@pipedream/monday 0.6.3 → 0.8.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/actions/common/common-create-item.mjs +18 -9
- package/actions/create-board/create-board.mjs +2 -2
- package/actions/create-column/create-column.mjs +39 -24
- package/actions/create-group/create-group.mjs +2 -2
- package/actions/create-item/create-item.mjs +2 -2
- package/actions/create-subitem/create-subitem.mjs +2 -2
- package/actions/create-update/create-update.mjs +2 -2
- package/actions/get-column-values/get-column-values.mjs +4 -4
- package/actions/get-items-by-column-value/get-items-by-column-value.mjs +22 -7
- package/actions/update-column-values/update-column-values.mjs +29 -14
- package/actions/update-item-name/update-item-name.mjs +2 -2
- package/common/queries.mjs +11 -0
- package/common/utils.mjs +42 -3
- package/monday.app.mjs +25 -16
- package/package.json +2 -2
- package/sources/column-value-updated/column-value-updated.mjs +11 -3
- package/sources/name-updated/name-updated.mjs +3 -3
- package/sources/new-board/new-board.mjs +4 -4
- package/sources/new-item/new-item.mjs +3 -3
- package/sources/new-subitem/new-subitem.mjs +9 -4
- package/sources/new-subitem-update/new-subitem-update.mjs +8 -3
- package/sources/new-user/new-user.mjs +3 -3
- package/sources/specific-column-updated/specific-column-updated.mjs +8 -3
- package/sources/subitem-column-value-updated/subitem-column-value-updated.mjs +9 -4
- package/sources/subitem-name-updated/subitem-name-updated.mjs +9 -4
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
capitalizeWord, getColumnOptions,
|
|
3
|
+
} from "../../common/utils.mjs";
|
|
1
4
|
import monday from "../../monday.app.mjs";
|
|
2
5
|
|
|
3
6
|
export default {
|
|
@@ -11,7 +14,7 @@ export default {
|
|
|
11
14
|
}),
|
|
12
15
|
],
|
|
13
16
|
type: "string[]",
|
|
14
|
-
description: "Select columns to
|
|
17
|
+
description: "Select which item columns to set values for",
|
|
15
18
|
reloadProps: true,
|
|
16
19
|
},
|
|
17
20
|
},
|
|
@@ -20,26 +23,32 @@ export default {
|
|
|
20
23
|
if (!this.columns) {
|
|
21
24
|
return props;
|
|
22
25
|
}
|
|
26
|
+
const columnData = await this.monday.listColumns({
|
|
27
|
+
boardId: +this.boardId,
|
|
28
|
+
});
|
|
23
29
|
for (const column of this.columns) {
|
|
24
|
-
let description;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
description = "The ID of the person/user to add to item";
|
|
30
|
+
let description, options;
|
|
31
|
+
options = getColumnOptions(columnData, column);
|
|
32
|
+
if (column === "person") {
|
|
33
|
+
description = "The ID of a person/user";
|
|
29
34
|
} else if (column === "date4") {
|
|
30
|
-
description = "
|
|
35
|
+
description = "A date string in `YYYY-MM-DD` format, e.g. `2022-09-02`";
|
|
36
|
+
} else if (options) {
|
|
37
|
+
description = `Select a value from the list for column "${column}".`;
|
|
31
38
|
} else {
|
|
32
|
-
description = `Value for column ${column}. See the [Column Type Reference](https://developer.monday.com/api-reference/
|
|
39
|
+
description = `Value for column "${column}". See the [Column Type Reference](https://developer.monday.com/api-reference/reference/column-types-reference) to learn more about entering column type values.`;
|
|
33
40
|
}
|
|
34
41
|
props[column] = {
|
|
35
42
|
type: "string",
|
|
36
|
-
label: column,
|
|
43
|
+
label: capitalizeWord(column),
|
|
37
44
|
description,
|
|
45
|
+
options,
|
|
38
46
|
};
|
|
39
47
|
}
|
|
40
48
|
return props;
|
|
41
49
|
},
|
|
42
50
|
methods: {
|
|
51
|
+
capitalizeWord,
|
|
43
52
|
getEmailValue(value) {
|
|
44
53
|
let email = value;
|
|
45
54
|
if (typeof value === "string") {
|
|
@@ -4,9 +4,9 @@ import monday from "../../monday.app.mjs";
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "monday-create-board",
|
|
6
6
|
name: "Create Board",
|
|
7
|
-
description: "Creates a new board. [See the documentation](https://
|
|
7
|
+
description: "Creates a new board. [See the documentation](https://developer.monday.com/api-reference/reference/boards#create-a-board)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.8",
|
|
10
10
|
props: {
|
|
11
11
|
monday,
|
|
12
12
|
boardName: {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import constants from "../../common/constants.mjs";
|
|
2
2
|
import monday from "../../monday.app.mjs";
|
|
3
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
key: "monday-create-column",
|
|
6
7
|
name: "Create Column",
|
|
7
8
|
description: "Creates a column. [See the documentation](https://developer.monday.com/api-reference/reference/columns#create-a-column)",
|
|
8
9
|
type: "action",
|
|
9
|
-
version: "0.0
|
|
10
|
+
version: "0.1.0",
|
|
10
11
|
props: {
|
|
11
12
|
monday,
|
|
12
13
|
boardId: {
|
|
@@ -18,45 +19,63 @@ export default {
|
|
|
18
19
|
title: {
|
|
19
20
|
type: "string",
|
|
20
21
|
label: "Title",
|
|
21
|
-
description: "The new column
|
|
22
|
+
description: "The title of the new column",
|
|
22
23
|
},
|
|
23
24
|
columnType: {
|
|
24
25
|
type: "string",
|
|
25
26
|
label: "Column Type",
|
|
26
|
-
description: "The new column
|
|
27
|
+
description: "The type of the new column",
|
|
27
28
|
options: constants.COLUMN_TYPE_OPTIONS,
|
|
28
29
|
reloadProps: true,
|
|
29
30
|
},
|
|
30
31
|
description: {
|
|
31
32
|
type: "string",
|
|
32
33
|
label: "Description",
|
|
33
|
-
description: "The column
|
|
34
|
+
description: "The description of the new column",
|
|
34
35
|
optional: true,
|
|
35
36
|
},
|
|
36
37
|
},
|
|
37
38
|
async additionalProps() {
|
|
38
39
|
const props = {};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
optional: true,
|
|
44
|
-
};
|
|
45
|
-
if (this.columnType === "status") {
|
|
46
|
-
props.defaults = {
|
|
47
|
-
...defaults,
|
|
48
|
-
default: "{\"labels\":{\"1\":\"Option1\",\"2\":\"Option2\",\"3\":\"Option3\",\"4\": \"Option4\"}}",
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
if (this.columnType === "dropdown") {
|
|
40
|
+
if ([
|
|
41
|
+
"status",
|
|
42
|
+
"dropdown",
|
|
43
|
+
].includes(this.columnType)) {
|
|
52
44
|
props.defaults = {
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
type: "string",
|
|
46
|
+
label: "Custom Labels (Defaults)",
|
|
47
|
+
description: "The new column's custom labels (defaults). For use with column types `status` or `dropdown`. Should be an object in the format `{ \"1\": \"Technology\", \"2\": \"Marketing\" }` where each key is the label ID and each value is the label text. [See the documentation](https://developer.monday.com/api-reference/reference/columns#create-a-status-or-dropdown-column-with-custom-labels) for more information.",
|
|
48
|
+
optional: true,
|
|
55
49
|
};
|
|
56
50
|
}
|
|
57
51
|
return props;
|
|
58
52
|
},
|
|
59
53
|
async run({ $ }) {
|
|
54
|
+
let { defaults } = this;
|
|
55
|
+
if (defaults) {
|
|
56
|
+
try {
|
|
57
|
+
if (this.columnType === "status") {
|
|
58
|
+
defaults = JSON.stringify({
|
|
59
|
+
labels: JSON.parse(defaults),
|
|
60
|
+
});
|
|
61
|
+
} else if (this.columnType === "dropdown") {
|
|
62
|
+
const obj = JSON.parse(defaults);
|
|
63
|
+
defaults = JSON.stringify({
|
|
64
|
+
settings: {
|
|
65
|
+
labels: Object.entries(obj).map(([
|
|
66
|
+
id,
|
|
67
|
+
name,
|
|
68
|
+
]) => ({
|
|
69
|
+
id: Number(id),
|
|
70
|
+
name,
|
|
71
|
+
})),
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
} catch (err) {
|
|
76
|
+
throw new ConfigurationError(`Error parsing \`Custom Labels\` as JSON: "${err}"`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
60
79
|
const {
|
|
61
80
|
data,
|
|
62
81
|
errors,
|
|
@@ -66,11 +85,7 @@ export default {
|
|
|
66
85
|
boardId: +this.boardId,
|
|
67
86
|
title: this.title,
|
|
68
87
|
columnType: this.columnType,
|
|
69
|
-
defaults
|
|
70
|
-
? typeof this.defaults !== "string"
|
|
71
|
-
? JSON.stringify(this.defaults)
|
|
72
|
-
: this.defaults
|
|
73
|
-
: undefined,
|
|
88
|
+
defaults,
|
|
74
89
|
description: this.description,
|
|
75
90
|
});
|
|
76
91
|
|
|
@@ -3,9 +3,9 @@ import monday from "../../monday.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "monday-create-group",
|
|
5
5
|
name: "Create Group",
|
|
6
|
-
description: "Creates a new group in a specific board. [See the documentation](https://
|
|
6
|
+
description: "Creates a new group in a specific board. [See the documentation](https://developer.monday.com/api-reference/reference/groups#create-a-group)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.9",
|
|
9
9
|
props: {
|
|
10
10
|
monday,
|
|
11
11
|
boardId: {
|
|
@@ -6,9 +6,9 @@ export default {
|
|
|
6
6
|
...commonCreateItem,
|
|
7
7
|
key: "monday-create-item",
|
|
8
8
|
name: "Create Item",
|
|
9
|
-
description: "Creates an item. [See the documentation](https://
|
|
9
|
+
description: "Creates an item. [See the documentation](https://developer.monday.com/api-reference/reference/items#create-an-item)",
|
|
10
10
|
type: "action",
|
|
11
|
-
version: "0.0
|
|
11
|
+
version: "0.1.0",
|
|
12
12
|
props: {
|
|
13
13
|
monday,
|
|
14
14
|
boardId: {
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
name: "Create Subitem",
|
|
9
9
|
description: "Creates a subitem. [See the documentation](https://developer.monday.com/api-reference/reference/subitems#create-a-subitem)",
|
|
10
10
|
type: "action",
|
|
11
|
-
version: "0.0
|
|
11
|
+
version: "0.1.0",
|
|
12
12
|
props: {
|
|
13
13
|
monday,
|
|
14
14
|
boardId: {
|
|
@@ -26,7 +26,7 @@ export default {
|
|
|
26
26
|
}),
|
|
27
27
|
],
|
|
28
28
|
optional: false,
|
|
29
|
-
description: "
|
|
29
|
+
description: "Select a parent item or provide an item ID",
|
|
30
30
|
},
|
|
31
31
|
itemName: {
|
|
32
32
|
propDefinition: [
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
name: "Create an Update",
|
|
7
7
|
description: "Creates a new update. [See the documentation](https://developer.monday.com/api-reference/reference/updates#create-an-update)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.11",
|
|
10
10
|
props: {
|
|
11
11
|
monday,
|
|
12
12
|
updateBody: {
|
|
@@ -33,7 +33,7 @@ export default {
|
|
|
33
33
|
},
|
|
34
34
|
parentId: {
|
|
35
35
|
label: "Parent Update ID",
|
|
36
|
-
description: "
|
|
36
|
+
description: "Select a parent update or provide an update ID",
|
|
37
37
|
propDefinition: [
|
|
38
38
|
monday,
|
|
39
39
|
"updateId",
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-get-column-values",
|
|
6
6
|
name: "Get Column Values",
|
|
7
|
-
description: "Return values of
|
|
8
|
-
version: "0.0.
|
|
7
|
+
description: "Return values of specific column(s) for a board item. [See the documentation](https://developer.monday.com/api-reference/reference/column-values-v2)",
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
],
|
|
30
30
|
type: "string[]",
|
|
31
31
|
label: "Columns",
|
|
32
|
-
description: "
|
|
32
|
+
description: "Select the column(s) to return data from",
|
|
33
33
|
optional: true,
|
|
34
34
|
},
|
|
35
35
|
},
|
|
@@ -49,7 +49,7 @@ export default {
|
|
|
49
49
|
throw new Error(response.errors[0].message);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
$.export("$summary", `Successfully retrieved column values for item with ID ${this.itemId}
|
|
52
|
+
$.export("$summary", `Successfully retrieved column values for item with ID ${this.itemId}`);
|
|
53
53
|
|
|
54
54
|
return this.formatColumnValues(response.data.items);
|
|
55
55
|
},
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { getColumnOptions } from "../../common/utils.mjs";
|
|
1
2
|
import common from "../common/column-values.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
...common,
|
|
5
6
|
key: "monday-get-items-by-column-value",
|
|
6
7
|
name: "Get Items By Column Value",
|
|
7
|
-
description: "Searches a column for items matching a value. [See the documentation](https://developer.monday.com/api-reference/
|
|
8
|
-
version: "0.0
|
|
8
|
+
description: "Searches a column for items matching a value. [See the documentation](https://developer.monday.com/api-reference/reference/items-page-by-column-values)",
|
|
9
|
+
version: "0.1.0",
|
|
9
10
|
type: "action",
|
|
10
11
|
props: {
|
|
11
12
|
...common.props,
|
|
@@ -18,12 +19,26 @@ export default {
|
|
|
18
19
|
}),
|
|
19
20
|
],
|
|
20
21
|
description: "The column to search",
|
|
22
|
+
reloadProps: true,
|
|
21
23
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
24
|
+
},
|
|
25
|
+
async additionalProps() {
|
|
26
|
+
const columnData = await this.monday.listColumns({
|
|
27
|
+
boardId: +this.boardId,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const options = getColumnOptions(columnData, this.columnId, true);
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
value: {
|
|
34
|
+
type: "string",
|
|
35
|
+
label: "Value",
|
|
36
|
+
description: `The value to search for.${options
|
|
37
|
+
? ""
|
|
38
|
+
: " [See the documentation](https://developer.monday.com/api-reference/reference/items-page-by-column-values#supported-and-unsupported-columns) for additional information about column values"} `,
|
|
39
|
+
options,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
27
42
|
},
|
|
28
43
|
async run({ $ }) {
|
|
29
44
|
const response = await this.monday.getItemsByColumnValue({
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import common from "../common/column-values.mjs";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
axios, getFileStreamAndMetadata,
|
|
4
|
+
} from "@pipedream/platform";
|
|
4
5
|
import FormData from "form-data";
|
|
6
|
+
import { getColumnOptions } from "../../common/utils.mjs";
|
|
5
7
|
|
|
6
8
|
export default {
|
|
7
9
|
...common,
|
|
8
10
|
key: "monday-update-column-values",
|
|
9
11
|
name: "Update Column Values",
|
|
10
|
-
description: "Update multiple column values of an item. [See the documentation](https://developer.monday.com/api-reference/
|
|
11
|
-
version: "0.0
|
|
12
|
+
description: "Update multiple column values of an item. [See the documentation](https://developer.monday.com/api-reference/reference/columns#change-multiple-column-values)",
|
|
13
|
+
version: "0.2.0",
|
|
12
14
|
type: "action",
|
|
13
15
|
props: {
|
|
14
16
|
...common.props,
|
|
17
|
+
updateInfoBox: {
|
|
18
|
+
type: "alert",
|
|
19
|
+
alertType: "info",
|
|
20
|
+
content: "See the [Column types reference](https://developer.monday.com/api-reference/reference/column-types-reference) to find the proper data structures for supported column types",
|
|
21
|
+
},
|
|
15
22
|
boardId: {
|
|
16
23
|
...common.props.boardId,
|
|
17
|
-
description: "The board's unique identifier. See the [Column types reference](https://developer.monday.com/api-reference/docs/column-types-reference) to find the proper data structures for supported column types.",
|
|
18
24
|
reloadProps: true,
|
|
19
25
|
},
|
|
20
26
|
itemId: {
|
|
@@ -30,17 +36,22 @@ export default {
|
|
|
30
36
|
},
|
|
31
37
|
async additionalProps() {
|
|
32
38
|
const props = {};
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
const { boardId } = this;
|
|
40
|
+
if (boardId) {
|
|
41
|
+
const columns = await this.monday.listColumns({
|
|
42
|
+
boardId: +boardId,
|
|
43
|
+
});
|
|
35
44
|
for (const column of columns) {
|
|
36
|
-
|
|
45
|
+
const id = column.id;
|
|
46
|
+
props[id] = {
|
|
37
47
|
type: "string",
|
|
38
48
|
label: column.title,
|
|
39
|
-
description: `The value for
|
|
49
|
+
description: `The value for the "${column.title}" column (\`${id}\`)`,
|
|
40
50
|
optional: true,
|
|
51
|
+
options: getColumnOptions(columns, id),
|
|
41
52
|
};
|
|
42
53
|
if (column.type === "file") {
|
|
43
|
-
props[column.id].description += ".
|
|
54
|
+
props[column.id].description += ". Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)";
|
|
44
55
|
}
|
|
45
56
|
}
|
|
46
57
|
}
|
|
@@ -52,13 +63,17 @@ export default {
|
|
|
52
63
|
$, itemId, column, filePath,
|
|
53
64
|
}) {
|
|
54
65
|
const query = `mutation ($file: File!) { add_file_to_column (file: $file, item_id: ${itemId}, column_id: "${column.id}") { id } }`;
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
const {
|
|
67
|
+
stream, metadata,
|
|
68
|
+
} = await getFileStreamAndMetadata(filePath);
|
|
58
69
|
|
|
59
70
|
const formData = new FormData();
|
|
60
71
|
formData.append("query", query);
|
|
61
|
-
formData.append("variables[file]",
|
|
72
|
+
formData.append("variables[file]", stream, {
|
|
73
|
+
contentType: metadata.contentType,
|
|
74
|
+
knownLength: metadata.size,
|
|
75
|
+
filename: metadata.name,
|
|
76
|
+
});
|
|
62
77
|
|
|
63
78
|
return axios($, {
|
|
64
79
|
method: "POST",
|
|
@@ -3,9 +3,9 @@ import monday from "../../monday.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "monday-update-item-name",
|
|
5
5
|
name: "Update Item Name",
|
|
6
|
-
description: "Update an item's name. [See the documentation](https://
|
|
6
|
+
description: "Update an item's name. [See the documentation](https://developer.monday.com/api-reference/reference/columns#change-multiple-column-values)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.10",
|
|
9
9
|
props: {
|
|
10
10
|
monday,
|
|
11
11
|
boardId: {
|
package/common/queries.mjs
CHANGED
|
@@ -98,12 +98,23 @@ export default {
|
|
|
98
98
|
boards (ids: [$boardId]) {
|
|
99
99
|
columns {
|
|
100
100
|
id
|
|
101
|
+
settings_str
|
|
101
102
|
title
|
|
102
103
|
type
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
`,
|
|
108
|
+
listColumnOptions: `
|
|
109
|
+
query listColumnOptions ($boardId: ID!) {
|
|
110
|
+
boards (ids: [$boardId]) {
|
|
111
|
+
columns {
|
|
112
|
+
id
|
|
113
|
+
title
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`,
|
|
107
118
|
listUsers: `
|
|
108
119
|
query {
|
|
109
120
|
users (
|
package/common/utils.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
function emptyStrToUndefined(value) {
|
|
2
|
-
const trimmed = typeof
|
|
2
|
+
const trimmed = typeof value === "string" && value.trim();
|
|
3
3
|
return trimmed === ""
|
|
4
4
|
? undefined
|
|
5
5
|
: value;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
function strinfied(value) {
|
|
9
|
-
return typeof
|
|
9
|
+
return typeof value === "object"
|
|
10
10
|
? JSON.stringify(value)
|
|
11
11
|
: emptyStrToUndefined(value);
|
|
12
12
|
}
|
|
@@ -18,11 +18,50 @@ function strNumber(value) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
function toNumber(value) {
|
|
21
|
-
return typeof
|
|
21
|
+
return typeof value === "number"
|
|
22
22
|
? value
|
|
23
23
|
: strNumber(value);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
export function capitalizeWord(str) {
|
|
27
|
+
return str.slice(0, 1).toUpperCase() + str.slice(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function getColumnOptions(allColumnData, columnId, useLabels = false) {
|
|
31
|
+
const columnOptions = allColumnData.find(
|
|
32
|
+
({ id }) => id === columnId,
|
|
33
|
+
)?.settings_str;
|
|
34
|
+
if (columnOptions) {
|
|
35
|
+
try {
|
|
36
|
+
const labels = JSON.parse(columnOptions).labels;
|
|
37
|
+
return (Array.isArray(labels)
|
|
38
|
+
? labels.map(({
|
|
39
|
+
id, name,
|
|
40
|
+
}) => useLabels
|
|
41
|
+
? name
|
|
42
|
+
: ({
|
|
43
|
+
label: name,
|
|
44
|
+
value: id.toString(),
|
|
45
|
+
}))
|
|
46
|
+
: Object.entries(labels).map(
|
|
47
|
+
([
|
|
48
|
+
value,
|
|
49
|
+
label,
|
|
50
|
+
]) => useLabels
|
|
51
|
+
? label
|
|
52
|
+
: ({
|
|
53
|
+
label: label !== ""
|
|
54
|
+
? label
|
|
55
|
+
: value,
|
|
56
|
+
value,
|
|
57
|
+
}),
|
|
58
|
+
)).filter((str) => str);
|
|
59
|
+
} catch (err) {
|
|
60
|
+
console.log(`Error parsing options for column "${columnId}": ${err}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
26
65
|
export default {
|
|
27
66
|
emptyStrToUndefined,
|
|
28
67
|
strinfied,
|
package/monday.app.mjs
CHANGED
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
boardId: {
|
|
14
14
|
type: "string",
|
|
15
15
|
label: "Board ID",
|
|
16
|
-
description: "
|
|
16
|
+
description: "Select a board, or provide a board ID",
|
|
17
17
|
async options({ page }) {
|
|
18
18
|
return this.listBoardsOptions({
|
|
19
19
|
page: page + 1,
|
|
@@ -23,18 +23,18 @@ export default {
|
|
|
23
23
|
boardName: {
|
|
24
24
|
type: "string",
|
|
25
25
|
label: "Board Name",
|
|
26
|
-
description: "The board's name",
|
|
26
|
+
description: "The new board's name",
|
|
27
27
|
},
|
|
28
28
|
boardKind: {
|
|
29
29
|
type: "string",
|
|
30
30
|
label: "Board Kind",
|
|
31
|
-
description: "The board's kind (`public` / `private` / `share`)",
|
|
31
|
+
description: "The new board's kind (`public` / `private` / `share`)",
|
|
32
32
|
options: constants.BOARD_KIND_OPTIONS,
|
|
33
33
|
},
|
|
34
34
|
folderId: {
|
|
35
35
|
type: "integer",
|
|
36
36
|
label: "Folder ID",
|
|
37
|
-
description: "
|
|
37
|
+
description: "Optionally select a folder to create the board in, or provide a folder ID",
|
|
38
38
|
optional: true,
|
|
39
39
|
async options({ workspaceId }) {
|
|
40
40
|
return this.listFolderOptions({
|
|
@@ -45,7 +45,7 @@ export default {
|
|
|
45
45
|
workspaceId: {
|
|
46
46
|
type: "integer",
|
|
47
47
|
label: "Workspace ID",
|
|
48
|
-
description: "
|
|
48
|
+
description: "Select a workspace to create the board in, or provide a workspace ID. If not specified, the **Main Workspace** will be used",
|
|
49
49
|
optional: true,
|
|
50
50
|
async options() {
|
|
51
51
|
return this.listWorkspacesOptions();
|
|
@@ -54,7 +54,7 @@ export default {
|
|
|
54
54
|
templateId: {
|
|
55
55
|
type: "integer",
|
|
56
56
|
label: "Board Template ID",
|
|
57
|
-
description: "
|
|
57
|
+
description: "The board's template ID. You can obtain it from the URL when selecting the desired board (e.g. `https://{subdomain}.monday.com/boards/2419687965`) where `2419687965` is the template ID. [See the documentation](https://developer.monday.com/api-reference/reference/boards#create-a-board) for more information",
|
|
58
58
|
optional: true,
|
|
59
59
|
},
|
|
60
60
|
groupName: {
|
|
@@ -65,7 +65,7 @@ export default {
|
|
|
65
65
|
groupId: {
|
|
66
66
|
type: "string",
|
|
67
67
|
label: "Group ID",
|
|
68
|
-
description: "
|
|
68
|
+
description: "Select a group or provide a group ID",
|
|
69
69
|
optional: true,
|
|
70
70
|
async options({ boardId }) {
|
|
71
71
|
return this.listGroupsOptions({
|
|
@@ -76,7 +76,7 @@ export default {
|
|
|
76
76
|
itemName: {
|
|
77
77
|
type: "string",
|
|
78
78
|
label: "Item Name",
|
|
79
|
-
description: "The item's name",
|
|
79
|
+
description: "The new item's name",
|
|
80
80
|
},
|
|
81
81
|
itemColumnValues: {
|
|
82
82
|
type: "object",
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
98
98
|
itemId: {
|
|
99
99
|
type: "string",
|
|
100
100
|
label: "Item ID",
|
|
101
|
-
description: "
|
|
101
|
+
description: "Select an item or provide an item ID",
|
|
102
102
|
optional: true,
|
|
103
103
|
async options({
|
|
104
104
|
boardId, prevContext,
|
|
@@ -112,7 +112,7 @@ export default {
|
|
|
112
112
|
updateId: {
|
|
113
113
|
type: "string",
|
|
114
114
|
label: "Update ID",
|
|
115
|
-
description: "
|
|
115
|
+
description: "Select an update or provide an update ID",
|
|
116
116
|
optional: true,
|
|
117
117
|
async options({
|
|
118
118
|
page, boardId,
|
|
@@ -126,17 +126,17 @@ export default {
|
|
|
126
126
|
column: {
|
|
127
127
|
type: "string",
|
|
128
128
|
label: "Column",
|
|
129
|
-
description: "
|
|
129
|
+
description: "Select a column to watch for changes",
|
|
130
130
|
async options({ boardId }) {
|
|
131
|
-
const columns = await this.
|
|
131
|
+
const columns = await this.listColumnOptions({
|
|
132
132
|
boardId: +boardId,
|
|
133
133
|
});
|
|
134
134
|
return columns
|
|
135
|
-
|
|
135
|
+
?.filter((column) => column.id !== "name")
|
|
136
136
|
.map((column) => ({
|
|
137
137
|
label: column.title,
|
|
138
138
|
value: column.id,
|
|
139
|
-
}));
|
|
139
|
+
})) ?? [];
|
|
140
140
|
},
|
|
141
141
|
},
|
|
142
142
|
},
|
|
@@ -307,6 +307,15 @@ export default {
|
|
|
307
307
|
},
|
|
308
308
|
});
|
|
309
309
|
},
|
|
310
|
+
async listColumnOptions(variables) {
|
|
311
|
+
const { data } = await this.makeRequest({
|
|
312
|
+
query: queries.listColumnOptions,
|
|
313
|
+
options: {
|
|
314
|
+
variables,
|
|
315
|
+
},
|
|
316
|
+
});
|
|
317
|
+
return data?.boards[0]?.columns;
|
|
318
|
+
},
|
|
310
319
|
async listColumns(variables) {
|
|
311
320
|
const { data } = await this.makeRequest({
|
|
312
321
|
query: queries.listColumns,
|
|
@@ -376,13 +385,13 @@ export default {
|
|
|
376
385
|
|
|
377
386
|
const { boards } = data;
|
|
378
387
|
return boards
|
|
379
|
-
|
|
388
|
+
?.filter(({ type }) => type !== constants.BOARD_TYPE.SUB_ITEMS_BOARD)
|
|
380
389
|
.map(({
|
|
381
390
|
id, name,
|
|
382
391
|
}) => ({
|
|
383
392
|
label: name,
|
|
384
393
|
value: id,
|
|
385
|
-
}));
|
|
394
|
+
})) ?? [];
|
|
386
395
|
},
|
|
387
396
|
async listFolderOptions(variables) {
|
|
388
397
|
const {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/monday",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Pipedream Monday Components",
|
|
5
5
|
"main": "monday.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pipedream/platform": "^3.0
|
|
17
|
+
"@pipedream/platform": "^3.1.0",
|
|
18
18
|
"form-data": "^4.0.0",
|
|
19
19
|
"lodash.flatmap": "^4.5.0",
|
|
20
20
|
"lodash.map": "^4.6.0",
|
|
@@ -3,10 +3,10 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-column-value-updated",
|
|
6
|
-
name: "
|
|
7
|
-
description: "Emit new event when a column value is updated on a board
|
|
6
|
+
name: "Column Value Updated (Instant)",
|
|
7
|
+
description: "Emit new event when a column value is updated on a board. [See the documentation](https://developer.monday.com/api-reference/reference/webhooks#sample-payload-for-webhook-events)",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.8",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
hooks: {
|
|
12
12
|
...common.hooks,
|
|
@@ -14,6 +14,14 @@ export default {
|
|
|
14
14
|
await this.commonDeploy();
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
|
+
props: {
|
|
18
|
+
...common.props,
|
|
19
|
+
alertBox: {
|
|
20
|
+
type: "alert",
|
|
21
|
+
alertType: "warning",
|
|
22
|
+
content: "For changes to `Name`, use the **Name Updated** trigger",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
17
25
|
methods: {
|
|
18
26
|
...common.methods,
|
|
19
27
|
getWebhookArgs() {
|
|
@@ -3,10 +3,10 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-name-updated",
|
|
6
|
-
name: "
|
|
7
|
-
description: "Emit new event when an item's
|
|
6
|
+
name: "Name Updated (Instant)",
|
|
7
|
+
description: "Emit new event when an item's name is updated. [See the documentation](https://developer.monday.com/api-reference/reference/webhooks#sample-payload-for-webhook-events)",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.8",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
hooks: {
|
|
12
12
|
...common.hooks,
|
|
@@ -3,10 +3,10 @@ import common from "../common/common-polling.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-new-board",
|
|
6
|
-
name: "New Board",
|
|
7
|
-
description: "Emit new event when a
|
|
6
|
+
name: "New Board Created",
|
|
7
|
+
description: "Emit new event when a board is created in Monday. [See the documentation](https://developer.monday.com/api-reference/reference/webhooks#sample-payload-for-webhook-events)",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.9",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -14,7 +14,7 @@ export default {
|
|
|
14
14
|
type: "integer",
|
|
15
15
|
min: 1,
|
|
16
16
|
label: "Max API Requests per Execution",
|
|
17
|
-
description: "The maximum number of API requests to make per execution (
|
|
17
|
+
description: "The maximum number of API requests to make per execution (multiple requests are required to retrieve paginated results)",
|
|
18
18
|
optional: true,
|
|
19
19
|
default: 1,
|
|
20
20
|
},
|
|
@@ -3,10 +3,10 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-new-item",
|
|
6
|
-
name: "New Item (Instant)",
|
|
7
|
-
description: "Emit new event when a new item is added to a board
|
|
6
|
+
name: "New Item Created (Instant)",
|
|
7
|
+
description: "Emit new event when a new item is added to a board. [See the documentation](https://developer.monday.com/api-reference/reference/webhooks#sample-payload-for-webhook-events)",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.8",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
hooks: {
|
|
12
12
|
...common.hooks,
|
|
@@ -3,13 +3,18 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-new-subitem",
|
|
6
|
-
name: "New Sub-Item (Instant)",
|
|
7
|
-
description: "Emit new event when a sub-item is created.
|
|
6
|
+
name: "New Sub-Item Created (Instant)",
|
|
7
|
+
description: "Emit new event when a sub-item is created. [See the documentation](https://developer.monday.com/api-reference/reference/webhooks#sample-payload-for-webhook-events)",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.7",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
13
|
+
alertBox: {
|
|
14
|
+
type: "alert",
|
|
15
|
+
alertType: "warning",
|
|
16
|
+
content: "To create this trigger, you need to have at least one subitem previously created on your board",
|
|
17
|
+
},
|
|
13
18
|
boardId: {
|
|
14
19
|
propDefinition: [
|
|
15
20
|
common.props.monday,
|
|
@@ -20,7 +25,7 @@ export default {
|
|
|
20
25
|
methods: {
|
|
21
26
|
...common.methods,
|
|
22
27
|
getWebhookCreationError() {
|
|
23
|
-
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board
|
|
28
|
+
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board";
|
|
24
29
|
},
|
|
25
30
|
getWebhookArgs() {
|
|
26
31
|
return {
|
|
@@ -4,12 +4,17 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-new-subitem-update",
|
|
6
6
|
name: "New Sub-Item Update (Instant)",
|
|
7
|
-
description: "Emit new event when an update is posted in sub-items.
|
|
7
|
+
description: "Emit new event when an update is posted in sub-items. [See the documentation](https://developer.monday.com/api-reference/reference/webhooks#sample-payload-for-webhook-events)",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.7",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
13
|
+
alertBox: {
|
|
14
|
+
type: "alert",
|
|
15
|
+
alertType: "warning",
|
|
16
|
+
content: "To create this trigger, you need to have at least one subitem previously created on your board",
|
|
17
|
+
},
|
|
13
18
|
boardId: {
|
|
14
19
|
propDefinition: [
|
|
15
20
|
common.props.monday,
|
|
@@ -20,7 +25,7 @@ export default {
|
|
|
20
25
|
methods: {
|
|
21
26
|
...common.methods,
|
|
22
27
|
getWebhookCreationError() {
|
|
23
|
-
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board
|
|
28
|
+
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board";
|
|
24
29
|
},
|
|
25
30
|
getWebhookArgs() {
|
|
26
31
|
return {
|
|
@@ -3,10 +3,10 @@ import common from "../common/common-polling.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-new-user",
|
|
6
|
-
name: "New User",
|
|
7
|
-
description: "Emit new event when a new user is created in Monday.",
|
|
6
|
+
name: "New User Created",
|
|
7
|
+
description: "Emit new event when a new user is created in Monday. [See the documentation](https://developer.monday.com/api-reference/reference/webhooks#sample-payload-for-webhook-events)",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.9",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
methods: {
|
|
12
12
|
...common.methods,
|
|
@@ -3,10 +3,10 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-specific-column-updated",
|
|
6
|
-
name: "
|
|
7
|
-
description: "Emit new event when a value in the specified column is updated
|
|
6
|
+
name: "Specific Column Updated (Instant)",
|
|
7
|
+
description: "Emit new event when a value in the specified column is updated. [See the documentation](https://developer.monday.com/api-reference/reference/webhooks#sample-payload-for-webhook-events)",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.8",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
hooks: {
|
|
12
12
|
...common.hooks,
|
|
@@ -16,6 +16,11 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
props: {
|
|
18
18
|
...common.props,
|
|
19
|
+
alertBox: {
|
|
20
|
+
type: "alert",
|
|
21
|
+
alertType: "warning",
|
|
22
|
+
content: "For changes to `Name`, use the **Name Updated** trigger",
|
|
23
|
+
},
|
|
19
24
|
column: {
|
|
20
25
|
propDefinition: [
|
|
21
26
|
common.props.monday,
|
|
@@ -3,13 +3,18 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-subitem-column-value-updated",
|
|
6
|
-
name: "
|
|
7
|
-
description: "Emit new event when any sub-item column changes.
|
|
6
|
+
name: "Sub-Item Column Value Updated (Instant)",
|
|
7
|
+
description: "Emit new event when any sub-item column changes. [See the documentation](https://developer.monday.com/api-reference/reference/webhooks#sample-payload-for-webhook-events)",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.8",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
13
|
+
alertBox: {
|
|
14
|
+
type: "alert",
|
|
15
|
+
alertType: "warning",
|
|
16
|
+
content: "To create this trigger, you need to have at least one subitem previously created on your board",
|
|
17
|
+
},
|
|
13
18
|
boardId: {
|
|
14
19
|
propDefinition: [
|
|
15
20
|
common.props.monday,
|
|
@@ -20,7 +25,7 @@ export default {
|
|
|
20
25
|
methods: {
|
|
21
26
|
...common.methods,
|
|
22
27
|
getWebhookCreationError() {
|
|
23
|
-
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board
|
|
28
|
+
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board";
|
|
24
29
|
},
|
|
25
30
|
getWebhookArgs() {
|
|
26
31
|
return {
|
|
@@ -3,13 +3,18 @@ import common from "../common/common-webhook.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
key: "monday-subitem-name-updated",
|
|
6
|
-
name: "
|
|
7
|
-
description: "Emit new event when a sub-item name changes.
|
|
6
|
+
name: "Sub-Item Name Updated (Instant)",
|
|
7
|
+
description: "Emit new event when a sub-item name changes. [See the documentation](https://developer.monday.com/api-reference/reference/webhooks#sample-payload-for-webhook-events)",
|
|
8
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.7",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
13
|
+
alertBox: {
|
|
14
|
+
type: "alert",
|
|
15
|
+
alertType: "warning",
|
|
16
|
+
content: "To create this trigger, you need to have at least one subitem previously created on your board",
|
|
17
|
+
},
|
|
13
18
|
boardId: {
|
|
14
19
|
propDefinition: [
|
|
15
20
|
common.props.monday,
|
|
@@ -20,7 +25,7 @@ export default {
|
|
|
20
25
|
methods: {
|
|
21
26
|
...common.methods,
|
|
22
27
|
getWebhookCreationError() {
|
|
23
|
-
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board
|
|
28
|
+
return "Failed to establish webhook. To create this trigger, you need to have at least one subitem previously created on your board";
|
|
24
29
|
},
|
|
25
30
|
getWebhookArgs() {
|
|
26
31
|
return {
|