-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug description
The SDK seems to be broken in version 2.0.0. Or, the examples should be updated if there are major changes, as they're currently not working.
Is reproducible
Yes
To reproduce
Executing the following example:
import { TodoistApi } from '@doist/todoist-api-typescript'
import * as dotenv from 'dotenv';
dotenv.config();
if (!process.env.TODOIST_API_TOKEN) {
throw new Error('Missing TODOIST_API_TOKEN environment variable')
}
const api = new TodoistApi(process.env.TODOIST_API_TOKEN)
api.getProjects()
.then((projects) => console.log(projects))
.catch((error) => console.error(error));
Results in the following error:
ValidationError: Validation failed:
{
"parentId": "Expected string, but was null"
}.
Object should match { parentId?: string; }
at new ValidationError (project/node_modules/runtypes/lib/errors.js:22:28)
at Object.check (project/node_modules/runtypes/lib/runtype.js:37:19)
at validateProject (project/node_modules/@doist/todoist-api-typescript/dist/utils/validators.js:14:28)
at Array.map (<anonymous>)
at validateProjectArray (project/node_modules/@doist/todoist-api-typescript/dist/utils/validators.js:18:18)
at TodoistApi.<anonymous> (project/node_modules/@doist/todoist-api-typescript/dist/TodoistApi.js:201:85)
at step (project/node_modules/@doist/todoist-api-typescript/dist/TodoistApi.js:33:23)
at Object.next (project/node_modules/@doist/todoist-api-typescript/dist/TodoistApi.js:14:53)
at fulfilled (project/node_modules/@doist/todoist-api-typescript/dist/TodoistApi.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5) {
code: 'CONTENT_INCORRECT',
details: { parentId: 'Expected string, but was null' }
}
Version information:
- Package version: 2.0.0
Additional information
Downgrading to 1.7.0, the SDK works fine.
dubisdev and iancmy
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working