Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

castle-chat-lib

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

castle-chat-lib - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

3

package.json
{
"name": "castle-chat-lib",
"version": "1.3.0",
"version": "1.4.0",
"description": "",

@@ -13,2 +13,3 @@ "main": "src/index.js",

"dependencies": {
"castle-api-client": "^6.0.0",
"jquery": "^3.3.1",

@@ -15,0 +16,0 @@ "lodash": "^4.17.11",

@@ -5,3 +5,6 @@ import Candy from './candy/candy';

import _ from 'lodash';
import CastleApiClient from 'castle-api-client';
export const API = CastleApiClient('https://api.castle.games');
const PRESENCE_DEBOUNCE_DELAY = 100;

@@ -75,2 +78,6 @@ const PRESENCE_DEBOUNCE_MAX_WAIT = 500;

async _debugSetTokenInStorageAsync() {
await API.client.setTokenAsync(this._token);
}
connect() {

@@ -129,6 +136,3 @@ if (this._chat) {

this._chat.Core.connect(
`${this._userId}@castle.games`,
this._token
);
this._chat.Core.connect(`${this._userId}@castle.games`, this._token);
}

@@ -187,11 +191,19 @@

sendMessage(channel, message) {
async sendMessageAsync(channel, message) {
try {
this._chat.Core.Action.Jabber.Room.Message(
`${channel}@conference.castle.games`,
message,
'groupchat',
null,
uuidv4()
let result = await API.graphqlAsync(
`
mutation($roomName: String!, $message: String!) {
sendChatMessage(roomName: $roomName, message: $message)
}
`,
{
roomName: channel,
message,
}
);
if (result.errors && result.errors.length) {
throw new Error(result.errors);
}
} catch (e) {

@@ -198,0 +210,0 @@ console.log('send message error');

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