@lovrabet/cli 1.3.4-beta.0 → 1.3.4-beta.2

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
- function a0_0x2ccc(_0x44d502,_0x5180d8){_0x44d502=_0x44d502-0x182;const _0x310eea=a0_0x310e();let _0x2cccc0=_0x310eea[_0x44d502];return _0x2cccc0;}const a0_0x2b86f4=a0_0x2ccc;(function(_0x392e52,_0x207e38){const _0x3bb882=a0_0x2ccc,_0x3b1a85=_0x392e52();while(!![]){try{const _0x15a464=parseInt(_0x3bb882(0x1ae))/0x1*(parseInt(_0x3bb882(0x1a0))/0x2)+parseInt(_0x3bb882(0x1a2))/0x3+-parseInt(_0x3bb882(0x1bb))/0x4*(parseInt(_0x3bb882(0x1b3))/0x5)+parseInt(_0x3bb882(0x193))/0x6+-parseInt(_0x3bb882(0x182))/0x7*(-parseInt(_0x3bb882(0x1b5))/0x8)+-parseInt(_0x3bb882(0x1a6))/0x9*(-parseInt(_0x3bb882(0x18a))/0xa)+-parseInt(_0x3bb882(0x190))/0xb;if(_0x15a464===_0x207e38)break;else _0x3b1a85['push'](_0x3b1a85['shift']());}catch(_0x35a5dd){_0x3b1a85['push'](_0x3b1a85['shift']());}}}(a0_0x310e,0x1aea0));import{jsx as a0_0x419c0a,jsxs as a0_0x1faa7d}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';import{useI18n}from'../i18n/hooks.js';const MCP_IDE_LIST=[a0_0x2b86f4(0x1aa),a0_0x2b86f4(0x185)],SKILL_IDE_LIST=[a0_0x2b86f4(0x18c),a0_0x2b86f4(0x185),a0_0x2b86f4(0x1b8),'codex',a0_0x2b86f4(0x1aa),a0_0x2b86f4(0x19a),'qoder',a0_0x2b86f4(0x19f),a0_0x2b86f4(0x187),'agent'];export function AISetupUI({config:_0x222048,onComplete:_0x306d38}){const _0x34ae31=a0_0x2b86f4,{t:_0x5f32a9}=useI18n(),{exit:_0x41d6d8}=useApp(),[_0x43a212,_0x2501cb]=useState('confirming'),[_0x50d050,_0x5b4ad7]=useState(0x0),[_0x6d5f0e,_0x4b1654]=useState(new Set([0x0,0x1])),[_0x49fb19,_0x4b6e47]=useState(new Set(SKILL_IDE_LIST['map']((_0x56db5a,_0x52238f)=>_0x52238f))),[_0x2c6fad,_0x3fb865]=useState('');useEffect(()=>{!_0x222048['appcode']&&_0x306d38({'mcpResults':[],'skillResults':[]});},[_0x222048[_0x34ae31(0x197)],_0x306d38]),useInput((_0x2427f2,_0x3eb125)=>{const _0x203451=_0x34ae31;if(_0x43a212===_0x203451(0x188)){if(_0x2427f2==='y'||_0x2427f2==='Y'||_0x3eb125[_0x203451(0x189)]){_0xd94385();return;}if(_0x2427f2==='n'||_0x2427f2==='N'){_0x306d38({'mcpResults':[],'skillResults':[]});return;}if(_0x3eb125[_0x203451(0x189)]){_0xd94385();return;}}if(_0x43a212===_0x203451(0x183)){if(_0x3eb125[_0x203451(0x18d)]){_0x5b4ad7(_0x15f68c=>_0x15f68c>0x0?_0x15f68c-0x1:SKILL_IDE_LIST[_0x203451(0x1b0)]-0x1);return;}if(_0x3eb125['downArrow']){_0x5b4ad7(_0x44bf9f=>_0x44bf9f<SKILL_IDE_LIST[_0x203451(0x1b0)]-0x1?_0x44bf9f+0x1:0x0);return;}if(_0x2427f2==='\x20'){const _0x2ce4ea=_0x50d050<MCP_IDE_LIST[_0x203451(0x1b0)];if(_0x2ce4ea){const _0x5b1cf9=new Set(_0x6d5f0e);_0x5b1cf9['has'](_0x50d050)?_0x5b1cf9[_0x203451(0x19d)](_0x50d050):_0x5b1cf9[_0x203451(0x18f)](_0x50d050),_0x4b1654(_0x5b1cf9);}else{const _0x44caaa=_0x50d050-MCP_IDE_LIST[_0x203451(0x1b0)],_0x588586=new Set(_0x49fb19);_0x588586['has'](_0x44caaa)?_0x588586[_0x203451(0x19d)](_0x44caaa):_0x588586[_0x203451(0x18f)](_0x44caaa),_0x4b6e47(_0x588586);}return;}if(_0x2427f2==='a'||_0x2427f2==='A'){_0x4b1654(new Set(MCP_IDE_LIST[_0x203451(0x1b4)]((_0x181ebf,_0x5f3cd0)=>_0x5f3cd0))),_0x4b6e47(new Set(SKILL_IDE_LIST[_0x203451(0x1b4)]((_0x5ac2e2,_0xe38ddf)=>_0xe38ddf)));return;}if(_0x2427f2==='q'||_0x2427f2==='Q'){_0x41d6d8();return;}if(_0x3eb125['return']){if(_0x6d5f0e[_0x203451(0x186)]===0x0&&_0x49fb19[_0x203451(0x186)]===0x0){_0x3fb865(_0x5f32a9(_0x203451(0x192)));return;}_0xd94385();return;}}if(_0x43a212==='done'){_0x41d6d8();return;}});async function _0xd94385(){const _0x1b551c=_0x34ae31;_0x2501cb(_0x1b551c(0x195));const _0x573447=[],_0x1dc80e=[];for(const _0x20434c of _0x6d5f0e){const _0x438698=MCP_IDE_LIST[_0x20434c];if(!_0x438698)continue;try{const _0x62b7c0=await configureMcp(_0x438698,_0x222048[_0x1b551c(0x1ac)]);_0x573447[_0x1b551c(0x1b7)](_0x62b7c0);}catch(_0x245a07){_0x573447[_0x1b551c(0x1b7)]({'ide':MCP_IDE_CONFIGS[_0x438698]?.[_0x1b551c(0x1b9)]||_0x438698,'status':_0x1b551c(0x1ad),'message':_0x245a07 instanceof Error?_0x245a07[_0x1b551c(0x196)]:String(_0x245a07)});}}await copySharedSkills(_0x222048['projectRoot']);for(const _0x2644a2 of _0x49fb19){const _0x41e8d1=SKILL_IDE_LIST[_0x2644a2];if(!_0x41e8d1)continue;try{const _0x26f553=await installSkill(_0x41e8d1,_0x222048[_0x1b551c(0x1ac)]);_0x1dc80e[_0x1b551c(0x1b7)](_0x26f553);}catch(_0x29174d){_0x1dc80e[_0x1b551c(0x1b7)]({'ide':SKILL_IDE_CONFIGS[_0x41e8d1]?.[_0x1b551c(0x1b9)]||_0x41e8d1,'status':_0x1b551c(0x1ad),'message':_0x29174d instanceof Error?_0x29174d[_0x1b551c(0x196)]:String(_0x29174d)});}}if(_0x1dc80e[_0x1b551c(0x1b0)]>0x0){const _0x424492=_0x1dc80e[_0x1b551c(0x198)](_0xaab2d1=>_0xaab2d1['status']===_0x1b551c(0x1be))['map'](_0x4bd9f5=>_0x4bd9f5[_0x1b551c(0x18e)]);_0x424492[_0x1b551c(0x1b0)]>0x0&&createSkillManifest(_0x222048[_0x1b551c(0x1ac)],_0x424492);}_0x2501cb(_0x1b551c(0x1a5)),setTimeout(()=>{_0x306d38({'mcpResults':_0x573447,'skillResults':_0x1dc80e});},0xbb8);}if(_0x43a212===_0x34ae31(0x188))return a0_0x1faa7d(Box,{'flexDirection':_0x34ae31(0x1bd),'marginTop':0x1,'children':[a0_0x419c0a(Box,{'marginTop':0x1,'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1ba),'children':_0x5f32a9(_0x34ae31(0x1a9))})}),a0_0x419c0a(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1af),'children':_0x5f32a9(_0x34ae31(0x19b))})}),a0_0x419c0a(Box,{'marginLeft':0x2,'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1af),'children':_0x5f32a9('aiSetup.ui.confirm.skillDescription')})}),a0_0x1faa7d(Box,{'marginTop':0x1,'flexDirection':_0x34ae31(0x1bd),'children':[a0_0x419c0a(Box,{'children':a0_0x419c0a(Text,{'color':'green','children':_0x5f32a9(_0x34ae31(0x19c))})}),a0_0x419c0a(Box,{'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1af),'children':_0x5f32a9(_0x34ae31(0x1a3))})}),a0_0x419c0a(Box,{'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1bc),'children':_0x5f32a9(_0x34ae31(0x1bf))})})]}),_0x2c6fad&&a0_0x419c0a(Box,{'marginTop':0x1,'children':a0_0x1faa7d(Text,{'color':_0x34ae31(0x191),'children':['✗\x20',_0x2c6fad]})})]});if(_0x43a212==='selecting')return a0_0x1faa7d(Box,{'flexDirection':_0x34ae31(0x1bd),'marginTop':0x1,'children':[a0_0x419c0a(Box,{'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x19e),'bold':!![],'children':_0x5f32a9(_0x34ae31(0x1ab))})}),_0x2c6fad&&a0_0x419c0a(Box,{'marginTop':0x1,'children':a0_0x1faa7d(Text,{'color':_0x34ae31(0x191),'children':['✗\x20',_0x2c6fad]})}),a0_0x1faa7d(Box,{'marginTop':0x1,'flexDirection':_0x34ae31(0x1bd),'children':[a0_0x419c0a(Text,{'bold':!![],'color':_0x34ae31(0x1a7),'children':_0x5f32a9('aiSetup.ui.select.mcpSection')}),MCP_IDE_LIST[_0x34ae31(0x1b4)]((_0xd1255b,_0x17a48c)=>{const _0x171cab=_0x34ae31,_0x3aef32=_0x50d050===_0x17a48c,_0x12ea17=_0x6d5f0e[_0x171cab(0x184)](_0x17a48c);return a0_0x419c0a(Box,{'children':a0_0x1faa7d(Text,{'backgroundColor':_0x3aef32?_0x171cab(0x194):undefined,'color':_0x3aef32?_0x171cab(0x1ba):undefined,'children':[_0x12ea17?_0x171cab(0x18b):_0x171cab(0x1b2),'\x20',_0xd1255b==='cursor'?_0x171cab(0x1b6):_0x171cab(0x199)]})},_0x171cab(0x1b1)+_0xd1255b);}),a0_0x419c0a(Box,{'marginTop':0x1,'children':a0_0x419c0a(Text,{'bold':!![],'color':_0x34ae31(0x1a7),'children':_0x5f32a9(_0x34ae31(0x1a1))})}),SKILL_IDE_LIST[_0x34ae31(0x1b4)]((_0x4ec92b,_0x22c8e5)=>{const _0x2e6f0f=_0x34ae31,_0x41804c=_0x22c8e5+MCP_IDE_LIST['length'],_0x20cfaf=_0x50d050===_0x41804c,_0xacc815=_0x49fb19[_0x2e6f0f(0x184)](_0x41804c);return a0_0x419c0a(Box,{'children':a0_0x1faa7d(Text,{'backgroundColor':_0x20cfaf?_0x2e6f0f(0x194):undefined,'color':_0x20cfaf?_0x2e6f0f(0x1ba):undefined,'children':[_0xacc815?_0x2e6f0f(0x18b):_0x2e6f0f(0x1b2),'\x20',SKILL_IDE_CONFIGS[_0x4ec92b]['name']]})},_0x2e6f0f(0x1a4)+_0x4ec92b);}),a0_0x419c0a(Box,{'marginTop':0x1,'children':a0_0x419c0a(Text,{'color':_0x34ae31(0x1af),'children':_0x5f32a9(_0x34ae31(0x1a8))})})]})]});if(_0x43a212==='installing')return a0_0x419c0a(Box,{'flexDirection':'column','marginTop':0x1,'children':a0_0x419c0a(Box,{'children':a0_0x419c0a(Text,{'children':_0x5f32a9('aiSetup.ui.installing')})})});if(_0x43a212===_0x34ae31(0x1a5))return null;return null;}function a0_0x310e(){const _0x88fdc0=['return','50WiNsgn','[✓]','antigravity','upArrow','ide','add','5525003GvHMgZ','red','aiSetup.ui.selectAtLeastOne','459870rnpWfg','blue','installing','message','appcode','filter','Claude\x20Code','opencode','aiSetup.ui.confirm.mcpDescription','aiSetup.ui.confirm.yes','delete','cyan','trae','81208OORMJC','aiSetup.ui.select.skillSection','472752xaZdFG','aiSetup.ui.confirm.no','skill-','done','316377oYZBuy','yellow','aiSetup.ui.select.controls','aiSetup.ui.confirm.title','cursor','aiSetup.ui.select.title','projectRoot','error','4NBmKqz','gray','length','mcp-','[\x20]','288100FfDoKo','map','9896zesdvp','Cursor','push','codebuddy','name','white','4mjmwcn','dimColor','column','success','aiSetup.ui.confirm.default','553QqpqQB','selecting','has','claude','size','windsurf','confirming'];a0_0x310e=function(){return _0x88fdc0;};return a0_0x310e();}const MCP_IDE_CONFIGS={'cursor':{'name':a0_0x2b86f4(0x1b6)},'claude':{'name':'Claude\x20Code'}};
1
+ const a0_0x234483=a0_0x3c29;(function(_0x24470c,_0x136083){const _0x265c3e=a0_0x3c29,_0x1804fc=_0x24470c();while(!![]){try{const _0x16361e=-parseInt(_0x265c3e(0x194))/0x1+parseInt(_0x265c3e(0x176))/0x2+-parseInt(_0x265c3e(0x171))/0x3*(-parseInt(_0x265c3e(0x16f))/0x4)+parseInt(_0x265c3e(0x193))/0x5+-parseInt(_0x265c3e(0x192))/0x6+parseInt(_0x265c3e(0x15d))/0x7*(-parseInt(_0x265c3e(0x186))/0x8)+parseInt(_0x265c3e(0x15b))/0x9*(-parseInt(_0x265c3e(0x199))/0xa);if(_0x16361e===_0x136083)break;else _0x1804fc['push'](_0x1804fc['shift']());}catch(_0xe94850){_0x1804fc['push'](_0x1804fc['shift']());}}}(a0_0x1900,0x3d38b));import{jsx as a0_0x2df71c,jsxs as a0_0xf3e7b9}from'react/jsx-runtime';function a0_0x3c29(_0x3b83a6,_0x4aadc0){_0x3b83a6=_0x3b83a6-0x15a;const _0x190053=a0_0x1900();let _0x3c2983=_0x190053[_0x3b83a6];return _0x3c2983;}import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';function a0_0x1900(){const _0x370187=['[✓]','aiSetup.ui.confirm.mcpDescription','name','aiSetup.ui.confirm.yes','add','done','Cursor','upArrow','selecting','trae','message','yellow','cursor','push','size','44zjsBoO','white','88887FYkfEb','aiSetup.ui.select.title','confirming','length','red','965026deDpsU','aiSetup.ui.confirm.no','[\x20]','blue','status','green','skill-','claude','return','projectRoot','success','agent','column','map','aiSetup.ui.select.controls','aiSetup.ui.select.mcpSection','950856Ygpumb','error','has','windsurf','codex','aiSetup.ui.select.skillSection','delete','Claude\x20Code','cyan','codebuddy','ide','gray','2046552BRfEKt','2213700KffFGW','32099GraiXV','installing','antigravity','aiSetup.ui.confirm.default','downArrow','70wcXZsb','aiSetup.ui.confirm.title','653607UclqIK','aiSetup.ui.confirm.skillDescription','7rrwTlq','opencode','appcode'];a0_0x1900=function(){return _0x370187;};return a0_0x1900();}import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';import{useI18n}from'../i18n/hooks.js';const MCP_IDE_LIST=[a0_0x234483(0x16c),a0_0x234483(0x17d)],SKILL_IDE_LIST=[a0_0x234483(0x196),a0_0x234483(0x17d),a0_0x234483(0x18f),a0_0x234483(0x18a),a0_0x234483(0x16c),a0_0x234483(0x15e),'qoder',a0_0x234483(0x169),a0_0x234483(0x189),a0_0x234483(0x181)];export function AISetupUI({config:_0x339821,onComplete:_0x1e7a87}){const _0x412ee5=a0_0x234483,{t:_0x591c62}=useI18n(),{exit:_0x40f91e}=useApp(),[_0x1da8e0,_0x277cbf]=useState(_0x412ee5(0x173)),[_0x3266a3,_0x333b28]=useState(0x0),[_0x3ee0f7,_0x598045]=useState(new Set([0x0,0x1])),[_0x1a3641,_0x12b97a]=useState(new Set(SKILL_IDE_LIST['map']((_0x169fb2,_0x8e5a52)=>_0x8e5a52))),[_0x3781d2,_0x1ea926]=useState('');useEffect(()=>{!_0x339821['appcode']&&_0x1e7a87({'mcpResults':[],'skillResults':[]});},[_0x339821[_0x412ee5(0x15f)],_0x1e7a87]),useInput((_0x46edad,_0x24c58f)=>{const _0x1497e2=_0x412ee5;if(_0x1da8e0===_0x1497e2(0x173)){if(_0x46edad==='y'||_0x46edad==='Y'||_0x24c58f[_0x1497e2(0x17e)]){_0x2da1a2();return;}if(_0x46edad==='n'||_0x46edad==='N'){_0x1e7a87({'mcpResults':[],'skillResults':[]});return;}if(_0x24c58f[_0x1497e2(0x17e)]){_0x2da1a2();return;}}if(_0x1da8e0===_0x1497e2(0x168)){if(_0x24c58f[_0x1497e2(0x167)]){_0x333b28(_0x57174c=>_0x57174c>0x0?_0x57174c-0x1:SKILL_IDE_LIST[_0x1497e2(0x174)]-0x1);return;}if(_0x24c58f[_0x1497e2(0x198)]){_0x333b28(_0x5d1214=>_0x5d1214<SKILL_IDE_LIST[_0x1497e2(0x174)]-0x1?_0x5d1214+0x1:0x0);return;}if(_0x46edad==='\x20'){const _0x26545f=_0x3266a3<MCP_IDE_LIST[_0x1497e2(0x174)];if(_0x26545f){const _0x45c19c=new Set(_0x3ee0f7);_0x45c19c['has'](_0x3266a3)?_0x45c19c[_0x1497e2(0x18c)](_0x3266a3):_0x45c19c[_0x1497e2(0x164)](_0x3266a3),_0x598045(_0x45c19c);}else{const _0x1d81a9=_0x3266a3-MCP_IDE_LIST[_0x1497e2(0x174)],_0x21a6f2=new Set(_0x1a3641);_0x21a6f2[_0x1497e2(0x188)](_0x1d81a9)?_0x21a6f2[_0x1497e2(0x18c)](_0x1d81a9):_0x21a6f2['add'](_0x1d81a9),_0x12b97a(_0x21a6f2);}return;}if(_0x46edad==='a'||_0x46edad==='A'){_0x598045(new Set(MCP_IDE_LIST['map']((_0x14eb8a,_0x13e78f)=>_0x13e78f))),_0x12b97a(new Set(SKILL_IDE_LIST[_0x1497e2(0x183)]((_0x84c2a6,_0x26bc51)=>_0x26bc51)));return;}if(_0x46edad==='q'||_0x46edad==='Q'){_0x40f91e();return;}if(_0x24c58f[_0x1497e2(0x17e)]){if(_0x3ee0f7[_0x1497e2(0x16e)]===0x0&&_0x1a3641[_0x1497e2(0x16e)]===0x0){_0x1ea926(_0x591c62('aiSetup.ui.selectAtLeastOne'));return;}_0x2da1a2();return;}}if(_0x1da8e0===_0x1497e2(0x165)){_0x40f91e();return;}});async function _0x2da1a2(){const _0x2797c5=_0x412ee5;_0x277cbf(_0x2797c5(0x195));const _0x39030d=[],_0x2753ab=[];for(const _0x433ed6 of _0x3ee0f7){const _0x31e011=MCP_IDE_LIST[_0x433ed6];if(!_0x31e011)continue;try{const _0x357bfc=await configureMcp(_0x31e011,_0x339821[_0x2797c5(0x17f)]);_0x39030d[_0x2797c5(0x16d)](_0x357bfc);}catch(_0x14cd17){_0x39030d[_0x2797c5(0x16d)]({'ide':MCP_IDE_CONFIGS[_0x31e011]?.['name']||_0x31e011,'status':'error','message':_0x14cd17 instanceof Error?_0x14cd17[_0x2797c5(0x16a)]:String(_0x14cd17)});}}await copySharedSkills(_0x339821['projectRoot']);for(const _0x3d661f of _0x1a3641){const _0x3b82aa=SKILL_IDE_LIST[_0x3d661f];if(!_0x3b82aa)continue;try{const _0x5382c8=await installSkill(_0x3b82aa,_0x339821[_0x2797c5(0x17f)]);_0x2753ab[_0x2797c5(0x16d)](_0x5382c8);}catch(_0x3b6eff){_0x2753ab[_0x2797c5(0x16d)]({'ide':SKILL_IDE_CONFIGS[_0x3b82aa]?.[_0x2797c5(0x162)]||_0x3b82aa,'status':_0x2797c5(0x187),'message':_0x3b6eff instanceof Error?_0x3b6eff['message']:String(_0x3b6eff)});}}if(_0x2753ab['length']>0x0){const _0x1c7601=_0x2753ab['filter'](_0x1ff602=>_0x1ff602[_0x2797c5(0x17a)]===_0x2797c5(0x180))['map'](_0x4dec95=>_0x4dec95[_0x2797c5(0x190)]);_0x1c7601['length']>0x0&&createSkillManifest(_0x339821[_0x2797c5(0x17f)],_0x1c7601);}_0x277cbf('done'),setTimeout(()=>{_0x1e7a87({'mcpResults':_0x39030d,'skillResults':_0x2753ab});},0xbb8);}if(_0x1da8e0==='confirming')return a0_0xf3e7b9(Box,{'flexDirection':_0x412ee5(0x182),'marginTop':0x1,'children':[a0_0x2df71c(Box,{'marginTop':0x1,'children':a0_0x2df71c(Text,{'color':'white','children':_0x591c62(_0x412ee5(0x15a))})}),a0_0x2df71c(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a0_0x2df71c(Text,{'color':_0x412ee5(0x191),'children':_0x591c62(_0x412ee5(0x161))})}),a0_0x2df71c(Box,{'marginLeft':0x2,'children':a0_0x2df71c(Text,{'color':_0x412ee5(0x191),'children':_0x591c62(_0x412ee5(0x15c))})}),a0_0xf3e7b9(Box,{'marginTop':0x1,'flexDirection':_0x412ee5(0x182),'children':[a0_0x2df71c(Box,{'children':a0_0x2df71c(Text,{'color':_0x412ee5(0x17b),'children':_0x591c62(_0x412ee5(0x163))})}),a0_0x2df71c(Box,{'children':a0_0x2df71c(Text,{'color':_0x412ee5(0x191),'children':_0x591c62(_0x412ee5(0x177))})}),a0_0x2df71c(Box,{'children':a0_0x2df71c(Text,{'color':'dimColor','children':_0x591c62(_0x412ee5(0x197))})})]}),_0x3781d2&&a0_0x2df71c(Box,{'marginTop':0x1,'children':a0_0xf3e7b9(Text,{'color':_0x412ee5(0x175),'children':['✗\x20',_0x3781d2]})})]});if(_0x1da8e0==='selecting')return a0_0xf3e7b9(Box,{'flexDirection':_0x412ee5(0x182),'marginTop':0x1,'children':[a0_0x2df71c(Box,{'children':a0_0x2df71c(Text,{'color':_0x412ee5(0x18e),'bold':!![],'children':_0x591c62(_0x412ee5(0x172))})}),_0x3781d2&&a0_0x2df71c(Box,{'marginTop':0x1,'children':a0_0xf3e7b9(Text,{'color':_0x412ee5(0x175),'children':['✗\x20',_0x3781d2]})}),a0_0xf3e7b9(Box,{'marginTop':0x1,'flexDirection':'column','children':[a0_0x2df71c(Text,{'bold':!![],'color':_0x412ee5(0x16b),'children':_0x591c62(_0x412ee5(0x185))}),MCP_IDE_LIST[_0x412ee5(0x183)]((_0x5d8437,_0x46f4a7)=>{const _0x26ac35=_0x412ee5,_0x4c163d=_0x3266a3===_0x46f4a7,_0x2c54da=_0x3ee0f7[_0x26ac35(0x188)](_0x46f4a7);return a0_0x2df71c(Box,{'children':a0_0xf3e7b9(Text,{'backgroundColor':_0x4c163d?_0x26ac35(0x179):undefined,'color':_0x4c163d?'white':undefined,'children':[_0x2c54da?_0x26ac35(0x160):_0x26ac35(0x178),'\x20',_0x5d8437==='cursor'?'Cursor':_0x26ac35(0x18d)]})},'mcp-'+_0x5d8437);}),a0_0x2df71c(Box,{'marginTop':0x1,'children':a0_0x2df71c(Text,{'bold':!![],'color':_0x412ee5(0x16b),'children':_0x591c62(_0x412ee5(0x18b))})}),SKILL_IDE_LIST[_0x412ee5(0x183)]((_0x2bc5d3,_0x532609)=>{const _0x471904=_0x412ee5,_0x291cc4=_0x532609+MCP_IDE_LIST['length'],_0x2ea3af=_0x3266a3===_0x291cc4,_0x55753b=_0x1a3641[_0x471904(0x188)](_0x291cc4);return a0_0x2df71c(Box,{'children':a0_0xf3e7b9(Text,{'backgroundColor':_0x2ea3af?_0x471904(0x179):undefined,'color':_0x2ea3af?_0x471904(0x170):undefined,'children':[_0x55753b?_0x471904(0x160):_0x471904(0x178),'\x20',SKILL_IDE_CONFIGS[_0x2bc5d3][_0x471904(0x162)]]})},_0x471904(0x17c)+_0x2bc5d3);}),a0_0x2df71c(Box,{'marginTop':0x1,'children':a0_0x2df71c(Text,{'color':'gray','children':_0x591c62(_0x412ee5(0x184))})})]})]});if(_0x1da8e0==='installing')return a0_0x2df71c(Box,{'flexDirection':'column','marginTop':0x1,'children':a0_0x2df71c(Box,{'children':a0_0x2df71c(Text,{'children':_0x591c62('aiSetup.ui.installing')})})});if(_0x1da8e0===_0x412ee5(0x165))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a0_0x234483(0x166)},'claude':{'name':a0_0x234483(0x18d)}};
@@ -1 +1 @@
1
- const a1_0x1d8864=a1_0x4484;(function(_0x10ad29,_0x7f4c74){const _0x3a3cb1=a1_0x4484,_0x3e84ed=_0x10ad29();while(!![]){try{const _0x197210=parseInt(_0x3a3cb1(0x6a))/0x1+parseInt(_0x3a3cb1(0xa9))/0x2*(-parseInt(_0x3a3cb1(0x8d))/0x3)+-parseInt(_0x3a3cb1(0x67))/0x4+parseInt(_0x3a3cb1(0x6b))/0x5*(parseInt(_0x3a3cb1(0x80))/0x6)+-parseInt(_0x3a3cb1(0xac))/0x7*(parseInt(_0x3a3cb1(0x66))/0x8)+parseInt(_0x3a3cb1(0xaa))/0x9+-parseInt(_0x3a3cb1(0x73))/0xa*(-parseInt(_0x3a3cb1(0x93))/0xb);if(_0x197210===_0x7f4c74)break;else _0x3e84ed['push'](_0x3e84ed['shift']());}catch(_0x162c90){_0x3e84ed['push'](_0x3e84ed['shift']());}}}(a1_0x9ff4,0x380fe));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a1_0x4484(_0x52bf05,_0x4b1969){_0x52bf05=_0x52bf05-0x66;const _0x9ff4e8=a1_0x9ff4();let _0x448441=_0x9ff4e8[_0x52bf05];return _0x448441;}import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';import a1_0x4d62a7 from'../i18n/index.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME='lovrabet-dataset',MCP_COMMAND=a1_0x1d8864(0x89),MCP_ARGS=[a1_0x1d8864(0xb1)];export function buildEnvConfig(_0x329f94,_0x267fde){const _0x428bbe=a1_0x1d8864,_0x205578={'LOVRABET_APP_CODE':String(_0x329f94)};return _0x267fde!=='online'&&(_0x205578[_0x428bbe(0x7b)]=String(_0x267fde)),_0x205578;}export async function configureCursorMcp(_0x1dbd32){const _0x4705aa=a1_0x1d8864,_0x5167fe=_0x1dbd32||process[_0x4705aa(0x6e)](),_0x52df6f=readConfig(_0x5167fe),_0x214f48=_0x52df6f[_0x4705aa(0x99)]||_0x52df6f['app'],_0x558071=_0x52df6f[_0x4705aa(0x8f)]||_0x4705aa(0xa7);if(!_0x214f48)return{'ide':_0x4705aa(0x69),'status':_0x4705aa(0xa0),'message':a1_0x4d62a7['t'](_0x4705aa(0x8a))};const _0x5d6b65=buildEnvConfig(_0x214f48,_0x558071),_0x13f6f3={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x5d6b65},_0x366f88=join(_0x5167fe,_0x4705aa(0x7f),_0x4705aa(0x9f)),_0x170425=join(_0x5167fe,_0x4705aa(0x7f));try{!existsSync(_0x170425)&&mkdirSync(_0x170425,{'recursive':!![]});let _0x1dda89={'mcpServers':{}};if(existsSync(_0x366f88)){const _0x5cb7a9=readFileSync(_0x366f88,_0x4705aa(0x6c));_0x1dda89=JSON[_0x4705aa(0x9e)](_0x5cb7a9);}return(!_0x1dda89['mcpServers']||typeof _0x1dda89[_0x4705aa(0x78)]!==_0x4705aa(0x94))&&(_0x1dda89['mcpServers']={}),_0x1dda89[_0x4705aa(0x78)][MCP_SERVER_NAME]=_0x13f6f3,writeFileSync(_0x366f88,JSON[_0x4705aa(0x77)](_0x1dda89,null,0x2),_0x4705aa(0x6c)),logger['info'](_0x4705aa(0x81),a1_0x4d62a7['t'](_0x4705aa(0x68)),{'appcode':_0x214f48,'env':_0x558071,'path':_0x366f88}),await copyCursorRules(_0x170425),{'ide':_0x4705aa(0x69),'status':_0x4705aa(0x71),'message':a1_0x4d62a7['t'](_0x4705aa(0x74))};}catch(_0x14473a){return logger[_0x4705aa(0xa0)](_0x4705aa(0x81),a1_0x4d62a7['t'](_0x4705aa(0x98)),{'error':_0x14473a instanceof Error?_0x14473a[_0x4705aa(0x79)]:String(_0x14473a)}),{'ide':_0x4705aa(0x69),'status':_0x4705aa(0xa0),'message':_0x14473a instanceof Error?_0x14473a[_0x4705aa(0x79)]:String(_0x14473a)};}}export async function configureClaudeMcp(_0x1640b4){const _0x1136e4=a1_0x1d8864,_0x44594d=_0x1640b4||process[_0x1136e4(0x6e)](),_0x1996df=readConfig(_0x44594d),_0x447bba=_0x1996df[_0x1136e4(0x99)]||_0x1996df[_0x1136e4(0x88)],_0x2b3894=_0x1996df[_0x1136e4(0x8f)]||_0x1136e4(0xa7);if(!_0x447bba)return{'ide':_0x1136e4(0xaf),'status':'error','message':a1_0x4d62a7['t'](_0x1136e4(0x8a))};let _0x432e37=_0x1136e4(0xa2)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x1136e4(0xad)]('\x20')+'\x20-e\x20LOVRABET_APP_CODE='+_0x447bba;return _0x2b3894!==_0x1136e4(0xa7)&&(_0x432e37+='\x20-e\x20LOVRABET_ENV='+_0x2b3894),await copyAgentsMd(_0x44594d),logger['info'](_0x1136e4(0x81),a1_0x4d62a7['t'](_0x1136e4(0xa3)),{'command':_0x432e37,'appcode':_0x447bba,'env':_0x2b3894}),console['log'](a1_0x4d62a7['t'](_0x1136e4(0xab))),console[_0x1136e4(0x8e)]('\x20\x20'+_0x432e37+'\x0a'),console[_0x1136e4(0x8e)](a1_0x4d62a7['t'](_0x1136e4(0x85))),console['log']('\x20\x20AppCode:\x20'+_0x447bba),_0x2b3894!=='online'&&console[_0x1136e4(0x8e)](a1_0x4d62a7['t']('aiSetup.mcp.claude.env',{'env':_0x2b3894})),console[_0x1136e4(0x8e)](a1_0x4d62a7['t']('aiSetup.mcp.claude.restartRequired')),{'ide':_0x1136e4(0xaf),'status':_0x1136e4(0xa5),'message':a1_0x4d62a7['t'](_0x1136e4(0x91),{'command':_0x432e37})};}export async function showOtherGuide(_0xfcec49){const _0x4b69b9=a1_0x1d8864,_0x2ebc80=_0xfcec49||process[_0x4b69b9(0x6e)](),_0x2962dd=readConfig(_0x2ebc80),_0x39fc77=_0x2962dd['appcode']||_0x2962dd['app'],_0x39381b=_0x2962dd[_0x4b69b9(0x8f)]||'online';if(!_0x39fc77)return{'ide':a1_0x4d62a7['t'](_0x4b69b9(0x70)),'status':'error','message':a1_0x4d62a7['t'](_0x4b69b9(0x8a))};return console[_0x4b69b9(0x8e)](a1_0x4d62a7['t'](_0x4b69b9(0x6d))),console[_0x4b69b9(0x8e)]('{'),console['log'](_0x4b69b9(0x7d)),console[_0x4b69b9(0x8e)](_0x4b69b9(0xae)+MCP_SERVER_NAME+'\x22:\x20{'),console[_0x4b69b9(0x8e)]('\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22'+MCP_COMMAND+'\x22,'),console['log'](_0x4b69b9(0x7c)+MCP_ARGS[_0x4b69b9(0x97)](_0x23439b=>'\x22'+_0x23439b+'\x22')[_0x4b69b9(0xad)](',\x20')+'],'),console[_0x4b69b9(0x8e)](_0x4b69b9(0x96)),console[_0x4b69b9(0x8e)](_0x4b69b9(0x8c)+_0x39fc77+'\x22,'),_0x39381b!=='online'&&console[_0x4b69b9(0x8e)](_0x4b69b9(0x7a)+_0x39381b+'\x22,'),console[_0x4b69b9(0x8e)](_0x4b69b9(0x84)),console['log']('\x20\x20\x20\x20}'),console[_0x4b69b9(0x8e)](_0x4b69b9(0x7e)),console['log']('}\x0a'),logger[_0x4b69b9(0x76)](_0x4b69b9(0x81),a1_0x4d62a7['t']('aiSetup.mcp.other.guideShown'),{'appcode':_0x39fc77,'env':_0x39381b}),{'ide':a1_0x4d62a7['t'](_0x4b69b9(0x70)),'status':_0x4b69b9(0xa5),'message':a1_0x4d62a7['t'](_0x4b69b9(0x8b))};}export async function configureMcp(_0x28e021,_0x33bb8d){const _0x5e1792=a1_0x1d8864;switch(_0x28e021){case _0x5e1792(0x86):return await configureCursorMcp(_0x33bb8d);case'claude':return await configureClaudeMcp(_0x33bb8d);default:throw new Error(a1_0x4d62a7['t'](_0x5e1792(0xa1),{'ide':_0x28e021}));}}async function copyCursorRules(_0x41b627){const _0x10db60=a1_0x1d8864,_0x1819ca=join(_0x41b627,_0x10db60(0x9b)),_0x5c0989=join(_0x1819ca,'lovrabet_rules.mdc');if(existsSync(_0x5c0989))return;try{!existsSync(_0x1819ca)&&mkdirSync(_0x1819ca,{'recursive':!![]});const _0x124fb2=await getRulesContent();writeFileSync(_0x5c0989,_0x124fb2,_0x10db60(0x6c)),logger[_0x10db60(0x76)](_0x10db60(0x81),a1_0x4d62a7['t']('aiSetup.mcp.cursor.rules.created'),{'to':_0x5c0989});}catch(_0x118e51){logger[_0x10db60(0xa0)](_0x10db60(0x81),a1_0x4d62a7['t'](_0x10db60(0x72)),{'error':_0x118e51 instanceof Error?_0x118e51['message']:String(_0x118e51)});}}async function copyAgentsMd(_0x43518f){const _0x50dedc=a1_0x1d8864,_0x4c957a=join(_0x43518f,_0x50dedc(0x90));if(existsSync(_0x4c957a))return;try{const _0x47b5c2=await getRulesContent();writeFileSync(_0x4c957a,_0x47b5c2,'utf-8'),logger[_0x50dedc(0x76)](_0x50dedc(0x81),a1_0x4d62a7['t']('aiSetup.mcp.claude.agents.created'),{'to':_0x4c957a});}catch(_0x2b98fb){logger[_0x50dedc(0xa0)]('mcp-install',a1_0x4d62a7['t'](_0x50dedc(0x82)),{'error':_0x2b98fb instanceof Error?_0x2b98fb['message']:String(_0x2b98fb)});}}function a1_0x9ff4(){const _0x2153e4=['1100292Jjltlt','aiSetup.mcp.cursor.success','Cursor','8610honDBI','10IYKBFj','utf-8','aiSetup.mcp.other.title','cwd','aiSetup.skill.manifestCreated','aiSetup.mcp.other.name','success','aiSetup.mcp.cursor.rules.copyFailed','21970xfFIna','aiSetup.mcp.cursor.written','aiSetup.skill.installFailed','info','stringify','mcpServers','message','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','LOVRABET_ENV','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','\x20\x20\x22mcpServers\x22:\x20{','\x20\x20}','.cursor','688932HKXNYJ','mcp-install','aiSetup.mcp.claude.agents.copyFailed','skill-install','\x20\x20\x20\x20\x20\x20}','aiSetup.mcp.claude.configInfo','cursor','.lovrabet/skill/.shared','app','npx','aiSetup.error.missingAppcode','aiSetup.mcp.other.guideShown','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','3aaRNXv','log','env','agents.md','aiSetup.mcp.claude.manualExecute','2.0.0','649rzctbB','object','../../cdn-source/skills','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','map','aiSetup.mcp.cursor.error','appcode','node:fs','rules','aiSetup.skill.itemsCreated','aiSetup.skill.installSuccess','parse','mcp.json','error','aiSetup.mcp.unsupportedIDE','claude\x20mcp\x20add\x20','aiSetup.mcp.claude.commandGenerated','.shared','manual','.lovrabet/skill-manifest.json','online','aiSetup.skill.unknownIDE','233112khvfpK','2831850JwdwiR','aiSetup.mcp.claude.manualCommand','12614cAEgQb','join','\x20\x20\x20\x20\x22','Claude\x20Code','.lovrabet','@lovrabet/dataset-mcp-server@latest','aiSetup.skill.sharedCopyFailed','272DczqDT'];a1_0x9ff4=function(){return _0x2153e4;};return a1_0x9ff4();}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x1e5e0a,_0x1e75b6){const _0x1b36f9=a1_0x1d8864,_0xbb0e7f=_0x1e75b6||process[_0x1b36f9(0x6e)](),_0x568e6e=resolve(__dirname,_0x1b36f9(0x95)),_0x47c1e6=SKILL_IDE_CONFIGS[_0x1e5e0a];if(!_0x47c1e6)return{'ide':_0x1e5e0a,'status':_0x1b36f9(0xa0),'message':a1_0x4d62a7['t'](_0x1b36f9(0xa8),{'ide':_0x1e5e0a})};const _0x4421b5=_0x47c1e6['name'];try{let _0xb201aa;try{_0xb201aa=await fetchGuidesFromCDN();}catch{}const _0x284054=await installSingleIDE(_0x1e5e0a,_0x47c1e6,_0xbb0e7f,_0x568e6e,_0xb201aa);return _0xb201aa&&writeGuidesToProject(_0xb201aa,_0xbb0e7f),logger['info'](_0x1b36f9(0x83),a1_0x4d62a7['t'](_0x1b36f9(0x9d),{'name':_0x4421b5}),{'ide':_0x1e5e0a,'filesCount':_0x284054}),{'ide':_0x4421b5,'status':_0x1b36f9(0x71),'message':a1_0x4d62a7['t'](_0x1b36f9(0x9c),{'count':_0x284054})};}catch(_0x1b053c){return logger['error'](_0x1b36f9(0x83),a1_0x4d62a7['t'](_0x1b36f9(0x75),{'name':_0x4421b5}),{'error':_0x1b053c instanceof Error?_0x1b053c[_0x1b36f9(0x79)]:String(_0x1b053c)}),{'ide':_0x4421b5,'status':'error','message':_0x1b053c instanceof Error?_0x1b053c[_0x1b36f9(0x79)]:String(_0x1b053c)};}}async function copyDir(_0x3fc7db,_0x41df17){const _0x520611=a1_0x1d8864,{statSync:_0x1ed4a2}=await import(_0x520611(0x9a)),{readdirSync:_0x2db5ba}=await import(_0x520611(0x9a)),_0xa1da60=_0x1ed4a2(_0x3fc7db);if(_0xa1da60['isDirectory']()){!existsSync(_0x41df17)&&mkdirSync(_0x41df17,{'recursive':!![]});const _0x164c7e=_0x2db5ba(_0x3fc7db);for(const _0x1848a8 of _0x164c7e){await copyDir(join(_0x3fc7db,_0x1848a8),join(_0x41df17,_0x1848a8));}}else copyFileSync(_0x3fc7db,_0x41df17);}export async function copySharedSkills(_0x43f99b){const _0x403e63=a1_0x1d8864,_0x4957eb=_0x43f99b||process[_0x403e63(0x6e)](),_0xe9e889=resolve(__dirname,_0x403e63(0x95)),_0xc9a756=join(_0xe9e889,_0x403e63(0xa4)),_0x54792a=join(_0x4957eb,_0x403e63(0x87));if(!existsSync(_0xc9a756))return![];try{return await copyDir(_0xc9a756,_0x54792a),logger[_0x403e63(0x76)]('skill-install',a1_0x4d62a7['t']('aiSetup.skill.sharedCopied'),{'path':_0x54792a}),!![];}catch(_0x203902){return logger[_0x403e63(0xa0)](_0x403e63(0x83),a1_0x4d62a7['t'](_0x403e63(0xb2)),{'error':_0x203902 instanceof Error?_0x203902[_0x403e63(0x79)]:String(_0x203902)}),![];}}export function createSkillManifest(_0x5d3ed9,_0x459095){const _0x87f658=a1_0x1d8864,_0x3316fd={'version':_0x87f658(0x92),'installedAt':new Date()['toISOString'](),'platforms':_0x459095},_0x24b795=join(_0x5d3ed9,_0x87f658(0xa6)),_0x1d68ae=join(_0x5d3ed9,_0x87f658(0xb0));!existsSync(_0x1d68ae)&&mkdirSync(_0x1d68ae,{'recursive':!![]}),writeFileSync(_0x24b795,JSON['stringify'](_0x3316fd,null,0x2),_0x87f658(0x6c)),logger['info'](_0x87f658(0x83),a1_0x4d62a7['t'](_0x87f658(0x6f)),{'path':_0x24b795});}
1
+ const a1_0x1771ed=a1_0x6a5d;(function(_0x5dec89,_0x506b97){const _0x39991a=a1_0x6a5d,_0x1ddb5a=_0x5dec89();while(!![]){try{const _0x1c783c=parseInt(_0x39991a(0x13f))/0x1*(-parseInt(_0x39991a(0x134))/0x2)+-parseInt(_0x39991a(0x11d))/0x3+parseInt(_0x39991a(0x11a))/0x4+parseInt(_0x39991a(0x135))/0x5+parseInt(_0x39991a(0x126))/0x6+-parseInt(_0x39991a(0x11e))/0x7*(parseInt(_0x39991a(0x14c))/0x8)+parseInt(_0x39991a(0x12e))/0x9*(-parseInt(_0x39991a(0x14f))/0xa);if(_0x1c783c===_0x506b97)break;else _0x1ddb5a['push'](_0x1ddb5a['shift']());}catch(_0x46b3b5){_0x1ddb5a['push'](_0x1ddb5a['shift']());}}}(a1_0x496d,0xa12f3));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_0x4d8569 from'../i18n/index.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME='lovrabet-dataset',MCP_COMMAND=a1_0x1771ed(0x147),MCP_ARGS=[a1_0x1771ed(0x156)];export function buildEnvConfig(_0x4d0554,_0x5c65da){const _0x166de3=a1_0x1771ed,_0x84dde2={'LOVRABET_APP_CODE':String(_0x4d0554)};return _0x5c65da!==_0x166de3(0x14b)&&(_0x84dde2['LOVRABET_ENV']=String(_0x5c65da)),_0x84dde2;}function a1_0x496d(){const _0x1f7007=['3838692IktVzx','\x20\x20\x20\x20\x20\x20}','aiSetup.skill.sharedCopyFailed','617406sPuTbE','329QaCcYo','\x20\x20AppCode:\x20','app','../../cdn-source/skills','Cursor','aiSetup.skill.manifestCreated','success','aiSetup.mcp.other.title','136128uToQHD','.lovrabet/skill/.shared','\x20\x20\x22mcpServers\x22:\x20{','mcp.json','log','claude','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','\x20\x20\x20\x20}','14238mMKAWY','\x22:\x20{','aiSetup.mcp.claude.commandGenerated','object','aiSetup.mcp.claude.configInfo','utf-8','2gMWETS','2958110DIrJmg','aiSetup.skill.installSuccess','cursor','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','stringify','aiSetup.mcp.cursor.rules.copyFailed','appcode','join','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','env','46477IpggZm','aiSetup.error.missingAppcode','agents.md','.lovrabet/skill-manifest.json','lovrabet_rules.mdc','aiSetup.mcp.unsupportedIDE','mcp-install','aiSetup.mcp.cursor.error','npx','\x20-e\x20LOVRABET_APP_CODE=','manual','2.0.0','online','10808TqANkN','cwd','skill-install','3780nApTfb','.shared','aiSetup.mcp.cursor.success','aiSetup.mcp.other.name','aiSetup.skill.sharedCopied','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','map','@lovrabet/dataset-mcp-server@latest','toISOString','info','rules','aiSetup.mcp.claude.agents.created','node:fs','mcpServers','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','.cursor','aiSetup.mcp.other.guideShown','aiSetup.mcp.claude.agents.copyFailed','Claude\x20Code','message','error','aiSetup.mcp.cursor.rules.created','aiSetup.mcp.claude.env','.lovrabet','\x20\x20\x20\x20\x22'];a1_0x496d=function(){return _0x1f7007;};return a1_0x496d();}export async function configureCursorMcp(_0x2a7997){const _0xb4595d=a1_0x1771ed,_0x2f7257=_0x2a7997||process['cwd'](),_0x458114=readConfig(_0x2f7257),_0x2ada5c=_0x458114[_0xb4595d(0x13b)]||_0x458114[_0xb4595d(0x120)],_0x35ef1f=_0x458114[_0xb4595d(0x13e)]||'online';if(!_0x2ada5c)return{'ide':_0xb4595d(0x122),'status':_0xb4595d(0x163),'message':a1_0x4d8569['t'](_0xb4595d(0x140))};const _0x17045=buildEnvConfig(_0x2ada5c,_0x35ef1f),_0x520810={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x17045},_0x3031f1=join(_0x2f7257,'.cursor',_0xb4595d(0x129)),_0xf6bc57=join(_0x2f7257,_0xb4595d(0x15e));try{!existsSync(_0xf6bc57)&&mkdirSync(_0xf6bc57,{'recursive':!![]});let _0x2be87e={'mcpServers':{}};if(existsSync(_0x3031f1)){const _0x1b02bb=readFileSync(_0x3031f1,_0xb4595d(0x133));_0x2be87e=JSON['parse'](_0x1b02bb);}return(!_0x2be87e[_0xb4595d(0x15c)]||typeof _0x2be87e[_0xb4595d(0x15c)]!==_0xb4595d(0x131))&&(_0x2be87e[_0xb4595d(0x15c)]={}),_0x2be87e[_0xb4595d(0x15c)][MCP_SERVER_NAME]=_0x520810,writeFileSync(_0x3031f1,JSON[_0xb4595d(0x139)](_0x2be87e,null,0x2),_0xb4595d(0x133)),logger[_0xb4595d(0x158)](_0xb4595d(0x145),a1_0x4d8569['t'](_0xb4595d(0x151)),{'appcode':_0x2ada5c,'env':_0x35ef1f,'path':_0x3031f1}),await copyCursorRules(_0xf6bc57),{'ide':_0xb4595d(0x122),'status':'success','message':a1_0x4d8569['t']('aiSetup.mcp.cursor.written')};}catch(_0x4d6430){return logger['error']('mcp-install',a1_0x4d8569['t'](_0xb4595d(0x146)),{'error':_0x4d6430 instanceof Error?_0x4d6430[_0xb4595d(0x162)]:String(_0x4d6430)}),{'ide':_0xb4595d(0x122),'status':_0xb4595d(0x163),'message':_0x4d6430 instanceof Error?_0x4d6430[_0xb4595d(0x162)]:String(_0x4d6430)};}}export async function configureClaudeMcp(_0x450ae2){const _0x2422d9=a1_0x1771ed,_0x30ee75=_0x450ae2||process[_0x2422d9(0x14d)](),_0x12536b=readConfig(_0x30ee75),_0x3e647a=_0x12536b[_0x2422d9(0x13b)]||_0x12536b[_0x2422d9(0x120)],_0x40d8fa=_0x12536b[_0x2422d9(0x13e)]||'online';if(!_0x3e647a)return{'ide':_0x2422d9(0x161),'status':_0x2422d9(0x163),'message':a1_0x4d8569['t'](_0x2422d9(0x140))};let _0x3f0162='claude\x20mcp\x20add\x20'+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x2422d9(0x13c)]('\x20')+_0x2422d9(0x148)+_0x3e647a;return _0x40d8fa!==_0x2422d9(0x14b)&&(_0x3f0162+='\x20-e\x20LOVRABET_ENV='+_0x40d8fa),await copyAgentsMd(_0x30ee75),logger['info'](_0x2422d9(0x145),a1_0x4d8569['t'](_0x2422d9(0x130)),{'command':_0x3f0162,'appcode':_0x3e647a,'env':_0x40d8fa}),console['log'](a1_0x4d8569['t']('aiSetup.mcp.claude.manualCommand')),console['log']('\x20\x20'+_0x3f0162+'\x0a'),console[_0x2422d9(0x12a)](a1_0x4d8569['t'](_0x2422d9(0x132))),console[_0x2422d9(0x12a)](_0x2422d9(0x11f)+_0x3e647a),_0x40d8fa!==_0x2422d9(0x14b)&&console['log'](a1_0x4d8569['t'](_0x2422d9(0x165),{'env':_0x40d8fa})),console[_0x2422d9(0x12a)](a1_0x4d8569['t']('aiSetup.mcp.claude.restartRequired')),{'ide':_0x2422d9(0x161),'status':_0x2422d9(0x149),'message':a1_0x4d8569['t']('aiSetup.mcp.claude.manualExecute',{'command':_0x3f0162})};}export async function showOtherGuide(_0x4ac7a4){const _0x472e6a=a1_0x1771ed,_0x3cdf54=_0x4ac7a4||process['cwd'](),_0x555c60=readConfig(_0x3cdf54),_0x5606d6=_0x555c60[_0x472e6a(0x13b)]||_0x555c60[_0x472e6a(0x120)],_0x3aa2ee=_0x555c60['env']||_0x472e6a(0x14b);if(!_0x5606d6)return{'ide':a1_0x4d8569['t'](_0x472e6a(0x152)),'status':_0x472e6a(0x163),'message':a1_0x4d8569['t']('aiSetup.error.missingAppcode')};return console['log'](a1_0x4d8569['t'](_0x472e6a(0x125))),console[_0x472e6a(0x12a)]('{'),console[_0x472e6a(0x12a)](_0x472e6a(0x128)),console[_0x472e6a(0x12a)](_0x472e6a(0x119)+MCP_SERVER_NAME+_0x472e6a(0x12f)),console[_0x472e6a(0x12a)](_0x472e6a(0x15d)+MCP_COMMAND+'\x22,'),console['log'](_0x472e6a(0x13d)+MCP_ARGS[_0x472e6a(0x155)](_0xd39a48=>'\x22'+_0xd39a48+'\x22')[_0x472e6a(0x13c)](',\x20')+'],'),console[_0x472e6a(0x12a)](_0x472e6a(0x12c)),console[_0x472e6a(0x12a)](_0x472e6a(0x154)+_0x5606d6+'\x22,'),_0x3aa2ee!=='online'&&console[_0x472e6a(0x12a)](_0x472e6a(0x138)+_0x3aa2ee+'\x22,'),console[_0x472e6a(0x12a)](_0x472e6a(0x11b)),console[_0x472e6a(0x12a)](_0x472e6a(0x12d)),console['log']('\x20\x20}'),console[_0x472e6a(0x12a)]('}\x0a'),logger[_0x472e6a(0x158)](_0x472e6a(0x145),a1_0x4d8569['t'](_0x472e6a(0x15f)),{'appcode':_0x5606d6,'env':_0x3aa2ee}),{'ide':a1_0x4d8569['t'](_0x472e6a(0x152)),'status':_0x472e6a(0x149),'message':a1_0x4d8569['t'](_0x472e6a(0x15f))};}function a1_0x6a5d(_0x3208d9,_0x3cc922){_0x3208d9=_0x3208d9-0x119;const _0x496dcd=a1_0x496d();let _0x6a5d86=_0x496dcd[_0x3208d9];return _0x6a5d86;}export async function configureMcp(_0x7bb5a5,_0x536e2d){const _0x1e85b5=a1_0x1771ed;switch(_0x7bb5a5){case _0x1e85b5(0x137):return await configureCursorMcp(_0x536e2d);case _0x1e85b5(0x12b):return await configureClaudeMcp(_0x536e2d);default:throw new Error(a1_0x4d8569['t'](_0x1e85b5(0x144),{'ide':_0x7bb5a5}));}}async function copyCursorRules(_0x211810){const _0x3f3974=a1_0x1771ed,_0x10feca=join(_0x211810,_0x3f3974(0x159)),_0xa6d8d0=join(_0x10feca,_0x3f3974(0x143));if(existsSync(_0xa6d8d0))return;try{!existsSync(_0x10feca)&&mkdirSync(_0x10feca,{'recursive':!![]});const _0x35af93=await getRulesContent();writeFileSync(_0xa6d8d0,_0x35af93,_0x3f3974(0x133)),logger[_0x3f3974(0x158)](_0x3f3974(0x145),a1_0x4d8569['t'](_0x3f3974(0x164)),{'to':_0xa6d8d0});}catch(_0x1ab4f3){logger['error'](_0x3f3974(0x145),a1_0x4d8569['t'](_0x3f3974(0x13a)),{'error':_0x1ab4f3 instanceof Error?_0x1ab4f3[_0x3f3974(0x162)]:String(_0x1ab4f3)});}}async function copyAgentsMd(_0x495acb){const _0x2a5c78=a1_0x1771ed,_0x3e30a0=join(_0x495acb,_0x2a5c78(0x141));if(existsSync(_0x3e30a0))return;try{const _0x46adf9=await getRulesContent();writeFileSync(_0x3e30a0,_0x46adf9,'utf-8'),logger[_0x2a5c78(0x158)](_0x2a5c78(0x145),a1_0x4d8569['t'](_0x2a5c78(0x15a)),{'to':_0x3e30a0});}catch(_0x1c83e4){logger['error'](_0x2a5c78(0x145),a1_0x4d8569['t'](_0x2a5c78(0x160)),{'error':_0x1c83e4 instanceof Error?_0x1c83e4[_0x2a5c78(0x162)]:String(_0x1c83e4)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x43f1d0,_0x31fb36){const _0x17038f=a1_0x1771ed,_0x5d90cd=_0x31fb36||process['cwd'](),_0x1863f7=resolve(__dirname,_0x17038f(0x121)),_0x5e5533=SKILL_IDE_CONFIGS[_0x43f1d0];if(!_0x5e5533)return{'ide':_0x43f1d0,'status':_0x17038f(0x163),'message':a1_0x4d8569['t']('aiSetup.skill.unknownIDE',{'ide':_0x43f1d0})};const _0x349abd=_0x5e5533['name'];try{let _0x28286d;try{_0x28286d=await fetchGuidesFromCDN();}catch{}const _0x216967=await installSingleIDE(_0x43f1d0,_0x5e5533,_0x5d90cd,_0x1863f7,_0x28286d);return _0x28286d&&writeGuidesToProject(_0x28286d,_0x5d90cd),logger[_0x17038f(0x158)](_0x17038f(0x14e),a1_0x4d8569['t'](_0x17038f(0x136),{'name':_0x349abd}),{'ide':_0x43f1d0,'filesCount':_0x216967}),{'ide':_0x349abd,'status':_0x17038f(0x124),'message':a1_0x4d8569['t']('aiSetup.skill.itemsCreated',{'count':_0x216967})};}catch(_0x5eefef){return logger[_0x17038f(0x163)](_0x17038f(0x14e),a1_0x4d8569['t']('aiSetup.skill.installFailed',{'name':_0x349abd}),{'error':_0x5eefef instanceof Error?_0x5eefef[_0x17038f(0x162)]:String(_0x5eefef)}),{'ide':_0x349abd,'status':_0x17038f(0x163),'message':_0x5eefef instanceof Error?_0x5eefef[_0x17038f(0x162)]:String(_0x5eefef)};}}async function copyDir(_0x5c1260,_0x716ac6){const _0x2494f6=a1_0x1771ed,{statSync:_0x5e1f11}=await import(_0x2494f6(0x15b)),{readdirSync:_0x5d00c8}=await import(_0x2494f6(0x15b)),_0x9c9c59=_0x5e1f11(_0x5c1260);if(_0x9c9c59['isDirectory']()){!existsSync(_0x716ac6)&&mkdirSync(_0x716ac6,{'recursive':!![]});const _0x36afa0=_0x5d00c8(_0x5c1260);for(const _0x5ff27e of _0x36afa0){await copyDir(join(_0x5c1260,_0x5ff27e),join(_0x716ac6,_0x5ff27e));}}else copyFileSync(_0x5c1260,_0x716ac6);}export async function copySharedSkills(_0x23d0ec){const _0x35844d=a1_0x1771ed,_0x4eb93f=_0x23d0ec||process[_0x35844d(0x14d)](),_0x237bfe=resolve(__dirname,_0x35844d(0x121)),_0x2377b8=join(_0x237bfe,_0x35844d(0x150)),_0x160583=join(_0x4eb93f,_0x35844d(0x127));if(!existsSync(_0x2377b8))return![];try{return await copyDir(_0x2377b8,_0x160583),logger[_0x35844d(0x158)](_0x35844d(0x14e),a1_0x4d8569['t'](_0x35844d(0x153)),{'path':_0x160583}),!![];}catch(_0x49652e){return logger[_0x35844d(0x163)]('skill-install',a1_0x4d8569['t'](_0x35844d(0x11c)),{'error':_0x49652e instanceof Error?_0x49652e[_0x35844d(0x162)]:String(_0x49652e)}),![];}}export function createSkillManifest(_0x4400a0,_0x3011b3){const _0x5640d7=a1_0x1771ed,_0x24bedc={'version':_0x5640d7(0x14a),'installedAt':new Date()[_0x5640d7(0x157)](),'platforms':_0x3011b3},_0x46f47c=join(_0x4400a0,_0x5640d7(0x142)),_0x376551=join(_0x4400a0,_0x5640d7(0x166));!existsSync(_0x376551)&&mkdirSync(_0x376551,{'recursive':!![]}),writeFileSync(_0x46f47c,JSON[_0x5640d7(0x139)](_0x24bedc,null,0x2),_0x5640d7(0x133)),logger[_0x5640d7(0x158)]('skill-install',a1_0x4d8569['t'](_0x5640d7(0x123)),{'path':_0x46f47c});}
@@ -1 +1 @@
1
- (function(_0x2ba4c0,_0x2d9b1c){const _0x15d738=a2_0x552b,_0x12df43=_0x2ba4c0();while(!![]){try{const _0x3dce66=parseInt(_0x15d738(0x19f))/0x1*(-parseInt(_0x15d738(0x19c))/0x2)+-parseInt(_0x15d738(0x1b1))/0x3+-parseInt(_0x15d738(0x1ae))/0x4+-parseInt(_0x15d738(0x1b4))/0x5+-parseInt(_0x15d738(0x193))/0x6*(-parseInt(_0x15d738(0x1c5))/0x7)+parseInt(_0x15d738(0x18c))/0x8*(-parseInt(_0x15d738(0x1a2))/0x9)+parseInt(_0x15d738(0x19b))/0xa;if(_0x3dce66===_0x2d9b1c)break;else _0x12df43['push'](_0x12df43['shift']());}catch(_0x138d28){_0x12df43['push'](_0x12df43['shift']());}}}(a2_0xa3ed,0xac44e));import{jsx as a2_0x1afc25,jsxs as a2_0x2d1d33,Fragment as a2_0x2f7703}from'react/jsx-runtime';import{useEffect,useState}from'react';function a2_0xa3ed(){const _0x12797e=['message','yellow','api.common.noAppCodeDefault','includes','🚀\x20','api.docUI.allDatasetsNotFound','api.docUI.docFailed','filter','api.docUI.noDatasets','cyan','join','api.docUI.failedDatasets','map','env','235137cTcJAg','8RnNqXm','\x1b[0m','api.docUI.generatingFile','green','filePath','api.docUI.docComplete','api-doc','90esHZsC','red','文档生成失败:\x20','api.docUI.generatedDocs','column','./docs','api.common.usingSpecifiedAppCode','api.docUI.processedDatasets','33259750BCsnqR','66AgbYwW','api.docUI.filteredDatasets','api.docUI.docGenerateFailed','21973uEPcmX','datasetName','\x1b[90m','8053308NVCeRR','cwd','expired','online','api.docUI.datasetsNotFound','api.common.usingDefaultAppCode','\x20-\x20','length','error','gray','\x1b[33m','api.docUI.generatingDocs','1122756AlkGbW','success','💡\x20','1528047ImapzL','lovrabet\x20auth','Authentication','3571335PzFdeE','datasetCode','dim'];a2_0xa3ed=function(){return _0x12797e;};return a2_0xa3ed();}function a2_0x552b(_0x779d66,_0x343476){_0x779d66=_0x779d66-0x18c;const _0xa3ed4f=a2_0xa3ed();let _0x552b0c=_0xa3ed4f[_0x779d66];return _0x552b0c;}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';import{useI18n}from'../i18n/hooks.js';export const ApiDocUI=({appCode:_0x862d92,env:_0x5046dd,output:_0x59816d,extraParams:_0x1368c8,datasetCodes:_0x30c83e})=>{const _0x58877e=a2_0x552b,{exit:_0x13ccc9}=useApp(),{t:_0x512b7a}=useI18n(),[_0x5111ad,_0x3f0cea]=useState(![]),[_0x3cdd05,_0x272e69]=useState(''),[_0x2569e8,_0x598412]=useState(![]),[_0x32f648,_0x174670]=useState(null),[_0x185414,_0x4780d8]=useState(null),[_0x44e3a1,_0xa87886]=useState(0x0),_0x44803e=readConfig(),_0xe1bbe6=getConfigAppCode(),_0x3beaee=_0x862d92||_0xe1bbe6,_0x3b2244=typeof _0x44803e?.[_0x58877e(0x1c4)]==='string'?_0x44803e[_0x58877e(0x1c4)]:undefined,_0x556f07=_0x5046dd||_0x3b2244||_0x58877e(0x1a5);initEnv(_0x556f07);const _0x4c0c7b=_0x59816d||_0x58877e(0x198),_0x38ac78=_0x862d92?_0x512b7a(_0x58877e(0x199),{'appCode':_0x3beaee}):_0x512b7a(_0x58877e(0x1a7),{'appCode':_0x3beaee});useEffect(()=>{_0x3f0cea(!![]),_0x46d6ec();},[]),useEffect(()=>{(_0x2569e8||_0x32f648)&&_0x13ccc9();},[_0x2569e8,_0x32f648,_0x13ccc9]);async function _0x46d6ec(){const _0x27db70=_0x58877e;if(!_0x3beaee){_0x174670(_0x512b7a(_0x27db70(0x1b9)));return;}try{logger['setLogPath'](process[_0x27db70(0x1a3)]()),_0x272e69(_0x512b7a('api.docUI.fetchingDatasets'));const {configArray:_0x4477e5}=await fetchModelList(_0x3beaee);_0xa87886(_0x4477e5[_0x27db70(0x1a9)]);if(_0x4477e5[_0x27db70(0x1a9)]===0x0){_0x174670(_0x512b7a(_0x27db70(0x1bf)));return;}let _0xc5fdc9=_0x4477e5;if(_0x30c83e&&_0x30c83e[_0x27db70(0x1a9)]>0x0){_0xc5fdc9=_0x4477e5[_0x27db70(0x1be)](_0xa80f17=>_0x30c83e['includes'](_0xa80f17[_0x27db70(0x1b5)]));const _0x4283c7=_0xc5fdc9['map'](_0x35631b=>_0x35631b[_0x27db70(0x1b5)]),_0x1828f1=_0x30c83e['filter'](_0x233d70=>!_0x4283c7[_0x27db70(0x1ba)](_0x233d70));_0x1828f1[_0x27db70(0x1a9)]>0x0&&console['log'](_0x27db70(0x1ac)+_0x512b7a(_0x27db70(0x1a6),{'codes':_0x1828f1[_0x27db70(0x1c1)](',\x20')})+_0x27db70(0x18d));if(_0xc5fdc9[_0x27db70(0x1a9)]===0x0){_0x174670(_0x512b7a(_0x27db70(0x1bc),{'codes':_0x30c83e[_0x27db70(0x1c1)](',\x20')}));return;}console['log'](_0x27db70(0x1a1)+_0x512b7a(_0x27db70(0x19d),{'total':_0x4477e5['length'],'count':_0xc5fdc9[_0x27db70(0x1a9)]})+_0x27db70(0x18d));}_0x272e69(_0x512b7a(_0x27db70(0x1ad),{'count':_0xc5fdc9[_0x27db70(0x1a9)]}));const _0x4b81a2=await generateDatasetDocs(_0xc5fdc9,_0x3beaee,_0x4c0c7b,(_0x32c357,_0x113067,_0x102b82)=>{const _0x141316=_0x27db70;_0x272e69(_0x512b7a(_0x141316(0x18e),{'fileName':_0x102b82,'current':_0x32c357,'total':_0x113067}));},_0x1368c8);_0x4780d8(_0x4b81a2),_0x598412(!![]);const _0x52becc=_0x4b81a2[_0x27db70(0x1be)](_0x5b0946=>_0x5b0946[_0x27db70(0x1af)])[_0x27db70(0x1a9)],_0x441d24=_0x4b81a2['filter'](_0xe9689d=>!_0xe9689d[_0x27db70(0x1af)])[_0x27db70(0x1a9)];logger[_0x27db70(0x1af)](_0x27db70(0x192),'文档生成完成',undefined,{'totalCount':_0x4b81a2['length'],'successCount':_0x52becc,'failCount':_0x441d24,'outputDir':_0x4c0c7b});}catch(_0x412773){const _0x340600=_0x412773 instanceof Error?_0x412773[_0x27db70(0x1b7)]:String(_0x412773);logger[_0x27db70(0x1aa)](_0x27db70(0x192),_0x27db70(0x195)+_0x340600,{'appCode':_0x3beaee,'outputDir':_0x4c0c7b}),_0x174670(_0x512b7a(_0x27db70(0x19e),{'error':_0x340600}));}finally{_0x3f0cea(![]);}}const _0x3ec9e2=_0x185414?.[_0x58877e(0x1be)](_0x29230b=>_0x29230b['success'])[_0x58877e(0x1a9)]||0x0,_0x287f67=_0x185414?.['filter'](_0x241d4f=>!_0x241d4f[_0x58877e(0x1af)])[_0x58877e(0x1a9)]||0x0;return a2_0x2d1d33(Box,{'flexDirection':_0x58877e(0x197),'children':[(_0x5111ad||_0x2569e8)&&a2_0x2d1d33(Box,{'children':[a2_0x1afc25(Text,{'color':_0x58877e(0x1ab),'children':'*\x20'}),a2_0x1afc25(Text,{'color':_0x862d92?'white':_0x58877e(0x1b6),'children':_0x38ac78})]}),_0x5111ad&&a2_0x1afc25(Box,{'children':a2_0x2d1d33(Text,{'children':[_0x58877e(0x1bb),_0x3cdd05]})}),_0x2569e8&&_0x185414&&a2_0x2d1d33(Box,{'flexDirection':_0x58877e(0x197),'children':[a2_0x1afc25(Box,{'children':a2_0x2d1d33(Text,{'color':_0x58877e(0x18f),'children':[_0x512b7a(_0x58877e(0x191),{'successCount':_0x3ec9e2}),_0x287f67>0x0?_0x512b7a(_0x58877e(0x1bd),{'failCount':_0x287f67}):'']})}),a2_0x1afc25(Box,{'marginTop':0x1,'children':a2_0x1afc25(Text,{'color':'gray','children':_0x512b7a(_0x58877e(0x19a),{'count':_0x44e3a1})})}),a2_0x2d1d33(Box,{'marginTop':0x1,'children':[a2_0x1afc25(Text,{'color':_0x58877e(0x1ab),'children':_0x512b7a('api.docUI.outputDir')}),a2_0x1afc25(Text,{'color':'cyan','children':_0x4c0c7b})]}),_0x3ec9e2>0x0&&a2_0x2d1d33(a2_0x2f7703,{'children':[a2_0x1afc25(Box,{'marginTop':0x1,'children':a2_0x1afc25(Text,{'color':_0x58877e(0x1ab),'children':_0x512b7a(_0x58877e(0x196))})}),_0x185414['filter'](_0x51c56b=>_0x51c56b[_0x58877e(0x1af)])[_0x58877e(0x1c3)]((_0x5769ca,_0x3cd066)=>a2_0x2d1d33(Box,{'marginLeft':0x2,'children':[a2_0x2d1d33(Text,{'color':_0x58877e(0x1c0),'children':['•\x20',_0x5769ca[_0x58877e(0x190)]]}),a2_0x2d1d33(Text,{'color':'dim','children':[_0x58877e(0x1a8),_0x5769ca[_0x58877e(0x1a0)]]})]},_0x3cd066))]}),_0x287f67>0x0&&a2_0x2d1d33(a2_0x2f7703,{'children':[a2_0x1afc25(Box,{'marginTop':0x1,'children':a2_0x1afc25(Text,{'color':_0x58877e(0x1b8),'children':_0x512b7a(_0x58877e(0x1c2))})}),_0x185414[_0x58877e(0x1be)](_0x5715a3=>!_0x5715a3[_0x58877e(0x1af)])[_0x58877e(0x1c3)]((_0xe02e54,_0x81c88d)=>a2_0x2d1d33(Box,{'marginLeft':0x2,'flexDirection':_0x58877e(0x197),'children':[a2_0x2d1d33(Text,{'color':_0x58877e(0x194),'children':['•\x20',_0xe02e54['datasetName'],'\x20(',_0xe02e54[_0x58877e(0x1b5)],')']}),_0xe02e54[_0x58877e(0x1aa)]&&a2_0x1afc25(Box,{'marginLeft':0x2,'children':a2_0x1afc25(Text,{'color':_0x58877e(0x1b6),'children':_0xe02e54[_0x58877e(0x1aa)]})})]},_0x81c88d))]})]}),_0x32f648&&a2_0x2d1d33(Box,{'flexDirection':_0x58877e(0x197),'children':[a2_0x1afc25(Box,{'children':a2_0x2d1d33(Text,{'color':_0x58877e(0x194),'children':['❌\x20',_0x32f648]})}),(_0x32f648['includes']('登录')||_0x32f648['includes'](_0x58877e(0x1b3))||_0x32f648[_0x58877e(0x1ba)](_0x58877e(0x1a4)))&&a2_0x2d1d33(Box,{'marginTop':0x1,'children':[a2_0x1afc25(Text,{'color':_0x58877e(0x1b8),'children':_0x58877e(0x1b0)}),a2_0x1afc25(Text,{'color':_0x58877e(0x1c0),'children':_0x58877e(0x1b2)}),a2_0x2d1d33(Text,{'color':_0x58877e(0x1b8),'children':['\x20',_0x512b7a('api.common.authRetry')]})]})]})]});};
1
+ (function(_0x5b3620,_0x29d975){const _0xe49886=a2_0x1e33,_0xfa0044=_0x5b3620();while(!![]){try{const _0x367235=-parseInt(_0xe49886(0x87))/0x1*(parseInt(_0xe49886(0x81))/0x2)+parseInt(_0xe49886(0x8a))/0x3+-parseInt(_0xe49886(0x79))/0x4*(-parseInt(_0xe49886(0x7a))/0x5)+parseInt(_0xe49886(0x8e))/0x6+parseInt(_0xe49886(0x75))/0x7+-parseInt(_0xe49886(0x6a))/0x8+parseInt(_0xe49886(0x67))/0x9*(-parseInt(_0xe49886(0x9b))/0xa);if(_0x367235===_0x29d975)break;else _0xfa0044['push'](_0xfa0044['shift']());}catch(_0x9598f1){_0xfa0044['push'](_0xfa0044['shift']());}}}(a2_0x597f,0x18d7a));function a2_0x1e33(_0x4382e2,_0x3b2eca){_0x4382e2=_0x4382e2-0x65;const _0x597f19=a2_0x597f();let _0x1e3351=_0x597f19[_0x4382e2];return _0x1e3351;}import{jsx as a2_0xae22bc,jsxs as a2_0x2d53aa,Fragment as a2_0x4085bb}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{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:_0x385310,env:_0x1da2b3,output:_0x2d792d,extraParams:_0x5dfc34,datasetCodes:_0x40c0bc})=>{const _0x4193f2=a2_0x1e33,{exit:_0x192d21}=useApp(),{t:_0x187094}=useI18n(),[_0x395223,_0x233185]=useState(![]),[_0x2b82a7,_0x256b67]=useState(''),[_0x8f7520,_0x933ff]=useState(![]),[_0x5b3572,_0x4ab6e3]=useState(null),[_0x2a7768,_0x56d14f]=useState(null),[_0x2180f7,_0xc029e5]=useState(0x0),_0xa87d18=readConfig(),_0x22364f=getConfigAppCode(),_0x323a05=_0x385310||_0x22364f,_0x32277e=typeof _0xa87d18?.[_0x4193f2(0x6b)]===_0x4193f2(0x76)?_0xa87d18['env']:undefined,_0x11dc27=_0x1da2b3||_0x32277e||_0x4193f2(0x85);initEnv(_0x11dc27);const _0x5826eb=_0x2d792d||_0x4193f2(0x94),_0x254fd7=_0x385310?_0x187094(_0x4193f2(0x7b),{'appCode':_0x323a05}):_0x187094(_0x4193f2(0x7e),{'appCode':_0x323a05});useEffect(()=>{_0x233185(!![]),_0x10426f();},[]),useEffect(()=>{(_0x8f7520||_0x5b3572)&&_0x192d21();},[_0x8f7520,_0x5b3572,_0x192d21]);async function _0x10426f(){const _0x2013a9=_0x4193f2;if(!_0x323a05){_0x4ab6e3(_0x187094(_0x2013a9(0x83)));return;}try{logger[_0x2013a9(0x78)](process[_0x2013a9(0x93)]()),_0x256b67(_0x187094('api.docUI.fetchingDatasets'));const {configArray:_0x1049cd}=await fetchModelList(_0x323a05);_0xc029e5(_0x1049cd[_0x2013a9(0x84)]);if(_0x1049cd[_0x2013a9(0x84)]===0x0){_0x4ab6e3(_0x187094('api.docUI.noDatasets'));return;}let _0x19a55d=_0x1049cd;if(_0x40c0bc&&_0x40c0bc[_0x2013a9(0x84)]>0x0){_0x19a55d=_0x1049cd['filter'](_0x279a70=>_0x40c0bc[_0x2013a9(0x73)](_0x279a70[_0x2013a9(0x9a)]));const _0x4c7d03=_0x19a55d[_0x2013a9(0x86)](_0x3fd507=>_0x3fd507[_0x2013a9(0x9a)]),_0x13d83b=_0x40c0bc[_0x2013a9(0x72)](_0x4be9aa=>!_0x4c7d03[_0x2013a9(0x73)](_0x4be9aa));_0x13d83b[_0x2013a9(0x84)]>0x0&&console[_0x2013a9(0x92)]('\x1b[33m'+_0x187094(_0x2013a9(0x70),{'codes':_0x13d83b['join'](',\x20')})+_0x2013a9(0x77));if(_0x19a55d[_0x2013a9(0x84)]===0x0){_0x4ab6e3(_0x187094(_0x2013a9(0x66),{'codes':_0x40c0bc[_0x2013a9(0x7d)](',\x20')}));return;}console[_0x2013a9(0x92)](_0x2013a9(0x90)+_0x187094(_0x2013a9(0x8d),{'total':_0x1049cd['length'],'count':_0x19a55d['length']})+'\x1b[0m');}_0x256b67(_0x187094('api.docUI.generatingDocs',{'count':_0x19a55d[_0x2013a9(0x84)]}));const _0x383ce1=await generateDatasetDocs(_0x19a55d,_0x323a05,_0x5826eb,(_0x55e511,_0x9a3048,_0x227dc4)=>{_0x256b67(_0x187094('api.docUI.generatingFile',{'fileName':_0x227dc4,'current':_0x55e511,'total':_0x9a3048}));},_0x5dfc34);_0x56d14f(_0x383ce1),_0x933ff(!![]);const _0x5bb205=_0x383ce1[_0x2013a9(0x72)](_0x2d2b78=>_0x2d2b78['success'])[_0x2013a9(0x84)],_0x3fdd16=_0x383ce1[_0x2013a9(0x72)](_0x5acf00=>!_0x5acf00[_0x2013a9(0x96)])['length'];logger['success'](_0x2013a9(0x95),_0x2013a9(0x80),undefined,{'totalCount':_0x383ce1[_0x2013a9(0x84)],'successCount':_0x5bb205,'failCount':_0x3fdd16,'outputDir':_0x5826eb});}catch(_0x311063){const _0x567d1b=_0x311063 instanceof Error?_0x311063[_0x2013a9(0x6e)]:String(_0x311063);logger['error'](_0x2013a9(0x95),_0x2013a9(0x91)+_0x567d1b,{'appCode':_0x323a05,'outputDir':_0x5826eb}),_0x4ab6e3(_0x187094(_0x2013a9(0x82),{'error':_0x567d1b}));}finally{_0x233185(![]);}}const _0x1d1807=_0x2a7768?.[_0x4193f2(0x72)](_0xfd03ab=>_0xfd03ab[_0x4193f2(0x96)])['length']||0x0,_0x20df54=_0x2a7768?.[_0x4193f2(0x72)](_0x29bbe0=>!_0x29bbe0[_0x4193f2(0x96)])[_0x4193f2(0x84)]||0x0;return a2_0x2d53aa(Box,{'flexDirection':'column','children':[(_0x395223||_0x8f7520)&&a2_0x2d53aa(Box,{'children':[a2_0xae22bc(Text,{'color':_0x4193f2(0x7c),'children':'*\x20'}),a2_0xae22bc(Text,{'color':_0x385310?_0x4193f2(0x71):'dim','children':_0x254fd7})]}),_0x395223&&a2_0xae22bc(Box,{'children':a2_0x2d53aa(Text,{'children':['*\x20',_0x2b82a7]})}),_0x8f7520&&_0x2a7768&&a2_0x2d53aa(Box,{'flexDirection':_0x4193f2(0x8b),'children':[a2_0xae22bc(Box,{'children':a2_0x2d53aa(Text,{'color':_0x4193f2(0x8c),'children':[_0x187094(_0x4193f2(0x8f),{'successCount':_0x1d1807}),_0x20df54>0x0?_0x187094('api.docUI.docFailed',{'failCount':_0x20df54}):'']})}),a2_0xae22bc(Box,{'marginTop':0x1,'children':a2_0xae22bc(Text,{'color':_0x4193f2(0x7c),'children':_0x187094(_0x4193f2(0x6d),{'count':_0x2180f7})})}),a2_0x2d53aa(Box,{'marginTop':0x1,'children':[a2_0xae22bc(Text,{'color':_0x4193f2(0x7c),'children':_0x187094('api.docUI.outputDir')}),a2_0xae22bc(Text,{'color':'cyan','children':_0x5826eb})]}),_0x1d1807>0x0&&a2_0x2d53aa(a2_0x4085bb,{'children':[a2_0xae22bc(Box,{'marginTop':0x1,'children':a2_0xae22bc(Text,{'color':_0x4193f2(0x7c),'children':_0x187094(_0x4193f2(0x6c))})}),_0x2a7768['filter'](_0x57c2e1=>_0x57c2e1[_0x4193f2(0x96)])[_0x4193f2(0x86)]((_0x1ef0f1,_0xb19e69)=>a2_0x2d53aa(Box,{'marginLeft':0x2,'children':[a2_0x2d53aa(Text,{'color':'cyan','children':['•\x20',_0x1ef0f1[_0x4193f2(0x69)]]}),a2_0x2d53aa(Text,{'color':_0x4193f2(0x74),'children':[_0x4193f2(0x89),_0x1ef0f1['datasetName']]})]},_0xb19e69))]}),_0x20df54>0x0&&a2_0x2d53aa(a2_0x4085bb,{'children':[a2_0xae22bc(Box,{'marginTop':0x1,'children':a2_0xae22bc(Text,{'color':_0x4193f2(0x9c),'children':_0x187094(_0x4193f2(0x7f))})}),_0x2a7768[_0x4193f2(0x72)](_0x2f7d7e=>!_0x2f7d7e[_0x4193f2(0x96)])[_0x4193f2(0x86)]((_0x1ef1c5,_0x1ae6fa)=>a2_0x2d53aa(Box,{'marginLeft':0x2,'flexDirection':_0x4193f2(0x8b),'children':[a2_0x2d53aa(Text,{'color':'red','children':['•\x20',_0x1ef1c5[_0x4193f2(0x97)],'\x20(',_0x1ef1c5[_0x4193f2(0x9a)],')']}),_0x1ef1c5[_0x4193f2(0x68)]&&a2_0xae22bc(Box,{'marginLeft':0x2,'children':a2_0xae22bc(Text,{'color':_0x4193f2(0x74),'children':_0x1ef1c5[_0x4193f2(0x68)]})})]},_0x1ae6fa))]})]}),_0x5b3572&&a2_0x2d53aa(Box,{'flexDirection':'column','children':[a2_0xae22bc(Box,{'children':a2_0x2d53aa(Text,{'color':_0x4193f2(0x65),'children':[_0x4193f2(0x88),_0x5b3572]})}),(_0x5b3572[_0x4193f2(0x73)]('登录')||_0x5b3572[_0x4193f2(0x73)](_0x4193f2(0x98))||_0x5b3572['includes']('expired'))&&a2_0x2d53aa(Box,{'marginTop':0x1,'children':[a2_0xae22bc(Text,{'color':'yellow','children':'*\x20'}),a2_0xae22bc(Text,{'color':_0x4193f2(0x99),'children':_0x4193f2(0x6f)}),a2_0x2d53aa(Text,{'color':'yellow','children':['\x20',_0x187094('api.common.authRetry')]})]})]})]});};function a2_0x597f(){const _0x3dc0b3=['datasetCode','460920NBvVmC','yellow','red','api.docUI.allDatasetsNotFound','18dMvVpH','error','filePath','958344mrVBOr','env','api.docUI.generatedDocs','api.docUI.processedDatasets','message','lovrabet\x20auth','api.docUI.datasetsNotFound','white','filter','includes','dim','43512qetlXy','string','\x1b[0m','setLogPath','38996pXnuFx','10lVTTmH','api.common.usingSpecifiedAppCode','gray','join','api.common.usingDefaultAppCode','api.docUI.failedDatasets','文档生成完成','14gTVZNX','api.docUI.docGenerateFailed','api.common.noAppCodeDefault','length','online','map','4631enHGEe','[ERROR]\x20','\x20-\x20','382374KfCayy','column','green','api.docUI.filteredDatasets','1157856mZONLD','api.docUI.docComplete','\x1b[90m','文档生成失败:\x20','log','cwd','./docs','api-doc','success','datasetName','Authentication','cyan'];a2_0x597f=function(){return _0x3dc0b3;};return a2_0x597f();}
@@ -1 +1 @@
1
- const a3_0x2eea49=a3_0x5bcd;(function(_0x4730e1,_0x40a4eb){const _0xfbd52f=a3_0x5bcd,_0x592f1c=_0x4730e1();while(!![]){try{const _0x339252=-parseInt(_0xfbd52f(0xfc))/0x1*(-parseInt(_0xfbd52f(0xf6))/0x2)+-parseInt(_0xfbd52f(0xf0))/0x3+-parseInt(_0xfbd52f(0xe5))/0x4*(-parseInt(_0xfbd52f(0xf2))/0x5)+-parseInt(_0xfbd52f(0xe7))/0x6+-parseInt(_0xfbd52f(0xe8))/0x7*(-parseInt(_0xfbd52f(0xed))/0x8)+-parseInt(_0xfbd52f(0xfe))/0x9+parseInt(_0xfbd52f(0xef))/0xa*(parseInt(_0xfbd52f(0xec))/0xb);if(_0x339252===_0x40a4eb)break;else _0x592f1c['push'](_0x592f1c['shift']());}catch(_0x2c2b15){_0x592f1c['push'](_0x592f1c['shift']());}}}(a3_0x297d,0x9b721));function a3_0x5bcd(_0x353003,_0x517ccd){_0x353003=_0x353003-0xe2;const _0x297da9=a3_0x297d();let _0x5bcdad=_0x297da9[_0x353003];return _0x5bcdad;}function a3_0x297d(){const _0x2d4b51=['json','datasetCode','297424anUmuF','bind','6604011LGiOpl','log','join','api-doc','string','status','application/json','api.docBatch.generating','text','api.docBatch.waiting','3742564ajjMma','tableName','3905652PnIqnT','1019431wuJcgs','name','push','api.docBatch.failed','5302ijTTLx','48HkDqNR','POST','10870LohWgs','2720385OPnYIy','生成文档成功:\x20','5elcCdW','api.docBatch.totalDatasets','data','markdown','4OABUOz','.md','length','api.docBatch.httpError'];a3_0x297d=function(){return _0x2d4b51;};return a3_0x297d();}import{mkdirSync,writeFileSync}from'node:fs';import a3_0x2b71be from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import a3_0x3ef281 from'../i18n/index.js';const t=a3_0x3ef281['t'][a3_0x2eea49(0xfd)](a3_0x3ef281);export async function fetchDatasetDoc(_0x432afb){const _0x4fd735=a3_0x2eea49,{appCode:_0x571c74,datasetCode:_0x3f9c8d,datasetId:_0x49f4e1,extraParams:_0x492a1e}=_0x432afb,_0x1550da=getApiDomain(),_0x4e39b7=_0x1550da+'/api/node-toolbox/api-doc-generator',_0x1535ed={'appCode':_0x571c74,'datasetCode':_0x3f9c8d,'datasetId':_0x49f4e1,..._0x492a1e||{}},_0x33bc50=await fetch(_0x4e39b7,{'method':_0x4fd735(0xee),'headers':{'Content-Type':_0x4fd735(0x104),'Cookie':getCookie()},'body':JSON['stringify'](_0x1535ed)});if(!_0x33bc50['ok']){if(_0x33bc50[_0x4fd735(0x103)]===0x191)throw new Error(t('api.common.authExpired'));let _0x4ac9fe='';try{_0x4ac9fe=await _0x33bc50[_0x4fd735(0xe3)]();}catch(_0x4106f7){}throw new Error(''+t(_0x4fd735(0xf9),{'datasetCode':_0x3f9c8d,'status':_0x33bc50['status']})+(_0x4ac9fe?'\x0a'+_0x4ac9fe:''));}const _0x44766a=await _0x33bc50[_0x4fd735(0xfa)]();if(!_0x44766a[_0x4fd735(0xf4)]||typeof _0x44766a[_0x4fd735(0xf4)][_0x4fd735(0xf5)]!==_0x4fd735(0x102))throw new Error(t('api.docBatch.docFormatError',{'datasetCode':_0x3f9c8d}));return _0x44766a['data'][_0x4fd735(0xf5)];}function delay(_0xd843b3){return new Promise(_0x39eb8d=>setTimeout(_0x39eb8d,_0xd843b3));}export async function generateDatasetDocs(_0x34eeb0,_0xa77916,_0x18ed1d='./docs',_0xb540e7,_0x149694){const _0x254a04=a3_0x2eea49;mkdirSync(_0x18ed1d,{'recursive':!![]});const _0x251163=[],_0x9287b9=_0x34eeb0[_0x254a04(0xf8)];console[_0x254a04(0xff)](t(_0x254a04(0xf3),{'count':_0x9287b9}));for(let _0x39f6d6=0x0;_0x39f6d6<_0x34eeb0['length'];_0x39f6d6++){const _0x7fbf19=_0x34eeb0[_0x39f6d6],_0x2be053=_0x39f6d6+0x1,_0x160230=_0x7fbf19[_0x254a04(0xe6)];try{console[_0x254a04(0xff)](t(_0x254a04(0xe2),{'current':_0x2be053,'total':_0x9287b9,'fileName':_0x160230,'name':_0x7fbf19[_0x254a04(0xe9)]}));_0xb540e7&&_0xb540e7(_0x2be053,_0x9287b9,_0x160230);const _0x1cc180=await fetchDatasetDoc({'appCode':_0xa77916,'datasetCode':_0x7fbf19['datasetCode'],'datasetId':_0x7fbf19['id'],'enableAI':![],'extraParams':_0x149694}),_0x108906=a3_0x2b71be[_0x254a04(0x100)](_0x18ed1d,_0x160230+_0x254a04(0xf7));writeFileSync(_0x108906,_0x1cc180,{'encoding':'utf8'}),console[_0x254a04(0xff)](t('api.docBatch.success',{'fileName':_0x160230})),logger['success'](_0x254a04(0x101),_0x254a04(0xf1)+_0x160230,undefined,{'datasetCode':_0x7fbf19['datasetCode'],'datasetName':_0x7fbf19[_0x254a04(0xe9)],'filePath':_0x108906,'progress':_0x2be053+'/'+_0x9287b9}),_0x251163[_0x254a04(0xea)]({'datasetCode':_0x7fbf19[_0x254a04(0xfb)],'datasetName':_0x7fbf19[_0x254a04(0xe9)],'filePath':_0x108906,'success':!![]}),_0x2be053<_0x9287b9&&await delay(0x1388);}catch(_0x179238){const _0x506e80=_0x179238 instanceof Error?_0x179238['message']:String(_0x179238);console[_0x254a04(0xff)](t(_0x254a04(0xeb),{'fileName':_0x160230,'error':_0x506e80})),logger['error'](_0x254a04(0x101),'生成文档失败:\x20'+_0x7fbf19['datasetCode'],{'datasetCode':_0x7fbf19[_0x254a04(0xfb)],'datasetName':_0x7fbf19[_0x254a04(0xe9)],'error':_0x506e80,'progress':_0x2be053+'/'+_0x9287b9}),_0x251163[_0x254a04(0xea)]({'datasetCode':_0x7fbf19['datasetCode'],'datasetName':_0x7fbf19[_0x254a04(0xe9)],'filePath':'','success':![],'error':_0x506e80}),_0x2be053<_0x9287b9&&(console[_0x254a04(0xff)](t(_0x254a04(0xe4))),await delay(0xbb8));}}return _0x251163;}
1
+ const a3_0x547bed=a3_0x3836;(function(_0x138c47,_0x44e9ae){const _0x2ead5a=a3_0x3836,_0x5b9700=_0x138c47();while(!![]){try{const _0x43ba1b=parseInt(_0x2ead5a(0x134))/0x1*(-parseInt(_0x2ead5a(0x120))/0x2)+-parseInt(_0x2ead5a(0x140))/0x3*(-parseInt(_0x2ead5a(0x125))/0x4)+parseInt(_0x2ead5a(0x11d))/0x5*(parseInt(_0x2ead5a(0x11b))/0x6)+-parseInt(_0x2ead5a(0x13a))/0x7*(-parseInt(_0x2ead5a(0x131))/0x8)+parseInt(_0x2ead5a(0x12c))/0x9*(-parseInt(_0x2ead5a(0x122))/0xa)+-parseInt(_0x2ead5a(0x11e))/0xb*(parseInt(_0x2ead5a(0x130))/0xc)+parseInt(_0x2ead5a(0x123))/0xd;if(_0x43ba1b===_0x44e9ae)break;else _0x5b9700['push'](_0x5b9700['shift']());}catch(_0x16e4fb){_0x5b9700['push'](_0x5b9700['shift']());}}}(a3_0x2061,0x83ebd));import{mkdirSync,writeFileSync}from'node:fs';import a3_0x414639 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a3_0x3836(_0x3da205,_0x523165){_0x3da205=_0x3da205-0x11a;const _0x2061e8=a3_0x2061();let _0x3836b8=_0x2061e8[_0x3da205];return _0x3836b8;}function a3_0x2061(){const _0x553e99=['api.docBatch.docFormatError','api.docBatch.waiting','32QIIDzf','.md','api-doc','stringify','string','api.common.authExpired','7wwqhpp','error','name','api.docBatch.success','api.docBatch.totalDatasets','length','16782xQBREm','text','生成文档成功:\x20','POST','application/json','1293528kmHaWn','生成文档失败:\x20','15miNqbl','121NUMnAm','bind','31334DinYwh','status','2110JvTpno','17614883jbGAsn','api.docBatch.generating','44GwOOmr','api.docBatch.httpError','markdown','log','push','utf8','join','6381lxmfke','data','datasetCode','api.docBatch.failed','961776pDdsvi','77048cSaDIi'];a3_0x2061=function(){return _0x553e99;};return a3_0x2061();}import a3_0x52ddba from'../i18n/index.js';const t=a3_0x52ddba['t'][a3_0x547bed(0x11f)](a3_0x52ddba);export async function fetchDatasetDoc(_0x4d4bc6){const _0x565917=a3_0x547bed,{appCode:_0x13879b,datasetCode:_0x5df273,datasetId:_0x2869f2,extraParams:_0x5264b1}=_0x4d4bc6,_0x4bede4=getApiDomain(),_0x515f0a=_0x4bede4+'/api/node-toolbox/api-doc-generator',_0x5f2017={'appCode':_0x13879b,'datasetCode':_0x5df273,'datasetId':_0x2869f2,..._0x5264b1||{}},_0x172548=await fetch(_0x515f0a,{'method':_0x565917(0x143),'headers':{'Content-Type':_0x565917(0x11a),'Cookie':getCookie()},'body':JSON[_0x565917(0x137)](_0x5f2017)});if(!_0x172548['ok']){if(_0x172548[_0x565917(0x121)]===0x191)throw new Error(t(_0x565917(0x139)));let _0x468786='';try{_0x468786=await _0x172548[_0x565917(0x141)]();}catch(_0x57b963){}throw new Error(''+t(_0x565917(0x126),{'datasetCode':_0x5df273,'status':_0x172548['status']})+(_0x468786?'\x0a'+_0x468786:''));}const _0x4f3561=await _0x172548['json']();if(!_0x4f3561[_0x565917(0x12d)]||typeof _0x4f3561[_0x565917(0x12d)][_0x565917(0x127)]!==_0x565917(0x138))throw new Error(t(_0x565917(0x132),{'datasetCode':_0x5df273}));return _0x4f3561[_0x565917(0x12d)]['markdown'];}function delay(_0x35826f){return new Promise(_0x3b4314=>setTimeout(_0x3b4314,_0x35826f));}export async function generateDatasetDocs(_0x41056b,_0x10a389,_0x488f46='./docs',_0x596969,_0x355419){const _0x431909=a3_0x547bed;mkdirSync(_0x488f46,{'recursive':!![]});const _0x5277fb=[],_0x103564=_0x41056b[_0x431909(0x13f)];console[_0x431909(0x128)](t(_0x431909(0x13e),{'count':_0x103564}));for(let _0x3ffdbf=0x0;_0x3ffdbf<_0x41056b[_0x431909(0x13f)];_0x3ffdbf++){const _0x47b75b=_0x41056b[_0x3ffdbf],_0x388f33=_0x3ffdbf+0x1,_0x5be2b2=_0x47b75b['tableName'];try{console[_0x431909(0x128)](t(_0x431909(0x124),{'current':_0x388f33,'total':_0x103564,'fileName':_0x5be2b2,'name':_0x47b75b['name']}));_0x596969&&_0x596969(_0x388f33,_0x103564,_0x5be2b2);const _0x4b0129=await fetchDatasetDoc({'appCode':_0x10a389,'datasetCode':_0x47b75b[_0x431909(0x12e)],'datasetId':_0x47b75b['id'],'enableAI':![],'extraParams':_0x355419}),_0x2674cb=a3_0x414639[_0x431909(0x12b)](_0x488f46,_0x5be2b2+_0x431909(0x135));writeFileSync(_0x2674cb,_0x4b0129,{'encoding':_0x431909(0x12a)}),console[_0x431909(0x128)](t(_0x431909(0x13d),{'fileName':_0x5be2b2})),logger['success'](_0x431909(0x136),_0x431909(0x142)+_0x5be2b2,undefined,{'datasetCode':_0x47b75b[_0x431909(0x12e)],'datasetName':_0x47b75b[_0x431909(0x13c)],'filePath':_0x2674cb,'progress':_0x388f33+'/'+_0x103564}),_0x5277fb['push']({'datasetCode':_0x47b75b[_0x431909(0x12e)],'datasetName':_0x47b75b[_0x431909(0x13c)],'filePath':_0x2674cb,'success':!![]}),_0x388f33<_0x103564&&await delay(0x1388);}catch(_0x3a1c70){const _0x4ecadc=_0x3a1c70 instanceof Error?_0x3a1c70['message']:String(_0x3a1c70);console[_0x431909(0x128)](t(_0x431909(0x12f),{'fileName':_0x5be2b2,'error':_0x4ecadc})),logger[_0x431909(0x13b)](_0x431909(0x136),_0x431909(0x11c)+_0x47b75b[_0x431909(0x12e)],{'datasetCode':_0x47b75b[_0x431909(0x12e)],'datasetName':_0x47b75b[_0x431909(0x13c)],'error':_0x4ecadc,'progress':_0x388f33+'/'+_0x103564}),_0x5277fb[_0x431909(0x129)]({'datasetCode':_0x47b75b[_0x431909(0x12e)],'datasetName':_0x47b75b[_0x431909(0x13c)],'filePath':'','success':![],'error':_0x4ecadc}),_0x388f33<_0x103564&&(console[_0x431909(0x128)](t(_0x431909(0x133))),await delay(0xbb8));}}return _0x5277fb;}
@@ -1 +1 @@
1
- (function(_0xb4b319,_0x41804d){const _0x194fbb=a4_0x345c,_0x5bc0c1=_0xb4b319();while(!![]){try{const _0x3ee2ab=-parseInt(_0x194fbb(0x136))/0x1*(-parseInt(_0x194fbb(0x14b))/0x2)+-parseInt(_0x194fbb(0x151))/0x3+-parseInt(_0x194fbb(0x13a))/0x4*(-parseInt(_0x194fbb(0x159))/0x5)+-parseInt(_0x194fbb(0x13f))/0x6+-parseInt(_0x194fbb(0x14f))/0x7+-parseInt(_0x194fbb(0x162))/0x8+parseInt(_0x194fbb(0x14a))/0x9*(parseInt(_0x194fbb(0x161))/0xa);if(_0x3ee2ab===_0x41804d)break;else _0x5bc0c1['push'](_0x5bc0c1['shift']());}catch(_0x2d16eb){_0x5bc0c1['push'](_0x5bc0c1['shift']());}}}(a4_0x5878,0xcc42a));import{jsx as a4_0x450a01,jsxs as a4_0x404762}from'react/jsx-runtime';import{useEffect,useState}from'react';function a4_0x345c(_0x4ab1d1,_0x4769d3){_0x4ab1d1=_0x4ab1d1-0x132;const _0x58785c=a4_0x5878();let _0x345c37=_0x58785c[_0x4ab1d1];return _0x345c37;}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a4_0x5878(){const _0x1ffcac=['4765440xcEqdh','💡\x20','拉取\x20API\x20配置失败:\x20','api.common.usingSpecifiedAppCode','Authentication','api.pullUI.importHint','slice','column','5HqTKYa','api.pullUI.clientFile','duplicateCount','-client','-api','lovrabet\x20auth','api.pullUI.pullFailed','cyan','438010vCHKUy','4572472ZehPmq','api.pullUI.modelFile','replace','dim','./src/api/','expired','originalCount','.ts','api.pullUI.duplicateInfo','1dxEdsY','modelCount','api.pullUI.successPull','api.common.usingDefaultAppCode','5180132YOMvpG','join','white','api.pullUI.generatedFiles','error','7109706HXIyCS','client','api','online','red','includes','api.pullUI.fetching','gray','env','{\x20lovrabetClient\x20}','yellow','387NzwqIq','3022270oOpXNr','split','cwd','message','3555797GDRqKp','setLogPath'];a4_0x5878=function(){return _0x1ffcac;};return a4_0x5878();}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';import{useI18n}from'../i18n/hooks.js';export const ApiPullUI=({appCode:_0x45431d,env:_0x3be9b5,output:_0x480b16})=>{const _0x3ee33d=a4_0x345c,{exit:_0x200e8a}=useApp(),{t:_0x346386}=useI18n(),[_0x4b5a03,_0x146ad2]=useState(![]),[_0x23118f,_0x45fd04]=useState(![]),[_0x58ef8f,_0x2e79fa]=useState(null),[_0x56371b,_0x1e5ea9]=useState(null),_0x127e68=readConfig(),_0x2c4ece=getConfigAppCode(),_0xf2b9e3=_0x45431d||_0x2c4ece,_0x331d0f=typeof _0x127e68?.[_0x3ee33d(0x147)]==='string'?_0x127e68['env']:undefined,_0x2576db=_0x3be9b5||_0x331d0f||_0x3ee33d(0x142);initEnv(_0x2576db);const _0x40ae74=_0x480b16||_0x3ee33d(0x166),_0x437e32=_0x45431d&&_0x45431d[_0x3ee33d(0x144)]('-')?_0x45431d[_0x3ee33d(0x14c)]('-')[_0x3ee33d(0x157)](0x1)[_0x3ee33d(0x13b)]('-'):'',_0x1aeb70=_0x45431d?_0x346386(_0x3ee33d(0x154),{'appCode':_0xf2b9e3}):_0x346386(_0x3ee33d(0x139),{'appCode':_0xf2b9e3}),_0x40e2aa=_0x437e32?_0x437e32+_0x3ee33d(0x15d):_0x3ee33d(0x141),_0x1e7867=_0x437e32?_0x437e32+_0x3ee33d(0x15c):_0x3ee33d(0x140);useEffect(()=>{_0x146ad2(!![]),_0xd0d367();},[]),useEffect(()=>{(_0x23118f||_0x58ef8f)&&_0x200e8a();},[_0x23118f,_0x58ef8f,_0x200e8a]);async function _0xd0d367(){const _0x235088=_0x3ee33d;if(!_0xf2b9e3){_0x2e79fa(_0x346386('api.common.noAppCodeDefault'));return;}try{logger[_0x235088(0x150)](process[_0x235088(0x14d)]());const {configArray:_0x238e04}=await fetchModelList(_0xf2b9e3),_0x6021a0=_0x238e04['length'],_0x5263c8=!_0x45431d,_0x524d28=await generateApiFile(_0x238e04,_0x437e32,_0xf2b9e3,_0x5263c8,_0x2576db,_0x40ae74),_0x40674f=_0x40ae74['endsWith']('/')?_0x40ae74:_0x40ae74+'/';_0x1e5ea9({'api':''+_0x40674f+_0x40e2aa+_0x235088(0x134),'client':''+_0x40674f+_0x1e7867+'.ts','modelCount':_0x524d28[_0x235088(0x137)],'datasetCount':_0x6021a0,'originalCount':_0x6021a0,'duplicateCount':0x0}),_0x45fd04(!![]);}catch(_0x3394b3){const _0x312967=_0x3394b3 instanceof Error?_0x3394b3[_0x235088(0x14e)]:String(_0x3394b3);logger[_0x235088(0x13e)]('api-pull',_0x235088(0x153)+_0x312967,{'appCode':_0xf2b9e3,'error':_0x312967}),_0x2e79fa(_0x346386(_0x235088(0x15f),{'error':_0x312967}));}finally{_0x146ad2(![]);}}return a4_0x404762(Box,{'flexDirection':_0x3ee33d(0x158),'children':[(_0x4b5a03||_0x23118f)&&a4_0x404762(Box,{'children':[a4_0x450a01(Text,{'color':_0x3ee33d(0x146),'children':'*\x20'}),a4_0x450a01(Text,{'color':_0x45431d?_0x3ee33d(0x13c):_0x3ee33d(0x165),'children':_0x1aeb70})]}),_0x4b5a03&&a4_0x450a01(Box,{'children':a4_0x450a01(Text,{'children':_0x346386(_0x3ee33d(0x145),{'env':_0x2576db})})}),_0x23118f&&_0x56371b&&a4_0x404762(Box,{'flexDirection':_0x3ee33d(0x158),'children':[a4_0x450a01(Box,{'children':a4_0x450a01(Text,{'color':'green','children':_0x346386(_0x3ee33d(0x138),{'datasetCount':_0x56371b['datasetCount'],'modelCount':_0x56371b[_0x3ee33d(0x137)]})})}),_0x56371b[_0x3ee33d(0x15b)]>0x0&&a4_0x450a01(Box,{'marginTop':0x1,'children':a4_0x450a01(Text,{'color':_0x3ee33d(0x149),'children':_0x346386(_0x3ee33d(0x135),{'originalCount':_0x56371b[_0x3ee33d(0x133)],'duplicateCount':_0x56371b[_0x3ee33d(0x15b)]})})}),a4_0x450a01(Box,{'marginTop':0x1,'children':a4_0x450a01(Text,{'color':_0x3ee33d(0x146),'children':_0x346386(_0x3ee33d(0x13d))})}),a4_0x404762(Box,{'marginLeft':0x2,'children':[a4_0x404762(Text,{'color':'cyan','children':['•\x20',_0x56371b[_0x3ee33d(0x141)]]}),a4_0x404762(Text,{'color':_0x3ee33d(0x165),'children':['\x20',_0x346386(_0x3ee33d(0x163),{'count':_0x56371b[_0x3ee33d(0x137)]})]})]}),a4_0x404762(Box,{'marginLeft':0x2,'children':[a4_0x404762(Text,{'color':_0x3ee33d(0x160),'children':['•\x20',_0x56371b[_0x3ee33d(0x140)]]}),a4_0x404762(Text,{'color':_0x3ee33d(0x165),'children':['\x20',_0x346386(_0x3ee33d(0x15a))]})]}),a4_0x450a01(Box,{'marginTop':0x1,'children':a4_0x450a01(Text,{'color':_0x3ee33d(0x146),'children':_0x346386(_0x3ee33d(0x156))})}),a4_0x450a01(Box,{'marginLeft':0x2,'children':a4_0x404762(Text,{'color':_0x3ee33d(0x149),'children':['import\x20',_0x3ee33d(0x148),'\x20from\x20\x27@/',_0x56371b['client'][_0x3ee33d(0x164)](/^\.\//,'')[_0x3ee33d(0x164)](_0x3ee33d(0x134),''),'\x27']})})]}),_0x58ef8f&&a4_0x404762(Box,{'flexDirection':_0x3ee33d(0x158),'children':[a4_0x450a01(Box,{'children':a4_0x404762(Text,{'color':_0x3ee33d(0x143),'children':['❌\x20',_0x58ef8f]})}),(_0x58ef8f[_0x3ee33d(0x144)]('登录')||_0x58ef8f[_0x3ee33d(0x144)](_0x3ee33d(0x155))||_0x58ef8f[_0x3ee33d(0x144)](_0x3ee33d(0x132)))&&a4_0x404762(Box,{'marginTop':0x1,'children':[a4_0x450a01(Text,{'color':_0x3ee33d(0x149),'children':_0x3ee33d(0x152)}),a4_0x450a01(Text,{'color':_0x3ee33d(0x160),'children':_0x3ee33d(0x15e)}),a4_0x404762(Text,{'color':_0x3ee33d(0x149),'children':['\x20',_0x346386('api.common.authRetry')]})]})]})]});};
1
+ (function(_0x3e1c2b,_0xbd30c1){const _0x33e68d=a4_0x31b3,_0x16874d=_0x3e1c2b();while(!![]){try{const _0x4388d8=-parseInt(_0x33e68d(0x130))/0x1+parseInt(_0x33e68d(0x13a))/0x2+-parseInt(_0x33e68d(0x142))/0x3+-parseInt(_0x33e68d(0x143))/0x4*(parseInt(_0x33e68d(0x12e))/0x5)+-parseInt(_0x33e68d(0x136))/0x6+-parseInt(_0x33e68d(0x14a))/0x7*(-parseInt(_0x33e68d(0x141))/0x8)+-parseInt(_0x33e68d(0x144))/0x9*(-parseInt(_0x33e68d(0x152))/0xa);if(_0x4388d8===_0xbd30c1)break;else _0x16874d['push'](_0x16874d['shift']());}catch(_0xdd5664){_0x16874d['push'](_0x16874d['shift']());}}}(a4_0x4c95,0x84bb1));import{jsx as a4_0xedb1f8,jsxs as a4_0x5c92cf}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';function a4_0x4c95(){const _0x35cd46=['5xdhuxV','import\x20','1029006bXqsyM','yellow','message','cyan','dim','includes','809706CtzrvP','column','拉取\x20API\x20配置失败:\x20','api.pullUI.clientFile','345962yBdZdG','duplicateCount','originalCount','white','client','api.common.authRetry','lovrabet\x20auth','8ZmLuwZ','2368551RSRDQf','786248YdgBrz','7346727SpqYbm','[ERROR]\x20','api.common.usingDefaultAppCode','env','gray','setLogPath','6216798fGOHxa','api','api.pullUI.modelFile','api.common.usingSpecifiedAppCode','string','.ts','endsWith','./src/api/','20ktiXoM','-client','slice','{\x20lovrabetClient\x20}','online','cwd','api-pull','api.pullUI.importHint','api.pullUI.successPull','length','replace','datasetCount','api.pullUI.generatedFiles','\x20from\x20\x27@/','Authentication','green','-api','red','api.common.noAppCodeDefault','error','join'];a4_0x4c95=function(){return _0x35cd46;};return a4_0x4c95();}import{fetchModelList}from'./fetch-model-list.js';function a4_0x31b3(_0x38d50a,_0x13c7c9){_0x38d50a=_0x38d50a-0x11c;const _0x4c950f=a4_0x4c95();let _0x31b391=_0x4c950f[_0x38d50a];return _0x31b391;}import{useI18n}from'../i18n/hooks.js';export const ApiPullUI=({appCode:_0xa84bf1,env:_0x1082ec,output:_0x2a174d})=>{const _0x1f646e=a4_0x31b3,{exit:_0x211c63}=useApp(),{t:_0x1e73e8}=useI18n(),[_0x5c9b08,_0x3079fc]=useState(![]),[_0x4dc361,_0x14aa85]=useState(![]),[_0x9f2c74,_0x4d950f]=useState(null),[_0x58d5c6,_0x2e3e0f]=useState(null),_0x27d434=readConfig(),_0x27e753=getConfigAppCode(),_0x5400b5=_0xa84bf1||_0x27e753,_0x5e8fac=typeof _0x27d434?.[_0x1f646e(0x147)]===_0x1f646e(0x14e)?_0x27d434[_0x1f646e(0x147)]:undefined,_0x56fd5d=_0x1082ec||_0x5e8fac||_0x1f646e(0x11d);initEnv(_0x56fd5d);const _0x18719b=_0x2a174d||_0x1f646e(0x151),_0x463332=_0xa84bf1&&_0xa84bf1['includes']('-')?_0xa84bf1['split']('-')[_0x1f646e(0x154)](0x1)[_0x1f646e(0x12d)]('-'):'',_0x1d5af2=_0xa84bf1?_0x1e73e8(_0x1f646e(0x14d),{'appCode':_0x5400b5}):_0x1e73e8(_0x1f646e(0x146),{'appCode':_0x5400b5}),_0x438ea5=_0x463332?_0x463332+_0x1f646e(0x129):_0x1f646e(0x14b),_0x3ab574=_0x463332?_0x463332+_0x1f646e(0x153):'client';useEffect(()=>{_0x3079fc(!![]),_0x215982();},[]),useEffect(()=>{(_0x4dc361||_0x9f2c74)&&_0x211c63();},[_0x4dc361,_0x9f2c74,_0x211c63]);async function _0x215982(){const _0x42210b=_0x1f646e;if(!_0x5400b5){_0x4d950f(_0x1e73e8(_0x42210b(0x12b)));return;}try{logger[_0x42210b(0x149)](process[_0x42210b(0x11e)]());const {configArray:_0x48eaa1}=await fetchModelList(_0x5400b5),_0xd9a352=_0x48eaa1[_0x42210b(0x122)],_0x1e5533=!_0xa84bf1,_0x5ad809=await generateApiFile(_0x48eaa1,_0x463332,_0x5400b5,_0x1e5533,_0x56fd5d,_0x18719b),_0x2399b5=_0x18719b[_0x42210b(0x150)]('/')?_0x18719b:_0x18719b+'/';_0x2e3e0f({'api':''+_0x2399b5+_0x438ea5+_0x42210b(0x14f),'client':''+_0x2399b5+_0x3ab574+'.ts','modelCount':_0x5ad809['modelCount'],'datasetCount':_0xd9a352,'originalCount':_0xd9a352,'duplicateCount':0x0}),_0x14aa85(!![]);}catch(_0x548118){const _0x5efe67=_0x548118 instanceof Error?_0x548118[_0x42210b(0x132)]:String(_0x548118);logger[_0x42210b(0x12c)](_0x42210b(0x11f),_0x42210b(0x138)+_0x5efe67,{'appCode':_0x5400b5,'error':_0x5efe67}),_0x4d950f(_0x1e73e8('api.pullUI.pullFailed',{'error':_0x5efe67}));}finally{_0x3079fc(![]);}}return a4_0x5c92cf(Box,{'flexDirection':_0x1f646e(0x137),'children':[(_0x5c9b08||_0x4dc361)&&a4_0x5c92cf(Box,{'children':[a4_0xedb1f8(Text,{'color':_0x1f646e(0x148),'children':'*\x20'}),a4_0xedb1f8(Text,{'color':_0xa84bf1?_0x1f646e(0x13d):_0x1f646e(0x134),'children':_0x1d5af2})]}),_0x5c9b08&&a4_0xedb1f8(Box,{'children':a4_0xedb1f8(Text,{'children':_0x1e73e8('api.pullUI.fetching',{'env':_0x56fd5d})})}),_0x4dc361&&_0x58d5c6&&a4_0x5c92cf(Box,{'flexDirection':'column','children':[a4_0xedb1f8(Box,{'children':a4_0xedb1f8(Text,{'color':_0x1f646e(0x128),'children':_0x1e73e8(_0x1f646e(0x121),{'datasetCount':_0x58d5c6[_0x1f646e(0x124)],'modelCount':_0x58d5c6['modelCount']})})}),_0x58d5c6[_0x1f646e(0x13b)]>0x0&&a4_0xedb1f8(Box,{'marginTop':0x1,'children':a4_0xedb1f8(Text,{'color':_0x1f646e(0x131),'children':_0x1e73e8('api.pullUI.duplicateInfo',{'originalCount':_0x58d5c6[_0x1f646e(0x13c)],'duplicateCount':_0x58d5c6[_0x1f646e(0x13b)]})})}),a4_0xedb1f8(Box,{'marginTop':0x1,'children':a4_0xedb1f8(Text,{'color':'gray','children':_0x1e73e8(_0x1f646e(0x125))})}),a4_0x5c92cf(Box,{'marginLeft':0x2,'children':[a4_0x5c92cf(Text,{'color':_0x1f646e(0x133),'children':['•\x20',_0x58d5c6['api']]}),a4_0x5c92cf(Text,{'color':_0x1f646e(0x134),'children':['\x20',_0x1e73e8(_0x1f646e(0x14c),{'count':_0x58d5c6['modelCount']})]})]}),a4_0x5c92cf(Box,{'marginLeft':0x2,'children':[a4_0x5c92cf(Text,{'color':'cyan','children':['•\x20',_0x58d5c6[_0x1f646e(0x13e)]]}),a4_0x5c92cf(Text,{'color':_0x1f646e(0x134),'children':['\x20',_0x1e73e8(_0x1f646e(0x139))]})]}),a4_0xedb1f8(Box,{'marginTop':0x1,'children':a4_0xedb1f8(Text,{'color':'gray','children':_0x1e73e8(_0x1f646e(0x120))})}),a4_0xedb1f8(Box,{'marginLeft':0x2,'children':a4_0x5c92cf(Text,{'color':_0x1f646e(0x131),'children':[_0x1f646e(0x12f),_0x1f646e(0x11c),_0x1f646e(0x126),_0x58d5c6[_0x1f646e(0x13e)][_0x1f646e(0x123)](/^\.\//,'')[_0x1f646e(0x123)](_0x1f646e(0x14f),''),'\x27']})})]}),_0x9f2c74&&a4_0x5c92cf(Box,{'flexDirection':_0x1f646e(0x137),'children':[a4_0xedb1f8(Box,{'children':a4_0x5c92cf(Text,{'color':_0x1f646e(0x12a),'children':[_0x1f646e(0x145),_0x9f2c74]})}),(_0x9f2c74['includes']('登录')||_0x9f2c74[_0x1f646e(0x135)](_0x1f646e(0x127))||_0x9f2c74[_0x1f646e(0x135)]('expired'))&&a4_0x5c92cf(Box,{'marginTop':0x1,'children':[a4_0xedb1f8(Text,{'color':_0x1f646e(0x131),'children':'*\x20'}),a4_0xedb1f8(Text,{'color':_0x1f646e(0x133),'children':_0x1f646e(0x140)}),a4_0x5c92cf(Text,{'color':_0x1f646e(0x131),'children':['\x20',_0x1e73e8(_0x1f646e(0x13f))]})]})]})]});};
@@ -1 +1 @@
1
- const a5_0x25bc10=a5_0x1413;(function(_0x33780a,_0x3a3722){const _0x13a707=a5_0x1413,_0x3f17e7=_0x33780a();while(!![]){try{const _0x2cb273=-parseInt(_0x13a707(0x17c))/0x1*(-parseInt(_0x13a707(0x180))/0x2)+-parseInt(_0x13a707(0x177))/0x3+-parseInt(_0x13a707(0x17d))/0x4+-parseInt(_0x13a707(0x182))/0x5+-parseInt(_0x13a707(0x18f))/0x6*(parseInt(_0x13a707(0x17e))/0x7)+-parseInt(_0x13a707(0x183))/0x8*(parseInt(_0x13a707(0x173))/0x9)+parseInt(_0x13a707(0x189))/0xa;if(_0x2cb273===_0x3a3722)break;else _0x3f17e7['push'](_0x3f17e7['shift']());}catch(_0x41eec7){_0x3f17e7['push'](_0x3f17e7['shift']());}}}(a5_0x304f,0x200b6));import{getCookie}from'../auth/get-cookie.js';function a5_0x1413(_0x5a4249,_0xac64bc){_0x5a4249=_0x5a4249-0x171;const _0x304fcc=a5_0x304f();let _0x141389=_0x304fcc[_0x5a4249];return _0x141389;}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';import a5_0x26640a from'../i18n/index.js';const t=a5_0x26640a['t'][a5_0x25bc10(0x179)](a5_0x26640a);function a5_0x304f(){const _0x546030=['json','960qCCFdU','includes','name','api.common.authExpired','success','data','trim','/api/node-toolbox/dataset/model-list?appcode=','api.common.unknownError','1364481QCrpzc','replace','&otype=array','fetch-model-list','189150PkIwwO','code','bind','message','info','4849zEONzo','550868UPrHCk','7000cQmDwZ','status','20vDNfVX','length','642200eRTfpH','8lRkqUK','401','configArray','errorMsg','api.fetchModel.fetchError','api.fetchModel.httpError','7235800DIGmrn','errorCode','error','map','Unauthorized'];a5_0x304f=function(){return _0x546030;};return a5_0x304f();}function cleanNewlines(_0x5be4d7){const _0x1a5868=a5_0x25bc10;return _0x5be4d7[_0x1a5868(0x174)](/[\r\n]+/g,'\x20')[_0x1a5868(0x195)]();}function cleanDatasetName(_0x5d1907){const _0x37f2e0=a5_0x25bc10;if(!_0x5d1907['name'])return _0x5d1907;return{..._0x5d1907,'name':cleanNewlines(_0x5d1907[_0x37f2e0(0x191)])};}function cleanDatasetNames(_0x4feafd){const _0x53051e=a5_0x25bc10;return _0x4feafd[_0x53051e(0x18c)](cleanDatasetName);}export async function fetchModelList(_0x28d9bd){const _0x4d61fe=a5_0x25bc10,_0x288d32=getEnv(),_0x235c58=getApiDomain()+_0x4d61fe(0x171)+_0x28d9bd+_0x4d61fe(0x175);logger[_0x4d61fe(0x17b)](_0x4d61fe(0x176),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x288d32+')',{'apiUrl':_0x235c58});const _0x2f9ec2=await fetch(_0x235c58,{'headers':{'Cookie':getCookie()}});if(!_0x2f9ec2['ok']){if(_0x2f9ec2[_0x4d61fe(0x17f)]===0x191)throw new Error(t(_0x4d61fe(0x192)));throw new Error(t(_0x4d61fe(0x188),{'status':_0x2f9ec2['status']}));}const _0x2e2511=await _0x2f9ec2[_0x4d61fe(0x18e)]();if(!_0x2e2511[_0x4d61fe(0x193)]){const _0x5a2b75=_0x2e2511[_0x4d61fe(0x186)]||_0x2e2511[_0x4d61fe(0x17a)]||_0x2e2511[_0x4d61fe(0x194)]?.['message']||_0x2e2511['errorMessage']||_0x2e2511[_0x4d61fe(0x18b)]||t(_0x4d61fe(0x172));if(_0x5a2b75[_0x4d61fe(0x190)](_0x4d61fe(0x184))||_0x5a2b75[_0x4d61fe(0x190)](_0x4d61fe(0x18d))||_0x5a2b75['includes']('登录')||_0x5a2b75[_0x4d61fe(0x190)]('认证')||_0x2e2511[_0x4d61fe(0x18a)]==='UNAUTHORIZED'||_0x2e2511[_0x4d61fe(0x178)]===0x191||_0x2e2511[_0x4d61fe(0x178)]===_0x4d61fe(0x184))throw new Error(t(_0x4d61fe(0x192)));throw new Error(t(_0x4d61fe(0x187),{'error':_0x5a2b75}));}const _0xf410c3=cleanDatasetNames(_0x2e2511[_0x4d61fe(0x194)][_0x4d61fe(0x185)]);return{'configArray':_0xf410c3,'count':_0xf410c3[_0x4d61fe(0x181)]};}
1
+ const a5_0xc001e3=a5_0x4a75;(function(_0x55f9ae,_0x32088a){const _0x42737c=a5_0x4a75,_0x152412=_0x55f9ae();while(!![]){try{const _0x1572ec=parseInt(_0x42737c(0x1e7))/0x1*(-parseInt(_0x42737c(0x1fd))/0x2)+parseInt(_0x42737c(0x1ea))/0x3*(parseInt(_0x42737c(0x200))/0x4)+parseInt(_0x42737c(0x1f0))/0x5*(-parseInt(_0x42737c(0x1f6))/0x6)+-parseInt(_0x42737c(0x1f4))/0x7+parseInt(_0x42737c(0x1f9))/0x8*(parseInt(_0x42737c(0x1ee))/0x9)+parseInt(_0x42737c(0x1ef))/0xa+parseInt(_0x42737c(0x1f5))/0xb;if(_0x1572ec===_0x32088a)break;else _0x152412['push'](_0x152412['shift']());}catch(_0x1132ef){_0x152412['push'](_0x152412['shift']());}}}(a5_0x3658,0x9c5ba));import{getCookie}from'../auth/get-cookie.js';function a5_0x3658(){const _0x20f93d=['7417848GUyJoS','bind','code','message','262456ZdJUwk','json','name','64yDEDsO','replace','/api/node-toolbox/dataset/model-list?appcode=','includes','errorCode','api.common.authExpired','configArray','2eYxySR','401','UNAUTHORIZED','25278gziKmJ','success','data','length','9BlEYez','7971990nCELXU','900175Cpuiml','&otype=array','api.common.unknownError','api.fetchModel.fetchError','8548596wLkwcf','8854835dFywuG','18UDZIOG','status','map'];a5_0x3658=function(){return _0x20f93d;};return a5_0x3658();}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';import a5_0x31af06 from'../i18n/index.js';const t=a5_0x31af06['t'][a5_0xc001e3(0x1fa)](a5_0x31af06);function cleanNewlines(_0x2d74f9){const _0x2f43e7=a5_0xc001e3;return _0x2d74f9[_0x2f43e7(0x201)](/[\r\n]+/g,'\x20')['trim']();}function cleanDatasetName(_0x237e6e){const _0x5cd526=a5_0xc001e3;if(!_0x237e6e[_0x5cd526(0x1ff)])return _0x237e6e;return{..._0x237e6e,'name':cleanNewlines(_0x237e6e[_0x5cd526(0x1ff)])};}function a5_0x4a75(_0x51ed04,_0x5344cc){_0x51ed04=_0x51ed04-0x1e4;const _0x3658e1=a5_0x3658();let _0x4a752d=_0x3658e1[_0x51ed04];return _0x4a752d;}function cleanDatasetNames(_0x462bb6){const _0x12d68f=a5_0xc001e3;return _0x462bb6[_0x12d68f(0x1f8)](cleanDatasetName);}export async function fetchModelList(_0x57e97c){const _0x20878c=a5_0xc001e3,_0x20c30b=getEnv(),_0x4099af=getApiDomain()+_0x20878c(0x202)+_0x57e97c+_0x20878c(0x1f1);logger['info']('fetch-model-list','正在从服务器拉取模型列表...\x20(环境:\x20'+_0x20c30b+')',{'apiUrl':_0x4099af});const _0x3612d2=await fetch(_0x4099af,{'headers':{'Cookie':getCookie()}});if(!_0x3612d2['ok']){if(_0x3612d2[_0x20878c(0x1f7)]===0x191)throw new Error(t(_0x20878c(0x1e5)));throw new Error(t('api.fetchModel.httpError',{'status':_0x3612d2[_0x20878c(0x1f7)]}));}const _0x14586e=await _0x3612d2[_0x20878c(0x1fe)]();if(!_0x14586e[_0x20878c(0x1eb)]){const _0x296d52=_0x14586e['errorMsg']||_0x14586e[_0x20878c(0x1fc)]||_0x14586e['data']?.[_0x20878c(0x1fc)]||_0x14586e['errorMessage']||_0x14586e['error']||t(_0x20878c(0x1f2));if(_0x296d52['includes']('401')||_0x296d52[_0x20878c(0x203)]('Unauthorized')||_0x296d52[_0x20878c(0x203)]('登录')||_0x296d52[_0x20878c(0x203)]('认证')||_0x14586e[_0x20878c(0x1e4)]===_0x20878c(0x1e9)||_0x14586e['code']===0x191||_0x14586e[_0x20878c(0x1fb)]===_0x20878c(0x1e8))throw new Error(t('api.common.authExpired'));throw new Error(t(_0x20878c(0x1f3),{'error':_0x296d52}));}const _0x595ac2=cleanDatasetNames(_0x14586e[_0x20878c(0x1ec)][_0x20878c(0x1e6)]);return{'configArray':_0x595ac2,'count':_0x595ac2[_0x20878c(0x1ed)]};}
@@ -1 +1 @@
1
- const a6_0x388461=a6_0x1f25;function a6_0x23fb(){const _0x40ef85=['online','2303817abnIls','typescript','api.generateFile.noAppCode','tableName','length','client','string','./src/api/','join','alias','templates/generate-api','client.ts.tpl','.ts','2640687xwVwvg','5180090mPtEgj','push','{\x20apiConfigName:\x20','endsWith','datasetCode','init-api','-api','resolve','371857YjTEzL','utf8','CONFIG_NAMES.DEFAULT','../..','format','forEach','\x22\x20}','{\x20apiConfigName:\x20\x22','2497404dvjzwg','dirname',',\x20env:\x20\x22','bind','success','app','2476896jCvNyd','api','3207756wVFivP','104QSUELZ','key','replaceApiContent','API\x20文件生成成功!','env'];a6_0x23fb=function(){return _0x40ef85;};return a6_0x23fb();}(function(_0x48c5cb,_0x117abf){const _0xbc4f99=a6_0x1f25,_0x5d1932=_0x48c5cb();while(!![]){try{const _0x27d8df=parseInt(_0xbc4f99(0x10f))/0x1+-parseInt(_0xbc4f99(0x11f))/0x2+-parseInt(_0xbc4f99(0xf9))/0x3+-parseInt(_0xbc4f99(0x117))/0x4+-parseInt(_0xbc4f99(0x107))/0x5+-parseInt(_0xbc4f99(0x11d))/0x6+-parseInt(_0xbc4f99(0x106))/0x7*(-parseInt(_0xbc4f99(0x120))/0x8);if(_0x27d8df===_0x117abf)break;else _0x5d1932['push'](_0x5d1932['shift']());}catch(_0x5bc889){_0x5d1932['push'](_0x5d1932['shift']());}}}(a6_0x23fb,0xcae0c));import a6_0xf7994e from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a6_0x29a348 from'node:path';import{fileURLToPath}from'node:url';function a6_0x1f25(_0x57e29e,_0x1b5373){_0x57e29e=_0x57e29e-0xf6;const _0x23fb85=a6_0x23fb();let _0x1f2551=_0x23fb85[_0x57e29e];return _0x1f2551;}import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';import a6_0x25afa7 from'../i18n/index.js';const t=a6_0x25afa7['t'][a6_0x388461(0x11a)](a6_0x25afa7);export async function generateApiFile(_0x40bc76,_0x27586c='',_0x19a943,_0x1ec988=![],_0x12ace5,_0x42309d=a6_0x388461(0x100)){const _0x58241b=a6_0x388461,_0x1aafff=readConfig(),_0x154623=_0x19a943||_0x1aafff?.[_0x58241b(0x11c)];if(typeof _0x154623!==_0x58241b(0xff)||!_0x154623)throw new Error(t(_0x58241b(0xfb)));const _0x1f5eca=_0x1ec988?_0x58241b(0x111):'\x22'+_0x154623+'\x22',_0x38783e=typeof _0x1aafff[_0x58241b(0xf7)]===_0x58241b(0xff)?_0x1aafff['env']:undefined,_0xbc687f=_0x12ace5||_0x38783e||_0x58241b(0xf8),_0x45c41f=_0xbc687f!==_0x58241b(0xf8);let _0x3bf3c1;if(_0x1ec988)_0x45c41f?_0x3bf3c1=_0x58241b(0x109)+_0x1f5eca+_0x58241b(0x119)+_0xbc687f+_0x58241b(0x115):_0x3bf3c1='';else{const _0x4d8327=_0x45c41f?_0x58241b(0x119)+_0xbc687f+'\x22':'';_0x3bf3c1=_0x58241b(0x116)+_0x154623+'\x22'+_0x4d8327+'\x20}';}const _0x3b8fff=_0x27586c?_0x27586c+_0x58241b(0x10d):_0x58241b(0x11e),_0x789d8f=_0x27586c?_0x27586c+'-client':_0x58241b(0xfe),_0x4a4cce=[];_0x40bc76[_0x58241b(0x114)](_0x292845=>{const _0x165e2b=_0x58241b;_0x4a4cce[_0x165e2b(0x108)]({'datasetCode':_0x292845[_0x165e2b(0x10b)],'tableName':_0x292845[_0x165e2b(0xfc)],'name':_0x292845['name']||'','alias':_0x292845[_0x165e2b(0x102)]||_0x292845[_0x165e2b(0x121)]});});const _0x2e5c0d=fileURLToPath(import.meta.url),_0x22f200=a6_0x29a348[_0x58241b(0x10e)](a6_0x29a348[_0x58241b(0x118)](_0x2e5c0d),_0x58241b(0x112)),_0x54d139=a6_0x29a348[_0x58241b(0x101)](_0x22f200,_0x58241b(0x103)),_0x441158=a6_0x29a348[_0x58241b(0x101)](_0x54d139,'api.ts.tpl'),_0x2cfa83=a6_0x29a348['join'](_0x54d139,_0x58241b(0x104)),_0x37cc56=_0x42309d[_0x58241b(0x10a)]('/')?_0x42309d['slice'](0x0,-0x1):_0x42309d;mkdirSync(_0x37cc56,{'recursive':!![]});const _0xb6799b=_0x4a4cce[0x0]?.[_0x58241b(0x102)],_0x307d75=readFileSync(_0x441158,'utf8'),_0x1e6b93=TemplateReplacer[_0x58241b(0x122)](_0x307d75,_0x154623,_0x4a4cce,_0xb6799b,_0x3b8fff,_0x1f5eca),_0x104326=await a6_0xf7994e[_0x58241b(0x113)](_0x1e6b93,{'parser':_0x58241b(0xfa)}),_0x2255fc=_0x37cc56+'/'+_0x3b8fff+_0x58241b(0x105);writeFileSync(_0x2255fc,_0x104326,{'encoding':'utf8'});const _0x28db93=readFileSync(_0x2cfa83,_0x58241b(0x110)),_0x4ff3f4=TemplateReplacer['replaceApiContent'](_0x28db93,_0x154623,_0x4a4cce,_0xb6799b,_0x3b8fff,_0x1f5eca,_0x3bf3c1),_0x26e2e2=await a6_0xf7994e['format'](_0x4ff3f4,{'parser':'typescript'}),_0x5248f9=_0x37cc56+'/'+_0x789d8f+_0x58241b(0x105);writeFileSync(_0x5248f9,_0x26e2e2,{'encoding':'utf8'});const _0x1e1f09=_0x4a4cce[_0x58241b(0xfd)];return logger[_0x58241b(0x11b)](_0x58241b(0x10c),_0x58241b(0xf6),undefined,{'apiFile':_0x2255fc,'clientFile':_0x5248f9,'modelCount':_0x1e1f09,'configName':_0x1f5eca}),{'modelCount':_0x1e1f09,'apiFilePath':_0x2255fc,'clientFilePath':_0x5248f9,'configName':_0x1f5eca};}
1
+ const a6_0x30af0f=a6_0x36db;(function(_0x5e91b6,_0x58d51a){const _0x2b2d39=a6_0x36db,_0x45ce17=_0x5e91b6();while(!![]){try{const _0x994556=parseInt(_0x2b2d39(0x81))/0x1+-parseInt(_0x2b2d39(0x8b))/0x2*(-parseInt(_0x2b2d39(0x85))/0x3)+-parseInt(_0x2b2d39(0x8e))/0x4*(parseInt(_0x2b2d39(0x87))/0x5)+parseInt(_0x2b2d39(0x82))/0x6*(parseInt(_0x2b2d39(0x7b))/0x7)+-parseInt(_0x2b2d39(0x73))/0x8+parseInt(_0x2b2d39(0x95))/0x9+-parseInt(_0x2b2d39(0x91))/0xa;if(_0x994556===_0x58d51a)break;else _0x45ce17['push'](_0x45ce17['shift']());}catch(_0x11933b){_0x45ce17['push'](_0x45ce17['shift']());}}}(a6_0x1077,0x581d4));import a6_0xc890dd from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a6_0x41e72f from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a6_0x36db(_0x25c910,_0xefc299){_0x25c910=_0x25c910-0x71;const _0x107748=a6_0x1077();let _0x36dbf1=_0x107748[_0x25c910];return _0x36dbf1;}import{logger}from'../utils/logger.js';import a6_0x52ce82 from'../i18n/index.js';const t=a6_0x52ce82['t'][a6_0x30af0f(0x90)](a6_0x52ce82);function a6_0x1077(){const _0x42aef2=['api.ts.tpl','\x22\x20}','3026GgEUei','-api','success','2051068jgCzzq','resolve','bind','10705200TnBuGi','name','.ts','../..','5540985LYXdaR','tableName','-client','online','endsWith','1464376ImAjRj','CONFIG_NAMES.DEFAULT','alias','slice','utf8','{\x20apiConfigName:\x20','typescript','client.ts.tpl','1477qVHaii','string','dirname','format','join','app','702834sfngzi','19986pAmoxQ','replaceApiContent','client','210GyAzcS',',\x20env:\x20\x22','5nwSGPH','{\x20apiConfigName:\x20\x22'];a6_0x1077=function(){return _0x42aef2;};return a6_0x1077();}export async function generateApiFile(_0x44e01d,_0x50419f='',_0x91c4d,_0x5a0fd9=![],_0x5bf153,_0x214f8b='./src/api/'){const _0x4e6f44=a6_0x30af0f,_0x30f7d6=readConfig(),_0x407494=_0x91c4d||_0x30f7d6?.[_0x4e6f44(0x80)];if(typeof _0x407494!==_0x4e6f44(0x7c)||!_0x407494)throw new Error(t('api.generateFile.noAppCode'));const _0x513624=_0x5a0fd9?_0x4e6f44(0x74):'\x22'+_0x407494+'\x22',_0x254b52=typeof _0x30f7d6['env']===_0x4e6f44(0x7c)?_0x30f7d6['env']:undefined,_0x3094b2=_0x5bf153||_0x254b52||_0x4e6f44(0x71),_0x27cb11=_0x3094b2!==_0x4e6f44(0x71);let _0x4257c4;if(_0x5a0fd9)_0x27cb11?_0x4257c4=_0x4e6f44(0x78)+_0x513624+_0x4e6f44(0x86)+_0x3094b2+_0x4e6f44(0x8a):_0x4257c4='';else{const _0x3ac3ae=_0x27cb11?_0x4e6f44(0x86)+_0x3094b2+'\x22':'';_0x4257c4=_0x4e6f44(0x88)+_0x407494+'\x22'+_0x3ac3ae+'\x20}';}const _0x37fad3=_0x50419f?_0x50419f+_0x4e6f44(0x8c):'api',_0x33f52c=_0x50419f?_0x50419f+_0x4e6f44(0x97):_0x4e6f44(0x84),_0x292965=[];_0x44e01d['forEach'](_0x10181f=>{const _0x37cf8b=_0x4e6f44;_0x292965['push']({'datasetCode':_0x10181f['datasetCode'],'tableName':_0x10181f[_0x37cf8b(0x96)],'name':_0x10181f[_0x37cf8b(0x92)]||'','alias':_0x10181f['alias']||_0x10181f['key']});});const _0x4301eb=fileURLToPath(import.meta.url),_0x523257=a6_0x41e72f[_0x4e6f44(0x8f)](a6_0x41e72f[_0x4e6f44(0x7d)](_0x4301eb),_0x4e6f44(0x94)),_0x599ecd=a6_0x41e72f[_0x4e6f44(0x7f)](_0x523257,'templates/generate-api'),_0x15d818=a6_0x41e72f[_0x4e6f44(0x7f)](_0x599ecd,_0x4e6f44(0x89)),_0x392d1b=a6_0x41e72f[_0x4e6f44(0x7f)](_0x599ecd,_0x4e6f44(0x7a)),_0x40202e=_0x214f8b[_0x4e6f44(0x72)]('/')?_0x214f8b[_0x4e6f44(0x76)](0x0,-0x1):_0x214f8b;mkdirSync(_0x40202e,{'recursive':!![]});const _0x2ea687=_0x292965[0x0]?.[_0x4e6f44(0x75)],_0x4eb460=readFileSync(_0x15d818,_0x4e6f44(0x77)),_0x673fcd=TemplateReplacer[_0x4e6f44(0x83)](_0x4eb460,_0x407494,_0x292965,_0x2ea687,_0x37fad3,_0x513624),_0x410810=await a6_0xc890dd[_0x4e6f44(0x7e)](_0x673fcd,{'parser':_0x4e6f44(0x79)}),_0x38b8ff=_0x40202e+'/'+_0x37fad3+'.ts';writeFileSync(_0x38b8ff,_0x410810,{'encoding':'utf8'});const _0x51dfb5=readFileSync(_0x392d1b,'utf8'),_0x4b4b4d=TemplateReplacer[_0x4e6f44(0x83)](_0x51dfb5,_0x407494,_0x292965,_0x2ea687,_0x37fad3,_0x513624,_0x4257c4),_0x5e19c9=await a6_0xc890dd[_0x4e6f44(0x7e)](_0x4b4b4d,{'parser':_0x4e6f44(0x79)}),_0x2583a4=_0x40202e+'/'+_0x33f52c+_0x4e6f44(0x93);writeFileSync(_0x2583a4,_0x5e19c9,{'encoding':_0x4e6f44(0x77)});const _0xbaab57=_0x292965['length'];return logger[_0x4e6f44(0x8d)]('init-api','API\x20文件生成成功!',undefined,{'apiFile':_0x38b8ff,'clientFile':_0x2583a4,'modelCount':_0xbaab57,'configName':_0x513624}),{'modelCount':_0xbaab57,'apiFilePath':_0x38b8ff,'clientFilePath':_0x2583a4,'configName':_0x513624};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- const a7_0x1164ee=a7_0x5890;(function(_0x5f41d8,_0x3e9c54){const _0x528731=a7_0x5890,_0x110e6b=_0x5f41d8();while(!![]){try{const _0x4f3cc3=-parseInt(_0x528731(0x1df))/0x1*(parseInt(_0x528731(0x20b))/0x2)+parseInt(_0x528731(0x1c8))/0x3*(parseInt(_0x528731(0x1d3))/0x4)+parseInt(_0x528731(0x1e2))/0x5+parseInt(_0x528731(0x206))/0x6+parseInt(_0x528731(0x1d4))/0x7*(parseInt(_0x528731(0x1f7))/0x8)+parseInt(_0x528731(0x1d0))/0x9*(parseInt(_0x528731(0x210))/0xa)+-parseInt(_0x528731(0x1ce))/0xb;if(_0x4f3cc3===_0x3e9c54)break;else _0x110e6b['push'](_0x110e6b['shift']());}catch(_0xa24e24){_0x110e6b['push'](_0x110e6b['shift']());}}}(a7_0x37f5,0xb33ef));import{jsx as a7_0x58c931}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a7_0x5890(_0x5b1524,_0x40afd2){_0x5b1524=_0x5b1524-0x1bd;const _0x37f557=a7_0x37f5();let _0x58905f=_0x37f557[_0x5b1524];return _0x58905f;}function a7_0x37f5(){const _0xa9a778=['8zmwpKJ','\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20','api.help.usage','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20','datasetcode','api.common.noAppCodeOption1','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','api.help.optAppcode','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','doc','api.help.pullDesc','api.help.optDatasetcode','\x1b[0m','api.help.optHelp','1356720UqONJR','error','bind','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a','2294138ygeQAb','\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.help.pullEnv','6890OXCRHv','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20','length','api.help.docDatasets','parse','output','env','api.common.noAppCode','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','api.help.availableCommands','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','35016TtsFmB','object','api.common.usingConfigAppCode','input','\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','api.common.noAppCodeHint','16628788bXYhRS','api.help.pullOutput','11619yoMTAM','exit','log','264tWbBNk','9333548oljwVP','api.help.title','api.help.docOutput','trim','split','api.help.unknownCommand','isArray','api.help.docEnv','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','appcode','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20','1uybNnJ','api.help.docDataset','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','868165YkqasX','flags','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.paramsNotJson','\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.useAppcodeFlag','string','\x1b[90m','api.help.optEnv','help','api.help.examples','api.common.onlyGenerateDatasets','api.help.docDesc','api.common.paramsError','api.common.noAppCodeOption2Pull','api.common.noPositionalArgs','message','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.help.options','api.help.docAppcode'];a7_0x37f5=function(){return _0xa9a778;};return a7_0x37f5();}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';import a7_0x5a326c from'../i18n/index.js';const t=a7_0x5a326c['t'][a7_0x1164ee(0x208)](a7_0x5a326c);export async function apiCli(_0x244150){const _0x24d4ae=a7_0x1164ee,_0x4e8cba=_0x244150['input'][0x1];if(_0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1ec)]){console[_0x24d4ae(0x1d2)]('\x0a'+t(_0x24d4ae(0x1d5))+'\x0a\x0a'+t(_0x24d4ae(0x1f9))+_0x24d4ae(0x20a)+t(_0x24d4ae(0x1f5))+_0x24d4ae(0x1f8)+t(_0x24d4ae(0x1fe))+_0x24d4ae(0x20c)+t('api.help.optOutput')+_0x24d4ae(0x1cc)+t(_0x24d4ae(0x1eb))+'\x0a\x20\x20--datasetcode\x20<codes>\x20'+t(_0x24d4ae(0x203))+'\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+t(_0x24d4ae(0x205))+'\x0a\x0a'+t(_0x24d4ae(0x1ed))+_0x24d4ae(0x20e)+t(_0x24d4ae(0x202))+_0x24d4ae(0x1fa)+t('api.help.pullAppcode')+_0x24d4ae(0x1de)+t('api.help.pullOutput')+_0x24d4ae(0x1c6)+t('api.help.pullEnv')+_0x24d4ae(0x1e6)+t(_0x24d4ae(0x1ef))+_0x24d4ae(0x1dc)+t('api.help.docAppcode')+_0x24d4ae(0x1e1)+t(_0x24d4ae(0x1d6))+_0x24d4ae(0x1f4)+t(_0x24d4ae(0x1db))+_0x24d4ae(0x211)+t(_0x24d4ae(0x1e0))+'\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20'+t(_0x24d4ae(0x1bf))+'\x0a');return;}if(_0x4e8cba==='pull'){_0x244150[_0x24d4ae(0x1cb)][0x2]&&(console[_0x24d4ae(0x207)](t(_0x24d4ae(0x1f2))),console[_0x24d4ae(0x1d2)](t(_0x24d4ae(0x1e8))),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1c4)+_0x244150[_0x24d4ae(0x1cb)][0x2]),process[_0x24d4ae(0x1d1)](0x1));const _0x49dfc3=getConfigAppCode();let _0x4874fa=_0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1dd)];const _0x235d5c=typeof _0x244150['flags'][_0x24d4ae(0x1c2)]===_0x24d4ae(0x1e9)?_0x244150['flags'][_0x24d4ae(0x1c2)]:undefined,_0x3bf05b=_0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1c1)];!_0x4874fa&&!_0x49dfc3&&(console[_0x24d4ae(0x207)](t(_0x24d4ae(0x1c3))),console['log'](t(_0x24d4ae(0x1cd))),console[_0x24d4ae(0x1d2)](t(_0x24d4ae(0x1fc))),console[_0x24d4ae(0x1d2)](t(_0x24d4ae(0x1f1))),process[_0x24d4ae(0x1d1)](0x1)),_0x4874fa&&_0x49dfc3&&_0x4874fa===_0x49dfc3&&(console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1ea)+t(_0x24d4ae(0x1ca),{'appCode':_0x4874fa})+_0x24d4ae(0x204)),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1ea)+t('api.common.usingConfigAppCodeHint')+_0x24d4ae(0x204)),_0x4874fa=undefined),render(a7_0x58c931(ApiPullUI,{'appCode':_0x4874fa,'env':_0x235d5c,'output':_0x3bf05b}));}else{if(_0x4e8cba===_0x24d4ae(0x201)){_0x244150[_0x24d4ae(0x1cb)][0x2]&&(console[_0x24d4ae(0x207)](t(_0x24d4ae(0x1f2))),console[_0x24d4ae(0x1d2)](t('api.common.useAppcodeFlag')),console['log'](_0x24d4ae(0x1fd)+_0x244150['input'][0x2]),process[_0x24d4ae(0x1d1)](0x1));const _0x54e242=getConfigAppCode();let _0x7bb3ba=_0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1dd)];const _0x3e456c=typeof _0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1c2)]===_0x24d4ae(0x1e9)?_0x244150[_0x24d4ae(0x1e3)]['env']:undefined,_0x397c92=_0x244150[_0x24d4ae(0x1e3)][_0x24d4ae(0x1c1)],_0x25a74f=_0x244150['flags']['params'],_0xb94c06=_0x244150['flags'][_0x24d4ae(0x1fb)];!_0x7bb3ba&&!_0x54e242&&(console[_0x24d4ae(0x207)](t(_0x24d4ae(0x1c3))),console['log'](t(_0x24d4ae(0x1cd))),console[_0x24d4ae(0x1d2)](t(_0x24d4ae(0x1fc))),console['log'](t('api.common.noAppCodeOption2Doc')),process[_0x24d4ae(0x1d1)](0x1));_0x7bb3ba&&_0x54e242&&_0x7bb3ba===_0x54e242&&(console['log'](_0x24d4ae(0x1ea)+t('api.common.usingConfigAppCode',{'appCode':_0x7bb3ba})+_0x24d4ae(0x204)),_0x7bb3ba=undefined);let _0x59ab9e;if(_0x25a74f)try{_0x59ab9e=JSON[_0x24d4ae(0x1c0)](_0x25a74f),(typeof _0x59ab9e!==_0x24d4ae(0x1c9)||_0x59ab9e===null||Array[_0x24d4ae(0x1da)](_0x59ab9e))&&(console[_0x24d4ae(0x207)](t('api.common.paramsInvalidJson')),process[_0x24d4ae(0x1d1)](0x1));}catch(_0x5589e4){console[_0x24d4ae(0x207)](t(_0x24d4ae(0x1e5))),console['error'](t(_0x24d4ae(0x1f0),{'error':_0x5589e4 instanceof Error?_0x5589e4[_0x24d4ae(0x1f3)]:String(_0x5589e4)})),process['exit'](0x1);}let _0x2e6110;_0xb94c06&&(_0x2e6110=_0xb94c06[_0x24d4ae(0x1d8)](',')['map'](_0x2ac29f=>_0x2ac29f[_0x24d4ae(0x1d7)]())['filter'](_0x23335b=>_0x23335b[_0x24d4ae(0x1be)]>0x0),_0x2e6110[_0x24d4ae(0x1be)]===0x0&&(console[_0x24d4ae(0x207)](t('api.common.datasetcodeEmpty')),process[_0x24d4ae(0x1d1)](0x1)),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1ea)+t(_0x24d4ae(0x1ee),{'codes':_0x2e6110['join'](',\x20')})+'\x1b[0m')),render(a7_0x58c931(ApiDocUI,{'appCode':_0x7bb3ba,'env':_0x3e456c,'output':_0x397c92,'extraParams':_0x59ab9e,'datasetCodes':_0x2e6110}));}else console['error'](t(_0x24d4ae(0x1d9))+':\x20'+_0x4e8cba),console['log'](t(_0x24d4ae(0x1c5))),console['log'](_0x24d4ae(0x1e7)+t(_0x24d4ae(0x202))),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x209)+t('api.help.pullAppcode')),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x20d)+t(_0x24d4ae(0x1cf))),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1c7)+t(_0x24d4ae(0x20f))),console[_0x24d4ae(0x1d2)](''),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x200)+t('api.help.docDesc')),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1bd)+t(_0x24d4ae(0x1f6))),console[_0x24d4ae(0x1d2)](_0x24d4ae(0x1ff)+t('api.help.docOutput')),console['log'](_0x24d4ae(0x1e4)+t(_0x24d4ae(0x1db))),process[_0x24d4ae(0x1d1)](0x1);}}
1
+ (function(_0x45d1ec,_0xc9e407){const _0x260633=a7_0x5da0,_0x2431a7=_0x45d1ec();while(!![]){try{const _0x3dfcb2=parseInt(_0x260633(0x92))/0x1+parseInt(_0x260633(0x7e))/0x2*(-parseInt(_0x260633(0xb6))/0x3)+parseInt(_0x260633(0x6e))/0x4*(-parseInt(_0x260633(0xa8))/0x5)+parseInt(_0x260633(0x7c))/0x6+parseInt(_0x260633(0x87))/0x7*(parseInt(_0x260633(0x99))/0x8)+parseInt(_0x260633(0x94))/0x9*(-parseInt(_0x260633(0xb7))/0xa)+-parseInt(_0x260633(0x9c))/0xb*(-parseInt(_0x260633(0x80))/0xc);if(_0x3dfcb2===_0xc9e407)break;else _0x2431a7['push'](_0x2431a7['shift']());}catch(_0x268540){_0x2431a7['push'](_0x2431a7['shift']());}}}(a7_0x2b95,0xa7a3b));import{jsx as a7_0x29f42e}from'react/jsx-runtime';import{render}from'ink';function a7_0x5da0(_0x1044a5,_0x40623f){_0x1044a5=_0x1044a5-0x6e;const _0x2b952e=a7_0x2b95();let _0x5da090=_0x2b952e[_0x1044a5];return _0x5da090;}import{ApiPullUI}from'./api-pull-ui.js';function a7_0x2b95(){const _0x1729e8=['15804SrHugM','api.help.docDataset','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.help.docDatasets','api.help.pullEnv','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20','error','170093XXTKFE','api.help.pullDesc','split','api.help.examples','api.help.options','\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','isArray','filter','api.help.optHelp','api.common.noAppCode','api.help.pullOutput','173969Wbxesa','input','2655tLXqRM','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.noPositionalArgs','424NfYYzD','api.common.noAppCodeOption1','api.help.usage','7139cMBmES','api.common.noAppCodeOption2Pull','api.help.docAppcode','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20','api.help.unknownCommand','\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20','join','\x0a\x20\x20--datasetcode\x20<codes>\x20','\x1b[0m','api.common.usingConfigAppCodeHint','datasetcode','\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','785uUdJRY','api.help.availableCommands','doc','api.help.optOutput','api.help.optAppcode','api.help.docDesc','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','output','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','api.common.onlyGenerateDatasets','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a','\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','message','876jQQkAa','27290qqTCGK','pull','\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--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.noAppCodeHint','api.common.datasetcodeEmpty','api.common.paramsNotJson','length','9580wWbMXs','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','api.help.pullAppcode','trim','params','api.common.noAppCodeOption2Doc','\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','log','\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','api.help.optDatasetcode','\x1b[90m','string','flags','3863016RBCgDF','exit','7484HrPRgA','env'];a7_0x2b95=function(){return _0x1729e8;};return a7_0x2b95();}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';import a7_0x597b9b from'../i18n/index.js';const t=a7_0x597b9b['t']['bind'](a7_0x597b9b);export async function apiCli(_0x118b45){const _0x5a0215=a7_0x5da0,_0x21317a=_0x118b45[_0x5a0215(0x93)][0x1];if(_0x118b45[_0x5a0215(0x7b)]['help']){console[_0x5a0215(0x75)]('\x0a'+t('api.help.title')+'\x0a\x0a'+t(_0x5a0215(0x9b))+_0x5a0215(0xb3)+t(_0x5a0215(0x8b))+_0x5a0215(0xa1)+t(_0x5a0215(0xac))+'\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20'+t(_0x5a0215(0xab))+_0x5a0215(0x76)+t('api.help.optEnv')+_0x5a0215(0xa3)+t(_0x5a0215(0x78))+_0x5a0215(0xb1)+t(_0x5a0215(0x8f))+'\x0a\x0a'+t(_0x5a0215(0x8a))+_0x5a0215(0xa7)+t(_0x5a0215(0x88))+_0x5a0215(0x9f)+t(_0x5a0215(0x70))+'\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x5a0215(0x91))+_0x5a0215(0xae)+t(_0x5a0215(0x84))+_0x5a0215(0x8c)+t(_0x5a0215(0xad))+'\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'+t('api.help.docAppcode')+_0x5a0215(0xb4)+t('api.help.docOutput')+_0x5a0215(0x74)+t('api.help.docEnv')+_0x5a0215(0xba)+t(_0x5a0215(0x81))+_0x5a0215(0x96)+t(_0x5a0215(0x83))+'\x0a');return;}if(_0x21317a===_0x5a0215(0xb8)){_0x118b45[_0x5a0215(0x93)][0x2]&&(console[_0x5a0215(0x86)](t(_0x5a0215(0x98))),console[_0x5a0215(0x75)](t('api.common.useAppcodeFlag')),console[_0x5a0215(0x75)](_0x5a0215(0x6f)+_0x118b45[_0x5a0215(0x93)][0x2]),process['exit'](0x1));const _0x1fa65f=getConfigAppCode();let _0x349f77=_0x118b45[_0x5a0215(0x7b)]['appcode'];const _0xed70f7=typeof _0x118b45[_0x5a0215(0x7b)]['env']===_0x5a0215(0x7a)?_0x118b45['flags'][_0x5a0215(0x7f)]:undefined,_0x212367=_0x118b45[_0x5a0215(0x7b)]['output'];!_0x349f77&&!_0x1fa65f&&(console[_0x5a0215(0x86)](t('api.common.noAppCode')),console['log'](t('api.common.noAppCodeHint')),console[_0x5a0215(0x75)](t(_0x5a0215(0x9a))),console[_0x5a0215(0x75)](t(_0x5a0215(0x9d))),process['exit'](0x1)),_0x349f77&&_0x1fa65f&&_0x349f77===_0x1fa65f&&(console[_0x5a0215(0x75)](_0x5a0215(0x79)+t('api.common.usingConfigAppCode',{'appCode':_0x349f77})+_0x5a0215(0xa4)),console[_0x5a0215(0x75)]('\x1b[90m'+t(_0x5a0215(0xa5))+_0x5a0215(0xa4)),_0x349f77=undefined),render(a7_0x29f42e(ApiPullUI,{'appCode':_0x349f77,'env':_0xed70f7,'output':_0x212367}));}else{if(_0x21317a===_0x5a0215(0xaa)){_0x118b45[_0x5a0215(0x93)][0x2]&&(console[_0x5a0215(0x86)](t(_0x5a0215(0x98))),console['log'](t('api.common.useAppcodeFlag')),console[_0x5a0215(0x75)](_0x5a0215(0x77)+_0x118b45[_0x5a0215(0x93)][0x2]),process[_0x5a0215(0x7d)](0x1));const _0x1ed967=getConfigAppCode();let _0x2a69bd=_0x118b45[_0x5a0215(0x7b)]['appcode'];const _0xd50110=typeof _0x118b45[_0x5a0215(0x7b)][_0x5a0215(0x7f)]===_0x5a0215(0x7a)?_0x118b45[_0x5a0215(0x7b)][_0x5a0215(0x7f)]:undefined,_0x4d67ea=_0x118b45[_0x5a0215(0x7b)][_0x5a0215(0xaf)],_0x22a8c9=_0x118b45[_0x5a0215(0x7b)][_0x5a0215(0x72)],_0x20db70=_0x118b45['flags'][_0x5a0215(0xa6)];!_0x2a69bd&&!_0x1ed967&&(console['error'](t(_0x5a0215(0x90))),console[_0x5a0215(0x75)](t(_0x5a0215(0xbb))),console[_0x5a0215(0x75)](t('api.common.noAppCodeOption1')),console[_0x5a0215(0x75)](t(_0x5a0215(0x73))),process[_0x5a0215(0x7d)](0x1));_0x2a69bd&&_0x1ed967&&_0x2a69bd===_0x1ed967&&(console[_0x5a0215(0x75)]('\x1b[90m'+t('api.common.usingConfigAppCode',{'appCode':_0x2a69bd})+_0x5a0215(0xa4)),_0x2a69bd=undefined);let _0x752dc2;if(_0x22a8c9)try{_0x752dc2=JSON['parse'](_0x22a8c9),(typeof _0x752dc2!=='object'||_0x752dc2===null||Array[_0x5a0215(0x8d)](_0x752dc2))&&(console[_0x5a0215(0x86)](t('api.common.paramsInvalidJson')),process[_0x5a0215(0x7d)](0x1));}catch(_0x24b55c){console[_0x5a0215(0x86)](t(_0x5a0215(0xbd))),console['error'](t('api.common.paramsError',{'error':_0x24b55c instanceof Error?_0x24b55c[_0x5a0215(0xb5)]:String(_0x24b55c)})),process[_0x5a0215(0x7d)](0x1);}let _0x3c2c1a;_0x20db70&&(_0x3c2c1a=_0x20db70[_0x5a0215(0x89)](',')['map'](_0x20df57=>_0x20df57[_0x5a0215(0x71)]())[_0x5a0215(0x8e)](_0x2ec02a=>_0x2ec02a[_0x5a0215(0xbe)]>0x0),_0x3c2c1a['length']===0x0&&(console[_0x5a0215(0x86)](t(_0x5a0215(0xbc))),process[_0x5a0215(0x7d)](0x1)),console['log'](_0x5a0215(0x79)+t(_0x5a0215(0xb2),{'codes':_0x3c2c1a[_0x5a0215(0xa2)](',\x20')})+_0x5a0215(0xa4))),render(a7_0x29f42e(ApiDocUI,{'appCode':_0x2a69bd,'env':_0xd50110,'output':_0x4d67ea,'extraParams':_0x752dc2,'datasetCodes':_0x3c2c1a}));}else console[_0x5a0215(0x86)](t(_0x5a0215(0xa0))+':\x20'+_0x21317a),console[_0x5a0215(0x75)](t(_0x5a0215(0xa9))),console[_0x5a0215(0x75)](_0x5a0215(0xb9)+t(_0x5a0215(0x88))),console[_0x5a0215(0x75)](_0x5a0215(0x85)+t(_0x5a0215(0x70))),console[_0x5a0215(0x75)](_0x5a0215(0x82)+t(_0x5a0215(0x91))),console['log']('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x5a0215(0x84))),console['log'](''),console[_0x5a0215(0x75)]('\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'+t(_0x5a0215(0xad))),console['log'](_0x5a0215(0xb0)+t(_0x5a0215(0x9e))),console[_0x5a0215(0x75)](_0x5a0215(0x95)+t('api.help.docOutput')),console['log'](_0x5a0215(0x97)+t('api.help.docEnv')),process['exit'](0x1);}}
@@ -1 +1 @@
1
- function a8_0x2934(){const _0xf6eaf6=['api.silent.clientFileName','api.silent.modelFileName','api','12SofaVP','API\x20配置拉取成功:\x20','5CvYtCd','50MJBrYp','2000763rcaaxq','env','test','2354077lqshYj','error','2ALRcVc','modelCount','3458956upEbLV','300643qAJCeq','1577064YHdfse','cwd','api.silent.invalidPrefix','-client','chdir','message','bind','7682286jvdgrZ','length','104TspwiV','client','api.silent.error','log','string','api.silent.processing','info','api.silent.success','api.silent.generating','trim','885662gGVTEp'];a8_0x2934=function(){return _0xf6eaf6;};return a8_0x2934();}const a8_0x2f5a7b=a8_0x15b3;(function(_0x5c0760,_0x39095b){const _0x39b26b=a8_0x15b3,_0x39292b=_0x5c0760();while(!![]){try{const _0x255a55=parseInt(_0x39b26b(0x115))/0x1*(parseInt(_0x39b26b(0xfe))/0x2)+-parseInt(_0x39b26b(0x102))/0x3+parseInt(_0x39b26b(0x100))/0x4+-parseInt(_0x39b26b(0x11b))/0x5*(parseInt(_0x39b26b(0x109))/0x6)+parseInt(_0x39b26b(0x101))/0x7*(-parseInt(_0x39b26b(0x10b))/0x8)+parseInt(_0x39b26b(0x11d))/0x9*(parseInt(_0x39b26b(0x11c))/0xa)+-parseInt(_0x39b26b(0xfc))/0xb*(-parseInt(_0x39b26b(0x119))/0xc);if(_0x255a55===_0x39095b)break;else _0x39292b['push'](_0x39292b['shift']());}catch(_0x4e2114){_0x39292b['push'](_0x39292b['shift']());}}}(a8_0x2934,0xadb71));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a8_0x15b3(_0x33dd5d,_0x3472d3){_0x33dd5d=_0x33dd5d-0xfc;const _0x293486=a8_0x2934();let _0x15b36c=_0x293486[_0x33dd5d];return _0x15b36c;}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';import a8_0x1e8d9b from'../i18n/index.js';const t=a8_0x1e8d9b['t'][a8_0x2f5a7b(0x108)](a8_0x1e8d9b);export async function pullApiSilent(_0xa9b4d6,_0x3d102b,_0x3ba252,_0x212ea1){const _0x41f986=a8_0x2f5a7b;let _0x1b41c5;try{const _0x1ddd7b=_0x3d102b?.[_0x41f986(0x114)]()||'';if(_0x1ddd7b){const _0x5ca493=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5ca493[_0x41f986(0x11f)](_0x1ddd7b))return console[_0x41f986(0xfd)](t(_0x41f986(0x104))),![];}_0x3ba252&&(_0x1b41c5=process[_0x41f986(0x103)](),process[_0x41f986(0x106)](_0x3ba252));const _0x5c4002=readConfig(),_0x4386ae=typeof _0x5c4002[_0x41f986(0x11e)]===_0x41f986(0x10f)?_0x5c4002['env']:undefined,_0x1db4e0=_0x212ea1||_0x4386ae||'online';initEnv(_0x1db4e0),console['log'](t('api.silent.fetching',{'env':_0x1db4e0}));const {configArray:_0x1c224c}=await fetchModelList(_0xa9b4d6),_0x11eb33=_0x1ddd7b?_0x1ddd7b+'-api':_0x41f986(0x118),_0x25a2c4=_0x1ddd7b?_0x1ddd7b+_0x41f986(0x105):_0x41f986(0x10c);console[_0x41f986(0x10e)](t(_0x41f986(0x113))),console[_0x41f986(0x10e)](t(_0x41f986(0x117),{'name':_0x11eb33})),console['log'](t(_0x41f986(0x116),{'name':_0x25a2c4})),console[_0x41f986(0x10e)](t(_0x41f986(0x110),{'count':_0x1c224c['length']}));const _0x414f73=await generateApiFile(_0x1c224c,_0x1ddd7b,_0xa9b4d6,!![],_0x1db4e0);return console[_0x41f986(0x10e)](t(_0x41f986(0x112),{'datasetCount':_0x1c224c[_0x41f986(0x10a)],'modelCount':_0x414f73[_0x41f986(0xff)]})),_0x3ba252&&logger[_0x41f986(0x111)]('create-api-pull',_0x41f986(0x11a)+_0xa9b4d6,{'projectPath':_0x3ba252,'appCode':_0xa9b4d6,'datasetCount':_0x1c224c[_0x41f986(0x10a)],'filePrefix':_0x1ddd7b}),!![];}catch(_0x22b5fc){const _0x5add88=_0x22b5fc instanceof Error?_0x22b5fc[_0x41f986(0x107)]:String(_0x22b5fc);return console[_0x41f986(0xfd)](t(_0x41f986(0x10d),{'error':_0x5add88})),_0x3ba252&&logger[_0x41f986(0xfd)]('create-api-pull','API\x20配置拉取异常:\x20'+_0x5add88,{'appCode':_0xa9b4d6,'projectPath':_0x3ba252}),![];}finally{_0x1b41c5&&process[_0x41f986(0x106)](_0x1b41c5);}}
1
+ const a8_0x2804ab=a8_0x2238;function a8_0x19cd(){const _0x1e0f6e=['142930ETCDjv','306xWMsVG','chdir','length','64XgLnOY','api.silent.invalidPrefix','api.silent.fetching','37200dWsDRA','error','string','api.silent.generating','-client','online','env','client','message','cwd','api.silent.error','create-api-pull','34670MtlnAV','api.silent.success','93CNQhbP','12ZuUqAC','bind','trim','API\x20配置拉取成功:\x20','711424zRUNub','API\x20配置拉取异常:\x20','1341344Hmrcev','19762611NuiDdQ','test','421392RwCvhZ','api.silent.modelFileName','189ijEaBt','api.silent.processing','log'];a8_0x19cd=function(){return _0x1e0f6e;};return a8_0x19cd();}(function(_0x584a59,_0x1a1996){const _0x1277f1=a8_0x2238,_0x1dd672=_0x584a59();while(!![]){try{const _0x32b27b=-parseInt(_0x1277f1(0x185))/0x1+parseInt(_0x1277f1(0x179))/0x2*(-parseInt(_0x1277f1(0x17b))/0x3)+parseInt(_0x1277f1(0x182))/0x4+parseInt(_0x1277f1(0x16d))/0x5*(parseInt(_0x1277f1(0x167))/0x6)+-parseInt(_0x1277f1(0x180))/0x7*(parseInt(_0x1277f1(0x16a))/0x8)+-parseInt(_0x1277f1(0x187))/0x9*(parseInt(_0x1277f1(0x18a))/0xa)+-parseInt(_0x1277f1(0x183))/0xb*(-parseInt(_0x1277f1(0x17c))/0xc);if(_0x32b27b===_0x1a1996)break;else _0x1dd672['push'](_0x1dd672['shift']());}catch(_0x1cd411){_0x1dd672['push'](_0x1dd672['shift']());}}}(a8_0x19cd,0x6b45f));import{readConfig}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 a8_0x408c6c from'../i18n/index.js';const t=a8_0x408c6c['t'][a8_0x2804ab(0x17d)](a8_0x408c6c);function a8_0x2238(_0x1c8f5b,_0x108791){_0x1c8f5b=_0x1c8f5b-0x167;const _0x19cddb=a8_0x19cd();let _0x22384f=_0x19cddb[_0x1c8f5b];return _0x22384f;}export async function pullApiSilent(_0x36eced,_0x4f82a7,_0x30576b,_0x70f5fd){const _0x5f1662=a8_0x2804ab;let _0x14a013;try{const _0x9e533e=_0x4f82a7?.[_0x5f1662(0x17e)]()||'';if(_0x9e533e){const _0x519a70=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x519a70[_0x5f1662(0x184)](_0x9e533e))return console[_0x5f1662(0x16e)](t(_0x5f1662(0x16b))),![];}_0x30576b&&(_0x14a013=process[_0x5f1662(0x176)](),process[_0x5f1662(0x168)](_0x30576b));const _0x4cfc11=readConfig(),_0x5b9054=typeof _0x4cfc11[_0x5f1662(0x173)]===_0x5f1662(0x16f)?_0x4cfc11[_0x5f1662(0x173)]:undefined,_0x5ad9be=_0x70f5fd||_0x5b9054||_0x5f1662(0x172);initEnv(_0x5ad9be),console[_0x5f1662(0x189)](t(_0x5f1662(0x16c),{'env':_0x5ad9be}));const {configArray:_0x2a9bd8}=await fetchModelList(_0x36eced),_0x3dcb9f=_0x9e533e?_0x9e533e+'-api':'api',_0x2885e5=_0x9e533e?_0x9e533e+_0x5f1662(0x171):_0x5f1662(0x174);console[_0x5f1662(0x189)](t(_0x5f1662(0x170))),console[_0x5f1662(0x189)](t(_0x5f1662(0x186),{'name':_0x3dcb9f})),console['log'](t('api.silent.clientFileName',{'name':_0x2885e5})),console[_0x5f1662(0x189)](t(_0x5f1662(0x188),{'count':_0x2a9bd8[_0x5f1662(0x169)]}));const _0x1cfb52=await generateApiFile(_0x2a9bd8,_0x9e533e,_0x36eced,!![],_0x5ad9be);return console[_0x5f1662(0x189)](t(_0x5f1662(0x17a),{'datasetCount':_0x2a9bd8[_0x5f1662(0x169)],'modelCount':_0x1cfb52['modelCount']})),_0x30576b&&logger['info'](_0x5f1662(0x178),_0x5f1662(0x17f)+_0x36eced,{'projectPath':_0x30576b,'appCode':_0x36eced,'datasetCount':_0x2a9bd8[_0x5f1662(0x169)],'filePrefix':_0x9e533e}),!![];}catch(_0x20c6fc){const _0x31f535=_0x20c6fc instanceof Error?_0x20c6fc[_0x5f1662(0x175)]:String(_0x20c6fc);return console[_0x5f1662(0x16e)](t(_0x5f1662(0x177),{'error':_0x31f535})),_0x30576b&&logger['error'](_0x5f1662(0x178),_0x5f1662(0x181)+_0x31f535,{'appCode':_0x36eced,'projectPath':_0x30576b}),![];}finally{_0x14a013&&process['chdir'](_0x14a013);}}