Socket
Socket
Sign inDemoInstall

pubnub

Package Overview
Dependencies
Maintainers
4
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pubnub - npm Package Compare versions

Comparing version 4.4.4 to 4.5.0

lib/networking/base.js

35

CHANGELOG.md
## [v4.5.0](https://github.com/pubnub/javascript/tree/v4.5.0)
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.4.4...v4.5.0)
- 🌟add optional support for keepAlive by passing the keepAlive config into the init logic
## [v4.4.4](https://github.com/pubnub/javascript/tree/v4.4.4)

@@ -11,3 +21,2 @@

- ⭐add guard to check for publish, secret keys when performing a grant

@@ -56,3 +65,2 @@

- ⭐handle network outage cases for correct reporting.

@@ -65,12 +73,2 @@

[Full Changelog](https://github.com/pubnub/javascript/compare/v4.3.3...v4.3.3)
- ⭐bump version after v3 release.
## [v4.3.3](https://github.com/pubnub/javascript/tree/v4.3.3)
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.3.2...v4.3.3)

@@ -112,11 +110,8 @@

- ⭐publish supports custom ttl interval
- ⭐v2 for audit and grant; no consumer facing changes.
- ⭐fixes for param validation on usage of promises

@@ -165,3 +160,2 @@

- ⭐Add hooks to stop polling time when the number of subscriptions drops to 0 (@jasonpoe)

@@ -190,7 +184,5 @@

- ⭐History always returns timetokens in the payloads.
- ⭐Optionally, if queue size is set, send status on queue size threshold

@@ -219,3 +211,2 @@

- ⭐Sign requests when a a secret key is passed

@@ -274,3 +265,2 @@

- ⭐Constants for operation and category are exposed on global object

@@ -299,3 +289,2 @@

- ⭐Try..catch wrapped around localStorage for iframe compliance

@@ -314,3 +303,2 @@

- ⭐PNSDK support for partner identification

@@ -338,3 +326,2 @@

- 🌟Exposing generateUUID method to create uuids.

@@ -344,7 +331,5 @@

- ⭐Triggering disconnect, reconnect events on Web distributions.
- ⭐React Native adjustments to package.json information.

@@ -351,0 +336,0 @@

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

{"errors":[],"warnings":[],"version":"1.14.0","hash":"02ac80b59279d0bc4961","publicPath":"","assetsByChunkName":{"main":"pubnub.js"},"assets":[{"name":"pubnub.js","size":179605,"chunks":[0],"chunkNames":["main"],"emitted":true},{"name":"stats.json","size":0,"chunks":[],"chunkNames":[]}],"chunks":[{"id":0,"rendered":true,"initial":true,"entry":true,"extraAsync":false,"size":170966,"names":["main"],"files":["pubnub.js"],"hash":"1fd9496243b135d9f277","parents":[],"modules":[],"filteredModules":46,"origins":[{"moduleId":0,"module":"/Users/Max/Desktop/CLIENT_CONTROL/javascript/node_modules/babel-loader/lib/index.js!/Users/Max/Desktop/CLIENT_CONTROL/javascript/src/web/index.js","moduleIdentifier":"/Users/Max/Desktop/CLIENT_CONTROL/javascript/node_modules/babel-loader/lib/index.js!/Users/Max/Desktop/CLIENT_CONTROL/javascript/src/web/index.js","moduleName":"./src/web/index.js","loc":"","name":"main","reasons":[]}]}],"modules":[],"filteredModules":46,"children":[]}
{"errors":[],"warnings":[],"version":"1.14.0","hash":"8da9d0fe7b69195a4f86","publicPath":"","assetsByChunkName":{"main":"pubnub.js"},"assets":[{"name":"pubnub.js","size":181565,"chunks":[0],"chunkNames":["main"],"emitted":true},{"name":"stats.json","size":0,"chunks":[],"chunkNames":[]}],"chunks":[{"id":0,"rendered":true,"initial":true,"entry":true,"extraAsync":false,"size":172866,"names":["main"],"files":["pubnub.js"],"hash":"dbd70a70f621326e118d","parents":[],"modules":[],"filteredModules":47,"origins":[{"moduleId":0,"module":"/Users/Max/Desktop/CLIENT_CONTROL/javascript/node_modules/babel-loader/lib/index.js!/Users/Max/Desktop/CLIENT_CONTROL/javascript/src/web/index.js","moduleIdentifier":"/Users/Max/Desktop/CLIENT_CONTROL/javascript/node_modules/babel-loader/lib/index.js!/Users/Max/Desktop/CLIENT_CONTROL/javascript/src/web/index.js","moduleName":"./src/web/index.js","loc":"","name":"main","reasons":[]}]}],"modules":[],"filteredModules":47,"children":[]}

@@ -28,3 +28,3 @@ 'use strict';

this.instanceId = _uuid2.default.v4();
this.instanceId = 'pn-' + _uuid2.default.v4();
this.secretKey = setup.secretKey || setup.secret_key;

@@ -44,2 +44,4 @@ this.subscribeKey = setup.subscribeKey || setup.subscribe_key;

this.proxy = setup.proxy;
this.keepAlive = setup.keepAlive;
this.keepAliveSettings = setup.keepAliveSettings;

@@ -168,3 +170,3 @@ if (typeof location !== 'undefined' && location.protocol === 'https:') {

value: function getVersion() {
return '4.4.4';
return '4.5.0';
}

@@ -182,3 +184,3 @@ }, {

return _uuid2.default.v4();
return 'pn-' + _uuid2.default.v4();
}

@@ -185,0 +187,0 @@ }]);

@@ -13,6 +13,2 @@ 'use strict';

var _networking = require('./components/networking');
var _networking2 = _interopRequireDefault(_networking);
var _config = require('./components/config');

@@ -26,2 +22,6 @@

var _base = require('../networking/base');
var _base2 = _interopRequireDefault(_base);
var _subscription_manager = require('./components/subscription_manager');

@@ -149,4 +149,4 @@

var sendBeacon = setup.sendBeacon,
db = setup.db;
var db = setup.db,
networking = setup.networking;

@@ -156,4 +156,9 @@

var crypto = new _index2.default({ config: config });
var networking = new _networking2.default({ config: config, crypto: crypto, sendBeacon: sendBeacon });
if (!networking) {
networking = new _base2.default({});
}
networking.init(config);
var modules = { config: config, networking: networking, crypto: crypto };

@@ -160,0 +165,0 @@

@@ -21,2 +21,6 @@ 'use strict';

var _node = require('../networking/node');
var _node2 = _interopRequireDefault(_node);
var _flow_interfaces = require('../core/flow_interfaces');

@@ -63,2 +67,3 @@

setup.db = new Database();
setup.networking = new _node2.default();
setup.sdkFamily = 'Nodejs';

@@ -65,0 +70,0 @@ return _possibleConstructorReturn(this, (_class2.__proto__ || Object.getPrototypeOf(_class2)).call(this, setup));

@@ -11,2 +11,6 @@ 'use strict';

var _web = require('../networking/web');
var _web2 = _interopRequireDefault(_web);
var _flow_interfaces = require('../core/flow_interfaces');

@@ -39,10 +43,2 @@

function sendBeacon(url) {
if (navigator && navigator.sendBeacon) {
navigator.sendBeacon(url);
} else {
return false;
}
}
var _class = function (_PubNubCore) {

@@ -55,4 +51,4 @@ _inherits(_class, _PubNubCore);

setup.db = db;
setup.sendBeacon = sendBeacon;
setup.sdkFamily = 'Web';
setup.networking = new _web2.default();

@@ -59,0 +55,0 @@ var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, setup));

{
"name": "pubnub",
"version": "4.4.4",
"version": "4.5.0",
"author": "PubNub <support@pubnub.com>",

@@ -29,2 +29,3 @@ "description": "Publish & Subscribe Real-time Messaging with PubNub",

"dependencies": {
"agentkeepalive": "^3.1.0",
"superagent": "^2.3.0",

@@ -90,2 +91,2 @@ "superagent-proxy": "^1.0.2",

}
}
}

@@ -22,3 +22,3 @@ # PubNub JavaScript SDK (V4)

## CDN Links
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.4.4.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.4.4.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.5.0.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.5.0.js

@@ -5,3 +5,3 @@ /* @flow */

import uuidGenerator from 'uuid';
import { InternalSetupStruct, DatabaseInterface } from '../flow_interfaces';
import { InternalSetupStruct, DatabaseInterface, KeepAliveStruct } from '../flow_interfaces';

@@ -68,2 +68,7 @@ type ConfigConstructArgs = {

// use connection keep-alive for http requests
keepAlive: ?boolean;
keepAliveSettings: ?KeepAliveStruct;
// alert when a heartbeat works out.

@@ -111,3 +116,3 @@ announceSuccessfulHeartbeats: boolean;

this.instanceId = uuidGenerator.v4();
this.instanceId = `pn-${uuidGenerator.v4()}`;
this.secretKey = setup.secretKey || setup.secret_key;

@@ -127,2 +132,4 @@ this.subscribeKey = setup.subscribeKey || setup.subscribe_key;

this.proxy = setup.proxy;
this.keepAlive = setup.keepAlive;
this.keepAliveSettings = setup.keepAliveSettings;

@@ -196,3 +203,3 @@ // if location config exist and we are in https, force secure to true.

getVersion(): string {
return '4.4.4';
return '4.5.0';
}

@@ -212,5 +219,5 @@

// randomize the UUID and push to storage
return uuidGenerator.v4();
return `pn-${uuidGenerator.v4()}`;
}
}

@@ -22,2 +22,16 @@ /* eslint no-unused-vars: 0 */

export type KeepAliveStruct = {
keepAlive: number,
keepAliveMsecs: number,
freeSocketKeepAliveTimeout: number,
timeout: number,
maxSockets: number,
maxFreeSockets: number
}
export type NetworkingModules = {
agentKeepAliveModule: ?Function,
sendBeaconModule: ?Function
}
export type InternalSetupStruct = {

@@ -40,6 +54,10 @@ useSendBeacon: ?boolean, // configuration on beacon usage

keepAlive: ?boolean, // is keep-alive enabled?
keepAliveSettings: ?KeepAliveStruct, // configuration on keep-alive usage
suppressLev: ?boolean,
db: Function // get / set implementation to store data
db: Function, // get / set implementation to store data
networking: Function // component of networking to use
}

@@ -46,0 +64,0 @@

@@ -5,5 +5,5 @@ /* @flow */

import Networking from './components/networking';
import Config from './components/config';
import Crypto from './components/cryptography/index';
import Networking from '../networking/base';
import SubscriptionManager from './components/subscription_manager';

@@ -106,8 +106,13 @@ import ListenerManager from './components/listener_manager';

constructor(setup: InternalSetupStruct) {
let { sendBeacon, db } = setup;
let { db, networking } = setup;
const config = this._config = new Config({ setup, db });
const crypto = new Crypto({ config });
const networking = new Networking({ config, crypto, sendBeacon });
if (!networking) {
networking = new Networking({});
}
networking.init(config);
let modules = { config, networking, crypto };

@@ -114,0 +119,0 @@

@@ -7,2 +7,3 @@ /* @flow */

import PubNubCore from '../core/pubnub-common';
import Networking from '../networking/node';
import { InternalSetupStruct } from '../core/flow_interfaces';

@@ -33,2 +34,3 @@

setup.db = new Database();
setup.networking = new Networking();
setup.sdkFamily = 'Nodejs';

@@ -35,0 +37,0 @@ super(setup);

@@ -5,2 +5,3 @@ /* @flow */

import PubNubCore from '../core/pubnub-common';
import Networking from '../networking/web';
import { InternalSetupStruct } from '../core/flow_interfaces';

@@ -31,11 +32,2 @@

function sendBeacon(url: string) {
if (navigator && navigator.sendBeacon) {
navigator.sendBeacon(url);
} else {
return false;
}
}
export default class extends PubNubCore {

@@ -45,4 +37,4 @@

setup.db = db;
setup.sendBeacon = sendBeacon;
setup.sdkFamily = 'Web';
setup.networking = new Networking();

@@ -49,0 +41,0 @@ super(setup);

@@ -44,3 +44,3 @@ /* global describe, beforeEach, it, before, afterEach, after */

const pubnub = new PubNub(storageParams);
assert.equal(pubnub.getUUID(), 'uuidCustom');
assert.equal(pubnub.getUUID(), 'pn-uuidCustom');
});

@@ -56,3 +56,3 @@

assert.equal(dbInstance.get.getCall(0).args[0], 'mySubKeyuuid');
assert.equal(pubnub.getUUID(), 'uuidCustom');
assert.equal(pubnub.getUUID(), 'pn-uuidCustom');
});

@@ -59,0 +59,0 @@

Sorry, the diff of this file is not supported yet

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 not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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