Socket
Socket
Sign inDemoInstall

@pusher/platform

Package Overview
Dependencies
Maintainers
9
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pusher/platform - npm Package Compare versions

Comparing version 0.15.5 to 0.16.0

86

CHANGELOG.md

@@ -1,18 +0,37 @@

# Change Log
# Changelog
This project adheres to [Semantic Versioning Scheme](http://semver.org)
## Unreleased
---
## [v0.15.5] 2018-11-19
## [Unreleased](https://github.com/pusher/pusher-platform-js/compare/0.16.0...HEAD)
## [0.16.0](https://github.com/pusher/pusher-platform-js/compare/0.15.6...0.16.0) - 2018-12-18
### Fixes
- Makes WebSockets and subscriptions reconnect more reliably
### Changes
- Subscriptions will now default to retrying, rather than not, if the error that caused the close isn't of an expected form
## [0.15.6](https://github.com/pusher/pusher-platform-js/compare/0.15.5...0.15.6) - 2018-12-05
### Fixes
- Reconnections and subscription retries now occur as expected when the websocket transport receives a close message
## [0.15.5](https://github.com/pusher/pusher-platform-js/compare/0.15.3...0.15.5) - 2018-11-19
- Adopt package in to the pusher org as `@pusher/platform`
## [v0.15.3] 2018-11-16
## [0.15.3](https://github.com/pusher/pusher-platform-js/compare/0.15.2...0.15.3) - 2018-11-16
- Work around Chrome taking 60 seconds to close a broken websocket by disposing of
the registered callbacks and proceeding immediately with a new one
### Fixes
## [v0.15.2] 2018-10-12
- Work around Chrome taking 60 seconds to close a broken websocket by disposing of the registered callbacks and proceeding immediately with a new one
## [0.15.2](https://github.com/pusher/pusher-platform-js/compare/0.15.1...0.15.2) - 2018-10-12
### Changes

@@ -22,3 +41,3 @@

## [v0.15.1] 2018-04-10
## [0.15.1](https://github.com/pusher/pusher-platform-js/compare/0.15.0...0.15.1) - 2018-04-10

@@ -29,3 +48,3 @@ ### Additions

## [v0.15.0] 2018-03-07
## [0.15.0](https://github.com/pusher/pusher-platform-js/compare/0.14.0...0.15.0) - 2018-03-07

@@ -40,5 +59,4 @@ ### Changes

## [0.14.0](https://github.com/pusher/pusher-platform-js/compare/0.13.2...0.14.0) - 2017-12-07
## [v0.14.0] 2017-12-07
### Changes

@@ -48,5 +66,4 @@

## [0.13.2](https://github.com/pusher/pusher-platform-js/compare/0.13.1...0.13.2) - 2017-12-05
## [v0.13.2] 2017-12-05
### Changes

@@ -56,5 +73,4 @@

## [0.13.1](https://github.com/pusher/pusher-platform-js/compare/0.13.0...0.13.1) - 2017-12-05
## [v0.13.1] 2017-12-05
### Changes

@@ -64,5 +80,4 @@

## [0.13.0](https://github.com/pusher/pusher-platform-js/compare/0.12.4...0.13.0) - 2017-11-28
## [v0.13.0] 2017-11-28
### Changes

@@ -75,3 +90,3 @@

## [v0.12.4] 2017-11-24
## [0.12.4](https://github.com/pusher/pusher-platform-js/compare/0.12.3...0.12.4) - 2017-11-24

@@ -83,3 +98,3 @@ ### Fixed

## [v0.12.3] 2017-11-22
## [0.12.3](https://github.com/pusher/pusher-platform-js/compare/0.12.2...0.12.3) - 2017-11-22

@@ -91,3 +106,3 @@ ### Fixed

## [v0.12.2] 2017-11-22
## [0.12.2](https://github.com/pusher/pusher-platform-js/compare/0.12.1...0.12.2) - 2017-11-22

@@ -99,3 +114,3 @@ ### Changes

## [v0.12.1] 2017-11-21
## [0.12.1](https://github.com/pusher/pusher-platform-js/compare/0.12.0...0.12.1) - 2017-11-21

@@ -107,3 +122,3 @@ ### Changes

## [v0.12.0] 2017-11-17
## [0.12.0](https://github.com/pusher/pusher-platform-js/compare/0.11.1...0.12.0) - 2017-11-17

@@ -126,3 +141,3 @@ ### Changes

## [v0.11.1] 2017-11-03
## [0.11.1](https://github.com/pusher/pusher-platform-js/compare/0.11.0...0.11.1) - 2017-11-03

@@ -133,9 +148,7 @@ ### Fixes

## [v0.11.0] 2017-11-03
## [0.11.0](https://github.com/pusher/pusher-platform-js/compare/0.10.0...0.11.0) - 2017-11-03
### Changes
This is quite big change since we added `websockets`
as basic transport for all subscriptions. On the other
hand there are no changes on public interfaces (library is using different transport internally).
This is quite big change since we added `websockets` as basic transport for all subscriptions. On the other hand there are no changes on public interfaces (the SDK is using a different transport internally).

@@ -145,3 +158,3 @@ - Added `websockets` as basic transport for all subscriptions

## [v0.10.0] 2017-10-27
## [0.10.0](https://github.com/pusher/pusher-platform-js/compare/0.9.2...0.10.0) - 2017-10-27

@@ -157,3 +170,3 @@ ### Changes

## [v0.9.2] 2017-10-06
## [0.9.2](https://github.com/pusher/pusher-platform-js/compare/0.9.0...0.9.2) - 2017-10-06

@@ -165,6 +178,5 @@ ### Fixes

## [v0.9.0] 2017-09-14
## [0.9.0](https://github.com/pusher/pusher-platform-js/compare/0.7.0...0.9.0) - 2017-09-14
Refactored a lot of stuff internally, some API changes. This is a big release.
There will be an additional document describing how subscriptions are constructed, and how they work "under the hood".
Refactored a lot of stuff internally, some API changes. This is a big release. There will be an additional document describing how subscriptions are constructed, and how they work "under the hood".

@@ -190,3 +202,3 @@ ### Changes

## [v0.7.0] 2017-07-19
## [0.7.0](https://github.com/pusher/pusher-platform-js/compare/0.6.1...0.7.0) - 2017-07-19

@@ -198,3 +210,3 @@ ### Changes

## [v0.6.1] 2017-07-10
## [0.6.1](https://github.com/pusher/pusher-platform-js/compare/0.6.0...0.6.1) - 2017-07-10

@@ -206,3 +218,3 @@ ### Fixes

## [v0.6.0] 2017-07-05
## [0.6.0](https://github.com/pusher/pusher-platform-js/compare/0.5.2...0.6.0) - 2017-07-05

@@ -215,2 +227,4 @@ ### Changes

_.. prehistory_
---
Older releases are not covered by this changelog.

@@ -28,4 +28,4 @@ import { Logger } from './logger';

subscribeNonResuming(path: string, headers: ElementsHeaders, listeners: SubscriptionListeners, retryStrategyOptions: RetryStrategyOptions, tokenProvider?: TokenProvider): Subscription;
private infoHeaders();
private makeRequest(options);
private infoHeaders;
private makeRequest;
}

@@ -14,3 +14,3 @@ import { BaseClient, BaseClientOptions } from './base-client';

import { createTransportStrategy } from './transports';
export { BaseClient, BaseClientOptions, ConsoleLogger, createResumingStrategy, createRetryingStrategy, createRetryStrategyOptionsOrDefault, createTokenProvidingStrategy, createTransportStrategy, DoNotRetry, ElementsHeaders, EmptyLogger, ErrorResponse, executeNetworkRequest, HOST_BASE, Instance, Logger, NetworkError, RawRequestOptions, RequestOptions, responseToHeadersObject, ResumableSubscribeOptions, RetryStrategyResult, Retry, RetryStrategyOptions, RetryResolution, sendRawRequest, SubscribeOptions, Subscription, SubscriptionEvent, SubscriptionListeners, TokenProvider, XhrReadyState };
export { BaseClient, BaseClientOptions, ConsoleLogger, createResumingStrategy, createRetryingStrategy, createRetryStrategyOptionsOrDefault, createTokenProvidingStrategy, createTransportStrategy, DoNotRetry, ElementsHeaders, EmptyLogger, ErrorResponse, executeNetworkRequest, HOST_BASE, Instance, Logger, NetworkError, RawRequestOptions, RequestOptions, responseToHeadersObject, ResumableSubscribeOptions, RetryStrategyResult, Retry, RetryStrategyOptions, RetryResolution, sendRawRequest, SubscribeOptions, Subscription, SubscriptionEvent, SubscriptionListeners, TokenProvider, XhrReadyState, };
declare const _default: {

@@ -17,0 +17,0 @@ BaseClient: typeof BaseClient;

@@ -42,3 +42,3 @@ import { BaseClient } from './base-client';

subscribeResuming(options: ResumableSubscribeOptions): Subscription;
private absPath(relativePath);
private absPath;
}

@@ -6,3 +6,3 @@ export declare enum LogLevel {

WARNING = 4,
ERROR = 5,
ERROR = 5
}

@@ -24,4 +24,4 @@ export interface Logger {

error(...items: any[]): void;
private log(logFunction, level, items);
private errorAwareLog(logFunction, item, loggerSignature);
private log;
private errorAwareLog;
}

@@ -28,0 +28,0 @@ export declare class EmptyLogger implements Logger {

@@ -16,2 +16,6 @@ export declare type ElementsHeaders = {

}
export declare class ProtocolError {
error: string;
constructor(error: string);
}
export declare enum XhrReadyState {

@@ -22,3 +26,3 @@ UNSENT = 0,

LOADING = 3,
DONE = 4,
DONE = 4
}

@@ -28,3 +28,3 @@ import { Logger } from './logger';

private logger;
private retryUnsafeRequests;
private retryUnsafeRequests?;
private initialTimeoutMillis;

@@ -38,4 +38,3 @@ private maxTimeoutMillis;

attemptRetry(error: any): RetryStrategyResult;
private shouldSafeRetry(error);
private calulateMillisToRetry();
private calculateMillisToRetry;
}

@@ -9,3 +9,3 @@ import { ElementsHeaders } from '../network';

ENDING = 3,
ENDED = 4,
ENDED = 4
}

@@ -17,4 +17,4 @@ export default class HttpTransport implements SubscriptionTransport {

subscribe(path: string, listeners: SubscriptionListeners, headers: ElementsHeaders): Subscription;
private createXHR(baseURL, options);
private setJSONHeaderIfAppropriate(xhr, options);
private createXHR;
private setJSONHeaderIfAppropriate;
}

@@ -0,1 +1,2 @@

import { Logger } from '../logger';
import { ElementsHeaders } from '../network';

@@ -7,3 +8,3 @@ import { Subscription, SubscriptionListeners, SubscriptionTransport } from '../subscription';

Closing = 2,
Closed = 3,
Closed = 3
}

@@ -23,20 +24,21 @@ export default class WebSocketTransport implements SubscriptionTransport {

private lastSentPingID;
constructor(host: string);
private logger;
constructor(host: string, logger: Logger);
subscribe(path: string, listeners: SubscriptionListeners, headers: ElementsHeaders): Subscription;
unsubscribe(subID: number): void;
private connect();
private close(error?);
private tryReconnectIfNeeded();
private subscribePending(path, listeners, headers, subID?);
private getMessage(messageType, id, path?, headers?);
private sendMessage(message);
private subscription(subID);
private receiveMessage(event);
private validateMessage(message);
private onOpenMessage(message, subID, subscriptionListeners);
private onEventMessage(eventMessage, subscriptionListeners);
private onEOSMessage(eosMessage, subID, subscriptionListeners);
private onCloseMessage(closeMessage);
private onPongMessage(message);
private onPingMessage(message);
private connect;
private close;
private tryReconnectIfNeeded;
private subscribePending;
private getMessage;
private sendMessage;
private subscription;
private receiveMessage;
private validateMessage;
private onOpenMessage;
private onEventMessage;
private onEOSMessage;
private onCloseMessage;
private onPongMessage;
private onPingMessage;
}

@@ -28,4 +28,4 @@ import { Logger } from './logger';

subscribeNonResuming(path: string, headers: ElementsHeaders, listeners: SubscriptionListeners, retryStrategyOptions: RetryStrategyOptions, tokenProvider?: TokenProvider): Subscription;
private infoHeaders();
private makeRequest(options);
private infoHeaders;
private makeRequest;
}

@@ -14,3 +14,3 @@ import { BaseClient, BaseClientOptions } from './base-client';

import { createTransportStrategy } from './transports';
export { BaseClient, BaseClientOptions, ConsoleLogger, createResumingStrategy, createRetryingStrategy, createRetryStrategyOptionsOrDefault, createTokenProvidingStrategy, createTransportStrategy, DoNotRetry, ElementsHeaders, EmptyLogger, ErrorResponse, executeNetworkRequest, HOST_BASE, Instance, Logger, NetworkError, RawRequestOptions, RequestOptions, responseToHeadersObject, ResumableSubscribeOptions, RetryStrategyResult, Retry, RetryStrategyOptions, RetryResolution, sendRawRequest, SubscribeOptions, Subscription, SubscriptionEvent, SubscriptionListeners, TokenProvider, XhrReadyState };
export { BaseClient, BaseClientOptions, ConsoleLogger, createResumingStrategy, createRetryingStrategy, createRetryStrategyOptionsOrDefault, createTokenProvidingStrategy, createTransportStrategy, DoNotRetry, ElementsHeaders, EmptyLogger, ErrorResponse, executeNetworkRequest, HOST_BASE, Instance, Logger, NetworkError, RawRequestOptions, RequestOptions, responseToHeadersObject, ResumableSubscribeOptions, RetryStrategyResult, Retry, RetryStrategyOptions, RetryResolution, sendRawRequest, SubscribeOptions, Subscription, SubscriptionEvent, SubscriptionListeners, TokenProvider, XhrReadyState, };
declare const _default: {

@@ -17,0 +17,0 @@ BaseClient: typeof BaseClient;

@@ -42,3 +42,3 @@ import { BaseClient } from './base-client';

subscribeResuming(options: ResumableSubscribeOptions): Subscription;
private absPath(relativePath);
private absPath;
}

@@ -6,3 +6,3 @@ export declare enum LogLevel {

WARNING = 4,
ERROR = 5,
ERROR = 5
}

@@ -24,4 +24,4 @@ export interface Logger {

error(...items: any[]): void;
private log(logFunction, level, items);
private errorAwareLog(logFunction, item, loggerSignature);
private log;
private errorAwareLog;
}

@@ -28,0 +28,0 @@ export declare class EmptyLogger implements Logger {

@@ -16,2 +16,6 @@ export declare type ElementsHeaders = {

}
export declare class ProtocolError {
error: string;
constructor(error: string);
}
export declare enum XhrReadyState {

@@ -22,3 +26,3 @@ UNSENT = 0,

LOADING = 3,
DONE = 4,
DONE = 4
}

@@ -28,3 +28,3 @@ import { Logger } from './logger';

private logger;
private retryUnsafeRequests;
private retryUnsafeRequests?;
private initialTimeoutMillis;

@@ -38,4 +38,3 @@ private maxTimeoutMillis;

attemptRetry(error: any): RetryStrategyResult;
private shouldSafeRetry(error);
private calulateMillisToRetry();
private calculateMillisToRetry;
}

@@ -9,3 +9,3 @@ import { ElementsHeaders } from '../network';

ENDING = 3,
ENDED = 4,
ENDED = 4
}

@@ -17,4 +17,4 @@ export default class HttpTransport implements SubscriptionTransport {

subscribe(path: string, listeners: SubscriptionListeners, headers: ElementsHeaders): Subscription;
private createXHR(baseURL, options);
private setJSONHeaderIfAppropriate(xhr, options);
private createXHR;
private setJSONHeaderIfAppropriate;
}

@@ -0,1 +1,2 @@

import { Logger } from '../logger';
import { ElementsHeaders } from '../network';

@@ -7,3 +8,3 @@ import { Subscription, SubscriptionListeners, SubscriptionTransport } from '../subscription';

Closing = 2,
Closed = 3,
Closed = 3
}

@@ -23,20 +24,21 @@ export default class WebSocketTransport implements SubscriptionTransport {

private lastSentPingID;
constructor(host: string);
private logger;
constructor(host: string, logger: Logger);
subscribe(path: string, listeners: SubscriptionListeners, headers: ElementsHeaders): Subscription;
unsubscribe(subID: number): void;
private connect();
private close(error?);
private tryReconnectIfNeeded();
private subscribePending(path, listeners, headers, subID?);
private getMessage(messageType, id, path?, headers?);
private sendMessage(message);
private subscription(subID);
private receiveMessage(event);
private validateMessage(message);
private onOpenMessage(message, subID, subscriptionListeners);
private onEventMessage(eventMessage, subscriptionListeners);
private onEOSMessage(eosMessage, subID, subscriptionListeners);
private onCloseMessage(closeMessage);
private onPongMessage(message);
private onPingMessage(message);
private connect;
private close;
private tryReconnectIfNeeded;
private subscribePending;
private getMessage;
private sendMessage;
private subscription;
private receiveMessage;
private validateMessage;
private onOpenMessage;
private onEventMessage;
private onEOSMessage;
private onCloseMessage;
private onPongMessage;
private onPingMessage;
}

@@ -28,4 +28,4 @@ import { Logger } from './logger';

subscribeNonResuming(path: string, headers: ElementsHeaders, listeners: SubscriptionListeners, retryStrategyOptions: RetryStrategyOptions, tokenProvider?: TokenProvider): Subscription;
private infoHeaders();
private makeRequest(options);
private infoHeaders;
private makeRequest;
}

@@ -14,3 +14,3 @@ import { BaseClient, BaseClientOptions } from './base-client';

import { createTransportStrategy } from './transports';
export { BaseClient, BaseClientOptions, ConsoleLogger, createResumingStrategy, createRetryingStrategy, createRetryStrategyOptionsOrDefault, createTokenProvidingStrategy, createTransportStrategy, DoNotRetry, ElementsHeaders, EmptyLogger, ErrorResponse, executeNetworkRequest, HOST_BASE, Instance, Logger, NetworkError, RawRequestOptions, RequestOptions, responseToHeadersObject, ResumableSubscribeOptions, RetryStrategyResult, Retry, RetryStrategyOptions, RetryResolution, sendRawRequest, SubscribeOptions, Subscription, SubscriptionEvent, SubscriptionListeners, TokenProvider, XhrReadyState };
export { BaseClient, BaseClientOptions, ConsoleLogger, createResumingStrategy, createRetryingStrategy, createRetryStrategyOptionsOrDefault, createTokenProvidingStrategy, createTransportStrategy, DoNotRetry, ElementsHeaders, EmptyLogger, ErrorResponse, executeNetworkRequest, HOST_BASE, Instance, Logger, NetworkError, RawRequestOptions, RequestOptions, responseToHeadersObject, ResumableSubscribeOptions, RetryStrategyResult, Retry, RetryStrategyOptions, RetryResolution, sendRawRequest, SubscribeOptions, Subscription, SubscriptionEvent, SubscriptionListeners, TokenProvider, XhrReadyState, };
declare const _default: {

@@ -17,0 +17,0 @@ BaseClient: typeof BaseClient;

@@ -42,3 +42,3 @@ import { BaseClient } from './base-client';

subscribeResuming(options: ResumableSubscribeOptions): Subscription;
private absPath(relativePath);
private absPath;
}

@@ -6,3 +6,3 @@ export declare enum LogLevel {

WARNING = 4,
ERROR = 5,
ERROR = 5
}

@@ -24,4 +24,4 @@ export interface Logger {

error(...items: any[]): void;
private log(logFunction, level, items);
private errorAwareLog(logFunction, item, loggerSignature);
private log;
private errorAwareLog;
}

@@ -28,0 +28,0 @@ export declare class EmptyLogger implements Logger {

@@ -16,2 +16,6 @@ export declare type ElementsHeaders = {

}
export declare class ProtocolError {
error: string;
constructor(error: string);
}
export declare enum XhrReadyState {

@@ -22,3 +26,3 @@ UNSENT = 0,

LOADING = 3,
DONE = 4,
DONE = 4
}

@@ -28,3 +28,3 @@ import { Logger } from './logger';

private logger;
private retryUnsafeRequests;
private retryUnsafeRequests?;
private initialTimeoutMillis;

@@ -38,4 +38,3 @@ private maxTimeoutMillis;

attemptRetry(error: any): RetryStrategyResult;
private shouldSafeRetry(error);
private calulateMillisToRetry();
private calculateMillisToRetry;
}

@@ -9,3 +9,3 @@ import { ElementsHeaders } from '../network';

ENDING = 3,
ENDED = 4,
ENDED = 4
}

@@ -17,4 +17,4 @@ export default class HttpTransport implements SubscriptionTransport {

subscribe(path: string, listeners: SubscriptionListeners, headers: ElementsHeaders): Subscription;
private createXHR(baseURL, options);
private setJSONHeaderIfAppropriate(xhr, options);
private createXHR;
private setJSONHeaderIfAppropriate;
}

@@ -0,1 +1,2 @@

import { Logger } from '../logger';
import { ElementsHeaders } from '../network';

@@ -7,3 +8,3 @@ import { Subscription, SubscriptionListeners, SubscriptionTransport } from '../subscription';

Closing = 2,
Closed = 3,
Closed = 3
}

@@ -23,20 +24,21 @@ export default class WebSocketTransport implements SubscriptionTransport {

private lastSentPingID;
constructor(host: string);
private logger;
constructor(host: string, logger: Logger);
subscribe(path: string, listeners: SubscriptionListeners, headers: ElementsHeaders): Subscription;
unsubscribe(subID: number): void;
private connect();
private close(error?);
private tryReconnectIfNeeded();
private subscribePending(path, listeners, headers, subID?);
private getMessage(messageType, id, path?, headers?);
private sendMessage(message);
private subscription(subID);
private receiveMessage(event);
private validateMessage(message);
private onOpenMessage(message, subID, subscriptionListeners);
private onEventMessage(eventMessage, subscriptionListeners);
private onEOSMessage(eosMessage, subID, subscriptionListeners);
private onCloseMessage(closeMessage);
private onPongMessage(message);
private onPingMessage(message);
private connect;
private close;
private tryReconnectIfNeeded;
private subscribePending;
private getMessage;
private sendMessage;
private subscription;
private receiveMessage;
private validateMessage;
private onOpenMessage;
private onEventMessage;
private onEOSMessage;
private onCloseMessage;
private onPongMessage;
private onPingMessage;
}

@@ -6,3 +6,3 @@ {

"types": "dist/web/declarations/index.d.ts",
"version": "0.15.5",
"version": "0.16.0",
"author": "Pusher",

@@ -20,4 +20,3 @@ "license": "MIT",

"build": "yarn build:all",
"build:all":
"yarn clean && yarn build:web && yarn build:react-native && yarn build:worker",
"build:all": "yarn clean && yarn build:web && yarn build:react-native && yarn build:worker",
"build:web": "webpack --config=webpack/config.web.js",

@@ -29,6 +28,9 @@ "build:react-native": "webpack --config=webpack/config.react-native.js",

"lint": "tslint -c tslint.json 'src/**/*.ts'",
"lint:build:test": "yarn lint && yarn test",
"prettier": "prettier 'src/**/*.ts' 'test/**/*.js'",
"test-jest": "jest test/unit/*.test.js",
"test-integration": "karma start --single-run",
"test": "yarn build && yarn test-jest && yarn test-integration"
"test": "yarn build && yarn test-jest && yarn test-integration",
"publish-please": "publish-please",
"prepublishOnly": "publish-please guard"
},

@@ -47,2 +49,3 @@ "devDependencies": {

"prettier": "^1.8.1",
"publish-please": "^5.4.3",
"ts-loader": "^2.1.0",

@@ -49,0 +52,0 @@ "tslint": "^5.8.0",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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