@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(_0x11143d,_0x334e0e){const _0x5e2daf=a35_0x1a1c,_0x4fc358=_0x11143d();while(!![]){try{const _0x48a99a=-parseInt(_0x5e2daf(0x1ee))/0x1*(parseInt(_0x5e2daf(0x204))/0x2)+parseInt(_0x5e2daf(0x1fd))/0x3*(-parseInt(_0x5e2daf(0x1ff))/0x4)+parseInt(_0x5e2daf(0x205))/0x5+parseInt(_0x5e2daf(0x202))/0x6+parseInt(_0x5e2daf(0x1f8))/0x7*(-parseInt(_0x5e2daf(0x200))/0x8)+-parseInt(_0x5e2daf(0x1f9))/0x9+parseInt(_0x5e2daf(0x1f7))/0xa;if(_0x48a99a===_0x334e0e)break;else _0x4fc358['push'](_0x4fc358['shift']());}catch(_0x1bdabc){_0x4fc358['push'](_0x4fc358['shift']());}}}(a35_0x42bc,0xa6631));function a35_0x42bc(){const _0x43c3cf=['1507340OfFAjm','3ZnrxMN','resolve','message','开始安装依赖','now','info','安装依赖','cwd','https://registry.npmmirror.com','22471930xatYho','5943777rjbflp','5108715SnkhUq','npm','--registry','install','9PMxHuS','error','205148SACnUb','8immCTs','success','374574MINksM','依赖安装失败','239308qMcEGN'];a35_0x42bc=function(){return _0x43c3cf;};return a35_0x42bc();}import a35_0x5a5133 from'node:path';import{useCallback,useState}from'react';function a35_0x1a1c(_0x1735cd,_0xf49f37){const _0x42bcbd=a35_0x42bc();return a35_0x1a1c=function(_0x1a1cd8,_0x41485e){_0x1a1cd8=_0x1a1cd8-0x1ee;let _0x2cfaab=_0x42bcbd[_0x1a1cd8];return _0x2cfaab;},a35_0x1a1c(_0x1735cd,_0xf49f37);}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x403772=a35_0x1a1c,[_0x1e0259,_0x3bd50e]=useState(![]),[_0x2cf60,_0x3b1bf7]=useState(![]),[_0x4f188c,_0x37a250]=useState(''),_0xdc061=useCallback(async _0x8effcf=>{const _0x94a57=a35_0x1a1c,_0x3a6666=Date[_0x94a57(0x1f2)](),_0x5cc1fb=a35_0x5a5133[_0x94a57(0x1ef)](process[_0x94a57(0x1f5)](),_0x8effcf);_0x3bd50e(!![]),_0x3b1bf7(![]);const _0x1d33a7=async(_0xaec872,_0x204e97)=>{await execa(_0xaec872,_0x204e97,{'cwd':_0x5cc1fb});};try{logger[_0x94a57(0x1f3)](_0x94a57(0x1fc),_0x94a57(0x1f1),{'projectCode':_0x8effcf,'registry':_0x94a57(0x1f6)}),await _0x1d33a7(_0x94a57(0x1fa),['install',_0x94a57(0x1fb),'https://registry.npmmirror.com']);const _0x52f6c5=Date[_0x94a57(0x1f2)]()-_0x3a6666;logger[_0x94a57(0x201)]('install','依赖安装完成',_0x52f6c5,{'projectCode':_0x8effcf});}catch(_0x2448ab){const _0x25f8c3=Date[_0x94a57(0x1f2)]()-_0x3a6666;logger[_0x94a57(0x1fe)]('install',_0x94a57(0x203),{'projectCode':_0x8effcf,'error':_0x2448ab instanceof Error?_0x2448ab[_0x94a57(0x1f0)]:String(_0x2448ab),'duration':_0x25f8c3});throw _0x2448ab;}finally{_0x3bd50e(![]),_0x3b1bf7(!![]),_0x37a250(formatElapsed(_0x3a6666));}},[]);return{'taskName':_0x403772(0x1f4),'finished':_0x2cf60,'loading':_0x1e0259,'elapsed':_0x4f188c,'doTask':_0xdc061};}
1
+ function a35_0x2e93(){const _0x2a5c6b=['error','293774YzpiOY','开始安装依赖','347457Okwdft','20meWikZ','安装依赖','322vYhPWV','1564szNZif','459592nlCKre','2185011efIZKO','now','835HqJzWT','1304UwJKVY','cwd','https://registry.npmmirror.com','npm','545532bZpPkA','message','依赖安装失败','info','install','依赖安装完成'];a35_0x2e93=function(){return _0x2a5c6b;};return a35_0x2e93();}(function(_0x3b2831,_0x211202){const _0x348d5b=a35_0x1871,_0x2c3c5d=_0x3b2831();while(!![]){try{const _0x4ca435=parseInt(_0x348d5b(0x1e1))/0x1+parseInt(_0x348d5b(0x1e8))/0x2+parseInt(_0x348d5b(0x1e3))/0x3+-parseInt(_0x348d5b(0x1e7))/0x4*(parseInt(_0x348d5b(0x1eb))/0x5)+parseInt(_0x348d5b(0x1da))/0x6+parseInt(_0x348d5b(0x1e6))/0x7*(-parseInt(_0x348d5b(0x1d6))/0x8)+parseInt(_0x348d5b(0x1e9))/0x9*(-parseInt(_0x348d5b(0x1e4))/0xa);if(_0x4ca435===_0x211202)break;else _0x2c3c5d['push'](_0x2c3c5d['shift']());}catch(_0x199123){_0x2c3c5d['push'](_0x2c3c5d['shift']());}}}(a35_0x2e93,0x29fb6));import a35_0x1b3a02 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a35_0x1871(_0x6f3f8d,_0x27dcfd){const _0x2e9357=a35_0x2e93();return a35_0x1871=function(_0x1871cc,_0x2147bd){_0x1871cc=_0x1871cc-0x1d6;let _0x375e96=_0x2e9357[_0x1871cc];return _0x375e96;},a35_0x1871(_0x6f3f8d,_0x27dcfd);}import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x96bd6e=a35_0x1871,[_0x22aff1,_0x1340df]=useState(![]),[_0x511589,_0x71efaf]=useState(![]),[_0x372fae,_0x11c2be]=useState(''),_0x34be75=useCallback(async _0x33e383=>{const _0x3f0500=a35_0x1871,_0x4feec3=Date[_0x3f0500(0x1ea)](),_0x2b9d99=a35_0x1b3a02['resolve'](process[_0x3f0500(0x1d7)](),_0x33e383);_0x1340df(!![]),_0x71efaf(![]);const _0x179c4e=async(_0x5b9d33,_0x59d41a)=>{await execa(_0x5b9d33,_0x59d41a,{'cwd':_0x2b9d99});};try{logger[_0x3f0500(0x1dd)](_0x3f0500(0x1de),_0x3f0500(0x1e2),{'projectCode':_0x33e383,'registry':'https://registry.npmmirror.com'}),await _0x179c4e(_0x3f0500(0x1d9),[_0x3f0500(0x1de),'--registry',_0x3f0500(0x1d8)]);const _0x3d43e3=Date[_0x3f0500(0x1ea)]()-_0x4feec3;logger['success']('install',_0x3f0500(0x1df),_0x3d43e3,{'projectCode':_0x33e383});}catch(_0x3236a8){const _0x1ed07f=Date[_0x3f0500(0x1ea)]()-_0x4feec3;logger[_0x3f0500(0x1e0)](_0x3f0500(0x1de),_0x3f0500(0x1dc),{'projectCode':_0x33e383,'error':_0x3236a8 instanceof Error?_0x3236a8[_0x3f0500(0x1db)]:String(_0x3236a8),'duration':_0x1ed07f});throw _0x3236a8;}finally{_0x1340df(![]),_0x71efaf(!![]),_0x11c2be(formatElapsed(_0x4feec3));}},[]);return{'taskName':_0x96bd6e(0x1e5),'finished':_0x511589,'loading':_0x22aff1,'elapsed':_0x372fae,'doTask':_0x34be75};}
package/lib/help.js CHANGED
@@ -1 +1 @@
1
- (function(_0x58bfe0,_0x555d5d){var _0x2c8847=a36_0x188f,_0x3f7572=_0x58bfe0();while(!![]){try{var _0x3a83e9=parseInt(_0x2c8847(0x14d))/0x1*(-parseInt(_0x2c8847(0x146))/0x2)+parseInt(_0x2c8847(0x143))/0x3+-parseInt(_0x2c8847(0x148))/0x4*(-parseInt(_0x2c8847(0x14b))/0x5)+-parseInt(_0x2c8847(0x149))/0x6+parseInt(_0x2c8847(0x14e))/0x7+-parseInt(_0x2c8847(0x142))/0x8*(-parseInt(_0x2c8847(0x14c))/0x9)+parseInt(_0x2c8847(0x145))/0xa*(-parseInt(_0x2c8847(0x141))/0xb);if(_0x3a83e9===_0x555d5d)break;else _0x3f7572['push'](_0x3f7572['shift']());}catch(_0x4b9e9e){_0x3f7572['push'](_0x3f7572['shift']());}}}(a36_0x34d0,0x21404));import{jsx as a36_0x8daa2e,jsxs as a36_0x127fbd}from'react/jsx-runtime';import{Box,Text}from'ink';function a36_0x188f(_0x55d5fb,_0x48067e){var _0x34d050=a36_0x34d0();return a36_0x188f=function(_0x188f47,_0x1a92c0){_0x188f47=_0x188f47-0x13f;var _0x117b69=_0x34d050[_0x188f47];return _0x117b69;},a36_0x188f(_0x55d5fb,_0x48067e);}function a36_0x34d0(){var _0x280801=['30lbdWev','2zaojhM','查看可用命令。','4HkdSOi','443046cmQick','lovrabet\x20--help','325285niTRwK','58887WdBncM','60529PgtpuC','1815821bNPehX','column','green','1132351Rvgzvv','184hfuwvd','313320ZdzLsS','!\x20请指定一个有效的命令。'];a36_0x34d0=function(){return _0x280801;};return a36_0x34d0();}export function Help(){var _0x123c0c=a36_0x188f;return a36_0x127fbd(Box,{'flexDirection':_0x123c0c(0x13f),'marginTop':0x1,'marginBottom':0x1,'children':[a36_0x127fbd(Box,{'children':[a36_0x8daa2e(Box,{'width':'1'}),a36_0x8daa2e(Text,{'children':_0x123c0c(0x144)})]}),a36_0x127fbd(Box,{'marginTop':0x1,'children':[a36_0x8daa2e(Box,{'width':'1'}),a36_0x127fbd(Text,{'children':['\x20\x20','使用']}),a36_0x127fbd(Text,{'bold':!![],'color':_0x123c0c(0x140),'children':['\x20',_0x123c0c(0x14a),'\x20']}),a36_0x8daa2e(Text,{'children':_0x123c0c(0x147)})]})]});}
1
+ (function(_0x469b0d,_0x1b3118){var _0x3f433a=a36_0x2595,_0x3beb69=_0x469b0d();while(!![]){try{var _0x3e25ea=-parseInt(_0x3f433a(0x199))/0x1+-parseInt(_0x3f433a(0x194))/0x2*(-parseInt(_0x3f433a(0x197))/0x3)+-parseInt(_0x3f433a(0x193))/0x4*(-parseInt(_0x3f433a(0x195))/0x5)+parseInt(_0x3f433a(0x18f))/0x6*(parseInt(_0x3f433a(0x19a))/0x7)+-parseInt(_0x3f433a(0x18d))/0x8*(-parseInt(_0x3f433a(0x198))/0x9)+-parseInt(_0x3f433a(0x192))/0xa*(parseInt(_0x3f433a(0x190))/0xb)+-parseInt(_0x3f433a(0x196))/0xc;if(_0x3e25ea===_0x1b3118)break;else _0x3beb69['push'](_0x3beb69['shift']());}catch(_0x3da4a9){_0x3beb69['push'](_0x3beb69['shift']());}}}(a36_0xfcc4,0x8043b));function a36_0xfcc4(){var _0x3fd363=['63pOCqhg','555909MFikJi','973bKentl','!\x20请指定一个有效的命令。','34792vVkHHm','green','28554sODSNo','11PIoFts','查看可用命令。','7400810wWemBF','36qWYtzg','2wHHkwl','390425TthRkY','2380392xFDFpb','1875054eiDoez'];a36_0xfcc4=function(){return _0x3fd363;};return a36_0xfcc4();}import{jsx as a36_0x40f1a3,jsxs as a36_0x30c6c3}from'react/jsx-runtime';import{Box,Text}from'ink';function a36_0x2595(_0x199c0e,_0x9fd74c){var _0xfcc44b=a36_0xfcc4();return a36_0x2595=function(_0x25953d,_0x1a611a){_0x25953d=_0x25953d-0x18c;var _0x1c66e5=_0xfcc44b[_0x25953d];return _0x1c66e5;},a36_0x2595(_0x199c0e,_0x9fd74c);}export function Help(){var _0x4f0be2=a36_0x2595;return a36_0x30c6c3(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a36_0x30c6c3(Box,{'children':[a36_0x40f1a3(Box,{'width':'1'}),a36_0x40f1a3(Text,{'children':_0x4f0be2(0x18c)})]}),a36_0x30c6c3(Box,{'marginTop':0x1,'children':[a36_0x40f1a3(Box,{'width':'1'}),a36_0x30c6c3(Text,{'children':['\x20\x20','使用']}),a36_0x30c6c3(Text,{'bold':!![],'color':_0x4f0be2(0x18e),'children':['\x20','lovrabet\x20--help','\x20']}),a36_0x40f1a3(Text,{'children':_0x4f0be2(0x191)})]})]});}
@@ -1 +1 @@
1
- const a37_0x3ecc39=a37_0x2087;(function(_0x52520c,_0x3f2ea9){const _0x58cc01=a37_0x2087,_0x19b177=_0x52520c();while(!![]){try{const _0x5d7e67=-parseInt(_0x58cc01(0x90))/0x1+-parseInt(_0x58cc01(0x91))/0x2*(-parseInt(_0x58cc01(0x97))/0x3)+parseInt(_0x58cc01(0x9a))/0x4*(-parseInt(_0x58cc01(0x9b))/0x5)+-parseInt(_0x58cc01(0x93))/0x6+parseInt(_0x58cc01(0x94))/0x7*(-parseInt(_0x58cc01(0x8f))/0x8)+parseInt(_0x58cc01(0x95))/0x9+parseInt(_0x58cc01(0x9c))/0xa*(parseInt(_0x58cc01(0x92))/0xb);if(_0x5d7e67===_0x3f2ea9)break;else _0x19b177['push'](_0x19b177['shift']());}catch(_0x331319){_0x19b177['push'](_0x19b177['shift']());}}}(a37_0x577a,0x94051));import{existsSync,readFileSync}from'node:fs';function a37_0x2087(_0x46c570,_0x353ee4){const _0x577a09=a37_0x577a();return a37_0x2087=function(_0x20870b,_0x467b97){_0x20870b=_0x20870b-0x8f;let _0x210c2d=_0x577a09[_0x20870b];return _0x210c2d;},a37_0x2087(_0x46c570,_0x353ee4);}function a37_0x577a(){const _0x4b4d84=['130552uhhcFo','919859GPjJiQ','1556VnTXWM','504009VzqSKi','4780326lsuZNn','70kgKJLk','7211547HyAmll','.lovrabetrc','3261VPcqBm','utf8','parse','1592092IHWjMP','5qLBPrD','270nDwRvC','cwd'];a37_0x577a=function(){return _0x4b4d84;};return a37_0x577a();}import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a37_0x3ecc39(0x9d)](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),a37_0x3ecc39(0x96));export function readConfig(){const _0x58fc54=a37_0x3ecc39;let _0x3eba24={};try{if(existsSync(globalConfigPath)){const _0x1f44d9=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x1f44d9&&(_0x3eba24=JSON[_0x58fc54(0x99)](_0x1f44d9));}}catch(_0x3cd0ce){}try{if(existsSync(projectConfigPath)){const _0x4946ed=readFileSync(projectConfigPath,{'encoding':_0x58fc54(0x98)});if(_0x4946ed){const _0x4cda31=JSON[_0x58fc54(0x99)](_0x4946ed);_0x3eba24={..._0x3eba24,..._0x4cda31};}}}catch(_0x3a2143){}return _0x3eba24;}export function isInProject(){return existsSync(projectConfigPath);}
1
+ const a37_0x19910e=a37_0x1bac;(function(_0x4d62c3,_0x590d9b){const _0x9876e7=a37_0x1bac,_0xed513b=_0x4d62c3();while(!![]){try{const _0xa984a2=parseInt(_0x9876e7(0x12d))/0x1*(-parseInt(_0x9876e7(0x12b))/0x2)+parseInt(_0x9876e7(0x125))/0x3+-parseInt(_0x9876e7(0x12a))/0x4*(-parseInt(_0x9876e7(0x122))/0x5)+parseInt(_0x9876e7(0x120))/0x6*(parseInt(_0x9876e7(0x124))/0x7)+parseInt(_0x9876e7(0x12c))/0x8+parseInt(_0x9876e7(0x121))/0x9*(-parseInt(_0x9876e7(0x123))/0xa)+-parseInt(_0x9876e7(0x127))/0xb*(parseInt(_0x9876e7(0x129))/0xc);if(_0xa984a2===_0x590d9b)break;else _0xed513b['push'](_0xed513b['shift']());}catch(_0x777cdf){_0xed513b['push'](_0xed513b['shift']());}}}(a37_0x1628,0xe9d6c));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a37_0x19910e(0x128)](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),'.lovrabetrc');export function readConfig(){const _0x3aeb9c=a37_0x19910e;let _0x58429b={};try{if(existsSync(globalConfigPath)){const _0x49f0d9=readFileSync(globalConfigPath,{'encoding':_0x3aeb9c(0x126)});_0x49f0d9&&(_0x58429b=JSON[_0x3aeb9c(0x12e)](_0x49f0d9));}}catch(_0x30ff3f){}try{if(existsSync(projectConfigPath)){const _0x4472c9=readFileSync(projectConfigPath,{'encoding':'utf8'});if(_0x4472c9){const _0x5ff639=JSON[_0x3aeb9c(0x12e)](_0x4472c9);_0x58429b={..._0x58429b,..._0x5ff639};}}}catch(_0x3af2f4){}return _0x58429b;}function a37_0x1bac(_0x40b7bb,_0x301a77){const _0x1628bf=a37_0x1628();return a37_0x1bac=function(_0x1baca8,_0x39716a){_0x1baca8=_0x1baca8-0x120;let _0x537303=_0x1628bf[_0x1baca8];return _0x537303;},a37_0x1bac(_0x40b7bb,_0x301a77);}export function isInProject(){return existsSync(projectConfigPath);}function a37_0x1628(){const _0x36da3f=['5yTInEI','18275410AHSSCk','458899BZwymY','1415973AAMoMc','utf8','11EtPPcx','cwd','19958916CzsuHm','5084504NTCmyv','2WUrUrV','12842864pcwfqf','79913JcOtda','parse','108WBpqHz','9cYBNSE'];a37_0x1628=function(){return _0x36da3f;};return a37_0x1628();}
@@ -1 +1 @@
1
- (function(_0x572ff2,_0x2e6a45){const _0x50e80c=a38_0x53af,_0x4c7642=_0x572ff2();while(!![]){try{const _0x2f2026=parseInt(_0x50e80c(0xbe))/0x1*(-parseInt(_0x50e80c(0xcb))/0x2)+-parseInt(_0x50e80c(0xca))/0x3+-parseInt(_0x50e80c(0xc1))/0x4*(parseInt(_0x50e80c(0xc4))/0x5)+-parseInt(_0x50e80c(0xc0))/0x6*(parseInt(_0x50e80c(0xc3))/0x7)+-parseInt(_0x50e80c(0xbd))/0x8+parseInt(_0x50e80c(0xc5))/0x9*(-parseInt(_0x50e80c(0xc9))/0xa)+-parseInt(_0x50e80c(0xc7))/0xb*(-parseInt(_0x50e80c(0xba))/0xc);if(_0x2f2026===_0x2e6a45)break;else _0x4c7642['push'](_0x4c7642['shift']());}catch(_0x1e310a){_0x4c7642['push'](_0x4c7642['shift']());}}}(a38_0x3184,0xc3df6));import a38_0x2591aa from'node:path';function a38_0x3184(){const _0x5bfd19=['mkdirSync','3834aKpost','8NjiEYx','复制目录时出错:','13097giLGUz','1042025bBhxDz','21213nZTzRn','error','58383413nPLIwy','readdirSync','2510oDBfBp','2579634rWwZPW','6NfAUjK','copyFileSync','12owBjBm','join','name','6190608xQaQsc','222533hwlZID'];a38_0x3184=function(){return _0x5bfd19;};return a38_0x3184();}function a38_0x53af(_0x4ab13b,_0x34382b){const _0x318420=a38_0x3184();return a38_0x53af=function(_0x53afe7,_0x329db9){_0x53afe7=_0x53afe7-0xba;let _0x374214=_0x318420[_0x53afe7];return _0x374214;},a38_0x53af(_0x4ab13b,_0x34382b);}import a38_0x408958 from'node:fs';export async function copyDirectory(_0x4413fa,_0x2e778e){const _0x4165e8=a38_0x53af;try{const _0x4f07b1=a38_0x408958[_0x4165e8(0xc8)](_0x4413fa,{'withFileTypes':!![]});a38_0x408958[_0x4165e8(0xbf)](_0x2e778e,{'recursive':!![]});for(const _0x5d9331 of _0x4f07b1){const _0x421742=a38_0x2591aa[_0x4165e8(0xbb)](_0x4413fa,_0x5d9331['name']),_0x29b251=a38_0x2591aa[_0x4165e8(0xbb)](_0x2e778e,_0x5d9331[_0x4165e8(0xbc)]);_0x5d9331['isDirectory']()?await copyDirectory(_0x421742,_0x29b251):a38_0x408958[_0x4165e8(0xcc)](_0x421742,_0x29b251);}}catch(_0xf4857d){console[_0x4165e8(0xc6)](_0x4165e8(0xc2),_0xf4857d);}}
1
+ (function(_0x392710,_0x574f0a){const _0x3d9529=a38_0x50f9,_0x9b53be=_0x392710();while(!![]){try{const _0x49f190=-parseInt(_0x3d9529(0xe4))/0x1+-parseInt(_0x3d9529(0xe3))/0x2+parseInt(_0x3d9529(0xe5))/0x3*(-parseInt(_0x3d9529(0xe9))/0x4)+parseInt(_0x3d9529(0xe1))/0x5*(parseInt(_0x3d9529(0xe2))/0x6)+parseInt(_0x3d9529(0xec))/0x7*(parseInt(_0x3d9529(0xe7))/0x8)+parseInt(_0x3d9529(0xe8))/0x9*(parseInt(_0x3d9529(0xdc))/0xa)+-parseInt(_0x3d9529(0xdf))/0xb*(-parseInt(_0x3d9529(0xdb))/0xc);if(_0x49f190===_0x574f0a)break;else _0x9b53be['push'](_0x9b53be['shift']());}catch(_0x5829b0){_0x9b53be['push'](_0x9b53be['shift']());}}}(a38_0x3d3b,0x47e99));import a38_0x403125 from'node:path';function a38_0x50f9(_0x33f705,_0x4c10ef){const _0x3d3bb4=a38_0x3d3b();return a38_0x50f9=function(_0x50f9af,_0xea1abe){_0x50f9af=_0x50f9af-0xdb;let _0xcf736d=_0x3d3bb4[_0x50f9af];return _0xcf736d;},a38_0x50f9(_0x33f705,_0x4c10ef);}import a38_0x1e22bc from'node:fs';export async function copyDirectory(_0x28ef1e,_0x382839){const _0x161f35=a38_0x50f9;try{const _0x27fe8b=a38_0x1e22bc[_0x161f35(0xe6)](_0x28ef1e,{'withFileTypes':!![]});a38_0x1e22bc[_0x161f35(0xe0)](_0x382839,{'recursive':!![]});for(const _0x527894 of _0x27fe8b){const _0x4f47a5=a38_0x403125[_0x161f35(0xea)](_0x28ef1e,_0x527894['name']),_0x1014d1=a38_0x403125[_0x161f35(0xea)](_0x382839,_0x527894['name']);_0x527894[_0x161f35(0xeb)]()?await copyDirectory(_0x4f47a5,_0x1014d1):a38_0x1e22bc['copyFileSync'](_0x4f47a5,_0x1014d1);}}catch(_0x44dd62){console[_0x161f35(0xde)](_0x161f35(0xdd),_0x44dd62);}}function a38_0x3d3b(){const _0x2e7ad2=['复制目录时出错:','error','19437izNius','mkdirSync','194280NIsPTX','48MuFASz','913380Znngco','423205WHchLD','25863yOcABk','readdirSync','400160RORXfV','279OMQbDo','148uQocyT','join','isDirectory','21Ozayrd','5232spSCga','84550QNjjTi'];a38_0x3d3b=function(){return _0x2e7ad2;};return a38_0x3d3b();}
@@ -1 +1 @@
1
- (function(_0x523c18,_0x405974){const _0x5c7340=a39_0x5ec1,_0x2d7b73=_0x523c18();while(!![]){try{const _0x165bab=-parseInt(_0x5c7340(0x8f))/0x1*(-parseInt(_0x5c7340(0x9a))/0x2)+parseInt(_0x5c7340(0x88))/0x3+parseInt(_0x5c7340(0x92))/0x4*(-parseInt(_0x5c7340(0x80))/0x5)+-parseInt(_0x5c7340(0x83))/0x6*(-parseInt(_0x5c7340(0x8c))/0x7)+-parseInt(_0x5c7340(0x85))/0x8*(parseInt(_0x5c7340(0x94))/0x9)+parseInt(_0x5c7340(0x99))/0xa+-parseInt(_0x5c7340(0x9b))/0xb;if(_0x165bab===_0x405974)break;else _0x2d7b73['push'](_0x2d7b73['shift']());}catch(_0x24d3d6){_0x2d7b73['push'](_0x2d7b73['shift']());}}}(a39_0x4918,0xacbf8));function a39_0x4918(){const _0xced451=['signal','1205560AbefEg','log','get','1235013LZHYwL','ENOTFOUND','text','*\x20请求失败,','1833797sHvRIN','includes','status','513179xzuUan','Request\x20failed','content-type','4tFjtwT','headers','9bIEXoR','json','statusText','ECONNRESET','message','2916540tuawia','2rbjtLY','6150243NeVOUT','AbortError','fetch','1615310XskVkY','TypeError','name','12BVryYS'];a39_0x4918=function(){return _0xced451;};return a39_0x4918();}function a39_0x5ec1(_0x787407,_0x50f8c4){const _0x4918fa=a39_0x4918();return a39_0x5ec1=function(_0x5ec1a7,_0x5bb1bd){_0x5ec1a7=_0x5ec1a7-0x7e;let _0x2c2332=_0x4918fa[_0x5ec1a7];return _0x2c2332;},a39_0x5ec1(_0x787407,_0x50f8c4);}export async function httpRequest(_0x161c00,_0x2f60e4={}){const _0x58f5d3=a39_0x5ec1,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x2f60e4;let _0x302284=null;for(let _0x6e2893=0x0;_0x6e2893<=retries;_0x6e2893++){try{const _0x12d674=new AbortController(),_0x540243=setTimeout(()=>_0x12d674['abort'](),timeout),_0x492f6f=await fetch(_0x161c00,{'headers':headers,'signal':_0x12d674[_0x58f5d3(0x84)]});clearTimeout(_0x540243);let _0x2dca86;const _0x3d81db=_0x492f6f[_0x58f5d3(0x93)][_0x58f5d3(0x87)](_0x58f5d3(0x91));return _0x3d81db?.[_0x58f5d3(0x8d)]('application/json')?_0x2dca86=await _0x492f6f[_0x58f5d3(0x95)]():_0x2dca86=await _0x492f6f[_0x58f5d3(0x8a)](),{'ok':_0x492f6f['ok'],'status':_0x492f6f[_0x58f5d3(0x8e)],'statusText':_0x492f6f[_0x58f5d3(0x96)],'data':_0x2dca86,'headers':_0x492f6f['headers'],'url':_0x492f6f['url'],'text':()=>_0x492f6f[_0x58f5d3(0x8a)]()};}catch(_0x120908){_0x302284=_0x120908 instanceof Error?_0x120908:new Error(String(_0x120908));if(_0x6e2893===retries)break;if(shouldRetry(_0x120908)){console[_0x58f5d3(0x86)](_0x58f5d3(0x8b)+retryDelay+'ms\x20后进行第\x20'+(_0x6e2893+0x1)+'\x20次重试...'),await sleep(retryDelay);continue;}else break;}}throw _0x302284||new Error(_0x58f5d3(0x90));}function shouldRetry(_0x25f34c){const _0x377314=a39_0x5ec1;if(_0x25f34c instanceof Error){if(_0x25f34c[_0x377314(0x82)]===_0x377314(0x7e))return![];if(_0x25f34c['name']===_0x377314(0x81)&&_0x25f34c[_0x377314(0x98)][_0x377314(0x8d)](_0x377314(0x7f)))return!![];if(_0x25f34c['message'][_0x377314(0x8d)](_0x377314(0x97)))return!![];if(_0x25f34c[_0x377314(0x98)][_0x377314(0x8d)](_0x377314(0x89)))return![];}return![];}function sleep(_0x4516b8){return new Promise(_0x1f4f8f=>setTimeout(_0x1f4f8f,_0x4516b8));}export function validateUrl(_0x1c6f53){try{return new URL(_0x1c6f53),!![];}catch{return![];}}
1
+ (function(_0x27b59c,_0x225cad){const _0x443d1f=a39_0x1afc,_0x41fa83=_0x27b59c();while(!![]){try{const _0x48500d=parseInt(_0x443d1f(0x1d6))/0x1*(parseInt(_0x443d1f(0x1d0))/0x2)+parseInt(_0x443d1f(0x1de))/0x3+parseInt(_0x443d1f(0x1d8))/0x4+-parseInt(_0x443d1f(0x1e5))/0x5+-parseInt(_0x443d1f(0x1d9))/0x6+parseInt(_0x443d1f(0x1ce))/0x7+-parseInt(_0x443d1f(0x1cf))/0x8;if(_0x48500d===_0x225cad)break;else _0x41fa83['push'](_0x41fa83['shift']());}catch(_0x47cbb6){_0x41fa83['push'](_0x41fa83['shift']());}}}(a39_0x4c39,0x32030));function a39_0x4c39(){const _0x162869=['ms\x20后进行第\x20','includes','Request\x20failed','name','get','message','1243985JMlDvV','454874qSeBZl','219952KkTQty','21126NqzbtF','text','url','\x20次重试...','fetch','log','35zddkSP','content-type','64868GxnBNZ','641226eAehGI','statusText','ENOTFOUND','headers','json','411318ySPzwk'];a39_0x4c39=function(){return _0x162869;};return a39_0x4c39();}export async function httpRequest(_0xcefcfb,_0x265de1={}){const _0x5f4341=a39_0x1afc,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x265de1;let _0x37f290=null;for(let _0x298456=0x0;_0x298456<=retries;_0x298456++){try{const _0x48810b=new AbortController(),_0x87630f=setTimeout(()=>_0x48810b['abort'](),timeout),_0x393252=await fetch(_0xcefcfb,{'headers':headers,'signal':_0x48810b['signal']});clearTimeout(_0x87630f);let _0x4dbb22;const _0x3cabc1=_0x393252[_0x5f4341(0x1dc)][_0x5f4341(0x1e3)](_0x5f4341(0x1d7));return _0x3cabc1?.['includes']('application/json')?_0x4dbb22=await _0x393252[_0x5f4341(0x1dd)]():_0x4dbb22=await _0x393252[_0x5f4341(0x1d1)](),{'ok':_0x393252['ok'],'status':_0x393252['status'],'statusText':_0x393252[_0x5f4341(0x1da)],'data':_0x4dbb22,'headers':_0x393252[_0x5f4341(0x1dc)],'url':_0x393252[_0x5f4341(0x1d2)],'text':()=>_0x393252['text']()};}catch(_0x32449e){_0x37f290=_0x32449e instanceof Error?_0x32449e:new Error(String(_0x32449e));if(_0x298456===retries)break;if(shouldRetry(_0x32449e)){console[_0x5f4341(0x1d5)]('*\x20请求失败,'+retryDelay+_0x5f4341(0x1df)+(_0x298456+0x1)+_0x5f4341(0x1d3)),await sleep(retryDelay);continue;}else break;}}throw _0x37f290||new Error(_0x5f4341(0x1e1));}function a39_0x1afc(_0xc6008c,_0x45ded6){const _0x4c39be=a39_0x4c39();return a39_0x1afc=function(_0x1afc69,_0x3d6064){_0x1afc69=_0x1afc69-0x1ce;let _0x20e20f=_0x4c39be[_0x1afc69];return _0x20e20f;},a39_0x1afc(_0xc6008c,_0x45ded6);}function shouldRetry(_0x12e28e){const _0x4faed7=a39_0x1afc;if(_0x12e28e instanceof Error){if(_0x12e28e[_0x4faed7(0x1e2)]==='AbortError')return![];if(_0x12e28e[_0x4faed7(0x1e2)]==='TypeError'&&_0x12e28e[_0x4faed7(0x1e4)][_0x4faed7(0x1e0)](_0x4faed7(0x1d4)))return!![];if(_0x12e28e['message'][_0x4faed7(0x1e0)]('ECONNRESET'))return!![];if(_0x12e28e[_0x4faed7(0x1e4)][_0x4faed7(0x1e0)](_0x4faed7(0x1db)))return![];}return![];}function sleep(_0x55f200){return new Promise(_0x369299=>setTimeout(_0x369299,_0x55f200));}export function validateUrl(_0x32eaa0){try{return new URL(_0x32eaa0),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a40_0x3b978a=a40_0x38c0;(function(_0x1d1044,_0x3614af){const _0x3cd2bb=a40_0x38c0,_0xee15aa=_0x1d1044();while(!![]){try{const _0x1b38d9=parseInt(_0x3cd2bb(0x1f3))/0x1+parseInt(_0x3cd2bb(0x205))/0x2*(parseInt(_0x3cd2bb(0x1e9))/0x3)+-parseInt(_0x3cd2bb(0x1f1))/0x4*(parseInt(_0x3cd2bb(0x1ef))/0x5)+-parseInt(_0x3cd2bb(0x1dc))/0x6*(parseInt(_0x3cd2bb(0x1e8))/0x7)+parseInt(_0x3cd2bb(0x1fe))/0x8+parseInt(_0x3cd2bb(0x1df))/0x9+parseInt(_0x3cd2bb(0x208))/0xa*(-parseInt(_0x3cd2bb(0x1ec))/0xb);if(_0x1b38d9===_0x3614af)break;else _0xee15aa['push'](_0xee15aa['shift']());}catch(_0x3d46d1){_0xee15aa['push'](_0xee15aa['shift']());}}}(a40_0xdad8,0xd0436));import a40_0x3eeac6 from'winston';import a40_0x23a1a4 from'node:fs';function a40_0xdad8(){const _0x240a46=['713474ozoNPQ','stringify','readFileSync','14510NxXcbA','error','dirname','.lovrabet.log','unknown','initWinstonLogger','File','green','getWinstonInstance','174nLVHJm','existsSync','warn','154899HSRcPE','red','timestamp','command','writeFileSync','Failed\x20to\x20clear\x20logs:','开始执行:\x20','map','duration','8617xuspRj','9RroTQL','level','winstonLogger','21439xlBGPn','now','Failed\x20to\x20read\x20logs:','5150wuOYlu','logFilePath','1348tfuENC','trim','1336909njIZDC','format','combine','log','toISOString','parse','info','logTask','details','yellow','printf','13116184cwfzXu','clear','addColors','message','utf8','transports','success'];a40_0xdad8=function(){return _0x240a46;};return a40_0xdad8();}function a40_0x38c0(_0x327462,_0x4042fe){const _0xdad841=a40_0xdad8();return a40_0x38c0=function(_0x38c0da,_0x576c07){_0x38c0da=_0x38c0da-0x1db;let _0x483db0=_0xdad841[_0x38c0da];return _0x483db0;},a40_0x38c0(_0x327462,_0x4042fe);}import a40_0x2d51fa from'node:path';class Logger{[a40_0x3b978a(0x1eb)];[a40_0x3b978a(0x1f0)];constructor(){const _0x25a23e=a40_0x3b978a;this[_0x25a23e(0x1f0)]='';}[a40_0x3b978a(0x20d)](){const _0x4fb63d=a40_0x3b978a,_0x35f2a1=a40_0x2d51fa[_0x4fb63d(0x20a)](this[_0x4fb63d(0x1f0)]);!a40_0x23a1a4[_0x4fb63d(0x1dd)](_0x35f2a1)&&a40_0x23a1a4['mkdirSync'](_0x35f2a1,{'recursive':!![]});const _0x50d874=a40_0x3eeac6[_0x4fb63d(0x1f4)][_0x4fb63d(0x1f5)](a40_0x3eeac6[_0x4fb63d(0x1f4)][_0x4fb63d(0x1e1)](),a40_0x3eeac6[_0x4fb63d(0x1f4)]['errors']({'stack':!![]}),a40_0x3eeac6[_0x4fb63d(0x1f4)][_0x4fb63d(0x1fd)](_0x33e78d=>{const _0xe142d8=_0x4fb63d,_0x1015fe={'timestamp':_0x33e78d['timestamp']||new Date()[_0xe142d8(0x1f7)](),'level':_0x33e78d[_0xe142d8(0x1ea)]||_0xe142d8(0x1f9),'command':_0x33e78d[_0xe142d8(0x1e2)]||_0xe142d8(0x20c),'message':_0x33e78d[_0xe142d8(0x201)]||'','duration':_0x33e78d[_0xe142d8(0x1e7)]||undefined,'details':_0x33e78d[_0xe142d8(0x1fb)]||undefined};return JSON[_0xe142d8(0x206)](_0x1015fe);}));this[_0x4fb63d(0x1eb)]=a40_0x3eeac6['createLogger']({'level':_0x4fb63d(0x1f9),'format':_0x50d874,'transports':[new a40_0x3eeac6[(_0x4fb63d(0x203))][(_0x4fb63d(0x20e))]({'filename':this[_0x4fb63d(0x1f0)],'level':_0x4fb63d(0x1f9)})],'silent':![]}),a40_0x3eeac6[_0x4fb63d(0x200)]({'success':_0x4fb63d(0x20f),'error':_0x4fb63d(0x1e0),'warn':_0x4fb63d(0x1fc),'info':'blue'});}['setLogPath'](_0x6625b2){const _0x14052d=a40_0x3b978a;this['logFilePath']=a40_0x2d51fa['join'](_0x6625b2,_0x14052d(0x20b)),this[_0x14052d(0x1eb)]&&this[_0x14052d(0x1eb)][_0x14052d(0x1ff)](),this[_0x14052d(0x20d)]();}['info'](_0x4be2ed,_0x51c827,_0x339435){const _0x5aebe0=a40_0x3b978a;if(!this[_0x5aebe0(0x1f0)]||!this[_0x5aebe0(0x1eb)])return;this[_0x5aebe0(0x1eb)][_0x5aebe0(0x1f9)](_0x51c827,{'command':_0x4be2ed,'details':_0x339435});}[a40_0x3b978a(0x204)](_0xfad895,_0x4fa848,_0x2c8199,_0x2eff7a){const _0x35924f=a40_0x3b978a;if(!this[_0x35924f(0x1f0)]||!this[_0x35924f(0x1eb)])return;this[_0x35924f(0x1eb)][_0x35924f(0x1f6)]('info',_0x4fa848,{'level':'success','command':_0xfad895,'duration':_0x2c8199,'details':_0x2eff7a});}[a40_0x3b978a(0x209)](_0x3def66,_0x51e3d6,_0x1cdfd9){const _0x23d2e3=a40_0x3b978a;if(!this[_0x23d2e3(0x1f0)]||!this[_0x23d2e3(0x1eb)])return;this[_0x23d2e3(0x1eb)]['error'](_0x51e3d6,{'command':_0x3def66,'details':_0x1cdfd9});}[a40_0x3b978a(0x1de)](_0x1d93f6,_0xd759b9,_0x327d6b){const _0x5a091b=a40_0x3b978a;if(!this[_0x5a091b(0x1f0)]||!this[_0x5a091b(0x1eb)])return;this['winstonLogger'][_0x5a091b(0x1de)](_0xd759b9,{'command':_0x1d93f6,'details':_0x327d6b});}async[a40_0x3b978a(0x1fa)](_0x37a6ef,_0x3c3ea7,_0x26739a){const _0x51f5ee=a40_0x3b978a,_0x47670a=Date['now']();this[_0x51f5ee(0x1f9)](_0x37a6ef,_0x51f5ee(0x1e5)+_0x3c3ea7);try{const _0x577028=await _0x26739a(),_0x3a537a=Date[_0x51f5ee(0x1ed)]()-_0x47670a;return this[_0x51f5ee(0x204)](_0x37a6ef,'完成:\x20'+_0x3c3ea7,_0x3a537a),_0x577028;}catch(_0x59dd49){const _0x6a91ae=Date['now']()-_0x47670a;this[_0x51f5ee(0x209)](_0x37a6ef,'失败:\x20'+_0x3c3ea7,{'error':_0x59dd49 instanceof Error?_0x59dd49[_0x51f5ee(0x201)]:String(_0x59dd49),'duration':_0x6a91ae});throw _0x59dd49;}}['readLogs'](){const _0x347e09=a40_0x3b978a;try{if(!a40_0x23a1a4[_0x347e09(0x1dd)](this['logFilePath']))return[];const _0x18d8e0=a40_0x23a1a4[_0x347e09(0x207)](this[_0x347e09(0x1f0)],_0x347e09(0x202));return _0x18d8e0['split']('\x0a')['filter'](_0x1c72aa=>_0x1c72aa[_0x347e09(0x1f2)]())[_0x347e09(0x1e6)](_0x3c7ba9=>JSON[_0x347e09(0x1f8)](_0x3c7ba9));}catch(_0x4cf216){return console[_0x347e09(0x1de)](_0x347e09(0x1ee),_0x4cf216),[];}}['clearLogs'](){const _0x3ccaf2=a40_0x3b978a;try{a40_0x23a1a4[_0x3ccaf2(0x1dd)](this[_0x3ccaf2(0x1f0)])&&a40_0x23a1a4[_0x3ccaf2(0x1e3)](this[_0x3ccaf2(0x1f0)],'','utf8');}catch(_0x22029e){console['warn'](_0x3ccaf2(0x1e4),_0x22029e);}}[a40_0x3b978a(0x1db)](){const _0x4edc39=a40_0x3b978a;return this[_0x4edc39(0x1eb)];}}export const logger=new Logger();
1
+ const a40_0x175f4f=a40_0x3596;(function(_0x5ddb22,_0x5e1524){const _0x56b714=a40_0x3596,_0x4c1c72=_0x5ddb22();while(!![]){try{const _0x5c52a4=parseInt(_0x56b714(0x8f))/0x1*(parseInt(_0x56b714(0x8c))/0x2)+-parseInt(_0x56b714(0x8d))/0x3+-parseInt(_0x56b714(0xaf))/0x4+-parseInt(_0x56b714(0x96))/0x5*(-parseInt(_0x56b714(0xa5))/0x6)+parseInt(_0x56b714(0xab))/0x7*(-parseInt(_0x56b714(0xb0))/0x8)+-parseInt(_0x56b714(0xb2))/0x9*(parseInt(_0x56b714(0x95))/0xa)+parseInt(_0x56b714(0x9b))/0xb*(parseInt(_0x56b714(0xb6))/0xc);if(_0x5c52a4===_0x5e1524)break;else _0x4c1c72['push'](_0x4c1c72['shift']());}catch(_0x522cbb){_0x4c1c72['push'](_0x4c1c72['shift']());}}}(a40_0x1cfd,0x8dafe));function a40_0x1cfd(){const _0xf173b1=['log','command','split','readLogs','11nNFqGf','duration','red','map','combine','winstonLogger','initWinstonLogger','transports','clearLogs','join','4520274azBpAb','filter','green','writeFileSync','error','clear','349496BojKEZ','format','info','timestamp','236184KELYMo','64JEdtpr','dirname','18xCIEGZ','utf8','logFilePath','yellow','1175316blJRTZ','.lovrabet.log','unknown','Failed\x20to\x20clear\x20logs:','setLogPath','printf','now','existsSync','success','warn','message','774AjBWsv','928773nflZwZ','details','2079qUkBxD','Failed\x20to\x20read\x20logs:','createLogger','stringify','File','getWinstonInstance','1537420XIkLLJ','5wjNGRm'];a40_0x1cfd=function(){return _0xf173b1;};return a40_0x1cfd();}function a40_0x3596(_0xfa0f01,_0x101080){const _0x1cfd1a=a40_0x1cfd();return a40_0x3596=function(_0x3596d0,_0x1341fd){_0x3596d0=_0x3596d0-0x87;let _0x55b01e=_0x1cfd1a[_0x3596d0];return _0x55b01e;},a40_0x3596(_0xfa0f01,_0x101080);}import a40_0x9e10cd from'winston';import a40_0x528f20 from'node:fs';import a40_0x2806c9 from'node:path';class Logger{[a40_0x175f4f(0xa0)];['logFilePath'];constructor(){const _0x345fa5=a40_0x175f4f;this[_0x345fa5(0xb4)]='';}[a40_0x175f4f(0xa1)](){const _0x39031a=a40_0x175f4f,_0x468b15=a40_0x2806c9[_0x39031a(0xb1)](this[_0x39031a(0xb4)]);!a40_0x528f20[_0x39031a(0x88)](_0x468b15)&&a40_0x528f20['mkdirSync'](_0x468b15,{'recursive':!![]});const _0x4a37e9=a40_0x9e10cd['format'][_0x39031a(0x9f)](a40_0x9e10cd[_0x39031a(0xac)]['timestamp'](),a40_0x9e10cd[_0x39031a(0xac)]['errors']({'stack':!![]}),a40_0x9e10cd[_0x39031a(0xac)][_0x39031a(0xbb)](_0x2fc6a0=>{const _0x28b9cd=_0x39031a,_0x3ba415={'timestamp':_0x2fc6a0[_0x28b9cd(0xae)]||new Date()['toISOString'](),'level':_0x2fc6a0['level']||'info','command':_0x2fc6a0[_0x28b9cd(0x98)]||_0x28b9cd(0xb8),'message':_0x2fc6a0[_0x28b9cd(0x8b)]||'','duration':_0x2fc6a0[_0x28b9cd(0x9c)]||undefined,'details':_0x2fc6a0[_0x28b9cd(0x8e)]||undefined};return JSON[_0x28b9cd(0x92)](_0x3ba415);}));this[_0x39031a(0xa0)]=a40_0x9e10cd[_0x39031a(0x91)]({'level':_0x39031a(0xad),'format':_0x4a37e9,'transports':[new a40_0x9e10cd[(_0x39031a(0xa2))][(_0x39031a(0x93))]({'filename':this['logFilePath'],'level':_0x39031a(0xad)})],'silent':![]}),a40_0x9e10cd['addColors']({'success':_0x39031a(0xa7),'error':_0x39031a(0x9d),'warn':_0x39031a(0xb5),'info':'blue'});}[a40_0x175f4f(0xba)](_0x2a3fc4){const _0x1e3d03=a40_0x175f4f;this[_0x1e3d03(0xb4)]=a40_0x2806c9[_0x1e3d03(0xa4)](_0x2a3fc4,_0x1e3d03(0xb7)),this[_0x1e3d03(0xa0)]&&this[_0x1e3d03(0xa0)][_0x1e3d03(0xaa)](),this[_0x1e3d03(0xa1)]();}['info'](_0x2bb433,_0x110591,_0x20f5ff){const _0x54b251=a40_0x175f4f;if(!this['logFilePath']||!this[_0x54b251(0xa0)])return;this[_0x54b251(0xa0)][_0x54b251(0xad)](_0x110591,{'command':_0x2bb433,'details':_0x20f5ff});}[a40_0x175f4f(0x89)](_0x5de38c,_0x761e9a,_0x39004c,_0x4ddc8f){const _0x1550dd=a40_0x175f4f;if(!this[_0x1550dd(0xb4)]||!this['winstonLogger'])return;this[_0x1550dd(0xa0)][_0x1550dd(0x97)](_0x1550dd(0xad),_0x761e9a,{'level':'success','command':_0x5de38c,'duration':_0x39004c,'details':_0x4ddc8f});}[a40_0x175f4f(0xa9)](_0x27992f,_0x84b15a,_0x4cc1a2){const _0x1b629b=a40_0x175f4f;if(!this[_0x1b629b(0xb4)]||!this[_0x1b629b(0xa0)])return;this[_0x1b629b(0xa0)]['error'](_0x84b15a,{'command':_0x27992f,'details':_0x4cc1a2});}['warn'](_0x49e8fa,_0x414bca,_0x5a94a5){const _0x472e9f=a40_0x175f4f;if(!this[_0x472e9f(0xb4)]||!this[_0x472e9f(0xa0)])return;this[_0x472e9f(0xa0)][_0x472e9f(0x8a)](_0x414bca,{'command':_0x49e8fa,'details':_0x5a94a5});}async['logTask'](_0x2f72fd,_0x302f49,_0x1d1679){const _0x41c0f5=a40_0x175f4f,_0x39f937=Date['now']();this[_0x41c0f5(0xad)](_0x2f72fd,'开始执行:\x20'+_0x302f49);try{const _0x20367a=await _0x1d1679(),_0x6793fd=Date['now']()-_0x39f937;return this[_0x41c0f5(0x89)](_0x2f72fd,'完成:\x20'+_0x302f49,_0x6793fd),_0x20367a;}catch(_0x385b33){const _0x1ac685=Date[_0x41c0f5(0x87)]()-_0x39f937;this[_0x41c0f5(0xa9)](_0x2f72fd,'失败:\x20'+_0x302f49,{'error':_0x385b33 instanceof Error?_0x385b33[_0x41c0f5(0x8b)]:String(_0x385b33),'duration':_0x1ac685});throw _0x385b33;}}[a40_0x175f4f(0x9a)](){const _0x42e904=a40_0x175f4f;try{if(!a40_0x528f20[_0x42e904(0x88)](this[_0x42e904(0xb4)]))return[];const _0x137be0=a40_0x528f20['readFileSync'](this[_0x42e904(0xb4)],_0x42e904(0xb3));return _0x137be0[_0x42e904(0x99)]('\x0a')[_0x42e904(0xa6)](_0x5cb8ac=>_0x5cb8ac['trim']())[_0x42e904(0x9e)](_0x2109c1=>JSON['parse'](_0x2109c1));}catch(_0x513f9f){return console[_0x42e904(0x8a)](_0x42e904(0x90),_0x513f9f),[];}}[a40_0x175f4f(0xa3)](){const _0x23446c=a40_0x175f4f;try{a40_0x528f20[_0x23446c(0x88)](this[_0x23446c(0xb4)])&&a40_0x528f20[_0x23446c(0xa8)](this[_0x23446c(0xb4)],'',_0x23446c(0xb3));}catch(_0x35d810){console[_0x23446c(0x8a)](_0x23446c(0xb9),_0x35d810);}}[a40_0x175f4f(0x94)](){return this['winstonLogger'];}}export const logger=new Logger();
@@ -1 +1 @@
1
- const a41_0x6037ed=a41_0x482e;function a41_0x5d40(){const _0x1b9cbf=['\x20from\x20\x22../pages/','charAt','map','531486GUPgio','writeFile','now','toComponentName','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','addPageRoute','6aMRiWT','2144165GhDsmR','path:\x20\x22','2209536bfuyEE','includes','toUpperCase','addImport','slice','index','src','success','readFile','existsSync','56248vjLqRl','1719oGBkPR','868538knjHXM','router','未找到路由配置的\x20children\x20数组','previewChanges','length','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','开始更新路由配置','info','message','match','路由文件不存在:\x20','lastIndexOf','utf8','indexOf','1944735QNplqZ','路由配置更新失败','routerFilePath','路由配置更新完成','join','promises','index.tsx','addRoute','242308JVdQdX','toLowerCase'];a41_0x5d40=function(){return _0x1b9cbf;};return a41_0x5d40();}(function(_0x1a607c,_0x2511ee){const _0x378993=a41_0x482e,_0x10bb4d=_0x1a607c();while(!![]){try{const _0x26b403=parseInt(_0x378993(0x10a))/0x1+-parseInt(_0x378993(0xf5))/0x2+-parseInt(_0x378993(0xe8))/0x3+-parseInt(_0x378993(0xf0))/0x4+-parseInt(_0x378993(0xfc))/0x5*(parseInt(_0x378993(0xfb))/0x6)+-parseInt(_0x378993(0xfe))/0x7+-parseInt(_0x378993(0x108))/0x8*(-parseInt(_0x378993(0x109))/0x9);if(_0x26b403===_0x2511ee)break;else _0x10bb4d['push'](_0x10bb4d['shift']());}catch(_0x3c2afc){_0x10bb4d['push'](_0x10bb4d['shift']());}}}(a41_0x5d40,0x7837d));function a41_0x482e(_0xd528ce,_0x226d5a){const _0x5d402b=a41_0x5d40();return a41_0x482e=function(_0x482ec9,_0x2bcbe8){_0x482ec9=_0x482ec9-0xe0;let _0x530a18=_0x5d402b[_0x482ec9];return _0x530a18;},a41_0x482e(_0xd528ce,_0x226d5a);}import a41_0x5973f1 from'node:fs';import a41_0x2835fd from'node:path';import{logger}from'./logger.js';export class RouterUpdater{['routerFilePath'];constructor(_0x478503){const _0xe454f8=a41_0x482e;this['routerFilePath']=a41_0x2835fd[_0xe454f8(0xec)](_0x478503,_0xe454f8(0x104),_0xe454f8(0x10b),_0xe454f8(0xee));}async[a41_0x6037ed(0xfa)](_0x38b7aa,_0xde9671){const _0x33e550=a41_0x6037ed;if(!a41_0x5973f1[_0x33e550(0x107)](this[_0x33e550(0xea)]))throw new Error(_0x33e550(0xe4)+this['routerFilePath']);const _0x5cbf2d=Date[_0x33e550(0xf7)]();logger[_0x33e550(0xe1)](_0x33e550(0x10b),_0x33e550(0xe0),{'pageName':_0x38b7aa,'routePath':_0xde9671,'file':this[_0x33e550(0xea)]});try{const _0x44e5b9=await a41_0x5973f1['promises'][_0x33e550(0x106)](this['routerFilePath'],_0x33e550(0xe6)),_0x486c24=this[_0x33e550(0xf8)](_0x38b7aa),_0x3f5e64=this['addImport'](_0x44e5b9,_0x486c24,_0x38b7aa),_0x295f6a=this[_0x33e550(0xef)](_0x3f5e64,_0xde9671,_0x486c24);await a41_0x5973f1[_0x33e550(0xed)][_0x33e550(0xf6)](this['routerFilePath'],_0x295f6a,'utf8');const _0x5a3cd0=Date[_0x33e550(0xf7)]()-_0x5cbf2d;logger[_0x33e550(0x105)](_0x33e550(0x10b),_0x33e550(0xeb),_0x5a3cd0,{'pageName':_0x38b7aa,'routePath':_0xde9671,'componentName':_0x486c24});}catch(_0x2d0e92){const _0x1c04e8=Date[_0x33e550(0xf7)]()-_0x5cbf2d;logger['error'](_0x33e550(0x10b),_0x33e550(0xe9),{'pageName':_0x38b7aa,'routePath':_0xde9671,'error':_0x2d0e92 instanceof Error?_0x2d0e92[_0x33e550(0xe2)]:String(_0x2d0e92),'duration':_0x1c04e8});throw _0x2d0e92;}}[a41_0x6037ed(0xf8)](_0x5bd7ff){const _0x3cd084=a41_0x6037ed;return _0x5bd7ff['split']('-')[_0x3cd084(0xf4)](_0xe8636c=>_0xe8636c[_0x3cd084(0xf3)](0x0)[_0x3cd084(0x100)]()+_0xe8636c['slice'](0x1)[_0x3cd084(0xf1)]())[_0x3cd084(0xec)]('');}[a41_0x6037ed(0x101)](_0x12bbd5,_0x4b7e0c,_0x54b471){const _0x74ff0b=a41_0x6037ed,_0x2dbbbb=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x28c657=_0x12bbd5[_0x74ff0b(0xe3)](_0x2dbbbb)||[],_0x14e97f='import\x20'+_0x4b7e0c+_0x74ff0b(0xf2)+_0x54b471+'\x22;';if(_0x12bbd5[_0x74ff0b(0xff)](_0x14e97f))return _0x12bbd5;if(_0x28c657[_0x74ff0b(0x10e)]>0x0){const _0x7a9f2d=_0x28c657[_0x28c657['length']-0x1];if(_0x7a9f2d){const _0x221640=_0x12bbd5[_0x74ff0b(0xe5)](_0x7a9f2d),_0x1687a5=_0x221640+_0x7a9f2d['length'];return _0x12bbd5[_0x74ff0b(0x102)](0x0,_0x1687a5)+_0x14e97f+'\x0a'+_0x12bbd5[_0x74ff0b(0x102)](_0x1687a5);}}const _0x2b5073=_0x12bbd5[_0x74ff0b(0xe3)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x2b5073&&_0x2b5073[_0x74ff0b(0x103)]!==undefined){const _0x392aad=_0x2b5073['index']+_0x2b5073[0x0][_0x74ff0b(0x10e)];return _0x12bbd5[_0x74ff0b(0x102)](0x0,_0x392aad)+_0x14e97f+'\x0a'+_0x12bbd5[_0x74ff0b(0x102)](_0x392aad);}return _0x12bbd5;}[a41_0x6037ed(0xef)](_0x316974,_0x35397b,_0x2a6cf9){const _0x494327=a41_0x6037ed,_0x34a9d3='\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'+_0x35397b+_0x494327(0x10f)+_0x2a6cf9+_0x494327(0xf9);if(_0x316974[_0x494327(0xff)](_0x494327(0xfd)+_0x35397b+'\x22'))return _0x316974;const _0x5b74d9=/children:\s*\[([\s\S]*?)\]/,_0x4da162=_0x316974['match'](_0x5b74d9);if(!_0x4da162||_0x4da162[_0x494327(0x103)]===undefined)throw new Error(_0x494327(0x10c));const _0x465d56=_0x4da162[0x1],_0xdb947=_0x4da162[_0x494327(0x103)]+_0x4da162[0x0][_0x494327(0xe7)]('[')+0x1,_0x32282a=_0x465d56?.[_0x494327(0xe3)](/\{[\s\S]*?\},/g)||[];if(_0x32282a['length']>0x0){const _0x12eab8=_0x32282a[_0x32282a[_0x494327(0x10e)]-0x1];if(_0x12eab8){const _0x203f6b=_0x316974[_0x494327(0xe5)](_0x12eab8),_0x5bdeab=_0x203f6b+_0x12eab8[_0x494327(0x10e)];return _0x316974[_0x494327(0x102)](0x0,_0x5bdeab)+'\x0a'+_0x34a9d3+_0x316974['slice'](_0x5bdeab);}}return _0x316974[_0x494327(0x102)](0x0,_0xdb947)+'\x0a'+_0x34a9d3+_0x316974['slice'](_0xdb947);}async[a41_0x6037ed(0x10d)](_0x508090,_0x568585){const _0x115bb3=a41_0x6037ed;if(!a41_0x5973f1[_0x115bb3(0x107)](this['routerFilePath']))throw new Error(_0x115bb3(0xe4)+this['routerFilePath']);const _0x52d707=await a41_0x5973f1[_0x115bb3(0xed)][_0x115bb3(0x106)](this['routerFilePath'],_0x115bb3(0xe6)),_0x2533f0=this['toComponentName'](_0x508090);let _0x28c385=this[_0x115bb3(0x101)](_0x52d707,_0x2533f0,_0x508090);return _0x28c385=this[_0x115bb3(0xef)](_0x28c385,_0x568585,_0x2533f0),_0x28c385;}}
1
+ const a41_0x56a5b7=a41_0x225f;(function(_0xa43623,_0x34a050){const _0x5d92b5=a41_0x225f,_0x1974e8=_0xa43623();while(!![]){try{const _0x29d36f=parseInt(_0x5d92b5(0x1b0))/0x1*(-parseInt(_0x5d92b5(0x18e))/0x2)+parseInt(_0x5d92b5(0x191))/0x3*(-parseInt(_0x5d92b5(0x18b))/0x4)+-parseInt(_0x5d92b5(0x197))/0x5+parseInt(_0x5d92b5(0x196))/0x6+-parseInt(_0x5d92b5(0x19d))/0x7*(-parseInt(_0x5d92b5(0x18d))/0x8)+-parseInt(_0x5d92b5(0x189))/0x9+parseInt(_0x5d92b5(0x185))/0xa;if(_0x29d36f===_0x34a050)break;else _0x1974e8['push'](_0x1974e8['shift']());}catch(_0x2e20ad){_0x1974e8['push'](_0x1974e8['shift']());}}}(a41_0x2ae2,0xe2b6b));import a41_0x3fb513 from'node:fs';import a41_0x4dbb1d from'node:path';function a41_0x225f(_0x19f927,_0x313ab3){const _0x2ae203=a41_0x2ae2();return a41_0x225f=function(_0x225f0c,_0x1d9ffc){_0x225f0c=_0x225f0c-0x184;let _0x34f19c=_0x2ae203[_0x225f0c];return _0x34f19c;},a41_0x225f(_0x19f927,_0x313ab3);}import{logger}from'./logger.js';function a41_0x2ae2(){const _0x5f1199=['766132cSAmOh','index.tsx','now','24PybJLs','charAt','includes','toComponentName','路由配置更新失败','8670228MdxcoT','9030815KHdteu','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','writeFile','slice','length','addPageRoute','53179sqtrGE','match','src','previewChanges','path:\x20\x22','map','readFile','utf8','error','开始更新路由配置','addRoute','info','import\x20','router','addImport','\x20from\x20\x22../pages/','existsSync','promises','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','3cnpJlL','toLowerCase','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','35416750XUdtVp','join','路由文件不存在:\x20','toUpperCase','4864059YCGkck','index','729364GiXFnh','routerFilePath','944EWjsKE'];a41_0x2ae2=function(){return _0x5f1199;};return a41_0x2ae2();}export class RouterUpdater{[a41_0x56a5b7(0x18c)];constructor(_0x5c1ee7){const _0x5c56cc=a41_0x56a5b7;this[_0x5c56cc(0x18c)]=a41_0x4dbb1d[_0x5c56cc(0x186)](_0x5c1ee7,_0x5c56cc(0x19f),_0x5c56cc(0x1aa),_0x5c56cc(0x18f));}async[a41_0x56a5b7(0x19c)](_0x3f7ef7,_0x471f22){const _0x3c5459=a41_0x56a5b7;if(!a41_0x3fb513['existsSync'](this[_0x3c5459(0x18c)]))throw new Error(_0x3c5459(0x187)+this['routerFilePath']);const _0x19189b=Date[_0x3c5459(0x190)]();logger[_0x3c5459(0x1a8)](_0x3c5459(0x1aa),_0x3c5459(0x1a6),{'pageName':_0x3f7ef7,'routePath':_0x471f22,'file':this[_0x3c5459(0x18c)]});try{const _0x20a0c3=await a41_0x3fb513[_0x3c5459(0x1ae)][_0x3c5459(0x1a3)](this[_0x3c5459(0x18c)],_0x3c5459(0x1a4)),_0x11d4e5=this[_0x3c5459(0x194)](_0x3f7ef7),_0x50f9c8=this[_0x3c5459(0x1ab)](_0x20a0c3,_0x11d4e5,_0x3f7ef7),_0x355229=this[_0x3c5459(0x1a7)](_0x50f9c8,_0x471f22,_0x11d4e5);await a41_0x3fb513[_0x3c5459(0x1ae)][_0x3c5459(0x199)](this[_0x3c5459(0x18c)],_0x355229,_0x3c5459(0x1a4));const _0x42d84f=Date[_0x3c5459(0x190)]()-_0x19189b;logger['success'](_0x3c5459(0x1aa),'路由配置更新完成',_0x42d84f,{'pageName':_0x3f7ef7,'routePath':_0x471f22,'componentName':_0x11d4e5});}catch(_0x59fc0d){const _0x1922c4=Date[_0x3c5459(0x190)]()-_0x19189b;logger[_0x3c5459(0x1a5)](_0x3c5459(0x1aa),_0x3c5459(0x195),{'pageName':_0x3f7ef7,'routePath':_0x471f22,'error':_0x59fc0d instanceof Error?_0x59fc0d['message']:String(_0x59fc0d),'duration':_0x1922c4});throw _0x59fc0d;}}['toComponentName'](_0x3308f1){const _0x395205=a41_0x56a5b7;return _0x3308f1['split']('-')[_0x395205(0x1a2)](_0xcc35da=>_0xcc35da[_0x395205(0x192)](0x0)[_0x395205(0x188)]()+_0xcc35da[_0x395205(0x19a)](0x1)[_0x395205(0x1b1)]())[_0x395205(0x186)]('');}[a41_0x56a5b7(0x1ab)](_0x4d5a56,_0x4bfa5d,_0x5d6233){const _0x26a06f=a41_0x56a5b7,_0x2cfc2d=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x5f17ce=_0x4d5a56[_0x26a06f(0x19e)](_0x2cfc2d)||[],_0x200c3f=_0x26a06f(0x1a9)+_0x4bfa5d+_0x26a06f(0x1ac)+_0x5d6233+'\x22;';if(_0x4d5a56[_0x26a06f(0x193)](_0x200c3f))return _0x4d5a56;if(_0x5f17ce[_0x26a06f(0x19b)]>0x0){const _0x226bf5=_0x5f17ce[_0x5f17ce[_0x26a06f(0x19b)]-0x1];if(_0x226bf5){const _0x1903fe=_0x4d5a56['lastIndexOf'](_0x226bf5),_0x4151d8=_0x1903fe+_0x226bf5['length'];return _0x4d5a56[_0x26a06f(0x19a)](0x0,_0x4151d8)+_0x200c3f+'\x0a'+_0x4d5a56[_0x26a06f(0x19a)](_0x4151d8);}}const _0x249dcb=_0x4d5a56[_0x26a06f(0x19e)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x249dcb&&_0x249dcb['index']!==undefined){const _0x42275a=_0x249dcb['index']+_0x249dcb[0x0][_0x26a06f(0x19b)];return _0x4d5a56[_0x26a06f(0x19a)](0x0,_0x42275a)+_0x200c3f+'\x0a'+_0x4d5a56[_0x26a06f(0x19a)](_0x42275a);}return _0x4d5a56;}[a41_0x56a5b7(0x1a7)](_0x5530fe,_0x2697fd,_0x39efc3){const _0x5c7b9d=a41_0x56a5b7,_0x2c736c=_0x5c7b9d(0x1af)+_0x2697fd+_0x5c7b9d(0x184)+_0x39efc3+_0x5c7b9d(0x198);if(_0x5530fe[_0x5c7b9d(0x193)](_0x5c7b9d(0x1a1)+_0x2697fd+'\x22'))return _0x5530fe;const _0x4c0553=/children:\s*\[([\s\S]*?)\]/,_0x47751f=_0x5530fe[_0x5c7b9d(0x19e)](_0x4c0553);if(!_0x47751f||_0x47751f[_0x5c7b9d(0x18a)]===undefined)throw new Error('未找到路由配置的\x20children\x20数组');const _0x446b93=_0x47751f[0x1],_0x46649e=_0x47751f[_0x5c7b9d(0x18a)]+_0x47751f[0x0]['indexOf']('[')+0x1,_0x23e84f=_0x446b93?.[_0x5c7b9d(0x19e)](/\{[\s\S]*?\},/g)||[];if(_0x23e84f[_0x5c7b9d(0x19b)]>0x0){const _0x5f00ec=_0x23e84f[_0x23e84f[_0x5c7b9d(0x19b)]-0x1];if(_0x5f00ec){const _0x47e945=_0x5530fe['lastIndexOf'](_0x5f00ec),_0x32f7d6=_0x47e945+_0x5f00ec[_0x5c7b9d(0x19b)];return _0x5530fe[_0x5c7b9d(0x19a)](0x0,_0x32f7d6)+'\x0a'+_0x2c736c+_0x5530fe[_0x5c7b9d(0x19a)](_0x32f7d6);}}return _0x5530fe[_0x5c7b9d(0x19a)](0x0,_0x46649e)+'\x0a'+_0x2c736c+_0x5530fe[_0x5c7b9d(0x19a)](_0x46649e);}async[a41_0x56a5b7(0x1a0)](_0x4332b3,_0x5256ef){const _0x54d5a3=a41_0x56a5b7;if(!a41_0x3fb513[_0x54d5a3(0x1ad)](this['routerFilePath']))throw new Error(_0x54d5a3(0x187)+this[_0x54d5a3(0x18c)]);const _0x8b8974=await a41_0x3fb513[_0x54d5a3(0x1ae)][_0x54d5a3(0x1a3)](this[_0x54d5a3(0x18c)],'utf8'),_0x2850a3=this[_0x54d5a3(0x194)](_0x4332b3);let _0x5062d9=this[_0x54d5a3(0x1ab)](_0x8b8974,_0x2850a3,_0x4332b3);return _0x5062d9=this[_0x54d5a3(0x1a7)](_0x5062d9,_0x5256ef,_0x2850a3),_0x5062d9;}}
@@ -1 +1 @@
1
- function a42_0x532e(){const _0x198f08=['mkdir','split','map','.tpl','9656460eigSKd','message','.tsx','processFile','writeFile','readFile','模板内容替换失败','isDirectory','108oTyzZv','toISOString','keys','stringify','.json','name','replaceApiContent','.ts','template','now','模板内容替换完成','8134392tegRbk','6121350ZRUISk','.js','numeric','toDisplayTitle','toUpperCase','includes','.jsx','YourModel','toLowerCase','toLocaleString','pop','api','readdir','10293864JMasQX','promises','info','charAt','endsWith','350623npdrbU','2-digit','.scss','success','开始处理模板内容替换','toLocaleDateString','48466gnSFJQ','slice','default','processDirectory','6231028nojcll','utf8','toComponentName','join','replace'];a42_0x532e=function(){return _0x198f08;};return a42_0x532e();}const a42_0x1e044f=a42_0x16e3;(function(_0x1abf7e,_0x10fcf7){const _0x36f07f=a42_0x16e3,_0x3b538b=_0x1abf7e();while(!![]){try{const _0x5c052c=parseInt(_0x36f07f(0x177))/0x1+-parseInt(_0x36f07f(0x17d))/0x2*(parseInt(_0x36f07f(0x159))/0x3)+parseInt(_0x36f07f(0x148))/0x4+-parseInt(_0x36f07f(0x165))/0x5+parseInt(_0x36f07f(0x151))/0x6+-parseInt(_0x36f07f(0x172))/0x7+parseInt(_0x36f07f(0x164))/0x8;if(_0x5c052c===_0x10fcf7)break;else _0x3b538b['push'](_0x3b538b['shift']());}catch(_0x57bc14){_0x3b538b['push'](_0x3b538b['shift']());}}}(a42_0x532e,0xec2d3));function a42_0x16e3(_0x5a1a77,_0x59fa38){const _0x532ecc=a42_0x532e();return a42_0x16e3=function(_0x16e3a7,_0x5e55f6){_0x16e3a7=_0x16e3a7-0x147;let _0x340cd2=_0x532ecc[_0x16e3a7];return _0x340cd2;},a42_0x16e3(_0x5a1a77,_0x59fa38);}import a42_0xb2cc0 from'node:fs';import a42_0x3eb393 from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a42_0x1e044f(0x14a)](_0x4555b8){const _0xb22fbb=a42_0x1e044f,_0x5d92aa=_0x4555b8[_0xb22fbb(0x14e)]('/')[_0xb22fbb(0x16f)]()||_0x4555b8;return _0x5d92aa['split']('-')[_0xb22fbb(0x14f)](_0x84cfc0=>_0x84cfc0['charAt'](0x0)[_0xb22fbb(0x169)]()+_0x84cfc0[_0xb22fbb(0x17e)](0x1)[_0xb22fbb(0x16d)]())[_0xb22fbb(0x14b)]('');}static[a42_0x1e044f(0x168)](_0x451aca){const _0x3516fe=a42_0x1e044f,_0x34e514=_0x451aca[_0x3516fe(0x14e)]('/')[_0x3516fe(0x16f)]()||_0x451aca;return _0x34e514['split']('-')[_0x3516fe(0x14f)](_0x1332ca=>_0x1332ca[_0x3516fe(0x175)](0x0)['toUpperCase']()+_0x1332ca[_0x3516fe(0x17e)](0x1)[_0x3516fe(0x16d)]())[_0x3516fe(0x14b)]('\x20');}static['replaceContent'](_0x15d584,_0x2c13d2,_0x43ddf6){const _0x3ff237=a42_0x1e044f,_0x236d81=this['toComponentName'](_0x2c13d2),_0xcc0d5f=this['toDisplayTitle'](_0x2c13d2),_0x4a99df=new Date(),_0xcce2f2=_0x4a99df[_0x3ff237(0x16e)](undefined,{'year':_0x3ff237(0x167),'month':_0x3ff237(0x178),'day':_0x3ff237(0x178),'hour':_0x3ff237(0x178),'minute':'2-digit','second':_0x3ff237(0x178),'hour12':![]})[_0x3ff237(0x14c)](/\//g,'-'),_0xd3794d=_0x4a99df[_0x3ff237(0x17c)](undefined,{'year':_0x3ff237(0x167),'month':_0x3ff237(0x178),'day':'2-digit'})[_0x3ff237(0x14c)](/\//g,'-'),_0x280595=_0x4a99df['toLocaleTimeString'](undefined,{'hour12':![]});let _0x4a1a49=_0x15d584[_0x3ff237(0x14c)](/\{ComponentName\}/g,_0x236d81)[_0x3ff237(0x14c)](/\{DisplayTitle\}/g,_0xcc0d5f)[_0x3ff237(0x14c)](/\{PageName\}/g,_0x2c13d2)[_0x3ff237(0x14c)](/\{TemplateName\}/g,_0x43ddf6)[_0x3ff237(0x14c)](/\{CreatedAt\}/g,_0xcce2f2)[_0x3ff237(0x14c)](/\{CreatedDate\}/g,_0xd3794d)['replace'](/\{CreatedTime\}/g,_0x280595);return _0x4a1a49;}static[a42_0x1e044f(0x15f)](_0x5254f7,_0x4ae240,_0x2fbdac,_0x1688c0,_0x1fc4f5,_0x1a3f14,_0x4ff997){const _0xec6a69=a42_0x1e044f,_0x5d3ff1=new Date(),_0x5c8770=_0x5d3ff1[_0xec6a69(0x15a)](),_0xd29412=JSON[_0xec6a69(0x15c)](_0x2fbdac,null,0x2)[_0xec6a69(0x14e)]('\x0a')[_0xec6a69(0x17e)](0x1,-0x1)[_0xec6a69(0x14f)](_0x2e3e96=>_0x2e3e96[_0xec6a69(0x14c)](/^ /,'\x20\x20\x20\x20'))[_0xec6a69(0x14b)]('\x0a'),_0x34cc68=_0x1688c0||Object[_0xec6a69(0x15b)](_0x2fbdac)[0x0]||_0xec6a69(0x16c);let _0x447db3=_0x5254f7[_0xec6a69(0x14c)](/\{AppCode\}/g,_0x4ae240)['replace'](/\{ModelConfigs\}/g,_0xd29412)['replace'](/\{ExampleModelName\}/g,_0x34cc68)['replace'](/\{ApiFileName\}/g,_0x1fc4f5||_0xec6a69(0x170))[_0xec6a69(0x14c)](/\{ConfigName\}/g,_0x1a3f14||_0xec6a69(0x17f))[_0xec6a69(0x14c)](/\{ClientConfigParam\}/g,_0x4ff997||'')[_0xec6a69(0x14c)](/\{CreatedAt\}/g,_0x5c8770);return _0x447db3;}static async['processTemplate'](_0x3aab97,_0x3ec8cd,_0x18076c,_0x2cb147,_0x345596=!![]){const _0x201408=a42_0x1e044f,_0x8a3ba=Date[_0x201408(0x162)]();try{_0x345596&&logger[_0x201408(0x174)]('template',_0x201408(0x17b),{'templatePath':_0x3aab97,'targetPath':_0x3ec8cd,'pageName':_0x18076c,'templateName':_0x2cb147});await a42_0xb2cc0['promises'][_0x201408(0x14d)](_0x3ec8cd,{'recursive':!![]}),await this[_0x201408(0x147)](_0x3aab97,_0x3ec8cd,_0x18076c,_0x2cb147);if(_0x345596){const _0x37432f=Date['now']()-_0x8a3ba;logger[_0x201408(0x17a)](_0x201408(0x161),_0x201408(0x163),_0x37432f,{'pageName':_0x18076c,'templateName':_0x2cb147});}}catch(_0x52c9a7){if(_0x345596){const _0x17061f=Date[_0x201408(0x162)]()-_0x8a3ba;logger['error'](_0x201408(0x161),_0x201408(0x157),{'templatePath':_0x3aab97,'targetPath':_0x3ec8cd,'pageName':_0x18076c,'templateName':_0x2cb147,'error':_0x52c9a7 instanceof Error?_0x52c9a7[_0x201408(0x152)]:String(_0x52c9a7),'duration':_0x17061f});}throw _0x52c9a7;}}static async[a42_0x1e044f(0x147)](_0x338890,_0x5fc9b,_0x2ecb22,_0x1f3b0b){const _0x38b0eb=a42_0x1e044f,_0x39a386=await a42_0xb2cc0[_0x38b0eb(0x173)][_0x38b0eb(0x171)](_0x338890,{'withFileTypes':!![]});for(const _0x4eaea1 of _0x39a386){const _0x3033e6=a42_0x3eb393[_0x38b0eb(0x14b)](_0x338890,_0x4eaea1['name']);let _0x216533=a42_0x3eb393[_0x38b0eb(0x14b)](_0x5fc9b,_0x4eaea1[_0x38b0eb(0x15e)]);_0x4eaea1[_0x38b0eb(0x15e)][_0x38b0eb(0x176)](_0x38b0eb(0x150))&&(_0x216533=a42_0x3eb393[_0x38b0eb(0x14b)](_0x5fc9b,_0x4eaea1[_0x38b0eb(0x15e)][_0x38b0eb(0x14c)](/\.tpl$/,'')));if(_0x4eaea1[_0x38b0eb(0x158)]())await a42_0xb2cc0['promises']['mkdir'](_0x216533,{'recursive':!![]}),await this[_0x38b0eb(0x147)](_0x3033e6,_0x216533,_0x2ecb22,_0x1f3b0b);else _0x4eaea1['isFile']()&&await this[_0x38b0eb(0x154)](_0x3033e6,_0x216533,_0x2ecb22,_0x1f3b0b);}}static async[a42_0x1e044f(0x154)](_0x3305e0,_0x8824ee,_0x19771e,_0xf33796){const _0x34feba=a42_0x1e044f,_0x4d2dac=a42_0x3eb393['extname'](_0x3305e0)['toLowerCase']();_0x3305e0['endsWith'](_0x34feba(0x150))&&(_0x8824ee=_0x8824ee[_0x34feba(0x14c)](/\.tpl$/,''));const _0x9bc3d7=[_0x34feba(0x153),_0x34feba(0x160),_0x34feba(0x16b),_0x34feba(0x166),_0x34feba(0x15d),'.md','.css',_0x34feba(0x179),_0x34feba(0x150)];if(_0x9bc3d7[_0x34feba(0x16a)](_0x4d2dac)||_0x3305e0['endsWith'](_0x34feba(0x150))){const _0x37fb9d=await a42_0xb2cc0[_0x34feba(0x173)][_0x34feba(0x156)](_0x3305e0,_0x34feba(0x149)),_0x5a38dd=this['replaceContent'](_0x37fb9d,_0x19771e,_0xf33796);await a42_0xb2cc0[_0x34feba(0x173)][_0x34feba(0x155)](_0x8824ee,_0x5a38dd,'utf8');}else await a42_0xb2cc0[_0x34feba(0x173)]['copyFile'](_0x3305e0,_0x8824ee);}}
1
+ const a42_0x52117f=a42_0x1904;(function(_0x4c1c9b,_0xa7c47){const _0x2e151f=a42_0x1904,_0x1711aa=_0x4c1c9b();while(!![]){try{const _0x5a7d68=parseInt(_0x2e151f(0x100))/0x1*(parseInt(_0x2e151f(0xfc))/0x2)+parseInt(_0x2e151f(0x11d))/0x3+-parseInt(_0x2e151f(0xfa))/0x4*(-parseInt(_0x2e151f(0x105))/0x5)+parseInt(_0x2e151f(0x11f))/0x6*(parseInt(_0x2e151f(0x122))/0x7)+-parseInt(_0x2e151f(0x10b))/0x8*(parseInt(_0x2e151f(0x10f))/0x9)+-parseInt(_0x2e151f(0xf0))/0xa+-parseInt(_0x2e151f(0x10c))/0xb;if(_0x5a7d68===_0xa7c47)break;else _0x1711aa['push'](_0x1711aa['shift']());}catch(_0x12383d){_0x1711aa['push'](_0x1711aa['shift']());}}}(a42_0x50c6,0x5d063));import a42_0xc8c1d7 from'node:fs';function a42_0x50c6(){const _0x2f0117=['utf8','toDisplayTitle','4466460kyRVLn','pop','toLocaleString','join','copyFile','includes','processTemplate','isFile','.jsx','name','132472vxpBFj','split','237814liCdDn','YourModel','toUpperCase','.css','5XiNJnm','numeric','slice','processDirectory','开始处理模板内容替换','85axTaqd','toComponentName','.json','toLocaleDateString','.scss','readdir','227608dnZKRU','11884510rFJFLJ','success','error','9HZRDsF','processFile','toLowerCase','.tpl','template','charAt','extname','模板内容替换完成','2-digit','endsWith','default','isDirectory','promises','map','1213200fIyvme','stringify','6Zjcwme','toISOString','replace','2622151oyfCit','replaceApiContent','now','.js'];a42_0x50c6=function(){return _0x2f0117;};return a42_0x50c6();}function a42_0x1904(_0x1a130a,_0x251277){const _0x50c69c=a42_0x50c6();return a42_0x1904=function(_0x19048c,_0x441ac9){_0x19048c=_0x19048c-0xee;let _0x611256=_0x50c69c[_0x19048c];return _0x611256;},a42_0x1904(_0x1a130a,_0x251277);}import a42_0x2c5acb from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a42_0x52117f(0x106)](_0x30bde5){const _0xadfe66=a42_0x52117f,_0xc16300=_0x30bde5[_0xadfe66(0xfb)]('/')['pop']()||_0x30bde5;return _0xc16300[_0xadfe66(0xfb)]('-')[_0xadfe66(0x11c)](_0x593d43=>_0x593d43[_0xadfe66(0x114)](0x0)[_0xadfe66(0xfe)]()+_0x593d43[_0xadfe66(0x102)](0x1)[_0xadfe66(0x111)]())[_0xadfe66(0xf3)]('');}static[a42_0x52117f(0xef)](_0xc0f96c){const _0x51076e=a42_0x52117f,_0x1339dd=_0xc0f96c['split']('/')[_0x51076e(0xf1)]()||_0xc0f96c;return _0x1339dd[_0x51076e(0xfb)]('-')[_0x51076e(0x11c)](_0x48ec6d=>_0x48ec6d[_0x51076e(0x114)](0x0)[_0x51076e(0xfe)]()+_0x48ec6d[_0x51076e(0x102)](0x1)[_0x51076e(0x111)]())[_0x51076e(0xf3)]('\x20');}static['replaceContent'](_0x432980,_0x5df7ae,_0x87c03b){const _0x32c9f4=a42_0x52117f,_0x9451b3=this[_0x32c9f4(0x106)](_0x5df7ae),_0x5681f8=this[_0x32c9f4(0xef)](_0x5df7ae),_0x3cca37=new Date(),_0x2e0e32=_0x3cca37[_0x32c9f4(0xf2)](undefined,{'year':_0x32c9f4(0x101),'month':_0x32c9f4(0x117),'day':'2-digit','hour':_0x32c9f4(0x117),'minute':_0x32c9f4(0x117),'second':_0x32c9f4(0x117),'hour12':![]})[_0x32c9f4(0x121)](/\//g,'-'),_0x4df29d=_0x3cca37[_0x32c9f4(0x108)](undefined,{'year':_0x32c9f4(0x101),'month':'2-digit','day':_0x32c9f4(0x117)})[_0x32c9f4(0x121)](/\//g,'-'),_0x22d282=_0x3cca37['toLocaleTimeString'](undefined,{'hour12':![]});let _0x46ee9d=_0x432980['replace'](/\{ComponentName\}/g,_0x9451b3)[_0x32c9f4(0x121)](/\{DisplayTitle\}/g,_0x5681f8)[_0x32c9f4(0x121)](/\{PageName\}/g,_0x5df7ae)[_0x32c9f4(0x121)](/\{TemplateName\}/g,_0x87c03b)[_0x32c9f4(0x121)](/\{CreatedAt\}/g,_0x2e0e32)[_0x32c9f4(0x121)](/\{CreatedDate\}/g,_0x4df29d)[_0x32c9f4(0x121)](/\{CreatedTime\}/g,_0x22d282);return _0x46ee9d;}static[a42_0x52117f(0x123)](_0x200651,_0x168e96,_0x5124e8,_0x599287,_0x4dad45,_0x268e5a,_0x550bf8){const _0x1fc888=a42_0x52117f,_0x39bb18=new Date(),_0x337458=_0x39bb18[_0x1fc888(0x120)](),_0x25a4e0=JSON[_0x1fc888(0x11e)](_0x5124e8,null,0x2)[_0x1fc888(0xfb)]('\x0a')['slice'](0x1,-0x1)[_0x1fc888(0x11c)](_0x17e98c=>_0x17e98c[_0x1fc888(0x121)](/^ /,'\x20\x20\x20\x20'))[_0x1fc888(0xf3)]('\x0a'),_0x3a6be2=_0x599287||Object['keys'](_0x5124e8)[0x0]||_0x1fc888(0xfd);let _0x19888f=_0x200651[_0x1fc888(0x121)](/\{AppCode\}/g,_0x168e96)[_0x1fc888(0x121)](/\{ModelConfigs\}/g,_0x25a4e0)[_0x1fc888(0x121)](/\{ExampleModelName\}/g,_0x3a6be2)[_0x1fc888(0x121)](/\{ApiFileName\}/g,_0x4dad45||'api')[_0x1fc888(0x121)](/\{ConfigName\}/g,_0x268e5a||_0x1fc888(0x119))['replace'](/\{ClientConfigParam\}/g,_0x550bf8||'')['replace'](/\{CreatedAt\}/g,_0x337458);return _0x19888f;}static async[a42_0x52117f(0xf6)](_0x57d74e,_0x59ac33,_0x35ed2e,_0x1a1c60,_0x1614ce=!![]){const _0x380f84=a42_0x52117f,_0x30d022=Date[_0x380f84(0x124)]();try{_0x1614ce&&logger['info'](_0x380f84(0x113),_0x380f84(0x104),{'templatePath':_0x57d74e,'targetPath':_0x59ac33,'pageName':_0x35ed2e,'templateName':_0x1a1c60});await a42_0xc8c1d7[_0x380f84(0x11b)]['mkdir'](_0x59ac33,{'recursive':!![]}),await this['processDirectory'](_0x57d74e,_0x59ac33,_0x35ed2e,_0x1a1c60);if(_0x1614ce){const _0x4ac348=Date[_0x380f84(0x124)]()-_0x30d022;logger[_0x380f84(0x10d)](_0x380f84(0x113),_0x380f84(0x116),_0x4ac348,{'pageName':_0x35ed2e,'templateName':_0x1a1c60});}}catch(_0x10af32){if(_0x1614ce){const _0x50c447=Date['now']()-_0x30d022;logger[_0x380f84(0x10e)](_0x380f84(0x113),'模板内容替换失败',{'templatePath':_0x57d74e,'targetPath':_0x59ac33,'pageName':_0x35ed2e,'templateName':_0x1a1c60,'error':_0x10af32 instanceof Error?_0x10af32['message']:String(_0x10af32),'duration':_0x50c447});}throw _0x10af32;}}static async[a42_0x52117f(0x103)](_0x53f7a1,_0x34ee81,_0x33b286,_0x78625f){const _0x7ba78a=a42_0x52117f,_0x43785c=await a42_0xc8c1d7[_0x7ba78a(0x11b)][_0x7ba78a(0x10a)](_0x53f7a1,{'withFileTypes':!![]});for(const _0x21eb8d of _0x43785c){const _0xbfab0a=a42_0x2c5acb['join'](_0x53f7a1,_0x21eb8d['name']);let _0x285709=a42_0x2c5acb[_0x7ba78a(0xf3)](_0x34ee81,_0x21eb8d['name']);_0x21eb8d['name'][_0x7ba78a(0x118)](_0x7ba78a(0x112))&&(_0x285709=a42_0x2c5acb[_0x7ba78a(0xf3)](_0x34ee81,_0x21eb8d[_0x7ba78a(0xf9)][_0x7ba78a(0x121)](/\.tpl$/,'')));if(_0x21eb8d[_0x7ba78a(0x11a)]())await a42_0xc8c1d7['promises']['mkdir'](_0x285709,{'recursive':!![]}),await this[_0x7ba78a(0x103)](_0xbfab0a,_0x285709,_0x33b286,_0x78625f);else _0x21eb8d[_0x7ba78a(0xf7)]()&&await this[_0x7ba78a(0x110)](_0xbfab0a,_0x285709,_0x33b286,_0x78625f);}}static async['processFile'](_0x4f7a80,_0x49e4ee,_0x239f16,_0x18d44c){const _0xaa8022=a42_0x52117f,_0x4780bc=a42_0x2c5acb[_0xaa8022(0x115)](_0x4f7a80)[_0xaa8022(0x111)]();_0x4f7a80[_0xaa8022(0x118)](_0xaa8022(0x112))&&(_0x49e4ee=_0x49e4ee[_0xaa8022(0x121)](/\.tpl$/,''));const _0x30cbe3=['.tsx','.ts',_0xaa8022(0xf8),_0xaa8022(0x125),_0xaa8022(0x107),'.md',_0xaa8022(0xff),_0xaa8022(0x109),'.tpl'];if(_0x30cbe3[_0xaa8022(0xf5)](_0x4780bc)||_0x4f7a80[_0xaa8022(0x118)]('.tpl')){const _0x417397=await a42_0xc8c1d7['promises']['readFile'](_0x4f7a80,_0xaa8022(0xee)),_0x5dbb42=this['replaceContent'](_0x417397,_0x239f16,_0x18d44c);await a42_0xc8c1d7[_0xaa8022(0x11b)]['writeFile'](_0x49e4ee,_0x5dbb42,_0xaa8022(0xee));}else await a42_0xc8c1d7[_0xaa8022(0x11b)][_0xaa8022(0xf4)](_0x4f7a80,_0x49e4ee);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@ant-design/icons": "^6.0.0",
12
12
  "@ice/stark-app": "^1.5.0",
13
- "@lovrabet/sdk": "^1.1.8",
13
+ "@lovrabet/sdk": "^1.1.12",
14
14
  "antd": "^5.26.7",
15
15
  "echarts": "^5.6.0",
16
16
  "echarts-for-react": "^3.0.2",
@@ -450,9 +450,9 @@
450
450
  }
451
451
  },
452
452
  "node_modules/@lovrabet/sdk": {
453
- "version": "1.1.8",
454
- "resolved": "https://registry.npmjs.org/@lovrabet/sdk/-/sdk-1.1.8.tgz",
455
- "integrity": "sha512-44oN2ecAhsQhm0NG68CwU8o/vQoS3dW0IZnFq9OR4msR8Mb+TiHK2NWgkRcevxFeCSLO/EI6uVA3PEhWVhLsZQ==",
453
+ "version": "1.1.12",
454
+ "resolved": "https://registry.npmjs.org/@lovrabet/sdk/-/sdk-1.1.12.tgz",
455
+ "integrity": "sha512-+S+jt5dWnipGGl7nR4sYs9Mw97Wgdtq2o08QZfDNHHRCXjVwXAWtd6vxXYkeUZ8nJ+4r+/TrYT6023rHA8kM/Q==",
456
456
  "peerDependencies": {
457
457
  "typescript": "^5"
458
458
  }
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@ant-design/icons": "^6.0.0",
13
13
  "@ice/stark-app": "^1.5.0",
14
- "@lovrabet/sdk": "^1.1.8",
14
+ "@lovrabet/sdk": "^1.1.14",
15
15
  "antd": "^5.26.7",
16
16
  "echarts": "^5.6.0",
17
17
  "echarts-for-react": "^3.0.2",