@lovrabet/cli 1.2.5-beta.3 → 1.2.5-beta.4

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 (66) 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/ai-setup/AISetupUI.js +1 -1
  5. package/lib/ai-setup/config.js +1 -1
  6. package/lib/api/api-doc-ui.js +1 -1
  7. package/lib/api/api-doc.js +1 -1
  8. package/lib/api/api-pull-ui.js +1 -1
  9. package/lib/api/fetch-model-list.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  14. package/lib/app-menu/create-menu.js +1 -1
  15. package/lib/app-menu/get-local-pages.js +1 -1
  16. package/lib/app-menu/get-online-menu-list.js +1 -1
  17. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  18. package/lib/app-menu/utils.js +1 -1
  19. package/lib/app-menu/valid-url.js +1 -1
  20. package/lib/app-menu-update-cdn/current-content.js +1 -1
  21. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  22. package/lib/app-menu-update-cdn/main.js +1 -1
  23. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/task-finished.js +1 -1
  44. package/lib/create-app/task-loading.js +1 -1
  45. package/lib/create-app/task-running.js +1 -1
  46. package/lib/create-app/task-time.js +1 -1
  47. package/lib/create-app/use-copy-project-template.js +1 -1
  48. package/lib/create-app/use-format-code.js +1 -1
  49. package/lib/create-app/use-install-dependencies.js +1 -1
  50. package/lib/help.js +1 -1
  51. package/lib/init/main.js +1 -1
  52. package/lib/mcp/McpInstallUI.js +1 -1
  53. package/lib/mcp/claude.js +1 -1
  54. package/lib/mcp/cursor.js +1 -1
  55. package/lib/mcp/main.js +1 -1
  56. package/lib/skills/SkillInstallUI.js +1 -1
  57. package/lib/skills/main.js +1 -1
  58. package/lib/utils/check-sdk-version.js +1 -1
  59. package/lib/utils/config.js +1 -1
  60. package/lib/utils/copy-directory.js +1 -1
  61. package/lib/utils/http-client.js +1 -1
  62. package/lib/utils/logger.js +1 -1
  63. package/lib/utils/router-updater.js +1 -1
  64. package/lib/utils/sleep.js +1 -1
  65. package/lib/utils/template-replacer.js +1 -1
  66. package/package.json +1 -1
@@ -1 +1 @@
1
- const a61_0x30bb26=a61_0x4487;(function(_0x35347e,_0x547a96){const _0x174935=a61_0x4487,_0x27155b=_0x35347e();while(!![]){try{const _0x260bb4=-parseInt(_0x174935(0x10f))/0x1*(parseInt(_0x174935(0x112))/0x2)+parseInt(_0x174935(0x10a))/0x3*(parseInt(_0x174935(0x116))/0x4)+parseInt(_0x174935(0x114))/0x5+parseInt(_0x174935(0x118))/0x6*(parseInt(_0x174935(0x119))/0x7)+-parseInt(_0x174935(0x108))/0x8+parseInt(_0x174935(0x10b))/0x9+-parseInt(_0x174935(0x117))/0xa;if(_0x260bb4===_0x547a96)break;else _0x27155b['push'](_0x27155b['shift']());}catch(_0x2cbc22){_0x27155b['push'](_0x27155b['shift']());}}}(a61_0x2d04,0x89c08));import{existsSync,readFileSync}from'node:fs';function a61_0x4487(_0x2d1a1f,_0x3e94a5){_0x2d1a1f=_0x2d1a1f-0x108;const _0x2d041a=a61_0x2d04();let _0x44871a=_0x2d041a[_0x2d1a1f];return _0x44871a;}import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a61_0x30bb26(0x10e)](),a61_0x30bb26(0x10c));export const globalConfigPath=resolve(homedir(),a61_0x30bb26(0x10c));export function readConfig(_0x5168b6){const _0xb71429=a61_0x30bb26;let _0xaa2547={};try{if(existsSync(globalConfigPath)){const _0xccd70d=readFileSync(globalConfigPath,{'encoding':_0xb71429(0x109)});_0xccd70d&&(_0xaa2547=JSON[_0xb71429(0x111)](_0xccd70d));}}catch(_0x391d25){}try{const _0x50614f=_0x5168b6?resolve(_0x5168b6,_0xb71429(0x10c)):projectConfigPath;if(existsSync(_0x50614f)){const _0x528364=readFileSync(_0x50614f,{'encoding':_0xb71429(0x109)});if(_0x528364){const _0x1617d0=JSON[_0xb71429(0x111)](_0x528364);_0xaa2547={..._0xaa2547,..._0x1617d0};}}}catch(_0x65d61b){}return _0xaa2547;}export function getConfigAppCode(){const _0x1a70d9=a61_0x30bb26;let _0x5d61a3={},_0x4a826d={};try{if(existsSync(globalConfigPath)){const _0x93bb52=readFileSync(globalConfigPath,{'encoding':_0x1a70d9(0x109)});_0x93bb52&&(_0x4a826d=JSON[_0x1a70d9(0x111)](_0x93bb52));}}catch(_0x5d910c){}try{if(existsSync(projectConfigPath)){const _0x38a449=readFileSync(projectConfigPath,{'encoding':_0x1a70d9(0x109)});_0x38a449&&(_0x5d61a3=JSON['parse'](_0x38a449));}}catch(_0x11fd5e){}let _0x239fbc;if(_0x1a70d9(0x10d)in _0x5d61a3)_0x239fbc=_0x5d61a3[_0x1a70d9(0x10d)];else{if(_0x1a70d9(0x115)in _0x5d61a3)_0x239fbc=_0x5d61a3['app'];else{if(_0x1a70d9(0x10d)in _0x4a826d)_0x239fbc=_0x4a826d['appcode'];else _0x1a70d9(0x115)in _0x4a826d&&(_0x239fbc=_0x4a826d['app']);}}if(typeof _0x239fbc!==_0x1a70d9(0x113)||_0x239fbc[_0x1a70d9(0x110)]()==='')return undefined;return _0x239fbc;}function a61_0x2d04(){const _0x38e695=['1102219InjGoM','trim','parse','2JxGfra','string','4883965GXouRY','app','3950908mFFAwb','2791810qyCEpo','17274Ydzhar','1113uDuFDO','6211584FYqnWx','utf8','3wbYlET','2698191BMayTn','.lovrabetrc','appcode','cwd'];a61_0x2d04=function(){return _0x38e695;};return a61_0x2d04();}export function isInProject(){return existsSync(projectConfigPath);}
1
+ const a61_0x7a12c7=a61_0x2e51;(function(_0x2af4ba,_0x43d4ea){const _0x4a30c5=a61_0x2e51,_0x3174d1=_0x2af4ba();while(!![]){try{const _0x40ee17=-parseInt(_0x4a30c5(0x1b9))/0x1*(-parseInt(_0x4a30c5(0x1b2))/0x2)+-parseInt(_0x4a30c5(0x1bc))/0x3+-parseInt(_0x4a30c5(0x1b4))/0x4+-parseInt(_0x4a30c5(0x1bb))/0x5+-parseInt(_0x4a30c5(0x1bd))/0x6+parseInt(_0x4a30c5(0x1b5))/0x7+parseInt(_0x4a30c5(0x1b8))/0x8*(parseInt(_0x4a30c5(0x1b3))/0x9);if(_0x40ee17===_0x43d4ea)break;else _0x3174d1['push'](_0x3174d1['shift']());}catch(_0x4e3e55){_0x3174d1['push'](_0x3174d1['shift']());}}}(a61_0x58d3,0xf1a37));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';function a61_0x58d3(){const _0x5ee5d9=['6444318leVbMU','.lovrabetrc','string','app','parse','2734598ibOoov','5823AQorcw','2378624HprDEi','8709610xCKmhX','appcode','cwd','37272OqwctK','1cFdQQe','utf8','9622570aRuBuE','3128784tkfGvE'];a61_0x58d3=function(){return _0x5ee5d9;};return a61_0x58d3();}import{homedir}from'node:os';export const projectConfigPath=resolve(process[a61_0x7a12c7(0x1b7)](),a61_0x7a12c7(0x1be));function a61_0x2e51(_0x5ac97c,_0x5f5b97){_0x5ac97c=_0x5ac97c-0x1b0;const _0x58d3f8=a61_0x58d3();let _0x2e516a=_0x58d3f8[_0x5ac97c];return _0x2e516a;}export const globalConfigPath=resolve(homedir(),a61_0x7a12c7(0x1be));export function readConfig(_0x491fb5){const _0xdb14e7=a61_0x7a12c7;let _0x384546={};try{if(existsSync(globalConfigPath)){const _0x4e704e=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x4e704e&&(_0x384546=JSON[_0xdb14e7(0x1b1)](_0x4e704e));}}catch(_0x499309){}try{const _0x5c78f6=_0x491fb5?resolve(_0x491fb5,_0xdb14e7(0x1be)):projectConfigPath;if(existsSync(_0x5c78f6)){const _0x2ba46a=readFileSync(_0x5c78f6,{'encoding':_0xdb14e7(0x1ba)});if(_0x2ba46a){const _0x105492=JSON[_0xdb14e7(0x1b1)](_0x2ba46a);_0x384546={..._0x384546,..._0x105492};}}}catch(_0x31b689){}return _0x384546;}export function getConfigAppCode(){const _0x2722c0=a61_0x7a12c7;let _0x1d5843={},_0x2ca804={};try{if(existsSync(globalConfigPath)){const _0x459f66=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x459f66&&(_0x2ca804=JSON[_0x2722c0(0x1b1)](_0x459f66));}}catch(_0x3d89f0){}try{if(existsSync(projectConfigPath)){const _0x2af9ba=readFileSync(projectConfigPath,{'encoding':_0x2722c0(0x1ba)});_0x2af9ba&&(_0x1d5843=JSON[_0x2722c0(0x1b1)](_0x2af9ba));}}catch(_0x4a2865){}let _0x309b46;if(_0x2722c0(0x1b6)in _0x1d5843)_0x309b46=_0x1d5843[_0x2722c0(0x1b6)];else{if(_0x2722c0(0x1b0)in _0x1d5843)_0x309b46=_0x1d5843['app'];else{if(_0x2722c0(0x1b6)in _0x2ca804)_0x309b46=_0x2ca804['appcode'];else _0x2722c0(0x1b0)in _0x2ca804&&(_0x309b46=_0x2ca804[_0x2722c0(0x1b0)]);}}if(typeof _0x309b46!==_0x2722c0(0x1bf)||_0x309b46['trim']()==='')return undefined;return _0x309b46;}export function isInProject(){return existsSync(projectConfigPath);}
@@ -1 +1 @@
1
- (function(_0xe42b38,_0x5e3a3b){const _0x58b9f5=a62_0x4bc8,_0x32376b=_0xe42b38();while(!![]){try{const _0x4056d9=-parseInt(_0x58b9f5(0x136))/0x1+parseInt(_0x58b9f5(0x12b))/0x2+parseInt(_0x58b9f5(0x133))/0x3+-parseInt(_0x58b9f5(0x12a))/0x4*(-parseInt(_0x58b9f5(0x129))/0x5)+-parseInt(_0x58b9f5(0x12e))/0x6+-parseInt(_0x58b9f5(0x130))/0x7+parseInt(_0x58b9f5(0x12f))/0x8;if(_0x4056d9===_0x5e3a3b)break;else _0x32376b['push'](_0x32376b['shift']());}catch(_0xc7e4bd){_0x32376b['push'](_0x32376b['shift']());}}}(a62_0x5a4a,0xf4104));function a62_0x4bc8(_0x1cfb69,_0x672319){_0x1cfb69=_0x1cfb69-0x129;const _0x5a4af7=a62_0x5a4a();let _0x4bc835=_0x5a4af7[_0x1cfb69];return _0x4bc835;}import a62_0x22ad02 from'node:path';import a62_0x152844 from'node:fs';function a62_0x5a4a(){const _0x271329=['1238512nrOVVP','readdirSync','copyFileSync','6391842oFzEbN','7070376sEArYS','708043JFUFVO','isDirectory','name','2248806hyqjSD','复制目录时出错:','error','702988wWPAvw','mkdirSync','31135eOGJpI','396JwvXsd'];a62_0x5a4a=function(){return _0x271329;};return a62_0x5a4a();}export async function copyDirectory(_0x5624e1,_0x5f5443){const _0x42d2dc=a62_0x4bc8;try{const _0x38b749=a62_0x152844[_0x42d2dc(0x12c)](_0x5624e1,{'withFileTypes':!![]});a62_0x152844[_0x42d2dc(0x137)](_0x5f5443,{'recursive':!![]});for(const _0x4cccb4 of _0x38b749){const _0x32f070=a62_0x22ad02['join'](_0x5624e1,_0x4cccb4[_0x42d2dc(0x132)]),_0x1ff003=a62_0x22ad02['join'](_0x5f5443,_0x4cccb4[_0x42d2dc(0x132)]);_0x4cccb4[_0x42d2dc(0x131)]()?await copyDirectory(_0x32f070,_0x1ff003):a62_0x152844[_0x42d2dc(0x12d)](_0x32f070,_0x1ff003);}}catch(_0x43bb38){console[_0x42d2dc(0x135)](_0x42d2dc(0x134),_0x43bb38);}}
1
+ (function(_0x56a667,_0x1117ed){const _0x16dcbb=a62_0x1993,_0x1da45e=_0x56a667();while(!![]){try{const _0x3f2770=-parseInt(_0x16dcbb(0x11e))/0x1+-parseInt(_0x16dcbb(0x11a))/0x2+parseInt(_0x16dcbb(0x11d))/0x3*(-parseInt(_0x16dcbb(0x117))/0x4)+parseInt(_0x16dcbb(0x121))/0x5+parseInt(_0x16dcbb(0x122))/0x6+parseInt(_0x16dcbb(0x11c))/0x7*(parseInt(_0x16dcbb(0x115))/0x8)+-parseInt(_0x16dcbb(0x123))/0x9*(-parseInt(_0x16dcbb(0x124))/0xa);if(_0x3f2770===_0x1117ed)break;else _0x1da45e['push'](_0x1da45e['shift']());}catch(_0x5e3267){_0x1da45e['push'](_0x1da45e['shift']());}}}(a62_0x3b2b,0x7d184));import a62_0x19276e from'node:path';function a62_0x1993(_0x12a6d6,_0x2414d4){_0x12a6d6=_0x12a6d6-0x115;const _0x3b2b63=a62_0x3b2b();let _0x199340=_0x3b2b63[_0x12a6d6];return _0x199340;}import a62_0x31bd14 from'node:fs';export async function copyDirectory(_0x3ff81e,_0x4b3397){const _0x45bda7=a62_0x1993;try{const _0x932c5e=a62_0x31bd14[_0x45bda7(0x11b)](_0x3ff81e,{'withFileTypes':!![]});a62_0x31bd14[_0x45bda7(0x120)](_0x4b3397,{'recursive':!![]});for(const _0x5e20ad of _0x932c5e){const _0x15ef22=a62_0x19276e[_0x45bda7(0x118)](_0x3ff81e,_0x5e20ad[_0x45bda7(0x116)]),_0x3f691c=a62_0x19276e[_0x45bda7(0x118)](_0x4b3397,_0x5e20ad[_0x45bda7(0x116)]);_0x5e20ad[_0x45bda7(0x119)]()?await copyDirectory(_0x15ef22,_0x3f691c):a62_0x31bd14['copyFileSync'](_0x15ef22,_0x3f691c);}}catch(_0x542031){console[_0x45bda7(0x11f)]('复制目录时出错:',_0x542031);}}function a62_0x3b2b(){const _0x326f40=['4104636bvVrqp','7596ijDfhF','1490kzSwvX','2733712cDDmTc','name','1108SgfSyT','join','isDirectory','1686318cHSZKj','readdirSync','7sVbmyT','654eyihaP','246246eQtzFM','error','mkdirSync','2553015BuaDAn'];a62_0x3b2b=function(){return _0x326f40;};return a62_0x3b2b();}
@@ -1 +1 @@
1
- (function(_0x324266,_0x27a704){const _0xfa40f8=a63_0x5cf1,_0x430bb8=_0x324266();while(!![]){try{const _0x3892f1=-parseInt(_0xfa40f8(0x147))/0x1+-parseInt(_0xfa40f8(0x148))/0x2*(-parseInt(_0xfa40f8(0x15b))/0x3)+parseInt(_0xfa40f8(0x14f))/0x4*(-parseInt(_0xfa40f8(0x153))/0x5)+parseInt(_0xfa40f8(0x14a))/0x6+-parseInt(_0xfa40f8(0x149))/0x7*(parseInt(_0xfa40f8(0x158))/0x8)+-parseInt(_0xfa40f8(0x15c))/0x9+parseInt(_0xfa40f8(0x157))/0xa;if(_0x3892f1===_0x27a704)break;else _0x430bb8['push'](_0x430bb8['shift']());}catch(_0x511aad){_0x430bb8['push'](_0x430bb8['shift']());}}}(a63_0x2df2,0xbaa9c));export async function httpRequest(_0x514309,_0x4a6550={}){const _0x44a89d=a63_0x5cf1,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x4a6550;let _0x774cf1=null;for(let _0x13ed64=0x0;_0x13ed64<=retries;_0x13ed64++){try{const _0x4d40d9=new AbortController(),_0x1556b9=setTimeout(()=>_0x4d40d9['abort'](),timeout),_0x5c210b=await fetch(_0x514309,{'headers':headers,'signal':_0x4d40d9[_0x44a89d(0x156)]});clearTimeout(_0x1556b9);let _0x9dfe0;const _0x208f6d=_0x5c210b[_0x44a89d(0x146)]['get'](_0x44a89d(0x14c));return _0x208f6d?.['includes']('application/json')?_0x9dfe0=await _0x5c210b[_0x44a89d(0x14d)]():_0x9dfe0=await _0x5c210b[_0x44a89d(0x152)](),{'ok':_0x5c210b['ok'],'status':_0x5c210b['status'],'statusText':_0x5c210b[_0x44a89d(0x15a)],'data':_0x9dfe0,'headers':_0x5c210b[_0x44a89d(0x146)],'url':_0x5c210b[_0x44a89d(0x159)],'text':()=>_0x5c210b[_0x44a89d(0x152)]()};}catch(_0x5557aa){_0x774cf1=_0x5557aa instanceof Error?_0x5557aa:new Error(String(_0x5557aa));if(_0x13ed64===retries)break;if(shouldRetry(_0x5557aa)){console['log']('*\x20请求失败,'+retryDelay+_0x44a89d(0x15d)+(_0x13ed64+0x1)+'\x20次重试...'),await sleep(retryDelay);continue;}else break;}}throw _0x774cf1||new Error(_0x44a89d(0x154));}function a63_0x5cf1(_0x7a1b70,_0x5857fa){_0x7a1b70=_0x7a1b70-0x146;const _0x2df238=a63_0x2df2();let _0x5cf192=_0x2df238[_0x7a1b70];return _0x5cf192;}function shouldRetry(_0x52d16a){const _0x17228f=a63_0x5cf1;if(_0x52d16a instanceof Error){if(_0x52d16a[_0x17228f(0x155)]===_0x17228f(0x14b))return![];if(_0x52d16a[_0x17228f(0x155)]==='TypeError'&&_0x52d16a[_0x17228f(0x150)]['includes']('fetch'))return!![];if(_0x52d16a['message'][_0x17228f(0x151)](_0x17228f(0x14e)))return!![];if(_0x52d16a[_0x17228f(0x150)][_0x17228f(0x151)]('ENOTFOUND'))return![];}return![];}function sleep(_0x582c9c){return new Promise(_0x5a13d7=>setTimeout(_0x5a13d7,_0x582c9c));}function a63_0x2df2(){const _0x28f65b=['message','includes','text','240YcosUe','Request\x20failed','name','signal','11487140dRYEwD','16VflseK','url','statusText','462UbDPLy','609183xXDGei','ms\x20后进行第\x20','headers','303249XRiokt','5312cxLApa','1623587WfXPvK','2368152QkgDfW','AbortError','content-type','json','ECONNRESET','29420frEZof'];a63_0x2df2=function(){return _0x28f65b;};return a63_0x2df2();}export function validateUrl(_0xf819a7){try{return new URL(_0xf819a7),!![];}catch{return![];}}
1
+ (function(_0x47b436,_0x222f32){const _0xcdc024=a63_0x3f9c,_0x30bc8e=_0x47b436();while(!![]){try{const _0x5468dc=parseInt(_0xcdc024(0xb5))/0x1+parseInt(_0xcdc024(0xba))/0x2*(parseInt(_0xcdc024(0xbd))/0x3)+parseInt(_0xcdc024(0xa5))/0x4+-parseInt(_0xcdc024(0xa3))/0x5+-parseInt(_0xcdc024(0xb1))/0x6+parseInt(_0xcdc024(0xab))/0x7+parseInt(_0xcdc024(0xa6))/0x8*(parseInt(_0xcdc024(0xae))/0x9);if(_0x5468dc===_0x222f32)break;else _0x30bc8e['push'](_0x30bc8e['shift']());}catch(_0x2165dd){_0x30bc8e['push'](_0x30bc8e['shift']());}}}(a63_0x2d18,0x3f04e));function a63_0x3f9c(_0x5df391,_0x1e1cac){_0x5df391=_0x5df391-0xa2;const _0x2d1874=a63_0x2d18();let _0x3f9c77=_0x2d1874[_0x5df391];return _0x3f9c77;}export async function httpRequest(_0x1b37e5,_0x284af0={}){const _0x55d194=a63_0x3f9c,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x284af0;let _0x406121=null;for(let _0x22722c=0x0;_0x22722c<=retries;_0x22722c++){try{const _0x356035=new AbortController(),_0x15093d=setTimeout(()=>_0x356035[_0x55d194(0xb8)](),timeout),_0x2e13e5=await fetch(_0x1b37e5,{'headers':headers,'signal':_0x356035[_0x55d194(0xac)]});clearTimeout(_0x15093d);let _0x4af9f7;const _0x4e199d=_0x2e13e5['headers'][_0x55d194(0xaa)]('content-type');return _0x4e199d?.[_0x55d194(0xb0)](_0x55d194(0xa9))?_0x4af9f7=await _0x2e13e5[_0x55d194(0xbe)]():_0x4af9f7=await _0x2e13e5[_0x55d194(0xbb)](),{'ok':_0x2e13e5['ok'],'status':_0x2e13e5[_0x55d194(0xbf)],'statusText':_0x2e13e5['statusText'],'data':_0x4af9f7,'headers':_0x2e13e5[_0x55d194(0xa4)],'url':_0x2e13e5[_0x55d194(0xb4)],'text':()=>_0x2e13e5[_0x55d194(0xbb)]()};}catch(_0x19e197){_0x406121=_0x19e197 instanceof Error?_0x19e197:new Error(String(_0x19e197));if(_0x22722c===retries)break;if(shouldRetry(_0x19e197)){console[_0x55d194(0xaf)](_0x55d194(0xb3)+retryDelay+_0x55d194(0xb9)+(_0x22722c+0x1)+_0x55d194(0xad)),await sleep(retryDelay);continue;}else break;}}throw _0x406121||new Error(_0x55d194(0xb6));}function shouldRetry(_0x569c29){const _0x3f3689=a63_0x3f9c;if(_0x569c29 instanceof Error){if(_0x569c29['name']===_0x3f3689(0xb7))return![];if(_0x569c29[_0x3f3689(0xa7)]===_0x3f3689(0xa8)&&_0x569c29[_0x3f3689(0xbc)][_0x3f3689(0xb0)](_0x3f3689(0xb2)))return!![];if(_0x569c29[_0x3f3689(0xbc)][_0x3f3689(0xb0)]('ECONNRESET'))return!![];if(_0x569c29[_0x3f3689(0xbc)][_0x3f3689(0xb0)](_0x3f3689(0xa2)))return![];}return![];}function sleep(_0x469ab0){return new Promise(_0x13d336=>setTimeout(_0x13d336,_0x469ab0));}function a63_0x2d18(){const _0x2daeaf=['abort','ms\x20后进行第\x20','2DXOrst','text','message','288696WwLUmC','json','status','ENOTFOUND','1736305JWEZyB','headers','752964HjHtdV','11768IjyIyf','name','TypeError','application/json','get','2253195RRLkue','signal','\x20次重试...','477tLpOKJ','log','includes','631392itRocr','fetch','*\x20请求失败,','url','26298QIiUVI','Request\x20failed','AbortError'];a63_0x2d18=function(){return _0x2daeaf;};return a63_0x2d18();}export function validateUrl(_0x55b7ef){try{return new URL(_0x55b7ef),!![];}catch{return![];}}
@@ -1 +1 @@
1
- function a64_0x14bd(_0x140fdf,_0x17379e){_0x140fdf=_0x140fdf-0x12a;const _0x1db82f=a64_0x1db8();let _0x14bdb6=_0x1db82f[_0x140fdf];return _0x14bdb6;}const a64_0x234030=a64_0x14bd;(function(_0x475d29,_0x4a9dd5){const _0x4e9081=a64_0x14bd,_0x1f92d4=_0x475d29();while(!![]){try{const _0x3d1da2=parseInt(_0x4e9081(0x15a))/0x1+parseInt(_0x4e9081(0x159))/0x2+-parseInt(_0x4e9081(0x141))/0x3*(-parseInt(_0x4e9081(0x156))/0x4)+-parseInt(_0x4e9081(0x140))/0x5*(-parseInt(_0x4e9081(0x154))/0x6)+parseInt(_0x4e9081(0x15e))/0x7*(parseInt(_0x4e9081(0x15f))/0x8)+-parseInt(_0x4e9081(0x12b))/0x9+-parseInt(_0x4e9081(0x14f))/0xa*(parseInt(_0x4e9081(0x12a))/0xb);if(_0x3d1da2===_0x4a9dd5)break;else _0x1f92d4['push'](_0x1f92d4['shift']());}catch(_0x136630){_0x1f92d4['push'](_0x1f92d4['shift']());}}}(a64_0x1db8,0x91179));function a64_0x1db8(){const _0x1f03a5=['stringify','File','existsSync','unknown','details','readLogs','format','565sJydBR','3gGtbCu','readFileSync','printf','transports','errors','setRawCommand','yellow','完成:\x20','clear','createLogger','command','initWinstonLogger','blue','join','30iasmfK','warn','green','combine','rawCommand','6738MnEFvQ','red','2508784vEBjud','toISOString','error','1529512LWdRQv','155059UEPQpT','.lovrabet.log','writeFileSync','log','1390501XPZCQw','24kczdMN','filter','setLogPath','Failed\x20to\x20read\x20logs:','map','Failed\x20to\x20clear\x20logs:','utf8','info','message','4297887mnGWRX','4530519BaRNdB','currentRawCommand','trim','addColors','clearLogs','logTask','timestamp','success','mkdirSync','level','winstonLogger','logFilePath','parse','now'];a64_0x1db8=function(){return _0x1f03a5;};return a64_0x1db8();}import a64_0x56efd1 from'winston';import a64_0x11edf7 from'node:fs';import a64_0x17ad5b from'node:path';class Logger{[a64_0x234030(0x135)];['logFilePath'];['currentRawCommand']='';constructor(){const _0x219d18=a64_0x234030;this[_0x219d18(0x136)]='';}[a64_0x234030(0x146)](_0x21b6fd){this['currentRawCommand']=_0x21b6fd;}[a64_0x234030(0x14c)](){const _0x3c3cb8=a64_0x234030,_0x349e89=a64_0x17ad5b['dirname'](this[_0x3c3cb8(0x136)]);!a64_0x11edf7[_0x3c3cb8(0x13b)](_0x349e89)&&a64_0x11edf7[_0x3c3cb8(0x133)](_0x349e89,{'recursive':!![]});const _0x5cba2b=a64_0x56efd1['format'][_0x3c3cb8(0x152)](a64_0x56efd1['format'][_0x3c3cb8(0x131)](),a64_0x56efd1[_0x3c3cb8(0x13f)][_0x3c3cb8(0x145)]({'stack':!![]}),a64_0x56efd1['format'][_0x3c3cb8(0x143)](_0x2f5612=>{const _0x561322=_0x3c3cb8,_0x1065d4={'timestamp':_0x2f5612[_0x561322(0x131)]||new Date()[_0x561322(0x157)](),'level':_0x2f5612[_0x561322(0x134)]||_0x561322(0x166),'command':_0x2f5612[_0x561322(0x14b)]||_0x561322(0x13c),'rawCommand':_0x2f5612[_0x561322(0x153)]||this[_0x561322(0x12c)]||undefined,'message':_0x2f5612[_0x561322(0x167)]||'','duration':_0x2f5612['duration']||undefined,'details':_0x2f5612[_0x561322(0x13d)]||undefined};return JSON[_0x561322(0x139)](_0x1065d4);}));this[_0x3c3cb8(0x135)]=a64_0x56efd1[_0x3c3cb8(0x14a)]({'level':'info','format':_0x5cba2b,'transports':[new a64_0x56efd1[(_0x3c3cb8(0x144))][(_0x3c3cb8(0x13a))]({'filename':this[_0x3c3cb8(0x136)],'level':_0x3c3cb8(0x166)})],'silent':![]}),a64_0x56efd1[_0x3c3cb8(0x12e)]({'success':_0x3c3cb8(0x151),'error':_0x3c3cb8(0x155),'warn':_0x3c3cb8(0x147),'info':_0x3c3cb8(0x14d)});}[a64_0x234030(0x161)](_0x1fe383){const _0x26bac3=a64_0x234030;this['logFilePath']=a64_0x17ad5b[_0x26bac3(0x14e)](_0x1fe383,_0x26bac3(0x15b)),this[_0x26bac3(0x135)]&&this[_0x26bac3(0x135)][_0x26bac3(0x149)](),this['initWinstonLogger']();}[a64_0x234030(0x166)](_0xf2f39d,_0x2e77b5,_0x20e56f){const _0x5b875c=a64_0x234030;if(!this['logFilePath']||!this[_0x5b875c(0x135)])return;this[_0x5b875c(0x135)][_0x5b875c(0x166)](_0x2e77b5,{'command':_0xf2f39d,'details':_0x20e56f});}[a64_0x234030(0x132)](_0x71b24a,_0x3f0a86,_0x294b38,_0x207cc1){const _0x445ab8=a64_0x234030;if(!this[_0x445ab8(0x136)]||!this[_0x445ab8(0x135)])return;this[_0x445ab8(0x135)][_0x445ab8(0x15d)](_0x445ab8(0x166),_0x3f0a86,{'level':'success','command':_0x71b24a,'duration':_0x294b38,'details':_0x207cc1});}[a64_0x234030(0x158)](_0x2f820e,_0x2c8736,_0x20c977){const _0x12267b=a64_0x234030;if(!this[_0x12267b(0x136)]||!this[_0x12267b(0x135)])return;this[_0x12267b(0x135)][_0x12267b(0x158)](_0x2c8736,{'command':_0x2f820e,'details':_0x20c977});}['warn'](_0x153bf7,_0x58dcfb,_0x69ef3b){const _0x85adb1=a64_0x234030;if(!this[_0x85adb1(0x136)]||!this[_0x85adb1(0x135)])return;this[_0x85adb1(0x135)][_0x85adb1(0x150)](_0x58dcfb,{'command':_0x153bf7,'details':_0x69ef3b});}async[a64_0x234030(0x130)](_0x53d3b3,_0x33b5ab,_0x1aeced){const _0x454617=a64_0x234030,_0x4a5c84=Date['now']();this[_0x454617(0x166)](_0x53d3b3,'开始执行:\x20'+_0x33b5ab);try{const _0x56e985=await _0x1aeced(),_0x281c80=Date[_0x454617(0x138)]()-_0x4a5c84;return this[_0x454617(0x132)](_0x53d3b3,_0x454617(0x148)+_0x33b5ab,_0x281c80),_0x56e985;}catch(_0x4f8473){const _0x6398e4=Date[_0x454617(0x138)]()-_0x4a5c84;this['error'](_0x53d3b3,'失败:\x20'+_0x33b5ab,{'error':_0x4f8473 instanceof Error?_0x4f8473['message']:String(_0x4f8473),'duration':_0x6398e4});throw _0x4f8473;}}[a64_0x234030(0x13e)](){const _0x5a8354=a64_0x234030;try{if(!a64_0x11edf7[_0x5a8354(0x13b)](this[_0x5a8354(0x136)]))return[];const _0x2bcfdd=a64_0x11edf7[_0x5a8354(0x142)](this[_0x5a8354(0x136)],'utf8');return _0x2bcfdd['split']('\x0a')[_0x5a8354(0x160)](_0x2956a5=>_0x2956a5[_0x5a8354(0x12d)]())[_0x5a8354(0x163)](_0x358b93=>JSON[_0x5a8354(0x137)](_0x358b93));}catch(_0x1ee540){return console[_0x5a8354(0x150)](_0x5a8354(0x162),_0x1ee540),[];}}[a64_0x234030(0x12f)](){const _0x2b4404=a64_0x234030;try{a64_0x11edf7['existsSync'](this['logFilePath'])&&a64_0x11edf7[_0x2b4404(0x15c)](this[_0x2b4404(0x136)],'',_0x2b4404(0x165));}catch(_0x299657){console[_0x2b4404(0x150)](_0x2b4404(0x164),_0x299657);}}['getWinstonInstance'](){return this['winstonLogger'];}}export const logger=new Logger();
1
+ const a64_0x2ad189=a64_0x3c56;(function(_0x4b1f41,_0x4c65a1){const _0x2ed2a0=a64_0x3c56,_0x780006=_0x4b1f41();while(!![]){try{const _0x93b9fc=-parseInt(_0x2ed2a0(0x12b))/0x1*(parseInt(_0x2ed2a0(0x13a))/0x2)+-parseInt(_0x2ed2a0(0x141))/0x3+-parseInt(_0x2ed2a0(0x12d))/0x4+-parseInt(_0x2ed2a0(0x133))/0x5+-parseInt(_0x2ed2a0(0x151))/0x6*(parseInt(_0x2ed2a0(0x152))/0x7)+-parseInt(_0x2ed2a0(0x13b))/0x8+-parseInt(_0x2ed2a0(0x134))/0x9*(-parseInt(_0x2ed2a0(0x13e))/0xa);if(_0x93b9fc===_0x4c65a1)break;else _0x780006['push'](_0x780006['shift']());}catch(_0x488933){_0x780006['push'](_0x780006['shift']());}}}(a64_0x41ed,0x82766));import a64_0xf53339 from'winston';function a64_0x41ed(){const _0x26e658=['4191940WpdmyG','12141OndDXF','logTask','rawCommand','command','existsSync','stringify','1120qTNgvX','6575216eaBIya','error','parse','33730nOoWgW','clearLogs','timestamp','2105718xqUBFp','success','red','开始执行:\x20','now','join','失败:\x20','File','initWinstonLogger','clear','mkdirSync','writeFileSync','setLogPath','transports','toISOString','currentRawCommand','251730WIIgMm','133qhjKGl','duration','green','logFilePath','message','createLogger','getWinstonInstance','readLogs','winstonLogger','utf8','format','info','filter','combine','.lovrabet.log','level','yellow','577oSKMXJ','log','2133368CvTLOG','warn','errors','dirname','details','trim'];a64_0x41ed=function(){return _0x26e658;};return a64_0x41ed();}import a64_0x2d6527 from'node:fs';import a64_0x272e2e from'node:path';function a64_0x3c56(_0x318cce,_0xc3ead4){_0x318cce=_0x318cce-0x123;const _0x41edfc=a64_0x41ed();let _0x3c56f1=_0x41edfc[_0x318cce];return _0x3c56f1;}class Logger{[a64_0x2ad189(0x15a)];[a64_0x2ad189(0x155)];[a64_0x2ad189(0x150)]='';constructor(){const _0x5e9e23=a64_0x2ad189;this[_0x5e9e23(0x155)]='';}['setRawCommand'](_0x38b45b){const _0x52dde9=a64_0x2ad189;this[_0x52dde9(0x150)]=_0x38b45b;}[a64_0x2ad189(0x149)](){const _0x3d1093=a64_0x2ad189,_0x24f429=a64_0x272e2e[_0x3d1093(0x130)](this[_0x3d1093(0x155)]);!a64_0x2d6527[_0x3d1093(0x138)](_0x24f429)&&a64_0x2d6527[_0x3d1093(0x14b)](_0x24f429,{'recursive':!![]});const _0x52edb8=a64_0xf53339[_0x3d1093(0x124)][_0x3d1093(0x127)](a64_0xf53339[_0x3d1093(0x124)][_0x3d1093(0x140)](),a64_0xf53339[_0x3d1093(0x124)][_0x3d1093(0x12f)]({'stack':!![]}),a64_0xf53339[_0x3d1093(0x124)]['printf'](_0x31109c=>{const _0x240d65=_0x3d1093,_0x3564a7={'timestamp':_0x31109c[_0x240d65(0x140)]||new Date()[_0x240d65(0x14f)](),'level':_0x31109c[_0x240d65(0x129)]||'info','command':_0x31109c[_0x240d65(0x137)]||'unknown','rawCommand':_0x31109c[_0x240d65(0x136)]||this['currentRawCommand']||undefined,'message':_0x31109c[_0x240d65(0x156)]||'','duration':_0x31109c[_0x240d65(0x153)]||undefined,'details':_0x31109c[_0x240d65(0x131)]||undefined};return JSON[_0x240d65(0x139)](_0x3564a7);}));this[_0x3d1093(0x15a)]=a64_0xf53339[_0x3d1093(0x157)]({'level':_0x3d1093(0x125),'format':_0x52edb8,'transports':[new a64_0xf53339[(_0x3d1093(0x14e))][(_0x3d1093(0x148))]({'filename':this[_0x3d1093(0x155)],'level':'info'})],'silent':![]}),a64_0xf53339['addColors']({'success':_0x3d1093(0x154),'error':_0x3d1093(0x143),'warn':_0x3d1093(0x12a),'info':'blue'});}[a64_0x2ad189(0x14d)](_0x43383d){const _0x2ff6a2=a64_0x2ad189;this['logFilePath']=a64_0x272e2e[_0x2ff6a2(0x146)](_0x43383d,_0x2ff6a2(0x128)),this['winstonLogger']&&this[_0x2ff6a2(0x15a)][_0x2ff6a2(0x14a)](),this[_0x2ff6a2(0x149)]();}[a64_0x2ad189(0x125)](_0xea115,_0x489eaf,_0xb441f7){const _0x567752=a64_0x2ad189;if(!this[_0x567752(0x155)]||!this[_0x567752(0x15a)])return;this[_0x567752(0x15a)][_0x567752(0x125)](_0x489eaf,{'command':_0xea115,'details':_0xb441f7});}[a64_0x2ad189(0x142)](_0x474d72,_0x36c3f9,_0x59ac51,_0x1707f5){const _0x578d7c=a64_0x2ad189;if(!this[_0x578d7c(0x155)]||!this[_0x578d7c(0x15a)])return;this[_0x578d7c(0x15a)][_0x578d7c(0x12c)](_0x578d7c(0x125),_0x36c3f9,{'level':_0x578d7c(0x142),'command':_0x474d72,'duration':_0x59ac51,'details':_0x1707f5});}[a64_0x2ad189(0x13c)](_0x20e0d1,_0x1e0497,_0x645b9e){const _0x445586=a64_0x2ad189;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x445586(0x15a)][_0x445586(0x13c)](_0x1e0497,{'command':_0x20e0d1,'details':_0x645b9e});}[a64_0x2ad189(0x12e)](_0xec9b2e,_0x5f684b,_0x508cb0){const _0x59b7c7=a64_0x2ad189;if(!this[_0x59b7c7(0x155)]||!this[_0x59b7c7(0x15a)])return;this[_0x59b7c7(0x15a)][_0x59b7c7(0x12e)](_0x5f684b,{'command':_0xec9b2e,'details':_0x508cb0});}async[a64_0x2ad189(0x135)](_0x43e7d2,_0x5c5b53,_0x239c9b){const _0x37eac1=a64_0x2ad189,_0x474d9c=Date['now']();this[_0x37eac1(0x125)](_0x43e7d2,_0x37eac1(0x144)+_0x5c5b53);try{const _0x2c7801=await _0x239c9b(),_0x9b60a2=Date[_0x37eac1(0x145)]()-_0x474d9c;return this[_0x37eac1(0x142)](_0x43e7d2,'完成:\x20'+_0x5c5b53,_0x9b60a2),_0x2c7801;}catch(_0x4b0d28){const _0x5cc4ce=Date[_0x37eac1(0x145)]()-_0x474d9c;this['error'](_0x43e7d2,_0x37eac1(0x147)+_0x5c5b53,{'error':_0x4b0d28 instanceof Error?_0x4b0d28[_0x37eac1(0x156)]:String(_0x4b0d28),'duration':_0x5cc4ce});throw _0x4b0d28;}}[a64_0x2ad189(0x159)](){const _0x55c621=a64_0x2ad189;try{if(!a64_0x2d6527[_0x55c621(0x138)](this['logFilePath']))return[];const _0x1c1d05=a64_0x2d6527['readFileSync'](this[_0x55c621(0x155)],_0x55c621(0x123));return _0x1c1d05['split']('\x0a')[_0x55c621(0x126)](_0x5bd0ff=>_0x5bd0ff[_0x55c621(0x132)]())['map'](_0x59ab42=>JSON[_0x55c621(0x13d)](_0x59ab42));}catch(_0x174029){return console[_0x55c621(0x12e)]('Failed\x20to\x20read\x20logs:',_0x174029),[];}}[a64_0x2ad189(0x13f)](){const _0x17593d=a64_0x2ad189;try{a64_0x2d6527[_0x17593d(0x138)](this[_0x17593d(0x155)])&&a64_0x2d6527[_0x17593d(0x14c)](this['logFilePath'],'',_0x17593d(0x123));}catch(_0x360385){console[_0x17593d(0x12e)]('Failed\x20to\x20clear\x20logs:',_0x360385);}}[a64_0x2ad189(0x158)](){return this['winstonLogger'];}}export const logger=new Logger();
@@ -1 +1 @@
1
- const a65_0x5970db=a65_0x996a;function a65_0x996a(_0x25216b,_0x9a9163){_0x25216b=_0x25216b-0x13b;const _0x234544=a65_0x2345();let _0x996a38=_0x234544[_0x25216b];return _0x996a38;}(function(_0x5eb237,_0x7f8fb4){const _0x5efb23=a65_0x996a,_0x31afe8=_0x5eb237();while(!![]){try{const _0x18bc7b=parseInt(_0x5efb23(0x13e))/0x1*(parseInt(_0x5efb23(0x163))/0x2)+-parseInt(_0x5efb23(0x141))/0x3+parseInt(_0x5efb23(0x157))/0x4+parseInt(_0x5efb23(0x142))/0x5*(-parseInt(_0x5efb23(0x14a))/0x6)+parseInt(_0x5efb23(0x154))/0x7*(-parseInt(_0x5efb23(0x150))/0x8)+-parseInt(_0x5efb23(0x165))/0x9+parseInt(_0x5efb23(0x14d))/0xa*(parseInt(_0x5efb23(0x15a))/0xb);if(_0x18bc7b===_0x7f8fb4)break;else _0x31afe8['push'](_0x31afe8['shift']());}catch(_0x2dc21e){_0x31afe8['push'](_0x31afe8['shift']());}}}(a65_0x2345,0x59b4b));function a65_0x2345(){const _0x728cdf=['1551132TfljJv','match','toComponentName','readFile','error','router','now','开始更新路由配置','join','53995NzWJTb','existsSync','path:\x20\x22','425904mKzIyk','2469095DOoeQF','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','index.tsx','writeFile','lastIndexOf','previewChanges','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','路由文件不存在:\x20','6EYYDgJ','includes','\x20from\x20\x22../pages/','20aAFfCG','indexOf','map','80kdifQg','index','split','utf8','212149btzeto','import\x20','promises','1110828GyupCX','addPageRoute','toLowerCase','6308159zRlCjX','addRoute','routerFilePath','message','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','addImport','length','slice','info','2fuFqJJ','路由配置更新失败'];a65_0x2345=function(){return _0x728cdf;};return a65_0x2345();}import a65_0x1a27a8 from'node:fs';import a65_0x508fa9 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a65_0x5970db(0x15c)];constructor(_0x259c1d){const _0x3ebaf1=a65_0x5970db;this[_0x3ebaf1(0x15c)]=a65_0x508fa9[_0x3ebaf1(0x13d)](_0x259c1d,'src',_0x3ebaf1(0x16a),_0x3ebaf1(0x144));}async[a65_0x5970db(0x158)](_0x4accc7,_0x1d5805){const _0x18a350=a65_0x5970db;if(!a65_0x1a27a8[_0x18a350(0x13f)](this[_0x18a350(0x15c)]))throw new Error(_0x18a350(0x149)+this['routerFilePath']);const _0x1af791=Date[_0x18a350(0x13b)]();logger[_0x18a350(0x162)](_0x18a350(0x16a),_0x18a350(0x13c),{'pageName':_0x4accc7,'routePath':_0x1d5805,'file':this[_0x18a350(0x15c)]});try{const _0x188d90=await a65_0x1a27a8[_0x18a350(0x156)]['readFile'](this[_0x18a350(0x15c)],_0x18a350(0x153)),_0x52cee3=this[_0x18a350(0x167)](_0x4accc7),_0x2d2c1f=this[_0x18a350(0x15f)](_0x188d90,_0x52cee3,_0x4accc7),_0x1d6b22=this[_0x18a350(0x15b)](_0x2d2c1f,_0x1d5805,_0x52cee3);await a65_0x1a27a8[_0x18a350(0x156)][_0x18a350(0x145)](this[_0x18a350(0x15c)],_0x1d6b22,_0x18a350(0x153));const _0x4540b6=Date[_0x18a350(0x13b)]()-_0x1af791;logger['success']('router','路由配置更新完成',_0x4540b6,{'pageName':_0x4accc7,'routePath':_0x1d5805,'componentName':_0x52cee3});}catch(_0x503b03){const _0x39c578=Date[_0x18a350(0x13b)]()-_0x1af791;logger[_0x18a350(0x169)]('router',_0x18a350(0x164),{'pageName':_0x4accc7,'routePath':_0x1d5805,'error':_0x503b03 instanceof Error?_0x503b03[_0x18a350(0x15d)]:String(_0x503b03),'duration':_0x39c578});throw _0x503b03;}}[a65_0x5970db(0x167)](_0x4cc73b){const _0x396797=a65_0x5970db;return _0x4cc73b[_0x396797(0x152)]('-')[_0x396797(0x14f)](_0x25a9cf=>_0x25a9cf['charAt'](0x0)['toUpperCase']()+_0x25a9cf[_0x396797(0x161)](0x1)[_0x396797(0x159)]())[_0x396797(0x13d)]('');}['addImport'](_0x2d0564,_0x6b13d3,_0xc0954){const _0x208ca9=a65_0x5970db,_0x7e3fec=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x395423=_0x2d0564[_0x208ca9(0x166)](_0x7e3fec)||[],_0x4f0956=_0x208ca9(0x155)+_0x6b13d3+_0x208ca9(0x14c)+_0xc0954+'\x22;';if(_0x2d0564[_0x208ca9(0x14b)](_0x4f0956))return _0x2d0564;if(_0x395423[_0x208ca9(0x160)]>0x0){const _0x12f977=_0x395423[_0x395423[_0x208ca9(0x160)]-0x1];if(_0x12f977){const _0x28cd1a=_0x2d0564[_0x208ca9(0x146)](_0x12f977),_0x3afbb7=_0x28cd1a+_0x12f977[_0x208ca9(0x160)];return _0x2d0564[_0x208ca9(0x161)](0x0,_0x3afbb7)+_0x4f0956+'\x0a'+_0x2d0564[_0x208ca9(0x161)](_0x3afbb7);}}const _0x14048c=_0x2d0564[_0x208ca9(0x166)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x14048c&&_0x14048c[_0x208ca9(0x151)]!==undefined){const _0x2559b4=_0x14048c['index']+_0x14048c[0x0][_0x208ca9(0x160)];return _0x2d0564[_0x208ca9(0x161)](0x0,_0x2559b4)+_0x4f0956+'\x0a'+_0x2d0564['slice'](_0x2559b4);}return _0x2d0564;}['addRoute'](_0x57192f,_0xd2c52b,_0x18eb46){const _0x3f4592=a65_0x5970db,_0x47ae54=_0x3f4592(0x148)+_0xd2c52b+_0x3f4592(0x143)+_0x18eb46+_0x3f4592(0x15e);if(_0x57192f[_0x3f4592(0x14b)](_0x3f4592(0x140)+_0xd2c52b+'\x22'))return _0x57192f;const _0x4a639a=/children:\s*\[([\s\S]*?)\]/,_0x188d9b=_0x57192f[_0x3f4592(0x166)](_0x4a639a);if(!_0x188d9b||_0x188d9b[_0x3f4592(0x151)]===undefined)throw new Error('未找到路由配置的\x20children\x20数组');const _0x253752=_0x188d9b[0x1],_0x2f45c1=_0x188d9b[_0x3f4592(0x151)]+_0x188d9b[0x0][_0x3f4592(0x14e)]('[')+0x1,_0x4f9ddd=_0x253752?.[_0x3f4592(0x166)](/\{[\s\S]*?\},/g)||[];if(_0x4f9ddd[_0x3f4592(0x160)]>0x0){const _0x4eccc9=_0x4f9ddd[_0x4f9ddd[_0x3f4592(0x160)]-0x1];if(_0x4eccc9){const _0x503819=_0x57192f[_0x3f4592(0x146)](_0x4eccc9),_0x2a2c95=_0x503819+_0x4eccc9[_0x3f4592(0x160)];return _0x57192f['slice'](0x0,_0x2a2c95)+'\x0a'+_0x47ae54+_0x57192f[_0x3f4592(0x161)](_0x2a2c95);}}return _0x57192f['slice'](0x0,_0x2f45c1)+'\x0a'+_0x47ae54+_0x57192f[_0x3f4592(0x161)](_0x2f45c1);}async[a65_0x5970db(0x147)](_0x30d7c9,_0xac71ff){const _0x88e313=a65_0x5970db;if(!a65_0x1a27a8[_0x88e313(0x13f)](this[_0x88e313(0x15c)]))throw new Error(_0x88e313(0x149)+this[_0x88e313(0x15c)]);const _0x2016fe=await a65_0x1a27a8['promises'][_0x88e313(0x168)](this[_0x88e313(0x15c)],_0x88e313(0x153)),_0xb2fa4c=this['toComponentName'](_0x30d7c9);let _0x1bbb90=this[_0x88e313(0x15f)](_0x2016fe,_0xb2fa4c,_0x30d7c9);return _0x1bbb90=this['addRoute'](_0x1bbb90,_0xac71ff,_0xb2fa4c),_0x1bbb90;}}
1
+ const a65_0x93e6af=a65_0x12b5;(function(_0x8f007c,_0x382385){const _0x2768ec=a65_0x12b5,_0x2803ca=_0x8f007c();while(!![]){try{const _0x338b2d=parseInt(_0x2768ec(0xd5))/0x1*(-parseInt(_0x2768ec(0xd8))/0x2)+-parseInt(_0x2768ec(0xf9))/0x3*(-parseInt(_0x2768ec(0xf5))/0x4)+-parseInt(_0x2768ec(0xd7))/0x5+-parseInt(_0x2768ec(0xf2))/0x6*(parseInt(_0x2768ec(0xd6))/0x7)+-parseInt(_0x2768ec(0xcf))/0x8+-parseInt(_0x2768ec(0xdc))/0x9*(parseInt(_0x2768ec(0xe5))/0xa)+-parseInt(_0x2768ec(0xef))/0xb*(-parseInt(_0x2768ec(0xf6))/0xc);if(_0x338b2d===_0x382385)break;else _0x2803ca['push'](_0x2803ca['shift']());}catch(_0x36c499){_0x2803ca['push'](_0x2803ca['shift']());}}}(a65_0x5633,0x33d0d));import a65_0x461324 from'node:fs';import a65_0x98de08 from'node:path';import{logger}from'./logger.js';function a65_0x12b5(_0x47643c,_0x103488){_0x47643c=_0x47643c-0xc9;const _0x563323=a65_0x5633();let _0x12b5ba=_0x563323[_0x47643c];return _0x12b5ba;}export class RouterUpdater{[a65_0x93e6af(0xd3)];constructor(_0x4059b3){const _0x19b433=a65_0x93e6af;this[_0x19b433(0xd3)]=a65_0x98de08['join'](_0x4059b3,_0x19b433(0xd9),_0x19b433(0xf3),'index.tsx');}async[a65_0x93e6af(0xe3)](_0x425f57,_0x2fe412){const _0x1b9a16=a65_0x93e6af;if(!a65_0x461324['existsSync'](this['routerFilePath']))throw new Error(_0x1b9a16(0xe8)+this[_0x1b9a16(0xd3)]);const _0x2dfbd7=Date[_0x1b9a16(0xd1)]();logger[_0x1b9a16(0xeb)]('router',_0x1b9a16(0xf8),{'pageName':_0x425f57,'routePath':_0x2fe412,'file':this[_0x1b9a16(0xd3)]});try{const _0x45d29b=await a65_0x461324[_0x1b9a16(0xd2)]['readFile'](this[_0x1b9a16(0xd3)],_0x1b9a16(0xea)),_0x132c33=this['toComponentName'](_0x425f57),_0x5dbc80=this[_0x1b9a16(0xee)](_0x45d29b,_0x132c33,_0x425f57),_0x402175=this[_0x1b9a16(0xda)](_0x5dbc80,_0x2fe412,_0x132c33);await a65_0x461324[_0x1b9a16(0xd2)][_0x1b9a16(0xe7)](this[_0x1b9a16(0xd3)],_0x402175,'utf8');const _0x2a72aa=Date[_0x1b9a16(0xd1)]()-_0x2dfbd7;logger[_0x1b9a16(0xd4)](_0x1b9a16(0xf3),_0x1b9a16(0xc9),_0x2a72aa,{'pageName':_0x425f57,'routePath':_0x2fe412,'componentName':_0x132c33});}catch(_0xca5792){const _0x448ff0=Date[_0x1b9a16(0xd1)]()-_0x2dfbd7;logger[_0x1b9a16(0xce)]('router',_0x1b9a16(0xe1),{'pageName':_0x425f57,'routePath':_0x2fe412,'error':_0xca5792 instanceof Error?_0xca5792[_0x1b9a16(0xe9)]:String(_0xca5792),'duration':_0x448ff0});throw _0xca5792;}}[a65_0x93e6af(0xca)](_0x20a023){const _0xd314af=a65_0x93e6af;return _0x20a023[_0xd314af(0xde)]('-')[_0xd314af(0xcb)](_0x2ef7e2=>_0x2ef7e2['charAt'](0x0)[_0xd314af(0xed)]()+_0x2ef7e2[_0xd314af(0xcd)](0x1)[_0xd314af(0xf0)]())[_0xd314af(0xf7)]('');}[a65_0x93e6af(0xee)](_0x3db08a,_0x4e484b,_0x25d57d){const _0xc5054a=a65_0x93e6af,_0xe44428=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x2ecf56=_0x3db08a[_0xc5054a(0xe0)](_0xe44428)||[],_0x219736=_0xc5054a(0xd0)+_0x4e484b+'\x20from\x20\x22../pages/'+_0x25d57d+'\x22;';if(_0x3db08a['includes'](_0x219736))return _0x3db08a;if(_0x2ecf56[_0xc5054a(0xec)]>0x0){const _0x36944e=_0x2ecf56[_0x2ecf56['length']-0x1];if(_0x36944e){const _0x2e34ba=_0x3db08a[_0xc5054a(0xcc)](_0x36944e),_0x3227ec=_0x2e34ba+_0x36944e[_0xc5054a(0xec)];return _0x3db08a['slice'](0x0,_0x3227ec)+_0x219736+'\x0a'+_0x3db08a[_0xc5054a(0xcd)](_0x3227ec);}}const _0x484a41=_0x3db08a[_0xc5054a(0xe0)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x484a41&&_0x484a41[_0xc5054a(0xf4)]!==undefined){const _0x498c4a=_0x484a41[_0xc5054a(0xf4)]+_0x484a41[0x0]['length'];return _0x3db08a['slice'](0x0,_0x498c4a)+_0x219736+'\x0a'+_0x3db08a[_0xc5054a(0xcd)](_0x498c4a);}return _0x3db08a;}[a65_0x93e6af(0xda)](_0x5f5c81,_0x5832a3,_0x4f0be8){const _0x2c6b3d=a65_0x93e6af,_0x10a175=_0x2c6b3d(0xe6)+_0x5832a3+_0x2c6b3d(0xe2)+_0x4f0be8+'\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},';if(_0x5f5c81[_0x2c6b3d(0xdf)](_0x2c6b3d(0xdd)+_0x5832a3+'\x22'))return _0x5f5c81;const _0xd872fc=/children:\s*\[([\s\S]*?)\]/,_0x102245=_0x5f5c81[_0x2c6b3d(0xe0)](_0xd872fc);if(!_0x102245||_0x102245[_0x2c6b3d(0xf4)]===undefined)throw new Error('未找到路由配置的\x20children\x20数组');const _0x407d7c=_0x102245[0x1],_0x3a1170=_0x102245['index']+_0x102245[0x0][_0x2c6b3d(0xdb)]('[')+0x1,_0x329966=_0x407d7c?.['match'](/\{[\s\S]*?\},/g)||[];if(_0x329966[_0x2c6b3d(0xec)]>0x0){const _0x3e6a58=_0x329966[_0x329966['length']-0x1];if(_0x3e6a58){const _0x13b928=_0x5f5c81[_0x2c6b3d(0xcc)](_0x3e6a58),_0x2d215d=_0x13b928+_0x3e6a58[_0x2c6b3d(0xec)];return _0x5f5c81['slice'](0x0,_0x2d215d)+'\x0a'+_0x10a175+_0x5f5c81['slice'](_0x2d215d);}}return _0x5f5c81['slice'](0x0,_0x3a1170)+'\x0a'+_0x10a175+_0x5f5c81['slice'](_0x3a1170);}async[a65_0x93e6af(0xe4)](_0x551ff2,_0x168184){const _0xd3dde8=a65_0x93e6af;if(!a65_0x461324[_0xd3dde8(0xf1)](this['routerFilePath']))throw new Error(_0xd3dde8(0xe8)+this['routerFilePath']);const _0x2f13c8=await a65_0x461324[_0xd3dde8(0xd2)]['readFile'](this['routerFilePath'],_0xd3dde8(0xea)),_0x578b9a=this[_0xd3dde8(0xca)](_0x551ff2);let _0x1e5b82=this[_0xd3dde8(0xee)](_0x2f13c8,_0x578b9a,_0x551ff2);return _0x1e5b82=this['addRoute'](_0x1e5b82,_0x168184,_0x578b9a),_0x1e5b82;}}function a65_0x5633(){const _0x585079=['info','length','toUpperCase','addImport','11RBBVMS','toLowerCase','existsSync','1842jhPvHP','router','index','436RVbdxu','8796444kWVolR','join','开始更新路由配置','7677KPWuPq','路由配置更新完成','toComponentName','map','lastIndexOf','slice','error','837504IBkYsl','import\x20','now','promises','routerFilePath','success','252821JErpji','7917QzVyGT','114730qKUDFR','2frmvNR','src','addRoute','indexOf','2169zSXltO','path:\x20\x22','split','includes','match','路由配置更新失败','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','addPageRoute','previewChanges','2990ELbSOW','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','writeFile','路由文件不存在:\x20','message','utf8'];a65_0x5633=function(){return _0x585079;};return a65_0x5633();}
@@ -1 +1 @@
1
- export function sleep(_0x32345d){return new Promise(_0x40b03=>setTimeout(_0x40b03,_0x32345d));}
1
+ export function sleep(_0x484369){return new Promise(_0xd58dad=>setTimeout(_0xd58dad,_0x484369));}
@@ -1 +1 @@
1
- const a67_0x1cac4f=a67_0x202d;(function(_0x1d4123,_0x16f3aa){const _0xcf5ea7=a67_0x202d,_0x4842e4=_0x1d4123();while(!![]){try{const _0x3b3cae=parseInt(_0xcf5ea7(0xe8))/0x1+parseInt(_0xcf5ea7(0xb1))/0x2+-parseInt(_0xcf5ea7(0xd2))/0x3*(-parseInt(_0xcf5ea7(0xd1))/0x4)+parseInt(_0xcf5ea7(0xe5))/0x5+-parseInt(_0xcf5ea7(0xbd))/0x6*(parseInt(_0xcf5ea7(0xbe))/0x7)+-parseInt(_0xcf5ea7(0xc3))/0x8+-parseInt(_0xcf5ea7(0xce))/0x9;if(_0x3b3cae===_0x16f3aa)break;else _0x4842e4['push'](_0x4842e4['shift']());}catch(_0x521c72){_0x4842e4['push'](_0x4842e4['shift']());}}}(a67_0x4fb2,0xa8520));import a67_0x13d74c from'node:fs';import a67_0x339bf2 from'node:path';function a67_0x202d(_0x4fed04,_0x6aa1d2){_0x4fed04=_0x4fed04-0xae;const _0x4fb24c=a67_0x4fb2();let _0x202d7e=_0x4fb24c[_0x4fed04];return _0x202d7e;}function a67_0x4fb2(){const _0x3489b8=['1257402OORBsV','name:\x20\x22','.ts','tableName','../../package.json','readdir','join','isDirectory','default','toComponentName','version','replace','552tlmbMc','39550iEksga','name','map','error','.js','5774800umNRIS','tableName:\x20\x22','includes','writeFile','readFile','.css','processFile','numeric','replaceApiContent','slice','replaceContent','13794147MVAaXM','toUpperCase','split','15784Qfhxzd','753DGGWvc','extname','endsWith','toLocaleTimeString','模板内容替换失败','.json','.tsx','alias:\x20\x22','datasetCode','utf8','.tpl','promises','isFile','processTemplate','template','charAt','toLocaleString','message','mkdir','2768475WRieXU','模板内容替换完成','toLowerCase','1290931DtVQYp','.jsx','processDirectory','copyFile','\x20},','toDisplayTitle','datasetCode:\x20\x22','alias','info','开始处理模板内容替换','2-digit','api','now','\x0a\x20\x20\x20\x20{\x20'];a67_0x4fb2=function(){return _0x3489b8;};return a67_0x4fb2();}import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require(a67_0x1cac4f(0xb5))[a67_0x1cac4f(0xbb)];export class TemplateReplacer{static[a67_0x1cac4f(0xba)](_0x4f9704){const _0x261024=a67_0x1cac4f,_0x50ba6f=_0x4f9704[_0x261024(0xd0)]('/')['pop']()||_0x4f9704;return _0x50ba6f[_0x261024(0xd0)]('-')[_0x261024(0xc0)](_0xbe745b=>_0xbe745b['charAt'](0x0)[_0x261024(0xcf)]()+_0xbe745b[_0x261024(0xcc)](0x1)[_0x261024(0xe7)]())[_0x261024(0xb7)]('');}static[a67_0x1cac4f(0xed)](_0x10345c){const _0x5e8fa9=a67_0x1cac4f,_0x2ba814=_0x10345c[_0x5e8fa9(0xd0)]('/')['pop']()||_0x10345c;return _0x2ba814['split']('-')[_0x5e8fa9(0xc0)](_0x222995=>_0x222995[_0x5e8fa9(0xe1)](0x0)['toUpperCase']()+_0x222995[_0x5e8fa9(0xcc)](0x1)[_0x5e8fa9(0xe7)]())['join']('\x20');}static[a67_0x1cac4f(0xcd)](_0xc09c9d,_0x67b7eb,_0x1e12d4){const _0x36530d=a67_0x1cac4f,_0x55481b=this[_0x36530d(0xba)](_0x67b7eb),_0x397b84=this[_0x36530d(0xed)](_0x67b7eb),_0x4c27cf=new Date(),_0x111d7c=_0x4c27cf[_0x36530d(0xe2)](undefined,{'year':'numeric','month':_0x36530d(0xf2),'day':_0x36530d(0xf2),'hour':_0x36530d(0xf2),'minute':'2-digit','second':_0x36530d(0xf2),'hour12':![]})['replace'](/\//g,'-'),_0x214753=_0x4c27cf['toLocaleDateString'](undefined,{'year':_0x36530d(0xca),'month':_0x36530d(0xf2),'day':'2-digit'})['replace'](/\//g,'-'),_0x1f0b40=_0x4c27cf[_0x36530d(0xd5)](undefined,{'hour12':![]});let _0x57277d=_0xc09c9d[_0x36530d(0xbc)](/\{CliVersion\}/g,CLI_VERSION)[_0x36530d(0xbc)](/\{ComponentName\}/g,_0x55481b)['replace'](/\{DisplayTitle\}/g,_0x397b84)[_0x36530d(0xbc)](/\{PageName\}/g,_0x67b7eb)[_0x36530d(0xbc)](/\{TemplateName\}/g,_0x1e12d4)[_0x36530d(0xbc)](/\{CreatedAt\}/g,_0x111d7c)['replace'](/\{CreatedDate\}/g,_0x214753)[_0x36530d(0xbc)](/\{CreatedTime\}/g,_0x1f0b40);return _0x57277d;}static[a67_0x1cac4f(0xcb)](_0x1b0012,_0x23dd6c,_0x4c5ab5,_0x142f9c,_0x486cf1,_0x35745f,_0x4762e6){const _0x4830da=a67_0x1cac4f,_0xd62886=new Date(),_0x4b1c5=_0xd62886['toISOString'](),_0x33deb0=_0x4c5ab5[_0x4830da(0xc0)](_0x4d57e9=>{const _0x19b0c6=_0x4830da,_0x1bcc43=[_0x19b0c6(0xee)+_0x4d57e9[_0x19b0c6(0xda)]+'\x22',_0x19b0c6(0xc4)+_0x4d57e9[_0x19b0c6(0xb4)]+'\x22',_0x19b0c6(0xb2)+_0x4d57e9[_0x19b0c6(0xbf)]+'\x22'];return _0x4d57e9[_0x19b0c6(0xef)]&&_0x1bcc43['push'](_0x19b0c6(0xd9)+_0x4d57e9[_0x19b0c6(0xef)]+'\x22'),_0x19b0c6(0xb0)+_0x1bcc43[_0x19b0c6(0xb7)](',\x20')+_0x19b0c6(0xec);})[_0x4830da(0xb7)](''),_0x453008=_0x142f9c||_0x4c5ab5[0x0]?.[_0x4830da(0xef)]||'YourModel';let _0x23268b=_0x1b0012[_0x4830da(0xbc)](/\{AppCode\}/g,_0x23dd6c)[_0x4830da(0xbc)](/\{ModelConfigs\}/g,_0x33deb0)['replace'](/\{ExampleModelName\}/g,_0x453008)['replace'](/\{ApiFileName\}/g,_0x486cf1||_0x4830da(0xae))[_0x4830da(0xbc)](/\{ConfigName\}/g,_0x35745f||_0x4830da(0xb9))['replace'](/\{ClientConfigParam\}/g,_0x4762e6||'')[_0x4830da(0xbc)](/\{CreatedAt\}/g,_0x4b1c5);return _0x23268b;}static async[a67_0x1cac4f(0xdf)](_0x307763,_0x490e7b,_0x54bb92,_0x30b448,_0x1e50eb=!![]){const _0x2b2be3=a67_0x1cac4f,_0x908c3a=Date[_0x2b2be3(0xaf)]();try{_0x1e50eb&&logger[_0x2b2be3(0xf0)](_0x2b2be3(0xe0),_0x2b2be3(0xf1),{'templatePath':_0x307763,'targetPath':_0x490e7b,'pageName':_0x54bb92,'templateName':_0x30b448});await a67_0x13d74c[_0x2b2be3(0xdd)]['mkdir'](_0x490e7b,{'recursive':!![]}),await this[_0x2b2be3(0xea)](_0x307763,_0x490e7b,_0x54bb92,_0x30b448);if(_0x1e50eb){const _0xbd1c0a=Date[_0x2b2be3(0xaf)]()-_0x908c3a;logger['success'](_0x2b2be3(0xe0),_0x2b2be3(0xe6),_0xbd1c0a,{'pageName':_0x54bb92,'templateName':_0x30b448});}}catch(_0x2fff82){if(_0x1e50eb){const _0x4b0c48=Date[_0x2b2be3(0xaf)]()-_0x908c3a;logger[_0x2b2be3(0xc1)](_0x2b2be3(0xe0),_0x2b2be3(0xd6),{'templatePath':_0x307763,'targetPath':_0x490e7b,'pageName':_0x54bb92,'templateName':_0x30b448,'error':_0x2fff82 instanceof Error?_0x2fff82[_0x2b2be3(0xe3)]:String(_0x2fff82),'duration':_0x4b0c48});}throw _0x2fff82;}}static async[a67_0x1cac4f(0xea)](_0x184d6a,_0x2be10a,_0x996f13,_0x156998){const _0x590dbd=a67_0x1cac4f,_0x43d096=await a67_0x13d74c['promises'][_0x590dbd(0xb6)](_0x184d6a,{'withFileTypes':!![]});for(const _0x363120 of _0x43d096){const _0x25600e=a67_0x339bf2[_0x590dbd(0xb7)](_0x184d6a,_0x363120[_0x590dbd(0xbf)]);let _0x255350=a67_0x339bf2[_0x590dbd(0xb7)](_0x2be10a,_0x363120[_0x590dbd(0xbf)]);_0x363120[_0x590dbd(0xbf)][_0x590dbd(0xd4)](_0x590dbd(0xdc))&&(_0x255350=a67_0x339bf2[_0x590dbd(0xb7)](_0x2be10a,_0x363120[_0x590dbd(0xbf)][_0x590dbd(0xbc)](/\.tpl$/,'')));if(_0x363120[_0x590dbd(0xb8)]())await a67_0x13d74c['promises'][_0x590dbd(0xe4)](_0x255350,{'recursive':!![]}),await this['processDirectory'](_0x25600e,_0x255350,_0x996f13,_0x156998);else _0x363120[_0x590dbd(0xde)]()&&await this[_0x590dbd(0xc9)](_0x25600e,_0x255350,_0x996f13,_0x156998);}}static async[a67_0x1cac4f(0xc9)](_0x2b9696,_0x4babd4,_0x4837df,_0x18643d){const _0x2d3c48=a67_0x1cac4f,_0x184516=a67_0x339bf2[_0x2d3c48(0xd3)](_0x2b9696)['toLowerCase']();_0x2b9696['endsWith']('.tpl')&&(_0x4babd4=_0x4babd4[_0x2d3c48(0xbc)](/\.tpl$/,''));const _0x17de2e=[_0x2d3c48(0xd8),_0x2d3c48(0xb3),_0x2d3c48(0xe9),_0x2d3c48(0xc2),_0x2d3c48(0xd7),'.md',_0x2d3c48(0xc8),'.scss',_0x2d3c48(0xdc)];if(_0x17de2e[_0x2d3c48(0xc5)](_0x184516)||_0x2b9696['endsWith'](_0x2d3c48(0xdc))){const _0x8f39a4=await a67_0x13d74c['promises'][_0x2d3c48(0xc7)](_0x2b9696,'utf8'),_0x2c33e7=this[_0x2d3c48(0xcd)](_0x8f39a4,_0x4837df,_0x18643d);await a67_0x13d74c[_0x2d3c48(0xdd)][_0x2d3c48(0xc6)](_0x4babd4,_0x2c33e7,_0x2d3c48(0xdb));}else await a67_0x13d74c[_0x2d3c48(0xdd)][_0x2d3c48(0xeb)](_0x2b9696,_0x4babd4);}}
1
+ const a67_0x5c8cb1=a67_0x8950;(function(_0x25de1a,_0x53b099){const _0x39b6ca=a67_0x8950,_0x3dfc9b=_0x25de1a();while(!![]){try{const _0x3978bb=-parseInt(_0x39b6ca(0x10f))/0x1*(parseInt(_0x39b6ca(0x122))/0x2)+parseInt(_0x39b6ca(0x113))/0x3+-parseInt(_0x39b6ca(0x100))/0x4+-parseInt(_0x39b6ca(0x109))/0x5+-parseInt(_0x39b6ca(0x12f))/0x6+parseInt(_0x39b6ca(0x12e))/0x7*(-parseInt(_0x39b6ca(0x11b))/0x8)+parseInt(_0x39b6ca(0x10b))/0x9;if(_0x3978bb===_0x53b099)break;else _0x3dfc9b['push'](_0x3dfc9b['shift']());}catch(_0x4fdd2e){_0x3dfc9b['push'](_0x3dfc9b['shift']());}}}(a67_0x4746,0x6fbed));function a67_0x4746(){const _0x538696=['2547144AziKNC','utf8','\x0a\x20\x20\x20\x20{\x20','模板内容替换失败','\x20},','readFile','message','extname','344JdZikk','numeric','toComponentName','datasetCode','name','endsWith','version','2mDrcFq','replaceContent','join','.tpl','processTemplate','开始处理模板内容替换','template','processFile','info','includes','alias:\x20\x22','toDisplayTitle','5747NrGeEy','1162734Gbqdco','now','.md','toLocaleDateString','isDirectory','name:\x20\x22','tableName','toLocaleTimeString','promises','replace','error','default','toLowerCase','.ts','processDirectory','charAt','1992380uxlBsO','alias','pop','slice','.tsx','toLocaleString','readdir','YourModel','split','1346605NvAXBw','toUpperCase','10953108gngXDf','.scss','../../package.json','datasetCode:\x20\x22','611843WtFOzb','2-digit','mkdir','tableName:\x20\x22'];a67_0x4746=function(){return _0x538696;};return a67_0x4746();}import a67_0x79066a from'node:fs';import a67_0x10be17 from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';function a67_0x8950(_0x3bb765,_0x2cfafa){_0x3bb765=_0x3bb765-0xf9;const _0x474616=a67_0x4746();let _0x8950eb=_0x474616[_0x3bb765];return _0x8950eb;}const require=createRequire(import.meta.url),CLI_VERSION=require(a67_0x5c8cb1(0x10d))[a67_0x5c8cb1(0x121)];export class TemplateReplacer{static[a67_0x5c8cb1(0x11d)](_0x7814d4){const _0x4c63db=a67_0x5c8cb1,_0x396412=_0x7814d4[_0x4c63db(0x108)]('/')[_0x4c63db(0x102)]()||_0x7814d4;return _0x396412['split']('-')['map'](_0x3bf340=>_0x3bf340[_0x4c63db(0xff)](0x0)[_0x4c63db(0x10a)]()+_0x3bf340['slice'](0x1)[_0x4c63db(0xfc)]())[_0x4c63db(0x124)]('');}static[a67_0x5c8cb1(0x12d)](_0x28542d){const _0x5681da=a67_0x5c8cb1,_0x3a83d0=_0x28542d[_0x5681da(0x108)]('/')[_0x5681da(0x102)]()||_0x28542d;return _0x3a83d0[_0x5681da(0x108)]('-')['map'](_0x4fcda2=>_0x4fcda2[_0x5681da(0xff)](0x0)[_0x5681da(0x10a)]()+_0x4fcda2[_0x5681da(0x103)](0x1)['toLowerCase']())[_0x5681da(0x124)]('\x20');}static[a67_0x5c8cb1(0x123)](_0x282c1,_0x103dcc,_0x2b34d9){const _0xa51b1b=a67_0x5c8cb1,_0xd00254=this['toComponentName'](_0x103dcc),_0x184e6b=this[_0xa51b1b(0x12d)](_0x103dcc),_0x4a91e3=new Date(),_0x29f686=_0x4a91e3[_0xa51b1b(0x105)](undefined,{'year':'numeric','month':_0xa51b1b(0x110),'day':_0xa51b1b(0x110),'hour':_0xa51b1b(0x110),'minute':'2-digit','second':_0xa51b1b(0x110),'hour12':![]})['replace'](/\//g,'-'),_0x2128d5=_0x4a91e3[_0xa51b1b(0x132)](undefined,{'year':_0xa51b1b(0x11c),'month':_0xa51b1b(0x110),'day':_0xa51b1b(0x110)})[_0xa51b1b(0xf9)](/\//g,'-'),_0x2d392f=_0x4a91e3[_0xa51b1b(0x136)](undefined,{'hour12':![]});let _0x275edc=_0x282c1[_0xa51b1b(0xf9)](/\{CliVersion\}/g,CLI_VERSION)[_0xa51b1b(0xf9)](/\{ComponentName\}/g,_0xd00254)[_0xa51b1b(0xf9)](/\{DisplayTitle\}/g,_0x184e6b)[_0xa51b1b(0xf9)](/\{PageName\}/g,_0x103dcc)['replace'](/\{TemplateName\}/g,_0x2b34d9)[_0xa51b1b(0xf9)](/\{CreatedAt\}/g,_0x29f686)[_0xa51b1b(0xf9)](/\{CreatedDate\}/g,_0x2128d5)['replace'](/\{CreatedTime\}/g,_0x2d392f);return _0x275edc;}static['replaceApiContent'](_0x5987d5,_0xb617f8,_0xaef4ab,_0x918f77,_0x118d80,_0x1205b7,_0x550442){const _0x3be4ad=a67_0x5c8cb1,_0x37091f=new Date(),_0x3c1499=_0x37091f['toISOString'](),_0x1d544b=_0xaef4ab['map'](_0xa6e711=>{const _0x226897=a67_0x8950,_0x28c30e=[_0x226897(0x10e)+_0xa6e711[_0x226897(0x11e)]+'\x22',_0x226897(0x112)+_0xa6e711[_0x226897(0x135)]+'\x22',_0x226897(0x134)+_0xa6e711['name']+'\x22'];return _0xa6e711['alias']&&_0x28c30e['push'](_0x226897(0x12c)+_0xa6e711[_0x226897(0x101)]+'\x22'),_0x226897(0x115)+_0x28c30e['join'](',\x20')+_0x226897(0x117);})['join'](''),_0x39ed68=_0x918f77||_0xaef4ab[0x0]?.[_0x3be4ad(0x101)]||_0x3be4ad(0x107);let _0x4197b2=_0x5987d5[_0x3be4ad(0xf9)](/\{AppCode\}/g,_0xb617f8)[_0x3be4ad(0xf9)](/\{ModelConfigs\}/g,_0x1d544b)[_0x3be4ad(0xf9)](/\{ExampleModelName\}/g,_0x39ed68)[_0x3be4ad(0xf9)](/\{ApiFileName\}/g,_0x118d80||'api')[_0x3be4ad(0xf9)](/\{ConfigName\}/g,_0x1205b7||_0x3be4ad(0xfb))[_0x3be4ad(0xf9)](/\{ClientConfigParam\}/g,_0x550442||'')['replace'](/\{CreatedAt\}/g,_0x3c1499);return _0x4197b2;}static async[a67_0x5c8cb1(0x126)](_0x18fa94,_0x9444c1,_0x312e2c,_0x43e46f,_0x475f5e=!![]){const _0x3d75fa=a67_0x5c8cb1,_0x2dbb32=Date[_0x3d75fa(0x130)]();try{_0x475f5e&&logger[_0x3d75fa(0x12a)](_0x3d75fa(0x128),_0x3d75fa(0x127),{'templatePath':_0x18fa94,'targetPath':_0x9444c1,'pageName':_0x312e2c,'templateName':_0x43e46f});await a67_0x79066a['promises'][_0x3d75fa(0x111)](_0x9444c1,{'recursive':!![]}),await this[_0x3d75fa(0xfe)](_0x18fa94,_0x9444c1,_0x312e2c,_0x43e46f);if(_0x475f5e){const _0x7fa2a=Date['now']()-_0x2dbb32;logger['success'](_0x3d75fa(0x128),'模板内容替换完成',_0x7fa2a,{'pageName':_0x312e2c,'templateName':_0x43e46f});}}catch(_0x83c677){if(_0x475f5e){const _0x1b9dad=Date[_0x3d75fa(0x130)]()-_0x2dbb32;logger[_0x3d75fa(0xfa)](_0x3d75fa(0x128),_0x3d75fa(0x116),{'templatePath':_0x18fa94,'targetPath':_0x9444c1,'pageName':_0x312e2c,'templateName':_0x43e46f,'error':_0x83c677 instanceof Error?_0x83c677[_0x3d75fa(0x119)]:String(_0x83c677),'duration':_0x1b9dad});}throw _0x83c677;}}static async[a67_0x5c8cb1(0xfe)](_0x3d6f60,_0xd1284a,_0x51fce3,_0xd279e1){const _0x18499e=a67_0x5c8cb1,_0x2e282f=await a67_0x79066a[_0x18499e(0x137)][_0x18499e(0x106)](_0x3d6f60,{'withFileTypes':!![]});for(const _0x5c8411 of _0x2e282f){const _0x3dc1fc=a67_0x10be17[_0x18499e(0x124)](_0x3d6f60,_0x5c8411[_0x18499e(0x11f)]);let _0x468392=a67_0x10be17[_0x18499e(0x124)](_0xd1284a,_0x5c8411[_0x18499e(0x11f)]);_0x5c8411[_0x18499e(0x11f)][_0x18499e(0x120)](_0x18499e(0x125))&&(_0x468392=a67_0x10be17[_0x18499e(0x124)](_0xd1284a,_0x5c8411[_0x18499e(0x11f)][_0x18499e(0xf9)](/\.tpl$/,'')));if(_0x5c8411[_0x18499e(0x133)]())await a67_0x79066a[_0x18499e(0x137)]['mkdir'](_0x468392,{'recursive':!![]}),await this[_0x18499e(0xfe)](_0x3dc1fc,_0x468392,_0x51fce3,_0xd279e1);else _0x5c8411['isFile']()&&await this[_0x18499e(0x129)](_0x3dc1fc,_0x468392,_0x51fce3,_0xd279e1);}}static async[a67_0x5c8cb1(0x129)](_0xfb4ac1,_0x52f259,_0x182507,_0x3a0707){const _0x11f3f8=a67_0x5c8cb1,_0x677ee8=a67_0x10be17[_0x11f3f8(0x11a)](_0xfb4ac1)[_0x11f3f8(0xfc)]();_0xfb4ac1[_0x11f3f8(0x120)]('.tpl')&&(_0x52f259=_0x52f259['replace'](/\.tpl$/,''));const _0x3dfe24=[_0x11f3f8(0x104),_0x11f3f8(0xfd),'.jsx','.js','.json',_0x11f3f8(0x131),'.css',_0x11f3f8(0x10c),_0x11f3f8(0x125)];if(_0x3dfe24[_0x11f3f8(0x12b)](_0x677ee8)||_0xfb4ac1[_0x11f3f8(0x120)](_0x11f3f8(0x125))){const _0x45a8f6=await a67_0x79066a['promises'][_0x11f3f8(0x118)](_0xfb4ac1,_0x11f3f8(0x114)),_0x37bdb6=this[_0x11f3f8(0x123)](_0x45a8f6,_0x182507,_0x3a0707);await a67_0x79066a[_0x11f3f8(0x137)]['writeFile'](_0x52f259,_0x37bdb6,_0x11f3f8(0x114));}else await a67_0x79066a[_0x11f3f8(0x137)]['copyFile'](_0xfb4ac1,_0x52f259);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.2.5-beta.3",
3
+ "version": "1.2.5-beta.4",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"