@pusher/chatkit-server
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -10,2 +10,11 @@ # Changelog | ||
## [1.2.0](https://github.com/pusher/chatkit-server-node/compare/1.1.0...1.2.0) | ||
### Additions | ||
- Async deletion methods. `asyncDeleteUser`, `getDeleteUserStatus`, | ||
`asyncDeleteRoom`, `getDeleteRoomStatus`. The `deleteRoom` and `deleteUser` | ||
methods should be considered deprecated, and will be removed in a future | ||
version. | ||
## [1.1.0](https://github.com/pusher/chatkit-server-node/compare/1.0.6...1.1.0) | ||
@@ -12,0 +21,0 @@ |
{ | ||
"name": "@pusher/chatkit-server", | ||
"description": "Pusher Chatkit server SDK", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"main": "target/src/index.js", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
{ | ||
"name": "@pusher/chatkit-server", | ||
"description": "Pusher Chatkit server SDK", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"main": "target/src/index.js", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -184,2 +184,11 @@ /// <reference types="node" /> | ||
} | ||
export interface AsyncDeleteRoomOptions { | ||
roomId: string; | ||
} | ||
export interface AsyncDeleteUserOptions { | ||
userId: string; | ||
} | ||
export interface AsyncDeleteJobOptions { | ||
jobId: string; | ||
} | ||
export interface User { | ||
@@ -196,2 +205,3 @@ id: string; | ||
cursorsInstance: Instance; | ||
schedulerInstance: Instance; | ||
instanceLocator: string; | ||
@@ -246,2 +256,5 @@ private tokenWithExpiry?; | ||
getReadCursorsForRoom(options: GetReadCursorsForRoomOptions): Promise<any>; | ||
asyncDeleteRoom(options: AsyncDeleteRoomOptions): Promise<any>; | ||
asyncDeleteUser(options: AsyncDeleteUserOptions): Promise<any>; | ||
getDeleteStatus(options: AsyncDeleteJobOptions): Promise<any>; | ||
apiRequest(options: GeneralRequestOptions): Promise<any>; | ||
@@ -248,0 +261,0 @@ authorizerRequest(options: GeneralRequestOptions): Promise<any>; |
@@ -38,2 +38,3 @@ "use strict"; | ||
const cursorsInstanceOptions = Object.assign({}, instanceOptions, { serviceName: "chatkit_cursors", serviceVersion: "v2" }); | ||
const schedulerInstanceOptions = Object.assign({}, instanceOptions, { serviceName: "chatkit_scheduler", serviceVersion: "v1" }); | ||
this.instanceLocator = instanceLocator; | ||
@@ -44,2 +45,3 @@ this.serverInstanceV2 = new platform_node_1.Instance(serverInstanceOptions("v2")); | ||
this.cursorsInstance = new platform_node_1.Instance(cursorsInstanceOptions); | ||
this.schedulerInstance = new platform_node_1.Instance(schedulerInstanceOptions); | ||
} | ||
@@ -593,2 +595,29 @@ // Token generation | ||
} | ||
asyncDeleteRoom(options) { | ||
return this.schedulerInstance | ||
.request({ | ||
method: "PUT", | ||
path: `/rooms/${encodeURIComponent(options.roomId)}`, | ||
jwt: this.getServerToken(), | ||
}) | ||
.then(res => JSON.parse(res.body)); | ||
} | ||
asyncDeleteUser(options) { | ||
return this.schedulerInstance | ||
.request({ | ||
method: "PUT", | ||
path: `/users/${encodeURIComponent(options.userId)}`, | ||
jwt: this.getServerToken(), | ||
}) | ||
.then(res => JSON.parse(res.body)); | ||
} | ||
getDeleteStatus(options) { | ||
return this.schedulerInstance | ||
.request({ | ||
method: "GET", | ||
path: `/status/${encodeURIComponent(options.jobId)}`, | ||
jwt: this.getServerToken(), | ||
}) | ||
.then(res => JSON.parse(res.body)); | ||
} | ||
// General requests | ||
@@ -595,0 +624,0 @@ apiRequest(options) { |
Sorry, the diff of this file is not supported yet
65201
957