@lovrabet/cli 1.1.2 → 1.1.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/README.md +2 -2
- 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-pull-ui.js +1 -1
- package/lib/api/format-dataset.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/api/pull.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/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
- package/templates/pages/sdk-fetch/index.tsx.tpl +14 -5
- package/templates/projects/sub-app-react-demo/package-lock.json +2856 -0
- package/templates/projects/sub-app-react-demo/package.json +1 -1
- package/templates/projects/sub-app-react-demo/src/api/api.ts +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Lovrabet CLI
|
|
2
2
|
|
|
3
|
-
一个强大的前端开发脚手架工具,专为 Lovrabet
|
|
3
|
+
一个强大的前端开发脚手架工具,专为 [Lovrabet](https://www.lovrabet.com) 开放平台应用开发而设计。提供项目创建、页面生成、API 集成、开发调试等全套开发工具链。
|
|
4
4
|
|
|
5
5
|
## ✨ 特性
|
|
6
6
|
|
|
@@ -250,7 +250,7 @@ cd component-library
|
|
|
250
250
|
lovrabet build
|
|
251
251
|
```
|
|
252
252
|
|
|
253
|
-
## 🆘
|
|
253
|
+
## 🆘 故障排查
|
|
254
254
|
|
|
255
255
|
### 常见问题
|
|
256
256
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1da5a3,_0x3b8622){const _0x42c48e=a0_0x2087,_0x5bfd44=_0x1da5a3();while(!![]){try{const _0x3b1ce9=parseInt(_0x42c48e(0x152))/0x1+-parseInt(_0x42c48e(0x165))/0x2+-parseInt(_0x42c48e(0x15a))/0x3*(parseInt(_0x42c48e(0x15f))/0x4)+parseInt(_0x42c48e(0x14c))/0x5+-parseInt(_0x42c48e(0x149))/0x6+parseInt(_0x42c48e(0x14d))/0x7*(-parseInt(_0x42c48e(0x150))/0x8)+parseInt(_0x42c48e(0x161))/0x9;if(_0x3b1ce9===_0x3b8622)break;else _0x5bfd44['push'](_0x5bfd44['shift']());}catch(_0x5dceab){_0x5bfd44['push'](_0x5bfd44['shift']());}}}(a0_0x6c9c,0xcc50e));import{jsx as a0_0x18ba95,jsxs as a0_0x3e7795}from'react/jsx-runtime';import{useState}from'react';function a0_0x6c9c(){const _0x4b355c=['14948qvXqZC','trim','28682667AteFYy','\x20←\x20','my-page','includes','56496gEcIxn','test','页面路径\x20','endsWith','green','startsWith','6615402POOjbH','页面路径不合法','\x20直接回车确认,或输入自定义路由地址','194105YwgSye','790706vAiTjl','backspace','页面路径长度不能超过\x20100\x20个字符','24LfIHlW','length','115932YYIqhD','路径不能包含连续的\x20/','路径不能以\x20/\x20开头或结尾','existsSync','\x20已存在,请使用其他路径','return','red','delete','831HcTnsk','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','gray','slice','column'];a0_0x6c9c=function(){return _0x4b355c;};return a0_0x6c9c();}import{Text,Box,useInput}from'ink';import a0_0x15af7e from'node:fs';function a0_0x2087(_0x50aee3,_0x53d1ba){const _0x6c9c03=a0_0x6c9c();return a0_0x2087=function(_0x208738,_0x108daa){_0x208738=_0x208738-0x147;let _0x3dccde=_0x6c9c03[_0x208738];return _0x3dccde;},a0_0x2087(_0x50aee3,_0x53d1ba);}export function InputProjectCode(_0x5972a5){const _0x129f5f=a0_0x2087,{onSubmit:_0x1960b7,pagePath:_0x113bf1}=_0x5972a5,[_0x461485,_0x4b75ce]=useState(''),[_0x46622f,_0x1bb141]=useState(''),_0x5e7dfa=_0x129f5f(0x163);function _0x38d852(_0x19bff6){const _0x3ee6d1=_0x129f5f;if(_0x19bff6[_0x3ee6d1(0x151)]>0x64)return{'valid':![],'message':_0x3ee6d1(0x14f)};if(_0x19bff6[_0x3ee6d1(0x148)]('/')||_0x19bff6[_0x3ee6d1(0x168)]('/'))return{'valid':![],'message':_0x3ee6d1(0x154)};if(_0x19bff6[_0x3ee6d1(0x164)]('//'))return{'valid':![],'message':_0x3ee6d1(0x153)};const _0x45e598=_0x19bff6['split']('/');for(const _0x1f7ce1 of _0x45e598){if(!_0x1f7ce1)continue;const _0x352401=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x352401[_0x3ee6d1(0x166)](_0x1f7ce1))return{'valid':![],'message':_0x3ee6d1(0x15b)};}return{'valid':!![]};}return useInput((_0x4e0026,_0x249cbe)=>{const _0x1a3c2d=_0x129f5f;if(_0x249cbe[_0x1a3c2d(0x157)]){const _0x569f6f=_0x461485[_0x1a3c2d(0x160)]()||_0x5e7dfa;if(_0x46622f)return;const _0x1e27f6=_0x113bf1+'/'+_0x569f6f;if(a0_0x15af7e[_0x1a3c2d(0x155)](_0x1e27f6)){_0x1bb141(_0x1a3c2d(0x167)+_0x569f6f+_0x1a3c2d(0x156));return;}_0x1960b7(_0x569f6f),_0x4b75ce(''),_0x1bb141('');}else _0x249cbe[_0x1a3c2d(0x14e)]||_0x249cbe[_0x1a3c2d(0x159)]?_0x4b75ce(_0x57937a=>{const _0x27a928=_0x1a3c2d,_0x27e07e=_0x57937a[_0x27a928(0x15d)](0x0,-0x1),{valid:_0x251018,message:_0x3f6238}=_0x38d852(_0x27e07e);return _0x1bb141(_0x251018?'':_0x3f6238||'页面路径不合法'),_0x27e07e;}):_0x4b75ce(_0x10e5d5=>{const _0x274179=_0x1a3c2d,_0x335874=_0x10e5d5+_0x4e0026,{valid:_0x46c326,message:_0x5e4573}=_0x38d852(_0x335874);return _0x1bb141(_0x46c326?'':_0x5e4573||_0x274179(0x14a)),_0x335874;});}),a0_0x3e7795(Box,{'flexDirection':_0x129f5f(0x15e),'children':[a0_0x3e7795(Box,{'children':[a0_0x18ba95(Text,{'color':'gray','children':'\x20Step2:\x20'}),a0_0x18ba95(Text,{'children':'页面路由地址:\x20'}),_0x461485?a0_0x18ba95(Text,{'color':_0x129f5f(0x147),'children':_0x461485}):a0_0x18ba95(Text,{'color':_0x129f5f(0x15c),'children':_0x5e7dfa}),_0x46622f&&a0_0x3e7795(Text,{'color':_0x129f5f(0x158),'children':[_0x129f5f(0x162),_0x46622f]})]}),!_0x46622f&&!_0x461485&&a0_0x18ba95(Box,{'children':a0_0x18ba95(Text,{'color':'gray','children':_0x129f5f(0x14b)})})]});}
|
package/lib/add-page/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a1_0x2f0a(_0x2dfebb,_0x1cf97b){const _0x28eca9=a1_0x28ec();return a1_0x2f0a=function(_0x2f0ade,_0x23a58c){_0x2f0ade=_0x2f0ade-0xe3;let _0xeb7acb=_0x28eca9[_0x2f0ade];return _0xeb7acb;},a1_0x2f0a(_0x2dfebb,_0x1cf97b);}const a1_0x458b9f=a1_0x2f0a;(function(_0x14f22d,_0x255313){const _0x28ee01=a1_0x2f0a,_0x4cba0c=_0x14f22d();while(!![]){try{const _0xd36589=parseInt(_0x28ee01(0xe7))/0x1+-parseInt(_0x28ee01(0xed))/0x2+-parseInt(_0x28ee01(0xf7))/0x3+-parseInt(_0x28ee01(0x107))/0x4*(parseInt(_0x28ee01(0xfe))/0x5)+parseInt(_0x28ee01(0xfb))/0x6*(parseInt(_0x28ee01(0xf6))/0x7)+parseInt(_0x28ee01(0xea))/0x8*(parseInt(_0x28ee01(0x105))/0x9)+parseInt(_0x28ee01(0xfd))/0xa;if(_0xd36589===_0x255313)break;else _0x4cba0c['push'](_0x4cba0c['shift']());}catch(_0x349729){_0x4cba0c['push'](_0x4cba0c['shift']());}}}(a1_0x28ec,0x288d7));import{jsx as a1_0x38c786,jsxs as a1_0x2010ea,Fragment as a1_0x3e442f}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x401910 from'node:path';import{useEffect,useState}from'react';function a1_0x28ec(){const _0x48a84d=['9565BFwmmn','已输入的页面路由\x20','green','setLogPath','../../templates/pages','catch','message','108747PRrzIz','\x20*\x20页面文件已创建,可直接通过路由访问','184JuanAU','add-page','gray','processTemplate','pages','\x20Step2:\x20','info','147226Cbtquk','dirname','\x20*\x20页面路径:\x20','120VWvazo','\x20*\x20页面创建成功!','正在创建页面,请稍候…','595534QEAKXF','\x20Step1:\x20','src','now','join','cwd','开始添加页面:\x20','resolve','已选择页面模板\x20','77iNYXtz','728838vNmAjH','\x20*\x20路由地址:\x20','then','finally','125934jAzihL','页面添加失败:\x20','2354640KmBFcq'];a1_0x28ec=function(){return _0x48a84d;};return a1_0x28ec();}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_0x401910[a1_0x458b9f(0xe8)](fileURLToPath(import.meta['url'])),pageTemplateDir=a1_0x401910['resolve'](__dirname,a1_0x458b9f(0x102)),projectDir=process['cwd']();export const AddPage=()=>{const _0xdd36e5=a1_0x458b9f,{exit:_0xf8cc9b}=useApp(),[_0x538310,_0x393ef4]=useState(''),[_0x1ef5ed,_0x237f30]=useState(''),[_0x22931b,_0x492afb]=useState(![]),[_0x4a6c09,_0x1ff5b3]=useState(![]),_0x17b450=a1_0x401910[_0xdd36e5(0xf1)](projectDir,_0xdd36e5(0xef),'pages'),_0x5470fb=a1_0x401910[_0xdd36e5(0xf1)](_0x17b450,_0x1ef5ed),_0x2cba6a=a1_0x401910[_0xdd36e5(0xf1)](_0xdd36e5(0xef),_0xdd36e5(0xe4),_0x1ef5ed);useEffect(()=>{const _0xab7e65=_0xdd36e5,_0x34920c=a1_0x401910[_0xab7e65(0xf4)](pageTemplateDir,_0x538310);if(_0x538310&&_0x1ef5ed){_0x492afb(!![]),logger[_0xab7e65(0x101)](process[_0xab7e65(0xf2)]());const _0x355dbd=Date['now']();logger[_0xab7e65(0xe6)](_0xab7e65(0x108),_0xab7e65(0xf3)+_0x1ef5ed,{'template':_0x538310,'targetPath':_0x2cba6a}),TemplateReplacer[_0xab7e65(0xe3)](_0x34920c,a1_0x401910[_0xab7e65(0xf1)](_0x17b450,_0x1ef5ed),_0x1ef5ed,_0x538310)[_0xab7e65(0xf9)](()=>{const _0x3f4147=_0xab7e65,_0x182bcf=Date['now']()-_0x355dbd;logger['success'](_0x3f4147(0x108),'页面添加成功:\x20'+_0x1ef5ed,_0x182bcf,{'template':_0x538310,'targetPath':_0x2cba6a,'routePath':_0x1ef5ed}),_0x1ff5b3(!![]);})[_0xab7e65(0x103)](_0x1d18f8=>{const _0x4be28a=_0xab7e65,_0x31e75c=Date[_0x4be28a(0xf0)]()-_0x355dbd;logger['error']('add-page',_0x4be28a(0xfc)+_0x1ef5ed,{'template':_0x538310,'targetPath':_0x2cba6a,'error':_0x1d18f8 instanceof Error?_0x1d18f8[_0x4be28a(0x104)]:String(_0x1d18f8),'duration':_0x31e75c});})[_0xab7e65(0xfa)](()=>{_0x492afb(![]);});}},[_0x538310,_0x1ef5ed]),useEffect(()=>{_0x4a6c09&&setTimeout(()=>{_0xf8cc9b();});},[_0x4a6c09]);if(_0x538310)return a1_0x2010ea(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x2010ea(Box,{'children':[a1_0x38c786(Text,{'color':_0xdd36e5(0x109),'children':_0xdd36e5(0xee)}),a1_0x38c786(Text,{'children':_0xdd36e5(0xf5)}),a1_0x38c786(Text,{'color':'green','children':_0x538310})]}),_0x1ef5ed?a1_0x2010ea(Box,{'children':[a1_0x38c786(Text,{'color':'gray','children':_0xdd36e5(0xe5)}),a1_0x38c786(Text,{'children':_0xdd36e5(0xff)}),a1_0x38c786(Text,{'color':_0xdd36e5(0x100),'children':_0x1ef5ed})]}):a1_0x38c786(InputProjectCode,{'pagePath':_0x5470fb,'onSubmit':_0x237f30}),_0x1ef5ed&&_0x22931b?a1_0x2010ea(Box,{'marginTop':0x1,'children':[a1_0x38c786(Box,{'width':'4'}),a1_0x38c786(Text,{'children':_0xdd36e5(0xec)})]}):null,_0x4a6c09?a1_0x2010ea(a1_0x3e442f,{'children':[a1_0x38c786(Box,{'marginTop':0x1,'children':a1_0x38c786(Text,{'color':'gray','children':_0xdd36e5(0xeb)})}),a1_0x2010ea(Box,{'children':[a1_0x38c786(Text,{'color':'gray','children':_0xdd36e5(0xe9)}),a1_0x38c786(Text,{'color':_0xdd36e5(0x100),'children':_0x2cba6a})]}),a1_0x2010ea(Box,{'children':[a1_0x38c786(Text,{'color':'gray','children':_0xdd36e5(0xf8)}),a1_0x2010ea(Text,{'color':'green','children':['/',_0x1ef5ed]})]}),a1_0x38c786(Box,{'marginTop':0x1,'children':a1_0x38c786(Text,{'color':'cyan','children':_0xdd36e5(0x106)})})]}):null]});return a1_0x38c786(SelectPageTemplate,{'onSelect':_0x393ef4});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x157cea,_0x1ca8e3){const _0x11e2bf=a2_0x53f6,_0x407cec=_0x157cea();while(!![]){try{const _0x27056e=-parseInt(_0x11e2bf(0x162))/0x1*(-parseInt(_0x11e2bf(0x14f))/0x2)+-parseInt(_0x11e2bf(0x15e))/0x3+parseInt(_0x11e2bf(0x15b))/0x4*(parseInt(_0x11e2bf(0x148))/0x5)+parseInt(_0x11e2bf(0x156))/0x6*(parseInt(_0x11e2bf(0x152))/0x7)+-parseInt(_0x11e2bf(0x14c))/0x8*(-parseInt(_0x11e2bf(0x15c))/0x9)+-parseInt(_0x11e2bf(0x151))/0xa+-parseInt(_0x11e2bf(0x155))/0xb*(parseInt(_0x11e2bf(0x157))/0xc);if(_0x27056e===_0x1ca8e3)break;else _0x407cec['push'](_0x407cec['shift']());}catch(_0x3b2a43){_0x407cec['push'](_0x407cec['shift']());}}}(a2_0x423e,0x4987d));function a2_0x53f6(_0x2a4e56,_0x68e206){const _0x423e5b=a2_0x423e();return a2_0x53f6=function(_0x53f63e,_0x501440){_0x53f63e=_0x53f63e-0x145;let _0x3f5fcc=_0x423e5b[_0x53f63e];return _0x3f5fcc;},a2_0x53f6(_0x2a4e56,_0x68e206);}import{jsx as a2_0x5a6ab3,jsxs as a2_0x3d96b5}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';function a2_0x423e(){const _0x457c99=['509346QHoSlu','\x20\x20\x20\x20\x20\x20>\x20','localeCompare','请选择您要创建的页面模板','43QiPgiL','sdk-fetch','\x20Step1:\x20','blank','\x20\x20\x20\x20\x20\x20\x20\x20','gray','resolve','2641150nCwfUK','获取模板列表失败:','length','join','68232yARwfP','正在加载页面模板...','label','6506NTKARQ','column','5028760VcpUGf','4146331RTqrwM','map','url','209bBTEBX','6JMKPyr','558084ulBUlk','isDirectory','upArrow','../..','4FvnmaB','630zQjpmP','downArrow'];a2_0x423e=function(){return _0x457c99;};return a2_0x423e();}import a2_0x4613ac from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x4ef91e=a2_0x53f6;try{const _0x5979fa=fileURLToPath(import.meta[_0x4ef91e(0x154)]),_0x4954fa=a2_0x4613ac[_0x4ef91e(0x147)](a2_0x4613ac['dirname'](_0x5979fa),_0x4ef91e(0x15a)),_0x59cf2b=a2_0x4613ac[_0x4ef91e(0x14b)](_0x4954fa,'templates/pages'),_0x5a57ba=await readdir(_0x59cf2b,{'withFileTypes':!![]}),_0x2d144d=_0x5a57ba['filter'](_0x4124f4=>_0x4124f4[_0x4ef91e(0x158)]())['map'](_0x5a0e67=>({'label':_0x5a0e67['name']}))['sort']((_0x40ee32,_0x12e203)=>_0x40ee32[_0x4ef91e(0x14e)][_0x4ef91e(0x160)](_0x12e203[_0x4ef91e(0x14e)]));return _0x2d144d;}catch(_0x4efc6a){return console['error'](_0x4ef91e(0x149),_0x4efc6a),[{'label':_0x4ef91e(0x165)},{'label':_0x4ef91e(0x163)}];}}export function SelectPageTemplate(_0x3fc54f){const _0x5e7ea6=a2_0x53f6,[_0x2ff9dc,_0x8f3951]=useState(0x0),[_0x2e4a19,_0x1f627c]=useState([]),[_0x4f96df,_0x22e21d]=useState(!![]);useEffect(()=>{async function _0x2a90ed(){const _0x514fa4=await getTemplateList();_0x1f627c(_0x514fa4),_0x22e21d(![]);}_0x2a90ed();},[]),useInput((_0x56dea3,_0x5b7739)=>{const _0x4c0c58=a2_0x53f6;if(_0x4f96df)return;if(_0x5b7739['return']){const _0x469dbe=_0x2e4a19[_0x2ff9dc];_0x469dbe&&_0x3fc54f['onSelect'](_0x469dbe[_0x4c0c58(0x14e)]);}_0x5b7739[_0x4c0c58(0x159)]&&_0x8f3951(_0xaa85d2=>_0xaa85d2===0x0?_0x2e4a19[_0x4c0c58(0x14a)]-0x1:_0xaa85d2-0x1),_0x5b7739[_0x4c0c58(0x15d)]&&_0x8f3951(_0x351f6e=>_0x351f6e===_0x2e4a19[_0x4c0c58(0x14a)]-0x1?0x0:_0x351f6e+0x1);});if(_0x4f96df)return a2_0x5a6ab3(Box,{'flexDirection':_0x5e7ea6(0x150),'paddingY':0x1,'children':a2_0x3d96b5(Box,{'children':[a2_0x5a6ab3(Text,{'color':'gray','children':'\x20Step1:\x20'}),a2_0x5a6ab3(Text,{'children':_0x5e7ea6(0x14d)})]})});return a2_0x3d96b5(Box,{'flexDirection':_0x5e7ea6(0x150),'paddingY':0x1,'children':[a2_0x3d96b5(Box,{'children':[a2_0x5a6ab3(Text,{'color':_0x5e7ea6(0x146),'children':_0x5e7ea6(0x164)}),a2_0x5a6ab3(Text,{'children':_0x5e7ea6(0x161)})]}),_0x2e4a19[_0x5e7ea6(0x153)]((_0x2b3d05,_0x270d14)=>{const _0x44a77e=_0x5e7ea6,_0x1653ad=_0x270d14===_0x2ff9dc,_0x237fc8=_0x1653ad?_0x44a77e(0x15f)+_0x2b3d05[_0x44a77e(0x14e)]:_0x44a77e(0x145)+_0x2b3d05[_0x44a77e(0x14e)];return a2_0x5a6ab3(Box,{'children':a2_0x5a6ab3(Text,{'color':_0x1653ad?'green':undefined,'children':_0x237fc8})},_0x237fc8);})]});}
|
package/lib/api/api-pull-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x56b569,_0x33373d){const _0xa34f2c=a3_0x221c,_0x44e1f0=_0x56b569();while(!![]){try{const _0x36c7da=parseInt(_0xa34f2c(0x226))/0x1*(-parseInt(_0xa34f2c(0x208))/0x2)+parseInt(_0xa34f2c(0x21b))/0x3*(parseInt(_0xa34f2c(0x1f2))/0x4)+parseInt(_0xa34f2c(0x20e))/0x5+-parseInt(_0xa34f2c(0x202))/0x6*(-parseInt(_0xa34f2c(0x20a))/0x7)+-parseInt(_0xa34f2c(0x219))/0x8*(parseInt(_0xa34f2c(0x21a))/0x9)+parseInt(_0xa34f2c(0x225))/0xa+parseInt(_0xa34f2c(0x204))/0xb*(-parseInt(_0xa34f2c(0x1f3))/0xc);if(_0x36c7da===_0x33373d)break;else _0x44e1f0['push'](_0x44e1f0['shift']());}catch(_0x27e7cb){_0x44e1f0['push'](_0x44e1f0['shift']());}}}(a3_0x4ca9,0x70b63));function a3_0x4ca9(){const _0x43141c=['11dMherl','status','api-pull','💡\x20请使用\x20','788IqVdSa',',且无法读取错误响应内容','558320QRsMvu','replace','url','*\x20已生成文件:','3634025MLLchB','message','data','拉取\x20API\x20配置失败:\x20','green','json','lovrabet\x20auth','cyan','*\x20将生成文件:\x20','\x20-\x20客户端实例文件','api','1560864yVSgnQ','9BzozND','79347mBoWgr','text','error','red','{\x20lovrabetClient\x20}','client','-client','获取数据集失败,HTTP状态码:\x20','🚀\x20正在从服务器拉取\x20API\x20配置...','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','223340EVACld','284CRGGSg','split','√\x20API\x20文件生成成功!','\x20-\x20模型配置文件','dim','100AsVsWq','14400156RiEgFU','cwd','yellow','slice','success','app','使用配置的应用AppCode:\x20','import\x20','includes','column','.ts','src/api/','gray','*\x20导入方式:','未提供应用AppCode,且配置中也没有默认值','42iqEARX','&pageSize=999¤tPage=1'];a3_0x4ca9=function(){return _0x43141c;};return a3_0x4ca9();}import{jsx as a3_0x40e09c,jsxs as a3_0x77ac50}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a3_0x221c(_0x1c18eb,_0x291624){const _0x4ca93e=a3_0x4ca9();return a3_0x221c=function(_0x221c01,_0x407d10){_0x221c01=_0x221c01-0x1f1;let _0x184b88=_0x4ca93e[_0x221c01];return _0x184b88;},a3_0x221c(_0x1c18eb,_0x291624);}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x1353aa})=>{const _0x142ec4=a3_0x221c,{exit:_0xf1c3b}=useApp(),[_0x50d99b,_0x20d9bb]=useState(![]),[_0x881698,_0x4f42b3]=useState(![]),[_0x4e64fe,_0x19ed85]=useState(null),[_0x402a42,_0x10270c]=useState(null),_0x37905f=readConfig(),_0x69c931=_0x1353aa||_0x37905f?.[_0x142ec4(0x1f8)],_0x234d59=_0x1353aa&&_0x1353aa[_0x142ec4(0x1fb)]('-')?_0x1353aa[_0x142ec4(0x227)]('-')[_0x142ec4(0x1f6)](0x1)['join']('-'):'',_0x55bead=_0x1353aa?'使用指定的应用AppCode:\x20'+_0x69c931:_0x142ec4(0x1f9)+_0x69c931,_0x56488b=_0x234d59?_0x234d59+'-api':_0x142ec4(0x218),_0x3130a1=_0x234d59?_0x234d59+_0x142ec4(0x221):_0x142ec4(0x220);useEffect(()=>{_0x20d9bb(!![]),_0x2e502c();},[]),useEffect(()=>{(_0x881698||_0x4e64fe)&&_0xf1c3b();},[_0x881698,_0x4e64fe,_0xf1c3b]);async function _0x2e502c(){const _0x1a7978=_0x142ec4;if(!_0x69c931){_0x19ed85(_0x1a7978(0x201));return;}try{logger['setLogPath'](process[_0x1a7978(0x1f4)]());const _0x4e1fac=await fetch(getApiDomain()+'/smartapi/dataset/getList?appCode='+_0x69c931+_0x1a7978(0x203),{'headers':{'Cookie':getCookie()}});if(_0x4e1fac['ok']){const _0x218568=await _0x4e1fac[_0x1a7978(0x213)]();if(_0x218568[_0x1a7978(0x1f7)]){const _0x8a31e8=!_0x1353aa;await generateApiFile(_0x218568[_0x1a7978(0x210)]['tableData'],_0x234d59,_0x69c931,_0x8a31e8),_0x10270c({'api':'src/api/'+_0x56488b+_0x1a7978(0x1fd),'client':_0x1a7978(0x1fe)+_0x3130a1+_0x1a7978(0x1fd)}),_0x4f42b3(!![]);}}else{if(_0x4e1fac[_0x1a7978(0x205)]===0x191){const _0x3d1792=_0x1a7978(0x224);logger['error']('api-pull',_0x3d1792,{'status':_0x4e1fac['status'],'appCode':_0x69c931,'url':_0x4e1fac[_0x1a7978(0x20c)]}),_0x19ed85(_0x3d1792);}else{const _0x3b6cbb=_0x1a7978(0x222)+_0x4e1fac[_0x1a7978(0x205)];try{const _0x2a5a4d=await _0x4e1fac[_0x1a7978(0x21c)]();_0x2a5a4d?logger[_0x1a7978(0x21d)](_0x1a7978(0x206),_0x3b6cbb,{'status':_0x4e1fac[_0x1a7978(0x205)],'appCode':_0x69c931,'url':_0x4e1fac[_0x1a7978(0x20c)],'errorBody':_0x2a5a4d}):logger['error'](_0x1a7978(0x206),_0x3b6cbb,{'status':_0x4e1fac[_0x1a7978(0x205)],'appCode':_0x69c931,'url':_0x4e1fac[_0x1a7978(0x20c)]});}catch(_0x2df1d7){logger['error'](_0x1a7978(0x206),_0x3b6cbb+_0x1a7978(0x209),{'status':_0x4e1fac[_0x1a7978(0x205)],'appCode':_0x69c931,'url':_0x4e1fac[_0x1a7978(0x20c)],'readError':_0x2df1d7 instanceof Error?_0x2df1d7[_0x1a7978(0x20f)]:String(_0x2df1d7)});}_0x19ed85(_0x3b6cbb);}}}catch(_0x2402a8){const _0x3b390f=_0x2402a8 instanceof Error?_0x2402a8[_0x1a7978(0x20f)]:String(_0x2402a8);_0x19ed85(_0x1a7978(0x211)+_0x3b390f);}finally{_0x20d9bb(![]);}}return a3_0x77ac50(Box,{'flexDirection':_0x142ec4(0x1fc),'children':[a3_0x77ac50(Box,{'children':[a3_0x40e09c(Text,{'color':'gray','children':'*\x20'}),a3_0x40e09c(Text,{'color':_0x1353aa?'white':_0x142ec4(0x1f1),'children':_0x55bead})]}),a3_0x77ac50(Box,{'children':[a3_0x40e09c(Text,{'color':_0x142ec4(0x1ff),'children':_0x142ec4(0x216)}),a3_0x77ac50(Text,{'color':_0x142ec4(0x215),'children':[_0x56488b,_0x142ec4(0x1fd)]}),a3_0x40e09c(Text,{'color':_0x142ec4(0x1f1),'children':'\x20和\x20'}),a3_0x77ac50(Text,{'color':_0x142ec4(0x215),'children':[_0x3130a1,_0x142ec4(0x1fd)]})]}),_0x50d99b&&a3_0x40e09c(Box,{'children':a3_0x40e09c(Text,{'children':_0x142ec4(0x223)})}),_0x881698&&_0x402a42&&a3_0x77ac50(Box,{'flexDirection':'column','children':[a3_0x40e09c(Box,{'children':a3_0x40e09c(Text,{'color':_0x142ec4(0x212),'children':_0x142ec4(0x228)})}),a3_0x40e09c(Box,{'marginTop':0x1,'children':a3_0x40e09c(Text,{'color':_0x142ec4(0x1ff),'children':_0x142ec4(0x20d)})}),a3_0x77ac50(Box,{'marginLeft':0x2,'children':[a3_0x77ac50(Text,{'color':_0x142ec4(0x215),'children':['•\x20',_0x402a42[_0x142ec4(0x218)]]}),a3_0x40e09c(Text,{'color':'dim','children':_0x142ec4(0x229)})]}),a3_0x77ac50(Box,{'marginLeft':0x2,'children':[a3_0x77ac50(Text,{'color':_0x142ec4(0x215),'children':['•\x20',_0x402a42[_0x142ec4(0x220)]]}),a3_0x40e09c(Text,{'color':'dim','children':_0x142ec4(0x217)})]}),a3_0x40e09c(Box,{'marginTop':0x1,'children':a3_0x40e09c(Text,{'color':_0x142ec4(0x1ff),'children':_0x142ec4(0x200)})}),a3_0x40e09c(Box,{'marginLeft':0x2,'children':a3_0x77ac50(Text,{'color':_0x142ec4(0x1f5),'children':[_0x142ec4(0x1fa),_0x142ec4(0x21f),'\x20from\x20\x27@/api/',_0x402a42[_0x142ec4(0x220)][_0x142ec4(0x20b)](_0x142ec4(0x1fe),'')[_0x142ec4(0x20b)](_0x142ec4(0x1fd),''),'\x27']})})]}),_0x4e64fe&&a3_0x77ac50(Box,{'flexDirection':_0x142ec4(0x1fc),'children':[a3_0x40e09c(Box,{'children':a3_0x77ac50(Text,{'color':_0x142ec4(0x21e),'children':['❌\x20',_0x4e64fe]})}),_0x4e64fe['includes']('登录')&&a3_0x77ac50(Box,{'marginTop':0x1,'children':[a3_0x40e09c(Text,{'color':'yellow','children':_0x142ec4(0x207)}),a3_0x40e09c(Text,{'color':_0x142ec4(0x215),'children':_0x142ec4(0x214)}),a3_0x40e09c(Text,{'color':'yellow','children':'\x20重新登录后再试'})]})]})]});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a4_0x2c70(_0x1630be,_0x2c9d4b){const _0x1cba63=a4_0x1cba();return a4_0x2c70=function(_0x2c709d,_0x5edb4d){_0x2c709d=_0x2c709d-0xa0;let _0x812218=_0x1cba63[_0x2c709d];return _0x812218;},a4_0x2c70(_0x1630be,_0x2c9d4b);}(function(_0x36c750,_0x295a6e){const _0x4cdea0=a4_0x2c70,_0x2c0100=_0x36c750();while(!![]){try{const _0x4eb256=parseInt(_0x4cdea0(0xad))/0x1+-parseInt(_0x4cdea0(0xa5))/0x2*(parseInt(_0x4cdea0(0xac))/0x3)+parseInt(_0x4cdea0(0xa9))/0x4+parseInt(_0x4cdea0(0xb7))/0x5+-parseInt(_0x4cdea0(0xa8))/0x6*(-parseInt(_0x4cdea0(0xa4))/0x7)+parseInt(_0x4cdea0(0xa7))/0x8+-parseInt(_0x4cdea0(0xb5))/0x9*(parseInt(_0x4cdea0(0xba))/0xa);if(_0x4eb256===_0x295a6e)break;else _0x2c0100['push'](_0x2c0100['shift']());}catch(_0x350325){_0x2c0100['push'](_0x2c0100['shift']());}}}(a4_0x1cba,0x57a89));export function formatDataset(_0x522aa6){const _0x44daba=a4_0x2c70,_0x6ec913=_0x522aa6[_0x44daba(0xaa)](_0x1242e4=>_0x1242e4[_0x44daba(0xa6)]),_0x377cb4=_0x522aa6[_0x44daba(0xaa)](_0x53a507=>!_0x53a507[_0x44daba(0xa6)]),_0x234f02=new Map();_0x6ec913[_0x44daba(0xae)](_0x61c501=>{const _0x15542b=_0x44daba,_0x5aaf1d=_0x61c501[_0x15542b(0xa6)][_0x15542b(0xb1)],_0x28ddaa=_0x234f02['get'](_0x5aaf1d);(!_0x28ddaa||_0x61c501['id']>_0x28ddaa['id'])&&_0x234f02[_0x15542b(0xb9)](_0x5aaf1d,_0x61c501);});const _0x458adc=Array[_0x44daba(0xa0)](_0x234f02[_0x44daba(0xa1)]())[_0x44daba(0xb8)](_0x4e5d5b=>{const _0x300f27=_0x44daba,_0x23f9b3=snakeToCamel(_0x4e5d5b[_0x300f27(0xa6)][_0x300f27(0xb1)]);return{'id':_0x4e5d5b['id'],'name':_0x4e5d5b[_0x300f27(0xb2)],'code':_0x4e5d5b[_0x300f27(0xbc)],'tableName':_0x4e5d5b[_0x300f27(0xa6)][_0x300f27(0xb1)],'apiFucName':_0x23f9b3?_0x23f9b3+_0x300f27(0xbb):_0x300f27(0xb0)+_0x4e5d5b['code']+_0x300f27(0xbb),'pkField':_0x4e5d5b['dbtableConfig'][_0x300f27(0xa2)],'allFields':_0x4e5d5b['dbtableConfig'][_0x300f27(0xb4)][_0x300f27(0xb3)](',')};}),_0x3ff692=_0x377cb4[_0x44daba(0xb8)](_0xf0afaa=>{const _0xcc9b41=_0x44daba,_0x2b3f2f=_0xcc9b41(0xb6)+_0xf0afaa['code'],_0x247496=snakeToCamel(_0x2b3f2f);return{'id':_0xf0afaa['id'],'name':_0xf0afaa['name'],'code':_0xf0afaa[_0xcc9b41(0xbc)],'tableName':_0x2b3f2f,'apiFucName':_0x247496?_0x247496+_0xcc9b41(0xbb):_0xcc9b41(0xb0)+_0xf0afaa[_0xcc9b41(0xbc)]+_0xcc9b41(0xbb),'pkField':undefined,'allFields':[]};});return[..._0x458adc,..._0x3ff692];}function snakeToCamel(_0x519eac){const _0x4188fa=a4_0x2c70;if(!_0x519eac)return _0x519eac;const _0x2d3058=_0x519eac[_0x4188fa(0xa3)]();return _0x2d3058[_0x4188fa(0xab)](/_([a-zA-Z0-9])/g,(_0x718e5b,_0x14d2e7)=>_0x14d2e7[_0x4188fa(0xaf)]());}function a4_0x1cba(){const _0xa3b745=['name','split','allFields','9ynXBbI','dataset_','780135jDfAMm','map','set','2110570sbsxmx','Api','code','from','values','pkField','trim','147dwkvqJ','270658YxmIib','dbtableConfig','1374752XCAGZQ','184248PNTogF','583168xhakwA','filter','replace','15SozSRS','128220dafvSE','forEach','toUpperCase','dataset','tableName'];a4_0x1cba=function(){return _0xa3b745;};return a4_0x1cba();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x334e19,_0xc7b60b){const _0x19fc6d=a5_0x23cd,_0x3d26fc=_0x334e19();while(!![]){try{const _0x4f6f51=parseInt(_0x19fc6d(0x19e))/0x1+parseInt(_0x19fc6d(0x18a))/0x2+-parseInt(_0x19fc6d(0x188))/0x3+-parseInt(_0x19fc6d(0x191))/0x4+parseInt(_0x19fc6d(0x1a4))/0x5+parseInt(_0x19fc6d(0x1a0))/0x6+-parseInt(_0x19fc6d(0x198))/0x7;if(_0x4f6f51===_0xc7b60b)break;else _0x3d26fc['push'](_0x3d26fc['shift']());}catch(_0x19e6b9){_0x3d26fc['push'](_0x3d26fc['shift']());}}}(a5_0xbc8d,0xaff25));function a5_0xbc8d(){const _0x551f15=['\x20\x20\x20•\x20','.ts','CONFIG_NAMES.DEFAULT','toUpperCase','api','length','1461195rsVAnt','-client','536924hGWopi','url','log','\x20-\x20客户端实例文件','*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/api/','replaceApiContent','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','2092896xaHGiF','app','code','replace','API\x20文件生成成功!','keys','client','3113488FgRBmO','utf8','apiFucName','api.ts.tpl','typescript','forEach','679151PZGQRf','\x20个模型)','1984752qovyLI','dirname','-api','format','4486725ujokpW','charAt','resolve'];a5_0xbc8d=function(){return _0x551f15;};return a5_0xbc8d();}import a5_0x53668d from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0xa99ba from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a5_0x23cd(_0xbe0ed8,_0x4b2a93){const _0xbc8dbf=a5_0xbc8d();return a5_0x23cd=function(_0x23cd84,_0x6e861a){_0x23cd84=_0x23cd84-0x180;let _0x267443=_0xbc8dbf[_0x23cd84];return _0x267443;},a5_0x23cd(_0xbe0ed8,_0x4b2a93);}import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x473c75,_0x2356e9='',_0x3dab1f,_0x1c11e2=![]){const _0x7a8c14=a5_0x23cd,_0x3a9fdb=readConfig(),_0x42d736=_0x3dab1f||_0x3a9fdb?.[_0x7a8c14(0x192)];if(typeof _0x42d736!=='string'||!_0x42d736)throw new Error(_0x7a8c14(0x190));const _0x4b2dba=_0x1c11e2?_0x7a8c14(0x184):'\x22'+_0x42d736+'\x22',_0x2eb64c=_0x1c11e2?'':'\x22'+_0x42d736+'\x22',_0x25238c=_0x2356e9?_0x2356e9+_0x7a8c14(0x1a2):_0x7a8c14(0x186),_0x408a6e=_0x2356e9?_0x2356e9+_0x7a8c14(0x189):_0x7a8c14(0x197),_0x15fcaa=formatDataset(_0x473c75),_0x2d63a9={};_0x15fcaa[_0x7a8c14(0x19d)](_0x63184=>{const _0x1c81c3=_0x7a8c14,_0x1d6486=_0x63184[_0x1c81c3(0x19a)][_0x1c81c3(0x194)](/Api$/,''),_0x3eba83=_0x1d6486[_0x1c81c3(0x180)](0x0)[_0x1c81c3(0x185)]()+_0x1d6486['slice'](0x1);_0x2d63a9[_0x3eba83]={'tableName':_0x63184['tableName'],'datasetCode':_0x63184[_0x1c81c3(0x193)]};});const _0x242ede=fileURLToPath(import.meta[_0x7a8c14(0x18b)]),_0x108143=a5_0xa99ba[_0x7a8c14(0x181)](a5_0xa99ba[_0x7a8c14(0x1a1)](_0x242ede),'../..'),_0x3a1d0b=a5_0xa99ba['join'](_0x108143,'templates/generate-api'),_0x1c1221=a5_0xa99ba['join'](_0x3a1d0b,_0x7a8c14(0x19b)),_0x1368f4=a5_0xa99ba['join'](_0x3a1d0b,'client.ts.tpl');mkdirSync('src/api',{'recursive':!![]});const _0x429266=readFileSync(_0x1c1221,_0x7a8c14(0x199)),_0xc5498c=TemplateReplacer['replaceApiContent'](_0x429266,_0x42d736,_0x2d63a9,Object[_0x7a8c14(0x196)](_0x2d63a9)[0x0],_0x25238c,_0x4b2dba),_0xd2c85d=await a5_0x53668d[_0x7a8c14(0x1a3)](_0xc5498c,{'parser':'typescript'}),_0x40eb51='src/api/'+_0x25238c+_0x7a8c14(0x183);writeFileSync(_0x40eb51,_0xd2c85d,{'encoding':_0x7a8c14(0x199)});const _0x1c1274=readFileSync(_0x1368f4,_0x7a8c14(0x199)),_0x3f945a=TemplateReplacer[_0x7a8c14(0x18f)](_0x1c1274,_0x42d736,_0x2d63a9,Object[_0x7a8c14(0x196)](_0x2d63a9)[0x0],_0x25238c,_0x4b2dba,_0x2eb64c),_0x129b1a=await a5_0x53668d[_0x7a8c14(0x1a3)](_0x3f945a,{'parser':_0x7a8c14(0x19c)}),_0x46332f='src/api/'+_0x408a6e+_0x7a8c14(0x183);writeFileSync(_0x46332f,_0x129b1a,{'encoding':'utf8'}),logger['success']('init-api',_0x7a8c14(0x195)),console[_0x7a8c14(0x18c)]('*\x20已生成文件:'),console[_0x7a8c14(0x18c)]('\x20\x20\x20•\x20'+_0x40eb51+'\x20-\x20模型配置文件\x20('+Object[_0x7a8c14(0x196)](_0x2d63a9)[_0x7a8c14(0x187)]+_0x7a8c14(0x19f)),console['log'](_0x7a8c14(0x182)+_0x46332f+_0x7a8c14(0x18d)),console[_0x7a8c14(0x18c)]('*\x20API配置\x20apiConfigName\x20:\x20'+_0x4b2dba),console[_0x7a8c14(0x18c)](_0x7a8c14(0x18e)+_0x408a6e+'\x27');}
|
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x34955b,_0x207840){const _0x491641=a6_0x4e55,_0x4f05c6=_0x34955b();while(!![]){try{const _0x5d123d=-parseInt(_0x491641(0x13c))/0x1*(-parseInt(_0x491641(0x13f))/0x2)+-parseInt(_0x491641(0x137))/0x3+parseInt(_0x491641(0x139))/0x4*(-parseInt(_0x491641(0x13e))/0x5)+-parseInt(_0x491641(0x13b))/0x6*(-parseInt(_0x491641(0x13d))/0x7)+-parseInt(_0x491641(0x144))/0x8+-parseInt(_0x491641(0x141))/0x9*(-parseInt(_0x491641(0x138))/0xa)+-parseInt(_0x491641(0x13a))/0xb*(-parseInt(_0x491641(0x142))/0xc);if(_0x5d123d===_0x207840)break;else _0x4f05c6['push'](_0x4f05c6['shift']());}catch(_0x1fa66c){_0x4f05c6['push'](_0x4f05c6['shift']());}}}(a6_0x588c,0x72521));import{jsx as a6_0x46e43d}from'react/jsx-runtime';function a6_0x588c(){const _0x4dfb7a=['407259BGBMUN','120BFJkrV','exit','5505672SemVfa','\x20\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','Available\x20commands:','pull','\x20\x20\x20\x20app-code:\x20可选的应用AppCode,不指定则使用配置的默认值','log','input','2104485eGjhDV','190GDKIsJ','1312WtWZnL','1508804wFPuCY','138702EkTsmm','2AkhzSX','42PeJOQp','11695LJDGRP','255042xhOiEx','Unknown\x20api\x20command:\x20'];a6_0x588c=function(){return _0x4dfb7a;};return a6_0x588c();}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a6_0x4e55(_0x54518e,_0x3c4c09){const _0x588c6f=a6_0x588c();return a6_0x4e55=function(_0x4e5522,_0x54ca7c){_0x4e5522=_0x4e5522-0x134;let _0x37d481=_0x588c6f[_0x4e5522];return _0x37d481;},a6_0x4e55(_0x54518e,_0x3c4c09);}export async function apiCli(_0x5d0c57){const _0x5f1722=a6_0x4e55,_0x472d2d=_0x5d0c57[_0x5f1722(0x136)][0x1];if(_0x472d2d===_0x5f1722(0x147)){const _0xe076cb=_0x5d0c57[_0x5f1722(0x136)][0x2];render(a6_0x46e43d(ApiPullUI,{'appCode':_0xe076cb}));}else console['error'](_0x5f1722(0x140)+_0x472d2d),console[_0x5f1722(0x135)](_0x5f1722(0x146)),console[_0x5f1722(0x135)](_0x5f1722(0x145)),console['log'](_0x5f1722(0x134)),process[_0x5f1722(0x143)](0x1);}
|
package/lib/api/pull-silent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x361e6a,_0x35657f){const _0xe0b7b1=a7_0xaf2f,_0x4f775c=_0x361e6a();while(!![]){try{const _0x22d585=parseInt(_0xe0b7b1(0x1f0))/0x1+parseInt(_0xe0b7b1(0x1ed))/0x2+-parseInt(_0xe0b7b1(0x1e8))/0x3*(-parseInt(_0xe0b7b1(0x1c9))/0x4)+-parseInt(_0xe0b7b1(0x1f6))/0x5*(-parseInt(_0xe0b7b1(0x1ee))/0x6)+-parseInt(_0xe0b7b1(0x1cf))/0x7+parseInt(_0xe0b7b1(0x1ef))/0x8+-parseInt(_0xe0b7b1(0x1d7))/0x9*(parseInt(_0xe0b7b1(0x1d6))/0xa);if(_0x22d585===_0x35657f)break;else _0x4f775c['push'](_0x4f775c['shift']());}catch(_0x20776d){_0x4f775c['push'](_0x4f775c['shift']());}}}(a7_0x12a9,0x67d27));function a7_0x12a9(){const _0x2124b3=['356409eEPMqZ',',且无法读取错误响应内容','create-api-pull','client','×\x20API\x20配置拉取异常:','824900ODpVBm','246324SEdWSr','2528520fqsSpZ','548015vUMWrr','*\x20正在处理\x20','text','API\x20配置拉取成功:\x20','message','API\x20配置拉取异常:\x20','60DaEgGL','-client','status','data','16EjadnE','×\x20错误详情:','API\x20配置拉取失败:\x20','×\x20服务器返回错误:','chdir','length','3550659QyPNCI','\x20\x20\x20•\x20','获取数据集失败,原因:登录鉴权失败,登录已过期','×\x20无法读取错误响应内容','获取数据集失败,HTTP状态码:\x20','*\x20正在从服务器拉取\x20API\x20配置...','*\x20开始生成\x20API\x20配置文件:','79030vBZtft','1494uBMzPm','info','error','url','√\x20API\x20配置文件生成完成','api','/smartapi/dataset/getList?appCode=','log','.ts\x20-\x20模型配置文件','tableData','.ts\x20-\x20客户端实例文件','未知错误','json','success','test','\x20个数据集...','&pageSize=999¤tPage=1'];a7_0x12a9=function(){return _0x2124b3;};return a7_0x12a9();}function a7_0xaf2f(_0x463050,_0x3d2b5f){const _0x12a9e5=a7_0x12a9();return a7_0xaf2f=function(_0xaf2fb7,_0x3e4079){_0xaf2fb7=_0xaf2fb7-0x1c7;let _0x4ffb64=_0x12a9e5[_0xaf2fb7];return _0x4ffb64;},a7_0xaf2f(_0x463050,_0x3d2b5f);}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export async function pullApiSilent(_0xb8da32,_0x113086,_0x24c04f){const _0x482053=a7_0xaf2f;let _0x5b2e7c;try{const _0x3949c5=_0x113086?.['trim']()||'';if(_0x3949c5){const _0x512bed=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x512bed[_0x482053(0x1e5)](_0x3949c5))return console[_0x482053(0x1d9)]('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),![];}_0x24c04f&&(_0x5b2e7c=process['cwd'](),process[_0x482053(0x1cd)](_0x24c04f));console['log'](_0x482053(0x1d4));const _0x32caea=await fetch(getApiDomain()+_0x482053(0x1dd)+_0xb8da32+_0x482053(0x1e7),{'headers':{'Cookie':getCookie()}});if(_0x32caea['ok']){const _0x2aea5c=await _0x32caea[_0x482053(0x1e3)]();if(_0x2aea5c[_0x482053(0x1e4)]){const _0x28d56f=_0x3949c5?_0x3949c5+'-api':_0x482053(0x1dc),_0x3363c2=_0x3949c5?_0x3949c5+_0x482053(0x1f7):_0x482053(0x1eb);return console['log'](_0x482053(0x1d5)),console['log']('\x20\x20\x20•\x20'+_0x28d56f+_0x482053(0x1df)),console[_0x482053(0x1de)](_0x482053(0x1d0)+_0x3363c2+_0x482053(0x1e1)),console[_0x482053(0x1de)](_0x482053(0x1f1)+_0x2aea5c[_0x482053(0x1c8)][_0x482053(0x1e0)][_0x482053(0x1ce)]+_0x482053(0x1e6)),await generateApiFile(_0x2aea5c[_0x482053(0x1c8)][_0x482053(0x1e0)],_0x3949c5,_0xb8da32,!![]),console[_0x482053(0x1de)](_0x482053(0x1db)),_0x24c04f&&logger[_0x482053(0x1d8)](_0x482053(0x1ea),_0x482053(0x1f3)+_0xb8da32,{'projectPath':_0x24c04f,'appCode':_0xb8da32,'datasetCount':_0x2aea5c[_0x482053(0x1c8)][_0x482053(0x1e0)][_0x482053(0x1ce)],'filePrefix':_0x3949c5}),!![];}else return console['error'](_0x482053(0x1cc),_0x2aea5c[_0x482053(0x1f4)]||_0x482053(0x1e2)),_0x24c04f&&logger[_0x482053(0x1d9)](_0x482053(0x1ea),_0x482053(0x1cb)+(_0x2aea5c['message']||_0x482053(0x1e2)),{'projectPath':_0x24c04f,'appCode':_0xb8da32}),![];}else{if(_0x32caea[_0x482053(0x1c7)]===0x191){const _0xb03048=_0x482053(0x1d1);console[_0x482053(0x1d9)]('×\x20'+_0xb03048),_0x24c04f&&logger[_0x482053(0x1d9)](_0x482053(0x1ea),_0xb03048,{'status':_0x32caea[_0x482053(0x1c7)],'appCode':_0xb8da32,'url':_0x32caea[_0x482053(0x1da)],'projectPath':_0x24c04f});}else{const _0x50268d=_0x482053(0x1d3)+_0x32caea[_0x482053(0x1c7)];console['error']('×\x20'+_0x50268d);try{const _0x2ace2d=await _0x32caea[_0x482053(0x1f2)]();_0x2ace2d&&console[_0x482053(0x1d9)](_0x482053(0x1ca),_0x2ace2d),_0x24c04f&&logger[_0x482053(0x1d9)]('create-api-pull',_0x50268d,{'status':_0x32caea['status'],'appCode':_0xb8da32,'url':_0x32caea[_0x482053(0x1da)],'errorBody':_0x2ace2d,'projectPath':_0x24c04f});}catch(_0x45dae4){console[_0x482053(0x1d9)](_0x482053(0x1d2)),_0x24c04f&&logger[_0x482053(0x1d9)](_0x482053(0x1ea),_0x50268d+_0x482053(0x1e9),{'status':_0x32caea[_0x482053(0x1c7)],'appCode':_0xb8da32,'url':_0x32caea[_0x482053(0x1da)],'readError':_0x45dae4 instanceof Error?_0x45dae4[_0x482053(0x1f4)]:String(_0x45dae4),'projectPath':_0x24c04f});}}return![];}}catch(_0xf3528b){const _0x6677fc=_0xf3528b instanceof Error?_0xf3528b[_0x482053(0x1f4)]:String(_0xf3528b);return console[_0x482053(0x1d9)](_0x482053(0x1ec),_0x6677fc),_0x24c04f&&logger[_0x482053(0x1d9)]('create-api-pull',_0x482053(0x1f5)+_0x6677fc,{'appCode':_0xb8da32,'projectPath':_0x24c04f}),![];}finally{_0x5b2e7c&&process[_0x482053(0x1cd)](_0x5b2e7c);}}
|
package/lib/api/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a8_0x1d9c(){const _0x5baa23=['*\x20正在处理\x20','url','client','\x20\x20\x20•\x20','log','×\x20错误详情:','451vbfBPZ','\x0a*\x20正在从服务器拉取\x20API\x20配置...','exit','!\x20请使用以下方式之一:','message','14NaiMch','-client','465xciljj','588198QHsUeY','257588GrpQgQ','×\x20未提供应用AppCode,且配置中也没有默认值','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','\x1b[0m','.ts\x20-\x20模型配置文件','4902120SOnxqC','4013528PkXTqf','status','tableData','528610XvPbNH','!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20','data','api','&pageSize=999¤tPage=1','\x1b[90m*\x20使用配置的应用AppCode:\x20','-api','api-pull','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','40636WTiPxI','7932318ZjydMU','6KKEzbU','success','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','\x20个数据集...','test','error','trim','/smartapi/dataset/getList?appCode=','stdout','.ts\x20-\x20客户端实例文件','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','string','json'];a8_0x1d9c=function(){return _0x5baa23;};return a8_0x1d9c();}function a8_0x1734(_0x33b56e,_0xc4f7c5){const _0x1d9ca9=a8_0x1d9c();return a8_0x1734=function(_0x17343c,_0x17f664){_0x17343c=_0x17343c-0xe2;let _0x590c35=_0x1d9ca9[_0x17343c];return _0x590c35;},a8_0x1734(_0x33b56e,_0xc4f7c5);}(function(_0x55b5f8,_0x3edc81){const _0x5cc95e=a8_0x1734,_0x594569=_0x55b5f8();while(!![]){try{const _0x1fd43e=-parseInt(_0x5cc95e(0x107))/0x1+-parseInt(_0x5cc95e(0xeb))/0x2*(-parseInt(_0x5cc95e(0x106))/0x3)+-parseInt(_0x5cc95e(0xe9))/0x4*(parseInt(_0x5cc95e(0x105))/0x5)+-parseInt(_0x5cc95e(0xea))/0x6+parseInt(_0x5cc95e(0x103))/0x7*(parseInt(_0x5cc95e(0x10d))/0x8)+-parseInt(_0x5cc95e(0x10c))/0x9+parseInt(_0x5cc95e(0x110))/0xa*(parseInt(_0x5cc95e(0xfe))/0xb);if(_0x1fd43e===_0x3edc81)break;else _0x594569['push'](_0x594569['shift']());}catch(_0x3ef8b3){_0x594569['push'](_0x594569['shift']());}}}(a8_0x1d9c,0xa866d));import{createInterface}from'node:readline/promises';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export async function initApi(_0x5ab524){const _0x44ca67=a8_0x1734,_0x4c0cae=readConfig(),_0xca173f=_0x5ab524||_0x4c0cae?.['app'];(typeof _0xca173f!==_0x44ca67(0xf6)||!_0xca173f)&&(_0x5ab524?console[_0x44ca67(0xf0)]('×\x20提供的应用AppCode\x20\x22'+_0x5ab524+'\x22\x20无效'):(console[_0x44ca67(0xf0)](_0x44ca67(0x108)),console[_0x44ca67(0xfc)](_0x44ca67(0x101)),console[_0x44ca67(0xfc)](_0x44ca67(0x109)),console[_0x44ca67(0xfc)](_0x44ca67(0xf5))),process[_0x44ca67(0x100)](0x1));_0x5ab524?console[_0x44ca67(0xfc)]('*\x20使用指定的应用AppCode:\x20'+_0xca173f):console[_0x44ca67(0xfc)](_0x44ca67(0xe5)+_0xca173f+_0x44ca67(0x10a));const _0x395ca2=createInterface({'input':process['stdin'],'output':process[_0x44ca67(0xf3)]});let _0x484109;try{const _0x39583b=await _0x395ca2['question'](_0x44ca67(0x111));_0x484109=_0x39583b[_0x44ca67(0xf1)]();if(_0x484109){const _0x9246eb=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x9246eb[_0x44ca67(0xef)](_0x484109)&&(console[_0x44ca67(0xf0)](_0x44ca67(0xed)),process['exit'](0x1));}}finally{_0x395ca2['close']();}console[_0x44ca67(0xfc)](_0x44ca67(0xff));const _0x528eac=await fetch(getApiDomain()+_0x44ca67(0xf2)+_0xca173f+_0x44ca67(0xe4),{'headers':{'Cookie':getCookie()}});if(_0x528eac['ok']){const _0x4bbf62=await _0x528eac[_0x44ca67(0xf7)]();if(_0x4bbf62[_0x44ca67(0xec)]){const _0x2ffa5d=_0x484109?_0x484109+_0x44ca67(0xe6):_0x44ca67(0xe3),_0xd7ef05=_0x484109?_0x484109+_0x44ca67(0x104):_0x44ca67(0xfa);console[_0x44ca67(0xfc)]('*\x20开始生成\x20API\x20配置文件:'),console[_0x44ca67(0xfc)](_0x44ca67(0xfb)+_0x2ffa5d+_0x44ca67(0x10b)),console[_0x44ca67(0xfc)](_0x44ca67(0xfb)+_0xd7ef05+_0x44ca67(0xf4)),console[_0x44ca67(0xfc)](_0x44ca67(0xf8)+_0x4bbf62['data'][_0x44ca67(0x10f)]['length']+_0x44ca67(0xee));const _0x5c2998=!_0x5ab524;await generateApiFile(_0x4bbf62[_0x44ca67(0xe2)]['tableData'],_0x484109,_0xca173f,_0x5c2998);}}else{if(_0x528eac[_0x44ca67(0x10e)]===0x191){const _0x5dfe42=_0x44ca67(0xe8);console[_0x44ca67(0xf0)]('×\x20'+_0x5dfe42),logger['error'](_0x44ca67(0xe7),_0x5dfe42,{'status':_0x528eac[_0x44ca67(0x10e)],'appCode':_0xca173f,'url':_0x528eac[_0x44ca67(0xf9)]});}else{const _0x263d71='获取数据集失败,HTTP状态码:\x20'+_0x528eac[_0x44ca67(0x10e)];console[_0x44ca67(0xf0)]('×\x20'+_0x263d71);try{const _0x4e9839=await _0x528eac['text']();_0x4e9839?(console[_0x44ca67(0xf0)](_0x44ca67(0xfd),_0x4e9839),logger[_0x44ca67(0xf0)](_0x44ca67(0xe7),_0x263d71,{'status':_0x528eac['status'],'appCode':_0xca173f,'url':_0x528eac['url'],'errorBody':_0x4e9839})):logger[_0x44ca67(0xf0)](_0x44ca67(0xe7),_0x263d71,{'status':_0x528eac[_0x44ca67(0x10e)],'appCode':_0xca173f,'url':_0x528eac['url']});}catch(_0x3586ab){console[_0x44ca67(0xf0)]('×\x20无法读取错误响应内容'),logger['error'](_0x44ca67(0xe7),_0x263d71+',且无法读取错误响应内容',{'status':_0x528eac[_0x44ca67(0x10e)],'appCode':_0xca173f,'url':_0x528eac[_0x44ca67(0xf9)],'readError':_0x3586ab instanceof Error?_0x3586ab[_0x44ca67(0x102)]:String(_0x3586ab)});}}process['exit'](0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x551e00,_0x270895){const _0x598131=a10_0x1b82,_0x45ca42=_0x551e00();while(!![]){try{const _0x4e80ce=parseInt(_0x598131(0x1c1))/0x1+parseInt(_0x598131(0x1b6))/0x2*(parseInt(_0x598131(0x1ae))/0x3)+parseInt(_0x598131(0x1b5))/0x4*(-parseInt(_0x598131(0x1b7))/0x5)+parseInt(_0x598131(0x1bb))/0x6+-parseInt(_0x598131(0x1af))/0x7+-parseInt(_0x598131(0x1b4))/0x8*(-parseInt(_0x598131(0x1bc))/0x9)+-parseInt(_0x598131(0x1b9))/0xa;if(_0x4e80ce===_0x270895)break;else _0x45ca42['push'](_0x45ca42['shift']());}catch(_0x32317f){_0x45ca42['push'](_0x45ca42['shift']());}}}(a10_0x3ce3,0x5a1b3));import{jsx as a10_0x35d531,jsxs as a10_0x44121f}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';function a10_0x1b82(_0x2a2c2a,_0x2b8c58){const _0x3ce3cc=a10_0x3ce3();return a10_0x1b82=function(_0x1b8275,_0x37fc75){_0x1b8275=_0x1b8275-0x1ae;let _0x4c9939=_0x3ce3cc[_0x1b8275];return _0x4c9939;},a10_0x1b82(_0x2a2c2a,_0x2b8c58);}import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a10_0x2d868b from'ink-spinner';export function AuthServer(){const _0x1f814e=a10_0x1b82,{exit:_0x526aa2}=useApp(),[_0x1d32f5,_0x35bff1]=useState(![]),[_0x56c81c,_0x2f3942]=useState(!![]),[_0x21f4d8,_0x31108d]=useState(![]),[_0x36feb1,_0x13e1ee]=useState(![]);useEffect(()=>{getIsSessionValid()['then'](_0x35bff1)['finally'](()=>_0x2f3942(![]));},[]),useEffect(()=>{const _0x47b960=a10_0x1b82;!_0x56c81c&&_0x1d32f5&&(console[_0x47b960(0x1b3)](_0x47b960(0x1b1)),_0x526aa2());},[_0x56c81c,_0x1d32f5,_0x526aa2]),useEffect(()=>{const _0x218e13=a10_0x1b82;_0x36feb1&&(console[_0x218e13(0x1b3)](_0x218e13(0x1ba)),_0x526aa2());},[_0x36feb1,_0x526aa2]),useInput((_0x445bb1,_0x625750)=>{const _0xc31d15=a10_0x1b82;_0x625750[_0xc31d15(0x1be)]&&(_0x31108d(!![]),authServer({'silent':!![]})['then'](_0x3a22ab=>{_0x13e1ee(_0x3a22ab);})),_0x445bb1==='q'&&_0x526aa2();});if(_0x56c81c)return null;if(_0x1d32f5||_0x36feb1)return null;return a10_0x35d531(Box,{'flexDirection':_0x1f814e(0x1c0),'marginTop':0x1,'marginBottom':0x1,'children':_0x21f4d8?a10_0x44121f(Box,{'children':[a10_0x35d531(Box,{'width':'1'}),a10_0x44121f(Text,{'color':_0x1f814e(0x1bf),'children':[a10_0x35d531(a10_0x2d868b,{'type':_0x1f814e(0x1b8)}),'\x20\x20']}),a10_0x35d531(Text,{'children':'正在登录...\x20'}),a10_0x35d531(Text,{'color':_0x1f814e(0x1b0),'children':'请前往浏览器完成登录。'})]}):a10_0x44121f(Box,{'children':[a10_0x35d531(Box,{'width':'1'}),a10_0x35d531(Text,{'children':_0x1f814e(0x1b2)}),a10_0x35d531(Text,{'color':'gray','children':_0x1f814e(0x1bd)})]})});}function a10_0x3ce3(){const _0x3b6efb=['322767KpbQYq','按\x20“q”\x20退出。','return','green','column','322640Pzrvxn','545469TZDYMn','4180148ROxyFw','gray','√\x20当前为有效会话,无需重新登录。','*\x20按回车开始登录。','log','136tKyqgk','4gKMDhS','2RMElYA','876820cNcyuc','dots','3379280iYluKR','*\x20登录成功!','2192382kAbVLR'];a10_0x3ce3=function(){return _0x3b6efb;};return a10_0x3ce3();}
|
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a11_0x15515e=a11_0x914f;(function(_0xe3893b,_0x227bc3){const _0x1636d4=a11_0x914f,_0x51c46c=_0xe3893b();while(!![]){try{const _0x19741a=-parseInt(_0x1636d4(0xf5))/0x1+-parseInt(_0x1636d4(0xe5))/0x2*(-parseInt(_0x1636d4(0xd3))/0x3)+parseInt(_0x1636d4(0xf9))/0x4*(-parseInt(_0x1636d4(0xe6))/0x5)+parseInt(_0x1636d4(0xdd))/0x6+-parseInt(_0x1636d4(0xda))/0x7*(-parseInt(_0x1636d4(0xe1))/0x8)+-parseInt(_0x1636d4(0xf4))/0x9*(-parseInt(_0x1636d4(0xfa))/0xa)+-parseInt(_0x1636d4(0xd7))/0xb*(parseInt(_0x1636d4(0xf8))/0xc);if(_0x19741a===_0x227bc3)break;else _0x51c46c['push'](_0x51c46c['shift']());}catch(_0x3a6384){_0x51c46c['push'](_0x51c46c['shift']());}}}(a11_0x1817,0x3ec4c));import{writeFileSync}from'node:fs';import a11_0x559270 from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';function a11_0x914f(_0x63f3d3,_0x3e007e){const _0x1817d3=a11_0x1817();return a11_0x914f=function(_0x914fcf,_0x246b21){_0x914fcf=_0x914fcf-0xd2;let _0x2bec7a=_0x1817d3[_0x914fcf];return _0x2bec7a;},a11_0x914f(_0x63f3d3,_0x3e007e);}export async function authServer(_0x1b2b28){const _0xb71233=a11_0x914f,_0x54e435=_0x1b2b28?.[_0xb71233(0xde)]||![];if(await getIsSessionValid())return!![];const _0x22224e=await(await fetch(_0xb71233(0xf1)))[_0xb71233(0xfb)]();return new Promise(async(_0x4efae0,_0x55198d)=>{const _0x5af985=_0xb71233;let _0x50cb1b=0x0;const _0x179212=a11_0x559270['createServer'](_0x22224e,async(_0x29d0b5,_0x20f83b)=>{const _0xfe81af=a11_0x914f,_0x575d69=getUserDomain(),_0x521bd1=_0x29d0b5[_0xfe81af(0xd5)][_0xfe81af(0xd6)]||'',_0x150023=await fetch(_0x575d69+'/api/auth/get-session',{'headers':{'cookie':_0x521bd1}})['then'](_0x484911=>_0x484911[_0xfe81af(0xfb)]()),_0x4d90a9=_0x150023&&_0x150023[_0xfe81af(0xee)]&&_0x150023['user'];if(_0x4d90a9){writeFileSync(cookieFile,_0x521bd1,_0xfe81af(0xd8)),_0x4efae0(!![]);const _0x38a57a=_0xfe81af(0xe0);_0x20f83b['writeHead'](0xc8,{'Content-Type':_0xfe81af(0xed)}),_0x20f83b['end'](_0x38a57a),_0x179212[_0xfe81af(0xdb)]();}else{const _0x124680=''+encodeURIComponent(_0xfe81af(0xea)+_0x50cb1b);_0x20f83b['writeHead'](0x12e,{'location':_0x575d69+'/sign-in?redirect='+_0x124680}),_0x20f83b['end']();return;}});_0x179212[_0x5af985(0xe3)](0x0,_0x5af985(0xe8),()=>{const _0x2d9a13=_0x5af985,_0x535859=_0x179212[_0x2d9a13(0xe9)]();_0x50cb1b=typeof _0x535859===_0x2d9a13(0xef)&&_0x535859?_0x535859[_0x2d9a13(0xeb)]:Number(_0x535859);const _0x2734c7='https://dev.lovrabet.com:'+_0x50cb1b;!_0x54e435&&(console[_0x2d9a13(0xe7)](_0x2d9a13(0xdc)),console[_0x2d9a13(0xe7)](_0x2d9a13(0xec),_0x2734c7),console['log'](_0x2d9a13(0xfe)),console['log'](''),console[_0x2d9a13(0xe7)](_0x2d9a13(0xd2)),console[_0x2d9a13(0xe7)]('')),openInBrowser(_0x2734c7)[_0x2d9a13(0xe2)](_0xc3c2af=>{const _0x475286=_0x2d9a13;!_0x54e435&&(_0xc3c2af?console[_0x475286(0xe7)]('✅\x20浏览器已自动打开,请在浏览器中完成登录'):(console[_0x475286(0xe7)]('⚠️\x20\x20无法自动打开浏览器'),console[_0x475286(0xe7)](_0x475286(0xd9),_0x2734c7)),console['log'](''));})[_0x2d9a13(0xf2)](()=>{const _0x384a79=_0x2d9a13;!_0x54e435&&(console['log'](_0x384a79(0xff)),console[_0x384a79(0xe7)](_0x384a79(0xd9),_0x2734c7),console[_0x384a79(0xe7)](''));});}),_0x179212['on'](_0x5af985(0xfc),_0x339aae=>{const _0x316725=_0x5af985;!_0x54e435&&console[_0x316725(0xfc)](_0x316725(0xf0),_0x339aae),_0x55198d(_0x339aae);});});}function openInBrowser(_0x317e41){return new Promise(_0x180b4c=>{const _0x56078e=a11_0x914f,_0x520af4=process[_0x56078e(0xf6)];let _0x14e949;if(_0x520af4===_0x56078e(0xdf))_0x14e949='start\x20\x22\x22\x20\x22'+_0x317e41+'\x22';else _0x520af4===_0x56078e(0xf3)?_0x14e949=_0x56078e(0xfd)+_0x317e41+'\x22':_0x14e949=_0x56078e(0xe4)+_0x317e41+'\x22';exec(_0x14e949,_0x3123c5=>{_0x3123c5?_0x180b4c(![]):_0x180b4c(!![]);});});}if(import.meta[a11_0x15515e(0xd4)]){const isAuth=await authServer();console[a11_0x15515e(0xe7)](a11_0x15515e(0xf7),isAuth);}function a11_0x1817(){const _0x4e5710=['platform','isAuth','24wEwddf','14744JvrRKf','50jcbpGj','json','error','open\x20\x22','🌐\x20正在尝试自动打开浏览器...','⚠️\x20\x20无法自动打开浏览器','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','801NcVKzi','main','headers','cookie','17369lUUbgV','utf-8','🔗\x20请手动复制登录地址到浏览器:','574ugQMdB','close','🔐\x20正在启动登录服务...','1737006pXLyVB','silent','win32','<!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>','7232EleqRd','then','listen','xdg-open\x20\x22','3360wJudXG','460CgfVhS','log','127.0.0.1','address','https://dev.lovrabet.com:','port','📍\x20登录地址:','text/html;\x20charset=utf-8','session','object','Auth\x20server\x20error:','https://g.yuntooai.com/cert/lovrabet-dev.json','catch','darwin','370611zpHaEr','418714KvORhk'];a11_0x1817=function(){return _0x4e5710;};return a11_0x1817();}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a12_0x2bf72b=a12_0x1834;function a12_0x4b26(){const _0xc17c19=['/cookie','10PWXRVb','7201989TCPLli','5943qMCIMT','/.lovrabet','1270632kdEROm','1149602fQCmqb','7056115wmhPby','462148nkZWJj','39uWFSlM','8144yAaIuA','1srMdas','9798330pXynlt'];a12_0x4b26=function(){return _0xc17c19;};return a12_0x4b26();}(function(_0x328e98,_0x48907c){const _0xbaae86=a12_0x1834,_0x1454c0=_0x328e98();while(!![]){try{const _0x35a107=-parseInt(_0xbaae86(0xc5))/0x1*(-parseInt(_0xbaae86(0xc0))/0x2)+-parseInt(_0xbaae86(0xc3))/0x3*(parseInt(_0xbaae86(0xc2))/0x4)+parseInt(_0xbaae86(0xc8))/0x5*(parseInt(_0xbaae86(0xbf))/0x6)+-parseInt(_0xbaae86(0xca))/0x7*(-parseInt(_0xbaae86(0xc4))/0x8)+parseInt(_0xbaae86(0xc9))/0x9+-parseInt(_0xbaae86(0xc6))/0xa+parseInt(_0xbaae86(0xc1))/0xb;if(_0x35a107===_0x48907c)break;else _0x1454c0['push'](_0x1454c0['shift']());}catch(_0x582d77){_0x1454c0['push'](_0x1454c0['shift']());}}}(a12_0x4b26,0xc8ce3));import{mkdirSync}from'node:fs';function a12_0x1834(_0x4e0bb3,_0x4458e2){const _0x4b2623=a12_0x4b26();return a12_0x1834=function(_0x18346e,_0x247bff){_0x18346e=_0x18346e-0xbe;let _0x133eed=_0x4b2623[_0x18346e];return _0x133eed;},a12_0x1834(_0x4e0bb3,_0x4458e2);}import{homedir}from'node:os';export const configDir=homedir()+a12_0x2bf72b(0xbe);export const cookieFile=configDir+a12_0x2bf72b(0xc7);mkdirSync(configDir,{'recursive':!![]});
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x220796,_0x33823c){var _0x5e96d0=a13_0x1642,_0x3ca42a=_0x220796();while(!![]){try{var _0x323984=-parseInt(_0x5e96d0(0x9e))/0x1+-parseInt(_0x5e96d0(0x9f))/0x2+parseInt(_0x5e96d0(0x9c))/0x3+parseInt(_0x5e96d0(0x9a))/0x4*(-parseInt(_0x5e96d0(0x9b))/0x5)+parseInt(_0x5e96d0(0xa0))/0x6+parseInt(_0x5e96d0(0x9d))/0x7*(parseInt(_0x5e96d0(0xa1))/0x8)+-parseInt(_0x5e96d0(0xa2))/0x9;if(_0x323984===_0x33823c)break;else _0x3ca42a['push'](_0x3ca42a['shift']());}catch(_0xc13bc1){_0x3ca42a['push'](_0x3ca42a['shift']());}}}(a13_0x2e33,0x4f7a0));import{readFileSync}from'node:fs';function a13_0x2e33(){var _0x2b2fe2=['623620MXKjbK','10YENCPB','1602732RFytRH','885787zMyWFM','55461eiRahx','767452nOSKXU','2740836FXCdIq','8hqOkLx','369522inkzTl','utf-8'];a13_0x2e33=function(){return _0x2b2fe2;};return a13_0x2e33();}import{cookieFile}from'./constant.js';function a13_0x1642(_0x126bac,_0x306c2b){var _0x2e3363=a13_0x2e33();return a13_0x1642=function(_0x1642ce,_0x1d99a2){_0x1642ce=_0x1642ce-0x9a;var _0x32233b=_0x2e3363[_0x1642ce];return _0x32233b;},a13_0x1642(_0x126bac,_0x306c2b);}export function getCookie(){var _0x2b03c1=a13_0x1642;try{return readFileSync(cookieFile,_0x2b03c1(0xa3));}catch{}return'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3c5d81,_0x47e03a){const _0x335ae4=a14_0x8166,_0x4d4ae4=_0x3c5d81();while(!![]){try{const _0x2102e0=parseInt(_0x335ae4(0xa0))/0x1+parseInt(_0x335ae4(0xa1))/0x2*(-parseInt(_0x335ae4(0xa9))/0x3)+-parseInt(_0x335ae4(0xab))/0x4*(-parseInt(_0x335ae4(0xa5))/0x5)+-parseInt(_0x335ae4(0xaa))/0x6+-parseInt(_0x335ae4(0xa3))/0x7*(parseInt(_0x335ae4(0xa7))/0x8)+-parseInt(_0x335ae4(0xa2))/0x9+-parseInt(_0x335ae4(0x9f))/0xa*(-parseInt(_0x335ae4(0xa6))/0xb);if(_0x2102e0===_0x47e03a)break;else _0x4d4ae4['push'](_0x4d4ae4['shift']());}catch(_0x3121d4){_0x4d4ae4['push'](_0x4d4ae4['shift']());}}}(a14_0x2d74,0x5102a));import{existsSync,readFileSync}from'node:fs';function a14_0x8166(_0x21abe6,_0x347b77){const _0x2d7444=a14_0x2d74();return a14_0x8166=function(_0x81663b,_0x3b39e4){_0x81663b=_0x81663b-0x9d;let _0x4db690=_0x2d7444[_0x81663b];return _0x4db690;},a14_0x8166(_0x21abe6,_0x347b77);}import{getUserDomain}from'../constant/domain.js';function a14_0x2d74(){const _0x2c119f=['225291MRiphD','18752mqArOJ','json','606PDRWKf','305112gdibxI','10372HTScwW','user','then','300UVVNYI','387659TcxsgJ','3902NTgfBz','1830726suRGJt','259yTHpkt','utf-8','125layfop'];a14_0x2d74=function(){return _0x2c119f;};return a14_0x2d74();}import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x178322=a14_0x8166;try{if(!existsSync(cookieFile))return![];const _0x37cdc0=readFileSync(cookieFile,_0x178322(0xa4)),_0x406a82=await fetch(getUserDomain()+'/api/auth/get-session',{'headers':{'cookie':_0x37cdc0}})[_0x178322(0x9e)](_0x53f09c=>_0x53f09c[_0x178322(0xa8)]());return _0x406a82&&_0x406a82['session']&&_0x406a82[_0x178322(0x9d)];}catch{}return![];}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a15_0x1e54(_0x13101b,_0x1c60c6){var _0x3552f4=a15_0x3552();return a15_0x1e54=function(_0x1e546c,_0x521df8){_0x1e546c=_0x1e546c-0x1b8;var _0x37a855=_0x3552f4[_0x1e546c];return _0x37a855;},a15_0x1e54(_0x13101b,_0x1c60c6);}function a15_0x3552(){var _0x4c7f2f=['12747EsEKSv','25970cKFivC','2aWxYXA','log','201axUTZa','11joKuhH','2968jilesn','44476dmwQrU','1205435PLJxQu','!\x20当前未登录','✓\x20已退出登录','112088YYJciG','4285896mAIHgQ','3052584VBylZO','2205gbjkhg'];a15_0x3552=function(){return _0x4c7f2f;};return a15_0x3552();}(function(_0x215f70,_0x38ca3e){var _0x11558c=a15_0x1e54,_0x2fc8c2=_0x215f70();while(!![]){try{var _0x15c956=-parseInt(_0x11558c(0x1bf))/0x1*(parseInt(_0x11558c(0x1c5))/0x2)+-parseInt(_0x11558c(0x1b8))/0x3*(-parseInt(_0x11558c(0x1bb))/0x4)+-parseInt(_0x11558c(0x1bc))/0x5+parseInt(_0x11558c(0x1c1))/0x6+-parseInt(_0x11558c(0x1c3))/0x7*(-parseInt(_0x11558c(0x1ba))/0x8)+parseInt(_0x11558c(0x1c2))/0x9*(-parseInt(_0x11558c(0x1c4))/0xa)+-parseInt(_0x11558c(0x1b9))/0xb*(parseInt(_0x11558c(0x1c0))/0xc);if(_0x15c956===_0x38ca3e)break;else _0x2fc8c2['push'](_0x2fc8c2['shift']());}catch(_0x516dc0){_0x2fc8c2['push'](_0x2fc8c2['shift']());}}}(a15_0x3552,0x8e44a));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';export function logout(){var _0x237212=a15_0x1e54;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x237212(0x1c6)](_0x237212(0x1be))):console['log'](_0x237212(0x1bd));}
|
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a16_0x1acf3e=a16_0x34e7;(function(_0x38e4b8,_0x4af456){const _0x5a61c1=a16_0x34e7,_0x491573=_0x38e4b8();while(!![]){try{const _0x129bfe=-parseInt(_0x5a61c1(0xfa))/0x1*(-parseInt(_0x5a61c1(0x103))/0x2)+parseInt(_0x5a61c1(0xf2))/0x3+parseInt(_0x5a61c1(0xe5))/0x4*(-parseInt(_0x5a61c1(0xf0))/0x5)+parseInt(_0x5a61c1(0xe8))/0x6+-parseInt(_0x5a61c1(0xe7))/0x7*(parseInt(_0x5a61c1(0xf5))/0x8)+parseInt(_0x5a61c1(0xf3))/0x9+-parseInt(_0x5a61c1(0xe9))/0xa;if(_0x129bfe===_0x4af456)break;else _0x491573['push'](_0x491573['shift']());}catch(_0x40d01c){_0x491573['push'](_0x491573['shift']());}}}(a16_0x1dc8,0x864ff));import{jsx as a16_0x26fc22}from'react/jsx-runtime';import a16_0x2eec01 from'meow';import{render}from'ink';import{CreateApp}from'./create-app/main.js';import{AddPage}from'./add-page/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';import{AuthServer}from'./auth/auth-server-ui.js';import{logout}from'./auth/logout.js';function a16_0x1dc8(){const _0x512e20=['add','5ttrFLd','start','2767923cSdHwr','9619209gsokcN','config','296Wumbam','clear','exit','cwd','input','79bNGUeQ','all','logout','string','auth','boolean','page','flags','setLogPath','4728zBWLGF','2352044RIDmuk','preview','3038QSceoa','282108hsXZEA','10710040ytpeRm','logs','api','trim','error','watch'];a16_0x1dc8=function(){return _0x512e20;};return a16_0x1dc8();}import{Help}from'./help.js';import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';const cli=a16_0x2eec01('\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登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\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添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\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构建项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\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监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20logs\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清空日志\x0a',{'importMeta':import.meta,'flags':{'name':{'type':a16_0x1acf3e(0xfd)},'clear':{'type':a16_0x1acf3e(0xff)}}});await run();function a16_0x34e7(_0x4ad71c,_0x4130db){const _0x1dc8c4=a16_0x1dc8();return a16_0x34e7=function(_0x34e710,_0x35ad3d){_0x34e710=_0x34e710-0xe5;let _0x4cf6ea=_0x1dc8c4[_0x34e710];return _0x4cf6ea;},a16_0x34e7(_0x4ad71c,_0x4130db);}async function run(){const _0xa096c3=a16_0x1acf3e,_0x55003e=cli[_0xa096c3(0xf9)][0x0];switch(_0x55003e){case'create':{const _0x3bb325=cli[_0xa096c3(0xf9)][0x1]?.[_0xa096c3(0xec)]();render(a16_0x26fc22(CreateApp,{'projectCode':_0x3bb325}));break;}case _0xa096c3(0xef):{cli['input'][0x1]===_0xa096c3(0x100)&&(logger[_0xa096c3(0x102)](process[_0xa096c3(0xf8)]()),render(a16_0x26fc22(AddPage,{})));break;}case _0xa096c3(0xf1):{try{logger[_0xa096c3(0x102)](process[_0xa096c3(0xf8)]()),await runStart();}catch(_0x84cb97){console[_0xa096c3(0xed)](_0x84cb97),process[_0xa096c3(0xf7)](0x1);}break;}case'build':{try{logger[_0xa096c3(0x102)](process[_0xa096c3(0xf8)]()),await runBuild();}catch(_0x568071){console[_0xa096c3(0xed)](_0x568071),process[_0xa096c3(0xf7)](0x1);}break;}case _0xa096c3(0xe6):{const _0x30a232=cli['flags'][_0xa096c3(0xee)];logger['setLogPath'](process[_0xa096c3(0xf8)]());if(_0x30a232)try{await Promise[_0xa096c3(0xfb)]([runBuildWatch(),runPreview()]);}catch(_0x2eb4ec){console[_0xa096c3(0xed)](_0x2eb4ec),process[_0xa096c3(0xf7)](0x1);}else try{await runPreview();}catch(_0x5242ac){console['error'](_0x5242ac),process[_0xa096c3(0xf7)](0x1);}break;}case _0xa096c3(0xf4):{render(a16_0x26fc22(Config,{'cli':cli}));break;}case _0xa096c3(0xeb):{await apiCli(cli);break;}case _0xa096c3(0xfe):{render(a16_0x26fc22(AuthServer,{}));break;}case _0xa096c3(0xfc):{logout();break;}case _0xa096c3(0xea):{cli[_0xa096c3(0x101)][_0xa096c3(0xf6)]?clearLogs():showLogs();break;}default:render(a16_0x26fc22(Help,{}));break;}}
|
package/lib/cmd/build-watch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x34ceb4,_0x15c2ba){const _0x1356d3=a17_0x1b87,_0x1fe821=_0x34ceb4();while(!![]){try{const _0x11ea74=parseInt(_0x1356d3(0x1e7))/0x1+parseInt(_0x1356d3(0x1e6))/0x2*(-parseInt(_0x1356d3(0x1f6))/0x3)+-parseInt(_0x1356d3(0x1ef))/0x4*(-parseInt(_0x1356d3(0x1e9))/0x5)+-parseInt(_0x1356d3(0x1f2))/0x6*(-parseInt(_0x1356d3(0x1ee))/0x7)+-parseInt(_0x1356d3(0x1f0))/0x8*(parseInt(_0x1356d3(0x1f4))/0x9)+-parseInt(_0x1356d3(0x1ed))/0xa+parseInt(_0x1356d3(0x1f3))/0xb;if(_0x11ea74===_0x15c2ba)break;else _0x1fe821['push'](_0x1fe821['shift']());}catch(_0x4c41dc){_0x1fe821['push'](_0x1fe821['shift']());}}}(a17_0x5e94,0xa1781));function a17_0x5e94(){const _0xaeaab4=['error','12538540xGcfeR','2165107eSUYgb','292804wRyAfN','8ufKlqm','env','6iMXQQC','14614039nlTCaX','4846581TWPaxO','node_modules','255WTsUAr','2014ZGqkZn','755083FCQmnf','PATH','10oUpVni','close','--watch'];a17_0x5e94=function(){return _0xaeaab4;};return a17_0x5e94();}import{spawn}from'node:child_process';function a17_0x1b87(_0x2a78d7,_0x5111b3){const _0x5e946c=a17_0x5e94();return a17_0x1b87=function(_0x1b87cb,_0x48c9cc){_0x1b87cb=_0x1b87cb-0x1e6;let _0x259b22=_0x5e946c[_0x1b87cb];return _0x259b22;},a17_0x1b87(_0x2a78d7,_0x5111b3);}import{delimiter,join}from'node:path';export function runBuildWatch(){return new Promise((_0x3400ab,_0x59805c)=>{const _0x3a8d03=a17_0x1b87,_0x4f98e8=spawn('vite',['build',_0x3a8d03(0x1eb)],{'stdio':'inherit','shell':!![],'env':{...process['env'],'PATH':''+join(process['cwd'](),_0x3a8d03(0x1f5),'.bin')+delimiter+process[_0x3a8d03(0x1f1)][_0x3a8d03(0x1e8)]}});_0x4f98e8['on'](_0x3a8d03(0x1ea),_0x1397cf=>{if(_0x1397cf===0x0||_0x1397cf===null)_0x3400ab();else _0x59805c(new Error('npm\x20run\x20build\x20exited\x20with\x20code\x20'+_0x1397cf));}),_0x4f98e8['on'](_0x3a8d03(0x1ec),_0x59805c);});}
|