|
1 | 1 | # TODOIST-REST-CLIENT v.0.0.3 |
2 | 2 |
|
3 | | -## Working on |
| 3 | +## _A simple todoist-rest-api client_ |
4 | 4 |
|
5 | | -- New resources: Projects & Sections !! |
| 5 | +## Important changes |
| 6 | + |
| 7 | +- Now `create` function returns a boolean: true if the resource was created successfully and false if not. |
6 | 8 | - New general functions: |
7 | | - - Find by ID |
8 | | - - Get JSONs => implementing methods for getting JSON (not content/name arrays) |
| 9 | + - Get JSONs => implemented methods for getting JSON (not content/name arrays) |
| 10 | +- Now you can create projects! |
| 11 | + |
| 12 | +```js |
| 13 | +import TDSClient, { Project } from "todoist-rest-client"; |
| 14 | +const myClient = new TDSClient(apiToken); |
| 15 | +myClient.create({ type: "project" }, new Project({ name: "New Project" })); |
| 16 | +``` |
| 17 | + |
| 18 | +# TODOIST-REST-CLIENT |
| 19 | + |
| 20 | +## _A simple todoist-rest-api client_ |
| 21 | + |
| 22 | +A todoist rest API client with: |
| 23 | + |
| 24 | +## Implemented Features |
| 25 | + |
| 26 | +- get Today Tasks |
| 27 | +- get All Tasks/Projects |
| 28 | +- create task/project (see examples) |
| 29 | + |
| 30 | +I'll implement more features in the future like: |
| 31 | + |
| 32 | +- new resources |
| 33 | +- more tasks functions |
| 34 | + |
| 35 | +> something important |
| 36 | +
|
| 37 | +## Installation |
| 38 | + |
| 39 | +For installing the client: |
| 40 | + |
| 41 | +```sh |
| 42 | +npm install todoist-rest-client |
| 43 | +``` |
| 44 | + |
| 45 | +## USE |
| 46 | + |
| 47 | +```js |
| 48 | +import TDSClient from "todoist-rest-client"; |
| 49 | + |
| 50 | +const Client = new TDSClient(API_TOKEN); //get an api token from your todoist integrations page |
| 51 | +``` |
| 52 | + |
| 53 | +## API |
| 54 | + |
| 55 | +### Client.create({type}, todoistResource) |
| 56 | + |
| 57 | +This method allows creating todoist resources (tasks, projects, ...). |
| 58 | +If no params are given, it creates a _No_Content_ task in the inbox. |
| 59 | +If given type param, creates default todoistResourceType. |
| 60 | + |
| 61 | +```js |
| 62 | +//Creating a todoist resource |
| 63 | +import TDSClient from "todoist-rest-client"; |
| 64 | + |
| 65 | +const Client = new TDSClient(API_TOKEN); //get an api token from your todoist integrations page |
| 66 | + |
| 67 | +Client.create({ type: "task" }); |
| 68 | +``` |
| 69 | + |
| 70 | +## Todoist Resources |
| 71 | + |
| 72 | +Todoist resources are classes that allow you to easyly create resource objects for todoist. |
| 73 | +They can be imported directly from the package: |
| 74 | + |
| 75 | +```js |
| 76 | +import {Task, Project} from "todoist-rest-client"; |
| 77 | + |
| 78 | +const myTask = new Task({....}); |
| 79 | +const myProject = new Project({....}); |
| 80 | +``` |
| 81 | + |
| 82 | +### Task |
| 83 | + |
| 84 | +Tasks are the basic pieces of todoist. Each task has a lot of properties: content, date, priority... |
| 85 | + |
| 86 | +### Project |
| 87 | + |
| 88 | +Projects are the way to organize tasks in a simple way. Each project has, at least, a `name` property. |
| 89 | + |
| 90 | +### Future Implementations |
| 91 | + |
| 92 | +In future versions of this package, I'd like to implement more resources to work with sections, comments and all the Todoist's stuff. |
9 | 93 |
|
10 | 94 | ## License |
11 | 95 |
|
|
0 commit comments