@cryozerolabs/n8n-nodes-dingtalk 0.1.1 → 0.3.0
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 +44 -4
- package/dist/credentials/DingtalkApi.credentials.js +8 -1
- package/dist/credentials/DingtalkApi.credentials.js.map +1 -1
- package/dist/docs/images/notable-ai-table-guide.png +0 -0
- package/dist/nodes/DingtalkNode/DingtalkNode.node.d.ts +20 -0
- package/dist/nodes/DingtalkNode/DingtalkNode.node.js +38 -68
- package/dist/nodes/DingtalkNode/DingtalkNode.node.js.map +1 -1
- package/dist/nodes/DingtalkNode/DingtalkNode.node.json +5 -5
- package/dist/nodes/DingtalkNode/resources/auth/index.js +5 -1
- package/dist/nodes/DingtalkNode/resources/auth/index.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/doc/index.d.ts +2 -0
- package/dist/nodes/DingtalkNode/resources/doc/index.js +13 -0
- package/dist/nodes/DingtalkNode/resources/doc/index.js.map +1 -0
- package/dist/nodes/DingtalkNode/resources/doc/resourceGetUploadinfo.d.ts +3 -0
- package/dist/nodes/DingtalkNode/resources/doc/resourceGetUploadinfo.js +70 -0
- package/dist/nodes/DingtalkNode/resources/doc/resourceGetUploadinfo.js.map +1 -0
- package/dist/nodes/DingtalkNode/resources/notable/common.d.ts +5 -0
- package/dist/nodes/DingtalkNode/resources/notable/common.js +100 -0
- package/dist/nodes/DingtalkNode/resources/notable/common.js.map +1 -0
- package/dist/nodes/DingtalkNode/resources/notable/fieldCreate.js +11 -33
- package/dist/nodes/DingtalkNode/resources/notable/fieldCreate.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/fieldDelete.js +8 -30
- package/dist/nodes/DingtalkNode/resources/notable/fieldDelete.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/fieldGetAll.js +8 -30
- package/dist/nodes/DingtalkNode/resources/notable/fieldGetAll.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/fieldUpdate.js +11 -33
- package/dist/nodes/DingtalkNode/resources/notable/fieldUpdate.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/index.js +37 -1
- package/dist/nodes/DingtalkNode/resources/notable/index.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/methods/index.d.ts +9 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/index.js +45 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/index.js.map +1 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/listSearch.d.ts +2 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/listSearch.js +29 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/listSearch.js.map +1 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/loadOptions.d.ts +3 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/loadOptions.js +50 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/loadOptions.js.map +1 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/resourceMapping.d.ts +2 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/resourceMapping.js +48 -0
- package/dist/nodes/DingtalkNode/resources/notable/methods/resourceMapping.js.map +1 -0
- package/dist/nodes/DingtalkNode/resources/notable/recordDelete.js +35 -44
- package/dist/nodes/DingtalkNode/resources/notable/recordDelete.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/recordGet.js +10 -32
- package/dist/nodes/DingtalkNode/resources/notable/recordGet.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/recordInsert.js +65 -40
- package/dist/nodes/DingtalkNode/resources/notable/recordInsert.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/recordList.js +190 -37
- package/dist/nodes/DingtalkNode/resources/notable/recordList.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/recordUpdate.js +68 -39
- package/dist/nodes/DingtalkNode/resources/notable/recordUpdate.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/sheetCreate.js +13 -28
- package/dist/nodes/DingtalkNode/resources/notable/sheetCreate.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/sheetDelete.js +8 -30
- package/dist/nodes/DingtalkNode/resources/notable/sheetDelete.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/sheetGet.js +8 -30
- package/dist/nodes/DingtalkNode/resources/notable/sheetGet.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/sheetGetAll.js +5 -23
- package/dist/nodes/DingtalkNode/resources/notable/sheetGetAll.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/notable/sheetUpdate.js +15 -38
- package/dist/nodes/DingtalkNode/resources/notable/sheetUpdate.js.map +1 -1
- package/dist/nodes/DingtalkNode/resources/user/index.js +5 -1
- package/dist/nodes/DingtalkNode/resources/user/index.js.map +1 -1
- package/dist/nodes/shared/properties/body.d.ts +14 -0
- package/dist/nodes/shared/properties/body.js +123 -0
- package/dist/nodes/shared/properties/body.js.map +1 -0
- package/dist/nodes/shared/properties/commaSeparatedString.d.ts +3 -0
- package/dist/nodes/shared/properties/commaSeparatedString.js +28 -0
- package/dist/nodes/shared/properties/commaSeparatedString.js.map +1 -0
- package/dist/nodes/shared/properties/operator.d.ts +4 -0
- package/dist/nodes/shared/properties/operator.js +66 -0
- package/dist/nodes/shared/properties/operator.js.map +1 -0
- package/dist/nodes/shared/request.js +2 -0
- package/dist/nodes/shared/request.js.map +1 -1
- package/dist/nodes/shared/resource.d.ts +5 -3
- package/dist/nodes/shared/resource.js +17 -68
- package/dist/nodes/shared/resource.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/nodes/shared/validation.d.ts +0 -2
- package/dist/nodes/shared/validation.js +0 -20
- package/dist/nodes/shared/validation.js.map +0 -1
|
@@ -1,37 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../shared/request");
|
|
4
|
-
const
|
|
4
|
+
const body_1 = require("../../../shared/properties/body");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
const operator_1 = require("../../../shared/properties/operator");
|
|
5
7
|
const OP = 'notable.field.create';
|
|
6
8
|
const showOnly = { show: { operation: [OP] } };
|
|
7
9
|
const properties = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type: 'string',
|
|
12
|
-
default: '',
|
|
13
|
-
required: true,
|
|
14
|
-
description: '可通过AI表格 解析URL 操作获取',
|
|
15
|
-
displayOptions: showOnly,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
displayName: '数据表ID或名称 (sheetIdOrName)',
|
|
19
|
-
name: 'sheetIdOrName',
|
|
20
|
-
type: 'string',
|
|
21
|
-
default: '',
|
|
22
|
-
required: true,
|
|
23
|
-
description: '可通过AI表格 解析URL 操作获取sheetId',
|
|
24
|
-
displayOptions: showOnly,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
displayName: '操作人的 unionId (operatorId)',
|
|
28
|
-
name: 'operatorId',
|
|
29
|
-
type: 'string',
|
|
30
|
-
default: '',
|
|
31
|
-
required: true,
|
|
32
|
-
description: '可通过用户管理 查询用户详情 获取',
|
|
33
|
-
displayOptions: showOnly,
|
|
34
|
-
},
|
|
10
|
+
...(0, operator_1.operatorProps)(showOnly),
|
|
11
|
+
...(0, common_1.baseProps)(showOnly),
|
|
12
|
+
...(0, common_1.sheetProps)(showOnly),
|
|
35
13
|
{
|
|
36
14
|
displayName: '请求体 JSON',
|
|
37
15
|
name: 'body',
|
|
@@ -49,7 +27,7 @@ const properties = [
|
|
|
49
27
|
],
|
|
50
28
|
},
|
|
51
29
|
type: 'singleSelect',
|
|
52
|
-
}),
|
|
30
|
+
}, null, 2),
|
|
53
31
|
required: true,
|
|
54
32
|
description: '官方文档: https://open.dingtalk.com/document/orgapp/api-noatable-createfield',
|
|
55
33
|
displayOptions: showOnly,
|
|
@@ -61,11 +39,11 @@ const op = {
|
|
|
61
39
|
description: '在数据表中创建一个字段',
|
|
62
40
|
properties,
|
|
63
41
|
async run(itemIndex) {
|
|
64
|
-
const baseId =
|
|
65
|
-
const sheet =
|
|
66
|
-
const operatorId =
|
|
42
|
+
const baseId = (0, common_1.getBase)(this, itemIndex);
|
|
43
|
+
const sheet = (0, common_1.getSheet)(this, itemIndex);
|
|
44
|
+
const operatorId = await (0, operator_1.getOperatorId)(this, itemIndex);
|
|
67
45
|
const raw = this.getNodeParameter('body', itemIndex);
|
|
68
|
-
const body = (0,
|
|
46
|
+
const body = (0, body_1.parseJsonBody)(raw, this.getNode(), itemIndex);
|
|
69
47
|
const resp = await request_1.request.call(this, {
|
|
70
48
|
method: 'POST',
|
|
71
49
|
url: `/notable/bases/${baseId}/sheets/${sheet}/fields`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldCreate.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/fieldCreate.ts"],"names":[],"mappings":";;AAOA,qDAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"fieldCreate.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/fieldCreate.ts"],"names":[],"mappings":";;AAOA,qDAAkD;AAClD,0DAAgE;AAChE,qCAAoE;AACpE,kEAAmF;AAEnF,MAAM,EAAE,GAAG,sBAAsB,CAAC;AAGlC,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAE/C,MAAM,UAAU,GAAsB;IACpC,GAAG,IAAA,wBAAa,EAAC,QAAQ,CAAC;IAC1B,GAAG,IAAA,kBAAS,EAAC,QAAQ,CAAC;IACtB,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC;IACvB;QACE,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI,CAAC,SAA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AAe,EAAE,CAAC"}
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../shared/request");
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
const operator_1 = require("../../../shared/properties/operator");
|
|
4
6
|
const OP = 'notable.field.delete';
|
|
5
7
|
const showOnly = { show: { operation: [OP] } };
|
|
6
8
|
const properties = [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type: 'string',
|
|
11
|
-
default: '',
|
|
12
|
-
required: true,
|
|
13
|
-
description: '可通过AI表格 解析URL 操作获取',
|
|
14
|
-
displayOptions: showOnly,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
displayName: '数据表ID或名称 (sheetIdOrName)',
|
|
18
|
-
name: 'sheetIdOrName',
|
|
19
|
-
type: 'string',
|
|
20
|
-
default: '',
|
|
21
|
-
required: true,
|
|
22
|
-
description: '可通过AI表格 解析URL 操作获取sheetId',
|
|
23
|
-
displayOptions: showOnly,
|
|
24
|
-
},
|
|
9
|
+
...(0, operator_1.operatorProps)(showOnly),
|
|
10
|
+
...(0, common_1.baseProps)(showOnly),
|
|
11
|
+
...(0, common_1.sheetProps)(showOnly),
|
|
25
12
|
{
|
|
26
13
|
displayName: '字段ID或字段名称 (fieldIdOrName)',
|
|
27
14
|
name: 'fieldIdOrName',
|
|
@@ -30,15 +17,6 @@ const properties = [
|
|
|
30
17
|
required: true,
|
|
31
18
|
displayOptions: showOnly,
|
|
32
19
|
},
|
|
33
|
-
{
|
|
34
|
-
displayName: '操作人的 unionId (operatorId)',
|
|
35
|
-
name: 'operatorId',
|
|
36
|
-
type: 'string',
|
|
37
|
-
default: '',
|
|
38
|
-
required: true,
|
|
39
|
-
description: '可通过用户管理 查询用户详情 获取',
|
|
40
|
-
displayOptions: showOnly,
|
|
41
|
-
},
|
|
42
20
|
];
|
|
43
21
|
const op = {
|
|
44
22
|
value: OP,
|
|
@@ -46,10 +24,10 @@ const op = {
|
|
|
46
24
|
description: '在AI表格中删除一个字段',
|
|
47
25
|
properties,
|
|
48
26
|
async run(itemIndex) {
|
|
49
|
-
const baseId =
|
|
50
|
-
const sheet =
|
|
27
|
+
const baseId = (0, common_1.getBase)(this, itemIndex);
|
|
28
|
+
const sheet = (0, common_1.getSheet)(this, itemIndex);
|
|
51
29
|
const field = this.getNodeParameter('fieldIdOrName', itemIndex);
|
|
52
|
-
const operatorId =
|
|
30
|
+
const operatorId = await (0, operator_1.getOperatorId)(this, itemIndex);
|
|
53
31
|
const resp = await request_1.request.call(this, {
|
|
54
32
|
method: 'DELETE',
|
|
55
33
|
url: `/notable/bases/${baseId}/sheets/${sheet}/fields/${field}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldDelete.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/fieldDelete.ts"],"names":[],"mappings":";;AAOA,qDAAkD;
|
|
1
|
+
{"version":3,"file":"fieldDelete.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/fieldDelete.ts"],"names":[],"mappings":";;AAOA,qDAAkD;AAClD,qCAAoE;AACpE,kEAAmF;AAEnF,MAAM,EAAE,GAAG,sBAAsB,CAAC;AAGlC,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAE/C,MAAM,UAAU,GAAsB;IACpC,GAAG,IAAA,wBAAa,EAAC,QAAQ,CAAC;IAC1B,GAAG,IAAA,kBAAS,EAAC,QAAQ,CAAC;IACtB,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC;IACvB;QACE,WAAW,EAAE,2BAA2B;QACxC,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC;AAEF,MAAM,EAAE,GAAiB;IACvB,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,cAAc;IAC3B,UAAU;IAEV,KAAK,CAAC,GAAG,CAA0B,SAAiB;QAClD,MAAM,MAAM,GAAG,IAAA,gBAAO,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACxC,MAAM,KAAK,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,SAAS,CAAW,CAAC;QAC1E,MAAM,UAAU,GAAG,MAAM,IAAA,wBAAa,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAExD,MAAM,IAAI,GAAG,MAAM,iBAAO,CAAC,IAAI,CAAC,IAAI,EAAE;YACpC,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,kBAAkB,MAAM,WAAW,KAAK,WAAW,KAAK,EAAE;YAC/D,EAAE,EAAE,EAAE,UAAU,EAAE;SACnB,CAAC,CAAC;QAEH,MAAM,GAAG,GAAgB,IAA8B,CAAC;QACxD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IACxD,CAAC;CACF,CAAC;AAEF,kBAAe,EAAE,CAAC"}
|
|
@@ -1,36 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../shared/request");
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
const operator_1 = require("../../../shared/properties/operator");
|
|
4
6
|
const OP = 'notable.field.getAll';
|
|
5
7
|
const showOnly = { show: { operation: [OP] } };
|
|
6
8
|
const properties = [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type: 'string',
|
|
11
|
-
default: '',
|
|
12
|
-
required: true,
|
|
13
|
-
description: 'AI表格ID, 可通过AI表格 解析URL 操作获取',
|
|
14
|
-
displayOptions: showOnly,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
displayName: '数据表ID或名称 (sheetIdOrName)',
|
|
18
|
-
name: 'sheetIdOrName',
|
|
19
|
-
type: 'string',
|
|
20
|
-
default: '',
|
|
21
|
-
required: true,
|
|
22
|
-
description: '目标数据表的 ID 或名称',
|
|
23
|
-
displayOptions: showOnly,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
displayName: '操作人的 unionId (operatorId)',
|
|
27
|
-
name: 'operatorId',
|
|
28
|
-
type: 'string',
|
|
29
|
-
default: '',
|
|
30
|
-
required: true,
|
|
31
|
-
description: '可通过用户管理 查询用户详情 获取',
|
|
32
|
-
displayOptions: showOnly,
|
|
33
|
-
},
|
|
9
|
+
...(0, operator_1.operatorProps)(showOnly),
|
|
10
|
+
...(0, common_1.baseProps)(showOnly),
|
|
11
|
+
...(0, common_1.sheetProps)(showOnly),
|
|
34
12
|
];
|
|
35
13
|
const op = {
|
|
36
14
|
value: OP,
|
|
@@ -38,9 +16,9 @@ const op = {
|
|
|
38
16
|
description: '获取在数据表中的所有字段',
|
|
39
17
|
properties,
|
|
40
18
|
async run(itemIndex) {
|
|
41
|
-
const baseId =
|
|
42
|
-
const sheet =
|
|
43
|
-
const operatorId =
|
|
19
|
+
const baseId = (0, common_1.getBase)(this, itemIndex);
|
|
20
|
+
const sheet = (0, common_1.getSheet)(this, itemIndex);
|
|
21
|
+
const operatorId = await (0, operator_1.getOperatorId)(this, itemIndex);
|
|
44
22
|
const resp = await request_1.request.call(this, {
|
|
45
23
|
method: 'GET',
|
|
46
24
|
url: `/notable/bases/${baseId}/sheets/${sheet}/fields`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldGetAll.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/fieldGetAll.ts"],"names":[],"mappings":";;AAOA,qDAAkD;
|
|
1
|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@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../shared/request");
|
|
4
|
-
const
|
|
4
|
+
const body_1 = require("../../../shared/properties/body");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
const operator_1 = require("../../../shared/properties/operator");
|
|
5
7
|
const OP = 'notable.field.update';
|
|
6
8
|
const showOnly = { show: { operation: [OP] } };
|
|
7
9
|
const properties = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type: 'string',
|
|
12
|
-
default: '',
|
|
13
|
-
required: true,
|
|
14
|
-
description: '可通过AI表格 解析URL 操作获取',
|
|
15
|
-
displayOptions: showOnly,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
displayName: '数据表ID或名称 (sheetIdOrName)',
|
|
19
|
-
name: 'sheetIdOrName',
|
|
20
|
-
type: 'string',
|
|
21
|
-
default: '',
|
|
22
|
-
required: true,
|
|
23
|
-
description: '可通过AI表格 解析URL 操作获取sheetId',
|
|
24
|
-
displayOptions: showOnly,
|
|
25
|
-
},
|
|
10
|
+
...(0, operator_1.operatorProps)(showOnly),
|
|
11
|
+
...(0, common_1.baseProps)(showOnly),
|
|
12
|
+
...(0, common_1.sheetProps)(showOnly),
|
|
26
13
|
{
|
|
27
14
|
displayName: '字段ID或字段名称 (fieldIdOrName)',
|
|
28
15
|
name: 'fieldIdOrName',
|
|
@@ -31,15 +18,6 @@ const properties = [
|
|
|
31
18
|
required: true,
|
|
32
19
|
displayOptions: showOnly,
|
|
33
20
|
},
|
|
34
|
-
{
|
|
35
|
-
displayName: '操作人的 unionId (operatorId)',
|
|
36
|
-
name: 'operatorId',
|
|
37
|
-
type: 'string',
|
|
38
|
-
default: '',
|
|
39
|
-
required: true,
|
|
40
|
-
description: '可通过用户管理 查询用户详情 获取',
|
|
41
|
-
displayOptions: showOnly,
|
|
42
|
-
},
|
|
43
21
|
{
|
|
44
22
|
displayName: '请求体 JSON',
|
|
45
23
|
name: 'body',
|
|
@@ -56,7 +34,7 @@ const properties = [
|
|
|
56
34
|
},
|
|
57
35
|
],
|
|
58
36
|
},
|
|
59
|
-
}),
|
|
37
|
+
}, null, 2),
|
|
60
38
|
required: true,
|
|
61
39
|
description: '官方文档: https://open.dingtalk.com/document/orgapp/api-noatable-updatefield',
|
|
62
40
|
displayOptions: showOnly,
|
|
@@ -68,12 +46,12 @@ const op = {
|
|
|
68
46
|
description: '在数据表中更新一个字段',
|
|
69
47
|
properties,
|
|
70
48
|
async run(itemIndex) {
|
|
71
|
-
const baseId =
|
|
72
|
-
const sheet =
|
|
49
|
+
const baseId = (0, common_1.getBase)(this, itemIndex);
|
|
50
|
+
const sheet = (0, common_1.getSheet)(this, itemIndex);
|
|
73
51
|
const field = this.getNodeParameter('fieldIdOrName', itemIndex);
|
|
74
|
-
const operatorId =
|
|
52
|
+
const operatorId = await (0, operator_1.getOperatorId)(this, itemIndex);
|
|
75
53
|
const raw = this.getNodeParameter('body', itemIndex);
|
|
76
|
-
const body = (0,
|
|
54
|
+
const body = (0, body_1.parseJsonBody)(raw, this.getNode(), itemIndex);
|
|
77
55
|
const resp = await request_1.request.call(this, {
|
|
78
56
|
method: 'PUT',
|
|
79
57
|
url: `/notable/bases/${baseId}/sheets/${sheet}/fields/${field}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldUpdate.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/fieldUpdate.ts"],"names":[],"mappings":";;AAOA,qDAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"fieldUpdate.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/fieldUpdate.ts"],"names":[],"mappings":";;AAOA,qDAAkD;AAClD,0DAAgE;AAChE,qCAAoE;AACpE,kEAAmF;AAEnF,MAAM,EAAE,GAAG,sBAAsB,CAAC;AAGlC,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,EAAE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AG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAY,CAAC;QAEhE,MAAM,IAAI,GAAG,IAAA,oBAAa,EAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;QAE3D,MAAM,IAAI,GAAG,MAAM,iBAAO,CAAC,IAAI,CAAC,IAAI,EAAE;YACpC,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,kBAAkB,MAAM,WAAW,KAAK,WAAW,KAAK,EAAE;YAC/D,EAAE,EAAE,EAAE,UAAU,EAAE;YAClB,IAAI;SACL,CAAC,CAAC;QAEH,MAAM,GAAG,GAAgB,IAA8B,CAAC;QACxD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IACxD,CAAC;CACF,CAAC;AAEF,kBAAe,EAAE,CAAC"}
|
|
@@ -1,9 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const resource_1 = require("../../../shared/resource");
|
|
7
|
+
const fieldCreate_1 = __importDefault(require("./fieldCreate"));
|
|
8
|
+
const fieldDelete_1 = __importDefault(require("./fieldDelete"));
|
|
9
|
+
const fieldGetAll_1 = __importDefault(require("./fieldGetAll"));
|
|
10
|
+
const fieldUpdate_1 = __importDefault(require("./fieldUpdate"));
|
|
11
|
+
const parseUrl_1 = __importDefault(require("./parseUrl"));
|
|
12
|
+
const recordDelete_1 = __importDefault(require("./recordDelete"));
|
|
13
|
+
const recordGet_1 = __importDefault(require("./recordGet"));
|
|
14
|
+
const recordInsert_1 = __importDefault(require("./recordInsert"));
|
|
15
|
+
const recordList_1 = __importDefault(require("./recordList"));
|
|
16
|
+
const recordUpdate_1 = __importDefault(require("./recordUpdate"));
|
|
17
|
+
const sheetCreate_1 = __importDefault(require("./sheetCreate"));
|
|
18
|
+
const sheetDelete_1 = __importDefault(require("./sheetDelete"));
|
|
19
|
+
const sheetGet_1 = __importDefault(require("./sheetGet"));
|
|
20
|
+
const sheetGetAll_1 = __importDefault(require("./sheetGetAll"));
|
|
21
|
+
const sheetUpdate_1 = __importDefault(require("./sheetUpdate"));
|
|
22
|
+
const index_1 = __importDefault(require("./methods/index"));
|
|
4
23
|
exports.default = (0, resource_1.makeResourceBundle)({
|
|
5
24
|
value: 'notable',
|
|
6
25
|
name: 'AI表格',
|
|
7
|
-
|
|
26
|
+
operations: [
|
|
27
|
+
fieldCreate_1.default,
|
|
28
|
+
fieldDelete_1.default,
|
|
29
|
+
fieldGetAll_1.default,
|
|
30
|
+
fieldUpdate_1.default,
|
|
31
|
+
parseUrl_1.default,
|
|
32
|
+
recordDelete_1.default,
|
|
33
|
+
recordGet_1.default,
|
|
34
|
+
recordInsert_1.default,
|
|
35
|
+
recordList_1.default,
|
|
36
|
+
recordUpdate_1.default,
|
|
37
|
+
sheetCreate_1.default,
|
|
38
|
+
sheetDelete_1.default,
|
|
39
|
+
sheetGet_1.default,
|
|
40
|
+
sheetGetAll_1.default,
|
|
41
|
+
sheetUpdate_1.default,
|
|
42
|
+
],
|
|
43
|
+
methods: index_1.default,
|
|
8
44
|
});
|
|
9
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/index.ts"],"names":[],"mappings":";;;;;AAAA,uDAA8D;AAC9D,gEAAwC;AACxC,gEAAwC;AACxC,gEAAwC;AACxC,gEAAwC;AACxC,0DAAkC;AAClC,kEAA0C;AAC1C,4DAAoC;AACpC,kEAA0C;AAC1C,8DAAsC;AACtC,kEAA0C;AAC1C,gEAAwC;AACxC,gEAAwC;AACxC,0DAAkC;AAClC,gEAAwC;AACxC,gEAAwC;AAExC,4DAAsC;AAEtC,kBAAe,IAAA,6BAAkB,EAAC;IAChC,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE;QACV,qBAAW;QACX,qBAAW;QACX,qBAAW;QACX,qBAAW;QACX,kBAAQ;QACR,sBAAY;QACZ,mBAAS;QACT,sBAAY;QACZ,oBAAU;QACV,sBAAY;QACZ,qBAAW;QACX,qBAAW;QACX,kBAAQ;QACR,qBAAW;QACX,qBAAW;KACZ;IACD,OAAO,EAAP,eAAO;CACR,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as listSearch from './listSearch';
|
|
2
|
+
import * as loadOptions from './loadOptions';
|
|
3
|
+
import * as resourceMapping from './resourceMapping';
|
|
4
|
+
declare const methods: {
|
|
5
|
+
listSearch: typeof listSearch;
|
|
6
|
+
loadOptions: typeof loadOptions;
|
|
7
|
+
resourceMapping: typeof resourceMapping;
|
|
8
|
+
};
|
|
9
|
+
export default methods;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const listSearch = __importStar(require("./listSearch"));
|
|
37
|
+
const loadOptions = __importStar(require("./loadOptions"));
|
|
38
|
+
const resourceMapping = __importStar(require("./resourceMapping"));
|
|
39
|
+
const methods = {
|
|
40
|
+
listSearch,
|
|
41
|
+
loadOptions,
|
|
42
|
+
resourceMapping,
|
|
43
|
+
};
|
|
44
|
+
exports.default = methods;
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/DingtalkNode/resources/notable/methods/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AAC3C,2DAA6C;AAC7C,mEAAqD;AAErD,MAAM,OAAO,GAAG;IACd,UAAU;IACV,WAAW;IACX,eAAe;CAChB,CAAC;AACF,kBAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sheetSearch = sheetSearch;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const request_1 = require("../../../../shared/request");
|
|
6
|
+
const operator_1 = require("../../../../shared/properties/operator");
|
|
7
|
+
async function sheetSearch(filter) {
|
|
8
|
+
const operatorId = await (0, operator_1.getOperatorIdForLoadOptions)(this);
|
|
9
|
+
const baseId = this.getNodeParameter('baseId', undefined, { extractValue: true });
|
|
10
|
+
if (!operatorId || !baseId) {
|
|
11
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), '请先配置 操作人 和 AI表格');
|
|
12
|
+
}
|
|
13
|
+
const resp = await request_1.request.call(this, {
|
|
14
|
+
method: 'GET',
|
|
15
|
+
url: `/notable/bases/${baseId}/sheets`,
|
|
16
|
+
qs: { operatorId },
|
|
17
|
+
});
|
|
18
|
+
const items = resp.value;
|
|
19
|
+
const results = items
|
|
20
|
+
.filter((s) => (filter ? String(s.name).toLowerCase().includes(filter.toLowerCase()) : true))
|
|
21
|
+
.map((s) => ({
|
|
22
|
+
name: String(s.name),
|
|
23
|
+
value: String(s.id),
|
|
24
|
+
}));
|
|
25
|
+
return {
|
|
26
|
+
results,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=listSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listSearch.js","sourceRoot":"","sources":["../../../../../../nodes/DingtalkNode/resources/notable/methods/listSearch.ts"],"names":[],"mappings":";;AASA,kCA4BC;AArCD,+CAMsB;AACtB,wDAAqD;AACrD,qEAAqF;AAC9E,KAAK,UAAU,WAAW,CAE/B,MAAe;IAEf,MAAM,UAAU,GAAG,MAAM,IAAA,sCAA2B,EAAC,IAAI,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAW,CAAC;IAE5F,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM,EAAE,CAAC;QAE3B,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,iBAAO,CAAC,IAAI,CAAC,IAAI,EAAE;QACpC,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,kBAAkB,MAAM,SAAS;QACtC,EAAE,EAAE,EAAE,UAAU,EAAE;KACnB,CAAC,CAAC;IACH,MAAM,KAAK,GAAI,IAAoB,CAAC,KAAsB,CAAC;IAC3D,MAAM,OAAO,GAA2B,KAAK;SAC1C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SAC5F,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACX,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;KACpB,CAAC,CAAC,CAAC;IAEN,OAAO;QACL,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export declare function notableGeFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
3
|
+
export declare function notableGetFieldsAndAddOptions(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.notableGeFields = notableGeFields;
|
|
4
|
+
exports.notableGetFieldsAndAddOptions = notableGetFieldsAndAddOptions;
|
|
5
|
+
const request_1 = require("../../../../shared/request");
|
|
6
|
+
const operator_1 = require("../../../../shared/properties/operator");
|
|
7
|
+
async function notableGeFields() {
|
|
8
|
+
const baseId = this.getNodeParameter('baseId', undefined, { extractValue: true });
|
|
9
|
+
const sheet = this.getNodeParameter('sheetIdOrName', undefined, { extractValue: true });
|
|
10
|
+
const operatorId = await (0, operator_1.getOperatorIdForLoadOptions)(this);
|
|
11
|
+
if (!baseId || !sheet || !operatorId) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
const resp = await request_1.request.call(this, {
|
|
15
|
+
method: 'GET',
|
|
16
|
+
url: `/notable/bases/${baseId}/sheets/${sheet}/fields`,
|
|
17
|
+
qs: { operatorId },
|
|
18
|
+
});
|
|
19
|
+
const fields = resp.value;
|
|
20
|
+
return (fields || []).map((f) => ({
|
|
21
|
+
name: String(f.name),
|
|
22
|
+
value: String(f.name),
|
|
23
|
+
description: `类型: ${String(f.type || '未知')}`,
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
async function notableGetFieldsAndAddOptions() {
|
|
27
|
+
const apiFields = await notableGeFields.call(this);
|
|
28
|
+
if (apiFields && apiFields.length > 0) {
|
|
29
|
+
return apiFields;
|
|
30
|
+
}
|
|
31
|
+
const userFields = new Set();
|
|
32
|
+
try {
|
|
33
|
+
const filter = this.getNodeParameter('filter', undefined);
|
|
34
|
+
if (filter && filter.conditions && Array.isArray(filter.conditions)) {
|
|
35
|
+
filter.conditions.forEach((condition) => {
|
|
36
|
+
if (condition.field && typeof condition.field === 'string') {
|
|
37
|
+
userFields.add(condition.field);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
}
|
|
44
|
+
const options = Array.from(userFields).map((field) => ({
|
|
45
|
+
name: field,
|
|
46
|
+
value: field,
|
|
47
|
+
}));
|
|
48
|
+
return options;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=loadOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadOptions.js","sourceRoot":"","sources":["../../../../../../nodes/DingtalkNode/resources/notable/methods/loadOptions.ts"],"names":[],"mappings":";;AAOA,0CAuBC;AAOD,sEAiCC;AArED,wDAAqD;AACrD,qEAAqF;AAK9E,KAAK,UAAU,eAAe;IAGnC,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAW,CAAC;IAC5F,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAW,CAAC;IAClG,MAAM,UAAU,GAAG,MAAM,IAAA,sCAA2B,EAAC,IAAI,CAAC,CAAC;IAE3D,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;QACrC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,iBAAO,CAAC,IAAI,CAAC,IAAI,EAAE;QACpC,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,kBAAkB,MAAM,WAAW,KAAK,SAAS;QACtD,EAAE,EAAE,EAAE,UAAU,EAAE;KACnB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAI,IAAoB,CAAC,KAAsB,CAAC;IAC5D,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QACrB,WAAW,EAAE,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE;KAC7C,CAAC,CAAC,CAAC;AACN,CAAC;AAOM,KAAK,UAAU,6BAA6B;IAIjD,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,OAAO,SAAS,CAAC;IACnB,CAAC;IAGD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IAGrC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,CAAgB,CAAC;QACzE,IAAI,MAAM,IAAI,MAAM,CAAC,UAAU,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YACnE,MAAM,CAAC,UAA4B,CAAC,OAAO,CAAC,CAAC,SAAsB,EAAE,EAAE;gBACtE,IAAI,SAAS,CAAC,KAAK,IAAI,OAAO,SAAS,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;oBAC3D,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;gBAClC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;IAGD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACrD,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,KAAK;KACb,CAAC,CAAC,CAAC;IAEJ,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.notableGetColumns = notableGetColumns;
|
|
4
|
+
const request_1 = require("../../../../shared/request");
|
|
5
|
+
const operator_1 = require("../../../../shared/properties/operator");
|
|
6
|
+
async function notableGetColumns() {
|
|
7
|
+
var _a;
|
|
8
|
+
const baseId = this.getNodeParameter('baseId', undefined, { extractValue: true });
|
|
9
|
+
const sheet = this.getNodeParameter('sheetIdOrName', undefined, { extractValue: true });
|
|
10
|
+
const operatorId = await (0, operator_1.getOperatorIdForLoadOptions)(this);
|
|
11
|
+
const resp = await request_1.request.call(this, {
|
|
12
|
+
method: 'GET',
|
|
13
|
+
url: `/notable/bases/${baseId}/sheets/${sheet}/fields`,
|
|
14
|
+
qs: { operatorId },
|
|
15
|
+
});
|
|
16
|
+
const fields = [];
|
|
17
|
+
const value = resp === null || resp === void 0 ? void 0 : resp.value;
|
|
18
|
+
if (Array.isArray(value)) {
|
|
19
|
+
for (const field of value) {
|
|
20
|
+
const typeMap = {
|
|
21
|
+
text: 'string',
|
|
22
|
+
number: 'number',
|
|
23
|
+
singleSelect: 'string',
|
|
24
|
+
multipleSelect: 'array',
|
|
25
|
+
date: 'dateTime',
|
|
26
|
+
user: 'object',
|
|
27
|
+
department: 'object',
|
|
28
|
+
attachment: 'object',
|
|
29
|
+
unidirectionalLink: 'object',
|
|
30
|
+
bidirectionalLink: 'object',
|
|
31
|
+
url: 'object',
|
|
32
|
+
};
|
|
33
|
+
fields.push({
|
|
34
|
+
id: field.name,
|
|
35
|
+
displayName: `${field.name} (${field.type})`,
|
|
36
|
+
required: false,
|
|
37
|
+
defaultMatch: false,
|
|
38
|
+
canBeUsedToMatch: true,
|
|
39
|
+
display: true,
|
|
40
|
+
removed: true,
|
|
41
|
+
readOnly: false,
|
|
42
|
+
type: (_a = typeMap[field.type]) !== null && _a !== void 0 ? _a : 'string',
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return { fields };
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=resourceMapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceMapping.js","sourceRoot":"","sources":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