@lovrabet/cli 1.1.26-beta.8 → 1.1.26-beta.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 (58) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/api/api-doc-ui.js +1 -1
  5. package/lib/api/api-doc.js +1 -1
  6. package/lib/api/api-pull-ui.js +1 -1
  7. package/lib/api/fetch-model-list.js +1 -1
  8. package/lib/api/generate-api-file.js +1 -1
  9. package/lib/api/main.js +1 -1
  10. package/lib/api/pull-silent.js +1 -1
  11. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  12. package/lib/app-menu/create-menu.js +1 -1
  13. package/lib/app-menu/get-local-pages.js +1 -1
  14. package/lib/app-menu/get-online-menu-list.js +1 -1
  15. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  16. package/lib/app-menu/utils.js +1 -1
  17. package/lib/app-menu/valid-url.js +1 -1
  18. package/lib/app-menu-cdn-version/app-menu-sync-cdn-version-ui.js +1 -1
  19. package/lib/app-menu-cdn-version/cdn-url-compare-table.js +1 -1
  20. package/lib/app-menu-cdn-version/update-menu-cdn-url.js +1 -1
  21. package/lib/auth/auth-server-ui.js +1 -1
  22. package/lib/auth/auth-server.js +1 -1
  23. package/lib/auth/constant.js +1 -1
  24. package/lib/auth/get-cookie.js +1 -1
  25. package/lib/auth/is-session-valid.js +1 -1
  26. package/lib/auth/logout.js +1 -1
  27. package/lib/cli.js +1 -1
  28. package/lib/cmd/build-watch.js +1 -1
  29. package/lib/cmd/build.js +1 -1
  30. package/lib/cmd/logs.js +1 -1
  31. package/lib/cmd/preview.js +1 -1
  32. package/lib/cmd/start.js +1 -1
  33. package/lib/config/config-help.js +1 -1
  34. package/lib/config/main.js +1 -1
  35. package/lib/constant/domain.js +1 -1
  36. package/lib/constant/env.js +1 -1
  37. package/lib/create-app/enhanced-guided-create.js +1 -1
  38. package/lib/create-app/format-elapsed.js +1 -1
  39. package/lib/create-app/main.js +1 -1
  40. package/lib/create-app/task-finished.js +1 -1
  41. package/lib/create-app/task-loading.js +1 -1
  42. package/lib/create-app/task-running.js +1 -1
  43. package/lib/create-app/task-time.js +1 -1
  44. package/lib/create-app/use-copy-project-template.js +1 -1
  45. package/lib/create-app/use-format-code.js +1 -1
  46. package/lib/create-app/use-install-dependencies.js +1 -1
  47. package/lib/help.js +1 -1
  48. package/lib/init/main.js +1 -1
  49. package/lib/mcp/cursor.js +1 -1
  50. package/lib/mcp/main.js +1 -1
  51. package/lib/utils/config.js +1 -1
  52. package/lib/utils/copy-directory.js +1 -1
  53. package/lib/utils/http-client.js +1 -1
  54. package/lib/utils/logger.js +1 -1
  55. package/lib/utils/router-updater.js +1 -1
  56. package/lib/utils/sleep.js +1 -1
  57. package/lib/utils/template-replacer.js +1 -1
  58. package/package.json +1 -1
package/lib/mcp/cursor.js CHANGED
@@ -1 +1 @@
1
- function a50_0x40b3(){const _0x10e9a6=['9rLnmSI','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','96agaPcH','stringify','message','未找到\x20appcode\x20配置','配置\x20Cursor\x20MCP\x20成功','390nYajgF','@lovrabet/dataset-mcp-server','.cursor','解析现有\x20mcp.json\x20失败','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','750982vILSSQ','mcp-cursor','cwd','utf8','lovrabet-dataset','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','7273648AoPWBN','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','7056sJhsaO','1092WtVKDQ','npx','创建\x20.cursor\x20目录','online','✓\x20创建\x20.cursor\x20目录:\x20','log','9756DOFURq','\x20\x20-\x20环境:\x20','创建\x20.cursor/rules\x20目录','warn','2381710DMEDPA','appcode','url','mcp.json','✓\x20创建\x20mcp.json\x20配置文件','error','lovrabet_rules.mdc','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','\x20\x20-\x20配置文件:\x20','创建新的\x20mcp.json\x20配置','mcpServers','3172050lkJQTq','1SKgeNy','\x0a配置信息:','复制\x20Cursor\x20Rules\x20文件失败','exit','复制\x20Cursor\x20Rules\x20文件','info','136620BCHPeY','rules','app','更新现有\x20mcp.json\x20配置','parse'];a50_0x40b3=function(){return _0x10e9a6;};return a50_0x40b3();}(function(_0x56e075,_0xcf27e){const _0x5e6195=a50_0x975b,_0x3b5d69=_0x56e075();while(!![]){try{const _0x36bc29=-parseInt(_0x5e6195(0x1ff))/0x1*(-parseInt(_0x5e6195(0x1e0))/0x2)+parseInt(_0x5e6195(0x1e8))/0x3*(parseInt(_0x5e6195(0x1d6))/0x4)+-parseInt(_0x5e6195(0x1db))/0x5*(-parseInt(_0x5e6195(0x1ef))/0x6)+parseInt(_0x5e6195(0x1fe))/0x7+parseInt(_0x5e6195(0x1e6))/0x8+-parseInt(_0x5e6195(0x1d4))/0x9*(parseInt(_0x5e6195(0x1f3))/0xa)+parseInt(_0x5e6195(0x1cf))/0xb*(-parseInt(_0x5e6195(0x1e9))/0xc);if(_0x36bc29===_0xcf27e)break;else _0x3b5d69['push'](_0x3b5d69['shift']());}catch(_0x580b1d){_0x3b5d69['push'](_0x3b5d69['shift']());}}}(a50_0x40b3,0x86f1c));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';function a50_0x975b(_0x120a12,_0x456532){const _0x40b3c1=a50_0x40b3();return a50_0x975b=function(_0x975b74,_0x97bba3){_0x975b74=_0x975b74-0x1cf;let _0x45d6e8=_0x40b3c1[_0x975b74];return _0x45d6e8;},a50_0x975b(_0x120a12,_0x456532);}import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0xd98c51=a50_0x975b;try{const _0x45a9ec=process[_0xd98c51(0x1e2)](),_0x38ae95=resolve(_0x45a9ec,_0xd98c51(0x1dd)),_0x150d6d=resolve(_0x38ae95,_0xd98c51(0x1f6)),_0x46cc6d=readConfig(),_0x36ba09=_0x46cc6d[_0xd98c51(0x1f4)]||_0x46cc6d[_0xd98c51(0x1d1)],_0x31e23e=_0x46cc6d['env']||_0xd98c51(0x1ec);!_0x36ba09&&(console[_0xd98c51(0x1f8)](_0xd98c51(0x1e5)),logger['error'](_0xd98c51(0x1e1),_0xd98c51(0x1d9)),process['exit'](0x1));!existsSync(_0x38ae95)&&(mkdirSync(_0x38ae95,{'recursive':!![]}),logger['info']('mcp-cursor',_0xd98c51(0x1eb),{'path':_0x38ae95}),console[_0xd98c51(0x1ee)](_0xd98c51(0x1ed)+_0x38ae95));const _0x357343={'command':_0xd98c51(0x1ea),'args':['-y',_0xd98c51(0x1dc)],'env':{'LOVRABET_APP_CODE':String(_0x36ba09),'LOVRABET_ENV':String(_0x31e23e)}};let _0x1c5aa8;if(existsSync(_0x150d6d))try{const _0x223ad3=readFileSync(_0x150d6d,'utf8');_0x1c5aa8=JSON[_0xd98c51(0x1d3)](_0x223ad3),!_0x1c5aa8['mcpServers']&&(_0x1c5aa8[_0xd98c51(0x1fd)]={}),_0x1c5aa8['mcpServers'][_0xd98c51(0x1e4)]=_0x357343,logger[_0xd98c51(0x204)](_0xd98c51(0x1e1),_0xd98c51(0x1d2),{'path':_0x150d6d,'appcode':_0x36ba09,'env':_0x31e23e}),console[_0xd98c51(0x1ee)]('✓\x20更新\x20mcp.json\x20配置');}catch(_0x449771){logger[_0xd98c51(0x1f8)]('mcp-cursor',_0xd98c51(0x1de),{'error':_0x449771 instanceof Error?_0x449771['message']:String(_0x449771)}),console[_0xd98c51(0x1f8)]('错误:\x20解析现有\x20mcp.json\x20失败:\x20'+(_0x449771 instanceof Error?_0x449771[_0xd98c51(0x1d8)]:String(_0x449771))),process['exit'](0x1);}else _0x1c5aa8={'mcpServers':{'lovrabet-dataset':_0x357343}},logger[_0xd98c51(0x204)](_0xd98c51(0x1e1),_0xd98c51(0x1fc),{'path':_0x150d6d,'appcode':_0x36ba09,'env':_0x31e23e}),console['log'](_0xd98c51(0x1f7));writeFileSync(_0x150d6d,JSON[_0xd98c51(0x1d7)](_0x1c5aa8,null,0x2),{'encoding':_0xd98c51(0x1e3)});const _0x938784=resolve(_0x38ae95,_0xd98c51(0x1d0)),_0x3e379e=resolve(_0x938784,_0xd98c51(0x1f9));if(!existsSync(_0x3e379e))try{!existsSync(_0x938784)&&(mkdirSync(_0x938784,{'recursive':!![]}),logger['info'](_0xd98c51(0x1e1),_0xd98c51(0x1f1),{'path':_0x938784}));const _0x51135c=fileURLToPath(import.meta[_0xd98c51(0x1f5)]),_0x47e72a=dirname(_0x51135c),_0x5a5459=resolve(_0x47e72a,'../../templates/rules/lovrabet_rules.mdc.tpl');existsSync(_0x5a5459)?(copyFileSync(_0x5a5459,_0x3e379e),logger['info']('mcp-cursor',_0xd98c51(0x203),{'from':_0x5a5459,'to':_0x3e379e}),console[_0xd98c51(0x1ee)](_0xd98c51(0x1df))):logger[_0xd98c51(0x1f2)](_0xd98c51(0x1e1),'Cursor\x20Rules\x20模板文件不存在',{'templatePath':_0x5a5459});}catch(_0x92e259){logger['error'](_0xd98c51(0x1e1),_0xd98c51(0x201),{'error':_0x92e259 instanceof Error?_0x92e259['message']:String(_0x92e259)}),console[_0xd98c51(0x1f2)](_0xd98c51(0x1e7)+(_0x92e259 instanceof Error?_0x92e259[_0xd98c51(0x1d8)]:String(_0x92e259)));}else console[_0xd98c51(0x1ee)](_0xd98c51(0x1d5)),logger[_0xd98c51(0x204)](_0xd98c51(0x1e1),'Cursor\x20Rules\x20文件已存在,跳过',{'path':_0x3e379e});console[_0xd98c51(0x1ee)]('\x0a✓\x20Cursor\x20MCP\x20配置成功!'),console['log'](_0xd98c51(0x200)),console[_0xd98c51(0x1ee)]('\x20\x20-\x20AppCode:\x20'+_0x36ba09),console[_0xd98c51(0x1ee)](_0xd98c51(0x1f0)+_0x31e23e),console[_0xd98c51(0x1ee)](_0xd98c51(0x1fb)+_0x150d6d),console[_0xd98c51(0x1ee)]('\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。'),console[_0xd98c51(0x1ee)](_0xd98c51(0x1fa)),logger[_0xd98c51(0x204)](_0xd98c51(0x1e1),_0xd98c51(0x1da),{'appcode':_0x36ba09,'env':_0x31e23e,'configPath':_0x150d6d}),process[_0xd98c51(0x202)](0x0);}catch(_0x32b8bd){logger[_0xd98c51(0x1f8)]('mcp-cursor','配置\x20Cursor\x20MCP\x20失败',{'error':_0x32b8bd instanceof Error?_0x32b8bd[_0xd98c51(0x1d8)]:String(_0x32b8bd)}),console[_0xd98c51(0x1f8)]('错误:\x20配置失败:\x20'+(_0x32b8bd instanceof Error?_0x32b8bd['message']:String(_0x32b8bd))),process[_0xd98c51(0x202)](0x1);}}
1
+ (function(_0x45d277,_0x12a1a8){const _0x1598e8=a50_0x5ba7,_0x32163c=_0x45d277();while(!![]){try{const _0x170079=-parseInt(_0x1598e8(0x97))/0x1+-parseInt(_0x1598e8(0x9e))/0x2*(parseInt(_0x1598e8(0x84))/0x3)+-parseInt(_0x1598e8(0x7a))/0x4*(-parseInt(_0x1598e8(0x9a))/0x5)+parseInt(_0x1598e8(0x9d))/0x6*(parseInt(_0x1598e8(0x90))/0x7)+parseInt(_0x1598e8(0xa1))/0x8*(-parseInt(_0x1598e8(0x73))/0x9)+-parseInt(_0x1598e8(0x8e))/0xa+parseInt(_0x1598e8(0x7d))/0xb;if(_0x170079===_0x12a1a8)break;else _0x32163c['push'](_0x32163c['shift']());}catch(_0x367fef){_0x32163c['push'](_0x32163c['shift']());}}}(a50_0x456f,0x64588));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';function a50_0x5ba7(_0x34ff9f,_0x281f70){const _0x456f36=a50_0x456f();return a50_0x5ba7=function(_0x5ba7d7,_0x5d0979){_0x5ba7d7=_0x5ba7d7-0x72;let _0xc67d4=_0x456f36[_0x5ba7d7];return _0xc67d4;},a50_0x5ba7(_0x34ff9f,_0x281f70);}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a50_0x456f(){const _0x33f5b5=['npx','utf8','9pPEGKk','message','lovrabet-dataset','✓\x20创建\x20mcp.json\x20配置文件','../../templates/rules/lovrabet_rules.mdc.tpl','info','parse','4ktqrnu','error','warn','4427434JjyHZX','未找到\x20appcode\x20配置','解析现有\x20mcp.json\x20失败','配置\x20Cursor\x20MCP\x20失败','复制\x20Cursor\x20Rules\x20文件','mcp-cursor','创建\x20.cursor/rules\x20目录','21lMlfbY','复制\x20Cursor\x20Rules\x20文件失败','配置\x20Cursor\x20MCP\x20成功','✓\x20更新\x20mcp.json\x20配置','\x0a✓\x20Cursor\x20MCP\x20配置成功!','url','appcode','env','mcp.json','错误:\x20配置失败:\x20','2578030GJcBLF','rules','154lPZcsY','\x20\x20-\x20AppCode:\x20','cwd','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','创建\x20.cursor\x20目录','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','157920jVFtNl','✓\x20创建\x20.cursor\x20目录:\x20','online','1644795itVJDM','.cursor','log','196446KXONBf','150954JhvxYG','lovrabet_rules.mdc','\x0a配置信息:','773416uOUPhH','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','exit','mcpServers'];a50_0x456f=function(){return _0x33f5b5;};return a50_0x456f();}import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0x41d4fe=a50_0x5ba7;try{const _0x296c70=process[_0x41d4fe(0x92)](),_0xc94bb5=resolve(_0x296c70,_0x41d4fe(0x9b)),_0x4ac284=resolve(_0xc94bb5,_0x41d4fe(0x8c)),_0x3cf17e=readConfig(),_0x1e7e4b=_0x3cf17e[_0x41d4fe(0x8a)]||_0x3cf17e['app'],_0x439480=_0x3cf17e[_0x41d4fe(0x8b)]||_0x41d4fe(0x99);!_0x1e7e4b&&(console['error']('错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置'),logger[_0x41d4fe(0x7b)](_0x41d4fe(0x82),_0x41d4fe(0x7e)),process['exit'](0x1));!existsSync(_0xc94bb5)&&(mkdirSync(_0xc94bb5,{'recursive':!![]}),logger[_0x41d4fe(0x78)](_0x41d4fe(0x82),_0x41d4fe(0x95),{'path':_0xc94bb5}),console['log'](_0x41d4fe(0x98)+_0xc94bb5));const _0xfa794c={'command':_0x41d4fe(0xa5),'args':['-y','@lovrabet/dataset-mcp-server'],'env':{'LOVRABET_APP_CODE':String(_0x1e7e4b),'LOVRABET_ENV':String(_0x439480)}};let _0xd8fa7c;if(existsSync(_0x4ac284))try{const _0x640df7=readFileSync(_0x4ac284,_0x41d4fe(0x72));_0xd8fa7c=JSON[_0x41d4fe(0x79)](_0x640df7),!_0xd8fa7c[_0x41d4fe(0xa4)]&&(_0xd8fa7c[_0x41d4fe(0xa4)]={}),_0xd8fa7c['mcpServers'][_0x41d4fe(0x75)]=_0xfa794c,logger[_0x41d4fe(0x78)]('mcp-cursor','更新现有\x20mcp.json\x20配置',{'path':_0x4ac284,'appcode':_0x1e7e4b,'env':_0x439480}),console['log'](_0x41d4fe(0x87));}catch(_0x248522){logger[_0x41d4fe(0x7b)]('mcp-cursor',_0x41d4fe(0x7f),{'error':_0x248522 instanceof Error?_0x248522['message']:String(_0x248522)}),console[_0x41d4fe(0x7b)]('错误:\x20解析现有\x20mcp.json\x20失败:\x20'+(_0x248522 instanceof Error?_0x248522['message']:String(_0x248522))),process[_0x41d4fe(0xa3)](0x1);}else _0xd8fa7c={'mcpServers':{'lovrabet-dataset':_0xfa794c}},logger[_0x41d4fe(0x78)](_0x41d4fe(0x82),'创建新的\x20mcp.json\x20配置',{'path':_0x4ac284,'appcode':_0x1e7e4b,'env':_0x439480}),console[_0x41d4fe(0x9c)](_0x41d4fe(0x76));writeFileSync(_0x4ac284,JSON['stringify'](_0xd8fa7c,null,0x2),{'encoding':'utf8'});const _0x1f7750=resolve(_0xc94bb5,_0x41d4fe(0x8f)),_0x38d606=resolve(_0x1f7750,_0x41d4fe(0x9f));if(!existsSync(_0x38d606))try{!existsSync(_0x1f7750)&&(mkdirSync(_0x1f7750,{'recursive':!![]}),logger[_0x41d4fe(0x78)](_0x41d4fe(0x82),_0x41d4fe(0x83),{'path':_0x1f7750}));const _0xbccd02=fileURLToPath(import.meta[_0x41d4fe(0x89)]),_0x1e81cb=dirname(_0xbccd02),_0x1decac=resolve(_0x1e81cb,_0x41d4fe(0x77));existsSync(_0x1decac)?(copyFileSync(_0x1decac,_0x38d606),logger[_0x41d4fe(0x78)](_0x41d4fe(0x82),_0x41d4fe(0x81),{'from':_0x1decac,'to':_0x38d606}),console['log'](_0x41d4fe(0x94))):logger[_0x41d4fe(0x7c)](_0x41d4fe(0x82),'Cursor\x20Rules\x20模板文件不存在',{'templatePath':_0x1decac});}catch(_0x4d09d5){logger[_0x41d4fe(0x7b)](_0x41d4fe(0x82),_0x41d4fe(0x85),{'error':_0x4d09d5 instanceof Error?_0x4d09d5[_0x41d4fe(0x74)]:String(_0x4d09d5)}),console[_0x41d4fe(0x7c)]('警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20'+(_0x4d09d5 instanceof Error?_0x4d09d5[_0x41d4fe(0x74)]:String(_0x4d09d5)));}else console[_0x41d4fe(0x9c)](_0x41d4fe(0x96)),logger[_0x41d4fe(0x78)]('mcp-cursor','Cursor\x20Rules\x20文件已存在,跳过',{'path':_0x38d606});console[_0x41d4fe(0x9c)](_0x41d4fe(0x88)),console[_0x41d4fe(0x9c)](_0x41d4fe(0xa0)),console[_0x41d4fe(0x9c)](_0x41d4fe(0x91)+_0x1e7e4b),console[_0x41d4fe(0x9c)]('\x20\x20-\x20环境:\x20'+_0x439480),console[_0x41d4fe(0x9c)]('\x20\x20-\x20配置文件:\x20'+_0x4ac284),console[_0x41d4fe(0x9c)](_0x41d4fe(0x93)),console[_0x41d4fe(0x9c)](_0x41d4fe(0xa2)),logger[_0x41d4fe(0x78)]('mcp-cursor',_0x41d4fe(0x86),{'appcode':_0x1e7e4b,'env':_0x439480,'configPath':_0x4ac284}),process['exit'](0x0);}catch(_0x8f3d3c){logger[_0x41d4fe(0x7b)](_0x41d4fe(0x82),_0x41d4fe(0x80),{'error':_0x8f3d3c instanceof Error?_0x8f3d3c[_0x41d4fe(0x74)]:String(_0x8f3d3c)}),console[_0x41d4fe(0x7b)](_0x41d4fe(0x8d)+(_0x8f3d3c instanceof Error?_0x8f3d3c['message']:String(_0x8f3d3c))),process[_0x41d4fe(0xa3)](0x1);}}
package/lib/mcp/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x3252e6,_0x18316c){var _0x564726=a51_0x46d0,_0x33388b=_0x3252e6();while(!![]){try{var _0x1de46c=parseInt(_0x564726(0x1c3))/0x1*(parseInt(_0x564726(0x1c0))/0x2)+-parseInt(_0x564726(0x1c6))/0x3+-parseInt(_0x564726(0x1b5))/0x4+-parseInt(_0x564726(0x1b0))/0x5*(parseInt(_0x564726(0x1b2))/0x6)+-parseInt(_0x564726(0x1ca))/0x7*(parseInt(_0x564726(0x1af))/0x8)+-parseInt(_0x564726(0x1c9))/0x9+parseInt(_0x564726(0x1c1))/0xa*(parseInt(_0x564726(0x1b7))/0xb);if(_0x1de46c===_0x18316c)break;else _0x33388b['push'](_0x33388b['shift']());}catch(_0x3a727b){_0x33388b['push'](_0x33388b['shift']());}}}(a51_0x2cdf,0xec13d));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';export async function mcpCommand(_0x42cdd7){var _0x2d81cf=a51_0x46d0;logger[_0x2d81cf(0x1c8)](process[_0x2d81cf(0x1c5)]());if(!_0x42cdd7){console['error'](_0x2d81cf(0x1bd)),console[_0x2d81cf(0x1be)]('\x0a使用方法:'),console['log'](_0x2d81cf(0x1bc)),console[_0x2d81cf(0x1be)](_0x2d81cf(0x1b3)),console['log'](_0x2d81cf(0x1c4)),logger[_0x2d81cf(0x1bb)](_0x2d81cf(0x1b8),'未指定\x20IDE\x20类型'),process[_0x2d81cf(0x1bf)](0x1);return;}switch(_0x42cdd7[_0x2d81cf(0x1b4)]()){case _0x2d81cf(0x1b9):logger[_0x2d81cf(0x1b6)]('mcp',_0x2d81cf(0x1b1)),await configureCursorMcp();break;default:console['error']('错误:\x20不支持的\x20IDE\x20类型:\x20'+_0x42cdd7),console['log'](_0x2d81cf(0x1c7)),console[_0x2d81cf(0x1be)](_0x2d81cf(0x1ba)),logger[_0x2d81cf(0x1bb)](_0x2d81cf(0x1b8),_0x2d81cf(0x1c2)+_0x42cdd7),process[_0x2d81cf(0x1bf)](0x1);break;}}function a51_0x46d0(_0x782191,_0x459071){var _0x2cdf89=a51_0x2cdf();return a51_0x46d0=function(_0x46d003,_0x3675b0){_0x46d003=_0x46d003-0x1af;var _0x28c810=_0x2cdf89[_0x46d003];return _0x28c810;},a51_0x46d0(_0x782191,_0x459071);}function a51_0x2cdf(){var _0x2c01a6=['10cRArPa','不支持的\x20IDE\x20类型:\x20','1901HbcIRe','\x20\x20lovrabet\x20mcp\x20cursor','cwd','5056026zGzLov','\x0a当前支持的\x20IDE:','setLogPath','12625011RbXhHZ','42yKKzzm','225944iCQXxl','230dNKjWj','执行配置\x20Cursor\x20MCP\x20命令','120918jJPipN','\x0a示例:','toLowerCase','2771828XVaqcw','info','53855428gXymuz','mcp','cursor','\x20\x20-\x20cursor','error','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','错误:\x20请指定\x20IDE\x20类型','log','exit','998OfeJwK'];a51_0x2cdf=function(){return _0x2c01a6;};return a51_0x2cdf();}
1
+ function a51_0x1df5(){var _0x359eaf=['info','6223008munVAS','log','4410732BohUgQ','\x0a使用方法:','227046bMzGHo','3OjLNcj','\x0a示例:','执行配置\x20Cursor\x20MCP\x20命令','错误:\x20不支持的\x20IDE\x20类型:\x20','2809570viGcbq','cwd','8941572NzNwhw','3WKTmcW','\x0a当前支持的\x20IDE:','未指定\x20IDE\x20类型','\x20\x20lovrabet\x20mcp\x20cursor','mcp','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','不支持的\x20IDE\x20类型:\x20','\x20\x20-\x20cursor','36582670uhwAwy','error','setLogPath','错误:\x20请指定\x20IDE\x20类型','exit','8238072UMppdy','7mUNGyc'];a51_0x1df5=function(){return _0x359eaf;};return a51_0x1df5();}(function(_0x1d9e33,_0x189c81){var _0x826eb1=a51_0x4866,_0x44c3a6=_0x1d9e33();while(!![]){try{var _0x3d34d0=parseInt(_0x826eb1(0x135))/0x1*(parseInt(_0x826eb1(0x149))/0x2)+parseInt(_0x826eb1(0x14a))/0x3*(-parseInt(_0x826eb1(0x147))/0x4)+-parseInt(_0x826eb1(0x132))/0x5+-parseInt(_0x826eb1(0x142))/0x6*(parseInt(_0x826eb1(0x143))/0x7)+parseInt(_0x826eb1(0x145))/0x8+-parseInt(_0x826eb1(0x134))/0x9+parseInt(_0x826eb1(0x13d))/0xa;if(_0x3d34d0===_0x189c81)break;else _0x44c3a6['push'](_0x44c3a6['shift']());}catch(_0x432b1c){_0x44c3a6['push'](_0x44c3a6['shift']());}}}(a51_0x1df5,0xb607b));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';function a51_0x4866(_0x3c1e39,_0x5a21e7){var _0x1df5a5=a51_0x1df5();return a51_0x4866=function(_0x48669d,_0x504468){_0x48669d=_0x48669d-0x132;var _0x4f3ba9=_0x1df5a5[_0x48669d];return _0x4f3ba9;},a51_0x4866(_0x3c1e39,_0x5a21e7);}export async function mcpCommand(_0xc82282){var _0x321367=a51_0x4866;logger[_0x321367(0x13f)](process[_0x321367(0x133)]());if(!_0xc82282){console['error'](_0x321367(0x140)),console[_0x321367(0x146)](_0x321367(0x148)),console[_0x321367(0x146)](_0x321367(0x13a)),console[_0x321367(0x146)](_0x321367(0x14b)),console[_0x321367(0x146)](_0x321367(0x138)),logger[_0x321367(0x13e)](_0x321367(0x139),_0x321367(0x137)),process[_0x321367(0x141)](0x1);return;}switch(_0xc82282['toLowerCase']()){case'cursor':logger[_0x321367(0x144)](_0x321367(0x139),_0x321367(0x14c)),await configureCursorMcp();break;default:console[_0x321367(0x13e)](_0x321367(0x14d)+_0xc82282),console[_0x321367(0x146)](_0x321367(0x136)),console[_0x321367(0x146)](_0x321367(0x13c)),logger['error'](_0x321367(0x139),_0x321367(0x13b)+_0xc82282),process['exit'](0x1);break;}}
@@ -1 +1 @@
1
- const a52_0x4a3ee8=a52_0x3f76;(function(_0x5690ed,_0x1fb010){const _0x3c7d02=a52_0x3f76,_0x3e3cbd=_0x5690ed();while(!![]){try{const _0x36e8d5=-parseInt(_0x3c7d02(0x183))/0x1*(-parseInt(_0x3c7d02(0x18d))/0x2)+parseInt(_0x3c7d02(0x185))/0x3+parseInt(_0x3c7d02(0x182))/0x4+parseInt(_0x3c7d02(0x184))/0x5*(parseInt(_0x3c7d02(0x188))/0x6)+parseInt(_0x3c7d02(0x186))/0x7+-parseInt(_0x3c7d02(0x18b))/0x8+parseInt(_0x3c7d02(0x18a))/0x9*(-parseInt(_0x3c7d02(0x18c))/0xa);if(_0x36e8d5===_0x1fb010)break;else _0x3e3cbd['push'](_0x3e3cbd['shift']());}catch(_0x28cf43){_0x3e3cbd['push'](_0x3e3cbd['shift']());}}}(a52_0x4dcf,0x88fd6));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process['cwd'](),a52_0x4a3ee8(0x18f));function a52_0x4dcf(){const _0x12e885=['647658RkFLcv','2222661inJihz','app','6kvIlPH','utf8','18fFrNNL','6213792UGXcqh','5981770EPsCeb','2PziUyZ','parse','.lovrabetrc','trim','appcode','3623876TJeDtU','778761NGuEwq','1580245mWiGRQ'];a52_0x4dcf=function(){return _0x12e885;};return a52_0x4dcf();}export const globalConfigPath=resolve(homedir(),a52_0x4a3ee8(0x18f));export function readConfig(){const _0x3ac7e4=a52_0x4a3ee8;let _0x540368={};try{if(existsSync(globalConfigPath)){const _0x5b896b=readFileSync(globalConfigPath,{'encoding':_0x3ac7e4(0x189)});_0x5b896b&&(_0x540368=JSON[_0x3ac7e4(0x18e)](_0x5b896b));}}catch(_0x17ddd6){}try{if(existsSync(projectConfigPath)){const _0x2b9c89=readFileSync(projectConfigPath,{'encoding':_0x3ac7e4(0x189)});if(_0x2b9c89){const _0x2a670f=JSON[_0x3ac7e4(0x18e)](_0x2b9c89);_0x540368={..._0x540368,..._0x2a670f};}}}catch(_0x2409e8){}return _0x540368;}export function getConfigAppCode(){const _0x36bd69=a52_0x4a3ee8;let _0x45df0c={},_0x383650={};try{if(existsSync(globalConfigPath)){const _0x1a99ee=readFileSync(globalConfigPath,{'encoding':_0x36bd69(0x189)});_0x1a99ee&&(_0x383650=JSON['parse'](_0x1a99ee));}}catch(_0x1f6b36){}try{if(existsSync(projectConfigPath)){const _0x58fec8=readFileSync(projectConfigPath,{'encoding':_0x36bd69(0x189)});_0x58fec8&&(_0x45df0c=JSON[_0x36bd69(0x18e)](_0x58fec8));}}catch(_0xe59f21){}let _0x3cc60f;if(_0x36bd69(0x181)in _0x45df0c)_0x3cc60f=_0x45df0c['appcode'];else{if(_0x36bd69(0x187)in _0x45df0c)_0x3cc60f=_0x45df0c[_0x36bd69(0x187)];else{if('appcode'in _0x383650)_0x3cc60f=_0x383650[_0x36bd69(0x181)];else _0x36bd69(0x187)in _0x383650&&(_0x3cc60f=_0x383650[_0x36bd69(0x187)]);}}if(typeof _0x3cc60f!=='string'||_0x3cc60f[_0x36bd69(0x180)]()==='')return undefined;return _0x3cc60f;}function a52_0x3f76(_0x15a0fe,_0x47c9ee){const _0x4dcfac=a52_0x4dcf();return a52_0x3f76=function(_0x3f7652,_0x1cda85){_0x3f7652=_0x3f7652-0x180;let _0x1ea398=_0x4dcfac[_0x3f7652];return _0x1ea398;},a52_0x3f76(_0x15a0fe,_0x47c9ee);}export function isInProject(){return existsSync(projectConfigPath);}
1
+ const a52_0x2d8895=a52_0x1e57;function a52_0x1a15(){const _0x159f3c=['string','8lYbNEk','942957ryrAas','279823SlhORo','utf8','242242kXOERr','1347311apLJul','trim','482988QpPRqs','cwd','appcode','.lovrabetrc','app','123130MsMiSz','822984nqwENC','64wXygLQ','parse'];a52_0x1a15=function(){return _0x159f3c;};return a52_0x1a15();}(function(_0x219422,_0x1aa7a8){const _0x5f07b6=a52_0x1e57,_0x229e98=_0x219422();while(!![]){try{const _0x18f5f1=-parseInt(_0x5f07b6(0xbc))/0x1+-parseInt(_0x5f07b6(0xbe))/0x2+-parseInt(_0x5f07b6(0xc1))/0x3+-parseInt(_0x5f07b6(0xba))/0x4*(parseInt(_0x5f07b6(0xc6))/0x5)+parseInt(_0x5f07b6(0xc7))/0x6+-parseInt(_0x5f07b6(0xbf))/0x7+-parseInt(_0x5f07b6(0xc8))/0x8*(-parseInt(_0x5f07b6(0xbb))/0x9);if(_0x18f5f1===_0x1aa7a8)break;else _0x229e98['push'](_0x229e98['shift']());}catch(_0x47aa93){_0x229e98['push'](_0x229e98['shift']());}}}(a52_0x1a15,0x29ea3));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a52_0x2d8895(0xc2)](),a52_0x2d8895(0xc4));function a52_0x1e57(_0x1a00a4,_0x131c9c){const _0x1a158a=a52_0x1a15();return a52_0x1e57=function(_0x1e5763,_0x15de03){_0x1e5763=_0x1e5763-0xb9;let _0x2cf158=_0x1a158a[_0x1e5763];return _0x2cf158;},a52_0x1e57(_0x1a00a4,_0x131c9c);}export const globalConfigPath=resolve(homedir(),a52_0x2d8895(0xc4));export function readConfig(){const _0x4d18c8=a52_0x2d8895;let _0x1e77d8={};try{if(existsSync(globalConfigPath)){const _0xe7cb4e=readFileSync(globalConfigPath,{'encoding':_0x4d18c8(0xbd)});_0xe7cb4e&&(_0x1e77d8=JSON[_0x4d18c8(0xc9)](_0xe7cb4e));}}catch(_0x360e78){}try{if(existsSync(projectConfigPath)){const _0x48972c=readFileSync(projectConfigPath,{'encoding':_0x4d18c8(0xbd)});if(_0x48972c){const _0x4a00f2=JSON[_0x4d18c8(0xc9)](_0x48972c);_0x1e77d8={..._0x1e77d8,..._0x4a00f2};}}}catch(_0x3e0762){}return _0x1e77d8;}export function getConfigAppCode(){const _0x246255=a52_0x2d8895;let _0x18961b={},_0x2231a5={};try{if(existsSync(globalConfigPath)){const _0x1cfa58=readFileSync(globalConfigPath,{'encoding':_0x246255(0xbd)});_0x1cfa58&&(_0x2231a5=JSON['parse'](_0x1cfa58));}}catch(_0x1a33dd){}try{if(existsSync(projectConfigPath)){const _0x4db060=readFileSync(projectConfigPath,{'encoding':_0x246255(0xbd)});_0x4db060&&(_0x18961b=JSON[_0x246255(0xc9)](_0x4db060));}}catch(_0x4eedb4){}let _0x99b77c;if(_0x246255(0xc3)in _0x18961b)_0x99b77c=_0x18961b[_0x246255(0xc3)];else{if('app'in _0x18961b)_0x99b77c=_0x18961b[_0x246255(0xc5)];else{if(_0x246255(0xc3)in _0x2231a5)_0x99b77c=_0x2231a5[_0x246255(0xc3)];else _0x246255(0xc5)in _0x2231a5&&(_0x99b77c=_0x2231a5[_0x246255(0xc5)]);}}if(typeof _0x99b77c!==_0x246255(0xb9)||_0x99b77c[_0x246255(0xc0)]()==='')return undefined;return _0x99b77c;}export function isInProject(){return existsSync(projectConfigPath);}
@@ -1 +1 @@
1
- function a53_0x3438(_0x1e1cd2,_0x1028c6){const _0x513e09=a53_0x513e();return a53_0x3438=function(_0x34380e,_0x52810e){_0x34380e=_0x34380e-0x104;let _0x19e446=_0x513e09[_0x34380e];return _0x19e446;},a53_0x3438(_0x1e1cd2,_0x1028c6);}(function(_0x4ee964,_0xf242f){const _0x436ff4=a53_0x3438,_0x5de93b=_0x4ee964();while(!![]){try{const _0x3be472=-parseInt(_0x436ff4(0x104))/0x1*(parseInt(_0x436ff4(0x107))/0x2)+parseInt(_0x436ff4(0x10d))/0x3*(parseInt(_0x436ff4(0x106))/0x4)+-parseInt(_0x436ff4(0x115))/0x5*(-parseInt(_0x436ff4(0x114))/0x6)+-parseInt(_0x436ff4(0x109))/0x7*(parseInt(_0x436ff4(0x10a))/0x8)+-parseInt(_0x436ff4(0x113))/0x9+parseInt(_0x436ff4(0x10f))/0xa*(-parseInt(_0x436ff4(0x116))/0xb)+parseInt(_0x436ff4(0x10e))/0xc;if(_0x3be472===_0xf242f)break;else _0x5de93b['push'](_0x5de93b['shift']());}catch(_0x5dff87){_0x5de93b['push'](_0x5de93b['shift']());}}}(a53_0x513e,0x1b37e));function a53_0x513e(){const _0x391a61=['mkdirSync','isDirectory','2811XLQsKS','3498168MFNuuR','60uMCYIk','error','复制目录时出错:','name','422505BWbNXy','8688scZlVD','30hWayTP','193072ZJSqhS','1KlOKwo','readdirSync','484jLyOvF','211604GheMcU','join','7518uhQKyT','328crDIMw'];a53_0x513e=function(){return _0x391a61;};return a53_0x513e();}import a53_0x5816aa from'node:path';import a53_0x4e9fb2 from'node:fs';export async function copyDirectory(_0x8d4e6e,_0x1a49d8){const _0x2b82b6=a53_0x3438;try{const _0x56cce9=a53_0x4e9fb2[_0x2b82b6(0x105)](_0x8d4e6e,{'withFileTypes':!![]});a53_0x4e9fb2[_0x2b82b6(0x10b)](_0x1a49d8,{'recursive':!![]});for(const _0x492976 of _0x56cce9){const _0x2ff874=a53_0x5816aa[_0x2b82b6(0x108)](_0x8d4e6e,_0x492976[_0x2b82b6(0x112)]),_0x6de0bf=a53_0x5816aa[_0x2b82b6(0x108)](_0x1a49d8,_0x492976[_0x2b82b6(0x112)]);_0x492976[_0x2b82b6(0x10c)]()?await copyDirectory(_0x2ff874,_0x6de0bf):a53_0x4e9fb2['copyFileSync'](_0x2ff874,_0x6de0bf);}}catch(_0x2c5a7d){console[_0x2b82b6(0x110)](_0x2b82b6(0x111),_0x2c5a7d);}}
1
+ (function(_0x59526f,_0x52f3f9){const _0x32442b=a53_0x3185,_0x23f3d7=_0x59526f();while(!![]){try{const _0x20342e=-parseInt(_0x32442b(0x1fd))/0x1+-parseInt(_0x32442b(0x1f5))/0x2+-parseInt(_0x32442b(0x1f9))/0x3*(-parseInt(_0x32442b(0x1f3))/0x4)+-parseInt(_0x32442b(0x1ef))/0x5*(-parseInt(_0x32442b(0x200))/0x6)+-parseInt(_0x32442b(0x1f4))/0x7+-parseInt(_0x32442b(0x1fa))/0x8*(parseInt(_0x32442b(0x1fb))/0x9)+parseInt(_0x32442b(0x1f8))/0xa*(parseInt(_0x32442b(0x1f0))/0xb);if(_0x20342e===_0x52f3f9)break;else _0x23f3d7['push'](_0x23f3d7['shift']());}catch(_0x4787b5){_0x23f3d7['push'](_0x23f3d7['shift']());}}}(a53_0x33d8,0xcb21e));function a53_0x3185(_0x129f89,_0x477458){const _0x33d8fe=a53_0x33d8();return a53_0x3185=function(_0x318553,_0x87f576){_0x318553=_0x318553-0x1ef;let _0x191f30=_0x33d8fe[_0x318553];return _0x191f30;},a53_0x3185(_0x129f89,_0x477458);}import a53_0x2b36ba from'node:path';function a53_0x33d8(){const _0xd9742f=['213RbaQwW','139256FkUAbb','36wQTRPS','readdirSync','1281571ZUJmgT','copyFileSync','isDirectory','24918izlYZu','error','1400lnRISe','9911JVLMWi','name','mkdirSync','344KSiYer','10862838pgXjBF','2380304mYHRET','复制目录时出错:','join','41690sdDCyL'];a53_0x33d8=function(){return _0xd9742f;};return a53_0x33d8();}import a53_0x1455b7 from'node:fs';export async function copyDirectory(_0xa8f157,_0x3874b6){const _0x2d3ecd=a53_0x3185;try{const _0x50dcc1=a53_0x1455b7[_0x2d3ecd(0x1fc)](_0xa8f157,{'withFileTypes':!![]});a53_0x1455b7[_0x2d3ecd(0x1f2)](_0x3874b6,{'recursive':!![]});for(const _0x424ec6 of _0x50dcc1){const _0x42a5ca=a53_0x2b36ba[_0x2d3ecd(0x1f7)](_0xa8f157,_0x424ec6[_0x2d3ecd(0x1f1)]),_0x54227b=a53_0x2b36ba[_0x2d3ecd(0x1f7)](_0x3874b6,_0x424ec6['name']);_0x424ec6[_0x2d3ecd(0x1ff)]()?await copyDirectory(_0x42a5ca,_0x54227b):a53_0x1455b7[_0x2d3ecd(0x1fe)](_0x42a5ca,_0x54227b);}}catch(_0x54df75){console[_0x2d3ecd(0x201)](_0x2d3ecd(0x1f6),_0x54df75);}}
@@ -1 +1 @@
1
- (function(_0x40a2b8,_0x3d5b0b){const _0x3e73be=a54_0x3fe0,_0x5aee11=_0x40a2b8();while(!![]){try{const _0x4c614d=parseInt(_0x3e73be(0x16e))/0x1*(-parseInt(_0x3e73be(0x174))/0x2)+parseInt(_0x3e73be(0x17e))/0x3+-parseInt(_0x3e73be(0x178))/0x4+parseInt(_0x3e73be(0x188))/0x5+parseInt(_0x3e73be(0x189))/0x6+-parseInt(_0x3e73be(0x184))/0x7+parseInt(_0x3e73be(0x171))/0x8;if(_0x4c614d===_0x3d5b0b)break;else _0x5aee11['push'](_0x5aee11['shift']());}catch(_0x4573e7){_0x5aee11['push'](_0x5aee11['shift']());}}}(a54_0x2887,0x4608a));export async function httpRequest(_0x183edb,_0x2cd472={}){const _0x52cc47=a54_0x3fe0,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x2cd472;let _0x1d2104=null;for(let _0x2d2530=0x0;_0x2d2530<=retries;_0x2d2530++){try{const _0x55d370=new AbortController(),_0xba4e05=setTimeout(()=>_0x55d370[_0x52cc47(0x183)](),timeout),_0x27ea28=await fetch(_0x183edb,{'headers':headers,'signal':_0x55d370[_0x52cc47(0x185)]});clearTimeout(_0xba4e05);let _0x494287;const _0x43a31a=_0x27ea28[_0x52cc47(0x176)]['get'](_0x52cc47(0x186));return _0x43a31a?.[_0x52cc47(0x182)](_0x52cc47(0x180))?_0x494287=await _0x27ea28[_0x52cc47(0x181)]():_0x494287=await _0x27ea28[_0x52cc47(0x16d)](),{'ok':_0x27ea28['ok'],'status':_0x27ea28[_0x52cc47(0x17b)],'statusText':_0x27ea28[_0x52cc47(0x17a)],'data':_0x494287,'headers':_0x27ea28['headers'],'url':_0x27ea28[_0x52cc47(0x16f)],'text':()=>_0x27ea28[_0x52cc47(0x16d)]()};}catch(_0x4c6774){_0x1d2104=_0x4c6774 instanceof Error?_0x4c6774:new Error(String(_0x4c6774));if(_0x2d2530===retries)break;if(shouldRetry(_0x4c6774)){console[_0x52cc47(0x177)](_0x52cc47(0x170)+retryDelay+_0x52cc47(0x17d)+(_0x2d2530+0x1)+_0x52cc47(0x17f)),await sleep(retryDelay);continue;}else break;}}throw _0x1d2104||new Error('Request\x20failed');}function a54_0x3fe0(_0x47ad38,_0x147190){const _0x2887c3=a54_0x2887();return a54_0x3fe0=function(_0x3fe0b1,_0x19632a){_0x3fe0b1=_0x3fe0b1-0x16d;let _0x17bb55=_0x2887c3[_0x3fe0b1];return _0x17bb55;},a54_0x3fe0(_0x47ad38,_0x147190);}function shouldRetry(_0x17825a){const _0x193e1e=a54_0x3fe0;if(_0x17825a instanceof Error){if(_0x17825a[_0x193e1e(0x17c)]===_0x193e1e(0x187))return![];if(_0x17825a[_0x193e1e(0x17c)]===_0x193e1e(0x173)&&_0x17825a[_0x193e1e(0x175)][_0x193e1e(0x182)](_0x193e1e(0x172)))return!![];if(_0x17825a[_0x193e1e(0x175)][_0x193e1e(0x182)](_0x193e1e(0x18a)))return!![];if(_0x17825a[_0x193e1e(0x175)][_0x193e1e(0x182)](_0x193e1e(0x179)))return![];}return![];}function sleep(_0x3521ab){return new Promise(_0x598c0a=>setTimeout(_0x598c0a,_0x3521ab));}function a54_0x2887(){const _0x173619=['44326cGxUFt','url','*\x20请求失败,','5022136wjVOaH','fetch','TypeError','10zDTSVl','message','headers','log','1167468TuURrg','ENOTFOUND','statusText','status','name','ms\x20后进行第\x20','1697955vujxbe','\x20次重试...','application/json','json','includes','abort','3429090fWBaxL','signal','content-type','AbortError','147865dvvKTE','401400qoPOBl','ECONNRESET','text'];a54_0x2887=function(){return _0x173619;};return a54_0x2887();}export function validateUrl(_0x3a9a84){try{return new URL(_0x3a9a84),!![];}catch{return![];}}
1
+ (function(_0x3e3e75,_0x5adace){const _0x5dc82c=a54_0x24e0,_0xcbd41=_0x3e3e75();while(!![]){try{const _0x39311c=-parseInt(_0x5dc82c(0xc2))/0x1+parseInt(_0x5dc82c(0xcc))/0x2+parseInt(_0x5dc82c(0xc5))/0x3+-parseInt(_0x5dc82c(0xc1))/0x4*(-parseInt(_0x5dc82c(0xd6))/0x5)+-parseInt(_0x5dc82c(0xc7))/0x6*(-parseInt(_0x5dc82c(0xce))/0x7)+parseInt(_0x5dc82c(0xc3))/0x8+-parseInt(_0x5dc82c(0xcf))/0x9;if(_0x39311c===_0x5adace)break;else _0xcbd41['push'](_0xcbd41['shift']());}catch(_0x5c0add){_0xcbd41['push'](_0xcbd41['shift']());}}}(a54_0x3ca5,0x3547f));function a54_0x3ca5(){const _0x20a1ff=['150702vKHwJL','fetch','name','url','*\x20请求失败,','594882fEpVhC','get','70pAJqEo','8012457bCmWUl','text','abort','headers','AbortError','content-type','TypeError','1031170kIofwh','ENOTFOUND','signal','message','application/json','log','\x20次重试...','includes','4QWUBvb','248580JfYKGl','2085144eOwdHj','json','1024812YmIwva','Request\x20failed'];a54_0x3ca5=function(){return _0x20a1ff;};return a54_0x3ca5();}export async function httpRequest(_0x207c59,_0x155a43={}){const _0x521055=a54_0x24e0,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x155a43;let _0x40e4fc=null;for(let _0x4d7b77=0x0;_0x4d7b77<=retries;_0x4d7b77++){try{const _0x1e8b06=new AbortController(),_0x275009=setTimeout(()=>_0x1e8b06[_0x521055(0xd1)](),timeout),_0x41a349=await fetch(_0x207c59,{'headers':headers,'signal':_0x1e8b06[_0x521055(0xbb)]});clearTimeout(_0x275009);let _0x1b46db;const _0x479d1e=_0x41a349[_0x521055(0xd2)][_0x521055(0xcd)](_0x521055(0xd4));return _0x479d1e?.['includes'](_0x521055(0xbd))?_0x1b46db=await _0x41a349[_0x521055(0xc4)]():_0x1b46db=await _0x41a349[_0x521055(0xd0)](),{'ok':_0x41a349['ok'],'status':_0x41a349['status'],'statusText':_0x41a349['statusText'],'data':_0x1b46db,'headers':_0x41a349['headers'],'url':_0x41a349[_0x521055(0xca)],'text':()=>_0x41a349[_0x521055(0xd0)]()};}catch(_0x55392b){_0x40e4fc=_0x55392b instanceof Error?_0x55392b:new Error(String(_0x55392b));if(_0x4d7b77===retries)break;if(shouldRetry(_0x55392b)){console[_0x521055(0xbe)](_0x521055(0xcb)+retryDelay+'ms\x20后进行第\x20'+(_0x4d7b77+0x1)+_0x521055(0xbf)),await sleep(retryDelay);continue;}else break;}}throw _0x40e4fc||new Error(_0x521055(0xc6));}function shouldRetry(_0x302331){const _0x133572=a54_0x24e0;if(_0x302331 instanceof Error){if(_0x302331[_0x133572(0xc9)]===_0x133572(0xd3))return![];if(_0x302331[_0x133572(0xc9)]===_0x133572(0xd5)&&_0x302331[_0x133572(0xbc)][_0x133572(0xc0)](_0x133572(0xc8)))return!![];if(_0x302331[_0x133572(0xbc)][_0x133572(0xc0)]('ECONNRESET'))return!![];if(_0x302331[_0x133572(0xbc)]['includes'](_0x133572(0xd7)))return![];}return![];}function sleep(_0x117449){return new Promise(_0x21f3d3=>setTimeout(_0x21f3d3,_0x117449));}function a54_0x24e0(_0x430ee3,_0x199917){const _0x3ca509=a54_0x3ca5();return a54_0x24e0=function(_0x24e039,_0x3adef3){_0x24e039=_0x24e039-0xbb;let _0x23b1bc=_0x3ca509[_0x24e039];return _0x23b1bc;},a54_0x24e0(_0x430ee3,_0x199917);}export function validateUrl(_0x1e3ee8){try{return new URL(_0x1e3ee8),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a55_0x39fda6=a55_0x5935;function a55_0x5935(_0x2fb947,_0x655493){const _0x15ff39=a55_0x15ff();return a55_0x5935=function(_0x593518,_0x5a7352){_0x593518=_0x593518-0x170;let _0xeed034=_0x15ff39[_0x593518];return _0xeed034;},a55_0x5935(_0x2fb947,_0x655493);}(function(_0x35b772,_0x18c64e){const _0x147b1b=a55_0x5935,_0x1c47fa=_0x35b772();while(!![]){try{const _0x1820d1=-parseInt(_0x147b1b(0x187))/0x1+-parseInt(_0x147b1b(0x188))/0x2*(parseInt(_0x147b1b(0x1a3))/0x3)+parseInt(_0x147b1b(0x178))/0x4*(-parseInt(_0x147b1b(0x177))/0x5)+parseInt(_0x147b1b(0x1a7))/0x6*(parseInt(_0x147b1b(0x1a5))/0x7)+-parseInt(_0x147b1b(0x19e))/0x8*(-parseInt(_0x147b1b(0x1a6))/0x9)+parseInt(_0x147b1b(0x1a1))/0xa+parseInt(_0x147b1b(0x19d))/0xb*(parseInt(_0x147b1b(0x172))/0xc);if(_0x1820d1===_0x18c64e)break;else _0x1c47fa['push'](_0x1c47fa['shift']());}catch(_0xae69e2){_0x1c47fa['push'](_0x1c47fa['shift']());}}}(a55_0x15ff,0x2ebf3));import a55_0x3499d5 from'winston';import a55_0x26280f from'node:fs';import a55_0x41b3b3 from'node:path';function a55_0x15ff(){const _0x532d0f=['rawCommand','Failed\x20to\x20clear\x20logs:','transports','errors','readFileSync','.lovrabet.log','unknown','level','logFilePath','209727muDGJG','2eaeVTD','initWinstonLogger','timestamp','Failed\x20to\x20read\x20logs:','logTask','format','log','dirname','success','now','split','duration','info','File','yellow','trim','winstonLogger','filter','writeFileSync','parse','warn','330mfJylP','1160104OSLziu','addColors','开始执行:\x20','2523610RRNQfu','blue','658311IQsgki','utf8','7eVAxFL','9TmlSwc','1855758JccdOz','readLogs','existsSync','5892QJQKix','error','完成:\x20','stringify','clearLogs','105Oeskcv','19192PJxZdn','message','combine','失败:\x20','createLogger','currentRawCommand'];a55_0x15ff=function(){return _0x532d0f;};return a55_0x15ff();}class Logger{['winstonLogger'];[a55_0x39fda6(0x186)];[a55_0x39fda6(0x17d)]='';constructor(){const _0x13cb88=a55_0x39fda6;this[_0x13cb88(0x186)]='';}['setRawCommand'](_0x2fab2c){const _0x2f622f=a55_0x39fda6;this[_0x2f622f(0x17d)]=_0x2fab2c;}[a55_0x39fda6(0x189)](){const _0x200416=a55_0x39fda6,_0xa7f1ba=a55_0x41b3b3[_0x200416(0x18f)](this[_0x200416(0x186)]);!a55_0x26280f[_0x200416(0x171)](_0xa7f1ba)&&a55_0x26280f['mkdirSync'](_0xa7f1ba,{'recursive':!![]});const _0x55a9ea=a55_0x3499d5['format'][_0x200416(0x17a)](a55_0x3499d5[_0x200416(0x18d)][_0x200416(0x18a)](),a55_0x3499d5[_0x200416(0x18d)][_0x200416(0x181)]({'stack':!![]}),a55_0x3499d5[_0x200416(0x18d)]['printf'](_0x1da62a=>{const _0x1dbcbd=_0x200416,_0x3cfd65={'timestamp':_0x1da62a['timestamp']||new Date()['toISOString'](),'level':_0x1da62a[_0x1dbcbd(0x185)]||_0x1dbcbd(0x194),'command':_0x1da62a['command']||_0x1dbcbd(0x184),'rawCommand':_0x1da62a[_0x1dbcbd(0x17e)]||this[_0x1dbcbd(0x17d)]||undefined,'message':_0x1da62a[_0x1dbcbd(0x179)]||'','duration':_0x1da62a[_0x1dbcbd(0x193)]||undefined,'details':_0x1da62a['details']||undefined};return JSON[_0x1dbcbd(0x175)](_0x3cfd65);}));this[_0x200416(0x198)]=a55_0x3499d5[_0x200416(0x17c)]({'level':'info','format':_0x55a9ea,'transports':[new a55_0x3499d5[(_0x200416(0x180))][(_0x200416(0x195))]({'filename':this[_0x200416(0x186)],'level':_0x200416(0x194)})],'silent':![]}),a55_0x3499d5[_0x200416(0x19f)]({'success':'green','error':'red','warn':_0x200416(0x196),'info':_0x200416(0x1a2)});}['setLogPath'](_0x296603){const _0x1330c7=a55_0x39fda6;this[_0x1330c7(0x186)]=a55_0x41b3b3['join'](_0x296603,_0x1330c7(0x183)),this[_0x1330c7(0x198)]&&this[_0x1330c7(0x198)]['clear'](),this[_0x1330c7(0x189)]();}[a55_0x39fda6(0x194)](_0x2e308b,_0x43cd32,_0x71c37e){const _0x4e590e=a55_0x39fda6;if(!this[_0x4e590e(0x186)]||!this[_0x4e590e(0x198)])return;this['winstonLogger'][_0x4e590e(0x194)](_0x43cd32,{'command':_0x2e308b,'details':_0x71c37e});}[a55_0x39fda6(0x190)](_0x1634b9,_0x3fd718,_0xa0cecd,_0x26b3be){const _0x582141=a55_0x39fda6;if(!this[_0x582141(0x186)]||!this[_0x582141(0x198)])return;this[_0x582141(0x198)][_0x582141(0x18e)](_0x582141(0x194),_0x3fd718,{'level':'success','command':_0x1634b9,'duration':_0xa0cecd,'details':_0x26b3be});}[a55_0x39fda6(0x173)](_0x461cbf,_0x1f0597,_0x1082d0){const _0x2d207e=a55_0x39fda6;if(!this[_0x2d207e(0x186)]||!this[_0x2d207e(0x198)])return;this[_0x2d207e(0x198)][_0x2d207e(0x173)](_0x1f0597,{'command':_0x461cbf,'details':_0x1082d0});}[a55_0x39fda6(0x19c)](_0x415ce1,_0x26abc9,_0x1ed147){const _0x34d34c=a55_0x39fda6;if(!this[_0x34d34c(0x186)]||!this['winstonLogger'])return;this[_0x34d34c(0x198)][_0x34d34c(0x19c)](_0x26abc9,{'command':_0x415ce1,'details':_0x1ed147});}async[a55_0x39fda6(0x18c)](_0x4eb6e2,_0x4e78bd,_0x1ef15c){const _0x49c7d5=a55_0x39fda6,_0x493b1e=Date[_0x49c7d5(0x191)]();this[_0x49c7d5(0x194)](_0x4eb6e2,_0x49c7d5(0x1a0)+_0x4e78bd);try{const _0x5b6133=await _0x1ef15c(),_0x5c7d51=Date['now']()-_0x493b1e;return this[_0x49c7d5(0x190)](_0x4eb6e2,_0x49c7d5(0x174)+_0x4e78bd,_0x5c7d51),_0x5b6133;}catch(_0x482286){const _0x5b5b0e=Date[_0x49c7d5(0x191)]()-_0x493b1e;this['error'](_0x4eb6e2,_0x49c7d5(0x17b)+_0x4e78bd,{'error':_0x482286 instanceof Error?_0x482286['message']:String(_0x482286),'duration':_0x5b5b0e});throw _0x482286;}}[a55_0x39fda6(0x170)](){const _0x4482fc=a55_0x39fda6;try{if(!a55_0x26280f[_0x4482fc(0x171)](this[_0x4482fc(0x186)]))return[];const _0x531b62=a55_0x26280f[_0x4482fc(0x182)](this[_0x4482fc(0x186)],_0x4482fc(0x1a4));return _0x531b62[_0x4482fc(0x192)]('\x0a')[_0x4482fc(0x199)](_0x23bcac=>_0x23bcac[_0x4482fc(0x197)]())['map'](_0x4c8656=>JSON[_0x4482fc(0x19b)](_0x4c8656));}catch(_0x2d71f0){return console[_0x4482fc(0x19c)](_0x4482fc(0x18b),_0x2d71f0),[];}}[a55_0x39fda6(0x176)](){const _0x5757fb=a55_0x39fda6;try{a55_0x26280f[_0x5757fb(0x171)](this[_0x5757fb(0x186)])&&a55_0x26280f[_0x5757fb(0x19a)](this[_0x5757fb(0x186)],'','utf8');}catch(_0xde8e46){console[_0x5757fb(0x19c)](_0x5757fb(0x17f),_0xde8e46);}}['getWinstonInstance'](){const _0x3566ff=a55_0x39fda6;return this[_0x3566ff(0x198)];}}export const logger=new Logger();
1
+ const a55_0x5b468f=a55_0x67d9;(function(_0x350aa0,_0x3d6f7b){const _0x52de3b=a55_0x67d9,_0x4d5aaa=_0x350aa0();while(!![]){try{const _0x91bbbc=-parseInt(_0x52de3b(0x1a0))/0x1+-parseInt(_0x52de3b(0x1bb))/0x2+-parseInt(_0x52de3b(0x197))/0x3+-parseInt(_0x52de3b(0x1a2))/0x4+parseInt(_0x52de3b(0x18f))/0x5+parseInt(_0x52de3b(0x19b))/0x6*(-parseInt(_0x52de3b(0x1ac))/0x7)+parseInt(_0x52de3b(0x1c3))/0x8*(parseInt(_0x52de3b(0x18c))/0x9);if(_0x91bbbc===_0x3d6f7b)break;else _0x4d5aaa['push'](_0x4d5aaa['shift']());}catch(_0x4fd68c){_0x4d5aaa['push'](_0x4d5aaa['shift']());}}}(a55_0x1594,0xd24f7));import a55_0xeafb44 from'winston';import a55_0x584492 from'node:fs';import a55_0x1ec65a from'node:path';class Logger{[a55_0x5b468f(0x1ae)];[a55_0x5b468f(0x1a6)];[a55_0x5b468f(0x1b2)]='';constructor(){const _0x427dd3=a55_0x5b468f;this[_0x427dd3(0x1a6)]='';}[a55_0x5b468f(0x191)](_0x28891e){const _0x55f1bf=a55_0x5b468f;this[_0x55f1bf(0x1b2)]=_0x28891e;}[a55_0x5b468f(0x1a5)](){const _0xdd44e0=a55_0x5b468f,_0x5d2303=a55_0x1ec65a['dirname'](this[_0xdd44e0(0x1a6)]);!a55_0x584492['existsSync'](_0x5d2303)&&a55_0x584492[_0xdd44e0(0x198)](_0x5d2303,{'recursive':!![]});const _0x27e85b=a55_0xeafb44[_0xdd44e0(0x1b0)]['combine'](a55_0xeafb44['format'][_0xdd44e0(0x1b4)](),a55_0xeafb44[_0xdd44e0(0x1b0)]['errors']({'stack':!![]}),a55_0xeafb44[_0xdd44e0(0x1b0)][_0xdd44e0(0x19f)](_0x41d7ce=>{const _0x59730f=_0xdd44e0,_0x5d8afc={'timestamp':_0x41d7ce[_0x59730f(0x1b4)]||new Date()[_0x59730f(0x1c1)](),'level':_0x41d7ce[_0x59730f(0x1bd)]||'info','command':_0x41d7ce[_0x59730f(0x195)]||'unknown','rawCommand':_0x41d7ce[_0x59730f(0x1ab)]||this[_0x59730f(0x1b2)]||undefined,'message':_0x41d7ce[_0x59730f(0x19e)]||'','duration':_0x41d7ce['duration']||undefined,'details':_0x41d7ce[_0x59730f(0x1a1)]||undefined};return JSON[_0x59730f(0x19a)](_0x5d8afc);}));this[_0xdd44e0(0x1ae)]=a55_0xeafb44[_0xdd44e0(0x19d)]({'level':_0xdd44e0(0x1b9),'format':_0x27e85b,'transports':[new a55_0xeafb44[(_0xdd44e0(0x1c0))][(_0xdd44e0(0x1a4))]({'filename':this[_0xdd44e0(0x1a6)],'level':_0xdd44e0(0x1b9)})],'silent':![]}),a55_0xeafb44[_0xdd44e0(0x199)]({'success':_0xdd44e0(0x193),'error':_0xdd44e0(0x1b3),'warn':_0xdd44e0(0x1a3),'info':_0xdd44e0(0x18e)});}['setLogPath'](_0x674dc4){const _0x2b02d1=a55_0x5b468f;this[_0x2b02d1(0x1a6)]=a55_0x1ec65a[_0x2b02d1(0x1b5)](_0x674dc4,_0x2b02d1(0x1aa)),this[_0x2b02d1(0x1ae)]&&this[_0x2b02d1(0x1ae)][_0x2b02d1(0x1a8)](),this[_0x2b02d1(0x1a5)]();}[a55_0x5b468f(0x1b9)](_0x33582b,_0x272066,_0x507ce1){const _0x86ffbc=a55_0x5b468f;if(!this[_0x86ffbc(0x1a6)]||!this[_0x86ffbc(0x1ae)])return;this[_0x86ffbc(0x1ae)]['info'](_0x272066,{'command':_0x33582b,'details':_0x507ce1});}[a55_0x5b468f(0x194)](_0x261e89,_0x3c9f5c,_0x2b95e5,_0x15a50b){const _0x5b0f5f=a55_0x5b468f;if(!this[_0x5b0f5f(0x1a6)]||!this[_0x5b0f5f(0x1ae)])return;this[_0x5b0f5f(0x1ae)]['log']('info',_0x3c9f5c,{'level':'success','command':_0x261e89,'duration':_0x2b95e5,'details':_0x15a50b});}[a55_0x5b468f(0x1a9)](_0x58698d,_0x30c17a,_0x2d6903){const _0x8168e1=a55_0x5b468f;if(!this[_0x8168e1(0x1a6)]||!this[_0x8168e1(0x1ae)])return;this[_0x8168e1(0x1ae)][_0x8168e1(0x1a9)](_0x30c17a,{'command':_0x58698d,'details':_0x2d6903});}[a55_0x5b468f(0x1b8)](_0xe1b828,_0x5b1245,_0x2ee204){const _0xfa4b5d=a55_0x5b468f;if(!this['logFilePath']||!this[_0xfa4b5d(0x1ae)])return;this[_0xfa4b5d(0x1ae)][_0xfa4b5d(0x1b8)](_0x5b1245,{'command':_0xe1b828,'details':_0x2ee204});}async[a55_0x5b468f(0x1ba)](_0x26a711,_0x5714c6,_0x357bf0){const _0x1d562d=a55_0x5b468f,_0x46e4d5=Date[_0x1d562d(0x1b6)]();this[_0x1d562d(0x1b9)](_0x26a711,'开始执行:\x20'+_0x5714c6);try{const _0x5725bf=await _0x357bf0(),_0x3dcc44=Date[_0x1d562d(0x1b6)]()-_0x46e4d5;return this[_0x1d562d(0x194)](_0x26a711,_0x1d562d(0x190)+_0x5714c6,_0x3dcc44),_0x5725bf;}catch(_0x4e425f){const _0xb7524=Date[_0x1d562d(0x1b6)]()-_0x46e4d5;this[_0x1d562d(0x1a9)](_0x26a711,'失败:\x20'+_0x5714c6,{'error':_0x4e425f instanceof Error?_0x4e425f[_0x1d562d(0x19e)]:String(_0x4e425f),'duration':_0xb7524});throw _0x4e425f;}}[a55_0x5b468f(0x1b7)](){const _0x361e01=a55_0x5b468f;try{if(!a55_0x584492[_0x361e01(0x192)](this['logFilePath']))return[];const _0x21513a=a55_0x584492[_0x361e01(0x19c)](this['logFilePath'],_0x361e01(0x1a7));return _0x21513a[_0x361e01(0x18d)]('\x0a')[_0x361e01(0x1ad)](_0x4a9940=>_0x4a9940['trim']())[_0x361e01(0x1b1)](_0x2628fc=>JSON[_0x361e01(0x1be)](_0x2628fc));}catch(_0x1be175){return console[_0x361e01(0x1b8)](_0x361e01(0x196),_0x1be175),[];}}[a55_0x5b468f(0x1bc)](){const _0x5bcb63=a55_0x5b468f;try{a55_0x584492[_0x5bcb63(0x192)](this[_0x5bcb63(0x1a6)])&&a55_0x584492[_0x5bcb63(0x1c2)](this[_0x5bcb63(0x1a6)],'',_0x5bcb63(0x1a7));}catch(_0x5ef1e8){console[_0x5bcb63(0x1b8)](_0x5bcb63(0x1af),_0x5ef1e8);}}[a55_0x5b468f(0x1bf)](){return this['winstonLogger'];}}function a55_0x1594(){const _0x57a489=['3962368Vgbkji','yellow','File','initWinstonLogger','logFilePath','utf8','clear','error','.lovrabet.log','rawCommand','49hSWJgh','filter','winstonLogger','Failed\x20to\x20clear\x20logs:','format','map','currentRawCommand','red','timestamp','join','now','readLogs','warn','info','logTask','2396524ojKkTr','clearLogs','level','parse','getWinstonInstance','transports','toISOString','writeFileSync','112wjmQiP','3797487yqYcfa','split','blue','5002735luaOQd','完成:\x20','setRawCommand','existsSync','green','success','command','Failed\x20to\x20read\x20logs:','5015379vtJEhV','mkdirSync','addColors','stringify','449214ebFHTR','readFileSync','createLogger','message','printf','1661588FfABNi','details'];a55_0x1594=function(){return _0x57a489;};return a55_0x1594();}function a55_0x67d9(_0x1c44f4,_0x5f213f){const _0x159434=a55_0x1594();return a55_0x67d9=function(_0x67d973,_0x1c647d){_0x67d973=_0x67d973-0x18c;let _0x5cc295=_0x159434[_0x67d973];return _0x5cc295;},a55_0x67d9(_0x1c44f4,_0x5f213f);}export const logger=new Logger();
@@ -1 +1 @@
1
- const a56_0x1effa4=a56_0x372d;(function(_0x1ac1c0,_0x37d0ff){const _0x348b8e=a56_0x372d,_0x276b91=_0x1ac1c0();while(!![]){try{const _0x55663b=-parseInt(_0x348b8e(0x168))/0x1*(parseInt(_0x348b8e(0x170))/0x2)+parseInt(_0x348b8e(0x16b))/0x3+parseInt(_0x348b8e(0x157))/0x4+parseInt(_0x348b8e(0x16f))/0x5+parseInt(_0x348b8e(0x17f))/0x6*(-parseInt(_0x348b8e(0x155))/0x7)+parseInt(_0x348b8e(0x15b))/0x8*(parseInt(_0x348b8e(0x17b))/0x9)+parseInt(_0x348b8e(0x161))/0xa;if(_0x55663b===_0x37d0ff)break;else _0x276b91['push'](_0x276b91['shift']());}catch(_0x11679f){_0x276b91['push'](_0x276b91['shift']());}}}(a56_0x33bf,0xdb645));import a56_0x79d525 from'node:fs';import a56_0x5b6d26 from'node:path';import{logger}from'./logger.js';function a56_0x372d(_0xe746fc,_0x4480df){const _0x33bf33=a56_0x33bf();return a56_0x372d=function(_0x372d54,_0x1d0f78){_0x372d54=_0x372d54-0x153;let _0x33c46e=_0x33bf33[_0x372d54];return _0x33c46e;},a56_0x372d(_0xe746fc,_0x4480df);}function a56_0x33bf(){const _0xa3df62=['\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','2750384NhnSZW','\x20from\x20\x22../pages/','match','toUpperCase','5067064EfWimW','开始更新路由配置','index','import\x20','未找到路由配置的\x20children\x20数组','previewChanges','5766350NCpIjd','now','utf8','success','路由配置更新完成','charAt','writeFile','538wIiAqI','path:\x20\x22','existsSync','4235694bLMEEC','split','message','readFile','1751770IcFWvT','5270malKGT','error','lastIndexOf','includes','join','toLowerCase','slice','addRoute','addPageRoute','toComponentName','index.tsx','9YhNgIj','promises','map','addImport','1062TWwbmy','indexOf','路由文件不存在:\x20','length','router','routerFilePath','53137hlWIpe'];a56_0x33bf=function(){return _0xa3df62;};return a56_0x33bf();}export class RouterUpdater{['routerFilePath'];constructor(_0x6d9311){const _0x3fd142=a56_0x372d;this[_0x3fd142(0x154)]=a56_0x5b6d26[_0x3fd142(0x174)](_0x6d9311,'src',_0x3fd142(0x153),_0x3fd142(0x17a));}async[a56_0x1effa4(0x178)](_0x4bde01,_0x380d9c){const _0x5a2d42=a56_0x1effa4;if(!a56_0x79d525[_0x5a2d42(0x16a)](this[_0x5a2d42(0x154)]))throw new Error('路由文件不存在:\x20'+this[_0x5a2d42(0x154)]);const _0x4a4a32=Date[_0x5a2d42(0x162)]();logger['info']('router',_0x5a2d42(0x15c),{'pageName':_0x4bde01,'routePath':_0x380d9c,'file':this[_0x5a2d42(0x154)]});try{const _0x1998f9=await a56_0x79d525['promises']['readFile'](this['routerFilePath'],'utf8'),_0xef967d=this[_0x5a2d42(0x179)](_0x4bde01),_0x4c2702=this[_0x5a2d42(0x17e)](_0x1998f9,_0xef967d,_0x4bde01),_0x173a64=this[_0x5a2d42(0x177)](_0x4c2702,_0x380d9c,_0xef967d);await a56_0x79d525[_0x5a2d42(0x17c)][_0x5a2d42(0x167)](this[_0x5a2d42(0x154)],_0x173a64,_0x5a2d42(0x163));const _0x9327f8=Date[_0x5a2d42(0x162)]()-_0x4a4a32;logger[_0x5a2d42(0x164)](_0x5a2d42(0x153),_0x5a2d42(0x165),_0x9327f8,{'pageName':_0x4bde01,'routePath':_0x380d9c,'componentName':_0xef967d});}catch(_0x4be98a){const _0xbcd566=Date[_0x5a2d42(0x162)]()-_0x4a4a32;logger[_0x5a2d42(0x171)](_0x5a2d42(0x153),'路由配置更新失败',{'pageName':_0x4bde01,'routePath':_0x380d9c,'error':_0x4be98a instanceof Error?_0x4be98a[_0x5a2d42(0x16d)]:String(_0x4be98a),'duration':_0xbcd566});throw _0x4be98a;}}[a56_0x1effa4(0x179)](_0x208f8d){const _0x234ff5=a56_0x1effa4;return _0x208f8d[_0x234ff5(0x16c)]('-')[_0x234ff5(0x17d)](_0x252c77=>_0x252c77[_0x234ff5(0x166)](0x0)[_0x234ff5(0x15a)]()+_0x252c77[_0x234ff5(0x176)](0x1)[_0x234ff5(0x175)]())[_0x234ff5(0x174)]('');}[a56_0x1effa4(0x17e)](_0x9b99b5,_0x19309c,_0x2f63e7){const _0x3ce751=a56_0x1effa4,_0x5f5837=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x2af001=_0x9b99b5[_0x3ce751(0x159)](_0x5f5837)||[],_0xc349cb=_0x3ce751(0x15e)+_0x19309c+_0x3ce751(0x158)+_0x2f63e7+'\x22;';if(_0x9b99b5['includes'](_0xc349cb))return _0x9b99b5;if(_0x2af001[_0x3ce751(0x182)]>0x0){const _0x48f439=_0x2af001[_0x2af001['length']-0x1];if(_0x48f439){const _0x4892e4=_0x9b99b5[_0x3ce751(0x172)](_0x48f439),_0x3df430=_0x4892e4+_0x48f439[_0x3ce751(0x182)];return _0x9b99b5[_0x3ce751(0x176)](0x0,_0x3df430)+_0xc349cb+'\x0a'+_0x9b99b5[_0x3ce751(0x176)](_0x3df430);}}const _0x3a576e=_0x9b99b5[_0x3ce751(0x159)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x3a576e&&_0x3a576e[_0x3ce751(0x15d)]!==undefined){const _0x59b2b9=_0x3a576e[_0x3ce751(0x15d)]+_0x3a576e[0x0][_0x3ce751(0x182)];return _0x9b99b5[_0x3ce751(0x176)](0x0,_0x59b2b9)+_0xc349cb+'\x0a'+_0x9b99b5[_0x3ce751(0x176)](_0x59b2b9);}return _0x9b99b5;}['addRoute'](_0x346c29,_0x37d661,_0x56def1){const _0xfd2082=a56_0x1effa4,_0x258aa8='\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'+_0x37d661+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<'+_0x56def1+_0xfd2082(0x156);if(_0x346c29[_0xfd2082(0x173)](_0xfd2082(0x169)+_0x37d661+'\x22'))return _0x346c29;const _0x5ec5cc=/children:\s*\[([\s\S]*?)\]/,_0x126f72=_0x346c29[_0xfd2082(0x159)](_0x5ec5cc);if(!_0x126f72||_0x126f72[_0xfd2082(0x15d)]===undefined)throw new Error(_0xfd2082(0x15f));const _0x274ccc=_0x126f72[0x1],_0x28f189=_0x126f72[_0xfd2082(0x15d)]+_0x126f72[0x0][_0xfd2082(0x180)]('[')+0x1,_0x59ab76=_0x274ccc?.[_0xfd2082(0x159)](/\{[\s\S]*?\},/g)||[];if(_0x59ab76[_0xfd2082(0x182)]>0x0){const _0xf21d5c=_0x59ab76[_0x59ab76[_0xfd2082(0x182)]-0x1];if(_0xf21d5c){const _0x40a22b=_0x346c29['lastIndexOf'](_0xf21d5c),_0x15291b=_0x40a22b+_0xf21d5c['length'];return _0x346c29[_0xfd2082(0x176)](0x0,_0x15291b)+'\x0a'+_0x258aa8+_0x346c29[_0xfd2082(0x176)](_0x15291b);}}return _0x346c29['slice'](0x0,_0x28f189)+'\x0a'+_0x258aa8+_0x346c29[_0xfd2082(0x176)](_0x28f189);}async[a56_0x1effa4(0x160)](_0x48784a,_0x3c5cce){const _0x2cdad9=a56_0x1effa4;if(!a56_0x79d525[_0x2cdad9(0x16a)](this['routerFilePath']))throw new Error(_0x2cdad9(0x181)+this[_0x2cdad9(0x154)]);const _0x389a5d=await a56_0x79d525['promises'][_0x2cdad9(0x16e)](this[_0x2cdad9(0x154)],_0x2cdad9(0x163)),_0x4a9f00=this[_0x2cdad9(0x179)](_0x48784a);let _0x577df0=this[_0x2cdad9(0x17e)](_0x389a5d,_0x4a9f00,_0x48784a);return _0x577df0=this[_0x2cdad9(0x177)](_0x577df0,_0x3c5cce,_0x4a9f00),_0x577df0;}}
1
+ const a56_0x2ef250=a56_0x3cdd;function a56_0x4b61(){const _0x40a68f=['readFile','530360ttgLOG','promises','6bFKLWQ','22978EAEybN','existsSync','error','addImport','routerFilePath','now','toUpperCase','2pMGAMZ','map','addRoute','toComponentName','toLowerCase','\x20from\x20\x22../pages/','utf8','921305mXhSGl','match','路由配置更新完成','50TTClCv','charAt','split','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','addPageRoute','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','import\x20','success','885447lCUrPq','开始更新路由配置','377856rVBGqh','join','路由文件不存在:\x20','slice','路由配置更新失败','previewChanges','length','includes','未找到路由配置的\x20children\x20数组','1045268wpxinM','src','router','index','483606QEYJgq'];a56_0x4b61=function(){return _0x40a68f;};return a56_0x4b61();}(function(_0x4bd976,_0x4512f9){const _0x55ca12=a56_0x3cdd,_0x4c93a5=_0x4bd976();while(!![]){try{const _0x2dd701=-parseInt(_0x55ca12(0x17c))/0x1*(-parseInt(_0x55ca12(0x175))/0x2)+-parseInt(_0x55ca12(0x170))/0x3+parseInt(_0x55ca12(0x172))/0x4+-parseInt(_0x55ca12(0x183))/0x5*(parseInt(_0x55ca12(0x174))/0x6)+-parseInt(_0x55ca12(0x16c))/0x7+-parseInt(_0x55ca12(0x163))/0x8+-parseInt(_0x55ca12(0x161))/0x9*(-parseInt(_0x55ca12(0x186))/0xa);if(_0x2dd701===_0x4512f9)break;else _0x4c93a5['push'](_0x4c93a5['shift']());}catch(_0x49efa2){_0x4c93a5['push'](_0x4c93a5['shift']());}}}(a56_0x4b61,0x19bf8));import a56_0x34d8a5 from'node:fs';import a56_0x3b0fe6 from'node:path';function a56_0x3cdd(_0x32732d,_0x243854){const _0x4b61bd=a56_0x4b61();return a56_0x3cdd=function(_0x3cdd21,_0x27e9c4){_0x3cdd21=_0x3cdd21-0x161;let _0x528e31=_0x4b61bd[_0x3cdd21];return _0x528e31;},a56_0x3cdd(_0x32732d,_0x243854);}import{logger}from'./logger.js';export class RouterUpdater{[a56_0x2ef250(0x179)];constructor(_0x36edfb){const _0x4ba485=a56_0x2ef250;this[_0x4ba485(0x179)]=a56_0x3b0fe6[_0x4ba485(0x164)](_0x36edfb,_0x4ba485(0x16d),_0x4ba485(0x16e),'index.tsx');}async[a56_0x2ef250(0x18a)](_0x5dcd98,_0x1e9edb){const _0x4ca219=a56_0x2ef250;if(!a56_0x34d8a5['existsSync'](this[_0x4ca219(0x179)]))throw new Error(_0x4ca219(0x165)+this[_0x4ca219(0x179)]);const _0x2c5ef6=Date[_0x4ca219(0x17a)]();logger['info'](_0x4ca219(0x16e),_0x4ca219(0x162),{'pageName':_0x5dcd98,'routePath':_0x1e9edb,'file':this[_0x4ca219(0x179)]});try{const _0x1176bb=await a56_0x34d8a5['promises'][_0x4ca219(0x171)](this['routerFilePath'],_0x4ca219(0x182)),_0x15e490=this[_0x4ca219(0x17f)](_0x5dcd98),_0x25e8a1=this[_0x4ca219(0x178)](_0x1176bb,_0x15e490,_0x5dcd98),_0x105a74=this['addRoute'](_0x25e8a1,_0x1e9edb,_0x15e490);await a56_0x34d8a5[_0x4ca219(0x173)]['writeFile'](this[_0x4ca219(0x179)],_0x105a74,_0x4ca219(0x182));const _0xe3b378=Date[_0x4ca219(0x17a)]()-_0x2c5ef6;logger[_0x4ca219(0x18d)]('router',_0x4ca219(0x185),_0xe3b378,{'pageName':_0x5dcd98,'routePath':_0x1e9edb,'componentName':_0x15e490});}catch(_0x585414){const _0x1abd06=Date[_0x4ca219(0x17a)]()-_0x2c5ef6;logger[_0x4ca219(0x177)](_0x4ca219(0x16e),_0x4ca219(0x167),{'pageName':_0x5dcd98,'routePath':_0x1e9edb,'error':_0x585414 instanceof Error?_0x585414['message']:String(_0x585414),'duration':_0x1abd06});throw _0x585414;}}[a56_0x2ef250(0x17f)](_0x32456f){const _0x3480cc=a56_0x2ef250;return _0x32456f[_0x3480cc(0x188)]('-')[_0x3480cc(0x17d)](_0xe7d78e=>_0xe7d78e[_0x3480cc(0x187)](0x0)[_0x3480cc(0x17b)]()+_0xe7d78e[_0x3480cc(0x166)](0x1)[_0x3480cc(0x180)]())[_0x3480cc(0x164)]('');}[a56_0x2ef250(0x178)](_0x271fab,_0x35d8cb,_0x14fe2a){const _0x4b8a9b=a56_0x2ef250,_0x550fb0=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x110379=_0x271fab[_0x4b8a9b(0x184)](_0x550fb0)||[],_0x484181=_0x4b8a9b(0x18c)+_0x35d8cb+_0x4b8a9b(0x181)+_0x14fe2a+'\x22;';if(_0x271fab[_0x4b8a9b(0x16a)](_0x484181))return _0x271fab;if(_0x110379['length']>0x0){const _0x243cdb=_0x110379[_0x110379['length']-0x1];if(_0x243cdb){const _0x342de3=_0x271fab['lastIndexOf'](_0x243cdb),_0x44c822=_0x342de3+_0x243cdb[_0x4b8a9b(0x169)];return _0x271fab[_0x4b8a9b(0x166)](0x0,_0x44c822)+_0x484181+'\x0a'+_0x271fab['slice'](_0x44c822);}}const _0x371386=_0x271fab['match'](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x371386&&_0x371386[_0x4b8a9b(0x16f)]!==undefined){const _0x9f5b0a=_0x371386[_0x4b8a9b(0x16f)]+_0x371386[0x0][_0x4b8a9b(0x169)];return _0x271fab['slice'](0x0,_0x9f5b0a)+_0x484181+'\x0a'+_0x271fab[_0x4b8a9b(0x166)](_0x9f5b0a);}return _0x271fab;}['addRoute'](_0x1a0206,_0x5ed083,_0xea23b){const _0x32c754=a56_0x2ef250,_0x555e13=_0x32c754(0x18b)+_0x5ed083+_0x32c754(0x189)+_0xea23b+'\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},';if(_0x1a0206['includes']('path:\x20\x22'+_0x5ed083+'\x22'))return _0x1a0206;const _0x1c324c=/children:\s*\[([\s\S]*?)\]/,_0x2c91c1=_0x1a0206[_0x32c754(0x184)](_0x1c324c);if(!_0x2c91c1||_0x2c91c1[_0x32c754(0x16f)]===undefined)throw new Error(_0x32c754(0x16b));const _0x1bf9dc=_0x2c91c1[0x1],_0x12b966=_0x2c91c1[_0x32c754(0x16f)]+_0x2c91c1[0x0]['indexOf']('[')+0x1,_0x1a3b8b=_0x1bf9dc?.[_0x32c754(0x184)](/\{[\s\S]*?\},/g)||[];if(_0x1a3b8b['length']>0x0){const _0x277fe6=_0x1a3b8b[_0x1a3b8b[_0x32c754(0x169)]-0x1];if(_0x277fe6){const _0x39b19d=_0x1a0206['lastIndexOf'](_0x277fe6),_0x17365a=_0x39b19d+_0x277fe6[_0x32c754(0x169)];return _0x1a0206[_0x32c754(0x166)](0x0,_0x17365a)+'\x0a'+_0x555e13+_0x1a0206[_0x32c754(0x166)](_0x17365a);}}return _0x1a0206[_0x32c754(0x166)](0x0,_0x12b966)+'\x0a'+_0x555e13+_0x1a0206[_0x32c754(0x166)](_0x12b966);}async[a56_0x2ef250(0x168)](_0x18e045,_0x4c5385){const _0x12a6cf=a56_0x2ef250;if(!a56_0x34d8a5[_0x12a6cf(0x176)](this[_0x12a6cf(0x179)]))throw new Error('路由文件不存在:\x20'+this[_0x12a6cf(0x179)]);const _0xae884e=await a56_0x34d8a5[_0x12a6cf(0x173)][_0x12a6cf(0x171)](this['routerFilePath'],_0x12a6cf(0x182)),_0x74fa0d=this[_0x12a6cf(0x17f)](_0x18e045);let _0x47f4af=this[_0x12a6cf(0x178)](_0xae884e,_0x74fa0d,_0x18e045);return _0x47f4af=this[_0x12a6cf(0x17e)](_0x47f4af,_0x4c5385,_0x74fa0d),_0x47f4af;}}
@@ -1 +1 @@
1
- export function sleep(_0x271e98){return new Promise(_0x820baa=>setTimeout(_0x820baa,_0x271e98));}
1
+ export function sleep(_0x5db0ba){return new Promise(_0x57dcc2=>setTimeout(_0x57dcc2,_0x5db0ba));}
@@ -1 +1 @@
1
- const a58_0x3a6a16=a58_0x2968;(function(_0x1174bf,_0x35e45b){const _0x3e6eea=a58_0x2968,_0x51ce77=_0x1174bf();while(!![]){try{const _0x4d0558=parseInt(_0x3e6eea(0xa7))/0x1+parseInt(_0x3e6eea(0xb1))/0x2+-parseInt(_0x3e6eea(0xc2))/0x3+parseInt(_0x3e6eea(0x97))/0x4*(parseInt(_0x3e6eea(0xad))/0x5)+-parseInt(_0x3e6eea(0x9f))/0x6+-parseInt(_0x3e6eea(0xb0))/0x7+-parseInt(_0x3e6eea(0xa0))/0x8;if(_0x4d0558===_0x35e45b)break;else _0x51ce77['push'](_0x51ce77['shift']());}catch(_0x27b6a4){_0x51ce77['push'](_0x51ce77['shift']());}}}(a58_0x3040,0x1f77b));import a58_0x4b588b from'node:fs';function a58_0x2968(_0xa0eee8,_0x26dd1a){const _0x3040e5=a58_0x3040();return a58_0x2968=function(_0x296890,_0x507967){_0x296890=_0x296890-0x92;let _0x1e7312=_0x3040e5[_0x296890];return _0x1e7312;},a58_0x2968(_0xa0eee8,_0x26dd1a);}import a58_0x245482 from'node:path';function a58_0x3040(){const _0x1f5aae=['toComponentName','slice','keys','.scss','map','toUpperCase','236537XymFRc','toDisplayTitle','模板内容替换失败','replace','now','.jsx','15byKQeM','processDirectory','toLocaleTimeString','177499pTNGDl','275916XwFlPx','charAt','info','.tsx','readdir','2-digit','endsWith','stringify','toLowerCase','isDirectory','.css','join','replaceApiContent','pop','error','split','promises','173580GQNEZN','success','toISOString','.tpl','processFile','name','api','模板内容替换完成','default','replaceContent','155468XiSVCU','toLocaleString','utf8','mkdir','processTemplate','numeric','template','extname','1293684YGDISU','506992QMLZlr'];a58_0x3040=function(){return _0x1f5aae;};return a58_0x3040();}import{logger}from'./logger.js';export class TemplateReplacer{static[a58_0x3a6a16(0xa1)](_0x37c744){const _0x180a37=a58_0x3a6a16,_0x13cb33=_0x37c744['split']('/')[_0x180a37(0xbe)]()||_0x37c744;return _0x13cb33[_0x180a37(0xc0)]('-')[_0x180a37(0xa5)](_0x19bd82=>_0x19bd82[_0x180a37(0xb2)](0x0)['toUpperCase']()+_0x19bd82[_0x180a37(0xa2)](0x1)[_0x180a37(0xb9)]())[_0x180a37(0xbc)]('');}static[a58_0x3a6a16(0xa8)](_0x5f8384){const _0x45584e=a58_0x3a6a16,_0x17b6e3=_0x5f8384[_0x45584e(0xc0)]('/')[_0x45584e(0xbe)]()||_0x5f8384;return _0x17b6e3[_0x45584e(0xc0)]('-')['map'](_0x2246c8=>_0x2246c8[_0x45584e(0xb2)](0x0)[_0x45584e(0xa6)]()+_0x2246c8[_0x45584e(0xa2)](0x1)['toLowerCase']())[_0x45584e(0xbc)]('\x20');}static['replaceContent'](_0x17ad59,_0x2f1303,_0x53d424){const _0x3afc1d=a58_0x3a6a16,_0x531934=this[_0x3afc1d(0xa1)](_0x2f1303),_0x134a90=this[_0x3afc1d(0xa8)](_0x2f1303),_0x5f2e53=new Date(),_0x127edf=_0x5f2e53[_0x3afc1d(0x98)](undefined,{'year':'numeric','month':_0x3afc1d(0xb6),'day':'2-digit','hour':_0x3afc1d(0xb6),'minute':'2-digit','second':_0x3afc1d(0xb6),'hour12':![]})[_0x3afc1d(0xaa)](/\//g,'-'),_0x3fd00c=_0x5f2e53['toLocaleDateString'](undefined,{'year':_0x3afc1d(0x9c),'month':_0x3afc1d(0xb6),'day':'2-digit'})[_0x3afc1d(0xaa)](/\//g,'-'),_0x33a900=_0x5f2e53[_0x3afc1d(0xaf)](undefined,{'hour12':![]});let _0x4688af=_0x17ad59['replace'](/\{ComponentName\}/g,_0x531934)[_0x3afc1d(0xaa)](/\{DisplayTitle\}/g,_0x134a90)[_0x3afc1d(0xaa)](/\{PageName\}/g,_0x2f1303)[_0x3afc1d(0xaa)](/\{TemplateName\}/g,_0x53d424)[_0x3afc1d(0xaa)](/\{CreatedAt\}/g,_0x127edf)[_0x3afc1d(0xaa)](/\{CreatedDate\}/g,_0x3fd00c)[_0x3afc1d(0xaa)](/\{CreatedTime\}/g,_0x33a900);return _0x4688af;}static[a58_0x3a6a16(0xbd)](_0x306c2a,_0x312b25,_0x42edc1,_0xccb6ff,_0x1dc03c,_0x3d9661,_0x2baf6d){const _0x13fadb=a58_0x3a6a16,_0x2a0025=new Date(),_0x11eb77=_0x2a0025[_0x13fadb(0xc4)](),_0x5e7132=JSON[_0x13fadb(0xb8)](_0x42edc1,null,0x2)['split']('\x0a')['slice'](0x1,-0x1)[_0x13fadb(0xa5)](_0x57f5f5=>_0x57f5f5[_0x13fadb(0xaa)](/^ /,'\x20\x20\x20\x20'))[_0x13fadb(0xbc)]('\x0a'),_0x68043e=_0xccb6ff||Object[_0x13fadb(0xa3)](_0x42edc1)[0x0]||'YourModel';let _0x40d1df=_0x306c2a[_0x13fadb(0xaa)](/\{AppCode\}/g,_0x312b25)['replace'](/\{ModelConfigs\}/g,_0x5e7132)[_0x13fadb(0xaa)](/\{ExampleModelName\}/g,_0x68043e)[_0x13fadb(0xaa)](/\{ApiFileName\}/g,_0x1dc03c||_0x13fadb(0x93))[_0x13fadb(0xaa)](/\{ConfigName\}/g,_0x3d9661||_0x13fadb(0x95))[_0x13fadb(0xaa)](/\{ClientConfigParam\}/g,_0x2baf6d||'')[_0x13fadb(0xaa)](/\{CreatedAt\}/g,_0x11eb77);return _0x40d1df;}static async[a58_0x3a6a16(0x9b)](_0xc77d47,_0x2d0093,_0x257604,_0x3d5d79,_0x354d4b=!![]){const _0x4cb2dc=a58_0x3a6a16,_0x2e430d=Date[_0x4cb2dc(0xab)]();try{_0x354d4b&&logger[_0x4cb2dc(0xb3)](_0x4cb2dc(0x9d),'开始处理模板内容替换',{'templatePath':_0xc77d47,'targetPath':_0x2d0093,'pageName':_0x257604,'templateName':_0x3d5d79});await a58_0x4b588b[_0x4cb2dc(0xc1)][_0x4cb2dc(0x9a)](_0x2d0093,{'recursive':!![]}),await this[_0x4cb2dc(0xae)](_0xc77d47,_0x2d0093,_0x257604,_0x3d5d79);if(_0x354d4b){const _0x49ff89=Date['now']()-_0x2e430d;logger[_0x4cb2dc(0xc3)]('template',_0x4cb2dc(0x94),_0x49ff89,{'pageName':_0x257604,'templateName':_0x3d5d79});}}catch(_0x28e20e){if(_0x354d4b){const _0x3ae020=Date[_0x4cb2dc(0xab)]()-_0x2e430d;logger[_0x4cb2dc(0xbf)](_0x4cb2dc(0x9d),_0x4cb2dc(0xa9),{'templatePath':_0xc77d47,'targetPath':_0x2d0093,'pageName':_0x257604,'templateName':_0x3d5d79,'error':_0x28e20e instanceof Error?_0x28e20e['message']:String(_0x28e20e),'duration':_0x3ae020});}throw _0x28e20e;}}static async[a58_0x3a6a16(0xae)](_0x11cb43,_0x22d091,_0x1ea08a,_0x35c5ce){const _0x5a13e8=a58_0x3a6a16,_0x59939e=await a58_0x4b588b[_0x5a13e8(0xc1)][_0x5a13e8(0xb5)](_0x11cb43,{'withFileTypes':!![]});for(const _0x5408b5 of _0x59939e){const _0x4ec497=a58_0x245482[_0x5a13e8(0xbc)](_0x11cb43,_0x5408b5[_0x5a13e8(0x92)]);let _0x3fdf84=a58_0x245482[_0x5a13e8(0xbc)](_0x22d091,_0x5408b5[_0x5a13e8(0x92)]);_0x5408b5[_0x5a13e8(0x92)][_0x5a13e8(0xb7)](_0x5a13e8(0xc5))&&(_0x3fdf84=a58_0x245482[_0x5a13e8(0xbc)](_0x22d091,_0x5408b5[_0x5a13e8(0x92)]['replace'](/\.tpl$/,'')));if(_0x5408b5[_0x5a13e8(0xba)]())await a58_0x4b588b[_0x5a13e8(0xc1)]['mkdir'](_0x3fdf84,{'recursive':!![]}),await this[_0x5a13e8(0xae)](_0x4ec497,_0x3fdf84,_0x1ea08a,_0x35c5ce);else _0x5408b5['isFile']()&&await this[_0x5a13e8(0xc6)](_0x4ec497,_0x3fdf84,_0x1ea08a,_0x35c5ce);}}static async[a58_0x3a6a16(0xc6)](_0x853eea,_0x351c2f,_0x3e062e,_0x1c38b6){const _0xeda825=a58_0x3a6a16,_0x31d15a=a58_0x245482[_0xeda825(0x9e)](_0x853eea)[_0xeda825(0xb9)]();_0x853eea[_0xeda825(0xb7)]('.tpl')&&(_0x351c2f=_0x351c2f[_0xeda825(0xaa)](/\.tpl$/,''));const _0x1d14ee=[_0xeda825(0xb4),'.ts',_0xeda825(0xac),'.js','.json','.md',_0xeda825(0xbb),_0xeda825(0xa4),_0xeda825(0xc5)];if(_0x1d14ee['includes'](_0x31d15a)||_0x853eea[_0xeda825(0xb7)](_0xeda825(0xc5))){const _0x229baa=await a58_0x4b588b[_0xeda825(0xc1)]['readFile'](_0x853eea,_0xeda825(0x99)),_0x2470b7=this[_0xeda825(0x96)](_0x229baa,_0x3e062e,_0x1c38b6);await a58_0x4b588b[_0xeda825(0xc1)]['writeFile'](_0x351c2f,_0x2470b7,_0xeda825(0x99));}else await a58_0x4b588b[_0xeda825(0xc1)]['copyFile'](_0x853eea,_0x351c2f);}}
1
+ const a58_0x181f98=a58_0x1412;function a58_0xbd26(){const _0x2342d8=['360580kPkiML','3BCeyws','模板内容替换完成','replaceApiContent','toLocaleDateString','78Yaxjer','mkdir','includes','.css','toLowerCase','keys','map','48zWCCJl','toDisplayTitle','6019536OmXJSI','join','4420uEYdwd','processTemplate','extname','.ts','api','2-digit','charAt','14113ZtgpZP','copyFile','readFile','utf8','writeFile','promises','replaceContent','name','toISOString','toLocaleString','196RXeorg','1YTPETR','toComponentName','YourModel','isFile','processDirectory','template','toLocaleTimeString','718442ljyUNF','slice','开始处理模板内容替换','toUpperCase','7488207KuxbWU','.jsx','success','isDirectory','numeric','137024vpOWfD','replace','.scss','endsWith','.json','3362356jiRDhG','split','now','.tpl','default','.tsx'];a58_0xbd26=function(){return _0x2342d8;};return a58_0xbd26();}function a58_0x1412(_0x24690f,_0x51a050){const _0xbd2689=a58_0xbd26();return a58_0x1412=function(_0x1412df,_0x3824a2){_0x1412df=_0x1412df-0xc1;let _0x205ddc=_0xbd2689[_0x1412df];return _0x205ddc;},a58_0x1412(_0x24690f,_0x51a050);}(function(_0x127b7f,_0x33459f){const _0x594653=a58_0x1412,_0x460dc0=_0x127b7f();while(!![]){try{const _0x472312=-parseInt(_0x594653(0xe9))/0x1*(parseInt(_0x594653(0xf0))/0x2)+parseInt(_0x594653(0xc8))/0x3*(-parseInt(_0x594653(0xc1))/0x4)+-parseInt(_0x594653(0xc7))/0x5*(-parseInt(_0x594653(0xd3))/0x6)+-parseInt(_0x594653(0xe8))/0x7*(parseInt(_0x594653(0xf9))/0x8)+-parseInt(_0x594653(0xf4))/0x9+parseInt(_0x594653(0xd7))/0xa*(-parseInt(_0x594653(0xde))/0xb)+-parseInt(_0x594653(0xd5))/0xc*(-parseInt(_0x594653(0xcc))/0xd);if(_0x472312===_0x33459f)break;else _0x460dc0['push'](_0x460dc0['shift']());}catch(_0x4a7790){_0x460dc0['push'](_0x460dc0['shift']());}}}(a58_0xbd26,0x7c121));import a58_0x25dcdd from'node:fs';import a58_0x54732c from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a58_0x181f98(0xea)](_0xb10a98){const _0x84af53=a58_0x181f98,_0x288f22=_0xb10a98[_0x84af53(0xc2)]('/')['pop']()||_0xb10a98;return _0x288f22[_0x84af53(0xc2)]('-')[_0x84af53(0xd2)](_0x3dd413=>_0x3dd413[_0x84af53(0xdd)](0x0)[_0x84af53(0xf3)]()+_0x3dd413['slice'](0x1)['toLowerCase']())['join']('');}static[a58_0x181f98(0xd4)](_0x268320){const _0x23b53c=a58_0x181f98,_0x2fcc75=_0x268320[_0x23b53c(0xc2)]('/')['pop']()||_0x268320;return _0x2fcc75[_0x23b53c(0xc2)]('-')[_0x23b53c(0xd2)](_0x399d05=>_0x399d05[_0x23b53c(0xdd)](0x0)[_0x23b53c(0xf3)]()+_0x399d05[_0x23b53c(0xf1)](0x1)[_0x23b53c(0xd0)]())[_0x23b53c(0xd6)]('\x20');}static[a58_0x181f98(0xe4)](_0x39f6c0,_0x165853,_0x40bcc0){const _0x2c89f6=a58_0x181f98,_0x5eb135=this['toComponentName'](_0x165853),_0x3e2b15=this[_0x2c89f6(0xd4)](_0x165853),_0x1609d3=new Date(),_0x4050b5=_0x1609d3[_0x2c89f6(0xe7)](undefined,{'year':_0x2c89f6(0xf8),'month':_0x2c89f6(0xdc),'day':_0x2c89f6(0xdc),'hour':_0x2c89f6(0xdc),'minute':'2-digit','second':'2-digit','hour12':![]})[_0x2c89f6(0xfa)](/\//g,'-'),_0x2be554=_0x1609d3[_0x2c89f6(0xcb)](undefined,{'year':_0x2c89f6(0xf8),'month':'2-digit','day':_0x2c89f6(0xdc)})[_0x2c89f6(0xfa)](/\//g,'-'),_0x2e404f=_0x1609d3[_0x2c89f6(0xef)](undefined,{'hour12':![]});let _0x53b098=_0x39f6c0[_0x2c89f6(0xfa)](/\{ComponentName\}/g,_0x5eb135)[_0x2c89f6(0xfa)](/\{DisplayTitle\}/g,_0x3e2b15)['replace'](/\{PageName\}/g,_0x165853)[_0x2c89f6(0xfa)](/\{TemplateName\}/g,_0x40bcc0)[_0x2c89f6(0xfa)](/\{CreatedAt\}/g,_0x4050b5)[_0x2c89f6(0xfa)](/\{CreatedDate\}/g,_0x2be554)[_0x2c89f6(0xfa)](/\{CreatedTime\}/g,_0x2e404f);return _0x53b098;}static[a58_0x181f98(0xca)](_0x24ff00,_0x1291a0,_0x141819,_0x3a7002,_0x1fe726,_0x21f7da,_0x5ee31b){const _0x5c038a=a58_0x181f98,_0x36115b=new Date(),_0x2fe14f=_0x36115b[_0x5c038a(0xe6)](),_0x3c1d3e=JSON['stringify'](_0x141819,null,0x2)[_0x5c038a(0xc2)]('\x0a')[_0x5c038a(0xf1)](0x1,-0x1)[_0x5c038a(0xd2)](_0x1f8a03=>_0x1f8a03[_0x5c038a(0xfa)](/^ /,'\x20\x20\x20\x20'))[_0x5c038a(0xd6)]('\x0a'),_0xb6eed9=_0x3a7002||Object[_0x5c038a(0xd1)](_0x141819)[0x0]||_0x5c038a(0xeb);let _0x403b88=_0x24ff00[_0x5c038a(0xfa)](/\{AppCode\}/g,_0x1291a0)[_0x5c038a(0xfa)](/\{ModelConfigs\}/g,_0x3c1d3e)['replace'](/\{ExampleModelName\}/g,_0xb6eed9)[_0x5c038a(0xfa)](/\{ApiFileName\}/g,_0x1fe726||_0x5c038a(0xdb))[_0x5c038a(0xfa)](/\{ConfigName\}/g,_0x21f7da||_0x5c038a(0xc5))[_0x5c038a(0xfa)](/\{ClientConfigParam\}/g,_0x5ee31b||'')['replace'](/\{CreatedAt\}/g,_0x2fe14f);return _0x403b88;}static async[a58_0x181f98(0xd8)](_0x58aa1c,_0x3e8664,_0x8ef161,_0x354e37,_0x515424=!![]){const _0x12fdc7=a58_0x181f98,_0x4742fa=Date[_0x12fdc7(0xc3)]();try{_0x515424&&logger['info'](_0x12fdc7(0xee),_0x12fdc7(0xf2),{'templatePath':_0x58aa1c,'targetPath':_0x3e8664,'pageName':_0x8ef161,'templateName':_0x354e37});await a58_0x25dcdd[_0x12fdc7(0xe3)][_0x12fdc7(0xcd)](_0x3e8664,{'recursive':!![]}),await this['processDirectory'](_0x58aa1c,_0x3e8664,_0x8ef161,_0x354e37);if(_0x515424){const _0x42678e=Date[_0x12fdc7(0xc3)]()-_0x4742fa;logger[_0x12fdc7(0xf6)](_0x12fdc7(0xee),_0x12fdc7(0xc9),_0x42678e,{'pageName':_0x8ef161,'templateName':_0x354e37});}}catch(_0x1d980f){if(_0x515424){const _0x1a1f8e=Date[_0x12fdc7(0xc3)]()-_0x4742fa;logger['error'](_0x12fdc7(0xee),'模板内容替换失败',{'templatePath':_0x58aa1c,'targetPath':_0x3e8664,'pageName':_0x8ef161,'templateName':_0x354e37,'error':_0x1d980f instanceof Error?_0x1d980f['message']:String(_0x1d980f),'duration':_0x1a1f8e});}throw _0x1d980f;}}static async['processDirectory'](_0x5e14be,_0x4f66f6,_0x2de6aa,_0x5c24ec){const _0x39b757=a58_0x181f98,_0x470e41=await a58_0x25dcdd[_0x39b757(0xe3)]['readdir'](_0x5e14be,{'withFileTypes':!![]});for(const _0xa676f6 of _0x470e41){const _0xed0925=a58_0x54732c[_0x39b757(0xd6)](_0x5e14be,_0xa676f6[_0x39b757(0xe5)]);let _0x423ed9=a58_0x54732c['join'](_0x4f66f6,_0xa676f6['name']);_0xa676f6[_0x39b757(0xe5)][_0x39b757(0xfc)](_0x39b757(0xc4))&&(_0x423ed9=a58_0x54732c[_0x39b757(0xd6)](_0x4f66f6,_0xa676f6[_0x39b757(0xe5)][_0x39b757(0xfa)](/\.tpl$/,'')));if(_0xa676f6[_0x39b757(0xf7)]())await a58_0x25dcdd[_0x39b757(0xe3)]['mkdir'](_0x423ed9,{'recursive':!![]}),await this[_0x39b757(0xed)](_0xed0925,_0x423ed9,_0x2de6aa,_0x5c24ec);else _0xa676f6[_0x39b757(0xec)]()&&await this['processFile'](_0xed0925,_0x423ed9,_0x2de6aa,_0x5c24ec);}}static async['processFile'](_0x13a1ea,_0x368a94,_0x432c15,_0x2f4c4f){const _0x4c50c4=a58_0x181f98,_0x31387c=a58_0x54732c[_0x4c50c4(0xd9)](_0x13a1ea)['toLowerCase']();_0x13a1ea[_0x4c50c4(0xfc)](_0x4c50c4(0xc4))&&(_0x368a94=_0x368a94[_0x4c50c4(0xfa)](/\.tpl$/,''));const _0x27af83=[_0x4c50c4(0xc6),_0x4c50c4(0xda),_0x4c50c4(0xf5),'.js',_0x4c50c4(0xfd),'.md',_0x4c50c4(0xcf),_0x4c50c4(0xfb),'.tpl'];if(_0x27af83[_0x4c50c4(0xce)](_0x31387c)||_0x13a1ea['endsWith'](_0x4c50c4(0xc4))){const _0x5e86fe=await a58_0x25dcdd[_0x4c50c4(0xe3)][_0x4c50c4(0xe0)](_0x13a1ea,'utf8'),_0x79540=this[_0x4c50c4(0xe4)](_0x5e86fe,_0x432c15,_0x2f4c4f);await a58_0x25dcdd['promises'][_0x4c50c4(0xe2)](_0x368a94,_0x79540,_0x4c50c4(0xe1));}else await a58_0x25dcdd[_0x4c50c4(0xe3)][_0x4c50c4(0xdf)](_0x13a1ea,_0x368a94);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.1.26-beta.8",
3
+ "version": "1.1.26-beta.9",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"