Skip to content

Commit

Permalink
Updated to version 0.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan Botea committed Oct 27, 2015
1 parent dd83526 commit d92458b
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 50 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 0.2.6

* Changed all methods that delete resources to use DELETE HTTP method
* Fixed a bug on deathorizing admin
* Context operations also send messages to workers in order to notifiy clients
* API uses TelepatLogger instead of console.log
* `context` is not required if subscribing/unsubscribing from user or context builtin models

# 0.2.5

* Fixed `/user/update` when updating password
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ or by setting up environment variables (this method is the most convenient):

* `TP_MSG_QUE`: Name of the messaging client you want to use. Should be the same as the exported variable in
telepat-models
* `TP_KFK_HOST`: Kafka (zooekeeper) server (if you are using the Kafka Messaging Client)
* `TP_KFK_PORT`: Kafka (zooekeeper) server port (if you are using the Kafka Messaging Client)
* `TP_REDIS_HOST`: Redis server
* `TP_REDIS_PORT`: Redis server port
* `TP_MAIN_DB`: Name of the main database which to use. Should be the same as the exported variable in telepat-models
* `TP_ES_HOST`: Elasticsearch server (if you are using the ES database adapter)
* `TP_ES_PORT`: Elasticsearch server port (if you are using the ES database adapter)
* `TP_PW_SALT`: Password salt used for hashing passwords

**Important**: You need to set up the other config variables specified in the `telepat-models` README file for resources
that you're using.

## Testing

To run just the tests using mocha (make sure you have installed globally `npm install mocha`):
Expand Down
6 changes: 3 additions & 3 deletions controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ router.use('/contexts',
* @apiDescription Get all contexts
* @apiName AdminGetContexts
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
* @deprecated
*
* @apiHeader {String} Content-type application/json
Expand Down Expand Up @@ -86,7 +86,7 @@ router.use('/schemas',
* @apiDescription Gets the model schema for an application
* @apiName AdminGetSchemas
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
* @deprecated
*
* @apiHeader {String} Content-type application/json
Expand Down Expand Up @@ -136,7 +136,7 @@ router.use('/users',
* @apiDescription Gets all users of the application
* @apiName AdminGetUsers
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
* @deprecated
*
* @apiHeader {String} Content-type application/json
Expand Down
12 changes: 6 additions & 6 deletions controllers/admin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var Models = require('telepat-models');
* @apiDescription Authenticates an admin and returns the authorization token
* @apiName AdminAuthenticate
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
*
Expand Down Expand Up @@ -82,7 +82,7 @@ router.post('/login', function (req, res, next) {
* @apiDescription Creates a new admin
* @apiName AdminAdd
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
*
Expand Down Expand Up @@ -137,7 +137,7 @@ router.use('/me', security.tokenValidation);
* @apiDescription Gets information about the logged admin
* @apiName AdminMe
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -167,7 +167,7 @@ router.use('/update', security.tokenValidation);
Every property in the request body is used to update the admin.
* @apiName AdminUpdate
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -232,7 +232,7 @@ router.use('/delete', security.tokenValidation);
* @apiDescription Deletes the currently logged admin.
* @apiName AdminDelete
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand All @@ -254,7 +254,7 @@ router.use('/apps', security.tokenValidation);
* @apiDescription Lists the application for the current admin
* @apiName AdminApps
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down
10 changes: 5 additions & 5 deletions controllers/admin/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ router.use('/add', security.tokenValidation);
The request body should contain the application itself.
* @apiName AdminAppAdd
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -70,7 +70,7 @@ router.use('/remove',
* @apiDescription Removes an application from the admin.
* @apiName AdminAppRemove
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -116,7 +116,7 @@ router.use('/update',
* @apiDescription Updates an app
* @apiName AdminAppUpdate
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -186,7 +186,7 @@ router.use('/authorize',
* @apiDescription Authorizes an admin to an application
* @apiName AdminAuthorize
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -259,7 +259,7 @@ router.use('/deauthorize',
* @apiDescription Deauthorizes an admin from an application
* @apiName AdminDeauthorize
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down
10 changes: 5 additions & 5 deletions controllers/admin/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ router.use('/',
* @apiDescription Get all contexts
* @apiName AdminGetContexts
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -56,7 +56,7 @@ router.get('/all', function (req, res, next) {
* @apiDescription Retrieves a context
* @apiName AdminGetContext
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -118,7 +118,7 @@ router.use('/add',
* @apiDescription Creates a new context
* @apiName AdminCreateContext
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -180,7 +180,7 @@ router.use('/remove',
* @apiDescription Removes a context and all associated objects
* @apiName AdminRemoveContext
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -244,7 +244,7 @@ router.use('/update',
* @apiDescription Updates the context object
* @apiName AdminUpdateContext
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down
6 changes: 3 additions & 3 deletions controllers/admin/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ router.use('/all',
* @apiDescription Gets the model schema for an application
* @apiName AdminGetSchemas
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -65,7 +65,7 @@ router.use('/update',
* @apiDescription Updates the model schema
* @apiName AdminUpdateSchema
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -109,7 +109,7 @@ router.use('/remove_model',
* @apiDescription Removes a model from the application (all items of this type will be deleted)
* @apiName AdminRemoveAppModel
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down
6 changes: 3 additions & 3 deletions controllers/admin/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ router.use('/all',
* @apiDescription Gets all users of the application
* @apiName AdminGetUsers
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -64,7 +64,7 @@ router.use('/update',
* @apiDescription Updates an user from an application
* @apiName AdminUpdateUser
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -153,7 +153,7 @@ router.use('/delete',
* @apiDescription Deletes an user from an application
* @apiName AdminDeleteUser
* @apiGroup Admin
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down
4 changes: 2 additions & 2 deletions controllers/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ router.use(security.tokenValidation);
* @apiDescription Get all contexts
* @apiName GetContexts
* @apiGroup Context
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization The authorization token obtained in the login endpoint.
Expand Down Expand Up @@ -56,7 +56,7 @@ router.get('/all', function (req, res, next) {
* @apiDescription Retrieves a context
* @apiName GetContext
* @apiGroup Context
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization The authorization token obtained in the login endpoint. Should have the format: <i>Bearer $TOKEN</i>
Expand Down
2 changes: 1 addition & 1 deletion controllers/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ router.use(security.deviceIdValidation);
* to search for a device with this UDID and return the device ID.
* @apiName DeviceRegister
* @apiGroup Device
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} X-BLGREQ-UDID Custom header containing the device ID if you want to update device info, or
Expand Down
12 changes: 6 additions & 6 deletions controllers/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var validateContext = function(appId, context, callback) {
* Subsequent subscription on the same channel and filter will have no effect but will return the objects.
* @apiName ObjectSubscribe
* @apiGroup Object
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -211,7 +211,7 @@ router.post('/subscribe', function(req, res, next) {
* @apiDescription Unsubscribe to an object or a collection of objects (by a filter)
* @apiName ObjectUnsubscribe
* @apiGroup Object
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -316,7 +316,7 @@ router.post('/unsubscribe', function(req, res, next) {
* @apiDescription Creates a new object. The object is not immediately created.
* @apiName ObjectCreate
* @apiGroup Object
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -417,7 +417,7 @@ router.post('/create', function(req, res, next) {
* @apiDescription Updates an existing object. The object is not updated immediately.
* @apiName ObjectUpdate
* @apiGroup Object
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -526,7 +526,7 @@ router.post('/update', function(req, res, next) {
* @apiDescription Deletes an object. The object is not immediately deleted.
* @apiName ObjectDelete
* @apiGroup Object
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down Expand Up @@ -598,7 +598,7 @@ router.delete('/delete', function(req, res, next) {
* @apiDescription Gets the object count of a certain filter/subscription
* @apiName ObjectCount
* @apiGroup Object
* @apiVersion 0.2.3
* @apiVersion 0.2.6
*
* @apiHeader {String} Content-type application/json
* @apiHeader {String} Authorization
Expand Down
Loading

0 comments on commit d92458b

Please sign in to comment.