@lovrabet/cli 1.1.26-beta.5 → 1.1.26-beta.8
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 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-cdn-version/app-menu-sync-cdn-version-ui.js +1 -1
- package/lib/app-menu-cdn-version/cdn-url-compare-table.js +1 -1
- package/lib/app-menu-cdn-version/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/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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x55897f,_0x4acb9a){const _0x6f276d=a0_0x5d1b,_0x468959=_0x55897f();while(!![]){try{const _0x4fa035=-parseInt(_0x6f276d(0xf0))/0x1+-parseInt(_0x6f276d(0xdd))/0x2+parseInt(_0x6f276d(0xe8))/0x3+parseInt(_0x6f276d(0xde))/0x4+parseInt(_0x6f276d(0xeb))/0x5*(parseInt(_0x6f276d(0xe9))/0x6)+-parseInt(_0x6f276d(0xda))/0x7*(-parseInt(_0x6f276d(0xd6))/0x8)+-parseInt(_0x6f276d(0xef))/0x9*(parseInt(_0x6f276d(0xe5))/0xa);if(_0x4fa035===_0x4acb9a)break;else _0x468959['push'](_0x468959['shift']());}catch(_0x47ebe4){_0x468959['push'](_0x468959['shift']());}}}(a0_0x5d4c,0xe0292));import{jsx as a0_0x332d50,jsxs as a0_0x37756d}from'react/jsx-runtime';import{useState}from'react';function a0_0x5d4c(){const _0x3e1135=['red','20yHYvLh','split','endsWith','4783587TCwxzc','1308852ONNmVy','\x20←\x20','5PMpnQb','页面路径\x20','gray','路径不能包含连续的\x20/','8132427qhUJfZ','591117iBnZCp','return','trim','页面路径不合法','35648fuRGrL','\x20Step2:\x20','test','delete','1442Empsbb','\x20直接回车确认,或输入自定义路由地址','column','481932meEfpB','3307376KOtNQd','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','includes','length','\x20已存在,请使用其他路径','existsSync'];a0_0x5d4c=function(){return _0x3e1135;};return a0_0x5d4c();}import{Text,Box,useInput}from'ink';import a0_0x26e0c4 from'node:fs';function a0_0x5d1b(_0x32dfc4,_0x50e513){const _0x5d4c89=a0_0x5d4c();return a0_0x5d1b=function(_0x5d1b5d,_0x38d821){_0x5d1b5d=_0x5d1b5d-0xd5;let _0x4e3c44=_0x5d4c89[_0x5d1b5d];return _0x4e3c44;},a0_0x5d1b(_0x32dfc4,_0x50e513);}export function InputProjectCode(_0x15da8d){const _0x590d60=a0_0x5d1b,{onSubmit:_0x130c80,pagePath:_0x330097}=_0x15da8d,[_0x276be0,_0x10cd51]=useState(''),[_0x4f7a9d,_0x3e4213]=useState(''),_0x136c9b='my-page';function _0xef9a21(_0x38c73c){const _0x4d015f=a0_0x5d1b;if(_0x38c73c[_0x4d015f(0xe1)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x38c73c['startsWith']('/')||_0x38c73c[_0x4d015f(0xe7)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x38c73c[_0x4d015f(0xe0)]('//'))return{'valid':![],'message':_0x4d015f(0xee)};const _0x259467=_0x38c73c[_0x4d015f(0xe6)]('/');for(const _0x4ed562 of _0x259467){if(!_0x4ed562)continue;const _0x534e3b=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x534e3b[_0x4d015f(0xd8)](_0x4ed562))return{'valid':![],'message':_0x4d015f(0xdf)};}return{'valid':!![]};}return useInput((_0xb4cbd,_0x4b66cd)=>{const _0x5380c4=a0_0x5d1b;if(_0x4b66cd[_0x5380c4(0xf1)]){const _0x2056f1=_0x276be0[_0x5380c4(0xf2)]()||_0x136c9b;if(_0x4f7a9d)return;const _0x3aae9c=_0x330097+'/'+_0x2056f1;if(a0_0x26e0c4[_0x5380c4(0xe3)](_0x3aae9c)){_0x3e4213(_0x5380c4(0xec)+_0x2056f1+_0x5380c4(0xe2));return;}_0x130c80(_0x2056f1),_0x10cd51(''),_0x3e4213('');}else _0x4b66cd['backspace']||_0x4b66cd[_0x5380c4(0xd9)]?_0x10cd51(_0x4bc14c=>{const _0x2cfe6b=_0x5380c4,_0x13c150=_0x4bc14c['slice'](0x0,-0x1),{valid:_0x906f10,message:_0x48dcaf}=_0xef9a21(_0x13c150);return _0x3e4213(_0x906f10?'':_0x48dcaf||_0x2cfe6b(0xd5)),_0x13c150;}):_0x10cd51(_0x2f59a6=>{const _0x47ec50=_0x5380c4,_0x469316=_0x2f59a6+_0xb4cbd,{valid:_0x4bbab0,message:_0x513de7}=_0xef9a21(_0x469316);return _0x3e4213(_0x4bbab0?'':_0x513de7||_0x47ec50(0xd5)),_0x469316;});}),a0_0x37756d(Box,{'flexDirection':_0x590d60(0xdc),'children':[a0_0x37756d(Box,{'children':[a0_0x332d50(Text,{'color':'gray','children':_0x590d60(0xd7)}),a0_0x332d50(Text,{'children':'页面路由地址:\x20'}),_0x276be0?a0_0x332d50(Text,{'color':'green','children':_0x276be0}):a0_0x332d50(Text,{'color':_0x590d60(0xed),'children':_0x136c9b}),_0x4f7a9d&&a0_0x37756d(Text,{'color':_0x590d60(0xe4),'children':[_0x590d60(0xea),_0x4f7a9d]})]}),!_0x4f7a9d&&!_0x276be0&&a0_0x332d50(Box,{'children':a0_0x332d50(Text,{'color':_0x590d60(0xed),'children':_0x590d60(0xdb)})})]});}
|
package/lib/add-page/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a1_0x11231e=a1_0x4016;(function(_0x522df4,_0x29cbd4){const _0x13f5b3=a1_0x4016,_0x1b57ef=_0x522df4();while(!![]){try{const _0x4435f2=parseInt(_0x13f5b3(0x139))/0x1*(parseInt(_0x13f5b3(0x14d))/0x2)+-parseInt(_0x13f5b3(0x142))/0x3+-parseInt(_0x13f5b3(0x154))/0x4*(parseInt(_0x13f5b3(0x155))/0x5)+parseInt(_0x13f5b3(0x145))/0x6*(-parseInt(_0x13f5b3(0x13d))/0x7)+-parseInt(_0x13f5b3(0x14e))/0x8*(-parseInt(_0x13f5b3(0x156))/0x9)+parseInt(_0x13f5b3(0x144))/0xa+parseInt(_0x13f5b3(0x146))/0xb;if(_0x4435f2===_0x29cbd4)break;else _0x1b57ef['push'](_0x1b57ef['shift']());}catch(_0x24e978){_0x1b57ef['push'](_0x1b57ef['shift']());}}}(a1_0x2780,0x2b1ed));import{jsx as a1_0x13f924,jsxs as a1_0x53a112,Fragment as a1_0x3c1533}from'react/jsx-runtime';function a1_0x4016(_0x4ab02d,_0x202407){const _0x278062=a1_0x2780();return a1_0x4016=function(_0x4016e1,_0x42a86f){_0x4016e1=_0x4016e1-0x133;let _0x9b93f6=_0x278062[_0x4016e1];return _0x9b93f6;},a1_0x4016(_0x4ab02d,_0x202407);}import{fileURLToPath}from'node:url';import a1_0x1e861c from'node:path';import{useEffect,useState}from'react';function a1_0x2780(){const _0x4337fb=['488568kwCdbu','5DBUIPD','18DVJvsz','now','\x20Step1:\x20','resolve','success','cyan','\x20*\x20页面路径:\x20','页面添加失败:\x20','setLogPath','5255kMqbTu','info','正在创建页面,请稍候…','\x20*\x20页面文件已创建,可直接通过路由访问','7cTWICY','catch','\x20*\x20路由地址:\x20','开始添加页面:\x20','pages','182124nSncIE','join','1549410BQyTCz','1966122zdUqAS','1211848iNNKXm','\x20Step2:\x20','green','../../templates/pages','\x20*\x20页面创建成功!','页面添加成功:\x20','processTemplate','98IrAtfu','658216BNJqjp','add-page','已输入的页面路由\x20','dirname','src','gray'];a1_0x2780=function(){return _0x4337fb;};return a1_0x2780();}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_0x1e861c[a1_0x11231e(0x151)](fileURLToPath(import.meta['url'])),pageTemplateDir=a1_0x1e861c['resolve'](__dirname,a1_0x11231e(0x149)),projectDir=process['cwd']();export const AddPage=()=>{const _0xba3de8=a1_0x11231e,{exit:_0x3ef67f}=useApp(),[_0x330d5a,_0x129410]=useState(''),[_0x518cf1,_0x429435]=useState(''),[_0x11a90e,_0x2f1c43]=useState(![]),[_0x5c8eea,_0x10ec86]=useState(![]),_0x49d0e1=a1_0x1e861c[_0xba3de8(0x143)](projectDir,_0xba3de8(0x152),_0xba3de8(0x141)),_0x314fc7=a1_0x1e861c['join'](_0x49d0e1,_0x518cf1),_0x563be7=a1_0x1e861c[_0xba3de8(0x143)]('src',_0xba3de8(0x141),_0x518cf1);useEffect(()=>{const _0x9f313f=_0xba3de8,_0x5d539d=a1_0x1e861c[_0x9f313f(0x133)](pageTemplateDir,_0x330d5a);if(_0x330d5a&&_0x518cf1){_0x2f1c43(!![]),logger[_0x9f313f(0x138)](process['cwd']());const _0x1b862f=Date['now']();logger[_0x9f313f(0x13a)](_0x9f313f(0x14f),_0x9f313f(0x140)+_0x518cf1,{'template':_0x330d5a,'targetPath':_0x563be7}),TemplateReplacer[_0x9f313f(0x14c)](_0x5d539d,a1_0x1e861c[_0x9f313f(0x143)](_0x49d0e1,_0x518cf1),_0x518cf1,_0x330d5a)['then'](()=>{const _0x5542e1=_0x9f313f,_0x25afe3=Date[_0x5542e1(0x157)]()-_0x1b862f;logger[_0x5542e1(0x134)](_0x5542e1(0x14f),_0x5542e1(0x14b)+_0x518cf1,_0x25afe3,{'template':_0x330d5a,'targetPath':_0x563be7,'routePath':_0x518cf1}),_0x10ec86(!![]);})[_0x9f313f(0x13e)](_0x16cc15=>{const _0x1584d7=_0x9f313f,_0x5d23c9=Date['now']()-_0x1b862f;logger['error'](_0x1584d7(0x14f),_0x1584d7(0x137)+_0x518cf1,{'template':_0x330d5a,'targetPath':_0x563be7,'error':_0x16cc15 instanceof Error?_0x16cc15['message']:String(_0x16cc15),'duration':_0x5d23c9});})['finally'](()=>{_0x2f1c43(![]);});}},[_0x330d5a,_0x518cf1]),useEffect(()=>{_0x5c8eea&&setTimeout(()=>{_0x3ef67f();});},[_0x5c8eea]);if(_0x330d5a)return a1_0x53a112(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x53a112(Box,{'children':[a1_0x13f924(Text,{'color':_0xba3de8(0x153),'children':_0xba3de8(0x158)}),a1_0x13f924(Text,{'children':'已选择页面模板\x20'}),a1_0x13f924(Text,{'color':_0xba3de8(0x148),'children':_0x330d5a})]}),_0x518cf1?a1_0x53a112(Box,{'children':[a1_0x13f924(Text,{'color':'gray','children':_0xba3de8(0x147)}),a1_0x13f924(Text,{'children':_0xba3de8(0x150)}),a1_0x13f924(Text,{'color':'green','children':_0x518cf1})]}):a1_0x13f924(InputProjectCode,{'pagePath':_0x314fc7,'onSubmit':_0x429435}),_0x518cf1&&_0x11a90e?a1_0x53a112(Box,{'marginTop':0x1,'children':[a1_0x13f924(Box,{'width':'4'}),a1_0x13f924(Text,{'children':_0xba3de8(0x13b)})]}):null,_0x5c8eea?a1_0x53a112(a1_0x3c1533,{'children':[a1_0x13f924(Box,{'marginTop':0x1,'children':a1_0x13f924(Text,{'color':'gray','children':_0xba3de8(0x14a)})}),a1_0x53a112(Box,{'children':[a1_0x13f924(Text,{'color':_0xba3de8(0x153),'children':_0xba3de8(0x136)}),a1_0x13f924(Text,{'color':'green','children':_0x563be7})]}),a1_0x53a112(Box,{'children':[a1_0x13f924(Text,{'color':'gray','children':_0xba3de8(0x13f)}),a1_0x53a112(Text,{'color':_0xba3de8(0x148),'children':['/',_0x518cf1]})]}),a1_0x13f924(Box,{'marginTop':0x1,'children':a1_0x13f924(Text,{'color':_0xba3de8(0x135),'children':_0xba3de8(0x13c)})})]}):null]});return a1_0x13f924(SelectPageTemplate,{'onSelect':_0x129410});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x40e1c2,_0x46bad4){const _0x31d3c1=a2_0xf4c7,_0x1c7ee9=_0x40e1c2();while(!![]){try{const _0x3a4790=-parseInt(_0x31d3c1(0x196))/0x1*(-parseInt(_0x31d3c1(0x180))/0x2)+-parseInt(_0x31d3c1(0x18a))/0x3+parseInt(_0x31d3c1(0x17b))/0x4*(-parseInt(_0x31d3c1(0x189))/0x5)+-parseInt(_0x31d3c1(0x184))/0x6*(-parseInt(_0x31d3c1(0x18d))/0x7)+-parseInt(_0x31d3c1(0x197))/0x8+-parseInt(_0x31d3c1(0x198))/0x9*(-parseInt(_0x31d3c1(0x19c))/0xa)+parseInt(_0x31d3c1(0x17c))/0xb;if(_0x3a4790===_0x46bad4)break;else _0x1c7ee9['push'](_0x1c7ee9['shift']());}catch(_0xabac98){_0x1c7ee9['push'](_0x1c7ee9['shift']());}}}(a2_0x4543,0x28ec2));function a2_0x4543(){const _0x17fb1b=['resolve','82411dUNBZF','../..','return','sdk-fetch','请选择您要创建的页面模板','gray','dirname','error','sort','1qcVlKg','1225496ZYdSJy','3231ZHBLhX','map','\x20\x20\x20\x20\x20\x20\x20\x20','onSelect','3490kDpGus','label','green','186152VXFzFk','354948XdlFsv','url','name','\x20\x20\x20\x20\x20\x20>\x20','615236HTNeoo','localeCompare','column','正在加载页面模板...','24LDTLvV','downArrow','\x20Step1:\x20','获取模板列表失败:','isDirectory','20lMUvMj','15936qbZRWa','templates/pages'];a2_0x4543=function(){return _0x17fb1b;};return a2_0x4543();}function a2_0xf4c7(_0x461bc6,_0x598d94){const _0x4543e9=a2_0x4543();return a2_0xf4c7=function(_0xf4c798,_0x54004e){_0xf4c798=_0xf4c798-0x17b;let _0x12b30f=_0x4543e9[_0xf4c798];return _0x12b30f;},a2_0xf4c7(_0x461bc6,_0x598d94);}import{jsx as a2_0x3fc7e2,jsxs as a2_0x57bcf4}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x1f5e20 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x2b1117=a2_0xf4c7;try{const _0x2f211b=fileURLToPath(import.meta[_0x2b1117(0x17d)]),_0xd21eb4=a2_0x1f5e20[_0x2b1117(0x18c)](a2_0x1f5e20[_0x2b1117(0x193)](_0x2f211b),_0x2b1117(0x18e)),_0x373a24=a2_0x1f5e20['join'](_0xd21eb4,_0x2b1117(0x18b)),_0x31b92c=await readdir(_0x373a24,{'withFileTypes':!![]}),_0xa31a4=_0x31b92c['filter'](_0x2a4d47=>_0x2a4d47[_0x2b1117(0x188)]())[_0x2b1117(0x199)](_0x2b5b66=>({'label':_0x2b5b66[_0x2b1117(0x17e)]}))[_0x2b1117(0x195)]((_0x2f4b41,_0xec9dc7)=>_0x2f4b41[_0x2b1117(0x19d)][_0x2b1117(0x181)](_0xec9dc7['label']));return _0xa31a4;}catch(_0x2e7fc5){return console[_0x2b1117(0x194)](_0x2b1117(0x187),_0x2e7fc5),[{'label':'blank'},{'label':_0x2b1117(0x190)}];}}export function SelectPageTemplate(_0x38d44d){const _0xcdd7d6=a2_0xf4c7,[_0x164c1e,_0x20420e]=useState(0x0),[_0x181375,_0x5b7135]=useState([]),[_0x371136,_0x598786]=useState(!![]);useEffect(()=>{async function _0x1f610f(){const _0x50d1b2=await getTemplateList();_0x5b7135(_0x50d1b2),_0x598786(![]);}_0x1f610f();},[]),useInput((_0x2cbc85,_0x15630d)=>{const _0x37132b=a2_0xf4c7;if(_0x371136)return;if(_0x15630d[_0x37132b(0x18f)]){const _0x1e3a44=_0x181375[_0x164c1e];_0x1e3a44&&_0x38d44d[_0x37132b(0x19b)](_0x1e3a44[_0x37132b(0x19d)]);}_0x15630d['upArrow']&&_0x20420e(_0x46a181=>_0x46a181===0x0?_0x181375['length']-0x1:_0x46a181-0x1),_0x15630d[_0x37132b(0x185)]&&_0x20420e(_0x42bc53=>_0x42bc53===_0x181375['length']-0x1?0x0:_0x42bc53+0x1);});if(_0x371136)return a2_0x3fc7e2(Box,{'flexDirection':_0xcdd7d6(0x182),'paddingY':0x1,'children':a2_0x57bcf4(Box,{'children':[a2_0x3fc7e2(Text,{'color':'gray','children':_0xcdd7d6(0x186)}),a2_0x3fc7e2(Text,{'children':_0xcdd7d6(0x183)})]})});return a2_0x57bcf4(Box,{'flexDirection':_0xcdd7d6(0x182),'paddingY':0x1,'children':[a2_0x57bcf4(Box,{'children':[a2_0x3fc7e2(Text,{'color':_0xcdd7d6(0x192),'children':_0xcdd7d6(0x186)}),a2_0x3fc7e2(Text,{'children':_0xcdd7d6(0x191)})]}),_0x181375[_0xcdd7d6(0x199)]((_0x15eb1e,_0x522dca)=>{const _0x3f5dad=_0xcdd7d6,_0x8ce0f9=_0x522dca===_0x164c1e,_0x25d470=_0x8ce0f9?_0x3f5dad(0x17f)+_0x15eb1e[_0x3f5dad(0x19d)]:_0x3f5dad(0x19a)+_0x15eb1e[_0x3f5dad(0x19d)];return a2_0x3fc7e2(Box,{'children':a2_0x3fc7e2(Text,{'color':_0x8ce0f9?_0x3f5dad(0x19e):undefined,'children':_0x25d470})},_0x25d470);})]});}
|
package/lib/api/api-doc-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f1f84,_0x222513){const _0x100749=a3_0x1ae3,_0xf94c14=_0x4f1f84();while(!![]){try{const _0x32ba6b=-parseInt(_0x100749(0xd4))/0x1+parseInt(_0x100749(0xe3))/0x2*(-parseInt(_0x100749(0xcf))/0x3)+parseInt(_0x100749(0xb6))/0x4*(parseInt(_0x100749(0xba))/0x5)+parseInt(_0x100749(0xdd))/0x6*(parseInt(_0x100749(0xd8))/0x7)+parseInt(_0x100749(0xcd))/0x8+parseInt(_0x100749(0xe6))/0x9*(-parseInt(_0x100749(0xdc))/0xa)+parseInt(_0x100749(0xc5))/0xb;if(_0x32ba6b===_0x222513)break;else _0xf94c14['push'](_0xf94c14['shift']());}catch(_0x5cd08c){_0xf94c14['push'](_0xf94c14['shift']());}}}(a3_0x4e5c,0x565dc));function a3_0x1ae3(_0x46ec8d,_0x5597f5){const _0x4e5c4c=a3_0x4e5c();return a3_0x1ae3=function(_0x1ae328,_0x31300d){_0x1ae328=_0x1ae328-0xaf;let _0x39c4a4=_0x4e5c4c[_0x1ae328];return _0x39c4a4;},a3_0x1ae3(_0x46ec8d,_0x5597f5);}import{jsx as a3_0x4c5e20,jsxs as a3_0x467c1b,Fragment as a3_0x167b30}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';function a3_0x4e5c(){const _0xc42912=['使用指定的应用AppCode:\x20','正在生成\x20','√\x20文档生成完成!成功\x20','string','yellow','文档生成失败:\x20','api-doc','includes','lovrabet\x20auth','5223636NUIAfN','指定的数据集代码都不存在:\x20','💡\x20请使用\x20','使用配置的应用AppCode:\x20','env','gray','error','*\x20生成的文档文件:','922688HQBFra','\x20重新登录后再试','954rIUsrB','cyan','\x1b[33m!\x20以下数据集代码不存在:\x20','red','\x1b[90m*\x20从\x20','55617gIGxYe','filter','green','message','487879uownGa','未找到任何数据集','\x20-\x20','未提供应用AppCode,且配置中也没有默认值','3706190AQWuTf','6wjKiTn','map','\x20个数据集的文档...','success',',\x20失败\x20','length','98asAFWQ','\x20个匹配的数据集\x1b[0m','.md\x20(','9PVJxcR','正在获取数据集列表...','column','\x20个数据集中筛选出\x20','./docs','join','log','cwd','datasetName','12620SPLbMA','dim','datasetCode','online','215wkAQaY','white'];a3_0x4e5c=function(){return _0xc42912;};return a3_0x4e5c();}export const ApiDocUI=({appCode:_0x51acfb,env:_0x3897de,output:_0xafe2be,extraParams:_0x2a6724,datasetCodes:_0x4b091f})=>{const _0xf75745=a3_0x1ae3,{exit:_0x5f3188}=useApp(),[_0x83fdd7,_0x307d33]=useState(![]),[_0x36dcd9,_0x7f356f]=useState(''),[_0x410fec,_0x3d8b6a]=useState(![]),[_0x544f4b,_0x94a324]=useState(null),[_0x1ac572,_0x4bf11f]=useState(null),[_0x176735,_0x67c208]=useState(0x0),_0x4dc392=readConfig(),_0x55e767=getConfigAppCode(),_0x469af1=_0x51acfb||_0x55e767,_0x38838d=typeof _0x4dc392?.[_0xf75745(0xc9)]===_0xf75745(0xbf)?_0x4dc392[_0xf75745(0xc9)]:undefined,_0x29dbd4=_0x3897de||_0x38838d||_0xf75745(0xb9);initEnv(_0x29dbd4);const _0xd03994=_0xafe2be||_0xf75745(0xb1),_0x5a7c08=_0x51acfb?_0xf75745(0xbc)+_0x469af1:_0xf75745(0xc8)+_0x469af1;useEffect(()=>{_0x307d33(!![]),_0x5d45b4();},[]),useEffect(()=>{(_0x410fec||_0x544f4b)&&_0x5f3188();},[_0x410fec,_0x544f4b,_0x5f3188]);async function _0x5d45b4(){const _0x503e6b=_0xf75745;if(!_0x469af1){_0x94a324(_0x503e6b(0xdb));return;}try{logger['setLogPath'](process[_0x503e6b(0xb4)]()),_0x7f356f(_0x503e6b(0xe7));const {configArray:_0x3a8274}=await fetchModelList(_0x469af1);_0x67c208(_0x3a8274[_0x503e6b(0xe2)]);if(_0x3a8274[_0x503e6b(0xe2)]===0x0){_0x94a324(_0x503e6b(0xd9));return;}let _0x40d870=_0x3a8274;if(_0x4b091f&&_0x4b091f[_0x503e6b(0xe2)]>0x0){_0x40d870=_0x3a8274[_0x503e6b(0xd5)](_0x27d4f5=>_0x4b091f[_0x503e6b(0xc3)](_0x27d4f5[_0x503e6b(0xb8)]));const _0xa97cdf=_0x40d870[_0x503e6b(0xde)](_0x54c8cf=>_0x54c8cf[_0x503e6b(0xb8)]),_0x2cd6cf=_0x4b091f[_0x503e6b(0xd5)](_0x33a0bd=>!_0xa97cdf[_0x503e6b(0xc3)](_0x33a0bd));_0x2cd6cf[_0x503e6b(0xe2)]>0x0&&console[_0x503e6b(0xb3)](_0x503e6b(0xd1)+_0x2cd6cf[_0x503e6b(0xb2)](',\x20')+'\x1b[0m');if(_0x40d870[_0x503e6b(0xe2)]===0x0){_0x94a324(_0x503e6b(0xc6)+_0x4b091f[_0x503e6b(0xb2)](',\x20'));return;}console[_0x503e6b(0xb3)](_0x503e6b(0xd3)+_0x3a8274[_0x503e6b(0xe2)]+_0x503e6b(0xb0)+_0x40d870[_0x503e6b(0xe2)]+_0x503e6b(0xe4));}_0x7f356f(_0x503e6b(0xbd)+_0x40d870['length']+_0x503e6b(0xdf));const _0x53a6e8=await generateDatasetDocs(_0x40d870,_0x469af1,_0xd03994,(_0x36452e,_0x3a6d55,_0x3bffb8)=>{const _0x3451af=_0x503e6b;_0x7f356f(_0x3451af(0xbd)+_0x3bffb8+_0x3451af(0xe5)+_0x36452e+'/'+_0x3a6d55+')');},_0x2a6724);_0x4bf11f(_0x53a6e8),_0x3d8b6a(!![]);const _0x5a89a7=_0x53a6e8[_0x503e6b(0xd5)](_0x471588=>_0x471588[_0x503e6b(0xe0)])[_0x503e6b(0xe2)],_0x2617a7=_0x53a6e8[_0x503e6b(0xd5)](_0x13d152=>!_0x13d152[_0x503e6b(0xe0)])[_0x503e6b(0xe2)];logger[_0x503e6b(0xe0)](_0x503e6b(0xc2),'文档生成完成',undefined,{'totalCount':_0x53a6e8['length'],'successCount':_0x5a89a7,'failCount':_0x2617a7,'outputDir':_0xd03994});}catch(_0x1b4e1e){const _0x4eec35=_0x1b4e1e instanceof Error?_0x1b4e1e[_0x503e6b(0xd7)]:String(_0x1b4e1e);logger[_0x503e6b(0xcb)]('api-doc',_0x503e6b(0xc1)+_0x4eec35,{'appCode':_0x469af1,'outputDir':_0xd03994}),_0x94a324(_0x503e6b(0xc1)+_0x4eec35);}finally{_0x307d33(![]);}}const _0x46ed16=_0x1ac572?.[_0xf75745(0xd5)](_0x4aafa1=>_0x4aafa1[_0xf75745(0xe0)])['length']||0x0,_0x580543=_0x1ac572?.[_0xf75745(0xd5)](_0x53397a=>!_0x53397a['success'])[_0xf75745(0xe2)]||0x0;return a3_0x467c1b(Box,{'flexDirection':_0xf75745(0xaf),'children':[(_0x83fdd7||_0x410fec)&&a3_0x467c1b(Box,{'children':[a3_0x4c5e20(Text,{'color':_0xf75745(0xca),'children':'*\x20'}),a3_0x4c5e20(Text,{'color':_0x51acfb?_0xf75745(0xbb):_0xf75745(0xb7),'children':_0x5a7c08})]}),_0x83fdd7&&a3_0x4c5e20(Box,{'children':a3_0x467c1b(Text,{'children':['🚀\x20',_0x36dcd9,'\x20(环境:\x20',_0x29dbd4,')']})}),_0x410fec&&_0x1ac572&&a3_0x467c1b(Box,{'flexDirection':_0xf75745(0xaf),'children':[a3_0x4c5e20(Box,{'children':a3_0x467c1b(Text,{'color':_0xf75745(0xd6),'children':[_0xf75745(0xbe),_0x46ed16,'\x20个',_0x580543>0x0&&_0xf75745(0xe1)+_0x580543+'\x20个']})}),a3_0x4c5e20(Box,{'marginTop':0x1,'children':a3_0x467c1b(Text,{'color':'gray','children':['*\x20共处理\x20',_0x176735,'\x20个数据集']})}),a3_0x467c1b(Box,{'marginTop':0x1,'children':[a3_0x4c5e20(Text,{'color':_0xf75745(0xca),'children':'*\x20输出目录:\x20'}),a3_0x4c5e20(Text,{'color':_0xf75745(0xd0),'children':_0xd03994})]}),_0x46ed16>0x0&&a3_0x467c1b(a3_0x167b30,{'children':[a3_0x4c5e20(Box,{'marginTop':0x1,'children':a3_0x4c5e20(Text,{'color':_0xf75745(0xca),'children':_0xf75745(0xcc)})}),_0x1ac572[_0xf75745(0xd5)](_0x5d4370=>_0x5d4370[_0xf75745(0xe0)])[_0xf75745(0xde)]((_0x2b699b,_0x840150)=>a3_0x467c1b(Box,{'marginLeft':0x2,'children':[a3_0x467c1b(Text,{'color':_0xf75745(0xd0),'children':['•\x20',_0x2b699b['filePath']]}),a3_0x467c1b(Text,{'color':_0xf75745(0xb7),'children':[_0xf75745(0xda),_0x2b699b[_0xf75745(0xb5)]]})]},_0x840150))]}),_0x580543>0x0&&a3_0x467c1b(a3_0x167b30,{'children':[a3_0x4c5e20(Box,{'marginTop':0x1,'children':a3_0x4c5e20(Text,{'color':'yellow','children':'⚠️\x20以下数据集生成失败:'})}),_0x1ac572['filter'](_0x13f778=>!_0x13f778[_0xf75745(0xe0)])[_0xf75745(0xde)]((_0x25e41f,_0x1e326c)=>a3_0x467c1b(Box,{'marginLeft':0x2,'flexDirection':_0xf75745(0xaf),'children':[a3_0x467c1b(Text,{'color':_0xf75745(0xd2),'children':['•\x20',_0x25e41f[_0xf75745(0xb5)],'\x20(',_0x25e41f[_0xf75745(0xb8)],')']}),_0x25e41f[_0xf75745(0xcb)]&&a3_0x4c5e20(Box,{'marginLeft':0x2,'children':a3_0x4c5e20(Text,{'color':_0xf75745(0xb7),'children':_0x25e41f[_0xf75745(0xcb)]})})]},_0x1e326c))]})]}),_0x544f4b&&a3_0x467c1b(Box,{'flexDirection':'column','children':[a3_0x4c5e20(Box,{'children':a3_0x467c1b(Text,{'color':_0xf75745(0xd2),'children':['❌\x20',_0x544f4b]})}),_0x544f4b[_0xf75745(0xc3)]('登录')&&a3_0x467c1b(Box,{'marginTop':0x1,'children':[a3_0x4c5e20(Text,{'color':_0xf75745(0xc0),'children':_0xf75745(0xc7)}),a3_0x4c5e20(Text,{'color':_0xf75745(0xd0),'children':_0xf75745(0xc4)}),a3_0x4c5e20(Text,{'color':_0xf75745(0xc0),'children':_0xf75745(0xce)})]})]})]});};
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a4_0x626d4=a4_0x1f03;(function(_0x2cdb6d,_0x5c530a){const _0x4b15af=a4_0x1f03,_0x4964f9=_0x2cdb6d();while(!![]){try{const _0x237b89=parseInt(_0x4b15af(0x13f))/0x1*(-parseInt(_0x4b15af(0x13a))/0x2)+parseInt(_0x4b15af(0x150))/0x3+-parseInt(_0x4b15af(0x14a))/0x4+-parseInt(_0x4b15af(0x143))/0x5+parseInt(_0x4b15af(0x141))/0x6*(-parseInt(_0x4b15af(0x13e))/0x7)+-parseInt(_0x4b15af(0x156))/0x8+parseInt(_0x4b15af(0x14c))/0x9*(parseInt(_0x4b15af(0x140))/0xa);if(_0x237b89===_0x5c530a)break;else _0x4964f9['push'](_0x4964f9['shift']());}catch(_0x52c930){_0x4964f9['push'](_0x4964f9['shift']());}}}(a4_0x1651,0x5f346));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x1b73f7 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a4_0x1f03(_0x1f82ca,_0x3d0e6c){const _0x165177=a4_0x1651();return a4_0x1f03=function(_0x1f0342,_0x52d134){_0x1f0342=_0x1f0342-0x12e;let _0x2a137b=_0x165177[_0x1f0342];return _0x2a137b;},a4_0x1f03(_0x1f82ca,_0x3d0e6c);}function a4_0x1651(){const _0x18b0bd=['join','log','\x0a共有\x20','tableName','.md\x20-\x20','stringify','length','响应数据格式错误\x20(','✓\x20成功生成:\x20','status','404056BAPjTN','✗\x20失败:\x20','获取文档失败\x20(','utf8','1795857KQwHzn','2ttMgSA','3200khmaNd','6LiLTrz','.md\x20(','3179435FGZyNs','.md','datasetCode','success','error','/api/node-toolbox/api-doc-generator','json','3099820uSkuzz','./docs','67590sGinCA','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','生成文档失败:\x20','data','1308285IoYhmR','生成文档成功:\x20','name','message','\x20个数据集需要生成文档\x0a','api-doc','3023104VlooyN','markdown','string','push','):缺少\x20data.markdown\x20字段'];a4_0x1651=function(){return _0x18b0bd;};return a4_0x1651();}import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x474916){const _0xe5df29=a4_0x1f03,{appCode:_0x806a,datasetCode:_0x579c3a,datasetId:_0x375b1f,extraParams:_0x222ade}=_0x474916,_0x15e479=getApiDomain(),_0x130148=_0x15e479+_0xe5df29(0x148),_0x11b29a={'appCode':_0x806a,'datasetCode':_0x579c3a,'datasetId':_0x375b1f,..._0x222ade||{}},_0x43291b=await fetch(_0x130148,{'method':'POST','headers':{'Content-Type':'application/json','Cookie':getCookie()},'body':JSON[_0xe5df29(0x135)](_0x11b29a)});if(!_0x43291b['ok']){if(_0x43291b[_0xe5df29(0x139)]===0x191)throw new Error(_0xe5df29(0x14d));let _0x59c58e='';try{_0x59c58e=await _0x43291b['text']();}catch(_0x4a18f4){}throw new Error(_0xe5df29(0x13c)+_0x579c3a+'),HTTP状态码:\x20'+_0x43291b[_0xe5df29(0x139)]+(_0x59c58e?'\x0a'+_0x59c58e:''));}const _0x29df4d=await _0x43291b[_0xe5df29(0x149)]();if(!_0x29df4d[_0xe5df29(0x14f)]||typeof _0x29df4d[_0xe5df29(0x14f)]['markdown']!==_0xe5df29(0x158))throw new Error(_0xe5df29(0x137)+_0x579c3a+_0xe5df29(0x12f));return _0x29df4d['data'][_0xe5df29(0x157)];}function delay(_0x563451){return new Promise(_0x2d1335=>setTimeout(_0x2d1335,_0x563451));}export async function generateDatasetDocs(_0x2c27b7,_0x4bd5f1,_0x33937f=a4_0x626d4(0x14b),_0x5ef620,_0x2450be){const _0x523dd9=a4_0x626d4;mkdirSync(_0x33937f,{'recursive':!![]});const _0x30b517=[],_0x1a5d54=_0x2c27b7[_0x523dd9(0x136)];console[_0x523dd9(0x131)](_0x523dd9(0x132)+_0x1a5d54+_0x523dd9(0x154));for(let _0x168016=0x0;_0x168016<_0x2c27b7[_0x523dd9(0x136)];_0x168016++){const _0x15754e=_0x2c27b7[_0x168016],_0x1bc343=_0x168016+0x1,_0x4db5b9=_0x15754e[_0x523dd9(0x133)];try{console[_0x523dd9(0x131)]('['+_0x1bc343+'/'+_0x1a5d54+']\x20正在生成:\x20'+_0x4db5b9+_0x523dd9(0x142)+_0x15754e[_0x523dd9(0x152)]+')');_0x5ef620&&_0x5ef620(_0x1bc343,_0x1a5d54,_0x4db5b9);const _0x2e2387=await fetchDatasetDoc({'appCode':_0x4bd5f1,'datasetCode':_0x15754e[_0x523dd9(0x145)],'datasetId':_0x15754e['id'],'enableAI':![],'extraParams':_0x2450be}),_0x4048aa=a4_0x1b73f7[_0x523dd9(0x130)](_0x33937f,_0x4db5b9+'.md');writeFileSync(_0x4048aa,_0x2e2387,{'encoding':_0x523dd9(0x13d)}),console[_0x523dd9(0x131)](_0x523dd9(0x138)+_0x4db5b9+_0x523dd9(0x144)),logger[_0x523dd9(0x146)](_0x523dd9(0x155),_0x523dd9(0x151)+_0x4db5b9,undefined,{'datasetCode':_0x15754e[_0x523dd9(0x145)],'datasetName':_0x15754e[_0x523dd9(0x152)],'filePath':_0x4048aa,'progress':_0x1bc343+'/'+_0x1a5d54}),_0x30b517['push']({'datasetCode':_0x15754e[_0x523dd9(0x145)],'datasetName':_0x15754e[_0x523dd9(0x152)],'filePath':_0x4048aa,'success':!![]}),_0x1bc343<_0x1a5d54&&await delay(0x1388);}catch(_0x347ca8){const _0x31dcda=_0x347ca8 instanceof Error?_0x347ca8[_0x523dd9(0x153)]:String(_0x347ca8);console['log'](_0x523dd9(0x13b)+_0x4db5b9+_0x523dd9(0x134)+_0x31dcda+'\x0a'),logger[_0x523dd9(0x147)](_0x523dd9(0x155),_0x523dd9(0x14e)+_0x15754e[_0x523dd9(0x145)],{'datasetCode':_0x15754e[_0x523dd9(0x145)],'datasetName':_0x15754e[_0x523dd9(0x152)],'error':_0x31dcda,'progress':_0x1bc343+'/'+_0x1a5d54}),_0x30b517[_0x523dd9(0x12e)]({'datasetCode':_0x15754e[_0x523dd9(0x145)],'datasetName':_0x15754e[_0x523dd9(0x152)],'filePath':'','success':![],'error':_0x31dcda}),_0x1bc343<_0x1a5d54&&(console[_0x523dd9(0x131)]('等待\x203\x20秒...\x0a'),await delay(0xbb8));}}return _0x30b517;}
|
package/lib/api/api-pull-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f44a1,_0x41445d){const _0x5b1b2d=a5_0x3c6c,_0x4d3655=_0x1f44a1();while(!![]){try{const _0x3ce22a=parseInt(_0x5b1b2d(0x144))/0x1*(-parseInt(_0x5b1b2d(0x127))/0x2)+-parseInt(_0x5b1b2d(0x11d))/0x3*(-parseInt(_0x5b1b2d(0x132))/0x4)+parseInt(_0x5b1b2d(0x120))/0x5*(-parseInt(_0x5b1b2d(0x129))/0x6)+-parseInt(_0x5b1b2d(0x119))/0x7+parseInt(_0x5b1b2d(0x11a))/0x8*(-parseInt(_0x5b1b2d(0x11b))/0x9)+parseInt(_0x5b1b2d(0x148))/0xa+-parseInt(_0x5b1b2d(0x114))/0xb*(-parseInt(_0x5b1b2d(0x11c))/0xc);if(_0x3ce22a===_0x41445d)break;else _0x4d3655['push'](_0x4d3655['shift']());}catch(_0x268885){_0x4d3655['push'](_0x4d3655['shift']());}}}(a5_0x1729,0xaf975));import{jsx as a5_0x1e5563,jsxs as a5_0x10d052}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a5_0x1729(){const _0x3b1d79=['\x20个数据集,生成','257250UOcbug','2824asgibR','15111sAmHIW','435300OIXojr','749829QXceWc','error','message','5EUbHVH','datasetCount','yellow','api','api-pull','cwd','{\x20lovrabetClient\x20}','2732bkDZgG','endsWith','8316126VwZtLq','未提供应用AppCode,且配置中也没有默认值','string','column','\x20-\x20客户端实例文件','env','使用配置的应用AppCode:\x20','includes','modelCount','20NGdhom','cyan','!\x20原始数据集\x20','\x20from\x20\x27@/','dim','duplicateCount','join','gray','online','\x20个模型)','slice','\x20个模型','*\x20导入方式:','setLogPath','client','√\x20成功拉取\x20','\x20个,过滤重复','💡\x20请使用\x20','882KREmzg','-\x20模型配置文件\x20(','-api','red','7672010cFEOjP','green','.ts','拉取\x20API\x20配置失败:\x20','583GjCLUG','\x20重新登录后再试','-client','使用指定的应用AppCode:\x20'];a5_0x1729=function(){return _0x3b1d79;};return a5_0x1729();}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';function a5_0x3c6c(_0x559c90,_0x1459fa){const _0x1729bb=a5_0x1729();return a5_0x3c6c=function(_0x3c6c1a,_0xf41e67){_0x3c6c1a=_0x3c6c1a-0x112;let _0x1527be=_0x1729bb[_0x3c6c1a];return _0x1527be;},a5_0x3c6c(_0x559c90,_0x1459fa);}export const ApiPullUI=({appCode:_0x48d31d,env:_0x2066ab,output:_0x4a8f4c})=>{const _0x228e92=a5_0x3c6c,{exit:_0x486a}=useApp(),[_0xd5dc21,_0x73af5b]=useState(![]),[_0xb28150,_0x412821]=useState(![]),[_0x5ae2e2,_0x35a365]=useState(null),[_0x21782a,_0x1eaaf4]=useState(null),_0x1936b9=readConfig(),_0x1ead9a=getConfigAppCode(),_0x73997e=_0x48d31d||_0x1ead9a,_0x296fcf=typeof _0x1936b9?.[_0x228e92(0x12e)]===_0x228e92(0x12b)?_0x1936b9[_0x228e92(0x12e)]:undefined,_0x40cc38=_0x2066ab||_0x296fcf||_0x228e92(0x13a);initEnv(_0x40cc38);const _0x138205=_0x4a8f4c||'./src/api/',_0x30c6dd=_0x48d31d&&_0x48d31d[_0x228e92(0x130)]('-')?_0x48d31d['split']('-')[_0x228e92(0x13c)](0x1)[_0x228e92(0x138)]('-'):'',_0x1c8ca7=_0x48d31d?_0x228e92(0x117)+_0x73997e:_0x228e92(0x12f)+_0x73997e,_0x2522f7=_0x30c6dd?_0x30c6dd+_0x228e92(0x146):_0x228e92(0x123),_0x467b17=_0x30c6dd?_0x30c6dd+_0x228e92(0x116):'client';useEffect(()=>{_0x73af5b(!![]),_0x5d5740();},[]),useEffect(()=>{(_0xb28150||_0x5ae2e2)&&_0x486a();},[_0xb28150,_0x5ae2e2,_0x486a]);async function _0x5d5740(){const _0x585901=_0x228e92;if(!_0x73997e){_0x35a365(_0x585901(0x12a));return;}try{logger[_0x585901(0x13f)](process[_0x585901(0x125)]());const {configArray:_0x275370}=await fetchModelList(_0x73997e),_0x23803a=_0x275370['length'],_0x4e3e78=!_0x48d31d,_0x4c64b7=await generateApiFile(_0x275370,_0x30c6dd,_0x73997e,_0x4e3e78,_0x40cc38,_0x138205),_0x4a6161=_0x138205[_0x585901(0x128)]('/')?_0x138205:_0x138205+'/';_0x1eaaf4({'api':''+_0x4a6161+_0x2522f7+_0x585901(0x112),'client':''+_0x4a6161+_0x467b17+_0x585901(0x112),'modelCount':_0x4c64b7[_0x585901(0x131)],'datasetCount':_0x23803a,'originalCount':_0x23803a,'duplicateCount':0x0}),_0x412821(!![]);}catch(_0x4814b6){const _0x37391d=_0x4814b6 instanceof Error?_0x4814b6[_0x585901(0x11f)]:String(_0x4814b6);logger[_0x585901(0x11e)](_0x585901(0x124),_0x585901(0x113)+_0x37391d,{'appCode':_0x73997e,'error':_0x37391d}),_0x35a365(_0x585901(0x113)+_0x37391d);}finally{_0x73af5b(![]);}}return a5_0x10d052(Box,{'flexDirection':_0x228e92(0x12c),'children':[(_0xd5dc21||_0xb28150)&&a5_0x10d052(Box,{'children':[a5_0x1e5563(Text,{'color':_0x228e92(0x139),'children':'*\x20'}),a5_0x1e5563(Text,{'color':_0x48d31d?'white':_0x228e92(0x136),'children':_0x1c8ca7})]}),_0xd5dc21&&a5_0x1e5563(Box,{'children':a5_0x10d052(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x40cc38,')']})}),_0xb28150&&_0x21782a&&a5_0x10d052(Box,{'flexDirection':_0x228e92(0x12c),'children':[a5_0x1e5563(Box,{'children':a5_0x10d052(Text,{'color':_0x228e92(0x149),'children':[_0x228e92(0x141),_0x21782a[_0x228e92(0x121)],_0x228e92(0x118),'\x20',_0x21782a[_0x228e92(0x131)],_0x228e92(0x13d)]})}),_0x21782a[_0x228e92(0x137)]>0x0&&a5_0x1e5563(Box,{'marginTop':0x1,'children':a5_0x10d052(Text,{'color':_0x228e92(0x122),'children':[_0x228e92(0x134),_0x21782a['originalCount'],_0x228e92(0x142),'\x20',_0x21782a[_0x228e92(0x137)],'\x20个']})}),a5_0x1e5563(Box,{'marginTop':0x1,'children':a5_0x1e5563(Text,{'color':_0x228e92(0x139),'children':'*\x20已生成文件:'})}),a5_0x10d052(Box,{'marginLeft':0x2,'children':[a5_0x10d052(Text,{'color':'cyan','children':['•\x20',_0x21782a[_0x228e92(0x123)]]}),a5_0x10d052(Text,{'color':_0x228e92(0x136),'children':['\x20',_0x228e92(0x145),_0x21782a['modelCount'],_0x228e92(0x13b)]})]}),a5_0x10d052(Box,{'marginLeft':0x2,'children':[a5_0x10d052(Text,{'color':_0x228e92(0x133),'children':['•\x20',_0x21782a[_0x228e92(0x140)]]}),a5_0x1e5563(Text,{'color':_0x228e92(0x136),'children':_0x228e92(0x12d)})]}),a5_0x1e5563(Box,{'marginTop':0x1,'children':a5_0x1e5563(Text,{'color':_0x228e92(0x139),'children':_0x228e92(0x13e)})}),a5_0x1e5563(Box,{'marginLeft':0x2,'children':a5_0x10d052(Text,{'color':_0x228e92(0x122),'children':['import\x20',_0x228e92(0x126),_0x228e92(0x135),_0x21782a[_0x228e92(0x140)]['replace'](/^\.\//,'')['replace'](_0x228e92(0x112),''),'\x27']})})]}),_0x5ae2e2&&a5_0x10d052(Box,{'flexDirection':_0x228e92(0x12c),'children':[a5_0x1e5563(Box,{'children':a5_0x10d052(Text,{'color':_0x228e92(0x147),'children':['❌\x20',_0x5ae2e2]})}),_0x5ae2e2[_0x228e92(0x130)]('登录')&&a5_0x10d052(Box,{'marginTop':0x1,'children':[a5_0x1e5563(Text,{'color':_0x228e92(0x122),'children':_0x228e92(0x143)}),a5_0x1e5563(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a5_0x1e5563(Text,{'color':'yellow','children':_0x228e92(0x115)})]})]})]});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19f2ed,_0x20f675){const _0x59d433=a6_0x4866,_0x3b0f80=_0x19f2ed();while(!![]){try{const _0x54d8aa=-parseInt(_0x59d433(0x117))/0x1+-parseInt(_0x59d433(0x116))/0x2*(parseInt(_0x59d433(0x119))/0x3)+parseInt(_0x59d433(0x104))/0x4*(-parseInt(_0x59d433(0x113))/0x5)+-parseInt(_0x59d433(0x105))/0x6*(-parseInt(_0x59d433(0x111))/0x7)+parseInt(_0x59d433(0x106))/0x8+-parseInt(_0x59d433(0x10b))/0x9*(parseInt(_0x59d433(0x11b))/0xa)+-parseInt(_0x59d433(0x107))/0xb*(-parseInt(_0x59d433(0x114))/0xc);if(_0x54d8aa===_0x20f675)break;else _0x3b0f80['push'](_0x3b0f80['shift']());}catch(_0x35e85d){_0x3b0f80['push'](_0x3b0f80['shift']());}}}(a6_0x3a74,0x79e48));function a6_0x4866(_0x1a0766,_0x5a8558){const _0x3a74b3=a6_0x3a74();return a6_0x4866=function(_0x48666f,_0x4e0479){_0x48666f=_0x48666f-0x104;let _0x4e2ab0=_0x3a74b3[_0x48666f];return _0x4e2ab0;},a6_0x4866(_0x1a0766,_0x5a8558);}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0x3a74(){const _0x5eeb89=['119592vYIRjC','status','998254FqxTON','809155ArGGFM','info','6hCOQPs','正在从服务器拉取模型列表...\x20(环境:\x20','316600LcpVRU','23324VdqItL','23124gJiMli','2992448BlYpmT','1551kJUzpc','获取数据集失败:\x20','fetch-model-list','configArray','18CCYWiq','获取数据集失败,HTTP状态码:\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','success','count','&otype=array','1253bYyppR','data','85bSeJJD'];a6_0x3a74=function(){return _0x5eeb89;};return a6_0x3a74();}import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x15ba0d){const _0x19b25a=a6_0x4866,_0x2f57dd=getEnv(),_0x227070=getApiDomain()+'/api/node-toolbox/dataset/model-list?appcode='+_0x15ba0d+_0x19b25a(0x110);logger[_0x19b25a(0x118)](_0x19b25a(0x109),_0x19b25a(0x11a)+_0x2f57dd+')',{'apiUrl':_0x227070});const _0x7d3b5f=await fetch(_0x227070,{'headers':{'Cookie':getCookie()}});if(!_0x7d3b5f['ok']){if(_0x7d3b5f[_0x19b25a(0x115)]===0x191)throw new Error(_0x19b25a(0x10d));throw new Error(_0x19b25a(0x10c)+_0x7d3b5f[_0x19b25a(0x115)]);}const _0x1afa78=await _0x7d3b5f['json']();if(!_0x1afa78[_0x19b25a(0x10e)])throw new Error(_0x19b25a(0x108)+(_0x1afa78['message']||'未知错误'));return{'configArray':_0x1afa78[_0x19b25a(0x112)][_0x19b25a(0x10a)],'count':_0x1afa78[_0x19b25a(0x112)][_0x19b25a(0x10f)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a7_0x1d72(){const _0x2bde62=['452601OeuzCT','192606FskbiM','slice','name','-client','12jQzptk','api.ts.tpl','-api','keys','{\x20apiConfigName:\x20\x22','init-api','\x22\x20}','format','./src/api/','utf8','string','env','2632042kuWefB','{\x20apiConfigName:\x20','API\x20文件生成成功!','.ts','3ESlRYf','CONFIG_NAMES.DEFAULT','success','client','client.ts.tpl','1855820adAHyj','88znoIGq','length','replaceApiContent','typescript','4248795HZHXnZ','../..','forEach',',\x20env:\x20\x22','online','dirname','key','7481220kaznqD','resolve','258634ZeeYBo','join','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code'];a7_0x1d72=function(){return _0x2bde62;};return a7_0x1d72();}const a7_0x3d6078=a7_0x3abb;(function(_0x2f40f1,_0x5ee2e6){const _0x527d06=a7_0x3abb,_0x1389e6=_0x2f40f1();while(!![]){try{const _0x470578=-parseInt(_0x527d06(0x86))/0x1+-parseInt(_0x527d06(0x82))/0x2*(parseInt(_0x527d06(0x9a))/0x3)+parseInt(_0x527d06(0x74))/0x4+parseInt(_0x527d06(0x79))/0x5+parseInt(_0x527d06(0x8a))/0x6*(-parseInt(_0x527d06(0x96))/0x7)+-parseInt(_0x527d06(0x75))/0x8*(parseInt(_0x527d06(0x85))/0x9)+parseInt(_0x527d06(0x80))/0xa;if(_0x470578===_0x5ee2e6)break;else _0x1389e6['push'](_0x1389e6['shift']());}catch(_0x2729f3){_0x1389e6['push'](_0x1389e6['shift']());}}}(a7_0x1d72,0x6a222));import a7_0x17e1a0 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x222cab from'node:path';import{fileURLToPath}from'node:url';function a7_0x3abb(_0x590fa2,_0x3c9bf7){const _0x1d7248=a7_0x1d72();return a7_0x3abb=function(_0x3abb52,_0x4b55b6){_0x3abb52=_0x3abb52-0x74;let _0x10d68c=_0x1d7248[_0x3abb52];return _0x10d68c;},a7_0x3abb(_0x590fa2,_0x3c9bf7);}import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0xc6d5b5,_0x5d5624='',_0x52ba0b,_0x350e51=![],_0x28060d,_0x282770=a7_0x3d6078(0x92)){const _0x2a49c5=a7_0x3d6078,_0x1f400c=readConfig(),_0x56d5da=_0x52ba0b||_0x1f400c?.['app'];if(typeof _0x56d5da!=='string'||!_0x56d5da)throw new Error(_0x2a49c5(0x84));const _0x458f54=_0x350e51?_0x2a49c5(0x9b):'\x22'+_0x56d5da+'\x22',_0x2d2c14=typeof _0x1f400c[_0x2a49c5(0x95)]===_0x2a49c5(0x94)?_0x1f400c[_0x2a49c5(0x95)]:undefined,_0x39e301=_0x28060d||_0x2d2c14||_0x2a49c5(0x7d),_0x3fe1b2=_0x39e301!=='online';let _0x2d3267;if(_0x350e51)_0x3fe1b2?_0x2d3267=_0x2a49c5(0x97)+_0x458f54+_0x2a49c5(0x7c)+_0x39e301+_0x2a49c5(0x90):_0x2d3267='';else{const _0x2255da=_0x3fe1b2?_0x2a49c5(0x7c)+_0x39e301+'\x22':'';_0x2d3267=_0x2a49c5(0x8e)+_0x56d5da+'\x22'+_0x2255da+'\x20}';}const _0x1d6dcb=_0x5d5624?_0x5d5624+_0x2a49c5(0x8c):'api',_0x146777=_0x5d5624?_0x5d5624+_0x2a49c5(0x89):_0x2a49c5(0x9d),_0x4d4d86={};_0xc6d5b5[_0x2a49c5(0x7b)](_0x30716e=>{const _0x41957d=_0x2a49c5;_0x4d4d86[_0x30716e[_0x41957d(0x7f)]]={'tableName':_0x30716e['tableName'],'datasetCode':_0x30716e['datasetCode'],'name':_0x30716e[_0x41957d(0x88)]||''};});const _0x369f3a=fileURLToPath(import.meta['url']),_0x8a1065=a7_0x222cab[_0x2a49c5(0x81)](a7_0x222cab[_0x2a49c5(0x7e)](_0x369f3a),_0x2a49c5(0x7a)),_0x24d17a=a7_0x222cab[_0x2a49c5(0x83)](_0x8a1065,'templates/generate-api'),_0x136436=a7_0x222cab[_0x2a49c5(0x83)](_0x24d17a,_0x2a49c5(0x8b)),_0xef3a51=a7_0x222cab['join'](_0x24d17a,_0x2a49c5(0x9e)),_0x40762e=_0x282770['endsWith']('/')?_0x282770[_0x2a49c5(0x87)](0x0,-0x1):_0x282770;mkdirSync(_0x40762e,{'recursive':!![]});const _0xf89c97=readFileSync(_0x136436,'utf8'),_0x47a643=TemplateReplacer['replaceApiContent'](_0xf89c97,_0x56d5da,_0x4d4d86,Object[_0x2a49c5(0x8d)](_0x4d4d86)[0x0],_0x1d6dcb,_0x458f54),_0x44a317=await a7_0x17e1a0[_0x2a49c5(0x91)](_0x47a643,{'parser':_0x2a49c5(0x78)}),_0x4e74b6=_0x40762e+'/'+_0x1d6dcb+_0x2a49c5(0x99);writeFileSync(_0x4e74b6,_0x44a317,{'encoding':_0x2a49c5(0x93)});const _0xf5bb3=readFileSync(_0xef3a51,_0x2a49c5(0x93)),_0xdc6d74=TemplateReplacer[_0x2a49c5(0x77)](_0xf5bb3,_0x56d5da,_0x4d4d86,Object[_0x2a49c5(0x8d)](_0x4d4d86)[0x0],_0x1d6dcb,_0x458f54,_0x2d3267),_0x38a7c1=await a7_0x17e1a0['format'](_0xdc6d74,{'parser':'typescript'}),_0x463ae9=_0x40762e+'/'+_0x146777+_0x2a49c5(0x99);writeFileSync(_0x463ae9,_0x38a7c1,{'encoding':_0x2a49c5(0x93)});const _0x1354b5=Object[_0x2a49c5(0x8d)](_0x4d4d86)[_0x2a49c5(0x76)];return logger[_0x2a49c5(0x9c)](_0x2a49c5(0x8f),_0x2a49c5(0x98),undefined,{'apiFile':_0x4e74b6,'clientFile':_0x463ae9,'modelCount':_0x1354b5,'configName':_0x458f54}),{'modelCount':_0x1354b5,'apiFilePath':_0x4e74b6,'clientFilePath':_0x463ae9,'configName':_0x458f54};}
|
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a8_0x45e5(_0x4e1f6b,_0x2462d6){const _0x49fc5f=a8_0x49fc();return a8_0x45e5=function(_0x45e50a,_0x1e329c){_0x45e50a=_0x45e50a-0x1b8;let _0x5634bc=_0x49fc5f[_0x45e50a];return _0x5634bc;},a8_0x45e5(_0x4e1f6b,_0x2462d6);}(function(_0x41d6e1,_0x365493){const _0x390573=a8_0x45e5,_0x201cc=_0x41d6e1();while(!![]){try{const _0xaf9c7e=parseInt(_0x390573(0x1cc))/0x1*(parseInt(_0x390573(0x1d3))/0x2)+-parseInt(_0x390573(0x1e8))/0x3+-parseInt(_0x390573(0x1b9))/0x4+parseInt(_0x390573(0x1e0))/0x5+-parseInt(_0x390573(0x1cf))/0x6+-parseInt(_0x390573(0x1e5))/0x7+parseInt(_0x390573(0x1bb))/0x8*(parseInt(_0x390573(0x1c8))/0x9);if(_0xaf9c7e===_0x365493)break;else _0x201cc['push'](_0x201cc['shift']());}catch(_0x35f672){_0x201cc['push'](_0x201cc['shift']());}}}(a8_0x49fc,0xa82b6));import{jsx as a8_0x36ff05}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a8_0x49fc(){const _0x3e4681=['join','4480452zyCbHJ','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','11384tXcqwu','❌\x20错误:不再支持位置参数方式','请使用\x20--appcode\x20参数,例如:','\x1b[90m*\x20使用配置的应用AppCode:\x20','pull','trim','\x1b[90m*\x20仅生成指定数据集的文档:\x20','error','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','\x1b[0m','exit','!\x20请使用以下方式之一:','message','24615OsFwIr','map','appcode','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','1538xXdrXz','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','3340098bSAmHo','×\x20--datasetcode\x20参数不能为空','filter','input','416CVpBpF','datasetcode','help','env','split','object','×\x20未配置\x20AppCode','output','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','length','\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\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\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','1759410fjOIDX','doc','isArray','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','flags','9170371MiRwjf','×\x20--params\x20参数不是有效的\x20JSON\x20格式','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','2664060mwZwGG','log','parse'];a8_0x49fc=function(){return _0x3e4681;};return a8_0x49fc();}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x2a68f9){const _0x52a802=a8_0x45e5,_0x15293d=_0x2a68f9['input'][0x1];if(_0x2a68f9[_0x52a802(0x1e4)][_0x52a802(0x1d5)]){console['log']('\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');return;}if(_0x15293d===_0x52a802(0x1bf)){_0x2a68f9[_0x52a802(0x1d2)][0x2]&&(console[_0x52a802(0x1c2)](_0x52a802(0x1bc)),console[_0x52a802(0x1e9)]('请使用\x20--appcode\x20参数,例如:'),console[_0x52a802(0x1e9)](_0x52a802(0x1e7)+_0x2a68f9[_0x52a802(0x1d2)][0x2]),process[_0x52a802(0x1c5)](0x1));const _0x50def8=getConfigAppCode();let _0x4ec051=_0x2a68f9[_0x52a802(0x1e4)][_0x52a802(0x1ca)];const _0x4d4aad=typeof _0x2a68f9[_0x52a802(0x1e4)]['env']==='string'?_0x2a68f9['flags'][_0x52a802(0x1d6)]:undefined,_0x4f6f84=_0x2a68f9[_0x52a802(0x1e4)][_0x52a802(0x1da)];!_0x4ec051&&!_0x50def8&&(console[_0x52a802(0x1c2)](_0x52a802(0x1d9)),console['log'](_0x52a802(0x1c6)),console[_0x52a802(0x1e9)](_0x52a802(0x1df)),console[_0x52a802(0x1e9)](_0x52a802(0x1ce)),process[_0x52a802(0x1c5)](0x1)),_0x4ec051&&_0x50def8&&_0x4ec051===_0x50def8&&(console[_0x52a802(0x1e9)](_0x52a802(0x1be)+_0x4ec051+_0x52a802(0x1c4)),console['log'](_0x52a802(0x1db)),_0x4ec051=undefined),render(a8_0x36ff05(ApiPullUI,{'appCode':_0x4ec051,'env':_0x4d4aad,'output':_0x4f6f84}));}else{if(_0x15293d===_0x52a802(0x1e1)){_0x2a68f9[_0x52a802(0x1d2)][0x2]&&(console[_0x52a802(0x1c2)](_0x52a802(0x1bc)),console[_0x52a802(0x1e9)](_0x52a802(0x1bd)),console[_0x52a802(0x1e9)](_0x52a802(0x1ba)+_0x2a68f9['input'][0x2]),process[_0x52a802(0x1c5)](0x1));const _0x539888=getConfigAppCode();let _0x52f4d0=_0x2a68f9[_0x52a802(0x1e4)][_0x52a802(0x1ca)];const _0x3c0536=typeof _0x2a68f9['flags'][_0x52a802(0x1d6)]==='string'?_0x2a68f9[_0x52a802(0x1e4)][_0x52a802(0x1d6)]:undefined,_0x1393d6=_0x2a68f9[_0x52a802(0x1e4)][_0x52a802(0x1da)],_0x3a89f6=_0x2a68f9[_0x52a802(0x1e4)]['params'],_0x1fd89c=_0x2a68f9['flags'][_0x52a802(0x1d4)];!_0x52f4d0&&!_0x539888&&(console['error']('×\x20未配置\x20AppCode'),console['log'](_0x52a802(0x1c6)),console[_0x52a802(0x1e9)](_0x52a802(0x1df)),console[_0x52a802(0x1e9)](_0x52a802(0x1cd)),process[_0x52a802(0x1c5)](0x1));_0x52f4d0&&_0x539888&&_0x52f4d0===_0x539888&&(console['log'](_0x52a802(0x1be)+_0x52f4d0+_0x52a802(0x1c4)),_0x52f4d0=undefined);let _0x304a58;if(_0x3a89f6)try{_0x304a58=JSON[_0x52a802(0x1ea)](_0x3a89f6),(typeof _0x304a58!==_0x52a802(0x1d8)||_0x304a58===null||Array[_0x52a802(0x1e2)](_0x304a58))&&(console[_0x52a802(0x1c2)](_0x52a802(0x1e3)),process[_0x52a802(0x1c5)](0x1));}catch(_0x1be76b){console[_0x52a802(0x1c2)](_0x52a802(0x1e6)),console[_0x52a802(0x1c2)]('\x20\x20错误:\x20'+(_0x1be76b instanceof Error?_0x1be76b[_0x52a802(0x1c7)]:String(_0x1be76b))),process['exit'](0x1);}let _0x2b1cef;_0x1fd89c&&(_0x2b1cef=_0x1fd89c[_0x52a802(0x1d7)](',')[_0x52a802(0x1c9)](_0x396fc0=>_0x396fc0[_0x52a802(0x1c0)]())[_0x52a802(0x1d1)](_0x4ec989=>_0x4ec989[_0x52a802(0x1dc)]>0x0),_0x2b1cef['length']===0x0&&(console[_0x52a802(0x1c2)](_0x52a802(0x1d0)),process[_0x52a802(0x1c5)](0x1)),console[_0x52a802(0x1e9)](_0x52a802(0x1c1)+_0x2b1cef[_0x52a802(0x1b8)](',\x20')+'\x1b[0m')),render(a8_0x36ff05(ApiDocUI,{'appCode':_0x52f4d0,'env':_0x3c0536,'output':_0x1393d6,'extraParams':_0x304a58,'datasetCodes':_0x2b1cef}));}else console[_0x52a802(0x1c2)]('Unknown\x20api\x20command:\x20'+_0x15293d),console['log']('Available\x20commands:'),console[_0x52a802(0x1e9)](_0x52a802(0x1dd)),console[_0x52a802(0x1e9)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console[_0x52a802(0x1e9)](_0x52a802(0x1cb)),console[_0x52a802(0x1e9)]('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console[_0x52a802(0x1e9)](''),console['log'](_0x52a802(0x1de)),console[_0x52a802(0x1e9)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console[_0x52a802(0x1e9)](_0x52a802(0x1c3)),console['log']('\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),process[_0x52a802(0x1c5)](0x1);}}
|
package/lib/api/pull-silent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a9_0x2d40(_0x19eeff,_0x3998bb){const _0x35e196=a9_0x35e1();return a9_0x2d40=function(_0x2d403c,_0x128d56){_0x2d403c=_0x2d403c-0x1ea;let _0x213a90=_0x35e196[_0x2d403c];return _0x213a90;},a9_0x2d40(_0x19eeff,_0x3998bb);}(function(_0x468fbe,_0x5563ec){const _0x27cbbd=a9_0x2d40,_0x52b8dd=_0x468fbe();while(!![]){try{const _0x57b500=-parseInt(_0x27cbbd(0x20c))/0x1+-parseInt(_0x27cbbd(0x1fa))/0x2*(parseInt(_0x27cbbd(0x203))/0x3)+-parseInt(_0x27cbbd(0x20d))/0x4*(parseInt(_0x27cbbd(0x208))/0x5)+parseInt(_0x27cbbd(0x1ed))/0x6+parseInt(_0x27cbbd(0x1ec))/0x7*(-parseInt(_0x27cbbd(0x1fc))/0x8)+parseInt(_0x27cbbd(0x206))/0x9*(parseInt(_0x27cbbd(0x1f7))/0xa)+parseInt(_0x27cbbd(0x201))/0xb*(parseInt(_0x27cbbd(0x209))/0xc);if(_0x57b500===_0x5563ec)break;else _0x52b8dd['push'](_0x52b8dd['shift']());}catch(_0x35bc5e){_0x52b8dd['push'](_0x52b8dd['shift']());}}}(a9_0x35e1,0x8cee5));import{readConfig}from'../utils/config.js';function a9_0x35e1(){const _0xe72637=['7MlpBlr','1873086egsPTk','client','*\x20开始生成\x20API\x20配置文件:','modelCount','message','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','.ts\x20-\x20客户端实例文件','api','*\x20正在处理\x20','env','9490iCMQhr','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','length','8972rhZLKY','\x20个模型','200824zwetvd','API\x20配置拉取异常:\x20','error','log','cwd','11ttHSog','\x20\x20\x20•\x20','408SKYNXw','.ts\x20-\x20模型配置文件','√\x20成功拉取\x20','8442FyHrpV','create-api-pull','2285455qfjoTv','13088772JFbqjS','test','chdir','166440wZAMbC','8lYFSaH','-client','trim'];a9_0x35e1=function(){return _0xe72637;};return a9_0x35e1();}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 async function pullApiSilent(_0x12b787,_0x37953e,_0x5c75b2,_0x38691d){const _0x2106d8=a9_0x2d40;let _0x5e52e9;try{const _0x39937b=_0x37953e?.[_0x2106d8(0x1eb)]()||'';if(_0x39937b){const _0x4c2f90=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x4c2f90[_0x2106d8(0x20a)](_0x39937b))return console[_0x2106d8(0x1fe)](_0x2106d8(0x1f8)),![];}_0x5c75b2&&(_0x5e52e9=process[_0x2106d8(0x200)](),process[_0x2106d8(0x20b)](_0x5c75b2));const _0x3486ab=readConfig(),_0x1ab9cc=typeof _0x3486ab[_0x2106d8(0x1f6)]==='string'?_0x3486ab['env']:undefined,_0x2b3814=_0x38691d||_0x1ab9cc||'online';initEnv(_0x2b3814),console[_0x2106d8(0x1ff)](_0x2106d8(0x1f2)+_0x2b3814+')');const {configArray:_0x5adb53}=await fetchModelList(_0x12b787),_0x16d8c9=_0x39937b?_0x39937b+'-api':_0x2106d8(0x1f4),_0xe67f0b=_0x39937b?_0x39937b+_0x2106d8(0x1ea):_0x2106d8(0x1ee);console[_0x2106d8(0x1ff)](_0x2106d8(0x1ef)),console['log'](_0x2106d8(0x202)+_0x16d8c9+_0x2106d8(0x204)),console[_0x2106d8(0x1ff)](_0x2106d8(0x202)+_0xe67f0b+_0x2106d8(0x1f3)),console[_0x2106d8(0x1ff)](_0x2106d8(0x1f5)+_0x5adb53[_0x2106d8(0x1f9)]+'\x20个数据集...');const _0x2cdc7e=await generateApiFile(_0x5adb53,_0x39937b,_0x12b787,!![],_0x2b3814);return console[_0x2106d8(0x1ff)](_0x2106d8(0x205)+_0x5adb53['length']+'\x20个数据集,生成\x20'+_0x2cdc7e[_0x2106d8(0x1f0)]+_0x2106d8(0x1fb)),_0x5c75b2&&logger['info'](_0x2106d8(0x207),'API\x20配置拉取成功:\x20'+_0x12b787,{'projectPath':_0x5c75b2,'appCode':_0x12b787,'datasetCount':_0x5adb53[_0x2106d8(0x1f9)],'filePrefix':_0x39937b}),!![];}catch(_0x3c3b26){const _0x58e5a2=_0x3c3b26 instanceof Error?_0x3c3b26[_0x2106d8(0x1f1)]:String(_0x3c3b26);return console[_0x2106d8(0x1fe)]('×\x20API\x20配置拉取异常:',_0x58e5a2),_0x5c75b2&&logger[_0x2106d8(0x1fe)]('create-api-pull',_0x2106d8(0x1fd)+_0x58e5a2,{'appCode':_0x12b787,'projectPath':_0x5c75b2}),![];}finally{_0x5e52e9&&process[_0x2106d8(0x20b)](_0x5e52e9);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x243faa,_0x37d16c){const _0x159ca1=a10_0x1182,_0x1e4f65=_0x243faa();while(!![]){try{const _0x4d619a=parseInt(_0x159ca1(0x14f))/0x1+parseInt(_0x159ca1(0x169))/0x2*(-parseInt(_0x159ca1(0x18d))/0x3)+parseInt(_0x159ca1(0x174))/0x4+parseInt(_0x159ca1(0x191))/0x5+-parseInt(_0x159ca1(0x15c))/0x6+parseInt(_0x159ca1(0x176))/0x7*(parseInt(_0x159ca1(0x154))/0x8)+-parseInt(_0x159ca1(0x18e))/0x9;if(_0x4d619a===_0x37d16c)break;else _0x1e4f65['push'](_0x1e4f65['shift']());}catch(_0x1e3fca){_0x1e4f65['push'](_0x1e4f65['shift']());}}}(a10_0x1f72,0xb8920));import{jsx as a10_0x216457,jsxs as a10_0x38ef37,Fragment as a10_0x3af1ea}from'react/jsx-runtime';function a10_0x1f72(){const _0x5ec79b=['green','repeat','backspace','creating','JS\x20链接','blue','*\x20请选择要同步的菜单:','5673528fhmFgD','size','value','!\x20未找到本地页面,请先创建页面','input-css','请至少选择一个菜单','提示:使用\x20','\x20输入项目的\x20JS\x20资源链接(https://...)','delete','\x20命令重新登录','[\x20]','*\x20CSS\x20链接:\x20','red','2LQuovZ','has','join','catch','菜单名称','online','√\x20菜单创建完成','gray','return','[✓]','\x20←\x20','5054132jKivBC','column','3025645exjpIz','input-js','selecting','length','*\x20同步菜单到\x20Lovrabet\x20平台','then','label','done','请输入有效的\x20CSS\x20https\x20链接','lovrabet\x20auth','local','fill','cyan','map','slice','message','请输入有效的\x20JS\x20https\x20链接','path','filter','add','JS\x20链接无法访问','white','trim','3396531dTjZFN','7694883RNrwcj','创建菜单失败','已选择菜单','6193515RowdxI','max','yellow','754281OVXYwb','\x20输入项目的\x20CSS\x20资源链接(https://...)','Lovrabet平台','dots','includes','8pLLSjB'];a10_0x1f72=function(){return _0x5ec79b;};return a10_0x1f72();}import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x5debbf from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta['main']&&render(a10_0x216457(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x328b63=a10_0x1182,{exit:_0x45a644}=useApp(),{loading:_0x1501a2,menuList:_0x1a726a,error:_0x1b80a4}=useGetOnlineMenuList(),_0x48fbc6=getLocalPages(),_0x1f5412=_0x1a726a[_0x328b63(0x183)](_0x35b119=>_0x35b119[_0x328b63(0x187)]),_0x42f753=[_0x328b63(0x16d),..._0x48fbc6[_0x328b63(0x183)](_0x49cb35=>_0x49cb35[_0x328b63(0x17c)])],_0x44b5e2=getStringWidth(getMaxWidth(_0x42f753,0x4)),_0x474db6=getStringWidth(getMaxWidth([_0x328b63(0x16d)])),[_0x24670a,_0x33f6d7]=useState(_0x328b63(0x178)),[_0x172106,_0xfc9ea4]=useState(new Set()),[_0x32a6f0,_0x4d760e]=useState(0x0),[_0x4ca1c4,_0x5b5f86]=useState(''),[_0x43d781,_0x115cf2]=useState(''),[_0x3c3210,_0x5e026f]=useState(''),[_0x5ad85c,_0x53c387]=useState(''),[_0x29f1ff,_0x3157a6]=useState([]),_0x1dcdad=_0x48fbc6[_0x328b63(0x183)](_0x1d665b=>({'label':_0x1d665b[_0x328b63(0x17c)],'path':_0x1d665b['path'],'local':!![],'online':_0x1f5412[_0x328b63(0x153)](_0x1d665b['path'])})),_0x45d227=_0x48fbc6['filter'](_0x43e811=>{const _0x587730=_0x328b63;return!_0x1f5412[_0x587730(0x153)](_0x43e811['path']);});useEffect(()=>{const _0x595de9=_0x328b63;if(!_0x1501a2&&_0x48fbc6['length']>0x0&&_0x172106[_0x595de9(0x15d)]===0x0){const _0x210e05=new Set(_0x48fbc6[_0x595de9(0x183)]((_0x1705ed,_0x9000b5)=>({'page':_0x1705ed,'index':_0x9000b5}))[_0x595de9(0x188)](({page:_0x5a21d1})=>!_0x1f5412[_0x595de9(0x153)](_0x5a21d1[_0x595de9(0x187)]))['map'](({index:_0x235165})=>_0x235165));_0xfc9ea4(_0x210e05);}},[_0x1501a2,_0x48fbc6[_0x328b63(0x179)],_0x1f5412[_0x328b63(0x179)]]),useInput(async(_0x439775,_0x502315)=>{const _0x5f424e=_0x328b63;if(_0x24670a===_0x5f424e(0x178)){if(_0x502315['upArrow']){_0x4d760e(_0x1796b7=>_0x1796b7>0x0?_0x1796b7-0x1:_0x48fbc6[_0x5f424e(0x179)]-0x1);return;}if(_0x502315['downArrow']){_0x4d760e(_0x180daa=>_0x180daa<_0x48fbc6[_0x5f424e(0x179)]-0x1?_0x180daa+0x1:0x0);return;}if(_0x439775==='\x20'){_0xfc9ea4(_0x25afe3=>{const _0x57d27b=_0x5f424e,_0x9414da=new Set(_0x25afe3);return _0x9414da[_0x57d27b(0x16a)](_0x32a6f0)?_0x9414da['delete'](_0x32a6f0):_0x9414da[_0x57d27b(0x189)](_0x32a6f0),_0x9414da;});return;}if(_0x439775==='a'||_0x439775==='A'){const _0x839088=new Set(_0x48fbc6[_0x5f424e(0x183)]((_0x7e4da4,_0x97769)=>_0x97769));_0xfc9ea4(_0x839088);return;}if(_0x439775==='i'||_0x439775==='I'||_0x439775==='r'||_0x439775==='R'){_0xfc9ea4(_0x45f770=>{const _0x12d090=_0x5f424e,_0x1cc7a2=new Set();for(let _0x25c135=0x0;_0x25c135<_0x48fbc6[_0x12d090(0x179)];_0x25c135++){!_0x45f770['has'](_0x25c135)&&_0x1cc7a2['add'](_0x25c135);}return _0x1cc7a2;});return;}if(_0x439775==='q'||_0x439775==='Q'){_0x45a644();return;}if(_0x502315[_0x5f424e(0x171)]){if(_0x172106[_0x5f424e(0x15d)]===0x0){_0x53c387(_0x5f424e(0x161));return;}const _0x15aec0=_0x48fbc6['filter']((_0x2c8369,_0xe9bc0b)=>_0x172106[_0x5f424e(0x16a)](_0xe9bc0b)),_0x108ce3=_0x15aec0[_0x5f424e(0x183)](_0x1b832d=>_0x1b832d['label'])['join'](',\x20');_0x3157a6([{'label':_0x5f424e(0x190),'value':_0x172106[_0x5f424e(0x15d)]+'\x20个'}]),_0x53c387(''),_0x33f6d7('input-js');return;}return;}if(_0x24670a===_0x5f424e(0x177)){if(_0x502315[_0x5f424e(0x171)]){const _0x16de70=_0x3c3210['trim']();if(_0x16de70==='')return;if(!isValidJsHttpsUrl(_0x16de70)){_0x53c387(_0x5f424e(0x186));return;}if(!await isUrlReachable(_0x16de70)){_0x53c387(_0x5f424e(0x18a));return;}_0x5b5f86(_0x16de70),_0x3157a6(_0x59bef5=>[..._0x59bef5,{'label':_0x5f424e(0x159),'value':_0x16de70}]),_0x5e026f(''),_0x53c387(''),_0x33f6d7(_0x5f424e(0x160));return;}if(_0x502315[_0x5f424e(0x157)]||_0x502315[_0x5f424e(0x164)]){_0x5e026f(_0x312b9c=>_0x312b9c[_0x5f424e(0x184)](0x0,-0x1)),_0x53c387('');return;}_0x5e026f(_0x3a9864=>_0x3a9864+_0x439775);return;}if(_0x24670a===_0x5f424e(0x160)){if(_0x502315[_0x5f424e(0x171)]){const _0x3efb2d=_0x3c3210[_0x5f424e(0x18c)]();if(_0x3efb2d==='')return;if(!isValidCssHttpsUrl(_0x3efb2d)){_0x53c387(_0x5f424e(0x17e));return;}if(!await isUrlReachable(_0x3efb2d)){_0x53c387('CSS\x20链接无法访问');return;}_0x115cf2(_0x3efb2d),_0x3157a6(_0x5344f9=>[..._0x5344f9,{'label':'CSS\x20链接','value':_0x3efb2d}]),_0x5e026f(''),_0x53c387(''),_0x33f6d7(_0x5f424e(0x158));const _0x1d8336=_0x48fbc6[_0x5f424e(0x188)]((_0xab9b87,_0x2e9f7e)=>_0x172106[_0x5f424e(0x16a)](_0x2e9f7e));createMenus(_0x1d8336,[_0x4ca1c4,_0x3efb2d])[_0x5f424e(0x17b)](()=>{const _0x44c214=_0x5f424e;_0x33f6d7(_0x44c214(0x17d)),setTimeout(()=>{_0x45a644();},0x3e8);})[_0x5f424e(0x16c)](_0x250d2e=>{const _0x29aafe=_0x5f424e;_0x53c387(_0x250d2e[_0x29aafe(0x185)]||_0x29aafe(0x18f)),_0x33f6d7('selecting');});return;}if(_0x502315[_0x5f424e(0x157)]||_0x502315[_0x5f424e(0x164)]){_0x5e026f(_0x77ee5=>_0x77ee5[_0x5f424e(0x184)](0x0,-0x1)),_0x53c387('');return;}_0x5e026f(_0x4ac09f=>_0x4ac09f+_0x439775);return;}});if(_0x1501a2)return a10_0x38ef37(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x216457(Text,{'children':'\x20\x20'}),a10_0x216457(a10_0x5debbf,{'type':_0x328b63(0x152)}),a10_0x216457(Text,{'children':'\x20正在获取线上菜单列表...'})]});if(_0x1b80a4)return a10_0x38ef37(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x38ef37(Text,{'color':_0x328b63(0x168),'children':['✗\x20',_0x1b80a4]}),a10_0x38ef37(Box,{'marginTop':0x1,'children':[a10_0x216457(Text,{'color':_0x328b63(0x170),'children':_0x328b63(0x162)}),a10_0x216457(Text,{'color':'cyan','children':_0x328b63(0x17f)}),a10_0x216457(Text,{'color':_0x328b63(0x170),'children':_0x328b63(0x165)})]})]});if(_0x48fbc6[_0x328b63(0x179)]===0x0)return a10_0x216457(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x216457(Text,{'color':_0x328b63(0x14e),'children':_0x328b63(0x15f)})});return a10_0x38ef37(Box,{'flexDirection':_0x328b63(0x175),'marginTop':0x1,'marginBottom':0x1,'children':[_0x24670a===_0x328b63(0x178)&&a10_0x38ef37(a10_0x3af1ea,{'children':[a10_0x38ef37(Box,{'children':[a10_0x38ef37(Text,{'bold':!![],'children':['\x20\x20',_0x328b63(0x16d),getRemainingSpaces(_0x44b5e2,_0x328b63(0x16d))]}),a10_0x38ef37(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x474db6,_0x328b63(0x16d))]}),a10_0x38ef37(Text,{'bold':!![],'children':[_0x328b63(0x151),getRemainingSpaces(_0x474db6,_0x328b63(0x16d))]})]}),_0x1dcdad[_0x328b63(0x183)](_0x2e9072=>a10_0x38ef37(Box,{'children':[a10_0x38ef37(Text,{'children':['\x20\x20',_0x2e9072[_0x328b63(0x17c)],getRemainingSpaces(_0x44b5e2,_0x2e9072[_0x328b63(0x17c)])]}),a10_0x38ef37(Text,{'color':'green','children':[_0x2e9072[_0x328b63(0x180)]?'✓':'✗',getRemainingSpaces(_0x474db6,'✓')]}),a10_0x38ef37(Text,{'color':_0x2e9072[_0x328b63(0x16e)]?_0x328b63(0x155):_0x328b63(0x168),'children':[_0x2e9072['online']?'✓':'✗',getRemainingSpaces(_0x474db6,'✓')]})]},_0x2e9072[_0x328b63(0x187)]))]}),_0x24670a===_0x328b63(0x178)&&_0x29f1ff['length']===0x0&&a10_0x216457(Box,{'marginTop':0x1,'children':a10_0x216457(Text,{'color':_0x328b63(0x182),'children':_0x328b63(0x17a)})}),_0x29f1ff[_0x328b63(0x183)]((_0x3bc01c,_0x4c3a0c)=>a10_0x38ef37(Box,{'children':[a10_0x38ef37(Text,{'color':'green','children':['√\x20',_0x3bc01c[_0x328b63(0x17c)],':\x20']}),a10_0x216457(Text,{'color':_0x328b63(0x182),'children':_0x3bc01c[_0x328b63(0x15e)]})]},_0x4c3a0c)),_0x5ad85c&&_0x24670a===_0x328b63(0x178)&&a10_0x216457(Box,{'marginTop':0x1,'children':a10_0x38ef37(Text,{'color':_0x328b63(0x168),'children':['✗\x20',_0x5ad85c]})}),_0x24670a===_0x328b63(0x178)&&a10_0x216457(a10_0x3af1ea,{'children':a10_0x38ef37(Box,{'marginTop':_0x29f1ff[_0x328b63(0x179)]>0x0||_0x5ad85c?0x1:0x0,'flexDirection':'column','children':[a10_0x216457(Text,{'bold':!![],'children':_0x328b63(0x15b)}),_0x48fbc6[_0x328b63(0x183)]((_0x272e45,_0xc73f5f)=>{const _0x3f8585=_0x328b63,_0x30afa9=_0x32a6f0===_0xc73f5f,_0x193810=_0x172106[_0x3f8585(0x16a)](_0xc73f5f),_0x181a55=_0x1f5412[_0x3f8585(0x153)](_0x272e45['path']),_0x3fd810=_0x181a55?'更新':'新建';return a10_0x216457(Box,{'children':a10_0x38ef37(Text,{'backgroundColor':_0x30afa9?_0x3f8585(0x15a):undefined,'color':_0x30afa9?_0x3f8585(0x18b):undefined,'children':['\x20\x20',_0x193810?_0x3f8585(0x172):_0x3f8585(0x166),'\x20',_0x272e45[_0x3f8585(0x17c)]]})},_0x272e45[_0x3f8585(0x187)]);}),a10_0x216457(Box,{'marginTop':0x1,'children':a10_0x38ef37(Text,{'color':_0x328b63(0x170),'children':['\x20','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认']})})]})}),_0x24670a===_0x328b63(0x177)&&a10_0x38ef37(a10_0x3af1ea,{'children':[a10_0x38ef37(Box,{'children':[a10_0x216457(Text,{'children':'*\x20JS\x20链接:\x20'}),a10_0x216457(Text,{'color':'green','children':_0x3c3210}),_0x5ad85c&&a10_0x38ef37(Text,{'color':'red','children':[_0x328b63(0x173),_0x5ad85c]})]}),!_0x5ad85c&&a10_0x216457(Box,{'children':a10_0x216457(Text,{'color':'gray','children':_0x328b63(0x163)})})]}),_0x24670a===_0x328b63(0x160)&&a10_0x38ef37(a10_0x3af1ea,{'children':[a10_0x38ef37(Box,{'children':[a10_0x216457(Text,{'children':_0x328b63(0x167)}),a10_0x216457(Text,{'color':'green','children':_0x3c3210}),_0x5ad85c&&a10_0x38ef37(Text,{'color':_0x328b63(0x168),'children':[_0x328b63(0x173),_0x5ad85c]})]}),!_0x5ad85c&&a10_0x216457(Box,{'children':a10_0x216457(Text,{'color':_0x328b63(0x170),'children':_0x328b63(0x150)})})]}),_0x24670a===_0x328b63(0x158)&&a10_0x216457(Box,{'children':a10_0x216457(Text,{'children':'*\x20正在创建菜单...'})}),_0x24670a===_0x328b63(0x17d)&&a10_0x216457(Box,{'children':a10_0x216457(Text,{'color':_0x328b63(0x155),'children':_0x328b63(0x16f)})})]});}function a10_0x1182(_0x391b0c,_0x256046){const _0x1f7275=a10_0x1f72();return a10_0x1182=function(_0x11828e,_0x4742aa){_0x11828e=_0x11828e-0x14e;let _0x421361=_0x1f7275[_0x11828e];return _0x421361;},a10_0x1182(_0x391b0c,_0x256046);}function getStringWidth(_0x35f1ee){let _0x3f73b1=0x0;for(const _0x3f6160 of _0x35f1ee){/[\u4e00-\u9fa5]/['test'](_0x3f6160)?_0x3f73b1+=0x2:_0x3f73b1+=0x1;}return _0x3f73b1;}function getRemainingSpaces(_0x3ed366,_0xad5a4d){const _0xb8e8fe=a10_0x1182,_0x10f992=getStringWidth(_0xad5a4d);return Array(Math[_0xb8e8fe(0x192)](0x0,_0x3ed366-_0x10f992))[_0xb8e8fe(0x181)]('\x20')[_0xb8e8fe(0x16b)]('');}function getMaxWidth(_0x217079,_0x16c0e7=0x2){const _0x11ee1e=a10_0x1182;let _0x260d2f='',_0x3dcbaa=0x0;for(const _0x10a38f of _0x217079){const _0x47dd38=getStringWidth(_0x10a38f);_0x47dd38>_0x3dcbaa&&(_0x3dcbaa=_0x47dd38,_0x260d2f=_0x10a38f);}return _0x260d2f+'\x20'[_0x11ee1e(0x156)](_0x16c0e7);}
|
|
1
|
+
const a10_0x19592c=a10_0x2d15;(function(_0x361a2f,_0x367c8d){const _0x3f40d2=a10_0x2d15,_0x729d81=_0x361a2f();while(!![]){try{const _0x5ac67b=-parseInt(_0x3f40d2(0x155))/0x1*(-parseInt(_0x3f40d2(0x133))/0x2)+parseInt(_0x3f40d2(0x145))/0x3*(parseInt(_0x3f40d2(0x15f))/0x4)+-parseInt(_0x3f40d2(0x12a))/0x5*(-parseInt(_0x3f40d2(0x152))/0x6)+parseInt(_0x3f40d2(0x13c))/0x7+parseInt(_0x3f40d2(0x13d))/0x8+parseInt(_0x3f40d2(0x144))/0x9*(parseInt(_0x3f40d2(0x154))/0xa)+-parseInt(_0x3f40d2(0x150))/0xb;if(_0x5ac67b===_0x367c8d)break;else _0x729d81['push'](_0x729d81['shift']());}catch(_0x3d5249){_0x729d81['push'](_0x729d81['shift']());}}}(a10_0x3814,0x8ead4));import{jsx as a10_0x2cd534,jsxs as a10_0x578854,Fragment as a10_0x12c482}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x4156f0 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta[a10_0x19592c(0x140)]&&render(a10_0x2cd534(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x1d4ace=a10_0x19592c,{exit:_0x286119}=useApp(),{loading:_0x4f93de,menuList:_0x45bdf5,error:_0x1c067f}=useGetOnlineMenuList(),_0x5e887e=getLocalPages(),_0x3402e7=_0x45bdf5[_0x1d4ace(0x141)](_0x2b62e9=>_0x2b62e9[_0x1d4ace(0x15d)]),_0x362495=[_0x1d4ace(0x142),..._0x5e887e[_0x1d4ace(0x141)](_0x22b258=>_0x22b258[_0x1d4ace(0x146)])],_0x20a866=getStringWidth(getMaxWidth(_0x362495,0x4)),_0x5e3a24=getStringWidth(getMaxWidth([_0x1d4ace(0x142)])),[_0x11f07b,_0x483de2]=useState(_0x1d4ace(0x15e)),[_0x4695ac,_0x2c7d42]=useState(new Set()),[_0x408d2d,_0x3ad92d]=useState(0x0),[_0x2769db,_0x5ddfda]=useState(''),[_0x417594,_0x4303d5]=useState(''),[_0x435b77,_0x254005]=useState(''),[_0x2e6474,_0xb9e461]=useState(''),[_0x40a71f,_0x185265]=useState([]),_0x3e5423=_0x5e887e[_0x1d4ace(0x141)](_0x5998e5=>({'label':_0x5998e5['label'],'path':_0x5998e5[_0x1d4ace(0x15d)],'local':!![],'online':_0x3402e7[_0x1d4ace(0x124)](_0x5998e5[_0x1d4ace(0x15d)])})),_0xc7a5db=_0x5e887e[_0x1d4ace(0x11b)](_0x3f5385=>{const _0x90c61f=_0x1d4ace;return!_0x3402e7[_0x90c61f(0x124)](_0x3f5385[_0x90c61f(0x15d)]);});useEffect(()=>{const _0xb8fd5b=_0x1d4ace;if(!_0x4f93de&&_0x5e887e[_0xb8fd5b(0x11d)]>0x0&&_0x4695ac[_0xb8fd5b(0x153)]===0x0){const _0x2bcb42=new Set(_0x5e887e[_0xb8fd5b(0x141)]((_0x5d966a,_0x58e1fa)=>({'page':_0x5d966a,'index':_0x58e1fa}))[_0xb8fd5b(0x11b)](({page:_0xdd5aae})=>!_0x3402e7[_0xb8fd5b(0x124)](_0xdd5aae[_0xb8fd5b(0x15d)]))[_0xb8fd5b(0x141)](({index:_0x3deade})=>_0x3deade));_0x2c7d42(_0x2bcb42);}},[_0x4f93de,_0x5e887e['length'],_0x3402e7[_0x1d4ace(0x11d)]]),useInput(async(_0x616ff8,_0x3955b0)=>{const _0x4edd5b=_0x1d4ace;if(_0x11f07b===_0x4edd5b(0x15e)){if(_0x3955b0['upArrow']){_0x3ad92d(_0x2c6c4c=>_0x2c6c4c>0x0?_0x2c6c4c-0x1:_0x5e887e[_0x4edd5b(0x11d)]-0x1);return;}if(_0x3955b0[_0x4edd5b(0x11e)]){_0x3ad92d(_0x3a9d83=>_0x3a9d83<_0x5e887e[_0x4edd5b(0x11d)]-0x1?_0x3a9d83+0x1:0x0);return;}if(_0x616ff8==='\x20'){_0x2c7d42(_0x49e21e=>{const _0x505094=_0x4edd5b,_0x663439=new Set(_0x49e21e);return _0x663439[_0x505094(0x13f)](_0x408d2d)?_0x663439[_0x505094(0x15b)](_0x408d2d):_0x663439[_0x505094(0x147)](_0x408d2d),_0x663439;});return;}if(_0x616ff8==='a'||_0x616ff8==='A'){const _0x14562d=new Set(_0x5e887e[_0x4edd5b(0x141)]((_0x4ace82,_0x18e2cc)=>_0x18e2cc));_0x2c7d42(_0x14562d);return;}if(_0x616ff8==='i'||_0x616ff8==='I'||_0x616ff8==='r'||_0x616ff8==='R'){_0x2c7d42(_0x181466=>{const _0x1d59c2=_0x4edd5b,_0x507ebe=new Set();for(let _0x177bb3=0x0;_0x177bb3<_0x5e887e[_0x1d59c2(0x11d)];_0x177bb3++){!_0x181466[_0x1d59c2(0x13f)](_0x177bb3)&&_0x507ebe['add'](_0x177bb3);}return _0x507ebe;});return;}if(_0x616ff8==='q'||_0x616ff8==='Q'){_0x286119();return;}if(_0x3955b0[_0x4edd5b(0x137)]){if(_0x4695ac[_0x4edd5b(0x153)]===0x0){_0xb9e461(_0x4edd5b(0x151));return;}const _0xb0ab9c=_0x5e887e[_0x4edd5b(0x11b)]((_0xa2c7d8,_0x5532ba)=>_0x4695ac[_0x4edd5b(0x13f)](_0x5532ba)),_0x5855ae=_0xb0ab9c[_0x4edd5b(0x141)](_0x7e2942=>_0x7e2942[_0x4edd5b(0x146)])[_0x4edd5b(0x15c)](',\x20');_0x185265([{'label':'已选择菜单','value':_0x4695ac[_0x4edd5b(0x153)]+'\x20个'}]),_0xb9e461(''),_0x483de2(_0x4edd5b(0x12e));return;}return;}if(_0x11f07b===_0x4edd5b(0x12e)){if(_0x3955b0[_0x4edd5b(0x137)]){const _0x525f58=_0x435b77[_0x4edd5b(0x12d)]();if(_0x525f58==='')return;if(!isValidJsHttpsUrl(_0x525f58)){_0xb9e461(_0x4edd5b(0x138));return;}if(!await isUrlReachable(_0x525f58)){_0xb9e461(_0x4edd5b(0x15a));return;}_0x5ddfda(_0x525f58),_0x185265(_0x300772=>[..._0x300772,{'label':_0x4edd5b(0x136),'value':_0x525f58}]),_0x254005(''),_0xb9e461(''),_0x483de2(_0x4edd5b(0x156));return;}if(_0x3955b0[_0x4edd5b(0x14a)]||_0x3955b0[_0x4edd5b(0x15b)]){_0x254005(_0x39bd79=>_0x39bd79[_0x4edd5b(0x13e)](0x0,-0x1)),_0xb9e461('');return;}_0x254005(_0xf78412=>_0xf78412+_0x616ff8);return;}if(_0x11f07b===_0x4edd5b(0x156)){if(_0x3955b0[_0x4edd5b(0x137)]){const _0x322316=_0x435b77['trim']();if(_0x322316==='')return;if(!isValidCssHttpsUrl(_0x322316)){_0xb9e461('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x322316)){_0xb9e461(_0x4edd5b(0x14e));return;}_0x4303d5(_0x322316),_0x185265(_0x413116=>[..._0x413116,{'label':_0x4edd5b(0x126),'value':_0x322316}]),_0x254005(''),_0xb9e461(''),_0x483de2(_0x4edd5b(0x143));const _0x427856=_0x5e887e['filter']((_0x7695cc,_0x3e5600)=>_0x4695ac[_0x4edd5b(0x13f)](_0x3e5600));createMenus(_0x427856,[_0x2769db,_0x322316])['then'](()=>{_0x483de2('done'),setTimeout(()=>{_0x286119();},0x3e8);})[_0x4edd5b(0x13b)](_0x3740b8=>{const _0x2388a6=_0x4edd5b;_0xb9e461(_0x3740b8[_0x2388a6(0x122)]||'创建菜单失败'),_0x483de2(_0x2388a6(0x15e));});return;}if(_0x3955b0[_0x4edd5b(0x14a)]||_0x3955b0[_0x4edd5b(0x15b)]){_0x254005(_0x21518c=>_0x21518c['slice'](0x0,-0x1)),_0xb9e461('');return;}_0x254005(_0x5bc911=>_0x5bc911+_0x616ff8);return;}});if(_0x4f93de)return a10_0x578854(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x2cd534(Text,{'children':'\x20\x20'}),a10_0x2cd534(a10_0x4156f0,{'type':'dots'}),a10_0x2cd534(Text,{'children':_0x1d4ace(0x12c)})]});if(_0x1c067f)return a10_0x578854(Box,{'flexDirection':_0x1d4ace(0x135),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x578854(Text,{'color':'red','children':['✗\x20',_0x1c067f]}),a10_0x578854(Box,{'marginTop':0x1,'children':[a10_0x2cd534(Text,{'color':_0x1d4ace(0x123),'children':_0x1d4ace(0x129)}),a10_0x2cd534(Text,{'color':_0x1d4ace(0x127),'children':_0x1d4ace(0x125)}),a10_0x2cd534(Text,{'color':'gray','children':_0x1d4ace(0x13a)})]})]});if(_0x5e887e[_0x1d4ace(0x11d)]===0x0)return a10_0x2cd534(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x2cd534(Text,{'color':_0x1d4ace(0x128),'children':'!\x20未找到本地页面,请先创建页面'})});return a10_0x578854(Box,{'flexDirection':_0x1d4ace(0x135),'marginTop':0x1,'marginBottom':0x1,'children':[_0x11f07b===_0x1d4ace(0x15e)&&a10_0x578854(a10_0x12c482,{'children':[a10_0x578854(Box,{'children':[a10_0x578854(Text,{'bold':!![],'children':['\x20\x20','菜单名称',getRemainingSpaces(_0x20a866,_0x1d4ace(0x142))]}),a10_0x578854(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x5e3a24,'菜单名称')]}),a10_0x578854(Text,{'bold':!![],'children':[_0x1d4ace(0x11f),getRemainingSpaces(_0x5e3a24,_0x1d4ace(0x142))]})]}),_0x3e5423[_0x1d4ace(0x141)](_0x578fdc=>a10_0x578854(Box,{'children':[a10_0x578854(Text,{'children':['\x20\x20',_0x578fdc[_0x1d4ace(0x146)],getRemainingSpaces(_0x20a866,_0x578fdc[_0x1d4ace(0x146)])]}),a10_0x578854(Text,{'color':_0x1d4ace(0x12f),'children':[_0x578fdc['local']?'✓':'✗',getRemainingSpaces(_0x5e3a24,'✓')]}),a10_0x578854(Text,{'color':_0x578fdc[_0x1d4ace(0x132)]?'green':'red','children':[_0x578fdc[_0x1d4ace(0x132)]?'✓':'✗',getRemainingSpaces(_0x5e3a24,'✓')]})]},_0x578fdc['path']))]}),_0x11f07b===_0x1d4ace(0x15e)&&_0x40a71f[_0x1d4ace(0x11d)]===0x0&&a10_0x2cd534(Box,{'marginTop':0x1,'children':a10_0x2cd534(Text,{'color':'cyan','children':_0x1d4ace(0x158)})}),_0x40a71f['map']((_0x245c4d,_0x1e7741)=>a10_0x578854(Box,{'children':[a10_0x578854(Text,{'color':'green','children':['√\x20',_0x245c4d['label'],':\x20']}),a10_0x2cd534(Text,{'color':_0x1d4ace(0x127),'children':_0x245c4d['value']})]},_0x1e7741)),_0x2e6474&&_0x11f07b===_0x1d4ace(0x15e)&&a10_0x2cd534(Box,{'marginTop':0x1,'children':a10_0x578854(Text,{'color':_0x1d4ace(0x14b),'children':['✗\x20',_0x2e6474]})}),_0x11f07b==='selecting'&&a10_0x2cd534(a10_0x12c482,{'children':a10_0x578854(Box,{'marginTop':_0x40a71f['length']>0x0||_0x2e6474?0x1:0x0,'flexDirection':_0x1d4ace(0x135),'children':[a10_0x2cd534(Text,{'bold':!![],'children':'*\x20请选择要同步的菜单:'}),_0x5e887e[_0x1d4ace(0x141)]((_0x53a6e6,_0x4b2dd4)=>{const _0x2a0567=_0x1d4ace,_0x4d6b6d=_0x408d2d===_0x4b2dd4,_0x1be80c=_0x4695ac[_0x2a0567(0x13f)](_0x4b2dd4),_0x1174ce=_0x3402e7[_0x2a0567(0x124)](_0x53a6e6[_0x2a0567(0x15d)]),_0x230ede=_0x1174ce?'更新':'新建';return a10_0x2cd534(Box,{'children':a10_0x578854(Text,{'backgroundColor':_0x4d6b6d?_0x2a0567(0x148):undefined,'color':_0x4d6b6d?_0x2a0567(0x14d):undefined,'children':['\x20\x20',_0x1be80c?_0x2a0567(0x12b):_0x2a0567(0x121),'\x20',_0x53a6e6[_0x2a0567(0x146)]]})},_0x53a6e6[_0x2a0567(0x15d)]);}),a10_0x2cd534(Box,{'marginTop':0x1,'children':a10_0x578854(Text,{'color':_0x1d4ace(0x123),'children':['\x20',_0x1d4ace(0x139)]})})]})}),_0x11f07b===_0x1d4ace(0x12e)&&a10_0x578854(a10_0x12c482,{'children':[a10_0x578854(Box,{'children':[a10_0x2cd534(Text,{'children':_0x1d4ace(0x149)}),a10_0x2cd534(Text,{'color':_0x1d4ace(0x12f),'children':_0x435b77}),_0x2e6474&&a10_0x578854(Text,{'color':'red','children':['\x20←\x20',_0x2e6474]})]}),!_0x2e6474&&a10_0x2cd534(Box,{'children':a10_0x2cd534(Text,{'color':_0x1d4ace(0x123),'children':_0x1d4ace(0x14c)})})]}),_0x11f07b===_0x1d4ace(0x156)&&a10_0x578854(a10_0x12c482,{'children':[a10_0x578854(Box,{'children':[a10_0x2cd534(Text,{'children':_0x1d4ace(0x120)}),a10_0x2cd534(Text,{'color':_0x1d4ace(0x12f),'children':_0x435b77}),_0x2e6474&&a10_0x578854(Text,{'color':'red','children':['\x20←\x20',_0x2e6474]})]}),!_0x2e6474&&a10_0x2cd534(Box,{'children':a10_0x2cd534(Text,{'color':'gray','children':_0x1d4ace(0x14f)})})]}),_0x11f07b===_0x1d4ace(0x143)&&a10_0x2cd534(Box,{'children':a10_0x2cd534(Text,{'children':_0x1d4ace(0x131)})}),_0x11f07b==='done'&&a10_0x2cd534(Box,{'children':a10_0x2cd534(Text,{'color':_0x1d4ace(0x12f),'children':_0x1d4ace(0x159)})})]});}function a10_0x2d15(_0x3d3213,_0x5591ad){const _0x381472=a10_0x3814();return a10_0x2d15=function(_0x2d15c5,_0x28c776){_0x2d15c5=_0x2d15c5-0x11b;let _0x2e205b=_0x381472[_0x2d15c5];return _0x2e205b;},a10_0x2d15(_0x3d3213,_0x5591ad);}function getStringWidth(_0xbd83e6){const _0x116152=a10_0x19592c;let _0x772cfe=0x0;for(const _0x8c289 of _0xbd83e6){/[\u4e00-\u9fa5]/[_0x116152(0x157)](_0x8c289)?_0x772cfe+=0x2:_0x772cfe+=0x1;}return _0x772cfe;}function getRemainingSpaces(_0x3a0e1b,_0xd025c9){const _0x2c817f=a10_0x19592c,_0x107830=getStringWidth(_0xd025c9);return Array(Math[_0x2c817f(0x130)](0x0,_0x3a0e1b-_0x107830))[_0x2c817f(0x11c)]('\x20')['join']('');}function a10_0x3814(){const _0x275d1a=['JS\x20链接','return','请输入有效的\x20JS\x20https\x20链接','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','\x20命令重新登录','catch','3068716NBqoBp','9075288GuCJhd','slice','has','main','map','菜单名称','creating','279gNreHp','3LgVFQQ','label','add','blue','*\x20JS\x20链接:\x20','backspace','red','\x20输入项目的\x20JS\x20资源链接(https://...)','white','CSS\x20链接无法访问','\x20输入项目的\x20CSS\x20资源链接(https://...)','42576270HynIIM','请至少选择一个菜单','6978666yvaYXL','size','176690htsBxN','264ZjLKrL','input-css','test','*\x20同步菜单到\x20Lovrabet\x20平台','√\x20菜单创建完成','JS\x20链接无法访问','delete','join','path','selecting','375764hUuojJ','filter','fill','length','downArrow','Lovrabet平台','*\x20CSS\x20链接:\x20','[\x20]','message','gray','includes','lovrabet\x20auth','CSS\x20链接','cyan','yellow','提示:使用\x20','5eaaSLA','[✓]','\x20正在获取线上菜单列表...','trim','input-js','green','max','*\x20正在创建菜单...','online','8162OKOrRr','repeat','column'];a10_0x3814=function(){return _0x275d1a;};return a10_0x3814();}function getMaxWidth(_0xe2a189,_0x398fe8=0x2){const _0x1ced97=a10_0x19592c;let _0x2ee13f='',_0x56c2bf=0x0;for(const _0x3cf3da of _0xe2a189){const _0x57681b=getStringWidth(_0x3cf3da);_0x57681b>_0x56c2bf&&(_0x56c2bf=_0x57681b,_0x2ee13f=_0x3cf3da);}return _0x2ee13f+'\x20'[_0x1ced97(0x134)](_0x398fe8);}
|