Skip to content

Commit

Permalink
fix export for cjs and es module compatibility (#276)
Browse files Browse the repository at this point in the history
* fix export for cjs and es module compatibility

* exclude node files from rollup

* fix lint

* remove karma babel

* PubNub SDK v7.0.1 release.

Co-authored-by: Rai Phairow <rai.phairow@Rais-MacBook-Pro-2.local>
Co-authored-by: Client Engineering Bot <60980775+Client Engineering Bot@users.noreply.github.com>
  • Loading branch information
3 people authored May 24, 2022
1 parent 6854231 commit 26d6baf
Show file tree
Hide file tree
Showing 80 changed files with 479 additions and 1,055 deletions.
10 changes: 7 additions & 3 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
changelog:
- date: 2022-05-24
version: v7.0.1
changes:

- date: 2022-05-24
version: v7.0.0
changes:
Expand Down Expand Up @@ -1112,7 +1116,7 @@ supported-platforms:
- "Ubuntu 14.04 and up"
- "Windows 7 and up"
version: "Pubnub Javascript for Node"
version: "7.0.0"
version: "7.0.1"
sdks:
-
full-name: PubNub Javascript SDK
Expand All @@ -1131,7 +1135,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/archive/refs/tags/v7.0.0.zip
location: https://github.com/pubnub/javascript/archive/refs/tags/v7.0.1.zip
requires:
-
name: "agentkeepalive"
Expand Down Expand Up @@ -1895,7 +1899,7 @@ sdks:
distribution-type: library
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/releases/download/v7.0.0/pubnub.7.0.0.js
location: https://github.com/pubnub/javascript/releases/download/v7.0.1/pubnub.7.0.1.js
requires:
-
name: "agentkeepalive"
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v7.0.1
May 24 2022

## v7.0.0
May 24 2022

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.0.0.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.0.0.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.0.1.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.0.1.min.js
2. Configure your keys:
Expand Down
2 changes: 1 addition & 1 deletion dist/web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@
return this;
};
default_1.prototype.getVersion = function () {
return '7.0.0';
return '7.0.1';
};
default_1.prototype._addPnsdkSuffix = function (name, suffix) {
this._PNSDKSuffix[name] = suffix;
Expand Down
2 changes: 1 addition & 1 deletion dist/web/pubnub.min.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion karma/chrome.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = function (config) {
frameworks: ['mocha', 'chai'],

files: [
'node_modules/@babel/polyfill/dist/polyfill.js',
'../src/web/index.js',
'../' + process.argv[process.argv.length - 1],
],
Expand Down
7 changes: 5 additions & 2 deletions lib/core/components/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"use strict";
/* */
/* global location */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var uuid_1 = require("./uuid");
var uuid_1 = __importDefault(require("./uuid"));
var PRESENCE_TIMEOUT_MINIMUM = 20;
var PRESENCE_TIMEOUT_DEFAULT = 300;
var makeDefaultOrigins = function () { return Array.from({ length: 20 }, function (_, i) { return "ps".concat(i + 1, ".pndsn.com"); }); };
Expand Down Expand Up @@ -145,7 +148,7 @@ var default_1 = /** @class */ (function () {
return this;
};
default_1.prototype.getVersion = function () {
return '7.0.0';
return '7.0.1';
};
default_1.prototype._addPnsdkSuffix = function (name, suffix) {
this._PNSDKSuffix[name] = suffix;
Expand Down
5 changes: 4 additions & 1 deletion lib/core/components/cryptography/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var hmac_sha256_1 = require("./hmac-sha256");
var hmac_sha256_1 = __importDefault(require("./hmac-sha256"));
function bufferToWordArray(b) {
var wa = [];
var i;
Expand Down
11 changes: 7 additions & 4 deletions lib/core/components/endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ var __assign = (this && this.__assign) || function () {
};
return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.signRequest = exports.generatePNSDK = exports.createValidationError = exports.PubNubError = void 0;
var uuid_1 = require("./uuid");
var utils_1 = require("../utils");
var operations_1 = require("../constants/operations");
var categories_1 = require("../constants/categories");
var uuid_1 = __importDefault(require("./uuid"));
var utils_1 = __importDefault(require("../utils"));
var operations_1 = __importDefault(require("../constants/operations"));
var categories_1 = __importDefault(require("../constants/categories"));
var PubNubError = /** @class */ (function (_super) {
__extends(PubNubError, _super);
function PubNubError(message, status) {
Expand Down
5 changes: 4 additions & 1 deletion lib/core/components/listener_manager.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var categories_1 = require("../constants/categories");
var categories_1 = __importDefault(require("../constants/categories"));
var default_1 = /** @class */ (function () {
function default_1() {
this._listeners = [];
Expand Down
11 changes: 7 additions & 4 deletions lib/core/components/subscription_manager.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var reconnection_manager_1 = require("./reconnection_manager");
var deduping_manager_1 = require("./deduping_manager");
var utils_1 = require("../utils");
var categories_1 = require("../constants/categories");
var reconnection_manager_1 = __importDefault(require("./reconnection_manager"));
var deduping_manager_1 = __importDefault(require("./deduping_manager"));
var utils_1 = __importDefault(require("../utils"));
var categories_1 = __importDefault(require("../constants/categories"));
var default_1 = /** @class */ (function () {
function default_1(_a) {
var subscribeEndpoint = _a.subscribeEndpoint, leaveEndpoint = _a.leaveEndpoint, heartbeatEndpoint = _a.heartbeatEndpoint, setStateEndpoint = _a.setStateEndpoint, timeEndpoint = _a.timeEndpoint, getFileUrl = _a.getFileUrl, config = _a.config, crypto = _a.crypto, listenerManager = _a.listenerManager;
Expand Down
5 changes: 4 additions & 1 deletion lib/core/components/telemetry_manager.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/* */
var operations_1 = require("../constants/operations");
var operations_1 = __importDefault(require("../constants/operations"));
var default_1 = /** @class */ (function () {
function default_1(configuration) {
this._maximumSamplesCount = 100;
Expand Down
5 changes: 4 additions & 1 deletion lib/core/components/uuid.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var lil_uuid_1 = require("lil-uuid");
var lil_uuid_1 = __importDefault(require("lil-uuid"));
exports.default = {
createUUID: function () {
if (lil_uuid_1.default.uuid) {
Expand Down
5 changes: 4 additions & 1 deletion lib/core/endpoints/access_manager/audit.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.prepareParams = exports.isAuthSupported = exports.getRequestTimeout = exports.getURL = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var operations_1 = __importDefault(require("../../constants/operations"));
function getOperation() {
return operations_1.default.PNAccessManagerAudit;
}
Expand Down
5 changes: 4 additions & 1 deletion lib/core/endpoints/access_manager/grant.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.prepareParams = exports.isAuthSupported = exports.getRequestTimeout = exports.getURL = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var operations_1 = __importDefault(require("../../constants/operations"));
function getOperation() {
return operations_1.default.PNAccessManagerGrant;
}
Expand Down
5 changes: 4 additions & 1 deletion lib/core/endpoints/access_manager/grant_token.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
/* */
/* eslint camelcase: 0 */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.postPayload = exports.prepareParams = exports.isAuthSupported = exports.getRequestTimeout = exports.usePost = exports.postURL = exports.validateParams = exports.extractPermissions = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var operations_1 = __importDefault(require("../../constants/operations"));
function getOperation() {
return operations_1.default.PNAccessManagerGrantToken;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/access_manager/revoke_token.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"use strict";
/** */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var operations_1 = require("../../constants/operations");
var utils_1 = require("../../utils");
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
var endpoint = {
getOperation: function () { return operations_1.default.PNAccessManagerRevokeToken; },
validateParams: function (modules, token) {
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/actions/add_message_action.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.postPayload = exports.prepareParams = exports.isAuthSupported = exports.getRequestHeaders = exports.getRequestTimeout = exports.postURL = exports.usePost = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var utils_1 = require("../../utils");
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
function getOperation() {
return operations_1.default.PNAddMessageActionOperation;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/actions/get_message_actions.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.prepareParams = exports.isAuthSupported = exports.getRequestTimeout = exports.getURL = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var utils_1 = require("../../utils");
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
function getOperation() {
return operations_1.default.PNGetMessageActionsOperation;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/actions/remove_message_action.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.prepareParams = exports.isAuthSupported = exports.getRequestTimeout = exports.getURL = exports.useDelete = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var utils_1 = require("../../utils");
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
function getOperation() {
return operations_1.default.PNRemoveMessageActionOperation;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/channel_groups/add_channels.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.prepareParams = exports.isAuthSupported = exports.getRequestTimeout = exports.getURL = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var utils_1 = require("../../utils");
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
function getOperation() {
return operations_1.default.PNAddChannelsToGroupOperation;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/channel_groups/delete_group.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.prepareParams = exports.getRequestTimeout = exports.isAuthSupported = exports.getURL = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var utils_1 = require("../../utils");
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
function getOperation() {
return operations_1.default.PNRemoveGroupOperation;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/channel_groups/list_channels.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.prepareParams = exports.isAuthSupported = exports.getRequestTimeout = exports.getURL = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var utils_1 = require("../../utils");
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
function getOperation() {
return operations_1.default.PNChannelsForGroupOperation;
}
Expand Down
5 changes: 4 additions & 1 deletion lib/core/endpoints/channel_groups/list_groups.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.prepareParams = exports.isAuthSupported = exports.getRequestTimeout = exports.getURL = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var operations_1 = __importDefault(require("../../constants/operations"));
function getOperation() {
return operations_1.default.PNChannelGroupsOperation;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/channel_groups/remove_channels.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.prepareParams = exports.isAuthSupported = exports.getRequestTimeout = exports.getURL = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../../constants/operations");
var utils_1 = require("../../utils");
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
function getOperation() {
return operations_1.default.PNRemoveChannelsFromGroupOperation;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/fetch_messages.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
/* */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleResponse = exports.prepareParams = exports.isAuthSupported = exports.getRequestTimeout = exports.getURL = exports.validateParams = exports.getOperation = void 0;
var operations_1 = require("../constants/operations");
var utils_1 = require("../utils");
var operations_1 = __importDefault(require("../constants/operations"));
var utils_1 = __importDefault(require("../utils"));
function __processMessage(modules, message) {
var config = modules.config, crypto = modules.crypto;
if (!config.cipherKey)
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/file_upload/delete_file.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"use strict";
/** */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var operations_1 = require("../../constants/operations");
var utils_1 = require("../../utils");
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
var endpoint = {
getOperation: function () { return operations_1.default.PNListFilesOperation; },
validateParams: function (_, params) {
Expand Down
7 changes: 5 additions & 2 deletions lib/core/endpoints/file_upload/download_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var operations_1 = require("../../constants/operations");
var utils_1 = require("../../utils");
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
var endpoint = {
getOperation: function () { return operations_1.default.PNDownloadFileOperation; },
validateParams: function (_, params) {
Expand Down
Loading

0 comments on commit 26d6baf

Please sign in to comment.