Skip to content

Commit

Permalink
CLEN-1406/Fix proxy agent dependency upgrade (#331)
Browse files Browse the repository at this point in the history
* fix: proxy feature dependency

* test: removed node 12 to get support for optional chaining operator

* fix: message acount condition when multiple timetokens and channels provided

* lib dist files

* fix codacy issue for module exports in .js file

* PubNub SDK v7.3.3 release.

* fix: version bump

* fix: missing version bump

* PubNub SDK v7.3.0 release.

* docs(pubnub.yml) fix formatting

---------

Co-authored-by: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com>
Co-authored-by: Serhii Mamontov <parfeon@me.com>
  • Loading branch information
3 people authored Jul 26, 2023
1 parent 40570e6 commit 9584344
Show file tree
Hide file tree
Showing 17 changed files with 485 additions and 534 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ module.exports = {
'class-methods-use-this': 0,
'no-prototype-builtins': 1,
'prefer-destructuring': 0,
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
};
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: true
matrix:
node: [12, 14, 16]
node: [14, 16]
env: ["ci:node"]
include:
- node: 16
Expand Down
11 changes: 8 additions & 3 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
changelog:
- date: 2023-07-26
version: v7.3.0
changes:
- type: bug
text: "Fixes issue of severe vulnerability warnings for vm2 usage."
- date: 2023-06-19
version: v7.2.3
changes:
Expand Down Expand Up @@ -875,7 +880,7 @@ supported-platforms:
- 'Ubuntu 14.04 and up'
- 'Windows 7 and up'
version: 'Pubnub Javascript for Node'
version: '7.2.3'
version: '7.3.0'
sdks:
- full-name: PubNub Javascript SDK
short-name: Javascript
Expand All @@ -891,7 +896,7 @@ sdks:
- distribution-type: source
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/archive/refs/tags/v7.2.3.zip
location: https://github.com/pubnub/javascript/archive/refs/tags/v7.3.0.zip
requires:
- name: 'agentkeepalive'
min-version: '3.5.2'
Expand Down Expand Up @@ -1562,7 +1567,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/releases/download/v7.2.3/pubnub.7.2.3.js
location: https://github.com/pubnub/javascript/releases/download/v7.3.0/pubnub.7.3.0.js
requires:
- name: 'agentkeepalive'
min-version: '3.5.2'
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v7.3.0
July 26 2023

#### Fixed
- Fixes issue of severe vulnerability warnings for vm2 usage.



## v7.2.3
June 19 2023

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ You will need the publish and subscribe keys to authenticate your app. Get your
npm install pubnub
```
* or download one of our builds from our CDN:
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.2.3.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.2.3.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.3.0.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.3.0.min.js
2. Configure your keys:
Expand Down
5 changes: 2 additions & 3 deletions dist/web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@
return this;
};
default_1.prototype.getVersion = function () {
return '7.2.3';
return '7.3.0';
};
default_1.prototype._addPnsdkSuffix = function (name, suffix) {
this._PNSDKSuffix[name] = suffix;
Expand Down Expand Up @@ -6266,7 +6266,6 @@
handleResponse: handleResponse$4
});

/* */
function getOperation$3() {
return OPERATIONS.PNMessageCounts;
}
Expand All @@ -6277,7 +6276,7 @@
return 'Missing channel';
if (timetoken && channelTimetokens)
return 'timetoken and channelTimetokens are incompatible together';
if (timetoken && channelTimetokens && channelTimetokens.length > 1 && channels.length !== channelTimetokens.length) {
if (channelTimetokens && channelTimetokens.length > 1 && channels.length !== channelTimetokens.length) {
return 'Length of channelTimetokens and channels do not match';
}
if (!config.subscribeKey)
Expand Down
2 changes: 1 addition & 1 deletion dist/web/pubnub.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/core/components/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ var default_1 = /** @class */ (function () {
return this;
};
default_1.prototype.getVersion = function () {
return '7.2.3';
return '7.3.0';
};
default_1.prototype._addPnsdkSuffix = function (name, suffix) {
this._PNSDKSuffix[name] = suffix;
Expand Down
3 changes: 1 addition & 2 deletions lib/core/endpoints/history/message_counts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use strict";
/* */
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
Expand Down Expand Up @@ -34,7 +33,7 @@ function validateParams(modules, incomingParams) {
return 'Missing channel';
if (timetoken && channelTimetokens)
return 'timetoken and channelTimetokens are incompatible together';
if (timetoken && channelTimetokens && channelTimetokens.length > 1 && channels.length !== channelTimetokens.length) {
if (channelTimetokens && channelTimetokens.length > 1 && channels.length !== channelTimetokens.length) {
return 'Length of channelTimetokens and channels do not match';
}
if (!config.subscribeKey)
Expand Down
4 changes: 2 additions & 2 deletions lib/networking/modules/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.keepAlive = exports.proxy = void 0;
var superagent_1 = __importDefault(require("superagent"));
var superagent_proxy_1 = __importDefault(require("superagent-proxy"));
var agentkeepalive_1 = __importDefault(require("agentkeepalive"));
var proxyAgent_1 = __importDefault(require("../proxyAgent"));
var keepAliveAgent = null;
var keepAliveSecureAgent = null;
(0, superagent_proxy_1.default)(superagent_1.default);
(0, proxyAgent_1.default)(superagent_1.default);
function proxy(superagentConstruct) {
return superagentConstruct.proxy(this._config.proxy);
}
Expand Down
15 changes: 15 additions & 0 deletions lib/networking/proxyAgent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var proxy_agent_1 = require("proxy-agent");
function default_1(superagent) {
var Request = superagent.Request;
Request.prototype.proxy = proxy;
return superagent;
}
exports.default = default_1;
function proxy(proxyConfiguration) {
var agent = new proxy_agent_1.ProxyAgent(proxyConfiguration);
if (agent)
this.agent(agent);
return this;
}
Loading

0 comments on commit 9584344

Please sign in to comment.