Skip to content

Commit 7ffd01b

Browse files
authored
feat!: switch to v9 API (#35)
* Rename v8 to v9 * Make changes for v9 sync api * Update package.json
1 parent b729686 commit 7ffd01b

File tree

9 files changed

+4315
-149
lines changed

9 files changed

+4315
-149
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![npm version](https://badge.fury.io/js/todoist.svg)](https://badge.fury.io/js/todoist)
44

5-
This module implements v8 of Todoist Sync API described [here](https://developer.todoist.com/sync/v8/)
5+
This module implements v9 of Todoist Sync API described [here](https://developer.todoist.com/sync/v9/)
66

77
## Installation
88

@@ -19,7 +19,7 @@ yarn add todoist
1919
## Usage
2020

2121
```javascript
22-
const Todoist = require('todoist').v8
22+
const Todoist = require('todoist').v9
2323
const todoist = Todoist(process.env.TODOIST_API_KEY)
2424

2525
;(async () => {

examples/simple.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* simple.js
33
*/
44

5-
const Todoist = require('../').v8
5+
const Todoist = require('../').v9
66
const api = Todoist(process.env.TODOIST_API_KEY)
77

88
;(async () => {

examples/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
* simple.js
33
*/
44

5-
import { v8 as Todoist, TodoistV8Types } from '..'
5+
import { v9 as Todoist, TodoistV9Types } from '..'
66

77
const api = Todoist(process.env.TODOIST_API_KEY)
88

9-
const handleItem = (item: TodoistV8Types.Item) => {
9+
const handleItem = (item: TodoistV9Types.Item) => {
1010
/* … Do something with a Todoist-Item */
1111
}
1212

1313
;(async () => {
1414
await api.sync()
1515

16-
const items /* : TodoistV8Types.Item[] */ = api.items.get()
16+
const items /* : TodoistV9Types.Item[] */ = api.items.get()
1717
items.map(handleItem)
1818

19-
const projects /* : TodoistV8Types.Project[] */ = api.projects.get()
19+
const projects /* : TodoistV9Types.Project[] */ = api.projects.get()
2020
projects.map(handleItem) // fails, as an item is not compatible with a project
2121
})()

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "todoist",
3-
"version": "0.5.1",
4-
"description": "Todoist Sync API v8",
3+
"version": "1.0.0",
4+
"description": "Todoist Sync API v9",
55
"homepage": "https://github.com/romgrk/node-todoist",
66
"bugs": {
77
"url": "https://github.com/romgrk/node-todoist/issues"

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Todoist as TodoistV8 } from './v8'
2-
import * as TodoistV8Types from './v8-types'
1+
import { Todoist as TodoistV9 } from './v9'
2+
import * as TodoistV9Types from './v9-types'
33

44
// export V8 as the current version
5-
export const Todoist = TodoistV8
5+
export const Todoist = TodoistV9
66

77
// create backwards compatibility list
8-
export const v8 = TodoistV8
8+
export const v9 = TodoistV9
99
// export Types as well
10-
export { TodoistV8Types }
10+
export { TodoistV9Types }

0 commit comments

Comments
 (0)