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.9.0 to 4.9.1

26

CHANGELOG.md
## [v4.9.1](https://github.com/pubnub/javascript/tree/v4.9.1)
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.9.0...v4.9.1)
- 🌟add support custom encryption and decryption
## [v4.9.0](https://github.com/pubnub/javascript/tree/v4.9.0)
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.8.0...v4.9.0)
- 🌟integrate fetch for react-native SDK
- ⭐announce when subscription get reactivated
- ⭐stop heartbeats for responses with status PNBadRequestCategory
## [v4.8.0](https://github.com/pubnub/javascript/tree/v4.8.0)

@@ -3,0 +29,0 @@

2

lib/core/components/config.js

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

value: function getVersion() {
return '4.9.0';
return '4.9.1';
}

@@ -174,0 +174,0 @@ }, {

@@ -230,4 +230,4 @@ 'use strict';

this.encrypt = crypto.pnEncrypt.bind(crypto);
this.decrypt = crypto.pnDecrypt.bind(crypto);
this.encrypt = crypto.encrypt.bind(crypto);
this.decrypt = crypto.decrypt.bind(crypto);

@@ -234,0 +234,0 @@ this.getAuthKey = modules.config.getAuthKey.bind(modules.config);

{
"name": "pubnub",
"version": "4.9.0",
"version": "4.9.1",
"author": "PubNub <support@pubnub.com>",

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

"gulp-istanbul": "^1.1.1",
"gulp-mocha": "^4.3.0",
"gulp-mocha": "^3.0.1",
"gulp-rename": "^1.2.2",

@@ -87,3 +87,3 @@ "gulp-sourcemaps": "^2.4.0",

"underscore": "^1.8.3",
"webpack": "^1.14.0",
"webpack": "^2.4.1",
"webpack-dev-server": "^1.16.2",

@@ -97,2 +97,2 @@ "webpack-stream": "^3.2.0"

}
}
}

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

## CDN Links
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.9.0.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.9.0.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.9.1.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.9.1.js

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

getVersion(): string {
return '4.9.0';
return '4.9.1';
}

@@ -211,0 +211,0 @@

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

decrypt(data: string, customCipherKey: ?string, options: ?Object): Object | string | null {
decrypt(data: Object, customCipherKey: ?string, options: ?Object): Object | string | null {
if (this._config.customDecrypt) {

@@ -111,0 +111,0 @@ return this._config.customDecrypt(data);

@@ -416,2 +416,6 @@ /* @flow */

if (message.userMetadata) {
announce.userMetadata = message.userMetadata;
}
if (this._config.cipherKey) {

@@ -418,0 +422,0 @@ announce.message = this._crypto.decrypt(message.payload);

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

originationTimetoken: rawMessage.o,
userMetadata: rawMessage.u,
publishMetaData

@@ -76,0 +77,0 @@ };

@@ -195,4 +195,4 @@ /* @flow */

// mount crypto
this.encrypt = crypto.pnEncrypt.bind(crypto);
this.decrypt = crypto.pnDecrypt.bind(crypto);
this.encrypt = crypto.encrypt.bind(crypto);
this.decrypt = crypto.decrypt.bind(crypto);

@@ -199,0 +199,0 @@ /** config **/

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

.query({ pnsdk: `PubNub-JS-Nodejs/${pubnub.getVersion()}`, uuid: 'myUUID', heartbeat: 300, tt: 10, tr: 1 })
.reply(200, '{"t":{"t":"20","r":1},"m":[{"a":"4","f":0,"i":"Client-g5d4g","p":{"t":"14607577960925503","r":1},"i": "client3", "k":"sub-c-4cec9f8e-01fa-11e6-8180-0619f8945a4f","c":"coolChannel","d":{"text":"Message10"},"b":"coolChan-bnel"}]}');
.reply(200, '{"t":{"t":"20","r":1},"m":[{"a":"4","f":0,"i":"Client-g5d4g","p":{"t":"14607577960925503","r":1},"i": "client3", "k":"sub-c-4cec9f8e-01fa-11e6-8180-0619f8945a4f","c":"coolChannel","d":{"text":"Message10"},"b":"coolChan-bnel", "u": {"cool": "meta"}}]}');

@@ -89,2 +89,5 @@ let incomingPayloads = [];

},
userMetadata: {
cool: 'meta'
},
subscribedChannel: 'coolChan-bnel',

@@ -91,0 +94,0 @@ channel: 'coolChannel',

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

import PubNub from '../../src/node/index';
import CryptoJS from '../../src/core/components/cryptography/hmac-sha256';

@@ -47,2 +48,19 @@ describe('#core / mounting point', () => {

it('supports custom encryption/decryption', () => {
let customEncrypt = (data) => {
let cipher = CryptoJS.AES.encrypt(JSON.stringify(data), 'customKey');
return cipher.toString();
};
let customDecrypt = (data) => {
let bytes = CryptoJS.AES.decrypt(data, 'customKey');
return JSON.parse(bytes.toString(CryptoJS.enc.Utf8));
};
let pn = new PubNub({ customEncrypt, customDecrypt });
let ciphertext = pn.encrypt({ hi: 'there' });
assert.deepEqual(pn.decrypt(ciphertext), { hi: 'there' });
});
});

@@ -25,5 +25,3 @@ let webpack = require('webpack');

plugins: [
new webpack.BannerPlugin(`${packageJSON.version} / Consumer `, {
raw: false, entryOnly: true,
}),
new webpack.BannerPlugin({ banner: `${packageJSON.version} / Consumer `, raw: false }),
new StatsPlugin('stats.json', {

@@ -30,0 +28,0 @@ chunkModules: true,

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 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

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