Skip to content
This repository has been archived by the owner on Jul 19, 2018. It is now read-only.

Commit

Permalink
Add authentication documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Mazzuola committed Mar 23, 2016
1 parent bbb7114 commit 3bda68e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,24 @@ var totalItems = productsArray.totalItems
var pageNumber = productsArray.pageNumber
```

# Client

Contains all the instantiated resources classes

**Parameters**

- `args` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Configuration object, possible properties are `username`, `password` and `token`

**Examples**

```javascript
var client = new cloudesire.Client({
username: 'myUser',
password: 'thePassword',
token: 'insteadOfThePasswordICanPassAToken'
})
```

# Category

**Extends BaseResource**
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"order": ["Options", "PaginatedResponse", "Category", "Product", "ProductVersion"]
"order": ["Options", "PaginatedResponse", "Client", "Category", "Product", "ProductVersion"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"compile": "babel src -d lib && browserify src/client.js -t [babelify --no-sourceMaps] -p [minifyify --no-map] -s cloudesire -o lib/client.web.js",
"prepublish": "npm run compile",
"docs": "cat README.md.template > README.md && documentation build src/resources/*.js -f md -c config.json >> README.md",
"docs": "cat README.md.template > README.md && documentation build src/client.js src/resources/*.js -f md -c config.json >> README.md",
"test": "npm run eslint && npm run compile && npm run mocha && npm run phantomjs",
"mocha": "istanbul cover _mocha -- --compilers js:babel-register -R spec test/flow.spec.js && cat ./coverage/lcov.info | coveralls",
"phantomjs": "mocha-phantomjs --ignore-ssl-errors=true test/flow.spec.html",
Expand Down
11 changes: 11 additions & 0 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ import Category from './resources/Category'

const BASE_URL = 'https://backend.cloudesire.com/api'

/**
* Contains all the instantiated resources classes
* @constructor
* @param {object} args Configuration object, possible properties are `username`, `password` and `token`
* @example
* var client = new cloudesire.Client({
* username: 'myUser',
* password: 'thePassword',
* token: 'insteadOfThePasswordICanPassAToken'
* })
*/
export default class Client {
constructor(args) {
const {baseUrl, username, password, token} = args
Expand Down

0 comments on commit 3bda68e

Please sign in to comment.