Skip to content

Commit fd8ff04

Browse files
PubNub SDK v7.4.3 release.
1 parent d52a9e0 commit fd8ff04

File tree

9 files changed

+50
-21
lines changed

9 files changed

+50
-21
lines changed

.pubnub.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22
changelog:
3+
- date: 2023-11-08
4+
version: v7.4.3
5+
changes:
6+
- type: bug
7+
text: "Fixes issue of not able to encrypt Blob file content in web."
38
- date: 2023-10-30
49
version: v7.4.2
510
changes:
@@ -912,7 +917,7 @@ supported-platforms:
912917
- 'Ubuntu 14.04 and up'
913918
- 'Windows 7 and up'
914919
version: 'Pubnub Javascript for Node'
915-
version: '7.4.2'
920+
version: '7.4.3'
916921
sdks:
917922
- full-name: PubNub Javascript SDK
918923
short-name: Javascript
@@ -928,7 +933,7 @@ sdks:
928933
- distribution-type: source
929934
distribution-repository: GitHub release
930935
package-name: pubnub.js
931-
location: https://github.com/pubnub/javascript/archive/refs/tags/v7.4.2.zip
936+
location: https://github.com/pubnub/javascript/archive/refs/tags/v7.4.3.zip
932937
requires:
933938
- name: 'agentkeepalive'
934939
min-version: '3.5.2'
@@ -1599,7 +1604,7 @@ sdks:
15991604
- distribution-type: library
16001605
distribution-repository: GitHub release
16011606
package-name: pubnub.js
1602-
location: https://github.com/pubnub/javascript/releases/download/v7.4.2/pubnub.7.4.2.js
1607+
location: https://github.com/pubnub/javascript/releases/download/v7.4.3/pubnub.7.4.3.js
16031608
requires:
16041609
- name: 'agentkeepalive'
16051610
min-version: '3.5.2'

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v7.4.3
2+
November 08 2023
3+
4+
#### Fixed
5+
- Fixes issue of not able to encrypt Blob file content in web.
6+
17
## v7.4.2
28
October 30 2023
39

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Watch [Getting Started with PubNub JS SDK](https://app.dashcam.io/replay/64ee0d2
2828
npm install pubnub
2929
```
3030
* or download one of our builds from our CDN:
31-
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.4.2.js
32-
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.4.2.min.js
31+
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.4.3.js
32+
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.4.3.min.js
3333
3434
2. Configure your keys:
3535

dist/web/pubnub.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@
791791
return this;
792792
};
793793
default_1.prototype.getVersion = function () {
794-
return '7.4.2';
794+
return '7.4.3';
795795
};
796796
default_1.prototype._addPnsdkSuffix = function (name, suffix) {
797797
this._PNSDKSuffix[name] = suffix;

dist/web/pubnub.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ var default_1 = /** @class */ (function () {
177177
return this;
178178
};
179179
default_1.prototype.getVersion = function () {
180-
return '7.4.2';
180+
return '7.4.3';
181181
};
182182
default_1.prototype._addPnsdkSuffix = function (name, suffix) {
183183
this._PNSDKSuffix[name] = suffix;

lib/crypto/modules/WebCryptoModule/webCryptoModule.js

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ var CryptoModule = /** @class */ (function () {
135135
case 0:
136136
if (this.defaultCryptor.identifier === CryptorHeader.LEGACY_IDENTIFIER)
137137
return [2 /*return*/, this.defaultCryptor.encryptFile(file, File)];
138-
fileData = this.getFileData(file.data);
139-
return [4 /*yield*/, this.defaultCryptor.encryptFileData(fileData)];
138+
return [4 /*yield*/, this.getFileData(file.data)];
140139
case 1:
140+
fileData = _a.sent();
141+
return [4 /*yield*/, this.defaultCryptor.encryptFileData(fileData)];
142+
case 2:
141143
encrypted = _a.sent();
142144
return [2 /*return*/, File.create({
143145
name: file.name,
@@ -162,7 +164,9 @@ var CryptoModule = /** @class */ (function () {
162164
if ((cryptor === null || cryptor === void 0 ? void 0 : cryptor.identifier) === CryptoModule.LEGACY_IDENTIFIER) {
163165
return [2 /*return*/, cryptor.decryptFile(file, File)];
164166
}
165-
fileData = this.getFileData(data);
167+
return [4 /*yield*/, this.getFileData(data)];
168+
case 2:
169+
fileData = _d.sent();
166170
metadata = fileData.slice(header.length - header.metadataLength, header.length);
167171
_b = (_a = File).create;
168172
_c = {
@@ -172,7 +176,7 @@ var CryptoModule = /** @class */ (function () {
172176
data: data.slice(header.length),
173177
metadata: metadata,
174178
})];
175-
case 2: return [2 /*return*/, _b.apply(_a, [(_c.data = _d.sent(),
179+
case 3: return [2 /*return*/, _b.apply(_a, [(_c.data = _d.sent(),
176180
_c)])];
177181
}
178182
});
@@ -214,13 +218,27 @@ var CryptoModule = /** @class */ (function () {
214218
return headerData.buffer;
215219
};
216220
CryptoModule.prototype.getFileData = function (input) {
217-
if (input instanceof ArrayBuffer) {
218-
return input;
219-
}
220-
if (typeof input === 'string') {
221-
return CryptoModule.encoder.encode(input);
222-
}
223-
throw new Error('Cannot decrypt/encrypt file. In browsers file decryption supports only string or ArrayBuffer');
221+
return __awaiter(this, void 0, void 0, function () {
222+
var fileData;
223+
return __generator(this, function (_a) {
224+
switch (_a.label) {
225+
case 0:
226+
if (!(input instanceof Blob)) return [3 /*break*/, 2];
227+
return [4 /*yield*/, input.arrayBuffer()];
228+
case 1:
229+
fileData = _a.sent();
230+
return [2 /*return*/, fileData];
231+
case 2:
232+
if (input instanceof ArrayBuffer) {
233+
return [2 /*return*/, input];
234+
}
235+
if (typeof input === 'string') {
236+
return [2 /*return*/, CryptoModule.encoder.encode(input)];
237+
}
238+
throw new Error('Cannot decrypt/encrypt file. In browsers file encrypt/decrypt supported for string, ArrayBuffer or Blob');
239+
}
240+
});
241+
});
224242
};
225243
CryptoModule.LEGACY_IDENTIFIER = '';
226244
CryptoModule.encoder = new TextEncoder();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pubnub",
3-
"version": "7.4.2",
3+
"version": "7.4.3",
44
"author": "PubNub <support@pubnub.com>",
55
"description": "Publish & Subscribe Real-time Messaging with PubNub",
66
"scripts": {

src/core/components/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ export default class {
350350
}
351351

352352
getVersion() {
353-
return '7.4.2';
353+
return '7.4.3';
354354
}
355355

356356
_addPnsdkSuffix(name, suffix) {

0 commit comments

Comments
 (0)