@cryozerolabs/n8n-nodes-dingtalk 0.1.0 → 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.
Files changed (89) hide show
  1. package/README.md +55 -11
  2. package/dist/credentials/DingtalkApi.credentials.js +8 -1
  3. package/dist/credentials/DingtalkApi.credentials.js.map +1 -1
  4. package/dist/credentials/icon.png +0 -0
  5. package/dist/docs/images/notable-ai-table-guide.png +0 -0
  6. package/dist/nodes/DingtalkNode/DingtalkNode.node.d.ts +20 -0
  7. package/dist/nodes/DingtalkNode/DingtalkNode.node.js +38 -68
  8. package/dist/nodes/DingtalkNode/DingtalkNode.node.js.map +1 -1
  9. package/dist/nodes/DingtalkNode/DingtalkNode.node.json +5 -5
  10. package/dist/nodes/DingtalkNode/icon.png +0 -0
  11. package/dist/nodes/DingtalkNode/resources/auth/index.js +5 -1
  12. package/dist/nodes/DingtalkNode/resources/auth/index.js.map +1 -1
  13. package/dist/nodes/DingtalkNode/resources/doc/index.d.ts +2 -0
  14. package/dist/nodes/DingtalkNode/resources/doc/index.js +13 -0
  15. package/dist/nodes/DingtalkNode/resources/doc/index.js.map +1 -0
  16. package/dist/nodes/DingtalkNode/resources/doc/resourceGetUploadinfo.d.ts +3 -0
  17. package/dist/nodes/DingtalkNode/resources/doc/resourceGetUploadinfo.js +70 -0
  18. package/dist/nodes/DingtalkNode/resources/doc/resourceGetUploadinfo.js.map +1 -0
  19. package/dist/nodes/DingtalkNode/resources/notable/common.d.ts +5 -0
  20. package/dist/nodes/DingtalkNode/resources/notable/common.js +100 -0
  21. package/dist/nodes/DingtalkNode/resources/notable/common.js.map +1 -0
  22. package/dist/nodes/DingtalkNode/resources/notable/fieldCreate.d.ts +3 -0
  23. package/dist/nodes/DingtalkNode/resources/notable/fieldCreate.js +58 -0
  24. package/dist/nodes/DingtalkNode/resources/notable/fieldCreate.js.map +1 -0
  25. package/dist/nodes/DingtalkNode/resources/notable/fieldDelete.d.ts +3 -0
  26. package/dist/nodes/DingtalkNode/resources/notable/fieldDelete.js +41 -0
  27. package/dist/nodes/DingtalkNode/resources/notable/fieldDelete.js.map +1 -0
  28. package/dist/nodes/DingtalkNode/resources/notable/fieldGetAll.d.ts +3 -0
  29. package/dist/nodes/DingtalkNode/resources/notable/fieldGetAll.js +32 -0
  30. package/dist/nodes/DingtalkNode/resources/notable/fieldGetAll.js.map +1 -0
  31. package/dist/nodes/DingtalkNode/resources/notable/fieldUpdate.d.ts +3 -0
  32. package/dist/nodes/DingtalkNode/resources/notable/fieldUpdate.js +66 -0
  33. package/dist/nodes/DingtalkNode/resources/notable/fieldUpdate.js.map +1 -0
  34. package/dist/nodes/DingtalkNode/resources/notable/index.js +37 -1
  35. package/dist/nodes/DingtalkNode/resources/notable/index.js.map +1 -1
  36. package/dist/nodes/DingtalkNode/resources/notable/methods/index.d.ts +9 -0
  37. package/dist/nodes/DingtalkNode/resources/notable/methods/index.js +45 -0
  38. package/dist/nodes/DingtalkNode/resources/notable/methods/index.js.map +1 -0
  39. package/dist/nodes/DingtalkNode/resources/notable/methods/listSearch.d.ts +2 -0
  40. package/dist/nodes/DingtalkNode/resources/notable/methods/listSearch.js +29 -0
  41. package/dist/nodes/DingtalkNode/resources/notable/methods/listSearch.js.map +1 -0
  42. package/dist/nodes/DingtalkNode/resources/notable/methods/loadOptions.d.ts +3 -0
  43. package/dist/nodes/DingtalkNode/resources/notable/methods/loadOptions.js +50 -0
  44. package/dist/nodes/DingtalkNode/resources/notable/methods/loadOptions.js.map +1 -0
  45. package/dist/nodes/DingtalkNode/resources/notable/methods/resourceMapping.d.ts +2 -0
  46. package/dist/nodes/DingtalkNode/resources/notable/methods/resourceMapping.js +48 -0
  47. package/dist/nodes/DingtalkNode/resources/notable/methods/resourceMapping.js.map +1 -0
  48. package/dist/nodes/DingtalkNode/resources/notable/recordDelete.js +35 -44
  49. package/dist/nodes/DingtalkNode/resources/notable/recordDelete.js.map +1 -1
  50. package/dist/nodes/DingtalkNode/resources/notable/recordGet.js +10 -32
  51. package/dist/nodes/DingtalkNode/resources/notable/recordGet.js.map +1 -1
  52. package/dist/nodes/DingtalkNode/resources/notable/recordInsert.js +65 -40
  53. package/dist/nodes/DingtalkNode/resources/notable/recordInsert.js.map +1 -1
  54. package/dist/nodes/DingtalkNode/resources/notable/recordList.js +190 -37
  55. package/dist/nodes/DingtalkNode/resources/notable/recordList.js.map +1 -1
  56. package/dist/nodes/DingtalkNode/resources/notable/recordUpdate.js +68 -39
  57. package/dist/nodes/DingtalkNode/resources/notable/recordUpdate.js.map +1 -1
  58. package/dist/nodes/DingtalkNode/resources/notable/sheetCreate.js +13 -28
  59. package/dist/nodes/DingtalkNode/resources/notable/sheetCreate.js.map +1 -1
  60. package/dist/nodes/DingtalkNode/resources/notable/sheetDelete.js +8 -30
  61. package/dist/nodes/DingtalkNode/resources/notable/sheetDelete.js.map +1 -1
  62. package/dist/nodes/DingtalkNode/resources/notable/sheetGet.js +8 -30
  63. package/dist/nodes/DingtalkNode/resources/notable/sheetGet.js.map +1 -1
  64. package/dist/nodes/DingtalkNode/resources/notable/sheetGetAll.js +5 -23
  65. package/dist/nodes/DingtalkNode/resources/notable/sheetGetAll.js.map +1 -1
  66. package/dist/nodes/DingtalkNode/resources/notable/sheetUpdate.js +15 -38
  67. package/dist/nodes/DingtalkNode/resources/notable/sheetUpdate.js.map +1 -1
  68. package/dist/nodes/DingtalkNode/resources/user/index.js +5 -1
  69. package/dist/nodes/DingtalkNode/resources/user/index.js.map +1 -1
  70. package/dist/nodes/shared/properties/body.d.ts +14 -0
  71. package/dist/nodes/shared/properties/body.js +123 -0
  72. package/dist/nodes/shared/properties/body.js.map +1 -0
  73. package/dist/nodes/shared/properties/commaSeparatedString.d.ts +3 -0
  74. package/dist/nodes/shared/properties/commaSeparatedString.js +28 -0
  75. package/dist/nodes/shared/properties/commaSeparatedString.js.map +1 -0
  76. package/dist/nodes/shared/properties/operator.d.ts +4 -0
  77. package/dist/nodes/shared/properties/operator.js +66 -0
  78. package/dist/nodes/shared/properties/operator.js.map +1 -0
  79. package/dist/nodes/shared/request.js +2 -0
  80. package/dist/nodes/shared/request.js.map +1 -1
  81. package/dist/nodes/shared/resource.d.ts +5 -3
  82. package/dist/nodes/shared/resource.js +17 -68
  83. package/dist/nodes/shared/resource.js.map +1 -1
  84. package/dist/package.json +2 -2
  85. package/dist/tsconfig.tsbuildinfo +1 -1
  86. package/package.json +4 -3
  87. package/dist/nodes/shared/validation.d.ts +0 -2
  88. package/dist/nodes/shared/validation.js +0 -20
  89. package/dist/nodes/shared/validation.js.map +0 -1
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../shared/request");
4
+ const body_1 = require("../../../shared/properties/body");
5
+ const common_1 = require("./common");
6
+ const operator_1 = require("../../../shared/properties/operator");
7
+ const OP = 'notable.field.create';
8
+ const showOnly = { show: { operation: [OP] } };
9
+ const properties = [
10
+ ...(0, operator_1.operatorProps)(showOnly),
11
+ ...(0, common_1.baseProps)(showOnly),
12
+ ...(0, common_1.sheetProps)(showOnly),
13
+ {
14
+ displayName: '请求体 JSON',
15
+ name: 'body',
16
+ type: 'json',
17
+ default: JSON.stringify({
18
+ name: '状态',
19
+ property: {
20
+ choices: [
21
+ {
22
+ name: '完成',
23
+ },
24
+ {
25
+ name: '失败',
26
+ },
27
+ ],
28
+ },
29
+ type: 'singleSelect',
30
+ }, null, 2),
31
+ required: true,
32
+ description: '官方文档: https://open.dingtalk.com/document/orgapp/api-noatable-createfield',
33
+ displayOptions: showOnly,
34
+ },
35
+ ];
36
+ const op = {
37
+ value: OP,
38
+ name: '创建字段',
39
+ description: '在数据表中创建一个字段',
40
+ properties,
41
+ async run(itemIndex) {
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);
45
+ const raw = this.getNodeParameter('body', itemIndex);
46
+ const body = (0, body_1.parseJsonBody)(raw, this.getNode(), itemIndex);
47
+ const resp = await request_1.request.call(this, {
48
+ method: 'POST',
49
+ url: `/notable/bases/${baseId}/sheets/${sheet}/fields`,
50
+ qs: { operatorId },
51
+ body,
52
+ });
53
+ const out = resp;
54
+ return { json: out, pairedItem: { item: itemIndex } };
55
+ },
56
+ };
57
+ exports.default = op;
58
+ //# sourceMappingURL=fieldCreate.js.map
@@ -0,0 +1 @@
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,SAAS,CACrB;YACE,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,IAAI;qBACX;oBACD;wBACE,IAAI,EAAE,IAAI;qBACX;iBACF;aACF;YACD,IAAI,EAAE,cAAc;SACrB,EACD,IAAI,EACJ,CAAC,CACF;QACD,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,0EAA0E;QACvF,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC;AAEF,MAAM,EAAE,GAAiB;IACvB,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,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,UAAU,GAAG,MAAM,IAAA,wBAAa,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACxD,MAAM,GAAG,GAAG,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,MAAM;YACd,GAAG,EAAE,kBAAkB,MAAM,WAAW,KAAK,SAAS;YACtD,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"}
@@ -0,0 +1,3 @@
1
+ import type { OperationDef } from '../../../shared/operation';
2
+ declare const op: OperationDef;
3
+ export default op;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../shared/request");
4
+ const common_1 = require("./common");
5
+ const operator_1 = require("../../../shared/properties/operator");
6
+ const OP = 'notable.field.delete';
7
+ const showOnly = { show: { operation: [OP] } };
8
+ const properties = [
9
+ ...(0, operator_1.operatorProps)(showOnly),
10
+ ...(0, common_1.baseProps)(showOnly),
11
+ ...(0, common_1.sheetProps)(showOnly),
12
+ {
13
+ displayName: '字段ID或字段名称 (fieldIdOrName)',
14
+ name: 'fieldIdOrName',
15
+ type: 'string',
16
+ default: '',
17
+ required: true,
18
+ displayOptions: showOnly,
19
+ },
20
+ ];
21
+ const op = {
22
+ value: OP,
23
+ name: '删除字段',
24
+ description: '在AI表格中删除一个字段',
25
+ properties,
26
+ async run(itemIndex) {
27
+ const baseId = (0, common_1.getBase)(this, itemIndex);
28
+ const sheet = (0, common_1.getSheet)(this, itemIndex);
29
+ const field = this.getNodeParameter('fieldIdOrName', itemIndex);
30
+ const operatorId = await (0, operator_1.getOperatorId)(this, itemIndex);
31
+ const resp = await request_1.request.call(this, {
32
+ method: 'DELETE',
33
+ url: `/notable/bases/${baseId}/sheets/${sheet}/fields/${field}`,
34
+ qs: { operatorId },
35
+ });
36
+ const out = resp;
37
+ return { json: out, pairedItem: { item: itemIndex } };
38
+ },
39
+ };
40
+ exports.default = op;
41
+ //# sourceMappingURL=fieldDelete.js.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ import type { OperationDef } from '../../../shared/operation';
2
+ declare const op: OperationDef;
3
+ export default op;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../shared/request");
4
+ const common_1 = require("./common");
5
+ const operator_1 = require("../../../shared/properties/operator");
6
+ const OP = 'notable.field.getAll';
7
+ const showOnly = { show: { operation: [OP] } };
8
+ const properties = [
9
+ ...(0, operator_1.operatorProps)(showOnly),
10
+ ...(0, common_1.baseProps)(showOnly),
11
+ ...(0, common_1.sheetProps)(showOnly),
12
+ ];
13
+ const op = {
14
+ value: OP,
15
+ name: '获取所有字段',
16
+ description: '获取在数据表中的所有字段',
17
+ properties,
18
+ async run(itemIndex) {
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);
22
+ const resp = await request_1.request.call(this, {
23
+ method: 'GET',
24
+ url: `/notable/bases/${baseId}/sheets/${sheet}/fields`,
25
+ qs: { operatorId },
26
+ });
27
+ const out = resp;
28
+ return { json: out, pairedItem: { item: itemIndex } };
29
+ },
30
+ };
31
+ exports.default = op;
32
+ //# sourceMappingURL=fieldGetAll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fieldGetAll.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/fieldGetAll.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;CACxB,CAAC;AAEF,MAAM,EAAE,GAAiB;IACvB,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,QAAQ;IACd,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,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,KAAK;YACb,GAAG,EAAE,kBAAkB,MAAM,WAAW,KAAK,SAAS;YACtD,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"}
@@ -0,0 +1,3 @@
1
+ import type { OperationDef } from '../../../shared/operation';
2
+ declare const op: OperationDef;
3
+ export default op;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../shared/request");
4
+ const body_1 = require("../../../shared/properties/body");
5
+ const common_1 = require("./common");
6
+ const operator_1 = require("../../../shared/properties/operator");
7
+ const OP = 'notable.field.update';
8
+ const showOnly = { show: { operation: [OP] } };
9
+ const properties = [
10
+ ...(0, operator_1.operatorProps)(showOnly),
11
+ ...(0, common_1.baseProps)(showOnly),
12
+ ...(0, common_1.sheetProps)(showOnly),
13
+ {
14
+ displayName: '字段ID或字段名称 (fieldIdOrName)',
15
+ name: 'fieldIdOrName',
16
+ type: 'string',
17
+ default: '',
18
+ required: true,
19
+ displayOptions: showOnly,
20
+ },
21
+ {
22
+ displayName: '请求体 JSON',
23
+ name: 'body',
24
+ type: 'json',
25
+ default: JSON.stringify({
26
+ name: '字段名',
27
+ property: {
28
+ choices: [
29
+ {
30
+ name: '选项一',
31
+ },
32
+ {
33
+ name: '选项二',
34
+ },
35
+ ],
36
+ },
37
+ }, null, 2),
38
+ required: true,
39
+ description: '官方文档: https://open.dingtalk.com/document/orgapp/api-noatable-updatefield',
40
+ displayOptions: showOnly,
41
+ },
42
+ ];
43
+ const op = {
44
+ value: OP,
45
+ name: '更新字段',
46
+ description: '在数据表中更新一个字段',
47
+ properties,
48
+ async run(itemIndex) {
49
+ const baseId = (0, common_1.getBase)(this, itemIndex);
50
+ const sheet = (0, common_1.getSheet)(this, itemIndex);
51
+ const field = this.getNodeParameter('fieldIdOrName', itemIndex);
52
+ const operatorId = await (0, operator_1.getOperatorId)(this, itemIndex);
53
+ const raw = this.getNodeParameter('body', itemIndex);
54
+ const body = (0, body_1.parseJsonBody)(raw, this.getNode(), itemIndex);
55
+ const resp = await request_1.request.call(this, {
56
+ method: 'PUT',
57
+ url: `/notable/bases/${baseId}/sheets/${sheet}/fields/${field}`,
58
+ qs: { operatorId },
59
+ body,
60
+ });
61
+ const out = resp;
62
+ return { json: out, pairedItem: { item: itemIndex } };
63
+ },
64
+ };
65
+ exports.default = op;
66
+ //# sourceMappingURL=fieldUpdate.js.map
@@ -0,0 +1 @@
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,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;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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
- dir: __dirname,
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":";;AAAA,uDAA8D;AAE9D,kBAAe,IAAA,6BAAkB,EAAC;IACjC,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,SAAS;CACd,CAAC,CAAC"}
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,2 @@
1
+ import { type ILoadOptionsFunctions, type INodeListSearchResult } from 'n8n-workflow';
2
+ export declare function sheetSearch(this: ILoadOptionsFunctions, filter?: string): Promise<INodeListSearchResult>;
@@ -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;AAO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;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,2 @@
1
+ import { ILoadOptionsFunctions, ResourceMapperFields } from 'n8n-workflow';
2
+ export declare function notableGetColumns(this: ILoadOptionsFunctions): Promise<ResourceMapperFields>;
@@ -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":["../../../../../../nodes/DingtalkNode/resources/notable/methods/resourceMapping.ts"],"names":[],"mappings":";;AAUA,8CA+CC;AAlDD,wDAAqD;AACrD,qEAAqF;AAE9E,KAAK,UAAU,iBAAiB;;IAGrC,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,MAAM,IAAI,GAAG,MAAM,iBAAO,CAAC,IAAI,CAAC,IAAI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shared/request");
4
- const validation_1 = require("../../../shared/validation");
4
+ const body_1 = require("../../../shared/properties/body");
5
+ const operator_1 = require("../../../shared/properties/operator");
6
+ const commaSeparatedString_1 = require("../../../shared/properties/commaSeparatedString");
7
+ const common_1 = require("./common");
5
8
  const OP = 'notable.record.delete';
6
9
  const showOnly = { show: { operation: [OP] } };
7
- const properties = [
8
- {
9
- displayName: 'AI表格ID (baseId)',
10
- name: 'baseId',
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: '',
10
+ const formProperties = [
11
+ (0, commaSeparatedString_1.commaSeparatedStringProperty)({
12
+ displayName: '记录ID列表',
13
+ name: 'recordIds',
22
14
  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
- },
35
- {
36
- displayName: '请求体 JSON',
37
- name: 'body',
38
- type: 'json',
39
- default: JSON.stringify({
40
- recordIds: ['String'],
41
- }),
42
- required: true,
43
- description: '官方文档: https://open.dingtalk.com/document/development/api-noatable-deleterecords',
44
- displayOptions: showOnly,
45
- },
15
+ placeholder: '例如:rec001, rec002',
16
+ description: '要删除的记录ID列表,多个参数请用","分隔。支持表达式和固定值',
17
+ }),
18
+ ];
19
+ const properties = [
20
+ ...(0, operator_1.operatorProps)(showOnly),
21
+ ...(0, common_1.baseProps)(showOnly),
22
+ ...(0, common_1.sheetProps)(showOnly),
23
+ ...(0, body_1.bodyProps)(showOnly, {
24
+ defaultMode: 'form',
25
+ defaultJsonBody: JSON.stringify({
26
+ recordIds: ['rec001', 'rec002'],
27
+ }, null, 2),
28
+ jsonDescription: '请求体JSON数据。<a href="https://open.dingtalk.com/document/development/api-noatable-deleterecords" target="_blank">查看API文档</a>',
29
+ formProperties,
30
+ }),
46
31
  ];
47
32
  const op = {
48
33
  value: OP,
@@ -50,11 +35,17 @@ const op = {
50
35
  description: '删除数据表中的多行记录',
51
36
  properties,
52
37
  async run(itemIndex) {
53
- const baseId = this.getNodeParameter('baseId', itemIndex);
54
- const sheet = this.getNodeParameter('sheetIdOrName', itemIndex);
55
- const operatorId = this.getNodeParameter('operatorId', itemIndex);
56
- const raw = this.getNodeParameter('body', itemIndex);
57
- const body = (0, validation_1.parseJsonBody)(raw, this.getNode(), itemIndex);
38
+ const baseId = (0, common_1.getBase)(this, itemIndex);
39
+ const sheet = (0, common_1.getSheet)(this, itemIndex);
40
+ const operatorId = await (0, operator_1.getOperatorId)(this, itemIndex);
41
+ const body = (0, body_1.getBodyData)(this, itemIndex, {
42
+ formBuilder: (ctx, idx) => {
43
+ const recordIds = (0, commaSeparatedString_1.getCommaSeparatedValues)(ctx, idx, 'recordIds');
44
+ return {
45
+ recordIds,
46
+ };
47
+ },
48
+ });
58
49
  const resp = await request_1.request.call(this, {
59
50
  method: 'POST',
60
51
  url: `/notable/bases/${baseId}/sheets/${sheet}/records/delete`,
@@ -1 +1 @@
1
- {"version":3,"file":"recordDelete.js","sourceRoot":"","sources":["../../../../../nodes/DingtalkNode/resources/notable/recordDelete.ts"],"names":[],"mappings":";;AAOA,qDAAkD;AAClD,2DAA2D;AAE3D,MAAM,EAAE,GAAG,uBAAuB,CAAC;AAGnC,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAE/C,MAAM,UAAU,GAAsB;IACpC;QACE,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,oBAA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