@pipedream/monday 0.3.6 → 0.3.8
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/create-board/create-board.mjs +2 -2
- package/actions/create-column/create-column.mjs +1 -1
- package/actions/create-group/create-group.mjs +1 -1
- package/actions/create-item/create-item.mjs +2 -2
- package/actions/create-update/create-update.mjs +2 -2
- package/actions/update-item-name/update-item-name.mjs +1 -1
- package/common/constants.mjs +6 -0
- package/common/queries.mjs +1 -0
- package/monday.app.mjs +4 -3
- package/package.json +1 -1
- package/sources/column-value-updated/column-value-updated.mjs +8 -2
- package/sources/common/common-webhook.mjs +42 -23
- package/sources/name-updated/name-updated.mjs +8 -2
- package/sources/new-board/new-board.mjs +1 -1
- package/sources/new-item/new-item.mjs +8 -2
- package/sources/new-subitem/new-subitem.mjs +34 -0
- package/sources/new-subitem-update/new-subitem-update.mjs +34 -0
- package/sources/new-user/new-user.mjs +1 -1
- package/sources/specific-column-updated/specific-column-updated.mjs +8 -2
- package/sources/subitem-column-value-updated/subitem-column-value-updated.mjs +39 -0
- package/sources/subitem-name-updated/subitem-name-updated.mjs +34 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import monday from "../../monday.app.mjs";
|
|
2
1
|
import utils from "../../common/utils.mjs";
|
|
2
|
+
import monday from "../../monday.app.mjs";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "monday-create-board",
|
|
6
6
|
name: "Create Board",
|
|
7
7
|
description: "Creates a new board. [See the docs here](https://api.developer.monday.com/docs/boards#create-a-board)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.3",
|
|
10
10
|
props: {
|
|
11
11
|
monday,
|
|
12
12
|
boardName: {
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Create Group",
|
|
6
6
|
description: "Creates a new group in a specific board. [See the docs here](https://api.developer.monday.com/docs/groups-queries#create-a-group)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.4",
|
|
9
9
|
props: {
|
|
10
10
|
monday,
|
|
11
11
|
boardId: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import monday from "../../monday.app.mjs";
|
|
2
1
|
import utils from "../../common/utils.mjs";
|
|
2
|
+
import monday from "../../monday.app.mjs";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "monday-create-item",
|
|
6
6
|
name: "Create Item",
|
|
7
7
|
description: "Creates an item. [See the docs here](https://api.developer.monday.com/docs/items-queries#create-an-item)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.5",
|
|
10
10
|
props: {
|
|
11
11
|
monday,
|
|
12
12
|
boardId: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import monday from "../../monday.app.mjs";
|
|
2
1
|
import utils from "../../common/utils.mjs";
|
|
2
|
+
import monday from "../../monday.app.mjs";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "monday-create-update",
|
|
6
6
|
name: "Create an Update",
|
|
7
7
|
description: "Creates a new update. [See the docs here](https://api.developer.monday.com/docs/updates-queries#create-an-update)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.5",
|
|
10
10
|
props: {
|
|
11
11
|
monday,
|
|
12
12
|
updateBody: {
|
package/common/constants.mjs
CHANGED
package/common/queries.mjs
CHANGED
package/monday.app.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import mondaySdk from "monday-sdk-js";
|
|
2
|
-
import uniqBy from "lodash.uniqby";
|
|
3
|
-
import map from "lodash.map";
|
|
4
1
|
import flatMap from "lodash.flatmap";
|
|
2
|
+
import map from "lodash.map";
|
|
3
|
+
import uniqBy from "lodash.uniqby";
|
|
4
|
+
import mondaySdk from "monday-sdk-js";
|
|
5
5
|
import constants from "./common/constants.mjs";
|
|
6
6
|
import mutations from "./common/mutations.mjs";
|
|
7
7
|
import queries from "./common/queries.mjs";
|
|
@@ -303,6 +303,7 @@ export default {
|
|
|
303
303
|
|
|
304
304
|
const { boards } = data;
|
|
305
305
|
return boards
|
|
306
|
+
.filter(({ type }) => type !== constants.BOARD_TYPE.SUB_ITEMS_BOARD)
|
|
306
307
|
.map(({
|
|
307
308
|
id, name,
|
|
308
309
|
}) => ({
|
package/package.json
CHANGED
|
@@ -3,11 +3,17 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-column-value-updated",
|
|
6
|
-
name: "Column Value Updated",
|
|
6
|
+
name: "New Column Value Updated (Instant)",
|
|
7
7
|
description: "Emit new event when a column value is updated on a board in Monday. For changes to Name, use the Name Updated Trigger.",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.3",
|
|
10
10
|
dedupe: "unique",
|
|
11
|
+
hooks: {
|
|
12
|
+
...common.hooks,
|
|
13
|
+
async deploy() {
|
|
14
|
+
await this.commonDeploy();
|
|
15
|
+
},
|
|
16
|
+
},
|
|
11
17
|
methods: {
|
|
12
18
|
...common.methods,
|
|
13
19
|
getWebhookArgs() {
|
|
@@ -16,18 +16,6 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
hooks: {
|
|
19
|
-
async deploy() {
|
|
20
|
-
const { items } = (await this.monday.listItemsBoard({
|
|
21
|
-
boardId: +this.boardId,
|
|
22
|
-
})).data.boards[0];
|
|
23
|
-
for (const item of items.slice(-25).reverse()) {
|
|
24
|
-
const itemData = await this.monday.getItem({
|
|
25
|
-
id: +item.id,
|
|
26
|
-
});
|
|
27
|
-
const meta = this.generateMeta(item);
|
|
28
|
-
this.$emit(itemData, meta);
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
19
|
async activate() {
|
|
32
20
|
const args = this.getWebhookArgs();
|
|
33
21
|
const { data } = await this.monday.createWebhook({
|
|
@@ -37,18 +25,21 @@ export default {
|
|
|
37
25
|
});
|
|
38
26
|
const hookId = data?.create_webhook?.id;
|
|
39
27
|
if (!hookId) {
|
|
40
|
-
throw new Error (
|
|
28
|
+
throw new Error (this.getWebhookCreationError());
|
|
41
29
|
}
|
|
42
30
|
this._setHookId(data.create_webhook.id);
|
|
43
31
|
},
|
|
44
32
|
async deactivate() {
|
|
45
33
|
const hookId = this._getHookId();
|
|
46
|
-
|
|
47
|
-
id: hookId,
|
|
34
|
+
return this.monday.deleteWebhook({
|
|
35
|
+
id: +hookId,
|
|
48
36
|
});
|
|
49
37
|
},
|
|
50
38
|
},
|
|
51
39
|
methods: {
|
|
40
|
+
getWebhookCreationError() {
|
|
41
|
+
return "Failed to establish webhook";
|
|
42
|
+
},
|
|
52
43
|
_getHookId() {
|
|
53
44
|
return this.db.get("hookId");
|
|
54
45
|
},
|
|
@@ -58,24 +49,46 @@ export default {
|
|
|
58
49
|
getWebhookArgs() {
|
|
59
50
|
throw new Error("getEventType is not implemented");
|
|
60
51
|
},
|
|
61
|
-
|
|
52
|
+
getSummary({ item }) {
|
|
53
|
+
return item.name;
|
|
54
|
+
},
|
|
55
|
+
generateMeta({
|
|
56
|
+
item, event,
|
|
57
|
+
}) {
|
|
62
58
|
return {
|
|
63
|
-
id: `${item.id}_${item.updated_at}`,
|
|
64
|
-
summary:
|
|
59
|
+
id: `${item.id}_${item.updated_at || item.changedAt}`,
|
|
60
|
+
summary: this.getSummary({
|
|
61
|
+
item,
|
|
62
|
+
event,
|
|
63
|
+
}),
|
|
65
64
|
ts: Date.parse(item.updated_at),
|
|
66
65
|
};
|
|
67
66
|
},
|
|
67
|
+
async commonDeploy() {
|
|
68
|
+
const { items } = (await this.monday.listItemsBoard({
|
|
69
|
+
boardId: +this.boardId,
|
|
70
|
+
})).data.boards[0];
|
|
71
|
+
for (const item of items.slice(-25).reverse()) {
|
|
72
|
+
const itemData = await this.monday.getItem({
|
|
73
|
+
id: +item.id,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const meta = this.generateMeta({
|
|
77
|
+
item,
|
|
78
|
+
});
|
|
79
|
+
this.$emit(itemData, meta);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
68
82
|
},
|
|
69
83
|
async run(event) {
|
|
70
84
|
const { body } = event;
|
|
71
85
|
|
|
72
86
|
// verify the webhook
|
|
73
87
|
if (body?.challenge) {
|
|
74
|
-
|
|
88
|
+
return this.http.respond({
|
|
75
89
|
status: 200,
|
|
76
90
|
body,
|
|
77
91
|
});
|
|
78
|
-
return;
|
|
79
92
|
}
|
|
80
93
|
|
|
81
94
|
const itemId = body?.event?.pulseId;
|
|
@@ -83,11 +96,17 @@ export default {
|
|
|
83
96
|
return;
|
|
84
97
|
}
|
|
85
98
|
|
|
86
|
-
const
|
|
99
|
+
const item = await this.monday.getItem({
|
|
87
100
|
id: itemId,
|
|
88
101
|
});
|
|
89
102
|
|
|
90
|
-
const meta = this.generateMeta(
|
|
91
|
-
|
|
103
|
+
const meta = this.generateMeta({
|
|
104
|
+
item,
|
|
105
|
+
event: body.event,
|
|
106
|
+
});
|
|
107
|
+
this.$emit({
|
|
108
|
+
...body,
|
|
109
|
+
item,
|
|
110
|
+
}, meta);
|
|
92
111
|
},
|
|
93
112
|
};
|
|
@@ -3,11 +3,17 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-name-updated",
|
|
6
|
-
name: "Name Updated",
|
|
6
|
+
name: "New Name Updated (Instant)",
|
|
7
7
|
description: "Emit new event when an item's Name is updated on a board in Monday.",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.3",
|
|
10
10
|
dedupe: "unique",
|
|
11
|
+
hooks: {
|
|
12
|
+
...common.hooks,
|
|
13
|
+
async deploy() {
|
|
14
|
+
await this.commonDeploy();
|
|
15
|
+
},
|
|
16
|
+
},
|
|
11
17
|
methods: {
|
|
12
18
|
...common.methods,
|
|
13
19
|
getWebhookArgs() {
|
|
@@ -3,11 +3,17 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-new-item",
|
|
6
|
-
name: "New Item",
|
|
6
|
+
name: "New Item (Instant)",
|
|
7
7
|
description: "Emit new event when a new item is added to a board in Monday.",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.3",
|
|
10
10
|
dedupe: "unique",
|
|
11
|
+
hooks: {
|
|
12
|
+
...common.hooks,
|
|
13
|
+
async deploy() {
|
|
14
|
+
await this.commonDeploy();
|
|
15
|
+
},
|
|
16
|
+
},
|
|
11
17
|
methods: {
|
|
12
18
|
...common.methods,
|
|
13
19
|
getWebhookArgs() {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import common from "../common/common-webhook.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "monday-new-subitem",
|
|
6
|
+
name: "New Sub-Item (Instant)",
|
|
7
|
+
description: "Emit new event when a sub-item is created. To create this trigger, you need to have at least one subitem previously created on your board.",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.2",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
boardId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
common.props.monday,
|
|
16
|
+
"boardId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
...common.methods,
|
|
22
|
+
getWebhookCreationError() {
|
|
23
|
+
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board.";
|
|
24
|
+
},
|
|
25
|
+
getWebhookArgs() {
|
|
26
|
+
return {
|
|
27
|
+
event: "create_subitem",
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
getSummary({ event: { pulseId } }) {
|
|
31
|
+
return `New sub-item with id ${pulseId} was created.`;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import common from "../common/common-webhook.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "monday-new-subitem-update",
|
|
6
|
+
name: "New Sub-Item Update (Instant)",
|
|
7
|
+
description: "Emit new event when an update is posted in sub-items. To create this trigger, you need to have at least one subitem previously created on your board.",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.2",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
boardId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
common.props.monday,
|
|
16
|
+
"boardId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
...common.methods,
|
|
22
|
+
getWebhookCreationError() {
|
|
23
|
+
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board.";
|
|
24
|
+
},
|
|
25
|
+
getWebhookArgs() {
|
|
26
|
+
return {
|
|
27
|
+
event: "create_subitem_update",
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
getSummary({ event: { pulseId } }) {
|
|
31
|
+
return `New update with id ${pulseId} was created.`;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -3,11 +3,17 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-specific-column-updated",
|
|
6
|
-
name: "Specific Column Updated",
|
|
6
|
+
name: "New Specific Column Updated (Instant)",
|
|
7
7
|
description: "Emit new event when a value in the specified column is updated on a board in Monday. For changes to Name, use the Name Updated Trigger.",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.3",
|
|
10
10
|
dedupe: "unique",
|
|
11
|
+
hooks: {
|
|
12
|
+
...common.hooks,
|
|
13
|
+
async deploy() {
|
|
14
|
+
await this.commonDeploy();
|
|
15
|
+
},
|
|
16
|
+
},
|
|
11
17
|
props: {
|
|
12
18
|
...common.props,
|
|
13
19
|
column: {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import common from "../common/common-webhook.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "monday-subitem-column-value-updated",
|
|
6
|
+
name: "New Sub-Item Column Value Updated (Instant)",
|
|
7
|
+
description: "Emit new event when any sub-item column changes. To create this trigger, you need to have at least one subitem previously created on your board.",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.2",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
boardId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
common.props.monday,
|
|
16
|
+
"boardId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
...common.methods,
|
|
22
|
+
getWebhookCreationError() {
|
|
23
|
+
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board.";
|
|
24
|
+
},
|
|
25
|
+
getWebhookArgs() {
|
|
26
|
+
return {
|
|
27
|
+
event: "change_subitem_column_value",
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
getSummary({
|
|
31
|
+
event: {
|
|
32
|
+
columnId,
|
|
33
|
+
pulseId,
|
|
34
|
+
},
|
|
35
|
+
}) {
|
|
36
|
+
return `The column ${columnId} of sub-item with id ${pulseId} was changed.`;
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import common from "../common/common-webhook.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "monday-subitem-name-updated",
|
|
6
|
+
name: "New Sub-Item Name Updated (Instant)",
|
|
7
|
+
description: "Emit new event when a sub-item name changes. To create this trigger, you need to have at least one subitem previously created on your board.",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.2",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
boardId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
common.props.monday,
|
|
16
|
+
"boardId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
...common.methods,
|
|
22
|
+
getWebhookCreationError() {
|
|
23
|
+
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board.";
|
|
24
|
+
},
|
|
25
|
+
getWebhookArgs() {
|
|
26
|
+
return {
|
|
27
|
+
event: "change_subitem_name",
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
getSummary({ event: { pulseId } }) {
|
|
31
|
+
return `The name of sub-item with id ${pulseId} was changed.`;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|