@lovrabet/cli 1.1.26-beta.8 → 1.1.26-beta.9
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(_0x3e3aab,_0x2a146e){const _0x23aa3b=a0_0x2553,_0x37a029=_0x3e3aab();while(!![]){try{const _0x301cb3=parseInt(_0x23aa3b(0x8a))/0x1+parseInt(_0x23aa3b(0x8c))/0x2*(-parseInt(_0x23aa3b(0x7d))/0x3)+parseInt(_0x23aa3b(0x83))/0x4*(parseInt(_0x23aa3b(0x7b))/0x5)+parseInt(_0x23aa3b(0x93))/0x6+parseInt(_0x23aa3b(0x7f))/0x7*(parseInt(_0x23aa3b(0x7c))/0x8)+parseInt(_0x23aa3b(0x85))/0x9*(-parseInt(_0x23aa3b(0x97))/0xa)+parseInt(_0x23aa3b(0x8b))/0xb;if(_0x301cb3===_0x2a146e)break;else _0x37a029['push'](_0x37a029['shift']());}catch(_0x33e773){_0x37a029['push'](_0x37a029['shift']());}}}(a0_0x3b36,0x5fc29));import{jsx as a0_0x41d30a,jsxs as a0_0x55f0f9}from'react/jsx-runtime';import{useState}from'react';function a0_0x2553(_0x596ff7,_0x4202d5){const _0x3b36ff=a0_0x3b36();return a0_0x2553=function(_0x2553c7,_0xed08bb){_0x2553c7=_0x2553c7-0x79;let _0x82111f=_0x3b36ff[_0x2553c7];return _0x82111f;},a0_0x2553(_0x596ff7,_0x4202d5);}import{Text,Box,useInput}from'ink';function a0_0x3b36(){const _0x345e96=['页面路由地址:\x20','\x20直接回车确认,或输入自定义路由地址','\x20已存在,请使用其他路径','return','327754XIJnXM','2380873TIZBMd','93846WXVzYP','gray','my-page','页面路径\x20','页面路径不合法','backspace','\x20Step2:\x20','3286926afVfqi','路径不能以\x20/\x20开头或结尾','trim','red','430qZhnZU','length','split','15deeESq','24cZnCal','39LitCaw','includes','1061319BuJzLy','endsWith','delete','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','183640acUKTr','\x20←\x20','142821LkpFfe'];a0_0x3b36=function(){return _0x345e96;};return a0_0x3b36();}import a0_0x3e3ffb from'node:fs';export function InputProjectCode(_0x5ee9cf){const _0x3e1d86=a0_0x2553,{onSubmit:_0x33353a,pagePath:_0x4d57a4}=_0x5ee9cf,[_0x11ab2c,_0x127213]=useState(''),[_0x50270d,_0x406b4a]=useState(''),_0x2f363e=_0x3e1d86(0x8e);function _0x2eff3b(_0x24f531){const _0xe5a1c1=_0x3e1d86;if(_0x24f531[_0xe5a1c1(0x79)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x24f531['startsWith']('/')||_0x24f531[_0xe5a1c1(0x80)]('/'))return{'valid':![],'message':_0xe5a1c1(0x94)};if(_0x24f531[_0xe5a1c1(0x7e)]('//'))return{'valid':![],'message':'路径不能包含连续的\x20/'};const _0x116284=_0x24f531[_0xe5a1c1(0x7a)]('/');for(const _0x63937e of _0x116284){if(!_0x63937e)continue;const _0x51e7b1=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x51e7b1['test'](_0x63937e))return{'valid':![],'message':_0xe5a1c1(0x82)};}return{'valid':!![]};}return useInput((_0x689385,_0x33e434)=>{const _0x588bc4=_0x3e1d86;if(_0x33e434[_0x588bc4(0x89)]){const _0x1722c9=_0x11ab2c[_0x588bc4(0x95)]()||_0x2f363e;if(_0x50270d)return;const _0x16be64=_0x4d57a4+'/'+_0x1722c9;if(a0_0x3e3ffb['existsSync'](_0x16be64)){_0x406b4a(_0x588bc4(0x8f)+_0x1722c9+_0x588bc4(0x88));return;}_0x33353a(_0x1722c9),_0x127213(''),_0x406b4a('');}else _0x33e434[_0x588bc4(0x91)]||_0x33e434[_0x588bc4(0x81)]?_0x127213(_0x4f0e3f=>{const _0xcdc074=_0x4f0e3f['slice'](0x0,-0x1),{valid:_0x4c34c1,message:_0x131cc0}=_0x2eff3b(_0xcdc074);return _0x406b4a(_0x4c34c1?'':_0x131cc0||'页面路径不合法'),_0xcdc074;}):_0x127213(_0x32b74e=>{const _0x5927d6=_0x588bc4,_0x22b2f1=_0x32b74e+_0x689385,{valid:_0x1e1689,message:_0xa2276b}=_0x2eff3b(_0x22b2f1);return _0x406b4a(_0x1e1689?'':_0xa2276b||_0x5927d6(0x90)),_0x22b2f1;});}),a0_0x55f0f9(Box,{'flexDirection':'column','children':[a0_0x55f0f9(Box,{'children':[a0_0x41d30a(Text,{'color':_0x3e1d86(0x8d),'children':_0x3e1d86(0x92)}),a0_0x41d30a(Text,{'children':_0x3e1d86(0x86)}),_0x11ab2c?a0_0x41d30a(Text,{'color':'green','children':_0x11ab2c}):a0_0x41d30a(Text,{'color':_0x3e1d86(0x8d),'children':_0x2f363e}),_0x50270d&&a0_0x55f0f9(Text,{'color':_0x3e1d86(0x96),'children':[_0x3e1d86(0x84),_0x50270d]})]}),!_0x50270d&&!_0x11ab2c&&a0_0x41d30a(Box,{'children':a0_0x41d30a(Text,{'color':_0x3e1d86(0x8d),'children':_0x3e1d86(0x87)})})]});}
|
package/lib/add-page/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a1_0x5ecf4e=a1_0x4612;(function(_0x17aa99,_0x8f1e45){const _0x289fb5=a1_0x4612,_0x516a9e=_0x17aa99();while(!![]){try{const _0x3f56aa=parseInt(_0x289fb5(0xe1))/0x1*(parseInt(_0x289fb5(0xf1))/0x2)+parseInt(_0x289fb5(0xf2))/0x3*(parseInt(_0x289fb5(0xe3))/0x4)+parseInt(_0x289fb5(0xf6))/0x5*(parseInt(_0x289fb5(0xfa))/0x6)+-parseInt(_0x289fb5(0xd9))/0x7+-parseInt(_0x289fb5(0xe4))/0x8*(-parseInt(_0x289fb5(0xef))/0x9)+parseInt(_0x289fb5(0xf9))/0xa+parseInt(_0x289fb5(0xf0))/0xb*(-parseInt(_0x289fb5(0xe2))/0xc);if(_0x3f56aa===_0x8f1e45)break;else _0x516a9e['push'](_0x516a9e['shift']());}catch(_0xda82c6){_0x516a9e['push'](_0x516a9e['shift']());}}}(a1_0x5eb9,0xaef93));function a1_0x4612(_0x4e2bb2,_0x47c79b){const _0x5eb93c=a1_0x5eb9();return a1_0x4612=function(_0x46124d,_0x58ea41){_0x46124d=_0x46124d-0xd5;let _0x52aa95=_0x5eb93c[_0x46124d];return _0x52aa95;},a1_0x4612(_0x4e2bb2,_0x47c79b);}import{jsx as a1_0x4b3cfa,jsxs as a1_0x334e2d,Fragment as a1_0x364684}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0xc14f43 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x5eb9(){const _0x3f1cf4=['dirname','\x20*\x20页面路径:\x20','add-page','页面添加失败:\x20','2434167vEfVjq','677897GaGQwQ','428aoqVlq','183369kKwiRA','green','processTemplate','cwd','28965gUHOCI','column','正在创建页面,请稍候…','5855770xCMAsi','258EbexMw','url','pages','finally','info','9606975GGTNga','页面添加成功:\x20','now','gray','\x20Step1:\x20','setLogPath','success','开始添加页面:\x20','2770XImKTl','36hjcJdd','20EiPbus','16VskVul','error','resolve','cyan','已选择页面模板\x20','../../templates/pages','join'];a1_0x5eb9=function(){return _0x3f1cf4;};return a1_0x5eb9();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0xc14f43[a1_0x5ecf4e(0xeb)](fileURLToPath(import.meta[a1_0x5ecf4e(0xd5)])),pageTemplateDir=a1_0xc14f43[a1_0x5ecf4e(0xe6)](__dirname,a1_0x5ecf4e(0xe9)),projectDir=process[a1_0x5ecf4e(0xf5)]();export const AddPage=()=>{const _0x353a62=a1_0x5ecf4e,{exit:_0x4b3227}=useApp(),[_0x499dea,_0x2a9166]=useState(''),[_0x170aa3,_0x243fcb]=useState(''),[_0x916d09,_0x339346]=useState(![]),[_0x3ca85e,_0x253ee5]=useState(![]),_0x31a36a=a1_0xc14f43[_0x353a62(0xea)](projectDir,'src',_0x353a62(0xd6)),_0x45768d=a1_0xc14f43[_0x353a62(0xea)](_0x31a36a,_0x170aa3),_0x55d4b2=a1_0xc14f43[_0x353a62(0xea)]('src',_0x353a62(0xd6),_0x170aa3);useEffect(()=>{const _0x5997c0=_0x353a62,_0x3ba9af=a1_0xc14f43['resolve'](pageTemplateDir,_0x499dea);if(_0x499dea&&_0x170aa3){_0x339346(!![]),logger[_0x5997c0(0xde)](process[_0x5997c0(0xf5)]());const _0x5afa07=Date['now']();logger[_0x5997c0(0xd8)]('add-page',_0x5997c0(0xe0)+_0x170aa3,{'template':_0x499dea,'targetPath':_0x55d4b2}),TemplateReplacer[_0x5997c0(0xf4)](_0x3ba9af,a1_0xc14f43[_0x5997c0(0xea)](_0x31a36a,_0x170aa3),_0x170aa3,_0x499dea)['then'](()=>{const _0x2d213a=_0x5997c0,_0x3f262a=Date[_0x2d213a(0xdb)]()-_0x5afa07;logger[_0x2d213a(0xdf)](_0x2d213a(0xed),_0x2d213a(0xda)+_0x170aa3,_0x3f262a,{'template':_0x499dea,'targetPath':_0x55d4b2,'routePath':_0x170aa3}),_0x253ee5(!![]);})['catch'](_0x5c1505=>{const _0x22894f=_0x5997c0,_0x365b16=Date[_0x22894f(0xdb)]()-_0x5afa07;logger[_0x22894f(0xe5)](_0x22894f(0xed),_0x22894f(0xee)+_0x170aa3,{'template':_0x499dea,'targetPath':_0x55d4b2,'error':_0x5c1505 instanceof Error?_0x5c1505['message']:String(_0x5c1505),'duration':_0x365b16});})[_0x5997c0(0xd7)](()=>{_0x339346(![]);});}},[_0x499dea,_0x170aa3]),useEffect(()=>{_0x3ca85e&&setTimeout(()=>{_0x4b3227();});},[_0x3ca85e]);if(_0x499dea)return a1_0x334e2d(Box,{'flexDirection':_0x353a62(0xf7),'paddingY':0x1,'children':[a1_0x334e2d(Box,{'children':[a1_0x4b3cfa(Text,{'color':'gray','children':_0x353a62(0xdd)}),a1_0x4b3cfa(Text,{'children':_0x353a62(0xe8)}),a1_0x4b3cfa(Text,{'color':_0x353a62(0xf3),'children':_0x499dea})]}),_0x170aa3?a1_0x334e2d(Box,{'children':[a1_0x4b3cfa(Text,{'color':_0x353a62(0xdc),'children':'\x20Step2:\x20'}),a1_0x4b3cfa(Text,{'children':'已输入的页面路由\x20'}),a1_0x4b3cfa(Text,{'color':'green','children':_0x170aa3})]}):a1_0x4b3cfa(InputProjectCode,{'pagePath':_0x45768d,'onSubmit':_0x243fcb}),_0x170aa3&&_0x916d09?a1_0x334e2d(Box,{'marginTop':0x1,'children':[a1_0x4b3cfa(Box,{'width':'4'}),a1_0x4b3cfa(Text,{'children':_0x353a62(0xf8)})]}):null,_0x3ca85e?a1_0x334e2d(a1_0x364684,{'children':[a1_0x4b3cfa(Box,{'marginTop':0x1,'children':a1_0x4b3cfa(Text,{'color':_0x353a62(0xdc),'children':'\x20*\x20页面创建成功!'})}),a1_0x334e2d(Box,{'children':[a1_0x4b3cfa(Text,{'color':_0x353a62(0xdc),'children':_0x353a62(0xec)}),a1_0x4b3cfa(Text,{'color':'green','children':_0x55d4b2})]}),a1_0x334e2d(Box,{'children':[a1_0x4b3cfa(Text,{'color':_0x353a62(0xdc),'children':'\x20*\x20路由地址:\x20'}),a1_0x334e2d(Text,{'color':_0x353a62(0xf3),'children':['/',_0x170aa3]})]}),a1_0x4b3cfa(Box,{'marginTop':0x1,'children':a1_0x4b3cfa(Text,{'color':_0x353a62(0xe7),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x4b3cfa(SelectPageTemplate,{'onSelect':_0x2a9166});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ca13f,_0x4ca31e){const _0x5d0eb1=a2_0x4c5d,_0xd9c262=_0x2ca13f();while(!![]){try{const _0x45fce9=-parseInt(_0x5d0eb1(0x14a))/0x1*(-parseInt(_0x5d0eb1(0x142))/0x2)+parseInt(_0x5d0eb1(0x150))/0x3+parseInt(_0x5d0eb1(0x138))/0x4*(-parseInt(_0x5d0eb1(0x148))/0x5)+-parseInt(_0x5d0eb1(0x13e))/0x6*(parseInt(_0x5d0eb1(0x140))/0x7)+-parseInt(_0x5d0eb1(0x13d))/0x8+parseInt(_0x5d0eb1(0x14f))/0x9+-parseInt(_0x5d0eb1(0x147))/0xa*(parseInt(_0x5d0eb1(0x134))/0xb);if(_0x45fce9===_0x4ca31e)break;else _0xd9c262['push'](_0xd9c262['shift']());}catch(_0x3615eb){_0xd9c262['push'](_0xd9c262['shift']());}}}(a2_0x1ea6,0x364d3));import{jsx as a2_0x162703,jsxs as a2_0x55c9ea}from'react/jsx-runtime';import{useState,useEffect}from'react';function a2_0x4c5d(_0xe4cde3,_0x150f66){const _0x1ea665=a2_0x1ea6();return a2_0x4c5d=function(_0x4c5d77,_0x1783c7){_0x4c5d77=_0x4c5d77-0x131;let _0x22a573=_0x1ea665[_0x4c5d77];return _0x22a573;},a2_0x4c5d(_0xe4cde3,_0x150f66);}import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0xeff476 from'node:path';import{fileURLToPath}from'node:url';function a2_0x1ea6(){const _0x44edfe=['409810LrYHXm','5OUajya','templates/pages','150pFUZCq','\x20Step1:\x20','error','sdk-fetch','resolve','1435104WcemnP','1175868ftlJTV','map','localeCompare','url','44DPkjgU','onSelect','name','column','754604vClhYP','join','return','正在加载页面模板...','请选择您要创建的页面模板','1497328EoumeB','14196Kzhnze','label','679mctpRj','upArrow','5870OoKYHC','gray','\x20\x20\x20\x20\x20\x20\x20\x20','length','blank'];a2_0x1ea6=function(){return _0x44edfe;};return a2_0x1ea6();}async function getTemplateList(){const _0x3147d6=a2_0x4c5d;try{const _0x27d712=fileURLToPath(import.meta[_0x3147d6(0x133)]),_0x2a7cf3=a2_0xeff476[_0x3147d6(0x14e)](a2_0xeff476['dirname'](_0x27d712),'../..'),_0x15308e=a2_0xeff476[_0x3147d6(0x139)](_0x2a7cf3,_0x3147d6(0x149)),_0x3209dc=await readdir(_0x15308e,{'withFileTypes':!![]}),_0x2db3d5=_0x3209dc['filter'](_0x1ac902=>_0x1ac902['isDirectory']())[_0x3147d6(0x131)](_0x1d5912=>({'label':_0x1d5912[_0x3147d6(0x136)]}))['sort']((_0x520e8c,_0x46ad0c)=>_0x520e8c[_0x3147d6(0x13f)][_0x3147d6(0x132)](_0x46ad0c[_0x3147d6(0x13f)]));return _0x2db3d5;}catch(_0x1ca519){return console[_0x3147d6(0x14c)]('获取模板列表失败:',_0x1ca519),[{'label':_0x3147d6(0x146)},{'label':_0x3147d6(0x14d)}];}}export function SelectPageTemplate(_0x1158b0){const _0x21d1c8=a2_0x4c5d,[_0x3adc7e,_0x35b1c4]=useState(0x0),[_0x3d8032,_0x3e2e44]=useState([]),[_0x5284f4,_0x12a137]=useState(!![]);useEffect(()=>{async function _0xdd6379(){const _0xf44e7d=await getTemplateList();_0x3e2e44(_0xf44e7d),_0x12a137(![]);}_0xdd6379();},[]),useInput((_0x1aa576,_0x180283)=>{const _0x115306=a2_0x4c5d;if(_0x5284f4)return;if(_0x180283[_0x115306(0x13a)]){const _0x52f63f=_0x3d8032[_0x3adc7e];_0x52f63f&&_0x1158b0[_0x115306(0x135)](_0x52f63f[_0x115306(0x13f)]);}_0x180283[_0x115306(0x141)]&&_0x35b1c4(_0xf8604d=>_0xf8604d===0x0?_0x3d8032[_0x115306(0x145)]-0x1:_0xf8604d-0x1),_0x180283['downArrow']&&_0x35b1c4(_0xb95c2c=>_0xb95c2c===_0x3d8032['length']-0x1?0x0:_0xb95c2c+0x1);});if(_0x5284f4)return a2_0x162703(Box,{'flexDirection':_0x21d1c8(0x137),'paddingY':0x1,'children':a2_0x55c9ea(Box,{'children':[a2_0x162703(Text,{'color':_0x21d1c8(0x143),'children':_0x21d1c8(0x14b)}),a2_0x162703(Text,{'children':_0x21d1c8(0x13b)})]})});return a2_0x55c9ea(Box,{'flexDirection':_0x21d1c8(0x137),'paddingY':0x1,'children':[a2_0x55c9ea(Box,{'children':[a2_0x162703(Text,{'color':'gray','children':_0x21d1c8(0x14b)}),a2_0x162703(Text,{'children':_0x21d1c8(0x13c)})]}),_0x3d8032[_0x21d1c8(0x131)]((_0x37816d,_0x3d11d2)=>{const _0x5947db=_0x21d1c8,_0x58a93f=_0x3d11d2===_0x3adc7e,_0x5a8865=_0x58a93f?'\x20\x20\x20\x20\x20\x20>\x20'+_0x37816d['label']:_0x5947db(0x144)+_0x37816d[_0x5947db(0x13f)];return a2_0x162703(Box,{'children':a2_0x162703(Text,{'color':_0x58a93f?'green':undefined,'children':_0x5a8865})},_0x5a8865);})]});}
|
package/lib/api/api-doc-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x152f20,_0x4a5cb2){const _0x1e52e1=a3_0xff3f,_0x5e47ae=_0x152f20();while(!![]){try{const _0x5df13a=-parseInt(_0x1e52e1(0x1c4))/0x1+-parseInt(_0x1e52e1(0x1d8))/0x2*(-parseInt(_0x1e52e1(0x1c2))/0x3)+-parseInt(_0x1e52e1(0x1c7))/0x4+parseInt(_0x1e52e1(0x1ac))/0x5+-parseInt(_0x1e52e1(0x1d6))/0x6*(-parseInt(_0x1e52e1(0x1b6))/0x7)+-parseInt(_0x1e52e1(0x1cf))/0x8+parseInt(_0x1e52e1(0x1ae))/0x9;if(_0x5df13a===_0x4a5cb2)break;else _0x5e47ae['push'](_0x5e47ae['shift']());}catch(_0x3383d4){_0x5e47ae['push'](_0x5e47ae['shift']());}}}(a3_0x2390,0xc1238));import{jsx as a3_0xc096ce,jsxs as a3_0x1d1190,Fragment as a3_0x5303c4}from'react/jsx-runtime';import{useEffect,useState}from'react';function a3_0xff3f(_0x41e901,_0x38dc33){const _0x23905d=a3_0x2390();return a3_0xff3f=function(_0xff3f1e,_0x15aec8){_0xff3f1e=_0xff3f1e-0x1a8;let _0x308d26=_0x23905d[_0xff3f1e];return _0x308d26;},a3_0xff3f(_0x41e901,_0x38dc33);}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a3_0x2390(){const _0x4c7d77=['\x20重新登录后再试','error','21gRhjEG','datasetCode','cyan','\x20个匹配的数据集\x1b[0m',',\x20失败\x20','.md\x20(','env','lovrabet\x20auth','\x1b[0m','red','white','yellow','6umBiPc','*\x20共处理\x20','1489376wMPooS','\x1b[90m*\x20从\x20','column','6258656LjfAmB','√\x20文档生成完成!成功\x20','log','online','正在获取数据集列表...','文档生成失败:\x20','filePath','api-doc','1587232SuxBrr','⚠️\x20以下数据集生成失败:','success','\x20个数据集','datasetName','setLogPath','cwd','2333748NRfeEe','未提供应用AppCode,且配置中也没有默认值','909836DYWFFy','includes','正在生成\x20','filter','文档生成完成','./docs','map','gray','未找到任何数据集','*\x20输出目录:\x20','length','*\x20生成的文档文件:','540105HWFUch','\x1b[33m!\x20以下数据集代码不存在:\x20','16729281nonQLv','\x20(环境:\x20','dim','\x20个数据集中筛选出\x20','使用配置的应用AppCode:\x20','\x20个数据集的文档...'];a3_0x2390=function(){return _0x4c7d77;};return a3_0x2390();}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';export const ApiDocUI=({appCode:_0x2b6506,env:_0x5b684b,output:_0x2c6359,extraParams:_0xbccc9c,datasetCodes:_0xba8e58})=>{const _0x41c61f=a3_0xff3f,{exit:_0x18e2f5}=useApp(),[_0x522949,_0xc31078]=useState(![]),[_0x34ebfb,_0xd018fb]=useState(''),[_0xf69433,_0x466d62]=useState(![]),[_0x23cc7e,_0x4f44e4]=useState(null),[_0x249d79,_0xc5f349]=useState(null),[_0x4ed8cc,_0x1215b5]=useState(0x0),_0x5e5980=readConfig(),_0x315a5d=getConfigAppCode(),_0x2ad36d=_0x2b6506||_0x315a5d,_0x5998a7=typeof _0x5e5980?.['env']==='string'?_0x5e5980[_0x41c61f(0x1bc)]:undefined,_0x44ebdc=_0x5b684b||_0x5998a7||_0x41c61f(0x1ca);initEnv(_0x44ebdc);const _0x44882b=_0x2c6359||_0x41c61f(0x1dd),_0x460c57=_0x2b6506?'使用指定的应用AppCode:\x20'+_0x2ad36d:_0x41c61f(0x1b2)+_0x2ad36d;useEffect(()=>{_0xc31078(!![]),_0x769e5();},[]),useEffect(()=>{(_0xf69433||_0x23cc7e)&&_0x18e2f5();},[_0xf69433,_0x23cc7e,_0x18e2f5]);async function _0x769e5(){const _0x511cd7=_0x41c61f;if(!_0x2ad36d){_0x4f44e4(_0x511cd7(0x1d7));return;}try{logger[_0x511cd7(0x1d4)](process[_0x511cd7(0x1d5)]()),_0xd018fb(_0x511cd7(0x1cb));const {configArray:_0x10dad6}=await fetchModelList(_0x2ad36d);_0x1215b5(_0x10dad6['length']);if(_0x10dad6[_0x511cd7(0x1aa)]===0x0){_0x4f44e4(_0x511cd7(0x1a8));return;}let _0xf5f43a=_0x10dad6;if(_0xba8e58&&_0xba8e58[_0x511cd7(0x1aa)]>0x0){_0xf5f43a=_0x10dad6['filter'](_0x4b55b1=>_0xba8e58[_0x511cd7(0x1d9)](_0x4b55b1['datasetCode']));const _0x4977ae=_0xf5f43a['map'](_0x19cbf4=>_0x19cbf4[_0x511cd7(0x1b7)]),_0x2fb8c8=_0xba8e58[_0x511cd7(0x1db)](_0x5cb5da=>!_0x4977ae[_0x511cd7(0x1d9)](_0x5cb5da));_0x2fb8c8[_0x511cd7(0x1aa)]>0x0&&console[_0x511cd7(0x1c9)](_0x511cd7(0x1ad)+_0x2fb8c8['join'](',\x20')+_0x511cd7(0x1be));if(_0xf5f43a[_0x511cd7(0x1aa)]===0x0){_0x4f44e4('指定的数据集代码都不存在:\x20'+_0xba8e58['join'](',\x20'));return;}console['log'](_0x511cd7(0x1c5)+_0x10dad6[_0x511cd7(0x1aa)]+_0x511cd7(0x1b1)+_0xf5f43a[_0x511cd7(0x1aa)]+_0x511cd7(0x1b9));}_0xd018fb(_0x511cd7(0x1da)+_0xf5f43a[_0x511cd7(0x1aa)]+_0x511cd7(0x1b3));const _0x1bc196=await generateDatasetDocs(_0xf5f43a,_0x2ad36d,_0x44882b,(_0xccdc44,_0x379fd7,_0x159b02)=>{const _0x15782f=_0x511cd7;_0xd018fb('正在生成\x20'+_0x159b02+_0x15782f(0x1bb)+_0xccdc44+'/'+_0x379fd7+')');},_0xbccc9c);_0xc5f349(_0x1bc196),_0x466d62(!![]);const _0x2a7504=_0x1bc196[_0x511cd7(0x1db)](_0x51a681=>_0x51a681[_0x511cd7(0x1d1)])[_0x511cd7(0x1aa)],_0x1b9487=_0x1bc196['filter'](_0x3fe960=>!_0x3fe960['success'])[_0x511cd7(0x1aa)];logger['success'](_0x511cd7(0x1ce),_0x511cd7(0x1dc),undefined,{'totalCount':_0x1bc196['length'],'successCount':_0x2a7504,'failCount':_0x1b9487,'outputDir':_0x44882b});}catch(_0x1eecc5){const _0x116b09=_0x1eecc5 instanceof Error?_0x1eecc5['message']:String(_0x1eecc5);logger[_0x511cd7(0x1b5)](_0x511cd7(0x1ce),_0x511cd7(0x1cc)+_0x116b09,{'appCode':_0x2ad36d,'outputDir':_0x44882b}),_0x4f44e4(_0x511cd7(0x1cc)+_0x116b09);}finally{_0xc31078(![]);}}const _0x29e5e1=_0x249d79?.[_0x41c61f(0x1db)](_0x96792f=>_0x96792f[_0x41c61f(0x1d1)])[_0x41c61f(0x1aa)]||0x0,_0x125464=_0x249d79?.['filter'](_0x504b31=>!_0x504b31['success'])[_0x41c61f(0x1aa)]||0x0;return a3_0x1d1190(Box,{'flexDirection':_0x41c61f(0x1c6),'children':[(_0x522949||_0xf69433)&&a3_0x1d1190(Box,{'children':[a3_0xc096ce(Text,{'color':_0x41c61f(0x1df),'children':'*\x20'}),a3_0xc096ce(Text,{'color':_0x2b6506?_0x41c61f(0x1c0):_0x41c61f(0x1b0),'children':_0x460c57})]}),_0x522949&&a3_0xc096ce(Box,{'children':a3_0x1d1190(Text,{'children':['🚀\x20',_0x34ebfb,_0x41c61f(0x1af),_0x44ebdc,')']})}),_0xf69433&&_0x249d79&&a3_0x1d1190(Box,{'flexDirection':_0x41c61f(0x1c6),'children':[a3_0xc096ce(Box,{'children':a3_0x1d1190(Text,{'color':'green','children':[_0x41c61f(0x1c8),_0x29e5e1,'\x20个',_0x125464>0x0&&_0x41c61f(0x1ba)+_0x125464+'\x20个']})}),a3_0xc096ce(Box,{'marginTop':0x1,'children':a3_0x1d1190(Text,{'color':'gray','children':[_0x41c61f(0x1c3),_0x4ed8cc,_0x41c61f(0x1d2)]})}),a3_0x1d1190(Box,{'marginTop':0x1,'children':[a3_0xc096ce(Text,{'color':'gray','children':_0x41c61f(0x1a9)}),a3_0xc096ce(Text,{'color':_0x41c61f(0x1b8),'children':_0x44882b})]}),_0x29e5e1>0x0&&a3_0x1d1190(a3_0x5303c4,{'children':[a3_0xc096ce(Box,{'marginTop':0x1,'children':a3_0xc096ce(Text,{'color':_0x41c61f(0x1df),'children':_0x41c61f(0x1ab)})}),_0x249d79[_0x41c61f(0x1db)](_0x594424=>_0x594424[_0x41c61f(0x1d1)])[_0x41c61f(0x1de)]((_0x31edf6,_0xd2d02d)=>a3_0x1d1190(Box,{'marginLeft':0x2,'children':[a3_0x1d1190(Text,{'color':_0x41c61f(0x1b8),'children':['•\x20',_0x31edf6[_0x41c61f(0x1cd)]]}),a3_0x1d1190(Text,{'color':_0x41c61f(0x1b0),'children':['\x20-\x20',_0x31edf6['datasetName']]})]},_0xd2d02d))]}),_0x125464>0x0&&a3_0x1d1190(a3_0x5303c4,{'children':[a3_0xc096ce(Box,{'marginTop':0x1,'children':a3_0xc096ce(Text,{'color':_0x41c61f(0x1c1),'children':_0x41c61f(0x1d0)})}),_0x249d79[_0x41c61f(0x1db)](_0x138dd2=>!_0x138dd2[_0x41c61f(0x1d1)])[_0x41c61f(0x1de)]((_0x46e57d,_0xa8cd77)=>a3_0x1d1190(Box,{'marginLeft':0x2,'flexDirection':_0x41c61f(0x1c6),'children':[a3_0x1d1190(Text,{'color':'red','children':['•\x20',_0x46e57d[_0x41c61f(0x1d3)],'\x20(',_0x46e57d['datasetCode'],')']}),_0x46e57d[_0x41c61f(0x1b5)]&&a3_0xc096ce(Box,{'marginLeft':0x2,'children':a3_0xc096ce(Text,{'color':_0x41c61f(0x1b0),'children':_0x46e57d[_0x41c61f(0x1b5)]})})]},_0xa8cd77))]})]}),_0x23cc7e&&a3_0x1d1190(Box,{'flexDirection':_0x41c61f(0x1c6),'children':[a3_0xc096ce(Box,{'children':a3_0x1d1190(Text,{'color':_0x41c61f(0x1bf),'children':['❌\x20',_0x23cc7e]})}),_0x23cc7e[_0x41c61f(0x1d9)]('登录')&&a3_0x1d1190(Box,{'marginTop':0x1,'children':[a3_0xc096ce(Text,{'color':_0x41c61f(0x1c1),'children':'💡\x20请使用\x20'}),a3_0xc096ce(Text,{'color':_0x41c61f(0x1b8),'children':_0x41c61f(0x1bd)}),a3_0xc096ce(Text,{'color':_0x41c61f(0x1c1),'children':_0x41c61f(0x1b4)})]})]})]});};
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a4_0x5055f3=a4_0x7745;(function(_0x3aa956,_0xd3936e){const _0x132c60=a4_0x7745,_0x51fe73=_0x3aa956();while(!![]){try{const _0x529714=parseInt(_0x132c60(0x1d1))/0x1+parseInt(_0x132c60(0x1b4))/0x2*(parseInt(_0x132c60(0x1cc))/0x3)+parseInt(_0x132c60(0x1bf))/0x4+parseInt(_0x132c60(0x1d5))/0x5*(parseInt(_0x132c60(0x1cf))/0x6)+parseInt(_0x132c60(0x1d2))/0x7*(-parseInt(_0x132c60(0x1c2))/0x8)+-parseInt(_0x132c60(0x1d6))/0x9+-parseInt(_0x132c60(0x1bc))/0xa;if(_0x529714===_0xd3936e)break;else _0x51fe73['push'](_0x51fe73['shift']());}catch(_0x2f706d){_0x51fe73['push'](_0x51fe73['shift']());}}}(a4_0x3d2f,0xde1a6));function a4_0x3d2f(){const _0x2d2c94=['201496uRlmhX','length','/api/node-toolbox/api-doc-generator','string','status','获取文档失败\x20(','\x20个数据集需要生成文档\x0a','),HTTP状态码:\x20','name','tableName','21tdUiFl','✓\x20成功生成:\x20','join','5338464MAGUou','error','1021048EazhYl','147QfIogz','响应数据格式错误\x20(','log','10SYXqJS','12661542kMCRSb','message','data','push','datasetCode','markdown','等待\x203\x20秒...\x0a','.md\x20(','496358TJXGDj','POST','utf8',']\x20正在生成:\x20','.md\x20-\x20','生成文档成功:\x20','./docs','✗\x20失败:\x20','18329230eolRce','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','stringify','562532xbKtlg','api-doc','.md'];a4_0x3d2f=function(){return _0x2d2c94;};return a4_0x3d2f();}import{mkdirSync,writeFileSync}from'node:fs';import a4_0x347b02 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x5ec66b){const _0x4d839a=a4_0x7745,{appCode:_0x30d739,datasetCode:_0x4b2305,datasetId:_0x3d6588,extraParams:_0x3bb146}=_0x5ec66b,_0xa5570d=getApiDomain(),_0x29d228=_0xa5570d+_0x4d839a(0x1c4),_0x153c56={'appCode':_0x30d739,'datasetCode':_0x4b2305,'datasetId':_0x3d6588,..._0x3bb146||{}},_0x4aabdc=await fetch(_0x29d228,{'method':_0x4d839a(0x1b5),'headers':{'Content-Type':'application/json','Cookie':getCookie()},'body':JSON[_0x4d839a(0x1be)](_0x153c56)});if(!_0x4aabdc['ok']){if(_0x4aabdc[_0x4d839a(0x1c6)]===0x191)throw new Error(_0x4d839a(0x1bd));let _0x4409ab='';try{_0x4409ab=await _0x4aabdc['text']();}catch(_0x54dca3){}throw new Error(_0x4d839a(0x1c7)+_0x4b2305+_0x4d839a(0x1c9)+_0x4aabdc['status']+(_0x4409ab?'\x0a'+_0x4409ab:''));}const _0x35f528=await _0x4aabdc['json']();if(!_0x35f528[_0x4d839a(0x1d8)]||typeof _0x35f528[_0x4d839a(0x1d8)][_0x4d839a(0x1db)]!==_0x4d839a(0x1c5))throw new Error(_0x4d839a(0x1d3)+_0x4b2305+'):缺少\x20data.markdown\x20字段');return _0x35f528['data']['markdown'];}function delay(_0x45f31f){return new Promise(_0xf50e6f=>setTimeout(_0xf50e6f,_0x45f31f));}function a4_0x7745(_0x2ba944,_0x338bb7){const _0x3d2fda=a4_0x3d2f();return a4_0x7745=function(_0x7745ec,_0x3f023f){_0x7745ec=_0x7745ec-0x1b2;let _0x33d941=_0x3d2fda[_0x7745ec];return _0x33d941;},a4_0x7745(_0x2ba944,_0x338bb7);}export async function generateDatasetDocs(_0x19825a,_0x5c09ac,_0x357197=a4_0x5055f3(0x1ba),_0x589801,_0x19976b){const _0x12ce8e=a4_0x5055f3;mkdirSync(_0x357197,{'recursive':!![]});const _0x4c0f0d=[],_0x453bf9=_0x19825a[_0x12ce8e(0x1c3)];console[_0x12ce8e(0x1d4)]('\x0a共有\x20'+_0x453bf9+_0x12ce8e(0x1c8));for(let _0x1d86b4=0x0;_0x1d86b4<_0x19825a[_0x12ce8e(0x1c3)];_0x1d86b4++){const _0x2ccc0b=_0x19825a[_0x1d86b4],_0x5b8489=_0x1d86b4+0x1,_0x32a728=_0x2ccc0b[_0x12ce8e(0x1cb)];try{console[_0x12ce8e(0x1d4)]('['+_0x5b8489+'/'+_0x453bf9+_0x12ce8e(0x1b7)+_0x32a728+_0x12ce8e(0x1b3)+_0x2ccc0b['name']+')');_0x589801&&_0x589801(_0x5b8489,_0x453bf9,_0x32a728);const _0x2148b3=await fetchDatasetDoc({'appCode':_0x5c09ac,'datasetCode':_0x2ccc0b[_0x12ce8e(0x1da)],'datasetId':_0x2ccc0b['id'],'enableAI':![],'extraParams':_0x19976b}),_0x64efc1=a4_0x347b02[_0x12ce8e(0x1ce)](_0x357197,_0x32a728+_0x12ce8e(0x1c1));writeFileSync(_0x64efc1,_0x2148b3,{'encoding':_0x12ce8e(0x1b6)}),console[_0x12ce8e(0x1d4)](_0x12ce8e(0x1cd)+_0x32a728+'.md'),logger['success'](_0x12ce8e(0x1c0),_0x12ce8e(0x1b9)+_0x32a728,undefined,{'datasetCode':_0x2ccc0b[_0x12ce8e(0x1da)],'datasetName':_0x2ccc0b['name'],'filePath':_0x64efc1,'progress':_0x5b8489+'/'+_0x453bf9}),_0x4c0f0d[_0x12ce8e(0x1d9)]({'datasetCode':_0x2ccc0b[_0x12ce8e(0x1da)],'datasetName':_0x2ccc0b[_0x12ce8e(0x1ca)],'filePath':_0x64efc1,'success':!![]}),_0x5b8489<_0x453bf9&&await delay(0x1388);}catch(_0x5c59cb){const _0x4e343e=_0x5c59cb instanceof Error?_0x5c59cb[_0x12ce8e(0x1d7)]:String(_0x5c59cb);console['log'](_0x12ce8e(0x1bb)+_0x32a728+_0x12ce8e(0x1b8)+_0x4e343e+'\x0a'),logger[_0x12ce8e(0x1d0)](_0x12ce8e(0x1c0),'生成文档失败:\x20'+_0x2ccc0b[_0x12ce8e(0x1da)],{'datasetCode':_0x2ccc0b[_0x12ce8e(0x1da)],'datasetName':_0x2ccc0b['name'],'error':_0x4e343e,'progress':_0x5b8489+'/'+_0x453bf9}),_0x4c0f0d[_0x12ce8e(0x1d9)]({'datasetCode':_0x2ccc0b['datasetCode'],'datasetName':_0x2ccc0b[_0x12ce8e(0x1ca)],'filePath':'','success':![],'error':_0x4e343e}),_0x5b8489<_0x453bf9&&(console[_0x12ce8e(0x1d4)](_0x12ce8e(0x1b2)),await delay(0xbb8));}}return _0x4c0f0d;}
|
package/lib/api/api-pull-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29bd1c,_0x4538f3){const _0x583ab1=a5_0x3a41,_0x3b6419=_0x29bd1c();while(!![]){try{const _0x177abb=parseInt(_0x583ab1(0x1e6))/0x1*(-parseInt(_0x583ab1(0x209))/0x2)+-parseInt(_0x583ab1(0x20d))/0x3+parseInt(_0x583ab1(0x1fe))/0x4*(parseInt(_0x583ab1(0x1de))/0x5)+parseInt(_0x583ab1(0x202))/0x6*(-parseInt(_0x583ab1(0x1f9))/0x7)+parseInt(_0x583ab1(0x1f6))/0x8*(parseInt(_0x583ab1(0x1f3))/0x9)+parseInt(_0x583ab1(0x207))/0xa*(-parseInt(_0x583ab1(0x1dc))/0xb)+parseInt(_0x583ab1(0x1fd))/0xc;if(_0x177abb===_0x4538f3)break;else _0x3b6419['push'](_0x3b6419['shift']());}catch(_0x2a68d7){_0x3b6419['push'](_0x3b6419['shift']());}}}(a5_0x5c94,0xb74f5));import{jsx as a5_0xa9709e,jsxs as a5_0x99a2c6}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';function a5_0x3a41(_0x5cb9c7,_0x1a949a){const _0x5c94be=a5_0x5c94();return a5_0x3a41=function(_0x3a4107,_0x2aadc7){_0x3a4107=_0x3a4107-0x1dc;let _0x4c5ded=_0x5c94be[_0x3a4107];return _0x4c5ded;},a5_0x3a41(_0x5cb9c7,_0x1a949a);}export const ApiPullUI=({appCode:_0x4fd4e0,env:_0x23c1bf,output:_0x4bb25a})=>{const _0x224e52=a5_0x3a41,{exit:_0x5312d1}=useApp(),[_0x318219,_0xcbb3c2]=useState(![]),[_0x4d738d,_0x35d2f8]=useState(![]),[_0xabcb30,_0x4fce53]=useState(null),[_0x1378f4,_0x5af82b]=useState(null),_0x5b9fcf=readConfig(),_0x5a8575=getConfigAppCode(),_0x437503=_0x4fd4e0||_0x5a8575,_0xa83ed5=typeof _0x5b9fcf?.['env']==='string'?_0x5b9fcf[_0x224e52(0x20e)]:undefined,_0x4353fc=_0x23c1bf||_0xa83ed5||'online';initEnv(_0x4353fc);const _0x7fdf9c=_0x4bb25a||_0x224e52(0x1e3),_0x578673=_0x4fd4e0&&_0x4fd4e0[_0x224e52(0x203)]('-')?_0x4fd4e0['split']('-')[_0x224e52(0x1e7)](0x1)[_0x224e52(0x1f8)]('-'):'',_0x4b29e5=_0x4fd4e0?_0x224e52(0x1f4)+_0x437503:'使用配置的应用AppCode:\x20'+_0x437503,_0x419fba=_0x578673?_0x578673+_0x224e52(0x20f):_0x224e52(0x1fa),_0x565b6d=_0x578673?_0x578673+_0x224e52(0x1e5):'client';useEffect(()=>{_0xcbb3c2(!![]),_0x1c7275();},[]),useEffect(()=>{(_0x4d738d||_0xabcb30)&&_0x5312d1();},[_0x4d738d,_0xabcb30,_0x5312d1]);async function _0x1c7275(){const _0x401919=_0x224e52;if(!_0x437503){_0x4fce53('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x401919(0x1ee)](process[_0x401919(0x1f2)]());const {configArray:_0x226ead}=await fetchModelList(_0x437503),_0xcf2a22=_0x226ead[_0x401919(0x1e2)],_0x296f2d=!_0x4fd4e0,_0xb04d0d=await generateApiFile(_0x226ead,_0x578673,_0x437503,_0x296f2d,_0x4353fc,_0x7fdf9c),_0x217f0f=_0x7fdf9c[_0x401919(0x1fc)]('/')?_0x7fdf9c:_0x7fdf9c+'/';_0x5af82b({'api':''+_0x217f0f+_0x419fba+_0x401919(0x1dd),'client':''+_0x217f0f+_0x565b6d+_0x401919(0x1dd),'modelCount':_0xb04d0d[_0x401919(0x1f1)],'datasetCount':_0xcf2a22,'originalCount':_0xcf2a22,'duplicateCount':0x0}),_0x35d2f8(!![]);}catch(_0x284af1){const _0x107da9=_0x284af1 instanceof Error?_0x284af1['message']:String(_0x284af1);logger[_0x401919(0x1df)](_0x401919(0x1ec),_0x401919(0x1f5)+_0x107da9,{'appCode':_0x437503,'error':_0x107da9}),_0x4fce53('拉取\x20API\x20配置失败:\x20'+_0x107da9);}finally{_0xcbb3c2(![]);}}return a5_0x99a2c6(Box,{'flexDirection':_0x224e52(0x1eb),'children':[(_0x318219||_0x4d738d)&&a5_0x99a2c6(Box,{'children':[a5_0xa9709e(Text,{'color':'gray','children':'*\x20'}),a5_0xa9709e(Text,{'color':_0x4fd4e0?'white':_0x224e52(0x1fb),'children':_0x4b29e5})]}),_0x318219&&a5_0xa9709e(Box,{'children':a5_0x99a2c6(Text,{'children':[_0x224e52(0x20c),_0x4353fc,')']})}),_0x4d738d&&_0x1378f4&&a5_0x99a2c6(Box,{'flexDirection':_0x224e52(0x1eb),'children':[a5_0xa9709e(Box,{'children':a5_0x99a2c6(Text,{'color':_0x224e52(0x1e1),'children':[_0x224e52(0x200),_0x1378f4[_0x224e52(0x1ed)],_0x224e52(0x1e4),'\x20',_0x1378f4[_0x224e52(0x1f1)],'\x20个模型']})}),_0x1378f4['duplicateCount']>0x0&&a5_0xa9709e(Box,{'marginTop':0x1,'children':a5_0x99a2c6(Text,{'color':'yellow','children':[_0x224e52(0x201),_0x1378f4[_0x224e52(0x1e0)],_0x224e52(0x1e8),'\x20',_0x1378f4['duplicateCount'],'\x20个']})}),a5_0xa9709e(Box,{'marginTop':0x1,'children':a5_0xa9709e(Text,{'color':_0x224e52(0x20a),'children':_0x224e52(0x204)})}),a5_0x99a2c6(Box,{'marginLeft':0x2,'children':[a5_0x99a2c6(Text,{'color':'cyan','children':['•\x20',_0x1378f4[_0x224e52(0x1fa)]]}),a5_0x99a2c6(Text,{'color':'dim','children':['\x20','-\x20模型配置文件\x20(',_0x1378f4[_0x224e52(0x1f1)],'\x20个模型)']})]}),a5_0x99a2c6(Box,{'marginLeft':0x2,'children':[a5_0x99a2c6(Text,{'color':_0x224e52(0x208),'children':['•\x20',_0x1378f4[_0x224e52(0x1ff)]]}),a5_0xa9709e(Text,{'color':_0x224e52(0x1fb),'children':_0x224e52(0x1e9)})]}),a5_0xa9709e(Box,{'marginTop':0x1,'children':a5_0xa9709e(Text,{'color':'gray','children':_0x224e52(0x1ea)})}),a5_0xa9709e(Box,{'marginLeft':0x2,'children':a5_0x99a2c6(Text,{'color':_0x224e52(0x1f0),'children':[_0x224e52(0x1f7),'{\x20lovrabetClient\x20}','\x20from\x20\x27@/',_0x1378f4[_0x224e52(0x1ff)][_0x224e52(0x20b)](/^\.\//,'')[_0x224e52(0x20b)](_0x224e52(0x1dd),''),'\x27']})})]}),_0xabcb30&&a5_0x99a2c6(Box,{'flexDirection':_0x224e52(0x1eb),'children':[a5_0xa9709e(Box,{'children':a5_0x99a2c6(Text,{'color':_0x224e52(0x205),'children':['❌\x20',_0xabcb30]})}),_0xabcb30['includes']('登录')&&a5_0x99a2c6(Box,{'marginTop':0x1,'children':[a5_0xa9709e(Text,{'color':_0x224e52(0x1f0),'children':_0x224e52(0x206)}),a5_0xa9709e(Text,{'color':'cyan','children':_0x224e52(0x1ef)}),a5_0xa9709e(Text,{'color':'yellow','children':_0x224e52(0x210)})]})]})]});};function a5_0x5c94(){const _0x17613f=['261831TpptdH','env','-api','\x20重新登录后再试','2502632HlqDOQ','.ts','5PGqIli','error','originalCount','green','length','./src/api/','\x20个数据集,生成','-client','1clwbwQ','slice','\x20个,过滤重复','\x20-\x20客户端实例文件','*\x20导入方式:','column','api-pull','datasetCount','setLogPath','lovrabet\x20auth','yellow','modelCount','cwd','13167657nNQPQr','使用指定的应用AppCode:\x20','拉取\x20API\x20配置失败:\x20','8xTKQmb','import\x20','join','1869553CUwicV','api','dim','endsWith','24248232kjbYzK','1228868YpISjJ','client','√\x20成功拉取\x20','!\x20原始数据集\x20','18ZNGjhs','includes','*\x20已生成文件:','red','💡\x20请使用\x20','60detxrS','cyan','1573106hvusSd','gray','replace','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'];a5_0x5c94=function(){return _0x17613f;};return a5_0x5c94();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a6_0x4f98(){const _0x501040=['2627286zMrdAu','6660270DaYcLe','configArray','status','25zDTONQ','success','未知错误','count','10814587vcaEYn','835496CuqrYz','data','1412892swFXkA','2480ikTvBN','info','获取数据集失败:\x20','/api/node-toolbox/dataset/model-list?appcode=','获取数据集失败,HTTP状态码:\x20','&otype=array','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','message','fetch-model-list','304xeiYTJ','571fhxppx'];a6_0x4f98=function(){return _0x501040;};return a6_0x4f98();}function a6_0x1727(_0x988b39,_0x2ac2fa){const _0x4f982b=a6_0x4f98();return a6_0x1727=function(_0x17275d,_0x25d1e9){_0x17275d=_0x17275d-0x163;let _0x1cb695=_0x4f982b[_0x17275d];return _0x1cb695;},a6_0x1727(_0x988b39,_0x2ac2fa);}(function(_0x34ba72,_0x19006a){const _0x44e5a4=a6_0x1727,_0x1b60a9=_0x34ba72();while(!![]){try{const _0x4af8fa=parseInt(_0x44e5a4(0x164))/0x1*(-parseInt(_0x44e5a4(0x163))/0x2)+parseInt(_0x44e5a4(0x165))/0x3+parseInt(_0x44e5a4(0x16e))/0x4*(-parseInt(_0x44e5a4(0x169))/0x5)+parseInt(_0x44e5a4(0x170))/0x6+parseInt(_0x44e5a4(0x16d))/0x7+-parseInt(_0x44e5a4(0x171))/0x8+-parseInt(_0x44e5a4(0x166))/0x9;if(_0x4af8fa===_0x19006a)break;else _0x1b60a9['push'](_0x1b60a9['shift']());}catch(_0x38c482){_0x1b60a9['push'](_0x1b60a9['shift']());}}}(a6_0x4f98,0xbf92b));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(_0xe2338c){const _0x4b6b19=a6_0x1727,_0x3d4e64=getEnv(),_0x369d95=getApiDomain()+_0x4b6b19(0x174)+_0xe2338c+_0x4b6b19(0x176);logger[_0x4b6b19(0x172)](_0x4b6b19(0x179),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x3d4e64+')',{'apiUrl':_0x369d95});const _0x39dd3d=await fetch(_0x369d95,{'headers':{'Cookie':getCookie()}});if(!_0x39dd3d['ok']){if(_0x39dd3d[_0x4b6b19(0x168)]===0x191)throw new Error(_0x4b6b19(0x177));throw new Error(_0x4b6b19(0x175)+_0x39dd3d[_0x4b6b19(0x168)]);}const _0x2a5967=await _0x39dd3d['json']();if(!_0x2a5967[_0x4b6b19(0x16a)])throw new Error(_0x4b6b19(0x173)+(_0x2a5967[_0x4b6b19(0x178)]||_0x4b6b19(0x16b)));return{'configArray':_0x2a5967[_0x4b6b19(0x16f)][_0x4b6b19(0x167)],'count':_0x2a5967[_0x4b6b19(0x16f)][_0x4b6b19(0x16c)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a7_0x30f2be=a7_0x406e;(function(_0x5f499b,_0x16cce5){const _0x5e7e0a=a7_0x406e,_0x593eb5=_0x5f499b();while(!![]){try{const _0x15d906=parseInt(_0x5e7e0a(0x9f))/0x1*(-parseInt(_0x5e7e0a(0x86))/0x2)+parseInt(_0x5e7e0a(0x93))/0x3+-parseInt(_0x5e7e0a(0x9d))/0x4+parseInt(_0x5e7e0a(0x87))/0x5+parseInt(_0x5e7e0a(0x96))/0x6+-parseInt(_0x5e7e0a(0x8a))/0x7*(-parseInt(_0x5e7e0a(0x81))/0x8)+-parseInt(_0x5e7e0a(0xa4))/0x9*(parseInt(_0x5e7e0a(0x8f))/0xa);if(_0x15d906===_0x16cce5)break;else _0x593eb5['push'](_0x593eb5['shift']());}catch(_0x5f18d4){_0x593eb5['push'](_0x593eb5['shift']());}}}(a7_0xeb54,0x66a7c));import a7_0x5362ba from'prettier';function a7_0x406e(_0x311d89,_0x2244d0){const _0xeb54f3=a7_0xeb54();return a7_0x406e=function(_0x406e60,_0x11cded){_0x406e60=_0x406e60-0x7c;let _0x1c8868=_0xeb54f3[_0x406e60];return _0x1c8868;},a7_0x406e(_0x311d89,_0x2244d0);}import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x44afc6 from'node:path';function a7_0xeb54(){const _0x597224=['client.ts.tpl','templates/generate-api','1562058FtOJqO','length','{\x20apiConfigName:\x20\x22','3820128oLjHAQ','typescript','slice','forEach',',\x20env:\x20\x22','endsWith','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','1917072iVReKL','datasetCode','838112BdcZXW','success','resolve','app','client','9lbJuxS','join','env','string','-client','API\x20文件生成成功!','\x22\x20}','114720WbEraR','dirname','utf8','-api','format','2gzmVkA','2961115VjKpOA','keys','./src/api/','28YNJMTk','tableName','.ts','../..','online','691010yltfUq','replaceApiContent'];a7_0xeb54=function(){return _0x597224;};return a7_0xeb54();}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x2c30ef,_0x2038b5='',_0x4f965a,_0x24699d=![],_0x2f834b,_0x3d8152=a7_0x30f2be(0x89)){const _0x50b4d5=a7_0x30f2be,_0x2de050=readConfig(),_0x157b93=_0x4f965a||_0x2de050?.[_0x50b4d5(0xa2)];if(typeof _0x157b93!==_0x50b4d5(0x7d)||!_0x157b93)throw new Error(_0x50b4d5(0x9c));const _0x4712e4=_0x24699d?'CONFIG_NAMES.DEFAULT':'\x22'+_0x157b93+'\x22',_0xbe4f83=typeof _0x2de050[_0x50b4d5(0x7c)]===_0x50b4d5(0x7d)?_0x2de050[_0x50b4d5(0x7c)]:undefined,_0x314616=_0x2f834b||_0xbe4f83||_0x50b4d5(0x8e),_0x2ca2d3=_0x314616!==_0x50b4d5(0x8e);let _0x5b71eb;if(_0x24699d)_0x2ca2d3?_0x5b71eb='{\x20apiConfigName:\x20'+_0x4712e4+',\x20env:\x20\x22'+_0x314616+_0x50b4d5(0x80):_0x5b71eb='';else{const _0x57399c=_0x2ca2d3?_0x50b4d5(0x9a)+_0x314616+'\x22':'';_0x5b71eb=_0x50b4d5(0x95)+_0x157b93+'\x22'+_0x57399c+'\x20}';}const _0x302b94=_0x2038b5?_0x2038b5+_0x50b4d5(0x84):'api',_0x27f8cd=_0x2038b5?_0x2038b5+_0x50b4d5(0x7e):_0x50b4d5(0xa3),_0x5dfdc3={};_0x2c30ef[_0x50b4d5(0x99)](_0x563237=>{const _0x5b3626=_0x50b4d5;_0x5dfdc3[_0x563237['key']]={'tableName':_0x563237[_0x5b3626(0x8b)],'datasetCode':_0x563237[_0x5b3626(0x9e)],'name':_0x563237['name']||''};});const _0x1e195a=fileURLToPath(import.meta['url']),_0x552ce4=a7_0x44afc6[_0x50b4d5(0xa1)](a7_0x44afc6[_0x50b4d5(0x82)](_0x1e195a),_0x50b4d5(0x8d)),_0x223c51=a7_0x44afc6[_0x50b4d5(0xa5)](_0x552ce4,_0x50b4d5(0x92)),_0x1a5b86=a7_0x44afc6[_0x50b4d5(0xa5)](_0x223c51,'api.ts.tpl'),_0x23bab1=a7_0x44afc6[_0x50b4d5(0xa5)](_0x223c51,_0x50b4d5(0x91)),_0x47c002=_0x3d8152[_0x50b4d5(0x9b)]('/')?_0x3d8152[_0x50b4d5(0x98)](0x0,-0x1):_0x3d8152;mkdirSync(_0x47c002,{'recursive':!![]});const _0x50779c=readFileSync(_0x1a5b86,_0x50b4d5(0x83)),_0x46d7c7=TemplateReplacer[_0x50b4d5(0x90)](_0x50779c,_0x157b93,_0x5dfdc3,Object[_0x50b4d5(0x88)](_0x5dfdc3)[0x0],_0x302b94,_0x4712e4),_0x1517e5=await a7_0x5362ba[_0x50b4d5(0x85)](_0x46d7c7,{'parser':_0x50b4d5(0x97)}),_0x2af1b4=_0x47c002+'/'+_0x302b94+_0x50b4d5(0x8c);writeFileSync(_0x2af1b4,_0x1517e5,{'encoding':_0x50b4d5(0x83)});const _0xc425fe=readFileSync(_0x23bab1,'utf8'),_0x38f5f8=TemplateReplacer[_0x50b4d5(0x90)](_0xc425fe,_0x157b93,_0x5dfdc3,Object[_0x50b4d5(0x88)](_0x5dfdc3)[0x0],_0x302b94,_0x4712e4,_0x5b71eb),_0x36381d=await a7_0x5362ba[_0x50b4d5(0x85)](_0x38f5f8,{'parser':_0x50b4d5(0x97)}),_0x103f78=_0x47c002+'/'+_0x27f8cd+_0x50b4d5(0x8c);writeFileSync(_0x103f78,_0x36381d,{'encoding':'utf8'});const _0x32094c=Object[_0x50b4d5(0x88)](_0x5dfdc3)[_0x50b4d5(0x94)];return logger[_0x50b4d5(0xa0)]('init-api',_0x50b4d5(0x7f),undefined,{'apiFile':_0x2af1b4,'clientFile':_0x103f78,'modelCount':_0x32094c,'configName':_0x4712e4}),{'modelCount':_0x32094c,'apiFilePath':_0x2af1b4,'clientFilePath':_0x103f78,'configName':_0x4712e4};}
|
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xcb7952,_0x1e1ce1){const _0x512437=a8_0x30e8,_0x420a2f=_0xcb7952();while(!![]){try{const _0x138809=-parseInt(_0x512437(0xcb))/0x1+parseInt(_0x512437(0xcd))/0x2+-parseInt(_0x512437(0xc5))/0x3+parseInt(_0x512437(0xc6))/0x4+parseInt(_0x512437(0xca))/0x5*(parseInt(_0x512437(0xeb))/0x6)+parseInt(_0x512437(0xc9))/0x7*(parseInt(_0x512437(0xc8))/0x8)+-parseInt(_0x512437(0xd6))/0x9;if(_0x138809===_0x1e1ce1)break;else _0x420a2f['push'](_0x420a2f['shift']());}catch(_0x4b3791){_0x420a2f['push'](_0x420a2f['shift']());}}}(a8_0x5006,0xe0d0d));function a8_0x5006(){const _0x13bc8e=['请使用\x20--appcode\x20参数,例如:','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','3504KWUisA','env','map','length','split','error','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','output','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','parse','input','Unknown\x20api\x20command:\x20','×\x20未配置\x20AppCode','\x20\x20错误:\x20','datasetcode','3967611VjPuEm','3884416bTENCs','×\x20--datasetcode\x20参数不能为空','14161712iVkOfk','7Otxqku','10080yTeJCj','1282463lpITOH','\x1b[0m','601598xBCWNp','\x1b[90m*\x20仅生成指定数据集的文档:\x20','×\x20--params\x20参数不是有效的\x20JSON\x20格式','\x1b[90m*\x20使用配置的应用AppCode:\x20','Available\x20commands:','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','string','help','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','6242544AdcafC','isArray','❌\x20错误:不再支持位置参数方式','pull','join','filter','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','object','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','message','log','exit','params','\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文档','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','doc','\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请使用以下方式之一:','flags'];a8_0x5006=function(){return _0x13bc8e;};return a8_0x5006();}import{jsx as a8_0x4ace25}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a8_0x30e8(_0x4c8048,_0x182247){const _0x50068b=a8_0x5006();return a8_0x30e8=function(_0x30e8e2,_0x2cdf5b){_0x30e8e2=_0x30e8e2-0xbe;let _0x2dd35c=_0x50068b[_0x30e8e2];return _0x2dd35c;},a8_0x30e8(_0x4c8048,_0x182247);}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x49cd37){const _0x4f4915=a8_0x30e8,_0x1b3baf=_0x49cd37['input'][0x1];if(_0x49cd37['flags'][_0x4f4915(0xd4)]){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(_0x1b3baf===_0x4f4915(0xd9)){_0x49cd37[_0x4f4915(0xc0)][0x2]&&(console[_0x4f4915(0xf0)]('❌\x20错误:不再支持位置参数方式'),console[_0x4f4915(0xe0)](_0x4f4915(0xe9)),console[_0x4f4915(0xe0)](_0x4f4915(0xea)+_0x49cd37[_0x4f4915(0xc0)][0x2]),process['exit'](0x1));const _0x10a58b=getConfigAppCode();let _0x527dc9=_0x49cd37[_0x4f4915(0xe8)]['appcode'];const _0x2a74fe=typeof _0x49cd37[_0x4f4915(0xe8)][_0x4f4915(0xec)]==='string'?_0x49cd37[_0x4f4915(0xe8)][_0x4f4915(0xec)]:undefined,_0x5295d8=_0x49cd37[_0x4f4915(0xe8)][_0x4f4915(0xf3)];!_0x527dc9&&!_0x10a58b&&(console['error']('×\x20未配置\x20AppCode'),console[_0x4f4915(0xe0)](_0x4f4915(0xe7)),console[_0x4f4915(0xe0)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x4f4915(0xe0)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>'),process[_0x4f4915(0xe1)](0x1)),_0x527dc9&&_0x10a58b&&_0x527dc9===_0x10a58b&&(console['log'](_0x4f4915(0xd0)+_0x527dc9+_0x4f4915(0xcc)),console[_0x4f4915(0xe0)](_0x4f4915(0xe4)),_0x527dc9=undefined),render(a8_0x4ace25(ApiPullUI,{'appCode':_0x527dc9,'env':_0x2a74fe,'output':_0x5295d8}));}else{if(_0x1b3baf===_0x4f4915(0xe5)){_0x49cd37[_0x4f4915(0xc0)][0x2]&&(console[_0x4f4915(0xf0)](_0x4f4915(0xd8)),console[_0x4f4915(0xe0)](_0x4f4915(0xe9)),console[_0x4f4915(0xe0)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0x49cd37[_0x4f4915(0xc0)][0x2]),process[_0x4f4915(0xe1)](0x1));const _0x9fec5d=getConfigAppCode();let _0x309cf3=_0x49cd37[_0x4f4915(0xe8)]['appcode'];const _0x1b17b6=typeof _0x49cd37['flags']['env']===_0x4f4915(0xd3)?_0x49cd37[_0x4f4915(0xe8)][_0x4f4915(0xec)]:undefined,_0x544072=_0x49cd37[_0x4f4915(0xe8)][_0x4f4915(0xf3)],_0x2be944=_0x49cd37[_0x4f4915(0xe8)][_0x4f4915(0xe2)],_0x576d55=_0x49cd37[_0x4f4915(0xe8)][_0x4f4915(0xc4)];!_0x309cf3&&!_0x9fec5d&&(console[_0x4f4915(0xf0)](_0x4f4915(0xc2)),console[_0x4f4915(0xe0)](_0x4f4915(0xe7)),console[_0x4f4915(0xe0)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console['log'](_0x4f4915(0xd5)),process[_0x4f4915(0xe1)](0x1));_0x309cf3&&_0x9fec5d&&_0x309cf3===_0x9fec5d&&(console[_0x4f4915(0xe0)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x309cf3+_0x4f4915(0xcc)),_0x309cf3=undefined);let _0x5466ae;if(_0x2be944)try{_0x5466ae=JSON[_0x4f4915(0xbf)](_0x2be944),(typeof _0x5466ae!==_0x4f4915(0xdd)||_0x5466ae===null||Array[_0x4f4915(0xd7)](_0x5466ae))&&(console['error'](_0x4f4915(0xd2)),process[_0x4f4915(0xe1)](0x1));}catch(_0x1ba69a){console[_0x4f4915(0xf0)](_0x4f4915(0xcf)),console['error'](_0x4f4915(0xc3)+(_0x1ba69a instanceof Error?_0x1ba69a[_0x4f4915(0xdf)]:String(_0x1ba69a))),process[_0x4f4915(0xe1)](0x1);}let _0xd18bb3;_0x576d55&&(_0xd18bb3=_0x576d55[_0x4f4915(0xef)](',')[_0x4f4915(0xed)](_0x3e906f=>_0x3e906f['trim']())[_0x4f4915(0xdb)](_0x18bf9e=>_0x18bf9e[_0x4f4915(0xee)]>0x0),_0xd18bb3['length']===0x0&&(console[_0x4f4915(0xf0)](_0x4f4915(0xc7)),process['exit'](0x1)),console[_0x4f4915(0xe0)](_0x4f4915(0xce)+_0xd18bb3[_0x4f4915(0xda)](',\x20')+_0x4f4915(0xcc))),render(a8_0x4ace25(ApiDocUI,{'appCode':_0x309cf3,'env':_0x1b17b6,'output':_0x544072,'extraParams':_0x5466ae,'datasetCodes':_0xd18bb3}));}else console['error'](_0x4f4915(0xc1)+_0x1b3baf),console[_0x4f4915(0xe0)](_0x4f4915(0xd1)),console[_0x4f4915(0xe0)](_0x4f4915(0xe6)),console['log'](_0x4f4915(0xdc)),console[_0x4f4915(0xe0)](_0x4f4915(0xbe)),console[_0x4f4915(0xe0)](_0x4f4915(0xf2)),console[_0x4f4915(0xe0)](''),console[_0x4f4915(0xe0)](_0x4f4915(0xe3)),console[_0x4f4915(0xe0)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console[_0x4f4915(0xe0)](_0x4f4915(0xde)),console[_0x4f4915(0xe0)](_0x4f4915(0xf1)),process[_0x4f4915(0xe1)](0x1);}}
|
package/lib/api/pull-silent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x575bd7,_0x1e5744){const _0x271be9=a9_0x18c9,_0x308a8f=_0x575bd7();while(!![]){try{const _0xd2b940=parseInt(_0x271be9(0x152))/0x1*(parseInt(_0x271be9(0x15b))/0x2)+-parseInt(_0x271be9(0x171))/0x3+-parseInt(_0x271be9(0x169))/0x4+parseInt(_0x271be9(0x158))/0x5+-parseInt(_0x271be9(0x163))/0x6+parseInt(_0x271be9(0x170))/0x7+parseInt(_0x271be9(0x164))/0x8;if(_0xd2b940===_0x1e5744)break;else _0x308a8f['push'](_0x308a8f['shift']());}catch(_0x5463b4){_0x308a8f['push'](_0x308a8f['shift']());}}}(a9_0x29a5,0x80944));import{readConfig}from'../utils/config.js';function a9_0x18c9(_0x9538e6,_0x267f35){const _0x29a5ec=a9_0x29a5();return a9_0x18c9=function(_0x18c930,_0xd85374){_0x18c930=_0x18c930-0x152;let _0x1f144d=_0x29a5ec[_0x18c930];return _0x1f144d;},a9_0x18c9(_0x9538e6,_0x267f35);}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_0x29a5(){const _0x2348b8=['env','√\x20成功拉取\x20','error','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','\x20个模型','250690ddgdoD','-api','length','6HHzRnz','-client','string','\x20\x20\x20•\x20','online','cwd','chdir','api','2595294WGbvUe','11684800xZJvWf','*\x20正在处理\x20','info','API\x20配置拉取成功:\x20','trim','1646560ZaxTcR','×\x20API\x20配置拉取异常:','message','.ts\x20-\x20客户端实例文件','create-api-pull','client','log','3445981VKWSOL','2142963YFGqEV','27383ejoJeR'];a9_0x29a5=function(){return _0x2348b8;};return a9_0x29a5();}export async function pullApiSilent(_0x4fa2f5,_0x1e0541,_0x4d8eac,_0x13198a){const _0x1c7abc=a9_0x18c9;let _0x1a857d;try{const _0x200ab5=_0x1e0541?.[_0x1c7abc(0x168)]()||'';if(_0x200ab5){const _0x5e9742=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5e9742['test'](_0x200ab5))return console[_0x1c7abc(0x155)](_0x1c7abc(0x156)),![];}_0x4d8eac&&(_0x1a857d=process[_0x1c7abc(0x160)](),process[_0x1c7abc(0x161)](_0x4d8eac));const _0x760c3=readConfig(),_0x4498c0=typeof _0x760c3[_0x1c7abc(0x153)]===_0x1c7abc(0x15d)?_0x760c3[_0x1c7abc(0x153)]:undefined,_0x775ad0=_0x13198a||_0x4498c0||_0x1c7abc(0x15f);initEnv(_0x775ad0),console[_0x1c7abc(0x16f)]('*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'+_0x775ad0+')');const {configArray:_0x45aa2d}=await fetchModelList(_0x4fa2f5),_0x56e884=_0x200ab5?_0x200ab5+_0x1c7abc(0x159):_0x1c7abc(0x162),_0x535a55=_0x200ab5?_0x200ab5+_0x1c7abc(0x15c):_0x1c7abc(0x16e);console[_0x1c7abc(0x16f)]('*\x20开始生成\x20API\x20配置文件:'),console[_0x1c7abc(0x16f)](_0x1c7abc(0x15e)+_0x56e884+'.ts\x20-\x20模型配置文件'),console[_0x1c7abc(0x16f)]('\x20\x20\x20•\x20'+_0x535a55+_0x1c7abc(0x16c)),console[_0x1c7abc(0x16f)](_0x1c7abc(0x165)+_0x45aa2d[_0x1c7abc(0x15a)]+'\x20个数据集...');const _0x694046=await generateApiFile(_0x45aa2d,_0x200ab5,_0x4fa2f5,!![],_0x775ad0);return console['log'](_0x1c7abc(0x154)+_0x45aa2d[_0x1c7abc(0x15a)]+'\x20个数据集,生成\x20'+_0x694046['modelCount']+_0x1c7abc(0x157)),_0x4d8eac&&logger[_0x1c7abc(0x166)](_0x1c7abc(0x16d),_0x1c7abc(0x167)+_0x4fa2f5,{'projectPath':_0x4d8eac,'appCode':_0x4fa2f5,'datasetCount':_0x45aa2d[_0x1c7abc(0x15a)],'filePrefix':_0x200ab5}),!![];}catch(_0x31af8b){const _0xb8be61=_0x31af8b instanceof Error?_0x31af8b[_0x1c7abc(0x16b)]:String(_0x31af8b);return console[_0x1c7abc(0x155)](_0x1c7abc(0x16a),_0xb8be61),_0x4d8eac&&logger[_0x1c7abc(0x155)](_0x1c7abc(0x16d),'API\x20配置拉取异常:\x20'+_0xb8be61,{'appCode':_0x4fa2f5,'projectPath':_0x4d8eac}),![];}finally{_0x1a857d&&process[_0x1c7abc(0x161)](_0x1a857d);}}
|
|
@@ -1 +1 @@
|
|
|
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);}
|
|
1
|
+
function a10_0x37eb(_0x30123e,_0x4ff8f9){const _0x50b05e=a10_0x50b0();return a10_0x37eb=function(_0x37eb62,_0xe1febc){_0x37eb62=_0x37eb62-0x65;let _0x2e1a97=_0x50b05e[_0x37eb62];return _0x2e1a97;},a10_0x37eb(_0x30123e,_0x4ff8f9);}(function(_0x1c648c,_0x21e50f){const _0x9c9c4a=a10_0x37eb,_0x580f02=_0x1c648c();while(!![]){try{const _0x4619e8=parseInt(_0x9c9c4a(0xa5))/0x1*(-parseInt(_0x9c9c4a(0x77))/0x2)+-parseInt(_0x9c9c4a(0x84))/0x3*(-parseInt(_0x9c9c4a(0x86))/0x4)+parseInt(_0x9c9c4a(0x8a))/0x5+parseInt(_0x9c9c4a(0x69))/0x6*(-parseInt(_0x9c9c4a(0x6c))/0x7)+parseInt(_0x9c9c4a(0x8c))/0x8*(-parseInt(_0x9c9c4a(0x7f))/0x9)+parseInt(_0x9c9c4a(0xa0))/0xa+parseInt(_0x9c9c4a(0xa1))/0xb;if(_0x4619e8===_0x21e50f)break;else _0x580f02['push'](_0x580f02['shift']());}catch(_0x28ed37){_0x580f02['push'](_0x580f02['shift']());}}}(a10_0x50b0,0x3b954));import{jsx as a10_0xaf898e,jsxs as a10_0x5e00ff,Fragment as a10_0x156c06}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';function a10_0x50b0(){const _0x4dfa3a=['filter','213279EUrvwQ','*\x20JS\x20链接:\x20','16iXUxQz','includes','Lovrabet平台','创建菜单失败','1908310mMtyzo','return','16NnivWJ','downArrow','trim','red','\x20输入项目的\x20CSS\x20资源链接(https://...)','\x20←\x20','green','CSS\x20链接无法访问','done','input-js','请输入有效的\x20JS\x20https\x20链接','gray','add','slice','delete','\x20正在获取线上菜单列表...','已选择菜单','\x20输入项目的\x20JS\x20资源链接(https://...)','*\x20CSS\x20链接:\x20','blue','1117010XFoolG','1287110PFYSHB','join','length','upArrow','10847Rvgnpb','*\x20正在创建菜单...','input-css','[✓]','backspace','message','CSS\x20链接','selecting','fill','has','then','1187436uHzWkA','size','cyan','7XrxJus','column','label','path','JS\x20链接无法访问','请至少选择一个菜单','online','lovrabet\x20auth','map','value','!\x20未找到本地页面,请先创建页面','46hKVlmT','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','√\x20菜单创建完成','yellow','菜单名称','JS\x20链接','max','*\x20同步菜单到\x20Lovrabet\x20平台','914877WGnkks','repeat','*\x20请选择要同步的菜单:','catch'];a10_0x50b0=function(){return _0x4dfa3a;};return a10_0x50b0();}import{useEffect,useState}from'react';import a10_0xbdf26f 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_0xaf898e(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x493044=a10_0x37eb,{exit:_0x3c46ae}=useApp(),{loading:_0xa9295e,menuList:_0x11aecf,error:_0x3b0117}=useGetOnlineMenuList(),_0x20f70c=getLocalPages(),_0x2c2c2a=_0x11aecf['map'](_0x4f7ee0=>_0x4f7ee0['path']),_0x433280=[_0x493044(0x7b),..._0x20f70c[_0x493044(0x74)](_0x3ac324=>_0x3ac324[_0x493044(0x6e)])],_0x38437a=getStringWidth(getMaxWidth(_0x433280,0x4)),_0x41d814=getStringWidth(getMaxWidth([_0x493044(0x7b)])),[_0x471350,_0x2665cd]=useState(_0x493044(0x65)),[_0x4c2101,_0xcb1dc1]=useState(new Set()),[_0x35c675,_0x51610a]=useState(0x0),[_0x3cfd66,_0x245083]=useState(''),[_0x401aa9,_0x4f0aaa]=useState(''),[_0x19155a,_0x40073f]=useState(''),[_0x35ed6c,_0x472ac9]=useState(''),[_0x51464a,_0x257232]=useState([]),_0x1dc73f=_0x20f70c['map'](_0x4f7578=>({'label':_0x4f7578[_0x493044(0x6e)],'path':_0x4f7578[_0x493044(0x6f)],'local':!![],'online':_0x2c2c2a[_0x493044(0x87)](_0x4f7578[_0x493044(0x6f)])})),_0x3f518b=_0x20f70c[_0x493044(0x83)](_0x353366=>{const _0x96f983=_0x493044;return!_0x2c2c2a[_0x96f983(0x87)](_0x353366[_0x96f983(0x6f)]);});useEffect(()=>{const _0x4b10fd=_0x493044;if(!_0xa9295e&&_0x20f70c[_0x4b10fd(0xa3)]>0x0&&_0x4c2101[_0x4b10fd(0x6a)]===0x0){const _0x222d1b=new Set(_0x20f70c['map']((_0x4046bb,_0x34e2fd)=>({'page':_0x4046bb,'index':_0x34e2fd}))['filter'](({page:_0x292119})=>!_0x2c2c2a[_0x4b10fd(0x87)](_0x292119[_0x4b10fd(0x6f)]))['map'](({index:_0x3dd091})=>_0x3dd091));_0xcb1dc1(_0x222d1b);}},[_0xa9295e,_0x20f70c[_0x493044(0xa3)],_0x2c2c2a['length']]),useInput(async(_0x6e46f1,_0x24e864)=>{const _0x130873=_0x493044;if(_0x471350===_0x130873(0x65)){if(_0x24e864[_0x130873(0xa4)]){_0x51610a(_0x50a610=>_0x50a610>0x0?_0x50a610-0x1:_0x20f70c[_0x130873(0xa3)]-0x1);return;}if(_0x24e864[_0x130873(0x8d)]){_0x51610a(_0x43cf22=>_0x43cf22<_0x20f70c['length']-0x1?_0x43cf22+0x1:0x0);return;}if(_0x6e46f1==='\x20'){_0xcb1dc1(_0x52e3a3=>{const _0x5ad292=_0x130873,_0x1c314b=new Set(_0x52e3a3);return _0x1c314b[_0x5ad292(0x67)](_0x35c675)?_0x1c314b[_0x5ad292(0x9a)](_0x35c675):_0x1c314b[_0x5ad292(0x98)](_0x35c675),_0x1c314b;});return;}if(_0x6e46f1==='a'||_0x6e46f1==='A'){const _0x1972ae=new Set(_0x20f70c[_0x130873(0x74)]((_0x14beb3,_0x151073)=>_0x151073));_0xcb1dc1(_0x1972ae);return;}if(_0x6e46f1==='i'||_0x6e46f1==='I'||_0x6e46f1==='r'||_0x6e46f1==='R'){_0xcb1dc1(_0x5a41fd=>{const _0x1e41e8=_0x130873,_0x417cea=new Set();for(let _0x1782b0=0x0;_0x1782b0<_0x20f70c[_0x1e41e8(0xa3)];_0x1782b0++){!_0x5a41fd['has'](_0x1782b0)&&_0x417cea[_0x1e41e8(0x98)](_0x1782b0);}return _0x417cea;});return;}if(_0x6e46f1==='q'||_0x6e46f1==='Q'){_0x3c46ae();return;}if(_0x24e864[_0x130873(0x8b)]){if(_0x4c2101[_0x130873(0x6a)]===0x0){_0x472ac9(_0x130873(0x71));return;}const _0x59064d=_0x20f70c[_0x130873(0x83)]((_0x30badd,_0x184138)=>_0x4c2101['has'](_0x184138)),_0x3d031f=_0x59064d[_0x130873(0x74)](_0x3ac449=>_0x3ac449[_0x130873(0x6e)])[_0x130873(0xa2)](',\x20');_0x257232([{'label':_0x130873(0x9c),'value':_0x4c2101[_0x130873(0x6a)]+'\x20个'}]),_0x472ac9(''),_0x2665cd(_0x130873(0x95));return;}return;}if(_0x471350===_0x130873(0x95)){if(_0x24e864[_0x130873(0x8b)]){const _0x55fa7f=_0x19155a['trim']();if(_0x55fa7f==='')return;if(!isValidJsHttpsUrl(_0x55fa7f)){_0x472ac9(_0x130873(0x96));return;}if(!await isUrlReachable(_0x55fa7f)){_0x472ac9(_0x130873(0x70));return;}_0x245083(_0x55fa7f),_0x257232(_0x1bf3ce=>[..._0x1bf3ce,{'label':_0x130873(0x7c),'value':_0x55fa7f}]),_0x40073f(''),_0x472ac9(''),_0x2665cd('input-css');return;}if(_0x24e864['backspace']||_0x24e864[_0x130873(0x9a)]){_0x40073f(_0x2ce71f=>_0x2ce71f[_0x130873(0x99)](0x0,-0x1)),_0x472ac9('');return;}_0x40073f(_0x27bd00=>_0x27bd00+_0x6e46f1);return;}if(_0x471350===_0x130873(0xa7)){if(_0x24e864['return']){const _0x2afb59=_0x19155a[_0x130873(0x8e)]();if(_0x2afb59==='')return;if(!isValidCssHttpsUrl(_0x2afb59)){_0x472ac9('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x2afb59)){_0x472ac9(_0x130873(0x93));return;}_0x4f0aaa(_0x2afb59),_0x257232(_0x1e751b=>[..._0x1e751b,{'label':_0x130873(0xab),'value':_0x2afb59}]),_0x40073f(''),_0x472ac9(''),_0x2665cd('creating');const _0x4e30f1=_0x20f70c['filter']((_0x5606f5,_0x5add24)=>_0x4c2101[_0x130873(0x67)](_0x5add24));createMenus(_0x4e30f1,[_0x3cfd66,_0x2afb59])[_0x130873(0x68)](()=>{const _0x36733d=_0x130873;_0x2665cd(_0x36733d(0x94)),setTimeout(()=>{_0x3c46ae();},0x3e8);})[_0x130873(0x82)](_0x405563=>{const _0x5d5e56=_0x130873;_0x472ac9(_0x405563[_0x5d5e56(0xaa)]||_0x5d5e56(0x89)),_0x2665cd(_0x5d5e56(0x65));});return;}if(_0x24e864[_0x130873(0xa9)]||_0x24e864[_0x130873(0x9a)]){_0x40073f(_0x3e28e8=>_0x3e28e8['slice'](0x0,-0x1)),_0x472ac9('');return;}_0x40073f(_0x1d56c5=>_0x1d56c5+_0x6e46f1);return;}});if(_0xa9295e)return a10_0x5e00ff(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0xaf898e(Text,{'children':'\x20\x20'}),a10_0xaf898e(a10_0xbdf26f,{'type':'dots'}),a10_0xaf898e(Text,{'children':_0x493044(0x9b)})]});if(_0x3b0117)return a10_0x5e00ff(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x5e00ff(Text,{'color':_0x493044(0x8f),'children':['✗\x20',_0x3b0117]}),a10_0x5e00ff(Box,{'marginTop':0x1,'children':[a10_0xaf898e(Text,{'color':'gray','children':'提示:使用\x20'}),a10_0xaf898e(Text,{'color':'cyan','children':_0x493044(0x73)}),a10_0xaf898e(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x20f70c['length']===0x0)return a10_0xaf898e(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0xaf898e(Text,{'color':_0x493044(0x7a),'children':_0x493044(0x76)})});return a10_0x5e00ff(Box,{'flexDirection':_0x493044(0x6d),'marginTop':0x1,'marginBottom':0x1,'children':[_0x471350==='selecting'&&a10_0x5e00ff(a10_0x156c06,{'children':[a10_0x5e00ff(Box,{'children':[a10_0x5e00ff(Text,{'bold':!![],'children':['\x20\x20','菜单名称',getRemainingSpaces(_0x38437a,_0x493044(0x7b))]}),a10_0x5e00ff(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x41d814,_0x493044(0x7b))]}),a10_0x5e00ff(Text,{'bold':!![],'children':[_0x493044(0x88),getRemainingSpaces(_0x41d814,'菜单名称')]})]}),_0x1dc73f[_0x493044(0x74)](_0x388c31=>a10_0x5e00ff(Box,{'children':[a10_0x5e00ff(Text,{'children':['\x20\x20',_0x388c31[_0x493044(0x6e)],getRemainingSpaces(_0x38437a,_0x388c31[_0x493044(0x6e)])]}),a10_0x5e00ff(Text,{'color':_0x493044(0x92),'children':[_0x388c31['local']?'✓':'✗',getRemainingSpaces(_0x41d814,'✓')]}),a10_0x5e00ff(Text,{'color':_0x388c31['online']?'green':_0x493044(0x8f),'children':[_0x388c31[_0x493044(0x72)]?'✓':'✗',getRemainingSpaces(_0x41d814,'✓')]})]},_0x388c31['path']))]}),_0x471350===_0x493044(0x65)&&_0x51464a[_0x493044(0xa3)]===0x0&&a10_0xaf898e(Box,{'marginTop':0x1,'children':a10_0xaf898e(Text,{'color':_0x493044(0x6b),'children':_0x493044(0x7e)})}),_0x51464a['map']((_0x1b1e1b,_0x360791)=>a10_0x5e00ff(Box,{'children':[a10_0x5e00ff(Text,{'color':_0x493044(0x92),'children':['√\x20',_0x1b1e1b[_0x493044(0x6e)],':\x20']}),a10_0xaf898e(Text,{'color':_0x493044(0x6b),'children':_0x1b1e1b[_0x493044(0x75)]})]},_0x360791)),_0x35ed6c&&_0x471350===_0x493044(0x65)&&a10_0xaf898e(Box,{'marginTop':0x1,'children':a10_0x5e00ff(Text,{'color':_0x493044(0x8f),'children':['✗\x20',_0x35ed6c]})}),_0x471350==='selecting'&&a10_0xaf898e(a10_0x156c06,{'children':a10_0x5e00ff(Box,{'marginTop':_0x51464a['length']>0x0||_0x35ed6c?0x1:0x0,'flexDirection':'column','children':[a10_0xaf898e(Text,{'bold':!![],'children':_0x493044(0x81)}),_0x20f70c[_0x493044(0x74)]((_0x3e4d69,_0x7c60e3)=>{const _0x2aea3a=_0x493044,_0x4da18b=_0x35c675===_0x7c60e3,_0x2a7efd=_0x4c2101[_0x2aea3a(0x67)](_0x7c60e3),_0x5c9d71=_0x2c2c2a[_0x2aea3a(0x87)](_0x3e4d69['path']),_0x37124d=_0x5c9d71?'更新':'新建';return a10_0xaf898e(Box,{'children':a10_0x5e00ff(Text,{'backgroundColor':_0x4da18b?_0x2aea3a(0x9f):undefined,'color':_0x4da18b?'white':undefined,'children':['\x20\x20',_0x2a7efd?_0x2aea3a(0xa8):'[\x20]','\x20',_0x3e4d69[_0x2aea3a(0x6e)]]})},_0x3e4d69['path']);}),a10_0xaf898e(Box,{'marginTop':0x1,'children':a10_0x5e00ff(Text,{'color':'gray','children':['\x20',_0x493044(0x78)]})})]})}),_0x471350===_0x493044(0x95)&&a10_0x5e00ff(a10_0x156c06,{'children':[a10_0x5e00ff(Box,{'children':[a10_0xaf898e(Text,{'children':_0x493044(0x85)}),a10_0xaf898e(Text,{'color':'green','children':_0x19155a}),_0x35ed6c&&a10_0x5e00ff(Text,{'color':'red','children':['\x20←\x20',_0x35ed6c]})]}),!_0x35ed6c&&a10_0xaf898e(Box,{'children':a10_0xaf898e(Text,{'color':_0x493044(0x97),'children':_0x493044(0x9d)})})]}),_0x471350===_0x493044(0xa7)&&a10_0x5e00ff(a10_0x156c06,{'children':[a10_0x5e00ff(Box,{'children':[a10_0xaf898e(Text,{'children':_0x493044(0x9e)}),a10_0xaf898e(Text,{'color':_0x493044(0x92),'children':_0x19155a}),_0x35ed6c&&a10_0x5e00ff(Text,{'color':_0x493044(0x8f),'children':[_0x493044(0x91),_0x35ed6c]})]}),!_0x35ed6c&&a10_0xaf898e(Box,{'children':a10_0xaf898e(Text,{'color':_0x493044(0x97),'children':_0x493044(0x90)})})]}),_0x471350==='creating'&&a10_0xaf898e(Box,{'children':a10_0xaf898e(Text,{'children':_0x493044(0xa6)})}),_0x471350===_0x493044(0x94)&&a10_0xaf898e(Box,{'children':a10_0xaf898e(Text,{'color':_0x493044(0x92),'children':_0x493044(0x79)})})]});}function getStringWidth(_0x5d814e){let _0x1e3a39=0x0;for(const _0x8b4d69 of _0x5d814e){/[\u4e00-\u9fa5]/['test'](_0x8b4d69)?_0x1e3a39+=0x2:_0x1e3a39+=0x1;}return _0x1e3a39;}function getRemainingSpaces(_0x4dce54,_0x426b51){const _0x2aabde=a10_0x37eb,_0x1ab5cc=getStringWidth(_0x426b51);return Array(Math[_0x2aabde(0x7d)](0x0,_0x4dce54-_0x1ab5cc))[_0x2aabde(0x66)]('\x20')[_0x2aabde(0xa2)]('');}function getMaxWidth(_0x457f34,_0x174844=0x2){const _0x7ac52b=a10_0x37eb;let _0xc14014='',_0x28eb91=0x0;for(const _0x2c1d59 of _0x457f34){const _0x1b7d71=getStringWidth(_0x2c1d59);_0x1b7d71>_0x28eb91&&(_0x28eb91=_0x1b7d71,_0xc14014=_0x2c1d59);}return _0xc14014+'\x20'[_0x7ac52b(0x80)](_0x174844);}
|