ticktick-api icon indicating copy to clipboard operation
ticktick-api copied to clipboard

add: getStatus() and postTask() methods

Open ndom91 opened this issue 4 years ago • 0 comments

Hey nice start to this cli!

I added methods for getStatus() which will return you, among other things, the projectId for your inbox. I also added a basic postTask() method for adding tasks. I added the jsdoc notation for both so hopefully it should be self explanatory.

Some notes though:

  • projects that have an emoji selected as their icon, get this emoji prepended to the name which is returned, which makes it impossible to lookup projects by their name
  • I only exposed a few options for adding tasks in the methods arguments, not sure what people would want to set so maybe we can adjust these. I set defaults for everything but title and projectId, those are the only required fields.
  • TickTick seems to send an Email alerting of a new signin from an "unknown device" on every run of the cli, which is super annoying. Have you found a way to get around that? I tried setting the referer of the webapp, a browser user-agent, their "x-device" object, nothign worked :(
  • Also I made the demo script executable as a script directly on the cli, so you can just run ./ticktick-demo.js, for example. I also added it as an npm script as demo, i.e. npm run demo

Otherwise, great stuff! Keep up the good work!

ndom91 avatar Feb 14 '21 22:02 ndom91