@pipedream/trello 0.3.2 → 0.3.5
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-via-url/add-attachment-to-card-via-url.mjs +73 -0
- package/actions/add-checklist/add-checklist.mjs +68 -0
- package/actions/add-comment/add-comment.mjs +55 -0
- package/actions/add-existing-label-to-card/add-existing-label-to-card.mjs +48 -0
- package/actions/add-file-as-attachment-via-url/add-file-as-attachment-via-url.mjs +72 -0
- package/actions/add-image-attachment/add-image-attachment.mjs +75 -0
- package/actions/add-label-to-card/add-label-to-card.mjs +55 -0
- package/actions/add-member-to-card/add-member-to-card.mjs +48 -0
- package/actions/archive-card/archive-card.mjs +37 -0
- package/actions/close-board/close-board.mjs +25 -0
- package/actions/common.js +21 -0
- package/actions/complete-checklist-item/complete-checklist-item.mjs +49 -0
- package/actions/copy-board/copy-board.mjs +174 -0
- package/actions/create-board/create-board.mjs +175 -0
- package/actions/create-card/create-card.mjs +195 -0
- package/actions/create-checklist/create-checklist.mjs +66 -0
- package/actions/create-checklist-item/create-checklist-item.mjs +67 -0
- package/actions/create-comment-on-card/create-comment-on-card.mjs +42 -0
- package/actions/create-label/create-label.mjs +73 -0
- package/actions/create-list/create-list.mjs +67 -0
- package/actions/delete-checklist/delete-checklist.mjs +46 -0
- package/actions/find-labels/find-labels.mjs +44 -0
- package/actions/find-list/find-list.mjs +49 -0
- package/actions/get-card/get-card.mjs +37 -0
- package/actions/get-list/get-list.mjs +32 -0
- package/actions/move-card-to-list/move-card-to-list.mjs +53 -0
- package/actions/remove-label-from-card/remove-label-from-card.mjs +47 -0
- package/actions/rename-list/rename-list.mjs +47 -0
- package/actions/search-boards/search-boards.mjs +57 -0
- package/actions/search-cards/search-cards.mjs +59 -0
- package/actions/search-checklists/search-checklists.mjs +110 -0
- package/actions/search-members/search-members.mjs +61 -0
- package/actions/update-card/update-card.mjs +165 -0
- package/common/events.js +138 -0
- package/common/fields.js +50 -0
- package/package.json +23 -19
- package/sources/board-based.mjs +27 -0
- package/sources/card-archived/card-archived.mjs +54 -0
- package/sources/card-due-date-reminder/card-due-date-reminder.mjs +80 -0
- package/sources/card-moved/card-moved.mjs +84 -0
- package/sources/card-updates/card-updates.mjs +60 -0
- package/sources/common-polling.mjs +16 -0
- package/sources/common-webhook.mjs +90 -0
- package/sources/common.js +34 -0
- package/sources/custom-webhook-events/custom-webhook-events.mjs +110 -0
- package/sources/new-activity/new-activity.mjs +64 -0
- package/sources/new-attachment/new-attachment.mjs +60 -0
- package/sources/new-board/new-board.mjs +29 -0
- package/sources/new-card/new-card.mjs +58 -0
- package/sources/new-checklist/new-checklist.mjs +29 -0
- package/sources/new-comment-added-to-card/new-comment-added-to-card.mjs +94 -0
- package/sources/new-label/new-label.mjs +41 -0
- package/sources/new-label-added-to-card/new-label-added-to-card.mjs +138 -0
- package/sources/new-list/new-list.mjs +29 -0
- package/sources/new-member-on-card/new-member-on-card.mjs +38 -0
- package/sources/new-notification/new-notification.mjs +50 -0
- package/trello.app.js +647 -145
- package/sources/card-archived/card-archived.js +0 -75
- package/sources/card-due-date-reminder/card-due-date-reminder.js +0 -65
- package/sources/card-moved/card-moved.js +0 -84
- package/sources/card-updates/card-updates.js +0 -77
- package/sources/custom-webhook-events/custom-webhook-events.js +0 -72
- package/sources/new-board/new-board.js +0 -62
- package/sources/new-card/new-card.js +0 -77
- package/sources/new-checklist/new-checklist.js +0 -74
- package/sources/new-comment-added-to-card/new-comment-added-to-card.js +0 -86
- package/sources/new-label/new-label.js +0 -73
- package/sources/new-label-added-to-card/new-labels-added-to-card.js +0 -85
- package/sources/new-list/new-list.js +0 -74
- package/sources/new-member-on-card/new-member-on-card.js +0 -75
- package/sources/new-notification/new-notification.js +0 -45
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
const trello = require("../../trello.app.js");
|
|
2
|
-
const get = require("lodash.get");
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
key: "trello-new-label",
|
|
6
|
-
name: "New Label (Instant)",
|
|
7
|
-
description: "Emits an event for each new label added to a board.",
|
|
8
|
-
version: "0.0.3",
|
|
9
|
-
dedupe: "unique",
|
|
10
|
-
props: {
|
|
11
|
-
trello,
|
|
12
|
-
boardId: { propDefinition: [trello, "boardId"] },
|
|
13
|
-
db: "$.service.db",
|
|
14
|
-
http: "$.interface.http",
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
hooks: {
|
|
18
|
-
async activate() {
|
|
19
|
-
let modelId = this.boardId;
|
|
20
|
-
if (!this.boardId) {
|
|
21
|
-
const member = await this.trello.getMember("me");
|
|
22
|
-
modelId = member.id;
|
|
23
|
-
}
|
|
24
|
-
const { id } = await this.trello.createHook({
|
|
25
|
-
id: modelId,
|
|
26
|
-
endpoint: this.http.endpoint,
|
|
27
|
-
});
|
|
28
|
-
this.db.set("hookId", id);
|
|
29
|
-
this.db.set("boardId", this.boardId);
|
|
30
|
-
},
|
|
31
|
-
async deactivate() {
|
|
32
|
-
console.log(this.db.get("hookId"));
|
|
33
|
-
await this.trello.deleteHook({
|
|
34
|
-
hookId: this.db.get("hookId"),
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
async run(event) {
|
|
40
|
-
// validate signature
|
|
41
|
-
if (
|
|
42
|
-
!this.trello.verifyTrelloWebhookRequest(
|
|
43
|
-
event,
|
|
44
|
-
this.http.endpoint
|
|
45
|
-
)
|
|
46
|
-
) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const body = get(event, "body");
|
|
51
|
-
if (!body) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const eventType = get(body, "action.type");
|
|
56
|
-
if (eventType !== "createLabel") {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const boardId = this.db.get("boardId");
|
|
60
|
-
const labelId = get(body, "action.data.label.id");
|
|
61
|
-
const label = await this.trello.getLabel(labelId);
|
|
62
|
-
|
|
63
|
-
if (boardId && boardId !== label.idBoard) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
this.$emit(label, {
|
|
68
|
-
id: label.id,
|
|
69
|
-
summary: label.name ? `${label.color} - ${label.name}` : `${label.color}`,
|
|
70
|
-
ts: Date.now(),
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const trello = require("../../trello.app.js");
|
|
2
|
-
const get = require("lodash.get");
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
key: "trello-new-label-added-to-card",
|
|
6
|
-
name: "New Label Added To Card (Instant)",
|
|
7
|
-
description: "Emits an event for each label added to a card.",
|
|
8
|
-
version: "0.0.3",
|
|
9
|
-
props: {
|
|
10
|
-
db: "$.service.db",
|
|
11
|
-
http: "$.interface.http",
|
|
12
|
-
trello,
|
|
13
|
-
boardId: { propDefinition: [trello, "boardId"] },
|
|
14
|
-
listIds: {
|
|
15
|
-
propDefinition: [trello, "listIds", (c) => ({ boardId: c.boardId })],
|
|
16
|
-
},
|
|
17
|
-
cardIds: {
|
|
18
|
-
propDefinition: [trello, "cardIds", (c) => ({ boardId: c.boardId })],
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
hooks: {
|
|
22
|
-
async activate() {
|
|
23
|
-
let modelId = this.boardId;
|
|
24
|
-
if (!this.boardId) {
|
|
25
|
-
const member = await this.trello.getMember("me");
|
|
26
|
-
modelId = member.id;
|
|
27
|
-
}
|
|
28
|
-
const { id } = await this.trello.createHook({
|
|
29
|
-
id: modelId,
|
|
30
|
-
endpoint: this.http.endpoint,
|
|
31
|
-
});
|
|
32
|
-
this.db.set("hookId", id);
|
|
33
|
-
this.db.set("boardId", this.boardId);
|
|
34
|
-
this.db.set("listIds", this.listIds);
|
|
35
|
-
this.db.set("cardIds", this.cardIds);
|
|
36
|
-
},
|
|
37
|
-
async deactivate() {
|
|
38
|
-
console.log(this.db.get("hookId"));
|
|
39
|
-
await this.trello.deleteHook({
|
|
40
|
-
hookId: this.db.get("hookId"),
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
async run(event) {
|
|
45
|
-
// validate signature
|
|
46
|
-
if (
|
|
47
|
-
!this.trello.verifyTrelloWebhookRequest(
|
|
48
|
-
event,
|
|
49
|
-
this.http.endpoint
|
|
50
|
-
)
|
|
51
|
-
) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const body = get(event, "body");
|
|
56
|
-
if (!body) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const eventType = get(body, "action.type");
|
|
61
|
-
if (eventType !== "addLabelToCard") {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const cardId = get(body, "action.data.card.id");
|
|
66
|
-
const labelName = get(body, "action.data.label.name");
|
|
67
|
-
const labelColor = get(body, "action.data.label.color");
|
|
68
|
-
const boardId = this.db.get("boardId");
|
|
69
|
-
const listIds = this.db.get("listIds");
|
|
70
|
-
const cardIds = this.db.get("cardIds");
|
|
71
|
-
const card = await this.trello.getCard(cardId);
|
|
72
|
-
|
|
73
|
-
if (boardId && boardId !== card.idBoard) return;
|
|
74
|
-
if (listIds && listIds.length > 0 && !listIds.includes(card.idList)) return;
|
|
75
|
-
if (cardIds && cardIds.length > 0 && !cardIds.includes(card.id)) return;
|
|
76
|
-
|
|
77
|
-
this.$emit(card, {
|
|
78
|
-
id: card.id,
|
|
79
|
-
summary: labelName
|
|
80
|
-
? `${labelColor} - ${labelName}; added to ${card.name}`
|
|
81
|
-
: `${labelColor}; added to ${card.name}`,
|
|
82
|
-
ts: Date.now(),
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const trello = require("../../trello.app.js");
|
|
2
|
-
const get = require("lodash.get");
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
key: "trello-new-list",
|
|
6
|
-
name: "New List (Instant)",
|
|
7
|
-
description: "Emits an event for each new list added to a board.",
|
|
8
|
-
version: "0.0.3",
|
|
9
|
-
dedupe: "unique",
|
|
10
|
-
props: {
|
|
11
|
-
trello,
|
|
12
|
-
boardId: { propDefinition: [trello, "boardId"] },
|
|
13
|
-
db: "$.service.db",
|
|
14
|
-
http: "$.interface.http",
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
hooks: {
|
|
18
|
-
async activate() {
|
|
19
|
-
let modelId = this.boardId;
|
|
20
|
-
if (!this.boardId) {
|
|
21
|
-
const member = await this.trello.getMember("me");
|
|
22
|
-
modelId = member.id;
|
|
23
|
-
}
|
|
24
|
-
const { id } = await this.trello.createHook({
|
|
25
|
-
id: modelId,
|
|
26
|
-
endpoint: this.http.endpoint,
|
|
27
|
-
});
|
|
28
|
-
this.db.set("hookId", id);
|
|
29
|
-
this.db.set("boardId", this.boardId);
|
|
30
|
-
},
|
|
31
|
-
async deactivate() {
|
|
32
|
-
console.log(this.db.get("hookId"));
|
|
33
|
-
await this.trello.deleteHook({
|
|
34
|
-
hookId: this.db.get("hookId"),
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
async run(event) {
|
|
40
|
-
// validate signature
|
|
41
|
-
if (
|
|
42
|
-
!this.trello.verifyTrelloWebhookRequest(
|
|
43
|
-
event,
|
|
44
|
-
this.http.endpoint
|
|
45
|
-
)
|
|
46
|
-
) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const body = get(event, "body");
|
|
51
|
-
if (!body) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const eventType = get(body, "action.type");
|
|
56
|
-
if (eventType !== "createList") {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const boardId = this.db.get("boardId");
|
|
61
|
-
const listId = get(body, "action.data.list.id");
|
|
62
|
-
const list = await this.trello.getList(listId);
|
|
63
|
-
|
|
64
|
-
if (boardId && boardId !== list.idBoard) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
this.$emit(list, {
|
|
69
|
-
id: list.id,
|
|
70
|
-
summary: list.name,
|
|
71
|
-
ts: Date.now(),
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
const trello = require("../../trello.app.js");
|
|
2
|
-
const get = require("lodash.get");
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
key: "trello-new-member-on-card",
|
|
6
|
-
name: "New Member on Card (Instant)",
|
|
7
|
-
description:
|
|
8
|
-
"Emits an event for each card joined by the authenticated Trello user.",
|
|
9
|
-
version: "0.0.4",
|
|
10
|
-
dedupe: "unique",
|
|
11
|
-
props: {
|
|
12
|
-
trello,
|
|
13
|
-
boardId: { propDefinition: [trello, "boardId"] },
|
|
14
|
-
db: "$.service.db",
|
|
15
|
-
http: "$.interface.http",
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
hooks: {
|
|
19
|
-
async activate() {
|
|
20
|
-
let modelId = this.boardId;
|
|
21
|
-
if (!this.boardId) {
|
|
22
|
-
const member = await this.trello.getMember("me");
|
|
23
|
-
modelId = member.id;
|
|
24
|
-
}
|
|
25
|
-
const { id } = await this.trello.createHook({
|
|
26
|
-
id: modelId,
|
|
27
|
-
endpoint: this.http.endpoint,
|
|
28
|
-
});
|
|
29
|
-
this.db.set("hookId", id);
|
|
30
|
-
this.db.set("boardId", this.boardId);
|
|
31
|
-
},
|
|
32
|
-
async deactivate() {
|
|
33
|
-
console.log(this.db.get("hookId"));
|
|
34
|
-
await this.trello.deleteHook({
|
|
35
|
-
hookId: this.db.get("hookId"),
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
async run(event) {
|
|
41
|
-
// validate signature
|
|
42
|
-
if (
|
|
43
|
-
!this.trello.verifyTrelloWebhookRequest(
|
|
44
|
-
event,
|
|
45
|
-
this.http.endpoint
|
|
46
|
-
)
|
|
47
|
-
) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const body = get(event, "body");
|
|
52
|
-
if (!body) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const eventType = get(body, "action.type");
|
|
57
|
-
if (eventType !== "addMemberToCard") {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const boardId = this.db.get("boardId");
|
|
62
|
-
const cardId = get(body, "action.data.card.id");
|
|
63
|
-
const card = await this.trello.getCard(cardId);
|
|
64
|
-
|
|
65
|
-
if (boardId && boardId !== card.idBoard) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
this.$emit(card, {
|
|
70
|
-
id: card.id,
|
|
71
|
-
summary: card.name,
|
|
72
|
-
ts: Date.now(),
|
|
73
|
-
});
|
|
74
|
-
},
|
|
75
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const trello = require("../../trello.app.js");
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
key: "trello-new-notification",
|
|
5
|
-
name: "New Notification",
|
|
6
|
-
description:
|
|
7
|
-
"Emits an event for each new Trello notification for the authenticated user.",
|
|
8
|
-
version: "0.0.3",
|
|
9
|
-
dedupe: "unique",
|
|
10
|
-
props: {
|
|
11
|
-
trello,
|
|
12
|
-
db: "$.service.db",
|
|
13
|
-
timer: {
|
|
14
|
-
type: "$.interface.timer",
|
|
15
|
-
default: {
|
|
16
|
-
intervalSeconds: 60 * 15,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
async run(event) {
|
|
22
|
-
let notificationDate;
|
|
23
|
-
const since = this.db.get("lastNotificationId") || null;
|
|
24
|
-
const params = {
|
|
25
|
-
since,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const notifications = await this.trello.getNotifications("me", params);
|
|
29
|
-
|
|
30
|
-
if (notifications.length > 0)
|
|
31
|
-
this.db.set(
|
|
32
|
-
"lastNotificationId",
|
|
33
|
-
notifications[notifications.length - 1].id
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
for (const notification of notifications) {
|
|
37
|
-
notificationDate = new Date(notification.date);
|
|
38
|
-
this.$emit(notification, {
|
|
39
|
-
id: notification.id,
|
|
40
|
-
summary: `${notification.type} : ${notification.data.card.name}`,
|
|
41
|
-
ts: notificationDate.getTime(),
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
};
|