@pipedream/todoist 0.2.2 → 0.3.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/create-filter/create-filter.mjs +3 -5
- package/actions/create-label/create-label.mjs +3 -3
- package/actions/create-project/create-project.mjs +3 -3
- package/actions/create-project-comment/create-project-comment.mjs +2 -2
- package/actions/create-section/create-section.mjs +2 -2
- package/actions/create-task/create-task.mjs +3 -2
- package/actions/create-task-comment/create-task-comment.mjs +2 -2
- package/actions/delete-comment/delete-comment.mjs +2 -2
- package/actions/delete-filter/delete-filter.mjs +2 -2
- package/actions/delete-label/delete-label.mjs +2 -2
- package/actions/delete-project/delete-project.mjs +2 -2
- package/actions/delete-section/delete-section.mjs +2 -2
- package/actions/delete-task/delete-task.mjs +2 -2
- package/actions/export-tasks/export-tasks.mjs +5 -5
- package/actions/find-project/find-project.mjs +2 -2
- package/actions/find-task/find-task.mjs +4 -4
- package/actions/find-user/find-user.mjs +2 -2
- package/actions/get-label/get-label.mjs +2 -2
- package/actions/get-project/get-project.mjs +2 -2
- package/actions/get-project-comment/get-project-comment.mjs +2 -2
- package/actions/get-section/get-section.mjs +2 -2
- package/actions/get-task/get-task.mjs +2 -2
- package/actions/get-task-comment/get-task-comment.mjs +2 -2
- package/actions/import-tasks/import-tasks.mjs +2 -2
- package/actions/invite-user-to-project/invite-user-to-project.mjs +2 -2
- package/actions/list-filters/list-filters.mjs +2 -2
- package/actions/list-labels/list-labels.mjs +4 -4
- package/actions/list-project-comments/list-project-comments.mjs +4 -4
- package/actions/list-projects/list-projects.mjs +4 -5
- package/actions/list-sections/list-sections.mjs +4 -4
- package/actions/list-task-comments/list-task-comments.mjs +4 -4
- package/actions/list-uncompleted-tasks/list-uncompleted-tasks.mjs +4 -4
- package/actions/mark-task-completed/mark-task-completed.mjs +2 -2
- package/actions/move-task-to-section/move-task-to-section.mjs +2 -2
- package/actions/search-tasks/search-tasks.mjs +6 -6
- package/actions/uncomplete-task/uncomplete-task.mjs +2 -2
- package/actions/update-comment/update-comment.mjs +2 -2
- package/actions/update-filter/update-filter.mjs +3 -5
- package/actions/update-label/update-label.mjs +3 -3
- package/actions/update-project/update-project.mjs +3 -3
- package/actions/update-section/update-section.mjs +2 -2
- package/actions/update-task/update-task.mjs +2 -2
- package/common/colors.mjs +50 -0
- package/package.json +1 -1
- package/sources/completed-task/completed-task.mjs +2 -2
- package/sources/incomplete-task/incomplete-task.mjs +2 -2
- package/sources/new-or-modified-project/new-or-modified-project.mjs +2 -2
- package/sources/new-or-modified-task/new-or-modified-task.mjs +2 -2
- package/sources/new-project/new-project.mjs +2 -2
- package/sources/new-section/new-section.mjs +2 -2
- package/sources/new-task/new-task.mjs +2 -2
- package/sources/sync-resources/sync-resources.mjs +2 -2
- package/todoist.app.mjs +48 -14
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-create-filter",
|
|
5
5
|
name: "Create Filter",
|
|
6
|
-
description: "Creates a filter. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Creates a filter. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Filters/Add-a-filter)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -57,9 +57,7 @@ export default {
|
|
|
57
57
|
query,
|
|
58
58
|
color,
|
|
59
59
|
item_order: order,
|
|
60
|
-
is_favorite: favorite
|
|
61
|
-
? 1
|
|
62
|
-
: 0,
|
|
60
|
+
is_favorite: favorite,
|
|
63
61
|
};
|
|
64
62
|
const resp = await this.todoist.createFilter({
|
|
65
63
|
$,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-create-label",
|
|
5
5
|
name: "Create Label",
|
|
6
|
-
description: "Creates a label. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Creates a label. [See the documentation](https://developer.todoist.com/api/v1#tag/Labels/operation/create_label_api_v1_labels_post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -49,7 +49,7 @@ export default {
|
|
|
49
49
|
name,
|
|
50
50
|
order,
|
|
51
51
|
color,
|
|
52
|
-
favorite,
|
|
52
|
+
is_favorite: favorite,
|
|
53
53
|
};
|
|
54
54
|
const resp = await this.todoist.createLabel({
|
|
55
55
|
$,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-create-project",
|
|
5
5
|
name: "Create Project",
|
|
6
|
-
description: "Creates a project. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Creates a project. [See the documentation](https://developer.todoist.com/api/v1#tag/Projects/operation/create_project_api_v1_projects_post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -50,7 +50,7 @@ export default {
|
|
|
50
50
|
name,
|
|
51
51
|
parent_id: parent,
|
|
52
52
|
color,
|
|
53
|
-
favorite,
|
|
53
|
+
is_favorite: favorite,
|
|
54
54
|
};
|
|
55
55
|
const resp = await this.todoist.createProject({
|
|
56
56
|
$,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-create-project-comment",
|
|
5
5
|
name: "Create Project Comment",
|
|
6
|
-
description: "Adds a comment to a project. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Adds a comment to a project. [See the documentation](https://developer.todoist.com/api/v1#tag/Comments/operation/create_comment_api_v1_comments_post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-create-section",
|
|
5
5
|
name: "Create Section",
|
|
6
|
-
description: "Creates a section. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Creates a section. [See the documentation](https://developer.todoist.com/api/v1#tag/Sections/operation/create_section_api_v1_sections_post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-create-task",
|
|
5
5
|
name: "Create Task",
|
|
6
|
-
description: "Creates a task. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Creates a task. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/create_task_api_v1_tasks_post)",
|
|
7
|
+
version: "0.0.7",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -13,6 +13,7 @@ export default {
|
|
|
13
13
|
type: "action",
|
|
14
14
|
props: {
|
|
15
15
|
todoist,
|
|
16
|
+
// eslint-disable-next-line pipedream/props-label, pipedream/props-description
|
|
16
17
|
recurringInfoLabel: {
|
|
17
18
|
type: "alert",
|
|
18
19
|
alertType: "info",
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-create-task-comment",
|
|
5
5
|
name: "Create Task Comment",
|
|
6
|
-
description: "Adds a comment to a task. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Adds a comment to a task. [See the documentation](https://developer.todoist.com/api/v1#tag/Comments/operation/create_comment_api_v1_comments_post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-delete-comment",
|
|
5
5
|
name: "Delete Comment",
|
|
6
|
-
description: "Deletes a comment. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Deletes a comment. [See the documentation](https://developer.todoist.com/api/v1#tag/Comments/operation/delete_comment_api_v1_comments__comment_id__delete)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-delete-filter",
|
|
5
5
|
name: "Delete Filter",
|
|
6
|
-
description: "Deletes a filter. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Deletes a filter. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Filters/Delete-a-filter)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-delete-label",
|
|
5
5
|
name: "Delete Label",
|
|
6
|
-
description: "Deletes a label. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Deletes a label. [See the documentation](https://developer.todoist.com/api/v1#tag/Labels/operation/delete_label_api_v1_labels__label_id__delete)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-delete-project",
|
|
5
5
|
name: "Delete Project",
|
|
6
|
-
description: "Deletes a project. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Deletes a project. [See the documentation](https://developer.todoist.com/api/v1#tag/Projects/operation/delete_project_api_v1_projects__project_id__delete)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-delete-section",
|
|
5
5
|
name: "Delete Section",
|
|
6
|
-
description: "Deletes a section. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Deletes a section. [See the documentation](https://developer.todoist.com/api/v1#tag/Sections/operation/delete_section_api_v1_sections__section_id__delete)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-delete-task",
|
|
5
5
|
name: "Delete Task",
|
|
6
|
-
description: "Deletes a task. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Deletes a task. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/delete_task_api_v1_tasks__task_id__delete)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -6,8 +6,8 @@ import converter from "json-2-csv";
|
|
|
6
6
|
export default {
|
|
7
7
|
key: "todoist-export-tasks",
|
|
8
8
|
name: "Export Tasks",
|
|
9
|
-
description: "Export project task names as comma separated file. Returns path to new file. [See
|
|
10
|
-
version: "0.1.
|
|
9
|
+
description: "Export project task names as comma separated file. Returns path to new file. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/get_tasks_api_v1_tasks_get)",
|
|
10
|
+
version: "0.1.3",
|
|
11
11
|
annotations: {
|
|
12
12
|
destructiveHint: false,
|
|
13
13
|
openWorldHint: true,
|
|
@@ -31,20 +31,20 @@ export default {
|
|
|
31
31
|
async run ({ $ }) {
|
|
32
32
|
const { project } = this;
|
|
33
33
|
|
|
34
|
-
const
|
|
34
|
+
const resp = await this.todoist.getActiveTasks({
|
|
35
35
|
$,
|
|
36
36
|
params: {
|
|
37
37
|
project_id: project,
|
|
38
38
|
},
|
|
39
39
|
});
|
|
40
|
-
const csv = converter.json2csv(
|
|
40
|
+
const csv = converter.json2csv(resp?.results);
|
|
41
41
|
|
|
42
42
|
const { path } = await file({
|
|
43
43
|
postfix: ".csv",
|
|
44
44
|
});
|
|
45
45
|
await fs.promises.appendFile(path, Buffer.from(csv));
|
|
46
46
|
|
|
47
|
-
$.export("$summary", `Successfully exported ${
|
|
47
|
+
$.export("$summary", `Successfully exported ${resp?.results?.length} task${resp?.results?.length === 1
|
|
48
48
|
? ""
|
|
49
49
|
: "s"} to "${path}"`);
|
|
50
50
|
return path;
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-find-project",
|
|
5
5
|
name: "Find Project",
|
|
6
|
-
description: "Finds a project (by name/title). [See
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Finds a project (by name/title). [See the documentation](https://developer.todoist.com/api/v1#tag/Projects/operation/get_projects_api_v1_projects_get) Optionally, create one if none are found. [See the documentation](https://developer.todoist.com/api/v1#tag/Projects/operation/create_project_api_v1_projects_post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-find-task",
|
|
5
5
|
name: "Find Task",
|
|
6
|
-
description: "Finds a task by name. [See
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Finds a task by name. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/get_tasks_api_v1_tasks_get) Optionally, create one if none are found. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/create_task_api_v1_tasks_post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -39,13 +39,13 @@ export default {
|
|
|
39
39
|
content,
|
|
40
40
|
createIfNotFound,
|
|
41
41
|
} = this;
|
|
42
|
-
const
|
|
42
|
+
const resp = await this.todoist.getActiveTasks({
|
|
43
43
|
$,
|
|
44
44
|
params: {
|
|
45
45
|
project_id: project,
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
|
-
let result =
|
|
48
|
+
let result = resp?.results?.find((task) => task?.content == content);
|
|
49
49
|
let summary = result
|
|
50
50
|
? "Task found"
|
|
51
51
|
: "Task not found";
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-find-user",
|
|
5
5
|
name: "Find User",
|
|
6
|
-
description: "Searches by email for a user who is connected/shared with your account. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Searches by email for a user who is connected/shared with your account. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Overview/Read-resources)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-get-label",
|
|
5
5
|
name: "Get Label",
|
|
6
|
-
description: "Returns info about a label. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns info about a label. [See the documentation](https://developer.todoist.com/api/v1#tag/Labels/operation/get_label_api_v1_labels__label_id__get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-get-project",
|
|
5
5
|
name: "Get Project",
|
|
6
|
-
description: "Returns info about a project. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns info about a project. [See the documentation](https://developer.todoist.com/api/v1#tag/Projects/operation/get_project_api_v1_projects__project_id__get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-get-project-comment",
|
|
5
5
|
name: "Get Project Comment",
|
|
6
|
-
description: "Returns info about a project comment. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns info about a project comment. [See the documentation](https://developer.todoist.com/api/v1#tag/Comments/operation/get_comment_api_v1_comments__comment_id__get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-get-section",
|
|
5
5
|
name: "Get Section",
|
|
6
|
-
description: "Returns info about a section. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns info about a section. [See the documentation](https://developer.todoist.com/api/v1#tag/Sections/operation/get_section_api_v1_sections__section_id__get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-get-task",
|
|
5
5
|
name: "Get Task",
|
|
6
|
-
description: "Returns info about a task. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns info about a task. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/get_task_api_v1_tasks__task_id__get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-get-task-comment",
|
|
5
5
|
name: "Get Task Comment",
|
|
6
|
-
description: "Returns info about a task comment. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns info about a task comment. [See the documentation](https://developer.todoist.com/api/v1#tag/Comments/operation/get_comment_api_v1_comments__comment_id__get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,8 +5,8 @@ import { getFileStream } from "@pipedream/platform";
|
|
|
5
5
|
export default {
|
|
6
6
|
key: "todoist-import-tasks",
|
|
7
7
|
name: "Import Tasks",
|
|
8
|
-
description: "Import tasks into a selected project. [See
|
|
9
|
-
version: "0.1.
|
|
8
|
+
description: "Import tasks into a selected project. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/create_task_api_v1_tasks_post)",
|
|
9
|
+
version: "0.1.3",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: true,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-invite-user-to-project",
|
|
5
5
|
name: "Invite User To Project",
|
|
6
|
-
description: "Sends email to a person, inviting them to use one of your projects. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Sends email to a person, inviting them to use one of your projects. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Sharing/Share-a-project)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-list-filters",
|
|
5
5
|
name: "List Filters",
|
|
6
|
-
description: "Returns a list of all filters. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns a list of all filters. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Overview/Read-resources)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-list-labels",
|
|
5
5
|
name: "List Labels",
|
|
6
|
-
description: "Returns a list of all labels. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns a list of all labels. [See the documentation](https://developer.todoist.com/api/v1#tag/Labels/operation/get_labels_api_v1_labels_get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -18,9 +18,9 @@ export default {
|
|
|
18
18
|
const resp = await this.todoist.getLabels({
|
|
19
19
|
$,
|
|
20
20
|
});
|
|
21
|
-
$.export("$summary", `Successfully retrieved ${resp
|
|
21
|
+
$.export("$summary", `Successfully retrieved ${resp?.results?.length} label${resp?.results?.length === 1
|
|
22
22
|
? ""
|
|
23
23
|
: "s"}`);
|
|
24
|
-
return resp;
|
|
24
|
+
return resp?.results;
|
|
25
25
|
},
|
|
26
26
|
};
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-list-project-comments",
|
|
5
5
|
name: "List Project Comments",
|
|
6
|
-
description: "Returns a list of comments for a project. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns a list of comments for a project. [See the documentation](https://developer.todoist.com/api/v1#tag/Comments/operation/get_comments_api_v1_comments_get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -29,9 +29,9 @@ export default {
|
|
|
29
29
|
$,
|
|
30
30
|
params,
|
|
31
31
|
});
|
|
32
|
-
$.export("$summary", `Successfully retrieved ${resp
|
|
32
|
+
$.export("$summary", `Successfully retrieved ${resp?.results?.length} comment${resp?.results?.length === 1
|
|
33
33
|
? ""
|
|
34
34
|
: "s"}`);
|
|
35
|
-
return resp;
|
|
35
|
+
return resp?.results;
|
|
36
36
|
},
|
|
37
37
|
};
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-list-projects",
|
|
5
5
|
name: "List Projects",
|
|
6
|
-
description: "Returns a list of all projects. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns a list of all projects. [See the documentation](https://developer.todoist.com/api/v1#tag/Projects/operation/get_projects_api_v1_projects_get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -18,10 +18,9 @@ export default {
|
|
|
18
18
|
const resp = await this.todoist.getProjects({
|
|
19
19
|
$,
|
|
20
20
|
});
|
|
21
|
-
$.export("$summary",
|
|
22
|
-
$.export("$summary", `Successfully retrieved ${resp.length} project${resp.length === 1
|
|
21
|
+
$.export("$summary", `Successfully retrieved ${resp?.results?.length} project${resp?.results?.length === 1
|
|
23
22
|
? ""
|
|
24
23
|
: "s"}`);
|
|
25
|
-
return resp;
|
|
24
|
+
return resp?.results;
|
|
26
25
|
},
|
|
27
26
|
};
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-list-sections",
|
|
5
5
|
name: "List Sections",
|
|
6
|
-
description: "Returns a list of all sections. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns a list of all sections. [See the documentation](https://developer.todoist.com/api/v1#tag/Sections/operation/get_sections_api_v1_sections_get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -28,9 +28,9 @@ export default {
|
|
|
28
28
|
$,
|
|
29
29
|
params,
|
|
30
30
|
});
|
|
31
|
-
$.export("$summary", `Successfully retrieved ${resp
|
|
31
|
+
$.export("$summary", `Successfully retrieved ${resp?.results?.length} section${resp?.results?.length === 1
|
|
32
32
|
? ""
|
|
33
33
|
: "s"}`);
|
|
34
|
-
return resp;
|
|
34
|
+
return resp?.results;
|
|
35
35
|
},
|
|
36
36
|
};
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-list-task-comments",
|
|
5
5
|
name: "List Task Comments",
|
|
6
|
-
description: "Returns a list of comments for a task. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns a list of comments for a task. [See the documentation](https://developer.todoist.com/api/v1#tag/Comments/operation/get_comments_api_v1_comments_get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -37,9 +37,9 @@ export default {
|
|
|
37
37
|
$,
|
|
38
38
|
params,
|
|
39
39
|
});
|
|
40
|
-
$.export("$summary", `Successfully retrieved ${resp
|
|
40
|
+
$.export("$summary", `Successfully retrieved ${resp?.results?.length} comment${resp?.results?.length === 1
|
|
41
41
|
? ""
|
|
42
42
|
: "s"}`);
|
|
43
|
-
return resp;
|
|
43
|
+
return resp?.results;
|
|
44
44
|
},
|
|
45
45
|
};
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-list-uncompleted-tasks",
|
|
5
5
|
name: "List Uncompleted Tasks",
|
|
6
|
-
description: "Returns a list of uncompleted tasks by project, section, and/or label. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Returns a list of uncompleted tasks by project, section, and/or label. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/get_tasks_api_v1_tasks_get)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -50,9 +50,9 @@ export default {
|
|
|
50
50
|
$,
|
|
51
51
|
params,
|
|
52
52
|
});
|
|
53
|
-
$.export("$summary", `Successfully retrieved ${resp
|
|
53
|
+
$.export("$summary", `Successfully retrieved ${resp?.results?.length} task${resp?.results?.length === 1
|
|
54
54
|
? ""
|
|
55
55
|
: "s"}`);
|
|
56
|
-
return resp;
|
|
56
|
+
return resp?.results;
|
|
57
57
|
},
|
|
58
58
|
};
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-mark-task-completed",
|
|
5
5
|
name: "Mark Task as Completed",
|
|
6
|
-
description: "Marks a task as being completed. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Marks a task as being completed. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/close_task_api_v1_tasks__task_id__close_post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-move-task-to-section",
|
|
5
5
|
name: "Move Task To Section",
|
|
6
|
-
description: "Move a Task to a different section within the same project. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Move a Task to a different section within the same project. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/move_task_api_v1_tasks__task_id__move_post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-search-tasks",
|
|
5
5
|
name: "Search Tasks",
|
|
6
|
-
description: "Search tasks by name, label, project and/or section. [See
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Search tasks by name, label, project and/or section. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/get_tasks_api_v1_tasks_get)",
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -51,7 +51,7 @@ export default {
|
|
|
51
51
|
project,
|
|
52
52
|
section,
|
|
53
53
|
} = this;
|
|
54
|
-
const
|
|
54
|
+
const resp = await this.todoist.getActiveTasks({
|
|
55
55
|
$,
|
|
56
56
|
params: {
|
|
57
57
|
label,
|
|
@@ -60,9 +60,9 @@ export default {
|
|
|
60
60
|
},
|
|
61
61
|
});
|
|
62
62
|
let result = name
|
|
63
|
-
?
|
|
64
|
-
:
|
|
65
|
-
let summary = `${result
|
|
63
|
+
? resp?.results?.filter((task) => task?.content?.includes(name))
|
|
64
|
+
: resp?.results;
|
|
65
|
+
let summary = `${result?.length} task${result?.length == 1
|
|
66
66
|
? ""
|
|
67
67
|
: "s"} found`;
|
|
68
68
|
$.export("$summary", summary);
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-uncomplete-task",
|
|
5
5
|
name: "Uncomplete Task",
|
|
6
|
-
description: "Uncompletes a task. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Uncompletes a task. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/reopen_task_api_v1_tasks__task_id__reopen_post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-update-comment",
|
|
5
5
|
name: "Update Comment",
|
|
6
|
-
description: "Updates a comment. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Updates a comment. [See the documentation](https://developer.todoist.com/api/v1#tag/Comments/operation/update_comment_api_v1_comments__comment_id__post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-update-filter",
|
|
5
5
|
name: "Update Filter",
|
|
6
|
-
description: "Updates a filter. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Updates a filter. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Filters/Update-a-filter)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -67,9 +67,7 @@ export default {
|
|
|
67
67
|
query,
|
|
68
68
|
color,
|
|
69
69
|
item_order: order,
|
|
70
|
-
is_favorite: favorite
|
|
71
|
-
? 1
|
|
72
|
-
: 0,
|
|
70
|
+
is_favorite: favorite,
|
|
73
71
|
};
|
|
74
72
|
const resp = await this.todoist.updateFilter({
|
|
75
73
|
$,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-update-label",
|
|
5
5
|
name: "Update Label",
|
|
6
|
-
description: "Updates a label. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Updates a label. [See the documentation](https://developer.todoist.com/api/v1#tag/Labels/operation/update_label_api_v1_labels__label_id__post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
59
59
|
name,
|
|
60
60
|
order,
|
|
61
61
|
color,
|
|
62
|
-
favorite,
|
|
62
|
+
is_favorite: favorite,
|
|
63
63
|
};
|
|
64
64
|
// No interesting data is returned from Todoist
|
|
65
65
|
await this.todoist.updateLabel({
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-update-project",
|
|
5
5
|
name: "Update Project",
|
|
6
|
-
description: "Updates a project. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Updates a project. [See the documentation](https://developer.todoist.com/api/v1#tag/Projects/operation/update_project_api_v1_projects__project_id__post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -51,7 +51,7 @@ export default {
|
|
|
51
51
|
projectId,
|
|
52
52
|
name,
|
|
53
53
|
color,
|
|
54
|
-
favorite,
|
|
54
|
+
is_favorite: favorite,
|
|
55
55
|
};
|
|
56
56
|
// No interesting data is returned from Todoist
|
|
57
57
|
await this.todoist.updateProject({
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-update-section",
|
|
5
5
|
name: "Update Section",
|
|
6
|
-
description: "Updates a section. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Updates a section. [See the documentation](https://developer.todoist.com/api/v1#tag/Sections/operation/update_section_api_v1_sections__section_id__post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,8 +3,8 @@ import todoist from "../../todoist.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "todoist-update-task",
|
|
5
5
|
name: "Update Task",
|
|
6
|
-
description: "Updates a task. [See the
|
|
7
|
-
version: "0.0.
|
|
6
|
+
description: "Updates a task. [See the documentation](https://developer.todoist.com/api/v1#tag/Tasks/operation/update_task_api_v1_tasks__task_id__post)",
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
package/common/colors.mjs
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
+
// Map of numeric IDs to v1 API color names
|
|
2
|
+
const COLOR_MAP = {
|
|
3
|
+
30: "berry_red",
|
|
4
|
+
31: "red",
|
|
5
|
+
32: "orange",
|
|
6
|
+
33: "yellow",
|
|
7
|
+
34: "olive_green",
|
|
8
|
+
35: "lime_green",
|
|
9
|
+
36: "green",
|
|
10
|
+
37: "mint_green",
|
|
11
|
+
38: "teal",
|
|
12
|
+
39: "sky_blue",
|
|
13
|
+
40: "light_blue",
|
|
14
|
+
41: "blue",
|
|
15
|
+
42: "grape",
|
|
16
|
+
43: "violet",
|
|
17
|
+
44: "lavender",
|
|
18
|
+
45: "magenta",
|
|
19
|
+
46: "salmon",
|
|
20
|
+
47: "charcoal",
|
|
21
|
+
48: "grey",
|
|
22
|
+
49: "taupe",
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Reverse mapping
|
|
26
|
+
const COLOR_NAME_TO_ID = Object.fromEntries(
|
|
27
|
+
Object.entries(COLOR_MAP).map(([
|
|
28
|
+
id,
|
|
29
|
+
name,
|
|
30
|
+
]) => [
|
|
31
|
+
name,
|
|
32
|
+
parseInt(id),
|
|
33
|
+
]),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
// Helper functions
|
|
37
|
+
export function numericToString(numericColor) {
|
|
38
|
+
return COLOR_MAP[numericColor] || null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function stringToNumeric(colorName) {
|
|
42
|
+
return COLOR_NAME_TO_ID[colorName] || null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Original export for backward compatibility
|
|
1
46
|
export default [
|
|
2
47
|
{
|
|
3
48
|
label: "Berry Red",
|
|
@@ -80,3 +125,8 @@ export default [
|
|
|
80
125
|
value: 49,
|
|
81
126
|
},
|
|
82
127
|
];
|
|
128
|
+
|
|
129
|
+
export {
|
|
130
|
+
COLOR_MAP,
|
|
131
|
+
COLOR_NAME_TO_ID,
|
|
132
|
+
};
|
package/package.json
CHANGED
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "todoist-completed-task",
|
|
6
6
|
name: "New Completed Task",
|
|
7
|
-
description: "Emit new event for each completed task. [See the
|
|
8
|
-
version: "1.0.
|
|
7
|
+
description: "Emit new event for each completed task. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Overview/Read-resources)",
|
|
8
|
+
version: "1.0.1",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
methods: {
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "todoist-incomplete-task",
|
|
6
6
|
name: "New Incomplete Task",
|
|
7
|
-
description: "Emit new event for each new incomplete task. [See the
|
|
8
|
-
version: "0.1.
|
|
7
|
+
description: "Emit new event for each new incomplete task. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Overview/Read-resources)",
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "todoist-new-or-modified-project",
|
|
6
6
|
name: "New or Modified Project",
|
|
7
|
-
description: "Emit new event for each new or modified project. [See the
|
|
8
|
-
version: "0.0.
|
|
7
|
+
description: "Emit new event for each new or modified project. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Overview/Read-resources)",
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
type: "source",
|
|
10
10
|
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "todoist-new-or-modified-task",
|
|
6
6
|
name: "New or Modified Task",
|
|
7
|
-
description: "Emit new event for each new or modified task. [See the
|
|
8
|
-
version: "0.0.
|
|
7
|
+
description: "Emit new event for each new or modified task. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Overview/Read-resources)",
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
type: "source",
|
|
10
10
|
};
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "todoist-new-project",
|
|
6
6
|
name: "New Project",
|
|
7
|
-
description: "Emit new event for each new project. [See the
|
|
8
|
-
version: "0.0.
|
|
7
|
+
description: "Emit new event for each new project. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Overview/Read-resources)",
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "greatest",
|
|
11
11
|
};
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "todoist-new-section",
|
|
6
6
|
name: "New Section",
|
|
7
|
-
description: "Emit new event for each new section added. [See the
|
|
8
|
-
version: "0.0.
|
|
7
|
+
description: "Emit new event for each new section added. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Overview/Read-resources)",
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "greatest",
|
|
11
11
|
methods: {
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "todoist-new-task",
|
|
6
6
|
name: "New Task",
|
|
7
|
-
description: "Emit new event for each new task. [See the
|
|
8
|
-
version: "0.0.
|
|
7
|
+
description: "Emit new event for each new task. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Overview/Read-resources)",
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "greatest",
|
|
11
11
|
};
|
|
@@ -4,8 +4,8 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "todoist-sync-resources",
|
|
6
6
|
name: "New Sync Resources",
|
|
7
|
-
description: "Emit new updates for your selected resources. [See the
|
|
8
|
-
version: "0.0.
|
|
7
|
+
description: "Emit new updates for your selected resources. [See the documentation](https://developer.todoist.com/api/v1#tag/Sync/Overview/Read-resources)",
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
type: "source",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
package/todoist.app.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { axios } from "@pipedream/platform";
|
|
2
2
|
import querystring from "query-string";
|
|
3
3
|
import resourceTypes from "./common/resource-types.mjs";
|
|
4
|
-
import colors from "./common/colors.mjs";
|
|
4
|
+
import colors, { numericToString } from "./common/colors.mjs";
|
|
5
5
|
import { v4 as uuid } from "uuid";
|
|
6
6
|
|
|
7
7
|
export default {
|
|
@@ -185,7 +185,7 @@ export default {
|
|
|
185
185
|
color: {
|
|
186
186
|
type: "integer",
|
|
187
187
|
label: "Color",
|
|
188
|
-
description: "A numeric ID representing a color. Refer to the id column in the [Colors](https://developer.todoist.com/guides/#colors) guide for more info.",
|
|
188
|
+
description: "A numeric ID representing a color (automatically converted to v1 API format). Refer to the id column in the [Colors](https://developer.todoist.com/guides/#colors) guide for more info.",
|
|
189
189
|
options: colors,
|
|
190
190
|
optional: true,
|
|
191
191
|
},
|
|
@@ -272,7 +272,7 @@ export default {
|
|
|
272
272
|
async _makeSyncRequest(opts) {
|
|
273
273
|
const {
|
|
274
274
|
$,
|
|
275
|
-
path = "/
|
|
275
|
+
path = "/api/v1/sync",
|
|
276
276
|
} = opts;
|
|
277
277
|
delete opts.path;
|
|
278
278
|
delete opts.$;
|
|
@@ -302,7 +302,7 @@ export default {
|
|
|
302
302
|
} = opts;
|
|
303
303
|
delete opts.path;
|
|
304
304
|
delete opts.$;
|
|
305
|
-
opts.url = `https://api.todoist.com/
|
|
305
|
+
opts.url = `https://api.todoist.com/api/v1${path[0] === "/"
|
|
306
306
|
? ""
|
|
307
307
|
: "/"}${path}`;
|
|
308
308
|
opts.headers = {
|
|
@@ -351,7 +351,7 @@ export default {
|
|
|
351
351
|
}) {
|
|
352
352
|
return this._makeSyncRequest({
|
|
353
353
|
$,
|
|
354
|
-
path: "/
|
|
354
|
+
path: "/api/v1/sync",
|
|
355
355
|
method: "POST",
|
|
356
356
|
payload: opts,
|
|
357
357
|
});
|
|
@@ -403,7 +403,9 @@ export default {
|
|
|
403
403
|
} = opts;
|
|
404
404
|
return this._makeRestRequest({
|
|
405
405
|
$,
|
|
406
|
-
path:
|
|
406
|
+
path: id
|
|
407
|
+
? `/projects/${id}`
|
|
408
|
+
: "/projects",
|
|
407
409
|
method: "GET",
|
|
408
410
|
});
|
|
409
411
|
},
|
|
@@ -419,6 +421,10 @@ export default {
|
|
|
419
421
|
$,
|
|
420
422
|
data = {},
|
|
421
423
|
} = opts;
|
|
424
|
+
// Transform numeric color to string for v1 API
|
|
425
|
+
if (data.color && typeof data.color === "number") {
|
|
426
|
+
data.color = numericToString(data.color);
|
|
427
|
+
}
|
|
422
428
|
return this._makeRestRequest({
|
|
423
429
|
$,
|
|
424
430
|
path: "/projects",
|
|
@@ -439,6 +445,10 @@ export default {
|
|
|
439
445
|
} = opts;
|
|
440
446
|
const { projectId } = data;
|
|
441
447
|
delete data.projectId;
|
|
448
|
+
// Transform numeric color to string for v1 API
|
|
449
|
+
if (data.color && typeof data.color === "number") {
|
|
450
|
+
data.color = numericToString(data.color);
|
|
451
|
+
}
|
|
442
452
|
return this._makeRestRequest({
|
|
443
453
|
$,
|
|
444
454
|
path: `/projects/${projectId}`,
|
|
@@ -520,7 +530,9 @@ export default {
|
|
|
520
530
|
delete params.section_id;
|
|
521
531
|
return this._makeRestRequest({
|
|
522
532
|
$,
|
|
523
|
-
path:
|
|
533
|
+
path: id
|
|
534
|
+
? `/sections/${id}`
|
|
535
|
+
: "/sections",
|
|
524
536
|
method: "GET",
|
|
525
537
|
params,
|
|
526
538
|
});
|
|
@@ -596,7 +608,9 @@ export default {
|
|
|
596
608
|
} = opts;
|
|
597
609
|
return this._makeRestRequest({
|
|
598
610
|
$,
|
|
599
|
-
path:
|
|
611
|
+
path: id
|
|
612
|
+
? `/labels/${id}`
|
|
613
|
+
: "/labels",
|
|
600
614
|
method: "GET",
|
|
601
615
|
});
|
|
602
616
|
},
|
|
@@ -611,6 +625,10 @@ export default {
|
|
|
611
625
|
$,
|
|
612
626
|
data = {},
|
|
613
627
|
} = opts;
|
|
628
|
+
// Transform numeric color to string for v1 API
|
|
629
|
+
if (data.color && typeof data.color === "number") {
|
|
630
|
+
data.color = numericToString(data.color);
|
|
631
|
+
}
|
|
614
632
|
return this._makeRestRequest({
|
|
615
633
|
$,
|
|
616
634
|
path: "/labels",
|
|
@@ -631,6 +649,10 @@ export default {
|
|
|
631
649
|
} = opts;
|
|
632
650
|
const { labelId } = data;
|
|
633
651
|
delete data.labelId;
|
|
652
|
+
// Transform numeric color to string for v1 API
|
|
653
|
+
if (data.color && typeof data.color === "number") {
|
|
654
|
+
data.color = numericToString(data.color);
|
|
655
|
+
}
|
|
634
656
|
return this._makeRestRequest({
|
|
635
657
|
$,
|
|
636
658
|
path: `/labels/${labelId}`,
|
|
@@ -678,7 +700,9 @@ export default {
|
|
|
678
700
|
delete params.comment_id;
|
|
679
701
|
return this._makeRestRequest({
|
|
680
702
|
$,
|
|
681
|
-
path:
|
|
703
|
+
path: id
|
|
704
|
+
? `/comments/${id}`
|
|
705
|
+
: "/comments",
|
|
682
706
|
method: "GET",
|
|
683
707
|
params,
|
|
684
708
|
});
|
|
@@ -757,7 +781,9 @@ export default {
|
|
|
757
781
|
delete params.task_id;
|
|
758
782
|
return this._makeRestRequest({
|
|
759
783
|
$,
|
|
760
|
-
path:
|
|
784
|
+
path: id
|
|
785
|
+
? `/tasks/${id}`
|
|
786
|
+
: "/tasks",
|
|
761
787
|
method: "GET",
|
|
762
788
|
params,
|
|
763
789
|
});
|
|
@@ -775,7 +801,7 @@ export default {
|
|
|
775
801
|
} = opts;
|
|
776
802
|
return (await this._makeSyncRequest({
|
|
777
803
|
$,
|
|
778
|
-
path: "/
|
|
804
|
+
path: "/api/v1/tasks/completed/by_completion_date",
|
|
779
805
|
method: "POST",
|
|
780
806
|
payload: params,
|
|
781
807
|
})).items;
|
|
@@ -891,7 +917,7 @@ export default {
|
|
|
891
917
|
const { taskId } = params;
|
|
892
918
|
return this._makeRestRequest({
|
|
893
919
|
$,
|
|
894
|
-
path:
|
|
920
|
+
path: `/tasks/${taskId}/close`,
|
|
895
921
|
method: "POST",
|
|
896
922
|
});
|
|
897
923
|
},
|
|
@@ -909,7 +935,7 @@ export default {
|
|
|
909
935
|
const { taskId } = params;
|
|
910
936
|
return this._makeRestRequest({
|
|
911
937
|
$,
|
|
912
|
-
path:
|
|
938
|
+
path: `/tasks/${taskId}/reopen`,
|
|
913
939
|
method: "POST",
|
|
914
940
|
});
|
|
915
941
|
},
|
|
@@ -927,7 +953,7 @@ export default {
|
|
|
927
953
|
const { taskId } = data;
|
|
928
954
|
return this._makeRestRequest({
|
|
929
955
|
$,
|
|
930
|
-
path:
|
|
956
|
+
path: `/tasks/${taskId}`,
|
|
931
957
|
method: "DELETE",
|
|
932
958
|
});
|
|
933
959
|
},
|
|
@@ -1022,6 +1048,10 @@ export default {
|
|
|
1022
1048
|
$,
|
|
1023
1049
|
data = {},
|
|
1024
1050
|
} = opts;
|
|
1051
|
+
// Transform numeric color to string for v1 API
|
|
1052
|
+
if (data.color && typeof data.color === "number") {
|
|
1053
|
+
data.color = numericToString(data.color);
|
|
1054
|
+
}
|
|
1025
1055
|
const commands = [
|
|
1026
1056
|
{
|
|
1027
1057
|
type: "filter_add",
|
|
@@ -1048,6 +1078,10 @@ export default {
|
|
|
1048
1078
|
$,
|
|
1049
1079
|
data = {},
|
|
1050
1080
|
} = opts;
|
|
1081
|
+
// Transform numeric color to string for v1 API
|
|
1082
|
+
if (data.color && typeof data.color === "number") {
|
|
1083
|
+
data.color = numericToString(data.color);
|
|
1084
|
+
}
|
|
1051
1085
|
const commands = [
|
|
1052
1086
|
{
|
|
1053
1087
|
type: "filter_update",
|