pusher-chatkit-server
Advanced tools
Comparing version 0.9.0 to 0.9.1
# Changelog | ||
## [v0.9.1] 2018-01-26 | ||
### Additions | ||
- Added `getRoomMessages` example | ||
### Changes | ||
- `getRooms` now requires a `userId` parameter, which is used to generate the token that the request is made with | ||
- Updated `getRooms` example | ||
- Bumped pusher-platform-node dependency to 0.11.1 | ||
## [v0.9.0] 2018-01-16 | ||
@@ -7,3 +19,2 @@ | ||
- Removed permissions constants and permissions checking from the SDK. The API will return a sensible error if you provide an invalid permission name | ||
- Added `updateGlobalRoomPermissions` example | ||
@@ -15,2 +26,7 @@ | ||
### Removals | ||
- Removed permissions constants and permissions checking from the SDK. The API will return a sensible error if you provide an invalid permission name | ||
## [v0.8.3] 2018-01-04 | ||
@@ -17,0 +33,0 @@ |
{ | ||
"name": "pusher-chatkit-server", | ||
"description": "Pusher Chatkit server library", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"main": "./target/index.js", | ||
@@ -20,3 +20,3 @@ "license": "MIT", | ||
"jsonwebtoken": "^7.4.1", | ||
"pusher-platform-node": "~0.10.0" | ||
"pusher-platform-node": "~0.11.1" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
@@ -187,7 +187,12 @@ import { | ||
getRooms(): Promise<any> { | ||
getRooms(userId: string): Promise<any> { | ||
const jwt = this.generateAccessToken({ | ||
userId: userId, | ||
su: true, | ||
}); | ||
return this.apiInstance.request({ | ||
method: 'GET', | ||
path: `/rooms`, | ||
jwt: this.getServerToken(), | ||
jwt: jwt.token, | ||
}).then((res) => { | ||
@@ -194,0 +199,0 @@ return JSON.parse(res.body); |
@@ -55,3 +55,3 @@ import { Instance, AuthenticationResponse, AuthenticateOptions, BaseClient, TokenWithExpiry } from 'pusher-platform-node'; | ||
getRoomMessages(roomId: number, initialId: string, direction: string, limit: number): Promise<any>; | ||
getRooms(): Promise<any>; | ||
getRooms(userId: string): Promise<any>; | ||
createRoom(userId: string, options: CreateRoomOptions): Promise<any>; | ||
@@ -58,0 +58,0 @@ createRoomRole(name: string, permissions: Array<string>): Promise<void>; |
@@ -119,7 +119,11 @@ "use strict"; | ||
}; | ||
Chatkit.prototype.getRooms = function () { | ||
Chatkit.prototype.getRooms = function (userId) { | ||
var jwt = this.generateAccessToken({ | ||
userId: userId, | ||
su: true, | ||
}); | ||
return this.apiInstance.request({ | ||
method: 'GET', | ||
path: "/rooms", | ||
jwt: this.getServerToken(), | ||
jwt: jwt.token, | ||
}).then(function (res) { | ||
@@ -126,0 +130,0 @@ return JSON.parse(res.body); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
86372
811
+ Addedpusher-platform-node@0.11.1(transitive)
- Removedpusher-platform-node@0.10.0(transitive)
Updatedpusher-platform-node@~0.11.1