@pipedream/trello 0.3.14 → 0.4.1
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 +131 -0
- package/actions/add-checklist/add-checklist.mjs +50 -42
- package/actions/add-comment/add-comment.mjs +44 -35
- package/actions/add-existing-label-to-card/add-existing-label-to-card.mjs +19 -14
- package/actions/add-member-to-card/add-member-to-card.mjs +19 -14
- package/actions/archive-card/archive-card.mjs +15 -10
- package/actions/{common.mjs → common/common.mjs} +2 -2
- package/actions/complete-checklist-item/complete-checklist-item.mjs +51 -31
- package/actions/create-board/create-board.mjs +86 -88
- package/actions/create-card/create-card.mjs +102 -53
- package/actions/create-checklist-item/create-checklist-item.mjs +54 -39
- package/actions/create-label/create-label.mjs +38 -50
- package/actions/create-list/create-list.mjs +43 -42
- package/actions/delete-checklist/delete-checklist.mjs +17 -14
- package/actions/find-labels/find-labels.mjs +14 -12
- package/actions/find-list/find-list.mjs +13 -10
- package/actions/get-card/get-card.mjs +13 -9
- package/actions/get-list/get-list.mjs +29 -15
- package/actions/move-card-to-list/move-card-to-list.mjs +17 -13
- package/actions/remove-label-from-card/remove-label-from-card.mjs +20 -13
- package/actions/rename-list/rename-list.mjs +24 -10
- package/actions/search-boards/search-boards.mjs +22 -18
- package/actions/search-cards/search-cards.mjs +23 -18
- package/actions/search-checklists/search-checklists.mjs +96 -59
- package/actions/search-members/search-members.mjs +44 -34
- package/actions/update-card/update-card.mjs +68 -50
- package/common/constants.mjs +128 -0
- package/common/fields.mjs +1 -0
- package/package.json +5 -3
- package/sources/card-archived/card-archived.mjs +22 -18
- package/sources/card-archived/test-event.mjs +64 -0
- package/sources/card-due-date-reminder/card-due-date-reminder.mjs +118 -39
- package/sources/card-due-date-reminder/test-event.mjs +75 -0
- package/sources/card-moved/card-moved.mjs +30 -27
- package/sources/card-moved/test-event.mjs +78 -0
- package/sources/card-updates/card-updates.mjs +29 -27
- package/sources/card-updates/test-event.mjs +86 -0
- package/sources/common/actions.mjs +206 -0
- package/sources/common/common-board-based.mjs +16 -9
- package/sources/common/common-webhook.mjs +86 -32
- package/sources/common/common.mjs +7 -4
- package/sources/custom-webhook-events/custom-webhook-events.mjs +37 -49
- package/sources/new-activity/new-activity.mjs +25 -32
- package/sources/new-attachment/new-attachment.mjs +42 -35
- package/sources/new-attachment/test-event.mjs +69 -0
- package/sources/new-board/new-board.mjs +21 -12
- package/sources/new-board/test-event.mjs +100 -0
- package/sources/new-card/new-card.mjs +29 -27
- package/sources/new-card/test-event.mjs +79 -0
- package/sources/new-checklist/new-checklist.mjs +42 -13
- package/sources/new-checklist/test-event.mjs +22 -0
- package/sources/new-comment-added-to-card/new-comment-added-to-card.mjs +49 -34
- package/sources/new-comment-added-to-card/test-event.mjs +298 -0
- package/sources/new-label/new-label.mjs +17 -14
- package/sources/new-label/test-event.mjs +7 -0
- package/sources/new-label-added-to-card/new-label-added-to-card.mjs +38 -29
- package/sources/new-label-added-to-card/test-event.mjs +85 -0
- package/sources/new-member-on-card/new-member-on-card.mjs +21 -18
- package/sources/new-member-on-card/test-event.mjs +83 -0
- package/sources/new-notification/new-notification.mjs +8 -7
- package/trello.app.mjs +454 -494
- 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/close-board/close-board.mjs +0 -25
- package/actions/copy-board/copy-board.mjs +0 -174
- package/actions/create-checklist/create-checklist.mjs +0 -66
- package/actions/create-comment-on-card/create-comment-on-card.mjs +0 -42
- package/sources/new-list/new-list.mjs +0 -29
- /package/{common → sources/common}/events.mjs +0 -0
@@ -0,0 +1,131 @@
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
2
|
+
import fs from "fs";
|
3
|
+
import FormData from "form-data";
|
4
|
+
import app from "../../trello.app.mjs";
|
5
|
+
|
6
|
+
export default {
|
7
|
+
key: "trello-add-attachment-to-card",
|
8
|
+
name: "Add Attachment To Card",
|
9
|
+
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)",
|
10
|
+
version: "0.0.2",
|
11
|
+
type: "action",
|
12
|
+
props: {
|
13
|
+
app,
|
14
|
+
board: {
|
15
|
+
propDefinition: [
|
16
|
+
app,
|
17
|
+
"board",
|
18
|
+
],
|
19
|
+
},
|
20
|
+
cardId: {
|
21
|
+
propDefinition: [
|
22
|
+
app,
|
23
|
+
"cards",
|
24
|
+
(c) => ({
|
25
|
+
board: c.board,
|
26
|
+
}),
|
27
|
+
],
|
28
|
+
type: "string",
|
29
|
+
label: "Card",
|
30
|
+
description: "The ID of the Card to add the Attachment to",
|
31
|
+
optional: false,
|
32
|
+
},
|
33
|
+
name: {
|
34
|
+
propDefinition: [
|
35
|
+
app,
|
36
|
+
"name",
|
37
|
+
],
|
38
|
+
},
|
39
|
+
fileType: {
|
40
|
+
propDefinition: [
|
41
|
+
app,
|
42
|
+
"fileType",
|
43
|
+
],
|
44
|
+
reloadProps: true,
|
45
|
+
},
|
46
|
+
url: {
|
47
|
+
propDefinition: [
|
48
|
+
app,
|
49
|
+
"url",
|
50
|
+
],
|
51
|
+
hidden: true,
|
52
|
+
},
|
53
|
+
file: {
|
54
|
+
propDefinition: [
|
55
|
+
app,
|
56
|
+
"file",
|
57
|
+
],
|
58
|
+
hidden: true,
|
59
|
+
},
|
60
|
+
mimeType: {
|
61
|
+
propDefinition: [
|
62
|
+
app,
|
63
|
+
"mimeType",
|
64
|
+
],
|
65
|
+
hidden: true,
|
66
|
+
},
|
67
|
+
setCover: {
|
68
|
+
type: "boolean",
|
69
|
+
label: "Set Cover?",
|
70
|
+
description: "Determines whether to use the new attachment as a cover for the Card",
|
71
|
+
default: false,
|
72
|
+
optional: true,
|
73
|
+
},
|
74
|
+
},
|
75
|
+
async additionalProps(props) {
|
76
|
+
const attachmentIsPath = this.fileType === "path";
|
77
|
+
const attachmentIsUrl = this.fileType === "url";
|
78
|
+
props.file.hidden = !attachmentIsPath;
|
79
|
+
props.mimeType.hidden = !attachmentIsPath;
|
80
|
+
props.url.hidden = !attachmentIsUrl;
|
81
|
+
|
82
|
+
return {};
|
83
|
+
},
|
84
|
+
async run({ $ }) {
|
85
|
+
const {
|
86
|
+
cardId,
|
87
|
+
name,
|
88
|
+
url,
|
89
|
+
mimeType,
|
90
|
+
setCover,
|
91
|
+
file,
|
92
|
+
} = this;
|
93
|
+
|
94
|
+
let response;
|
95
|
+
const params = {
|
96
|
+
name,
|
97
|
+
mimeType,
|
98
|
+
setCover,
|
99
|
+
};
|
100
|
+
|
101
|
+
if (file && !file?.startsWith("/tmp")) {
|
102
|
+
throw new ConfigurationError("The file path must be in the `/tmp` directory");
|
103
|
+
}
|
104
|
+
|
105
|
+
if (file) {
|
106
|
+
const form = new FormData();
|
107
|
+
form.append("file", fs.createReadStream(file));
|
108
|
+
|
109
|
+
response = await this.app.addAttachmentToCard({
|
110
|
+
$,
|
111
|
+
cardId,
|
112
|
+
params,
|
113
|
+
headers: form.getHeaders(),
|
114
|
+
data: form,
|
115
|
+
});
|
116
|
+
|
117
|
+
} else {
|
118
|
+
response = await this.app.addAttachmentToCard({
|
119
|
+
$,
|
120
|
+
cardId,
|
121
|
+
params: {
|
122
|
+
...params,
|
123
|
+
url,
|
124
|
+
},
|
125
|
+
});
|
126
|
+
}
|
127
|
+
|
128
|
+
$.export("$summary", `Successfully added attachement to card ${cardId}`);
|
129
|
+
return response;
|
130
|
+
},
|
131
|
+
};
|
@@ -1,68 +1,76 @@
|
|
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
|
-
name: "
|
7
|
-
description: "Adds a new checklist to a card.",
|
8
|
-
version: "0.1
|
5
|
+
name: "Add Checklist",
|
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.1",
|
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
|
+
],
|
45
|
+
label: "Copy from Checklist",
|
28
46
|
},
|
29
47
|
pos: {
|
30
|
-
|
31
|
-
|
32
|
-
|
48
|
+
propDefinition: [
|
49
|
+
app,
|
50
|
+
"pos",
|
51
|
+
],
|
33
52
|
},
|
34
53
|
},
|
35
54
|
async run({ $ }) {
|
36
|
-
const
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
"pos",
|
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
|
-
};
|
55
|
+
const {
|
56
|
+
cardId,
|
57
|
+
name,
|
58
|
+
idChecklistSource,
|
59
|
+
pos,
|
60
|
+
} = this;
|
54
61
|
|
55
|
-
const
|
56
|
-
|
57
|
-
|
58
|
-
|
62
|
+
const response = await this.app.addChecklist({
|
63
|
+
$,
|
64
|
+
cardId,
|
65
|
+
params: {
|
66
|
+
name,
|
67
|
+
idChecklistSource,
|
68
|
+
pos,
|
69
|
+
},
|
70
|
+
});
|
59
71
|
|
60
|
-
|
61
|
-
token,
|
62
|
-
oauthSignerUri,
|
63
|
-
};
|
72
|
+
$.export("$summary", `Successfully added checklist with ID: ${response.id}`);
|
64
73
|
|
65
|
-
|
66
|
-
return resp;
|
74
|
+
return response;
|
67
75
|
},
|
68
76
|
};
|
@@ -1,55 +1,64 @@
|
|
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
|
-
name: "
|
7
|
-
description: "Create a new comment on a specific card.",
|
8
|
-
version: "0.1
|
5
|
+
name: "Add Comment",
|
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.1",
|
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
|
-
"text",
|
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
|
+
cardId,
|
49
|
+
text,
|
50
|
+
} = this;
|
41
51
|
|
42
|
-
const
|
43
|
-
|
44
|
-
|
45
|
-
|
52
|
+
const response = await this.app.addComment({
|
53
|
+
$,
|
54
|
+
cardId,
|
55
|
+
params: {
|
56
|
+
text,
|
57
|
+
},
|
58
|
+
});
|
46
59
|
|
47
|
-
|
48
|
-
token,
|
49
|
-
oauthSignerUri,
|
50
|
-
};
|
60
|
+
$.export("$summary", `Successfully added comment with ID: ${response.id}`);
|
51
61
|
|
52
|
-
|
53
|
-
return resp;
|
62
|
+
return response;
|
54
63
|
},
|
55
64
|
};
|
@@ -1,23 +1,22 @@
|
|
1
|
-
import
|
1
|
+
import app from "../../trello.app.mjs";
|
2
2
|
|
3
3
|
export default {
|
4
|
-
...common,
|
5
4
|
key: "trello-add-existing-label-to-card",
|
6
5
|
name: "Add Existing Label to Card",
|
7
|
-
description: "Adds an existing label to the specified card. [See the
|
8
|
-
version: "0.
|
6
|
+
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).",
|
7
|
+
version: "0.1.1",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
10
|
+
app,
|
12
11
|
board: {
|
13
12
|
propDefinition: [
|
14
|
-
|
13
|
+
app,
|
15
14
|
"board",
|
16
15
|
],
|
17
16
|
},
|
18
|
-
|
17
|
+
cardId: {
|
19
18
|
propDefinition: [
|
20
|
-
|
19
|
+
app,
|
21
20
|
"cards",
|
22
21
|
(c) => ({
|
23
22
|
board: c.board,
|
@@ -28,21 +27,27 @@ export default {
|
|
28
27
|
description: "The ID of the Card to add the Label to",
|
29
28
|
optional: false,
|
30
29
|
},
|
31
|
-
|
30
|
+
value: {
|
32
31
|
propDefinition: [
|
33
|
-
|
32
|
+
app,
|
34
33
|
"label",
|
35
34
|
(c) => ({
|
36
35
|
board: c.board,
|
36
|
+
card: c.cardId,
|
37
|
+
excludeCardLabels: true,
|
37
38
|
}),
|
38
39
|
],
|
39
40
|
},
|
40
41
|
},
|
41
42
|
async run({ $ }) {
|
42
|
-
const res = await this.
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
const res = await this.app.addExistingLabelToCard({
|
44
|
+
$,
|
45
|
+
cardId: this.cardId,
|
46
|
+
params: {
|
47
|
+
value: this.value,
|
48
|
+
},
|
49
|
+
});
|
50
|
+
$.export("$summary", `Successfully added label and returned \`${res.length}\` labels added.`);
|
46
51
|
return res;
|
47
52
|
},
|
48
53
|
};
|
@@ -1,23 +1,22 @@
|
|
1
|
-
import
|
1
|
+
import app from "../../trello.app.mjs";
|
2
2
|
|
3
3
|
export default {
|
4
|
-
...common,
|
5
4
|
key: "trello-add-member-to-card",
|
6
5
|
name: "Add Member to Card",
|
7
|
-
description: "Adds a member to the specified card. [See the
|
8
|
-
version: "0.1
|
6
|
+
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).",
|
7
|
+
version: "0.2.1",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
10
|
+
app,
|
12
11
|
board: {
|
13
12
|
propDefinition: [
|
14
|
-
|
13
|
+
app,
|
15
14
|
"board",
|
16
15
|
],
|
17
16
|
},
|
18
|
-
|
17
|
+
cardId: {
|
19
18
|
propDefinition: [
|
20
|
-
|
19
|
+
app,
|
21
20
|
"cards",
|
22
21
|
(c) => ({
|
23
22
|
board: c.board,
|
@@ -28,21 +27,27 @@ export default {
|
|
28
27
|
description: "The ID of the Card to add the Member to",
|
29
28
|
optional: false,
|
30
29
|
},
|
31
|
-
|
30
|
+
value: {
|
32
31
|
propDefinition: [
|
33
|
-
|
32
|
+
app,
|
34
33
|
"member",
|
35
34
|
(c) => ({
|
36
35
|
board: c.board,
|
36
|
+
card: c.cardId,
|
37
|
+
excludeCardMembers: true,
|
37
38
|
}),
|
38
39
|
],
|
39
40
|
},
|
40
41
|
},
|
41
42
|
async run({ $ }) {
|
42
|
-
const res = await this.
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
const res = await this.app.addMemberToCard({
|
44
|
+
$,
|
45
|
+
cardId: this.cardId,
|
46
|
+
params: {
|
47
|
+
value: this.value,
|
48
|
+
},
|
49
|
+
});
|
50
|
+
$.export("$summary", `Successfully added member ${res[0].fullName} to card ${this.cardId}`);
|
46
51
|
return res;
|
47
52
|
},
|
48
53
|
};
|
@@ -1,23 +1,22 @@
|
|
1
|
-
import
|
1
|
+
import app from "../../trello.app.mjs";
|
2
2
|
|
3
3
|
export default {
|
4
|
-
...common,
|
5
4
|
key: "trello-archive-card",
|
6
5
|
name: "Archive Card",
|
7
|
-
description: "Archives a card. [See the
|
8
|
-
version: "0.1
|
6
|
+
description: "Archives a card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put).",
|
7
|
+
version: "0.2.1",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
10
|
+
app,
|
12
11
|
board: {
|
13
12
|
propDefinition: [
|
14
|
-
|
13
|
+
app,
|
15
14
|
"board",
|
16
15
|
],
|
17
16
|
},
|
18
|
-
|
17
|
+
cardId: {
|
19
18
|
propDefinition: [
|
20
|
-
|
19
|
+
app,
|
21
20
|
"cards",
|
22
21
|
(c) => ({
|
23
22
|
board: c.board,
|
@@ -30,8 +29,14 @@ export default {
|
|
30
29
|
},
|
31
30
|
},
|
32
31
|
async run({ $ }) {
|
33
|
-
const res = await this.
|
34
|
-
|
32
|
+
const res = await this.app.updateCard({
|
33
|
+
$,
|
34
|
+
cardId: this.cardId,
|
35
|
+
data: {
|
36
|
+
closed: true,
|
37
|
+
},
|
38
|
+
});
|
39
|
+
$.export("$summary", `Successfully archived card ${this.cardId}`);
|
35
40
|
return res;
|
36
41
|
},
|
37
42
|
};
|
@@ -1,49 +1,69 @@
|
|
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.1
|
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.1",
|
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
|
+
checklistCardsOnly: true,
|
24
|
+
}),
|
25
|
+
],
|
16
26
|
type: "string",
|
27
|
+
label: "Card ID",
|
17
28
|
description: "The ID of the card.",
|
29
|
+
optional: false,
|
18
30
|
},
|
19
|
-
|
20
|
-
|
21
|
-
|
31
|
+
checklistId: {
|
32
|
+
propDefinition: [
|
33
|
+
app,
|
34
|
+
"checklist",
|
35
|
+
({ cardId }) => ({
|
36
|
+
card: cardId,
|
37
|
+
}),
|
38
|
+
],
|
39
|
+
},
|
40
|
+
checklistItemId: {
|
41
|
+
propDefinition: [
|
42
|
+
app,
|
43
|
+
"checklistItemId",
|
44
|
+
({ checklistId }) => ({
|
45
|
+
checklistId,
|
46
|
+
}),
|
47
|
+
],
|
22
48
|
},
|
23
49
|
},
|
24
50
|
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
|
-
};
|
51
|
+
const {
|
52
|
+
cardId,
|
53
|
+
checklistItemId,
|
54
|
+
} = this;
|
35
55
|
|
36
|
-
const
|
37
|
-
|
38
|
-
|
39
|
-
|
56
|
+
const response = await this.app.completeChecklistItem({
|
57
|
+
$,
|
58
|
+
cardId,
|
59
|
+
checklistItemId,
|
60
|
+
params: {
|
61
|
+
state: "complete",
|
62
|
+
},
|
63
|
+
});
|
40
64
|
|
41
|
-
|
42
|
-
token,
|
43
|
-
oauthSignerUri,
|
44
|
-
};
|
65
|
+
$.export("$summary", `Successfully completed checklist item with ID: ${checklistItemId}`);
|
45
66
|
|
46
|
-
|
47
|
-
return resp;
|
67
|
+
return response;
|
48
68
|
},
|
49
69
|
};
|