@pipedream/todoist 0.0.1
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/LICENSE +7 -0
- package/actions/create-filter/create-filter.mjs +66 -0
- package/actions/create-label/create-label.mjs +56 -0
- package/actions/create-project/create-project.mjs +57 -0
- package/actions/create-project-comment/create-project-comment.mjs +42 -0
- package/actions/create-section/create-section.mjs +49 -0
- package/actions/create-task/create-task.mjs +150 -0
- package/actions/create-task-comment/create-task-comment.mjs +51 -0
- package/actions/delete-comment/delete-comment.mjs +56 -0
- package/actions/delete-filter/delete-filter.mjs +30 -0
- package/actions/delete-label/delete-label.mjs +34 -0
- package/actions/delete-project/delete-project.mjs +34 -0
- package/actions/delete-section/delete-section.mjs +43 -0
- package/actions/delete-task/delete-task.mjs +44 -0
- package/actions/export-tasks/export-tasks.mjs +40 -0
- package/actions/find-project/find-project.mjs +51 -0
- package/actions/find-task/find-task.mjs +62 -0
- package/actions/find-user/find-user.mjs +28 -0
- package/actions/get-label/get-label.mjs +26 -0
- package/actions/get-project/get-project.mjs +26 -0
- package/actions/get-project-comment/get-project-comment.mjs +38 -0
- package/actions/get-section/get-section.mjs +38 -0
- package/actions/get-task/get-task.mjs +37 -0
- package/actions/get-task-comment/get-task-comment.mjs +47 -0
- package/actions/import-tasks/import-tasks.mjs +104 -0
- package/actions/invite-user-to-project/invite-user-to-project.mjs +40 -0
- package/actions/list-filters/list-filters.mjs +23 -0
- package/actions/list-labels/list-labels.mjs +21 -0
- package/actions/list-project-comments/list-project-comments.mjs +32 -0
- package/actions/list-projects/list-projects.mjs +22 -0
- package/actions/list-sections/list-sections.mjs +31 -0
- package/actions/list-task-comments/list-task-comments.mjs +40 -0
- package/actions/list-uncompleted-tasks/list-uncompleted-tasks.mjs +53 -0
- package/actions/mark-task-completed/mark-task-completed.mjs +43 -0
- package/actions/move-task-to-section/move-task-to-section.mjs +58 -0
- package/actions/uncomplete-task/uncomplete-task.mjs +42 -0
- package/actions/update-comment/update-comment.mjs +67 -0
- package/actions/update-filter/update-filter.mjs +76 -0
- package/actions/update-label/update-label.mjs +70 -0
- package/actions/update-project/update-project.mjs +62 -0
- package/actions/update-section/update-section.mjs +54 -0
- package/actions/update-task/update-task.mjs +126 -0
- package/colors.mjs +82 -0
- package/package.json +23 -0
- package/resource-types.mjs +15 -0
- package/sources/common-project.mjs +18 -0
- package/sources/common-task.mjs +38 -0
- package/sources/common.mjs +56 -0
- package/sources/completed-task/completed-task.mjs +17 -0
- package/sources/incomplete-task/incomplete-task.mjs +17 -0
- package/sources/new-or-modified-project/new-or-modified-project.mjs +10 -0
- package/sources/new-or-modified-task/new-or-modified-task.mjs +10 -0
- package/sources/new-project/new-project.mjs +11 -0
- package/sources/new-section/new-section.mjs +24 -0
- package/sources/new-task/new-task.mjs +11 -0
- package/sources/sync-resources/sync-resources.mjs +64 -0
- package/todoist.app.mjs +1105 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-list-sections",
|
|
5
|
+
name: "List Sections",
|
|
6
|
+
description: "Returns a list of all sections. [See the docs here](https://developer.todoist.com/rest/v1/#get-all-sections)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
project: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"project",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
async run ({ $ }) {
|
|
19
|
+
const params = {
|
|
20
|
+
project_id: this.project,
|
|
21
|
+
};
|
|
22
|
+
const resp = await this.todoist.getSections({
|
|
23
|
+
$,
|
|
24
|
+
params,
|
|
25
|
+
});
|
|
26
|
+
$.export("$summary", `Successfully retrieved ${resp.length} section${resp.length === 1
|
|
27
|
+
? ""
|
|
28
|
+
: "s"}`);
|
|
29
|
+
return resp;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-list-task-comments",
|
|
5
|
+
name: "List Task Comments",
|
|
6
|
+
description: "Returns a list of comments for a task. [See the docs here](https://developer.todoist.com/rest/v1/#get-all-comments)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
project: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"project",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
task: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
todoist,
|
|
20
|
+
"task",
|
|
21
|
+
(c) => ({
|
|
22
|
+
project: c.project,
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
async run ({ $ }) {
|
|
28
|
+
const params = {
|
|
29
|
+
task_id: this.task,
|
|
30
|
+
};
|
|
31
|
+
const resp = await this.todoist.getComments({
|
|
32
|
+
$,
|
|
33
|
+
params,
|
|
34
|
+
});
|
|
35
|
+
$.export("$summary", `Successfully retrieved ${resp.length} comment${resp.length === 1
|
|
36
|
+
? ""
|
|
37
|
+
: "s"}`);
|
|
38
|
+
return resp;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-list-uncompleted-tasks",
|
|
5
|
+
name: "List Uncompleted Tasks",
|
|
6
|
+
description: "Returns a list of uncompleted tasks by project, section, and/or label. [See the docs here](https://developer.todoist.com/rest/v1/#get-active-tasks)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
project: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"project",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
section: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
todoist,
|
|
20
|
+
"section",
|
|
21
|
+
(c) => ({
|
|
22
|
+
project: c.project,
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
label: {
|
|
27
|
+
propDefinition: [
|
|
28
|
+
todoist,
|
|
29
|
+
"label",
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
async run ({ $ }) {
|
|
34
|
+
const {
|
|
35
|
+
project,
|
|
36
|
+
section,
|
|
37
|
+
label,
|
|
38
|
+
} = this;
|
|
39
|
+
const params = {
|
|
40
|
+
project_id: project,
|
|
41
|
+
section_id: section,
|
|
42
|
+
label_id: label,
|
|
43
|
+
};
|
|
44
|
+
const resp = await this.todoist.getActiveTasks({
|
|
45
|
+
$,
|
|
46
|
+
params,
|
|
47
|
+
});
|
|
48
|
+
$.export("$summary", `Successfully retrieved ${resp.length} task${resp.length === 1
|
|
49
|
+
? ""
|
|
50
|
+
: "s"}`);
|
|
51
|
+
return resp;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-mark-task-completed",
|
|
5
|
+
name: "Mark Task as Completed",
|
|
6
|
+
description: "Marks a task as being completed. [See the docs here](https://developer.todoist.com/rest/v1/#close-a-task)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
project: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"project",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
taskId: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
todoist,
|
|
20
|
+
"task",
|
|
21
|
+
(c) => ({
|
|
22
|
+
project: c.project,
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
description: "The task to mark as complete",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
async run ({ $ }) {
|
|
29
|
+
const { taskId } = this;
|
|
30
|
+
// No interesting data is returned from Todoist
|
|
31
|
+
await this.todoist.closeTask({
|
|
32
|
+
$,
|
|
33
|
+
params: {
|
|
34
|
+
taskId,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
$.export("$summary", "Successfully closed task");
|
|
38
|
+
return {
|
|
39
|
+
id: taskId,
|
|
40
|
+
success: true,
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-move-task-to-section",
|
|
5
|
+
name: "Move Task To Section",
|
|
6
|
+
description: "Move a Task to a different section within the same project. [See the docs here](https://developer.todoist.com/sync/v8/#move-an-item)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
project: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"project",
|
|
15
|
+
],
|
|
16
|
+
description: "Project containing the task to move",
|
|
17
|
+
},
|
|
18
|
+
task: {
|
|
19
|
+
propDefinition: [
|
|
20
|
+
todoist,
|
|
21
|
+
"task",
|
|
22
|
+
(c) => ({
|
|
23
|
+
project: c.project,
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
description: "Select a task to move",
|
|
27
|
+
},
|
|
28
|
+
section: {
|
|
29
|
+
propDefinition: [
|
|
30
|
+
todoist,
|
|
31
|
+
"section",
|
|
32
|
+
(c) => ({
|
|
33
|
+
project: c.project,
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
description: "The section to move the task to",
|
|
37
|
+
optional: false,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
async run ({ $ }) {
|
|
41
|
+
const {
|
|
42
|
+
task,
|
|
43
|
+
section,
|
|
44
|
+
} = this;
|
|
45
|
+
|
|
46
|
+
const data = {
|
|
47
|
+
id: task,
|
|
48
|
+
section_id: section,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const resp = await this.todoist.moveTask({
|
|
52
|
+
$,
|
|
53
|
+
data,
|
|
54
|
+
});
|
|
55
|
+
$.export("$summary", "Successfully moved task");
|
|
56
|
+
return resp;
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-uncomplete-task",
|
|
5
|
+
name: "Uncomplete Task",
|
|
6
|
+
description: "Uncompletes a task. [See the docs here](https://developer.todoist.com/rest/v1/#reopen-a-task)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
project: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"project",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
taskId: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
todoist,
|
|
20
|
+
"completedTask",
|
|
21
|
+
(c) => ({
|
|
22
|
+
project: c.project,
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
async run ({ $ }) {
|
|
28
|
+
const { taskId } = this;
|
|
29
|
+
// No interesting data is returned from Todoist
|
|
30
|
+
await this.todoist.reopenTask({
|
|
31
|
+
$,
|
|
32
|
+
params: {
|
|
33
|
+
taskId,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
$.export("$summary", "Successfully reopened task");
|
|
37
|
+
return {
|
|
38
|
+
id: taskId,
|
|
39
|
+
success: true,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-update-comment",
|
|
5
|
+
name: "Update Comment",
|
|
6
|
+
description: "Updates a comment. [See the docs here](https://developer.todoist.com/rest/v1/#update-a-comment)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
project: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"project",
|
|
15
|
+
],
|
|
16
|
+
description: "Project containing the comment to update",
|
|
17
|
+
},
|
|
18
|
+
task: {
|
|
19
|
+
propDefinition: [
|
|
20
|
+
todoist,
|
|
21
|
+
"task",
|
|
22
|
+
(c) => ({
|
|
23
|
+
project: c.project,
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
description: "Task containing the comment to update",
|
|
27
|
+
optional: true,
|
|
28
|
+
},
|
|
29
|
+
commentId: {
|
|
30
|
+
propDefinition: [
|
|
31
|
+
todoist,
|
|
32
|
+
"commentId",
|
|
33
|
+
(c) => ({
|
|
34
|
+
project: c.project,
|
|
35
|
+
task: c.task,
|
|
36
|
+
}),
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
content: {
|
|
40
|
+
propDefinition: [
|
|
41
|
+
todoist,
|
|
42
|
+
"content",
|
|
43
|
+
],
|
|
44
|
+
optional: false,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
async run ({ $ }) {
|
|
48
|
+
const {
|
|
49
|
+
commentId,
|
|
50
|
+
content,
|
|
51
|
+
} = this;
|
|
52
|
+
const data = {
|
|
53
|
+
commentId,
|
|
54
|
+
content,
|
|
55
|
+
};
|
|
56
|
+
// No interesting data is returned from Todoist
|
|
57
|
+
await this.todoist.updateComment({
|
|
58
|
+
$,
|
|
59
|
+
data,
|
|
60
|
+
});
|
|
61
|
+
$.export("$summary", "Successfully updated comment");
|
|
62
|
+
return {
|
|
63
|
+
id: commentId,
|
|
64
|
+
success: true,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-update-filter",
|
|
5
|
+
name: "Update Filter",
|
|
6
|
+
description: "Updates a filter. [See the docs here](https://developer.todoist.com/sync/v8/#update-a-filter)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
filter: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"filter",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
name: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
todoist,
|
|
20
|
+
"name",
|
|
21
|
+
],
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
query: {
|
|
25
|
+
propDefinition: [
|
|
26
|
+
todoist,
|
|
27
|
+
"query",
|
|
28
|
+
],
|
|
29
|
+
optional: true,
|
|
30
|
+
},
|
|
31
|
+
color: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
todoist,
|
|
34
|
+
"color",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
order: {
|
|
38
|
+
propDefinition: [
|
|
39
|
+
todoist,
|
|
40
|
+
"order",
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
favorite: {
|
|
44
|
+
propDefinition: [
|
|
45
|
+
todoist,
|
|
46
|
+
"favorite",
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
async run ({ $ }) {
|
|
51
|
+
const {
|
|
52
|
+
filter,
|
|
53
|
+
name,
|
|
54
|
+
query,
|
|
55
|
+
color,
|
|
56
|
+
order,
|
|
57
|
+
favorite,
|
|
58
|
+
} = this;
|
|
59
|
+
const data = {
|
|
60
|
+
id: filter,
|
|
61
|
+
name,
|
|
62
|
+
query,
|
|
63
|
+
color,
|
|
64
|
+
item_order: order,
|
|
65
|
+
is_favorite: favorite
|
|
66
|
+
? 1
|
|
67
|
+
: 0,
|
|
68
|
+
};
|
|
69
|
+
const resp = await this.todoist.updateFilter({
|
|
70
|
+
$,
|
|
71
|
+
data,
|
|
72
|
+
});
|
|
73
|
+
$.export("$summary", "Successfully updated filter");
|
|
74
|
+
return resp;
|
|
75
|
+
},
|
|
76
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-update-label",
|
|
5
|
+
name: "Update Label",
|
|
6
|
+
description: "Updates a label. [See the docs here](https://developer.todoist.com/rest/v1/#update-a-label)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
label: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"label",
|
|
15
|
+
],
|
|
16
|
+
description: "The label to update",
|
|
17
|
+
},
|
|
18
|
+
name: {
|
|
19
|
+
propDefinition: [
|
|
20
|
+
todoist,
|
|
21
|
+
"name",
|
|
22
|
+
],
|
|
23
|
+
optional: true,
|
|
24
|
+
},
|
|
25
|
+
order: {
|
|
26
|
+
propDefinition: [
|
|
27
|
+
todoist,
|
|
28
|
+
"order",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
color: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
todoist,
|
|
34
|
+
"color",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
favorite: {
|
|
38
|
+
propDefinition: [
|
|
39
|
+
todoist,
|
|
40
|
+
"favorite",
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
async run ({ $ }) {
|
|
45
|
+
const {
|
|
46
|
+
label,
|
|
47
|
+
name,
|
|
48
|
+
order,
|
|
49
|
+
color,
|
|
50
|
+
favorite,
|
|
51
|
+
} = this;
|
|
52
|
+
const data = {
|
|
53
|
+
labelId: label,
|
|
54
|
+
name,
|
|
55
|
+
order,
|
|
56
|
+
color,
|
|
57
|
+
favorite,
|
|
58
|
+
};
|
|
59
|
+
// No interesting data is returned from Todoist
|
|
60
|
+
await this.todoist.updateLabel({
|
|
61
|
+
$,
|
|
62
|
+
data,
|
|
63
|
+
});
|
|
64
|
+
$.export("$summary", "Successfully updated label");
|
|
65
|
+
return {
|
|
66
|
+
id: label,
|
|
67
|
+
success: true,
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-update-project",
|
|
5
|
+
name: "Update Project",
|
|
6
|
+
description: "Updates a project. [See the docs here](https://developer.todoist.com/rest/v1/#update-a-project)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
projectId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"project",
|
|
15
|
+
],
|
|
16
|
+
description: "The project to update",
|
|
17
|
+
},
|
|
18
|
+
name: {
|
|
19
|
+
propDefinition: [
|
|
20
|
+
todoist,
|
|
21
|
+
"name",
|
|
22
|
+
],
|
|
23
|
+
optional: true,
|
|
24
|
+
},
|
|
25
|
+
color: {
|
|
26
|
+
propDefinition: [
|
|
27
|
+
todoist,
|
|
28
|
+
"color",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
favorite: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
todoist,
|
|
34
|
+
"favorite",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
async run ({ $ }) {
|
|
39
|
+
const {
|
|
40
|
+
projectId,
|
|
41
|
+
name,
|
|
42
|
+
color,
|
|
43
|
+
favorite,
|
|
44
|
+
} = this;
|
|
45
|
+
const data = {
|
|
46
|
+
projectId,
|
|
47
|
+
name,
|
|
48
|
+
color,
|
|
49
|
+
favorite,
|
|
50
|
+
};
|
|
51
|
+
// No interesting data is returned from Todoist
|
|
52
|
+
await this.todoist.updateProject({
|
|
53
|
+
$,
|
|
54
|
+
data,
|
|
55
|
+
});
|
|
56
|
+
$.export("$summary", "Successfully updated project");
|
|
57
|
+
return {
|
|
58
|
+
id: projectId,
|
|
59
|
+
success: true,
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import todoist from "../../todoist.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "todoist-update-section",
|
|
5
|
+
name: "Update Section",
|
|
6
|
+
description: "Updates a section. [See the docs here](https://developer.todoist.com/rest/v1/#update-a-section)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
todoist,
|
|
11
|
+
project: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
todoist,
|
|
14
|
+
"project",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
section: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
todoist,
|
|
20
|
+
"section",
|
|
21
|
+
(c) => ({
|
|
22
|
+
project: c.project,
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
description: "The section to update",
|
|
26
|
+
},
|
|
27
|
+
name: {
|
|
28
|
+
propDefinition: [
|
|
29
|
+
todoist,
|
|
30
|
+
"name",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
async run ({ $ }) {
|
|
35
|
+
const {
|
|
36
|
+
section,
|
|
37
|
+
name,
|
|
38
|
+
} = this;
|
|
39
|
+
const data = {
|
|
40
|
+
sectionId: section,
|
|
41
|
+
name,
|
|
42
|
+
};
|
|
43
|
+
// No interesting data is returned from Todoist
|
|
44
|
+
await this.todoist.updateSection({
|
|
45
|
+
$,
|
|
46
|
+
data,
|
|
47
|
+
});
|
|
48
|
+
$.export("$summary", "Successfully updated section");
|
|
49
|
+
return {
|
|
50
|
+
id: section,
|
|
51
|
+
success: true,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
};
|