New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pusher-chatkit-server

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pusher-chatkit-server - npm Package Compare versions

Comparing version 0.11.1 to 0.11.2

6

CHANGELOG.md
# Changelog
## [0.11.2] 2018-04-17
### Additions
- Added `update_user` function and example
## [0.11.1] 2018-04-10

@@ -4,0 +10,0 @@

2

package.json
{
"name": "pusher-chatkit-server",
"description": "Pusher Chatkit server library",
"version": "0.11.1",
"version": "0.11.2",
"main": "./target/index.js",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -116,2 +116,9 @@ import {

export interface UpdateUserOptions {
id: string;
name?: string;
avatarURL?: string;
customData?: any;
}
export interface CreateRoomOptions {

@@ -234,2 +241,24 @@ creatorId: string;

updateUser(options: UpdateUserOptions): Promise<any> {
const jwt = this.generateAccessToken({
su: true,
userId: options.id,
});
let updatePayload: any = {};
if (options.name) { updatePayload.name = options.name };
if (options.avatarURL) { updatePayload.avatar_url = options.avatarURL };
if (options.customData) { updatePayload.custom_data = options.customData };
return this.apiInstance.request({
method: 'PUT',
path: `/users/${options.id}`,
headers: {
'Content-Type': 'application/json'
},
body: updatePayload,
jwt: jwt.token,
}).then(() => {})
}
deleteUser(options: DeleteUserOptions): Promise<void> {

@@ -236,0 +265,0 @@ return this.apiInstance.request({

@@ -91,2 +91,8 @@ import { AuthenticationResponse, AuthenticateOptions, AuthenticatePayload, BaseClient, Instance, TokenWithExpiry } from 'pusher-platform-node';

}
export interface UpdateUserOptions {
id: string;
name?: string;
avatarURL?: string;
customData?: any;
}
export interface CreateRoomOptions {

@@ -124,2 +130,3 @@ creatorId: string;

createUsers(options: CreateUsersOptions): Promise<any>;
updateUser(options: UpdateUserOptions): Promise<any>;
deleteUser(options: DeleteUserOptions): Promise<void>;

@@ -126,0 +133,0 @@ getUsers(): Promise<any>;

@@ -94,2 +94,30 @@ "use strict";

};
Chatkit.prototype.updateUser = function (options) {
var jwt = this.generateAccessToken({
su: true,
userId: options.id,
});
var updatePayload = {};
if (options.name) {
updatePayload.name = options.name;
}
;
if (options.avatarURL) {
updatePayload.avatar_url = options.avatarURL;
}
;
if (options.customData) {
updatePayload.custom_data = options.customData;
}
;
return this.apiInstance.request({
method: 'PUT',
path: "/users/" + options.id,
headers: {
'Content-Type': 'application/json'
},
body: updatePayload,
jwt: jwt.token,
}).then(function () { });
};
Chatkit.prototype.deleteUser = function (options) {

@@ -96,0 +124,0 @@ return this.apiInstance.request({

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc