@pipedream/trello 0.3.14 → 0.4.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/actions/add-attachment-to-card/add-attachment-to-card.mjs +124 -0
- package/actions/add-checklist/add-checklist.mjs +56 -38
- package/actions/add-comment/add-comment.mjs +44 -34
- package/actions/add-existing-label-to-card/add-existing-label-to-card.mjs +26 -11
- package/actions/add-member-to-card/add-member-to-card.mjs +26 -11
- package/actions/archive-card/archive-card.mjs +13 -7
- package/actions/close-board/close-board.mjs +10 -4
- package/actions/common.mjs +2 -2
- package/actions/complete-checklist-item/complete-checklist-item.mjs +61 -31
- package/actions/create-board/create-board.mjs +96 -61
- package/actions/create-card/create-card.mjs +83 -39
- package/actions/create-checklist/create-checklist.mjs +26 -14
- package/actions/create-checklist-item/create-checklist-item.mjs +64 -39
- package/actions/create-comment-on-card/create-comment-on-card.mjs +26 -9
- package/actions/create-label/create-label.mjs +37 -36
- package/actions/create-list/create-list.mjs +51 -42
- package/actions/delete-checklist/delete-checklist.mjs +24 -11
- package/actions/find-labels/find-labels.mjs +13 -10
- package/actions/find-list/find-list.mjs +12 -9
- package/actions/get-card/get-card.mjs +12 -8
- package/actions/get-list/get-list.mjs +29 -15
- package/actions/move-card-to-list/move-card-to-list.mjs +16 -12
- package/actions/remove-label-from-card/remove-label-from-card.mjs +26 -10
- package/actions/rename-list/rename-list.mjs +23 -9
- package/actions/search-boards/search-boards.mjs +17 -15
- package/actions/search-cards/search-cards.mjs +17 -15
- package/actions/search-checklists/search-checklists.mjs +102 -46
- package/actions/search-members/search-members.mjs +48 -28
- package/actions/update-card/update-card.mjs +62 -45
- package/package.json +4 -3
- package/sources/card-archived/card-archived.mjs +21 -5
- package/sources/card-due-date-reminder/card-due-date-reminder.mjs +31 -30
- package/sources/card-moved/card-moved.mjs +12 -6
- package/sources/card-updates/card-updates.mjs +19 -10
- package/sources/common/common-board-based.mjs +4 -2
- package/sources/common/common-webhook.mjs +63 -20
- package/sources/common/common.mjs +2 -2
- package/sources/custom-webhook-events/custom-webhook-events.mjs +30 -11
- package/sources/new-activity/new-activity.mjs +5 -3
- package/sources/new-attachment/new-attachment.mjs +20 -4
- package/sources/new-board/new-board.mjs +5 -3
- package/sources/new-card/new-card.mjs +19 -10
- package/sources/new-checklist/new-checklist.mjs +15 -3
- package/sources/new-comment-added-to-card/new-comment-added-to-card.mjs +30 -9
- package/sources/new-label/new-label.mjs +7 -3
- package/sources/new-label-added-to-card/new-label-added-to-card.mjs +20 -10
- package/sources/new-list/new-list.mjs +7 -3
- package/sources/new-member-on-card/new-member-on-card.mjs +15 -3
- package/sources/new-notification/new-notification.mjs +15 -5
- package/trello.app.mjs +269 -487
- package/actions/add-attachment-to-card-via-url/add-attachment-to-card-via-url.mjs +0 -73
- package/actions/add-file-as-attachment-via-url/add-file-as-attachment-via-url.mjs +0 -72
- package/actions/add-image-attachment/add-image-attachment.mjs +0 -75
- package/actions/add-label-to-card/add-label-to-card.mjs +0 -55
- package/actions/copy-board/copy-board.mjs +0 -174
- /package/{common → sources/common}/events.mjs +0 -0
@@ -0,0 +1,124 @@
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
2
|
+
import fs from "fs";
|
3
|
+
import FormData from "form-data";
|
4
|
+
import common from "../common.mjs";
|
5
|
+
|
6
|
+
export default {
|
7
|
+
...common,
|
8
|
+
key: "trello-add-attachment-to-card",
|
9
|
+
name: "Add Attachment To Card",
|
10
|
+
description: "Adds a file attachment on a card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-attachments-post)",
|
11
|
+
version: "0.0.1",
|
12
|
+
type: "action",
|
13
|
+
props: {
|
14
|
+
...common.props,
|
15
|
+
board: {
|
16
|
+
propDefinition: [
|
17
|
+
common.props.app,
|
18
|
+
"board",
|
19
|
+
],
|
20
|
+
},
|
21
|
+
cardId: {
|
22
|
+
propDefinition: [
|
23
|
+
common.props.app,
|
24
|
+
"cards",
|
25
|
+
(c) => ({
|
26
|
+
board: c.board,
|
27
|
+
}),
|
28
|
+
],
|
29
|
+
type: "string",
|
30
|
+
label: "Card",
|
31
|
+
description: "The ID of the Card to add the Attachment to",
|
32
|
+
optional: false,
|
33
|
+
},
|
34
|
+
name: {
|
35
|
+
propDefinition: [
|
36
|
+
common.props.app,
|
37
|
+
"name",
|
38
|
+
],
|
39
|
+
},
|
40
|
+
url: {
|
41
|
+
propDefinition: [
|
42
|
+
common.props.app,
|
43
|
+
"url",
|
44
|
+
],
|
45
|
+
},
|
46
|
+
mimeType: {
|
47
|
+
propDefinition: [
|
48
|
+
common.props.app,
|
49
|
+
"mimeType",
|
50
|
+
],
|
51
|
+
},
|
52
|
+
file: {
|
53
|
+
propDefinition: [
|
54
|
+
common.props.app,
|
55
|
+
"file",
|
56
|
+
],
|
57
|
+
},
|
58
|
+
setCover: {
|
59
|
+
type: "boolean",
|
60
|
+
label: "Set Cover?",
|
61
|
+
description: "Determines whether to use the new attachment as a cover for the Card",
|
62
|
+
default: false,
|
63
|
+
},
|
64
|
+
},
|
65
|
+
methods: {
|
66
|
+
...common.methods,
|
67
|
+
addAttachmentToCard({
|
68
|
+
cardId, ...args
|
69
|
+
} = {}) {
|
70
|
+
return this.app.post({
|
71
|
+
path: `/cards/${cardId}/attachments`,
|
72
|
+
...args,
|
73
|
+
});
|
74
|
+
},
|
75
|
+
},
|
76
|
+
async run({ $ }) {
|
77
|
+
const {
|
78
|
+
addAttachmentToCard,
|
79
|
+
cardId,
|
80
|
+
name,
|
81
|
+
url,
|
82
|
+
mimeType,
|
83
|
+
setCover,
|
84
|
+
file,
|
85
|
+
} = this;
|
86
|
+
|
87
|
+
let response;
|
88
|
+
const params = {
|
89
|
+
name,
|
90
|
+
mimeType,
|
91
|
+
setCover,
|
92
|
+
};
|
93
|
+
|
94
|
+
if (file && !file?.startsWith("/tmp")) {
|
95
|
+
throw new ConfigurationError("The file path must be in the `/tmp` directory");
|
96
|
+
}
|
97
|
+
|
98
|
+
if (file) {
|
99
|
+
const form = new FormData();
|
100
|
+
form.append("file", fs.createReadStream(file));
|
101
|
+
|
102
|
+
response = await addAttachmentToCard({
|
103
|
+
$,
|
104
|
+
cardId,
|
105
|
+
params,
|
106
|
+
headers: form.getHeaders(),
|
107
|
+
data: form,
|
108
|
+
});
|
109
|
+
|
110
|
+
} else {
|
111
|
+
response = await addAttachmentToCard({
|
112
|
+
$,
|
113
|
+
cardId,
|
114
|
+
params: {
|
115
|
+
...params,
|
116
|
+
url,
|
117
|
+
},
|
118
|
+
});
|
119
|
+
}
|
120
|
+
|
121
|
+
$.export("$summary", `Successfully added attachement to card ${cardId}`);
|
122
|
+
return response;
|
123
|
+
},
|
124
|
+
};
|
@@ -1,68 +1,86 @@
|
|
1
|
-
|
2
|
-
import { axios } from "@pipedream/platform";
|
1
|
+
import app from "../../trello.app.mjs";
|
3
2
|
|
4
3
|
export default {
|
5
4
|
key: "trello-add-checklist",
|
6
5
|
name: "Create a Checklist",
|
7
|
-
description: "Adds a new checklist to a card.",
|
8
|
-
version: "0.
|
6
|
+
description: "Adds a new checklist to a card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-checklists-post).",
|
7
|
+
version: "0.2.0",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
app,
|
11
|
+
boardId: {
|
12
|
+
propDefinition: [
|
13
|
+
app,
|
14
|
+
"board",
|
15
|
+
],
|
14
16
|
},
|
15
|
-
|
17
|
+
cardId: {
|
16
18
|
type: "string",
|
19
|
+
label: "Card ID",
|
17
20
|
description: "The ID of the card.",
|
21
|
+
optional: false,
|
22
|
+
propDefinition: [
|
23
|
+
app,
|
24
|
+
"cards",
|
25
|
+
({ boardId }) => ({
|
26
|
+
board: boardId,
|
27
|
+
}),
|
28
|
+
],
|
18
29
|
},
|
19
30
|
name: {
|
20
31
|
type: "string",
|
32
|
+
label: "Checklist Name",
|
21
33
|
description: "The name of the checklist.",
|
22
34
|
optional: true,
|
23
35
|
},
|
24
36
|
idChecklistSource: {
|
25
|
-
type: "string",
|
26
|
-
description: "The ID of a source checklist to copy into the new one.",
|
27
37
|
optional: true,
|
38
|
+
propDefinition: [
|
39
|
+
app,
|
40
|
+
"checklist",
|
41
|
+
({ boardId }) => ({
|
42
|
+
board: boardId,
|
43
|
+
}),
|
44
|
+
],
|
28
45
|
},
|
29
46
|
pos: {
|
30
47
|
type: "string",
|
48
|
+
label: "Position",
|
31
49
|
description: "The position of the checklist on the card. One of: top, bottom, or a positive number.",
|
32
50
|
optional: true,
|
33
51
|
},
|
34
52
|
},
|
53
|
+
methods: {
|
54
|
+
addChecklist({
|
55
|
+
cardId, ...args
|
56
|
+
} = {}) {
|
57
|
+
return this.app.post({
|
58
|
+
path: `/cards/${cardId}/checklists`,
|
59
|
+
...args,
|
60
|
+
});
|
61
|
+
},
|
62
|
+
},
|
35
63
|
async run({ $ }) {
|
36
|
-
const
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
];
|
44
|
-
let p = this;
|
45
|
-
|
46
|
-
const queryString = trelloParams.filter((param) => p[param]).map((param) => `${param}=${p[param]}`)
|
47
|
-
.join("&");
|
48
|
-
|
49
|
-
const config = {
|
50
|
-
url: `https://api.trello.com/1/cards/${id}/checklists?${queryString}`,
|
51
|
-
method: "POST",
|
52
|
-
data: "",
|
53
|
-
};
|
64
|
+
const {
|
65
|
+
addChecklist,
|
66
|
+
cardId,
|
67
|
+
name,
|
68
|
+
idChecklistSource,
|
69
|
+
pos,
|
70
|
+
} = this;
|
54
71
|
|
55
|
-
const
|
56
|
-
|
57
|
-
|
58
|
-
|
72
|
+
const response = await addChecklist({
|
73
|
+
$,
|
74
|
+
cardId,
|
75
|
+
params: {
|
76
|
+
name,
|
77
|
+
idChecklistSource,
|
78
|
+
pos,
|
79
|
+
},
|
80
|
+
});
|
59
81
|
|
60
|
-
|
61
|
-
token,
|
62
|
-
oauthSignerUri,
|
63
|
-
};
|
82
|
+
$.export("$summary", "Successfully added checklist.");
|
64
83
|
|
65
|
-
|
66
|
-
return resp;
|
84
|
+
return response;
|
67
85
|
},
|
68
86
|
};
|
@@ -1,55 +1,65 @@
|
|
1
|
-
|
2
|
-
import { axios } from "@pipedream/platform";
|
1
|
+
import app from "../../trello.app.mjs";
|
3
2
|
|
4
3
|
export default {
|
5
4
|
key: "trello-add-comment",
|
6
5
|
name: "Create a Comment",
|
7
|
-
description: "Create a new comment on a specific card.",
|
8
|
-
version: "0.
|
6
|
+
description: "Create a new comment on a specific card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-actions-comments-post).",
|
7
|
+
version: "0.2.0",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
app,
|
11
|
+
boardId: {
|
12
|
+
propDefinition: [
|
13
|
+
app,
|
14
|
+
"board",
|
15
|
+
],
|
14
16
|
},
|
15
|
-
|
17
|
+
cardId: {
|
16
18
|
type: "string",
|
19
|
+
label: "Card ID",
|
17
20
|
description: "The ID of the card.",
|
21
|
+
optional: false,
|
22
|
+
propDefinition: [
|
23
|
+
app,
|
24
|
+
"cards",
|
25
|
+
({ boardId }) => ({
|
26
|
+
board: boardId,
|
27
|
+
}),
|
28
|
+
],
|
18
29
|
},
|
19
30
|
text: {
|
20
31
|
type: "string",
|
32
|
+
label: "Comment",
|
21
33
|
description: "The comment to add.",
|
22
34
|
},
|
23
35
|
},
|
36
|
+
methods: {
|
37
|
+
addComment({
|
38
|
+
cardId, ...args
|
39
|
+
} = {}) {
|
40
|
+
return this.app.post({
|
41
|
+
path: `/cards/${cardId}/actions/comments`,
|
42
|
+
...args,
|
43
|
+
});
|
44
|
+
},
|
45
|
+
},
|
24
46
|
async run({ $ }) {
|
25
|
-
const
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
];
|
31
|
-
let p = this;
|
32
|
-
|
33
|
-
const queryString = trelloParams.filter((param) => p[param]).map((param) => `${param}=${p[param]}`)
|
34
|
-
.join("&");
|
35
|
-
|
36
|
-
const config = {
|
37
|
-
url: `https://api.trello.com/1/cards/${id}/actions/comments?${queryString}`,
|
38
|
-
method: "POST",
|
39
|
-
data: "",
|
40
|
-
};
|
47
|
+
const {
|
48
|
+
addComment,
|
49
|
+
cardId,
|
50
|
+
text,
|
51
|
+
} = this;
|
41
52
|
|
42
|
-
const
|
43
|
-
|
44
|
-
|
45
|
-
|
53
|
+
const response = await addComment({
|
54
|
+
$,
|
55
|
+
cardId,
|
56
|
+
params: {
|
57
|
+
text,
|
58
|
+
},
|
59
|
+
});
|
46
60
|
|
47
|
-
|
48
|
-
token,
|
49
|
-
oauthSignerUri,
|
50
|
-
};
|
61
|
+
$.export("$summary", "Successfully added comment.");
|
51
62
|
|
52
|
-
|
53
|
-
return resp;
|
63
|
+
return response;
|
54
64
|
},
|
55
65
|
};
|
@@ -4,20 +4,20 @@ export default {
|
|
4
4
|
...common,
|
5
5
|
key: "trello-add-existing-label-to-card",
|
6
6
|
name: "Add Existing Label to Card",
|
7
|
-
description: "Adds an existing label to the specified card. [See the
|
8
|
-
version: "0.0
|
7
|
+
description: "Adds an existing label to the specified card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idlabels-post).",
|
8
|
+
version: "0.1.0",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
...common.props,
|
12
12
|
board: {
|
13
13
|
propDefinition: [
|
14
|
-
common.props.
|
14
|
+
common.props.app,
|
15
15
|
"board",
|
16
16
|
],
|
17
17
|
},
|
18
|
-
|
18
|
+
cardId: {
|
19
19
|
propDefinition: [
|
20
|
-
common.props.
|
20
|
+
common.props.app,
|
21
21
|
"cards",
|
22
22
|
(c) => ({
|
23
23
|
board: c.board,
|
@@ -28,9 +28,9 @@ export default {
|
|
28
28
|
description: "The ID of the Card to add the Label to",
|
29
29
|
optional: false,
|
30
30
|
},
|
31
|
-
|
31
|
+
value: {
|
32
32
|
propDefinition: [
|
33
|
-
common.props.
|
33
|
+
common.props.app,
|
34
34
|
"label",
|
35
35
|
(c) => ({
|
36
36
|
board: c.board,
|
@@ -38,11 +38,26 @@ export default {
|
|
38
38
|
],
|
39
39
|
},
|
40
40
|
},
|
41
|
+
methods: {
|
42
|
+
...common.methods,
|
43
|
+
addExistingLabelToCard({
|
44
|
+
cardId, ...args
|
45
|
+
} = {}) {
|
46
|
+
return this.app.post({
|
47
|
+
path: `/cards/${cardId}/idLabels`,
|
48
|
+
...args,
|
49
|
+
});
|
50
|
+
},
|
51
|
+
},
|
41
52
|
async run({ $ }) {
|
42
|
-
const res = await this.
|
43
|
-
|
44
|
-
|
45
|
-
|
53
|
+
const res = await this.addExistingLabelToCard({
|
54
|
+
$,
|
55
|
+
cardId: this.cardId,
|
56
|
+
params: {
|
57
|
+
value: this.value,
|
58
|
+
},
|
59
|
+
});
|
60
|
+
$.export("$summary", `Successfully added label and returned \`${res.length}\` labels added.`);
|
46
61
|
return res;
|
47
62
|
},
|
48
63
|
};
|
@@ -4,20 +4,20 @@ export default {
|
|
4
4
|
...common,
|
5
5
|
key: "trello-add-member-to-card",
|
6
6
|
name: "Add Member to Card",
|
7
|
-
description: "Adds a member to the specified card. [See the
|
8
|
-
version: "0.
|
7
|
+
description: "Adds a member to the specified card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idmembers-post).",
|
8
|
+
version: "0.2.0",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
...common.props,
|
12
12
|
board: {
|
13
13
|
propDefinition: [
|
14
|
-
common.props.
|
14
|
+
common.props.app,
|
15
15
|
"board",
|
16
16
|
],
|
17
17
|
},
|
18
|
-
|
18
|
+
cardId: {
|
19
19
|
propDefinition: [
|
20
|
-
common.props.
|
20
|
+
common.props.app,
|
21
21
|
"cards",
|
22
22
|
(c) => ({
|
23
23
|
board: c.board,
|
@@ -28,9 +28,9 @@ export default {
|
|
28
28
|
description: "The ID of the Card to add the Member to",
|
29
29
|
optional: false,
|
30
30
|
},
|
31
|
-
|
31
|
+
value: {
|
32
32
|
propDefinition: [
|
33
|
-
common.props.
|
33
|
+
common.props.app,
|
34
34
|
"member",
|
35
35
|
(c) => ({
|
36
36
|
board: c.board,
|
@@ -38,11 +38,26 @@ export default {
|
|
38
38
|
],
|
39
39
|
},
|
40
40
|
},
|
41
|
+
methods: {
|
42
|
+
...common.methods,
|
43
|
+
addMemberToCard({
|
44
|
+
cardId, ...args
|
45
|
+
} = {}) {
|
46
|
+
return this.app.post({
|
47
|
+
path: `/cards/${cardId}/idMembers`,
|
48
|
+
...args,
|
49
|
+
});
|
50
|
+
},
|
51
|
+
},
|
41
52
|
async run({ $ }) {
|
42
|
-
const res = await this.
|
43
|
-
|
44
|
-
|
45
|
-
|
53
|
+
const res = await this.addMemberToCard({
|
54
|
+
$,
|
55
|
+
cardId: this.cardId,
|
56
|
+
params: {
|
57
|
+
value: this.value,
|
58
|
+
},
|
59
|
+
});
|
60
|
+
$.export("$summary", `Successfully added member ${res[0].fullName} to card ${this.cardId}`);
|
46
61
|
return res;
|
47
62
|
},
|
48
63
|
};
|
@@ -4,20 +4,20 @@ export default {
|
|
4
4
|
...common,
|
5
5
|
key: "trello-archive-card",
|
6
6
|
name: "Archive Card",
|
7
|
-
description: "Archives a card. [See the
|
8
|
-
version: "0.
|
7
|
+
description: "Archives a card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put).",
|
8
|
+
version: "0.2.0",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
...common.props,
|
12
12
|
board: {
|
13
13
|
propDefinition: [
|
14
|
-
common.props.
|
14
|
+
common.props.app,
|
15
15
|
"board",
|
16
16
|
],
|
17
17
|
},
|
18
|
-
|
18
|
+
cardId: {
|
19
19
|
propDefinition: [
|
20
|
-
common.props.
|
20
|
+
common.props.app,
|
21
21
|
"cards",
|
22
22
|
(c) => ({
|
23
23
|
board: c.board,
|
@@ -30,8 +30,14 @@ export default {
|
|
30
30
|
},
|
31
31
|
},
|
32
32
|
async run({ $ }) {
|
33
|
-
const res = await this.
|
34
|
-
|
33
|
+
const res = await this.app.updateCard({
|
34
|
+
$,
|
35
|
+
cardId: this.cardId,
|
36
|
+
data: {
|
37
|
+
closed: true,
|
38
|
+
},
|
39
|
+
});
|
40
|
+
$.export("$summary", `Successfully archived card ${this.cardId}`);
|
35
41
|
return res;
|
36
42
|
},
|
37
43
|
};
|
@@ -4,21 +4,27 @@ export default {
|
|
4
4
|
...common,
|
5
5
|
key: "trello-close-board",
|
6
6
|
name: "Close Board",
|
7
|
-
description: "Closes a board. [See the
|
8
|
-
version: "0.0
|
7
|
+
description: "Closes a board. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-put).",
|
8
|
+
version: "0.1.0",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
...common.props,
|
12
12
|
boardId: {
|
13
13
|
propDefinition: [
|
14
|
-
common.props.
|
14
|
+
common.props.app,
|
15
15
|
"board",
|
16
16
|
],
|
17
17
|
description: "The ID of the Board to close",
|
18
18
|
},
|
19
19
|
},
|
20
20
|
async run({ $ }) {
|
21
|
-
const res = await this.
|
21
|
+
const res = await this.app.updateBoard({
|
22
|
+
$,
|
23
|
+
boardId: this.boardId,
|
24
|
+
data: {
|
25
|
+
closed: true,
|
26
|
+
},
|
27
|
+
});
|
22
28
|
$.export("$summary", `Successfully closed board ${this.boardId}`);
|
23
29
|
return res;
|
24
30
|
},
|
package/actions/common.mjs
CHANGED
@@ -1,49 +1,79 @@
|
|
1
|
-
|
2
|
-
import { axios } from "@pipedream/platform";
|
1
|
+
import app from "../../trello.app.mjs";
|
3
2
|
|
4
3
|
export default {
|
5
4
|
key: "trello-complete-checklist-item",
|
6
5
|
name: "Complete a Checklist Item",
|
7
|
-
description: "Completes an existing checklist item in a card.",
|
8
|
-
version: "0.
|
6
|
+
description: "Completes an existing checklist item in a card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-checkitem-idcheckitem-put).",
|
7
|
+
version: "0.2.0",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
app,
|
11
|
+
board: {
|
12
|
+
propDefinition: [
|
13
|
+
app,
|
14
|
+
"board",
|
15
|
+
],
|
14
16
|
},
|
15
|
-
|
17
|
+
cardId: {
|
18
|
+
propDefinition: [
|
19
|
+
app,
|
20
|
+
"cards",
|
21
|
+
(c) => ({
|
22
|
+
board: c.board,
|
23
|
+
}),
|
24
|
+
],
|
16
25
|
type: "string",
|
26
|
+
label: "Card ID",
|
17
27
|
description: "The ID of the card.",
|
28
|
+
optional: false,
|
18
29
|
},
|
19
|
-
|
20
|
-
|
21
|
-
|
30
|
+
checklistId: {
|
31
|
+
propDefinition: [
|
32
|
+
app,
|
33
|
+
"checklist",
|
34
|
+
({ cardId }) => ({
|
35
|
+
card: cardId,
|
36
|
+
}),
|
37
|
+
],
|
38
|
+
},
|
39
|
+
checklistItemId: {
|
40
|
+
propDefinition: [
|
41
|
+
app,
|
42
|
+
"checklistItemId",
|
43
|
+
({ checklistId }) => ({
|
44
|
+
checklistId,
|
45
|
+
}),
|
46
|
+
],
|
47
|
+
},
|
48
|
+
},
|
49
|
+
methods: {
|
50
|
+
completeChecklistItem({
|
51
|
+
cardId, checklistItemId, ...args
|
52
|
+
} = {}) {
|
53
|
+
return this.app.put({
|
54
|
+
path: `/cards/${cardId}/checkItem/${checklistItemId}`,
|
55
|
+
...args,
|
56
|
+
});
|
22
57
|
},
|
23
58
|
},
|
24
59
|
async run({ $ }) {
|
25
|
-
const
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
const config = {
|
31
|
-
url: `https://api.trello.com/1/cards/${id}/checkItem/${idCheckItem}?state=complete`,
|
32
|
-
method: "PUT",
|
33
|
-
data: "",
|
34
|
-
};
|
60
|
+
const {
|
61
|
+
completeChecklistItem,
|
62
|
+
cardId,
|
63
|
+
checklistItemId,
|
64
|
+
} = this;
|
35
65
|
|
36
|
-
const
|
37
|
-
|
38
|
-
|
39
|
-
|
66
|
+
const response = await completeChecklistItem({
|
67
|
+
$,
|
68
|
+
cardId,
|
69
|
+
checklistItemId,
|
70
|
+
params: {
|
71
|
+
state: "complete",
|
72
|
+
},
|
73
|
+
});
|
40
74
|
|
41
|
-
|
42
|
-
token,
|
43
|
-
oauthSignerUri,
|
44
|
-
};
|
75
|
+
$.export("$summary", "Successfully completed checklist item.");
|
45
76
|
|
46
|
-
|
47
|
-
return resp;
|
77
|
+
return response;
|
48
78
|
},
|
49
79
|
};
|