diff --git a/components/todoist/actions/create-task/create-task.mjs b/components/todoist/actions/create-task/create-task.mjs index 3f5dee2e0bd13..77ca39b1649fd 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 examples and information.", + }, content: { propDefinition: [ todoist, 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/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 ?? [])); }, }, }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ca86868b73242..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: @@ -13190,8 +13188,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