Giter Club home page Giter Club logo

wunderlist-api's Introduction

πŸ‘‹πŸ»πŸ“• Bye and thank you!

On 6th May, 2020, Wunderlist has now shut down. The lists will no longer sync across devices and the webapp is no longer available. For that reason the project will be archived, thank's everyone who used and helps the project along the time!

Wunderlist-api

πŸ“• Wunderlist in a simple way.


NPM version Dependency Status devDependency Status

Installation

[sudo] npm install --save wunderlist-api

Changelog

  • 1.0.0 - ES6 MODULES! You can use Wunderlist-api with new sintax based in ES6, based in Class and features ES6!
  • 0.2.2 - The names of some methods have changed from version 0.2.x, please see the new names from the need.

Docs

Concepts

There are some parameters that are needed to operate certain methods, among all, some are rather odd, such as the revision, that is the amount of change that this task note, user, list, comment, subtask, in short, anything was modified, by default, it comes with the value 1. When required this parameter, you must enter the value of the current revision and not the following number. For example, to delete a user from the list that was newly created, I pass the current value of revision in case the value 1. For more information on types of parameters or any other matter, please visit the official site Wunderlist.

Usage

Authorization

To access the information have 2 data, the first the access token and the Client ID, this information is available here.

  • accessToken - string
  • clientId - string
'use strict';

import Wunderlist from 'wunderlist-api';

const wunderlist = new Wunderlist({
  clientId: 'Your Client ID',
  accessToken: 'Your Access Token'
})
// => authenticated

All the following methods may be accessed in the same way, only changing the parameter when it becomes necessary, show only an example that can be repeated after any other. The method is based on the concept of promises.

Universal Exampler: for all methods is REQUIRED use .then() for get response!

// authentication
wunderlist.method(parameters)
  .then( response => {
    // response
  })
  .catch( error => {
    // handle error
  });

User

User information
wunderlist.user()
Avatar
  • userId: integer
  • size: integer (optional)
  • fallback: boolean (optional)
wunderlist.avatar(userId, size, fallback)

Lists

Get All lists
wunderlist.getLists()
Get specified list
  • listId: integer
wunderlist.getList(listId)
Make a list from state (public or private)
  • listId: integer
  • revision: integer
  • public: boolean
wunderlist.avatar(listId, revision, public)
Create List
  • title: string
wunderlist.createList(title)
Update List
  • listId: integer
  • revision: integer
  • title: string
wunderlist.updateList(listId, revision, title)
Delete List
  • listId: integer
  • revision: integer
wunderlist.deleteList(listId, revision)
Users authorized in list
  • listId: integer
wunderlist.listUsers(listId)

Notes

Get notes from list
  • listId: integer
wunderlist.notesList(listId)
Get notes from task
  • taskId: integer
wunderlist.notesTask(taskId)
Create note
  • taskId: integer
  • content: string
wunderlist.createNote(taskId, content)
Delete note
  • noteId: integer
  • revision: integer
wunderlist.deleteNote(noteId, revision)

Tasks

Get all tasks
  • listId: integer
wunderlist.getTasks(listId)
Get tasks for state
  • listId: integer
  • state: boolean (completed or incompleted)
wunderlist.getTasksForState(listId, state)
Get specified task
  • taskId: integer
wunderlist.getTask(taskId)
Create task
  • listId: integer
  • title: string
  • state: boolean
  • starred: boolean
wunderlist.createTask(listId, title, state, starred)
Delete Task
  • taskId: integer
  • revision: integer
wunderlist.deleteTask(taskId, revision)

Subtasks

Get subtask from list
  • taskId: integer
wunderlist.subtaskList(taskId)
Get completed subtasks from list
  • listId: integer
  • completed: boolean
wunderlist.subtaskListState(listId, completed)
Get subtask from task
  • taskId: integer
wunderlist.subtaskComment(taskId)
Get completed subtask from task
  • taskId: integer
  • completed: boolean
wunderlist.subtaskCommentState(taskId, completed)
Create subtask
  • taskId: integer
  • title: string
  • completed: boolean
wunderlist.createSubstask(taskId, title, completed)
Delete subtask
  • subtaskId: integer
  • revision: integer
wunderlist.deleteSubtask(subtaskId, revision)

Task Comments

Get comments from Task
  • taskId: integer
wunderlist.commentsTaks(taskId)
Get comments from Lists
  • listId: integer
wunderlist.commentsList(listId)
Create Comment
  • taskId: integer
  • text: string
wunderlist.createComment(taskId, text)

Membership

Get Membership
wunderlist.getMembership()
Add member to list
  • user_id: integer
  • listId: string
  • muted: boolean
wunderlist.addMember(user_id, listId, muted)
Remove a Member from a List
  • user_id: integer
  • revision: integer
wunderlist.removeMember(user_id, revision)

Contributing

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am "Add some feature"
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request :D

For more information on types of parameters or any other matter, please visit the official site Wunderlist.

License MIT @ 2016 Felipe Sousa

wunderlist-api's People

Contributors

dependabot[bot] avatar felipesousa avatar okachanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wunderlist-api's Issues

Broken in Node 8.9.3 (stable)

I'm afraid the ES6 modules are breaking the npm-module in node v8.9.3

➜  node --version
v8.9.3
➜  node index.js                                       
./node_modules/wunderlist-api/build/index.js:524
export default Wunderlist;
^^^^^^

SyntaxError: Unexpected token export

Even with the experimental flag on, it doesn't work:

➜  node --experimental-modules index.js
(node:94262) ExperimentalWarning: The ESM module loader is experimental.
index.js:11
import WunderlistAPI from 'wunderlist-api';
^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:80:10)

And if you'll try babel with prefixes (2015 or 2016) it doesn't work as well.

➜ npm start
> babel-node index.js --presets es2015,stage-2

./node_modules/wunderlist-api/build/index.js:524
export default Wunderlist;
^^^^^^

SyntaxError: Unexpected token export

[issue]: error when run build script

When the script build is executed the prompt return a dependecies error:

> tsc -p tsconfig.json && rollup -c rollup.config.js

node_modules/@types/jest/index.d.ts:484:51 - error TS2307: Cannot find module 'jest-diff'.

484             diff(a: any, b: any, options?: import("jest-diff").DiffOptions): string | null;
                                                      ~~~~~~~~~~~

node_modules/@types/jest/index.d.ts:538:44 - error TS2307: Cannot find module 'pretty-format'.

538     type SnapshotSerializerPlugin = import('pretty-format').Plugin;
                                               ~~~~~~~~~~~~~~~

[setup]: setup Jest

Acceptance criteria:

  • Add support to Jest
  • Add script to run and collect coverage;

[setup]: Setup Github Actions

Acceptance Criteria:

  • Automated pipelines in GitHub actions;
  • Publish Docs on github pages
  • run tests, build and publish the project version each time when merging with master

more details here.

[feature]: auth

Acceptance criteria:

  • create auth class
  • define request base headers
  • create tests cases

authentication error

hi guys. thanks for publishing your project! :)

when trying to authenticate with my clientID/accessToken I get an error saying:

body: '{"error":{"type":"server_error","translation_key":"api_error_unknown","message":"An unknown server error occurred","authentication":["missing"]}}' }

here's my code:

"use strict";

const Wunderlist = require("wunderlist-api");

const wunderlist = new Wunderlist({
  clientID: "xxx",
  accessToken: "xxx"
});

// authentication
wunderlist
  .user()
  .then(response => {
    // response
    console.log(response);
  })
  .catch(error => {
    // handle error
  });

what am i doing wrong?

[docs]: Update the Readme.md

Acceptance Criteria:

  • section: the project
  • #21
  • section: how to use
  • section: features/endpoints;
  • section: contribute
  • section: credits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.