jjb-cmd 3.0.0 → 3.0.2

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 CHANGED
@@ -41,11 +41,23 @@ jjb-cmd help
41
41
 
42
42
  #### 用户登录
43
43
 
44
+ **交互式:**
45
+
46
+ ```bash
47
+ jjb-cmd login
48
+ ```
49
+
50
+ **非交互式(适合 AI/脚本):**
51
+
44
52
  ```bash
53
+ jjb-cmd login -u <用户名> -p <密码>
54
+
55
+ # 或用环境变量(更安全,避免账号密码出现在命令行)
56
+ export JJB_USERNAME=<用户名> JJB_PASSWORD=<密码>
45
57
  jjb-cmd login
46
58
  ```
47
59
 
48
- 交互式输入用户名和密码完成登录,登录信息会安全加密存储在本地 `.auth` 文件中。
60
+ 登录信息会安全加密存储在本地 `.auth` 文件中。
49
61
 
50
62
  #### 退出登录
51
63
 
@@ -152,6 +164,13 @@ node build.js
152
164
 
153
165
  ## 更新日志
154
166
 
167
+ ### v3.0.2
168
+ - `login` / `auth` 支持非交互登录(`-u` / `-p` 或 `JJB_USERNAME` / `JJB_PASSWORD` 环境变量),实现命令级 AI 全自动
169
+
170
+ ### v3.0.1
171
+ - 移除遗留的原生依赖(`better-sqlite3` 等),修复在未安装 Visual Studio C++ 工具链环境下安装失败的问题
172
+ - 精简依赖,仅保留 `axios` / `chalk` / `commander` / `inquirer`
173
+
155
174
  ### v3.0.0
156
175
  - push: 实时查询后端远程分支并二次确认,防止推错分支发错版本
157
176
  - push: 支持 `--build` / `--target` / `--message` 非交互一键推送(适合 AI/脚本)
package/bin/command.js CHANGED
@@ -35,7 +35,9 @@ function showHelp() {
35
35
  ['jjb-cmd publish <version>', '发布云组件'],
36
36
  [' arg1 <version>', '发布版本,仅支持 dev/test/latest 或数字版本(最多 5 位,如 1.0.0.0),不能以 v 开头'],
37
37
  [' -f, --force', '跳过所有二次确认'],
38
- ['jjb-cmd login', '登录授权(交互式输入用户名和密码)'],
38
+ ['jjb-cmd login', '登录授权(交互式,或用 -u/-p 非交互)'],
39
+ [' -u, --username <user>', '用户名(非交互,AI/脚本)'],
40
+ [' -p, --password <pwd>', '密码(非交互,AI/脚本)'],
39
41
  ['jjb-cmd logout', '退出登录(删除本地登录信息)'],
40
42
  ['jjb-cmd push java', '推送微应用到服务器'],
41
43
  [' -b, --build <script>', '指定打包命令(如 build:prod),跳过选择'],
@@ -63,13 +65,28 @@ commander.command('help').description('-- 帮助').action(() => {
63
65
  showHelp();
64
66
  });
65
67
 
66
- // 登录(原 auth 更名,保留 auth 作为兼容别名)
67
- commander.command('login').description('-- 登录授权').action(async () => {
68
- await require('../src/auth.js')([]);
69
- });
70
- commander.command('auth').description('-- 登录授权(已更名,建议使用 jjb-cmd login)').action(async () => {
71
- await require('../src/auth.js')([]);
72
- });
68
+ // 登录(原 auth 更名,保留 auth 作为兼容别名;支持 -u/-p 非交互,适合 AI/脚本)
69
+ // 注意:login/auth 无位置参数,commander 1.x 会把命令对象作为第一个参数传入
70
+ function runLogin(arg1, arg2) {
71
+ const cmd = (arg1 && typeof arg1 === 'object') ? arg1 : arg2;
72
+ require('../src/auth.js')({
73
+ username: cmd && cmd.username,
74
+ password: cmd && cmd.password
75
+ });
76
+ }
77
+ const loginCmd = commander.command('login');
78
+ loginCmd
79
+ .option('-u, --username <username>', '用户名(非交互)')
80
+ .option('-p, --password <password>', '密码(非交互)')
81
+ .description('-- 登录授权');
82
+ loginCmd.action(runLogin);
83
+
84
+ const authCmd = commander.command('auth');
85
+ authCmd
86
+ .option('-u, --username <username>', '用户名(非交互)')
87
+ .option('-p, --password <password>', '密码(非交互)')
88
+ .description('-- 登录授权(已更名,建议使用 jjb-cmd login)');
89
+ authCmd.action(runLogin);
73
90
 
74
91
  // 退出登录(删除本地登录信息)
75
92
  commander.command('logout').description('-- 退出登录').action(async () => {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "env": "prod",
5
5
  "httpMethod": "http",
6
6
  "pushMessage": "yes",
7
- "version": "3.0.0",
7
+ "version": "3.0.2",
8
8
  "description": "jjb-cmd命令行工具",
9
9
  "main": "index.js",
10
10
  "scripts": {
@@ -17,23 +17,9 @@
17
17
  "author": "jiaoxiwei",
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "@babel/core": "^7.19.3",
21
- "@babel/generator": "^7.26.0",
22
- "@babel/parser": "^7.26.1",
23
- "@babel/preset-env": "^7.23.2",
24
- "@babel/preset-react": "^7.18.6",
25
- "@babel/preset-typescript": "^7.23.2",
26
- "@babel/traverse": "^7.25.9",
27
- "@cqsjjb/react-code-optimization": "latest",
28
20
  "axios": "^1.1.3",
29
- "better-sqlite3": "^12.6.2",
30
21
  "chalk": "2.4.0",
31
22
  "commander": "^1.3.2",
32
- "compressing": "^1.5.1",
33
- "inquirer": "^8.2.7",
34
- "jenkins": "^1.0.2",
35
- "prettier": "^3.3.3",
36
- "request": "2.88.2",
37
- "single-line-log": "1.1.2"
23
+ "inquirer": "^8.2.7"
38
24
  }
39
25
  }
package/src/auth.js CHANGED
@@ -1 +1 @@
1
- function a0_0x4fc2(){const _0x4a8438=['1917774EsrjmO','认证失败:\x20','3590peRVWT','已清理无效的认证信息','保存认证信息失败:\x20','用户取消输入','exit','71830RwpNsz','path','):\x20','正在验证用户凭证...','217RuqPTC','659068fjEsvH','password','post','用户认证成功','未知错误','message','5DuEXKb','2108256MIRhhO','./utils','9406602yuoNFI','status','exports','username','网络连接失败:\x20无法连接到服务器','认证失败\x20(','data','includes','):\x20用户名或密码错误','1424340QockiI','启动交互式登录流程','2sRVxpa','response','request','join','./password-input','193456dOpqQO','./crypto-utils','../.auth'];a0_0x4fc2=function(){return _0x4a8438;};return a0_0x4fc2();}function a0_0x3837(_0x58b5b3,_0x1250fb){_0x58b5b3=_0x58b5b3-0xc4;const _0x4fc2d9=a0_0x4fc2();let _0x3837fe=_0x4fc2d9[_0x58b5b3];return _0x3837fe;}const a0_0xc95f3c=a0_0x3837;(function(_0x2f795a,_0x4edff6){const _0x176fc7=a0_0x3837,_0x7f50b6=_0x2f795a();while(!![]){try{const _0x11fa95=parseInt(_0x176fc7(0xc8))/0x1*(parseInt(_0x176fc7(0xdc))/0x2)+-parseInt(_0x176fc7(0xc6))/0x3+-parseInt(_0x176fc7(0xe3))/0x4+-parseInt(_0x176fc7(0xe2))/0x5*(-parseInt(_0x176fc7(0xd0))/0x6)+parseInt(_0x176fc7(0xdb))/0x7*(-parseInt(_0x176fc7(0xcd))/0x8)+-parseInt(_0x176fc7(0xe5))/0x9+parseInt(_0x176fc7(0xd2))/0xa*(parseInt(_0x176fc7(0xd7))/0xb);if(_0x11fa95===_0x4edff6)break;else _0x7f50b6['push'](_0x7f50b6['shift']());}catch(_0x206e2d){_0x7f50b6['push'](_0x7f50b6['shift']());}}}(a0_0x4fc2,0x807df));const axios=require('axios'),path=require(a0_0xc95f3c(0xd8)),{getApiHost}=require('./config'),{logInfo,logSuccess,logError,fileExists,deleteFile}=require(a0_0xc95f3c(0xe4)),{saveAuth,deleteAuth}=require(a0_0xc95f3c(0xce)),{getCredentials,interactiveAuth}=require(a0_0xc95f3c(0xcc));module[a0_0xc95f3c(0xe7)]=async _0x5089d4=>{const _0xbc8bd3=a0_0xc95f3c,_0x598750=path[_0xbc8bd3(0xcb)](__dirname,_0xbc8bd3(0xcf));try{logInfo(_0xbc8bd3(0xc7));const _0x52d2d3=await interactiveAuth(),_0xe53ef7=_0x52d2d3[_0xbc8bd3(0xe8)],_0x3ab603=_0x52d2d3[_0xbc8bd3(0xdd)];logInfo(_0xbc8bd3(0xda));const _0x5e0902=await axios[_0xbc8bd3(0xde)](getApiHost()+'/api/auth',{'username':_0xe53ef7,'password':_0x3ab603});if(_0x5e0902[_0xbc8bd3(0xeb)][_0xbc8bd3(0xe6)]){logSuccess(_0xbc8bd3(0xdf));try{saveAuth(_0xe53ef7,_0x3ab603,_0x598750),logSuccess('认证信息已安全加密存储');}catch(_0x39a392){logError(_0xbc8bd3(0xd4)+_0x39a392['message']),process[_0xbc8bd3(0xd6)](0x1);}}else logError(_0xbc8bd3(0xd1)+(_0x5e0902[_0xbc8bd3(0xeb)][_0xbc8bd3(0xe1)]||_0xbc8bd3(0xe0))),fileExists(_0x598750)&&(deleteAuth(_0x598750),logInfo(_0xbc8bd3(0xd3))),process[_0xbc8bd3(0xd6)](0x1);}catch(_0x2602a7){if(_0x2602a7[_0xbc8bd3(0xe1)][_0xbc8bd3(0xc4)](_0xbc8bd3(0xd5)))logError('用户取消登录操作');else{if(_0x2602a7[_0xbc8bd3(0xc9)]){const _0xca2035=_0x2602a7[_0xbc8bd3(0xc9)][_0xbc8bd3(0xe6)],_0x462091=_0x2602a7[_0xbc8bd3(0xc9)][_0xbc8bd3(0xeb)]?.[_0xbc8bd3(0xe1)]||_0x2602a7[_0xbc8bd3(0xe1)];_0xca2035===0x191||_0xca2035===0x193?logError(_0xbc8bd3(0xea)+_0xca2035+_0xbc8bd3(0xc5)):logError('请求失败\x20('+_0xca2035+_0xbc8bd3(0xd9)+_0x462091);}else _0x2602a7[_0xbc8bd3(0xca)]?logError(_0xbc8bd3(0xe9)):logError('登录失败:\x20'+_0x2602a7['message']);}process[_0xbc8bd3(0xd6)](0x1);}};
1
+ function a0_0x476a(_0x9efcf9,_0x1e271f){_0x9efcf9=_0x9efcf9-0x17d;const _0x482a52=a0_0x482a();let _0x476acf=_0x482a52[_0x9efcf9];return _0x476acf;}function a0_0x482a(){const _0x2607b4=['认证失败:\x20','88NjCuRQ','exit','../.auth','3558774ibkrTj','includes','./config','./crypto-utils','):\x20','网络连接失败:\x20无法连接到服务器','未知错误','登录失败:\x20','exports','正在验证用户凭证...','认证信息已安全加密存储','message','password','用户取消输入','认证失败\x20(','763580bAQBla','已清理无效的认证信息','path','request','用户认证成功','status','4534040vODOLU','):\x20用户名或密码错误','请求失败\x20(','/api/auth','289317thcATp','6ExCdpv','保存认证信息失败:\x20','99vpGVuX','data','2870wlykTf','response','使用非交互方式登录(命令行参数\x20/\x20环境变量)','用户取消登录操作','2700085IJqhrK','axios','启动交互式登录流程','join','./utils','1022957EZhdqD','post','username'];a0_0x482a=function(){return _0x2607b4;};return a0_0x482a();}const a0_0x434cee=a0_0x476a;(function(_0xe70e65,_0x5a9d2c){const _0x6c3f9a=a0_0x476a,_0x3ce358=_0xe70e65();while(!![]){try{const _0x202a89=parseInt(_0x6c3f9a(0x19b))/0x1+-parseInt(_0x6c3f9a(0x183))/0x2+parseInt(_0x6c3f9a(0x1a2))/0x3+-parseInt(_0x6c3f9a(0x189))/0x4+parseInt(_0x6c3f9a(0x196))/0x5*(parseInt(_0x6c3f9a(0x18e))/0x6)+-parseInt(_0x6c3f9a(0x18d))/0x7*(parseInt(_0x6c3f9a(0x19f))/0x8)+parseInt(_0x6c3f9a(0x190))/0x9*(-parseInt(_0x6c3f9a(0x192))/0xa);if(_0x202a89===_0x5a9d2c)break;else _0x3ce358['push'](_0x3ce358['shift']());}catch(_0x54a375){_0x3ce358['push'](_0x3ce358['shift']());}}}(a0_0x482a,0xbd7c6));const axios=require(a0_0x434cee(0x197)),path=require(a0_0x434cee(0x185)),{getApiHost}=require(a0_0x434cee(0x1a4)),{logInfo,logSuccess,logError,fileExists,deleteFile}=require(a0_0x434cee(0x19a)),{saveAuth,deleteAuth}=require(a0_0x434cee(0x1a5)),{getCredentials,interactiveAuth}=require('./password-input');module[a0_0x434cee(0x1aa)]=async _0x48b864=>{const _0xdeb7fe=a0_0x434cee;(_0x48b864==null||Array['isArray'](_0x48b864))&&(_0x48b864={});const _0x5a2774=path[_0xdeb7fe(0x199)](__dirname,_0xdeb7fe(0x1a1));try{let _0x178f99=_0x48b864[_0xdeb7fe(0x19d)],_0x4301d7=_0x48b864[_0xdeb7fe(0x180)];if(!_0x178f99)_0x178f99=process.env.JJB_USERNAME;if(!_0x4301d7)_0x4301d7=process.env.JJB_PASSWORD;if(_0x178f99&&_0x4301d7)logInfo(_0xdeb7fe(0x194));else{logInfo(_0xdeb7fe(0x198));const _0x3c5ff7=await interactiveAuth();_0x178f99=_0x3c5ff7[_0xdeb7fe(0x19d)],_0x4301d7=_0x3c5ff7['password'];}logInfo(_0xdeb7fe(0x17d));const _0x4ca8d7=await axios[_0xdeb7fe(0x19c)](getApiHost()+_0xdeb7fe(0x18c),{'username':_0x178f99,'password':_0x4301d7});if(_0x4ca8d7[_0xdeb7fe(0x191)][_0xdeb7fe(0x188)]){logSuccess(_0xdeb7fe(0x187));try{saveAuth(_0x178f99,_0x4301d7,_0x5a2774),logSuccess(_0xdeb7fe(0x17e));}catch(_0x22328f){logError(_0xdeb7fe(0x18f)+_0x22328f['message']),process['exit'](0x1);}}else logError(_0xdeb7fe(0x19e)+(_0x4ca8d7[_0xdeb7fe(0x191)][_0xdeb7fe(0x17f)]||_0xdeb7fe(0x1a8))),fileExists(_0x5a2774)&&(deleteAuth(_0x5a2774),logInfo(_0xdeb7fe(0x184))),process[_0xdeb7fe(0x1a0)](0x1);}catch(_0x21d6f0){if(_0x21d6f0['message'][_0xdeb7fe(0x1a3)](_0xdeb7fe(0x181)))logError(_0xdeb7fe(0x195));else{if(_0x21d6f0[_0xdeb7fe(0x193)]){const _0x370f6d=_0x21d6f0[_0xdeb7fe(0x193)][_0xdeb7fe(0x188)],_0x41148f=_0x21d6f0['response']['data']?.['message']||_0x21d6f0[_0xdeb7fe(0x17f)];_0x370f6d===0x191||_0x370f6d===0x193?logError(_0xdeb7fe(0x182)+_0x370f6d+_0xdeb7fe(0x18a)):logError(_0xdeb7fe(0x18b)+_0x370f6d+_0xdeb7fe(0x1a6)+_0x41148f);}else _0x21d6f0[_0xdeb7fe(0x186)]?logError(_0xdeb7fe(0x1a7)):logError(_0xdeb7fe(0x1a9)+_0x21d6f0[_0xdeb7fe(0x17f)]);}process['exit'](0x1);}};
package/src/config.js CHANGED
@@ -1 +1 @@
1
- const a1_0x222bd9=a1_0x2ba6;(function(_0x3733c9,_0x5d5857){const _0x351ef2=a1_0x2ba6,_0x4c1056=_0x3733c9();while(!![]){try{const _0x33f638=parseInt(_0x351ef2(0xe4))/0x1+-parseInt(_0x351ef2(0xe2))/0x2*(-parseInt(_0x351ef2(0xf3))/0x3)+-parseInt(_0x351ef2(0xe5))/0x4*(-parseInt(_0x351ef2(0xe8))/0x5)+-parseInt(_0x351ef2(0xef))/0x6+parseInt(_0x351ef2(0x104))/0x7*(parseInt(_0x351ef2(0xfa))/0x8)+parseInt(_0x351ef2(0xf4))/0x9*(-parseInt(_0x351ef2(0xfb))/0xa)+parseInt(_0x351ef2(0xe9))/0xb;if(_0x33f638===_0x5d5857)break;else _0x4c1056['push'](_0x4c1056['shift']());}catch(_0x5006e9){_0x4c1056['push'](_0x4c1056['shift']());}}}(a1_0x2a23,0x46cbc));function a1_0x2ba6(_0x3ec9af,_0x448ac3){_0x3ec9af=_0x3ec9af-0xdf;const _0x2a234c=a1_0x2a23();let _0x2ba6c9=_0x2a234c[_0x3ec9af];return _0x2ba6c9;}function a1_0x2a23(){const _0xd54781=['../package.json','G4HJRsHr9D7Ssmixegw2','7PJwELM','jjb-assembly-','http://120.26.210.58:8089','CLOUD_PROJECT','http','getApiHost','API_HOST','parse','4YhxUjb','gPSit8aJsLVmNzuQ5Cy4','516355vmpbQP','8yYOtwb','readFileSync','join','437215IuVUXJ','1329273ODVNZG','GIT_TEMP_DIR','http://192.168.1.242:10985','GIT_TEMP_JAVA','jjb-assembly-java','CONFIG_FILE_HOST','2016312FdAyNP','d4wQ7dzEjYPsgVbKnYei','API_HOST_TEST','test','256515lnTpkz','4332492VimDLn','ywPtT3xCG6b_vAxp6sTj','httpMethod','now','toString','https://jcloud.cqjjb.cn','994608fxCTNA','10HUpQyK','e9njpBd1nS_LREN8GFpR','env','snBxJ2i5kYarGGcsojhY','hLqARY89CN6fUD3yg4NL','https://cdn.cqjjb.cn/jjb-cloud-config','7V-YUxhmh51Mdhgx4rq4'];a1_0x2a23=function(){return _0xd54781;};return a1_0x2a23();}const os=require('os'),path=require('path'),fs=require('fs'),API_HOST='http://120.26.210.58:8088',API_HOST_HTTPS=a1_0x222bd9(0xf9),API_HOST_TEST=a1_0x222bd9(0x106);exports[a1_0x222bd9(0xee)]=a1_0x222bd9(0x100),exports[a1_0x222bd9(0xe0)]=API_HOST,exports[a1_0x222bd9(0xf1)]=API_HOST_TEST,exports['GIT_HOST']=a1_0x222bd9(0xeb),exports[a1_0x222bd9(0xea)]=a1_0x222bd9(0x105)+Date[a1_0x222bd9(0xf7)](),exports[a1_0x222bd9(0xec)]=a1_0x222bd9(0xed),exports[a1_0x222bd9(0x107)]={'common':{'token':a1_0x222bd9(0x103),'projectId':0x117},'react-admin-component':{'token':'FT3pKzxpRynFkmddJ9Bs','projectId':0x154},'jjb-dva-runtime':{'token':a1_0x222bd9(0xff),'projectId':0x23b},'jjb-common-lib':{'token':a1_0x222bd9(0xfc),'projectId':0x23c},'jjb-common-decorator':{'token':a1_0x222bd9(0xe3),'projectId':0x23e},'vue-unisass-component':{'token':a1_0x222bd9(0xf0),'projectId':0x153},'react-component':{'token':a1_0x222bd9(0xfe),'projectId':0x33f},'micro-app-ts':{'token':a1_0x222bd9(0x101),'projectId':0x33e},'micro-app':{'token':'FqNrmFAgrxasMrbbjvq9','projectId':0x33d},'lib':{'token':a1_0x222bd9(0xf5),'projectId':0x33c}},exports['TEMPLATE_FOLDER']=path[a1_0x222bd9(0xe7)](os['tmpdir'](),exports['GIT_TEMP_DIR']),exports[a1_0x222bd9(0xdf)]=()=>{const _0x4bf069=a1_0x222bd9;try{const _0x281409=JSON[_0x4bf069(0xe1)](fs[_0x4bf069(0xe6)](path[_0x4bf069(0xe7)](__dirname,_0x4bf069(0x102)))[_0x4bf069(0xf8)]());return _0x281409[_0x4bf069(0xfd)]===_0x4bf069(0xf2)?API_HOST_TEST:_0x281409[_0x4bf069(0xf6)]===_0x4bf069(0x108)?API_HOST:API_HOST_HTTPS;}catch(_0x4be03a){return API_HOST_HTTPS;}};
1
+ function a1_0xe3fa(){const _0x4a66a7=['2669214rhpbKu','getApiHost','https://cdn.cqjjb.cn/jjb-cloud-config','../package.json','http://120.26.210.58:8088','gPSit8aJsLVmNzuQ5Cy4','http://120.26.210.58:8089','24DIvjPB','4ClUiGV','479455lqApQe','GIT_HOST','parse','353490mwZoHc','http://192.168.1.242:10985','readFileSync','path','16243548BKyEuI','httpMethod','FqNrmFAgrxasMrbbjvq9','3282966glWtYL','CLOUD_PROJECT','jjb-assembly-','jjb-assembly-java','tmpdir','11ddTOwK','257308ggkYvs','FT3pKzxpRynFkmddJ9Bs','API_HOST_TEST','https://jcloud.cqjjb.cn','http','GIT_TEMP_DIR','8BuysdT','14yXmYrf','377110tWRfVd','join','TEMPLATE_FOLDER','G4HJRsHr9D7Ssmixegw2','now'];a1_0xe3fa=function(){return _0x4a66a7;};return a1_0xe3fa();}const a1_0x2a0d79=a1_0x8e8d;function a1_0x8e8d(_0x5038e5,_0x543bc8){_0x5038e5=_0x5038e5-0x8d;const _0xe3faab=a1_0xe3fa();let _0x8e8d39=_0xe3faab[_0x5038e5];return _0x8e8d39;}(function(_0x241cc3,_0x4a577b){const _0x4195e0=a1_0x8e8d,_0x13e111=_0x241cc3();while(!![]){try{const _0xf84c59=-parseInt(_0x4195e0(0x9a))/0x1+-parseInt(_0x4195e0(0x8d))/0x2*(-parseInt(_0x4195e0(0xae))/0x3)+-parseInt(_0x4195e0(0xaf))/0x4*(parseInt(_0x4195e0(0xb0))/0x5)+-parseInt(_0x4195e0(0xa7))/0x6*(-parseInt(_0x4195e0(0xa1))/0x7)+parseInt(_0x4195e0(0xa0))/0x8*(parseInt(_0x4195e0(0x94))/0x9)+-parseInt(_0x4195e0(0xa2))/0xa+-parseInt(_0x4195e0(0x99))/0xb*(parseInt(_0x4195e0(0x91))/0xc);if(_0xf84c59===_0x4a577b)break;else _0x13e111['push'](_0x13e111['shift']());}catch(_0x57d1e9){_0x13e111['push'](_0x13e111['shift']());}}}(a1_0xe3fa,0xe191d));const os=require('os'),path=require(a1_0x2a0d79(0x90)),fs=require('fs'),API_HOST=a1_0x2a0d79(0xab),API_HOST_HTTPS=a1_0x2a0d79(0x9d),API_HOST_TEST=a1_0x2a0d79(0xad);exports['CONFIG_FILE_HOST']=a1_0x2a0d79(0xa9),exports['API_HOST']=API_HOST,exports[a1_0x2a0d79(0x9c)]=API_HOST_TEST,exports[a1_0x2a0d79(0xb1)]=a1_0x2a0d79(0x8e),exports[a1_0x2a0d79(0x9f)]=a1_0x2a0d79(0x96)+Date[a1_0x2a0d79(0xa6)](),exports['GIT_TEMP_JAVA']=a1_0x2a0d79(0x97),exports[a1_0x2a0d79(0x95)]={'common':{'token':a1_0x2a0d79(0xa5),'projectId':0x117},'react-admin-component':{'token':a1_0x2a0d79(0x9b),'projectId':0x154},'jjb-dva-runtime':{'token':'hLqARY89CN6fUD3yg4NL','projectId':0x23b},'jjb-common-lib':{'token':'e9njpBd1nS_LREN8GFpR','projectId':0x23c},'jjb-common-decorator':{'token':a1_0x2a0d79(0xac),'projectId':0x23e},'vue-unisass-component':{'token':'d4wQ7dzEjYPsgVbKnYei','projectId':0x153},'react-component':{'token':'snBxJ2i5kYarGGcsojhY','projectId':0x33f},'micro-app-ts':{'token':'7V-YUxhmh51Mdhgx4rq4','projectId':0x33e},'micro-app':{'token':a1_0x2a0d79(0x93),'projectId':0x33d},'lib':{'token':'ywPtT3xCG6b_vAxp6sTj','projectId':0x33c}},exports[a1_0x2a0d79(0xa4)]=path['join'](os[a1_0x2a0d79(0x98)](),exports[a1_0x2a0d79(0x9f)]),exports[a1_0x2a0d79(0xa8)]=()=>{const _0x361018=a1_0x2a0d79;try{const _0x2b3d25=JSON[_0x361018(0xb2)](fs[_0x361018(0x8f)](path[_0x361018(0xa3)](__dirname,_0x361018(0xaa)))['toString']());return _0x2b3d25['env']==='test'?API_HOST_TEST:_0x2b3d25[_0x361018(0x92)]===_0x361018(0x9e)?API_HOST:API_HOST_HTTPS;}catch(_0x509fd1){return API_HOST_HTTPS;}};
@@ -1 +1 @@
1
- const a2_0x1e7996=a2_0x549b;(function(_0xde3a96,_0x55ecc3){const _0x57246b=a2_0x549b,_0x1f3e19=_0xde3a96();while(!![]){try{const _0x4abfb3=parseInt(_0x57246b(0x126))/0x1*(parseInt(_0x57246b(0x12c))/0x2)+-parseInt(_0x57246b(0x112))/0x3*(-parseInt(_0x57246b(0x121))/0x4)+-parseInt(_0x57246b(0x11d))/0x5+parseInt(_0x57246b(0x136))/0x6*(-parseInt(_0x57246b(0x138))/0x7)+-parseInt(_0x57246b(0x11f))/0x8*(-parseInt(_0x57246b(0x124))/0x9)+-parseInt(_0x57246b(0x12a))/0xa*(parseInt(_0x57246b(0x130))/0xb)+parseInt(_0x57246b(0x119))/0xc;if(_0x4abfb3===_0x55ecc3)break;else _0x1f3e19['push'](_0x1f3e19['shift']());}catch(_0x844e02){_0x1f3e19['push'](_0x1f3e19['shift']());}}}(a2_0xc679,0xb6894));const crypto=require('crypto'),fs=require('fs'),path=require('path'),CRYPTO_CONFIG={'algorithm':a2_0x1e7996(0x111),'keyLength':0x20,'ivLength':0x10,'saltLength':0x20};function deriveKey(_0x24522f,_0x3c8bc9){const _0xb402c1=a2_0x1e7996;return crypto[_0xb402c1(0x132)](_0x24522f,_0x3c8bc9,0x186a0,CRYPTO_CONFIG[_0xb402c1(0x11e)],_0xb402c1(0x116));}function generateSalt(){const _0x5738d1=a2_0x1e7996;return crypto[_0x5738d1(0x12d)](CRYPTO_CONFIG['saltLength']);}function generateIV(){const _0x135693=a2_0x1e7996;return crypto[_0x135693(0x12d)](CRYPTO_CONFIG['ivLength']);}function a2_0xc679(){const _0x9c7ad6=['22682844jUPjKz','hex','exports','saltLength','1582155qcSyUc','keyLength','301208CkQtaT','保存认证信息失败:\x20','54024huRqWa','删除认证文件失败:\x20','unknown','126vRYehs','utf8','308769pesEjn','platform','setAutoPadding','ivLength','10nCVpVX','userInfo','2XJVoyy','randomBytes','加密失败:\x20','split','5781160oPHfky','createHash','pbkdf2Sync','update','from','sha256','10074CnXDzC','读取认证信息失败:\x20','4907uhpgOH','concat','toString','existsSync','base64','hostname','final','aes-256-cbc','9umMtOW','slice','解密失败:\x20','createCipheriv','sha512','message','writeFileSync'];a2_0xc679=function(){return _0x9c7ad6;};return a2_0xc679();}function a2_0x549b(_0x179d8e,_0x52b3c8){_0x179d8e=_0x179d8e-0x10e;const _0xc6792b=a2_0xc679();let _0x549b6f=_0xc6792b[_0x179d8e];return _0x549b6f;}function encrypt(_0x1f1ebb,_0x209e99){const _0x697497=a2_0x1e7996;try{const _0x19f9f0=generateSalt(),_0x53aa91=generateIV(),_0x1f7a6c=deriveKey(_0x209e99,_0x19f9f0),_0xce55d8=crypto[_0x697497(0x115)](CRYPTO_CONFIG['algorithm'],_0x1f7a6c,_0x53aa91);_0xce55d8[_0x697497(0x128)](!![]);let _0x436ad2=_0xce55d8['update'](_0x1f1ebb,_0x697497(0x125),_0x697497(0x11a));_0x436ad2+=_0xce55d8[_0x697497(0x110)](_0x697497(0x11a));const _0x33a575=Buffer[_0x697497(0x139)]([_0x19f9f0,_0x53aa91,Buffer[_0x697497(0x134)](_0x436ad2,_0x697497(0x11a))]);return _0x33a575[_0x697497(0x13a)](_0x697497(0x10e));}catch(_0x1fc384){throw new Error(_0x697497(0x12e)+_0x1fc384[_0x697497(0x117)]);}}function decrypt(_0x14ebc9,_0x1c77a8){const _0x2e745e=a2_0x1e7996;try{const _0x140276=Buffer[_0x2e745e(0x134)](_0x14ebc9,_0x2e745e(0x10e)),_0x4f6d5d=_0x140276['slice'](0x0,CRYPTO_CONFIG[_0x2e745e(0x11c)]),_0x50ebd4=_0x140276[_0x2e745e(0x113)](CRYPTO_CONFIG[_0x2e745e(0x11c)],CRYPTO_CONFIG[_0x2e745e(0x11c)]+CRYPTO_CONFIG[_0x2e745e(0x129)]),_0x4418d8=_0x140276['slice'](CRYPTO_CONFIG[_0x2e745e(0x11c)]+CRYPTO_CONFIG['ivLength']),_0x34825e=deriveKey(_0x1c77a8,_0x4f6d5d),_0x545263=crypto['createDecipheriv'](CRYPTO_CONFIG['algorithm'],_0x34825e,_0x50ebd4);_0x545263[_0x2e745e(0x128)](!![]);let _0x3d6849=_0x545263[_0x2e745e(0x133)](_0x4418d8,null,_0x2e745e(0x125));return _0x3d6849+=_0x545263[_0x2e745e(0x110)](_0x2e745e(0x125)),_0x3d6849;}catch(_0xb57ae1){throw new Error(_0x2e745e(0x114)+_0xb57ae1[_0x2e745e(0x117)]);}}function generateDeviceKey(){const _0x4db20a=a2_0x1e7996,_0x7134e3=require('os');let _0x2427be=_0x4db20a(0x123);try{_0x2427be=_0x7134e3[_0x4db20a(0x12b)]()['username']||_0x4db20a(0x123);}catch(_0x2e8a45){_0x2427be=process.env.USER||process.env.LOGNAME||process.env.USERNAME||'unknown';}const _0xb41f1f=[_0x7134e3[_0x4db20a(0x127)](),_0x7134e3['arch'](),_0x7134e3[_0x4db20a(0x10f)](),_0x2427be]['join']('|');return crypto[_0x4db20a(0x131)](_0x4db20a(0x135))['update'](_0xb41f1f)['digest'](_0x4db20a(0x11a));}function saveAuth(_0xf6a4bc,_0x360e14,_0x4898e6){const _0x1d7c68=a2_0x1e7996;try{const _0x147cd0=generateDeviceKey(),_0x4a12da=_0xf6a4bc+'/'+_0x360e14,_0x5e34ae=encrypt(_0x4a12da,_0x147cd0);return fs[_0x1d7c68(0x118)](_0x4898e6,_0x5e34ae,{'mode':0x180}),!![];}catch(_0x1e0abf){throw new Error(_0x1d7c68(0x120)+_0x1e0abf[_0x1d7c68(0x117)]);}}function loadAuth(_0x260898){const _0x5d8912=a2_0x1e7996;try{if(!fs[_0x5d8912(0x13b)](_0x260898))throw new Error('认证文件不存在');const _0x12c2ac=generateDeviceKey(),_0x341dd2=fs['readFileSync'](_0x260898,_0x5d8912(0x125)),_0x460f91=decrypt(_0x341dd2,_0x12c2ac),[_0x54fb7c,_0x1657a9]=_0x460f91[_0x5d8912(0x12f)]('/');if(!_0x54fb7c||!_0x1657a9)throw new Error('认证数据格式错误');return{'username':_0x54fb7c,'password':_0x1657a9};}catch(_0x3da154){throw new Error(_0x5d8912(0x137)+_0x3da154[_0x5d8912(0x117)]);}}function deleteAuth(_0x3930f1){const _0x54806c=a2_0x1e7996;try{fs['existsSync'](_0x3930f1)&&fs['unlinkSync'](_0x3930f1);}catch(_0x4cf051){throw new Error(_0x54806c(0x122)+_0x4cf051[_0x54806c(0x117)]);}}module[a2_0x1e7996(0x11b)]={'encrypt':encrypt,'decrypt':decrypt,'saveAuth':saveAuth,'loadAuth':loadAuth,'deleteAuth':deleteAuth,'generateDeviceKey':generateDeviceKey};
1
+ const a2_0x5a1c27=a2_0x4203;(function(_0x298462,_0x5d058d){const _0x17a716=a2_0x4203,_0xaa1c65=_0x298462();while(!![]){try{const _0x25464c=-parseInt(_0x17a716(0xe1))/0x1*(-parseInt(_0x17a716(0xd8))/0x2)+-parseInt(_0x17a716(0xc6))/0x3*(parseInt(_0x17a716(0xe0))/0x4)+parseInt(_0x17a716(0xd7))/0x5*(parseInt(_0x17a716(0xbf))/0x6)+-parseInt(_0x17a716(0xe7))/0x7+-parseInt(_0x17a716(0xe6))/0x8*(-parseInt(_0x17a716(0xd2))/0x9)+parseInt(_0x17a716(0xe2))/0xa*(parseInt(_0x17a716(0xd9))/0xb)+parseInt(_0x17a716(0xcb))/0xc*(parseInt(_0x17a716(0xc5))/0xd);if(_0x25464c===_0x5d058d)break;else _0xaa1c65['push'](_0xaa1c65['shift']());}catch(_0x19f59e){_0xaa1c65['push'](_0xaa1c65['shift']());}}}(a2_0x25f5,0x22cf4));const crypto=require('crypto'),fs=require('fs'),path=require(a2_0x5a1c27(0xe9)),CRYPTO_CONFIG={'algorithm':a2_0x5a1c27(0xca),'keyLength':0x20,'ivLength':0x10,'saltLength':0x20};function deriveKey(_0x191358,_0x6a3a78){return crypto['pbkdf2Sync'](_0x191358,_0x6a3a78,0x186a0,CRYPTO_CONFIG['keyLength'],'sha512');}function generateSalt(){const _0x3d11e3=a2_0x5a1c27;return crypto[_0x3d11e3(0xe4)](CRYPTO_CONFIG['saltLength']);}function generateIV(){const _0x439449=a2_0x5a1c27;return crypto[_0x439449(0xe4)](CRYPTO_CONFIG[_0x439449(0xe8)]);}function a2_0x4203(_0xd1663f,_0x4706fc){_0xd1663f=_0xd1663f-0xbd;const _0x25f5e7=a2_0x25f5();let _0x420306=_0x25f5e7[_0xd1663f];return _0x420306;}function encrypt(_0x455b29,_0x497ec5){const _0x6fd7e5=a2_0x5a1c27;try{const _0x5aa00e=generateSalt(),_0x4207b3=generateIV(),_0x3a5c78=deriveKey(_0x497ec5,_0x5aa00e),_0x4a98f2=crypto[_0x6fd7e5(0xc9)](CRYPTO_CONFIG['algorithm'],_0x3a5c78,_0x4207b3);_0x4a98f2[_0x6fd7e5(0xed)](!![]);let _0x31f442=_0x4a98f2[_0x6fd7e5(0xc8)](_0x455b29,'utf8',_0x6fd7e5(0xdd));_0x31f442+=_0x4a98f2[_0x6fd7e5(0xe3)](_0x6fd7e5(0xdd));const _0xf80a1d=Buffer[_0x6fd7e5(0xbd)]([_0x5aa00e,_0x4207b3,Buffer['from'](_0x31f442,_0x6fd7e5(0xdd))]);return _0xf80a1d[_0x6fd7e5(0xc0)](_0x6fd7e5(0xc1));}catch(_0x103192){throw new Error(_0x6fd7e5(0xd0)+_0x103192[_0x6fd7e5(0xc2)]);}}function decrypt(_0x1706c5,_0xbf2e83){const _0x4b0443=a2_0x5a1c27;try{const _0x5c1859=Buffer[_0x4b0443(0xda)](_0x1706c5,_0x4b0443(0xc1)),_0x3618cd=_0x5c1859[_0x4b0443(0xd6)](0x0,CRYPTO_CONFIG[_0x4b0443(0xea)]),_0x39f034=_0x5c1859[_0x4b0443(0xd6)](CRYPTO_CONFIG[_0x4b0443(0xea)],CRYPTO_CONFIG['saltLength']+CRYPTO_CONFIG[_0x4b0443(0xe8)]),_0x2ebe15=_0x5c1859[_0x4b0443(0xd6)](CRYPTO_CONFIG[_0x4b0443(0xea)]+CRYPTO_CONFIG[_0x4b0443(0xe8)]),_0x2b506d=deriveKey(_0xbf2e83,_0x3618cd),_0x3ce0ea=crypto['createDecipheriv'](CRYPTO_CONFIG[_0x4b0443(0xc3)],_0x2b506d,_0x39f034);_0x3ce0ea[_0x4b0443(0xed)](!![]);let _0x575a9a=_0x3ce0ea['update'](_0x2ebe15,null,_0x4b0443(0xec));return _0x575a9a+=_0x3ce0ea[_0x4b0443(0xe3)]('utf8'),_0x575a9a;}catch(_0x334280){throw new Error(_0x4b0443(0xcf)+_0x334280['message']);}}function a2_0x25f5(){const _0x471505=['unlinkSync','userInfo','slice','10avmmgl','1098hluJvz','55oxvzUr','from','exports','读取认证信息失败:\x20','hex','existsSync','writeFileSync','388328sBePtT','291BARysZ','220390ZSHaVp','final','randomBytes','保存认证信息失败:\x20','16576NJQGJJ','1789578adVvmz','ivLength','path','saltLength','unknown','utf8','setAutoPadding','username','concat','split','139692NsTRnS','toString','base64','message','algorithm','platform','338zAfREW','6MJRDfr','认证数据格式错误','update','createCipheriv','aes-256-cbc','11616kmuWLU','删除认证文件失败:\x20','digest','认证文件不存在','解密失败:\x20','加密失败:\x20','sha256','1089vdbDOz','arch'];a2_0x25f5=function(){return _0x471505;};return a2_0x25f5();}function generateDeviceKey(){const _0x18e1da=a2_0x5a1c27,_0x14daef=require('os');let _0x384065=_0x18e1da(0xeb);try{_0x384065=_0x14daef[_0x18e1da(0xd5)]()[_0x18e1da(0xee)]||_0x18e1da(0xeb);}catch(_0x28153e){_0x384065=process.env.USER||process.env.LOGNAME||process.env.USERNAME||_0x18e1da(0xeb);}const _0x5ef9bc=[_0x14daef[_0x18e1da(0xc4)](),_0x14daef[_0x18e1da(0xd3)](),_0x14daef['hostname'](),_0x384065]['join']('|');return crypto['createHash'](_0x18e1da(0xd1))['update'](_0x5ef9bc)[_0x18e1da(0xcd)]('hex');}function saveAuth(_0x51427a,_0x935322,_0x2c6289){const _0x400e73=a2_0x5a1c27;try{const _0x440d1c=generateDeviceKey(),_0x15a2b0=_0x51427a+'/'+_0x935322,_0x4bbd48=encrypt(_0x15a2b0,_0x440d1c);return fs[_0x400e73(0xdf)](_0x2c6289,_0x4bbd48,{'mode':0x180}),!![];}catch(_0x56ae25){throw new Error(_0x400e73(0xe5)+_0x56ae25[_0x400e73(0xc2)]);}}function loadAuth(_0x4093a9){const _0x5844cc=a2_0x5a1c27;try{if(!fs[_0x5844cc(0xde)](_0x4093a9))throw new Error(_0x5844cc(0xce));const _0x2cdc22=generateDeviceKey(),_0x586643=fs['readFileSync'](_0x4093a9,_0x5844cc(0xec)),_0x46a2dd=decrypt(_0x586643,_0x2cdc22),[_0x15a3f2,_0x435490]=_0x46a2dd[_0x5844cc(0xbe)]('/');if(!_0x15a3f2||!_0x435490)throw new Error(_0x5844cc(0xc7));return{'username':_0x15a3f2,'password':_0x435490};}catch(_0x4e7cc7){throw new Error(_0x5844cc(0xdc)+_0x4e7cc7[_0x5844cc(0xc2)]);}}function deleteAuth(_0x29bf5e){const _0x1f241c=a2_0x5a1c27;try{fs['existsSync'](_0x29bf5e)&&fs[_0x1f241c(0xd4)](_0x29bf5e);}catch(_0x6ed369){throw new Error(_0x1f241c(0xcc)+_0x6ed369[_0x1f241c(0xc2)]);}}module[a2_0x5a1c27(0xdb)]={'encrypt':encrypt,'decrypt':decrypt,'saveAuth':saveAuth,'loadAuth':loadAuth,'deleteAuth':deleteAuth,'generateDeviceKey':generateDeviceKey};
package/src/logout.js CHANGED
@@ -1 +1 @@
1
- const a3_0x3cf876=a3_0x121f;(function(_0x38b401,_0x2e911b){const _0x3ad9f5=a3_0x121f,_0x260fab=_0x38b401();while(!![]){try{const _0x3614ed=parseInt(_0x3ad9f5(0x168))/0x1+-parseInt(_0x3ad9f5(0x15f))/0x2+parseInt(_0x3ad9f5(0x169))/0x3+-parseInt(_0x3ad9f5(0x16c))/0x4+-parseInt(_0x3ad9f5(0x163))/0x5*(parseInt(_0x3ad9f5(0x166))/0x6)+parseInt(_0x3ad9f5(0x161))/0x7+parseInt(_0x3ad9f5(0x164))/0x8;if(_0x3614ed===_0x2e911b)break;else _0x260fab['push'](_0x260fab['shift']());}catch(_0x2fc13f){_0x260fab['push'](_0x260fab['shift']());}}}(a3_0x4e2d,0xf3dbe));function a3_0x121f(_0x26566b,_0x12f0a7){_0x26566b=_0x26566b-0x15f;const _0x4e2de8=a3_0x4e2d();let _0x121ff2=_0x4e2de8[_0x26566b];return _0x121ff2;}const path=require(a3_0x3cf876(0x16d)),{logInfo,logSuccess,logWarning,logError,fileExists}=require(a3_0x3cf876(0x170)),{deleteAuth}=require(a3_0x3cf876(0x165));function a3_0x4e2d(){const _0x577547=['./utils','3402378kBVPgM','退出登录失败:\x20','6940416EatOgU','exports','8850065ozVpkt','16242640ZqiqVl','./crypto-utils','6RgYxma','join','1491952RGuwNd','870783itDkDM','message','../.auth','1335932EeLOgm','path','正在退出登录...','exit'];a3_0x4e2d=function(){return _0x577547;};return a3_0x4e2d();}module[a3_0x3cf876(0x162)]=async function(){const _0xdb3ff1=a3_0x3cf876,_0x1ae351=path[_0xdb3ff1(0x167)](__dirname,_0xdb3ff1(0x16b));!fileExists(_0x1ae351)&&(logWarning('当前未登录,无需退出'),process[_0xdb3ff1(0x16f)](0x0));try{logInfo(_0xdb3ff1(0x16e)),deleteAuth(_0x1ae351),logSuccess('已退出登录,本地登录信息已删除'),process[_0xdb3ff1(0x16f)](0x0);}catch(_0x3e62a7){logError(_0xdb3ff1(0x160)+_0x3e62a7[_0xdb3ff1(0x16a)]),process[_0xdb3ff1(0x16f)](0x1);}};
1
+ function a3_0x3eb9(_0x479c12,_0xe07a5d){_0x479c12=_0x479c12-0xce;const _0x4a89e9=a3_0x4a89();let _0x3eb936=_0x4a89e9[_0x479c12];return _0x3eb936;}const a3_0xcbf3d7=a3_0x3eb9;(function(_0x617c39,_0x1cef38){const _0x229463=a3_0x3eb9,_0x688ff3=_0x617c39();while(!![]){try{const _0x4a5d8b=parseInt(_0x229463(0xdd))/0x1+-parseInt(_0x229463(0xce))/0x2+-parseInt(_0x229463(0xd8))/0x3*(-parseInt(_0x229463(0xd0))/0x4)+parseInt(_0x229463(0xd3))/0x5*(parseInt(_0x229463(0xda))/0x6)+-parseInt(_0x229463(0xd9))/0x7+parseInt(_0x229463(0xd1))/0x8*(parseInt(_0x229463(0xd4))/0x9)+-parseInt(_0x229463(0xcf))/0xa;if(_0x4a5d8b===_0x1cef38)break;else _0x688ff3['push'](_0x688ff3['shift']());}catch(_0x4ae1ac){_0x688ff3['push'](_0x688ff3['shift']());}}}(a3_0x4a89,0x80274));const path=require('path'),{logInfo,logSuccess,logWarning,logError,fileExists}=require(a3_0xcbf3d7(0xd2)),{deleteAuth}=require(a3_0xcbf3d7(0xde));function a3_0x4a89(){const _0x530a4b=['join','../.auth','309GupYui','910315ZOxBfp','4866azkpvZ','正在退出登录...','exit','1007441nahLJy','./crypto-utils','当前未登录,无需退出','1873806jsjylF','7927740dFELQd','5608liCMzd','1056zLQfBc','./utils','2165eilHzu','60111USyMMk','exports'];a3_0x4a89=function(){return _0x530a4b;};return a3_0x4a89();}module[a3_0xcbf3d7(0xd5)]=async function(){const _0x1af6a2=a3_0xcbf3d7,_0x3a6672=path[_0x1af6a2(0xd6)](__dirname,_0x1af6a2(0xd7));!fileExists(_0x3a6672)&&(logWarning(_0x1af6a2(0xdf)),process[_0x1af6a2(0xdc)](0x0));try{logInfo(_0x1af6a2(0xdb)),deleteAuth(_0x3a6672),logSuccess('已退出登录,本地登录信息已删除'),process[_0x1af6a2(0xdc)](0x0);}catch(_0x107895){logError('退出登录失败:\x20'+_0x107895['message']),process['exit'](0x1);}};
@@ -1 +1 @@
1
- const a4_0x1083c5=a4_0x15f5;function a4_0x15f5(_0x766247,_0x277dd6){_0x766247=_0x766247-0x1d3;const _0xf07506=a4_0xf075();let _0x15f57d=_0xf07506[_0x766247];return _0x15f57d;}(function(_0x506ef4,_0x510b34){const _0x233057=a4_0x15f5,_0x3f28a3=_0x506ef4();while(!![]){try{const _0x80d817=parseInt(_0x233057(0x1da))/0x1*(-parseInt(_0x233057(0x1e8))/0x2)+parseInt(_0x233057(0x1e3))/0x3+parseInt(_0x233057(0x1d4))/0x4*(parseInt(_0x233057(0x1d3))/0x5)+parseInt(_0x233057(0x1e9))/0x6+-parseInt(_0x233057(0x1db))/0x7+parseInt(_0x233057(0x1e0))/0x8+-parseInt(_0x233057(0x1e6))/0x9;if(_0x80d817===_0x510b34)break;else _0x3f28a3['push'](_0x3f28a3['shift']());}catch(_0x51eab8){_0x3f28a3['push'](_0x3f28a3['shift']());}}}(a4_0xf075,0xbe575));const inquirer=require('inquirer'),{logError}=require(a4_0x1083c5(0x1d5));async function getCredentials(_0x54577b=null){const _0x1dc088=a4_0x1083c5;try{let _0x2e08cf=_0x54577b;const _0x5d64fd=[];!_0x2e08cf&&_0x5d64fd[_0x1dc088(0x1d6)]({'type':_0x1dc088(0x1df),'name':'username','message':_0x1dc088(0x1d9),'validate':_0x181c5a=>{const _0x343d94=_0x1dc088;if(!_0x181c5a||!_0x181c5a[_0x343d94(0x1e2)]())return'账号不能为空';return!![];}});_0x5d64fd[_0x1dc088(0x1d6)]({'type':_0x1dc088(0x1e4),'name':_0x1dc088(0x1e4),'message':_0x1dc088(0x1e7),'mask':'*','validate':_0x36ea2c=>{const _0x4f3d1c=_0x1dc088;if(!_0x36ea2c||!_0x36ea2c[_0x4f3d1c(0x1e2)]())return _0x4f3d1c(0x1dc);return!![];}});const _0x577053=await inquirer[_0x1dc088(0x1d8)](_0x5d64fd);_0x2e08cf=_0x2e08cf||_0x577053[_0x1dc088(0x1dd)][_0x1dc088(0x1e2)]();const _0x6ab075=_0x577053[_0x1dc088(0x1e4)];return{'username':_0x2e08cf,'password':_0x6ab075};}catch(_0x17fb7c){_0x17fb7c[_0x1dc088(0x1d7)]?logError(_0x1dc088(0x1de)):logError(_0x1dc088(0x1e5)+_0x17fb7c[_0x1dc088(0x1e1)]);throw _0x17fb7c;}}async function interactiveAuth(){return await getCredentials();}function a4_0xf075(){const _0x4e87a2=['请输入密码:','17888GsxXaN','3146928NqQBoy','45ytASzS','562508fzoIug','./utils','push','isTtyError','prompt','请输入账号:','61BIVUaP','1753500hPOKxt','密码不能为空','username','获取认证信息失败:\x20当前环境不支持交互式输入','input','9547888WELHwB','message','trim','4227513KsdSKZ','password','获取认证信息失败:\x20','25353603CjVGgz'];a4_0xf075=function(){return _0x4e87a2;};return a4_0xf075();}module['exports']={'getCredentials':getCredentials,'interactiveAuth':interactiveAuth};
1
+ function a4_0x5074(_0x5a03a0,_0x39461e){_0x5a03a0=_0x5a03a0-0xdc;const _0x455e83=a4_0x455e();let _0x507443=_0x455e83[_0x5a03a0];return _0x507443;}const a4_0x2a840c=a4_0x5074;(function(_0x19e9d4,_0x12ed25){const _0x363160=a4_0x5074,_0x368cc9=_0x19e9d4();while(!![]){try{const _0x1d41b7=-parseInt(_0x363160(0xe6))/0x1*(parseInt(_0x363160(0xe7))/0x2)+-parseInt(_0x363160(0xec))/0x3+parseInt(_0x363160(0xe1))/0x4*(-parseInt(_0x363160(0xe5))/0x5)+parseInt(_0x363160(0xe8))/0x6+-parseInt(_0x363160(0xde))/0x7+parseInt(_0x363160(0xe9))/0x8*(parseInt(_0x363160(0xea))/0x9)+parseInt(_0x363160(0xdd))/0xa;if(_0x1d41b7===_0x12ed25)break;else _0x368cc9['push'](_0x368cc9['shift']());}catch(_0x4fe8f2){_0x368cc9['push'](_0x368cc9['shift']());}}}(a4_0x455e,0x87e7b));const inquirer=require('inquirer'),{logError}=require(a4_0x2a840c(0xdf));async function getCredentials(_0x27215c=null){const _0x368d58=a4_0x2a840c;try{let _0x19d9ca=_0x27215c;const _0x3d5d47=[];!_0x19d9ca&&_0x3d5d47[_0x368d58(0xdc)]({'type':_0x368d58(0xed),'name':_0x368d58(0xe4),'message':'请输入账号:','validate':_0x5bf9cc=>{if(!_0x5bf9cc||!_0x5bf9cc['trim']())return'账号不能为空';return!![];}});_0x3d5d47['push']({'type':'password','name':_0x368d58(0xeb),'message':'请输入密码:','mask':'*','validate':_0x16c4c4=>{const _0x9a46f5=_0x368d58;if(!_0x16c4c4||!_0x16c4c4[_0x9a46f5(0xe3)]())return'密码不能为空';return!![];}});const _0x50bd64=await inquirer[_0x368d58(0xe2)](_0x3d5d47);_0x19d9ca=_0x19d9ca||_0x50bd64[_0x368d58(0xe4)][_0x368d58(0xe3)]();const _0x3339c0=_0x50bd64[_0x368d58(0xeb)];return{'username':_0x19d9ca,'password':_0x3339c0};}catch(_0x20f97a){_0x20f97a['isTtyError']?logError(_0x368d58(0xee)):logError(_0x368d58(0xef)+_0x20f97a[_0x368d58(0xe0)]);throw _0x20f97a;}}function a4_0x455e(){const _0x3d964f=['获取认证信息失败:\x20','push','20564400jHTCJO','4011924SgZZta','./utils','message','661544pkKSCj','prompt','trim','username','5jKShmU','131311EgHIUX','16SPzSMo','4654452UIblyb','8368xbIloE','1242wjIsNl','password','1892571BfkHtU','input','获取认证信息失败:\x20当前环境不支持交互式输入'];a4_0x455e=function(){return _0x3d964f;};return a4_0x455e();}async function interactiveAuth(){return await getCredentials();}module['exports']={'getCredentials':getCredentials,'interactiveAuth':interactiveAuth};
package/src/publish.js CHANGED
@@ -1 +1 @@
1
- const a5_0x88b0e1=a5_0x7e79;(function(_0x2e3007,_0x1a769e){const _0x17582a=a5_0x7e79,_0x265134=_0x2e3007();while(!![]){try{const _0x5c737f=parseInt(_0x17582a(0x1c8))/0x1*(-parseInt(_0x17582a(0x1c3))/0x2)+-parseInt(_0x17582a(0x160))/0x3+parseInt(_0x17582a(0x17a))/0x4+parseInt(_0x17582a(0x16e))/0x5*(-parseInt(_0x17582a(0x1e3))/0x6)+parseInt(_0x17582a(0x15f))/0x7+parseInt(_0x17582a(0x1d6))/0x8*(-parseInt(_0x17582a(0x161))/0x9)+-parseInt(_0x17582a(0x1e4))/0xa*(-parseInt(_0x17582a(0x1de))/0xb);if(_0x5c737f===_0x1a769e)break;else _0x265134['push'](_0x265134['shift']());}catch(_0x35ec59){_0x265134['push'](_0x265134['shift']());}}}(a5_0x2cef,0xd9f62));function a5_0x7e79(_0x17d69d,_0x435456){_0x17d69d=_0x17d69d-0x15d;const _0x2cef2e=a5_0x2cef();let _0x7e79de=_0x2cef2e[_0x17d69d];return _0x7e79de;}const path=require('path'),os=require('os'),child_process=require(a5_0x88b0e1(0x165)),axios=require('axios'),inquirer=require(a5_0x88b0e1(0x1a7)),{getApiHost}=require(a5_0x88b0e1(0x164)),{CONSTANTS,logInfo,logSuccess,logWarning,logError,executeCommand,fileExists,readFile,writeFile}=require('./utils'),{loadAuth}=require(a5_0x88b0e1(0x166));function getGitInfo(){const _0x2b8cfb=a5_0x88b0e1;let _0x8ffae8=_0x2b8cfb(0x18b),_0x2204e1='unknown';try{_0x8ffae8=child_process[_0x2b8cfb(0x171)](_0x2b8cfb(0x17e),{'cwd':process[_0x2b8cfb(0x179)](),'stdio':_0x2b8cfb(0x1da)})[_0x2b8cfb(0x18d)]()['trim']();}catch(_0x3e17b7){}try{_0x2204e1=child_process['execSync'](_0x2b8cfb(0x15d),{'cwd':process['cwd'](),'stdio':'pipe'})[_0x2b8cfb(0x18d)]()[_0x2b8cfb(0x1d4)]();}catch(_0x24eba6){}return{'branch':_0x8ffae8,'gitUser':_0x2204e1};}function generateMetadataComment(_0x36a9cc){const _0x25801d=a5_0x88b0e1,{branch:_0x5a9093,gitUser:_0x129a6b,hostname:_0xef009f,platform:_0x131f37,publishTime:_0x18b382,version:_0x417d13,cmdVersion:_0x9fe871}=_0x36a9cc;return _0x25801d(0x18e)+_0x5a9093+_0x25801d(0x1ac)+_0xef009f+'\x20('+_0x131f37+_0x25801d(0x194)+_0x18b382+_0x25801d(0x17c)+_0x129a6b+_0x25801d(0x162)+_0x417d13+_0x25801d(0x190)+_0x9fe871+_0x25801d(0x1d3);}function parseComponentConfig(_0x4e89d3){const _0x4cfe19=a5_0x88b0e1,_0x40028a=_0x4e89d3['match'](/(window\[).+?(\.componentKey|.+]={)/img);if(!_0x40028a||!_0x40028a[_0x4cfe19(0x1bc)])throw new Error(_0x4cfe19(0x17b));const _0x18da07={},_0x1281c7=_0x4e89d3['match'](/componentKey.+([{,]info:\s{0,}{)/img);if(!_0x1281c7||!_0x1281c7[_0x4cfe19(0x1bc)])throw new Error(_0x4cfe19(0x1a8));let _0x2e7b70='{';const _0xbdb9e6=_0x4e89d3['split'](_0x1281c7[0x0])[0x1];for(let _0x4d896e=0x0;_0x4d896e<_0xbdb9e6[_0x4cfe19(0x1bc)];_0x4d896e++){_0x2e7b70+=_0xbdb9e6[_0x4d896e];if(_0xbdb9e6[_0x4d896e]==='}'){try{const _0x41f3f9=new Function('return\x20'+_0x2e7b70)();Object[_0x4cfe19(0x1d7)](_0x18da07,_0x41f3f9),_0x18da07[_0x4cfe19(0x1d8)]={};}catch(_0x3bf603){}break;}}const _0x535c2e=_0x4e89d3[_0x4cfe19(0x174)](/componentKey.+([{,]settings:\s{0,}{)/img);if(!_0x535c2e||!_0x535c2e[_0x4cfe19(0x1bc)])throw new Error(_0x4cfe19(0x19d));let _0x2b254c='{';const _0x5ce1df=_0x4e89d3[_0x4cfe19(0x1c5)](_0x535c2e[0x0])[0x1];for(let _0x98c964=0x0;_0x98c964<_0x5ce1df['length'];_0x98c964++){_0x2b254c+=_0x5ce1df[_0x98c964];if(_0x5ce1df[_0x98c964]==='}'){try{_0x18da07[_0x4cfe19(0x1d8)]=new Function(_0x4cfe19(0x180)+_0x2b254c)();}catch(_0x15bae6){}break;}}return JSON['stringify'](_0x18da07);}function getNodeEnv(_0x1f87f8){const _0x4a1e77=a5_0x88b0e1;if(_0x1f87f8===_0x4a1e77(0x19a))return _0x4a1e77(0x19a);if(_0x1f87f8===_0x4a1e77(0x1c2))return'development';return _0x4a1e77(0x1cb);}function a5_0x2cef(){const _0x402070=['\x20\x20-\x20危险操作确认倒计时','readmePath','114PulThx','2681790ZzNJJs','未提供版本号,用法:\x20jjb-cmd\x20publish\x20<version>(如\x20jjb-cmd\x20publish\x201.0.0)','git\x20config\x20user.name','../.auth','2065945rhPxFp','1471725JuVPJD','8657757qGbAuf','\x20|\x20publish-version:\x20','NODE_ENV\x20设置为:\x20','./config','child_process','./crypto-utils','npm\x20run\x20build:','post','valid','confirm','thumbnail.png','exports','正在读取包信息...','469835YepDxi','\x20\x204.\x20已了解发布后的影响范围','response','execSync','追溯信息注入完成','latest','match','缩略图处理完成','版本号不能以\x20v\x20开头(后台会自动补\x20v\x20前缀,输入\x20v1.0.0\x20会生成\x20vv1.0.0\x20目录),请去掉\x20v\x20后重试,例如:\x20','thumbnail_base64','警告:您即将进行组件发布操作,此操作不可逆,请谨慎操作','cwd','6616164aHXgMj','请在组件入口文件中添加\x22window[props.componentKey]\x22以暴露组件的配置信息!','\x20|\x20git-user:\x20','package.json','git\x20rev-parse\x20--abbrev-ref\x20HEAD','/api/file/publish','return\x20','\x20\x205.\x20发布成功后请立即通知相关人员进行测试和验证','force','项目构建完成','\x20\x202.\x20已检查构建产物完整性','message','请在组件根目录为组件添加一个缩略图\x22thumbnail.png\x22文件!','includes','0.0.0','binary','授权失败:\x20','unknown','dist','toString','/**\x20git-branch:\x20','正在处理缩略图...','\x20|\x20cmd-version:\x20','hostname','thumbnailPath','branch',')\x20|\x20publish-time:\x20','组件发布失败!根目录缺少\x27dist/index.js\x27文件!','已启用\x20--force,跳过以下二次确认:','组件发布成功','then','data','test','password','认证信息加载成功','暴露的配置信息中缺少\x22settings\x22!','请输入此次组件发布的信息:','\x20秒...\x20\x20','index.js','confirmed','yarn.lock','组件发布失败!根目录缺少\x27package.json\x27文件!','no\x20message','write','toISOString','inquirer','暴露的配置信息中缺少\x22info\x22!','request','未知错误','replace','\x20|\x20device:\x20','正在提交发布请求...','网络连接失败:\x20无法连接到服务器','\x20\x20-\x20发布信息输入(使用默认值\x20\x22no\x20message\x22)','服务器授权成功','input','gitUser','\x20\x203.\x20已确认版本号和发布信息正确','正在执行项目构建...','exit','操作失败:\x20','resolve','catch','parse','项目构建失败:\x20','prompt','length','\x20\x201.\x20已充分测试组件各项功能','文件验证通过','status','):\x20认证信息无效或无权限','未检测到认证信息,请先执行登录操作:\x20jjb-cmd\x20login','dev','449426kHfSqM','请在组件根目录添加一个README.md说明文件!','split','请求失败\x20(','授权失败\x20(','7qtIzOL','README.md','distPath','production','msg','发布失败:\x20','发布操作已取消','正在解析组件配置信息...','../package.json','/api/auth','发布错误可能导致线上应用产生严重生产故障,请务必确保:','\x20**/\x0a','trim','stdout','8SNfWaO','assign','defaultSetting','base64','pipe','platform','join','正在验证发布所需文件...','154XlpyIH','from','component_config_content'];a5_0x2cef=function(){return _0x402070;};return a5_0x2cef();}function validateVersion(_0x31183e){const _0x178156=a5_0x88b0e1;if(!_0x31183e||typeof _0x31183e!=='string')return{'valid':![],'message':_0x178156(0x1e5)};const _0x3b1fc8=_0x31183e[_0x178156(0x1d4)]();if([_0x178156(0x1c2),_0x178156(0x19a),_0x178156(0x173)][_0x178156(0x187)](_0x3b1fc8))return{'valid':!![],'version':_0x3b1fc8};if(/^\d+(\.\d+){0,4}$/['test'](_0x3b1fc8))return{'valid':!![],'version':_0x3b1fc8};if(/^v\d/[_0x178156(0x19a)](_0x3b1fc8))return{'valid':![],'message':_0x178156(0x176)+_0x3b1fc8[_0x178156(0x1ab)](/^v/,'')};return{'valid':![],'message':'版本号格式不正确:\x20\x22'+_0x3b1fc8+'\x22,只允许\x20dev、test、latest\x20或数字版本(最多\x205\x20位,如\x201.0.0.0)'};}function executeBuild(_0x126fb6,_0x4b937e){const _0x1eb313=a5_0x88b0e1,_0x3071ef=getNodeEnv(_0x4b937e);process.env.NODE_ENV=_0x3071ef,logInfo(_0x1eb313(0x163)+_0x3071ef);const _0x37a0fc=path[_0x1eb313(0x1dc)](_0x126fb6,_0x1eb313(0x1a2));fileExists(_0x37a0fc)?executeCommand('yarn\x20build:'+_0x3071ef,_0x126fb6):executeCommand(_0x1eb313(0x167)+_0x3071ef,_0x126fb6);}function validateRequiredFiles(_0x180ed0){const _0x1e821f=a5_0x88b0e1,_0x30ac19=path[_0x1e821f(0x1dc)](_0x180ed0,_0x1e821f(0x1c9)),_0x41503f=path[_0x1e821f(0x1dc)](_0x180ed0,_0x1e821f(0x18c),_0x1e821f(0x1a0)),_0x14f84b=path[_0x1e821f(0x1dc)](_0x180ed0,_0x1e821f(0x17d)),_0x2f4f4c=path[_0x1e821f(0x1dc)](_0x180ed0,_0x1e821f(0x16b));if(!fileExists(_0x14f84b))throw new Error(_0x1e821f(0x1a3));if(!fileExists(_0x41503f))throw new Error(_0x1e821f(0x195));if(!fileExists(_0x30ac19))throw new Error(_0x1e821f(0x1c4));if(!fileExists(_0x2f4f4c))throw new Error(_0x1e821f(0x186));return{'readmePath':_0x30ac19,'distPath':_0x41503f,'packageJsonPath':_0x14f84b,'thumbnailPath':_0x2f4f4c};}const submitFun=function(_0x26401b,_0x2da561){const _0x5e06f0=a5_0x88b0e1;_0x2da561['message']=_0x26401b||'no\x20message',axios[_0x5e06f0(0x168)](getApiHost()+_0x5e06f0(0x17f),_0x2da561)[_0x5e06f0(0x198)](_0x53b992=>{const _0x43f180=_0x5e06f0;logSuccess(_0x53b992[_0x43f180(0x199)][_0x43f180(0x185)]||_0x43f180(0x197)),process[_0x43f180(0x1b5)](0x0);})[_0x5e06f0(0x1b8)](_0x2a1e3f=>{const _0x364de8=_0x5e06f0;if(_0x2a1e3f&&_0x2a1e3f[_0x364de8(0x170)]){const _0x2441f4=_0x2a1e3f[_0x364de8(0x170)][_0x364de8(0x1bf)],_0x12dfb7=_0x2a1e3f[_0x364de8(0x170)][_0x364de8(0x199)]&&(_0x2a1e3f[_0x364de8(0x170)][_0x364de8(0x199)][_0x364de8(0x185)]||_0x2a1e3f[_0x364de8(0x170)][_0x364de8(0x199)]['msg'])||'';logError('发布失败\x20('+_0x2441f4+'):\x20'+(_0x12dfb7||_0x2a1e3f[_0x364de8(0x185)]));}else _0x2a1e3f&&_0x2a1e3f[_0x364de8(0x1a9)]?logError(_0x364de8(0x1ae)):logError(_0x364de8(0x1cd)+(_0x2a1e3f['message']||_0x364de8(0x1aa)));process['exit'](0x1);});};module[a5_0x88b0e1(0x16c)]=(_0x351a00,_0x40885c={})=>{const _0x23df43=a5_0x88b0e1,_0x39c827=validateVersion(_0x351a00);!_0x39c827[_0x23df43(0x169)]&&(logError(_0x39c827[_0x23df43(0x185)]),process[_0x23df43(0x1b5)](0x1));_0x351a00=_0x39c827['version'];const _0xf31142=!!(_0x40885c&&_0x40885c[_0x23df43(0x182)]),_0x1b5366=path['join'](__dirname,_0x23df43(0x15e));!fileExists(_0x1b5366)&&(logError(_0x23df43(0x1c1)),process['exit'](0x1));let _0x2783dc,_0x3b3247;try{logInfo('正在加载认证信息...');const _0xda796c=loadAuth(_0x1b5366);_0x2783dc=_0xda796c['username'],_0x3b3247=_0xda796c[_0x23df43(0x19b)],logSuccess(_0x23df43(0x19c));}catch(_0x2addd5){logError('读取认证信息失败:\x20'+_0x2addd5[_0x23df43(0x185)]),process[_0x23df43(0x1b5)](0x1);}logInfo('正在请求服务器授权...'),axios[_0x23df43(0x168)](getApiHost()+_0x23df43(0x1d1),{'username':_0x2783dc,'password':_0x3b3247})[_0x23df43(0x198)](async _0x22368b=>{const _0x3fc86c=_0x23df43;if(_0x22368b[_0x3fc86c(0x199)][_0x3fc86c(0x1bf)]){logSuccess(_0x3fc86c(0x1b0));const _0x2fd334=path[_0x3fc86c(0x1b7)]('./');logInfo(_0x3fc86c(0x1b4));try{executeBuild(_0x2fd334,_0x351a00),logSuccess(_0x3fc86c(0x183));}catch(_0x2cbfc3){logError(_0x3fc86c(0x1ba)+_0x2cbfc3[_0x3fc86c(0x185)]),process[_0x3fc86c(0x1b5)](0x1);}logInfo(_0x3fc86c(0x1dd));let _0x1c23d8;try{_0x1c23d8=validateRequiredFiles(_0x2fd334),logSuccess(_0x3fc86c(0x1be));}catch(_0x42e038){logError(_0x42e038[_0x3fc86c(0x185)]),process[_0x3fc86c(0x1b5)](0x1);}logInfo(_0x3fc86c(0x16d));const _0x3529f8=JSON[_0x3fc86c(0x1b9)](readFile(path[_0x3fc86c(0x1dc)](__dirname,_0x3fc86c(0x1d0)))),{version:_0xaa2966}=_0x3529f8;logInfo('正在注入组件追溯信息...');const _0x5e4063=getGitInfo(),_0x162e6d=new Date()[_0x3fc86c(0x1a6)](),_0xe61f1a=readFile(_0x1c23d8[_0x3fc86c(0x1ca)]),_0x1a94bf=generateMetadataComment({'branch':_0x5e4063[_0x3fc86c(0x193)],'gitUser':_0x5e4063[_0x3fc86c(0x1b2)],'hostname':os[_0x3fc86c(0x191)](),'platform':os[_0x3fc86c(0x1db)](),'publishTime':_0x162e6d,'version':_0x351a00||_0x3fc86c(0x188),'cmdVersion':_0xaa2966})+_0xe61f1a;logSuccess(_0x3fc86c(0x172)),logInfo('正在准备发布数据...');const _0x19146c={'username':_0x2783dc,'cmd_version':_0xaa2966,'hostname':os[_0x3fc86c(0x191)](),'platform':os[_0x3fc86c(0x1db)](),'package_version':_0x351a00||0x0,'package_content':_0x1a94bf,'readme_content':readFile(_0x1c23d8[_0x3fc86c(0x1e2)])};try{logInfo(_0x3fc86c(0x1cf)),_0x19146c[_0x3fc86c(0x1e0)]=parseComponentConfig(_0x1a94bf),logSuccess('组件配置解析完成');}catch(_0x3204c2){logError(_0x3204c2[_0x3fc86c(0x185)]),process[_0x3fc86c(0x1b5)](0x1);}logInfo(_0x3fc86c(0x18f));const _0x1b46ef=readFile(_0x1c23d8[_0x3fc86c(0x192)],_0x3fc86c(0x189));_0x19146c[_0x3fc86c(0x177)]=Buffer[_0x3fc86c(0x1df)](_0x1b46ef,_0x3fc86c(0x189))[_0x3fc86c(0x18d)](_0x3fc86c(0x1d9)),logSuccess(_0x3fc86c(0x175)),logWarning(_0x3fc86c(0x178)),logWarning(_0x3fc86c(0x1d2)),logWarning(_0x3fc86c(0x1bd)),logWarning(_0x3fc86c(0x184)),logWarning(_0x3fc86c(0x1b3)),logWarning(_0x3fc86c(0x16f)),logWarning(_0x3fc86c(0x181));let _0x7c2050=_0x3fc86c(0x1a4);if(!_0xf31142){await new Promise(_0x2e2cc8=>{let _0x46392e=0xa;const _0xba9d1d=setInterval(()=>{const _0x26f7be=a5_0x7e79;process[_0x26f7be(0x1d5)][_0x26f7be(0x1a5)]('\x0d倒计时\x20'+_0x46392e+_0x26f7be(0x19f)),_0x46392e--,_0x46392e<0x0&&(clearInterval(_0xba9d1d),process[_0x26f7be(0x1d5)][_0x26f7be(0x1a5)]('\x0d\x0a'),_0x2e2cc8());},0x3e8);});const {confirmed:_0x55224b}=await inquirer['prompt']([{'type':_0x3fc86c(0x16a),'name':_0x3fc86c(0x1a1),'message':'我已充分了解以上可能存在的严重风险,确认继续发布操作?','default':![]}]);!_0x55224b&&(logInfo(_0x3fc86c(0x1ce)),process[_0x3fc86c(0x1b5)](0x0));const {message:_0x51fd77}=await inquirer[_0x3fc86c(0x1bb)]([{'type':_0x3fc86c(0x1b1),'name':_0x3fc86c(0x185),'message':_0x3fc86c(0x19e),'default':'no\x20message'}]);_0x7c2050=_0x51fd77||_0x3fc86c(0x1a4);}else logWarning(_0x3fc86c(0x196)),logWarning(_0x3fc86c(0x1e1)),logWarning('\x20\x20-\x20风险确认提问'),logWarning(_0x3fc86c(0x1af));logInfo(_0x3fc86c(0x1ad)),submitFun(_0x7c2050,_0x19146c);}else logError(_0x3fc86c(0x18a)+(_0x22368b[_0x3fc86c(0x199)][_0x3fc86c(0x185)]||_0x3fc86c(0x1aa))),process[_0x3fc86c(0x1b5)](0x1);})[_0x23df43(0x1b8)](_0x979e58=>{const _0x990f57=_0x23df43;if(_0x979e58&&_0x979e58[_0x990f57(0x170)]){const _0x511a50=_0x979e58[_0x990f57(0x170)][_0x990f57(0x1bf)];if(_0x511a50===0x191||_0x511a50===0x193)logError(_0x990f57(0x1c7)+_0x511a50+_0x990f57(0x1c0));else{const _0xbefaef=_0x979e58[_0x990f57(0x170)][_0x990f57(0x199)]&&(_0x979e58[_0x990f57(0x170)][_0x990f57(0x199)]['message']||_0x979e58['response'][_0x990f57(0x199)][_0x990f57(0x1cc)])||'';logError(_0x990f57(0x1c6)+_0x511a50+'):\x20'+(_0xbefaef||_0x979e58[_0x990f57(0x185)]));}}else _0x979e58&&_0x979e58['request']?logError('网络连接失败:\x20无法连接到服务器或服务器无响应'):logError(_0x990f57(0x1b6)+(_0x979e58?_0x979e58[_0x990f57(0x185)]:'未知错误'));process[_0x990f57(0x1b5)](0x1);});};
1
+ const a5_0x1c2c69=a5_0x45f6;(function(_0x3b8971,_0x29cddb){const _0x90744c=a5_0x45f6,_0x20b26f=_0x3b8971();while(!![]){try{const _0x4cfa6b=-parseInt(_0x90744c(0x180))/0x1+parseInt(_0x90744c(0x16b))/0x2+parseInt(_0x90744c(0x17e))/0x3*(-parseInt(_0x90744c(0x160))/0x4)+parseInt(_0x90744c(0x14d))/0x5+-parseInt(_0x90744c(0x12f))/0x6+parseInt(_0x90744c(0x138))/0x7*(parseInt(_0x90744c(0x13c))/0x8)+parseInt(_0x90744c(0x130))/0x9*(-parseInt(_0x90744c(0x188))/0xa);if(_0x4cfa6b===_0x29cddb)break;else _0x20b26f['push'](_0x20b26f['shift']());}catch(_0x363d76){_0x20b26f['push'](_0x20b26f['shift']());}}}(a5_0x16e0,0x2d9d1));const path=require(a5_0x1c2c69(0x124)),os=require('os'),child_process=require(a5_0x1c2c69(0x164)),axios=require('axios'),inquirer=require(a5_0x1c2c69(0x125)),{getApiHost}=require(a5_0x1c2c69(0x128)),{CONSTANTS,logInfo,logSuccess,logWarning,logError,executeCommand,fileExists,readFile,writeFile}=require(a5_0x1c2c69(0x13e)),{loadAuth}=require('./crypto-utils');function getGitInfo(){const _0x212374=a5_0x1c2c69;let _0x2ca122=_0x212374(0x127),_0x5dfd32='unknown';try{_0x2ca122=child_process[_0x212374(0x17d)](_0x212374(0x126),{'cwd':process[_0x212374(0x145)](),'stdio':_0x212374(0x115)})[_0x212374(0x155)]()[_0x212374(0x17c)]();}catch(_0xf98d13){}try{_0x5dfd32=child_process[_0x212374(0x17d)](_0x212374(0x166),{'cwd':process['cwd'](),'stdio':_0x212374(0x115)})[_0x212374(0x155)]()['trim']();}catch(_0x30a5d1){}return{'branch':_0x2ca122,'gitUser':_0x5dfd32};}function a5_0x16e0(){const _0x9b19b3=['data','path','inquirer','git\x20rev-parse\x20--abbrev-ref\x20HEAD','unknown','./config','../.auth','defaultSetting','版本号不能以\x20v\x20开头(后台会自动补\x20v\x20前缀,输入\x20v1.0.0\x20会生成\x20vv1.0.0\x20目录),请去掉\x20v\x20后重试,例如:\x20','\x20|\x20publish-version:\x20','请在组件根目录添加一个README.md说明文件!','index.js','230226RYqtXd','117rBjTYZ','正在准备发布数据...','split','join','正在请求服务器授权...','dev','网络连接失败:\x20无法连接到服务器或服务器无响应','操作失败:\x20','14826gfmohS','\x20\x204.\x20已了解发布后的影响范围','\x20\x205.\x20发布成功后请立即通知相关人员进行测试和验证','请输入此次组件发布的信息:','872qwGdzE','version','./utils','platform','status','match','\x20|\x20git-user:\x20','发布失败:\x20','binary','cwd','readmePath','hostname','\x20\x203.\x20已确认版本号和发布信息正确','正在验证发布所需文件...','正在读取包信息...','production','\x20秒...\x20\x20','1228825uyzNuK','正在提交发布请求...','正在处理缩略图...',')\x20|\x20publish-time:\x20','正在解析组件配置信息...','request','response','读取认证信息失败:\x20','toString','msg','thumbnail.png','valid','write','package.json','thumbnail_base64','发布失败\x20(','我已充分了解以上可能存在的严重风险,确认继续发布操作?','警告:您即将进行组件发布操作,此操作不可逆,请谨慎操作','resolve','8AGtmmo','/api/auth','\x20\x202.\x20已检查构建产物完整性','yarn.lock','child_process','toISOString','git\x20config\x20user.name','项目构建失败:\x20','distPath','confirm','length','578720cqwmQV','):\x20认证信息无效或无权限','项目构建完成','\x20|\x20device:\x20','\x20|\x20cmd-version:\x20','缩略图处理完成','post','认证信息加载成功','组件发布成功','test','string','暴露的配置信息中缺少\x22info\x22!','latest','parse','no\x20message','发布错误可能导致线上应用产生严重生产故障,请务必确保:','网络连接失败:\x20无法连接到服务器','trim','execSync','450444kLuxYl','NODE_ENV\x20设置为:\x20','237276PglzCH','catch','message','\x20\x201.\x20已充分测试组件各项功能','input','force','from','正在注入组件追溯信息...','2470uRLPdO','):\x20','授权失败:\x20','0.0.0','stringify','return\x20','未知错误','component_config_content','组件配置解析完成','then','stdout','pipe','请在组件入口文件中添加\x22window[props.componentKey]\x22以暴露组件的配置信息!','发布操作已取消','assign','服务器授权成功','\x20\x20-\x20发布信息输入(使用默认值\x20\x22no\x20message\x22)','正在执行项目构建...','未提供版本号,用法:\x20jjb-cmd\x20publish\x20<version>(如\x20jjb-cmd\x20publish\x201.0.0)','请在组件根目录为组件添加一个缩略图\x22thumbnail.png\x22文件!','\x20**/\x0a','组件发布失败!根目录缺少\x27package.json\x27文件!','已启用\x20--force,跳过以下二次确认:','exit','授权失败\x20('];a5_0x16e0=function(){return _0x9b19b3;};return a5_0x16e0();}function generateMetadataComment(_0x192635){const _0x5af9e2=a5_0x1c2c69,{branch:_0x212a3d,gitUser:_0x1b79d5,hostname:_0x83fc5a,platform:_0x3523fa,publishTime:_0x52054a,version:_0x46ced7,cmdVersion:_0x5b221d}=_0x192635;return'/**\x20git-branch:\x20'+_0x212a3d+_0x5af9e2(0x16e)+_0x83fc5a+'\x20('+_0x3523fa+_0x5af9e2(0x150)+_0x52054a+_0x5af9e2(0x142)+_0x1b79d5+_0x5af9e2(0x12c)+_0x46ced7+_0x5af9e2(0x16f)+_0x5b221d+_0x5af9e2(0x11e);}function a5_0x45f6(_0x483a4e,_0x2e5224){_0x483a4e=_0x483a4e-0x113;const _0x16e0a3=a5_0x16e0();let _0x45f651=_0x16e0a3[_0x483a4e];return _0x45f651;}function parseComponentConfig(_0x170d03){const _0x28cd92=a5_0x1c2c69,_0x3f5f7d=_0x170d03['match'](/(window\[).+?(\.componentKey|.+]={)/img);if(!_0x3f5f7d||!_0x3f5f7d['length'])throw new Error(_0x28cd92(0x116));const _0x838269={},_0x198647=_0x170d03[_0x28cd92(0x141)](/componentKey.+([{,]info:\s{0,}{)/img);if(!_0x198647||!_0x198647[_0x28cd92(0x16a)])throw new Error(_0x28cd92(0x176));let _0x240839='{';const _0x216d16=_0x170d03['split'](_0x198647[0x0])[0x1];for(let _0x49087d=0x0;_0x49087d<_0x216d16[_0x28cd92(0x16a)];_0x49087d++){_0x240839+=_0x216d16[_0x49087d];if(_0x216d16[_0x49087d]==='}'){try{const _0x6b15a4=new Function(_0x28cd92(0x18d)+_0x240839)();Object[_0x28cd92(0x118)](_0x838269,_0x6b15a4),_0x838269[_0x28cd92(0x12a)]={};}catch(_0x90c82a){}break;}}const _0x482f54=_0x170d03[_0x28cd92(0x141)](/componentKey.+([{,]settings:\s{0,}{)/img);if(!_0x482f54||!_0x482f54[_0x28cd92(0x16a)])throw new Error('暴露的配置信息中缺少\x22settings\x22!');let _0x546eb4='{';const _0x492e14=_0x170d03[_0x28cd92(0x132)](_0x482f54[0x0])[0x1];for(let _0x8449b4=0x0;_0x8449b4<_0x492e14[_0x28cd92(0x16a)];_0x8449b4++){_0x546eb4+=_0x492e14[_0x8449b4];if(_0x492e14[_0x8449b4]==='}'){try{_0x838269['defaultSetting']=new Function(_0x28cd92(0x18d)+_0x546eb4)();}catch(_0x526630){}break;}}return JSON[_0x28cd92(0x18c)](_0x838269);}function getNodeEnv(_0xf0375d){const _0x1732db=a5_0x1c2c69;if(_0xf0375d===_0x1732db(0x174))return _0x1732db(0x174);if(_0xf0375d===_0x1732db(0x135))return'development';return _0x1732db(0x14b);}function validateVersion(_0x8c5022){const _0x514342=a5_0x1c2c69;if(!_0x8c5022||typeof _0x8c5022!==_0x514342(0x175))return{'valid':![],'message':_0x514342(0x11c)};const _0x26cb14=_0x8c5022[_0x514342(0x17c)]();if([_0x514342(0x135),_0x514342(0x174),_0x514342(0x177)]['includes'](_0x26cb14))return{'valid':!![],'version':_0x26cb14};if(/^\d+(\.\d+){0,4}$/[_0x514342(0x174)](_0x26cb14))return{'valid':!![],'version':_0x26cb14};if(/^v\d/['test'](_0x26cb14))return{'valid':![],'message':_0x514342(0x12b)+_0x26cb14['replace'](/^v/,'')};return{'valid':![],'message':'版本号格式不正确:\x20\x22'+_0x26cb14+'\x22,只允许\x20dev、test、latest\x20或数字版本(最多\x205\x20位,如\x201.0.0.0)'};}function executeBuild(_0x286057,_0x1c5494){const _0x178771=a5_0x1c2c69,_0x148334=getNodeEnv(_0x1c5494);process.env.NODE_ENV=_0x148334,logInfo(_0x178771(0x17f)+_0x148334);const _0xc13e97=path['join'](_0x286057,_0x178771(0x163));fileExists(_0xc13e97)?executeCommand('yarn\x20build:'+_0x148334,_0x286057):executeCommand('npm\x20run\x20build:'+_0x148334,_0x286057);}function validateRequiredFiles(_0x3439ae){const _0x3f9134=a5_0x1c2c69,_0x21fbb1=path[_0x3f9134(0x133)](_0x3439ae,'README.md'),_0x1956c9=path['join'](_0x3439ae,'dist',_0x3f9134(0x12e)),_0x42c3cf=path['join'](_0x3439ae,_0x3f9134(0x15a)),_0x54e777=path['join'](_0x3439ae,_0x3f9134(0x157));if(!fileExists(_0x42c3cf))throw new Error(_0x3f9134(0x11f));if(!fileExists(_0x1956c9))throw new Error('组件发布失败!根目录缺少\x27dist/index.js\x27文件!');if(!fileExists(_0x21fbb1))throw new Error(_0x3f9134(0x12d));if(!fileExists(_0x54e777))throw new Error(_0x3f9134(0x11d));return{'readmePath':_0x21fbb1,'distPath':_0x1956c9,'packageJsonPath':_0x42c3cf,'thumbnailPath':_0x54e777};}const submitFun=function(_0x5b80b3,_0x6fdbd8){const _0x4238dc=a5_0x1c2c69;_0x6fdbd8[_0x4238dc(0x182)]=_0x5b80b3||'no\x20message',axios[_0x4238dc(0x171)](getApiHost()+'/api/file/publish',_0x6fdbd8)[_0x4238dc(0x113)](_0x17548b=>{const _0x367a22=_0x4238dc;logSuccess(_0x17548b[_0x367a22(0x123)]['message']||_0x367a22(0x173)),process[_0x367a22(0x121)](0x0);})[_0x4238dc(0x181)](_0x325758=>{const _0x431f6e=_0x4238dc;if(_0x325758&&_0x325758[_0x431f6e(0x153)]){const _0x2e3da2=_0x325758['response'][_0x431f6e(0x140)],_0x5280a6=_0x325758['response']['data']&&(_0x325758['response'][_0x431f6e(0x123)][_0x431f6e(0x182)]||_0x325758[_0x431f6e(0x153)][_0x431f6e(0x123)][_0x431f6e(0x156)])||'';logError(_0x431f6e(0x15c)+_0x2e3da2+'):\x20'+(_0x5280a6||_0x325758['message']));}else _0x325758&&_0x325758[_0x431f6e(0x152)]?logError(_0x431f6e(0x17b)):logError(_0x431f6e(0x143)+(_0x325758[_0x431f6e(0x182)]||_0x431f6e(0x18e)));process[_0x431f6e(0x121)](0x1);});};module['exports']=(_0x4cc021,_0x5014e5={})=>{const _0x5a82c2=a5_0x1c2c69,_0x43ea29=validateVersion(_0x4cc021);!_0x43ea29[_0x5a82c2(0x158)]&&(logError(_0x43ea29[_0x5a82c2(0x182)]),process[_0x5a82c2(0x121)](0x1));_0x4cc021=_0x43ea29[_0x5a82c2(0x13d)];const _0x56ef98=!!(_0x5014e5&&_0x5014e5[_0x5a82c2(0x185)]),_0x490e26=path['join'](__dirname,_0x5a82c2(0x129));!fileExists(_0x490e26)&&(logError('未检测到认证信息,请先执行登录操作:\x20jjb-cmd\x20login'),process[_0x5a82c2(0x121)](0x1));let _0x2a023b,_0x34c93d;try{logInfo('正在加载认证信息...');const _0xd3e2e7=loadAuth(_0x490e26);_0x2a023b=_0xd3e2e7['username'],_0x34c93d=_0xd3e2e7['password'],logSuccess(_0x5a82c2(0x172));}catch(_0x28eacd){logError(_0x5a82c2(0x154)+_0x28eacd[_0x5a82c2(0x182)]),process[_0x5a82c2(0x121)](0x1);}logInfo(_0x5a82c2(0x134)),axios[_0x5a82c2(0x171)](getApiHost()+_0x5a82c2(0x161),{'username':_0x2a023b,'password':_0x34c93d})[_0x5a82c2(0x113)](async _0x386363=>{const _0x473d48=_0x5a82c2;if(_0x386363[_0x473d48(0x123)]['status']){logSuccess(_0x473d48(0x119));const _0x38b1c8=path[_0x473d48(0x15f)]('./');logInfo(_0x473d48(0x11b));try{executeBuild(_0x38b1c8,_0x4cc021),logSuccess(_0x473d48(0x16d));}catch(_0x1f9f59){logError(_0x473d48(0x167)+_0x1f9f59[_0x473d48(0x182)]),process[_0x473d48(0x121)](0x1);}logInfo(_0x473d48(0x149));let _0x4912b0;try{_0x4912b0=validateRequiredFiles(_0x38b1c8),logSuccess('文件验证通过');}catch(_0x330d01){logError(_0x330d01[_0x473d48(0x182)]),process[_0x473d48(0x121)](0x1);}logInfo(_0x473d48(0x14a));const _0x54307a=JSON[_0x473d48(0x178)](readFile(path[_0x473d48(0x133)](__dirname,'../package.json'))),{version:_0x50d91a}=_0x54307a;logInfo(_0x473d48(0x187));const _0x3bee01=getGitInfo(),_0x4b9c28=new Date()[_0x473d48(0x165)](),_0x2bf311=readFile(_0x4912b0[_0x473d48(0x168)]),_0x34bd0b=generateMetadataComment({'branch':_0x3bee01['branch'],'gitUser':_0x3bee01['gitUser'],'hostname':os[_0x473d48(0x147)](),'platform':os[_0x473d48(0x13f)](),'publishTime':_0x4b9c28,'version':_0x4cc021||_0x473d48(0x18b),'cmdVersion':_0x50d91a})+_0x2bf311;logSuccess('追溯信息注入完成'),logInfo(_0x473d48(0x131));const _0x3e9d3d={'username':_0x2a023b,'cmd_version':_0x50d91a,'hostname':os[_0x473d48(0x147)](),'platform':os['platform'](),'package_version':_0x4cc021||0x0,'package_content':_0x34bd0b,'readme_content':readFile(_0x4912b0[_0x473d48(0x146)])};try{logInfo(_0x473d48(0x151)),_0x3e9d3d[_0x473d48(0x18f)]=parseComponentConfig(_0x34bd0b),logSuccess(_0x473d48(0x190));}catch(_0x56d372){logError(_0x56d372[_0x473d48(0x182)]),process[_0x473d48(0x121)](0x1);}logInfo(_0x473d48(0x14f));const _0x256ab4=readFile(_0x4912b0['thumbnailPath'],_0x473d48(0x144));_0x3e9d3d[_0x473d48(0x15b)]=Buffer[_0x473d48(0x186)](_0x256ab4,_0x473d48(0x144))[_0x473d48(0x155)]('base64'),logSuccess(_0x473d48(0x170)),logWarning(_0x473d48(0x15e)),logWarning(_0x473d48(0x17a)),logWarning(_0x473d48(0x183)),logWarning(_0x473d48(0x162)),logWarning(_0x473d48(0x148)),logWarning(_0x473d48(0x139)),logWarning(_0x473d48(0x13a));let _0x288fbb='no\x20message';if(!_0x56ef98){await new Promise(_0x3b29e5=>{let _0x214ba6=0xa;const _0x139763=setInterval(()=>{const _0x2e4aad=a5_0x45f6;process[_0x2e4aad(0x114)][_0x2e4aad(0x159)]('\x0d倒计时\x20'+_0x214ba6+_0x2e4aad(0x14c)),_0x214ba6--,_0x214ba6<0x0&&(clearInterval(_0x139763),process[_0x2e4aad(0x114)][_0x2e4aad(0x159)]('\x0d\x0a'),_0x3b29e5());},0x3e8);});const {confirmed:_0x50dace}=await inquirer['prompt']([{'type':_0x473d48(0x169),'name':'confirmed','message':_0x473d48(0x15d),'default':![]}]);!_0x50dace&&(logInfo(_0x473d48(0x117)),process[_0x473d48(0x121)](0x0));const {message:_0x26c172}=await inquirer['prompt']([{'type':_0x473d48(0x184),'name':_0x473d48(0x182),'message':_0x473d48(0x13b),'default':_0x473d48(0x179)}]);_0x288fbb=_0x26c172||_0x473d48(0x179);}else logWarning(_0x473d48(0x120)),logWarning('\x20\x20-\x20危险操作确认倒计时'),logWarning('\x20\x20-\x20风险确认提问'),logWarning(_0x473d48(0x11a));logInfo(_0x473d48(0x14e)),submitFun(_0x288fbb,_0x3e9d3d);}else logError(_0x473d48(0x18a)+(_0x386363[_0x473d48(0x123)][_0x473d48(0x182)]||_0x473d48(0x18e))),process[_0x473d48(0x121)](0x1);})['catch'](_0x4a40f1=>{const _0x448a11=_0x5a82c2;if(_0x4a40f1&&_0x4a40f1[_0x448a11(0x153)]){const _0x1d1b29=_0x4a40f1['response'][_0x448a11(0x140)];if(_0x1d1b29===0x191||_0x1d1b29===0x193)logError(_0x448a11(0x122)+_0x1d1b29+_0x448a11(0x16c));else{const _0x20810f=_0x4a40f1[_0x448a11(0x153)][_0x448a11(0x123)]&&(_0x4a40f1[_0x448a11(0x153)][_0x448a11(0x123)][_0x448a11(0x182)]||_0x4a40f1['response'][_0x448a11(0x123)][_0x448a11(0x156)])||'';logError('请求失败\x20('+_0x1d1b29+_0x448a11(0x189)+(_0x20810f||_0x4a40f1[_0x448a11(0x182)]));}}else _0x4a40f1&&_0x4a40f1[_0x448a11(0x152)]?logError(_0x448a11(0x136)):logError(_0x448a11(0x137)+(_0x4a40f1?_0x4a40f1[_0x448a11(0x182)]:_0x448a11(0x18e)));process[_0x448a11(0x121)](0x1);});};
package/src/push.js CHANGED
@@ -1 +1 @@
1
- const a6_0x1e58ea=a6_0x245f;function a6_0x2c20(){const _0x5ebdd9=['missingFields','child_process','指定的后端分支不存在:\x20','MAX_BUFFER_SIZE','DEFAULT_BRANCH','3113350FiRfQx','exit','授权失败:\x20','正在提交代码变更...','toLowerCase','未知错误','no\x20message','):\x20','includes','请选择要执行的打包命令:','CONFIG_FILE_NAME','sort','jjb.config.json\x20读取成功','正在推送代码到远程仓库...','yarn.lock','master','test','12sRCooF','request','正在清理目标目录...','replace','now','force','正在同步\x20Git\x20仓库最新代码...','检测到已存在的仓库,正在强制清理...','构建产物目录不存在,请检查构建输出配置','2LNRhBV','BUILD_OUTPUT_DIR','解析\x20jjb.config.json\x20失败:\x20','some','8BzlXzV','confirmed','正在执行构建命令:\x20','yarn','push','javaGitName','username','utf8','substr','password','__esModule','临时工作目录已创建','目标分支\x20','join','正在切换到目标分支:\x20','/api/auth','授权失败\x20(','message','resolve','请输入提交信息:','npm\x20run\x20','项目构建失败:\x20','release','操作失败:\x20','SYNC_DELAY','查询远程分支失败:\x20','正在清理临时工作目录...','164541rzdBjV','map','代码同步完成','),请稍候...','git\x20add\x20.','项目构建完成','正在安装项目依赖\x20(','已选择打包命令:\x20','HEAD','.html','正在请求服务器授权...','confirm','临时工作目录已清理:\x20','build','704PKFyMn','catch','javaGit','yarn\x20run\x20','git\x20checkout\x20','targetBranch','split','分支名不能为空','2422914uvIAmT','isValid','list','\x20个远程分支','代码推送完成','29924719SqqruZ','解析\x20package.json\x20失败:\x20','未找到\x20jjb.config.json\x20文件','keys','无法查询远程分支(','7ubgRPc','):\x20认证信息无效或无权限','未检测到认证信息,请先执行登录操作:\x20jjb-cmd\x20login','prompt','正在查询后端仓库远程分支,校验目标分支...','可用的打包命令:\x20','正在处理构建产物...','正在加载认证信息...','response','非交互模式必须指定后端分支,用法:\x20jjb-cmd\x20push\x20java\x20--build\x20<打包命令>\x20--target\x20<后端分支>','正在同步远程仓库...','代码提交成功','已选择后端分支:\x20','random','length','项目依赖安装完成','git\x20pull','../.auth','main','\x20存在,校验通过','非交互模式必须指定打包命令,用法:\x20jjb-cmd\x20push\x20java\x20--build\x20<打包命令>\x20--target\x20<后端分支>','5769340dqUaaH','使用指定的提交信息:\x20','trim','status','filter','请求失败\x20(','post','TEMPLATES_PATH','已取消选择,请重新选择后端分支','selectedScript','./crypto-utils','网络连接失败:\x20无法连接到服务器','分支切换完成','package.json\x20读取成功','commitMessage','正在创建模板目录...',',确认推送到该分支吗?','\x22\x20--no-verify','tmpdir','branch','input','prod','localeCompare','data','清理临时目录失败:\x20','已生成\x20','代码提交跳过:\x20没有需要提交的变更','isArray','正在准备临时工作目录...','appIdentifier','未找到\x20package.json\x20文件','服务器授权成功','Git\x20仓库克隆完成','default','index.html','39663RTPRiB','526822cHnWOE','readFileSync','npm\x20install','git\x20clone\x20','您选择的后端分支是:\x20','scripts','正在复制构建产物到目标目录...','正在添加文件变更...','index','正在检查项目配置文件...','认证信息加载成功','未查询到远程分支,请手动输入分支名','./utils'];a6_0x2c20=function(){return _0x5ebdd9;};return a6_0x2c20();}(function(_0x459b81,_0x4fdb04){const _0x4870ea=a6_0x245f,_0x24fb90=_0x459b81();while(!![]){try{const _0x459945=parseInt(_0x4870ea(0x1cf))/0x1*(-parseInt(_0x4870ea(0x1a3))/0x2)+-parseInt(_0x4870ea(0x1ee))/0x3*(-parseInt(_0x4870ea(0x1d3))/0x4)+-parseInt(_0x4870ea(0x223))/0x5+parseInt(_0x4870ea(0x204))/0x6*(-parseInt(_0x4870ea(0x20e))/0x7)+-parseInt(_0x4870ea(0x1fc))/0x8*(parseInt(_0x4870ea(0x1a2))/0x9)+parseInt(_0x4870ea(0x1b5))/0xa+-parseInt(_0x4870ea(0x209))/0xb*(-parseInt(_0x4870ea(0x1c6))/0xc);if(_0x459945===_0x4fdb04)break;else _0x24fb90['push'](_0x24fb90['shift']());}catch(_0xa22c46){_0x24fb90['push'](_0x24fb90['shift']());}}}(a6_0x2c20,0xa35cd));function a6_0x245f(_0xaabe4e,_0x19462b){_0xaabe4e=_0xaabe4e-0x19f;const _0x2c20da=a6_0x2c20();let _0x245f9e=_0x2c20da[_0xaabe4e];return _0x245f9e;}const os=require('os'),path=require('path'),fs=require('fs'),child_process=require(a6_0x1e58ea(0x1b1)),inquirer=require('inquirer'),{CopyFolder,DeleteDirAllFile}=require(a6_0x1e58ea(0x1af)),{GIT_TEMP_JAVA,getApiHost}=require('./config'),axios=require('axios'),{CONSTANTS,logInfo,logSuccess,logWarning,logError,executeCommand,deleteFolderRecursive,fileExists,readFile,writeFile,createDir,isViteProject,validateConfig}=require(a6_0x1e58ea(0x1af)),{loadAuth}=require(a6_0x1e58ea(0x22d));function getRemoteBranches(_0x46f6d8){const _0x728f52=a6_0x1e58ea,_0x131efd=child_process['execSync']('git\x20ls-remote\x20--heads\x20'+_0x46f6d8,{'encoding':_0x728f52(0x1da)}),_0x1229ad=[_0x728f52(0x1c4),_0x728f52(0x220),'dev','develop',_0x728f52(0x1c5),_0x728f52(0x238),'production',_0x728f52(0x1e9)];return _0x131efd[_0x728f52(0x202)]('\x0a')[_0x728f52(0x1ef)](_0xfa6769=>{const _0x15f70f=_0x728f52,_0x30c92a=_0xfa6769[_0x15f70f(0x202)]('\x09')[0x1]||'';return _0x30c92a[_0x15f70f(0x1c9)](/^refs\/heads\//,'')[_0x15f70f(0x225)]();})['filter'](_0x26539a=>_0x26539a&&_0x26539a!==_0x728f52(0x1f6))[_0x728f52(0x1c0)]((_0x15fe17,_0x2fd454)=>{const _0x5536b9=_0x728f52,_0x3abb47=_0x1229ad['indexOf'](_0x15fe17),_0x321ef6=_0x1229ad['indexOf'](_0x2fd454);if(_0x3abb47!==-0x1&&_0x321ef6!==-0x1)return _0x3abb47-_0x321ef6;if(_0x3abb47!==-0x1)return-0x1;if(_0x321ef6!==-0x1)return 0x1;return _0x15fe17[_0x5536b9(0x239)](_0x2fd454);});}async function promptBranchInput(){const _0x391e82=a6_0x1e58ea,{branch:_0x40b408}=await inquirer[_0x391e82(0x211)]([{'type':_0x391e82(0x237),'name':_0x391e82(0x236),'message':'请输入要推送的后端分支名:','default':CONSTANTS[_0x391e82(0x1b4)],'validate':_0x42d3ca=>_0x42d3ca&&_0x42d3ca[_0x391e82(0x225)]()?!![]:_0x391e82(0x203)}]);return(_0x40b408||'')['trim']()||CONSTANTS[_0x391e82(0x1b4)];}module['exports']=async _0x3d89e7=>{const _0x5aec63=a6_0x1e58ea;(_0x3d89e7==null||Array[_0x5aec63(0x23e)](_0x3d89e7))&&(_0x3d89e7={});const _0x3c167e=_0x3d89e7['buildScript'],_0x582ec4=_0x3d89e7[_0x5aec63(0x201)],_0x57980c=_0x3d89e7[_0x5aec63(0x1e4)],_0x5b0d66=!!(_0x3c167e||_0x582ec4||_0x57980c);let _0x282631=null;const _0x141a8c=path[_0x5aec63(0x1e0)](__dirname,_0x5aec63(0x21f));!fileExists(_0x141a8c)&&(logError(_0x5aec63(0x210)),process[_0x5aec63(0x1b6)](0x1));let _0x1439e6,_0x2c31f7;try{logInfo(_0x5aec63(0x215));const _0x2334d6=loadAuth(_0x141a8c);_0x1439e6=_0x2334d6[_0x5aec63(0x1d9)],_0x2c31f7=_0x2334d6[_0x5aec63(0x1dc)],logSuccess(_0x5aec63(0x1ad));}catch(_0x14e3bb){logError('读取认证信息失败:\x20'+_0x14e3bb['message']),process[_0x5aec63(0x1b6)](0x1);}const _0x439b9f=[];if(_0x3d89e7[_0x5aec63(0x1cb)])_0x439b9f[_0x5aec63(0x1d7)](_0x5aec63(0x1cb));if(_0x3d89e7[_0x5aec63(0x1ab)])_0x439b9f['push'](_0x5aec63(0x1ab));const _0x58ccae=path[_0x5aec63(0x1e5)]('./'),_0x3781e4=path[_0x5aec63(0x1e0)](_0x58ccae,'package.json'),_0x496361=path[_0x5aec63(0x1e0)](_0x58ccae,CONSTANTS[_0x5aec63(0x1bf)]),_0x3cc892=path['join'](_0x58ccae,CONSTANTS[_0x5aec63(0x1d0)]),_0x1421e9=os[_0x5aec63(0x235)](),_0x14c029=fileExists(path[_0x5aec63(0x1e0)](_0x58ccae,_0x5aec63(0x1c3)))?_0x5aec63(0x1d6):'npm',_0x5d2618=_0x14c029===_0x5aec63(0x1d6)?_0x5aec63(0x1d6):_0x5aec63(0x1a5),_0x2d15c0=_0x4119bd=>_0x14c029===_0x5aec63(0x1d6)?_0x5aec63(0x1ff)+_0x4119bd:_0x5aec63(0x1e7)+_0x4119bd;logInfo(_0x5aec63(0x1ac));!fileExists(_0x3781e4)&&(logError(_0x5aec63(0x241)),process['exit'](0x1));let _0x4da918;try{_0x4da918=JSON['parse'](fs[_0x5aec63(0x1a4)](_0x3781e4,_0x5aec63(0x1da))),logSuccess(_0x5aec63(0x230));}catch(_0xa26060){logError(_0x5aec63(0x20a)+_0xa26060[_0x5aec63(0x1e4)]),process[_0x5aec63(0x1b6)](0x1);}const _0x31300d=_0x4da918[_0x5aec63(0x1a8)]||{},_0x194fb9=[_0x5aec63(0x1fb)],_0x7bf782=Object[_0x5aec63(0x20c)](_0x31300d)[_0x5aec63(0x227)](_0x4d8ce2=>{const _0x16288e=_0x5aec63;return _0x194fb9[_0x16288e(0x1d2)](_0x263c8b=>_0x4d8ce2[_0x16288e(0x1b9)]()[_0x16288e(0x1bd)](_0x263c8b));});_0x7bf782[_0x5aec63(0x21c)]===0x0&&(logError('未找到打包相关的命令,请检查\x20package.json\x20中的\x20scripts\x20配置'),process[_0x5aec63(0x1b6)](0x1));let _0x9e4c66;if(_0x3c167e)_0x31300d[_0x3c167e]?_0x9e4c66=_0x3c167e:(logError('指定的打包命令不存在:\x20'+_0x3c167e),logError(_0x5aec63(0x213)+_0x7bf782['join'](',\x20')),process[_0x5aec63(0x1b6)](0x1));else{if(_0x5b0d66)logError(_0x5aec63(0x222)),process[_0x5aec63(0x1b6)](0x1);else{const _0x3b38c1=await inquirer[_0x5aec63(0x211)]([{'type':_0x5aec63(0x206),'name':'selectedScript','message':_0x5aec63(0x1be),'choices':_0x7bf782[_0x5aec63(0x1ef)](_0x315828=>({'name':_0x315828+'\x20('+_0x31300d[_0x315828]+')','value':_0x315828}))}]);_0x9e4c66=_0x3b38c1[_0x5aec63(0x22c)];}}logInfo(_0x5aec63(0x1f5)+_0x9e4c66),logInfo(_0x5aec63(0x1ac));!fileExists(_0x496361)&&(logError(_0x5aec63(0x20b)),process['exit'](0x1));let _0x496d64;try{_0x496d64=require(_0x496361),_0x496d64=_0x496d64[_0x5aec63(0x1dd)]?_0x496d64[_0x5aec63(0x1a0)]:_0x496d64,logSuccess(_0x5aec63(0x1c1));}catch(_0x1ab400){logError(_0x5aec63(0x1d1)+_0x1ab400[_0x5aec63(0x1e4)]),process[_0x5aec63(0x1b6)](0x1);}const _0x25c3f0=[_0x5aec63(0x1fe),_0x5aec63(0x1d8),_0x5aec63(0x240)],_0xd775c2=validateConfig(_0x496d64,_0x25c3f0);!_0xd775c2[_0x5aec63(0x205)]&&(logError('配置文件中缺少必要字段:\x20'+_0xd775c2[_0x5aec63(0x1b0)][_0x5aec63(0x1e0)](',\x20')),process[_0x5aec63(0x1b6)](0x1));let _0x1ce3df=null;if(_0x582ec4){logInfo(_0x5aec63(0x212));try{const _0xeacda2=getRemoteBranches(_0x496d64[_0x5aec63(0x1fe)]);_0xeacda2[_0x5aec63(0x21c)]>0x0&&!_0xeacda2[_0x5aec63(0x1bd)](_0x582ec4)&&(logError(_0x5aec63(0x1b2)+_0x582ec4),logError('当前远程分支:\x20'+_0xeacda2['join'](',\x20')),process['exit'](0x1)),logSuccess(_0x5aec63(0x1df)+_0x582ec4+_0x5aec63(0x221));}catch(_0x311376){logWarning(_0x5aec63(0x20d)+_0x311376['message']+'),将直接尝试切换到\x20'+_0x582ec4);}_0x1ce3df=_0x582ec4;}else{if(_0x5b0d66)logError(_0x5aec63(0x217)),process['exit'](0x1);else{logWarning('⚠\x20请仔细核对所选后端分支,选错分支将导致发错版本,直接影响线上环境!');let _0x3ccd08=[];try{logInfo('正在查询后端仓库远程分支...'),_0x3ccd08=getRemoteBranches(_0x496d64['javaGit']),_0x3ccd08['length']>0x0?logSuccess('查询到\x20'+_0x3ccd08[_0x5aec63(0x21c)]+_0x5aec63(0x207)):logWarning(_0x5aec63(0x1ae));}catch(_0x32ab3f){logWarning(_0x5aec63(0x1ec)+_0x32ab3f['message']);}while(!_0x1ce3df){let _0x4d30e5;if(_0x3ccd08[_0x5aec63(0x21c)]>0x0){const {targetBranch:_0x137d80}=await inquirer[_0x5aec63(0x211)]([{'type':_0x5aec63(0x206),'name':'targetBranch','message':'请选择要推送的后端分支(务必核对,选错将发错版本):','pageSize':0xf,'choices':_0x3ccd08}]);_0x4d30e5=_0x137d80;}else _0x4d30e5=await promptBranchInput();const {confirmed:_0x571b61}=await inquirer[_0x5aec63(0x211)]([{'type':_0x5aec63(0x1f9),'name':_0x5aec63(0x1d4),'message':_0x5aec63(0x1a7)+_0x4d30e5+_0x5aec63(0x233),'default':![]}]);_0x571b61?_0x1ce3df=_0x4d30e5:logWarning(_0x5aec63(0x22b));}}}logInfo(_0x5aec63(0x21a)+_0x1ce3df),logInfo(_0x5aec63(0x1f8)),axios[_0x5aec63(0x229)](getApiHost()+_0x5aec63(0x1e2),{'username':_0x1439e6,'password':_0x2c31f7})['then'](async _0x1ad473=>{const _0x23698b=_0x5aec63;if(_0x1ad473['data'][_0x23698b(0x226)]){logSuccess(_0x23698b(0x242));const _0x33d3e1=GIT_TEMP_JAVA+'-'+Date[_0x23698b(0x1ca)]()+'-'+Math[_0x23698b(0x21b)]()['toString'](0x24)[_0x23698b(0x1db)](0x2,0x9);_0x282631=_0x33d3e1;const _0x5eb3bf=path[_0x23698b(0x1e0)](_0x1421e9,_0x33d3e1);logInfo(_0x23698b(0x23f));fileExists(_0x5eb3bf)&&deleteFolderRecursive(_0x5eb3bf);createDir(_0x5eb3bf),logSuccess(_0x23698b(0x1de));const _0x41159e=path[_0x23698b(0x1e0)](_0x5eb3bf,_0x496d64['javaGitName']);logInfo('正在克隆\x20Git\x20仓库...'),fileExists(_0x41159e)?_0x439b9f[_0x23698b(0x1bd)]('force')?(logInfo(_0x23698b(0x1cd)),DeleteDirAllFile(_0x41159e,()=>{const _0xb93a37=_0x23698b;executeCommand(_0xb93a37(0x1a6)+_0x496d64[_0xb93a37(0x1fe)],_0x5eb3bf),logSuccess(_0xb93a37(0x19f));})):(executeCommand(_0x23698b(0x1a6)+_0x496d64[_0x23698b(0x1fe)],_0x5eb3bf),logSuccess(_0x23698b(0x19f))):(executeCommand(_0x23698b(0x1a6)+_0x496d64[_0x23698b(0x1fe)],_0x5eb3bf),logSuccess('Git\x20仓库克隆完成')),_0x7131cb(_0x5eb3bf,_0x496d64,_0x33d3e1,_0x9e4c66,_0x1ce3df);}else logError(_0x23698b(0x1b7)+(_0x1ad473[_0x23698b(0x23a)]['message']||_0x23698b(0x1ba))),process['exit'](0x1);})[_0x5aec63(0x1fd)](_0x33fdb4=>{const _0x46d726=_0x5aec63;if(_0x33fdb4&&_0x33fdb4[_0x46d726(0x216)]){const _0x2cf2fe=_0x33fdb4[_0x46d726(0x216)][_0x46d726(0x226)];_0x2cf2fe===0x191||_0x2cf2fe===0x193?logError(_0x46d726(0x1e3)+_0x2cf2fe+_0x46d726(0x20f)):logError(_0x46d726(0x228)+_0x2cf2fe+_0x46d726(0x1bc)+(_0x33fdb4['response']['data']?.[_0x46d726(0x1e4)]||_0x33fdb4[_0x46d726(0x1e4)]));}else _0x33fdb4&&_0x33fdb4[_0x46d726(0x1c7)]?logError(_0x46d726(0x22e)):logError(_0x46d726(0x1ea)+(_0x33fdb4[_0x46d726(0x1e4)]||_0x46d726(0x1ba)));process['exit'](0x1);}),process['on'](_0x5aec63(0x1b6),()=>{const _0x3eb5a3=_0x5aec63;if(_0x282631){const _0x215196=path[_0x3eb5a3(0x1e0)](os[_0x3eb5a3(0x235)](),_0x282631);if(fileExists(_0x215196))try{deleteFolderRecursive(_0x215196);}catch(_0xf4bce8){}}}),process['on']('uncaughtException',_0x26c74b=>{const _0x32d09e=_0x5aec63;if(_0x282631){const _0x34e1f6=path['join'](os[_0x32d09e(0x235)](),_0x282631);if(fileExists(_0x34e1f6))try{deleteFolderRecursive(_0x34e1f6);}catch(_0x2bd17e){}}throw _0x26c74b;});function _0x7131cb(_0x1005d7,_0x50142c,_0x4e01f1,_0x534ec2,_0x1be73a){const _0x511170=_0x5aec63,_0x502b80=path[_0x511170(0x1e0)](_0x1005d7,_0x50142c[_0x511170(0x1d8)]);logInfo(_0x511170(0x1e1)+_0x1be73a),executeCommand(_0x511170(0x200)+_0x1be73a,_0x502b80),logSuccess(_0x511170(0x22f)),logInfo(_0x511170(0x1cc)),executeCommand(_0x511170(0x21e),_0x502b80),logSuccess(_0x511170(0x1f0));!fileExists(path[_0x511170(0x1e0)](_0x58ccae,'node_modules'))?(logWarning('检测到未安装项目依赖'),logInfo(_0x511170(0x1f4)+_0x14c029+_0x511170(0x1f1)),executeCommand(_0x5d2618,_0x58ccae),logSuccess(_0x511170(0x21d))):logInfo('项目依赖检查通过');try{logInfo(_0x511170(0x1d5)+_0x2d15c0(_0x534ec2)),executeCommand(_0x2d15c0(_0x534ec2),_0x58ccae,{'maxBuffer':CONSTANTS[_0x511170(0x1b3)]}),logSuccess(_0x511170(0x1f3));}catch(_0x25280d){logError(_0x511170(0x1e8)+_0x25280d[_0x511170(0x1e4)]);const _0x26d33f=path[_0x511170(0x1e0)](os[_0x511170(0x235)](),_0x4e01f1);if(fileExists(_0x26d33f))try{deleteFolderRecursive(_0x26d33f),logInfo(_0x511170(0x1fa)+_0x4e01f1);}catch(_0x11903d){logWarning(_0x511170(0x23b)+_0x11903d[_0x511170(0x1e4)]);}process['exit'](0x1);}if(fileExists(_0x3cc892)){logInfo(_0x511170(0x214));const _0xd9a686=_0x50142c[_0x511170(0x240)],_0x13330e=readFile(path['join'](_0x3cc892,_0x511170(0x1a1)));_0x439b9f[_0x511170(0x1bd)](_0x511170(0x1ab))?(writeFile(path[_0x511170(0x1e0)](_0x3cc892,'index.html'),_0x13330e),logInfo('已生成\x20index.html\x20文件')):(writeFile(path['join'](_0x3cc892,_0xd9a686+'.html'),_0x13330e),logInfo(_0x511170(0x23c)+_0xd9a686+'.html\x20文件'));const _0x34d7d8=path[_0x511170(0x1e0)](_0x502b80,CONSTANTS[_0x511170(0x22a)]);logInfo(_0x511170(0x232)),createDir(_0x34d7d8);const _0x429572=path[_0x511170(0x1e0)](_0x34d7d8,_0x50142c[_0x511170(0x240)]);logInfo(_0x511170(0x1c8)),DeleteDirAllFile(_0x429572,()=>{const _0x2df282=_0x511170;createDir(_0x429572),logInfo(_0x2df282(0x1a9)),writeFile(path[_0x2df282(0x1e0)](_0x34d7d8,_0xd9a686+_0x2df282(0x1f7)),_0x13330e),CopyFolder(path[_0x2df282(0x1e0)](_0x3cc892,_0x50142c[_0x2df282(0x240)]),_0x429572,async()=>{const _0x5dbde3=_0x2df282;logSuccess('构建产物复制完成'),setTimeout(async()=>{const _0x2b4d8f=a6_0x245f;logInfo(_0x2b4d8f(0x218)),executeCommand('git\x20pull',_0x502b80),logInfo(_0x2b4d8f(0x1aa)),executeCommand(_0x2b4d8f(0x1f2),_0x502b80);let _0x290160;if(_0x57980c&&_0x57980c[_0x2b4d8f(0x225)]())_0x290160=_0x57980c[_0x2b4d8f(0x225)](),logInfo(_0x2b4d8f(0x224)+_0x290160);else{if(_0x5b0d66)_0x290160=_0x2b4d8f(0x1bb);else{const {commitMessage:_0x146de8}=await inquirer[_0x2b4d8f(0x211)]([{'type':_0x2b4d8f(0x237),'name':_0x2b4d8f(0x231),'message':_0x2b4d8f(0x1e6),'default':_0x2b4d8f(0x1bb)}]);_0x290160=_0x146de8['trim']()||_0x2b4d8f(0x1bb);}}try{logInfo(_0x2b4d8f(0x1b8)),executeCommand('git\x20commit\x20-m\x20\x22'+_0x290160+_0x2b4d8f(0x234),_0x502b80),logSuccess(_0x2b4d8f(0x219));}catch(_0x557cce){logWarning(_0x2b4d8f(0x23d));}logInfo(_0x2b4d8f(0x1c2)),executeCommand('git\x20push',_0x502b80),logSuccess(_0x2b4d8f(0x208)),setTimeout(()=>{const _0x4debff=_0x2b4d8f;logInfo(_0x4debff(0x1ed));const _0x3e807f=path[_0x4debff(0x1e0)](os['tmpdir'](),_0x4e01f1);if(fileExists(_0x3e807f))try{deleteFolderRecursive(_0x3e807f),logSuccess('临时工作目录已清理:\x20'+_0x4e01f1);}catch(_0x38a8b4){logWarning(_0x4debff(0x23b)+_0x38a8b4[_0x4debff(0x1e4)]);}},CONSTANTS[_0x2b4d8f(0x1eb)]*0x2);},CONSTANTS[_0x5dbde3(0x1eb)]);});});}else{logError(_0x511170(0x1ce));const _0x19a1ec=path[_0x511170(0x1e0)](os['tmpdir'](),_0x4e01f1);if(fileExists(_0x19a1ec))try{deleteFolderRecursive(_0x19a1ec),logInfo('临时工作目录已清理:\x20'+_0x4e01f1);}catch(_0x467947){logWarning('清理临时目录失败:\x20'+_0x467947['message']);}process[_0x511170(0x1b6)](0x1);}}};
1
+ const a6_0x25aaee=a6_0x494b;(function(_0x4d6b1,_0x5b98b5){const _0x39cc4e=a6_0x494b,_0x42a506=_0x4d6b1();while(!![]){try{const _0x1617a4=-parseInt(_0x39cc4e(0x131))/0x1*(-parseInt(_0x39cc4e(0xd0))/0x2)+parseInt(_0x39cc4e(0x15b))/0x3+-parseInt(_0x39cc4e(0xfe))/0x4+-parseInt(_0x39cc4e(0x142))/0x5+-parseInt(_0x39cc4e(0x138))/0x6+-parseInt(_0x39cc4e(0x140))/0x7+parseInt(_0x39cc4e(0x133))/0x8;if(_0x1617a4===_0x5b98b5)break;else _0x42a506['push'](_0x42a506['shift']());}catch(_0x311b8d){_0x42a506['push'](_0x42a506['shift']());}}}(a6_0x1a63,0xcac6d));function a6_0x1a63(){const _0xb19df1=['split','response','request','构建产物复制完成','配置文件中缺少必要字段:\x20','password','临时工作目录已创建','master','Git\x20仓库克隆完成','SYNC_DELAY','build','yarn','git\x20push','正在同步远程仓库...','2mesDDZ','push','BUILD_OUTPUT_DIR','post','项目构建完成','filter','已生成\x20','buildScript','正在安装项目依赖\x20(','代码推送完成','查询远程分支失败:\x20','项目依赖检查通过','./utils','npm\x20install','some','您选择的后端分支是:\x20','git\x20clone\x20','map','branch','目标分支\x20','catch','正在处理构建产物...','isArray','指定的打包命令不存在:\x20','resolve','查询到\x20','临时工作目录已清理:\x20','data','jjb.config.json\x20读取成功','清理临时目录失败:\x20','/api/auth','正在复制构建产物到目标目录...','):\x20','正在请求服务器授权...','javaGitName','prod','then','授权失败:\x20','tmpdir','message','项目构建失败:\x20','toLowerCase','sort','\x22\x20--no-verify','missingFields','parse','738128LyqnKO','exports','package.json\x20读取成功','正在准备临时工作目录...','请选择要执行的打包命令:','default','indexOf','main','正在加载认证信息...','exit',',确认推送到该分支吗?','DEFAULT_BRANCH','请输入提交信息:','正在查询后端仓库远程分支...','inquirer','正在清理临时工作目录...','请选择要推送的后端分支(务必核对,选错将发错版本):','请求失败\x20(','非交互模式必须指定后端分支,用法:\x20jjb-cmd\x20push\x20java\x20--build\x20<打包命令>\x20--target\x20<后端分支>','yarn\x20run\x20','分支名不能为空','.html','操作失败:\x20','分支切换完成','git\x20checkout\x20','includes','),请稍候...','toString','MAX_BUFFER_SIZE','prompt','input','检测到已存在的仓库,正在强制清理...','指定的后端分支不存在:\x20','yarn.lock','解析\x20package.json\x20失败:\x20','正在推送代码到远程仓库...','targetBranch','release','请输入要推送的后端分支名:','网络连接失败:\x20无法连接到服务器','无法查询远程分支(','git\x20pull','appIdentifier','./config','force','非交互模式必须指定打包命令,用法:\x20jjb-cmd\x20push\x20java\x20--build\x20<打包命令>\x20--target\x20<后端分支>','selectedScript','now','commitMessage','解析\x20jjb.config.json\x20失败:\x20','../.auth','1524101AJcwji','授权失败\x20(','18429616iKbCWO','项目依赖安装完成','服务器授权成功','代码提交成功','使用指定的提交信息:\x20','9706704igxPyG','trim','join','认证信息加载成功','可用的打包命令:\x20','execSync','develop','读取认证信息失败:\x20','10306492nlgoMA','index.html','3826015MroXrK','正在切换到目标分支:\x20','CONFIG_FILE_NAME','path','javaGit','npm\x20run\x20','keys','length','\x20存在,校验通过','未找到\x20jjb.config.json\x20文件','git\x20add\x20.','list','git\x20commit\x20-m\x20\x22','utf8','代码同步完成','正在克隆\x20Git\x20仓库...','replace','未知错误','index','TEMPLATES_PATH','正在检查项目配置文件...','⚠\x20请仔细核对所选后端分支,选错分支将导致发错版本,直接影响线上环境!','):\x20认证信息无效或无权限','scripts','child_process','3127935bvSLPS','正在创建模板目录...','isValid','dev','检测到未安装项目依赖','\x20个远程分支','no\x20message','status'];a6_0x1a63=function(){return _0xb19df1;};return a6_0x1a63();}const os=require('os'),path=require(a6_0x25aaee(0x145)),fs=require('fs'),child_process=require(a6_0x25aaee(0x15a)),inquirer=require(a6_0x25aaee(0x10c)),{CopyFolder,DeleteDirAllFile}=require(a6_0x25aaee(0xdc)),{GIT_TEMP_JAVA,getApiHost}=require(a6_0x25aaee(0x129)),axios=require('axios'),{CONSTANTS,logInfo,logSuccess,logWarning,logError,executeCommand,deleteFolderRecursive,fileExists,readFile,writeFile,createDir,isViteProject,validateConfig}=require(a6_0x25aaee(0xdc)),{loadAuth}=require('./crypto-utils');function getRemoteBranches(_0x1989e3){const _0x3de41b=a6_0x25aaee,_0x471abe=child_process[_0x3de41b(0x13d)]('git\x20ls-remote\x20--heads\x20'+_0x1989e3,{'encoding':_0x3de41b(0x14f)}),_0xc203a5=[_0x3de41b(0x16a),_0x3de41b(0x105),_0x3de41b(0x15e),_0x3de41b(0x13e),'test',_0x3de41b(0xf3),'production',_0x3de41b(0x123)];return _0x471abe[_0x3de41b(0x163)]('\x0a')['map'](_0x3811cb=>{const _0xcaf76d=_0x3de41b,_0x5bace1=_0x3811cb[_0xcaf76d(0x163)]('\x09')[0x1]||'';return _0x5bace1[_0xcaf76d(0x152)](/^refs\/heads\//,'')[_0xcaf76d(0x139)]();})[_0x3de41b(0xd5)](_0x44ecee=>_0x44ecee&&_0x44ecee!=='HEAD')[_0x3de41b(0xfa)]((_0x146823,_0x52c0ab)=>{const _0x543e77=_0x3de41b,_0x1701ee=_0xc203a5[_0x543e77(0x104)](_0x146823),_0x2d0349=_0xc203a5[_0x543e77(0x104)](_0x52c0ab);if(_0x1701ee!==-0x1&&_0x2d0349!==-0x1)return _0x1701ee-_0x2d0349;if(_0x1701ee!==-0x1)return-0x1;if(_0x2d0349!==-0x1)return 0x1;return _0x146823['localeCompare'](_0x52c0ab);});}function a6_0x494b(_0x2f3cc7,_0x2206cb){_0x2f3cc7=_0x2f3cc7-0xcb;const _0x1a63a1=a6_0x1a63();let _0x494b43=_0x1a63a1[_0x2f3cc7];return _0x494b43;}async function promptBranchInput(){const _0x4597cc=a6_0x25aaee,{branch:_0x5e9fcd}=await inquirer['prompt']([{'type':_0x4597cc(0x11c),'name':_0x4597cc(0xe2),'message':_0x4597cc(0x124),'default':CONSTANTS[_0x4597cc(0x109)],'validate':_0x8d603b=>_0x8d603b&&_0x8d603b[_0x4597cc(0x139)]()?!![]:_0x4597cc(0x112)}]);return(_0x5e9fcd||'')[_0x4597cc(0x139)]()||CONSTANTS[_0x4597cc(0x109)];}module[a6_0x25aaee(0xff)]=async _0x2d1864=>{const _0x55d199=a6_0x25aaee;(_0x2d1864==null||Array[_0x55d199(0xe6)](_0x2d1864))&&(_0x2d1864={});const _0x217cae=_0x2d1864[_0x55d199(0xd7)],_0x3e475f=_0x2d1864[_0x55d199(0x122)],_0x2043dd=_0x2d1864[_0x55d199(0xf7)],_0x11fc71=!!(_0x217cae||_0x3e475f||_0x2043dd);let _0x79d8db=null;const _0x2dbd76=path['join'](__dirname,_0x55d199(0x130));!fileExists(_0x2dbd76)&&(logError('未检测到认证信息,请先执行登录操作:\x20jjb-cmd\x20login'),process[_0x55d199(0x107)](0x1));let _0x26700b,_0xa0f679;try{logInfo(_0x55d199(0x106));const _0x266b2f=loadAuth(_0x2dbd76);_0x26700b=_0x266b2f['username'],_0xa0f679=_0x266b2f[_0x55d199(0x168)],logSuccess(_0x55d199(0x13b));}catch(_0x2be939){logError(_0x55d199(0x13f)+_0x2be939[_0x55d199(0xf7)]),process[_0x55d199(0x107)](0x1);}const _0x27a070=[];if(_0x2d1864[_0x55d199(0x12a)])_0x27a070[_0x55d199(0xd1)](_0x55d199(0x12a));if(_0x2d1864[_0x55d199(0x154)])_0x27a070[_0x55d199(0xd1)](_0x55d199(0x154));const _0x294ca0=path[_0x55d199(0xe8)]('./'),_0x1df65a=path['join'](_0x294ca0,'package.json'),_0x20507d=path['join'](_0x294ca0,CONSTANTS[_0x55d199(0x144)]),_0x1e5bc4=path[_0x55d199(0x13a)](_0x294ca0,CONSTANTS[_0x55d199(0xd2)]),_0x3ea63e=os[_0x55d199(0xf6)](),_0x16edd6=fileExists(path['join'](_0x294ca0,_0x55d199(0x11f)))?'yarn':'npm',_0x731a34=_0x16edd6===_0x55d199(0xcd)?'yarn':_0x55d199(0xdd),_0x47dff0=_0x1be924=>_0x16edd6===_0x55d199(0xcd)?_0x55d199(0x111)+_0x1be924:_0x55d199(0x147)+_0x1be924;logInfo('正在检查项目配置文件...');!fileExists(_0x1df65a)&&(logError('未找到\x20package.json\x20文件'),process[_0x55d199(0x107)](0x1));let _0x592786;try{_0x592786=JSON[_0x55d199(0xfd)](fs['readFileSync'](_0x1df65a,'utf8')),logSuccess(_0x55d199(0x100));}catch(_0x1b0bd2){logError(_0x55d199(0x120)+_0x1b0bd2[_0x55d199(0xf7)]),process[_0x55d199(0x107)](0x1);}const _0x52bdba=_0x592786[_0x55d199(0x159)]||{},_0x17e45b=[_0x55d199(0xcc)],_0x129a70=Object[_0x55d199(0x148)](_0x52bdba)[_0x55d199(0xd5)](_0x222419=>{const _0x4e17d1=_0x55d199;return _0x17e45b[_0x4e17d1(0xde)](_0x3134d9=>_0x222419[_0x4e17d1(0xf9)]()[_0x4e17d1(0x117)](_0x3134d9));});_0x129a70[_0x55d199(0x149)]===0x0&&(logError('未找到打包相关的命令,请检查\x20package.json\x20中的\x20scripts\x20配置'),process['exit'](0x1));let _0x35ee84;if(_0x217cae)_0x52bdba[_0x217cae]?_0x35ee84=_0x217cae:(logError(_0x55d199(0xe7)+_0x217cae),logError(_0x55d199(0x13c)+_0x129a70[_0x55d199(0x13a)](',\x20')),process[_0x55d199(0x107)](0x1));else{if(_0x11fc71)logError(_0x55d199(0x12b)),process[_0x55d199(0x107)](0x1);else{const _0x15526d=await inquirer[_0x55d199(0x11b)]([{'type':_0x55d199(0x14d),'name':_0x55d199(0x12c),'message':_0x55d199(0x102),'choices':_0x129a70[_0x55d199(0xe1)](_0x25560d=>({'name':_0x25560d+'\x20('+_0x52bdba[_0x25560d]+')','value':_0x25560d}))}]);_0x35ee84=_0x15526d[_0x55d199(0x12c)];}}logInfo('已选择打包命令:\x20'+_0x35ee84),logInfo(_0x55d199(0x156));!fileExists(_0x20507d)&&(logError(_0x55d199(0x14b)),process['exit'](0x1));let _0x64f0bf;try{_0x64f0bf=require(_0x20507d),_0x64f0bf=_0x64f0bf['__esModule']?_0x64f0bf[_0x55d199(0x103)]:_0x64f0bf,logSuccess(_0x55d199(0xec));}catch(_0x30a76b){logError(_0x55d199(0x12f)+_0x30a76b['message']),process['exit'](0x1);}const _0x141376=[_0x55d199(0x146),_0x55d199(0xf2),_0x55d199(0x128)],_0x5c6697=validateConfig(_0x64f0bf,_0x141376);!_0x5c6697[_0x55d199(0x15d)]&&(logError(_0x55d199(0x167)+_0x5c6697[_0x55d199(0xfc)][_0x55d199(0x13a)](',\x20')),process[_0x55d199(0x107)](0x1));let _0x3276d8=null;if(_0x3e475f){logInfo('正在查询后端仓库远程分支,校验目标分支...');try{const _0x256fdd=getRemoteBranches(_0x64f0bf[_0x55d199(0x146)]);_0x256fdd[_0x55d199(0x149)]>0x0&&!_0x256fdd['includes'](_0x3e475f)&&(logError(_0x55d199(0x11e)+_0x3e475f),logError('当前远程分支:\x20'+_0x256fdd[_0x55d199(0x13a)](',\x20')),process[_0x55d199(0x107)](0x1)),logSuccess(_0x55d199(0xe3)+_0x3e475f+_0x55d199(0x14a));}catch(_0x493196){logWarning(_0x55d199(0x126)+_0x493196[_0x55d199(0xf7)]+'),将直接尝试切换到\x20'+_0x3e475f);}_0x3276d8=_0x3e475f;}else{if(_0x11fc71)logError(_0x55d199(0x110)),process[_0x55d199(0x107)](0x1);else{logWarning(_0x55d199(0x157));let _0x3597c8=[];try{logInfo(_0x55d199(0x10b)),_0x3597c8=getRemoteBranches(_0x64f0bf[_0x55d199(0x146)]),_0x3597c8['length']>0x0?logSuccess(_0x55d199(0xe9)+_0x3597c8[_0x55d199(0x149)]+_0x55d199(0x160)):logWarning('未查询到远程分支,请手动输入分支名');}catch(_0x31803b){logWarning(_0x55d199(0xda)+_0x31803b[_0x55d199(0xf7)]);}while(!_0x3276d8){let _0x247709;if(_0x3597c8[_0x55d199(0x149)]>0x0){const {targetBranch:_0x5a2b61}=await inquirer[_0x55d199(0x11b)]([{'type':_0x55d199(0x14d),'name':'targetBranch','message':_0x55d199(0x10e),'pageSize':0xf,'choices':_0x3597c8}]);_0x247709=_0x5a2b61;}else _0x247709=await promptBranchInput();const {confirmed:_0x206762}=await inquirer['prompt']([{'type':'confirm','name':'confirmed','message':_0x55d199(0xdf)+_0x247709+_0x55d199(0x108),'default':![]}]);_0x206762?_0x3276d8=_0x247709:logWarning('已取消选择,请重新选择后端分支');}}}logInfo('已选择后端分支:\x20'+_0x3276d8),logInfo(_0x55d199(0xf1)),axios[_0x55d199(0xd3)](getApiHost()+_0x55d199(0xee),{'username':_0x26700b,'password':_0xa0f679})[_0x55d199(0xf4)](async _0x294e14=>{const _0x5c19e6=_0x55d199;if(_0x294e14['data'][_0x5c19e6(0x162)]){logSuccess(_0x5c19e6(0x135));const _0x595195=GIT_TEMP_JAVA+'-'+Date[_0x5c19e6(0x12d)]()+'-'+Math['random']()[_0x5c19e6(0x119)](0x24)['substr'](0x2,0x9);_0x79d8db=_0x595195;const _0x4da379=path['join'](_0x3ea63e,_0x595195);logInfo(_0x5c19e6(0x101));fileExists(_0x4da379)&&deleteFolderRecursive(_0x4da379);createDir(_0x4da379),logSuccess(_0x5c19e6(0x169));const _0x5d735f=path[_0x5c19e6(0x13a)](_0x4da379,_0x64f0bf[_0x5c19e6(0xf2)]);logInfo(_0x5c19e6(0x151)),fileExists(_0x5d735f)?_0x27a070[_0x5c19e6(0x117)](_0x5c19e6(0x12a))?(logInfo(_0x5c19e6(0x11d)),DeleteDirAllFile(_0x5d735f,()=>{const _0x32ecd8=_0x5c19e6;executeCommand(_0x32ecd8(0xe0)+_0x64f0bf[_0x32ecd8(0x146)],_0x4da379),logSuccess(_0x32ecd8(0x16b));})):(executeCommand(_0x5c19e6(0xe0)+_0x64f0bf[_0x5c19e6(0x146)],_0x4da379),logSuccess(_0x5c19e6(0x16b))):(executeCommand(_0x5c19e6(0xe0)+_0x64f0bf[_0x5c19e6(0x146)],_0x4da379),logSuccess(_0x5c19e6(0x16b))),_0x2d39a1(_0x4da379,_0x64f0bf,_0x595195,_0x35ee84,_0x3276d8);}else logError(_0x5c19e6(0xf5)+(_0x294e14[_0x5c19e6(0xeb)][_0x5c19e6(0xf7)]||_0x5c19e6(0x153))),process[_0x5c19e6(0x107)](0x1);})[_0x55d199(0xe4)](_0x30cfa8=>{const _0x3a5d90=_0x55d199;if(_0x30cfa8&&_0x30cfa8[_0x3a5d90(0x164)]){const _0x20deaa=_0x30cfa8[_0x3a5d90(0x164)][_0x3a5d90(0x162)];_0x20deaa===0x191||_0x20deaa===0x193?logError(_0x3a5d90(0x132)+_0x20deaa+_0x3a5d90(0x158)):logError(_0x3a5d90(0x10f)+_0x20deaa+_0x3a5d90(0xf0)+(_0x30cfa8[_0x3a5d90(0x164)][_0x3a5d90(0xeb)]?.[_0x3a5d90(0xf7)]||_0x30cfa8[_0x3a5d90(0xf7)]));}else _0x30cfa8&&_0x30cfa8[_0x3a5d90(0x165)]?logError(_0x3a5d90(0x125)):logError(_0x3a5d90(0x114)+(_0x30cfa8['message']||_0x3a5d90(0x153)));process[_0x3a5d90(0x107)](0x1);}),process['on'](_0x55d199(0x107),()=>{const _0x295569=_0x55d199;if(_0x79d8db){const _0x31d01b=path['join'](os[_0x295569(0xf6)](),_0x79d8db);if(fileExists(_0x31d01b))try{deleteFolderRecursive(_0x31d01b);}catch(_0x378727){}}}),process['on']('uncaughtException',_0xb90e99=>{const _0x41a755=_0x55d199;if(_0x79d8db){const _0x159c61=path[_0x41a755(0x13a)](os[_0x41a755(0xf6)](),_0x79d8db);if(fileExists(_0x159c61))try{deleteFolderRecursive(_0x159c61);}catch(_0x195418){}}throw _0xb90e99;});function _0x2d39a1(_0x95e641,_0x1fd04c,_0x12f433,_0x14d20e,_0x362521){const _0x23be53=_0x55d199,_0x3118ca=path['join'](_0x95e641,_0x1fd04c['javaGitName']);logInfo(_0x23be53(0x143)+_0x362521),executeCommand(_0x23be53(0x116)+_0x362521,_0x3118ca),logSuccess(_0x23be53(0x115)),logInfo('正在同步\x20Git\x20仓库最新代码...'),executeCommand(_0x23be53(0x127),_0x3118ca),logSuccess(_0x23be53(0x150));!fileExists(path[_0x23be53(0x13a)](_0x294ca0,'node_modules'))?(logWarning(_0x23be53(0x15f)),logInfo(_0x23be53(0xd8)+_0x16edd6+_0x23be53(0x118)),executeCommand(_0x731a34,_0x294ca0),logSuccess(_0x23be53(0x134))):logInfo(_0x23be53(0xdb));try{logInfo('正在执行构建命令:\x20'+_0x47dff0(_0x14d20e)),executeCommand(_0x47dff0(_0x14d20e),_0x294ca0,{'maxBuffer':CONSTANTS[_0x23be53(0x11a)]}),logSuccess(_0x23be53(0xd4));}catch(_0x2d6437){logError(_0x23be53(0xf8)+_0x2d6437['message']);const _0x480a23=path[_0x23be53(0x13a)](os[_0x23be53(0xf6)](),_0x12f433);if(fileExists(_0x480a23))try{deleteFolderRecursive(_0x480a23),logInfo('临时工作目录已清理:\x20'+_0x12f433);}catch(_0x517b8f){logWarning(_0x23be53(0xed)+_0x517b8f[_0x23be53(0xf7)]);}process[_0x23be53(0x107)](0x1);}if(fileExists(_0x1e5bc4)){logInfo(_0x23be53(0xe5));const _0x111310=_0x1fd04c[_0x23be53(0x128)],_0x39fbd0=readFile(path[_0x23be53(0x13a)](_0x1e5bc4,_0x23be53(0x141)));_0x27a070[_0x23be53(0x117)](_0x23be53(0x154))?(writeFile(path[_0x23be53(0x13a)](_0x1e5bc4,'index.html'),_0x39fbd0),logInfo('已生成\x20index.html\x20文件')):(writeFile(path[_0x23be53(0x13a)](_0x1e5bc4,_0x111310+_0x23be53(0x113)),_0x39fbd0),logInfo(_0x23be53(0xd6)+_0x111310+'.html\x20文件'));const _0x41d9ed=path[_0x23be53(0x13a)](_0x3118ca,CONSTANTS[_0x23be53(0x155)]);logInfo(_0x23be53(0x15c)),createDir(_0x41d9ed);const _0x3977be=path[_0x23be53(0x13a)](_0x41d9ed,_0x1fd04c[_0x23be53(0x128)]);logInfo('正在清理目标目录...'),DeleteDirAllFile(_0x3977be,()=>{const _0x88d0ad=_0x23be53;createDir(_0x3977be),logInfo(_0x88d0ad(0xef)),writeFile(path[_0x88d0ad(0x13a)](_0x41d9ed,_0x111310+'.html'),_0x39fbd0),CopyFolder(path[_0x88d0ad(0x13a)](_0x1e5bc4,_0x1fd04c['appIdentifier']),_0x3977be,async()=>{const _0x20882c=_0x88d0ad;logSuccess(_0x20882c(0x166)),setTimeout(async()=>{const _0x3ae56a=_0x20882c;logInfo(_0x3ae56a(0xcf)),executeCommand(_0x3ae56a(0x127),_0x3118ca),logInfo('正在添加文件变更...'),executeCommand(_0x3ae56a(0x14c),_0x3118ca);let _0x1ebc35;if(_0x2043dd&&_0x2043dd['trim']())_0x1ebc35=_0x2043dd[_0x3ae56a(0x139)](),logInfo(_0x3ae56a(0x137)+_0x1ebc35);else{if(_0x11fc71)_0x1ebc35=_0x3ae56a(0x161);else{const {commitMessage:_0x1a697a}=await inquirer['prompt']([{'type':_0x3ae56a(0x11c),'name':_0x3ae56a(0x12e),'message':_0x3ae56a(0x10a),'default':_0x3ae56a(0x161)}]);_0x1ebc35=_0x1a697a['trim']()||_0x3ae56a(0x161);}}try{logInfo('正在提交代码变更...'),executeCommand(_0x3ae56a(0x14e)+_0x1ebc35+_0x3ae56a(0xfb),_0x3118ca),logSuccess(_0x3ae56a(0x136));}catch(_0x590ebc){logWarning('代码提交跳过:\x20没有需要提交的变更');}logInfo(_0x3ae56a(0x121)),executeCommand(_0x3ae56a(0xce),_0x3118ca),logSuccess(_0x3ae56a(0xd9)),setTimeout(()=>{const _0x2c3679=_0x3ae56a;logInfo(_0x2c3679(0x10d));const _0x4804f1=path['join'](os['tmpdir'](),_0x12f433);if(fileExists(_0x4804f1))try{deleteFolderRecursive(_0x4804f1),logSuccess(_0x2c3679(0xea)+_0x12f433);}catch(_0x2fa289){logWarning(_0x2c3679(0xed)+_0x2fa289[_0x2c3679(0xf7)]);}},CONSTANTS[_0x3ae56a(0xcb)]*0x2);},CONSTANTS[_0x20882c(0xcb)]);});});}else{logError('构建产物目录不存在,请检查构建输出配置');const _0x17dbaa=path[_0x23be53(0x13a)](os['tmpdir'](),_0x12f433);if(fileExists(_0x17dbaa))try{deleteFolderRecursive(_0x17dbaa),logInfo('临时工作目录已清理:\x20'+_0x12f433);}catch(_0x5b91df){logWarning(_0x23be53(0xed)+_0x5b91df[_0x23be53(0xf7)]);}process[_0x23be53(0x107)](0x1);}}};
package/src/utils.js CHANGED
@@ -1 +1 @@
1
- function a7_0x25d4(){const _0x3c75ff=['rmdirSync','461331rvdhaj','232EdfzUA','close','jjb.config.js','788501aOXBRC','vite.config.mjs','exports','mkdir','writeFileSync','1zbfeLd','6sElmLr','readdirSync','join','文件复制失败:\x20','[工作目录:\x20','unlinkSync','log','7173VQScMQ','red','green','创建目录失败:\x20','createWriteStream','message','102932ciMiAV','filter','3355MevwXk','dirname','mkdirSync','15bSynTF','error','readdir','readFileSync','vite.config.js','240FUFRaL','length','forEach','blue','statSync','176631bowiRg','pipe','child_process','execSync','isDirectory','path','执行命令:\x20','5650AtcdSU','314476nKwoFf','existsSync','vite.config.ts','stat','start/src/main/resources/templates','utf8'];a7_0x25d4=function(){return _0x3c75ff;};return a7_0x25d4();}const a7_0x213057=a7_0x142f;function a7_0x142f(_0x913f54,_0x19557a){_0x913f54=_0x913f54-0x1e9;const _0x25d4b0=a7_0x25d4();let _0x142f0a=_0x25d4b0[_0x913f54];return _0x142f0a;}(function(_0x597c97,_0x150428){const _0x99012=a7_0x142f,_0x2bc7ad=_0x597c97();while(!![]){try{const _0x131089=-parseInt(_0x99012(0x217))/0x1*(parseInt(_0x99012(0x207))/0x2)+parseInt(_0x99012(0x20e))/0x3+parseInt(_0x99012(0x1f0))/0x4*(parseInt(_0x99012(0x1f5))/0x5)+-parseInt(_0x99012(0x218))/0x6*(-parseInt(_0x99012(0x212))/0x7)+parseInt(_0x99012(0x20f))/0x8*(parseInt(_0x99012(0x1ea))/0x9)+-parseInt(_0x99012(0x206))/0xa*(-parseInt(_0x99012(0x1f2))/0xb)+parseInt(_0x99012(0x1fa))/0xc*(-parseInt(_0x99012(0x1ff))/0xd);if(_0x131089===_0x150428)break;else _0x2bc7ad['push'](_0x2bc7ad['shift']());}catch(_0x1a51cf){_0x2bc7ad['push'](_0x2bc7ad['shift']());}}}(a7_0x25d4,0x1adff));const fs=require('fs'),path=require(a7_0x213057(0x204)),child_process=require(a7_0x213057(0x201)),chalk=require('chalk'),CONSTANTS={'MAX_BUFFER_SIZE':0x3b9aca00,'SYNC_DELAY':0x3e8,'DEFAULT_BRANCH':'master','CONFIG_FILE_NAME':a7_0x213057(0x211),'BUILD_OUTPUT_DIR':'dist','TEMPLATES_PATH':a7_0x213057(0x20b)};function logInfo(_0x3dc9f3,_0x35c5c4=''){const _0x3fa100=a7_0x213057,_0x1c4a69=chalk[_0x3fa100(0x1fd)]('ℹ'),_0xd9e605=_0x35c5c4?_0x1c4a69+'\x20'+_0x3dc9f3+'\x20'+_0x35c5c4:_0x1c4a69+'\x20'+_0x3dc9f3;console['log'](_0xd9e605);}function logSuccess(_0x53e89c){const _0x5b4981=a7_0x213057;console[_0x5b4981(0x1e9)](chalk[_0x5b4981(0x1ec)]('✓\x20'+_0x53e89c));}function logWarning(_0x18fb41){console['log'](chalk['yellow']('⚠\x20'+_0x18fb41));}function logError(_0x50ce6c){const _0x5c0665=a7_0x213057;console[_0x5c0665(0x1e9)](chalk[_0x5c0665(0x1eb)]('✗\x20'+_0x50ce6c));}function executeCommand(_0x5c3487,_0xe67975,_0x3f3804={}){const _0x1eba09=a7_0x213057;return logInfo(_0x1eba09(0x205)+_0x5c3487,_0xe67975?_0x1eba09(0x21c)+_0xe67975+']':''),child_process[_0x1eba09(0x202)](_0x5c3487,{'cwd':_0xe67975,..._0x3f3804});}function deleteFolderRecursive(_0x40d48b){const _0x2485e2=a7_0x213057;fs['existsSync'](_0x40d48b)&&(fs[_0x2485e2(0x219)](_0x40d48b)[_0x2485e2(0x1fc)](_0x2948a4=>{const _0x33c989=_0x2485e2,_0x53075d=path[_0x33c989(0x21a)](_0x40d48b,_0x2948a4);fs['lstatSync'](_0x53075d)[_0x33c989(0x203)]()?deleteFolderRecursive(_0x53075d):fs[_0x33c989(0x21d)](_0x53075d);}),fs['rmdirSync'](_0x40d48b));}function fileExists(_0x444e7d){const _0x472be4=a7_0x213057;return fs[_0x472be4(0x208)](_0x444e7d);}function readFile(_0x174a0f,_0x18b556=a7_0x213057(0x20c)){const _0x279d7b=a7_0x213057;return fs[_0x279d7b(0x1f8)](_0x174a0f,_0x18b556);}function writeFile(_0x4fcc82,_0x1f0e6b,_0x19b0ef=a7_0x213057(0x20c)){const _0x2d206e=a7_0x213057;fs[_0x2d206e(0x216)](_0x4fcc82,_0x1f0e6b,_0x19b0ef);}function createDir(_0x2638b6){const _0x2b20af=a7_0x213057;!fs[_0x2b20af(0x208)](_0x2638b6)&&fs[_0x2b20af(0x1f4)](_0x2638b6,{'recursive':!![]});}function isViteProject(_0x45a830){const _0x705736=a7_0x213057;return fileExists(path[_0x705736(0x21a)](_0x45a830,_0x705736(0x1f9)))||fileExists(path[_0x705736(0x21a)](_0x45a830,_0x705736(0x209)))||fileExists(path[_0x705736(0x21a)](_0x45a830,_0x705736(0x213)));}function validateConfig(_0x59e5cc,_0x3755c8){const _0x2a5b6c=a7_0x213057,_0x32f7ef=_0x3755c8[_0x2a5b6c(0x1f1)](_0x39b4d5=>!_0x59e5cc[_0x39b4d5]);return{'isValid':_0x32f7ef[_0x2a5b6c(0x1fb)]===0x0,'missingFields':_0x32f7ef};}function DeleteDirAllFile(_0x4da6fc,_0x322a15){const _0x3c547d=a7_0x213057;let _0x3be0e2=[];fs[_0x3c547d(0x208)](_0x4da6fc)?(_0x3be0e2=fs[_0x3c547d(0x219)](_0x4da6fc),_0x3be0e2[_0x3c547d(0x1fc)](function(_0x6d59f5,_0x16a5ec){const _0x3d6bea=_0x3c547d;let _0x39eacf=path[_0x3d6bea(0x21a)](_0x4da6fc,_0x6d59f5);fs[_0x3d6bea(0x1fe)](_0x39eacf)[_0x3d6bea(0x203)]()?DeleteDirAllFile(_0x39eacf):fs['unlinkSync'](_0x39eacf);}),fs[_0x3c547d(0x20d)](_0x4da6fc),_0x322a15&&_0x322a15()):_0x322a15&&_0x322a15();}function CopyFile(_0x57e175,_0x4944d8,_0x46189a){const _0x442673=a7_0x213057,_0x27a8e1=path[_0x442673(0x1f3)](_0x4944d8);!fs[_0x442673(0x208)](_0x27a8e1)&&fs['mkdirSync'](_0x27a8e1,{'recursive':!![]});const _0x3b2340=fs['createReadStream'](_0x57e175),_0x4bfcef=fs[_0x442673(0x1ee)](_0x4944d8);_0x3b2340[_0x442673(0x200)](_0x4bfcef),_0x4bfcef['on']('close',function(){_0x46189a&&_0x46189a();}),_0x4bfcef['on'](_0x442673(0x1f6),function(_0x3410e3){const _0x5dd46b=_0x442673;logError(_0x5dd46b(0x21b)+_0x3410e3[_0x5dd46b(0x1ef)]),_0x46189a&&_0x46189a();});}function CopyFolder(_0x3c47e5,_0x268bc6,_0x3ff6bb){const _0x1712ed=a7_0x213057;!fs['existsSync'](_0x268bc6)&&fs[_0x1712ed(0x1f4)](_0x268bc6,{'recursive':!![]}),fs[_0x1712ed(0x1f7)](_0x3c47e5,function(_0x1643b0,_0x4201fa){const _0x4098df=_0x1712ed;let _0x54a453=0x0;const _0x5f488f=function(){++_0x54a453===_0x4201fa['length']&&_0x3ff6bb&&_0x3ff6bb();};if(_0x1643b0){_0x5f488f();return;}_0x4201fa[_0x4098df(0x1fc)](function(_0x112630){const _0x42f015=_0x4098df,_0x14731c=path[_0x42f015(0x21a)](_0x3c47e5,_0x112630),_0x106e0a=path['join'](_0x268bc6,_0x112630);fs[_0x42f015(0x20a)](_0x14731c,function(_0x3d6b23,_0x376134){const _0x34d5ec=_0x42f015;if(_0x376134[_0x34d5ec(0x203)]())fs[_0x34d5ec(0x215)](_0x106e0a,{'recursive':!![]},function(_0x12378f){const _0x10a472=_0x34d5ec;if(_0x12378f){logError(_0x10a472(0x1ed)+_0x12378f[_0x10a472(0x1ef)]);return;}CopyFolder(_0x14731c,_0x106e0a,_0x5f488f);});else{const _0x5b0d2b=fs['createReadStream'](_0x14731c),_0x49803f=fs[_0x34d5ec(0x1ee)](_0x106e0a);_0x5b0d2b[_0x34d5ec(0x200)](_0x49803f),_0x49803f['on'](_0x34d5ec(0x210),_0x5f488f),_0x49803f['on']('error',_0x5f488f);}});}),_0x4201fa['length']===0x0&&_0x3ff6bb&&_0x3ff6bb();});}module[a7_0x213057(0x214)]={'CONSTANTS':CONSTANTS,'logInfo':logInfo,'logSuccess':logSuccess,'logWarning':logWarning,'logError':logError,'executeCommand':executeCommand,'deleteFolderRecursive':deleteFolderRecursive,'fileExists':fileExists,'readFile':readFile,'writeFile':writeFile,'createDir':createDir,'isViteProject':isViteProject,'validateConfig':validateConfig,'DeleteDirAllFile':DeleteDirAllFile,'CopyFile':CopyFile,'CopyFolder':CopyFolder};
1
+ const a7_0xa07990=a7_0x5cce;(function(_0x2b34bd,_0xf8d293){const _0x42e64e=a7_0x5cce,_0x1b13e6=_0x2b34bd();while(!![]){try{const _0x10ce4f=parseInt(_0x42e64e(0x186))/0x1+-parseInt(_0x42e64e(0x19a))/0x2+-parseInt(_0x42e64e(0x195))/0x3+parseInt(_0x42e64e(0x19d))/0x4*(-parseInt(_0x42e64e(0x17a))/0x5)+-parseInt(_0x42e64e(0x19b))/0x6*(-parseInt(_0x42e64e(0x180))/0x7)+-parseInt(_0x42e64e(0x19c))/0x8*(-parseInt(_0x42e64e(0x192))/0x9)+parseInt(_0x42e64e(0x188))/0xa*(parseInt(_0x42e64e(0x191))/0xb);if(_0x10ce4f===_0xf8d293)break;else _0x1b13e6['push'](_0x1b13e6['shift']());}catch(_0x1d10ed){_0x1b13e6['push'](_0x1b13e6['shift']());}}}(a7_0x729f,0x347fd));const fs=require('fs'),path=require(a7_0xa07990(0x196)),child_process=require(a7_0xa07990(0x17c)),chalk=require(a7_0xa07990(0x1ac)),CONSTANTS={'MAX_BUFFER_SIZE':0x3b9aca00,'SYNC_DELAY':0x3e8,'DEFAULT_BRANCH':a7_0xa07990(0x18b),'CONFIG_FILE_NAME':a7_0xa07990(0x1aa),'BUILD_OUTPUT_DIR':a7_0xa07990(0x194),'TEMPLATES_PATH':a7_0xa07990(0x185)};function logInfo(_0x578e4b,_0x313481=''){const _0x3798ca=a7_0xa07990,_0x29aae4=chalk[_0x3798ca(0x17e)]('ℹ'),_0x5582dc=_0x313481?_0x29aae4+'\x20'+_0x578e4b+'\x20'+_0x313481:_0x29aae4+'\x20'+_0x578e4b;console[_0x3798ca(0x1a1)](_0x5582dc);}function a7_0x5cce(_0x2687b2,_0x5a1b2d){_0x2687b2=_0x2687b2-0x17a;const _0x729f6e=a7_0x729f();let _0x5cce65=_0x729f6e[_0x2687b2];return _0x5cce65;}function logSuccess(_0x59ce4e){const _0x30d57a=a7_0xa07990;console[_0x30d57a(0x1a1)](chalk[_0x30d57a(0x190)]('✓\x20'+_0x59ce4e));}function logWarning(_0x2e320e){const _0xab4429=a7_0xa07990;console[_0xab4429(0x1a1)](chalk[_0xab4429(0x187)]('⚠\x20'+_0x2e320e));}function logError(_0x40e766){const _0x4088fa=a7_0xa07990;console[_0x4088fa(0x1a1)](chalk[_0x4088fa(0x18d)]('✗\x20'+_0x40e766));}function executeCommand(_0x472fc1,_0x42d6f5,_0x3c39ec={}){const _0x52f92d=a7_0xa07990;return logInfo(_0x52f92d(0x19f)+_0x472fc1,_0x42d6f5?_0x52f92d(0x19e)+_0x42d6f5+']':''),child_process[_0x52f92d(0x1a0)](_0x472fc1,{'cwd':_0x42d6f5,..._0x3c39ec});}function deleteFolderRecursive(_0x586af3){const _0x3599e5=a7_0xa07990;fs[_0x3599e5(0x1a5)](_0x586af3)&&(fs['readdirSync'](_0x586af3)['forEach'](_0x22757f=>{const _0x5c1ac4=_0x3599e5,_0x3febba=path[_0x5c1ac4(0x184)](_0x586af3,_0x22757f);fs[_0x5c1ac4(0x182)](_0x3febba)['isDirectory']()?deleteFolderRecursive(_0x3febba):fs[_0x5c1ac4(0x17f)](_0x3febba);}),fs[_0x3599e5(0x18a)](_0x586af3));}function fileExists(_0x2532d5){const _0x888227=a7_0xa07990;return fs[_0x888227(0x1a5)](_0x2532d5);}function readFile(_0x1f8728,_0xa98171=a7_0xa07990(0x1ab)){const _0x250af9=a7_0xa07990;return fs[_0x250af9(0x189)](_0x1f8728,_0xa98171);}function writeFile(_0xc13324,_0x346c47,_0x540f40=a7_0xa07990(0x1ab)){fs['writeFileSync'](_0xc13324,_0x346c47,_0x540f40);}function createDir(_0x4b1e6c){!fs['existsSync'](_0x4b1e6c)&&fs['mkdirSync'](_0x4b1e6c,{'recursive':!![]});}function isViteProject(_0x1c3308){const _0x2f4b81=a7_0xa07990;return fileExists(path[_0x2f4b81(0x184)](_0x1c3308,'vite.config.js'))||fileExists(path[_0x2f4b81(0x184)](_0x1c3308,_0x2f4b81(0x1ae)))||fileExists(path['join'](_0x1c3308,'vite.config.mjs'));}function validateConfig(_0x5154aa,_0x457f08){const _0x350ee3=a7_0xa07990,_0xc48e49=_0x457f08[_0x350ee3(0x199)](_0x1d9fdc=>!_0x5154aa[_0x1d9fdc]);return{'isValid':_0xc48e49[_0x350ee3(0x1ad)]===0x0,'missingFields':_0xc48e49};}function a7_0x729f(){const _0x5b08d9=['child_process','readdir','blue','unlinkSync','18095bhzAFK','close','lstatSync','stat','join','start/src/main/resources/templates','401579WWUcrQ','yellow','30OIgkzc','readFileSync','rmdirSync','master','createWriteStream','red','pipe','isDirectory','green','628364AsvlcY','3371859kGQtlM','statSync','dist','635820onegYm','path','forEach','exports','filter','844618DSqpRx','726ErzdsR','8MSACdx','1644404rLLSmV','[工作目录:\x20','执行命令:\x20','execSync','log','dirname','error','mkdirSync','existsSync','创建目录失败:\x20','mkdir','文件复制失败:\x20','message','jjb.config.js','utf8','chalk','length','vite.config.ts','readdirSync','5ohOFah','createReadStream'];a7_0x729f=function(){return _0x5b08d9;};return a7_0x729f();}function DeleteDirAllFile(_0x59181e,_0x446759){const _0x1a1c48=a7_0xa07990;let _0x1cced7=[];fs[_0x1a1c48(0x1a5)](_0x59181e)?(_0x1cced7=fs[_0x1a1c48(0x1af)](_0x59181e),_0x1cced7[_0x1a1c48(0x197)](function(_0xf7e9c8,_0x5223c0){const _0x1e0d25=_0x1a1c48;let _0x44a7df=path[_0x1e0d25(0x184)](_0x59181e,_0xf7e9c8);fs[_0x1e0d25(0x193)](_0x44a7df)[_0x1e0d25(0x18f)]()?DeleteDirAllFile(_0x44a7df):fs['unlinkSync'](_0x44a7df);}),fs[_0x1a1c48(0x18a)](_0x59181e),_0x446759&&_0x446759()):_0x446759&&_0x446759();}function CopyFile(_0x25e1f7,_0x51f0bf,_0x185675){const _0x1e55c5=a7_0xa07990,_0xb15bd0=path[_0x1e55c5(0x1a2)](_0x51f0bf);!fs['existsSync'](_0xb15bd0)&&fs[_0x1e55c5(0x1a4)](_0xb15bd0,{'recursive':!![]});const _0x4b3a37=fs[_0x1e55c5(0x17b)](_0x25e1f7),_0x4160f4=fs['createWriteStream'](_0x51f0bf);_0x4b3a37[_0x1e55c5(0x18e)](_0x4160f4),_0x4160f4['on'](_0x1e55c5(0x181),function(){_0x185675&&_0x185675();}),_0x4160f4['on'](_0x1e55c5(0x1a3),function(_0x21a9fa){const _0x49ccaf=_0x1e55c5;logError(_0x49ccaf(0x1a8)+_0x21a9fa[_0x49ccaf(0x1a9)]),_0x185675&&_0x185675();});}function CopyFolder(_0x542818,_0xd1f229,_0x36757f){const _0x21949b=a7_0xa07990;!fs[_0x21949b(0x1a5)](_0xd1f229)&&fs[_0x21949b(0x1a4)](_0xd1f229,{'recursive':!![]}),fs[_0x21949b(0x17d)](_0x542818,function(_0x128824,_0x20df6c){const _0x3296b3=_0x21949b;let _0x560549=0x0;const _0x29c105=function(){const _0x404183=a7_0x5cce;++_0x560549===_0x20df6c[_0x404183(0x1ad)]&&_0x36757f&&_0x36757f();};if(_0x128824){_0x29c105();return;}_0x20df6c['forEach'](function(_0x49a5db){const _0x3e03c1=a7_0x5cce,_0x30230c=path[_0x3e03c1(0x184)](_0x542818,_0x49a5db),_0x5cef48=path[_0x3e03c1(0x184)](_0xd1f229,_0x49a5db);fs[_0x3e03c1(0x183)](_0x30230c,function(_0x3747f8,_0x21ca8d){const _0x3b6d03=_0x3e03c1;if(_0x21ca8d[_0x3b6d03(0x18f)]())fs[_0x3b6d03(0x1a7)](_0x5cef48,{'recursive':!![]},function(_0x5225d8){const _0x1243f9=_0x3b6d03;if(_0x5225d8){logError(_0x1243f9(0x1a6)+_0x5225d8[_0x1243f9(0x1a9)]);return;}CopyFolder(_0x30230c,_0x5cef48,_0x29c105);});else{const _0x41613b=fs[_0x3b6d03(0x17b)](_0x30230c),_0x59313f=fs[_0x3b6d03(0x18c)](_0x5cef48);_0x41613b[_0x3b6d03(0x18e)](_0x59313f),_0x59313f['on'](_0x3b6d03(0x181),_0x29c105),_0x59313f['on'](_0x3b6d03(0x1a3),_0x29c105);}});}),_0x20df6c[_0x3296b3(0x1ad)]===0x0&&_0x36757f&&_0x36757f();});}module[a7_0xa07990(0x198)]={'CONSTANTS':CONSTANTS,'logInfo':logInfo,'logSuccess':logSuccess,'logWarning':logWarning,'logError':logError,'executeCommand':executeCommand,'deleteFolderRecursive':deleteFolderRecursive,'fileExists':fileExists,'readFile':readFile,'writeFile':writeFile,'createDir':createDir,'isViteProject':isViteProject,'validateConfig':validateConfig,'DeleteDirAllFile':DeleteDirAllFile,'CopyFile':CopyFile,'CopyFolder':CopyFolder};