cloudcc-cli 1.6.5 → 1.6.6
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 +8 -0
- package/bin/cc.js +15 -15
- package/core/core/CCObject.java +48 -0
- package/core/core/CCService.java +806 -0
- package/core/core/CCTrigger.java +23 -0
- package/core/core/CCTriggerHandler.java +15 -0
- package/core/core/DevLogger.java +39 -0
- package/core/core/OperatationEnum.java +5 -0
- package/core/core/PeakInterf.java +6 -0
- package/core/core/PeakSvc.java +8 -0
- package/core/core/ServiceResult.java +35 -0
- package/core/core/TriggerInvoker.java +83 -0
- package/core/core/TriggerMethod.java +9 -0
- package/core/core/TriggerTimeEnum.java +5 -0
- package/core/core/UserInfo.java +45 -0
- package/core.zip +0 -0
- package/package.json +1 -1
- package/src/classes/create.js +5 -8
- package/src/classes/publish.js +8 -12
- package/src/config/get.js +1 -3
- package/src/config/use.js +1 -3
- package/src/object/get.js +4 -6
- package/src/plugin/create.js +10 -20
- package/src/plugin/create1.js +8 -16
- package/src/plugin/publish.js +44 -77
- package/src/plugin/publish1.js +42 -72
- package/src/project/create.js +12 -14
- package/src/project/create1.js +15 -17
- package/src/recordType/get.js +3 -6
- package/src/script/create.js +3 -6
- package/src/script/publish.js +10 -17
- package/src/timer/create.js +3 -6
- package/src/timer/publish.js +8 -12
- package/src/token/get.js +1 -3
- package/src/triggers/create.js +8 -16
- package/src/triggers/index.js +1 -1
- package/src/triggers/publish.js +10 -13
- package/template/index.js +10 -10
- package/template/indexvue +3 -3
- package/tool/branch/index.js +25 -0
- package/tool/checkLange/checkLang.js +68 -0
- package/tool/checkLange/clearLang.js +85 -0
- package/tool/checkLange/result.txt +0 -0
- package/utils/checkVersion.js +19 -30
- package/utils/http.js +5 -5
- package/utils/utils.js +19 -21
package/utils/http.js
CHANGED
|
@@ -12,13 +12,13 @@ axios.defaults.httpsAgent = httpsAgent
|
|
|
12
12
|
axios.defaults.httpAgent = httpAgent
|
|
13
13
|
|
|
14
14
|
const service = axios.create({
|
|
15
|
-
timeout: 60000,
|
|
15
|
+
timeout: 60000,
|
|
16
16
|
headers: {
|
|
17
17
|
'Content-Type': 'application/json; charset=utf-8',
|
|
18
18
|
},
|
|
19
19
|
})
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
service.interceptors.request.use(
|
|
23
23
|
config => {
|
|
24
24
|
if (global.accessToken) {
|
|
@@ -27,17 +27,17 @@ service.interceptors.request.use(
|
|
|
27
27
|
return config
|
|
28
28
|
},
|
|
29
29
|
error => {
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
Promise.reject(error)
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
service.interceptors.response.use(
|
|
37
37
|
response => {
|
|
38
38
|
const code = response.data.code || 200
|
|
39
39
|
if (code !== 200) {
|
|
40
|
-
return Promise.reject(null == response.data.msg ? "
|
|
40
|
+
return Promise.reject(null == response.data.msg ? "Unknown exception" : response.data.msg)
|
|
41
41
|
} else {
|
|
42
42
|
return response.data;
|
|
43
43
|
}
|
package/utils/utils.js
CHANGED
|
@@ -3,29 +3,29 @@ const fs = require("fs");
|
|
|
3
3
|
const path = require("path")
|
|
4
4
|
const chalk = require("chalk")
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
* 获得配置信息
|
|
8
|
-
* @returns 配置信息
|
|
9
|
-
*/
|
|
6
|
+
|
|
10
7
|
function getPackageJson_old(projectPath = process.cwd()) {
|
|
11
8
|
const packageJson = JSON.parse(fs.readFileSync(path.join(projectPath, "package.json")), 'utf8');
|
|
12
9
|
return packageJson.devConsoleConfig;
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
|
|
12
|
+
async function getBaseUrl(devConfig) {
|
|
13
|
+
if ('private' == devConfig.version) {
|
|
14
|
+
global.apiSvc = devConfig.baseUrl + (devConfig.apiSvcPrefix || "/apitfs")
|
|
15
|
+
global.setupSvc = devConfig.baseUrl + (devConfig.setupSvcPrefix || "/ccsetup")
|
|
16
|
+
} else {
|
|
17
|
+
let u = "https://developer.apis.cloudcc.cn/oauth/apidomain?scope=cloudccCRM&orgId=" + devConfig.orgId
|
|
18
|
+
let res = await getParams(u)
|
|
19
|
+
global.apiSvc = res.orgapi_address
|
|
20
|
+
global.setupSvc = new URL(res.orgapi_address).origin + (devConfig.setupSvcPrefix || "/ccsetup")
|
|
21
|
+
}
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
25
|
async function getBusToken(path) {
|
|
26
26
|
let devConfig = getPackageJson(path);
|
|
27
|
-
if(!devConfig.username
|
|
28
|
-
console.log(chalk.red('
|
|
27
|
+
if (!devConfig.username || !devConfig.safetyMark || !devConfig.clientId || !devConfig.openSecretKey || !devConfig.orgId) {
|
|
28
|
+
console.log(chalk.red('The security tag configuration is incorrect. Please check the documentation for configuration.'));
|
|
29
29
|
console.log();
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
@@ -36,8 +36,8 @@ async function getBusToken(path) {
|
|
|
36
36
|
secretKey: devConfig.openSecretKey,
|
|
37
37
|
orgId: devConfig.orgId
|
|
38
38
|
}
|
|
39
|
-
await getBaseUrl(devConfig
|
|
40
|
-
let res = await postNormal(global.
|
|
39
|
+
await getBaseUrl(devConfig)
|
|
40
|
+
let res = await postNormal(global.apiSvc + "/api/cauth/token", body)
|
|
41
41
|
if (res.result) {
|
|
42
42
|
global.accessToken = res.data.accessToken
|
|
43
43
|
return res.data.accessToken;
|
|
@@ -45,9 +45,7 @@ async function getBusToken(path) {
|
|
|
45
45
|
return false
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
* 获取配置参数
|
|
50
|
-
*/
|
|
48
|
+
|
|
51
49
|
function getPackageJson(projectPath = process.cwd()) {
|
|
52
50
|
let config = getPackageJson_old(projectPath);
|
|
53
51
|
if (!config) {
|