Comparing version 5.0.0 to 5.0.1
@@ -0,1 +1,4 @@ | ||
## v5.0.1 | ||
March 02 2022 | ||
## v5.0.0 | ||
@@ -2,0 +5,0 @@ January 12 2022 |
@@ -33,3 +33,3 @@ "use strict"; | ||
function _default(_ref) { | ||
var _setup$fileUploadPubl, _setup$useRandomIVs; | ||
var _setup$fileUploadPubl, _setup$useRandomIVs, _setup$enableSubscrib; | ||
@@ -75,2 +75,3 @@ var setup = _ref.setup; | ||
(0, _defineProperty2["default"])(this, "useRandomIVs", void 0); | ||
(0, _defineProperty2["default"])(this, "enableSubscribeBeta", void 0); | ||
this._PNSDKSuffix = {}; | ||
@@ -105,3 +106,8 @@ this.instanceId = "pn-".concat(_uuid["default"].createUUID()); | ||
this.useRandomIVs = (_setup$useRandomIVs = setup.useRandomIVs) !== null && _setup$useRandomIVs !== void 0 ? _setup$useRandomIVs : true; | ||
this.enableSubscribeBeta = (_setup$enableSubscrib = setup.enableSubscribeBeta) !== null && _setup$enableSubscrib !== void 0 ? _setup$enableSubscrib : false; | ||
if (setup.enableSubscribeBeta && setup.enableSubscribeBeta === true) { | ||
throw new Error('not implemented'); | ||
} | ||
if (typeof location !== 'undefined' && location.protocol === 'https:') { | ||
@@ -248,3 +254,3 @@ this.secure = true; | ||
value: function getVersion() { | ||
return '5.0.0'; | ||
return '5.0.1'; | ||
} | ||
@@ -251,0 +257,0 @@ }, { |
@@ -213,3 +213,4 @@ "use strict"; | ||
ignoreBody: typeof endpoint.ignoreBody === 'function' ? endpoint.ignoreBody(modules) : false, | ||
forceBuffered: typeof endpoint.forceBuffered === 'function' ? endpoint.forceBuffered(modules, incomingParams) : null | ||
forceBuffered: typeof endpoint.forceBuffered === 'function' ? endpoint.forceBuffered(modules, incomingParams) : null, | ||
abortSignal: typeof endpoint.getAbortSignal === 'function' ? endpoint.getAbortSignal(modules, incomingParams) : null | ||
}; | ||
@@ -216,0 +217,0 @@ outgoingParams.uuid = config.UUID; |
@@ -263,3 +263,3 @@ "use strict"; | ||
if (channelGroup in _this4._presenceChannelGroups) { | ||
delete _this4._channelGroups[channelGroup]; | ||
delete _this4._presenceChannelGroups[channelGroup]; | ||
actualChannelGroups.push(channelGroup); | ||
@@ -266,0 +266,0 @@ } |
@@ -64,3 +64,5 @@ "use strict"; | ||
PNAccessManagerAudit: 'PNAccessManagerAudit', | ||
PNAccessManagerRevokeToken: 'PNAccessManagerRevokeToken' | ||
PNAccessManagerRevokeToken: 'PNAccessManagerRevokeToken', | ||
PNHandshakeOperation: 'PNHandshakeOperation', | ||
PNReceiveMessagesOperation: 'PNReceiveMessagesOperation' | ||
}; | ||
@@ -67,0 +69,0 @@ exports["default"] = _default; |
@@ -174,2 +174,8 @@ "use strict"; | ||
var _handshake = _interopRequireDefault(require("./endpoints/subscriptionUtils/handshake")); | ||
var _receiveMessages = _interopRequireDefault(require("./endpoints/subscriptionUtils/receiveMessages")); | ||
var subscriptionTypes = _interopRequireWildcard(require("./endpoints/subscriptionUtils/types")); | ||
var _operations = _interopRequireDefault(require("./constants/operations")); | ||
@@ -213,2 +219,7 @@ | ||
(0, _defineProperty2["default"])(this, "setState", void 0); | ||
(0, _defineProperty2["default"])(this, "iAmHere", void 0); | ||
(0, _defineProperty2["default"])(this, "iAmAway", void 0); | ||
(0, _defineProperty2["default"])(this, "setPresenceState", void 0); | ||
(0, _defineProperty2["default"])(this, "handshake", void 0); | ||
(0, _defineProperty2["default"])(this, "receiveMessages", void 0); | ||
(0, _defineProperty2["default"])(this, "grant", void 0); | ||
@@ -357,2 +368,5 @@ (0, _defineProperty2["default"])(this, "grantToken", void 0); | ||
this.setState = subscriptionManager.adaptStateChange.bind(subscriptionManager); | ||
this.iAmHere = _endpoint["default"].bind(this, modules, presenceHeartbeatEndpointConfig); | ||
this.iAmAway = _endpoint["default"].bind(this, modules, presenceLeaveEndpointConfig); | ||
this.setPresenceState = _endpoint["default"].bind(this, modules, presenceSetStateConfig); | ||
this.grant = _endpoint["default"].bind(this, modules, grantEndpointConfig); | ||
@@ -395,2 +409,4 @@ this.grantToken = _endpoint["default"].bind(this, modules, grantTokenEndpointConfig); | ||
this.deleteFile = _endpoint["default"].bind(this, modules, _delete_file["default"]); | ||
this.handshake = _endpoint["default"].bind(this, modules, _handshake["default"]); | ||
this.receiveMessages = _endpoint["default"].bind(this, modules, _receiveMessages["default"]); | ||
this.objects = { | ||
@@ -397,0 +413,0 @@ getAllUUIDMetadata: _endpoint["default"].bind(this, modules, _get_all["default"]), |
@@ -65,2 +65,8 @@ "use strict"; | ||
if (endpoint.abortSignal) { | ||
endpoint.abortSignal.on('abort', function () { | ||
sc.abort(); | ||
}); | ||
} | ||
if (endpoint.forceBuffered === true) { | ||
@@ -67,0 +73,0 @@ if (typeof Blob === 'undefined') { |
@@ -71,3 +71,3 @@ "use strict"; | ||
for (var byteIdx = byteOffset + 3; byteIdx >= byteOffset; byteIdx -= 1) { | ||
if (view[byteIdx] === 0) { | ||
if (view[byteIdx] === 0 && zeroBytesCount < 3) { | ||
zeroBytesCount += 1; | ||
@@ -74,0 +74,0 @@ } |
{ | ||
"name": "pubnub", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"author": "PubNub <support@pubnub.com>", | ||
@@ -27,2 +27,3 @@ "description": "Publish & Subscribe Real-time Messaging with PubNub", | ||
"react-native": "./lib/react_native/index.js", | ||
"metro": "./lib/react_native/index.js", | ||
"nativescript": "./lib/nativescript/index.js", | ||
@@ -29,0 +30,0 @@ "browser": "./dist/web/pubnub.min.js", |
@@ -25,4 +25,4 @@ # PubNub JavaScript SDK (V4) | ||
* or download one of our builds from our CDN: | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.5.0.0.js | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.5.0.0.min.js | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.5.0.1.js | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.5.0.1.min.js | ||
@@ -29,0 +29,0 @@ 2. Configure your keys: |
@@ -144,2 +144,3 @@ /* @flow */ | ||
useRandomIVs: boolean; | ||
enableSubscribeBeta: boolean; | ||
@@ -182,2 +183,9 @@ constructor({ setup }: ConfigConstructArgs) { | ||
// flag for beta subscribe feature enablement | ||
this.enableSubscribeBeta = setup.enableSubscribeBeta ?? false; | ||
if (setup.enableSubscribeBeta && setup.enableSubscribeBeta === true) { | ||
throw new Error('not implemented'); | ||
} | ||
// if location config exist and we are in https, force secure to true. | ||
@@ -316,3 +324,3 @@ if (typeof location !== 'undefined' && location.protocol === 'https:') { | ||
getVersion(): string { | ||
return '5.0.0'; | ||
return '5.0.1'; | ||
} | ||
@@ -319,0 +327,0 @@ |
@@ -164,2 +164,3 @@ import uuidGenerator from './uuid'; | ||
typeof endpoint.forceBuffered === 'function' ? endpoint.forceBuffered(modules, incomingParams) : null, | ||
abortSignal: typeof endpoint.getAbortSignal === 'function' ? endpoint.getAbortSignal(modules, incomingParams) : null | ||
}; | ||
@@ -166,0 +167,0 @@ |
@@ -272,3 +272,3 @@ /* @flow */ | ||
if (channelGroup in this._presenceChannelGroups) { | ||
delete this._channelGroups[channelGroup]; | ||
delete this._presenceChannelGroups[channelGroup]; | ||
actualChannelGroups.push(channelGroup); | ||
@@ -275,0 +275,0 @@ } |
@@ -88,2 +88,6 @@ /* @flow */ | ||
// | ||
// subscription utilities | ||
PNHandshakeOperation: 'PNHandshakeOperation', | ||
PNReceiveMessagesOperation: 'PNReceiveMessagesOperation' | ||
}; |
@@ -51,4 +51,6 @@ /** @flow */ | ||
getAbortSignal?: InjectedFunction<[TParams], any>, | ||
handleResponse?: InjectedMaybeAsyncFunction<[Record, TParams], TResult>, | ||
handleError?: InjectedMaybeAsyncFunction<[Record, TParams], any> | ||
|}; |
@@ -154,2 +154,7 @@ /** @flow */ | ||
// subscription utilities | ||
import handshakeEndpointConfig from './endpoints/subscriptionUtils/handshake'; | ||
import receiveMessagesConfig from './endpoints/subscriptionUtils/receiveMessages'; | ||
import * as subscriptionTypes from './endpoints/subscriptionUtils/types'; | ||
import OPERATIONS from './constants/operations'; | ||
@@ -192,2 +197,17 @@ import CATEGORIES from './constants/categories'; | ||
setState: Function; | ||
// presence utility methods | ||
iAmHere: Function; | ||
iAmAway: Function; | ||
setPresenceState: Function; | ||
// subscription utility methods | ||
handshake: ( | ||
parameters: subscriptionTypes.HandshakeParams, | ||
callback?: (status: CallbackStatus, result: subscriptionTypes.HandshakeResult) => void | ||
) => Promise<subscriptionTypes.HandshakeResult>; | ||
receiveMessages: ( | ||
parameters: subscriptionTypes.ReceiveMessagesParams, | ||
callback?: (status: CallbackStatus, result: subscriptionTypes.ReceiveMessagesResult) => void | ||
) => Promise<subscriptionTypes.ReceiveMessagesResult>; | ||
// | ||
@@ -441,2 +461,8 @@ grant: Function; | ||
this.setState = subscriptionManager.adaptStateChange.bind(subscriptionManager); | ||
/* presence utilities */ | ||
this.iAmHere = endpointCreator.bind(this, modules, presenceHeartbeatEndpointConfig); | ||
this.iAmAway = endpointCreator.bind(this, modules, presenceLeaveEndpointConfig); | ||
this.setPresenceState = endpointCreator.bind(this, modules, presenceSetStateConfig); | ||
/* PAM */ | ||
@@ -490,2 +516,6 @@ this.grant = endpointCreator.bind(this, modules, grantEndpointConfig); | ||
this.handshake = endpointCreator.bind(this, modules, handshakeEndpointConfig); | ||
this.receiveMessages = endpointCreator.bind(this, modules, receiveMessagesConfig); | ||
// Objects API v2 | ||
@@ -492,0 +522,0 @@ |
@@ -47,2 +47,8 @@ /* @flow */ | ||
if (endpoint.abortSignal) { | ||
endpoint.abortSignal.on('abort', () => { | ||
sc.abort(); | ||
}); | ||
} | ||
if (endpoint.forceBuffered === true) { | ||
@@ -49,0 +55,0 @@ if (typeof Blob === 'undefined') { |
@@ -43,3 +43,3 @@ /* @flow */ | ||
for (let byteIdx = byteOffset + 3; byteIdx >= byteOffset; byteIdx -= 1) { | ||
if (view[byteIdx] === 0) { | ||
if (view[byteIdx] === 0 && zeroBytesCount < 3) { | ||
zeroBytesCount += 1; | ||
@@ -46,0 +46,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 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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6281326
432
62452