@lovrabet/cli 1.3.0-beta.12 → 1.3.0-beta.14
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.
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/skill-install-non-interactive.js +1 -1
- package/lib/skills/skill-installer.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -0
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -0
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a0_0x599d(_0x252bec,_0x4d0f3f){_0x252bec=_0x252bec-0x1bb;const _0x4cbd68=a0_0x4cbd();let _0x599d86=_0x4cbd68[_0x252bec];return _0x599d86;}(function(_0x1295f0,_0x3e6554){const _0xd7010=a0_0x599d,_0x372cd7=_0x1295f0();while(!![]){try{const _0x4b4dd3=parseInt(_0xd7010(0x1c9))/0x1*(parseInt(_0xd7010(0x1c3))/0x2)+-parseInt(_0xd7010(0x1be))/0x3*(parseInt(_0xd7010(0x1c4))/0x4)+parseInt(_0xd7010(0x1d6))/0x5+-parseInt(_0xd7010(0x1db))/0x6*(-parseInt(_0xd7010(0x1da))/0x7)+-parseInt(_0xd7010(0x1cd))/0x8+-parseInt(_0xd7010(0x1cc))/0x9+parseInt(_0xd7010(0x1cf))/0xa;if(_0x4b4dd3===_0x3e6554)break;else _0x372cd7['push'](_0x372cd7['shift']());}catch(_0x459540){_0x372cd7['push'](_0x372cd7['shift']());}}}(a0_0x4cbd,0x90847));import{jsx as a0_0x35825f,jsxs as a0_0x4ba8d0}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a0_0x4cbd(){const _0x3bdd96=['existsSync','页面路径长度不能超过\x20100\x20个字符','\x20←\x20','1296176MLOrPK','6CxocKj','includes','\x20已存在,请使用其他路径','页面路径\x20','my-page','6PTsXnC','\x20Step2:\x20','页面路径不合法','delete','gray','65544cLaGxw','2267120qIszqz','slice','column','\x20直接回车确认,或输入自定义路由地址','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','31iObdZV','length','路径不能包含连续的\x20/','3313449khaWUP','299848DoLzzo','split','4706640TulciU','return','green','endsWith','red','test','backspace','2296905ONXwIg'];a0_0x4cbd=function(){return _0x3bdd96;};return a0_0x4cbd();}import a0_0x1769cf from'node:fs';export function InputProjectCode(_0x567620){const _0xd619d6=a0_0x599d,{onSubmit:_0x5cb45b,pagePath:_0x1bbe06}=_0x567620,[_0x120ee1,_0x1cc84a]=useState(''),[_0x54e242,_0x22d871]=useState(''),_0x1dde98=_0xd619d6(0x1bd);function _0x493693(_0x4d3c01){const _0x4e4e89=_0xd619d6;if(_0x4d3c01[_0x4e4e89(0x1ca)]>0x64)return{'valid':![],'message':_0x4e4e89(0x1d8)};if(_0x4d3c01['startsWith']('/')||_0x4d3c01[_0x4e4e89(0x1d2)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x4d3c01[_0x4e4e89(0x1dc)]('//'))return{'valid':![],'message':_0x4e4e89(0x1cb)};const _0x3af7a4=_0x4d3c01[_0x4e4e89(0x1ce)]('/');for(const _0x10446e of _0x3af7a4){if(!_0x10446e)continue;const _0x1c9be9=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x1c9be9[_0x4e4e89(0x1d4)](_0x10446e))return{'valid':![],'message':_0x4e4e89(0x1c8)};}return{'valid':!![]};}return useInput((_0x29d4f7,_0x48b78b)=>{const _0x26fe90=_0xd619d6;if(_0x48b78b[_0x26fe90(0x1d0)]){const _0x3b2f9f=_0x120ee1['trim']()||_0x1dde98;if(_0x54e242)return;const _0x770802=_0x1bbe06+'/'+_0x3b2f9f;if(a0_0x1769cf[_0x26fe90(0x1d7)](_0x770802)){_0x22d871(_0x26fe90(0x1bc)+_0x3b2f9f+_0x26fe90(0x1bb));return;}_0x5cb45b(_0x3b2f9f),_0x1cc84a(''),_0x22d871('');}else _0x48b78b[_0x26fe90(0x1d5)]||_0x48b78b[_0x26fe90(0x1c1)]?_0x1cc84a(_0x5308f4=>{const _0x305c81=_0x26fe90,_0x2274b1=_0x5308f4[_0x305c81(0x1c5)](0x0,-0x1),{valid:_0x536ff8,message:_0x5cba35}=_0x493693(_0x2274b1);return _0x22d871(_0x536ff8?'':_0x5cba35||_0x305c81(0x1c0)),_0x2274b1;}):_0x1cc84a(_0x3456f8=>{const _0x4d3be3=_0x26fe90,_0x36a179=_0x3456f8+_0x29d4f7,{valid:_0x42c032,message:_0x30c6db}=_0x493693(_0x36a179);return _0x22d871(_0x42c032?'':_0x30c6db||_0x4d3be3(0x1c0)),_0x36a179;});}),a0_0x4ba8d0(Box,{'flexDirection':_0xd619d6(0x1c6),'children':[a0_0x4ba8d0(Box,{'children':[a0_0x35825f(Text,{'color':_0xd619d6(0x1c2),'children':_0xd619d6(0x1bf)}),a0_0x35825f(Text,{'children':'页面路由地址:\x20'}),_0x120ee1?a0_0x35825f(Text,{'color':_0xd619d6(0x1d1),'children':_0x120ee1}):a0_0x35825f(Text,{'color':_0xd619d6(0x1c2),'children':_0x1dde98}),_0x54e242&&a0_0x4ba8d0(Text,{'color':_0xd619d6(0x1d3),'children':[_0xd619d6(0x1d9),_0x54e242]})]}),!_0x54e242&&!_0x120ee1&&a0_0x35825f(Box,{'children':a0_0x35825f(Text,{'color':_0xd619d6(0x1c2),'children':_0xd619d6(0x1c7)})})]});}
|
package/lib/add-page/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a1_0x25fe(){const _0x13e187=['\x20*\x20页面创建成功!','319668mPcEJw','正在创建页面,请稍候…','69786lzJVhj','pages','add-page','catch','gray','resolve','2065491VYrYJg','green','315642igVlHy','已输入的页面路由\x20','32dxwmXN','join','297360XEbLDG','40OdPBjG','error','setLogPath','45MAxhEy','cwd','then','\x20*\x20页面路径:\x20','开始添加页面:\x20','processTemplate','success','info','16714rJmTCL','\x20*\x20路由地址:\x20','\x20Step1:\x20','src','115Tpkugl','now','已选择页面模板\x20','column','dirname','message','188650LcGhDt'];a1_0x25fe=function(){return _0x13e187;};return a1_0x25fe();}function a1_0x1ee8(_0x103a58,_0x1ab8cc){_0x103a58=_0x103a58-0xb8;const _0x25fef2=a1_0x25fe();let _0x1ee8a7=_0x25fef2[_0x103a58];return _0x1ee8a7;}const a1_0x3fc185=a1_0x1ee8;(function(_0x2afc46,_0x55aaf4){const _0x32c84b=a1_0x1ee8,_0x14a496=_0x2afc46();while(!![]){try{const _0x5dc3ce=parseInt(_0x32c84b(0xd1))/0x1+parseInt(_0x32c84b(0xbb))/0x2*(-parseInt(_0x32c84b(0xd9))/0x3)+-parseInt(_0x32c84b(0xc7))/0x4+-parseInt(_0x32c84b(0xbf))/0x5*(parseInt(_0x32c84b(0xc9))/0x6)+parseInt(_0x32c84b(0xd5))/0x7*(parseInt(_0x32c84b(0xd3))/0x8)+parseInt(_0x32c84b(0xcf))/0x9+parseInt(_0x32c84b(0xd6))/0xa*(-parseInt(_0x32c84b(0xc5))/0xb);if(_0x5dc3ce===_0x55aaf4)break;else _0x14a496['push'](_0x14a496['shift']());}catch(_0x3fe110){_0x14a496['push'](_0x14a496['shift']());}}}(a1_0x25fe,0x2a66c));import{jsx as a1_0x179856,jsxs as a1_0x276d2e,Fragment as a1_0x5ccaef}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x1938f2 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x1938f2[a1_0x3fc185(0xc3)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x1938f2[a1_0x3fc185(0xce)](__dirname,'../../templates/pages'),projectDir=process[a1_0x3fc185(0xda)]();export const AddPage=()=>{const _0x11e15a=a1_0x3fc185,{exit:_0x5a7065}=useApp(),[_0x51ab53,_0x430185]=useState(''),[_0x5c5f36,_0x532410]=useState(''),[_0x4afd76,_0x2c7747]=useState(![]),[_0x4c63f3,_0xed3dd0]=useState(![]),_0x51100b=a1_0x1938f2[_0x11e15a(0xd4)](projectDir,_0x11e15a(0xbe),_0x11e15a(0xca)),_0x1c3599=a1_0x1938f2[_0x11e15a(0xd4)](_0x51100b,_0x5c5f36),_0x5b1b76=a1_0x1938f2[_0x11e15a(0xd4)](_0x11e15a(0xbe),_0x11e15a(0xca),_0x5c5f36);useEffect(()=>{const _0x2d1735=_0x11e15a,_0xdecdd1=a1_0x1938f2[_0x2d1735(0xce)](pageTemplateDir,_0x51ab53);if(_0x51ab53&&_0x5c5f36){_0x2c7747(!![]),logger[_0x2d1735(0xd8)](process[_0x2d1735(0xda)]());const _0x210ff0=Date['now']();logger[_0x2d1735(0xba)](_0x2d1735(0xcb),_0x2d1735(0xdd)+_0x5c5f36,{'template':_0x51ab53,'targetPath':_0x5b1b76}),TemplateReplacer[_0x2d1735(0xb8)](_0xdecdd1,a1_0x1938f2[_0x2d1735(0xd4)](_0x51100b,_0x5c5f36),_0x5c5f36,_0x51ab53)[_0x2d1735(0xdb)](()=>{const _0x2929b1=_0x2d1735,_0x599a0b=Date[_0x2929b1(0xc0)]()-_0x210ff0;logger[_0x2929b1(0xb9)](_0x2929b1(0xcb),'页面添加成功:\x20'+_0x5c5f36,_0x599a0b,{'template':_0x51ab53,'targetPath':_0x5b1b76,'routePath':_0x5c5f36}),_0xed3dd0(!![]);})[_0x2d1735(0xcc)](_0x5e4f6c=>{const _0x322068=_0x2d1735,_0x393b69=Date[_0x322068(0xc0)]()-_0x210ff0;logger[_0x322068(0xd7)](_0x322068(0xcb),'页面添加失败:\x20'+_0x5c5f36,{'template':_0x51ab53,'targetPath':_0x5b1b76,'error':_0x5e4f6c instanceof Error?_0x5e4f6c[_0x322068(0xc4)]:String(_0x5e4f6c),'duration':_0x393b69});})['finally'](()=>{_0x2c7747(![]);});}},[_0x51ab53,_0x5c5f36]),useEffect(()=>{_0x4c63f3&&setTimeout(()=>{_0x5a7065();});},[_0x4c63f3]);if(_0x51ab53)return a1_0x276d2e(Box,{'flexDirection':_0x11e15a(0xc2),'paddingY':0x1,'children':[a1_0x276d2e(Box,{'children':[a1_0x179856(Text,{'color':_0x11e15a(0xcd),'children':_0x11e15a(0xbd)}),a1_0x179856(Text,{'children':_0x11e15a(0xc1)}),a1_0x179856(Text,{'color':'green','children':_0x51ab53})]}),_0x5c5f36?a1_0x276d2e(Box,{'children':[a1_0x179856(Text,{'color':_0x11e15a(0xcd),'children':'\x20Step2:\x20'}),a1_0x179856(Text,{'children':_0x11e15a(0xd2)}),a1_0x179856(Text,{'color':'green','children':_0x5c5f36})]}):a1_0x179856(InputProjectCode,{'pagePath':_0x1c3599,'onSubmit':_0x532410}),_0x5c5f36&&_0x4afd76?a1_0x276d2e(Box,{'marginTop':0x1,'children':[a1_0x179856(Box,{'width':'4'}),a1_0x179856(Text,{'children':_0x11e15a(0xc8)})]}):null,_0x4c63f3?a1_0x276d2e(a1_0x5ccaef,{'children':[a1_0x179856(Box,{'marginTop':0x1,'children':a1_0x179856(Text,{'color':_0x11e15a(0xcd),'children':_0x11e15a(0xc6)})}),a1_0x276d2e(Box,{'children':[a1_0x179856(Text,{'color':_0x11e15a(0xcd),'children':_0x11e15a(0xdc)}),a1_0x179856(Text,{'color':_0x11e15a(0xd0),'children':_0x5b1b76})]}),a1_0x276d2e(Box,{'children':[a1_0x179856(Text,{'color':'gray','children':_0x11e15a(0xbc)}),a1_0x276d2e(Text,{'color':_0x11e15a(0xd0),'children':['/',_0x5c5f36]})]}),a1_0x179856(Box,{'marginTop':0x1,'children':a1_0x179856(Text,{'color':'cyan','children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x179856(SelectPageTemplate,{'onSelect':_0x430185});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x268d1c,_0x3af360){const _0x13837b=a2_0x110a,_0x8c6482=_0x268d1c();while(!![]){try{const _0x88aa60=parseInt(_0x13837b(0x1a0))/0x1+parseInt(_0x13837b(0x19a))/0x2+-parseInt(_0x13837b(0x19d))/0x3*(parseInt(_0x13837b(0x198))/0x4)+parseInt(_0x13837b(0x18b))/0x5+-parseInt(_0x13837b(0x18f))/0x6*(parseInt(_0x13837b(0x195))/0x7)+-parseInt(_0x13837b(0x190))/0x8+-parseInt(_0x13837b(0x1a4))/0x9*(-parseInt(_0x13837b(0x197))/0xa);if(_0x88aa60===_0x3af360)break;else _0x8c6482['push'](_0x8c6482['shift']());}catch(_0x4ce823){_0x8c6482['push'](_0x8c6482['shift']());}}}(a2_0x5083,0xea3bf));function a2_0x110a(_0x23ec26,_0x3390f7){_0x23ec26=_0x23ec26-0x188;const _0x50839d=a2_0x5083();let _0x110a35=_0x50839d[_0x23ec26];return _0x110a35;}import{jsx as a2_0x51c164,jsxs as a2_0x5dab53}from'react/jsx-runtime';function a2_0x5083(){const _0x229d41=['green','18Fvroku','downArrow','join','map','正在加载页面模板...','gray','length','sdk-fetch','1736795ZsVfme','upArrow','filter','localeCompare','1482DAwpor','10424880kjDQsL','../..','return','dirname','isDirectory','9793ZmPEAA','onSelect','8147860XzCwmP','39860dxkmGF','label','148780ZZGRLj','\x20\x20\x20\x20\x20\x20>\x20','获取模板列表失败:','342vYeUZL','column','name','1692775JIMvqv','resolve','\x20Step1:\x20'];a2_0x5083=function(){return _0x229d41;};return a2_0x5083();}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x541af4 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x2ebea9=a2_0x110a;try{const _0xb5cea=fileURLToPath(import.meta.url),_0x99227f=a2_0x541af4[_0x2ebea9(0x1a1)](a2_0x541af4[_0x2ebea9(0x193)](_0xb5cea),_0x2ebea9(0x191)),_0x438402=a2_0x541af4[_0x2ebea9(0x1a6)](_0x99227f,'templates/pages'),_0x17b1a4=await readdir(_0x438402,{'withFileTypes':!![]}),_0x480af0=_0x17b1a4[_0x2ebea9(0x18d)](_0x42064f=>_0x42064f[_0x2ebea9(0x194)]())['map'](_0x28c1db=>({'label':_0x28c1db[_0x2ebea9(0x19f)]}))['sort']((_0x41845c,_0x20ce21)=>_0x41845c[_0x2ebea9(0x199)][_0x2ebea9(0x18e)](_0x20ce21['label']));return _0x480af0;}catch(_0x378263){return console['error'](_0x2ebea9(0x19c),_0x378263),[{'label':'blank'},{'label':_0x2ebea9(0x18a)}];}}export function SelectPageTemplate(_0x198c1f){const _0x9f0bf2=a2_0x110a,[_0x206366,_0x360164]=useState(0x0),[_0x2f724d,_0xea5208]=useState([]),[_0x263859,_0x1c5e36]=useState(!![]);useEffect(()=>{async function _0x438e54(){const _0x1bb411=await getTemplateList();_0xea5208(_0x1bb411),_0x1c5e36(![]);}_0x438e54();},[]),useInput((_0x316011,_0x4d7cd6)=>{const _0x572be6=a2_0x110a;if(_0x263859)return;if(_0x4d7cd6[_0x572be6(0x192)]){const _0x3ed893=_0x2f724d[_0x206366];_0x3ed893&&_0x198c1f[_0x572be6(0x196)](_0x3ed893[_0x572be6(0x199)]);}_0x4d7cd6[_0x572be6(0x18c)]&&_0x360164(_0x26659c=>_0x26659c===0x0?_0x2f724d[_0x572be6(0x189)]-0x1:_0x26659c-0x1),_0x4d7cd6[_0x572be6(0x1a5)]&&_0x360164(_0x14e9ca=>_0x14e9ca===_0x2f724d['length']-0x1?0x0:_0x14e9ca+0x1);});if(_0x263859)return a2_0x51c164(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0x5dab53(Box,{'children':[a2_0x51c164(Text,{'color':'gray','children':_0x9f0bf2(0x1a2)}),a2_0x51c164(Text,{'children':_0x9f0bf2(0x1a8)})]})});return a2_0x5dab53(Box,{'flexDirection':_0x9f0bf2(0x19e),'paddingY':0x1,'children':[a2_0x5dab53(Box,{'children':[a2_0x51c164(Text,{'color':_0x9f0bf2(0x188),'children':_0x9f0bf2(0x1a2)}),a2_0x51c164(Text,{'children':'请选择您要创建的页面模板'})]}),_0x2f724d[_0x9f0bf2(0x1a7)]((_0x13d54c,_0x5025be)=>{const _0x359c28=_0x9f0bf2,_0x197a81=_0x5025be===_0x206366,_0x3559c0=_0x197a81?_0x359c28(0x19b)+_0x13d54c[_0x359c28(0x199)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x13d54c[_0x359c28(0x199)];return a2_0x51c164(Box,{'children':a2_0x51c164(Text,{'color':_0x197a81?_0x359c28(0x1a3):undefined,'children':_0x3559c0})},_0x3559c0);})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a3_0x2241ab=a3_0x277b;(function(_0x15e4e4,_0x487d5f){const _0x41a0b5=a3_0x277b,_0x503be9=_0x15e4e4();while(!![]){try{const _0x51df03=-parseInt(_0x41a0b5(0xa6))/0x1*(-parseInt(_0x41a0b5(0x8a))/0x2)+-parseInt(_0x41a0b5(0x7c))/0x3*(-parseInt(_0x41a0b5(0x99))/0x4)+-parseInt(_0x41a0b5(0x79))/0x5*(-parseInt(_0x41a0b5(0x95))/0x6)+parseInt(_0x41a0b5(0x92))/0x7*(parseInt(_0x41a0b5(0xaa))/0x8)+parseInt(_0x41a0b5(0x71))/0x9+parseInt(_0x41a0b5(0xa5))/0xa+-parseInt(_0x41a0b5(0xa3))/0xb;if(_0x51df03===_0x487d5f)break;else _0x503be9['push'](_0x503be9['shift']());}catch(_0x21cbc2){_0x503be9['push'](_0x503be9['shift']());}}}(a3_0x4037,0x71254));function a3_0x277b(_0x1f58e8,_0x1e664c){_0x1f58e8=_0x1f58e8-0x6f;const _0x40379a=a3_0x4037();let _0x277ba3=_0x40379a[_0x1f58e8];return _0x277ba3;}import{jsx as a3_0x1a4f88,jsxs as a3_0x325adf}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=[a3_0x2241ab(0x9f),a3_0x2241ab(0x97)],SKILL_IDE_LIST=[a3_0x2241ab(0xa7),a3_0x2241ab(0x97),a3_0x2241ab(0x9c),a3_0x2241ab(0xa1),'cursor',a3_0x2241ab(0x94),a3_0x2241ab(0xac),a3_0x2241ab(0xab),'windsurf',a3_0x2241ab(0x83)];function a3_0x4037(){const _0x5e8e3d=['cyan','delete','error','message','请至少选择一个配置项','confirming','length','57055wEHxhx','projectRoot','downArrow','2533686qawFmO','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','map','Claude\x20Code','gray','has','selecting','agent','Enter\x20默认:\x20是','size','[\x20]','是否同时配置\x20AI\x20助手?这将:','dimColor','upArrow','2pSVHsB','[N]\x20跳过,稍后手动配置','red','success','push','正在配置\x20AI\x20助手...','技能包\x20(研发规范指南)','appcode','91byRCSh','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','opencode','222jZpcZe','mcp-','claude','add','4Miptyk','return','installing','codebuddy','status','Cursor','cursor','column','codex','[✓]','31265498GjdPMX','name','5446080EmTWXi','701528vFTJmY','antigravity','done','MCP\x20服务器\x20(AI\x20访问数据集)','158024Hmxfkb','trae','qoder','white','yellow','blue','4824612JOOfxU'];a3_0x4037=function(){return _0x5e8e3d;};return a3_0x4037();}export function AISetupUI({config:_0x1ce80f,onComplete:_0xe78470}){const _0x30b0b3=a3_0x2241ab,{exit:_0xeee97e}=useApp(),[_0x3852f5,_0x39fac4]=useState(_0x30b0b3(0x77)),[_0x42f54d,_0x326871]=useState(0x0),[_0x18e892,_0x31393a]=useState(new Set([0x0,0x1])),[_0x3c4d88,_0x5229de]=useState(new Set(SKILL_IDE_LIST[_0x30b0b3(0x7e)]((_0xfd1f8a,_0x4275b1)=>_0x4275b1))),[_0x3ef242,_0x1f7636]=useState('');useEffect(()=>{const _0xc143ed=_0x30b0b3;!_0x1ce80f[_0xc143ed(0x91)]&&_0xe78470({'mcpResults':[],'skillResults':[]});},[_0x1ce80f[_0x30b0b3(0x91)],_0xe78470]),useInput((_0x5a96ae,_0xb5e8b4)=>{const _0x372493=_0x30b0b3;if(_0x3852f5==='confirming'){if(_0x5a96ae==='y'||_0x5a96ae==='Y'||_0xb5e8b4[_0x372493(0x9a)]){_0x43be42();return;}if(_0x5a96ae==='n'||_0x5a96ae==='N'){_0xe78470({'mcpResults':[],'skillResults':[]});return;}if(_0xb5e8b4['return']){_0x43be42();return;}}if(_0x3852f5===_0x372493(0x82)){if(_0xb5e8b4[_0x372493(0x89)]){_0x326871(_0x3fd91d=>_0x3fd91d>0x0?_0x3fd91d-0x1:SKILL_IDE_LIST[_0x372493(0x78)]-0x1);return;}if(_0xb5e8b4[_0x372493(0x7b)]){_0x326871(_0x381122=>_0x381122<SKILL_IDE_LIST[_0x372493(0x78)]-0x1?_0x381122+0x1:0x0);return;}if(_0x5a96ae==='\x20'){const _0x4c564a=_0x42f54d<MCP_IDE_LIST['length'];if(_0x4c564a){const _0x4830bb=new Set(_0x18e892);_0x4830bb[_0x372493(0x81)](_0x42f54d)?_0x4830bb[_0x372493(0x73)](_0x42f54d):_0x4830bb[_0x372493(0x98)](_0x42f54d),_0x31393a(_0x4830bb);}else{const _0x3ea063=_0x42f54d-MCP_IDE_LIST['length'],_0x12599e=new Set(_0x3c4d88);_0x12599e[_0x372493(0x81)](_0x3ea063)?_0x12599e[_0x372493(0x73)](_0x3ea063):_0x12599e[_0x372493(0x98)](_0x3ea063),_0x5229de(_0x12599e);}return;}if(_0x5a96ae==='a'||_0x5a96ae==='A'){_0x31393a(new Set(MCP_IDE_LIST[_0x372493(0x7e)]((_0x4d6e14,_0x5169b1)=>_0x5169b1))),_0x5229de(new Set(SKILL_IDE_LIST[_0x372493(0x7e)]((_0xcd864,_0x458b11)=>_0x458b11)));return;}if(_0x5a96ae==='q'||_0x5a96ae==='Q'){_0xeee97e();return;}if(_0xb5e8b4[_0x372493(0x9a)]){if(_0x18e892['size']===0x0&&_0x3c4d88[_0x372493(0x85)]===0x0){_0x1f7636(_0x372493(0x76));return;}_0x43be42();return;}}if(_0x3852f5==='done'){_0xeee97e();return;}});async function _0x43be42(){const _0x5962d1=_0x30b0b3;_0x39fac4('installing');const _0x445441=[],_0x244ace=[];for(const _0x4ef78f of _0x18e892){const _0x3c420d=MCP_IDE_LIST[_0x4ef78f];if(!_0x3c420d)continue;try{const _0x1194cb=await configureMcp(_0x3c420d,_0x1ce80f[_0x5962d1(0x7a)]);_0x445441[_0x5962d1(0x8e)](_0x1194cb);}catch(_0x58c202){_0x445441['push']({'ide':MCP_IDE_CONFIGS[_0x3c420d]?.[_0x5962d1(0xa4)]||_0x3c420d,'status':_0x5962d1(0x74),'message':_0x58c202 instanceof Error?_0x58c202[_0x5962d1(0x75)]:String(_0x58c202)});}}await copySharedSkills(_0x1ce80f[_0x5962d1(0x7a)]);for(const _0x22a308 of _0x3c4d88){const _0xef35a0=SKILL_IDE_LIST[_0x22a308];if(!_0xef35a0)continue;try{const _0xa731ba=await installSkill(_0xef35a0,_0x1ce80f[_0x5962d1(0x7a)]);_0x244ace[_0x5962d1(0x8e)](_0xa731ba);}catch(_0x1a0f93){_0x244ace['push']({'ide':SKILL_IDE_CONFIGS[_0xef35a0]?.[_0x5962d1(0xa4)]||_0xef35a0,'status':_0x5962d1(0x74),'message':_0x1a0f93 instanceof Error?_0x1a0f93[_0x5962d1(0x75)]:String(_0x1a0f93)});}}if(_0x244ace[_0x5962d1(0x78)]>0x0){const _0x4fa071=_0x244ace['filter'](_0x100ad4=>_0x100ad4[_0x5962d1(0x9d)]===_0x5962d1(0x8d))[_0x5962d1(0x7e)](_0x3dc5ab=>_0x3dc5ab['ide']);_0x4fa071[_0x5962d1(0x78)]>0x0&&createSkillManifest(_0x1ce80f[_0x5962d1(0x7a)],_0x4fa071);}_0x39fac4(_0x5962d1(0xa8)),setTimeout(()=>{_0xe78470({'mcpResults':_0x445441,'skillResults':_0x244ace});},0xbb8);}if(_0x3852f5===_0x30b0b3(0x77))return a3_0x325adf(Box,{'flexDirection':_0x30b0b3(0xa0),'marginTop':0x1,'children':[a3_0x1a4f88(Box,{'marginTop':0x1,'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0xad),'children':_0x30b0b3(0x87)})}),a3_0x1a4f88(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x80),'children':_0x30b0b3(0x7d)})}),a3_0x1a4f88(Box,{'marginLeft':0x2,'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x80),'children':_0x30b0b3(0x93)})}),a3_0x325adf(Box,{'marginTop':0x1,'flexDirection':_0x30b0b3(0xa0),'children':[a3_0x1a4f88(Box,{'children':a3_0x1a4f88(Text,{'color':'green','children':'[Y]\x20是,配置\x20AI\x20助手'})}),a3_0x1a4f88(Box,{'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x80),'children':_0x30b0b3(0x8b)})}),a3_0x1a4f88(Box,{'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x88),'children':_0x30b0b3(0x84)})})]}),_0x3ef242&&a3_0x1a4f88(Box,{'marginTop':0x1,'children':a3_0x325adf(Text,{'color':'red','children':['✗\x20',_0x3ef242]})})]});if(_0x3852f5===_0x30b0b3(0x82))return a3_0x325adf(Box,{'flexDirection':_0x30b0b3(0xa0),'marginTop':0x1,'children':[a3_0x1a4f88(Box,{'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x72),'bold':!![],'children':'*\x20选择要配置的\x20IDE:'})}),_0x3ef242&&a3_0x1a4f88(Box,{'marginTop':0x1,'children':a3_0x325adf(Text,{'color':_0x30b0b3(0x8c),'children':['✗\x20',_0x3ef242]})}),a3_0x325adf(Box,{'marginTop':0x1,'flexDirection':_0x30b0b3(0xa0),'children':[a3_0x1a4f88(Text,{'bold':!![],'color':'yellow','children':_0x30b0b3(0xa9)}),MCP_IDE_LIST[_0x30b0b3(0x7e)]((_0xb8dba9,_0x1b7dc1)=>{const _0x2d7dee=_0x30b0b3,_0x549761=_0x42f54d===_0x1b7dc1,_0x280722=_0x18e892[_0x2d7dee(0x81)](_0x1b7dc1);return a3_0x1a4f88(Box,{'children':a3_0x325adf(Text,{'backgroundColor':_0x549761?_0x2d7dee(0x70):undefined,'color':_0x549761?_0x2d7dee(0xad):undefined,'children':[_0x280722?_0x2d7dee(0xa2):'[\x20]','\x20',_0xb8dba9===_0x2d7dee(0x9f)?_0x2d7dee(0x9e):_0x2d7dee(0x7f)]})},_0x2d7dee(0x96)+_0xb8dba9);}),a3_0x1a4f88(Box,{'marginTop':0x1,'children':a3_0x1a4f88(Text,{'bold':!![],'color':_0x30b0b3(0x6f),'children':_0x30b0b3(0x90)})}),SKILL_IDE_LIST[_0x30b0b3(0x7e)]((_0x4c7b16,_0x40157c)=>{const _0x39a5c8=_0x30b0b3,_0x4edcbd=_0x40157c+MCP_IDE_LIST[_0x39a5c8(0x78)],_0xc5a913=_0x42f54d===_0x4edcbd,_0x49e803=_0x3c4d88[_0x39a5c8(0x81)](_0x4edcbd);return a3_0x1a4f88(Box,{'children':a3_0x325adf(Text,{'backgroundColor':_0xc5a913?_0x39a5c8(0x70):undefined,'color':_0xc5a913?_0x39a5c8(0xad):undefined,'children':[_0x49e803?_0x39a5c8(0xa2):_0x39a5c8(0x86),'\x20',SKILL_IDE_CONFIGS[_0x4c7b16]['name']]})},'skill-'+_0x4c7b16);}),a3_0x1a4f88(Box,{'marginTop':0x1,'children':a3_0x1a4f88(Text,{'color':_0x30b0b3(0x80),'children':'↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认'})})]})]});if(_0x3852f5===_0x30b0b3(0x9b))return a3_0x1a4f88(Box,{'flexDirection':_0x30b0b3(0xa0),'marginTop':0x1,'children':a3_0x1a4f88(Box,{'children':a3_0x1a4f88(Text,{'children':_0x30b0b3(0x8f)})})});if(_0x3852f5===_0x30b0b3(0xa8))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x2241ab(0x9e)},'claude':{'name':a3_0x2241ab(0x7f)}};
|
package/lib/ai-setup/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x51f940=a4_0x3d57;(function(_0x718f79,_0x5aeb06){const _0x15752b=a4_0x3d57,_0x4bdfe8=_0x718f79();while(!![]){try{const _0x3773bb=-parseInt(_0x15752b(0x10c))/0x1*(parseInt(_0x15752b(0xef))/0x2)+-parseInt(_0x15752b(0x11b))/0x3*(parseInt(_0x15752b(0x10a))/0x4)+parseInt(_0x15752b(0xd7))/0x5*(-parseInt(_0x15752b(0xdf))/0x6)+parseInt(_0x15752b(0x121))/0x7*(parseInt(_0x15752b(0xe6))/0x8)+parseInt(_0x15752b(0xf5))/0x9*(parseInt(_0x15752b(0x10e))/0xa)+-parseInt(_0x15752b(0xed))/0xb*(parseInt(_0x15752b(0xde))/0xc)+parseInt(_0x15752b(0x105))/0xd;if(_0x3773bb===_0x5aeb06)break;else _0x4bdfe8['push'](_0x4bdfe8['shift']());}catch(_0x2c7ab5){_0x4bdfe8['push'](_0x4bdfe8['shift']());}}}(a4_0x2876,0x74bf9));function a4_0x2876(){const _0x272d52=['\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','请手动执行:\x20','2.0.0','.lovrabet','99yJWgAt','LOVRABET_ENV','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','env','创建\x20Cursor\x20Rules\x20文件','lovrabet-dataset','log','error','parse','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','复制\x20Cursor\x20Rules\x20文件失败','\x20\x20AppCode:\x20','不支持的\x20MCP\x20IDE:\x20','isDirectory','创建\x20agents.md\x20文件','15440568HYPVPw','utf-8','info','cwd','rules','12zWMThs','mcpServers','2WrBGHy','manual','580660jXTjhK','map','Cursor','mcp-install','共享技能文件复制成功','\x20\x20}','npx','已写入\x20.cursor/mcp.json','创建技能包\x20manifest','复制\x20agents.md\x20文件失败','Claude\x20Code\x20MCP\x20命令已生成','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','\x20\x20\x20\x20}','715389jNWGee','mcp.json','\x22:\x20{','agents.md','name','.cursor','88018aCVOug','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','app','join','共享技能文件复制失败','message','stringify','\x20\x20\x20\x20\x22','appcode','85795qjvcqO','Claude\x20Code','配置信息:','Cursor\x20MCP\x20配置失败','Cursor\x20MCP\x20配置成功','cursor','已创建\x20','348FuhPzI','150coyfQh','../../cdn-source/skills','配置指引已显示','\x20-e\x20LOVRABET_APP_CODE=','.lovrabet/skill/.shared','需要先配置\x20appcode','skill-install','136BUTJxp','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','.lovrabet/skill-manifest.json','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','@lovrabet/dataset-mcp-server@latest','online','其他\x20IDE\x20配置指引已显示','18799ZrGbWd','success','368094FkLPOM','lovrabet_rules.mdc'];a4_0x2876=function(){return _0x272d52;};return a4_0x2876();}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';function a4_0x3d57(_0x2ebca1,_0x57d9a3){_0x2ebca1=_0x2ebca1-0xd1;const _0x287676=a4_0x2876();let _0x3d5780=_0x287676[_0x2ebca1];return _0x3d5780;}import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a4_0x51f940(0xfa),MCP_COMMAND=a4_0x51f940(0x114),MCP_ARGS=[a4_0x51f940(0xea)];export function buildEnvConfig(_0x47aed3,_0x5708a6){const _0x2c1479=a4_0x51f940,_0x4f9742={'LOVRABET_APP_CODE':String(_0x47aed3)};return _0x5708a6!==_0x2c1479(0xeb)&&(_0x4f9742[_0x2c1479(0xf6)]=String(_0x5708a6)),_0x4f9742;}export async function configureCursorMcp(_0x1c5ab8){const _0x2c62f3=a4_0x51f940,_0x55d51a=_0x1c5ab8||process[_0x2c62f3(0x108)](),_0x4d149e=readConfig(_0x55d51a),_0x3efbd7=_0x4d149e['appcode']||_0x4d149e[_0x2c62f3(0x123)],_0xa58114=_0x4d149e[_0x2c62f3(0xf8)]||'online';if(!_0x3efbd7)return{'ide':_0x2c62f3(0x110),'status':_0x2c62f3(0xfc),'message':_0x2c62f3(0xe4)};const _0x14eeb5=buildEnvConfig(_0x3efbd7,_0xa58114),_0x2ad869={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x14eeb5},_0x43bdb5=join(_0x55d51a,_0x2c62f3(0x120),_0x2c62f3(0x11c)),_0x2c4d4c=join(_0x55d51a,_0x2c62f3(0x120));try{!existsSync(_0x2c4d4c)&&mkdirSync(_0x2c4d4c,{'recursive':!![]});let _0x5f1911={'mcpServers':{}};if(existsSync(_0x43bdb5)){const _0x5ab731=readFileSync(_0x43bdb5,_0x2c62f3(0x106));_0x5f1911=JSON[_0x2c62f3(0xfd)](_0x5ab731);}return(!_0x5f1911[_0x2c62f3(0x10b)]||typeof _0x5f1911[_0x2c62f3(0x10b)]!=='object')&&(_0x5f1911[_0x2c62f3(0x10b)]={}),_0x5f1911[_0x2c62f3(0x10b)][MCP_SERVER_NAME]=_0x2ad869,writeFileSync(_0x43bdb5,JSON['stringify'](_0x5f1911,null,0x2),_0x2c62f3(0x106)),logger[_0x2c62f3(0x107)](_0x2c62f3(0x111),_0x2c62f3(0xdb),{'appcode':_0x3efbd7,'env':_0xa58114,'path':_0x43bdb5}),await copyCursorRules(_0x2c4d4c),{'ide':'Cursor','status':'success','message':_0x2c62f3(0x115)};}catch(_0x1f3018){return logger[_0x2c62f3(0xfc)](_0x2c62f3(0x111),_0x2c62f3(0xda),{'error':_0x1f3018 instanceof Error?_0x1f3018['message']:String(_0x1f3018)}),{'ide':_0x2c62f3(0x110),'status':_0x2c62f3(0xfc),'message':_0x1f3018 instanceof Error?_0x1f3018[_0x2c62f3(0xd3)]:String(_0x1f3018)};}}export async function configureClaudeMcp(_0x16d406){const _0x4d452b=a4_0x51f940,_0x35da94=_0x16d406||process[_0x4d452b(0x108)](),_0x5f3ab2=readConfig(_0x35da94),_0x461f56=_0x5f3ab2[_0x4d452b(0xd6)]||_0x5f3ab2['app'],_0x5f3416=_0x5f3ab2[_0x4d452b(0xf8)]||_0x4d452b(0xeb);if(!_0x461f56)return{'ide':_0x4d452b(0xd8),'status':'error','message':'需要先配置\x20appcode'};let _0x19b8ae='claude\x20mcp\x20add\x20'+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x4d452b(0xd1)]('\x20')+_0x4d452b(0xe2)+_0x461f56;return _0x5f3416!==_0x4d452b(0xeb)&&(_0x19b8ae+='\x20-e\x20LOVRABET_ENV='+_0x5f3416),await copyAgentsMd(_0x35da94),logger[_0x4d452b(0x107)](_0x4d452b(0x111),_0x4d452b(0x118),{'command':_0x19b8ae,'appcode':_0x461f56,'env':_0x5f3416}),console[_0x4d452b(0xfb)](_0x4d452b(0x119)),console[_0x4d452b(0xfb)]('\x20\x20'+_0x19b8ae+'\x0a'),console[_0x4d452b(0xfb)](_0x4d452b(0xd9)),console[_0x4d452b(0xfb)](_0x4d452b(0x101)+_0x461f56),_0x5f3416!=='online'&&console[_0x4d452b(0xfb)]('\x20\x20环境:\x20'+_0x5f3416),console[_0x4d452b(0xfb)](_0x4d452b(0xfe)),{'ide':'Claude\x20Code','status':_0x4d452b(0x10d),'message':_0x4d452b(0xf2)+_0x19b8ae};}export async function showOtherGuide(_0xb9889){const _0x1f5445=a4_0x51f940,_0x25b259=_0xb9889||process[_0x1f5445(0x108)](),_0x56b3c5=readConfig(_0x25b259),_0x1c368a=_0x56b3c5[_0x1f5445(0xd6)]||_0x56b3c5['app'],_0x4bafdd=_0x56b3c5[_0x1f5445(0xf8)]||_0x1f5445(0xeb);if(!_0x1c368a)return{'ide':'其他','status':_0x1f5445(0xfc),'message':_0x1f5445(0xe4)};return console['log'](_0x1f5445(0x122)),console[_0x1f5445(0xfb)]('{'),console[_0x1f5445(0xfb)]('\x20\x20\x22mcpServers\x22:\x20{'),console[_0x1f5445(0xfb)](_0x1f5445(0xd5)+MCP_SERVER_NAME+_0x1f5445(0x11d)),console[_0x1f5445(0xfb)](_0x1f5445(0xf1)+MCP_COMMAND+'\x22,'),console[_0x1f5445(0xfb)](_0x1f5445(0xe7)+MCP_ARGS[_0x1f5445(0x10f)](_0x46a98b=>'\x22'+_0x46a98b+'\x22')['join'](',\x20')+'],'),console[_0x1f5445(0xfb)](_0x1f5445(0xf7)),console[_0x1f5445(0xfb)](_0x1f5445(0xe9)+_0x1c368a+'\x22,'),_0x4bafdd!=='online'&&console['log'](_0x1f5445(0xff)+_0x4bafdd+'\x22,'),console[_0x1f5445(0xfb)]('\x20\x20\x20\x20\x20\x20}'),console[_0x1f5445(0xfb)](_0x1f5445(0x11a)),console[_0x1f5445(0xfb)](_0x1f5445(0x113)),console[_0x1f5445(0xfb)]('}\x0a'),logger[_0x1f5445(0x107)]('mcp-install',_0x1f5445(0xec),{'appcode':_0x1c368a,'env':_0x4bafdd}),{'ide':'其他','status':_0x1f5445(0x10d),'message':_0x1f5445(0xe1)};}export async function configureMcp(_0x8586bf,_0x29e61f){const _0x1afbdd=a4_0x51f940;switch(_0x8586bf){case _0x1afbdd(0xdc):return await configureCursorMcp(_0x29e61f);case'claude':return await configureClaudeMcp(_0x29e61f);default:throw new Error(_0x1afbdd(0x102)+_0x8586bf);}}async function copyCursorRules(_0xf6cc8c){const _0x21a9f6=a4_0x51f940,_0x277b85=join(_0xf6cc8c,_0x21a9f6(0x109)),_0x38909f=join(_0x277b85,_0x21a9f6(0xf0));if(existsSync(_0x38909f))return;try{!existsSync(_0x277b85)&&mkdirSync(_0x277b85,{'recursive':!![]});const _0x206a18=await getRulesContent();writeFileSync(_0x38909f,_0x206a18,_0x21a9f6(0x106)),logger[_0x21a9f6(0x107)]('mcp-install',_0x21a9f6(0xf9),{'to':_0x38909f});}catch(_0x2a0c80){logger['error']('mcp-install',_0x21a9f6(0x100),{'error':_0x2a0c80 instanceof Error?_0x2a0c80[_0x21a9f6(0xd3)]:String(_0x2a0c80)});}}async function copyAgentsMd(_0x33315d){const _0x55f255=a4_0x51f940,_0x9b3048=join(_0x33315d,_0x55f255(0x11e));if(existsSync(_0x9b3048))return;try{const _0x1c6d1e=await getRulesContent();writeFileSync(_0x9b3048,_0x1c6d1e,_0x55f255(0x106)),logger[_0x55f255(0x107)]('mcp-install',_0x55f255(0x104),{'to':_0x9b3048});}catch(_0x70cbfc){logger[_0x55f255(0xfc)](_0x55f255(0x111),_0x55f255(0x117),{'error':_0x70cbfc instanceof Error?_0x70cbfc['message']:String(_0x70cbfc)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x169ccf,_0x1e77bc){const _0x4020f7=a4_0x51f940,_0x53a33f=_0x1e77bc||process[_0x4020f7(0x108)](),_0x35ae02=resolve(__dirname,_0x4020f7(0xe0)),_0x2d50fe=SKILL_IDE_CONFIGS[_0x169ccf];if(!_0x2d50fe)return{'ide':_0x169ccf,'status':_0x4020f7(0xfc),'message':'未知的\x20IDE:\x20'+_0x169ccf};const _0x5326f7=_0x2d50fe[_0x4020f7(0x11f)];try{let _0x186dca;try{_0x186dca=await fetchGuidesFromCDN();}catch{}const _0x4df3d8=await installSingleIDE(_0x169ccf,_0x2d50fe,_0x53a33f,_0x35ae02,_0x186dca);return _0x186dca&&writeGuidesToProject(_0x186dca,_0x53a33f),logger['info'](_0x4020f7(0xe5),_0x5326f7+'\x20技能包安装成功',{'ide':_0x169ccf,'filesCount':_0x4df3d8}),{'ide':_0x5326f7,'status':_0x4020f7(0xee),'message':_0x4020f7(0xdd)+_0x4df3d8+'\x20项'};}catch(_0x26b2c6){return logger['error']('skill-install',_0x5326f7+'\x20技能包安装失败',{'error':_0x26b2c6 instanceof Error?_0x26b2c6['message']:String(_0x26b2c6)}),{'ide':_0x5326f7,'status':_0x4020f7(0xfc),'message':_0x26b2c6 instanceof Error?_0x26b2c6[_0x4020f7(0xd3)]:String(_0x26b2c6)};}}async function copyDir(_0x96e42b,_0x30671a){const _0x335f25=a4_0x51f940,{statSync:_0x499c8b}=await import('node:fs'),{readdirSync:_0x2f4797}=await import('node:fs'),_0x36efc5=_0x499c8b(_0x96e42b);if(_0x36efc5[_0x335f25(0x103)]()){!existsSync(_0x30671a)&&mkdirSync(_0x30671a,{'recursive':!![]});const _0x352ea5=_0x2f4797(_0x96e42b);for(const _0x36c7c4 of _0x352ea5){await copyDir(join(_0x96e42b,_0x36c7c4),join(_0x30671a,_0x36c7c4));}}else copyFileSync(_0x96e42b,_0x30671a);}export async function copySharedSkills(_0x6a5c54){const _0x4a341c=a4_0x51f940,_0x1e9dbb=_0x6a5c54||process[_0x4a341c(0x108)](),_0x5462fb=resolve(__dirname,'../../cdn-source/skills'),_0x152d82=join(_0x5462fb,'.shared'),_0x3fd72f=join(_0x1e9dbb,_0x4a341c(0xe3));if(!existsSync(_0x152d82))return![];try{return await copyDir(_0x152d82,_0x3fd72f),logger['info']('skill-install',_0x4a341c(0x112),{'path':_0x3fd72f}),!![];}catch(_0x19ce65){return logger[_0x4a341c(0xfc)](_0x4a341c(0xe5),_0x4a341c(0xd2),{'error':_0x19ce65 instanceof Error?_0x19ce65[_0x4a341c(0xd3)]:String(_0x19ce65)}),![];}}export function createSkillManifest(_0x2c8f42,_0x1af344){const _0x35e7c8=a4_0x51f940,_0x506df5={'version':_0x35e7c8(0xf3),'installedAt':new Date()['toISOString'](),'platforms':_0x1af344},_0xd30a8=join(_0x2c8f42,_0x35e7c8(0xe8)),_0x43d993=join(_0x2c8f42,_0x35e7c8(0xf4));!existsSync(_0x43d993)&&mkdirSync(_0x43d993,{'recursive':!![]}),writeFileSync(_0xd30a8,JSON[_0x35e7c8(0xd4)](_0x506df5,null,0x2),'utf-8'),logger[_0x35e7c8(0x107)]('skill-install',_0x35e7c8(0x116),{'path':_0xd30a8});}
|
|
1
|
+
const a4_0x103241=a4_0x467f;(function(_0x5e5c56,_0x400f38){const _0xb5b7e5=a4_0x467f,_0x5d24c8=_0x5e5c56();while(!![]){try{const _0x378686=-parseInt(_0xb5b7e5(0xd7))/0x1*(-parseInt(_0xb5b7e5(0xc6))/0x2)+-parseInt(_0xb5b7e5(0xdb))/0x3*(-parseInt(_0xb5b7e5(0xff))/0x4)+-parseInt(_0xb5b7e5(0xc4))/0x5+-parseInt(_0xb5b7e5(0xfa))/0x6+-parseInt(_0xb5b7e5(0xd9))/0x7+-parseInt(_0xb5b7e5(0xcb))/0x8*(-parseInt(_0xb5b7e5(0x106))/0x9)+parseInt(_0xb5b7e5(0xfd))/0xa;if(_0x378686===_0x400f38)break;else _0x5d24c8['push'](_0x5d24c8['shift']());}catch(_0x3c09dd){_0x5d24c8['push'](_0x5d24c8['shift']());}}}(a4_0x3298,0x9949c));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a4_0x103241(0xc5),MCP_COMMAND='npx',MCP_ARGS=[a4_0x103241(0x104)];export function buildEnvConfig(_0x4fefc1,_0x4408ac){const _0x405e3=a4_0x103241,_0x20aa28={'LOVRABET_APP_CODE':String(_0x4fefc1)};return _0x4408ac!==_0x405e3(0xf3)&&(_0x20aa28[_0x405e3(0xeb)]=String(_0x4408ac)),_0x20aa28;}export async function configureCursorMcp(_0x540b3f){const _0x194b9e=a4_0x103241,_0x380815=_0x540b3f||process[_0x194b9e(0xea)](),_0x372c0b=readConfig(_0x380815),_0x142e8d=_0x372c0b[_0x194b9e(0xce)]||_0x372c0b[_0x194b9e(0xe4)],_0x3eba2e=_0x372c0b[_0x194b9e(0xf8)]||_0x194b9e(0xf3);if(!_0x142e8d)return{'ide':_0x194b9e(0x108),'status':_0x194b9e(0xda),'message':_0x194b9e(0xe9)};const _0x50d5be=buildEnvConfig(_0x142e8d,_0x3eba2e),_0x2f3545={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x50d5be},_0x496a4d=join(_0x380815,_0x194b9e(0xe1),_0x194b9e(0xe0)),_0x41ab8c=join(_0x380815,_0x194b9e(0xe1));try{!existsSync(_0x41ab8c)&&mkdirSync(_0x41ab8c,{'recursive':!![]});let _0x516d57={'mcpServers':{}};if(existsSync(_0x496a4d)){const _0x3886a0=readFileSync(_0x496a4d,'utf-8');_0x516d57=JSON[_0x194b9e(0xed)](_0x3886a0);}return(!_0x516d57[_0x194b9e(0xfb)]||typeof _0x516d57[_0x194b9e(0xfb)]!=='object')&&(_0x516d57['mcpServers']={}),_0x516d57[_0x194b9e(0xfb)][MCP_SERVER_NAME]=_0x2f3545,writeFileSync(_0x496a4d,JSON[_0x194b9e(0xe6)](_0x516d57,null,0x2),_0x194b9e(0xd3)),logger[_0x194b9e(0xf9)]('mcp-install',_0x194b9e(0x105),{'appcode':_0x142e8d,'env':_0x3eba2e,'path':_0x496a4d}),await copyCursorRules(_0x41ab8c),{'ide':'Cursor','status':_0x194b9e(0xca),'message':_0x194b9e(0xcc)};}catch(_0x46f791){return logger['error'](_0x194b9e(0x10a),_0x194b9e(0xc7),{'error':_0x46f791 instanceof Error?_0x46f791[_0x194b9e(0xd2)]:String(_0x46f791)}),{'ide':'Cursor','status':_0x194b9e(0xda),'message':_0x46f791 instanceof Error?_0x46f791[_0x194b9e(0xd2)]:String(_0x46f791)};}}export async function configureClaudeMcp(_0x5b24e2){const _0x1d41cf=a4_0x103241,_0x1f1c2e=_0x5b24e2||process[_0x1d41cf(0xea)](),_0x2134fa=readConfig(_0x1f1c2e),_0x16d51b=_0x2134fa[_0x1d41cf(0xce)]||_0x2134fa['app'],_0x26966d=_0x2134fa['env']||_0x1d41cf(0xf3);if(!_0x16d51b)return{'ide':'Claude\x20Code','status':'error','message':_0x1d41cf(0xe9)};let _0x1df26a=_0x1d41cf(0x107)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x1d41cf(0xe2)]('\x20')+'\x20-e\x20LOVRABET_APP_CODE='+_0x16d51b;return _0x26966d!==_0x1d41cf(0xf3)&&(_0x1df26a+=_0x1d41cf(0xf7)+_0x26966d),await copyAgentsMd(_0x1f1c2e),logger[_0x1d41cf(0xf9)](_0x1d41cf(0x10a),_0x1d41cf(0x109),{'command':_0x1df26a,'appcode':_0x16d51b,'env':_0x26966d}),console[_0x1d41cf(0xc9)](_0x1d41cf(0x100)),console[_0x1d41cf(0xc9)]('\x20\x20'+_0x1df26a+'\x0a'),console[_0x1d41cf(0xc9)]('配置信息:'),console[_0x1d41cf(0xc9)]('\x20\x20AppCode:\x20'+_0x16d51b),_0x26966d!==_0x1d41cf(0xf3)&&console[_0x1d41cf(0xc9)]('\x20\x20环境:\x20'+_0x26966d),console[_0x1d41cf(0xc9)](_0x1d41cf(0xee)),{'ide':_0x1d41cf(0xf2),'status':_0x1d41cf(0xe5),'message':_0x1d41cf(0xf6)+_0x1df26a};}function a4_0x3298(){const _0x5f2d86=['1464YFeKSL','已写入\x20.cursor/mcp.json','../../cdn-source/skills','appcode','cursor','node:fs','不支持的\x20MCP\x20IDE:\x20','message','utf-8','复制\x20agents.md\x20文件失败','\x20\x20}','toISOString','9287OHzJwJ','rules','3637662MKruJA','error','4965Rhettv','\x20技能包安装失败','\x20\x20\x20\x20}','其他\x20IDE\x20配置指引已显示','.lovrabet/skill/.shared','mcp.json','.cursor','join','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','app','manual','stringify','name','未知的\x20IDE:\x20','需要先配置\x20appcode','cwd','LOVRABET_ENV','skill-install','parse','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','\x20技能包安装成功','\x20\x20\x20\x20\x22','Claude\x20Code','online','lovrabet_rules.mdc','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','请手动执行:\x20','\x20-e\x20LOVRABET_ENV=','env','info','1405056CerJjV','mcpServers','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','2613760pqSvPF','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','1708YPknaR','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','已创建\x20','创建技能包\x20manifest','复制\x20Cursor\x20Rules\x20文件失败','@lovrabet/dataset-mcp-server@latest','Cursor\x20MCP\x20配置成功','27225sPkmYU','claude\x20mcp\x20add\x20','Cursor','Claude\x20Code\x20MCP\x20命令已生成','mcp-install','isDirectory','2.0.0','.shared','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','\x20\x20\x20\x20\x20\x20}','2835640ZAPAhP','lovrabet-dataset','92wiNUSV','Cursor\x20MCP\x20配置失败','claude','log','success'];a4_0x3298=function(){return _0x5f2d86;};return a4_0x3298();}export async function showOtherGuide(_0x52944b){const _0x507da3=a4_0x103241,_0x176c34=_0x52944b||process[_0x507da3(0xea)](),_0x598085=readConfig(_0x176c34),_0x2f9457=_0x598085[_0x507da3(0xce)]||_0x598085[_0x507da3(0xe4)],_0x624a8f=_0x598085[_0x507da3(0xf8)]||'online';if(!_0x2f9457)return{'ide':'其他','status':_0x507da3(0xda),'message':_0x507da3(0xe9)};return console['log'](_0x507da3(0xf5)),console[_0x507da3(0xc9)]('{'),console['log']('\x20\x20\x22mcpServers\x22:\x20{'),console['log'](_0x507da3(0xf1)+MCP_SERVER_NAME+'\x22:\x20{'),console['log'](_0x507da3(0xc2)+MCP_COMMAND+'\x22,'),console[_0x507da3(0xc9)](_0x507da3(0xfc)+MCP_ARGS['map'](_0x5e786b=>'\x22'+_0x5e786b+'\x22')[_0x507da3(0xe2)](',\x20')+'],'),console[_0x507da3(0xc9)](_0x507da3(0xef)),console[_0x507da3(0xc9)](_0x507da3(0xe3)+_0x2f9457+'\x22,'),_0x624a8f!=='online'&&console['log'](_0x507da3(0xfe)+_0x624a8f+'\x22,'),console[_0x507da3(0xc9)](_0x507da3(0xc3)),console[_0x507da3(0xc9)](_0x507da3(0xdd)),console[_0x507da3(0xc9)](_0x507da3(0xd5)),console[_0x507da3(0xc9)]('}\x0a'),logger[_0x507da3(0xf9)]('mcp-install',_0x507da3(0xde),{'appcode':_0x2f9457,'env':_0x624a8f}),{'ide':'其他','status':_0x507da3(0xe5),'message':'配置指引已显示'};}function a4_0x467f(_0x1fac51,_0x21da78){_0x1fac51=_0x1fac51-0xc2;const _0x329832=a4_0x3298();let _0x467fc8=_0x329832[_0x1fac51];return _0x467fc8;}export async function configureMcp(_0x193836,_0x54f45b){const _0x7846b3=a4_0x103241;switch(_0x193836){case _0x7846b3(0xcf):return await configureCursorMcp(_0x54f45b);case _0x7846b3(0xc8):return await configureClaudeMcp(_0x54f45b);default:throw new Error(_0x7846b3(0xd1)+_0x193836);}}async function copyCursorRules(_0xfec8a5){const _0x31eb42=a4_0x103241,_0x16d81b=join(_0xfec8a5,_0x31eb42(0xd8)),_0x1fced1=join(_0x16d81b,_0x31eb42(0xf4));if(existsSync(_0x1fced1))return;try{!existsSync(_0x16d81b)&&mkdirSync(_0x16d81b,{'recursive':!![]});const _0x201a35=await getRulesContent();writeFileSync(_0x1fced1,_0x201a35,_0x31eb42(0xd3)),logger[_0x31eb42(0xf9)](_0x31eb42(0x10a),'创建\x20Cursor\x20Rules\x20文件',{'to':_0x1fced1});}catch(_0x26c977){logger[_0x31eb42(0xda)]('mcp-install',_0x31eb42(0x103),{'error':_0x26c977 instanceof Error?_0x26c977[_0x31eb42(0xd2)]:String(_0x26c977)});}}async function copyAgentsMd(_0x53f795){const _0xc5fac7=a4_0x103241,_0x49168f=join(_0x53f795,'agents.md');if(existsSync(_0x49168f))return;try{const _0x240324=await getRulesContent();writeFileSync(_0x49168f,_0x240324,_0xc5fac7(0xd3)),logger['info']('mcp-install','创建\x20agents.md\x20文件',{'to':_0x49168f});}catch(_0x279865){logger[_0xc5fac7(0xda)]('mcp-install',_0xc5fac7(0xd4),{'error':_0x279865 instanceof Error?_0x279865[_0xc5fac7(0xd2)]:String(_0x279865)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x55d274,_0x16a527){const _0x249b87=a4_0x103241,_0xe36e59=_0x16a527||process[_0x249b87(0xea)](),_0x5a426c=resolve(__dirname,'../../cdn-source/skills'),_0x4476e0=SKILL_IDE_CONFIGS[_0x55d274];if(!_0x4476e0)return{'ide':_0x55d274,'status':'error','message':_0x249b87(0xe8)+_0x55d274};const _0x3ad496=_0x4476e0[_0x249b87(0xe7)];try{let _0x2f062b;try{_0x2f062b=await fetchGuidesFromCDN();}catch{}const _0x750e32=await installSingleIDE(_0x55d274,_0x4476e0,_0xe36e59,_0x5a426c,_0x2f062b);return _0x2f062b&&writeGuidesToProject(_0x2f062b,_0xe36e59),logger[_0x249b87(0xf9)](_0x249b87(0xec),_0x3ad496+_0x249b87(0xf0),{'ide':_0x55d274,'filesCount':_0x750e32}),{'ide':_0x3ad496,'status':_0x249b87(0xca),'message':_0x249b87(0x101)+_0x750e32+'\x20项'};}catch(_0x1bf2cb){return logger[_0x249b87(0xda)](_0x249b87(0xec),_0x3ad496+_0x249b87(0xdc),{'error':_0x1bf2cb instanceof Error?_0x1bf2cb[_0x249b87(0xd2)]:String(_0x1bf2cb)}),{'ide':_0x3ad496,'status':_0x249b87(0xda),'message':_0x1bf2cb instanceof Error?_0x1bf2cb[_0x249b87(0xd2)]:String(_0x1bf2cb)};}}async function copyDir(_0xd5a210,_0x320bab){const _0x178d42=a4_0x103241,{statSync:_0x45af9a}=await import(_0x178d42(0xd0)),{readdirSync:_0x3f9fe8}=await import(_0x178d42(0xd0)),_0x4d32d5=_0x45af9a(_0xd5a210);if(_0x4d32d5[_0x178d42(0x10b)]()){!existsSync(_0x320bab)&&mkdirSync(_0x320bab,{'recursive':!![]});const _0x886fb0=_0x3f9fe8(_0xd5a210);for(const _0x5f3ed8 of _0x886fb0){await copyDir(join(_0xd5a210,_0x5f3ed8),join(_0x320bab,_0x5f3ed8));}}else copyFileSync(_0xd5a210,_0x320bab);}export async function copySharedSkills(_0x192c42){const _0x13c01a=a4_0x103241,_0x2a1d96=_0x192c42||process['cwd'](),_0x592954=resolve(__dirname,_0x13c01a(0xcd)),_0xdc98f2=join(_0x592954,_0x13c01a(0x10d)),_0x543399=join(_0x2a1d96,_0x13c01a(0xdf));if(!existsSync(_0xdc98f2))return![];try{return await copyDir(_0xdc98f2,_0x543399),logger[_0x13c01a(0xf9)]('skill-install','共享技能文件复制成功',{'path':_0x543399}),!![];}catch(_0x31d342){return logger[_0x13c01a(0xda)](_0x13c01a(0xec),'共享技能文件复制失败',{'error':_0x31d342 instanceof Error?_0x31d342[_0x13c01a(0xd2)]:String(_0x31d342)}),![];}}export function createSkillManifest(_0x5da0c8,_0x1fde78){const _0x5a936e=a4_0x103241,_0x3ae6fb={'version':_0x5a936e(0x10c),'installedAt':new Date()[_0x5a936e(0xd6)](),'platforms':_0x1fde78},_0x481897=join(_0x5da0c8,'.lovrabet/skill-manifest.json'),_0x5212f0=join(_0x5da0c8,'.lovrabet');!existsSync(_0x5212f0)&&mkdirSync(_0x5212f0,{'recursive':!![]}),writeFileSync(_0x481897,JSON[_0x5a936e(0xe6)](_0x3ae6fb,null,0x2),'utf-8'),logger['info'](_0x5a936e(0xec),_0x5a936e(0x102),{'path':_0x481897});}
|
package/lib/api/api-doc-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5b5277,_0x3d7be5){const _0x1c2dd5=a5_0x2834,_0x57b16a=_0x5b5277();while(!![]){try{const _0x5a58ac=-parseInt(_0x1c2dd5(0x126))/0x1+parseInt(_0x1c2dd5(0x14f))/0x2*(-parseInt(_0x1c2dd5(0x139))/0x3)+-parseInt(_0x1c2dd5(0x13c))/0x4*(parseInt(_0x1c2dd5(0x13d))/0x5)+-parseInt(_0x1c2dd5(0x120))/0x6*(parseInt(_0x1c2dd5(0x135))/0x7)+-parseInt(_0x1c2dd5(0x128))/0x8+-parseInt(_0x1c2dd5(0x14a))/0x9+parseInt(_0x1c2dd5(0x142))/0xa*(parseInt(_0x1c2dd5(0x136))/0xb);if(_0x5a58ac===_0x3d7be5)break;else _0x57b16a['push'](_0x57b16a['shift']());}catch(_0x5420e6){_0x57b16a['push'](_0x57b16a['shift']());}}}(a5_0x1993,0x856cb));import{jsx as a5_0x7cb958,jsxs as a5_0x15f24b,Fragment as a5_0x1bfa9f}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';function a5_0x2834(_0x493482,_0x348f0d){_0x493482=_0x493482-0x11a;const _0x19936f=a5_0x1993();let _0x283475=_0x19936f[_0x493482];return _0x283475;}import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';function a5_0x1993(){const _0x307d63=['730wFwkYl','error','指定的数据集代码都不存在:\x20','dim','\x1b[33m!\x20以下数据集代码不存在:\x20','\x20-\x20','join','success','4495617aQlyac','文档生成失败:\x20','gray','log','red','3108mGGpdw','*\x20生成的文档文件:','string','white','map','online','使用指定的应用AppCode:\x20','env','\x20个匹配的数据集\x1b[0m','column','lovrabet\x20auth','🚀\x20','\x20个数据集','6OpmUqD','length','\x1b[0m','💡\x20请使用\x20','\x1b[90m*\x20从\x20','yellow','290920CxFgmR','api-doc','2758168CuoSnS','green','正在生成\x20',',\x20失败\x20','includes','\x20(环境:\x20','cyan','./docs','filter','\x20个数据集的文档...','datasetName','文档生成完成','√\x20文档生成完成!成功\x20','1535723bmDPVI','483868iQKbuK','cwd','setLogPath','744pcneTN','正在获取数据集列表...','使用配置的应用AppCode:\x20','45104KppmEV','410ZJkiiP','filePath','message','.md\x20(','\x20重新登录后再试'];a5_0x1993=function(){return _0x307d63;};return a5_0x1993();}export const ApiDocUI=({appCode:_0x5364a6,env:_0x38a635,output:_0x18764e,extraParams:_0x489911,datasetCodes:_0x1c5870})=>{const _0x3bb2ec=a5_0x2834,{exit:_0x145988}=useApp(),[_0x20ea1d,_0x237382]=useState(![]),[_0x59f601,_0x42cc22]=useState(''),[_0x2b3c3f,_0x246b3a]=useState(![]),[_0x4eb616,_0x365a8e]=useState(null),[_0x572bed,_0x4abaf1]=useState(null),[_0x1bcf1d,_0x309c19]=useState(0x0),_0x4d0f09=readConfig(),_0x7628dd=getConfigAppCode(),_0x58fd54=_0x5364a6||_0x7628dd,_0x2c9379=typeof _0x4d0f09?.[_0x3bb2ec(0x11a)]===_0x3bb2ec(0x151)?_0x4d0f09[_0x3bb2ec(0x11a)]:undefined,_0xcdff8c=_0x38a635||_0x2c9379||_0x3bb2ec(0x154);initEnv(_0xcdff8c);const _0x16a5ed=_0x18764e||_0x3bb2ec(0x12f),_0x15efb9=_0x5364a6?_0x3bb2ec(0x155)+_0x58fd54:_0x3bb2ec(0x13b)+_0x58fd54;useEffect(()=>{_0x237382(!![]),_0x4ae7a2();},[]),useEffect(()=>{(_0x2b3c3f||_0x4eb616)&&_0x145988();},[_0x2b3c3f,_0x4eb616,_0x145988]);async function _0x4ae7a2(){const _0x232c6b=_0x3bb2ec;if(!_0x58fd54){_0x365a8e('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x232c6b(0x138)](process[_0x232c6b(0x137)]()),_0x42cc22(_0x232c6b(0x13a));const {configArray:_0x279c53}=await fetchModelList(_0x58fd54);_0x309c19(_0x279c53[_0x232c6b(0x121)]);if(_0x279c53['length']===0x0){_0x365a8e('未找到任何数据集');return;}let _0x158190=_0x279c53;if(_0x1c5870&&_0x1c5870[_0x232c6b(0x121)]>0x0){_0x158190=_0x279c53[_0x232c6b(0x130)](_0x3d5cca=>_0x1c5870[_0x232c6b(0x12c)](_0x3d5cca['datasetCode']));const _0x47f767=_0x158190[_0x232c6b(0x153)](_0x426477=>_0x426477['datasetCode']),_0x453ab9=_0x1c5870[_0x232c6b(0x130)](_0x18a120=>!_0x47f767['includes'](_0x18a120));_0x453ab9['length']>0x0&&console[_0x232c6b(0x14d)](_0x232c6b(0x146)+_0x453ab9[_0x232c6b(0x148)](',\x20')+_0x232c6b(0x122));if(_0x158190[_0x232c6b(0x121)]===0x0){_0x365a8e(_0x232c6b(0x144)+_0x1c5870['join'](',\x20'));return;}console[_0x232c6b(0x14d)](_0x232c6b(0x124)+_0x279c53['length']+'\x20个数据集中筛选出\x20'+_0x158190[_0x232c6b(0x121)]+_0x232c6b(0x11b));}_0x42cc22(_0x232c6b(0x12a)+_0x158190[_0x232c6b(0x121)]+_0x232c6b(0x131));const _0x2ae7a6=await generateDatasetDocs(_0x158190,_0x58fd54,_0x16a5ed,(_0x17aac6,_0x92f5d0,_0x3ef2e8)=>{const _0x13f970=_0x232c6b;_0x42cc22(_0x13f970(0x12a)+_0x3ef2e8+_0x13f970(0x140)+_0x17aac6+'/'+_0x92f5d0+')');},_0x489911);_0x4abaf1(_0x2ae7a6),_0x246b3a(!![]);const _0x1cbaa7=_0x2ae7a6[_0x232c6b(0x130)](_0x19318b=>_0x19318b[_0x232c6b(0x149)])['length'],_0x55a8b1=_0x2ae7a6[_0x232c6b(0x130)](_0x538e2e=>!_0x538e2e['success'])[_0x232c6b(0x121)];logger['success'](_0x232c6b(0x127),_0x232c6b(0x133),undefined,{'totalCount':_0x2ae7a6['length'],'successCount':_0x1cbaa7,'failCount':_0x55a8b1,'outputDir':_0x16a5ed});}catch(_0x3b3858){const _0x53c85c=_0x3b3858 instanceof Error?_0x3b3858[_0x232c6b(0x13f)]:String(_0x3b3858);logger[_0x232c6b(0x143)](_0x232c6b(0x127),'文档生成失败:\x20'+_0x53c85c,{'appCode':_0x58fd54,'outputDir':_0x16a5ed}),_0x365a8e(_0x232c6b(0x14b)+_0x53c85c);}finally{_0x237382(![]);}}const _0x1cc1a8=_0x572bed?.['filter'](_0x2e2363=>_0x2e2363[_0x3bb2ec(0x149)])['length']||0x0,_0x47c4d4=_0x572bed?.[_0x3bb2ec(0x130)](_0xc74da0=>!_0xc74da0['success'])['length']||0x0;return a5_0x15f24b(Box,{'flexDirection':_0x3bb2ec(0x11c),'children':[(_0x20ea1d||_0x2b3c3f)&&a5_0x15f24b(Box,{'children':[a5_0x7cb958(Text,{'color':_0x3bb2ec(0x14c),'children':'*\x20'}),a5_0x7cb958(Text,{'color':_0x5364a6?_0x3bb2ec(0x152):_0x3bb2ec(0x145),'children':_0x15efb9})]}),_0x20ea1d&&a5_0x7cb958(Box,{'children':a5_0x15f24b(Text,{'children':[_0x3bb2ec(0x11e),_0x59f601,_0x3bb2ec(0x12d),_0xcdff8c,')']})}),_0x2b3c3f&&_0x572bed&&a5_0x15f24b(Box,{'flexDirection':'column','children':[a5_0x7cb958(Box,{'children':a5_0x15f24b(Text,{'color':_0x3bb2ec(0x129),'children':[_0x3bb2ec(0x134),_0x1cc1a8,'\x20个',_0x47c4d4>0x0&&_0x3bb2ec(0x12b)+_0x47c4d4+'\x20个']})}),a5_0x7cb958(Box,{'marginTop':0x1,'children':a5_0x15f24b(Text,{'color':_0x3bb2ec(0x14c),'children':['*\x20共处理\x20',_0x1bcf1d,_0x3bb2ec(0x11f)]})}),a5_0x15f24b(Box,{'marginTop':0x1,'children':[a5_0x7cb958(Text,{'color':_0x3bb2ec(0x14c),'children':'*\x20输出目录:\x20'}),a5_0x7cb958(Text,{'color':_0x3bb2ec(0x12e),'children':_0x16a5ed})]}),_0x1cc1a8>0x0&&a5_0x15f24b(a5_0x1bfa9f,{'children':[a5_0x7cb958(Box,{'marginTop':0x1,'children':a5_0x7cb958(Text,{'color':_0x3bb2ec(0x14c),'children':_0x3bb2ec(0x150)})}),_0x572bed[_0x3bb2ec(0x130)](_0x1d783e=>_0x1d783e['success'])['map']((_0x5aaa9a,_0xed11a7)=>a5_0x15f24b(Box,{'marginLeft':0x2,'children':[a5_0x15f24b(Text,{'color':_0x3bb2ec(0x12e),'children':['•\x20',_0x5aaa9a[_0x3bb2ec(0x13e)]]}),a5_0x15f24b(Text,{'color':_0x3bb2ec(0x145),'children':[_0x3bb2ec(0x147),_0x5aaa9a[_0x3bb2ec(0x132)]]})]},_0xed11a7))]}),_0x47c4d4>0x0&&a5_0x15f24b(a5_0x1bfa9f,{'children':[a5_0x7cb958(Box,{'marginTop':0x1,'children':a5_0x7cb958(Text,{'color':_0x3bb2ec(0x125),'children':'⚠️\x20以下数据集生成失败:'})}),_0x572bed[_0x3bb2ec(0x130)](_0x26e64a=>!_0x26e64a[_0x3bb2ec(0x149)])[_0x3bb2ec(0x153)]((_0x57c11c,_0x19cd18)=>a5_0x15f24b(Box,{'marginLeft':0x2,'flexDirection':_0x3bb2ec(0x11c),'children':[a5_0x15f24b(Text,{'color':'red','children':['•\x20',_0x57c11c['datasetName'],'\x20(',_0x57c11c['datasetCode'],')']}),_0x57c11c[_0x3bb2ec(0x143)]&&a5_0x7cb958(Box,{'marginLeft':0x2,'children':a5_0x7cb958(Text,{'color':_0x3bb2ec(0x145),'children':_0x57c11c[_0x3bb2ec(0x143)]})})]},_0x19cd18))]})]}),_0x4eb616&&a5_0x15f24b(Box,{'flexDirection':_0x3bb2ec(0x11c),'children':[a5_0x7cb958(Box,{'children':a5_0x15f24b(Text,{'color':_0x3bb2ec(0x14e),'children':['❌\x20',_0x4eb616]})}),_0x4eb616[_0x3bb2ec(0x12c)]('登录')&&a5_0x15f24b(Box,{'marginTop':0x1,'children':[a5_0x7cb958(Text,{'color':'yellow','children':_0x3bb2ec(0x123)}),a5_0x7cb958(Text,{'color':_0x3bb2ec(0x12e),'children':_0x3bb2ec(0x11d)}),a5_0x7cb958(Text,{'color':_0x3bb2ec(0x125),'children':_0x3bb2ec(0x141)})]})]})]});};
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x5b3e2f=a6_0x5c1e;(function(_0x4e4a71,_0x24b9f0){const _0x58e90d=a6_0x5c1e,_0x314bb2=_0x4e4a71();while(!![]){try{const _0x3b5a0c=-parseInt(_0x58e90d(0x19e))/0x1+-parseInt(_0x58e90d(0x1bc))/0x2*(parseInt(_0x58e90d(0x1ac))/0x3)+-parseInt(_0x58e90d(0x1bf))/0x4*(-parseInt(_0x58e90d(0x1b5))/0x5)+-parseInt(_0x58e90d(0x1a0))/0x6*(-parseInt(_0x58e90d(0x1b6))/0x7)+-parseInt(_0x58e90d(0x1ab))/0x8+parseInt(_0x58e90d(0x1b1))/0x9*(-parseInt(_0x58e90d(0x19f))/0xa)+parseInt(_0x58e90d(0x19b))/0xb;if(_0x3b5a0c===_0x24b9f0)break;else _0x314bb2['push'](_0x314bb2['shift']());}catch(_0x43ccd0){_0x314bb2['push'](_0x314bb2['shift']());}}}(a6_0x7dc2,0x195f6));function a6_0x5c1e(_0x16a272,_0x3c9f24){_0x16a272=_0x16a272-0x199;const _0x7dc2a2=a6_0x7dc2();let _0x5c1ef0=_0x7dc2a2[_0x16a272];return _0x5c1ef0;}import{mkdirSync,writeFileSync}from'node:fs';import a6_0x1749ef from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x21aa16){const _0x5dd7e8=a6_0x5c1e,{appCode:_0x15fe94,datasetCode:_0x424b02,datasetId:_0x451938,extraParams:_0x367f74}=_0x21aa16,_0x10a52d=getApiDomain(),_0x23e2c9=_0x10a52d+_0x5dd7e8(0x19a),_0x28f269={'appCode':_0x15fe94,'datasetCode':_0x424b02,'datasetId':_0x451938,..._0x367f74||{}},_0x2af802=await fetch(_0x23e2c9,{'method':_0x5dd7e8(0x1ad),'headers':{'Content-Type':_0x5dd7e8(0x1c2),'Cookie':getCookie()},'body':JSON[_0x5dd7e8(0x1af)](_0x28f269)});if(!_0x2af802['ok']){if(_0x2af802['status']===0x191)throw new Error(_0x5dd7e8(0x1a9));let _0x87ccbf='';try{_0x87ccbf=await _0x2af802[_0x5dd7e8(0x19d)]();}catch(_0x21756f){}throw new Error(_0x5dd7e8(0x1a3)+_0x424b02+_0x5dd7e8(0x1a7)+_0x2af802[_0x5dd7e8(0x1a6)]+(_0x87ccbf?'\x0a'+_0x87ccbf:''));}const _0x53a387=await _0x2af802[_0x5dd7e8(0x199)]();if(!_0x53a387[_0x5dd7e8(0x1b7)]||typeof _0x53a387[_0x5dd7e8(0x1b7)][_0x5dd7e8(0x1a1)]!==_0x5dd7e8(0x1c4))throw new Error(_0x5dd7e8(0x1a8)+_0x424b02+_0x5dd7e8(0x19c));return _0x53a387['data'][_0x5dd7e8(0x1a1)];}function a6_0x7dc2(){const _0x21f2b9=['datasetCode','name','361516UiNGny','✗\x20失败:\x20','\x20个数据集需要生成文档\x0a','88FYuVvv','join','./docs','application/json','error','string','json','/api/node-toolbox/api-doc-generator','4852210YpgoMt','):缺少\x20data.markdown\x20字段','text','206255SwAMzu','80zyPyMh','2322tOhvCz','markdown','生成文档成功:\x20','获取文档失败\x20(','api-doc','.md','status','),HTTP状态码:\x20','响应数据格式错误\x20(','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','utf8','660048JOjQEX','3DGXQLh','POST','log','stringify','length','90927wPGEso','push','等待\x203\x20秒...\x0a',']\x20正在生成:\x20','2445XvcBFj','3661fMenkn','data','✓\x20成功生成:\x20','生成文档失败:\x20'];a6_0x7dc2=function(){return _0x21f2b9;};return a6_0x7dc2();}function delay(_0x39b056){return new Promise(_0x375103=>setTimeout(_0x375103,_0x39b056));}export async function generateDatasetDocs(_0x548a18,_0xd12ed8,_0x28ea1d=a6_0x5b3e2f(0x1c1),_0x5fe523,_0x4e125a){const _0x17f729=a6_0x5b3e2f;mkdirSync(_0x28ea1d,{'recursive':!![]});const _0x140ff1=[],_0x49f2a1=_0x548a18['length'];console[_0x17f729(0x1ae)]('\x0a共有\x20'+_0x49f2a1+_0x17f729(0x1be));for(let _0x51d12a=0x0;_0x51d12a<_0x548a18[_0x17f729(0x1b0)];_0x51d12a++){const _0x5d50ba=_0x548a18[_0x51d12a],_0x109787=_0x51d12a+0x1,_0x200494=_0x5d50ba['tableName'];try{console['log']('['+_0x109787+'/'+_0x49f2a1+_0x17f729(0x1b4)+_0x200494+'.md\x20('+_0x5d50ba[_0x17f729(0x1bb)]+')');_0x5fe523&&_0x5fe523(_0x109787,_0x49f2a1,_0x200494);const _0x41e16e=await fetchDatasetDoc({'appCode':_0xd12ed8,'datasetCode':_0x5d50ba[_0x17f729(0x1ba)],'datasetId':_0x5d50ba['id'],'enableAI':![],'extraParams':_0x4e125a}),_0xc3d852=a6_0x1749ef[_0x17f729(0x1c0)](_0x28ea1d,_0x200494+'.md');writeFileSync(_0xc3d852,_0x41e16e,{'encoding':_0x17f729(0x1aa)}),console['log'](_0x17f729(0x1b8)+_0x200494+_0x17f729(0x1a5)),logger['success'](_0x17f729(0x1a4),_0x17f729(0x1a2)+_0x200494,undefined,{'datasetCode':_0x5d50ba['datasetCode'],'datasetName':_0x5d50ba['name'],'filePath':_0xc3d852,'progress':_0x109787+'/'+_0x49f2a1}),_0x140ff1['push']({'datasetCode':_0x5d50ba[_0x17f729(0x1ba)],'datasetName':_0x5d50ba['name'],'filePath':_0xc3d852,'success':!![]}),_0x109787<_0x49f2a1&&await delay(0x1388);}catch(_0x4ce940){const _0x8c567c=_0x4ce940 instanceof Error?_0x4ce940['message']:String(_0x4ce940);console[_0x17f729(0x1ae)](_0x17f729(0x1bd)+_0x200494+'.md\x20-\x20'+_0x8c567c+'\x0a'),logger[_0x17f729(0x1c3)]('api-doc',_0x17f729(0x1b9)+_0x5d50ba[_0x17f729(0x1ba)],{'datasetCode':_0x5d50ba[_0x17f729(0x1ba)],'datasetName':_0x5d50ba[_0x17f729(0x1bb)],'error':_0x8c567c,'progress':_0x109787+'/'+_0x49f2a1}),_0x140ff1[_0x17f729(0x1b2)]({'datasetCode':_0x5d50ba['datasetCode'],'datasetName':_0x5d50ba[_0x17f729(0x1bb)],'filePath':'','success':![],'error':_0x8c567c}),_0x109787<_0x49f2a1&&(console['log'](_0x17f729(0x1b3)),await delay(0xbb8));}}return _0x140ff1;}
|
package/lib/api/api-pull-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa9f60d,_0x582df7){const _0x2f5522=a7_0x4393,_0x6c8e=_0xa9f60d();while(!![]){try{const _0x9fed52=-parseInt(_0x2f5522(0x1fa))/0x1*(parseInt(_0x2f5522(0x21b))/0x2)+parseInt(_0x2f5522(0x1f9))/0x3*(parseInt(_0x2f5522(0x205))/0x4)+-parseInt(_0x2f5522(0x214))/0x5*(-parseInt(_0x2f5522(0x20c))/0x6)+-parseInt(_0x2f5522(0x1f1))/0x7+parseInt(_0x2f5522(0x1fc))/0x8+-parseInt(_0x2f5522(0x21a))/0x9*(parseInt(_0x2f5522(0x213))/0xa)+parseInt(_0x2f5522(0x216))/0xb;if(_0x9fed52===_0x582df7)break;else _0x6c8e['push'](_0x6c8e['shift']());}catch(_0x42e52c){_0x6c8e['push'](_0x6c8e['shift']());}}}(a7_0x28d9,0xecbbe));import{jsx as a7_0x23f2a0,jsxs as a7_0x956980}from'react/jsx-runtime';import{useEffect,useState}from'react';function a7_0x28d9(){const _0x7b2c27=['yellow','includes','√\x20成功拉取\x20','480093DFaXPb','7nlxRVd','-api','5710904mlJAjq','cwd','*\x20已生成文件:','cyan','string','.ts','client','使用指定的应用AppCode:\x20','setLogPath','16BxCWuF','modelCount','api-pull','\x20重新登录后再试','error','\x20个模型)','*\x20导入方式:','30510YnJwwx','column','\x20个,过滤重复','拉取\x20API\x20配置失败:\x20','api','\x20个数据集,生成','{\x20lovrabetClient\x20}','10uJwpqH','845IVxXkg','datasetCount','26170012XCTjqL','env','red','duplicateCount','8977068MXuKAm','290332dxcHhi','gray','replace','length','\x20-\x20客户端实例文件','import\x20','使用配置的应用AppCode:\x20','join','white','!\x20原始数据集\x20','slice','11264176zmwWcJ','online','未提供应用AppCode,且配置中也没有默认值','lovrabet\x20auth','-\x20模型配置文件\x20('];a7_0x28d9=function(){return _0x7b2c27;};return a7_0x28d9();}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a7_0x4393(_0x2f4e60,_0x2daf13){_0x2f4e60=_0x2f4e60-0x1ed;const _0x28d901=a7_0x28d9();let _0x439398=_0x28d901[_0x2f4e60];return _0x439398;}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x198dfc,env:_0xc4ae3e,output:_0x1e85d7})=>{const _0x27946e=a7_0x4393,{exit:_0x5d531c}=useApp(),[_0x4ee1c1,_0x13d478]=useState(![]),[_0x2003f9,_0x35469f]=useState(![]),[_0x330fca,_0x3bbbcf]=useState(null),[_0x466ac7,_0x11c9e4]=useState(null),_0x220163=readConfig(),_0x3e6314=getConfigAppCode(),_0x3de600=_0x198dfc||_0x3e6314,_0xbd2089=typeof _0x220163?.[_0x27946e(0x217)]===_0x27946e(0x200)?_0x220163[_0x27946e(0x217)]:undefined,_0x5172bc=_0xc4ae3e||_0xbd2089||_0x27946e(0x1f2);initEnv(_0x5172bc);const _0x2c5b90=_0x1e85d7||'./src/api/',_0xaab6ef=_0x198dfc&&_0x198dfc[_0x27946e(0x1f7)]('-')?_0x198dfc['split']('-')[_0x27946e(0x1f0)](0x1)[_0x27946e(0x1ed)]('-'):'',_0x4f48a8=_0x198dfc?_0x27946e(0x203)+_0x3de600:_0x27946e(0x221)+_0x3de600,_0x27116b=_0xaab6ef?_0xaab6ef+_0x27946e(0x1fb):_0x27946e(0x210),_0x6907fe=_0xaab6ef?_0xaab6ef+'-client':_0x27946e(0x202);useEffect(()=>{_0x13d478(!![]),_0x1c427e();},[]),useEffect(()=>{(_0x2003f9||_0x330fca)&&_0x5d531c();},[_0x2003f9,_0x330fca,_0x5d531c]);async function _0x1c427e(){const _0xac4c72=_0x27946e;if(!_0x3de600){_0x3bbbcf(_0xac4c72(0x1f3));return;}try{logger[_0xac4c72(0x204)](process[_0xac4c72(0x1fd)]());const {configArray:_0x407970}=await fetchModelList(_0x3de600),_0x434f85=_0x407970[_0xac4c72(0x21e)],_0x5c833c=!_0x198dfc,_0x356613=await generateApiFile(_0x407970,_0xaab6ef,_0x3de600,_0x5c833c,_0x5172bc,_0x2c5b90),_0x9b0b78=_0x2c5b90['endsWith']('/')?_0x2c5b90:_0x2c5b90+'/';_0x11c9e4({'api':''+_0x9b0b78+_0x27116b+_0xac4c72(0x201),'client':''+_0x9b0b78+_0x6907fe+_0xac4c72(0x201),'modelCount':_0x356613[_0xac4c72(0x206)],'datasetCount':_0x434f85,'originalCount':_0x434f85,'duplicateCount':0x0}),_0x35469f(!![]);}catch(_0x130a2b){const _0x28bc52=_0x130a2b instanceof Error?_0x130a2b['message']:String(_0x130a2b);logger[_0xac4c72(0x209)](_0xac4c72(0x207),_0xac4c72(0x20f)+_0x28bc52,{'appCode':_0x3de600,'error':_0x28bc52}),_0x3bbbcf(_0xac4c72(0x20f)+_0x28bc52);}finally{_0x13d478(![]);}}return a7_0x956980(Box,{'flexDirection':_0x27946e(0x20d),'children':[(_0x4ee1c1||_0x2003f9)&&a7_0x956980(Box,{'children':[a7_0x23f2a0(Text,{'color':_0x27946e(0x21c),'children':'*\x20'}),a7_0x23f2a0(Text,{'color':_0x198dfc?_0x27946e(0x1ee):'dim','children':_0x4f48a8})]}),_0x4ee1c1&&a7_0x23f2a0(Box,{'children':a7_0x956980(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x5172bc,')']})}),_0x2003f9&&_0x466ac7&&a7_0x956980(Box,{'flexDirection':_0x27946e(0x20d),'children':[a7_0x23f2a0(Box,{'children':a7_0x956980(Text,{'color':'green','children':[_0x27946e(0x1f8),_0x466ac7[_0x27946e(0x215)],_0x27946e(0x211),'\x20',_0x466ac7[_0x27946e(0x206)],'\x20个模型']})}),_0x466ac7['duplicateCount']>0x0&&a7_0x23f2a0(Box,{'marginTop':0x1,'children':a7_0x956980(Text,{'color':_0x27946e(0x1f6),'children':[_0x27946e(0x1ef),_0x466ac7['originalCount'],_0x27946e(0x20e),'\x20',_0x466ac7[_0x27946e(0x219)],'\x20个']})}),a7_0x23f2a0(Box,{'marginTop':0x1,'children':a7_0x23f2a0(Text,{'color':_0x27946e(0x21c),'children':_0x27946e(0x1fe)})}),a7_0x956980(Box,{'marginLeft':0x2,'children':[a7_0x956980(Text,{'color':_0x27946e(0x1ff),'children':['•\x20',_0x466ac7['api']]}),a7_0x956980(Text,{'color':'dim','children':['\x20',_0x27946e(0x1f5),_0x466ac7['modelCount'],_0x27946e(0x20a)]})]}),a7_0x956980(Box,{'marginLeft':0x2,'children':[a7_0x956980(Text,{'color':_0x27946e(0x1ff),'children':['•\x20',_0x466ac7['client']]}),a7_0x23f2a0(Text,{'color':'dim','children':_0x27946e(0x21f)})]}),a7_0x23f2a0(Box,{'marginTop':0x1,'children':a7_0x23f2a0(Text,{'color':'gray','children':_0x27946e(0x20b)})}),a7_0x23f2a0(Box,{'marginLeft':0x2,'children':a7_0x956980(Text,{'color':_0x27946e(0x1f6),'children':[_0x27946e(0x220),_0x27946e(0x212),'\x20from\x20\x27@/',_0x466ac7[_0x27946e(0x202)][_0x27946e(0x21d)](/^\.\//,'')[_0x27946e(0x21d)](_0x27946e(0x201),''),'\x27']})})]}),_0x330fca&&a7_0x956980(Box,{'flexDirection':'column','children':[a7_0x23f2a0(Box,{'children':a7_0x956980(Text,{'color':_0x27946e(0x218),'children':['❌\x20',_0x330fca]})}),_0x330fca[_0x27946e(0x1f7)]('登录')&&a7_0x956980(Box,{'marginTop':0x1,'children':[a7_0x23f2a0(Text,{'color':_0x27946e(0x1f6),'children':'💡\x20请使用\x20'}),a7_0x23f2a0(Text,{'color':_0x27946e(0x1ff),'children':_0x27946e(0x1f4)}),a7_0x23f2a0(Text,{'color':_0x27946e(0x1f6),'children':_0x27946e(0x208)})]})]})]});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a8_0x35f1(_0x237504,_0x1af31b){_0x237504=_0x237504-0xe3;const _0x220b63=a8_0x220b();let _0x35f163=_0x220b63[_0x237504];return _0x35f163;}(function(_0x5cf7b0,_0x1cb634){const _0x19adb5=a8_0x35f1,_0x57f192=_0x5cf7b0();while(!![]){try{const _0x27710b=-parseInt(_0x19adb5(0xf6))/0x1*(parseInt(_0x19adb5(0xe8))/0x2)+-parseInt(_0x19adb5(0xe3))/0x3*(parseInt(_0x19adb5(0x103))/0x4)+parseInt(_0x19adb5(0xf0))/0x5+parseInt(_0x19adb5(0xf1))/0x6*(-parseInt(_0x19adb5(0xf5))/0x7)+-parseInt(_0x19adb5(0xec))/0x8*(parseInt(_0x19adb5(0xfa))/0x9)+-parseInt(_0x19adb5(0xf8))/0xa*(-parseInt(_0x19adb5(0xfc))/0xb)+parseInt(_0x19adb5(0xf7))/0xc;if(_0x27710b===_0x1cb634)break;else _0x57f192['push'](_0x57f192['shift']());}catch(_0x2b1e84){_0x57f192['push'](_0x57f192['shift']());}}}(a8_0x220b,0x7273a));function a8_0x220b(){const _0x41f938=['data','/api/node-toolbox/dataset/model-list?appcode=','7GrbPxi','225685xnEoTf','21203988KRVmlZ','20sgujVJ','status','19269oiySaX','获取数据集失败,HTTP状态码:\x20','4109941BkFwwW','errorMsg','code','configArray','UNAUTHORIZED','正在从服务器拉取模型列表...\x20(环境:\x20','includes','4DSygCp','1524657TJWIeC','&otype=array','count','Unauthorized','errorMessage','6UHyepS','fetch-model-list','未知错误','message','2976qCydmJ','json','获取数据集失败:\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','2207435dMSDiV','3031368XcSeOC','401'];a8_0x220b=function(){return _0x41f938;};return a8_0x220b();}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';export async function fetchModelList(_0x3f9b6e){const _0x117cdb=a8_0x35f1,_0x578fc3=getEnv(),_0x2417f8=getApiDomain()+_0x117cdb(0xf4)+_0x3f9b6e+_0x117cdb(0xe4);logger['info'](_0x117cdb(0xe9),_0x117cdb(0x101)+_0x578fc3+')',{'apiUrl':_0x2417f8});const _0x338eab=await fetch(_0x2417f8,{'headers':{'Cookie':getCookie()}});if(!_0x338eab['ok']){if(_0x338eab[_0x117cdb(0xf9)]===0x191)throw new Error(_0x117cdb(0xef));throw new Error(_0x117cdb(0xfb)+_0x338eab['status']);}const _0x15fce5=await _0x338eab[_0x117cdb(0xed)]();if(!_0x15fce5['success']){const _0x55626b=_0x15fce5[_0x117cdb(0xfd)]||_0x15fce5[_0x117cdb(0xeb)]||_0x15fce5['data']?.['message']||_0x15fce5[_0x117cdb(0xe7)]||_0x15fce5['error']||_0x117cdb(0xea);if(_0x55626b[_0x117cdb(0x102)](_0x117cdb(0xf2))||_0x55626b[_0x117cdb(0x102)](_0x117cdb(0xe6))||_0x55626b[_0x117cdb(0x102)]('登录')||_0x55626b[_0x117cdb(0x102)]('认证')||_0x15fce5['errorCode']===_0x117cdb(0x100)||_0x15fce5[_0x117cdb(0xfe)]===0x191||_0x15fce5['code']===_0x117cdb(0xf2))throw new Error(_0x117cdb(0xef));throw new Error(_0x117cdb(0xee)+_0x55626b);}return{'configArray':_0x15fce5['data'][_0x117cdb(0xff)],'count':_0x15fce5[_0x117cdb(0xf3)][_0x117cdb(0xe5)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a9_0x2801(){const _0x339982=['alias','.ts','utf8','resolve','join','API\x20文件生成成功!',',\x20env:\x20\x22','-client','key','env','459604yXOFFn','21592lmjmZz','endsWith','{\x20apiConfigName:\x20','927hmzCJd','app','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','push','1382724QVLozr','7654050dkwOmj','333535pYUTKy','templates/generate-api','\x22\x20}','init-api','6KOYsvc','1HkwAup','../..','length','string','format','online','name','slice','1425648uARHeA','130070QOYUQJ','success','client.ts.tpl','datasetCode','CONFIG_NAMES.DEFAULT','typescript','tableName','replaceApiContent','-api','client'];a9_0x2801=function(){return _0x339982;};return a9_0x2801();}(function(_0xa60a2d,_0x1676fe){const _0x36b719=a9_0x48cb,_0x45793b=_0xa60a2d();while(!![]){try{const _0x518989=-parseInt(_0x36b719(0xae))/0x1*(-parseInt(_0x36b719(0xb7))/0x2)+parseInt(_0x36b719(0xad))/0x3*(-parseInt(_0x36b719(0xcb))/0x4)+-parseInt(_0x36b719(0xd5))/0x5+-parseInt(_0x36b719(0xb6))/0x6+parseInt(_0x36b719(0xd3))/0x7+-parseInt(_0x36b719(0xcc))/0x8*(parseInt(_0x36b719(0xcf))/0x9)+parseInt(_0x36b719(0xd4))/0xa;if(_0x518989===_0x1676fe)break;else _0x45793b['push'](_0x45793b['shift']());}catch(_0x6c6c1){_0x45793b['push'](_0x45793b['shift']());}}}(a9_0x2801,0x34b32));import a9_0x235b42 from'prettier';function a9_0x48cb(_0x56d746,_0x56f0da){_0x56d746=_0x56d746-0xad;const _0x280190=a9_0x2801();let _0x48cb7c=_0x280190[_0x56d746];return _0x48cb7c;}import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x5d669c 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';export async function generateApiFile(_0x46a0d6,_0x2c2ae8='',_0x2664a4,_0x178614=![],_0x3c4c7a,_0x2fa089='./src/api/'){const _0xce2665=a9_0x48cb,_0xfa2977=readConfig(),_0x34d072=_0x2664a4||_0xfa2977?.[_0xce2665(0xd0)];if(typeof _0x34d072!==_0xce2665(0xb1)||!_0x34d072)throw new Error(_0xce2665(0xd1));const _0x3cfc28=_0x178614?_0xce2665(0xbb):'\x22'+_0x34d072+'\x22',_0x3be473=typeof _0xfa2977[_0xce2665(0xca)]===_0xce2665(0xb1)?_0xfa2977[_0xce2665(0xca)]:undefined,_0x590531=_0x3c4c7a||_0x3be473||'online',_0x3a55fd=_0x590531!==_0xce2665(0xb3);let _0x27b32d;if(_0x178614)_0x3a55fd?_0x27b32d=_0xce2665(0xce)+_0x3cfc28+',\x20env:\x20\x22'+_0x590531+_0xce2665(0xd7):_0x27b32d='';else{const _0x58d867=_0x3a55fd?_0xce2665(0xc7)+_0x590531+'\x22':'';_0x27b32d='{\x20apiConfigName:\x20\x22'+_0x34d072+'\x22'+_0x58d867+'\x20}';}const _0x3cefa5=_0x2c2ae8?_0x2c2ae8+_0xce2665(0xbf):'api',_0x366f4e=_0x2c2ae8?_0x2c2ae8+_0xce2665(0xc8):_0xce2665(0xc0),_0x4171a2=[];_0x46a0d6['forEach'](_0x5177a2=>{const _0x1fb5c0=_0xce2665;_0x4171a2[_0x1fb5c0(0xd2)]({'datasetCode':_0x5177a2[_0x1fb5c0(0xba)],'tableName':_0x5177a2[_0x1fb5c0(0xbd)],'name':_0x5177a2[_0x1fb5c0(0xb4)]||'','alias':_0x5177a2[_0x1fb5c0(0xc1)]||_0x5177a2[_0x1fb5c0(0xc9)]});});const _0x7c3244=fileURLToPath(import.meta.url),_0x45e403=a9_0x5d669c[_0xce2665(0xc4)](a9_0x5d669c['dirname'](_0x7c3244),_0xce2665(0xaf)),_0x3ff6d5=a9_0x5d669c[_0xce2665(0xc5)](_0x45e403,_0xce2665(0xd6)),_0x255822=a9_0x5d669c[_0xce2665(0xc5)](_0x3ff6d5,'api.ts.tpl'),_0x32b583=a9_0x5d669c[_0xce2665(0xc5)](_0x3ff6d5,_0xce2665(0xb9)),_0x442dc3=_0x2fa089[_0xce2665(0xcd)]('/')?_0x2fa089[_0xce2665(0xb5)](0x0,-0x1):_0x2fa089;mkdirSync(_0x442dc3,{'recursive':!![]});const _0x85f29d=_0x4171a2[0x0]?.[_0xce2665(0xc1)],_0x4ba7fa=readFileSync(_0x255822,_0xce2665(0xc3)),_0x16e2bc=TemplateReplacer[_0xce2665(0xbe)](_0x4ba7fa,_0x34d072,_0x4171a2,_0x85f29d,_0x3cefa5,_0x3cfc28),_0x446596=await a9_0x235b42['format'](_0x16e2bc,{'parser':_0xce2665(0xbc)}),_0x475058=_0x442dc3+'/'+_0x3cefa5+'.ts';writeFileSync(_0x475058,_0x446596,{'encoding':_0xce2665(0xc3)});const _0x45920a=readFileSync(_0x32b583,_0xce2665(0xc3)),_0x5347e0=TemplateReplacer[_0xce2665(0xbe)](_0x45920a,_0x34d072,_0x4171a2,_0x85f29d,_0x3cefa5,_0x3cfc28,_0x27b32d),_0x32fcfc=await a9_0x235b42[_0xce2665(0xb2)](_0x5347e0,{'parser':_0xce2665(0xbc)}),_0x476d83=_0x442dc3+'/'+_0x366f4e+_0xce2665(0xc2);writeFileSync(_0x476d83,_0x32fcfc,{'encoding':'utf8'});const _0x3b5ca5=_0x4171a2[_0xce2665(0xb0)];return logger[_0xce2665(0xb8)](_0xce2665(0xd8),_0xce2665(0xc6),undefined,{'apiFile':_0x475058,'clientFile':_0x476d83,'modelCount':_0x3b5ca5,'configName':_0x3cfc28}),{'modelCount':_0x3b5ca5,'apiFilePath':_0x475058,'clientFilePath':_0x476d83,'configName':_0x3cfc28};}
|
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x75d14c,_0x5af2e9){const _0x2248b9=a10_0x4ded,_0x27d176=_0x75d14c();while(!![]){try{const _0x4f72e5=parseInt(_0x2248b9(0x1e7))/0x1*(parseInt(_0x2248b9(0x202))/0x2)+-parseInt(_0x2248b9(0x204))/0x3*(-parseInt(_0x2248b9(0x1e1))/0x4)+parseInt(_0x2248b9(0x1d9))/0x5*(-parseInt(_0x2248b9(0x1df))/0x6)+parseInt(_0x2248b9(0x1f2))/0x7+-parseInt(_0x2248b9(0x1e4))/0x8+-parseInt(_0x2248b9(0x207))/0x9*(-parseInt(_0x2248b9(0x1fb))/0xa)+parseInt(_0x2248b9(0x206))/0xb;if(_0x4f72e5===_0x5af2e9)break;else _0x27d176['push'](_0x27d176['shift']());}catch(_0x3c7fa){_0x27d176['push'](_0x27d176['shift']());}}}(a10_0x5887,0x4bd0a));function a10_0x4ded(_0xc39eec,_0x567524){_0xc39eec=_0xc39eec-0x1d1;const _0x58873c=a10_0x5887();let _0x4dedc0=_0x58873c[_0xc39eec];return _0x4dedc0;}import{jsx as a10_0x28ff4e}from'react/jsx-runtime';function a10_0x5887(){const _0x46e32b=['string','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','❌\x20错误:不再支持位置参数方式','doc','622290LZrUHF','log','10072BKtPsR','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','trim','4329120VvmrqT','Unknown\x20api\x20command:\x20','message','4601iXeqbW','error','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生成\x20API\x20文档','×\x20--datasetcode\x20参数不能为空','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','pull','help','flags','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','isArray','251118RBLlmG','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','\x1b[90m*\x20使用配置的应用AppCode:\x20','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','params','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','!\x20请使用以下方式之一:','filter','10PJMSUa','exit','join','请使用\x20--appcode\x20参数,例如:','output','parse','×\x20未配置\x20AppCode','164CAgbLI','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','90BbCquI','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','5987410zortXk','1168353AmNWFq','×\x20--params\x20参数不是有效的\x20JSON\x20格式','length','\x20\x20错误:\x20','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','\x1b[0m','appcode','input','object','15biQdef','env'];a10_0x5887=function(){return _0x46e32b;};return a10_0x5887();}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x3fc361){const _0x4c5815=a10_0x4ded,_0x4cd37a=_0x3fc361[_0x4c5815(0x1d7)][0x1];if(_0x3fc361[_0x4c5815(0x1ef)][_0x4c5815(0x1ee)]){console['log'](_0x4c5815(0x1f3));return;}if(_0x4cd37a===_0x4c5815(0x1ed)){_0x3fc361['input'][0x2]&&(console['error'](_0x4c5815(0x1dd)),console[_0x4c5815(0x1e0)](_0x4c5815(0x1fe)),console[_0x4c5815(0x1e0)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x3fc361[_0x4c5815(0x1d7)][0x2]),process[_0x4c5815(0x1fc)](0x1));const _0x5a0179=getConfigAppCode();let _0xb0fc86=_0x3fc361[_0x4c5815(0x1ef)]['appcode'];const _0x582465=typeof _0x3fc361[_0x4c5815(0x1ef)]['env']===_0x4c5815(0x1db)?_0x3fc361[_0x4c5815(0x1ef)]['env']:undefined,_0x162f89=_0x3fc361[_0x4c5815(0x1ef)][_0x4c5815(0x1ff)];!_0xb0fc86&&!_0x5a0179&&(console[_0x4c5815(0x1e8)](_0x4c5815(0x201)),console[_0x4c5815(0x1e0)](_0x4c5815(0x1f9)),console[_0x4c5815(0x1e0)](_0x4c5815(0x203)),console[_0x4c5815(0x1e0)](_0x4c5815(0x1e2)),process[_0x4c5815(0x1fc)](0x1)),_0xb0fc86&&_0x5a0179&&_0xb0fc86===_0x5a0179&&(console[_0x4c5815(0x1e0)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0xb0fc86+_0x4c5815(0x1d5)),console['log'](_0x4c5815(0x1d4)),_0xb0fc86=undefined),render(a10_0x28ff4e(ApiPullUI,{'appCode':_0xb0fc86,'env':_0x582465,'output':_0x162f89}));}else{if(_0x4cd37a===_0x4c5815(0x1de)){_0x3fc361[_0x4c5815(0x1d7)][0x2]&&(console[_0x4c5815(0x1e8)](_0x4c5815(0x1dd)),console['log'](_0x4c5815(0x1fe)),console[_0x4c5815(0x1e0)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0x3fc361[_0x4c5815(0x1d7)][0x2]),process[_0x4c5815(0x1fc)](0x1));const _0x4c97e0=getConfigAppCode();let _0x3297d1=_0x3fc361[_0x4c5815(0x1ef)][_0x4c5815(0x1d6)];const _0x3f3cd6=typeof _0x3fc361[_0x4c5815(0x1ef)][_0x4c5815(0x1da)]===_0x4c5815(0x1db)?_0x3fc361['flags']['env']:undefined,_0x5a9d63=_0x3fc361['flags']['output'],_0x4fd284=_0x3fc361[_0x4c5815(0x1ef)][_0x4c5815(0x1f7)],_0x442d24=_0x3fc361[_0x4c5815(0x1ef)]['datasetcode'];!_0x3297d1&&!_0x4c97e0&&(console[_0x4c5815(0x1e8)](_0x4c5815(0x201)),console['log'](_0x4c5815(0x1f9)),console['log'](_0x4c5815(0x203)),console[_0x4c5815(0x1e0)](_0x4c5815(0x1f0)),process[_0x4c5815(0x1fc)](0x1));_0x3297d1&&_0x4c97e0&&_0x3297d1===_0x4c97e0&&(console[_0x4c5815(0x1e0)](_0x4c5815(0x1f5)+_0x3297d1+_0x4c5815(0x1d5)),_0x3297d1=undefined);let _0x1efbe;if(_0x4fd284)try{_0x1efbe=JSON[_0x4c5815(0x200)](_0x4fd284),(typeof _0x1efbe!==_0x4c5815(0x1d8)||_0x1efbe===null||Array[_0x4c5815(0x1f1)](_0x1efbe))&&(console[_0x4c5815(0x1e8)](_0x4c5815(0x1dc)),process[_0x4c5815(0x1fc)](0x1));}catch(_0x440cc4){console['error'](_0x4c5815(0x1d1)),console['error'](_0x4c5815(0x1d3)+(_0x440cc4 instanceof Error?_0x440cc4[_0x4c5815(0x1e6)]:String(_0x440cc4))),process['exit'](0x1);}let _0x3e2b37;_0x442d24&&(_0x3e2b37=_0x442d24[_0x4c5815(0x1e9)](',')['map'](_0x3aad0c=>_0x3aad0c[_0x4c5815(0x1e3)]())[_0x4c5815(0x1fa)](_0x55ae85=>_0x55ae85[_0x4c5815(0x1d2)]>0x0),_0x3e2b37[_0x4c5815(0x1d2)]===0x0&&(console['error'](_0x4c5815(0x1eb)),process[_0x4c5815(0x1fc)](0x1)),console[_0x4c5815(0x1e0)]('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x3e2b37[_0x4c5815(0x1fd)](',\x20')+_0x4c5815(0x1d5))),render(a10_0x28ff4e(ApiDocUI,{'appCode':_0x3297d1,'env':_0x3f3cd6,'output':_0x5a9d63,'extraParams':_0x1efbe,'datasetCodes':_0x3e2b37}));}else console[_0x4c5815(0x1e8)](_0x4c5815(0x1e5)+_0x4cd37a),console[_0x4c5815(0x1e0)]('Available\x20commands:'),console[_0x4c5815(0x1e0)](_0x4c5815(0x1f8)),console[_0x4c5815(0x1e0)](_0x4c5815(0x1f6)),console['log'](_0x4c5815(0x1f4)),console['log'](_0x4c5815(0x1ec)),console[_0x4c5815(0x1e0)](''),console[_0x4c5815(0x1e0)](_0x4c5815(0x1ea)),console[_0x4c5815(0x1e0)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console[_0x4c5815(0x1e0)]('\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)'),console[_0x4c5815(0x1e0)](_0x4c5815(0x205)),process['exit'](0x1);}}
|