@pipedream/monday 0.3.9 → 0.5.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/column-values.mjs +32 -0
- package/actions/create-board/create-board.mjs +9 -6
- package/actions/create-column/create-column.mjs +2 -2
- package/actions/create-group/create-group.mjs +2 -2
- package/actions/create-item/create-item.mjs +2 -2
- package/actions/create-update/create-update.mjs +2 -2
- package/actions/get-column-values/get-column-values.mjs +56 -0
- package/actions/get-items-by-column-value/get-items-by-column-value.mjs +60 -0
- package/actions/update-column-values/update-column-values.mjs +70 -0
- package/actions/update-item-name/update-item-name.mjs +2 -2
- package/common/mutations.mjs +34 -13
- package/common/queries.mjs +71 -12
- package/monday.app.mjs +111 -21
- package/package.json +1 -1
- package/sources/column-value-updated/column-value-updated.mjs +1 -1
- package/sources/common/common-webhook.mjs +4 -2
- package/sources/name-updated/name-updated.mjs +1 -1
- package/sources/new-board/new-board.mjs +1 -1
- package/sources/new-item/new-item.mjs +1 -1
- package/sources/new-subitem/new-subitem.mjs +1 -1
- package/sources/new-subitem-update/new-subitem-update.mjs +1 -1
- package/sources/new-user/new-user.mjs +1 -1
- package/sources/specific-column-updated/specific-column-updated.mjs +1 -1
- package/sources/subitem-column-value-updated/subitem-column-value-updated.mjs +1 -1
- package/sources/subitem-name-updated/subitem-name-updated.mjs +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import monday from "../../monday.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
props: {
|
|
5
|
+
monday,
|
|
6
|
+
boardId: {
|
|
7
|
+
propDefinition: [
|
|
8
|
+
monday,
|
|
9
|
+
"boardId",
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
methods: {
|
|
14
|
+
async getColumns(boardId) {
|
|
15
|
+
const columns = await this.monday.listColumns({
|
|
16
|
+
boardId: +boardId,
|
|
17
|
+
});
|
|
18
|
+
return columns.filter(({ id }) => id !== "name");
|
|
19
|
+
},
|
|
20
|
+
formatColumnValues(items) {
|
|
21
|
+
for (const item of items) {
|
|
22
|
+
item.column_values = item.column_values.map(({
|
|
23
|
+
id, value, text,
|
|
24
|
+
}) => ({
|
|
25
|
+
id,
|
|
26
|
+
value: text || value,
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
return items;
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -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
|
|
7
|
+
description: "Creates a new board. [See the documentation](https://api.developer.monday.com/docs/boards#create-a-board)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.5",
|
|
10
10
|
props: {
|
|
11
11
|
monday,
|
|
12
12
|
boardName: {
|
|
@@ -21,16 +21,19 @@ export default {
|
|
|
21
21
|
"boardKind",
|
|
22
22
|
],
|
|
23
23
|
},
|
|
24
|
-
|
|
24
|
+
workspaceId: {
|
|
25
25
|
propDefinition: [
|
|
26
26
|
monday,
|
|
27
|
-
"
|
|
27
|
+
"workspaceId",
|
|
28
28
|
],
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
folderId: {
|
|
31
31
|
propDefinition: [
|
|
32
32
|
monday,
|
|
33
|
-
"
|
|
33
|
+
"folderId",
|
|
34
|
+
(c) => ({
|
|
35
|
+
workspaceId: c.workspaceId,
|
|
36
|
+
}),
|
|
34
37
|
],
|
|
35
38
|
},
|
|
36
39
|
templateId: {
|
|
@@ -4,9 +4,9 @@ import monday from "../../monday.app.mjs";
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "monday-create-column",
|
|
6
6
|
name: "Create Column",
|
|
7
|
-
description: "Creates a column. [See the
|
|
7
|
+
description: "Creates a column. [See the documentation](https://developer.monday.com/api-reference/docs/columns-queries-1)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.5",
|
|
10
10
|
props: {
|
|
11
11
|
monday,
|
|
12
12
|
boardId: {
|
|
@@ -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
|
|
6
|
+
description: "Creates a new group in a specific board. [See the documentation](https://api.developer.monday.com/docs/groups-queries#create-a-group)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
props: {
|
|
10
10
|
monday,
|
|
11
11
|
boardId: {
|
|
@@ -4,9 +4,9 @@ import monday from "../../monday.app.mjs";
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "monday-create-item",
|
|
6
6
|
name: "Create Item",
|
|
7
|
-
description: "Creates an item. [See the
|
|
7
|
+
description: "Creates an item. [See the documentation](https://api.developer.monday.com/docs/items-queries#create-an-item)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.8",
|
|
10
10
|
props: {
|
|
11
11
|
monday,
|
|
12
12
|
boardId: {
|
|
@@ -4,9 +4,9 @@ import monday from "../../monday.app.mjs";
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "monday-create-update",
|
|
6
6
|
name: "Create an Update",
|
|
7
|
-
description: "Creates a new update. [See the
|
|
7
|
+
description: "Creates a new update. [See the documentation](https://api.developer.monday.com/docs/updates-queries#create-an-update)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.7",
|
|
10
10
|
props: {
|
|
11
11
|
monday,
|
|
12
12
|
updateBody: {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import common from "../common/column-values.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "monday-get-column-values",
|
|
6
|
+
name: "Get Column Values",
|
|
7
|
+
description: "Return values of a specific column or columns for a board item. [See the documentation](https://developer.monday.com/api-reference/docs/column-values-v2)",
|
|
8
|
+
version: "0.0.2",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
...common.props,
|
|
12
|
+
itemId: {
|
|
13
|
+
propDefinition: [
|
|
14
|
+
common.props.monday,
|
|
15
|
+
"itemId",
|
|
16
|
+
({ boardId }) => ({
|
|
17
|
+
boardId: +boardId,
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
20
|
+
optional: false,
|
|
21
|
+
},
|
|
22
|
+
columnIds: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
common.props.monday,
|
|
25
|
+
"column",
|
|
26
|
+
(c) => ({
|
|
27
|
+
boardId: c.boardId,
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
type: "string[]",
|
|
31
|
+
label: "Columns",
|
|
32
|
+
description: "Return data from the specified column(s)",
|
|
33
|
+
optional: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
async run({ $ }) {
|
|
37
|
+
let columnIds = this.columnIds;
|
|
38
|
+
if (!columnIds?.length) {
|
|
39
|
+
const columns = await this.getColumns(this.boardId);
|
|
40
|
+
columnIds = columns.map(({ id }) => id);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const response = await this.monday.getColumnValues({
|
|
44
|
+
itemId: +this.itemId,
|
|
45
|
+
columnIds: columnIds,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (response.errors) {
|
|
49
|
+
throw new Error(response.errors[0].message);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
$.export("$summary", `Successfully retrieved column values for item with ID ${this.itemId}.`);
|
|
53
|
+
|
|
54
|
+
return this.formatColumnValues(response.data.items);
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import common from "../common/column-values.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "monday-get-items-by-column-value",
|
|
6
|
+
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/docs/items-page-by-column-values)",
|
|
8
|
+
version: "0.0.2",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
...common.props,
|
|
12
|
+
columnId: {
|
|
13
|
+
propDefinition: [
|
|
14
|
+
common.props.monday,
|
|
15
|
+
"column",
|
|
16
|
+
(c) => ({
|
|
17
|
+
boardId: c.boardId,
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
20
|
+
description: "The column to search",
|
|
21
|
+
},
|
|
22
|
+
value: {
|
|
23
|
+
type: "string",
|
|
24
|
+
label: "Value",
|
|
25
|
+
description: "The value to serach for. [See documentation](https://developer.monday.com/api-reference/docs/items-by-column-values#supported-limited-support-and-unsupported-columns) for additional information about column values.",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
async run({ $ }) {
|
|
29
|
+
const response = await this.monday.getItemsByColumnValue({
|
|
30
|
+
boardId: +this.boardId,
|
|
31
|
+
columnId: this.columnId,
|
|
32
|
+
columnValue: this.value,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (response.errors) {
|
|
36
|
+
throw new Error(response.errors[0].message);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const { data: { items_page_by_column_values: pageItems } } = response;
|
|
40
|
+
const { items } = pageItems;
|
|
41
|
+
let cursor = pageItems?.cursor;
|
|
42
|
+
while (cursor) {
|
|
43
|
+
const {
|
|
44
|
+
data: {
|
|
45
|
+
cursor: nextCursor, items_page_by_column_values: { items: nextItems },
|
|
46
|
+
},
|
|
47
|
+
} = await this.monday.getItemsByColumnValue({
|
|
48
|
+
cursor,
|
|
49
|
+
});
|
|
50
|
+
items.push(...nextItems);
|
|
51
|
+
cursor = nextCursor;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
$.export("$summary", `Successfully retrieved ${items.length} item${items.length === 1
|
|
55
|
+
? ""
|
|
56
|
+
: "s"}.`);
|
|
57
|
+
|
|
58
|
+
return this.formatColumnValues(items);
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import common from "../common/column-values.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "monday-update-column-values",
|
|
6
|
+
name: "Update Column Values",
|
|
7
|
+
description: "Update multiple column values of an item. [See the documentation](https://developer.monday.com/api-reference/docs/columns#change-multiple-column-values)",
|
|
8
|
+
version: "0.0.2",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
...common.props,
|
|
12
|
+
boardId: {
|
|
13
|
+
...common.props.boardId,
|
|
14
|
+
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.",
|
|
15
|
+
reloadProps: true,
|
|
16
|
+
},
|
|
17
|
+
itemId: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
common.props.monday,
|
|
20
|
+
"itemId",
|
|
21
|
+
({ boardId }) => ({
|
|
22
|
+
boardId: +boardId,
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
optional: false,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
async additionalProps() {
|
|
29
|
+
const props = {};
|
|
30
|
+
if (this.boardId) {
|
|
31
|
+
const columns = await this.getColumns(this.boardId);
|
|
32
|
+
for (const column of columns) {
|
|
33
|
+
props[column.id] = {
|
|
34
|
+
type: "string",
|
|
35
|
+
label: column.title,
|
|
36
|
+
description: `The value for column ${column.title}`,
|
|
37
|
+
optional: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return props;
|
|
42
|
+
},
|
|
43
|
+
async run({ $ }) {
|
|
44
|
+
const columns = await this.getColumns(this.boardId);
|
|
45
|
+
const columnValues = {};
|
|
46
|
+
for (const column of columns) {
|
|
47
|
+
if (this[column.id]) {
|
|
48
|
+
columnValues[column.id] = this[column.id];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const response = await this.monday.updateColumnValues({
|
|
53
|
+
boardId: +this.boardId,
|
|
54
|
+
itemId: +this.itemId,
|
|
55
|
+
columnValues: JSON.stringify(columnValues),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
if (response.error_message) {
|
|
59
|
+
throw new Error(`${response.error_message} ${JSON.stringify(response.error_data)}`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const { data: { change_multiple_column_values: item } } = response;
|
|
63
|
+
|
|
64
|
+
$.export("$summary", `Successfully updated item with ID ${item.id}.`);
|
|
65
|
+
|
|
66
|
+
return this.formatColumnValues([
|
|
67
|
+
item,
|
|
68
|
+
]);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -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
|
|
6
|
+
description: "Update an item's name. [See the documentation](https://api.developer.monday.com/docs/item-name)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
props: {
|
|
10
10
|
monday,
|
|
11
11
|
boardId: {
|
package/common/mutations.mjs
CHANGED
|
@@ -3,9 +3,9 @@ export default {
|
|
|
3
3
|
mutation createBoard (
|
|
4
4
|
$boardName: String!
|
|
5
5
|
$boardKind: BoardKind!
|
|
6
|
-
$folderId:
|
|
7
|
-
$workspaceId:
|
|
8
|
-
$templateId:
|
|
6
|
+
$folderId: ID
|
|
7
|
+
$workspaceId: ID
|
|
8
|
+
$templateId: ID
|
|
9
9
|
) {
|
|
10
10
|
create_board (
|
|
11
11
|
board_name: $boardName
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
`,
|
|
21
21
|
createGroup: `
|
|
22
22
|
mutation createGroup (
|
|
23
|
-
$boardId:
|
|
23
|
+
$boardId: ID!
|
|
24
24
|
$groupName: String!
|
|
25
25
|
) {
|
|
26
26
|
create_group (
|
|
@@ -33,8 +33,8 @@ export default {
|
|
|
33
33
|
`,
|
|
34
34
|
createItem: `
|
|
35
35
|
mutation createItem (
|
|
36
|
-
$itemName: String
|
|
37
|
-
$boardId:
|
|
36
|
+
$itemName: String!
|
|
37
|
+
$boardId: ID!
|
|
38
38
|
$groupId: String
|
|
39
39
|
$columnValues: JSON
|
|
40
40
|
$createLabels: Boolean
|
|
@@ -53,8 +53,8 @@ export default {
|
|
|
53
53
|
createUpdate: `
|
|
54
54
|
mutation createUpdate (
|
|
55
55
|
$updateBody: String!
|
|
56
|
-
$itemId:
|
|
57
|
-
$parentId:
|
|
56
|
+
$itemId: ID
|
|
57
|
+
$parentId: ID
|
|
58
58
|
) {
|
|
59
59
|
create_update (
|
|
60
60
|
body: $updateBody
|
|
@@ -67,8 +67,8 @@ export default {
|
|
|
67
67
|
`,
|
|
68
68
|
updateItemName: `
|
|
69
69
|
mutation updateItemName (
|
|
70
|
-
$boardId:
|
|
71
|
-
$itemId:
|
|
70
|
+
$boardId: ID!
|
|
71
|
+
$itemId: ID!
|
|
72
72
|
$columnValues: JSON!
|
|
73
73
|
) {
|
|
74
74
|
change_multiple_column_values (
|
|
@@ -82,7 +82,7 @@ export default {
|
|
|
82
82
|
`,
|
|
83
83
|
createWebhook: `
|
|
84
84
|
mutation createWebhook (
|
|
85
|
-
$boardId:
|
|
85
|
+
$boardId: ID!
|
|
86
86
|
$url: String!
|
|
87
87
|
$event: WebhookEventType!
|
|
88
88
|
$config: JSON
|
|
@@ -100,7 +100,7 @@ export default {
|
|
|
100
100
|
`,
|
|
101
101
|
deleteWebhook: `
|
|
102
102
|
mutation deleteWebhook (
|
|
103
|
-
$id:
|
|
103
|
+
$id: ID!
|
|
104
104
|
) {
|
|
105
105
|
delete_webhook(
|
|
106
106
|
id: $id
|
|
@@ -112,7 +112,7 @@ export default {
|
|
|
112
112
|
`,
|
|
113
113
|
createColumn: `
|
|
114
114
|
mutation createColumn (
|
|
115
|
-
$boardId:
|
|
115
|
+
$boardId: ID!
|
|
116
116
|
$title: String!
|
|
117
117
|
$columnType: ColumnType!
|
|
118
118
|
$defaults: JSON
|
|
@@ -129,4 +129,25 @@ export default {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
`,
|
|
132
|
+
updateColumnValues: `
|
|
133
|
+
mutation updateItem (
|
|
134
|
+
$boardId: ID!
|
|
135
|
+
$itemId: ID!
|
|
136
|
+
$columnValues: JSON!
|
|
137
|
+
) {
|
|
138
|
+
change_multiple_column_values (
|
|
139
|
+
board_id: $boardId
|
|
140
|
+
item_id: $itemId
|
|
141
|
+
column_values: $columnValues
|
|
142
|
+
) {
|
|
143
|
+
id
|
|
144
|
+
name
|
|
145
|
+
column_values {
|
|
146
|
+
id
|
|
147
|
+
value
|
|
148
|
+
text
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
`,
|
|
132
153
|
};
|
package/common/queries.mjs
CHANGED
|
@@ -14,6 +14,22 @@ export default {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
`,
|
|
17
|
+
listWorkspaces: `
|
|
18
|
+
query {
|
|
19
|
+
workspaces {
|
|
20
|
+
id
|
|
21
|
+
name
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`,
|
|
25
|
+
listFolders: `
|
|
26
|
+
query ($workspaceId: [ID]) {
|
|
27
|
+
folders (workspace_ids: $workspaceId) {
|
|
28
|
+
id
|
|
29
|
+
name
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`,
|
|
17
33
|
listWorkspacesBoards: `
|
|
18
34
|
query {
|
|
19
35
|
boards (
|
|
@@ -29,7 +45,7 @@ export default {
|
|
|
29
45
|
}
|
|
30
46
|
`,
|
|
31
47
|
listGroupsBoards: `
|
|
32
|
-
query listGroups ($boardId:
|
|
48
|
+
query listGroups ($boardId: ID!) {
|
|
33
49
|
boards (ids: [$boardId]) {
|
|
34
50
|
groups {
|
|
35
51
|
id
|
|
@@ -39,11 +55,23 @@ export default {
|
|
|
39
55
|
}
|
|
40
56
|
`,
|
|
41
57
|
listItemsBoard: `
|
|
42
|
-
query listItems ($boardId:
|
|
58
|
+
query listItems ($boardId: ID!) {
|
|
43
59
|
boards (ids: [$boardId]) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
60
|
+
items_page (query_params: {order_by:[{ column_id: "__creation_log__", direction: desc }]}) {
|
|
61
|
+
cursor
|
|
62
|
+
items {
|
|
63
|
+
id
|
|
64
|
+
name
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`,
|
|
70
|
+
listItemsNextPage: `
|
|
71
|
+
query listItems ($cursor: String!) {
|
|
72
|
+
next_items_page (cursor: $cursor) {
|
|
73
|
+
cursor
|
|
74
|
+
items {
|
|
47
75
|
id
|
|
48
76
|
name
|
|
49
77
|
}
|
|
@@ -52,7 +80,7 @@ export default {
|
|
|
52
80
|
`,
|
|
53
81
|
listUpdatesBoard: `
|
|
54
82
|
query listUpdates (
|
|
55
|
-
$boardId:
|
|
83
|
+
$boardId: ID!,
|
|
56
84
|
$page: Int = 1
|
|
57
85
|
) {
|
|
58
86
|
boards (ids: [$boardId]) {
|
|
@@ -66,7 +94,7 @@ export default {
|
|
|
66
94
|
}
|
|
67
95
|
`,
|
|
68
96
|
listColumns: `
|
|
69
|
-
query listColumns ($boardId:
|
|
97
|
+
query listColumns ($boardId: ID!) {
|
|
70
98
|
boards (ids: [$boardId]) {
|
|
71
99
|
columns {
|
|
72
100
|
id
|
|
@@ -87,7 +115,7 @@ export default {
|
|
|
87
115
|
}
|
|
88
116
|
`,
|
|
89
117
|
getItem: `
|
|
90
|
-
query getItem ($id:
|
|
118
|
+
query getItem ($id: ID!) {
|
|
91
119
|
items (ids: [$id]) {
|
|
92
120
|
id
|
|
93
121
|
name
|
|
@@ -112,7 +140,7 @@ export default {
|
|
|
112
140
|
}
|
|
113
141
|
`,
|
|
114
142
|
getBoard: `
|
|
115
|
-
query getBoard($id:
|
|
143
|
+
query getBoard($id: ID!) {
|
|
116
144
|
boards (ids: [$id]) {
|
|
117
145
|
id
|
|
118
146
|
name
|
|
@@ -124,8 +152,10 @@ export default {
|
|
|
124
152
|
groups {
|
|
125
153
|
id
|
|
126
154
|
}
|
|
127
|
-
|
|
128
|
-
|
|
155
|
+
items_page {
|
|
156
|
+
items {
|
|
157
|
+
id
|
|
158
|
+
}
|
|
129
159
|
}
|
|
130
160
|
owner {
|
|
131
161
|
id
|
|
@@ -141,7 +171,7 @@ export default {
|
|
|
141
171
|
}
|
|
142
172
|
`,
|
|
143
173
|
getUser: `
|
|
144
|
-
query getUser($id:
|
|
174
|
+
query getUser($id: ID!) {
|
|
145
175
|
users (ids: [$id]) {
|
|
146
176
|
id
|
|
147
177
|
name
|
|
@@ -177,4 +207,33 @@ export default {
|
|
|
177
207
|
}
|
|
178
208
|
}
|
|
179
209
|
`,
|
|
210
|
+
getColumnValues: `
|
|
211
|
+
query getItem ($itemId: ID!, $columnIds: [String!]) {
|
|
212
|
+
items (ids: [$itemId]){
|
|
213
|
+
id
|
|
214
|
+
name
|
|
215
|
+
column_values (ids: $columnIds){
|
|
216
|
+
id
|
|
217
|
+
value
|
|
218
|
+
text
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
`,
|
|
223
|
+
getItemsByColumnValue: `
|
|
224
|
+
query ($boardId: ID!, $columnId: String!, $columnValue: String!){
|
|
225
|
+
items_page_by_column_values (board_id: $boardId, columns: [{column_id: $columnId, column_values: [$columnValue]}]) {
|
|
226
|
+
cursor
|
|
227
|
+
items {
|
|
228
|
+
id
|
|
229
|
+
name
|
|
230
|
+
column_values {
|
|
231
|
+
id
|
|
232
|
+
value
|
|
233
|
+
text
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
`,
|
|
180
239
|
};
|
package/monday.app.mjs
CHANGED
|
@@ -36,6 +36,11 @@ export default {
|
|
|
36
36
|
label: "Folder ID",
|
|
37
37
|
description: "Board folder ID",
|
|
38
38
|
optional: true,
|
|
39
|
+
async options({ workspaceId }) {
|
|
40
|
+
return this.listFolderOptions({
|
|
41
|
+
workspaceId,
|
|
42
|
+
});
|
|
43
|
+
},
|
|
39
44
|
},
|
|
40
45
|
workspaceId: {
|
|
41
46
|
type: "integer",
|
|
@@ -95,9 +100,12 @@ export default {
|
|
|
95
100
|
label: "Item ID",
|
|
96
101
|
description: "The item's unique identifier",
|
|
97
102
|
optional: true,
|
|
98
|
-
async options({
|
|
103
|
+
async options({
|
|
104
|
+
boardId, prevContext,
|
|
105
|
+
}) {
|
|
99
106
|
return this.listItemsOptions({
|
|
100
107
|
boardId,
|
|
108
|
+
cursor: prevContext.cursor,
|
|
101
109
|
});
|
|
102
110
|
},
|
|
103
111
|
},
|
|
@@ -239,17 +247,40 @@ export default {
|
|
|
239
247
|
},
|
|
240
248
|
});
|
|
241
249
|
},
|
|
242
|
-
async listItemsBoard(
|
|
250
|
+
async listItemsBoard({
|
|
251
|
+
cursor, ...variables
|
|
252
|
+
}) {
|
|
253
|
+
const query = cursor
|
|
254
|
+
? queries.listItemsNextPage
|
|
255
|
+
: queries.listItemsBoard;
|
|
256
|
+
const options = cursor
|
|
257
|
+
? {
|
|
258
|
+
variables: cursor,
|
|
259
|
+
}
|
|
260
|
+
: {
|
|
261
|
+
variables,
|
|
262
|
+
};
|
|
263
|
+
return this.makeRequest({
|
|
264
|
+
query,
|
|
265
|
+
options,
|
|
266
|
+
});
|
|
267
|
+
},
|
|
268
|
+
async listUpdatesBoard(variables) {
|
|
243
269
|
return this.makeRequest({
|
|
244
|
-
query: queries.
|
|
270
|
+
query: queries.listUpdatesBoard,
|
|
245
271
|
options: {
|
|
246
272
|
variables,
|
|
247
273
|
},
|
|
248
274
|
});
|
|
249
275
|
},
|
|
250
|
-
async
|
|
276
|
+
async listWorkspaces() {
|
|
251
277
|
return this.makeRequest({
|
|
252
|
-
query: queries.
|
|
278
|
+
query: queries.listWorkspaces,
|
|
279
|
+
});
|
|
280
|
+
},
|
|
281
|
+
async listFolders(variables) {
|
|
282
|
+
return this.makeRequest({
|
|
283
|
+
query: queries.listFolders,
|
|
253
284
|
options: {
|
|
254
285
|
variables,
|
|
255
286
|
},
|
|
@@ -286,6 +317,40 @@ export default {
|
|
|
286
317
|
});
|
|
287
318
|
return data?.users;
|
|
288
319
|
},
|
|
320
|
+
async getColumnValues(variables) {
|
|
321
|
+
return this.makeRequest({
|
|
322
|
+
query: queries.getColumnValues,
|
|
323
|
+
options: {
|
|
324
|
+
variables,
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
},
|
|
328
|
+
async getItemsByColumnValue({
|
|
329
|
+
cursor, ...variables
|
|
330
|
+
}) {
|
|
331
|
+
const query = cursor
|
|
332
|
+
? queries.listItemsNextPage
|
|
333
|
+
: queries.getItemsByColumnValue;
|
|
334
|
+
const options = cursor
|
|
335
|
+
? {
|
|
336
|
+
variables: cursor,
|
|
337
|
+
}
|
|
338
|
+
: {
|
|
339
|
+
variables,
|
|
340
|
+
};
|
|
341
|
+
return this.makeRequest({
|
|
342
|
+
query,
|
|
343
|
+
options,
|
|
344
|
+
});
|
|
345
|
+
},
|
|
346
|
+
async updateColumnValues(variables) {
|
|
347
|
+
return this.makeRequest({
|
|
348
|
+
query: mutations.updateColumnValues,
|
|
349
|
+
options: {
|
|
350
|
+
variables,
|
|
351
|
+
},
|
|
352
|
+
});
|
|
353
|
+
},
|
|
289
354
|
async listBoardsOptions(variables) {
|
|
290
355
|
const {
|
|
291
356
|
data,
|
|
@@ -311,12 +376,34 @@ export default {
|
|
|
311
376
|
value: id,
|
|
312
377
|
}));
|
|
313
378
|
},
|
|
379
|
+
async listFolderOptions(variables) {
|
|
380
|
+
const {
|
|
381
|
+
data, errors, error_message: errorMessage,
|
|
382
|
+
} = await this.listFolders(variables);
|
|
383
|
+
|
|
384
|
+
if (errors) {
|
|
385
|
+
throw new Error(`Error listing folders: ${errors[0].message}`);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
if (errorMessage) {
|
|
389
|
+
throw new Error(`Failed to list folders: ${errorMessage}`);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
const { folders } = data;
|
|
393
|
+
return folders
|
|
394
|
+
.map(({
|
|
395
|
+
id, name,
|
|
396
|
+
}) => ({
|
|
397
|
+
label: name,
|
|
398
|
+
value: +id,
|
|
399
|
+
}));
|
|
400
|
+
},
|
|
314
401
|
async listWorkspacesOptions() {
|
|
315
402
|
const {
|
|
316
403
|
data,
|
|
317
404
|
errors,
|
|
318
405
|
error_message: errorMessage,
|
|
319
|
-
} = await this.
|
|
406
|
+
} = await this.listWorkspaces();
|
|
320
407
|
|
|
321
408
|
if (errors) {
|
|
322
409
|
throw new Error(`Error listing workspaces: ${errors[0].message}`);
|
|
@@ -326,13 +413,12 @@ export default {
|
|
|
326
413
|
throw new Error(`Failed to list workspaces: ${errorMessage}`);
|
|
327
414
|
}
|
|
328
415
|
|
|
329
|
-
const {
|
|
416
|
+
const { workspaces } = data;
|
|
330
417
|
const options =
|
|
331
|
-
|
|
332
|
-
.
|
|
333
|
-
.map(({ workspace }) => ({
|
|
418
|
+
workspaces
|
|
419
|
+
.map((workspace) => ({
|
|
334
420
|
label: workspace.name,
|
|
335
|
-
value: workspace.id,
|
|
421
|
+
value: +workspace.id,
|
|
336
422
|
}));
|
|
337
423
|
return uniqBy(options, "value");
|
|
338
424
|
},
|
|
@@ -379,16 +465,20 @@ export default {
|
|
|
379
465
|
}
|
|
380
466
|
|
|
381
467
|
const { boards } = data;
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
468
|
+
const items = boards[0].items_page.items;
|
|
469
|
+
const cursor = boards[0].items_page.cursor;
|
|
470
|
+
const options = items.map(({
|
|
471
|
+
id, name,
|
|
472
|
+
}) => ({
|
|
473
|
+
value: id,
|
|
474
|
+
label: name,
|
|
475
|
+
}));
|
|
476
|
+
return {
|
|
477
|
+
options,
|
|
478
|
+
context: {
|
|
479
|
+
cursor,
|
|
480
|
+
},
|
|
481
|
+
};
|
|
392
482
|
},
|
|
393
483
|
async listUpdatesOptions(variables) {
|
|
394
484
|
const {
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
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.5",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
hooks: {
|
|
12
12
|
...common.hooks,
|
|
@@ -65,7 +65,7 @@ export default {
|
|
|
65
65
|
};
|
|
66
66
|
},
|
|
67
67
|
async commonDeploy() {
|
|
68
|
-
const { items } = (await this.monday.listItemsBoard({
|
|
68
|
+
const { items_page: { items } } = (await this.monday.listItemsBoard({
|
|
69
69
|
boardId: +this.boardId,
|
|
70
70
|
})).data.boards[0];
|
|
71
71
|
for (const item of items.slice(-25).reverse()) {
|
|
@@ -76,7 +76,9 @@ export default {
|
|
|
76
76
|
const meta = this.generateMeta({
|
|
77
77
|
item,
|
|
78
78
|
});
|
|
79
|
-
this.$emit(
|
|
79
|
+
this.$emit({
|
|
80
|
+
item: itemData,
|
|
81
|
+
}, meta);
|
|
80
82
|
}
|
|
81
83
|
},
|
|
82
84
|
},
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
name: "New Sub-Item (Instant)",
|
|
7
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
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.4",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
name: "New Sub-Item Update (Instant)",
|
|
7
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
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.4",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
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.5",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
hooks: {
|
|
12
12
|
...common.hooks,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
name: "New Sub-Item Column Value Updated (Instant)",
|
|
7
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
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.4",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
name: "New Sub-Item Name Updated (Instant)",
|
|
7
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
8
|
type: "source",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.4",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|