quiq-chat
Advanced tools
Comparing version 1.10.4 to 1.10.5
@@ -321,3 +321,3 @@ 'use strict'; | ||
var version = "1.10.4"; | ||
var version = "1.10.5"; | ||
@@ -484,2 +484,19 @@ // | ||
// | ||
var MessageTypes = { | ||
// eslint-disable-line import/prefer-default-export | ||
TEXT: 'Text', | ||
CHAT_MESSAGE: 'ChatMessage', | ||
JOIN: 'Join', | ||
LEAVE: 'Leave', | ||
REGISTER: 'Register', | ||
BURN_IT_DOWN: 'BurnItDown', | ||
AGENT_TYPING: 'AgentTyping' | ||
}; | ||
var MAX_SOCKET_CONNECTION_ATTEMPTS = 20; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
@@ -491,2 +508,3 @@ | ||
var ie9Ping = void 0; | ||
var connectionCount = 0; | ||
@@ -535,2 +553,11 @@ var buildRequest = function buildRequest(socketUrl) { | ||
var connectSocket = function connectSocket(builder) { | ||
// Check that maximum retries not exceeded; increment connection count | ||
if (connectionCount >= MAX_SOCKET_CONNECTION_ATTEMPTS) { | ||
if (callbacks$1.onConnectionLoss) { | ||
callbacks$1.onConnectionLoss(); | ||
} | ||
throw new Error('Maximum socket connection attempts exceeded.'); | ||
} | ||
connectionCount++; | ||
var socketUrl = builder.socketUrl, | ||
@@ -627,15 +654,2 @@ websocketCallbacks = builder.callbacks; | ||
// | ||
var MessageTypes = { | ||
// eslint-disable-line import/prefer-default-export | ||
TEXT: 'Text', | ||
CHAT_MESSAGE: 'ChatMessage', | ||
JOIN: 'Join', | ||
LEAVE: 'Leave', | ||
REGISTER: 'Register', | ||
BURN_IT_DOWN: 'BurnItDown', | ||
AGENT_TYPING: 'AgentTyping' | ||
}; | ||
var _this$1 = undefined; | ||
@@ -642,0 +656,0 @@ |
{ | ||
"name": "quiq-chat", | ||
"version": "1.10.4", | ||
"version": "1.10.5", | ||
"description": "Library to help with network requests to create a webchat client for Quiq Messaging", | ||
@@ -5,0 +5,0 @@ "main": "build/quiq-chat.js", |
@@ -25,2 +25,4 @@ // @flow | ||
export const MAX_SOCKET_CONNECTION_ATTEMPTS = 20; | ||
export const noAgentsAvailableClass = 'noAgentsAvailable'; |
@@ -7,2 +7,3 @@ // @flow | ||
import {version} from '../package.json'; | ||
import {MAX_SOCKET_CONNECTION_ATTEMPTS} from './appConstants'; | ||
import type { | ||
@@ -19,2 +20,3 @@ AtmosphereRequest, | ||
let ie9Ping: number; | ||
let connectionCount: number = 0; | ||
@@ -63,2 +65,11 @@ const buildRequest = (socketUrl: string) => { | ||
export const connectSocket = (builder: AtmosphereConnectionBuilder) => { | ||
// Check that maximum retries not exceeded; increment connection count | ||
if (connectionCount >= MAX_SOCKET_CONNECTION_ATTEMPTS) { | ||
if (callbacks.onConnectionLoss) { | ||
callbacks.onConnectionLoss(); | ||
} | ||
throw new Error('Maximum socket connection attempts exceeded.'); | ||
} | ||
connectionCount++; | ||
const {socketUrl, callbacks: websocketCallbacks} = builder; | ||
@@ -65,0 +76,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
274903
33
3209