@lovrabet/cli 1.1.8 → 1.1.9

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 (45) 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-pull-ui.js +1 -1
  5. package/lib/api/format-dataset.js +1 -1
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/api/main.js +1 -1
  8. package/lib/api/pull-silent.js +1 -1
  9. package/lib/api/pull.js +1 -1
  10. package/lib/auth/auth-server-ui.js +1 -1
  11. package/lib/auth/auth-server.js +1 -1
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.js +1 -1
  14. package/lib/auth/is-session-valid.js +1 -1
  15. package/lib/auth/logout.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/cmd/build-watch.js +1 -1
  18. package/lib/cmd/build.js +1 -1
  19. package/lib/cmd/logs.js +1 -1
  20. package/lib/cmd/preview.js +1 -1
  21. package/lib/cmd/start.js +1 -1
  22. package/lib/config/config-help.js +1 -1
  23. package/lib/config/main.js +1 -1
  24. package/lib/constant/domain.js +1 -1
  25. package/lib/constant/env.js +1 -1
  26. package/lib/create-app/enhanced-guided-create.js +1 -1
  27. package/lib/create-app/format-elapsed.js +1 -1
  28. package/lib/create-app/main.js +1 -1
  29. package/lib/create-app/task-finished.js +1 -1
  30. package/lib/create-app/task-loading.js +1 -1
  31. package/lib/create-app/task-running.js +1 -1
  32. package/lib/create-app/task-time.js +1 -1
  33. package/lib/create-app/use-copy-project-template.js +1 -1
  34. package/lib/create-app/use-format-code.js +1 -1
  35. package/lib/create-app/use-install-dependencies.js +1 -1
  36. package/lib/help.js +1 -1
  37. package/lib/utils/config.js +1 -1
  38. package/lib/utils/copy-directory.js +1 -1
  39. package/lib/utils/http-client.js +1 -1
  40. package/lib/utils/logger.js +1 -1
  41. package/lib/utils/router-updater.js +1 -1
  42. package/lib/utils/template-replacer.js +1 -1
  43. package/package.json +1 -1
  44. package/templates/projects/sub-app-react-demo/package-lock.json +4 -4
  45. package/templates/projects/sub-app-react-demo/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x2d9927,_0x922dcb){const _0x32993c=a0_0x3522,_0x2836ef=_0x2d9927();while(!![]){try{const _0x401f41=-parseInt(_0x32993c(0x9d))/0x1+parseInt(_0x32993c(0xa9))/0x2+parseInt(_0x32993c(0xa8))/0x3+-parseInt(_0x32993c(0x9b))/0x4+parseInt(_0x32993c(0xa7))/0x5+-parseInt(_0x32993c(0xaa))/0x6+-parseInt(_0x32993c(0x9e))/0x7*(-parseInt(_0x32993c(0xa6))/0x8);if(_0x401f41===_0x922dcb)break;else _0x2836ef['push'](_0x2836ef['shift']());}catch(_0x2d88f7){_0x2836ef['push'](_0x2836ef['shift']());}}}(a0_0x29c3,0x2bcac));import{jsx as a0_0x82848e,jsxs as a0_0x50db1b}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x44b443 from'node:fs';function a0_0x3522(_0x341bfb,_0x182aab){const _0x29c32f=a0_0x29c3();return a0_0x3522=function(_0x352285,_0x4193c6){_0x352285=_0x352285-0x94;let _0x507d4f=_0x29c32f[_0x352285];return _0x507d4f;},a0_0x3522(_0x341bfb,_0x182aab);}export function InputProjectCode(_0x3bebfb){const _0x3ae20a=a0_0x3522,{onSubmit:_0x126f22,pagePath:_0x4a6a21}=_0x3bebfb,[_0x23ae17,_0x5b3e25]=useState(''),[_0x2c54b6,_0x4ae6cc]=useState(''),_0x23997c='my-page';function _0x93f8b8(_0x4d4088){const _0x7bb17f=a0_0x3522;if(_0x4d4088['length']>0x64)return{'valid':![],'message':_0x7bb17f(0xa5)};if(_0x4d4088[_0x7bb17f(0xab)]('/')||_0x4d4088[_0x7bb17f(0xa4)]('/'))return{'valid':![],'message':_0x7bb17f(0xac)};if(_0x4d4088[_0x7bb17f(0xa3)]('//'))return{'valid':![],'message':_0x7bb17f(0x9a)};const _0x1c2bd2=_0x4d4088[_0x7bb17f(0xa2)]('/');for(const _0x3ce1f3 of _0x1c2bd2){if(!_0x3ce1f3)continue;const _0x5c0602=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x5c0602[_0x7bb17f(0x99)](_0x3ce1f3))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x342a8d,_0x518331)=>{const _0x1cd92e=a0_0x3522;if(_0x518331['return']){const _0x5a5cdc=_0x23ae17[_0x1cd92e(0xa0)]()||_0x23997c;if(_0x2c54b6)return;const _0xabdbf0=_0x4a6a21+'/'+_0x5a5cdc;if(a0_0x44b443[_0x1cd92e(0xaf)](_0xabdbf0)){_0x4ae6cc('页面路径\x20'+_0x5a5cdc+_0x1cd92e(0xae));return;}_0x126f22(_0x5a5cdc),_0x5b3e25(''),_0x4ae6cc('');}else _0x518331[_0x1cd92e(0x98)]||_0x518331[_0x1cd92e(0x94)]?_0x5b3e25(_0x2702ce=>{const _0xb7371d=_0x1cd92e,_0xdcaacc=_0x2702ce[_0xb7371d(0xad)](0x0,-0x1),{valid:_0x755181,message:_0x28c686}=_0x93f8b8(_0xdcaacc);return _0x4ae6cc(_0x755181?'':_0x28c686||_0xb7371d(0x97)),_0xdcaacc;}):_0x5b3e25(_0x72268c=>{const _0x134470=_0x72268c+_0x342a8d,{valid:_0x275619,message:_0xa0d330}=_0x93f8b8(_0x134470);return _0x4ae6cc(_0x275619?'':_0xa0d330||'页面路径不合法'),_0x134470;});}),a0_0x50db1b(Box,{'flexDirection':_0x3ae20a(0x96),'children':[a0_0x50db1b(Box,{'children':[a0_0x82848e(Text,{'color':_0x3ae20a(0x9f),'children':_0x3ae20a(0xa1)}),a0_0x82848e(Text,{'children':'页面路由地址:\x20'}),_0x23ae17?a0_0x82848e(Text,{'color':'green','children':_0x23ae17}):a0_0x82848e(Text,{'color':_0x3ae20a(0x9f),'children':_0x23997c}),_0x2c54b6&&a0_0x50db1b(Text,{'color':_0x3ae20a(0x95),'children':[_0x3ae20a(0x9c),_0x2c54b6]})]}),!_0x2c54b6&&!_0x23ae17&&a0_0x82848e(Box,{'children':a0_0x82848e(Text,{'color':'gray','children':'\x20直接回车确认,或输入自定义路由地址'})})]});}function a0_0x29c3(){const _0x3bf32c=['existsSync','delete','red','column','页面路径不合法','backspace','test','路径不能包含连续的\x20/','2468mwLQDK','\x20←\x20','278683KXSCDl','2396359sMefXZ','gray','trim','\x20Step2:\x20','split','includes','endsWith','页面路径长度不能超过\x20100\x20个字符','8wIFokk','87520HhVupi','71184iCaaBe','707482oPhJxR','1671828ZkfVXN','startsWith','路径不能以\x20/\x20开头或结尾','slice','\x20已存在,请使用其他路径'];a0_0x29c3=function(){return _0x3bf32c;};return a0_0x29c3();}
1
+ function a0_0x4e8c(_0xd50599,_0x566223){const _0x531f20=a0_0x531f();return a0_0x4e8c=function(_0x4e8cd0,_0x3d8f38){_0x4e8cd0=_0x4e8cd0-0xd9;let _0xdc4305=_0x531f20[_0x4e8cd0];return _0xdc4305;},a0_0x4e8c(_0xd50599,_0x566223);}function a0_0x531f(){const _0x23cad4=['delete','71821UMtUPx','length','7mKZsYW','split','页面路径\x20','gray','1725714DMauFX','my-page','10LtttIl','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','\x20Step2:\x20','4153448hHnhSU','2uJysHa','页面路径不合法','column','路径不能以\x20/\x20开头或结尾','endsWith','页面路径长度不能超过\x20100\x20个字符','980832EFltkn','existsSync','2002670KzHZAn','458128kETycN','页面路由地址:\x20','\x20直接回车确认,或输入自定义路由地址','464583RUELTX','test','\x20←\x20','路径不能包含连续的\x20/','red'];a0_0x531f=function(){return _0x23cad4;};return a0_0x531f();}(function(_0x5b1d47,_0x3c3c8){const _0x2a75ae=a0_0x4e8c,_0x495dce=_0x5b1d47();while(!![]){try{const _0xb48e59=parseInt(_0x2a75ae(0xde))/0x1*(-parseInt(_0x2a75ae(0xea))/0x2)+parseInt(_0x2a75ae(0xf6))/0x3+parseInt(_0x2a75ae(0xf3))/0x4+-parseInt(_0x2a75ae(0xf2))/0x5+parseInt(_0x2a75ae(0xf0))/0x6+-parseInt(_0x2a75ae(0xe0))/0x7*(-parseInt(_0x2a75ae(0xe9))/0x8)+-parseInt(_0x2a75ae(0xe4))/0x9*(parseInt(_0x2a75ae(0xe6))/0xa);if(_0xb48e59===_0x3c3c8)break;else _0x495dce['push'](_0x495dce['shift']());}catch(_0x26ca47){_0x495dce['push'](_0x495dce['shift']());}}}(a0_0x531f,0x464c9));import{jsx as a0_0x26ea40,jsxs as a0_0x185837}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x20a90e from'node:fs';export function InputProjectCode(_0x4fb1f8){const _0x2c5c55=a0_0x4e8c,{onSubmit:_0x104cb3,pagePath:_0x3a1c46}=_0x4fb1f8,[_0xa82e58,_0x41de3f]=useState(''),[_0x406031,_0x29ac9f]=useState(''),_0x164cb2=_0x2c5c55(0xe5);function _0x47fbbf(_0x772e10){const _0x2b96b1=_0x2c5c55;if(_0x772e10[_0x2b96b1(0xdf)]>0x64)return{'valid':![],'message':_0x2b96b1(0xef)};if(_0x772e10['startsWith']('/')||_0x772e10[_0x2b96b1(0xee)]('/'))return{'valid':![],'message':_0x2b96b1(0xed)};if(_0x772e10['includes']('//'))return{'valid':![],'message':_0x2b96b1(0xdb)};const _0x16c930=_0x772e10[_0x2b96b1(0xe1)]('/');for(const _0x1955f0 of _0x16c930){if(!_0x1955f0)continue;const _0x57660d=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x57660d[_0x2b96b1(0xd9)](_0x1955f0))return{'valid':![],'message':_0x2b96b1(0xe7)};}return{'valid':!![]};}return useInput((_0x57ac71,_0x28f544)=>{const _0x569e17=_0x2c5c55;if(_0x28f544['return']){const _0x4b3a2e=_0xa82e58['trim']()||_0x164cb2;if(_0x406031)return;const _0x454678=_0x3a1c46+'/'+_0x4b3a2e;if(a0_0x20a90e[_0x569e17(0xf1)](_0x454678)){_0x29ac9f(_0x569e17(0xe2)+_0x4b3a2e+'\x20已存在,请使用其他路径');return;}_0x104cb3(_0x4b3a2e),_0x41de3f(''),_0x29ac9f('');}else _0x28f544['backspace']||_0x28f544[_0x569e17(0xdd)]?_0x41de3f(_0x3b9c2e=>{const _0x7f00ab=_0x569e17,_0x20bd01=_0x3b9c2e['slice'](0x0,-0x1),{valid:_0x5b4cd3,message:_0x1cfbce}=_0x47fbbf(_0x20bd01);return _0x29ac9f(_0x5b4cd3?'':_0x1cfbce||_0x7f00ab(0xeb)),_0x20bd01;}):_0x41de3f(_0x55d665=>{const _0x267fdc=_0x569e17,_0x5354b5=_0x55d665+_0x57ac71,{valid:_0x37c6b1,message:_0x1444ad}=_0x47fbbf(_0x5354b5);return _0x29ac9f(_0x37c6b1?'':_0x1444ad||_0x267fdc(0xeb)),_0x5354b5;});}),a0_0x185837(Box,{'flexDirection':_0x2c5c55(0xec),'children':[a0_0x185837(Box,{'children':[a0_0x26ea40(Text,{'color':_0x2c5c55(0xe3),'children':_0x2c5c55(0xe8)}),a0_0x26ea40(Text,{'children':_0x2c5c55(0xf4)}),_0xa82e58?a0_0x26ea40(Text,{'color':'green','children':_0xa82e58}):a0_0x26ea40(Text,{'color':_0x2c5c55(0xe3),'children':_0x164cb2}),_0x406031&&a0_0x185837(Text,{'color':_0x2c5c55(0xdc),'children':[_0x2c5c55(0xda),_0x406031]})]}),!_0x406031&&!_0xa82e58&&a0_0x26ea40(Box,{'children':a0_0x26ea40(Text,{'color':_0x2c5c55(0xe3),'children':_0x2c5c55(0xf5)})})]});}
@@ -1 +1 @@
1
- const a1_0x598a23=a1_0x2015;(function(_0x14a8bf,_0x244b41){const _0x179c8a=a1_0x2015,_0x15e9aa=_0x14a8bf();while(!![]){try{const _0x1e6209=parseInt(_0x179c8a(0x184))/0x1+parseInt(_0x179c8a(0x181))/0x2*(parseInt(_0x179c8a(0x189))/0x3)+parseInt(_0x179c8a(0x197))/0x4*(parseInt(_0x179c8a(0x196))/0x5)+-parseInt(_0x179c8a(0x180))/0x6*(parseInt(_0x179c8a(0x183))/0x7)+parseInt(_0x179c8a(0x195))/0x8+parseInt(_0x179c8a(0x18c))/0x9+parseInt(_0x179c8a(0x19b))/0xa*(-parseInt(_0x179c8a(0x190))/0xb);if(_0x1e6209===_0x244b41)break;else _0x15e9aa['push'](_0x15e9aa['shift']());}catch(_0x4e91a1){_0x15e9aa['push'](_0x15e9aa['shift']());}}}(a1_0x76f4,0xb60d7));import{jsx as a1_0x29c919,jsxs as a1_0xc7d44c,Fragment as a1_0x126c0e}from'react/jsx-runtime';function a1_0x2015(_0x52786f,_0x827f6b){const _0x76f435=a1_0x76f4();return a1_0x2015=function(_0x20158e,_0x2f9ceb){_0x20158e=_0x20158e-0x176;let _0x447216=_0x76f435[_0x20158e];return _0x447216;},a1_0x2015(_0x52786f,_0x827f6b);}import{fileURLToPath}from'node:url';import a1_0x5ca495 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x76f4(){const _0x5508e3=['success','30MwameO','processTemplate','pages','7976826uMtOsZ','\x20*\x20页面文件已创建,可直接通过路由访问','url','\x20*\x20页面创建成功!','52657WBSdOp','已输入的页面路由\x20','cyan','src','gray','1274744UmDkmc','15ealYLV','628244DZmGYy','catch','join','resolve','1600KjzeiP','then','\x20Step1:\x20','setLogPath','cwd','\x20*\x20页面路径:\x20','dirname','green','error','now','正在创建页面,请稍候…','\x20Step2:\x20','info','6WBTobp','60952xERktm','已选择页面模板\x20','9241099qfcabv','1010164WMLPrP','finally','add-page','开始添加页面:\x20'];a1_0x76f4=function(){return _0x5508e3;};return a1_0x76f4();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x5ca495[a1_0x598a23(0x179)](fileURLToPath(import.meta[a1_0x598a23(0x18e)])),pageTemplateDir=a1_0x5ca495[a1_0x598a23(0x19a)](__dirname,'../../templates/pages'),projectDir=process[a1_0x598a23(0x177)]();export const AddPage=()=>{const _0x31b3bd=a1_0x598a23,{exit:_0x1bf321}=useApp(),[_0x1804bc,_0x1ced09]=useState(''),[_0x5bc1b8,_0x2fed51]=useState(''),[_0xf9f204,_0x4758c7]=useState(![]),[_0x4a513e,_0x5d0ef0]=useState(![]),_0x4e4109=a1_0x5ca495['join'](projectDir,'src','pages'),_0x49d363=a1_0x5ca495[_0x31b3bd(0x199)](_0x4e4109,_0x5bc1b8),_0x591956=a1_0x5ca495[_0x31b3bd(0x199)](_0x31b3bd(0x193),_0x31b3bd(0x18b),_0x5bc1b8);useEffect(()=>{const _0x48b771=_0x31b3bd,_0x3d859d=a1_0x5ca495[_0x48b771(0x19a)](pageTemplateDir,_0x1804bc);if(_0x1804bc&&_0x5bc1b8){_0x4758c7(!![]),logger[_0x48b771(0x176)](process['cwd']());const _0x70fd8d=Date[_0x48b771(0x17c)]();logger[_0x48b771(0x17f)](_0x48b771(0x186),_0x48b771(0x187)+_0x5bc1b8,{'template':_0x1804bc,'targetPath':_0x591956}),TemplateReplacer[_0x48b771(0x18a)](_0x3d859d,a1_0x5ca495[_0x48b771(0x199)](_0x4e4109,_0x5bc1b8),_0x5bc1b8,_0x1804bc)[_0x48b771(0x19c)](()=>{const _0x25a5e7=_0x48b771,_0x573783=Date[_0x25a5e7(0x17c)]()-_0x70fd8d;logger[_0x25a5e7(0x188)](_0x25a5e7(0x186),'页面添加成功:\x20'+_0x5bc1b8,_0x573783,{'template':_0x1804bc,'targetPath':_0x591956,'routePath':_0x5bc1b8}),_0x5d0ef0(!![]);})[_0x48b771(0x198)](_0x15f190=>{const _0x2a387a=_0x48b771,_0x3eb106=Date[_0x2a387a(0x17c)]()-_0x70fd8d;logger[_0x2a387a(0x17b)]('add-page','页面添加失败:\x20'+_0x5bc1b8,{'template':_0x1804bc,'targetPath':_0x591956,'error':_0x15f190 instanceof Error?_0x15f190['message']:String(_0x15f190),'duration':_0x3eb106});})[_0x48b771(0x185)](()=>{_0x4758c7(![]);});}},[_0x1804bc,_0x5bc1b8]),useEffect(()=>{_0x4a513e&&setTimeout(()=>{_0x1bf321();});},[_0x4a513e]);if(_0x1804bc)return a1_0xc7d44c(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0xc7d44c(Box,{'children':[a1_0x29c919(Text,{'color':_0x31b3bd(0x194),'children':_0x31b3bd(0x19d)}),a1_0x29c919(Text,{'children':_0x31b3bd(0x182)}),a1_0x29c919(Text,{'color':'green','children':_0x1804bc})]}),_0x5bc1b8?a1_0xc7d44c(Box,{'children':[a1_0x29c919(Text,{'color':'gray','children':_0x31b3bd(0x17e)}),a1_0x29c919(Text,{'children':_0x31b3bd(0x191)}),a1_0x29c919(Text,{'color':'green','children':_0x5bc1b8})]}):a1_0x29c919(InputProjectCode,{'pagePath':_0x49d363,'onSubmit':_0x2fed51}),_0x5bc1b8&&_0xf9f204?a1_0xc7d44c(Box,{'marginTop':0x1,'children':[a1_0x29c919(Box,{'width':'4'}),a1_0x29c919(Text,{'children':_0x31b3bd(0x17d)})]}):null,_0x4a513e?a1_0xc7d44c(a1_0x126c0e,{'children':[a1_0x29c919(Box,{'marginTop':0x1,'children':a1_0x29c919(Text,{'color':_0x31b3bd(0x194),'children':_0x31b3bd(0x18f)})}),a1_0xc7d44c(Box,{'children':[a1_0x29c919(Text,{'color':_0x31b3bd(0x194),'children':_0x31b3bd(0x178)}),a1_0x29c919(Text,{'color':_0x31b3bd(0x17a),'children':_0x591956})]}),a1_0xc7d44c(Box,{'children':[a1_0x29c919(Text,{'color':'gray','children':'\x20*\x20路由地址:\x20'}),a1_0xc7d44c(Text,{'color':'green','children':['/',_0x5bc1b8]})]}),a1_0x29c919(Box,{'marginTop':0x1,'children':a1_0x29c919(Text,{'color':_0x31b3bd(0x192),'children':_0x31b3bd(0x18d)})})]}):null]});return a1_0x29c919(SelectPageTemplate,{'onSelect':_0x1ced09});};
1
+ const a1_0x14a6c6=a1_0xcff5;(function(_0x3413a8,_0xc853c2){const _0x41f596=a1_0xcff5,_0x6d6e67=_0x3413a8();while(!![]){try{const _0x9b55e1=parseInt(_0x41f596(0x1bb))/0x1*(parseInt(_0x41f596(0x1af))/0x2)+-parseInt(_0x41f596(0x1b5))/0x3*(-parseInt(_0x41f596(0x1b9))/0x4)+-parseInt(_0x41f596(0x1a3))/0x5+-parseInt(_0x41f596(0x1b7))/0x6*(-parseInt(_0x41f596(0x1b2))/0x7)+parseInt(_0x41f596(0x1bf))/0x8*(parseInt(_0x41f596(0x1bd))/0x9)+-parseInt(_0x41f596(0x1a7))/0xa+-parseInt(_0x41f596(0x1b6))/0xb;if(_0x9b55e1===_0xc853c2)break;else _0x6d6e67['push'](_0x6d6e67['shift']());}catch(_0x5c6722){_0x6d6e67['push'](_0x6d6e67['shift']());}}}(a1_0x3e9c,0xed852));import{jsx as a1_0x5e70c2,jsxs as a1_0x347187,Fragment as a1_0x47a434}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x4897bf 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_0xcff5(_0x48e8c9,_0x3bc752){const _0x3e9c22=a1_0x3e9c();return a1_0xcff5=function(_0xcff527,_0x1108e6){_0xcff527=_0xcff527-0x1a2;let _0x22aeed=_0x3e9c22[_0xcff527];return _0x22aeed;},a1_0xcff5(_0x48e8c9,_0x3bc752);}import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x4897bf['dirname'](fileURLToPath(import.meta[a1_0x14a6c6(0x1a5)])),pageTemplateDir=a1_0x4897bf[a1_0x14a6c6(0x1b1)](__dirname,a1_0x14a6c6(0x1b8)),projectDir=process[a1_0x14a6c6(0x1be)]();function a1_0x3e9c(){const _0x84ed40=['error','6094170CGmMKp','\x20Step2:\x20','url','src','2519410nLhxbo','\x20*\x20路由地址:\x20','正在创建页面,请稍候…','页面添加成功:\x20','catch','\x20*\x20页面文件已创建,可直接通过路由访问','success','then','2GZtkgm','gray','resolve','2359XaexBi','join','now','6izbamg','16716172VGoiWj','7926PiAaPx','../../templates/pages','510604tryuXb','column','1639679shjaqR','info','14608359oIjbXR','cwd','8nZIqdY','green','\x20*\x20页面创建成功!','processTemplate','开始添加页面:\x20','setLogPath','add-page','pages'];a1_0x3e9c=function(){return _0x84ed40;};return a1_0x3e9c();}export const AddPage=()=>{const _0x1ba9a4=a1_0x14a6c6,{exit:_0x476ff6}=useApp(),[_0x39de59,_0x4b20a5]=useState(''),[_0x5a33ae,_0x47bfad]=useState(''),[_0x3a869e,_0x1ae624]=useState(![]),[_0x353286,_0x20808c]=useState(![]),_0x111c01=a1_0x4897bf[_0x1ba9a4(0x1b3)](projectDir,_0x1ba9a4(0x1a6),_0x1ba9a4(0x1c6)),_0x1dee9c=a1_0x4897bf[_0x1ba9a4(0x1b3)](_0x111c01,_0x5a33ae),_0x174a1f=a1_0x4897bf[_0x1ba9a4(0x1b3)](_0x1ba9a4(0x1a6),'pages',_0x5a33ae);useEffect(()=>{const _0x14d266=_0x1ba9a4,_0x5e9bef=a1_0x4897bf['resolve'](pageTemplateDir,_0x39de59);if(_0x39de59&&_0x5a33ae){_0x1ae624(!![]),logger[_0x14d266(0x1c4)](process[_0x14d266(0x1be)]());const _0x1cfc40=Date['now']();logger[_0x14d266(0x1bc)](_0x14d266(0x1c5),_0x14d266(0x1c3)+_0x5a33ae,{'template':_0x39de59,'targetPath':_0x174a1f}),TemplateReplacer[_0x14d266(0x1c2)](_0x5e9bef,a1_0x4897bf[_0x14d266(0x1b3)](_0x111c01,_0x5a33ae),_0x5a33ae,_0x39de59)[_0x14d266(0x1ae)](()=>{const _0x521bc6=_0x14d266,_0x5e43d3=Date[_0x521bc6(0x1b4)]()-_0x1cfc40;logger[_0x521bc6(0x1ad)]('add-page',_0x521bc6(0x1aa)+_0x5a33ae,_0x5e43d3,{'template':_0x39de59,'targetPath':_0x174a1f,'routePath':_0x5a33ae}),_0x20808c(!![]);})[_0x14d266(0x1ab)](_0x11cc2f=>{const _0x311084=_0x14d266,_0x121c9d=Date[_0x311084(0x1b4)]()-_0x1cfc40;logger[_0x311084(0x1a2)](_0x311084(0x1c5),'页面添加失败:\x20'+_0x5a33ae,{'template':_0x39de59,'targetPath':_0x174a1f,'error':_0x11cc2f instanceof Error?_0x11cc2f['message']:String(_0x11cc2f),'duration':_0x121c9d});})['finally'](()=>{_0x1ae624(![]);});}},[_0x39de59,_0x5a33ae]),useEffect(()=>{_0x353286&&setTimeout(()=>{_0x476ff6();});},[_0x353286]);if(_0x39de59)return a1_0x347187(Box,{'flexDirection':_0x1ba9a4(0x1ba),'paddingY':0x1,'children':[a1_0x347187(Box,{'children':[a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1b0),'children':'\x20Step1:\x20'}),a1_0x5e70c2(Text,{'children':'已选择页面模板\x20'}),a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1c0),'children':_0x39de59})]}),_0x5a33ae?a1_0x347187(Box,{'children':[a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1b0),'children':_0x1ba9a4(0x1a4)}),a1_0x5e70c2(Text,{'children':'已输入的页面路由\x20'}),a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1c0),'children':_0x5a33ae})]}):a1_0x5e70c2(InputProjectCode,{'pagePath':_0x1dee9c,'onSubmit':_0x47bfad}),_0x5a33ae&&_0x3a869e?a1_0x347187(Box,{'marginTop':0x1,'children':[a1_0x5e70c2(Box,{'width':'4'}),a1_0x5e70c2(Text,{'children':_0x1ba9a4(0x1a9)})]}):null,_0x353286?a1_0x347187(a1_0x47a434,{'children':[a1_0x5e70c2(Box,{'marginTop':0x1,'children':a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1b0),'children':_0x1ba9a4(0x1c1)})}),a1_0x347187(Box,{'children':[a1_0x5e70c2(Text,{'color':'gray','children':'\x20*\x20页面路径:\x20'}),a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1c0),'children':_0x174a1f})]}),a1_0x347187(Box,{'children':[a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1b0),'children':_0x1ba9a4(0x1a8)}),a1_0x347187(Text,{'color':_0x1ba9a4(0x1c0),'children':['/',_0x5a33ae]})]}),a1_0x5e70c2(Box,{'marginTop':0x1,'children':a1_0x5e70c2(Text,{'color':'cyan','children':_0x1ba9a4(0x1ac)})})]}):null]});return a1_0x5e70c2(SelectPageTemplate,{'onSelect':_0x4b20a5});};
@@ -1 +1 @@
1
- function a2_0x38b2(){const _0x48eace=['blank','42RZQply','resolve','322662WRdiuQ','label','isDirectory','484588YBUqOO','7582120avcbwb','column','正在加载页面模板...','803446JBLanE','10396449vuClzl','join','sort','dirname','3949365JOufaV','gray','\x20Step1:\x20','map','downArrow','14wXtzdJ','请选择您要创建的页面模板','1544132pdmJAA','length','templates/pages','url'];a2_0x38b2=function(){return _0x48eace;};return a2_0x38b2();}(function(_0x54e65d,_0x6e906a){const _0x5afba7=a2_0x32f1,_0x55ed53=_0x54e65d();while(!![]){try{const _0x8bc6c8=-parseInt(_0x5afba7(0x9d))/0x1+parseInt(_0x5afba7(0x91))/0x2*(-parseInt(_0x5afba7(0x9a))/0x3)+-parseInt(_0x5afba7(0x93))/0x4+-parseInt(_0x5afba7(0x8c))/0x5+-parseInt(_0x5afba7(0x98))/0x6*(-parseInt(_0x5afba7(0x87))/0x7)+parseInt(_0x5afba7(0x9e))/0x8+parseInt(_0x5afba7(0x88))/0x9;if(_0x8bc6c8===_0x6e906a)break;else _0x55ed53['push'](_0x55ed53['shift']());}catch(_0x28ec0a){_0x55ed53['push'](_0x55ed53['shift']());}}}(a2_0x38b2,0x785c8));import{jsx as a2_0x4a4b8a,jsxs as a2_0x42faa1}from'react/jsx-runtime';import{useState,useEffect}from'react';function a2_0x32f1(_0x2011f7,_0x5bfe99){const _0x38b29f=a2_0x38b2();return a2_0x32f1=function(_0x32f181,_0x5984cd){_0x32f181=_0x32f181-0x87;let _0x25c52b=_0x38b29f[_0x32f181];return _0x25c52b;},a2_0x32f1(_0x2011f7,_0x5bfe99);}import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x122cca from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x1caff1=a2_0x32f1;try{const _0x279a67=fileURLToPath(import.meta[_0x1caff1(0x96)]),_0x615297=a2_0x122cca[_0x1caff1(0x99)](a2_0x122cca[_0x1caff1(0x8b)](_0x279a67),'../..'),_0x4e78d5=a2_0x122cca[_0x1caff1(0x89)](_0x615297,_0x1caff1(0x95)),_0x1ee479=await readdir(_0x4e78d5,{'withFileTypes':!![]}),_0x1b097b=_0x1ee479['filter'](_0x291c88=>_0x291c88[_0x1caff1(0x9c)]())[_0x1caff1(0x8f)](_0x500900=>({'label':_0x500900['name']}))[_0x1caff1(0x8a)]((_0x4132b0,_0x4090c7)=>_0x4132b0[_0x1caff1(0x9b)]['localeCompare'](_0x4090c7[_0x1caff1(0x9b)]));return _0x1b097b;}catch(_0x3b3a5a){return console['error']('获取模板列表失败:',_0x3b3a5a),[{'label':_0x1caff1(0x97)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x4536cd){const _0x2ab132=a2_0x32f1,[_0x5a3337,_0x4f0248]=useState(0x0),[_0x59e0db,_0x551b1c]=useState([]),[_0x5f0d79,_0x29be37]=useState(!![]);useEffect(()=>{async function _0x30ea6a(){const _0x38ef5f=await getTemplateList();_0x551b1c(_0x38ef5f),_0x29be37(![]);}_0x30ea6a();},[]),useInput((_0x2bbe88,_0x126dbc)=>{const _0x50c4c3=a2_0x32f1;if(_0x5f0d79)return;if(_0x126dbc['return']){const _0x453466=_0x59e0db[_0x5a3337];_0x453466&&_0x4536cd['onSelect'](_0x453466[_0x50c4c3(0x9b)]);}_0x126dbc['upArrow']&&_0x4f0248(_0xaba88f=>_0xaba88f===0x0?_0x59e0db[_0x50c4c3(0x94)]-0x1:_0xaba88f-0x1),_0x126dbc[_0x50c4c3(0x90)]&&_0x4f0248(_0x119082=>_0x119082===_0x59e0db[_0x50c4c3(0x94)]-0x1?0x0:_0x119082+0x1);});if(_0x5f0d79)return a2_0x4a4b8a(Box,{'flexDirection':_0x2ab132(0x9f),'paddingY':0x1,'children':a2_0x42faa1(Box,{'children':[a2_0x4a4b8a(Text,{'color':_0x2ab132(0x8d),'children':_0x2ab132(0x8e)}),a2_0x4a4b8a(Text,{'children':_0x2ab132(0xa0)})]})});return a2_0x42faa1(Box,{'flexDirection':_0x2ab132(0x9f),'paddingY':0x1,'children':[a2_0x42faa1(Box,{'children':[a2_0x4a4b8a(Text,{'color':_0x2ab132(0x8d),'children':_0x2ab132(0x8e)}),a2_0x4a4b8a(Text,{'children':_0x2ab132(0x92)})]}),_0x59e0db[_0x2ab132(0x8f)]((_0x23e954,_0x2fc5c8)=>{const _0x4b4066=_0x2ab132,_0x5673f3=_0x2fc5c8===_0x5a3337,_0x18877f=_0x5673f3?'\x20\x20\x20\x20\x20\x20>\x20'+_0x23e954[_0x4b4066(0x9b)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x23e954[_0x4b4066(0x9b)];return a2_0x4a4b8a(Box,{'children':a2_0x4a4b8a(Text,{'color':_0x5673f3?'green':undefined,'children':_0x18877f})},_0x18877f);})]});}
1
+ function a2_0x5a18(_0x44248e,_0x6c2d05){const _0x40a0a5=a2_0x40a0();return a2_0x5a18=function(_0x5a1830,_0x2d4511){_0x5a1830=_0x5a1830-0x17a;let _0x3793a5=_0x40a0a5[_0x5a1830];return _0x3793a5;},a2_0x5a18(_0x44248e,_0x6c2d05);}(function(_0x1816aa,_0x3b16b0){const _0x1b5bc6=a2_0x5a18,_0x2c049c=_0x1816aa();while(!![]){try{const _0x438bad=parseInt(_0x1b5bc6(0x187))/0x1*(parseInt(_0x1b5bc6(0x19c))/0x2)+-parseInt(_0x1b5bc6(0x191))/0x3+parseInt(_0x1b5bc6(0x186))/0x4*(-parseInt(_0x1b5bc6(0x18c))/0x5)+parseInt(_0x1b5bc6(0x17f))/0x6+parseInt(_0x1b5bc6(0x194))/0x7*(parseInt(_0x1b5bc6(0x197))/0x8)+-parseInt(_0x1b5bc6(0x192))/0x9+parseInt(_0x1b5bc6(0x193))/0xa;if(_0x438bad===_0x3b16b0)break;else _0x2c049c['push'](_0x2c049c['shift']());}catch(_0x58ca8b){_0x2c049c['push'](_0x2c049c['shift']());}}}(a2_0x40a0,0x3fc65));import{jsx as a2_0x280047,jsxs as a2_0x2bc691}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x306911 from'node:path';import{fileURLToPath}from'node:url';function a2_0x40a0(){const _0x100526=['label','gray','length','585882kekacg','2212605klsJTQ','3905800QloZnM','410893mxKrqJ','resolve','正在加载页面模板...','56gggMOE','isDirectory','url','sdk-fetch','获取模板列表失败:','99406ciYznk','../..','filter','column','templates/pages','sort','1834500tPtWHx','map','dirname','name','请选择您要创建的页面模板','onSelect','green','2017076ipEmDE','2wWTqkD','\x20\x20\x20\x20\x20\x20>\x20','\x20Step1:\x20','downArrow','return','5fTxnMM','blank'];a2_0x40a0=function(){return _0x100526;};return a2_0x40a0();}async function getTemplateList(){const _0x204bb2=a2_0x5a18;try{const _0x294a31=fileURLToPath(import.meta[_0x204bb2(0x199)]),_0x4ba8ac=a2_0x306911[_0x204bb2(0x195)](a2_0x306911[_0x204bb2(0x181)](_0x294a31),_0x204bb2(0x17a)),_0x2a7354=a2_0x306911['join'](_0x4ba8ac,_0x204bb2(0x17d)),_0x2ec324=await readdir(_0x2a7354,{'withFileTypes':!![]}),_0x4d4feb=_0x2ec324[_0x204bb2(0x17b)](_0x1bea8d=>_0x1bea8d[_0x204bb2(0x198)]())[_0x204bb2(0x180)](_0x2083ef=>({'label':_0x2083ef[_0x204bb2(0x182)]}))[_0x204bb2(0x17e)]((_0x16a754,_0x4d3c52)=>_0x16a754[_0x204bb2(0x18e)]['localeCompare'](_0x4d3c52[_0x204bb2(0x18e)]));return _0x4d4feb;}catch(_0x17e73a){return console['error'](_0x204bb2(0x19b),_0x17e73a),[{'label':_0x204bb2(0x18d)},{'label':_0x204bb2(0x19a)}];}}export function SelectPageTemplate(_0x34fcd3){const _0x4130d4=a2_0x5a18,[_0x457a76,_0x487cc5]=useState(0x0),[_0x54b3a3,_0x435237]=useState([]),[_0x597e4b,_0x3579fc]=useState(!![]);useEffect(()=>{async function _0x5cb910(){const _0xccf7d2=await getTemplateList();_0x435237(_0xccf7d2),_0x3579fc(![]);}_0x5cb910();},[]),useInput((_0x2dd2f9,_0x1ffa6d)=>{const _0x150057=a2_0x5a18;if(_0x597e4b)return;if(_0x1ffa6d[_0x150057(0x18b)]){const _0x9b32c6=_0x54b3a3[_0x457a76];_0x9b32c6&&_0x34fcd3[_0x150057(0x184)](_0x9b32c6['label']);}_0x1ffa6d['upArrow']&&_0x487cc5(_0x4be6ac=>_0x4be6ac===0x0?_0x54b3a3[_0x150057(0x190)]-0x1:_0x4be6ac-0x1),_0x1ffa6d[_0x150057(0x18a)]&&_0x487cc5(_0x40b07e=>_0x40b07e===_0x54b3a3['length']-0x1?0x0:_0x40b07e+0x1);});if(_0x597e4b)return a2_0x280047(Box,{'flexDirection':_0x4130d4(0x17c),'paddingY':0x1,'children':a2_0x2bc691(Box,{'children':[a2_0x280047(Text,{'color':_0x4130d4(0x18f),'children':_0x4130d4(0x189)}),a2_0x280047(Text,{'children':_0x4130d4(0x196)})]})});return a2_0x2bc691(Box,{'flexDirection':_0x4130d4(0x17c),'paddingY':0x1,'children':[a2_0x2bc691(Box,{'children':[a2_0x280047(Text,{'color':_0x4130d4(0x18f),'children':_0x4130d4(0x189)}),a2_0x280047(Text,{'children':_0x4130d4(0x183)})]}),_0x54b3a3[_0x4130d4(0x180)]((_0xc3df1a,_0x42c643)=>{const _0x3e09ee=_0x4130d4,_0x1cf9af=_0x42c643===_0x457a76,_0x2738a3=_0x1cf9af?_0x3e09ee(0x188)+_0xc3df1a['label']:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0xc3df1a[_0x3e09ee(0x18e)];return a2_0x280047(Box,{'children':a2_0x280047(Text,{'color':_0x1cf9af?_0x3e09ee(0x185):undefined,'children':_0x2738a3})},_0x2738a3);})]});}
@@ -1 +1 @@
1
- (function(_0x3a325c,_0x342490){const _0x297f27=a3_0x2a43,_0x1ec1df=_0x3a325c();while(!![]){try{const _0x21b86a=parseInt(_0x297f27(0x135))/0x1*(-parseInt(_0x297f27(0x12c))/0x2)+parseInt(_0x297f27(0x111))/0x3+-parseInt(_0x297f27(0x107))/0x4*(-parseInt(_0x297f27(0x11b))/0x5)+parseInt(_0x297f27(0x100))/0x6*(parseInt(_0x297f27(0x118))/0x7)+parseInt(_0x297f27(0x10f))/0x8*(parseInt(_0x297f27(0x129))/0x9)+-parseInt(_0x297f27(0x128))/0xa+parseInt(_0x297f27(0x10e))/0xb*(-parseInt(_0x297f27(0x113))/0xc);if(_0x21b86a===_0x342490)break;else _0x1ec1df['push'](_0x1ec1df['shift']());}catch(_0x432974){_0x1ec1df['push'](_0x1ec1df['shift']());}}}(a3_0x5af5,0xaa865));import{jsx as a3_0x1122bb,jsxs as a3_0x5dfdb2}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig}from'../utils/config.js';function a3_0x2a43(_0x245445,_0x3d0a65){const _0x5af56b=a3_0x5af5();return a3_0x2a43=function(_0x2a437d,_0x273a7c){_0x2a437d=_0x2a437d-0xfe;let _0x2338e9=_0x5af56b[_0x2a437d];return _0x2338e9;},a3_0x2a43(_0x245445,_0x3d0a65);}function a3_0x5af5(){const _0x1e3c65=['*\x20已生成文件:','6yPrApD','拉取\x20API\x20配置失败:\x20','status','setLogPath','includes','error','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','8gkEhuW','column','./src/api/','√\x20API\x20文件生成成功!','\x20-\x20模型配置文件','gray','json','1331XuWRbb','104wHWbLb','replace','899154YUntwE','-api','205188gURpun','red','dim',',且无法读取错误响应内容','data','9425136qZZsMr','green','api-pull','2342350LmhenL','client','\x20重新登录后再试','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','cyan','import\x20','message','lovrabet\x20auth','endsWith','split','使用指定的应用AppCode:\x20','join','string','6400510cSfLTb','612162bxNcaM','yellow','-client','366aeZFoV','success','\x20from\x20\x27@/','url','white','tableData','*\x20导入方式:','.ts','💡\x20请使用\x20','327OnFxbW','未提供应用AppCode,且配置中也没有默认值','env','api'];a3_0x5af5=function(){return _0x1e3c65;};return a3_0x5af5();}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';export const ApiPullUI=({appCode:_0x285624,env:_0x2e1329,output:_0x1dfc73})=>{const _0x4756e0=a3_0x2a43,{exit:_0x4d4fb9}=useApp(),[_0x30d3ca,_0xe22220]=useState(![]),[_0x49b027,_0x20a620]=useState(![]),[_0x42ca94,_0x44ca0c]=useState(null),[_0x5c048a,_0x1195d2]=useState(null),_0x1267fc=readConfig(),_0x4bf246=_0x285624||_0x1267fc?.['app'],_0x4456da=typeof _0x1267fc?.[_0x4756e0(0x137)]===_0x4756e0(0x127)?_0x1267fc[_0x4756e0(0x137)]:undefined,_0x318064=_0x2e1329||_0x4456da||'online';initEnv(_0x318064);const _0x1b2b2a=_0x1dfc73||_0x4756e0(0x109),_0x43e15b=_0x285624&&_0x285624[_0x4756e0(0x104)]('-')?_0x285624[_0x4756e0(0x124)]('-')['slice'](0x1)[_0x4756e0(0x126)]('-'):'',_0x49dd4e=_0x285624?_0x4756e0(0x125)+_0x4bf246:'使用配置的应用AppCode:\x20'+_0x4bf246,_0x2cd643=_0x43e15b?_0x43e15b+_0x4756e0(0x112):_0x4756e0(0xfe),_0xa3937b=_0x43e15b?_0x43e15b+_0x4756e0(0x12b):_0x4756e0(0x11c);useEffect(()=>{_0xe22220(!![]),_0x42db15();},[]),useEffect(()=>{(_0x49b027||_0x42ca94)&&_0x4d4fb9();},[_0x49b027,_0x42ca94,_0x4d4fb9]);async function _0x42db15(){const _0x40c670=_0x4756e0;if(!_0x4bf246){_0x44ca0c(_0x40c670(0x136));return;}try{logger[_0x40c670(0x103)](process['cwd']());const _0x8f2673=await fetch(getApiDomain()+'/smartapi/dataset/getList?appCode='+_0x4bf246+'&pageSize=999&currentPage=1',{'headers':{'Cookie':getCookie()}});if(_0x8f2673['ok']){const _0x1fc34f=await _0x8f2673[_0x40c670(0x10d)]();if(_0x1fc34f[_0x40c670(0x12d)]){const _0x494703=!_0x285624;await generateApiFile(_0x1fc34f[_0x40c670(0x117)][_0x40c670(0x131)],_0x43e15b,_0x4bf246,_0x494703,_0x318064,_0x1b2b2a);const _0x411a6b=_0x1b2b2a[_0x40c670(0x123)]('/')?_0x1b2b2a:_0x1b2b2a+'/';_0x1195d2({'api':''+_0x411a6b+_0x2cd643+_0x40c670(0x133),'client':''+_0x411a6b+_0xa3937b+_0x40c670(0x133)}),_0x20a620(!![]);}}else{if(_0x8f2673[_0x40c670(0x102)]===0x191){const _0x58182e=_0x40c670(0x11e);logger[_0x40c670(0x105)](_0x40c670(0x11a),_0x58182e,{'status':_0x8f2673[_0x40c670(0x102)],'appCode':_0x4bf246,'url':_0x8f2673[_0x40c670(0x12f)]}),_0x44ca0c(_0x58182e);}else{const _0x3f5534='获取数据集失败,HTTP状态码:\x20'+_0x8f2673[_0x40c670(0x102)];try{const _0x206fad=await _0x8f2673['text']();_0x206fad?logger[_0x40c670(0x105)](_0x40c670(0x11a),_0x3f5534,{'status':_0x8f2673[_0x40c670(0x102)],'appCode':_0x4bf246,'url':_0x8f2673[_0x40c670(0x12f)],'errorBody':_0x206fad}):logger['error']('api-pull',_0x3f5534,{'status':_0x8f2673[_0x40c670(0x102)],'appCode':_0x4bf246,'url':_0x8f2673['url']});}catch(_0x1fad36){logger[_0x40c670(0x105)](_0x40c670(0x11a),_0x3f5534+_0x40c670(0x116),{'status':_0x8f2673[_0x40c670(0x102)],'appCode':_0x4bf246,'url':_0x8f2673[_0x40c670(0x12f)],'readError':_0x1fad36 instanceof Error?_0x1fad36[_0x40c670(0x121)]:String(_0x1fad36)});}_0x44ca0c(_0x3f5534);}}}catch(_0x1414db){const _0x53186c=_0x1414db instanceof Error?_0x1414db[_0x40c670(0x121)]:String(_0x1414db);_0x44ca0c(_0x40c670(0x101)+_0x53186c);}finally{_0xe22220(![]);}}return a3_0x5dfdb2(Box,{'flexDirection':_0x4756e0(0x108),'children':[a3_0x5dfdb2(Box,{'children':[a3_0x1122bb(Text,{'color':_0x4756e0(0x10c),'children':'*\x20'}),a3_0x1122bb(Text,{'color':_0x285624?_0x4756e0(0x130):_0x4756e0(0x115),'children':_0x49dd4e})]}),a3_0x5dfdb2(Box,{'children':[a3_0x1122bb(Text,{'color':_0x4756e0(0x10c),'children':'*\x20将生成文件:\x20'}),a3_0x5dfdb2(Text,{'color':'cyan','children':[_0x2cd643,'.ts']}),a3_0x1122bb(Text,{'color':_0x4756e0(0x115),'children':'\x20和\x20'}),a3_0x5dfdb2(Text,{'color':_0x4756e0(0x11f),'children':[_0xa3937b,'.ts']})]}),_0x30d3ca&&a3_0x1122bb(Box,{'children':a3_0x5dfdb2(Text,{'children':[_0x4756e0(0x106),_0x318064,')']})}),_0x49b027&&_0x5c048a&&a3_0x5dfdb2(Box,{'flexDirection':_0x4756e0(0x108),'children':[a3_0x1122bb(Box,{'children':a3_0x1122bb(Text,{'color':_0x4756e0(0x119),'children':_0x4756e0(0x10a)})}),a3_0x1122bb(Box,{'marginTop':0x1,'children':a3_0x1122bb(Text,{'color':_0x4756e0(0x10c),'children':_0x4756e0(0xff)})}),a3_0x5dfdb2(Box,{'marginLeft':0x2,'children':[a3_0x5dfdb2(Text,{'color':_0x4756e0(0x11f),'children':['•\x20',_0x5c048a['api']]}),a3_0x1122bb(Text,{'color':_0x4756e0(0x115),'children':_0x4756e0(0x10b)})]}),a3_0x5dfdb2(Box,{'marginLeft':0x2,'children':[a3_0x5dfdb2(Text,{'color':_0x4756e0(0x11f),'children':['•\x20',_0x5c048a[_0x4756e0(0x11c)]]}),a3_0x1122bb(Text,{'color':_0x4756e0(0x115),'children':'\x20-\x20客户端实例文件'})]}),a3_0x1122bb(Box,{'marginTop':0x1,'children':a3_0x1122bb(Text,{'color':'gray','children':_0x4756e0(0x132)})}),a3_0x1122bb(Box,{'marginLeft':0x2,'children':a3_0x5dfdb2(Text,{'color':_0x4756e0(0x12a),'children':[_0x4756e0(0x120),'{\x20lovrabetClient\x20}',_0x4756e0(0x12e),_0x5c048a[_0x4756e0(0x11c)][_0x4756e0(0x110)](/^\.\//,'')['replace'](/^src\//,'')[_0x4756e0(0x110)](_0x4756e0(0x133),''),'\x27']})})]}),_0x42ca94&&a3_0x5dfdb2(Box,{'flexDirection':'column','children':[a3_0x1122bb(Box,{'children':a3_0x5dfdb2(Text,{'color':_0x4756e0(0x114),'children':['❌\x20',_0x42ca94]})}),_0x42ca94[_0x4756e0(0x104)]('登录')&&a3_0x5dfdb2(Box,{'marginTop':0x1,'children':[a3_0x1122bb(Text,{'color':_0x4756e0(0x12a),'children':_0x4756e0(0x134)}),a3_0x1122bb(Text,{'color':'cyan','children':_0x4756e0(0x122)}),a3_0x1122bb(Text,{'color':_0x4756e0(0x12a),'children':_0x4756e0(0x11d)})]})]})]});};
1
+ (function(_0x3de300,_0x5b7d20){const _0x1f06af=a3_0xf095,_0x6a04e5=_0x3de300();while(!![]){try{const _0x258521=parseInt(_0x1f06af(0x14d))/0x1+parseInt(_0x1f06af(0x169))/0x2+parseInt(_0x1f06af(0x177))/0x3+-parseInt(_0x1f06af(0x15f))/0x4*(-parseInt(_0x1f06af(0x14b))/0x5)+-parseInt(_0x1f06af(0x147))/0x6*(parseInt(_0x1f06af(0x168))/0x7)+parseInt(_0x1f06af(0x164))/0x8+-parseInt(_0x1f06af(0x157))/0x9*(parseInt(_0x1f06af(0x15d))/0xa);if(_0x258521===_0x5b7d20)break;else _0x6a04e5['push'](_0x6a04e5['shift']());}catch(_0x31fb58){_0x6a04e5['push'](_0x6a04e5['shift']());}}}(a3_0x4302,0xf0968));import{jsx as a3_0x239839,jsxs as a3_0x2c8b61}from'react/jsx-runtime';import{useEffect,useState}from'react';function a3_0x4302(){const _0x560483=['29784663uMMxqu','api-pull','success','green','拉取\x20API\x20配置失败:\x20','cyan','10OFgXzA','使用指定的应用AppCode:\x20','1535188YwGowy','status',',且无法读取错误响应内容','string','replace','1057160IdmdWQ','slice','.ts','message','5572021SaZAAK','3761592Drwszk','💡\x20请使用\x20','data','white','split','env','\x20-\x20客户端实例文件','tableData','未提供应用AppCode,且配置中也没有默认值','url','dim','api','yellow','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','3133935uptdzw','-client','setLogPath','\x20和\x20','\x20-\x20模型配置文件','-api','includes','import\x20','12sJeDOE','red','\x20重新登录后再试','client','25hkywhz','√\x20API\x20文件生成成功!','910290szWblG','&pageSize=999&currentPage=1','gray','error','lovrabet\x20auth','online','获取数据集失败,HTTP状态码:\x20','/smartapi/dataset/getList?appCode=','app','column'];a3_0x4302=function(){return _0x560483;};return a3_0x4302();}import{Box,Text,useApp}from'ink';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';function a3_0xf095(_0x59a2a4,_0x3a331f){const _0x430237=a3_0x4302();return a3_0xf095=function(_0xf09505,_0x4402ab){_0xf09505=_0xf09505-0x147;let _0x262626=_0x430237[_0xf09505];return _0x262626;},a3_0xf095(_0x59a2a4,_0x3a331f);}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x4c33c6,env:_0x2e9dcb,output:_0x5f03f1})=>{const _0x31547c=a3_0xf095,{exit:_0x22e97c}=useApp(),[_0xdcf659,_0x52c032]=useState(![]),[_0x51fa5d,_0x495b07]=useState(![]),[_0xe13024,_0x22819b]=useState(null),[_0x26bcca,_0x32a584]=useState(null),_0x22e576=readConfig(),_0x458797=_0x4c33c6||_0x22e576?.[_0x31547c(0x155)],_0x48aa9b=typeof _0x22e576?.[_0x31547c(0x16e)]===_0x31547c(0x162)?_0x22e576[_0x31547c(0x16e)]:undefined,_0x755727=_0x2e9dcb||_0x48aa9b||_0x31547c(0x152);initEnv(_0x755727);const _0x411917=_0x5f03f1||'./src/api/',_0x3c10e5=_0x4c33c6&&_0x4c33c6[_0x31547c(0x17d)]('-')?_0x4c33c6[_0x31547c(0x16d)]('-')[_0x31547c(0x165)](0x1)['join']('-'):'',_0x3dc67f=_0x4c33c6?_0x31547c(0x15e)+_0x458797:'使用配置的应用AppCode:\x20'+_0x458797,_0x14484=_0x3c10e5?_0x3c10e5+_0x31547c(0x17c):_0x31547c(0x174),_0x4b3550=_0x3c10e5?_0x3c10e5+_0x31547c(0x178):'client';useEffect(()=>{_0x52c032(!![]),_0x2af923();},[]),useEffect(()=>{(_0x51fa5d||_0xe13024)&&_0x22e97c();},[_0x51fa5d,_0xe13024,_0x22e97c]);async function _0x2af923(){const _0x2e71d1=_0x31547c;if(!_0x458797){_0x22819b(_0x2e71d1(0x171));return;}try{logger[_0x2e71d1(0x179)](process['cwd']());const _0x25258f=await fetch(getApiDomain()+_0x2e71d1(0x154)+_0x458797+_0x2e71d1(0x14e),{'headers':{'Cookie':getCookie()}});if(_0x25258f['ok']){const _0x473a56=await _0x25258f['json']();if(_0x473a56[_0x2e71d1(0x159)]){const _0x2d1c6c=!_0x4c33c6;await generateApiFile(_0x473a56[_0x2e71d1(0x16b)][_0x2e71d1(0x170)],_0x3c10e5,_0x458797,_0x2d1c6c,_0x755727,_0x411917);const _0x3e9c33=_0x411917['endsWith']('/')?_0x411917:_0x411917+'/';_0x32a584({'api':''+_0x3e9c33+_0x14484+'.ts','client':''+_0x3e9c33+_0x4b3550+_0x2e71d1(0x166)}),_0x495b07(!![]);}}else{if(_0x25258f[_0x2e71d1(0x160)]===0x191){const _0x424b9b='登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录';logger[_0x2e71d1(0x150)](_0x2e71d1(0x158),_0x424b9b,{'status':_0x25258f[_0x2e71d1(0x160)],'appCode':_0x458797,'url':_0x25258f[_0x2e71d1(0x172)]}),_0x22819b(_0x424b9b);}else{const _0x2e1e1=_0x2e71d1(0x153)+_0x25258f[_0x2e71d1(0x160)];try{const _0x57c04f=await _0x25258f['text']();_0x57c04f?logger[_0x2e71d1(0x150)](_0x2e71d1(0x158),_0x2e1e1,{'status':_0x25258f['status'],'appCode':_0x458797,'url':_0x25258f[_0x2e71d1(0x172)],'errorBody':_0x57c04f}):logger[_0x2e71d1(0x150)](_0x2e71d1(0x158),_0x2e1e1,{'status':_0x25258f[_0x2e71d1(0x160)],'appCode':_0x458797,'url':_0x25258f[_0x2e71d1(0x172)]});}catch(_0x35b19f){logger[_0x2e71d1(0x150)](_0x2e71d1(0x158),_0x2e1e1+_0x2e71d1(0x161),{'status':_0x25258f[_0x2e71d1(0x160)],'appCode':_0x458797,'url':_0x25258f[_0x2e71d1(0x172)],'readError':_0x35b19f instanceof Error?_0x35b19f[_0x2e71d1(0x167)]:String(_0x35b19f)});}_0x22819b(_0x2e1e1);}}}catch(_0x37fac8){const _0x1ceb65=_0x37fac8 instanceof Error?_0x37fac8[_0x2e71d1(0x167)]:String(_0x37fac8);_0x22819b(_0x2e71d1(0x15b)+_0x1ceb65);}finally{_0x52c032(![]);}}return a3_0x2c8b61(Box,{'flexDirection':_0x31547c(0x156),'children':[a3_0x2c8b61(Box,{'children':[a3_0x239839(Text,{'color':_0x31547c(0x14f),'children':'*\x20'}),a3_0x239839(Text,{'color':_0x4c33c6?_0x31547c(0x16c):_0x31547c(0x173),'children':_0x3dc67f})]}),a3_0x2c8b61(Box,{'children':[a3_0x239839(Text,{'color':_0x31547c(0x14f),'children':'*\x20将生成文件:\x20'}),a3_0x2c8b61(Text,{'color':'cyan','children':[_0x14484,_0x31547c(0x166)]}),a3_0x239839(Text,{'color':'dim','children':_0x31547c(0x17a)}),a3_0x2c8b61(Text,{'color':_0x31547c(0x15c),'children':[_0x4b3550,_0x31547c(0x166)]})]}),_0xdcf659&&a3_0x239839(Box,{'children':a3_0x2c8b61(Text,{'children':[_0x31547c(0x176),_0x755727,')']})}),_0x51fa5d&&_0x26bcca&&a3_0x2c8b61(Box,{'flexDirection':'column','children':[a3_0x239839(Box,{'children':a3_0x239839(Text,{'color':_0x31547c(0x15a),'children':_0x31547c(0x14c)})}),a3_0x239839(Box,{'marginTop':0x1,'children':a3_0x239839(Text,{'color':'gray','children':'*\x20已生成文件:'})}),a3_0x2c8b61(Box,{'marginLeft':0x2,'children':[a3_0x2c8b61(Text,{'color':_0x31547c(0x15c),'children':['•\x20',_0x26bcca['api']]}),a3_0x239839(Text,{'color':_0x31547c(0x173),'children':_0x31547c(0x17b)})]}),a3_0x2c8b61(Box,{'marginLeft':0x2,'children':[a3_0x2c8b61(Text,{'color':_0x31547c(0x15c),'children':['•\x20',_0x26bcca[_0x31547c(0x14a)]]}),a3_0x239839(Text,{'color':_0x31547c(0x173),'children':_0x31547c(0x16f)})]}),a3_0x239839(Box,{'marginTop':0x1,'children':a3_0x239839(Text,{'color':_0x31547c(0x14f),'children':'*\x20导入方式:'})}),a3_0x239839(Box,{'marginLeft':0x2,'children':a3_0x2c8b61(Text,{'color':_0x31547c(0x175),'children':[_0x31547c(0x17e),'{\x20lovrabetClient\x20}','\x20from\x20\x27@/',_0x26bcca[_0x31547c(0x14a)][_0x31547c(0x163)](/^\.\//,'')[_0x31547c(0x163)](/^src\//,'')['replace'](_0x31547c(0x166),''),'\x27']})})]}),_0xe13024&&a3_0x2c8b61(Box,{'flexDirection':_0x31547c(0x156),'children':[a3_0x239839(Box,{'children':a3_0x2c8b61(Text,{'color':_0x31547c(0x148),'children':['❌\x20',_0xe13024]})}),_0xe13024['includes']('登录')&&a3_0x2c8b61(Box,{'marginTop':0x1,'children':[a3_0x239839(Text,{'color':_0x31547c(0x175),'children':_0x31547c(0x16a)}),a3_0x239839(Text,{'color':_0x31547c(0x15c),'children':_0x31547c(0x151)}),a3_0x239839(Text,{'color':_0x31547c(0x175),'children':_0x31547c(0x149)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x3084b8,_0x5e5690){const _0x5dbaa4=a4_0x4bb0,_0xff40e5=_0x3084b8();while(!![]){try{const _0x4aec91=parseInt(_0x5dbaa4(0x94))/0x1+-parseInt(_0x5dbaa4(0x9a))/0x2+-parseInt(_0x5dbaa4(0xa7))/0x3*(parseInt(_0x5dbaa4(0xa0))/0x4)+parseInt(_0x5dbaa4(0x99))/0x5*(-parseInt(_0x5dbaa4(0x8d))/0x6)+parseInt(_0x5dbaa4(0xa3))/0x7+parseInt(_0x5dbaa4(0x97))/0x8*(-parseInt(_0x5dbaa4(0xa6))/0x9)+parseInt(_0x5dbaa4(0x90))/0xa*(parseInt(_0x5dbaa4(0x9e))/0xb);if(_0x4aec91===_0x5e5690)break;else _0xff40e5['push'](_0xff40e5['shift']());}catch(_0x2bea06){_0xff40e5['push'](_0xff40e5['shift']());}}}(a4_0x4a33,0xbe1dd));function a4_0x4bb0(_0x36a66d,_0x16ad64){const _0x4a3314=a4_0x4a33();return a4_0x4bb0=function(_0x4bb0a8,_0x2e6b8e){_0x4bb0a8=_0x4bb0a8-0x8d;let _0x1fc4cf=_0x4a3314[_0x4bb0a8];return _0x1fc4cf;},a4_0x4bb0(_0x36a66d,_0x16ad64);}function a4_0x4a33(){const _0x4d54ed=['2782794uKJEVD','dbtableConfig','get','469143TLbsyr','186TxPvuK','137892ynyXLm','tableName','from','548190JqXLno','dataset_','dataset','values','1002009bHkEoP','map','name','216OwgnWn','replace','245vOcThU','1774000SqVLJy','pkField','code','Api','847XtLDJR','trim','91700Qxphwu','filter','allFields'];a4_0x4a33=function(){return _0x4d54ed;};return a4_0x4a33();}export function formatDataset(_0x3e0c68){const _0x346f56=a4_0x4bb0,_0x32ebdc=_0x3e0c68[_0x346f56(0xa1)](_0x2c7356=>_0x2c7356['dbtableConfig']),_0x571ac1=_0x3e0c68['filter'](_0x3f16bb=>!_0x3f16bb['dbtableConfig']),_0x30064c=new Map();_0x32ebdc['forEach'](_0x4cfa40=>{const _0x234d87=_0x346f56,_0x5f1e59=_0x4cfa40[_0x234d87(0xa4)][_0x234d87(0x8e)],_0x34732b=_0x30064c[_0x234d87(0xa5)](_0x5f1e59);(!_0x34732b||_0x4cfa40['id']>_0x34732b['id'])&&_0x30064c['set'](_0x5f1e59,_0x4cfa40);});const _0x17d8b1=Array[_0x346f56(0x8f)](_0x30064c[_0x346f56(0x93)]())[_0x346f56(0x95)](_0x32607f=>{const _0x31815e=_0x346f56,_0x3fdc16=snakeToCamel(_0x32607f['dbtableConfig'][_0x31815e(0x8e)]);return{'id':_0x32607f['id'],'name':_0x32607f[_0x31815e(0x96)],'code':_0x32607f[_0x31815e(0x9c)],'tableName':_0x32607f[_0x31815e(0xa4)][_0x31815e(0x8e)],'apiFucName':_0x3fdc16?_0x3fdc16+'Api':_0x31815e(0x92)+_0x32607f[_0x31815e(0x9c)]+'Api','pkField':_0x32607f['dbtableConfig'][_0x31815e(0x9b)],'allFields':_0x32607f[_0x31815e(0xa4)][_0x31815e(0xa2)]['split'](',')};}),_0x2f0991=_0x571ac1['map'](_0x5b8fc0=>{const _0x34dccb=_0x346f56,_0x19c3c0=_0x34dccb(0x91)+_0x5b8fc0[_0x34dccb(0x9c)],_0x4b05f2=snakeToCamel(_0x19c3c0);return{'id':_0x5b8fc0['id'],'name':_0x5b8fc0[_0x34dccb(0x96)],'code':_0x5b8fc0[_0x34dccb(0x9c)],'tableName':_0x19c3c0,'apiFucName':_0x4b05f2?_0x4b05f2+_0x34dccb(0x9d):'dataset'+_0x5b8fc0[_0x34dccb(0x9c)]+'Api','pkField':undefined,'allFields':[]};});return[..._0x17d8b1,..._0x2f0991];}function snakeToCamel(_0x35e58f){const _0x5b618f=a4_0x4bb0;if(!_0x35e58f)return _0x35e58f;const _0xdcf788=_0x35e58f[_0x5b618f(0x9f)]();return _0xdcf788[_0x5b618f(0x98)](/_([a-zA-Z0-9])/g,(_0x272323,_0x3b7b9b)=>_0x3b7b9b['toUpperCase']());}
1
+ (function(_0x4f8d33,_0x3e20c4){const _0x15b885=a4_0x3651,_0x2d3c76=_0x4f8d33();while(!![]){try{const _0x343edb=-parseInt(_0x15b885(0x1b8))/0x1+-parseInt(_0x15b885(0x1a8))/0x2*(-parseInt(_0x15b885(0x1b9))/0x3)+parseInt(_0x15b885(0x1b1))/0x4*(-parseInt(_0x15b885(0x1b5))/0x5)+parseInt(_0x15b885(0x1ae))/0x6+parseInt(_0x15b885(0x1c2))/0x7*(-parseInt(_0x15b885(0x1ac))/0x8)+parseInt(_0x15b885(0x1a9))/0x9+parseInt(_0x15b885(0x1b6))/0xa;if(_0x343edb===_0x3e20c4)break;else _0x2d3c76['push'](_0x2d3c76['shift']());}catch(_0xb69836){_0x2d3c76['push'](_0x2d3c76['shift']());}}}(a4_0x54cd,0xa8985));function a4_0x3651(_0x2a6a2b,_0x47cd1d){const _0x54cdf9=a4_0x54cd();return a4_0x3651=function(_0x36511b,_0x33fcae){_0x36511b=_0x36511b-0x1a6;let _0x5231f6=_0x54cdf9[_0x36511b];return _0x5231f6;},a4_0x3651(_0x2a6a2b,_0x47cd1d);}export function formatDataset(_0xdc08e7){const _0x198e0c=a4_0x3651,_0x383404=_0xdc08e7[_0x198e0c(0x1ad)](_0x2d12a5=>_0x2d12a5[_0x198e0c(0x1bc)]),_0x155f69=_0xdc08e7[_0x198e0c(0x1ad)](_0x440c7c=>!_0x440c7c['dbtableConfig']),_0x92fbd1=new Map();_0x383404[_0x198e0c(0x1b7)](_0x44879e=>{const _0x378b92=_0x198e0c,_0x1c019c=_0x44879e[_0x378b92(0x1bc)][_0x378b92(0x1c1)],_0x36fb8c=_0x92fbd1[_0x378b92(0x1b2)](_0x1c019c);(!_0x36fb8c||_0x44879e['id']>_0x36fb8c['id'])&&_0x92fbd1[_0x378b92(0x1bd)](_0x1c019c,_0x44879e);});const _0x3b225d=Array['from'](_0x92fbd1[_0x198e0c(0x1a6)]())[_0x198e0c(0x1b0)](_0x236564=>{const _0x5e35de=_0x198e0c,_0x2091d3=snakeToCamel(_0x236564[_0x5e35de(0x1bc)][_0x5e35de(0x1c1)]);return{'id':_0x236564['id'],'name':_0x236564[_0x5e35de(0x1aa)],'code':_0x236564[_0x5e35de(0x1af)],'tableName':_0x236564['dbtableConfig'][_0x5e35de(0x1c1)],'apiFucName':_0x2091d3?_0x2091d3+_0x5e35de(0x1bf):'dataset'+_0x236564[_0x5e35de(0x1af)]+_0x5e35de(0x1bf),'pkField':_0x236564[_0x5e35de(0x1bc)][_0x5e35de(0x1b4)],'allFields':_0x236564['dbtableConfig'][_0x5e35de(0x1b3)][_0x5e35de(0x1a7)](',')};}),_0x192f62=_0x155f69['map'](_0x242778=>{const _0x67e39c=_0x198e0c,_0x5bbcd5=_0x67e39c(0x1ba)+_0x242778[_0x67e39c(0x1af)],_0x2efd2e=snakeToCamel(_0x5bbcd5);return{'id':_0x242778['id'],'name':_0x242778[_0x67e39c(0x1aa)],'code':_0x242778[_0x67e39c(0x1af)],'tableName':_0x5bbcd5,'apiFucName':_0x2efd2e?_0x2efd2e+_0x67e39c(0x1bf):_0x67e39c(0x1bb)+_0x242778['code']+_0x67e39c(0x1bf),'pkField':undefined,'allFields':[]};});return[..._0x3b225d,..._0x192f62];}function a4_0x54cd(){const _0x232221=['toUpperCase','tableName','648683MFDREC','values','split','4kpokRv','2225484NRPkry','name','trim','24ZXNKKx','filter','549426UoKhnn','code','map','2620172dpnCWN','get','allFields','pkField','5DUdiCF','18812460TRZVBm','forEach','851224VYMhwb','382119sTQOvF','dataset_','dataset','dbtableConfig','set','replace','Api'];a4_0x54cd=function(){return _0x232221;};return a4_0x54cd();}function snakeToCamel(_0x3ce49f){const _0xc7fa22=a4_0x3651;if(!_0x3ce49f)return _0x3ce49f;const _0x574fd5=_0x3ce49f[_0xc7fa22(0x1ab)]();return _0x574fd5[_0xc7fa22(0x1be)](/_([a-zA-Z0-9])/g,(_0x4fa6cd,_0x1b96cf)=>_0x1b96cf[_0xc7fa22(0x1c0)]());}
@@ -1 +1 @@
1
- function a5_0x5799(){const _0x14eeeb=['\x20\x20\x20•\x20','*\x20API配置\x20apiConfigName\x20:\x20','init-api',',\x20env:\x20\x22','client.ts.tpl','client','1194242keecaV','code','log','1954458YaViIB','env','dirname','string','1228221VEonCQ','37315PJPTlB','207847COVwPg','API\x20文件生成成功!','replaceApiContent','app','*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/','CONFIG_NAMES.DEFAULT','6605352xvZIfA','6NEtvGU','{\x20apiConfigName:\x20\x22','templates/generate-api','slice','replace','online','resolve','length','api.ts.tpl','api','{\x20apiConfigName:\x20','toUpperCase','format','utf8','apiFucName','join','typescript','.ts','604OvyKwX','\x20-\x20客户端实例文件','\x22\x20}','1813746vhlxFT','30tBmKHZ','../..','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','tableName','keys','*\x20已生成文件:'];a5_0x5799=function(){return _0x14eeeb;};return a5_0x5799();}(function(_0x78c4da,_0x4ba294){const _0x3e6e18=a5_0x2a1b,_0x3a72cb=_0x78c4da();while(!![]){try{const _0xc419c4=parseInt(_0x3e6e18(0x1db))/0x1*(-parseInt(_0x3e6e18(0x1e2))/0x2)+parseInt(_0x3e6e18(0x1d5))/0x3+-parseInt(_0x3e6e18(0x1f4))/0x4*(parseInt(_0x3e6e18(0x1da))/0x5)+parseInt(_0x3e6e18(0x1f7))/0x6+parseInt(_0x3e6e18(0x1d2))/0x7+parseInt(_0x3e6e18(0x1e1))/0x8+parseInt(_0x3e6e18(0x1d9))/0x9*(parseInt(_0x3e6e18(0x1f8))/0xa);if(_0xc419c4===_0x4ba294)break;else _0x3a72cb['push'](_0x3a72cb['shift']());}catch(_0x128db5){_0x3a72cb['push'](_0x3a72cb['shift']());}}}(a5_0x5799,0x94aed));import a5_0x10a6d0 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x3e1008 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';function a5_0x2a1b(_0x58f316,_0x3568b2){const _0x5799d3=a5_0x5799();return a5_0x2a1b=function(_0x2a1b6d,_0x21d44d){_0x2a1b6d=_0x2a1b6d-0x1d2;let _0x3d616d=_0x5799d3[_0x2a1b6d];return _0x3d616d;},a5_0x2a1b(_0x58f316,_0x3568b2);}export async function generateApiFile(_0x2d8a00,_0x8a5e50='',_0x3bf8fa,_0x53cac0=![],_0xba449c,_0x555aa3='./src/api/'){const _0x3ecc21=a5_0x2a1b,_0x7ad4cf=readConfig(),_0x532233=_0x3bf8fa||_0x7ad4cf?.[_0x3ecc21(0x1de)];if(typeof _0x532233!==_0x3ecc21(0x1d8)||!_0x532233)throw new Error(_0x3ecc21(0x1fa));const _0x262581=_0x53cac0?_0x3ecc21(0x1e0):'\x22'+_0x532233+'\x22',_0xe1acd7=typeof _0x7ad4cf[_0x3ecc21(0x1d6)]===_0x3ecc21(0x1d8)?_0x7ad4cf[_0x3ecc21(0x1d6)]:undefined,_0x90fbad=_0xba449c||_0xe1acd7||_0x3ecc21(0x1e7),_0x355764=_0x90fbad!=='online';let _0x34aaae;if(_0x53cac0)_0x355764?_0x34aaae=_0x3ecc21(0x1ec)+_0x262581+_0x3ecc21(0x201)+_0x90fbad+_0x3ecc21(0x1f6):_0x34aaae='';else{const _0x249dfa=_0x355764?_0x3ecc21(0x201)+_0x90fbad+'\x22':'';_0x34aaae=_0x3ecc21(0x1e3)+_0x532233+'\x22'+_0x249dfa+'\x20}';}const _0x182a68=_0x8a5e50?_0x8a5e50+'-api':_0x3ecc21(0x1eb),_0x272643=_0x8a5e50?_0x8a5e50+'-client':_0x3ecc21(0x203),_0x3fff97=formatDataset(_0x2d8a00),_0x2ddf38={};_0x3fff97['forEach'](_0x2d8bac=>{const _0x4f6e04=_0x3ecc21,_0x313bd0=_0x2d8bac[_0x4f6e04(0x1f0)]['replace'](/Api$/,''),_0x4f6214=_0x313bd0['charAt'](0x0)[_0x4f6e04(0x1ed)]()+_0x313bd0[_0x4f6e04(0x1e5)](0x1);_0x2ddf38[_0x4f6214]={'tableName':_0x2d8bac[_0x4f6e04(0x1fb)],'datasetCode':_0x2d8bac[_0x4f6e04(0x1d3)]};});const _0xcd1394=fileURLToPath(import.meta['url']),_0x9ac6da=a5_0x3e1008[_0x3ecc21(0x1e8)](a5_0x3e1008[_0x3ecc21(0x1d7)](_0xcd1394),_0x3ecc21(0x1f9)),_0xc879d=a5_0x3e1008[_0x3ecc21(0x1f1)](_0x9ac6da,_0x3ecc21(0x1e4)),_0x5428d1=a5_0x3e1008[_0x3ecc21(0x1f1)](_0xc879d,_0x3ecc21(0x1ea)),_0x33b543=a5_0x3e1008[_0x3ecc21(0x1f1)](_0xc879d,_0x3ecc21(0x202)),_0x265f6b=_0x555aa3['endsWith']('/')?_0x555aa3['slice'](0x0,-0x1):_0x555aa3;mkdirSync(_0x265f6b,{'recursive':!![]});const _0x1693d0=readFileSync(_0x5428d1,_0x3ecc21(0x1ef)),_0x5dd704=TemplateReplacer['replaceApiContent'](_0x1693d0,_0x532233,_0x2ddf38,Object[_0x3ecc21(0x1fc)](_0x2ddf38)[0x0],_0x182a68,_0x262581),_0x44431e=await a5_0x10a6d0[_0x3ecc21(0x1ee)](_0x5dd704,{'parser':_0x3ecc21(0x1f2)}),_0x33332a=_0x265f6b+'/'+_0x182a68+_0x3ecc21(0x1f3);writeFileSync(_0x33332a,_0x44431e,{'encoding':'utf8'});const _0x3bd38e=readFileSync(_0x33b543,_0x3ecc21(0x1ef)),_0x19954e=TemplateReplacer[_0x3ecc21(0x1dd)](_0x3bd38e,_0x532233,_0x2ddf38,Object[_0x3ecc21(0x1fc)](_0x2ddf38)[0x0],_0x182a68,_0x262581,_0x34aaae),_0x87db8d=await a5_0x10a6d0[_0x3ecc21(0x1ee)](_0x19954e,{'parser':_0x3ecc21(0x1f2)}),_0x235d1d=_0x265f6b+'/'+_0x272643+_0x3ecc21(0x1f3);writeFileSync(_0x235d1d,_0x87db8d,{'encoding':_0x3ecc21(0x1ef)}),logger['success'](_0x3ecc21(0x200),_0x3ecc21(0x1dc)),console[_0x3ecc21(0x1d4)](_0x3ecc21(0x1fd)),console[_0x3ecc21(0x1d4)](_0x3ecc21(0x1fe)+_0x33332a+'\x20-\x20模型配置文件\x20('+Object[_0x3ecc21(0x1fc)](_0x2ddf38)[_0x3ecc21(0x1e9)]+'\x20个模型)'),console[_0x3ecc21(0x1d4)](_0x3ecc21(0x1fe)+_0x235d1d+_0x3ecc21(0x1f5)),console[_0x3ecc21(0x1d4)](_0x3ecc21(0x1ff)+_0x262581);const _0x3b016c=_0x265f6b['replace'](/^\.\//,'')[_0x3ecc21(0x1e6)](/\/$/,'');console['log'](_0x3ecc21(0x1df)+_0x3b016c+'/'+_0x272643+'\x27');}
1
+ const a5_0x1e34e2=a5_0x41f5;(function(_0x1438d0,_0x3aef82){const _0x2d8239=a5_0x41f5,_0x25a755=_0x1438d0();while(!![]){try{const _0x3d3712=parseInt(_0x2d8239(0x15b))/0x1+parseInt(_0x2d8239(0x15c))/0x2+-parseInt(_0x2d8239(0x14b))/0x3+-parseInt(_0x2d8239(0x141))/0x4*(-parseInt(_0x2d8239(0x140))/0x5)+parseInt(_0x2d8239(0x164))/0x6*(-parseInt(_0x2d8239(0x168))/0x7)+-parseInt(_0x2d8239(0x165))/0x8+-parseInt(_0x2d8239(0x166))/0x9;if(_0x3d3712===_0x3aef82)break;else _0x25a755['push'](_0x25a755['shift']());}catch(_0x1a466b){_0x25a755['push'](_0x25a755['shift']());}}}(a5_0x19d6,0xf3fdd));import a5_0x163c1e from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x4e0317 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{formatDataset}from'./format-dataset.js';function a5_0x41f5(_0x2afff8,_0x40e673){const _0x19d69d=a5_0x19d6();return a5_0x41f5=function(_0x41f534,_0x30d88d){_0x41f534=_0x41f534-0x140;let _0x5c4d82=_0x19d69d[_0x41f534];return _0x5c4d82;},a5_0x41f5(_0x2afff8,_0x40e673);}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';function a5_0x19d6(){const _0xe6eb2f=['.ts','{\x20apiConfigName:\x20','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','env','templates/generate-api','client.ts.tpl','-client','667270efFUJA','1778610ZQuMxP','string','client','replace','code','slice','\x20-\x20模型配置文件\x20(','\x20个模型)','208668IpemYX','6782848XdPvXW','9101511bdhNpG','\x20\x20\x20•\x20','7aSPjDb','tableName','6809555fJUzGV','4zyIRqJ','success','init-api','\x20-\x20客户端实例文件','CONFIG_NAMES.DEFAULT','log','API\x20文件生成成功!','./src/api/','online','typescript','75552iBRbMu','join',',\x20env:\x20\x22','../..','forEach','keys','utf8','replaceApiContent','charAt'];a5_0x19d6=function(){return _0xe6eb2f;};return a5_0x19d6();}export async function generateApiFile(_0x258630,_0x40014e='',_0x485c25,_0x5be7f8=![],_0x422e2e,_0x62c4d4=a5_0x1e34e2(0x148)){const _0x206e4a=a5_0x1e34e2,_0x4a91d4=readConfig(),_0x55ca08=_0x485c25||_0x4a91d4?.['app'];if(typeof _0x55ca08!==_0x206e4a(0x15d)||!_0x55ca08)throw new Error(_0x206e4a(0x156));const _0x47e587=_0x5be7f8?_0x206e4a(0x145):'\x22'+_0x55ca08+'\x22',_0x36f80a=typeof _0x4a91d4[_0x206e4a(0x157)]==='string'?_0x4a91d4[_0x206e4a(0x157)]:undefined,_0x367274=_0x422e2e||_0x36f80a||_0x206e4a(0x149),_0x1517f0=_0x367274!=='online';let _0x269b18;if(_0x5be7f8)_0x1517f0?_0x269b18=_0x206e4a(0x155)+_0x47e587+',\x20env:\x20\x22'+_0x367274+'\x22\x20}':_0x269b18='';else{const _0x376228=_0x1517f0?_0x206e4a(0x14d)+_0x367274+'\x22':'';_0x269b18='{\x20apiConfigName:\x20\x22'+_0x55ca08+'\x22'+_0x376228+'\x20}';}const _0x460eb1=_0x40014e?_0x40014e+'-api':'api',_0x4ecb98=_0x40014e?_0x40014e+_0x206e4a(0x15a):_0x206e4a(0x15e),_0xa06d69=formatDataset(_0x258630),_0x4822a9={};_0xa06d69[_0x206e4a(0x14f)](_0x35ece7=>{const _0x4552d5=_0x206e4a,_0x5b4c3c=_0x35ece7['apiFucName'][_0x4552d5(0x15f)](/Api$/,''),_0x5248cd=_0x5b4c3c[_0x4552d5(0x153)](0x0)['toUpperCase']()+_0x5b4c3c[_0x4552d5(0x161)](0x1);_0x4822a9[_0x5248cd]={'tableName':_0x35ece7[_0x4552d5(0x169)],'datasetCode':_0x35ece7[_0x4552d5(0x160)]};});const _0x48188f=fileURLToPath(import.meta['url']),_0x3ffd0a=a5_0x4e0317['resolve'](a5_0x4e0317['dirname'](_0x48188f),_0x206e4a(0x14e)),_0x440b57=a5_0x4e0317[_0x206e4a(0x14c)](_0x3ffd0a,_0x206e4a(0x158)),_0x1141da=a5_0x4e0317[_0x206e4a(0x14c)](_0x440b57,'api.ts.tpl'),_0x225898=a5_0x4e0317[_0x206e4a(0x14c)](_0x440b57,_0x206e4a(0x159)),_0xc3eb9b=_0x62c4d4['endsWith']('/')?_0x62c4d4[_0x206e4a(0x161)](0x0,-0x1):_0x62c4d4;mkdirSync(_0xc3eb9b,{'recursive':!![]});const _0x1830e1=readFileSync(_0x1141da,_0x206e4a(0x151)),_0x1e1e3a=TemplateReplacer[_0x206e4a(0x152)](_0x1830e1,_0x55ca08,_0x4822a9,Object[_0x206e4a(0x150)](_0x4822a9)[0x0],_0x460eb1,_0x47e587),_0x1f7801=await a5_0x163c1e['format'](_0x1e1e3a,{'parser':_0x206e4a(0x14a)}),_0x5709a1=_0xc3eb9b+'/'+_0x460eb1+_0x206e4a(0x154);writeFileSync(_0x5709a1,_0x1f7801,{'encoding':_0x206e4a(0x151)});const _0x3222e0=readFileSync(_0x225898,_0x206e4a(0x151)),_0x4fcb14=TemplateReplacer[_0x206e4a(0x152)](_0x3222e0,_0x55ca08,_0x4822a9,Object[_0x206e4a(0x150)](_0x4822a9)[0x0],_0x460eb1,_0x47e587,_0x269b18),_0x1765d4=await a5_0x163c1e['format'](_0x4fcb14,{'parser':'typescript'}),_0x1389bf=_0xc3eb9b+'/'+_0x4ecb98+'.ts';writeFileSync(_0x1389bf,_0x1765d4,{'encoding':_0x206e4a(0x151)}),logger[_0x206e4a(0x142)](_0x206e4a(0x143),_0x206e4a(0x147)),console[_0x206e4a(0x146)]('*\x20已生成文件:'),console[_0x206e4a(0x146)](_0x206e4a(0x167)+_0x5709a1+_0x206e4a(0x162)+Object[_0x206e4a(0x150)](_0x4822a9)['length']+_0x206e4a(0x163)),console[_0x206e4a(0x146)](_0x206e4a(0x167)+_0x1389bf+_0x206e4a(0x144)),console[_0x206e4a(0x146)]('*\x20API配置\x20apiConfigName\x20:\x20'+_0x47e587);const _0x581969=_0xc3eb9b[_0x206e4a(0x15f)](/^\.\//,'')[_0x206e4a(0x15f)](/\/$/,'');console['log']('*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/'+_0x581969+'/'+_0x4ecb98+'\x27');}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0xf91ed7,_0x3d0b06){const _0x7ae519=a6_0xd871,_0x462874=_0xf91ed7();while(!![]){try{const _0x5bc0c2=-parseInt(_0x7ae519(0x1d7))/0x1*(parseInt(_0x7ae519(0x1cd))/0x2)+-parseInt(_0x7ae519(0x1c8))/0x3*(parseInt(_0x7ae519(0x1c6))/0x4)+parseInt(_0x7ae519(0x1c7))/0x5+parseInt(_0x7ae519(0x1c4))/0x6*(-parseInt(_0x7ae519(0x1db))/0x7)+parseInt(_0x7ae519(0x1d3))/0x8+-parseInt(_0x7ae519(0x1c5))/0x9+parseInt(_0x7ae519(0x1d9))/0xa;if(_0x5bc0c2===_0x3d0b06)break;else _0x462874['push'](_0x462874['shift']());}catch(_0x38bbdc){_0x462874['push'](_0x462874['shift']());}}}(a6_0x4422,0x4ad24));import{jsx as a6_0x3e465d}from'react/jsx-runtime';function a6_0xd871(_0xe7406f,_0xde077d){const _0x4422e5=a6_0x4422();return a6_0xd871=function(_0xd871c7,_0x879a5a){_0xd871c7=_0xd871c7-0x1c4;let _0x2e2e97=_0x4422e5[_0xd871c7];return _0x2e2e97;},a6_0xd871(_0xe7406f,_0xde077d);}function a6_0x4422(){const _0x16862c=['Unknown\x20api\x20command:\x20','input','3826LNFqyS','error','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','exit','Available\x20commands:','env','2024376mUvNfb','output','log','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','199wBcLkQ','\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配置文件','16524320vHygms','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','30604rLHAME','786rycmnr','5327541GFtOpc','550524XenzVO','419940RqJiLz','3USYtKq','flags','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20指定输出目录(默认:./src/api/)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--help\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\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20--env\x20daily\x20--output\x20./api\x0a'];a6_0x4422=function(){return _0x16862c;};return a6_0x4422();}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';export async function apiCli(_0x59a072){const _0xf85b04=a6_0xd871,_0x471ddf=_0x59a072[_0xf85b04(0x1cc)][0x1];if(_0x59a072[_0xf85b04(0x1c9)]['help']){console[_0xf85b04(0x1d5)](_0xf85b04(0x1ca));return;}if(_0x471ddf==='pull'){_0x59a072['input'][0x2]&&(console['error']('❌\x20错误:不再支持位置参数方式'),console[_0xf85b04(0x1d5)]('请使用\x20--appcode\x20参数,例如:'),console['log'](_0xf85b04(0x1cf)+_0x59a072[_0xf85b04(0x1cc)][0x2]),process[_0xf85b04(0x1d0)](0x1));const _0x3c2359=_0x59a072[_0xf85b04(0x1c9)]['appcode'],_0x139a81=typeof _0x59a072['flags']['env']==='string'?_0x59a072[_0xf85b04(0x1c9)][_0xf85b04(0x1d2)]:undefined,_0x1b71dd=_0x59a072[_0xf85b04(0x1c9)][_0xf85b04(0x1d4)];render(a6_0x3e465d(ApiPullUI,{'appCode':_0x3c2359,'env':_0x139a81,'output':_0x1b71dd}));}else console[_0xf85b04(0x1ce)](_0xf85b04(0x1cb)+_0x471ddf),console[_0xf85b04(0x1d5)](_0xf85b04(0x1d1)),console[_0xf85b04(0x1d5)](_0xf85b04(0x1d8)),console[_0xf85b04(0x1d5)](_0xf85b04(0x1da)),console[_0xf85b04(0x1d5)]('\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)'),console[_0xf85b04(0x1d5)](_0xf85b04(0x1d6)),process[_0xf85b04(0x1d0)](0x1);}
1
+ (function(_0x5ecaa3,_0x4e238d){const _0x3cd966=a6_0x4d0c,_0x2e6479=_0x5ecaa3();while(!![]){try{const _0x1fca95=-parseInt(_0x3cd966(0x65))/0x1*(-parseInt(_0x3cd966(0x7c))/0x2)+parseInt(_0x3cd966(0x80))/0x3+-parseInt(_0x3cd966(0x69))/0x4+-parseInt(_0x3cd966(0x78))/0x5+parseInt(_0x3cd966(0x81))/0x6*(-parseInt(_0x3cd966(0x72))/0x7)+-parseInt(_0x3cd966(0x77))/0x8+parseInt(_0x3cd966(0x75))/0x9*(parseInt(_0x3cd966(0x73))/0xa);if(_0x1fca95===_0x4e238d)break;else _0x2e6479['push'](_0x2e6479['shift']());}catch(_0x2cb869){_0x2e6479['push'](_0x2e6479['shift']());}}}(a6_0x1978,0x7d86a));import{jsx as a6_0x3819f8}from'react/jsx-runtime';function a6_0x4d0c(_0x423fdc,_0x45df98){const _0x1978e3=a6_0x1978();return a6_0x4d0c=function(_0x4d0c56,_0x4d20da){_0x4d0c56=_0x4d0c56-0x64;let _0x295d26=_0x1978e3[_0x4d0c56];return _0x295d26;},a6_0x4d0c(_0x423fdc,_0x45df98);}function a6_0x1978(){const _0x565157=['\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20指定输出目录(默认:./src/api/)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--help\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\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20--env\x20daily\x20--output\x20./api\x0a','\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配置文件','appcode','2140240sevEUl','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','Available\x20commands:','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','env','help','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','Unknown\x20api\x20command:\x20','input','7zzaSvq','8675690VenDbU','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','18CkDPCf','❌\x20错误:不再支持位置参数方式','4209344iqPBph','1726490UnZOzE','请使用\x20--appcode\x20参数,例如:','string','pull','514pCaNGj','flags','log','error','553338nCuxjP','3701934QsfZPL','exit','2405JDmHrn'];a6_0x1978=function(){return _0x565157;};return a6_0x1978();}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';export async function apiCli(_0x1d16d6){const _0xcca91c=a6_0x4d0c,_0x300bcf=_0x1d16d6[_0xcca91c(0x71)][0x1];if(_0x1d16d6['flags'][_0xcca91c(0x6e)]){console[_0xcca91c(0x7e)](_0xcca91c(0x66));return;}if(_0x300bcf===_0xcca91c(0x7b)){_0x1d16d6[_0xcca91c(0x71)][0x2]&&(console[_0xcca91c(0x7f)](_0xcca91c(0x76)),console[_0xcca91c(0x7e)](_0xcca91c(0x79)),console[_0xcca91c(0x7e)](_0xcca91c(0x74)+_0x1d16d6['input'][0x2]),process[_0xcca91c(0x64)](0x1));const _0x50f4be=_0x1d16d6[_0xcca91c(0x7d)][_0xcca91c(0x68)],_0x59099d=typeof _0x1d16d6[_0xcca91c(0x7d)]['env']===_0xcca91c(0x7a)?_0x1d16d6[_0xcca91c(0x7d)][_0xcca91c(0x6d)]:undefined,_0x22994c=_0x1d16d6[_0xcca91c(0x7d)]['output'];render(a6_0x3819f8(ApiPullUI,{'appCode':_0x50f4be,'env':_0x59099d,'output':_0x22994c}));}else console[_0xcca91c(0x7f)](_0xcca91c(0x70)+_0x300bcf),console[_0xcca91c(0x7e)](_0xcca91c(0x6b)),console[_0xcca91c(0x7e)](_0xcca91c(0x67)),console[_0xcca91c(0x7e)](_0xcca91c(0x6f)),console['log'](_0xcca91c(0x6c)),console[_0xcca91c(0x7e)](_0xcca91c(0x6a)),process[_0xcca91c(0x64)](0x1);}
@@ -1 +1 @@
1
- (function(_0x5e3972,_0x4d9c87){const _0x5c29b7=a7_0x12c3,_0x5ebf8e=_0x5e3972();while(!![]){try{const _0x21027b=-parseInt(_0x5c29b7(0x1a6))/0x1*(parseInt(_0x5c29b7(0x1b8))/0x2)+parseInt(_0x5c29b7(0x19b))/0x3+-parseInt(_0x5c29b7(0x192))/0x4*(-parseInt(_0x5c29b7(0x195))/0x5)+-parseInt(_0x5c29b7(0x194))/0x6*(parseInt(_0x5c29b7(0x19f))/0x7)+parseInt(_0x5c29b7(0x1ab))/0x8*(parseInt(_0x5c29b7(0x19d))/0x9)+-parseInt(_0x5c29b7(0x18f))/0xa+parseInt(_0x5c29b7(0x1a5))/0xb;if(_0x21027b===_0x4d9c87)break;else _0x5ebf8e['push'](_0x5ebf8e['shift']());}catch(_0xb81c79){_0x5ebf8e['push'](_0x5ebf8e['shift']());}}}(a7_0x99c8,0xc364c));import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';function a7_0x12c3(_0x4223a0,_0x1294e8){const _0x99c89a=a7_0x99c8();return a7_0x12c3=function(_0x12c390,_0x327432){_0x12c390=_0x12c390-0x18e;let _0x427608=_0x99c89a[_0x12c390];return _0x427608;},a7_0x12c3(_0x4223a0,_0x1294e8);}import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';function a7_0x99c8(){const _0x3ad075=['6147784HmQFuL','status','api','string','-api','-client','API\x20配置拉取成功:\x20','tableData','/smartapi/dataset/getList?appCode=','success','log','data','cwd','2286990HWhbVu','√\x20API\x20配置文件生成完成','test','未知错误','1681230tZatbt','url','create-api-pull','572maKhCI','获取数据集失败,HTTP状态码:\x20','41646WZswfB','7475JvYyIF','获取数据集失败,原因:登录鉴权失败,登录已过期','×\x20API\x20配置拉取异常:','env','text','chdir','3818379KYnoUi','error','9ifGubd','API\x20配置拉取失败:\x20','273ovpWVt','info','×\x20错误详情:','message',',且无法读取错误响应内容','length','1403578HHLleP','1lqJgwx','client','.ts\x20-\x20客户端实例文件','\x20\x20\x20•\x20','×\x20服务器返回错误:'];a7_0x99c8=function(){return _0x3ad075;};return a7_0x99c8();}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{httpRequest}from'../utils/http-client.js';export async function pullApiSilent(_0x2efd51,_0xf51efc,_0x1bcc57,_0x51830d){const _0x5e8b28=a7_0x12c3;let _0x1e122b;try{const _0x4a435f=_0xf51efc?.['trim']()||'';if(_0x4a435f){const _0x4df62d=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x4df62d[_0x5e8b28(0x1ba)](_0x4a435f))return console[_0x5e8b28(0x19c)]('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),![];}_0x1bcc57&&(_0x1e122b=process[_0x5e8b28(0x1b7)](),process[_0x5e8b28(0x19a)](_0x1bcc57));const _0x5786c4=readConfig(),_0x233013=typeof _0x5786c4[_0x5e8b28(0x198)]===_0x5e8b28(0x1ae)?_0x5786c4[_0x5e8b28(0x198)]:undefined,_0x1c1e62=_0x51830d||_0x233013||'online';initEnv(_0x1c1e62),console['log']('*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'+_0x1c1e62+')');const _0x59a2d2=getApiDomain()+_0x5e8b28(0x1b3)+_0x2efd51+'&pageSize=999&currentPage=1',_0x56c19c=await httpRequest(_0x59a2d2,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x56c19c['ok']){const _0x360cae=_0x56c19c[_0x5e8b28(0x1b6)];if(_0x360cae[_0x5e8b28(0x1b4)]){const _0x5cd6bc=_0x4a435f?_0x4a435f+_0x5e8b28(0x1af):_0x5e8b28(0x1ad),_0x23dab3=_0x4a435f?_0x4a435f+_0x5e8b28(0x1b0):_0x5e8b28(0x1a7);return console[_0x5e8b28(0x1b5)]('*\x20开始生成\x20API\x20配置文件:'),console[_0x5e8b28(0x1b5)](_0x5e8b28(0x1a9)+_0x5cd6bc+'.ts\x20-\x20模型配置文件'),console[_0x5e8b28(0x1b5)](_0x5e8b28(0x1a9)+_0x23dab3+_0x5e8b28(0x1a8)),console[_0x5e8b28(0x1b5)]('*\x20正在处理\x20'+_0x360cae['data'][_0x5e8b28(0x1b2)][_0x5e8b28(0x1a4)]+'\x20个数据集...'),await generateApiFile(_0x360cae[_0x5e8b28(0x1b6)][_0x5e8b28(0x1b2)],_0x4a435f,_0x2efd51,!![],_0x1c1e62),console[_0x5e8b28(0x1b5)](_0x5e8b28(0x1b9)),_0x1bcc57&&logger[_0x5e8b28(0x1a0)](_0x5e8b28(0x191),_0x5e8b28(0x1b1)+_0x2efd51,{'projectPath':_0x1bcc57,'appCode':_0x2efd51,'datasetCount':_0x360cae['data'][_0x5e8b28(0x1b2)][_0x5e8b28(0x1a4)],'filePrefix':_0x4a435f}),!![];}else return console[_0x5e8b28(0x19c)](_0x5e8b28(0x1aa),_0x360cae[_0x5e8b28(0x1a2)]||_0x5e8b28(0x18e)),_0x1bcc57&&logger[_0x5e8b28(0x19c)](_0x5e8b28(0x191),_0x5e8b28(0x19e)+(_0x360cae[_0x5e8b28(0x1a2)]||_0x5e8b28(0x18e)),{'projectPath':_0x1bcc57,'appCode':_0x2efd51}),![];}else{if(_0x56c19c[_0x5e8b28(0x1ac)]===0x191){const _0x2a5da9=_0x5e8b28(0x196);console[_0x5e8b28(0x19c)]('×\x20'+_0x2a5da9),_0x1bcc57&&logger['error'](_0x5e8b28(0x191),_0x2a5da9,{'status':_0x56c19c['status'],'appCode':_0x2efd51,'url':_0x56c19c[_0x5e8b28(0x190)],'projectPath':_0x1bcc57});}else{const _0xdb544a=_0x5e8b28(0x193)+_0x56c19c[_0x5e8b28(0x1ac)];console[_0x5e8b28(0x19c)]('×\x20'+_0xdb544a);try{const _0x4b274f=await _0x56c19c[_0x5e8b28(0x199)]();_0x4b274f&&console[_0x5e8b28(0x19c)](_0x5e8b28(0x1a1),_0x4b274f),_0x1bcc57&&logger[_0x5e8b28(0x19c)](_0x5e8b28(0x191),_0xdb544a,{'status':_0x56c19c[_0x5e8b28(0x1ac)],'appCode':_0x2efd51,'url':_0x56c19c['url'],'errorBody':_0x4b274f,'projectPath':_0x1bcc57});}catch(_0x2166d6){console[_0x5e8b28(0x19c)]('×\x20无法读取错误响应内容'),_0x1bcc57&&logger['error'](_0x5e8b28(0x191),_0xdb544a+_0x5e8b28(0x1a3),{'status':_0x56c19c[_0x5e8b28(0x1ac)],'appCode':_0x2efd51,'url':_0x56c19c[_0x5e8b28(0x190)],'readError':_0x2166d6 instanceof Error?_0x2166d6[_0x5e8b28(0x1a2)]:String(_0x2166d6),'projectPath':_0x1bcc57});}}return![];}}catch(_0xacda30){const _0x1b4930=_0xacda30 instanceof Error?_0xacda30[_0x5e8b28(0x1a2)]:String(_0xacda30);return console[_0x5e8b28(0x19c)](_0x5e8b28(0x197),_0x1b4930),_0x1bcc57&&logger[_0x5e8b28(0x19c)](_0x5e8b28(0x191),'API\x20配置拉取异常:\x20'+_0x1b4930,{'appCode':_0x2efd51,'projectPath':_0x1bcc57}),![];}finally{_0x1e122b&&process[_0x5e8b28(0x19a)](_0x1e122b);}}
1
+ (function(_0x11c922,_0x52c266){const _0x210493=a7_0x4769,_0x1dbc99=_0x11c922();while(!![]){try{const _0x20ad43=-parseInt(_0x210493(0x205))/0x1+parseInt(_0x210493(0x1ed))/0x2+-parseInt(_0x210493(0x21b))/0x3+-parseInt(_0x210493(0x1f9))/0x4+-parseInt(_0x210493(0x1f0))/0x5+parseInt(_0x210493(0x1fd))/0x6*(-parseInt(_0x210493(0x206))/0x7)+parseInt(_0x210493(0x1fc))/0x8;if(_0x20ad43===_0x52c266)break;else _0x1dbc99['push'](_0x1dbc99['shift']());}catch(_0x1126dd){_0x1dbc99['push'](_0x1dbc99['shift']());}}}(a7_0x8fe1,0x21c32));import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';function a7_0x4769(_0x1aa63d,_0x2ddc93){const _0x8fe16a=a7_0x8fe1();return a7_0x4769=function(_0x476965,_0x56dee6){_0x476965=_0x476965-0x1ed;let _0x5ce299=_0x8fe16a[_0x476965];return _0x5ce299;},a7_0x4769(_0x1aa63d,_0x2ddc93);}import{getApiDomain}from'../constant/domain.js';function a7_0x8fe1(){const _0x1cd028=['*\x20开始生成\x20API\x20配置文件:','-client','未知错误','.ts\x20-\x20模型配置文件','&pageSize=999&currentPage=1','status','api','460348GrHOWC','API\x20配置拉取失败:\x20','获取数据集失败,HTTP状态码:\x20','5934072qGzKCt','4146lDkEqP','client','tableData','/smartapi/dataset/getList?appCode=','url','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','API\x20配置拉取成功:\x20',',且无法读取错误响应内容','118303mCXTWV','2611bZLbYq','create-api-pull','data','-api','×\x20错误详情:','log','string','text','chdir','length','*\x20正在处理\x20','info','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','message','cwd','\x20\x20\x20•\x20','×\x20服务器返回错误:','×\x20API\x20配置拉取异常:','error','获取数据集失败,原因:登录鉴权失败,登录已过期','online','701037wrQikp','env','365434KjVWKr','×\x20无法读取错误响应内容','trim','306870GBtiYa','API\x20配置拉取异常:\x20'];a7_0x8fe1=function(){return _0x1cd028;};return a7_0x8fe1();}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(_0x57f9f8,_0x5ae705,_0x22b0e5,_0x414f6b){const _0x36ff85=a7_0x4769;let _0x584872;try{const _0x58d892=_0x5ae705?.[_0x36ff85(0x1ef)]()||'';if(_0x58d892){const _0x5d37e8=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5d37e8['test'](_0x58d892))return console['error'](_0x36ff85(0x212)),![];}_0x22b0e5&&(_0x584872=process[_0x36ff85(0x214)](),process[_0x36ff85(0x20e)](_0x22b0e5));const _0xf28bb8=readConfig(),_0x27ad53=typeof _0xf28bb8[_0x36ff85(0x21c)]===_0x36ff85(0x20c)?_0xf28bb8[_0x36ff85(0x21c)]:undefined,_0x5575c2=_0x414f6b||_0x27ad53||_0x36ff85(0x21a);initEnv(_0x5575c2),console[_0x36ff85(0x20b)](_0x36ff85(0x202)+_0x5575c2+')');const _0x560ffb=getApiDomain()+_0x36ff85(0x200)+_0x57f9f8+_0x36ff85(0x1f6),_0x1460b8=await httpRequest(_0x560ffb,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x1460b8['ok']){const _0x580321=_0x1460b8['data'];if(_0x580321['success']){const _0xbed659=_0x58d892?_0x58d892+_0x36ff85(0x209):_0x36ff85(0x1f8),_0x470711=_0x58d892?_0x58d892+_0x36ff85(0x1f3):_0x36ff85(0x1fe);return console[_0x36ff85(0x20b)](_0x36ff85(0x1f2)),console['log'](_0x36ff85(0x215)+_0xbed659+_0x36ff85(0x1f5)),console[_0x36ff85(0x20b)](_0x36ff85(0x215)+_0x470711+'.ts\x20-\x20客户端实例文件'),console[_0x36ff85(0x20b)](_0x36ff85(0x210)+_0x580321['data'][_0x36ff85(0x1ff)][_0x36ff85(0x20f)]+'\x20个数据集...'),await generateApiFile(_0x580321[_0x36ff85(0x208)][_0x36ff85(0x1ff)],_0x58d892,_0x57f9f8,!![],_0x5575c2),console[_0x36ff85(0x20b)]('√\x20API\x20配置文件生成完成'),_0x22b0e5&&logger[_0x36ff85(0x211)](_0x36ff85(0x207),_0x36ff85(0x203)+_0x57f9f8,{'projectPath':_0x22b0e5,'appCode':_0x57f9f8,'datasetCount':_0x580321['data'][_0x36ff85(0x1ff)][_0x36ff85(0x20f)],'filePrefix':_0x58d892}),!![];}else return console['error'](_0x36ff85(0x216),_0x580321[_0x36ff85(0x213)]||_0x36ff85(0x1f4)),_0x22b0e5&&logger[_0x36ff85(0x218)](_0x36ff85(0x207),_0x36ff85(0x1fa)+(_0x580321[_0x36ff85(0x213)]||_0x36ff85(0x1f4)),{'projectPath':_0x22b0e5,'appCode':_0x57f9f8}),![];}else{if(_0x1460b8['status']===0x191){const _0x3d1a48=_0x36ff85(0x219);console[_0x36ff85(0x218)]('×\x20'+_0x3d1a48),_0x22b0e5&&logger['error'](_0x36ff85(0x207),_0x3d1a48,{'status':_0x1460b8[_0x36ff85(0x1f7)],'appCode':_0x57f9f8,'url':_0x1460b8[_0x36ff85(0x201)],'projectPath':_0x22b0e5});}else{const _0x4842cf=_0x36ff85(0x1fb)+_0x1460b8[_0x36ff85(0x1f7)];console[_0x36ff85(0x218)]('×\x20'+_0x4842cf);try{const _0x4ac4ea=await _0x1460b8[_0x36ff85(0x20d)]();_0x4ac4ea&&console[_0x36ff85(0x218)](_0x36ff85(0x20a),_0x4ac4ea),_0x22b0e5&&logger['error']('create-api-pull',_0x4842cf,{'status':_0x1460b8[_0x36ff85(0x1f7)],'appCode':_0x57f9f8,'url':_0x1460b8[_0x36ff85(0x201)],'errorBody':_0x4ac4ea,'projectPath':_0x22b0e5});}catch(_0x341c9d){console[_0x36ff85(0x218)](_0x36ff85(0x1ee)),_0x22b0e5&&logger[_0x36ff85(0x218)](_0x36ff85(0x207),_0x4842cf+_0x36ff85(0x204),{'status':_0x1460b8['status'],'appCode':_0x57f9f8,'url':_0x1460b8[_0x36ff85(0x201)],'readError':_0x341c9d instanceof Error?_0x341c9d[_0x36ff85(0x213)]:String(_0x341c9d),'projectPath':_0x22b0e5});}}return![];}}catch(_0x1af6af){const _0x28c372=_0x1af6af instanceof Error?_0x1af6af[_0x36ff85(0x213)]:String(_0x1af6af);return console[_0x36ff85(0x218)](_0x36ff85(0x217),_0x28c372),_0x22b0e5&&logger[_0x36ff85(0x218)](_0x36ff85(0x207),_0x36ff85(0x1f1)+_0x28c372,{'appCode':_0x57f9f8,'projectPath':_0x22b0e5}),![];}finally{_0x584872&&process[_0x36ff85(0x20e)](_0x584872);}}
package/lib/api/pull.js CHANGED
@@ -1 +1 @@
1
- function a8_0xad0d(_0xb12953,_0x3e6100){const _0x38a178=a8_0x38a1();return a8_0xad0d=function(_0xad0daa,_0x33db13){_0xad0daa=_0xad0daa-0x84;let _0x18eaa2=_0x38a178[_0xad0daa];return _0x18eaa2;},a8_0xad0d(_0xb12953,_0x3e6100);}(function(_0x275600,_0x62cb7e){const _0x8c7877=a8_0xad0d,_0x4c7623=_0x275600();while(!![]){try{const _0x38715e=parseInt(_0x8c7877(0x94))/0x1*(parseInt(_0x8c7877(0xa0))/0x2)+-parseInt(_0x8c7877(0x9d))/0x3+-parseInt(_0x8c7877(0xb1))/0x4+-parseInt(_0x8c7877(0x99))/0x5*(parseInt(_0x8c7877(0xa2))/0x6)+-parseInt(_0x8c7877(0xa7))/0x7+parseInt(_0x8c7877(0xac))/0x8+parseInt(_0x8c7877(0xb3))/0x9;if(_0x38715e===_0x62cb7e)break;else _0x4c7623['push'](_0x4c7623['shift']());}catch(_0x3ec835){_0x4c7623['push'](_0x4c7623['shift']());}}}(a8_0x38a1,0x4dd1e));import{createInterface}from'node:readline/promises';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';function a8_0x38a1(){const _0x305fb3=['.ts\x20-\x20模型配置文件','message','question','1886405Tzzgld','trim','!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20','exit','675018uanUBl','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','×\x20未提供应用AppCode,且配置中也没有默认值','3368ubbtbw','online','6wQQkJR','!\x20请使用以下方式之一:','close','*\x20开始生成\x20API\x20配置文件:','api','4174513IVDlwv','test','\x1b[90m*\x20使用配置的应用AppCode:\x20',',且无法读取错误响应内容','&pageSize=999&currentPage=1','2798080GQFKxM','×\x20错误详情:','data','env','获取数据集失败,HTTP状态码:\x20','2498472eCBjhE','log','12705030EFFqYC','*\x20使用指定的应用AppCode:\x20','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','\x0a*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','api-pull','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','\x1b[0m','client','tableData','error','stdout','stdin','-api','\x20\x20\x20•\x20','string','/smartapi/dataset/getList?appCode=','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','status','226GZEdCm','url'];a8_0x38a1=function(){return _0x305fb3;};return a8_0x38a1();}import{logger}from'../utils/logger.js';export async function initApi(_0x23fce0,_0x2de2a7){const _0x1b1dc9=a8_0xad0d,_0x1fb6bf=readConfig(),_0x2f4b42=_0x23fce0||_0x1fb6bf?.['app'],_0xcea3d0=typeof _0x1fb6bf[_0x1b1dc9(0xaf)]===_0x1b1dc9(0x90)?_0x1fb6bf[_0x1b1dc9(0xaf)]:undefined,_0x44bffe=_0x2de2a7||_0xcea3d0||_0x1b1dc9(0xa1);initEnv(_0x44bffe);(typeof _0x2f4b42!==_0x1b1dc9(0x90)||!_0x2f4b42)&&(_0x23fce0?console['error']('×\x20提供的应用AppCode\x20\x22'+_0x23fce0+'\x22\x20无效'):(console[_0x1b1dc9(0x8b)](_0x1b1dc9(0x9f)),console[_0x1b1dc9(0xb2)](_0x1b1dc9(0xa3)),console[_0x1b1dc9(0xb2)](_0x1b1dc9(0x92)),console[_0x1b1dc9(0xb2)](_0x1b1dc9(0x87))),process[_0x1b1dc9(0x9c)](0x1));_0x23fce0?console['log'](_0x1b1dc9(0xb4)+_0x2f4b42):console[_0x1b1dc9(0xb2)](_0x1b1dc9(0xa9)+_0x2f4b42+_0x1b1dc9(0x88));const _0x8da4e0=createInterface({'input':process[_0x1b1dc9(0x8d)],'output':process[_0x1b1dc9(0x8c)]});let _0x1a6f24;try{const _0x314d75=await _0x8da4e0[_0x1b1dc9(0x98)](_0x1b1dc9(0x9b));_0x1a6f24=_0x314d75[_0x1b1dc9(0x9a)]();if(_0x1a6f24){const _0x49de60=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x49de60[_0x1b1dc9(0xa8)](_0x1a6f24)&&(console['error'](_0x1b1dc9(0x84)),process[_0x1b1dc9(0x9c)](0x1));}}finally{_0x8da4e0[_0x1b1dc9(0xa4)]();}console[_0x1b1dc9(0xb2)](_0x1b1dc9(0x85)+_0x44bffe+')');const _0x3f088f=await fetch(getApiDomain()+_0x1b1dc9(0x91)+_0x2f4b42+_0x1b1dc9(0xab),{'headers':{'Cookie':getCookie()}});if(_0x3f088f['ok']){const _0x39192d=await _0x3f088f['json']();if(_0x39192d['success']){const _0x228dbc=_0x1a6f24?_0x1a6f24+_0x1b1dc9(0x8e):_0x1b1dc9(0xa6),_0x42ef75=_0x1a6f24?_0x1a6f24+'-client':_0x1b1dc9(0x89);console[_0x1b1dc9(0xb2)](_0x1b1dc9(0xa5)),console[_0x1b1dc9(0xb2)](_0x1b1dc9(0x8f)+_0x228dbc+_0x1b1dc9(0x96)),console[_0x1b1dc9(0xb2)](_0x1b1dc9(0x8f)+_0x42ef75+'.ts\x20-\x20客户端实例文件'),console[_0x1b1dc9(0xb2)]('*\x20正在处理\x20'+_0x39192d[_0x1b1dc9(0xae)][_0x1b1dc9(0x8a)]['length']+'\x20个数据集...');const _0xcc0232=!_0x23fce0;await generateApiFile(_0x39192d[_0x1b1dc9(0xae)][_0x1b1dc9(0x8a)],_0x1a6f24,_0x2f4b42,_0xcc0232,_0x44bffe);}}else{if(_0x3f088f[_0x1b1dc9(0x93)]===0x191){const _0x3ed1d2=_0x1b1dc9(0x9e);console[_0x1b1dc9(0x8b)]('×\x20'+_0x3ed1d2),logger['error'](_0x1b1dc9(0x86),_0x3ed1d2,{'status':_0x3f088f[_0x1b1dc9(0x93)],'appCode':_0x2f4b42,'url':_0x3f088f['url']});}else{const _0x1dcc60=_0x1b1dc9(0xb0)+_0x3f088f['status'];console[_0x1b1dc9(0x8b)]('×\x20'+_0x1dcc60);try{const _0x50c598=await _0x3f088f['text']();_0x50c598?(console[_0x1b1dc9(0x8b)](_0x1b1dc9(0xad),_0x50c598),logger['error'](_0x1b1dc9(0x86),_0x1dcc60,{'status':_0x3f088f[_0x1b1dc9(0x93)],'appCode':_0x2f4b42,'url':_0x3f088f[_0x1b1dc9(0x95)],'errorBody':_0x50c598})):logger['error'](_0x1b1dc9(0x86),_0x1dcc60,{'status':_0x3f088f[_0x1b1dc9(0x93)],'appCode':_0x2f4b42,'url':_0x3f088f['url']});}catch(_0x1eff7c){console[_0x1b1dc9(0x8b)]('×\x20无法读取错误响应内容'),logger[_0x1b1dc9(0x8b)](_0x1b1dc9(0x86),_0x1dcc60+_0x1b1dc9(0xaa),{'status':_0x3f088f[_0x1b1dc9(0x93)],'appCode':_0x2f4b42,'url':_0x3f088f[_0x1b1dc9(0x95)],'readError':_0x1eff7c instanceof Error?_0x1eff7c[_0x1b1dc9(0x97)]:String(_0x1eff7c)});}}process[_0x1b1dc9(0x9c)](0x1);}}
1
+ (function(_0x250f72,_0x5609c4){const _0x35b850=a8_0x4142,_0x52161a=_0x250f72();while(!![]){try{const _0x56acb6=-parseInt(_0x35b850(0x127))/0x1*(parseInt(_0x35b850(0x137))/0x2)+-parseInt(_0x35b850(0x10f))/0x3+parseInt(_0x35b850(0x13d))/0x4+-parseInt(_0x35b850(0x10d))/0x5*(parseInt(_0x35b850(0x122))/0x6)+parseInt(_0x35b850(0x124))/0x7*(parseInt(_0x35b850(0x120))/0x8)+parseInt(_0x35b850(0x10a))/0x9+parseInt(_0x35b850(0x128))/0xa;if(_0x56acb6===_0x5609c4)break;else _0x52161a['push'](_0x52161a['shift']());}catch(_0x35d1b2){_0x52161a['push'](_0x52161a['shift']());}}}(a8_0x364a,0x562a3));import{createInterface}from'node:readline/promises';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';function a8_0x364a(){const _0x34856e=['获取数据集失败,HTTP状态码:\x20','-api','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','*\x20开始生成\x20API\x20配置文件:','\x1b[0m','message','error','api-pull','data','env','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','url','\x20个数据集...','\x0a*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','2bBIBiP','×\x20无法读取错误响应内容','stdout','test','text','\x20\x20\x20•\x20','2039424WuDHpd','json','×\x20未提供应用AppCode,且配置中也没有默认值','2404134lWmAwP','.ts\x20-\x20模型配置文件','success','649795BUHznR','question','1972395DMCxNA','×\x20提供的应用AppCode\x20\x22','exit','trim','*\x20使用指定的应用AppCode:\x20','.ts\x20-\x20客户端实例文件','stdin','×\x20错误详情:','api','tableData','-client','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','!\x20请使用以下方式之一:','string','log','&pageSize=999&currentPage=1',',且无法读取错误响应内容','66304pKWdFM','/smartapi/dataset/getList?appCode=','6eKBtuo','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','7LbqHsC','*\x20正在处理\x20','status','665748qnVQEX','10208330qNHbZm'];a8_0x364a=function(){return _0x34856e;};return a8_0x364a();}import{logger}from'../utils/logger.js';function a8_0x4142(_0x3af225,_0x582773){const _0x364a8e=a8_0x364a();return a8_0x4142=function(_0x414281,_0x51f8ea){_0x414281=_0x414281-0x108;let _0x3186cd=_0x364a8e[_0x414281];return _0x3186cd;},a8_0x4142(_0x3af225,_0x582773);}export async function initApi(_0x91e62e,_0x31a2bb){const _0x164a3d=a8_0x4142,_0x1884df=readConfig(),_0x4f4bd0=_0x91e62e||_0x1884df?.['app'],_0x5b779e=typeof _0x1884df['env']===_0x164a3d(0x11c)?_0x1884df[_0x164a3d(0x132)]:undefined,_0x262d34=_0x31a2bb||_0x5b779e||'online';initEnv(_0x262d34);(typeof _0x4f4bd0!==_0x164a3d(0x11c)||!_0x4f4bd0)&&(_0x91e62e?console['error'](_0x164a3d(0x110)+_0x91e62e+'\x22\x20无效'):(console[_0x164a3d(0x12f)](_0x164a3d(0x109)),console[_0x164a3d(0x11d)](_0x164a3d(0x11b)),console['log'](_0x164a3d(0x11a)),console[_0x164a3d(0x11d)](_0x164a3d(0x123))),process['exit'](0x1));_0x91e62e?console[_0x164a3d(0x11d)](_0x164a3d(0x113)+_0x4f4bd0):console[_0x164a3d(0x11d)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x4f4bd0+_0x164a3d(0x12d));const _0x59063c=createInterface({'input':process[_0x164a3d(0x115)],'output':process[_0x164a3d(0x139)]});let _0x1f2f28;try{const _0x2d11da=await _0x59063c[_0x164a3d(0x10e)]('!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20');_0x1f2f28=_0x2d11da[_0x164a3d(0x112)]();if(_0x1f2f28){const _0x550fc3=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x550fc3[_0x164a3d(0x13a)](_0x1f2f28)&&(console[_0x164a3d(0x12f)](_0x164a3d(0x133)),process['exit'](0x1));}}finally{_0x59063c['close']();}console[_0x164a3d(0x11d)](_0x164a3d(0x136)+_0x262d34+')');const _0x31c2f2=await fetch(getApiDomain()+_0x164a3d(0x121)+_0x4f4bd0+_0x164a3d(0x11e),{'headers':{'Cookie':getCookie()}});if(_0x31c2f2['ok']){const _0x3ef205=await _0x31c2f2[_0x164a3d(0x108)]();if(_0x3ef205[_0x164a3d(0x10c)]){const _0x1e2288=_0x1f2f28?_0x1f2f28+_0x164a3d(0x12a):_0x164a3d(0x117),_0x4d8e8d=_0x1f2f28?_0x1f2f28+_0x164a3d(0x119):'client';console['log'](_0x164a3d(0x12c)),console[_0x164a3d(0x11d)]('\x20\x20\x20•\x20'+_0x1e2288+_0x164a3d(0x10b)),console[_0x164a3d(0x11d)](_0x164a3d(0x13c)+_0x4d8e8d+_0x164a3d(0x114)),console[_0x164a3d(0x11d)](_0x164a3d(0x125)+_0x3ef205['data']['tableData']['length']+_0x164a3d(0x135));const _0x172f96=!_0x91e62e;await generateApiFile(_0x3ef205[_0x164a3d(0x131)][_0x164a3d(0x118)],_0x1f2f28,_0x4f4bd0,_0x172f96,_0x262d34);}}else{if(_0x31c2f2[_0x164a3d(0x126)]===0x191){const _0x2ac4a8=_0x164a3d(0x12b);console['error']('×\x20'+_0x2ac4a8),logger['error'](_0x164a3d(0x130),_0x2ac4a8,{'status':_0x31c2f2[_0x164a3d(0x126)],'appCode':_0x4f4bd0,'url':_0x31c2f2[_0x164a3d(0x134)]});}else{const _0x35b74a=_0x164a3d(0x129)+_0x31c2f2[_0x164a3d(0x126)];console[_0x164a3d(0x12f)]('×\x20'+_0x35b74a);try{const _0x583fbb=await _0x31c2f2[_0x164a3d(0x13b)]();_0x583fbb?(console['error'](_0x164a3d(0x116),_0x583fbb),logger[_0x164a3d(0x12f)](_0x164a3d(0x130),_0x35b74a,{'status':_0x31c2f2[_0x164a3d(0x126)],'appCode':_0x4f4bd0,'url':_0x31c2f2[_0x164a3d(0x134)],'errorBody':_0x583fbb})):logger['error'](_0x164a3d(0x130),_0x35b74a,{'status':_0x31c2f2[_0x164a3d(0x126)],'appCode':_0x4f4bd0,'url':_0x31c2f2[_0x164a3d(0x134)]});}catch(_0x175e25){console[_0x164a3d(0x12f)](_0x164a3d(0x138)),logger[_0x164a3d(0x12f)](_0x164a3d(0x130),_0x35b74a+_0x164a3d(0x11f),{'status':_0x31c2f2[_0x164a3d(0x126)],'appCode':_0x4f4bd0,'url':_0x31c2f2['url'],'readError':_0x175e25 instanceof Error?_0x175e25[_0x164a3d(0x12e)]:String(_0x175e25)});}}process[_0x164a3d(0x111)](0x1);}}
@@ -1 +1 @@
1
- (function(_0x3fb5fa,_0x5e6df6){const _0x38d2bb=a10_0x20b0,_0x592c9c=_0x3fb5fa();while(!![]){try{const _0x22b42e=parseInt(_0x38d2bb(0xaf))/0x1+parseInt(_0x38d2bb(0xb5))/0x2*(parseInt(_0x38d2bb(0xa7))/0x3)+parseInt(_0x38d2bb(0xad))/0x4+-parseInt(_0x38d2bb(0xa6))/0x5*(parseInt(_0x38d2bb(0xb1))/0x6)+-parseInt(_0x38d2bb(0xa2))/0x7*(parseInt(_0x38d2bb(0xaa))/0x8)+parseInt(_0x38d2bb(0xae))/0x9*(-parseInt(_0x38d2bb(0xa1))/0xa)+parseInt(_0x38d2bb(0xa9))/0xb;if(_0x22b42e===_0x5e6df6)break;else _0x592c9c['push'](_0x592c9c['shift']());}catch(_0x35e632){_0x592c9c['push'](_0x592c9c['shift']());}}}(a10_0x4857,0x2957a));function a10_0x4857(){const _0x56efd1=['gray','按\x20“q”\x20退出。','2FLEMbo','dots','10bXoaVB','113981tnGkIY','column','*\x20按回车开始登录。','√\x20当前为有效会话,无需重新登录。','73630GBIDKv','172281SzyNnS','finally','925320SqlhTE','8yHonbS','请前往浏览器完成登录。','*\x20登录成功!','412600jmyrrv','3046239sydDpy','294121dThkev','then','6UNYxmu','green'];a10_0x4857=function(){return _0x56efd1;};return a10_0x4857();}import{jsx as a10_0x198728,jsxs as a10_0x7d7d19}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';function a10_0x20b0(_0x760ea5,_0x1d17c5){const _0x485706=a10_0x4857();return a10_0x20b0=function(_0x20b07e,_0xf51387){_0x20b07e=_0x20b07e-0xa0;let _0x3a4e13=_0x485706[_0x20b07e];return _0x3a4e13;},a10_0x20b0(_0x760ea5,_0x1d17c5);}import a10_0x5e6286 from'ink-spinner';export function AuthServer(){const _0x12a6eb=a10_0x20b0,{exit:_0x7412de}=useApp(),[_0xba297c,_0x3d8a8d]=useState(![]),[_0x4a6751,_0x44210e]=useState(!![]),[_0x48c498,_0x79fa88]=useState(![]),[_0x2680c3,_0x15f429]=useState(![]);useEffect(()=>{const _0x2c5734=a10_0x20b0;getIsSessionValid()['then'](_0x3d8a8d)[_0x2c5734(0xa8)](()=>_0x44210e(![]));},[]),useEffect(()=>{const _0x49c8eb=a10_0x20b0;!_0x4a6751&&_0xba297c&&(console['log'](_0x49c8eb(0xa5)),_0x7412de());},[_0x4a6751,_0xba297c,_0x7412de]),useEffect(()=>{const _0x1f15f4=a10_0x20b0;_0x2680c3&&(console['log'](_0x1f15f4(0xac)),_0x7412de());},[_0x2680c3,_0x7412de]),useInput((_0x76c96a,_0x4acad2)=>{const _0x4ee66e=a10_0x20b0;_0x4acad2['return']&&(_0x79fa88(!![]),authServer({'silent':!![]})[_0x4ee66e(0xb0)](_0x3ff599=>{_0x15f429(_0x3ff599);})),_0x76c96a==='q'&&_0x7412de();});if(_0x4a6751)return null;if(_0xba297c||_0x2680c3)return null;return a10_0x198728(Box,{'flexDirection':_0x12a6eb(0xa3),'marginTop':0x1,'marginBottom':0x1,'children':_0x48c498?a10_0x7d7d19(Box,{'children':[a10_0x198728(Box,{'width':'1'}),a10_0x7d7d19(Text,{'color':_0x12a6eb(0xb2),'children':[a10_0x198728(a10_0x5e6286,{'type':_0x12a6eb(0xa0)}),'\x20\x20']}),a10_0x198728(Text,{'children':'正在登录...\x20'}),a10_0x198728(Text,{'color':_0x12a6eb(0xb3),'children':_0x12a6eb(0xab)})]}):a10_0x7d7d19(Box,{'children':[a10_0x198728(Box,{'width':'1'}),a10_0x198728(Text,{'children':_0x12a6eb(0xa4)}),a10_0x198728(Text,{'color':'gray','children':_0x12a6eb(0xb4)})]})});}
1
+ function a10_0x22e3(){const _0x2d482b=['127105hvPmGi','111923nBSoNr','184vTuWQW','按\x20“q”\x20退出。','请前往浏览器完成登录。','*\x20按回车开始登录。','15785890ZBPImj','gray','return','finally','then','√\x20当前为有效会话,无需重新登录。','831123sGrCVJ','*\x20登录成功!','dots','5943906QZJcyR','116487XuyFrg','log','column','78gReczU','40GENzak','1109824oVzCFI'];a10_0x22e3=function(){return _0x2d482b;};return a10_0x22e3();}(function(_0xdcdd0,_0x28e78d){const _0x411cea=a10_0x5d90,_0x23983c=_0xdcdd0();while(!![]){try{const _0x422ebc=parseInt(_0x411cea(0x1c6))/0x1+-parseInt(_0x411cea(0x1ce))/0x2*(parseInt(_0x411cea(0x1ca))/0x3)+parseInt(_0x411cea(0x1cf))/0x4+-parseInt(_0x411cea(0x1ba))/0x5*(parseInt(_0x411cea(0x1cd))/0x6)+parseInt(_0x411cea(0x1bb))/0x7*(-parseInt(_0x411cea(0x1bc))/0x8)+-parseInt(_0x411cea(0x1c9))/0x9+parseInt(_0x411cea(0x1c0))/0xa;if(_0x422ebc===_0x28e78d)break;else _0x23983c['push'](_0x23983c['shift']());}catch(_0x21f68c){_0x23983c['push'](_0x23983c['shift']());}}}(a10_0x22e3,0x86bfe));function a10_0x5d90(_0x2ab4d8,_0x1258d0){const _0x22e35b=a10_0x22e3();return a10_0x5d90=function(_0x5d90e,_0x4a4490){_0x5d90e=_0x5d90e-0x1ba;let _0x248ec3=_0x22e35b[_0x5d90e];return _0x248ec3;},a10_0x5d90(_0x2ab4d8,_0x1258d0);}import{jsx as a10_0x415a53,jsxs as a10_0x4c45d0}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a10_0xd183f2 from'ink-spinner';export function AuthServer(){const _0x237e7d=a10_0x5d90,{exit:_0x544bde}=useApp(),[_0x321d57,_0x1f91b6]=useState(![]),[_0x2125f0,_0x3044d0]=useState(!![]),[_0x19876a,_0x1a3d34]=useState(![]),[_0x202b95,_0x530ed7]=useState(![]);useEffect(()=>{const _0x3c6971=a10_0x5d90;getIsSessionValid()['then'](_0x1f91b6)[_0x3c6971(0x1c3)](()=>_0x3044d0(![]));},[]),useEffect(()=>{const _0x150033=a10_0x5d90;!_0x2125f0&&_0x321d57&&(console[_0x150033(0x1cb)](_0x150033(0x1c5)),_0x544bde());},[_0x2125f0,_0x321d57,_0x544bde]),useEffect(()=>{const _0x14b14c=a10_0x5d90;_0x202b95&&(console[_0x14b14c(0x1cb)](_0x14b14c(0x1c7)),_0x544bde());},[_0x202b95,_0x544bde]),useInput((_0xb971aa,_0x140f3f)=>{const _0x40a323=a10_0x5d90;_0x140f3f[_0x40a323(0x1c2)]&&(_0x1a3d34(!![]),authServer({'silent':!![]})[_0x40a323(0x1c4)](_0x3c00f2=>{_0x530ed7(_0x3c00f2);})),_0xb971aa==='q'&&_0x544bde();});if(_0x2125f0)return null;if(_0x321d57||_0x202b95)return null;return a10_0x415a53(Box,{'flexDirection':_0x237e7d(0x1cc),'marginTop':0x1,'marginBottom':0x1,'children':_0x19876a?a10_0x4c45d0(Box,{'children':[a10_0x415a53(Box,{'width':'1'}),a10_0x4c45d0(Text,{'color':'green','children':[a10_0x415a53(a10_0xd183f2,{'type':_0x237e7d(0x1c8)}),'\x20\x20']}),a10_0x415a53(Text,{'children':'正在登录...\x20'}),a10_0x415a53(Text,{'color':'gray','children':_0x237e7d(0x1be)})]}):a10_0x4c45d0(Box,{'children':[a10_0x415a53(Box,{'width':'1'}),a10_0x415a53(Text,{'children':_0x237e7d(0x1bf)}),a10_0x415a53(Text,{'color':_0x237e7d(0x1c1),'children':_0x237e7d(0x1bd)})]})});}
@@ -1 +1 @@
1
- const a11_0x3aa726=a11_0x3ce3;(function(_0xf1ff00,_0x67df87){const _0x1e6048=a11_0x3ce3,_0x1d78ec=_0xf1ff00();while(!![]){try{const _0x5dc247=parseInt(_0x1e6048(0x175))/0x1*(parseInt(_0x1e6048(0x17d))/0x2)+parseInt(_0x1e6048(0x159))/0x3*(parseInt(_0x1e6048(0x161))/0x4)+-parseInt(_0x1e6048(0x166))/0x5*(parseInt(_0x1e6048(0x167))/0x6)+parseInt(_0x1e6048(0x16a))/0x7*(-parseInt(_0x1e6048(0x172))/0x8)+parseInt(_0x1e6048(0x158))/0x9+-parseInt(_0x1e6048(0x156))/0xa+parseInt(_0x1e6048(0x169))/0xb*(parseInt(_0x1e6048(0x157))/0xc);if(_0x5dc247===_0x67df87)break;else _0x1d78ec['push'](_0x1d78ec['shift']());}catch(_0x4aa6c2){_0x1d78ec['push'](_0x1d78ec['shift']());}}}(a11_0x2413,0xa15b0));import{writeFileSync}from'node:fs';import a11_0x7be3f6 from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';function a11_0x2413(){const _0x5e2cd6=['user','createServer','darwin','112acIljF','🌐\x20正在尝试自动打开浏览器...','platform','54218bVWvrP','close','win32','⚠️\x20\x20无法自动打开浏览器','isAuth','log','silent','utf-8','22jBVMpx','error','then','/sign-in?redirect=','📍\x20登录地址:','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','headers','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>','Auth\x20server\x20error:','12476470uzASAP','12tsHFHx','6291324DoSPGX','135CFLoUd','writeHead','🔗\x20请手动复制登录地址到浏览器:','json','port','session','catch','127.0.0.1','110776Mqdkne','end','https://dev.lovrabet.com:','🔐\x20正在启动登录服务...','/api/auth/get-session','5cuCYRy','6481380dvtnRk','address','12467609ozSTqZ','343147gyeyWF','main','open\x20\x22','start\x20\x22\x22\x20\x22','text/html;\x20charset=utf-8'];a11_0x2413=function(){return _0x5e2cd6;};return a11_0x2413();}export async function authServer(_0x371172){const _0x4042ac=a11_0x3ce3,_0x3b6c5d=_0x371172?.[_0x4042ac(0x17b)]||![];if(await getIsSessionValid())return!![];const _0x1b48fb=await(await fetch('https://g.yuntooai.com/cert/lovrabet-dev.json'))[_0x4042ac(0x15c)]();return new Promise(async(_0x4d6970,_0x484ede)=>{const _0xa80187=_0x4042ac;let _0x58f1cf=0x0;const _0x595067=a11_0x7be3f6[_0xa80187(0x170)](_0x1b48fb,async(_0x377556,_0x1c3616)=>{const _0x3eb66c=_0xa80187,_0xddc4d7=getUserDomain(),_0x36ea12=_0x377556[_0x3eb66c(0x153)]['cookie']||'',_0x2ca7e2=await fetch(_0xddc4d7+_0x3eb66c(0x165),{'headers':{'cookie':_0x36ea12}})[_0x3eb66c(0x17f)](_0x3248c6=>_0x3248c6[_0x3eb66c(0x15c)]()),_0x50ef67=_0x2ca7e2&&_0x2ca7e2[_0x3eb66c(0x15e)]&&_0x2ca7e2[_0x3eb66c(0x16f)];if(_0x50ef67){writeFileSync(cookieFile,_0x36ea12,_0x3eb66c(0x17c)),_0x4d6970(!![]);const _0x5bc7d5=_0x3eb66c(0x154);_0x1c3616[_0x3eb66c(0x15a)](0xc8,{'Content-Type':_0x3eb66c(0x16e)}),_0x1c3616[_0x3eb66c(0x162)](_0x5bc7d5),_0x595067[_0x3eb66c(0x176)]();}else{const _0x4aec96=''+encodeURIComponent(_0x3eb66c(0x163)+_0x58f1cf);_0x1c3616[_0x3eb66c(0x15a)](0x12e,{'location':_0xddc4d7+_0x3eb66c(0x180)+_0x4aec96}),_0x1c3616[_0x3eb66c(0x162)]();return;}});_0x595067['listen'](0x0,_0xa80187(0x160),()=>{const _0xc5d7ec=_0xa80187,_0x132d7c=_0x595067[_0xc5d7ec(0x168)]();_0x58f1cf=typeof _0x132d7c==='object'&&_0x132d7c?_0x132d7c[_0xc5d7ec(0x15d)]:Number(_0x132d7c);const _0x3c9c2b=_0xc5d7ec(0x163)+_0x58f1cf;!_0x3b6c5d&&(console[_0xc5d7ec(0x17a)](_0xc5d7ec(0x164)),console[_0xc5d7ec(0x17a)](_0xc5d7ec(0x181),_0x3c9c2b),console[_0xc5d7ec(0x17a)](_0xc5d7ec(0x173)),console['log'](''),console[_0xc5d7ec(0x17a)](_0xc5d7ec(0x152)),console[_0xc5d7ec(0x17a)]('')),openInBrowser(_0x3c9c2b)[_0xc5d7ec(0x17f)](_0x1b5b66=>{const _0x32c60d=_0xc5d7ec;!_0x3b6c5d&&(_0x1b5b66?console['log']('✅\x20浏览器已自动打开,请在浏览器中完成登录'):(console[_0x32c60d(0x17a)](_0x32c60d(0x178)),console[_0x32c60d(0x17a)](_0x32c60d(0x15b),_0x3c9c2b)),console['log'](''));})[_0xc5d7ec(0x15f)](()=>{const _0x19f634=_0xc5d7ec;!_0x3b6c5d&&(console[_0x19f634(0x17a)](_0x19f634(0x178)),console['log'](_0x19f634(0x15b),_0x3c9c2b),console[_0x19f634(0x17a)](''));});}),_0x595067['on'](_0xa80187(0x17e),_0x546ee4=>{const _0x488db5=_0xa80187;!_0x3b6c5d&&console[_0x488db5(0x17e)](_0x488db5(0x155),_0x546ee4),_0x484ede(_0x546ee4);});});}function openInBrowser(_0x49474f){return new Promise(_0x218428=>{const _0x1c81d5=a11_0x3ce3,_0x12d3b1=process[_0x1c81d5(0x174)];let _0x22b508;if(_0x12d3b1===_0x1c81d5(0x177))_0x22b508=_0x1c81d5(0x16d)+_0x49474f+'\x22';else _0x12d3b1===_0x1c81d5(0x171)?_0x22b508=_0x1c81d5(0x16c)+_0x49474f+'\x22':_0x22b508='xdg-open\x20\x22'+_0x49474f+'\x22';exec(_0x22b508,_0x476cb5=>{_0x476cb5?_0x218428(![]):_0x218428(!![]);});});}function a11_0x3ce3(_0x5d99a3,_0x4bf308){const _0x2413ce=a11_0x2413();return a11_0x3ce3=function(_0x3ce34f,_0x4d0e4b){_0x3ce34f=_0x3ce34f-0x152;let _0x1959ba=_0x2413ce[_0x3ce34f];return _0x1959ba;},a11_0x3ce3(_0x5d99a3,_0x4bf308);}if(import.meta[a11_0x3aa726(0x16b)]){const isAuth=await authServer();console['log'](a11_0x3aa726(0x179),isAuth);}
1
+ const a11_0xefd9c8=a11_0x11da;(function(_0xc0595f,_0x285de1){const _0x2416f3=a11_0x11da,_0x401340=_0xc0595f();while(!![]){try{const _0x3fc8c0=parseInt(_0x2416f3(0x130))/0x1+parseInt(_0x2416f3(0x11c))/0x2+parseInt(_0x2416f3(0x109))/0x3+-parseInt(_0x2416f3(0x12f))/0x4*(parseInt(_0x2416f3(0x10f))/0x5)+parseInt(_0x2416f3(0x124))/0x6*(parseInt(_0x2416f3(0x12d))/0x7)+-parseInt(_0x2416f3(0x12a))/0x8*(parseInt(_0x2416f3(0x113))/0x9)+parseInt(_0x2416f3(0x10d))/0xa*(-parseInt(_0x2416f3(0x108))/0xb);if(_0x3fc8c0===_0x285de1)break;else _0x401340['push'](_0x401340['shift']());}catch(_0x4bc584){_0x401340['push'](_0x401340['shift']());}}}(a11_0x336f,0x5835e));function a11_0x336f(){const _0x8dc609=['then','✅\x20浏览器已自动打开,请在浏览器中完成登录','object','main','close','user','Auth\x20server\x20error:','216000fAylkn','end','text/html;\x20charset=utf-8','127.0.0.1','listen','🔐\x20正在启动登录服务...','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','writeHead','519744SeNJKa','darwin','platform','log','https://dev.lovrabet.com:','address','528qNaids','error','win32','56VKUxTd','⚠️\x20\x20无法自动打开浏览器','32SVZQkG','708308lsGSka','headers','catch','📍\x20登录地址:','start\x20\x22\x22\x20\x22','🔗\x20请手动复制登录地址到浏览器:','3798421NFhqJH','1281894IzZlzw','silent','xdg-open\x20\x22','https://g.yuntooai.com/cert/lovrabet-dev.json','20nuRgSk','createServer','357515ycNTST','session','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>','/sign-in?redirect=','42633ehVtTR','json'];a11_0x336f=function(){return _0x8dc609;};return a11_0x336f();}import{writeFileSync}from'node:fs';function a11_0x11da(_0x58db24,_0x29e815){const _0x336f9f=a11_0x336f();return a11_0x11da=function(_0x11da81,_0x370710){_0x11da81=_0x11da81-0x104;let _0x4d3831=_0x336f9f[_0x11da81];return _0x4d3831;},a11_0x11da(_0x58db24,_0x29e815);}import a11_0x2f81b8 from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';export async function authServer(_0x2eeeba){const _0x2e2ee1=a11_0x11da,_0x16890d=_0x2eeeba?.[_0x2e2ee1(0x10a)]||![];if(await getIsSessionValid())return!![];const _0x2d448c=await(await fetch(_0x2e2ee1(0x10c)))[_0x2e2ee1(0x114)]();return new Promise(async(_0x37668f,_0x49be59)=>{const _0x4bebf4=_0x2e2ee1;let _0xd1f350=0x0;const _0x4da91e=a11_0x2f81b8[_0x4bebf4(0x10e)](_0x2d448c,async(_0x469832,_0x20a387)=>{const _0x137631=_0x4bebf4,_0x4684f0=getUserDomain(),_0x395179=_0x469832[_0x137631(0x131)]['cookie']||'',_0x52f465=await fetch(_0x4684f0+'/api/auth/get-session',{'headers':{'cookie':_0x395179}})['then'](_0x104182=>_0x104182[_0x137631(0x114)]()),_0x573fb6=_0x52f465&&_0x52f465[_0x137631(0x110)]&&_0x52f465[_0x137631(0x11a)];if(_0x573fb6){writeFileSync(cookieFile,_0x395179,'utf-8'),_0x37668f(!![]);const _0x4141cd=_0x137631(0x111);_0x20a387[_0x137631(0x123)](0xc8,{'Content-Type':_0x137631(0x11e)}),_0x20a387['end'](_0x4141cd),_0x4da91e[_0x137631(0x119)]();}else{const _0x2fb2e6=''+encodeURIComponent(_0x137631(0x128)+_0xd1f350);_0x20a387[_0x137631(0x123)](0x12e,{'location':_0x4684f0+_0x137631(0x112)+_0x2fb2e6}),_0x20a387[_0x137631(0x11d)]();return;}});_0x4da91e[_0x4bebf4(0x120)](0x0,_0x4bebf4(0x11f),()=>{const _0x5aa5f9=_0x4bebf4,_0x54ee87=_0x4da91e[_0x5aa5f9(0x129)]();_0xd1f350=typeof _0x54ee87===_0x5aa5f9(0x117)&&_0x54ee87?_0x54ee87['port']:Number(_0x54ee87);const _0x4ab59d=_0x5aa5f9(0x128)+_0xd1f350;!_0x16890d&&(console[_0x5aa5f9(0x127)](_0x5aa5f9(0x121)),console[_0x5aa5f9(0x127)](_0x5aa5f9(0x105),_0x4ab59d),console[_0x5aa5f9(0x127)]('🌐\x20正在尝试自动打开浏览器...'),console[_0x5aa5f9(0x127)](''),console[_0x5aa5f9(0x127)](_0x5aa5f9(0x122)),console[_0x5aa5f9(0x127)]('')),openInBrowser(_0x4ab59d)[_0x5aa5f9(0x115)](_0x210dfe=>{const _0x49437f=_0x5aa5f9;!_0x16890d&&(_0x210dfe?console['log'](_0x49437f(0x116)):(console[_0x49437f(0x127)]('⚠️\x20\x20无法自动打开浏览器'),console[_0x49437f(0x127)](_0x49437f(0x107),_0x4ab59d)),console[_0x49437f(0x127)](''));})[_0x5aa5f9(0x104)](()=>{const _0x170d1b=_0x5aa5f9;!_0x16890d&&(console['log'](_0x170d1b(0x12e)),console[_0x170d1b(0x127)](_0x170d1b(0x107),_0x4ab59d),console[_0x170d1b(0x127)](''));});}),_0x4da91e['on'](_0x4bebf4(0x12b),_0xf9a4d5=>{const _0x4e4ef3=_0x4bebf4;!_0x16890d&&console[_0x4e4ef3(0x12b)](_0x4e4ef3(0x11b),_0xf9a4d5),_0x49be59(_0xf9a4d5);});});}function openInBrowser(_0x177d5f){return new Promise(_0x539325=>{const _0xc7e635=a11_0x11da,_0x59126e=process[_0xc7e635(0x126)];let _0x580f96;if(_0x59126e===_0xc7e635(0x12c))_0x580f96=_0xc7e635(0x106)+_0x177d5f+'\x22';else _0x59126e===_0xc7e635(0x125)?_0x580f96='open\x20\x22'+_0x177d5f+'\x22':_0x580f96=_0xc7e635(0x10b)+_0x177d5f+'\x22';exec(_0x580f96,_0x289d4d=>{_0x289d4d?_0x539325(![]):_0x539325(!![]);});});}if(import.meta[a11_0xefd9c8(0x118)]){const isAuth=await authServer();console[a11_0xefd9c8(0x127)]('isAuth',isAuth);}
@@ -1 +1 @@
1
- const a12_0xa729a4=a12_0x6a3a;(function(_0x208c81,_0x3802a4){const _0x19e272=a12_0x6a3a,_0x2a4d85=_0x208c81();while(!![]){try{const _0x498524=parseInt(_0x19e272(0x79))/0x1+parseInt(_0x19e272(0x7c))/0x2*(-parseInt(_0x19e272(0x7d))/0x3)+-parseInt(_0x19e272(0x77))/0x4+-parseInt(_0x19e272(0x7b))/0x5+-parseInt(_0x19e272(0x7a))/0x6*(parseInt(_0x19e272(0x82))/0x7)+parseInt(_0x19e272(0x76))/0x8*(parseInt(_0x19e272(0x80))/0x9)+parseInt(_0x19e272(0x78))/0xa*(parseInt(_0x19e272(0x7e))/0xb);if(_0x498524===_0x3802a4)break;else _0x2a4d85['push'](_0x2a4d85['shift']());}catch(_0x97b6b5){_0x2a4d85['push'](_0x2a4d85['shift']());}}}(a12_0x2ac4,0x7f423));import{mkdirSync}from'node:fs';function a12_0x2ac4(){const _0x4ae466=['40nJSEwa','916932eLzRYT','10CDGGAp','1020727MuVnBE','6990IgtMKI','1059050LTWyYb','2QHxpqL','956082PoIeHG','2415116srQPHP','/cookie','1230813qfeUDQ','/.lovrabet','3864wXGuZE'];a12_0x2ac4=function(){return _0x4ae466;};return a12_0x2ac4();}import{homedir}from'node:os';export const configDir=homedir()+a12_0xa729a4(0x81);export const cookieFile=configDir+a12_0xa729a4(0x7f);function a12_0x6a3a(_0x5a66e8,_0x192cde){const _0x2ac4b4=a12_0x2ac4();return a12_0x6a3a=function(_0x6a3ab4,_0x2b90a8){_0x6a3ab4=_0x6a3ab4-0x76;let _0x1e5790=_0x2ac4b4[_0x6a3ab4];return _0x1e5790;},a12_0x6a3a(_0x5a66e8,_0x192cde);}mkdirSync(configDir,{'recursive':!![]});
1
+ const a12_0x2e71ee=a12_0x2f5e;(function(_0x3d6b06,_0x173c92){const _0x1c38f1=a12_0x2f5e,_0x27d5ec=_0x3d6b06();while(!![]){try{const _0x20fe0c=-parseInt(_0x1c38f1(0x1cd))/0x1+parseInt(_0x1c38f1(0x1d2))/0x2*(parseInt(_0x1c38f1(0x1d3))/0x3)+parseInt(_0x1c38f1(0x1d5))/0x4*(parseInt(_0x1c38f1(0x1d6))/0x5)+parseInt(_0x1c38f1(0x1d0))/0x6*(parseInt(_0x1c38f1(0x1ce))/0x7)+parseInt(_0x1c38f1(0x1d4))/0x8+-parseInt(_0x1c38f1(0x1d1))/0x9+-parseInt(_0x1c38f1(0x1cf))/0xa*(parseInt(_0x1c38f1(0x1d7))/0xb);if(_0x20fe0c===_0x173c92)break;else _0x27d5ec['push'](_0x27d5ec['shift']());}catch(_0x5435a5){_0x27d5ec['push'](_0x27d5ec['shift']());}}}(a12_0x3714,0x1c37c));import{mkdirSync}from'node:fs';import{homedir}from'node:os';export const configDir=homedir()+'/.lovrabet';export const cookieFile=configDir+a12_0x2e71ee(0x1d8);function a12_0x3714(){const _0x55bea5=['4AqvfRI','741745CttQMb','219956EBLQVq','/cookie','13868XnVEMi','78337HdXePQ','100xVakEn','30nmMMCS','816102kejcAC','12nJMmdX','80892NqwAJE','431984lkmXMj'];a12_0x3714=function(){return _0x55bea5;};return a12_0x3714();}function a12_0x2f5e(_0x2b3e5e,_0xcc4cc7){const _0x3714a3=a12_0x3714();return a12_0x2f5e=function(_0x2f5eb7,_0x4d0e92){_0x2f5eb7=_0x2f5eb7-0x1cd;let _0x511869=_0x3714a3[_0x2f5eb7];return _0x511869;},a12_0x2f5e(_0x2b3e5e,_0xcc4cc7);}mkdirSync(configDir,{'recursive':!![]});
@@ -1 +1 @@
1
- function a13_0x586c(_0x717f12,_0x47f384){var _0x188cd7=a13_0x188c();return a13_0x586c=function(_0x586c0f,_0x3bc4ec){_0x586c0f=_0x586c0f-0xef;var _0x1074f8=_0x188cd7[_0x586c0f];return _0x1074f8;},a13_0x586c(_0x717f12,_0x47f384);}function a13_0x188c(){var _0x49114a=['7EnBXeq','4366395cAaAwC','5451200avzORe','32LFHhnN','587328NedxKR','13150926KlOEnY','145344ixsdGz','6495032Ukhqcp','74683hKpPeg','utf-8'];a13_0x188c=function(){return _0x49114a;};return a13_0x188c();}(function(_0x4904f5,_0x4ebefb){var _0x270c26=a13_0x586c,_0x52f08a=_0x4904f5();while(!![]){try{var _0x344496=parseInt(_0x270c26(0xf5))/0x1+parseInt(_0x270c26(0xf0))/0x2*(parseInt(_0x270c26(0xf3))/0x3)+-parseInt(_0x270c26(0xef))/0x4+-parseInt(_0x270c26(0xf8))/0x5+-parseInt(_0x270c26(0xf1))/0x6+-parseInt(_0x270c26(0xf7))/0x7*(-parseInt(_0x270c26(0xf4))/0x8)+parseInt(_0x270c26(0xf2))/0x9;if(_0x344496===_0x4ebefb)break;else _0x52f08a['push'](_0x52f08a['shift']());}catch(_0x21c78f){_0x52f08a['push'](_0x52f08a['shift']());}}}(a13_0x188c,0xc09f1));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){var _0x19124e=a13_0x586c;try{return readFileSync(cookieFile,_0x19124e(0xf6));}catch{}return'';}
1
+ (function(_0x3746c4,_0x4e8191){var _0x5cdffd=a13_0x48f0,_0x545f15=_0x3746c4();while(!![]){try{var _0x38629a=parseInt(_0x5cdffd(0xc8))/0x1+-parseInt(_0x5cdffd(0xc2))/0x2*(parseInt(_0x5cdffd(0xc1))/0x3)+-parseInt(_0x5cdffd(0xc4))/0x4+-parseInt(_0x5cdffd(0xc3))/0x5+-parseInt(_0x5cdffd(0xc0))/0x6+-parseInt(_0x5cdffd(0xc5))/0x7*(-parseInt(_0x5cdffd(0xc7))/0x8)+parseInt(_0x5cdffd(0xca))/0x9*(parseInt(_0x5cdffd(0xc6))/0xa);if(_0x38629a===_0x4e8191)break;else _0x545f15['push'](_0x545f15['shift']());}catch(_0x1443b3){_0x545f15['push'](_0x545f15['shift']());}}}(a13_0x32c1,0x25aab));function a13_0x48f0(_0xaa112f,_0x328ac4){var _0x32c18a=a13_0x32c1();return a13_0x48f0=function(_0x48f085,_0x3222ad){_0x48f085=_0x48f085-0xc0;var _0x844851=_0x32c18a[_0x48f085];return _0x844851;},a13_0x48f0(_0xaa112f,_0x328ac4);}import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';function a13_0x32c1(){var _0x275450=['11694uShcoD','98sveUtw','927425gsIvnU','1035892qYGkSr','56567VYSpcx','10uwLJMb','8oCQXyM','215373QWUPMX','utf-8','5861556dXQkjL','509970HmVYds'];a13_0x32c1=function(){return _0x275450;};return a13_0x32c1();}export function getCookie(){var _0x8b5362=a13_0x48f0;try{return readFileSync(cookieFile,_0x8b5362(0xc9));}catch{}return'';}
@@ -1 +1 @@
1
- (function(_0x2a7545,_0xb42c49){const _0x13d9c1=a14_0x9584,_0x3d6292=_0x2a7545();while(!![]){try{const _0x2751da=parseInt(_0x13d9c1(0x189))/0x1+parseInt(_0x13d9c1(0x191))/0x2+-parseInt(_0x13d9c1(0x192))/0x3+-parseInt(_0x13d9c1(0x188))/0x4*(-parseInt(_0x13d9c1(0x18f))/0x5)+parseInt(_0x13d9c1(0x18b))/0x6*(-parseInt(_0x13d9c1(0x193))/0x7)+parseInt(_0x13d9c1(0x18c))/0x8+parseInt(_0x13d9c1(0x18e))/0x9*(-parseInt(_0x13d9c1(0x18d))/0xa);if(_0x2751da===_0xb42c49)break;else _0x3d6292['push'](_0x3d6292['shift']());}catch(_0x293d8a){_0x3d6292['push'](_0x3d6292['shift']());}}}(a14_0x50cd,0x474f8));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x763831=a14_0x9584;try{if(!existsSync(cookieFile))return![];const _0x5b991b=readFileSync(cookieFile,_0x763831(0x195)),_0x4e4070=await fetch(getUserDomain()+_0x763831(0x194),{'headers':{'cookie':_0x5b991b}})[_0x763831(0x18a)](_0x54342e=>_0x54342e[_0x763831(0x190)]());return _0x4e4070&&_0x4e4070[_0x763831(0x196)]&&_0x4e4070['user'];}catch{}return![];}function a14_0x9584(_0x3fe335,_0x3555fd){const _0x50cd98=a14_0x50cd();return a14_0x9584=function(_0x9584d9,_0x16b9b3){_0x9584d9=_0x9584d9-0x188;let _0x1e0e13=_0x50cd98[_0x9584d9];return _0x1e0e13;},a14_0x9584(_0x3fe335,_0x3555fd);}function a14_0x50cd(){const _0x21d741=['/api/auth/get-session','utf-8','session','1116wUDSSk','313887sxPyFo','then','168VNmdwa','1011320wzKvLA','1294330rdXGuP','9OYhbcG','3085uGsaQe','json','138494EmCykL','506757RfAozX','22813ULSrco'];a14_0x50cd=function(){return _0x21d741;};return a14_0x50cd();}
1
+ function a14_0x33cd(){const _0x31fbdd=['then','/api/auth/get-session','1226tLZXqY','user','476RaRKiK','json','session','1761910zZpLiR','167hDFwMI','7378656KJYrxg','11fUFjnk','utf-8','16FPlURJ','999198gvispJ','1145dkfHmd','36ivBnPJ','213479HxdlIg','762150zpcjcw'];a14_0x33cd=function(){return _0x31fbdd;};return a14_0x33cd();}(function(_0x1f951d,_0x2ca05c){const _0x1dfdff=a14_0x4ff8,_0x5c6d37=_0x1f951d();while(!![]){try{const _0x4a6d91=-parseInt(_0x1dfdff(0xd1))/0x1*(-parseInt(_0x1dfdff(0xcb))/0x2)+-parseInt(_0x1dfdff(0xc8))/0x3+parseInt(_0x1dfdff(0xcd))/0x4*(-parseInt(_0x1dfdff(0xc5))/0x5)+-parseInt(_0x1dfdff(0xc6))/0x6*(-parseInt(_0x1dfdff(0xc7))/0x7)+parseInt(_0x1dfdff(0xd5))/0x8*(-parseInt(_0x1dfdff(0xc4))/0x9)+parseInt(_0x1dfdff(0xd0))/0xa*(-parseInt(_0x1dfdff(0xd3))/0xb)+parseInt(_0x1dfdff(0xd2))/0xc;if(_0x4a6d91===_0x2ca05c)break;else _0x5c6d37['push'](_0x5c6d37['shift']());}catch(_0x294834){_0x5c6d37['push'](_0x5c6d37['shift']());}}}(a14_0x33cd,0x35e21));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';function a14_0x4ff8(_0x2e3933,_0x58cdc6){const _0x33cd04=a14_0x33cd();return a14_0x4ff8=function(_0x4ff8fc,_0x4315b5){_0x4ff8fc=_0x4ff8fc-0xc4;let _0x45dfb4=_0x33cd04[_0x4ff8fc];return _0x45dfb4;},a14_0x4ff8(_0x2e3933,_0x58cdc6);}import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x243bec=a14_0x4ff8;try{if(!existsSync(cookieFile))return![];const _0xd0bcc0=readFileSync(cookieFile,_0x243bec(0xd4)),_0x560e72=await fetch(getUserDomain()+_0x243bec(0xca),{'headers':{'cookie':_0xd0bcc0}})[_0x243bec(0xc9)](_0x17e754=>_0x17e754[_0x243bec(0xce)]());return _0x560e72&&_0x560e72[_0x243bec(0xcf)]&&_0x560e72[_0x243bec(0xcc)];}catch{}return![];}
@@ -1 +1 @@
1
- function a15_0x1c17(_0x557311,_0x7e0522){var _0x45b01c=a15_0x45b0();return a15_0x1c17=function(_0x1c17f3,_0x4c8421){_0x1c17f3=_0x1c17f3-0xf8;var _0x3ff18b=_0x45b01c[_0x1c17f3];return _0x3ff18b;},a15_0x1c17(_0x557311,_0x7e0522);}(function(_0x118a7b,_0x440c66){var _0x4608f5=a15_0x1c17,_0x298f96=_0x118a7b();while(!![]){try{var _0x3720fd=parseInt(_0x4608f5(0xfb))/0x1+-parseInt(_0x4608f5(0xfc))/0x2*(-parseInt(_0x4608f5(0xff))/0x3)+parseInt(_0x4608f5(0x100))/0x4*(parseInt(_0x4608f5(0xfd))/0x5)+parseInt(_0x4608f5(0xfa))/0x6*(parseInt(_0x4608f5(0x102))/0x7)+-parseInt(_0x4608f5(0x104))/0x8+parseInt(_0x4608f5(0x101))/0x9*(-parseInt(_0x4608f5(0xfe))/0xa)+-parseInt(_0x4608f5(0xf9))/0xb;if(_0x3720fd===_0x440c66)break;else _0x298f96['push'](_0x298f96['shift']());}catch(_0x52850a){_0x298f96['push'](_0x298f96['shift']());}}}(a15_0x45b0,0xcb89e));function a15_0x45b0(){var _0x5674d1=['22MNwCRt','5FxwKhd','1760KkwEMK','405639eINsVY','2047436aAhZTJ','61326kVcIov','228277TmhLVM','log','8156336mKVVuz','✓\x20已退出登录','12450438HJpIrD','258mpKQyl','782883mgaWwi'];a15_0x45b0=function(){return _0x5674d1;};return a15_0x45b0();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';export function logout(){var _0x265a4d=a15_0x1c17;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x265a4d(0x103)](_0x265a4d(0xf8))):console[_0x265a4d(0x103)]('!\x20当前未登录');}
1
+ (function(_0x1bf359,_0x454f02){var _0x3eb964=a15_0x2b3b,_0x43ead6=_0x1bf359();while(!![]){try{var _0x51e230=parseInt(_0x3eb964(0x8f))/0x1+parseInt(_0x3eb964(0x93))/0x2+parseInt(_0x3eb964(0x89))/0x3+parseInt(_0x3eb964(0x94))/0x4+-parseInt(_0x3eb964(0x8d))/0x5*(parseInt(_0x3eb964(0x91))/0x6)+parseInt(_0x3eb964(0x8a))/0x7*(-parseInt(_0x3eb964(0x90))/0x8)+parseInt(_0x3eb964(0x8e))/0x9*(-parseInt(_0x3eb964(0x92))/0xa);if(_0x51e230===_0x454f02)break;else _0x43ead6['push'](_0x43ead6['shift']());}catch(_0x310d2d){_0x43ead6['push'](_0x43ead6['shift']());}}}(a15_0xb0ec,0x92833));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';export function logout(){var _0x5cce91=a15_0x2b3b;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5cce91(0x8b)](_0x5cce91(0x8c))):console[_0x5cce91(0x8b)]('!\x20当前未登录');}function a15_0x2b3b(_0x1a6f32,_0x2ff6ea){var _0xb0ec89=a15_0xb0ec();return a15_0x2b3b=function(_0x2b3ba1,_0x301ea3){_0x2b3ba1=_0x2b3ba1-0x89;var _0x2af99d=_0xb0ec89[_0x2b3ba1];return _0x2af99d;},a15_0x2b3b(_0x1a6f32,_0x2ff6ea);}function a15_0xb0ec(){var _0x3cda3f=['log','✓\x20已退出登录','5894465wJVVFv','18klFKuK','701551isDKhQ','50672CNIuxu','6Pvefwy','1985450QVMStO','1817822ILfYun','512664lniMej','1559436PsRUib','91QIshEj'];a15_0xb0ec=function(){return _0x3cda3f;};return a15_0xb0ec();}