diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript-commons.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript-commons.yaml index 09c4b888..1bf82775 100644 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript-commons.yaml +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript-commons.yaml @@ -73,6 +73,20 @@ pipeline: spec: shell: Sh command: npm run test + - step: + type: Run + name: ioredis peer dependency matrix + identifier: ioredis_matrix + spec: + shell: Sh + command: |- + set -e + for version in 4 5; do + echo "--- Testing against ioredis v$version ---" + npm install --no-save --no-audit --no-fund "ioredis@$version" + npx jest src/storages/inRedis + done + npm ci - step: type: Run name: npm run build diff --git a/CHANGES.txt b/CHANGES.txt index 6da11eb6..d6810448 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ + +3.3.0 (XXX XX, 2026) + - Added support for ioredis v6 (Related to issue https://github.com/splitio/javascript-client/issues/951). Note that ioredis v6 requires Node.js 20 or above; stay on ioredis v4 or v5 for older Node.js versions. + - Removed the `@types/ioredis` dependency, which is no longer required since the public type definitions don't depend on ioredis types. The `@types/node` dependency, previously installed transitively by `@types/ioredis`, is now declared explicitly, since the public type definitions use Node.js types for the `agent` and `tls` options. + 3.2.0 (August 28, 2026) - Added support for AI configs. - Removed Configs SDK-related types and modules and moved them to the Configs SDK repository. @@ -20,6 +25,13 @@ - Removed the misleading warning log 'No listeners for SDK_READY event detected', since users can use the `whenReady` method to wait for the SDK to be ready. - BREAKING CHANGES: Renamed some types and modules, and updated the signatures of others for clarity and reusability. +2.13.0 (September 24, 2026) + - Added support for ioredis v6 (Related to issue https://github.com/splitio/javascript-client/issues/951). Note that ioredis v6 requires Node.js 20 or above; stay on ioredis v4 or v5 for older Node.js versions. + - Removed the `@types/ioredis` dependency, which is no longer required since the public type definitions don't depend on ioredis types. The `@types/node` dependency, previously installed transitively by `@types/ioredis`, is now declared explicitly, since the public type definitions use Node.js types for the `agent` and `tls` options. + +2.12.2 (September 23, 2026) + - Updated some transitive dependencies for vulnerability fixes. + 2.12.1 (June 25, 2026) - Updated internal modules to handle `null` values from `/splitChanges` response. - Updated some dependencies for vulnerability fixes. diff --git a/package-lock.json b/package-lock.json index 4641572c..f01b2d6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,10 @@ "version": "3.1.1-rc.4", "license": "Apache-2.0", "dependencies": { - "@types/ioredis": "^4.28.0", + "@types/node": ">=14.0.0", "tslib": "^2.3.1" }, "devDependencies": { - "@types/ioredis": "^4.28.0", "@types/jest": "^27.0.0", "@types/lodash": "^4.14.162", "@typescript-eslint/eslint-plugin": "^7.18.0", @@ -25,7 +24,7 @@ "eslint-plugin-import": "^2.25.3", "eslint-plugin-tsdoc": "^0.3.0", "fetch-mock": "^9.11.0", - "ioredis": "^5.0.0", + "ioredis": "^6.0.0", "jest": "^27.2.3", "jest-localstorage-mock": "^2.4.3", "lodash": "^4.17.21", @@ -37,7 +36,7 @@ }, "peerDependencies": { "bloom-filters": "^3.0.0", - "ioredis": "^4.28.0 || ^5.0.0", + "ioredis": "^4.28.0 || ^5.0.0 || ^6.0.0", "node-fetch": "^2.7.0" }, "peerDependenciesMeta": { @@ -668,9 +667,9 @@ "license": "BSD-3-Clause" }, "node_modules/@ioredis/commands": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.5.0.tgz", - "integrity": "sha512-eUgLqrMf8nJkZxT24JvVRrQya1vZkQh8BBeYNwGDqa5I0VUi8ACx7uFvAaLxintokpTenkK6DASvo/bvNbBGow==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-2.0.0.tgz", + "integrity": "sha512-vrx0AE/T0h7cRZwfo1M39Cr+ZhZrkf0V8mQN75wucKCxCLD9l/VX6no3gFvrLqD1IlG/1LtzWovqEw3t0Vr9zg==", "dev": true, "license": "MIT" }, @@ -1497,15 +1496,6 @@ "@types/node": "*" } }, - "node_modules/@types/ioredis": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@types/ioredis/-/ioredis-4.28.1.tgz", - "integrity": "sha512-raYHPqRWrfnEoym94BY28mG1+tcZqh3dsp2q7x5IyMAAEvIdu+H0X8diASMpncIm+oHyH9dalOeOnGOL/YnuOA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", @@ -1556,8 +1546,7 @@ "node_modules/@types/node": { "version": "14.14.7", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz", - "integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==", - "dev": true + "integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==" }, "node_modules/@types/prettier": { "version": "2.7.3", @@ -1747,9 +1736,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", - "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", + "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", "dev": true, "license": "MIT", "dependencies": { @@ -2197,9 +2186,9 @@ } }, "node_modules/baseline-browser-mapping": { - "version": "2.11.23", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.23.tgz", - "integrity": "sha512-le521dGVfxM7yRX0EikCoSz+rOK+hHzdDt/E7mG1jOJB/6WAAUuwVroLwaB7ApaUsz5Q0kFlDXLSA9MheUIfRQ==", + "version": "2.11.25", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.25.tgz", + "integrity": "sha512-gMmEShwwq7FJqMwvfRwvCl00v4kN+KOfJqXn+f4nrufak5gNHJOksd/60Dvjuz7sI8Y5WiSFBa8FEYr+zoyqCw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -2230,9 +2219,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz", - "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==", + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", "dev": true, "license": "MIT", "dependencies": { @@ -2259,9 +2248,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.28.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", - "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", + "version": "4.29.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.0.tgz", + "integrity": "sha512-3GSvyjvDI4Dur1Meg2BekJquu5uF+9R9a1+5M1Mde192eZoXbeXjzgOsgqPS2V8D5wrrip0gR5Hf/GhWQ9ZzaA==", "dev": true, "funding": [ { @@ -2280,11 +2269,11 @@ "license": "MIT", "peer": true, "dependencies": { - "baseline-browser-mapping": "^2.11.20", + "baseline-browser-mapping": "^2.11.23", "caniuse-lite": "^1.0.30001810", - "electron-to-chromium": "^1.5.420", - "node-releases": "^2.0.54", - "update-browserslist-db": "^1.3.2" + "electron-to-chromium": "^1.5.427", + "node-releases": "^2.0.55", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -2427,10 +2416,11 @@ } }, "node_modules/cluster-key-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz", - "integrity": "sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.1.tgz", + "integrity": "sha512-rwHwUfXL40Chm1r08yrhU3qpUvdVlgkKNeyeGPOxnW8/SyVDvgRaed/Uz54AqWNaTCAThlj6QAs3TZcKI0xDEw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=0.10.0" } @@ -2567,12 +2557,13 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -2721,9 +2712,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.427", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.427.tgz", - "integrity": "sha512-n14zb3FdsChZ2BNobqNHAJMcP3ifFv4paox2LvCrfVAQcqGiSURgbJl+PfMpHVCNFkStnNc+RRVtPBTVW5PDgw==", + "version": "1.5.438", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.438.tgz", + "integrity": "sha512-AN9xMU1hJiT65LkCUPL1DZm5TCbOPb2Qsm5pYwFLEXp6/qj9SdT4yMiqs7Qqstwvkn1zF7l36SRGt+s6XcJ0FA==", "dev": true, "license": "ISC" }, @@ -4270,24 +4261,21 @@ } }, "node_modules/ioredis": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.9.2.tgz", - "integrity": "sha512-tAAg/72/VxOUW7RQSX1pIxJVucYKcjFjfvj60L57jrZpYCHC3XN0WCQ3sNYL4Gmvv+7GPvTAjc+KSdeNuE8oWQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-6.0.0.tgz", + "integrity": "sha512-f+Dtubxfpf6KYFq7WVXJoOLn0bk4TJrMrN9SzeE+jrWrCWj7XX3fA6vkryafhADX+GMymRxgDJDOI33COkJc0w==", "dev": true, "license": "MIT", "dependencies": { - "@ioredis/commands": "1.5.0", - "cluster-key-slot": "^1.1.0", - "debug": "^4.3.4", - "denque": "^2.1.0", - "lodash.defaults": "^4.2.0", - "lodash.isarguments": "^3.1.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0", - "standard-as-callback": "^2.1.0" + "@ioredis/commands": "2.0.0", + "cluster-key-slot": "1.1.1", + "debug": "4.4.3", + "denque": "2.1.0", + "redis-errors": "1.2.0", + "standard-as-callback": "2.1.0" }, "engines": { - "node": ">=12.22.0" + "node": ">=20.0.0" }, "funding": { "type": "opencollective", @@ -6549,18 +6537,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", - "dev": true - }, - "node_modules/lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", - "dev": true - }, "node_modules/lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", @@ -6723,10 +6699,11 @@ "dev": true }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", @@ -6784,9 +6761,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.55", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.55.tgz", - "integrity": "sha512-mIrE/Cw9y+9Au6dS5vDKDhQza9YvG6w+ZrS6X+ZzA7yFW/soAeaups4Qzn1bL6g5FVy8WtP79+0j82oPIbqRjQ==", + "version": "2.0.57", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.57.tgz", + "integrity": "sha512-kQK9LGGFiHtrWiNhZtA7Qbw17AQz+dmsEKODRIVTXA9+e5MS/2gZEBhYJt13GrAz5/IOZKddH/0Z3TP/Zgo+yw==", "dev": true, "license": "MIT", "engines": { @@ -7194,20 +7171,9 @@ "node_modules/redis-errors": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", - "integrity": "sha1-62LSrbFeTq9GEMBK/hUpOEJQq60=", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/redis-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", - "integrity": "sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ=", - "dev": true, - "dependencies": { - "redis-errors": "^1.0.0" - }, + "license": "MIT", "engines": { "node": ">=4" } diff --git a/package.json b/package.json index 861726e6..7bcf2643 100644 --- a/package.json +++ b/package.json @@ -45,12 +45,12 @@ "bugs": "https://github.com/splitio/javascript-commons/issues", "homepage": "https://github.com/splitio/javascript-commons#readme", "dependencies": { - "@types/ioredis": "^4.28.0", + "@types/node": ">=14.0.0", "tslib": "^2.3.1" }, "peerDependencies": { "bloom-filters": "^3.0.0", - "ioredis": "^4.28.0 || ^5.0.0", + "ioredis": "^4.28.0 || ^5.0.0 || ^6.0.0", "node-fetch": "^2.7.0" }, "peerDependenciesMeta": { @@ -65,7 +65,6 @@ } }, "devDependencies": { - "@types/ioredis": "^4.28.0", "@types/jest": "^27.0.0", "@types/lodash": "^4.14.162", "@typescript-eslint/eslint-plugin": "^7.18.0", @@ -77,7 +76,7 @@ "eslint-plugin-import": "^2.25.3", "eslint-plugin-tsdoc": "^0.3.0", "fetch-mock": "^9.11.0", - "ioredis": "^5.0.0", + "ioredis": "^6.0.0", "jest": "^27.2.3", "jest-localstorage-mock": "^2.4.3", "lodash": "^4.17.21", diff --git a/src/storages/inRedis/RedisAdapter.ts b/src/storages/inRedis/RedisAdapter.ts index c3d3ab8e..7fa48b63 100644 --- a/src/storages/inRedis/RedisAdapter.ts +++ b/src/storages/inRedis/RedisAdapter.ts @@ -1,12 +1,12 @@ // Dynamically require ioredis to prevent strict TypeScript binding -// and handle module export differences between v4 and v5. +// and handle module export differences between v4 and later major versions. let RedisConstructor: any; try { const ioredisLib = require('ioredis'); RedisConstructor = ioredisLib.default || ioredisLib; } catch (e) { // If we reach here, the peer dependency is missing - throw new Error('ioredis is missing. Please install ioredis v4 or v5.'); + throw new Error('ioredis is missing. Please install ioredis v4, v5 or v6.'); } import { ILogger } from '../../logger/types'; @@ -31,9 +31,12 @@ const DEFAULT_LIBRARY_OPTIONS = { enableOfflineQueue: false, connectTimeout: DEFAULT_OPTIONS.connectionTimeout, lazyConnect: false, - // CRITICAL: v5 defaults this to 0 (disabled), which breaks dynamic clusters. - // v4 defaulted to 5000. We explicitly set it here to ensure v5 works like v4. + // CRITICAL: v5 and v6 default this to 0 (disabled), which breaks dynamic clusters. + // v4 defaulted to 5000. We explicitly set it here to ensure v5 and v6 work like v4. slotsRefreshInterval: 5000, + // v6 defaults to RESP3 (`protocol: 3`). The SDK doesn't use any RESP3 feature, + // so we stick to RESP2 to keep the v4 and v5 behavior. Ignored by v4 and v5. + protocol: 2, }; interface IRedisCommand { @@ -45,7 +48,7 @@ interface IRedisCommand { /** * Redis adapter on top of the library of choice (written with ioredis) for some extra control. - * Refactored to use Composition instead of Inheritance to support both v4 and v5. + * Refactored to use Composition instead of Inheritance to support v4, v5 and v6. */ export class RedisAdapter { // eslint-disable-next-line no-undef -- Index signature to allow proxying dynamic ioredis methods without TS errors diff --git a/src/storages/inRedis/__tests__/RedisAdapter.spec.ts b/src/storages/inRedis/__tests__/RedisAdapter.spec.ts index ec0742ba..40174e4b 100644 --- a/src/storages/inRedis/__tests__/RedisAdapter.spec.ts +++ b/src/storages/inRedis/__tests__/RedisAdapter.spec.ts @@ -110,7 +110,7 @@ describe('STORAGE Redis Adapter', () => { // Keep in mind we're storing the arguments object, not a true array. expect(constructorParams.length).toBe(2); // In this signature, the constructor receives two params. expect(constructorParams[0]).toBe(redisUrl); // When we use the Redis URL, that should be the first parameter passed to ioredis constructor - expect(constructorParams[1]).toEqual({ enableOfflineQueue: false, connectTimeout: 123, lazyConnect: false, slotsRefreshInterval: 5000, tls: { ca: 'ca' } }); // and the second parameter would be the default settings for the lib. + expect(constructorParams[1]).toEqual({ enableOfflineQueue: false, connectTimeout: 123, lazyConnect: false, slotsRefreshInterval: 5000, protocol: 2, tls: { ca: 'ca' } }); // and the second parameter would be the default settings for the lib. new RedisAdapter(loggerMock, { ...redisParams, @@ -121,7 +121,7 @@ describe('STORAGE Redis Adapter', () => { expect(constructorParams.length).toBe(1); // In this signature, the constructor receives one param. // we keep "pass" instead of "password" on our settings API to be backwards compatible. - expect(constructorParams[0]).toEqual({ host: redisParams.host, port: redisParams.port, db: redisParams.db, password: redisParams.pass, enableOfflineQueue: false, connectTimeout: 123, lazyConnect: false, slotsRefreshInterval: 5000, tls: { ca: 'ca' } }); // If we send all the redis params separate, it will pass one object to the library containing that and the rest of the options. + expect(constructorParams[0]).toEqual({ host: redisParams.host, port: redisParams.port, db: redisParams.db, password: redisParams.pass, enableOfflineQueue: false, connectTimeout: 123, lazyConnect: false, slotsRefreshInterval: 5000, protocol: 2, tls: { ca: 'ca' } }); // If we send all the redis params separate, it will pass one object to the library containing that and the rest of the options. new RedisAdapter(loggerMock, { ...redisParams, @@ -133,7 +133,7 @@ describe('STORAGE Redis Adapter', () => { expect(constructorParams.length).toBe(2); // In this signature, the constructor receives two params. expect(constructorParams[0]).toBe(redisUrl); // When we use the Redis URL, even if we specified all the other params one by one the URL takes precedence, so that should be the first parameter passed to ioredis constructor - expect(constructorParams[1]).toEqual({ enableOfflineQueue: false, connectTimeout: 10000, lazyConnect: false, slotsRefreshInterval: 5000, tls: { ca: 'ca' } }); // and the second parameter would be the default settings for the lib. + expect(constructorParams[1]).toEqual({ enableOfflineQueue: false, connectTimeout: 10000, lazyConnect: false, slotsRefreshInterval: 5000, protocol: 2, tls: { ca: 'ca' } }); // and the second parameter would be the default settings for the lib. }); test('static method - _defineOptions', () => { diff --git a/types/splitio.d.ts b/types/splitio.d.ts index 4d22f008..459830bf 100644 --- a/types/splitio.d.ts +++ b/types/splitio.d.ts @@ -1,7 +1,7 @@ // Type definitions for Split Software SDKs // Project: https://www.split.io/ -import type { RedisOptions } from 'ioredis'; +import type { ConnectionOptions } from 'tls'; import type { RequestOptions } from 'http'; export as namespace SplitIO; @@ -1715,7 +1715,7 @@ declare namespace SplitIO { * * @defaultValue `undefined` */ - tls?: RedisOptions['tls']; + tls?: ConnectionOptions; }; /** * Optional prefix to prevent any kind of data collision between SDK versions.