cloudcc-cli 1.9.2 → 1.9.3

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
@@ -1,3 +1,10 @@
1
+ # ReleaseV1.9.3
2
+ #### Release Date: 2025-2-28
3
+ #### Release Scope: Full
4
+ #### Release Content
5
+ * Optimization
6
+ * Add the function of getting object field attributes
7
+
1
8
  # ReleaseV1.9.2
2
9
  #### Release Date: 2025-2-11
3
10
  #### Release Scope: Full
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
package/src/object/get.js CHANGED
@@ -2,10 +2,42 @@ const { getBusToken } = require("../../utils/utils")
2
2
  const { postNormal } = require("../../utils/http")
3
3
 
4
4
 
5
- async function get(path, type) {
5
+ async function get(path, type, object) {
6
6
  if (await getBusToken(path)) {
7
7
  let res = [];
8
- if ("trigger" === type) {
8
+ if ("fields" === type) {
9
+ object = JSON.parse(decodeURI(object))
10
+ let fieldsPromises = postNormal(global.setupSvc + "/api/fieldSetup/queryField", { prefix: object.objprefix })
11
+ const fieldsResults = await Promise.all([fieldsPromises])
12
+ res = {
13
+ ...object,
14
+ fields: fieldsResults[0].data.stdFields.map((field) => {
15
+ return {
16
+ fieldname: field.labelName,
17
+ apiname: field.schemefieldName
18
+ }
19
+ })
20
+ }
21
+ } else if ("chat" === type) {
22
+ //get chat object
23
+ let standardObjList = await postNormal(global.setupSvc + "/api/customObject/standardObjList");
24
+ standardObjList.data.map((item) => {
25
+ res.push({
26
+ apiname: item.label,
27
+ objname: item.objname,
28
+ objprefix: item.objprefix
29
+ })
30
+ })
31
+ //get custom object
32
+ let customObjList = await postNormal(global.setupSvc + "/api/customObject/list")
33
+ customObjList.data.objList.map((item) => {
34
+ res.push({
35
+ apiname: item.schemetableName,
36
+ objname: item.objLabel,
37
+ objprefix: item.prefix,
38
+ })
39
+ })
40
+ } else if ("trigger" === type) {
9
41
  //get trigger object
10
42
  let triggerObjList = await postNormal(global.setupSvc + "/api/trigger/newobjtrigger")
11
43
  triggerObjList.data.targetObjList.map((item) => {
@@ -1,7 +1,7 @@
1
1
  const cc = {}
2
2
  cc.get = require("./get")
3
3
  function main(action, argvs) {
4
- cc[action](argvs[2], argvs[3])
4
+ cc[action](argvs[2], argvs[3], argvs[4])
5
5
  }
6
6
 
7
7
  module.exports = main;