@lovrabet/cli 1.1.26-beta.2 → 1.1.26-beta.4
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(_0x4ca21c,_0xf5d083){const _0x313747=a0_0x5bc9,_0x308d70=_0x4ca21c();while(!![]){try{const _0x5753c9=parseInt(_0x313747(0x105))/0x1+parseInt(_0x313747(0x109))/0x2+parseInt(_0x313747(0x10a))/0x3*(-parseInt(_0x313747(0x106))/0x4)+-parseInt(_0x313747(0x10e))/0x5+-parseInt(_0x313747(0x103))/0x6*(parseInt(_0x313747(0xf6))/0x7)+-parseInt(_0x313747(0xff))/0x8*(parseInt(_0x313747(0xf5))/0x9)+parseInt(_0x313747(0xfe))/0xa*(parseInt(_0x313747(0x10d))/0xb);if(_0x5753c9===_0xf5d083)break;else _0x308d70['push'](_0x308d70['shift']());}catch(_0x23523d){_0x308d70['push'](_0x308d70['shift']());}}}(a0_0x5e99,0xc2c4f));import{jsx as a0_0x4895b0,jsxs as a0_0x554e8e}from'react/jsx-runtime';import{useState}from'react';function a0_0x5bc9(_0x229740,_0x546f11){const _0x5e9909=a0_0x5e99();return a0_0x5bc9=function(_0x5bc91a,_0x1ce9bb){_0x5bc91a=_0x5bc91a-0xf1;let _0x4464f5=_0x5e9909[_0x5bc91a];return _0x4464f5;},a0_0x5bc9(_0x229740,_0x546f11);}import{Text,Box,useInput}from'ink';import a0_0x2d2f67 from'node:fs';export function InputProjectCode(_0x3f3fe6){const _0x16b2eb=a0_0x5bc9,{onSubmit:_0x53c065,pagePath:_0x56bda5}=_0x3f3fe6,[_0x39ae9b,_0x52217f]=useState(''),[_0x2f5c8e,_0x5658d4]=useState(''),_0x4f4b84='my-page';function _0x4c6d84(_0x35e9f7){const _0x1d8255=a0_0x5bc9;if(_0x35e9f7[_0x1d8255(0x10c)]>0x64)return{'valid':![],'message':_0x1d8255(0xf7)};if(_0x35e9f7[_0x1d8255(0x10b)]('/')||_0x35e9f7['endsWith']('/'))return{'valid':![],'message':_0x1d8255(0xf4)};if(_0x35e9f7[_0x1d8255(0xf1)]('//'))return{'valid':![],'message':_0x1d8255(0xfa)};const _0x264a36=_0x35e9f7['split']('/');for(const _0x20220a of _0x264a36){if(!_0x20220a)continue;const _0x49cae3=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x49cae3['test'](_0x20220a))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x4a6806,_0x1071fd)=>{const _0x2b3de9=a0_0x5bc9;if(_0x1071fd[_0x2b3de9(0x102)]){const _0x4ffbd3=_0x39ae9b['trim']()||_0x4f4b84;if(_0x2f5c8e)return;const _0x22d94e=_0x56bda5+'/'+_0x4ffbd3;if(a0_0x2d2f67[_0x2b3de9(0x10f)](_0x22d94e)){_0x5658d4(_0x2b3de9(0xf9)+_0x4ffbd3+'\x20已存在,请使用其他路径');return;}_0x53c065(_0x4ffbd3),_0x52217f(''),_0x5658d4('');}else _0x1071fd[_0x2b3de9(0x100)]||_0x1071fd['delete']?_0x52217f(_0x1e9f81=>{const _0x2915c1=_0x2b3de9,_0x47bc93=_0x1e9f81[_0x2915c1(0xfd)](0x0,-0x1),{valid:_0x1b1cd1,message:_0x41c472}=_0x4c6d84(_0x47bc93);return _0x5658d4(_0x1b1cd1?'':_0x41c472||_0x2915c1(0xfc)),_0x47bc93;}):_0x52217f(_0x353a3f=>{const _0x127d4e=_0x2b3de9,_0x3f7d31=_0x353a3f+_0x4a6806,{valid:_0x32ac1d,message:_0x52c50a}=_0x4c6d84(_0x3f7d31);return _0x5658d4(_0x32ac1d?'':_0x52c50a||_0x127d4e(0xfc)),_0x3f7d31;});}),a0_0x554e8e(Box,{'flexDirection':_0x16b2eb(0x107),'children':[a0_0x554e8e(Box,{'children':[a0_0x4895b0(Text,{'color':'gray','children':_0x16b2eb(0x104)}),a0_0x4895b0(Text,{'children':_0x16b2eb(0xfb)}),_0x39ae9b?a0_0x4895b0(Text,{'color':_0x16b2eb(0x101),'children':_0x39ae9b}):a0_0x4895b0(Text,{'color':_0x16b2eb(0x108),'children':_0x4f4b84}),_0x2f5c8e&&a0_0x554e8e(Text,{'color':_0x16b2eb(0xf3),'children':[_0x16b2eb(0xf8),_0x2f5c8e]})]}),!_0x2f5c8e&&!_0x39ae9b&&a0_0x4895b0(Box,{'children':a0_0x4895b0(Text,{'color':_0x16b2eb(0x108),'children':_0x16b2eb(0xf2)})})]});}function a0_0x5e99(){const _0x2fefeb=['页面路由地址:\x20','页面路径不合法','slice','10XwGslr','8MUgPGE','backspace','green','return','129282qBrDtQ','\x20Step2:\x20','1282941zQgftO','6357080CSlmXC','column','gray','1273542xxZjBD','3jFLbEy','startsWith','length','33339515PErBLl','5363180SEXImj','existsSync','includes','\x20直接回车确认,或输入自定义路由地址','red','路径不能以\x20/\x20开头或结尾','10897065VtRnNs','91KmwYdD','页面路径长度不能超过\x20100\x20个字符','\x20←\x20','页面路径\x20','路径不能包含连续的\x20/'];a0_0x5e99=function(){return _0x2fefeb;};return a0_0x5e99();}
|
package/lib/add-page/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a1_0x136c09=a1_0x124f;(function(_0x1e6f18,_0xf5289a){const _0x2020fa=a1_0x124f,_0x52bdad=_0x1e6f18();while(!![]){try{const _0x1b6be1=-parseInt(_0x2020fa(0x7d))/0x1+-parseInt(_0x2020fa(0x8b))/0x2+parseInt(_0x2020fa(0x70))/0x3+parseInt(_0x2020fa(0x72))/0x4*(-parseInt(_0x2020fa(0x86))/0x5)+parseInt(_0x2020fa(0x78))/0x6*(-parseInt(_0x2020fa(0x8a))/0x7)+parseInt(_0x2020fa(0x7f))/0x8+parseInt(_0x2020fa(0x74))/0x9*(parseInt(_0x2020fa(0x76))/0xa);if(_0x1b6be1===_0xf5289a)break;else _0x52bdad['push'](_0x52bdad['shift']());}catch(_0x25f6eb){_0x52bdad['push'](_0x52bdad['shift']());}}}(a1_0xde80,0x2a9cb));import{jsx as a1_0x378527,jsxs as a1_0x3688d9,Fragment as a1_0x32d6f8}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x356f03 from'node:path';import{useEffect,useState}from'react';function a1_0xde80(){const _0x147b22=['635524ebxviB','页面添加失败:\x20','gray','url','src','join','\x20Step1:\x20','页面添加成功:\x20','已输入的页面路由\x20','开始添加页面:\x20','setLogPath','../../templates/pages','408354oeemBm','已选择页面模板\x20','92BAErgs','catch','592362TPALrK','green','130XVVZxS','now','8682aIiriy','message','pages','cyan','processTemplate','183299GTQAPB','error','1276392HZpXRr','正在创建页面,请稍候…','finally','add-page','\x20*\x20路由地址:\x20','success','cwd','65980eJldIz','resolve','\x20Step2:\x20','\x20*\x20页面路径:\x20','833FQhWoY'];a1_0xde80=function(){return _0x147b22;};return a1_0xde80();}function a1_0x124f(_0x16fa33,_0x44d3e8){const _0xde8007=a1_0xde80();return a1_0x124f=function(_0x124f03,_0x1d3497){_0x124f03=_0x124f03-0x65;let _0x5ba2b7=_0xde8007[_0x124f03];return _0x5ba2b7;},a1_0x124f(_0x16fa33,_0x44d3e8);}import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x356f03['dirname'](fileURLToPath(import.meta[a1_0x136c09(0x67)])),pageTemplateDir=a1_0x356f03['resolve'](__dirname,a1_0x136c09(0x6f)),projectDir=process[a1_0x136c09(0x85)]();export const AddPage=()=>{const _0x114e88=a1_0x136c09,{exit:_0x46dd81}=useApp(),[_0x8cbb8c,_0x448876]=useState(''),[_0x54c2be,_0x42bdb4]=useState(''),[_0x538fbd,_0x116eb2]=useState(![]),[_0x1e3b6a,_0x1c89e4]=useState(![]),_0x4b09ad=a1_0x356f03['join'](projectDir,'src',_0x114e88(0x7a)),_0x26e13e=a1_0x356f03[_0x114e88(0x69)](_0x4b09ad,_0x54c2be),_0xd8d7c=a1_0x356f03[_0x114e88(0x69)](_0x114e88(0x68),_0x114e88(0x7a),_0x54c2be);useEffect(()=>{const _0x205aab=_0x114e88,_0x21178d=a1_0x356f03[_0x205aab(0x87)](pageTemplateDir,_0x8cbb8c);if(_0x8cbb8c&&_0x54c2be){_0x116eb2(!![]),logger[_0x205aab(0x6e)](process[_0x205aab(0x85)]());const _0x334358=Date[_0x205aab(0x77)]();logger['info']('add-page',_0x205aab(0x6d)+_0x54c2be,{'template':_0x8cbb8c,'targetPath':_0xd8d7c}),TemplateReplacer[_0x205aab(0x7c)](_0x21178d,a1_0x356f03[_0x205aab(0x69)](_0x4b09ad,_0x54c2be),_0x54c2be,_0x8cbb8c)['then'](()=>{const _0x4b3137=_0x205aab,_0x220eb1=Date[_0x4b3137(0x77)]()-_0x334358;logger[_0x4b3137(0x84)](_0x4b3137(0x82),_0x4b3137(0x6b)+_0x54c2be,_0x220eb1,{'template':_0x8cbb8c,'targetPath':_0xd8d7c,'routePath':_0x54c2be}),_0x1c89e4(!![]);})[_0x205aab(0x73)](_0xa7c594=>{const _0x351b6e=_0x205aab,_0x2cd4e6=Date[_0x351b6e(0x77)]()-_0x334358;logger[_0x351b6e(0x7e)](_0x351b6e(0x82),_0x351b6e(0x65)+_0x54c2be,{'template':_0x8cbb8c,'targetPath':_0xd8d7c,'error':_0xa7c594 instanceof Error?_0xa7c594[_0x351b6e(0x79)]:String(_0xa7c594),'duration':_0x2cd4e6});})[_0x205aab(0x81)](()=>{_0x116eb2(![]);});}},[_0x8cbb8c,_0x54c2be]),useEffect(()=>{_0x1e3b6a&&setTimeout(()=>{_0x46dd81();});},[_0x1e3b6a]);if(_0x8cbb8c)return a1_0x3688d9(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x6a)}),a1_0x378527(Text,{'children':_0x114e88(0x71)}),a1_0x378527(Text,{'color':'green','children':_0x8cbb8c})]}),_0x54c2be?a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x88)}),a1_0x378527(Text,{'children':_0x114e88(0x6c)}),a1_0x378527(Text,{'color':_0x114e88(0x75),'children':_0x54c2be})]}):a1_0x378527(InputProjectCode,{'pagePath':_0x26e13e,'onSubmit':_0x42bdb4}),_0x54c2be&&_0x538fbd?a1_0x3688d9(Box,{'marginTop':0x1,'children':[a1_0x378527(Box,{'width':'4'}),a1_0x378527(Text,{'children':_0x114e88(0x80)})]}):null,_0x1e3b6a?a1_0x3688d9(a1_0x32d6f8,{'children':[a1_0x378527(Box,{'marginTop':0x1,'children':a1_0x378527(Text,{'color':_0x114e88(0x66),'children':'\x20*\x20页面创建成功!'})}),a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x89)}),a1_0x378527(Text,{'color':_0x114e88(0x75),'children':_0xd8d7c})]}),a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x83)}),a1_0x3688d9(Text,{'color':_0x114e88(0x75),'children':['/',_0x54c2be]})]}),a1_0x378527(Box,{'marginTop':0x1,'children':a1_0x378527(Text,{'color':_0x114e88(0x7b),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x378527(SelectPageTemplate,{'onSelect':_0x448876});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1f2fb6,_0x437d72){const _0x307b80=a2_0x5af8,_0x103bf6=_0x1f2fb6();while(!![]){try{const _0x1ef944=parseInt(_0x307b80(0x1d4))/0x1+-parseInt(_0x307b80(0x1d7))/0x2+-parseInt(_0x307b80(0x1db))/0x3*(-parseInt(_0x307b80(0x1d6))/0x4)+parseInt(_0x307b80(0x1d0))/0x5*(parseInt(_0x307b80(0x1ca))/0x6)+-parseInt(_0x307b80(0x1be))/0x7+parseInt(_0x307b80(0x1c0))/0x8*(parseInt(_0x307b80(0x1c6))/0x9)+parseInt(_0x307b80(0x1c2))/0xa*(-parseInt(_0x307b80(0x1c5))/0xb);if(_0x1ef944===_0x437d72)break;else _0x103bf6['push'](_0x103bf6['shift']());}catch(_0x3c4c4d){_0x103bf6['push'](_0x103bf6['shift']());}}}(a2_0x49e1,0xa75cd));import{jsx as a2_0x189819,jsxs as a2_0x295cb7}from'react/jsx-runtime';function a2_0x5af8(_0x49c943,_0x19fd4f){const _0x49e111=a2_0x49e1();return a2_0x5af8=function(_0x5af884,_0x183f43){_0x5af884=_0x5af884-0x1b8;let _0x1c6f7c=_0x49e111[_0x5af884];return _0x1c6f7c;},a2_0x5af8(_0x49c943,_0x19fd4f);}function a2_0x49e1(){const _0x56c2a4=['resolve','sort','localeCompare','2662125PRWSZQ','join','获取模板列表失败:','url','913330pCzOqg','onSelect','595124erwKrR','1134278hHLKEj','请选择您要创建的页面模板','downArrow','\x20\x20\x20\x20\x20\x20>\x20','3ztpATI','\x20\x20\x20\x20\x20\x20\x20\x20','column','length','green','isDirectory','\x20Step1:\x20','2050524paECiT','return','16dfXijd','正在加载页面模板...','12092260UKqPvN','gray','label','11SwJrwt','5221251AAliWz','error','../..','templates/pages','6nevfYQ','blank','filter'];a2_0x49e1=function(){return _0x56c2a4;};return a2_0x49e1();}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x56c14e from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x12e614=a2_0x5af8;try{const _0x3f6d98=fileURLToPath(import.meta[_0x12e614(0x1d3)]),_0x2a352b=a2_0x56c14e[_0x12e614(0x1cd)](a2_0x56c14e['dirname'](_0x3f6d98),_0x12e614(0x1c8)),_0x3092ff=a2_0x56c14e[_0x12e614(0x1d1)](_0x2a352b,_0x12e614(0x1c9)),_0x2bad97=await readdir(_0x3092ff,{'withFileTypes':!![]}),_0x404056=_0x2bad97[_0x12e614(0x1cc)](_0x3917ad=>_0x3917ad[_0x12e614(0x1bc)]())['map'](_0x27d562=>({'label':_0x27d562['name']}))[_0x12e614(0x1ce)]((_0x1c89ed,_0x21d2cc)=>_0x1c89ed[_0x12e614(0x1c4)][_0x12e614(0x1cf)](_0x21d2cc['label']));return _0x404056;}catch(_0x4ec7c7){return console[_0x12e614(0x1c7)](_0x12e614(0x1d2),_0x4ec7c7),[{'label':_0x12e614(0x1cb)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x3830d8){const _0x26aace=a2_0x5af8,[_0x525559,_0x4a55a4]=useState(0x0),[_0x2fcfb0,_0x480c1c]=useState([]),[_0x3382fa,_0x36d45b]=useState(!![]);useEffect(()=>{async function _0x2c28ed(){const _0x34ef56=await getTemplateList();_0x480c1c(_0x34ef56),_0x36d45b(![]);}_0x2c28ed();},[]),useInput((_0x4b13d4,_0x53fab8)=>{const _0x35e209=a2_0x5af8;if(_0x3382fa)return;if(_0x53fab8[_0x35e209(0x1bf)]){const _0x599a68=_0x2fcfb0[_0x525559];_0x599a68&&_0x3830d8[_0x35e209(0x1d5)](_0x599a68[_0x35e209(0x1c4)]);}_0x53fab8['upArrow']&&_0x4a55a4(_0x12b5fc=>_0x12b5fc===0x0?_0x2fcfb0[_0x35e209(0x1ba)]-0x1:_0x12b5fc-0x1),_0x53fab8[_0x35e209(0x1d9)]&&_0x4a55a4(_0x4062d7=>_0x4062d7===_0x2fcfb0[_0x35e209(0x1ba)]-0x1?0x0:_0x4062d7+0x1);});if(_0x3382fa)return a2_0x189819(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0x295cb7(Box,{'children':[a2_0x189819(Text,{'color':'gray','children':_0x26aace(0x1bd)}),a2_0x189819(Text,{'children':_0x26aace(0x1c1)})]})});return a2_0x295cb7(Box,{'flexDirection':_0x26aace(0x1b9),'paddingY':0x1,'children':[a2_0x295cb7(Box,{'children':[a2_0x189819(Text,{'color':_0x26aace(0x1c3),'children':_0x26aace(0x1bd)}),a2_0x189819(Text,{'children':_0x26aace(0x1d8)})]}),_0x2fcfb0['map']((_0x4e94f4,_0x96096)=>{const _0x5851db=_0x26aace,_0x28b41f=_0x96096===_0x525559,_0x2b5046=_0x28b41f?_0x5851db(0x1da)+_0x4e94f4[_0x5851db(0x1c4)]:_0x5851db(0x1b8)+_0x4e94f4[_0x5851db(0x1c4)];return a2_0x189819(Box,{'children':a2_0x189819(Text,{'color':_0x28b41f?_0x5851db(0x1bb):undefined,'children':_0x2b5046})},_0x2b5046);})]});}
|
package/lib/api/api-doc-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1bef4a,_0x31b9e1){const _0x3bc69c=a3_0x54b0,_0x165e09=_0x1bef4a();while(!![]){try{const _0x313756=parseInt(_0x3bc69c(0x124))/0x1+-parseInt(_0x3bc69c(0x15b))/0x2*(-parseInt(_0x3bc69c(0x120))/0x3)+parseInt(_0x3bc69c(0x158))/0x4+-parseInt(_0x3bc69c(0x150))/0x5+-parseInt(_0x3bc69c(0x131))/0x6*(parseInt(_0x3bc69c(0x149))/0x7)+parseInt(_0x3bc69c(0x13d))/0x8*(parseInt(_0x3bc69c(0x151))/0x9)+parseInt(_0x3bc69c(0x136))/0xa*(-parseInt(_0x3bc69c(0x13a))/0xb);if(_0x313756===_0x31b9e1)break;else _0x165e09['push'](_0x165e09['shift']());}catch(_0x4f9e7f){_0x165e09['push'](_0x165e09['shift']());}}}(a3_0x1075,0x974b4));import{jsx as a3_0x23b80f,jsxs as a3_0xb76d19,Fragment as a3_0x7b863}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a3_0x54b0(_0xf89cba,_0x5daa01){const _0x1075ad=a3_0x1075();return a3_0x54b0=function(_0x54b097,_0x19dc4e){_0x54b097=_0x54b097-0x120;let _0x281a85=_0x1075ad[_0x54b097];return _0x281a85;},a3_0x54b0(_0xf89cba,_0x5daa01);}import{initEnv}from'../constant/env.js';function a3_0x1075(){const _0x4a1e90=['datasetCode','🚀\x20','1183651Msuqti','dim','\x20-\x20','success','文档生成失败:\x20','使用配置的应用AppCode:\x20','💡\x20请使用\x20','3544345GSdOiu','6390EIGBtz','log','gray','length','error','white','online','3274896sNfGuK','\x1b[0m','\x1b[33m!\x20以下数据集代码不存在:\x20','8Qpxxxq','300732AkiaNu','未提供应用AppCode,且配置中也没有默认值','red','setLogPath','1040930QqpNkc','\x20个数据集中筛选出\x20','column','正在生成\x20','string','*\x20生成的文档文件:','指定的数据集代码都不存在:\x20','map','文档生成完成','green','join','\x20个匹配的数据集\x1b[0m','./docs','12bkawsw','yellow',',\x20失败\x20','未找到任何数据集','\x20重新登录后再试','42650KDxOeP','api-doc','\x20个数据集','.md\x20(','2255HnbZAV','lovrabet\x20auth','filePath','3160gsgjuv','filter','includes','√\x20文档生成完成!成功\x20','cyan','\x20个数据集的文档...','\x20(环境:\x20','*\x20输出目录:\x20','env','cwd'];a3_0x1075=function(){return _0x4a1e90;};return a3_0x1075();}import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x52739c,env:_0x37a566,output:_0x1a57e0,extraParams:_0x3e65fc,datasetCodes:_0x3edc3a})=>{const _0x354654=a3_0x54b0,{exit:_0x22e44c}=useApp(),[_0x40204e,_0x12528b]=useState(![]),[_0x543b29,_0x27f5c1]=useState(''),[_0x220a22,_0x16808c]=useState(![]),[_0x4105f6,_0x2cdbac]=useState(null),[_0x445ed2,_0x2f7d1b]=useState(null),[_0x3e003e,_0x4c7c0e]=useState(0x0),_0x249e0b=readConfig(),_0x2485e1=getConfigAppCode(),_0x1108bd=_0x52739c||_0x2485e1,_0x5e6ca6=typeof _0x249e0b?.[_0x354654(0x145)]===_0x354654(0x128)?_0x249e0b[_0x354654(0x145)]:undefined,_0x13c052=_0x37a566||_0x5e6ca6||_0x354654(0x157);initEnv(_0x13c052);const _0x9e722a=_0x1a57e0||_0x354654(0x130),_0x4e4d90=_0x52739c?'使用指定的应用AppCode:\x20'+_0x1108bd:_0x354654(0x14e)+_0x1108bd;useEffect(()=>{_0x12528b(!![]),_0x2059c6();},[]),useEffect(()=>{(_0x220a22||_0x4105f6)&&_0x22e44c();},[_0x220a22,_0x4105f6,_0x22e44c]);async function _0x2059c6(){const _0x155283=_0x354654;if(!_0x1108bd){_0x2cdbac(_0x155283(0x121));return;}try{logger[_0x155283(0x123)](process[_0x155283(0x146)]()),_0x27f5c1('正在获取数据集列表...');const {configArray:_0x3f1b36}=await fetchModelList(_0x1108bd);_0x4c7c0e(_0x3f1b36['length']);if(_0x3f1b36[_0x155283(0x154)]===0x0){_0x2cdbac(_0x155283(0x134));return;}let _0x41aa3b=_0x3f1b36;if(_0x3edc3a&&_0x3edc3a[_0x155283(0x154)]>0x0){_0x41aa3b=_0x3f1b36[_0x155283(0x13e)](_0x34f11d=>_0x3edc3a[_0x155283(0x13f)](_0x34f11d[_0x155283(0x147)]));const _0x13faa7=_0x41aa3b[_0x155283(0x12b)](_0x351340=>_0x351340[_0x155283(0x147)]),_0x5beb36=_0x3edc3a[_0x155283(0x13e)](_0x4e2796=>!_0x13faa7[_0x155283(0x13f)](_0x4e2796));_0x5beb36[_0x155283(0x154)]>0x0&&console[_0x155283(0x152)](_0x155283(0x15a)+_0x5beb36[_0x155283(0x12e)](',\x20')+_0x155283(0x159));if(_0x41aa3b[_0x155283(0x154)]===0x0){_0x2cdbac(_0x155283(0x12a)+_0x3edc3a[_0x155283(0x12e)](',\x20'));return;}console[_0x155283(0x152)]('\x1b[90m*\x20从\x20'+_0x3f1b36[_0x155283(0x154)]+_0x155283(0x125)+_0x41aa3b['length']+_0x155283(0x12f));}_0x27f5c1(_0x155283(0x127)+_0x41aa3b[_0x155283(0x154)]+_0x155283(0x142));const _0x1e01cb=await generateDatasetDocs(_0x41aa3b,_0x1108bd,_0x9e722a,(_0x307f93,_0x3f3114,_0x50b302)=>{const _0x28b1b6=_0x155283;_0x27f5c1(_0x28b1b6(0x127)+_0x50b302+_0x28b1b6(0x139)+_0x307f93+'/'+_0x3f3114+')');},_0x3e65fc);_0x2f7d1b(_0x1e01cb),_0x16808c(!![]);const _0x2d4040=_0x1e01cb[_0x155283(0x13e)](_0x61bd4d=>_0x61bd4d[_0x155283(0x14c)])[_0x155283(0x154)],_0x2c2ed3=_0x1e01cb[_0x155283(0x13e)](_0x46afcf=>!_0x46afcf[_0x155283(0x14c)])[_0x155283(0x154)];logger['success']('api-doc',_0x155283(0x12c),undefined,{'totalCount':_0x1e01cb[_0x155283(0x154)],'successCount':_0x2d4040,'failCount':_0x2c2ed3,'outputDir':_0x9e722a});}catch(_0x40ab5c){const _0x23653b=_0x40ab5c instanceof Error?_0x40ab5c['message']:String(_0x40ab5c);logger[_0x155283(0x155)](_0x155283(0x137),_0x155283(0x14d)+_0x23653b,{'appCode':_0x1108bd,'outputDir':_0x9e722a}),_0x2cdbac(_0x155283(0x14d)+_0x23653b);}finally{_0x12528b(![]);}}const _0x3f9add=_0x445ed2?.['filter'](_0x2ae926=>_0x2ae926[_0x354654(0x14c)])[_0x354654(0x154)]||0x0,_0x257200=_0x445ed2?.[_0x354654(0x13e)](_0xb702cf=>!_0xb702cf[_0x354654(0x14c)])[_0x354654(0x154)]||0x0;return a3_0xb76d19(Box,{'flexDirection':_0x354654(0x126),'children':[(_0x40204e||_0x220a22)&&a3_0xb76d19(Box,{'children':[a3_0x23b80f(Text,{'color':_0x354654(0x153),'children':'*\x20'}),a3_0x23b80f(Text,{'color':_0x52739c?_0x354654(0x156):_0x354654(0x14a),'children':_0x4e4d90})]}),_0x40204e&&a3_0x23b80f(Box,{'children':a3_0xb76d19(Text,{'children':[_0x354654(0x148),_0x543b29,_0x354654(0x143),_0x13c052,')']})}),_0x220a22&&_0x445ed2&&a3_0xb76d19(Box,{'flexDirection':_0x354654(0x126),'children':[a3_0x23b80f(Box,{'children':a3_0xb76d19(Text,{'color':_0x354654(0x12d),'children':[_0x354654(0x140),_0x3f9add,'\x20个',_0x257200>0x0&&_0x354654(0x133)+_0x257200+'\x20个']})}),a3_0x23b80f(Box,{'marginTop':0x1,'children':a3_0xb76d19(Text,{'color':_0x354654(0x153),'children':['*\x20共处理\x20',_0x3e003e,_0x354654(0x138)]})}),a3_0xb76d19(Box,{'marginTop':0x1,'children':[a3_0x23b80f(Text,{'color':'gray','children':_0x354654(0x144)}),a3_0x23b80f(Text,{'color':_0x354654(0x141),'children':_0x9e722a})]}),_0x3f9add>0x0&&a3_0xb76d19(a3_0x7b863,{'children':[a3_0x23b80f(Box,{'marginTop':0x1,'children':a3_0x23b80f(Text,{'color':_0x354654(0x153),'children':_0x354654(0x129)})}),_0x445ed2[_0x354654(0x13e)](_0x456b80=>_0x456b80['success'])[_0x354654(0x12b)]((_0x49e5b8,_0x577d91)=>a3_0xb76d19(Box,{'marginLeft':0x2,'children':[a3_0xb76d19(Text,{'color':'cyan','children':['•\x20',_0x49e5b8[_0x354654(0x13c)]]}),a3_0xb76d19(Text,{'color':'dim','children':[_0x354654(0x14b),_0x49e5b8['datasetName']]})]},_0x577d91))]}),_0x257200>0x0&&a3_0xb76d19(a3_0x7b863,{'children':[a3_0x23b80f(Box,{'marginTop':0x1,'children':a3_0x23b80f(Text,{'color':_0x354654(0x132),'children':'⚠️\x20以下数据集生成失败:'})}),_0x445ed2[_0x354654(0x13e)](_0x52e0a3=>!_0x52e0a3[_0x354654(0x14c)])['map']((_0x56c6b4,_0x43c09f)=>a3_0xb76d19(Box,{'marginLeft':0x2,'flexDirection':_0x354654(0x126),'children':[a3_0xb76d19(Text,{'color':'red','children':['•\x20',_0x56c6b4['datasetName'],'\x20(',_0x56c6b4[_0x354654(0x147)],')']}),_0x56c6b4['error']&&a3_0x23b80f(Box,{'marginLeft':0x2,'children':a3_0x23b80f(Text,{'color':_0x354654(0x14a),'children':_0x56c6b4['error']})})]},_0x43c09f))]})]}),_0x4105f6&&a3_0xb76d19(Box,{'flexDirection':_0x354654(0x126),'children':[a3_0x23b80f(Box,{'children':a3_0xb76d19(Text,{'color':_0x354654(0x122),'children':['❌\x20',_0x4105f6]})}),_0x4105f6[_0x354654(0x13f)]('登录')&&a3_0xb76d19(Box,{'marginTop':0x1,'children':[a3_0x23b80f(Text,{'color':'yellow','children':_0x354654(0x14f)}),a3_0x23b80f(Text,{'color':_0x354654(0x141),'children':_0x354654(0x13b)}),a3_0x23b80f(Text,{'color':_0x354654(0x132),'children':_0x354654(0x135)})]})]})]});};
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a4_0x13dda7=a4_0x2be0;(function(_0x461ab0,_0x338b2c){const _0x53d4bd=a4_0x2be0,_0x378e4c=_0x461ab0();while(!![]){try{const _0x409875=parseInt(_0x53d4bd(0x1ed))/0x1*(-parseInt(_0x53d4bd(0x1e6))/0x2)+-parseInt(_0x53d4bd(0x1f3))/0x3+-parseInt(_0x53d4bd(0x1f0))/0x4+-parseInt(_0x53d4bd(0x1eb))/0x5+-parseInt(_0x53d4bd(0x1fa))/0x6+parseInt(_0x53d4bd(0x1e5))/0x7+-parseInt(_0x53d4bd(0x1ef))/0x8*(-parseInt(_0x53d4bd(0x1e3))/0x9);if(_0x409875===_0x338b2c)break;else _0x378e4c['push'](_0x378e4c['shift']());}catch(_0x19a915){_0x378e4c['push'](_0x378e4c['shift']());}}}(a4_0x273d,0x77760));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x472112 from'node:path';function a4_0x2be0(_0x2f7b6a,_0x418dd9){const _0x273de4=a4_0x273d();return a4_0x2be0=function(_0x2be095,_0x4cec8c){_0x2be095=_0x2be095-0x1df;let _0x433a61=_0x273de4[_0x2be095];return _0x433a61;},a4_0x2be0(_0x2f7b6a,_0x418dd9);}function a4_0x273d(){const _0x48732f=['join','application/json','获取文档失败\x20(','),HTTP状态码:\x20','error','text','✗\x20失败:\x20','响应数据格式错误\x20(','3739509NGKpjr','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','2086630kuWDvO','2qkKorA','生成文档失败:\x20','.md\x20-\x20','\x20个数据集需要生成文档\x0a','data','645980Vwuaxq','log','105548AnkqcX','datasetCode','40OgAwuj','2159492dYYNyx','string','name','801297qxSmAv','等待\x203\x20秒...\x0a','json','✓\x20成功生成:\x20','POST','length','success','5067402nkGxGf','.md\x20(','markdown','./docs','message','push','utf8','\x0a共有\x20',']\x20正在生成:\x20','.md'];a4_0x273d=function(){return _0x48732f;};return a4_0x273d();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x81ee6c){const _0x13ecaf=a4_0x2be0,{appCode:_0x51a02d,datasetCode:_0x5c5b5f,datasetId:_0x177179,extraParams:_0x1fdbe5}=_0x81ee6c,_0x4a51dc=getApiDomain(),_0x42eca4=_0x4a51dc+'/api/node-toolbox/api-doc-generator',_0x3c6f4e={'appCode':_0x51a02d,'datasetCode':_0x5c5b5f,'datasetId':_0x177179,..._0x1fdbe5||{}},_0x11010b=await fetch(_0x42eca4,{'method':_0x13ecaf(0x1f7),'headers':{'Content-Type':_0x13ecaf(0x205),'Cookie':getCookie()},'body':JSON['stringify'](_0x3c6f4e)});if(!_0x11010b['ok']){if(_0x11010b['status']===0x191)throw new Error(_0x13ecaf(0x1e4));let _0x38d5c3='';try{_0x38d5c3=await _0x11010b[_0x13ecaf(0x1e0)]();}catch(_0x21a7e3){}throw new Error(_0x13ecaf(0x206)+_0x5c5b5f+_0x13ecaf(0x207)+_0x11010b['status']+(_0x38d5c3?'\x0a'+_0x38d5c3:''));}const _0x4a9b9a=await _0x11010b[_0x13ecaf(0x1f5)]();if(!_0x4a9b9a[_0x13ecaf(0x1ea)]||typeof _0x4a9b9a[_0x13ecaf(0x1ea)][_0x13ecaf(0x1fc)]!==_0x13ecaf(0x1f1))throw new Error(_0x13ecaf(0x1e2)+_0x5c5b5f+'):缺少\x20data.markdown\x20字段');return _0x4a9b9a[_0x13ecaf(0x1ea)][_0x13ecaf(0x1fc)];}function delay(_0x18e218){return new Promise(_0x235af5=>setTimeout(_0x235af5,_0x18e218));}export async function generateDatasetDocs(_0x13924a,_0x230d48,_0x17ca29=a4_0x13dda7(0x1fd),_0x11892c,_0x51a40b){const _0xfeb2ae=a4_0x13dda7;mkdirSync(_0x17ca29,{'recursive':!![]});const _0x3cd12d=[],_0x26e902=_0x13924a[_0xfeb2ae(0x1f8)];console[_0xfeb2ae(0x1ec)](_0xfeb2ae(0x201)+_0x26e902+_0xfeb2ae(0x1e9));for(let _0x722004=0x0;_0x722004<_0x13924a['length'];_0x722004++){const _0x12b2af=_0x13924a[_0x722004],_0x5a9b44=_0x722004+0x1,_0x5808ac=_0x12b2af['tableName'];try{console[_0xfeb2ae(0x1ec)]('['+_0x5a9b44+'/'+_0x26e902+_0xfeb2ae(0x202)+_0x5808ac+_0xfeb2ae(0x1fb)+_0x12b2af[_0xfeb2ae(0x1f2)]+')');_0x11892c&&_0x11892c(_0x5a9b44,_0x26e902,_0x5808ac);const _0x5e3022=await fetchDatasetDoc({'appCode':_0x230d48,'datasetCode':_0x12b2af[_0xfeb2ae(0x1ee)],'datasetId':_0x12b2af['id'],'enableAI':![],'extraParams':_0x51a40b}),_0x3f0907=a4_0x472112[_0xfeb2ae(0x204)](_0x17ca29,_0x5808ac+'.md');writeFileSync(_0x3f0907,_0x5e3022,{'encoding':_0xfeb2ae(0x200)}),console['log'](_0xfeb2ae(0x1f6)+_0x5808ac+_0xfeb2ae(0x203)),logger[_0xfeb2ae(0x1f9)]('api-doc','生成文档成功:\x20'+_0x5808ac,undefined,{'datasetCode':_0x12b2af['datasetCode'],'datasetName':_0x12b2af['name'],'filePath':_0x3f0907,'progress':_0x5a9b44+'/'+_0x26e902}),_0x3cd12d[_0xfeb2ae(0x1ff)]({'datasetCode':_0x12b2af['datasetCode'],'datasetName':_0x12b2af[_0xfeb2ae(0x1f2)],'filePath':_0x3f0907,'success':!![]}),_0x5a9b44<_0x26e902&&await delay(0x1388);}catch(_0x956e29){const _0x67228d=_0x956e29 instanceof Error?_0x956e29[_0xfeb2ae(0x1fe)]:String(_0x956e29);console[_0xfeb2ae(0x1ec)](_0xfeb2ae(0x1e1)+_0x5808ac+_0xfeb2ae(0x1e8)+_0x67228d+'\x0a'),logger[_0xfeb2ae(0x1df)]('api-doc',_0xfeb2ae(0x1e7)+_0x12b2af['datasetCode'],{'datasetCode':_0x12b2af[_0xfeb2ae(0x1ee)],'datasetName':_0x12b2af['name'],'error':_0x67228d,'progress':_0x5a9b44+'/'+_0x26e902}),_0x3cd12d['push']({'datasetCode':_0x12b2af[_0xfeb2ae(0x1ee)],'datasetName':_0x12b2af[_0xfeb2ae(0x1f2)],'filePath':'','success':![],'error':_0x67228d}),_0x5a9b44<_0x26e902&&(console[_0xfeb2ae(0x1ec)](_0xfeb2ae(0x1f4)),await delay(0xbb8));}}return _0x3cd12d;}
|
package/lib/api/api-pull-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x28c1a1,_0x345f71){const _0x3b8fc5=a5_0x5430,_0x206476=_0x28c1a1();while(!![]){try{const _0x2cf85f=parseInt(_0x3b8fc5(0x123))/0x1+-parseInt(_0x3b8fc5(0x131))/0x2+parseInt(_0x3b8fc5(0x129))/0x3*(-parseInt(_0x3b8fc5(0x105))/0x4)+-parseInt(_0x3b8fc5(0x112))/0x5+parseInt(_0x3b8fc5(0xff))/0x6*(-parseInt(_0x3b8fc5(0x124))/0x7)+parseInt(_0x3b8fc5(0xfc))/0x8*(-parseInt(_0x3b8fc5(0xfe))/0x9)+parseInt(_0x3b8fc5(0x104))/0xa;if(_0x2cf85f===_0x345f71)break;else _0x206476['push'](_0x206476['shift']());}catch(_0x57fdb7){_0x206476['push'](_0x206476['shift']());}}}(a5_0x442e,0x6b65a));function a5_0x5430(_0x4d8849,_0x1f1efc){const _0x442eae=a5_0x442e();return a5_0x5430=function(_0x5430fc,_0xd7769c){_0x5430fc=_0x5430fc-0xfb;let _0x186083=_0x442eae[_0x5430fc];return _0x186083;},a5_0x5430(_0x4d8849,_0x1f1efc);}import{jsx as a5_0x59cac3,jsxs as a5_0x307464}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';function a5_0x442e(){const _0x2038a7=['√\x20成功拉取\x20','originalCount','yellow','white','gray','\x20个数据集,生成','.ts','split','red','\x20from\x20\x27@/','length','拉取\x20API\x20配置失败:\x20','cwd','\x20个模型','cyan','column','725204HeiJAg','14oZWYSJ','env','setLogPath','import\x20','client','2634591XXcoAC','api','*\x20导入方式:','error','使用指定的应用AppCode:\x20','-client','{\x20lovrabetClient\x20}','api-pull','1740692NDjMOL','string','使用配置的应用AppCode:\x20','144WbuWbP','*\x20已生成文件:','383877CoPOgQ','1647402dXZPAE','./src/api/','modelCount','slice','\x20个,过滤重复','33004270AHOUIA','4aLAiad','💡\x20请使用\x20','green','endsWith','!\x20原始数据集\x20','duplicateCount','replace','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','message','dim','includes','-api','\x20个模型)','2601510MULjKF'];a5_0x442e=function(){return _0x2038a7;};return a5_0x442e();}import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x208f66,env:_0x1e51e5,output:_0x4a4eb9})=>{const _0x553019=a5_0x5430,{exit:_0x531dd3}=useApp(),[_0x48be15,_0x5e72e5]=useState(![]),[_0x53809e,_0x57c05a]=useState(![]),[_0x4b802e,_0x875d53]=useState(null),[_0x2cd1d7,_0x49ee72]=useState(null),_0x5d64df=readConfig(),_0x11f9cd=getConfigAppCode(),_0x1e5724=_0x208f66||_0x11f9cd,_0x3578b8=typeof _0x5d64df?.[_0x553019(0x125)]===_0x553019(0x132)?_0x5d64df['env']:undefined,_0x49fd42=_0x1e51e5||_0x3578b8||'online';initEnv(_0x49fd42);const _0x47250d=_0x4a4eb9||_0x553019(0x100),_0x8300de=_0x208f66&&_0x208f66[_0x553019(0x10f)]('-')?_0x208f66[_0x553019(0x11a)]('-')[_0x553019(0x102)](0x1)['join']('-'):'',_0x55c9bb=_0x208f66?_0x553019(0x12d)+_0x1e5724:_0x553019(0xfb)+_0x1e5724,_0xce2d84=_0x8300de?_0x8300de+_0x553019(0x110):_0x553019(0x12a),_0x2a2ba5=_0x8300de?_0x8300de+_0x553019(0x12e):_0x553019(0x128);useEffect(()=>{_0x5e72e5(!![]),_0x8bcb6f();},[]),useEffect(()=>{(_0x53809e||_0x4b802e)&&_0x531dd3();},[_0x53809e,_0x4b802e,_0x531dd3]);async function _0x8bcb6f(){const _0x54302d=_0x553019;if(!_0x1e5724){_0x875d53('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x54302d(0x126)](process[_0x54302d(0x11f)]());const {configArray:_0x2be7c3}=await fetchModelList(_0x1e5724),_0x3bcb4e=_0x2be7c3[_0x54302d(0x11d)],_0x5cd535=!_0x208f66,_0x3b4cd9=await generateApiFile(_0x2be7c3,_0x8300de,_0x1e5724,_0x5cd535,_0x49fd42,_0x47250d),_0x548f2a=_0x47250d[_0x54302d(0x108)]('/')?_0x47250d:_0x47250d+'/';_0x49ee72({'api':''+_0x548f2a+_0xce2d84+_0x54302d(0x119),'client':''+_0x548f2a+_0x2a2ba5+'.ts','modelCount':_0x3b4cd9[_0x54302d(0x101)],'datasetCount':_0x3bcb4e,'originalCount':_0x3bcb4e,'duplicateCount':0x0}),_0x57c05a(!![]);}catch(_0x5ecf40){const _0x37b558=_0x5ecf40 instanceof Error?_0x5ecf40[_0x54302d(0x10d)]:String(_0x5ecf40);logger[_0x54302d(0x12c)](_0x54302d(0x130),_0x54302d(0x11e)+_0x37b558,{'appCode':_0x1e5724,'error':_0x37b558}),_0x875d53(_0x54302d(0x11e)+_0x37b558);}finally{_0x5e72e5(![]);}}return a5_0x307464(Box,{'flexDirection':_0x553019(0x122),'children':[(_0x48be15||_0x53809e)&&a5_0x307464(Box,{'children':[a5_0x59cac3(Text,{'color':_0x553019(0x117),'children':'*\x20'}),a5_0x59cac3(Text,{'color':_0x208f66?_0x553019(0x116):_0x553019(0x10e),'children':_0x55c9bb})]}),_0x48be15&&a5_0x59cac3(Box,{'children':a5_0x307464(Text,{'children':[_0x553019(0x10c),_0x49fd42,')']})}),_0x53809e&&_0x2cd1d7&&a5_0x307464(Box,{'flexDirection':_0x553019(0x122),'children':[a5_0x59cac3(Box,{'children':a5_0x307464(Text,{'color':_0x553019(0x107),'children':[_0x553019(0x113),_0x2cd1d7['datasetCount'],_0x553019(0x118),'\x20',_0x2cd1d7[_0x553019(0x101)],_0x553019(0x120)]})}),_0x2cd1d7[_0x553019(0x10a)]>0x0&&a5_0x59cac3(Box,{'marginTop':0x1,'children':a5_0x307464(Text,{'color':'yellow','children':[_0x553019(0x109),_0x2cd1d7[_0x553019(0x114)],_0x553019(0x103),'\x20',_0x2cd1d7[_0x553019(0x10a)],'\x20个']})}),a5_0x59cac3(Box,{'marginTop':0x1,'children':a5_0x59cac3(Text,{'color':'gray','children':_0x553019(0xfd)})}),a5_0x307464(Box,{'marginLeft':0x2,'children':[a5_0x307464(Text,{'color':_0x553019(0x121),'children':['•\x20',_0x2cd1d7[_0x553019(0x12a)]]}),a5_0x307464(Text,{'color':_0x553019(0x10e),'children':['\x20','-\x20模型配置文件\x20(',_0x2cd1d7[_0x553019(0x101)],_0x553019(0x111)]})]}),a5_0x307464(Box,{'marginLeft':0x2,'children':[a5_0x307464(Text,{'color':'cyan','children':['•\x20',_0x2cd1d7[_0x553019(0x128)]]}),a5_0x59cac3(Text,{'color':_0x553019(0x10e),'children':'\x20-\x20客户端实例文件'})]}),a5_0x59cac3(Box,{'marginTop':0x1,'children':a5_0x59cac3(Text,{'color':_0x553019(0x117),'children':_0x553019(0x12b)})}),a5_0x59cac3(Box,{'marginLeft':0x2,'children':a5_0x307464(Text,{'color':_0x553019(0x115),'children':[_0x553019(0x127),_0x553019(0x12f),_0x553019(0x11c),_0x2cd1d7[_0x553019(0x128)][_0x553019(0x10b)](/^\.\//,'')[_0x553019(0x10b)](_0x553019(0x119),''),'\x27']})})]}),_0x4b802e&&a5_0x307464(Box,{'flexDirection':'column','children':[a5_0x59cac3(Box,{'children':a5_0x307464(Text,{'color':_0x553019(0x11b),'children':['❌\x20',_0x4b802e]})}),_0x4b802e[_0x553019(0x10f)]('登录')&&a5_0x307464(Box,{'marginTop':0x1,'children':[a5_0x59cac3(Text,{'color':_0x553019(0x115),'children':_0x553019(0x106)}),a5_0x59cac3(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a5_0x59cac3(Text,{'color':'yellow','children':'\x20重新登录后再试'})]})]})]});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x455d9a,_0xb5370f){const _0x5e5bdd=a6_0x2d1a,_0x57b596=_0x455d9a();while(!![]){try{const _0x199ef7=parseInt(_0x5e5bdd(0x7c))/0x1*(-parseInt(_0x5e5bdd(0x89))/0x2)+-parseInt(_0x5e5bdd(0x80))/0x3+-parseInt(_0x5e5bdd(0x8b))/0x4+-parseInt(_0x5e5bdd(0x8c))/0x5+-parseInt(_0x5e5bdd(0x86))/0x6+-parseInt(_0x5e5bdd(0x85))/0x7+parseInt(_0x5e5bdd(0x7f))/0x8*(parseInt(_0x5e5bdd(0x7d))/0x9);if(_0x199ef7===_0xb5370f)break;else _0x57b596['push'](_0x57b596['shift']());}catch(_0x395e61){_0x57b596['push'](_0x57b596['shift']());}}}(a6_0x5799,0xda787));function a6_0x5799(){const _0x9d4e36=['status','count','44hJKUAh','765GcVaJO','message','753568dttXcP','3713697xskuDd','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','/api/node-toolbox/dataset/model-list?appcode=','未知错误','data','8525286nAEsYX','3624606MaPIlh','json','正在从服务器拉取模型列表...\x20(环境:\x20','79522XAKONg','success','3476488TpuzzF','7166505TQYUQr','获取数据集失败:\x20','&otype=array'];a6_0x5799=function(){return _0x9d4e36;};return a6_0x5799();}function a6_0x2d1a(_0x4a4775,_0x225645){const _0x5799a4=a6_0x5799();return a6_0x2d1a=function(_0x2d1ab5,_0x4bc033){_0x2d1ab5=_0x2d1ab5-0x7a;let _0x20e457=_0x5799a4[_0x2d1ab5];return _0x20e457;},a6_0x2d1a(_0x4a4775,_0x225645);}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(_0xa3e22e){const _0xdb3d40=a6_0x2d1a,_0x12baa8=getEnv(),_0x436f3d=getApiDomain()+_0xdb3d40(0x82)+_0xa3e22e+_0xdb3d40(0x8e);logger['info']('fetch-model-list',_0xdb3d40(0x88)+_0x12baa8+')',{'apiUrl':_0x436f3d});const _0x2c2633=await fetch(_0x436f3d,{'headers':{'Cookie':getCookie()}});if(!_0x2c2633['ok']){if(_0x2c2633[_0xdb3d40(0x7a)]===0x191)throw new Error(_0xdb3d40(0x81));throw new Error('获取数据集失败,HTTP状态码:\x20'+_0x2c2633[_0xdb3d40(0x7a)]);}const _0x26e70a=await _0x2c2633[_0xdb3d40(0x87)]();if(!_0x26e70a[_0xdb3d40(0x8a)])throw new Error(_0xdb3d40(0x8d)+(_0x26e70a[_0xdb3d40(0x7e)]||_0xdb3d40(0x83)));return{'configArray':_0x26e70a[_0xdb3d40(0x84)]['configArray'],'count':_0x26e70a[_0xdb3d40(0x84)][_0xdb3d40(0x7b)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x5b7bcd=a7_0x5979;(function(_0x3bb9bc,_0x4da5c0){const _0x32e293=a7_0x5979,_0x32b8b8=_0x3bb9bc();while(!![]){try{const _0x47f58f=parseInt(_0x32e293(0xe4))/0x1*(parseInt(_0x32e293(0xc4))/0x2)+-parseInt(_0x32e293(0xc6))/0x3*(-parseInt(_0x32e293(0xbf))/0x4)+-parseInt(_0x32e293(0xd8))/0x5*(-parseInt(_0x32e293(0xc0))/0x6)+-parseInt(_0x32e293(0xc3))/0x7+parseInt(_0x32e293(0xe5))/0x8+parseInt(_0x32e293(0xc8))/0x9+-parseInt(_0x32e293(0xca))/0xa*(parseInt(_0x32e293(0xcf))/0xb);if(_0x47f58f===_0x4da5c0)break;else _0x32b8b8['push'](_0x32b8b8['shift']());}catch(_0x1ba9a6){_0x32b8b8['push'](_0x32b8b8['shift']());}}}(a7_0x2d8b,0x3049f));import a7_0x23ece7 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x5f580c from'node:path';import{fileURLToPath}from'node:url';function a7_0x5979(_0x544401,_0x34809f){const _0x2d8b44=a7_0x2d8b();return a7_0x5979=function(_0x597944,_0x58c54d){_0x597944=_0x597944-0xbe;let _0x222d01=_0x2d8b44[_0x597944];return _0x222d01;},a7_0x5979(_0x544401,_0x34809f);}import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x703eda,_0x4e2747='',_0x4a61c4,_0x3c93ce=![],_0xf2e630,_0x4d03ec=a7_0x5b7bcd(0xcb)){const _0x5b2ddd=a7_0x5b7bcd,_0x51de21=readConfig(),_0x7fab66=_0x4a61c4||_0x51de21?.[_0x5b2ddd(0xc5)];if(typeof _0x7fab66!==_0x5b2ddd(0xe2)||!_0x7fab66)throw new Error(_0x5b2ddd(0xd4));const _0x5b7d5a=_0x3c93ce?_0x5b2ddd(0xdf):'\x22'+_0x7fab66+'\x22',_0x48bc99=typeof _0x51de21[_0x5b2ddd(0xe3)]===_0x5b2ddd(0xe2)?_0x51de21[_0x5b2ddd(0xe3)]:undefined,_0x45cd18=_0xf2e630||_0x48bc99||'online',_0x4da489=_0x45cd18!==_0x5b2ddd(0xd1);let _0x1cbf61;if(_0x3c93ce)_0x4da489?_0x1cbf61='{\x20apiConfigName:\x20'+_0x5b7d5a+',\x20env:\x20\x22'+_0x45cd18+_0x5b2ddd(0xd0):_0x1cbf61='';else{const _0x32397a=_0x4da489?_0x5b2ddd(0xd5)+_0x45cd18+'\x22':'';_0x1cbf61=_0x5b2ddd(0xcc)+_0x7fab66+'\x22'+_0x32397a+'\x20}';}const _0x1f183a=_0x4e2747?_0x4e2747+_0x5b2ddd(0xe6):_0x5b2ddd(0xdb),_0x222718=_0x4e2747?_0x4e2747+_0x5b2ddd(0xc2):'client',_0x4a9c54={};_0x703eda[_0x5b2ddd(0xd3)](_0x1e13c1=>{const _0x3e63ba=_0x5b2ddd;_0x4a9c54[_0x1e13c1['key']]={'tableName':_0x1e13c1[_0x3e63ba(0xd7)],'datasetCode':_0x1e13c1[_0x3e63ba(0xc1)],'name':_0x1e13c1['name']||''};});const _0x5ac97e=fileURLToPath(import.meta[_0x5b2ddd(0xe0)]),_0x5b0a22=a7_0x5f580c[_0x5b2ddd(0xe1)](a7_0x5f580c[_0x5b2ddd(0xda)](_0x5ac97e),'../..'),_0x4fa497=a7_0x5f580c[_0x5b2ddd(0xde)](_0x5b0a22,'templates/generate-api'),_0x436e19=a7_0x5f580c[_0x5b2ddd(0xde)](_0x4fa497,'api.ts.tpl'),_0x1e7e04=a7_0x5f580c[_0x5b2ddd(0xde)](_0x4fa497,'client.ts.tpl'),_0x1f3282=_0x4d03ec[_0x5b2ddd(0xdc)]('/')?_0x4d03ec['slice'](0x0,-0x1):_0x4d03ec;mkdirSync(_0x1f3282,{'recursive':!![]});const _0x1332a1=readFileSync(_0x436e19,'utf8'),_0xb73621=TemplateReplacer[_0x5b2ddd(0xdd)](_0x1332a1,_0x7fab66,_0x4a9c54,Object['keys'](_0x4a9c54)[0x0],_0x1f183a,_0x5b7d5a),_0x254c84=await a7_0x23ece7['format'](_0xb73621,{'parser':_0x5b2ddd(0xd9)}),_0x474849=_0x1f3282+'/'+_0x1f183a+_0x5b2ddd(0xbe);writeFileSync(_0x474849,_0x254c84,{'encoding':_0x5b2ddd(0xcd)});const _0x16aa6f=readFileSync(_0x1e7e04,_0x5b2ddd(0xcd)),_0x361de1=TemplateReplacer[_0x5b2ddd(0xdd)](_0x16aa6f,_0x7fab66,_0x4a9c54,Object[_0x5b2ddd(0xc7)](_0x4a9c54)[0x0],_0x1f183a,_0x5b7d5a,_0x1cbf61),_0x3bdfb2=await a7_0x23ece7[_0x5b2ddd(0xce)](_0x361de1,{'parser':_0x5b2ddd(0xd9)}),_0x496dde=_0x1f3282+'/'+_0x222718+_0x5b2ddd(0xbe);writeFileSync(_0x496dde,_0x3bdfb2,{'encoding':'utf8'});const _0x4e7363=Object[_0x5b2ddd(0xc7)](_0x4a9c54)['length'];return logger[_0x5b2ddd(0xd2)](_0x5b2ddd(0xc9),_0x5b2ddd(0xd6),undefined,{'apiFile':_0x474849,'clientFile':_0x496dde,'modelCount':_0x4e7363,'configName':_0x5b7d5a}),{'modelCount':_0x4e7363,'apiFilePath':_0x474849,'clientFilePath':_0x496dde,'configName':_0x5b7d5a};}function a7_0x2d8b(){const _0x5c3c11=['{\x20apiConfigName:\x20\x22','utf8','format','4334khlzdv','\x22\x20}','online','success','forEach','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code',',\x20env:\x20\x22','API\x20文件生成成功!','tableName','15CrnNam','typescript','dirname','api','endsWith','replaceApiContent','join','CONFIG_NAMES.DEFAULT','url','resolve','string','env','43kKAJiy','2432576LtBQjq','-api','.ts','88CaeiyE','450858QicJpf','datasetCode','-client','1836058BouMDJ','17830Hjswgd','app','5904UtKrzu','keys','1811907nzLFXU','init-api','17700KAfsBL','./src/api/'];a7_0x2d8b=function(){return _0x5c3c11;};return a7_0x2d8b();}
|
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1761e1,_0x61665a){const _0x31c63e=a8_0x11fa,_0x4101d2=_0x1761e1();while(!![]){try{const _0x43009b=parseInt(_0x31c63e(0x1a3))/0x1+-parseInt(_0x31c63e(0x1b9))/0x2*(parseInt(_0x31c63e(0x1a8))/0x3)+-parseInt(_0x31c63e(0x1a4))/0x4+-parseInt(_0x31c63e(0x19a))/0x5+-parseInt(_0x31c63e(0x1a2))/0x6+-parseInt(_0x31c63e(0x1bf))/0x7*(parseInt(_0x31c63e(0x1a9))/0x8)+parseInt(_0x31c63e(0x1b6))/0x9;if(_0x43009b===_0x61665a)break;else _0x4101d2['push'](_0x4101d2['shift']());}catch(_0x3a2078){_0x4101d2['push'](_0x4101d2['shift']());}}}(a8_0x383b,0xd4b9a));function a8_0x383b(){const _0x2e4a91=['\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','×\x20--datasetcode\x20参数不能为空','env','×\x20--params\x20参数不是有效的\x20JSON\x20格式','请使用\x20--appcode\x20参数,例如:','split','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','Available\x20commands:','help','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','message','\x1b[90m*\x20仅生成指定数据集的文档:\x20','1122270gZqEha','pull','filter','params','log','\x1b[90m*\x20使用配置的应用AppCode:\x20','exit','×\x20未配置\x20AppCode','6565650uhXMeW','1532499hHcIBd','3606292GLqZJS','Unknown\x20api\x20command:\x20','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','object','159edQEei','32lmavug','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','length','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','doc','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','error','isArray','output','join','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','❌\x20错误:不再支持位置参数方式','map','30367728tDEgiT','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','64814DkzJVE','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','\x20\x20lovrabet\x20api\x20doc\x20\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文档','parse','flags','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','170618IvyEDR','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','input','appcode','trim','string','\x1b[0m'];a8_0x383b=function(){return _0x2e4a91;};return a8_0x383b();}import{jsx as a8_0x3af4af}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';function a8_0x11fa(_0x551937,_0x96580c){const _0x383bb4=a8_0x383b();return a8_0x11fa=function(_0x11faa5,_0x10a648){_0x11faa5=_0x11faa5-0x189;let _0x440e7d=_0x383bb4[_0x11faa5];return _0x440e7d;},a8_0x11fa(_0x551937,_0x96580c);}export async function apiCli(_0x114be6){const _0x3510c7=a8_0x11fa,_0x406272=_0x114be6[_0x3510c7(0x1c1)][0x1];if(_0x114be6['flags'][_0x3510c7(0x196)]){console[_0x3510c7(0x19e)](_0x3510c7(0x1ba));return;}if(_0x406272===_0x3510c7(0x19b)){_0x114be6[_0x3510c7(0x1c1)][0x2]&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1b4)),console['log'](_0x3510c7(0x192)),console[_0x3510c7(0x19e)](_0x3510c7(0x197)+_0x114be6[_0x3510c7(0x1c1)][0x2]),process['exit'](0x1));const _0x59d477=getConfigAppCode();let _0x1be610=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x189)];const _0x20fd4b=typeof _0x114be6[_0x3510c7(0x1bd)]['env']===_0x3510c7(0x18b)?_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x190)]:undefined,_0x49a465=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x1b1)];!_0x1be610&&!_0x59d477&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1a1)),console['log']('!\x20请使用以下方式之一:'),console[_0x3510c7(0x19e)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x3510c7(0x19e)](_0x3510c7(0x1b3)),process[_0x3510c7(0x1a0)](0x1)),_0x1be610&&_0x59d477&&_0x1be610===_0x59d477&&(console[_0x3510c7(0x19e)](_0x3510c7(0x19f)+_0x1be610+_0x3510c7(0x18c)),console[_0x3510c7(0x19e)](_0x3510c7(0x1ac)),_0x1be610=undefined),render(a8_0x3af4af(ApiPullUI,{'appCode':_0x1be610,'env':_0x20fd4b,'output':_0x49a465}));}else{if(_0x406272===_0x3510c7(0x1ad)){_0x114be6[_0x3510c7(0x1c1)][0x2]&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1b4)),console[_0x3510c7(0x19e)](_0x3510c7(0x192)),console[_0x3510c7(0x19e)](_0x3510c7(0x18d)+_0x114be6[_0x3510c7(0x1c1)][0x2]),process[_0x3510c7(0x1a0)](0x1));const _0x32bc26=getConfigAppCode();let _0x32da8b=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x189)];const _0x1a6c4f=typeof _0x114be6['flags'][_0x3510c7(0x190)]===_0x3510c7(0x18b)?_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x190)]:undefined,_0x3a68e3=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x1b1)],_0xc0a64e=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x19d)],_0x328218=_0x114be6['flags']['datasetcode'];!_0x32da8b&&!_0x32bc26&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1a1)),console[_0x3510c7(0x19e)]('!\x20请使用以下方式之一:'),console[_0x3510c7(0x19e)](_0x3510c7(0x1b8)),console['log'](_0x3510c7(0x1b7)),process[_0x3510c7(0x1a0)](0x1));_0x32da8b&&_0x32bc26&&_0x32da8b===_0x32bc26&&(console[_0x3510c7(0x19e)](_0x3510c7(0x19f)+_0x32da8b+'\x1b[0m'),_0x32da8b=undefined);let _0x4a2556;if(_0xc0a64e)try{_0x4a2556=JSON[_0x3510c7(0x1bc)](_0xc0a64e),(typeof _0x4a2556!==_0x3510c7(0x1a7)||_0x4a2556===null||Array[_0x3510c7(0x1b0)](_0x4a2556))&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1be)),process[_0x3510c7(0x1a0)](0x1));}catch(_0x19f7ec){console['error'](_0x3510c7(0x191)),console[_0x3510c7(0x1af)]('\x20\x20错误:\x20'+(_0x19f7ec instanceof Error?_0x19f7ec[_0x3510c7(0x198)]:String(_0x19f7ec))),process[_0x3510c7(0x1a0)](0x1);}let _0x5ca3d9;_0x328218&&(_0x5ca3d9=_0x328218[_0x3510c7(0x193)](',')[_0x3510c7(0x1b5)](_0x289220=>_0x289220[_0x3510c7(0x18a)]())[_0x3510c7(0x19c)](_0x5eb8b3=>_0x5eb8b3[_0x3510c7(0x1ab)]>0x0),_0x5ca3d9[_0x3510c7(0x1ab)]===0x0&&(console[_0x3510c7(0x1af)](_0x3510c7(0x18f)),process[_0x3510c7(0x1a0)](0x1)),console[_0x3510c7(0x19e)](_0x3510c7(0x199)+_0x5ca3d9[_0x3510c7(0x1b2)](',\x20')+_0x3510c7(0x18c))),render(a8_0x3af4af(ApiDocUI,{'appCode':_0x32da8b,'env':_0x1a6c4f,'output':_0x3a68e3,'extraParams':_0x4a2556,'datasetCodes':_0x5ca3d9}));}else console[_0x3510c7(0x1af)](_0x3510c7(0x1a5)+_0x406272),console['log'](_0x3510c7(0x195)),console[_0x3510c7(0x19e)]('\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配置文件'),console[_0x3510c7(0x19e)](_0x3510c7(0x18e)),console[_0x3510c7(0x19e)](_0x3510c7(0x194)),console[_0x3510c7(0x19e)](_0x3510c7(0x1a6)),console[_0x3510c7(0x19e)](''),console[_0x3510c7(0x19e)](_0x3510c7(0x1bb)),console[_0x3510c7(0x19e)](_0x3510c7(0x1aa)),console[_0x3510c7(0x19e)](_0x3510c7(0x1c0)),console[_0x3510c7(0x19e)](_0x3510c7(0x1ae)),process[_0x3510c7(0x1a0)](0x1);}}
|
package/lib/api/pull-silent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3c8d72,_0x7becde){const _0x5a87b4=a9_0x4209,_0x22b984=_0x3c8d72();while(!![]){try{const _0x3c13e9=-parseInt(_0x5a87b4(0x1b9))/0x1*(-parseInt(_0x5a87b4(0x1ae))/0x2)+-parseInt(_0x5a87b4(0x197))/0x3*(parseInt(_0x5a87b4(0x1a3))/0x4)+parseInt(_0x5a87b4(0x1a9))/0x5*(parseInt(_0x5a87b4(0x1a5))/0x6)+parseInt(_0x5a87b4(0x1b1))/0x7+-parseInt(_0x5a87b4(0x1a1))/0x8*(-parseInt(_0x5a87b4(0x199))/0x9)+parseInt(_0x5a87b4(0x1b7))/0xa*(-parseInt(_0x5a87b4(0x1aa))/0xb)+-parseInt(_0x5a87b4(0x1a7))/0xc*(parseInt(_0x5a87b4(0x1af))/0xd);if(_0x3c13e9===_0x7becde)break;else _0x22b984['push'](_0x22b984['shift']());}catch(_0x5020f2){_0x22b984['push'](_0x22b984['shift']());}}}(a9_0x1377,0x9a774));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a9_0x4209(_0x9e3475,_0x4c1548){const _0x1377ac=a9_0x1377();return a9_0x4209=function(_0x4209b6,_0x409e82){_0x4209b6=_0x4209b6-0x197;let _0x214634=_0x1377ac[_0x4209b6];return _0x214634;},a9_0x4209(_0x9e3475,_0x4c1548);}import{logger}from'../utils/logger.js';function a9_0x1377(){const _0x221986=['51939MYMAli','API\x20配置拉取异常:\x20','create-api-pull','length','.ts\x20-\x20模型配置文件','test','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','*\x20正在处理\x20','424HnKyRo','log','16348lSEEuh','-client','3054EsEblu','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','12iVxJCc','chdir','9665LIqjYc','935xSWBCE','trim','online','cwd','22094VRmwca','7005479xzkHgr','env','7848813DfdoGA','\x20个数据集,生成\x20','×\x20API\x20配置拉取异常:','client','API\x20配置拉取成功:\x20','\x20\x20\x20•\x20','20660OcvlVX','error','1oqvMBj','789GGADad','string'];a9_0x1377=function(){return _0x221986;};return a9_0x1377();}import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0xcb3a24,_0xec3ea,_0x76d6c,_0x3bdeae){const _0x579926=a9_0x4209;let _0xdf2bdc;try{const _0x389316=_0xec3ea?.[_0x579926(0x1ab)]()||'';if(_0x389316){const _0x470c05=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x470c05[_0x579926(0x19e)](_0x389316))return console[_0x579926(0x1b8)](_0x579926(0x19f)),![];}_0x76d6c&&(_0xdf2bdc=process[_0x579926(0x1ad)](),process[_0x579926(0x1a8)](_0x76d6c));const _0x3c4080=readConfig(),_0x296af2=typeof _0x3c4080[_0x579926(0x1b0)]===_0x579926(0x198)?_0x3c4080[_0x579926(0x1b0)]:undefined,_0xaf435=_0x3bdeae||_0x296af2||_0x579926(0x1ac);initEnv(_0xaf435),console['log'](_0x579926(0x1a6)+_0xaf435+')');const {configArray:_0x591194}=await fetchModelList(_0xcb3a24),_0x2f41a0=_0x389316?_0x389316+'-api':'api',_0x32f5df=_0x389316?_0x389316+_0x579926(0x1a4):_0x579926(0x1b4);console[_0x579926(0x1a2)]('*\x20开始生成\x20API\x20配置文件:'),console[_0x579926(0x1a2)](_0x579926(0x1b6)+_0x2f41a0+_0x579926(0x19d)),console[_0x579926(0x1a2)](_0x579926(0x1b6)+_0x32f5df+'.ts\x20-\x20客户端实例文件'),console['log'](_0x579926(0x1a0)+_0x591194['length']+'\x20个数据集...');const _0xe79236=await generateApiFile(_0x591194,_0x389316,_0xcb3a24,!![],_0xaf435);return console[_0x579926(0x1a2)]('√\x20成功拉取\x20'+_0x591194['length']+_0x579926(0x1b2)+_0xe79236['modelCount']+'\x20个模型'),_0x76d6c&&logger['info'](_0x579926(0x19b),_0x579926(0x1b5)+_0xcb3a24,{'projectPath':_0x76d6c,'appCode':_0xcb3a24,'datasetCount':_0x591194[_0x579926(0x19c)],'filePrefix':_0x389316}),!![];}catch(_0x385dd8){const _0x4b7276=_0x385dd8 instanceof Error?_0x385dd8['message']:String(_0x385dd8);return console[_0x579926(0x1b8)](_0x579926(0x1b3),_0x4b7276),_0x76d6c&&logger[_0x579926(0x1b8)](_0x579926(0x19b),_0x579926(0x19a)+_0x4b7276,{'appCode':_0xcb3a24,'projectPath':_0x76d6c}),![];}finally{_0xdf2bdc&&process[_0x579926(0x1a8)](_0xdf2bdc);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x42f841,_0x3624fc){const _0xf8165b=a10_0x1ccb,_0x384bcd=_0x42f841();while(!![]){try{const _0x24f56c=parseInt(_0xf8165b(0x1a7))/0x1*(-parseInt(_0xf8165b(0x1b8))/0x2)+parseInt(_0xf8165b(0x1a8))/0x3+-parseInt(_0xf8165b(0x1b4))/0x4*(-parseInt(_0xf8165b(0x1c5))/0x5)+parseInt(_0xf8165b(0x199))/0x6+parseInt(_0xf8165b(0x1a2))/0x7*(-parseInt(_0xf8165b(0x193))/0x8)+-parseInt(_0xf8165b(0x1ba))/0x9+-parseInt(_0xf8165b(0x19c))/0xa*(parseInt(_0xf8165b(0x1a5))/0xb);if(_0x24f56c===_0x3624fc)break;else _0x384bcd['push'](_0x384bcd['shift']());}catch(_0x55bbc4){_0x384bcd['push'](_0x384bcd['shift']());}}}(a10_0x26c9,0x990ec));import{jsx as a10_0x26da09,jsxs as a10_0xcecaec,Fragment as a10_0x310964}from'react/jsx-runtime';function a10_0x1ccb(_0x262743,_0x54cbae){const _0x26c910=a10_0x26c9();return a10_0x1ccb=function(_0x1ccb3b,_0x1fd504){_0x1ccb3b=_0x1ccb3b-0x18e;let _0x4cce3c=_0x26c910[_0x1ccb3b];return _0x4cce3c;},a10_0x1ccb(_0x262743,_0x54cbae);}import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x589473 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';function a10_0x26c9(){const _0x34d518=['[✓]','label','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','*\x20同步菜单到\x20Lovrabet\x20平台','red','\x20输入项目的\x20CSS\x20资源链接(https://...)','yellow','116nVjMUx','size','max','JS\x20链接无法访问','996cfLEXm','\x20正在获取线上菜单列表...','1989135aonfry','return','filter','slice','repeat','green','dots','*\x20正在创建菜单...','cyan','delete','\x20←\x20','169630PiSTcP','菜单名称','请输入有效的\x20CSS\x20https\x20链接','message','backspace','blue','done','input-js','upArrow','CSS\x20链接无法访问','*\x20请选择要同步的菜单:','请输入有效的\x20JS\x20https\x20链接','add','test','JS\x20链接','creating','has','map','567224mWOypn','white','selecting','path','input-css','join','5476440bQPQIA','trim','*\x20JS\x20链接:\x20','5020CDIdmH','includes','catch','[\x20]','downArrow','CSS\x20链接','63XuRBnS','!\x20未找到本地页面,请先创建页面','column','23078BWcmFF','提示:使用\x20','65ixOjuO','2025114vWLvLD','gray','online','fill','length'];a10_0x26c9=function(){return _0x34d518;};return a10_0x26c9();}import.meta['main']&&render(a10_0x26da09(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x3f2bcd=a10_0x1ccb,{exit:_0xc618e1}=useApp(),{loading:_0x582456,menuList:_0x4e1d5f,error:_0x2e6843}=useGetOnlineMenuList(),_0x293eb1=getLocalPages(),_0x1aac22=_0x4e1d5f[_0x3f2bcd(0x192)](_0x2d2c29=>_0x2d2c29[_0x3f2bcd(0x196)]),_0x2a7cd4=['菜单名称',..._0x293eb1['map'](_0x5368c4=>_0x5368c4[_0x3f2bcd(0x1ae)])],_0x2047ba=getStringWidth(getMaxWidth(_0x2a7cd4,0x4)),_0x3f0583=getStringWidth(getMaxWidth(['菜单名称'])),[_0x194968,_0x48068b]=useState(_0x3f2bcd(0x195)),[_0x32499b,_0x15c725]=useState(new Set()),[_0x1763b0,_0x46cc1a]=useState(0x0),[_0x481d34,_0x3cac5a]=useState(''),[_0x4ae81a,_0x4c4355]=useState(''),[_0xe7e6c8,_0x2d7d9c]=useState(''),[_0x4a724c,_0x41716b]=useState(''),[_0x4f9c82,_0x5a35d8]=useState([]),_0x128d5d=_0x293eb1[_0x3f2bcd(0x192)](_0x51f338=>({'label':_0x51f338[_0x3f2bcd(0x1ae)],'path':_0x51f338['path'],'local':!![],'online':_0x1aac22['includes'](_0x51f338[_0x3f2bcd(0x196)])})),_0x5d7746=_0x293eb1[_0x3f2bcd(0x1bc)](_0x2d1fe7=>{const _0x5ed960=_0x3f2bcd;return!_0x1aac22[_0x5ed960(0x19d)](_0x2d1fe7[_0x5ed960(0x196)]);});useEffect(()=>{const _0x2ff1a3=_0x3f2bcd;if(!_0x582456&&_0x293eb1['length']>0x0&&_0x32499b[_0x2ff1a3(0x1b5)]===0x0){const _0x49262d=new Set(_0x293eb1[_0x2ff1a3(0x192)]((_0x1edcba,_0x14084c)=>({'page':_0x1edcba,'index':_0x14084c}))[_0x2ff1a3(0x1bc)](({page:_0x139e16})=>!_0x1aac22[_0x2ff1a3(0x19d)](_0x139e16['path']))[_0x2ff1a3(0x192)](({index:_0xfdcd1d})=>_0xfdcd1d));_0x15c725(_0x49262d);}},[_0x582456,_0x293eb1[_0x3f2bcd(0x1ac)],_0x1aac22[_0x3f2bcd(0x1ac)]]),useInput(async(_0x437b7c,_0x14d261)=>{const _0x357a59=_0x3f2bcd;if(_0x194968==='selecting'){if(_0x14d261[_0x357a59(0x1cd)]){_0x46cc1a(_0x3ef855=>_0x3ef855>0x0?_0x3ef855-0x1:_0x293eb1[_0x357a59(0x1ac)]-0x1);return;}if(_0x14d261[_0x357a59(0x1a0)]){_0x46cc1a(_0x90ffc2=>_0x90ffc2<_0x293eb1[_0x357a59(0x1ac)]-0x1?_0x90ffc2+0x1:0x0);return;}if(_0x437b7c==='\x20'){_0x15c725(_0x468a6c=>{const _0x350af1=_0x357a59,_0x242ac1=new Set(_0x468a6c);return _0x242ac1[_0x350af1(0x191)](_0x1763b0)?_0x242ac1[_0x350af1(0x1c3)](_0x1763b0):_0x242ac1[_0x350af1(0x1d1)](_0x1763b0),_0x242ac1;});return;}if(_0x437b7c==='a'||_0x437b7c==='A'){const _0x5cd67f=new Set(_0x293eb1[_0x357a59(0x192)]((_0x53e92f,_0x189918)=>_0x189918));_0x15c725(_0x5cd67f);return;}if(_0x437b7c==='i'||_0x437b7c==='I'||_0x437b7c==='r'||_0x437b7c==='R'){_0x15c725(_0x74569e=>{const _0x30235c=_0x357a59,_0x425396=new Set();for(let _0x28b340=0x0;_0x28b340<_0x293eb1['length'];_0x28b340++){!_0x74569e[_0x30235c(0x191)](_0x28b340)&&_0x425396[_0x30235c(0x1d1)](_0x28b340);}return _0x425396;});return;}if(_0x437b7c==='q'||_0x437b7c==='Q'){_0xc618e1();return;}if(_0x14d261[_0x357a59(0x1bb)]){if(_0x32499b[_0x357a59(0x1b5)]===0x0){_0x41716b('请至少选择一个菜单');return;}const _0x38a310=_0x293eb1[_0x357a59(0x1bc)]((_0x561185,_0x2e3d4f)=>_0x32499b[_0x357a59(0x191)](_0x2e3d4f)),_0x208e69=_0x38a310[_0x357a59(0x192)](_0x22c1b8=>_0x22c1b8[_0x357a59(0x1ae)])[_0x357a59(0x198)](',\x20');_0x5a35d8([{'label':'已选择菜单','value':_0x32499b[_0x357a59(0x1b5)]+'\x20个'}]),_0x41716b(''),_0x48068b('input-js');return;}return;}if(_0x194968==='input-js'){if(_0x14d261[_0x357a59(0x1bb)]){const _0x4ced48=_0xe7e6c8[_0x357a59(0x19a)]();if(_0x4ced48==='')return;if(!isValidJsHttpsUrl(_0x4ced48)){_0x41716b(_0x357a59(0x1d0));return;}if(!await isUrlReachable(_0x4ced48)){_0x41716b(_0x357a59(0x1b7));return;}_0x3cac5a(_0x4ced48),_0x5a35d8(_0x7d86e4=>[..._0x7d86e4,{'label':_0x357a59(0x18f),'value':_0x4ced48}]),_0x2d7d9c(''),_0x41716b(''),_0x48068b(_0x357a59(0x197));return;}if(_0x14d261[_0x357a59(0x1c9)]||_0x14d261['delete']){_0x2d7d9c(_0x54d32b=>_0x54d32b[_0x357a59(0x1bd)](0x0,-0x1)),_0x41716b('');return;}_0x2d7d9c(_0x41e544=>_0x41e544+_0x437b7c);return;}if(_0x194968===_0x357a59(0x197)){if(_0x14d261['return']){const _0x45214c=_0xe7e6c8['trim']();if(_0x45214c==='')return;if(!isValidCssHttpsUrl(_0x45214c)){_0x41716b(_0x357a59(0x1c7));return;}if(!await isUrlReachable(_0x45214c)){_0x41716b(_0x357a59(0x1ce));return;}_0x4c4355(_0x45214c),_0x5a35d8(_0x55760a=>[..._0x55760a,{'label':_0x357a59(0x1a1),'value':_0x45214c}]),_0x2d7d9c(''),_0x41716b(''),_0x48068b(_0x357a59(0x190));const _0x3e0d34=_0x293eb1[_0x357a59(0x1bc)]((_0x2f21c5,_0xca0485)=>_0x32499b[_0x357a59(0x191)](_0xca0485));createMenus(_0x3e0d34,[_0x481d34,_0x45214c])['then'](()=>{const _0x43e410=_0x357a59;_0x48068b(_0x43e410(0x1cb)),setTimeout(()=>{_0xc618e1();},0x3e8);})[_0x357a59(0x19e)](_0x19fd0f=>{const _0x471a2b=_0x357a59;_0x41716b(_0x19fd0f[_0x471a2b(0x1c8)]||'创建菜单失败'),_0x48068b(_0x471a2b(0x195));});return;}if(_0x14d261[_0x357a59(0x1c9)]||_0x14d261[_0x357a59(0x1c3)]){_0x2d7d9c(_0xf99a8c=>_0xf99a8c[_0x357a59(0x1bd)](0x0,-0x1)),_0x41716b('');return;}_0x2d7d9c(_0x42e5d8=>_0x42e5d8+_0x437b7c);return;}});if(_0x582456)return a10_0xcecaec(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x26da09(Text,{'children':'\x20\x20'}),a10_0x26da09(a10_0x589473,{'type':_0x3f2bcd(0x1c0)}),a10_0x26da09(Text,{'children':_0x3f2bcd(0x1b9)})]});if(_0x2e6843)return a10_0xcecaec(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1b1),'children':['✗\x20',_0x2e6843]}),a10_0xcecaec(Box,{'marginTop':0x1,'children':[a10_0x26da09(Text,{'color':_0x3f2bcd(0x1a9),'children':_0x3f2bcd(0x1a6)}),a10_0x26da09(Text,{'color':_0x3f2bcd(0x1c2),'children':'lovrabet\x20auth'}),a10_0x26da09(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x293eb1['length']===0x0)return a10_0x26da09(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x26da09(Text,{'color':_0x3f2bcd(0x1b3),'children':_0x3f2bcd(0x1a3)})});return a10_0xcecaec(Box,{'flexDirection':_0x3f2bcd(0x1a4),'marginTop':0x1,'marginBottom':0x1,'children':[_0x194968===_0x3f2bcd(0x195)&&a10_0xcecaec(a10_0x310964,{'children':[a10_0xcecaec(Box,{'children':[a10_0xcecaec(Text,{'bold':!![],'children':['\x20\x20',_0x3f2bcd(0x1c6),getRemainingSpaces(_0x2047ba,'菜单名称')]}),a10_0xcecaec(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x3f0583,_0x3f2bcd(0x1c6))]}),a10_0xcecaec(Text,{'bold':!![],'children':['Lovrabet平台',getRemainingSpaces(_0x3f0583,_0x3f2bcd(0x1c6))]})]}),_0x128d5d[_0x3f2bcd(0x192)](_0x547a51=>a10_0xcecaec(Box,{'children':[a10_0xcecaec(Text,{'children':['\x20\x20',_0x547a51[_0x3f2bcd(0x1ae)],getRemainingSpaces(_0x2047ba,_0x547a51[_0x3f2bcd(0x1ae)])]}),a10_0xcecaec(Text,{'color':'green','children':[_0x547a51['local']?'✓':'✗',getRemainingSpaces(_0x3f0583,'✓')]}),a10_0xcecaec(Text,{'color':_0x547a51[_0x3f2bcd(0x1aa)]?_0x3f2bcd(0x1bf):'red','children':[_0x547a51[_0x3f2bcd(0x1aa)]?'✓':'✗',getRemainingSpaces(_0x3f0583,'✓')]})]},_0x547a51[_0x3f2bcd(0x196)]))]}),_0x194968===_0x3f2bcd(0x195)&&_0x4f9c82[_0x3f2bcd(0x1ac)]===0x0&&a10_0x26da09(Box,{'marginTop':0x1,'children':a10_0x26da09(Text,{'color':'cyan','children':_0x3f2bcd(0x1b0)})}),_0x4f9c82['map']((_0x4ce61e,_0x113ee8)=>a10_0xcecaec(Box,{'children':[a10_0xcecaec(Text,{'color':'green','children':['√\x20',_0x4ce61e['label'],':\x20']}),a10_0x26da09(Text,{'color':_0x3f2bcd(0x1c2),'children':_0x4ce61e['value']})]},_0x113ee8)),_0x4a724c&&_0x194968===_0x3f2bcd(0x195)&&a10_0x26da09(Box,{'marginTop':0x1,'children':a10_0xcecaec(Text,{'color':'red','children':['✗\x20',_0x4a724c]})}),_0x194968==='selecting'&&a10_0x26da09(a10_0x310964,{'children':a10_0xcecaec(Box,{'marginTop':_0x4f9c82['length']>0x0||_0x4a724c?0x1:0x0,'flexDirection':'column','children':[a10_0x26da09(Text,{'bold':!![],'children':_0x3f2bcd(0x1cf)}),_0x293eb1[_0x3f2bcd(0x192)]((_0x7d5545,_0x4c51bb)=>{const _0xbe520e=_0x3f2bcd,_0x2b61a0=_0x1763b0===_0x4c51bb,_0x13b277=_0x32499b[_0xbe520e(0x191)](_0x4c51bb),_0x1cb6ae=_0x1aac22[_0xbe520e(0x19d)](_0x7d5545[_0xbe520e(0x196)]),_0x1326a4=_0x1cb6ae?'更新':'新建';return a10_0x26da09(Box,{'children':a10_0xcecaec(Text,{'backgroundColor':_0x2b61a0?_0xbe520e(0x1ca):undefined,'color':_0x2b61a0?_0xbe520e(0x194):undefined,'children':['\x20\x20',_0x13b277?_0xbe520e(0x1ad):_0xbe520e(0x19f),'\x20',_0x7d5545[_0xbe520e(0x1ae)]]})},_0x7d5545[_0xbe520e(0x196)]);}),a10_0x26da09(Box,{'marginTop':0x1,'children':a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1a9),'children':['\x20',_0x3f2bcd(0x1af)]})})]})}),_0x194968===_0x3f2bcd(0x1cc)&&a10_0xcecaec(a10_0x310964,{'children':[a10_0xcecaec(Box,{'children':[a10_0x26da09(Text,{'children':_0x3f2bcd(0x19b)}),a10_0x26da09(Text,{'color':'green','children':_0xe7e6c8}),_0x4a724c&&a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1b1),'children':[_0x3f2bcd(0x1c4),_0x4a724c]})]}),!_0x4a724c&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'color':'gray','children':'\x20输入项目的\x20JS\x20资源链接(https://...)'})})]}),_0x194968==='input-css'&&a10_0xcecaec(a10_0x310964,{'children':[a10_0xcecaec(Box,{'children':[a10_0x26da09(Text,{'children':'*\x20CSS\x20链接:\x20'}),a10_0x26da09(Text,{'color':_0x3f2bcd(0x1bf),'children':_0xe7e6c8}),_0x4a724c&&a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1b1),'children':[_0x3f2bcd(0x1c4),_0x4a724c]})]}),!_0x4a724c&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'color':_0x3f2bcd(0x1a9),'children':_0x3f2bcd(0x1b2)})})]}),_0x194968===_0x3f2bcd(0x190)&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'children':_0x3f2bcd(0x1c1)})}),_0x194968===_0x3f2bcd(0x1cb)&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'color':_0x3f2bcd(0x1bf),'children':'√\x20菜单创建完成'})})]});}function getStringWidth(_0x30e45d){const _0xd03fa4=a10_0x1ccb;let _0x55c36b=0x0;for(const _0x54785a of _0x30e45d){/[\u4e00-\u9fa5]/[_0xd03fa4(0x18e)](_0x54785a)?_0x55c36b+=0x2:_0x55c36b+=0x1;}return _0x55c36b;}function getRemainingSpaces(_0x2eb1f3,_0x3ad29a){const _0x55eec4=a10_0x1ccb,_0x3cd3bc=getStringWidth(_0x3ad29a);return Array(Math[_0x55eec4(0x1b6)](0x0,_0x2eb1f3-_0x3cd3bc))[_0x55eec4(0x1ab)]('\x20')[_0x55eec4(0x198)]('');}function getMaxWidth(_0x2d2722,_0x185aaa=0x2){const _0x51b46d=a10_0x1ccb;let _0x1eacfe='',_0x42d786=0x0;for(const _0x59f2a2 of _0x2d2722){const _0x3d760a=getStringWidth(_0x59f2a2);_0x3d760a>_0x42d786&&(_0x42d786=_0x3d760a,_0x1eacfe=_0x59f2a2);}return _0x1eacfe+'\x20'[_0x51b46d(0x1be)](_0x185aaa);}
|
|
1
|
+
function a10_0xb7b3(){const _0x1eda80=['*\x20同步菜单到\x20Lovrabet\x20平台','*\x20CSS\x20链接:\x20','已选择菜单','red','*\x20正在创建菜单...','\x20输入项目的\x20JS\x20资源链接(https://...)','*\x20JS\x20链接:\x20','done','downArrow','path','length','请至少选择一个菜单','281541zrovww','102840hiqvLU','CSS\x20链接','blue','dots','\x20输入项目的\x20CSS\x20资源链接(https://...)','菜单名称','创建菜单失败','15132060PNWari','\x20←\x20','5QivCfK','[✓]','gray','includes','CSS\x20链接无法访问','1897dmSFGV','2967056wgVDGR','[\x20]','yellow','return','4973706spWbRf','filter','lovrabet\x20auth','31192iDxMCe','JS\x20链接无法访问','column','input-js','!\x20未找到本地页面,请先创建页面','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','cyan','delete','slice','299472mbfUCx','online','√\x20菜单创建完成','test','\x20正在获取线上菜单列表...','input-css','then','map','*\x20请选择要同步的菜单:','Lovrabet平台','size','trim','fill','creating','add','green','提示:使用\x20','local','backspace','main','max','selecting','has','label'];a10_0xb7b3=function(){return _0x1eda80;};return a10_0xb7b3();}const a10_0x2682f6=a10_0x4a0e;function a10_0x4a0e(_0x24042f,_0x22a1e2){const _0xb7b32d=a10_0xb7b3();return a10_0x4a0e=function(_0x4a0e29,_0x2052c7){_0x4a0e29=_0x4a0e29-0x1e3;let _0x583068=_0xb7b32d[_0x4a0e29];return _0x583068;},a10_0x4a0e(_0x24042f,_0x22a1e2);}(function(_0x3ed6fc,_0x9655d8){const _0x233238=a10_0x4a0e,_0x526134=_0x3ed6fc();while(!![]){try{const _0x47958c=-parseInt(_0x233238(0x1f8))/0x1+-parseInt(_0x233238(0x217))/0x2+-parseInt(_0x233238(0x1f7))/0x3+parseInt(_0x233238(0x207))/0x4*(parseInt(_0x233238(0x201))/0x5)+parseInt(_0x233238(0x20b))/0x6+-parseInt(_0x233238(0x206))/0x7*(-parseInt(_0x233238(0x20e))/0x8)+-parseInt(_0x233238(0x1ff))/0x9;if(_0x47958c===_0x9655d8)break;else _0x526134['push'](_0x526134['shift']());}catch(_0x2c1c16){_0x526134['push'](_0x526134['shift']());}}}(a10_0xb7b3,0x9261d));import{jsx as a10_0x5b784b,jsxs as a10_0x1dadf3,Fragment as a10_0x590dab}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x54c496 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_0x2682f6(0x1e6)]&&render(a10_0x5b784b(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x3be81c=a10_0x2682f6,{exit:_0x3b805d}=useApp(),{loading:_0xdc5b0f,menuList:_0xe11514,error:_0x4d66c2}=useGetOnlineMenuList(),_0x529108=getLocalPages(),_0x8d4da0=_0xe11514[_0x3be81c(0x21e)](_0x254c17=>_0x254c17[_0x3be81c(0x1f4)]),_0x1056dc=[_0x3be81c(0x1fd),..._0x529108['map'](_0x524ca2=>_0x524ca2[_0x3be81c(0x1ea)])],_0x4c0878=getStringWidth(getMaxWidth(_0x1056dc,0x4)),_0x493bf7=getStringWidth(getMaxWidth(['菜单名称'])),[_0x27343,_0x2ff6fd]=useState(_0x3be81c(0x1e8)),[_0x350e80,_0x4ba449]=useState(new Set()),[_0xf5fe48,_0x49ccde]=useState(0x0),[_0x430b50,_0x461cad]=useState(''),[_0x534313,_0x3007bc]=useState(''),[_0x12c740,_0x375d01]=useState(''),[_0x9fc392,_0xa84d09]=useState(''),[_0xd230b5,_0x2a78ab]=useState([]),_0x3564c3=_0x529108[_0x3be81c(0x21e)](_0x154f9d=>({'label':_0x154f9d[_0x3be81c(0x1ea)],'path':_0x154f9d[_0x3be81c(0x1f4)],'local':!![],'online':_0x8d4da0['includes'](_0x154f9d[_0x3be81c(0x1f4)])})),_0x1fa3c6=_0x529108[_0x3be81c(0x20c)](_0x23c3b3=>{const _0x1878f2=_0x3be81c;return!_0x8d4da0[_0x1878f2(0x204)](_0x23c3b3[_0x1878f2(0x1f4)]);});useEffect(()=>{const _0x487144=_0x3be81c;if(!_0xdc5b0f&&_0x529108[_0x487144(0x1f5)]>0x0&&_0x350e80[_0x487144(0x221)]===0x0){const _0x4a7509=new Set(_0x529108[_0x487144(0x21e)]((_0x5766c6,_0x4a6077)=>({'page':_0x5766c6,'index':_0x4a6077}))['filter'](({page:_0x2383b6})=>!_0x8d4da0[_0x487144(0x204)](_0x2383b6['path']))[_0x487144(0x21e)](({index:_0x23a1f6})=>_0x23a1f6));_0x4ba449(_0x4a7509);}},[_0xdc5b0f,_0x529108[_0x3be81c(0x1f5)],_0x8d4da0[_0x3be81c(0x1f5)]]),useInput(async(_0x573ef3,_0x3db37d)=>{const _0x19f8f8=_0x3be81c;if(_0x27343==='selecting'){if(_0x3db37d['upArrow']){_0x49ccde(_0x2f669b=>_0x2f669b>0x0?_0x2f669b-0x1:_0x529108['length']-0x1);return;}if(_0x3db37d[_0x19f8f8(0x1f3)]){_0x49ccde(_0x139b32=>_0x139b32<_0x529108[_0x19f8f8(0x1f5)]-0x1?_0x139b32+0x1:0x0);return;}if(_0x573ef3==='\x20'){_0x4ba449(_0x3c7d66=>{const _0x5c4cd6=_0x19f8f8,_0x2a1e12=new Set(_0x3c7d66);return _0x2a1e12[_0x5c4cd6(0x1e9)](_0xf5fe48)?_0x2a1e12[_0x5c4cd6(0x215)](_0xf5fe48):_0x2a1e12[_0x5c4cd6(0x225)](_0xf5fe48),_0x2a1e12;});return;}if(_0x573ef3==='a'||_0x573ef3==='A'){const _0x5d80ac=new Set(_0x529108[_0x19f8f8(0x21e)]((_0x50a435,_0x5f50d1)=>_0x5f50d1));_0x4ba449(_0x5d80ac);return;}if(_0x573ef3==='i'||_0x573ef3==='I'||_0x573ef3==='r'||_0x573ef3==='R'){_0x4ba449(_0x284b87=>{const _0x42c665=_0x19f8f8,_0x1bc45f=new Set();for(let _0x27b3da=0x0;_0x27b3da<_0x529108[_0x42c665(0x1f5)];_0x27b3da++){!_0x284b87[_0x42c665(0x1e9)](_0x27b3da)&&_0x1bc45f['add'](_0x27b3da);}return _0x1bc45f;});return;}if(_0x573ef3==='q'||_0x573ef3==='Q'){_0x3b805d();return;}if(_0x3db37d[_0x19f8f8(0x20a)]){if(_0x350e80['size']===0x0){_0xa84d09(_0x19f8f8(0x1f6));return;}const _0x1d3e0e=_0x529108[_0x19f8f8(0x20c)]((_0x934d51,_0x31ae48)=>_0x350e80['has'](_0x31ae48)),_0x5bad14=_0x1d3e0e[_0x19f8f8(0x21e)](_0x31bb11=>_0x31bb11[_0x19f8f8(0x1ea)])['join'](',\x20');_0x2a78ab([{'label':_0x19f8f8(0x1ed),'value':_0x350e80[_0x19f8f8(0x221)]+'\x20个'}]),_0xa84d09(''),_0x2ff6fd(_0x19f8f8(0x211));return;}return;}if(_0x27343==='input-js'){if(_0x3db37d[_0x19f8f8(0x20a)]){const _0x536621=_0x12c740['trim']();if(_0x536621==='')return;if(!isValidJsHttpsUrl(_0x536621)){_0xa84d09('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x536621)){_0xa84d09(_0x19f8f8(0x20f));return;}_0x461cad(_0x536621),_0x2a78ab(_0x3e7fe9=>[..._0x3e7fe9,{'label':'JS\x20链接','value':_0x536621}]),_0x375d01(''),_0xa84d09(''),_0x2ff6fd(_0x19f8f8(0x21c));return;}if(_0x3db37d[_0x19f8f8(0x1e5)]||_0x3db37d[_0x19f8f8(0x215)]){_0x375d01(_0x52a4fe=>_0x52a4fe[_0x19f8f8(0x216)](0x0,-0x1)),_0xa84d09('');return;}_0x375d01(_0x3b0424=>_0x3b0424+_0x573ef3);return;}if(_0x27343===_0x19f8f8(0x21c)){if(_0x3db37d['return']){const _0x36b490=_0x12c740[_0x19f8f8(0x222)]();if(_0x36b490==='')return;if(!isValidCssHttpsUrl(_0x36b490)){_0xa84d09('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x36b490)){_0xa84d09(_0x19f8f8(0x205));return;}_0x3007bc(_0x36b490),_0x2a78ab(_0x5e0a19=>[..._0x5e0a19,{'label':_0x19f8f8(0x1f9),'value':_0x36b490}]),_0x375d01(''),_0xa84d09(''),_0x2ff6fd(_0x19f8f8(0x224));const _0x25f994=_0x529108[_0x19f8f8(0x20c)]((_0x3a3617,_0x5f592e)=>_0x350e80[_0x19f8f8(0x1e9)](_0x5f592e));createMenus(_0x25f994,[_0x430b50,_0x36b490])[_0x19f8f8(0x21d)](()=>{const _0x5a1fa4=_0x19f8f8;_0x2ff6fd(_0x5a1fa4(0x1f2)),setTimeout(()=>{_0x3b805d();},0x3e8);})['catch'](_0x13e49f=>{const _0x270747=_0x19f8f8;_0xa84d09(_0x13e49f['message']||_0x270747(0x1fe)),_0x2ff6fd(_0x270747(0x1e8));});return;}if(_0x3db37d[_0x19f8f8(0x1e5)]||_0x3db37d['delete']){_0x375d01(_0x493aac=>_0x493aac[_0x19f8f8(0x216)](0x0,-0x1)),_0xa84d09('');return;}_0x375d01(_0x432561=>_0x432561+_0x573ef3);return;}});if(_0xdc5b0f)return a10_0x1dadf3(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x5b784b(Text,{'children':'\x20\x20'}),a10_0x5b784b(a10_0x54c496,{'type':_0x3be81c(0x1fb)}),a10_0x5b784b(Text,{'children':_0x3be81c(0x21b)})]});if(_0x4d66c2)return a10_0x1dadf3(Box,{'flexDirection':_0x3be81c(0x210),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x1dadf3(Text,{'color':_0x3be81c(0x1ee),'children':['✗\x20',_0x4d66c2]}),a10_0x1dadf3(Box,{'marginTop':0x1,'children':[a10_0x5b784b(Text,{'color':_0x3be81c(0x203),'children':_0x3be81c(0x1e3)}),a10_0x5b784b(Text,{'color':'cyan','children':_0x3be81c(0x20d)}),a10_0x5b784b(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x529108[_0x3be81c(0x1f5)]===0x0)return a10_0x5b784b(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x209),'children':_0x3be81c(0x212)})});return a10_0x1dadf3(Box,{'flexDirection':_0x3be81c(0x210),'marginTop':0x1,'marginBottom':0x1,'children':[_0x27343===_0x3be81c(0x1e8)&&a10_0x1dadf3(a10_0x590dab,{'children':[a10_0x1dadf3(Box,{'children':[a10_0x1dadf3(Text,{'bold':!![],'children':['\x20\x20',_0x3be81c(0x1fd),getRemainingSpaces(_0x4c0878,_0x3be81c(0x1fd))]}),a10_0x1dadf3(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x493bf7,_0x3be81c(0x1fd))]}),a10_0x1dadf3(Text,{'bold':!![],'children':[_0x3be81c(0x220),getRemainingSpaces(_0x493bf7,_0x3be81c(0x1fd))]})]}),_0x3564c3[_0x3be81c(0x21e)](_0x21ab65=>a10_0x1dadf3(Box,{'children':[a10_0x1dadf3(Text,{'children':['\x20\x20',_0x21ab65[_0x3be81c(0x1ea)],getRemainingSpaces(_0x4c0878,_0x21ab65[_0x3be81c(0x1ea)])]}),a10_0x1dadf3(Text,{'color':_0x3be81c(0x226),'children':[_0x21ab65[_0x3be81c(0x1e4)]?'✓':'✗',getRemainingSpaces(_0x493bf7,'✓')]}),a10_0x1dadf3(Text,{'color':_0x21ab65[_0x3be81c(0x218)]?_0x3be81c(0x226):_0x3be81c(0x1ee),'children':[_0x21ab65[_0x3be81c(0x218)]?'✓':'✗',getRemainingSpaces(_0x493bf7,'✓')]})]},_0x21ab65['path']))]}),_0x27343==='selecting'&&_0xd230b5[_0x3be81c(0x1f5)]===0x0&&a10_0x5b784b(Box,{'marginTop':0x1,'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x214),'children':_0x3be81c(0x1eb)})}),_0xd230b5[_0x3be81c(0x21e)]((_0x217b5a,_0xf5035b)=>a10_0x1dadf3(Box,{'children':[a10_0x1dadf3(Text,{'color':_0x3be81c(0x226),'children':['√\x20',_0x217b5a['label'],':\x20']}),a10_0x5b784b(Text,{'color':_0x3be81c(0x214),'children':_0x217b5a['value']})]},_0xf5035b)),_0x9fc392&&_0x27343===_0x3be81c(0x1e8)&&a10_0x5b784b(Box,{'marginTop':0x1,'children':a10_0x1dadf3(Text,{'color':'red','children':['✗\x20',_0x9fc392]})}),_0x27343==='selecting'&&a10_0x5b784b(a10_0x590dab,{'children':a10_0x1dadf3(Box,{'marginTop':_0xd230b5[_0x3be81c(0x1f5)]>0x0||_0x9fc392?0x1:0x0,'flexDirection':_0x3be81c(0x210),'children':[a10_0x5b784b(Text,{'bold':!![],'children':_0x3be81c(0x21f)}),_0x529108[_0x3be81c(0x21e)]((_0xc9a14c,_0x11ed3a)=>{const _0x26fe8c=_0x3be81c,_0x16746a=_0xf5fe48===_0x11ed3a,_0x294cf5=_0x350e80[_0x26fe8c(0x1e9)](_0x11ed3a),_0x4c8b8e=_0x8d4da0['includes'](_0xc9a14c['path']),_0x1e52b1=_0x4c8b8e?'更新':'新建';return a10_0x5b784b(Box,{'children':a10_0x1dadf3(Text,{'backgroundColor':_0x16746a?_0x26fe8c(0x1fa):undefined,'color':_0x16746a?'white':undefined,'children':['\x20\x20',_0x294cf5?_0x26fe8c(0x202):_0x26fe8c(0x208),'\x20',_0xc9a14c[_0x26fe8c(0x1ea)]]})},_0xc9a14c[_0x26fe8c(0x1f4)]);}),a10_0x5b784b(Box,{'marginTop':0x1,'children':a10_0x1dadf3(Text,{'color':_0x3be81c(0x203),'children':['\x20',_0x3be81c(0x213)]})})]})}),_0x27343===_0x3be81c(0x211)&&a10_0x1dadf3(a10_0x590dab,{'children':[a10_0x1dadf3(Box,{'children':[a10_0x5b784b(Text,{'children':_0x3be81c(0x1f1)}),a10_0x5b784b(Text,{'color':_0x3be81c(0x226),'children':_0x12c740}),_0x9fc392&&a10_0x1dadf3(Text,{'color':'red','children':[_0x3be81c(0x200),_0x9fc392]})]}),!_0x9fc392&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x203),'children':_0x3be81c(0x1f0)})})]}),_0x27343==='input-css'&&a10_0x1dadf3(a10_0x590dab,{'children':[a10_0x1dadf3(Box,{'children':[a10_0x5b784b(Text,{'children':_0x3be81c(0x1ec)}),a10_0x5b784b(Text,{'color':'green','children':_0x12c740}),_0x9fc392&&a10_0x1dadf3(Text,{'color':_0x3be81c(0x1ee),'children':[_0x3be81c(0x200),_0x9fc392]})]}),!_0x9fc392&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'color':'gray','children':_0x3be81c(0x1fc)})})]}),_0x27343===_0x3be81c(0x224)&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'children':_0x3be81c(0x1ef)})}),_0x27343==='done'&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x226),'children':_0x3be81c(0x219)})})]});}function getStringWidth(_0x4eac54){const _0xbe8590=a10_0x2682f6;let _0x4440c0=0x0;for(const _0x1429b3 of _0x4eac54){/[\u4e00-\u9fa5]/[_0xbe8590(0x21a)](_0x1429b3)?_0x4440c0+=0x2:_0x4440c0+=0x1;}return _0x4440c0;}function getRemainingSpaces(_0x1b480e,_0x118154){const _0x13440b=a10_0x2682f6,_0x56d868=getStringWidth(_0x118154);return Array(Math[_0x13440b(0x1e7)](0x0,_0x1b480e-_0x56d868))[_0x13440b(0x223)]('\x20')['join']('');}function getMaxWidth(_0x2ca47c,_0xa4f6b4=0x2){let _0x4ab61e='',_0x4d0175=0x0;for(const _0x258c02 of _0x2ca47c){const _0x1480b9=getStringWidth(_0x258c02);_0x1480b9>_0x4d0175&&(_0x4d0175=_0x1480b9,_0x4ab61e=_0x258c02);}return _0x4ab61e+'\x20'['repeat'](_0xa4f6b4);}
|