@lovrabet/cli 1.1.16 → 1.1.18
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 -0
- 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/valid-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/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
- package/lib/api/fetch-datasets.js +0 -1
- package/lib/api/format-dataset.js +0 -1
- package/lib/api/pull.js +0 -1
- package/lib/api/types.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a12_0x4072(_0x21204e,_0x4cc736){const _0x4d397c=a12_0x4d39();return a12_0x4072=function(_0x407241,_0x398cd2){_0x407241=_0x407241-0x19f;let _0x1aaa34=_0x4d397c[_0x407241];return _0x1aaa34;},a12_0x4072(_0x21204e,_0x4cc736);}const a12_0x401e7a=a12_0x4072;(function(_0x3f6e7a,_0x51a1c4){const _0x26e320=a12_0x4072,_0x13ebd5=_0x3f6e7a();while(!![]){try{const _0x2cece0=parseInt(_0x26e320(0x1a0))/0x1+parseInt(_0x26e320(0x1ab))/0x2*(-parseInt(_0x26e320(0x1b2))/0x3)+-parseInt(_0x26e320(0x1a9))/0x4*(parseInt(_0x26e320(0x1b4))/0x5)+parseInt(_0x26e320(0x1a5))/0x6+-parseInt(_0x26e320(0x1ac))/0x7*(parseInt(_0x26e320(0x1b1))/0x8)+-parseInt(_0x26e320(0x1b3))/0x9*(-parseInt(_0x26e320(0x1af))/0xa)+parseInt(_0x26e320(0x1a8))/0xb;if(_0x2cece0===_0x51a1c4)break;else _0x13ebd5['push'](_0x13ebd5['shift']());}catch(_0x4cc884){_0x13ebd5['push'](_0x13ebd5['shift']());}}}(a12_0x4d39,0x9517d));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve}from'path';const pagesDir=resolve(process[a12_0x401e7a(0x19f)](),a12_0x401e7a(0x1b0));export function extractTitleFromComment(_0x2b1f00){const _0x436d9d=a12_0x401e7a;try{const _0x428180=readFileSync(_0x2b1f00,_0x436d9d(0x1a3)),_0x436bd8=_0x428180[_0x436d9d(0x1a1)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x436bd8&&_0x436bd8[0x1]){const _0xfb4be3=_0x436bd8[0x1],_0x3161a4=_0xfb4be3[_0x436d9d(0x1a1)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x3161a4&&_0x3161a4[0x1])return _0x3161a4[0x1]['trim']();}let _0x282824=null;const _0x3ad3a0=_0x428180['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x3ad3a0&&_0x3ad3a0[0x1]&&(_0x282824=_0x3ad3a0[0x1]);if(!_0x282824){const _0x584872=_0x428180['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x584872&&_0x584872[0x1]&&(_0x282824=_0x584872[0x1]);}if(_0x282824){const _0x2f626f=new RegExp('\x5cb'+_0x282824+_0x436d9d(0x1a4)),_0x49383a=_0x428180['match'](_0x2f626f);if(_0x49383a&&_0x49383a[0x1])return _0x49383a[0x1];return _0x282824;}return null;}catch(_0x353ecf){return null;}}function a12_0x4d39(){const _0x2f0483=['2552803tjUArS','1132yaPNdb','forEach','754612uivtfn','7vEfxcS','concat','endsWith','10gZewGf','src/pages','4259720YXkIoX','9NLdvlq','9550449tmNjNY','4240sCZbCl','cwd','904524hxezij','match','replace','utf-8','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','1903764MIuaDW','push','filter'];a12_0x4d39=function(){return _0x2f0483;};return a12_0x4d39();}export function getLocalPages(_0x25b28c=pagesDir,_0x171cbf=pagesDir){const _0x4c4cb4=a12_0x401e7a;let _0x16b644=[];const _0x164725=readdirSync(_0x25b28c);return _0x164725[_0x4c4cb4(0x1aa)](_0x13c4a9=>{const _0x188b42=_0x4c4cb4,_0x3fd233=join(_0x25b28c,_0x13c4a9),_0x1128dd=statSync(_0x3fd233);if(_0x1128dd&&_0x1128dd['isDirectory']())_0x16b644=_0x16b644[_0x188b42(0x1ad)](getLocalPages(_0x3fd233,_0x171cbf));else{if(_0x13c4a9[_0x188b42(0x1ae)]('.tsx')){let _0x1f7f19=relative(_0x171cbf,_0x3fd233);_0x1f7f19[_0x188b42(0x1ae)]('index.tsx')?_0x1f7f19=_0x1f7f19[_0x188b42(0x1a2)](/index\.tsx$/,''):_0x1f7f19=_0x1f7f19[_0x188b42(0x1a2)](/\.tsx$/,'');_0x1f7f19[_0x188b42(0x1ae)]('/')&&(_0x1f7f19=_0x1f7f19['slice'](0x0,-0x1));const _0x10b1ae=extractTitleFromComment(_0x3fd233),_0x2699fa=_0x10b1ae||_0x1f7f19;_0x16b644[_0x188b42(0x1a6)]({'path':_0x1f7f19,'label':_0x2699fa});}}}),_0x16b644[_0x4c4cb4(0x1a7)](_0x27acb3=>_0x27acb3['path']!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a13_0x1071(){const _0x561156=['780352nVlgOL','3430074vMIBcY','then','!\x20请使用以下方式之一:','error','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','1448935ZKaIDa','path','map','json','567517hbStWo','672875wwDDvx','log','1766004iCLBoW','×\x20未提供应用AppCode,且配置中也没有默认值','GET','label','application/json','1545804yPgzfe','finally','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>'];a13_0x1071=function(){return _0x561156;};return a13_0x1071();}(function(_0x12b5c6,_0x3b84cc){const _0x2e762c=a13_0x3b3f,_0x1e08a7=_0x12b5c6();while(!![]){try{const _0x4393ea=-parseInt(_0x2e762c(0xc4))/0x1+parseInt(_0x2e762c(0xba))/0x2+parseInt(_0x2e762c(0xb7))/0x3+parseInt(_0x2e762c(0xb2))/0x4+parseInt(_0x2e762c(0xc0))/0x5+-parseInt(_0x2e762c(0xbb))/0x6+-parseInt(_0x2e762c(0xc5))/0x7;if(_0x4393ea===_0x3b84cc)break;else _0x1e08a7['push'](_0x1e08a7['shift']());}catch(_0x257fe7){_0x1e08a7['push'](_0x1e08a7['shift']());}}}(a13_0x1071,0x62003));import{useEffect,useState}from'react';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';function a13_0x3b3f(_0x1f5334,_0x574a36){const _0x107151=a13_0x1071();return a13_0x3b3f=function(_0x3b3fbf,_0xad0c88){_0x3b3fbf=_0x3b3fbf-0xb2;let _0x553699=_0x107151[_0x3b3fbf];return _0x553699;},a13_0x3b3f(_0x1f5334,_0x574a36);}const config=readConfig();export async function getOnlineMenuList(){const _0xbae353=a13_0x3b3f,_0x35e60d=config?.['appcode'];if(!_0x35e60d)return console[_0xbae353(0xbe)](_0xbae353(0xb3)),console[_0xbae353(0xc6)](_0xbae353(0xbd)),console['log'](_0xbae353(0xb9)),console[_0xbae353(0xc6)](_0xbae353(0xbf)),[];const _0x2531c1=await fetch(getApiDomain()+'/smartapi/menu/find?appCode='+_0x35e60d,{'method':_0xbae353(0xb4),'headers':{'Content-Type':_0xbae353(0xb6),'Cookie':getCookie()}});if(_0x2531c1['ok']){const {data:_0x2c9d2b}=await _0x2531c1[_0xbae353(0xc3)]();return _0x2c9d2b[_0xbae353(0xc2)](_0x2d655b=>({'path':_0x2d655b[_0xbae353(0xc1)],'label':_0x2d655b[_0xbae353(0xb5)]}));}return[];}export function useGetOnlineMenuList(){const [_0xcafe5a,_0x78432d]=useState([]),[_0x33132e,_0x3af292]=useState(!![]);return useEffect(()=>{const _0x44465c=a13_0x3b3f;_0x3af292(!![]),getOnlineMenuList()[_0x44465c(0xbc)](_0x78432d)[_0x44465c(0xb8)](()=>_0x3af292(![]));},[]),{'menuList':_0xcafe5a,'loading':_0x33132e};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5091a7,_0x41e17b){const _0x1d3cea=a15_0x29da,_0x4dab50=_0x5091a7();while(!![]){try{const _0x3b7334=-parseInt(_0x1d3cea(0xd7))/0x1*(parseInt(_0x1d3cea(0xdb))/0x2)+parseInt(_0x1d3cea(0xd8))/0x3*(-parseInt(_0x1d3cea(0xda))/0x4)+-parseInt(_0x1d3cea(0xd1))/0x5+-parseInt(_0x1d3cea(0xd3))/0x6+-parseInt(_0x1d3cea(0xd4))/0x7+parseInt(_0x1d3cea(0xd0))/0x8*(parseInt(_0x1d3cea(0xd2))/0x9)+parseInt(_0x1d3cea(0xdc))/0xa*(parseInt(_0x1d3cea(0xdd))/0xb);if(_0x3b7334===_0x41e17b)break;else _0x4dab50['push'](_0x4dab50['shift']());}catch(_0x5f082b){_0x4dab50['push'](_0x4dab50['shift']());}}}(a15_0x3bae,0xb82c0));export function isValidJsHttpsUrl(_0x12d041){const _0x580ca6=a15_0x29da;return/^https:\/\/.+\.js(\?.*)?$/[_0x580ca6(0xd6)](_0x12d041[_0x580ca6(0xd9)]());}function a15_0x29da(_0x37f4cc,_0x1089e8){const _0x3bae41=a15_0x3bae();return a15_0x29da=function(_0x29da8a,_0x25e2e6){_0x29da8a=_0x29da8a-0xd0;let _0x316646=_0x3bae41[_0x29da8a];return _0x316646;},a15_0x29da(_0x37f4cc,_0x1089e8);}export function isValidCssHttpsUrl(_0x290281){const _0x44c446=a15_0x29da;return/^https:\/\/.+\.css(\?.*)?$/[_0x44c446(0xd6)](_0x290281['trim']());}function a15_0x3bae(){const _0x66aef3=['trim','4689964wOeNDh','76078zblqKu','1450fQggpZ','329197pewFTK','12744BqGYnx','2574830jKqEFr','2043qUyrYj','5586648EVVkCS','3704918oMYjCz','HEAD','test','21YUfaAX','3NmWZtW'];a15_0x3bae=function(){return _0x66aef3;};return a15_0x3bae();}export async function isUrlReachable(_0x380ae4){const _0x36cbb9=a15_0x29da;try{const _0x4dd033=await fetch(_0x380ae4,{'method':_0x36cbb9(0xd5)});return _0x4dd033['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d4524,_0x283f90){const _0x3e786d=a16_0x5042,_0x45d61b=_0x2d4524();while(!![]){try{const _0x1ac4a5=-parseInt(_0x3e786d(0x155))/0x1+-parseInt(_0x3e786d(0x150))/0x2*(parseInt(_0x3e786d(0x15d))/0x3)+-parseInt(_0x3e786d(0x158))/0x4*(-parseInt(_0x3e786d(0x156))/0x5)+-parseInt(_0x3e786d(0x14e))/0x6+parseInt(_0x3e786d(0x15e))/0x7*(parseInt(_0x3e786d(0x154))/0x8)+-parseInt(_0x3e786d(0x15b))/0x9+parseInt(_0x3e786d(0x152))/0xa*(parseInt(_0x3e786d(0x153))/0xb);if(_0x1ac4a5===_0x283f90)break;else _0x45d61b['push'](_0x45d61b['shift']());}catch(_0x440c4a){_0x45d61b['push'](_0x45d61b['shift']());}}}(a16_0x20a2,0x74150));import{jsx as a16_0x4cdc62,jsxs as a16_0x3df568}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';function a16_0x5042(_0x306665,_0x576266){const _0x20a21e=a16_0x20a2();return a16_0x5042=function(_0x50424b,_0x51b569){_0x50424b=_0x50424b-0x14c;let _0x1776b1=_0x20a21e[_0x50424b];return _0x1776b1;},a16_0x5042(_0x306665,_0x576266);}import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a16_0x3dec05 from'ink-spinner';export function AuthServer(){const _0x2f86ca=a16_0x5042,{exit:_0x318556}=useApp(),[_0x55c181,_0x42e6e4]=useState(![]),[_0x35b2f0,_0x5b3995]=useState(!![]),[_0x2cca3f,_0x271ede]=useState(![]),[_0x5573a0,_0x56bd9b]=useState(![]);useEffect(()=>{const _0x448c7a=a16_0x5042;getIsSessionValid()['then'](_0x42e6e4)[_0x448c7a(0x15f)](()=>_0x5b3995(![]));},[]),useEffect(()=>{!_0x35b2f0&&_0x55c181&&(console['log']('√\x20当前为有效会话,无需重新登录。'),_0x318556());},[_0x35b2f0,_0x55c181,_0x318556]),useEffect(()=>{const _0x4a4c16=a16_0x5042;_0x5573a0&&(console[_0x4a4c16(0x157)](_0x4a4c16(0x15a)),_0x318556());},[_0x5573a0,_0x318556]),useInput((_0x209dc0,_0x46e9bb)=>{const _0x390923=a16_0x5042;_0x46e9bb[_0x390923(0x159)]&&(_0x271ede(!![]),authServer({'silent':!![]})['then'](_0x50d303=>{_0x56bd9b(_0x50d303);})),_0x209dc0==='q'&&_0x318556();});if(_0x35b2f0)return null;if(_0x55c181||_0x5573a0)return null;return a16_0x4cdc62(Box,{'flexDirection':_0x2f86ca(0x14c),'marginTop':0x1,'marginBottom':0x1,'children':_0x2cca3f?a16_0x3df568(Box,{'children':[a16_0x4cdc62(Box,{'width':'1'}),a16_0x3df568(Text,{'color':'green','children':[a16_0x4cdc62(a16_0x3dec05,{'type':'dots'}),'\x20\x20']}),a16_0x4cdc62(Text,{'children':_0x2f86ca(0x14f)}),a16_0x4cdc62(Text,{'color':_0x2f86ca(0x15c),'children':'请前往浏览器完成登录。'})]}):a16_0x3df568(Box,{'children':[a16_0x4cdc62(Box,{'width':'1'}),a16_0x4cdc62(Text,{'children':_0x2f86ca(0x151)}),a16_0x4cdc62(Text,{'color':'gray','children':_0x2f86ca(0x14d)})]})});}function a16_0x20a2(){const _0x4a9245=['4313992OttceK','855127ZPMlFk','250vsRPhq','log','20444EtMdCz','return','*\x20登录成功!','6657804KKXdQb','gray','49782RFlXtv','7FRaQaq','finally','column','按\x20“q”\x20退出。','3494268RkEIJn','正在登录...\x20','110LCiYhQ','*\x20按回车开始登录。','27706040TcJQnw','11OXFxJZ'];a16_0x20a2=function(){return _0x4a9245;};return a16_0x20a2();}
|
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x1f7cd7=a17_0x3f5f;(function(_0x23d47c,_0x4281e0){const _0x137e62=a17_0x3f5f,_0x255c5c=_0x23d47c();while(!![]){try{const _0x32df43=parseInt(_0x137e62(0x1b3))/0x1*(parseInt(_0x137e62(0x19b))/0x2)+parseInt(_0x137e62(0x1b2))/0x3*(parseInt(_0x137e62(0x1a4))/0x4)+-parseInt(_0x137e62(0x1af))/0x5+-parseInt(_0x137e62(0x1ae))/0x6*(-parseInt(_0x137e62(0x1ad))/0x7)+-parseInt(_0x137e62(0x1a3))/0x8+-parseInt(_0x137e62(0x1a0))/0x9+-parseInt(_0x137e62(0x1bf))/0xa;if(_0x32df43===_0x4281e0)break;else _0x255c5c['push'](_0x255c5c['shift']());}catch(_0x569c63){_0x255c5c['push'](_0x255c5c['shift']());}}}(a17_0x1752,0x4b844));import{writeFileSync}from'node:fs';import a17_0x20fd4b from'node:https';import{getUserDomain}from'../constant/domain.js';function a17_0x3f5f(_0x443fdd,_0x1393a7){const _0x1752ff=a17_0x1752();return a17_0x3f5f=function(_0x3f5f30,_0x50b244){_0x3f5f30=_0x3f5f30-0x196;let _0xddad9d=_0x1752ff[_0x3f5f30];return _0xddad9d;},a17_0x3f5f(_0x443fdd,_0x1393a7);}import{exec}from'node:child_process';function a17_0x1752(){const _0xa25d0d=['1609504EpZyyJ','567860DtJTMe','listen','https://dev.lovrabet.com:','address','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','/api/auth/get-session','object','silent','✅\x20浏览器已自动打开,请在浏览器中完成登录','56kBVSYv','171366kYiHwY','1979345dWTUUz','session','text/html;\x20charset=utf-8','9rSEgGq','327hFUpeL','/sign-in?redirect=','utf-8','writeHead','127.0.0.1','error','cookie','🔗\x20请手动复制登录地址到浏览器:','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>','isAuth','port','end','295790SWAkFp','log','json','open\x20\x22','createServer','close','catch','Auth\x20server\x20error:','🌐\x20正在尝试自动打开浏览器...','headers','2160cMOkFR','then','darwin','user','🔐\x20正在启动登录服务...','644319IiIIpO','⚠️\x20\x20无法自动打开浏览器','https://g.yuntooai.com/cert/lovrabet-dev.json'];a17_0x1752=function(){return _0xa25d0d;};return a17_0x1752();}import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';export async function authServer(_0x23eece){const _0x17cbaf=a17_0x3f5f,_0x3d7337=_0x23eece?.[_0x17cbaf(0x1ab)]||![];if(await getIsSessionValid())return!![];const _0x2cae21=await(await fetch(_0x17cbaf(0x1a2)))[_0x17cbaf(0x1c1)]();return new Promise(async(_0x32a24f,_0x1caa66)=>{const _0x27a05a=_0x17cbaf;let _0x35ceba=0x0;const _0x4f6a19=a17_0x20fd4b[_0x27a05a(0x1c3)](_0x2cae21,async(_0x417418,_0x54cb94)=>{const _0xcd7c48=_0x27a05a,_0xaf5ab7=getUserDomain(),_0xe53922=_0x417418[_0xcd7c48(0x19a)][_0xcd7c48(0x1b9)]||'',_0x19e8e4=await fetch(_0xaf5ab7+_0xcd7c48(0x1a9),{'headers':{'cookie':_0xe53922}})[_0xcd7c48(0x19c)](_0x24308e=>_0x24308e[_0xcd7c48(0x1c1)]()),_0x52ae0e=_0x19e8e4&&_0x19e8e4[_0xcd7c48(0x1b0)]&&_0x19e8e4[_0xcd7c48(0x19e)];if(_0x52ae0e){writeFileSync(cookieFile,_0xe53922,_0xcd7c48(0x1b5)),_0x32a24f(!![]);const _0xc8fd4f=_0xcd7c48(0x1bb);_0x54cb94[_0xcd7c48(0x1b6)](0xc8,{'Content-Type':_0xcd7c48(0x1b1)}),_0x54cb94[_0xcd7c48(0x1be)](_0xc8fd4f),_0x4f6a19[_0xcd7c48(0x196)]();}else{const _0x145eb1=''+encodeURIComponent(_0xcd7c48(0x1a6)+_0x35ceba);_0x54cb94[_0xcd7c48(0x1b6)](0x12e,{'location':_0xaf5ab7+_0xcd7c48(0x1b4)+_0x145eb1}),_0x54cb94[_0xcd7c48(0x1be)]();return;}});_0x4f6a19[_0x27a05a(0x1a5)](0x0,_0x27a05a(0x1b7),()=>{const _0x59b0bf=_0x27a05a,_0x10ed8b=_0x4f6a19[_0x59b0bf(0x1a7)]();_0x35ceba=typeof _0x10ed8b===_0x59b0bf(0x1aa)&&_0x10ed8b?_0x10ed8b[_0x59b0bf(0x1bd)]:Number(_0x10ed8b);const _0x36b733=_0x59b0bf(0x1a6)+_0x35ceba;!_0x3d7337&&(console['log'](_0x59b0bf(0x19f)),console['log']('📍\x20登录地址:',_0x36b733),console[_0x59b0bf(0x1c0)](_0x59b0bf(0x199)),console[_0x59b0bf(0x1c0)](''),console[_0x59b0bf(0x1c0)](_0x59b0bf(0x1a8)),console[_0x59b0bf(0x1c0)]('')),openInBrowser(_0x36b733)[_0x59b0bf(0x19c)](_0x1675d3=>{const _0xc4d6b7=_0x59b0bf;!_0x3d7337&&(_0x1675d3?console['log'](_0xc4d6b7(0x1ac)):(console[_0xc4d6b7(0x1c0)]('⚠️\x20\x20无法自动打开浏览器'),console['log'](_0xc4d6b7(0x1ba),_0x36b733)),console[_0xc4d6b7(0x1c0)](''));})[_0x59b0bf(0x197)](()=>{const _0x5e24c0=_0x59b0bf;!_0x3d7337&&(console['log'](_0x5e24c0(0x1a1)),console[_0x5e24c0(0x1c0)]('🔗\x20请手动复制登录地址到浏览器:',_0x36b733),console['log'](''));});}),_0x4f6a19['on'](_0x27a05a(0x1b8),_0x93d1a2=>{const _0x388347=_0x27a05a;!_0x3d7337&&console[_0x388347(0x1b8)](_0x388347(0x198),_0x93d1a2),_0x1caa66(_0x93d1a2);});});}function openInBrowser(_0x57ba4e){return new Promise(_0x1faa70=>{const _0x31d559=a17_0x3f5f,_0x15a79a=process['platform'];let _0x4725c6;if(_0x15a79a==='win32')_0x4725c6='start\x20\x22\x22\x20\x22'+_0x57ba4e+'\x22';else _0x15a79a===_0x31d559(0x19d)?_0x4725c6=_0x31d559(0x1c2)+_0x57ba4e+'\x22':_0x4725c6='xdg-open\x20\x22'+_0x57ba4e+'\x22';exec(_0x4725c6,_0x186384=>{_0x186384?_0x1faa70(![]):_0x1faa70(!![]);});});}if(import.meta['main']){const isAuth=await authServer();console[a17_0x1f7cd7(0x1c0)](a17_0x1f7cd7(0x1bc),isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x444524,_0x54a92f){const _0x488e16=a18_0x5f5b,_0x18c8cf=_0x444524();while(!![]){try{const _0x59f954=-parseInt(_0x488e16(0xd3))/0x1*(-parseInt(_0x488e16(0xce))/0x2)+parseInt(_0x488e16(0xd4))/0x3*(-parseInt(_0x488e16(0xcf))/0x4)+-parseInt(_0x488e16(0xd1))/0x5*(-parseInt(_0x488e16(0xd6))/0x6)+parseInt(_0x488e16(0xd5))/0x7*(parseInt(_0x488e16(0xcd))/0x8)+-parseInt(_0x488e16(0xd2))/0x9*(parseInt(_0x488e16(0xd8))/0xa)+parseInt(_0x488e16(0xd0))/0xb+-parseInt(_0x488e16(0xd7))/0xc;if(_0x59f954===_0x54a92f)break;else _0x18c8cf['push'](_0x18c8cf['shift']());}catch(_0x83e9f2){_0x18c8cf['push'](_0x18c8cf['shift']());}}}(a18_0x445f,0xce586));import{mkdirSync}from'node:fs';import{homedir}from'node:os';function a18_0x5f5b(_0x218810,_0x8b7715){const _0x445fb2=a18_0x445f();return a18_0x5f5b=function(_0x5f5ba3,_0xac9088){_0x5f5ba3=_0x5f5ba3-0xcd;let _0x3eeb66=_0x445fb2[_0x5f5ba3];return _0x3eeb66;},a18_0x5f5b(_0x218810,_0x8b7715);}export const configDir=homedir()+'/.lovrabet';function a18_0x445f(){const _0xba24=['3918inRybm','1803264NHKkfK','46170zLVpJz','278736FMnaGL','1751242vvRQaM','1071108WVSCNQ','4757126QxeGgX','3230KZwFdZ','999ZWLbll','1vnYhdN','6OhYVNS','63gtSwLY'];a18_0x445f=function(){return _0xba24;};return a18_0x445f();}export const cookieFile=configDir+'/cookie';mkdirSync(configDir,{'recursive':!![]});
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54592d,_0x208a8d){var _0x372c52=a19_0xc251,_0x152531=_0x54592d();while(!![]){try{var _0x59bcdd=-parseInt(_0x372c52(0x10f))/0x1*(parseInt(_0x372c52(0x110))/0x2)+-parseInt(_0x372c52(0x115))/0x3+parseInt(_0x372c52(0x114))/0x4+parseInt(_0x372c52(0x112))/0x5+parseInt(_0x372c52(0x113))/0x6+-parseInt(_0x372c52(0x111))/0x7+parseInt(_0x372c52(0x10e))/0x8;if(_0x59bcdd===_0x208a8d)break;else _0x152531['push'](_0x152531['shift']());}catch(_0x1f1483){_0x152531['push'](_0x152531['shift']());}}}(a19_0x4537,0x761df));function a19_0x4537(){var _0x408b23=['806058iyKWQj','2402276PVypdV','2354631nuocMt','utf-8','1868952YbUxyu','1CtezUY','311522oxvYgw','2200247MoNNcU','3851175DwdFqT'];a19_0x4537=function(){return _0x408b23;};return a19_0x4537();}import{readFileSync}from'node:fs';function a19_0xc251(_0x17a262,_0x2f523b){var _0x4537cc=a19_0x4537();return a19_0xc251=function(_0xc251eb,_0x48c28e){_0xc251eb=_0xc251eb-0x10e;var _0x50a1d6=_0x4537cc[_0xc251eb];return _0x50a1d6;},a19_0xc251(_0x17a262,_0x2f523b);}import{cookieFile}from'./constant.js';export function getCookie(){var _0x4848bf=a19_0xc251;try{return readFileSync(cookieFile,_0x4848bf(0x116));}catch{}return'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4cc552,_0x56a4e2){const _0x33f7f8=a20_0x4205,_0x49d577=_0x4cc552();while(!![]){try{const _0x3246a2=parseInt(_0x33f7f8(0x138))/0x1*(parseInt(_0x33f7f8(0x144))/0x2)+parseInt(_0x33f7f8(0x139))/0x3*(-parseInt(_0x33f7f8(0x140))/0x4)+parseInt(_0x33f7f8(0x13d))/0x5*(-parseInt(_0x33f7f8(0x13c))/0x6)+parseInt(_0x33f7f8(0x143))/0x7+parseInt(_0x33f7f8(0x145))/0x8+-parseInt(_0x33f7f8(0x13e))/0x9*(parseInt(_0x33f7f8(0x13b))/0xa)+parseInt(_0x33f7f8(0x13a))/0xb;if(_0x3246a2===_0x56a4e2)break;else _0x49d577['push'](_0x49d577['shift']());}catch(_0x424fef){_0x49d577['push'](_0x49d577['shift']());}}}(a20_0x8c2a,0xd1bc3));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';function a20_0x8c2a(){const _0x2ba627=['36iEebui','session','96CDAtOS','json','utf-8','9649395ahveuS','550858nZMnrN','694760pddENn','user','/api/auth/get-session','1oeMrph','212508zkiFhn','34903506fAOVwv','3651580bslsiJ','6XSDOfk','4470170ChlzZm'];a20_0x8c2a=function(){return _0x2ba627;};return a20_0x8c2a();}function a20_0x4205(_0x373207,_0x4f4be7){const _0x8c2ade=a20_0x8c2a();return a20_0x4205=function(_0x42054b,_0x19c3e3){_0x42054b=_0x42054b-0x138;let _0x57312c=_0x8c2ade[_0x42054b];return _0x57312c;},a20_0x4205(_0x373207,_0x4f4be7);}export async function getIsSessionValid(){const _0x19c4be=a20_0x4205;try{if(!existsSync(cookieFile))return![];const _0x32aa7e=readFileSync(cookieFile,_0x19c4be(0x142)),_0x47457d=await fetch(getUserDomain()+_0x19c4be(0x147),{'headers':{'cookie':_0x32aa7e}})['then'](_0x47c53b=>_0x47c53b[_0x19c4be(0x141)]());return _0x47457d&&_0x47457d[_0x19c4be(0x13f)]&&_0x47457d[_0x19c4be(0x146)];}catch{}return![];}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a21_0x41b0(_0x425404,_0x131305){var _0x4dfe15=a21_0x4dfe();return a21_0x41b0=function(_0x41b0e7,_0x571813){_0x41b0e7=_0x41b0e7-0x18e;var _0x3a8dae=_0x4dfe15[_0x41b0e7];return _0x3a8dae;},a21_0x41b0(_0x425404,_0x131305);}(function(_0xde63b1,_0x542399){var _0x9bc6ac=a21_0x41b0,_0x3cd178=_0xde63b1();while(!![]){try{var _0x3c25d0=parseInt(_0x9bc6ac(0x193))/0x1+-parseInt(_0x9bc6ac(0x19a))/0x2+parseInt(_0x9bc6ac(0x194))/0x3*(-parseInt(_0x9bc6ac(0x190))/0x4)+parseInt(_0x9bc6ac(0x195))/0x5*(parseInt(_0x9bc6ac(0x198))/0x6)+-parseInt(_0x9bc6ac(0x18e))/0x7*(-parseInt(_0x9bc6ac(0x18f))/0x8)+parseInt(_0x9bc6ac(0x191))/0x9+parseInt(_0x9bc6ac(0x199))/0xa*(parseInt(_0x9bc6ac(0x196))/0xb);if(_0x3c25d0===_0x542399)break;else _0x3cd178['push'](_0x3cd178['shift']());}catch(_0x1e05f1){_0x3cd178['push'](_0x3cd178['shift']());}}}(a21_0x4dfe,0x4401a));function a21_0x4dfe(){var _0x460ede=['!\x20当前未登录','158587fTBCne','9bWyHou','38640NuAjhg','140327JaIwRO','log','78VyQKqJ','70udIutV','1004046iZwvrG','14GQQnUa','1497160YaLols','482872iqSOqM','3780819IEgnrw'];a21_0x4dfe=function(){return _0x460ede;};return a21_0x4dfe();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';export function logout(){var _0x28c567=a21_0x41b0;existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20已退出登录')):console[_0x28c567(0x197)](_0x28c567(0x192));}
|
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a22_0x553afe=a22_0x61ba;(function(_0x2b5f08,_0x4c2a29){const _0x2eb896=a22_0x61ba,_0x4427be=_0x2b5f08();while(!![]){try{const _0x2daece=parseInt(_0x2eb896(0x94))/0x1+-parseInt(_0x2eb896(0x8e))/0x2*(-parseInt(_0x2eb896(0x8a))/0x3)+parseInt(_0x2eb896(0x7e))/0x4+-parseInt(_0x2eb896(0x86))/0x5+parseInt(_0x2eb896(0x7b))/0x6*(-parseInt(_0x2eb896(0x81))/0x7)+-parseInt(_0x2eb896(0x79))/0x8*(-parseInt(_0x2eb896(0x87))/0x9)+-parseInt(_0x2eb896(0xa2))/0xa*(parseInt(_0x2eb896(0x85))/0xb);if(_0x2daece===_0x4c2a29)break;else _0x4427be['push'](_0x4427be['shift']());}catch(_0x5b01c5){_0x4427be['push'](_0x4427be['shift']());}}}(a22_0x3cc9,0x6f599));import{jsx as a22_0x520c57}from'react/jsx-runtime';import a22_0x291ca4 from'meow';import{render}from'ink';import{CreateApp}from'./create-app/main.js';import{AddPage}from'./add-page/main.js';import{Init}from'./init/main.js';import{runStart}from'./cmd/start.js';import{runBuild}from'./cmd/build.js';import{runPreview}from'./cmd/preview.js';import{runBuildWatch}from'./cmd/build-watch.js';import{Config}from'./config/main.js';import{apiCli}from'./api/main.js';function a22_0x3cc9(){const _0x51a12e=['page','string','input','exit','setRawCommand','add','argv','\x20(监听模式)','config','211530oUJUnd','trim','create','api','preview','info','lovrabet\x20','441448fdtMUE','setLogPath','6kKdGyw','cwd','init','1831952lqRCfd','build','执行预览命令','5510498jotQqq','error','add-page','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20在现有项目中初始化\x20.lovrabetrc\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20init\x20--appcode\x20<code>\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x20初始化配置文件\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20create\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建项目并指定环境\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20sync\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20同步菜单\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20api\x20doc\x20--[options]\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','396Bfioze','294590VkWMDm','27jRIauz','boolean','auth','7842vRJdim','clear','logs','sync','570LsYVnl','slice','all','flags','执行构建命令','执行启动命令','695208HAvBsT','执行添加页面命令','watch','start','env'];a22_0x3cc9=function(){return _0x51a12e;};return a22_0x3cc9();}import{AuthServer}from'./auth/auth-server-ui.js';import{logout}from'./auth/logout.js';function a22_0x61ba(_0x338a98,_0x15d0d0){const _0x3cc9cf=a22_0x3cc9();return a22_0x61ba=function(_0x61bae2,_0x19280f){_0x61bae2=_0x61bae2-0x76;let _0x236c40=_0x3cc9cf[_0x61bae2];return _0x236c40;},a22_0x61ba(_0x338a98,_0x15d0d0);}import{Help}from'./help.js';import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';import{AppMenuSyncUI}from'./app-menu/app-menu-sync-ui.js';const cli=a22_0x291ca4(a22_0x553afe(0x84),{'importMeta':import.meta,'flags':{'name':{'type':a22_0x553afe(0x9a)},'clear':{'type':a22_0x553afe(0x88)},'env':{'type':a22_0x553afe(0x9a)},'watch':{'type':'boolean'},'help':{'type':a22_0x553afe(0x88)},'appcode':{'type':a22_0x553afe(0x9a)},'output':{'type':a22_0x553afe(0x9a)},'params':{'type':a22_0x553afe(0x9a)},'datasetcode':{'type':a22_0x553afe(0x9a)}}});await run();async function run(){const _0x1293f6=a22_0x553afe,_0x279ff6=cli[_0x1293f6(0x9b)][0x0],_0x4d3fc5=(_0x1293f6(0x78)+process[_0x1293f6(0x9f)][_0x1293f6(0x8f)](0x2)['join']('\x20'))[_0x1293f6(0xa3)]();logger[_0x1293f6(0x9d)](_0x4d3fc5);switch(_0x279ff6){case _0x1293f6(0x7d):{const _0x198366=cli[_0x1293f6(0x91)]['appcode'],_0x4838f3=cli[_0x1293f6(0x91)]['env'];logger[_0x1293f6(0x7a)](process['cwd']()),logger['info']('init','执行初始化配置命令'),render(a22_0x520c57(Init,{'appcode':_0x198366,'env':_0x4838f3}));break;}case _0x1293f6(0xa4):{const _0x3fa58a=cli[_0x1293f6(0x9b)][0x1]?.[_0x1293f6(0xa3)](),_0x540413=cli['flags'][_0x1293f6(0x98)];render(a22_0x520c57(CreateApp,{'projectCode':_0x3fa58a,'env':_0x540413}));break;}case _0x1293f6(0x9e):{cli[_0x1293f6(0x9b)][0x1]===_0x1293f6(0x99)&&(logger[_0x1293f6(0x7a)](process[_0x1293f6(0x7c)]()),logger[_0x1293f6(0x77)](_0x1293f6(0x83),_0x1293f6(0x95)),render(a22_0x520c57(AddPage,{})));break;}case _0x1293f6(0x97):{try{logger[_0x1293f6(0x7a)](process[_0x1293f6(0x7c)]()),logger[_0x1293f6(0x77)](_0x1293f6(0x97),_0x1293f6(0x93)),await runStart();}catch(_0x544caf){console['error'](_0x544caf),process[_0x1293f6(0x9c)](0x1);}break;}case _0x1293f6(0x7f):{try{logger['setLogPath'](process[_0x1293f6(0x7c)]()),logger[_0x1293f6(0x77)](_0x1293f6(0x7f),_0x1293f6(0x92)),await runBuild();}catch(_0x1d7e07){console[_0x1293f6(0x82)](_0x1d7e07),process[_0x1293f6(0x9c)](0x1);}break;}case _0x1293f6(0x76):{const _0x1d47a0=cli[_0x1293f6(0x91)][_0x1293f6(0x96)];logger[_0x1293f6(0x7a)](process[_0x1293f6(0x7c)]()),logger[_0x1293f6(0x77)](_0x1293f6(0x76),_0x1293f6(0x80)+(_0x1d47a0?_0x1293f6(0xa0):''));if(_0x1d47a0)try{await Promise[_0x1293f6(0x90)]([runBuildWatch(),runPreview()]);}catch(_0x4517fa){console['error'](_0x4517fa),process[_0x1293f6(0x9c)](0x1);}else try{await runPreview();}catch(_0x127a1f){console['error'](_0x127a1f),process[_0x1293f6(0x9c)](0x1);}break;}case _0x1293f6(0xa1):{render(a22_0x520c57(Config,{'cli':cli}));break;}case _0x1293f6(0xa5):{await apiCli(cli);break;}case _0x1293f6(0x89):{render(a22_0x520c57(AuthServer,{}));break;}case'menu':{const _0x18eab9=cli['input'][0x1];_0x18eab9===_0x1293f6(0x8d)&&render(a22_0x520c57(AppMenuSyncUI,{}));break;}case'logout':{logout();break;}case _0x1293f6(0x8c):{cli[_0x1293f6(0x91)][_0x1293f6(0x8b)]?clearLogs():showLogs();break;}default:render(a22_0x520c57(Help,{}));break;}}
|
package/lib/cmd/build-watch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f075a,_0x20ca4b){const _0x513e6c=a23_0x2f8f,_0x205716=_0x5f075a();while(!![]){try{const _0x3a23ae=-parseInt(_0x513e6c(0x17a))/0x1+-parseInt(_0x513e6c(0x172))/0x2*(parseInt(_0x513e6c(0x17c))/0x3)+parseInt(_0x513e6c(0x175))/0x4+parseInt(_0x513e6c(0x177))/0x5+-parseInt(_0x513e6c(0x174))/0x6+-parseInt(_0x513e6c(0x176))/0x7+parseInt(_0x513e6c(0x173))/0x8;if(_0x3a23ae===_0x20ca4b)break;else _0x205716['push'](_0x205716['shift']());}catch(_0x4459ff){_0x205716['push'](_0x205716['shift']());}}}(a23_0x40d4,0xf0bdd));import{spawn}from'node:child_process';function a23_0x2f8f(_0x1c55d6,_0x7c9e87){const _0x40d4f0=a23_0x40d4();return a23_0x2f8f=function(_0x2f8f7a,_0x30bd90){_0x2f8f7a=_0x2f8f7a-0x170;let _0x29e5e4=_0x40d4f0[_0x2f8f7a];return _0x29e5e4;},a23_0x2f8f(_0x1c55d6,_0x7c9e87);}function a23_0x40d4(){const _0x503f7e=['7271655gboIwt','vite','PATH','414204QuTPXy','npm\x20run\x20build\x20exited\x20with\x20code\x20','89361JqmATy','node_modules','env','.bin','close','6pTQmtJ','4681648eNoKgq','2992026MhMFvL','3597560PqeeCC','6654298AnpIWj'];a23_0x40d4=function(){return _0x503f7e;};return a23_0x40d4();}import{delimiter,join}from'node:path';export function runBuildWatch(){return new Promise((_0x1564b3,_0x2de40b)=>{const _0x572baa=a23_0x2f8f,_0x3e52e2=spawn(_0x572baa(0x178),['build','--watch'],{'stdio':'inherit','shell':!![],'env':{...process[_0x572baa(0x17e)],'PATH':''+join(process['cwd'](),_0x572baa(0x17d),_0x572baa(0x170))+delimiter+process[_0x572baa(0x17e)][_0x572baa(0x179)]}});_0x3e52e2['on'](_0x572baa(0x171),_0x3d95a3=>{const _0x473f1a=_0x572baa;if(_0x3d95a3===0x0||_0x3d95a3===null)_0x1564b3();else _0x2de40b(new Error(_0x473f1a(0x17b)+_0x3d95a3));}),_0x3e52e2['on']('error',_0x2de40b);});}
|
package/lib/cmd/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8f9145,_0xf38006){const _0x5b24de=a24_0x3dd2,_0x39527b=_0x8f9145();while(!![]){try{const _0x2b20e5=-parseInt(_0x5b24de(0xf4))/0x1*(parseInt(_0x5b24de(0xf2))/0x2)+parseInt(_0x5b24de(0x10b))/0x3*(-parseInt(_0x5b24de(0xf3))/0x4)+-parseInt(_0x5b24de(0xf9))/0x5+-parseInt(_0x5b24de(0x10a))/0x6+parseInt(_0x5b24de(0xf1))/0x7*(-parseInt(_0x5b24de(0x101))/0x8)+-parseInt(_0x5b24de(0x105))/0x9*(parseInt(_0x5b24de(0x102))/0xa)+parseInt(_0x5b24de(0xf0))/0xb*(parseInt(_0x5b24de(0x100))/0xc);if(_0x2b20e5===_0xf38006)break;else _0x39527b['push'](_0x39527b['shift']());}catch(_0x5b869b){_0x39527b['push'](_0x39527b['shift']());}}}(a24_0x593c,0xc2fbb));import{delimiter,join}from'node:path';function a24_0x3dd2(_0x479c10,_0x5f2e78){const _0x593cce=a24_0x593c();return a24_0x3dd2=function(_0x3dd242,_0x4a2f47){_0x3dd242=_0x3dd242-0xee;let _0x516995=_0x593cce[_0x3dd242];return _0x516995;},a24_0x3dd2(_0x479c10,_0x5f2e78);}function a24_0x593c(){const _0x579bef=['npm\x20run\x20build\x20exited\x20with\x20code\x20','项目构建出错','now','45441udZvRT','13937YjAghB','150CPAYSN','4JptRtu','19350BcwIiG','data','run','npm','inherit','4454700dFWrVB','error','项目构建失败','项目构建成功','node_modules','PATH','stderr','14844xbWoxF','1448KAVVpc','40ZUgvlx','info','pipe','1446156tOeOyB','build','.bin','npm\x20run\x20build','cwd','5776656qjLnNe','9969WlTxSK'];a24_0x593c=function(){return _0x579bef;};return a24_0x593c();}import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runBuild(){return new Promise((_0x2ccc34,_0x382904)=>{const _0x5b9bbd=a24_0x3dd2,_0x273d92=Date[_0x5b9bbd(0xef)]();logger[_0x5b9bbd(0x103)]('build','开始构建项目',{'command':_0x5b9bbd(0x108)});let _0x4c10b6='';const _0x4906aa=spawn(_0x5b9bbd(0xf7),[_0x5b9bbd(0xf6),_0x5b9bbd(0x106)],{'stdio':['inherit',_0x5b9bbd(0xf8),_0x5b9bbd(0x104)],'shell':!![],'env':{...process['env'],'PATH':''+join(process[_0x5b9bbd(0x109)](),_0x5b9bbd(0xfd),_0x5b9bbd(0x107))+delimiter+process['env'][_0x5b9bbd(0xfe)]}});_0x4906aa[_0x5b9bbd(0xff)]?.['on'](_0x5b9bbd(0xf5),_0x1c754e=>{_0x4c10b6+=_0x1c754e['toString']();}),_0x4906aa['on']('close',_0x563f7b=>{const _0x388356=_0x5b9bbd,_0x52c2c0=Date['now']()-_0x273d92;if(_0x563f7b===0x0||_0x563f7b===null)logger['success'](_0x388356(0x106),_0x388356(0xfc),_0x52c2c0),_0x2ccc34();else{const _0x27879e={'exitCode':_0x563f7b,'duration':_0x52c2c0,'command':_0x388356(0x108),'cwd':process[_0x388356(0x109)]()};_0x4c10b6['trim']()&&(_0x27879e[_0x388356(0xff)]=_0x4c10b6['trim']()),logger[_0x388356(0xfa)](_0x388356(0x106),_0x388356(0xfb),_0x27879e),_0x382904(new Error(_0x388356(0x10c)+_0x563f7b));}}),_0x4906aa['on'](_0x5b9bbd(0xfa),_0xd2f252=>{const _0x726262=_0x5b9bbd,_0x5b0903=Date[_0x726262(0xef)]()-_0x273d92;logger[_0x726262(0xfa)](_0x726262(0x106),_0x726262(0xee),{'error':_0xd2f252['message'],'duration':_0x5b0903,'stderr':_0x4c10b6['trim']()||undefined}),_0x382904(_0xd2f252);});});}
|
package/lib/cmd/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a25_0x41c2(){const _0x1701ea=['1141194KBCXSc','keys','486453KQculO','details','log','forEach','duration','7621496CElFTe','8wNKVuq','4054959vgCCqq','readLogs','warn','\x20\x20\x20耗时:\x20','cwd','*\x20日志已清空','7KKcwey','level','1054732PIXQEN','error','\x20\x20\x20时间:\x20','message','zh-CN','\x20\x20\x20详情:\x20','*\x20Lovrabet\x20CLI\x20日志记录:\x0a','stringify','1276132KyDuPM','20djQWcU','260xKAAYo','clearLogs','setLogPath','136174vvFuzi','timestamp','toLocaleString','*\x20暂无日志记录'];a25_0x41c2=function(){return _0x1701ea;};return a25_0x41c2();}function a25_0xbbec(_0x1dbd90,_0x907de5){const _0x41c245=a25_0x41c2();return a25_0xbbec=function(_0xbbecf3,_0xe29761){_0xbbecf3=_0xbbecf3-0x12b;let _0x493ecc=_0x41c245[_0xbbecf3];return _0x493ecc;},a25_0xbbec(_0x1dbd90,_0x907de5);}(function(_0x510a30,_0x536f8a){const _0x453da6=a25_0xbbec,_0x3bf80c=_0x510a30();while(!![]){try{const _0x5007cd=-parseInt(_0x453da6(0x135))/0x1*(parseInt(_0x453da6(0x141))/0x2)+-parseInt(_0x453da6(0x13b))/0x3+parseInt(_0x453da6(0x14a))/0x4*(-parseInt(_0x453da6(0x131))/0x5)+-parseInt(_0x453da6(0x139))/0x6+-parseInt(_0x453da6(0x148))/0x7*(parseInt(_0x453da6(0x140))/0x8)+parseInt(_0x453da6(0x142))/0x9+-parseInt(_0x453da6(0x132))/0xa*(-parseInt(_0x453da6(0x130))/0xb);if(_0x5007cd===_0x536f8a)break;else _0x3bf80c['push'](_0x3bf80c['shift']());}catch(_0x413e78){_0x3bf80c['push'](_0x3bf80c['shift']());}}}(a25_0x41c2,0x894de));import{logger}from'../utils/logger.js';export function showLogs(){const _0x1d599a=a25_0xbbec;logger['setLogPath'](process[_0x1d599a(0x146)]());const _0x1bfc73=logger[_0x1d599a(0x143)]();if(_0x1bfc73['length']===0x0){console[_0x1d599a(0x13d)](_0x1d599a(0x138));return;}console[_0x1d599a(0x13d)](_0x1d599a(0x12e)),_0x1bfc73[_0x1d599a(0x13e)]((_0x2240fd,_0x10acf4)=>{const _0x2e91a0=_0x1d599a,_0x4c852e=new Date(_0x2240fd[_0x2e91a0(0x136)])[_0x2e91a0(0x137)](_0x2e91a0(0x12c)),_0x565b6a=_0x2240fd[_0x2e91a0(0x149)]==='success'?'√':_0x2240fd[_0x2e91a0(0x149)]===_0x2e91a0(0x14b)?'×':_0x2240fd[_0x2e91a0(0x149)]===_0x2e91a0(0x144)?'!':'i';console[_0x2e91a0(0x13d)](_0x10acf4+0x1+'.\x20'+_0x565b6a+'\x20['+_0x2240fd['command']+']\x20'+_0x2240fd[_0x2e91a0(0x12b)]),console['log'](_0x2e91a0(0x14c)+_0x4c852e),_0x2240fd[_0x2e91a0(0x13f)]&&console['log'](_0x2e91a0(0x145)+_0x2240fd[_0x2e91a0(0x13f)]+'ms'),_0x2240fd['details']&&Object[_0x2e91a0(0x13a)](_0x2240fd[_0x2e91a0(0x13c)])['length']>0x0&&console[_0x2e91a0(0x13d)](_0x2e91a0(0x12d)+JSON[_0x2e91a0(0x12f)](_0x2240fd[_0x2e91a0(0x13c)],null,0x2)),console[_0x2e91a0(0x13d)]('');});}export function clearLogs(){const _0x1f491d=a25_0xbbec;logger[_0x1f491d(0x134)](process[_0x1f491d(0x146)]()),logger[_0x1f491d(0x133)](),console[_0x1f491d(0x13d)](_0x1f491d(0x147));}
|
package/lib/cmd/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x484434,_0x41aef3){const _0x43f3de=a26_0x1559,_0x5b79ae=_0x484434();while(!![]){try{const _0x2283ba=parseInt(_0x43f3de(0x129))/0x1+parseInt(_0x43f3de(0x135))/0x2+-parseInt(_0x43f3de(0x13f))/0x3*(parseInt(_0x43f3de(0x12f))/0x4)+-parseInt(_0x43f3de(0x12c))/0x5+-parseInt(_0x43f3de(0x13b))/0x6*(parseInt(_0x43f3de(0x12d))/0x7)+parseInt(_0x43f3de(0x126))/0x8+parseInt(_0x43f3de(0x133))/0x9;if(_0x2283ba===_0x41aef3)break;else _0x5b79ae['push'](_0x5b79ae['shift']());}catch(_0x3a5cbf){_0x5b79ae['push'](_0x5b79ae['shift']());}}}(a26_0x5b1a,0xf11a8));function a26_0x5b1a(){const _0x5bd35c=['cwd','preview','message','21688920uArkvW','inherit','1253488wFFPDw','stderr','vite','trim','启动预览服务器','error','6zkVbgD','env','预览服务器启动失败','vite\x20preview','147igSBjx','pipe','success','13640896Zxwunv','now','.bin','712745WLmFqQ','PATH','预览服务器启动成功','6712945sozBzc','12001528RoAqtx','info','115088lDJNcY'];a26_0x5b1a=function(){return _0x5bd35c;};return a26_0x5b1a();}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a26_0x1559(_0x56dced,_0xcb1a0f){const _0x5b1a91=a26_0x5b1a();return a26_0x1559=function(_0x1559c3,_0x5688be){_0x1559c3=_0x1559c3-0x124;let _0x58aadb=_0x5b1a91[_0x1559c3];return _0x58aadb;},a26_0x1559(_0x56dced,_0xcb1a0f);}import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x19f1a1,_0x18d64f)=>{const _0x189725=a26_0x1559,_0x49fed7=Date[_0x189725(0x127)]();logger[_0x189725(0x12e)](_0x189725(0x131),_0x189725(0x139),{'command':_0x189725(0x13e)});let _0x3a23c3='';const _0x49a607=spawn(_0x189725(0x137),[_0x189725(0x131)],{'stdio':[_0x189725(0x134),_0x189725(0x134),_0x189725(0x124)],'shell':!![],'env':{...process[_0x189725(0x13c)],'PATH':''+join(process[_0x189725(0x130)](),'node_modules',_0x189725(0x128))+delimiter+process['env'][_0x189725(0x12a)]}});_0x49a607[_0x189725(0x136)]?.['on']('data',_0x2d2ef2=>{_0x3a23c3+=_0x2d2ef2['toString']();}),_0x49a607['on']('close',_0x118e28=>{const _0x143c02=_0x189725,_0x178057=Date[_0x143c02(0x127)]()-_0x49fed7;if(_0x118e28===0x0||_0x118e28===null)logger[_0x143c02(0x125)](_0x143c02(0x131),_0x143c02(0x12b),_0x178057),_0x19f1a1();else{const _0x1cf719={'exitCode':_0x118e28,'duration':_0x178057,'command':_0x143c02(0x13e),'cwd':process[_0x143c02(0x130)]()};_0x3a23c3[_0x143c02(0x138)]()&&(_0x1cf719['stderr']=_0x3a23c3[_0x143c02(0x138)]()),logger[_0x143c02(0x13a)](_0x143c02(0x131),_0x143c02(0x13d),_0x1cf719),_0x18d64f(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x118e28));}}),_0x49a607['on'](_0x189725(0x13a),_0x1f2e07=>{const _0x3bddbf=_0x189725,_0x3c1e30=Date[_0x3bddbf(0x127)]()-_0x49fed7;logger['error']('preview','预览服务器启动出错',{'error':_0x1f2e07[_0x3bddbf(0x132)],'duration':_0x3c1e30,'stderr':_0x3a23c3[_0x3bddbf(0x138)]()||undefined}),_0x18d64f(_0x1f2e07);});});}
|
package/lib/cmd/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x31de68,_0x1c4c96){const _0x3bd57d=a27_0x212b,_0x45891f=_0x31de68();while(!![]){try{const _0x264abb=parseInt(_0x3bd57d(0x78))/0x1*(parseInt(_0x3bd57d(0x6f))/0x2)+-parseInt(_0x3bd57d(0x7e))/0x3*(parseInt(_0x3bd57d(0x7f))/0x4)+parseInt(_0x3bd57d(0x87))/0x5*(parseInt(_0x3bd57d(0x6e))/0x6)+-parseInt(_0x3bd57d(0x70))/0x7*(parseInt(_0x3bd57d(0x7c))/0x8)+parseInt(_0x3bd57d(0x6d))/0x9*(-parseInt(_0x3bd57d(0x7b))/0xa)+parseInt(_0x3bd57d(0x6c))/0xb+parseInt(_0x3bd57d(0x79))/0xc;if(_0x264abb===_0x1c4c96)break;else _0x45891f['push'](_0x45891f['shift']());}catch(_0xf62d2c){_0x45891f['push'](_0x45891f['shift']());}}}(a27_0x1cb4,0x54c53));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a27_0x1cb4(){const _0x3af984=['7LyMREw','data','vite\x20exited\x20with\x20code\x20','trim','PATH','开发服务器启动出错','pipe','error','7ORNdXy','1422828MlqzXa','env','10XdtaTT','2402584dyBAEw','now','15fMQEjO','5644cxmbPp','.bin','inherit','start','info','vite','write','success','695tlYdsS','stderr','toString','2435642DyRYiC','2715885VZJDbP','7728PdcpgB','124954qrOmBc'];a27_0x1cb4=function(){return _0x3af984;};return a27_0x1cb4();}import{logger}from'../utils/logger.js';function a27_0x212b(_0x243c8a,_0x25f2cc){const _0x1cb4db=a27_0x1cb4();return a27_0x212b=function(_0x212b1f,_0x53d318){_0x212b1f=_0x212b1f-0x6b;let _0x18384e=_0x1cb4db[_0x212b1f];return _0x18384e;},a27_0x212b(_0x243c8a,_0x25f2cc);}export function runStart(_0x2f209e){return new Promise((_0x52afb9,_0x5411ac)=>{const _0x43c2c2=a27_0x212b,_0x43af27=Date[_0x43c2c2(0x7d)](),_0x4da444=_0x2f209e||process['cwd']();logger[_0x43c2c2(0x83)](_0x43c2c2(0x82),'启动开发服务器',{'command':_0x43c2c2(0x84),'cwd':_0x4da444});let _0xb708a0='';const _0x444126=spawn(_0x43c2c2(0x84),{'stdio':[_0x43c2c2(0x81),_0x43c2c2(0x81),_0x43c2c2(0x76)],'shell':!![],'cwd':_0x4da444,'env':{...process['env'],'PATH':''+join(_0x4da444,'node_modules',_0x43c2c2(0x80))+delimiter+process[_0x43c2c2(0x7a)][_0x43c2c2(0x74)]}});_0x444126[_0x43c2c2(0x88)]?.['on'](_0x43c2c2(0x71),_0x393282=>{const _0x4cbc85=_0x43c2c2,_0x683a73=_0x393282[_0x4cbc85(0x6b)]();_0xb708a0+=_0x683a73,process[_0x4cbc85(0x88)][_0x4cbc85(0x85)](_0x683a73);}),_0x444126['on']('close',_0x15d13f=>{const _0x24a725=_0x43c2c2,_0x739ac3=Date[_0x24a725(0x7d)]()-_0x43af27;if(_0x15d13f===0x0||_0x15d13f===null)logger[_0x24a725(0x86)]('start','开发服务器启动成功',_0x739ac3),_0x52afb9();else{const _0x4748b0={'exitCode':_0x15d13f,'duration':_0x739ac3,'command':'vite','cwd':_0x4da444};_0xb708a0['trim']()&&(_0x4748b0[_0x24a725(0x88)]=_0xb708a0[_0x24a725(0x73)]()),logger['error'](_0x24a725(0x82),'开发服务器启动失败',_0x4748b0),_0x5411ac(new Error(_0x24a725(0x72)+_0x15d13f));}}),_0x444126['on']('error',_0xb8048=>{const _0x42292e=_0x43c2c2,_0x312c0d=Date[_0x42292e(0x7d)]()-_0x43af27,_0x41092f={'error':_0xb8048['message'],'duration':_0x312c0d,'command':_0x42292e(0x84),'cwd':_0x4da444};_0xb708a0[_0x42292e(0x73)]()&&(_0x41092f[_0x42292e(0x88)]=_0xb708a0[_0x42292e(0x73)]()),logger[_0x42292e(0x77)](_0x42292e(0x82),_0x42292e(0x75),_0x41092f),_0x5411ac(_0xb8048);});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a28_0x4c01(_0x228ca1,_0x4544ee){const _0x249601=a28_0x2496();return a28_0x4c01=function(_0x4c019a,_0x3cb92a){_0x4c019a=_0x4c019a-0x173;let _0x40f2a9=_0x249601[_0x4c019a];return _0x40f2a9;},a28_0x4c01(_0x228ca1,_0x4544ee);}(function(_0x2ceda2,_0x457ae5){const _0x13460e=a28_0x4c01,_0x5372a8=_0x2ceda2();while(!![]){try{const _0x4ccf05=-parseInt(_0x13460e(0x17e))/0x1*(parseInt(_0x13460e(0x178))/0x2)+parseInt(_0x13460e(0x174))/0x3+-parseInt(_0x13460e(0x176))/0x4+parseInt(_0x13460e(0x17a))/0x5*(-parseInt(_0x13460e(0x180))/0x6)+-parseInt(_0x13460e(0x17f))/0x7*(parseInt(_0x13460e(0x17c))/0x8)+-parseInt(_0x13460e(0x177))/0x9*(-parseInt(_0x13460e(0x179))/0xa)+parseInt(_0x13460e(0x18b))/0xb;if(_0x4ccf05===_0x457ae5)break;else _0x5372a8['push'](_0x5372a8['shift']());}catch(_0x1a3960){_0x5372a8['push'](_0x5372a8['shift']());}}}(a28_0x2496,0x5ecfa));import{jsxs as a28_0x5ace24,jsx as a28_0x1f3757}from'react/jsx-runtime';import{Box,Text}from'ink';function a28_0x2496(){const _0x52539a=['gray','lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','\x20*\x20配置示例:','command','description','配置当前项目的\x20App\x20Code','map','column','\x20\x20\x20\x20','获取配置项','13848945dqEPNu','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','列出所有配置项','1850445IYXvju','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','2243064INTPYl','2996262PeyIcb','1471532WECdor','20yckTJo','35AnAzrF','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','2152ugDBbR','无效的命令,可用命令如下:','1HgSFJY','11375mreyIx','359694bfhYML'];a28_0x2496=function(){return _0x52539a;};return a28_0x2496();}export function ConfigHelp(){const _0x2f0c83=a28_0x4c01,_0x48d309=[{'command':_0x2f0c83(0x17b),'description':'设置配置项'},{'command':_0x2f0c83(0x175),'description':_0x2f0c83(0x18a)},{'command':'lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','description':_0x2f0c83(0x173)}],_0x16c217=[{'command':_0x2f0c83(0x18c),'description':_0x2f0c83(0x186)},{'command':_0x2f0c83(0x182),'description':'设置环境\x20(online/daily)'}];return a28_0x5ace24(Box,{'flexDirection':_0x2f0c83(0x188),'marginTop':0x1,'marginBottom':0x1,'children':[a28_0x1f3757(Box,{'marginBottom':0x1,'children':a28_0x5ace24(Text,{'color':_0x2f0c83(0x181),'children':['\x20!','\x20\x20',_0x2f0c83(0x17d)]})}),_0x48d309[_0x2f0c83(0x187)](_0x391014=>a28_0x5ace24(Box,{'children':[a28_0x5ace24(Text,{'children':[_0x2f0c83(0x189),_0x391014[_0x2f0c83(0x184)]]}),a28_0x1f3757(Text,{'color':_0x2f0c83(0x181),'children':_0x391014[_0x2f0c83(0x185)]})]},_0x391014['command'])),a28_0x1f3757(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x1f3757(Text,{'color':_0x2f0c83(0x181),'children':_0x2f0c83(0x183)})}),_0x16c217[_0x2f0c83(0x187)](_0xb5c352=>a28_0x5ace24(Box,{'children':[a28_0x5ace24(Text,{'children':['\x20\x20\x20\x20',_0xb5c352['command']]}),a28_0x1f3757(Text,{'color':_0x2f0c83(0x181),'children':_0xb5c352['description']})]},_0xb5c352[_0x2f0c83(0x184)]))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5bcfb9,_0x310225){const _0x217f80=a29_0x1b26,_0x4a7b7c=_0x5bcfb9();while(!![]){try{const _0x30afcb=-parseInt(_0x217f80(0x1e6))/0x1+parseInt(_0x217f80(0x1df))/0x2*(parseInt(_0x217f80(0x1e0))/0x3)+-parseInt(_0x217f80(0x1f2))/0x4+-parseInt(_0x217f80(0x1dd))/0x5+parseInt(_0x217f80(0x1e1))/0x6*(-parseInt(_0x217f80(0x1d9))/0x7)+parseInt(_0x217f80(0x1ef))/0x8*(parseInt(_0x217f80(0x1d5))/0x9)+-parseInt(_0x217f80(0x1da))/0xa*(-parseInt(_0x217f80(0x1d6))/0xb);if(_0x30afcb===_0x310225)break;else _0x4a7b7c['push'](_0x4a7b7c['shift']());}catch(_0x1baf48){_0x4a7b7c['push'](_0x4a7b7c['shift']());}}}(a29_0xeaeb,0x81daf));import{jsx as a29_0x2a4199,jsxs as a29_0x375ed4}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';function a29_0x1b26(_0x511bb2,_0x407260){const _0xeaeb5a=a29_0xeaeb();return a29_0x1b26=function(_0x1b2690,_0x10a73b){_0x1b2690=_0x1b2690-0x1c8;let _0x161a59=_0xeaeb5a[_0x1b2690];return _0x161a59;},a29_0x1b26(_0x511bb2,_0x407260);}function a29_0xeaeb(){const _0x513311=['config','保存配置失败','stringify','message','undefined','list','81XXyMes','7042486atSxcE','includes','help','7gsDhgL','20GkgjyZ','set','parse','2993920AJbvjW','error','171486WFXpVd','6qThkvU','68412nWWKxC','mkdirSync','环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22','get','配置值无效或过长','195730zVpkRR','env','input','未提供配置值','online','log','.tmp','appcode','utf8','291752BNQcFm','环境配置已设置为:\x20','daily','1769424mavbXs','string','保存配置失败:\x20','--help','flags','length','app','renameSync','red'];a29_0xeaeb=function(){return _0x513311;};return a29_0xeaeb();}import a29_0x42f679 from'node:fs';import a29_0x16da99 from'node:path';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';import{logger}from'../utils/logger.js';export function Config(_0x1049ea){const _0x5613c5=a29_0x1b26,{cli:_0x5aacd5}=_0x1049ea,_0x2727ef=_0x5aacd5[_0x5613c5(0x1e8)][0x1],_0xc6b0e4=_0x5aacd5[_0x5613c5(0x1e8)][0x2],_0x4f016d=[_0x5613c5(0x1db),_0x5613c5(0x1e4)]['includes'](_0x2727ef||''),_0x45b1e6=_0x5aacd5[_0x5613c5(0x1e8)][_0x5613c5(0x1cb)]>=0x3;if(_0xc6b0e4===_0x5613c5(0x1c9)||_0x5aacd5[_0x5613c5(0x1ca)][_0x5613c5(0x1d8)])return a29_0x2a4199(ConfigHelp,{});const _0x37fd88=readConfig();if(_0x2727ef==='set'){if(_0xc6b0e4){const _0x30e83e=_0x5aacd5[_0x5613c5(0x1e8)][0x3];if(typeof _0x30e83e!==_0x5613c5(0x1d3)){if(_0xc6b0e4===_0x5613c5(0x1e7)&&![_0x5613c5(0x1ea),_0x5613c5(0x1f1)][_0x5613c5(0x1d7)](_0x30e83e))return a29_0x2a4199(Box,{'children':a29_0x2a4199(Text,{'color':_0x5613c5(0x1ce),'children':_0x5613c5(0x1e3)})});const _0x38093e=isInProject(),_0x3d0c48=_0x38093e?projectConfigPath:globalConfigPath;let _0x57c34b={};try{if(existsSync(_0x3d0c48)){const _0x1f8098=readFileSync(_0x3d0c48,{'encoding':_0x5613c5(0x1ee)});_0x1f8098&&(_0x57c34b=JSON[_0x5613c5(0x1dc)](_0x1f8098));}}catch(_0x5a83ef){}if(typeof _0x30e83e!==_0x5613c5(0x1f3)||_0x30e83e[_0x5613c5(0x1cb)]>0x1f4)return a29_0x2a4199(Box,{'children':a29_0x2a4199(Text,{'color':_0x5613c5(0x1ce),'children':_0x5613c5(0x1e5)})});let _0x58dc4c=_0xc6b0e4;_0xc6b0e4===_0x5613c5(0x1cc)&&(_0x58dc4c='appcode',delete _0x57c34b['app']);_0xc6b0e4===_0x5613c5(0x1ed)&&delete _0x57c34b['app'];_0x57c34b[_0x58dc4c]=_0x30e83e;try{const _0x1c43ed=a29_0x16da99['dirname'](_0x3d0c48);!existsSync(_0x1c43ed)&&a29_0x42f679[_0x5613c5(0x1e2)](_0x1c43ed,{'recursive':!![]});const _0x4d1b2e=_0x3d0c48+_0x5613c5(0x1ec);writeFileSync(_0x4d1b2e,JSON[_0x5613c5(0x1d1)](_0x57c34b,null,0x2),{'encoding':_0x5613c5(0x1ee),'mode':0x180}),a29_0x42f679[_0x5613c5(0x1cd)](_0x4d1b2e,_0x3d0c48);if(_0xc6b0e4===_0x5613c5(0x1e7)){const _0x32faf9=_0x38093e?'项目':'全局';console['log']('✓\x20'+_0x32faf9+_0x5613c5(0x1f0)+_0x30e83e);}}catch(_0x176395){const _0x416a6d=_0x3d0c48+_0x5613c5(0x1ec);try{existsSync(_0x416a6d)&&a29_0x42f679['unlinkSync'](_0x416a6d);}catch(_0x5201ae){}return logger[_0x5613c5(0x1de)](_0x5613c5(0x1cf),_0x5613c5(0x1d0),{'error':_0x176395 instanceof Error?_0x176395[_0x5613c5(0x1d2)]:String(_0x176395),'configKey':_0xc6b0e4,'configValue':_0x30e83e,'targetConfigPath':_0x3d0c48}),a29_0x2a4199(Box,{'children':a29_0x375ed4(Text,{'color':_0x5613c5(0x1ce),'children':[_0x5613c5(0x1c8),_0x176395 instanceof Error?_0x176395[_0x5613c5(0x1d2)]:String(_0x176395)]})});}return null;}return a29_0x2a4199(Box,{'children':a29_0x2a4199(Text,{'color':_0x5613c5(0x1ce),'children':_0x5613c5(0x1e9)})});}}if(_0x2727ef===_0x5613c5(0x1e4)){if(_0xc6b0e4){let _0x284a10=_0xc6b0e4;return _0xc6b0e4===_0x5613c5(0x1cc)&&(_0x284a10=_0x5613c5(0x1ed)),console[_0x5613c5(0x1eb)](_0x37fd88[_0x284a10]||_0x5613c5(0x1d3)),null;}return null;}if(_0x2727ef===_0x5613c5(0x1d4))return console['log'](JSON['stringify'](_0x37fd88,null,0x2)),null;if(!_0x4f016d||!_0x45b1e6)return a29_0x2a4199(ConfigHelp,{});return null;}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0xd069e0=a30_0x4ba4;function a30_0x291f(){const _0x40321f=['1456364Rvtcwm','59829708sKjCBd','369HzKApU','47200KWNadm','11rZRJkb','4146pjsLlk','https://user-daily.lovrabet.com','44093CeNuBC','1498haCgIV','online','https://api.lovrabet.com','7745tNkuyX','368TUQqcH','3339312tvuwym','2985PfBsyg'];a30_0x291f=function(){return _0x40321f;};return a30_0x291f();}(function(_0x477ae5,_0x4815a0){const _0x4a6bf1=a30_0x4ba4,_0x544da1=_0x477ae5();while(!![]){try{const _0x502384=-parseInt(_0x4a6bf1(0xac))/0x1+parseInt(_0x4a6bf1(0xa5))/0x2*(-parseInt(_0x4a6bf1(0xab))/0x3)+-parseInt(_0x4a6bf1(0xaa))/0x4+parseInt(_0x4a6bf1(0xa8))/0x5*(-parseInt(_0x4a6bf1(0xa2))/0x6)+-parseInt(_0x4a6bf1(0xa4))/0x7*(-parseInt(_0x4a6bf1(0xa9))/0x8)+parseInt(_0x4a6bf1(0xae))/0x9*(-parseInt(_0x4a6bf1(0xaf))/0xa)+parseInt(_0x4a6bf1(0xa1))/0xb*(parseInt(_0x4a6bf1(0xad))/0xc);if(_0x502384===_0x4815a0)break;else _0x544da1['push'](_0x544da1['shift']());}catch(_0x30cbc5){_0x544da1['push'](_0x544da1['shift']());}}}(a30_0x291f,0xee185));import{getEnv}from'./env.js';function a30_0x4ba4(_0x20136e,_0x202c91){const _0x291f88=a30_0x291f();return a30_0x4ba4=function(_0x4ba4ec,_0x3f6c53){_0x4ba4ec=_0x4ba4ec-0xa1;let _0x1feed6=_0x291f88[_0x4ba4ec];return _0x1feed6;},a30_0x4ba4(_0x20136e,_0x202c91);}export const getUserDomain=()=>getEnv()===a30_0xd069e0(0xa6)?'https://user.lovrabet.com':a30_0xd069e0(0xa3);export const getApiDomain=()=>getEnv()===a30_0xd069e0(0xa6)?a30_0xd069e0(0xa7):'https://daily-api.lovrabet.com';
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a31_0x334b3a=a31_0x5d9d;function a31_0x5d9d(_0x506ecb,_0x374d7d){const _0x266720=a31_0x2667();return a31_0x5d9d=function(_0x5d9d2e,_0x3e2a41){_0x5d9d2e=_0x5d9d2e-0x128;let _0x10407c=_0x266720[_0x5d9d2e];return _0x10407c;},a31_0x5d9d(_0x506ecb,_0x374d7d);}function a31_0x2667(){const _0x4c3d6c=['313122cuHRga','online','1786347rmrvrA','888BWYiGT','28114LaVNUh','LOVRABET_ENV','24FLeocR','11810aUuTUy','1012398jQoRku','425901eogdsl','1095716vOIrSK','env'];a31_0x2667=function(){return _0x4c3d6c;};return a31_0x2667();}(function(_0xd6fb21,_0x81710){const _0x26c870=a31_0x5d9d,_0x4096e6=_0xd6fb21();while(!![]){try{const _0x1e0631=parseInt(_0x26c870(0x133))/0x1+-parseInt(_0x26c870(0x12b))/0x2+parseInt(_0x26c870(0x12f))/0x3+-parseInt(_0x26c870(0x131))/0x4+-parseInt(_0x26c870(0x12e))/0x5*(-parseInt(_0x26c870(0x12a))/0x6)+parseInt(_0x26c870(0x130))/0x7+parseInt(_0x26c870(0x12d))/0x8*(-parseInt(_0x26c870(0x129))/0x9);if(_0x1e0631===_0x81710)break;else _0x4096e6['push'](_0x4096e6['shift']());}catch(_0x579e12){_0x4096e6['push'](_0x4096e6['shift']());}}}(a31_0x2667,0x2b5a4));let env=process[a31_0x334b3a(0x132)][a31_0x334b3a(0x12c)]||a31_0x334b3a(0x128);export function getEnv(){return env;}export function initEnv(_0x4e79ad){env=_0x4e79ad;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x49bc02,_0xa0831a){const _0x5d798=a35_0x2b2a,_0x173300=_0x49bc02();while(!![]){try{const _0x3f1bfd=-parseInt(_0x5d798(0xb9))/0x1+-parseInt(_0x5d798(0xd7))/0x2+parseInt(_0x5d798(0xac))/0x3*(parseInt(_0x5d798(0xa9))/0x4)+-parseInt(_0x5d798(0xc1))/0x5*(parseInt(_0x5d798(0xb3))/0x6)+-parseInt(_0x5d798(0xbb))/0x7*(-parseInt(_0x5d798(0xe0))/0x8)+parseInt(_0x5d798(0xca))/0x9+-parseInt(_0x5d798(0xc2))/0xa*(-parseInt(_0x5d798(0xc0))/0xb);if(_0x3f1bfd===_0xa0831a)break;else _0x173300['push'](_0x173300['shift']());}catch(_0x2a9778){_0x173300['push'](_0x173300['shift']());}}}(a35_0x396d,0x2d1b5));function a35_0x396d(){const _0x10c3d2=['project-name','trim','319hInTJz','135INPYtE','7930VfByTR','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','step','Yes','length','\x20\x20使用\x20←→\x20选择,回车确认','creating','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','1439082hkbvRy','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','*\x20是否要自动拉取\x20API\x20配置?','api-pull','应用AppCode不合法','登录失败','red','rightArrow','应用AppCode','项目名','app-code','test','green','401202sLMSjC','column','项目名不合法','includes','backspace','未设置','login-prompt','*\x20创建新项目','*\x20应用AppCode\x20','8WQrjKE','应用AppCode长度不能超过\x20100\x20个字符','online','slice','return','my-app','login-process','已登录','gray','8jACiMo','*\x20项目名:\x20','login-check','258057TxQEJv','string','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','\x20检查中...','登录状态','delete','login','14214iGqNNn','\x20←\x20','confirm-api-pull','env','\x20登录中...','*\x20是否要先登录以便拉取\x20API\x20配置?','98729jsWMZH','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','1351819bQlfIT','map','yellow'];a35_0x396d=function(){return _0x10c3d2;};return a35_0x396d();}import{jsx as a35_0x53e220,jsxs as a35_0x5a6a36,Fragment as a35_0x5c2884}from'react/jsx-runtime';function a35_0x2b2a(_0x2608ab,_0x4cf500){const _0x396d92=a35_0x396d();return a35_0x2b2a=function(_0x2b2a14,_0xfccf86){_0x2b2a14=_0x2b2a14-0xa9;let _0x3d548a=_0x396d92[_0x2b2a14];return _0x3d548a;},a35_0x2b2a(_0x2608ab,_0x4cf500);}import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x21dcdc){const _0x428abc=a35_0x2b2a,{onCreate:_0x271600,env:_0x117b18}=_0x21dcdc,[_0x12b1f2,_0x50c9dc]=useState(_0x428abc(0xbe)),[_0x51cc5a,_0x1c0c5f]=useState(''),[_0x1b60b9,_0x4c8007]=useState(''),[_0x4da4e6,_0x20f44b]=useState(''),[_0x270453,_0x5a2e3a]=useState(''),[_0x1e1969,_0x27bbc4]=useState([]),[_0x2d2d50,_0x456632]=useState(null),[_0x3d86ac,_0x53b792]=useState(![]),[_0x90440d,_0x5ecedc]=useState(![]),[_0x2c8170,_0x49d151]=useState(![]),[_0x4fae4c,_0x11591a]=useState(0x0),[_0x52707e,_0x20a0ba]=useState(0x0),_0x3b9bbb=_0x428abc(0xe5),_0x1a2a3d=readConfig(),_0x3e02b5=typeof _0x1a2a3d[_0x428abc(0xb6)]===_0x428abc(0xad)?_0x1a2a3d['env']:undefined;function _0x11b3fc(_0x48e0b2){const _0x23938c=_0x428abc;if(_0x48e0b2['length']>0x32)return{'valid':![],'message':'项目名长度不能超过\x2050\x20个字符'};const _0x2e0788=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x48e0b2?.[_0x23938c(0xbf)]()&&!_0x2e0788['test'](_0x48e0b2))return{'valid':![],'message':_0x23938c(0xba)};return{'valid':!![]};}function _0x3463be(_0x6d6a19){const _0x3ea775=_0x428abc;if(!_0x6d6a19[_0x3ea775(0xbf)]())return{'valid':!![]};if(_0x6d6a19['length']>0x64)return{'valid':![],'message':_0x3ea775(0xe1)};const _0x55db93=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x55db93[_0x3ea775(0xd5)](_0x6d6a19))return{'valid':![],'message':_0x3ea775(0xcb)};return{'valid':!![]};}async function _0x4ddfb4(){_0x53b792(!![]);try{const _0x7cde55=await getIsSessionValid();return _0x456632(_0x7cde55),_0x7cde55;}catch(_0x51dfe0){return _0x456632(![]),![];}finally{_0x53b792(![]);}}async function _0x4a7497(){_0x5ecedc(!![]);try{const _0x58bb57=await authServer({'silent':!![]});return _0x456632(_0x58bb57),_0x58bb57;}catch(_0x3eecf8){return _0x456632(![]),![];}finally{_0x5ecedc(![]);}}return useInput(async(_0x303ebe,_0x181bd0)=>{const _0x3d708f=_0x428abc;if(_0x181bd0['leftArrow']||_0x181bd0[_0x3d708f(0xd1)]){if(_0x12b1f2===_0x3d708f(0xb5)){_0x11591a(_0x483491=>_0x483491===0x0?0x1:0x0);return;}if(_0x12b1f2==='login-prompt'){_0x20a0ba(_0x215173=>_0x215173===0x0?0x1:0x0);return;}}if(_0x181bd0[_0x3d708f(0xe4)]){if(_0x12b1f2===_0x3d708f(0xbe)){const _0x30d9de=_0x4da4e6[_0x3d708f(0xbf)]()||_0x3b9bbb;if(_0x270453)return;_0x1c0c5f(_0x30d9de),_0x27bbc4([{'step':_0x3d708f(0xbe),'label':_0x3d708f(0xd3),'value':_0x30d9de}]),_0x20f44b(''),_0x5a2e3a(''),_0x50c9dc(_0x3d708f(0xd4));return;}if(_0x12b1f2==='app-code'){if(_0x270453)return;const _0x3a0283=_0x4da4e6[_0x3d708f(0xbf)]();_0x4c8007(_0x3a0283),_0x27bbc4(_0x12934e=>[..._0x12934e,{'step':_0x3d708f(0xd4),'label':_0x3d708f(0xd2),'value':_0x3a0283||_0x3d708f(0xdc)}]),_0x20f44b(''),_0x5a2e3a('');if(_0x3a0283){_0x50c9dc(_0x3d708f(0xab));const _0x382bba=await _0x4ddfb4();_0x382bba?_0x50c9dc(_0x3d708f(0xb5)):_0x50c9dc(_0x3d708f(0xdd));}else{const _0x3ac2a3=_0x117b18||_0x3e02b5||_0x3d708f(0xe2);_0x271600({'projectName':_0x51cc5a,'appCode':undefined,'pullApi':![],'env':_0x3ac2a3}),_0x50c9dc('creating');}return;}if(_0x12b1f2===_0x3d708f(0xb5)){const _0x45fbca=_0x4fae4c===0x0;_0x49d151(_0x45fbca),_0x27bbc4(_0x52410d=>[..._0x52410d,{'step':_0x3d708f(0xcd),'label':'拉取API配置','value':_0x45fbca?'是':'否'}]);const _0x31e462=_0x117b18||_0x3e02b5||_0x3d708f(0xe2);_0x271600({'projectName':_0x51cc5a,'appCode':_0x1b60b9,'pullApi':_0x45fbca,'env':_0x31e462}),_0x50c9dc(_0x3d708f(0xc8));return;}if(_0x12b1f2==='login-prompt'){const _0x9210e4=_0x52707e===0x0;if(_0x9210e4){_0x50c9dc(_0x3d708f(0xe6));const _0x22ff84=await _0x4a7497();if(_0x22ff84)_0x27bbc4(_0x21136c=>[..._0x21136c,{'step':_0x3d708f(0xb2),'label':_0x3d708f(0xb0),'value':_0x3d708f(0xe7)}]),_0x50c9dc(_0x3d708f(0xb5));else{_0x27bbc4(_0x2fe452=>[..._0x2fe452,{'step':_0x3d708f(0xb2),'label':_0x3d708f(0xb0),'value':_0x3d708f(0xcf)}]);const _0x4d4102=_0x117b18||_0x3e02b5||'online';_0x271600({'projectName':_0x51cc5a,'appCode':_0x1b60b9,'pullApi':![],'env':_0x4d4102}),_0x50c9dc(_0x3d708f(0xc8));}}else{_0x27bbc4(_0x3320b5=>[..._0x3320b5,{'step':_0x3d708f(0xb2),'label':_0x3d708f(0xb0),'value':'跳过登录'}]);const _0x1a19e5=_0x117b18||_0x3e02b5||_0x3d708f(0xe2);_0x271600({'projectName':_0x51cc5a,'appCode':_0x1b60b9,'pullApi':![],'env':_0x1a19e5}),_0x50c9dc(_0x3d708f(0xc8));}return;}}if(_0x181bd0[_0x3d708f(0xdb)]||_0x181bd0[_0x3d708f(0xb1)]){_0x20f44b(_0x3da15e=>{const _0x3c5be9=_0x3d708f,_0xe274f5=_0x3da15e[_0x3c5be9(0xe3)](0x0,-0x1);if(_0x12b1f2==='project-name'){const {valid:_0x34c4be,message:_0x4f0563}=_0x11b3fc(_0xe274f5);_0x5a2e3a(_0x34c4be?'':_0x4f0563||_0x3c5be9(0xd9));}else{if(_0x12b1f2===_0x3c5be9(0xd4)){const {valid:_0x1795e7,message:_0x163f20}=_0x3463be(_0xe274f5);_0x5a2e3a(_0x1795e7?'':_0x163f20||_0x3c5be9(0xce));}}return _0xe274f5;});return;}if([_0x3d708f(0xc8),_0x3d708f(0xab),_0x3d708f(0xe6)][_0x3d708f(0xda)](_0x12b1f2))return;if(_0x12b1f2===_0x3d708f(0xb5)||_0x12b1f2===_0x3d708f(0xdd))return;_0x20f44b(_0xf7581b=>{const _0xfdc7c7=_0xf7581b+_0x303ebe;if(_0x12b1f2==='project-name'){const {valid:_0x3da374,message:_0x4d74e2}=_0x11b3fc(_0xfdc7c7);_0x5a2e3a(_0x3da374?'':_0x4d74e2||'项目名不合法');}else{if(_0x12b1f2==='app-code'){const {valid:_0x708d44,message:_0x15749c}=_0x3463be(_0xfdc7c7);_0x5a2e3a(_0x708d44?'':_0x15749c||'应用AppCode不合法');}}return _0xfdc7c7;});}),a35_0x5a6a36(Box,{'flexDirection':_0x428abc(0xd8),'marginTop':0x1,'children':[_0x1e1969[_0x428abc(0xc6)]===0x0&&a35_0x53e220(Box,{'children':a35_0x53e220(Text,{'color':'cyan','children':_0x428abc(0xde)})}),_0x1e1969[_0x428abc(0xbc)](_0x4b17a1=>a35_0x5a6a36(Box,{'children':[a35_0x5a6a36(Text,{'color':_0x428abc(0xd6),'children':['√\x20',_0x4b17a1['label'],':\x20']}),a35_0x53e220(Text,{'color':'cyan','children':_0x4b17a1['value']})]},_0x4b17a1[_0x428abc(0xc4)])),_0x12b1f2==='project-name'&&a35_0x5a6a36(a35_0x5c2884,{'children':[a35_0x5a6a36(Box,{'children':[a35_0x53e220(Text,{'children':_0x428abc(0xaa)}),_0x4da4e6?a35_0x53e220(Text,{'color':_0x428abc(0xd6),'children':_0x4da4e6}):a35_0x53e220(Text,{'color':'gray','children':_0x3b9bbb}),_0x270453&&a35_0x5a6a36(Text,{'color':'red','children':[_0x428abc(0xb4),_0x270453]})]}),!_0x270453&&!_0x4da4e6&&a35_0x53e220(Box,{'children':a35_0x53e220(Text,{'color':'gray','children':'\x20直接回车确认,或输入自定义名称'})})]}),_0x12b1f2===_0x428abc(0xd4)&&a35_0x5a6a36(a35_0x5c2884,{'children':[a35_0x5a6a36(Box,{'children':[a35_0x53e220(Text,{'children':_0x428abc(0xdf)}),a35_0x53e220(Text,{'color':_0x428abc(0xe8),'children':'[可选]:\x20'}),a35_0x53e220(Text,{'color':_0x428abc(0xd6),'children':_0x4da4e6}),_0x270453&&a35_0x5a6a36(Text,{'color':_0x428abc(0xd0),'children':[_0x428abc(0xb4),_0x270453]})]}),!_0x270453&&a35_0x53e220(Box,{'children':a35_0x5a6a36(Text,{'color':'gray','children':['\x20',_0x428abc(0xae)]})})]}),_0x12b1f2===_0x428abc(0xab)&&a35_0x5a6a36(Box,{'children':[a35_0x53e220(Text,{'children':'*\x20正在检查登录状态...'}),_0x3d86ac&&a35_0x53e220(Text,{'color':'gray','children':_0x428abc(0xaf)})]}),_0x12b1f2===_0x428abc(0xb5)&&a35_0x5a6a36(a35_0x5c2884,{'children':[a35_0x53e220(Box,{'children':a35_0x53e220(Text,{'color':_0x428abc(0xd6),'children':'√\x20检测到有效登录状态'})}),a35_0x53e220(Box,{'marginTop':0x1,'children':a35_0x53e220(Text,{'children':_0x428abc(0xcc)})}),a35_0x5a6a36(Box,{'marginLeft':0x2,'children':[a35_0x5a6a36(Text,{'color':_0x4fae4c===0x0?_0x428abc(0xd6):_0x428abc(0xe8),'children':[_0x4fae4c===0x0?'▶\x20':'\x20\x20',_0x428abc(0xc5)]}),a35_0x53e220(Text,{'children':'\x20'}),a35_0x5a6a36(Text,{'color':_0x4fae4c===0x1?_0x428abc(0xd6):'gray','children':[_0x4fae4c===0x1?'▶\x20':'\x20\x20','No']})]}),a35_0x53e220(Box,{'children':a35_0x53e220(Text,{'color':'gray','children':_0x428abc(0xc7)})}),a35_0x53e220(Box,{'children':a35_0x53e220(Text,{'color':'yellow','children':_0x428abc(0xc3)})})]}),_0x12b1f2===_0x428abc(0xdd)&&a35_0x5a6a36(a35_0x5c2884,{'children':[a35_0x53e220(Box,{'children':a35_0x53e220(Text,{'color':_0x428abc(0xbd),'children':'!\x20未检测到有效登录'})}),a35_0x53e220(Box,{'marginTop':0x1,'children':a35_0x53e220(Text,{'children':_0x428abc(0xb8)})}),a35_0x5a6a36(Box,{'marginLeft':0x2,'children':[a35_0x5a6a36(Text,{'color':_0x52707e===0x0?_0x428abc(0xd6):_0x428abc(0xe8),'children':[_0x52707e===0x0?'▶\x20':'\x20\x20',_0x428abc(0xc5)]}),a35_0x53e220(Text,{'children':'\x20'}),a35_0x5a6a36(Text,{'color':_0x52707e===0x1?_0x428abc(0xd6):_0x428abc(0xe8),'children':[_0x52707e===0x1?'▶\x20':'\x20\x20','No']})]}),a35_0x53e220(Box,{'children':a35_0x53e220(Text,{'color':_0x428abc(0xe8),'children':_0x428abc(0xc7)})}),a35_0x53e220(Box,{'children':a35_0x53e220(Text,{'color':_0x428abc(0xbd),'children':_0x428abc(0xc9)})})]}),_0x12b1f2===_0x428abc(0xe6)&&a35_0x5a6a36(Box,{'children':[a35_0x53e220(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x90440d&&a35_0x53e220(Text,{'color':'gray','children':_0x428abc(0xb7)})]})]});}
|
|
1
|
+
(function(_0x2abeef,_0x5d2d41){const _0x37df63=a32_0x2b57,_0x291179=_0x2abeef();while(!![]){try{const _0x5c6a7e=parseInt(_0x37df63(0x1b8))/0x1*(-parseInt(_0x37df63(0x1c4))/0x2)+-parseInt(_0x37df63(0x1d2))/0x3+-parseInt(_0x37df63(0x1b1))/0x4*(-parseInt(_0x37df63(0x19a))/0x5)+parseInt(_0x37df63(0x1bb))/0x6*(-parseInt(_0x37df63(0x1ab))/0x7)+-parseInt(_0x37df63(0x199))/0x8+-parseInt(_0x37df63(0x198))/0x9+parseInt(_0x37df63(0x1b2))/0xa*(parseInt(_0x37df63(0x1a4))/0xb);if(_0x5c6a7e===_0x5d2d41)break;else _0x291179['push'](_0x291179['shift']());}catch(_0x21349b){_0x291179['push'](_0x291179['shift']());}}}(a32_0x5835,0xed5e9));import{jsx as a32_0x69b5cc,jsxs as a32_0x42aea9,Fragment as a32_0x5a05c4}from'react/jsx-runtime';function a32_0x2b57(_0x2f7183,_0x46acb3){const _0x583518=a32_0x5835();return a32_0x2b57=function(_0x2b5709,_0x55c77d){_0x2b5709=_0x2b5709-0x195;let _0x316a93=_0x583518[_0x2b5709];return _0x316a93;},a32_0x2b57(_0x2f7183,_0x46acb3);}import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';function a32_0x5835(){const _0xe930c=['login-process','green','confirm-api-pull','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','\x20\x20使用\x20←→\x20选择,回车确认','includes','return','√\x20检测到有效登录状态','432447LyGAmI','应用AppCode','label','cyan','leftArrow','应用AppCode长度不能超过\x20100\x20个字符','7634610PsASTv','7576624ikftfO','7650EeOvWs','项目名','login','yellow','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','gray','column','登录失败','project-name','app-code','3059419yMYHlS','trim','跳过登录','\x20检查中...','creating','*\x20是否要先登录以便拉取\x20API\x20配置?','env','1876hTOhmt','api-pull','\x20直接回车确认,或输入自定义名称','login-check','slice','!\x20未检测到有效登录','208mgfNOF','160rYNWDR','[可选]:\x20','应用AppCode不合法','登录状态','\x20登录中...','backspace','821614xOzHdQ','rightArrow','\x20←\x20','17826rtUDNr','*\x20创建新项目','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','项目名不合法','my-app','*\x20正在登录,请前往浏览器完成登录...','online','login-prompt','length','2DVVvrf','red','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','delete','*\x20应用AppCode\x20','已登录'];a32_0x5835=function(){return _0xe930c;};return a32_0x5835();}import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x524ad1){const _0x29e139=a32_0x2b57,{onCreate:_0x10cb49,env:_0xb43e40}=_0x524ad1,[_0x3944cd,_0x41aaee]=useState('project-name'),[_0x35aaa5,_0x218c14]=useState(''),[_0x2340e4,_0x3f6c44]=useState(''),[_0x4cd4db,_0x411143]=useState(''),[_0xb58d6d,_0x8c6a3b]=useState(''),[_0x5c5284,_0x4c6bd3]=useState([]),[_0x488509,_0x513797]=useState(null),[_0x1ca217,_0x1af4c1]=useState(![]),[_0x1c5c98,_0x4fb16e]=useState(![]),[_0x6791ba,_0x5bee78]=useState(![]),[_0x2b84c8,_0x5f195d]=useState(0x0),[_0x31ace5,_0x354492]=useState(0x0),_0xabf112=_0x29e139(0x1bf),_0x4c4e65=readConfig(),_0x29d2db=typeof _0x4c4e65[_0x29e139(0x1aa)]==='string'?_0x4c4e65[_0x29e139(0x1aa)]:undefined;function _0x1ac175(_0x30da97){const _0x183f0c=_0x29e139;if(_0x30da97[_0x183f0c(0x1c3)]>0x32)return{'valid':![],'message':'项目名长度不能超过\x2050\x20个字符'};const _0x4c848d=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x30da97?.[_0x183f0c(0x1a5)]()&&!_0x4c848d['test'](_0x30da97))return{'valid':![],'message':_0x183f0c(0x1bd)};return{'valid':!![]};}function _0x20f717(_0x1482d5){const _0x527e32=_0x29e139;if(!_0x1482d5[_0x527e32(0x1a5)]())return{'valid':!![]};if(_0x1482d5[_0x527e32(0x1c3)]>0x64)return{'valid':![],'message':_0x527e32(0x197)};const _0x58763a=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x58763a['test'](_0x1482d5))return{'valid':![],'message':_0x527e32(0x1c6)};return{'valid':!![]};}async function _0x553971(){_0x1af4c1(!![]);try{const _0x3e2200=await getIsSessionValid();return _0x513797(_0x3e2200),_0x3e2200;}catch(_0x1f1943){return _0x513797(![]),![];}finally{_0x1af4c1(![]);}}async function _0x3ed879(){_0x4fb16e(!![]);try{const _0x4130e7=await authServer({'silent':!![]});return _0x513797(_0x4130e7),_0x4130e7;}catch(_0x1fc481){return _0x513797(![]),![];}finally{_0x4fb16e(![]);}}return useInput(async(_0x55d695,_0x45a39d)=>{const _0x155fd6=_0x29e139;if(_0x45a39d[_0x155fd6(0x196)]||_0x45a39d[_0x155fd6(0x1b9)]){if(_0x3944cd===_0x155fd6(0x1cc)){_0x5f195d(_0x4728f1=>_0x4728f1===0x0?0x1:0x0);return;}if(_0x3944cd===_0x155fd6(0x1c2)){_0x354492(_0x3cd78e=>_0x3cd78e===0x0?0x1:0x0);return;}}if(_0x45a39d[_0x155fd6(0x1d0)]){if(_0x3944cd===_0x155fd6(0x1a2)){const _0x356582=_0x4cd4db['trim']()||_0xabf112;if(_0xb58d6d)return;_0x218c14(_0x356582),_0x4c6bd3([{'step':_0x155fd6(0x1a2),'label':_0x155fd6(0x19b),'value':_0x356582}]),_0x411143(''),_0x8c6a3b(''),_0x41aaee(_0x155fd6(0x1a3));return;}if(_0x3944cd===_0x155fd6(0x1a3)){if(_0xb58d6d)return;const _0x4fc8e1=_0x4cd4db[_0x155fd6(0x1a5)]();_0x3f6c44(_0x4fc8e1),_0x4c6bd3(_0x50d1d5=>[..._0x50d1d5,{'step':'app-code','label':_0x155fd6(0x1d3),'value':_0x4fc8e1||'未设置'}]),_0x411143(''),_0x8c6a3b('');if(_0x4fc8e1){_0x41aaee(_0x155fd6(0x1ae));const _0x5e7636=await _0x553971();_0x5e7636?_0x41aaee(_0x155fd6(0x1cc)):_0x41aaee(_0x155fd6(0x1c2));}else{const _0x131b0c=_0xb43e40||_0x29d2db||_0x155fd6(0x1c1);_0x10cb49({'projectName':_0x35aaa5,'appCode':undefined,'pullApi':![],'env':_0x131b0c}),_0x41aaee(_0x155fd6(0x1a8));}return;}if(_0x3944cd==='confirm-api-pull'){const _0x20b11a=_0x2b84c8===0x0;_0x5bee78(_0x20b11a),_0x4c6bd3(_0x593cfd=>[..._0x593cfd,{'step':_0x155fd6(0x1ac),'label':'拉取API配置','value':_0x20b11a?'是':'否'}]);const _0xf58b34=_0xb43e40||_0x29d2db||_0x155fd6(0x1c1);_0x10cb49({'projectName':_0x35aaa5,'appCode':_0x2340e4,'pullApi':_0x20b11a,'env':_0xf58b34}),_0x41aaee(_0x155fd6(0x1a8));return;}if(_0x3944cd===_0x155fd6(0x1c2)){const _0x549076=_0x31ace5===0x0;if(_0x549076){_0x41aaee('login-process');const _0x1d844b=await _0x3ed879();if(_0x1d844b)_0x4c6bd3(_0x277713=>[..._0x277713,{'step':'login','label':_0x155fd6(0x1b5),'value':_0x155fd6(0x1c9)}]),_0x41aaee(_0x155fd6(0x1cc));else{_0x4c6bd3(_0x56979b=>[..._0x56979b,{'step':'login','label':_0x155fd6(0x1b5),'value':_0x155fd6(0x1a1)}]);const _0x5278ab=_0xb43e40||_0x29d2db||'online';_0x10cb49({'projectName':_0x35aaa5,'appCode':_0x2340e4,'pullApi':![],'env':_0x5278ab}),_0x41aaee(_0x155fd6(0x1a8));}}else{_0x4c6bd3(_0x1af85e=>[..._0x1af85e,{'step':_0x155fd6(0x19c),'label':_0x155fd6(0x1b5),'value':_0x155fd6(0x1a6)}]);const _0x4acd98=_0xb43e40||_0x29d2db||'online';_0x10cb49({'projectName':_0x35aaa5,'appCode':_0x2340e4,'pullApi':![],'env':_0x4acd98}),_0x41aaee(_0x155fd6(0x1a8));}return;}}if(_0x45a39d[_0x155fd6(0x1b7)]||_0x45a39d[_0x155fd6(0x1c7)]){_0x411143(_0x4de2fd=>{const _0x494f08=_0x155fd6,_0x351f0a=_0x4de2fd[_0x494f08(0x1af)](0x0,-0x1);if(_0x3944cd===_0x494f08(0x1a2)){const {valid:_0x1fd128,message:_0x36be5c}=_0x1ac175(_0x351f0a);_0x8c6a3b(_0x1fd128?'':_0x36be5c||_0x494f08(0x1be));}else{if(_0x3944cd===_0x494f08(0x1a3)){const {valid:_0x4063ee,message:_0x4f3f1c}=_0x20f717(_0x351f0a);_0x8c6a3b(_0x4063ee?'':_0x4f3f1c||_0x494f08(0x1b4));}}return _0x351f0a;});return;}if([_0x155fd6(0x1a8),_0x155fd6(0x1ae),_0x155fd6(0x1ca)][_0x155fd6(0x1cf)](_0x3944cd))return;if(_0x3944cd===_0x155fd6(0x1cc)||_0x3944cd===_0x155fd6(0x1c2))return;_0x411143(_0x183a5e=>{const _0x57758e=_0x155fd6,_0x162394=_0x183a5e+_0x55d695;if(_0x3944cd==='project-name'){const {valid:_0x3cac75,message:_0x3345bd}=_0x1ac175(_0x162394);_0x8c6a3b(_0x3cac75?'':_0x3345bd||_0x57758e(0x1be));}else{if(_0x3944cd===_0x57758e(0x1a3)){const {valid:_0xb21f5c,message:_0x5e23ec}=_0x20f717(_0x162394);_0x8c6a3b(_0xb21f5c?'':_0x5e23ec||_0x57758e(0x1b4));}}return _0x162394;});}),a32_0x42aea9(Box,{'flexDirection':_0x29e139(0x1a0),'marginTop':0x1,'children':[_0x5c5284['length']===0x0&&a32_0x69b5cc(Box,{'children':a32_0x69b5cc(Text,{'color':_0x29e139(0x195),'children':_0x29e139(0x1bc)})}),_0x5c5284['map'](_0x342f62=>a32_0x42aea9(Box,{'children':[a32_0x42aea9(Text,{'color':'green','children':['√\x20',_0x342f62[_0x29e139(0x1d4)],':\x20']}),a32_0x69b5cc(Text,{'color':_0x29e139(0x195),'children':_0x342f62['value']})]},_0x342f62['step'])),_0x3944cd===_0x29e139(0x1a2)&&a32_0x42aea9(a32_0x5a05c4,{'children':[a32_0x42aea9(Box,{'children':[a32_0x69b5cc(Text,{'children':'*\x20项目名:\x20'}),_0x4cd4db?a32_0x69b5cc(Text,{'color':'green','children':_0x4cd4db}):a32_0x69b5cc(Text,{'color':'gray','children':_0xabf112}),_0xb58d6d&&a32_0x42aea9(Text,{'color':_0x29e139(0x1c5),'children':[_0x29e139(0x1ba),_0xb58d6d]})]}),!_0xb58d6d&&!_0x4cd4db&&a32_0x69b5cc(Box,{'children':a32_0x69b5cc(Text,{'color':_0x29e139(0x19f),'children':_0x29e139(0x1ad)})})]}),_0x3944cd===_0x29e139(0x1a3)&&a32_0x42aea9(a32_0x5a05c4,{'children':[a32_0x42aea9(Box,{'children':[a32_0x69b5cc(Text,{'children':_0x29e139(0x1c8)}),a32_0x69b5cc(Text,{'color':_0x29e139(0x19f),'children':_0x29e139(0x1b3)}),a32_0x69b5cc(Text,{'color':'green','children':_0x4cd4db}),_0xb58d6d&&a32_0x42aea9(Text,{'color':_0x29e139(0x1c5),'children':['\x20←\x20',_0xb58d6d]})]}),!_0xb58d6d&&a32_0x69b5cc(Box,{'children':a32_0x42aea9(Text,{'color':_0x29e139(0x19f),'children':['\x20',_0x29e139(0x1cd)]})})]}),_0x3944cd==='login-check'&&a32_0x42aea9(Box,{'children':[a32_0x69b5cc(Text,{'children':'*\x20正在检查登录状态...'}),_0x1ca217&&a32_0x69b5cc(Text,{'color':'gray','children':_0x29e139(0x1a7)})]}),_0x3944cd==='confirm-api-pull'&&a32_0x42aea9(a32_0x5a05c4,{'children':[a32_0x69b5cc(Box,{'children':a32_0x69b5cc(Text,{'color':_0x29e139(0x1cb),'children':_0x29e139(0x1d1)})}),a32_0x69b5cc(Box,{'marginTop':0x1,'children':a32_0x69b5cc(Text,{'children':'*\x20是否要自动拉取\x20API\x20配置?'})}),a32_0x42aea9(Box,{'marginLeft':0x2,'children':[a32_0x42aea9(Text,{'color':_0x2b84c8===0x0?_0x29e139(0x1cb):_0x29e139(0x19f),'children':[_0x2b84c8===0x0?'▶\x20':'\x20\x20','Yes']}),a32_0x69b5cc(Text,{'children':'\x20'}),a32_0x42aea9(Text,{'color':_0x2b84c8===0x1?'green':_0x29e139(0x19f),'children':[_0x2b84c8===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x69b5cc(Box,{'children':a32_0x69b5cc(Text,{'color':_0x29e139(0x19f),'children':_0x29e139(0x1ce)})}),a32_0x69b5cc(Box,{'children':a32_0x69b5cc(Text,{'color':_0x29e139(0x19d),'children':'\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口'})})]}),_0x3944cd===_0x29e139(0x1c2)&&a32_0x42aea9(a32_0x5a05c4,{'children':[a32_0x69b5cc(Box,{'children':a32_0x69b5cc(Text,{'color':'yellow','children':_0x29e139(0x1b0)})}),a32_0x69b5cc(Box,{'marginTop':0x1,'children':a32_0x69b5cc(Text,{'children':_0x29e139(0x1a9)})}),a32_0x42aea9(Box,{'marginLeft':0x2,'children':[a32_0x42aea9(Text,{'color':_0x31ace5===0x0?_0x29e139(0x1cb):_0x29e139(0x19f),'children':[_0x31ace5===0x0?'▶\x20':'\x20\x20','Yes']}),a32_0x69b5cc(Text,{'children':'\x20'}),a32_0x42aea9(Text,{'color':_0x31ace5===0x1?'green':_0x29e139(0x19f),'children':[_0x31ace5===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x69b5cc(Box,{'children':a32_0x69b5cc(Text,{'color':_0x29e139(0x19f),'children':_0x29e139(0x1ce)})}),a32_0x69b5cc(Box,{'children':a32_0x69b5cc(Text,{'color':_0x29e139(0x19d),'children':_0x29e139(0x19e)})})]}),_0x3944cd==='login-process'&&a32_0x42aea9(Box,{'children':[a32_0x69b5cc(Text,{'children':_0x29e139(0x1c0)}),_0x1c5c98&&a32_0x69b5cc(Text,{'color':_0x29e139(0x19f),'children':_0x29e139(0x1b6)})]})]});}
|