@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.
Files changed (57) hide show
  1. package/LICENSE +7 -0
  2. package/actions/create-filter/create-filter.mjs +66 -0
  3. package/actions/create-label/create-label.mjs +56 -0
  4. package/actions/create-project/create-project.mjs +57 -0
  5. package/actions/create-project-comment/create-project-comment.mjs +42 -0
  6. package/actions/create-section/create-section.mjs +49 -0
  7. package/actions/create-task/create-task.mjs +150 -0
  8. package/actions/create-task-comment/create-task-comment.mjs +51 -0
  9. package/actions/delete-comment/delete-comment.mjs +56 -0
  10. package/actions/delete-filter/delete-filter.mjs +30 -0
  11. package/actions/delete-label/delete-label.mjs +34 -0
  12. package/actions/delete-project/delete-project.mjs +34 -0
  13. package/actions/delete-section/delete-section.mjs +43 -0
  14. package/actions/delete-task/delete-task.mjs +44 -0
  15. package/actions/export-tasks/export-tasks.mjs +40 -0
  16. package/actions/find-project/find-project.mjs +51 -0
  17. package/actions/find-task/find-task.mjs +62 -0
  18. package/actions/find-user/find-user.mjs +28 -0
  19. package/actions/get-label/get-label.mjs +26 -0
  20. package/actions/get-project/get-project.mjs +26 -0
  21. package/actions/get-project-comment/get-project-comment.mjs +38 -0
  22. package/actions/get-section/get-section.mjs +38 -0
  23. package/actions/get-task/get-task.mjs +37 -0
  24. package/actions/get-task-comment/get-task-comment.mjs +47 -0
  25. package/actions/import-tasks/import-tasks.mjs +104 -0
  26. package/actions/invite-user-to-project/invite-user-to-project.mjs +40 -0
  27. package/actions/list-filters/list-filters.mjs +23 -0
  28. package/actions/list-labels/list-labels.mjs +21 -0
  29. package/actions/list-project-comments/list-project-comments.mjs +32 -0
  30. package/actions/list-projects/list-projects.mjs +22 -0
  31. package/actions/list-sections/list-sections.mjs +31 -0
  32. package/actions/list-task-comments/list-task-comments.mjs +40 -0
  33. package/actions/list-uncompleted-tasks/list-uncompleted-tasks.mjs +53 -0
  34. package/actions/mark-task-completed/mark-task-completed.mjs +43 -0
  35. package/actions/move-task-to-section/move-task-to-section.mjs +58 -0
  36. package/actions/uncomplete-task/uncomplete-task.mjs +42 -0
  37. package/actions/update-comment/update-comment.mjs +67 -0
  38. package/actions/update-filter/update-filter.mjs +76 -0
  39. package/actions/update-label/update-label.mjs +70 -0
  40. package/actions/update-project/update-project.mjs +62 -0
  41. package/actions/update-section/update-section.mjs +54 -0
  42. package/actions/update-task/update-task.mjs +126 -0
  43. package/colors.mjs +82 -0
  44. package/package.json +23 -0
  45. package/resource-types.mjs +15 -0
  46. package/sources/common-project.mjs +18 -0
  47. package/sources/common-task.mjs +38 -0
  48. package/sources/common.mjs +56 -0
  49. package/sources/completed-task/completed-task.mjs +17 -0
  50. package/sources/incomplete-task/incomplete-task.mjs +17 -0
  51. package/sources/new-or-modified-project/new-or-modified-project.mjs +10 -0
  52. package/sources/new-or-modified-task/new-or-modified-task.mjs +10 -0
  53. package/sources/new-project/new-project.mjs +11 -0
  54. package/sources/new-section/new-section.mjs +24 -0
  55. package/sources/new-task/new-task.mjs +11 -0
  56. package/sources/sync-resources/sync-resources.mjs +64 -0
  57. package/todoist.app.mjs +1105 -0
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2020 Pipedream, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,66 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-create-filter",
5
+ name: "Create Filter",
6
+ description: "Creates a filter. [See the docs here](https://developer.todoist.com/sync/v8/#add-a-filter)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ todoist,
11
+ name: {
12
+ propDefinition: [
13
+ todoist,
14
+ "name",
15
+ ],
16
+ },
17
+ query: {
18
+ propDefinition: [
19
+ todoist,
20
+ "query",
21
+ ],
22
+ },
23
+ color: {
24
+ propDefinition: [
25
+ todoist,
26
+ "color",
27
+ ],
28
+ },
29
+ order: {
30
+ propDefinition: [
31
+ todoist,
32
+ "order",
33
+ ],
34
+ },
35
+ favorite: {
36
+ propDefinition: [
37
+ todoist,
38
+ "favorite",
39
+ ],
40
+ },
41
+ },
42
+ async run ({ $ }) {
43
+ const {
44
+ name,
45
+ query,
46
+ color,
47
+ order,
48
+ favorite,
49
+ } = this;
50
+ const data = {
51
+ name,
52
+ query,
53
+ color,
54
+ item_order: order,
55
+ is_favorite: favorite
56
+ ? 1
57
+ : 0,
58
+ };
59
+ const resp = await this.todoist.createFilter({
60
+ $,
61
+ data,
62
+ });
63
+ $.export("$summary", "Successfully created filter");
64
+ return resp;
65
+ },
66
+ };
@@ -0,0 +1,56 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-create-label",
5
+ name: "Create Label",
6
+ description: "Creates a label. [See the docs here](https://developer.todoist.com/rest/v1/#create-a-new-label)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ todoist,
11
+ name: {
12
+ propDefinition: [
13
+ todoist,
14
+ "name",
15
+ ],
16
+ },
17
+ order: {
18
+ propDefinition: [
19
+ todoist,
20
+ "order",
21
+ ],
22
+ },
23
+ color: {
24
+ propDefinition: [
25
+ todoist,
26
+ "color",
27
+ ],
28
+ },
29
+ favorite: {
30
+ propDefinition: [
31
+ todoist,
32
+ "favorite",
33
+ ],
34
+ },
35
+ },
36
+ async run ({ $ }) {
37
+ const {
38
+ name,
39
+ order,
40
+ color,
41
+ favorite,
42
+ } = this;
43
+ const data = {
44
+ name,
45
+ order,
46
+ color,
47
+ favorite,
48
+ };
49
+ const resp = await this.todoist.createLabel({
50
+ $,
51
+ data,
52
+ });
53
+ $.export("$summary", "Successfully created label");
54
+ return resp;
55
+ },
56
+ };
@@ -0,0 +1,57 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-create-project",
5
+ name: "Create Project",
6
+ description: "Creates a project. [See the docs here](https://developer.todoist.com/rest/v1/#create-a-new-project)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ todoist,
11
+ name: {
12
+ propDefinition: [
13
+ todoist,
14
+ "name",
15
+ ],
16
+ },
17
+ parent: {
18
+ propDefinition: [
19
+ todoist,
20
+ "project",
21
+ ],
22
+ description: "Optional parent project",
23
+ },
24
+ color: {
25
+ propDefinition: [
26
+ todoist,
27
+ "color",
28
+ ],
29
+ },
30
+ favorite: {
31
+ propDefinition: [
32
+ todoist,
33
+ "favorite",
34
+ ],
35
+ },
36
+ },
37
+ async run ({ $ }) {
38
+ const {
39
+ name,
40
+ parent,
41
+ color,
42
+ favorite,
43
+ } = this;
44
+ const data = {
45
+ name,
46
+ parent_id: parent,
47
+ color,
48
+ favorite,
49
+ };
50
+ const resp = await this.todoist.createProject({
51
+ $,
52
+ data,
53
+ });
54
+ $.export("$summary", "Successfully created project");
55
+ return resp;
56
+ },
57
+ };
@@ -0,0 +1,42 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-create-project-comment",
5
+ name: "Create Project Comment",
6
+ description: "Adds a comment to a project. [See the docs here](https://developer.todoist.com/rest/v1/#create-a-new-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 to add a comment to",
17
+ optional: false,
18
+ },
19
+ content: {
20
+ propDefinition: [
21
+ todoist,
22
+ "content",
23
+ ],
24
+ },
25
+ },
26
+ async run ({ $ }) {
27
+ const {
28
+ project,
29
+ content,
30
+ } = this;
31
+ const data = {
32
+ project_id: project,
33
+ content,
34
+ };
35
+ const resp = await this.todoist.createComment({
36
+ $,
37
+ data,
38
+ });
39
+ $.export("$summary", "Successfully created comment");
40
+ return resp;
41
+ },
42
+ };
@@ -0,0 +1,49 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-create-section",
5
+ name: "Create Section",
6
+ description: "Creates a section. [See the docs here](https://developer.todoist.com/rest/v1/#create-a-new-section)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ todoist,
11
+ project: {
12
+ propDefinition: [
13
+ todoist,
14
+ "project",
15
+ ],
16
+ optional: false,
17
+ },
18
+ name: {
19
+ propDefinition: [
20
+ todoist,
21
+ "name",
22
+ ],
23
+ },
24
+ order: {
25
+ propDefinition: [
26
+ todoist,
27
+ "order",
28
+ ],
29
+ },
30
+ },
31
+ async run ({ $ }) {
32
+ const {
33
+ project,
34
+ name,
35
+ order,
36
+ } = this;
37
+ const data = {
38
+ project_id: project,
39
+ name,
40
+ order,
41
+ };
42
+ const resp = await this.todoist.createSection({
43
+ $,
44
+ data,
45
+ });
46
+ $.export("$summary", "Successfully created section");
47
+ return resp;
48
+ },
49
+ };
@@ -0,0 +1,150 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-create-task",
5
+ name: "Create Task",
6
+ description: "Creates a task. [See the docs here](https://developer.todoist.com/rest/v1/#create-a-new-task)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ todoist,
11
+ content: {
12
+ propDefinition: [
13
+ todoist,
14
+ "content",
15
+ ],
16
+ description: "Task Content",
17
+ optional: false,
18
+ },
19
+ description: {
20
+ propDefinition: [
21
+ todoist,
22
+ "description",
23
+ ],
24
+ },
25
+ project: {
26
+ propDefinition: [
27
+ todoist,
28
+ "project",
29
+ ],
30
+ description: "Task project. If not set, task is put to user's Inbox.",
31
+ optional: true,
32
+ },
33
+ section: {
34
+ propDefinition: [
35
+ todoist,
36
+ "section",
37
+ (c) => ({
38
+ project: c.project,
39
+ }),
40
+ ],
41
+ description: "The section to put task into",
42
+ optional: true,
43
+ },
44
+ parent: {
45
+ propDefinition: [
46
+ todoist,
47
+ "task",
48
+ (c) => ({
49
+ project: c.project,
50
+ section: c.section,
51
+ }),
52
+ ],
53
+ label: "Parent",
54
+ description: "Parent task",
55
+ optional: true,
56
+ },
57
+ order: {
58
+ propDefinition: [
59
+ todoist,
60
+ "order",
61
+ ],
62
+ },
63
+ labels: {
64
+ propDefinition: [
65
+ todoist,
66
+ "label",
67
+ ],
68
+ type: "string[]",
69
+ description: "Labels associated with the task",
70
+ optional: true,
71
+ },
72
+ priority: {
73
+ propDefinition: [
74
+ todoist,
75
+ "priority",
76
+ ],
77
+ },
78
+ dueString: {
79
+ propDefinition: [
80
+ todoist,
81
+ "dueString",
82
+ ],
83
+ },
84
+ dueDate: {
85
+ propDefinition: [
86
+ todoist,
87
+ "dueDate",
88
+ ],
89
+ },
90
+ dueDatetime: {
91
+ propDefinition: [
92
+ todoist,
93
+ "dueDatetime",
94
+ ],
95
+ },
96
+ dueLang: {
97
+ propDefinition: [
98
+ todoist,
99
+ "dueLang",
100
+ ],
101
+ },
102
+ assignee: {
103
+ propDefinition: [
104
+ todoist,
105
+ "assignee",
106
+ (c) => ({
107
+ project: c.project,
108
+ }),
109
+ ],
110
+ },
111
+ },
112
+ async run ({ $ }) {
113
+ const {
114
+ content,
115
+ description,
116
+ project,
117
+ section,
118
+ parent,
119
+ order,
120
+ labels,
121
+ priority,
122
+ dueString,
123
+ dueDate,
124
+ dueDatetime,
125
+ dueLang,
126
+ assignee,
127
+ } = this;
128
+ const data = {
129
+ content,
130
+ description,
131
+ project_id: project,
132
+ section_id: section,
133
+ parent_id: parent,
134
+ order,
135
+ label_ids: labels,
136
+ priority,
137
+ due_string: dueString,
138
+ due_date: dueDate,
139
+ due_datetime: dueDatetime,
140
+ due_lang: dueLang,
141
+ assignee,
142
+ };
143
+ const resp = await this.todoist.createTask({
144
+ $,
145
+ data,
146
+ });
147
+ $.export("$summary", "Successfully created task");
148
+ return resp;
149
+ },
150
+ };
@@ -0,0 +1,51 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-create-task-comment",
5
+ name: "Create Task Comment",
6
+ description: "Adds a comment to a task. [See the docs here](https://developer.todoist.com/rest/v1/#create-a-new-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 task to add a comment to",
17
+ },
18
+ task: {
19
+ propDefinition: [
20
+ todoist,
21
+ "task",
22
+ (c) => ({
23
+ project: c.project,
24
+ }),
25
+ ],
26
+ description: "Task to add new comment to",
27
+ },
28
+ content: {
29
+ propDefinition: [
30
+ todoist,
31
+ "content",
32
+ ],
33
+ },
34
+ },
35
+ async run ({ $ }) {
36
+ const {
37
+ task,
38
+ content,
39
+ } = this;
40
+ const data = {
41
+ task_id: task,
42
+ content,
43
+ };
44
+ const resp = await this.todoist.createComment({
45
+ $,
46
+ data,
47
+ });
48
+ $.export("$summary", "Successfully created comment");
49
+ return resp;
50
+ },
51
+ };
@@ -0,0 +1,56 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-delete-comment",
5
+ name: "Delete Comment",
6
+ description: "Deletes a comment. [See the docs here](https://developer.todoist.com/rest/v1/#delete-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 delete",
17
+ },
18
+ task: {
19
+ propDefinition: [
20
+ todoist,
21
+ "task",
22
+ (c) => ({
23
+ project: c.project,
24
+ }),
25
+ ],
26
+ description: "Task containing the comment to delete",
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
+ },
40
+ async run ({ $ }) {
41
+ const { commentId } = this;
42
+ const data = {
43
+ commentId,
44
+ };
45
+ // No interesting data is returned from Todoist
46
+ await this.todoist.deleteComment({
47
+ $,
48
+ data,
49
+ });
50
+ $.export("$summary", "Successfully deleted comment");
51
+ return {
52
+ id: commentId,
53
+ success: true,
54
+ };
55
+ },
56
+ };
@@ -0,0 +1,30 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-delete-filter",
5
+ name: "Delete Filter",
6
+ description: "Deletes a filter. [See the docs here](https://developer.todoist.com/sync/v8/#delete-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
+ },
18
+ async run ({ $ }) {
19
+ const { filter } = this;
20
+ const data = {
21
+ id: filter,
22
+ };
23
+ const resp = await this.todoist.deleteFilter({
24
+ $,
25
+ data,
26
+ });
27
+ $.export("$summary", "Successfully deleted filter");
28
+ return resp;
29
+ },
30
+ };
@@ -0,0 +1,34 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-delete-label",
5
+ name: "Delete Label",
6
+ description: "Deletes a label. [See the docs here](https://developer.todoist.com/rest/v1/#delete-a-label)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ todoist,
11
+ label: {
12
+ propDefinition: [
13
+ todoist,
14
+ "label",
15
+ ],
16
+ },
17
+ },
18
+ async run ({ $ }) {
19
+ const { label } = this;
20
+ const data = {
21
+ labelId: label,
22
+ };
23
+ // No interesting data is returned from Todoist
24
+ await this.todoist.deleteLabel({
25
+ $,
26
+ data,
27
+ });
28
+ $.export("$summary", "Successfully deleted label");
29
+ return {
30
+ id: label,
31
+ success: true,
32
+ };
33
+ },
34
+ };
@@ -0,0 +1,34 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-delete-project",
5
+ name: "Delete Project",
6
+ description: "Deletes a project. [See the docs here](https://developer.todoist.com/rest/v1/#delete-a-project)",
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 { project } = this;
20
+ const data = {
21
+ projectId: project,
22
+ };
23
+ // No interesting data is returned from Todoist
24
+ await this.todoist.deleteProject({
25
+ $,
26
+ data,
27
+ });
28
+ $.export("$summary", "Successfully deleted project");
29
+ return {
30
+ id: project,
31
+ success: true,
32
+ };
33
+ },
34
+ };
@@ -0,0 +1,43 @@
1
+ import todoist from "../../todoist.app.mjs";
2
+
3
+ export default {
4
+ key: "todoist-delete-section",
5
+ name: "Delete Section",
6
+ description: "Deletes a section. [See the docs here](https://developer.todoist.com/rest/v1/#delete-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
+ },
26
+ },
27
+ async run ({ $ }) {
28
+ const { section } = this;
29
+ const data = {
30
+ sectionId: section,
31
+ };
32
+ // No interesting data is returned from Todoist
33
+ await this.todoist.deleteSection({
34
+ $,
35
+ data,
36
+ });
37
+ $.export("$summary", "Successfully deleted section");
38
+ return {
39
+ id: section,
40
+ success: true,
41
+ };
42
+ },
43
+ };