@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,25 +1,24 @@
|
|
1
|
-
import
|
1
|
+
import app from "../../trello.app.mjs";
|
2
2
|
import pickBy from "lodash-es/pickBy.js";
|
3
3
|
import pick from "lodash-es/pick.js";
|
4
4
|
|
5
5
|
export default {
|
6
|
-
...common,
|
7
6
|
key: "trello-update-card",
|
8
7
|
name: "Update Card",
|
9
|
-
description: "Updates a card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put)",
|
10
|
-
version: "0.1
|
8
|
+
description: "Updates a card. [See the documentation](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put).",
|
9
|
+
version: "0.2.1",
|
11
10
|
type: "action",
|
12
11
|
props: {
|
13
|
-
|
12
|
+
app,
|
14
13
|
idBoard: {
|
15
14
|
propDefinition: [
|
16
|
-
|
15
|
+
app,
|
17
16
|
"board",
|
18
17
|
],
|
19
18
|
},
|
20
|
-
|
19
|
+
cardId: {
|
21
20
|
propDefinition: [
|
22
|
-
|
21
|
+
app,
|
23
22
|
"cards",
|
24
23
|
(c) => ({
|
25
24
|
board: c.idBoard,
|
@@ -32,14 +31,14 @@ export default {
|
|
32
31
|
},
|
33
32
|
name: {
|
34
33
|
propDefinition: [
|
35
|
-
|
34
|
+
app,
|
36
35
|
"name",
|
37
36
|
],
|
38
37
|
description: "The new name for the card.",
|
39
38
|
},
|
40
39
|
desc: {
|
41
40
|
propDefinition: [
|
42
|
-
|
41
|
+
app,
|
43
42
|
"desc",
|
44
43
|
],
|
45
44
|
description: "The new description for the card.",
|
@@ -49,10 +48,11 @@ export default {
|
|
49
48
|
label: "Archived",
|
50
49
|
description: "Whether to archive the card",
|
51
50
|
default: false,
|
51
|
+
optional: true,
|
52
52
|
},
|
53
53
|
idMembers: {
|
54
54
|
propDefinition: [
|
55
|
-
|
55
|
+
app,
|
56
56
|
"member",
|
57
57
|
(c) => ({
|
58
58
|
board: c.idBoard,
|
@@ -64,15 +64,20 @@ export default {
|
|
64
64
|
optional: true,
|
65
65
|
},
|
66
66
|
idAttachmentCover: {
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
propDefinition: [
|
68
|
+
app,
|
69
|
+
"cardAttachmentId",
|
70
|
+
({ cardId }) => ({
|
71
|
+
cardId,
|
72
|
+
params: {
|
73
|
+
filter: "cover",
|
74
|
+
},
|
75
|
+
}),
|
76
|
+
],
|
72
77
|
},
|
73
78
|
idList: {
|
74
79
|
propDefinition: [
|
75
|
-
|
80
|
+
app,
|
76
81
|
"lists",
|
77
82
|
(c) => ({
|
78
83
|
board: c.idBoard,
|
@@ -84,7 +89,7 @@ export default {
|
|
84
89
|
},
|
85
90
|
idLabels: {
|
86
91
|
propDefinition: [
|
87
|
-
|
92
|
+
app,
|
88
93
|
"label",
|
89
94
|
(c) => ({
|
90
95
|
board: c.idBoard,
|
@@ -97,19 +102,20 @@ export default {
|
|
97
102
|
},
|
98
103
|
pos: {
|
99
104
|
propDefinition: [
|
100
|
-
|
105
|
+
app,
|
101
106
|
"pos",
|
102
107
|
],
|
108
|
+
description: "The position of the new card. `top`, `bottom`, or a positive float",
|
103
109
|
},
|
104
110
|
due: {
|
105
111
|
propDefinition: [
|
106
|
-
|
112
|
+
app,
|
107
113
|
"due",
|
108
114
|
],
|
109
115
|
},
|
110
116
|
dueComplete: {
|
111
117
|
propDefinition: [
|
112
|
-
|
118
|
+
app,
|
113
119
|
"dueComplete",
|
114
120
|
],
|
115
121
|
description: "Whether the due date should be marked complete.",
|
@@ -118,30 +124,31 @@ export default {
|
|
118
124
|
subscribed: {
|
119
125
|
type: "boolean",
|
120
126
|
label: "Subscribed",
|
121
|
-
description: "Whether the member
|
127
|
+
description: "Whether the member should be subscribed to the card.",
|
122
128
|
default: false,
|
129
|
+
optional: true,
|
123
130
|
},
|
124
131
|
address: {
|
125
132
|
propDefinition: [
|
126
|
-
|
133
|
+
app,
|
127
134
|
"address",
|
128
135
|
],
|
129
136
|
},
|
130
137
|
locationName: {
|
131
138
|
propDefinition: [
|
132
|
-
|
139
|
+
app,
|
133
140
|
"locationName",
|
134
141
|
],
|
135
142
|
},
|
136
143
|
coordinates: {
|
137
144
|
propDefinition: [
|
138
|
-
|
145
|
+
app,
|
139
146
|
"coordinates",
|
140
147
|
],
|
141
148
|
},
|
142
149
|
customFieldIds: {
|
143
150
|
propDefinition: [
|
144
|
-
|
151
|
+
app,
|
145
152
|
"customFieldIds",
|
146
153
|
(c) => ({
|
147
154
|
boardId: c.idBoard,
|
@@ -156,7 +163,9 @@ export default {
|
|
156
163
|
return props;
|
157
164
|
}
|
158
165
|
for (const customFieldId of this.customFieldIds) {
|
159
|
-
const customField = await this.
|
166
|
+
const customField = await this.app.getCustomField({
|
167
|
+
customFieldId,
|
168
|
+
});
|
160
169
|
props[customFieldId] = {
|
161
170
|
type: "string",
|
162
171
|
label: `Value for Custom Field - ${customField.name}`,
|
@@ -171,11 +180,13 @@ export default {
|
|
171
180
|
return props;
|
172
181
|
},
|
173
182
|
methods: {
|
174
|
-
...common.methods,
|
175
183
|
async getCustomFieldItems($) {
|
176
184
|
const customFieldItems = [];
|
177
185
|
for (const customFieldId of this.customFieldIds) {
|
178
|
-
const customField = await this.
|
186
|
+
const customField = await this.app.getCustomField({
|
187
|
+
$,
|
188
|
+
customFieldId,
|
189
|
+
});
|
179
190
|
const customFieldItem = {
|
180
191
|
idCustomField: customFieldId,
|
181
192
|
};
|
@@ -196,30 +207,37 @@ export default {
|
|
196
207
|
},
|
197
208
|
},
|
198
209
|
async run({ $ }) {
|
199
|
-
const
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
210
|
+
const res = await this.app.updateCard({
|
211
|
+
$,
|
212
|
+
cardId: this.cardId,
|
213
|
+
data: pickBy(pick(this, [
|
214
|
+
"name",
|
215
|
+
"desc",
|
216
|
+
"closed",
|
217
|
+
"idMembers",
|
218
|
+
"idAttachmentCover",
|
219
|
+
"idList",
|
220
|
+
"idLabels",
|
221
|
+
"idBoard",
|
222
|
+
"pos",
|
223
|
+
"due",
|
224
|
+
"dueComplete",
|
225
|
+
"subscribed",
|
226
|
+
"address",
|
227
|
+
"locationName",
|
228
|
+
"coordinates",
|
229
|
+
])),
|
230
|
+
});
|
217
231
|
|
218
232
|
if (this.customFieldIds) {
|
219
233
|
const customFieldItems = await this.getCustomFieldItems($);
|
220
|
-
const updatedCustomFields = await this.
|
221
|
-
|
222
|
-
|
234
|
+
const updatedCustomFields = await this.app.updateCustomFields({
|
235
|
+
$,
|
236
|
+
cardId: this.cardId,
|
237
|
+
data: {
|
238
|
+
customFieldItems,
|
239
|
+
},
|
240
|
+
});
|
223
241
|
res.updatedCustomFields = updatedCustomFields;
|
224
242
|
}
|
225
243
|
|
@@ -0,0 +1,128 @@
|
|
1
|
+
const POSITIONS = [
|
2
|
+
"top",
|
3
|
+
"bottom",
|
4
|
+
];
|
5
|
+
|
6
|
+
const CARD_FILTERS = [
|
7
|
+
"all",
|
8
|
+
"closed",
|
9
|
+
"none",
|
10
|
+
"open",
|
11
|
+
"visible",
|
12
|
+
];
|
13
|
+
|
14
|
+
const LIST_FILTERS = [
|
15
|
+
"all",
|
16
|
+
"closed",
|
17
|
+
"none",
|
18
|
+
"open",
|
19
|
+
];
|
20
|
+
|
21
|
+
const POWER_UPS = [
|
22
|
+
"all",
|
23
|
+
"calendar",
|
24
|
+
"cardAging",
|
25
|
+
"recap",
|
26
|
+
"voting",
|
27
|
+
];
|
28
|
+
|
29
|
+
const PREFS_PERMISSION_LEVELS = [
|
30
|
+
"org",
|
31
|
+
"private",
|
32
|
+
"public",
|
33
|
+
];
|
34
|
+
|
35
|
+
const PREFS_VOTING = [
|
36
|
+
"disabled",
|
37
|
+
"members",
|
38
|
+
"observers",
|
39
|
+
"org",
|
40
|
+
"public",
|
41
|
+
];
|
42
|
+
|
43
|
+
const PREFS_COMMENTS = [
|
44
|
+
"disabled",
|
45
|
+
"members",
|
46
|
+
"observers",
|
47
|
+
"org",
|
48
|
+
"public",
|
49
|
+
];
|
50
|
+
|
51
|
+
const PREFS_INVITATIONS = [
|
52
|
+
"admins",
|
53
|
+
"members",
|
54
|
+
];
|
55
|
+
|
56
|
+
const PREFS_BACKGROUNDS = [
|
57
|
+
"blue",
|
58
|
+
"orange",
|
59
|
+
"green",
|
60
|
+
"red",
|
61
|
+
"purple",
|
62
|
+
"pink",
|
63
|
+
"lime",
|
64
|
+
"sky",
|
65
|
+
"grey",
|
66
|
+
];
|
67
|
+
|
68
|
+
const PREFS_CARD_AGING = [
|
69
|
+
"pirate",
|
70
|
+
"regular",
|
71
|
+
];
|
72
|
+
|
73
|
+
const LABEL_COLORS = [
|
74
|
+
"yellow",
|
75
|
+
"purple",
|
76
|
+
"blue",
|
77
|
+
"red",
|
78
|
+
"green",
|
79
|
+
"orange",
|
80
|
+
"black",
|
81
|
+
"sky",
|
82
|
+
"pink",
|
83
|
+
"lime",
|
84
|
+
"null",
|
85
|
+
];
|
86
|
+
|
87
|
+
const NOTIFICATION_TIMES = [
|
88
|
+
"5 minutes",
|
89
|
+
"10 minutes",
|
90
|
+
"15 minutes",
|
91
|
+
"30 minutes",
|
92
|
+
"1 hour",
|
93
|
+
"2 hours",
|
94
|
+
"3 hours",
|
95
|
+
"6 hours",
|
96
|
+
"12 hours",
|
97
|
+
"1 day",
|
98
|
+
"2 days",
|
99
|
+
"3 days",
|
100
|
+
"1 week",
|
101
|
+
];
|
102
|
+
|
103
|
+
const CARD_KEEP_FROM_SOURCE_PROPERTIES = [
|
104
|
+
"all",
|
105
|
+
"attachments",
|
106
|
+
"checklists",
|
107
|
+
"comments",
|
108
|
+
"due",
|
109
|
+
"labels",
|
110
|
+
"members",
|
111
|
+
"stickers",
|
112
|
+
];
|
113
|
+
|
114
|
+
export default {
|
115
|
+
POSITIONS,
|
116
|
+
CARD_FILTERS,
|
117
|
+
LIST_FILTERS,
|
118
|
+
POWER_UPS,
|
119
|
+
PREFS_PERMISSION_LEVELS,
|
120
|
+
PREFS_VOTING,
|
121
|
+
PREFS_COMMENTS,
|
122
|
+
PREFS_INVITATIONS,
|
123
|
+
PREFS_BACKGROUNDS,
|
124
|
+
PREFS_CARD_AGING,
|
125
|
+
LABEL_COLORS,
|
126
|
+
NOTIFICATION_TIMES,
|
127
|
+
CARD_KEEP_FROM_SOURCE_PROPERTIES,
|
128
|
+
};
|
package/common/fields.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pipedream/trello",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.4.1",
|
4
4
|
"description": "Pipedream Trello Components",
|
5
5
|
"main": "trello.app.mjs",
|
6
6
|
"keywords": [
|
@@ -10,10 +10,12 @@
|
|
10
10
|
"homepage": "https://pipedream.com/apps/trello",
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
12
12
|
"dependencies": {
|
13
|
-
"@pipedream/platform": "^
|
13
|
+
"@pipedream/platform": "^3.0.1",
|
14
14
|
"crypto": "^1.0.1",
|
15
|
+
"form-data": "^4.0.0",
|
15
16
|
"lodash-es": "^4.17.21",
|
16
|
-
"mime": "^
|
17
|
+
"mime": "^4.0.4",
|
18
|
+
"ms": "^2.1.3"
|
17
19
|
},
|
18
20
|
"gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535",
|
19
21
|
"publishConfig": {
|
@@ -1,54 +1,58 @@
|
|
1
1
|
import common from "../common/common-webhook.mjs";
|
2
|
+
import sampleEmit from "./test-event.mjs";
|
2
3
|
|
3
4
|
export default {
|
4
5
|
...common,
|
5
6
|
key: "trello-card-archived",
|
6
|
-
name: "Card Archived (Instant)",
|
7
|
+
name: "Card Archived (Instant)", /* eslint-disable-line pipedream/source-name */
|
7
8
|
description: "Emit new event for each card archived.",
|
8
|
-
version: "0.
|
9
|
+
version: "0.1.1",
|
9
10
|
type: "source",
|
10
11
|
props: {
|
11
12
|
...common.props,
|
12
13
|
board: {
|
13
14
|
propDefinition: [
|
14
|
-
common.props.
|
15
|
+
common.props.app,
|
15
16
|
"board",
|
16
17
|
],
|
17
18
|
},
|
18
19
|
lists: {
|
19
20
|
propDefinition: [
|
20
|
-
common.props.
|
21
|
+
common.props.app,
|
21
22
|
"lists",
|
22
23
|
(c) => ({
|
23
24
|
board: c.board,
|
24
25
|
}),
|
25
26
|
],
|
27
|
+
description: "If specified, events will only be emitted when a card in one of the selected lists is archived",
|
26
28
|
},
|
27
29
|
},
|
28
30
|
methods: {
|
29
31
|
...common.methods,
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
};
|
32
|
+
getSampleEvents() {
|
33
|
+
return this.app.getFilteredCards({
|
34
|
+
boardId: this.board,
|
35
|
+
filter: "closed",
|
36
|
+
});
|
36
37
|
},
|
37
|
-
|
38
|
-
|
39
|
-
return eventTranslationKey === "action_archived_card";
|
38
|
+
getSortField() {
|
39
|
+
return "dateLastActivity";
|
40
40
|
},
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
isCorrectEventType({ display }) {
|
42
|
+
return display?.translationKey === "action_archived_card";
|
43
|
+
},
|
44
|
+
getResult({ data }) {
|
45
|
+
return this.app.getCard({
|
46
|
+
cardId: data?.card?.id,
|
47
|
+
});
|
44
48
|
},
|
45
49
|
isRelevant({ result: card }) {
|
46
50
|
return (
|
47
51
|
(!this.board || this.board === card.idBoard) &&
|
48
|
-
(!this.lists ||
|
49
|
-
this.lists.length === 0 ||
|
52
|
+
(!this.lists?.length ||
|
50
53
|
this.lists.includes(card.idList))
|
51
54
|
);
|
52
55
|
},
|
53
56
|
},
|
57
|
+
sampleEmit,
|
54
58
|
};
|
@@ -0,0 +1,64 @@
|
|
1
|
+
export default {
|
2
|
+
"id": "5f4ee830046a92139596173a",
|
3
|
+
"badges": {
|
4
|
+
"attachmentsByType": {
|
5
|
+
"trello": {
|
6
|
+
"board": 0,
|
7
|
+
"card": 0
|
8
|
+
}
|
9
|
+
},
|
10
|
+
"externalSource": null,
|
11
|
+
"location": false,
|
12
|
+
"votes": 0,
|
13
|
+
"viewingMemberVoted": false,
|
14
|
+
"subscribed": false,
|
15
|
+
"fogbugz": "",
|
16
|
+
"checkItems": 0,
|
17
|
+
"checkItemsChecked": 0,
|
18
|
+
"checkItemsEarliestDue": null,
|
19
|
+
"comments": 0,
|
20
|
+
"attachments": 0,
|
21
|
+
"description": false,
|
22
|
+
"due": null,
|
23
|
+
"dueComplete": false,
|
24
|
+
"start": null,
|
25
|
+
"lastUpdatedByAi": false
|
26
|
+
},
|
27
|
+
"checkItemStates": [],
|
28
|
+
"closed": true,
|
29
|
+
"dueComplete": false,
|
30
|
+
"dateLastActivity": "2020-09-02T00:34:22.602Z",
|
31
|
+
"desc": "",
|
32
|
+
"descData": null,
|
33
|
+
"due": null,
|
34
|
+
"dueReminder": null,
|
35
|
+
"email": null,
|
36
|
+
"idBoard": "5f4d7be6c45c22583f75fa02",
|
37
|
+
"idChecklists": [],
|
38
|
+
"idList": "5f4d7f78bdd7ce4d2d25fdda",
|
39
|
+
"idMembers": [],
|
40
|
+
"idMembersVoted": [],
|
41
|
+
"idShort": 10,
|
42
|
+
"idAttachmentCover": null,
|
43
|
+
"labels": [],
|
44
|
+
"idLabels": [],
|
45
|
+
"manualCoverAttachment": false,
|
46
|
+
"name": "a new card",
|
47
|
+
"pinned": false,
|
48
|
+
"pos": 65535,
|
49
|
+
"shortLink": "eBapV0gL",
|
50
|
+
"shortUrl": "https://trello.com/c/eBapV0gL",
|
51
|
+
"start": null,
|
52
|
+
"subscribed": false,
|
53
|
+
"url": "https://trello.com/c/eBapV0gL/10-a-new-card",
|
54
|
+
"cover": {
|
55
|
+
"idAttachment": null,
|
56
|
+
"color": null,
|
57
|
+
"idUploadedBackground": null,
|
58
|
+
"size": "normal",
|
59
|
+
"brightness": "light",
|
60
|
+
"idPlugin": null
|
61
|
+
},
|
62
|
+
"isTemplate": false,
|
63
|
+
"cardRole": null
|
64
|
+
}
|