@lovrabet/cli 1.1.12 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/api/api-doc-ui.js +1 -1
  5. package/lib/api/api-doc.js +1 -1
  6. package/lib/api/api-pull-ui.js +1 -1
  7. package/lib/api/fetch-datasets.js +1 -1
  8. package/lib/api/format-dataset.js +1 -1
  9. package/lib/api/generate-api-file.js +1 -1
  10. package/lib/api/main.js +1 -1
  11. package/lib/api/pull-silent.js +1 -1
  12. package/lib/api/pull.js +1 -1
  13. package/lib/auth/auth-server-ui.js +1 -1
  14. package/lib/auth/auth-server.js +1 -1
  15. package/lib/auth/constant.js +1 -1
  16. package/lib/auth/get-cookie.js +1 -1
  17. package/lib/auth/is-session-valid.js +1 -1
  18. package/lib/auth/logout.js +1 -1
  19. package/lib/cli.js +1 -1
  20. package/lib/cmd/build-watch.js +1 -1
  21. package/lib/cmd/build.js +1 -1
  22. package/lib/cmd/logs.js +1 -1
  23. package/lib/cmd/preview.js +1 -1
  24. package/lib/cmd/start.js +1 -1
  25. package/lib/config/config-help.js +1 -1
  26. package/lib/config/main.js +1 -1
  27. package/lib/constant/domain.js +1 -1
  28. package/lib/constant/env.js +1 -1
  29. package/lib/create-app/enhanced-guided-create.js +1 -1
  30. package/lib/create-app/format-elapsed.js +1 -1
  31. package/lib/create-app/main.js +1 -1
  32. package/lib/create-app/task-finished.js +1 -1
  33. package/lib/create-app/task-loading.js +1 -1
  34. package/lib/create-app/task-running.js +1 -1
  35. package/lib/create-app/task-time.js +1 -1
  36. package/lib/create-app/use-copy-project-template.js +1 -1
  37. package/lib/create-app/use-format-code.js +1 -1
  38. package/lib/create-app/use-install-dependencies.js +1 -1
  39. package/lib/help.js +1 -1
  40. package/lib/init/main.js +1 -1
  41. package/lib/utils/config.js +1 -1
  42. package/lib/utils/copy-directory.js +1 -1
  43. package/lib/utils/http-client.js +1 -1
  44. package/lib/utils/logger.js +1 -1
  45. package/lib/utils/router-updater.js +1 -1
  46. package/lib/utils/template-replacer.js +1 -1
  47. package/package.json +1 -1
  48. package/templates/projects/sub-app-react-demo/package-lock.json +18 -11
  49. package/templates/projects/sub-app-react-demo/package.json +1 -1
  50. package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +1 -10
  51. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +166 -2
  52. package/templates/projects/sub-app-react-demo/src/components/ApiUrlDisplay.tsx +0 -111
  53. package/templates/projects/sub-app-react-demo/src/pages/chart-fetch/index.tsx +0 -137
  54. package/templates/projects/sub-app-react-demo/src/pages/table-display.tsx +0 -130
@@ -1 +1 @@
1
- (function(_0x19e63a,_0x23b7cf){const _0x454efa=a0_0x58a8,_0x47fb7f=_0x19e63a();while(!![]){try{const _0x1f8ccd=-parseInt(_0x454efa(0x167))/0x1+parseInt(_0x454efa(0x16b))/0x2*(parseInt(_0x454efa(0x16f))/0x3)+-parseInt(_0x454efa(0x163))/0x4+parseInt(_0x454efa(0x174))/0x5*(parseInt(_0x454efa(0x178))/0x6)+-parseInt(_0x454efa(0x17f))/0x7+-parseInt(_0x454efa(0x164))/0x8*(parseInt(_0x454efa(0x176))/0x9)+parseInt(_0x454efa(0x171))/0xa*(parseInt(_0x454efa(0x161))/0xb);if(_0x1f8ccd===_0x23b7cf)break;else _0x47fb7f['push'](_0x47fb7f['shift']());}catch(_0x345cc1){_0x47fb7f['push'](_0x47fb7f['shift']());}}}(a0_0x1248,0xdf3b4));import{jsx as a0_0x50566a,jsxs as a0_0x1ea0ab}from'react/jsx-runtime';function a0_0x58a8(_0x4c99d1,_0x3c5d73){const _0x124897=a0_0x1248();return a0_0x58a8=function(_0x58a81e,_0x4e744d){_0x58a81e=_0x58a81e-0x15e;let _0x1e4a39=_0x124897[_0x58a81e];return _0x1e4a39;},a0_0x58a8(_0x4c99d1,_0x3c5d73);}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x2c74ab from'node:fs';function a0_0x1248(){const _0x142492=['gray','2193124uCyubW','8sufhNF','页面路由地址:\x20','路径不能包含连续的\x20/','486124jugTYW','slice','existsSync','startsWith','38pSMwVb','\x20Step2:\x20','red','return','244575LcgGaO','split','32899810ODDYtV','页面路径长度不能超过\x20100\x20个字符','trim','255JSrdBu','页面路径\x20','12797046eFsbAR','\x20直接回车确认,或输入自定义路由地址','14286HRZiKN','\x20←\x20','delete','length','endsWith','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','test','11128124HpRDnG','my-page','\x20已存在,请使用其他路径','路径不能以\x20/\x20开头或结尾','页面路径不合法','11ajKSHc'];a0_0x1248=function(){return _0x142492;};return a0_0x1248();}export function InputProjectCode(_0x59e1f5){const _0x25ea26=a0_0x58a8,{onSubmit:_0x54d3fa,pagePath:_0x5a7114}=_0x59e1f5,[_0x229ce8,_0x443e17]=useState(''),[_0x3cc50a,_0x502ba5]=useState(''),_0x47385a=_0x25ea26(0x180);function _0x3f2f13(_0x1129f5){const _0xc72aa4=_0x25ea26;if(_0x1129f5[_0xc72aa4(0x17b)]>0x64)return{'valid':![],'message':_0xc72aa4(0x172)};if(_0x1129f5[_0xc72aa4(0x16a)]('/')||_0x1129f5[_0xc72aa4(0x17c)]('/'))return{'valid':![],'message':_0xc72aa4(0x15f)};if(_0x1129f5['includes']('//'))return{'valid':![],'message':_0xc72aa4(0x166)};const _0x225573=_0x1129f5[_0xc72aa4(0x170)]('/');for(const _0x1480eb of _0x225573){if(!_0x1480eb)continue;const _0x57b597=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x57b597[_0xc72aa4(0x17e)](_0x1480eb))return{'valid':![],'message':_0xc72aa4(0x17d)};}return{'valid':!![]};}return useInput((_0x1a2517,_0x4f65b7)=>{const _0x90e582=_0x25ea26;if(_0x4f65b7[_0x90e582(0x16e)]){const _0x1195e2=_0x229ce8[_0x90e582(0x173)]()||_0x47385a;if(_0x3cc50a)return;const _0x4bb5b5=_0x5a7114+'/'+_0x1195e2;if(a0_0x2c74ab[_0x90e582(0x169)](_0x4bb5b5)){_0x502ba5(_0x90e582(0x175)+_0x1195e2+_0x90e582(0x15e));return;}_0x54d3fa(_0x1195e2),_0x443e17(''),_0x502ba5('');}else _0x4f65b7['backspace']||_0x4f65b7[_0x90e582(0x17a)]?_0x443e17(_0x36875b=>{const _0x1ab512=_0x90e582,_0x53208f=_0x36875b[_0x1ab512(0x168)](0x0,-0x1),{valid:_0x28cf2d,message:_0x2d8a54}=_0x3f2f13(_0x53208f);return _0x502ba5(_0x28cf2d?'':_0x2d8a54||_0x1ab512(0x160)),_0x53208f;}):_0x443e17(_0x5a3d6e=>{const _0x2855d9=_0x90e582,_0x47c834=_0x5a3d6e+_0x1a2517,{valid:_0x601bc4,message:_0x5d4ae2}=_0x3f2f13(_0x47c834);return _0x502ba5(_0x601bc4?'':_0x5d4ae2||_0x2855d9(0x160)),_0x47c834;});}),a0_0x1ea0ab(Box,{'flexDirection':'column','children':[a0_0x1ea0ab(Box,{'children':[a0_0x50566a(Text,{'color':_0x25ea26(0x162),'children':_0x25ea26(0x16c)}),a0_0x50566a(Text,{'children':_0x25ea26(0x165)}),_0x229ce8?a0_0x50566a(Text,{'color':'green','children':_0x229ce8}):a0_0x50566a(Text,{'color':_0x25ea26(0x162),'children':_0x47385a}),_0x3cc50a&&a0_0x1ea0ab(Text,{'color':_0x25ea26(0x16d),'children':[_0x25ea26(0x179),_0x3cc50a]})]}),!_0x3cc50a&&!_0x229ce8&&a0_0x50566a(Box,{'children':a0_0x50566a(Text,{'color':'gray','children':_0x25ea26(0x177)})})]});}
1
+ (function(_0x5235e9,_0xa1c5c4){const _0xd0afe4=a0_0xeaf6,_0x48dcdd=_0x5235e9();while(!![]){try{const _0x13d782=-parseInt(_0xd0afe4(0xe6))/0x1+parseInt(_0xd0afe4(0xee))/0x2*(parseInt(_0xd0afe4(0xf3))/0x3)+parseInt(_0xd0afe4(0xf0))/0x4*(-parseInt(_0xd0afe4(0xf6))/0x5)+parseInt(_0xd0afe4(0xed))/0x6+parseInt(_0xd0afe4(0xde))/0x7+parseInt(_0xd0afe4(0xe9))/0x8+parseInt(_0xd0afe4(0xe1))/0x9*(-parseInt(_0xd0afe4(0xf1))/0xa);if(_0x13d782===_0xa1c5c4)break;else _0x48dcdd['push'](_0x48dcdd['shift']());}catch(_0x38a02f){_0x48dcdd['push'](_0x48dcdd['shift']());}}}(a0_0x13c5,0x34fe4));import{jsx as a0_0x3f1160,jsxs as a0_0x36a705}from'react/jsx-runtime';function a0_0xeaf6(_0xd91bcb,_0x2ea65f){const _0x13c5be=a0_0x13c5();return a0_0xeaf6=function(_0xeaf6fe,_0x385de8){_0xeaf6fe=_0xeaf6fe-0xd8;let _0x121e0e=_0x13c5be[_0xeaf6fe];return _0x121e0e;},a0_0xeaf6(_0xd91bcb,_0x2ea65f);}import{useState}from'react';import{Text,Box,useInput}from'ink';function a0_0x13c5(){const _0xbaf06e=['\x20Step2:\x20','页面路由地址:\x20','slice','页面路径长度不能超过\x20100\x20个字符','2076522zEvVMl','test','column','45zmcLtR','路径不能包含连续的\x20/','页面路径不合法','backspace','delete','206870vEcsiC','includes','trim','1273712pWNzuF','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','length','split','1605810NRlGpe','180242opOmEC','页面路径\x20','4NgpJPf','627710wYpmMZ','my-page','3jCZECn','\x20已存在,请使用其他路径','gray','379155ANrVVk','startsWith','endsWith','return','\x20直接回车确认,或输入自定义路由地址','red'];a0_0x13c5=function(){return _0xbaf06e;};return a0_0x13c5();}import a0_0x5bec3f from'node:fs';export function InputProjectCode(_0x639177){const _0x3d9bc1=a0_0xeaf6,{onSubmit:_0x35a935,pagePath:_0x2a28dd}=_0x639177,[_0x635b46,_0x5b9807]=useState(''),[_0xe0ef5b,_0x51be0a]=useState(''),_0x4c3c69=_0x3d9bc1(0xf2);function _0x303e8a(_0x190881){const _0x5d9518=_0x3d9bc1;if(_0x190881[_0x5d9518(0xeb)]>0x64)return{'valid':![],'message':_0x5d9518(0xdd)};if(_0x190881[_0x5d9518(0xf7)]('/')||_0x190881[_0x5d9518(0xf8)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x190881[_0x5d9518(0xe7)]('//'))return{'valid':![],'message':_0x5d9518(0xe2)};const _0x5e1212=_0x190881[_0x5d9518(0xec)]('/');for(const _0x403e37 of _0x5e1212){if(!_0x403e37)continue;const _0x411381=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x411381[_0x5d9518(0xdf)](_0x403e37))return{'valid':![],'message':_0x5d9518(0xea)};}return{'valid':!![]};}return useInput((_0x509109,_0x293ee7)=>{const _0x2c2313=_0x3d9bc1;if(_0x293ee7[_0x2c2313(0xf9)]){const _0x5cba8e=_0x635b46[_0x2c2313(0xe8)]()||_0x4c3c69;if(_0xe0ef5b)return;const _0x465e2f=_0x2a28dd+'/'+_0x5cba8e;if(a0_0x5bec3f['existsSync'](_0x465e2f)){_0x51be0a(_0x2c2313(0xef)+_0x5cba8e+_0x2c2313(0xf4));return;}_0x35a935(_0x5cba8e),_0x5b9807(''),_0x51be0a('');}else _0x293ee7[_0x2c2313(0xe4)]||_0x293ee7[_0x2c2313(0xe5)]?_0x5b9807(_0x393c0e=>{const _0x50e1bc=_0x2c2313,_0x2775d9=_0x393c0e[_0x50e1bc(0xdc)](0x0,-0x1),{valid:_0x2744e7,message:_0x2d08cf}=_0x303e8a(_0x2775d9);return _0x51be0a(_0x2744e7?'':_0x2d08cf||'页面路径不合法'),_0x2775d9;}):_0x5b9807(_0x548157=>{const _0x23177b=_0x2c2313,_0x4d90ec=_0x548157+_0x509109,{valid:_0x43c54f,message:_0x371417}=_0x303e8a(_0x4d90ec);return _0x51be0a(_0x43c54f?'':_0x371417||_0x23177b(0xe3)),_0x4d90ec;});}),a0_0x36a705(Box,{'flexDirection':_0x3d9bc1(0xe0),'children':[a0_0x36a705(Box,{'children':[a0_0x3f1160(Text,{'color':_0x3d9bc1(0xf5),'children':_0x3d9bc1(0xda)}),a0_0x3f1160(Text,{'children':_0x3d9bc1(0xdb)}),_0x635b46?a0_0x3f1160(Text,{'color':'green','children':_0x635b46}):a0_0x3f1160(Text,{'color':_0x3d9bc1(0xf5),'children':_0x4c3c69}),_0xe0ef5b&&a0_0x36a705(Text,{'color':_0x3d9bc1(0xd9),'children':['\x20←\x20',_0xe0ef5b]})]}),!_0xe0ef5b&&!_0x635b46&&a0_0x3f1160(Box,{'children':a0_0x3f1160(Text,{'color':'gray','children':_0x3d9bc1(0xd8)})})]});}
@@ -1 +1 @@
1
- const a1_0x4a6e16=a1_0x4971;(function(_0x5e498f,_0x5a97b7){const _0x1068a0=a1_0x4971,_0x59f402=_0x5e498f();while(!![]){try{const _0x351eb2=parseInt(_0x1068a0(0x90))/0x1*(parseInt(_0x1068a0(0x94))/0x2)+-parseInt(_0x1068a0(0xb0))/0x3+-parseInt(_0x1068a0(0x9e))/0x4+parseInt(_0x1068a0(0xa9))/0x5*(-parseInt(_0x1068a0(0xa5))/0x6)+-parseInt(_0x1068a0(0xae))/0x7*(parseInt(_0x1068a0(0x95))/0x8)+-parseInt(_0x1068a0(0x97))/0x9+parseInt(_0x1068a0(0x98))/0xa;if(_0x351eb2===_0x5a97b7)break;else _0x59f402['push'](_0x59f402['shift']());}catch(_0x1525a0){_0x59f402['push'](_0x59f402['shift']());}}}(a1_0x370b,0x9c593));import{jsx as a1_0x524b9d,jsxs as a1_0x6aed03,Fragment as a1_0x486bfd}from'react/jsx-runtime';function a1_0x4971(_0x321923,_0x2a48f7){const _0x370b02=a1_0x370b();return a1_0x4971=function(_0x497194,_0x48cbc7){_0x497194=_0x497194-0x8f;let _0x131ac0=_0x370b02[_0x497194];return _0x131ac0;},a1_0x4971(_0x321923,_0x2a48f7);}import{fileURLToPath}from'node:url';import a1_0x4c4473 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';function a1_0x370b(){const _0x1ba7ed=['now','cyan','pages','1160392WItORo','已输入的页面路由\x20','add-page','\x20*\x20页面创建成功!','src','\x20*\x20页面文件已创建,可直接通过路由访问','error','6LOwwmd','green','已选择页面模板\x20','../../templates/pages','283810NYgyYG','resolve','页面添加失败:\x20','column','then','924knKMuP','gray','1056624rybLjg','cwd','9pLrEyt','开始添加页面:\x20','finally','\x20Step2:\x20','217178TCHLUB','8424cSXwzE','\x20*\x20路由地址:\x20','7701372hBStPb','13568740eofaJW','\x20*\x20页面路径:\x20','join'];a1_0x370b=function(){return _0x1ba7ed;};return a1_0x370b();}import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x4c4473['dirname'](fileURLToPath(import.meta['url'])),pageTemplateDir=a1_0x4c4473[a1_0x4a6e16(0xaa)](__dirname,a1_0x4a6e16(0xa8)),projectDir=process[a1_0x4a6e16(0x8f)]();export const AddPage=()=>{const _0x25a167=a1_0x4a6e16,{exit:_0x221e66}=useApp(),[_0x5d3048,_0x1f990e]=useState(''),[_0x4cdf2f,_0x3a9ec5]=useState(''),[_0x66f22c,_0x26e151]=useState(![]),[_0x402ce5,_0x22be95]=useState(![]),_0x73bb7a=a1_0x4c4473[_0x25a167(0x9a)](projectDir,_0x25a167(0xa2),'pages'),_0x3ba76a=a1_0x4c4473[_0x25a167(0x9a)](_0x73bb7a,_0x4cdf2f),_0x478bba=a1_0x4c4473[_0x25a167(0x9a)](_0x25a167(0xa2),_0x25a167(0x9d),_0x4cdf2f);useEffect(()=>{const _0x52ebb7=_0x25a167,_0x5522ab=a1_0x4c4473[_0x52ebb7(0xaa)](pageTemplateDir,_0x5d3048);if(_0x5d3048&&_0x4cdf2f){_0x26e151(!![]),logger['setLogPath'](process[_0x52ebb7(0x8f)]());const _0x3ec230=Date['now']();logger['info'](_0x52ebb7(0xa0),_0x52ebb7(0x91)+_0x4cdf2f,{'template':_0x5d3048,'targetPath':_0x478bba}),TemplateReplacer['processTemplate'](_0x5522ab,a1_0x4c4473[_0x52ebb7(0x9a)](_0x73bb7a,_0x4cdf2f),_0x4cdf2f,_0x5d3048)[_0x52ebb7(0xad)](()=>{const _0x2e0923=_0x52ebb7,_0x22efe9=Date[_0x2e0923(0x9b)]()-_0x3ec230;logger['success']('add-page','页面添加成功:\x20'+_0x4cdf2f,_0x22efe9,{'template':_0x5d3048,'targetPath':_0x478bba,'routePath':_0x4cdf2f}),_0x22be95(!![]);})['catch'](_0x5b4937=>{const _0x2452e1=_0x52ebb7,_0x128cf3=Date[_0x2452e1(0x9b)]()-_0x3ec230;logger[_0x2452e1(0xa4)]('add-page',_0x2452e1(0xab)+_0x4cdf2f,{'template':_0x5d3048,'targetPath':_0x478bba,'error':_0x5b4937 instanceof Error?_0x5b4937['message']:String(_0x5b4937),'duration':_0x128cf3});})[_0x52ebb7(0x92)](()=>{_0x26e151(![]);});}},[_0x5d3048,_0x4cdf2f]),useEffect(()=>{_0x402ce5&&setTimeout(()=>{_0x221e66();});},[_0x402ce5]);if(_0x5d3048)return a1_0x6aed03(Box,{'flexDirection':_0x25a167(0xac),'paddingY':0x1,'children':[a1_0x6aed03(Box,{'children':[a1_0x524b9d(Text,{'color':_0x25a167(0xaf),'children':'\x20Step1:\x20'}),a1_0x524b9d(Text,{'children':_0x25a167(0xa7)}),a1_0x524b9d(Text,{'color':_0x25a167(0xa6),'children':_0x5d3048})]}),_0x4cdf2f?a1_0x6aed03(Box,{'children':[a1_0x524b9d(Text,{'color':_0x25a167(0xaf),'children':_0x25a167(0x93)}),a1_0x524b9d(Text,{'children':_0x25a167(0x9f)}),a1_0x524b9d(Text,{'color':'green','children':_0x4cdf2f})]}):a1_0x524b9d(InputProjectCode,{'pagePath':_0x3ba76a,'onSubmit':_0x3a9ec5}),_0x4cdf2f&&_0x66f22c?a1_0x6aed03(Box,{'marginTop':0x1,'children':[a1_0x524b9d(Box,{'width':'4'}),a1_0x524b9d(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x402ce5?a1_0x6aed03(a1_0x486bfd,{'children':[a1_0x524b9d(Box,{'marginTop':0x1,'children':a1_0x524b9d(Text,{'color':_0x25a167(0xaf),'children':_0x25a167(0xa1)})}),a1_0x6aed03(Box,{'children':[a1_0x524b9d(Text,{'color':'gray','children':_0x25a167(0x99)}),a1_0x524b9d(Text,{'color':_0x25a167(0xa6),'children':_0x478bba})]}),a1_0x6aed03(Box,{'children':[a1_0x524b9d(Text,{'color':_0x25a167(0xaf),'children':_0x25a167(0x96)}),a1_0x6aed03(Text,{'color':_0x25a167(0xa6),'children':['/',_0x4cdf2f]})]}),a1_0x524b9d(Box,{'marginTop':0x1,'children':a1_0x524b9d(Text,{'color':_0x25a167(0x9c),'children':_0x25a167(0xa3)})})]}):null]});return a1_0x524b9d(SelectPageTemplate,{'onSelect':_0x1f990e});};
1
+ const a1_0x1a5819=a1_0xd114;(function(_0x44ca56,_0x35a706){const _0x74cdcc=a1_0xd114,_0x2b270d=_0x44ca56();while(!![]){try{const _0x4755b6=parseInt(_0x74cdcc(0x7b))/0x1*(parseInt(_0x74cdcc(0x82))/0x2)+-parseInt(_0x74cdcc(0x7f))/0x3+-parseInt(_0x74cdcc(0x94))/0x4*(-parseInt(_0x74cdcc(0x87))/0x5)+parseInt(_0x74cdcc(0x88))/0x6+parseInt(_0x74cdcc(0x8d))/0x7+-parseInt(_0x74cdcc(0x92))/0x8*(-parseInt(_0x74cdcc(0x77))/0x9)+-parseInt(_0x74cdcc(0x76))/0xa;if(_0x4755b6===_0x35a706)break;else _0x2b270d['push'](_0x2b270d['shift']());}catch(_0x1846a0){_0x2b270d['push'](_0x2b270d['shift']());}}}(a1_0xdba8,0xd8524));function a1_0xdba8(){const _0x56d307=['\x20*\x20页面创建成功!','finally','processTemplate','1822689kPFHdg','join','src','133662xNLfnb','pages','页面添加失败:\x20','add-page','then','102980YWRpGj','9928050MGUIff','setLogPath','已输入的页面路由\x20','\x20*\x20路由地址:\x20','cyan','5990166YoLOVw','\x20*\x20页面路径:\x20','green','\x20*\x20页面文件已创建,可直接通过路由访问','message','31240rTTdaO','now','20jxXsmY','info','cwd','column','开始添加页面:\x20','resolve','success','url','26094760lcavrm','1431WfSMiX','error','gray','正在创建页面,请稍候…','13dIBydv'];a1_0xdba8=function(){return _0x56d307;};return a1_0xdba8();}import{jsx as a1_0x264336,jsxs as a1_0x3cab27,Fragment as a1_0xbb3259}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x5f989b from'node:path';import{useEffect,useState}from'react';function a1_0xd114(_0x40af9c,_0x2e4580){const _0xdba8b6=a1_0xdba8();return a1_0xd114=function(_0xd11428,_0x35a65e){_0xd11428=_0xd11428-0x73;let _0x5c0d8b=_0xdba8b6[_0xd11428];return _0x5c0d8b;},a1_0xd114(_0x40af9c,_0x2e4580);}import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x5f989b['dirname'](fileURLToPath(import.meta[a1_0x1a5819(0x75)])),pageTemplateDir=a1_0x5f989b[a1_0x1a5819(0x73)](__dirname,'../../templates/pages'),projectDir=process[a1_0x1a5819(0x96)]();export const AddPage=()=>{const _0x50e1de=a1_0x1a5819,{exit:_0x1a7aa4}=useApp(),[_0x33b633,_0x4e57ba]=useState(''),[_0x295544,_0x504257]=useState(''),[_0x5488a5,_0x2a5672]=useState(![]),[_0x245407,_0x38f8fd]=useState(![]),_0x3f50b2=a1_0x5f989b[_0x50e1de(0x80)](projectDir,_0x50e1de(0x81),_0x50e1de(0x83)),_0xe5fe96=a1_0x5f989b['join'](_0x3f50b2,_0x295544),_0x19d039=a1_0x5f989b[_0x50e1de(0x80)](_0x50e1de(0x81),_0x50e1de(0x83),_0x295544);useEffect(()=>{const _0x310703=_0x50e1de,_0x178ece=a1_0x5f989b[_0x310703(0x73)](pageTemplateDir,_0x33b633);if(_0x33b633&&_0x295544){_0x2a5672(!![]),logger[_0x310703(0x89)](process[_0x310703(0x96)]());const _0x9ea070=Date['now']();logger[_0x310703(0x95)](_0x310703(0x85),_0x310703(0x98)+_0x295544,{'template':_0x33b633,'targetPath':_0x19d039}),TemplateReplacer[_0x310703(0x7e)](_0x178ece,a1_0x5f989b[_0x310703(0x80)](_0x3f50b2,_0x295544),_0x295544,_0x33b633)[_0x310703(0x86)](()=>{const _0x5cf90f=_0x310703,_0x4f8ad2=Date[_0x5cf90f(0x93)]()-_0x9ea070;logger[_0x5cf90f(0x74)](_0x5cf90f(0x85),'页面添加成功:\x20'+_0x295544,_0x4f8ad2,{'template':_0x33b633,'targetPath':_0x19d039,'routePath':_0x295544}),_0x38f8fd(!![]);})['catch'](_0x216338=>{const _0x289668=_0x310703,_0x4a8442=Date[_0x289668(0x93)]()-_0x9ea070;logger[_0x289668(0x78)](_0x289668(0x85),_0x289668(0x84)+_0x295544,{'template':_0x33b633,'targetPath':_0x19d039,'error':_0x216338 instanceof Error?_0x216338[_0x289668(0x91)]:String(_0x216338),'duration':_0x4a8442});})[_0x310703(0x7d)](()=>{_0x2a5672(![]);});}},[_0x33b633,_0x295544]),useEffect(()=>{_0x245407&&setTimeout(()=>{_0x1a7aa4();});},[_0x245407]);if(_0x33b633)return a1_0x3cab27(Box,{'flexDirection':_0x50e1de(0x97),'paddingY':0x1,'children':[a1_0x3cab27(Box,{'children':[a1_0x264336(Text,{'color':_0x50e1de(0x79),'children':'\x20Step1:\x20'}),a1_0x264336(Text,{'children':'已选择页面模板\x20'}),a1_0x264336(Text,{'color':_0x50e1de(0x8f),'children':_0x33b633})]}),_0x295544?a1_0x3cab27(Box,{'children':[a1_0x264336(Text,{'color':'gray','children':'\x20Step2:\x20'}),a1_0x264336(Text,{'children':_0x50e1de(0x8a)}),a1_0x264336(Text,{'color':_0x50e1de(0x8f),'children':_0x295544})]}):a1_0x264336(InputProjectCode,{'pagePath':_0xe5fe96,'onSubmit':_0x504257}),_0x295544&&_0x5488a5?a1_0x3cab27(Box,{'marginTop':0x1,'children':[a1_0x264336(Box,{'width':'4'}),a1_0x264336(Text,{'children':_0x50e1de(0x7a)})]}):null,_0x245407?a1_0x3cab27(a1_0xbb3259,{'children':[a1_0x264336(Box,{'marginTop':0x1,'children':a1_0x264336(Text,{'color':_0x50e1de(0x79),'children':_0x50e1de(0x7c)})}),a1_0x3cab27(Box,{'children':[a1_0x264336(Text,{'color':_0x50e1de(0x79),'children':_0x50e1de(0x8e)}),a1_0x264336(Text,{'color':_0x50e1de(0x8f),'children':_0x19d039})]}),a1_0x3cab27(Box,{'children':[a1_0x264336(Text,{'color':_0x50e1de(0x79),'children':_0x50e1de(0x8b)}),a1_0x3cab27(Text,{'color':_0x50e1de(0x8f),'children':['/',_0x295544]})]}),a1_0x264336(Box,{'marginTop':0x1,'children':a1_0x264336(Text,{'color':_0x50e1de(0x8c),'children':_0x50e1de(0x90)})})]}):null]});return a1_0x264336(SelectPageTemplate,{'onSelect':_0x4e57ba});};
@@ -1 +1 @@
1
- function a2_0x1a7a(_0x57ac3b,_0x4b54d3){const _0x932419=a2_0x9324();return a2_0x1a7a=function(_0x1a7a66,_0x4f925a){_0x1a7a66=_0x1a7a66-0x15d;let _0x26068f=_0x932419[_0x1a7a66];return _0x26068f;},a2_0x1a7a(_0x57ac3b,_0x4b54d3);}(function(_0x5bce0e,_0x793ec2){const _0xc2a239=a2_0x1a7a,_0x7ad7de=_0x5bce0e();while(!![]){try{const _0x579ef6=-parseInt(_0xc2a239(0x164))/0x1*(parseInt(_0xc2a239(0x17f))/0x2)+-parseInt(_0xc2a239(0x167))/0x3*(-parseInt(_0xc2a239(0x16b))/0x4)+parseInt(_0xc2a239(0x166))/0x5+parseInt(_0xc2a239(0x161))/0x6+parseInt(_0xc2a239(0x174))/0x7+-parseInt(_0xc2a239(0x181))/0x8*(parseInt(_0xc2a239(0x160))/0x9)+-parseInt(_0xc2a239(0x15d))/0xa*(parseInt(_0xc2a239(0x16f))/0xb);if(_0x579ef6===_0x793ec2)break;else _0x7ad7de['push'](_0x7ad7de['shift']());}catch(_0xf010df){_0x7ad7de['push'](_0x7ad7de['shift']());}}}(a2_0x9324,0xead81));import{jsx as a2_0x4d96a7,jsxs as a2_0x27db4f}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';function a2_0x9324(){const _0x2ab027=['blank','8996695wAdzov','5389656JXxFsj','join','error','resolve','4kJjrXC','name','gray','onSelect','22ggjAfI','map','sort','dirname','请选择您要创建的页面模板','10751118ZgZBre','../..','downArrow','length','正在加载页面模板...','green','获取模板列表失败:','column','isDirectory','\x20\x20\x20\x20\x20\x20\x20\x20','templates/pages','194QAvblc','return','184ZMFDeh','17798020SqWEch','url','localeCompare','736254PdTulw','11093016uqaygK','label','\x20Step1:\x20','5954CVDmWc'];a2_0x9324=function(){return _0x2ab027;};return a2_0x9324();}import a2_0x529a3a from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x2c4e74=a2_0x1a7a;try{const _0x11010c=fileURLToPath(import.meta[_0x2c4e74(0x15e)]),_0x3a020c=a2_0x529a3a[_0x2c4e74(0x16a)](a2_0x529a3a[_0x2c4e74(0x172)](_0x11010c),_0x2c4e74(0x175)),_0x379b85=a2_0x529a3a[_0x2c4e74(0x168)](_0x3a020c,_0x2c4e74(0x17e)),_0x45e910=await readdir(_0x379b85,{'withFileTypes':!![]}),_0x7119b3=_0x45e910['filter'](_0x2cc85a=>_0x2cc85a[_0x2c4e74(0x17c)]())[_0x2c4e74(0x170)](_0x524b8d=>({'label':_0x524b8d[_0x2c4e74(0x16c)]}))[_0x2c4e74(0x171)]((_0x233925,_0x3fe5f0)=>_0x233925[_0x2c4e74(0x162)][_0x2c4e74(0x15f)](_0x3fe5f0[_0x2c4e74(0x162)]));return _0x7119b3;}catch(_0x54c524){return console[_0x2c4e74(0x169)](_0x2c4e74(0x17a),_0x54c524),[{'label':_0x2c4e74(0x165)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x41f6d9){const _0x50260c=a2_0x1a7a,[_0x3b5caf,_0xcc210c]=useState(0x0),[_0x20cd1b,_0x4cd2d4]=useState([]),[_0x497ce0,_0x1aa78d]=useState(!![]);useEffect(()=>{async function _0x56dc19(){const _0x12873c=await getTemplateList();_0x4cd2d4(_0x12873c),_0x1aa78d(![]);}_0x56dc19();},[]),useInput((_0x4da256,_0x5f4ae1)=>{const _0x4fb895=a2_0x1a7a;if(_0x497ce0)return;if(_0x5f4ae1[_0x4fb895(0x180)]){const _0x3eb6da=_0x20cd1b[_0x3b5caf];_0x3eb6da&&_0x41f6d9[_0x4fb895(0x16e)](_0x3eb6da[_0x4fb895(0x162)]);}_0x5f4ae1['upArrow']&&_0xcc210c(_0x534a40=>_0x534a40===0x0?_0x20cd1b[_0x4fb895(0x177)]-0x1:_0x534a40-0x1),_0x5f4ae1[_0x4fb895(0x176)]&&_0xcc210c(_0x15fb4e=>_0x15fb4e===_0x20cd1b[_0x4fb895(0x177)]-0x1?0x0:_0x15fb4e+0x1);});if(_0x497ce0)return a2_0x4d96a7(Box,{'flexDirection':_0x50260c(0x17b),'paddingY':0x1,'children':a2_0x27db4f(Box,{'children':[a2_0x4d96a7(Text,{'color':'gray','children':_0x50260c(0x163)}),a2_0x4d96a7(Text,{'children':_0x50260c(0x178)})]})});return a2_0x27db4f(Box,{'flexDirection':_0x50260c(0x17b),'paddingY':0x1,'children':[a2_0x27db4f(Box,{'children':[a2_0x4d96a7(Text,{'color':_0x50260c(0x16d),'children':_0x50260c(0x163)}),a2_0x4d96a7(Text,{'children':_0x50260c(0x173)})]}),_0x20cd1b[_0x50260c(0x170)]((_0x12e997,_0x588773)=>{const _0x59dd05=_0x50260c,_0x4884ab=_0x588773===_0x3b5caf,_0x2a8510=_0x4884ab?'\x20\x20\x20\x20\x20\x20>\x20'+_0x12e997[_0x59dd05(0x162)]:_0x59dd05(0x17d)+_0x12e997[_0x59dd05(0x162)];return a2_0x4d96a7(Box,{'children':a2_0x4d96a7(Text,{'color':_0x4884ab?_0x59dd05(0x179):undefined,'children':_0x2a8510})},_0x2a8510);})]});}
1
+ (function(_0x293a04,_0x2345c1){const _0x4bba37=a2_0x21df,_0x39ec3e=_0x293a04();while(!![]){try{const _0x3560e3=-parseInt(_0x4bba37(0x1f5))/0x1+parseInt(_0x4bba37(0x1f4))/0x2+parseInt(_0x4bba37(0x200))/0x3*(-parseInt(_0x4bba37(0x205))/0x4)+-parseInt(_0x4bba37(0x1f3))/0x5+-parseInt(_0x4bba37(0x1fe))/0x6+parseInt(_0x4bba37(0x1fb))/0x7*(parseInt(_0x4bba37(0x209))/0x8)+parseInt(_0x4bba37(0x20e))/0x9;if(_0x3560e3===_0x2345c1)break;else _0x39ec3e['push'](_0x39ec3e['shift']());}catch(_0x4c0b89){_0x39ec3e['push'](_0x39ec3e['shift']());}}}(a2_0x7cc4,0x4bc23));import{jsx as a2_0x561a11,jsxs as a2_0x4c25d2}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';function a2_0x7cc4(){const _0x421c32=['filter','return','../..','2672820IBZtQm','url','name','column','\x20\x20\x20\x20\x20\x20>\x20','resolve','blank','1115990lJqIJd','1219350NOaqtn','64444JkQvEG','isDirectory','label','length','downArrow','onSelect','1299515IpmyNy','upArrow','green','2718018WxoNwo','dirname','3cGppQT','\x20Step1:\x20','获取模板列表失败:','join','sort','165392uULwnP','gray','请选择您要创建的页面模板','sdk-fetch','8aFoykh','map'];a2_0x7cc4=function(){return _0x421c32;};return a2_0x7cc4();}import a2_0x16b5ad from'node:path';function a2_0x21df(_0xf7789,_0x247307){const _0x7cc495=a2_0x7cc4();return a2_0x21df=function(_0x21dfce,_0x314c71){_0x21dfce=_0x21dfce-0x1ee;let _0x506b84=_0x7cc495[_0x21dfce];return _0x506b84;},a2_0x21df(_0xf7789,_0x247307);}import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x425c2a=a2_0x21df;try{const _0x36ab91=fileURLToPath(import.meta[_0x425c2a(0x20f)]),_0x502713=a2_0x16b5ad[_0x425c2a(0x1f1)](a2_0x16b5ad[_0x425c2a(0x1ff)](_0x36ab91),_0x425c2a(0x20d)),_0x583bed=a2_0x16b5ad[_0x425c2a(0x203)](_0x502713,'templates/pages'),_0xe98cd8=await readdir(_0x583bed,{'withFileTypes':!![]}),_0x4f97f0=_0xe98cd8[_0x425c2a(0x20b)](_0x66d7b3=>_0x66d7b3[_0x425c2a(0x1f6)]())[_0x425c2a(0x20a)](_0x58bcdb=>({'label':_0x58bcdb[_0x425c2a(0x1ee)]}))[_0x425c2a(0x204)]((_0x46a14c,_0x1d6b4a)=>_0x46a14c[_0x425c2a(0x1f7)]['localeCompare'](_0x1d6b4a[_0x425c2a(0x1f7)]));return _0x4f97f0;}catch(_0x2d07c3){return console['error'](_0x425c2a(0x202),_0x2d07c3),[{'label':_0x425c2a(0x1f2)},{'label':_0x425c2a(0x208)}];}}export function SelectPageTemplate(_0x217c35){const _0x45e96c=a2_0x21df,[_0x1f54f9,_0x40ee3a]=useState(0x0),[_0x382322,_0x23b5ea]=useState([]),[_0x529bb2,_0xc36969]=useState(!![]);useEffect(()=>{async function _0x5aa3ac(){const _0x209a86=await getTemplateList();_0x23b5ea(_0x209a86),_0xc36969(![]);}_0x5aa3ac();},[]),useInput((_0x1777d0,_0x178930)=>{const _0x2705ef=a2_0x21df;if(_0x529bb2)return;if(_0x178930[_0x2705ef(0x20c)]){const _0x13d4e4=_0x382322[_0x1f54f9];_0x13d4e4&&_0x217c35[_0x2705ef(0x1fa)](_0x13d4e4[_0x2705ef(0x1f7)]);}_0x178930[_0x2705ef(0x1fc)]&&_0x40ee3a(_0x4afa3b=>_0x4afa3b===0x0?_0x382322[_0x2705ef(0x1f8)]-0x1:_0x4afa3b-0x1),_0x178930[_0x2705ef(0x1f9)]&&_0x40ee3a(_0x19a0a5=>_0x19a0a5===_0x382322['length']-0x1?0x0:_0x19a0a5+0x1);});if(_0x529bb2)return a2_0x561a11(Box,{'flexDirection':_0x45e96c(0x1ef),'paddingY':0x1,'children':a2_0x4c25d2(Box,{'children':[a2_0x561a11(Text,{'color':_0x45e96c(0x206),'children':_0x45e96c(0x201)}),a2_0x561a11(Text,{'children':'正在加载页面模板...'})]})});return a2_0x4c25d2(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x4c25d2(Box,{'children':[a2_0x561a11(Text,{'color':_0x45e96c(0x206),'children':_0x45e96c(0x201)}),a2_0x561a11(Text,{'children':_0x45e96c(0x207)})]}),_0x382322[_0x45e96c(0x20a)]((_0x41e9e4,_0x25c026)=>{const _0x4ee1b8=_0x45e96c,_0x501a78=_0x25c026===_0x1f54f9,_0x48d9ea=_0x501a78?_0x4ee1b8(0x1f0)+_0x41e9e4[_0x4ee1b8(0x1f7)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x41e9e4['label'];return a2_0x561a11(Box,{'children':a2_0x561a11(Text,{'color':_0x501a78?_0x4ee1b8(0x1fd):undefined,'children':_0x48d9ea})},_0x48d9ea);})]});}
@@ -1 +1 @@
1
- (function(_0x219835,_0x272440){const _0x197e3f=a3_0x12c2,_0xa91f27=_0x219835();while(!![]){try{const _0x5eb629=-parseInt(_0x197e3f(0xc0))/0x1+-parseInt(_0x197e3f(0xed))/0x2*(parseInt(_0x197e3f(0xcd))/0x3)+parseInt(_0x197e3f(0xe9))/0x4*(-parseInt(_0x197e3f(0xc1))/0x5)+parseInt(_0x197e3f(0xdb))/0x6+parseInt(_0x197e3f(0xf1))/0x7*(parseInt(_0x197e3f(0xe0))/0x8)+parseInt(_0x197e3f(0xc6))/0x9+parseInt(_0x197e3f(0xeb))/0xa*(parseInt(_0x197e3f(0xde))/0xb);if(_0x5eb629===_0x272440)break;else _0xa91f27['push'](_0xa91f27['shift']());}catch(_0xf0f112){_0xa91f27['push'](_0xa91f27['shift']());}}}(a3_0x3a48,0x51650));import{jsx as a3_0x184e34,jsxs as a3_0x32646d,Fragment as a3_0x22e0c5}from'react/jsx-runtime';function a3_0x3a48(){const _0x4dc8eb=['string','√\x20文档生成完成!成功\x20','white','dim','4964004AsvTOk',',\x20失败\x20','cyan','.md\x20(','map','join','includes','1345053BKfNub','未找到任何数据集','length','*\x20输出目录:\x20','\x1b[0m','datasetCode','success','env','🚀\x20','使用指定的应用AppCode:\x20','api-doc','red','未提供应用AppCode,且配置中也没有默认值','setLogPath','2526042ezsJAn','!\x20原始数据集\x20','\x1b[90m*\x20从\x20','684838uLxGXH','column','24DakhMA','\x20(环境:\x20','code','lovrabet\x20auth','log','💡\x20请使用\x20','online','filter','正在获取数据集列表...','5372FnrWeH','datasetName','130GPsGhL','\x1b[33m!\x20以下数据集代码不存在:\x20','2qIWAlu','正在生成\x20','error','文档生成失败:\x20','269598lTsGTq','message','gray','\x20个,过滤重复','cwd','*\x20生成的文档文件:','指定的数据集代码都不存在:\x20','\x20重新登录后再试','\x20个数据集中筛选出\x20','使用配置的应用AppCode:\x20','yellow','duplicateCount','⚠️\x20以下数据集生成失败:','534197GtMiFD','2165wHciVD'];a3_0x3a48=function(){return _0x4dc8eb;};return a3_0x3a48();}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a3_0x12c2(_0x24ec03,_0x224a71){const _0x3a4803=a3_0x3a48();return a3_0x12c2=function(_0x12c266,_0x8a5d2d){_0x12c266=_0x12c266-0xb8;let _0x353d0a=_0x3a4803[_0x12c266];return _0x353d0a;},a3_0x12c2(_0x24ec03,_0x224a71);}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:_0x5ba1f9,env:_0x4a9959,output:_0x2ecdba,extraParams:_0x224f4b,datasetCodes:_0x4983c0})=>{const _0x5e279e=a3_0x12c2,{exit:_0x51709a}=useApp(),[_0x4a8704,_0x4164de]=useState(![]),[_0x56a8df,_0x3c95ad]=useState(''),[_0x5c7731,_0x31f3a6]=useState(![]),[_0x5b4c4c,_0x23d1ce]=useState(null),[_0x129a53,_0x269f83]=useState(null),[_0x4f7456,_0x435598]=useState(null),_0x3c9e89=readConfig(),_0x1c4405=getConfigAppCode(),_0x218fc0=_0x5ba1f9||_0x1c4405,_0x29272a=typeof _0x3c9e89?.[_0x5e279e(0xd4)]===_0x5e279e(0xc2)?_0x3c9e89['env']:undefined,_0x2c6335=_0x4a9959||_0x29272a||_0x5e279e(0xe6);initEnv(_0x2c6335);const _0x2df1e1=_0x2ecdba||'./docs',_0x1a3416=_0x5ba1f9?_0x5e279e(0xd6)+_0x218fc0:_0x5e279e(0xbc)+_0x218fc0;useEffect(()=>{_0x4164de(!![]),_0x49270();},[]),useEffect(()=>{(_0x5c7731||_0x5b4c4c)&&_0x51709a();},[_0x5c7731,_0x5b4c4c,_0x51709a]);async function _0x49270(){const _0x32452a=_0x5e279e;if(!_0x218fc0){_0x23d1ce(_0x32452a(0xd9));return;}try{logger[_0x32452a(0xda)](process[_0x32452a(0xf5)]()),_0x3c95ad(_0x32452a(0xe8));const {rawData:_0x27f60e,originalCount:_0x11c8e2,filteredCount:_0x317d55,duplicateCount:_0x8e24d6}=await fetchDatasets(_0x218fc0);_0x435598({'originalCount':_0x11c8e2,'filteredCount':_0x317d55,'duplicateCount':_0x8e24d6});if(_0x27f60e[_0x32452a(0xcf)]===0x0){_0x23d1ce(_0x32452a(0xce));return;}let _0x130113=_0x27f60e;if(_0x4983c0&&_0x4983c0[_0x32452a(0xcf)]>0x0){_0x130113=_0x27f60e[_0x32452a(0xe7)](_0x1fbafc=>_0x4983c0[_0x32452a(0xcc)](_0x1fbafc[_0x32452a(0xe2)]));const _0x4ca561=_0x130113[_0x32452a(0xca)](_0x3bc836=>_0x3bc836[_0x32452a(0xe2)]),_0x253848=_0x4983c0['filter'](_0x2e387c=>!_0x4ca561[_0x32452a(0xcc)](_0x2e387c));_0x253848[_0x32452a(0xcf)]>0x0&&console[_0x32452a(0xe4)](_0x32452a(0xec)+_0x253848[_0x32452a(0xcb)](',\x20')+_0x32452a(0xd1));if(_0x130113['length']===0x0){_0x23d1ce(_0x32452a(0xb9)+_0x4983c0[_0x32452a(0xcb)](',\x20'));return;}console['log'](_0x32452a(0xdd)+_0x27f60e[_0x32452a(0xcf)]+_0x32452a(0xbb)+_0x130113[_0x32452a(0xcf)]+'\x20个匹配的数据集\x1b[0m');}_0x3c95ad(_0x32452a(0xee)+_0x130113['length']+'\x20个数据集的文档...');const _0x3a259c=await generateDatasetDocs(_0x130113,_0x218fc0,_0x2df1e1,(_0x17ca90,_0x280fe5,_0x4e068a)=>{const _0x433203=_0x32452a;_0x3c95ad(_0x433203(0xee)+_0x4e068a+_0x433203(0xc9)+_0x17ca90+'/'+_0x280fe5+')');},_0x224f4b);_0x269f83(_0x3a259c),_0x31f3a6(!![]);const _0xc25da7=_0x3a259c[_0x32452a(0xe7)](_0x223f71=>_0x223f71[_0x32452a(0xd3)])[_0x32452a(0xcf)],_0x244897=_0x3a259c[_0x32452a(0xe7)](_0x57dcef=>!_0x57dcef[_0x32452a(0xd3)])[_0x32452a(0xcf)];logger[_0x32452a(0xd3)]('api-doc','文档生成完成',undefined,{'totalCount':_0x3a259c[_0x32452a(0xcf)],'successCount':_0xc25da7,'failCount':_0x244897,'outputDir':_0x2df1e1});}catch(_0x1e93ed){const _0x4d8f6f=_0x1e93ed instanceof Error?_0x1e93ed[_0x32452a(0xf2)]:String(_0x1e93ed);logger[_0x32452a(0xef)](_0x32452a(0xd7),'文档生成失败:\x20'+_0x4d8f6f,{'appCode':_0x218fc0,'outputDir':_0x2df1e1}),_0x23d1ce(_0x32452a(0xf0)+_0x4d8f6f);}finally{_0x4164de(![]);}}const _0x573a53=_0x129a53?.['filter'](_0x1217ee=>_0x1217ee[_0x5e279e(0xd3)])[_0x5e279e(0xcf)]||0x0,_0x54e9b1=_0x129a53?.[_0x5e279e(0xe7)](_0x4eb50a=>!_0x4eb50a['success'])[_0x5e279e(0xcf)]||0x0;return a3_0x32646d(Box,{'flexDirection':_0x5e279e(0xdf),'children':[(_0x4a8704||_0x5c7731)&&a3_0x32646d(Box,{'children':[a3_0x184e34(Text,{'color':_0x5e279e(0xf3),'children':'*\x20'}),a3_0x184e34(Text,{'color':_0x5ba1f9?_0x5e279e(0xc4):'dim','children':_0x1a3416})]}),_0x4a8704&&a3_0x184e34(Box,{'children':a3_0x32646d(Text,{'children':[_0x5e279e(0xd5),_0x56a8df,_0x5e279e(0xe1),_0x2c6335,')']})}),_0x5c7731&&_0x129a53&&_0x4f7456&&a3_0x32646d(Box,{'flexDirection':'column','children':[a3_0x184e34(Box,{'children':a3_0x32646d(Text,{'color':'green','children':[_0x5e279e(0xc3),_0x573a53,'\x20个',_0x54e9b1>0x0&&_0x5e279e(0xc7)+_0x54e9b1+'\x20个']})}),_0x4f7456['duplicateCount']>0x0&&a3_0x184e34(Box,{'marginTop':0x1,'children':a3_0x32646d(Text,{'color':_0x5e279e(0xbd),'children':[_0x5e279e(0xdc),_0x4f7456['originalCount'],_0x5e279e(0xf4),'\x20',_0x4f7456[_0x5e279e(0xbe)],'\x20个']})}),a3_0x32646d(Box,{'marginTop':0x1,'children':[a3_0x184e34(Text,{'color':'gray','children':_0x5e279e(0xd0)}),a3_0x184e34(Text,{'color':'cyan','children':_0x2df1e1})]}),_0x573a53>0x0&&a3_0x32646d(a3_0x22e0c5,{'children':[a3_0x184e34(Box,{'marginTop':0x1,'children':a3_0x184e34(Text,{'color':_0x5e279e(0xf3),'children':_0x5e279e(0xb8)})}),_0x129a53[_0x5e279e(0xe7)](_0x251497=>_0x251497['success'])[_0x5e279e(0xca)]((_0x21a240,_0x2abd4d)=>a3_0x32646d(Box,{'marginLeft':0x2,'children':[a3_0x32646d(Text,{'color':_0x5e279e(0xc8),'children':['•\x20',_0x21a240['filePath']]}),a3_0x32646d(Text,{'color':_0x5e279e(0xc5),'children':['\x20-\x20',_0x21a240[_0x5e279e(0xea)]]})]},_0x2abd4d))]}),_0x54e9b1>0x0&&a3_0x32646d(a3_0x22e0c5,{'children':[a3_0x184e34(Box,{'marginTop':0x1,'children':a3_0x184e34(Text,{'color':_0x5e279e(0xbd),'children':_0x5e279e(0xbf)})}),_0x129a53['filter'](_0x23e281=>!_0x23e281[_0x5e279e(0xd3)])[_0x5e279e(0xca)]((_0x366601,_0x3d2577)=>a3_0x32646d(Box,{'marginLeft':0x2,'flexDirection':_0x5e279e(0xdf),'children':[a3_0x32646d(Text,{'color':_0x5e279e(0xd8),'children':['•\x20',_0x366601[_0x5e279e(0xea)],'\x20(',_0x366601[_0x5e279e(0xd2)],')']}),_0x366601[_0x5e279e(0xef)]&&a3_0x184e34(Box,{'marginLeft':0x2,'children':a3_0x184e34(Text,{'color':_0x5e279e(0xc5),'children':_0x366601['error']})})]},_0x3d2577))]})]}),_0x5b4c4c&&a3_0x32646d(Box,{'flexDirection':'column','children':[a3_0x184e34(Box,{'children':a3_0x32646d(Text,{'color':_0x5e279e(0xd8),'children':['❌\x20',_0x5b4c4c]})}),_0x5b4c4c[_0x5e279e(0xcc)]('登录')&&a3_0x32646d(Box,{'marginTop':0x1,'children':[a3_0x184e34(Text,{'color':_0x5e279e(0xbd),'children':_0x5e279e(0xe5)}),a3_0x184e34(Text,{'color':_0x5e279e(0xc8),'children':_0x5e279e(0xe3)}),a3_0x184e34(Text,{'color':_0x5e279e(0xbd),'children':_0x5e279e(0xba)})]})]})]});};
1
+ function a3_0xcec3(_0x40396b,_0x130c57){const _0x18e3a6=a3_0x18e3();return a3_0xcec3=function(_0xcec37d,_0x4aa52d){_0xcec37d=_0xcec37d-0x111;let _0x5df8d3=_0x18e3a6[_0xcec37d];return _0x5df8d3;},a3_0xcec3(_0x40396b,_0x130c57);}(function(_0x55428f,_0x1efe9f){const _0x3dd7ce=a3_0xcec3,_0x2b3371=_0x55428f();while(!![]){try{const _0x6a5b61=-parseInt(_0x3dd7ce(0x13d))/0x1+parseInt(_0x3dd7ce(0x119))/0x2*(parseInt(_0x3dd7ce(0x149))/0x3)+parseInt(_0x3dd7ce(0x139))/0x4+-parseInt(_0x3dd7ce(0x13e))/0x5*(-parseInt(_0x3dd7ce(0x148))/0x6)+parseInt(_0x3dd7ce(0x11d))/0x7*(parseInt(_0x3dd7ce(0x133))/0x8)+-parseInt(_0x3dd7ce(0x127))/0x9*(-parseInt(_0x3dd7ce(0x115))/0xa)+-parseInt(_0x3dd7ce(0x12c))/0xb;if(_0x6a5b61===_0x1efe9f)break;else _0x2b3371['push'](_0x2b3371['shift']());}catch(_0x493c2d){_0x2b3371['push'](_0x2b3371['shift']());}}}(a3_0x18e3,0x548e5));import{jsx as a3_0x3874d6,jsxs as a3_0x551b59,Fragment as a3_0xd97120}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchDatasets}from'./fetch-datasets.js';function a3_0x18e3(){const _0x504968=['\x20-\x20','未提供应用AppCode,且配置中也没有默认值','.md\x20(','\x20个匹配的数据集\x1b[0m','\x20个,过滤重复','⚠️\x20以下数据集生成失败:','正在获取数据集列表...','27YEgYMu','gray','\x20个数据集中筛选出\x20','!\x20原始数据集\x20','join','9501833FpJNcu','文档生成完成','./docs','\x1b[33m!\x20以下数据集代码不存在:\x20','red','未找到任何数据集','white','36464DfhQnU','code','string','💡\x20请使用\x20','duplicateCount','lovrabet\x20auth','2596400VmSfsb','column','dim','\x1b[90m*\x20从\x20','233409kxwZYd','4055JUpexG','log','filter','cyan','*\x20生成的文档文件:','includes','success','\x1b[0m','\x20(环境:\x20','\x20个数据集的文档...','378LVlFJm','10197ErXodJ','green','文档生成失败:\x20','env','originalCount','setLogPath','正在生成\x20','1052070wabobS','filePath','map','datasetName','190acOLsw','🚀\x20','yellow','length','161XdCKeN',',\x20失败\x20','api-doc'];a3_0x18e3=function(){return _0x504968;};return a3_0x18e3();}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x2586c5,env:_0x47c1c1,output:_0x43fada,extraParams:_0x352ed5,datasetCodes:_0x367678})=>{const _0x215f52=a3_0xcec3,{exit:_0x338d8f}=useApp(),[_0x4eb67c,_0x123229]=useState(![]),[_0x51cda8,_0xa68017]=useState(''),[_0x5cc09f,_0x130717]=useState(![]),[_0x373193,_0x1271a0]=useState(null),[_0x168323,_0x130cce]=useState(null),[_0x339bed,_0x41b23f]=useState(null),_0x45f965=readConfig(),_0x176362=getConfigAppCode(),_0x1d6c3d=_0x2586c5||_0x176362,_0x51a3fc=typeof _0x45f965?.[_0x215f52(0x111)]===_0x215f52(0x135)?_0x45f965[_0x215f52(0x111)]:undefined,_0x4bdc86=_0x47c1c1||_0x51a3fc||'online';initEnv(_0x4bdc86);const _0x42edfd=_0x43fada||_0x215f52(0x12e),_0x549d39=_0x2586c5?'使用指定的应用AppCode:\x20'+_0x1d6c3d:'使用配置的应用AppCode:\x20'+_0x1d6c3d;useEffect(()=>{_0x123229(!![]),_0x4ac1f7();},[]),useEffect(()=>{(_0x5cc09f||_0x373193)&&_0x338d8f();},[_0x5cc09f,_0x373193,_0x338d8f]);async function _0x4ac1f7(){const _0x5f1356=_0x215f52;if(!_0x1d6c3d){_0x1271a0(_0x5f1356(0x121));return;}try{logger[_0x5f1356(0x113)](process['cwd']()),_0xa68017(_0x5f1356(0x126));const {rawData:_0x2acccc,originalCount:_0x1d8c18,filteredCount:_0x17f22a,duplicateCount:_0x113ab9}=await fetchDatasets(_0x1d6c3d);_0x41b23f({'originalCount':_0x1d8c18,'filteredCount':_0x17f22a,'duplicateCount':_0x113ab9});if(_0x2acccc[_0x5f1356(0x11c)]===0x0){_0x1271a0(_0x5f1356(0x131));return;}let _0x3c93f5=_0x2acccc;if(_0x367678&&_0x367678[_0x5f1356(0x11c)]>0x0){_0x3c93f5=_0x2acccc[_0x5f1356(0x140)](_0x1f3852=>_0x367678[_0x5f1356(0x143)](_0x1f3852['code']));const _0x33d32b=_0x3c93f5['map'](_0x942674=>_0x942674[_0x5f1356(0x134)]),_0x31ad05=_0x367678[_0x5f1356(0x140)](_0x26850a=>!_0x33d32b[_0x5f1356(0x143)](_0x26850a));_0x31ad05[_0x5f1356(0x11c)]>0x0&&console[_0x5f1356(0x13f)](_0x5f1356(0x12f)+_0x31ad05['join'](',\x20')+_0x5f1356(0x145));if(_0x3c93f5[_0x5f1356(0x11c)]===0x0){_0x1271a0('指定的数据集代码都不存在:\x20'+_0x367678[_0x5f1356(0x12b)](',\x20'));return;}console[_0x5f1356(0x13f)](_0x5f1356(0x13c)+_0x2acccc[_0x5f1356(0x11c)]+_0x5f1356(0x129)+_0x3c93f5[_0x5f1356(0x11c)]+_0x5f1356(0x123));}_0xa68017(_0x5f1356(0x114)+_0x3c93f5[_0x5f1356(0x11c)]+_0x5f1356(0x147));const _0xcb3fbd=await generateDatasetDocs(_0x3c93f5,_0x1d6c3d,_0x42edfd,(_0x47994f,_0x269589,_0x270aa2)=>{const _0x2f3dc5=_0x5f1356;_0xa68017(_0x2f3dc5(0x114)+_0x270aa2+_0x2f3dc5(0x122)+_0x47994f+'/'+_0x269589+')');},_0x352ed5);_0x130cce(_0xcb3fbd),_0x130717(!![]);const _0x3ea876=_0xcb3fbd[_0x5f1356(0x140)](_0x49bdc0=>_0x49bdc0[_0x5f1356(0x144)])[_0x5f1356(0x11c)],_0x32c2e4=_0xcb3fbd[_0x5f1356(0x140)](_0x50d3b6=>!_0x50d3b6['success'])['length'];logger[_0x5f1356(0x144)](_0x5f1356(0x11f),_0x5f1356(0x12d),undefined,{'totalCount':_0xcb3fbd[_0x5f1356(0x11c)],'successCount':_0x3ea876,'failCount':_0x32c2e4,'outputDir':_0x42edfd});}catch(_0x17e637){const _0x16a0c0=_0x17e637 instanceof Error?_0x17e637['message']:String(_0x17e637);logger['error'](_0x5f1356(0x11f),_0x5f1356(0x14b)+_0x16a0c0,{'appCode':_0x1d6c3d,'outputDir':_0x42edfd}),_0x1271a0(_0x5f1356(0x14b)+_0x16a0c0);}finally{_0x123229(![]);}}const _0x340e13=_0x168323?.[_0x215f52(0x140)](_0x3aa53d=>_0x3aa53d[_0x215f52(0x144)])[_0x215f52(0x11c)]||0x0,_0x51ae9f=_0x168323?.[_0x215f52(0x140)](_0x3c1242=>!_0x3c1242[_0x215f52(0x144)])[_0x215f52(0x11c)]||0x0;return a3_0x551b59(Box,{'flexDirection':_0x215f52(0x13a),'children':[(_0x4eb67c||_0x5cc09f)&&a3_0x551b59(Box,{'children':[a3_0x3874d6(Text,{'color':_0x215f52(0x128),'children':'*\x20'}),a3_0x3874d6(Text,{'color':_0x2586c5?_0x215f52(0x132):_0x215f52(0x13b),'children':_0x549d39})]}),_0x4eb67c&&a3_0x3874d6(Box,{'children':a3_0x551b59(Text,{'children':[_0x215f52(0x11a),_0x51cda8,_0x215f52(0x146),_0x4bdc86,')']})}),_0x5cc09f&&_0x168323&&_0x339bed&&a3_0x551b59(Box,{'flexDirection':_0x215f52(0x13a),'children':[a3_0x3874d6(Box,{'children':a3_0x551b59(Text,{'color':_0x215f52(0x14a),'children':['√\x20文档生成完成!成功\x20',_0x340e13,'\x20个',_0x51ae9f>0x0&&_0x215f52(0x11e)+_0x51ae9f+'\x20个']})}),_0x339bed[_0x215f52(0x137)]>0x0&&a3_0x3874d6(Box,{'marginTop':0x1,'children':a3_0x551b59(Text,{'color':_0x215f52(0x11b),'children':[_0x215f52(0x12a),_0x339bed[_0x215f52(0x112)],_0x215f52(0x124),'\x20',_0x339bed[_0x215f52(0x137)],'\x20个']})}),a3_0x551b59(Box,{'marginTop':0x1,'children':[a3_0x3874d6(Text,{'color':_0x215f52(0x128),'children':'*\x20输出目录:\x20'}),a3_0x3874d6(Text,{'color':'cyan','children':_0x42edfd})]}),_0x340e13>0x0&&a3_0x551b59(a3_0xd97120,{'children':[a3_0x3874d6(Box,{'marginTop':0x1,'children':a3_0x3874d6(Text,{'color':_0x215f52(0x128),'children':_0x215f52(0x142)})}),_0x168323[_0x215f52(0x140)](_0x593e30=>_0x593e30[_0x215f52(0x144)])[_0x215f52(0x117)]((_0x45fb16,_0x5404e2)=>a3_0x551b59(Box,{'marginLeft':0x2,'children':[a3_0x551b59(Text,{'color':_0x215f52(0x141),'children':['•\x20',_0x45fb16[_0x215f52(0x116)]]}),a3_0x551b59(Text,{'color':_0x215f52(0x13b),'children':[_0x215f52(0x120),_0x45fb16[_0x215f52(0x118)]]})]},_0x5404e2))]}),_0x51ae9f>0x0&&a3_0x551b59(a3_0xd97120,{'children':[a3_0x3874d6(Box,{'marginTop':0x1,'children':a3_0x3874d6(Text,{'color':_0x215f52(0x11b),'children':_0x215f52(0x125)})}),_0x168323[_0x215f52(0x140)](_0x571308=>!_0x571308[_0x215f52(0x144)])['map']((_0x5b2133,_0x3bdd6c)=>a3_0x551b59(Box,{'marginLeft':0x2,'flexDirection':_0x215f52(0x13a),'children':[a3_0x551b59(Text,{'color':'red','children':['•\x20',_0x5b2133[_0x215f52(0x118)],'\x20(',_0x5b2133['datasetCode'],')']}),_0x5b2133['error']&&a3_0x3874d6(Box,{'marginLeft':0x2,'children':a3_0x3874d6(Text,{'color':'dim','children':_0x5b2133['error']})})]},_0x3bdd6c))]})]}),_0x373193&&a3_0x551b59(Box,{'flexDirection':'column','children':[a3_0x3874d6(Box,{'children':a3_0x551b59(Text,{'color':_0x215f52(0x130),'children':['❌\x20',_0x373193]})}),_0x373193[_0x215f52(0x143)]('登录')&&a3_0x551b59(Box,{'marginTop':0x1,'children':[a3_0x3874d6(Text,{'color':_0x215f52(0x11b),'children':_0x215f52(0x136)}),a3_0x3874d6(Text,{'color':_0x215f52(0x141),'children':_0x215f52(0x138)}),a3_0x3874d6(Text,{'color':'yellow','children':'\x20重新登录后再试'})]})]})]});};
@@ -1 +1 @@
1
- const a4_0x2fee9f=a4_0x24d2;(function(_0x23860f,_0x5c460a){const _0x21f671=a4_0x24d2,_0x2adc60=_0x23860f();while(!![]){try{const _0x58e900=parseInt(_0x21f671(0x15c))/0x1+-parseInt(_0x21f671(0x15d))/0x2+parseInt(_0x21f671(0x139))/0x3+parseInt(_0x21f671(0x155))/0x4*(-parseInt(_0x21f671(0x13e))/0x5)+-parseInt(_0x21f671(0x152))/0x6*(parseInt(_0x21f671(0x147))/0x7)+parseInt(_0x21f671(0x141))/0x8*(-parseInt(_0x21f671(0x13a))/0x9)+-parseInt(_0x21f671(0x153))/0xa*(-parseInt(_0x21f671(0x14c))/0xb);if(_0x58e900===_0x5c460a)break;else _0x2adc60['push'](_0x2adc60['shift']());}catch(_0x2df896){_0x2adc60['push'](_0x2adc60['shift']());}}}(a4_0x131f,0xa84f9));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x9fc4a1 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a4_0x24d2(_0x5efde6,_0x2f8d03){const _0x131f49=a4_0x131f();return a4_0x24d2=function(_0x24d23d,_0x5d0bf1){_0x24d23d=_0x24d23d-0x138;let _0x4224d9=_0x131f49[_0x24d23d];return _0x4224d9;},a4_0x24d2(_0x5efde6,_0x2f8d03);}export async function fetchDatasetDoc(_0x35cd6b){const _0x1d6762=a4_0x24d2,{appCode:_0x3189b5,datasetCode:_0x49fa4b,datasetId:_0x1a719b,extraParams:_0x5962af}=_0x35cd6b,_0xa20f54=getApiDomain(),_0x489e82=_0xa20f54+_0x1d6762(0x140),_0x457926={'appCode':_0x3189b5,'datasetCode':_0x49fa4b,'datasetId':_0x1a719b,..._0x5962af||{}},_0x112388=await fetch(_0x489e82,{'method':'POST','headers':{'Content-Type':_0x1d6762(0x13c),'Cookie':getCookie()},'body':JSON['stringify'](_0x457926)});if(!_0x112388['ok']){if(_0x112388[_0x1d6762(0x145)]===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');let _0x362e4b='';try{_0x362e4b=await _0x112388[_0x1d6762(0x159)]();}catch(_0x4eb60d){}throw new Error('获取文档失败\x20('+_0x49fa4b+_0x1d6762(0x14e)+_0x112388[_0x1d6762(0x145)]+(_0x362e4b?'\x0a'+_0x362e4b:''));}const _0x41fe47=await _0x112388[_0x1d6762(0x13f)]();if(!_0x41fe47[_0x1d6762(0x150)]||typeof _0x41fe47[_0x1d6762(0x150)][_0x1d6762(0x14a)]!==_0x1d6762(0x138))throw new Error(_0x1d6762(0x144)+_0x49fa4b+'):缺少\x20data.markdown\x20字段');return _0x41fe47[_0x1d6762(0x150)][_0x1d6762(0x14a)];}function delay(_0x2d3776){return new Promise(_0x142685=>setTimeout(_0x142685,_0x2d3776));}export async function generateDatasetDocs(_0x3cbf95,_0x1a9710,_0x1239e7=a4_0x2fee9f(0x15b),_0x15beb2,_0x4b73e2){const _0x552636=a4_0x2fee9f;mkdirSync(_0x1239e7,{'recursive':!![]});const _0x84ddf6=[],_0x2bccce=_0x3cbf95['length'];console[_0x552636(0x142)](_0x552636(0x146)+_0x2bccce+_0x552636(0x158));for(let _0x539d6f=0x0;_0x539d6f<_0x3cbf95[_0x552636(0x13d)];_0x539d6f++){const _0x1f38c8=_0x3cbf95[_0x539d6f],_0x27de1f=_0x539d6f+0x1;let _0x52c435;if(_0x1f38c8[_0x552636(0x148)]?.['tableName'])_0x52c435=_0x1f38c8[_0x552636(0x148)]['tableName'];else{const _0x4d22f8=_0x1f38c8[_0x552636(0x14d)]['slice'](-0x6)[_0x552636(0x15f)](0x6,'0');_0x52c435='dataset_'+_0x4d22f8;}try{console[_0x552636(0x142)]('['+_0x27de1f+'/'+_0x2bccce+_0x552636(0x161)+_0x52c435+_0x552636(0x154)+_0x1f38c8[_0x552636(0x14b)]+')');_0x15beb2&&_0x15beb2(_0x27de1f,_0x2bccce,_0x52c435);const _0xb4a911=await fetchDatasetDoc({'appCode':_0x1a9710,'datasetCode':_0x1f38c8['code'],'datasetId':_0x1f38c8['id'],'enableAI':![],'extraParams':_0x4b73e2}),_0x2091ac=a4_0x9fc4a1[_0x552636(0x162)](_0x1239e7,_0x52c435+'.md');writeFileSync(_0x2091ac,_0xb4a911,{'encoding':_0x552636(0x13b)}),console[_0x552636(0x142)]('✓\x20成功生成:\x20'+_0x52c435+_0x552636(0x15e)),logger[_0x552636(0x157)](_0x552636(0x149),_0x552636(0x143)+_0x52c435,undefined,{'datasetCode':_0x1f38c8[_0x552636(0x14d)],'datasetName':_0x1f38c8['name'],'filePath':_0x2091ac,'progress':_0x27de1f+'/'+_0x2bccce}),_0x84ddf6['push']({'datasetCode':_0x1f38c8[_0x552636(0x14d)],'datasetName':_0x1f38c8[_0x552636(0x14b)],'filePath':_0x2091ac,'success':!![]}),_0x27de1f<_0x2bccce&&await delay(0xbb8);}catch(_0x22bb57){const _0x4576a4=_0x22bb57 instanceof Error?_0x22bb57[_0x552636(0x151)]:String(_0x22bb57);console[_0x552636(0x142)](_0x552636(0x14f)+_0x52c435+'.md\x20-\x20'+_0x4576a4+'\x0a'),logger[_0x552636(0x156)](_0x552636(0x149),'生成文档失败:\x20'+_0x1f38c8['code'],{'datasetCode':_0x1f38c8[_0x552636(0x14d)],'datasetName':_0x1f38c8[_0x552636(0x14b)],'error':_0x4576a4,'progress':_0x27de1f+'/'+_0x2bccce}),_0x84ddf6[_0x552636(0x160)]({'datasetCode':_0x1f38c8[_0x552636(0x14d)],'datasetName':_0x1f38c8[_0x552636(0x14b)],'filePath':'','success':![],'error':_0x4576a4}),_0x27de1f<_0x2bccce&&(console['log'](_0x552636(0x15a)),await delay(0xbb8));}}return _0x84ddf6;}function a4_0x131f(){const _0x3cc9aa=['message','90KbiVJw','10FYuxnb','.md\x20(','64FpaSkE','error','success','\x20个数据集需要生成文档\x0a','text','等待\x203\x20秒...\x0a','./docs','637827VzTkvY','1128980joWUuV','.md','padStart','push',']\x20正在生成:\x20','join','string','1369959PwdzvP','26361ypXUaN','utf8','application/json','length','129585YQhDyz','json','/api/node-toolbox/api-doc-generator','2384jpVbUT','log','生成文档成功:\x20','响应数据格式错误\x20(','status','\x0a共有\x20','90874ysamxe','dbtableConfig','api-doc','markdown','name','18058205oSKnsR','code','),HTTP状态码:\x20','✗\x20失败:\x20','data'];a4_0x131f=function(){return _0x3cc9aa;};return a4_0x131f();}
1
+ function a4_0x48c7(_0x1aeca6,_0x261e4d){const _0x5f5d3f=a4_0x5f5d();return a4_0x48c7=function(_0x48c782,_0x3778db){_0x48c782=_0x48c782-0x11c;let _0x2f89b1=_0x5f5d3f[_0x48c782];return _0x2f89b1;},a4_0x48c7(_0x1aeca6,_0x261e4d);}const a4_0x5563bb=a4_0x48c7;(function(_0x1b672b,_0xd5dc7){const _0x19a8fc=a4_0x48c7,_0x3fc434=_0x1b672b();while(!![]){try{const _0x4a05e0=parseInt(_0x19a8fc(0x12c))/0x1+-parseInt(_0x19a8fc(0x147))/0x2+-parseInt(_0x19a8fc(0x12f))/0x3+parseInt(_0x19a8fc(0x13e))/0x4*(-parseInt(_0x19a8fc(0x11e))/0x5)+parseInt(_0x19a8fc(0x145))/0x6*(parseInt(_0x19a8fc(0x14a))/0x7)+-parseInt(_0x19a8fc(0x120))/0x8*(parseInt(_0x19a8fc(0x13c))/0x9)+parseInt(_0x19a8fc(0x11d))/0xa;if(_0x4a05e0===_0xd5dc7)break;else _0x3fc434['push'](_0x3fc434['shift']());}catch(_0x354f81){_0x3fc434['push'](_0x3fc434['shift']());}}}(a4_0x5f5d,0xb6ed6));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x4ff368 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(_0x3b512c){const _0x96d7=a4_0x48c7,{appCode:_0x335b7e,datasetCode:_0x5cd684,datasetId:_0x13da51,extraParams:_0xdfdad9}=_0x3b512c,_0x581e58=getApiDomain(),_0x23afff=_0x581e58+_0x96d7(0x131),_0x214fbf={'appCode':_0x335b7e,'datasetCode':_0x5cd684,'datasetId':_0x13da51,..._0xdfdad9||{}},_0x1a2609=await fetch(_0x23afff,{'method':_0x96d7(0x137),'headers':{'Content-Type':_0x96d7(0x136),'Cookie':getCookie()},'body':JSON['stringify'](_0x214fbf)});if(!_0x1a2609['ok']){if(_0x1a2609[_0x96d7(0x127)]===0x191)throw new Error(_0x96d7(0x129));let _0x6628e4='';try{_0x6628e4=await _0x1a2609[_0x96d7(0x130)]();}catch(_0x2f6fb3){}throw new Error(_0x96d7(0x125)+_0x5cd684+_0x96d7(0x132)+_0x1a2609[_0x96d7(0x127)]+(_0x6628e4?'\x0a'+_0x6628e4:''));}const _0x4ff86f=await _0x1a2609[_0x96d7(0x13d)]();if(!_0x4ff86f[_0x96d7(0x133)]||typeof _0x4ff86f[_0x96d7(0x133)][_0x96d7(0x149)]!=='string')throw new Error(_0x96d7(0x123)+_0x5cd684+_0x96d7(0x124));return _0x4ff86f[_0x96d7(0x133)][_0x96d7(0x149)];}function a4_0x5f5d(){const _0x32d5d9=[']\x20正在生成:\x20','420hIfqiV','code','1211818uSPijn','api-doc','markdown','4228gLrPka','slice','43283550Ueezuz','5YBiOQw','name','4424zcxGUr','.md\x20-\x20','dataset_','响应数据格式错误\x20(','):缺少\x20data.markdown\x20字段','获取文档失败\x20(','push','status','log','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','success','✗\x20失败:\x20','97077QiRuOm','.md','等待\x203\x20秒...\x0a','3656001NtdoPI','text','/api/node-toolbox/api-doc-generator','),HTTP状态码:\x20','data','error','\x20个数据集需要生成文档\x0a','application/json','POST','utf8','length','./docs','dbtableConfig','20133ErHeUT','json','2627220LNVHcy','message','\x0a共有\x20','✓\x20成功生成:\x20','生成文档失败:\x20','.md\x20('];a4_0x5f5d=function(){return _0x32d5d9;};return a4_0x5f5d();}function delay(_0x151619){return new Promise(_0x107bca=>setTimeout(_0x107bca,_0x151619));}export async function generateDatasetDocs(_0x230259,_0x2cfab1,_0x42f099=a4_0x5563bb(0x13a),_0x4d3fb6,_0x40bccc){const _0x4fad97=a4_0x5563bb;mkdirSync(_0x42f099,{'recursive':!![]});const _0x52cf24=[],_0x24d16c=_0x230259[_0x4fad97(0x139)];console[_0x4fad97(0x128)](_0x4fad97(0x140)+_0x24d16c+_0x4fad97(0x135));for(let _0x342202=0x0;_0x342202<_0x230259[_0x4fad97(0x139)];_0x342202++){const _0x4abb3a=_0x230259[_0x342202],_0x1e0cd9=_0x342202+0x1;let _0x49547e;if(_0x4abb3a[_0x4fad97(0x13b)]?.['tableName'])_0x49547e=_0x4abb3a[_0x4fad97(0x13b)]['tableName'];else{const _0x213dd6=_0x4abb3a[_0x4fad97(0x146)][_0x4fad97(0x11c)](-0x6)['padStart'](0x6,'0');_0x49547e=_0x4fad97(0x122)+_0x213dd6;}try{console[_0x4fad97(0x128)]('['+_0x1e0cd9+'/'+_0x24d16c+_0x4fad97(0x144)+_0x49547e+_0x4fad97(0x143)+_0x4abb3a[_0x4fad97(0x11f)]+')');_0x4d3fb6&&_0x4d3fb6(_0x1e0cd9,_0x24d16c,_0x49547e);const _0x3847cc=await fetchDatasetDoc({'appCode':_0x2cfab1,'datasetCode':_0x4abb3a[_0x4fad97(0x146)],'datasetId':_0x4abb3a['id'],'enableAI':![],'extraParams':_0x40bccc}),_0x59ed40=a4_0x4ff368['join'](_0x42f099,_0x49547e+_0x4fad97(0x12d));writeFileSync(_0x59ed40,_0x3847cc,{'encoding':_0x4fad97(0x138)}),console[_0x4fad97(0x128)](_0x4fad97(0x141)+_0x49547e+_0x4fad97(0x12d)),logger[_0x4fad97(0x12a)](_0x4fad97(0x148),'生成文档成功:\x20'+_0x49547e,undefined,{'datasetCode':_0x4abb3a['code'],'datasetName':_0x4abb3a[_0x4fad97(0x11f)],'filePath':_0x59ed40,'progress':_0x1e0cd9+'/'+_0x24d16c}),_0x52cf24[_0x4fad97(0x126)]({'datasetCode':_0x4abb3a[_0x4fad97(0x146)],'datasetName':_0x4abb3a['name'],'filePath':_0x59ed40,'success':!![]});}catch(_0x46fcbc){const _0x378c1c=_0x46fcbc instanceof Error?_0x46fcbc[_0x4fad97(0x13f)]:String(_0x46fcbc);console[_0x4fad97(0x128)](_0x4fad97(0x12b)+_0x49547e+_0x4fad97(0x121)+_0x378c1c+'\x0a'),logger[_0x4fad97(0x134)](_0x4fad97(0x148),_0x4fad97(0x142)+_0x4abb3a[_0x4fad97(0x146)],{'datasetCode':_0x4abb3a[_0x4fad97(0x146)],'datasetName':_0x4abb3a[_0x4fad97(0x11f)],'error':_0x378c1c,'progress':_0x1e0cd9+'/'+_0x24d16c}),_0x52cf24[_0x4fad97(0x126)]({'datasetCode':_0x4abb3a[_0x4fad97(0x146)],'datasetName':_0x4abb3a['name'],'filePath':'','success':![],'error':_0x378c1c}),_0x1e0cd9<_0x24d16c&&(console[_0x4fad97(0x128)](_0x4fad97(0x12e)),await delay(0xbb8));}}return _0x52cf24;}
@@ -1 +1 @@
1
- (function(_0x4a1599,_0x129746){const _0x58a52d=a5_0x8c6d,_0x1747ab=_0x4a1599();while(!![]){try{const _0x338d27=-parseInt(_0x58a52d(0x129))/0x1+-parseInt(_0x58a52d(0x121))/0x2+parseInt(_0x58a52d(0x13d))/0x3*(parseInt(_0x58a52d(0x148))/0x4)+-parseInt(_0x58a52d(0x11c))/0x5*(-parseInt(_0x58a52d(0x135))/0x6)+-parseInt(_0x58a52d(0x14f))/0x7+parseInt(_0x58a52d(0x142))/0x8*(parseInt(_0x58a52d(0x137))/0x9)+-parseInt(_0x58a52d(0x125))/0xa*(-parseInt(_0x58a52d(0x14d))/0xb);if(_0x338d27===_0x129746)break;else _0x1747ab['push'](_0x1747ab['shift']());}catch(_0x336a36){_0x1747ab['push'](_0x1747ab['shift']());}}}(a5_0xbe0f,0xe9acb));import{jsx as a5_0x3595ac,jsxs as a5_0x32131b}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a5_0xbe0f(){const _0x286387=['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','includes','./src/api/','-\x20模型配置文件\x20(','💡\x20请使用\x20','cyan','1023186EhbPIp','-api','52551IMVRgc','-client','*\x20已生成文件:','使用配置的应用AppCode:\x20','gray','error','580857ZehUVe','\x20个,过滤重复','拉取\x20API\x20配置失败:\x20','*\x20导入方式:','!\x20原始数据集\x20','1168cNdqTs','column','lovrabet\x20auth','red','datasetCount','endsWith','24wPGqQL','未提供应用AppCode,且配置中也没有默认值','replace','api','√\x20成功拉取\x20','451ReBbiL','.ts','8041355xNVJgb','white','25VrNiln','\x20个数据集,生成','\x20重新登录后再试','modelCount','yellow','572858FMNqAI','client','使用指定的应用AppCode:\x20','join','22450NsQBCw','string','slice','\x20-\x20客户端实例文件','566583AMroxo','\x20from\x20\x27@/','split','duplicateCount','dim','cwd'];a5_0xbe0f=function(){return _0x286387;};return a5_0xbe0f();}import{initEnv}from'../constant/env.js';import{fetchDatasets}from'./fetch-datasets.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';function a5_0x8c6d(_0x2b706e,_0x40cdbb){const _0xbe0f20=a5_0xbe0f();return a5_0x8c6d=function(_0x8c6dcd,_0x264131){_0x8c6dcd=_0x8c6dcd-0x11b;let _0x216695=_0xbe0f20[_0x8c6dcd];return _0x216695;},a5_0x8c6d(_0x2b706e,_0x40cdbb);}export const ApiPullUI=({appCode:_0x329a94,env:_0x4cfd06,output:_0x551f81})=>{const _0x17fb39=a5_0x8c6d,{exit:_0x3624a4}=useApp(),[_0x46454c,_0x42881e]=useState(![]),[_0x469e6c,_0x3180fa]=useState(![]),[_0x187159,_0x948177]=useState(null),[_0x24f489,_0xbdd081]=useState(null),_0x462881=readConfig(),_0x3c0c5d=getConfigAppCode(),_0x5c6110=_0x329a94||_0x3c0c5d,_0x18c76e=typeof _0x462881?.['env']===_0x17fb39(0x126)?_0x462881['env']:undefined,_0x39fb6a=_0x4cfd06||_0x18c76e||'online';initEnv(_0x39fb6a);const _0x59f29d=_0x551f81||_0x17fb39(0x131),_0x51dc59=_0x329a94&&_0x329a94[_0x17fb39(0x130)]('-')?_0x329a94[_0x17fb39(0x12b)]('-')[_0x17fb39(0x127)](0x1)[_0x17fb39(0x124)]('-'):'',_0x1c5a0a=_0x329a94?_0x17fb39(0x123)+_0x5c6110:_0x17fb39(0x13a)+_0x5c6110,_0x3a40d0=_0x51dc59?_0x51dc59+_0x17fb39(0x136):_0x17fb39(0x14b),_0x4547eb=_0x51dc59?_0x51dc59+_0x17fb39(0x138):_0x17fb39(0x122);useEffect(()=>{_0x42881e(!![]),_0x3d3b5e();},[]),useEffect(()=>{(_0x469e6c||_0x187159)&&_0x3624a4();},[_0x469e6c,_0x187159,_0x3624a4]);async function _0x3d3b5e(){const _0x2f2263=_0x17fb39;if(!_0x5c6110){_0x948177(_0x2f2263(0x149));return;}try{logger['setLogPath'](process[_0x2f2263(0x12e)]());const {rawData:_0x5abdc5,originalCount:_0x2c751a,filteredCount:_0x471571,duplicateCount:_0x30acea}=await fetchDatasets(_0x5c6110),_0x5d8ad1=_0x471571,_0x1df7f4=!_0x329a94,_0x418823=await generateApiFile(_0x5abdc5,_0x51dc59,_0x5c6110,_0x1df7f4,_0x39fb6a,_0x59f29d),_0x371580=_0x59f29d[_0x2f2263(0x147)]('/')?_0x59f29d:_0x59f29d+'/';_0xbdd081({'api':''+_0x371580+_0x3a40d0+_0x2f2263(0x14e),'client':''+_0x371580+_0x4547eb+_0x2f2263(0x14e),'modelCount':_0x418823['modelCount'],'datasetCount':_0x5d8ad1,'originalCount':_0x2c751a,'duplicateCount':_0x30acea}),_0x3180fa(!![]);}catch(_0x115556){const _0x769631=_0x115556 instanceof Error?_0x115556['message']:String(_0x115556);logger[_0x2f2263(0x13c)]('api-pull',_0x2f2263(0x13f)+_0x769631,{'appCode':_0x5c6110,'error':_0x769631}),_0x948177('拉取\x20API\x20配置失败:\x20'+_0x769631);}finally{_0x42881e(![]);}}return a5_0x32131b(Box,{'flexDirection':'column','children':[(_0x46454c||_0x469e6c)&&a5_0x32131b(Box,{'children':[a5_0x3595ac(Text,{'color':_0x17fb39(0x13b),'children':'*\x20'}),a5_0x3595ac(Text,{'color':_0x329a94?_0x17fb39(0x11b):_0x17fb39(0x12d),'children':_0x1c5a0a})]}),_0x46454c&&a5_0x3595ac(Box,{'children':a5_0x32131b(Text,{'children':[_0x17fb39(0x12f),_0x39fb6a,')']})}),_0x469e6c&&_0x24f489&&a5_0x32131b(Box,{'flexDirection':_0x17fb39(0x143),'children':[a5_0x3595ac(Box,{'children':a5_0x32131b(Text,{'color':'green','children':[_0x17fb39(0x14c),_0x24f489[_0x17fb39(0x146)],_0x17fb39(0x11d),'\x20',_0x24f489[_0x17fb39(0x11f)],'\x20个模型']})}),_0x24f489[_0x17fb39(0x12c)]>0x0&&a5_0x3595ac(Box,{'marginTop':0x1,'children':a5_0x32131b(Text,{'color':_0x17fb39(0x120),'children':[_0x17fb39(0x141),_0x24f489['originalCount'],_0x17fb39(0x13e),'\x20',_0x24f489[_0x17fb39(0x12c)],'\x20个']})}),a5_0x3595ac(Box,{'marginTop':0x1,'children':a5_0x3595ac(Text,{'color':_0x17fb39(0x13b),'children':_0x17fb39(0x139)})}),a5_0x32131b(Box,{'marginLeft':0x2,'children':[a5_0x32131b(Text,{'color':_0x17fb39(0x134),'children':['•\x20',_0x24f489['api']]}),a5_0x32131b(Text,{'color':_0x17fb39(0x12d),'children':['\x20',_0x17fb39(0x132),_0x24f489[_0x17fb39(0x11f)],'\x20个模型)']})]}),a5_0x32131b(Box,{'marginLeft':0x2,'children':[a5_0x32131b(Text,{'color':_0x17fb39(0x134),'children':['•\x20',_0x24f489['client']]}),a5_0x3595ac(Text,{'color':_0x17fb39(0x12d),'children':_0x17fb39(0x128)})]}),a5_0x3595ac(Box,{'marginTop':0x1,'children':a5_0x3595ac(Text,{'color':'gray','children':_0x17fb39(0x140)})}),a5_0x3595ac(Box,{'marginLeft':0x2,'children':a5_0x32131b(Text,{'color':_0x17fb39(0x120),'children':['import\x20','{\x20lovrabetClient\x20}',_0x17fb39(0x12a),_0x24f489['client'][_0x17fb39(0x14a)](/^\.\//,'')['replace'](_0x17fb39(0x14e),''),'\x27']})})]}),_0x187159&&a5_0x32131b(Box,{'flexDirection':_0x17fb39(0x143),'children':[a5_0x3595ac(Box,{'children':a5_0x32131b(Text,{'color':_0x17fb39(0x145),'children':['❌\x20',_0x187159]})}),_0x187159[_0x17fb39(0x130)]('登录')&&a5_0x32131b(Box,{'marginTop':0x1,'children':[a5_0x3595ac(Text,{'color':_0x17fb39(0x120),'children':_0x17fb39(0x133)}),a5_0x3595ac(Text,{'color':_0x17fb39(0x134),'children':_0x17fb39(0x144)}),a5_0x3595ac(Text,{'color':_0x17fb39(0x120),'children':_0x17fb39(0x11e)})]})]})]});};
1
+ (function(_0x4a534f,_0x5a08ef){const _0x5a7782=a5_0x2afc,_0xa5c50b=_0x4a534f();while(!![]){try{const _0x35eca2=parseInt(_0x5a7782(0x132))/0x1*(-parseInt(_0x5a7782(0x124))/0x2)+-parseInt(_0x5a7782(0x13c))/0x3+-parseInt(_0x5a7782(0x147))/0x4+parseInt(_0x5a7782(0x136))/0x5+parseInt(_0x5a7782(0x133))/0x6+-parseInt(_0x5a7782(0x128))/0x7+parseInt(_0x5a7782(0x130))/0x8*(parseInt(_0x5a7782(0x12d))/0x9);if(_0x35eca2===_0x5a08ef)break;else _0xa5c50b['push'](_0xa5c50b['shift']());}catch(_0x282d3c){_0xa5c50b['push'](_0xa5c50b['shift']());}}}(a5_0x31dd,0x1e859));import{jsx as a5_0x256cc1,jsxs as a5_0x187dd7}from'react/jsx-runtime';import{useEffect,useState}from'react';function a5_0x31dd(){const _0x1bda15=['env','\x20重新登录后再试','slice','online','import\x20','131760ZFkZpd','💡\x20请使用\x20','\x20个模型','red','\x20个,过滤重复','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','\x20-\x20客户端实例文件','setLogPath','api','√\x20成功拉取\x20','cyan','690668WxEcHQ','lovrabet\x20auth','*\x20导入方式:','拉取\x20API\x20配置失败:\x20','{\x20lovrabetClient\x20}','white','*\x20已生成文件:','column','gray','.ts','\x20from\x20\x27@/','client','modelCount','yellow','split','duplicateCount','green','使用指定的应用AppCode:\x20','1282gnAOhH','-client','dim','originalCount','1151290cXIOSl','\x20个模型)','api-pull','使用配置的应用AppCode:\x20','未提供应用AppCode,且配置中也没有默认值','3436020BvJgaj','\x20个数据集,生成','replace','8STJopZ','datasetCount','362CuCcKR','1201170kFuQXm','-\x20模型配置文件\x20(','includes','780705BYucsC'];a5_0x31dd=function(){return _0x1bda15;};return a5_0x31dd();}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a5_0x2afc(_0x5d6315,_0x4b07ab){const _0x31ddfa=a5_0x31dd();return a5_0x2afc=function(_0x2afcfe,_0x1a4cfd){_0x2afcfe=_0x2afcfe-0x118;let _0x5ae9fa=_0x31ddfa[_0x2afcfe];return _0x5ae9fa;},a5_0x2afc(_0x5d6315,_0x4b07ab);}import{initEnv}from'../constant/env.js';import{fetchDatasets}from'./fetch-datasets.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x4a8fb9,env:_0x3a6146,output:_0x51e5ee})=>{const _0x3a61b7=a5_0x2afc,{exit:_0x2c95d7}=useApp(),[_0x380fe0,_0x33ef0d]=useState(![]),[_0x191d04,_0x25dd46]=useState(![]),[_0x4bb3a3,_0x3ae341]=useState(null),[_0x4c9891,_0x1d6296]=useState(null),_0x5518d5=readConfig(),_0x32ab23=getConfigAppCode(),_0x186c32=_0x4a8fb9||_0x32ab23,_0x5a54ad=typeof _0x5518d5?.[_0x3a61b7(0x137)]==='string'?_0x5518d5['env']:undefined,_0x287d00=_0x3a6146||_0x5a54ad||_0x3a61b7(0x13a);initEnv(_0x287d00);const _0x2294bb=_0x51e5ee||'./src/api/',_0x46fa88=_0x4a8fb9&&_0x4a8fb9[_0x3a61b7(0x135)]('-')?_0x4a8fb9[_0x3a61b7(0x120)]('-')[_0x3a61b7(0x139)](0x1)['join']('-'):'',_0x2022bb=_0x4a8fb9?_0x3a61b7(0x123)+_0x186c32:_0x3a61b7(0x12b)+_0x186c32,_0x387bee=_0x46fa88?_0x46fa88+'-api':_0x3a61b7(0x144),_0x5542a6=_0x46fa88?_0x46fa88+_0x3a61b7(0x125):_0x3a61b7(0x11d);useEffect(()=>{_0x33ef0d(!![]),_0x505301();},[]),useEffect(()=>{(_0x191d04||_0x4bb3a3)&&_0x2c95d7();},[_0x191d04,_0x4bb3a3,_0x2c95d7]);async function _0x505301(){const _0x45e41f=_0x3a61b7;if(!_0x186c32){_0x3ae341(_0x45e41f(0x12c));return;}try{logger[_0x45e41f(0x143)](process['cwd']());const {rawData:_0x1a96de,originalCount:_0x4abc26,filteredCount:_0x15d30c,duplicateCount:_0x197ca6}=await fetchDatasets(_0x186c32),_0xbea49e=_0x15d30c,_0x36099b=!_0x4a8fb9,_0x98f242=await generateApiFile(_0x1a96de,_0x46fa88,_0x186c32,_0x36099b,_0x287d00,_0x2294bb),_0x61ddbf=_0x2294bb['endsWith']('/')?_0x2294bb:_0x2294bb+'/';_0x1d6296({'api':''+_0x61ddbf+_0x387bee+'.ts','client':''+_0x61ddbf+_0x5542a6+_0x45e41f(0x11b),'modelCount':_0x98f242[_0x45e41f(0x11e)],'datasetCount':_0xbea49e,'originalCount':_0x4abc26,'duplicateCount':_0x197ca6}),_0x25dd46(!![]);}catch(_0xd91730){const _0x3a8263=_0xd91730 instanceof Error?_0xd91730['message']:String(_0xd91730);logger['error'](_0x45e41f(0x12a),_0x45e41f(0x14a)+_0x3a8263,{'appCode':_0x186c32,'error':_0x3a8263}),_0x3ae341(_0x45e41f(0x14a)+_0x3a8263);}finally{_0x33ef0d(![]);}}return a5_0x187dd7(Box,{'flexDirection':_0x3a61b7(0x119),'children':[(_0x380fe0||_0x191d04)&&a5_0x187dd7(Box,{'children':[a5_0x256cc1(Text,{'color':_0x3a61b7(0x11a),'children':'*\x20'}),a5_0x256cc1(Text,{'color':_0x4a8fb9?_0x3a61b7(0x14c):_0x3a61b7(0x126),'children':_0x2022bb})]}),_0x380fe0&&a5_0x256cc1(Box,{'children':a5_0x187dd7(Text,{'children':[_0x3a61b7(0x141),_0x287d00,')']})}),_0x191d04&&_0x4c9891&&a5_0x187dd7(Box,{'flexDirection':_0x3a61b7(0x119),'children':[a5_0x256cc1(Box,{'children':a5_0x187dd7(Text,{'color':_0x3a61b7(0x122),'children':[_0x3a61b7(0x145),_0x4c9891[_0x3a61b7(0x131)],_0x3a61b7(0x12e),'\x20',_0x4c9891[_0x3a61b7(0x11e)],_0x3a61b7(0x13e)]})}),_0x4c9891[_0x3a61b7(0x121)]>0x0&&a5_0x256cc1(Box,{'marginTop':0x1,'children':a5_0x187dd7(Text,{'color':_0x3a61b7(0x11f),'children':['!\x20原始数据集\x20',_0x4c9891[_0x3a61b7(0x127)],_0x3a61b7(0x140),'\x20',_0x4c9891['duplicateCount'],'\x20个']})}),a5_0x256cc1(Box,{'marginTop':0x1,'children':a5_0x256cc1(Text,{'color':'gray','children':_0x3a61b7(0x118)})}),a5_0x187dd7(Box,{'marginLeft':0x2,'children':[a5_0x187dd7(Text,{'color':_0x3a61b7(0x146),'children':['•\x20',_0x4c9891[_0x3a61b7(0x144)]]}),a5_0x187dd7(Text,{'color':'dim','children':['\x20',_0x3a61b7(0x134),_0x4c9891['modelCount'],_0x3a61b7(0x129)]})]}),a5_0x187dd7(Box,{'marginLeft':0x2,'children':[a5_0x187dd7(Text,{'color':_0x3a61b7(0x146),'children':['•\x20',_0x4c9891[_0x3a61b7(0x11d)]]}),a5_0x256cc1(Text,{'color':_0x3a61b7(0x126),'children':_0x3a61b7(0x142)})]}),a5_0x256cc1(Box,{'marginTop':0x1,'children':a5_0x256cc1(Text,{'color':_0x3a61b7(0x11a),'children':_0x3a61b7(0x149)})}),a5_0x256cc1(Box,{'marginLeft':0x2,'children':a5_0x187dd7(Text,{'color':_0x3a61b7(0x11f),'children':[_0x3a61b7(0x13b),_0x3a61b7(0x14b),_0x3a61b7(0x11c),_0x4c9891['client'][_0x3a61b7(0x12f)](/^\.\//,'')[_0x3a61b7(0x12f)](_0x3a61b7(0x11b),''),'\x27']})})]}),_0x4bb3a3&&a5_0x187dd7(Box,{'flexDirection':_0x3a61b7(0x119),'children':[a5_0x256cc1(Box,{'children':a5_0x187dd7(Text,{'color':_0x3a61b7(0x13f),'children':['❌\x20',_0x4bb3a3]})}),_0x4bb3a3[_0x3a61b7(0x135)]('登录')&&a5_0x187dd7(Box,{'marginTop':0x1,'children':[a5_0x256cc1(Text,{'color':'yellow','children':_0x3a61b7(0x13d)}),a5_0x256cc1(Text,{'color':'cyan','children':_0x3a61b7(0x148)}),a5_0x256cc1(Text,{'color':_0x3a61b7(0x11f),'children':_0x3a61b7(0x138)})]})]})]});};
@@ -1 +1 @@
1
- function a6_0x58c7(_0x41a63b,_0x26f17b){const _0x2839ca=a6_0x2839();return a6_0x58c7=function(_0x58c70e,_0x4fc8b5){_0x58c70e=_0x58c70e-0x12b;let _0x51666d=_0x2839ca[_0x58c70e];return _0x51666d;},a6_0x58c7(_0x41a63b,_0x26f17b);}(function(_0x2c01f7,_0x4e76a3){const _0x101d77=a6_0x58c7,_0x2e9be1=_0x2c01f7();while(!![]){try{const _0x3dbdc8=-parseInt(_0x101d77(0x132))/0x1+-parseInt(_0x101d77(0x144))/0x2*(parseInt(_0x101d77(0x12d))/0x3)+-parseInt(_0x101d77(0x131))/0x4+parseInt(_0x101d77(0x138))/0x5*(parseInt(_0x101d77(0x133))/0x6)+-parseInt(_0x101d77(0x13a))/0x7+-parseInt(_0x101d77(0x13d))/0x8+parseInt(_0x101d77(0x134))/0x9*(parseInt(_0x101d77(0x12b))/0xa);if(_0x3dbdc8===_0x4e76a3)break;else _0x2e9be1['push'](_0x2e9be1['shift']());}catch(_0x2c35d7){_0x2e9be1['push'](_0x2e9be1['shift']());}}}(a6_0x2839,0x93a9e));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{formatDataset}from'./format-dataset.js';function a6_0x2839(){const _0x251f4f=['tableName','获取数据集失败,HTTP状态码:\x20','1645285IjtXnJ','set','6517252zHXGsJ','from','&pageSize=999&currentPage=1','7746736nvFIDe','length','get','/smartapi/dataset/getList?appCode=','未知错误','forEach','获取数据集失败:\x20','72MNsazT','16378410GmdlsU','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','93843pKJBbW','text','tableData','dbtableConfig','657652NYYnPF','468116wOXwRA','18dDHoRc','18lgQrvZ','status'];a6_0x2839=function(){return _0x251f4f;};return a6_0x2839();}export function filterDuplicateDatasets(_0x570f59){const _0x3f0247=a6_0x58c7,_0x38ee26=_0x570f59['filter'](_0x71c599=>_0x71c599[_0x3f0247(0x130)]),_0x481555=_0x570f59['filter'](_0x991140=>!_0x991140[_0x3f0247(0x130)]),_0x14c48e=new Map();return _0x38ee26[_0x3f0247(0x142)](_0x234e95=>{const _0x44a130=_0x3f0247,_0x330778=_0x234e95[_0x44a130(0x130)][_0x44a130(0x136)],_0x70bf47=_0x14c48e[_0x44a130(0x13f)](_0x330778);(!_0x70bf47||_0x234e95['id']>_0x70bf47['id'])&&_0x14c48e[_0x44a130(0x139)](_0x330778,_0x234e95);}),[...Array[_0x3f0247(0x13b)](_0x14c48e['values']()),..._0x481555];}export async function fetchDatasets(_0x241abb){const _0x5947a4=a6_0x58c7,_0x38b360=await fetch(getApiDomain()+_0x5947a4(0x140)+_0x241abb+_0x5947a4(0x13c),{'headers':{'Cookie':getCookie()}});if(!_0x38b360['ok']){if(_0x38b360[_0x5947a4(0x135)]===0x191)throw new Error(_0x5947a4(0x12c));let _0x246ccd='';try{_0x246ccd=await _0x38b360[_0x5947a4(0x12e)]();}catch(_0x21ab40){}throw new Error(_0x5947a4(0x137)+_0x38b360['status']+(_0x246ccd?'\x0a'+_0x246ccd:''));}const _0x2a8c02=await _0x38b360['json']();if(!_0x2a8c02['success'])throw new Error(_0x5947a4(0x143)+(_0x2a8c02['message']||_0x5947a4(0x141)));const _0x53ad3d=_0x2a8c02['data'][_0x5947a4(0x12f)],_0x470d2f=_0x53ad3d[_0x5947a4(0x13e)],_0x2f84f7=filterDuplicateDatasets(_0x53ad3d),_0x51bc40=_0x2f84f7['length'],_0x21f7da=_0x470d2f-_0x51bc40,_0x149532=formatDataset(_0x2f84f7);return{'datasets':_0x149532,'rawData':_0x2f84f7,'originalCount':_0x470d2f,'filteredCount':_0x51bc40,'duplicateCount':_0x21f7da};}
1
+ (function(_0x2836ff,_0x8a402b){const _0x56dccc=a6_0x396b,_0x20ba41=_0x2836ff();while(!![]){try{const _0x2ec9cb=-parseInt(_0x56dccc(0x1f7))/0x1+parseInt(_0x56dccc(0x1fd))/0x2*(-parseInt(_0x56dccc(0x201))/0x3)+parseInt(_0x56dccc(0x1f9))/0x4+parseInt(_0x56dccc(0x1ee))/0x5*(-parseInt(_0x56dccc(0x206))/0x6)+-parseInt(_0x56dccc(0x209))/0x7*(parseInt(_0x56dccc(0x1f5))/0x8)+-parseInt(_0x56dccc(0x1fa))/0x9*(parseInt(_0x56dccc(0x207))/0xa)+parseInt(_0x56dccc(0x20a))/0xb;if(_0x2ec9cb===_0x8a402b)break;else _0x20ba41['push'](_0x20ba41['shift']());}catch(_0x4cb5f2){_0x20ba41['push'](_0x20ba41['shift']());}}}(a6_0x321e,0xb7a14));function a6_0x321e(){const _0x43efb4=['set','8aSPUqQ','/smartapi/dataset/getList?appCode=','154983WwfhVG','text','788632SSmbVH','27cHFMjz','获取数据集失败,HTTP状态码:\x20','获取数据集失败:\x20','15494AIOZeL','from','dbtableConfig','get','381AIIPDU','未知错误','data','&pageSize=999&currentPage=1','success','1158DyRZEC','3148670bFxSxX','forEach','9648184NJVzWe','46751012nsoVjd','6045qbCWBh','tableName','status','tableData','message','length'];a6_0x321e=function(){return _0x43efb4;};return a6_0x321e();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{formatDataset}from'./format-dataset.js';export function filterDuplicateDatasets(_0x36235a){const _0x300f3d=a6_0x396b,_0x265756=_0x36235a['filter'](_0x24fa1e=>_0x24fa1e[_0x300f3d(0x1ff)]),_0x4f36cb=_0x36235a['filter'](_0x69ceef=>!_0x69ceef[_0x300f3d(0x1ff)]),_0x29c7ac=new Map();return _0x265756[_0x300f3d(0x208)](_0x485a79=>{const _0x351646=_0x300f3d,_0x2f8481=_0x485a79[_0x351646(0x1ff)][_0x351646(0x1ef)],_0x4a51ea=_0x29c7ac[_0x351646(0x200)](_0x2f8481);(!_0x4a51ea||_0x485a79['id']>_0x4a51ea['id'])&&_0x29c7ac[_0x351646(0x1f4)](_0x2f8481,_0x485a79);}),[...Array[_0x300f3d(0x1fe)](_0x29c7ac['values']()),..._0x4f36cb];}function a6_0x396b(_0x101806,_0x23dc8c){const _0x321e37=a6_0x321e();return a6_0x396b=function(_0x396b60,_0x243d4b){_0x396b60=_0x396b60-0x1ee;let _0x466b9d=_0x321e37[_0x396b60];return _0x466b9d;},a6_0x396b(_0x101806,_0x23dc8c);}export async function fetchDatasets(_0x254d45){const _0xe33703=a6_0x396b,_0x159153=await fetch(getApiDomain()+_0xe33703(0x1f6)+_0x254d45+_0xe33703(0x204),{'headers':{'Cookie':getCookie()}});if(!_0x159153['ok']){if(_0x159153[_0xe33703(0x1f0)]===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');let _0x37978c='';try{_0x37978c=await _0x159153[_0xe33703(0x1f8)]();}catch(_0x373235){}throw new Error(_0xe33703(0x1fb)+_0x159153[_0xe33703(0x1f0)]+(_0x37978c?'\x0a'+_0x37978c:''));}const _0x3d5b1e=await _0x159153['json']();if(!_0x3d5b1e[_0xe33703(0x205)])throw new Error(_0xe33703(0x1fc)+(_0x3d5b1e[_0xe33703(0x1f2)]||_0xe33703(0x202)));const _0x46efc6=_0x3d5b1e[_0xe33703(0x203)][_0xe33703(0x1f1)],_0x43cec4=_0x46efc6[_0xe33703(0x1f3)],_0x5632cd=filterDuplicateDatasets(_0x46efc6),_0x4437f1=_0x5632cd['length'],_0x12f9c6=_0x43cec4-_0x4437f1,_0x907b07=formatDataset(_0x5632cd);return{'datasets':_0x907b07,'rawData':_0x5632cd,'originalCount':_0x43cec4,'filteredCount':_0x4437f1,'duplicateCount':_0x12f9c6};}
@@ -1 +1 @@
1
- (function(_0x2da370,_0x31fa03){const _0x14183d=a7_0x359f,_0x4f5576=_0x2da370();while(!![]){try{const _0x17e9d2=-parseInt(_0x14183d(0x19b))/0x1+parseInt(_0x14183d(0x199))/0x2*(-parseInt(_0x14183d(0x1a4))/0x3)+-parseInt(_0x14183d(0x18f))/0x4*(parseInt(_0x14183d(0x1a6))/0x5)+-parseInt(_0x14183d(0x1a5))/0x6+-parseInt(_0x14183d(0x198))/0x7*(parseInt(_0x14183d(0x19d))/0x8)+-parseInt(_0x14183d(0x1a7))/0x9+-parseInt(_0x14183d(0x195))/0xa*(-parseInt(_0x14183d(0x196))/0xb);if(_0x17e9d2===_0x31fa03)break;else _0x4f5576['push'](_0x4f5576['shift']());}catch(_0x91266){_0x4f5576['push'](_0x4f5576['shift']());}}}(a7_0x2125,0x62c5b));function a7_0x359f(_0xaf063d,_0x9c32f4){const _0x212592=a7_0x2125();return a7_0x359f=function(_0x359fd8,_0x5767fb){_0x359fd8=_0x359fd8-0x18d;let _0x5082d8=_0x212592[_0x359fd8];return _0x5082d8;},a7_0x359f(_0xaf063d,_0x9c32f4);}export function formatDataset(_0x2d8f0b){const _0x45803d=a7_0x359f,_0x4492d7=_0x2d8f0b[_0x45803d(0x1a0)](_0x8da251=>_0x8da251[_0x45803d(0x192)]),_0x2c7f15=_0x2d8f0b['filter'](_0x56cb7f=>!_0x56cb7f[_0x45803d(0x192)]),_0x47e7ac=new Map();_0x4492d7[_0x45803d(0x1a2)](_0xa8d7a0=>{const _0x279945=_0x45803d,_0x2cae6f=_0xa8d7a0[_0x279945(0x192)][_0x279945(0x18e)],_0x48238e=_0x47e7ac['get'](_0x2cae6f);(!_0x48238e||_0xa8d7a0['id']>_0x48238e['id'])&&_0x47e7ac[_0x279945(0x18d)](_0x2cae6f,_0xa8d7a0);});const _0x160f4d=Array['from'](_0x47e7ac[_0x45803d(0x19e)]())[_0x45803d(0x19a)](_0x397285=>{const _0x1ddd47=_0x45803d,_0x142efc=snakeToCamel(_0x397285['dbtableConfig']['tableName']);return{'id':_0x397285['id'],'name':_0x397285[_0x1ddd47(0x193)],'code':_0x397285[_0x1ddd47(0x194)],'tableName':_0x397285['dbtableConfig'][_0x1ddd47(0x18e)],'apiFucName':_0x142efc?_0x142efc+_0x1ddd47(0x197):'dataset'+_0x397285['code']+'Api','pkField':_0x397285[_0x1ddd47(0x192)]['pkField'],'allFields':_0x397285[_0x1ddd47(0x192)][_0x1ddd47(0x1a3)]?_0x397285[_0x1ddd47(0x192)][_0x1ddd47(0x1a3)][_0x1ddd47(0x1a1)](','):[]};}),_0x31fa41=_0x2c7f15[_0x45803d(0x19a)](_0x670739=>{const _0x438f92=_0x45803d,_0x3b4c49=_0x670739[_0x438f92(0x194)]['slice'](-0x6),_0x15e109=_0x438f92(0x190)+_0x3b4c49,_0x334e3b=snakeToCamel(_0x15e109);return{'id':_0x670739['id'],'name':_0x670739[_0x438f92(0x193)],'code':_0x670739[_0x438f92(0x194)],'tableName':_0x15e109,'apiFucName':_0x334e3b?_0x334e3b+_0x438f92(0x197):'dataset'+_0x3b4c49+_0x438f92(0x197),'pkField':undefined,'allFields':[]};});return[..._0x160f4d,..._0x31fa41];}function a7_0x2125(){const _0x331b8e=['dbtableConfig','name','code','162220kQwhAr','2167AtxHNR','Api','98BUHFSm','848858mtlchi','map','570225gBaUvh','toUpperCase','187336EmwTdb','values','trim','filter','split','forEach','allFields','3BWkfiX','4748892QjTyJc','55vbxMPT','4845222kLTVqH','set','tableName','50484mqOVFH','dataset_','replace'];a7_0x2125=function(){return _0x331b8e;};return a7_0x2125();}function snakeToCamel(_0x304e05){const _0x3c9f52=a7_0x359f;if(!_0x304e05)return _0x304e05;const _0xaab6b2=_0x304e05[_0x3c9f52(0x19f)]();return _0xaab6b2[_0x3c9f52(0x191)](/_([a-zA-Z0-9])/g,(_0x4348b8,_0x17f9a7)=>_0x17f9a7[_0x3c9f52(0x19c)]());}
1
+ function a7_0x1afa(){const _0x34a804=['pkField','7635xklwxg','map','Api','2422030TSiKKC','split','12MKRnni','dbtableConfig','allFields','replace','set','659187fSaNda','984MpPgCL','code','260622pHIOaV','trim','tableName','660930Trhspg','name','forEach','dataset','287312YVeVXp','1096QLZYSs','16919kSeEah','filter'];a7_0x1afa=function(){return _0x34a804;};return a7_0x1afa();}(function(_0x5732c3,_0x48dfdb){const _0x2c2b0e=a7_0x5b82,_0x46efa1=_0x5732c3();while(!![]){try{const _0x299e06=-parseInt(_0x2c2b0e(0x80))/0x1+parseInt(_0x2c2b0e(0x83))/0x2+-parseInt(_0x2c2b0e(0x78))/0x3*(parseInt(_0x2c2b0e(0x87))/0x4)+-parseInt(_0x2c2b0e(0x8c))/0x5*(parseInt(_0x2c2b0e(0x7e))/0x6)+parseInt(_0x2c2b0e(0x89))/0x7*(parseInt(_0x2c2b0e(0x88))/0x8)+parseInt(_0x2c2b0e(0x7d))/0x9+parseInt(_0x2c2b0e(0x76))/0xa;if(_0x299e06===_0x48dfdb)break;else _0x46efa1['push'](_0x46efa1['shift']());}catch(_0x40f6ca){_0x46efa1['push'](_0x46efa1['shift']());}}}(a7_0x1afa,0x2b9f6));function a7_0x5b82(_0x4ecc83,_0x1af7bf){const _0x1afa17=a7_0x1afa();return a7_0x5b82=function(_0x5b8285,_0x4dab3d){_0x5b8285=_0x5b8285-0x76;let _0x3d910d=_0x1afa17[_0x5b8285];return _0x3d910d;},a7_0x5b82(_0x4ecc83,_0x1af7bf);}export function formatDataset(_0x512b0a){const _0x20fa97=a7_0x5b82,_0x4912b9=_0x512b0a[_0x20fa97(0x8a)](_0x369dc=>_0x369dc[_0x20fa97(0x79)]),_0x1346c4=_0x512b0a[_0x20fa97(0x8a)](_0x2104be=>!_0x2104be[_0x20fa97(0x79)]),_0x2af2fb=new Map();_0x4912b9[_0x20fa97(0x85)](_0x46389d=>{const _0x85aeb7=_0x20fa97,_0x2fce1c=_0x46389d['dbtableConfig'][_0x85aeb7(0x82)],_0x4d7d8f=_0x2af2fb['get'](_0x2fce1c);(!_0x4d7d8f||_0x46389d['id']>_0x4d7d8f['id'])&&_0x2af2fb[_0x85aeb7(0x7c)](_0x2fce1c,_0x46389d);});const _0x49f06d=Array['from'](_0x2af2fb['values']())[_0x20fa97(0x8d)](_0x224a67=>{const _0x531727=_0x20fa97,_0x5bb32a=snakeToCamel(_0x224a67[_0x531727(0x79)][_0x531727(0x82)]);return{'id':_0x224a67['id'],'name':_0x224a67[_0x531727(0x84)],'code':_0x224a67[_0x531727(0x7f)],'tableName':_0x224a67[_0x531727(0x79)]['tableName'],'apiFucName':_0x5bb32a?_0x5bb32a+_0x531727(0x8e):_0x531727(0x86)+_0x224a67[_0x531727(0x7f)]+_0x531727(0x8e),'modelName':_0x5bb32a||_0x531727(0x86)+_0x224a67[_0x531727(0x7f)],'pkField':_0x224a67[_0x531727(0x79)][_0x531727(0x8b)],'allFields':_0x224a67[_0x531727(0x79)][_0x531727(0x7a)]?_0x224a67[_0x531727(0x79)][_0x531727(0x7a)][_0x531727(0x77)](','):[]};}),_0x50239e=_0x1346c4[_0x20fa97(0x8d)](_0x2f18d1=>{const _0x3340b0=_0x20fa97,_0x2db2cb=_0x2f18d1[_0x3340b0(0x7f)]['slice'](-0x6),_0x2a0789='dataset_'+_0x2db2cb,_0x4b93d8=snakeToCamel(_0x2a0789);return{'id':_0x2f18d1['id'],'name':_0x2f18d1['name'],'code':_0x2f18d1['code'],'tableName':_0x2a0789,'apiFucName':_0x4b93d8?_0x4b93d8+_0x3340b0(0x8e):_0x3340b0(0x86)+_0x2db2cb+_0x3340b0(0x8e),'modelName':_0x4b93d8||'dataset'+_0x2db2cb,'pkField':undefined,'allFields':[]};});return[..._0x49f06d,..._0x50239e];}function snakeToCamel(_0x271e33){const _0x44ffd4=a7_0x5b82;if(!_0x271e33)return _0x271e33;const _0x3f46b4=_0x271e33[_0x44ffd4(0x81)]();return _0x3f46b4[_0x44ffd4(0x7b)](/_([a-zA-Z0-9])/g,(_0x96635b,_0x209008)=>_0x209008['toUpperCase']());}
@@ -1 +1 @@
1
- const a8_0x111314=a8_0x2f91;(function(_0xa1e56d,_0x36fe45){const _0x5348e2=a8_0x2f91,_0x4a5178=_0xa1e56d();while(!![]){try{const _0x10c8ce=-parseInt(_0x5348e2(0x11f))/0x1+-parseInt(_0x5348e2(0x10a))/0x2*(parseInt(_0x5348e2(0x112))/0x3)+-parseInt(_0x5348e2(0x10e))/0x4+-parseInt(_0x5348e2(0x100))/0x5*(-parseInt(_0x5348e2(0x117))/0x6)+-parseInt(_0x5348e2(0x127))/0x7*(-parseInt(_0x5348e2(0x104))/0x8)+parseInt(_0x5348e2(0x115))/0x9+parseInt(_0x5348e2(0x102))/0xa*(parseInt(_0x5348e2(0x10b))/0xb);if(_0x10c8ce===_0x36fe45)break;else _0x4a5178['push'](_0x4a5178['shift']());}catch(_0x92782f){_0x4a5178['push'](_0x4a5178['shift']());}}}(a8_0x283f,0xea2e1));function a8_0x283f(){const _0x1289c9=['api.ts.tpl','../..','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','app','92OIaGCp','78199qEADmg','\x22\x20}','apiFucName','496248xIpowb','join','length','-client','3117VJHgYS','resolve','./src/api/','4183731sQsevh','replace','11459238btRMdS','client','slice','utf8','client.ts.tpl','success','code','online','1912562vaNcMv','.ts','env','{\x20apiConfigName:\x20\x22','keys','name',',\x20env:\x20\x22','CONFIG_NAMES.DEFAULT','994TKPiCS','replaceApiContent','-api','api','string','init-api','url','5KKCSzh','format','390XwFJfl','{\x20apiConfigName:\x20','22064cdOPod','tableName'];a8_0x283f=function(){return _0x1289c9;};return a8_0x283f();}import a8_0x3ff686 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a8_0x74ce64 from'node:path';function a8_0x2f91(_0x4ebc8f,_0x5478b2){const _0x283f67=a8_0x283f();return a8_0x2f91=function(_0x2f9141,_0x5a4c6c){_0x2f9141=_0x2f9141-0xfd;let _0x2dcaf8=_0x283f67[_0x2f9141];return _0x2dcaf8;},a8_0x2f91(_0x4ebc8f,_0x5478b2);}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';export async function generateApiFile(_0x4cefd2,_0x405f7c='',_0x5755c2,_0x5a18a2=![],_0x5d7d6a,_0x14b014=a8_0x111314(0x114)){const _0x30e6bf=a8_0x111314,_0x5c7843=readConfig(),_0xcde37d=_0x5755c2||_0x5c7843?.[_0x30e6bf(0x109)];if(typeof _0xcde37d!=='string'||!_0xcde37d)throw new Error(_0x30e6bf(0x108));const _0x5eca50=_0x5a18a2?_0x30e6bf(0x126):'\x22'+_0xcde37d+'\x22',_0x20af71=typeof _0x5c7843[_0x30e6bf(0x121)]===_0x30e6bf(0xfd)?_0x5c7843[_0x30e6bf(0x121)]:undefined,_0x8dcb14=_0x5d7d6a||_0x20af71||_0x30e6bf(0x11e),_0x473e94=_0x8dcb14!=='online';let _0x30695d;if(_0x5a18a2)_0x473e94?_0x30695d=_0x30e6bf(0x103)+_0x5eca50+_0x30e6bf(0x125)+_0x8dcb14+_0x30e6bf(0x10c):_0x30695d='';else{const _0x47e1ce=_0x473e94?_0x30e6bf(0x125)+_0x8dcb14+'\x22':'';_0x30695d=_0x30e6bf(0x122)+_0xcde37d+'\x22'+_0x47e1ce+'\x20}';}const _0x2c5fea=_0x405f7c?_0x405f7c+_0x30e6bf(0x129):_0x30e6bf(0x12a),_0x16b62a=_0x405f7c?_0x405f7c+_0x30e6bf(0x111):_0x30e6bf(0x118),_0x38ea6c=formatDataset(_0x4cefd2),_0x72db94={};_0x38ea6c['forEach'](_0xd0c55a=>{const _0x16276c=_0x30e6bf,_0x5e8794=_0xd0c55a[_0x16276c(0x10d)][_0x16276c(0x116)](/Api$/,''),_0x5a8f57=_0x5e8794['charAt'](0x0)['toUpperCase']()+_0x5e8794[_0x16276c(0x119)](0x1);_0x72db94[_0x5a8f57]={'tableName':_0xd0c55a[_0x16276c(0x105)],'datasetCode':_0xd0c55a[_0x16276c(0x11d)],'name':_0xd0c55a[_0x16276c(0x124)]||''};});const _0x17a25e=fileURLToPath(import.meta[_0x30e6bf(0xff)]),_0xc5e21d=a8_0x74ce64[_0x30e6bf(0x113)](a8_0x74ce64['dirname'](_0x17a25e),_0x30e6bf(0x107)),_0x34f2de=a8_0x74ce64[_0x30e6bf(0x10f)](_0xc5e21d,'templates/generate-api'),_0x743f5b=a8_0x74ce64[_0x30e6bf(0x10f)](_0x34f2de,_0x30e6bf(0x106)),_0x461917=a8_0x74ce64[_0x30e6bf(0x10f)](_0x34f2de,_0x30e6bf(0x11b)),_0x276b84=_0x14b014['endsWith']('/')?_0x14b014['slice'](0x0,-0x1):_0x14b014;mkdirSync(_0x276b84,{'recursive':!![]});const _0x59e613=readFileSync(_0x743f5b,'utf8'),_0x261bed=TemplateReplacer[_0x30e6bf(0x128)](_0x59e613,_0xcde37d,_0x72db94,Object[_0x30e6bf(0x123)](_0x72db94)[0x0],_0x2c5fea,_0x5eca50),_0x5edd4e=await a8_0x3ff686[_0x30e6bf(0x101)](_0x261bed,{'parser':'typescript'}),_0x13962e=_0x276b84+'/'+_0x2c5fea+_0x30e6bf(0x120);writeFileSync(_0x13962e,_0x5edd4e,{'encoding':_0x30e6bf(0x11a)});const _0x3ac419=readFileSync(_0x461917,'utf8'),_0x5833ee=TemplateReplacer[_0x30e6bf(0x128)](_0x3ac419,_0xcde37d,_0x72db94,Object[_0x30e6bf(0x123)](_0x72db94)[0x0],_0x2c5fea,_0x5eca50,_0x30695d),_0x28939a=await a8_0x3ff686[_0x30e6bf(0x101)](_0x5833ee,{'parser':'typescript'}),_0xa5fc1c=_0x276b84+'/'+_0x16b62a+_0x30e6bf(0x120);writeFileSync(_0xa5fc1c,_0x28939a,{'encoding':_0x30e6bf(0x11a)});const _0x29b738=Object[_0x30e6bf(0x123)](_0x72db94)[_0x30e6bf(0x110)];return logger[_0x30e6bf(0x11c)](_0x30e6bf(0xfe),'API\x20文件生成成功!',undefined,{'apiFile':_0x13962e,'clientFile':_0xa5fc1c,'modelCount':_0x29b738,'configName':_0x5eca50}),{'modelCount':_0x29b738,'apiFilePath':_0x13962e,'clientFilePath':_0xa5fc1c,'configName':_0x5eca50};}
1
+ const a8_0xfc8274=a8_0xea92;function a8_0x1040(){const _0x1e37e1=['endsWith','551625AOAQxj','utf8','186696zNdisY','string','length','tableName','3QtTski','app','-client','env','181386mSsmZZ','{\x20apiConfigName:\x20\x22','676406IgrbmZ','6rEeMyO',',\x20env:\x20\x22','templates/generate-api','code','-api','5510953dAOQja','{\x20apiConfigName:\x20','typescript','online','11WvWItx','modelName','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','slice','API\x20文件生成成功!','join','dirname','70RzVfID','init-api','url','forEach','keys','130XNkrjS','10856532jXssjl','CONFIG_NAMES.DEFAULT','.ts','./src/api/','api','replaceApiContent','4499152eGtufr'];a8_0x1040=function(){return _0x1e37e1;};return a8_0x1040();}function a8_0xea92(_0x58fcb9,_0x4a1bcf){const _0x104041=a8_0x1040();return a8_0xea92=function(_0xea92f4,_0x3673ff){_0xea92f4=_0xea92f4-0x82;let _0x11bf99=_0x104041[_0xea92f4];return _0x11bf99;},a8_0xea92(_0x58fcb9,_0x4a1bcf);}(function(_0x3a91d9,_0x3107ae){const _0x1b6d6a=a8_0xea92,_0x3995cc=_0x3a91d9();while(!![]){try{const _0x1e92f7=parseInt(_0x1b6d6a(0xa8))/0x1+parseInt(_0x1b6d6a(0x89))/0x2*(-parseInt(_0x1b6d6a(0x83))/0x3)+-parseInt(_0x1b6d6a(0xaa))/0x4*(parseInt(_0x1b6d6a(0x9a))/0x5)+parseInt(_0x1b6d6a(0x8a))/0x6*(parseInt(_0x1b6d6a(0x8f))/0x7)+-parseInt(_0x1b6d6a(0xa6))/0x8+-parseInt(_0x1b6d6a(0x87))/0x9*(parseInt(_0x1b6d6a(0x9f))/0xa)+parseInt(_0x1b6d6a(0x93))/0xb*(parseInt(_0x1b6d6a(0xa0))/0xc);if(_0x1e92f7===_0x3107ae)break;else _0x3995cc['push'](_0x3995cc['shift']());}catch(_0x4bfaa0){_0x3995cc['push'](_0x3995cc['shift']());}}}(a8_0x1040,0x6863c));import a8_0x2e34de from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a8_0x3cf416 from'node:path';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';export async function generateApiFile(_0x5b0fd3,_0x228f0c='',_0x4f7e5b,_0x246960=![],_0x188618,_0x2e949a=a8_0xfc8274(0xa3)){const _0x32bc03=a8_0xfc8274,_0x13ddc6=readConfig(),_0x4836e7=_0x4f7e5b||_0x13ddc6?.[_0x32bc03(0x84)];if(typeof _0x4836e7!==_0x32bc03(0xab)||!_0x4836e7)throw new Error(_0x32bc03(0x95));const _0x183ae7=_0x246960?_0x32bc03(0xa1):'\x22'+_0x4836e7+'\x22',_0x4a30f8=typeof _0x13ddc6['env']==='string'?_0x13ddc6[_0x32bc03(0x86)]:undefined,_0x510034=_0x188618||_0x4a30f8||_0x32bc03(0x92),_0xecf25e=_0x510034!==_0x32bc03(0x92);let _0x3853b4;if(_0x246960)_0xecf25e?_0x3853b4=_0x32bc03(0x90)+_0x183ae7+_0x32bc03(0x8b)+_0x510034+'\x22\x20}':_0x3853b4='';else{const _0x4f1cdd=_0xecf25e?_0x32bc03(0x8b)+_0x510034+'\x22':'';_0x3853b4=_0x32bc03(0x88)+_0x4836e7+'\x22'+_0x4f1cdd+'\x20}';}const _0x3729fa=_0x228f0c?_0x228f0c+_0x32bc03(0x8e):_0x32bc03(0xa4),_0x2f0de3=_0x228f0c?_0x228f0c+_0x32bc03(0x85):'client',_0x3d5595=formatDataset(_0x5b0fd3),_0x1ba2f1={};_0x3d5595[_0x32bc03(0x9d)](_0x22bf3f=>{const _0x4451f7=_0x32bc03;_0x1ba2f1[_0x22bf3f[_0x4451f7(0x94)]]={'tableName':_0x22bf3f[_0x4451f7(0x82)],'datasetCode':_0x22bf3f[_0x4451f7(0x8d)],'name':_0x22bf3f['name']||''};});const _0x2ca6db=fileURLToPath(import.meta[_0x32bc03(0x9c)]),_0x162496=a8_0x3cf416['resolve'](a8_0x3cf416[_0x32bc03(0x99)](_0x2ca6db),'../..'),_0x3c6aab=a8_0x3cf416[_0x32bc03(0x98)](_0x162496,_0x32bc03(0x8c)),_0xa6973b=a8_0x3cf416[_0x32bc03(0x98)](_0x3c6aab,'api.ts.tpl'),_0x343294=a8_0x3cf416['join'](_0x3c6aab,'client.ts.tpl'),_0x84c387=_0x2e949a[_0x32bc03(0xa7)]('/')?_0x2e949a[_0x32bc03(0x96)](0x0,-0x1):_0x2e949a;mkdirSync(_0x84c387,{'recursive':!![]});const _0x473e72=readFileSync(_0xa6973b,'utf8'),_0x45c312=TemplateReplacer[_0x32bc03(0xa5)](_0x473e72,_0x4836e7,_0x1ba2f1,Object[_0x32bc03(0x9e)](_0x1ba2f1)[0x0],_0x3729fa,_0x183ae7),_0x331b98=await a8_0x2e34de['format'](_0x45c312,{'parser':_0x32bc03(0x91)}),_0x2d3a16=_0x84c387+'/'+_0x3729fa+_0x32bc03(0xa2);writeFileSync(_0x2d3a16,_0x331b98,{'encoding':_0x32bc03(0xa9)});const _0x5df24f=readFileSync(_0x343294,_0x32bc03(0xa9)),_0x178252=TemplateReplacer[_0x32bc03(0xa5)](_0x5df24f,_0x4836e7,_0x1ba2f1,Object[_0x32bc03(0x9e)](_0x1ba2f1)[0x0],_0x3729fa,_0x183ae7,_0x3853b4),_0x364c57=await a8_0x2e34de['format'](_0x178252,{'parser':_0x32bc03(0x91)}),_0x1acea5=_0x84c387+'/'+_0x2f0de3+'.ts';writeFileSync(_0x1acea5,_0x364c57,{'encoding':'utf8'});const _0x590c13=Object[_0x32bc03(0x9e)](_0x1ba2f1)[_0x32bc03(0xac)];return logger['success'](_0x32bc03(0x9b),_0x32bc03(0x97),undefined,{'apiFile':_0x2d3a16,'clientFile':_0x1acea5,'modelCount':_0x590c13,'configName':_0x183ae7}),{'modelCount':_0x590c13,'apiFilePath':_0x2d3a16,'clientFilePath':_0x1acea5,'configName':_0x183ae7};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x272083,_0x277ab6){const _0x1ea955=a9_0x40c6,_0x1015a2=_0x272083();while(!![]){try{const _0x382034=parseInt(_0x1ea955(0x14d))/0x1+parseInt(_0x1ea955(0x150))/0x2*(-parseInt(_0x1ea955(0x153))/0x3)+parseInt(_0x1ea955(0x148))/0x4+-parseInt(_0x1ea955(0x13d))/0x5+-parseInt(_0x1ea955(0x140))/0x6*(parseInt(_0x1ea955(0x12e))/0x7)+-parseInt(_0x1ea955(0x12a))/0x8+parseInt(_0x1ea955(0x13a))/0x9;if(_0x382034===_0x277ab6)break;else _0x1015a2['push'](_0x1015a2['shift']());}catch(_0x5f5411){_0x1015a2['push'](_0x1015a2['shift']());}}}(a9_0x5623,0xb1e83));import{jsx as a9_0x142ba0}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a9_0x40c6(_0xe8181b,_0x1e8577){const _0x562325=a9_0x5623();return a9_0x40c6=function(_0x40c68f,_0x3fb2fb){_0x40c68f=_0x40c68f-0x121;let _0x35329e=_0x562325[_0x40c68f];return _0x35329e;},a9_0x40c6(_0xe8181b,_0x1e8577);}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x2b2eaf){const _0x446dab=a9_0x40c6,_0x2b65b7=_0x2b2eaf[_0x446dab(0x14b)][0x1];if(_0x2b2eaf[_0x446dab(0x14c)][_0x446dab(0x129)]){console[_0x446dab(0x134)](_0x446dab(0x128));return;}if(_0x2b65b7===_0x446dab(0x14e)){_0x2b2eaf[_0x446dab(0x14b)][0x2]&&(console[_0x446dab(0x126)](_0x446dab(0x14f)),console[_0x446dab(0x134)](_0x446dab(0x13e)),console[_0x446dab(0x134)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x2b2eaf['input'][0x2]),process[_0x446dab(0x149)](0x1));const _0x4a40aa=getConfigAppCode();let _0x36b85f=_0x2b2eaf[_0x446dab(0x14c)][_0x446dab(0x132)];const _0x4172c2=typeof _0x2b2eaf['flags'][_0x446dab(0x123)]===_0x446dab(0x144)?_0x2b2eaf[_0x446dab(0x14c)][_0x446dab(0x123)]:undefined,_0x2f8c50=_0x2b2eaf[_0x446dab(0x14c)][_0x446dab(0x141)];!_0x36b85f&&!_0x4a40aa&&(console[_0x446dab(0x126)](_0x446dab(0x13b)),console[_0x446dab(0x134)]('!\x20请使用以下方式之一:'),console[_0x446dab(0x134)](_0x446dab(0x12f)),console['log'](_0x446dab(0x13f)),process[_0x446dab(0x149)](0x1)),_0x36b85f&&_0x4a40aa&&_0x36b85f===_0x4a40aa&&(console[_0x446dab(0x134)](_0x446dab(0x130)+_0x36b85f+_0x446dab(0x127)),console[_0x446dab(0x134)](_0x446dab(0x12d)),_0x36b85f=undefined),render(a9_0x142ba0(ApiPullUI,{'appCode':_0x36b85f,'env':_0x4172c2,'output':_0x2f8c50}));}else{if(_0x2b65b7==='doc'){_0x2b2eaf[_0x446dab(0x14b)][0x2]&&(console[_0x446dab(0x126)](_0x446dab(0x14f)),console['log'](_0x446dab(0x13e)),console[_0x446dab(0x134)](_0x446dab(0x139)+_0x2b2eaf['input'][0x2]),process[_0x446dab(0x149)](0x1));const _0x2bc5d1=getConfigAppCode();let _0x43d776=_0x2b2eaf[_0x446dab(0x14c)][_0x446dab(0x132)];const _0x477b2a=typeof _0x2b2eaf[_0x446dab(0x14c)][_0x446dab(0x123)]===_0x446dab(0x144)?_0x2b2eaf[_0x446dab(0x14c)][_0x446dab(0x123)]:undefined,_0x5985fb=_0x2b2eaf['flags'][_0x446dab(0x141)],_0x486e33=_0x2b2eaf[_0x446dab(0x14c)]['params'],_0x5ac900=_0x2b2eaf[_0x446dab(0x14c)][_0x446dab(0x122)];!_0x43d776&&!_0x2bc5d1&&(console[_0x446dab(0x126)](_0x446dab(0x13b)),console[_0x446dab(0x134)](_0x446dab(0x125)),console[_0x446dab(0x134)](_0x446dab(0x12f)),console[_0x446dab(0x134)](_0x446dab(0x152)),process[_0x446dab(0x149)](0x1));_0x43d776&&_0x2bc5d1&&_0x43d776===_0x2bc5d1&&(console['log']('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x43d776+_0x446dab(0x127)),_0x43d776=undefined);let _0x1a46ae;if(_0x486e33)try{_0x1a46ae=JSON[_0x446dab(0x12c)](_0x486e33),(typeof _0x1a46ae!==_0x446dab(0x136)||_0x1a46ae===null||Array[_0x446dab(0x146)](_0x1a46ae))&&(console[_0x446dab(0x126)](_0x446dab(0x137)),process[_0x446dab(0x149)](0x1));}catch(_0x280083){console[_0x446dab(0x126)]('×\x20--params\x20参数不是有效的\x20JSON\x20格式'),console[_0x446dab(0x126)](_0x446dab(0x151)+(_0x280083 instanceof Error?_0x280083['message']:String(_0x280083))),process['exit'](0x1);}let _0x390993;_0x5ac900&&(_0x390993=_0x5ac900[_0x446dab(0x121)](',')[_0x446dab(0x131)](_0x4e4247=>_0x4e4247[_0x446dab(0x154)]())[_0x446dab(0x133)](_0x344322=>_0x344322[_0x446dab(0x13c)]>0x0),_0x390993['length']===0x0&&(console[_0x446dab(0x126)](_0x446dab(0x124)),process['exit'](0x1)),console[_0x446dab(0x134)]('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x390993[_0x446dab(0x138)](',\x20')+_0x446dab(0x127))),render(a9_0x142ba0(ApiDocUI,{'appCode':_0x43d776,'env':_0x477b2a,'output':_0x5985fb,'extraParams':_0x1a46ae,'datasetCodes':_0x390993}));}else console['error'](_0x446dab(0x12b)+_0x2b65b7),console[_0x446dab(0x134)]('Available\x20commands:'),console[_0x446dab(0x134)](_0x446dab(0x145)),console[_0x446dab(0x134)](_0x446dab(0x135)),console[_0x446dab(0x134)](_0x446dab(0x147)),console[_0x446dab(0x134)](_0x446dab(0x143)),console[_0x446dab(0x134)](''),console['log']('\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档'),console['log'](_0x446dab(0x14a)),console[_0x446dab(0x134)](_0x446dab(0x142)),console['log']('\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),process[_0x446dab(0x149)](0x1);}}function a9_0x5623(){const _0x1e772f=['string','\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配置文件','isArray','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','2458028fWmZOY','exit','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','input','flags','286073arIzPv','pull','❌\x20错误:不再支持位置参数方式','226354mbnLeD','\x20\x20错误:\x20','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','6FjTCem','trim','split','datasetcode','env','×\x20--datasetcode\x20参数不能为空','!\x20请使用以下方式之一:','error','\x1b[0m','\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','help','582128EtCZpM','Unknown\x20api\x20command:\x20','parse','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','1599941hjHiHk','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x1b[90m*\x20使用配置的应用AppCode:\x20','map','appcode','filter','log','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','object','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','join','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','9689535EGUZlN','×\x20未配置\x20AppCode','length','1318395MjgLzh','请使用\x20--appcode\x20参数,例如:','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','18KVzigq','output','\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--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'];a9_0x5623=function(){return _0x1e772f;};return a9_0x5623();}
1
+ function a9_0xd432(_0x4c09c8,_0x3b55da){const _0x14796a=a9_0x1479();return a9_0xd432=function(_0xd43221,_0xcc7b0d){_0xd43221=_0xd43221-0xaf;let _0x5a704d=_0x14796a[_0xd43221];return _0x5a704d;},a9_0xd432(_0x4c09c8,_0x3b55da);}(function(_0x26f6a8,_0x19cd37){const _0x4e2731=a9_0xd432,_0x30820f=_0x26f6a8();while(!![]){try{const _0xf80d3f=parseInt(_0x4e2731(0xd8))/0x1+-parseInt(_0x4e2731(0xe1))/0x2*(-parseInt(_0x4e2731(0xc6))/0x3)+parseInt(_0x4e2731(0xbd))/0x4*(parseInt(_0x4e2731(0xd6))/0x5)+-parseInt(_0x4e2731(0xb3))/0x6*(-parseInt(_0x4e2731(0xb7))/0x7)+parseInt(_0x4e2731(0xcd))/0x8+parseInt(_0x4e2731(0xd2))/0x9*(-parseInt(_0x4e2731(0xc7))/0xa)+-parseInt(_0x4e2731(0xc3))/0xb;if(_0xf80d3f===_0x19cd37)break;else _0x30820f['push'](_0x30820f['shift']());}catch(_0x35fda6){_0x30820f['push'](_0x30820f['shift']());}}}(a9_0x1479,0xcf646));import{jsx as a9_0x3e22cb}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x26ce8f){const _0x5c4148=a9_0xd432,_0x461c5f=_0x26ce8f[_0x5c4148(0xc4)][0x1];if(_0x26ce8f['flags']['help']){console[_0x5c4148(0xb6)](_0x5c4148(0xd7));return;}if(_0x461c5f===_0x5c4148(0xb1)){_0x26ce8f[_0x5c4148(0xc4)][0x2]&&(console[_0x5c4148(0xe0)](_0x5c4148(0xdf)),console['log'](_0x5c4148(0xc2)),console[_0x5c4148(0xb6)](_0x5c4148(0xb0)+_0x26ce8f[_0x5c4148(0xc4)][0x2]),process[_0x5c4148(0xba)](0x1));const _0x1f03b8=getConfigAppCode();let _0x2f191b=_0x26ce8f[_0x5c4148(0xd3)]['appcode'];const _0x4bb4ab=typeof _0x26ce8f[_0x5c4148(0xd3)][_0x5c4148(0xda)]===_0x5c4148(0xce)?_0x26ce8f[_0x5c4148(0xd3)]['env']:undefined,_0x5c0769=_0x26ce8f[_0x5c4148(0xd3)]['output'];!_0x2f191b&&!_0x1f03b8&&(console[_0x5c4148(0xe0)]('×\x20未配置\x20AppCode'),console[_0x5c4148(0xb6)](_0x5c4148(0xc5)),console[_0x5c4148(0xb6)](_0x5c4148(0xcf)),console[_0x5c4148(0xb6)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>'),process['exit'](0x1)),_0x2f191b&&_0x1f03b8&&_0x2f191b===_0x1f03b8&&(console[_0x5c4148(0xb6)](_0x5c4148(0xde)+_0x2f191b+_0x5c4148(0xb9)),console[_0x5c4148(0xb6)](_0x5c4148(0xbf)),_0x2f191b=undefined),render(a9_0x3e22cb(ApiPullUI,{'appCode':_0x2f191b,'env':_0x4bb4ab,'output':_0x5c0769}));}else{if(_0x461c5f==='doc'){_0x26ce8f[_0x5c4148(0xc4)][0x2]&&(console[_0x5c4148(0xe0)](_0x5c4148(0xdf)),console[_0x5c4148(0xb6)]('请使用\x20--appcode\x20参数,例如:'),console['log'](_0x5c4148(0xdc)+_0x26ce8f[_0x5c4148(0xc4)][0x2]),process[_0x5c4148(0xba)](0x1));const _0x353ca3=getConfigAppCode();let _0x272b42=_0x26ce8f[_0x5c4148(0xd3)][_0x5c4148(0xd1)];const _0x273984=typeof _0x26ce8f[_0x5c4148(0xd3)][_0x5c4148(0xda)]===_0x5c4148(0xce)?_0x26ce8f[_0x5c4148(0xd3)][_0x5c4148(0xda)]:undefined,_0x455aa9=_0x26ce8f[_0x5c4148(0xd3)]['output'],_0x409e11=_0x26ce8f[_0x5c4148(0xd3)][_0x5c4148(0xd0)],_0x103c9b=_0x26ce8f[_0x5c4148(0xd3)]['datasetcode'];!_0x272b42&&!_0x353ca3&&(console[_0x5c4148(0xe0)]('×\x20未配置\x20AppCode'),console[_0x5c4148(0xb6)](_0x5c4148(0xc5)),console[_0x5c4148(0xb6)](_0x5c4148(0xcf)),console[_0x5c4148(0xb6)](_0x5c4148(0xd5)),process[_0x5c4148(0xba)](0x1));_0x272b42&&_0x353ca3&&_0x272b42===_0x353ca3&&(console[_0x5c4148(0xb6)](_0x5c4148(0xde)+_0x272b42+_0x5c4148(0xb9)),_0x272b42=undefined);let _0x14c9a9;if(_0x409e11)try{_0x14c9a9=JSON[_0x5c4148(0xbc)](_0x409e11),(typeof _0x14c9a9!==_0x5c4148(0xaf)||_0x14c9a9===null||Array[_0x5c4148(0xb4)](_0x14c9a9))&&(console[_0x5c4148(0xe0)](_0x5c4148(0xb2)),process['exit'](0x1));}catch(_0x2624cc){console[_0x5c4148(0xe0)]('×\x20--params\x20参数不是有效的\x20JSON\x20格式'),console[_0x5c4148(0xe0)](_0x5c4148(0xc1)+(_0x2624cc instanceof Error?_0x2624cc[_0x5c4148(0xbe)]:String(_0x2624cc))),process['exit'](0x1);}let _0x38ce1b;_0x103c9b&&(_0x38ce1b=_0x103c9b['split'](',')[_0x5c4148(0xbb)](_0x2611f2=>_0x2611f2['trim']())[_0x5c4148(0xc9)](_0x7a94dd=>_0x7a94dd[_0x5c4148(0xb5)]>0x0),_0x38ce1b[_0x5c4148(0xb5)]===0x0&&(console['error'](_0x5c4148(0xdd)),process['exit'](0x1)),console[_0x5c4148(0xb6)](_0x5c4148(0xc8)+_0x38ce1b[_0x5c4148(0xcb)](',\x20')+'\x1b[0m')),render(a9_0x3e22cb(ApiDocUI,{'appCode':_0x272b42,'env':_0x273984,'output':_0x455aa9,'extraParams':_0x14c9a9,'datasetCodes':_0x38ce1b}));}else console[_0x5c4148(0xe0)]('Unknown\x20api\x20command:\x20'+_0x461c5f),console[_0x5c4148(0xb6)](_0x5c4148(0xd4)),console[_0x5c4148(0xb6)](_0x5c4148(0xd9)),console[_0x5c4148(0xb6)](_0x5c4148(0xdb)),console[_0x5c4148(0xb6)](_0x5c4148(0xc0)),console[_0x5c4148(0xb6)](_0x5c4148(0xe2)),console[_0x5c4148(0xb6)](''),console[_0x5c4148(0xb6)](_0x5c4148(0xca)),console[_0x5c4148(0xb6)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console[_0x5c4148(0xb6)](_0x5c4148(0xcc)),console[_0x5c4148(0xb6)](_0x5c4148(0xb8)),process[_0x5c4148(0xba)](0x1);}}function a9_0x1479(){const _0x5a6988=['env','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','×\x20--datasetcode\x20参数不能为空','\x1b[90m*\x20使用配置的应用AppCode:\x20','❌\x20错误:不再支持位置参数方式','error','2HGTVQz','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','object','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','pull','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','12woHIWg','isArray','length','log','2275301blLZDR','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x1b[0m','exit','map','parse','6652PBDpLK','message','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','\x20\x20错误:\x20','请使用\x20--appcode\x20参数,例如:','34490808dTLhNA','input','!\x20请使用以下方式之一:','1640805cxTAUV','10573670PYlOuS','\x1b[90m*\x20仅生成指定数据集的文档:\x20','filter','\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文档','join','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','13323560cvpDSt','string','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','params','appcode','9uXraxO','flags','Available\x20commands:','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','4315QowAEA','\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','744738MKIIwk','\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配置文件'];a9_0x1479=function(){return _0x5a6988;};return a9_0x1479();}
@@ -1 +1 @@
1
- (function(_0x525e26,_0x2193fe){const _0x52c134=a10_0x5829,_0x5c2578=_0x525e26();while(!![]){try{const _0x2a3604=-parseInt(_0x52c134(0x156))/0x1*(-parseInt(_0x52c134(0x158))/0x2)+-parseInt(_0x52c134(0x172))/0x3*(parseInt(_0x52c134(0x14c))/0x4)+parseInt(_0x52c134(0x157))/0x5+-parseInt(_0x52c134(0x15d))/0x6+parseInt(_0x52c134(0x177))/0x7+-parseInt(_0x52c134(0x152))/0x8*(parseInt(_0x52c134(0x16e))/0x9)+parseInt(_0x52c134(0x14f))/0xa;if(_0x2a3604===_0x2193fe)break;else _0x5c2578['push'](_0x5c2578['shift']());}catch(_0x4eeb7c){_0x5c2578['push'](_0x5c2578['shift']());}}}(a10_0x39e2,0x9648f));import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';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';function a10_0x39e2(){const _0x3e2ae9=['data','*\x20开始生成\x20API\x20配置文件:','\x20\x20\x20•\x20','1jeOtQi','496070WSuRxd','1357028uHagBc','status','&pageSize=999&currentPage=1',',且无法读取错误响应内容','modelCount','6905742VZpmGe','\x20个数据集,生成\x20','string','√\x20成功拉取\x20','online','-client','×\x20无法读取错误响应内容','text','.ts\x20-\x20客户端实例文件','×\x20服务器返回错误:','create-api-pull','.ts\x20-\x20模型配置文件','length','client','-api','message','未知错误','18slcRZZ','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','tableData','×\x20API\x20配置拉取异常:','78sWbuVW','url','API\x20配置拉取失败:\x20','×\x20错误详情:','获取数据集失败,原因:登录鉴权失败,登录已过期','1839719nRpIbz','\x20个模型','API\x20配置拉取异常:\x20','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','/smartapi/dataset/getList?appCode=','env','error','info','51616IFHkqJ','获取数据集失败,HTTP状态码:\x20','chdir','17688410GWFoIE','log','test','2829432hPtPzx'];a10_0x39e2=function(){return _0x3e2ae9;};return a10_0x39e2();}function a10_0x5829(_0x38211d,_0x1189db){const _0x39e257=a10_0x39e2();return a10_0x5829=function(_0x58292d,_0x252fd6){_0x58292d=_0x58292d-0x14c;let _0x535f63=_0x39e257[_0x58292d];return _0x535f63;},a10_0x5829(_0x38211d,_0x1189db);}export async function pullApiSilent(_0x1ef695,_0x34e338,_0x416243,_0x159b20){const _0xd7d943=a10_0x5829;let _0x44d7d0;try{const _0x5a134d=_0x34e338?.['trim']()||'';if(_0x5a134d){const _0xc48197=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0xc48197[_0xd7d943(0x151)](_0x5a134d))return console[_0xd7d943(0x17d)](_0xd7d943(0x17a)),![];}_0x416243&&(_0x44d7d0=process['cwd'](),process[_0xd7d943(0x14e)](_0x416243));const _0xfedc88=readConfig(),_0x1ca077=typeof _0xfedc88[_0xd7d943(0x17c)]===_0xd7d943(0x15f)?_0xfedc88[_0xd7d943(0x17c)]:undefined,_0x5dd550=_0x159b20||_0x1ca077||_0xd7d943(0x161);initEnv(_0x5dd550),console['log'](_0xd7d943(0x16f)+_0x5dd550+')');const _0x30d3b6=getApiDomain()+_0xd7d943(0x17b)+_0x1ef695+_0xd7d943(0x15a),_0x52d9bd=await httpRequest(_0x30d3b6,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x52d9bd['ok']){const _0x17ba6f=_0x52d9bd[_0xd7d943(0x153)];if(_0x17ba6f['success']){const _0x3a54f0=_0x5a134d?_0x5a134d+_0xd7d943(0x16b):'api',_0x148583=_0x5a134d?_0x5a134d+_0xd7d943(0x162):_0xd7d943(0x16a);console[_0xd7d943(0x150)](_0xd7d943(0x154)),console[_0xd7d943(0x150)]('\x20\x20\x20•\x20'+_0x3a54f0+_0xd7d943(0x168)),console[_0xd7d943(0x150)](_0xd7d943(0x155)+_0x148583+_0xd7d943(0x165)),console[_0xd7d943(0x150)]('*\x20正在处理\x20'+_0x17ba6f[_0xd7d943(0x153)][_0xd7d943(0x170)]['length']+'\x20个数据集...');const _0x1892db=await generateApiFile(_0x17ba6f['data'][_0xd7d943(0x170)],_0x5a134d,_0x1ef695,!![],_0x5dd550);return console[_0xd7d943(0x150)](_0xd7d943(0x160)+_0x17ba6f[_0xd7d943(0x153)][_0xd7d943(0x170)][_0xd7d943(0x169)]+_0xd7d943(0x15e)+_0x1892db[_0xd7d943(0x15c)]+_0xd7d943(0x178)),_0x416243&&logger[_0xd7d943(0x17e)]('create-api-pull','API\x20配置拉取成功:\x20'+_0x1ef695,{'projectPath':_0x416243,'appCode':_0x1ef695,'datasetCount':_0x17ba6f[_0xd7d943(0x153)]['tableData'][_0xd7d943(0x169)],'filePrefix':_0x5a134d}),!![];}else return console[_0xd7d943(0x17d)](_0xd7d943(0x166),_0x17ba6f[_0xd7d943(0x16c)]||_0xd7d943(0x16d)),_0x416243&&logger['error'](_0xd7d943(0x167),_0xd7d943(0x174)+(_0x17ba6f[_0xd7d943(0x16c)]||'未知错误'),{'projectPath':_0x416243,'appCode':_0x1ef695}),![];}else{if(_0x52d9bd[_0xd7d943(0x159)]===0x191){const _0x33fee6=_0xd7d943(0x176);console[_0xd7d943(0x17d)]('×\x20'+_0x33fee6),_0x416243&&logger[_0xd7d943(0x17d)](_0xd7d943(0x167),_0x33fee6,{'status':_0x52d9bd[_0xd7d943(0x159)],'appCode':_0x1ef695,'url':_0x52d9bd[_0xd7d943(0x173)],'projectPath':_0x416243});}else{const _0x145b62=_0xd7d943(0x14d)+_0x52d9bd[_0xd7d943(0x159)];console['error']('×\x20'+_0x145b62);try{const _0x352a33=await _0x52d9bd[_0xd7d943(0x164)]();_0x352a33&&console[_0xd7d943(0x17d)](_0xd7d943(0x175),_0x352a33),_0x416243&&logger['error'](_0xd7d943(0x167),_0x145b62,{'status':_0x52d9bd[_0xd7d943(0x159)],'appCode':_0x1ef695,'url':_0x52d9bd[_0xd7d943(0x173)],'errorBody':_0x352a33,'projectPath':_0x416243});}catch(_0x255da3){console[_0xd7d943(0x17d)](_0xd7d943(0x163)),_0x416243&&logger[_0xd7d943(0x17d)](_0xd7d943(0x167),_0x145b62+_0xd7d943(0x15b),{'status':_0x52d9bd[_0xd7d943(0x159)],'appCode':_0x1ef695,'url':_0x52d9bd[_0xd7d943(0x173)],'readError':_0x255da3 instanceof Error?_0x255da3[_0xd7d943(0x16c)]:String(_0x255da3),'projectPath':_0x416243});}}return![];}}catch(_0x34fdab){const _0x7992e9=_0x34fdab instanceof Error?_0x34fdab[_0xd7d943(0x16c)]:String(_0x34fdab);return console[_0xd7d943(0x17d)](_0xd7d943(0x171),_0x7992e9),_0x416243&&logger[_0xd7d943(0x17d)](_0xd7d943(0x167),_0xd7d943(0x179)+_0x7992e9,{'appCode':_0x1ef695,'projectPath':_0x416243}),![];}finally{_0x44d7d0&&process[_0xd7d943(0x14e)](_0x44d7d0);}}
1
+ function a10_0x31cb(_0x44e6f8,_0x217667){const _0x280543=a10_0x2805();return a10_0x31cb=function(_0x31cb39,_0x1364c6){_0x31cb39=_0x31cb39-0x81;let _0x5ed32a=_0x280543[_0x31cb39];return _0x5ed32a;},a10_0x31cb(_0x44e6f8,_0x217667);}(function(_0x5b2049,_0x3022a1){const _0x30f0d1=a10_0x31cb,_0x177b62=_0x5b2049();while(!![]){try{const _0x15a705=parseInt(_0x30f0d1(0x86))/0x1+parseInt(_0x30f0d1(0x8d))/0x2+-parseInt(_0x30f0d1(0x95))/0x3*(parseInt(_0x30f0d1(0xae))/0x4)+parseInt(_0x30f0d1(0x93))/0x5*(parseInt(_0x30f0d1(0x90))/0x6)+parseInt(_0x30f0d1(0x9e))/0x7+parseInt(_0x30f0d1(0x98))/0x8*(parseInt(_0x30f0d1(0x94))/0x9)+parseInt(_0x30f0d1(0x89))/0xa*(-parseInt(_0x30f0d1(0x82))/0xb);if(_0x15a705===_0x3022a1)break;else _0x177b62['push'](_0x177b62['shift']());}catch(_0x40543f){_0x177b62['push'](_0x177b62['shift']());}}}(a10_0x2805,0x321b9));import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';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(_0x19992b,_0x4dacf7,_0x580fe2,_0x1da2b5){const _0x48b6be=a10_0x31cb;let _0x75d47c;try{const _0x55768b=_0x4dacf7?.[_0x48b6be(0x8b)]()||'';if(_0x55768b){const _0x1023de=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x1023de['test'](_0x55768b))return console[_0x48b6be(0x99)](_0x48b6be(0xa8)),![];}_0x580fe2&&(_0x75d47c=process[_0x48b6be(0xa0)](),process[_0x48b6be(0xa7)](_0x580fe2));const _0x4a488e=readConfig(),_0x4c3590=typeof _0x4a488e['env']==='string'?_0x4a488e['env']:undefined,_0x3d8fb8=_0x1da2b5||_0x4c3590||_0x48b6be(0x9a);initEnv(_0x3d8fb8),console['log'](_0x48b6be(0xa1)+_0x3d8fb8+')');const _0x29a6ad=getApiDomain()+_0x48b6be(0x91)+_0x19992b+_0x48b6be(0x8c),_0x5df8bb=await httpRequest(_0x29a6ad,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x5df8bb['ok']){const _0x917df4=_0x5df8bb[_0x48b6be(0x87)];if(_0x917df4[_0x48b6be(0x97)]){const _0x22d9a2=_0x55768b?_0x55768b+_0x48b6be(0x8a):'api',_0x355730=_0x55768b?_0x55768b+_0x48b6be(0x9f):_0x48b6be(0x8f);console[_0x48b6be(0x88)]('*\x20开始生成\x20API\x20配置文件:'),console[_0x48b6be(0x88)]('\x20\x20\x20•\x20'+_0x22d9a2+_0x48b6be(0xaa)),console[_0x48b6be(0x88)](_0x48b6be(0x84)+_0x355730+_0x48b6be(0x9d)),console['log'](_0x48b6be(0x92)+_0x917df4[_0x48b6be(0x87)][_0x48b6be(0x81)][_0x48b6be(0x85)]+_0x48b6be(0xa2));const _0x47d4bc=await generateApiFile(_0x917df4[_0x48b6be(0x87)][_0x48b6be(0x81)],_0x55768b,_0x19992b,!![],_0x3d8fb8);return console[_0x48b6be(0x88)]('√\x20成功拉取\x20'+_0x917df4[_0x48b6be(0x87)]['tableData'][_0x48b6be(0x85)]+_0x48b6be(0xa4)+_0x47d4bc[_0x48b6be(0xa3)]+_0x48b6be(0x9c)),_0x580fe2&&logger[_0x48b6be(0x8e)](_0x48b6be(0x83),'API\x20配置拉取成功:\x20'+_0x19992b,{'projectPath':_0x580fe2,'appCode':_0x19992b,'datasetCount':_0x917df4['data'][_0x48b6be(0x81)][_0x48b6be(0x85)],'filePrefix':_0x55768b}),!![];}else return console[_0x48b6be(0x99)]('×\x20服务器返回错误:',_0x917df4[_0x48b6be(0xac)]||'未知错误'),_0x580fe2&&logger[_0x48b6be(0x99)](_0x48b6be(0x83),_0x48b6be(0xad)+(_0x917df4[_0x48b6be(0xac)]||'未知错误'),{'projectPath':_0x580fe2,'appCode':_0x19992b}),![];}else{if(_0x5df8bb['status']===0x191){const _0x231272=_0x48b6be(0xab);console[_0x48b6be(0x99)]('×\x20'+_0x231272),_0x580fe2&&logger['error'](_0x48b6be(0x83),_0x231272,{'status':_0x5df8bb[_0x48b6be(0x9b)],'appCode':_0x19992b,'url':_0x5df8bb['url'],'projectPath':_0x580fe2});}else{const _0x122b79=_0x48b6be(0xa6)+_0x5df8bb[_0x48b6be(0x9b)];console['error']('×\x20'+_0x122b79);try{const _0xbe4fbc=await _0x5df8bb['text']();_0xbe4fbc&&console[_0x48b6be(0x99)](_0x48b6be(0xa9),_0xbe4fbc),_0x580fe2&&logger['error']('create-api-pull',_0x122b79,{'status':_0x5df8bb[_0x48b6be(0x9b)],'appCode':_0x19992b,'url':_0x5df8bb['url'],'errorBody':_0xbe4fbc,'projectPath':_0x580fe2});}catch(_0x368dde){console[_0x48b6be(0x99)]('×\x20无法读取错误响应内容'),_0x580fe2&&logger[_0x48b6be(0x99)]('create-api-pull',_0x122b79+',且无法读取错误响应内容',{'status':_0x5df8bb[_0x48b6be(0x9b)],'appCode':_0x19992b,'url':_0x5df8bb['url'],'readError':_0x368dde instanceof Error?_0x368dde[_0x48b6be(0xac)]:String(_0x368dde),'projectPath':_0x580fe2});}}return![];}}catch(_0x5b608e){const _0x2bd424=_0x5b608e instanceof Error?_0x5b608e['message']:String(_0x5b608e);return console['error'](_0x48b6be(0x96),_0x2bd424),_0x580fe2&&logger[_0x48b6be(0x99)](_0x48b6be(0x83),_0x48b6be(0xa5)+_0x2bd424,{'appCode':_0x19992b,'projectPath':_0x580fe2}),![];}finally{_0x75d47c&&process['chdir'](_0x75d47c);}}function a10_0x2805(){const _0x7d32d1=['&pageSize=999&currentPage=1','116552ZtmsoI','info','client','3906WLfskB','/smartapi/dataset/getList?appCode=','*\x20正在处理\x20','140YZCNvc','7434QbnQla','1188138lxjxAq','×\x20API\x20配置拉取异常:','success','1112ZafTKv','error','online','status','\x20个模型','.ts\x20-\x20客户端实例文件','2698136XcYyZf','-client','cwd','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','\x20个数据集...','modelCount','\x20个数据集,生成\x20','API\x20配置拉取异常:\x20','获取数据集失败,HTTP状态码:\x20','chdir','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','×\x20错误详情:','.ts\x20-\x20模型配置文件','获取数据集失败,原因:登录鉴权失败,登录已过期','message','API\x20配置拉取失败:\x20','4qkmgBb','tableData','11oSPcnO','create-api-pull','\x20\x20\x20•\x20','length','311296RddCcM','data','log','2867750xqbVMW','-api','trim'];a10_0x2805=function(){return _0x7d32d1;};return a10_0x2805();}