@pipedream/todoist 0.1.3 → 0.2.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/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Overview
2
2
 
3
- With the Todoist API, you can build a variety of applications and tools to help
4
- you manage your to-do lists and tasks. Here are just a few examples of what you
5
- can build:
6
-
7
- - A to-do list application that allows you to manage your tasks and to-dos in
8
- one place.
9
- - A task management tool that helps you keep track of your tasks and to-dos.
10
- - A tool that helps you prioritize your tasks and to-dos.
11
- - A tool that helps you track your progress on your tasks and to-dos.
3
+ The Todoist API unlocks the potential to automate task management with precision. With Pipedream, you can craft workflows that react to events in Todoist, like task completions or due date changes, or drive actions in Todoist, such as creating tasks or updating projects. By integrating Todoist with Pipedream, you can seamlessly connect your to-do list with other apps to streamline your productivity, manage tasks based on triggers from other services, or compile reports on your task management patterns.
4
+
5
+ # Example Use Cases
6
+
7
+ - **Task Completion Notifications**: Send a notification through Slack or email when a high-priority task is completed in Todoist. This keeps your team in sync and immediately alerts members of critical task progress.
8
+
9
+ - **Calendar Syncing**: Automatically create a Google Calendar event when a new task with a due date is added to Todoist. This ensures you never miss a deadline and integrates your task list with your personal or work calendar.
10
+
11
+ - **GitHub Issue Tracking**: Whenever a new GitHub issue is reported, create a corresponding task in Todoist and assign it to the relevant team member. This bridges the gap between issue tracking and personal task management.
@@ -4,10 +4,15 @@ export default {
4
4
  key: "todoist-create-task",
5
5
  name: "Create Task",
6
6
  description: "Creates a task. [See the docs here](https://developer.todoist.com/rest/v2/#create-a-new-task)",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
8
  type: "action",
9
9
  props: {
10
10
  todoist,
11
+ recurringInfoLabel: {
12
+ type: "alert",
13
+ alertType: "info",
14
+ content: "To create a recurring task, use the `Due String` prop with a value such as `every week`. [See the Todoist documentation on recurring dates](https://www.todoist.com/help/articles/introduction-to-recurring-dates-YUYVJJAV) for more examples and information.",
15
+ },
11
16
  content: {
12
17
  propDefinition: [
13
18
  todoist,
@@ -7,7 +7,7 @@ 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 Docs](https://developer.todoist.com/rest/v2/#get-active-tasks)",
10
- version: "0.0.3",
10
+ version: "0.1.0",
11
11
  type: "action",
12
12
  props: {
13
13
  todoist,
@@ -27,7 +27,7 @@ export default {
27
27
  project_id: project,
28
28
  },
29
29
  });
30
- const csv = await converter.json2csvAsync(tasks);
30
+ const csv = converter.json2csv(tasks);
31
31
 
32
32
  const { path } = await file({
33
33
  postfix: ".csv",
@@ -1,12 +1,12 @@
1
1
  import todoist from "../../todoist.app.mjs";
2
- import fs from "fs";
3
2
  import converter from "json-2-csv";
3
+ import { getFileStream } from "@pipedream/platform";
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 Docs](https://developer.todoist.com/sync/v9/#add-an-item)",
9
- version: "0.0.3",
9
+ version: "0.1.0",
10
10
  type: "action",
11
11
  props: {
12
12
  todoist,
@@ -37,8 +37,13 @@ export default {
37
37
  project,
38
38
  } = this;
39
39
 
40
- const fileContents = (await fs.promises.readFile(path)).toString();
41
- const tasks = await converter.csv2jsonAsync(fileContents);
40
+ const stream = await getFileStream(path);
41
+ const chunks = [];
42
+ for await (const chunk of stream) {
43
+ chunks.push(chunk);
44
+ }
45
+ const fileContents = Buffer.concat(chunks).toString();
46
+ const tasks = converter.csv2json(fileContents);
42
47
  // CREATE TASKS
43
48
  const data = tasks.map((task) => ({
44
49
  content: task.content,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/todoist",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "Pipedream Todoist Components",
5
5
  "main": "todoist.app.mjs",
6
6
  "keywords": [
@@ -10,8 +10,8 @@
10
10
  "homepage": "https://pipedream.com/apps/todoist",
11
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
12
  "dependencies": {
13
- "@pipedream/platform": "^1.2.1",
14
- "json-2-csv": "^3.15.1",
13
+ "@pipedream/platform": "^3.1.0",
14
+ "json-2-csv": "^5.5.9",
15
15
  "query-string": "^7.1.3",
16
16
  "tmp-promise": "^3.0.3",
17
17
  "uuid": "^8.3.2"
@@ -5,13 +5,36 @@ 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 docs here](https://developer.todoist.com/sync/v8/#read-resources)",
8
- version: "0.0.6",
8
+ version: "1.0.0",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
13
- isElementRelevant(element) {
14
- return element.checked;
13
+ _getLastDate() {
14
+ return this.db.get("lastDate");
15
+ },
16
+ _setLastDate(value) {
17
+ this.db.set("lastDate", value);
18
+ },
19
+ async getSyncResult() {
20
+ const lastDate = this._getLastDate();
21
+ const items = await this.todoist.getCompletedTasks({
22
+ params: {
23
+ since: lastDate,
24
+ annotate_items: true,
25
+ },
26
+ });
27
+
28
+ const newDate = new Date().toISOString();
29
+ this._setLastDate(newDate);
30
+
31
+ console.log(items);
32
+ return items;
33
+ },
34
+ filterResults(syncResult) {
35
+ return syncResult
36
+ .filter((element) =>
37
+ this.todoist.isProjectInList(element.project_id, this.selectProjects ?? []));
15
38
  },
16
39
  },
17
40
  };
package/todoist.app.mjs CHANGED
@@ -255,8 +255,8 @@ export default {
255
255
  },
256
256
  path: {
257
257
  type: "string",
258
- label: "File Path",
259
- description: "Path to .csv file containing task data. Enter a static value (e.g., `/tmp/myFile.csv`) or reference prior step exports via the `steps` object (e.g., `{{steps.export_tasks.$return_value}}`).",
258
+ label: "File Path or URL",
259
+ description: "The .csv file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.csv`)",
260
260
  },
261
261
  },
262
262
  methods: {