From e8e4d7fea804a48978b7bbca8951bd76041bd71c Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 7 Apr 2025 21:00:01 -0300 Subject: [PATCH 1/6] Package/pnpm bump --- components/todoist/package.json | 4 ++-- pnpm-lock.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/todoist/package.json b/components/todoist/package.json index 7b1e07329af32..8c401cc6930f0 100644 --- a/components/todoist/package.json +++ b/components/todoist/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/todoist", - "version": "0.1.3", + "version": "0.1.4", "description": "Pipedream Todoist Components", "main": "todoist.app.mjs", "keywords": [ @@ -10,7 +10,7 @@ "homepage": "https://pipedream.com/apps/todoist", "author": "Pipedream (https://pipedream.com/)", "dependencies": { - "@pipedream/platform": "^1.2.1", + "@pipedream/platform": "^3.0.3", "json-2-csv": "^3.15.1", "query-string": "^7.1.3", "tmp-promise": "^3.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index edcf12a2ab365..0989d5736160d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13091,8 +13091,8 @@ importers: components/todoist: dependencies: '@pipedream/platform': - specifier: ^1.2.1 - version: 1.6.6 + specifier: ^3.0.3 + version: 3.0.3 json-2-csv: specifier: ^3.15.1 version: 3.20.0 From 7f6a1786d127b1d7019ffb424c7dd8771278f4d8 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 7 Apr 2025 21:32:24 -0300 Subject: [PATCH 2/6] [partial] Adding 'due is recurring' prop --- components/todoist/actions/create-task/create-task.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/todoist/actions/create-task/create-task.mjs b/components/todoist/actions/create-task/create-task.mjs index 3f5dee2e0bd13..432d35724411a 100644 --- a/components/todoist/actions/create-task/create-task.mjs +++ b/components/todoist/actions/create-task/create-task.mjs @@ -120,6 +120,7 @@ export default { dueDate, dueDatetime, dueLang, + dueIsRecurring, assignee, } = this; const data = { @@ -135,6 +136,7 @@ export default { due_date: dueDate, due_datetime: dueDatetime, due_lang: dueLang, + due_is_recurring: dueIsRecurring, assignee_id: assignee, }; const resp = await this.todoist.createTask({ From 20f607b133dfeb3a33eec65e03c023e9eead499e Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 7 Apr 2025 22:31:13 -0300 Subject: [PATCH 3/6] Adding recurring date info alert prop --- components/todoist/actions/create-task/create-task.mjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/todoist/actions/create-task/create-task.mjs b/components/todoist/actions/create-task/create-task.mjs index 432d35724411a..1c4147cef1cf0 100644 --- a/components/todoist/actions/create-task/create-task.mjs +++ b/components/todoist/actions/create-task/create-task.mjs @@ -4,10 +4,15 @@ export default { key: "todoist-create-task", name: "Create Task", description: "Creates a task. [See the docs here](https://developer.todoist.com/rest/v2/#create-a-new-task)", - version: "0.0.4", + version: "0.0.5", type: "action", props: { todoist, + recurringInfoLabel: { + type: "alert", + alertType: "info", + 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 information.", + }, content: { propDefinition: [ todoist, @@ -120,7 +125,6 @@ export default { dueDate, dueDatetime, dueLang, - dueIsRecurring, assignee, } = this; const data = { @@ -136,7 +140,6 @@ export default { due_date: dueDate, due_datetime: dueDatetime, due_lang: dueLang, - due_is_recurring: dueIsRecurring, assignee_id: assignee, }; const resp = await this.todoist.createTask({ From 5869300be324893429621e9ebb4218b045c8c61c Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 7 Apr 2025 22:35:35 -0300 Subject: [PATCH 4/6] Text improvement --- components/todoist/actions/create-task/create-task.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/todoist/actions/create-task/create-task.mjs b/components/todoist/actions/create-task/create-task.mjs index 1c4147cef1cf0..77ca39b1649fd 100644 --- a/components/todoist/actions/create-task/create-task.mjs +++ b/components/todoist/actions/create-task/create-task.mjs @@ -11,7 +11,7 @@ export default { recurringInfoLabel: { type: "alert", alertType: "info", - 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 information.", + 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.", }, content: { propDefinition: [ From ea81c082046a2ea5828de57923f75db0d8f7c459 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 14 Apr 2025 21:14:51 -0300 Subject: [PATCH 5/6] pnpm --- pnpm-lock.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 52e4b2c255fe9..8c12a2e02aa99 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -962,8 +962,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/arlo: - specifiers: {} + components/arlo: {} components/aroflo: dependencies: @@ -5618,8 +5617,7 @@ importers: specifier: ^0.1.4 version: 0.1.6 - components/goqr_me: - specifiers: {} + components/goqr_me: {} components/gorgias: dependencies: From 114495053272f839266ec5ca4fe717949e0bf9db Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 22 Apr 2025 22:32:09 -0300 Subject: [PATCH 6/6] Reworking 'New Completed Task' to include recurring tasks --- .../sources/completed-task/completed-task.mjs | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/components/todoist/sources/completed-task/completed-task.mjs b/components/todoist/sources/completed-task/completed-task.mjs index 7a488726121e4..c44671f465a36 100644 --- a/components/todoist/sources/completed-task/completed-task.mjs +++ b/components/todoist/sources/completed-task/completed-task.mjs @@ -5,13 +5,36 @@ export default { key: "todoist-completed-task", name: "New Completed Task", description: "Emit new event for each completed task. [See the docs here](https://developer.todoist.com/sync/v8/#read-resources)", - version: "0.0.6", + version: "1.0.0", type: "source", dedupe: "unique", methods: { ...common.methods, - isElementRelevant(element) { - return element.checked; + _getLastDate() { + return this.db.get("lastDate"); + }, + _setLastDate(value) { + this.db.set("lastDate", value); + }, + async getSyncResult() { + const lastDate = this._getLastDate(); + const items = await this.todoist.getCompletedTasks({ + params: { + since: lastDate, + annotate_items: true, + }, + }); + + const newDate = new Date().toISOString(); + this._setLastDate(newDate); + + console.log(items); + return items; + }, + filterResults(syncResult) { + return syncResult + .filter((element) => + this.todoist.isProjectInList(element.project_id, this.selectProjects ?? [])); }, }, };