@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
@@ -1,61 +1,81 @@
|
|
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.
|
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.0",
|
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
16
|
limit: {
|
20
17
|
type: "integer",
|
18
|
+
label: "Limit",
|
21
19
|
description: "The maximum number of results to return. Maximum of 20.",
|
22
20
|
optional: true,
|
23
21
|
},
|
24
22
|
idBoard: {
|
25
|
-
|
23
|
+
label: "Board ID",
|
24
|
+
description: "The ID of the board to search for members.",
|
26
25
|
optional: true,
|
26
|
+
propDefinition: [
|
27
|
+
app,
|
28
|
+
"board",
|
29
|
+
],
|
27
30
|
},
|
28
31
|
idOrganization: {
|
29
32
|
type: "string",
|
33
|
+
label: "Organization ID",
|
34
|
+
description: "The ID of the organization to search for members.",
|
30
35
|
optional: true,
|
36
|
+
propDefinition: [
|
37
|
+
app,
|
38
|
+
"idOrganizations",
|
39
|
+
],
|
31
40
|
},
|
32
41
|
onlyOrgMembers: {
|
33
42
|
type: "boolean",
|
43
|
+
label: "Only Organization Members",
|
44
|
+
description: "If true, only members of the organization will be returned.",
|
34
45
|
optional: true,
|
35
46
|
},
|
36
47
|
},
|
48
|
+
methods: {
|
49
|
+
searchMembers(args = {}) {
|
50
|
+
return this.app._makeRequest({
|
51
|
+
path: "/search/members",
|
52
|
+
...args,
|
53
|
+
});
|
54
|
+
},
|
55
|
+
},
|
37
56
|
async run({ $ }) {
|
38
|
-
const
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
57
|
+
const {
|
58
|
+
searchMembers,
|
59
|
+
query,
|
60
|
+
limit,
|
61
|
+
idBoard,
|
62
|
+
idOrganization,
|
63
|
+
onlyOrgMembers,
|
64
|
+
} = this;
|
46
65
|
|
47
|
-
const
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
key: this.trello.$auth.oauth_access_token,
|
56
|
-
secret: this.trello.$auth.oauth_refresh_token,
|
66
|
+
const response = await searchMembers({
|
67
|
+
$,
|
68
|
+
params: {
|
69
|
+
query,
|
70
|
+
limit,
|
71
|
+
idBoard,
|
72
|
+
idOrganization,
|
73
|
+
onlyOrgMembers,
|
57
74
|
},
|
58
|
-
oauthSignerUri: this.trello.$auth.oauth_signer_uri,
|
59
75
|
});
|
76
|
+
|
77
|
+
$.export("$summary", "Successfully searched for members.");
|
78
|
+
|
79
|
+
return response;
|
60
80
|
},
|
61
81
|
};
|
@@ -1,25 +1,25 @@
|
|
1
1
|
import common from "../common.mjs";
|
2
|
-
import pickBy from "lodash.
|
3
|
-
import pick from "lodash.
|
2
|
+
import pickBy from "lodash-es/pickBy.js";
|
3
|
+
import pick from "lodash-es/pick.js";
|
4
4
|
|
5
5
|
export default {
|
6
6
|
...common,
|
7
7
|
key: "trello-update-card",
|
8
8
|
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.
|
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.2.0",
|
11
11
|
type: "action",
|
12
12
|
props: {
|
13
13
|
...common.props,
|
14
14
|
idBoard: {
|
15
15
|
propDefinition: [
|
16
|
-
common.props.
|
16
|
+
common.props.app,
|
17
17
|
"board",
|
18
18
|
],
|
19
19
|
},
|
20
|
-
|
20
|
+
cardId: {
|
21
21
|
propDefinition: [
|
22
|
-
common.props.
|
22
|
+
common.props.app,
|
23
23
|
"cards",
|
24
24
|
(c) => ({
|
25
25
|
board: c.idBoard,
|
@@ -32,14 +32,14 @@ export default {
|
|
32
32
|
},
|
33
33
|
name: {
|
34
34
|
propDefinition: [
|
35
|
-
common.props.
|
35
|
+
common.props.app,
|
36
36
|
"name",
|
37
37
|
],
|
38
38
|
description: "The new name for the card.",
|
39
39
|
},
|
40
40
|
desc: {
|
41
41
|
propDefinition: [
|
42
|
-
common.props.
|
42
|
+
common.props.app,
|
43
43
|
"desc",
|
44
44
|
],
|
45
45
|
description: "The new description for the card.",
|
@@ -52,7 +52,7 @@ export default {
|
|
52
52
|
},
|
53
53
|
idMembers: {
|
54
54
|
propDefinition: [
|
55
|
-
common.props.
|
55
|
+
common.props.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
|
+
common.props.app,
|
69
|
+
"cardAttachmentId",
|
70
|
+
({ cardId }) => ({
|
71
|
+
cardId,
|
72
|
+
params: {
|
73
|
+
filter: "cover",
|
74
|
+
},
|
75
|
+
}),
|
76
|
+
],
|
72
77
|
},
|
73
78
|
idList: {
|
74
79
|
propDefinition: [
|
75
|
-
common.props.
|
80
|
+
common.props.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
|
-
common.props.
|
92
|
+
common.props.app,
|
88
93
|
"label",
|
89
94
|
(c) => ({
|
90
95
|
board: c.idBoard,
|
@@ -97,19 +102,19 @@ export default {
|
|
97
102
|
},
|
98
103
|
pos: {
|
99
104
|
propDefinition: [
|
100
|
-
common.props.
|
105
|
+
common.props.app,
|
101
106
|
"pos",
|
102
107
|
],
|
103
108
|
},
|
104
109
|
due: {
|
105
110
|
propDefinition: [
|
106
|
-
common.props.
|
111
|
+
common.props.app,
|
107
112
|
"due",
|
108
113
|
],
|
109
114
|
},
|
110
115
|
dueComplete: {
|
111
116
|
propDefinition: [
|
112
|
-
common.props.
|
117
|
+
common.props.app,
|
113
118
|
"dueComplete",
|
114
119
|
],
|
115
120
|
description: "Whether the due date should be marked complete.",
|
@@ -123,25 +128,25 @@ export default {
|
|
123
128
|
},
|
124
129
|
address: {
|
125
130
|
propDefinition: [
|
126
|
-
common.props.
|
131
|
+
common.props.app,
|
127
132
|
"address",
|
128
133
|
],
|
129
134
|
},
|
130
135
|
locationName: {
|
131
136
|
propDefinition: [
|
132
|
-
common.props.
|
137
|
+
common.props.app,
|
133
138
|
"locationName",
|
134
139
|
],
|
135
140
|
},
|
136
141
|
coordinates: {
|
137
142
|
propDefinition: [
|
138
|
-
common.props.
|
143
|
+
common.props.app,
|
139
144
|
"coordinates",
|
140
145
|
],
|
141
146
|
},
|
142
147
|
customFieldIds: {
|
143
148
|
propDefinition: [
|
144
|
-
common.props.
|
149
|
+
common.props.app,
|
145
150
|
"customFieldIds",
|
146
151
|
(c) => ({
|
147
152
|
boardId: c.idBoard,
|
@@ -156,7 +161,9 @@ export default {
|
|
156
161
|
return props;
|
157
162
|
}
|
158
163
|
for (const customFieldId of this.customFieldIds) {
|
159
|
-
const customField = await this.
|
164
|
+
const customField = await this.app.getCustomField({
|
165
|
+
customFieldId,
|
166
|
+
});
|
160
167
|
props[customFieldId] = {
|
161
168
|
type: "string",
|
162
169
|
label: `Value for Custom Field - ${customField.name}`,
|
@@ -175,7 +182,10 @@ export default {
|
|
175
182
|
async getCustomFieldItems($) {
|
176
183
|
const customFieldItems = [];
|
177
184
|
for (const customFieldId of this.customFieldIds) {
|
178
|
-
const customField = await this.
|
185
|
+
const customField = await this.app.getCustomField({
|
186
|
+
$,
|
187
|
+
customFieldId,
|
188
|
+
});
|
179
189
|
const customFieldItem = {
|
180
190
|
idCustomField: customFieldId,
|
181
191
|
};
|
@@ -196,30 +206,37 @@ export default {
|
|
196
206
|
},
|
197
207
|
},
|
198
208
|
async run({ $ }) {
|
199
|
-
const
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
209
|
+
const res = await this.app.updateCard({
|
210
|
+
$,
|
211
|
+
cardId: this.cardId,
|
212
|
+
data: pickBy(pick(this, [
|
213
|
+
"name",
|
214
|
+
"desc",
|
215
|
+
"closed",
|
216
|
+
"idMembers",
|
217
|
+
"idAttachmentCover",
|
218
|
+
"idList",
|
219
|
+
"idLabels",
|
220
|
+
"idBoard",
|
221
|
+
"pos",
|
222
|
+
"due",
|
223
|
+
"dueComplete",
|
224
|
+
"subscribed",
|
225
|
+
"address",
|
226
|
+
"locationName",
|
227
|
+
"coordinates",
|
228
|
+
])),
|
229
|
+
});
|
217
230
|
|
218
231
|
if (this.customFieldIds) {
|
219
232
|
const customFieldItems = await this.getCustomFieldItems($);
|
220
|
-
const updatedCustomFields = await this.
|
221
|
-
|
222
|
-
|
233
|
+
const updatedCustomFields = await this.app.updateCustomFields({
|
234
|
+
$,
|
235
|
+
cardId: this.cardId,
|
236
|
+
data: {
|
237
|
+
customFieldItems,
|
238
|
+
},
|
239
|
+
});
|
223
240
|
res.updatedCustomFields = updatedCustomFields;
|
224
241
|
}
|
225
242
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pipedream/trello",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.4.0",
|
4
4
|
"description": "Pipedream Trello Components",
|
5
5
|
"main": "trello.app.mjs",
|
6
6
|
"keywords": [
|
@@ -10,11 +10,11 @@
|
|
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
|
-
"
|
16
|
-
"lodash
|
17
|
-
"
|
15
|
+
"form-data": "^4.0.0",
|
16
|
+
"lodash-es": "^4.17.21",
|
17
|
+
"ms": "^2.1.3"
|
18
18
|
},
|
19
19
|
"gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535",
|
20
20
|
"publishConfig": {
|
@@ -5,19 +5,20 @@ export default {
|
|
5
5
|
key: "trello-card-archived",
|
6
6
|
name: "Card Archived (Instant)",
|
7
7
|
description: "Emit new event for each card archived.",
|
8
|
-
version: "0.0
|
8
|
+
version: "0.1.0",
|
9
9
|
type: "source",
|
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
|
lists: {
|
19
|
+
optional: true,
|
19
20
|
propDefinition: [
|
20
|
-
common.props.
|
21
|
+
common.props.app,
|
21
22
|
"lists",
|
22
23
|
(c) => ({
|
23
24
|
board: c.board,
|
@@ -27,8 +28,21 @@ export default {
|
|
27
28
|
},
|
28
29
|
methods: {
|
29
30
|
...common.methods,
|
31
|
+
getFilteredCards({
|
32
|
+
boardId, ...args
|
33
|
+
} = {}) {
|
34
|
+
return this.app._makeRequest({
|
35
|
+
path: `/boards/${boardId}/cards`,
|
36
|
+
...args,
|
37
|
+
});
|
38
|
+
},
|
30
39
|
async getSampleEvents() {
|
31
|
-
const cards = await this.
|
40
|
+
const cards = await this.getFilteredCards({
|
41
|
+
boardId: this.board,
|
42
|
+
params: {
|
43
|
+
filter: "closed",
|
44
|
+
},
|
45
|
+
});
|
32
46
|
return {
|
33
47
|
sampleEvents: cards,
|
34
48
|
sortField: "dateLastActivity",
|
@@ -40,7 +54,9 @@ export default {
|
|
40
54
|
},
|
41
55
|
async getResult(event) {
|
42
56
|
const cardId = event.body?.action?.data?.card?.id;
|
43
|
-
return this.
|
57
|
+
return this.app.getCard({
|
58
|
+
cardId,
|
59
|
+
});
|
44
60
|
},
|
45
61
|
isRelevant({ result: card }) {
|
46
62
|
return (
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import ms from "ms";
|
1
2
|
import common from "../common/common-polling.mjs";
|
2
3
|
|
3
4
|
export default {
|
@@ -5,46 +6,37 @@ export default {
|
|
5
6
|
key: "trello-card-due-date-reminder",
|
6
7
|
name: "Card Due Date Reminder",
|
7
8
|
description: "Emit new event at a specified time before a card is due.",
|
8
|
-
version: "0.0
|
9
|
+
version: "0.1.0",
|
9
10
|
type: "source",
|
10
11
|
dedupe: "unique",
|
11
12
|
props: {
|
12
13
|
...common.props,
|
13
14
|
board: {
|
14
15
|
propDefinition: [
|
15
|
-
common.props.
|
16
|
+
common.props.app,
|
16
17
|
"board",
|
17
18
|
],
|
18
19
|
},
|
19
20
|
timeBefore: {
|
20
|
-
type: "
|
21
|
+
type: "string",
|
21
22
|
label: "Time Before",
|
22
|
-
description: "How far before the due time the event should trigger.",
|
23
|
-
default: 5,
|
24
|
-
},
|
25
|
-
timeBeforeUnit: {
|
26
|
-
type: "integer",
|
27
|
-
label: "Time Before (Unit)",
|
28
|
-
description: "Unit of time for Time Before.",
|
23
|
+
description: "How far before the due time the event should trigger. For example, `5 minutes`, `10 minutes`, `1 hour`.",
|
24
|
+
default: "5 minutes",
|
29
25
|
options: [
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
label: "Weeks",
|
44
|
-
value: 604800000,
|
45
|
-
},
|
26
|
+
"5 minutes",
|
27
|
+
"10 minutes",
|
28
|
+
"15 minutes",
|
29
|
+
"30 minutes",
|
30
|
+
"1 hour",
|
31
|
+
"2 hours",
|
32
|
+
"3 hours",
|
33
|
+
"6 hours",
|
34
|
+
"12 hours",
|
35
|
+
"1 day",
|
36
|
+
"2 days",
|
37
|
+
"3 days",
|
38
|
+
"1 week",
|
46
39
|
],
|
47
|
-
default: 60000,
|
48
40
|
},
|
49
41
|
},
|
50
42
|
methods: {
|
@@ -67,11 +59,20 @@ export default {
|
|
67
59
|
const boardId = this.board;
|
68
60
|
const now = event.timestamp * 1000;
|
69
61
|
|
70
|
-
const
|
62
|
+
const timeBeforeMs = ms(this.timeBefore);
|
63
|
+
if (!timeBeforeMs) {
|
64
|
+
throw new Error(`Invalid timeBefore value: ${this.timeBefore}`);
|
65
|
+
}
|
66
|
+
|
67
|
+
const cards = await this.app.getCards({
|
68
|
+
boardId,
|
69
|
+
});
|
71
70
|
for (const card of cards) {
|
72
|
-
if (!card.due)
|
71
|
+
if (!card.due) {
|
72
|
+
continue;
|
73
|
+
}
|
73
74
|
const due = Date.parse(card.due);
|
74
|
-
const notifyAt = due -
|
75
|
+
const notifyAt = due - timeBeforeMs;
|
75
76
|
if (notifyAt <= now) {
|
76
77
|
this.emitEvent(card, now);
|
77
78
|
}
|
@@ -5,19 +5,19 @@ export default {
|
|
5
5
|
key: "trello-card-moved",
|
6
6
|
name: "Card Moved (Instant)",
|
7
7
|
description: "Emit new event each time a card is moved to a list.",
|
8
|
-
version: "0.0
|
8
|
+
version: "0.1.0",
|
9
9
|
type: "source",
|
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
|
lists: {
|
19
19
|
propDefinition: [
|
20
|
-
common.props.
|
20
|
+
common.props.app,
|
21
21
|
"lists",
|
22
22
|
(c) => ({
|
23
23
|
board: c.board,
|
@@ -29,8 +29,12 @@ export default {
|
|
29
29
|
...common.methods,
|
30
30
|
async getSampleEvents() {
|
31
31
|
const cards = this.lists && this.lists.length > 0
|
32
|
-
? await this.
|
33
|
-
|
32
|
+
? await this.app.getCardsInList({
|
33
|
+
listId: this.lists[0],
|
34
|
+
})
|
35
|
+
: await this.app.getCards({
|
36
|
+
boardId: this.board,
|
37
|
+
});
|
34
38
|
return {
|
35
39
|
sampleEvents: cards,
|
36
40
|
sortFilter: "dateLastActivity",
|
@@ -51,7 +55,9 @@ export default {
|
|
51
55
|
const listAfter = event.body?.action?.data?.listAfter?.name;
|
52
56
|
/** Record listAfter to use in generateMeta() */
|
53
57
|
this._setListAfter(listAfter);
|
54
|
-
return this.
|
58
|
+
return this.app.getCard({
|
59
|
+
cardId,
|
60
|
+
});
|
55
61
|
},
|
56
62
|
isRelevant({
|
57
63
|
result: card, event,
|
@@ -5,19 +5,19 @@ export default {
|
|
5
5
|
key: "trello-card-updates",
|
6
6
|
name: "Card Updates (Instant)",
|
7
7
|
description: "Emit new event for each update to a Trello card.",
|
8
|
-
version: "0.0
|
8
|
+
version: "0.1.0",
|
9
9
|
type: "source",
|
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
|
cards: {
|
19
19
|
propDefinition: [
|
20
|
-
common.props.
|
20
|
+
common.props.app,
|
21
21
|
"cards",
|
22
22
|
(c) => ({
|
23
23
|
board: c.board,
|
@@ -26,7 +26,7 @@ export default {
|
|
26
26
|
},
|
27
27
|
customFieldItems: {
|
28
28
|
propDefinition: [
|
29
|
-
common.props.
|
29
|
+
common.props.app,
|
30
30
|
"customFieldItems",
|
31
31
|
],
|
32
32
|
},
|
@@ -37,14 +37,20 @@ export default {
|
|
37
37
|
let cards = [];
|
38
38
|
if (this.cards && this.cards.length > 0) {
|
39
39
|
for (const cardId of this.cards) {
|
40
|
-
const card = await this.
|
41
|
-
|
40
|
+
const card = await this.app.getCard({
|
41
|
+
cardId,
|
42
|
+
params: {
|
43
|
+
customFieldItems: this.customFieldItems,
|
44
|
+
},
|
42
45
|
});
|
43
46
|
cards.push(card);
|
44
47
|
}
|
45
48
|
} else {
|
46
|
-
cards = await this.
|
47
|
-
|
49
|
+
cards = await this.app.getCards({
|
50
|
+
boardId: this.board,
|
51
|
+
params: {
|
52
|
+
customFieldItems: this.customFieldItems,
|
53
|
+
},
|
48
54
|
});
|
49
55
|
}
|
50
56
|
return {
|
@@ -58,8 +64,11 @@ export default {
|
|
58
64
|
},
|
59
65
|
async getResult(event) {
|
60
66
|
const cardId = event.body?.action?.data?.card?.id;
|
61
|
-
return this.
|
62
|
-
|
67
|
+
return this.app.getCard({
|
68
|
+
cardId,
|
69
|
+
params: {
|
70
|
+
customFieldItems: this.customFieldItems,
|
71
|
+
},
|
63
72
|
});
|
64
73
|
},
|
65
74
|
isRelevant({ result: card }) {
|
@@ -9,7 +9,7 @@ export default {
|
|
9
9
|
...base.props,
|
10
10
|
board: {
|
11
11
|
propDefinition: [
|
12
|
-
base.props.
|
12
|
+
base.props.app,
|
13
13
|
"board",
|
14
14
|
],
|
15
15
|
},
|
@@ -32,7 +32,9 @@ export default {
|
|
32
32
|
return false;
|
33
33
|
}
|
34
34
|
|
35
|
-
const member = await this.
|
35
|
+
const member = await this.app.getMember({
|
36
|
+
memberId: "me",
|
37
|
+
});
|
36
38
|
|
37
39
|
if (
|
38
40
|
this.onlyEventsRelatedWithAuthenticatedUser &&
|