@lovrabet/cli 1.3.4 → 1.4.1-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 (88) hide show
  1. package/lib/ai-setup/config.js +1 -1
  2. package/lib/api/api-doc-ui.js +1 -1
  3. package/lib/api/api-doc.js +1 -1
  4. package/lib/api/api-pull-ui.js +1 -1
  5. package/lib/api/fetch-model-list.js +1 -1
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/api/main.js +1 -1
  8. package/lib/api/pull-silent.js +1 -1
  9. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  10. package/lib/app-menu/create-menu.js +1 -1
  11. package/lib/app-menu/get-local-pages.js +1 -1
  12. package/lib/app-menu/get-online-menu-list.js +1 -1
  13. package/lib/app-menu/update-menu.js +1 -0
  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.js +1 -0
  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/main.js +1 -1
  64. package/lib/skills/npx-skills-add.js +1 -0
  65. package/lib/ui/IDESelector.js +1 -1
  66. package/lib/ui/useIDESelection.js +1 -1
  67. package/lib/utils/ai_config.js +1 -1
  68. package/lib/utils/cdn-config.js +1 -1
  69. package/lib/utils/check-sdk-version.js +1 -1
  70. package/lib/utils/cli-version-check.js +1 -1
  71. package/lib/utils/config.js +1 -1
  72. package/lib/utils/copy-directory.js +1 -1
  73. package/lib/utils/file-utils.js +1 -1
  74. package/lib/utils/guides-cdn.js +1 -1
  75. package/lib/utils/http-client.js +1 -1
  76. package/lib/utils/logger.js +1 -1
  77. package/lib/utils/rules-cdn.js +1 -1
  78. package/lib/utils/sleep.js +1 -1
  79. package/lib/utils/template-replacer.js +1 -1
  80. package/package.json +5 -5
  81. package/sidecar/flags.json +10 -0
  82. package/templates/rules/lovrabet_rules.mdc.tpl +891 -0
  83. package/templates/skill/SKILL.md.tpl +120 -0
  84. package/lib/ai-setup/AISetupUI.js +0 -1
  85. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +0 -1
  86. package/lib/skills/SkillInstallUI.js +0 -1
  87. package/lib/skills/skill-install-non-interactive.js +0 -1
  88. package/lib/skills/skill-installer.js +0 -1
@@ -1 +1 @@
1
- const a1_0x1c64d1=a1_0x469d;(function(_0x3fe60c,_0x9b6cf4){const _0x11b4b3=a1_0x469d,_0x471e7e=_0x3fe60c();while(!![]){try{const _0x2160a2=-parseInt(_0x11b4b3(0x116))/0x1+-parseInt(_0x11b4b3(0x102))/0x2+parseInt(_0x11b4b3(0xf9))/0x3+parseInt(_0x11b4b3(0x126))/0x4*(-parseInt(_0x11b4b3(0xea))/0x5)+parseInt(_0x11b4b3(0xfe))/0x6+-parseInt(_0x11b4b3(0x117))/0x7*(parseInt(_0x11b4b3(0x10e))/0x8)+-parseInt(_0x11b4b3(0x12a))/0x9*(-parseInt(_0x11b4b3(0xf3))/0xa);if(_0x2160a2===_0x9b6cf4)break;else _0x471e7e['push'](_0x471e7e['shift']());}catch(_0x43ee8e){_0x471e7e['push'](_0x471e7e['shift']());}}}(a1_0x209d,0xb0c8f));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';import a1_0x30ff46 from'../i18n/index.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a1_0x1c64d1(0x112),MCP_COMMAND='npx',MCP_ARGS=[a1_0x1c64d1(0xef)];export function buildEnvConfig(_0x183cf8,_0x4ba769){const _0x4642db=a1_0x1c64d1,_0x409266={'LOVRABET_APP_CODE':String(_0x183cf8)};return _0x4ba769!==_0x4642db(0x125)&&(_0x409266[_0x4642db(0x11c)]=String(_0x4ba769)),_0x409266;}export async function configureCursorMcp(_0x49d26b){const _0x198d21=a1_0x1c64d1,_0xeb5f83=_0x49d26b||process['cwd'](),_0x1be72d=readConfig(_0xeb5f83),_0x3bc727=_0x1be72d[_0x198d21(0xfc)]||_0x1be72d[_0x198d21(0x123)],_0x4b793d=_0x1be72d['env']||_0x198d21(0x125);if(!_0x3bc727)return{'ide':'Cursor','status':_0x198d21(0x11d),'message':a1_0x30ff46['t'](_0x198d21(0xf8))};const _0x39f193=buildEnvConfig(_0x3bc727,_0x4b793d),_0xda1cf8={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x39f193},_0x5c0b40=join(_0xeb5f83,_0x198d21(0x103),'mcp.json'),_0x4e04b1=join(_0xeb5f83,_0x198d21(0x103));try{!existsSync(_0x4e04b1)&&mkdirSync(_0x4e04b1,{'recursive':!![]});let _0x5434a7={'mcpServers':{}};if(existsSync(_0x5c0b40)){const _0x3c0cfa=readFileSync(_0x5c0b40,_0x198d21(0x12c));_0x5434a7=JSON['parse'](_0x3c0cfa);}return(!_0x5434a7[_0x198d21(0x12e)]||typeof _0x5434a7['mcpServers']!=='object')&&(_0x5434a7[_0x198d21(0x12e)]={}),_0x5434a7[_0x198d21(0x12e)][MCP_SERVER_NAME]=_0xda1cf8,writeFileSync(_0x5c0b40,JSON['stringify'](_0x5434a7,null,0x2),_0x198d21(0x12c)),logger[_0x198d21(0xe7)](_0x198d21(0x12d),a1_0x30ff46['t']('aiSetup.mcp.cursor.success'),{'appcode':_0x3bc727,'env':_0x4b793d,'path':_0x5c0b40}),await copyCursorRules(_0x4e04b1),{'ide':_0x198d21(0x10d),'status':'success','message':a1_0x30ff46['t'](_0x198d21(0xf4))};}catch(_0x7f98fd){return logger[_0x198d21(0x11d)](_0x198d21(0x12d),a1_0x30ff46['t']('aiSetup.mcp.cursor.error'),{'error':_0x7f98fd instanceof Error?_0x7f98fd['message']:String(_0x7f98fd)}),{'ide':_0x198d21(0x10d),'status':_0x198d21(0x11d),'message':_0x7f98fd instanceof Error?_0x7f98fd[_0x198d21(0x127)]:String(_0x7f98fd)};}}export async function configureClaudeMcp(_0x4d5950){const _0x1177e0=a1_0x1c64d1,_0x359037=_0x4d5950||process[_0x1177e0(0xec)](),_0x22ab43=readConfig(_0x359037),_0xf8a5=_0x22ab43[_0x1177e0(0xfc)]||_0x22ab43[_0x1177e0(0x123)],_0x1dca71=_0x22ab43[_0x1177e0(0xfb)]||_0x1177e0(0x125);if(!_0xf8a5)return{'ide':_0x1177e0(0x128),'status':_0x1177e0(0x11d),'message':a1_0x30ff46['t'](_0x1177e0(0xf8))};let _0x3c8ce7=_0x1177e0(0xe6)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS['join']('\x20')+_0x1177e0(0x11b)+_0xf8a5;return _0x1dca71!==_0x1177e0(0x125)&&(_0x3c8ce7+=_0x1177e0(0x101)+_0x1dca71),await copyAgentsMd(_0x359037),logger[_0x1177e0(0xe7)](_0x1177e0(0x12d),a1_0x30ff46['t'](_0x1177e0(0xf7)),{'command':_0x3c8ce7,'appcode':_0xf8a5,'env':_0x1dca71}),console[_0x1177e0(0x129)](a1_0x30ff46['t']('aiSetup.mcp.claude.manualCommand')),console[_0x1177e0(0x129)]('\x20\x20'+_0x3c8ce7+'\x0a'),console[_0x1177e0(0x129)](a1_0x30ff46['t'](_0x1177e0(0x10a))),console[_0x1177e0(0x129)]('\x20\x20AppCode:\x20'+_0xf8a5),_0x1dca71!==_0x1177e0(0x125)&&console[_0x1177e0(0x129)](a1_0x30ff46['t'](_0x1177e0(0x10f),{'env':_0x1dca71})),console[_0x1177e0(0x129)](a1_0x30ff46['t'](_0x1177e0(0x12b))),{'ide':_0x1177e0(0x128),'status':_0x1177e0(0x109),'message':a1_0x30ff46['t']('aiSetup.mcp.claude.manualExecute',{'command':_0x3c8ce7})};}export async function showOtherGuide(_0x12ee48){const _0x360e87=a1_0x1c64d1,_0x5246bc=_0x12ee48||process['cwd'](),_0xd4fbd1=readConfig(_0x5246bc),_0x32b1c3=_0xd4fbd1[_0x360e87(0xfc)]||_0xd4fbd1[_0x360e87(0x123)],_0x57965b=_0xd4fbd1['env']||_0x360e87(0x125);if(!_0x32b1c3)return{'ide':a1_0x30ff46['t'](_0x360e87(0x124)),'status':'error','message':a1_0x30ff46['t'](_0x360e87(0xf8))};return console[_0x360e87(0x129)](a1_0x30ff46['t']('aiSetup.mcp.other.title')),console[_0x360e87(0x129)]('{'),console['log'](_0x360e87(0xf0)),console[_0x360e87(0x129)](_0x360e87(0xed)+MCP_SERVER_NAME+'\x22:\x20{'),console[_0x360e87(0x129)](_0x360e87(0xfd)+MCP_COMMAND+'\x22,'),console[_0x360e87(0x129)](_0x360e87(0x119)+MCP_ARGS[_0x360e87(0x105)](_0xb40a0b=>'\x22'+_0xb40a0b+'\x22')['join'](',\x20')+'],'),console['log'](_0x360e87(0x110)),console['log'](_0x360e87(0xfa)+_0x32b1c3+'\x22,'),_0x57965b!==_0x360e87(0x125)&&console['log'](_0x360e87(0x108)+_0x57965b+'\x22,'),console[_0x360e87(0x129)]('\x20\x20\x20\x20\x20\x20}'),console[_0x360e87(0x129)](_0x360e87(0x11f)),console[_0x360e87(0x129)]('\x20\x20}'),console[_0x360e87(0x129)]('}\x0a'),logger[_0x360e87(0xe7)]('mcp-install',a1_0x30ff46['t'](_0x360e87(0x114)),{'appcode':_0x32b1c3,'env':_0x57965b}),{'ide':a1_0x30ff46['t']('aiSetup.mcp.other.name'),'status':_0x360e87(0x109),'message':a1_0x30ff46['t'](_0x360e87(0x114))};}export async function configureMcp(_0x1a41e8,_0x3efd5a){const _0x20093b=a1_0x1c64d1;switch(_0x1a41e8){case _0x20093b(0xff):return await configureCursorMcp(_0x3efd5a);case'claude':return await configureClaudeMcp(_0x3efd5a);default:throw new Error(a1_0x30ff46['t'](_0x20093b(0xf1),{'ide':_0x1a41e8}));}}async function copyCursorRules(_0x960f54){const _0x53bd9e=a1_0x1c64d1,_0x3b63bd=join(_0x960f54,_0x53bd9e(0xeb)),_0x20f00b=join(_0x3b63bd,_0x53bd9e(0x113));if(existsSync(_0x20f00b))return;try{!existsSync(_0x3b63bd)&&mkdirSync(_0x3b63bd,{'recursive':!![]});const _0x1c402e=await getRulesContent();writeFileSync(_0x20f00b,_0x1c402e,_0x53bd9e(0x12c)),logger[_0x53bd9e(0xe7)](_0x53bd9e(0x12d),a1_0x30ff46['t'](_0x53bd9e(0x11e)),{'to':_0x20f00b});}catch(_0x14a50a){logger[_0x53bd9e(0x11d)]('mcp-install',a1_0x30ff46['t'](_0x53bd9e(0x100)),{'error':_0x14a50a instanceof Error?_0x14a50a[_0x53bd9e(0x127)]:String(_0x14a50a)});}}async function copyAgentsMd(_0x1d2ca2){const _0x33083a=a1_0x1c64d1,_0x29d6f5=join(_0x1d2ca2,_0x33083a(0xe9));if(existsSync(_0x29d6f5))return;try{const _0x375e11=await getRulesContent();writeFileSync(_0x29d6f5,_0x375e11,_0x33083a(0x12c)),logger[_0x33083a(0xe7)](_0x33083a(0x12d),a1_0x30ff46['t'](_0x33083a(0x120)),{'to':_0x29d6f5});}catch(_0x55e547){logger[_0x33083a(0x11d)](_0x33083a(0x12d),a1_0x30ff46['t']('aiSetup.mcp.claude.agents.copyFailed'),{'error':_0x55e547 instanceof Error?_0x55e547['message']:String(_0x55e547)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x3ec1b8,_0x561988){const _0x448492=a1_0x1c64d1,_0xfe6711=_0x561988||process[_0x448492(0xec)](),_0x1cf1f4=resolve(__dirname,'../../cdn-source/skills'),_0x38fc94=SKILL_IDE_CONFIGS[_0x3ec1b8];if(!_0x38fc94)return{'ide':_0x3ec1b8,'status':_0x448492(0x11d),'message':a1_0x30ff46['t'](_0x448492(0x115),{'ide':_0x3ec1b8})};const _0x3d455f=_0x38fc94[_0x448492(0xf6)];try{let _0x3d8c29;try{_0x3d8c29=await fetchGuidesFromCDN();}catch{}const _0x2229ba=await installSingleIDE(_0x3ec1b8,_0x38fc94,_0xfe6711,_0x1cf1f4,_0x3d8c29);return _0x3d8c29&&writeGuidesToProject(_0x3d8c29,_0xfe6711),logger[_0x448492(0xe7)](_0x448492(0x106),a1_0x30ff46['t'](_0x448492(0x122),{'name':_0x3d455f}),{'ide':_0x3ec1b8,'filesCount':_0x2229ba}),{'ide':_0x3d455f,'status':_0x448492(0x121),'message':a1_0x30ff46['t']('aiSetup.skill.itemsCreated',{'count':_0x2229ba})};}catch(_0x1fa8bb){return logger[_0x448492(0x11d)]('skill-install',a1_0x30ff46['t']('aiSetup.skill.installFailed',{'name':_0x3d455f}),{'error':_0x1fa8bb instanceof Error?_0x1fa8bb[_0x448492(0x127)]:String(_0x1fa8bb)}),{'ide':_0x3d455f,'status':_0x448492(0x11d),'message':_0x1fa8bb instanceof Error?_0x1fa8bb[_0x448492(0x127)]:String(_0x1fa8bb)};}}async function copyDir(_0x409b6c,_0x444e98){const _0x3a6597=a1_0x1c64d1,{statSync:_0x4dc6b3}=await import(_0x3a6597(0x10c)),{readdirSync:_0x1cef5b}=await import(_0x3a6597(0x10c)),_0x285d45=_0x4dc6b3(_0x409b6c);if(_0x285d45[_0x3a6597(0xf5)]()){!existsSync(_0x444e98)&&mkdirSync(_0x444e98,{'recursive':!![]});const _0x193d04=_0x1cef5b(_0x409b6c);for(const _0x26ca22 of _0x193d04){await copyDir(join(_0x409b6c,_0x26ca22),join(_0x444e98,_0x26ca22));}}else copyFileSync(_0x409b6c,_0x444e98);}function a1_0x209d(){const _0x5f4983=['\x20-e\x20LOVRABET_APP_CODE=','LOVRABET_ENV','error','aiSetup.mcp.cursor.rules.created','\x20\x20\x20\x20}','aiSetup.mcp.claude.agents.created','success','aiSetup.skill.installSuccess','app','aiSetup.mcp.other.name','online','2582936wquFfB','message','Claude\x20Code','log','8221923neGpQJ','aiSetup.mcp.claude.restartRequired','utf-8','mcp-install','mcpServers','claude\x20mcp\x20add\x20','info','aiSetup.skill.sharedCopied','agents.md','10wVDYDv','rules','cwd','\x20\x20\x20\x20\x22','toISOString','@lovrabet/dataset-mcp-server@latest','\x20\x20\x22mcpServers\x22:\x20{','aiSetup.mcp.unsupportedIDE','aiSetup.skill.sharedCopyFailed','50ihCZZT','aiSetup.mcp.cursor.written','isDirectory','name','aiSetup.mcp.claude.commandGenerated','aiSetup.error.missingAppcode','2649036ZuATtH','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','env','appcode','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','1935354knUlHf','cursor','aiSetup.mcp.cursor.rules.copyFailed','\x20-e\x20LOVRABET_ENV=','2851974NyMkfn','.cursor','.lovrabet','map','skill-install','.shared','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','manual','aiSetup.mcp.claude.configInfo','.lovrabet/skill-manifest.json','node:fs','Cursor','16OKLyTU','aiSetup.mcp.claude.env','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','2.0.0','lovrabet-dataset','lovrabet_rules.mdc','aiSetup.mcp.other.guideShown','aiSetup.skill.unknownIDE','1217922oCbPzM','3898363FXpTMI','aiSetup.skill.manifestCreated','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','.lovrabet/skill/.shared'];a1_0x209d=function(){return _0x5f4983;};return a1_0x209d();}export async function copySharedSkills(_0x3b7f02){const _0x51578a=a1_0x1c64d1,_0x248429=_0x3b7f02||process[_0x51578a(0xec)](),_0x2a9498=resolve(__dirname,'../../cdn-source/skills'),_0x30e361=join(_0x2a9498,_0x51578a(0x107)),_0x5e800a=join(_0x248429,_0x51578a(0x11a));if(!existsSync(_0x30e361))return![];try{return await copyDir(_0x30e361,_0x5e800a),logger[_0x51578a(0xe7)]('skill-install',a1_0x30ff46['t'](_0x51578a(0xe8)),{'path':_0x5e800a}),!![];}catch(_0x34111a){return logger[_0x51578a(0x11d)](_0x51578a(0x106),a1_0x30ff46['t'](_0x51578a(0xf2)),{'error':_0x34111a instanceof Error?_0x34111a[_0x51578a(0x127)]:String(_0x34111a)}),![];}}function a1_0x469d(_0x11afb8,_0x903f9f){_0x11afb8=_0x11afb8-0xe6;const _0x209d6c=a1_0x209d();let _0x469da2=_0x209d6c[_0x11afb8];return _0x469da2;}export function createSkillManifest(_0x22712f,_0x508a72){const _0x4cd43b=a1_0x1c64d1,_0x163a48={'version':_0x4cd43b(0x111),'installedAt':new Date()[_0x4cd43b(0xee)](),'platforms':_0x508a72},_0x3916c1=join(_0x22712f,_0x4cd43b(0x10b)),_0x1cb768=join(_0x22712f,_0x4cd43b(0x104));!existsSync(_0x1cb768)&&mkdirSync(_0x1cb768,{'recursive':!![]}),writeFileSync(_0x3916c1,JSON['stringify'](_0x163a48,null,0x2),_0x4cd43b(0x12c)),logger[_0x4cd43b(0xe7)](_0x4cd43b(0x106),a1_0x30ff46['t'](_0x4cd43b(0x118)),{'path':_0x3916c1});}
1
+ const a0_0x384210=a0_0x3ddd;function a0_0x3ddd(_0x114a36,_0x2ee606){_0x114a36=_0x114a36-0x18e;const _0x19c249=a0_0x19c2();let _0x3ddd21=_0x19c249[_0x114a36];return _0x3ddd21;}(function(_0x572044,_0x2ab640){const _0x40aa5a=a0_0x3ddd,_0x4dddd1=_0x572044();while(!![]){try{const _0x2ccce1=-parseInt(_0x40aa5a(0x19c))/0x1*(-parseInt(_0x40aa5a(0x196))/0x2)+-parseInt(_0x40aa5a(0x1b1))/0x3+-parseInt(_0x40aa5a(0x198))/0x4+-parseInt(_0x40aa5a(0x1b5))/0x5+-parseInt(_0x40aa5a(0x195))/0x6+parseInt(_0x40aa5a(0x1b8))/0x7+-parseInt(_0x40aa5a(0x1af))/0x8*(-parseInt(_0x40aa5a(0x18f))/0x9);if(_0x2ccce1===_0x2ab640)break;else _0x4dddd1['push'](_0x4dddd1['shift']());}catch(_0x38b357){_0x4dddd1['push'](_0x4dddd1['shift']());}}}(a0_0x19c2,0x81398));import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';import{join}from'node:path';function a0_0x19c2(){const _0x2dadba=['aiSetup.mcp.cursor.written','appcode','2268156ipqpvo','37796DXJGdx','aiSetup.mcp.cursor.error','637056nBFVHN','aiSetup.mcp.unsupportedIDE','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','aiSetup.mcp.cursor.success','49epreiZ','aiSetup.mcp.claude.env','.cursor','parse','Claude\x20Code','LOVRABET_ENV','aiSetup.mcp.claude.commandGenerated','join','aiSetup.mcp.other.guideShown','info','error','object','aiSetup.mcp.claude.configInfo','stringify','utf-8','log','lovrabet-dataset','\x22:\x20{','manual','33872rFqDTt','\x20\x20\x20\x20\x20\x20}','3091632rhTxAF','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','production','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','4780255XjUYxc','\x20-e\x20LOVRABET_APP_CODE=','\x20\x20}','7302981LFAouW','mcp-install','mcp.json','\x20\x20\x20\x20}','aiSetup.error.missingAppcode','mcpServers','aiSetup.mcp.claude.manualExecute','cursor','aiSetup.mcp.claude.manualCommand','env','message','npx','Cursor','aiSetup.mcp.other.title','aiSetup.mcp.claude.restartRequired','aiSetup.mcp.other.name','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','app','2304qmlryk','@lovrabet/dataset-mcp-server@latest','cwd','claude\x20mcp\x20add\x20'];a0_0x19c2=function(){return _0x2dadba;};return a0_0x19c2();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{copyRulesToAgentsMd,copyRulesToCursor}from'../utils/rules-cdn.js';import{normalizeEnv}from'../constant/env.js';import a0_0x25aedb from'../i18n/index.js';const MCP_SERVER_NAME=a0_0x384210(0x1ac),MCP_COMMAND=a0_0x384210(0x1c3),MCP_ARGS=[a0_0x384210(0x190)];export function buildEnvConfig(_0x216506,_0x4fafdb){const _0x5d335d=a0_0x384210,_0x214465={'LOVRABET_APP_CODE':String(_0x216506)};return _0x4fafdb!==_0x5d335d(0x1b3)&&(_0x214465[_0x5d335d(0x1a1)]=String(_0x4fafdb)),_0x214465;}export async function configureCursorMcp(_0x2f4fdf){const _0x3fa785=a0_0x384210,_0x35d39c=_0x2f4fdf||process[_0x3fa785(0x191)](),_0x50fdbd=readConfig(_0x35d39c),_0x2d72d3=_0x50fdbd[_0x3fa785(0x194)]||_0x50fdbd['app'],_0x476515=normalizeEnv(_0x50fdbd[_0x3fa785(0x1c1)]||_0x3fa785(0x1b3));if(!_0x2d72d3)return{'ide':_0x3fa785(0x1c4),'status':'error','message':a0_0x25aedb['t'](_0x3fa785(0x1bc))};const _0x4a503b=buildEnvConfig(_0x2d72d3,_0x476515),_0x2119b6={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x4a503b},_0x224b74=join(_0x35d39c,'.cursor',_0x3fa785(0x1ba)),_0x5836ba=join(_0x35d39c,_0x3fa785(0x19e));try{!existsSync(_0x5836ba)&&mkdirSync(_0x5836ba,{'recursive':!![]});let _0x3f8b44={'mcpServers':{}};if(existsSync(_0x224b74)){const _0x2d1653=readFileSync(_0x224b74,_0x3fa785(0x1aa));_0x3f8b44=JSON[_0x3fa785(0x19f)](_0x2d1653);}return(!_0x3f8b44['mcpServers']||typeof _0x3f8b44[_0x3fa785(0x1bd)]!==_0x3fa785(0x1a7))&&(_0x3f8b44[_0x3fa785(0x1bd)]={}),_0x3f8b44[_0x3fa785(0x1bd)][MCP_SERVER_NAME]=_0x2119b6,writeFileSync(_0x224b74,JSON[_0x3fa785(0x1a9)](_0x3f8b44,null,0x2),_0x3fa785(0x1aa)),logger[_0x3fa785(0x1a5)]('mcp-install',a0_0x25aedb['t'](_0x3fa785(0x19b)),{'appcode':_0x2d72d3,'env':_0x476515,'path':_0x224b74}),await copyRulesToCursor(_0x35d39c),{'ide':_0x3fa785(0x1c4),'status':'success','message':a0_0x25aedb['t'](_0x3fa785(0x193))};}catch(_0x2fb40a){return logger['error'](_0x3fa785(0x1b9),a0_0x25aedb['t'](_0x3fa785(0x197)),{'error':_0x2fb40a instanceof Error?_0x2fb40a[_0x3fa785(0x1c2)]:String(_0x2fb40a)}),{'ide':'Cursor','status':_0x3fa785(0x1a6),'message':_0x2fb40a instanceof Error?_0x2fb40a[_0x3fa785(0x1c2)]:String(_0x2fb40a)};}}export async function configureClaudeMcp(_0x59633f){const _0x8f5ec0=a0_0x384210,_0x587f3d=_0x59633f||process[_0x8f5ec0(0x191)](),_0x4c50fd=readConfig(_0x587f3d),_0x14ef57=_0x4c50fd['appcode']||_0x4c50fd[_0x8f5ec0(0x18e)],_0x59642f=normalizeEnv(_0x4c50fd[_0x8f5ec0(0x1c1)]||'production');if(!_0x14ef57)return{'ide':'Claude\x20Code','status':'error','message':a0_0x25aedb['t']('aiSetup.error.missingAppcode')};let _0x5523f1=_0x8f5ec0(0x192)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x8f5ec0(0x1a3)]('\x20')+_0x8f5ec0(0x1b6)+_0x14ef57;return _0x59642f!=='production'&&(_0x5523f1+='\x20-e\x20LOVRABET_ENV='+_0x59642f),await copyRulesToAgentsMd(_0x587f3d),logger[_0x8f5ec0(0x1a5)]('mcp-install',a0_0x25aedb['t'](_0x8f5ec0(0x1a2)),{'command':_0x5523f1,'appcode':_0x14ef57,'env':_0x59642f}),console[_0x8f5ec0(0x1ab)](a0_0x25aedb['t'](_0x8f5ec0(0x1c0))),console[_0x8f5ec0(0x1ab)]('\x20\x20'+_0x5523f1+'\x0a'),console[_0x8f5ec0(0x1ab)](a0_0x25aedb['t'](_0x8f5ec0(0x1a8))),console['log']('\x20\x20AppCode:\x20'+_0x14ef57),_0x59642f!==_0x8f5ec0(0x1b3)&&console[_0x8f5ec0(0x1ab)](a0_0x25aedb['t'](_0x8f5ec0(0x19d),{'env':_0x59642f})),console[_0x8f5ec0(0x1ab)](a0_0x25aedb['t'](_0x8f5ec0(0x1c6))),{'ide':_0x8f5ec0(0x1a0),'status':'manual','message':a0_0x25aedb['t'](_0x8f5ec0(0x1be),{'command':_0x5523f1})};}export async function showOtherGuide(_0x5ca60a){const _0x28b82d=a0_0x384210,_0x58ca31=_0x5ca60a||process[_0x28b82d(0x191)](),_0x51c3a9=readConfig(_0x58ca31),_0x461944=_0x51c3a9['appcode']||_0x51c3a9[_0x28b82d(0x18e)],_0x53fc22=normalizeEnv(_0x51c3a9[_0x28b82d(0x1c1)]||_0x28b82d(0x1b3));if(!_0x461944)return{'ide':a0_0x25aedb['t'](_0x28b82d(0x1c7)),'status':_0x28b82d(0x1a6),'message':a0_0x25aedb['t'](_0x28b82d(0x1bc))};return console['log'](a0_0x25aedb['t'](_0x28b82d(0x1c5))),console[_0x28b82d(0x1ab)]('{'),console[_0x28b82d(0x1ab)]('\x20\x20\x22mcpServers\x22:\x20{'),console[_0x28b82d(0x1ab)]('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+_0x28b82d(0x1ad)),console[_0x28b82d(0x1ab)]('\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22'+MCP_COMMAND+'\x22,'),console[_0x28b82d(0x1ab)](_0x28b82d(0x1b2)+MCP_ARGS['map'](_0x3ebe8e=>'\x22'+_0x3ebe8e+'\x22')[_0x28b82d(0x1a3)](',\x20')+'],'),console[_0x28b82d(0x1ab)](_0x28b82d(0x1b4)),console[_0x28b82d(0x1ab)](_0x28b82d(0x1c8)+_0x461944+'\x22,'),_0x53fc22!==_0x28b82d(0x1b3)&&console['log'](_0x28b82d(0x19a)+_0x53fc22+'\x22,'),console['log'](_0x28b82d(0x1b0)),console['log'](_0x28b82d(0x1bb)),console[_0x28b82d(0x1ab)](_0x28b82d(0x1b7)),console['log']('}\x0a'),logger[_0x28b82d(0x1a5)](_0x28b82d(0x1b9),a0_0x25aedb['t']('aiSetup.mcp.other.guideShown'),{'appcode':_0x461944,'env':_0x53fc22}),{'ide':a0_0x25aedb['t']('aiSetup.mcp.other.name'),'status':_0x28b82d(0x1ae),'message':a0_0x25aedb['t'](_0x28b82d(0x1a4))};}export async function configureMcp(_0x4809dd,_0x3a93ec){const _0x4f3b0c=a0_0x384210;switch(_0x4809dd){case _0x4f3b0c(0x1bf):return await configureCursorMcp(_0x3a93ec);case'claude':return await configureClaudeMcp(_0x3a93ec);default:throw new Error(a0_0x25aedb['t'](_0x4f3b0c(0x199),{'ide':_0x4809dd}));}}
@@ -1 +1 @@
1
- (function(_0x33435e,_0x2bb8a9){const _0x2d5d21=a2_0x477b,_0x294975=_0x33435e();while(!![]){try{const _0xe664d5=-parseInt(_0x2d5d21(0x130))/0x1*(parseInt(_0x2d5d21(0x127))/0x2)+-parseInt(_0x2d5d21(0x145))/0x3*(-parseInt(_0x2d5d21(0x156))/0x4)+-parseInt(_0x2d5d21(0x144))/0x5+-parseInt(_0x2d5d21(0x142))/0x6+parseInt(_0x2d5d21(0x154))/0x7+parseInt(_0x2d5d21(0x148))/0x8+parseInt(_0x2d5d21(0x12f))/0x9*(parseInt(_0x2d5d21(0x13c))/0xa);if(_0xe664d5===_0x2bb8a9)break;else _0x294975['push'](_0x294975['shift']());}catch(_0x385633){_0x294975['push'](_0x294975['shift']());}}}(a2_0x3b98,0xd08dc));import{jsx as a2_0xe5261d,jsxs as a2_0x25ac32,Fragment as a2_0xfb6324}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a2_0x477b(_0x31172c,_0x3e5fd8){_0x31172c=_0x31172c-0x126;const _0x3b98aa=a2_0x3b98();let _0x477bc5=_0x3b98aa[_0x31172c];return _0x477bc5;}import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';import{useI18n}from'../i18n/hooks.js';function a2_0x3b98(){const _0x354cf6=['[ERROR]\x20','string','dim','api.common.usingSpecifiedAppCode','cwd','lovrabet\x20auth','api.docUI.generatedDocs','red','790BdleiS','\x20-\x20','expired','success','message','api.docUI.docFailed','20862mQxHtm','api.docUI.noDatasets','7655285eilzPk','2554395WzxucW','api.common.authRetry','api.docUI.generatingFile','1740584KVqRnj','\x1b[33m','map','api.docUI.docComplete','filter','文档生成失败:\x20','cyan','setLogPath','length','column','log','datasetName','1693916LpgOaG','env','4LeDWGD','api.docUI.datasetsNotFound','join','api.docUI.generatingDocs','api.docUI.fetchingDatasets','yellow','green','204106svRTSP','datasetCode','gray','api.common.usingDefaultAppCode','api.docUI.outputDir','./docs','includes','api.docUI.processedDatasets','204165xbGesd','7AWjfRa','error','api-doc','api.docUI.failedDatasets'];a2_0x3b98=function(){return _0x354cf6;};return a2_0x3b98();}export const ApiDocUI=({appCode:_0x222d4a,env:_0x28d587,output:_0x552077,extraParams:_0x44cfa1,datasetCodes:_0x791370})=>{const _0x2ce7a8=a2_0x477b,{exit:_0x4c166f}=useApp(),{t:_0x4e581a}=useI18n(),[_0x129f4c,_0x469ad8]=useState(![]),[_0x2cd1aa,_0x26d14b]=useState(''),[_0x2d32be,_0x17c9a9]=useState(![]),[_0x5f50ae,_0x6ee85d]=useState(null),[_0x420094,_0x46eb31]=useState(null),[_0x4c164c,_0x3d0d95]=useState(0x0),_0x24db74=readConfig(),_0x3563b8=getConfigAppCode(),_0x56f9e1=_0x222d4a||_0x3563b8,_0x561a6c=typeof _0x24db74?.[_0x2ce7a8(0x155)]===_0x2ce7a8(0x135)?_0x24db74[_0x2ce7a8(0x155)]:undefined,_0x43a5db=_0x28d587||_0x561a6c||'online';initEnv(_0x43a5db);const _0x461bf8=_0x552077||_0x2ce7a8(0x12c),_0x5e6f5b=_0x222d4a?_0x4e581a(_0x2ce7a8(0x137),{'appCode':_0x56f9e1}):_0x4e581a(_0x2ce7a8(0x12a),{'appCode':_0x56f9e1});useEffect(()=>{_0x469ad8(!![]),_0x510db6();},[]),useEffect(()=>{(_0x2d32be||_0x5f50ae)&&_0x4c166f();},[_0x2d32be,_0x5f50ae,_0x4c166f]);async function _0x510db6(){const _0x7b91b0=_0x2ce7a8;if(!_0x56f9e1){_0x6ee85d(_0x4e581a('api.common.noAppCodeDefault'));return;}try{logger[_0x7b91b0(0x14f)](process[_0x7b91b0(0x138)]()),_0x26d14b(_0x4e581a(_0x7b91b0(0x15a)));const {configArray:_0x5b8081}=await fetchModelList(_0x56f9e1);_0x3d0d95(_0x5b8081[_0x7b91b0(0x150)]);if(_0x5b8081[_0x7b91b0(0x150)]===0x0){_0x6ee85d(_0x4e581a(_0x7b91b0(0x143)));return;}let _0x5c83a1=_0x5b8081;if(_0x791370&&_0x791370[_0x7b91b0(0x150)]>0x0){_0x5c83a1=_0x5b8081[_0x7b91b0(0x14c)](_0x157092=>_0x791370[_0x7b91b0(0x12d)](_0x157092[_0x7b91b0(0x128)]));const _0x1edeef=_0x5c83a1[_0x7b91b0(0x14a)](_0x4bee5e=>_0x4bee5e[_0x7b91b0(0x128)]),_0x36d1f0=_0x791370['filter'](_0x3bf41c=>!_0x1edeef[_0x7b91b0(0x12d)](_0x3bf41c));_0x36d1f0[_0x7b91b0(0x150)]>0x0&&console[_0x7b91b0(0x152)](_0x7b91b0(0x149)+_0x4e581a(_0x7b91b0(0x157),{'codes':_0x36d1f0[_0x7b91b0(0x158)](',\x20')})+'\x1b[0m');if(_0x5c83a1['length']===0x0){_0x6ee85d(_0x4e581a('api.docUI.allDatasetsNotFound',{'codes':_0x791370[_0x7b91b0(0x158)](',\x20')}));return;}console['log']('\x1b[90m'+_0x4e581a('api.docUI.filteredDatasets',{'total':_0x5b8081[_0x7b91b0(0x150)],'count':_0x5c83a1[_0x7b91b0(0x150)]})+'\x1b[0m');}_0x26d14b(_0x4e581a(_0x7b91b0(0x159),{'count':_0x5c83a1[_0x7b91b0(0x150)]}));const _0x594ae8=await generateDatasetDocs(_0x5c83a1,_0x56f9e1,_0x461bf8,(_0x3bd0ff,_0x37a8a7,_0x251b3d)=>{const _0x2f487c=_0x7b91b0;_0x26d14b(_0x4e581a(_0x2f487c(0x147),{'fileName':_0x251b3d,'current':_0x3bd0ff,'total':_0x37a8a7}));},_0x44cfa1);_0x46eb31(_0x594ae8),_0x17c9a9(!![]);const _0x8df2c8=_0x594ae8[_0x7b91b0(0x14c)](_0x2f134b=>_0x2f134b[_0x7b91b0(0x13f)])['length'],_0x1e59de=_0x594ae8[_0x7b91b0(0x14c)](_0x45514c=>!_0x45514c['success'])[_0x7b91b0(0x150)];logger[_0x7b91b0(0x13f)]('api-doc','文档生成完成',undefined,{'totalCount':_0x594ae8[_0x7b91b0(0x150)],'successCount':_0x8df2c8,'failCount':_0x1e59de,'outputDir':_0x461bf8});}catch(_0x48bb31){const _0x3b15e6=_0x48bb31 instanceof Error?_0x48bb31[_0x7b91b0(0x140)]:String(_0x48bb31);logger[_0x7b91b0(0x131)](_0x7b91b0(0x132),_0x7b91b0(0x14d)+_0x3b15e6,{'appCode':_0x56f9e1,'outputDir':_0x461bf8}),_0x6ee85d(_0x4e581a('api.docUI.docGenerateFailed',{'error':_0x3b15e6}));}finally{_0x469ad8(![]);}}const _0x935b69=_0x420094?.[_0x2ce7a8(0x14c)](_0x5380e1=>_0x5380e1[_0x2ce7a8(0x13f)])[_0x2ce7a8(0x150)]||0x0,_0x1a2c68=_0x420094?.['filter'](_0x12509f=>!_0x12509f[_0x2ce7a8(0x13f)])['length']||0x0;return a2_0x25ac32(Box,{'flexDirection':_0x2ce7a8(0x151),'children':[(_0x129f4c||_0x2d32be)&&a2_0x25ac32(Box,{'children':[a2_0xe5261d(Text,{'color':_0x2ce7a8(0x129),'children':'*\x20'}),a2_0xe5261d(Text,{'color':_0x222d4a?'white':'dim','children':_0x5e6f5b})]}),_0x129f4c&&a2_0xe5261d(Box,{'children':a2_0x25ac32(Text,{'children':['*\x20',_0x2cd1aa]})}),_0x2d32be&&_0x420094&&a2_0x25ac32(Box,{'flexDirection':_0x2ce7a8(0x151),'children':[a2_0xe5261d(Box,{'children':a2_0x25ac32(Text,{'color':_0x2ce7a8(0x126),'children':[_0x4e581a(_0x2ce7a8(0x14b),{'successCount':_0x935b69}),_0x1a2c68>0x0?_0x4e581a(_0x2ce7a8(0x141),{'failCount':_0x1a2c68}):'']})}),a2_0xe5261d(Box,{'marginTop':0x1,'children':a2_0xe5261d(Text,{'color':_0x2ce7a8(0x129),'children':_0x4e581a(_0x2ce7a8(0x12e),{'count':_0x4c164c})})}),a2_0x25ac32(Box,{'marginTop':0x1,'children':[a2_0xe5261d(Text,{'color':'gray','children':_0x4e581a(_0x2ce7a8(0x12b))}),a2_0xe5261d(Text,{'color':'cyan','children':_0x461bf8})]}),_0x935b69>0x0&&a2_0x25ac32(a2_0xfb6324,{'children':[a2_0xe5261d(Box,{'marginTop':0x1,'children':a2_0xe5261d(Text,{'color':_0x2ce7a8(0x129),'children':_0x4e581a(_0x2ce7a8(0x13a))})}),_0x420094[_0x2ce7a8(0x14c)](_0x4e3760=>_0x4e3760[_0x2ce7a8(0x13f)])[_0x2ce7a8(0x14a)]((_0x43b392,_0x3eb30c)=>a2_0x25ac32(Box,{'marginLeft':0x2,'children':[a2_0x25ac32(Text,{'color':_0x2ce7a8(0x14e),'children':['•\x20',_0x43b392['filePath']]}),a2_0x25ac32(Text,{'color':_0x2ce7a8(0x136),'children':[_0x2ce7a8(0x13d),_0x43b392['datasetName']]})]},_0x3eb30c))]}),_0x1a2c68>0x0&&a2_0x25ac32(a2_0xfb6324,{'children':[a2_0xe5261d(Box,{'marginTop':0x1,'children':a2_0xe5261d(Text,{'color':_0x2ce7a8(0x15b),'children':_0x4e581a(_0x2ce7a8(0x133))})}),_0x420094[_0x2ce7a8(0x14c)](_0x3521c=>!_0x3521c[_0x2ce7a8(0x13f)])[_0x2ce7a8(0x14a)]((_0x336f1c,_0x234d2f)=>a2_0x25ac32(Box,{'marginLeft':0x2,'flexDirection':_0x2ce7a8(0x151),'children':[a2_0x25ac32(Text,{'color':_0x2ce7a8(0x13b),'children':['•\x20',_0x336f1c[_0x2ce7a8(0x153)],'\x20(',_0x336f1c[_0x2ce7a8(0x128)],')']}),_0x336f1c[_0x2ce7a8(0x131)]&&a2_0xe5261d(Box,{'marginLeft':0x2,'children':a2_0xe5261d(Text,{'color':_0x2ce7a8(0x136),'children':_0x336f1c[_0x2ce7a8(0x131)]})})]},_0x234d2f))]})]}),_0x5f50ae&&a2_0x25ac32(Box,{'flexDirection':_0x2ce7a8(0x151),'children':[a2_0xe5261d(Box,{'children':a2_0x25ac32(Text,{'color':_0x2ce7a8(0x13b),'children':[_0x2ce7a8(0x134),_0x5f50ae]})}),(_0x5f50ae['includes']('登录')||_0x5f50ae[_0x2ce7a8(0x12d)]('Authentication')||_0x5f50ae[_0x2ce7a8(0x12d)](_0x2ce7a8(0x13e)))&&a2_0x25ac32(Box,{'marginTop':0x1,'children':[a2_0xe5261d(Text,{'color':_0x2ce7a8(0x15b),'children':'*\x20'}),a2_0xe5261d(Text,{'color':_0x2ce7a8(0x14e),'children':_0x2ce7a8(0x139)}),a2_0x25ac32(Text,{'color':_0x2ce7a8(0x15b),'children':['\x20',_0x4e581a(_0x2ce7a8(0x146))]})]})]})]});};
1
+ (function(_0x3bb433,_0x3e898f){const _0x47b2dc=a1_0x2cba,_0x3d4de7=_0x3bb433();while(!![]){try{const _0x4d6ac3=-parseInt(_0x47b2dc(0xe0))/0x1+-parseInt(_0x47b2dc(0xd7))/0x2*(-parseInt(_0x47b2dc(0xd3))/0x3)+parseInt(_0x47b2dc(0xe7))/0x4*(-parseInt(_0x47b2dc(0xba))/0x5)+parseInt(_0x47b2dc(0xbd))/0x6+-parseInt(_0x47b2dc(0xde))/0x7+parseInt(_0x47b2dc(0xbc))/0x8*(-parseInt(_0x47b2dc(0xc8))/0x9)+parseInt(_0x47b2dc(0xb6))/0xa*(parseInt(_0x47b2dc(0xc7))/0xb);if(_0x4d6ac3===_0x3e898f)break;else _0x3d4de7['push'](_0x3d4de7['shift']());}catch(_0x4451b3){_0x3d4de7['push'](_0x3d4de7['shift']());}}}(a1_0x12af,0xac55f));import{jsx as a1_0x469b91,jsxs as a1_0x45408c,Fragment as a1_0x40d954}from'react/jsx-runtime';function a1_0x12af(){const _0x57ae60=['\x20-\x20','api.docUI.fetchingDatasets','api.docUI.docComplete','message','96430tRFEpM','red','join','white','22235HvFnSa','api.docUI.generatedDocs','32yjoluy','8166972IRcvxO','api.docUI.allDatasetsNotFound','filter','cyan','api.docUI.generatingFile','filePath','lovrabet\x20auth','dim','api.docUI.noDatasets','\x1b[0m','1991bvzwZh','1754415ZamJZq','api.docUI.processedDatasets','api.docUI.datasetsNotFound','datasetCode','includes','api.docUI.filteredDatasets','datasetName','expired','map','column','api.docUI.failedDatasets','12bzrkuV','env','error','api.common.noAppCodeDefault','399524shGJMZ','production','./docs','log','gray','api.docUI.docFailed','success','6653290TQSTyP','setLogPath','677930VZOmao','green','\x1b[33m','api-doc','yellow','length','\x1b[90m','712KmbBvo','cwd','api.docUI.docGenerateFailed'];a1_0x12af=function(){return _0x57ae60;};return a1_0x12af();}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';function a1_0x2cba(_0x133e0b,_0x5c93b3){_0x133e0b=_0x133e0b-0xb4;const _0x12affb=a1_0x12af();let _0x2cba39=_0x12affb[_0x133e0b];return _0x2cba39;}import{useI18n}from'../i18n/hooks.js';export const ApiDocUI=({appCode:_0x503ddc,env:_0x62ea4d,output:_0x977be0,extraParams:_0x1b9e6f,datasetCodes:_0x74b6c4})=>{const _0x5d8780=a1_0x2cba,{exit:_0x863ed1}=useApp(),{t:_0x13f88e}=useI18n(),[_0x1f4a66,_0x63596b]=useState(![]),[_0x25e619,_0x4e4a08]=useState(''),[_0x4ef80e,_0x3b0f39]=useState(![]),[_0x1ac0a6,_0x46c7b9]=useState(null),[_0x4cf93f,_0x18add6]=useState(null),[_0x4340c1,_0xe13e65]=useState(0x0),_0x562e10=readConfig(),_0x4b0d53=getConfigAppCode(),_0x349d4f=_0x503ddc||_0x4b0d53,_0x3e8aff=typeof _0x562e10?.[_0x5d8780(0xd4)]==='string'?_0x562e10['env']:undefined,_0x1fc2d3=_0x62ea4d||_0x3e8aff||_0x5d8780(0xd8);initEnv(_0x1fc2d3);const _0x2b60b6=_0x977be0||_0x5d8780(0xd9),_0x45989a=_0x503ddc?_0x13f88e('api.common.usingSpecifiedAppCode',{'appCode':_0x349d4f}):_0x13f88e('api.common.usingDefaultAppCode',{'appCode':_0x349d4f});useEffect(()=>{_0x63596b(!![]),_0x135eb8();},[]),useEffect(()=>{(_0x4ef80e||_0x1ac0a6)&&_0x863ed1();},[_0x4ef80e,_0x1ac0a6,_0x863ed1]);async function _0x135eb8(){const _0x57dd82=_0x5d8780;if(!_0x349d4f){_0x46c7b9(_0x13f88e(_0x57dd82(0xd6)));return;}try{logger[_0x57dd82(0xdf)](process[_0x57dd82(0xe8)]()),_0x4e4a08(_0x13f88e(_0x57dd82(0xeb)));const {configArray:_0x203c50}=await fetchModelList(_0x349d4f);_0xe13e65(_0x203c50[_0x57dd82(0xe5)]);if(_0x203c50[_0x57dd82(0xe5)]===0x0){_0x46c7b9(_0x13f88e(_0x57dd82(0xc5)));return;}let _0x9e8e4e=_0x203c50;if(_0x74b6c4&&_0x74b6c4['length']>0x0){_0x9e8e4e=_0x203c50[_0x57dd82(0xbf)](_0x2a86c3=>_0x74b6c4[_0x57dd82(0xcc)](_0x2a86c3[_0x57dd82(0xcb)]));const _0x120055=_0x9e8e4e[_0x57dd82(0xd0)](_0x55a471=>_0x55a471[_0x57dd82(0xcb)]),_0x577de4=_0x74b6c4['filter'](_0xc9eb1c=>!_0x120055[_0x57dd82(0xcc)](_0xc9eb1c));_0x577de4[_0x57dd82(0xe5)]>0x0&&console['log'](_0x57dd82(0xe2)+_0x13f88e(_0x57dd82(0xca),{'codes':_0x577de4[_0x57dd82(0xb8)](',\x20')})+'\x1b[0m');if(_0x9e8e4e['length']===0x0){_0x46c7b9(_0x13f88e(_0x57dd82(0xbe),{'codes':_0x74b6c4[_0x57dd82(0xb8)](',\x20')}));return;}console[_0x57dd82(0xda)](_0x57dd82(0xe6)+_0x13f88e(_0x57dd82(0xcd),{'total':_0x203c50[_0x57dd82(0xe5)],'count':_0x9e8e4e['length']})+_0x57dd82(0xc6));}_0x4e4a08(_0x13f88e('api.docUI.generatingDocs',{'count':_0x9e8e4e[_0x57dd82(0xe5)]}));const _0x207e02=await generateDatasetDocs(_0x9e8e4e,_0x349d4f,_0x2b60b6,(_0x34385b,_0xf4a069,_0x5a4f74)=>{const _0x2ffa0f=_0x57dd82;_0x4e4a08(_0x13f88e(_0x2ffa0f(0xc1),{'fileName':_0x5a4f74,'current':_0x34385b,'total':_0xf4a069}));},_0x1b9e6f);_0x18add6(_0x207e02),_0x3b0f39(!![]);const _0x4e5ba4=_0x207e02['filter'](_0x30fcc=>_0x30fcc[_0x57dd82(0xdd)])[_0x57dd82(0xe5)],_0x361c60=_0x207e02['filter'](_0x33dc5b=>!_0x33dc5b[_0x57dd82(0xdd)])[_0x57dd82(0xe5)];logger[_0x57dd82(0xdd)](_0x57dd82(0xe3),'文档生成完成',undefined,{'totalCount':_0x207e02[_0x57dd82(0xe5)],'successCount':_0x4e5ba4,'failCount':_0x361c60,'outputDir':_0x2b60b6});}catch(_0x330901){const _0x24198a=_0x330901 instanceof Error?_0x330901[_0x57dd82(0xb5)]:String(_0x330901);logger[_0x57dd82(0xd5)]('api-doc','文档生成失败:\x20'+_0x24198a,{'appCode':_0x349d4f,'outputDir':_0x2b60b6}),_0x46c7b9(_0x13f88e(_0x57dd82(0xe9),{'error':_0x24198a}));}finally{_0x63596b(![]);}}const _0x10b582=_0x4cf93f?.[_0x5d8780(0xbf)](_0x5779d6=>_0x5779d6[_0x5d8780(0xdd)])['length']||0x0,_0x89b5cb=_0x4cf93f?.[_0x5d8780(0xbf)](_0x3f312f=>!_0x3f312f['success'])['length']||0x0;return a1_0x45408c(Box,{'flexDirection':_0x5d8780(0xd1),'children':[(_0x1f4a66||_0x4ef80e)&&a1_0x45408c(Box,{'children':[a1_0x469b91(Text,{'color':_0x5d8780(0xdb),'children':'*\x20'}),a1_0x469b91(Text,{'color':_0x503ddc?_0x5d8780(0xb9):_0x5d8780(0xc4),'children':_0x45989a})]}),_0x1f4a66&&a1_0x469b91(Box,{'children':a1_0x45408c(Text,{'children':['*\x20',_0x25e619]})}),_0x4ef80e&&_0x4cf93f&&a1_0x45408c(Box,{'flexDirection':_0x5d8780(0xd1),'children':[a1_0x469b91(Box,{'children':a1_0x45408c(Text,{'color':_0x5d8780(0xe1),'children':[_0x13f88e(_0x5d8780(0xb4),{'successCount':_0x10b582}),_0x89b5cb>0x0?_0x13f88e(_0x5d8780(0xdc),{'failCount':_0x89b5cb}):'']})}),a1_0x469b91(Box,{'marginTop':0x1,'children':a1_0x469b91(Text,{'color':_0x5d8780(0xdb),'children':_0x13f88e(_0x5d8780(0xc9),{'count':_0x4340c1})})}),a1_0x45408c(Box,{'marginTop':0x1,'children':[a1_0x469b91(Text,{'color':_0x5d8780(0xdb),'children':_0x13f88e('api.docUI.outputDir')}),a1_0x469b91(Text,{'color':_0x5d8780(0xc0),'children':_0x2b60b6})]}),_0x10b582>0x0&&a1_0x45408c(a1_0x40d954,{'children':[a1_0x469b91(Box,{'marginTop':0x1,'children':a1_0x469b91(Text,{'color':_0x5d8780(0xdb),'children':_0x13f88e(_0x5d8780(0xbb))})}),_0x4cf93f[_0x5d8780(0xbf)](_0x9edaa2=>_0x9edaa2[_0x5d8780(0xdd)])[_0x5d8780(0xd0)]((_0x31e4bd,_0x4a9b21)=>a1_0x45408c(Box,{'marginLeft':0x2,'children':[a1_0x45408c(Text,{'color':_0x5d8780(0xc0),'children':['•\x20',_0x31e4bd[_0x5d8780(0xc2)]]}),a1_0x45408c(Text,{'color':_0x5d8780(0xc4),'children':[_0x5d8780(0xea),_0x31e4bd['datasetName']]})]},_0x4a9b21))]}),_0x89b5cb>0x0&&a1_0x45408c(a1_0x40d954,{'children':[a1_0x469b91(Box,{'marginTop':0x1,'children':a1_0x469b91(Text,{'color':_0x5d8780(0xe4),'children':_0x13f88e(_0x5d8780(0xd2))})}),_0x4cf93f[_0x5d8780(0xbf)](_0x5a95b0=>!_0x5a95b0['success'])[_0x5d8780(0xd0)]((_0x595e9f,_0x5a32d0)=>a1_0x45408c(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a1_0x45408c(Text,{'color':_0x5d8780(0xb7),'children':['•\x20',_0x595e9f[_0x5d8780(0xce)],'\x20(',_0x595e9f[_0x5d8780(0xcb)],')']}),_0x595e9f[_0x5d8780(0xd5)]&&a1_0x469b91(Box,{'marginLeft':0x2,'children':a1_0x469b91(Text,{'color':_0x5d8780(0xc4),'children':_0x595e9f[_0x5d8780(0xd5)]})})]},_0x5a32d0))]})]}),_0x1ac0a6&&a1_0x45408c(Box,{'flexDirection':_0x5d8780(0xd1),'children':[a1_0x469b91(Box,{'children':a1_0x45408c(Text,{'color':_0x5d8780(0xb7),'children':['[ERROR]\x20',_0x1ac0a6]})}),(_0x1ac0a6['includes']('登录')||_0x1ac0a6[_0x5d8780(0xcc)]('Authentication')||_0x1ac0a6[_0x5d8780(0xcc)](_0x5d8780(0xcf)))&&a1_0x45408c(Box,{'marginTop':0x1,'children':[a1_0x469b91(Text,{'color':'yellow','children':'*\x20'}),a1_0x469b91(Text,{'color':'cyan','children':_0x5d8780(0xc3)}),a1_0x45408c(Text,{'color':'yellow','children':['\x20',_0x13f88e('api.common.authRetry')]})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x33288a,_0x3d2b93){const _0x3ff9f0=a3_0x2780,_0x460267=_0x33288a();while(!![]){try{const _0x118225=parseInt(_0x3ff9f0(0x15a))/0x1*(parseInt(_0x3ff9f0(0x151))/0x2)+-parseInt(_0x3ff9f0(0x141))/0x3+parseInt(_0x3ff9f0(0x155))/0x4+parseInt(_0x3ff9f0(0x156))/0x5*(parseInt(_0x3ff9f0(0x153))/0x6)+-parseInt(_0x3ff9f0(0x14b))/0x7+-parseInt(_0x3ff9f0(0x143))/0x8+parseInt(_0x3ff9f0(0x15e))/0x9*(-parseInt(_0x3ff9f0(0x14e))/0xa);if(_0x118225===_0x3d2b93)break;else _0x460267['push'](_0x460267['shift']());}catch(_0x146240){_0x460267['push'](_0x460267['shift']());}}}(a3_0x4ab5,0x432e0));import{mkdirSync,writeFileSync}from'node:fs';function a3_0x4ab5(){const _0x49c7ae=['1714342Skeheo','status','/api/node-toolbox/api-doc-generator','228860DGZdVB','api-doc','log','2DweJOK','api.docBatch.failed','456mcvqgg','data','1729284dBwaEY','5410VKNpFU','api.common.authExpired','application/json','message','428095KZeldm','api.docBatch.waiting','string','tableName','9AurfST','success','生成文档失败:\x20','datasetCode','name','utf8','生成文档成功:\x20','450270xPFMry','POST','1996784uFQNLg','length','.md','api.docBatch.httpError','push','json','markdown','text'];a3_0x4ab5=function(){return _0x49c7ae;};return a3_0x4ab5();}function a3_0x2780(_0x356f8b,_0x9d5803){_0x356f8b=_0x356f8b-0x13b;const _0x4ab547=a3_0x4ab5();let _0x27804b=_0x4ab547[_0x356f8b];return _0x27804b;}import a3_0x39d98f from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import a3_0xf48645 from'../i18n/index.js';const t=a3_0xf48645['t']['bind'](a3_0xf48645);export async function fetchDatasetDoc(_0x47ece4){const _0x4b5c49=a3_0x2780,{appCode:_0x233a8e,datasetCode:_0x4e7bb1,datasetId:_0x5d850b,extraParams:_0x5b1a6f}=_0x47ece4,_0xec1f3e=getApiDomain(),_0x179230=_0xec1f3e+_0x4b5c49(0x14d),_0x46afa9={'appCode':_0x233a8e,'datasetCode':_0x4e7bb1,'datasetId':_0x5d850b,..._0x5b1a6f||{}},_0x10e59d=await fetch(_0x179230,{'method':_0x4b5c49(0x142),'headers':{'Content-Type':_0x4b5c49(0x158),'Cookie':getCookie()},'body':JSON['stringify'](_0x46afa9)});if(!_0x10e59d['ok']){if(_0x10e59d[_0x4b5c49(0x14c)]===0x191)throw new Error(t(_0x4b5c49(0x157)));let _0x5f2e0f='';try{_0x5f2e0f=await _0x10e59d[_0x4b5c49(0x14a)]();}catch(_0x28d38a){}throw new Error(''+t(_0x4b5c49(0x146),{'datasetCode':_0x4e7bb1,'status':_0x10e59d['status']})+(_0x5f2e0f?'\x0a'+_0x5f2e0f:''));}const _0x227957=await _0x10e59d[_0x4b5c49(0x148)]();if(!_0x227957[_0x4b5c49(0x154)]||typeof _0x227957['data']['markdown']!==_0x4b5c49(0x15c))throw new Error(t('api.docBatch.docFormatError',{'datasetCode':_0x4e7bb1}));return _0x227957['data'][_0x4b5c49(0x149)];}function delay(_0x5232b0){return new Promise(_0x4345d6=>setTimeout(_0x4345d6,_0x5232b0));}export async function generateDatasetDocs(_0xadf6ca,_0x3890bc,_0x387538='./docs',_0x2bb360,_0x4ef40f){const _0x193e34=a3_0x2780;mkdirSync(_0x387538,{'recursive':!![]});const _0x12a09a=[],_0x59f8a8=_0xadf6ca[_0x193e34(0x144)];console[_0x193e34(0x150)](t('api.docBatch.totalDatasets',{'count':_0x59f8a8}));for(let _0x4a4e9d=0x0;_0x4a4e9d<_0xadf6ca['length'];_0x4a4e9d++){const _0x159779=_0xadf6ca[_0x4a4e9d],_0x192613=_0x4a4e9d+0x1,_0x9346a=_0x159779[_0x193e34(0x15d)];try{console[_0x193e34(0x150)](t('api.docBatch.generating',{'current':_0x192613,'total':_0x59f8a8,'fileName':_0x9346a,'name':_0x159779[_0x193e34(0x13e)]}));_0x2bb360&&_0x2bb360(_0x192613,_0x59f8a8,_0x9346a);const _0x356192=await fetchDatasetDoc({'appCode':_0x3890bc,'datasetCode':_0x159779['datasetCode'],'datasetId':_0x159779['id'],'enableAI':![],'extraParams':_0x4ef40f}),_0x298e98=a3_0x39d98f['join'](_0x387538,_0x9346a+_0x193e34(0x145));writeFileSync(_0x298e98,_0x356192,{'encoding':_0x193e34(0x13f)}),console['log'](t('api.docBatch.success',{'fileName':_0x9346a})),logger[_0x193e34(0x13b)](_0x193e34(0x14f),_0x193e34(0x140)+_0x9346a,undefined,{'datasetCode':_0x159779['datasetCode'],'datasetName':_0x159779[_0x193e34(0x13e)],'filePath':_0x298e98,'progress':_0x192613+'/'+_0x59f8a8}),_0x12a09a['push']({'datasetCode':_0x159779[_0x193e34(0x13d)],'datasetName':_0x159779['name'],'filePath':_0x298e98,'success':!![]}),_0x192613<_0x59f8a8&&await delay(0x1388);}catch(_0x774609){const _0x1b79ca=_0x774609 instanceof Error?_0x774609[_0x193e34(0x159)]:String(_0x774609);console[_0x193e34(0x150)](t(_0x193e34(0x152),{'fileName':_0x9346a,'error':_0x1b79ca})),logger['error']('api-doc',_0x193e34(0x13c)+_0x159779['datasetCode'],{'datasetCode':_0x159779[_0x193e34(0x13d)],'datasetName':_0x159779[_0x193e34(0x13e)],'error':_0x1b79ca,'progress':_0x192613+'/'+_0x59f8a8}),_0x12a09a[_0x193e34(0x147)]({'datasetCode':_0x159779[_0x193e34(0x13d)],'datasetName':_0x159779[_0x193e34(0x13e)],'filePath':'','success':![],'error':_0x1b79ca}),_0x192613<_0x59f8a8&&(console[_0x193e34(0x150)](t(_0x193e34(0x15b))),await delay(0xbb8));}}return _0x12a09a;}
1
+ const a2_0x388729=a2_0x22fb;function a2_0x22fb(_0x5ea5d9,_0x125fe1){_0x5ea5d9=_0x5ea5d9-0x1c3;const _0x5d77dd=a2_0x5d77();let _0x22fb20=_0x5d77dd[_0x5ea5d9];return _0x22fb20;}(function(_0x19c38c,_0x1c9cb9){const _0x48962a=a2_0x22fb,_0x3bdeb9=_0x19c38c();while(!![]){try{const _0x155b66=parseInt(_0x48962a(0x1d7))/0x1*(-parseInt(_0x48962a(0x1da))/0x2)+-parseInt(_0x48962a(0x1c9))/0x3+parseInt(_0x48962a(0x1c3))/0x4*(parseInt(_0x48962a(0x1df))/0x5)+parseInt(_0x48962a(0x1cb))/0x6+-parseInt(_0x48962a(0x1dc))/0x7+-parseInt(_0x48962a(0x1cf))/0x8*(-parseInt(_0x48962a(0x1d6))/0x9)+parseInt(_0x48962a(0x1d8))/0xa*(-parseInt(_0x48962a(0x1e5))/0xb);if(_0x155b66===_0x1c9cb9)break;else _0x3bdeb9['push'](_0x3bdeb9['shift']());}catch(_0x4b9f09){_0x3bdeb9['push'](_0x3bdeb9['shift']());}}}(a2_0x5d77,0x4aebd));import{mkdirSync,writeFileSync}from'node:fs';import a2_0x444afb from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import a2_0x1fa121 from'../i18n/index.js';const t=a2_0x1fa121['t'][a2_0x388729(0x1e1)](a2_0x1fa121);export async function fetchDatasetDoc(_0x44d562){const _0x4bcbf6=a2_0x388729,{appCode:_0x4b9bd3,datasetCode:_0x5e28b3,datasetId:_0x446122,extraParams:_0x59e028}=_0x44d562,_0x2e947b=getApiDomain(),_0x34321c=_0x2e947b+'/api/node-toolbox/api-doc-generator',_0x4695cd={'appCode':_0x4b9bd3,'datasetCode':_0x5e28b3,'datasetId':_0x446122,..._0x59e028||{}},_0x30d79f=await fetch(_0x34321c,{'method':_0x4bcbf6(0x1e3),'headers':{'Content-Type':_0x4bcbf6(0x1d2),'Cookie':getCookie()},'body':JSON['stringify'](_0x4695cd)});if(!_0x30d79f['ok']){if(_0x30d79f['status']===0x191)throw new Error(t(_0x4bcbf6(0x1d3)));let _0x9c1876='';try{_0x9c1876=await _0x30d79f['text']();}catch(_0x672e2f){}throw new Error(''+t(_0x4bcbf6(0x1cc),{'datasetCode':_0x5e28b3,'status':_0x30d79f[_0x4bcbf6(0x1ca)]})+(_0x9c1876?'\x0a'+_0x9c1876:''));}const _0xfbb147=await _0x30d79f[_0x4bcbf6(0x1e7)]();if(!_0xfbb147[_0x4bcbf6(0x1de)]||typeof _0xfbb147[_0x4bcbf6(0x1de)]['markdown']!=='string')throw new Error(t(_0x4bcbf6(0x1d5),{'datasetCode':_0x5e28b3}));return _0xfbb147[_0x4bcbf6(0x1de)][_0x4bcbf6(0x1d0)];}function delay(_0x2cfee6){return new Promise(_0x188430=>setTimeout(_0x188430,_0x2cfee6));}export async function generateDatasetDocs(_0x584ed2,_0x6453f2,_0x4a6156=a2_0x388729(0x1ea),_0xfaba8a,_0x255b3e){const _0x47c335=a2_0x388729;mkdirSync(_0x4a6156,{'recursive':!![]});const _0x237e95=[],_0x42e640=_0x584ed2[_0x47c335(0x1e8)];console[_0x47c335(0x1d9)](t(_0x47c335(0x1ce),{'count':_0x42e640}));for(let _0x12ecc5=0x0;_0x12ecc5<_0x584ed2[_0x47c335(0x1e8)];_0x12ecc5++){const _0x5edaa3=_0x584ed2[_0x12ecc5],_0xb10c64=_0x12ecc5+0x1,_0x428adc=_0x5edaa3[_0x47c335(0x1c4)];try{console['log'](t(_0x47c335(0x1d1),{'current':_0xb10c64,'total':_0x42e640,'fileName':_0x428adc,'name':_0x5edaa3[_0x47c335(0x1dd)]}));_0xfaba8a&&_0xfaba8a(_0xb10c64,_0x42e640,_0x428adc);const _0x3bc7a4=await fetchDatasetDoc({'appCode':_0x6453f2,'datasetCode':_0x5edaa3[_0x47c335(0x1c7)],'datasetId':_0x5edaa3['id'],'enableAI':![],'extraParams':_0x255b3e}),_0x9edcd9=a2_0x444afb[_0x47c335(0x1c6)](_0x4a6156,_0x428adc+_0x47c335(0x1c8));writeFileSync(_0x9edcd9,_0x3bc7a4,{'encoding':_0x47c335(0x1cd)}),console['log'](t(_0x47c335(0x1e4),{'fileName':_0x428adc})),logger[_0x47c335(0x1e9)](_0x47c335(0x1e0),_0x47c335(0x1e2)+_0x428adc,undefined,{'datasetCode':_0x5edaa3['datasetCode'],'datasetName':_0x5edaa3[_0x47c335(0x1dd)],'filePath':_0x9edcd9,'progress':_0xb10c64+'/'+_0x42e640}),_0x237e95[_0x47c335(0x1db)]({'datasetCode':_0x5edaa3['datasetCode'],'datasetName':_0x5edaa3[_0x47c335(0x1dd)],'filePath':_0x9edcd9,'success':!![]}),_0xb10c64<_0x42e640&&await delay(0x1388);}catch(_0x274a60){const _0x89de22=_0x274a60 instanceof Error?_0x274a60['message']:String(_0x274a60);console[_0x47c335(0x1d9)](t(_0x47c335(0x1e6),{'fileName':_0x428adc,'error':_0x89de22})),logger[_0x47c335(0x1eb)]('api-doc',_0x47c335(0x1d4)+_0x5edaa3[_0x47c335(0x1c7)],{'datasetCode':_0x5edaa3[_0x47c335(0x1c7)],'datasetName':_0x5edaa3[_0x47c335(0x1dd)],'error':_0x89de22,'progress':_0xb10c64+'/'+_0x42e640}),_0x237e95[_0x47c335(0x1db)]({'datasetCode':_0x5edaa3[_0x47c335(0x1c7)],'datasetName':_0x5edaa3[_0x47c335(0x1dd)],'filePath':'','success':![],'error':_0x89de22}),_0xb10c64<_0x42e640&&(console[_0x47c335(0x1d9)](t(_0x47c335(0x1c5))),await delay(0xbb8));}}return _0x237e95;}function a2_0x5d77(){const _0x1abe7f=['application/json','api.common.authExpired','生成文档失败:\x20','api.docBatch.docFormatError','18eqXqRa','3041afcOBi','10vQtMsW','log','358QFAauS','push','110110XOfYQC','name','data','125645AkhKJO','api-doc','bind','生成文档成功:\x20','POST','api.docBatch.success','144419oeOymV','api.docBatch.failed','json','length','success','./docs','error','44aPPtTy','tableName','api.docBatch.waiting','join','datasetCode','.md','262176RwFkcZ','status','2960280JtUvJg','api.docBatch.httpError','utf8','api.docBatch.totalDatasets','790672PdKXjD','markdown','api.docBatch.generating'];a2_0x5d77=function(){return _0x1abe7f;};return a2_0x5d77();}
@@ -1 +1 @@
1
- function a4_0x1cde(_0x331066,_0x5eaec7){_0x331066=_0x331066-0x153;const _0x59d4ae=a4_0x59d4();let _0x1cde85=_0x59d4ae[_0x331066];return _0x1cde85;}(function(_0x249887,_0xf0f4e6){const _0x2cb1d7=a4_0x1cde,_0x4072a0=_0x249887();while(!![]){try{const _0x40faa1=-parseInt(_0x2cb1d7(0x17d))/0x1+parseInt(_0x2cb1d7(0x17c))/0x2*(parseInt(_0x2cb1d7(0x154))/0x3)+-parseInt(_0x2cb1d7(0x186))/0x4*(parseInt(_0x2cb1d7(0x17b))/0x5)+-parseInt(_0x2cb1d7(0x15f))/0x6*(-parseInt(_0x2cb1d7(0x172))/0x7)+-parseInt(_0x2cb1d7(0x183))/0x8+parseInt(_0x2cb1d7(0x175))/0x9*(-parseInt(_0x2cb1d7(0x170))/0xa)+parseInt(_0x2cb1d7(0x17e))/0xb;if(_0x40faa1===_0xf0f4e6)break;else _0x4072a0['push'](_0x4072a0['shift']());}catch(_0xd0e3e7){_0x4072a0['push'](_0x4072a0['shift']());}}}(a4_0x59d4,0x3b06c));import{jsx as a4_0x2acc7a,jsxs as a4_0x44533f}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';import{useI18n}from'../i18n/hooks.js';function a4_0x59d4(){const _0x18ebc0=['-client','api.common.usingDefaultAppCode','env','api.pullUI.modelFile','client','32365VdQwUu','699134slCVmK','439649xwBQyT','5055699ebKIWq','green','[ERROR]\x20','yellow','{\x20lovrabetClient\x20}','237144PzmQWR','api.pullUI.generatedFiles','cyan','108aEqnxE','endsWith','white','message','online','setLogPath','3UIshZj','red','length','api','api.pullUI.pullFailed','column','gray','-api','originalCount','api.pullUI.fetching','modelCount','1071834KYXtBu','join','slice','error','import\x20','\x20from\x20\x27@/','cwd','api.pullUI.duplicateInfo','Authentication','expired','api.common.noAppCodeDefault','拉取\x20API\x20配置失败:\x20','includes','.ts','api.pullUI.importHint','dim','replace','20SdESsS','split','7yYsmMv','api.pullUI.successPull','api.pullUI.clientFile','458910nEoCtW'];a4_0x59d4=function(){return _0x18ebc0;};return a4_0x59d4();}export const ApiPullUI=({appCode:_0x384bb2,env:_0x29eb95,output:_0x4d1673})=>{const _0x32fc55=a4_0x1cde,{exit:_0x2208a9}=useApp(),{t:_0x4683be}=useI18n(),[_0x258864,_0x56f2bf]=useState(![]),[_0x51c4fb,_0x8cebf6]=useState(![]),[_0x331dd7,_0x505e6d]=useState(null),[_0x4351e9,_0x749dfc]=useState(null),_0xc8df15=readConfig(),_0x5541b9=getConfigAppCode(),_0x2a7a26=_0x384bb2||_0x5541b9,_0x1a1a88=typeof _0xc8df15?.['env']==='string'?_0xc8df15[_0x32fc55(0x178)]:undefined,_0x5636e6=_0x29eb95||_0x1a1a88||_0x32fc55(0x18a);initEnv(_0x5636e6);const _0x325683=_0x4d1673||'./src/api/',_0x4c3b20=_0x384bb2&&_0x384bb2['includes']('-')?_0x384bb2[_0x32fc55(0x171)]('-')[_0x32fc55(0x161)](0x1)[_0x32fc55(0x160)]('-'):'',_0x138a74=_0x384bb2?_0x4683be('api.common.usingSpecifiedAppCode',{'appCode':_0x2a7a26}):_0x4683be(_0x32fc55(0x177),{'appCode':_0x2a7a26}),_0x368139=_0x4c3b20?_0x4c3b20+_0x32fc55(0x15b):_0x32fc55(0x157),_0x1a261b=_0x4c3b20?_0x4c3b20+_0x32fc55(0x176):_0x32fc55(0x17a);useEffect(()=>{_0x56f2bf(!![]),_0x241519();},[]),useEffect(()=>{(_0x51c4fb||_0x331dd7)&&_0x2208a9();},[_0x51c4fb,_0x331dd7,_0x2208a9]);async function _0x241519(){const _0x2e859b=_0x32fc55;if(!_0x2a7a26){_0x505e6d(_0x4683be(_0x2e859b(0x169)));return;}try{logger[_0x2e859b(0x153)](process[_0x2e859b(0x165)]());const {configArray:_0x26013b}=await fetchModelList(_0x2a7a26),_0x5f89b7=_0x26013b[_0x2e859b(0x156)],_0x4bc880=!_0x384bb2,_0xc95d24=await generateApiFile(_0x26013b,_0x4c3b20,_0x2a7a26,_0x4bc880,_0x5636e6,_0x325683),_0xd7d1e=_0x325683[_0x2e859b(0x187)]('/')?_0x325683:_0x325683+'/';_0x749dfc({'api':''+_0xd7d1e+_0x368139+_0x2e859b(0x16c),'client':''+_0xd7d1e+_0x1a261b+_0x2e859b(0x16c),'modelCount':_0xc95d24[_0x2e859b(0x15e)],'datasetCount':_0x5f89b7,'originalCount':_0x5f89b7,'duplicateCount':0x0}),_0x8cebf6(!![]);}catch(_0x46b426){const _0x3d3fb4=_0x46b426 instanceof Error?_0x46b426[_0x2e859b(0x189)]:String(_0x46b426);logger[_0x2e859b(0x162)]('api-pull',_0x2e859b(0x16a)+_0x3d3fb4,{'appCode':_0x2a7a26,'error':_0x3d3fb4}),_0x505e6d(_0x4683be(_0x2e859b(0x158),{'error':_0x3d3fb4}));}finally{_0x56f2bf(![]);}}return a4_0x44533f(Box,{'flexDirection':_0x32fc55(0x159),'children':[(_0x258864||_0x51c4fb)&&a4_0x44533f(Box,{'children':[a4_0x2acc7a(Text,{'color':'gray','children':'*\x20'}),a4_0x2acc7a(Text,{'color':_0x384bb2?_0x32fc55(0x188):'dim','children':_0x138a74})]}),_0x258864&&a4_0x2acc7a(Box,{'children':a4_0x2acc7a(Text,{'children':_0x4683be(_0x32fc55(0x15d),{'env':_0x5636e6})})}),_0x51c4fb&&_0x4351e9&&a4_0x44533f(Box,{'flexDirection':_0x32fc55(0x159),'children':[a4_0x2acc7a(Box,{'children':a4_0x2acc7a(Text,{'color':_0x32fc55(0x17f),'children':_0x4683be(_0x32fc55(0x173),{'datasetCount':_0x4351e9['datasetCount'],'modelCount':_0x4351e9[_0x32fc55(0x15e)]})})}),_0x4351e9['duplicateCount']>0x0&&a4_0x2acc7a(Box,{'marginTop':0x1,'children':a4_0x2acc7a(Text,{'color':_0x32fc55(0x181),'children':_0x4683be(_0x32fc55(0x166),{'originalCount':_0x4351e9[_0x32fc55(0x15c)],'duplicateCount':_0x4351e9['duplicateCount']})})}),a4_0x2acc7a(Box,{'marginTop':0x1,'children':a4_0x2acc7a(Text,{'color':_0x32fc55(0x15a),'children':_0x4683be(_0x32fc55(0x184))})}),a4_0x44533f(Box,{'marginLeft':0x2,'children':[a4_0x44533f(Text,{'color':_0x32fc55(0x185),'children':['•\x20',_0x4351e9['api']]}),a4_0x44533f(Text,{'color':'dim','children':['\x20',_0x4683be(_0x32fc55(0x179),{'count':_0x4351e9[_0x32fc55(0x15e)]})]})]}),a4_0x44533f(Box,{'marginLeft':0x2,'children':[a4_0x44533f(Text,{'color':_0x32fc55(0x185),'children':['•\x20',_0x4351e9['client']]}),a4_0x44533f(Text,{'color':_0x32fc55(0x16e),'children':['\x20',_0x4683be(_0x32fc55(0x174))]})]}),a4_0x2acc7a(Box,{'marginTop':0x1,'children':a4_0x2acc7a(Text,{'color':'gray','children':_0x4683be(_0x32fc55(0x16d))})}),a4_0x2acc7a(Box,{'marginLeft':0x2,'children':a4_0x44533f(Text,{'color':_0x32fc55(0x181),'children':[_0x32fc55(0x163),_0x32fc55(0x182),_0x32fc55(0x164),_0x4351e9[_0x32fc55(0x17a)][_0x32fc55(0x16f)](/^\.\//,'')[_0x32fc55(0x16f)](_0x32fc55(0x16c),''),'\x27']})})]}),_0x331dd7&&a4_0x44533f(Box,{'flexDirection':_0x32fc55(0x159),'children':[a4_0x2acc7a(Box,{'children':a4_0x44533f(Text,{'color':_0x32fc55(0x155),'children':[_0x32fc55(0x180),_0x331dd7]})}),(_0x331dd7[_0x32fc55(0x16b)]('登录')||_0x331dd7['includes'](_0x32fc55(0x167))||_0x331dd7['includes'](_0x32fc55(0x168)))&&a4_0x44533f(Box,{'marginTop':0x1,'children':[a4_0x2acc7a(Text,{'color':_0x32fc55(0x181),'children':'*\x20'}),a4_0x2acc7a(Text,{'color':_0x32fc55(0x185),'children':'lovrabet\x20auth'}),a4_0x44533f(Text,{'color':'yellow','children':['\x20',_0x4683be('api.common.authRetry')]})]})]})]});};
1
+ (function(_0x1f1373,_0xfb40ac){const _0x37f230=a3_0x9f72,_0x489f48=_0x1f1373();while(!![]){try{const _0x1c0d20=parseInt(_0x37f230(0x113))/0x1*(-parseInt(_0x37f230(0x10c))/0x2)+parseInt(_0x37f230(0xf7))/0x3*(-parseInt(_0x37f230(0x116))/0x4)+-parseInt(_0x37f230(0xfa))/0x5*(parseInt(_0x37f230(0x112))/0x6)+parseInt(_0x37f230(0x11c))/0x7+-parseInt(_0x37f230(0x106))/0x8+parseInt(_0x37f230(0xf9))/0x9*(parseInt(_0x37f230(0x100))/0xa)+parseInt(_0x37f230(0x119))/0xb;if(_0x1c0d20===_0xfb40ac)break;else _0x489f48['push'](_0x489f48['shift']());}catch(_0x7b209b){_0x489f48['push'](_0x489f48['shift']());}}}(a3_0x2753,0x48ade));import{jsx as a3_0x2c50f6,jsxs as a3_0x4bcf7c}from'react/jsx-runtime';import{useEffect,useState}from'react';function a3_0x2753(){const _0x34c57e=['duplicateCount','./src/api/','replace','437638ZBZiBc','white','\x20from\x20\x27@/','api.common.usingDefaultAppCode','api-pull','api.pullUI.pullFailed','571698YZlPIS','1RWLCQb','Authentication','env','56020YYDWBJ','includes','error','5931332axVddf','api.pullUI.importHint','column','2545039jrPWwF','split','join','cyan','yellow','lovrabet\x20auth','dim','cwd','client','green','endsWith','.ts','[ERROR]\x20','length','red','originalCount','9WuHWUt','datasetCount','54AdEmvg','5cLjfpf','gray','api.pullUI.successPull','api.pullUI.modelFile','api.pullUI.fetching','import\x20','561530ycQhtt','modelCount','api','-client','api.pullUI.duplicateInfo','production','4687168cTtDHT','message','string'];a3_0x2753=function(){return _0x34c57e;};return a3_0x2753();}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a3_0x9f72(_0x163138,_0x1cef42){_0x163138=_0x163138-0xf2;const _0x2753ef=a3_0x2753();let _0x9f7245=_0x2753ef[_0x163138];return _0x9f7245;}import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';import{useI18n}from'../i18n/hooks.js';export const ApiPullUI=({appCode:_0x15b0bc,env:_0x3c50f9,output:_0x3c02b2})=>{const _0x1de730=a3_0x9f72,{exit:_0x22a923}=useApp(),{t:_0x46db6e}=useI18n(),[_0x4605f3,_0x3b8468]=useState(![]),[_0x5b953c,_0x3f95ea]=useState(![]),[_0x3ee86b,_0x47d7a1]=useState(null),[_0x1a2ef1,_0x279c81]=useState(null),_0x181ede=readConfig(),_0x4d9f33=getConfigAppCode(),_0x38031d=_0x15b0bc||_0x4d9f33,_0xd7faff=typeof _0x181ede?.['env']===_0x1de730(0x108)?_0x181ede[_0x1de730(0x115)]:undefined,_0x1f2a60=_0x3c50f9||_0xd7faff||_0x1de730(0x105);initEnv(_0x1f2a60);const _0x273a3e=_0x3c02b2||_0x1de730(0x10a),_0x543678=_0x15b0bc&&_0x15b0bc[_0x1de730(0x117)]('-')?_0x15b0bc[_0x1de730(0x11d)]('-')['slice'](0x1)[_0x1de730(0x11e)]('-'):'',_0x3c1526=_0x15b0bc?_0x46db6e('api.common.usingSpecifiedAppCode',{'appCode':_0x38031d}):_0x46db6e(_0x1de730(0x10f),{'appCode':_0x38031d}),_0x359bb1=_0x543678?_0x543678+'-api':_0x1de730(0x102),_0x493d90=_0x543678?_0x543678+_0x1de730(0x103):'client';useEffect(()=>{_0x3b8468(!![]),_0x3eb075();},[]),useEffect(()=>{(_0x5b953c||_0x3ee86b)&&_0x22a923();},[_0x5b953c,_0x3ee86b,_0x22a923]);async function _0x3eb075(){const _0x58aa2d=_0x1de730;if(!_0x38031d){_0x47d7a1(_0x46db6e('api.common.noAppCodeDefault'));return;}try{logger['setLogPath'](process[_0x58aa2d(0x123)]());const {configArray:_0x2b0d5b}=await fetchModelList(_0x38031d),_0x3545e0=_0x2b0d5b[_0x58aa2d(0xf4)],_0x4aa240=!_0x15b0bc,_0x5ef7f9=await generateApiFile(_0x2b0d5b,_0x543678,_0x38031d,_0x4aa240,_0x1f2a60,_0x273a3e),_0x151ee1=_0x273a3e[_0x58aa2d(0x126)]('/')?_0x273a3e:_0x273a3e+'/';_0x279c81({'api':''+_0x151ee1+_0x359bb1+_0x58aa2d(0xf2),'client':''+_0x151ee1+_0x493d90+_0x58aa2d(0xf2),'modelCount':_0x5ef7f9['modelCount'],'datasetCount':_0x3545e0,'originalCount':_0x3545e0,'duplicateCount':0x0}),_0x3f95ea(!![]);}catch(_0x110998){const _0x16ff5d=_0x110998 instanceof Error?_0x110998[_0x58aa2d(0x107)]:String(_0x110998);logger[_0x58aa2d(0x118)](_0x58aa2d(0x110),'拉取\x20API\x20配置失败:\x20'+_0x16ff5d,{'appCode':_0x38031d,'error':_0x16ff5d}),_0x47d7a1(_0x46db6e(_0x58aa2d(0x111),{'error':_0x16ff5d}));}finally{_0x3b8468(![]);}}return a3_0x4bcf7c(Box,{'flexDirection':'column','children':[(_0x4605f3||_0x5b953c)&&a3_0x4bcf7c(Box,{'children':[a3_0x2c50f6(Text,{'color':_0x1de730(0xfb),'children':'*\x20'}),a3_0x2c50f6(Text,{'color':_0x15b0bc?_0x1de730(0x10d):_0x1de730(0x122),'children':_0x3c1526})]}),_0x4605f3&&a3_0x2c50f6(Box,{'children':a3_0x2c50f6(Text,{'children':_0x46db6e(_0x1de730(0xfe),{'env':_0x1f2a60})})}),_0x5b953c&&_0x1a2ef1&&a3_0x4bcf7c(Box,{'flexDirection':_0x1de730(0x11b),'children':[a3_0x2c50f6(Box,{'children':a3_0x2c50f6(Text,{'color':_0x1de730(0x125),'children':_0x46db6e(_0x1de730(0xfc),{'datasetCount':_0x1a2ef1[_0x1de730(0xf8)],'modelCount':_0x1a2ef1[_0x1de730(0x101)]})})}),_0x1a2ef1[_0x1de730(0x109)]>0x0&&a3_0x2c50f6(Box,{'marginTop':0x1,'children':a3_0x2c50f6(Text,{'color':_0x1de730(0x120),'children':_0x46db6e(_0x1de730(0x104),{'originalCount':_0x1a2ef1[_0x1de730(0xf6)],'duplicateCount':_0x1a2ef1['duplicateCount']})})}),a3_0x2c50f6(Box,{'marginTop':0x1,'children':a3_0x2c50f6(Text,{'color':'gray','children':_0x46db6e('api.pullUI.generatedFiles')})}),a3_0x4bcf7c(Box,{'marginLeft':0x2,'children':[a3_0x4bcf7c(Text,{'color':_0x1de730(0x11f),'children':['•\x20',_0x1a2ef1[_0x1de730(0x102)]]}),a3_0x4bcf7c(Text,{'color':'dim','children':['\x20',_0x46db6e(_0x1de730(0xfd),{'count':_0x1a2ef1[_0x1de730(0x101)]})]})]}),a3_0x4bcf7c(Box,{'marginLeft':0x2,'children':[a3_0x4bcf7c(Text,{'color':_0x1de730(0x11f),'children':['•\x20',_0x1a2ef1[_0x1de730(0x124)]]}),a3_0x4bcf7c(Text,{'color':'dim','children':['\x20',_0x46db6e('api.pullUI.clientFile')]})]}),a3_0x2c50f6(Box,{'marginTop':0x1,'children':a3_0x2c50f6(Text,{'color':_0x1de730(0xfb),'children':_0x46db6e(_0x1de730(0x11a))})}),a3_0x2c50f6(Box,{'marginLeft':0x2,'children':a3_0x4bcf7c(Text,{'color':'yellow','children':[_0x1de730(0xff),'{\x20lovrabetClient\x20}',_0x1de730(0x10e),_0x1a2ef1[_0x1de730(0x124)][_0x1de730(0x10b)](/^\.\//,'')[_0x1de730(0x10b)](_0x1de730(0xf2),''),'\x27']})})]}),_0x3ee86b&&a3_0x4bcf7c(Box,{'flexDirection':'column','children':[a3_0x2c50f6(Box,{'children':a3_0x4bcf7c(Text,{'color':_0x1de730(0xf5),'children':[_0x1de730(0xf3),_0x3ee86b]})}),(_0x3ee86b[_0x1de730(0x117)]('登录')||_0x3ee86b['includes'](_0x1de730(0x114))||_0x3ee86b[_0x1de730(0x117)]('expired'))&&a3_0x4bcf7c(Box,{'marginTop':0x1,'children':[a3_0x2c50f6(Text,{'color':_0x1de730(0x120),'children':'*\x20'}),a3_0x2c50f6(Text,{'color':_0x1de730(0x11f),'children':_0x1de730(0x121)}),a3_0x4bcf7c(Text,{'color':_0x1de730(0x120),'children':['\x20',_0x46db6e('api.common.authRetry')]})]})]})]});};
@@ -1 +1 @@
1
- const a5_0x43bf27=a5_0x5db6;(function(_0x36c366,_0x4d6e6d){const _0x583794=a5_0x5db6,_0x5c0161=_0x36c366();while(!![]){try{const _0x1b120a=-parseInt(_0x583794(0x167))/0x1+-parseInt(_0x583794(0x15d))/0x2*(-parseInt(_0x583794(0x171))/0x3)+parseInt(_0x583794(0x170))/0x4*(-parseInt(_0x583794(0x159))/0x5)+parseInt(_0x583794(0x176))/0x6*(-parseInt(_0x583794(0x16b))/0x7)+-parseInt(_0x583794(0x15c))/0x8*(parseInt(_0x583794(0x175))/0x9)+-parseInt(_0x583794(0x177))/0xa*(parseInt(_0x583794(0x174))/0xb)+parseInt(_0x583794(0x16e))/0xc;if(_0x1b120a===_0x4d6e6d)break;else _0x5c0161['push'](_0x5c0161['shift']());}catch(_0x3377f4){_0x5c0161['push'](_0x5c0161['shift']());}}}(a5_0x169d,0x2405d));function a5_0x5db6(_0x4c2b59,_0x21e7fd){_0x4c2b59=_0x4c2b59-0x157;const _0x169d2b=a5_0x169d();let _0x5db673=_0x169d2b[_0x4c2b59];return _0x5db673;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';import a5_0x4d31b2 from'../i18n/index.js';function a5_0x169d(){const _0x4a16c2=['92MEyTfS','message','errorMessage','fetch-model-list','Unauthorized','401','api.fetchModel.fetchError','replace','error','/api/node-toolbox/dataset/model-list?appcode=','285491kiDGgw','bind','code','name','95802xmSglM','data','errorMsg','9557040AnArwF','trim','825788IUMdAI','4686wmpqVr','configArray','api.fetchModel.httpError','66epCQXY','9AxZTvM','36esEfIG','208750TKTVgG','正在从服务器拉取模型列表...\x20(环境:\x20','includes','length','map','5rLAsUg','api.common.unknownError','json','171352DmPHBI'];a5_0x169d=function(){return _0x4a16c2;};return a5_0x169d();}const t=a5_0x4d31b2['t'][a5_0x43bf27(0x168)](a5_0x4d31b2);function cleanNewlines(_0x516e9e){const _0x2c866a=a5_0x43bf27;return _0x516e9e[_0x2c866a(0x164)](/[\r\n]+/g,'\x20')[_0x2c866a(0x16f)]();}function cleanDatasetName(_0x34eb64){const _0xacf230=a5_0x43bf27;if(!_0x34eb64[_0xacf230(0x16a)])return _0x34eb64;return{..._0x34eb64,'name':cleanNewlines(_0x34eb64['name'])};}function cleanDatasetNames(_0x28d026){const _0x21b630=a5_0x43bf27;return _0x28d026[_0x21b630(0x158)](cleanDatasetName);}export async function fetchModelList(_0x654d78){const _0x558bc7=a5_0x43bf27,_0x13b73e=getEnv(),_0x1c4022=getApiDomain()+_0x558bc7(0x166)+_0x654d78+'&otype=array';logger['info'](_0x558bc7(0x160),_0x558bc7(0x178)+_0x13b73e+')',{'apiUrl':_0x1c4022});const _0x1e33c3=await fetch(_0x1c4022,{'headers':{'Cookie':getCookie()}});if(!_0x1e33c3['ok']){if(_0x1e33c3['status']===0x191)throw new Error(t('api.common.authExpired'));throw new Error(t(_0x558bc7(0x173),{'status':_0x1e33c3['status']}));}const _0x341c55=await _0x1e33c3[_0x558bc7(0x15b)]();if(!_0x341c55['success']){const _0x4cc4d8=_0x341c55[_0x558bc7(0x16d)]||_0x341c55['message']||_0x341c55[_0x558bc7(0x16c)]?.[_0x558bc7(0x15e)]||_0x341c55[_0x558bc7(0x15f)]||_0x341c55[_0x558bc7(0x165)]||t(_0x558bc7(0x15a));if(_0x4cc4d8[_0x558bc7(0x179)](_0x558bc7(0x162))||_0x4cc4d8[_0x558bc7(0x179)](_0x558bc7(0x161))||_0x4cc4d8[_0x558bc7(0x179)]('登录')||_0x4cc4d8[_0x558bc7(0x179)]('认证')||_0x341c55['errorCode']==='UNAUTHORIZED'||_0x341c55[_0x558bc7(0x169)]===0x191||_0x341c55['code']===_0x558bc7(0x162))throw new Error(t('api.common.authExpired'));throw new Error(t(_0x558bc7(0x163),{'error':_0x4cc4d8}));}const _0x3a9708=cleanDatasetNames(_0x341c55[_0x558bc7(0x16c)][_0x558bc7(0x172)]);return{'configArray':_0x3a9708,'count':_0x3a9708[_0x558bc7(0x157)]};}
1
+ const a4_0x5af0dd=a4_0x21ac;(function(_0x2f7409,_0x28a539){const _0x32c1eb=a4_0x21ac,_0x4d170c=_0x2f7409();while(!![]){try{const _0x288295=parseInt(_0x32c1eb(0x1d6))/0x1+-parseInt(_0x32c1eb(0x1e9))/0x2+-parseInt(_0x32c1eb(0x1de))/0x3*(-parseInt(_0x32c1eb(0x1ea))/0x4)+parseInt(_0x32c1eb(0x1f1))/0x5+-parseInt(_0x32c1eb(0x1eb))/0x6+parseInt(_0x32c1eb(0x1d9))/0x7*(parseInt(_0x32c1eb(0x1f0))/0x8)+-parseInt(_0x32c1eb(0x1d3))/0x9;if(_0x288295===_0x28a539)break;else _0x4d170c['push'](_0x4d170c['shift']());}catch(_0x5c2370){_0x4d170c['push'](_0x4d170c['shift']());}}}(a4_0x5b4c,0x2a50c));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a4_0x5b4c(){const _0x584e08=['includes','code','errorMessage','302412Acbacw','49136ZpIrMa','1625610vKThQp','name','正在从服务器拉取模型列表...\x20(环境:\x20','configArray','errorCode','2661264NEWtMF','1325400kAyltz','message','map','bind','api.fetchModel.fetchError','894762pKvkKu','/api/node-toolbox/dataset/model-list?appcode=','errorMsg','72577dLVaPG','&otype=array','401','7NUdjcp','fetch-model-list','api.fetchModel.httpError','replace','api.common.unknownError','6AMVoFL','status','length','api.common.authExpired','data','Unauthorized','UNAUTHORIZED','error'];a4_0x5b4c=function(){return _0x584e08;};return a4_0x5b4c();}import{logger}from'../utils/logger.js';function a4_0x21ac(_0x1752a8,_0x4a9470){_0x1752a8=_0x1752a8-0x1d1;const _0x5b4cd0=a4_0x5b4c();let _0x21ac8b=_0x5b4cd0[_0x1752a8];return _0x21ac8b;}import{getEnv}from'../constant/env.js';import a4_0x31d5ee from'../i18n/index.js';const t=a4_0x31d5ee['t'][a4_0x5af0dd(0x1d1)](a4_0x31d5ee);function cleanNewlines(_0x5737db){const _0xad4928=a4_0x5af0dd;return _0x5737db[_0xad4928(0x1dc)](/[\r\n]+/g,'\x20')['trim']();}function cleanDatasetName(_0x18dd7a){const _0x29873c=a4_0x5af0dd;if(!_0x18dd7a[_0x29873c(0x1ec)])return _0x18dd7a;return{..._0x18dd7a,'name':cleanNewlines(_0x18dd7a['name'])};}function cleanDatasetNames(_0x21ac65){const _0x21d472=a4_0x5af0dd;return _0x21ac65[_0x21d472(0x1f3)](cleanDatasetName);}export async function fetchModelList(_0xa7abdf){const _0x4ee0e7=a4_0x5af0dd,_0x1b8b5d=getEnv(),_0x603d70=getApiDomain()+_0x4ee0e7(0x1d4)+_0xa7abdf+_0x4ee0e7(0x1d7);logger['info'](_0x4ee0e7(0x1da),_0x4ee0e7(0x1ed)+_0x1b8b5d+')',{'apiUrl':_0x603d70});const _0x44e290=await fetch(_0x603d70,{'headers':{'Cookie':getCookie()}});if(!_0x44e290['ok']){if(_0x44e290[_0x4ee0e7(0x1df)]===0x191)throw new Error(t(_0x4ee0e7(0x1e1)));throw new Error(t(_0x4ee0e7(0x1db),{'status':_0x44e290[_0x4ee0e7(0x1df)]}));}const _0x1ace91=await _0x44e290['json']();if(!_0x1ace91['success']){const _0x42e17e=_0x1ace91[_0x4ee0e7(0x1d5)]||_0x1ace91[_0x4ee0e7(0x1f2)]||_0x1ace91[_0x4ee0e7(0x1e2)]?.[_0x4ee0e7(0x1f2)]||_0x1ace91[_0x4ee0e7(0x1e8)]||_0x1ace91[_0x4ee0e7(0x1e5)]||t(_0x4ee0e7(0x1dd));if(_0x42e17e[_0x4ee0e7(0x1e6)](_0x4ee0e7(0x1d8))||_0x42e17e['includes'](_0x4ee0e7(0x1e3))||_0x42e17e[_0x4ee0e7(0x1e6)]('登录')||_0x42e17e[_0x4ee0e7(0x1e6)]('认证')||_0x1ace91[_0x4ee0e7(0x1ef)]===_0x4ee0e7(0x1e4)||_0x1ace91[_0x4ee0e7(0x1e7)]===0x191||_0x1ace91[_0x4ee0e7(0x1e7)]===_0x4ee0e7(0x1d8))throw new Error(t(_0x4ee0e7(0x1e1)));throw new Error(t(_0x4ee0e7(0x1d2),{'error':_0x42e17e}));}const _0x19eb2e=cleanDatasetNames(_0x1ace91[_0x4ee0e7(0x1e2)][_0x4ee0e7(0x1ee)]);return{'configArray':_0x19eb2e,'count':_0x19eb2e[_0x4ee0e7(0x1e0)]};}
@@ -1 +1 @@
1
- const a6_0x5ba96b=a6_0x353d;(function(_0x2ac78f,_0x40f469){const _0x184e1a=a6_0x353d,_0x3c858f=_0x2ac78f();while(!![]){try{const _0x169b90=parseInt(_0x184e1a(0xf9))/0x1*(parseInt(_0x184e1a(0xef))/0x2)+parseInt(_0x184e1a(0xf4))/0x3+-parseInt(_0x184e1a(0x110))/0x4*(parseInt(_0x184e1a(0xfe))/0x5)+-parseInt(_0x184e1a(0xee))/0x6*(parseInt(_0x184e1a(0xff))/0x7)+-parseInt(_0x184e1a(0x109))/0x8*(-parseInt(_0x184e1a(0x10b))/0x9)+-parseInt(_0x184e1a(0xed))/0xa+parseInt(_0x184e1a(0xf7))/0xb*(parseInt(_0x184e1a(0xf1))/0xc);if(_0x169b90===_0x40f469)break;else _0x3c858f['push'](_0x3c858f['shift']());}catch(_0x4f8046){_0x3c858f['push'](_0x3c858f['shift']());}}}(a6_0x4390,0xb0ea0));import a6_0x292336 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a6_0x4b32d0 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a6_0x353d(_0x2fc79a,_0x17707a){_0x2fc79a=_0x2fc79a-0xec;const _0x4390ae=a6_0x4390();let _0x353d9a=_0x4390ae[_0x2fc79a];return _0x353d9a;}import{logger}from'../utils/logger.js';import a6_0x1dd844 from'../i18n/index.js';function a6_0x4390(){const _0x262ae6=['alias','utf8','string','./src/api/','resolve',',\x20env:\x20\x22','API\x20文件生成成功!','env','templates/generate-api','5121968eIUsvy','../..','9GiPrMk','join','bind','tableName','typescript','16xQSdBX','datasetCode','push','key','success','.ts','app','\x22\x20}','8119210nQKhxB','6rBZrrz','2BWVkfa','{\x20apiConfigName:\x20\x22','2967276jcGkOp','length','init-api','2553453eEjSAU','dirname','format','11cFSDvR','api.ts.tpl','1021586URGRhJ','{\x20apiConfigName:\x20','-api','online','client.ts.tpl','1356385BPJRuG','970109RscIVt'];a6_0x4390=function(){return _0x262ae6;};return a6_0x4390();}const t=a6_0x1dd844['t'][a6_0x5ba96b(0x10d)](a6_0x1dd844);export async function generateApiFile(_0x213266,_0x14f243='',_0xdcded4,_0x573e7a=![],_0x5501c5,_0x181336=a6_0x5ba96b(0x103)){const _0x45ae61=a6_0x5ba96b,_0xc40299=readConfig(),_0x1cea79=_0xdcded4||_0xc40299?.[_0x45ae61(0x116)];if(typeof _0x1cea79!==_0x45ae61(0x102)||!_0x1cea79)throw new Error(t('api.generateFile.noAppCode'));const _0x4b5f3f=_0x573e7a?'CONFIG_NAMES.DEFAULT':'\x22'+_0x1cea79+'\x22',_0x578eb7=typeof _0xc40299['env']===_0x45ae61(0x102)?_0xc40299[_0x45ae61(0x107)]:undefined,_0x47c654=_0x5501c5||_0x578eb7||_0x45ae61(0xfc),_0x119726=_0x47c654!==_0x45ae61(0xfc);let _0x34ab1b;if(_0x573e7a)_0x119726?_0x34ab1b=_0x45ae61(0xfa)+_0x4b5f3f+_0x45ae61(0x105)+_0x47c654+_0x45ae61(0xec):_0x34ab1b='';else{const _0x1425df=_0x119726?_0x45ae61(0x105)+_0x47c654+'\x22':'';_0x34ab1b=_0x45ae61(0xf0)+_0x1cea79+'\x22'+_0x1425df+'\x20}';}const _0x5ecf98=_0x14f243?_0x14f243+_0x45ae61(0xfb):'api',_0xc91874=_0x14f243?_0x14f243+'-client':'client',_0x24216a=[];_0x213266['forEach'](_0x4e5ef2=>{const _0x474b22=_0x45ae61;_0x24216a[_0x474b22(0x112)]({'datasetCode':_0x4e5ef2[_0x474b22(0x111)],'tableName':_0x4e5ef2[_0x474b22(0x10e)],'name':_0x4e5ef2['name']||'','alias':_0x4e5ef2[_0x474b22(0x100)]||_0x4e5ef2[_0x474b22(0x113)]});});const _0x6aab95=fileURLToPath(import.meta.url),_0x130a48=a6_0x4b32d0[_0x45ae61(0x104)](a6_0x4b32d0[_0x45ae61(0xf5)](_0x6aab95),_0x45ae61(0x10a)),_0x42fe89=a6_0x4b32d0[_0x45ae61(0x10c)](_0x130a48,_0x45ae61(0x108)),_0x266ea5=a6_0x4b32d0['join'](_0x42fe89,_0x45ae61(0xf8)),_0x1b2240=a6_0x4b32d0[_0x45ae61(0x10c)](_0x42fe89,_0x45ae61(0xfd)),_0x384e6e=_0x181336['endsWith']('/')?_0x181336['slice'](0x0,-0x1):_0x181336;mkdirSync(_0x384e6e,{'recursive':!![]});const _0x298037=_0x24216a[0x0]?.[_0x45ae61(0x100)],_0x32271d=readFileSync(_0x266ea5,_0x45ae61(0x101)),_0x92378f=TemplateReplacer['replaceApiContent'](_0x32271d,_0x1cea79,_0x24216a,_0x298037,_0x5ecf98,_0x4b5f3f),_0x19ea64=await a6_0x292336[_0x45ae61(0xf6)](_0x92378f,{'parser':_0x45ae61(0x10f)}),_0x5ebbaa=_0x384e6e+'/'+_0x5ecf98+_0x45ae61(0x115);writeFileSync(_0x5ebbaa,_0x19ea64,{'encoding':_0x45ae61(0x101)});const _0x46e5d1=readFileSync(_0x1b2240,'utf8'),_0x16d2fc=TemplateReplacer['replaceApiContent'](_0x46e5d1,_0x1cea79,_0x24216a,_0x298037,_0x5ecf98,_0x4b5f3f,_0x34ab1b),_0x57b364=await a6_0x292336[_0x45ae61(0xf6)](_0x16d2fc,{'parser':'typescript'}),_0x405aa1=_0x384e6e+'/'+_0xc91874+_0x45ae61(0x115);writeFileSync(_0x405aa1,_0x57b364,{'encoding':_0x45ae61(0x101)});const _0xbf5806=_0x24216a[_0x45ae61(0xf2)];return logger[_0x45ae61(0x114)](_0x45ae61(0xf3),_0x45ae61(0x106),undefined,{'apiFile':_0x5ebbaa,'clientFile':_0x405aa1,'modelCount':_0xbf5806,'configName':_0x4b5f3f}),{'modelCount':_0xbf5806,'apiFilePath':_0x5ebbaa,'clientFilePath':_0x405aa1,'configName':_0x4b5f3f};}
1
+ const a5_0x4fdd08=a5_0x1e58;(function(_0x1ed9f6,_0x3720fd){const _0x3dfc59=a5_0x1e58,_0x6307c0=_0x1ed9f6();while(!![]){try{const _0xdd25e9=parseInt(_0x3dfc59(0x170))/0x1*(-parseInt(_0x3dfc59(0x171))/0x2)+parseInt(_0x3dfc59(0x184))/0x3*(-parseInt(_0x3dfc59(0x16f))/0x4)+parseInt(_0x3dfc59(0x18a))/0x5*(-parseInt(_0x3dfc59(0x17a))/0x6)+parseInt(_0x3dfc59(0x174))/0x7*(parseInt(_0x3dfc59(0x165))/0x8)+parseInt(_0x3dfc59(0x175))/0x9+-parseInt(_0x3dfc59(0x17d))/0xa+parseInt(_0x3dfc59(0x163))/0xb*(parseInt(_0x3dfc59(0x18b))/0xc);if(_0xdd25e9===_0x3720fd)break;else _0x6307c0['push'](_0x6307c0['shift']());}catch(_0x46ef87){_0x6307c0['push'](_0x6307c0['shift']());}}}(a5_0x469a,0x5e093));import a5_0x54013d from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x556e7f from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';function a5_0x1e58(_0x1a9d93,_0x5e2c1b){_0x1a9d93=_0x1a9d93-0x161;const _0x469a21=a5_0x469a();let _0x1e586f=_0x469a21[_0x1a9d93];return _0x1e586f;}import a5_0x31fe01 from'../i18n/index.js';const t=a5_0x31fe01['t'][a5_0x4fdd08(0x16c)](a5_0x31fe01);function a5_0x469a(){const _0x1d0236=['production','7444MflkoG','3QcJikj','260954yvDboB','format','typescript','14jQsKLi','990522USuswG','forEach','success','endsWith','{\x20apiConfigName:\x20\x22','270xBBNSz','../..','.ts','1048370SrthLL','app','join','utf8','API\x20文件生成成功!','string','./src/api/','798BLbivZ','replaceApiContent','name','client','resolve','{\x20apiConfigName:\x20','54515kBFOjG','249672ppxEAp','\x22\x20}','init-api','client.ts.tpl','583XWQCxd','templates/generate-api','2617296hbElqP','-api',',\x20env:\x20\x22','-client','api.ts.tpl','api.generateFile.noAppCode','CONFIG_NAMES.DEFAULT','bind','push'];a5_0x469a=function(){return _0x1d0236;};return a5_0x469a();}export async function generateApiFile(_0x11cab9,_0x394f23='',_0x2ca56f,_0x16b176=![],_0x2847c0,_0x4f0ceb=a5_0x4fdd08(0x183)){const _0x387399=a5_0x4fdd08,_0x397680=readConfig(),_0x473767=_0x2ca56f||_0x397680?.[_0x387399(0x17e)];if(typeof _0x473767!==_0x387399(0x182)||!_0x473767)throw new Error(t(_0x387399(0x16a)));const _0xd5a127=_0x16b176?_0x387399(0x16b):'\x22'+_0x473767+'\x22',_0x19024c=typeof _0x397680['env']===_0x387399(0x182)?_0x397680['env']:undefined,_0x584f11=_0x2847c0||_0x19024c||'production',_0xdcafbe=_0x584f11!==_0x387399(0x16e);let _0x1dd441;if(_0x16b176)_0xdcafbe?_0x1dd441=_0x387399(0x189)+_0xd5a127+_0x387399(0x167)+_0x584f11+_0x387399(0x18c):_0x1dd441='';else{const _0x27f932=_0xdcafbe?',\x20env:\x20\x22'+_0x584f11+'\x22':'';_0x1dd441=_0x387399(0x179)+_0x473767+'\x22'+_0x27f932+'\x20}';}const _0x41805a=_0x394f23?_0x394f23+_0x387399(0x166):'api',_0x522052=_0x394f23?_0x394f23+_0x387399(0x168):_0x387399(0x187),_0xe03543=[];_0x11cab9[_0x387399(0x176)](_0x390c65=>{const _0x3e117b=_0x387399;_0xe03543[_0x3e117b(0x16d)]({'datasetCode':_0x390c65['datasetCode'],'tableName':_0x390c65['tableName'],'name':_0x390c65[_0x3e117b(0x186)]||'','alias':_0x390c65['alias']||_0x390c65['key']});});const _0x2c49c8=fileURLToPath(import.meta.url),_0x58610e=a5_0x556e7f[_0x387399(0x188)](a5_0x556e7f['dirname'](_0x2c49c8),_0x387399(0x17b)),_0x37e5a1=a5_0x556e7f[_0x387399(0x17f)](_0x58610e,_0x387399(0x164)),_0x798cf9=a5_0x556e7f[_0x387399(0x17f)](_0x37e5a1,_0x387399(0x169)),_0x4ae41f=a5_0x556e7f[_0x387399(0x17f)](_0x37e5a1,_0x387399(0x162)),_0x331ac8=_0x4f0ceb[_0x387399(0x178)]('/')?_0x4f0ceb['slice'](0x0,-0x1):_0x4f0ceb;mkdirSync(_0x331ac8,{'recursive':!![]});const _0x560880=_0xe03543[0x0]?.['alias'],_0x40a288=readFileSync(_0x798cf9,_0x387399(0x180)),_0x5499dd=TemplateReplacer[_0x387399(0x185)](_0x40a288,_0x473767,_0xe03543,_0x560880,_0x41805a,_0xd5a127),_0x14ab9=await a5_0x54013d[_0x387399(0x172)](_0x5499dd,{'parser':_0x387399(0x173)}),_0x520a73=_0x331ac8+'/'+_0x41805a+_0x387399(0x17c);writeFileSync(_0x520a73,_0x14ab9,{'encoding':'utf8'});const _0x31a8ea=readFileSync(_0x4ae41f,_0x387399(0x180)),_0x2a653a=TemplateReplacer[_0x387399(0x185)](_0x31a8ea,_0x473767,_0xe03543,_0x560880,_0x41805a,_0xd5a127,_0x1dd441),_0x2acdd6=await a5_0x54013d['format'](_0x2a653a,{'parser':_0x387399(0x173)}),_0x1873fe=_0x331ac8+'/'+_0x522052+_0x387399(0x17c);writeFileSync(_0x1873fe,_0x2acdd6,{'encoding':_0x387399(0x180)});const _0x1acba5=_0xe03543['length'];return logger[_0x387399(0x177)](_0x387399(0x161),_0x387399(0x181),undefined,{'apiFile':_0x520a73,'clientFile':_0x1873fe,'modelCount':_0x1acba5,'configName':_0xd5a127}),{'modelCount':_0x1acba5,'apiFilePath':_0x520a73,'clientFilePath':_0x1873fe,'configName':_0xd5a127};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- const a7_0x5245dc=a7_0x3db9;(function(_0x4e8d30,_0x4e7bed){const _0x23ff5f=a7_0x3db9,_0x4a5d63=_0x4e8d30();while(!![]){try{const _0x8a33cf=-parseInt(_0x23ff5f(0xb7))/0x1+-parseInt(_0x23ff5f(0xce))/0x2+-parseInt(_0x23ff5f(0xe7))/0x3+parseInt(_0x23ff5f(0xf6))/0x4+parseInt(_0x23ff5f(0xda))/0x5+-parseInt(_0x23ff5f(0xc7))/0x6+parseInt(_0x23ff5f(0xc3))/0x7*(parseInt(_0x23ff5f(0xec))/0x8);if(_0x8a33cf===_0x4e7bed)break;else _0x4a5d63['push'](_0x4a5d63['shift']());}catch(_0x412fa4){_0x4a5d63['push'](_0x4a5d63['shift']());}}}(a7_0x7da6,0x9404e));import{jsx as a7_0x107df3}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a7_0x7da6(){const _0x21eb41=['\x0a\x20\x20--datasetcode\x20<codes>\x20','api.common.noAppCodeHint','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20','api.common.paramsError','702611HRpiNS','api.common.paramsNotJson','message','split','2875368eARvEr','string','api.common.usingConfigAppCode','flags','api.help.examples','api.help.usage','\x1b[0m','2330068TWpLol','api.common.noAppCodeOption1','env','api.help.docDesc','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.noAppCodeOption2Pull','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','log','exit','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.useAppcodeFlag','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','2652490TIqjjR','api.help.docEnv','datasetcode','api.common.paramsInvalidJson','api.common.onlyGenerateDatasets','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','input','api.help.optOutput','length','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20','pull','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','3019248QVhjsc','api.help.options','api.common.noAppCode','api.help.unknownCommand','\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','208nnIRVb','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.datasetcodeEmpty','api.help.docDataset','api.help.pullAppcode','api.help.availableCommands','api.help.pullOutput','api.help.docDatasets','api.common.noPositionalArgs','1034812RNMLZY','api.common.usingConfigAppCodeHint','api.help.pullEnv','api.help.optDatasetcode','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20','object','api.help.docAppcode','parse','doc','output','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.noAppCodeOption2Doc','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x1b[90m','appcode','help','error','trim','141935ZeNvZq','filter','api.help.docOutput','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','bind','api.help.pullDesc'];a7_0x7da6=function(){return _0x21eb41;};return a7_0x7da6();}import{getConfigAppCode}from'../utils/config.js';import a7_0x41419d from'../i18n/index.js';function a7_0x3db9(_0x4b06b7,_0x56b120){_0x4b06b7=_0x4b06b7-0xb2;const _0x7da62=a7_0x7da6();let _0x3db9e8=_0x7da62[_0x4b06b7];return _0x3db9e8;}const t=a7_0x41419d['t'][a7_0x5245dc(0xbc)](a7_0x41419d);export async function apiCli(_0x16cf34){const _0x31d7b1=a7_0x5245dc,_0x1c99a7=_0x16cf34[_0x31d7b1(0xe0)][0x1];if(_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xb4)]){console['log']('\x0a'+t('api.help.title')+'\x0a\x0a'+t(_0x31d7b1(0xcc))+_0x31d7b1(0xed)+t(_0x31d7b1(0xe8))+_0x31d7b1(0xe4)+t('api.help.optAppcode')+_0x31d7b1(0xfb)+t(_0x31d7b1(0xe1))+_0x31d7b1(0xeb)+t('api.help.optEnv')+_0x31d7b1(0xbe)+t(_0x31d7b1(0xf9))+'\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+t('api.help.optHelp')+'\x0a\x0a'+t(_0x31d7b1(0xcb))+_0x31d7b1(0xd4)+t(_0x31d7b1(0xbd))+'\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x31d7b1(0xf1))+_0x31d7b1(0xd7)+t(_0x31d7b1(0xf3))+_0x31d7b1(0xe6)+t(_0x31d7b1(0xf8))+'\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x31d7b1(0xd1))+_0x31d7b1(0x101)+t(_0x31d7b1(0xfd))+'\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x31d7b1(0xb9))+_0x31d7b1(0xd9)+t(_0x31d7b1(0xdb))+_0x31d7b1(0x103)+t(_0x31d7b1(0xf0))+_0x31d7b1(0xc1)+t(_0x31d7b1(0xf4))+'\x0a');return;}if(_0x1c99a7===_0x31d7b1(0xe5)){_0x16cf34[_0x31d7b1(0xe0)][0x2]&&(console[_0x31d7b1(0xb5)](t('api.common.noPositionalArgs')),console[_0x31d7b1(0xd5)](t(_0x31d7b1(0xd8))),console[_0x31d7b1(0xd5)](_0x31d7b1(0xc0)+_0x16cf34['input'][0x2]),process[_0x31d7b1(0xd6)](0x1));const _0x22f1c8=getConfigAppCode();let _0x265f6f=_0x16cf34['flags'][_0x31d7b1(0xb3)];const _0x4ad816=typeof _0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xd0)]==='string'?_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xd0)]:undefined,_0x49d266=_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0x100)];!_0x265f6f&&!_0x22f1c8&&(console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xe9))),console[_0x31d7b1(0xd5)](t(_0x31d7b1(0xbf))),console['log'](t(_0x31d7b1(0xcf))),console[_0x31d7b1(0xd5)](t(_0x31d7b1(0xd3))),process[_0x31d7b1(0xd6)](0x1)),_0x265f6f&&_0x22f1c8&&_0x265f6f===_0x22f1c8&&(console[_0x31d7b1(0xd5)]('\x1b[90m'+t(_0x31d7b1(0xc9),{'appCode':_0x265f6f})+_0x31d7b1(0xcd)),console['log'](_0x31d7b1(0xb2)+t(_0x31d7b1(0xf7))+_0x31d7b1(0xcd)),_0x265f6f=undefined),render(a7_0x107df3(ApiPullUI,{'appCode':_0x265f6f,'env':_0x4ad816,'output':_0x49d266}));}else{if(_0x1c99a7===_0x31d7b1(0xff)){_0x16cf34[_0x31d7b1(0xe0)][0x2]&&(console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xf5))),console[_0x31d7b1(0xd5)](t(_0x31d7b1(0xd8))),console[_0x31d7b1(0xd5)](_0x31d7b1(0xbb)+_0x16cf34[_0x31d7b1(0xe0)][0x2]),process[_0x31d7b1(0xd6)](0x1));const _0x228381=getConfigAppCode();let _0x9a0265=_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xb3)];const _0x2f317a=typeof _0x16cf34[_0x31d7b1(0xca)]['env']===_0x31d7b1(0xc8)?_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xd0)]:undefined,_0x594ce2=_0x16cf34['flags'][_0x31d7b1(0x100)],_0x3f8699=_0x16cf34['flags']['params'],_0x16110d=_0x16cf34[_0x31d7b1(0xca)][_0x31d7b1(0xdc)];!_0x9a0265&&!_0x228381&&(console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xe9))),console['log'](t(_0x31d7b1(0xbf))),console[_0x31d7b1(0xd5)](t(_0x31d7b1(0xcf))),console['log'](t(_0x31d7b1(0x102))),process['exit'](0x1));_0x9a0265&&_0x228381&&_0x9a0265===_0x228381&&(console[_0x31d7b1(0xd5)](_0x31d7b1(0xb2)+t('api.common.usingConfigAppCode',{'appCode':_0x9a0265})+_0x31d7b1(0xcd)),_0x9a0265=undefined);let _0x40614f;if(_0x3f8699)try{_0x40614f=JSON[_0x31d7b1(0xfe)](_0x3f8699),(typeof _0x40614f!==_0x31d7b1(0xfc)||_0x40614f===null||Array['isArray'](_0x40614f))&&(console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xdd))),process[_0x31d7b1(0xd6)](0x1));}catch(_0xd06454){console['error'](t(_0x31d7b1(0xc4))),console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xc2),{'error':_0xd06454 instanceof Error?_0xd06454[_0x31d7b1(0xc5)]:String(_0xd06454)})),process[_0x31d7b1(0xd6)](0x1);}let _0x4edd72;_0x16110d&&(_0x4edd72=_0x16110d[_0x31d7b1(0xc6)](',')['map'](_0x19135a=>_0x19135a[_0x31d7b1(0xb6)]())[_0x31d7b1(0xb8)](_0x2163b4=>_0x2163b4[_0x31d7b1(0xe2)]>0x0),_0x4edd72[_0x31d7b1(0xe2)]===0x0&&(console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xef))),process[_0x31d7b1(0xd6)](0x1)),console[_0x31d7b1(0xd5)](_0x31d7b1(0xb2)+t(_0x31d7b1(0xde),{'codes':_0x4edd72['join'](',\x20')})+_0x31d7b1(0xcd))),render(a7_0x107df3(ApiDocUI,{'appCode':_0x9a0265,'env':_0x2f317a,'output':_0x594ce2,'extraParams':_0x40614f,'datasetCodes':_0x4edd72}));}else console[_0x31d7b1(0xb5)](t(_0x31d7b1(0xea))+':\x20'+_0x1c99a7),console['log'](t(_0x31d7b1(0xf2))),console[_0x31d7b1(0xd5)](_0x31d7b1(0xdf)+t(_0x31d7b1(0xbd))),console[_0x31d7b1(0xd5)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20'+t('api.help.pullAppcode')),console[_0x31d7b1(0xd5)](_0x31d7b1(0xba)+t(_0x31d7b1(0xf3))),console[_0x31d7b1(0xd5)](_0x31d7b1(0xe3)+t(_0x31d7b1(0xf8))),console[_0x31d7b1(0xd5)](''),console[_0x31d7b1(0xd5)](_0x31d7b1(0xd2)+t('api.help.docDesc')),console[_0x31d7b1(0xd5)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20'+t('api.help.docAppcode')),console['log'](_0x31d7b1(0xee)+t(_0x31d7b1(0xb9))),console[_0x31d7b1(0xd5)](_0x31d7b1(0xfa)+t(_0x31d7b1(0xdb))),process[_0x31d7b1(0xd6)](0x1);}}
1
+ function a6_0x20db(){const _0x2f561d=['api.help.docDataset','api.help.pullOutput','output','api.help.unknownCommand','api.help.pullDesc','api.help.docDatasets','api.common.noAppCodeOption1','\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','bind','appcode','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20','env','api.help.optAppcode','\x1b[90m','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','datasetcode','16SjXVDv','map','api.common.paramsInvalidJson','api.help.docEnv','api.help.docDesc','api.common.noAppCodeOption2Doc','3395434DHMCND','api.help.optHelp','11373980iNEUaM','api.common.usingConfigAppCode','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.help.optDatasetcode','help','\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','api.help.examples','api.common.paramsError','split','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.help.usage','api.help.docAppcode','filter','\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','api.common.noAppCodeOption2Pull','\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','546652uRVBcI','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20','api.common.datasetcodeEmpty','api.help.options','\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','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','log','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','flags','api.help.title','213828JVQieI','api.help.pullAppcode','api.help.pullEnv','api.common.useAppcodeFlag','3PBbdDN','error','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20','join','5068595kixAMd','9kSnpWX','input','exit','api.help.optEnv','object','api.common.noAppCode','api.help.optOutput','\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20','api.common.noAppCodeHint','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20','\x1b[0m','\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','length','parse','doc','message','2461620XvGSYg','string','\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','1024022OzxkqS','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a'];a6_0x20db=function(){return _0x2f561d;};return a6_0x20db();}function a6_0x1bbf(_0x47c7b9,_0x5553fc){_0x47c7b9=_0x47c7b9-0x118;const _0x20db4f=a6_0x20db();let _0x1bbf7b=_0x20db4f[_0x47c7b9];return _0x1bbf7b;}const a6_0x4406d1=a6_0x1bbf;(function(_0x16a41f,_0x3388a8){const _0xcb2367=a6_0x1bbf,_0x49f2d1=_0x16a41f();while(!![]){try{const _0x4ec28b=parseInt(_0xcb2367(0x16a))/0x1+-parseInt(_0xcb2367(0x13f))/0x2+-parseInt(_0xcb2367(0x124))/0x3*(-parseInt(_0xcb2367(0x120))/0x4)+parseInt(_0xcb2367(0x12a))/0x5+-parseInt(_0xcb2367(0x13c))/0x6+parseInt(_0xcb2367(0x158))/0x7*(parseInt(_0xcb2367(0x152))/0x8)+parseInt(_0xcb2367(0x12b))/0x9*(-parseInt(_0xcb2367(0x15a))/0xa);if(_0x4ec28b===_0x3388a8)break;else _0x49f2d1['push'](_0x49f2d1['shift']());}catch(_0x6a26d2){_0x49f2d1['push'](_0x49f2d1['shift']());}}}(a6_0x20db,0x7fff1));import{jsx as a6_0x1dd75e}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';import a6_0x596313 from'../i18n/index.js';const t=a6_0x596313['t'][a6_0x4406d1(0x149)](a6_0x596313);export async function apiCli(_0x23001c){const _0x3564be=a6_0x4406d1,_0x1e41ed=_0x23001c['input'][0x1];if(_0x23001c[_0x3564be(0x11e)][_0x3564be(0x15e)]){console[_0x3564be(0x11c)]('\x0a'+t(_0x3564be(0x11f))+'\x0a\x0a'+t(_0x3564be(0x164))+_0x3564be(0x140)+t(_0x3564be(0x119))+_0x3564be(0x132)+t(_0x3564be(0x14e))+_0x3564be(0x127)+t(_0x3564be(0x131))+_0x3564be(0x167)+t(_0x3564be(0x12e))+'\x0a\x20\x20--datasetcode\x20<codes>\x20'+t(_0x3564be(0x15d))+_0x3564be(0x15f)+t(_0x3564be(0x159))+'\x0a\x0a'+t(_0x3564be(0x160))+_0x3564be(0x11a)+t(_0x3564be(0x145))+_0x3564be(0x16b)+t('api.help.pullAppcode')+_0x3564be(0x128)+t(_0x3564be(0x142))+_0x3564be(0x15c)+t(_0x3564be(0x122))+'\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x3564be(0x156))+_0x3564be(0x148)+t(_0x3564be(0x165))+_0x3564be(0x169)+t('api.help.docOutput')+_0x3564be(0x137)+t('api.help.docEnv')+_0x3564be(0x150)+t(_0x3564be(0x141))+_0x3564be(0x135)+t(_0x3564be(0x146))+'\x0a');return;}if(_0x1e41ed==='pull'){_0x23001c[_0x3564be(0x12c)][0x2]&&(console[_0x3564be(0x125)](t('api.common.noPositionalArgs')),console[_0x3564be(0x11c)](t(_0x3564be(0x123))),console[_0x3564be(0x11c)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x23001c[_0x3564be(0x12c)][0x2]),process[_0x3564be(0x12d)](0x1));const _0x2347ea=getConfigAppCode();let _0x2f6c86=_0x23001c[_0x3564be(0x11e)][_0x3564be(0x14a)];const _0x52cfce=typeof _0x23001c[_0x3564be(0x11e)][_0x3564be(0x14d)]==='string'?_0x23001c[_0x3564be(0x11e)][_0x3564be(0x14d)]:undefined,_0x4e2174=_0x23001c[_0x3564be(0x11e)][_0x3564be(0x143)];!_0x2f6c86&&!_0x2347ea&&(console[_0x3564be(0x125)](t(_0x3564be(0x130))),console[_0x3564be(0x11c)](t(_0x3564be(0x133))),console[_0x3564be(0x11c)](t(_0x3564be(0x147))),console[_0x3564be(0x11c)](t(_0x3564be(0x168))),process[_0x3564be(0x12d)](0x1)),_0x2f6c86&&_0x2347ea&&_0x2f6c86===_0x2347ea&&(console[_0x3564be(0x11c)](_0x3564be(0x14f)+t(_0x3564be(0x15b),{'appCode':_0x2f6c86})+_0x3564be(0x136)),console[_0x3564be(0x11c)]('\x1b[90m'+t('api.common.usingConfigAppCodeHint')+_0x3564be(0x136)),_0x2f6c86=undefined),render(a6_0x1dd75e(ApiPullUI,{'appCode':_0x2f6c86,'env':_0x52cfce,'output':_0x4e2174}));}else{if(_0x1e41ed===_0x3564be(0x13a)){_0x23001c[_0x3564be(0x12c)][0x2]&&(console[_0x3564be(0x125)](t('api.common.noPositionalArgs')),console[_0x3564be(0x11c)](t(_0x3564be(0x123))),console[_0x3564be(0x11c)](_0x3564be(0x11b)+_0x23001c['input'][0x2]),process[_0x3564be(0x12d)](0x1));const _0x113bed=getConfigAppCode();let _0x17b04b=_0x23001c['flags']['appcode'];const _0x355ff3=typeof _0x23001c['flags'][_0x3564be(0x14d)]===_0x3564be(0x13d)?_0x23001c[_0x3564be(0x11e)]['env']:undefined,_0x4f343f=_0x23001c['flags'][_0x3564be(0x143)],_0x5d9a4d=_0x23001c[_0x3564be(0x11e)]['params'],_0x321cb0=_0x23001c[_0x3564be(0x11e)][_0x3564be(0x151)];!_0x17b04b&&!_0x113bed&&(console[_0x3564be(0x125)](t(_0x3564be(0x130))),console['log'](t(_0x3564be(0x133))),console[_0x3564be(0x11c)](t('api.common.noAppCodeOption1')),console[_0x3564be(0x11c)](t(_0x3564be(0x157))),process[_0x3564be(0x12d)](0x1));_0x17b04b&&_0x113bed&&_0x17b04b===_0x113bed&&(console[_0x3564be(0x11c)]('\x1b[90m'+t(_0x3564be(0x15b),{'appCode':_0x17b04b})+_0x3564be(0x136)),_0x17b04b=undefined);let _0x366dd3;if(_0x5d9a4d)try{_0x366dd3=JSON[_0x3564be(0x139)](_0x5d9a4d),(typeof _0x366dd3!==_0x3564be(0x12f)||_0x366dd3===null||Array['isArray'](_0x366dd3))&&(console[_0x3564be(0x125)](t(_0x3564be(0x154))),process[_0x3564be(0x12d)](0x1));}catch(_0x4bf376){console[_0x3564be(0x125)](t('api.common.paramsNotJson')),console[_0x3564be(0x125)](t(_0x3564be(0x161),{'error':_0x4bf376 instanceof Error?_0x4bf376[_0x3564be(0x13b)]:String(_0x4bf376)})),process[_0x3564be(0x12d)](0x1);}let _0x741424;_0x321cb0&&(_0x741424=_0x321cb0[_0x3564be(0x162)](',')[_0x3564be(0x153)](_0x1c663e=>_0x1c663e['trim']())[_0x3564be(0x166)](_0x48d920=>_0x48d920[_0x3564be(0x138)]>0x0),_0x741424['length']===0x0&&(console[_0x3564be(0x125)](t(_0x3564be(0x118))),process[_0x3564be(0x12d)](0x1)),console[_0x3564be(0x11c)](_0x3564be(0x14f)+t('api.common.onlyGenerateDatasets',{'codes':_0x741424[_0x3564be(0x129)](',\x20')})+_0x3564be(0x136))),render(a6_0x1dd75e(ApiDocUI,{'appCode':_0x17b04b,'env':_0x355ff3,'output':_0x4f343f,'extraParams':_0x366dd3,'datasetCodes':_0x741424}));}else console[_0x3564be(0x125)](t(_0x3564be(0x144))+':\x20'+_0x1e41ed),console[_0x3564be(0x11c)](t('api.help.availableCommands')),console[_0x3564be(0x11c)](_0x3564be(0x13e)+t(_0x3564be(0x145))),console[_0x3564be(0x11c)](_0x3564be(0x14b)+t(_0x3564be(0x121))),console[_0x3564be(0x11c)](_0x3564be(0x14c)+t(_0x3564be(0x142))),console['log'](_0x3564be(0x126)+t(_0x3564be(0x122))),console[_0x3564be(0x11c)](''),console['log'](_0x3564be(0x163)+t(_0x3564be(0x156))),console[_0x3564be(0x11c)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20'+t('api.help.docAppcode')),console[_0x3564be(0x11c)](_0x3564be(0x11d)+t('api.help.docOutput')),console[_0x3564be(0x11c)](_0x3564be(0x134)+t(_0x3564be(0x155))),process[_0x3564be(0x12d)](0x1);}}
@@ -1 +1 @@
1
- const a8_0x3b6317=a8_0x57d8;(function(_0xa9e8e7,_0x2b55e7){const _0x5ddd54=a8_0x57d8,_0x9a4712=_0xa9e8e7();while(!![]){try{const _0x240496=parseInt(_0x5ddd54(0x14c))/0x1*(-parseInt(_0x5ddd54(0x14b))/0x2)+parseInt(_0x5ddd54(0x142))/0x3+-parseInt(_0x5ddd54(0x154))/0x4*(-parseInt(_0x5ddd54(0x159))/0x5)+-parseInt(_0x5ddd54(0x15f))/0x6+parseInt(_0x5ddd54(0x15e))/0x7*(-parseInt(_0x5ddd54(0x150))/0x8)+-parseInt(_0x5ddd54(0x15b))/0x9+-parseInt(_0x5ddd54(0x148))/0xa*(-parseInt(_0x5ddd54(0x14f))/0xb);if(_0x240496===_0x2b55e7)break;else _0x9a4712['push'](_0x9a4712['shift']());}catch(_0x419caa){_0x9a4712['push'](_0x9a4712['shift']());}}}(a8_0x3c53,0xb8465));function a8_0x3c53(){const _0x187419=['cwd','error','bind','91888rJqxMn','env','API\x20配置拉取异常:\x20','log','-api','260NPfega','trim','1213785MHbGxA','message','create-api-pull','7WKyvNX','7107636oYuDyI','api.silent.processing','-client','modelCount','2724267wskGKU','chdir','api.silent.clientFileName','api.silent.error','length','api.silent.generating','2440RYTYyM','api.silent.modelFileName','string','6mUyKYk','8812KejGPQ','client','info','41943qBBAOd','7458472rqgiJj'];a8_0x3c53=function(){return _0x187419;};return a8_0x3c53();}import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a8_0x57d8(_0x1e7a05,_0x135322){_0x1e7a05=_0x1e7a05-0x141;const _0x3c532d=a8_0x3c53();let _0x57d8b1=_0x3c532d[_0x1e7a05];return _0x57d8b1;}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';import a8_0x3b6a82 from'../i18n/index.js';const t=a8_0x3b6a82['t'][a8_0x3b6317(0x153)](a8_0x3b6a82);export async function pullApiSilent(_0x55d7f9,_0xb9bf72,_0xa58114,_0x4cd212){const _0xe07a81=a8_0x3b6317;let _0x7648d9;try{const _0x3432d5=_0xb9bf72?.[_0xe07a81(0x15a)]()||'';if(_0x3432d5){const _0x2de4d5=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x2de4d5['test'](_0x3432d5))return console[_0xe07a81(0x152)](t('api.silent.invalidPrefix')),![];}_0xa58114&&(_0x7648d9=process[_0xe07a81(0x151)](),process[_0xe07a81(0x143)](_0xa58114));const _0x2d8acf=readConfig(),_0x211bb4=typeof _0x2d8acf[_0xe07a81(0x155)]===_0xe07a81(0x14a)?_0x2d8acf['env']:undefined,_0x2bbdd8=_0x4cd212||_0x211bb4||'online';initEnv(_0x2bbdd8),console[_0xe07a81(0x157)](t('api.silent.fetching',{'env':_0x2bbdd8}));const {configArray:_0x1fa22c}=await fetchModelList(_0x55d7f9),_0x37e434=_0x3432d5?_0x3432d5+_0xe07a81(0x158):'api',_0x373dc9=_0x3432d5?_0x3432d5+_0xe07a81(0x161):_0xe07a81(0x14d);console[_0xe07a81(0x157)](t(_0xe07a81(0x147))),console[_0xe07a81(0x157)](t(_0xe07a81(0x149),{'name':_0x37e434})),console['log'](t(_0xe07a81(0x144),{'name':_0x373dc9})),console[_0xe07a81(0x157)](t(_0xe07a81(0x160),{'count':_0x1fa22c[_0xe07a81(0x146)]}));const _0x5d35c5=await generateApiFile(_0x1fa22c,_0x3432d5,_0x55d7f9,!![],_0x2bbdd8);return console[_0xe07a81(0x157)](t('api.silent.success',{'datasetCount':_0x1fa22c[_0xe07a81(0x146)],'modelCount':_0x5d35c5[_0xe07a81(0x141)]})),_0xa58114&&logger[_0xe07a81(0x14e)]('create-api-pull','API\x20配置拉取成功:\x20'+_0x55d7f9,{'projectPath':_0xa58114,'appCode':_0x55d7f9,'datasetCount':_0x1fa22c[_0xe07a81(0x146)],'filePrefix':_0x3432d5}),!![];}catch(_0x257f24){const _0x5cc6d2=_0x257f24 instanceof Error?_0x257f24[_0xe07a81(0x15c)]:String(_0x257f24);return console[_0xe07a81(0x152)](t(_0xe07a81(0x145),{'error':_0x5cc6d2})),_0xa58114&&logger[_0xe07a81(0x152)](_0xe07a81(0x15d),_0xe07a81(0x156)+_0x5cc6d2,{'appCode':_0x55d7f9,'projectPath':_0xa58114}),![];}finally{_0x7648d9&&process[_0xe07a81(0x143)](_0x7648d9);}}
1
+ const a7_0x466708=a7_0x18cf;(function(_0x54e190,_0x3aef1d){const _0x92db04=a7_0x18cf,_0x1cffcd=_0x54e190();while(!![]){try{const _0x1ba05e=-parseInt(_0x92db04(0xfe))/0x1+-parseInt(_0x92db04(0x100))/0x2*(-parseInt(_0x92db04(0xf0))/0x3)+parseInt(_0x92db04(0xf4))/0x4+parseInt(_0x92db04(0xe4))/0x5+-parseInt(_0x92db04(0xed))/0x6*(-parseInt(_0x92db04(0xfa))/0x7)+parseInt(_0x92db04(0xe2))/0x8*(-parseInt(_0x92db04(0xf7))/0x9)+parseInt(_0x92db04(0x101))/0xa*(-parseInt(_0x92db04(0xf3))/0xb);if(_0x1ba05e===_0x3aef1d)break;else _0x1cffcd['push'](_0x1cffcd['shift']());}catch(_0xec3da0){_0x1cffcd['push'](_0x1cffcd['shift']());}}}(a7_0x458a,0xcf229));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a7_0x458a(){const _0x4ef307=['error','string','-client','trim','-api','bind','env','api.silent.success','4098QzKnre','client','create-api-pull','1611SQcVwR','length','api.silent.processing','11BGDhcu','3567524KtWkSd','chdir','api.silent.modelFileName','2259swshPB','api.silent.generating','production','10717rnxSys','API\x20配置拉取成功:\x20','api','test','1124182kGaVpC','api.silent.clientFileName','978Kzdtvn','16625930camrAX','log','3176gqynRd','modelCount','7673500RrTHHb'];a7_0x458a=function(){return _0x4ef307;};return a7_0x458a();}import{logger}from'../utils/logger.js';function a7_0x18cf(_0x16be1e,_0x23bc4e){_0x16be1e=_0x16be1e-0xe1;const _0x458a30=a7_0x458a();let _0x18cfc1=_0x458a30[_0x16be1e];return _0x18cfc1;}import{fetchModelList}from'./fetch-model-list.js';import a7_0xd783d3 from'../i18n/index.js';const t=a7_0xd783d3['t'][a7_0x466708(0xea)](a7_0xd783d3);export async function pullApiSilent(_0x30d49b,_0x2d8ec5,_0x561b8b,_0x962bb4){const _0x15ac5c=a7_0x466708;let _0x4c7dec;try{const _0x479603=_0x2d8ec5?.[_0x15ac5c(0xe8)]()||'';if(_0x479603){const _0x561f9f=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x561f9f[_0x15ac5c(0xfd)](_0x479603))return console[_0x15ac5c(0xe5)](t('api.silent.invalidPrefix')),![];}_0x561b8b&&(_0x4c7dec=process['cwd'](),process[_0x15ac5c(0xf5)](_0x561b8b));const _0x211687=readConfig(),_0x1fc5c0=typeof _0x211687['env']===_0x15ac5c(0xe6)?_0x211687[_0x15ac5c(0xeb)]:undefined,_0x31e042=_0x962bb4||_0x1fc5c0||_0x15ac5c(0xf9);initEnv(_0x31e042),console[_0x15ac5c(0xe1)](t('api.silent.fetching',{'env':_0x31e042}));const {configArray:_0x28315b}=await fetchModelList(_0x30d49b),_0xe38827=_0x479603?_0x479603+_0x15ac5c(0xe9):_0x15ac5c(0xfc),_0x19950e=_0x479603?_0x479603+_0x15ac5c(0xe7):_0x15ac5c(0xee);console[_0x15ac5c(0xe1)](t(_0x15ac5c(0xf8))),console['log'](t(_0x15ac5c(0xf6),{'name':_0xe38827})),console[_0x15ac5c(0xe1)](t(_0x15ac5c(0xff),{'name':_0x19950e})),console['log'](t(_0x15ac5c(0xf2),{'count':_0x28315b['length']}));const _0x51f909=await generateApiFile(_0x28315b,_0x479603,_0x30d49b,!![],_0x31e042);return console[_0x15ac5c(0xe1)](t(_0x15ac5c(0xec),{'datasetCount':_0x28315b[_0x15ac5c(0xf1)],'modelCount':_0x51f909[_0x15ac5c(0xe3)]})),_0x561b8b&&logger['info'](_0x15ac5c(0xef),_0x15ac5c(0xfb)+_0x30d49b,{'projectPath':_0x561b8b,'appCode':_0x30d49b,'datasetCount':_0x28315b[_0x15ac5c(0xf1)],'filePrefix':_0x479603}),!![];}catch(_0x4bec81){const _0x4f05c9=_0x4bec81 instanceof Error?_0x4bec81['message']:String(_0x4bec81);return console[_0x15ac5c(0xe5)](t('api.silent.error',{'error':_0x4f05c9})),_0x561b8b&&logger['error'](_0x15ac5c(0xef),'API\x20配置拉取异常:\x20'+_0x4f05c9,{'appCode':_0x30d49b,'projectPath':_0x561b8b}),![];}finally{_0x4c7dec&&process[_0x15ac5c(0xf5)](_0x4c7dec);}}
@@ -1 +1 @@
1
- (function(_0x29569a,_0x26f2d2){const _0x21e23f=a9_0x2748,_0x355236=_0x29569a();while(!![]){try{const _0x17340d=parseInt(_0x21e23f(0xcc))/0x1+-parseInt(_0x21e23f(0xd0))/0x2*(parseInt(_0x21e23f(0xa3))/0x3)+-parseInt(_0x21e23f(0xa6))/0x4*(-parseInt(_0x21e23f(0xd2))/0x5)+parseInt(_0x21e23f(0xce))/0x6+parseInt(_0x21e23f(0xd4))/0x7+parseInt(_0x21e23f(0xd1))/0x8*(-parseInt(_0x21e23f(0xc4))/0x9)+-parseInt(_0x21e23f(0xe8))/0xa;if(_0x17340d===_0x26f2d2)break;else _0x355236['push'](_0x355236['shift']());}catch(_0xff78c3){_0x355236['push'](_0x355236['shift']());}}}(a9_0x4a46,0x71588));import{jsx as a9_0x321245,jsxs as a9_0x1cae30,Fragment as a9_0x4ff900}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a9_0x13f304 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';function a9_0x4a46(){const _0x2d3ed7=['appMenu.sync.step.creating','delete','dots','test','gray','column','return','appMenu.sync.loading.fetchingMenuList','online','backspace','includes','red','appMenu.sync.table.lovrabetPlatform','appMenu.sync.error.noLocalPages','appMenu.sync.input.jsUrl.label','appMenu.sync.operation.create','repeat','upArrow','appMenu.sync.input.jsUrl.placeholder','appMenu.sync.input.cssUrl.placeholder','length','slice','trim','appMenu.sync.step.jsUrl','message','9wwpqZp','[✓]','appMenu.sync.step.cssUrl','appMenu.sync.table.local','has','filter','appMenu.sync.error.authHint.prefix','creating','621334TenKBh','blue','421218whcmfs','path','14LCOLaL','2850008xiYEbT','91600brjjvQ','appMenu.sync.error.invalidCssUrl','5876115uRCwbJ','appMenu.sync.error.cssUrlUnreachable','appMenu.sync.error.createMenuFailed','label','appMenu.sync.operation.update','appMenu.sync.step.completed','[\x20]','catch','appMenu.sync.table.menuName','map','green','add','white','size','appMenu.sync.error.authHint.suffix','value','appMenu.sync.input.cssUrl.label','join','appMenu.sync.title','fill','12177250JruwZg','input-js','input-css','done','appMenu.sync.error.invalidJsUrl','selecting','25998tvRRYk','cyan','\x20←\x20','124WlOBDF','appMenu.sync.step.selectedMenusCount','max','appMenu.sync.error.jsUrlUnreachable','appMenu.sync.hotkeys'];a9_0x4a46=function(){return _0x2d3ed7;};return a9_0x4a46();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import{useI18n}from'../i18n/hooks.js';import.meta.main&&render(a9_0x321245(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x5886a0=a9_0x2748,{exit:_0x2e1200}=useApp(),{t:_0x429c93}=useI18n(),{loading:_0x40027e,menuList:_0x575a65,error:_0x21cb34}=useGetOnlineMenuList(),_0x49c52b=getLocalPages(),_0x130192=_0x575a65['map'](_0x572b5f=>_0x572b5f[_0x5886a0(0xcf)]),_0xe41fdf=_0x429c93(_0x5886a0(0xdc)),_0x2b8765=[_0xe41fdf,..._0x49c52b[_0x5886a0(0xdd)](_0x5794c8=>_0x5794c8['label'])],_0x5891ce=getStringWidth(getMaxWidth(_0x2b8765,0x4)),_0x3adfbf=getStringWidth(getMaxWidth([_0xe41fdf])),[_0xf67d25,_0x114cd1]=useState(_0x5886a0(0xa2)),[_0x17e92c,_0x1817a4]=useState(new Set()),[_0x28ae5c,_0x128120]=useState(0x0),[_0xeb717,_0x5bb623]=useState(''),[_0x35e591,_0x3fc806]=useState(''),[_0x30aefe,_0x51ad5a]=useState(''),[_0x25b4a9,_0x5a0bf8]=useState(''),[_0x16d2dc,_0x3ccc97]=useState([]),_0x2a3286=_0x49c52b[_0x5886a0(0xdd)](_0x17f816=>({'label':_0x17f816['label'],'path':_0x17f816['path'],'local':!![],'online':_0x130192[_0x5886a0(0xb5)](_0x17f816[_0x5886a0(0xcf)])})),_0x5188e0=_0x49c52b[_0x5886a0(0xc9)](_0x3bd73d=>{const _0x2d6d1d=_0x5886a0;return!_0x130192[_0x2d6d1d(0xb5)](_0x3bd73d[_0x2d6d1d(0xcf)]);});useEffect(()=>{const _0x51e15a=_0x5886a0;if(!_0x40027e&&_0x49c52b[_0x51e15a(0xbf)]>0x0&&_0x17e92c[_0x51e15a(0xe1)]===0x0){const _0x5f2a85=new Set(_0x49c52b['map']((_0x2947db,_0x3496e3)=>({'page':_0x2947db,'index':_0x3496e3}))[_0x51e15a(0xc9)](({page:_0x2b7553})=>!_0x130192[_0x51e15a(0xb5)](_0x2b7553[_0x51e15a(0xcf)]))[_0x51e15a(0xdd)](({index:_0x173c93})=>_0x173c93));_0x1817a4(_0x5f2a85);}},[_0x40027e,_0x49c52b['length'],_0x130192[_0x5886a0(0xbf)]]),useInput(async(_0x88986b,_0x286189)=>{const _0x1d87cf=_0x5886a0;if(_0xf67d25===_0x1d87cf(0xa2)){if(_0x286189[_0x1d87cf(0xbc)]){_0x128120(_0x57b93d=>_0x57b93d>0x0?_0x57b93d-0x1:_0x49c52b['length']-0x1);return;}if(_0x286189['downArrow']){_0x128120(_0x487e24=>_0x487e24<_0x49c52b[_0x1d87cf(0xbf)]-0x1?_0x487e24+0x1:0x0);return;}if(_0x88986b==='\x20'){_0x1817a4(_0x5a282f=>{const _0x52da9e=_0x1d87cf,_0xf217e=new Set(_0x5a282f);return _0xf217e[_0x52da9e(0xc8)](_0x28ae5c)?_0xf217e[_0x52da9e(0xac)](_0x28ae5c):_0xf217e[_0x52da9e(0xdf)](_0x28ae5c),_0xf217e;});return;}if(_0x88986b==='a'||_0x88986b==='A'){const _0x1e534d=new Set(_0x49c52b[_0x1d87cf(0xdd)]((_0x1e793b,_0x83e89a)=>_0x83e89a));_0x1817a4(_0x1e534d);return;}if(_0x88986b==='i'||_0x88986b==='I'||_0x88986b==='r'||_0x88986b==='R'){_0x1817a4(_0x3e083c=>{const _0x3e0fac=_0x1d87cf,_0x114514=new Set();for(let _0x24da92=0x0;_0x24da92<_0x49c52b[_0x3e0fac(0xbf)];_0x24da92++){!_0x3e083c[_0x3e0fac(0xc8)](_0x24da92)&&_0x114514[_0x3e0fac(0xdf)](_0x24da92);}return _0x114514;});return;}if(_0x88986b==='q'||_0x88986b==='Q'){_0x2e1200();return;}if(_0x286189[_0x1d87cf(0xb1)]){if(_0x17e92c[_0x1d87cf(0xe1)]===0x0){_0x5a0bf8(_0x429c93('appMenu.sync.error.noMenuSelected'));return;}const _0x2604ab=_0x49c52b[_0x1d87cf(0xc9)]((_0x27339d,_0x4b41a0)=>_0x17e92c[_0x1d87cf(0xc8)](_0x4b41a0)),_0x2fbf09=_0x2604ab['map'](_0x5dcf8a=>_0x5dcf8a['label'])[_0x1d87cf(0xe5)](',\x20');_0x3ccc97([{'label':_0x429c93('appMenu.sync.step.selectedMenus'),'value':_0x429c93(_0x1d87cf(0xa7),{'count':_0x17e92c[_0x1d87cf(0xe1)]})}]),_0x5a0bf8(''),_0x114cd1(_0x1d87cf(0xe9));return;}return;}if(_0xf67d25===_0x1d87cf(0xe9)){if(_0x286189['return']){const _0x31c31e=_0x30aefe[_0x1d87cf(0xc1)]();if(_0x31c31e==='')return;if(!isValidJsHttpsUrl(_0x31c31e)){_0x5a0bf8(_0x429c93(_0x1d87cf(0xa1)));return;}if(!await isUrlReachable(_0x31c31e)){_0x5a0bf8(_0x429c93(_0x1d87cf(0xa9)));return;}_0x5bb623(_0x31c31e),_0x3ccc97(_0x3cc967=>[..._0x3cc967,{'label':_0x429c93(_0x1d87cf(0xc2)),'value':_0x31c31e}]),_0x51ad5a(''),_0x5a0bf8(''),_0x114cd1(_0x1d87cf(0xea));return;}if(_0x286189[_0x1d87cf(0xb4)]||_0x286189['delete']){_0x51ad5a(_0x148af5=>_0x148af5[_0x1d87cf(0xc0)](0x0,-0x1)),_0x5a0bf8('');return;}_0x51ad5a(_0xdec1cb=>_0xdec1cb+_0x88986b);return;}if(_0xf67d25==='input-css'){if(_0x286189[_0x1d87cf(0xb1)]){const _0x10970a=_0x30aefe[_0x1d87cf(0xc1)]();if(_0x10970a==='')return;if(!isValidCssHttpsUrl(_0x10970a)){_0x5a0bf8(_0x429c93(_0x1d87cf(0xd3)));return;}if(!await isUrlReachable(_0x10970a)){_0x5a0bf8(_0x429c93(_0x1d87cf(0xd5)));return;}_0x3fc806(_0x10970a),_0x3ccc97(_0x3bb396=>[..._0x3bb396,{'label':_0x429c93(_0x1d87cf(0xc6)),'value':_0x10970a}]),_0x51ad5a(''),_0x5a0bf8(''),_0x114cd1('creating');const _0x24c066=_0x49c52b['filter']((_0x52324a,_0x34a46e)=>_0x17e92c['has'](_0x34a46e));createMenus(_0x24c066,[_0xeb717,_0x10970a])['then'](()=>{const _0xd16719=_0x1d87cf;_0x114cd1(_0xd16719(0xa0)),setTimeout(()=>{_0x2e1200();},0x3e8);})[_0x1d87cf(0xdb)](_0xe28536=>{const _0x1e397d=_0x1d87cf;_0x5a0bf8(_0xe28536[_0x1e397d(0xc3)]||_0x429c93(_0x1e397d(0xd6))),_0x114cd1(_0x1e397d(0xa2));});return;}if(_0x286189[_0x1d87cf(0xb4)]||_0x286189[_0x1d87cf(0xac)]){_0x51ad5a(_0x2b76c5=>_0x2b76c5[_0x1d87cf(0xc0)](0x0,-0x1)),_0x5a0bf8('');return;}_0x51ad5a(_0x5563b3=>_0x5563b3+_0x88986b);return;}});if(_0x40027e)return a9_0x1cae30(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a9_0x321245(Text,{'children':'\x20\x20'}),a9_0x321245(a9_0x13f304,{'type':_0x5886a0(0xad)}),a9_0x321245(Text,{'children':_0x429c93(_0x5886a0(0xb2))})]});if(_0x21cb34)return a9_0x1cae30(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a9_0x1cae30(Text,{'color':_0x5886a0(0xb6),'children':['✗\x20',_0x21cb34]}),a9_0x1cae30(Box,{'marginTop':0x1,'children':[a9_0x321245(Text,{'color':'gray','children':_0x429c93(_0x5886a0(0xca))}),a9_0x321245(Text,{'color':_0x5886a0(0xa4),'children':'lovrabet\x20auth'}),a9_0x321245(Text,{'color':_0x5886a0(0xaf),'children':_0x429c93(_0x5886a0(0xe2))})]})]});if(_0x49c52b[_0x5886a0(0xbf)]===0x0)return a9_0x321245(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a9_0x321245(Text,{'color':'yellow','children':_0x429c93(_0x5886a0(0xb8))})});return a9_0x1cae30(Box,{'flexDirection':_0x5886a0(0xb0),'marginTop':0x1,'marginBottom':0x1,'children':[_0xf67d25===_0x5886a0(0xa2)&&a9_0x1cae30(a9_0x4ff900,{'children':[a9_0x1cae30(Box,{'children':[a9_0x1cae30(Text,{'bold':!![],'children':['\x20\x20',_0xe41fdf,getRemainingSpaces(_0x5891ce,_0xe41fdf)]}),a9_0x1cae30(Text,{'bold':!![],'children':[_0x429c93(_0x5886a0(0xc7)),getRemainingSpaces(_0x3adfbf,_0xe41fdf)]}),a9_0x1cae30(Text,{'bold':!![],'children':[_0x429c93(_0x5886a0(0xb7)),getRemainingSpaces(_0x3adfbf,_0xe41fdf)]})]}),_0x2a3286['map'](_0x354a12=>a9_0x1cae30(Box,{'children':[a9_0x1cae30(Text,{'children':['\x20\x20',_0x354a12[_0x5886a0(0xd7)],getRemainingSpaces(_0x5891ce,_0x354a12['label'])]}),a9_0x1cae30(Text,{'color':_0x5886a0(0xde),'children':[_0x354a12['local']?'✓':'✗',getRemainingSpaces(_0x3adfbf,'✓')]}),a9_0x1cae30(Text,{'color':_0x354a12[_0x5886a0(0xb3)]?_0x5886a0(0xde):'red','children':[_0x354a12[_0x5886a0(0xb3)]?'✓':'✗',getRemainingSpaces(_0x3adfbf,'✓')]})]},_0x354a12[_0x5886a0(0xcf)]))]}),_0xf67d25===_0x5886a0(0xa2)&&_0x16d2dc[_0x5886a0(0xbf)]===0x0&&a9_0x321245(Box,{'marginTop':0x1,'children':a9_0x321245(Text,{'color':_0x5886a0(0xa4),'children':_0x429c93(_0x5886a0(0xe6))})}),_0x16d2dc[_0x5886a0(0xdd)]((_0x52d199,_0x5c7790)=>a9_0x1cae30(Box,{'children':[a9_0x1cae30(Text,{'color':_0x5886a0(0xde),'children':['√\x20',_0x52d199[_0x5886a0(0xd7)],':\x20']}),a9_0x321245(Text,{'color':_0x5886a0(0xa4),'children':_0x52d199[_0x5886a0(0xe3)]})]},_0x5c7790)),_0x25b4a9&&_0xf67d25===_0x5886a0(0xa2)&&a9_0x321245(Box,{'marginTop':0x1,'children':a9_0x1cae30(Text,{'color':_0x5886a0(0xb6),'children':['✗\x20',_0x25b4a9]})}),_0xf67d25===_0x5886a0(0xa2)&&a9_0x321245(a9_0x4ff900,{'children':a9_0x1cae30(Box,{'marginTop':_0x16d2dc[_0x5886a0(0xbf)]>0x0||_0x25b4a9?0x1:0x0,'flexDirection':_0x5886a0(0xb0),'children':[a9_0x321245(Text,{'bold':!![],'children':_0x429c93('appMenu.sync.step.selectMenus')}),_0x49c52b[_0x5886a0(0xdd)]((_0x2ac015,_0x555a1e)=>{const _0x17eda8=_0x5886a0,_0x4683ef=_0x28ae5c===_0x555a1e,_0x29fcb2=_0x17e92c['has'](_0x555a1e),_0x407076=_0x130192['includes'](_0x2ac015[_0x17eda8(0xcf)]),_0x197c23=_0x407076?_0x429c93(_0x17eda8(0xd8)):_0x429c93(_0x17eda8(0xba));return a9_0x321245(Box,{'children':a9_0x1cae30(Text,{'backgroundColor':_0x4683ef?_0x17eda8(0xcd):undefined,'color':_0x4683ef?_0x17eda8(0xe0):undefined,'children':['\x20\x20',_0x29fcb2?_0x17eda8(0xc5):_0x17eda8(0xda),'\x20',_0x2ac015[_0x17eda8(0xd7)]]})},_0x2ac015[_0x17eda8(0xcf)]);}),a9_0x321245(Box,{'marginTop':0x1,'children':a9_0x1cae30(Text,{'color':_0x5886a0(0xaf),'children':['\x20',_0x429c93(_0x5886a0(0xaa))]})})]})}),_0xf67d25===_0x5886a0(0xe9)&&a9_0x1cae30(a9_0x4ff900,{'children':[a9_0x1cae30(Box,{'children':[a9_0x321245(Text,{'children':_0x429c93(_0x5886a0(0xb9))}),a9_0x321245(Text,{'color':_0x5886a0(0xde),'children':_0x30aefe}),_0x25b4a9&&a9_0x1cae30(Text,{'color':_0x5886a0(0xb6),'children':[_0x5886a0(0xa5),_0x25b4a9]})]}),!_0x25b4a9&&a9_0x321245(Box,{'children':a9_0x321245(Text,{'color':'gray','children':_0x429c93(_0x5886a0(0xbd))})})]}),_0xf67d25===_0x5886a0(0xea)&&a9_0x1cae30(a9_0x4ff900,{'children':[a9_0x1cae30(Box,{'children':[a9_0x321245(Text,{'children':_0x429c93(_0x5886a0(0xe4))}),a9_0x321245(Text,{'color':_0x5886a0(0xde),'children':_0x30aefe}),_0x25b4a9&&a9_0x1cae30(Text,{'color':_0x5886a0(0xb6),'children':[_0x5886a0(0xa5),_0x25b4a9]})]}),!_0x25b4a9&&a9_0x321245(Box,{'children':a9_0x321245(Text,{'color':'gray','children':_0x429c93(_0x5886a0(0xbe))})})]}),_0xf67d25===_0x5886a0(0xcb)&&a9_0x321245(Box,{'children':a9_0x321245(Text,{'children':_0x429c93(_0x5886a0(0xab))})}),_0xf67d25==='done'&&a9_0x321245(Box,{'children':a9_0x321245(Text,{'color':'green','children':_0x429c93(_0x5886a0(0xd9))})})]});}function getStringWidth(_0x1fd551){const _0x48003b=a9_0x2748;let _0x861b89=0x0;for(const _0x2b0fe0 of _0x1fd551){/[\u4e00-\u9fa5]/[_0x48003b(0xae)](_0x2b0fe0)?_0x861b89+=0x2:_0x861b89+=0x1;}return _0x861b89;}function getRemainingSpaces(_0x49fa89,_0x1c8b7e){const _0x1fbbc8=a9_0x2748,_0x18c703=getStringWidth(_0x1c8b7e);return Array(Math[_0x1fbbc8(0xa8)](0x0,_0x49fa89-_0x18c703))[_0x1fbbc8(0xe7)]('\x20')[_0x1fbbc8(0xe5)]('');}function a9_0x2748(_0x54d9fd,_0x9916af){_0x54d9fd=_0x54d9fd-0xa0;const _0x4a46d8=a9_0x4a46();let _0x2748d4=_0x4a46d8[_0x54d9fd];return _0x2748d4;}function getMaxWidth(_0xb6bf2b,_0x128786=0x2){const _0x132436=a9_0x2748;let _0x2fb6e0='',_0x3ba82c=0x0;for(const _0x1a959b of _0xb6bf2b){const _0x2a1047=getStringWidth(_0x1a959b);_0x2a1047>_0x3ba82c&&(_0x3ba82c=_0x2a1047,_0x2fb6e0=_0x1a959b);}return _0x2fb6e0+'\x20'[_0x132436(0xbb)](_0x128786);}
1
+ (function(_0x55b0a3,_0x905df0){const _0x37a154=a8_0x2113,_0x3cfaf9=_0x55b0a3();while(!![]){try{const _0x3e8869=parseInt(_0x37a154(0x22c))/0x1*(parseInt(_0x37a154(0x208))/0x2)+parseInt(_0x37a154(0x211))/0x3+parseInt(_0x37a154(0x221))/0x4*(parseInt(_0x37a154(0x1fb))/0x5)+-parseInt(_0x37a154(0x21a))/0x6+-parseInt(_0x37a154(0x212))/0x7+-parseInt(_0x37a154(0x1f9))/0x8*(parseInt(_0x37a154(0x206))/0x9)+parseInt(_0x37a154(0x1f4))/0xa;if(_0x3e8869===_0x905df0)break;else _0x3cfaf9['push'](_0x3cfaf9['shift']());}catch(_0x3ac7d2){_0x3cfaf9['push'](_0x3cfaf9['shift']());}}}(a8_0x5cbf,0x5b2be));function a8_0x2113(_0xecdac8,_0x58557e){_0xecdac8=_0xecdac8-0x1ea;const _0x5cbf36=a8_0x5cbf();let _0x21139d=_0x5cbf36[_0xecdac8];return _0x21139d;}import{jsx as a8_0x315876,jsxs as a8_0x5dd3d0,Fragment as a8_0x1ccac3}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a8_0x288602 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import{useI18n}from'../i18n/hooks.js';import{updateMenu}from'../app-menu-update-cdn/update-menu.js';import.meta.main&&render(a8_0x315876(AppMenuSyncUI,{}));function a8_0x5cbf(){const _0x45557d=['map','cyan','appMenu.sync.step.creating','appMenu.sync.title','all','appMenu.sync.error.cssUrlUnreachable','1604ByRMnX','appMenu.sync.error.createMenuFailed','has','selecting','appMenu.sync.step.selectedMenusCount','column','green','filter','appMenu.sync.step.completed','path','yellow','14303IdCkPy','appMenu.sync.operation.create','creating','appMenu.sync.table.lovrabetPlatform','then','online','repeat','slice','appMenu.sync.error.noMenuSelected','appMenu.sync.error.noLocalPages','appMenu.sync.error.invalidJsUrl','gray','appMenu.sync.operation.update','includes','local','trim','12963310EtyXen','appMenu.sync.table.menuName','appMenu.sync.input.cssUrl.placeholder','done','add','16QAmoca','input-js','3665oLFJpA','max','[✓]','appMenu.sync.step.selectMenus','appMenu.sync.error.jsUrlUnreachable','message','push','appMenu.sync.input.cssUrl.label','fill','appMenu.sync.error.authHint.prefix','downArrow','1973241vRItli','size','46uQjQUh','red','backspace','delete','return','value','appMenu.sync.error.authHint.suffix','input-css','label','287010uBBnQd','4028871NPKbHX','appMenu.sync.input.jsUrl.placeholder','upArrow','\x20←\x20','appMenu.sync.error.invalidCssUrl','appMenu.sync.step.cssUrl','length','appMenu.sync.step.jsUrl','3764484Ezcpps'];a8_0x5cbf=function(){return _0x45557d;};return a8_0x5cbf();}export function AppMenuSyncUI(){const _0x2fff2c=a8_0x2113,{exit:_0x381ef7}=useApp(),{t:_0x140162}=useI18n(),{loading:_0x463817,menuList:_0x26356c,error:_0x201e38}=useGetOnlineMenuList(),_0x263a6e=getLocalPages(),_0x2fe6b0=_0x26356c[_0x2fff2c(0x21b)](_0x10b837=>_0x10b837['path']),_0x55d35c=_0x140162(_0x2fff2c(0x1f5)),_0xe77922=[_0x55d35c,..._0x263a6e[_0x2fff2c(0x21b)](_0x5dcd4a=>_0x5dcd4a[_0x2fff2c(0x210)])],_0xfb3b5a=getStringWidth(getMaxWidth(_0xe77922,0x4)),_0x2890b5=getStringWidth(getMaxWidth([_0x55d35c])),[_0x430786,_0x3ce57a]=useState('selecting'),[_0x3a0b01,_0x11c364]=useState(new Set()),[_0x5da29d,_0x74c59b]=useState(0x0),[_0x4279fa,_0x4d3bdd]=useState(''),[_0x11cf4d,_0x56cd0f]=useState(''),[_0x2bf186,_0x2a067a]=useState(''),[_0x375c63,_0x157740]=useState(''),[_0x5c2d90,_0x34b82a]=useState([]),_0x56a514=_0x263a6e[_0x2fff2c(0x21b)](_0x192f2d=>({'label':_0x192f2d[_0x2fff2c(0x210)],'path':_0x192f2d[_0x2fff2c(0x22a)],'local':!![],'online':_0x2fe6b0[_0x2fff2c(0x1f1)](_0x192f2d['path'])}));useEffect(()=>{const _0x504a43=_0x2fff2c;if(!_0x463817&&_0x263a6e['length']>0x0&&_0x3a0b01[_0x504a43(0x207)]===0x0){const _0x1dd78e=new Set(_0x263a6e['map']((_0x1f5797,_0x1ae152)=>({'page':_0x1f5797,'index':_0x1ae152}))[_0x504a43(0x228)](({page:_0xf8e4ac})=>!_0x2fe6b0[_0x504a43(0x1f1)](_0xf8e4ac['path']))[_0x504a43(0x21b)](({index:_0x493608})=>_0x493608));_0x11c364(_0x1dd78e);}},[_0x463817,_0x263a6e[_0x2fff2c(0x218)],_0x2fe6b0[_0x2fff2c(0x218)]]),useInput(async(_0x421cec,_0x924389)=>{const _0x314462=_0x2fff2c;if(_0x430786===_0x314462(0x224)){if(_0x924389[_0x314462(0x214)]){_0x74c59b(_0x1f9c2e=>_0x1f9c2e>0x0?_0x1f9c2e-0x1:_0x263a6e[_0x314462(0x218)]-0x1);return;}if(_0x924389[_0x314462(0x205)]){_0x74c59b(_0x3523a3=>_0x3523a3<_0x263a6e[_0x314462(0x218)]-0x1?_0x3523a3+0x1:0x0);return;}if(_0x421cec==='\x20'){_0x11c364(_0xd75410=>{const _0x9f1be9=_0x314462,_0x115f8c=new Set(_0xd75410);return _0x115f8c[_0x9f1be9(0x223)](_0x5da29d)?_0x115f8c['delete'](_0x5da29d):_0x115f8c[_0x9f1be9(0x1f8)](_0x5da29d),_0x115f8c;});return;}if(_0x421cec==='a'||_0x421cec==='A'){const _0x19f948=new Set(_0x263a6e[_0x314462(0x21b)]((_0x1468b4,_0x96d719)=>_0x96d719));_0x11c364(_0x19f948);return;}if(_0x421cec==='i'||_0x421cec==='I'||_0x421cec==='r'||_0x421cec==='R'){_0x11c364(_0x3feb70=>{const _0x431195=_0x314462,_0x3a4c8e=new Set();for(let _0x289e24=0x0;_0x289e24<_0x263a6e[_0x431195(0x218)];_0x289e24++){!_0x3feb70[_0x431195(0x223)](_0x289e24)&&_0x3a4c8e[_0x431195(0x1f8)](_0x289e24);}return _0x3a4c8e;});return;}if(_0x421cec==='q'||_0x421cec==='Q'){_0x381ef7();return;}if(_0x924389['return']){if(_0x3a0b01[_0x314462(0x207)]===0x0){_0x157740(_0x140162(_0x314462(0x1ec)));return;}const _0x5ed573=_0x263a6e[_0x314462(0x228)]((_0x4a8ecc,_0x4ebef2)=>_0x3a0b01[_0x314462(0x223)](_0x4ebef2)),_0x3583ef=_0x5ed573[_0x314462(0x21b)](_0x1ac363=>_0x1ac363[_0x314462(0x210)])['join'](',\x20');_0x34b82a([{'label':_0x140162('appMenu.sync.step.selectedMenus'),'value':_0x140162(_0x314462(0x225),{'count':_0x3a0b01['size']})}]),_0x157740(''),_0x3ce57a(_0x314462(0x1fa));return;}return;}if(_0x430786===_0x314462(0x1fa)){if(_0x924389[_0x314462(0x20c)]){const _0x9bef06=_0x2bf186[_0x314462(0x1f3)]();if(_0x9bef06==='')return;if(!isValidJsHttpsUrl(_0x9bef06)){_0x157740(_0x140162(_0x314462(0x1ee)));return;}if(!await isUrlReachable(_0x9bef06)){_0x157740(_0x140162(_0x314462(0x1ff)));return;}_0x4d3bdd(_0x9bef06),_0x34b82a(_0x2a61b9=>[..._0x2a61b9,{'label':_0x140162(_0x314462(0x219)),'value':_0x9bef06}]),_0x2a067a(''),_0x157740(''),_0x3ce57a(_0x314462(0x20f));return;}if(_0x924389[_0x314462(0x20a)]||_0x924389['delete']){_0x2a067a(_0x45925e=>_0x45925e[_0x314462(0x1eb)](0x0,-0x1)),_0x157740('');return;}_0x2a067a(_0x500c94=>_0x500c94+_0x421cec);return;}if(_0x430786==='input-css'){if(_0x924389[_0x314462(0x20c)]){const _0xc8bbfe=_0x2bf186['trim']();if(_0xc8bbfe==='')return;if(!isValidCssHttpsUrl(_0xc8bbfe)){_0x157740(_0x140162(_0x314462(0x216)));return;}if(!await isUrlReachable(_0xc8bbfe)){_0x157740(_0x140162(_0x314462(0x220)));return;}_0x56cd0f(_0xc8bbfe),_0x34b82a(_0x340896=>[..._0x340896,{'label':_0x140162(_0x314462(0x217)),'value':_0xc8bbfe}]),_0x2a067a(''),_0x157740(''),_0x3ce57a('creating');const _0x3ea3a1=_0x263a6e[_0x314462(0x228)]((_0x445353,_0x45ba79)=>_0x3a0b01[_0x314462(0x223)](_0x45ba79)),_0x294b2b=_0x3ea3a1[_0x314462(0x228)](_0x2e3f8b=>!_0x2fe6b0[_0x314462(0x1f1)](_0x2e3f8b[_0x314462(0x22a)])),_0x3c5fdc=_0x3ea3a1[_0x314462(0x228)](_0x2d3a8b=>_0x2fe6b0['includes'](_0x2d3a8b[_0x314462(0x22a)])),_0x36aa36=async()=>{const _0xda3f2d=_0x314462,_0x4e00c1=[];_0x294b2b[_0xda3f2d(0x218)]>0x0&&_0x4e00c1['push'](createMenus(_0x294b2b,[_0x4279fa,_0xc8bbfe]));for(const _0x1be945 of _0x3c5fdc){const _0x543fb6=_0x26356c['find'](_0x55ab43=>_0x55ab43[_0xda3f2d(0x22a)]===_0x1be945[_0xda3f2d(0x22a)]);_0x543fb6&&_0x1be945[_0xda3f2d(0x210)]!==_0x543fb6[_0xda3f2d(0x210)]&&_0x4e00c1[_0xda3f2d(0x201)](updateMenu({'id':_0x543fb6['id'],'label':_0x1be945[_0xda3f2d(0x210)],'resources':[_0x4279fa,_0xc8bbfe]}));}await Promise[_0xda3f2d(0x21f)](_0x4e00c1);};_0x36aa36()[_0x314462(0x230)](()=>{_0x3ce57a('done'),setTimeout(()=>{_0x381ef7();},0x3e8);})['catch'](_0x5ba6ed=>{const _0x1303f7=_0x314462;_0x157740(_0x5ba6ed[_0x1303f7(0x200)]||_0x140162(_0x1303f7(0x222))),_0x3ce57a(_0x1303f7(0x224));});return;}if(_0x924389['backspace']||_0x924389[_0x314462(0x20b)]){_0x2a067a(_0xfc44c3=>_0xfc44c3[_0x314462(0x1eb)](0x0,-0x1)),_0x157740('');return;}_0x2a067a(_0x4b9bdc=>_0x4b9bdc+_0x421cec);return;}});if(_0x463817)return a8_0x5dd3d0(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a8_0x315876(Text,{'children':'\x20\x20'}),a8_0x315876(a8_0x288602,{'type':'dots'}),a8_0x315876(Text,{'children':_0x140162('appMenu.sync.loading.fetchingMenuList')})]});if(_0x201e38)return a8_0x5dd3d0(Box,{'flexDirection':_0x2fff2c(0x226),'marginTop':0x1,'marginBottom':0x1,'children':[a8_0x5dd3d0(Text,{'color':'red','children':['✗\x20',_0x201e38]}),a8_0x5dd3d0(Box,{'marginTop':0x1,'children':[a8_0x315876(Text,{'color':_0x2fff2c(0x1ef),'children':_0x140162(_0x2fff2c(0x204))}),a8_0x315876(Text,{'color':_0x2fff2c(0x21c),'children':'lovrabet\x20auth'}),a8_0x315876(Text,{'color':_0x2fff2c(0x1ef),'children':_0x140162(_0x2fff2c(0x20e))})]})]});if(_0x263a6e[_0x2fff2c(0x218)]===0x0)return a8_0x315876(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a8_0x315876(Text,{'color':_0x2fff2c(0x22b),'children':_0x140162(_0x2fff2c(0x1ed))})});return a8_0x5dd3d0(Box,{'flexDirection':_0x2fff2c(0x226),'marginTop':0x1,'marginBottom':0x1,'children':[_0x430786===_0x2fff2c(0x224)&&a8_0x5dd3d0(a8_0x1ccac3,{'children':[a8_0x5dd3d0(Box,{'children':[a8_0x5dd3d0(Text,{'bold':!![],'children':['\x20\x20',_0x55d35c,getRemainingSpaces(_0xfb3b5a,_0x55d35c)]}),a8_0x5dd3d0(Text,{'bold':!![],'children':[_0x140162('appMenu.sync.table.local'),getRemainingSpaces(_0x2890b5,_0x55d35c)]}),a8_0x5dd3d0(Text,{'bold':!![],'children':[_0x140162(_0x2fff2c(0x22f)),getRemainingSpaces(_0x2890b5,_0x55d35c)]})]}),_0x56a514[_0x2fff2c(0x21b)](_0x3b9e63=>a8_0x5dd3d0(Box,{'children':[a8_0x5dd3d0(Text,{'children':['\x20\x20',_0x3b9e63[_0x2fff2c(0x210)],getRemainingSpaces(_0xfb3b5a,_0x3b9e63[_0x2fff2c(0x210)])]}),a8_0x5dd3d0(Text,{'color':_0x2fff2c(0x227),'children':[_0x3b9e63[_0x2fff2c(0x1f2)]?'✓':'✗',getRemainingSpaces(_0x2890b5,'✓')]}),a8_0x5dd3d0(Text,{'color':_0x3b9e63[_0x2fff2c(0x231)]?_0x2fff2c(0x227):_0x2fff2c(0x209),'children':[_0x3b9e63[_0x2fff2c(0x231)]?'✓':'✗',getRemainingSpaces(_0x2890b5,'✓')]})]},_0x3b9e63[_0x2fff2c(0x22a)]))]}),_0x430786==='selecting'&&_0x5c2d90['length']===0x0&&a8_0x315876(Box,{'marginTop':0x1,'children':a8_0x315876(Text,{'color':_0x2fff2c(0x21c),'children':_0x140162(_0x2fff2c(0x21e))})}),_0x5c2d90['map']((_0x1aedc5,_0x3ed3db)=>a8_0x5dd3d0(Box,{'children':[a8_0x5dd3d0(Text,{'color':_0x2fff2c(0x227),'children':['√\x20',_0x1aedc5[_0x2fff2c(0x210)],':\x20']}),a8_0x315876(Text,{'color':_0x2fff2c(0x21c),'children':_0x1aedc5[_0x2fff2c(0x20d)]})]},_0x3ed3db)),_0x375c63&&_0x430786===_0x2fff2c(0x224)&&a8_0x315876(Box,{'marginTop':0x1,'children':a8_0x5dd3d0(Text,{'color':_0x2fff2c(0x209),'children':['✗\x20',_0x375c63]})}),_0x430786===_0x2fff2c(0x224)&&a8_0x315876(a8_0x1ccac3,{'children':a8_0x5dd3d0(Box,{'marginTop':_0x5c2d90[_0x2fff2c(0x218)]>0x0||_0x375c63?0x1:0x0,'flexDirection':'column','children':[a8_0x315876(Text,{'bold':!![],'children':_0x140162(_0x2fff2c(0x1fe))}),_0x263a6e['map']((_0x329230,_0xb74e6c)=>{const _0x469013=_0x2fff2c,_0x3e33fb=_0x5da29d===_0xb74e6c,_0x163d44=_0x3a0b01['has'](_0xb74e6c),_0x248a8f=_0x2fe6b0[_0x469013(0x1f1)](_0x329230[_0x469013(0x22a)]),_0x1d3509=_0x248a8f?_0x140162(_0x469013(0x1f0)):_0x140162(_0x469013(0x22d));return a8_0x315876(Box,{'children':a8_0x5dd3d0(Text,{'backgroundColor':_0x3e33fb?'blue':undefined,'color':_0x3e33fb?'white':undefined,'children':['\x20\x20',_0x163d44?_0x469013(0x1fd):'[\x20]','\x20',_0x329230[_0x469013(0x210)]]})},_0x329230['path']);}),a8_0x315876(Box,{'marginTop':0x1,'children':a8_0x5dd3d0(Text,{'color':_0x2fff2c(0x1ef),'children':['\x20',_0x140162('appMenu.sync.hotkeys')]})})]})}),_0x430786==='input-js'&&a8_0x5dd3d0(a8_0x1ccac3,{'children':[a8_0x5dd3d0(Box,{'children':[a8_0x315876(Text,{'children':_0x140162('appMenu.sync.input.jsUrl.label')}),a8_0x315876(Text,{'color':_0x2fff2c(0x227),'children':_0x2bf186}),_0x375c63&&a8_0x5dd3d0(Text,{'color':'red','children':[_0x2fff2c(0x215),_0x375c63]})]}),!_0x375c63&&a8_0x315876(Box,{'children':a8_0x315876(Text,{'color':'gray','children':_0x140162(_0x2fff2c(0x213))})})]}),_0x430786===_0x2fff2c(0x20f)&&a8_0x5dd3d0(a8_0x1ccac3,{'children':[a8_0x5dd3d0(Box,{'children':[a8_0x315876(Text,{'children':_0x140162(_0x2fff2c(0x202))}),a8_0x315876(Text,{'color':_0x2fff2c(0x227),'children':_0x2bf186}),_0x375c63&&a8_0x5dd3d0(Text,{'color':_0x2fff2c(0x209),'children':['\x20←\x20',_0x375c63]})]}),!_0x375c63&&a8_0x315876(Box,{'children':a8_0x315876(Text,{'color':_0x2fff2c(0x1ef),'children':_0x140162(_0x2fff2c(0x1f6))})})]}),_0x430786===_0x2fff2c(0x22e)&&a8_0x315876(Box,{'children':a8_0x315876(Text,{'children':_0x140162(_0x2fff2c(0x21d))})}),_0x430786===_0x2fff2c(0x1f7)&&a8_0x315876(Box,{'children':a8_0x315876(Text,{'color':_0x2fff2c(0x227),'children':_0x140162(_0x2fff2c(0x229))})})]});}function getStringWidth(_0x3f6e53){let _0x5c4092=0x0;for(const _0x577bb5 of _0x3f6e53){/[\u4e00-\u9fa5]/['test'](_0x577bb5)?_0x5c4092+=0x2:_0x5c4092+=0x1;}return _0x5c4092;}function getRemainingSpaces(_0x1501b4,_0x569e89){const _0x13552b=a8_0x2113,_0x26c2b8=getStringWidth(_0x569e89);return Array(Math[_0x13552b(0x1fc)](0x0,_0x1501b4-_0x26c2b8))[_0x13552b(0x203)]('\x20')['join']('');}function getMaxWidth(_0x2fef31,_0x3a14d4=0x2){const _0x4aaad=a8_0x2113;let _0x4e8feb='',_0x4d84e8=0x0;for(const _0x4cbdcd of _0x2fef31){const _0x1dd386=getStringWidth(_0x4cbdcd);_0x1dd386>_0x4d84e8&&(_0x4d84e8=_0x1dd386,_0x4e8feb=_0x4cbdcd);}return _0x4e8feb+'\x20'[_0x4aaad(0x1ea)](_0x3a14d4);}
@@ -1 +1 @@
1
- const a10_0x52c204=a10_0x1422;(function(_0x4e0e3a,_0x42e928){const _0x3354f5=a10_0x1422,_0x4dfac2=_0x4e0e3a();while(!![]){try{const _0x10bb64=parseInt(_0x3354f5(0xdd))/0x1+parseInt(_0x3354f5(0xd5))/0x2+-parseInt(_0x3354f5(0xfc))/0x3*(parseInt(_0x3354f5(0xf5))/0x4)+-parseInt(_0x3354f5(0xf3))/0x5*(-parseInt(_0x3354f5(0xdb))/0x6)+-parseInt(_0x3354f5(0xd8))/0x7*(parseInt(_0x3354f5(0xf4))/0x8)+parseInt(_0x3354f5(0xfe))/0x9*(-parseInt(_0x3354f5(0xea))/0xa)+parseInt(_0x3354f5(0xe4))/0xb;if(_0x10bb64===_0x42e928)break;else _0x4dfac2['push'](_0x4dfac2['shift']());}catch(_0x373c15){_0x4dfac2['push'](_0x4dfac2['shift']());}}}(a10_0x839e,0x1bad3));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import a10_0x64eba2 from'../i18n/index.js';const config=readConfig(),t=a10_0x64eba2['t'][a10_0x52c204(0xe0)](a10_0x64eba2);export async function createMenu(_0x5e1662){const _0x3c0b94=a10_0x52c204,_0x420cf4=config?.[_0x3c0b94(0xd3)];if(!_0x420cf4){const _0x54300f=t(_0x3c0b94(0xe8));logger[_0x3c0b94(0xe1)](_0x3c0b94(0xf0),_0x54300f),console[_0x3c0b94(0xe1)]('×\x20'+_0x54300f),console[_0x3c0b94(0xfd)](t(_0x3c0b94(0xee))),console[_0x3c0b94(0xfd)](t(_0x3c0b94(0xe2))),console[_0x3c0b94(0xfd)](t(_0x3c0b94(0xfa)));return;}logger['info']('create-menu',t('appMenu.creating.single',{'label':_0x5e1662[_0x3c0b94(0xed)],'path':_0x5e1662[_0x3c0b94(0xfb)]}));const _0x3ca935={'appCode':_0x420cf4,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x3c0b94(0xde),'resources':_0x5e1662[_0x3c0b94(0xf7)]?JSON[_0x3c0b94(0xd9)](_0x5e1662[_0x3c0b94(0xf7)]):undefined},..._0x5e1662},_0x372f32=await fetch(getApiDomain()+_0x3c0b94(0xda),{'method':'POST','body':JSON[_0x3c0b94(0xd9)](_0x3ca935),'headers':{'Content-Type':_0x3c0b94(0xe7),'Cookie':getCookie()}});if(!_0x372f32['ok']){if(_0x372f32['status']===0x191){const _0x1ed793=t(_0x3c0b94(0xd2));logger['error'](_0x3c0b94(0xf0),_0x1ed793,{'status':_0x372f32[_0x3c0b94(0xd1)],'menu':_0x5e1662[_0x3c0b94(0xed)]});throw new Error(_0x1ed793);}const _0x5a08e6=t(_0x3c0b94(0xd6),{'status':_0x372f32['status']});logger[_0x3c0b94(0xe1)](_0x3c0b94(0xf0),_0x5a08e6,{'menu':_0x5e1662[_0x3c0b94(0xed)]});throw new Error(_0x5a08e6);}const _0x4f9c0a=await _0x372f32[_0x3c0b94(0xf6)]();if(!_0x4f9c0a[_0x3c0b94(0xe3)]){const _0x457948=t(_0x3c0b94(0xd7),{'error':_0x4f9c0a[_0x3c0b94(0xeb)]||t(_0x3c0b94(0xd4))});logger[_0x3c0b94(0xe1)]('create-menu',_0x457948,{'errorCode':_0x4f9c0a[_0x3c0b94(0xdc)],'errorMsg':_0x4f9c0a[_0x3c0b94(0xeb)],'menu':_0x5e1662[_0x3c0b94(0xed)]});throw new Error(_0x457948);}logger[_0x3c0b94(0xe9)](_0x3c0b94(0xf0),''+t(_0x3c0b94(0xf9))+_0x5e1662[_0x3c0b94(0xed)],_0x4f9c0a[_0x3c0b94(0xf8)]),console[_0x3c0b94(0xfd)](t(_0x3c0b94(0xf9)),_0x4f9c0a[_0x3c0b94(0xf8)]);}function a10_0x1422(_0x3fabc4,_0x54bc9c){_0x3fabc4=_0x3fabc4-0xd0;const _0x839ebe=a10_0x839e();let _0x14225e=_0x839ebe[_0x3fabc4];return _0x14225e;}function a10_0x839e(){const _0x10c785=['597822NjMLXL','log','34227txPXns','length','status','appMenu.error.authExpired','appcode','common.error','362174gEctHY','appMenu.error.createHttpStatus','appMenu.error.createFailed','7GBYJlE','stringify','/smartapi/menu/create','6JZgnWK','errorCode','56394RcWXYk','import','appMenu.error.authValidationFailed','bind','error','appMenu.error.appCodeHint.option1','success','586355uGvmOJ','0011','map','application/json','appMenu.error.missingAppCode','info','150wvbhjT','errorMsg','all','label','appMenu.error.appCodeHint.title','includes','create-menu','appMenu.creating.batch.start','POST','1068055TuOgAw','1077720nanokX','4xIefqv','json','resources','data','appMenu.success.created','appMenu.error.appCodeHint.option2','path'];a10_0x839e=function(){return _0x10c785;};return a10_0x839e();}async function _createMenu(_0x4ea4bf,_0x1f0c74){const _0x40e4b7=a10_0x52c204,_0x2cbd11=config?.[_0x40e4b7(0xd3)];if(!_0x2cbd11){const _0x3516f1=t(_0x40e4b7(0xe8));logger[_0x40e4b7(0xe1)](_0x40e4b7(0xf0),_0x3516f1),console[_0x40e4b7(0xe1)]('×\x20'+_0x3516f1),console[_0x40e4b7(0xfd)](t(_0x40e4b7(0xee))),console[_0x40e4b7(0xfd)](t(_0x40e4b7(0xe2))),console[_0x40e4b7(0xfd)](t(_0x40e4b7(0xfa)));return;}const _0x2cfb8c={'appCode':_0x2cbd11,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x40e4b7(0xde),'resources':_0x1f0c74?JSON[_0x40e4b7(0xd9)](_0x1f0c74):undefined},'label':_0x4ea4bf[_0x40e4b7(0xed)],'path':_0x4ea4bf[_0x40e4b7(0xfb)]},_0x3d3b4f=await fetch(getApiDomain()+'/smartapi/menu/create',{'method':_0x40e4b7(0xf2),'body':JSON[_0x40e4b7(0xd9)](_0x2cfb8c),'headers':{'Content-Type':_0x40e4b7(0xe7),'Cookie':getCookie()}});if(!_0x3d3b4f['ok']){if(_0x3d3b4f[_0x40e4b7(0xd1)]===0x191){const _0x5d4d68=t(_0x40e4b7(0xd2));logger['error'](_0x40e4b7(0xf0),_0x5d4d68,{'status':_0x3d3b4f[_0x40e4b7(0xd1)],'menu':_0x4ea4bf[_0x40e4b7(0xed)]});throw new Error(_0x5d4d68);}const _0x1a5c1a=t('appMenu.error.createHttpStatus',{'status':_0x3d3b4f['status']});logger[_0x40e4b7(0xe1)](_0x40e4b7(0xf0),_0x1a5c1a,{'menu':_0x4ea4bf[_0x40e4b7(0xed)]});throw new Error(_0x1a5c1a);}const _0x2519e5=await _0x3d3b4f[_0x40e4b7(0xf6)]();if(!_0x2519e5[_0x40e4b7(0xe3)]){if(_0x2519e5[_0x40e4b7(0xdc)]===_0x40e4b7(0xe5)||_0x2519e5[_0x40e4b7(0xeb)]?.[_0x40e4b7(0xef)]('登录')){const _0x2b2ebd=t(_0x40e4b7(0xdf));logger['error'](_0x40e4b7(0xf0),_0x2b2ebd,{'errorCode':_0x2519e5[_0x40e4b7(0xdc)],'errorMsg':_0x2519e5[_0x40e4b7(0xeb)],'menu':_0x4ea4bf['label']});throw new Error(_0x2b2ebd);}const _0x3bb394=t('appMenu.error.createFailed',{'error':_0x2519e5[_0x40e4b7(0xeb)]||t(_0x40e4b7(0xd4))});logger[_0x40e4b7(0xe1)]('create-menu',_0x3bb394,{'errorCode':_0x2519e5[_0x40e4b7(0xdc)],'errorMsg':_0x2519e5[_0x40e4b7(0xeb)],'menu':_0x4ea4bf['label']});throw new Error(_0x3bb394);}logger[_0x40e4b7(0xe9)](_0x40e4b7(0xf0),''+t(_0x40e4b7(0xf9))+_0x4ea4bf[_0x40e4b7(0xed)]);}export async function createMenus(_0x14969a,_0x42d627){const _0xd3b8fe=a10_0x52c204;logger[_0xd3b8fe(0xe9)]('create-menus',t(_0xd3b8fe(0xf1),{'count':_0x14969a[_0xd3b8fe(0xd0)]})),await Promise[_0xd3b8fe(0xec)](_0x14969a[_0xd3b8fe(0xe6)](async _0x44b7f5=>{await _createMenu(_0x44b7f5,_0x42d627);})),logger[_0xd3b8fe(0xe9)]('create-menus',t('appMenu.creating.batch.completed',{'count':_0x14969a[_0xd3b8fe(0xd0)]}));}
1
+ const a9_0x36fea6=a9_0x15d3;(function(_0x5f13b4,_0x58b995){const _0x3a1778=a9_0x15d3,_0x4b49ea=_0x5f13b4();while(!![]){try{const _0x47414b=parseInt(_0x3a1778(0x13f))/0x1*(-parseInt(_0x3a1778(0x150))/0x2)+-parseInt(_0x3a1778(0x154))/0x3*(-parseInt(_0x3a1778(0x155))/0x4)+parseInt(_0x3a1778(0x146))/0x5+parseInt(_0x3a1778(0x131))/0x6*(parseInt(_0x3a1778(0x137))/0x7)+parseInt(_0x3a1778(0x143))/0x8+parseInt(_0x3a1778(0x12e))/0x9+-parseInt(_0x3a1778(0x144))/0xa;if(_0x47414b===_0x58b995)break;else _0x4b49ea['push'](_0x4b49ea['shift']());}catch(_0x33c937){_0x4b49ea['push'](_0x4b49ea['shift']());}}}(a9_0xada5,0x95174));function a9_0x15d3(_0x32c2d9,_0x2be303){_0x32c2d9=_0x32c2d9-0x127;const _0xada549=a9_0xada5();let _0x15d305=_0xada549[_0x32c2d9];return _0x15d305;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import a9_0x560773 from'../i18n/index.js';const config=readConfig(),t=a9_0x560773['t'][a9_0x36fea6(0x153)](a9_0x560773);function a9_0xada5(){const _0x76d10=['164953sjJTvK','error','application/json','status','8274616mYVKnj','32097200mGmizW','import','5201885RtBoms','stringify','appcode','label','includes','appMenu.error.authExpired','map','appMenu.creating.single','appMenu.error.createFailed','errorCode','8rcxvcb','length','log','bind','2982DGxGgh','4844QVTObQ','appMenu.error.appCodeHint.option1','info','appMenu.creating.batch.completed','create-menus','errorMsg','appMenu.error.appCodeHint.option2','0011','success','8517753RxIrci','procode','path','42qilNgg','common.error','POST','appMenu.error.appCodeHint.title','appMenu.error.missingAppCode','all','255353UxBKnA','data','/smartapi/menu/create','appMenu.success.created','appMenu.error.createHttpStatus','resources','json','create-menu'];a9_0xada5=function(){return _0x76d10;};return a9_0xada5();}export async function createMenu(_0x74a805){const _0x30c90e=a9_0x36fea6,_0x5f525b=config?.['appcode'];if(!_0x5f525b){const _0x4eaaaa=t(_0x30c90e(0x135));logger[_0x30c90e(0x140)](_0x30c90e(0x13e),_0x4eaaaa),console[_0x30c90e(0x140)]('×\x20'+_0x4eaaaa),console[_0x30c90e(0x152)](t(_0x30c90e(0x134))),console[_0x30c90e(0x152)](t('appMenu.error.appCodeHint.option1')),console[_0x30c90e(0x152)](t(_0x30c90e(0x12b)));return;}logger[_0x30c90e(0x127)]('create-menu',t(_0x30c90e(0x14d),{'label':_0x74a805[_0x30c90e(0x149)],'path':_0x74a805['path']}));const _0x540c99={'appCode':_0x5f525b,'type':_0x30c90e(0x12f),'sort':0x0,'extend':{'loadScriptMode':_0x30c90e(0x145),'resources':_0x74a805[_0x30c90e(0x13c)]?JSON[_0x30c90e(0x147)](_0x74a805[_0x30c90e(0x13c)]):undefined},..._0x74a805},_0x9f847d=await fetch(getApiDomain()+_0x30c90e(0x139),{'method':_0x30c90e(0x133),'body':JSON['stringify'](_0x540c99),'headers':{'Content-Type':_0x30c90e(0x141),'Cookie':getCookie()}});if(!_0x9f847d['ok']){if(_0x9f847d['status']===0x191){const _0x26eef3=t(_0x30c90e(0x14b));logger[_0x30c90e(0x140)](_0x30c90e(0x13e),_0x26eef3,{'status':_0x9f847d[_0x30c90e(0x142)],'menu':_0x74a805[_0x30c90e(0x149)]});throw new Error(_0x26eef3);}const _0x3b5d7e=t(_0x30c90e(0x13b),{'status':_0x9f847d[_0x30c90e(0x142)]});logger[_0x30c90e(0x140)](_0x30c90e(0x13e),_0x3b5d7e,{'menu':_0x74a805[_0x30c90e(0x149)]});throw new Error(_0x3b5d7e);}const _0x2196af=await _0x9f847d[_0x30c90e(0x13d)]();if(!_0x2196af[_0x30c90e(0x12d)]){const _0xedfa44=t(_0x30c90e(0x14e),{'error':_0x2196af[_0x30c90e(0x12a)]||t(_0x30c90e(0x132))});logger['error']('create-menu',_0xedfa44,{'errorCode':_0x2196af[_0x30c90e(0x14f)],'errorMsg':_0x2196af[_0x30c90e(0x12a)],'menu':_0x74a805['label']});throw new Error(_0xedfa44);}logger[_0x30c90e(0x127)](_0x30c90e(0x13e),''+t(_0x30c90e(0x13a))+_0x74a805[_0x30c90e(0x149)],_0x2196af[_0x30c90e(0x138)]),console[_0x30c90e(0x152)](t('appMenu.success.created'),_0x2196af[_0x30c90e(0x138)]);}async function _createMenu(_0xe28060,_0x33136d){const _0x282493=a9_0x36fea6,_0x8129ff=config?.[_0x282493(0x148)];if(!_0x8129ff){const _0x36ac83=t('appMenu.error.missingAppCode');logger['error'](_0x282493(0x13e),_0x36ac83),console[_0x282493(0x140)]('×\x20'+_0x36ac83),console[_0x282493(0x152)](t(_0x282493(0x134))),console[_0x282493(0x152)](t(_0x282493(0x156))),console[_0x282493(0x152)](t(_0x282493(0x12b)));return;}const _0x6212ac={'appCode':_0x8129ff,'type':_0x282493(0x12f),'sort':0x0,'extend':{'loadScriptMode':_0x282493(0x145),'resources':_0x33136d?JSON[_0x282493(0x147)](_0x33136d):undefined},'label':_0xe28060['label'],'path':_0xe28060[_0x282493(0x130)]},_0x553429=await fetch(getApiDomain()+_0x282493(0x139),{'method':_0x282493(0x133),'body':JSON['stringify'](_0x6212ac),'headers':{'Content-Type':_0x282493(0x141),'Cookie':getCookie()}});if(!_0x553429['ok']){if(_0x553429['status']===0x191){const _0x517526=t(_0x282493(0x14b));logger[_0x282493(0x140)](_0x282493(0x13e),_0x517526,{'status':_0x553429[_0x282493(0x142)],'menu':_0xe28060[_0x282493(0x149)]});throw new Error(_0x517526);}const _0x2c4f13=t(_0x282493(0x13b),{'status':_0x553429[_0x282493(0x142)]});logger[_0x282493(0x140)]('create-menu',_0x2c4f13,{'menu':_0xe28060[_0x282493(0x149)]});throw new Error(_0x2c4f13);}const _0x25ccb4=await _0x553429[_0x282493(0x13d)]();if(!_0x25ccb4[_0x282493(0x12d)]){if(_0x25ccb4[_0x282493(0x14f)]===_0x282493(0x12c)||_0x25ccb4[_0x282493(0x12a)]?.[_0x282493(0x14a)]('登录')){const _0x2123f2=t('appMenu.error.authValidationFailed');logger['error'](_0x282493(0x13e),_0x2123f2,{'errorCode':_0x25ccb4['errorCode'],'errorMsg':_0x25ccb4[_0x282493(0x12a)],'menu':_0xe28060['label']});throw new Error(_0x2123f2);}const _0x6bc41e=t('appMenu.error.createFailed',{'error':_0x25ccb4[_0x282493(0x12a)]||t(_0x282493(0x132))});logger['error'](_0x282493(0x13e),_0x6bc41e,{'errorCode':_0x25ccb4[_0x282493(0x14f)],'errorMsg':_0x25ccb4['errorMsg'],'menu':_0xe28060[_0x282493(0x149)]});throw new Error(_0x6bc41e);}logger[_0x282493(0x127)](_0x282493(0x13e),''+t(_0x282493(0x13a))+_0xe28060[_0x282493(0x149)]);}export async function createMenus(_0x28816b,_0x9efe02){const _0x5d785d=a9_0x36fea6;logger[_0x5d785d(0x127)](_0x5d785d(0x129),t('appMenu.creating.batch.start',{'count':_0x28816b[_0x5d785d(0x151)]})),await Promise[_0x5d785d(0x136)](_0x28816b[_0x5d785d(0x14c)](async _0x4868fe=>{await _createMenu(_0x4868fe,_0x9efe02);})),logger['info']('create-menus',t(_0x5d785d(0x128),{'count':_0x28816b['length']}));}