@zerodot/todoist 1.0.0 → 1.0.1

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,14 +1,18 @@
1
1
  # @zerodot/todoist
2
2
 
3
- Todoist node package for zerodot.
3
+ <img src="https://raw.githubusercontent.com/zerodot-io/nodes/main/packages/todoist/todoist.svg" alt="Todoist logo" width="48" height="48">
4
4
 
5
- ## Credential
5
+ Create and manage tasks, projects, sections, labels, and comments in Todoist. Get, create, update, close, reopen, move, and delete items. The node calls the Todoist API v1 with an API token.
6
6
 
7
- Create a **Todoist API Token** credential with an API token from Todoist.
7
+ ## Install
8
8
 
9
- - API tokens can be found in Todoist under **Settings > Integrations > Developer**.
9
+ In zerodot, go to **System > Nodes** and install **Todoist**.
10
10
 
11
- ## Operations
11
+ Manual: install `@zerodot/todoist` where the web app and the worker run, and add it to `ZERODOT_NODE_PACKAGES`.
12
+
13
+ ## Nodes
14
+
15
+ ### Todoist (`todoist.api`)
12
16
 
13
17
  - **Task**: Get Many, Get, Create, Update, Close, Reopen, Move, Delete
14
18
  - **Project**: Get Many, Get, Create, Update, Delete
@@ -16,13 +20,52 @@ Create a **Todoist API Token** credential with an API token from Todoist.
16
20
  - **Label**: Get Many, Get, Create, Update, Delete
17
21
  - **Comment**: Get Many, Get, Create, Update, Delete
18
22
 
19
- ## Notes
23
+ ### Behavior notes
24
+
25
+ - **API.** The node uses the Todoist API v1 under `https://api.todoist.com/api/v1`.
26
+ - **IDs.** IDs are text. Get, update, delete, close, reopen, and move need the ID of the item: **Task ID**, **Project ID**, **Section ID**, **Label ID**, or **Comment ID**. The node encodes an ID in the URL path, so a slash in an ID cannot change the path.
27
+ - **Task Create.** **Content** is required. The other fields are optional:
28
+ - **Description**, **Project ID**, **Section ID**, **Parent ID**, and **Assignee ID**
29
+ - **Labels**: label names
30
+ - **Priority**: 1 is P4 (normal), 2 is P3 (medium), 3 is P2 (high), and 4 is P1 (urgent)
31
+ - **Due String**: for example `tomorrow at 12`
32
+ - **Due Date**: `YYYY-MM-DD`. **Due Datetime**: RFC3339. **Due Language**: for example `en`
33
+ - **Duration** and **Duration Unit** (`minute` or `day`)
34
+ - **Deadline Date**: `YYYY-MM-DD`
35
+ - **Task Update.** The node sends only the fields that you fill in. **Labels** replace the full label list of the task. To move a task, use **Move**. Update cannot change the project, section, or parent.
36
+ - **Task Move.** Set exactly one of **Project ID**, **Section ID**, or **Parent ID**. Otherwise the node fails before it calls Todoist.
37
+ - **Task Get Many.** The filters are **Project ID**, **Section ID**, **Parent ID**, **Label Filter** (a label name), and **IDs** (a list of task IDs). There is no filter text. Each filter is sent as its own value.
38
+ - **Project Create.** **Name** is required. Other fields: **Description**, **Color** (a color name), **Favorite**, and **View Style** (`list`, `board`, or `calendar`).
39
+ - **Section Create.** **Name** and **Project ID** are required. Other fields: **Order** and **Description**.
40
+ - **Section Get Many.** The filter is **Project ID**.
41
+ - **Section Update.** Fields: **Name**, **Section Order**, **Collapsed**, and **Description**. **Order** is sent as the section order when **Section Order** is empty. If both are set, **Section Order** wins.
42
+ - **Label Create.** **Name** is required. Other fields: **Color**, **Order**, and **Favorite**.
43
+ - **Comment Get Many and Create.** Set exactly one of **Task ID** or **Project ID**. Otherwise the node fails. **Create** also needs **Content**.
44
+ - **Comment Update.** Needs **Comment ID** and **Content**.
45
+ - **Limits.** **Limit** is from 1 to 200 for the Get Many operations. A run makes one call, so the node returns one page. A list answer has `results` and `next_cursor`. To get the next page, set **Cursor** to `next_cursor` from the previous answer.
46
+ - **Output.** The node returns the JSON answer of Todoist. When Todoist sends no content, the output is `{ "success": true }`. This happens for Close, Reopen, and Delete.
47
+ - **Errors.** When Todoist returns an error status, the node fails. The message has the error text from Todoist and a hint. The API token is never in the message.
48
+ - **Destructive operations.** **Delete** removes a task, project, section, label, or comment. **Close** completes a task.
49
+ - **Binary data.** None.
50
+ - **Timeout.** The **Timeout** setting is in milliseconds. It is 30000 by default and up to 300000.
51
+ - **Retries.** None.
52
+
53
+ ## Credentials
54
+
55
+ ### Todoist API Token (`todoist.apiToken`)
56
+
57
+ - **API Token** (`apiToken`): the API token from Todoist. This value is secret. Find it in Todoist under **Settings > Integrations > Developer**.
58
+
59
+ The token is sent as a Bearer token in the `Authorization` header of each request. The package does not set token scopes.
60
+
61
+ The credential is tested with `GET /api/v1/projects?limit=1`.
62
+
63
+ Setup:
64
+
65
+ 1. In Todoist, go to **Settings > Integrations > Developer**.
66
+ 2. Copy your API token.
67
+ 3. In zerodot, create a **Todoist API Token** credential and paste the token.
68
+
69
+ ## License
20
70
 
21
- - Todoist API base URL: `https://api.todoist.com`
22
- - This package uses Todoist API v1 endpoints under `/api/v1/...`.
23
- - IDs are opaque strings.
24
- - Paginated list endpoints return `{ results: [...], next_cursor: string | null }`. Use `cursor` and `limit` (1-200) to page through results.
25
- - Task, project, section, label, and comment updates use POST requests and only send fields you provide. Task label updates replace the full label list.
26
- - Task move requires exactly one destination: `projectId`, `sectionId`, or `parentId`.
27
- - Comment get many/create requires exactly one of `taskId` or `projectId`.
28
- - Close, reopen, and delete operations return `{ success: true }` when Todoist responds with no content.
71
+ AGPL-3.0-only
package/dist/index.cjs CHANGED
@@ -707,6 +707,7 @@ function buildRequest(config) {
707
707
  const description = optionalString(config.description);
708
708
  if (name !== void 0) body.name = name;
709
709
  if (config.sectionOrder !== void 0) body.section_order = config.sectionOrder;
710
+ else if (config.order !== void 0) body.section_order = config.order;
710
711
  if (config.isCollapsed !== void 0) body.is_collapsed = config.isCollapsed;
711
712
  if (description !== void 0) body.description = description;
712
713
  return {
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@zerodot/todoist",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Create and manage tasks, projects, sections, labels, and comments in Todoist.",
5
5
  "license": "AGPL-3.0-only",
6
+ "homepage": "https://github.com/zerodot-io/nodes/tree/main/packages/todoist",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/zerodot-io/nodes.git",