diff --git a/package.json b/package.json index 3efb5aaad5..06cb2e089c 100644 --- a/package.json +++ b/package.json @@ -133,7 +133,7 @@ "stoppable": "^1.1.0", "ts-toolbelt": "^9.6.0", "type-is": "^1.6.18", - "unleash-client": "3.15.0", + "unleash-client": "3.16.0", "use-deep-compare-effect": "^1.8.1", "uuid": "^8.3.2" }, diff --git a/src/lib/types/stores/feature-strategies-store.ts b/src/lib/types/stores/feature-strategies-store.ts index 33c00bc28a..78c2d751c0 100644 --- a/src/lib/types/stores/feature-strategies-store.ts +++ b/src/lib/types/stores/feature-strategies-store.ts @@ -11,6 +11,7 @@ export interface FeatureConfigurationClient { name: string; type: string; enabled: boolean; + project: string; stale: boolean; strategies: IStrategyConfig[]; variants: IVariant[]; diff --git a/src/lib/util/offline-unleash-client.test.ts b/src/lib/util/offline-unleash-client.test.ts index 4973538cc9..c7ec7f3030 100644 --- a/src/lib/util/offline-unleash-client.test.ts +++ b/src/lib/util/offline-unleash-client.test.ts @@ -45,6 +45,7 @@ describe('offline client', () => { features: [ { name, + project: 'default', enabled: true, strategies: [{ name: 'default' }], variants: [], @@ -68,6 +69,7 @@ describe('offline client', () => { { name: enabledFeature, enabled: true, + project: 'default', strategies: [ { name: 'default', @@ -87,6 +89,7 @@ describe('offline client', () => { { name: disabledFeature, enabled: true, + project: 'default', strategies: [ { name: 'default', @@ -123,6 +126,7 @@ describe('offline client', () => { name: 'default', }, ], + project: 'default', stale: false, enabled: false, name, @@ -149,6 +153,7 @@ describe('offline client', () => { name: 'default', }, ], + project: 'default', stale: false, enabled: false, name, @@ -187,6 +192,7 @@ describe('offline client', () => { stale: false, enabled: false, name, + project: 'default', type: 'experiment', variants: [ { @@ -226,6 +232,7 @@ describe('offline client', () => { constraints: [], }, ], + project: 'default', stale: false, enabled: true, name, @@ -255,6 +262,7 @@ describe('offline client', () => { constraints: [], }, ], + project: 'default', stale: false, enabled: true, name, @@ -291,6 +299,7 @@ describe('offline client', () => { constraints: [], }, ], + project: 'default', stale: false, enabled: true, name, @@ -376,6 +385,7 @@ describe('offline client', () => { // impressionData: false, enabled: true, name: featureName, + project: 'default', // description: '', // project: 'heartman-for-test', stale: false, diff --git a/src/lib/util/offline-unleash-client.ts b/src/lib/util/offline-unleash-client.ts index 53bb61c261..6fa0a0e57a 100644 --- a/src/lib/util/offline-unleash-client.ts +++ b/src/lib/util/offline-unleash-client.ts @@ -4,8 +4,8 @@ import { FeatureConfigurationClient } from 'lib/types/stores/feature-strategies- import { Segment } from './feature-evaluator/strategy/strategy'; import { ISegment } from 'lib/types/model'; import { serializeDates } from '../../lib/types/serialize-dates'; -import { FeatureInterface } from './feature-evaluator/feature'; import { Operator } from './feature-evaluator/constraint'; +import { FeatureInterface } from 'unleash-client/lib/feature'; enum PayloadType { STRING = 'string', @@ -27,6 +27,7 @@ export const mapFeaturesForClient = ( type: variant.payload.type as unknown as PayloadType, }, })), + project: feature.project, strategies: feature.strategies.map((strategy) => ({ parameters: {}, ...strategy, diff --git a/yarn.lock b/yarn.lock index c6c911c399..a21d2cf05f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7395,10 +7395,10 @@ universalify@^2.0.0: resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== -unleash-client@3.15.0: - version "3.15.0" - resolved "https://registry.yarnpkg.com/unleash-client/-/unleash-client-3.15.0.tgz#6ba4d917a0d8d628e73267ae8114d261d210a1a9" - integrity sha512-pNfzJa7QWhtSMTGNhmanpgqjg3xIJK4gJgQiZdkJlUY6GPDXit8p4fGs94jC8zM/xzpa1ji9+sSx6GC9YDeCiQ== +unleash-client@3.16.0: + version "3.16.0" + resolved "https://registry.yarnpkg.com/unleash-client/-/unleash-client-3.16.0.tgz#f4d8100d10d86f4a3e51ad660b364d50e1aadfca" + integrity sha512-oqnAKIt7WLSw1t9L1dJLZGpXb7rRh8FPo40R8x7lTW5Hyd1dMAUS3AKvwfMLXm+Mszl8wWs+VXdr/00Mva2tBw== dependencies: ip "^1.1.5" make-fetch-happen "^10.0.0"