@lovrabet/cli 1.3.4-beta.1 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) 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 -1
  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 -1
  52. package/lib/i18n/hooks.js +1 -1
  53. package/lib/i18n/index.js +1 -1
  54. package/lib/i18n/locales/en-US.js +1 -1
  55. package/lib/i18n/locales/zh-CN.js +1 -1
  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 +1 -1
  83. package/templates/projects/sub-app-react-demo/src/pages/index.tsx +29 -6
  84. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +3 -3
@@ -1 +1 @@
1
- const a0_0x187e5a=a0_0x7680;function a0_0x1bb4(){const _0x50400e=['error','confirming','aiSetup.ui.confirm.yes','codex','return','projectRoot','aiSetup.ui.confirm.default','aiSetup.ui.select.title','skill-','delete','add','windsurf','aiSetup.ui.selectAtLeastOne','470402SfvWvv','1279671VOcYPS','red','message','527301yKTOwO','opencode','downArrow','434336CtPGIz','gray','5WICXGC','map','length','cursor','status','aiSetup.ui.confirm.title','column','843728HtpBEq','done','white','has','size','[\x20]','trae','yellow','cyan','filter','aiSetup.ui.installing','agent','selecting','name','aiSetup.ui.select.controls','442904KtWMzm','appcode','mcp-','aiSetup.ui.confirm.mcpDescription','push','35UEwgPJ','blue','ide','326082DWMpOv','dimColor','Claude\x20Code','codebuddy','antigravity'];a0_0x1bb4=function(){return _0x50400e;};return a0_0x1bb4();}(function(_0xbacea5,_0x4594d2){const _0x25f933=a0_0x7680,_0x524ac8=_0xbacea5();while(!![]){try{const _0x3ca803=parseInt(_0x25f933(0x128))/0x1+-parseInt(_0x25f933(0x138))/0x2+parseInt(_0x25f933(0x129))/0x3+-parseInt(_0x25f933(0x12f))/0x4*(-parseInt(_0x25f933(0x131))/0x5)+-parseInt(_0x25f933(0x14f))/0x6*(parseInt(_0x25f933(0x14c))/0x7)+parseInt(_0x25f933(0x147))/0x8+-parseInt(_0x25f933(0x12c))/0x9;if(_0x3ca803===_0x4594d2)break;else _0x524ac8['push'](_0x524ac8['shift']());}catch(_0x9ba430){_0x524ac8['push'](_0x524ac8['shift']());}}}(a0_0x1bb4,0x4b5ee));import{jsx as a0_0x1f5ac5,jsxs as a0_0x6b415f}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_0x187e5a(0x134),'claude'],SKILL_IDE_LIST=[a0_0x187e5a(0x153),'claude',a0_0x187e5a(0x152),a0_0x187e5a(0x157),'cursor',a0_0x187e5a(0x12d),'qoder',a0_0x187e5a(0x13e),a0_0x187e5a(0x126),a0_0x187e5a(0x143)];export function AISetupUI({config:_0x29c0c4,onComplete:_0x3f85f8}){const _0x378b47=a0_0x187e5a,{t:_0x94d07}=useI18n(),{exit:_0x5422ef}=useApp(),[_0x15cf90,_0x55608c]=useState(_0x378b47(0x155)),[_0x19f0c3,_0x3dd02e]=useState(0x0),[_0x4127b4,_0x1f32b1]=useState(new Set([0x0,0x1])),[_0x25b53c,_0x16821c]=useState(new Set(SKILL_IDE_LIST[_0x378b47(0x132)]((_0x49ec9a,_0x62ef2a)=>_0x62ef2a))),[_0x402193,_0x55a129]=useState('');useEffect(()=>{const _0x2c4bbf=_0x378b47;!_0x29c0c4[_0x2c4bbf(0x148)]&&_0x3f85f8({'mcpResults':[],'skillResults':[]});},[_0x29c0c4[_0x378b47(0x148)],_0x3f85f8]),useInput((_0x3a47fe,_0x19f941)=>{const _0x4cd1f9=_0x378b47;if(_0x15cf90==='confirming'){if(_0x3a47fe==='y'||_0x3a47fe==='Y'||_0x19f941[_0x4cd1f9(0x158)]){_0x434cf0();return;}if(_0x3a47fe==='n'||_0x3a47fe==='N'){_0x3f85f8({'mcpResults':[],'skillResults':[]});return;}if(_0x19f941['return']){_0x434cf0();return;}}if(_0x15cf90==='selecting'){if(_0x19f941['upArrow']){_0x3dd02e(_0x49ce91=>_0x49ce91>0x0?_0x49ce91-0x1:SKILL_IDE_LIST[_0x4cd1f9(0x133)]-0x1);return;}if(_0x19f941[_0x4cd1f9(0x12e)]){_0x3dd02e(_0x5c3a92=>_0x5c3a92<SKILL_IDE_LIST[_0x4cd1f9(0x133)]-0x1?_0x5c3a92+0x1:0x0);return;}if(_0x3a47fe==='\x20'){const _0x36f755=_0x19f0c3<MCP_IDE_LIST[_0x4cd1f9(0x133)];if(_0x36f755){const _0x525937=new Set(_0x4127b4);_0x525937[_0x4cd1f9(0x13b)](_0x19f0c3)?_0x525937['delete'](_0x19f0c3):_0x525937[_0x4cd1f9(0x125)](_0x19f0c3),_0x1f32b1(_0x525937);}else{const _0x3b609a=_0x19f0c3-MCP_IDE_LIST[_0x4cd1f9(0x133)],_0x991ca3=new Set(_0x25b53c);_0x991ca3[_0x4cd1f9(0x13b)](_0x3b609a)?_0x991ca3[_0x4cd1f9(0x124)](_0x3b609a):_0x991ca3[_0x4cd1f9(0x125)](_0x3b609a),_0x16821c(_0x991ca3);}return;}if(_0x3a47fe==='a'||_0x3a47fe==='A'){_0x1f32b1(new Set(MCP_IDE_LIST[_0x4cd1f9(0x132)]((_0x2c2308,_0x5ce8be)=>_0x5ce8be))),_0x16821c(new Set(SKILL_IDE_LIST[_0x4cd1f9(0x132)]((_0x52f279,_0x5ad80b)=>_0x5ad80b)));return;}if(_0x3a47fe==='q'||_0x3a47fe==='Q'){_0x5422ef();return;}if(_0x19f941[_0x4cd1f9(0x158)]){if(_0x4127b4[_0x4cd1f9(0x13c)]===0x0&&_0x25b53c['size']===0x0){_0x55a129(_0x94d07(_0x4cd1f9(0x127)));return;}_0x434cf0();return;}}if(_0x15cf90===_0x4cd1f9(0x139)){_0x5422ef();return;}});async function _0x434cf0(){const _0x15c1a7=_0x378b47;_0x55608c('installing');const _0x226786=[],_0x49e8ea=[];for(const _0x4473f4 of _0x4127b4){const _0x310b0c=MCP_IDE_LIST[_0x4473f4];if(!_0x310b0c)continue;try{const _0x208c73=await configureMcp(_0x310b0c,_0x29c0c4['projectRoot']);_0x226786['push'](_0x208c73);}catch(_0x2be7e5){_0x226786[_0x15c1a7(0x14b)]({'ide':MCP_IDE_CONFIGS[_0x310b0c]?.[_0x15c1a7(0x145)]||_0x310b0c,'status':'error','message':_0x2be7e5 instanceof Error?_0x2be7e5[_0x15c1a7(0x12b)]:String(_0x2be7e5)});}}await copySharedSkills(_0x29c0c4[_0x15c1a7(0x159)]);for(const _0x204070 of _0x25b53c){const _0x27a4b4=SKILL_IDE_LIST[_0x204070];if(!_0x27a4b4)continue;try{const _0x34100c=await installSkill(_0x27a4b4,_0x29c0c4['projectRoot']);_0x49e8ea[_0x15c1a7(0x14b)](_0x34100c);}catch(_0x1b82ff){_0x49e8ea[_0x15c1a7(0x14b)]({'ide':SKILL_IDE_CONFIGS[_0x27a4b4]?.['name']||_0x27a4b4,'status':_0x15c1a7(0x154),'message':_0x1b82ff instanceof Error?_0x1b82ff[_0x15c1a7(0x12b)]:String(_0x1b82ff)});}}if(_0x49e8ea['length']>0x0){const _0x29e86a=_0x49e8ea[_0x15c1a7(0x141)](_0x4b1b1f=>_0x4b1b1f[_0x15c1a7(0x135)]==='success')[_0x15c1a7(0x132)](_0xe1989b=>_0xe1989b[_0x15c1a7(0x14e)]);_0x29e86a[_0x15c1a7(0x133)]>0x0&&createSkillManifest(_0x29c0c4[_0x15c1a7(0x159)],_0x29e86a);}_0x55608c('done'),setTimeout(()=>{_0x3f85f8({'mcpResults':_0x226786,'skillResults':_0x49e8ea});},0xbb8);}if(_0x15cf90===_0x378b47(0x155))return a0_0x6b415f(Box,{'flexDirection':_0x378b47(0x137),'marginTop':0x1,'children':[a0_0x1f5ac5(Box,{'marginTop':0x1,'children':a0_0x1f5ac5(Text,{'color':_0x378b47(0x13a),'children':_0x94d07(_0x378b47(0x136))})}),a0_0x1f5ac5(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a0_0x1f5ac5(Text,{'color':_0x378b47(0x130),'children':_0x94d07(_0x378b47(0x14a))})}),a0_0x1f5ac5(Box,{'marginLeft':0x2,'children':a0_0x1f5ac5(Text,{'color':_0x378b47(0x130),'children':_0x94d07('aiSetup.ui.confirm.skillDescription')})}),a0_0x6b415f(Box,{'marginTop':0x1,'flexDirection':_0x378b47(0x137),'children':[a0_0x1f5ac5(Box,{'children':a0_0x1f5ac5(Text,{'color':'green','children':_0x94d07(_0x378b47(0x156))})}),a0_0x1f5ac5(Box,{'children':a0_0x1f5ac5(Text,{'color':_0x378b47(0x130),'children':_0x94d07('aiSetup.ui.confirm.no')})}),a0_0x1f5ac5(Box,{'children':a0_0x1f5ac5(Text,{'color':_0x378b47(0x150),'children':_0x94d07(_0x378b47(0x15a))})})]}),_0x402193&&a0_0x1f5ac5(Box,{'marginTop':0x1,'children':a0_0x6b415f(Text,{'color':_0x378b47(0x12a),'children':['✗\x20',_0x402193]})})]});if(_0x15cf90===_0x378b47(0x144))return a0_0x6b415f(Box,{'flexDirection':_0x378b47(0x137),'marginTop':0x1,'children':[a0_0x1f5ac5(Box,{'children':a0_0x1f5ac5(Text,{'color':_0x378b47(0x140),'bold':!![],'children':_0x94d07(_0x378b47(0x15b))})}),_0x402193&&a0_0x1f5ac5(Box,{'marginTop':0x1,'children':a0_0x6b415f(Text,{'color':_0x378b47(0x12a),'children':['✗\x20',_0x402193]})}),a0_0x6b415f(Box,{'marginTop':0x1,'flexDirection':_0x378b47(0x137),'children':[a0_0x1f5ac5(Text,{'bold':!![],'color':_0x378b47(0x13f),'children':_0x94d07('aiSetup.ui.select.mcpSection')}),MCP_IDE_LIST[_0x378b47(0x132)]((_0x347ad8,_0xcd73d0)=>{const _0x53f2b9=_0x378b47,_0x26c9a4=_0x19f0c3===_0xcd73d0,_0x39db28=_0x4127b4['has'](_0xcd73d0);return a0_0x1f5ac5(Box,{'children':a0_0x6b415f(Text,{'backgroundColor':_0x26c9a4?_0x53f2b9(0x14d):undefined,'color':_0x26c9a4?_0x53f2b9(0x13a):undefined,'children':[_0x39db28?'[✓]':_0x53f2b9(0x13d),'\x20',_0x347ad8===_0x53f2b9(0x134)?'Cursor':_0x53f2b9(0x151)]})},_0x53f2b9(0x149)+_0x347ad8);}),a0_0x1f5ac5(Box,{'marginTop':0x1,'children':a0_0x1f5ac5(Text,{'bold':!![],'color':_0x378b47(0x13f),'children':_0x94d07('aiSetup.ui.select.skillSection')})}),SKILL_IDE_LIST['map']((_0x369f15,_0x681cff)=>{const _0x13ae92=_0x378b47,_0xc6a44f=_0x681cff+MCP_IDE_LIST[_0x13ae92(0x133)],_0x2582ce=_0x19f0c3===_0xc6a44f,_0xde01f8=_0x25b53c[_0x13ae92(0x13b)](_0xc6a44f);return a0_0x1f5ac5(Box,{'children':a0_0x6b415f(Text,{'backgroundColor':_0x2582ce?_0x13ae92(0x14d):undefined,'color':_0x2582ce?_0x13ae92(0x13a):undefined,'children':[_0xde01f8?'[]':_0x13ae92(0x13d),'\x20',SKILL_IDE_CONFIGS[_0x369f15][_0x13ae92(0x145)]]})},_0x13ae92(0x15c)+_0x369f15);}),a0_0x1f5ac5(Box,{'marginTop':0x1,'children':a0_0x1f5ac5(Text,{'color':_0x378b47(0x130),'children':_0x94d07(_0x378b47(0x146))})})]})]});if(_0x15cf90==='installing')return a0_0x1f5ac5(Box,{'flexDirection':_0x378b47(0x137),'marginTop':0x1,'children':a0_0x1f5ac5(Box,{'children':a0_0x1f5ac5(Text,{'children':_0x94d07(_0x378b47(0x142))})})});if(_0x15cf90===_0x378b47(0x139))return null;return null;}function a0_0x7680(_0x209daa,_0x411a5a){_0x209daa=_0x209daa-0x124;const _0x1bb4f6=a0_0x1bb4();let _0x76802c=_0x1bb4f6[_0x209daa];return _0x76802c;}const MCP_IDE_CONFIGS={'cursor':{'name':'Cursor'},'claude':{'name':'Claude\x20Code'}};
1
+ const a0_0x6a51a4=a0_0x23f0;(function(_0x4dd7ff,_0x5cb963){const _0x428fc9=a0_0x23f0,_0x2d731f=_0x4dd7ff();while(!![]){try{const _0x4e13c4=-parseInt(_0x428fc9(0x195))/0x1*(-parseInt(_0x428fc9(0x1a2))/0x2)+parseInt(_0x428fc9(0x18e))/0x3*(-parseInt(_0x428fc9(0x1a0))/0x4)+-parseInt(_0x428fc9(0x180))/0x5+-parseInt(_0x428fc9(0x1bc))/0x6*(-parseInt(_0x428fc9(0x1a5))/0x7)+parseInt(_0x428fc9(0x192))/0x8*(parseInt(_0x428fc9(0x1b8))/0x9)+-parseInt(_0x428fc9(0x1b4))/0xa+parseInt(_0x428fc9(0x1aa))/0xb;if(_0x4e13c4===_0x5cb963)break;else _0x2d731f['push'](_0x2d731f['shift']());}catch(_0x381a1c){_0x2d731f['push'](_0x2d731f['shift']());}}}(a0_0x306e,0xc2934));import{jsx as a0_0x2a614b,jsxs as a0_0x1ccb59}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';function a0_0x23f0(_0x5bd0bc,_0x45118e){_0x5bd0bc=_0x5bd0bc-0x17d;const _0x306e9d=a0_0x306e();let _0x23f07a=_0x306e9d[_0x5bd0bc];return _0x23f07a;}import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';import{useI18n}from'../i18n/hooks.js';const MCP_IDE_LIST=[a0_0x6a51a4(0x1b6),a0_0x6a51a4(0x1a7)],SKILL_IDE_LIST=[a0_0x6a51a4(0x1a1),a0_0x6a51a4(0x1a7),a0_0x6a51a4(0x19a),'codex','cursor',a0_0x6a51a4(0x17f),a0_0x6a51a4(0x1af),a0_0x6a51a4(0x18c),'windsurf',a0_0x6a51a4(0x1b1)];function a0_0x306e(){const _0x100328=['128311FJRYCQ','aiSetup.ui.selectAtLeastOne','gray','size','green','codebuddy','error','push','aiSetup.ui.confirm.skillDescription','return','aiSetup.ui.confirm.default','6176312QMCsls','antigravity','2EkHSXS','name','aiSetup.ui.confirm.mcpDescription','8022Druwua','white','claude','appcode','installing','16101976QzLyda','red','success','Claude\x20Code','aiSetup.ui.confirm.no','qoder','ide','agent','yellow','aiSetup.ui.select.title','14693910SJFfBb','length','cursor','[✓]','45fdGnaL','cyan','add','Cursor','6696scpokW','aiSetup.ui.select.controls','status','opencode','3132295gjQVZH','blue','column','projectRoot','has','aiSetup.ui.select.mcpSection','aiSetup.ui.confirm.yes','aiSetup.ui.confirm.title','confirming','[\x20]','map','mcp-','trae','filter','3qSeydo','delete','selecting','aiSetup.ui.installing','2505352eUHPrG','done','message'];a0_0x306e=function(){return _0x100328;};return a0_0x306e();}export function AISetupUI({config:_0x2a5cdd,onComplete:_0x3fe6e8}){const _0x30ee7a=a0_0x6a51a4,{t:_0x588060}=useI18n(),{exit:_0x476118}=useApp(),[_0x4c63a1,_0x495104]=useState(_0x30ee7a(0x188)),[_0x5e9ff6,_0x436d4b]=useState(0x0),[_0x2f3239,_0x5985c2]=useState(new Set([0x0,0x1])),[_0xa0826a,_0x3b34f4]=useState(new Set(SKILL_IDE_LIST[_0x30ee7a(0x18a)]((_0x58adc8,_0x34bc10)=>_0x34bc10))),[_0x5e2df9,_0x356556]=useState('');useEffect(()=>{const _0x56f10f=_0x30ee7a;!_0x2a5cdd[_0x56f10f(0x1a8)]&&_0x3fe6e8({'mcpResults':[],'skillResults':[]});},[_0x2a5cdd['appcode'],_0x3fe6e8]),useInput((_0x2dbcf9,_0x46a02c)=>{const _0x18f2d2=_0x30ee7a;if(_0x4c63a1===_0x18f2d2(0x188)){if(_0x2dbcf9==='y'||_0x2dbcf9==='Y'||_0x46a02c[_0x18f2d2(0x19e)]){_0x48c0df();return;}if(_0x2dbcf9==='n'||_0x2dbcf9==='N'){_0x3fe6e8({'mcpResults':[],'skillResults':[]});return;}if(_0x46a02c[_0x18f2d2(0x19e)]){_0x48c0df();return;}}if(_0x4c63a1===_0x18f2d2(0x190)){if(_0x46a02c['upArrow']){_0x436d4b(_0x39413f=>_0x39413f>0x0?_0x39413f-0x1:SKILL_IDE_LIST[_0x18f2d2(0x1b5)]-0x1);return;}if(_0x46a02c['downArrow']){_0x436d4b(_0x56621d=>_0x56621d<SKILL_IDE_LIST[_0x18f2d2(0x1b5)]-0x1?_0x56621d+0x1:0x0);return;}if(_0x2dbcf9==='\x20'){const _0x5e3b2a=_0x5e9ff6<MCP_IDE_LIST[_0x18f2d2(0x1b5)];if(_0x5e3b2a){const _0x16448a=new Set(_0x2f3239);_0x16448a[_0x18f2d2(0x184)](_0x5e9ff6)?_0x16448a[_0x18f2d2(0x18f)](_0x5e9ff6):_0x16448a['add'](_0x5e9ff6),_0x5985c2(_0x16448a);}else{const _0x111d77=_0x5e9ff6-MCP_IDE_LIST[_0x18f2d2(0x1b5)],_0x3f38b6=new Set(_0xa0826a);_0x3f38b6[_0x18f2d2(0x184)](_0x111d77)?_0x3f38b6[_0x18f2d2(0x18f)](_0x111d77):_0x3f38b6[_0x18f2d2(0x1ba)](_0x111d77),_0x3b34f4(_0x3f38b6);}return;}if(_0x2dbcf9==='a'||_0x2dbcf9==='A'){_0x5985c2(new Set(MCP_IDE_LIST[_0x18f2d2(0x18a)]((_0x5a5112,_0x10c98f)=>_0x10c98f))),_0x3b34f4(new Set(SKILL_IDE_LIST[_0x18f2d2(0x18a)]((_0x2d99df,_0x4abb89)=>_0x4abb89)));return;}if(_0x2dbcf9==='q'||_0x2dbcf9==='Q'){_0x476118();return;}if(_0x46a02c['return']){if(_0x2f3239[_0x18f2d2(0x198)]===0x0&&_0xa0826a[_0x18f2d2(0x198)]===0x0){_0x356556(_0x588060(_0x18f2d2(0x196)));return;}_0x48c0df();return;}}if(_0x4c63a1===_0x18f2d2(0x193)){_0x476118();return;}});async function _0x48c0df(){const _0x204523=_0x30ee7a;_0x495104('installing');const _0x5b8d15=[],_0x351130=[];for(const _0x2578ac of _0x2f3239){const _0x587c4e=MCP_IDE_LIST[_0x2578ac];if(!_0x587c4e)continue;try{const _0xca5f14=await configureMcp(_0x587c4e,_0x2a5cdd[_0x204523(0x183)]);_0x5b8d15[_0x204523(0x19c)](_0xca5f14);}catch(_0x348ba8){_0x5b8d15[_0x204523(0x19c)]({'ide':MCP_IDE_CONFIGS[_0x587c4e]?.[_0x204523(0x1a3)]||_0x587c4e,'status':_0x204523(0x19b),'message':_0x348ba8 instanceof Error?_0x348ba8[_0x204523(0x194)]:String(_0x348ba8)});}}await copySharedSkills(_0x2a5cdd[_0x204523(0x183)]);for(const _0x34ade5 of _0xa0826a){const _0xf9cde2=SKILL_IDE_LIST[_0x34ade5];if(!_0xf9cde2)continue;try{const _0xa7c3ce=await installSkill(_0xf9cde2,_0x2a5cdd[_0x204523(0x183)]);_0x351130[_0x204523(0x19c)](_0xa7c3ce);}catch(_0x368575){_0x351130[_0x204523(0x19c)]({'ide':SKILL_IDE_CONFIGS[_0xf9cde2]?.[_0x204523(0x1a3)]||_0xf9cde2,'status':_0x204523(0x19b),'message':_0x368575 instanceof Error?_0x368575[_0x204523(0x194)]:String(_0x368575)});}}if(_0x351130['length']>0x0){const _0xd2626c=_0x351130[_0x204523(0x18d)](_0x522569=>_0x522569[_0x204523(0x17e)]===_0x204523(0x1ac))[_0x204523(0x18a)](_0x13645e=>_0x13645e[_0x204523(0x1b0)]);_0xd2626c[_0x204523(0x1b5)]>0x0&&createSkillManifest(_0x2a5cdd[_0x204523(0x183)],_0xd2626c);}_0x495104(_0x204523(0x193)),setTimeout(()=>{_0x3fe6e8({'mcpResults':_0x5b8d15,'skillResults':_0x351130});},0xbb8);}if(_0x4c63a1==='confirming')return a0_0x1ccb59(Box,{'flexDirection':_0x30ee7a(0x182),'marginTop':0x1,'children':[a0_0x2a614b(Box,{'marginTop':0x1,'children':a0_0x2a614b(Text,{'color':_0x30ee7a(0x1a6),'children':_0x588060(_0x30ee7a(0x187))})}),a0_0x2a614b(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a0_0x2a614b(Text,{'color':_0x30ee7a(0x197),'children':_0x588060(_0x30ee7a(0x1a4))})}),a0_0x2a614b(Box,{'marginLeft':0x2,'children':a0_0x2a614b(Text,{'color':_0x30ee7a(0x197),'children':_0x588060(_0x30ee7a(0x19d))})}),a0_0x1ccb59(Box,{'marginTop':0x1,'flexDirection':'column','children':[a0_0x2a614b(Box,{'children':a0_0x2a614b(Text,{'color':_0x30ee7a(0x199),'children':_0x588060(_0x30ee7a(0x186))})}),a0_0x2a614b(Box,{'children':a0_0x2a614b(Text,{'color':'gray','children':_0x588060(_0x30ee7a(0x1ae))})}),a0_0x2a614b(Box,{'children':a0_0x2a614b(Text,{'color':'dimColor','children':_0x588060(_0x30ee7a(0x19f))})})]}),_0x5e2df9&&a0_0x2a614b(Box,{'marginTop':0x1,'children':a0_0x1ccb59(Text,{'color':_0x30ee7a(0x1ab),'children':['✗\x20',_0x5e2df9]})})]});if(_0x4c63a1===_0x30ee7a(0x190))return a0_0x1ccb59(Box,{'flexDirection':'column','marginTop':0x1,'children':[a0_0x2a614b(Box,{'children':a0_0x2a614b(Text,{'color':_0x30ee7a(0x1b9),'bold':!![],'children':_0x588060(_0x30ee7a(0x1b3))})}),_0x5e2df9&&a0_0x2a614b(Box,{'marginTop':0x1,'children':a0_0x1ccb59(Text,{'color':_0x30ee7a(0x1ab),'children':['✗\x20',_0x5e2df9]})}),a0_0x1ccb59(Box,{'marginTop':0x1,'flexDirection':_0x30ee7a(0x182),'children':[a0_0x2a614b(Text,{'bold':!![],'color':'yellow','children':_0x588060(_0x30ee7a(0x185))}),MCP_IDE_LIST[_0x30ee7a(0x18a)]((_0x3cea35,_0x32bd1e)=>{const _0x17a9b7=_0x30ee7a,_0x4e5d6e=_0x5e9ff6===_0x32bd1e,_0x745464=_0x2f3239[_0x17a9b7(0x184)](_0x32bd1e);return a0_0x2a614b(Box,{'children':a0_0x1ccb59(Text,{'backgroundColor':_0x4e5d6e?_0x17a9b7(0x181):undefined,'color':_0x4e5d6e?_0x17a9b7(0x1a6):undefined,'children':[_0x745464?_0x17a9b7(0x1b7):_0x17a9b7(0x189),'\x20',_0x3cea35===_0x17a9b7(0x1b6)?_0x17a9b7(0x1bb):_0x17a9b7(0x1ad)]})},_0x17a9b7(0x18b)+_0x3cea35);}),a0_0x2a614b(Box,{'marginTop':0x1,'children':a0_0x2a614b(Text,{'bold':!![],'color':_0x30ee7a(0x1b2),'children':_0x588060('aiSetup.ui.select.skillSection')})}),SKILL_IDE_LIST[_0x30ee7a(0x18a)]((_0x2e5775,_0x43b533)=>{const _0x10ba20=_0x30ee7a,_0x2028a6=_0x43b533+MCP_IDE_LIST[_0x10ba20(0x1b5)],_0x5ab430=_0x5e9ff6===_0x2028a6,_0x5b54a6=_0xa0826a[_0x10ba20(0x184)](_0x2028a6);return a0_0x2a614b(Box,{'children':a0_0x1ccb59(Text,{'backgroundColor':_0x5ab430?_0x10ba20(0x181):undefined,'color':_0x5ab430?_0x10ba20(0x1a6):undefined,'children':[_0x5b54a6?_0x10ba20(0x1b7):'[\x20]','\x20',SKILL_IDE_CONFIGS[_0x2e5775]['name']]})},'skill-'+_0x2e5775);}),a0_0x2a614b(Box,{'marginTop':0x1,'children':a0_0x2a614b(Text,{'color':_0x30ee7a(0x197),'children':_0x588060(_0x30ee7a(0x17d))})})]})]});if(_0x4c63a1===_0x30ee7a(0x1a9))return a0_0x2a614b(Box,{'flexDirection':_0x30ee7a(0x182),'marginTop':0x1,'children':a0_0x2a614b(Box,{'children':a0_0x2a614b(Text,{'children':_0x588060(_0x30ee7a(0x191))})})});if(_0x4c63a1===_0x30ee7a(0x193))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a0_0x6a51a4(0x1bb)},'claude':{'name':'Claude\x20Code'}};
@@ -1 +1 @@
1
- const a1_0x28274a=a1_0x141a;(function(_0x7d040,_0x29eade){const _0x1cdd32=a1_0x141a,_0x35154c=_0x7d040();while(!![]){try{const _0x3464b5=parseInt(_0x1cdd32(0x1fe))/0x1+-parseInt(_0x1cdd32(0x1e1))/0x2+parseInt(_0x1cdd32(0x20b))/0x3+parseInt(_0x1cdd32(0x20c))/0x4+parseInt(_0x1cdd32(0x222))/0x5*(parseInt(_0x1cdd32(0x211))/0x6)+-parseInt(_0x1cdd32(0x228))/0x7*(parseInt(_0x1cdd32(0x1e5))/0x8)+-parseInt(_0x1cdd32(0x1e0))/0x9*(parseInt(_0x1cdd32(0x1f3))/0xa);if(_0x3464b5===_0x29eade)break;else _0x35154c['push'](_0x35154c['shift']());}catch(_0x7eb282){_0x35154c['push'](_0x35154c['shift']());}}}(a1_0x17fd,0x31ff6));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';function a1_0x17fd(){const _0x350acb=['aiSetup.skill.installFailed','.lovrabet/skill/.shared','2.0.0','Claude\x20Code','\x20-e\x20LOVRABET_APP_CODE=','appcode','aiSetup.mcp.other.name','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','319570lojWtk','manual','\x22:\x20{','mcpServers','mcp.json','error','success','aiSetup.mcp.claude.configInfo','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','aiSetup.skill.manifestCreated','join','301196egFpeo','aiSetup.skill.installSuccess','\x20\x20\x22mcpServers\x22:\x20{','agents.md','aiSetup.mcp.claude.manualCommand','log','\x20\x20AppCode:\x20','claude','.lovrabet/skill-manifest.json','mcp-install','stringify','LOVRABET_ENV','map','803943JRptAe','416852BbtQHg','message','aiSetup.mcp.claude.restartRequired','utf-8','\x20\x20}','41826gqwlYc','rules','aiSetup.error.missingAppcode','isDirectory','name','.shared','object','env','skill-install','aiSetup.mcp.cursor.success','aiSetup.mcp.claude.agents.created','aiSetup.skill.sharedCopied','app','cursor','@lovrabet/dataset-mcp-server@latest','aiSetup.mcp.cursor.rules.copyFailed','npx','290QPrTTp','\x20\x20\x20\x20\x20\x20}','Cursor','info','aiSetup.skill.unknownIDE','node:fs','27517OfFZFE','aiSetup.skill.itemsCreated','claude\x20mcp\x20add\x20','63nYwilX','708788DWHKYu','.cursor','toISOString','../../cdn-source/skills','600NvgUag','lovrabet-dataset','cwd','aiSetup.skill.sharedCopyFailed','online','.lovrabet'];a1_0x17fd=function(){return _0x350acb;};return a1_0x17fd();}import a1_0x2d4754 from'../i18n/index.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a1_0x28274a(0x1e6),MCP_COMMAND=a1_0x28274a(0x221),MCP_ARGS=[a1_0x28274a(0x21f)];export function buildEnvConfig(_0x42546a,_0x40eb77){const _0x52a3ce=a1_0x28274a,_0x336953={'LOVRABET_APP_CODE':String(_0x42546a)};return _0x40eb77!==_0x52a3ce(0x1e9)&&(_0x336953[_0x52a3ce(0x209)]=String(_0x40eb77)),_0x336953;}export async function configureCursorMcp(_0x291271){const _0x4b1c06=a1_0x28274a,_0x43759b=_0x291271||process[_0x4b1c06(0x1e7)](),_0x2de0ae=readConfig(_0x43759b),_0x135bf5=_0x2de0ae[_0x4b1c06(0x1f0)]||_0x2de0ae['app'],_0x4004a6=_0x2de0ae[_0x4b1c06(0x218)]||_0x4b1c06(0x1e9);if(!_0x135bf5)return{'ide':_0x4b1c06(0x224),'status':_0x4b1c06(0x1f8),'message':a1_0x2d4754['t']('aiSetup.error.missingAppcode')};const _0x46c788=buildEnvConfig(_0x135bf5,_0x4004a6),_0x407ecd={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x46c788},_0x4e55a7=join(_0x43759b,'.cursor',_0x4b1c06(0x1f7)),_0x4733ea=join(_0x43759b,_0x4b1c06(0x1e2));try{!existsSync(_0x4733ea)&&mkdirSync(_0x4733ea,{'recursive':!![]});let _0x8f7f0e={'mcpServers':{}};if(existsSync(_0x4e55a7)){const _0x127dd8=readFileSync(_0x4e55a7,_0x4b1c06(0x20f));_0x8f7f0e=JSON['parse'](_0x127dd8);}return(!_0x8f7f0e[_0x4b1c06(0x1f6)]||typeof _0x8f7f0e[_0x4b1c06(0x1f6)]!==_0x4b1c06(0x217))&&(_0x8f7f0e[_0x4b1c06(0x1f6)]={}),_0x8f7f0e[_0x4b1c06(0x1f6)][MCP_SERVER_NAME]=_0x407ecd,writeFileSync(_0x4e55a7,JSON[_0x4b1c06(0x208)](_0x8f7f0e,null,0x2),'utf-8'),logger[_0x4b1c06(0x225)](_0x4b1c06(0x207),a1_0x2d4754['t'](_0x4b1c06(0x21a)),{'appcode':_0x135bf5,'env':_0x4004a6,'path':_0x4e55a7}),await copyCursorRules(_0x4733ea),{'ide':_0x4b1c06(0x224),'status':'success','message':a1_0x2d4754['t']('aiSetup.mcp.cursor.written')};}catch(_0xed5150){return logger[_0x4b1c06(0x1f8)](_0x4b1c06(0x207),a1_0x2d4754['t']('aiSetup.mcp.cursor.error'),{'error':_0xed5150 instanceof Error?_0xed5150[_0x4b1c06(0x20d)]:String(_0xed5150)}),{'ide':'Cursor','status':_0x4b1c06(0x1f8),'message':_0xed5150 instanceof Error?_0xed5150[_0x4b1c06(0x20d)]:String(_0xed5150)};}}export async function configureClaudeMcp(_0x571be9){const _0x2cd6b5=a1_0x28274a,_0x490084=_0x571be9||process[_0x2cd6b5(0x1e7)](),_0x399a06=readConfig(_0x490084),_0x1e8f4b=_0x399a06[_0x2cd6b5(0x1f0)]||_0x399a06[_0x2cd6b5(0x21d)],_0x21d2fb=_0x399a06[_0x2cd6b5(0x218)]||'online';if(!_0x1e8f4b)return{'ide':'Claude\x20Code','status':'error','message':a1_0x2d4754['t'](_0x2cd6b5(0x213))};let _0xea27c0=_0x2cd6b5(0x1df)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x2cd6b5(0x1fd)]('\x20')+_0x2cd6b5(0x1ef)+_0x1e8f4b;return _0x21d2fb!==_0x2cd6b5(0x1e9)&&(_0xea27c0+='\x20-e\x20LOVRABET_ENV='+_0x21d2fb),await copyAgentsMd(_0x490084),logger[_0x2cd6b5(0x225)](_0x2cd6b5(0x207),a1_0x2d4754['t']('aiSetup.mcp.claude.commandGenerated'),{'command':_0xea27c0,'appcode':_0x1e8f4b,'env':_0x21d2fb}),console[_0x2cd6b5(0x203)](a1_0x2d4754['t'](_0x2cd6b5(0x202))),console['log']('\x20\x20'+_0xea27c0+'\x0a'),console['log'](a1_0x2d4754['t'](_0x2cd6b5(0x1fa))),console[_0x2cd6b5(0x203)](_0x2cd6b5(0x204)+_0x1e8f4b),_0x21d2fb!==_0x2cd6b5(0x1e9)&&console[_0x2cd6b5(0x203)](a1_0x2d4754['t']('aiSetup.mcp.claude.env',{'env':_0x21d2fb})),console[_0x2cd6b5(0x203)](a1_0x2d4754['t'](_0x2cd6b5(0x20e))),{'ide':_0x2cd6b5(0x1ee),'status':_0x2cd6b5(0x1f4),'message':a1_0x2d4754['t']('aiSetup.mcp.claude.manualExecute',{'command':_0xea27c0})};}export async function showOtherGuide(_0x31fa37){const _0x152b33=a1_0x28274a,_0x536802=_0x31fa37||process['cwd'](),_0x29ce27=readConfig(_0x536802),_0xb953c5=_0x29ce27[_0x152b33(0x1f0)]||_0x29ce27[_0x152b33(0x21d)],_0x391ec0=_0x29ce27['env']||_0x152b33(0x1e9);if(!_0xb953c5)return{'ide':a1_0x2d4754['t'](_0x152b33(0x1f1)),'status':_0x152b33(0x1f8),'message':a1_0x2d4754['t'](_0x152b33(0x213))};return console['log'](a1_0x2d4754['t']('aiSetup.mcp.other.title')),console[_0x152b33(0x203)]('{'),console[_0x152b33(0x203)](_0x152b33(0x200)),console['log']('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+_0x152b33(0x1f5)),console[_0x152b33(0x203)](_0x152b33(0x1fb)+MCP_COMMAND+'\x22,'),console['log'](_0x152b33(0x1f2)+MCP_ARGS[_0x152b33(0x20a)](_0x584297=>'\x22'+_0x584297+'\x22')[_0x152b33(0x1fd)](',\x20')+'],'),console[_0x152b33(0x203)]('\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{'),console['log']('\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22'+_0xb953c5+'\x22,'),_0x391ec0!==_0x152b33(0x1e9)&&console[_0x152b33(0x203)]('\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22'+_0x391ec0+'\x22,'),console[_0x152b33(0x203)](_0x152b33(0x223)),console[_0x152b33(0x203)]('\x20\x20\x20\x20}'),console['log'](_0x152b33(0x210)),console[_0x152b33(0x203)]('}\x0a'),logger[_0x152b33(0x225)]('mcp-install',a1_0x2d4754['t']('aiSetup.mcp.other.guideShown'),{'appcode':_0xb953c5,'env':_0x391ec0}),{'ide':a1_0x2d4754['t']('aiSetup.mcp.other.name'),'status':_0x152b33(0x1f4),'message':a1_0x2d4754['t']('aiSetup.mcp.other.guideShown')};}export async function configureMcp(_0xb003f2,_0x2ea7ea){const _0x43d341=a1_0x28274a;switch(_0xb003f2){case _0x43d341(0x21e):return await configureCursorMcp(_0x2ea7ea);case _0x43d341(0x205):return await configureClaudeMcp(_0x2ea7ea);default:throw new Error(a1_0x2d4754['t']('aiSetup.mcp.unsupportedIDE',{'ide':_0xb003f2}));}}function a1_0x141a(_0x4e4c0e,_0x138c59){_0x4e4c0e=_0x4e4c0e-0x1df;const _0x17fd89=a1_0x17fd();let _0x141a9e=_0x17fd89[_0x4e4c0e];return _0x141a9e;}async function copyCursorRules(_0x1fb944){const _0x188533=a1_0x28274a,_0x2df142=join(_0x1fb944,_0x188533(0x212)),_0x1117c3=join(_0x2df142,'lovrabet_rules.mdc');if(existsSync(_0x1117c3))return;try{!existsSync(_0x2df142)&&mkdirSync(_0x2df142,{'recursive':!![]});const _0x238ebf=await getRulesContent();writeFileSync(_0x1117c3,_0x238ebf,_0x188533(0x20f)),logger['info'](_0x188533(0x207),a1_0x2d4754['t']('aiSetup.mcp.cursor.rules.created'),{'to':_0x1117c3});}catch(_0x5f4e92){logger[_0x188533(0x1f8)](_0x188533(0x207),a1_0x2d4754['t'](_0x188533(0x220)),{'error':_0x5f4e92 instanceof Error?_0x5f4e92['message']:String(_0x5f4e92)});}}async function copyAgentsMd(_0x148d8e){const _0x4d0697=a1_0x28274a,_0x116909=join(_0x148d8e,_0x4d0697(0x201));if(existsSync(_0x116909))return;try{const _0x5dd180=await getRulesContent();writeFileSync(_0x116909,_0x5dd180,_0x4d0697(0x20f)),logger[_0x4d0697(0x225)](_0x4d0697(0x207),a1_0x2d4754['t'](_0x4d0697(0x21b)),{'to':_0x116909});}catch(_0x5253a2){logger[_0x4d0697(0x1f8)](_0x4d0697(0x207),a1_0x2d4754['t']('aiSetup.mcp.claude.agents.copyFailed'),{'error':_0x5253a2 instanceof Error?_0x5253a2['message']:String(_0x5253a2)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x524c32,_0x108d4a){const _0x2bf2d2=a1_0x28274a,_0x1f8091=_0x108d4a||process[_0x2bf2d2(0x1e7)](),_0x45817d=resolve(__dirname,_0x2bf2d2(0x1e4)),_0x1212e7=SKILL_IDE_CONFIGS[_0x524c32];if(!_0x1212e7)return{'ide':_0x524c32,'status':'error','message':a1_0x2d4754['t'](_0x2bf2d2(0x226),{'ide':_0x524c32})};const _0x51060d=_0x1212e7[_0x2bf2d2(0x215)];try{let _0x38177d;try{_0x38177d=await fetchGuidesFromCDN();}catch{}const _0x3fca82=await installSingleIDE(_0x524c32,_0x1212e7,_0x1f8091,_0x45817d,_0x38177d);return _0x38177d&&writeGuidesToProject(_0x38177d,_0x1f8091),logger[_0x2bf2d2(0x225)]('skill-install',a1_0x2d4754['t'](_0x2bf2d2(0x1ff),{'name':_0x51060d}),{'ide':_0x524c32,'filesCount':_0x3fca82}),{'ide':_0x51060d,'status':_0x2bf2d2(0x1f9),'message':a1_0x2d4754['t'](_0x2bf2d2(0x229),{'count':_0x3fca82})};}catch(_0xfab9f8){return logger[_0x2bf2d2(0x1f8)](_0x2bf2d2(0x219),a1_0x2d4754['t'](_0x2bf2d2(0x1eb),{'name':_0x51060d}),{'error':_0xfab9f8 instanceof Error?_0xfab9f8[_0x2bf2d2(0x20d)]:String(_0xfab9f8)}),{'ide':_0x51060d,'status':_0x2bf2d2(0x1f8),'message':_0xfab9f8 instanceof Error?_0xfab9f8[_0x2bf2d2(0x20d)]:String(_0xfab9f8)};}}async function copyDir(_0x3684de,_0x27ed61){const _0x200710=a1_0x28274a,{statSync:_0xca5a22}=await import(_0x200710(0x227)),{readdirSync:_0x12a9e4}=await import(_0x200710(0x227)),_0x36d026=_0xca5a22(_0x3684de);if(_0x36d026[_0x200710(0x214)]()){!existsSync(_0x27ed61)&&mkdirSync(_0x27ed61,{'recursive':!![]});const _0x5f43e3=_0x12a9e4(_0x3684de);for(const _0xad558c of _0x5f43e3){await copyDir(join(_0x3684de,_0xad558c),join(_0x27ed61,_0xad558c));}}else copyFileSync(_0x3684de,_0x27ed61);}export async function copySharedSkills(_0x28e73b){const _0x5aaa91=a1_0x28274a,_0x58036d=_0x28e73b||process[_0x5aaa91(0x1e7)](),_0x5acb24=resolve(__dirname,_0x5aaa91(0x1e4)),_0x2a0376=join(_0x5acb24,_0x5aaa91(0x216)),_0x1b2cab=join(_0x58036d,_0x5aaa91(0x1ec));if(!existsSync(_0x2a0376))return![];try{return await copyDir(_0x2a0376,_0x1b2cab),logger['info'](_0x5aaa91(0x219),a1_0x2d4754['t'](_0x5aaa91(0x21c)),{'path':_0x1b2cab}),!![];}catch(_0x44e6d8){return logger['error'](_0x5aaa91(0x219),a1_0x2d4754['t'](_0x5aaa91(0x1e8)),{'error':_0x44e6d8 instanceof Error?_0x44e6d8['message']:String(_0x44e6d8)}),![];}}export function createSkillManifest(_0x5e0e4d,_0x13db6e){const _0x46ec05=a1_0x28274a,_0x2598cf={'version':_0x46ec05(0x1ed),'installedAt':new Date()[_0x46ec05(0x1e3)](),'platforms':_0x13db6e},_0x41642e=join(_0x5e0e4d,_0x46ec05(0x206)),_0x1a1d84=join(_0x5e0e4d,_0x46ec05(0x1ea));!existsSync(_0x1a1d84)&&mkdirSync(_0x1a1d84,{'recursive':!![]}),writeFileSync(_0x41642e,JSON[_0x46ec05(0x208)](_0x2598cf,null,0x2),_0x46ec05(0x20f)),logger['info'](_0x46ec05(0x219),a1_0x2d4754['t'](_0x46ec05(0x1fc)),{'path':_0x41642e});}
1
+ const a1_0x1c64d1=a1_0x469d;(function(_0x3fe60c,_0x9b6cf4){const _0x11b4b3=a1_0x469d,_0x471e7e=_0x3fe60c();while(!![]){try{const _0x2160a2=-parseInt(_0x11b4b3(0x116))/0x1+-parseInt(_0x11b4b3(0x102))/0x2+parseInt(_0x11b4b3(0xf9))/0x3+parseInt(_0x11b4b3(0x126))/0x4*(-parseInt(_0x11b4b3(0xea))/0x5)+parseInt(_0x11b4b3(0xfe))/0x6+-parseInt(_0x11b4b3(0x117))/0x7*(parseInt(_0x11b4b3(0x10e))/0x8)+-parseInt(_0x11b4b3(0x12a))/0x9*(-parseInt(_0x11b4b3(0xf3))/0xa);if(_0x2160a2===_0x9b6cf4)break;else _0x471e7e['push'](_0x471e7e['shift']());}catch(_0x43ee8e){_0x471e7e['push'](_0x471e7e['shift']());}}}(a1_0x209d,0xb0c8f));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';import a1_0x30ff46 from'../i18n/index.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a1_0x1c64d1(0x112),MCP_COMMAND='npx',MCP_ARGS=[a1_0x1c64d1(0xef)];export function buildEnvConfig(_0x183cf8,_0x4ba769){const _0x4642db=a1_0x1c64d1,_0x409266={'LOVRABET_APP_CODE':String(_0x183cf8)};return _0x4ba769!==_0x4642db(0x125)&&(_0x409266[_0x4642db(0x11c)]=String(_0x4ba769)),_0x409266;}export async function configureCursorMcp(_0x49d26b){const _0x198d21=a1_0x1c64d1,_0xeb5f83=_0x49d26b||process['cwd'](),_0x1be72d=readConfig(_0xeb5f83),_0x3bc727=_0x1be72d[_0x198d21(0xfc)]||_0x1be72d[_0x198d21(0x123)],_0x4b793d=_0x1be72d['env']||_0x198d21(0x125);if(!_0x3bc727)return{'ide':'Cursor','status':_0x198d21(0x11d),'message':a1_0x30ff46['t'](_0x198d21(0xf8))};const _0x39f193=buildEnvConfig(_0x3bc727,_0x4b793d),_0xda1cf8={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x39f193},_0x5c0b40=join(_0xeb5f83,_0x198d21(0x103),'mcp.json'),_0x4e04b1=join(_0xeb5f83,_0x198d21(0x103));try{!existsSync(_0x4e04b1)&&mkdirSync(_0x4e04b1,{'recursive':!![]});let _0x5434a7={'mcpServers':{}};if(existsSync(_0x5c0b40)){const _0x3c0cfa=readFileSync(_0x5c0b40,_0x198d21(0x12c));_0x5434a7=JSON['parse'](_0x3c0cfa);}return(!_0x5434a7[_0x198d21(0x12e)]||typeof _0x5434a7['mcpServers']!=='object')&&(_0x5434a7[_0x198d21(0x12e)]={}),_0x5434a7[_0x198d21(0x12e)][MCP_SERVER_NAME]=_0xda1cf8,writeFileSync(_0x5c0b40,JSON['stringify'](_0x5434a7,null,0x2),_0x198d21(0x12c)),logger[_0x198d21(0xe7)](_0x198d21(0x12d),a1_0x30ff46['t']('aiSetup.mcp.cursor.success'),{'appcode':_0x3bc727,'env':_0x4b793d,'path':_0x5c0b40}),await copyCursorRules(_0x4e04b1),{'ide':_0x198d21(0x10d),'status':'success','message':a1_0x30ff46['t'](_0x198d21(0xf4))};}catch(_0x7f98fd){return logger[_0x198d21(0x11d)](_0x198d21(0x12d),a1_0x30ff46['t']('aiSetup.mcp.cursor.error'),{'error':_0x7f98fd instanceof Error?_0x7f98fd['message']:String(_0x7f98fd)}),{'ide':_0x198d21(0x10d),'status':_0x198d21(0x11d),'message':_0x7f98fd instanceof Error?_0x7f98fd[_0x198d21(0x127)]:String(_0x7f98fd)};}}export async function configureClaudeMcp(_0x4d5950){const _0x1177e0=a1_0x1c64d1,_0x359037=_0x4d5950||process[_0x1177e0(0xec)](),_0x22ab43=readConfig(_0x359037),_0xf8a5=_0x22ab43[_0x1177e0(0xfc)]||_0x22ab43[_0x1177e0(0x123)],_0x1dca71=_0x22ab43[_0x1177e0(0xfb)]||_0x1177e0(0x125);if(!_0xf8a5)return{'ide':_0x1177e0(0x128),'status':_0x1177e0(0x11d),'message':a1_0x30ff46['t'](_0x1177e0(0xf8))};let _0x3c8ce7=_0x1177e0(0xe6)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS['join']('\x20')+_0x1177e0(0x11b)+_0xf8a5;return _0x1dca71!==_0x1177e0(0x125)&&(_0x3c8ce7+=_0x1177e0(0x101)+_0x1dca71),await copyAgentsMd(_0x359037),logger[_0x1177e0(0xe7)](_0x1177e0(0x12d),a1_0x30ff46['t'](_0x1177e0(0xf7)),{'command':_0x3c8ce7,'appcode':_0xf8a5,'env':_0x1dca71}),console[_0x1177e0(0x129)](a1_0x30ff46['t']('aiSetup.mcp.claude.manualCommand')),console[_0x1177e0(0x129)]('\x20\x20'+_0x3c8ce7+'\x0a'),console[_0x1177e0(0x129)](a1_0x30ff46['t'](_0x1177e0(0x10a))),console[_0x1177e0(0x129)]('\x20\x20AppCode:\x20'+_0xf8a5),_0x1dca71!==_0x1177e0(0x125)&&console[_0x1177e0(0x129)](a1_0x30ff46['t'](_0x1177e0(0x10f),{'env':_0x1dca71})),console[_0x1177e0(0x129)](a1_0x30ff46['t'](_0x1177e0(0x12b))),{'ide':_0x1177e0(0x128),'status':_0x1177e0(0x109),'message':a1_0x30ff46['t']('aiSetup.mcp.claude.manualExecute',{'command':_0x3c8ce7})};}export async function showOtherGuide(_0x12ee48){const _0x360e87=a1_0x1c64d1,_0x5246bc=_0x12ee48||process['cwd'](),_0xd4fbd1=readConfig(_0x5246bc),_0x32b1c3=_0xd4fbd1[_0x360e87(0xfc)]||_0xd4fbd1[_0x360e87(0x123)],_0x57965b=_0xd4fbd1['env']||_0x360e87(0x125);if(!_0x32b1c3)return{'ide':a1_0x30ff46['t'](_0x360e87(0x124)),'status':'error','message':a1_0x30ff46['t'](_0x360e87(0xf8))};return console[_0x360e87(0x129)](a1_0x30ff46['t']('aiSetup.mcp.other.title')),console[_0x360e87(0x129)]('{'),console['log'](_0x360e87(0xf0)),console[_0x360e87(0x129)](_0x360e87(0xed)+MCP_SERVER_NAME+'\x22:\x20{'),console[_0x360e87(0x129)](_0x360e87(0xfd)+MCP_COMMAND+'\x22,'),console[_0x360e87(0x129)](_0x360e87(0x119)+MCP_ARGS[_0x360e87(0x105)](_0xb40a0b=>'\x22'+_0xb40a0b+'\x22')['join'](',\x20')+'],'),console['log'](_0x360e87(0x110)),console['log'](_0x360e87(0xfa)+_0x32b1c3+'\x22,'),_0x57965b!==_0x360e87(0x125)&&console['log'](_0x360e87(0x108)+_0x57965b+'\x22,'),console[_0x360e87(0x129)]('\x20\x20\x20\x20\x20\x20}'),console[_0x360e87(0x129)](_0x360e87(0x11f)),console[_0x360e87(0x129)]('\x20\x20}'),console[_0x360e87(0x129)]('}\x0a'),logger[_0x360e87(0xe7)]('mcp-install',a1_0x30ff46['t'](_0x360e87(0x114)),{'appcode':_0x32b1c3,'env':_0x57965b}),{'ide':a1_0x30ff46['t']('aiSetup.mcp.other.name'),'status':_0x360e87(0x109),'message':a1_0x30ff46['t'](_0x360e87(0x114))};}export async function configureMcp(_0x1a41e8,_0x3efd5a){const _0x20093b=a1_0x1c64d1;switch(_0x1a41e8){case _0x20093b(0xff):return await configureCursorMcp(_0x3efd5a);case'claude':return await configureClaudeMcp(_0x3efd5a);default:throw new Error(a1_0x30ff46['t'](_0x20093b(0xf1),{'ide':_0x1a41e8}));}}async function copyCursorRules(_0x960f54){const _0x53bd9e=a1_0x1c64d1,_0x3b63bd=join(_0x960f54,_0x53bd9e(0xeb)),_0x20f00b=join(_0x3b63bd,_0x53bd9e(0x113));if(existsSync(_0x20f00b))return;try{!existsSync(_0x3b63bd)&&mkdirSync(_0x3b63bd,{'recursive':!![]});const _0x1c402e=await getRulesContent();writeFileSync(_0x20f00b,_0x1c402e,_0x53bd9e(0x12c)),logger[_0x53bd9e(0xe7)](_0x53bd9e(0x12d),a1_0x30ff46['t'](_0x53bd9e(0x11e)),{'to':_0x20f00b});}catch(_0x14a50a){logger[_0x53bd9e(0x11d)]('mcp-install',a1_0x30ff46['t'](_0x53bd9e(0x100)),{'error':_0x14a50a instanceof Error?_0x14a50a[_0x53bd9e(0x127)]:String(_0x14a50a)});}}async function copyAgentsMd(_0x1d2ca2){const _0x33083a=a1_0x1c64d1,_0x29d6f5=join(_0x1d2ca2,_0x33083a(0xe9));if(existsSync(_0x29d6f5))return;try{const _0x375e11=await getRulesContent();writeFileSync(_0x29d6f5,_0x375e11,_0x33083a(0x12c)),logger[_0x33083a(0xe7)](_0x33083a(0x12d),a1_0x30ff46['t'](_0x33083a(0x120)),{'to':_0x29d6f5});}catch(_0x55e547){logger[_0x33083a(0x11d)](_0x33083a(0x12d),a1_0x30ff46['t']('aiSetup.mcp.claude.agents.copyFailed'),{'error':_0x55e547 instanceof Error?_0x55e547['message']:String(_0x55e547)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x3ec1b8,_0x561988){const _0x448492=a1_0x1c64d1,_0xfe6711=_0x561988||process[_0x448492(0xec)](),_0x1cf1f4=resolve(__dirname,'../../cdn-source/skills'),_0x38fc94=SKILL_IDE_CONFIGS[_0x3ec1b8];if(!_0x38fc94)return{'ide':_0x3ec1b8,'status':_0x448492(0x11d),'message':a1_0x30ff46['t'](_0x448492(0x115),{'ide':_0x3ec1b8})};const _0x3d455f=_0x38fc94[_0x448492(0xf6)];try{let _0x3d8c29;try{_0x3d8c29=await fetchGuidesFromCDN();}catch{}const _0x2229ba=await installSingleIDE(_0x3ec1b8,_0x38fc94,_0xfe6711,_0x1cf1f4,_0x3d8c29);return _0x3d8c29&&writeGuidesToProject(_0x3d8c29,_0xfe6711),logger[_0x448492(0xe7)](_0x448492(0x106),a1_0x30ff46['t'](_0x448492(0x122),{'name':_0x3d455f}),{'ide':_0x3ec1b8,'filesCount':_0x2229ba}),{'ide':_0x3d455f,'status':_0x448492(0x121),'message':a1_0x30ff46['t']('aiSetup.skill.itemsCreated',{'count':_0x2229ba})};}catch(_0x1fa8bb){return logger[_0x448492(0x11d)]('skill-install',a1_0x30ff46['t']('aiSetup.skill.installFailed',{'name':_0x3d455f}),{'error':_0x1fa8bb instanceof Error?_0x1fa8bb[_0x448492(0x127)]:String(_0x1fa8bb)}),{'ide':_0x3d455f,'status':_0x448492(0x11d),'message':_0x1fa8bb instanceof Error?_0x1fa8bb[_0x448492(0x127)]:String(_0x1fa8bb)};}}async function copyDir(_0x409b6c,_0x444e98){const _0x3a6597=a1_0x1c64d1,{statSync:_0x4dc6b3}=await import(_0x3a6597(0x10c)),{readdirSync:_0x1cef5b}=await import(_0x3a6597(0x10c)),_0x285d45=_0x4dc6b3(_0x409b6c);if(_0x285d45[_0x3a6597(0xf5)]()){!existsSync(_0x444e98)&&mkdirSync(_0x444e98,{'recursive':!![]});const _0x193d04=_0x1cef5b(_0x409b6c);for(const _0x26ca22 of _0x193d04){await copyDir(join(_0x409b6c,_0x26ca22),join(_0x444e98,_0x26ca22));}}else copyFileSync(_0x409b6c,_0x444e98);}function a1_0x209d(){const _0x5f4983=['\x20-e\x20LOVRABET_APP_CODE=','LOVRABET_ENV','error','aiSetup.mcp.cursor.rules.created','\x20\x20\x20\x20}','aiSetup.mcp.claude.agents.created','success','aiSetup.skill.installSuccess','app','aiSetup.mcp.other.name','online','2582936wquFfB','message','Claude\x20Code','log','8221923neGpQJ','aiSetup.mcp.claude.restartRequired','utf-8','mcp-install','mcpServers','claude\x20mcp\x20add\x20','info','aiSetup.skill.sharedCopied','agents.md','10wVDYDv','rules','cwd','\x20\x20\x20\x20\x22','toISOString','@lovrabet/dataset-mcp-server@latest','\x20\x20\x22mcpServers\x22:\x20{','aiSetup.mcp.unsupportedIDE','aiSetup.skill.sharedCopyFailed','50ihCZZT','aiSetup.mcp.cursor.written','isDirectory','name','aiSetup.mcp.claude.commandGenerated','aiSetup.error.missingAppcode','2649036ZuATtH','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','env','appcode','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','1935354knUlHf','cursor','aiSetup.mcp.cursor.rules.copyFailed','\x20-e\x20LOVRABET_ENV=','2851974NyMkfn','.cursor','.lovrabet','map','skill-install','.shared','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','manual','aiSetup.mcp.claude.configInfo','.lovrabet/skill-manifest.json','node:fs','Cursor','16OKLyTU','aiSetup.mcp.claude.env','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','2.0.0','lovrabet-dataset','lovrabet_rules.mdc','aiSetup.mcp.other.guideShown','aiSetup.skill.unknownIDE','1217922oCbPzM','3898363FXpTMI','aiSetup.skill.manifestCreated','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','.lovrabet/skill/.shared'];a1_0x209d=function(){return _0x5f4983;};return a1_0x209d();}export async function copySharedSkills(_0x3b7f02){const _0x51578a=a1_0x1c64d1,_0x248429=_0x3b7f02||process[_0x51578a(0xec)](),_0x2a9498=resolve(__dirname,'../../cdn-source/skills'),_0x30e361=join(_0x2a9498,_0x51578a(0x107)),_0x5e800a=join(_0x248429,_0x51578a(0x11a));if(!existsSync(_0x30e361))return![];try{return await copyDir(_0x30e361,_0x5e800a),logger[_0x51578a(0xe7)]('skill-install',a1_0x30ff46['t'](_0x51578a(0xe8)),{'path':_0x5e800a}),!![];}catch(_0x34111a){return logger[_0x51578a(0x11d)](_0x51578a(0x106),a1_0x30ff46['t'](_0x51578a(0xf2)),{'error':_0x34111a instanceof Error?_0x34111a[_0x51578a(0x127)]:String(_0x34111a)}),![];}}function a1_0x469d(_0x11afb8,_0x903f9f){_0x11afb8=_0x11afb8-0xe6;const _0x209d6c=a1_0x209d();let _0x469da2=_0x209d6c[_0x11afb8];return _0x469da2;}export function createSkillManifest(_0x22712f,_0x508a72){const _0x4cd43b=a1_0x1c64d1,_0x163a48={'version':_0x4cd43b(0x111),'installedAt':new Date()[_0x4cd43b(0xee)](),'platforms':_0x508a72},_0x3916c1=join(_0x22712f,_0x4cd43b(0x10b)),_0x1cb768=join(_0x22712f,_0x4cd43b(0x104));!existsSync(_0x1cb768)&&mkdirSync(_0x1cb768,{'recursive':!![]}),writeFileSync(_0x3916c1,JSON['stringify'](_0x163a48,null,0x2),_0x4cd43b(0x12c)),logger[_0x4cd43b(0xe7)](_0x4cd43b(0x106),a1_0x30ff46['t'](_0x4cd43b(0x118)),{'path':_0x3916c1});}
@@ -1 +1 @@
1
- function a2_0x5b10(){const _0x10254d=['1356TuDTsX','api.docUI.generatingFile','online','api.common.noAppCodeDefault','yellow','390bldHYQ','red','6083AchtSv','api-doc','40SqnLGB','api.docUI.docGenerateFailed','datasetName','9Hrzegv','datasetCode','api.docUI.failedDatasets','message','\x1b[90m','[ERROR]\x20','setLogPath','2067096ycBtdc','文档生成完成','filter','filePath','expired','api.docUI.outputDir','Authentication','\x20-\x20','length','2310cyJRru','11852YdOuAt','cyan','\x1b[33m','\x1b[0m','api.docUI.generatingDocs','string','lovrabet\x20auth','api.docUI.datasetsNotFound','log','4437012rKHKbH','api.docUI.generatedDocs','api.docUI.noDatasets','success','api.docUI.docFailed','error','api.docUI.filteredDatasets','white','gray','api.docUI.allDatasetsNotFound','dim','column','env','文档生成失败:\x20','join','includes','1346883RFKDgY','map','136OLGRDw','332607wTrnIM'];a2_0x5b10=function(){return _0x10254d;};return a2_0x5b10();}(function(_0x53c633,_0x1823ac){const _0x42d03f=a2_0xf4d3,_0x1310fa=_0x53c633();while(!![]){try{const _0x44abe8=parseInt(_0x42d03f(0x161))/0x1*(-parseInt(_0x42d03f(0x163))/0x2)+parseInt(_0x42d03f(0x15f))/0x3+-parseInt(_0x42d03f(0x180))/0x4*(parseInt(_0x42d03f(0x168))/0x5)+parseInt(_0x42d03f(0x17f))/0x6*(parseInt(_0x42d03f(0x16a))/0x7)+-parseInt(_0x42d03f(0x176))/0x8*(-parseInt(_0x42d03f(0x16f))/0x9)+-parseInt(_0x42d03f(0x16c))/0xa*(parseInt(_0x42d03f(0x162))/0xb)+-parseInt(_0x42d03f(0x189))/0xc;if(_0x44abe8===_0x1823ac)break;else _0x1310fa['push'](_0x1310fa['shift']());}catch(_0x4a5402){_0x1310fa['push'](_0x1310fa['shift']());}}}(a2_0x5b10,0x37a34));import{jsx as a2_0xc68f63,jsxs as a2_0x58a801,Fragment as a2_0x30730d}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a2_0xf4d3(_0x1b8d3b,_0xf22ac0){_0x1b8d3b=_0x1b8d3b-0x15e;const _0x5b10e0=a2_0x5b10();let _0xf4d383=_0x5b10e0[_0x1b8d3b];return _0xf4d383;}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:_0x517281,env:_0x58a267,output:_0xa4f58,extraParams:_0x47db34,datasetCodes:_0x5d3c92})=>{const _0x4cba45=a2_0xf4d3,{exit:_0x55c68f}=useApp(),{t:_0x55ebbe}=useI18n(),[_0x5c05b8,_0x323ea6]=useState(![]),[_0xf180e2,_0x455f86]=useState(''),[_0x1d1169,_0x3b3c75]=useState(![]),[_0x1a9f0a,_0x4bfb7b]=useState(null),[_0x2b6367,_0x13ad0c]=useState(null),[_0x2d228d,_0x34ddfd]=useState(0x0),_0x252641=readConfig(),_0x14d94c=getConfigAppCode(),_0x400659=_0x517281||_0x14d94c,_0x184dab=typeof _0x252641?.[_0x4cba45(0x195)]===_0x4cba45(0x185)?_0x252641[_0x4cba45(0x195)]:undefined,_0x455d6a=_0x58a267||_0x184dab||_0x4cba45(0x165);initEnv(_0x455d6a);const _0x2cdf3c=_0xa4f58||'./docs',_0x21d445=_0x517281?_0x55ebbe('api.common.usingSpecifiedAppCode',{'appCode':_0x400659}):_0x55ebbe('api.common.usingDefaultAppCode',{'appCode':_0x400659});useEffect(()=>{_0x323ea6(!![]),_0x46e947();},[]),useEffect(()=>{(_0x1d1169||_0x1a9f0a)&&_0x55c68f();},[_0x1d1169,_0x1a9f0a,_0x55c68f]);async function _0x46e947(){const _0x227805=_0x4cba45;if(!_0x400659){_0x4bfb7b(_0x55ebbe(_0x227805(0x166)));return;}try{logger[_0x227805(0x175)](process['cwd']()),_0x455f86(_0x55ebbe('api.docUI.fetchingDatasets'));const {configArray:_0x5990f0}=await fetchModelList(_0x400659);_0x34ddfd(_0x5990f0['length']);if(_0x5990f0['length']===0x0){_0x4bfb7b(_0x55ebbe(_0x227805(0x18b)));return;}let _0x29a4ed=_0x5990f0;if(_0x5d3c92&&_0x5d3c92['length']>0x0){_0x29a4ed=_0x5990f0[_0x227805(0x178)](_0x262346=>_0x5d3c92[_0x227805(0x15e)](_0x262346[_0x227805(0x170)]));const _0x4cad6c=_0x29a4ed['map'](_0x4de86b=>_0x4de86b['datasetCode']),_0x1f295d=_0x5d3c92['filter'](_0x2fffa6=>!_0x4cad6c[_0x227805(0x15e)](_0x2fffa6));_0x1f295d[_0x227805(0x17e)]>0x0&&console[_0x227805(0x188)](_0x227805(0x182)+_0x55ebbe(_0x227805(0x187),{'codes':_0x1f295d[_0x227805(0x197)](',\x20')})+_0x227805(0x183));if(_0x29a4ed['length']===0x0){_0x4bfb7b(_0x55ebbe(_0x227805(0x192),{'codes':_0x5d3c92[_0x227805(0x197)](',\x20')}));return;}console[_0x227805(0x188)](_0x227805(0x173)+_0x55ebbe(_0x227805(0x18f),{'total':_0x5990f0[_0x227805(0x17e)],'count':_0x29a4ed[_0x227805(0x17e)]})+_0x227805(0x183));}_0x455f86(_0x55ebbe(_0x227805(0x184),{'count':_0x29a4ed[_0x227805(0x17e)]}));const _0x42f2fd=await generateDatasetDocs(_0x29a4ed,_0x400659,_0x2cdf3c,(_0x323f10,_0x5ce767,_0x59872b)=>{const _0x4a5c09=_0x227805;_0x455f86(_0x55ebbe(_0x4a5c09(0x164),{'fileName':_0x59872b,'current':_0x323f10,'total':_0x5ce767}));},_0x47db34);_0x13ad0c(_0x42f2fd),_0x3b3c75(!![]);const _0x15e696=_0x42f2fd[_0x227805(0x178)](_0x2df716=>_0x2df716['success'])[_0x227805(0x17e)],_0x8788f8=_0x42f2fd[_0x227805(0x178)](_0x5e3f8b=>!_0x5e3f8b[_0x227805(0x18c)])[_0x227805(0x17e)];logger[_0x227805(0x18c)](_0x227805(0x16b),_0x227805(0x177),undefined,{'totalCount':_0x42f2fd[_0x227805(0x17e)],'successCount':_0x15e696,'failCount':_0x8788f8,'outputDir':_0x2cdf3c});}catch(_0x2f2f83){const _0xbfcad3=_0x2f2f83 instanceof Error?_0x2f2f83[_0x227805(0x172)]:String(_0x2f2f83);logger['error'](_0x227805(0x16b),_0x227805(0x196)+_0xbfcad3,{'appCode':_0x400659,'outputDir':_0x2cdf3c}),_0x4bfb7b(_0x55ebbe(_0x227805(0x16d),{'error':_0xbfcad3}));}finally{_0x323ea6(![]);}}const _0x4b8631=_0x2b6367?.['filter'](_0x1c8184=>_0x1c8184['success'])['length']||0x0,_0x5f561c=_0x2b6367?.[_0x4cba45(0x178)](_0x16ff39=>!_0x16ff39[_0x4cba45(0x18c)])[_0x4cba45(0x17e)]||0x0;return a2_0x58a801(Box,{'flexDirection':_0x4cba45(0x194),'children':[(_0x5c05b8||_0x1d1169)&&a2_0x58a801(Box,{'children':[a2_0xc68f63(Text,{'color':_0x4cba45(0x191),'children':'*\x20'}),a2_0xc68f63(Text,{'color':_0x517281?_0x4cba45(0x190):_0x4cba45(0x193),'children':_0x21d445})]}),_0x5c05b8&&a2_0xc68f63(Box,{'children':a2_0x58a801(Text,{'children':['*\x20',_0xf180e2]})}),_0x1d1169&&_0x2b6367&&a2_0x58a801(Box,{'flexDirection':'column','children':[a2_0xc68f63(Box,{'children':a2_0x58a801(Text,{'color':'green','children':[_0x55ebbe('api.docUI.docComplete',{'successCount':_0x4b8631}),_0x5f561c>0x0?_0x55ebbe(_0x4cba45(0x18d),{'failCount':_0x5f561c}):'']})}),a2_0xc68f63(Box,{'marginTop':0x1,'children':a2_0xc68f63(Text,{'color':_0x4cba45(0x191),'children':_0x55ebbe('api.docUI.processedDatasets',{'count':_0x2d228d})})}),a2_0x58a801(Box,{'marginTop':0x1,'children':[a2_0xc68f63(Text,{'color':_0x4cba45(0x191),'children':_0x55ebbe(_0x4cba45(0x17b))}),a2_0xc68f63(Text,{'color':_0x4cba45(0x181),'children':_0x2cdf3c})]}),_0x4b8631>0x0&&a2_0x58a801(a2_0x30730d,{'children':[a2_0xc68f63(Box,{'marginTop':0x1,'children':a2_0xc68f63(Text,{'color':_0x4cba45(0x191),'children':_0x55ebbe(_0x4cba45(0x18a))})}),_0x2b6367[_0x4cba45(0x178)](_0x59aecc=>_0x59aecc['success'])['map']((_0x2acec1,_0x278c0d)=>a2_0x58a801(Box,{'marginLeft':0x2,'children':[a2_0x58a801(Text,{'color':_0x4cba45(0x181),'children':['•\x20',_0x2acec1[_0x4cba45(0x179)]]}),a2_0x58a801(Text,{'color':_0x4cba45(0x193),'children':[_0x4cba45(0x17d),_0x2acec1[_0x4cba45(0x16e)]]})]},_0x278c0d))]}),_0x5f561c>0x0&&a2_0x58a801(a2_0x30730d,{'children':[a2_0xc68f63(Box,{'marginTop':0x1,'children':a2_0xc68f63(Text,{'color':_0x4cba45(0x167),'children':_0x55ebbe(_0x4cba45(0x171))})}),_0x2b6367[_0x4cba45(0x178)](_0x3f5039=>!_0x3f5039[_0x4cba45(0x18c)])[_0x4cba45(0x160)]((_0x2e1afa,_0xa10d61)=>a2_0x58a801(Box,{'marginLeft':0x2,'flexDirection':_0x4cba45(0x194),'children':[a2_0x58a801(Text,{'color':'red','children':['•\x20',_0x2e1afa['datasetName'],'\x20(',_0x2e1afa['datasetCode'],')']}),_0x2e1afa[_0x4cba45(0x18e)]&&a2_0xc68f63(Box,{'marginLeft':0x2,'children':a2_0xc68f63(Text,{'color':_0x4cba45(0x193),'children':_0x2e1afa[_0x4cba45(0x18e)]})})]},_0xa10d61))]})]}),_0x1a9f0a&&a2_0x58a801(Box,{'flexDirection':'column','children':[a2_0xc68f63(Box,{'children':a2_0x58a801(Text,{'color':_0x4cba45(0x169),'children':[_0x4cba45(0x174),_0x1a9f0a]})}),(_0x1a9f0a[_0x4cba45(0x15e)]('登录')||_0x1a9f0a[_0x4cba45(0x15e)](_0x4cba45(0x17c))||_0x1a9f0a['includes'](_0x4cba45(0x17a)))&&a2_0x58a801(Box,{'marginTop':0x1,'children':[a2_0xc68f63(Text,{'color':_0x4cba45(0x167),'children':'*\x20'}),a2_0xc68f63(Text,{'color':_0x4cba45(0x181),'children':_0x4cba45(0x186)}),a2_0x58a801(Text,{'color':_0x4cba45(0x167),'children':['\x20',_0x55ebbe('api.common.authRetry')]})]})]})]});};
1
+ (function(_0x33435e,_0x2bb8a9){const _0x2d5d21=a2_0x477b,_0x294975=_0x33435e();while(!![]){try{const _0xe664d5=-parseInt(_0x2d5d21(0x130))/0x1*(parseInt(_0x2d5d21(0x127))/0x2)+-parseInt(_0x2d5d21(0x145))/0x3*(-parseInt(_0x2d5d21(0x156))/0x4)+-parseInt(_0x2d5d21(0x144))/0x5+-parseInt(_0x2d5d21(0x142))/0x6+parseInt(_0x2d5d21(0x154))/0x7+parseInt(_0x2d5d21(0x148))/0x8+parseInt(_0x2d5d21(0x12f))/0x9*(parseInt(_0x2d5d21(0x13c))/0xa);if(_0xe664d5===_0x2bb8a9)break;else _0x294975['push'](_0x294975['shift']());}catch(_0x385633){_0x294975['push'](_0x294975['shift']());}}}(a2_0x3b98,0xd08dc));import{jsx as a2_0xe5261d,jsxs as a2_0x25ac32,Fragment as a2_0xfb6324}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a2_0x477b(_0x31172c,_0x3e5fd8){_0x31172c=_0x31172c-0x126;const _0x3b98aa=a2_0x3b98();let _0x477bc5=_0x3b98aa[_0x31172c];return _0x477bc5;}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';function a2_0x3b98(){const _0x354cf6=['[ERROR]\x20','string','dim','api.common.usingSpecifiedAppCode','cwd','lovrabet\x20auth','api.docUI.generatedDocs','red','790BdleiS','\x20-\x20','expired','success','message','api.docUI.docFailed','20862mQxHtm','api.docUI.noDatasets','7655285eilzPk','2554395WzxucW','api.common.authRetry','api.docUI.generatingFile','1740584KVqRnj','\x1b[33m','map','api.docUI.docComplete','filter','文档生成失败:\x20','cyan','setLogPath','length','column','log','datasetName','1693916LpgOaG','env','4LeDWGD','api.docUI.datasetsNotFound','join','api.docUI.generatingDocs','api.docUI.fetchingDatasets','yellow','green','204106svRTSP','datasetCode','gray','api.common.usingDefaultAppCode','api.docUI.outputDir','./docs','includes','api.docUI.processedDatasets','204165xbGesd','7AWjfRa','error','api-doc','api.docUI.failedDatasets'];a2_0x3b98=function(){return _0x354cf6;};return a2_0x3b98();}export const ApiDocUI=({appCode:_0x222d4a,env:_0x28d587,output:_0x552077,extraParams:_0x44cfa1,datasetCodes:_0x791370})=>{const _0x2ce7a8=a2_0x477b,{exit:_0x4c166f}=useApp(),{t:_0x4e581a}=useI18n(),[_0x129f4c,_0x469ad8]=useState(![]),[_0x2cd1aa,_0x26d14b]=useState(''),[_0x2d32be,_0x17c9a9]=useState(![]),[_0x5f50ae,_0x6ee85d]=useState(null),[_0x420094,_0x46eb31]=useState(null),[_0x4c164c,_0x3d0d95]=useState(0x0),_0x24db74=readConfig(),_0x3563b8=getConfigAppCode(),_0x56f9e1=_0x222d4a||_0x3563b8,_0x561a6c=typeof _0x24db74?.[_0x2ce7a8(0x155)]===_0x2ce7a8(0x135)?_0x24db74[_0x2ce7a8(0x155)]:undefined,_0x43a5db=_0x28d587||_0x561a6c||'online';initEnv(_0x43a5db);const _0x461bf8=_0x552077||_0x2ce7a8(0x12c),_0x5e6f5b=_0x222d4a?_0x4e581a(_0x2ce7a8(0x137),{'appCode':_0x56f9e1}):_0x4e581a(_0x2ce7a8(0x12a),{'appCode':_0x56f9e1});useEffect(()=>{_0x469ad8(!![]),_0x510db6();},[]),useEffect(()=>{(_0x2d32be||_0x5f50ae)&&_0x4c166f();},[_0x2d32be,_0x5f50ae,_0x4c166f]);async function _0x510db6(){const _0x7b91b0=_0x2ce7a8;if(!_0x56f9e1){_0x6ee85d(_0x4e581a('api.common.noAppCodeDefault'));return;}try{logger[_0x7b91b0(0x14f)](process[_0x7b91b0(0x138)]()),_0x26d14b(_0x4e581a(_0x7b91b0(0x15a)));const {configArray:_0x5b8081}=await fetchModelList(_0x56f9e1);_0x3d0d95(_0x5b8081[_0x7b91b0(0x150)]);if(_0x5b8081[_0x7b91b0(0x150)]===0x0){_0x6ee85d(_0x4e581a(_0x7b91b0(0x143)));return;}let _0x5c83a1=_0x5b8081;if(_0x791370&&_0x791370[_0x7b91b0(0x150)]>0x0){_0x5c83a1=_0x5b8081[_0x7b91b0(0x14c)](_0x157092=>_0x791370[_0x7b91b0(0x12d)](_0x157092[_0x7b91b0(0x128)]));const _0x1edeef=_0x5c83a1[_0x7b91b0(0x14a)](_0x4bee5e=>_0x4bee5e[_0x7b91b0(0x128)]),_0x36d1f0=_0x791370['filter'](_0x3bf41c=>!_0x1edeef[_0x7b91b0(0x12d)](_0x3bf41c));_0x36d1f0[_0x7b91b0(0x150)]>0x0&&console[_0x7b91b0(0x152)](_0x7b91b0(0x149)+_0x4e581a(_0x7b91b0(0x157),{'codes':_0x36d1f0[_0x7b91b0(0x158)](',\x20')})+'\x1b[0m');if(_0x5c83a1['length']===0x0){_0x6ee85d(_0x4e581a('api.docUI.allDatasetsNotFound',{'codes':_0x791370[_0x7b91b0(0x158)](',\x20')}));return;}console['log']('\x1b[90m'+_0x4e581a('api.docUI.filteredDatasets',{'total':_0x5b8081[_0x7b91b0(0x150)],'count':_0x5c83a1[_0x7b91b0(0x150)]})+'\x1b[0m');}_0x26d14b(_0x4e581a(_0x7b91b0(0x159),{'count':_0x5c83a1[_0x7b91b0(0x150)]}));const _0x594ae8=await generateDatasetDocs(_0x5c83a1,_0x56f9e1,_0x461bf8,(_0x3bd0ff,_0x37a8a7,_0x251b3d)=>{const _0x2f487c=_0x7b91b0;_0x26d14b(_0x4e581a(_0x2f487c(0x147),{'fileName':_0x251b3d,'current':_0x3bd0ff,'total':_0x37a8a7}));},_0x44cfa1);_0x46eb31(_0x594ae8),_0x17c9a9(!![]);const _0x8df2c8=_0x594ae8[_0x7b91b0(0x14c)](_0x2f134b=>_0x2f134b[_0x7b91b0(0x13f)])['length'],_0x1e59de=_0x594ae8[_0x7b91b0(0x14c)](_0x45514c=>!_0x45514c['success'])[_0x7b91b0(0x150)];logger[_0x7b91b0(0x13f)]('api-doc','文档生成完成',undefined,{'totalCount':_0x594ae8[_0x7b91b0(0x150)],'successCount':_0x8df2c8,'failCount':_0x1e59de,'outputDir':_0x461bf8});}catch(_0x48bb31){const _0x3b15e6=_0x48bb31 instanceof Error?_0x48bb31[_0x7b91b0(0x140)]:String(_0x48bb31);logger[_0x7b91b0(0x131)](_0x7b91b0(0x132),_0x7b91b0(0x14d)+_0x3b15e6,{'appCode':_0x56f9e1,'outputDir':_0x461bf8}),_0x6ee85d(_0x4e581a('api.docUI.docGenerateFailed',{'error':_0x3b15e6}));}finally{_0x469ad8(![]);}}const _0x935b69=_0x420094?.[_0x2ce7a8(0x14c)](_0x5380e1=>_0x5380e1[_0x2ce7a8(0x13f)])[_0x2ce7a8(0x150)]||0x0,_0x1a2c68=_0x420094?.['filter'](_0x12509f=>!_0x12509f[_0x2ce7a8(0x13f)])['length']||0x0;return a2_0x25ac32(Box,{'flexDirection':_0x2ce7a8(0x151),'children':[(_0x129f4c||_0x2d32be)&&a2_0x25ac32(Box,{'children':[a2_0xe5261d(Text,{'color':_0x2ce7a8(0x129),'children':'*\x20'}),a2_0xe5261d(Text,{'color':_0x222d4a?'white':'dim','children':_0x5e6f5b})]}),_0x129f4c&&a2_0xe5261d(Box,{'children':a2_0x25ac32(Text,{'children':['*\x20',_0x2cd1aa]})}),_0x2d32be&&_0x420094&&a2_0x25ac32(Box,{'flexDirection':_0x2ce7a8(0x151),'children':[a2_0xe5261d(Box,{'children':a2_0x25ac32(Text,{'color':_0x2ce7a8(0x126),'children':[_0x4e581a(_0x2ce7a8(0x14b),{'successCount':_0x935b69}),_0x1a2c68>0x0?_0x4e581a(_0x2ce7a8(0x141),{'failCount':_0x1a2c68}):'']})}),a2_0xe5261d(Box,{'marginTop':0x1,'children':a2_0xe5261d(Text,{'color':_0x2ce7a8(0x129),'children':_0x4e581a(_0x2ce7a8(0x12e),{'count':_0x4c164c})})}),a2_0x25ac32(Box,{'marginTop':0x1,'children':[a2_0xe5261d(Text,{'color':'gray','children':_0x4e581a(_0x2ce7a8(0x12b))}),a2_0xe5261d(Text,{'color':'cyan','children':_0x461bf8})]}),_0x935b69>0x0&&a2_0x25ac32(a2_0xfb6324,{'children':[a2_0xe5261d(Box,{'marginTop':0x1,'children':a2_0xe5261d(Text,{'color':_0x2ce7a8(0x129),'children':_0x4e581a(_0x2ce7a8(0x13a))})}),_0x420094[_0x2ce7a8(0x14c)](_0x4e3760=>_0x4e3760[_0x2ce7a8(0x13f)])[_0x2ce7a8(0x14a)]((_0x43b392,_0x3eb30c)=>a2_0x25ac32(Box,{'marginLeft':0x2,'children':[a2_0x25ac32(Text,{'color':_0x2ce7a8(0x14e),'children':['•\x20',_0x43b392['filePath']]}),a2_0x25ac32(Text,{'color':_0x2ce7a8(0x136),'children':[_0x2ce7a8(0x13d),_0x43b392['datasetName']]})]},_0x3eb30c))]}),_0x1a2c68>0x0&&a2_0x25ac32(a2_0xfb6324,{'children':[a2_0xe5261d(Box,{'marginTop':0x1,'children':a2_0xe5261d(Text,{'color':_0x2ce7a8(0x15b),'children':_0x4e581a(_0x2ce7a8(0x133))})}),_0x420094[_0x2ce7a8(0x14c)](_0x3521c=>!_0x3521c[_0x2ce7a8(0x13f)])[_0x2ce7a8(0x14a)]((_0x336f1c,_0x234d2f)=>a2_0x25ac32(Box,{'marginLeft':0x2,'flexDirection':_0x2ce7a8(0x151),'children':[a2_0x25ac32(Text,{'color':_0x2ce7a8(0x13b),'children':['•\x20',_0x336f1c[_0x2ce7a8(0x153)],'\x20(',_0x336f1c[_0x2ce7a8(0x128)],')']}),_0x336f1c[_0x2ce7a8(0x131)]&&a2_0xe5261d(Box,{'marginLeft':0x2,'children':a2_0xe5261d(Text,{'color':_0x2ce7a8(0x136),'children':_0x336f1c[_0x2ce7a8(0x131)]})})]},_0x234d2f))]})]}),_0x5f50ae&&a2_0x25ac32(Box,{'flexDirection':_0x2ce7a8(0x151),'children':[a2_0xe5261d(Box,{'children':a2_0x25ac32(Text,{'color':_0x2ce7a8(0x13b),'children':[_0x2ce7a8(0x134),_0x5f50ae]})}),(_0x5f50ae['includes']('登录')||_0x5f50ae[_0x2ce7a8(0x12d)]('Authentication')||_0x5f50ae[_0x2ce7a8(0x12d)](_0x2ce7a8(0x13e)))&&a2_0x25ac32(Box,{'marginTop':0x1,'children':[a2_0xe5261d(Text,{'color':_0x2ce7a8(0x15b),'children':'*\x20'}),a2_0xe5261d(Text,{'color':_0x2ce7a8(0x14e),'children':_0x2ce7a8(0x139)}),a2_0x25ac32(Text,{'color':_0x2ce7a8(0x15b),'children':['\x20',_0x4e581a(_0x2ce7a8(0x146))]})]})]})]});};
@@ -1 +1 @@
1
- const a3_0x2e7d57=a3_0x1436;(function(_0x3ec08c,_0x155737){const _0x89084e=a3_0x1436,_0x3bd682=_0x3ec08c();while(!![]){try{const _0x3d6d2c=-parseInt(_0x89084e(0x157))/0x1+-parseInt(_0x89084e(0x161))/0x2*(parseInt(_0x89084e(0x149))/0x3)+parseInt(_0x89084e(0x159))/0x4+-parseInt(_0x89084e(0x150))/0x5+-parseInt(_0x89084e(0x164))/0x6+parseInt(_0x89084e(0x163))/0x7+parseInt(_0x89084e(0x165))/0x8*(parseInt(_0x89084e(0x152))/0x9);if(_0x3d6d2c===_0x155737)break;else _0x3bd682['push'](_0x3bd682['shift']());}catch(_0x4e3e8f){_0x3bd682['push'](_0x3bd682['shift']());}}}(a3_0x1f85,0xcb80d));import{mkdirSync,writeFileSync}from'node:fs';import a3_0x5b73a9 from'node:path';function a3_0x1436(_0x165389,_0x5b8fe2){_0x165389=_0x165389-0x148;const _0x1f8587=a3_0x1f85();let _0x143687=_0x1f8587[_0x165389];return _0x143687;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import a3_0x8200f4 from'../i18n/index.js';function a3_0x1f85(){const _0x4d3d5b=['344JMZQMb','datasetCode','api.docBatch.totalDatasets','api.docBatch.generating','api.docBatch.httpError','api.docBatch.success','.md','success','json','528OrUUip','text','message','markdown','join','tableName','status','6560085yoKkil','utf8','560565spYfRX','bind','api.docBatch.failed','生成文档失败:\x20','data','1406394nAvuHh','api-doc','5712344OiYBdt','length','/api/node-toolbox/api-doc-generator','api.docBatch.docFormatError','push','log','application/json','name','6758gtnAIp','生成文档成功:\x20','8261764VlRBxj','6839574FDpoYr'];a3_0x1f85=function(){return _0x4d3d5b;};return a3_0x1f85();}const t=a3_0x8200f4['t'][a3_0x2e7d57(0x153)](a3_0x8200f4);export async function fetchDatasetDoc(_0x9f3a06){const _0x2a9e28=a3_0x2e7d57,{appCode:_0x4df514,datasetCode:_0x342c69,datasetId:_0x491597,extraParams:_0x29d0d5}=_0x9f3a06,_0x3da91d=getApiDomain(),_0x21b898=_0x3da91d+_0x2a9e28(0x15b),_0x5a68ba={'appCode':_0x4df514,'datasetCode':_0x342c69,'datasetId':_0x491597,..._0x29d0d5||{}},_0x47908a=await fetch(_0x21b898,{'method':'POST','headers':{'Content-Type':_0x2a9e28(0x15f),'Cookie':getCookie()},'body':JSON['stringify'](_0x5a68ba)});if(!_0x47908a['ok']){if(_0x47908a[_0x2a9e28(0x14f)]===0x191)throw new Error(t('api.common.authExpired'));let _0x50534a='';try{_0x50534a=await _0x47908a[_0x2a9e28(0x14a)]();}catch(_0x2a5e90){}throw new Error(''+t(_0x2a9e28(0x169),{'datasetCode':_0x342c69,'status':_0x47908a['status']})+(_0x50534a?'\x0a'+_0x50534a:''));}const _0x1166d1=await _0x47908a[_0x2a9e28(0x148)]();if(!_0x1166d1[_0x2a9e28(0x156)]||typeof _0x1166d1[_0x2a9e28(0x156)][_0x2a9e28(0x14c)]!=='string')throw new Error(t(_0x2a9e28(0x15c),{'datasetCode':_0x342c69}));return _0x1166d1[_0x2a9e28(0x156)][_0x2a9e28(0x14c)];}function delay(_0x57c90b){return new Promise(_0xb56795=>setTimeout(_0xb56795,_0x57c90b));}export async function generateDatasetDocs(_0x324c97,_0x4da183,_0xafc15b='./docs',_0x54ffb9,_0xe1f14){const _0x5b4681=a3_0x2e7d57;mkdirSync(_0xafc15b,{'recursive':!![]});const _0x249dfb=[],_0x405f23=_0x324c97[_0x5b4681(0x15a)];console['log'](t(_0x5b4681(0x167),{'count':_0x405f23}));for(let _0x5f3a36=0x0;_0x5f3a36<_0x324c97[_0x5b4681(0x15a)];_0x5f3a36++){const _0x1e4cac=_0x324c97[_0x5f3a36],_0x327fd8=_0x5f3a36+0x1,_0xfeef5f=_0x1e4cac[_0x5b4681(0x14e)];try{console['log'](t(_0x5b4681(0x168),{'current':_0x327fd8,'total':_0x405f23,'fileName':_0xfeef5f,'name':_0x1e4cac[_0x5b4681(0x160)]}));_0x54ffb9&&_0x54ffb9(_0x327fd8,_0x405f23,_0xfeef5f);const _0x5c42a0=await fetchDatasetDoc({'appCode':_0x4da183,'datasetCode':_0x1e4cac[_0x5b4681(0x166)],'datasetId':_0x1e4cac['id'],'enableAI':![],'extraParams':_0xe1f14}),_0x3c9594=a3_0x5b73a9[_0x5b4681(0x14d)](_0xafc15b,_0xfeef5f+_0x5b4681(0x16b));writeFileSync(_0x3c9594,_0x5c42a0,{'encoding':_0x5b4681(0x151)}),console[_0x5b4681(0x15e)](t(_0x5b4681(0x16a),{'fileName':_0xfeef5f})),logger[_0x5b4681(0x16c)](_0x5b4681(0x158),_0x5b4681(0x162)+_0xfeef5f,undefined,{'datasetCode':_0x1e4cac[_0x5b4681(0x166)],'datasetName':_0x1e4cac[_0x5b4681(0x160)],'filePath':_0x3c9594,'progress':_0x327fd8+'/'+_0x405f23}),_0x249dfb[_0x5b4681(0x15d)]({'datasetCode':_0x1e4cac[_0x5b4681(0x166)],'datasetName':_0x1e4cac[_0x5b4681(0x160)],'filePath':_0x3c9594,'success':!![]}),_0x327fd8<_0x405f23&&await delay(0x1388);}catch(_0x40a49e){const _0x217894=_0x40a49e instanceof Error?_0x40a49e[_0x5b4681(0x14b)]:String(_0x40a49e);console[_0x5b4681(0x15e)](t(_0x5b4681(0x154),{'fileName':_0xfeef5f,'error':_0x217894})),logger['error'](_0x5b4681(0x158),_0x5b4681(0x155)+_0x1e4cac[_0x5b4681(0x166)],{'datasetCode':_0x1e4cac[_0x5b4681(0x166)],'datasetName':_0x1e4cac['name'],'error':_0x217894,'progress':_0x327fd8+'/'+_0x405f23}),_0x249dfb[_0x5b4681(0x15d)]({'datasetCode':_0x1e4cac[_0x5b4681(0x166)],'datasetName':_0x1e4cac[_0x5b4681(0x160)],'filePath':'','success':![],'error':_0x217894}),_0x327fd8<_0x405f23&&(console[_0x5b4681(0x15e)](t('api.docBatch.waiting')),await delay(0xbb8));}}return _0x249dfb;}
1
+ (function(_0x33288a,_0x3d2b93){const _0x3ff9f0=a3_0x2780,_0x460267=_0x33288a();while(!![]){try{const _0x118225=parseInt(_0x3ff9f0(0x15a))/0x1*(parseInt(_0x3ff9f0(0x151))/0x2)+-parseInt(_0x3ff9f0(0x141))/0x3+parseInt(_0x3ff9f0(0x155))/0x4+parseInt(_0x3ff9f0(0x156))/0x5*(parseInt(_0x3ff9f0(0x153))/0x6)+-parseInt(_0x3ff9f0(0x14b))/0x7+-parseInt(_0x3ff9f0(0x143))/0x8+parseInt(_0x3ff9f0(0x15e))/0x9*(-parseInt(_0x3ff9f0(0x14e))/0xa);if(_0x118225===_0x3d2b93)break;else _0x460267['push'](_0x460267['shift']());}catch(_0x146240){_0x460267['push'](_0x460267['shift']());}}}(a3_0x4ab5,0x432e0));import{mkdirSync,writeFileSync}from'node:fs';function a3_0x4ab5(){const _0x49c7ae=['1714342Skeheo','status','/api/node-toolbox/api-doc-generator','228860DGZdVB','api-doc','log','2DweJOK','api.docBatch.failed','456mcvqgg','data','1729284dBwaEY','5410VKNpFU','api.common.authExpired','application/json','message','428095KZeldm','api.docBatch.waiting','string','tableName','9AurfST','success','生成文档失败:\x20','datasetCode','name','utf8','生成文档成功:\x20','450270xPFMry','POST','1996784uFQNLg','length','.md','api.docBatch.httpError','push','json','markdown','text'];a3_0x4ab5=function(){return _0x49c7ae;};return a3_0x4ab5();}function a3_0x2780(_0x356f8b,_0x9d5803){_0x356f8b=_0x356f8b-0x13b;const _0x4ab547=a3_0x4ab5();let _0x27804b=_0x4ab547[_0x356f8b];return _0x27804b;}import a3_0x39d98f from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import a3_0xf48645 from'../i18n/index.js';const t=a3_0xf48645['t']['bind'](a3_0xf48645);export async function fetchDatasetDoc(_0x47ece4){const _0x4b5c49=a3_0x2780,{appCode:_0x233a8e,datasetCode:_0x4e7bb1,datasetId:_0x5d850b,extraParams:_0x5b1a6f}=_0x47ece4,_0xec1f3e=getApiDomain(),_0x179230=_0xec1f3e+_0x4b5c49(0x14d),_0x46afa9={'appCode':_0x233a8e,'datasetCode':_0x4e7bb1,'datasetId':_0x5d850b,..._0x5b1a6f||{}},_0x10e59d=await fetch(_0x179230,{'method':_0x4b5c49(0x142),'headers':{'Content-Type':_0x4b5c49(0x158),'Cookie':getCookie()},'body':JSON['stringify'](_0x46afa9)});if(!_0x10e59d['ok']){if(_0x10e59d[_0x4b5c49(0x14c)]===0x191)throw new Error(t(_0x4b5c49(0x157)));let _0x5f2e0f='';try{_0x5f2e0f=await _0x10e59d[_0x4b5c49(0x14a)]();}catch(_0x28d38a){}throw new Error(''+t(_0x4b5c49(0x146),{'datasetCode':_0x4e7bb1,'status':_0x10e59d['status']})+(_0x5f2e0f?'\x0a'+_0x5f2e0f:''));}const _0x227957=await _0x10e59d[_0x4b5c49(0x148)]();if(!_0x227957[_0x4b5c49(0x154)]||typeof _0x227957['data']['markdown']!==_0x4b5c49(0x15c))throw new Error(t('api.docBatch.docFormatError',{'datasetCode':_0x4e7bb1}));return _0x227957['data'][_0x4b5c49(0x149)];}function delay(_0x5232b0){return new Promise(_0x4345d6=>setTimeout(_0x4345d6,_0x5232b0));}export async function generateDatasetDocs(_0xadf6ca,_0x3890bc,_0x387538='./docs',_0x2bb360,_0x4ef40f){const _0x193e34=a3_0x2780;mkdirSync(_0x387538,{'recursive':!![]});const _0x12a09a=[],_0x59f8a8=_0xadf6ca[_0x193e34(0x144)];console[_0x193e34(0x150)](t('api.docBatch.totalDatasets',{'count':_0x59f8a8}));for(let _0x4a4e9d=0x0;_0x4a4e9d<_0xadf6ca['length'];_0x4a4e9d++){const _0x159779=_0xadf6ca[_0x4a4e9d],_0x192613=_0x4a4e9d+0x1,_0x9346a=_0x159779[_0x193e34(0x15d)];try{console[_0x193e34(0x150)](t('api.docBatch.generating',{'current':_0x192613,'total':_0x59f8a8,'fileName':_0x9346a,'name':_0x159779[_0x193e34(0x13e)]}));_0x2bb360&&_0x2bb360(_0x192613,_0x59f8a8,_0x9346a);const _0x356192=await fetchDatasetDoc({'appCode':_0x3890bc,'datasetCode':_0x159779['datasetCode'],'datasetId':_0x159779['id'],'enableAI':![],'extraParams':_0x4ef40f}),_0x298e98=a3_0x39d98f['join'](_0x387538,_0x9346a+_0x193e34(0x145));writeFileSync(_0x298e98,_0x356192,{'encoding':_0x193e34(0x13f)}),console['log'](t('api.docBatch.success',{'fileName':_0x9346a})),logger[_0x193e34(0x13b)](_0x193e34(0x14f),_0x193e34(0x140)+_0x9346a,undefined,{'datasetCode':_0x159779['datasetCode'],'datasetName':_0x159779[_0x193e34(0x13e)],'filePath':_0x298e98,'progress':_0x192613+'/'+_0x59f8a8}),_0x12a09a['push']({'datasetCode':_0x159779[_0x193e34(0x13d)],'datasetName':_0x159779['name'],'filePath':_0x298e98,'success':!![]}),_0x192613<_0x59f8a8&&await delay(0x1388);}catch(_0x774609){const _0x1b79ca=_0x774609 instanceof Error?_0x774609[_0x193e34(0x159)]:String(_0x774609);console[_0x193e34(0x150)](t(_0x193e34(0x152),{'fileName':_0x9346a,'error':_0x1b79ca})),logger['error']('api-doc',_0x193e34(0x13c)+_0x159779['datasetCode'],{'datasetCode':_0x159779[_0x193e34(0x13d)],'datasetName':_0x159779[_0x193e34(0x13e)],'error':_0x1b79ca,'progress':_0x192613+'/'+_0x59f8a8}),_0x12a09a[_0x193e34(0x147)]({'datasetCode':_0x159779[_0x193e34(0x13d)],'datasetName':_0x159779[_0x193e34(0x13e)],'filePath':'','success':![],'error':_0x1b79ca}),_0x192613<_0x59f8a8&&(console[_0x193e34(0x150)](t(_0x193e34(0x15b))),await delay(0xbb8));}}return _0x12a09a;}
@@ -1 +1 @@
1
- (function(_0xc41ad4,_0x216353){const _0x292a1b=a4_0x58fb,_0x4ee01f=_0xc41ad4();while(!![]){try{const _0x1c0aa0=parseInt(_0x292a1b(0x1d6))/0x1+parseInt(_0x292a1b(0x1dc))/0x2*(parseInt(_0x292a1b(0x1d8))/0x3)+-parseInt(_0x292a1b(0x1d5))/0x4*(parseInt(_0x292a1b(0x1db))/0x5)+parseInt(_0x292a1b(0x1d2))/0x6+parseInt(_0x292a1b(0x1ea))/0x7*(parseInt(_0x292a1b(0x1eb))/0x8)+-parseInt(_0x292a1b(0x1ce))/0x9*(-parseInt(_0x292a1b(0x1d7))/0xa)+-parseInt(_0x292a1b(0x1c7))/0xb;if(_0x1c0aa0===_0x216353)break;else _0x4ee01f['push'](_0x4ee01f['shift']());}catch(_0x44d5e0){_0x4ee01f['push'](_0x4ee01f['shift']());}}}(a4_0x298d,0x19861));import{jsx as a4_0x51c3eb,jsxs as a4_0x361dbb}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a4_0x298d(){const _0x12e7bb=['44374huhxTF','90QCewJH','6pagDQj','api','replace','11865UDeRut','109464LqapjY','lovrabet\x20auth','api.pullUI.modelFile','api.common.usingDefaultAppCode','setLogPath','import\x20','./src/api/','env','api-pull','api.common.noAppCodeDefault','[ERROR]\x20','white','expired','datasetCount','14fUsoLW','59216BSzPRz','api.pullUI.pullFailed','api.pullUI.generatedFiles','string','column','split','length','client','{\x20lovrabetClient\x20}','api.pullUI.importHint','cwd','online','api.pullUI.clientFile','api.pullUI.successPull','message','green','.ts','red','duplicateCount','cyan','includes','api.pullUI.fetching','join','1505471vTHoaZ','api.pullUI.duplicateInfo','gray','originalCount','error','api.common.authRetry','slice','94041LbvHwi','yellow','拉取\x20API\x20配置失败:\x20','api.common.usingSpecifiedAppCode','626952RxtKyc','modelCount','dim','212kDseZz'];a4_0x298d=function(){return _0x12e7bb;};return a4_0x298d();}import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';function a4_0x58fb(_0x1d89d9,_0x39ff9d){_0x1d89d9=_0x1d89d9-0x1be;const _0x298d5b=a4_0x298d();let _0x58fb7a=_0x298d5b[_0x1d89d9];return _0x58fb7a;}import{fetchModelList}from'./fetch-model-list.js';import{useI18n}from'../i18n/hooks.js';export const ApiPullUI=({appCode:_0x441769,env:_0x54c2a5,output:_0x1f7ee6})=>{const _0x5f0ac3=a4_0x58fb,{exit:_0x17e330}=useApp(),{t:_0x12e501}=useI18n(),[_0x155b85,_0xc439ed]=useState(![]),[_0x211628,_0x58d38e]=useState(![]),[_0x424a35,_0x12519a]=useState(null),[_0x4d0e09,_0x15a0c8]=useState(null),_0x5374b8=readConfig(),_0x246da6=getConfigAppCode(),_0xfd7041=_0x441769||_0x246da6,_0x5775c8=typeof _0x5374b8?.[_0x5f0ac3(0x1e3)]===_0x5f0ac3(0x1ee)?_0x5374b8[_0x5f0ac3(0x1e3)]:undefined,_0x38164a=_0x54c2a5||_0x5775c8||_0x5f0ac3(0x1f6);initEnv(_0x38164a);const _0x5695b1=_0x1f7ee6||_0x5f0ac3(0x1e2),_0x3970fc=_0x441769&&_0x441769[_0x5f0ac3(0x1c4)]('-')?_0x441769[_0x5f0ac3(0x1f0)]('-')[_0x5f0ac3(0x1cd)](0x1)[_0x5f0ac3(0x1c6)]('-'):'',_0x42bd8b=_0x441769?_0x12e501(_0x5f0ac3(0x1d1),{'appCode':_0xfd7041}):_0x12e501(_0x5f0ac3(0x1df),{'appCode':_0xfd7041}),_0x1fceca=_0x3970fc?_0x3970fc+'-api':_0x5f0ac3(0x1d9),_0x1eb937=_0x3970fc?_0x3970fc+'-client':_0x5f0ac3(0x1f2);useEffect(()=>{_0xc439ed(!![]),_0x58e454();},[]),useEffect(()=>{(_0x211628||_0x424a35)&&_0x17e330();},[_0x211628,_0x424a35,_0x17e330]);async function _0x58e454(){const _0x283818=_0x5f0ac3;if(!_0xfd7041){_0x12519a(_0x12e501(_0x283818(0x1e5)));return;}try{logger[_0x283818(0x1e0)](process[_0x283818(0x1f5)]());const {configArray:_0x3b0e85}=await fetchModelList(_0xfd7041),_0xbcebf5=_0x3b0e85[_0x283818(0x1f1)],_0x579d2d=!_0x441769,_0x528d02=await generateApiFile(_0x3b0e85,_0x3970fc,_0xfd7041,_0x579d2d,_0x38164a,_0x5695b1),_0x571fa2=_0x5695b1['endsWith']('/')?_0x5695b1:_0x5695b1+'/';_0x15a0c8({'api':''+_0x571fa2+_0x1fceca+'.ts','client':''+_0x571fa2+_0x1eb937+_0x283818(0x1c0),'modelCount':_0x528d02[_0x283818(0x1d3)],'datasetCount':_0xbcebf5,'originalCount':_0xbcebf5,'duplicateCount':0x0}),_0x58d38e(!![]);}catch(_0xdcb268){const _0x471585=_0xdcb268 instanceof Error?_0xdcb268[_0x283818(0x1be)]:String(_0xdcb268);logger[_0x283818(0x1cb)](_0x283818(0x1e4),_0x283818(0x1d0)+_0x471585,{'appCode':_0xfd7041,'error':_0x471585}),_0x12519a(_0x12e501(_0x283818(0x1ec),{'error':_0x471585}));}finally{_0xc439ed(![]);}}return a4_0x361dbb(Box,{'flexDirection':_0x5f0ac3(0x1ef),'children':[(_0x155b85||_0x211628)&&a4_0x361dbb(Box,{'children':[a4_0x51c3eb(Text,{'color':_0x5f0ac3(0x1c9),'children':'*\x20'}),a4_0x51c3eb(Text,{'color':_0x441769?_0x5f0ac3(0x1e7):_0x5f0ac3(0x1d4),'children':_0x42bd8b})]}),_0x155b85&&a4_0x51c3eb(Box,{'children':a4_0x51c3eb(Text,{'children':_0x12e501(_0x5f0ac3(0x1c5),{'env':_0x38164a})})}),_0x211628&&_0x4d0e09&&a4_0x361dbb(Box,{'flexDirection':_0x5f0ac3(0x1ef),'children':[a4_0x51c3eb(Box,{'children':a4_0x51c3eb(Text,{'color':_0x5f0ac3(0x1bf),'children':_0x12e501(_0x5f0ac3(0x1f8),{'datasetCount':_0x4d0e09[_0x5f0ac3(0x1e9)],'modelCount':_0x4d0e09[_0x5f0ac3(0x1d3)]})})}),_0x4d0e09['duplicateCount']>0x0&&a4_0x51c3eb(Box,{'marginTop':0x1,'children':a4_0x51c3eb(Text,{'color':_0x5f0ac3(0x1cf),'children':_0x12e501(_0x5f0ac3(0x1c8),{'originalCount':_0x4d0e09[_0x5f0ac3(0x1ca)],'duplicateCount':_0x4d0e09[_0x5f0ac3(0x1c2)]})})}),a4_0x51c3eb(Box,{'marginTop':0x1,'children':a4_0x51c3eb(Text,{'color':'gray','children':_0x12e501(_0x5f0ac3(0x1ed))})}),a4_0x361dbb(Box,{'marginLeft':0x2,'children':[a4_0x361dbb(Text,{'color':_0x5f0ac3(0x1c3),'children':['•\x20',_0x4d0e09[_0x5f0ac3(0x1d9)]]}),a4_0x361dbb(Text,{'color':_0x5f0ac3(0x1d4),'children':['\x20',_0x12e501(_0x5f0ac3(0x1de),{'count':_0x4d0e09[_0x5f0ac3(0x1d3)]})]})]}),a4_0x361dbb(Box,{'marginLeft':0x2,'children':[a4_0x361dbb(Text,{'color':'cyan','children':['•\x20',_0x4d0e09['client']]}),a4_0x361dbb(Text,{'color':_0x5f0ac3(0x1d4),'children':['\x20',_0x12e501(_0x5f0ac3(0x1f7))]})]}),a4_0x51c3eb(Box,{'marginTop':0x1,'children':a4_0x51c3eb(Text,{'color':_0x5f0ac3(0x1c9),'children':_0x12e501(_0x5f0ac3(0x1f4))})}),a4_0x51c3eb(Box,{'marginLeft':0x2,'children':a4_0x361dbb(Text,{'color':_0x5f0ac3(0x1cf),'children':[_0x5f0ac3(0x1e1),_0x5f0ac3(0x1f3),'\x20from\x20\x27@/',_0x4d0e09[_0x5f0ac3(0x1f2)][_0x5f0ac3(0x1da)](/^\.\//,'')[_0x5f0ac3(0x1da)]('.ts',''),'\x27']})})]}),_0x424a35&&a4_0x361dbb(Box,{'flexDirection':_0x5f0ac3(0x1ef),'children':[a4_0x51c3eb(Box,{'children':a4_0x361dbb(Text,{'color':_0x5f0ac3(0x1c1),'children':[_0x5f0ac3(0x1e6),_0x424a35]})}),(_0x424a35['includes']('登录')||_0x424a35['includes']('Authentication')||_0x424a35[_0x5f0ac3(0x1c4)](_0x5f0ac3(0x1e8)))&&a4_0x361dbb(Box,{'marginTop':0x1,'children':[a4_0x51c3eb(Text,{'color':_0x5f0ac3(0x1cf),'children':'*\x20'}),a4_0x51c3eb(Text,{'color':_0x5f0ac3(0x1c3),'children':_0x5f0ac3(0x1dd)}),a4_0x361dbb(Text,{'color':_0x5f0ac3(0x1cf),'children':['\x20',_0x12e501(_0x5f0ac3(0x1cc))]})]})]})]});};
1
+ function a4_0x1cde(_0x331066,_0x5eaec7){_0x331066=_0x331066-0x153;const _0x59d4ae=a4_0x59d4();let _0x1cde85=_0x59d4ae[_0x331066];return _0x1cde85;}(function(_0x249887,_0xf0f4e6){const _0x2cb1d7=a4_0x1cde,_0x4072a0=_0x249887();while(!![]){try{const _0x40faa1=-parseInt(_0x2cb1d7(0x17d))/0x1+parseInt(_0x2cb1d7(0x17c))/0x2*(parseInt(_0x2cb1d7(0x154))/0x3)+-parseInt(_0x2cb1d7(0x186))/0x4*(parseInt(_0x2cb1d7(0x17b))/0x5)+-parseInt(_0x2cb1d7(0x15f))/0x6*(-parseInt(_0x2cb1d7(0x172))/0x7)+-parseInt(_0x2cb1d7(0x183))/0x8+parseInt(_0x2cb1d7(0x175))/0x9*(-parseInt(_0x2cb1d7(0x170))/0xa)+parseInt(_0x2cb1d7(0x17e))/0xb;if(_0x40faa1===_0xf0f4e6)break;else _0x4072a0['push'](_0x4072a0['shift']());}catch(_0xd0e3e7){_0x4072a0['push'](_0x4072a0['shift']());}}}(a4_0x59d4,0x3b06c));import{jsx as a4_0x2acc7a,jsxs as a4_0x44533f}from'react/jsx-runtime';import{useEffect,useState}from'react';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';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';import{useI18n}from'../i18n/hooks.js';function a4_0x59d4(){const _0x18ebc0=['-client','api.common.usingDefaultAppCode','env','api.pullUI.modelFile','client','32365VdQwUu','699134slCVmK','439649xwBQyT','5055699ebKIWq','green','[ERROR]\x20','yellow','{\x20lovrabetClient\x20}','237144PzmQWR','api.pullUI.generatedFiles','cyan','108aEqnxE','endsWith','white','message','online','setLogPath','3UIshZj','red','length','api','api.pullUI.pullFailed','column','gray','-api','originalCount','api.pullUI.fetching','modelCount','1071834KYXtBu','join','slice','error','import\x20','\x20from\x20\x27@/','cwd','api.pullUI.duplicateInfo','Authentication','expired','api.common.noAppCodeDefault','拉取\x20API\x20配置失败:\x20','includes','.ts','api.pullUI.importHint','dim','replace','20SdESsS','split','7yYsmMv','api.pullUI.successPull','api.pullUI.clientFile','458910nEoCtW'];a4_0x59d4=function(){return _0x18ebc0;};return a4_0x59d4();}export const ApiPullUI=({appCode:_0x384bb2,env:_0x29eb95,output:_0x4d1673})=>{const _0x32fc55=a4_0x1cde,{exit:_0x2208a9}=useApp(),{t:_0x4683be}=useI18n(),[_0x258864,_0x56f2bf]=useState(![]),[_0x51c4fb,_0x8cebf6]=useState(![]),[_0x331dd7,_0x505e6d]=useState(null),[_0x4351e9,_0x749dfc]=useState(null),_0xc8df15=readConfig(),_0x5541b9=getConfigAppCode(),_0x2a7a26=_0x384bb2||_0x5541b9,_0x1a1a88=typeof _0xc8df15?.['env']==='string'?_0xc8df15[_0x32fc55(0x178)]:undefined,_0x5636e6=_0x29eb95||_0x1a1a88||_0x32fc55(0x18a);initEnv(_0x5636e6);const _0x325683=_0x4d1673||'./src/api/',_0x4c3b20=_0x384bb2&&_0x384bb2['includes']('-')?_0x384bb2[_0x32fc55(0x171)]('-')[_0x32fc55(0x161)](0x1)[_0x32fc55(0x160)]('-'):'',_0x138a74=_0x384bb2?_0x4683be('api.common.usingSpecifiedAppCode',{'appCode':_0x2a7a26}):_0x4683be(_0x32fc55(0x177),{'appCode':_0x2a7a26}),_0x368139=_0x4c3b20?_0x4c3b20+_0x32fc55(0x15b):_0x32fc55(0x157),_0x1a261b=_0x4c3b20?_0x4c3b20+_0x32fc55(0x176):_0x32fc55(0x17a);useEffect(()=>{_0x56f2bf(!![]),_0x241519();},[]),useEffect(()=>{(_0x51c4fb||_0x331dd7)&&_0x2208a9();},[_0x51c4fb,_0x331dd7,_0x2208a9]);async function _0x241519(){const _0x2e859b=_0x32fc55;if(!_0x2a7a26){_0x505e6d(_0x4683be(_0x2e859b(0x169)));return;}try{logger[_0x2e859b(0x153)](process[_0x2e859b(0x165)]());const {configArray:_0x26013b}=await fetchModelList(_0x2a7a26),_0x5f89b7=_0x26013b[_0x2e859b(0x156)],_0x4bc880=!_0x384bb2,_0xc95d24=await generateApiFile(_0x26013b,_0x4c3b20,_0x2a7a26,_0x4bc880,_0x5636e6,_0x325683),_0xd7d1e=_0x325683[_0x2e859b(0x187)]('/')?_0x325683:_0x325683+'/';_0x749dfc({'api':''+_0xd7d1e+_0x368139+_0x2e859b(0x16c),'client':''+_0xd7d1e+_0x1a261b+_0x2e859b(0x16c),'modelCount':_0xc95d24[_0x2e859b(0x15e)],'datasetCount':_0x5f89b7,'originalCount':_0x5f89b7,'duplicateCount':0x0}),_0x8cebf6(!![]);}catch(_0x46b426){const _0x3d3fb4=_0x46b426 instanceof Error?_0x46b426[_0x2e859b(0x189)]:String(_0x46b426);logger[_0x2e859b(0x162)]('api-pull',_0x2e859b(0x16a)+_0x3d3fb4,{'appCode':_0x2a7a26,'error':_0x3d3fb4}),_0x505e6d(_0x4683be(_0x2e859b(0x158),{'error':_0x3d3fb4}));}finally{_0x56f2bf(![]);}}return a4_0x44533f(Box,{'flexDirection':_0x32fc55(0x159),'children':[(_0x258864||_0x51c4fb)&&a4_0x44533f(Box,{'children':[a4_0x2acc7a(Text,{'color':'gray','children':'*\x20'}),a4_0x2acc7a(Text,{'color':_0x384bb2?_0x32fc55(0x188):'dim','children':_0x138a74})]}),_0x258864&&a4_0x2acc7a(Box,{'children':a4_0x2acc7a(Text,{'children':_0x4683be(_0x32fc55(0x15d),{'env':_0x5636e6})})}),_0x51c4fb&&_0x4351e9&&a4_0x44533f(Box,{'flexDirection':_0x32fc55(0x159),'children':[a4_0x2acc7a(Box,{'children':a4_0x2acc7a(Text,{'color':_0x32fc55(0x17f),'children':_0x4683be(_0x32fc55(0x173),{'datasetCount':_0x4351e9['datasetCount'],'modelCount':_0x4351e9[_0x32fc55(0x15e)]})})}),_0x4351e9['duplicateCount']>0x0&&a4_0x2acc7a(Box,{'marginTop':0x1,'children':a4_0x2acc7a(Text,{'color':_0x32fc55(0x181),'children':_0x4683be(_0x32fc55(0x166),{'originalCount':_0x4351e9[_0x32fc55(0x15c)],'duplicateCount':_0x4351e9['duplicateCount']})})}),a4_0x2acc7a(Box,{'marginTop':0x1,'children':a4_0x2acc7a(Text,{'color':_0x32fc55(0x15a),'children':_0x4683be(_0x32fc55(0x184))})}),a4_0x44533f(Box,{'marginLeft':0x2,'children':[a4_0x44533f(Text,{'color':_0x32fc55(0x185),'children':['•\x20',_0x4351e9['api']]}),a4_0x44533f(Text,{'color':'dim','children':['\x20',_0x4683be(_0x32fc55(0x179),{'count':_0x4351e9[_0x32fc55(0x15e)]})]})]}),a4_0x44533f(Box,{'marginLeft':0x2,'children':[a4_0x44533f(Text,{'color':_0x32fc55(0x185),'children':['•\x20',_0x4351e9['client']]}),a4_0x44533f(Text,{'color':_0x32fc55(0x16e),'children':['\x20',_0x4683be(_0x32fc55(0x174))]})]}),a4_0x2acc7a(Box,{'marginTop':0x1,'children':a4_0x2acc7a(Text,{'color':'gray','children':_0x4683be(_0x32fc55(0x16d))})}),a4_0x2acc7a(Box,{'marginLeft':0x2,'children':a4_0x44533f(Text,{'color':_0x32fc55(0x181),'children':[_0x32fc55(0x163),_0x32fc55(0x182),_0x32fc55(0x164),_0x4351e9[_0x32fc55(0x17a)][_0x32fc55(0x16f)](/^\.\//,'')[_0x32fc55(0x16f)](_0x32fc55(0x16c),''),'\x27']})})]}),_0x331dd7&&a4_0x44533f(Box,{'flexDirection':_0x32fc55(0x159),'children':[a4_0x2acc7a(Box,{'children':a4_0x44533f(Text,{'color':_0x32fc55(0x155),'children':[_0x32fc55(0x180),_0x331dd7]})}),(_0x331dd7[_0x32fc55(0x16b)]('登录')||_0x331dd7['includes'](_0x32fc55(0x167))||_0x331dd7['includes'](_0x32fc55(0x168)))&&a4_0x44533f(Box,{'marginTop':0x1,'children':[a4_0x2acc7a(Text,{'color':_0x32fc55(0x181),'children':'*\x20'}),a4_0x2acc7a(Text,{'color':_0x32fc55(0x185),'children':'lovrabet\x20auth'}),a4_0x44533f(Text,{'color':'yellow','children':['\x20',_0x4683be('api.common.authRetry')]})]})]})]});};
@@ -1 +1 @@
1
- const a5_0x3b1347=a5_0xff52;(function(_0x13d58b,_0x39f814){const _0x1a97d=a5_0xff52,_0x1e1a17=_0x13d58b();while(!![]){try{const _0x48c327=parseInt(_0x1a97d(0x95))/0x1+-parseInt(_0x1a97d(0xa4))/0x2+parseInt(_0x1a97d(0x99))/0x3+-parseInt(_0x1a97d(0x9a))/0x4*(parseInt(_0x1a97d(0x8a))/0x5)+-parseInt(_0x1a97d(0x97))/0x6*(parseInt(_0x1a97d(0x8d))/0x7)+parseInt(_0x1a97d(0xa8))/0x8*(parseInt(_0x1a97d(0x9b))/0x9)+-parseInt(_0x1a97d(0xa1))/0xa*(-parseInt(_0x1a97d(0x98))/0xb);if(_0x48c327===_0x39f814)break;else _0x1e1a17['push'](_0x1e1a17['shift']());}catch(_0x2c6953){_0x1e1a17['push'](_0x1e1a17['shift']());}}}(a5_0xd808,0xc2421));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';import a5_0x4105f6 from'../i18n/index.js';const t=a5_0x4105f6['t'][a5_0x3b1347(0x92)](a5_0x4105f6);function a5_0xff52(_0xf00342,_0x4771a6){_0xf00342=_0xf00342-0x88;const _0xd8085b=a5_0xd808();let _0xff5232=_0xd8085b[_0xf00342];return _0xff5232;}function a5_0xd808(){const _0x2c1bf3=['errorMsg','trim','&otype=array','bind','data','api.fetchModel.fetchError','678311GwpFag','length','344262MvppIP','6358ewTiUu','909072ufOmxc','1444bIayJE','9ncvRsP','message','正在从服务器拉取模型列表...\x20(环境:\x20','json','includes','map','13610jAafaA','Unauthorized','error','822946YaMOmz','success','replace','api.common.authExpired','4994136InpGFp','code','info','status','name','configArray','1315BXZVVI','fetch-model-list','/api/node-toolbox/dataset/model-list?appcode=','133MilFzJ','401'];a5_0xd808=function(){return _0x2c1bf3;};return a5_0xd808();}function cleanNewlines(_0x229d30){const _0x18ee70=a5_0x3b1347;return _0x229d30[_0x18ee70(0xa6)](/[\r\n]+/g,'\x20')[_0x18ee70(0x90)]();}function cleanDatasetName(_0x9c5e6a){const _0x7a3719=a5_0x3b1347;if(!_0x9c5e6a[_0x7a3719(0x88)])return _0x9c5e6a;return{..._0x9c5e6a,'name':cleanNewlines(_0x9c5e6a['name'])};}function cleanDatasetNames(_0x3a0011){const _0x2a23a7=a5_0x3b1347;return _0x3a0011[_0x2a23a7(0xa0)](cleanDatasetName);}export async function fetchModelList(_0x73b36b){const _0x30b8eb=a5_0x3b1347,_0x2962d7=getEnv(),_0x3a37e0=getApiDomain()+_0x30b8eb(0x8c)+_0x73b36b+_0x30b8eb(0x91);logger[_0x30b8eb(0xaa)](_0x30b8eb(0x8b),_0x30b8eb(0x9d)+_0x2962d7+')',{'apiUrl':_0x3a37e0});const _0x3b6384=await fetch(_0x3a37e0,{'headers':{'Cookie':getCookie()}});if(!_0x3b6384['ok']){if(_0x3b6384[_0x30b8eb(0xab)]===0x191)throw new Error(t(_0x30b8eb(0xa7)));throw new Error(t('api.fetchModel.httpError',{'status':_0x3b6384['status']}));}const _0x59f246=await _0x3b6384[_0x30b8eb(0x9e)]();if(!_0x59f246[_0x30b8eb(0xa5)]){const _0x283f8c=_0x59f246[_0x30b8eb(0x8f)]||_0x59f246[_0x30b8eb(0x9c)]||_0x59f246[_0x30b8eb(0x93)]?.['message']||_0x59f246['errorMessage']||_0x59f246[_0x30b8eb(0xa3)]||t('api.common.unknownError');if(_0x283f8c['includes'](_0x30b8eb(0x8e))||_0x283f8c[_0x30b8eb(0x9f)](_0x30b8eb(0xa2))||_0x283f8c[_0x30b8eb(0x9f)]('登录')||_0x283f8c[_0x30b8eb(0x9f)]('认证')||_0x59f246['errorCode']==='UNAUTHORIZED'||_0x59f246[_0x30b8eb(0xa9)]===0x191||_0x59f246[_0x30b8eb(0xa9)]===_0x30b8eb(0x8e))throw new Error(t('api.common.authExpired'));throw new Error(t(_0x30b8eb(0x94),{'error':_0x283f8c}));}const _0x524ffa=cleanDatasetNames(_0x59f246['data'][_0x30b8eb(0x89)]);return{'configArray':_0x524ffa,'count':_0x524ffa[_0x30b8eb(0x96)]};}
1
+ const a5_0x43bf27=a5_0x5db6;(function(_0x36c366,_0x4d6e6d){const _0x583794=a5_0x5db6,_0x5c0161=_0x36c366();while(!![]){try{const _0x1b120a=-parseInt(_0x583794(0x167))/0x1+-parseInt(_0x583794(0x15d))/0x2*(-parseInt(_0x583794(0x171))/0x3)+parseInt(_0x583794(0x170))/0x4*(-parseInt(_0x583794(0x159))/0x5)+parseInt(_0x583794(0x176))/0x6*(-parseInt(_0x583794(0x16b))/0x7)+-parseInt(_0x583794(0x15c))/0x8*(parseInt(_0x583794(0x175))/0x9)+-parseInt(_0x583794(0x177))/0xa*(parseInt(_0x583794(0x174))/0xb)+parseInt(_0x583794(0x16e))/0xc;if(_0x1b120a===_0x4d6e6d)break;else _0x5c0161['push'](_0x5c0161['shift']());}catch(_0x3377f4){_0x5c0161['push'](_0x5c0161['shift']());}}}(a5_0x169d,0x2405d));function a5_0x5db6(_0x4c2b59,_0x21e7fd){_0x4c2b59=_0x4c2b59-0x157;const _0x169d2b=a5_0x169d();let _0x5db673=_0x169d2b[_0x4c2b59];return _0x5db673;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';import a5_0x4d31b2 from'../i18n/index.js';function a5_0x169d(){const _0x4a16c2=['92MEyTfS','message','errorMessage','fetch-model-list','Unauthorized','401','api.fetchModel.fetchError','replace','error','/api/node-toolbox/dataset/model-list?appcode=','285491kiDGgw','bind','code','name','95802xmSglM','data','errorMsg','9557040AnArwF','trim','825788IUMdAI','4686wmpqVr','configArray','api.fetchModel.httpError','66epCQXY','9AxZTvM','36esEfIG','208750TKTVgG','正在从服务器拉取模型列表...\x20(环境:\x20','includes','length','map','5rLAsUg','api.common.unknownError','json','171352DmPHBI'];a5_0x169d=function(){return _0x4a16c2;};return a5_0x169d();}const t=a5_0x4d31b2['t'][a5_0x43bf27(0x168)](a5_0x4d31b2);function cleanNewlines(_0x516e9e){const _0x2c866a=a5_0x43bf27;return _0x516e9e[_0x2c866a(0x164)](/[\r\n]+/g,'\x20')[_0x2c866a(0x16f)]();}function cleanDatasetName(_0x34eb64){const _0xacf230=a5_0x43bf27;if(!_0x34eb64[_0xacf230(0x16a)])return _0x34eb64;return{..._0x34eb64,'name':cleanNewlines(_0x34eb64['name'])};}function cleanDatasetNames(_0x28d026){const _0x21b630=a5_0x43bf27;return _0x28d026[_0x21b630(0x158)](cleanDatasetName);}export async function fetchModelList(_0x654d78){const _0x558bc7=a5_0x43bf27,_0x13b73e=getEnv(),_0x1c4022=getApiDomain()+_0x558bc7(0x166)+_0x654d78+'&otype=array';logger['info'](_0x558bc7(0x160),_0x558bc7(0x178)+_0x13b73e+')',{'apiUrl':_0x1c4022});const _0x1e33c3=await fetch(_0x1c4022,{'headers':{'Cookie':getCookie()}});if(!_0x1e33c3['ok']){if(_0x1e33c3['status']===0x191)throw new Error(t('api.common.authExpired'));throw new Error(t(_0x558bc7(0x173),{'status':_0x1e33c3['status']}));}const _0x341c55=await _0x1e33c3[_0x558bc7(0x15b)]();if(!_0x341c55['success']){const _0x4cc4d8=_0x341c55[_0x558bc7(0x16d)]||_0x341c55['message']||_0x341c55[_0x558bc7(0x16c)]?.[_0x558bc7(0x15e)]||_0x341c55[_0x558bc7(0x15f)]||_0x341c55[_0x558bc7(0x165)]||t(_0x558bc7(0x15a));if(_0x4cc4d8[_0x558bc7(0x179)](_0x558bc7(0x162))||_0x4cc4d8[_0x558bc7(0x179)](_0x558bc7(0x161))||_0x4cc4d8[_0x558bc7(0x179)]('登录')||_0x4cc4d8[_0x558bc7(0x179)]('认证')||_0x341c55['errorCode']==='UNAUTHORIZED'||_0x341c55[_0x558bc7(0x169)]===0x191||_0x341c55['code']===_0x558bc7(0x162))throw new Error(t('api.common.authExpired'));throw new Error(t(_0x558bc7(0x163),{'error':_0x4cc4d8}));}const _0x3a9708=cleanDatasetNames(_0x341c55[_0x558bc7(0x16c)][_0x558bc7(0x172)]);return{'configArray':_0x3a9708,'count':_0x3a9708[_0x558bc7(0x157)]};}
@@ -1 +1 @@
1
- const a6_0x2346c4=a6_0x94aa;(function(_0x266252,_0x2c57af){const _0x1fac72=a6_0x94aa,_0xf61616=_0x266252();while(!![]){try{const _0x3db966=parseInt(_0x1fac72(0x1fe))/0x1*(-parseInt(_0x1fac72(0x1fd))/0x2)+parseInt(_0x1fac72(0x21a))/0x3*(parseInt(_0x1fac72(0x20a))/0x4)+parseInt(_0x1fac72(0x1ff))/0x5+parseInt(_0x1fac72(0x217))/0x6+-parseInt(_0x1fac72(0x1f4))/0x7+parseInt(_0x1fac72(0x219))/0x8*(-parseInt(_0x1fac72(0x209))/0x9)+parseInt(_0x1fac72(0x20d))/0xa*(parseInt(_0x1fac72(0x216))/0xb);if(_0x3db966===_0x2c57af)break;else _0xf61616['push'](_0xf61616['shift']());}catch(_0x2629dc){_0xf61616['push'](_0xf61616['shift']());}}}(a6_0x23af,0xe96fb));import a6_0x4b173e from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a6_0x367f59 from'node:path';import{fileURLToPath}from'node:url';function a6_0x94aa(_0x386be8,_0x174b7c){_0x386be8=_0x386be8-0x1f2;const _0x23af95=a6_0x23af();let _0x94aa7=_0x23af95[_0x386be8];return _0x94aa7;}import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a6_0x23af(){const _0x390294=['format','utf8','slice','5405932Ibqbot','-client','templates/generate-api','resolve','CONFIG_NAMES.DEFAULT','forEach','alias','api','key','28wfiUPo','61865fODfaV','8146185MJBvbL','endsWith','-api','string','client.ts.tpl','api.generateFile.noAppCode','.ts','{\x20apiConfigName:\x20','replaceApiContent','app','14803110ABMTEj','316sGOxnV','\x22\x20}','../..','15000xUAJPT','init-api','join','API\x20文件生成成功!','length','push','typescript','tableName','name','12485tEBPFx','619296BpwHBf','{\x20apiConfigName:\x20\x22','8zrIqOl','30546yPIUJS',',\x20env:\x20\x22','datasetCode','bind','online','./src/api/'];a6_0x23af=function(){return _0x390294;};return a6_0x23af();}import{logger}from'../utils/logger.js';import a6_0x1dcd01 from'../i18n/index.js';const t=a6_0x1dcd01['t'][a6_0x2346c4(0x21d)](a6_0x1dcd01);export async function generateApiFile(_0x483d51,_0x17064f='',_0x4abdb3,_0x45e95b=![],_0x448d8f,_0x59faa2=a6_0x2346c4(0x21f)){const _0x4320be=a6_0x2346c4,_0x1ba773=readConfig(),_0x340a30=_0x4abdb3||_0x1ba773?.[_0x4320be(0x208)];if(typeof _0x340a30!=='string'||!_0x340a30)throw new Error(t(_0x4320be(0x204)));const _0xa6e6c8=_0x45e95b?_0x4320be(0x1f8):'\x22'+_0x340a30+'\x22',_0x5112c0=typeof _0x1ba773['env']===_0x4320be(0x202)?_0x1ba773['env']:undefined,_0x39d736=_0x448d8f||_0x5112c0||'online',_0x3f37b9=_0x39d736!==_0x4320be(0x21e);let _0x3a2c13;if(_0x45e95b)_0x3f37b9?_0x3a2c13=_0x4320be(0x206)+_0xa6e6c8+_0x4320be(0x21b)+_0x39d736+_0x4320be(0x20b):_0x3a2c13='';else{const _0x2cf546=_0x3f37b9?',\x20env:\x20\x22'+_0x39d736+'\x22':'';_0x3a2c13=_0x4320be(0x218)+_0x340a30+'\x22'+_0x2cf546+'\x20}';}const _0x1f81ca=_0x17064f?_0x17064f+_0x4320be(0x201):_0x4320be(0x1fb),_0x4a808a=_0x17064f?_0x17064f+_0x4320be(0x1f5):'client',_0x2fedb5=[];_0x483d51[_0x4320be(0x1f9)](_0x2c6251=>{const _0x5981ef=_0x4320be;_0x2fedb5[_0x5981ef(0x212)]({'datasetCode':_0x2c6251[_0x5981ef(0x21c)],'tableName':_0x2c6251[_0x5981ef(0x214)],'name':_0x2c6251[_0x5981ef(0x215)]||'','alias':_0x2c6251[_0x5981ef(0x1fa)]||_0x2c6251[_0x5981ef(0x1fc)]});});const _0xcd58a7=fileURLToPath(import.meta.url),_0xc21130=a6_0x367f59[_0x4320be(0x1f7)](a6_0x367f59['dirname'](_0xcd58a7),_0x4320be(0x20c)),_0x5ed34c=a6_0x367f59['join'](_0xc21130,_0x4320be(0x1f6)),_0x3e4bc4=a6_0x367f59[_0x4320be(0x20f)](_0x5ed34c,'api.ts.tpl'),_0x38cf51=a6_0x367f59[_0x4320be(0x20f)](_0x5ed34c,_0x4320be(0x203)),_0x2d3928=_0x59faa2[_0x4320be(0x200)]('/')?_0x59faa2[_0x4320be(0x1f3)](0x0,-0x1):_0x59faa2;mkdirSync(_0x2d3928,{'recursive':!![]});const _0x2c0a2f=_0x2fedb5[0x0]?.[_0x4320be(0x1fa)],_0x1f53e0=readFileSync(_0x3e4bc4,_0x4320be(0x1f2)),_0x5d92d9=TemplateReplacer[_0x4320be(0x207)](_0x1f53e0,_0x340a30,_0x2fedb5,_0x2c0a2f,_0x1f81ca,_0xa6e6c8),_0xcb72f9=await a6_0x4b173e[_0x4320be(0x220)](_0x5d92d9,{'parser':_0x4320be(0x213)}),_0x330549=_0x2d3928+'/'+_0x1f81ca+_0x4320be(0x205);writeFileSync(_0x330549,_0xcb72f9,{'encoding':_0x4320be(0x1f2)});const _0x376843=readFileSync(_0x38cf51,_0x4320be(0x1f2)),_0x47d21c=TemplateReplacer[_0x4320be(0x207)](_0x376843,_0x340a30,_0x2fedb5,_0x2c0a2f,_0x1f81ca,_0xa6e6c8,_0x3a2c13),_0x21f2cb=await a6_0x4b173e[_0x4320be(0x220)](_0x47d21c,{'parser':'typescript'}),_0x39b0a9=_0x2d3928+'/'+_0x4a808a+_0x4320be(0x205);writeFileSync(_0x39b0a9,_0x21f2cb,{'encoding':_0x4320be(0x1f2)});const _0x289e48=_0x2fedb5[_0x4320be(0x211)];return logger['success'](_0x4320be(0x20e),_0x4320be(0x210),undefined,{'apiFile':_0x330549,'clientFile':_0x39b0a9,'modelCount':_0x289e48,'configName':_0xa6e6c8}),{'modelCount':_0x289e48,'apiFilePath':_0x330549,'clientFilePath':_0x39b0a9,'configName':_0xa6e6c8};}
1
+ const a6_0x5ba96b=a6_0x353d;(function(_0x2ac78f,_0x40f469){const _0x184e1a=a6_0x353d,_0x3c858f=_0x2ac78f();while(!![]){try{const _0x169b90=parseInt(_0x184e1a(0xf9))/0x1*(parseInt(_0x184e1a(0xef))/0x2)+parseInt(_0x184e1a(0xf4))/0x3+-parseInt(_0x184e1a(0x110))/0x4*(parseInt(_0x184e1a(0xfe))/0x5)+-parseInt(_0x184e1a(0xee))/0x6*(parseInt(_0x184e1a(0xff))/0x7)+-parseInt(_0x184e1a(0x109))/0x8*(-parseInt(_0x184e1a(0x10b))/0x9)+-parseInt(_0x184e1a(0xed))/0xa+parseInt(_0x184e1a(0xf7))/0xb*(parseInt(_0x184e1a(0xf1))/0xc);if(_0x169b90===_0x40f469)break;else _0x3c858f['push'](_0x3c858f['shift']());}catch(_0x4f8046){_0x3c858f['push'](_0x3c858f['shift']());}}}(a6_0x4390,0xb0ea0));import a6_0x292336 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a6_0x4b32d0 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a6_0x353d(_0x2fc79a,_0x17707a){_0x2fc79a=_0x2fc79a-0xec;const _0x4390ae=a6_0x4390();let _0x353d9a=_0x4390ae[_0x2fc79a];return _0x353d9a;}import{logger}from'../utils/logger.js';import a6_0x1dd844 from'../i18n/index.js';function a6_0x4390(){const _0x262ae6=['alias','utf8','string','./src/api/','resolve',',\x20env:\x20\x22','API\x20文件生成成功!','env','templates/generate-api','5121968eIUsvy','../..','9GiPrMk','join','bind','tableName','typescript','16xQSdBX','datasetCode','push','key','success','.ts','app','\x22\x20}','8119210nQKhxB','6rBZrrz','2BWVkfa','{\x20apiConfigName:\x20\x22','2967276jcGkOp','length','init-api','2553453eEjSAU','dirname','format','11cFSDvR','api.ts.tpl','1021586URGRhJ','{\x20apiConfigName:\x20','-api','online','client.ts.tpl','1356385BPJRuG','970109RscIVt'];a6_0x4390=function(){return _0x262ae6;};return a6_0x4390();}const t=a6_0x1dd844['t'][a6_0x5ba96b(0x10d)](a6_0x1dd844);export async function generateApiFile(_0x213266,_0x14f243='',_0xdcded4,_0x573e7a=![],_0x5501c5,_0x181336=a6_0x5ba96b(0x103)){const _0x45ae61=a6_0x5ba96b,_0xc40299=readConfig(),_0x1cea79=_0xdcded4||_0xc40299?.[_0x45ae61(0x116)];if(typeof _0x1cea79!==_0x45ae61(0x102)||!_0x1cea79)throw new Error(t('api.generateFile.noAppCode'));const _0x4b5f3f=_0x573e7a?'CONFIG_NAMES.DEFAULT':'\x22'+_0x1cea79+'\x22',_0x578eb7=typeof _0xc40299['env']===_0x45ae61(0x102)?_0xc40299[_0x45ae61(0x107)]:undefined,_0x47c654=_0x5501c5||_0x578eb7||_0x45ae61(0xfc),_0x119726=_0x47c654!==_0x45ae61(0xfc);let _0x34ab1b;if(_0x573e7a)_0x119726?_0x34ab1b=_0x45ae61(0xfa)+_0x4b5f3f+_0x45ae61(0x105)+_0x47c654+_0x45ae61(0xec):_0x34ab1b='';else{const _0x1425df=_0x119726?_0x45ae61(0x105)+_0x47c654+'\x22':'';_0x34ab1b=_0x45ae61(0xf0)+_0x1cea79+'\x22'+_0x1425df+'\x20}';}const _0x5ecf98=_0x14f243?_0x14f243+_0x45ae61(0xfb):'api',_0xc91874=_0x14f243?_0x14f243+'-client':'client',_0x24216a=[];_0x213266['forEach'](_0x4e5ef2=>{const _0x474b22=_0x45ae61;_0x24216a[_0x474b22(0x112)]({'datasetCode':_0x4e5ef2[_0x474b22(0x111)],'tableName':_0x4e5ef2[_0x474b22(0x10e)],'name':_0x4e5ef2['name']||'','alias':_0x4e5ef2[_0x474b22(0x100)]||_0x4e5ef2[_0x474b22(0x113)]});});const _0x6aab95=fileURLToPath(import.meta.url),_0x130a48=a6_0x4b32d0[_0x45ae61(0x104)](a6_0x4b32d0[_0x45ae61(0xf5)](_0x6aab95),_0x45ae61(0x10a)),_0x42fe89=a6_0x4b32d0[_0x45ae61(0x10c)](_0x130a48,_0x45ae61(0x108)),_0x266ea5=a6_0x4b32d0['join'](_0x42fe89,_0x45ae61(0xf8)),_0x1b2240=a6_0x4b32d0[_0x45ae61(0x10c)](_0x42fe89,_0x45ae61(0xfd)),_0x384e6e=_0x181336['endsWith']('/')?_0x181336['slice'](0x0,-0x1):_0x181336;mkdirSync(_0x384e6e,{'recursive':!![]});const _0x298037=_0x24216a[0x0]?.[_0x45ae61(0x100)],_0x32271d=readFileSync(_0x266ea5,_0x45ae61(0x101)),_0x92378f=TemplateReplacer['replaceApiContent'](_0x32271d,_0x1cea79,_0x24216a,_0x298037,_0x5ecf98,_0x4b5f3f),_0x19ea64=await a6_0x292336[_0x45ae61(0xf6)](_0x92378f,{'parser':_0x45ae61(0x10f)}),_0x5ebbaa=_0x384e6e+'/'+_0x5ecf98+_0x45ae61(0x115);writeFileSync(_0x5ebbaa,_0x19ea64,{'encoding':_0x45ae61(0x101)});const _0x46e5d1=readFileSync(_0x1b2240,'utf8'),_0x16d2fc=TemplateReplacer['replaceApiContent'](_0x46e5d1,_0x1cea79,_0x24216a,_0x298037,_0x5ecf98,_0x4b5f3f,_0x34ab1b),_0x57b364=await a6_0x292336[_0x45ae61(0xf6)](_0x16d2fc,{'parser':'typescript'}),_0x405aa1=_0x384e6e+'/'+_0xc91874+_0x45ae61(0x115);writeFileSync(_0x405aa1,_0x57b364,{'encoding':_0x45ae61(0x101)});const _0xbf5806=_0x24216a[_0x45ae61(0xf2)];return logger[_0x45ae61(0x114)](_0x45ae61(0xf3),_0x45ae61(0x106),undefined,{'apiFile':_0x5ebbaa,'clientFile':_0x405aa1,'modelCount':_0xbf5806,'configName':_0x4b5f3f}),{'modelCount':_0xbf5806,'apiFilePath':_0x5ebbaa,'clientFilePath':_0x405aa1,'configName':_0x4b5f3f};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x38f540,_0x5c24a7){const _0x2ea1ff=a7_0x3029,_0x2e2ad9=_0x38f540();while(!![]){try{const _0x1186c1=parseInt(_0x2ea1ff(0x1a7))/0x1*(-parseInt(_0x2ea1ff(0x1c9))/0x2)+-parseInt(_0x2ea1ff(0x1c2))/0x3+parseInt(_0x2ea1ff(0x1e3))/0x4+-parseInt(_0x2ea1ff(0x1c3))/0x5*(-parseInt(_0x2ea1ff(0x1d2))/0x6)+parseInt(_0x2ea1ff(0x1e5))/0x7+parseInt(_0x2ea1ff(0x1a1))/0x8+-parseInt(_0x2ea1ff(0x1ca))/0x9;if(_0x1186c1===_0x5c24a7)break;else _0x2e2ad9['push'](_0x2e2ad9['shift']());}catch(_0x279c6b){_0x2e2ad9['push'](_0x2e2ad9['shift']());}}}(a7_0x4a52,0x3cde8));import{jsx as a7_0x4a645a}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';import a7_0x287aae from'../i18n/index.js';function a7_0x3029(_0x3d8719,_0x3afc83){_0x3d8719=_0x3d8719-0x197;const _0x4a5234=a7_0x4a52();let _0x302971=_0x4a5234[_0x3d8719];return _0x302971;}function a7_0x4a52(){const _0x3cc92d=['\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20','api.common.usingConfigAppCode','\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20','log','6BTcGrP','filter','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.paramsInvalidJson','pull','string','api.help.optDatasetcode','split','datasetcode','exit','doc','api.help.options','api.help.examples','error','api.help.pullEnv','\x1b[0m','object','1118904hRLqOR','api.help.docEnv','905856VFGLli','api.help.pullDesc','api.help.pullAppcode','api.common.useAppcodeFlag','api.common.noAppCode','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','output','api.common.noAppCodeOption2Doc','api.help.optAppcode','\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','api.common.paramsNotJson','\x1b[90m','api.common.noAppCodeHint','3374968LCFTRb','api.help.title','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20','api.help.usage','isArray','\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','48079hKrcgT','api.help.docDesc','map','\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','api.help.unknownCommand','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','help','api.help.availableCommands','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20','input','join','api.help.docAppcode','\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','\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','\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','api.help.optEnv','api.common.onlyGenerateDatasets','api.help.optHelp','api.common.paramsError','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20','length','api.common.noAppCodeOption2Pull','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a','api.common.noAppCodeOption1','trim','972606jaTlxr','975605bQdKpX','\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','api.help.optOutput','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\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','api.common.noPositionalArgs','8fDrNbM','2342592JaIfaA','flags','api.common.usingConfigAppCodeHint','env'];a7_0x4a52=function(){return _0x3cc92d;};return a7_0x4a52();}const t=a7_0x287aae['t']['bind'](a7_0x287aae);export async function apiCli(_0x3a38f5){const _0x362bbc=a7_0x3029,_0xe46684=_0x3a38f5[_0x362bbc(0x1b1)][0x1];if(_0x3a38f5[_0x362bbc(0x1cb)][_0x362bbc(0x1ae)]){console[_0x362bbc(0x1d1)]('\x0a'+t(_0x362bbc(0x1a2))+'\x0a\x0a'+t(_0x362bbc(0x1a4))+_0x362bbc(0x1bf)+t(_0x362bbc(0x1dd))+'\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20'+t(_0x362bbc(0x19c))+_0x362bbc(0x1d0)+t(_0x362bbc(0x1c5))+_0x362bbc(0x1c4)+t(_0x362bbc(0x1b7))+'\x0a\x20\x20--datasetcode\x20<codes>\x20'+t(_0x362bbc(0x1d8))+_0x362bbc(0x1aa)+t(_0x362bbc(0x1b9))+'\x0a\x0a'+t(_0x362bbc(0x1de))+'\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'+t(_0x362bbc(0x1e6))+_0x362bbc(0x1d4)+t(_0x362bbc(0x1e7))+_0x362bbc(0x1bc)+t('api.help.pullOutput')+_0x362bbc(0x1c7)+t('api.help.pullEnv')+_0x362bbc(0x19d)+t('api.help.docDesc')+_0x362bbc(0x1b5)+t('api.help.docAppcode')+'\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'+t('api.help.docOutput')+_0x362bbc(0x1a6)+t(_0x362bbc(0x1e4))+_0x362bbc(0x199)+t('api.help.docDataset')+_0x362bbc(0x1ce)+t('api.help.docDatasets')+'\x0a');return;}if(_0xe46684===_0x362bbc(0x1d6)){_0x3a38f5[_0x362bbc(0x1b1)][0x2]&&(console[_0x362bbc(0x1df)](t(_0x362bbc(0x1c8))),console[_0x362bbc(0x1d1)](t('api.common.useAppcodeFlag')),console['log']('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x3a38f5[_0x362bbc(0x1b1)][0x2]),process[_0x362bbc(0x1db)](0x1));const _0x5868b6=getConfigAppCode();let _0x5046b2=_0x3a38f5[_0x362bbc(0x1cb)]['appcode'];const _0x24f99b=typeof _0x3a38f5['flags'][_0x362bbc(0x1cd)]===_0x362bbc(0x1d7)?_0x3a38f5[_0x362bbc(0x1cb)][_0x362bbc(0x1cd)]:undefined,_0x144775=_0x3a38f5[_0x362bbc(0x1cb)]['output'];!_0x5046b2&&!_0x5868b6&&(console['error'](t(_0x362bbc(0x198))),console['log'](t(_0x362bbc(0x1a0))),console[_0x362bbc(0x1d1)](t(_0x362bbc(0x1c0))),console[_0x362bbc(0x1d1)](t(_0x362bbc(0x1be))),process[_0x362bbc(0x1db)](0x1)),_0x5046b2&&_0x5868b6&&_0x5046b2===_0x5868b6&&(console[_0x362bbc(0x1d1)](_0x362bbc(0x19f)+t('api.common.usingConfigAppCode',{'appCode':_0x5046b2})+_0x362bbc(0x1e1)),console[_0x362bbc(0x1d1)]('\x1b[90m'+t(_0x362bbc(0x1cc))+_0x362bbc(0x1e1)),_0x5046b2=undefined),render(a7_0x4a645a(ApiPullUI,{'appCode':_0x5046b2,'env':_0x24f99b,'output':_0x144775}));}else{if(_0xe46684===_0x362bbc(0x1dc)){_0x3a38f5[_0x362bbc(0x1b1)][0x2]&&(console[_0x362bbc(0x1df)](t(_0x362bbc(0x1c8))),console[_0x362bbc(0x1d1)](t(_0x362bbc(0x197))),console['log'](_0x362bbc(0x1bb)+_0x3a38f5[_0x362bbc(0x1b1)][0x2]),process['exit'](0x1));const _0x3f0d40=getConfigAppCode();let _0x3fb098=_0x3a38f5[_0x362bbc(0x1cb)]['appcode'];const _0x5bb8b2=typeof _0x3a38f5[_0x362bbc(0x1cb)][_0x362bbc(0x1cd)]===_0x362bbc(0x1d7)?_0x3a38f5['flags'][_0x362bbc(0x1cd)]:undefined,_0x3a56a4=_0x3a38f5[_0x362bbc(0x1cb)][_0x362bbc(0x19a)],_0xc53815=_0x3a38f5[_0x362bbc(0x1cb)]['params'],_0x50b60c=_0x3a38f5[_0x362bbc(0x1cb)][_0x362bbc(0x1da)];!_0x3fb098&&!_0x3f0d40&&(console[_0x362bbc(0x1df)](t(_0x362bbc(0x198))),console['log'](t('api.common.noAppCodeHint')),console[_0x362bbc(0x1d1)](t(_0x362bbc(0x1c0))),console['log'](t(_0x362bbc(0x19b))),process['exit'](0x1));_0x3fb098&&_0x3f0d40&&_0x3fb098===_0x3f0d40&&(console['log'](_0x362bbc(0x19f)+t(_0x362bbc(0x1cf),{'appCode':_0x3fb098})+_0x362bbc(0x1e1)),_0x3fb098=undefined);let _0x3b09c3;if(_0xc53815)try{_0x3b09c3=JSON['parse'](_0xc53815),(typeof _0x3b09c3!==_0x362bbc(0x1e2)||_0x3b09c3===null||Array[_0x362bbc(0x1a5)](_0x3b09c3))&&(console[_0x362bbc(0x1df)](t(_0x362bbc(0x1d5))),process[_0x362bbc(0x1db)](0x1));}catch(_0xe522f6){console['error'](t(_0x362bbc(0x19e))),console[_0x362bbc(0x1df)](t(_0x362bbc(0x1ba),{'error':_0xe522f6 instanceof Error?_0xe522f6['message']:String(_0xe522f6)})),process[_0x362bbc(0x1db)](0x1);}let _0x6321d3;_0x50b60c&&(_0x6321d3=_0x50b60c[_0x362bbc(0x1d9)](',')[_0x362bbc(0x1a9)](_0x34044d=>_0x34044d[_0x362bbc(0x1c1)]())[_0x362bbc(0x1d3)](_0x37078b=>_0x37078b[_0x362bbc(0x1bd)]>0x0),_0x6321d3[_0x362bbc(0x1bd)]===0x0&&(console['error'](t('api.common.datasetcodeEmpty')),process[_0x362bbc(0x1db)](0x1)),console[_0x362bbc(0x1d1)](_0x362bbc(0x19f)+t(_0x362bbc(0x1b8),{'codes':_0x6321d3[_0x362bbc(0x1b2)](',\x20')})+_0x362bbc(0x1e1))),render(a7_0x4a645a(ApiDocUI,{'appCode':_0x3fb098,'env':_0x5bb8b2,'output':_0x3a56a4,'extraParams':_0x3b09c3,'datasetCodes':_0x6321d3}));}else console[_0x362bbc(0x1df)](t(_0x362bbc(0x1ab))+':\x20'+_0xe46684),console[_0x362bbc(0x1d1)](t(_0x362bbc(0x1af))),console[_0x362bbc(0x1d1)](_0x362bbc(0x1b4)+t(_0x362bbc(0x1e6))),console[_0x362bbc(0x1d1)](_0x362bbc(0x1a3)+t(_0x362bbc(0x1e7))),console['log'](_0x362bbc(0x1b0)+t('api.help.pullOutput')),console['log'](_0x362bbc(0x1ac)+t(_0x362bbc(0x1e0))),console[_0x362bbc(0x1d1)](''),console[_0x362bbc(0x1d1)](_0x362bbc(0x1b6)+t(_0x362bbc(0x1a8))),console[_0x362bbc(0x1d1)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x362bbc(0x1b3))),console[_0x362bbc(0x1d1)](_0x362bbc(0x1ad)+t('api.help.docOutput')),console[_0x362bbc(0x1d1)](_0x362bbc(0x1c6)+t(_0x362bbc(0x1e4))),process[_0x362bbc(0x1db)](0x1);}}
1
+ const a7_0x5245dc=a7_0x3db9;(function(_0x4e8d30,_0x4e7bed){const _0x23ff5f=a7_0x3db9,_0x4a5d63=_0x4e8d30();while(!![]){try{const _0x8a33cf=-parseInt(_0x23ff5f(0xb7))/0x1+-parseInt(_0x23ff5f(0xce))/0x2+-parseInt(_0x23ff5f(0xe7))/0x3+parseInt(_0x23ff5f(0xf6))/0x4+parseInt(_0x23ff5f(0xda))/0x5+-parseInt(_0x23ff5f(0xc7))/0x6+parseInt(_0x23ff5f(0xc3))/0x7*(parseInt(_0x23ff5f(0xec))/0x8);if(_0x8a33cf===_0x4e7bed)break;else _0x4a5d63['push'](_0x4a5d63['shift']());}catch(_0x412fa4){_0x4a5d63['push'](_0x4a5d63['shift']());}}}(a7_0x7da6,0x9404e));import{jsx as a7_0x107df3}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a7_0x7da6(){const _0x21eb41=['\x0a\x20\x20--datasetcode\x20<codes>\x20','api.common.noAppCodeHint','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20','api.common.paramsError','702611HRpiNS','api.common.paramsNotJson','message','split','2875368eARvEr','string','api.common.usingConfigAppCode','flags','api.help.examples','api.help.usage','\x1b[0m','2330068TWpLol','api.common.noAppCodeOption1','env','api.help.docDesc','\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','api.common.noAppCodeOption2Pull','\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','log','exit','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.useAppcodeFlag','\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','2652490TIqjjR','api.help.docEnv','datasetcode','api.common.paramsInvalidJson','api.common.onlyGenerateDatasets','\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','input','api.help.optOutput','length','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20','pull','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','3019248QVhjsc','api.help.options','api.common.noAppCode','api.help.unknownCommand','\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','208nnIRVb','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.datasetcodeEmpty','api.help.docDataset','api.help.pullAppcode','api.help.availableCommands','api.help.pullOutput','api.help.docDatasets','api.common.noPositionalArgs','1034812RNMLZY','api.common.usingConfigAppCodeHint','api.help.pullEnv','api.help.optDatasetcode','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20','object','api.help.docAppcode','parse','doc','output','\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','api.common.noAppCodeOption2Doc','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x1b[90m','appcode','help','error','trim','141935ZeNvZq','filter','api.help.docOutput','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','bind','api.help.pullDesc'];a7_0x7da6=function(){return _0x21eb41;};return a7_0x7da6();}import{getConfigAppCode}from'../utils/config.js';import a7_0x41419d from'../i18n/index.js';function a7_0x3db9(_0x4b06b7,_0x56b120){_0x4b06b7=_0x4b06b7-0xb2;const _0x7da62=a7_0x7da6();let _0x3db9e8=_0x7da62[_0x4b06b7];return _0x3db9e8;}const t=a7_0x41419d['t'][a7_0x5245dc(0xbc)](a7_0x41419d);export async function apiCli(_0x16cf34){const _0x31d7b1=a7_0x5245dc,_0x1c99a7=_0x16cf34[_0x31d7b1(0xe0)][0x1];if(_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xb4)]){console['log']('\x0a'+t('api.help.title')+'\x0a\x0a'+t(_0x31d7b1(0xcc))+_0x31d7b1(0xed)+t(_0x31d7b1(0xe8))+_0x31d7b1(0xe4)+t('api.help.optAppcode')+_0x31d7b1(0xfb)+t(_0x31d7b1(0xe1))+_0x31d7b1(0xeb)+t('api.help.optEnv')+_0x31d7b1(0xbe)+t(_0x31d7b1(0xf9))+'\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+t('api.help.optHelp')+'\x0a\x0a'+t(_0x31d7b1(0xcb))+_0x31d7b1(0xd4)+t(_0x31d7b1(0xbd))+'\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x31d7b1(0xf1))+_0x31d7b1(0xd7)+t(_0x31d7b1(0xf3))+_0x31d7b1(0xe6)+t(_0x31d7b1(0xf8))+'\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'+t(_0x31d7b1(0xd1))+_0x31d7b1(0x101)+t(_0x31d7b1(0xfd))+'\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'+t(_0x31d7b1(0xb9))+_0x31d7b1(0xd9)+t(_0x31d7b1(0xdb))+_0x31d7b1(0x103)+t(_0x31d7b1(0xf0))+_0x31d7b1(0xc1)+t(_0x31d7b1(0xf4))+'\x0a');return;}if(_0x1c99a7===_0x31d7b1(0xe5)){_0x16cf34[_0x31d7b1(0xe0)][0x2]&&(console[_0x31d7b1(0xb5)](t('api.common.noPositionalArgs')),console[_0x31d7b1(0xd5)](t(_0x31d7b1(0xd8))),console[_0x31d7b1(0xd5)](_0x31d7b1(0xc0)+_0x16cf34['input'][0x2]),process[_0x31d7b1(0xd6)](0x1));const _0x22f1c8=getConfigAppCode();let _0x265f6f=_0x16cf34['flags'][_0x31d7b1(0xb3)];const _0x4ad816=typeof _0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xd0)]==='string'?_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xd0)]:undefined,_0x49d266=_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0x100)];!_0x265f6f&&!_0x22f1c8&&(console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xe9))),console[_0x31d7b1(0xd5)](t(_0x31d7b1(0xbf))),console['log'](t(_0x31d7b1(0xcf))),console[_0x31d7b1(0xd5)](t(_0x31d7b1(0xd3))),process[_0x31d7b1(0xd6)](0x1)),_0x265f6f&&_0x22f1c8&&_0x265f6f===_0x22f1c8&&(console[_0x31d7b1(0xd5)]('\x1b[90m'+t(_0x31d7b1(0xc9),{'appCode':_0x265f6f})+_0x31d7b1(0xcd)),console['log'](_0x31d7b1(0xb2)+t(_0x31d7b1(0xf7))+_0x31d7b1(0xcd)),_0x265f6f=undefined),render(a7_0x107df3(ApiPullUI,{'appCode':_0x265f6f,'env':_0x4ad816,'output':_0x49d266}));}else{if(_0x1c99a7===_0x31d7b1(0xff)){_0x16cf34[_0x31d7b1(0xe0)][0x2]&&(console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xf5))),console[_0x31d7b1(0xd5)](t(_0x31d7b1(0xd8))),console[_0x31d7b1(0xd5)](_0x31d7b1(0xbb)+_0x16cf34[_0x31d7b1(0xe0)][0x2]),process[_0x31d7b1(0xd6)](0x1));const _0x228381=getConfigAppCode();let _0x9a0265=_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xb3)];const _0x2f317a=typeof _0x16cf34[_0x31d7b1(0xca)]['env']===_0x31d7b1(0xc8)?_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xd0)]:undefined,_0x594ce2=_0x16cf34['flags'][_0x31d7b1(0x100)],_0x3f8699=_0x16cf34['flags']['params'],_0x16110d=_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xdc)];!_0x9a0265&&!_0x228381&&(console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xe9))),console['log'](t(_0x31d7b1(0xbf))),console[_0x31d7b1(0xd5)](t(_0x31d7b1(0xcf))),console['log'](t(_0x31d7b1(0x102))),process['exit'](0x1));_0x9a0265&&_0x228381&&_0x9a0265===_0x228381&&(console[_0x31d7b1(0xd5)](_0x31d7b1(0xb2)+t('api.common.usingConfigAppCode',{'appCode':_0x9a0265})+_0x31d7b1(0xcd)),_0x9a0265=undefined);let _0x40614f;if(_0x3f8699)try{_0x40614f=JSON[_0x31d7b1(0xfe)](_0x3f8699),(typeof _0x40614f!==_0x31d7b1(0xfc)||_0x40614f===null||Array['isArray'](_0x40614f))&&(console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xdd))),process[_0x31d7b1(0xd6)](0x1));}catch(_0xd06454){console['error'](t(_0x31d7b1(0xc4))),console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xc2),{'error':_0xd06454 instanceof Error?_0xd06454[_0x31d7b1(0xc5)]:String(_0xd06454)})),process[_0x31d7b1(0xd6)](0x1);}let _0x4edd72;_0x16110d&&(_0x4edd72=_0x16110d[_0x31d7b1(0xc6)](',')['map'](_0x19135a=>_0x19135a[_0x31d7b1(0xb6)]())[_0x31d7b1(0xb8)](_0x2163b4=>_0x2163b4[_0x31d7b1(0xe2)]>0x0),_0x4edd72[_0x31d7b1(0xe2)]===0x0&&(console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xef))),process[_0x31d7b1(0xd6)](0x1)),console[_0x31d7b1(0xd5)](_0x31d7b1(0xb2)+t(_0x31d7b1(0xde),{'codes':_0x4edd72['join'](',\x20')})+_0x31d7b1(0xcd))),render(a7_0x107df3(ApiDocUI,{'appCode':_0x9a0265,'env':_0x2f317a,'output':_0x594ce2,'extraParams':_0x40614f,'datasetCodes':_0x4edd72}));}else console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xea))+':\x20'+_0x1c99a7),console['log'](t(_0x31d7b1(0xf2))),console[_0x31d7b1(0xd5)](_0x31d7b1(0xdf)+t(_0x31d7b1(0xbd))),console[_0x31d7b1(0xd5)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20'+t('api.help.pullAppcode')),console[_0x31d7b1(0xd5)](_0x31d7b1(0xba)+t(_0x31d7b1(0xf3))),console[_0x31d7b1(0xd5)](_0x31d7b1(0xe3)+t(_0x31d7b1(0xf8))),console[_0x31d7b1(0xd5)](''),console[_0x31d7b1(0xd5)](_0x31d7b1(0xd2)+t('api.help.docDesc')),console[_0x31d7b1(0xd5)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20'+t('api.help.docAppcode')),console['log'](_0x31d7b1(0xee)+t(_0x31d7b1(0xb9))),console[_0x31d7b1(0xd5)](_0x31d7b1(0xfa)+t(_0x31d7b1(0xdb))),process[_0x31d7b1(0xd6)](0x1);}}
@@ -1 +1 @@
1
- const a8_0x119865=a8_0x3217;(function(_0x27c04a,_0x47111c){const _0x35bab4=a8_0x3217,_0x3b722f=_0x27c04a();while(!![]){try{const _0x56eb69=-parseInt(_0x35bab4(0x11b))/0x1*(-parseInt(_0x35bab4(0x138))/0x2)+parseInt(_0x35bab4(0x130))/0x3*(parseInt(_0x35bab4(0x137))/0x4)+-parseInt(_0x35bab4(0x125))/0x5+parseInt(_0x35bab4(0x11c))/0x6*(-parseInt(_0x35bab4(0x129))/0x7)+-parseInt(_0x35bab4(0x121))/0x8+parseInt(_0x35bab4(0x12c))/0x9*(-parseInt(_0x35bab4(0x11d))/0xa)+-parseInt(_0x35bab4(0x135))/0xb*(-parseInt(_0x35bab4(0x12f))/0xc);if(_0x56eb69===_0x47111c)break;else _0x3b722f['push'](_0x3b722f['shift']());}catch(_0x506d9e){_0x3b722f['push'](_0x3b722f['shift']());}}}(a8_0x1d9d,0x9905f));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a8_0x3217(_0x5d0133,_0x33954e){_0x5d0133=_0x5d0133-0x118;const _0x1d9da6=a8_0x1d9d();let _0x3217ef=_0x1d9da6[_0x5d0133];return _0x3217ef;}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';function a8_0x1d9d(){const _0x5cd5fd=['create-api-pull','bind','2610Vlelpd','client','length','12xAGMBY','3BYqNDB','api.silent.success','error','api.silent.invalidPrefix','api.silent.error','24725283dxoLIB','api.silent.modelFileName','1003564iQIybb','46nRJsAl','trim','-api','info','chdir','log','api.silent.processing','33513KoBnPm','30xSrqAa','2030uCYRZK','string','modelCount','API\x20配置拉取异常:\x20','7972648rKwJKJ','api.silent.fetching','env','API\x20配置拉取成功:\x20','3536820QfxlcP','online','api.silent.generating','-client','1231783KIZIoV'];a8_0x1d9d=function(){return _0x5cd5fd;};return a8_0x1d9d();}import a8_0x5a255c from'../i18n/index.js';const t=a8_0x5a255c['t'][a8_0x119865(0x12b)](a8_0x5a255c);export async function pullApiSilent(_0x3b4550,_0x6298c6,_0x42ed10,_0x243f8e){const _0x422a6c=a8_0x119865;let _0x47ed03;try{const _0x1ef983=_0x6298c6?.[_0x422a6c(0x139)]()||'';if(_0x1ef983){const _0x35fd2f=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x35fd2f['test'](_0x1ef983))return console[_0x422a6c(0x132)](t(_0x422a6c(0x133))),![];}_0x42ed10&&(_0x47ed03=process['cwd'](),process[_0x422a6c(0x118)](_0x42ed10));const _0xd674f3=readConfig(),_0x3ae2c8=typeof _0xd674f3['env']===_0x422a6c(0x11e)?_0xd674f3[_0x422a6c(0x123)]:undefined,_0x513ea0=_0x243f8e||_0x3ae2c8||_0x422a6c(0x126);initEnv(_0x513ea0),console[_0x422a6c(0x119)](t(_0x422a6c(0x122),{'env':_0x513ea0}));const {configArray:_0x15d5dd}=await fetchModelList(_0x3b4550),_0xe15b16=_0x1ef983?_0x1ef983+_0x422a6c(0x13a):'api',_0x581267=_0x1ef983?_0x1ef983+_0x422a6c(0x128):_0x422a6c(0x12d);console[_0x422a6c(0x119)](t(_0x422a6c(0x127))),console[_0x422a6c(0x119)](t(_0x422a6c(0x136),{'name':_0xe15b16})),console[_0x422a6c(0x119)](t('api.silent.clientFileName',{'name':_0x581267})),console[_0x422a6c(0x119)](t(_0x422a6c(0x11a),{'count':_0x15d5dd['length']}));const _0xebf8fd=await generateApiFile(_0x15d5dd,_0x1ef983,_0x3b4550,!![],_0x513ea0);return console[_0x422a6c(0x119)](t(_0x422a6c(0x131),{'datasetCount':_0x15d5dd[_0x422a6c(0x12e)],'modelCount':_0xebf8fd[_0x422a6c(0x11f)]})),_0x42ed10&&logger[_0x422a6c(0x13b)](_0x422a6c(0x12a),_0x422a6c(0x124)+_0x3b4550,{'projectPath':_0x42ed10,'appCode':_0x3b4550,'datasetCount':_0x15d5dd['length'],'filePrefix':_0x1ef983}),!![];}catch(_0x320d76){const _0x28870c=_0x320d76 instanceof Error?_0x320d76['message']:String(_0x320d76);return console[_0x422a6c(0x132)](t(_0x422a6c(0x134),{'error':_0x28870c})),_0x42ed10&&logger[_0x422a6c(0x132)](_0x422a6c(0x12a),_0x422a6c(0x120)+_0x28870c,{'appCode':_0x3b4550,'projectPath':_0x42ed10}),![];}finally{_0x47ed03&&process[_0x422a6c(0x118)](_0x47ed03);}}
1
+ const a8_0x3b6317=a8_0x57d8;(function(_0xa9e8e7,_0x2b55e7){const _0x5ddd54=a8_0x57d8,_0x9a4712=_0xa9e8e7();while(!![]){try{const _0x240496=parseInt(_0x5ddd54(0x14c))/0x1*(-parseInt(_0x5ddd54(0x14b))/0x2)+parseInt(_0x5ddd54(0x142))/0x3+-parseInt(_0x5ddd54(0x154))/0x4*(-parseInt(_0x5ddd54(0x159))/0x5)+-parseInt(_0x5ddd54(0x15f))/0x6+parseInt(_0x5ddd54(0x15e))/0x7*(-parseInt(_0x5ddd54(0x150))/0x8)+-parseInt(_0x5ddd54(0x15b))/0x9+-parseInt(_0x5ddd54(0x148))/0xa*(-parseInt(_0x5ddd54(0x14f))/0xb);if(_0x240496===_0x2b55e7)break;else _0x9a4712['push'](_0x9a4712['shift']());}catch(_0x419caa){_0x9a4712['push'](_0x9a4712['shift']());}}}(a8_0x3c53,0xb8465));function a8_0x3c53(){const _0x187419=['cwd','error','bind','91888rJqxMn','env','API\x20配置拉取异常:\x20','log','-api','260NPfega','trim','1213785MHbGxA','message','create-api-pull','7WKyvNX','7107636oYuDyI','api.silent.processing','-client','modelCount','2724267wskGKU','chdir','api.silent.clientFileName','api.silent.error','length','api.silent.generating','2440RYTYyM','api.silent.modelFileName','string','6mUyKYk','8812KejGPQ','client','info','41943qBBAOd','7458472rqgiJj'];a8_0x3c53=function(){return _0x187419;};return a8_0x3c53();}import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a8_0x57d8(_0x1e7a05,_0x135322){_0x1e7a05=_0x1e7a05-0x141;const _0x3c532d=a8_0x3c53();let _0x57d8b1=_0x3c532d[_0x1e7a05];return _0x57d8b1;}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';import a8_0x3b6a82 from'../i18n/index.js';const t=a8_0x3b6a82['t'][a8_0x3b6317(0x153)](a8_0x3b6a82);export async function pullApiSilent(_0x55d7f9,_0xb9bf72,_0xa58114,_0x4cd212){const _0xe07a81=a8_0x3b6317;let _0x7648d9;try{const _0x3432d5=_0xb9bf72?.[_0xe07a81(0x15a)]()||'';if(_0x3432d5){const _0x2de4d5=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x2de4d5['test'](_0x3432d5))return console[_0xe07a81(0x152)](t('api.silent.invalidPrefix')),![];}_0xa58114&&(_0x7648d9=process[_0xe07a81(0x151)](),process[_0xe07a81(0x143)](_0xa58114));const _0x2d8acf=readConfig(),_0x211bb4=typeof _0x2d8acf[_0xe07a81(0x155)]===_0xe07a81(0x14a)?_0x2d8acf['env']:undefined,_0x2bbdd8=_0x4cd212||_0x211bb4||'online';initEnv(_0x2bbdd8),console[_0xe07a81(0x157)](t('api.silent.fetching',{'env':_0x2bbdd8}));const {configArray:_0x1fa22c}=await fetchModelList(_0x55d7f9),_0x37e434=_0x3432d5?_0x3432d5+_0xe07a81(0x158):'api',_0x373dc9=_0x3432d5?_0x3432d5+_0xe07a81(0x161):_0xe07a81(0x14d);console[_0xe07a81(0x157)](t(_0xe07a81(0x147))),console[_0xe07a81(0x157)](t(_0xe07a81(0x149),{'name':_0x37e434})),console['log'](t(_0xe07a81(0x144),{'name':_0x373dc9})),console[_0xe07a81(0x157)](t(_0xe07a81(0x160),{'count':_0x1fa22c[_0xe07a81(0x146)]}));const _0x5d35c5=await generateApiFile(_0x1fa22c,_0x3432d5,_0x55d7f9,!![],_0x2bbdd8);return console[_0xe07a81(0x157)](t('api.silent.success',{'datasetCount':_0x1fa22c[_0xe07a81(0x146)],'modelCount':_0x5d35c5[_0xe07a81(0x141)]})),_0xa58114&&logger[_0xe07a81(0x14e)]('create-api-pull','API\x20配置拉取成功:\x20'+_0x55d7f9,{'projectPath':_0xa58114,'appCode':_0x55d7f9,'datasetCount':_0x1fa22c[_0xe07a81(0x146)],'filePrefix':_0x3432d5}),!![];}catch(_0x257f24){const _0x5cc6d2=_0x257f24 instanceof Error?_0x257f24[_0xe07a81(0x15c)]:String(_0x257f24);return console[_0xe07a81(0x152)](t(_0xe07a81(0x145),{'error':_0x5cc6d2})),_0xa58114&&logger[_0xe07a81(0x152)](_0xe07a81(0x15d),_0xe07a81(0x156)+_0x5cc6d2,{'appCode':_0x55d7f9,'projectPath':_0xa58114}),![];}finally{_0x7648d9&&process[_0xe07a81(0x143)](_0x7648d9);}}