@lovrabet/cli 1.3.2 → 1.3.4-beta.0

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 (89) hide show
  1. package/lib/ai-setup/AISetupUI.js +1 -1
  2. package/lib/ai-setup/config.js +1 -1
  3. package/lib/api/api-doc-ui.js +1 -1
  4. package/lib/api/api-doc.js +1 -1
  5. package/lib/api/api-pull-ui.js +1 -1
  6. package/lib/api/fetch-model-list.js +1 -1
  7. package/lib/api/generate-api-file.js +1 -1
  8. package/lib/api/main.js +1 -1
  9. package/lib/api/pull-silent.js +1 -1
  10. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  11. package/lib/app-menu/create-menu.js +1 -1
  12. package/lib/app-menu/get-local-pages.js +1 -1
  13. package/lib/app-menu/get-online-menu-list.js +1 -1
  14. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  15. package/lib/app-menu/utils.js +1 -1
  16. package/lib/app-menu/valid-url.js +1 -1
  17. package/lib/app-menu-update-cdn/current-content.js +1 -1
  18. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  19. package/lib/app-menu-update-cdn/main.js +1 -1
  20. package/lib/app-menu-update-cdn/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-flags.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-execa.js +1 -0
  34. package/lib/cmd/start.js +1 -1
  35. package/lib/config/config-help.js +1 -1
  36. package/lib/config/main.js +1 -1
  37. package/lib/constant/domain.js +1 -1
  38. package/lib/constant/env.js +1 -1
  39. package/lib/create-app/enhanced-guided-create.js +1 -1
  40. package/lib/create-app/format-elapsed.js +1 -1
  41. package/lib/create-app/main.js +1 -1
  42. package/lib/create-app/non-interactive.js +1 -1
  43. package/lib/create-app/task-finished.js +1 -1
  44. package/lib/create-app/task-loading.js +1 -1
  45. package/lib/create-app/task-running.js +1 -1
  46. package/lib/create-app/task-time.js +1 -1
  47. package/lib/create-app/use-copy-project-template.js +1 -1
  48. package/lib/create-app/use-format-code.js +1 -1
  49. package/lib/create-app/use-install-dependencies.js +1 -1
  50. package/lib/help.js +1 -1
  51. package/lib/i18n/I18nProvider.js +1 -0
  52. package/lib/i18n/hooks.js +1 -0
  53. package/lib/i18n/index.js +1 -0
  54. package/lib/i18n/locales/en-US.js +1 -0
  55. package/lib/i18n/locales/zh-CN.js +1 -0
  56. package/lib/init/main.js +1 -1
  57. package/lib/mcp/McpInstallUI.js +1 -1
  58. package/lib/mcp/claude.js +1 -1
  59. package/lib/mcp/cursor.js +1 -1
  60. package/lib/mcp/main.js +1 -1
  61. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  62. package/lib/mcp/mcp-installer.js +1 -1
  63. package/lib/skills/SkillInstallUI.js +1 -1
  64. package/lib/skills/main.js +1 -1
  65. package/lib/skills/skill-install-non-interactive.js +1 -1
  66. package/lib/skills/skill-installer.js +1 -1
  67. package/lib/ui/IDESelector.js +1 -1
  68. package/lib/ui/useIDESelection.js +1 -1
  69. package/lib/utils/ai_config.js +1 -1
  70. package/lib/utils/cdn-config.js +1 -1
  71. package/lib/utils/check-sdk-version.js +1 -1
  72. package/lib/utils/cli-version-check.js +1 -1
  73. package/lib/utils/config.js +1 -1
  74. package/lib/utils/copy-directory.js +1 -1
  75. package/lib/utils/file-utils.js +1 -1
  76. package/lib/utils/guides-cdn.js +1 -1
  77. package/lib/utils/http-client.js +1 -1
  78. package/lib/utils/logger.js +1 -1
  79. package/lib/utils/rules-cdn.js +1 -1
  80. package/lib/utils/sleep.js +1 -1
  81. package/lib/utils/template-replacer.js +1 -1
  82. package/package.json +6 -1
  83. package/templates/README.md +10 -55
  84. package/lib/add-page/input-page-router.js +0 -1
  85. package/lib/add-page/main.js +0 -1
  86. package/lib/add-page/select-page-template.js +0 -1
  87. package/lib/utils/router-updater.js +0 -1
  88. package/templates/pages/blank/index.tsx.tpl +0 -13
  89. package/templates/pages/sdk-fetch/index.tsx.tpl +0 -80
@@ -1 +1 @@
1
- const a3_0x11b8c3=a3_0x5545;function a3_0x14c3(){const _0x401dd5=['技能包\x20(研发规范指南)','681390pOWluJ','ide','installing','status','请至少选择一个配置项','push','qoder','trae','136LVriXt','upArrow','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','selecting','appcode','codex','codebuddy','done','name','add','MCP\x20服务器\x20(AI\x20访问数据集)','size','cyan','claude','delete','61220AjRSUt','45618fxxHms','length','259RswzWq','filter','skill-','downArrow','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认','red','projectRoot','dimColor','success','2439WFvgFn','confirming','[N]\x20跳过,稍后手动配置','opencode','return','5870249nJityt','antigravity','blue','[✓]','cursor','[\x20]','gray','has','7144ISkLTB','column','white','正在配置\x20AI\x20助手...','error','map','12TWKEmO','message','Cursor','25158XjdsUh','6011970VFjCTy','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范'];a3_0x14c3=function(){return _0x401dd5;};return a3_0x14c3();}(function(_0x144990,_0x382a58){const _0x87b8bf=a3_0x5545,_0x3aad10=_0x144990();while(!![]){try{const _0xd98a0a=-parseInt(_0x87b8bf(0x114))/0x1*(parseInt(_0x87b8bf(0xf5))/0x2)+-parseInt(_0x87b8bf(0xf6))/0x3*(-parseInt(_0x87b8bf(0xe6))/0x4)+parseInt(_0x87b8bf(0xde))/0x5+-parseInt(_0x87b8bf(0xda))/0x6*(parseInt(_0x87b8bf(0xf8))/0x7)+-parseInt(_0x87b8bf(0x10e))/0x8*(-parseInt(_0x87b8bf(0x101))/0x9)+-parseInt(_0x87b8bf(0xdb))/0xa+parseInt(_0x87b8bf(0x106))/0xb;if(_0xd98a0a===_0x382a58)break;else _0x3aad10['push'](_0x3aad10['shift']());}catch(_0xb4933d){_0x3aad10['push'](_0x3aad10['shift']());}}}(a3_0x14c3,0x4a886));function a3_0x5545(_0x3455be,_0x16b095){_0x3455be=_0x3455be-0xd8;const _0x14c329=a3_0x14c3();let _0x5545c0=_0x14c329[_0x3455be];return _0x5545c0;}import{jsx as a3_0x17159d,jsxs as a3_0x28af4e}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=[a3_0x11b8c3(0x10a),a3_0x11b8c3(0xf3)],SKILL_IDE_LIST=[a3_0x11b8c3(0x107),a3_0x11b8c3(0xf3),a3_0x11b8c3(0xec),a3_0x11b8c3(0xeb),a3_0x11b8c3(0x10a),a3_0x11b8c3(0x104),a3_0x11b8c3(0xe4),a3_0x11b8c3(0xe5),'windsurf','agent'];export function AISetupUI({config:_0x2bef46,onComplete:_0x2a3891}){const _0x35cd46=a3_0x11b8c3,{exit:_0x58b3d8}=useApp(),[_0x2e1252,_0x5c87d7]=useState(_0x35cd46(0x102)),[_0x37accc,_0x47fa64]=useState(0x0),[_0x2b00cb,_0x676609]=useState(new Set([0x0,0x1])),[_0x21d95f,_0x3d01d1]=useState(new Set(SKILL_IDE_LIST[_0x35cd46(0x113)]((_0x330416,_0x33cd67)=>_0x33cd67))),[_0x33ddb8,_0x4f56ea]=useState('');useEffect(()=>{const _0x105fc6=_0x35cd46;!_0x2bef46[_0x105fc6(0xea)]&&_0x2a3891({'mcpResults':[],'skillResults':[]});},[_0x2bef46[_0x35cd46(0xea)],_0x2a3891]),useInput((_0x2fe6ef,_0x3e2621)=>{const _0x1b7cc4=_0x35cd46;if(_0x2e1252===_0x1b7cc4(0x102)){if(_0x2fe6ef==='y'||_0x2fe6ef==='Y'||_0x3e2621[_0x1b7cc4(0x105)]){_0x2aa2e0();return;}if(_0x2fe6ef==='n'||_0x2fe6ef==='N'){_0x2a3891({'mcpResults':[],'skillResults':[]});return;}if(_0x3e2621['return']){_0x2aa2e0();return;}}if(_0x2e1252===_0x1b7cc4(0xe9)){if(_0x3e2621[_0x1b7cc4(0xe7)]){_0x47fa64(_0x5456ae=>_0x5456ae>0x0?_0x5456ae-0x1:SKILL_IDE_LIST[_0x1b7cc4(0xf7)]-0x1);return;}if(_0x3e2621[_0x1b7cc4(0xfb)]){_0x47fa64(_0x2a07f1=>_0x2a07f1<SKILL_IDE_LIST[_0x1b7cc4(0xf7)]-0x1?_0x2a07f1+0x1:0x0);return;}if(_0x2fe6ef==='\x20'){const _0x2c7f80=_0x37accc<MCP_IDE_LIST['length'];if(_0x2c7f80){const _0x150ba4=new Set(_0x2b00cb);_0x150ba4[_0x1b7cc4(0x10d)](_0x37accc)?_0x150ba4['delete'](_0x37accc):_0x150ba4['add'](_0x37accc),_0x676609(_0x150ba4);}else{const _0x21c8fe=_0x37accc-MCP_IDE_LIST['length'],_0x52bf25=new Set(_0x21d95f);_0x52bf25[_0x1b7cc4(0x10d)](_0x21c8fe)?_0x52bf25[_0x1b7cc4(0xf4)](_0x21c8fe):_0x52bf25[_0x1b7cc4(0xef)](_0x21c8fe),_0x3d01d1(_0x52bf25);}return;}if(_0x2fe6ef==='a'||_0x2fe6ef==='A'){_0x676609(new Set(MCP_IDE_LIST[_0x1b7cc4(0x113)]((_0x2f0ebd,_0x3f1133)=>_0x3f1133))),_0x3d01d1(new Set(SKILL_IDE_LIST[_0x1b7cc4(0x113)]((_0x45d874,_0x4c02f3)=>_0x4c02f3)));return;}if(_0x2fe6ef==='q'||_0x2fe6ef==='Q'){_0x58b3d8();return;}if(_0x3e2621['return']){if(_0x2b00cb['size']===0x0&&_0x21d95f[_0x1b7cc4(0xf1)]===0x0){_0x4f56ea(_0x1b7cc4(0xe2));return;}_0x2aa2e0();return;}}if(_0x2e1252===_0x1b7cc4(0xed)){_0x58b3d8();return;}});async function _0x2aa2e0(){const _0x2e6755=_0x35cd46;_0x5c87d7(_0x2e6755(0xe0));const _0x387ad4=[],_0x2514e8=[];for(const _0x530f31 of _0x2b00cb){const _0x2b28ee=MCP_IDE_LIST[_0x530f31];if(!_0x2b28ee)continue;try{const _0x3c82d1=await configureMcp(_0x2b28ee,_0x2bef46[_0x2e6755(0xfe)]);_0x387ad4[_0x2e6755(0xe3)](_0x3c82d1);}catch(_0x9c79ec){_0x387ad4[_0x2e6755(0xe3)]({'ide':MCP_IDE_CONFIGS[_0x2b28ee]?.[_0x2e6755(0xee)]||_0x2b28ee,'status':'error','message':_0x9c79ec instanceof Error?_0x9c79ec[_0x2e6755(0xd8)]:String(_0x9c79ec)});}}await copySharedSkills(_0x2bef46['projectRoot']);for(const _0x3d7aae of _0x21d95f){const _0x43e8af=SKILL_IDE_LIST[_0x3d7aae];if(!_0x43e8af)continue;try{const _0x2a389f=await installSkill(_0x43e8af,_0x2bef46[_0x2e6755(0xfe)]);_0x2514e8[_0x2e6755(0xe3)](_0x2a389f);}catch(_0x24b157){_0x2514e8[_0x2e6755(0xe3)]({'ide':SKILL_IDE_CONFIGS[_0x43e8af]?.[_0x2e6755(0xee)]||_0x43e8af,'status':_0x2e6755(0x112),'message':_0x24b157 instanceof Error?_0x24b157[_0x2e6755(0xd8)]:String(_0x24b157)});}}if(_0x2514e8[_0x2e6755(0xf7)]>0x0){const _0x3f3416=_0x2514e8[_0x2e6755(0xf9)](_0x149325=>_0x149325[_0x2e6755(0xe1)]===_0x2e6755(0x100))[_0x2e6755(0x113)](_0x300c6b=>_0x300c6b[_0x2e6755(0xdf)]);_0x3f3416[_0x2e6755(0xf7)]>0x0&&createSkillManifest(_0x2bef46['projectRoot'],_0x3f3416);}_0x5c87d7(_0x2e6755(0xed)),setTimeout(()=>{_0x2a3891({'mcpResults':_0x387ad4,'skillResults':_0x2514e8});},0xbb8);}if(_0x2e1252===_0x35cd46(0x102))return a3_0x28af4e(Box,{'flexDirection':_0x35cd46(0x10f),'marginTop':0x1,'children':[a3_0x17159d(Box,{'marginTop':0x1,'children':a3_0x17159d(Text,{'color':_0x35cd46(0x110),'children':'是否同时配置\x20AI\x20助手?这将:'})}),a3_0x17159d(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x17159d(Text,{'color':_0x35cd46(0x10c),'children':_0x35cd46(0xe8)})}),a3_0x17159d(Box,{'marginLeft':0x2,'children':a3_0x17159d(Text,{'color':_0x35cd46(0x10c),'children':_0x35cd46(0xdc)})}),a3_0x28af4e(Box,{'marginTop':0x1,'flexDirection':_0x35cd46(0x10f),'children':[a3_0x17159d(Box,{'children':a3_0x17159d(Text,{'color':'green','children':'[Y]\x20是,配置\x20AI\x20助手'})}),a3_0x17159d(Box,{'children':a3_0x17159d(Text,{'color':_0x35cd46(0x10c),'children':_0x35cd46(0x103)})}),a3_0x17159d(Box,{'children':a3_0x17159d(Text,{'color':_0x35cd46(0xff),'children':'Enter\x20默认:\x20是'})})]}),_0x33ddb8&&a3_0x17159d(Box,{'marginTop':0x1,'children':a3_0x28af4e(Text,{'color':_0x35cd46(0xfd),'children':['✗\x20',_0x33ddb8]})})]});if(_0x2e1252===_0x35cd46(0xe9))return a3_0x28af4e(Box,{'flexDirection':'column','marginTop':0x1,'children':[a3_0x17159d(Box,{'children':a3_0x17159d(Text,{'color':_0x35cd46(0xf2),'bold':!![],'children':'*\x20选择要配置的\x20IDE:'})}),_0x33ddb8&&a3_0x17159d(Box,{'marginTop':0x1,'children':a3_0x28af4e(Text,{'color':_0x35cd46(0xfd),'children':['✗\x20',_0x33ddb8]})}),a3_0x28af4e(Box,{'marginTop':0x1,'flexDirection':_0x35cd46(0x10f),'children':[a3_0x17159d(Text,{'bold':!![],'color':'yellow','children':_0x35cd46(0xf0)}),MCP_IDE_LIST[_0x35cd46(0x113)]((_0x2d02c3,_0x4743f9)=>{const _0x4af29e=_0x35cd46,_0x13c34a=_0x37accc===_0x4743f9,_0x272e13=_0x2b00cb[_0x4af29e(0x10d)](_0x4743f9);return a3_0x17159d(Box,{'children':a3_0x28af4e(Text,{'backgroundColor':_0x13c34a?'blue':undefined,'color':_0x13c34a?_0x4af29e(0x110):undefined,'children':[_0x272e13?_0x4af29e(0x109):_0x4af29e(0x10b),'\x20',_0x2d02c3===_0x4af29e(0x10a)?_0x4af29e(0xd9):'Claude\x20Code']})},'mcp-'+_0x2d02c3);}),a3_0x17159d(Box,{'marginTop':0x1,'children':a3_0x17159d(Text,{'bold':!![],'color':'yellow','children':_0x35cd46(0xdd)})}),SKILL_IDE_LIST[_0x35cd46(0x113)]((_0x3934c6,_0xe55e2e)=>{const _0x5d280b=_0x35cd46,_0x45b155=_0xe55e2e+MCP_IDE_LIST[_0x5d280b(0xf7)],_0x564da5=_0x37accc===_0x45b155,_0x4e5b00=_0x21d95f[_0x5d280b(0x10d)](_0x45b155);return a3_0x17159d(Box,{'children':a3_0x28af4e(Text,{'backgroundColor':_0x564da5?_0x5d280b(0x108):undefined,'color':_0x564da5?_0x5d280b(0x110):undefined,'children':[_0x4e5b00?_0x5d280b(0x109):_0x5d280b(0x10b),'\x20',SKILL_IDE_CONFIGS[_0x3934c6][_0x5d280b(0xee)]]})},_0x5d280b(0xfa)+_0x3934c6);}),a3_0x17159d(Box,{'marginTop':0x1,'children':a3_0x17159d(Text,{'color':_0x35cd46(0x10c),'children':_0x35cd46(0xfc)})})]})]});if(_0x2e1252==='installing')return a3_0x17159d(Box,{'flexDirection':_0x35cd46(0x10f),'marginTop':0x1,'children':a3_0x17159d(Box,{'children':a3_0x17159d(Text,{'children':_0x35cd46(0x111)})})});if(_0x2e1252===_0x35cd46(0xed))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':'Cursor'},'claude':{'name':'Claude\x20Code'}};
1
+ function a0_0x2ccc(_0x44d502,_0x5180d8){_0x44d502=_0x44d502-0x182;const _0x310eea=a0_0x310e();let _0x2cccc0=_0x310eea[_0x44d502];return _0x2cccc0;}const a0_0x2b86f4=a0_0x2ccc;(function(_0x392e52,_0x207e38){const _0x3bb882=a0_0x2ccc,_0x3b1a85=_0x392e52();while(!![]){try{const _0x15a464=parseInt(_0x3bb882(0x1ae))/0x1*(parseInt(_0x3bb882(0x1a0))/0x2)+parseInt(_0x3bb882(0x1a2))/0x3+-parseInt(_0x3bb882(0x1bb))/0x4*(parseInt(_0x3bb882(0x1b3))/0x5)+parseInt(_0x3bb882(0x193))/0x6+-parseInt(_0x3bb882(0x182))/0x7*(-parseInt(_0x3bb882(0x1b5))/0x8)+-parseInt(_0x3bb882(0x1a6))/0x9*(-parseInt(_0x3bb882(0x18a))/0xa)+-parseInt(_0x3bb882(0x190))/0xb;if(_0x15a464===_0x207e38)break;else _0x3b1a85['push'](_0x3b1a85['shift']());}catch(_0x35a5dd){_0x3b1a85['push'](_0x3b1a85['shift']());}}}(a0_0x310e,0x1aea0));import{jsx as a0_0x419c0a,jsxs as a0_0x1faa7d}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';import{useI18n}from'../i18n/hooks.js';const MCP_IDE_LIST=[a0_0x2b86f4(0x1aa),a0_0x2b86f4(0x185)],SKILL_IDE_LIST=[a0_0x2b86f4(0x18c),a0_0x2b86f4(0x185),a0_0x2b86f4(0x1b8),'codex',a0_0x2b86f4(0x1aa),a0_0x2b86f4(0x19a),'qoder',a0_0x2b86f4(0x19f),a0_0x2b86f4(0x187),'agent'];export function AISetupUI({config:_0x222048,onComplete:_0x306d38}){const _0x34ae31=a0_0x2b86f4,{t:_0x5f32a9}=useI18n(),{exit:_0x41d6d8}=useApp(),[_0x43a212,_0x2501cb]=useState('confirming'),[_0x50d050,_0x5b4ad7]=useState(0x0),[_0x6d5f0e,_0x4b1654]=useState(new Set([0x0,0x1])),[_0x49fb19,_0x4b6e47]=useState(new Set(SKILL_IDE_LIST['map']((_0x56db5a,_0x52238f)=>_0x52238f))),[_0x2c6fad,_0x3fb865]=useState('');useEffect(()=>{!_0x222048['appcode']&&_0x306d38({'mcpResults':[],'skillResults':[]});},[_0x222048[_0x34ae31(0x197)],_0x306d38]),useInput((_0x2427f2,_0x3eb125)=>{const _0x203451=_0x34ae31;if(_0x43a212===_0x203451(0x188)){if(_0x2427f2==='y'||_0x2427f2==='Y'||_0x3eb125[_0x203451(0x189)]){_0xd94385();return;}if(_0x2427f2==='n'||_0x2427f2==='N'){_0x306d38({'mcpResults':[],'skillResults':[]});return;}if(_0x3eb125[_0x203451(0x189)]){_0xd94385();return;}}if(_0x43a212===_0x203451(0x183)){if(_0x3eb125[_0x203451(0x18d)]){_0x5b4ad7(_0x15f68c=>_0x15f68c>0x0?_0x15f68c-0x1:SKILL_IDE_LIST[_0x203451(0x1b0)]-0x1);return;}if(_0x3eb125['downArrow']){_0x5b4ad7(_0x44bf9f=>_0x44bf9f<SKILL_IDE_LIST[_0x203451(0x1b0)]-0x1?_0x44bf9f+0x1:0x0);return;}if(_0x2427f2==='\x20'){const _0x2ce4ea=_0x50d050<MCP_IDE_LIST[_0x203451(0x1b0)];if(_0x2ce4ea){const _0x5b1cf9=new Set(_0x6d5f0e);_0x5b1cf9['has'](_0x50d050)?_0x5b1cf9[_0x203451(0x19d)](_0x50d050):_0x5b1cf9[_0x203451(0x18f)](_0x50d050),_0x4b1654(_0x5b1cf9);}else{const _0x44caaa=_0x50d050-MCP_IDE_LIST[_0x203451(0x1b0)],_0x588586=new Set(_0x49fb19);_0x588586['has'](_0x44caaa)?_0x588586[_0x203451(0x19d)](_0x44caaa):_0x588586[_0x203451(0x18f)](_0x44caaa),_0x4b6e47(_0x588586);}return;}if(_0x2427f2==='a'||_0x2427f2==='A'){_0x4b1654(new Set(MCP_IDE_LIST[_0x203451(0x1b4)]((_0x181ebf,_0x5f3cd0)=>_0x5f3cd0))),_0x4b6e47(new Set(SKILL_IDE_LIST[_0x203451(0x1b4)]((_0x5ac2e2,_0xe38ddf)=>_0xe38ddf)));return;}if(_0x2427f2==='q'||_0x2427f2==='Q'){_0x41d6d8();return;}if(_0x3eb125['return']){if(_0x6d5f0e[_0x203451(0x186)]===0x0&&_0x49fb19[_0x203451(0x186)]===0x0){_0x3fb865(_0x5f32a9(_0x203451(0x192)));return;}_0xd94385();return;}}if(_0x43a212==='done'){_0x41d6d8();return;}});async function _0xd94385(){const _0x1b551c=_0x34ae31;_0x2501cb(_0x1b551c(0x195));const _0x573447=[],_0x1dc80e=[];for(const _0x20434c of _0x6d5f0e){const _0x438698=MCP_IDE_LIST[_0x20434c];if(!_0x438698)continue;try{const _0x62b7c0=await configureMcp(_0x438698,_0x222048[_0x1b551c(0x1ac)]);_0x573447[_0x1b551c(0x1b7)](_0x62b7c0);}catch(_0x245a07){_0x573447[_0x1b551c(0x1b7)]({'ide':MCP_IDE_CONFIGS[_0x438698]?.[_0x1b551c(0x1b9)]||_0x438698,'status':_0x1b551c(0x1ad),'message':_0x245a07 instanceof Error?_0x245a07[_0x1b551c(0x196)]:String(_0x245a07)});}}await copySharedSkills(_0x222048['projectRoot']);for(const _0x2644a2 of _0x49fb19){const _0x41e8d1=SKILL_IDE_LIST[_0x2644a2];if(!_0x41e8d1)continue;try{const _0x26f553=await installSkill(_0x41e8d1,_0x222048[_0x1b551c(0x1ac)]);_0x1dc80e[_0x1b551c(0x1b7)](_0x26f553);}catch(_0x29174d){_0x1dc80e[_0x1b551c(0x1b7)]({'ide':SKILL_IDE_CONFIGS[_0x41e8d1]?.[_0x1b551c(0x1b9)]||_0x41e8d1,'status':_0x1b551c(0x1ad),'message':_0x29174d instanceof Error?_0x29174d[_0x1b551c(0x196)]:String(_0x29174d)});}}if(_0x1dc80e[_0x1b551c(0x1b0)]>0x0){const _0x424492=_0x1dc80e[_0x1b551c(0x198)](_0xaab2d1=>_0xaab2d1['status']===_0x1b551c(0x1be))['map'](_0x4bd9f5=>_0x4bd9f5[_0x1b551c(0x18e)]);_0x424492[_0x1b551c(0x1b0)]>0x0&&createSkillManifest(_0x222048[_0x1b551c(0x1ac)],_0x424492);}_0x2501cb(_0x1b551c(0x1a5)),setTimeout(()=>{_0x306d38({'mcpResults':_0x573447,'skillResults':_0x1dc80e});},0xbb8);}if(_0x43a212===_0x34ae31(0x188))return a0_0x1faa7d(Box,{'flexDirection':_0x34ae31(0x1bd),'marginTop':0x1,'children':[a0_0x419c0a(Box,{'marginTop':0x1,'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1ba),'children':_0x5f32a9(_0x34ae31(0x1a9))})}),a0_0x419c0a(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1af),'children':_0x5f32a9(_0x34ae31(0x19b))})}),a0_0x419c0a(Box,{'marginLeft':0x2,'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1af),'children':_0x5f32a9('aiSetup.ui.confirm.skillDescription')})}),a0_0x1faa7d(Box,{'marginTop':0x1,'flexDirection':_0x34ae31(0x1bd),'children':[a0_0x419c0a(Box,{'children':a0_0x419c0a(Text,{'color':'green','children':_0x5f32a9(_0x34ae31(0x19c))})}),a0_0x419c0a(Box,{'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1af),'children':_0x5f32a9(_0x34ae31(0x1a3))})}),a0_0x419c0a(Box,{'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1bc),'children':_0x5f32a9(_0x34ae31(0x1bf))})})]}),_0x2c6fad&&a0_0x419c0a(Box,{'marginTop':0x1,'children':a0_0x1faa7d(Text,{'color':_0x34ae31(0x191),'children':['✗\x20',_0x2c6fad]})})]});if(_0x43a212==='selecting')return a0_0x1faa7d(Box,{'flexDirection':_0x34ae31(0x1bd),'marginTop':0x1,'children':[a0_0x419c0a(Box,{'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x19e),'bold':!![],'children':_0x5f32a9(_0x34ae31(0x1ab))})}),_0x2c6fad&&a0_0x419c0a(Box,{'marginTop':0x1,'children':a0_0x1faa7d(Text,{'color':_0x34ae31(0x191),'children':['✗\x20',_0x2c6fad]})}),a0_0x1faa7d(Box,{'marginTop':0x1,'flexDirection':_0x34ae31(0x1bd),'children':[a0_0x419c0a(Text,{'bold':!![],'color':_0x34ae31(0x1a7),'children':_0x5f32a9('aiSetup.ui.select.mcpSection')}),MCP_IDE_LIST[_0x34ae31(0x1b4)]((_0xd1255b,_0x17a48c)=>{const _0x171cab=_0x34ae31,_0x3aef32=_0x50d050===_0x17a48c,_0x12ea17=_0x6d5f0e[_0x171cab(0x184)](_0x17a48c);return a0_0x419c0a(Box,{'children':a0_0x1faa7d(Text,{'backgroundColor':_0x3aef32?_0x171cab(0x194):undefined,'color':_0x3aef32?_0x171cab(0x1ba):undefined,'children':[_0x12ea17?_0x171cab(0x18b):_0x171cab(0x1b2),'\x20',_0xd1255b==='cursor'?_0x171cab(0x1b6):_0x171cab(0x199)]})},_0x171cab(0x1b1)+_0xd1255b);}),a0_0x419c0a(Box,{'marginTop':0x1,'children':a0_0x419c0a(Text,{'bold':!![],'color':_0x34ae31(0x1a7),'children':_0x5f32a9(_0x34ae31(0x1a1))})}),SKILL_IDE_LIST[_0x34ae31(0x1b4)]((_0x4ec92b,_0x22c8e5)=>{const _0x2e6f0f=_0x34ae31,_0x41804c=_0x22c8e5+MCP_IDE_LIST['length'],_0x20cfaf=_0x50d050===_0x41804c,_0xacc815=_0x49fb19[_0x2e6f0f(0x184)](_0x41804c);return a0_0x419c0a(Box,{'children':a0_0x1faa7d(Text,{'backgroundColor':_0x20cfaf?_0x2e6f0f(0x194):undefined,'color':_0x20cfaf?_0x2e6f0f(0x1ba):undefined,'children':[_0xacc815?_0x2e6f0f(0x18b):_0x2e6f0f(0x1b2),'\x20',SKILL_IDE_CONFIGS[_0x4ec92b]['name']]})},_0x2e6f0f(0x1a4)+_0x4ec92b);}),a0_0x419c0a(Box,{'marginTop':0x1,'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1af),'children':_0x5f32a9(_0x34ae31(0x1a8))})})]})]});if(_0x43a212==='installing')return a0_0x419c0a(Box,{'flexDirection':'column','marginTop':0x1,'children':a0_0x419c0a(Box,{'children':a0_0x419c0a(Text,{'children':_0x5f32a9('aiSetup.ui.installing')})})});if(_0x43a212===_0x34ae31(0x1a5))return null;return null;}function a0_0x310e(){const _0x88fdc0=['return','50WiNsgn','[✓]','antigravity','upArrow','ide','add','5525003GvHMgZ','red','aiSetup.ui.selectAtLeastOne','459870rnpWfg','blue','installing','message','appcode','filter','Claude\x20Code','opencode','aiSetup.ui.confirm.mcpDescription','aiSetup.ui.confirm.yes','delete','cyan','trae','81208OORMJC','aiSetup.ui.select.skillSection','472752xaZdFG','aiSetup.ui.confirm.no','skill-','done','316377oYZBuy','yellow','aiSetup.ui.select.controls','aiSetup.ui.confirm.title','cursor','aiSetup.ui.select.title','projectRoot','error','4NBmKqz','gray','length','mcp-','[\x20]','288100FfDoKo','map','9896zesdvp','Cursor','push','codebuddy','name','white','4mjmwcn','dimColor','column','success','aiSetup.ui.confirm.default','553QqpqQB','selecting','has','claude','size','windsurf','confirming'];a0_0x310e=function(){return _0x88fdc0;};return a0_0x310e();}const MCP_IDE_CONFIGS={'cursor':{'name':a0_0x2b86f4(0x1b6)},'claude':{'name':'Claude\x20Code'}};
@@ -1 +1 @@
1
- const a4_0x5252e9=a4_0x2360;(function(_0x2d3a97,_0x4fb13a){const _0x449a43=a4_0x2360,_0x11499d=_0x2d3a97();while(!![]){try{const _0x33fe73=-parseInt(_0x449a43(0x1ab))/0x1+-parseInt(_0x449a43(0x1ad))/0x2*(-parseInt(_0x449a43(0x1c9))/0x3)+parseInt(_0x449a43(0x1a9))/0x4*(parseInt(_0x449a43(0x1a7))/0x5)+parseInt(_0x449a43(0x1c8))/0x6+parseInt(_0x449a43(0x1d1))/0x7*(parseInt(_0x449a43(0x1a3))/0x8)+parseInt(_0x449a43(0x1b3))/0x9+-parseInt(_0x449a43(0x191))/0xa;if(_0x33fe73===_0x4fb13a)break;else _0x11499d['push'](_0x11499d['shift']());}catch(_0x10341e){_0x11499d['push'](_0x11499d['shift']());}}}(a4_0x12b2,0xe811d));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a4_0x5252e9(0x19e),MCP_COMMAND=a4_0x5252e9(0x1a0),MCP_ARGS=[a4_0x5252e9(0x1b7)];export function buildEnvConfig(_0xf9f7f1,_0x19081e){const _0x128bb2=a4_0x5252e9,_0xed220e={'LOVRABET_APP_CODE':String(_0xf9f7f1)};return _0x19081e!==_0x128bb2(0x192)&&(_0xed220e[_0x128bb2(0x1b5)]=String(_0x19081e)),_0xed220e;}function a4_0x2360(_0x4c3295,_0x1e4869){_0x4c3295=_0x4c3295-0x18c;const _0x12b2fd=a4_0x12b2();let _0x23605d=_0x12b2fd[_0x4c3295];return _0x23605d;}export async function configureCursorMcp(_0x1394ec){const _0x263297=a4_0x5252e9,_0x3bc31c=_0x1394ec||process[_0x263297(0x1c6)](),_0x1eeb8b=readConfig(_0x3bc31c),_0x1c640b=_0x1eeb8b[_0x263297(0x1cf)]||_0x1eeb8b[_0x263297(0x1b9)],_0x51c8fe=_0x1eeb8b[_0x263297(0x1a2)]||'online';if(!_0x1c640b)return{'ide':_0x263297(0x1d0),'status':_0x263297(0x1d6),'message':_0x263297(0x1af)};const _0x15e87f=buildEnvConfig(_0x1c640b,_0x51c8fe),_0x16bde8={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x15e87f},_0x459935=join(_0x3bc31c,_0x263297(0x19c),_0x263297(0x1a8)),_0x1242a7=join(_0x3bc31c,'.cursor');try{!existsSync(_0x1242a7)&&mkdirSync(_0x1242a7,{'recursive':!![]});let _0x5c4488={'mcpServers':{}};if(existsSync(_0x459935)){const _0x40e6bb=readFileSync(_0x459935,_0x263297(0x193));_0x5c4488=JSON[_0x263297(0x1b1)](_0x40e6bb);}return(!_0x5c4488[_0x263297(0x1d4)]||typeof _0x5c4488['mcpServers']!=='object')&&(_0x5c4488[_0x263297(0x1d4)]={}),_0x5c4488[_0x263297(0x1d4)][MCP_SERVER_NAME]=_0x16bde8,writeFileSync(_0x459935,JSON['stringify'](_0x5c4488,null,0x2),_0x263297(0x193)),logger[_0x263297(0x19a)](_0x263297(0x1ba),_0x263297(0x1d7),{'appcode':_0x1c640b,'env':_0x51c8fe,'path':_0x459935}),await copyCursorRules(_0x1242a7),{'ide':'Cursor','status':_0x263297(0x1ae),'message':_0x263297(0x1d5)};}catch(_0x2cfeb8){return logger[_0x263297(0x1d6)](_0x263297(0x1ba),_0x263297(0x1be),{'error':_0x2cfeb8 instanceof Error?_0x2cfeb8['message']:String(_0x2cfeb8)}),{'ide':_0x263297(0x1d0),'status':_0x263297(0x1d6),'message':_0x2cfeb8 instanceof Error?_0x2cfeb8['message']:String(_0x2cfeb8)};}}export async function configureClaudeMcp(_0x2c631e){const _0x427e49=a4_0x5252e9,_0xf1c2e=_0x2c631e||process[_0x427e49(0x1c6)](),_0x591625=readConfig(_0xf1c2e),_0xb9c04e=_0x591625[_0x427e49(0x1cf)]||_0x591625['app'],_0x17bb73=_0x591625[_0x427e49(0x1a2)]||_0x427e49(0x192);if(!_0xb9c04e)return{'ide':_0x427e49(0x1b2),'status':_0x427e49(0x1d6),'message':_0x427e49(0x1af)};let _0x4e7713=_0x427e49(0x18c)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x427e49(0x196)]('\x20')+_0x427e49(0x1c5)+_0xb9c04e;return _0x17bb73!==_0x427e49(0x192)&&(_0x4e7713+=_0x427e49(0x1d3)+_0x17bb73),await copyAgentsMd(_0xf1c2e),logger[_0x427e49(0x19a)](_0x427e49(0x1ba),_0x427e49(0x1bd),{'command':_0x4e7713,'appcode':_0xb9c04e,'env':_0x17bb73}),console[_0x427e49(0x1c3)]('\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a'),console[_0x427e49(0x1c3)]('\x20\x20'+_0x4e7713+'\x0a'),console[_0x427e49(0x1c3)]('配置信息:'),console[_0x427e49(0x1c3)](_0x427e49(0x1b6)+_0xb9c04e),_0x17bb73!=='online'&&console[_0x427e49(0x1c3)](_0x427e49(0x1c7)+_0x17bb73),console[_0x427e49(0x1c3)](_0x427e49(0x18f)),{'ide':_0x427e49(0x1b2),'status':'manual','message':_0x427e49(0x18d)+_0x4e7713};}export async function showOtherGuide(_0x4e816c){const _0x260148=a4_0x5252e9,_0xd0b0d2=_0x4e816c||process['cwd'](),_0x463a21=readConfig(_0xd0b0d2),_0x51a292=_0x463a21[_0x260148(0x1cf)]||_0x463a21[_0x260148(0x1b9)],_0x52e298=_0x463a21[_0x260148(0x1a2)]||'online';if(!_0x51a292)return{'ide':'其他','status':_0x260148(0x1d6),'message':_0x260148(0x1af)};return console['log'](_0x260148(0x1b0)),console['log']('{'),console['log']('\x20\x20\x22mcpServers\x22:\x20{'),console[_0x260148(0x1c3)]('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+'\x22:\x20{'),console[_0x260148(0x1c3)](_0x260148(0x194)+MCP_COMMAND+'\x22,'),console[_0x260148(0x1c3)](_0x260148(0x1ca)+MCP_ARGS[_0x260148(0x190)](_0x4f3200=>'\x22'+_0x4f3200+'\x22')[_0x260148(0x196)](',\x20')+'],'),console[_0x260148(0x1c3)]('\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{'),console[_0x260148(0x1c3)](_0x260148(0x195)+_0x51a292+'\x22,'),_0x52e298!==_0x260148(0x192)&&console[_0x260148(0x1c3)](_0x260148(0x1bf)+_0x52e298+'\x22,'),console['log']('\x20\x20\x20\x20\x20\x20}'),console[_0x260148(0x1c3)](_0x260148(0x197)),console[_0x260148(0x1c3)]('\x20\x20}'),console['log']('}\x0a'),logger[_0x260148(0x19a)](_0x260148(0x1ba),_0x260148(0x1aa),{'appcode':_0x51a292,'env':_0x52e298}),{'ide':'其他','status':_0x260148(0x1c0),'message':'配置指引已显示'};}export async function configureMcp(_0x33ead9,_0x1c0182){const _0x3979ef=a4_0x5252e9;switch(_0x33ead9){case _0x3979ef(0x19d):return await configureCursorMcp(_0x1c0182);case _0x3979ef(0x18e):return await configureClaudeMcp(_0x1c0182);default:throw new Error('不支持的\x20MCP\x20IDE:\x20'+_0x33ead9);}}async function copyCursorRules(_0x2c460e){const _0x40746d=a4_0x5252e9,_0x5d8477=join(_0x2c460e,_0x40746d(0x1cc)),_0x1d53ad=join(_0x5d8477,_0x40746d(0x1b8));if(existsSync(_0x1d53ad))return;try{!existsSync(_0x5d8477)&&mkdirSync(_0x5d8477,{'recursive':!![]});const _0x59b1a4=await getRulesContent();writeFileSync(_0x1d53ad,_0x59b1a4,_0x40746d(0x193)),logger[_0x40746d(0x19a)](_0x40746d(0x1ba),_0x40746d(0x1c4),{'to':_0x1d53ad});}catch(_0x185e12){logger[_0x40746d(0x1d6)]('mcp-install',_0x40746d(0x198),{'error':_0x185e12 instanceof Error?_0x185e12[_0x40746d(0x1cb)]:String(_0x185e12)});}}async function copyAgentsMd(_0x401ebf){const _0x1296a1=a4_0x5252e9,_0x18f86a=join(_0x401ebf,'agents.md');if(existsSync(_0x18f86a))return;try{const _0xeb0bae=await getRulesContent();writeFileSync(_0x18f86a,_0xeb0bae,'utf-8'),logger[_0x1296a1(0x19a)](_0x1296a1(0x1ba),_0x1296a1(0x1bb),{'to':_0x18f86a});}catch(_0x4c429e){logger[_0x1296a1(0x1d6)](_0x1296a1(0x1ba),_0x1296a1(0x199),{'error':_0x4c429e instanceof Error?_0x4c429e[_0x1296a1(0x1cb)]:String(_0x4c429e)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x66532c,_0x41e917){const _0x4da078=a4_0x5252e9,_0xd6ec4c=_0x41e917||process[_0x4da078(0x1c6)](),_0x2fd9d7=resolve(__dirname,_0x4da078(0x1d8)),_0x40e0f3=SKILL_IDE_CONFIGS[_0x66532c];if(!_0x40e0f3)return{'ide':_0x66532c,'status':_0x4da078(0x1d6),'message':_0x4da078(0x1cd)+_0x66532c};const _0x4dfd69=_0x40e0f3[_0x4da078(0x1a4)];try{let _0x212fae;try{_0x212fae=await fetchGuidesFromCDN();}catch{}const _0x202dd0=await installSingleIDE(_0x66532c,_0x40e0f3,_0xd6ec4c,_0x2fd9d7,_0x212fae);return _0x212fae&&writeGuidesToProject(_0x212fae,_0xd6ec4c),logger['info'](_0x4da078(0x1a6),_0x4dfd69+_0x4da078(0x1c1),{'ide':_0x66532c,'filesCount':_0x202dd0}),{'ide':_0x4dfd69,'status':_0x4da078(0x1ae),'message':'已创建\x20'+_0x202dd0+'\x20项'};}catch(_0x343905){return logger[_0x4da078(0x1d6)]('skill-install',_0x4dfd69+_0x4da078(0x1d9),{'error':_0x343905 instanceof Error?_0x343905[_0x4da078(0x1cb)]:String(_0x343905)}),{'ide':_0x4dfd69,'status':_0x4da078(0x1d6),'message':_0x343905 instanceof Error?_0x343905[_0x4da078(0x1cb)]:String(_0x343905)};}}function a4_0x12b2(){const _0x44d61=['已写入\x20.cursor/mcp.json','error','Cursor\x20MCP\x20配置成功','../../cdn-source/skills','\x20技能包安装失败','claude\x20mcp\x20add\x20','请手动执行:\x20','claude','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','map','47797890DPfuBD','online','utf-8','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','join','\x20\x20\x20\x20}','复制\x20Cursor\x20Rules\x20文件失败','复制\x20agents.md\x20文件失败','info','.lovrabet/skill-manifest.json','.cursor','cursor','lovrabet-dataset','isDirectory','npx','共享技能文件复制成功','env','47056MUkZTf','name','node:fs','skill-install','5YcfWZt','mcp.json','4952060VATmLW','其他\x20IDE\x20配置指引已显示','997383KLquRO','.lovrabet/skill/.shared','1652334dTiwfo','success','需要先配置\x20appcode','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','parse','Claude\x20Code','10591461enlufW','共享技能文件复制失败','LOVRABET_ENV','\x20\x20AppCode:\x20','@lovrabet/dataset-mcp-server@latest','lovrabet_rules.mdc','app','mcp-install','创建\x20agents.md\x20文件','toISOString','Claude\x20Code\x20MCP\x20命令已生成','Cursor\x20MCP\x20配置失败','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','manual','\x20技能包安装成功','创建技能包\x20manifest','log','创建\x20Cursor\x20Rules\x20文件','\x20-e\x20LOVRABET_APP_CODE=','cwd','\x20\x20环境:\x20','9963666dJSBxE','6aPNSYI','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','message','rules','未知的\x20IDE:\x20','2.0.0','appcode','Cursor','1190infmMH','stringify','\x20-e\x20LOVRABET_ENV=','mcpServers'];a4_0x12b2=function(){return _0x44d61;};return a4_0x12b2();}async function copyDir(_0x4af6da,_0x240b2c){const _0x69bff5=a4_0x5252e9,{statSync:_0x536a7d}=await import(_0x69bff5(0x1a5)),{readdirSync:_0x53cd76}=await import(_0x69bff5(0x1a5)),_0x333f0c=_0x536a7d(_0x4af6da);if(_0x333f0c[_0x69bff5(0x19f)]()){!existsSync(_0x240b2c)&&mkdirSync(_0x240b2c,{'recursive':!![]});const _0x206181=_0x53cd76(_0x4af6da);for(const _0x1b3cc7 of _0x206181){await copyDir(join(_0x4af6da,_0x1b3cc7),join(_0x240b2c,_0x1b3cc7));}}else copyFileSync(_0x4af6da,_0x240b2c);}export async function copySharedSkills(_0x8bfd71){const _0x2d647f=a4_0x5252e9,_0x3bce5d=_0x8bfd71||process[_0x2d647f(0x1c6)](),_0x5b2d33=resolve(__dirname,'../../cdn-source/skills'),_0x230704=join(_0x5b2d33,'.shared'),_0x33ca61=join(_0x3bce5d,_0x2d647f(0x1ac));if(!existsSync(_0x230704))return![];try{return await copyDir(_0x230704,_0x33ca61),logger[_0x2d647f(0x19a)](_0x2d647f(0x1a6),_0x2d647f(0x1a1),{'path':_0x33ca61}),!![];}catch(_0x32753b){return logger[_0x2d647f(0x1d6)](_0x2d647f(0x1a6),_0x2d647f(0x1b4),{'error':_0x32753b instanceof Error?_0x32753b[_0x2d647f(0x1cb)]:String(_0x32753b)}),![];}}export function createSkillManifest(_0x21f77f,_0x124abc){const _0x10aeb7=a4_0x5252e9,_0x282389={'version':_0x10aeb7(0x1ce),'installedAt':new Date()[_0x10aeb7(0x1bc)](),'platforms':_0x124abc},_0x1a694e=join(_0x21f77f,_0x10aeb7(0x19b)),_0x54ad72=join(_0x21f77f,'.lovrabet');!existsSync(_0x54ad72)&&mkdirSync(_0x54ad72,{'recursive':!![]}),writeFileSync(_0x1a694e,JSON[_0x10aeb7(0x1d2)](_0x282389,null,0x2),_0x10aeb7(0x193)),logger[_0x10aeb7(0x19a)]('skill-install',_0x10aeb7(0x1c2),{'path':_0x1a694e});}
1
+ const a1_0x1d8864=a1_0x4484;(function(_0x10ad29,_0x7f4c74){const _0x3a3cb1=a1_0x4484,_0x3e84ed=_0x10ad29();while(!![]){try{const _0x197210=parseInt(_0x3a3cb1(0x6a))/0x1+parseInt(_0x3a3cb1(0xa9))/0x2*(-parseInt(_0x3a3cb1(0x8d))/0x3)+-parseInt(_0x3a3cb1(0x67))/0x4+parseInt(_0x3a3cb1(0x6b))/0x5*(parseInt(_0x3a3cb1(0x80))/0x6)+-parseInt(_0x3a3cb1(0xac))/0x7*(parseInt(_0x3a3cb1(0x66))/0x8)+parseInt(_0x3a3cb1(0xaa))/0x9+-parseInt(_0x3a3cb1(0x73))/0xa*(-parseInt(_0x3a3cb1(0x93))/0xb);if(_0x197210===_0x7f4c74)break;else _0x3e84ed['push'](_0x3e84ed['shift']());}catch(_0x162c90){_0x3e84ed['push'](_0x3e84ed['shift']());}}}(a1_0x9ff4,0x380fe));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a1_0x4484(_0x52bf05,_0x4b1969){_0x52bf05=_0x52bf05-0x66;const _0x9ff4e8=a1_0x9ff4();let _0x448441=_0x9ff4e8[_0x52bf05];return _0x448441;}import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';import a1_0x4d62a7 from'../i18n/index.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME='lovrabet-dataset',MCP_COMMAND=a1_0x1d8864(0x89),MCP_ARGS=[a1_0x1d8864(0xb1)];export function buildEnvConfig(_0x329f94,_0x267fde){const _0x428bbe=a1_0x1d8864,_0x205578={'LOVRABET_APP_CODE':String(_0x329f94)};return _0x267fde!=='online'&&(_0x205578[_0x428bbe(0x7b)]=String(_0x267fde)),_0x205578;}export async function configureCursorMcp(_0x1dbd32){const _0x4705aa=a1_0x1d8864,_0x5167fe=_0x1dbd32||process[_0x4705aa(0x6e)](),_0x52df6f=readConfig(_0x5167fe),_0x214f48=_0x52df6f[_0x4705aa(0x99)]||_0x52df6f['app'],_0x558071=_0x52df6f[_0x4705aa(0x8f)]||_0x4705aa(0xa7);if(!_0x214f48)return{'ide':_0x4705aa(0x69),'status':_0x4705aa(0xa0),'message':a1_0x4d62a7['t'](_0x4705aa(0x8a))};const _0x5d6b65=buildEnvConfig(_0x214f48,_0x558071),_0x13f6f3={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x5d6b65},_0x366f88=join(_0x5167fe,_0x4705aa(0x7f),_0x4705aa(0x9f)),_0x170425=join(_0x5167fe,_0x4705aa(0x7f));try{!existsSync(_0x170425)&&mkdirSync(_0x170425,{'recursive':!![]});let _0x1dda89={'mcpServers':{}};if(existsSync(_0x366f88)){const _0x5cb7a9=readFileSync(_0x366f88,_0x4705aa(0x6c));_0x1dda89=JSON[_0x4705aa(0x9e)](_0x5cb7a9);}return(!_0x1dda89['mcpServers']||typeof _0x1dda89[_0x4705aa(0x78)]!==_0x4705aa(0x94))&&(_0x1dda89['mcpServers']={}),_0x1dda89[_0x4705aa(0x78)][MCP_SERVER_NAME]=_0x13f6f3,writeFileSync(_0x366f88,JSON[_0x4705aa(0x77)](_0x1dda89,null,0x2),_0x4705aa(0x6c)),logger['info'](_0x4705aa(0x81),a1_0x4d62a7['t'](_0x4705aa(0x68)),{'appcode':_0x214f48,'env':_0x558071,'path':_0x366f88}),await copyCursorRules(_0x170425),{'ide':_0x4705aa(0x69),'status':_0x4705aa(0x71),'message':a1_0x4d62a7['t'](_0x4705aa(0x74))};}catch(_0x14473a){return logger[_0x4705aa(0xa0)](_0x4705aa(0x81),a1_0x4d62a7['t'](_0x4705aa(0x98)),{'error':_0x14473a instanceof Error?_0x14473a[_0x4705aa(0x79)]:String(_0x14473a)}),{'ide':_0x4705aa(0x69),'status':_0x4705aa(0xa0),'message':_0x14473a instanceof Error?_0x14473a[_0x4705aa(0x79)]:String(_0x14473a)};}}export async function configureClaudeMcp(_0x1640b4){const _0x1136e4=a1_0x1d8864,_0x44594d=_0x1640b4||process[_0x1136e4(0x6e)](),_0x1996df=readConfig(_0x44594d),_0x447bba=_0x1996df[_0x1136e4(0x99)]||_0x1996df[_0x1136e4(0x88)],_0x2b3894=_0x1996df[_0x1136e4(0x8f)]||_0x1136e4(0xa7);if(!_0x447bba)return{'ide':_0x1136e4(0xaf),'status':'error','message':a1_0x4d62a7['t'](_0x1136e4(0x8a))};let _0x432e37=_0x1136e4(0xa2)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x1136e4(0xad)]('\x20')+'\x20-e\x20LOVRABET_APP_CODE='+_0x447bba;return _0x2b3894!==_0x1136e4(0xa7)&&(_0x432e37+='\x20-e\x20LOVRABET_ENV='+_0x2b3894),await copyAgentsMd(_0x44594d),logger['info'](_0x1136e4(0x81),a1_0x4d62a7['t'](_0x1136e4(0xa3)),{'command':_0x432e37,'appcode':_0x447bba,'env':_0x2b3894}),console['log'](a1_0x4d62a7['t'](_0x1136e4(0xab))),console[_0x1136e4(0x8e)]('\x20\x20'+_0x432e37+'\x0a'),console[_0x1136e4(0x8e)](a1_0x4d62a7['t'](_0x1136e4(0x85))),console['log']('\x20\x20AppCode:\x20'+_0x447bba),_0x2b3894!=='online'&&console[_0x1136e4(0x8e)](a1_0x4d62a7['t']('aiSetup.mcp.claude.env',{'env':_0x2b3894})),console[_0x1136e4(0x8e)](a1_0x4d62a7['t']('aiSetup.mcp.claude.restartRequired')),{'ide':_0x1136e4(0xaf),'status':_0x1136e4(0xa5),'message':a1_0x4d62a7['t'](_0x1136e4(0x91),{'command':_0x432e37})};}export async function showOtherGuide(_0xfcec49){const _0x4b69b9=a1_0x1d8864,_0x2ebc80=_0xfcec49||process[_0x4b69b9(0x6e)](),_0x2962dd=readConfig(_0x2ebc80),_0x39fc77=_0x2962dd['appcode']||_0x2962dd['app'],_0x39381b=_0x2962dd[_0x4b69b9(0x8f)]||'online';if(!_0x39fc77)return{'ide':a1_0x4d62a7['t'](_0x4b69b9(0x70)),'status':'error','message':a1_0x4d62a7['t'](_0x4b69b9(0x8a))};return console[_0x4b69b9(0x8e)](a1_0x4d62a7['t'](_0x4b69b9(0x6d))),console[_0x4b69b9(0x8e)]('{'),console['log'](_0x4b69b9(0x7d)),console[_0x4b69b9(0x8e)](_0x4b69b9(0xae)+MCP_SERVER_NAME+'\x22:\x20{'),console[_0x4b69b9(0x8e)]('\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22'+MCP_COMMAND+'\x22,'),console['log'](_0x4b69b9(0x7c)+MCP_ARGS[_0x4b69b9(0x97)](_0x23439b=>'\x22'+_0x23439b+'\x22')[_0x4b69b9(0xad)](',\x20')+'],'),console[_0x4b69b9(0x8e)](_0x4b69b9(0x96)),console[_0x4b69b9(0x8e)](_0x4b69b9(0x8c)+_0x39fc77+'\x22,'),_0x39381b!=='online'&&console[_0x4b69b9(0x8e)](_0x4b69b9(0x7a)+_0x39381b+'\x22,'),console[_0x4b69b9(0x8e)](_0x4b69b9(0x84)),console['log']('\x20\x20\x20\x20}'),console[_0x4b69b9(0x8e)](_0x4b69b9(0x7e)),console['log']('}\x0a'),logger[_0x4b69b9(0x76)](_0x4b69b9(0x81),a1_0x4d62a7['t']('aiSetup.mcp.other.guideShown'),{'appcode':_0x39fc77,'env':_0x39381b}),{'ide':a1_0x4d62a7['t'](_0x4b69b9(0x70)),'status':_0x4b69b9(0xa5),'message':a1_0x4d62a7['t'](_0x4b69b9(0x8b))};}export async function configureMcp(_0x28e021,_0x33bb8d){const _0x5e1792=a1_0x1d8864;switch(_0x28e021){case _0x5e1792(0x86):return await configureCursorMcp(_0x33bb8d);case'claude':return await configureClaudeMcp(_0x33bb8d);default:throw new Error(a1_0x4d62a7['t'](_0x5e1792(0xa1),{'ide':_0x28e021}));}}async function copyCursorRules(_0x41b627){const _0x10db60=a1_0x1d8864,_0x1819ca=join(_0x41b627,_0x10db60(0x9b)),_0x5c0989=join(_0x1819ca,'lovrabet_rules.mdc');if(existsSync(_0x5c0989))return;try{!existsSync(_0x1819ca)&&mkdirSync(_0x1819ca,{'recursive':!![]});const _0x124fb2=await getRulesContent();writeFileSync(_0x5c0989,_0x124fb2,_0x10db60(0x6c)),logger[_0x10db60(0x76)](_0x10db60(0x81),a1_0x4d62a7['t']('aiSetup.mcp.cursor.rules.created'),{'to':_0x5c0989});}catch(_0x118e51){logger[_0x10db60(0xa0)](_0x10db60(0x81),a1_0x4d62a7['t'](_0x10db60(0x72)),{'error':_0x118e51 instanceof Error?_0x118e51['message']:String(_0x118e51)});}}async function copyAgentsMd(_0x43518f){const _0x50dedc=a1_0x1d8864,_0x4c957a=join(_0x43518f,_0x50dedc(0x90));if(existsSync(_0x4c957a))return;try{const _0x47b5c2=await getRulesContent();writeFileSync(_0x4c957a,_0x47b5c2,'utf-8'),logger[_0x50dedc(0x76)](_0x50dedc(0x81),a1_0x4d62a7['t']('aiSetup.mcp.claude.agents.created'),{'to':_0x4c957a});}catch(_0x2b98fb){logger[_0x50dedc(0xa0)]('mcp-install',a1_0x4d62a7['t'](_0x50dedc(0x82)),{'error':_0x2b98fb instanceof Error?_0x2b98fb['message']:String(_0x2b98fb)});}}function a1_0x9ff4(){const _0x2153e4=['1100292Jjltlt','aiSetup.mcp.cursor.success','Cursor','8610honDBI','10IYKBFj','utf-8','aiSetup.mcp.other.title','cwd','aiSetup.skill.manifestCreated','aiSetup.mcp.other.name','success','aiSetup.mcp.cursor.rules.copyFailed','21970xfFIna','aiSetup.mcp.cursor.written','aiSetup.skill.installFailed','info','stringify','mcpServers','message','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','LOVRABET_ENV','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','\x20\x20\x22mcpServers\x22:\x20{','\x20\x20}','.cursor','688932HKXNYJ','mcp-install','aiSetup.mcp.claude.agents.copyFailed','skill-install','\x20\x20\x20\x20\x20\x20}','aiSetup.mcp.claude.configInfo','cursor','.lovrabet/skill/.shared','app','npx','aiSetup.error.missingAppcode','aiSetup.mcp.other.guideShown','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','3aaRNXv','log','env','agents.md','aiSetup.mcp.claude.manualExecute','2.0.0','649rzctbB','object','../../cdn-source/skills','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','map','aiSetup.mcp.cursor.error','appcode','node:fs','rules','aiSetup.skill.itemsCreated','aiSetup.skill.installSuccess','parse','mcp.json','error','aiSetup.mcp.unsupportedIDE','claude\x20mcp\x20add\x20','aiSetup.mcp.claude.commandGenerated','.shared','manual','.lovrabet/skill-manifest.json','online','aiSetup.skill.unknownIDE','233112khvfpK','2831850JwdwiR','aiSetup.mcp.claude.manualCommand','12614cAEgQb','join','\x20\x20\x20\x20\x22','Claude\x20Code','.lovrabet','@lovrabet/dataset-mcp-server@latest','aiSetup.skill.sharedCopyFailed','272DczqDT'];a1_0x9ff4=function(){return _0x2153e4;};return a1_0x9ff4();}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x1e5e0a,_0x1e75b6){const _0x1b36f9=a1_0x1d8864,_0xbb0e7f=_0x1e75b6||process[_0x1b36f9(0x6e)](),_0x568e6e=resolve(__dirname,_0x1b36f9(0x95)),_0x47c1e6=SKILL_IDE_CONFIGS[_0x1e5e0a];if(!_0x47c1e6)return{'ide':_0x1e5e0a,'status':_0x1b36f9(0xa0),'message':a1_0x4d62a7['t'](_0x1b36f9(0xa8),{'ide':_0x1e5e0a})};const _0x4421b5=_0x47c1e6['name'];try{let _0xb201aa;try{_0xb201aa=await fetchGuidesFromCDN();}catch{}const _0x284054=await installSingleIDE(_0x1e5e0a,_0x47c1e6,_0xbb0e7f,_0x568e6e,_0xb201aa);return _0xb201aa&&writeGuidesToProject(_0xb201aa,_0xbb0e7f),logger['info'](_0x1b36f9(0x83),a1_0x4d62a7['t'](_0x1b36f9(0x9d),{'name':_0x4421b5}),{'ide':_0x1e5e0a,'filesCount':_0x284054}),{'ide':_0x4421b5,'status':_0x1b36f9(0x71),'message':a1_0x4d62a7['t'](_0x1b36f9(0x9c),{'count':_0x284054})};}catch(_0x1b053c){return logger['error'](_0x1b36f9(0x83),a1_0x4d62a7['t'](_0x1b36f9(0x75),{'name':_0x4421b5}),{'error':_0x1b053c instanceof Error?_0x1b053c[_0x1b36f9(0x79)]:String(_0x1b053c)}),{'ide':_0x4421b5,'status':'error','message':_0x1b053c instanceof Error?_0x1b053c[_0x1b36f9(0x79)]:String(_0x1b053c)};}}async function copyDir(_0x3fc7db,_0x41df17){const _0x520611=a1_0x1d8864,{statSync:_0x1ed4a2}=await import(_0x520611(0x9a)),{readdirSync:_0x2db5ba}=await import(_0x520611(0x9a)),_0xa1da60=_0x1ed4a2(_0x3fc7db);if(_0xa1da60['isDirectory']()){!existsSync(_0x41df17)&&mkdirSync(_0x41df17,{'recursive':!![]});const _0x164c7e=_0x2db5ba(_0x3fc7db);for(const _0x1848a8 of _0x164c7e){await copyDir(join(_0x3fc7db,_0x1848a8),join(_0x41df17,_0x1848a8));}}else copyFileSync(_0x3fc7db,_0x41df17);}export async function copySharedSkills(_0x43f99b){const _0x403e63=a1_0x1d8864,_0x4957eb=_0x43f99b||process[_0x403e63(0x6e)](),_0xe9e889=resolve(__dirname,_0x403e63(0x95)),_0xc9a756=join(_0xe9e889,_0x403e63(0xa4)),_0x54792a=join(_0x4957eb,_0x403e63(0x87));if(!existsSync(_0xc9a756))return![];try{return await copyDir(_0xc9a756,_0x54792a),logger[_0x403e63(0x76)]('skill-install',a1_0x4d62a7['t']('aiSetup.skill.sharedCopied'),{'path':_0x54792a}),!![];}catch(_0x203902){return logger[_0x403e63(0xa0)](_0x403e63(0x83),a1_0x4d62a7['t'](_0x403e63(0xb2)),{'error':_0x203902 instanceof Error?_0x203902[_0x403e63(0x79)]:String(_0x203902)}),![];}}export function createSkillManifest(_0x5d3ed9,_0x459095){const _0x87f658=a1_0x1d8864,_0x3316fd={'version':_0x87f658(0x92),'installedAt':new Date()['toISOString'](),'platforms':_0x459095},_0x24b795=join(_0x5d3ed9,_0x87f658(0xa6)),_0x1d68ae=join(_0x5d3ed9,_0x87f658(0xb0));!existsSync(_0x1d68ae)&&mkdirSync(_0x1d68ae,{'recursive':!![]}),writeFileSync(_0x24b795,JSON['stringify'](_0x3316fd,null,0x2),_0x87f658(0x6c)),logger['info'](_0x87f658(0x83),a1_0x4d62a7['t'](_0x87f658(0x6f)),{'path':_0x24b795});}
@@ -1 +1 @@
1
- (function(_0x2e0dfe,_0x4bb0eb){const _0x1ab148=a5_0x1776,_0x1041ed=_0x2e0dfe();while(!![]){try{const _0x5d9787=-parseInt(_0x1ab148(0x1b8))/0x1+-parseInt(_0x1ab148(0x1ce))/0x2+parseInt(_0x1ab148(0x19f))/0x3*(-parseInt(_0x1ab148(0x1c3))/0x4)+-parseInt(_0x1ab148(0x1c4))/0x5+-parseInt(_0x1ab148(0x1be))/0x6+-parseInt(_0x1ab148(0x1b3))/0x7+parseInt(_0x1ab148(0x1a2))/0x8;if(_0x5d9787===_0x4bb0eb)break;else _0x1041ed['push'](_0x1041ed['shift']());}catch(_0x39ae95){_0x1041ed['push'](_0x1041ed['shift']());}}}(a5_0x22a5,0x5f8be));import{jsx as a5_0x2bb031,jsxs as a5_0x3ce69b,Fragment as a5_0x3e8a51}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a5_0x1776(_0x5b4de1,_0x1a6969){_0x5b4de1=_0x5b4de1-0x19f;const _0x22a577=a5_0x22a5();let _0x177657=_0x22a577[_0x5b4de1];return _0x177657;}import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';function a5_0x22a5(){const _0x394fd1=['env','string','cyan','gray','539555PflTgV','log','column','*\x20生成的文档文件:','\x20重新登录后再试','正在获取数据集列表...','2927832FlOyKc','red','\x1b[33m!\x20以下数据集代码不存在:\x20','未提供应用AppCode,且配置中也没有默认值','error','34968TlyZrN','236790tUvoFz','filePath','datasetName','api-doc','⚠️\x20以下数据集生成失败:','white','includes','\x20个数据集',',\x20失败\x20','map','1388244UtKGcO','success','\x20(环境:\x20','*\x20共处理\x20','filter','\x20个数据集中筛选出\x20','length','192XVdNvG','online','yellow','23650040ZyoBPW','指定的数据集代码都不存在:\x20','datasetCode','green','lovrabet\x20auth','join','dim','使用配置的应用AppCode:\x20','\x1b[0m','文档生成失败:\x20','\x20个数据集的文档...','setLogPath','message','cwd','正在生成\x20','\x20-\x20','\x20个匹配的数据集\x1b[0m','1654814PDBAJc'];a5_0x22a5=function(){return _0x394fd1;};return a5_0x22a5();}export const ApiDocUI=({appCode:_0x5cc74a,env:_0x570c4b,output:_0x3162a1,extraParams:_0x5d020b,datasetCodes:_0x4814a3})=>{const _0x36d07f=a5_0x1776,{exit:_0x3bb367}=useApp(),[_0x397990,_0x21734e]=useState(![]),[_0x70c91c,_0xcc5122]=useState(''),[_0x5c4775,_0xa75daa]=useState(![]),[_0x7ff32f,_0x18aac2]=useState(null),[_0x245eb7,_0x3fff5e]=useState(null),[_0x1fbaf7,_0x498b5a]=useState(0x0),_0x5f456e=readConfig(),_0x530fd6=getConfigAppCode(),_0x3cffcf=_0x5cc74a||_0x530fd6,_0x5444d2=typeof _0x5f456e?.['env']===_0x36d07f(0x1b5)?_0x5f456e[_0x36d07f(0x1b4)]:undefined,_0x51ea59=_0x570c4b||_0x5444d2||_0x36d07f(0x1a0);initEnv(_0x51ea59);const _0x5d5bd2=_0x3162a1||'./docs',_0x486cf4=_0x5cc74a?'使用指定的应用AppCode:\x20'+_0x3cffcf:_0x36d07f(0x1a9)+_0x3cffcf;useEffect(()=>{_0x21734e(!![]),_0x420c90();},[]),useEffect(()=>{(_0x5c4775||_0x7ff32f)&&_0x3bb367();},[_0x5c4775,_0x7ff32f,_0x3bb367]);async function _0x420c90(){const _0xee1bbd=_0x36d07f;if(!_0x3cffcf){_0x18aac2(_0xee1bbd(0x1c1));return;}try{logger[_0xee1bbd(0x1ad)](process[_0xee1bbd(0x1af)]()),_0xcc5122(_0xee1bbd(0x1bd));const {configArray:_0x337be8}=await fetchModelList(_0x3cffcf);_0x498b5a(_0x337be8[_0xee1bbd(0x1d4)]);if(_0x337be8[_0xee1bbd(0x1d4)]===0x0){_0x18aac2('未找到任何数据集');return;}let _0x444003=_0x337be8;if(_0x4814a3&&_0x4814a3[_0xee1bbd(0x1d4)]>0x0){_0x444003=_0x337be8[_0xee1bbd(0x1d2)](_0x1b37f9=>_0x4814a3[_0xee1bbd(0x1ca)](_0x1b37f9[_0xee1bbd(0x1a4)]));const _0x4b55e1=_0x444003[_0xee1bbd(0x1cd)](_0x4a489a=>_0x4a489a[_0xee1bbd(0x1a4)]),_0x42ae64=_0x4814a3['filter'](_0x27f09d=>!_0x4b55e1[_0xee1bbd(0x1ca)](_0x27f09d));_0x42ae64[_0xee1bbd(0x1d4)]>0x0&&console[_0xee1bbd(0x1b9)](_0xee1bbd(0x1c0)+_0x42ae64['join'](',\x20')+_0xee1bbd(0x1aa));if(_0x444003[_0xee1bbd(0x1d4)]===0x0){_0x18aac2(_0xee1bbd(0x1a3)+_0x4814a3[_0xee1bbd(0x1a7)](',\x20'));return;}console[_0xee1bbd(0x1b9)]('\x1b[90m*\x20从\x20'+_0x337be8[_0xee1bbd(0x1d4)]+_0xee1bbd(0x1d3)+_0x444003[_0xee1bbd(0x1d4)]+_0xee1bbd(0x1b2));}_0xcc5122(_0xee1bbd(0x1b0)+_0x444003[_0xee1bbd(0x1d4)]+_0xee1bbd(0x1ac));const _0x5ae04b=await generateDatasetDocs(_0x444003,_0x3cffcf,_0x5d5bd2,(_0x2e5e23,_0x7d3778,_0x5a798a)=>{const _0x6373d4=_0xee1bbd;_0xcc5122(_0x6373d4(0x1b0)+_0x5a798a+'.md\x20('+_0x2e5e23+'/'+_0x7d3778+')');},_0x5d020b);_0x3fff5e(_0x5ae04b),_0xa75daa(!![]);const _0x55d8e8=_0x5ae04b[_0xee1bbd(0x1d2)](_0x59afbe=>_0x59afbe[_0xee1bbd(0x1cf)])[_0xee1bbd(0x1d4)],_0x45c927=_0x5ae04b['filter'](_0x205c92=>!_0x205c92[_0xee1bbd(0x1cf)])['length'];logger[_0xee1bbd(0x1cf)]('api-doc','文档生成完成',undefined,{'totalCount':_0x5ae04b['length'],'successCount':_0x55d8e8,'failCount':_0x45c927,'outputDir':_0x5d5bd2});}catch(_0x2038fe){const _0x30b413=_0x2038fe instanceof Error?_0x2038fe[_0xee1bbd(0x1ae)]:String(_0x2038fe);logger[_0xee1bbd(0x1c2)](_0xee1bbd(0x1c7),_0xee1bbd(0x1ab)+_0x30b413,{'appCode':_0x3cffcf,'outputDir':_0x5d5bd2}),_0x18aac2(_0xee1bbd(0x1ab)+_0x30b413);}finally{_0x21734e(![]);}}const _0x2742e1=_0x245eb7?.['filter'](_0x1a5c06=>_0x1a5c06[_0x36d07f(0x1cf)])[_0x36d07f(0x1d4)]||0x0,_0x33fd8a=_0x245eb7?.[_0x36d07f(0x1d2)](_0xbd0bb1=>!_0xbd0bb1[_0x36d07f(0x1cf)])[_0x36d07f(0x1d4)]||0x0;return a5_0x3ce69b(Box,{'flexDirection':_0x36d07f(0x1ba),'children':[(_0x397990||_0x5c4775)&&a5_0x3ce69b(Box,{'children':[a5_0x2bb031(Text,{'color':_0x36d07f(0x1b7),'children':'*\x20'}),a5_0x2bb031(Text,{'color':_0x5cc74a?_0x36d07f(0x1c9):_0x36d07f(0x1a8),'children':_0x486cf4})]}),_0x397990&&a5_0x2bb031(Box,{'children':a5_0x3ce69b(Text,{'children':['🚀\x20',_0x70c91c,_0x36d07f(0x1d0),_0x51ea59,')']})}),_0x5c4775&&_0x245eb7&&a5_0x3ce69b(Box,{'flexDirection':_0x36d07f(0x1ba),'children':[a5_0x2bb031(Box,{'children':a5_0x3ce69b(Text,{'color':_0x36d07f(0x1a5),'children':['√\x20文档生成完成!成功\x20',_0x2742e1,'\x20个',_0x33fd8a>0x0&&_0x36d07f(0x1cc)+_0x33fd8a+'\x20个']})}),a5_0x2bb031(Box,{'marginTop':0x1,'children':a5_0x3ce69b(Text,{'color':_0x36d07f(0x1b7),'children':[_0x36d07f(0x1d1),_0x1fbaf7,_0x36d07f(0x1cb)]})}),a5_0x3ce69b(Box,{'marginTop':0x1,'children':[a5_0x2bb031(Text,{'color':_0x36d07f(0x1b7),'children':'*\x20输出目录:\x20'}),a5_0x2bb031(Text,{'color':_0x36d07f(0x1b6),'children':_0x5d5bd2})]}),_0x2742e1>0x0&&a5_0x3ce69b(a5_0x3e8a51,{'children':[a5_0x2bb031(Box,{'marginTop':0x1,'children':a5_0x2bb031(Text,{'color':_0x36d07f(0x1b7),'children':_0x36d07f(0x1bb)})}),_0x245eb7[_0x36d07f(0x1d2)](_0x4489e7=>_0x4489e7[_0x36d07f(0x1cf)])[_0x36d07f(0x1cd)]((_0x216890,_0x87a027)=>a5_0x3ce69b(Box,{'marginLeft':0x2,'children':[a5_0x3ce69b(Text,{'color':'cyan','children':['•\x20',_0x216890[_0x36d07f(0x1c5)]]}),a5_0x3ce69b(Text,{'color':'dim','children':[_0x36d07f(0x1b1),_0x216890[_0x36d07f(0x1c6)]]})]},_0x87a027))]}),_0x33fd8a>0x0&&a5_0x3ce69b(a5_0x3e8a51,{'children':[a5_0x2bb031(Box,{'marginTop':0x1,'children':a5_0x2bb031(Text,{'color':_0x36d07f(0x1a1),'children':_0x36d07f(0x1c8)})}),_0x245eb7[_0x36d07f(0x1d2)](_0x4c9d27=>!_0x4c9d27[_0x36d07f(0x1cf)])['map']((_0x3a0c48,_0x153fa1)=>a5_0x3ce69b(Box,{'marginLeft':0x2,'flexDirection':_0x36d07f(0x1ba),'children':[a5_0x3ce69b(Text,{'color':_0x36d07f(0x1bf),'children':['•\x20',_0x3a0c48[_0x36d07f(0x1c6)],'\x20(',_0x3a0c48[_0x36d07f(0x1a4)],')']}),_0x3a0c48[_0x36d07f(0x1c2)]&&a5_0x2bb031(Box,{'marginLeft':0x2,'children':a5_0x2bb031(Text,{'color':_0x36d07f(0x1a8),'children':_0x3a0c48['error']})})]},_0x153fa1))]})]}),_0x7ff32f&&a5_0x3ce69b(Box,{'flexDirection':'column','children':[a5_0x2bb031(Box,{'children':a5_0x3ce69b(Text,{'color':_0x36d07f(0x1bf),'children':['❌\x20',_0x7ff32f]})}),_0x7ff32f['includes']('登录')&&a5_0x3ce69b(Box,{'marginTop':0x1,'children':[a5_0x2bb031(Text,{'color':_0x36d07f(0x1a1),'children':'💡\x20请使用\x20'}),a5_0x2bb031(Text,{'color':_0x36d07f(0x1b6),'children':_0x36d07f(0x1a6)}),a5_0x2bb031(Text,{'color':'yellow','children':_0x36d07f(0x1bc)})]})]})]});};
1
+ (function(_0x2ba4c0,_0x2d9b1c){const _0x15d738=a2_0x552b,_0x12df43=_0x2ba4c0();while(!![]){try{const _0x3dce66=parseInt(_0x15d738(0x19f))/0x1*(-parseInt(_0x15d738(0x19c))/0x2)+-parseInt(_0x15d738(0x1b1))/0x3+-parseInt(_0x15d738(0x1ae))/0x4+-parseInt(_0x15d738(0x1b4))/0x5+-parseInt(_0x15d738(0x193))/0x6*(-parseInt(_0x15d738(0x1c5))/0x7)+parseInt(_0x15d738(0x18c))/0x8*(-parseInt(_0x15d738(0x1a2))/0x9)+parseInt(_0x15d738(0x19b))/0xa;if(_0x3dce66===_0x2d9b1c)break;else _0x12df43['push'](_0x12df43['shift']());}catch(_0x138d28){_0x12df43['push'](_0x12df43['shift']());}}}(a2_0xa3ed,0xac44e));import{jsx as a2_0x1afc25,jsxs as a2_0x2d1d33,Fragment as a2_0x2f7703}from'react/jsx-runtime';import{useEffect,useState}from'react';function a2_0xa3ed(){const _0x12797e=['message','yellow','api.common.noAppCodeDefault','includes','🚀\x20','api.docUI.allDatasetsNotFound','api.docUI.docFailed','filter','api.docUI.noDatasets','cyan','join','api.docUI.failedDatasets','map','env','235137cTcJAg','8RnNqXm','\x1b[0m','api.docUI.generatingFile','green','filePath','api.docUI.docComplete','api-doc','90esHZsC','red','文档生成失败:\x20','api.docUI.generatedDocs','column','./docs','api.common.usingSpecifiedAppCode','api.docUI.processedDatasets','33259750BCsnqR','66AgbYwW','api.docUI.filteredDatasets','api.docUI.docGenerateFailed','21973uEPcmX','datasetName','\x1b[90m','8053308NVCeRR','cwd','expired','online','api.docUI.datasetsNotFound','api.common.usingDefaultAppCode','\x20-\x20','length','error','gray','\x1b[33m','api.docUI.generatingDocs','1122756AlkGbW','success','💡\x20','1528047ImapzL','lovrabet\x20auth','Authentication','3571335PzFdeE','datasetCode','dim'];a2_0xa3ed=function(){return _0x12797e;};return a2_0xa3ed();}function a2_0x552b(_0x779d66,_0x343476){_0x779d66=_0x779d66-0x18c;const _0xa3ed4f=a2_0xa3ed();let _0x552b0c=_0xa3ed4f[_0x779d66];return _0x552b0c;}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';import{useI18n}from'../i18n/hooks.js';export const ApiDocUI=({appCode:_0x862d92,env:_0x5046dd,output:_0x59816d,extraParams:_0x1368c8,datasetCodes:_0x30c83e})=>{const _0x58877e=a2_0x552b,{exit:_0x13ccc9}=useApp(),{t:_0x512b7a}=useI18n(),[_0x5111ad,_0x3f0cea]=useState(![]),[_0x3cdd05,_0x272e69]=useState(''),[_0x2569e8,_0x598412]=useState(![]),[_0x32f648,_0x174670]=useState(null),[_0x185414,_0x4780d8]=useState(null),[_0x44e3a1,_0xa87886]=useState(0x0),_0x44803e=readConfig(),_0xe1bbe6=getConfigAppCode(),_0x3beaee=_0x862d92||_0xe1bbe6,_0x3b2244=typeof _0x44803e?.[_0x58877e(0x1c4)]==='string'?_0x44803e[_0x58877e(0x1c4)]:undefined,_0x556f07=_0x5046dd||_0x3b2244||_0x58877e(0x1a5);initEnv(_0x556f07);const _0x4c0c7b=_0x59816d||_0x58877e(0x198),_0x38ac78=_0x862d92?_0x512b7a(_0x58877e(0x199),{'appCode':_0x3beaee}):_0x512b7a(_0x58877e(0x1a7),{'appCode':_0x3beaee});useEffect(()=>{_0x3f0cea(!![]),_0x46d6ec();},[]),useEffect(()=>{(_0x2569e8||_0x32f648)&&_0x13ccc9();},[_0x2569e8,_0x32f648,_0x13ccc9]);async function _0x46d6ec(){const _0x27db70=_0x58877e;if(!_0x3beaee){_0x174670(_0x512b7a(_0x27db70(0x1b9)));return;}try{logger['setLogPath'](process[_0x27db70(0x1a3)]()),_0x272e69(_0x512b7a('api.docUI.fetchingDatasets'));const {configArray:_0x4477e5}=await fetchModelList(_0x3beaee);_0xa87886(_0x4477e5[_0x27db70(0x1a9)]);if(_0x4477e5[_0x27db70(0x1a9)]===0x0){_0x174670(_0x512b7a(_0x27db70(0x1bf)));return;}let _0xc5fdc9=_0x4477e5;if(_0x30c83e&&_0x30c83e[_0x27db70(0x1a9)]>0x0){_0xc5fdc9=_0x4477e5[_0x27db70(0x1be)](_0xa80f17=>_0x30c83e['includes'](_0xa80f17[_0x27db70(0x1b5)]));const _0x4283c7=_0xc5fdc9['map'](_0x35631b=>_0x35631b[_0x27db70(0x1b5)]),_0x1828f1=_0x30c83e['filter'](_0x233d70=>!_0x4283c7[_0x27db70(0x1ba)](_0x233d70));_0x1828f1[_0x27db70(0x1a9)]>0x0&&console['log'](_0x27db70(0x1ac)+_0x512b7a(_0x27db70(0x1a6),{'codes':_0x1828f1[_0x27db70(0x1c1)](',\x20')})+_0x27db70(0x18d));if(_0xc5fdc9[_0x27db70(0x1a9)]===0x0){_0x174670(_0x512b7a(_0x27db70(0x1bc),{'codes':_0x30c83e[_0x27db70(0x1c1)](',\x20')}));return;}console['log'](_0x27db70(0x1a1)+_0x512b7a(_0x27db70(0x19d),{'total':_0x4477e5['length'],'count':_0xc5fdc9[_0x27db70(0x1a9)]})+_0x27db70(0x18d));}_0x272e69(_0x512b7a(_0x27db70(0x1ad),{'count':_0xc5fdc9[_0x27db70(0x1a9)]}));const _0x4b81a2=await generateDatasetDocs(_0xc5fdc9,_0x3beaee,_0x4c0c7b,(_0x32c357,_0x113067,_0x102b82)=>{const _0x141316=_0x27db70;_0x272e69(_0x512b7a(_0x141316(0x18e),{'fileName':_0x102b82,'current':_0x32c357,'total':_0x113067}));},_0x1368c8);_0x4780d8(_0x4b81a2),_0x598412(!![]);const _0x52becc=_0x4b81a2[_0x27db70(0x1be)](_0x5b0946=>_0x5b0946[_0x27db70(0x1af)])[_0x27db70(0x1a9)],_0x441d24=_0x4b81a2['filter'](_0xe9689d=>!_0xe9689d[_0x27db70(0x1af)])[_0x27db70(0x1a9)];logger[_0x27db70(0x1af)](_0x27db70(0x192),'文档生成完成',undefined,{'totalCount':_0x4b81a2['length'],'successCount':_0x52becc,'failCount':_0x441d24,'outputDir':_0x4c0c7b});}catch(_0x412773){const _0x340600=_0x412773 instanceof Error?_0x412773[_0x27db70(0x1b7)]:String(_0x412773);logger[_0x27db70(0x1aa)](_0x27db70(0x192),_0x27db70(0x195)+_0x340600,{'appCode':_0x3beaee,'outputDir':_0x4c0c7b}),_0x174670(_0x512b7a(_0x27db70(0x19e),{'error':_0x340600}));}finally{_0x3f0cea(![]);}}const _0x3ec9e2=_0x185414?.[_0x58877e(0x1be)](_0x29230b=>_0x29230b['success'])[_0x58877e(0x1a9)]||0x0,_0x287f67=_0x185414?.['filter'](_0x241d4f=>!_0x241d4f[_0x58877e(0x1af)])[_0x58877e(0x1a9)]||0x0;return a2_0x2d1d33(Box,{'flexDirection':_0x58877e(0x197),'children':[(_0x5111ad||_0x2569e8)&&a2_0x2d1d33(Box,{'children':[a2_0x1afc25(Text,{'color':_0x58877e(0x1ab),'children':'*\x20'}),a2_0x1afc25(Text,{'color':_0x862d92?'white':_0x58877e(0x1b6),'children':_0x38ac78})]}),_0x5111ad&&a2_0x1afc25(Box,{'children':a2_0x2d1d33(Text,{'children':[_0x58877e(0x1bb),_0x3cdd05]})}),_0x2569e8&&_0x185414&&a2_0x2d1d33(Box,{'flexDirection':_0x58877e(0x197),'children':[a2_0x1afc25(Box,{'children':a2_0x2d1d33(Text,{'color':_0x58877e(0x18f),'children':[_0x512b7a(_0x58877e(0x191),{'successCount':_0x3ec9e2}),_0x287f67>0x0?_0x512b7a(_0x58877e(0x1bd),{'failCount':_0x287f67}):'']})}),a2_0x1afc25(Box,{'marginTop':0x1,'children':a2_0x1afc25(Text,{'color':'gray','children':_0x512b7a(_0x58877e(0x19a),{'count':_0x44e3a1})})}),a2_0x2d1d33(Box,{'marginTop':0x1,'children':[a2_0x1afc25(Text,{'color':_0x58877e(0x1ab),'children':_0x512b7a('api.docUI.outputDir')}),a2_0x1afc25(Text,{'color':'cyan','children':_0x4c0c7b})]}),_0x3ec9e2>0x0&&a2_0x2d1d33(a2_0x2f7703,{'children':[a2_0x1afc25(Box,{'marginTop':0x1,'children':a2_0x1afc25(Text,{'color':_0x58877e(0x1ab),'children':_0x512b7a(_0x58877e(0x196))})}),_0x185414['filter'](_0x51c56b=>_0x51c56b[_0x58877e(0x1af)])[_0x58877e(0x1c3)]((_0x5769ca,_0x3cd066)=>a2_0x2d1d33(Box,{'marginLeft':0x2,'children':[a2_0x2d1d33(Text,{'color':_0x58877e(0x1c0),'children':['•\x20',_0x5769ca[_0x58877e(0x190)]]}),a2_0x2d1d33(Text,{'color':'dim','children':[_0x58877e(0x1a8),_0x5769ca[_0x58877e(0x1a0)]]})]},_0x3cd066))]}),_0x287f67>0x0&&a2_0x2d1d33(a2_0x2f7703,{'children':[a2_0x1afc25(Box,{'marginTop':0x1,'children':a2_0x1afc25(Text,{'color':_0x58877e(0x1b8),'children':_0x512b7a(_0x58877e(0x1c2))})}),_0x185414[_0x58877e(0x1be)](_0x5715a3=>!_0x5715a3[_0x58877e(0x1af)])[_0x58877e(0x1c3)]((_0xe02e54,_0x81c88d)=>a2_0x2d1d33(Box,{'marginLeft':0x2,'flexDirection':_0x58877e(0x197),'children':[a2_0x2d1d33(Text,{'color':_0x58877e(0x194),'children':['•\x20',_0xe02e54['datasetName'],'\x20(',_0xe02e54[_0x58877e(0x1b5)],')']}),_0xe02e54[_0x58877e(0x1aa)]&&a2_0x1afc25(Box,{'marginLeft':0x2,'children':a2_0x1afc25(Text,{'color':_0x58877e(0x1b6),'children':_0xe02e54[_0x58877e(0x1aa)]})})]},_0x81c88d))]})]}),_0x32f648&&a2_0x2d1d33(Box,{'flexDirection':_0x58877e(0x197),'children':[a2_0x1afc25(Box,{'children':a2_0x2d1d33(Text,{'color':_0x58877e(0x194),'children':['❌\x20',_0x32f648]})}),(_0x32f648['includes']('登录')||_0x32f648['includes'](_0x58877e(0x1b3))||_0x32f648[_0x58877e(0x1ba)](_0x58877e(0x1a4)))&&a2_0x2d1d33(Box,{'marginTop':0x1,'children':[a2_0x1afc25(Text,{'color':_0x58877e(0x1b8),'children':_0x58877e(0x1b0)}),a2_0x1afc25(Text,{'color':_0x58877e(0x1c0),'children':_0x58877e(0x1b2)}),a2_0x2d1d33(Text,{'color':_0x58877e(0x1b8),'children':['\x20',_0x512b7a('api.common.authRetry')]})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x3336f2,_0x4791a1){const _0x36f22f=a6_0xc749,_0x551836=_0x3336f2();while(!![]){try{const _0x32f85a=parseInt(_0x36f22f(0xba))/0x1+parseInt(_0x36f22f(0xca))/0x2+parseInt(_0x36f22f(0xb9))/0x3*(parseInt(_0x36f22f(0xc3))/0x4)+parseInt(_0x36f22f(0xbc))/0x5+parseInt(_0x36f22f(0xd6))/0x6*(parseInt(_0x36f22f(0xc9))/0x7)+parseInt(_0x36f22f(0xb4))/0x8+parseInt(_0x36f22f(0xc2))/0x9*(-parseInt(_0x36f22f(0xd4))/0xa);if(_0x32f85a===_0x4791a1)break;else _0x551836['push'](_0x551836['shift']());}catch(_0x6abfba){_0x551836['push'](_0x551836['shift']());}}}(a6_0x120a,0xc8937));import{mkdirSync,writeFileSync}from'node:fs';function a6_0x120a(){const _0x1175c7=['2029484PVIDQU','status','/api/node-toolbox/api-doc-generator','success','stringify','markdown','.md','),HTTP状态码:\x20','message','length','44921680uByfFk','生成文档失败:\x20','6BiPmCS','text','✗\x20失败:\x20','api-doc','\x20个数据集需要生成文档\x0a','data','error','push','name','10465048QeNLQP','\x0a共有\x20','tableName','join','json','129jkdfqK','181088zjIkJS','datasetCode','7338590lzxHcL','log','生成文档成功:\x20','响应数据格式错误\x20(','POST','):缺少\x20data.markdown\x20字段','9OjrzEK','58356OkJwoq','.md\x20-\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','application/json',']\x20正在生成:\x20','✓\x20成功生成:\x20','5003047wrWaki'];a6_0x120a=function(){return _0x1175c7;};return a6_0x120a();}import a6_0x5e98da from'node:path';import{getCookie}from'../auth/get-cookie.js';function a6_0xc749(_0x15d4fb,_0x5c7160){_0x15d4fb=_0x15d4fb-0xb0;const _0x120a85=a6_0x120a();let _0xc74993=_0x120a85[_0x15d4fb];return _0xc74993;}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x4bbd24){const _0x541bfd=a6_0xc749,{appCode:_0x422073,datasetCode:_0x537a5c,datasetId:_0x240078,extraParams:_0x4c555b}=_0x4bbd24,_0x3f58a2=getApiDomain(),_0x229f84=_0x3f58a2+_0x541bfd(0xcc),_0x42b9d4={'appCode':_0x422073,'datasetCode':_0x537a5c,'datasetId':_0x240078,..._0x4c555b||{}},_0x2aa6cd=await fetch(_0x229f84,{'method':_0x541bfd(0xc0),'headers':{'Content-Type':_0x541bfd(0xc6),'Cookie':getCookie()},'body':JSON[_0x541bfd(0xce)](_0x42b9d4)});if(!_0x2aa6cd['ok']){if(_0x2aa6cd[_0x541bfd(0xcb)]===0x191)throw new Error(_0x541bfd(0xc5));let _0x10817e='';try{_0x10817e=await _0x2aa6cd[_0x541bfd(0xd7)]();}catch(_0x148ccc){}throw new Error('获取文档失败\x20('+_0x537a5c+_0x541bfd(0xd1)+_0x2aa6cd[_0x541bfd(0xcb)]+(_0x10817e?'\x0a'+_0x10817e:''));}const _0x554608=await _0x2aa6cd[_0x541bfd(0xb8)]();if(!_0x554608['data']||typeof _0x554608[_0x541bfd(0xb0)][_0x541bfd(0xcf)]!=='string')throw new Error(_0x541bfd(0xbf)+_0x537a5c+_0x541bfd(0xc1));return _0x554608['data']['markdown'];}function delay(_0x1c899b){return new Promise(_0x296c4d=>setTimeout(_0x296c4d,_0x1c899b));}export async function generateDatasetDocs(_0xd75a5b,_0x584dc4,_0xba8764='./docs',_0x1ab580,_0x459f84){const _0x58db29=a6_0xc749;mkdirSync(_0xba8764,{'recursive':!![]});const _0x6b189b=[],_0x2c51fd=_0xd75a5b[_0x58db29(0xd3)];console['log'](_0x58db29(0xb5)+_0x2c51fd+_0x58db29(0xda));for(let _0xa89b68=0x0;_0xa89b68<_0xd75a5b[_0x58db29(0xd3)];_0xa89b68++){const _0x148d32=_0xd75a5b[_0xa89b68],_0x18b89e=_0xa89b68+0x1,_0x2192a0=_0x148d32[_0x58db29(0xb6)];try{console[_0x58db29(0xbd)]('['+_0x18b89e+'/'+_0x2c51fd+_0x58db29(0xc7)+_0x2192a0+'.md\x20('+_0x148d32['name']+')');_0x1ab580&&_0x1ab580(_0x18b89e,_0x2c51fd,_0x2192a0);const _0x3d7bef=await fetchDatasetDoc({'appCode':_0x584dc4,'datasetCode':_0x148d32['datasetCode'],'datasetId':_0x148d32['id'],'enableAI':![],'extraParams':_0x459f84}),_0x1c3acd=a6_0x5e98da[_0x58db29(0xb7)](_0xba8764,_0x2192a0+_0x58db29(0xd0));writeFileSync(_0x1c3acd,_0x3d7bef,{'encoding':'utf8'}),console['log'](_0x58db29(0xc8)+_0x2192a0+_0x58db29(0xd0)),logger[_0x58db29(0xcd)](_0x58db29(0xd9),_0x58db29(0xbe)+_0x2192a0,undefined,{'datasetCode':_0x148d32['datasetCode'],'datasetName':_0x148d32[_0x58db29(0xb3)],'filePath':_0x1c3acd,'progress':_0x18b89e+'/'+_0x2c51fd}),_0x6b189b[_0x58db29(0xb2)]({'datasetCode':_0x148d32[_0x58db29(0xbb)],'datasetName':_0x148d32[_0x58db29(0xb3)],'filePath':_0x1c3acd,'success':!![]}),_0x18b89e<_0x2c51fd&&await delay(0x1388);}catch(_0xd6b262){const _0x18ccf4=_0xd6b262 instanceof Error?_0xd6b262[_0x58db29(0xd2)]:String(_0xd6b262);console[_0x58db29(0xbd)](_0x58db29(0xd8)+_0x2192a0+_0x58db29(0xc4)+_0x18ccf4+'\x0a'),logger[_0x58db29(0xb1)](_0x58db29(0xd9),_0x58db29(0xd5)+_0x148d32['datasetCode'],{'datasetCode':_0x148d32[_0x58db29(0xbb)],'datasetName':_0x148d32[_0x58db29(0xb3)],'error':_0x18ccf4,'progress':_0x18b89e+'/'+_0x2c51fd}),_0x6b189b['push']({'datasetCode':_0x148d32[_0x58db29(0xbb)],'datasetName':_0x148d32[_0x58db29(0xb3)],'filePath':'','success':![],'error':_0x18ccf4}),_0x18b89e<_0x2c51fd&&(console['log']('等待\x203\x20秒...\x0a'),await delay(0xbb8));}}return _0x6b189b;}
1
+ const a3_0x2eea49=a3_0x5bcd;(function(_0x4730e1,_0x40a4eb){const _0xfbd52f=a3_0x5bcd,_0x592f1c=_0x4730e1();while(!![]){try{const _0x339252=-parseInt(_0xfbd52f(0xfc))/0x1*(-parseInt(_0xfbd52f(0xf6))/0x2)+-parseInt(_0xfbd52f(0xf0))/0x3+-parseInt(_0xfbd52f(0xe5))/0x4*(-parseInt(_0xfbd52f(0xf2))/0x5)+-parseInt(_0xfbd52f(0xe7))/0x6+-parseInt(_0xfbd52f(0xe8))/0x7*(-parseInt(_0xfbd52f(0xed))/0x8)+-parseInt(_0xfbd52f(0xfe))/0x9+parseInt(_0xfbd52f(0xef))/0xa*(parseInt(_0xfbd52f(0xec))/0xb);if(_0x339252===_0x40a4eb)break;else _0x592f1c['push'](_0x592f1c['shift']());}catch(_0x2c2b15){_0x592f1c['push'](_0x592f1c['shift']());}}}(a3_0x297d,0x9b721));function a3_0x5bcd(_0x353003,_0x517ccd){_0x353003=_0x353003-0xe2;const _0x297da9=a3_0x297d();let _0x5bcdad=_0x297da9[_0x353003];return _0x5bcdad;}function a3_0x297d(){const _0x2d4b51=['json','datasetCode','297424anUmuF','bind','6604011LGiOpl','log','join','api-doc','string','status','application/json','api.docBatch.generating','text','api.docBatch.waiting','3742564ajjMma','tableName','3905652PnIqnT','1019431wuJcgs','name','push','api.docBatch.failed','5302ijTTLx','48HkDqNR','POST','10870LohWgs','2720385OPnYIy','生成文档成功:\x20','5elcCdW','api.docBatch.totalDatasets','data','markdown','4OABUOz','.md','length','api.docBatch.httpError'];a3_0x297d=function(){return _0x2d4b51;};return a3_0x297d();}import{mkdirSync,writeFileSync}from'node:fs';import a3_0x2b71be from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import a3_0x3ef281 from'../i18n/index.js';const t=a3_0x3ef281['t'][a3_0x2eea49(0xfd)](a3_0x3ef281);export async function fetchDatasetDoc(_0x432afb){const _0x4fd735=a3_0x2eea49,{appCode:_0x571c74,datasetCode:_0x3f9c8d,datasetId:_0x49f4e1,extraParams:_0x492a1e}=_0x432afb,_0x1550da=getApiDomain(),_0x4e39b7=_0x1550da+'/api/node-toolbox/api-doc-generator',_0x1535ed={'appCode':_0x571c74,'datasetCode':_0x3f9c8d,'datasetId':_0x49f4e1,..._0x492a1e||{}},_0x33bc50=await fetch(_0x4e39b7,{'method':_0x4fd735(0xee),'headers':{'Content-Type':_0x4fd735(0x104),'Cookie':getCookie()},'body':JSON['stringify'](_0x1535ed)});if(!_0x33bc50['ok']){if(_0x33bc50[_0x4fd735(0x103)]===0x191)throw new Error(t('api.common.authExpired'));let _0x4ac9fe='';try{_0x4ac9fe=await _0x33bc50[_0x4fd735(0xe3)]();}catch(_0x4106f7){}throw new Error(''+t(_0x4fd735(0xf9),{'datasetCode':_0x3f9c8d,'status':_0x33bc50['status']})+(_0x4ac9fe?'\x0a'+_0x4ac9fe:''));}const _0x44766a=await _0x33bc50[_0x4fd735(0xfa)]();if(!_0x44766a[_0x4fd735(0xf4)]||typeof _0x44766a[_0x4fd735(0xf4)][_0x4fd735(0xf5)]!==_0x4fd735(0x102))throw new Error(t('api.docBatch.docFormatError',{'datasetCode':_0x3f9c8d}));return _0x44766a['data'][_0x4fd735(0xf5)];}function delay(_0xd843b3){return new Promise(_0x39eb8d=>setTimeout(_0x39eb8d,_0xd843b3));}export async function generateDatasetDocs(_0x34eeb0,_0xa77916,_0x18ed1d='./docs',_0xb540e7,_0x149694){const _0x254a04=a3_0x2eea49;mkdirSync(_0x18ed1d,{'recursive':!![]});const _0x251163=[],_0x9287b9=_0x34eeb0[_0x254a04(0xf8)];console[_0x254a04(0xff)](t(_0x254a04(0xf3),{'count':_0x9287b9}));for(let _0x39f6d6=0x0;_0x39f6d6<_0x34eeb0['length'];_0x39f6d6++){const _0x7fbf19=_0x34eeb0[_0x39f6d6],_0x2be053=_0x39f6d6+0x1,_0x160230=_0x7fbf19[_0x254a04(0xe6)];try{console[_0x254a04(0xff)](t(_0x254a04(0xe2),{'current':_0x2be053,'total':_0x9287b9,'fileName':_0x160230,'name':_0x7fbf19[_0x254a04(0xe9)]}));_0xb540e7&&_0xb540e7(_0x2be053,_0x9287b9,_0x160230);const _0x1cc180=await fetchDatasetDoc({'appCode':_0xa77916,'datasetCode':_0x7fbf19['datasetCode'],'datasetId':_0x7fbf19['id'],'enableAI':![],'extraParams':_0x149694}),_0x108906=a3_0x2b71be[_0x254a04(0x100)](_0x18ed1d,_0x160230+_0x254a04(0xf7));writeFileSync(_0x108906,_0x1cc180,{'encoding':'utf8'}),console[_0x254a04(0xff)](t('api.docBatch.success',{'fileName':_0x160230})),logger['success'](_0x254a04(0x101),_0x254a04(0xf1)+_0x160230,undefined,{'datasetCode':_0x7fbf19['datasetCode'],'datasetName':_0x7fbf19[_0x254a04(0xe9)],'filePath':_0x108906,'progress':_0x2be053+'/'+_0x9287b9}),_0x251163[_0x254a04(0xea)]({'datasetCode':_0x7fbf19[_0x254a04(0xfb)],'datasetName':_0x7fbf19[_0x254a04(0xe9)],'filePath':_0x108906,'success':!![]}),_0x2be053<_0x9287b9&&await delay(0x1388);}catch(_0x179238){const _0x506e80=_0x179238 instanceof Error?_0x179238['message']:String(_0x179238);console[_0x254a04(0xff)](t(_0x254a04(0xeb),{'fileName':_0x160230,'error':_0x506e80})),logger['error'](_0x254a04(0x101),'生成文档失败:\x20'+_0x7fbf19['datasetCode'],{'datasetCode':_0x7fbf19[_0x254a04(0xfb)],'datasetName':_0x7fbf19[_0x254a04(0xe9)],'error':_0x506e80,'progress':_0x2be053+'/'+_0x9287b9}),_0x251163[_0x254a04(0xea)]({'datasetCode':_0x7fbf19['datasetCode'],'datasetName':_0x7fbf19[_0x254a04(0xe9)],'filePath':'','success':![],'error':_0x506e80}),_0x2be053<_0x9287b9&&(console[_0x254a04(0xff)](t(_0x254a04(0xe4))),await delay(0xbb8));}}return _0x251163;}
@@ -1 +1 @@
1
- (function(_0xa71420,_0x4a4a70){const _0x215490=a7_0x2c47,_0x4da904=_0xa71420();while(!![]){try{const _0x14fcd5=-parseInt(_0x215490(0x113))/0x1+parseInt(_0x215490(0xfd))/0x2+-parseInt(_0x215490(0x122))/0x3+-parseInt(_0x215490(0x11a))/0x4+-parseInt(_0x215490(0x105))/0x5+-parseInt(_0x215490(0x133))/0x6*(parseInt(_0x215490(0x12a))/0x7)+-parseInt(_0x215490(0x123))/0x8*(-parseInt(_0x215490(0x107))/0x9);if(_0x14fcd5===_0x4a4a70)break;else _0x4da904['push'](_0x4da904['shift']());}catch(_0x2a804f){_0x4da904['push'](_0x4da904['shift']());}}}(a7_0x1035,0x6b5ff));import{jsx as a7_0x260b70,jsxs as a7_0x4a61ee}from'react/jsx-runtime';import{useEffect,useState}from'react';function a7_0x1035(){const _0x539b53=['\x20个,过滤重复','619790YCCMJN','yellow','endsWith','gray','\x20重新登录后再试','join','./src/api/','1946220WLKmzd','-api','includes','red','error','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','cyan','\x20个模型','358425nfEeRS','897976ZyxoPu','api-pull','string','length','*\x20导入方式:','lovrabet\x20auth','拉取\x20API\x20配置失败:\x20','393708pulYjc','√\x20成功拉取\x20','未提供应用AppCode,且配置中也没有默认值','\x20-\x20客户端实例文件','cwd','api','\x20from\x20\x27@/','\x20个模型)','white','6LrZAWk','1632552rZvKpi','slice','replace','-client','modelCount','*\x20已生成文件:','dim','env','2206845HufroE','client','108jPjkSw','使用配置的应用AppCode:\x20','message','split','duplicateCount','import\x20','column','\x20个数据集,生成','{\x20lovrabetClient\x20}','使用指定的应用AppCode:\x20','.ts'];a7_0x1035=function(){return _0x539b53;};return a7_0x1035();}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a7_0x2c47(_0x15b9d2,_0x58fccb){_0x15b9d2=_0x15b9d2-0xfd;const _0x103575=a7_0x1035();let _0x2c47b5=_0x103575[_0x15b9d2];return _0x2c47b5;}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x38f8b5,env:_0x29067b,output:_0x145c42})=>{const _0x3d00ad=a7_0x2c47,{exit:_0xa9f3b0}=useApp(),[_0x2cf8ce,_0x245933]=useState(![]),[_0x32d352,_0x2f5e3b]=useState(![]),[_0xde5126,_0xf0be15]=useState(null),[_0x3a1e2b,_0xbfa747]=useState(null),_0x1b14a2=readConfig(),_0x47003c=getConfigAppCode(),_0x50b061=_0x38f8b5||_0x47003c,_0x4cfe41=typeof _0x1b14a2?.[_0x3d00ad(0x104)]===_0x3d00ad(0x125)?_0x1b14a2[_0x3d00ad(0x104)]:undefined,_0x2d6996=_0x29067b||_0x4cfe41||'online';initEnv(_0x2d6996);const _0x7d43c9=_0x145c42||_0x3d00ad(0x119),_0x209d8a=_0x38f8b5&&_0x38f8b5['includes']('-')?_0x38f8b5[_0x3d00ad(0x10a)]('-')[_0x3d00ad(0xfe)](0x1)[_0x3d00ad(0x118)]('-'):'',_0x135b01=_0x38f8b5?_0x3d00ad(0x110)+_0x50b061:_0x3d00ad(0x108)+_0x50b061,_0x3017b0=_0x209d8a?_0x209d8a+_0x3d00ad(0x11b):'api',_0x316976=_0x209d8a?_0x209d8a+_0x3d00ad(0x100):_0x3d00ad(0x106);useEffect(()=>{_0x245933(!![]),_0x8f179e();},[]),useEffect(()=>{(_0x32d352||_0xde5126)&&_0xa9f3b0();},[_0x32d352,_0xde5126,_0xa9f3b0]);async function _0x8f179e(){const _0x490704=_0x3d00ad;if(!_0x50b061){_0xf0be15(_0x490704(0x12c));return;}try{logger['setLogPath'](process[_0x490704(0x12e)]());const {configArray:_0x4369ca}=await fetchModelList(_0x50b061),_0x2cb362=_0x4369ca[_0x490704(0x126)],_0xc34e6b=!_0x38f8b5,_0x24d1ce=await generateApiFile(_0x4369ca,_0x209d8a,_0x50b061,_0xc34e6b,_0x2d6996,_0x7d43c9),_0x17cf31=_0x7d43c9[_0x490704(0x115)]('/')?_0x7d43c9:_0x7d43c9+'/';_0xbfa747({'api':''+_0x17cf31+_0x3017b0+_0x490704(0x111),'client':''+_0x17cf31+_0x316976+'.ts','modelCount':_0x24d1ce['modelCount'],'datasetCount':_0x2cb362,'originalCount':_0x2cb362,'duplicateCount':0x0}),_0x2f5e3b(!![]);}catch(_0x509b07){const _0x3872e7=_0x509b07 instanceof Error?_0x509b07[_0x490704(0x109)]:String(_0x509b07);logger[_0x490704(0x11e)](_0x490704(0x124),_0x490704(0x129)+_0x3872e7,{'appCode':_0x50b061,'error':_0x3872e7}),_0xf0be15(_0x490704(0x129)+_0x3872e7);}finally{_0x245933(![]);}}return a7_0x4a61ee(Box,{'flexDirection':_0x3d00ad(0x10d),'children':[(_0x2cf8ce||_0x32d352)&&a7_0x4a61ee(Box,{'children':[a7_0x260b70(Text,{'color':'gray','children':'*\x20'}),a7_0x260b70(Text,{'color':_0x38f8b5?_0x3d00ad(0x132):_0x3d00ad(0x103),'children':_0x135b01})]}),_0x2cf8ce&&a7_0x260b70(Box,{'children':a7_0x4a61ee(Text,{'children':[_0x3d00ad(0x11f),_0x2d6996,')']})}),_0x32d352&&_0x3a1e2b&&a7_0x4a61ee(Box,{'flexDirection':_0x3d00ad(0x10d),'children':[a7_0x260b70(Box,{'children':a7_0x4a61ee(Text,{'color':'green','children':[_0x3d00ad(0x12b),_0x3a1e2b['datasetCount'],_0x3d00ad(0x10e),'\x20',_0x3a1e2b[_0x3d00ad(0x101)],_0x3d00ad(0x121)]})}),_0x3a1e2b[_0x3d00ad(0x10b)]>0x0&&a7_0x260b70(Box,{'marginTop':0x1,'children':a7_0x4a61ee(Text,{'color':'yellow','children':['!\x20原始数据集\x20',_0x3a1e2b['originalCount'],_0x3d00ad(0x112),'\x20',_0x3a1e2b[_0x3d00ad(0x10b)],'\x20个']})}),a7_0x260b70(Box,{'marginTop':0x1,'children':a7_0x260b70(Text,{'color':_0x3d00ad(0x116),'children':_0x3d00ad(0x102)})}),a7_0x4a61ee(Box,{'marginLeft':0x2,'children':[a7_0x4a61ee(Text,{'color':_0x3d00ad(0x120),'children':['•\x20',_0x3a1e2b[_0x3d00ad(0x12f)]]}),a7_0x4a61ee(Text,{'color':_0x3d00ad(0x103),'children':['\x20','-\x20模型配置文件\x20(',_0x3a1e2b['modelCount'],_0x3d00ad(0x131)]})]}),a7_0x4a61ee(Box,{'marginLeft':0x2,'children':[a7_0x4a61ee(Text,{'color':_0x3d00ad(0x120),'children':['•\x20',_0x3a1e2b[_0x3d00ad(0x106)]]}),a7_0x260b70(Text,{'color':_0x3d00ad(0x103),'children':_0x3d00ad(0x12d)})]}),a7_0x260b70(Box,{'marginTop':0x1,'children':a7_0x260b70(Text,{'color':_0x3d00ad(0x116),'children':_0x3d00ad(0x127)})}),a7_0x260b70(Box,{'marginLeft':0x2,'children':a7_0x4a61ee(Text,{'color':_0x3d00ad(0x114),'children':[_0x3d00ad(0x10c),_0x3d00ad(0x10f),_0x3d00ad(0x130),_0x3a1e2b[_0x3d00ad(0x106)][_0x3d00ad(0xff)](/^\.\//,'')[_0x3d00ad(0xff)](_0x3d00ad(0x111),''),'\x27']})})]}),_0xde5126&&a7_0x4a61ee(Box,{'flexDirection':'column','children':[a7_0x260b70(Box,{'children':a7_0x4a61ee(Text,{'color':_0x3d00ad(0x11d),'children':['❌\x20',_0xde5126]})}),_0xde5126[_0x3d00ad(0x11c)]('登录')&&a7_0x4a61ee(Box,{'marginTop':0x1,'children':[a7_0x260b70(Text,{'color':_0x3d00ad(0x114),'children':'💡\x20请使用\x20'}),a7_0x260b70(Text,{'color':'cyan','children':_0x3d00ad(0x128)}),a7_0x260b70(Text,{'color':_0x3d00ad(0x114),'children':_0x3d00ad(0x117)})]})]})]});};
1
+ (function(_0xb4b319,_0x41804d){const _0x194fbb=a4_0x345c,_0x5bc0c1=_0xb4b319();while(!![]){try{const _0x3ee2ab=-parseInt(_0x194fbb(0x136))/0x1*(-parseInt(_0x194fbb(0x14b))/0x2)+-parseInt(_0x194fbb(0x151))/0x3+-parseInt(_0x194fbb(0x13a))/0x4*(-parseInt(_0x194fbb(0x159))/0x5)+-parseInt(_0x194fbb(0x13f))/0x6+-parseInt(_0x194fbb(0x14f))/0x7+-parseInt(_0x194fbb(0x162))/0x8+parseInt(_0x194fbb(0x14a))/0x9*(parseInt(_0x194fbb(0x161))/0xa);if(_0x3ee2ab===_0x41804d)break;else _0x5bc0c1['push'](_0x5bc0c1['shift']());}catch(_0x2d16eb){_0x5bc0c1['push'](_0x5bc0c1['shift']());}}}(a4_0x5878,0xcc42a));import{jsx as a4_0x450a01,jsxs as a4_0x404762}from'react/jsx-runtime';import{useEffect,useState}from'react';function a4_0x345c(_0x4ab1d1,_0x4769d3){_0x4ab1d1=_0x4ab1d1-0x132;const _0x58785c=a4_0x5878();let _0x345c37=_0x58785c[_0x4ab1d1];return _0x345c37;}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a4_0x5878(){const _0x1ffcac=['4765440xcEqdh','💡\x20','拉取\x20API\x20配置失败:\x20','api.common.usingSpecifiedAppCode','Authentication','api.pullUI.importHint','slice','column','5HqTKYa','api.pullUI.clientFile','duplicateCount','-client','-api','lovrabet\x20auth','api.pullUI.pullFailed','cyan','438010vCHKUy','4572472ZehPmq','api.pullUI.modelFile','replace','dim','./src/api/','expired','originalCount','.ts','api.pullUI.duplicateInfo','1dxEdsY','modelCount','api.pullUI.successPull','api.common.usingDefaultAppCode','5180132YOMvpG','join','white','api.pullUI.generatedFiles','error','7109706HXIyCS','client','api','online','red','includes','api.pullUI.fetching','gray','env','{\x20lovrabetClient\x20}','yellow','387NzwqIq','3022270oOpXNr','split','cwd','message','3555797GDRqKp','setLogPath'];a4_0x5878=function(){return _0x1ffcac;};return a4_0x5878();}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';import{useI18n}from'../i18n/hooks.js';export const ApiPullUI=({appCode:_0x45431d,env:_0x3be9b5,output:_0x480b16})=>{const _0x3ee33d=a4_0x345c,{exit:_0x200e8a}=useApp(),{t:_0x346386}=useI18n(),[_0x4b5a03,_0x146ad2]=useState(![]),[_0x23118f,_0x45fd04]=useState(![]),[_0x58ef8f,_0x2e79fa]=useState(null),[_0x56371b,_0x1e5ea9]=useState(null),_0x127e68=readConfig(),_0x2c4ece=getConfigAppCode(),_0xf2b9e3=_0x45431d||_0x2c4ece,_0x331d0f=typeof _0x127e68?.[_0x3ee33d(0x147)]==='string'?_0x127e68['env']:undefined,_0x2576db=_0x3be9b5||_0x331d0f||_0x3ee33d(0x142);initEnv(_0x2576db);const _0x40ae74=_0x480b16||_0x3ee33d(0x166),_0x437e32=_0x45431d&&_0x45431d[_0x3ee33d(0x144)]('-')?_0x45431d[_0x3ee33d(0x14c)]('-')[_0x3ee33d(0x157)](0x1)[_0x3ee33d(0x13b)]('-'):'',_0x1aeb70=_0x45431d?_0x346386(_0x3ee33d(0x154),{'appCode':_0xf2b9e3}):_0x346386(_0x3ee33d(0x139),{'appCode':_0xf2b9e3}),_0x40e2aa=_0x437e32?_0x437e32+_0x3ee33d(0x15d):_0x3ee33d(0x141),_0x1e7867=_0x437e32?_0x437e32+_0x3ee33d(0x15c):_0x3ee33d(0x140);useEffect(()=>{_0x146ad2(!![]),_0xd0d367();},[]),useEffect(()=>{(_0x23118f||_0x58ef8f)&&_0x200e8a();},[_0x23118f,_0x58ef8f,_0x200e8a]);async function _0xd0d367(){const _0x235088=_0x3ee33d;if(!_0xf2b9e3){_0x2e79fa(_0x346386('api.common.noAppCodeDefault'));return;}try{logger[_0x235088(0x150)](process[_0x235088(0x14d)]());const {configArray:_0x238e04}=await fetchModelList(_0xf2b9e3),_0x6021a0=_0x238e04['length'],_0x5263c8=!_0x45431d,_0x524d28=await generateApiFile(_0x238e04,_0x437e32,_0xf2b9e3,_0x5263c8,_0x2576db,_0x40ae74),_0x40674f=_0x40ae74['endsWith']('/')?_0x40ae74:_0x40ae74+'/';_0x1e5ea9({'api':''+_0x40674f+_0x40e2aa+_0x235088(0x134),'client':''+_0x40674f+_0x1e7867+'.ts','modelCount':_0x524d28[_0x235088(0x137)],'datasetCount':_0x6021a0,'originalCount':_0x6021a0,'duplicateCount':0x0}),_0x45fd04(!![]);}catch(_0x3394b3){const _0x312967=_0x3394b3 instanceof Error?_0x3394b3[_0x235088(0x14e)]:String(_0x3394b3);logger[_0x235088(0x13e)]('api-pull',_0x235088(0x153)+_0x312967,{'appCode':_0xf2b9e3,'error':_0x312967}),_0x2e79fa(_0x346386(_0x235088(0x15f),{'error':_0x312967}));}finally{_0x146ad2(![]);}}return a4_0x404762(Box,{'flexDirection':_0x3ee33d(0x158),'children':[(_0x4b5a03||_0x23118f)&&a4_0x404762(Box,{'children':[a4_0x450a01(Text,{'color':_0x3ee33d(0x146),'children':'*\x20'}),a4_0x450a01(Text,{'color':_0x45431d?_0x3ee33d(0x13c):_0x3ee33d(0x165),'children':_0x1aeb70})]}),_0x4b5a03&&a4_0x450a01(Box,{'children':a4_0x450a01(Text,{'children':_0x346386(_0x3ee33d(0x145),{'env':_0x2576db})})}),_0x23118f&&_0x56371b&&a4_0x404762(Box,{'flexDirection':_0x3ee33d(0x158),'children':[a4_0x450a01(Box,{'children':a4_0x450a01(Text,{'color':'green','children':_0x346386(_0x3ee33d(0x138),{'datasetCount':_0x56371b['datasetCount'],'modelCount':_0x56371b[_0x3ee33d(0x137)]})})}),_0x56371b[_0x3ee33d(0x15b)]>0x0&&a4_0x450a01(Box,{'marginTop':0x1,'children':a4_0x450a01(Text,{'color':_0x3ee33d(0x149),'children':_0x346386(_0x3ee33d(0x135),{'originalCount':_0x56371b[_0x3ee33d(0x133)],'duplicateCount':_0x56371b[_0x3ee33d(0x15b)]})})}),a4_0x450a01(Box,{'marginTop':0x1,'children':a4_0x450a01(Text,{'color':_0x3ee33d(0x146),'children':_0x346386(_0x3ee33d(0x13d))})}),a4_0x404762(Box,{'marginLeft':0x2,'children':[a4_0x404762(Text,{'color':'cyan','children':['•\x20',_0x56371b[_0x3ee33d(0x141)]]}),a4_0x404762(Text,{'color':_0x3ee33d(0x165),'children':['\x20',_0x346386(_0x3ee33d(0x163),{'count':_0x56371b[_0x3ee33d(0x137)]})]})]}),a4_0x404762(Box,{'marginLeft':0x2,'children':[a4_0x404762(Text,{'color':_0x3ee33d(0x160),'children':['•\x20',_0x56371b[_0x3ee33d(0x140)]]}),a4_0x404762(Text,{'color':_0x3ee33d(0x165),'children':['\x20',_0x346386(_0x3ee33d(0x15a))]})]}),a4_0x450a01(Box,{'marginTop':0x1,'children':a4_0x450a01(Text,{'color':_0x3ee33d(0x146),'children':_0x346386(_0x3ee33d(0x156))})}),a4_0x450a01(Box,{'marginLeft':0x2,'children':a4_0x404762(Text,{'color':_0x3ee33d(0x149),'children':['import\x20',_0x3ee33d(0x148),'\x20from\x20\x27@/',_0x56371b['client'][_0x3ee33d(0x164)](/^\.\//,'')[_0x3ee33d(0x164)](_0x3ee33d(0x134),''),'\x27']})})]}),_0x58ef8f&&a4_0x404762(Box,{'flexDirection':_0x3ee33d(0x158),'children':[a4_0x450a01(Box,{'children':a4_0x404762(Text,{'color':_0x3ee33d(0x143),'children':['❌\x20',_0x58ef8f]})}),(_0x58ef8f[_0x3ee33d(0x144)]('登录')||_0x58ef8f[_0x3ee33d(0x144)](_0x3ee33d(0x155))||_0x58ef8f[_0x3ee33d(0x144)](_0x3ee33d(0x132)))&&a4_0x404762(Box,{'marginTop':0x1,'children':[a4_0x450a01(Text,{'color':_0x3ee33d(0x149),'children':_0x3ee33d(0x152)}),a4_0x450a01(Text,{'color':_0x3ee33d(0x160),'children':_0x3ee33d(0x15e)}),a4_0x404762(Text,{'color':_0x3ee33d(0x149),'children':['\x20',_0x346386('api.common.authRetry')]})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x59b695,_0x2801ee){const _0x4a7773=a8_0x4d13,_0x10f164=_0x59b695();while(!![]){try{const _0x300cd8=parseInt(_0x4a7773(0x7a))/0x1+parseInt(_0x4a7773(0x79))/0x2*(parseInt(_0x4a7773(0x7c))/0x3)+parseInt(_0x4a7773(0x84))/0x4+parseInt(_0x4a7773(0x83))/0x5+parseInt(_0x4a7773(0x7d))/0x6*(parseInt(_0x4a7773(0x6e))/0x7)+parseInt(_0x4a7773(0x8a))/0x8+-parseInt(_0x4a7773(0x78))/0x9*(parseInt(_0x4a7773(0x71))/0xa);if(_0x300cd8===_0x2801ee)break;else _0x10f164['push'](_0x10f164['shift']());}catch(_0x42c76f){_0x10f164['push'](_0x10f164['shift']());}}}(a8_0x3ec4,0xb031f));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a8_0x3ec4(){const _0x165884=['18Osidsf','info','replace','获取数据集失败:\x20','includes','errorCode','5597940jmhpmi','763612QwMuOt','errorMsg','fetch-model-list','401','正在从服务器拉取模型列表...\x20(环境:\x20','UNAUTHORIZED','10936096MHtEoI','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','trim','/api/node-toolbox/dataset/model-list?appcode=','code','1370313KDYiee','data','name','34827230oIsmwa','json','message','获取数据集失败,HTTP状态码:\x20','Unauthorized','error','success','9GhOhft','1712126FtMLoK','83575BPYdgf','length','3djExFJ'];a8_0x3ec4=function(){return _0x165884;};return a8_0x3ec4();}import{getEnv}from'../constant/env.js';function cleanNewlines(_0x32430a){const _0x327e67=a8_0x4d13;return _0x32430a[_0x327e67(0x7f)](/[\r\n]+/g,'\x20')[_0x327e67(0x8c)]();}function a8_0x4d13(_0x1a7cf0,_0x113c18){_0x1a7cf0=_0x1a7cf0-0x6d;const _0x3ec443=a8_0x3ec4();let _0x4d1368=_0x3ec443[_0x1a7cf0];return _0x4d1368;}function cleanDatasetName(_0x496043){const _0x19699d=a8_0x4d13;if(!_0x496043['name'])return _0x496043;return{..._0x496043,'name':cleanNewlines(_0x496043[_0x19699d(0x70)])};}function cleanDatasetNames(_0x563648){return _0x563648['map'](cleanDatasetName);}export async function fetchModelList(_0x4c3b2e){const _0x493176=a8_0x4d13,_0x3ea61f=getEnv(),_0xbafc4f=getApiDomain()+_0x493176(0x8d)+_0x4c3b2e+'&otype=array';logger[_0x493176(0x7e)](_0x493176(0x86),_0x493176(0x88)+_0x3ea61f+')',{'apiUrl':_0xbafc4f});const _0x339616=await fetch(_0xbafc4f,{'headers':{'Cookie':getCookie()}});if(!_0x339616['ok']){if(_0x339616['status']===0x191)throw new Error(_0x493176(0x8b));throw new Error(_0x493176(0x74)+_0x339616['status']);}const _0x5eb3c6=await _0x339616[_0x493176(0x72)]();if(!_0x5eb3c6[_0x493176(0x77)]){const _0x7f8031=_0x5eb3c6[_0x493176(0x85)]||_0x5eb3c6[_0x493176(0x73)]||_0x5eb3c6[_0x493176(0x6f)]?.[_0x493176(0x73)]||_0x5eb3c6['errorMessage']||_0x5eb3c6[_0x493176(0x76)]||'未知错误';if(_0x7f8031[_0x493176(0x81)](_0x493176(0x87))||_0x7f8031[_0x493176(0x81)](_0x493176(0x75))||_0x7f8031[_0x493176(0x81)]('登录')||_0x7f8031[_0x493176(0x81)]('认证')||_0x5eb3c6[_0x493176(0x82)]===_0x493176(0x89)||_0x5eb3c6[_0x493176(0x6d)]===0x191||_0x5eb3c6['code']===_0x493176(0x87))throw new Error(_0x493176(0x8b));throw new Error(_0x493176(0x80)+_0x7f8031);}const _0x5a5651=cleanDatasetNames(_0x5eb3c6[_0x493176(0x6f)]['configArray']);return{'configArray':_0x5a5651,'count':_0x5a5651[_0x493176(0x7b)]};}
1
+ const a5_0x25bc10=a5_0x1413;(function(_0x33780a,_0x3a3722){const _0x13a707=a5_0x1413,_0x3f17e7=_0x33780a();while(!![]){try{const _0x2cb273=-parseInt(_0x13a707(0x17c))/0x1*(-parseInt(_0x13a707(0x180))/0x2)+-parseInt(_0x13a707(0x177))/0x3+-parseInt(_0x13a707(0x17d))/0x4+-parseInt(_0x13a707(0x182))/0x5+-parseInt(_0x13a707(0x18f))/0x6*(parseInt(_0x13a707(0x17e))/0x7)+-parseInt(_0x13a707(0x183))/0x8*(parseInt(_0x13a707(0x173))/0x9)+parseInt(_0x13a707(0x189))/0xa;if(_0x2cb273===_0x3a3722)break;else _0x3f17e7['push'](_0x3f17e7['shift']());}catch(_0x41eec7){_0x3f17e7['push'](_0x3f17e7['shift']());}}}(a5_0x304f,0x200b6));import{getCookie}from'../auth/get-cookie.js';function a5_0x1413(_0x5a4249,_0xac64bc){_0x5a4249=_0x5a4249-0x171;const _0x304fcc=a5_0x304f();let _0x141389=_0x304fcc[_0x5a4249];return _0x141389;}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';import a5_0x26640a from'../i18n/index.js';const t=a5_0x26640a['t'][a5_0x25bc10(0x179)](a5_0x26640a);function a5_0x304f(){const _0x546030=['json','960qCCFdU','includes','name','api.common.authExpired','success','data','trim','/api/node-toolbox/dataset/model-list?appcode=','api.common.unknownError','1364481QCrpzc','replace','&otype=array','fetch-model-list','189150PkIwwO','code','bind','message','info','4849zEONzo','550868UPrHCk','7000cQmDwZ','status','20vDNfVX','length','642200eRTfpH','8lRkqUK','401','configArray','errorMsg','api.fetchModel.fetchError','api.fetchModel.httpError','7235800DIGmrn','errorCode','error','map','Unauthorized'];a5_0x304f=function(){return _0x546030;};return a5_0x304f();}function cleanNewlines(_0x5be4d7){const _0x1a5868=a5_0x25bc10;return _0x5be4d7[_0x1a5868(0x174)](/[\r\n]+/g,'\x20')[_0x1a5868(0x195)]();}function cleanDatasetName(_0x5d1907){const _0x37f2e0=a5_0x25bc10;if(!_0x5d1907['name'])return _0x5d1907;return{..._0x5d1907,'name':cleanNewlines(_0x5d1907[_0x37f2e0(0x191)])};}function cleanDatasetNames(_0x4feafd){const _0x53051e=a5_0x25bc10;return _0x4feafd[_0x53051e(0x18c)](cleanDatasetName);}export async function fetchModelList(_0x28d9bd){const _0x4d61fe=a5_0x25bc10,_0x288d32=getEnv(),_0x235c58=getApiDomain()+_0x4d61fe(0x171)+_0x28d9bd+_0x4d61fe(0x175);logger[_0x4d61fe(0x17b)](_0x4d61fe(0x176),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x288d32+')',{'apiUrl':_0x235c58});const _0x2f9ec2=await fetch(_0x235c58,{'headers':{'Cookie':getCookie()}});if(!_0x2f9ec2['ok']){if(_0x2f9ec2[_0x4d61fe(0x17f)]===0x191)throw new Error(t(_0x4d61fe(0x192)));throw new Error(t(_0x4d61fe(0x188),{'status':_0x2f9ec2['status']}));}const _0x2e2511=await _0x2f9ec2[_0x4d61fe(0x18e)]();if(!_0x2e2511[_0x4d61fe(0x193)]){const _0x5a2b75=_0x2e2511[_0x4d61fe(0x186)]||_0x2e2511[_0x4d61fe(0x17a)]||_0x2e2511[_0x4d61fe(0x194)]?.['message']||_0x2e2511['errorMessage']||_0x2e2511[_0x4d61fe(0x18b)]||t(_0x4d61fe(0x172));if(_0x5a2b75[_0x4d61fe(0x190)](_0x4d61fe(0x184))||_0x5a2b75[_0x4d61fe(0x190)](_0x4d61fe(0x18d))||_0x5a2b75['includes']('登录')||_0x5a2b75[_0x4d61fe(0x190)]('认证')||_0x2e2511[_0x4d61fe(0x18a)]==='UNAUTHORIZED'||_0x2e2511[_0x4d61fe(0x178)]===0x191||_0x2e2511[_0x4d61fe(0x178)]===_0x4d61fe(0x184))throw new Error(t(_0x4d61fe(0x192)));throw new Error(t(_0x4d61fe(0x187),{'error':_0x5a2b75}));}const _0xf410c3=cleanDatasetNames(_0x2e2511[_0x4d61fe(0x194)][_0x4d61fe(0x185)]);return{'configArray':_0xf410c3,'count':_0xf410c3[_0x4d61fe(0x181)]};}
@@ -1 +1 @@
1
- (function(_0x42725b,_0x5cb6ad){const _0x39ab8a=a9_0x3b11,_0x3a7c71=_0x42725b();while(!![]){try{const _0x3b936a=-parseInt(_0x39ab8a(0x175))/0x1+-parseInt(_0x39ab8a(0x165))/0x2*(parseInt(_0x39ab8a(0x16b))/0x3)+parseInt(_0x39ab8a(0x164))/0x4*(parseInt(_0x39ab8a(0x174))/0x5)+parseInt(_0x39ab8a(0x171))/0x6+parseInt(_0x39ab8a(0x16c))/0x7*(parseInt(_0x39ab8a(0x17e))/0x8)+parseInt(_0x39ab8a(0x177))/0x9+-parseInt(_0x39ab8a(0x176))/0xa*(parseInt(_0x39ab8a(0x16a))/0xb);if(_0x3b936a===_0x5cb6ad)break;else _0x3a7c71['push'](_0x3a7c71['shift']());}catch(_0x3c367b){_0x3a7c71['push'](_0x3a7c71['shift']());}}}(a9_0x3028,0xe9405));import a9_0x59bf78 from'prettier';function a9_0x3b11(_0x2bf5a0,_0x785b48){_0x2bf5a0=_0x2bf5a0-0x164;const _0x3028d6=a9_0x3028();let _0x3b1106=_0x3028d6[_0x2bf5a0];return _0x3b1106;}import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x1e6585 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';function a9_0x3028(){const _0x2dab1a=['{\x20apiConfigName:\x20','name','slice','.ts','../..','112912stpKrG','datasetCode','success','alias','api','templates/generate-api','typescript','forEach',',\x20env:\x20\x22','join','API\x20文件生成成功!','format','CONFIG_NAMES.DEFAULT','length','utf8','string','188wEyGhT','195770Qofmpq','push','client','{\x20apiConfigName:\x20\x22','init-api','14839nyyGNq','45qmDpaF','651AYFiTC','endsWith','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','replaceApiContent','-client','8066136HSgRgP','online','env','58635vrqQto','98286dbPJJu','14890ROmCHd','11902428dZKtHT','tableName'];a9_0x3028=function(){return _0x2dab1a;};return a9_0x3028();}export async function generateApiFile(_0x349320,_0x165c71='',_0xb7ebb3,_0x40757b=![],_0xaeb488,_0x6ebddf='./src/api/'){const _0xafb4e0=a9_0x3b11,_0x1a248f=readConfig(),_0x1c78c6=_0xb7ebb3||_0x1a248f?.['app'];if(typeof _0x1c78c6!==_0xafb4e0(0x18d)||!_0x1c78c6)throw new Error(_0xafb4e0(0x16e));const _0x4cffb2=_0x40757b?_0xafb4e0(0x18a):'\x22'+_0x1c78c6+'\x22',_0x341a92=typeof _0x1a248f[_0xafb4e0(0x173)]===_0xafb4e0(0x18d)?_0x1a248f['env']:undefined,_0x1c3115=_0xaeb488||_0x341a92||_0xafb4e0(0x172),_0xd4ed57=_0x1c3115!==_0xafb4e0(0x172);let _0x3eb8ba;if(_0x40757b)_0xd4ed57?_0x3eb8ba=_0xafb4e0(0x179)+_0x4cffb2+_0xafb4e0(0x186)+_0x1c3115+'\x22\x20}':_0x3eb8ba='';else{const _0x183ed3=_0xd4ed57?_0xafb4e0(0x186)+_0x1c3115+'\x22':'';_0x3eb8ba=_0xafb4e0(0x168)+_0x1c78c6+'\x22'+_0x183ed3+'\x20}';}const _0x336a97=_0x165c71?_0x165c71+'-api':_0xafb4e0(0x182),_0x60baf5=_0x165c71?_0x165c71+_0xafb4e0(0x170):_0xafb4e0(0x167),_0x2d07c4=[];_0x349320[_0xafb4e0(0x185)](_0x3f2be6=>{const _0xa434a4=_0xafb4e0;_0x2d07c4[_0xa434a4(0x166)]({'datasetCode':_0x3f2be6[_0xa434a4(0x17f)],'tableName':_0x3f2be6[_0xa434a4(0x178)],'name':_0x3f2be6[_0xa434a4(0x17a)]||'','alias':_0x3f2be6[_0xa434a4(0x181)]||_0x3f2be6['key']});});const _0x30f4dd=fileURLToPath(import.meta.url),_0x424f92=a9_0x1e6585['resolve'](a9_0x1e6585['dirname'](_0x30f4dd),_0xafb4e0(0x17d)),_0x417de8=a9_0x1e6585[_0xafb4e0(0x187)](_0x424f92,_0xafb4e0(0x183)),_0x5efbed=a9_0x1e6585[_0xafb4e0(0x187)](_0x417de8,'api.ts.tpl'),_0x3ac29c=a9_0x1e6585[_0xafb4e0(0x187)](_0x417de8,'client.ts.tpl'),_0x4cf013=_0x6ebddf[_0xafb4e0(0x16d)]('/')?_0x6ebddf[_0xafb4e0(0x17b)](0x0,-0x1):_0x6ebddf;mkdirSync(_0x4cf013,{'recursive':!![]});const _0x433de5=_0x2d07c4[0x0]?.['alias'],_0x9fb6d1=readFileSync(_0x5efbed,'utf8'),_0x81e651=TemplateReplacer[_0xafb4e0(0x16f)](_0x9fb6d1,_0x1c78c6,_0x2d07c4,_0x433de5,_0x336a97,_0x4cffb2),_0x2ed74e=await a9_0x59bf78[_0xafb4e0(0x189)](_0x81e651,{'parser':'typescript'}),_0x1db641=_0x4cf013+'/'+_0x336a97+_0xafb4e0(0x17c);writeFileSync(_0x1db641,_0x2ed74e,{'encoding':_0xafb4e0(0x18c)});const _0x2b6286=readFileSync(_0x3ac29c,_0xafb4e0(0x18c)),_0xa05211=TemplateReplacer[_0xafb4e0(0x16f)](_0x2b6286,_0x1c78c6,_0x2d07c4,_0x433de5,_0x336a97,_0x4cffb2,_0x3eb8ba),_0x1b3be1=await a9_0x59bf78[_0xafb4e0(0x189)](_0xa05211,{'parser':_0xafb4e0(0x184)}),_0x14d7e1=_0x4cf013+'/'+_0x60baf5+_0xafb4e0(0x17c);writeFileSync(_0x14d7e1,_0x1b3be1,{'encoding':_0xafb4e0(0x18c)});const _0x24675b=_0x2d07c4[_0xafb4e0(0x18b)];return logger[_0xafb4e0(0x180)](_0xafb4e0(0x169),_0xafb4e0(0x188),undefined,{'apiFile':_0x1db641,'clientFile':_0x14d7e1,'modelCount':_0x24675b,'configName':_0x4cffb2}),{'modelCount':_0x24675b,'apiFilePath':_0x1db641,'clientFilePath':_0x14d7e1,'configName':_0x4cffb2};}
1
+ const a6_0x388461=a6_0x1f25;function a6_0x23fb(){const _0x40ef85=['online','2303817abnIls','typescript','api.generateFile.noAppCode','tableName','length','client','string','./src/api/','join','alias','templates/generate-api','client.ts.tpl','.ts','2640687xwVwvg','5180090mPtEgj','push','{\x20apiConfigName:\x20','endsWith','datasetCode','init-api','-api','resolve','371857YjTEzL','utf8','CONFIG_NAMES.DEFAULT','../..','format','forEach','\x22\x20}','{\x20apiConfigName:\x20\x22','2497404dvjzwg','dirname',',\x20env:\x20\x22','bind','success','app','2476896jCvNyd','api','3207756wVFivP','104QSUELZ','key','replaceApiContent','API\x20文件生成成功!','env'];a6_0x23fb=function(){return _0x40ef85;};return a6_0x23fb();}(function(_0x48c5cb,_0x117abf){const _0xbc4f99=a6_0x1f25,_0x5d1932=_0x48c5cb();while(!![]){try{const _0x27d8df=parseInt(_0xbc4f99(0x10f))/0x1+-parseInt(_0xbc4f99(0x11f))/0x2+-parseInt(_0xbc4f99(0xf9))/0x3+-parseInt(_0xbc4f99(0x117))/0x4+-parseInt(_0xbc4f99(0x107))/0x5+-parseInt(_0xbc4f99(0x11d))/0x6+-parseInt(_0xbc4f99(0x106))/0x7*(-parseInt(_0xbc4f99(0x120))/0x8);if(_0x27d8df===_0x117abf)break;else _0x5d1932['push'](_0x5d1932['shift']());}catch(_0x5bc889){_0x5d1932['push'](_0x5d1932['shift']());}}}(a6_0x23fb,0xcae0c));import a6_0xf7994e from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a6_0x29a348 from'node:path';import{fileURLToPath}from'node:url';function a6_0x1f25(_0x57e29e,_0x1b5373){_0x57e29e=_0x57e29e-0xf6;const _0x23fb85=a6_0x23fb();let _0x1f2551=_0x23fb85[_0x57e29e];return _0x1f2551;}import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';import a6_0x25afa7 from'../i18n/index.js';const t=a6_0x25afa7['t'][a6_0x388461(0x11a)](a6_0x25afa7);export async function generateApiFile(_0x40bc76,_0x27586c='',_0x19a943,_0x1ec988=![],_0x12ace5,_0x42309d=a6_0x388461(0x100)){const _0x58241b=a6_0x388461,_0x1aafff=readConfig(),_0x154623=_0x19a943||_0x1aafff?.[_0x58241b(0x11c)];if(typeof _0x154623!==_0x58241b(0xff)||!_0x154623)throw new Error(t(_0x58241b(0xfb)));const _0x1f5eca=_0x1ec988?_0x58241b(0x111):'\x22'+_0x154623+'\x22',_0x38783e=typeof _0x1aafff[_0x58241b(0xf7)]===_0x58241b(0xff)?_0x1aafff['env']:undefined,_0xbc687f=_0x12ace5||_0x38783e||_0x58241b(0xf8),_0x45c41f=_0xbc687f!==_0x58241b(0xf8);let _0x3bf3c1;if(_0x1ec988)_0x45c41f?_0x3bf3c1=_0x58241b(0x109)+_0x1f5eca+_0x58241b(0x119)+_0xbc687f+_0x58241b(0x115):_0x3bf3c1='';else{const _0x4d8327=_0x45c41f?_0x58241b(0x119)+_0xbc687f+'\x22':'';_0x3bf3c1=_0x58241b(0x116)+_0x154623+'\x22'+_0x4d8327+'\x20}';}const _0x3b8fff=_0x27586c?_0x27586c+_0x58241b(0x10d):_0x58241b(0x11e),_0x789d8f=_0x27586c?_0x27586c+'-client':_0x58241b(0xfe),_0x4a4cce=[];_0x40bc76[_0x58241b(0x114)](_0x292845=>{const _0x165e2b=_0x58241b;_0x4a4cce[_0x165e2b(0x108)]({'datasetCode':_0x292845[_0x165e2b(0x10b)],'tableName':_0x292845[_0x165e2b(0xfc)],'name':_0x292845['name']||'','alias':_0x292845[_0x165e2b(0x102)]||_0x292845[_0x165e2b(0x121)]});});const _0x2e5c0d=fileURLToPath(import.meta.url),_0x22f200=a6_0x29a348[_0x58241b(0x10e)](a6_0x29a348[_0x58241b(0x118)](_0x2e5c0d),_0x58241b(0x112)),_0x54d139=a6_0x29a348[_0x58241b(0x101)](_0x22f200,_0x58241b(0x103)),_0x441158=a6_0x29a348[_0x58241b(0x101)](_0x54d139,'api.ts.tpl'),_0x2cfa83=a6_0x29a348['join'](_0x54d139,_0x58241b(0x104)),_0x37cc56=_0x42309d[_0x58241b(0x10a)]('/')?_0x42309d['slice'](0x0,-0x1):_0x42309d;mkdirSync(_0x37cc56,{'recursive':!![]});const _0xb6799b=_0x4a4cce[0x0]?.[_0x58241b(0x102)],_0x307d75=readFileSync(_0x441158,'utf8'),_0x1e6b93=TemplateReplacer[_0x58241b(0x122)](_0x307d75,_0x154623,_0x4a4cce,_0xb6799b,_0x3b8fff,_0x1f5eca),_0x104326=await a6_0xf7994e[_0x58241b(0x113)](_0x1e6b93,{'parser':_0x58241b(0xfa)}),_0x2255fc=_0x37cc56+'/'+_0x3b8fff+_0x58241b(0x105);writeFileSync(_0x2255fc,_0x104326,{'encoding':'utf8'});const _0x28db93=readFileSync(_0x2cfa83,_0x58241b(0x110)),_0x4ff3f4=TemplateReplacer['replaceApiContent'](_0x28db93,_0x154623,_0x4a4cce,_0xb6799b,_0x3b8fff,_0x1f5eca,_0x3bf3c1),_0x26e2e2=await a6_0xf7994e['format'](_0x4ff3f4,{'parser':'typescript'}),_0x5248f9=_0x37cc56+'/'+_0x789d8f+_0x58241b(0x105);writeFileSync(_0x5248f9,_0x26e2e2,{'encoding':'utf8'});const _0x1e1f09=_0x4a4cce[_0x58241b(0xfd)];return logger[_0x58241b(0x11b)](_0x58241b(0x10c),_0x58241b(0xf6),undefined,{'apiFile':_0x2255fc,'clientFile':_0x5248f9,'modelCount':_0x1e1f09,'configName':_0x1f5eca}),{'modelCount':_0x1e1f09,'apiFilePath':_0x2255fc,'clientFilePath':_0x5248f9,'configName':_0x1f5eca};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x1d85d0,_0x381781){const _0xfd7a46=a10_0x33f5,_0x5c9857=_0x1d85d0();while(!![]){try{const _0x413463=-parseInt(_0xfd7a46(0x130))/0x1+-parseInt(_0xfd7a46(0x15c))/0x2*(-parseInt(_0xfd7a46(0x13c))/0x3)+-parseInt(_0xfd7a46(0x13a))/0x4+parseInt(_0xfd7a46(0x151))/0x5+-parseInt(_0xfd7a46(0x14e))/0x6+parseInt(_0xfd7a46(0x156))/0x7*(parseInt(_0xfd7a46(0x132))/0x8)+parseInt(_0xfd7a46(0x133))/0x9;if(_0x413463===_0x381781)break;else _0x5c9857['push'](_0x5c9857['shift']());}catch(_0x2297fa){_0x5c9857['push'](_0x5c9857['shift']());}}}(a10_0x4774,0x420e1));function a10_0x4774(){const _0x38afcf=['\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','160965fzYlcx','\x20\x20错误:\x20','48248TIBxfM','5537916GXrxbS','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','Unknown\x20api\x20command:\x20','isArray','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','exit','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','2139688rlqRvl','❌\x20错误:不再支持位置参数方式','389265JhhVPp','pull','×\x20--datasetcode\x20参数不能为空','join','split','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','请使用\x20--appcode\x20参数,例如:','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档','length','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','log','\x1b[90m*\x20使用配置的应用AppCode:\x20','!\x20请使用以下方式之一:','×\x20--params\x20参数不是有效的\x20JSON\x20格式','flags','datasetcode','input','2361222RitFXo','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','Available\x20commands:','329540MTwZXy','string','trim','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','336ZwEJOx','env','object','appcode','\x1b[0m','help','6uPUzeh','×\x20未配置\x20AppCode','error','parse','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','filter'];a10_0x4774=function(){return _0x38afcf;};return a10_0x4774();}import{jsx as a10_0x4e46d5}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';function a10_0x33f5(_0x2f480e,_0x868fc){_0x2f480e=_0x2f480e-0x12d;const _0x47744c=a10_0x4774();let _0x33f56c=_0x47744c[_0x2f480e];return _0x33f56c;}export async function apiCli(_0x260d41){const _0x174a7f=a10_0x33f5,_0x140622=_0x260d41[_0x174a7f(0x14d)][0x1];if(_0x260d41[_0x174a7f(0x14b)][_0x174a7f(0x15b)]){console[_0x174a7f(0x147)]('\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a');return;}if(_0x140622===_0x174a7f(0x13d)){_0x260d41[_0x174a7f(0x14d)][0x2]&&(console[_0x174a7f(0x15e)](_0x174a7f(0x13b)),console['log'](_0x174a7f(0x143)),console[_0x174a7f(0x147)](_0x174a7f(0x155)+_0x260d41[_0x174a7f(0x14d)][0x2]),process[_0x174a7f(0x138)](0x1));const _0x2d1c1d=getConfigAppCode();let _0x9cdf90=_0x260d41[_0x174a7f(0x14b)][_0x174a7f(0x159)];const _0x4193d1=typeof _0x260d41['flags'][_0x174a7f(0x157)]===_0x174a7f(0x152)?_0x260d41['flags'][_0x174a7f(0x157)]:undefined,_0x14894e=_0x260d41[_0x174a7f(0x14b)]['output'];!_0x9cdf90&&!_0x2d1c1d&&(console[_0x174a7f(0x15e)](_0x174a7f(0x15d)),console[_0x174a7f(0x147)](_0x174a7f(0x149)),console['log'](_0x174a7f(0x154)),console[_0x174a7f(0x147)](_0x174a7f(0x142)),process[_0x174a7f(0x138)](0x1)),_0x9cdf90&&_0x2d1c1d&&_0x9cdf90===_0x2d1c1d&&(console['log'](_0x174a7f(0x148)+_0x9cdf90+_0x174a7f(0x15a)),console[_0x174a7f(0x147)](_0x174a7f(0x134)),_0x9cdf90=undefined),render(a10_0x4e46d5(ApiPullUI,{'appCode':_0x9cdf90,'env':_0x4193d1,'output':_0x14894e}));}else{if(_0x140622==='doc'){_0x260d41[_0x174a7f(0x14d)][0x2]&&(console['error']('❌\x20错误:不再支持位置参数方式'),console[_0x174a7f(0x147)]('请使用\x20--appcode\x20参数,例如:'),console[_0x174a7f(0x147)](_0x174a7f(0x12e)+_0x260d41[_0x174a7f(0x14d)][0x2]),process[_0x174a7f(0x138)](0x1));const _0x4c5143=getConfigAppCode();let _0x19d73e=_0x260d41['flags'][_0x174a7f(0x159)];const _0x18b711=typeof _0x260d41[_0x174a7f(0x14b)][_0x174a7f(0x157)]===_0x174a7f(0x152)?_0x260d41[_0x174a7f(0x14b)][_0x174a7f(0x157)]:undefined,_0x265c47=_0x260d41['flags']['output'],_0x56913d=_0x260d41[_0x174a7f(0x14b)]['params'],_0x489338=_0x260d41[_0x174a7f(0x14b)][_0x174a7f(0x14c)];!_0x19d73e&&!_0x4c5143&&(console['error'](_0x174a7f(0x15d)),console['log'](_0x174a7f(0x149)),console['log'](_0x174a7f(0x154)),console[_0x174a7f(0x147)](_0x174a7f(0x160)),process[_0x174a7f(0x138)](0x1));_0x19d73e&&_0x4c5143&&_0x19d73e===_0x4c5143&&(console[_0x174a7f(0x147)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x19d73e+'\x1b[0m'),_0x19d73e=undefined);let _0x5c8253;if(_0x56913d)try{_0x5c8253=JSON[_0x174a7f(0x15f)](_0x56913d),(typeof _0x5c8253!==_0x174a7f(0x158)||_0x5c8253===null||Array[_0x174a7f(0x136)](_0x5c8253))&&(console[_0x174a7f(0x15e)](_0x174a7f(0x141)),process['exit'](0x1));}catch(_0x185acf){console[_0x174a7f(0x15e)](_0x174a7f(0x14a)),console[_0x174a7f(0x15e)](_0x174a7f(0x131)+(_0x185acf instanceof Error?_0x185acf['message']:String(_0x185acf))),process[_0x174a7f(0x138)](0x1);}let _0x1b0939;_0x489338&&(_0x1b0939=_0x489338[_0x174a7f(0x140)](',')['map'](_0x3543a9=>_0x3543a9[_0x174a7f(0x153)]())[_0x174a7f(0x12d)](_0x369d15=>_0x369d15['length']>0x0),_0x1b0939[_0x174a7f(0x145)]===0x0&&(console['error'](_0x174a7f(0x13e)),process[_0x174a7f(0x138)](0x1)),console[_0x174a7f(0x147)]('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x1b0939[_0x174a7f(0x13f)](',\x20')+_0x174a7f(0x15a))),render(a10_0x4e46d5(ApiDocUI,{'appCode':_0x19d73e,'env':_0x18b711,'output':_0x265c47,'extraParams':_0x5c8253,'datasetCodes':_0x1b0939}));}else console['error'](_0x174a7f(0x135)+_0x140622),console['log'](_0x174a7f(0x150)),console[_0x174a7f(0x147)]('\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件'),console[_0x174a7f(0x147)](_0x174a7f(0x12f)),console[_0x174a7f(0x147)](_0x174a7f(0x139)),console['log'](_0x174a7f(0x14f)),console[_0x174a7f(0x147)](''),console[_0x174a7f(0x147)](_0x174a7f(0x144)),console[_0x174a7f(0x147)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console['log'](_0x174a7f(0x137)),console[_0x174a7f(0x147)](_0x174a7f(0x146)),process[_0x174a7f(0x138)](0x1);}}
1
+ const a7_0x1164ee=a7_0x5890;(function(_0x5f41d8,_0x3e9c54){const _0x528731=a7_0x5890,_0x110e6b=_0x5f41d8();while(!![]){try{const _0x4f3cc3=-parseInt(_0x528731(0x1df))/0x1*(parseInt(_0x528731(0x20b))/0x2)+parseInt(_0x528731(0x1c8))/0x3*(parseInt(_0x528731(0x1d3))/0x4)+parseInt(_0x528731(0x1e2))/0x5+parseInt(_0x528731(0x206))/0x6+parseInt(_0x528731(0x1d4))/0x7*(parseInt(_0x528731(0x1f7))/0x8)+parseInt(_0x528731(0x1d0))/0x9*(parseInt(_0x528731(0x210))/0xa)+-parseInt(_0x528731(0x1ce))/0xb;if(_0x4f3cc3===_0x3e9c54)break;else _0x110e6b['push'](_0x110e6b['shift']());}catch(_0xa24e24){_0x110e6b['push'](_0x110e6b['shift']());}}}(a7_0x37f5,0xb33ef));import{jsx as a7_0x58c931}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a7_0x5890(_0x5b1524,_0x40afd2){_0x5b1524=_0x5b1524-0x1bd;const _0x37f557=a7_0x37f5();let _0x58905f=_0x37f557[_0x5b1524];return _0x58905f;}function a7_0x37f5(){const _0xa9a778=['8zmwpKJ','\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20','api.help.usage','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20','datasetcode','api.common.noAppCodeOption1','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','api.help.optAppcode','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','doc','api.help.pullDesc','api.help.optDatasetcode','\x1b[0m','api.help.optHelp','1356720UqONJR','error','bind','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a','2294138ygeQAb','\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.help.pullEnv','6890OXCRHv','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20','length','api.help.docDatasets','parse','output','env','api.common.noAppCode','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','api.help.availableCommands','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','35016TtsFmB','object','api.common.usingConfigAppCode','input','\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','api.common.noAppCodeHint','16628788bXYhRS','api.help.pullOutput','11619yoMTAM','exit','log','264tWbBNk','9333548oljwVP','api.help.title','api.help.docOutput','trim','split','api.help.unknownCommand','isArray','api.help.docEnv','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','appcode','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20','1uybNnJ','api.help.docDataset','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','868165YkqasX','flags','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.paramsNotJson','\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.useAppcodeFlag','string','\x1b[90m','api.help.optEnv','help','api.help.examples','api.common.onlyGenerateDatasets','api.help.docDesc','api.common.paramsError','api.common.noAppCodeOption2Pull','api.common.noPositionalArgs','message','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.help.options','api.help.docAppcode'];a7_0x37f5=function(){return _0xa9a778;};return a7_0x37f5();}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';import a7_0x5a326c from'../i18n/index.js';const t=a7_0x5a326c['t'][a7_0x1164ee(0x208)](a7_0x5a326c);export async function apiCli(_0x244150){const _0x24d4ae=a7_0x1164ee,_0x4e8cba=_0x244150['input'][0x1];if(_0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1ec)]){console[_0x24d4ae(0x1d2)]('\x0a'+t(_0x24d4ae(0x1d5))+'\x0a\x0a'+t(_0x24d4ae(0x1f9))+_0x24d4ae(0x20a)+t(_0x24d4ae(0x1f5))+_0x24d4ae(0x1f8)+t(_0x24d4ae(0x1fe))+_0x24d4ae(0x20c)+t('api.help.optOutput')+_0x24d4ae(0x1cc)+t(_0x24d4ae(0x1eb))+'\x0a\x20\x20--datasetcode\x20<codes>\x20'+t(_0x24d4ae(0x203))+'\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+t(_0x24d4ae(0x205))+'\x0a\x0a'+t(_0x24d4ae(0x1ed))+_0x24d4ae(0x20e)+t(_0x24d4ae(0x202))+_0x24d4ae(0x1fa)+t('api.help.pullAppcode')+_0x24d4ae(0x1de)+t('api.help.pullOutput')+_0x24d4ae(0x1c6)+t('api.help.pullEnv')+_0x24d4ae(0x1e6)+t(_0x24d4ae(0x1ef))+_0x24d4ae(0x1dc)+t('api.help.docAppcode')+_0x24d4ae(0x1e1)+t(_0x24d4ae(0x1d6))+_0x24d4ae(0x1f4)+t(_0x24d4ae(0x1db))+_0x24d4ae(0x211)+t(_0x24d4ae(0x1e0))+'\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20'+t(_0x24d4ae(0x1bf))+'\x0a');return;}if(_0x4e8cba==='pull'){_0x244150[_0x24d4ae(0x1cb)][0x2]&&(console[_0x24d4ae(0x207)](t(_0x24d4ae(0x1f2))),console[_0x24d4ae(0x1d2)](t(_0x24d4ae(0x1e8))),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1c4)+_0x244150[_0x24d4ae(0x1cb)][0x2]),process[_0x24d4ae(0x1d1)](0x1));const _0x49dfc3=getConfigAppCode();let _0x4874fa=_0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1dd)];const _0x235d5c=typeof _0x244150['flags'][_0x24d4ae(0x1c2)]===_0x24d4ae(0x1e9)?_0x244150['flags'][_0x24d4ae(0x1c2)]:undefined,_0x3bf05b=_0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1c1)];!_0x4874fa&&!_0x49dfc3&&(console[_0x24d4ae(0x207)](t(_0x24d4ae(0x1c3))),console['log'](t(_0x24d4ae(0x1cd))),console[_0x24d4ae(0x1d2)](t(_0x24d4ae(0x1fc))),console[_0x24d4ae(0x1d2)](t(_0x24d4ae(0x1f1))),process[_0x24d4ae(0x1d1)](0x1)),_0x4874fa&&_0x49dfc3&&_0x4874fa===_0x49dfc3&&(console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1ea)+t(_0x24d4ae(0x1ca),{'appCode':_0x4874fa})+_0x24d4ae(0x204)),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1ea)+t('api.common.usingConfigAppCodeHint')+_0x24d4ae(0x204)),_0x4874fa=undefined),render(a7_0x58c931(ApiPullUI,{'appCode':_0x4874fa,'env':_0x235d5c,'output':_0x3bf05b}));}else{if(_0x4e8cba===_0x24d4ae(0x201)){_0x244150[_0x24d4ae(0x1cb)][0x2]&&(console[_0x24d4ae(0x207)](t(_0x24d4ae(0x1f2))),console[_0x24d4ae(0x1d2)](t('api.common.useAppcodeFlag')),console['log'](_0x24d4ae(0x1fd)+_0x244150['input'][0x2]),process[_0x24d4ae(0x1d1)](0x1));const _0x54e242=getConfigAppCode();let _0x7bb3ba=_0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1dd)];const _0x3e456c=typeof _0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1c2)]===_0x24d4ae(0x1e9)?_0x244150[_0x24d4ae(0x1e3)]['env']:undefined,_0x397c92=_0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1c1)],_0x25a74f=_0x244150['flags']['params'],_0xb94c06=_0x244150['flags'][_0x24d4ae(0x1fb)];!_0x7bb3ba&&!_0x54e242&&(console[_0x24d4ae(0x207)](t(_0x24d4ae(0x1c3))),console['log'](t(_0x24d4ae(0x1cd))),console[_0x24d4ae(0x1d2)](t(_0x24d4ae(0x1fc))),console['log'](t('api.common.noAppCodeOption2Doc')),process[_0x24d4ae(0x1d1)](0x1));_0x7bb3ba&&_0x54e242&&_0x7bb3ba===_0x54e242&&(console['log'](_0x24d4ae(0x1ea)+t('api.common.usingConfigAppCode',{'appCode':_0x7bb3ba})+_0x24d4ae(0x204)),_0x7bb3ba=undefined);let _0x59ab9e;if(_0x25a74f)try{_0x59ab9e=JSON[_0x24d4ae(0x1c0)](_0x25a74f),(typeof _0x59ab9e!==_0x24d4ae(0x1c9)||_0x59ab9e===null||Array[_0x24d4ae(0x1da)](_0x59ab9e))&&(console[_0x24d4ae(0x207)](t('api.common.paramsInvalidJson')),process[_0x24d4ae(0x1d1)](0x1));}catch(_0x5589e4){console[_0x24d4ae(0x207)](t(_0x24d4ae(0x1e5))),console['error'](t(_0x24d4ae(0x1f0),{'error':_0x5589e4 instanceof Error?_0x5589e4[_0x24d4ae(0x1f3)]:String(_0x5589e4)})),process['exit'](0x1);}let _0x2e6110;_0xb94c06&&(_0x2e6110=_0xb94c06[_0x24d4ae(0x1d8)](',')['map'](_0x2ac29f=>_0x2ac29f[_0x24d4ae(0x1d7)]())['filter'](_0x23335b=>_0x23335b[_0x24d4ae(0x1be)]>0x0),_0x2e6110[_0x24d4ae(0x1be)]===0x0&&(console[_0x24d4ae(0x207)](t('api.common.datasetcodeEmpty')),process[_0x24d4ae(0x1d1)](0x1)),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1ea)+t(_0x24d4ae(0x1ee),{'codes':_0x2e6110['join'](',\x20')})+'\x1b[0m')),render(a7_0x58c931(ApiDocUI,{'appCode':_0x7bb3ba,'env':_0x3e456c,'output':_0x397c92,'extraParams':_0x59ab9e,'datasetCodes':_0x2e6110}));}else console['error'](t(_0x24d4ae(0x1d9))+':\x20'+_0x4e8cba),console['log'](t(_0x24d4ae(0x1c5))),console['log'](_0x24d4ae(0x1e7)+t(_0x24d4ae(0x202))),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x209)+t('api.help.pullAppcode')),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x20d)+t(_0x24d4ae(0x1cf))),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1c7)+t(_0x24d4ae(0x20f))),console[_0x24d4ae(0x1d2)](''),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x200)+t('api.help.docDesc')),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1bd)+t(_0x24d4ae(0x1f6))),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1ff)+t('api.help.docOutput')),console['log'](_0x24d4ae(0x1e4)+t(_0x24d4ae(0x1db))),process[_0x24d4ae(0x1d1)](0x1);}}
@@ -1 +1 @@
1
- (function(_0x38d903,_0x345790){const _0x185477=a11_0xf9ff,_0x470b4a=_0x38d903();while(!![]){try{const _0x4f24a1=-parseInt(_0x185477(0x191))/0x1+-parseInt(_0x185477(0x19f))/0x2+-parseInt(_0x185477(0x192))/0x3+-parseInt(_0x185477(0x187))/0x4+-parseInt(_0x185477(0x1a5))/0x5*(-parseInt(_0x185477(0x19b))/0x6)+-parseInt(_0x185477(0x186))/0x7*(parseInt(_0x185477(0x198))/0x8)+parseInt(_0x185477(0x18e))/0x9*(parseInt(_0x185477(0x18a))/0xa);if(_0x4f24a1===_0x345790)break;else _0x470b4a['push'](_0x470b4a['shift']());}catch(_0x51e307){_0x470b4a['push'](_0x470b4a['shift']());}}}(a11_0x5eb8,0x755c6));function a11_0xf9ff(_0x2bea12,_0x187392){_0x2bea12=_0x2bea12-0x185;const _0x5eb847=a11_0x5eb8();let _0xf9ffa8=_0x5eb847[_0x2bea12];return _0xf9ffa8;}import{readConfig}from'../utils/config.js';function a11_0x5eb8(){const _0x463d0f=['*\x20开始生成\x20API\x20配置文件:','error','online','3132hvIcxs','trim','chdir','280150XFyqwv','663cJjOhi','message','API\x20配置拉取成功:\x20','\x20\x20\x20•\x20','client','-api','3391784ZnKOGm','api','length','131112MIRdKx','modelCount','*\x20正在处理\x20','string','615024sRhJBV','env','\x20个数据集,生成\x20','info','log','.ts\x20-\x20模型配置文件','20FoPeWU','.ts\x20-\x20客户端实例文件','API\x20配置拉取异常:\x20','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','×\x20API\x20配置拉取异常:','create-api-pull','14xstKeZ','105620LOFyeH','√\x20成功拉取\x20','\x20个模型','53320FWAhoX'];a11_0x5eb8=function(){return _0x463d0f;};return a11_0x5eb8();}import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x544e09,_0x12e19e,_0x16bb6b,_0x1f78f3){const _0x125959=a11_0xf9ff;let _0x8eedc7;try{const _0x4dbf52=_0x12e19e?.[_0x125959(0x18f)]()||'';if(_0x4dbf52){const _0x49c371=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x49c371['test'](_0x4dbf52))return console['error']('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),![];}_0x16bb6b&&(_0x8eedc7=process['cwd'](),process[_0x125959(0x190)](_0x16bb6b));const _0x5800f4=readConfig(),_0x606e38=typeof _0x5800f4[_0x125959(0x1a0)]===_0x125959(0x19e)?_0x5800f4[_0x125959(0x1a0)]:undefined,_0x3a11bc=_0x1f78f3||_0x606e38||_0x125959(0x18d);initEnv(_0x3a11bc),console[_0x125959(0x1a3)](_0x125959(0x1a8)+_0x3a11bc+')');const {configArray:_0x26c276}=await fetchModelList(_0x544e09),_0x47e91f=_0x4dbf52?_0x4dbf52+_0x125959(0x197):_0x125959(0x199),_0x232b33=_0x4dbf52?_0x4dbf52+'-client':_0x125959(0x196);console[_0x125959(0x1a3)](_0x125959(0x18b)),console[_0x125959(0x1a3)](_0x125959(0x195)+_0x47e91f+_0x125959(0x1a4)),console[_0x125959(0x1a3)](_0x125959(0x195)+_0x232b33+_0x125959(0x1a6)),console[_0x125959(0x1a3)](_0x125959(0x19d)+_0x26c276[_0x125959(0x19a)]+'\x20个数据集...');const _0x26f176=await generateApiFile(_0x26c276,_0x4dbf52,_0x544e09,!![],_0x3a11bc);return console['log'](_0x125959(0x188)+_0x26c276[_0x125959(0x19a)]+_0x125959(0x1a1)+_0x26f176[_0x125959(0x19c)]+_0x125959(0x189)),_0x16bb6b&&logger[_0x125959(0x1a2)](_0x125959(0x185),_0x125959(0x194)+_0x544e09,{'projectPath':_0x16bb6b,'appCode':_0x544e09,'datasetCount':_0x26c276[_0x125959(0x19a)],'filePrefix':_0x4dbf52}),!![];}catch(_0x1f6f70){const _0x2a8990=_0x1f6f70 instanceof Error?_0x1f6f70[_0x125959(0x193)]:String(_0x1f6f70);return console['error'](_0x125959(0x1a9),_0x2a8990),_0x16bb6b&&logger[_0x125959(0x18c)](_0x125959(0x185),_0x125959(0x1a7)+_0x2a8990,{'appCode':_0x544e09,'projectPath':_0x16bb6b}),![];}finally{_0x8eedc7&&process['chdir'](_0x8eedc7);}}
1
+ function a8_0x2934(){const _0xf6eaf6=['api.silent.clientFileName','api.silent.modelFileName','api','12SofaVP','API\x20配置拉取成功:\x20','5CvYtCd','50MJBrYp','2000763rcaaxq','env','test','2354077lqshYj','error','2ALRcVc','modelCount','3458956upEbLV','300643qAJCeq','1577064YHdfse','cwd','api.silent.invalidPrefix','-client','chdir','message','bind','7682286jvdgrZ','length','104TspwiV','client','api.silent.error','log','string','api.silent.processing','info','api.silent.success','api.silent.generating','trim','885662gGVTEp'];a8_0x2934=function(){return _0xf6eaf6;};return a8_0x2934();}const a8_0x2f5a7b=a8_0x15b3;(function(_0x5c0760,_0x39095b){const _0x39b26b=a8_0x15b3,_0x39292b=_0x5c0760();while(!![]){try{const _0x255a55=parseInt(_0x39b26b(0x115))/0x1*(parseInt(_0x39b26b(0xfe))/0x2)+-parseInt(_0x39b26b(0x102))/0x3+parseInt(_0x39b26b(0x100))/0x4+-parseInt(_0x39b26b(0x11b))/0x5*(parseInt(_0x39b26b(0x109))/0x6)+parseInt(_0x39b26b(0x101))/0x7*(-parseInt(_0x39b26b(0x10b))/0x8)+parseInt(_0x39b26b(0x11d))/0x9*(parseInt(_0x39b26b(0x11c))/0xa)+-parseInt(_0x39b26b(0xfc))/0xb*(-parseInt(_0x39b26b(0x119))/0xc);if(_0x255a55===_0x39095b)break;else _0x39292b['push'](_0x39292b['shift']());}catch(_0x4e2114){_0x39292b['push'](_0x39292b['shift']());}}}(a8_0x2934,0xadb71));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a8_0x15b3(_0x33dd5d,_0x3472d3){_0x33dd5d=_0x33dd5d-0xfc;const _0x293486=a8_0x2934();let _0x15b36c=_0x293486[_0x33dd5d];return _0x15b36c;}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';import a8_0x1e8d9b from'../i18n/index.js';const t=a8_0x1e8d9b['t'][a8_0x2f5a7b(0x108)](a8_0x1e8d9b);export async function pullApiSilent(_0xa9b4d6,_0x3d102b,_0x3ba252,_0x212ea1){const _0x41f986=a8_0x2f5a7b;let _0x1b41c5;try{const _0x1ddd7b=_0x3d102b?.[_0x41f986(0x114)]()||'';if(_0x1ddd7b){const _0x5ca493=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5ca493[_0x41f986(0x11f)](_0x1ddd7b))return console[_0x41f986(0xfd)](t(_0x41f986(0x104))),![];}_0x3ba252&&(_0x1b41c5=process[_0x41f986(0x103)](),process[_0x41f986(0x106)](_0x3ba252));const _0x5c4002=readConfig(),_0x4386ae=typeof _0x5c4002[_0x41f986(0x11e)]===_0x41f986(0x10f)?_0x5c4002['env']:undefined,_0x1db4e0=_0x212ea1||_0x4386ae||'online';initEnv(_0x1db4e0),console['log'](t('api.silent.fetching',{'env':_0x1db4e0}));const {configArray:_0x1c224c}=await fetchModelList(_0xa9b4d6),_0x11eb33=_0x1ddd7b?_0x1ddd7b+'-api':_0x41f986(0x118),_0x25a2c4=_0x1ddd7b?_0x1ddd7b+_0x41f986(0x105):_0x41f986(0x10c);console[_0x41f986(0x10e)](t(_0x41f986(0x113))),console[_0x41f986(0x10e)](t(_0x41f986(0x117),{'name':_0x11eb33})),console['log'](t(_0x41f986(0x116),{'name':_0x25a2c4})),console[_0x41f986(0x10e)](t(_0x41f986(0x110),{'count':_0x1c224c['length']}));const _0x414f73=await generateApiFile(_0x1c224c,_0x1ddd7b,_0xa9b4d6,!![],_0x1db4e0);return console[_0x41f986(0x10e)](t(_0x41f986(0x112),{'datasetCount':_0x1c224c[_0x41f986(0x10a)],'modelCount':_0x414f73[_0x41f986(0xff)]})),_0x3ba252&&logger[_0x41f986(0x111)]('create-api-pull',_0x41f986(0x11a)+_0xa9b4d6,{'projectPath':_0x3ba252,'appCode':_0xa9b4d6,'datasetCount':_0x1c224c[_0x41f986(0x10a)],'filePrefix':_0x1ddd7b}),!![];}catch(_0x22b5fc){const _0x5add88=_0x22b5fc instanceof Error?_0x22b5fc[_0x41f986(0x107)]:String(_0x22b5fc);return console[_0x41f986(0xfd)](t(_0x41f986(0x10d),{'error':_0x5add88})),_0x3ba252&&logger[_0x41f986(0xfd)]('create-api-pull','API\x20配置拉取异常:\x20'+_0x5add88,{'appCode':_0xa9b4d6,'projectPath':_0x3ba252}),![];}finally{_0x1b41c5&&process[_0x41f986(0x106)](_0x1b41c5);}}