@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
@@ -1,23 +1,23 @@
|
|
1
|
-
import common from "../common.mjs";
|
1
|
+
import common from "../common/common.mjs";
|
2
2
|
|
3
3
|
export default {
|
4
4
|
...common,
|
5
5
|
key: "trello-rename-list",
|
6
6
|
name: "Rename List",
|
7
|
-
description: "Renames an existing list. [See the
|
8
|
-
version: "0.
|
7
|
+
description: "Renames an existing list. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-put).",
|
8
|
+
version: "0.1.1",
|
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
|
listId: {
|
19
19
|
propDefinition: [
|
20
|
-
common.props.
|
20
|
+
common.props.app,
|
21
21
|
"lists",
|
22
22
|
(c) => ({
|
23
23
|
board: c.board,
|
@@ -30,18 +30,32 @@ 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 new name of the list",
|
37
37
|
optional: false,
|
38
38
|
},
|
39
39
|
},
|
40
|
+
methods: {
|
41
|
+
renameList({
|
42
|
+
listId, ...args
|
43
|
+
} = {}) {
|
44
|
+
return this.app.put({
|
45
|
+
path: `/lists/${listId}`,
|
46
|
+
...args,
|
47
|
+
});
|
48
|
+
},
|
49
|
+
},
|
40
50
|
async run({ $ }) {
|
41
|
-
const res = await this.
|
42
|
-
|
43
|
-
|
44
|
-
|
51
|
+
const res = await this.renameList({
|
52
|
+
$,
|
53
|
+
listId: this.listId,
|
54
|
+
data: {
|
55
|
+
name: this.name,
|
56
|
+
},
|
57
|
+
});
|
58
|
+
$.export("$summary", `Successfully renamed list to \`${this.name}\`.`);
|
45
59
|
return res;
|
46
60
|
},
|
47
61
|
};
|
@@ -1,56 +1,60 @@
|
|
1
|
-
import
|
1
|
+
import app from "../../trello.app.mjs";
|
2
2
|
|
3
3
|
export default {
|
4
|
-
...common,
|
5
4
|
key: "trello-search-boards",
|
6
5
|
name: "Search Boards",
|
7
|
-
description: "Searches for boards matching the specified query. [See the
|
8
|
-
version: "0.
|
6
|
+
description: "Searches for boards matching the specified query. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-search/#api-search-get).",
|
7
|
+
version: "0.3.1",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
10
|
+
app,
|
12
11
|
query: {
|
13
12
|
propDefinition: [
|
14
|
-
|
13
|
+
app,
|
15
14
|
"query",
|
16
15
|
],
|
17
16
|
},
|
18
17
|
idOrganizations: {
|
19
18
|
propDefinition: [
|
20
|
-
|
19
|
+
app,
|
21
20
|
"idOrganizations",
|
22
21
|
],
|
23
22
|
description: "Specify the organizations to search for boards in",
|
24
23
|
},
|
25
24
|
partial: {
|
26
25
|
propDefinition: [
|
27
|
-
|
26
|
+
app,
|
28
27
|
"partial",
|
29
28
|
],
|
29
|
+
optional: true,
|
30
30
|
},
|
31
31
|
boardFields: {
|
32
32
|
propDefinition: [
|
33
|
-
|
33
|
+
app,
|
34
34
|
"boardFields",
|
35
35
|
],
|
36
|
+
optional: true,
|
36
37
|
},
|
37
38
|
boardsLimit: {
|
38
39
|
type: "integer",
|
39
40
|
label: "Boards Limit",
|
40
41
|
description: "The maximum number of boards to return.",
|
41
42
|
default: 10,
|
43
|
+
optional: true,
|
42
44
|
},
|
43
45
|
},
|
44
46
|
async run({ $ }) {
|
45
|
-
const
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
47
|
+
const { boards } = await this.app.search({
|
48
|
+
$,
|
49
|
+
params: {
|
50
|
+
query: this.query,
|
51
|
+
idOrganizations: this.idOrganizations?.join(","),
|
52
|
+
modelTypes: "boards",
|
53
|
+
board_fields: this.boardFields.join(","),
|
54
|
+
boards_limit: this.boardsLimit,
|
55
|
+
partial: this.partial,
|
56
|
+
},
|
57
|
+
});
|
54
58
|
$.export("$summary", `Successfully retrieved ${boards.length} board(s)`);
|
55
59
|
return boards;
|
56
60
|
},
|
@@ -1,58 +1,63 @@
|
|
1
|
-
import
|
1
|
+
import app from "../../trello.app.mjs";
|
2
2
|
|
3
3
|
export default {
|
4
|
-
...common,
|
5
4
|
key: "trello-search-cards",
|
6
5
|
name: "Search Cards",
|
7
|
-
description: "Searches for cards matching the specified query. [See the
|
8
|
-
version: "0.1
|
6
|
+
description: "Searches for cards matching the specified query. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-search/#api-search-get).",
|
7
|
+
version: "0.2.1",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
10
|
+
app,
|
12
11
|
query: {
|
13
12
|
propDefinition: [
|
14
|
-
|
13
|
+
app,
|
15
14
|
"query",
|
16
15
|
],
|
17
16
|
},
|
18
17
|
idBoards: {
|
19
18
|
propDefinition: [
|
20
|
-
|
19
|
+
app,
|
21
20
|
"board",
|
22
21
|
],
|
23
22
|
type: "string[]",
|
24
23
|
label: "Boards",
|
25
24
|
description: "The IDs of boards to search for cards in",
|
25
|
+
optional: true,
|
26
26
|
},
|
27
27
|
partial: {
|
28
28
|
propDefinition: [
|
29
|
-
|
29
|
+
app,
|
30
30
|
"partial",
|
31
31
|
],
|
32
|
+
optional: true,
|
32
33
|
},
|
33
34
|
cardFields: {
|
34
35
|
propDefinition: [
|
35
|
-
|
36
|
+
app,
|
36
37
|
"cardFields",
|
37
38
|
],
|
39
|
+
optional: true,
|
38
40
|
},
|
39
41
|
cardsLimit: {
|
40
42
|
type: "integer",
|
41
43
|
label: "Cards Limit",
|
42
44
|
description: "The maximum number of cards to return.",
|
43
45
|
default: 10,
|
46
|
+
optional: true,
|
44
47
|
},
|
45
48
|
},
|
46
49
|
async run({ $ }) {
|
47
|
-
const
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
50
|
+
const { cards } = await this.app.search({
|
51
|
+
$,
|
52
|
+
params: {
|
53
|
+
query: this.query,
|
54
|
+
idBoards: this.idBoards,
|
55
|
+
modelTypes: "cards",
|
56
|
+
card_fields: this.cardFields,
|
57
|
+
cards_limit: this.cardsLimit,
|
58
|
+
partial: this.partial,
|
59
|
+
},
|
60
|
+
});
|
56
61
|
$.export("$summary", `Successfully retrieved ${cards.length} card(s)`);
|
57
62
|
return cards;
|
58
63
|
},
|
@@ -1,110 +1,147 @@
|
|
1
|
-
|
2
|
-
import { axios } from "@pipedream/platform";
|
1
|
+
import app from "../../trello.app.mjs";
|
3
2
|
|
4
3
|
export default {
|
5
4
|
key: "trello-search-checklists",
|
6
|
-
name: "
|
7
|
-
description: "Find a checklist on a particular board or card by name.",
|
8
|
-
version: "0.1
|
5
|
+
name: "Search Checklists",
|
6
|
+
description: "Find a checklist on a particular board or card by name. [See the documentation here](https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-checklists-get) and [here](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-checklists-get).",
|
7
|
+
version: "0.2.1",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
12
|
-
type: "app",
|
13
|
-
app: "trello",
|
14
|
-
},
|
10
|
+
app,
|
15
11
|
type: {
|
16
12
|
type: "string",
|
13
|
+
label: "Type",
|
17
14
|
description: "Whether to search boards or cards for the checklist.",
|
18
15
|
options: [
|
19
16
|
"board",
|
20
17
|
"card",
|
21
18
|
],
|
19
|
+
reloadProps: true,
|
20
|
+
},
|
21
|
+
boardId: {
|
22
|
+
propDefinition: [
|
23
|
+
app,
|
24
|
+
"board",
|
25
|
+
],
|
26
|
+
hidden: true,
|
22
27
|
},
|
23
|
-
|
28
|
+
cardId: {
|
29
|
+
propDefinition: [
|
30
|
+
app,
|
31
|
+
"cards",
|
32
|
+
(c) => ({
|
33
|
+
board: c.boardId,
|
34
|
+
}),
|
35
|
+
],
|
24
36
|
type: "string",
|
25
|
-
|
37
|
+
label: "Card ID",
|
38
|
+
description: "The ID of the card",
|
39
|
+
hidden: true,
|
26
40
|
},
|
27
41
|
query: {
|
28
42
|
type: "string",
|
29
|
-
|
43
|
+
label: "Query",
|
44
|
+
description: "The query to search for",
|
30
45
|
},
|
31
46
|
checkItems: {
|
32
47
|
type: "string",
|
33
|
-
|
48
|
+
label: "Check Items",
|
49
|
+
description: "Whether to display checklist items in the result. Select `all` or `none`.",
|
34
50
|
optional: true,
|
35
51
|
options: [
|
36
52
|
"all",
|
37
53
|
"none",
|
38
54
|
],
|
55
|
+
reloadProps: true,
|
56
|
+
hidden: true,
|
39
57
|
},
|
40
|
-
|
41
|
-
type: "string",
|
58
|
+
checkItemFields: {
|
59
|
+
type: "string[]",
|
42
60
|
label: "CheckItem Fields",
|
43
|
-
description: "all or a
|
44
|
-
optional: true,
|
45
|
-
},
|
46
|
-
filter: {
|
47
|
-
type: "string",
|
48
|
-
description: "all or none",
|
49
|
-
optional: true,
|
61
|
+
description: "Fields to include in the results. `all` or a list of: `name`, `nameData`, `pos`, `state`, `type`",
|
50
62
|
options: [
|
51
63
|
"all",
|
52
|
-
"
|
64
|
+
"name",
|
65
|
+
"nameData",
|
66
|
+
"pos",
|
67
|
+
"state",
|
68
|
+
"type",
|
53
69
|
],
|
70
|
+
optional: true,
|
71
|
+
hidden: true,
|
54
72
|
},
|
55
73
|
fields: {
|
56
|
-
type: "string",
|
57
|
-
|
74
|
+
type: "string[]",
|
75
|
+
label: "Fields",
|
76
|
+
description: "Fields to include in the results. `all` or a list of: `idBoard`, `idCard`, `name`, `pos`. Eg: `idBoard,idCard,name,pos`. Eg: `all`.",
|
77
|
+
options: [
|
78
|
+
"all",
|
79
|
+
"idBoard",
|
80
|
+
"idCard",
|
81
|
+
"name",
|
82
|
+
"pos",
|
83
|
+
],
|
58
84
|
optional: true,
|
85
|
+
hidden: true,
|
59
86
|
},
|
60
87
|
},
|
88
|
+
additionalProps(props) {
|
89
|
+
const isCardSearch = this.type === "card";
|
90
|
+
props.boardId.hidden = false;
|
91
|
+
props.cardId.hidden = !isCardSearch;
|
92
|
+
props.checkItems.hidden = !isCardSearch;
|
93
|
+
props.checkItemFields.hidden = !isCardSearch;
|
94
|
+
props.fields.hidden = !isCardSearch;
|
95
|
+
|
96
|
+
props.checkItemFields.hidden = !(this.checkItems === "all");
|
97
|
+
|
98
|
+
return {};
|
99
|
+
},
|
61
100
|
async run({ $ }) {
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
101
|
+
const {
|
102
|
+
app,
|
103
|
+
type,
|
104
|
+
boardId,
|
105
|
+
cardId,
|
106
|
+
query,
|
107
|
+
checkItems,
|
108
|
+
checkItemFields,
|
109
|
+
fields,
|
110
|
+
} = this;
|
111
|
+
|
72
112
|
let checklists = null;
|
73
113
|
let matches = [];
|
74
114
|
|
75
|
-
|
76
|
-
.
|
77
|
-
|
78
|
-
|
79
|
-
checklists = await axios($, {
|
80
|
-
url: `https://api.trello.com/1/boards/${id}/checklists?${queryString}`,
|
81
|
-
method: "GET",
|
82
|
-
}, {
|
83
|
-
token: {
|
84
|
-
key: this.trello.$auth.oauth_access_token,
|
85
|
-
secret: this.trello.$auth.oauth_refresh_token,
|
86
|
-
},
|
87
|
-
oauthSignerUri: this.trello.$auth.oauth_signer_uri,
|
115
|
+
if (type === "board") {
|
116
|
+
checklists = await app.listBoardChecklists({
|
117
|
+
$,
|
118
|
+
boardId,
|
88
119
|
});
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
120
|
+
|
121
|
+
} else if (type === "card") {
|
122
|
+
checklists = await app.listCardChecklists({
|
123
|
+
$,
|
124
|
+
cardId,
|
125
|
+
params: {
|
126
|
+
checkItems,
|
127
|
+
checkItem_fields: checkItemFields?.length && checkItemFields.join(),
|
128
|
+
fields: fields?.length && fields.join(),
|
97
129
|
},
|
98
|
-
oauthSignerUri: this.trello.$auth.oauth_signer_uri,
|
99
130
|
});
|
100
131
|
}
|
132
|
+
|
101
133
|
if (checklists) {
|
102
|
-
checklists.forEach(
|
103
|
-
if (checklist.name.includes(query))
|
134
|
+
checklists.forEach((checklist) => {
|
135
|
+
if (checklist.name?.toLowerCase().includes(query.toLowerCase()))
|
104
136
|
matches.push(checklist);
|
105
137
|
});
|
106
138
|
}
|
107
139
|
|
140
|
+
if (matches?.length) {
|
141
|
+
$.export("$summary", `Found ${matches.length} matching checklist${matches.length === 1
|
142
|
+
? ""
|
143
|
+
: "s"}`);
|
144
|
+
}
|
108
145
|
return matches;
|
109
146
|
},
|
110
147
|
};
|
@@ -1,61 +1,71 @@
|
|
1
|
-
|
2
|
-
import { axios } from "@pipedream/platform";
|
1
|
+
import app from "../../trello.app.mjs";
|
3
2
|
|
4
3
|
export default {
|
5
4
|
key: "trello-search-members",
|
6
5
|
name: "Search Members",
|
7
|
-
description: "Search for Trello members.",
|
8
|
-
version: "0.1
|
6
|
+
description: "Search for Trello members. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-search/#api-search-members-get).",
|
7
|
+
version: "0.2.1",
|
9
8
|
type: "action",
|
10
9
|
props: {
|
11
|
-
|
12
|
-
type: "app",
|
13
|
-
app: "trello",
|
14
|
-
},
|
10
|
+
app,
|
15
11
|
query: {
|
16
12
|
type: "string",
|
13
|
+
label: "Search Query",
|
17
14
|
description: "Search query 1 to 16384 characters long",
|
18
15
|
},
|
19
|
-
limit: {
|
20
|
-
type: "integer",
|
21
|
-
description: "The maximum number of results to return. Maximum of 20.",
|
22
|
-
optional: true,
|
23
|
-
},
|
24
16
|
idBoard: {
|
25
|
-
|
17
|
+
label: "Board ID",
|
18
|
+
description: "The ID of the board to search for members.",
|
26
19
|
optional: true,
|
20
|
+
propDefinition: [
|
21
|
+
app,
|
22
|
+
"board",
|
23
|
+
],
|
27
24
|
},
|
28
25
|
idOrganization: {
|
29
26
|
type: "string",
|
27
|
+
label: "Organization ID",
|
28
|
+
description: "The ID of the organization to search for members.",
|
30
29
|
optional: true,
|
30
|
+
propDefinition: [
|
31
|
+
app,
|
32
|
+
"idOrganizations",
|
33
|
+
],
|
31
34
|
},
|
32
|
-
|
33
|
-
type: "
|
35
|
+
limit: {
|
36
|
+
type: "integer",
|
37
|
+
label: "Limit",
|
38
|
+
description: "The maximum number of results to return. Maximum of 20.",
|
34
39
|
optional: true,
|
35
40
|
},
|
36
41
|
},
|
37
42
|
async run({ $ }) {
|
38
|
-
const
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
];
|
45
|
-
let p = this;
|
43
|
+
const {
|
44
|
+
query,
|
45
|
+
limit,
|
46
|
+
idBoard,
|
47
|
+
idOrganization,
|
48
|
+
} = this;
|
46
49
|
|
47
|
-
const
|
48
|
-
.join("&");
|
50
|
+
const onlyOrgMembers = idBoard || idOrganization;
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
const response = await this.app.searchMembers({
|
53
|
+
$,
|
54
|
+
params: {
|
55
|
+
query,
|
56
|
+
limit,
|
57
|
+
idBoard,
|
58
|
+
idOrganization,
|
59
|
+
onlyOrgMembers,
|
57
60
|
},
|
58
|
-
oauthSignerUri: this.trello.$auth.oauth_signer_uri,
|
59
61
|
});
|
62
|
+
|
63
|
+
if (response?.length) {
|
64
|
+
$.export("$summary", `Successfully found ${response.length} member${response.length === 1
|
65
|
+
? ""
|
66
|
+
: "s"}`);
|
67
|
+
}
|
68
|
+
|
69
|
+
return response;
|
60
70
|
},
|
61
71
|
};
|