@pipedream/trello 0.3.3 → 0.3.4

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.
Files changed (71) hide show
  1. package/actions/add-attachment-to-card-via-url/add-attachment-to-card-via-url.mjs +73 -0
  2. package/actions/add-checklist/add-checklist.mjs +68 -0
  3. package/actions/add-comment/add-comment.mjs +55 -0
  4. package/actions/add-existing-label-to-card/add-existing-label-to-card.mjs +48 -0
  5. package/actions/add-file-as-attachment-via-url/add-file-as-attachment-via-url.mjs +72 -0
  6. package/actions/add-image-attachment/add-image-attachment.mjs +75 -0
  7. package/actions/add-label-to-card/add-label-to-card.mjs +55 -0
  8. package/actions/add-member-to-card/add-member-to-card.mjs +48 -0
  9. package/actions/archive-card/archive-card.mjs +37 -0
  10. package/actions/close-board/close-board.mjs +25 -0
  11. package/actions/common.js +21 -0
  12. package/actions/complete-checklist-item/complete-checklist-item.mjs +49 -0
  13. package/actions/copy-board/copy-board.mjs +174 -0
  14. package/actions/create-board/create-board.mjs +175 -0
  15. package/actions/create-card/create-card.mjs +195 -0
  16. package/actions/create-checklist/create-checklist.mjs +66 -0
  17. package/actions/create-checklist-item/create-checklist-item.mjs +67 -0
  18. package/actions/create-comment-on-card/create-comment-on-card.mjs +42 -0
  19. package/actions/create-label/create-label.mjs +73 -0
  20. package/actions/create-list/create-list.mjs +67 -0
  21. package/actions/delete-checklist/delete-checklist.mjs +46 -0
  22. package/actions/find-labels/find-labels.mjs +44 -0
  23. package/actions/find-list/find-list.mjs +49 -0
  24. package/actions/get-card/get-card.mjs +37 -0
  25. package/actions/get-list/get-list.mjs +32 -0
  26. package/actions/move-card-to-list/move-card-to-list.mjs +53 -0
  27. package/actions/remove-label-from-card/remove-label-from-card.mjs +47 -0
  28. package/actions/rename-list/rename-list.mjs +47 -0
  29. package/actions/search-boards/search-boards.mjs +57 -0
  30. package/actions/search-cards/search-cards.mjs +59 -0
  31. package/actions/search-checklists/search-checklists.mjs +110 -0
  32. package/actions/search-members/search-members.mjs +61 -0
  33. package/actions/update-card/update-card.mjs +165 -0
  34. package/common/events.js +138 -0
  35. package/common/fields.js +50 -0
  36. package/package.json +23 -19
  37. package/sources/board-based.mjs +27 -0
  38. package/sources/card-archived/card-archived.mjs +54 -0
  39. package/sources/card-due-date-reminder/card-due-date-reminder.mjs +80 -0
  40. package/sources/card-moved/card-moved.mjs +84 -0
  41. package/sources/card-updates/card-updates.mjs +60 -0
  42. package/sources/common-polling.mjs +16 -0
  43. package/sources/common-webhook.mjs +90 -0
  44. package/sources/common.js +34 -0
  45. package/sources/custom-webhook-events/custom-webhook-events.mjs +110 -0
  46. package/sources/new-activity/new-activity.mjs +64 -0
  47. package/sources/new-attachment/new-attachment.mjs +60 -0
  48. package/sources/new-board/new-board.mjs +29 -0
  49. package/sources/new-card/new-card.mjs +58 -0
  50. package/sources/new-checklist/new-checklist.mjs +29 -0
  51. package/sources/new-comment-added-to-card/new-comment-added-to-card.mjs +94 -0
  52. package/sources/new-label/new-label.mjs +41 -0
  53. package/sources/new-label-added-to-card/new-label-added-to-card.mjs +138 -0
  54. package/sources/new-list/new-list.mjs +29 -0
  55. package/sources/new-member-on-card/new-member-on-card.mjs +38 -0
  56. package/sources/new-notification/new-notification.mjs +50 -0
  57. package/trello.app.js +647 -145
  58. package/sources/card-archived/card-archived.js +0 -75
  59. package/sources/card-due-date-reminder/card-due-date-reminder.js +0 -65
  60. package/sources/card-moved/card-moved.js +0 -84
  61. package/sources/card-updates/card-updates.js +0 -77
  62. package/sources/custom-webhook-events/custom-webhook-events.js +0 -72
  63. package/sources/new-board/new-board.js +0 -62
  64. package/sources/new-card/new-card.js +0 -77
  65. package/sources/new-checklist/new-checklist.js +0 -74
  66. package/sources/new-comment-added-to-card/new-comment-added-to-card.js +0 -86
  67. package/sources/new-label/new-label.js +0 -73
  68. package/sources/new-label-added-to-card/new-labels-added-to-card.js +0 -85
  69. package/sources/new-list/new-list.js +0 -74
  70. package/sources/new-member-on-card/new-member-on-card.js +0 -75
  71. package/sources/new-notification/new-notification.js +0 -45
@@ -0,0 +1,73 @@
1
+ import common from "../common.js";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "trello-add-attachment-to-card-via-url",
6
+ name: "Add Attachment to Card via URL",
7
+ description: "Adds a file attachment on a card by referencing a public URL. [See the docs here](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-attachments-post)",
8
+ version: "0.0.1",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ board: {
13
+ propDefinition: [
14
+ common.props.trello,
15
+ "board",
16
+ ],
17
+ },
18
+ idCard: {
19
+ propDefinition: [
20
+ common.props.trello,
21
+ "cards",
22
+ (c) => ({
23
+ board: c.board,
24
+ }),
25
+ ],
26
+ type: "string",
27
+ label: "Card",
28
+ description: "The ID of the Card to add the Attachment to",
29
+ optional: false,
30
+ },
31
+ name: {
32
+ propDefinition: [
33
+ common.props.trello,
34
+ "name",
35
+ ],
36
+ },
37
+ url: {
38
+ propDefinition: [
39
+ common.props.trello,
40
+ "url",
41
+ ],
42
+ },
43
+ mimeType: {
44
+ propDefinition: [
45
+ common.props.trello,
46
+ "mimeType",
47
+ ],
48
+ },
49
+ setCover: {
50
+ type: "boolean",
51
+ label: "Set Cover?",
52
+ description: "Determines whether to use the new attachment as a cover for the Card",
53
+ default: false,
54
+ },
55
+ },
56
+ async run({ $ }) {
57
+ const {
58
+ idCard,
59
+ name,
60
+ url,
61
+ mimeType,
62
+ setCover,
63
+ } = this;
64
+ const res = await this.trello.addAttachmentToCardViaUrl(idCard, {
65
+ name,
66
+ url,
67
+ mimeType,
68
+ setCover,
69
+ }, $);
70
+ $.export("$summary", `Successfully added attachement to card ${idCard}`);
71
+ return res;
72
+ },
73
+ };
@@ -0,0 +1,68 @@
1
+ // legacy_hash_id: a_WYieM3
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "trello-add-checklist",
6
+ name: "Create a Checklist",
7
+ description: "Adds a new checklist to a card.",
8
+ version: "0.1.1",
9
+ type: "action",
10
+ props: {
11
+ trello: {
12
+ type: "app",
13
+ app: "trello",
14
+ },
15
+ id: {
16
+ type: "string",
17
+ description: "The ID of the card.",
18
+ },
19
+ name: {
20
+ type: "string",
21
+ description: "The name of the checklist.",
22
+ optional: true,
23
+ },
24
+ idChecklistSource: {
25
+ type: "string",
26
+ description: "The ID of a source checklist to copy into the new one.",
27
+ optional: true,
28
+ },
29
+ pos: {
30
+ type: "string",
31
+ description: "The position of the checklist on the card. One of: top, bottom, or a positive number.",
32
+ optional: true,
33
+ },
34
+ },
35
+ async run({ $ }) {
36
+ const oauthSignerUri = this.trello.$auth.oauth_signer_uri;
37
+
38
+ let id = this.id;
39
+ const trelloParams = [
40
+ "name",
41
+ "idChecklistSource",
42
+ "pos",
43
+ ];
44
+ let p = this;
45
+
46
+ const queryString = trelloParams.filter((param) => p[param]).map((param) => `${param}=${p[param]}`)
47
+ .join("&");
48
+
49
+ const config = {
50
+ url: `https://api.trello.com/1/cards/${id}/checklists?${queryString}`,
51
+ method: "POST",
52
+ data: "",
53
+ };
54
+
55
+ const token = {
56
+ key: this.trello.$auth.oauth_access_token,
57
+ secret: this.trello.$auth.oauth_refresh_token,
58
+ };
59
+
60
+ const signConfig = {
61
+ token,
62
+ oauthSignerUri,
63
+ };
64
+
65
+ const resp = await axios($, config, signConfig);
66
+ return resp;
67
+ },
68
+ };
@@ -0,0 +1,55 @@
1
+ // legacy_hash_id: a_Xzi26w
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "trello-add-comment",
6
+ name: "Create a Comment",
7
+ description: "Create a new comment on a specific card.",
8
+ version: "0.1.1",
9
+ type: "action",
10
+ props: {
11
+ trello: {
12
+ type: "app",
13
+ app: "trello",
14
+ },
15
+ id: {
16
+ type: "string",
17
+ description: "The ID of the card.",
18
+ },
19
+ text: {
20
+ type: "string",
21
+ description: "The comment to add.",
22
+ },
23
+ },
24
+ async run({ $ }) {
25
+ const oauthSignerUri = this.trello.$auth.oauth_signer_uri;
26
+
27
+ let id = this.id;
28
+ const trelloParams = [
29
+ "text",
30
+ ];
31
+ let p = this;
32
+
33
+ const queryString = trelloParams.filter((param) => p[param]).map((param) => `${param}=${p[param]}`)
34
+ .join("&");
35
+
36
+ const config = {
37
+ url: `https://api.trello.com/1/cards/${id}/actions/comments?${queryString}`,
38
+ method: "POST",
39
+ data: "",
40
+ };
41
+
42
+ const token = {
43
+ key: this.trello.$auth.oauth_access_token,
44
+ secret: this.trello.$auth.oauth_refresh_token,
45
+ };
46
+
47
+ const signConfig = {
48
+ token,
49
+ oauthSignerUri,
50
+ };
51
+
52
+ const resp = await axios($, config, signConfig);
53
+ return resp;
54
+ },
55
+ };
@@ -0,0 +1,48 @@
1
+ import common from "../common.js";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "trello-add-existing-label-to-card",
6
+ name: "Add Existing Label to Card",
7
+ description: "Adds an existing label to the specified card. [See the docs here](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idlabels-post)",
8
+ version: "0.0.1",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ board: {
13
+ propDefinition: [
14
+ common.props.trello,
15
+ "board",
16
+ ],
17
+ },
18
+ idCard: {
19
+ propDefinition: [
20
+ common.props.trello,
21
+ "cards",
22
+ (c) => ({
23
+ board: c.board,
24
+ }),
25
+ ],
26
+ type: "string",
27
+ label: "Card",
28
+ description: "The ID of the Card to add the Label to",
29
+ optional: false,
30
+ },
31
+ idLabel: {
32
+ propDefinition: [
33
+ common.props.trello,
34
+ "label",
35
+ (c) => ({
36
+ board: c.board,
37
+ }),
38
+ ],
39
+ },
40
+ },
41
+ async run({ $ }) {
42
+ const res = await this.trello.addExistingLabelToCard(this.idCard, {
43
+ value: this.idLabel,
44
+ }, $);
45
+ $.export("$summary", `Successfully added label ${this.idLabel} to card ${this.idCard}`);
46
+ return res;
47
+ },
48
+ };
@@ -0,0 +1,72 @@
1
+ // legacy_hash_id: a_elirYr
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "trello-add-file-as-attachment-via-url",
6
+ name: "Add Attachment to Card via URL",
7
+ description: "Create a file attachment on a card by referencing a public URL",
8
+ version: "0.1.1",
9
+ type: "action",
10
+ props: {
11
+ trello: {
12
+ type: "app",
13
+ app: "trello",
14
+ },
15
+ name: {
16
+ type: "string",
17
+ label: "Name",
18
+ description: "The name of the attachment. Max length 256.",
19
+ optional: true,
20
+ },
21
+ mimeType: {
22
+ type: "string",
23
+ label: "MIME Type",
24
+ description: "The mimeType of the attachment. Max length 256.",
25
+ optional: true,
26
+ },
27
+ url: {
28
+ type: "string",
29
+ label: "File URL",
30
+ description: "A URL to a file you'd like to attach. Must start with http:// or https://",
31
+ },
32
+ id: {
33
+ type: "string",
34
+ label: "ID",
35
+ description: "The ID of your Trello card",
36
+ },
37
+ },
38
+ async run({ $ }) {
39
+ const oauthSignerUri = this.trello.$auth.oauth_signer_uri;
40
+
41
+ const trelloParams = [
42
+ "name",
43
+ "mimeType",
44
+ "url",
45
+ ];
46
+ let p = this;
47
+
48
+ const queryString = trelloParams.filter((param) => p[param]).map((param) => `${param}=${encodeURIComponent(p[param])}`)
49
+ .join("&");
50
+
51
+ const config = {
52
+ url: `https://api.trello.com/1/cards/${this.id}/attachments?${queryString}`,
53
+ method: "POST",
54
+ headers: {
55
+ "Content-Type": "application/json",
56
+ },
57
+ };
58
+
59
+ const token = {
60
+ key: this.trello.$auth.oauth_access_token,
61
+ secret: this.trello.$auth.oauth_refresh_token,
62
+ };
63
+
64
+ const signConfig = {
65
+ token,
66
+ oauthSignerUri,
67
+ };
68
+
69
+ const resp = await axios($, config, signConfig);
70
+ return resp;
71
+ },
72
+ };
@@ -0,0 +1,75 @@
1
+ // legacy_hash_id: a_B0im8k
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "trello-add-image-attachment",
6
+ name: "Trello Add Image Attachment to Card",
7
+ description: "Adds image to card",
8
+ version: "0.1.1",
9
+ type: "action",
10
+ props: {
11
+ trello: {
12
+ type: "app",
13
+ app: "trello",
14
+ },
15
+ id: {
16
+ type: "string",
17
+ description: "The ID of the card.",
18
+ },
19
+ name: {
20
+ type: "string",
21
+ description: "The name of the attachment. Max length 256.",
22
+ optional: true,
23
+ },
24
+ file: {
25
+ type: "string",
26
+ description: "The file to attach, as multipart/form-data",
27
+ optional: true,
28
+ },
29
+ mimeType: {
30
+ type: "string",
31
+ description: "The mimeType of the attachment. Max length 256.",
32
+ optional: true,
33
+ },
34
+ url: {
35
+ type: "string",
36
+ description: "A URL to attach. Must start with http:// or https://",
37
+ },
38
+ },
39
+ async run({ $ }) {
40
+ const oauthSignerUri = this.trello.$auth.oauth_signer_uri;
41
+
42
+ let id = this.id;
43
+ const trelloParams = [
44
+ "name",
45
+ "file",
46
+ "mimeType",
47
+ "url",
48
+ ];
49
+ let p = this;
50
+
51
+ const queryString = trelloParams.filter((param) => p[param]).map((param) => `${param}=${p[param]}`)
52
+ .join("&");
53
+
54
+ const config = {
55
+ url: `https://api.trello.com/1/cards/${id}/attachments?${queryString}`,
56
+ method: "POST",
57
+ headers: {
58
+ "Content-Type": "application/json",
59
+ },
60
+ };
61
+
62
+ const token = {
63
+ key: this.trello.$auth.oauth_access_token,
64
+ secret: this.trello.$auth.oauth_refresh_token,
65
+ };
66
+
67
+ const signConfig = {
68
+ token,
69
+ oauthSignerUri,
70
+ };
71
+
72
+ const resp = await axios($, config, signConfig);
73
+ return resp;
74
+ },
75
+ };
@@ -0,0 +1,55 @@
1
+ // legacy_hash_id: a_xqi4E7
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "trello-add-label-to-card",
6
+ name: "Add Existing Label to Card",
7
+ description: "Add an existing label to a card.",
8
+ version: "0.1.1",
9
+ type: "action",
10
+ props: {
11
+ trello: {
12
+ type: "app",
13
+ app: "trello",
14
+ },
15
+ id: {
16
+ type: "string",
17
+ description: "The ID of the card.",
18
+ },
19
+ value: {
20
+ type: "string",
21
+ description: "The ID of the label to add",
22
+ },
23
+ },
24
+ async run({ $ }) {
25
+ const oauthSignerUri = this.trello.$auth.oauth_signer_uri;
26
+
27
+ let id = this.id;
28
+ const trelloParams = [
29
+ "value",
30
+ ];
31
+ let p = this;
32
+
33
+ const queryString = trelloParams.filter((param) => p[param]).map((param) => `${param}=${p[param]}`)
34
+ .join("&");
35
+
36
+ const config = {
37
+ url: `https://api.trello.com/1/cards/${id}/idLabels?${queryString}`,
38
+ method: "POST",
39
+ data: "",
40
+ };
41
+
42
+ const token = {
43
+ key: this.trello.$auth.oauth_access_token,
44
+ secret: this.trello.$auth.oauth_refresh_token,
45
+ };
46
+
47
+ const signConfig = {
48
+ token,
49
+ oauthSignerUri,
50
+ };
51
+
52
+ const resp = await axios($, config, signConfig);
53
+ return resp;
54
+ },
55
+ };
@@ -0,0 +1,48 @@
1
+ import common from "../common.js";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "trello-add-member-to-card",
6
+ name: "Add Member to Card",
7
+ description: "Adds a member to the specified card. [See the docs here](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idmembers-post)",
8
+ version: "0.1.2",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ board: {
13
+ propDefinition: [
14
+ common.props.trello,
15
+ "board",
16
+ ],
17
+ },
18
+ idCard: {
19
+ propDefinition: [
20
+ common.props.trello,
21
+ "cards",
22
+ (c) => ({
23
+ board: c.board,
24
+ }),
25
+ ],
26
+ type: "string",
27
+ label: "Card",
28
+ description: "The ID of the Card to add the Member to",
29
+ optional: false,
30
+ },
31
+ idMember: {
32
+ propDefinition: [
33
+ common.props.trello,
34
+ "member",
35
+ (c) => ({
36
+ board: c.board,
37
+ }),
38
+ ],
39
+ },
40
+ },
41
+ async run({ $ }) {
42
+ const res = await this.trello.addMemberToCard(this.idCard, {
43
+ value: this.idMember,
44
+ }, $);
45
+ $.export("$summary", `Successfully added member ${res[0].fullName} to card ${this.idCard}`);
46
+ return res;
47
+ },
48
+ };
@@ -0,0 +1,37 @@
1
+ import common from "../common.js";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "trello-archive-card",
6
+ name: "Archive Card",
7
+ description: "Archives a card. [See the docs here](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put)",
8
+ version: "0.1.2",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ board: {
13
+ propDefinition: [
14
+ common.props.trello,
15
+ "board",
16
+ ],
17
+ },
18
+ idCard: {
19
+ propDefinition: [
20
+ common.props.trello,
21
+ "cards",
22
+ (c) => ({
23
+ board: c.board,
24
+ }),
25
+ ],
26
+ type: "string",
27
+ label: "Card",
28
+ description: "The ID of the Card to archive",
29
+ optional: false,
30
+ },
31
+ },
32
+ async run({ $ }) {
33
+ const res = await this.trello.archiveCard(this.idCard, $);
34
+ $.export("$summary", `Successfully archived card ${this.idCard}`);
35
+ return res;
36
+ },
37
+ };
@@ -0,0 +1,25 @@
1
+ import common from "../common.js";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "trello-close-board",
6
+ name: "Close Board",
7
+ description: "Closes a board. [See the docs here](https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-put)",
8
+ version: "0.0.1",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ boardId: {
13
+ propDefinition: [
14
+ common.props.trello,
15
+ "board",
16
+ ],
17
+ description: "The ID of the Board to close",
18
+ },
19
+ },
20
+ async run({ $ }) {
21
+ const res = await this.trello.closeBoard(this.boardId, $);
22
+ $.export("$summary", `Successfully closed board ${this.boardId}`);
23
+ return res;
24
+ },
25
+ };
@@ -0,0 +1,21 @@
1
+ const trello = require("../trello.app");
2
+
3
+ module.exports = {
4
+ props: {
5
+ trello,
6
+ },
7
+ methods: {
8
+ /**
9
+ * Returns an array of objects that matches the object's `name` property with the `query` param
10
+ *
11
+ * @param {array} foundObjects an array of objects results of a Trello's get
12
+ * endpoint on `labels` and `lists`.
13
+ * @param {string} query the name string that will be use to query against `foundObjects.name`
14
+ * property
15
+ * @returns {array} the objects from `foundObjects` matching the specified query.
16
+ */
17
+ getMatches(foundObjects, query) {
18
+ return foundObjects?.filter((obj) => obj.name.includes(query)) ?? [];
19
+ },
20
+ },
21
+ };
@@ -0,0 +1,49 @@
1
+ // legacy_hash_id: a_EViowW
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "trello-complete-checklist-item",
6
+ name: "Complete a Checklist Item",
7
+ description: "Completes an existing checklist item in a card.",
8
+ version: "0.1.1",
9
+ type: "action",
10
+ props: {
11
+ trello: {
12
+ type: "app",
13
+ app: "trello",
14
+ },
15
+ id: {
16
+ type: "string",
17
+ description: "The ID of the card.",
18
+ },
19
+ idCheckItem: {
20
+ type: "string",
21
+ description: "The ID of the checklist item to complete.",
22
+ },
23
+ },
24
+ async run({ $ }) {
25
+ const oauthSignerUri = this.trello.$auth.oauth_signer_uri;
26
+
27
+ let id = this.id;
28
+ let idCheckItem = this.idCheckItem;
29
+
30
+ const config = {
31
+ url: `https://api.trello.com/1/cards/${id}/checkItem/${idCheckItem}?state=complete`,
32
+ method: "PUT",
33
+ data: "",
34
+ };
35
+
36
+ const token = {
37
+ key: this.trello.$auth.oauth_access_token,
38
+ secret: this.trello.$auth.oauth_refresh_token,
39
+ };
40
+
41
+ const signConfig = {
42
+ token,
43
+ oauthSignerUri,
44
+ };
45
+
46
+ const resp = await axios($, config, signConfig);
47
+ return resp;
48
+ },
49
+ };