diff --git a/CHANGES.txt b/CHANGES.txt index d2814f3..df021d3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,6 @@ 2.0.0 (November XX, 2024) - Added support for targeting rules based on large segments. - - Updated @splitsoftware/splitio package to version 11.0.0 that includes major updates, and updated some transitive dependencies for vulnerability fixes. + - Updated @splitsoftware/splitio package to version 11.0.1 that includes major updates, and updated some transitive dependencies for vulnerability fixes. - Renamed distribution folders from `/lib` to `/cjs` for CommonJS build, and `/es` to `/esm` for ECMAScript Modules build. - BREAKING CHANGES: - Removed the `core.trafficType` configuration option and made required the `trafficType` argument when calling the `track` helper function. This is because traffic types can no longer be bound to SDK clients in JavaScript SDK v11.0.0, and so the traffic type must be provided as argument in the `track` method calls. diff --git a/package-lock.json b/package-lock.json index 1bfd950..66643ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.14.1", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio": "11.0.0-rc.4", + "@splitsoftware/splitio": "11.0.1", "tslib": "^2.3.1" }, "devDependencies": { @@ -1543,11 +1543,11 @@ } }, "node_modules/@splitsoftware/splitio": { - "version": "11.0.0-rc.4", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-11.0.0-rc.4.tgz", - "integrity": "sha512-hQmeTf6tEWglbZwHvfdC4j0aSzGppfizcIKs+bOhXQf2Z52SVflO0cSuu6hxnLzDFtIbnDiOses12GhUceFBkg==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-11.0.1.tgz", + "integrity": "sha512-s6DF8h/ftP+vj2mpe46cDWDMy2DeEWlHLDmBGP3Rw4yOr57hdWwstg7b5mti2NLivObgVs8gKj1eoSxJK5Eb0A==", "dependencies": { - "@splitsoftware/splitio-commons": "2.0.0-rc.5", + "@splitsoftware/splitio-commons": "2.0.0", "bloom-filters": "^3.0.0", "ioredis": "^4.28.0", "js-yaml": "^3.13.1", @@ -1560,9 +1560,9 @@ } }, "node_modules/@splitsoftware/splitio-commons": { - "version": "2.0.0-rc.5", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.0-rc.5.tgz", - "integrity": "sha512-hNLA3cfVj5yGSHpOyTQVzcU2kIceJtJOdatcuue2ENOesjwDHfpvEy/YkIgLcLwXpvUxTFKpZd1BRej8gSbWoA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.0.tgz", + "integrity": "sha512-Sz4+vFacl29xw3451z9IUgB4zBFKUWZdCnmOB0DDXA803YKPqjXphdAwN6nV+1vsX9pXV/OS6UaNC4oUICa6PA==", "dependencies": { "@types/ioredis": "^4.28.0", "tslib": "^2.3.1" @@ -11158,11 +11158,11 @@ } }, "@splitsoftware/splitio": { - "version": "11.0.0-rc.4", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-11.0.0-rc.4.tgz", - "integrity": "sha512-hQmeTf6tEWglbZwHvfdC4j0aSzGppfizcIKs+bOhXQf2Z52SVflO0cSuu6hxnLzDFtIbnDiOses12GhUceFBkg==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-11.0.1.tgz", + "integrity": "sha512-s6DF8h/ftP+vj2mpe46cDWDMy2DeEWlHLDmBGP3Rw4yOr57hdWwstg7b5mti2NLivObgVs8gKj1eoSxJK5Eb0A==", "requires": { - "@splitsoftware/splitio-commons": "2.0.0-rc.5", + "@splitsoftware/splitio-commons": "2.0.0", "bloom-filters": "^3.0.0", "ioredis": "^4.28.0", "js-yaml": "^3.13.1", @@ -11172,9 +11172,9 @@ } }, "@splitsoftware/splitio-commons": { - "version": "2.0.0-rc.5", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.0-rc.5.tgz", - "integrity": "sha512-hNLA3cfVj5yGSHpOyTQVzcU2kIceJtJOdatcuue2ENOesjwDHfpvEy/YkIgLcLwXpvUxTFKpZd1BRej8gSbWoA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.0.tgz", + "integrity": "sha512-Sz4+vFacl29xw3451z9IUgB4zBFKUWZdCnmOB0DDXA803YKPqjXphdAwN6nV+1vsX9pXV/OS6UaNC4oUICa6PA==", "requires": { "@types/ioredis": "^4.28.0", "tslib": "^2.3.1" diff --git a/package.json b/package.json index 230c62b..1f3bba0 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "homepage": "https://github.com/splitio/redux-client#readme", "dependencies": { - "@splitsoftware/splitio": "11.0.0-rc.4", + "@splitsoftware/splitio": "11.0.1", "tslib": "^2.3.1" }, "devDependencies": { diff --git a/src/asyncActions.ts b/src/asyncActions.ts index a16a345..ab5e033 100644 --- a/src/asyncActions.ts +++ b/src/asyncActions.ts @@ -14,8 +14,8 @@ import { matching, __getStatus, validateGetTreatmentsParams, isMainClient } from export interface ISplitSdk { config: SplitIO.IBrowserSettings | SplitIO.INodeSettings; splitio: ISplitFactoryBuilder; - factory: SplitIO.ISDK | SplitIO.INodeSDK; - sharedClients: { [stringKey: string]: SplitIO.IClient }; + factory: SplitIO.IBrowserSDK | SplitIO.ISDK; + sharedClients: { [stringKey: string]: SplitIO.IBrowserClient }; isDetached: boolean; // true: server-side, false: client-side (i.e., client with bound key) dispatch: Dispatch; } @@ -173,7 +173,7 @@ export function getTreatments(params: IGetTreatmentsParams): Action | (() => voi } else { // Split SDK running in Node // Evaluate Split and return redux action. - const client = splitSdk.factory.client() as unknown as SplitIO.INodeClient; + const client = splitSdk.factory.client() as unknown as SplitIO.IClient; const treatments = splitNames ? client.getTreatmentsWithConfig(params.key, splitNames, params.attributes) : client.getTreatmentsWithConfigByFlagSets(params.key, flagSets, params.attributes); @@ -185,7 +185,7 @@ export function getTreatments(params: IGetTreatmentsParams): Action | (() => voi /** * Interface of SDK client for not detached execution (browser). */ -interface IClientNotDetached extends SplitIO.IClient { +interface IClientNotDetached extends SplitIO.IBrowserClient { _trackingStatus?: boolean; /** * stored evaluations to execute on SDK update. It is an object because we might diff --git a/src/helpers.ts b/src/helpers.ts index 314041f..bed0cbf 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -22,7 +22,7 @@ export function track(params: ITrackParams): boolean { if (splitSdk.isDetached) { // Node // In node, user must always provide key and TT as params - const client = splitSdk.factory.client() as SplitIO.INodeClient; + const client = splitSdk.factory.client() as SplitIO.IClient; return client.track(key, trafficType, eventType, value, properties); } else { // Browser diff --git a/src/types.ts b/src/types.ts index 91b2578..d4db8d2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -195,7 +195,7 @@ export interface ITrackParams { properties?: SplitIO.Properties; } -export type ISplitFactoryBuilder = ((settings: SplitIO.IBrowserSettings) => SplitIO.ISDK) | ((settings: SplitIO.INodeSettings) => SplitIO.INodeSDK); +export type ISplitFactoryBuilder = ((settings: SplitIO.IBrowserSettings) => SplitIO.IBrowserSDK) | ((settings: SplitIO.INodeSettings) => SplitIO.ISDK); export type ISplitAction = { type: string;