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.
Files changed (46) hide show
  1. package/README.md +8 -0
  2. package/bin/cc.js +15 -15
  3. package/core/core/CCObject.java +48 -0
  4. package/core/core/CCService.java +806 -0
  5. package/core/core/CCTrigger.java +23 -0
  6. package/core/core/CCTriggerHandler.java +15 -0
  7. package/core/core/DevLogger.java +39 -0
  8. package/core/core/OperatationEnum.java +5 -0
  9. package/core/core/PeakInterf.java +6 -0
  10. package/core/core/PeakSvc.java +8 -0
  11. package/core/core/ServiceResult.java +35 -0
  12. package/core/core/TriggerInvoker.java +83 -0
  13. package/core/core/TriggerMethod.java +9 -0
  14. package/core/core/TriggerTimeEnum.java +5 -0
  15. package/core/core/UserInfo.java +45 -0
  16. package/core.zip +0 -0
  17. package/package.json +1 -1
  18. package/src/classes/create.js +5 -8
  19. package/src/classes/publish.js +8 -12
  20. package/src/config/get.js +1 -3
  21. package/src/config/use.js +1 -3
  22. package/src/object/get.js +4 -6
  23. package/src/plugin/create.js +10 -20
  24. package/src/plugin/create1.js +8 -16
  25. package/src/plugin/publish.js +44 -77
  26. package/src/plugin/publish1.js +42 -72
  27. package/src/project/create.js +12 -14
  28. package/src/project/create1.js +15 -17
  29. package/src/recordType/get.js +3 -6
  30. package/src/script/create.js +3 -6
  31. package/src/script/publish.js +10 -17
  32. package/src/timer/create.js +3 -6
  33. package/src/timer/publish.js +8 -12
  34. package/src/token/get.js +1 -3
  35. package/src/triggers/create.js +8 -16
  36. package/src/triggers/index.js +1 -1
  37. package/src/triggers/publish.js +10 -13
  38. package/template/index.js +10 -10
  39. package/template/indexvue +3 -3
  40. package/tool/branch/index.js +25 -0
  41. package/tool/checkLange/checkLang.js +68 -0
  42. package/tool/checkLange/clearLang.js +85 -0
  43. package/tool/checkLange/result.txt +0 -0
  44. package/utils/checkVersion.js +19 -30
  45. package/utils/http.js +5 -5
  46. 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, // request timeout
15
+ timeout: 60000,
16
16
  headers: {
17
17
  'Content-Type': 'application/json; charset=utf-8',
18
18
  },
19
19
  })
20
20
 
21
- // request interceptor
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
- // Do something with request error
30
+
31
31
  Promise.reject(error)
32
32
  }
33
33
  )
34
34
 
35
- // response interceptor
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 ? "未知异常" : 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
- * 获取业务访问baseurl
16
- */
17
- async function getBaseUrl(orgId) {
18
- let u = "https://developer.apis.cloudcc.cn/oauth/apidomain?scope=cloudccCRM&orgId=" + orgId
19
- let res = await getParams(u)
20
- global.baseUrl = res.orgapi_address
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
- * 获取业务token
24
- */
23
+
24
+
25
25
  async function getBusToken(path) {
26
26
  let devConfig = getPackageJson(path);
27
- if(!devConfig.username||!devConfig.safetyMark||!devConfig.clientId||!devConfig.openSecretKey||!devConfig.orgId){
28
- console.log(chalk.red('安全标记配置有误,请查看文档进行配置:https://cloudccone.feishu.cn/wiki/IE0RwAOUFitPEMko1IxcaYMwnGx'));
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.orgId)
40
- let res = await postNormal(global.baseUrl + "/api/cauth/token", body)
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) {