@lovrabet/cli 1.2.1-beta.4 → 1.2.3

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 (65) 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-update-cdn/current-content.js +1 -1
  19. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  20. package/lib/app-menu-update-cdn/main.js +1 -1
  21. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  22. package/lib/auth/auth-server-ui.js +1 -1
  23. package/lib/auth/auth-server.js +1 -1
  24. package/lib/auth/constant.js +1 -1
  25. package/lib/auth/get-cookie.js +1 -1
  26. package/lib/auth/is-session-valid.js +1 -1
  27. package/lib/auth/logout.js +1 -1
  28. package/lib/cli.js +1 -1
  29. package/lib/cmd/build-watch.js +1 -1
  30. package/lib/cmd/build.js +1 -1
  31. package/lib/cmd/logs.js +1 -1
  32. package/lib/cmd/preview.js +1 -1
  33. package/lib/cmd/start.js +1 -1
  34. package/lib/config/config-help.js +1 -1
  35. package/lib/config/main.js +1 -1
  36. package/lib/constant/domain.js +1 -1
  37. package/lib/constant/env.js +1 -1
  38. package/lib/create-app/enhanced-guided-create.js +1 -1
  39. package/lib/create-app/format-elapsed.js +1 -1
  40. package/lib/create-app/main.js +1 -1
  41. package/lib/create-app/task-finished.js +1 -1
  42. package/lib/create-app/task-loading.js +1 -1
  43. package/lib/create-app/task-running.js +1 -1
  44. package/lib/create-app/task-time.js +1 -1
  45. package/lib/create-app/use-copy-project-template.js +1 -1
  46. package/lib/create-app/use-format-code.js +1 -1
  47. package/lib/create-app/use-install-dependencies.js +1 -1
  48. package/lib/help.js +1 -1
  49. package/lib/init/main.js +1 -1
  50. package/lib/mcp/cursor.js +1 -1
  51. package/lib/mcp/main.js +1 -1
  52. package/lib/utils/check-sdk-version.js +1 -1
  53. package/lib/utils/config.js +1 -1
  54. package/lib/utils/copy-directory.js +1 -1
  55. package/lib/utils/http-client.js +1 -1
  56. package/lib/utils/logger.js +1 -1
  57. package/lib/utils/router-updater.js +1 -1
  58. package/lib/utils/sleep.js +1 -1
  59. package/lib/utils/template-replacer.js +1 -1
  60. package/package.json +3 -3
  61. package/templates/projects/sub-app-react-demo/package.json +2 -2
  62. package/templates/projects/sub-app-react-demo/src/api/api.ts +42 -25
  63. package/templates/projects/sub-app-react-demo/src/api/client.ts +11 -10
  64. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +72 -19
  65. package/templates/projects/sub-app-react-demo/package-lock.json +0 -4062
package/lib/mcp/cursor.js CHANGED
@@ -1 +1 @@
1
- (function(_0x52d065,_0x1bbace){const _0x5a2556=a51_0x51df,_0x304114=_0x52d065();while(!![]){try{const _0x513b40=parseInt(_0x5a2556(0xf8))/0x1+parseInt(_0x5a2556(0xd6))/0x2+parseInt(_0x5a2556(0xd8))/0x3*(parseInt(_0x5a2556(0xfd))/0x4)+parseInt(_0x5a2556(0x105))/0x5+parseInt(_0x5a2556(0xe7))/0x6*(parseInt(_0x5a2556(0xed))/0x7)+parseInt(_0x5a2556(0x107))/0x8+-parseInt(_0x5a2556(0xfa))/0x9*(parseInt(_0x5a2556(0xe2))/0xa);if(_0x513b40===_0x1bbace)break;else _0x304114['push'](_0x304114['shift']());}catch(_0x498c1d){_0x304114['push'](_0x304114['shift']());}}}(a51_0x5a83,0x7a009));function a51_0x5a83(){const _0xdf798c=['复制\x20Cursor\x20Rules\x20文件失败','env','错误:\x20配置失败:\x20','创建新的\x20mcp.json\x20配置','配置\x20Cursor\x20MCP\x20成功','622416HuPLSc','lovrabet-dataset','261SZKuyH','配置\x20Cursor\x20MCP\x20失败','../../templates/rules/lovrabet_rules.mdc.tpl','184TeHwnA','error','.cursor','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','app','\x20\x20-\x20配置文件:\x20','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','warn','242460WBEyAI','npx','6897232MuzcIz','online','1637418xazlqu','解析现有\x20mcp.json\x20失败','33105iqKedV','✓\x20更新\x20mcp.json\x20配置','utf8','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','parse','lovrabet_rules.mdc','错误:\x20解析现有\x20mcp.json\x20失败:\x20','message','log','\x0a✓\x20Cursor\x20MCP\x20配置成功!','1056070YKyOTS','Cursor\x20Rules\x20文件已存在,跳过','info','exit','rules','4217658xGacTB','未找到\x20appcode\x20配置','更新现有\x20mcp.json\x20配置','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','stringify','\x20\x20-\x20环境:\x20','7JjLOad','mcpServers','mcp.json','mcp-cursor','@lovrabet/dataset-mcp-server','appcode'];a51_0x5a83=function(){return _0xdf798c;};return a51_0x5a83();}import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a51_0x51df(_0x27a85e,_0x40ab44){_0x27a85e=_0x27a85e-0xd6;const _0x5a83bf=a51_0x5a83();let _0x51dfa4=_0x5a83bf[_0x27a85e];return _0x51dfa4;}export async function configureCursorMcp(){const _0x113a4f=a51_0x51df;try{const _0x45ac82=process['cwd'](),_0x23dc27=resolve(_0x45ac82,_0x113a4f(0xff)),_0x3c74b1=resolve(_0x23dc27,_0x113a4f(0xef)),_0x2ba695=readConfig(),_0x3ff866=_0x2ba695[_0x113a4f(0xf2)]||_0x2ba695[_0x113a4f(0x101)],_0x567b1a=_0x2ba695[_0x113a4f(0xf4)]||_0x113a4f(0x108);!_0x3ff866&&(console[_0x113a4f(0xfe)](_0x113a4f(0x103)),logger[_0x113a4f(0xfe)](_0x113a4f(0xf0),_0x113a4f(0xe8)),process[_0x113a4f(0xe5)](0x1));!existsSync(_0x23dc27)&&(mkdirSync(_0x23dc27,{'recursive':!![]}),logger['info']('mcp-cursor','创建\x20.cursor\x20目录',{'path':_0x23dc27}),console[_0x113a4f(0xe0)]('✓\x20创建\x20.cursor\x20目录:\x20'+_0x23dc27));const _0x4ee1ca={'command':_0x113a4f(0x106),'args':['-y',_0x113a4f(0xf1)],'env':{'LOVRABET_APP_CODE':String(_0x3ff866),'LOVRABET_ENV':String(_0x567b1a)}};let _0x5790c1;if(existsSync(_0x3c74b1))try{const _0x3ab350=readFileSync(_0x3c74b1,'utf8');_0x5790c1=JSON[_0x113a4f(0xdc)](_0x3ab350),!_0x5790c1[_0x113a4f(0xee)]&&(_0x5790c1[_0x113a4f(0xee)]={}),_0x5790c1[_0x113a4f(0xee)][_0x113a4f(0xf9)]=_0x4ee1ca,logger[_0x113a4f(0xe4)]('mcp-cursor',_0x113a4f(0xe9),{'path':_0x3c74b1,'appcode':_0x3ff866,'env':_0x567b1a}),console['log'](_0x113a4f(0xd9));}catch(_0x5937f7){logger[_0x113a4f(0xfe)](_0x113a4f(0xf0),_0x113a4f(0xd7),{'error':_0x5937f7 instanceof Error?_0x5937f7['message']:String(_0x5937f7)}),console[_0x113a4f(0xfe)](_0x113a4f(0xde)+(_0x5937f7 instanceof Error?_0x5937f7['message']:String(_0x5937f7))),process['exit'](0x1);}else _0x5790c1={'mcpServers':{'lovrabet-dataset':_0x4ee1ca}},logger['info'](_0x113a4f(0xf0),_0x113a4f(0xf6),{'path':_0x3c74b1,'appcode':_0x3ff866,'env':_0x567b1a}),console['log']('✓\x20创建\x20mcp.json\x20配置文件');writeFileSync(_0x3c74b1,JSON[_0x113a4f(0xeb)](_0x5790c1,null,0x2),{'encoding':_0x113a4f(0xda)});const _0x2c91d6=resolve(_0x23dc27,_0x113a4f(0xe6)),_0x4e9677=resolve(_0x2c91d6,_0x113a4f(0xdd));if(!existsSync(_0x4e9677))try{!existsSync(_0x2c91d6)&&(mkdirSync(_0x2c91d6,{'recursive':!![]}),logger['info'](_0x113a4f(0xf0),'创建\x20.cursor/rules\x20目录',{'path':_0x2c91d6}));const _0x52acc3=fileURLToPath(import.meta.url),_0x3c1ac3=dirname(_0x52acc3),_0x31b9cc=resolve(_0x3c1ac3,_0x113a4f(0xfc));existsSync(_0x31b9cc)?(copyFileSync(_0x31b9cc,_0x4e9677),logger[_0x113a4f(0xe4)](_0x113a4f(0xf0),'复制\x20Cursor\x20Rules\x20文件',{'from':_0x31b9cc,'to':_0x4e9677}),console[_0x113a4f(0xe0)]('✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc')):logger[_0x113a4f(0x104)](_0x113a4f(0xf0),'Cursor\x20Rules\x20模板文件不存在',{'templatePath':_0x31b9cc});}catch(_0x358acf){logger[_0x113a4f(0xfe)]('mcp-cursor',_0x113a4f(0xf3),{'error':_0x358acf instanceof Error?_0x358acf[_0x113a4f(0xdf)]:String(_0x358acf)}),console[_0x113a4f(0x104)](_0x113a4f(0x100)+(_0x358acf instanceof Error?_0x358acf[_0x113a4f(0xdf)]:String(_0x358acf)));}else console[_0x113a4f(0xe0)](_0x113a4f(0xdb)),logger['info'](_0x113a4f(0xf0),_0x113a4f(0xe3),{'path':_0x4e9677});console[_0x113a4f(0xe0)](_0x113a4f(0xe1)),console[_0x113a4f(0xe0)]('\x0a配置信息:'),console[_0x113a4f(0xe0)]('\x20\x20-\x20AppCode:\x20'+_0x3ff866),console['log'](_0x113a4f(0xec)+_0x567b1a),console[_0x113a4f(0xe0)](_0x113a4f(0x102)+_0x3c74b1),console['log'](_0x113a4f(0xea)),console[_0x113a4f(0xe0)]('请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。'),logger[_0x113a4f(0xe4)]('mcp-cursor',_0x113a4f(0xf7),{'appcode':_0x3ff866,'env':_0x567b1a,'configPath':_0x3c74b1}),process[_0x113a4f(0xe5)](0x0);}catch(_0x582f73){logger['error'](_0x113a4f(0xf0),_0x113a4f(0xfb),{'error':_0x582f73 instanceof Error?_0x582f73[_0x113a4f(0xdf)]:String(_0x582f73)}),console[_0x113a4f(0xfe)](_0x113a4f(0xf5)+(_0x582f73 instanceof Error?_0x582f73[_0x113a4f(0xdf)]:String(_0x582f73))),process[_0x113a4f(0xe5)](0x1);}}
1
+ function a51_0x6ac4(_0x52fe34,_0xdfbd21){_0x52fe34=_0x52fe34-0x13b;const _0x2d44f1=a51_0x2d44();let _0x6ac4b2=_0x2d44f1[_0x52fe34];return _0x6ac4b2;}(function(_0x5ccd05,_0x145365){const _0x2e48aa=a51_0x6ac4,_0x3677cd=_0x5ccd05();while(!![]){try{const _0x37c80a=parseInt(_0x2e48aa(0x170))/0x1+-parseInt(_0x2e48aa(0x160))/0x2*(-parseInt(_0x2e48aa(0x16e))/0x3)+-parseInt(_0x2e48aa(0x144))/0x4*(-parseInt(_0x2e48aa(0x16b))/0x5)+-parseInt(_0x2e48aa(0x15d))/0x6*(parseInt(_0x2e48aa(0x13e))/0x7)+-parseInt(_0x2e48aa(0x157))/0x8*(-parseInt(_0x2e48aa(0x14e))/0x9)+parseInt(_0x2e48aa(0x13c))/0xa*(parseInt(_0x2e48aa(0x145))/0xb)+-parseInt(_0x2e48aa(0x14c))/0xc;if(_0x37c80a===_0x145365)break;else _0x3677cd['push'](_0x3677cd['shift']());}catch(_0x9cfe78){_0x3677cd['push'](_0x3677cd['shift']());}}}(a51_0x2d44,0x587c7));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a51_0x2d44(){const _0x1ff478=['npx','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','✓\x20创建\x20.cursor\x20目录:\x20','lovrabet-dataset','未找到\x20appcode\x20配置','app','\x20\x20-\x20配置文件:\x20','配置\x20Cursor\x20MCP\x20成功','250MwGQSc','\x0a配置信息:','创建\x20.cursor\x20目录','193416SDfYPD','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','216150YgPEMd','info','parse','exit','更新现有\x20mcp.json\x20配置','33410yvYeBw','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','1029TfARDL','配置\x20Cursor\x20MCP\x20失败','online','\x20\x20-\x20环境:\x20','rules','mcp.json','42424pHDZVI','2233NeYUuL','复制\x20Cursor\x20Rules\x20文件','@lovrabet/dataset-mcp-server','Cursor\x20Rules\x20模板文件不存在','error','错误:\x20配置失败:\x20','复制\x20Cursor\x20Rules\x20文件失败','19297152FXDpoQ','mcpServers','18FNdPOB','log','cwd','utf8','.cursor','../../templates/rules/lovrabet_rules.mdc.tpl','env','\x20\x20-\x20AppCode:\x20','✓\x20创建\x20mcp.json\x20配置文件','2409672Oobuzo','解析现有\x20mcp.json\x20失败','stringify','mcp-cursor','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','message','25992ApGXal','warn','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','18OoSomE','创建\x20.cursor/rules\x20目录','错误:\x20解析现有\x20mcp.json\x20失败:\x20'];a51_0x2d44=function(){return _0x1ff478;};return a51_0x2d44();}export async function configureCursorMcp(){const _0x8c541=a51_0x6ac4;try{const _0x4f866a=process[_0x8c541(0x150)](),_0x34671d=resolve(_0x4f866a,_0x8c541(0x152)),_0x5aa6e6=resolve(_0x34671d,_0x8c541(0x143)),_0x280c2e=readConfig(),_0x1567d0=_0x280c2e['appcode']||_0x280c2e[_0x8c541(0x168)],_0x411a75=_0x280c2e[_0x8c541(0x154)]||_0x8c541(0x140);!_0x1567d0&&(console['error']('错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置'),logger[_0x8c541(0x149)]('mcp-cursor',_0x8c541(0x167)),process[_0x8c541(0x173)](0x1));!existsSync(_0x34671d)&&(mkdirSync(_0x34671d,{'recursive':!![]}),logger['info'](_0x8c541(0x15a),_0x8c541(0x16d),{'path':_0x34671d}),console[_0x8c541(0x14f)](_0x8c541(0x165)+_0x34671d));const _0x40b1c5={'command':_0x8c541(0x163),'args':['-y',_0x8c541(0x147)],'env':{'LOVRABET_APP_CODE':String(_0x1567d0),'LOVRABET_ENV':String(_0x411a75)}};let _0xeeb35b;if(existsSync(_0x5aa6e6))try{const _0xe50029=readFileSync(_0x5aa6e6,_0x8c541(0x151));_0xeeb35b=JSON[_0x8c541(0x172)](_0xe50029),!_0xeeb35b[_0x8c541(0x14d)]&&(_0xeeb35b['mcpServers']={}),_0xeeb35b['mcpServers'][_0x8c541(0x166)]=_0x40b1c5,logger[_0x8c541(0x171)](_0x8c541(0x15a),_0x8c541(0x13b),{'path':_0x5aa6e6,'appcode':_0x1567d0,'env':_0x411a75}),console[_0x8c541(0x14f)]('✓\x20更新\x20mcp.json\x20配置');}catch(_0x4e87a3){logger[_0x8c541(0x149)](_0x8c541(0x15a),_0x8c541(0x158),{'error':_0x4e87a3 instanceof Error?_0x4e87a3[_0x8c541(0x15c)]:String(_0x4e87a3)}),console['error'](_0x8c541(0x162)+(_0x4e87a3 instanceof Error?_0x4e87a3[_0x8c541(0x15c)]:String(_0x4e87a3))),process[_0x8c541(0x173)](0x1);}else _0xeeb35b={'mcpServers':{'lovrabet-dataset':_0x40b1c5}},logger[_0x8c541(0x171)](_0x8c541(0x15a),'创建新的\x20mcp.json\x20配置',{'path':_0x5aa6e6,'appcode':_0x1567d0,'env':_0x411a75}),console[_0x8c541(0x14f)](_0x8c541(0x156));writeFileSync(_0x5aa6e6,JSON[_0x8c541(0x159)](_0xeeb35b,null,0x2),{'encoding':_0x8c541(0x151)});const _0x3fd4ec=resolve(_0x34671d,_0x8c541(0x142)),_0x5a743f=resolve(_0x3fd4ec,'lovrabet_rules.mdc');if(!existsSync(_0x5a743f))try{!existsSync(_0x3fd4ec)&&(mkdirSync(_0x3fd4ec,{'recursive':!![]}),logger[_0x8c541(0x171)]('mcp-cursor',_0x8c541(0x161),{'path':_0x3fd4ec}));const _0x2481df=fileURLToPath(import.meta.url),_0xa5e827=dirname(_0x2481df),_0x2abaf9=resolve(_0xa5e827,_0x8c541(0x153));existsSync(_0x2abaf9)?(copyFileSync(_0x2abaf9,_0x5a743f),logger[_0x8c541(0x171)]('mcp-cursor',_0x8c541(0x146),{'from':_0x2abaf9,'to':_0x5a743f}),console[_0x8c541(0x14f)](_0x8c541(0x164))):logger[_0x8c541(0x15e)](_0x8c541(0x15a),_0x8c541(0x148),{'templatePath':_0x2abaf9});}catch(_0x4424f0){logger['error']('mcp-cursor',_0x8c541(0x14b),{'error':_0x4424f0 instanceof Error?_0x4424f0[_0x8c541(0x15c)]:String(_0x4424f0)}),console['warn'](_0x8c541(0x15f)+(_0x4424f0 instanceof Error?_0x4424f0[_0x8c541(0x15c)]:String(_0x4424f0)));}else console[_0x8c541(0x14f)](_0x8c541(0x15b)),logger[_0x8c541(0x171)](_0x8c541(0x15a),'Cursor\x20Rules\x20文件已存在,跳过',{'path':_0x5a743f});console[_0x8c541(0x14f)]('\x0a✓\x20Cursor\x20MCP\x20配置成功!'),console[_0x8c541(0x14f)](_0x8c541(0x16c)),console[_0x8c541(0x14f)](_0x8c541(0x155)+_0x1567d0),console[_0x8c541(0x14f)](_0x8c541(0x141)+_0x411a75),console[_0x8c541(0x14f)](_0x8c541(0x169)+_0x5aa6e6),console['log'](_0x8c541(0x16f)),console[_0x8c541(0x14f)](_0x8c541(0x13d)),logger['info'](_0x8c541(0x15a),_0x8c541(0x16a),{'appcode':_0x1567d0,'env':_0x411a75,'configPath':_0x5aa6e6}),process[_0x8c541(0x173)](0x0);}catch(_0xe5a76f){logger[_0x8c541(0x149)](_0x8c541(0x15a),_0x8c541(0x13f),{'error':_0xe5a76f instanceof Error?_0xe5a76f[_0x8c541(0x15c)]:String(_0xe5a76f)}),console[_0x8c541(0x149)](_0x8c541(0x14a)+(_0xe5a76f instanceof Error?_0xe5a76f[_0x8c541(0x15c)]:String(_0xe5a76f))),process[_0x8c541(0x173)](0x1);}}
package/lib/mcp/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x120b04,_0x227d39){var _0x4640dc=a52_0x4a8f,_0x105c0e=_0x120b04();while(!![]){try{var _0x4a4171=-parseInt(_0x4640dc(0x18c))/0x1+-parseInt(_0x4640dc(0x198))/0x2*(parseInt(_0x4640dc(0x18e))/0x3)+parseInt(_0x4640dc(0x192))/0x4+-parseInt(_0x4640dc(0x194))/0x5+-parseInt(_0x4640dc(0x19b))/0x6+parseInt(_0x4640dc(0x19a))/0x7*(-parseInt(_0x4640dc(0x1a3))/0x8)+parseInt(_0x4640dc(0x1a1))/0x9;if(_0x4a4171===_0x227d39)break;else _0x105c0e['push'](_0x105c0e['shift']());}catch(_0x4f7c37){_0x105c0e['push'](_0x105c0e['shift']());}}}(a52_0x2803,0x89bd8));function a52_0x4a8f(_0xcf110f,_0xe5a8aa){_0xcf110f=_0xcf110f-0x18b;var _0x28034a=a52_0x2803();var _0x4a8f42=_0x28034a[_0xcf110f];return _0x4a8f42;}import{configureCursorMcp}from'./cursor.js';function a52_0x2803(){var _0x30a48e=['error','info','\x0a当前支持的\x20IDE:','未指定\x20IDE\x20类型','mcp','33791832mJGrzG','\x0a示例:','48WlcDTR','toLowerCase','787500oXyoTg','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','821823TbvhDi','log','exit','cwd','100476mtGcHg','执行配置\x20Cursor\x20MCP\x20命令','1157780mMeWEs','\x20\x20lovrabet\x20mcp\x20cursor','cursor','不支持的\x20IDE\x20类型:\x20','6PpvkDL','\x0a使用方法:','988043jiWFKZ','3166860LmPnwZ'];a52_0x2803=function(){return _0x30a48e;};return a52_0x2803();}import{logger}from'../utils/logger.js';export async function mcpCommand(_0x59badc){var _0x5483d2=a52_0x4a8f;logger['setLogPath'](process[_0x5483d2(0x191)]());if(!_0x59badc){console[_0x5483d2(0x19c)]('错误:\x20请指定\x20IDE\x20类型'),console['log'](_0x5483d2(0x199)),console[_0x5483d2(0x18f)](_0x5483d2(0x18d)),console[_0x5483d2(0x18f)](_0x5483d2(0x1a2)),console[_0x5483d2(0x18f)](_0x5483d2(0x195)),logger[_0x5483d2(0x19c)](_0x5483d2(0x1a0),_0x5483d2(0x19f)),process[_0x5483d2(0x190)](0x1);return;}switch(_0x59badc[_0x5483d2(0x18b)]()){case _0x5483d2(0x196):logger[_0x5483d2(0x19d)](_0x5483d2(0x1a0),_0x5483d2(0x193)),await configureCursorMcp();break;default:console[_0x5483d2(0x19c)]('错误:\x20不支持的\x20IDE\x20类型:\x20'+_0x59badc),console[_0x5483d2(0x18f)](_0x5483d2(0x19e)),console[_0x5483d2(0x18f)]('\x20\x20-\x20cursor'),logger[_0x5483d2(0x19c)](_0x5483d2(0x1a0),_0x5483d2(0x197)+_0x59badc),process[_0x5483d2(0x190)](0x1);break;}}
1
+ function a52_0x4fd6(_0x3e2e1c,_0x84a91a){_0x3e2e1c=_0x3e2e1c-0x1a3;var _0x4542b6=a52_0x4542();var _0x4fd603=_0x4542b6[_0x3e2e1c];return _0x4fd603;}(function(_0x4561d1,_0x407706){var _0x3c2a12=a52_0x4fd6,_0x43c0b5=_0x4561d1();while(!![]){try{var _0x2b7f78=-parseInt(_0x3c2a12(0x1aa))/0x1+parseInt(_0x3c2a12(0x1ae))/0x2*(parseInt(_0x3c2a12(0x1b5))/0x3)+parseInt(_0x3c2a12(0x1b8))/0x4*(parseInt(_0x3c2a12(0x1a3))/0x5)+-parseInt(_0x3c2a12(0x1a7))/0x6*(parseInt(_0x3c2a12(0x1af))/0x7)+parseInt(_0x3c2a12(0x1bc))/0x8+parseInt(_0x3c2a12(0x1b3))/0x9*(-parseInt(_0x3c2a12(0x1b4))/0xa)+parseInt(_0x3c2a12(0x1a9))/0xb*(parseInt(_0x3c2a12(0x1b2))/0xc);if(_0x2b7f78===_0x407706)break;else _0x43c0b5['push'](_0x43c0b5['shift']());}catch(_0x5c6405){_0x43c0b5['push'](_0x43c0b5['shift']());}}}(a52_0x4542,0x2752e));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';export async function mcpCommand(_0x16fe18){var _0x156513=a52_0x4fd6;logger[_0x156513(0x1ad)](process['cwd']());if(!_0x16fe18){console['error']('错误:\x20请指定\x20IDE\x20类型'),console[_0x156513(0x1a4)](_0x156513(0x1b6)),console[_0x156513(0x1a4)]('\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP'),console[_0x156513(0x1a4)]('\x0a示例:'),console[_0x156513(0x1a4)](_0x156513(0x1b1)),logger[_0x156513(0x1a6)](_0x156513(0x1bb),_0x156513(0x1ba)),process['exit'](0x1);return;}switch(_0x16fe18[_0x156513(0x1ab)]()){case _0x156513(0x1b0):logger['info'](_0x156513(0x1bb),_0x156513(0x1b9)),await configureCursorMcp();break;default:console[_0x156513(0x1a6)](_0x156513(0x1a5)+_0x16fe18),console['log'](_0x156513(0x1bd)),console[_0x156513(0x1a4)](_0x156513(0x1b7)),logger[_0x156513(0x1a6)]('mcp',_0x156513(0x1ac)+_0x16fe18),process[_0x156513(0x1a8)](0x1);break;}}function a52_0x4542(){var _0x5677f8=['\x20\x20lovrabet\x20mcp\x20cursor','640368jlgYBN','47106lxkTWg','590KjQehb','891045mXHygN','\x0a使用方法:','\x20\x20-\x20cursor','1940sBqrLK','执行配置\x20Cursor\x20MCP\x20命令','未指定\x20IDE\x20类型','mcp','1161704uHqRir','\x0a当前支持的\x20IDE:','2275ADkcTB','log','错误:\x20不支持的\x20IDE\x20类型:\x20','error','16314LPDvhs','exit','33lHsGkp','276987RcurxE','toLowerCase','不支持的\x20IDE\x20类型:\x20','setLogPath','2WdbvUw','196wCxcOS','cursor'];a52_0x4542=function(){return _0x5677f8;};return a52_0x4542();}
@@ -1 +1 @@
1
- const a54_0x3614f6=a54_0x5854;(function(_0x5bfeb5,_0x5954b8){const _0xaf1da1=a54_0x5854,_0x32740f=_0x5bfeb5();while(!![]){try{const _0x2a9c9b=parseInt(_0xaf1da1(0x187))/0x1+parseInt(_0xaf1da1(0x179))/0x2*(parseInt(_0xaf1da1(0x192))/0x3)+-parseInt(_0xaf1da1(0x194))/0x4+-parseInt(_0xaf1da1(0x18d))/0x5*(parseInt(_0xaf1da1(0x183))/0x6)+-parseInt(_0xaf1da1(0x180))/0x7+-parseInt(_0xaf1da1(0x195))/0x8*(parseInt(_0xaf1da1(0x18c))/0x9)+-parseInt(_0xaf1da1(0x178))/0xa*(-parseInt(_0xaf1da1(0x177))/0xb);if(_0x2a9c9b===_0x5954b8)break;else _0x32740f['push'](_0x32740f['shift']());}catch(_0x205962){_0x32740f['push'](_0x32740f['shift']());}}}(a54_0x5ad1,0x62eac));import a54_0x16e228 from'node:fs';function a54_0x5854(_0x3b8e76,_0x46e109){_0x3b8e76=_0x3b8e76-0x177;const _0x5ad135=a54_0x5ad1();let _0x58545e=_0x5ad135[_0x3b8e76];return _0x58545e;}import a54_0x4a8a38 from'node:path';import a54_0x462b61 from'semver';function a54_0x5ad1(){const _0x5bb55f=['9330992xJEfRY','10REZGyL','98xLsAxg','⚠️\x20\x20SDK\x20版本不兼容','minVersion','\x1b[33m','1.2.0','needsUpgrade','\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk','2404150GvKBzh','\x1b[1m','parse','2130SqTPUy','@lovrabet/sdk','package.json','version','82899BfRLQj','readFileSync','\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20','\x1b[0m','utf8','59337oxOIvQ','890eAIlky','dependencies','devDependencies','join','log','26124FQuuKS','\x20不支持新协议。','2078748tUdDER','32xqTqWR'];a54_0x5ad1=function(){return _0x5bb55f;};return a54_0x5ad1();}const MIN_SDK_VERSION=a54_0x3614f6(0x17d);export function checkSdkVersion(_0x272c19){const _0x2d7ecf=a54_0x3614f6,_0x55f12a=a54_0x4a8a38[_0x2d7ecf(0x190)](_0x272c19,_0x2d7ecf(0x185));if(!a54_0x16e228['existsSync'](_0x55f12a))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x3cc1f9=JSON[_0x2d7ecf(0x182)](a54_0x16e228[_0x2d7ecf(0x188)](_0x55f12a,_0x2d7ecf(0x18b))),_0x27dfb0=_0x3cc1f9[_0x2d7ecf(0x18e)]||{},_0x537bf7=_0x3cc1f9[_0x2d7ecf(0x18f)]||{},_0x563f19=_0x27dfb0['@lovrabet/sdk']||_0x537bf7[_0x2d7ecf(0x184)];if(!_0x563f19)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x480359=a54_0x462b61['coerce'](_0x563f19),_0x1fade4=_0x480359?a54_0x462b61['lt'](_0x480359,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x563f19,'needsUpgrade':_0x1fade4,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}export function printSdkUpgradeWarning(_0x121f14){const _0x457ea3=a54_0x3614f6;if(!_0x121f14[_0x457ea3(0x17e)])return;const _0x2972d0=_0x457ea3(0x17c),_0x45b9c5=_0x457ea3(0x18a),_0x4217bd=_0x457ea3(0x181);console['log'](),console[_0x457ea3(0x191)](''+_0x2972d0+_0x4217bd+_0x457ea3(0x17a)+_0x45b9c5),console[_0x457ea3(0x191)](_0x2972d0+_0x457ea3(0x189)+_0x121f14[_0x457ea3(0x186)]+_0x457ea3(0x193)+_0x45b9c5),console[_0x457ea3(0x191)](_0x2972d0+'\x20\x20\x20请升级\x20SDK\x20至\x20'+_0x121f14[_0x457ea3(0x17b)]+'\x20或更高版本:'+_0x45b9c5),console[_0x457ea3(0x191)](_0x2972d0+'\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest'+_0x45b9c5),console[_0x457ea3(0x191)](_0x2972d0+_0x457ea3(0x17f)+_0x45b9c5),console[_0x457ea3(0x191)]();}
1
+ (function(_0x32ec17,_0x2062a2){const _0x313310=a54_0x7a51,_0x102e86=_0x32ec17();while(!![]){try{const _0x8df29f=-parseInt(_0x313310(0x19c))/0x1+parseInt(_0x313310(0x18d))/0x2*(-parseInt(_0x313310(0x188))/0x3)+parseInt(_0x313310(0x193))/0x4+parseInt(_0x313310(0x18e))/0x5*(-parseInt(_0x313310(0x199))/0x6)+parseInt(_0x313310(0x19a))/0x7+parseInt(_0x313310(0x18f))/0x8+-parseInt(_0x313310(0x184))/0x9*(-parseInt(_0x313310(0x194))/0xa);if(_0x8df29f===_0x2062a2)break;else _0x102e86['push'](_0x102e86['shift']());}catch(_0x59ebb1){_0x102e86['push'](_0x102e86['shift']());}}}(a54_0x50f1,0xaa0bd));import a54_0x5e0061 from'node:fs';import a54_0x389c03 from'node:path';import a54_0x47cc88 from'semver';const MIN_SDK_VERSION='1.2.0';export function checkSdkVersion(_0x1339b9){const _0x52d90a=a54_0x7a51,_0xad50c4=a54_0x389c03[_0x52d90a(0x183)](_0x1339b9,_0x52d90a(0x186));if(!a54_0x5e0061['existsSync'](_0xad50c4))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x2795c9=JSON[_0x52d90a(0x195)](a54_0x5e0061[_0x52d90a(0x19b)](_0xad50c4,_0x52d90a(0x192))),_0x2e4011=_0x2795c9['dependencies']||{},_0xb4b2e2=_0x2795c9['devDependencies']||{},_0x521011=_0x2e4011[_0x52d90a(0x185)]||_0xb4b2e2[_0x52d90a(0x185)];if(!_0x521011)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x5229a0=a54_0x47cc88[_0x52d90a(0x18a)](_0x521011),_0x2ff145=_0x5229a0?a54_0x47cc88['lt'](_0x5229a0,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x521011,'needsUpgrade':_0x2ff145,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}function a54_0x7a51(_0x18176a,_0x169987){_0x18176a=_0x18176a-0x180;const _0x50f1bb=a54_0x50f1();let _0x7a519e=_0x50f1bb[_0x18176a];return _0x7a519e;}function a54_0x50f1(){const _0x2f2c77=['7464656jsVruP','\x1b[0m','needsUpgrade','utf8','2050728ZeELar','10TZHJCt','parse','\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk','\x1b[1m','\x20\x20\x20请升级\x20SDK\x20至\x20','404292KsWyGJ','3376975FaFtAd','readFileSync','729794UEQgho','log','\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20','minVersion','join','9060372BhqSGx','@lovrabet/sdk','package.json','version','12brCVxU','\x1b[33m','coerce','\x20不支持新协议。','⚠️\x20\x20SDK\x20版本不兼容','585842oOQZBe','25YjWwyA'];a54_0x50f1=function(){return _0x2f2c77;};return a54_0x50f1();}export function printSdkUpgradeWarning(_0x5d779a){const _0x5d528f=a54_0x7a51;if(!_0x5d779a[_0x5d528f(0x191)])return;const _0x55e97c=_0x5d528f(0x189),_0x220d57=_0x5d528f(0x190),_0x1d10c4=_0x5d528f(0x197);console[_0x5d528f(0x180)](),console[_0x5d528f(0x180)](''+_0x55e97c+_0x1d10c4+_0x5d528f(0x18c)+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+_0x5d528f(0x181)+_0x5d779a[_0x5d528f(0x187)]+_0x5d528f(0x18b)+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+_0x5d528f(0x198)+_0x5d779a[_0x5d528f(0x182)]+'\x20或更高版本:'+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+'\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest'+_0x220d57),console[_0x5d528f(0x180)](_0x55e97c+_0x5d528f(0x196)+_0x220d57),console['log']();}
@@ -1 +1 @@
1
- const a55_0x2efdbe=a55_0x2b5f;(function(_0x157429,_0x1e1b0c){const _0xc4032f=a55_0x2b5f,_0x3c35fa=_0x157429();while(!![]){try{const _0x43e39c=parseInt(_0xc4032f(0x1ef))/0x1+parseInt(_0xc4032f(0x1ee))/0x2*(parseInt(_0xc4032f(0x1f0))/0x3)+parseInt(_0xc4032f(0x1eb))/0x4+parseInt(_0xc4032f(0x1e4))/0x5+-parseInt(_0xc4032f(0x1ec))/0x6+-parseInt(_0xc4032f(0x1e7))/0x7*(parseInt(_0xc4032f(0x1e2))/0x8)+-parseInt(_0xc4032f(0x1ea))/0x9*(parseInt(_0xc4032f(0x1f1))/0xa);if(_0x43e39c===_0x1e1b0c)break;else _0x3c35fa['push'](_0x3c35fa['shift']());}catch(_0x206346){_0x3c35fa['push'](_0x3c35fa['shift']());}}}(a55_0x30b2,0xc262f));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a55_0x2efdbe(0x1f3)](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),a55_0x2efdbe(0x1f2));export function readConfig(){const _0x4149c2=a55_0x2efdbe;let _0xe34012={};try{if(existsSync(globalConfigPath)){const _0x1b4db7=readFileSync(globalConfigPath,{'encoding':_0x4149c2(0x1e3)});_0x1b4db7&&(_0xe34012=JSON[_0x4149c2(0x1e8)](_0x1b4db7));}}catch(_0x2f8cb5){}try{if(existsSync(projectConfigPath)){const _0x1dcdfe=readFileSync(projectConfigPath,{'encoding':'utf8'});if(_0x1dcdfe){const _0x69b420=JSON[_0x4149c2(0x1e8)](_0x1dcdfe);_0xe34012={..._0xe34012,..._0x69b420};}}}catch(_0x36f408){}return _0xe34012;}function a55_0x2b5f(_0x409e28,_0x291789){_0x409e28=_0x409e28-0x1e2;const _0x30b2ff=a55_0x30b2();let _0x2b5fe6=_0x30b2ff[_0x409e28];return _0x2b5fe6;}function a55_0x30b2(){const _0x492267=['parse','appcode','771354duYyZB','1111232GOOogM','2868702PERxzr','app','52zGtvlW','586764WxxugM','34677ciibNe','50AxTCDx','.lovrabetrc','cwd','73384SbBrhy','utf8','3514310QNaoMU','trim','string','126ZkpfPT'];a55_0x30b2=function(){return _0x492267;};return a55_0x30b2();}export function getConfigAppCode(){const _0x112a77=a55_0x2efdbe;let _0x2566ab={},_0x25866f={};try{if(existsSync(globalConfigPath)){const _0x1760ae=readFileSync(globalConfigPath,{'encoding':_0x112a77(0x1e3)});_0x1760ae&&(_0x25866f=JSON[_0x112a77(0x1e8)](_0x1760ae));}}catch(_0x7f0a32){}try{if(existsSync(projectConfigPath)){const _0x295456=readFileSync(projectConfigPath,{'encoding':'utf8'});_0x295456&&(_0x2566ab=JSON['parse'](_0x295456));}}catch(_0x4137e5){}let _0x15f74b;if(_0x112a77(0x1e9)in _0x2566ab)_0x15f74b=_0x2566ab[_0x112a77(0x1e9)];else{if(_0x112a77(0x1ed)in _0x2566ab)_0x15f74b=_0x2566ab[_0x112a77(0x1ed)];else{if('appcode'in _0x25866f)_0x15f74b=_0x25866f['appcode'];else _0x112a77(0x1ed)in _0x25866f&&(_0x15f74b=_0x25866f[_0x112a77(0x1ed)]);}}if(typeof _0x15f74b!==_0x112a77(0x1e6)||_0x15f74b[_0x112a77(0x1e5)]()==='')return undefined;return _0x15f74b;}export function isInProject(){return existsSync(projectConfigPath);}
1
+ function a55_0x48b2(_0xe41f23,_0x202c62){_0xe41f23=_0xe41f23-0x110;const _0xa87468=a55_0xa874();let _0x48b23f=_0xa87468[_0xe41f23];return _0x48b23f;}const a55_0x103815=a55_0x48b2;(function(_0x498b41,_0x12721f){const _0x1fa2b1=a55_0x48b2,_0x5ca312=_0x498b41();while(!![]){try{const _0x35ef3d=parseInt(_0x1fa2b1(0x112))/0x1+parseInt(_0x1fa2b1(0x110))/0x2*(parseInt(_0x1fa2b1(0x121))/0x3)+parseInt(_0x1fa2b1(0x114))/0x4*(parseInt(_0x1fa2b1(0x118))/0x5)+parseInt(_0x1fa2b1(0x111))/0x6+-parseInt(_0x1fa2b1(0x117))/0x7*(parseInt(_0x1fa2b1(0x11c))/0x8)+parseInt(_0x1fa2b1(0x119))/0x9*(-parseInt(_0x1fa2b1(0x113))/0xa)+-parseInt(_0x1fa2b1(0x11e))/0xb*(parseInt(_0x1fa2b1(0x122))/0xc);if(_0x35ef3d===_0x12721f)break;else _0x5ca312['push'](_0x5ca312['shift']());}catch(_0x120280){_0x5ca312['push'](_0x5ca312['shift']());}}}(a55_0xa874,0x74e6d));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a55_0x103815(0x115)](),a55_0x103815(0x116));export const globalConfigPath=resolve(homedir(),a55_0x103815(0x116));export function readConfig(){const _0x4bdf14=a55_0x103815;let _0x5882ee={};try{if(existsSync(globalConfigPath)){const _0x592981=readFileSync(globalConfigPath,{'encoding':_0x4bdf14(0x11a)});_0x592981&&(_0x5882ee=JSON[_0x4bdf14(0x11d)](_0x592981));}}catch(_0x427194){}try{if(existsSync(projectConfigPath)){const _0x44a853=readFileSync(projectConfigPath,{'encoding':_0x4bdf14(0x11a)});if(_0x44a853){const _0x45edb4=JSON['parse'](_0x44a853);_0x5882ee={..._0x5882ee,..._0x45edb4};}}}catch(_0x45e479){}return _0x5882ee;}export function getConfigAppCode(){const _0x2d97e3=a55_0x103815;let _0x4763f4={},_0x2c1331={};try{if(existsSync(globalConfigPath)){const _0x11d2df=readFileSync(globalConfigPath,{'encoding':_0x2d97e3(0x11a)});_0x11d2df&&(_0x2c1331=JSON['parse'](_0x11d2df));}}catch(_0x342806){}try{if(existsSync(projectConfigPath)){const _0x5f3c10=readFileSync(projectConfigPath,{'encoding':'utf8'});_0x5f3c10&&(_0x4763f4=JSON[_0x2d97e3(0x11d)](_0x5f3c10));}}catch(_0x5256a6){}let _0x4dfd26;if(_0x2d97e3(0x11f)in _0x4763f4)_0x4dfd26=_0x4763f4[_0x2d97e3(0x11f)];else{if(_0x2d97e3(0x11b)in _0x4763f4)_0x4dfd26=_0x4763f4[_0x2d97e3(0x11b)];else{if(_0x2d97e3(0x11f)in _0x2c1331)_0x4dfd26=_0x2c1331[_0x2d97e3(0x11f)];else _0x2d97e3(0x11b)in _0x2c1331&&(_0x4dfd26=_0x2c1331[_0x2d97e3(0x11b)]);}}if(typeof _0x4dfd26!=='string'||_0x4dfd26[_0x2d97e3(0x120)]()==='')return undefined;return _0x4dfd26;}export function isInProject(){return existsSync(projectConfigPath);}function a55_0xa874(){const _0x38ac78=['2946696guHWIe','765035AqEpiW','22030TdHWVa','4CQYSYv','cwd','.lovrabetrc','35BqEqsv','3650645gmHXWp','3501kwrasl','utf8','app','685936sixqTr','parse','2710741InuGbP','appcode','trim','6LhWLdt','24YbfqEq','271088ZMMQsk'];a55_0xa874=function(){return _0x38ac78;};return a55_0xa874();}
@@ -1 +1 @@
1
- function a56_0x30ad(){const _0x852030=['3795390KRaBPv','20OWBEsl','1315529hlQWug','163968BQGuAM','5177528CMnIwh','isDirectory','7266216PkeheH','2028670paZRjB','copyFileSync','48422nSJTOw','name','36kJDdMj','复制目录时出错:','readdirSync','7lOiBTY'];a56_0x30ad=function(){return _0x852030;};return a56_0x30ad();}(function(_0x303bb1,_0x1e98e1){const _0x3b9445=a56_0x526b,_0x2ac182=_0x303bb1();while(!![]){try{const _0x2aa6f4=parseInt(_0x3b9445(0x17d))/0x1+parseInt(_0x3b9445(0x175))/0x2*(parseInt(_0x3b9445(0x177))/0x3)+parseInt(_0x3b9445(0x17f))/0x4+-parseInt(_0x3b9445(0x182))/0x5+parseInt(_0x3b9445(0x17e))/0x6+parseInt(_0x3b9445(0x17a))/0x7*(-parseInt(_0x3b9445(0x181))/0x8)+parseInt(_0x3b9445(0x17b))/0x9*(-parseInt(_0x3b9445(0x17c))/0xa);if(_0x2aa6f4===_0x1e98e1)break;else _0x2ac182['push'](_0x2ac182['shift']());}catch(_0x1b782d){_0x2ac182['push'](_0x2ac182['shift']());}}}(a56_0x30ad,0xbc124));import a56_0x131899 from'node:path';function a56_0x526b(_0x3b6a37,_0x5e2f64){_0x3b6a37=_0x3b6a37-0x175;const _0x30ad12=a56_0x30ad();let _0x526b27=_0x30ad12[_0x3b6a37];return _0x526b27;}import a56_0x2c9b0d from'node:fs';export async function copyDirectory(_0x22d9c3,_0x4aaf16){const _0x4c8487=a56_0x526b;try{const _0x4a0e83=a56_0x2c9b0d[_0x4c8487(0x179)](_0x22d9c3,{'withFileTypes':!![]});a56_0x2c9b0d['mkdirSync'](_0x4aaf16,{'recursive':!![]});for(const _0x1a5369 of _0x4a0e83){const _0x2024a1=a56_0x131899['join'](_0x22d9c3,_0x1a5369[_0x4c8487(0x176)]),_0x57caba=a56_0x131899['join'](_0x4aaf16,_0x1a5369[_0x4c8487(0x176)]);_0x1a5369[_0x4c8487(0x180)]()?await copyDirectory(_0x2024a1,_0x57caba):a56_0x2c9b0d[_0x4c8487(0x183)](_0x2024a1,_0x57caba);}}catch(_0x52baf8){console['error'](_0x4c8487(0x178),_0x52baf8);}}
1
+ (function(_0x8e3141,_0x4994ca){const _0x1b4383=a56_0xd61c,_0x22701a=_0x8e3141();while(!![]){try{const _0x93673c=parseInt(_0x1b4383(0x129))/0x1+parseInt(_0x1b4383(0x124))/0x2+parseInt(_0x1b4383(0x123))/0x3+-parseInt(_0x1b4383(0x127))/0x4+parseInt(_0x1b4383(0x126))/0x5*(parseInt(_0x1b4383(0x12a))/0x6)+-parseInt(_0x1b4383(0x12d))/0x7+parseInt(_0x1b4383(0x11f))/0x8*(-parseInt(_0x1b4383(0x12c))/0x9);if(_0x93673c===_0x4994ca)break;else _0x22701a['push'](_0x22701a['shift']());}catch(_0x322b43){_0x22701a['push'](_0x22701a['shift']());}}}(a56_0x833a,0x199dc));function a56_0xd61c(_0x18cdf3,_0x1c88aa){_0x18cdf3=_0x18cdf3-0x11f;const _0x833a5f=a56_0x833a();let _0xd61c86=_0x833a5f[_0x18cdf3];return _0xd61c86;}function a56_0x833a(){const _0xb2e75f=['复制目录时出错:','error','isDirectory','196497iYbvSZ','291634pkPaXl','readdirSync','236915gtOctp','503900OqnUuL','join','115103loiuZh','6CAjFIQ','name','9JWBOVi','80220UupVNa','1051544tqgPFB'];a56_0x833a=function(){return _0xb2e75f;};return a56_0x833a();}import a56_0x1f1ef4 from'node:path';import a56_0x2e2d9f from'node:fs';export async function copyDirectory(_0x36c210,_0x2bb111){const _0x33c299=a56_0xd61c;try{const _0x39d895=a56_0x2e2d9f[_0x33c299(0x125)](_0x36c210,{'withFileTypes':!![]});a56_0x2e2d9f['mkdirSync'](_0x2bb111,{'recursive':!![]});for(const _0x649af5 of _0x39d895){const _0x26627c=a56_0x1f1ef4['join'](_0x36c210,_0x649af5[_0x33c299(0x12b)]),_0x5020ff=a56_0x1f1ef4[_0x33c299(0x128)](_0x2bb111,_0x649af5[_0x33c299(0x12b)]);_0x649af5[_0x33c299(0x122)]()?await copyDirectory(_0x26627c,_0x5020ff):a56_0x2e2d9f['copyFileSync'](_0x26627c,_0x5020ff);}}catch(_0x2cf030){console[_0x33c299(0x121)](_0x33c299(0x120),_0x2cf030);}}
@@ -1 +1 @@
1
- (function(_0x4df7e4,_0x2a0e57){const _0x36232b=a57_0x1642,_0x5a8254=_0x4df7e4();while(!![]){try{const _0x35bb5b=-parseInt(_0x36232b(0xb6))/0x1*(parseInt(_0x36232b(0xc0))/0x2)+parseInt(_0x36232b(0xb1))/0x3*(-parseInt(_0x36232b(0xad))/0x4)+-parseInt(_0x36232b(0xb2))/0x5*(parseInt(_0x36232b(0xbe))/0x6)+parseInt(_0x36232b(0xb8))/0x7+parseInt(_0x36232b(0xaf))/0x8+-parseInt(_0x36232b(0xb4))/0x9+parseInt(_0x36232b(0xc7))/0xa;if(_0x35bb5b===_0x2a0e57)break;else _0x5a8254['push'](_0x5a8254['shift']());}catch(_0x4c8017){_0x5a8254['push'](_0x5a8254['shift']());}}}(a57_0x3664,0x36e26));export async function httpRequest(_0x205565,_0x18703e={}){const _0x1f9b31=a57_0x1642,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x18703e;let _0x8c299f=null;for(let _0x446255=0x0;_0x446255<=retries;_0x446255++){try{const _0x18c3ba=new AbortController(),_0x24df53=setTimeout(()=>_0x18c3ba[_0x1f9b31(0xc1)](),timeout),_0x2a1bfd=await fetch(_0x205565,{'headers':headers,'signal':_0x18c3ba[_0x1f9b31(0xcb)]});clearTimeout(_0x24df53);let _0x2cd8e0;const _0x2f3e82=_0x2a1bfd['headers'][_0x1f9b31(0xc6)](_0x1f9b31(0xac));return _0x2f3e82?.[_0x1f9b31(0xbf)](_0x1f9b31(0xbb))?_0x2cd8e0=await _0x2a1bfd[_0x1f9b31(0xb5)]():_0x2cd8e0=await _0x2a1bfd['text'](),{'ok':_0x2a1bfd['ok'],'status':_0x2a1bfd[_0x1f9b31(0xc4)],'statusText':_0x2a1bfd[_0x1f9b31(0xb0)],'data':_0x2cd8e0,'headers':_0x2a1bfd[_0x1f9b31(0xc5)],'url':_0x2a1bfd[_0x1f9b31(0xb3)],'text':()=>_0x2a1bfd[_0x1f9b31(0xc8)]()};}catch(_0x3adc95){_0x8c299f=_0x3adc95 instanceof Error?_0x3adc95:new Error(String(_0x3adc95));if(_0x446255===retries)break;if(shouldRetry(_0x3adc95)){console[_0x1f9b31(0xb9)](_0x1f9b31(0xc2)+retryDelay+_0x1f9b31(0xca)+(_0x446255+0x1)+_0x1f9b31(0xc3)),await sleep(retryDelay);continue;}else break;}}throw _0x8c299f||new Error('Request\x20failed');}function shouldRetry(_0x3b63db){const _0x40c512=a57_0x1642;if(_0x3b63db instanceof Error){if(_0x3b63db['name']===_0x40c512(0xc9))return![];if(_0x3b63db[_0x40c512(0xae)]===_0x40c512(0xba)&&_0x3b63db['message'][_0x40c512(0xbf)](_0x40c512(0xbc)))return!![];if(_0x3b63db['message'][_0x40c512(0xbf)](_0x40c512(0xbd)))return!![];if(_0x3b63db[_0x40c512(0xb7)]['includes']('ENOTFOUND'))return![];}return![];}function a57_0x1642(_0x356c54,_0x5d7624){_0x356c54=_0x356c54-0xac;const _0x36644a=a57_0x3664();let _0x1642d4=_0x36644a[_0x356c54];return _0x1642d4;}function a57_0x3664(){const _0x579d99=['includes','114vAugrj','abort','*\x20请求失败,','\x20次重试...','status','headers','get','9315510nCWrBQ','text','AbortError','ms\x20后进行第\x20','signal','content-type','8RMomLS','name','784976VxXdpX','statusText','168261toOAUI','965ewOWwG','url','1004229ulOGDO','json','7448UXJvLD','message','1604617yfayOm','log','TypeError','application/json','fetch','ECONNRESET','11994XWuEFu'];a57_0x3664=function(){return _0x579d99;};return a57_0x3664();}function sleep(_0x45176e){return new Promise(_0x2b2c6f=>setTimeout(_0x2b2c6f,_0x45176e));}export function validateUrl(_0x3e6a4a){try{return new URL(_0x3e6a4a),!![];}catch{return![];}}
1
+ (function(_0x4f5b9a,_0x24b535){const _0x158598=a57_0x53f1,_0x3b6b88=_0x4f5b9a();while(!![]){try{const _0x132c22=parseInt(_0x158598(0x201))/0x1+-parseInt(_0x158598(0x1e4))/0x2*(-parseInt(_0x158598(0x1e9))/0x3)+-parseInt(_0x158598(0x1ef))/0x4*(parseInt(_0x158598(0x1ee))/0x5)+parseInt(_0x158598(0x1fc))/0x6*(parseInt(_0x158598(0x1f2))/0x7)+parseInt(_0x158598(0x1fa))/0x8+-parseInt(_0x158598(0x1f0))/0x9+-parseInt(_0x158598(0x1eb))/0xa;if(_0x132c22===_0x24b535)break;else _0x3b6b88['push'](_0x3b6b88['shift']());}catch(_0x260ca5){_0x3b6b88['push'](_0x3b6b88['shift']());}}}(a57_0x59fe,0xa83a0));export async function httpRequest(_0x4748f5,_0x18438a={}){const _0x52f5a3=a57_0x53f1,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x18438a;let _0xa1825e=null;for(let _0x7b4a7=0x0;_0x7b4a7<=retries;_0x7b4a7++){try{const _0x468a2b=new AbortController(),_0xcabd75=setTimeout(()=>_0x468a2b[_0x52f5a3(0x1ec)](),timeout),_0xfb766e=await fetch(_0x4748f5,{'headers':headers,'signal':_0x468a2b[_0x52f5a3(0x1e7)]});clearTimeout(_0xcabd75);let _0x2b78d7;const _0x3da151=_0xfb766e['headers'][_0x52f5a3(0x1e8)](_0x52f5a3(0x1e3));return _0x3da151?.[_0x52f5a3(0x1fe)](_0x52f5a3(0x1f7))?_0x2b78d7=await _0xfb766e[_0x52f5a3(0x1e6)]():_0x2b78d7=await _0xfb766e[_0x52f5a3(0x1fd)](),{'ok':_0xfb766e['ok'],'status':_0xfb766e[_0x52f5a3(0x1f3)],'statusText':_0xfb766e[_0x52f5a3(0x1ff)],'data':_0x2b78d7,'headers':_0xfb766e[_0x52f5a3(0x200)],'url':_0xfb766e[_0x52f5a3(0x1ea)],'text':()=>_0xfb766e[_0x52f5a3(0x1fd)]()};}catch(_0x43fb66){_0xa1825e=_0x43fb66 instanceof Error?_0x43fb66:new Error(String(_0x43fb66));if(_0x7b4a7===retries)break;if(shouldRetry(_0x43fb66)){console[_0x52f5a3(0x1e1)](_0x52f5a3(0x1e2)+retryDelay+_0x52f5a3(0x1f6)+(_0x7b4a7+0x1)+_0x52f5a3(0x1ed)),await sleep(retryDelay);continue;}else break;}}throw _0xa1825e||new Error(_0x52f5a3(0x1f1));}function shouldRetry(_0x25b0b1){const _0x677873=a57_0x53f1;if(_0x25b0b1 instanceof Error){if(_0x25b0b1[_0x677873(0x1f5)]===_0x677873(0x1f4))return![];if(_0x25b0b1[_0x677873(0x1f5)]===_0x677873(0x1f9)&&_0x25b0b1['message']['includes'](_0x677873(0x1fb)))return!![];if(_0x25b0b1[_0x677873(0x1f8)][_0x677873(0x1fe)]('ECONNRESET'))return!![];if(_0x25b0b1[_0x677873(0x1f8)][_0x677873(0x1fe)](_0x677873(0x1e5)))return![];}return![];}function a57_0x53f1(_0x3c420d,_0x2c7665){_0x3c420d=_0x3c420d-0x1e1;const _0x59feda=a57_0x59fe();let _0x53f134=_0x59feda[_0x3c420d];return _0x53f134;}function a57_0x59fe(){const _0x51d742=['2wKuaio','ENOTFOUND','json','signal','get','751974zvayGb','url','12667390AtIKOH','abort','\x20次重试...','160315kOYzVY','88PUvcgG','2099556AkHMer','Request\x20failed','4363793uAUfZY','status','AbortError','name','ms\x20后进行第\x20','application/json','message','TypeError','10738928LOTKZE','fetch','6eNSFhW','text','includes','statusText','headers','678042tjuIGQ','log','*\x20请求失败,','content-type'];a57_0x59fe=function(){return _0x51d742;};return a57_0x59fe();}function sleep(_0x109a5a){return new Promise(_0x302918=>setTimeout(_0x302918,_0x109a5a));}export function validateUrl(_0x26ea57){try{return new URL(_0x26ea57),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a58_0x51a0ff=a58_0x4e64;function a58_0x26af(){const _0xc40c5=['existsSync','details','initWinstonLogger','parse','16374RYvNht','49AkELfp','clear','logTask','clearLogs','addColors','logFilePath','setRawCommand','message','Failed\x20to\x20clear\x20logs:','mkdirSync','join','utf8','timestamp','Failed\x20to\x20read\x20logs:','toISOString','开始执行:\x20','log','writeFileSync','完成:\x20','command','blue','790860frdDUu','396bekoys','errors','stringify','6720525EFFwXm','success','error','green','info','52410879HuuUxA','readFileSync','1579024KBTvyc','filter','rawCommand','format','unknown','readLogs','transports','2242314DQyVGN','10NTNhCt','trim','winstonLogger','currentRawCommand','map','now','.lovrabet.log','red','level','warn','195700vxhmkA'];a58_0x26af=function(){return _0xc40c5;};return a58_0x26af();}(function(_0x42304a,_0x2d764b){const _0x2bb5cc=a58_0x4e64,_0x50b9a0=_0x42304a();while(!![]){try{const _0x5f1322=-parseInt(_0x2bb5cc(0xc1))/0x1+parseInt(_0x2bb5cc(0xab))/0x2*(-parseInt(_0x2bb5cc(0xc2))/0x3)+parseInt(_0x2bb5cc(0xa6))/0x4+-parseInt(_0x2bb5cc(0xc5))/0x5+-parseInt(_0x2bb5cc(0xd3))/0x6+parseInt(_0x2bb5cc(0xac))/0x7*(-parseInt(_0x2bb5cc(0xcc))/0x8)+-parseInt(_0x2bb5cc(0xca))/0x9*(-parseInt(_0x2bb5cc(0xd4))/0xa);if(_0x5f1322===_0x2d764b)break;else _0x50b9a0['push'](_0x50b9a0['shift']());}catch(_0x32f710){_0x50b9a0['push'](_0x50b9a0['shift']());}}}(a58_0x26af,0xdc0de));import a58_0x2d6691 from'winston';import a58_0x2ba5f2 from'node:fs';import a58_0x2dbf15 from'node:path';function a58_0x4e64(_0x2dd866,_0x2137a3){_0x2dd866=_0x2dd866-0xa6;const _0x26af2e=a58_0x26af();let _0x4e64ae=_0x26af2e[_0x2dd866];return _0x4e64ae;}class Logger{[a58_0x51a0ff(0xd6)];[a58_0x51a0ff(0xb1)];[a58_0x51a0ff(0xd7)]='';constructor(){const _0x2f8aca=a58_0x51a0ff;this[_0x2f8aca(0xb1)]='';}[a58_0x51a0ff(0xb2)](_0x334c85){const _0x19edd5=a58_0x51a0ff;this[_0x19edd5(0xd7)]=_0x334c85;}[a58_0x51a0ff(0xa9)](){const _0x37175f=a58_0x51a0ff,_0xb1d58b=a58_0x2dbf15['dirname'](this[_0x37175f(0xb1)]);!a58_0x2ba5f2[_0x37175f(0xa7)](_0xb1d58b)&&a58_0x2ba5f2[_0x37175f(0xb5)](_0xb1d58b,{'recursive':!![]});const _0x266820=a58_0x2d6691[_0x37175f(0xcf)]['combine'](a58_0x2d6691[_0x37175f(0xcf)][_0x37175f(0xb8)](),a58_0x2d6691[_0x37175f(0xcf)][_0x37175f(0xc3)]({'stack':!![]}),a58_0x2d6691[_0x37175f(0xcf)]['printf'](_0x18b0cb=>{const _0x281676=_0x37175f,_0x5e399a={'timestamp':_0x18b0cb[_0x281676(0xb8)]||new Date()[_0x281676(0xba)](),'level':_0x18b0cb[_0x281676(0xdc)]||'info','command':_0x18b0cb[_0x281676(0xbf)]||_0x281676(0xd0),'rawCommand':_0x18b0cb[_0x281676(0xce)]||this['currentRawCommand']||undefined,'message':_0x18b0cb[_0x281676(0xb3)]||'','duration':_0x18b0cb['duration']||undefined,'details':_0x18b0cb[_0x281676(0xa8)]||undefined};return JSON[_0x281676(0xc4)](_0x5e399a);}));this[_0x37175f(0xd6)]=a58_0x2d6691['createLogger']({'level':_0x37175f(0xc9),'format':_0x266820,'transports':[new a58_0x2d6691[(_0x37175f(0xd2))]['File']({'filename':this['logFilePath'],'level':'info'})],'silent':![]}),a58_0x2d6691[_0x37175f(0xb0)]({'success':_0x37175f(0xc8),'error':_0x37175f(0xdb),'warn':'yellow','info':_0x37175f(0xc0)});}['setLogPath'](_0x2ed224){const _0x16546d=a58_0x51a0ff;this[_0x16546d(0xb1)]=a58_0x2dbf15[_0x16546d(0xb6)](_0x2ed224,_0x16546d(0xda)),this[_0x16546d(0xd6)]&&this['winstonLogger'][_0x16546d(0xad)](),this[_0x16546d(0xa9)]();}[a58_0x51a0ff(0xc9)](_0x2e3f19,_0x2bb197,_0x36b01d){const _0x9ea903=a58_0x51a0ff;if(!this[_0x9ea903(0xb1)]||!this[_0x9ea903(0xd6)])return;this[_0x9ea903(0xd6)][_0x9ea903(0xc9)](_0x2bb197,{'command':_0x2e3f19,'details':_0x36b01d});}['success'](_0x283ca0,_0x54c2c2,_0x2c1108,_0x2f81ed){const _0x1a9fd4=a58_0x51a0ff;if(!this[_0x1a9fd4(0xb1)]||!this[_0x1a9fd4(0xd6)])return;this[_0x1a9fd4(0xd6)][_0x1a9fd4(0xbc)](_0x1a9fd4(0xc9),_0x54c2c2,{'level':_0x1a9fd4(0xc6),'command':_0x283ca0,'duration':_0x2c1108,'details':_0x2f81ed});}[a58_0x51a0ff(0xc7)](_0x8a0c62,_0x4f16de,_0x38689f){const _0x14a0a4=a58_0x51a0ff;if(!this['logFilePath']||!this[_0x14a0a4(0xd6)])return;this[_0x14a0a4(0xd6)][_0x14a0a4(0xc7)](_0x4f16de,{'command':_0x8a0c62,'details':_0x38689f});}[a58_0x51a0ff(0xdd)](_0x2769a0,_0x13c0c8,_0x1226c6){const _0x3e3c2b=a58_0x51a0ff;if(!this[_0x3e3c2b(0xb1)]||!this[_0x3e3c2b(0xd6)])return;this['winstonLogger'][_0x3e3c2b(0xdd)](_0x13c0c8,{'command':_0x2769a0,'details':_0x1226c6});}async[a58_0x51a0ff(0xae)](_0x32e76d,_0x5aa709,_0x187be4){const _0x1be019=a58_0x51a0ff,_0x496479=Date[_0x1be019(0xd9)]();this[_0x1be019(0xc9)](_0x32e76d,_0x1be019(0xbb)+_0x5aa709);try{const _0x43c931=await _0x187be4(),_0x5047a0=Date['now']()-_0x496479;return this[_0x1be019(0xc6)](_0x32e76d,_0x1be019(0xbe)+_0x5aa709,_0x5047a0),_0x43c931;}catch(_0x3a0c6c){const _0x30b4e2=Date[_0x1be019(0xd9)]()-_0x496479;this[_0x1be019(0xc7)](_0x32e76d,'失败:\x20'+_0x5aa709,{'error':_0x3a0c6c instanceof Error?_0x3a0c6c[_0x1be019(0xb3)]:String(_0x3a0c6c),'duration':_0x30b4e2});throw _0x3a0c6c;}}[a58_0x51a0ff(0xd1)](){const _0x56e526=a58_0x51a0ff;try{if(!a58_0x2ba5f2[_0x56e526(0xa7)](this[_0x56e526(0xb1)]))return[];const _0x34dc81=a58_0x2ba5f2[_0x56e526(0xcb)](this['logFilePath'],_0x56e526(0xb7));return _0x34dc81['split']('\x0a')[_0x56e526(0xcd)](_0x1a5548=>_0x1a5548[_0x56e526(0xd5)]())[_0x56e526(0xd8)](_0x4e1cfc=>JSON[_0x56e526(0xaa)](_0x4e1cfc));}catch(_0x286211){return console[_0x56e526(0xdd)](_0x56e526(0xb9),_0x286211),[];}}[a58_0x51a0ff(0xaf)](){const _0x9695b1=a58_0x51a0ff;try{a58_0x2ba5f2[_0x9695b1(0xa7)](this[_0x9695b1(0xb1)])&&a58_0x2ba5f2[_0x9695b1(0xbd)](this[_0x9695b1(0xb1)],'',_0x9695b1(0xb7));}catch(_0x2a5488){console[_0x9695b1(0xdd)](_0x9695b1(0xb4),_0x2a5488);}}['getWinstonInstance'](){return this['winstonLogger'];}}export const logger=new Logger();
1
+ function a58_0x1b0a(){const _0x241cb1=['7831117nPYAXk','.lovrabet.log','logTask','setLogPath','toISOString','initWinstonLogger','now','writeFileSync','info','2067626gQcBiM','success','command','readFileSync','currentRawCommand','1307913YgMyNq','blue','log','开始执行:\x20','errors','190552neZEVQ','10uBdiOW','2012838lnZXDX','mkdirSync','details','transports','format','timestamp','green','combine','message','trim','失败:\x20','level','getWinstonInstance','rawCommand','duration','dirname','split','parse','完成:\x20','filter','3567084FwPYFo','winstonLogger','utf8','existsSync','error','logFilePath','File','warn','createLogger','261IcylTF','clear','1023668pTZZNT'];a58_0x1b0a=function(){return _0x241cb1;};return a58_0x1b0a();}const a58_0x23c6b9=a58_0x1635;(function(_0x279a1d,_0x320e86){const _0x27b449=a58_0x1635,_0x5a9f53=_0x279a1d();while(!![]){try{const _0x2b367d=parseInt(_0x27b449(0x190))/0x1+-parseInt(_0x27b449(0x18b))/0x2+-parseInt(_0x27b449(0x176))/0x3+-parseInt(_0x27b449(0x181))/0x4*(parseInt(_0x27b449(0x196))/0x5)+parseInt(_0x27b449(0x197))/0x6+parseInt(_0x27b449(0x182))/0x7+parseInt(_0x27b449(0x195))/0x8*(parseInt(_0x27b449(0x17f))/0x9);if(_0x2b367d===_0x320e86)break;else _0x5a9f53['push'](_0x5a9f53['shift']());}catch(_0x22d2e7){_0x5a9f53['push'](_0x5a9f53['shift']());}}}(a58_0x1b0a,0xaf571));function a58_0x1635(_0x31846b,_0x5b68c7){_0x31846b=_0x31846b-0x164;const _0x1b0a3c=a58_0x1b0a();let _0x163584=_0x1b0a3c[_0x31846b];return _0x163584;}import a58_0x3a147f from'winston';import a58_0x518647 from'node:fs';import a58_0x166cba from'node:path';class Logger{[a58_0x23c6b9(0x177)];['logFilePath'];[a58_0x23c6b9(0x18f)]='';constructor(){const _0xc28815=a58_0x23c6b9;this[_0xc28815(0x17b)]='';}['setRawCommand'](_0x160de0){const _0x520c70=a58_0x23c6b9;this[_0x520c70(0x18f)]=_0x160de0;}[a58_0x23c6b9(0x187)](){const _0x89c12c=a58_0x23c6b9,_0x1f1ef3=a58_0x166cba[_0x89c12c(0x171)](this[_0x89c12c(0x17b)]);!a58_0x518647[_0x89c12c(0x179)](_0x1f1ef3)&&a58_0x518647[_0x89c12c(0x198)](_0x1f1ef3,{'recursive':!![]});const _0x4083de=a58_0x3a147f[_0x89c12c(0x166)][_0x89c12c(0x169)](a58_0x3a147f['format'][_0x89c12c(0x167)](),a58_0x3a147f['format'][_0x89c12c(0x194)]({'stack':!![]}),a58_0x3a147f[_0x89c12c(0x166)]['printf'](_0x54f549=>{const _0x424d29=_0x89c12c,_0x33eca6={'timestamp':_0x54f549[_0x424d29(0x167)]||new Date()[_0x424d29(0x186)](),'level':_0x54f549[_0x424d29(0x16d)]||_0x424d29(0x18a),'command':_0x54f549[_0x424d29(0x18d)]||'unknown','rawCommand':_0x54f549[_0x424d29(0x16f)]||this[_0x424d29(0x18f)]||undefined,'message':_0x54f549[_0x424d29(0x16a)]||'','duration':_0x54f549[_0x424d29(0x170)]||undefined,'details':_0x54f549[_0x424d29(0x164)]||undefined};return JSON['stringify'](_0x33eca6);}));this[_0x89c12c(0x177)]=a58_0x3a147f[_0x89c12c(0x17e)]({'level':_0x89c12c(0x18a),'format':_0x4083de,'transports':[new a58_0x3a147f[(_0x89c12c(0x165))][(_0x89c12c(0x17c))]({'filename':this['logFilePath'],'level':_0x89c12c(0x18a)})],'silent':![]}),a58_0x3a147f['addColors']({'success':_0x89c12c(0x168),'error':'red','warn':'yellow','info':_0x89c12c(0x191)});}[a58_0x23c6b9(0x185)](_0x3631cf){const _0x4515a9=a58_0x23c6b9;this[_0x4515a9(0x17b)]=a58_0x166cba['join'](_0x3631cf,_0x4515a9(0x183)),this['winstonLogger']&&this[_0x4515a9(0x177)][_0x4515a9(0x180)](),this[_0x4515a9(0x187)]();}['info'](_0x1f7d3d,_0x4e22de,_0x1699ff){const _0xeed1f5=a58_0x23c6b9;if(!this[_0xeed1f5(0x17b)]||!this[_0xeed1f5(0x177)])return;this[_0xeed1f5(0x177)][_0xeed1f5(0x18a)](_0x4e22de,{'command':_0x1f7d3d,'details':_0x1699ff});}[a58_0x23c6b9(0x18c)](_0x56de7c,_0x5f0233,_0x4d41c6,_0x40151d){const _0x262f45=a58_0x23c6b9;if(!this[_0x262f45(0x17b)]||!this[_0x262f45(0x177)])return;this['winstonLogger'][_0x262f45(0x192)](_0x262f45(0x18a),_0x5f0233,{'level':_0x262f45(0x18c),'command':_0x56de7c,'duration':_0x4d41c6,'details':_0x40151d});}[a58_0x23c6b9(0x17a)](_0x20b7cd,_0x2ffbca,_0x43c1f1){const _0x496952=a58_0x23c6b9;if(!this[_0x496952(0x17b)]||!this[_0x496952(0x177)])return;this[_0x496952(0x177)][_0x496952(0x17a)](_0x2ffbca,{'command':_0x20b7cd,'details':_0x43c1f1});}[a58_0x23c6b9(0x17d)](_0x520ce4,_0x3b59d8,_0x54b515){const _0x399509=a58_0x23c6b9;if(!this[_0x399509(0x17b)]||!this[_0x399509(0x177)])return;this[_0x399509(0x177)][_0x399509(0x17d)](_0x3b59d8,{'command':_0x520ce4,'details':_0x54b515});}async[a58_0x23c6b9(0x184)](_0x359927,_0x24c13e,_0x7fb011){const _0x4789b3=a58_0x23c6b9,_0x40f322=Date['now']();this['info'](_0x359927,_0x4789b3(0x193)+_0x24c13e);try{const _0x3f0066=await _0x7fb011(),_0x2f4903=Date[_0x4789b3(0x188)]()-_0x40f322;return this[_0x4789b3(0x18c)](_0x359927,_0x4789b3(0x174)+_0x24c13e,_0x2f4903),_0x3f0066;}catch(_0x53dc44){const _0x4feae4=Date[_0x4789b3(0x188)]()-_0x40f322;this[_0x4789b3(0x17a)](_0x359927,_0x4789b3(0x16c)+_0x24c13e,{'error':_0x53dc44 instanceof Error?_0x53dc44[_0x4789b3(0x16a)]:String(_0x53dc44),'duration':_0x4feae4});throw _0x53dc44;}}['readLogs'](){const _0x26472a=a58_0x23c6b9;try{if(!a58_0x518647[_0x26472a(0x179)](this[_0x26472a(0x17b)]))return[];const _0x37028e=a58_0x518647[_0x26472a(0x18e)](this['logFilePath'],_0x26472a(0x178));return _0x37028e[_0x26472a(0x172)]('\x0a')[_0x26472a(0x175)](_0x54dd62=>_0x54dd62[_0x26472a(0x16b)]())['map'](_0x3ae384=>JSON[_0x26472a(0x173)](_0x3ae384));}catch(_0x168f6b){return console[_0x26472a(0x17d)]('Failed\x20to\x20read\x20logs:',_0x168f6b),[];}}['clearLogs'](){const _0x4cf70c=a58_0x23c6b9;try{a58_0x518647[_0x4cf70c(0x179)](this['logFilePath'])&&a58_0x518647[_0x4cf70c(0x189)](this[_0x4cf70c(0x17b)],'','utf8');}catch(_0x2d1038){console[_0x4cf70c(0x17d)]('Failed\x20to\x20clear\x20logs:',_0x2d1038);}}[a58_0x23c6b9(0x16e)](){const _0x42814c=a58_0x23c6b9;return this[_0x42814c(0x177)];}}export const logger=new Logger();
@@ -1 +1 @@
1
- const a59_0x4eaa72=a59_0x4f39;(function(_0x10b5b6,_0x3cb5b1){const _0x1c778f=a59_0x4f39,_0x4826d2=_0x10b5b6();while(!![]){try{const _0x44313f=parseInt(_0x1c778f(0x131))/0x1*(-parseInt(_0x1c778f(0x111))/0x2)+-parseInt(_0x1c778f(0x134))/0x3*(-parseInt(_0x1c778f(0x12b))/0x4)+parseInt(_0x1c778f(0x11c))/0x5*(parseInt(_0x1c778f(0x108))/0x6)+parseInt(_0x1c778f(0x123))/0x7*(parseInt(_0x1c778f(0x11d))/0x8)+parseInt(_0x1c778f(0x10a))/0x9+-parseInt(_0x1c778f(0x10c))/0xa+-parseInt(_0x1c778f(0x12c))/0xb*(parseInt(_0x1c778f(0x118))/0xc);if(_0x44313f===_0x3cb5b1)break;else _0x4826d2['push'](_0x4826d2['shift']());}catch(_0x1305a1){_0x4826d2['push'](_0x4826d2['shift']());}}}(a59_0x3faf,0x88eba));import a59_0x1b1004 from'node:fs';function a59_0x3faf(){const _0x57020a=['4658950ieXtaw','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','charAt','toLowerCase','split','790882XFleIj','info','indexOf','previewChanges','error','readFile','路由配置更新完成','34717008RkOuqr','existsSync','import\x20','路由配置更新失败','1525fGiTBQ','8917624jEEMmg','promises','\x20from\x20\x22../pages/','path:\x20\x22','writeFile','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','7NFLEeY','success','未找到路由配置的\x20children\x20数组','router','lastIndexOf','message','now','slice','24576TPZbIx','11rKNcka','map','addRoute','match','src','1qOXyWd','addPageRoute','index','492hnCOTc','routerFilePath','toComponentName','join','addImport','路由文件不存在:\x20','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','index.tsx','21462NDQpvj','length','9917478mFgEOx','utf8'];a59_0x3faf=function(){return _0x57020a;};return a59_0x3faf();}function a59_0x4f39(_0x5aeab8,_0x4452f2){_0x5aeab8=_0x5aeab8-0x105;const _0x3faff3=a59_0x3faf();let _0x4f39a3=_0x3faff3[_0x5aeab8];return _0x4f39a3;}import a59_0x7bc5af from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a59_0x4eaa72(0x135)];constructor(_0x5ba225){const _0x52eeb1=a59_0x4eaa72;this['routerFilePath']=a59_0x7bc5af[_0x52eeb1(0x137)](_0x5ba225,_0x52eeb1(0x130),_0x52eeb1(0x126),_0x52eeb1(0x107));}async[a59_0x4eaa72(0x132)](_0x51ea4e,_0x47213d){const _0x3c2d76=a59_0x4eaa72;if(!a59_0x1b1004[_0x3c2d76(0x119)](this[_0x3c2d76(0x135)]))throw new Error(_0x3c2d76(0x105)+this[_0x3c2d76(0x135)]);const _0x510a7c=Date['now']();logger[_0x3c2d76(0x112)](_0x3c2d76(0x126),'开始更新路由配置',{'pageName':_0x51ea4e,'routePath':_0x47213d,'file':this[_0x3c2d76(0x135)]});try{const _0x1eba44=await a59_0x1b1004['promises'][_0x3c2d76(0x116)](this[_0x3c2d76(0x135)],_0x3c2d76(0x10b)),_0x38b478=this['toComponentName'](_0x51ea4e),_0x1b68b8=this[_0x3c2d76(0x138)](_0x1eba44,_0x38b478,_0x51ea4e),_0x335249=this[_0x3c2d76(0x12e)](_0x1b68b8,_0x47213d,_0x38b478);await a59_0x1b1004[_0x3c2d76(0x11e)][_0x3c2d76(0x121)](this[_0x3c2d76(0x135)],_0x335249,'utf8');const _0x2e4fa2=Date[_0x3c2d76(0x129)]()-_0x510a7c;logger[_0x3c2d76(0x124)](_0x3c2d76(0x126),_0x3c2d76(0x117),_0x2e4fa2,{'pageName':_0x51ea4e,'routePath':_0x47213d,'componentName':_0x38b478});}catch(_0x5e4361){const _0x994ad8=Date['now']()-_0x510a7c;logger[_0x3c2d76(0x115)](_0x3c2d76(0x126),_0x3c2d76(0x11b),{'pageName':_0x51ea4e,'routePath':_0x47213d,'error':_0x5e4361 instanceof Error?_0x5e4361[_0x3c2d76(0x128)]:String(_0x5e4361),'duration':_0x994ad8});throw _0x5e4361;}}[a59_0x4eaa72(0x136)](_0x5a0687){const _0x524d6b=a59_0x4eaa72;return _0x5a0687[_0x524d6b(0x110)]('-')[_0x524d6b(0x12d)](_0x4ada2a=>_0x4ada2a[_0x524d6b(0x10e)](0x0)['toUpperCase']()+_0x4ada2a[_0x524d6b(0x12a)](0x1)[_0x524d6b(0x10f)]())['join']('');}[a59_0x4eaa72(0x138)](_0x18f245,_0x43ece7,_0x234455){const _0x3d2329=a59_0x4eaa72,_0x464ee0=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x14d525=_0x18f245[_0x3d2329(0x12f)](_0x464ee0)||[],_0x4c18f9=_0x3d2329(0x11a)+_0x43ece7+_0x3d2329(0x11f)+_0x234455+'\x22;';if(_0x18f245['includes'](_0x4c18f9))return _0x18f245;if(_0x14d525[_0x3d2329(0x109)]>0x0){const _0x291d47=_0x14d525[_0x14d525[_0x3d2329(0x109)]-0x1];if(_0x291d47){const _0x36a729=_0x18f245[_0x3d2329(0x127)](_0x291d47),_0x1170be=_0x36a729+_0x291d47[_0x3d2329(0x109)];return _0x18f245['slice'](0x0,_0x1170be)+_0x4c18f9+'\x0a'+_0x18f245[_0x3d2329(0x12a)](_0x1170be);}}const _0x55e386=_0x18f245[_0x3d2329(0x12f)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x55e386&&_0x55e386[_0x3d2329(0x133)]!==undefined){const _0x33bc46=_0x55e386[_0x3d2329(0x133)]+_0x55e386[0x0][_0x3d2329(0x109)];return _0x18f245[_0x3d2329(0x12a)](0x0,_0x33bc46)+_0x4c18f9+'\x0a'+_0x18f245[_0x3d2329(0x12a)](_0x33bc46);}return _0x18f245;}[a59_0x4eaa72(0x12e)](_0x35f63e,_0x332b25,_0x49b46a){const _0x4c8642=a59_0x4eaa72,_0x37da2d=_0x4c8642(0x122)+_0x332b25+_0x4c8642(0x106)+_0x49b46a+_0x4c8642(0x10d);if(_0x35f63e['includes'](_0x4c8642(0x120)+_0x332b25+'\x22'))return _0x35f63e;const _0x12c26a=/children:\s*\[([\s\S]*?)\]/,_0x5d1e04=_0x35f63e[_0x4c8642(0x12f)](_0x12c26a);if(!_0x5d1e04||_0x5d1e04[_0x4c8642(0x133)]===undefined)throw new Error(_0x4c8642(0x125));const _0x27e26c=_0x5d1e04[0x1],_0x4889c9=_0x5d1e04[_0x4c8642(0x133)]+_0x5d1e04[0x0][_0x4c8642(0x113)]('[')+0x1,_0x3d6575=_0x27e26c?.[_0x4c8642(0x12f)](/\{[\s\S]*?\},/g)||[];if(_0x3d6575['length']>0x0){const _0x294bb5=_0x3d6575[_0x3d6575['length']-0x1];if(_0x294bb5){const _0x13546b=_0x35f63e['lastIndexOf'](_0x294bb5),_0x33707a=_0x13546b+_0x294bb5[_0x4c8642(0x109)];return _0x35f63e[_0x4c8642(0x12a)](0x0,_0x33707a)+'\x0a'+_0x37da2d+_0x35f63e['slice'](_0x33707a);}}return _0x35f63e[_0x4c8642(0x12a)](0x0,_0x4889c9)+'\x0a'+_0x37da2d+_0x35f63e[_0x4c8642(0x12a)](_0x4889c9);}async[a59_0x4eaa72(0x114)](_0x41710d,_0x1b9c59){const _0x4f0f13=a59_0x4eaa72;if(!a59_0x1b1004[_0x4f0f13(0x119)](this[_0x4f0f13(0x135)]))throw new Error(_0x4f0f13(0x105)+this[_0x4f0f13(0x135)]);const _0x349a70=await a59_0x1b1004[_0x4f0f13(0x11e)]['readFile'](this[_0x4f0f13(0x135)],'utf8'),_0x53e2dc=this[_0x4f0f13(0x136)](_0x41710d);let _0xb0a517=this['addImport'](_0x349a70,_0x53e2dc,_0x41710d);return _0xb0a517=this['addRoute'](_0xb0a517,_0x1b9c59,_0x53e2dc),_0xb0a517;}}
1
+ function a59_0x24aa(_0x50aa27,_0xcd01f1){_0x50aa27=_0x50aa27-0x73;const _0x12fb4a=a59_0x12fb();let _0x24aad7=_0x12fb4a[_0x50aa27];return _0x24aad7;}const a59_0x232dda=a59_0x24aa;(function(_0x235a12,_0x163446){const _0x3e7c42=a59_0x24aa,_0x40b00b=_0x235a12();while(!![]){try{const _0x2000c1=parseInt(_0x3e7c42(0x7c))/0x1*(-parseInt(_0x3e7c42(0x86))/0x2)+parseInt(_0x3e7c42(0x79))/0x3+parseInt(_0x3e7c42(0x98))/0x4*(-parseInt(_0x3e7c42(0x7b))/0x5)+parseInt(_0x3e7c42(0xa3))/0x6*(parseInt(_0x3e7c42(0x92))/0x7)+-parseInt(_0x3e7c42(0x90))/0x8+parseInt(_0x3e7c42(0x89))/0x9*(-parseInt(_0x3e7c42(0x83))/0xa)+-parseInt(_0x3e7c42(0x75))/0xb*(-parseInt(_0x3e7c42(0x94))/0xc);if(_0x2000c1===_0x163446)break;else _0x40b00b['push'](_0x40b00b['shift']());}catch(_0x1cce04){_0x40b00b['push'](_0x40b00b['shift']());}}}(a59_0x12fb,0x83b3d));function a59_0x12fb(){const _0x23574a=['addImport','655920XTITEs','charAt','1227085SRdnwb','4FRzRFV','match','length','toLowerCase','\x20from\x20\x22../pages/','路由配置更新失败','src','7757110QHkaVW','index','lastIndexOf','287744cYawoZ','message','previewChanges','9kKaspj','indexOf','utf8','join','index.tsx','error','split','3112616oeWygy','includes','959HpTdYd','slice','24KBvDkL','import\x20','map','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','12uUHxxn','addRoute','writeFile','toComponentName','success','existsSync','routerFilePath','promises','路由文件不存在:\x20','未找到路由配置的\x20children\x20数组','开始更新路由配置','35772lQodFy','now','router','10893003oYVCcQ','readFile','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'];a59_0x12fb=function(){return _0x23574a;};return a59_0x12fb();}import a59_0x382a27 from'node:fs';import a59_0x3a9eb3 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a59_0x232dda(0x9e)];constructor(_0x2c0100){const _0x2170f2=a59_0x232dda;this[_0x2170f2(0x9e)]=a59_0x3a9eb3[_0x2170f2(0x8c)](_0x2c0100,_0x2170f2(0x82),'router',_0x2170f2(0x8d));}async['addPageRoute'](_0x454c21,_0x14fa4a){const _0x1ddbe1=a59_0x232dda;if(!a59_0x382a27[_0x1ddbe1(0x9d)](this['routerFilePath']))throw new Error(_0x1ddbe1(0xa0)+this[_0x1ddbe1(0x9e)]);const _0x543bb4=Date[_0x1ddbe1(0x73)]();logger['info'](_0x1ddbe1(0x74),_0x1ddbe1(0xa2),{'pageName':_0x454c21,'routePath':_0x14fa4a,'file':this[_0x1ddbe1(0x9e)]});try{const _0x192a07=await a59_0x382a27['promises'][_0x1ddbe1(0x76)](this[_0x1ddbe1(0x9e)],'utf8'),_0xca1ecf=this[_0x1ddbe1(0x9b)](_0x454c21),_0x25b9bc=this['addImport'](_0x192a07,_0xca1ecf,_0x454c21),_0x4c6761=this[_0x1ddbe1(0x99)](_0x25b9bc,_0x14fa4a,_0xca1ecf);await a59_0x382a27['promises'][_0x1ddbe1(0x9a)](this[_0x1ddbe1(0x9e)],_0x4c6761,'utf8');const _0x3e45a9=Date[_0x1ddbe1(0x73)]()-_0x543bb4;logger[_0x1ddbe1(0x9c)](_0x1ddbe1(0x74),'路由配置更新完成',_0x3e45a9,{'pageName':_0x454c21,'routePath':_0x14fa4a,'componentName':_0xca1ecf});}catch(_0x4f385e){const _0x42adb6=Date[_0x1ddbe1(0x73)]()-_0x543bb4;logger[_0x1ddbe1(0x8e)](_0x1ddbe1(0x74),_0x1ddbe1(0x81),{'pageName':_0x454c21,'routePath':_0x14fa4a,'error':_0x4f385e instanceof Error?_0x4f385e[_0x1ddbe1(0x87)]:String(_0x4f385e),'duration':_0x42adb6});throw _0x4f385e;}}[a59_0x232dda(0x9b)](_0x2d3057){const _0x124a7f=a59_0x232dda;return _0x2d3057[_0x124a7f(0x8f)]('-')[_0x124a7f(0x96)](_0x2bd6c1=>_0x2bd6c1[_0x124a7f(0x7a)](0x0)['toUpperCase']()+_0x2bd6c1['slice'](0x1)[_0x124a7f(0x7f)]())[_0x124a7f(0x8c)]('');}['addImport'](_0x13f1e5,_0x394b7b,_0x13f07e){const _0x2cc666=a59_0x232dda,_0x44232f=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x245fff=_0x13f1e5['match'](_0x44232f)||[],_0xb4b31f=_0x2cc666(0x95)+_0x394b7b+_0x2cc666(0x80)+_0x13f07e+'\x22;';if(_0x13f1e5[_0x2cc666(0x91)](_0xb4b31f))return _0x13f1e5;if(_0x245fff[_0x2cc666(0x7e)]>0x0){const _0x25f2f6=_0x245fff[_0x245fff[_0x2cc666(0x7e)]-0x1];if(_0x25f2f6){const _0x22f949=_0x13f1e5[_0x2cc666(0x85)](_0x25f2f6),_0x410862=_0x22f949+_0x25f2f6['length'];return _0x13f1e5[_0x2cc666(0x93)](0x0,_0x410862)+_0xb4b31f+'\x0a'+_0x13f1e5[_0x2cc666(0x93)](_0x410862);}}const _0x286f47=_0x13f1e5[_0x2cc666(0x7d)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x286f47&&_0x286f47['index']!==undefined){const _0x19b998=_0x286f47[_0x2cc666(0x84)]+_0x286f47[0x0]['length'];return _0x13f1e5['slice'](0x0,_0x19b998)+_0xb4b31f+'\x0a'+_0x13f1e5['slice'](_0x19b998);}return _0x13f1e5;}[a59_0x232dda(0x99)](_0x5b19ba,_0x6e8554,_0x45903f){const _0x49f50d=a59_0x232dda,_0x1b09b8=_0x49f50d(0x77)+_0x6e8554+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<'+_0x45903f+_0x49f50d(0x97);if(_0x5b19ba[_0x49f50d(0x91)]('path:\x20\x22'+_0x6e8554+'\x22'))return _0x5b19ba;const _0xe12f0=/children:\s*\[([\s\S]*?)\]/,_0x14d6e7=_0x5b19ba[_0x49f50d(0x7d)](_0xe12f0);if(!_0x14d6e7||_0x14d6e7['index']===undefined)throw new Error(_0x49f50d(0xa1));const _0x41b66a=_0x14d6e7[0x1],_0x4d9c21=_0x14d6e7['index']+_0x14d6e7[0x0][_0x49f50d(0x8a)]('[')+0x1,_0x427c43=_0x41b66a?.[_0x49f50d(0x7d)](/\{[\s\S]*?\},/g)||[];if(_0x427c43[_0x49f50d(0x7e)]>0x0){const _0x11b689=_0x427c43[_0x427c43[_0x49f50d(0x7e)]-0x1];if(_0x11b689){const _0x505e0f=_0x5b19ba[_0x49f50d(0x85)](_0x11b689),_0x221a4a=_0x505e0f+_0x11b689[_0x49f50d(0x7e)];return _0x5b19ba[_0x49f50d(0x93)](0x0,_0x221a4a)+'\x0a'+_0x1b09b8+_0x5b19ba[_0x49f50d(0x93)](_0x221a4a);}}return _0x5b19ba['slice'](0x0,_0x4d9c21)+'\x0a'+_0x1b09b8+_0x5b19ba[_0x49f50d(0x93)](_0x4d9c21);}async[a59_0x232dda(0x88)](_0x48b930,_0x442e82){const _0x5aea1a=a59_0x232dda;if(!a59_0x382a27[_0x5aea1a(0x9d)](this[_0x5aea1a(0x9e)]))throw new Error(_0x5aea1a(0xa0)+this[_0x5aea1a(0x9e)]);const _0xa58333=await a59_0x382a27[_0x5aea1a(0x9f)][_0x5aea1a(0x76)](this[_0x5aea1a(0x9e)],_0x5aea1a(0x8b)),_0x39250c=this[_0x5aea1a(0x9b)](_0x48b930);let _0x24e740=this[_0x5aea1a(0x78)](_0xa58333,_0x39250c,_0x48b930);return _0x24e740=this[_0x5aea1a(0x99)](_0x24e740,_0x442e82,_0x39250c),_0x24e740;}}
@@ -1 +1 @@
1
- export function sleep(_0x5833bf){return new Promise(_0x1da612=>setTimeout(_0x1da612,_0x5833bf));}
1
+ export function sleep(_0x35fc7f){return new Promise(_0x1b05fe=>setTimeout(_0x1b05fe,_0x35fc7f));}
@@ -1 +1 @@
1
- const a61_0x3f88ec=a61_0x15e0;(function(_0x446378,_0x517609){const _0xa1375=a61_0x15e0,_0x2d0df3=_0x446378();while(!![]){try{const _0x269f00=-parseInt(_0xa1375(0x12c))/0x1+-parseInt(_0xa1375(0x149))/0x2+parseInt(_0xa1375(0x144))/0x3+-parseInt(_0xa1375(0x135))/0x4+-parseInt(_0xa1375(0x156))/0x5+parseInt(_0xa1375(0x169))/0x6*(-parseInt(_0xa1375(0x14f))/0x7)+parseInt(_0xa1375(0x13c))/0x8;if(_0x269f00===_0x517609)break;else _0x2d0df3['push'](_0x2d0df3['shift']());}catch(_0x2917f8){_0x2d0df3['push'](_0x2d0df3['shift']());}}}(a61_0x3f8a,0x95b4f));function a61_0x15e0(_0x123da7,_0x51a41b){_0x123da7=_0x123da7-0x129;const _0x3f8a84=a61_0x3f8a();let _0x15e09e=_0x3f8a84[_0x123da7];return _0x15e09e;}import a61_0x236b12 from'node:fs';import a61_0x1d9dcd from'node:path';import{logger}from'./logger.js';function a61_0x3f8a(){const _0x5b91a3=['.ts','datasetCode:\x20\x22','toUpperCase','extname','2271195rrufEN','toDisplayTitle','api','split','2-digit','name','now','.js','copyFile','slice','template','.jsx','processDirectory','.css','endsWith','push','tableName','mkdir','.tpl','30BxrbCb','\x0a\x20\x20\x20\x20{\x20','toComponentName','info','.md','1057223lvsnTQ','.json','map','toLowerCase','alias','readFile','readdir','toISOString','utf8','505492WLtHwN','replaceContent','pop','isFile','charAt','default','toLocaleTimeString','22724256iYAFFf','includes','writeFile','toLocaleDateString','name:\x20\x22','YourModel','promises','replace','3655326eKwtCv','alias:\x20\x22','模板内容替换完成','processTemplate','numeric','2440250mjdnZH','isDirectory','tableName:\x20\x22','replaceApiContent','\x20},','message','822941siniHl','join','.scss'];a61_0x3f8a=function(){return _0x5b91a3;};return a61_0x3f8a();}export class TemplateReplacer{static[a61_0x3f88ec(0x129)](_0x20a093){const _0x3496ec=a61_0x3f88ec,_0x178099=_0x20a093[_0x3496ec(0x159)]('/')[_0x3496ec(0x137)]()||_0x20a093;return _0x178099[_0x3496ec(0x159)]('-')[_0x3496ec(0x12e)](_0x3ceebe=>_0x3ceebe[_0x3496ec(0x139)](0x0)[_0x3496ec(0x154)]()+_0x3ceebe['slice'](0x1)[_0x3496ec(0x12f)]())[_0x3496ec(0x150)]('');}static['toDisplayTitle'](_0x29ab1f){const _0x14041b=a61_0x3f88ec,_0x526c26=_0x29ab1f[_0x14041b(0x159)]('/')[_0x14041b(0x137)]()||_0x29ab1f;return _0x526c26[_0x14041b(0x159)]('-')[_0x14041b(0x12e)](_0x3c6d5b=>_0x3c6d5b[_0x14041b(0x139)](0x0)['toUpperCase']()+_0x3c6d5b[_0x14041b(0x15f)](0x1)[_0x14041b(0x12f)]())['join']('\x20');}static[a61_0x3f88ec(0x136)](_0x237b98,_0x1e6cf6,_0x5de7b1){const _0x593c7f=a61_0x3f88ec,_0x193084=this[_0x593c7f(0x129)](_0x1e6cf6),_0x37b6aa=this[_0x593c7f(0x157)](_0x1e6cf6),_0x30434d=new Date(),_0x2042a5=_0x30434d['toLocaleString'](undefined,{'year':_0x593c7f(0x148),'month':_0x593c7f(0x15a),'day':_0x593c7f(0x15a),'hour':_0x593c7f(0x15a),'minute':_0x593c7f(0x15a),'second':_0x593c7f(0x15a),'hour12':![]})[_0x593c7f(0x143)](/\//g,'-'),_0x1442cf=_0x30434d[_0x593c7f(0x13f)](undefined,{'year':_0x593c7f(0x148),'month':_0x593c7f(0x15a),'day':_0x593c7f(0x15a)})['replace'](/\//g,'-'),_0x1b18a0=_0x30434d[_0x593c7f(0x13b)](undefined,{'hour12':![]});let _0x5299d2=_0x237b98[_0x593c7f(0x143)](/\{ComponentName\}/g,_0x193084)['replace'](/\{DisplayTitle\}/g,_0x37b6aa)['replace'](/\{PageName\}/g,_0x1e6cf6)['replace'](/\{TemplateName\}/g,_0x5de7b1)[_0x593c7f(0x143)](/\{CreatedAt\}/g,_0x2042a5)[_0x593c7f(0x143)](/\{CreatedDate\}/g,_0x1442cf)[_0x593c7f(0x143)](/\{CreatedTime\}/g,_0x1b18a0);return _0x5299d2;}static[a61_0x3f88ec(0x14c)](_0x51fa68,_0x368528,_0x110031,_0x2b2b0e,_0x5af683,_0x54ab9b,_0x539924){const _0x1077c1=a61_0x3f88ec,_0x32b86d=new Date(),_0x17ec22=_0x32b86d[_0x1077c1(0x133)](),_0xa447c1=_0x110031[_0x1077c1(0x12e)](_0x1eaae8=>{const _0xcf0261=_0x1077c1,_0x344300=[_0xcf0261(0x153)+_0x1eaae8['datasetCode']+'\x22',_0xcf0261(0x14b)+_0x1eaae8[_0xcf0261(0x166)]+'\x22',_0xcf0261(0x140)+_0x1eaae8[_0xcf0261(0x15b)]+'\x22'];return _0x1eaae8[_0xcf0261(0x130)]&&_0x344300[_0xcf0261(0x165)](_0xcf0261(0x145)+_0x1eaae8[_0xcf0261(0x130)]+'\x22'),_0xcf0261(0x16a)+_0x344300['join'](',\x20')+_0xcf0261(0x14d);})[_0x1077c1(0x150)](''),_0x4eae98=_0x2b2b0e||_0x110031[0x0]?.[_0x1077c1(0x130)]||_0x1077c1(0x141);let _0x463c26=_0x51fa68[_0x1077c1(0x143)](/\{AppCode\}/g,_0x368528)[_0x1077c1(0x143)](/\{ModelConfigs\}/g,_0xa447c1)['replace'](/\{ExampleModelName\}/g,_0x4eae98)[_0x1077c1(0x143)](/\{ApiFileName\}/g,_0x5af683||_0x1077c1(0x158))[_0x1077c1(0x143)](/\{ConfigName\}/g,_0x54ab9b||_0x1077c1(0x13a))['replace'](/\{ClientConfigParam\}/g,_0x539924||'')[_0x1077c1(0x143)](/\{CreatedAt\}/g,_0x17ec22);return _0x463c26;}static async[a61_0x3f88ec(0x147)](_0x1d9db6,_0x22cd82,_0x773e14,_0x5b01f4,_0x175862=!![]){const _0x40dde6=a61_0x3f88ec,_0x5939f2=Date[_0x40dde6(0x15c)]();try{_0x175862&&logger[_0x40dde6(0x12a)](_0x40dde6(0x160),'开始处理模板内容替换',{'templatePath':_0x1d9db6,'targetPath':_0x22cd82,'pageName':_0x773e14,'templateName':_0x5b01f4});await a61_0x236b12['promises'][_0x40dde6(0x167)](_0x22cd82,{'recursive':!![]}),await this[_0x40dde6(0x162)](_0x1d9db6,_0x22cd82,_0x773e14,_0x5b01f4);if(_0x175862){const _0x1b569f=Date[_0x40dde6(0x15c)]()-_0x5939f2;logger['success'](_0x40dde6(0x160),_0x40dde6(0x146),_0x1b569f,{'pageName':_0x773e14,'templateName':_0x5b01f4});}}catch(_0x34d9fa){if(_0x175862){const _0x3b30c3=Date['now']()-_0x5939f2;logger['error']('template','模板内容替换失败',{'templatePath':_0x1d9db6,'targetPath':_0x22cd82,'pageName':_0x773e14,'templateName':_0x5b01f4,'error':_0x34d9fa instanceof Error?_0x34d9fa[_0x40dde6(0x14e)]:String(_0x34d9fa),'duration':_0x3b30c3});}throw _0x34d9fa;}}static async[a61_0x3f88ec(0x162)](_0x5f5247,_0x861e1e,_0x38bd1a,_0x5d5bfd){const _0x3e5778=a61_0x3f88ec,_0x3efc3c=await a61_0x236b12[_0x3e5778(0x142)][_0x3e5778(0x132)](_0x5f5247,{'withFileTypes':!![]});for(const _0x52db2a of _0x3efc3c){const _0xbc3917=a61_0x1d9dcd[_0x3e5778(0x150)](_0x5f5247,_0x52db2a[_0x3e5778(0x15b)]);let _0x1d2f5f=a61_0x1d9dcd[_0x3e5778(0x150)](_0x861e1e,_0x52db2a[_0x3e5778(0x15b)]);_0x52db2a[_0x3e5778(0x15b)][_0x3e5778(0x164)](_0x3e5778(0x168))&&(_0x1d2f5f=a61_0x1d9dcd[_0x3e5778(0x150)](_0x861e1e,_0x52db2a[_0x3e5778(0x15b)][_0x3e5778(0x143)](/\.tpl$/,'')));if(_0x52db2a[_0x3e5778(0x14a)]())await a61_0x236b12['promises'][_0x3e5778(0x167)](_0x1d2f5f,{'recursive':!![]}),await this['processDirectory'](_0xbc3917,_0x1d2f5f,_0x38bd1a,_0x5d5bfd);else _0x52db2a[_0x3e5778(0x138)]()&&await this['processFile'](_0xbc3917,_0x1d2f5f,_0x38bd1a,_0x5d5bfd);}}static async['processFile'](_0x18d1ac,_0x2c1ad5,_0x3e5998,_0x26fdb2){const _0x17a627=a61_0x3f88ec,_0x3de55a=a61_0x1d9dcd[_0x17a627(0x155)](_0x18d1ac)[_0x17a627(0x12f)]();_0x18d1ac[_0x17a627(0x164)](_0x17a627(0x168))&&(_0x2c1ad5=_0x2c1ad5['replace'](/\.tpl$/,''));const _0x29ec97=['.tsx',_0x17a627(0x152),_0x17a627(0x161),_0x17a627(0x15d),_0x17a627(0x12d),_0x17a627(0x12b),_0x17a627(0x163),_0x17a627(0x151),_0x17a627(0x168)];if(_0x29ec97[_0x17a627(0x13d)](_0x3de55a)||_0x18d1ac[_0x17a627(0x164)](_0x17a627(0x168))){const _0x80f78f=await a61_0x236b12[_0x17a627(0x142)][_0x17a627(0x131)](_0x18d1ac,_0x17a627(0x134)),_0x4b1a3a=this[_0x17a627(0x136)](_0x80f78f,_0x3e5998,_0x26fdb2);await a61_0x236b12['promises'][_0x17a627(0x13e)](_0x2c1ad5,_0x4b1a3a,'utf8');}else await a61_0x236b12[_0x17a627(0x142)][_0x17a627(0x15e)](_0x18d1ac,_0x2c1ad5);}}
1
+ const a61_0x175b81=a61_0x5c82;function a61_0x14bf(){const _0x35ad9b=['toUpperCase','default','mkdir','.css','message','45573ZCiCXO','toLocaleTimeString','slice','map','info','4BdYhyN','toISOString','replace','endsWith','push','split','readdir','copyFile','isDirectory','charAt','toDisplayTitle','.tsx','.md','template','readFile','toLocaleString','.jsx','\x20},','promises','8mMdoxA','\x0a\x20\x20\x20\x20{\x20','6ivbnKv','name','4400118PMMCGc','error','alias','模板内容替换完成','writeFile','toComponentName','11668TCNeqT','api','.tpl','extname','1049240DzNGve','now','264aJkmsX','pop','numeric','tableName:\x20\x22','join','809150RlmdmI','toLowerCase','YourModel','tableName','replaceApiContent','processFile','toLocaleDateString','alias:\x20\x22','processDirectory','46838xBKAVL','4QVAJLV','utf8','replaceContent','.ts','1016813FmUlAx','2-digit','datasetCode'];a61_0x14bf=function(){return _0x35ad9b;};return a61_0x14bf();}function a61_0x5c82(_0x25e0df,_0x1fe6a4){_0x25e0df=_0x25e0df-0xb7;const _0x14bf12=a61_0x14bf();let _0x5c82e7=_0x14bf12[_0x25e0df];return _0x5c82e7;}(function(_0x55a172,_0x3dbc16){const _0x2b87ce=a61_0x5c82,_0x20c2c0=_0x55a172();while(!![]){try{const _0x55fb33=-parseInt(_0x2b87ce(0xf4))/0x1*(-parseInt(_0x2b87ce(0xdf))/0x2)+parseInt(_0x2b87ce(0xbd))/0x3+-parseInt(_0x2b87ce(0xc2))/0x4*(parseInt(_0x2b87ce(0xea))/0x5)+-parseInt(_0x2b87ce(0xd7))/0x6*(parseInt(_0x2b87ce(0xf8))/0x7)+parseInt(_0x2b87ce(0xd5))/0x8*(parseInt(_0x2b87ce(0xd9))/0x9)+parseInt(_0x2b87ce(0xe3))/0xa+parseInt(_0x2b87ce(0xf3))/0xb*(parseInt(_0x2b87ce(0xe5))/0xc);if(_0x55fb33===_0x3dbc16)break;else _0x20c2c0['push'](_0x20c2c0['shift']());}catch(_0x5f5a14){_0x20c2c0['push'](_0x20c2c0['shift']());}}}(a61_0x14bf,0x6647c));import a61_0x526b22 from'node:fs';import a61_0x19ab8c from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a61_0x175b81(0xde)](_0x177d36){const _0x13aa32=a61_0x175b81,_0x5501c8=_0x177d36[_0x13aa32(0xc7)]('/')['pop']()||_0x177d36;return _0x5501c8[_0x13aa32(0xc7)]('-')[_0x13aa32(0xc0)](_0x1c8461=>_0x1c8461[_0x13aa32(0xcb)](0x0)[_0x13aa32(0xb8)]()+_0x1c8461[_0x13aa32(0xbf)](0x1)[_0x13aa32(0xeb)]())['join']('');}static['toDisplayTitle'](_0x59969b){const _0x2c117b=a61_0x175b81,_0xf63132=_0x59969b[_0x2c117b(0xc7)]('/')[_0x2c117b(0xe6)]()||_0x59969b;return _0xf63132[_0x2c117b(0xc7)]('-')[_0x2c117b(0xc0)](_0x5d3d1d=>_0x5d3d1d[_0x2c117b(0xcb)](0x0)['toUpperCase']()+_0x5d3d1d[_0x2c117b(0xbf)](0x1)[_0x2c117b(0xeb)]())[_0x2c117b(0xe9)]('\x20');}static['replaceContent'](_0x5911fd,_0x2b9ea0,_0xd02018){const _0x207905=a61_0x175b81,_0x9bdf47=this[_0x207905(0xde)](_0x2b9ea0),_0x83e5e5=this[_0x207905(0xcc)](_0x2b9ea0),_0x1c6429=new Date(),_0x3f7b2c=_0x1c6429[_0x207905(0xd1)](undefined,{'year':_0x207905(0xe7),'month':_0x207905(0xf9),'day':'2-digit','hour':'2-digit','minute':_0x207905(0xf9),'second':_0x207905(0xf9),'hour12':![]})['replace'](/\//g,'-'),_0x5bc2ef=_0x1c6429[_0x207905(0xf0)](undefined,{'year':_0x207905(0xe7),'month':_0x207905(0xf9),'day':'2-digit'})[_0x207905(0xc4)](/\//g,'-'),_0x1be29e=_0x1c6429[_0x207905(0xbe)](undefined,{'hour12':![]});let _0x120a41=_0x5911fd[_0x207905(0xc4)](/\{ComponentName\}/g,_0x9bdf47)[_0x207905(0xc4)](/\{DisplayTitle\}/g,_0x83e5e5)[_0x207905(0xc4)](/\{PageName\}/g,_0x2b9ea0)[_0x207905(0xc4)](/\{TemplateName\}/g,_0xd02018)[_0x207905(0xc4)](/\{CreatedAt\}/g,_0x3f7b2c)[_0x207905(0xc4)](/\{CreatedDate\}/g,_0x5bc2ef)[_0x207905(0xc4)](/\{CreatedTime\}/g,_0x1be29e);return _0x120a41;}static[a61_0x175b81(0xee)](_0x1bb119,_0x595bb3,_0x16ffa7,_0x233b5a,_0x2e4cf6,_0x19aab3,_0x2ac58d){const _0xfd0422=a61_0x175b81,_0x56abcb=new Date(),_0x32106a=_0x56abcb[_0xfd0422(0xc3)](),_0x105fae=_0x16ffa7[_0xfd0422(0xc0)](_0x16f9e6=>{const _0x526313=_0xfd0422,_0x2111d4=['datasetCode:\x20\x22'+_0x16f9e6[_0x526313(0xb7)]+'\x22',_0x526313(0xe8)+_0x16f9e6[_0x526313(0xed)]+'\x22','name:\x20\x22'+_0x16f9e6[_0x526313(0xd8)]+'\x22'];return _0x16f9e6['alias']&&_0x2111d4[_0x526313(0xc6)](_0x526313(0xf1)+_0x16f9e6[_0x526313(0xdb)]+'\x22'),_0x526313(0xd6)+_0x2111d4[_0x526313(0xe9)](',\x20')+_0x526313(0xd3);})[_0xfd0422(0xe9)](''),_0x673f81=_0x233b5a||_0x16ffa7[0x0]?.[_0xfd0422(0xdb)]||_0xfd0422(0xec);let _0xd9eeba=_0x1bb119[_0xfd0422(0xc4)](/\{AppCode\}/g,_0x595bb3)[_0xfd0422(0xc4)](/\{ModelConfigs\}/g,_0x105fae)[_0xfd0422(0xc4)](/\{ExampleModelName\}/g,_0x673f81)[_0xfd0422(0xc4)](/\{ApiFileName\}/g,_0x2e4cf6||_0xfd0422(0xe0))[_0xfd0422(0xc4)](/\{ConfigName\}/g,_0x19aab3||_0xfd0422(0xb9))['replace'](/\{ClientConfigParam\}/g,_0x2ac58d||'')[_0xfd0422(0xc4)](/\{CreatedAt\}/g,_0x32106a);return _0xd9eeba;}static async['processTemplate'](_0x2c1076,_0x3ef750,_0x4f8def,_0x1e556c,_0x1119e1=!![]){const _0x36932b=a61_0x175b81,_0x2e4fab=Date[_0x36932b(0xe4)]();try{_0x1119e1&&logger[_0x36932b(0xc1)](_0x36932b(0xcf),'开始处理模板内容替换',{'templatePath':_0x2c1076,'targetPath':_0x3ef750,'pageName':_0x4f8def,'templateName':_0x1e556c});await a61_0x526b22[_0x36932b(0xd4)][_0x36932b(0xba)](_0x3ef750,{'recursive':!![]}),await this[_0x36932b(0xf2)](_0x2c1076,_0x3ef750,_0x4f8def,_0x1e556c);if(_0x1119e1){const _0xfbe0cd=Date[_0x36932b(0xe4)]()-_0x2e4fab;logger['success']('template',_0x36932b(0xdc),_0xfbe0cd,{'pageName':_0x4f8def,'templateName':_0x1e556c});}}catch(_0x4d2c6f){if(_0x1119e1){const _0xab3850=Date[_0x36932b(0xe4)]()-_0x2e4fab;logger[_0x36932b(0xda)](_0x36932b(0xcf),'模板内容替换失败',{'templatePath':_0x2c1076,'targetPath':_0x3ef750,'pageName':_0x4f8def,'templateName':_0x1e556c,'error':_0x4d2c6f instanceof Error?_0x4d2c6f[_0x36932b(0xbc)]:String(_0x4d2c6f),'duration':_0xab3850});}throw _0x4d2c6f;}}static async['processDirectory'](_0x114351,_0x3740b3,_0x299265,_0x5e04ba){const _0xf1a15c=a61_0x175b81,_0x4d6ad1=await a61_0x526b22['promises'][_0xf1a15c(0xc8)](_0x114351,{'withFileTypes':!![]});for(const _0x5229ae of _0x4d6ad1){const _0x410d91=a61_0x19ab8c[_0xf1a15c(0xe9)](_0x114351,_0x5229ae[_0xf1a15c(0xd8)]);let _0x19ece2=a61_0x19ab8c['join'](_0x3740b3,_0x5229ae['name']);_0x5229ae[_0xf1a15c(0xd8)]['endsWith'](_0xf1a15c(0xe1))&&(_0x19ece2=a61_0x19ab8c['join'](_0x3740b3,_0x5229ae[_0xf1a15c(0xd8)][_0xf1a15c(0xc4)](/\.tpl$/,'')));if(_0x5229ae[_0xf1a15c(0xca)]())await a61_0x526b22[_0xf1a15c(0xd4)][_0xf1a15c(0xba)](_0x19ece2,{'recursive':!![]}),await this[_0xf1a15c(0xf2)](_0x410d91,_0x19ece2,_0x299265,_0x5e04ba);else _0x5229ae['isFile']()&&await this[_0xf1a15c(0xef)](_0x410d91,_0x19ece2,_0x299265,_0x5e04ba);}}static async[a61_0x175b81(0xef)](_0x4fadc9,_0x352a89,_0x514b3b,_0x3c62a1){const _0x5afe50=a61_0x175b81,_0xbe5603=a61_0x19ab8c[_0x5afe50(0xe2)](_0x4fadc9)[_0x5afe50(0xeb)]();_0x4fadc9['endsWith']('.tpl')&&(_0x352a89=_0x352a89[_0x5afe50(0xc4)](/\.tpl$/,''));const _0xce8d62=[_0x5afe50(0xcd),_0x5afe50(0xf7),_0x5afe50(0xd2),'.js','.json',_0x5afe50(0xce),_0x5afe50(0xbb),'.scss','.tpl'];if(_0xce8d62['includes'](_0xbe5603)||_0x4fadc9[_0x5afe50(0xc5)](_0x5afe50(0xe1))){const _0x2342ae=await a61_0x526b22['promises'][_0x5afe50(0xd0)](_0x4fadc9,_0x5afe50(0xf5)),_0x1ccbe1=this[_0x5afe50(0xf6)](_0x2342ae,_0x514b3b,_0x3c62a1);await a61_0x526b22[_0x5afe50(0xd4)][_0x5afe50(0xdd)](_0x352a89,_0x1ccbe1,_0x5afe50(0xf5));}else await a61_0x526b22[_0x5afe50(0xd4)][_0x5afe50(0xc9)](_0x4fadc9,_0x352a89);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.2.1-beta.4",
3
+ "version": "1.2.3",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"
@@ -43,14 +43,14 @@
43
43
  "listr": "^0.14.3",
44
44
  "meow": "^13.2.0",
45
45
  "prettier": "^3.6.2",
46
- "react": "^19.1.1",
46
+ "react": "^19.2.0",
47
47
  "semver": "^7.7.3",
48
48
  "winston": "^3.17.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/listr": "^0.14.9",
52
52
  "@types/node": "^24.5.2",
53
- "@types/react": "^19.1.12",
53
+ "@types/react": "^19.2.0",
54
54
  "@types/semver": "^7.7.1",
55
55
  "@vitest/coverage-v8": "^3.2.4",
56
56
  "@vitest/ui": "^3.2.4",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sub-app-react-demo",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@ant-design/icons": "^6.0.0",
13
13
  "@ice/stark-app": "^1.5.0",
14
- "@lovrabet/sdk": "^1.1.24",
14
+ "@lovrabet/sdk": "latest",
15
15
  "antd": "^5.26.7",
16
16
  "echarts": "^5.6.0",
17
17
  "echarts-for-react": "^3.0.2",
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Generated by Lovrabet CLI
3
+ * Created: 2025-12-30T11:26:52.194Z
3
4
  *
4
5
  * 这个文件包含了项目的模型配置,并自动注册到 SDK 中
5
6
  * CLI 工具会自动维护这个文件,通常不需要手动修改
@@ -11,41 +12,57 @@ export const LOVRABET_APP_CODE = "app-c4c89304";
11
12
 
12
13
  /**
13
14
  * 项目的模型配置
14
- * 包含所有数据表的映射关系
15
+ * 使用数组格式,每个模型包含 datasetCode、tableName、name 和可选的 alias
16
+ *
17
+ * 访问方式:
18
+ * - 标准访问:client.models.dataset_[datasetCode]
19
+ * - 别名访问:client.models.[alias](如果配置了 alias)
15
20
  */
16
21
  export const LOVRABET_MODELS_CONFIG: ModelsConfig = {
17
22
  appCode: LOVRABET_APP_CODE,
18
- models: {
19
- // ProjectMembers: {
20
- // tableName: "project_members",
21
- // datasetCode: "71494bcba13f4ec7858abe90794183ad",
22
- // },
23
- Requirements: {
24
- tableName: "requirements",
25
- datasetCode: "d26ed512e878461ca97d287a47606fd3",
26
- },
27
- Projects: {
28
- tableName: "projects",
29
- datasetCode: "c6e55d6720b84ffcb21698b0a04ccd23",
23
+ models: [
24
+ {
25
+ datasetCode: "3ff202af07164d0a9c5df7ddd8f83c23",
26
+ tableName: "dataset_f83c23",
27
+ name: "客户访谈记录",
28
+ alias: "datasetF83c23",
30
29
  },
31
- Iterations: {
32
- tableName: "iterations",
30
+ {
33
31
  datasetCode: "a60f11c17c5344e7a26d5144212cf366",
32
+ tableName: "iterations",
33
+ name: "迭代信息",
34
+ alias: "iterations",
34
35
  },
35
- RequirementTypes: {
36
- tableName: "requirement_types",
36
+ {
37
+ datasetCode: "d26ed512e878461ca97d287a47606fd3",
38
+ tableName: "requirements",
39
+ name: "需求",
40
+ alias: "requirements",
41
+ },
42
+ {
37
43
  datasetCode: "f17f1ee941c1468e87e6a0ca655ce00e",
44
+ tableName: "requirement_types",
45
+ name: "需求类型",
46
+ alias: "requirementTypes",
38
47
  },
39
- CustomerInterviews: {
40
- tableName: "dataset_3c23",
41
- datasetCode: "3ff202af07164d0a9c5df7ddd8f83c23",
48
+ {
49
+ datasetCode: "c6e55d6720b84ffcb21698b0a04ccd23",
50
+ tableName: "projects",
51
+ name: "项目",
52
+ alias: "projects",
53
+ },
54
+ {
55
+ datasetCode: "71494bcba13f4ec7858abe90794183ad",
56
+ tableName: "project_members",
57
+ name: "项目成员",
58
+ alias: "projectMembers",
42
59
  },
43
- }
60
+ ],
44
61
  } as const;
45
62
 
46
63
  /**
47
- * 自动注册默认配置
48
- * 这样 createClient() 就可以无参数调用
64
+ * 自动注册配置
65
+ * 配置名称: CONFIG_NAMES.DEFAULT
49
66
  */
50
67
  registerModels(LOVRABET_MODELS_CONFIG, CONFIG_NAMES.DEFAULT);
51
68
 
@@ -55,12 +72,12 @@ registerModels(LOVRABET_MODELS_CONFIG, CONFIG_NAMES.DEFAULT);
55
72
  * // 开发环境配置
56
73
  * registerModels({
57
74
  * appCode: 'app-dev-123',
58
- * models: { ... }
75
+ * models: [...]
59
76
  * }, 'dev');
60
77
  *
61
78
  * // 其他项目配置
62
79
  * registerModels({
63
80
  * appCode: 'other-project',
64
- * models: { ... }
81
+ * models: [...]
65
82
  * }, 'project-b');
66
83
  */
@@ -1,16 +1,18 @@
1
1
  /**
2
2
  * Lovrabet SDK 客户端实例
3
+ * Generated by Lovrabet CLI
4
+ * Created: 2025-12-30T11:26:52.241Z
3
5
  *
4
6
  * 这个文件负责创建和导出统一的客户端实例,供整个应用使用
5
7
  * 通过导入 './api' 文件来自动执行配置注册
6
8
  */
7
9
 
8
- import { createClient } from "@lovrabet/sdk";
10
+ import { createClient, CONFIG_NAMES } from "@lovrabet/sdk";
9
11
  import "./api"; // 导入配置文件,执行 registerModels() 注册
10
12
 
11
13
  /**
12
14
  * 主要的客户端实例
13
- * 使用最简洁的方式创建:无参数调用,自动使用已注册的 'default' 配置
15
+ * 使用配置名称 'CONFIG_NAMES.DEFAULT' 创建客户端
14
16
  */
15
17
  export const lovrabetClient = createClient();
16
18
 
@@ -21,26 +23,25 @@ export const lovrabetClient = createClient();
21
23
  * import { lovrabetClient } from '@/api/client';
22
24
  *
23
25
  * // 获取数据列表
24
- * const requirements = await lovrabetClient.models.Requirements.getList({
26
+ * const data = await lovrabetClient.models.datasetF83c23.getList({
25
27
  * currentPage: 1,
26
28
  * pageSize: 20
27
29
  * });
28
30
  *
29
31
  * // 获取单条记录
30
- * const requirement = await lovrabetClient.models.Requirements.getOne('123');
32
+ * const record = await lovrabetClient.models.datasetF83c23.getOne('123');
31
33
  *
32
34
  * // 创建新记录
33
- * const newRequirement = await lovrabetClient.models.Requirements.create({
34
- * title: '新需求',
35
- * description: '需求描述'
35
+ * const newRecord = await lovrabetClient.models.datasetF83c23.create({
36
+ * // 记录数据
36
37
  * });
37
38
  */
38
39
 
39
40
  /**
40
41
  * 其他创建客户端的方式(根据需要选择):
41
42
  *
42
- * 1. 明确指定配置名称:
43
- * export const lovrabetClient = createClient('default');
43
+ * 1. 使用默认配置(无参数调用):
44
+ * export const lovrabetClient = createClient();
44
45
  *
45
46
  * 2. 使用其他已注册的配置:
46
47
  * export const devClient = createClient('dev');
@@ -52,7 +53,7 @@ export const lovrabetClient = createClient();
52
53
  *
53
54
  * 4. 通过 ClientConfig 指定配置名和其他选项:
54
55
  * export const lovrabetClient = createClient({
55
- * modelConfigName: 'default',
56
+ * apiConfigName: 'default',
56
57
  * token: 'custom-token',
57
58
  * env: 'daily'
58
59
  * });