@lovrabet/cli 1.1.26-beta.1 → 1.1.26-beta.11
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 -0
- package/lib/app-menu-cdn-version/update-menu-cdn-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -0
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -0
- package/lib/app-menu-update-cdn/main.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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x52715c,_0x3d808c){const _0xe85a6b=a0_0x5c6c,_0x4eb4c0=_0x52715c();while(!![]){try{const _0x581d2f=parseInt(_0xe85a6b(0x7c))/0x1*(parseInt(_0xe85a6b(0x7b))/0x2)+parseInt(_0xe85a6b(0x85))/0x3*(parseInt(_0xe85a6b(0x8d))/0x4)+-parseInt(_0xe85a6b(0x86))/0x5*(parseInt(_0xe85a6b(0x91))/0x6)+parseInt(_0xe85a6b(0x88))/0x7+parseInt(_0xe85a6b(0x83))/0x8+parseInt(_0xe85a6b(0x89))/0x9*(-parseInt(_0xe85a6b(0x82))/0xa)+-parseInt(_0xe85a6b(0x7d))/0xb;if(_0x581d2f===_0x3d808c)break;else _0x4eb4c0['push'](_0x4eb4c0['shift']());}catch(_0x1e41d4){_0x4eb4c0['push'](_0x4eb4c0['shift']());}}}(a0_0x1635,0x9bc3e));import{jsx as a0_0x4aaba2,jsxs as a0_0x5b9520}from'react/jsx-runtime';import{useState}from'react';function a0_0x5c6c(_0x2dbdf0,_0x28a70f){_0x2dbdf0=_0x2dbdf0-0x75;const _0x1635c8=a0_0x1635();let _0x5c6ce3=_0x1635c8[_0x2dbdf0];return _0x5c6ce3;}import{Text,Box,useInput}from'ink';import a0_0x306978 from'node:fs';export function InputProjectCode(_0x4ff7a1){const _0x2e2559=a0_0x5c6c,{onSubmit:_0x3e75ee,pagePath:_0xd20bce}=_0x4ff7a1,[_0x556019,_0x438a57]=useState(''),[_0xc78b3d,_0x56c854]=useState(''),_0x21e9af=_0x2e2559(0x78);function _0x2ab2e3(_0x5351aa){const _0x36e351=_0x2e2559;if(_0x5351aa['length']>0x64)return{'valid':![],'message':_0x36e351(0x97)};if(_0x5351aa[_0x36e351(0x79)]('/')||_0x5351aa[_0x36e351(0x8b)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x5351aa[_0x36e351(0x90)]('//'))return{'valid':![],'message':_0x36e351(0x8a)};const _0xe5e132=_0x5351aa[_0x36e351(0x77)]('/');for(const _0x29e602 of _0xe5e132){if(!_0x29e602)continue;const _0x276ce7=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x276ce7[_0x36e351(0x76)](_0x29e602))return{'valid':![],'message':_0x36e351(0x80)};}return{'valid':!![]};}return useInput((_0x3a7e92,_0xdc35e2)=>{const _0x49588a=_0x2e2559;if(_0xdc35e2[_0x49588a(0x95)]){const _0x1950dc=_0x556019[_0x49588a(0x96)]()||_0x21e9af;if(_0xc78b3d)return;const _0x1f2201=_0xd20bce+'/'+_0x1950dc;if(a0_0x306978[_0x49588a(0x7e)](_0x1f2201)){_0x56c854('页面路径\x20'+_0x1950dc+_0x49588a(0x7f));return;}_0x3e75ee(_0x1950dc),_0x438a57(''),_0x56c854('');}else _0xdc35e2[_0x49588a(0x84)]||_0xdc35e2['delete']?_0x438a57(_0x359f78=>{const _0x3f02e4=_0x49588a,_0x395e41=_0x359f78[_0x3f02e4(0x8f)](0x0,-0x1),{valid:_0x278c74,message:_0x26bf33}=_0x2ab2e3(_0x395e41);return _0x56c854(_0x278c74?'':_0x26bf33||_0x3f02e4(0x87)),_0x395e41;}):_0x438a57(_0x45a441=>{const _0x573cc0=_0x45a441+_0x3a7e92,{valid:_0x11a87d,message:_0x3b0fb2}=_0x2ab2e3(_0x573cc0);return _0x56c854(_0x11a87d?'':_0x3b0fb2||'页面路径不合法'),_0x573cc0;});}),a0_0x5b9520(Box,{'flexDirection':_0x2e2559(0x81),'children':[a0_0x5b9520(Box,{'children':[a0_0x4aaba2(Text,{'color':_0x2e2559(0x8c),'children':_0x2e2559(0x75)}),a0_0x4aaba2(Text,{'children':_0x2e2559(0x94)}),_0x556019?a0_0x4aaba2(Text,{'color':_0x2e2559(0x8e),'children':_0x556019}):a0_0x4aaba2(Text,{'color':'gray','children':_0x21e9af}),_0xc78b3d&&a0_0x5b9520(Text,{'color':_0x2e2559(0x92),'children':[_0x2e2559(0x7a),_0xc78b3d]})]}),!_0xc78b3d&&!_0x556019&&a0_0x4aaba2(Box,{'children':a0_0x4aaba2(Text,{'color':_0x2e2559(0x8c),'children':_0x2e2559(0x93)})})]});}function a0_0x1635(){const _0x384c13=['startsWith','\x20←\x20','308180VWAzuA','7MkfSLu','30236877yDNoUg','existsSync','\x20已存在,请使用其他路径','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','column','3284180HcPPVC','8826160qguvHe','backspace','33ZzhYll','1130hrhfFd','页面路径不合法','6835738JOPExm','9OrdeSD','路径不能包含连续的\x20/','endsWith','gray','222116HgLxxI','green','slice','includes','1434gQgAlT','red','\x20直接回车确认,或输入自定义路由地址','页面路由地址:\x20','return','trim','页面路径长度不能超过\x20100\x20个字符','\x20Step2:\x20','test','split','my-page'];a0_0x1635=function(){return _0x384c13;};return a0_0x1635();}
|
package/lib/add-page/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a1_0x5a81bc=a1_0x2e10;(function(_0x258341,_0x3e04f6){const _0x2ef565=a1_0x2e10,_0x4324f4=_0x258341();while(!![]){try{const _0x28f7aa=-parseInt(_0x2ef565(0x1fd))/0x1+parseInt(_0x2ef565(0x1f4))/0x2+parseInt(_0x2ef565(0x1ed))/0x3*(-parseInt(_0x2ef565(0x1fc))/0x4)+-parseInt(_0x2ef565(0x201))/0x5+-parseInt(_0x2ef565(0x1f5))/0x6+parseInt(_0x2ef565(0x211))/0x7+parseInt(_0x2ef565(0x1fa))/0x8*(parseInt(_0x2ef565(0x1ee))/0x9);if(_0x28f7aa===_0x3e04f6)break;else _0x4324f4['push'](_0x4324f4['shift']());}catch(_0x28a2e1){_0x4324f4['push'](_0x4324f4['shift']());}}}(a1_0x1c66,0x418bc));import{jsx as a1_0x3d797a,jsxs as a1_0x39b813,Fragment as a1_0x25980d}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x39b911 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x1c66(){const _0x185411=['cwd','cyan','已输入的页面路由\x20','3433927XssvUH','\x20Step1:\x20','message','171qtlAAA','945702VXkHIu','green','页面添加成功:\x20','join','error','\x20*\x20路由地址:\x20','788744LmSrFw','2237658BxhLcO','../../templates/pages','页面添加失败:\x20','catch','开始添加页面:\x20','40BXFzsl','processTemplate','21984kyWbwe','262395yKIfHV','gray','pages','\x20*\x20页面文件已创建,可直接通过路由访问','966185iwgaHg','finally','now','add-page','src','已选择页面模板\x20','正在创建页面,请稍候…','dirname','success','column','setLogPath','\x20Step2:\x20','resolve'];a1_0x1c66=function(){return _0x185411;};return a1_0x1c66();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x39b911[a1_0x5a81bc(0x208)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x39b911['resolve'](__dirname,a1_0x5a81bc(0x1f6)),projectDir=process[a1_0x5a81bc(0x20e)]();function a1_0x2e10(_0x93c4d9,_0x9c7be3){_0x93c4d9=_0x93c4d9-0x1eb;const _0x1c661b=a1_0x1c66();let _0x2e10e8=_0x1c661b[_0x93c4d9];return _0x2e10e8;}export const AddPage=()=>{const _0x3a0fd8=a1_0x5a81bc,{exit:_0x14732c}=useApp(),[_0x3399c4,_0x1a53f9]=useState(''),[_0x1c8b00,_0x300c36]=useState(''),[_0xed3d8e,_0x58d66f]=useState(![]),[_0x1c7122,_0x236952]=useState(![]),_0x5c6279=a1_0x39b911[_0x3a0fd8(0x1f1)](projectDir,_0x3a0fd8(0x205),_0x3a0fd8(0x1ff)),_0x2e7ae4=a1_0x39b911['join'](_0x5c6279,_0x1c8b00),_0x1c1396=a1_0x39b911[_0x3a0fd8(0x1f1)]('src',_0x3a0fd8(0x1ff),_0x1c8b00);useEffect(()=>{const _0x115ac2=_0x3a0fd8,_0x5e9ba7=a1_0x39b911[_0x115ac2(0x20d)](pageTemplateDir,_0x3399c4);if(_0x3399c4&&_0x1c8b00){_0x58d66f(!![]),logger[_0x115ac2(0x20b)](process[_0x115ac2(0x20e)]());const _0x1f01f9=Date[_0x115ac2(0x203)]();logger['info'](_0x115ac2(0x204),_0x115ac2(0x1f9)+_0x1c8b00,{'template':_0x3399c4,'targetPath':_0x1c1396}),TemplateReplacer[_0x115ac2(0x1fb)](_0x5e9ba7,a1_0x39b911[_0x115ac2(0x1f1)](_0x5c6279,_0x1c8b00),_0x1c8b00,_0x3399c4)['then'](()=>{const _0x4329d9=_0x115ac2,_0x2b227a=Date[_0x4329d9(0x203)]()-_0x1f01f9;logger[_0x4329d9(0x209)](_0x4329d9(0x204),_0x4329d9(0x1f0)+_0x1c8b00,_0x2b227a,{'template':_0x3399c4,'targetPath':_0x1c1396,'routePath':_0x1c8b00}),_0x236952(!![]);})[_0x115ac2(0x1f8)](_0x124fa6=>{const _0xb98c78=_0x115ac2,_0xd3bc49=Date[_0xb98c78(0x203)]()-_0x1f01f9;logger[_0xb98c78(0x1f2)]('add-page',_0xb98c78(0x1f7)+_0x1c8b00,{'template':_0x3399c4,'targetPath':_0x1c1396,'error':_0x124fa6 instanceof Error?_0x124fa6[_0xb98c78(0x1ec)]:String(_0x124fa6),'duration':_0xd3bc49});})[_0x115ac2(0x202)](()=>{_0x58d66f(![]);});}},[_0x3399c4,_0x1c8b00]),useEffect(()=>{_0x1c7122&&setTimeout(()=>{_0x14732c();});},[_0x1c7122]);if(_0x3399c4)return a1_0x39b813(Box,{'flexDirection':_0x3a0fd8(0x20a),'paddingY':0x1,'children':[a1_0x39b813(Box,{'children':[a1_0x3d797a(Text,{'color':'gray','children':_0x3a0fd8(0x1eb)}),a1_0x3d797a(Text,{'children':_0x3a0fd8(0x206)}),a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1ef),'children':_0x3399c4})]}),_0x1c8b00?a1_0x39b813(Box,{'children':[a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1fe),'children':_0x3a0fd8(0x20c)}),a1_0x3d797a(Text,{'children':_0x3a0fd8(0x210)}),a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1ef),'children':_0x1c8b00})]}):a1_0x3d797a(InputProjectCode,{'pagePath':_0x2e7ae4,'onSubmit':_0x300c36}),_0x1c8b00&&_0xed3d8e?a1_0x39b813(Box,{'marginTop':0x1,'children':[a1_0x3d797a(Box,{'width':'4'}),a1_0x3d797a(Text,{'children':_0x3a0fd8(0x207)})]}):null,_0x1c7122?a1_0x39b813(a1_0x25980d,{'children':[a1_0x3d797a(Box,{'marginTop':0x1,'children':a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1fe),'children':'\x20*\x20页面创建成功!'})}),a1_0x39b813(Box,{'children':[a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1fe),'children':'\x20*\x20页面路径:\x20'}),a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1ef),'children':_0x1c1396})]}),a1_0x39b813(Box,{'children':[a1_0x3d797a(Text,{'color':'gray','children':_0x3a0fd8(0x1f3)}),a1_0x39b813(Text,{'color':_0x3a0fd8(0x1ef),'children':['/',_0x1c8b00]})]}),a1_0x3d797a(Box,{'marginTop':0x1,'children':a1_0x3d797a(Text,{'color':_0x3a0fd8(0x20f),'children':_0x3a0fd8(0x200)})})]}):null]});return a1_0x3d797a(SelectPageTemplate,{'onSelect':_0x1a53f9});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x577820,_0x565367){const _0x552de5=a2_0x3615,_0x15a6cb=_0x577820();while(!![]){try{const _0x26d987=parseInt(_0x552de5(0x107))/0x1*(parseInt(_0x552de5(0x114))/0x2)+parseInt(_0x552de5(0x113))/0x3+parseInt(_0x552de5(0x116))/0x4+parseInt(_0x552de5(0x101))/0x5+-parseInt(_0x552de5(0x10b))/0x6*(parseInt(_0x552de5(0x11c))/0x7)+-parseInt(_0x552de5(0x108))/0x8+-parseInt(_0x552de5(0x104))/0x9*(parseInt(_0x552de5(0x123))/0xa);if(_0x26d987===_0x565367)break;else _0x15a6cb['push'](_0x15a6cb['shift']());}catch(_0x1775f7){_0x15a6cb['push'](_0x15a6cb['shift']());}}}(a2_0x2e5a,0xd91b3));import{jsx as a2_0x5157df,jsxs as a2_0x4c9aaf}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';function a2_0x2e5a(){const _0x48f17a=['297egwEVt','../..','localeCompare','15rAIoqL','4383256iropwW','sort','name','122604RJwgbe','\x20\x20\x20\x20\x20\x20>\x20','\x20Step1:\x20','isDirectory','label','error','downArrow','请选择您要创建的页面模板','3123045NPCAAD','115788wAmRop','join','5538076NwRAGN','return','\x20\x20\x20\x20\x20\x20\x20\x20','upArrow','blank','gray','273YpKHCw','正在加载页面模板...','length','templates/pages','map','column','green','363470QAghhw','698035zhNuWe','dirname','filter'];a2_0x2e5a=function(){return _0x48f17a;};return a2_0x2e5a();}import a2_0x24ac1e from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x1934d9=a2_0x3615;try{const _0x35f153=fileURLToPath(import.meta.url),_0x3abca1=a2_0x24ac1e['resolve'](a2_0x24ac1e[_0x1934d9(0x102)](_0x35f153),_0x1934d9(0x105)),_0x53fbbb=a2_0x24ac1e[_0x1934d9(0x115)](_0x3abca1,_0x1934d9(0x11f)),_0x186ac3=await readdir(_0x53fbbb,{'withFileTypes':!![]}),_0x113394=_0x186ac3[_0x1934d9(0x103)](_0x34fdee=>_0x34fdee[_0x1934d9(0x10e)]())[_0x1934d9(0x120)](_0x2fc161=>({'label':_0x2fc161[_0x1934d9(0x10a)]}))[_0x1934d9(0x109)]((_0x4538e7,_0x29373a)=>_0x4538e7[_0x1934d9(0x10f)][_0x1934d9(0x106)](_0x29373a['label']));return _0x113394;}catch(_0x53f773){return console[_0x1934d9(0x110)]('获取模板列表失败:',_0x53f773),[{'label':_0x1934d9(0x11a)},{'label':'sdk-fetch'}];}}function a2_0x3615(_0x310c6d,_0x3a0734){_0x310c6d=_0x310c6d-0x101;const _0x2e5a8b=a2_0x2e5a();let _0x3615a9=_0x2e5a8b[_0x310c6d];return _0x3615a9;}export function SelectPageTemplate(_0x1fbdc2){const _0x4915ee=a2_0x3615,[_0x2dc533,_0x42bcca]=useState(0x0),[_0x1b2502,_0x304aea]=useState([]),[_0x5adaf6,_0x172727]=useState(!![]);useEffect(()=>{async function _0x1b1e55(){const _0x40594d=await getTemplateList();_0x304aea(_0x40594d),_0x172727(![]);}_0x1b1e55();},[]),useInput((_0x33ab58,_0x3baa8e)=>{const _0x417750=a2_0x3615;if(_0x5adaf6)return;if(_0x3baa8e[_0x417750(0x117)]){const _0x463b3e=_0x1b2502[_0x2dc533];_0x463b3e&&_0x1fbdc2['onSelect'](_0x463b3e[_0x417750(0x10f)]);}_0x3baa8e[_0x417750(0x119)]&&_0x42bcca(_0x4b614e=>_0x4b614e===0x0?_0x1b2502[_0x417750(0x11e)]-0x1:_0x4b614e-0x1),_0x3baa8e[_0x417750(0x111)]&&_0x42bcca(_0x2852ee=>_0x2852ee===_0x1b2502[_0x417750(0x11e)]-0x1?0x0:_0x2852ee+0x1);});if(_0x5adaf6)return a2_0x5157df(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0x4c9aaf(Box,{'children':[a2_0x5157df(Text,{'color':_0x4915ee(0x11b),'children':_0x4915ee(0x10d)}),a2_0x5157df(Text,{'children':_0x4915ee(0x11d)})]})});return a2_0x4c9aaf(Box,{'flexDirection':_0x4915ee(0x121),'paddingY':0x1,'children':[a2_0x4c9aaf(Box,{'children':[a2_0x5157df(Text,{'color':'gray','children':_0x4915ee(0x10d)}),a2_0x5157df(Text,{'children':_0x4915ee(0x112)})]}),_0x1b2502[_0x4915ee(0x120)]((_0x5ebbf9,_0x366af1)=>{const _0x3584fa=_0x4915ee,_0x35c4a6=_0x366af1===_0x2dc533,_0x93a876=_0x35c4a6?_0x3584fa(0x10c)+_0x5ebbf9[_0x3584fa(0x10f)]:_0x3584fa(0x118)+_0x5ebbf9[_0x3584fa(0x10f)];return a2_0x5157df(Box,{'children':a2_0x5157df(Text,{'color':_0x35c4a6?_0x3584fa(0x122):undefined,'children':_0x93a876})},_0x93a876);})]});}
|
package/lib/api/api-doc-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x42b801,_0x40cdaf){const _0x952380=a3_0x7d35,_0x1c7e7b=_0x42b801();while(!![]){try{const _0x458b3a=parseInt(_0x952380(0x1ba))/0x1*(parseInt(_0x952380(0x1c5))/0x2)+parseInt(_0x952380(0x1be))/0x3+-parseInt(_0x952380(0x1bc))/0x4+parseInt(_0x952380(0x1ca))/0x5*(-parseInt(_0x952380(0x1db))/0x6)+parseInt(_0x952380(0x1e0))/0x7*(-parseInt(_0x952380(0x1af))/0x8)+-parseInt(_0x952380(0x1b3))/0x9+parseInt(_0x952380(0x1b1))/0xa;if(_0x458b3a===_0x40cdaf)break;else _0x1c7e7b['push'](_0x1c7e7b['shift']());}catch(_0x5d17c5){_0x1c7e7b['push'](_0x1c7e7b['shift']());}}}(a3_0x7711,0x8a55e));import{jsx as a3_0x4ed38c,jsxs as a3_0x2db64b,Fragment as a3_0xc07d34}from'react/jsx-runtime';function a3_0x7711(){const _0x1f8764=['\x1b[90m*\x20从\x20','17848050VUNkzD','map','2556864ousQmw','log','yellow','\x20-\x20','green','未找到任何数据集','setLogPath','90hhrxpD','\x20个数据集中筛选出\x20','3245456bXRGFK','join','2207709rhmnHa','\x20个数据集','指定的数据集代码都不存在:\x20','正在生成\x20','online','*\x20生成的文档文件:','\x20(环境:\x20','7548TPgrYO','success','cwd','未提供应用AppCode,且配置中也没有默认值','env','3535PvkDfo','includes','⚠️\x20以下数据集生成失败:','dim','message','文档生成完成','gray','*\x20共处理\x20','white','datasetCode','文档生成失败:\x20','🚀\x20','\x20个匹配的数据集\x1b[0m','filePath','error','red','cyan','630msKDPa','string','lovrabet\x20auth','\x20个数据集的文档...','正在获取数据集列表...','7EyszGP','使用配置的应用AppCode:\x20','filter','./docs','√\x20文档生成完成!成功\x20','column','\x1b[33m!\x20以下数据集代码不存在:\x20','length','api-doc','8992408rQaWXr'];a3_0x7711=function(){return _0x1f8764;};return a3_0x7711();}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';function a3_0x7d35(_0x50ebef,_0x5916c6){_0x50ebef=_0x50ebef-0x1af;const _0x77112a=a3_0x7711();let _0x7d35c1=_0x77112a[_0x50ebef];return _0x7d35c1;}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x21b84b,env:_0x1502cb,output:_0x50d50,extraParams:_0x32cba5,datasetCodes:_0x1ae0d1})=>{const _0x1b4da7=a3_0x7d35,{exit:_0x39bc89}=useApp(),[_0x45c2a8,_0x12be7c]=useState(![]),[_0x162290,_0x2f629c]=useState(''),[_0x11b5b2,_0x581ffc]=useState(![]),[_0x45f04e,_0x1846b4]=useState(null),[_0x26c872,_0xa8b5d5]=useState(null),[_0x434500,_0xc9c41d]=useState(0x0),_0x1daa89=readConfig(),_0x133812=getConfigAppCode(),_0x443c68=_0x21b84b||_0x133812,_0x567197=typeof _0x1daa89?.[_0x1b4da7(0x1c9)]===_0x1b4da7(0x1dc)?_0x1daa89['env']:undefined,_0x4c87de=_0x1502cb||_0x567197||_0x1b4da7(0x1c2);initEnv(_0x4c87de);const _0x1e0baf=_0x50d50||_0x1b4da7(0x1e3),_0x414e2f=_0x21b84b?'使用指定的应用AppCode:\x20'+_0x443c68:_0x1b4da7(0x1e1)+_0x443c68;useEffect(()=>{_0x12be7c(!![]),_0x3d6a9f();},[]),useEffect(()=>{(_0x11b5b2||_0x45f04e)&&_0x39bc89();},[_0x11b5b2,_0x45f04e,_0x39bc89]);async function _0x3d6a9f(){const _0x17d905=_0x1b4da7;if(!_0x443c68){_0x1846b4(_0x17d905(0x1c8));return;}try{logger[_0x17d905(0x1b9)](process[_0x17d905(0x1c7)]()),_0x2f629c(_0x17d905(0x1df));const {configArray:_0x43b121}=await fetchModelList(_0x443c68);_0xc9c41d(_0x43b121['length']);if(_0x43b121[_0x17d905(0x1e7)]===0x0){_0x1846b4(_0x17d905(0x1b8));return;}let _0x45f1bf=_0x43b121;if(_0x1ae0d1&&_0x1ae0d1[_0x17d905(0x1e7)]>0x0){_0x45f1bf=_0x43b121['filter'](_0x2d48b8=>_0x1ae0d1[_0x17d905(0x1cb)](_0x2d48b8[_0x17d905(0x1d3)]));const _0x196df3=_0x45f1bf['map'](_0x5e21d0=>_0x5e21d0[_0x17d905(0x1d3)]),_0x17b9fb=_0x1ae0d1[_0x17d905(0x1e2)](_0x201ff1=>!_0x196df3[_0x17d905(0x1cb)](_0x201ff1));_0x17b9fb[_0x17d905(0x1e7)]>0x0&&console[_0x17d905(0x1b4)](_0x17d905(0x1e6)+_0x17b9fb[_0x17d905(0x1bd)](',\x20')+'\x1b[0m');if(_0x45f1bf['length']===0x0){_0x1846b4(_0x17d905(0x1c0)+_0x1ae0d1[_0x17d905(0x1bd)](',\x20'));return;}console[_0x17d905(0x1b4)](_0x17d905(0x1b0)+_0x43b121[_0x17d905(0x1e7)]+_0x17d905(0x1bb)+_0x45f1bf[_0x17d905(0x1e7)]+_0x17d905(0x1d6));}_0x2f629c(_0x17d905(0x1c1)+_0x45f1bf['length']+_0x17d905(0x1de));const _0x24b5df=await generateDatasetDocs(_0x45f1bf,_0x443c68,_0x1e0baf,(_0x28932c,_0x86f1f3,_0x2d7998)=>{_0x2f629c('正在生成\x20'+_0x2d7998+'.md\x20('+_0x28932c+'/'+_0x86f1f3+')');},_0x32cba5);_0xa8b5d5(_0x24b5df),_0x581ffc(!![]);const _0x22f868=_0x24b5df[_0x17d905(0x1e2)](_0x490030=>_0x490030[_0x17d905(0x1c6)])[_0x17d905(0x1e7)],_0x7d5d90=_0x24b5df[_0x17d905(0x1e2)](_0x4a48b8=>!_0x4a48b8[_0x17d905(0x1c6)])['length'];logger[_0x17d905(0x1c6)](_0x17d905(0x1e8),_0x17d905(0x1cf),undefined,{'totalCount':_0x24b5df[_0x17d905(0x1e7)],'successCount':_0x22f868,'failCount':_0x7d5d90,'outputDir':_0x1e0baf});}catch(_0x581220){const _0x4332ce=_0x581220 instanceof Error?_0x581220[_0x17d905(0x1ce)]:String(_0x581220);logger[_0x17d905(0x1d8)](_0x17d905(0x1e8),_0x17d905(0x1d4)+_0x4332ce,{'appCode':_0x443c68,'outputDir':_0x1e0baf}),_0x1846b4(_0x17d905(0x1d4)+_0x4332ce);}finally{_0x12be7c(![]);}}const _0x22a29e=_0x26c872?.[_0x1b4da7(0x1e2)](_0x3b981b=>_0x3b981b[_0x1b4da7(0x1c6)])[_0x1b4da7(0x1e7)]||0x0,_0x18df91=_0x26c872?.['filter'](_0x6ce418=>!_0x6ce418['success'])['length']||0x0;return a3_0x2db64b(Box,{'flexDirection':'column','children':[(_0x45c2a8||_0x11b5b2)&&a3_0x2db64b(Box,{'children':[a3_0x4ed38c(Text,{'color':'gray','children':'*\x20'}),a3_0x4ed38c(Text,{'color':_0x21b84b?_0x1b4da7(0x1d2):_0x1b4da7(0x1cd),'children':_0x414e2f})]}),_0x45c2a8&&a3_0x4ed38c(Box,{'children':a3_0x2db64b(Text,{'children':[_0x1b4da7(0x1d5),_0x162290,_0x1b4da7(0x1c4),_0x4c87de,')']})}),_0x11b5b2&&_0x26c872&&a3_0x2db64b(Box,{'flexDirection':_0x1b4da7(0x1e5),'children':[a3_0x4ed38c(Box,{'children':a3_0x2db64b(Text,{'color':_0x1b4da7(0x1b7),'children':[_0x1b4da7(0x1e4),_0x22a29e,'\x20个',_0x18df91>0x0&&',\x20失败\x20'+_0x18df91+'\x20个']})}),a3_0x4ed38c(Box,{'marginTop':0x1,'children':a3_0x2db64b(Text,{'color':_0x1b4da7(0x1d0),'children':[_0x1b4da7(0x1d1),_0x434500,_0x1b4da7(0x1bf)]})}),a3_0x2db64b(Box,{'marginTop':0x1,'children':[a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1d0),'children':'*\x20输出目录:\x20'}),a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1da),'children':_0x1e0baf})]}),_0x22a29e>0x0&&a3_0x2db64b(a3_0xc07d34,{'children':[a3_0x4ed38c(Box,{'marginTop':0x1,'children':a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1d0),'children':_0x1b4da7(0x1c3)})}),_0x26c872[_0x1b4da7(0x1e2)](_0x5e6773=>_0x5e6773[_0x1b4da7(0x1c6)])['map']((_0x2a8737,_0x57671c)=>a3_0x2db64b(Box,{'marginLeft':0x2,'children':[a3_0x2db64b(Text,{'color':_0x1b4da7(0x1da),'children':['•\x20',_0x2a8737[_0x1b4da7(0x1d7)]]}),a3_0x2db64b(Text,{'color':'dim','children':[_0x1b4da7(0x1b6),_0x2a8737['datasetName']]})]},_0x57671c))]}),_0x18df91>0x0&&a3_0x2db64b(a3_0xc07d34,{'children':[a3_0x4ed38c(Box,{'marginTop':0x1,'children':a3_0x4ed38c(Text,{'color':'yellow','children':_0x1b4da7(0x1cc)})}),_0x26c872[_0x1b4da7(0x1e2)](_0x46957e=>!_0x46957e[_0x1b4da7(0x1c6)])[_0x1b4da7(0x1b2)]((_0x425dda,_0x2e94ad)=>a3_0x2db64b(Box,{'marginLeft':0x2,'flexDirection':_0x1b4da7(0x1e5),'children':[a3_0x2db64b(Text,{'color':_0x1b4da7(0x1d9),'children':['•\x20',_0x425dda['datasetName'],'\x20(',_0x425dda[_0x1b4da7(0x1d3)],')']}),_0x425dda[_0x1b4da7(0x1d8)]&&a3_0x4ed38c(Box,{'marginLeft':0x2,'children':a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1cd),'children':_0x425dda[_0x1b4da7(0x1d8)]})})]},_0x2e94ad))]})]}),_0x45f04e&&a3_0x2db64b(Box,{'flexDirection':'column','children':[a3_0x4ed38c(Box,{'children':a3_0x2db64b(Text,{'color':_0x1b4da7(0x1d9),'children':['❌\x20',_0x45f04e]})}),_0x45f04e[_0x1b4da7(0x1cb)]('登录')&&a3_0x2db64b(Box,{'marginTop':0x1,'children':[a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1b5),'children':'💡\x20请使用\x20'}),a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1da),'children':_0x1b4da7(0x1dd)}),a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1b5),'children':'\x20重新登录后再试'})]})]})]});};
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a4_0x15c465=a4_0x5767;function a4_0x5767(_0x1ae36e,_0x4c87e6){_0x1ae36e=_0x1ae36e-0x82;const _0x3b4dba=a4_0x3b4d();let _0x576781=_0x3b4dba[_0x1ae36e];return _0x576781;}(function(_0x1ce184,_0x398117){const _0x1d2e1b=a4_0x5767,_0x5a549c=_0x1ce184();while(!![]){try{const _0x5b9518=-parseInt(_0x1d2e1b(0x99))/0x1+parseInt(_0x1d2e1b(0x94))/0x2*(-parseInt(_0x1d2e1b(0x95))/0x3)+-parseInt(_0x1d2e1b(0xa3))/0x4*(-parseInt(_0x1d2e1b(0x91))/0x5)+-parseInt(_0x1d2e1b(0x83))/0x6*(parseInt(_0x1d2e1b(0x87))/0x7)+parseInt(_0x1d2e1b(0xa1))/0x8*(parseInt(_0x1d2e1b(0x8f))/0x9)+parseInt(_0x1d2e1b(0xa9))/0xa+-parseInt(_0x1d2e1b(0x89))/0xb*(-parseInt(_0x1d2e1b(0x9a))/0xc);if(_0x5b9518===_0x398117)break;else _0x5a549c['push'](_0x5a549c['shift']());}catch(_0x472954){_0x5a549c['push'](_0x5a549c['shift']());}}}(a4_0x3b4d,0xa9414));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x1d351f from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a4_0x3b4d(){const _0x148e54=['获取文档失败\x20(','api-doc','application/json','✓\x20成功生成:\x20','./docs','783UsOHLx','length','1245380YDgblL','log','生成文档失败:\x20','204rmZSGi','21636sXipzZ','),HTTP状态码:\x20','等待\x203\x20秒...\x0a','\x20个数据集需要生成文档\x0a','1342816lKinGU','27252UPmiVk',']\x20正在生成:\x20','/api/node-toolbox/api-doc-generator','markdown','utf8','name','datasetCode','74176rmguDF','✗\x20失败:\x20','16XdBmal','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','json','响应数据格式错误\x20(','success','data','2099420hQbezh','string','3636438YzjxuM','join','.md','.md\x20(','7XCRMLD','):缺少\x20data.markdown\x20字段','6611RdTSST'];a4_0x3b4d=function(){return _0x148e54;};return a4_0x3b4d();}export async function fetchDatasetDoc(_0x128dba){const _0x1eda92=a4_0x5767,{appCode:_0x3073e9,datasetCode:_0xfef84c,datasetId:_0x1801d4,extraParams:_0x2c66d5}=_0x128dba,_0x1dd306=getApiDomain(),_0x50399c=_0x1dd306+_0x1eda92(0x9c),_0x1d4129={'appCode':_0x3073e9,'datasetCode':_0xfef84c,'datasetId':_0x1801d4,..._0x2c66d5||{}},_0x5e0c55=await fetch(_0x50399c,{'method':'POST','headers':{'Content-Type':_0x1eda92(0x8c),'Cookie':getCookie()},'body':JSON['stringify'](_0x1d4129)});if(!_0x5e0c55['ok']){if(_0x5e0c55['status']===0x191)throw new Error(_0x1eda92(0xa4));let _0x108c06='';try{_0x108c06=await _0x5e0c55['text']();}catch(_0x370709){}throw new Error(_0x1eda92(0x8a)+_0xfef84c+_0x1eda92(0x96)+_0x5e0c55['status']+(_0x108c06?'\x0a'+_0x108c06:''));}const _0x4ec8a7=await _0x5e0c55[_0x1eda92(0xa5)]();if(!_0x4ec8a7[_0x1eda92(0xa8)]||typeof _0x4ec8a7[_0x1eda92(0xa8)][_0x1eda92(0x9d)]!==_0x1eda92(0x82))throw new Error(_0x1eda92(0xa6)+_0xfef84c+_0x1eda92(0x88));return _0x4ec8a7['data'][_0x1eda92(0x9d)];}function delay(_0x4d6295){return new Promise(_0x3d2d0b=>setTimeout(_0x3d2d0b,_0x4d6295));}export async function generateDatasetDocs(_0x213759,_0x325f38,_0x480375=a4_0x15c465(0x8e),_0xf7803d,_0x2caf91){const _0x7bafc2=a4_0x15c465;mkdirSync(_0x480375,{'recursive':!![]});const _0x3ccdf4=[],_0x4b08b5=_0x213759['length'];console['log']('\x0a共有\x20'+_0x4b08b5+_0x7bafc2(0x98));for(let _0x167bdf=0x0;_0x167bdf<_0x213759[_0x7bafc2(0x90)];_0x167bdf++){const _0x5b13db=_0x213759[_0x167bdf],_0x369674=_0x167bdf+0x1,_0x23e184=_0x5b13db['tableName'];try{console[_0x7bafc2(0x92)]('['+_0x369674+'/'+_0x4b08b5+_0x7bafc2(0x9b)+_0x23e184+_0x7bafc2(0x86)+_0x5b13db[_0x7bafc2(0x9f)]+')');_0xf7803d&&_0xf7803d(_0x369674,_0x4b08b5,_0x23e184);const _0x5a3f4a=await fetchDatasetDoc({'appCode':_0x325f38,'datasetCode':_0x5b13db[_0x7bafc2(0xa0)],'datasetId':_0x5b13db['id'],'enableAI':![],'extraParams':_0x2caf91}),_0x1e27b3=a4_0x1d351f[_0x7bafc2(0x84)](_0x480375,_0x23e184+_0x7bafc2(0x85));writeFileSync(_0x1e27b3,_0x5a3f4a,{'encoding':_0x7bafc2(0x9e)}),console['log'](_0x7bafc2(0x8d)+_0x23e184+_0x7bafc2(0x85)),logger[_0x7bafc2(0xa7)](_0x7bafc2(0x8b),'生成文档成功:\x20'+_0x23e184,undefined,{'datasetCode':_0x5b13db[_0x7bafc2(0xa0)],'datasetName':_0x5b13db[_0x7bafc2(0x9f)],'filePath':_0x1e27b3,'progress':_0x369674+'/'+_0x4b08b5}),_0x3ccdf4['push']({'datasetCode':_0x5b13db[_0x7bafc2(0xa0)],'datasetName':_0x5b13db[_0x7bafc2(0x9f)],'filePath':_0x1e27b3,'success':!![]}),_0x369674<_0x4b08b5&&await delay(0x1388);}catch(_0x4b5f72){const _0x3e80b0=_0x4b5f72 instanceof Error?_0x4b5f72['message']:String(_0x4b5f72);console[_0x7bafc2(0x92)](_0x7bafc2(0xa2)+_0x23e184+'.md\x20-\x20'+_0x3e80b0+'\x0a'),logger['error'](_0x7bafc2(0x8b),_0x7bafc2(0x93)+_0x5b13db[_0x7bafc2(0xa0)],{'datasetCode':_0x5b13db[_0x7bafc2(0xa0)],'datasetName':_0x5b13db['name'],'error':_0x3e80b0,'progress':_0x369674+'/'+_0x4b08b5}),_0x3ccdf4['push']({'datasetCode':_0x5b13db[_0x7bafc2(0xa0)],'datasetName':_0x5b13db[_0x7bafc2(0x9f)],'filePath':'','success':![],'error':_0x3e80b0}),_0x369674<_0x4b08b5&&(console[_0x7bafc2(0x92)](_0x7bafc2(0x97)),await delay(0xbb8));}}return _0x3ccdf4;}
|
package/lib/api/api-pull-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b7d7e,_0x4674d6){const _0x3862b9=a5_0x142e,_0x211822=_0x1b7d7e();while(!![]){try{const _0x258693=-parseInt(_0x3862b9(0xbe))/0x1+-parseInt(_0x3862b9(0xc5))/0x2*(parseInt(_0x3862b9(0xcd))/0x3)+parseInt(_0x3862b9(0xd4))/0x4+-parseInt(_0x3862b9(0xca))/0x5+parseInt(_0x3862b9(0xc9))/0x6*(parseInt(_0x3862b9(0xe5))/0x7)+parseInt(_0x3862b9(0xcf))/0x8*(parseInt(_0x3862b9(0xb8))/0x9)+-parseInt(_0x3862b9(0xbc))/0xa*(-parseInt(_0x3862b9(0xdf))/0xb);if(_0x258693===_0x4674d6)break;else _0x211822['push'](_0x211822['shift']());}catch(_0xbde454){_0x211822['push'](_0x211822['shift']());}}}(a5_0xb077,0x2ee06));import{jsx as a5_0x58f473,jsxs as a5_0x419431}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a5_0x142e(_0x5a4a49,_0x56a674){_0x5a4a49=_0x5a4a49-0xb5;const _0xb07786=a5_0xb077();let _0x142efe=_0xb07786[_0x5a4a49];return _0x142efe;}function a5_0xb077(){const _0x4b2caf=['red','includes','1590hyXHQB','\x20重新登录后再试','28463icHazU','online','replace','env','api','-\x20模型配置文件\x20(','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','150162WfsqOD','gray','.ts','duplicateCount','18mFMyLX','1428595tYORxm','未提供应用AppCode,且配置中也没有默认值','*\x20导入方式:','15OSThJk','dim','35368tLmdQw','client','拉取\x20API\x20配置失败:\x20','split','💡\x20请使用\x20','1109972KXYlMe','!\x20原始数据集\x20','\x20个模型)','message','cyan','join','lovrabet\x20auth','import\x20','length','\x20from\x20\x27@/','modelCount','29535gtgPgi','api-pull','-client','./src/api/','white','-api','403116afYyPf','string','column','√\x20成功拉取\x20','error','yellow','{\x20lovrabetClient\x20}','\x20个模型','originalCount','slice','setLogPath','9tfcJOK','\x20-\x20客户端实例文件'];a5_0xb077=function(){return _0x4b2caf;};return a5_0xb077();}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x596a2b,env:_0x1ba2a8,output:_0x1e5c84})=>{const _0x4f3ba5=a5_0x142e,{exit:_0x433605}=useApp(),[_0xf08c84,_0x14a052]=useState(![]),[_0xdf5aae,_0x5d8491]=useState(![]),[_0x33d5,_0x4189df]=useState(null),[_0x40bfc4,_0x4ec05e]=useState(null),_0x5ce478=readConfig(),_0x23d71b=getConfigAppCode(),_0xac74b3=_0x596a2b||_0x23d71b,_0x553c99=typeof _0x5ce478?.[_0x4f3ba5(0xc1)]===_0x4f3ba5(0xe6)?_0x5ce478[_0x4f3ba5(0xc1)]:undefined,_0xc20ceb=_0x1ba2a8||_0x553c99||_0x4f3ba5(0xbf);initEnv(_0xc20ceb);const _0x1f8c61=_0x1e5c84||_0x4f3ba5(0xe2),_0x515008=_0x596a2b&&_0x596a2b[_0x4f3ba5(0xbb)]('-')?_0x596a2b[_0x4f3ba5(0xd2)]('-')[_0x4f3ba5(0xb6)](0x1)[_0x4f3ba5(0xd9)]('-'):'',_0x3f8985=_0x596a2b?'使用指定的应用AppCode:\x20'+_0xac74b3:'使用配置的应用AppCode:\x20'+_0xac74b3,_0x41a839=_0x515008?_0x515008+_0x4f3ba5(0xe4):_0x4f3ba5(0xc2),_0x35d406=_0x515008?_0x515008+_0x4f3ba5(0xe1):_0x4f3ba5(0xd0);useEffect(()=>{_0x14a052(!![]),_0x3aa594();},[]),useEffect(()=>{(_0xdf5aae||_0x33d5)&&_0x433605();},[_0xdf5aae,_0x33d5,_0x433605]);async function _0x3aa594(){const _0x4b1433=_0x4f3ba5;if(!_0xac74b3){_0x4189df(_0x4b1433(0xcb));return;}try{logger[_0x4b1433(0xb7)](process['cwd']());const {configArray:_0x464732}=await fetchModelList(_0xac74b3),_0x86de39=_0x464732[_0x4b1433(0xdc)],_0x4a7992=!_0x596a2b,_0x5ce5b3=await generateApiFile(_0x464732,_0x515008,_0xac74b3,_0x4a7992,_0xc20ceb,_0x1f8c61),_0x5f4532=_0x1f8c61['endsWith']('/')?_0x1f8c61:_0x1f8c61+'/';_0x4ec05e({'api':''+_0x5f4532+_0x41a839+_0x4b1433(0xc7),'client':''+_0x5f4532+_0x35d406+_0x4b1433(0xc7),'modelCount':_0x5ce5b3[_0x4b1433(0xde)],'datasetCount':_0x86de39,'originalCount':_0x86de39,'duplicateCount':0x0}),_0x5d8491(!![]);}catch(_0x105fdd){const _0x190f30=_0x105fdd instanceof Error?_0x105fdd[_0x4b1433(0xd7)]:String(_0x105fdd);logger[_0x4b1433(0xe9)](_0x4b1433(0xe0),'拉取\x20API\x20配置失败:\x20'+_0x190f30,{'appCode':_0xac74b3,'error':_0x190f30}),_0x4189df(_0x4b1433(0xd1)+_0x190f30);}finally{_0x14a052(![]);}}return a5_0x419431(Box,{'flexDirection':_0x4f3ba5(0xe7),'children':[(_0xf08c84||_0xdf5aae)&&a5_0x419431(Box,{'children':[a5_0x58f473(Text,{'color':'gray','children':'*\x20'}),a5_0x58f473(Text,{'color':_0x596a2b?_0x4f3ba5(0xe3):_0x4f3ba5(0xce),'children':_0x3f8985})]}),_0xf08c84&&a5_0x58f473(Box,{'children':a5_0x419431(Text,{'children':[_0x4f3ba5(0xc4),_0xc20ceb,')']})}),_0xdf5aae&&_0x40bfc4&&a5_0x419431(Box,{'flexDirection':'column','children':[a5_0x58f473(Box,{'children':a5_0x419431(Text,{'color':'green','children':[_0x4f3ba5(0xe8),_0x40bfc4['datasetCount'],'\x20个数据集,生成','\x20',_0x40bfc4[_0x4f3ba5(0xde)],_0x4f3ba5(0xec)]})}),_0x40bfc4[_0x4f3ba5(0xc8)]>0x0&&a5_0x58f473(Box,{'marginTop':0x1,'children':a5_0x419431(Text,{'color':_0x4f3ba5(0xea),'children':[_0x4f3ba5(0xd5),_0x40bfc4[_0x4f3ba5(0xb5)],'\x20个,过滤重复','\x20',_0x40bfc4[_0x4f3ba5(0xc8)],'\x20个']})}),a5_0x58f473(Box,{'marginTop':0x1,'children':a5_0x58f473(Text,{'color':_0x4f3ba5(0xc6),'children':'*\x20已生成文件:'})}),a5_0x419431(Box,{'marginLeft':0x2,'children':[a5_0x419431(Text,{'color':_0x4f3ba5(0xd8),'children':['•\x20',_0x40bfc4[_0x4f3ba5(0xc2)]]}),a5_0x419431(Text,{'color':_0x4f3ba5(0xce),'children':['\x20',_0x4f3ba5(0xc3),_0x40bfc4[_0x4f3ba5(0xde)],_0x4f3ba5(0xd6)]})]}),a5_0x419431(Box,{'marginLeft':0x2,'children':[a5_0x419431(Text,{'color':'cyan','children':['•\x20',_0x40bfc4['client']]}),a5_0x58f473(Text,{'color':_0x4f3ba5(0xce),'children':_0x4f3ba5(0xb9)})]}),a5_0x58f473(Box,{'marginTop':0x1,'children':a5_0x58f473(Text,{'color':'gray','children':_0x4f3ba5(0xcc)})}),a5_0x58f473(Box,{'marginLeft':0x2,'children':a5_0x419431(Text,{'color':_0x4f3ba5(0xea),'children':[_0x4f3ba5(0xdb),_0x4f3ba5(0xeb),_0x4f3ba5(0xdd),_0x40bfc4['client'][_0x4f3ba5(0xc0)](/^\.\//,'')[_0x4f3ba5(0xc0)](_0x4f3ba5(0xc7),''),'\x27']})})]}),_0x33d5&&a5_0x419431(Box,{'flexDirection':'column','children':[a5_0x58f473(Box,{'children':a5_0x419431(Text,{'color':_0x4f3ba5(0xba),'children':['❌\x20',_0x33d5]})}),_0x33d5[_0x4f3ba5(0xbb)]('登录')&&a5_0x419431(Box,{'marginTop':0x1,'children':[a5_0x58f473(Text,{'color':'yellow','children':_0x4f3ba5(0xd3)}),a5_0x58f473(Text,{'color':'cyan','children':_0x4f3ba5(0xda)}),a5_0x58f473(Text,{'color':_0x4f3ba5(0xea),'children':_0x4f3ba5(0xbd)})]})]})]});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a6_0x1b30(_0x1c146c,_0x257ac9){_0x1c146c=_0x1c146c-0x1e7;const _0x4ba9bc=a6_0x4ba9();let _0x1b3030=_0x4ba9bc[_0x1c146c];return _0x1b3030;}function a6_0x4ba9(){const _0xa3feb9=['获取数据集失败:\x20','count','configArray','/api/node-toolbox/dataset/model-list?appcode=','获取数据集失败,HTTP状态码:\x20','message','data','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','89314sraaXg','736232OCGdCI','&otype=array','status','6RTtEWf','json','正在从服务器拉取模型列表...\x20(环境:\x20','32858kzEzOh','2772570SPyJJR','7MSAIrr','1254516PwgxtP','2728413zUGgKY','success','9907770HnVMNM','48gOSQWG'];a6_0x4ba9=function(){return _0xa3feb9;};return a6_0x4ba9();}(function(_0x2d54e8,_0x3553d5){const _0x15d530=a6_0x1b30,_0x572ee2=_0x2d54e8();while(!![]){try{const _0x248bc0=parseInt(_0x15d530(0x1f0))/0x1*(parseInt(_0x15d530(0x1e7))/0x2)+-parseInt(_0x15d530(0x1eb))/0x3*(-parseInt(_0x15d530(0x1e8))/0x4)+parseInt(_0x15d530(0x1ef))/0x5+-parseInt(_0x15d530(0x1f1))/0x6+-parseInt(_0x15d530(0x1ee))/0x7*(parseInt(_0x15d530(0x1f5))/0x8)+parseInt(_0x15d530(0x1f2))/0x9+-parseInt(_0x15d530(0x1f4))/0xa;if(_0x248bc0===_0x3553d5)break;else _0x572ee2['push'](_0x572ee2['shift']());}catch(_0x3a73bb){_0x572ee2['push'](_0x572ee2['shift']());}}}(a6_0x4ba9,0x4bc57));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x37f005){const _0x312348=a6_0x1b30,_0xf9b3ec=getEnv(),_0x57812f=getApiDomain()+_0x312348(0x1f9)+_0x37f005+_0x312348(0x1e9);logger['info']('fetch-model-list',_0x312348(0x1ed)+_0xf9b3ec+')',{'apiUrl':_0x57812f});const _0xe7c057=await fetch(_0x57812f,{'headers':{'Cookie':getCookie()}});if(!_0xe7c057['ok']){if(_0xe7c057[_0x312348(0x1ea)]===0x191)throw new Error(_0x312348(0x1fd));throw new Error(_0x312348(0x1fa)+_0xe7c057['status']);}const _0x189ac7=await _0xe7c057[_0x312348(0x1ec)]();if(!_0x189ac7[_0x312348(0x1f3)])throw new Error(_0x312348(0x1f6)+(_0x189ac7[_0x312348(0x1fb)]||'未知错误'));return{'configArray':_0x189ac7['data'][_0x312348(0x1f8)],'count':_0x189ac7[_0x312348(0x1fc)][_0x312348(0x1f7)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a7_0x30cb(_0x259aa5,_0x5922ee){_0x259aa5=_0x259aa5-0x190;const _0x4b5372=a7_0x4b53();let _0x30cb50=_0x4b5372[_0x259aa5];return _0x30cb50;}const a7_0x2a63e1=a7_0x30cb;(function(_0x4fb53d,_0x1484be){const _0x4253ac=a7_0x30cb,_0x4063c4=_0x4fb53d();while(!![]){try{const _0x21193d=-parseInt(_0x4253ac(0x1a2))/0x1*(parseInt(_0x4253ac(0x194))/0x2)+-parseInt(_0x4253ac(0x1b5))/0x3*(parseInt(_0x4253ac(0x196))/0x4)+-parseInt(_0x4253ac(0x1ad))/0x5+parseInt(_0x4253ac(0x193))/0x6+parseInt(_0x4253ac(0x1a4))/0x7*(-parseInt(_0x4253ac(0x19d))/0x8)+parseInt(_0x4253ac(0x19c))/0x9*(-parseInt(_0x4253ac(0x199))/0xa)+-parseInt(_0x4253ac(0x1af))/0xb*(-parseInt(_0x4253ac(0x1ab))/0xc);if(_0x21193d===_0x1484be)break;else _0x4063c4['push'](_0x4063c4['shift']());}catch(_0x462b0c){_0x4063c4['push'](_0x4063c4['shift']());}}}(a7_0x4b53,0x62e8c));import a7_0x42cd34 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x4e08ad from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a7_0x4b53(){const _0x55eb3a=['请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','typescript','31825632UxvUom','init-api','2887660JJvNsw','endsWith','11RJhZTh','.ts','replaceApiContent','format','join','-client','21Mtxbav','api.ts.tpl','online','keys','length','./src/api/','utf8','tableName','1581312RPQIJX','9610jeEiHd','name','349688UWHcjE','../..','env','30fLDkSx',',\x20env:\x20\x22','API\x20文件生成成功!','1190817ikPTho','879808hLTvwu','templates/generate-api','dirname','{\x20apiConfigName:\x20','success','55SdExOe','{\x20apiConfigName:\x20\x22','42KqvEpu','client.ts.tpl','slice','key','string'];a7_0x4b53=function(){return _0x55eb3a;};return a7_0x4b53();}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x35c65e,_0x1f30cc='',_0x5ec396,_0x2db426=![],_0x5cfe2e,_0x10143b=a7_0x2a63e1(0x190)){const _0x226a05=a7_0x2a63e1,_0x2e97d6=readConfig(),_0x49dd01=_0x5ec396||_0x2e97d6?.['app'];if(typeof _0x49dd01!==_0x226a05(0x1a8)||!_0x49dd01)throw new Error(_0x226a05(0x1a9));const _0x2b3153=_0x2db426?'CONFIG_NAMES.DEFAULT':'\x22'+_0x49dd01+'\x22',_0x5c7e73=typeof _0x2e97d6[_0x226a05(0x198)]===_0x226a05(0x1a8)?_0x2e97d6['env']:undefined,_0x2b0020=_0x5cfe2e||_0x5c7e73||_0x226a05(0x1b7),_0x148381=_0x2b0020!=='online';let _0x16672e;if(_0x2db426)_0x148381?_0x16672e=_0x226a05(0x1a0)+_0x2b3153+_0x226a05(0x19a)+_0x2b0020+'\x22\x20}':_0x16672e='';else{const _0x1a53dc=_0x148381?',\x20env:\x20\x22'+_0x2b0020+'\x22':'';_0x16672e=_0x226a05(0x1a3)+_0x49dd01+'\x22'+_0x1a53dc+'\x20}';}const _0x150f55=_0x1f30cc?_0x1f30cc+'-api':'api',_0x294634=_0x1f30cc?_0x1f30cc+_0x226a05(0x1b4):'client',_0x5bcfed={};_0x35c65e['forEach'](_0x376a0a=>{const _0x18699c=_0x226a05;_0x5bcfed[_0x376a0a[_0x18699c(0x1a7)]]={'tableName':_0x376a0a[_0x18699c(0x192)],'datasetCode':_0x376a0a['datasetCode'],'name':_0x376a0a[_0x18699c(0x195)]||''};});const _0x5d3342=fileURLToPath(import.meta.url),_0xcebdd=a7_0x4e08ad['resolve'](a7_0x4e08ad[_0x226a05(0x19f)](_0x5d3342),_0x226a05(0x197)),_0xc58b30=a7_0x4e08ad[_0x226a05(0x1b3)](_0xcebdd,_0x226a05(0x19e)),_0x19da95=a7_0x4e08ad['join'](_0xc58b30,_0x226a05(0x1b6)),_0x131929=a7_0x4e08ad[_0x226a05(0x1b3)](_0xc58b30,_0x226a05(0x1a5)),_0x2922c2=_0x10143b[_0x226a05(0x1ae)]('/')?_0x10143b[_0x226a05(0x1a6)](0x0,-0x1):_0x10143b;mkdirSync(_0x2922c2,{'recursive':!![]});const _0x4d1502=readFileSync(_0x19da95,_0x226a05(0x191)),_0x4dbf90=TemplateReplacer[_0x226a05(0x1b1)](_0x4d1502,_0x49dd01,_0x5bcfed,Object['keys'](_0x5bcfed)[0x0],_0x150f55,_0x2b3153),_0x526f25=await a7_0x42cd34['format'](_0x4dbf90,{'parser':'typescript'}),_0x25eefa=_0x2922c2+'/'+_0x150f55+_0x226a05(0x1b0);writeFileSync(_0x25eefa,_0x526f25,{'encoding':_0x226a05(0x191)});const _0x496de6=readFileSync(_0x131929,'utf8'),_0x523e39=TemplateReplacer[_0x226a05(0x1b1)](_0x496de6,_0x49dd01,_0x5bcfed,Object[_0x226a05(0x1b8)](_0x5bcfed)[0x0],_0x150f55,_0x2b3153,_0x16672e),_0x1eb0ec=await a7_0x42cd34[_0x226a05(0x1b2)](_0x523e39,{'parser':_0x226a05(0x1aa)}),_0x45968c=_0x2922c2+'/'+_0x294634+_0x226a05(0x1b0);writeFileSync(_0x45968c,_0x1eb0ec,{'encoding':_0x226a05(0x191)});const _0x21c869=Object[_0x226a05(0x1b8)](_0x5bcfed)[_0x226a05(0x1b9)];return logger[_0x226a05(0x1a1)](_0x226a05(0x1ac),_0x226a05(0x19b),undefined,{'apiFile':_0x25eefa,'clientFile':_0x45968c,'modelCount':_0x21c869,'configName':_0x2b3153}),{'modelCount':_0x21c869,'apiFilePath':_0x25eefa,'clientFilePath':_0x45968c,'configName':_0x2b3153};}
|
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a8_0x3556(){const _0x2ce818=['parse','❌\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配置文件','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','trim','204zfgjTD','exit','×\x20--datasetcode\x20参数不能为空','filter','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','4757084tqwSMk','input','split','28397ILhCTD','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','log','\x20\x20错误:\x20','\x1b[90m*\x20使用配置的应用AppCode:\x20','error','50LjKPEx','length','\x1b[90m*\x20仅生成指定数据集的文档:\x20','pull','×\x20未配置\x20AppCode','Available\x20commands:','map','message','appcode','681570jmIxSy','\x1b[0m','88475TMVmXc','\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请使用以下方式之一:','string','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','请使用\x20--appcode\x20参数,例如:','env','isArray','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','10352768ULXwFo','5741141jVRtcK','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','9363510zTxtCB','help','datasetcode','params','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','join','flags'];a8_0x3556=function(){return _0x2ce818;};return a8_0x3556();}(function(_0x47c2d3,_0x4a78b3){const _0xefbb88=a8_0x57ae,_0x18bf37=_0x47c2d3();while(!![]){try{const _0x5b6430=-parseInt(_0xefbb88(0xb4))/0x1*(parseInt(_0xefbb88(0x87))/0x2)+-parseInt(_0xefbb88(0x90))/0x3+parseInt(_0xefbb88(0xb1))/0x4+-parseInt(_0xefbb88(0x92))/0x5*(parseInt(_0xefbb88(0xac))/0x6)+parseInt(_0xefbb88(0x9c))/0x7+parseInt(_0xefbb88(0x9b))/0x8+-parseInt(_0xefbb88(0x9e))/0x9;if(_0x5b6430===_0x4a78b3)break;else _0x18bf37['push'](_0x18bf37['shift']());}catch(_0x54f109){_0x18bf37['push'](_0x18bf37['shift']());}}}(a8_0x3556,0xb0dab));import{jsx as a8_0x3e7f9c}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a8_0x57ae(_0x282b3b,_0x398c1f){_0x282b3b=_0x282b3b-0x87;const _0x3556cf=a8_0x3556();let _0x57ae74=_0x3556cf[_0x282b3b];return _0x57ae74;}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x1f4819){const _0x41b9f3=a8_0x57ae,_0x5076eb=_0x1f4819[_0x41b9f3(0xb2)][0x1];if(_0x1f4819[_0x41b9f3(0xa6)][_0x41b9f3(0x9f)]){console[_0x41b9f3(0xb6)](_0x41b9f3(0x93));return;}if(_0x5076eb===_0x41b9f3(0x8a)){_0x1f4819['input'][0x2]&&(console[_0x41b9f3(0xb9)](_0x41b9f3(0xa8)),console['log'](_0x41b9f3(0x97)),console[_0x41b9f3(0xb6)](_0x41b9f3(0xa2)+_0x1f4819[_0x41b9f3(0xb2)][0x2]),process[_0x41b9f3(0xad)](0x1));const _0x40a9ac=getConfigAppCode();let _0x3d4bd1=_0x1f4819['flags'][_0x41b9f3(0x8f)];const _0x19014a=typeof _0x1f4819[_0x41b9f3(0xa6)][_0x41b9f3(0x98)]===_0x41b9f3(0x95)?_0x1f4819[_0x41b9f3(0xa6)]['env']:undefined,_0x36b44a=_0x1f4819['flags']['output'];!_0x3d4bd1&&!_0x40a9ac&&(console[_0x41b9f3(0xb9)](_0x41b9f3(0x8b)),console[_0x41b9f3(0xb6)](_0x41b9f3(0x94)),console['log'](_0x41b9f3(0xb0)),console[_0x41b9f3(0xb6)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>'),process['exit'](0x1)),_0x3d4bd1&&_0x40a9ac&&_0x3d4bd1===_0x40a9ac&&(console[_0x41b9f3(0xb6)](_0x41b9f3(0xb8)+_0x3d4bd1+_0x41b9f3(0x91)),console[_0x41b9f3(0xb6)](_0x41b9f3(0xa4)),_0x3d4bd1=undefined),render(a8_0x3e7f9c(ApiPullUI,{'appCode':_0x3d4bd1,'env':_0x19014a,'output':_0x36b44a}));}else{if(_0x5076eb==='doc'){_0x1f4819[_0x41b9f3(0xb2)][0x2]&&(console[_0x41b9f3(0xb9)](_0x41b9f3(0xa8)),console['log'](_0x41b9f3(0x97)),console['log'](_0x41b9f3(0xa3)+_0x1f4819[_0x41b9f3(0xb2)][0x2]),process['exit'](0x1));const _0x2f8445=getConfigAppCode();let _0x5bb971=_0x1f4819['flags'][_0x41b9f3(0x8f)];const _0x5acfe9=typeof _0x1f4819['flags'][_0x41b9f3(0x98)]===_0x41b9f3(0x95)?_0x1f4819[_0x41b9f3(0xa6)][_0x41b9f3(0x98)]:undefined,_0x47fef3=_0x1f4819[_0x41b9f3(0xa6)]['output'],_0x39d0a8=_0x1f4819[_0x41b9f3(0xa6)][_0x41b9f3(0xa1)],_0x3bdb8b=_0x1f4819[_0x41b9f3(0xa6)][_0x41b9f3(0xa0)];!_0x5bb971&&!_0x2f8445&&(console['error'](_0x41b9f3(0x8b)),console[_0x41b9f3(0xb6)](_0x41b9f3(0x94)),console[_0x41b9f3(0xb6)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x41b9f3(0xb6)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>'),process['exit'](0x1));_0x5bb971&&_0x2f8445&&_0x5bb971===_0x2f8445&&(console[_0x41b9f3(0xb6)](_0x41b9f3(0xb8)+_0x5bb971+_0x41b9f3(0x91)),_0x5bb971=undefined);let _0x4cfaf2;if(_0x39d0a8)try{_0x4cfaf2=JSON[_0x41b9f3(0xa7)](_0x39d0a8),(typeof _0x4cfaf2!=='object'||_0x4cfaf2===null||Array[_0x41b9f3(0x99)](_0x4cfaf2))&&(console[_0x41b9f3(0xb9)](_0x41b9f3(0x9d)),process[_0x41b9f3(0xad)](0x1));}catch(_0x3c4455){console[_0x41b9f3(0xb9)]('×\x20--params\x20参数不是有效的\x20JSON\x20格式'),console[_0x41b9f3(0xb9)](_0x41b9f3(0xb7)+(_0x3c4455 instanceof Error?_0x3c4455[_0x41b9f3(0x8e)]:String(_0x3c4455))),process[_0x41b9f3(0xad)](0x1);}let _0x2bf24d;_0x3bdb8b&&(_0x2bf24d=_0x3bdb8b[_0x41b9f3(0xb3)](',')[_0x41b9f3(0x8d)](_0x5cbf7d=>_0x5cbf7d[_0x41b9f3(0xab)]())[_0x41b9f3(0xaf)](_0x523d30=>_0x523d30[_0x41b9f3(0x88)]>0x0),_0x2bf24d[_0x41b9f3(0x88)]===0x0&&(console[_0x41b9f3(0xb9)](_0x41b9f3(0xae)),process['exit'](0x1)),console[_0x41b9f3(0xb6)](_0x41b9f3(0x89)+_0x2bf24d[_0x41b9f3(0xa5)](',\x20')+'\x1b[0m')),render(a8_0x3e7f9c(ApiDocUI,{'appCode':_0x5bb971,'env':_0x5acfe9,'output':_0x47fef3,'extraParams':_0x4cfaf2,'datasetCodes':_0x2bf24d}));}else console['error']('Unknown\x20api\x20command:\x20'+_0x5076eb),console[_0x41b9f3(0xb6)](_0x41b9f3(0x8c)),console[_0x41b9f3(0xb6)](_0x41b9f3(0xa9)),console[_0x41b9f3(0xb6)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console['log'](_0x41b9f3(0xaa)),console[_0x41b9f3(0xb6)](_0x41b9f3(0xb5)),console[_0x41b9f3(0xb6)](''),console['log']('\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文档'),console[_0x41b9f3(0xb6)](_0x41b9f3(0x9a)),console[_0x41b9f3(0xb6)](_0x41b9f3(0x96)),console[_0x41b9f3(0xb6)]('\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),process[_0x41b9f3(0xad)](0x1);}}
|
package/lib/api/pull-silent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50a799,_0x1d1fb1){const _0x39ae89=a9_0x3381,_0x5cb1b8=_0x50a799();while(!![]){try{const _0x4114e1=parseInt(_0x39ae89(0xa1))/0x1*(parseInt(_0x39ae89(0xb4))/0x2)+parseInt(_0x39ae89(0xbd))/0x3*(-parseInt(_0x39ae89(0xb3))/0x4)+parseInt(_0x39ae89(0xa7))/0x5*(-parseInt(_0x39ae89(0x9f))/0x6)+parseInt(_0x39ae89(0xa9))/0x7+-parseInt(_0x39ae89(0xc1))/0x8*(parseInt(_0x39ae89(0xb1))/0x9)+parseInt(_0x39ae89(0xaf))/0xa+parseInt(_0x39ae89(0xbf))/0xb*(parseInt(_0x39ae89(0xa5))/0xc);if(_0x4114e1===_0x1d1fb1)break;else _0x5cb1b8['push'](_0x5cb1b8['shift']());}catch(_0xfdea77){_0x5cb1b8['push'](_0x5cb1b8['shift']());}}}(a9_0x47e9,0xb25b9));function a9_0x3381(_0x12ffb2,_0x226792){_0x12ffb2=_0x12ffb2-0x99;const _0x47e96d=a9_0x47e9();let _0x3381f1=_0x47e96d[_0x12ffb2];return _0x3381f1;}import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';function a9_0x47e9(){const _0x2458d9=['client','15696UbbQGq','\x20\x20\x20•\x20','5972eZztuV','142VScFxh','√\x20成功拉取\x20','\x20个模型','.ts\x20-\x20客户端实例文件','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','create-api-pull','.ts\x20-\x20模型配置文件','error','chdir','2460FXbeHp','info','22qwUzvh','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','432gjHcMG','-client','string','modelCount','cwd','api','API\x20配置拉取异常:\x20','log','9408rlycxZ','API\x20配置拉取成功:\x20','5722rtTLCT','env','\x20个数据集,生成\x20','message','4229688epoyDI','test','1390dYnEXX','*\x20开始生成\x20API\x20配置文件:','8943921wWhwPp','online','\x20个数据集...','*\x20正在处理\x20','trim','length','959800AxUzvU'];a9_0x47e9=function(){return _0x2458d9;};return a9_0x47e9();}export async function pullApiSilent(_0x4d4e43,_0x74e5db,_0x2885ee,_0xe9e828){const _0x1a23c9=a9_0x3381;let _0x3f5ab3;try{const _0x213b53=_0x74e5db?.[_0x1a23c9(0xad)]()||'';if(_0x213b53){const _0x3e4272=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x3e4272[_0x1a23c9(0xa6)](_0x213b53))return console[_0x1a23c9(0xbb)](_0x1a23c9(0xb8)),![];}_0x2885ee&&(_0x3f5ab3=process[_0x1a23c9(0x9b)](),process['chdir'](_0x2885ee));const _0x35dd1a=readConfig(),_0x337cad=typeof _0x35dd1a[_0x1a23c9(0xa2)]===_0x1a23c9(0x99)?_0x35dd1a[_0x1a23c9(0xa2)]:undefined,_0x4bdc5d=_0xe9e828||_0x337cad||_0x1a23c9(0xaa);initEnv(_0x4bdc5d),console['log'](_0x1a23c9(0xc0)+_0x4bdc5d+')');const {configArray:_0x227e72}=await fetchModelList(_0x4d4e43),_0xed1b5b=_0x213b53?_0x213b53+'-api':_0x1a23c9(0x9c),_0x22a9cd=_0x213b53?_0x213b53+_0x1a23c9(0xc2):_0x1a23c9(0xb0);console[_0x1a23c9(0x9e)](_0x1a23c9(0xa8)),console[_0x1a23c9(0x9e)](_0x1a23c9(0xb2)+_0xed1b5b+_0x1a23c9(0xba)),console[_0x1a23c9(0x9e)](_0x1a23c9(0xb2)+_0x22a9cd+_0x1a23c9(0xb7)),console[_0x1a23c9(0x9e)](_0x1a23c9(0xac)+_0x227e72[_0x1a23c9(0xae)]+_0x1a23c9(0xab));const _0x14812a=await generateApiFile(_0x227e72,_0x213b53,_0x4d4e43,!![],_0x4bdc5d);return console[_0x1a23c9(0x9e)](_0x1a23c9(0xb5)+_0x227e72[_0x1a23c9(0xae)]+_0x1a23c9(0xa3)+_0x14812a[_0x1a23c9(0x9a)]+_0x1a23c9(0xb6)),_0x2885ee&&logger[_0x1a23c9(0xbe)](_0x1a23c9(0xb9),_0x1a23c9(0xa0)+_0x4d4e43,{'projectPath':_0x2885ee,'appCode':_0x4d4e43,'datasetCount':_0x227e72[_0x1a23c9(0xae)],'filePrefix':_0x213b53}),!![];}catch(_0x5a6da7){const _0x32a74f=_0x5a6da7 instanceof Error?_0x5a6da7[_0x1a23c9(0xa4)]:String(_0x5a6da7);return console['error']('×\x20API\x20配置拉取异常:',_0x32a74f),_0x2885ee&&logger['error'](_0x1a23c9(0xb9),_0x1a23c9(0x9d)+_0x32a74f,{'appCode':_0x4d4e43,'projectPath':_0x2885ee}),![];}finally{_0x3f5ab3&&process[_0x1a23c9(0xbc)](_0x3f5ab3);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a10_0x1c3d(){const _0x386cd2=['slice','delete','length','fill','6221952NTiGst','!\x20未找到本地页面,请先创建页面','CSS\x20链接无法访问','[✓]','gray','message','downArrow','提示:使用\x20','5EAoqHh','input-js','green','selecting','filter','label','red','5805068jkBYuV','JS\x20链接无法访问','online','max','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','302772juajNp','catch','has','blue','请输入有效的\x20JS\x20https\x20链接','size','path','3970vZdWNK','\x20输入项目的\x20JS\x20资源链接(https://...)','value','white','cyan','*\x20CSS\x20链接:\x20','\x20←\x20','input-css','创建菜单失败','17858082fBjDGF','*\x20请选择要同步的菜单:','map','return','*\x20正在创建菜单...','[\x20]','菜单名称','join','local','then','21177kuxrpy','includes','upArrow','lovrabet\x20auth','dots','请输入有效的\x20CSS\x20https\x20链接','2309223PVzHQp','add','*\x20JS\x20链接:\x20','\x20命令重新登录','\x20输入项目的\x20CSS\x20资源链接(https://...)','*\x20同步菜单到\x20Lovrabet\x20平台','creating','column','1BHujXf','2809912kXzaqd','yellow','14BunPsV'];a10_0x1c3d=function(){return _0x386cd2;};return a10_0x1c3d();}(function(_0x3574a0,_0x47a5fa){const _0x1371b1=a10_0x11d3,_0x4918f2=_0x3574a0();while(!![]){try{const _0x374658=-parseInt(_0x1371b1(0x119))/0x1*(parseInt(_0x1371b1(0x11a))/0x2)+parseInt(_0x1371b1(0x111))/0x3+parseInt(_0x1371b1(0xec))/0x4*(parseInt(_0x1371b1(0xe5))/0x5)+-parseInt(_0x1371b1(0xf1))/0x6*(-parseInt(_0x1371b1(0x11c))/0x7)+-parseInt(_0x1371b1(0x121))/0x8+parseInt(_0x1371b1(0x10b))/0x9*(-parseInt(_0x1371b1(0xf8))/0xa)+parseInt(_0x1371b1(0x101))/0xb;if(_0x374658===_0x47a5fa)break;else _0x4918f2['push'](_0x4918f2['shift']());}catch(_0x1351de){_0x4918f2['push'](_0x4918f2['shift']());}}}(a10_0x1c3d,0xca489));import{jsx as a10_0x5c19b9,jsxs as a10_0x7bffe6,Fragment as a10_0x2823bc}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x12a9c9 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_0x5c19b9(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x2598d9=a10_0x11d3,{exit:_0x1085d7}=useApp(),{loading:_0x44c94b,menuList:_0x5d6d9e,error:_0x381e4f}=useGetOnlineMenuList(),_0x39c73c=getLocalPages(),_0x51263b=_0x5d6d9e[_0x2598d9(0x103)](_0x18f074=>_0x18f074[_0x2598d9(0xf7)]),_0x3a4471=[_0x2598d9(0x107),..._0x39c73c[_0x2598d9(0x103)](_0x277772=>_0x277772[_0x2598d9(0xea)])],_0x1167de=getStringWidth(getMaxWidth(_0x3a4471,0x4)),_0x29e8ad=getStringWidth(getMaxWidth(['菜单名称'])),[_0x67d263,_0x909b53]=useState(_0x2598d9(0xe8)),[_0x42f884,_0x22c2f7]=useState(new Set()),[_0x56becb,_0x436523]=useState(0x0),[_0x514f15,_0x1ab9d4]=useState(''),[_0x3be1c8,_0x3eff15]=useState(''),[_0x4dec9a,_0x1d68ed]=useState(''),[_0x22599e,_0xf6ae72]=useState(''),[_0x1f5893,_0x2cfa6b]=useState([]),_0x5ee784=_0x39c73c['map'](_0xf8db52=>({'label':_0xf8db52[_0x2598d9(0xea)],'path':_0xf8db52[_0x2598d9(0xf7)],'local':!![],'online':_0x51263b[_0x2598d9(0x10c)](_0xf8db52[_0x2598d9(0xf7)])})),_0x3e3042=_0x39c73c['filter'](_0x1387d3=>{const _0x5c4630=_0x2598d9;return!_0x51263b['includes'](_0x1387d3[_0x5c4630(0xf7)]);});useEffect(()=>{const _0x4cd346=_0x2598d9;if(!_0x44c94b&&_0x39c73c[_0x4cd346(0x11f)]>0x0&&_0x42f884[_0x4cd346(0xf6)]===0x0){const _0xa978c4=new Set(_0x39c73c[_0x4cd346(0x103)]((_0x407cf8,_0x4a074b)=>({'page':_0x407cf8,'index':_0x4a074b}))[_0x4cd346(0xe9)](({page:_0x5ddf4e})=>!_0x51263b['includes'](_0x5ddf4e[_0x4cd346(0xf7)]))[_0x4cd346(0x103)](({index:_0x3f312e})=>_0x3f312e));_0x22c2f7(_0xa978c4);}},[_0x44c94b,_0x39c73c['length'],_0x51263b[_0x2598d9(0x11f)]]),useInput(async(_0x1508ee,_0x1b05c4)=>{const _0x5f1d98=_0x2598d9;if(_0x67d263===_0x5f1d98(0xe8)){if(_0x1b05c4[_0x5f1d98(0x10d)]){_0x436523(_0x42b890=>_0x42b890>0x0?_0x42b890-0x1:_0x39c73c['length']-0x1);return;}if(_0x1b05c4[_0x5f1d98(0x127)]){_0x436523(_0x4d751a=>_0x4d751a<_0x39c73c['length']-0x1?_0x4d751a+0x1:0x0);return;}if(_0x1508ee==='\x20'){_0x22c2f7(_0x11a210=>{const _0x4b1f51=_0x5f1d98,_0x40cb09=new Set(_0x11a210);return _0x40cb09[_0x4b1f51(0xf3)](_0x56becb)?_0x40cb09['delete'](_0x56becb):_0x40cb09['add'](_0x56becb),_0x40cb09;});return;}if(_0x1508ee==='a'||_0x1508ee==='A'){const _0x23e9a0=new Set(_0x39c73c[_0x5f1d98(0x103)]((_0x14fc5e,_0x170656)=>_0x170656));_0x22c2f7(_0x23e9a0);return;}if(_0x1508ee==='i'||_0x1508ee==='I'||_0x1508ee==='r'||_0x1508ee==='R'){_0x22c2f7(_0xb9a149=>{const _0x239391=_0x5f1d98,_0x52bd16=new Set();for(let _0x3d4731=0x0;_0x3d4731<_0x39c73c['length'];_0x3d4731++){!_0xb9a149[_0x239391(0xf3)](_0x3d4731)&&_0x52bd16[_0x239391(0x112)](_0x3d4731);}return _0x52bd16;});return;}if(_0x1508ee==='q'||_0x1508ee==='Q'){_0x1085d7();return;}if(_0x1b05c4[_0x5f1d98(0x104)]){if(_0x42f884[_0x5f1d98(0xf6)]===0x0){_0xf6ae72('请至少选择一个菜单');return;}const _0x40a63f=_0x39c73c[_0x5f1d98(0xe9)]((_0x43cf26,_0x15741e)=>_0x42f884[_0x5f1d98(0xf3)](_0x15741e)),_0x3d467c=_0x40a63f[_0x5f1d98(0x103)](_0x4f9879=>_0x4f9879[_0x5f1d98(0xea)])[_0x5f1d98(0x108)](',\x20');_0x2cfa6b([{'label':'已选择菜单','value':_0x42f884['size']+'\x20个'}]),_0xf6ae72(''),_0x909b53('input-js');return;}return;}if(_0x67d263===_0x5f1d98(0xe6)){if(_0x1b05c4[_0x5f1d98(0x104)]){const _0x395243=_0x4dec9a['trim']();if(_0x395243==='')return;if(!isValidJsHttpsUrl(_0x395243)){_0xf6ae72(_0x5f1d98(0xf5));return;}if(!await isUrlReachable(_0x395243)){_0xf6ae72(_0x5f1d98(0xed));return;}_0x1ab9d4(_0x395243),_0x2cfa6b(_0x24d430=>[..._0x24d430,{'label':'JS\x20链接','value':_0x395243}]),_0x1d68ed(''),_0xf6ae72(''),_0x909b53(_0x5f1d98(0xff));return;}if(_0x1b05c4['backspace']||_0x1b05c4[_0x5f1d98(0x11e)]){_0x1d68ed(_0x36a666=>_0x36a666[_0x5f1d98(0x11d)](0x0,-0x1)),_0xf6ae72('');return;}_0x1d68ed(_0x1dfe71=>_0x1dfe71+_0x1508ee);return;}if(_0x67d263===_0x5f1d98(0xff)){if(_0x1b05c4['return']){const _0x3aa1cf=_0x4dec9a['trim']();if(_0x3aa1cf==='')return;if(!isValidCssHttpsUrl(_0x3aa1cf)){_0xf6ae72(_0x5f1d98(0x110));return;}if(!await isUrlReachable(_0x3aa1cf)){_0xf6ae72(_0x5f1d98(0x123));return;}_0x3eff15(_0x3aa1cf),_0x2cfa6b(_0x2d85ae=>[..._0x2d85ae,{'label':'CSS\x20链接','value':_0x3aa1cf}]),_0x1d68ed(''),_0xf6ae72(''),_0x909b53(_0x5f1d98(0x117));const _0x1b0ad3=_0x39c73c[_0x5f1d98(0xe9)]((_0xf9344a,_0x35140f)=>_0x42f884[_0x5f1d98(0xf3)](_0x35140f));createMenus(_0x1b0ad3,[_0x514f15,_0x3aa1cf])[_0x5f1d98(0x10a)](()=>{_0x909b53('done'),setTimeout(()=>{_0x1085d7();},0x3e8);})[_0x5f1d98(0xf2)](_0x4cc83f=>{const _0x3a8c91=_0x5f1d98;_0xf6ae72(_0x4cc83f[_0x3a8c91(0x126)]||_0x3a8c91(0x100)),_0x909b53('selecting');});return;}if(_0x1b05c4['backspace']||_0x1b05c4['delete']){_0x1d68ed(_0x12d810=>_0x12d810[_0x5f1d98(0x11d)](0x0,-0x1)),_0xf6ae72('');return;}_0x1d68ed(_0x42a618=>_0x42a618+_0x1508ee);return;}});if(_0x44c94b)return a10_0x7bffe6(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x5c19b9(Text,{'children':'\x20\x20'}),a10_0x5c19b9(a10_0x12a9c9,{'type':_0x2598d9(0x10f)}),a10_0x5c19b9(Text,{'children':'\x20正在获取线上菜单列表...'})]});if(_0x381e4f)return a10_0x7bffe6(Box,{'flexDirection':_0x2598d9(0x118),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x7bffe6(Text,{'color':_0x2598d9(0xeb),'children':['✗\x20',_0x381e4f]}),a10_0x7bffe6(Box,{'marginTop':0x1,'children':[a10_0x5c19b9(Text,{'color':_0x2598d9(0x125),'children':_0x2598d9(0xe4)}),a10_0x5c19b9(Text,{'color':'cyan','children':_0x2598d9(0x10e)}),a10_0x5c19b9(Text,{'color':'gray','children':_0x2598d9(0x114)})]})]});if(_0x39c73c[_0x2598d9(0x11f)]===0x0)return a10_0x5c19b9(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x5c19b9(Text,{'color':_0x2598d9(0x11b),'children':_0x2598d9(0x122)})});return a10_0x7bffe6(Box,{'flexDirection':_0x2598d9(0x118),'marginTop':0x1,'marginBottom':0x1,'children':[_0x67d263===_0x2598d9(0xe8)&&a10_0x7bffe6(a10_0x2823bc,{'children':[a10_0x7bffe6(Box,{'children':[a10_0x7bffe6(Text,{'bold':!![],'children':['\x20\x20',_0x2598d9(0x107),getRemainingSpaces(_0x1167de,_0x2598d9(0x107))]}),a10_0x7bffe6(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x29e8ad,_0x2598d9(0x107))]}),a10_0x7bffe6(Text,{'bold':!![],'children':['Lovrabet平台',getRemainingSpaces(_0x29e8ad,'菜单名称')]})]}),_0x5ee784[_0x2598d9(0x103)](_0x22f866=>a10_0x7bffe6(Box,{'children':[a10_0x7bffe6(Text,{'children':['\x20\x20',_0x22f866[_0x2598d9(0xea)],getRemainingSpaces(_0x1167de,_0x22f866['label'])]}),a10_0x7bffe6(Text,{'color':_0x2598d9(0xe7),'children':[_0x22f866[_0x2598d9(0x109)]?'✓':'✗',getRemainingSpaces(_0x29e8ad,'✓')]}),a10_0x7bffe6(Text,{'color':_0x22f866['online']?_0x2598d9(0xe7):_0x2598d9(0xeb),'children':[_0x22f866[_0x2598d9(0xee)]?'✓':'✗',getRemainingSpaces(_0x29e8ad,'✓')]})]},_0x22f866[_0x2598d9(0xf7)]))]}),_0x67d263===_0x2598d9(0xe8)&&_0x1f5893['length']===0x0&&a10_0x5c19b9(Box,{'marginTop':0x1,'children':a10_0x5c19b9(Text,{'color':_0x2598d9(0xfc),'children':_0x2598d9(0x116)})}),_0x1f5893[_0x2598d9(0x103)]((_0x4a3f17,_0x51d6e4)=>a10_0x7bffe6(Box,{'children':[a10_0x7bffe6(Text,{'color':_0x2598d9(0xe7),'children':['√\x20',_0x4a3f17[_0x2598d9(0xea)],':\x20']}),a10_0x5c19b9(Text,{'color':_0x2598d9(0xfc),'children':_0x4a3f17[_0x2598d9(0xfa)]})]},_0x51d6e4)),_0x22599e&&_0x67d263==='selecting'&&a10_0x5c19b9(Box,{'marginTop':0x1,'children':a10_0x7bffe6(Text,{'color':_0x2598d9(0xeb),'children':['✗\x20',_0x22599e]})}),_0x67d263===_0x2598d9(0xe8)&&a10_0x5c19b9(a10_0x2823bc,{'children':a10_0x7bffe6(Box,{'marginTop':_0x1f5893[_0x2598d9(0x11f)]>0x0||_0x22599e?0x1:0x0,'flexDirection':_0x2598d9(0x118),'children':[a10_0x5c19b9(Text,{'bold':!![],'children':_0x2598d9(0x102)}),_0x39c73c[_0x2598d9(0x103)]((_0x45249a,_0x11b903)=>{const _0x347e57=_0x2598d9,_0x2d22c9=_0x56becb===_0x11b903,_0x1544fc=_0x42f884[_0x347e57(0xf3)](_0x11b903),_0x5ddf12=_0x51263b[_0x347e57(0x10c)](_0x45249a[_0x347e57(0xf7)]),_0x41c699=_0x5ddf12?'更新':'新建';return a10_0x5c19b9(Box,{'children':a10_0x7bffe6(Text,{'backgroundColor':_0x2d22c9?_0x347e57(0xf4):undefined,'color':_0x2d22c9?_0x347e57(0xfb):undefined,'children':['\x20\x20',_0x1544fc?_0x347e57(0x124):_0x347e57(0x106),'\x20',_0x45249a[_0x347e57(0xea)]]})},_0x45249a[_0x347e57(0xf7)]);}),a10_0x5c19b9(Box,{'marginTop':0x1,'children':a10_0x7bffe6(Text,{'color':_0x2598d9(0x125),'children':['\x20',_0x2598d9(0xf0)]})})]})}),_0x67d263===_0x2598d9(0xe6)&&a10_0x7bffe6(a10_0x2823bc,{'children':[a10_0x7bffe6(Box,{'children':[a10_0x5c19b9(Text,{'children':_0x2598d9(0x113)}),a10_0x5c19b9(Text,{'color':'green','children':_0x4dec9a}),_0x22599e&&a10_0x7bffe6(Text,{'color':'red','children':[_0x2598d9(0xfe),_0x22599e]})]}),!_0x22599e&&a10_0x5c19b9(Box,{'children':a10_0x5c19b9(Text,{'color':'gray','children':_0x2598d9(0xf9)})})]}),_0x67d263===_0x2598d9(0xff)&&a10_0x7bffe6(a10_0x2823bc,{'children':[a10_0x7bffe6(Box,{'children':[a10_0x5c19b9(Text,{'children':_0x2598d9(0xfd)}),a10_0x5c19b9(Text,{'color':_0x2598d9(0xe7),'children':_0x4dec9a}),_0x22599e&&a10_0x7bffe6(Text,{'color':_0x2598d9(0xeb),'children':['\x20←\x20',_0x22599e]})]}),!_0x22599e&&a10_0x5c19b9(Box,{'children':a10_0x5c19b9(Text,{'color':_0x2598d9(0x125),'children':_0x2598d9(0x115)})})]}),_0x67d263===_0x2598d9(0x117)&&a10_0x5c19b9(Box,{'children':a10_0x5c19b9(Text,{'children':_0x2598d9(0x105)})}),_0x67d263==='done'&&a10_0x5c19b9(Box,{'children':a10_0x5c19b9(Text,{'color':_0x2598d9(0xe7),'children':'√\x20菜单创建完成'})})]});}function getStringWidth(_0x42a163){let _0x4dd365=0x0;for(const _0x498b63 of _0x42a163){/[\u4e00-\u9fa5]/['test'](_0x498b63)?_0x4dd365+=0x2:_0x4dd365+=0x1;}return _0x4dd365;}function getRemainingSpaces(_0x25e948,_0x211c0d){const _0x384665=a10_0x11d3,_0x35be0a=getStringWidth(_0x211c0d);return Array(Math[_0x384665(0xef)](0x0,_0x25e948-_0x35be0a))[_0x384665(0x120)]('\x20')[_0x384665(0x108)]('');}function a10_0x11d3(_0x1e8673,_0x1326cf){const _0x1c3db0=a10_0x1c3d();return a10_0x11d3=function(_0x11d319,_0x9bdd85){_0x11d319=_0x11d319-0xe4;let _0x417b3d=_0x1c3db0[_0x11d319];return _0x417b3d;},a10_0x11d3(_0x1e8673,_0x1326cf);}function getMaxWidth(_0x5d4083,_0x47ff50=0x2){let _0x5419fc='',_0x26c26d=0x0;for(const _0x374e57 of _0x5d4083){const _0x3407fa=getStringWidth(_0x374e57);_0x3407fa>_0x26c26d&&(_0x26c26d=_0x3407fa,_0x5419fc=_0x374e57);}return _0x5419fc+'\x20'['repeat'](_0x47ff50);}
|
|
1
|
+
(function(_0x256ad8,_0x422855){const _0x461ae1=a10_0x2f18,_0x39c0e5=_0x256ad8();while(!![]){try{const _0x494cca=parseInt(_0x461ae1(0x122))/0x1+parseInt(_0x461ae1(0x13e))/0x2*(parseInt(_0x461ae1(0x139))/0x3)+parseInt(_0x461ae1(0x147))/0x4*(parseInt(_0x461ae1(0x10c))/0x5)+parseInt(_0x461ae1(0x107))/0x6+-parseInt(_0x461ae1(0x106))/0x7+-parseInt(_0x461ae1(0x10b))/0x8+parseInt(_0x461ae1(0x111))/0x9*(parseInt(_0x461ae1(0x12d))/0xa);if(_0x494cca===_0x422855)break;else _0x39c0e5['push'](_0x39c0e5['shift']());}catch(_0x167bf3){_0x39c0e5['push'](_0x39c0e5['shift']());}}}(a10_0x4cc7,0x9f518));import{jsx as a10_0x185bf1,jsxs as a10_0x16ebf0,Fragment as a10_0x14fa26}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';function a10_0x4cc7(){const _0x372cbc=['↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','cyan','请输入有效的\x20JS\x20https\x20链接','lovrabet\x20auth','length','max','return','441124DZdqbT','delete','\x20←\x20','5269208MwPKDF','4311432Hwertj','*\x20正在创建菜单...','已选择菜单','green','3295680nrfpGR','15FtAbQT','online','message','has','*\x20CSS\x20链接:\x20','9hcYdHO','includes','done','path','creating','CSS\x20链接无法访问','test','dots','*\x20请选择要同步的菜单:','\x20正在获取线上菜单列表...','JS\x20链接无法访问','Lovrabet平台','yellow','创建菜单失败','gray','red','slice','684588doGqxf','filter','map','fill','add','input-css','trim','\x20输入项目的\x20JS\x20资源链接(https://...)','size','backspace','local','91190LjeneQ','downArrow','JS\x20链接','column','then','√\x20菜单创建完成','提示:使用\x20','菜单名称','white','value','[✓]','!\x20未找到本地页面,请先创建页面','22245JXzsSp','*\x20JS\x20链接:\x20','input-js','label','join','20cwlGGE','selecting'];a10_0x4cc7=function(){return _0x372cbc;};return a10_0x4cc7();}import{useEffect,useState}from'react';import a10_0x33f11e 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_0x2f18(_0x3135ab,_0xeda0f8){_0x3135ab=_0x3135ab-0x106;const _0x4cc7e2=a10_0x4cc7();let _0x2f18c6=_0x4cc7e2[_0x3135ab];return _0x2f18c6;}import.meta.main&&render(a10_0x185bf1(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x246484=a10_0x2f18,{exit:_0x33b01d}=useApp(),{loading:_0x238458,menuList:_0x62bbfb,error:_0x33bae4}=useGetOnlineMenuList(),_0x4049bd=getLocalPages(),_0x1b175e=_0x62bbfb[_0x246484(0x124)](_0x567bfa=>_0x567bfa[_0x246484(0x114)]),_0x53f6f6=[_0x246484(0x134),..._0x4049bd['map'](_0x2d4bc9=>_0x2d4bc9['label'])],_0x214302=getStringWidth(getMaxWidth(_0x53f6f6,0x4)),_0x4623a2=getStringWidth(getMaxWidth([_0x246484(0x134)])),[_0xa9c231,_0x571736]=useState(_0x246484(0x13f)),[_0x476427,_0xe90cfd]=useState(new Set()),[_0x18baea,_0x3bbbdb]=useState(0x0),[_0x58d1e5,_0xee5f1a]=useState(''),[_0x12f2a4,_0x4687c5]=useState(''),[_0x1d41d9,_0x44ccb9]=useState(''),[_0x3b1757,_0x1d05ce]=useState(''),[_0x4032e5,_0xecbcbe]=useState([]),_0x543e3b=_0x4049bd[_0x246484(0x124)](_0x585c08=>({'label':_0x585c08['label'],'path':_0x585c08[_0x246484(0x114)],'local':!![],'online':_0x1b175e[_0x246484(0x112)](_0x585c08[_0x246484(0x114)])})),_0x59f467=_0x4049bd['filter'](_0x360c49=>{const _0x127226=_0x246484;return!_0x1b175e[_0x127226(0x112)](_0x360c49[_0x127226(0x114)]);});useEffect(()=>{const _0x44577b=_0x246484;if(!_0x238458&&_0x4049bd[_0x44577b(0x144)]>0x0&&_0x476427['size']===0x0){const _0x4b44f5=new Set(_0x4049bd['map']((_0x4b3734,_0x54a6db)=>({'page':_0x4b3734,'index':_0x54a6db}))[_0x44577b(0x123)](({page:_0x333db2})=>!_0x1b175e[_0x44577b(0x112)](_0x333db2[_0x44577b(0x114)]))[_0x44577b(0x124)](({index:_0x55ae5a})=>_0x55ae5a));_0xe90cfd(_0x4b44f5);}},[_0x238458,_0x4049bd['length'],_0x1b175e[_0x246484(0x144)]]),useInput(async(_0x36861b,_0x1c4d1d)=>{const _0x3ae3ee=_0x246484;if(_0xa9c231==='selecting'){if(_0x1c4d1d['upArrow']){_0x3bbbdb(_0x1be7ce=>_0x1be7ce>0x0?_0x1be7ce-0x1:_0x4049bd[_0x3ae3ee(0x144)]-0x1);return;}if(_0x1c4d1d[_0x3ae3ee(0x12e)]){_0x3bbbdb(_0x41aa5a=>_0x41aa5a<_0x4049bd[_0x3ae3ee(0x144)]-0x1?_0x41aa5a+0x1:0x0);return;}if(_0x36861b==='\x20'){_0xe90cfd(_0x56ddf3=>{const _0x15a279=_0x3ae3ee,_0x11f94a=new Set(_0x56ddf3);return _0x11f94a[_0x15a279(0x10f)](_0x18baea)?_0x11f94a['delete'](_0x18baea):_0x11f94a[_0x15a279(0x126)](_0x18baea),_0x11f94a;});return;}if(_0x36861b==='a'||_0x36861b==='A'){const _0x20822e=new Set(_0x4049bd['map']((_0x5bbcee,_0x478ccb)=>_0x478ccb));_0xe90cfd(_0x20822e);return;}if(_0x36861b==='i'||_0x36861b==='I'||_0x36861b==='r'||_0x36861b==='R'){_0xe90cfd(_0x35275f=>{const _0x5f4808=_0x3ae3ee,_0x249a7b=new Set();for(let _0x5e7311=0x0;_0x5e7311<_0x4049bd['length'];_0x5e7311++){!_0x35275f[_0x5f4808(0x10f)](_0x5e7311)&&_0x249a7b[_0x5f4808(0x126)](_0x5e7311);}return _0x249a7b;});return;}if(_0x36861b==='q'||_0x36861b==='Q'){_0x33b01d();return;}if(_0x1c4d1d['return']){if(_0x476427[_0x3ae3ee(0x12a)]===0x0){_0x1d05ce('请至少选择一个菜单');return;}const _0x5c9276=_0x4049bd['filter']((_0xa555d4,_0x5a2c56)=>_0x476427[_0x3ae3ee(0x10f)](_0x5a2c56)),_0xf6b21e=_0x5c9276[_0x3ae3ee(0x124)](_0x527842=>_0x527842[_0x3ae3ee(0x13c)])['join'](',\x20');_0xecbcbe([{'label':_0x3ae3ee(0x109),'value':_0x476427[_0x3ae3ee(0x12a)]+'\x20个'}]),_0x1d05ce(''),_0x571736(_0x3ae3ee(0x13b));return;}return;}if(_0xa9c231==='input-js'){if(_0x1c4d1d[_0x3ae3ee(0x146)]){const _0x24dab8=_0x1d41d9[_0x3ae3ee(0x128)]();if(_0x24dab8==='')return;if(!isValidJsHttpsUrl(_0x24dab8)){_0x1d05ce(_0x3ae3ee(0x142));return;}if(!await isUrlReachable(_0x24dab8)){_0x1d05ce(_0x3ae3ee(0x11b));return;}_0xee5f1a(_0x24dab8),_0xecbcbe(_0x301d45=>[..._0x301d45,{'label':_0x3ae3ee(0x12f),'value':_0x24dab8}]),_0x44ccb9(''),_0x1d05ce(''),_0x571736(_0x3ae3ee(0x127));return;}if(_0x1c4d1d['backspace']||_0x1c4d1d[_0x3ae3ee(0x148)]){_0x44ccb9(_0x2bf9db=>_0x2bf9db[_0x3ae3ee(0x121)](0x0,-0x1)),_0x1d05ce('');return;}_0x44ccb9(_0x17bf19=>_0x17bf19+_0x36861b);return;}if(_0xa9c231===_0x3ae3ee(0x127)){if(_0x1c4d1d[_0x3ae3ee(0x146)]){const _0xc88b82=_0x1d41d9[_0x3ae3ee(0x128)]();if(_0xc88b82==='')return;if(!isValidCssHttpsUrl(_0xc88b82)){_0x1d05ce('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0xc88b82)){_0x1d05ce(_0x3ae3ee(0x116));return;}_0x4687c5(_0xc88b82),_0xecbcbe(_0x448844=>[..._0x448844,{'label':'CSS\x20链接','value':_0xc88b82}]),_0x44ccb9(''),_0x1d05ce(''),_0x571736(_0x3ae3ee(0x115));const _0x32ab84=_0x4049bd[_0x3ae3ee(0x123)]((_0x1328b3,_0x5c33c8)=>_0x476427['has'](_0x5c33c8));createMenus(_0x32ab84,[_0x58d1e5,_0xc88b82])[_0x3ae3ee(0x131)](()=>{_0x571736('done'),setTimeout(()=>{_0x33b01d();},0x3e8);})['catch'](_0x2d4b73=>{const _0x569bc3=_0x3ae3ee;_0x1d05ce(_0x2d4b73[_0x569bc3(0x10e)]||_0x569bc3(0x11e)),_0x571736(_0x569bc3(0x13f));});return;}if(_0x1c4d1d[_0x3ae3ee(0x12b)]||_0x1c4d1d[_0x3ae3ee(0x148)]){_0x44ccb9(_0xd4a20c=>_0xd4a20c[_0x3ae3ee(0x121)](0x0,-0x1)),_0x1d05ce('');return;}_0x44ccb9(_0x4e1eae=>_0x4e1eae+_0x36861b);return;}});if(_0x238458)return a10_0x16ebf0(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x185bf1(Text,{'children':'\x20\x20'}),a10_0x185bf1(a10_0x33f11e,{'type':_0x246484(0x118)}),a10_0x185bf1(Text,{'children':_0x246484(0x11a)})]});if(_0x33bae4)return a10_0x16ebf0(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x16ebf0(Text,{'color':'red','children':['✗\x20',_0x33bae4]}),a10_0x16ebf0(Box,{'marginTop':0x1,'children':[a10_0x185bf1(Text,{'color':'gray','children':_0x246484(0x133)}),a10_0x185bf1(Text,{'color':_0x246484(0x141),'children':_0x246484(0x143)}),a10_0x185bf1(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x4049bd[_0x246484(0x144)]===0x0)return a10_0x185bf1(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x185bf1(Text,{'color':_0x246484(0x11d),'children':_0x246484(0x138)})});return a10_0x16ebf0(Box,{'flexDirection':_0x246484(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[_0xa9c231==='selecting'&&a10_0x16ebf0(a10_0x14fa26,{'children':[a10_0x16ebf0(Box,{'children':[a10_0x16ebf0(Text,{'bold':!![],'children':['\x20\x20',_0x246484(0x134),getRemainingSpaces(_0x214302,_0x246484(0x134))]}),a10_0x16ebf0(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x4623a2,_0x246484(0x134))]}),a10_0x16ebf0(Text,{'bold':!![],'children':[_0x246484(0x11c),getRemainingSpaces(_0x4623a2,'菜单名称')]})]}),_0x543e3b[_0x246484(0x124)](_0x256daf=>a10_0x16ebf0(Box,{'children':[a10_0x16ebf0(Text,{'children':['\x20\x20',_0x256daf[_0x246484(0x13c)],getRemainingSpaces(_0x214302,_0x256daf[_0x246484(0x13c)])]}),a10_0x16ebf0(Text,{'color':_0x246484(0x10a),'children':[_0x256daf[_0x246484(0x12c)]?'✓':'✗',getRemainingSpaces(_0x4623a2,'✓')]}),a10_0x16ebf0(Text,{'color':_0x256daf[_0x246484(0x10d)]?'green':'red','children':[_0x256daf[_0x246484(0x10d)]?'✓':'✗',getRemainingSpaces(_0x4623a2,'✓')]})]},_0x256daf[_0x246484(0x114)]))]}),_0xa9c231===_0x246484(0x13f)&&_0x4032e5['length']===0x0&&a10_0x185bf1(Box,{'marginTop':0x1,'children':a10_0x185bf1(Text,{'color':_0x246484(0x141),'children':'*\x20同步菜单到\x20Lovrabet\x20平台'})}),_0x4032e5[_0x246484(0x124)]((_0x16b71e,_0x2e268c)=>a10_0x16ebf0(Box,{'children':[a10_0x16ebf0(Text,{'color':_0x246484(0x10a),'children':['√\x20',_0x16b71e[_0x246484(0x13c)],':\x20']}),a10_0x185bf1(Text,{'color':'cyan','children':_0x16b71e[_0x246484(0x136)]})]},_0x2e268c)),_0x3b1757&&_0xa9c231===_0x246484(0x13f)&&a10_0x185bf1(Box,{'marginTop':0x1,'children':a10_0x16ebf0(Text,{'color':_0x246484(0x120),'children':['✗\x20',_0x3b1757]})}),_0xa9c231===_0x246484(0x13f)&&a10_0x185bf1(a10_0x14fa26,{'children':a10_0x16ebf0(Box,{'marginTop':_0x4032e5[_0x246484(0x144)]>0x0||_0x3b1757?0x1:0x0,'flexDirection':_0x246484(0x130),'children':[a10_0x185bf1(Text,{'bold':!![],'children':_0x246484(0x119)}),_0x4049bd[_0x246484(0x124)]((_0x1b485c,_0x2bff7b)=>{const _0x49a71a=_0x246484,_0x18fa1a=_0x18baea===_0x2bff7b,_0x1ee33e=_0x476427[_0x49a71a(0x10f)](_0x2bff7b),_0x3f0704=_0x1b175e['includes'](_0x1b485c[_0x49a71a(0x114)]),_0x3a5f63=_0x3f0704?'更新':'新建';return a10_0x185bf1(Box,{'children':a10_0x16ebf0(Text,{'backgroundColor':_0x18fa1a?'blue':undefined,'color':_0x18fa1a?_0x49a71a(0x135):undefined,'children':['\x20\x20',_0x1ee33e?_0x49a71a(0x137):'[\x20]','\x20',_0x1b485c[_0x49a71a(0x13c)]]})},_0x1b485c['path']);}),a10_0x185bf1(Box,{'marginTop':0x1,'children':a10_0x16ebf0(Text,{'color':'gray','children':['\x20',_0x246484(0x140)]})})]})}),_0xa9c231==='input-js'&&a10_0x16ebf0(a10_0x14fa26,{'children':[a10_0x16ebf0(Box,{'children':[a10_0x185bf1(Text,{'children':_0x246484(0x13a)}),a10_0x185bf1(Text,{'color':_0x246484(0x10a),'children':_0x1d41d9}),_0x3b1757&&a10_0x16ebf0(Text,{'color':_0x246484(0x120),'children':['\x20←\x20',_0x3b1757]})]}),!_0x3b1757&&a10_0x185bf1(Box,{'children':a10_0x185bf1(Text,{'color':'gray','children':_0x246484(0x129)})})]}),_0xa9c231===_0x246484(0x127)&&a10_0x16ebf0(a10_0x14fa26,{'children':[a10_0x16ebf0(Box,{'children':[a10_0x185bf1(Text,{'children':_0x246484(0x110)}),a10_0x185bf1(Text,{'color':'green','children':_0x1d41d9}),_0x3b1757&&a10_0x16ebf0(Text,{'color':'red','children':[_0x246484(0x149),_0x3b1757]})]}),!_0x3b1757&&a10_0x185bf1(Box,{'children':a10_0x185bf1(Text,{'color':_0x246484(0x11f),'children':'\x20输入项目的\x20CSS\x20资源链接(https://...)'})})]}),_0xa9c231===_0x246484(0x115)&&a10_0x185bf1(Box,{'children':a10_0x185bf1(Text,{'children':_0x246484(0x108)})}),_0xa9c231===_0x246484(0x113)&&a10_0x185bf1(Box,{'children':a10_0x185bf1(Text,{'color':_0x246484(0x10a),'children':_0x246484(0x132)})})]});}function getStringWidth(_0x48f28b){const _0x4a9e7b=a10_0x2f18;let _0x459e11=0x0;for(const _0x299bdb of _0x48f28b){/[\u4e00-\u9fa5]/[_0x4a9e7b(0x117)](_0x299bdb)?_0x459e11+=0x2:_0x459e11+=0x1;}return _0x459e11;}function getRemainingSpaces(_0x8280cc,_0x3ac2bc){const _0x15c772=a10_0x2f18,_0x332e00=getStringWidth(_0x3ac2bc);return Array(Math[_0x15c772(0x145)](0x0,_0x8280cc-_0x332e00))[_0x15c772(0x125)]('\x20')[_0x15c772(0x13d)]('');}function getMaxWidth(_0x56eacb,_0x28fc38=0x2){let _0x34f5f8='',_0x15c079=0x0;for(const _0x3b2fff of _0x56eacb){const _0xe25bea=getStringWidth(_0x3b2fff);_0xe25bea>_0x15c079&&(_0x15c079=_0xe25bea,_0x34f5f8=_0x3b2fff);}return _0x34f5f8+'\x20'['repeat'](_0x28fc38);}
|