0.1.0 • Published 8 years ago

tigris-nodejs-sdk v0.1.0

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
8 years ago

Jogral Tigris NodeJS SDK

Build Status

This is the official NodeJS SDK for Jogral Tigris. This SDK will let you execute most of the functionality you would from the API, and is an alternative to the stock UI.

Why use this?

Suppose you want to extend the functionality/features of Tigris, e.g. integrating with your company intranet or with a third party service. This SDK is a layer around the REST-like API powering Tigris, leaving you to write software and not worry about forming your HTTP requests--just use native features!

We at Jogral are already using this API inside of Tigris. Must of the interaction between the UI and the API uses this SDK as a layer between the two, so you should be able to use this on the client and server side.

Installation

Coming soon.

Probably,

npm install tigris-nodejs-sdk

Usage

Coming soon!

To get started:

import { Client } from 'tigris-nodejs-sdk'

let client = Client(username, password, baseURL=baseURL)
console.log('My Username: {0}'.format(client.session().user().shortname))

Getting courses:

# Get all courses
client.courses()

# You can use a dict as query params
client.courses({slug: 'test'})

# You can create/retrieve/update, too
## New course
const courseObj = {title: 'title', ...}
let course = client.course(courseObj) # Course is not created yet, but object is.
course = course.save(true) # Now course is added to Tigris, and has an ID.
console.log(course.id())

## Get/edit course
course = client.course({id: 1}).get()
course.status = 1
updatedCourse = course.save()

More coming soon.

Contributing

You should be able to git started by cloning our repo. Once you've cloned your repo, go to the repo path and run

npm install tigris-sdk-env

NOTE: You should be sure to have some flavor of NodeJS 8. Anything earlier might work, but we've only tested against NodeJS 8+.

Testing

Test coverage is still largely in progress. We haven't decided the best test tool for JS. There are many test frameworks, but the question is whether or not they effectively meet out needs.

Support

Development, support, etc. is managed directly by Jogral. If you want to contact us directly, drop us a line at code@jogral.io. We welcome you to open issues directly through GitHub and to use email for questions.

License

The Tigris NodeJS SDK is licensed under the Apache License 2.0. See LICENSE for details.

TODO

  • Increase test coverage to 100%.
  • Make it clearer when sessions are expired.
  • Create documentation from docstrings.
  • Incorporate upcoming authorization updates to API into SDK.
  • Flesh out roadmap.