@lovrabet/cli 1.1.25 → 1.1.26-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.
- 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/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 -0
- package/lib/app-menu/utils.js +1 -0
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-cdn-version/app-menu-sync-cdn-version-ui.js +1 -0
- package/lib/app-menu-cdn-version/cdn-url-compare-table.js +1 -0
- package/lib/app-menu-cdn-version/types.js +1 -0
- package/lib/app-menu-cdn-version/update-menu-cdn-url.js +1 -0
- 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/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/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.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/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29dad8,_0x28bd8c){const _0x329a99=a0_0x2186,_0x50eb25=_0x29dad8();while(!![]){try{const _0x3b3469=-parseInt(_0x329a99(0x146))/0x1+parseInt(_0x329a99(0x155))/0x2*(parseInt(_0x329a99(0x149))/0x3)+-parseInt(_0x329a99(0x143))/0x4+-parseInt(_0x329a99(0x140))/0x5*(parseInt(_0x329a99(0x13e))/0x6)+parseInt(_0x329a99(0x14b))/0x7+-parseInt(_0x329a99(0x14a))/0x8+parseInt(_0x329a99(0x145))/0x9*(parseInt(_0x329a99(0x14c))/0xa);if(_0x3b3469===_0x28bd8c)break;else _0x50eb25['push'](_0x50eb25['shift']());}catch(_0x50ca18){_0x50eb25['push'](_0x50eb25['shift']());}}}(a0_0x49f2,0xb133b));import{jsx as a0_0x259e05,jsxs as a0_0x314e0d}from'react/jsx-runtime';function a0_0x49f2(){const _0x1e53f2=['路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','5BRjPKS','length','includes','5900KzQASf','green','18969696pSHenL','767051NwfZIv','\x20已存在,请使用其他路径','delete','3jGxkUs','6041536FARhDH','1758890uaSmAu','10NCnEDI','\x20Step2:\x20','existsSync','页面路径\x20','路径不能以\x20/\x20开头或结尾','return','red','页面路径长度不能超过\x20100\x20个字符','slice','717314uGrDVH','endsWith','test','\x20←\x20','gray','路径不能包含连续的\x20/','页面路径不合法','2808804rUAttW'];a0_0x49f2=function(){return _0x1e53f2;};return a0_0x49f2();}function a0_0x2186(_0x4fed83,_0x3914fc){const _0x49f2ef=a0_0x49f2();return a0_0x2186=function(_0x218612,_0x506019){_0x218612=_0x218612-0x139;let _0x159a84=_0x49f2ef[_0x218612];return _0x159a84;},a0_0x2186(_0x4fed83,_0x3914fc);}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x3fe4c5 from'node:fs';export function InputProjectCode(_0x55243d){const _0x455948=a0_0x2186,{onSubmit:_0x497450,pagePath:_0x1c2fc6}=_0x55243d,[_0x2a3a52,_0x3152b5]=useState(''),[_0x31eca7,_0x1af594]=useState(''),_0x3df605='my-page';function _0x2390d6(_0x8243a){const _0x1bc5ed=a0_0x2186;if(_0x8243a[_0x1bc5ed(0x141)]>0x64)return{'valid':![],'message':_0x1bc5ed(0x153)};if(_0x8243a['startsWith']('/')||_0x8243a[_0x1bc5ed(0x156)]('/'))return{'valid':![],'message':_0x1bc5ed(0x150)};if(_0x8243a[_0x1bc5ed(0x142)]('//'))return{'valid':![],'message':_0x1bc5ed(0x13c)};const _0x22728c=_0x8243a['split']('/');for(const _0xc39c3 of _0x22728c){if(!_0xc39c3)continue;const _0x305deb=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x305deb[_0x1bc5ed(0x139)](_0xc39c3))return{'valid':![],'message':_0x1bc5ed(0x13f)};}return{'valid':!![]};}return useInput((_0x5095e7,_0x1d8542)=>{const _0x4d77ba=a0_0x2186;if(_0x1d8542[_0x4d77ba(0x151)]){const _0x3cb88e=_0x2a3a52['trim']()||_0x3df605;if(_0x31eca7)return;const _0x3b82ca=_0x1c2fc6+'/'+_0x3cb88e;if(a0_0x3fe4c5[_0x4d77ba(0x14e)](_0x3b82ca)){_0x1af594(_0x4d77ba(0x14f)+_0x3cb88e+_0x4d77ba(0x147));return;}_0x497450(_0x3cb88e),_0x3152b5(''),_0x1af594('');}else _0x1d8542['backspace']||_0x1d8542[_0x4d77ba(0x148)]?_0x3152b5(_0x1049c8=>{const _0x130479=_0x4d77ba,_0x4e7551=_0x1049c8[_0x130479(0x154)](0x0,-0x1),{valid:_0x1737ec,message:_0x733ecb}=_0x2390d6(_0x4e7551);return _0x1af594(_0x1737ec?'':_0x733ecb||'页面路径不合法'),_0x4e7551;}):_0x3152b5(_0x3a8fe5=>{const _0x1cd506=_0x4d77ba,_0x234adb=_0x3a8fe5+_0x5095e7,{valid:_0x1ca177,message:_0x58b07b}=_0x2390d6(_0x234adb);return _0x1af594(_0x1ca177?'':_0x58b07b||_0x1cd506(0x13d)),_0x234adb;});}),a0_0x314e0d(Box,{'flexDirection':'column','children':[a0_0x314e0d(Box,{'children':[a0_0x259e05(Text,{'color':_0x455948(0x13b),'children':_0x455948(0x14d)}),a0_0x259e05(Text,{'children':'页面路由地址:\x20'}),_0x2a3a52?a0_0x259e05(Text,{'color':_0x455948(0x144),'children':_0x2a3a52}):a0_0x259e05(Text,{'color':_0x455948(0x13b),'children':_0x3df605}),_0x31eca7&&a0_0x314e0d(Text,{'color':_0x455948(0x152),'children':[_0x455948(0x13a),_0x31eca7]})]}),!_0x31eca7&&!_0x2a3a52&&a0_0x259e05(Box,{'children':a0_0x259e05(Text,{'color':_0x455948(0x13b),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
|
package/lib/add-page/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a1_0x2b87ea=a1_0x2a59;(function(_0x5b45af,_0x267da1){const _0x389fb4=a1_0x2a59,_0x41e7af=_0x5b45af();while(!![]){try{const _0x123203=-parseInt(_0x389fb4(0x108))/0x1*(-parseInt(_0x389fb4(0x121))/0x2)+parseInt(_0x389fb4(0x127))/0x3+parseInt(_0x389fb4(0x109))/0x4*(parseInt(_0x389fb4(0x129))/0x5)+-parseInt(_0x389fb4(0x11f))/0x6*(parseInt(_0x389fb4(0x116))/0x7)+-parseInt(_0x389fb4(0x125))/0x8+parseInt(_0x389fb4(0x12b))/0x9+-parseInt(_0x389fb4(0x112))/0xa;if(_0x123203===_0x267da1)break;else _0x41e7af['push'](_0x41e7af['shift']());}catch(_0x3837b2){_0x41e7af['push'](_0x41e7af['shift']());}}}(a1_0x3fd9,0x64a27));import{jsx as a1_0x3a40c9,jsxs as a1_0x44ab9d,Fragment as a1_0x2ae853}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x3f9b4b from'node:path';function a1_0x3fd9(){const _0x3abd47=['column','dirname','\x20*\x20页面文件已创建,可直接通过路由访问','1608190RsiOyp','processTemplate','cwd','src','50911iJPhvR','cyan','resolve','join','add-page','已输入的页面路由\x20','\x20Step2:\x20','now','pages','474HDZfZz','catch','868630UKypmh','url','页面添加成功:\x20','页面添加失败:\x20','1398880oKJjzR','green','1859700EDjsHV','\x20*\x20页面创建成功!','10zTgOzW','error','425538LrhUKr','正在创建页面,请稍候…','success','finally','\x20*\x20页面路径:\x20','1eEYjKc','441896EUrtMT','已选择页面模板\x20','message','\x20Step1:\x20','../../templates/pages','gray'];a1_0x3fd9=function(){return _0x3abd47;};return a1_0x3fd9();}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';function a1_0x2a59(_0x1d915c,_0x2c3d40){const _0x3fd914=a1_0x3fd9();return a1_0x2a59=function(_0x2a5934,_0x22c57a){_0x2a5934=_0x2a5934-0x105;let _0x299274=_0x3fd914[_0x2a5934];return _0x299274;},a1_0x2a59(_0x1d915c,_0x2c3d40);}import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x3f9b4b[a1_0x2b87ea(0x110)](fileURLToPath(import.meta[a1_0x2b87ea(0x122)])),pageTemplateDir=a1_0x3f9b4b['resolve'](__dirname,a1_0x2b87ea(0x10d)),projectDir=process['cwd']();export const AddPage=()=>{const _0x1c559e=a1_0x2b87ea,{exit:_0x1482e7}=useApp(),[_0x4e5f4f,_0x175625]=useState(''),[_0x4b248c,_0x28ec55]=useState(''),[_0x43ca23,_0x5b5472]=useState(![]),[_0x1c4080,_0x4f98b3]=useState(![]),_0x3e73f7=a1_0x3f9b4b[_0x1c559e(0x119)](projectDir,_0x1c559e(0x115),_0x1c559e(0x11e)),_0x4f409b=a1_0x3f9b4b['join'](_0x3e73f7,_0x4b248c),_0x32da58=a1_0x3f9b4b['join'](_0x1c559e(0x115),_0x1c559e(0x11e),_0x4b248c);useEffect(()=>{const _0x4233a1=_0x1c559e,_0x59cbc7=a1_0x3f9b4b[_0x4233a1(0x118)](pageTemplateDir,_0x4e5f4f);if(_0x4e5f4f&&_0x4b248c){_0x5b5472(!![]),logger['setLogPath'](process[_0x4233a1(0x114)]());const _0x102cd6=Date['now']();logger['info'](_0x4233a1(0x11a),'开始添加页面:\x20'+_0x4b248c,{'template':_0x4e5f4f,'targetPath':_0x32da58}),TemplateReplacer[_0x4233a1(0x113)](_0x59cbc7,a1_0x3f9b4b[_0x4233a1(0x119)](_0x3e73f7,_0x4b248c),_0x4b248c,_0x4e5f4f)['then'](()=>{const _0x48178a=_0x4233a1,_0x411aed=Date[_0x48178a(0x11d)]()-_0x102cd6;logger[_0x48178a(0x105)](_0x48178a(0x11a),_0x48178a(0x123)+_0x4b248c,_0x411aed,{'template':_0x4e5f4f,'targetPath':_0x32da58,'routePath':_0x4b248c}),_0x4f98b3(!![]);})[_0x4233a1(0x120)](_0x1c0a48=>{const _0x2fff81=_0x4233a1,_0x254a9f=Date['now']()-_0x102cd6;logger[_0x2fff81(0x12a)](_0x2fff81(0x11a),_0x2fff81(0x124)+_0x4b248c,{'template':_0x4e5f4f,'targetPath':_0x32da58,'error':_0x1c0a48 instanceof Error?_0x1c0a48[_0x2fff81(0x10b)]:String(_0x1c0a48),'duration':_0x254a9f});})[_0x4233a1(0x106)](()=>{_0x5b5472(![]);});}},[_0x4e5f4f,_0x4b248c]),useEffect(()=>{_0x1c4080&&setTimeout(()=>{_0x1482e7();});},[_0x1c4080]);if(_0x4e5f4f)return a1_0x44ab9d(Box,{'flexDirection':_0x1c559e(0x10f),'paddingY':0x1,'children':[a1_0x44ab9d(Box,{'children':[a1_0x3a40c9(Text,{'color':'gray','children':_0x1c559e(0x10c)}),a1_0x3a40c9(Text,{'children':_0x1c559e(0x10a)}),a1_0x3a40c9(Text,{'color':_0x1c559e(0x126),'children':_0x4e5f4f})]}),_0x4b248c?a1_0x44ab9d(Box,{'children':[a1_0x3a40c9(Text,{'color':'gray','children':_0x1c559e(0x11c)}),a1_0x3a40c9(Text,{'children':_0x1c559e(0x11b)}),a1_0x3a40c9(Text,{'color':_0x1c559e(0x126),'children':_0x4b248c})]}):a1_0x3a40c9(InputProjectCode,{'pagePath':_0x4f409b,'onSubmit':_0x28ec55}),_0x4b248c&&_0x43ca23?a1_0x44ab9d(Box,{'marginTop':0x1,'children':[a1_0x3a40c9(Box,{'width':'4'}),a1_0x3a40c9(Text,{'children':_0x1c559e(0x12c)})]}):null,_0x1c4080?a1_0x44ab9d(a1_0x2ae853,{'children':[a1_0x3a40c9(Box,{'marginTop':0x1,'children':a1_0x3a40c9(Text,{'color':_0x1c559e(0x10e),'children':_0x1c559e(0x128)})}),a1_0x44ab9d(Box,{'children':[a1_0x3a40c9(Text,{'color':_0x1c559e(0x10e),'children':_0x1c559e(0x107)}),a1_0x3a40c9(Text,{'color':_0x1c559e(0x126),'children':_0x32da58})]}),a1_0x44ab9d(Box,{'children':[a1_0x3a40c9(Text,{'color':_0x1c559e(0x10e),'children':'\x20*\x20路由地址:\x20'}),a1_0x44ab9d(Text,{'color':'green','children':['/',_0x4b248c]})]}),a1_0x3a40c9(Box,{'marginTop':0x1,'children':a1_0x3a40c9(Text,{'color':_0x1c559e(0x117),'children':_0x1c559e(0x111)})})]}):null]});return a1_0x3a40c9(SelectPageTemplate,{'onSelect':_0x175625});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a2_0x4f7e(){const _0x176508=['isDirectory','resolve','length','420xtfnLT','758768UvqIoF','2jZGFdG','../..','gray','downArrow','localeCompare','234pJFaUz','join','\x20\x20\x20\x20\x20\x20\x20\x20','10376jpaeuw','1302873OGQDUD','green','50816JCCths','sdk-fetch','12229250BuSDWy','获取模板列表失败:','name','blank','4222284qGvuRt','map','\x20Step1:\x20','1009890OfbwiT','label','return','column','\x20\x20\x20\x20\x20\x20>\x20','dirname','templates/pages','sort'];a2_0x4f7e=function(){return _0x176508;};return a2_0x4f7e();}(function(_0x4f771b,_0x5f0a73){const _0x5e19cd=a2_0xf22e,_0x1416f0=_0x4f771b();while(!![]){try{const _0x4c5d2d=parseInt(_0x5e19cd(0x135))/0x1*(parseInt(_0x5e19cd(0x136))/0x2)+parseInt(_0x5e19cd(0x13f))/0x3+parseInt(_0x5e19cd(0x13e))/0x4*(-parseInt(_0x5e19cd(0x134))/0x5)+parseInt(_0x5e19cd(0x147))/0x6+-parseInt(_0x5e19cd(0x14a))/0x7+parseInt(_0x5e19cd(0x141))/0x8*(parseInt(_0x5e19cd(0x13b))/0x9)+-parseInt(_0x5e19cd(0x143))/0xa;if(_0x4c5d2d===_0x5f0a73)break;else _0x1416f0['push'](_0x1416f0['shift']());}catch(_0xad5ff4){_0x1416f0['push'](_0x1416f0['shift']());}}}(a2_0x4f7e,0x746a2));import{jsx as a2_0x534526,jsxs as a2_0xfd3a1d}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x1865f1 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x3575dd=a2_0xf22e;try{const _0x2d3518=fileURLToPath(import.meta['url']),_0x240d42=a2_0x1865f1[_0x3575dd(0x153)](a2_0x1865f1[_0x3575dd(0x14f)](_0x2d3518),_0x3575dd(0x137)),_0x5a4a47=a2_0x1865f1[_0x3575dd(0x13c)](_0x240d42,_0x3575dd(0x150)),_0x3b2ed4=await readdir(_0x5a4a47,{'withFileTypes':!![]}),_0x2355cd=_0x3b2ed4['filter'](_0x283ce2=>_0x283ce2[_0x3575dd(0x152)]())[_0x3575dd(0x148)](_0x4cb68c=>({'label':_0x4cb68c[_0x3575dd(0x145)]}))[_0x3575dd(0x151)]((_0x2943ab,_0x5d9b46)=>_0x2943ab['label'][_0x3575dd(0x13a)](_0x5d9b46['label']));return _0x2355cd;}catch(_0xf18d3b){return console['error'](_0x3575dd(0x144),_0xf18d3b),[{'label':_0x3575dd(0x146)},{'label':_0x3575dd(0x142)}];}}function a2_0xf22e(_0x241063,_0x17e5ea){const _0x4f7e85=a2_0x4f7e();return a2_0xf22e=function(_0xf22ef5,_0x48119c){_0xf22ef5=_0xf22ef5-0x134;let _0x2b14b5=_0x4f7e85[_0xf22ef5];return _0x2b14b5;},a2_0xf22e(_0x241063,_0x17e5ea);}export function SelectPageTemplate(_0x2cd761){const _0x94175=a2_0xf22e,[_0x4feca8,_0xa322d5]=useState(0x0),[_0x275191,_0x17e7fd]=useState([]),[_0x59f8cf,_0x16e8b1]=useState(!![]);useEffect(()=>{async function _0x27b551(){const _0x310cda=await getTemplateList();_0x17e7fd(_0x310cda),_0x16e8b1(![]);}_0x27b551();},[]),useInput((_0xf0e814,_0x4d9705)=>{const _0x59060e=a2_0xf22e;if(_0x59f8cf)return;if(_0x4d9705[_0x59060e(0x14c)]){const _0x32f6e5=_0x275191[_0x4feca8];_0x32f6e5&&_0x2cd761['onSelect'](_0x32f6e5[_0x59060e(0x14b)]);}_0x4d9705['upArrow']&&_0xa322d5(_0x19afce=>_0x19afce===0x0?_0x275191[_0x59060e(0x154)]-0x1:_0x19afce-0x1),_0x4d9705[_0x59060e(0x139)]&&_0xa322d5(_0x242d46=>_0x242d46===_0x275191[_0x59060e(0x154)]-0x1?0x0:_0x242d46+0x1);});if(_0x59f8cf)return a2_0x534526(Box,{'flexDirection':_0x94175(0x14d),'paddingY':0x1,'children':a2_0xfd3a1d(Box,{'children':[a2_0x534526(Text,{'color':_0x94175(0x138),'children':_0x94175(0x149)}),a2_0x534526(Text,{'children':'正在加载页面模板...'})]})});return a2_0xfd3a1d(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0xfd3a1d(Box,{'children':[a2_0x534526(Text,{'color':_0x94175(0x138),'children':_0x94175(0x149)}),a2_0x534526(Text,{'children':'请选择您要创建的页面模板'})]}),_0x275191[_0x94175(0x148)]((_0x521610,_0x3c4e29)=>{const _0x1ac7fa=_0x94175,_0x257875=_0x3c4e29===_0x4feca8,_0x5a952c=_0x257875?_0x1ac7fa(0x14e)+_0x521610['label']:_0x1ac7fa(0x13d)+_0x521610[_0x1ac7fa(0x14b)];return a2_0x534526(Box,{'children':a2_0x534526(Text,{'color':_0x257875?_0x1ac7fa(0x140):undefined,'children':_0x5a952c})},_0x5a952c);})]});}
|
package/lib/api/api-doc-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xb6f3f9,_0x57b6b0){const _0x3d5d54=a3_0x1975,_0x528e3c=_0xb6f3f9();while(!![]){try{const _0x1ef4a1=-parseInt(_0x3d5d54(0xe7))/0x1+-parseInt(_0x3d5d54(0xef))/0x2+parseInt(_0x3d5d54(0xec))/0x3+-parseInt(_0x3d5d54(0xdb))/0x4*(-parseInt(_0x3d5d54(0xcf))/0x5)+-parseInt(_0x3d5d54(0xd4))/0x6+-parseInt(_0x3d5d54(0xe0))/0x7+-parseInt(_0x3d5d54(0xbc))/0x8*(-parseInt(_0x3d5d54(0xd3))/0x9);if(_0x1ef4a1===_0x57b6b0)break;else _0x528e3c['push'](_0x528e3c['shift']());}catch(_0x27a727){_0x528e3c['push'](_0x528e3c['shift']());}}}(a3_0x145e,0xf04c3));import{jsx as a3_0x40cbff,jsxs as a3_0x67b9d0,Fragment as a3_0x47a975}from'react/jsx-runtime';function a3_0x145e(){const _0x4c903a=['🚀\x20','filter','yellow','error','6572130TwTbMC','\x20-\x20','dim','api-doc','36ZxgQEU','1939212CZKnTu','⚠️\x20以下数据集生成失败:','join','\x1b[0m','success','\x20重新登录后再试','\x20个数据集中筛选出\x20','4sveHqF','正在获取数据集列表...','map','includes','white','13103356DIqJOs','正在生成\x20','length','filePath','column','\x1b[90m*\x20从\x20','*\x20共处理\x20','852280AECect','💡\x20请使用\x20','cyan','datasetCode','.md\x20(','2497473eccpjv','setLogPath','指定的数据集代码都不存在:\x20','2059032iQNVre','string','\x1b[33m!\x20以下数据集代码不存在:\x20','message','5828496mQpEYl','*\x20生成的文档文件:','\x20个数据集','datasetName','文档生成失败:\x20','env','使用指定的应用AppCode:\x20','log','./docs','\x20个数据集的文档...','√\x20文档生成完成!成功\x20','gray',',\x20失败\x20','文档生成完成','red'];a3_0x145e=function(){return _0x4c903a;};return a3_0x145e();}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 a3_0x1975(_0x57d3d9,_0x6438a9){const _0x145e48=a3_0x145e();return a3_0x1975=function(_0x1975bb,_0x473e92){_0x1975bb=_0x1975bb-0xb9;let _0x168401=_0x145e48[_0x1975bb];return _0x168401;},a3_0x1975(_0x57d3d9,_0x6438a9);}export const ApiDocUI=({appCode:_0x5e688c,env:_0x500cea,output:_0x272752,extraParams:_0x2b9df7,datasetCodes:_0x5a2478})=>{const _0x2e8313=a3_0x1975,{exit:_0x109da6}=useApp(),[_0x31a320,_0x5b9218]=useState(![]),[_0x1cd5f2,_0x39c4c5]=useState(''),[_0xfe49db,_0x16ab1e]=useState(![]),[_0x434620,_0x5a83ae]=useState(null),[_0x48aa6c,_0x305456]=useState(null),[_0x4474c3,_0x2d477c]=useState(0x0),_0x53757b=readConfig(),_0x2d09bf=getConfigAppCode(),_0x3b2cfb=_0x5e688c||_0x2d09bf,_0x833fb3=typeof _0x53757b?.[_0x2e8313(0xc1)]===_0x2e8313(0xb9)?_0x53757b[_0x2e8313(0xc1)]:undefined,_0x2f3d95=_0x500cea||_0x833fb3||'online';initEnv(_0x2f3d95);const _0x5cac6c=_0x272752||_0x2e8313(0xc4),_0x49f532=_0x5e688c?_0x2e8313(0xc2)+_0x3b2cfb:'使用配置的应用AppCode:\x20'+_0x3b2cfb;useEffect(()=>{_0x5b9218(!![]),_0x9bbc9e();},[]),useEffect(()=>{(_0xfe49db||_0x434620)&&_0x109da6();},[_0xfe49db,_0x434620,_0x109da6]);async function _0x9bbc9e(){const _0x5a9249=_0x2e8313;if(!_0x3b2cfb){_0x5a83ae('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x5a9249(0xed)](process['cwd']()),_0x39c4c5(_0x5a9249(0xdc));const {configArray:_0x345533}=await fetchModelList(_0x3b2cfb);_0x2d477c(_0x345533['length']);if(_0x345533[_0x5a9249(0xe2)]===0x0){_0x5a83ae('未找到任何数据集');return;}let _0xf8dda2=_0x345533;if(_0x5a2478&&_0x5a2478[_0x5a9249(0xe2)]>0x0){_0xf8dda2=_0x345533[_0x5a9249(0xcc)](_0x9835a4=>_0x5a2478[_0x5a9249(0xde)](_0x9835a4[_0x5a9249(0xea)]));const _0x594be8=_0xf8dda2[_0x5a9249(0xdd)](_0x4f9d65=>_0x4f9d65[_0x5a9249(0xea)]),_0x580149=_0x5a2478[_0x5a9249(0xcc)](_0x518dfd=>!_0x594be8[_0x5a9249(0xde)](_0x518dfd));_0x580149[_0x5a9249(0xe2)]>0x0&&console[_0x5a9249(0xc3)](_0x5a9249(0xba)+_0x580149[_0x5a9249(0xd6)](',\x20')+_0x5a9249(0xd7));if(_0xf8dda2[_0x5a9249(0xe2)]===0x0){_0x5a83ae(_0x5a9249(0xee)+_0x5a2478[_0x5a9249(0xd6)](',\x20'));return;}console['log'](_0x5a9249(0xe5)+_0x345533[_0x5a9249(0xe2)]+_0x5a9249(0xda)+_0xf8dda2[_0x5a9249(0xe2)]+'\x20个匹配的数据集\x1b[0m');}_0x39c4c5(_0x5a9249(0xe1)+_0xf8dda2[_0x5a9249(0xe2)]+_0x5a9249(0xc5));const _0x114a73=await generateDatasetDocs(_0xf8dda2,_0x3b2cfb,_0x5cac6c,(_0x411d0c,_0x2b2e1b,_0x29c31e)=>{const _0x4d292b=_0x5a9249;_0x39c4c5('正在生成\x20'+_0x29c31e+_0x4d292b(0xeb)+_0x411d0c+'/'+_0x2b2e1b+')');},_0x2b9df7);_0x305456(_0x114a73),_0x16ab1e(!![]);const _0x58ec85=_0x114a73[_0x5a9249(0xcc)](_0x2df08b=>_0x2df08b['success'])[_0x5a9249(0xe2)],_0x4f0f9b=_0x114a73[_0x5a9249(0xcc)](_0x5ee3e7=>!_0x5ee3e7[_0x5a9249(0xd8)])[_0x5a9249(0xe2)];logger[_0x5a9249(0xd8)](_0x5a9249(0xd2),_0x5a9249(0xc9),undefined,{'totalCount':_0x114a73[_0x5a9249(0xe2)],'successCount':_0x58ec85,'failCount':_0x4f0f9b,'outputDir':_0x5cac6c});}catch(_0xfe433a){const _0x1b5888=_0xfe433a instanceof Error?_0xfe433a[_0x5a9249(0xbb)]:String(_0xfe433a);logger[_0x5a9249(0xce)]('api-doc',_0x5a9249(0xc0)+_0x1b5888,{'appCode':_0x3b2cfb,'outputDir':_0x5cac6c}),_0x5a83ae('文档生成失败:\x20'+_0x1b5888);}finally{_0x5b9218(![]);}}const _0x5b9d32=_0x48aa6c?.[_0x2e8313(0xcc)](_0x367c9a=>_0x367c9a['success'])[_0x2e8313(0xe2)]||0x0,_0x2be05b=_0x48aa6c?.['filter'](_0x11b52c=>!_0x11b52c[_0x2e8313(0xd8)])['length']||0x0;return a3_0x67b9d0(Box,{'flexDirection':_0x2e8313(0xe4),'children':[(_0x31a320||_0xfe49db)&&a3_0x67b9d0(Box,{'children':[a3_0x40cbff(Text,{'color':_0x2e8313(0xc7),'children':'*\x20'}),a3_0x40cbff(Text,{'color':_0x5e688c?_0x2e8313(0xdf):_0x2e8313(0xd1),'children':_0x49f532})]}),_0x31a320&&a3_0x40cbff(Box,{'children':a3_0x67b9d0(Text,{'children':[_0x2e8313(0xcb),_0x1cd5f2,'\x20(环境:\x20',_0x2f3d95,')']})}),_0xfe49db&&_0x48aa6c&&a3_0x67b9d0(Box,{'flexDirection':'column','children':[a3_0x40cbff(Box,{'children':a3_0x67b9d0(Text,{'color':'green','children':[_0x2e8313(0xc6),_0x5b9d32,'\x20个',_0x2be05b>0x0&&_0x2e8313(0xc8)+_0x2be05b+'\x20个']})}),a3_0x40cbff(Box,{'marginTop':0x1,'children':a3_0x67b9d0(Text,{'color':_0x2e8313(0xc7),'children':[_0x2e8313(0xe6),_0x4474c3,_0x2e8313(0xbe)]})}),a3_0x67b9d0(Box,{'marginTop':0x1,'children':[a3_0x40cbff(Text,{'color':_0x2e8313(0xc7),'children':'*\x20输出目录:\x20'}),a3_0x40cbff(Text,{'color':_0x2e8313(0xe9),'children':_0x5cac6c})]}),_0x5b9d32>0x0&&a3_0x67b9d0(a3_0x47a975,{'children':[a3_0x40cbff(Box,{'marginTop':0x1,'children':a3_0x40cbff(Text,{'color':'gray','children':_0x2e8313(0xbd)})}),_0x48aa6c[_0x2e8313(0xcc)](_0xee1c12=>_0xee1c12[_0x2e8313(0xd8)])[_0x2e8313(0xdd)]((_0x57a6e4,_0x5b4f16)=>a3_0x67b9d0(Box,{'marginLeft':0x2,'children':[a3_0x67b9d0(Text,{'color':_0x2e8313(0xe9),'children':['•\x20',_0x57a6e4[_0x2e8313(0xe3)]]}),a3_0x67b9d0(Text,{'color':_0x2e8313(0xd1),'children':[_0x2e8313(0xd0),_0x57a6e4[_0x2e8313(0xbf)]]})]},_0x5b4f16))]}),_0x2be05b>0x0&&a3_0x67b9d0(a3_0x47a975,{'children':[a3_0x40cbff(Box,{'marginTop':0x1,'children':a3_0x40cbff(Text,{'color':_0x2e8313(0xcd),'children':_0x2e8313(0xd5)})}),_0x48aa6c[_0x2e8313(0xcc)](_0x477913=>!_0x477913['success'])['map']((_0x4e4bbd,_0x509e16)=>a3_0x67b9d0(Box,{'marginLeft':0x2,'flexDirection':_0x2e8313(0xe4),'children':[a3_0x67b9d0(Text,{'color':'red','children':['•\x20',_0x4e4bbd[_0x2e8313(0xbf)],'\x20(',_0x4e4bbd[_0x2e8313(0xea)],')']}),_0x4e4bbd['error']&&a3_0x40cbff(Box,{'marginLeft':0x2,'children':a3_0x40cbff(Text,{'color':_0x2e8313(0xd1),'children':_0x4e4bbd[_0x2e8313(0xce)]})})]},_0x509e16))]})]}),_0x434620&&a3_0x67b9d0(Box,{'flexDirection':'column','children':[a3_0x40cbff(Box,{'children':a3_0x67b9d0(Text,{'color':_0x2e8313(0xca),'children':['❌\x20',_0x434620]})}),_0x434620[_0x2e8313(0xde)]('登录')&&a3_0x67b9d0(Box,{'marginTop':0x1,'children':[a3_0x40cbff(Text,{'color':_0x2e8313(0xcd),'children':_0x2e8313(0xe8)}),a3_0x40cbff(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a3_0x40cbff(Text,{'color':'yellow','children':_0x2e8313(0xd9)})]})]})]});};
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x516f5f,_0x4406d0){const _0xea53fe=a4_0x2b3b,_0x31bafb=_0x516f5f();while(!![]){try{const _0x42fa96=parseInt(_0xea53fe(0xa5))/0x1+-parseInt(_0xea53fe(0x8f))/0x2+-parseInt(_0xea53fe(0x89))/0x3+-parseInt(_0xea53fe(0x9b))/0x4*(-parseInt(_0xea53fe(0xa2))/0x5)+-parseInt(_0xea53fe(0x88))/0x6*(-parseInt(_0xea53fe(0x96))/0x7)+parseInt(_0xea53fe(0x8d))/0x8+-parseInt(_0xea53fe(0x9e))/0x9;if(_0x42fa96===_0x4406d0)break;else _0x31bafb['push'](_0x31bafb['shift']());}catch(_0x40bc44){_0x31bafb['push'](_0x31bafb['shift']());}}}(a4_0x5a97,0x8e452));import{mkdirSync,writeFileSync}from'node:fs';import a4_0xbdd9ea from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a4_0x2b3b(_0x1e48dc,_0x368613){const _0x5a9756=a4_0x5a97();return a4_0x2b3b=function(_0x2b3b4b,_0x62d994){_0x2b3b4b=_0x2b3b4b-0x87;let _0x37de8e=_0x5a9756[_0x2b3b4b];return _0x37de8e;},a4_0x2b3b(_0x1e48dc,_0x368613);}export async function fetchDatasetDoc(_0x5e8431){const _0x597a55=a4_0x2b3b,{appCode:_0x19156e,datasetCode:_0x314170,datasetId:_0x3567d1,extraParams:_0x26faf6}=_0x5e8431,_0x5a32db=getApiDomain(),_0x595e42=_0x5a32db+'/api/node-toolbox/api-doc-generator',_0x389466={'appCode':_0x19156e,'datasetCode':_0x314170,'datasetId':_0x3567d1,..._0x26faf6||{}},_0x315f07=await fetch(_0x595e42,{'method':_0x597a55(0xad),'headers':{'Content-Type':_0x597a55(0xa9),'Cookie':getCookie()},'body':JSON[_0x597a55(0x99)](_0x389466)});if(!_0x315f07['ok']){if(_0x315f07[_0x597a55(0xa8)]===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');let _0x4049be='';try{_0x4049be=await _0x315f07[_0x597a55(0x9f)]();}catch(_0x4cd72c){}throw new Error('获取文档失败\x20('+_0x314170+_0x597a55(0x98)+_0x315f07[_0x597a55(0xa8)]+(_0x4049be?'\x0a'+_0x4049be:''));}const _0x26a8ed=await _0x315f07[_0x597a55(0xac)]();if(!_0x26a8ed[_0x597a55(0xae)]||typeof _0x26a8ed['data'][_0x597a55(0x87)]!==_0x597a55(0x8b))throw new Error(_0x597a55(0x92)+_0x314170+_0x597a55(0x97));return _0x26a8ed[_0x597a55(0xae)][_0x597a55(0x87)];}function delay(_0x31338c){return new Promise(_0xbd6216=>setTimeout(_0xbd6216,_0x31338c));}function a4_0x5a97(){const _0x2ec874=['.md\x20-\x20','json','POST','data','markdown','1434kbEjnV','1136730YvUXaw','success','string','.md\x20(','4689360VaAJym','.md','606738AcyzFL','生成文档成功:\x20','length','响应数据格式错误\x20(','join','tableName','push','20419OpihdH','):缺少\x20data.markdown\x20字段','),HTTP状态码:\x20','stringify','error','4HADDfE','\x0a共有\x20','✓\x20成功生成:\x20','7423830yFOLDT','text','datasetCode','utf8','3902165OWqJwt','log','api-doc','26121UGoWwQ','name','message','status','application/json','✗\x20失败:\x20'];a4_0x5a97=function(){return _0x2ec874;};return a4_0x5a97();}export async function generateDatasetDocs(_0x426c01,_0x53c045,_0x2cb401='./docs',_0x2d1249,_0x40d83d){const _0xb24d23=a4_0x2b3b;mkdirSync(_0x2cb401,{'recursive':!![]});const _0x731bcc=[],_0x2b7ef9=_0x426c01[_0xb24d23(0x91)];console['log'](_0xb24d23(0x9c)+_0x2b7ef9+'\x20个数据集需要生成文档\x0a');for(let _0x52b976=0x0;_0x52b976<_0x426c01[_0xb24d23(0x91)];_0x52b976++){const _0x5c0fa2=_0x426c01[_0x52b976],_0x3f8b8f=_0x52b976+0x1,_0x270184=_0x5c0fa2[_0xb24d23(0x94)];try{console['log']('['+_0x3f8b8f+'/'+_0x2b7ef9+']\x20正在生成:\x20'+_0x270184+_0xb24d23(0x8c)+_0x5c0fa2[_0xb24d23(0xa6)]+')');_0x2d1249&&_0x2d1249(_0x3f8b8f,_0x2b7ef9,_0x270184);const _0x4892f4=await fetchDatasetDoc({'appCode':_0x53c045,'datasetCode':_0x5c0fa2[_0xb24d23(0xa0)],'datasetId':_0x5c0fa2['id'],'enableAI':![],'extraParams':_0x40d83d}),_0x4fa8c7=a4_0xbdd9ea[_0xb24d23(0x93)](_0x2cb401,_0x270184+_0xb24d23(0x8e));writeFileSync(_0x4fa8c7,_0x4892f4,{'encoding':_0xb24d23(0xa1)}),console['log'](_0xb24d23(0x9d)+_0x270184+_0xb24d23(0x8e)),logger[_0xb24d23(0x8a)]('api-doc',_0xb24d23(0x90)+_0x270184,undefined,{'datasetCode':_0x5c0fa2[_0xb24d23(0xa0)],'datasetName':_0x5c0fa2[_0xb24d23(0xa6)],'filePath':_0x4fa8c7,'progress':_0x3f8b8f+'/'+_0x2b7ef9}),_0x731bcc[_0xb24d23(0x95)]({'datasetCode':_0x5c0fa2['datasetCode'],'datasetName':_0x5c0fa2[_0xb24d23(0xa6)],'filePath':_0x4fa8c7,'success':!![]}),_0x3f8b8f<_0x2b7ef9&&await delay(0x1388);}catch(_0x1d39fd){const _0x3817a1=_0x1d39fd instanceof Error?_0x1d39fd[_0xb24d23(0xa7)]:String(_0x1d39fd);console[_0xb24d23(0xa3)](_0xb24d23(0xaa)+_0x270184+_0xb24d23(0xab)+_0x3817a1+'\x0a'),logger[_0xb24d23(0x9a)](_0xb24d23(0xa4),'生成文档失败:\x20'+_0x5c0fa2[_0xb24d23(0xa0)],{'datasetCode':_0x5c0fa2['datasetCode'],'datasetName':_0x5c0fa2[_0xb24d23(0xa6)],'error':_0x3817a1,'progress':_0x3f8b8f+'/'+_0x2b7ef9}),_0x731bcc[_0xb24d23(0x95)]({'datasetCode':_0x5c0fa2['datasetCode'],'datasetName':_0x5c0fa2[_0xb24d23(0xa6)],'filePath':'','success':![],'error':_0x3817a1}),_0x3f8b8f<_0x2b7ef9&&(console[_0xb24d23(0xa3)]('等待\x203\x20秒...\x0a'),await delay(0xbb8));}}return _0x731bcc;}
|
package/lib/api/api-pull-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1547d9,_0x6f0b7c){const _0x253c05=a5_0x4e5f,_0x2bbe90=_0x1547d9();while(!![]){try{const _0x5f5527=-parseInt(_0x253c05(0x19d))/0x1+-parseInt(_0x253c05(0x1ad))/0x2*(parseInt(_0x253c05(0x1a4))/0x3)+-parseInt(_0x253c05(0x1ab))/0x4*(parseInt(_0x253c05(0x1c9))/0x5)+parseInt(_0x253c05(0x1a1))/0x6*(parseInt(_0x253c05(0x1b0))/0x7)+parseInt(_0x253c05(0x1c0))/0x8+parseInt(_0x253c05(0x1a8))/0x9+-parseInt(_0x253c05(0x19e))/0xa*(-parseInt(_0x253c05(0x1a6))/0xb);if(_0x5f5527===_0x6f0b7c)break;else _0x2bbe90['push'](_0x2bbe90['shift']());}catch(_0x5c7eed){_0x2bbe90['push'](_0x2bbe90['shift']());}}}(a5_0x11ef,0x3eea1));import{jsx as a5_0x107747,jsxs as a5_0xa33714}from'react/jsx-runtime';function a5_0x11ef(){const _0x450450=['√\x20成功拉取\x20','12rzxysx','column','26jCkJAE','error','-\x20模型配置文件\x20(','40817sEEftX','\x20个,过滤重复','\x20-\x20客户端实例文件','gray','online','cwd','dim','lovrabet\x20auth','未提供应用AppCode,且配置中也没有默认值','client','-client','endsWith','import\x20','duplicateCount','yellow','message','1407312AUchGd','*\x20已生成文件:','setLogPath','\x20个模型','replace','\x20个模型)','\x20个数据集,生成','red','使用配置的应用AppCode:\x20','571870QjgbQc','./src/api/','.ts','\x20重新登录后再试','join','modelCount','28180PzcyZo','190eHlPKZ','datasetCount','拉取\x20API\x20配置失败:\x20','168oqJonu','cyan','💡\x20请使用\x20','73389JbypTI','string','155639keZwbL','api-pull','3051045ruZDJA','includes'];a5_0x11ef=function(){return _0x450450;};return a5_0x11ef();}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a5_0x4e5f(_0x4ad81c,_0x282be5){const _0x11eff7=a5_0x11ef();return a5_0x4e5f=function(_0x4e5f20,_0x3dae86){_0x4e5f20=_0x4e5f20-0x19d;let _0x502032=_0x11eff7[_0x4e5f20];return _0x502032;},a5_0x4e5f(_0x4ad81c,_0x282be5);}import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x377ab8,env:_0xaf61bf,output:_0x4ee27b})=>{const _0x212910=a5_0x4e5f,{exit:_0x149305}=useApp(),[_0x7f46c3,_0x340c6e]=useState(![]),[_0x41dad0,_0x1f039d]=useState(![]),[_0x365f69,_0x89464a]=useState(null),[_0x4792af,_0x20a108]=useState(null),_0x11c411=readConfig(),_0x165b22=getConfigAppCode(),_0x115b07=_0x377ab8||_0x165b22,_0x3d05ca=typeof _0x11c411?.['env']===_0x212910(0x1a5)?_0x11c411['env']:undefined,_0x53355e=_0xaf61bf||_0x3d05ca||_0x212910(0x1b4);initEnv(_0x53355e);const _0x16d0fe=_0x4ee27b||_0x212910(0x1ca),_0x37c1cb=_0x377ab8&&_0x377ab8[_0x212910(0x1a9)]('-')?_0x377ab8['split']('-')['slice'](0x1)[_0x212910(0x1cd)]('-'):'',_0x307de5=_0x377ab8?'使用指定的应用AppCode:\x20'+_0x115b07:_0x212910(0x1c8)+_0x115b07,_0x410c4b=_0x37c1cb?_0x37c1cb+'-api':'api',_0x5827e6=_0x37c1cb?_0x37c1cb+_0x212910(0x1ba):_0x212910(0x1b9);useEffect(()=>{_0x340c6e(!![]),_0x8ca12f();},[]),useEffect(()=>{(_0x41dad0||_0x365f69)&&_0x149305();},[_0x41dad0,_0x365f69,_0x149305]);async function _0x8ca12f(){const _0x5f3958=_0x212910;if(!_0x115b07){_0x89464a(_0x5f3958(0x1b8));return;}try{logger[_0x5f3958(0x1c2)](process[_0x5f3958(0x1b5)]());const {configArray:_0x57f6d8}=await fetchModelList(_0x115b07),_0x350604=_0x57f6d8['length'],_0x228291=!_0x377ab8,_0x410bcd=await generateApiFile(_0x57f6d8,_0x37c1cb,_0x115b07,_0x228291,_0x53355e,_0x16d0fe),_0x13bcc8=_0x16d0fe[_0x5f3958(0x1bb)]('/')?_0x16d0fe:_0x16d0fe+'/';_0x20a108({'api':''+_0x13bcc8+_0x410c4b+_0x5f3958(0x1cb),'client':''+_0x13bcc8+_0x5827e6+'.ts','modelCount':_0x410bcd[_0x5f3958(0x1ce)],'datasetCount':_0x350604,'originalCount':_0x350604,'duplicateCount':0x0}),_0x1f039d(!![]);}catch(_0x88193d){const _0x35306c=_0x88193d instanceof Error?_0x88193d[_0x5f3958(0x1bf)]:String(_0x88193d);logger[_0x5f3958(0x1ae)](_0x5f3958(0x1a7),_0x5f3958(0x1a0)+_0x35306c,{'appCode':_0x115b07,'error':_0x35306c}),_0x89464a(_0x5f3958(0x1a0)+_0x35306c);}finally{_0x340c6e(![]);}}return a5_0xa33714(Box,{'flexDirection':_0x212910(0x1ac),'children':[(_0x7f46c3||_0x41dad0)&&a5_0xa33714(Box,{'children':[a5_0x107747(Text,{'color':_0x212910(0x1b3),'children':'*\x20'}),a5_0x107747(Text,{'color':_0x377ab8?'white':'dim','children':_0x307de5})]}),_0x7f46c3&&a5_0x107747(Box,{'children':a5_0xa33714(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x53355e,')']})}),_0x41dad0&&_0x4792af&&a5_0xa33714(Box,{'flexDirection':_0x212910(0x1ac),'children':[a5_0x107747(Box,{'children':a5_0xa33714(Text,{'color':'green','children':[_0x212910(0x1aa),_0x4792af[_0x212910(0x19f)],_0x212910(0x1c6),'\x20',_0x4792af['modelCount'],_0x212910(0x1c3)]})}),_0x4792af[_0x212910(0x1bd)]>0x0&&a5_0x107747(Box,{'marginTop':0x1,'children':a5_0xa33714(Text,{'color':_0x212910(0x1be),'children':['!\x20原始数据集\x20',_0x4792af['originalCount'],_0x212910(0x1b1),'\x20',_0x4792af[_0x212910(0x1bd)],'\x20个']})}),a5_0x107747(Box,{'marginTop':0x1,'children':a5_0x107747(Text,{'color':_0x212910(0x1b3),'children':_0x212910(0x1c1)})}),a5_0xa33714(Box,{'marginLeft':0x2,'children':[a5_0xa33714(Text,{'color':_0x212910(0x1a2),'children':['•\x20',_0x4792af['api']]}),a5_0xa33714(Text,{'color':_0x212910(0x1b6),'children':['\x20',_0x212910(0x1af),_0x4792af[_0x212910(0x1ce)],_0x212910(0x1c5)]})]}),a5_0xa33714(Box,{'marginLeft':0x2,'children':[a5_0xa33714(Text,{'color':_0x212910(0x1a2),'children':['•\x20',_0x4792af[_0x212910(0x1b9)]]}),a5_0x107747(Text,{'color':_0x212910(0x1b6),'children':_0x212910(0x1b2)})]}),a5_0x107747(Box,{'marginTop':0x1,'children':a5_0x107747(Text,{'color':_0x212910(0x1b3),'children':'*\x20导入方式:'})}),a5_0x107747(Box,{'marginLeft':0x2,'children':a5_0xa33714(Text,{'color':_0x212910(0x1be),'children':[_0x212910(0x1bc),'{\x20lovrabetClient\x20}','\x20from\x20\x27@/',_0x4792af[_0x212910(0x1b9)][_0x212910(0x1c4)](/^\.\//,'')[_0x212910(0x1c4)](_0x212910(0x1cb),''),'\x27']})})]}),_0x365f69&&a5_0xa33714(Box,{'flexDirection':'column','children':[a5_0x107747(Box,{'children':a5_0xa33714(Text,{'color':_0x212910(0x1c7),'children':['❌\x20',_0x365f69]})}),_0x365f69[_0x212910(0x1a9)]('登录')&&a5_0xa33714(Box,{'marginTop':0x1,'children':[a5_0x107747(Text,{'color':_0x212910(0x1be),'children':_0x212910(0x1a3)}),a5_0x107747(Text,{'color':_0x212910(0x1a2),'children':_0x212910(0x1b7)}),a5_0x107747(Text,{'color':'yellow','children':_0x212910(0x1cc)})]})]})]});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2f125c,_0x8a7146){const _0x52ad54=a6_0xb44c,_0x23e575=_0x2f125c();while(!![]){try{const _0x587212=-parseInt(_0x52ad54(0xe2))/0x1+parseInt(_0x52ad54(0xea))/0x2*(-parseInt(_0x52ad54(0xe7))/0x3)+-parseInt(_0x52ad54(0xdc))/0x4+-parseInt(_0x52ad54(0xe6))/0x5+parseInt(_0x52ad54(0xe5))/0x6+-parseInt(_0x52ad54(0xe1))/0x7+-parseInt(_0x52ad54(0xd9))/0x8*(-parseInt(_0x52ad54(0xd8))/0x9);if(_0x587212===_0x8a7146)break;else _0x23e575['push'](_0x23e575['shift']());}catch(_0x189d6f){_0x23e575['push'](_0x23e575['shift']());}}}(a6_0x4023,0x68aaf));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a6_0xb44c(_0x4e8e80,_0x38ee0b){const _0x402396=a6_0x4023();return a6_0xb44c=function(_0xb44cb5,_0x1d4a2a){_0xb44cb5=_0xb44cb5-0xd5;let _0x5e3e9d=_0x402396[_0xb44cb5];return _0x5e3e9d;},a6_0xb44c(_0x4e8e80,_0x38ee0b);}function a6_0x4023(){const _0x56e632=['&otype=array','4823550FwVoQB','1421275aQPrBH','386013gXQjTy','info','status','2tFrTeF','configArray','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','fetch-model-list','正在从服务器拉取模型列表...\x20(环境:\x20','2722338snxYmt','24iYqPAf','json','message','144552XpcDuP','data','获取数据集失败:\x20','count','获取数据集失败,HTTP状态码:\x20','4127403bZQRnM','243959ZvNbCb','/api/node-toolbox/dataset/model-list?appcode='];a6_0x4023=function(){return _0x56e632;};return a6_0x4023();}import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x42c2c0){const _0x518bb3=a6_0xb44c,_0x8e8cb=getEnv(),_0x13864d=getApiDomain()+_0x518bb3(0xe3)+_0x42c2c0+_0x518bb3(0xe4);logger[_0x518bb3(0xe8)](_0x518bb3(0xd6),_0x518bb3(0xd7)+_0x8e8cb+')',{'apiUrl':_0x13864d});const _0x33dc5c=await fetch(_0x13864d,{'headers':{'Cookie':getCookie()}});if(!_0x33dc5c['ok']){if(_0x33dc5c[_0x518bb3(0xe9)]===0x191)throw new Error(_0x518bb3(0xd5));throw new Error(_0x518bb3(0xe0)+_0x33dc5c[_0x518bb3(0xe9)]);}const _0x4242ed=await _0x33dc5c[_0x518bb3(0xda)]();if(!_0x4242ed['success'])throw new Error(_0x518bb3(0xde)+(_0x4242ed[_0x518bb3(0xdb)]||'未知错误'));return{'configArray':_0x4242ed['data'][_0x518bb3(0xeb)],'count':_0x4242ed[_0x518bb3(0xdd)][_0x518bb3(0xdf)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x46f415=a7_0x4d77;(function(_0x1bfc47,_0x1bc5b0){const _0x29b013=a7_0x4d77,_0x3fe46f=_0x1bfc47();while(!![]){try{const _0x1a32e7=parseInt(_0x29b013(0x7d))/0x1+parseInt(_0x29b013(0x7f))/0x2*(parseInt(_0x29b013(0x88))/0x3)+-parseInt(_0x29b013(0x87))/0x4*(-parseInt(_0x29b013(0x8d))/0x5)+parseInt(_0x29b013(0x79))/0x6*(parseInt(_0x29b013(0x8a))/0x7)+parseInt(_0x29b013(0x86))/0x8+parseInt(_0x29b013(0x97))/0x9+parseInt(_0x29b013(0x96))/0xa*(-parseInt(_0x29b013(0x80))/0xb);if(_0x1a32e7===_0x1bc5b0)break;else _0x3fe46f['push'](_0x3fe46f['shift']());}catch(_0x27195a){_0x3fe46f['push'](_0x3fe46f['shift']());}}}(a7_0x2518,0x9ea55));import a7_0x3f2b33 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';function a7_0x2518(){const _0x1cb136=['./src/api/','client','success','4202080zZckND','69304FZDwNp','14106jILhol','{\x20apiConfigName:\x20','77PNJOoE','datasetCode','replaceApiContent','5oFebMQ','online','tableName','resolve','length','key','endsWith','-client','keys','40yfbBAO','6280578ZHnqdN','CONFIG_NAMES.DEFAULT','client.ts.tpl','string','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','dirname','API\x20文件生成成功!','join',',\x20env:\x20\x22','utf8','typescript','app','86766tznCYG','.ts','name','../..','444804QfdzET','api','530MwTySP','6711430BzLgcm','url','slice'];a7_0x2518=function(){return _0x1cb136;};return a7_0x2518();}import a7_0x5d0510 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 a7_0x4d77(_0x274918,_0x24ca4e){const _0x2518ef=a7_0x2518();return a7_0x4d77=function(_0x4d778c,_0x10ae28){_0x4d778c=_0x4d778c-0x71;let _0xc2dc10=_0x2518ef[_0x4d778c];return _0xc2dc10;},a7_0x4d77(_0x274918,_0x24ca4e);}export async function generateApiFile(_0x43247f,_0x2d4631='',_0xa849ec,_0x365c3f=![],_0x3e543a,_0x4d13c9=a7_0x46f415(0x83)){const _0x3732f3=a7_0x46f415,_0x4615e4=readConfig(),_0xee89d9=_0xa849ec||_0x4615e4?.[_0x3732f3(0x78)];if(typeof _0xee89d9!==_0x3732f3(0x9a)||!_0xee89d9)throw new Error(_0x3732f3(0x71));const _0x3d2eba=_0x365c3f?_0x3732f3(0x98):'\x22'+_0xee89d9+'\x22',_0x3be089=typeof _0x4615e4['env']===_0x3732f3(0x9a)?_0x4615e4['env']:undefined,_0x20c3c7=_0x3e543a||_0x3be089||_0x3732f3(0x8e),_0xb870b0=_0x20c3c7!==_0x3732f3(0x8e);let _0x411a40;if(_0x365c3f)_0xb870b0?_0x411a40=_0x3732f3(0x89)+_0x3d2eba+',\x20env:\x20\x22'+_0x20c3c7+'\x22\x20}':_0x411a40='';else{const _0x2c2585=_0xb870b0?_0x3732f3(0x75)+_0x20c3c7+'\x22':'';_0x411a40='{\x20apiConfigName:\x20\x22'+_0xee89d9+'\x22'+_0x2c2585+'\x20}';}const _0x272941=_0x2d4631?_0x2d4631+'-api':_0x3732f3(0x7e),_0x5df4d8=_0x2d4631?_0x2d4631+_0x3732f3(0x94):_0x3732f3(0x84),_0x2e4bb8={};_0x43247f['forEach'](_0x1d3ef6=>{const _0x443cf2=_0x3732f3;_0x2e4bb8[_0x1d3ef6[_0x443cf2(0x92)]]={'tableName':_0x1d3ef6[_0x443cf2(0x8f)],'datasetCode':_0x1d3ef6[_0x443cf2(0x8b)],'name':_0x1d3ef6[_0x443cf2(0x7b)]||''};});const _0x394136=fileURLToPath(import.meta[_0x3732f3(0x81)]),_0x2e97bf=a7_0x5d0510[_0x3732f3(0x90)](a7_0x5d0510[_0x3732f3(0x72)](_0x394136),_0x3732f3(0x7c)),_0x29d6c6=a7_0x5d0510[_0x3732f3(0x74)](_0x2e97bf,'templates/generate-api'),_0x3a9ab8=a7_0x5d0510[_0x3732f3(0x74)](_0x29d6c6,'api.ts.tpl'),_0x4db923=a7_0x5d0510[_0x3732f3(0x74)](_0x29d6c6,_0x3732f3(0x99)),_0x56f31b=_0x4d13c9[_0x3732f3(0x93)]('/')?_0x4d13c9[_0x3732f3(0x82)](0x0,-0x1):_0x4d13c9;mkdirSync(_0x56f31b,{'recursive':!![]});const _0x568515=readFileSync(_0x3a9ab8,_0x3732f3(0x76)),_0x3f7d91=TemplateReplacer[_0x3732f3(0x8c)](_0x568515,_0xee89d9,_0x2e4bb8,Object['keys'](_0x2e4bb8)[0x0],_0x272941,_0x3d2eba),_0x4a6d58=await a7_0x3f2b33['format'](_0x3f7d91,{'parser':'typescript'}),_0x2fa304=_0x56f31b+'/'+_0x272941+'.ts';writeFileSync(_0x2fa304,_0x4a6d58,{'encoding':_0x3732f3(0x76)});const _0x412388=readFileSync(_0x4db923,_0x3732f3(0x76)),_0x599567=TemplateReplacer['replaceApiContent'](_0x412388,_0xee89d9,_0x2e4bb8,Object['keys'](_0x2e4bb8)[0x0],_0x272941,_0x3d2eba,_0x411a40),_0x49cff8=await a7_0x3f2b33['format'](_0x599567,{'parser':_0x3732f3(0x77)}),_0x2678b4=_0x56f31b+'/'+_0x5df4d8+_0x3732f3(0x7a);writeFileSync(_0x2678b4,_0x49cff8,{'encoding':_0x3732f3(0x76)});const _0x383299=Object[_0x3732f3(0x95)](_0x2e4bb8)[_0x3732f3(0x91)];return logger[_0x3732f3(0x85)]('init-api',_0x3732f3(0x73),undefined,{'apiFile':_0x2fa304,'clientFile':_0x2678b4,'modelCount':_0x383299,'configName':_0x3d2eba}),{'modelCount':_0x383299,'apiFilePath':_0x2fa304,'clientFilePath':_0x2678b4,'configName':_0x3d2eba};}
|
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x478cc4,_0x19f52e){const _0x564df8=a8_0x462c,_0x45f15b=_0x478cc4();while(!![]){try{const _0x83e91a=parseInt(_0x564df8(0x85))/0x1*(-parseInt(_0x564df8(0x8a))/0x2)+parseInt(_0x564df8(0x89))/0x3*(parseInt(_0x564df8(0x82))/0x4)+parseInt(_0x564df8(0x76))/0x5+-parseInt(_0x564df8(0x90))/0x6*(parseInt(_0x564df8(0x88))/0x7)+parseInt(_0x564df8(0x70))/0x8*(parseInt(_0x564df8(0x99))/0x9)+-parseInt(_0x564df8(0x83))/0xa+parseInt(_0x564df8(0x78))/0xb;if(_0x83e91a===_0x19f52e)break;else _0x45f15b['push'](_0x45f15b['shift']());}catch(_0x421245){_0x45f15b['push'](_0x45f15b['shift']());}}}(a8_0x5274,0x867cc));function a8_0x5274(){const _0x19f954=['\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配置文件','1137828sKmvMY','log','string','\x20\x20错误:\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','请使用\x20--appcode\x20参数,例如:','output','trim','×\x20--datasetcode\x20参数不能为空','1318104JbKJvh','input','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','\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\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','isArray','\x1b[0m','env','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','exit','\x1b[90m*\x20使用配置的应用AppCode:\x20','32oLXgme','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','error','appcode','pull','parse','271415qiEXrj','❌\x20错误:不再支持位置参数方式','11542960SaANwJ','Available\x20commands:','Unknown\x20api\x20command:\x20','×\x20未配置\x20AppCode','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档','length','datasetcode','object','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','filter','411628COxAZe','6638790JSfMAS','join','49PnjgXG','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','×\x20--params\x20参数不是有效的\x20JSON\x20格式','14OBDKjs','21zuPbQR','33298Egwrur','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','flags','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','split'];a8_0x5274=function(){return _0x19f954;};return a8_0x5274();}import{jsx as a8_0x5ecee9}from'react/jsx-runtime';import{render}from'ink';function a8_0x462c(_0x3df1b4,_0xe7d656){const _0x5274ba=a8_0x5274();return a8_0x462c=function(_0x462c40,_0xead651){_0x462c40=_0x462c40-0x6e;let _0x25a23a=_0x5274ba[_0x462c40];return _0x25a23a;},a8_0x462c(_0x3df1b4,_0xe7d656);}import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x28b03a){const _0xf2845f=a8_0x462c,_0x1d2ae7=_0x28b03a[_0xf2845f(0x9a)][0x1];if(_0x28b03a[_0xf2845f(0x8c)]['help']){console[_0xf2845f(0x91)](_0xf2845f(0x9c));return;}if(_0x1d2ae7===_0xf2845f(0x74)){_0x28b03a[_0xf2845f(0x9a)][0x2]&&(console[_0xf2845f(0x72)](_0xf2845f(0x77)),console[_0xf2845f(0x91)](_0xf2845f(0x95)),console[_0xf2845f(0x91)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x28b03a[_0xf2845f(0x9a)][0x2]),process[_0xf2845f(0x6e)](0x1));const _0x30f25e=getConfigAppCode();let _0x44935c=_0x28b03a[_0xf2845f(0x8c)][_0xf2845f(0x73)];const _0x392fa8=typeof _0x28b03a[_0xf2845f(0x8c)]['env']===_0xf2845f(0x92)?_0x28b03a[_0xf2845f(0x8c)][_0xf2845f(0xa0)]:undefined,_0x15f281=_0x28b03a['flags'][_0xf2845f(0x96)];!_0x44935c&&!_0x30f25e&&(console[_0xf2845f(0x72)](_0xf2845f(0x7b)),console['log']('!\x20请使用以下方式之一:'),console[_0xf2845f(0x91)](_0xf2845f(0xa1)),console['log']('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>'),process[_0xf2845f(0x6e)](0x1)),_0x44935c&&_0x30f25e&&_0x44935c===_0x30f25e&&(console[_0xf2845f(0x91)](_0xf2845f(0x6f)+_0x44935c+_0xf2845f(0x9f)),console[_0xf2845f(0x91)]('\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m'),_0x44935c=undefined),render(a8_0x5ecee9(ApiPullUI,{'appCode':_0x44935c,'env':_0x392fa8,'output':_0x15f281}));}else{if(_0x1d2ae7==='doc'){_0x28b03a[_0xf2845f(0x9a)][0x2]&&(console[_0xf2845f(0x72)]('❌\x20错误:不再支持位置参数方式'),console[_0xf2845f(0x91)]('请使用\x20--appcode\x20参数,例如:'),console['log'](_0xf2845f(0x94)+_0x28b03a[_0xf2845f(0x9a)][0x2]),process[_0xf2845f(0x6e)](0x1));const _0x463103=getConfigAppCode();let _0x2e6cb7=_0x28b03a['flags'][_0xf2845f(0x73)];const _0x537180=typeof _0x28b03a[_0xf2845f(0x8c)][_0xf2845f(0xa0)]==='string'?_0x28b03a[_0xf2845f(0x8c)][_0xf2845f(0xa0)]:undefined,_0x104fc0=_0x28b03a[_0xf2845f(0x8c)]['output'],_0x333249=_0x28b03a[_0xf2845f(0x8c)]['params'],_0x261be6=_0x28b03a[_0xf2845f(0x8c)][_0xf2845f(0x7e)];!_0x2e6cb7&&!_0x463103&&(console['error'](_0xf2845f(0x7b)),console['log']('!\x20请使用以下方式之一:'),console[_0xf2845f(0x91)](_0xf2845f(0xa1)),console[_0xf2845f(0x91)](_0xf2845f(0x9b)),process['exit'](0x1));_0x2e6cb7&&_0x463103&&_0x2e6cb7===_0x463103&&(console['log'](_0xf2845f(0x6f)+_0x2e6cb7+_0xf2845f(0x9f)),_0x2e6cb7=undefined);let _0x2db5f1;if(_0x333249)try{_0x2db5f1=JSON[_0xf2845f(0x75)](_0x333249),(typeof _0x2db5f1!==_0xf2845f(0x7f)||_0x2db5f1===null||Array[_0xf2845f(0x9e)](_0x2db5f1))&&(console['error'](_0xf2845f(0x8b)),process[_0xf2845f(0x6e)](0x1));}catch(_0x4a6496){console['error'](_0xf2845f(0x87)),console[_0xf2845f(0x72)](_0xf2845f(0x93)+(_0x4a6496 instanceof Error?_0x4a6496['message']:String(_0x4a6496))),process['exit'](0x1);}let _0x52738c;_0x261be6&&(_0x52738c=_0x261be6[_0xf2845f(0x8e)](',')['map'](_0x35ba37=>_0x35ba37[_0xf2845f(0x97)]())[_0xf2845f(0x81)](_0x3c6e62=>_0x3c6e62[_0xf2845f(0x7d)]>0x0),_0x52738c[_0xf2845f(0x7d)]===0x0&&(console['error'](_0xf2845f(0x98)),process['exit'](0x1)),console[_0xf2845f(0x91)]('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x52738c[_0xf2845f(0x84)](',\x20')+_0xf2845f(0x9f))),render(a8_0x5ecee9(ApiDocUI,{'appCode':_0x2e6cb7,'env':_0x537180,'output':_0x104fc0,'extraParams':_0x2db5f1,'datasetCodes':_0x52738c}));}else console[_0xf2845f(0x72)](_0xf2845f(0x7a)+_0x1d2ae7),console[_0xf2845f(0x91)](_0xf2845f(0x79)),console[_0xf2845f(0x91)](_0xf2845f(0x8f)),console['log'](_0xf2845f(0x86)),console[_0xf2845f(0x91)](_0xf2845f(0x80)),console[_0xf2845f(0x91)]('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console[_0xf2845f(0x91)](''),console['log'](_0xf2845f(0x7c)),console[_0xf2845f(0x91)](_0xf2845f(0x9d)),console['log'](_0xf2845f(0x8d)),console[_0xf2845f(0x91)](_0xf2845f(0x71)),process[_0xf2845f(0x6e)](0x1);}}
|
package/lib/api/pull-silent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x8c778b,_0x19de71){const _0x29aafc=a9_0x856e,_0x7e31ba=_0x8c778b();while(!![]){try{const _0x5b97e5=-parseInt(_0x29aafc(0x1f4))/0x1+-parseInt(_0x29aafc(0x20e))/0x2+parseInt(_0x29aafc(0x210))/0x3*(-parseInt(_0x29aafc(0x1ff))/0x4)+-parseInt(_0x29aafc(0x20a))/0x5+-parseInt(_0x29aafc(0x20b))/0x6+parseInt(_0x29aafc(0x201))/0x7+parseInt(_0x29aafc(0x211))/0x8*(parseInt(_0x29aafc(0x209))/0x9);if(_0x5b97e5===_0x19de71)break;else _0x7e31ba['push'](_0x7e31ba['shift']());}catch(_0x2eb723){_0x7e31ba['push'](_0x7e31ba['shift']());}}}(a9_0x3176,0x4175d));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a9_0x856e(_0x4266de,_0x318b7c){const _0x317634=a9_0x3176();return a9_0x856e=function(_0x856e04,_0x3f35c4){_0x856e04=_0x856e04-0x1f1;let _0x33e1e6=_0x317634[_0x856e04];return _0x33e1e6;},a9_0x856e(_0x4266de,_0x318b7c);}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x28fce3,_0x45ae4a,_0x368c07,_0x58abe9){const _0x47ce1c=a9_0x856e;let _0x34e4d6;try{const _0xf17241=_0x45ae4a?.['trim']()||'';if(_0xf17241){const _0xdd89eb=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0xdd89eb[_0x47ce1c(0x205)](_0xf17241))return console[_0x47ce1c(0x1f1)](_0x47ce1c(0x213)),![];}_0x368c07&&(_0x34e4d6=process[_0x47ce1c(0x1fc)](),process[_0x47ce1c(0x212)](_0x368c07));const _0xedd305=readConfig(),_0x2ff5e7=typeof _0xedd305[_0x47ce1c(0x202)]===_0x47ce1c(0x203)?_0xedd305[_0x47ce1c(0x202)]:undefined,_0x24f1fa=_0x58abe9||_0x2ff5e7||_0x47ce1c(0x1fd);initEnv(_0x24f1fa),console[_0x47ce1c(0x20d)](_0x47ce1c(0x1fb)+_0x24f1fa+')');const {configArray:_0x34976b}=await fetchModelList(_0x28fce3),_0x2b9b82=_0xf17241?_0xf17241+_0x47ce1c(0x200):_0x47ce1c(0x214),_0x39abe9=_0xf17241?_0xf17241+_0x47ce1c(0x1fe):'client';console[_0x47ce1c(0x20d)](_0x47ce1c(0x208)),console[_0x47ce1c(0x20d)](_0x47ce1c(0x1f7)+_0x2b9b82+'.ts\x20-\x20模型配置文件'),console[_0x47ce1c(0x20d)](_0x47ce1c(0x1f7)+_0x39abe9+_0x47ce1c(0x20f)),console['log'](_0x47ce1c(0x1f6)+_0x34976b[_0x47ce1c(0x20c)]+_0x47ce1c(0x206));const _0xa270f8=await generateApiFile(_0x34976b,_0xf17241,_0x28fce3,!![],_0x24f1fa);return console['log'](_0x47ce1c(0x207)+_0x34976b[_0x47ce1c(0x20c)]+'\x20个数据集,生成\x20'+_0xa270f8[_0x47ce1c(0x1fa)]+_0x47ce1c(0x1f2)),_0x368c07&&logger[_0x47ce1c(0x204)](_0x47ce1c(0x1f5),_0x47ce1c(0x1f3)+_0x28fce3,{'projectPath':_0x368c07,'appCode':_0x28fce3,'datasetCount':_0x34976b[_0x47ce1c(0x20c)],'filePrefix':_0xf17241}),!![];}catch(_0xfa171e){const _0x3e985b=_0xfa171e instanceof Error?_0xfa171e['message']:String(_0xfa171e);return console[_0x47ce1c(0x1f1)](_0x47ce1c(0x1f8),_0x3e985b),_0x368c07&&logger[_0x47ce1c(0x1f1)]('create-api-pull',_0x47ce1c(0x1f9)+_0x3e985b,{'appCode':_0x28fce3,'projectPath':_0x368c07}),![];}finally{_0x34e4d6&&process[_0x47ce1c(0x212)](_0x34e4d6);}}function a9_0x3176(){const _0x5c5d01=['online','-client','216PygqmW','-api','2161747qeZZom','env','string','info','test','\x20个数据集...','√\x20成功拉取\x20','*\x20开始生成\x20API\x20配置文件:','976230zaKyAg','208895DaGDwo','1386534YDKUGi','length','log','483544bKOfNe','.ts\x20-\x20客户端实例文件','1278accNcZ','56FiBeQN','chdir','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','api','error','\x20个模型','API\x20配置拉取成功:\x20','262342KNRqQV','create-api-pull','*\x20正在处理\x20','\x20\x20\x20•\x20','×\x20API\x20配置拉取异常:','API\x20配置拉取异常:\x20','modelCount','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','cwd'];a9_0x3176=function(){return _0x5c5d01;};return a9_0x3176();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a10_0x2947(_0x44c952,_0x56ba30){const _0x24590d=a10_0x2459();return a10_0x2947=function(_0x294780,_0x394ad8){_0x294780=_0x294780-0x15a;let _0x553649=_0x24590d[_0x294780];return _0x553649;},a10_0x2947(_0x44c952,_0x56ba30);}const a10_0xf8b73f=a10_0x2947;(function(_0x495c03,_0x1b7c54){const _0x507d16=a10_0x2947,_0x5a3a00=_0x495c03();while(!![]){try{const _0x12a309=parseInt(_0x507d16(0x17f))/0x1+-parseInt(_0x507d16(0x189))/0x2+-parseInt(_0x507d16(0x19e))/0x3+parseInt(_0x507d16(0x166))/0x4*(parseInt(_0x507d16(0x179))/0x5)+parseInt(_0x507d16(0x19a))/0x6*(parseInt(_0x507d16(0x18d))/0x7)+parseInt(_0x507d16(0x175))/0x8*(-parseInt(_0x507d16(0x183))/0x9)+-parseInt(_0x507d16(0x171))/0xa;if(_0x12a309===_0x1b7c54)break;else _0x5a3a00['push'](_0x5a3a00['shift']());}catch(_0x5f52a4){_0x5a3a00['push'](_0x5a3a00['shift']());}}}(a10_0x2459,0x35071));import{jsx as a10_0xaece53,jsxs as a10_0x1cbc0f,Fragment as a10_0x352ca0}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x1d7936 from'ink-spinner';import{useGetOnlineMenuList}from'./get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';function a10_0x2459(){const _0x46b62f=['[✓]','√\x20菜单创建完成','请输入有效的\x20JS\x20https\x20链接','创建菜单失败','472120kXWjnq','catch','JS\x20链接无法访问','yellow','424kZZEND','CSS\x20链接','filter','blue','1875715vJqDNp','join','delete','online','white','path','346543wWJGtE','map','size','red','3402NOskki','*\x20CSS\x20链接:\x20','includes','max','selecting','gray','633074epMxlt','请输入有效的\x20CSS\x20https\x20链接','main','!\x20未找到本地页面,请先创建页面','3101oVrFHk','green','trim','已选择菜单','message','upArrow','done','creating','菜单名称','*\x20请选择要同步的菜单:','test','*\x20正在创建菜单...','add','4164PlzqLZ','dots','input-js','return','1284432MpaGos','\x20输入项目的\x20JS\x20资源链接(https://...)','then','repeat','has','\x20←\x20','value','Lovrabet平台','label','slice','请至少选择一个菜单','input-css','cyan','4eHLPuR','length','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','\x20输入项目的\x20CSS\x20资源链接(https://...)','column','backspace','fill'];a10_0x2459=function(){return _0x46b62f;};return a10_0x2459();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta[a10_0xf8b73f(0x18b)]&&render(a10_0xaece53(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x2580d2=a10_0xf8b73f,{exit:_0x52cb68}=useApp(),{loading:_0x271643,menuList:_0x2adcbe,error:_0x6d2f81}=useGetOnlineMenuList(),_0x4f0acd=getLocalPages(),_0x508d87=_0x2adcbe[_0x2580d2(0x180)](_0xb4088=>_0xb4088[_0x2580d2(0x17e)]),_0xa47c0a=[_0x2580d2(0x195),..._0x4f0acd[_0x2580d2(0x180)](_0x48207c=>_0x48207c[_0x2580d2(0x161)])],_0xaf9eb9=getStringWidth(getMaxWidth(_0xa47c0a,0x4)),_0x22240e=getStringWidth(getMaxWidth([_0x2580d2(0x195)])),[_0x4a3ec3,_0x33ab47]=useState(_0x2580d2(0x187)),[_0x48b046,_0xba4179]=useState(new Set()),[_0x1dc259,_0x404ffb]=useState(0x0),[_0x272b35,_0x524327]=useState(''),[_0x23e01f,_0x4630cd]=useState(''),[_0x53b1da,_0x3191e7]=useState(''),[_0x8c07fd,_0x1b45f8]=useState(''),[_0x26696a,_0x3c2828]=useState([]),_0x409c93=_0x4f0acd[_0x2580d2(0x180)](_0x2a977c=>({'label':_0x2a977c[_0x2580d2(0x161)],'path':_0x2a977c[_0x2580d2(0x17e)],'local':!![],'online':_0x508d87['includes'](_0x2a977c['path'])})),_0x1c6bea=_0x4f0acd['filter'](_0x542765=>{const _0x5a1914=_0x2580d2;return!_0x508d87['includes'](_0x542765[_0x5a1914(0x17e)]);});useEffect(()=>{const _0x422359=_0x2580d2;if(!_0x271643&&_0x4f0acd[_0x422359(0x167)]>0x0&&_0x48b046['size']===0x0){const _0x4bba70=new Set(_0x4f0acd[_0x422359(0x180)]((_0x2d37b0,_0x3dbc03)=>({'page':_0x2d37b0,'index':_0x3dbc03}))[_0x422359(0x177)](({page:_0x56d7c7})=>!_0x508d87[_0x422359(0x185)](_0x56d7c7['path']))[_0x422359(0x180)](({index:_0x4acf8c})=>_0x4acf8c));_0xba4179(_0x4bba70);}},[_0x271643,_0x4f0acd[_0x2580d2(0x167)],_0x508d87['length']]),useInput(async(_0x220005,_0x4a3412)=>{const _0x4fbfca=_0x2580d2;if(_0x4a3ec3===_0x4fbfca(0x187)){if(_0x4a3412[_0x4fbfca(0x192)]){_0x404ffb(_0x23d1ee=>_0x23d1ee>0x0?_0x23d1ee-0x1:_0x4f0acd[_0x4fbfca(0x167)]-0x1);return;}if(_0x4a3412['downArrow']){_0x404ffb(_0x51fa54=>_0x51fa54<_0x4f0acd[_0x4fbfca(0x167)]-0x1?_0x51fa54+0x1:0x0);return;}if(_0x220005==='\x20'){_0xba4179(_0x3a3350=>{const _0xe62374=_0x4fbfca,_0x407eb3=new Set(_0x3a3350);return _0x407eb3[_0xe62374(0x15d)](_0x1dc259)?_0x407eb3[_0xe62374(0x17b)](_0x1dc259):_0x407eb3[_0xe62374(0x199)](_0x1dc259),_0x407eb3;});return;}if(_0x220005==='a'||_0x220005==='A'){const _0x21746b=new Set(_0x4f0acd[_0x4fbfca(0x180)]((_0x5cc2e7,_0x4fee07)=>_0x4fee07));_0xba4179(_0x21746b);return;}if(_0x220005==='i'||_0x220005==='I'||_0x220005==='r'||_0x220005==='R'){_0xba4179(_0x5269b1=>{const _0x4430c6=_0x4fbfca,_0x3328d5=new Set();for(let _0x97ca0d=0x0;_0x97ca0d<_0x4f0acd['length'];_0x97ca0d++){!_0x5269b1[_0x4430c6(0x15d)](_0x97ca0d)&&_0x3328d5[_0x4430c6(0x199)](_0x97ca0d);}return _0x3328d5;});return;}if(_0x220005==='q'||_0x220005==='Q'){_0x52cb68();return;}if(_0x4a3412['return']){if(_0x48b046[_0x4fbfca(0x181)]===0x0){_0x1b45f8(_0x4fbfca(0x163));return;}const _0x3719ee=_0x4f0acd['filter']((_0x49b9d7,_0x5c7b4e)=>_0x48b046['has'](_0x5c7b4e)),_0x4e3795=_0x3719ee[_0x4fbfca(0x180)](_0x581a7e=>_0x581a7e[_0x4fbfca(0x161)])[_0x4fbfca(0x17a)](',\x20');_0x3c2828([{'label':_0x4fbfca(0x190),'value':_0x48b046[_0x4fbfca(0x181)]+'\x20个'}]),_0x1b45f8(''),_0x33ab47(_0x4fbfca(0x19c));return;}return;}if(_0x4a3ec3===_0x4fbfca(0x19c)){if(_0x4a3412['return']){const _0x442bc1=_0x53b1da['trim']();if(_0x442bc1==='')return;if(!isValidJsHttpsUrl(_0x442bc1)){_0x1b45f8(_0x4fbfca(0x16f));return;}if(!await isUrlReachable(_0x442bc1)){_0x1b45f8(_0x4fbfca(0x173));return;}_0x524327(_0x442bc1),_0x3c2828(_0x51a511=>[..._0x51a511,{'label':'JS\x20链接','value':_0x442bc1}]),_0x3191e7(''),_0x1b45f8(''),_0x33ab47(_0x4fbfca(0x164));return;}if(_0x4a3412[_0x4fbfca(0x16b)]||_0x4a3412[_0x4fbfca(0x17b)]){_0x3191e7(_0x5f7ddc=>_0x5f7ddc[_0x4fbfca(0x162)](0x0,-0x1)),_0x1b45f8('');return;}_0x3191e7(_0x5e8be4=>_0x5e8be4+_0x220005);return;}if(_0x4a3ec3===_0x4fbfca(0x164)){if(_0x4a3412[_0x4fbfca(0x19d)]){const _0x2d5fbc=_0x53b1da[_0x4fbfca(0x18f)]();if(_0x2d5fbc==='')return;if(!isValidCssHttpsUrl(_0x2d5fbc)){_0x1b45f8(_0x4fbfca(0x18a));return;}if(!await isUrlReachable(_0x2d5fbc)){_0x1b45f8('CSS\x20链接无法访问');return;}_0x4630cd(_0x2d5fbc),_0x3c2828(_0x8d4c68=>[..._0x8d4c68,{'label':_0x4fbfca(0x176),'value':_0x2d5fbc}]),_0x3191e7(''),_0x1b45f8(''),_0x33ab47(_0x4fbfca(0x194));const _0xf7cdef=_0x4f0acd[_0x4fbfca(0x177)]((_0x226861,_0x867286)=>_0x48b046[_0x4fbfca(0x15d)](_0x867286));createMenus(_0xf7cdef,[_0x272b35,_0x2d5fbc])[_0x4fbfca(0x15b)](()=>{const _0x55551c=_0x4fbfca;_0x33ab47(_0x55551c(0x193)),setTimeout(()=>{_0x52cb68();},0x3e8);})[_0x4fbfca(0x172)](_0xe6f35d=>{const _0x56c2ac=_0x4fbfca;_0x1b45f8(_0xe6f35d[_0x56c2ac(0x191)]||_0x56c2ac(0x170)),_0x33ab47(_0x56c2ac(0x187));});return;}if(_0x4a3412[_0x4fbfca(0x16b)]||_0x4a3412[_0x4fbfca(0x17b)]){_0x3191e7(_0x42f6f0=>_0x42f6f0[_0x4fbfca(0x162)](0x0,-0x1)),_0x1b45f8('');return;}_0x3191e7(_0x25e72e=>_0x25e72e+_0x220005);return;}});if(_0x271643)return a10_0x1cbc0f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0xaece53(Text,{'children':'\x20\x20'}),a10_0xaece53(a10_0x1d7936,{'type':_0x2580d2(0x19b)}),a10_0xaece53(Text,{'children':'\x20正在获取线上菜单列表...'})]});if(_0x6d2f81)return a10_0x1cbc0f(Box,{'flexDirection':_0x2580d2(0x16a),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x1cbc0f(Text,{'color':'red','children':['✗\x20',_0x6d2f81]}),a10_0x1cbc0f(Box,{'marginTop':0x1,'children':[a10_0xaece53(Text,{'color':_0x2580d2(0x188),'children':'提示:使用\x20'}),a10_0xaece53(Text,{'color':_0x2580d2(0x165),'children':'lovrabet\x20auth'}),a10_0xaece53(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x4f0acd[_0x2580d2(0x167)]===0x0)return a10_0xaece53(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0xaece53(Text,{'color':_0x2580d2(0x174),'children':_0x2580d2(0x18c)})});return a10_0x1cbc0f(Box,{'flexDirection':_0x2580d2(0x16a),'marginTop':0x1,'marginBottom':0x1,'children':[_0x4a3ec3===_0x2580d2(0x187)&&a10_0x1cbc0f(a10_0x352ca0,{'children':[a10_0x1cbc0f(Box,{'children':[a10_0x1cbc0f(Text,{'bold':!![],'children':['\x20\x20',_0x2580d2(0x195),getRemainingSpaces(_0xaf9eb9,'菜单名称')]}),a10_0x1cbc0f(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x22240e,_0x2580d2(0x195))]}),a10_0x1cbc0f(Text,{'bold':!![],'children':[_0x2580d2(0x160),getRemainingSpaces(_0x22240e,_0x2580d2(0x195))]})]}),_0x409c93[_0x2580d2(0x180)](_0x1c4610=>a10_0x1cbc0f(Box,{'children':[a10_0x1cbc0f(Text,{'children':['\x20\x20',_0x1c4610[_0x2580d2(0x161)],getRemainingSpaces(_0xaf9eb9,_0x1c4610[_0x2580d2(0x161)])]}),a10_0x1cbc0f(Text,{'color':_0x2580d2(0x18e),'children':[_0x1c4610['local']?'✓':'✗',getRemainingSpaces(_0x22240e,'✓')]}),a10_0x1cbc0f(Text,{'color':_0x1c4610[_0x2580d2(0x17c)]?'green':_0x2580d2(0x182),'children':[_0x1c4610['online']?'✓':'✗',getRemainingSpaces(_0x22240e,'✓')]})]},_0x1c4610['path']))]}),_0x4a3ec3===_0x2580d2(0x187)&&_0x26696a[_0x2580d2(0x167)]===0x0&&a10_0xaece53(Box,{'marginTop':0x1,'children':a10_0xaece53(Text,{'color':_0x2580d2(0x165),'children':'*\x20同步菜单到\x20Lovrabet\x20平台'})}),_0x26696a[_0x2580d2(0x180)]((_0x25fb83,_0x3abeee)=>a10_0x1cbc0f(Box,{'children':[a10_0x1cbc0f(Text,{'color':'green','children':['√\x20',_0x25fb83[_0x2580d2(0x161)],':\x20']}),a10_0xaece53(Text,{'color':_0x2580d2(0x165),'children':_0x25fb83[_0x2580d2(0x15f)]})]},_0x3abeee)),_0x8c07fd&&_0x4a3ec3===_0x2580d2(0x187)&&a10_0xaece53(Box,{'marginTop':0x1,'children':a10_0x1cbc0f(Text,{'color':_0x2580d2(0x182),'children':['✗\x20',_0x8c07fd]})}),_0x4a3ec3===_0x2580d2(0x187)&&a10_0xaece53(a10_0x352ca0,{'children':a10_0x1cbc0f(Box,{'marginTop':_0x26696a[_0x2580d2(0x167)]>0x0||_0x8c07fd?0x1:0x0,'flexDirection':_0x2580d2(0x16a),'children':[a10_0xaece53(Text,{'bold':!![],'children':_0x2580d2(0x196)}),_0x4f0acd[_0x2580d2(0x180)]((_0x220aee,_0x1190ee)=>{const _0xc74b99=_0x2580d2,_0x4c8640=_0x1dc259===_0x1190ee,_0x556cf8=_0x48b046[_0xc74b99(0x15d)](_0x1190ee),_0x2adf87=_0x508d87[_0xc74b99(0x185)](_0x220aee['path']),_0x2bbf60=_0x2adf87?'更新':'新建';return a10_0xaece53(Box,{'children':a10_0x1cbc0f(Text,{'backgroundColor':_0x4c8640?_0xc74b99(0x178):undefined,'color':_0x4c8640?_0xc74b99(0x17d):undefined,'children':['\x20\x20',_0x556cf8?_0xc74b99(0x16d):'[\x20]','\x20',_0x220aee[_0xc74b99(0x161)]]})},_0x220aee[_0xc74b99(0x17e)]);}),a10_0xaece53(Box,{'marginTop':0x1,'children':a10_0x1cbc0f(Text,{'color':'gray','children':['\x20',_0x2580d2(0x168)]})})]})}),_0x4a3ec3===_0x2580d2(0x19c)&&a10_0x1cbc0f(a10_0x352ca0,{'children':[a10_0x1cbc0f(Box,{'children':[a10_0xaece53(Text,{'children':'*\x20JS\x20链接:\x20'}),a10_0xaece53(Text,{'color':_0x2580d2(0x18e),'children':_0x53b1da}),_0x8c07fd&&a10_0x1cbc0f(Text,{'color':'red','children':[_0x2580d2(0x15e),_0x8c07fd]})]}),!_0x8c07fd&&a10_0xaece53(Box,{'children':a10_0xaece53(Text,{'color':_0x2580d2(0x188),'children':_0x2580d2(0x15a)})})]}),_0x4a3ec3==='input-css'&&a10_0x1cbc0f(a10_0x352ca0,{'children':[a10_0x1cbc0f(Box,{'children':[a10_0xaece53(Text,{'children':_0x2580d2(0x184)}),a10_0xaece53(Text,{'color':'green','children':_0x53b1da}),_0x8c07fd&&a10_0x1cbc0f(Text,{'color':_0x2580d2(0x182),'children':[_0x2580d2(0x15e),_0x8c07fd]})]}),!_0x8c07fd&&a10_0xaece53(Box,{'children':a10_0xaece53(Text,{'color':_0x2580d2(0x188),'children':_0x2580d2(0x169)})})]}),_0x4a3ec3===_0x2580d2(0x194)&&a10_0xaece53(Box,{'children':a10_0xaece53(Text,{'children':_0x2580d2(0x198)})}),_0x4a3ec3===_0x2580d2(0x193)&&a10_0xaece53(Box,{'children':a10_0xaece53(Text,{'color':_0x2580d2(0x18e),'children':_0x2580d2(0x16e)})})]});}function getStringWidth(_0x142e3f){const _0x383152=a10_0xf8b73f;let _0x5d9414=0x0;for(const _0x423941 of _0x142e3f){/[\u4e00-\u9fa5]/[_0x383152(0x197)](_0x423941)?_0x5d9414+=0x2:_0x5d9414+=0x1;}return _0x5d9414;}function getRemainingSpaces(_0x17c01a,_0x20d16e){const _0x353ba7=a10_0xf8b73f,_0x2da3bc=getStringWidth(_0x20d16e);return Array(Math[_0x353ba7(0x186)](0x0,_0x17c01a-_0x2da3bc))[_0x353ba7(0x16c)]('\x20')['join']('');}function getMaxWidth(_0xf87d46,_0x3dbb1f=0x2){const _0x540fa5=a10_0xf8b73f;let _0x297d13='',_0x1fd067=0x0;for(const _0x52aeba of _0xf87d46){const _0x35dd61=getStringWidth(_0x52aeba);_0x35dd61>_0x1fd067&&(_0x1fd067=_0x35dd61,_0x297d13=_0x52aeba);}return _0x297d13+'\x20'[_0x540fa5(0x15c)](_0x3dbb1f);}
|
|
1
|
+
(function(_0x42f841,_0x3624fc){const _0xf8165b=a10_0x1ccb,_0x384bcd=_0x42f841();while(!![]){try{const _0x24f56c=parseInt(_0xf8165b(0x1a7))/0x1*(-parseInt(_0xf8165b(0x1b8))/0x2)+parseInt(_0xf8165b(0x1a8))/0x3+-parseInt(_0xf8165b(0x1b4))/0x4*(-parseInt(_0xf8165b(0x1c5))/0x5)+parseInt(_0xf8165b(0x199))/0x6+parseInt(_0xf8165b(0x1a2))/0x7*(-parseInt(_0xf8165b(0x193))/0x8)+-parseInt(_0xf8165b(0x1ba))/0x9+-parseInt(_0xf8165b(0x19c))/0xa*(parseInt(_0xf8165b(0x1a5))/0xb);if(_0x24f56c===_0x3624fc)break;else _0x384bcd['push'](_0x384bcd['shift']());}catch(_0x55bbc4){_0x384bcd['push'](_0x384bcd['shift']());}}}(a10_0x26c9,0x990ec));import{jsx as a10_0x26da09,jsxs as a10_0xcecaec,Fragment as a10_0x310964}from'react/jsx-runtime';function a10_0x1ccb(_0x262743,_0x54cbae){const _0x26c910=a10_0x26c9();return a10_0x1ccb=function(_0x1ccb3b,_0x1fd504){_0x1ccb3b=_0x1ccb3b-0x18e;let _0x4cce3c=_0x26c910[_0x1ccb3b];return _0x4cce3c;},a10_0x1ccb(_0x262743,_0x54cbae);}import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x589473 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';function a10_0x26c9(){const _0x34d518=['[✓]','label','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','*\x20同步菜单到\x20Lovrabet\x20平台','red','\x20输入项目的\x20CSS\x20资源链接(https://...)','yellow','116nVjMUx','size','max','JS\x20链接无法访问','996cfLEXm','\x20正在获取线上菜单列表...','1989135aonfry','return','filter','slice','repeat','green','dots','*\x20正在创建菜单...','cyan','delete','\x20←\x20','169630PiSTcP','菜单名称','请输入有效的\x20CSS\x20https\x20链接','message','backspace','blue','done','input-js','upArrow','CSS\x20链接无法访问','*\x20请选择要同步的菜单:','请输入有效的\x20JS\x20https\x20链接','add','test','JS\x20链接','creating','has','map','567224mWOypn','white','selecting','path','input-css','join','5476440bQPQIA','trim','*\x20JS\x20链接:\x20','5020CDIdmH','includes','catch','[\x20]','downArrow','CSS\x20链接','63XuRBnS','!\x20未找到本地页面,请先创建页面','column','23078BWcmFF','提示:使用\x20','65ixOjuO','2025114vWLvLD','gray','online','fill','length'];a10_0x26c9=function(){return _0x34d518;};return a10_0x26c9();}import.meta['main']&&render(a10_0x26da09(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x3f2bcd=a10_0x1ccb,{exit:_0xc618e1}=useApp(),{loading:_0x582456,menuList:_0x4e1d5f,error:_0x2e6843}=useGetOnlineMenuList(),_0x293eb1=getLocalPages(),_0x1aac22=_0x4e1d5f[_0x3f2bcd(0x192)](_0x2d2c29=>_0x2d2c29[_0x3f2bcd(0x196)]),_0x2a7cd4=['菜单名称',..._0x293eb1['map'](_0x5368c4=>_0x5368c4[_0x3f2bcd(0x1ae)])],_0x2047ba=getStringWidth(getMaxWidth(_0x2a7cd4,0x4)),_0x3f0583=getStringWidth(getMaxWidth(['菜单名称'])),[_0x194968,_0x48068b]=useState(_0x3f2bcd(0x195)),[_0x32499b,_0x15c725]=useState(new Set()),[_0x1763b0,_0x46cc1a]=useState(0x0),[_0x481d34,_0x3cac5a]=useState(''),[_0x4ae81a,_0x4c4355]=useState(''),[_0xe7e6c8,_0x2d7d9c]=useState(''),[_0x4a724c,_0x41716b]=useState(''),[_0x4f9c82,_0x5a35d8]=useState([]),_0x128d5d=_0x293eb1[_0x3f2bcd(0x192)](_0x51f338=>({'label':_0x51f338[_0x3f2bcd(0x1ae)],'path':_0x51f338['path'],'local':!![],'online':_0x1aac22['includes'](_0x51f338[_0x3f2bcd(0x196)])})),_0x5d7746=_0x293eb1[_0x3f2bcd(0x1bc)](_0x2d1fe7=>{const _0x5ed960=_0x3f2bcd;return!_0x1aac22[_0x5ed960(0x19d)](_0x2d1fe7[_0x5ed960(0x196)]);});useEffect(()=>{const _0x2ff1a3=_0x3f2bcd;if(!_0x582456&&_0x293eb1['length']>0x0&&_0x32499b[_0x2ff1a3(0x1b5)]===0x0){const _0x49262d=new Set(_0x293eb1[_0x2ff1a3(0x192)]((_0x1edcba,_0x14084c)=>({'page':_0x1edcba,'index':_0x14084c}))[_0x2ff1a3(0x1bc)](({page:_0x139e16})=>!_0x1aac22[_0x2ff1a3(0x19d)](_0x139e16['path']))[_0x2ff1a3(0x192)](({index:_0xfdcd1d})=>_0xfdcd1d));_0x15c725(_0x49262d);}},[_0x582456,_0x293eb1[_0x3f2bcd(0x1ac)],_0x1aac22[_0x3f2bcd(0x1ac)]]),useInput(async(_0x437b7c,_0x14d261)=>{const _0x357a59=_0x3f2bcd;if(_0x194968==='selecting'){if(_0x14d261[_0x357a59(0x1cd)]){_0x46cc1a(_0x3ef855=>_0x3ef855>0x0?_0x3ef855-0x1:_0x293eb1[_0x357a59(0x1ac)]-0x1);return;}if(_0x14d261[_0x357a59(0x1a0)]){_0x46cc1a(_0x90ffc2=>_0x90ffc2<_0x293eb1[_0x357a59(0x1ac)]-0x1?_0x90ffc2+0x1:0x0);return;}if(_0x437b7c==='\x20'){_0x15c725(_0x468a6c=>{const _0x350af1=_0x357a59,_0x242ac1=new Set(_0x468a6c);return _0x242ac1[_0x350af1(0x191)](_0x1763b0)?_0x242ac1[_0x350af1(0x1c3)](_0x1763b0):_0x242ac1[_0x350af1(0x1d1)](_0x1763b0),_0x242ac1;});return;}if(_0x437b7c==='a'||_0x437b7c==='A'){const _0x5cd67f=new Set(_0x293eb1[_0x357a59(0x192)]((_0x53e92f,_0x189918)=>_0x189918));_0x15c725(_0x5cd67f);return;}if(_0x437b7c==='i'||_0x437b7c==='I'||_0x437b7c==='r'||_0x437b7c==='R'){_0x15c725(_0x74569e=>{const _0x30235c=_0x357a59,_0x425396=new Set();for(let _0x28b340=0x0;_0x28b340<_0x293eb1['length'];_0x28b340++){!_0x74569e[_0x30235c(0x191)](_0x28b340)&&_0x425396[_0x30235c(0x1d1)](_0x28b340);}return _0x425396;});return;}if(_0x437b7c==='q'||_0x437b7c==='Q'){_0xc618e1();return;}if(_0x14d261[_0x357a59(0x1bb)]){if(_0x32499b[_0x357a59(0x1b5)]===0x0){_0x41716b('请至少选择一个菜单');return;}const _0x38a310=_0x293eb1[_0x357a59(0x1bc)]((_0x561185,_0x2e3d4f)=>_0x32499b[_0x357a59(0x191)](_0x2e3d4f)),_0x208e69=_0x38a310[_0x357a59(0x192)](_0x22c1b8=>_0x22c1b8[_0x357a59(0x1ae)])[_0x357a59(0x198)](',\x20');_0x5a35d8([{'label':'已选择菜单','value':_0x32499b[_0x357a59(0x1b5)]+'\x20个'}]),_0x41716b(''),_0x48068b('input-js');return;}return;}if(_0x194968==='input-js'){if(_0x14d261[_0x357a59(0x1bb)]){const _0x4ced48=_0xe7e6c8[_0x357a59(0x19a)]();if(_0x4ced48==='')return;if(!isValidJsHttpsUrl(_0x4ced48)){_0x41716b(_0x357a59(0x1d0));return;}if(!await isUrlReachable(_0x4ced48)){_0x41716b(_0x357a59(0x1b7));return;}_0x3cac5a(_0x4ced48),_0x5a35d8(_0x7d86e4=>[..._0x7d86e4,{'label':_0x357a59(0x18f),'value':_0x4ced48}]),_0x2d7d9c(''),_0x41716b(''),_0x48068b(_0x357a59(0x197));return;}if(_0x14d261[_0x357a59(0x1c9)]||_0x14d261['delete']){_0x2d7d9c(_0x54d32b=>_0x54d32b[_0x357a59(0x1bd)](0x0,-0x1)),_0x41716b('');return;}_0x2d7d9c(_0x41e544=>_0x41e544+_0x437b7c);return;}if(_0x194968===_0x357a59(0x197)){if(_0x14d261['return']){const _0x45214c=_0xe7e6c8['trim']();if(_0x45214c==='')return;if(!isValidCssHttpsUrl(_0x45214c)){_0x41716b(_0x357a59(0x1c7));return;}if(!await isUrlReachable(_0x45214c)){_0x41716b(_0x357a59(0x1ce));return;}_0x4c4355(_0x45214c),_0x5a35d8(_0x55760a=>[..._0x55760a,{'label':_0x357a59(0x1a1),'value':_0x45214c}]),_0x2d7d9c(''),_0x41716b(''),_0x48068b(_0x357a59(0x190));const _0x3e0d34=_0x293eb1[_0x357a59(0x1bc)]((_0x2f21c5,_0xca0485)=>_0x32499b[_0x357a59(0x191)](_0xca0485));createMenus(_0x3e0d34,[_0x481d34,_0x45214c])['then'](()=>{const _0x43e410=_0x357a59;_0x48068b(_0x43e410(0x1cb)),setTimeout(()=>{_0xc618e1();},0x3e8);})[_0x357a59(0x19e)](_0x19fd0f=>{const _0x471a2b=_0x357a59;_0x41716b(_0x19fd0f[_0x471a2b(0x1c8)]||'创建菜单失败'),_0x48068b(_0x471a2b(0x195));});return;}if(_0x14d261[_0x357a59(0x1c9)]||_0x14d261[_0x357a59(0x1c3)]){_0x2d7d9c(_0xf99a8c=>_0xf99a8c[_0x357a59(0x1bd)](0x0,-0x1)),_0x41716b('');return;}_0x2d7d9c(_0x42e5d8=>_0x42e5d8+_0x437b7c);return;}});if(_0x582456)return a10_0xcecaec(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x26da09(Text,{'children':'\x20\x20'}),a10_0x26da09(a10_0x589473,{'type':_0x3f2bcd(0x1c0)}),a10_0x26da09(Text,{'children':_0x3f2bcd(0x1b9)})]});if(_0x2e6843)return a10_0xcecaec(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1b1),'children':['✗\x20',_0x2e6843]}),a10_0xcecaec(Box,{'marginTop':0x1,'children':[a10_0x26da09(Text,{'color':_0x3f2bcd(0x1a9),'children':_0x3f2bcd(0x1a6)}),a10_0x26da09(Text,{'color':_0x3f2bcd(0x1c2),'children':'lovrabet\x20auth'}),a10_0x26da09(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x293eb1['length']===0x0)return a10_0x26da09(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x26da09(Text,{'color':_0x3f2bcd(0x1b3),'children':_0x3f2bcd(0x1a3)})});return a10_0xcecaec(Box,{'flexDirection':_0x3f2bcd(0x1a4),'marginTop':0x1,'marginBottom':0x1,'children':[_0x194968===_0x3f2bcd(0x195)&&a10_0xcecaec(a10_0x310964,{'children':[a10_0xcecaec(Box,{'children':[a10_0xcecaec(Text,{'bold':!![],'children':['\x20\x20',_0x3f2bcd(0x1c6),getRemainingSpaces(_0x2047ba,'菜单名称')]}),a10_0xcecaec(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x3f0583,_0x3f2bcd(0x1c6))]}),a10_0xcecaec(Text,{'bold':!![],'children':['Lovrabet平台',getRemainingSpaces(_0x3f0583,_0x3f2bcd(0x1c6))]})]}),_0x128d5d[_0x3f2bcd(0x192)](_0x547a51=>a10_0xcecaec(Box,{'children':[a10_0xcecaec(Text,{'children':['\x20\x20',_0x547a51[_0x3f2bcd(0x1ae)],getRemainingSpaces(_0x2047ba,_0x547a51[_0x3f2bcd(0x1ae)])]}),a10_0xcecaec(Text,{'color':'green','children':[_0x547a51['local']?'✓':'✗',getRemainingSpaces(_0x3f0583,'✓')]}),a10_0xcecaec(Text,{'color':_0x547a51[_0x3f2bcd(0x1aa)]?_0x3f2bcd(0x1bf):'red','children':[_0x547a51[_0x3f2bcd(0x1aa)]?'✓':'✗',getRemainingSpaces(_0x3f0583,'✓')]})]},_0x547a51[_0x3f2bcd(0x196)]))]}),_0x194968===_0x3f2bcd(0x195)&&_0x4f9c82[_0x3f2bcd(0x1ac)]===0x0&&a10_0x26da09(Box,{'marginTop':0x1,'children':a10_0x26da09(Text,{'color':'cyan','children':_0x3f2bcd(0x1b0)})}),_0x4f9c82['map']((_0x4ce61e,_0x113ee8)=>a10_0xcecaec(Box,{'children':[a10_0xcecaec(Text,{'color':'green','children':['√\x20',_0x4ce61e['label'],':\x20']}),a10_0x26da09(Text,{'color':_0x3f2bcd(0x1c2),'children':_0x4ce61e['value']})]},_0x113ee8)),_0x4a724c&&_0x194968===_0x3f2bcd(0x195)&&a10_0x26da09(Box,{'marginTop':0x1,'children':a10_0xcecaec(Text,{'color':'red','children':['✗\x20',_0x4a724c]})}),_0x194968==='selecting'&&a10_0x26da09(a10_0x310964,{'children':a10_0xcecaec(Box,{'marginTop':_0x4f9c82['length']>0x0||_0x4a724c?0x1:0x0,'flexDirection':'column','children':[a10_0x26da09(Text,{'bold':!![],'children':_0x3f2bcd(0x1cf)}),_0x293eb1[_0x3f2bcd(0x192)]((_0x7d5545,_0x4c51bb)=>{const _0xbe520e=_0x3f2bcd,_0x2b61a0=_0x1763b0===_0x4c51bb,_0x13b277=_0x32499b[_0xbe520e(0x191)](_0x4c51bb),_0x1cb6ae=_0x1aac22[_0xbe520e(0x19d)](_0x7d5545[_0xbe520e(0x196)]),_0x1326a4=_0x1cb6ae?'更新':'新建';return a10_0x26da09(Box,{'children':a10_0xcecaec(Text,{'backgroundColor':_0x2b61a0?_0xbe520e(0x1ca):undefined,'color':_0x2b61a0?_0xbe520e(0x194):undefined,'children':['\x20\x20',_0x13b277?_0xbe520e(0x1ad):_0xbe520e(0x19f),'\x20',_0x7d5545[_0xbe520e(0x1ae)]]})},_0x7d5545[_0xbe520e(0x196)]);}),a10_0x26da09(Box,{'marginTop':0x1,'children':a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1a9),'children':['\x20',_0x3f2bcd(0x1af)]})})]})}),_0x194968===_0x3f2bcd(0x1cc)&&a10_0xcecaec(a10_0x310964,{'children':[a10_0xcecaec(Box,{'children':[a10_0x26da09(Text,{'children':_0x3f2bcd(0x19b)}),a10_0x26da09(Text,{'color':'green','children':_0xe7e6c8}),_0x4a724c&&a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1b1),'children':[_0x3f2bcd(0x1c4),_0x4a724c]})]}),!_0x4a724c&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'color':'gray','children':'\x20输入项目的\x20JS\x20资源链接(https://...)'})})]}),_0x194968==='input-css'&&a10_0xcecaec(a10_0x310964,{'children':[a10_0xcecaec(Box,{'children':[a10_0x26da09(Text,{'children':'*\x20CSS\x20链接:\x20'}),a10_0x26da09(Text,{'color':_0x3f2bcd(0x1bf),'children':_0xe7e6c8}),_0x4a724c&&a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1b1),'children':[_0x3f2bcd(0x1c4),_0x4a724c]})]}),!_0x4a724c&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'color':_0x3f2bcd(0x1a9),'children':_0x3f2bcd(0x1b2)})})]}),_0x194968===_0x3f2bcd(0x190)&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'children':_0x3f2bcd(0x1c1)})}),_0x194968===_0x3f2bcd(0x1cb)&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'color':_0x3f2bcd(0x1bf),'children':'√\x20菜单创建完成'})})]});}function getStringWidth(_0x30e45d){const _0xd03fa4=a10_0x1ccb;let _0x55c36b=0x0;for(const _0x54785a of _0x30e45d){/[\u4e00-\u9fa5]/[_0xd03fa4(0x18e)](_0x54785a)?_0x55c36b+=0x2:_0x55c36b+=0x1;}return _0x55c36b;}function getRemainingSpaces(_0x2eb1f3,_0x3ad29a){const _0x55eec4=a10_0x1ccb,_0x3cd3bc=getStringWidth(_0x3ad29a);return Array(Math[_0x55eec4(0x1b6)](0x0,_0x2eb1f3-_0x3cd3bc))[_0x55eec4(0x1ab)]('\x20')[_0x55eec4(0x198)]('');}function getMaxWidth(_0x2d2722,_0x185aaa=0x2){const _0x51b46d=a10_0x1ccb;let _0x1eacfe='',_0x42d786=0x0;for(const _0x59f2a2 of _0x2d2722){const _0x3d760a=getStringWidth(_0x59f2a2);_0x3d760a>_0x42d786&&(_0x42d786=_0x3d760a,_0x1eacfe=_0x59f2a2);}return _0x1eacfe+'\x20'[_0x51b46d(0x1be)](_0x185aaa);}
|