@pipedream/trello 0.3.13 → 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/README.md +9 -10
- 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 +64 -47
- package/package.json +5 -5
- 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
@@ -4,20 +4,20 @@ export default {
|
|
4
4
|
...common,
|
5
5
|
key: "trello-create-checklist",
|
6
6
|
name: "Create Checklist",
|
7
|
-
description: "Creates a checklist on the specified card. [See the
|
8
|
-
version: "0.0
|
7
|
+
description: "Creates a checklist on the specified card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-checklists/#api-checklists-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
|
idCard: {
|
19
19
|
propDefinition: [
|
20
|
-
common.props.
|
20
|
+
common.props.app,
|
21
21
|
"cards",
|
22
22
|
(c) => ({
|
23
23
|
board: c.board,
|
@@ -30,21 +30,22 @@ export default {
|
|
30
30
|
},
|
31
31
|
name: {
|
32
32
|
propDefinition: [
|
33
|
-
common.props.
|
33
|
+
common.props.app,
|
34
34
|
"name",
|
35
35
|
],
|
36
36
|
description: "The name of the checklist. Should be a string of length 1 to 16384.",
|
37
37
|
},
|
38
38
|
pos: {
|
39
39
|
propDefinition: [
|
40
|
-
common.props.
|
40
|
+
common.props.app,
|
41
41
|
"pos",
|
42
42
|
],
|
43
43
|
description: "The position of the new checklist. Valid values: `top`, `bottom`, or a positive float.",
|
44
44
|
},
|
45
45
|
idChecklistSource: {
|
46
|
+
optional: true,
|
46
47
|
propDefinition: [
|
47
|
-
common.props.
|
48
|
+
common.props.app,
|
48
49
|
"checklist",
|
49
50
|
(c) => ({
|
50
51
|
board: c.board,
|
@@ -52,14 +53,25 @@ export default {
|
|
52
53
|
],
|
53
54
|
},
|
54
55
|
},
|
56
|
+
methods: {
|
57
|
+
...common.methods,
|
58
|
+
createChecklist(args = {}) {
|
59
|
+
return this.app.post({
|
60
|
+
path: "/checklists",
|
61
|
+
...args,
|
62
|
+
});
|
63
|
+
},
|
64
|
+
},
|
55
65
|
async run({ $ }) {
|
56
|
-
const
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
66
|
+
const res = await this.createChecklist({
|
67
|
+
$,
|
68
|
+
params: {
|
69
|
+
idCard: this.idCard,
|
70
|
+
name: this.name,
|
71
|
+
pos: this.pos,
|
72
|
+
idChecklistSource: this.idChecklistSource,
|
73
|
+
},
|
74
|
+
});
|
63
75
|
$.export("$summary", `Successfully created checklist ${res.name}`);
|
64
76
|
return res;
|
65
77
|
},
|
@@ -1,67 +1,92 @@
|
|
1
|
-
|
2
|
-
import { axios } from "@pipedream/platform";
|
1
|
+
import app from "../../trello.app.mjs";
|
3
2
|
|
4
3
|
export default {
|
5
4
|
key: "trello-create-checklist-item",
|
6
5
|
name: "Create a Checklist Item",
|
7
|
-
description: "Creates a new checklist item in a card.",
|
8
|
-
version: "0.
|
6
|
+
description: "Creates a new checklist item in a card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-checklists/#api-checklists-id-checkitems-post).",
|
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
|
+
card: {
|
18
|
+
propDefinition: [
|
19
|
+
app,
|
20
|
+
"cards",
|
21
|
+
({ board }) => ({
|
22
|
+
board,
|
23
|
+
}),
|
24
|
+
],
|
16
25
|
type: "string",
|
26
|
+
label: "Card",
|
27
|
+
description: "The ID of the Card that the checklist item should be added to",
|
28
|
+
optional: false,
|
29
|
+
},
|
30
|
+
checklistId: {
|
31
|
+
label: "Checklist ID",
|
17
32
|
description: "ID of a checklist.",
|
33
|
+
propDefinition: [
|
34
|
+
app,
|
35
|
+
"checklist",
|
36
|
+
({ card }) => ({
|
37
|
+
card,
|
38
|
+
}),
|
39
|
+
],
|
18
40
|
},
|
19
41
|
name: {
|
20
42
|
type: "string",
|
43
|
+
label: "Name",
|
21
44
|
description: "The name of the new check item on the checklist. Should be a string of length 1 to 16384.",
|
22
45
|
},
|
23
46
|
pos: {
|
24
|
-
|
25
|
-
|
26
|
-
|
47
|
+
propDefinition: [
|
48
|
+
app,
|
49
|
+
"pos",
|
50
|
+
],
|
27
51
|
},
|
28
52
|
checked: {
|
29
53
|
type: "boolean",
|
54
|
+
label: "Checked",
|
30
55
|
description: "Determines whether the check item is already checked when created.",
|
31
56
|
optional: true,
|
32
57
|
},
|
33
58
|
},
|
59
|
+
methods: {
|
60
|
+
createChecklistItem({
|
61
|
+
checklistId, ...args
|
62
|
+
} = {}) {
|
63
|
+
return this.app.post({
|
64
|
+
path: `/checklists/${checklistId}/checkItems`,
|
65
|
+
...args,
|
66
|
+
});
|
67
|
+
},
|
68
|
+
},
|
34
69
|
async run({ $ }) {
|
35
|
-
const
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
];
|
43
|
-
let p = this;
|
44
|
-
|
45
|
-
const queryString = trelloParams.filter((param) => p[param]).map((param) => `${param}=${p[param]}`)
|
46
|
-
.join("&");
|
47
|
-
|
48
|
-
const config = {
|
49
|
-
url: `https://api.trello.com/1/checklists/${id}/checkItems?${queryString}`,
|
50
|
-
method: "POST",
|
51
|
-
data: "",
|
52
|
-
};
|
70
|
+
const {
|
71
|
+
createChecklistItem,
|
72
|
+
checklistId,
|
73
|
+
name,
|
74
|
+
pos,
|
75
|
+
checked,
|
76
|
+
} = this;
|
53
77
|
|
54
|
-
const
|
55
|
-
|
56
|
-
|
57
|
-
|
78
|
+
const response = await createChecklistItem({
|
79
|
+
$,
|
80
|
+
checklistId,
|
81
|
+
params: {
|
82
|
+
name,
|
83
|
+
pos,
|
84
|
+
checked,
|
85
|
+
},
|
86
|
+
});
|
58
87
|
|
59
|
-
|
60
|
-
token,
|
61
|
-
oauthSignerUri,
|
62
|
-
};
|
88
|
+
$.export("$summary", "Successfully created a checklist item");
|
63
89
|
|
64
|
-
|
65
|
-
return resp;
|
90
|
+
return response;
|
66
91
|
},
|
67
92
|
};
|
@@ -4,23 +4,23 @@ export default {
|
|
4
4
|
...common,
|
5
5
|
key: "trello-create-comment-on-card",
|
6
6
|
name: "Create Comment on Card",
|
7
|
-
description: "Creates a new comment on a card. [See the
|
8
|
-
version: "0.0
|
7
|
+
description: "Creates a new comment on a card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-actions-comments-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
|
-
(
|
23
|
-
board
|
22
|
+
({ board }) => ({
|
23
|
+
board,
|
24
24
|
}),
|
25
25
|
],
|
26
26
|
type: "string",
|
@@ -34,9 +34,26 @@ export default {
|
|
34
34
|
description: "Text for the comment to be created.",
|
35
35
|
},
|
36
36
|
},
|
37
|
+
methods: {
|
38
|
+
...common.methods,
|
39
|
+
createCommentOnCard({
|
40
|
+
cardId, ...args
|
41
|
+
} = {}) {
|
42
|
+
return this.app.post({
|
43
|
+
path: `/cards/${cardId}/actions/comments`,
|
44
|
+
...args,
|
45
|
+
});
|
46
|
+
},
|
47
|
+
},
|
37
48
|
async run({ $ }) {
|
38
|
-
const res = await this.
|
39
|
-
|
49
|
+
const res = await this.createCommentOnCard({
|
50
|
+
$,
|
51
|
+
cardId: this.cardId,
|
52
|
+
params: {
|
53
|
+
text: this.comment,
|
54
|
+
},
|
55
|
+
});
|
56
|
+
$.export("$summary", `Successfully added comment to card ${this.cardId}`);
|
40
57
|
return res;
|
41
58
|
},
|
42
59
|
};
|
@@ -1,23 +1,30 @@
|
|
1
|
-
|
2
|
-
import { axios } from "@pipedream/platform";
|
1
|
+
import app from "../../trello.app.mjs";
|
3
2
|
|
4
3
|
export default {
|
5
4
|
key: "trello-create-label",
|
6
5
|
name: "Create Label",
|
7
|
-
description: "Creates a new label on the specified board.",
|
8
|
-
version: "0.
|
6
|
+
description: "Creates a new label on the specified board. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-labels/#api-labels-post).",
|
7
|
+
version: "0.2.0",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
app,
|
11
|
+
idBoard: {
|
12
|
+
type: "string",
|
13
|
+
label: "Board ID",
|
14
|
+
description: "The ID of the board to create the label on.",
|
15
|
+
propDefinition: [
|
16
|
+
app,
|
17
|
+
"board",
|
18
|
+
],
|
14
19
|
},
|
15
20
|
name: {
|
16
21
|
type: "string",
|
22
|
+
label: "Name",
|
17
23
|
description: "Name for the label.",
|
18
24
|
},
|
19
25
|
color: {
|
20
26
|
type: "string",
|
27
|
+
label: "Color",
|
21
28
|
description: "The color for the label. One of: yellow, purple, blue, red, green, orange, black, sky, pink, lime, null (null means no color, and the label will not show on the front of cards)",
|
22
29
|
options: [
|
23
30
|
"yellow",
|
@@ -33,41 +40,35 @@ export default {
|
|
33
40
|
"null",
|
34
41
|
],
|
35
42
|
},
|
36
|
-
|
37
|
-
|
38
|
-
|
43
|
+
},
|
44
|
+
methods: {
|
45
|
+
createLabel(args = {}) {
|
46
|
+
return this.app.post({
|
47
|
+
path: "/labels",
|
48
|
+
...args,
|
49
|
+
});
|
39
50
|
},
|
40
51
|
},
|
41
52
|
async run({ $ }) {
|
42
|
-
const oauthSignerUri = this.trello.$auth.oauth_signer_uri;
|
43
|
-
|
44
|
-
const trelloParams = [
|
45
|
-
"name",
|
46
|
-
"color",
|
47
|
-
"idBoard",
|
48
|
-
];
|
49
|
-
let p = this;
|
50
|
-
|
51
|
-
const queryString = trelloParams.filter((param) => p[param]).map((param) => `${param}=${p[param]}`)
|
52
|
-
.join("&");
|
53
53
|
|
54
|
-
const
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
const {
|
55
|
+
createLabel,
|
56
|
+
idBoard,
|
57
|
+
name,
|
58
|
+
color,
|
59
|
+
} = this;
|
59
60
|
|
60
|
-
const
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
const response = await createLabel({
|
62
|
+
$,
|
63
|
+
params: {
|
64
|
+
idBoard,
|
65
|
+
name,
|
66
|
+
color,
|
67
|
+
},
|
68
|
+
});
|
64
69
|
|
65
|
-
|
66
|
-
token,
|
67
|
-
oauthSignerUri,
|
68
|
-
};
|
70
|
+
$.export("$summary", "Successfully created a label");
|
69
71
|
|
70
|
-
|
71
|
-
return resp;
|
72
|
+
return response;
|
72
73
|
},
|
73
74
|
};
|
@@ -1,67 +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-create-list",
|
6
5
|
name: "Create a List",
|
7
|
-
description: "Creates a new list
|
8
|
-
version: "0.
|
6
|
+
description: "Creates a new list. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-post).",
|
7
|
+
version: "0.2.0",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
app,
|
11
|
+
idBoard: {
|
12
|
+
type: "string",
|
13
|
+
label: "Board ID",
|
14
|
+
description: "The long ID of the board the list should be created on.",
|
15
|
+
propDefinition: [
|
16
|
+
app,
|
17
|
+
"board",
|
18
|
+
],
|
14
19
|
},
|
15
20
|
name: {
|
16
21
|
type: "string",
|
22
|
+
label: "Name",
|
17
23
|
description: "Name for the list.",
|
18
24
|
},
|
19
|
-
idBoard: {
|
20
|
-
type: "string",
|
21
|
-
description: "The long ID of the board the list should be created on.",
|
22
|
-
},
|
23
25
|
idListSource: {
|
24
26
|
type: "string",
|
27
|
+
label: "List Source ID",
|
25
28
|
description: "ID of the list to copy into the new list.",
|
26
29
|
optional: true,
|
30
|
+
propDefinition: [
|
31
|
+
app,
|
32
|
+
"lists",
|
33
|
+
({ idBoard }) => ({
|
34
|
+
board: idBoard,
|
35
|
+
}),
|
36
|
+
],
|
27
37
|
},
|
28
38
|
pos: {
|
29
|
-
|
30
|
-
|
31
|
-
|
39
|
+
propDefinition: [
|
40
|
+
app,
|
41
|
+
"pos",
|
42
|
+
],
|
43
|
+
},
|
44
|
+
},
|
45
|
+
methods: {
|
46
|
+
createList(args = {}) {
|
47
|
+
return this.app.post({
|
48
|
+
path: "/lists",
|
49
|
+
...args,
|
50
|
+
});
|
32
51
|
},
|
33
52
|
},
|
34
53
|
async run({ $ }) {
|
35
|
-
const
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
];
|
43
|
-
let p = this;
|
44
|
-
|
45
|
-
const queryString = trelloParams.filter((param) => p[param]).map((param) => `${param}=${p[param]}`)
|
46
|
-
.join("&");
|
47
|
-
|
48
|
-
const config = {
|
49
|
-
url: `https://api.trello.com/1/lists?${queryString}`,
|
50
|
-
method: "POST",
|
51
|
-
data: "",
|
52
|
-
};
|
54
|
+
const {
|
55
|
+
createList,
|
56
|
+
name,
|
57
|
+
idBoard,
|
58
|
+
idListSource,
|
59
|
+
pos,
|
60
|
+
} = this;
|
53
61
|
|
54
|
-
const
|
55
|
-
|
56
|
-
|
57
|
-
|
62
|
+
const response = await createList({
|
63
|
+
$,
|
64
|
+
params: {
|
65
|
+
name,
|
66
|
+
idBoard,
|
67
|
+
idListSource,
|
68
|
+
pos,
|
69
|
+
},
|
70
|
+
});
|
58
71
|
|
59
|
-
|
60
|
-
token,
|
61
|
-
oauthSignerUri,
|
62
|
-
};
|
72
|
+
$.export("$summary", "Successfully created list.");
|
63
73
|
|
64
|
-
|
65
|
-
return resp;
|
74
|
+
return response;
|
66
75
|
},
|
67
76
|
};
|
@@ -4,20 +4,20 @@ export default {
|
|
4
4
|
...common,
|
5
5
|
key: "trello-delete-checklist",
|
6
6
|
name: "Delete Checklist",
|
7
|
-
description: "Deletes the specified checklist. [See the
|
8
|
-
version: "0.
|
7
|
+
description: "Deletes the specified checklist. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-checklists/#api-checklists-id-delete).",
|
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
|
+
carId: {
|
19
19
|
propDefinition: [
|
20
|
-
common.props.
|
20
|
+
common.props.app,
|
21
21
|
"cards",
|
22
22
|
(c) => ({
|
23
23
|
board: c.board,
|
@@ -28,19 +28,32 @@ export default {
|
|
28
28
|
description: "The ID of the card containing the checklist do delete",
|
29
29
|
optional: false,
|
30
30
|
},
|
31
|
-
|
31
|
+
checklistId: {
|
32
32
|
propDefinition: [
|
33
|
-
common.props.
|
33
|
+
common.props.app,
|
34
34
|
"checklist",
|
35
|
-
(
|
36
|
-
card:
|
35
|
+
({ carId }) => ({
|
36
|
+
card: carId,
|
37
37
|
}),
|
38
38
|
],
|
39
39
|
description: "The ID of the checklist to delete",
|
40
40
|
},
|
41
41
|
},
|
42
|
+
methods: {
|
43
|
+
deleteChecklist({
|
44
|
+
checklistId, ...args
|
45
|
+
} = {}) {
|
46
|
+
return this.app.delete({
|
47
|
+
path: `/checklists/${checklistId}`,
|
48
|
+
...args,
|
49
|
+
});
|
50
|
+
},
|
51
|
+
},
|
42
52
|
async run({ $ }) {
|
43
|
-
await this.
|
44
|
-
|
53
|
+
await this.deleteChecklist({
|
54
|
+
$,
|
55
|
+
checklistId: this.checklistId,
|
56
|
+
});
|
57
|
+
$.export("$summary", `Successfully deleted checklist ${this.checklistId}`);
|
45
58
|
},
|
46
59
|
};
|
@@ -4,39 +4,42 @@ export default {
|
|
4
4
|
...common,
|
5
5
|
key: "trello-find-labels",
|
6
6
|
name: "Find a Label",
|
7
|
-
description: "Finds a label on a specific board by name. [See the
|
8
|
-
version: "0.
|
7
|
+
description: "Finds a label on a specific board by name. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-labels-get)",
|
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
|
description: "Unique identifier of the board to search for labels",
|
18
18
|
},
|
19
19
|
name: {
|
20
20
|
propDefinition: [
|
21
|
-
common.props.
|
21
|
+
common.props.app,
|
22
22
|
"name",
|
23
23
|
],
|
24
24
|
label: "Label Name",
|
25
25
|
description: "Name of the label to find.",
|
26
26
|
optional: false,
|
27
27
|
},
|
28
|
-
|
28
|
+
limit: {
|
29
29
|
type: "integer",
|
30
|
-
label: "
|
30
|
+
label: "Limit",
|
31
31
|
description: "The number of labels to be returned (up to 1000)",
|
32
32
|
default: 50,
|
33
33
|
},
|
34
34
|
},
|
35
35
|
async run({ $ }) {
|
36
|
-
const
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
const labels = await this.app.findLabel({
|
37
|
+
$,
|
38
|
+
boardId: this.board,
|
39
|
+
params: {
|
40
|
+
limit: this.limit,
|
41
|
+
},
|
42
|
+
});
|
40
43
|
const res = this.getMatches(labels, this.name);
|
41
44
|
$.export("$summary", `Successfully retrieved ${res.length} label(s) with name ${this.name}`);
|
42
45
|
return res;
|
@@ -4,21 +4,21 @@ export default {
|
|
4
4
|
...common,
|
5
5
|
key: "trello-find-list",
|
6
6
|
name: "Find a List",
|
7
|
-
description: "Finds a list on a specific board by name. [See the
|
8
|
-
version: "0.
|
7
|
+
description: "Finds a list on a specific board by name. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-lists-get).",
|
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
|
description: "Specify the board to search for lists",
|
18
18
|
},
|
19
19
|
name: {
|
20
20
|
propDefinition: [
|
21
|
-
common.props.
|
21
|
+
common.props.app,
|
22
22
|
"name",
|
23
23
|
],
|
24
24
|
label: "List Name",
|
@@ -27,7 +27,7 @@ export default {
|
|
27
27
|
},
|
28
28
|
listFilter: {
|
29
29
|
propDefinition: [
|
30
|
-
common.props.
|
30
|
+
common.props.app,
|
31
31
|
"listFilter",
|
32
32
|
],
|
33
33
|
},
|
@@ -38,10 +38,13 @@ export default {
|
|
38
38
|
name,
|
39
39
|
listFilter,
|
40
40
|
} = this;
|
41
|
-
const
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
const lists = await this.app.getLists({
|
42
|
+
$,
|
43
|
+
boardId: board,
|
44
|
+
params: {
|
45
|
+
filter: listFilter,
|
46
|
+
},
|
47
|
+
});
|
45
48
|
const res = this.getMatches(lists, name);
|
46
49
|
$.export("$summary", `Successfully retrieved ${res.length} list(s) with name ${name}`);
|
47
50
|
return res;
|