From d9136fdda8791588c08291f4b6bfb7ef9eb79b85 Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Tue, 17 Dec 2024 11:49:05 +0200 Subject: [PATCH] fix(logger): for logger for Node.js Fix issue because of which `logVerbosity` set to `true` still didn't print logs for Node.js. --- dist/web/pubnub.js | 4 +--- lib/node/index.js | 2 +- lib/types/index.d.ts | 2 +- src/node/index.ts | 6 +++++- test/integration/endpoints/subscribe.test.ts | 3 +-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dist/web/pubnub.js b/dist/web/pubnub.js index 9f7033b9c..7ed7f2893 100644 --- a/dist/web/pubnub.js +++ b/dist/web/pubnub.js @@ -6224,9 +6224,7 @@ delete payload.data; } else if ('action' in payload && payload.action === 'interval') { - // @ts-expect-error This is `interval` object which should have `hereNowRefresh` field. - payload['hereNowRefresh'] = (_a = payload.here_now_refresh) !== null && _a !== void 0 ? _a : false; - // @ts-expect-error Keeping only human-readable keys. + payload.hereNowRefresh = (_a = payload.here_now_refresh) !== null && _a !== void 0 ? _a : false; delete payload.here_now_refresh; } } diff --git a/lib/node/index.js b/lib/node/index.js index bd2eb87c7..d49294680 100644 --- a/lib/node/index.js +++ b/lib/node/index.js @@ -66,7 +66,7 @@ class PubNub extends pubnub_common_1.PubNubCore { if (process.env.CRYPTO_MODULE !== 'disabled') cryptography = new node_2.default(); // Setup transport provider. - const transport = new node_transport_1.NodeTransport(configuration.keepAlive, configuration.keepAliveSettings); + const transport = new node_transport_1.NodeTransport(configuration.keepAlive, configuration.keepAliveSettings, clientConfiguration.logVerbosity); const transportMiddleware = new middleware_1.PubNubMiddleware({ clientConfiguration, tokenManager, diff --git a/lib/types/index.d.ts b/lib/types/index.d.ts index 1390645cc..2f10643ab 100644 --- a/lib/types/index.d.ts +++ b/lib/types/index.d.ts @@ -5952,7 +5952,7 @@ declare namespace PubNub { */ status?: string; /** - * Channel's membership type. + * Channel's member type. */ type?: string; /** diff --git a/src/node/index.ts b/src/node/index.ts index 1ba9a65a2..11a7816ea 100755 --- a/src/node/index.ts +++ b/src/node/index.ts @@ -101,7 +101,11 @@ class PubNub extends PubNubCore { // @ts-expect-error Force override default value. useRequestId: false, autoNetworkDetection: false, - logVerbosity: true, }); pubnubWithFiltering = new PubNub({ subscribeKey: 'mySubKey', @@ -203,7 +202,7 @@ describe('subscribe endpoints', () => { }); }); - it('supports timetoken', (done) => { + it.only('supports timetoken', (done) => { const scope0 = utils .createNock() .get('/v2/subscribe/mySubKey/c1/0')