@pipedream/todoist 0.3.0 → 0.3.2

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 (52) hide show
  1. package/actions/create-filter/create-filter.mjs +1 -1
  2. package/actions/create-label/create-label.mjs +1 -1
  3. package/actions/create-project/create-project.mjs +1 -1
  4. package/actions/create-project-comment/create-project-comment.mjs +1 -1
  5. package/actions/create-section/create-section.mjs +1 -1
  6. package/actions/create-task/create-task.mjs +1 -1
  7. package/actions/create-task-comment/create-task-comment.mjs +1 -1
  8. package/actions/delete-comment/delete-comment.mjs +1 -1
  9. package/actions/delete-filter/delete-filter.mjs +1 -1
  10. package/actions/delete-label/delete-label.mjs +1 -1
  11. package/actions/delete-project/delete-project.mjs +1 -1
  12. package/actions/delete-section/delete-section.mjs +1 -1
  13. package/actions/delete-task/delete-task.mjs +1 -1
  14. package/actions/export-tasks/export-tasks.mjs +3 -3
  15. package/actions/find-project/find-project.mjs +3 -3
  16. package/actions/find-task/find-task.mjs +2 -2
  17. package/actions/find-user/find-user.mjs +3 -3
  18. package/actions/get-label/get-label.mjs +1 -1
  19. package/actions/get-project/get-project.mjs +1 -1
  20. package/actions/get-project-comment/get-project-comment.mjs +1 -1
  21. package/actions/get-section/get-section.mjs +1 -1
  22. package/actions/get-task/get-task.mjs +1 -1
  23. package/actions/get-task-comment/get-task-comment.mjs +1 -1
  24. package/actions/import-tasks/import-tasks.mjs +3 -3
  25. package/actions/invite-user-to-project/invite-user-to-project.mjs +1 -1
  26. package/actions/list-filters/list-filters.mjs +3 -3
  27. package/actions/list-labels/list-labels.mjs +1 -1
  28. package/actions/list-project-comments/list-project-comments.mjs +1 -1
  29. package/actions/list-projects/list-projects.mjs +1 -1
  30. package/actions/list-sections/list-sections.mjs +1 -1
  31. package/actions/list-task-comments/list-task-comments.mjs +1 -1
  32. package/actions/list-uncompleted-tasks/list-uncompleted-tasks.mjs +1 -1
  33. package/actions/mark-task-completed/mark-task-completed.mjs +1 -1
  34. package/actions/move-task-to-section/move-task-to-section.mjs +1 -1
  35. package/actions/search-tasks/search-tasks.mjs +1 -1
  36. package/actions/uncomplete-task/uncomplete-task.mjs +2 -1
  37. package/actions/update-comment/update-comment.mjs +1 -1
  38. package/actions/update-filter/update-filter.mjs +1 -1
  39. package/actions/update-label/update-label.mjs +1 -1
  40. package/actions/update-project/update-project.mjs +1 -1
  41. package/actions/update-section/update-section.mjs +1 -1
  42. package/actions/update-task/update-task.mjs +1 -1
  43. package/package.json +2 -2
  44. package/sources/completed-task/completed-task.mjs +9 -9
  45. package/sources/incomplete-task/incomplete-task.mjs +1 -1
  46. package/sources/new-or-modified-project/new-or-modified-project.mjs +1 -1
  47. package/sources/new-or-modified-task/new-or-modified-task.mjs +1 -1
  48. package/sources/new-project/new-project.mjs +1 -1
  49. package/sources/new-section/new-section.mjs +1 -1
  50. package/sources/new-task/new-task.mjs +1 -1
  51. package/sources/sync-resources/sync-resources.mjs +1 -1
  52. package/todoist.app.mjs +44 -26
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-create-filter",
5
5
  name: "Create Filter",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-create-label",
5
5
  name: "Create Label",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-create-project",
5
5
  name: "Create Project",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-create-project-comment",
5
5
  name: "Create Project Comment",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-create-section",
5
5
  name: "Create Section",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-create-task",
5
5
  name: "Create Task",
6
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",
7
+ version: "0.0.9",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-create-task-comment",
5
5
  name: "Create Task Comment",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-delete-comment",
5
5
  name: "Delete Comment",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-delete-filter",
5
5
  name: "Delete Filter",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-delete-label",
5
5
  name: "Delete Label",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-delete-project",
5
5
  name: "Delete Project",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-delete-section",
5
5
  name: "Delete Section",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-delete-task",
5
5
  name: "Delete Task",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -1,13 +1,13 @@
1
- import todoist from "../../todoist.app.mjs";
2
1
  import fs from "fs";
3
- import { file } from "tmp-promise";
4
2
  import converter from "json-2-csv";
3
+ import { file } from "tmp-promise";
4
+ import todoist from "../../todoist.app.mjs";
5
5
 
6
6
  export default {
7
7
  key: "todoist-export-tasks",
8
8
  name: "Export Tasks",
9
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",
10
+ version: "0.1.5",
11
11
  annotations: {
12
12
  destructiveHint: false,
13
13
  openWorldHint: true,
@@ -4,9 +4,9 @@ export default {
4
4
  key: "todoist-find-project",
5
5
  name: "Find Project",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
- destructiveHint: false,
9
+ destructiveHint: true,
10
10
  openWorldHint: true,
11
11
  readOnlyHint: true,
12
12
  },
@@ -32,7 +32,7 @@ export default {
32
32
  name,
33
33
  createIfNotFound,
34
34
  } = this;
35
- const projects = await this.todoist.getProjects({
35
+ const { results: projects } = await this.todoist.getProjects({
36
36
  $,
37
37
  });
38
38
  let result = projects.find((project) => project.name == name);
@@ -4,9 +4,9 @@ export default {
4
4
  key: "todoist-find-task",
5
5
  name: "Find Task",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
- destructiveHint: false,
9
+ destructiveHint: true,
10
10
  openWorldHint: true,
11
11
  readOnlyHint: true,
12
12
  },
@@ -4,11 +4,11 @@ export default {
4
4
  key: "todoist-find-user",
5
5
  name: "Find User",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
- destructiveHint: true,
9
+ destructiveHint: false,
10
10
  openWorldHint: true,
11
- readOnlyHint: false,
11
+ readOnlyHint: true,
12
12
  },
13
13
  type: "action",
14
14
  props: {
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-get-label",
5
5
  name: "Get Label",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-get-project",
5
5
  name: "Get Project",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-get-project-comment",
5
5
  name: "Get Project Comment",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-get-section",
5
5
  name: "Get Section",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-get-task",
5
5
  name: "Get Task",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-get-task-comment",
5
5
  name: "Get Task Comment",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -1,12 +1,12 @@
1
- import todoist from "../../todoist.app.mjs";
2
- import converter from "json-2-csv";
3
1
  import { getFileStream } from "@pipedream/platform";
2
+ import converter from "json-2-csv";
3
+ import todoist from "../../todoist.app.mjs";
4
4
 
5
5
  export default {
6
6
  key: "todoist-import-tasks",
7
7
  name: "Import Tasks",
8
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",
9
+ version: "0.1.5",
10
10
  annotations: {
11
11
  destructiveHint: true,
12
12
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-invite-user-to-project",
5
5
  name: "Invite User To Project",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,11 +4,11 @@ export default {
4
4
  key: "todoist-list-filters",
5
5
  name: "List Filters",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
- destructiveHint: true,
9
+ destructiveHint: false,
10
10
  openWorldHint: true,
11
- readOnlyHint: false,
11
+ readOnlyHint: true,
12
12
  },
13
13
  type: "action",
14
14
  props: {
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-list-labels",
5
5
  name: "List Labels",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-list-project-comments",
5
5
  name: "List Project Comments",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-list-projects",
5
5
  name: "List Projects",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-list-sections",
5
5
  name: "List Sections",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-list-task-comments",
5
5
  name: "List Task Comments",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-list-uncompleted-tasks",
5
5
  name: "List Uncompleted Tasks",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-mark-task-completed",
5
5
  name: "Mark Task as Completed",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-move-task-to-section",
5
5
  name: "Move Task To Section",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-search-tasks",
5
5
  name: "Search Tasks",
6
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",
7
+ version: "0.0.6",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-uncomplete-task",
5
5
  name: "Uncomplete Task",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -18,6 +18,7 @@ export default {
18
18
  todoist,
19
19
  "project",
20
20
  ],
21
+ optional: false,
21
22
  },
22
23
  taskId: {
23
24
  propDefinition: [
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-update-comment",
5
5
  name: "Update Comment",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-update-filter",
5
5
  name: "Update Filter",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-update-label",
5
5
  name: "Update Label",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-update-project",
5
5
  name: "Update Project",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-update-section",
5
5
  name: "Update Section",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "todoist-update-task",
5
5
  name: "Update Task",
6
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",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/todoist",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Pipedream Todoist Components",
5
5
  "main": "todoist.app.mjs",
6
6
  "keywords": [
@@ -10,7 +10,7 @@
10
10
  "homepage": "https://pipedream.com/apps/todoist",
11
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
12
  "dependencies": {
13
- "@pipedream/platform": "^3.1.1",
13
+ "@pipedream/platform": "^3.3.0",
14
14
  "json-2-csv": "^5.5.9",
15
15
  "query-string": "^7.1.3",
16
16
  "tmp-promise": "^3.0.3",
@@ -5,7 +5,7 @@ export default {
5
5
  key: "todoist-completed-task",
6
6
  name: "New Completed Task",
7
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",
8
+ version: "1.0.3",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  methods: {
@@ -18,18 +18,18 @@ export default {
18
18
  },
19
19
  async getSyncResult() {
20
20
  const lastDate = this._getLastDate();
21
- const items = await this.todoist.getCompletedTasks({
22
- params: {
23
- since: lastDate,
24
- annotate_items: true,
25
- },
21
+ const newDate = new Date().toISOString();
22
+ const params = {
23
+ since: lastDate || newDate,
24
+ until: newDate,
25
+ };
26
+ const response = await this.todoist.getCompletedTasks({
27
+ params,
26
28
  });
27
29
 
28
- const newDate = new Date().toISOString();
29
30
  this._setLastDate(newDate);
30
31
 
31
- console.log(items);
32
- return items;
32
+ return response.items ?? [];
33
33
  },
34
34
  filterResults(syncResult) {
35
35
  return syncResult
@@ -5,7 +5,7 @@ export default {
5
5
  key: "todoist-incomplete-task",
6
6
  name: "New Incomplete Task",
7
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",
8
+ version: "0.1.3",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  props: {
@@ -5,6 +5,6 @@ export default {
5
5
  key: "todoist-new-or-modified-project",
6
6
  name: "New or Modified Project",
7
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",
8
+ version: "0.0.9",
9
9
  type: "source",
10
10
  };
@@ -5,6 +5,6 @@ export default {
5
5
  key: "todoist-new-or-modified-task",
6
6
  name: "New or Modified Task",
7
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",
8
+ version: "0.0.9",
9
9
  type: "source",
10
10
  };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "todoist-new-project",
6
6
  name: "New Project",
7
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",
8
+ version: "0.0.9",
9
9
  type: "source",
10
10
  dedupe: "greatest",
11
11
  };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "todoist-new-section",
6
6
  name: "New Section",
7
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",
8
+ version: "0.0.9",
9
9
  type: "source",
10
10
  dedupe: "greatest",
11
11
  methods: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "todoist-new-task",
6
6
  name: "New Task",
7
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",
8
+ version: "0.0.9",
9
9
  type: "source",
10
10
  dedupe: "greatest",
11
11
  };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "todoist-sync-resources",
6
6
  name: "New Sync Resources",
7
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",
8
+ version: "0.0.9",
9
9
  type: "source",
10
10
  props: {
11
11
  ...common.props,
package/todoist.app.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { axios } from "@pipedream/platform";
2
2
  import querystring from "query-string";
3
- import resourceTypes from "./common/resource-types.mjs";
4
- import colors, { numericToString } from "./common/colors.mjs";
5
3
  import { v4 as uuid } from "uuid";
4
+ import colors, { numericToString } from "./common/colors.mjs";
5
+ import resourceTypes from "./common/resource-types.mjs";
6
6
 
7
7
  export default {
8
8
  type: "app",
@@ -24,10 +24,11 @@ export default {
24
24
  "Filter for events that match one or more projects. Leave this blank to emit results for any project.",
25
25
  optional: true,
26
26
  async options() {
27
- return (await this.getProjects({})).map((project) => ({
27
+ const { results } = await this.getProjects({});
28
+ return results?.map((project) => ({
28
29
  label: project.name,
29
30
  value: project.id,
30
- }));
31
+ })) || [];
31
32
  },
32
33
  },
33
34
  project: {
@@ -36,7 +37,8 @@ export default {
36
37
  description: "Select a project to filter results by",
37
38
  optional: true,
38
39
  async options() {
39
- return (await this.getProjects({})).map((project) => ({
40
+ const { results } = await this.getProjects({});
41
+ return (results || []).map((project) => ({
40
42
  label: project.name,
41
43
  value: project.id,
42
44
  }));
@@ -48,11 +50,12 @@ export default {
48
50
  description: "Select a section to filter results by",
49
51
  optional: true,
50
52
  async options({ project }) {
51
- return (await this.getSections({
53
+ const { results } = await this.getSections({
52
54
  params: {
53
55
  project_id: project,
54
56
  },
55
- })).map((section) => ({
57
+ });
58
+ return (results || []).map((section) => ({
56
59
  label: section.name,
57
60
  value: section.id,
58
61
  }));
@@ -64,7 +67,8 @@ export default {
64
67
  description: "Select a label to filter results by",
65
68
  optional: true,
66
69
  async options() {
67
- return (await this.getLabels({})).map((label) => ({
70
+ const { results } = await this.getLabels({});
71
+ return (results || []).map((label) => ({
68
72
  label: label.name,
69
73
  value: label.id,
70
74
  }));
@@ -76,7 +80,8 @@ export default {
76
80
  description: "Select labels to add to the task.",
77
81
  optional: true,
78
82
  async options() {
79
- return (await this.getLabels({})).map((label) => label.name);
83
+ const { results } = await this.getLabels({});
84
+ return (results || []).map((label) => label.name);
80
85
  },
81
86
  },
82
87
  task: {
@@ -86,12 +91,13 @@ export default {
86
91
  async options({
87
92
  project, section,
88
93
  }) {
89
- return (await this.getActiveTasks({
94
+ const { results } = await this.getActiveTasks({
90
95
  params: {
91
96
  project_id: project,
92
97
  section_id: section,
93
98
  },
94
- })).map((task) => ({
99
+ });
100
+ return (results || []).map((task) => ({
95
101
  label: task.content,
96
102
  value: task.id,
97
103
  }));
@@ -104,25 +110,33 @@ export default {
104
110
  async options({
105
111
  project, prevContext,
106
112
  }) {
107
- const { offset = 0 } = prevContext;
113
+ const { cursor } = prevContext;
108
114
  const limit = 30;
115
+ const now = new Date();
116
+ const sinceDate = new Date(now);
117
+ sinceDate.setMonth(sinceDate.getMonth() - 3);
109
118
  const params = {
110
- offset,
111
119
  limit,
120
+ since: sinceDate.toISOString(),
121
+ until: now.toISOString(),
112
122
  };
123
+ if (cursor) {
124
+ params.cursor = cursor;
125
+ }
113
126
  if (project) {
114
127
  params.project_id = project;
115
128
  }
116
- const tasks = (await this.getCompletedTasks({
129
+ const response = await this.getCompletedTasks({
117
130
  params,
118
- })).map((task) => ({
131
+ });
132
+ const tasks = response.items.map((task) => ({
119
133
  label: task.content,
120
- value: task.task_id,
134
+ value: task.id,
121
135
  }));
122
136
  return {
123
137
  options: tasks,
124
138
  context: {
125
- offset: offset + limit,
139
+ cursor: response.next_cursor,
126
140
  },
127
141
  };
128
142
  },
@@ -132,7 +146,8 @@ export default {
132
146
  label: "Assignee",
133
147
  description: "The responsible user (if set, and only for shared tasks)",
134
148
  async options({ project }) {
135
- return (await this.getProjectCollaborators(project)).map((assignee) => ({
149
+ const { results } = await this.getProjectCollaborators(project);
150
+ return (results || []).map((assignee) => ({
136
151
  label: assignee.name,
137
152
  value: assignee.id,
138
153
  }));
@@ -165,12 +180,13 @@ export default {
165
180
  if (!project && !task) {
166
181
  return [];
167
182
  }
168
- return (await this.getComments({
183
+ const { results } = await this.getComments({
169
184
  params: {
170
185
  project_id: project,
171
186
  task_id: task,
172
187
  },
173
- })).map((comment) => ({
188
+ });
189
+ return (results || []).map((comment) => ({
174
190
  label: comment.content,
175
191
  value: comment.id,
176
192
  }));
@@ -507,7 +523,9 @@ export default {
507
523
  */
508
524
  async getProjectCollaborators(projectId) {
509
525
  if (!projectId) {
510
- return [];
526
+ return {
527
+ results: [],
528
+ };
511
529
  }
512
530
  return this._makeRestRequest({
513
531
  path: `/projects/${projectId}/collaborators`,
@@ -799,12 +817,12 @@ export default {
799
817
  $,
800
818
  params = {},
801
819
  } = opts;
802
- return (await this._makeSyncRequest({
820
+ return this._makeRestRequest({
803
821
  $,
804
- path: "/api/v1/tasks/completed/by_completion_date",
805
- method: "POST",
806
- payload: params,
807
- })).items;
822
+ path: "/tasks/completed/by_completion_date",
823
+ method: "GET",
824
+ params,
825
+ });
808
826
  },
809
827
  /**
810
828
  * Create a new task