diff --git a/src/storages/AbstractSplitsCacheAsync.ts b/src/storages/AbstractSplitsCacheAsync.ts index db127a97..ea2c25fc 100644 --- a/src/storages/AbstractSplitsCacheAsync.ts +++ b/src/storages/AbstractSplitsCacheAsync.ts @@ -1,6 +1,7 @@ import { ISplitsCacheAsync } from './types'; import { ISplit } from '../dtos/types'; import { objectAssign } from '../utils/lang/objectAssign'; +import { ISet } from '../utils/lang/sets'; /** * This class provides a skeletal implementation of the ISplitsCacheAsync interface @@ -17,6 +18,7 @@ export abstract class AbstractSplitsCacheAsync implements ISplitsCacheAsync { abstract getChangeNumber(): Promise abstract getAll(): Promise abstract getSplitNames(): Promise + abstract getNamesByFlagSets(flagsets: string[]): Promise> abstract trafficTypeExists(trafficType: string): Promise abstract clear(): Promise diff --git a/src/storages/AbstractSplitsCacheSync.ts b/src/storages/AbstractSplitsCacheSync.ts index 5bc76665..26b5f473 100644 --- a/src/storages/AbstractSplitsCacheSync.ts +++ b/src/storages/AbstractSplitsCacheSync.ts @@ -1,6 +1,7 @@ import { ISplitsCacheSync } from './types'; import { ISplit } from '../dtos/types'; import { objectAssign } from '../utils/lang/objectAssign'; +import { ISet, _Set } from '../utils/lang/sets'; /** * This class provides a skeletal implementation of the ISplitsCacheSync interface @@ -77,6 +78,11 @@ export abstract class AbstractSplitsCacheSync implements ISplitsCacheSync { } return false; } + /** NO-OP */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + getNamesByFlagSets(flagsets: string[]): ISet { + return new _Set([]); + } } diff --git a/src/storages/KeyBuilder.ts b/src/storages/KeyBuilder.ts index 262bcf39..a5f99f82 100644 --- a/src/storages/KeyBuilder.ts +++ b/src/storages/KeyBuilder.ts @@ -20,7 +20,7 @@ export class KeyBuilder { return `${this.prefix}.trafficType.${trafficType}`; } - buildFlagsetKey(flagset: string) { + buildFlagSetKey(flagset: string) { return `${this.prefix}.flagset.${flagset}`; } diff --git a/src/storages/__tests__/KeyBuilder.spec.ts b/src/storages/__tests__/KeyBuilder.spec.ts index 6da01a30..b91714fd 100644 --- a/src/storages/__tests__/KeyBuilder.spec.ts +++ b/src/storages/__tests__/KeyBuilder.spec.ts @@ -74,7 +74,7 @@ test('KEYS / flagset keys', () => { const flagsetName = 'flagset_x'; const expectedKey = `${prefix}.flagset.${flagsetName}`; - expect(builder.buildFlagsetKey(flagsetName)).toBe(expectedKey); + expect(builder.buildFlagSetKey(flagsetName)).toBe(expectedKey); }); diff --git a/src/storages/inLocalStorage/SplitsCacheInLocal.ts b/src/storages/inLocalStorage/SplitsCacheInLocal.ts index 9916da17..b959cd2b 100644 --- a/src/storages/inLocalStorage/SplitsCacheInLocal.ts +++ b/src/storages/inLocalStorage/SplitsCacheInLocal.ts @@ -108,8 +108,8 @@ export class SplitsCacheInLocal extends AbstractSplitsCacheSync { this._incrementCounts(split); this._decrementCounts(previousSplit); - if (previousSplit) this.removeFromFlagsets(previousSplit.name, previousSplit.sets); - this.addToFlagsets(split); + if (previousSplit) this.removeFromFlagSets(previousSplit.name, previousSplit.sets); + this.addToFlagSets(split); return true; } catch (e) { @@ -124,7 +124,7 @@ export class SplitsCacheInLocal extends AbstractSplitsCacheSync { localStorage.removeItem(this.keys.buildSplitKey(name)); this._decrementCounts(split); - if (split) this.removeFromFlagsets(split.name, split.sets); + if (split) this.removeFromFlagSets(split.name, split.sets); return true; } catch (e) { @@ -257,10 +257,10 @@ export class SplitsCacheInLocal extends AbstractSplitsCacheSync { // if the filter didn't change, nothing is done } - getNamesByFlagsets(flagsets: string[]): ISet{ + getNamesByFlagSets(flagsets: string[]): ISet{ let toReturn: ISet = new _Set([]); flagsets.forEach(flagset => { - const flagsetKey = this.keys.buildFlagsetKey(flagset); + const flagsetKey = this.keys.buildFlagSetKey(flagset); let flagsetFromLocalStorage = localStorage.getItem(flagsetKey); if (flagsetFromLocalStorage) { @@ -272,14 +272,14 @@ export class SplitsCacheInLocal extends AbstractSplitsCacheSync { } - private addToFlagsets(featureFlag: ISplit) { + private addToFlagSets(featureFlag: ISplit) { if (!featureFlag.sets) return; - featureFlag.sets.forEach(featureFlagset => { + featureFlag.sets.forEach(featureFlagSet => { - if (this.flagsetsFilter.length > 0 && !this.flagsetsFilter.some(filterFlagset => filterFlagset === featureFlagset)) return; + if (this.flagsetsFilter.length > 0 && !this.flagsetsFilter.some(filterFlagSet => filterFlagSet === featureFlagSet)) return; - const flagsetKey = this.keys.buildFlagsetKey(featureFlagset); + const flagsetKey = this.keys.buildFlagSetKey(featureFlagSet); let flagsetFromLocalStorage = localStorage.getItem(flagsetKey); if (!flagsetFromLocalStorage) flagsetFromLocalStorage = '[]'; @@ -291,7 +291,7 @@ export class SplitsCacheInLocal extends AbstractSplitsCacheSync { }); } - private removeFromFlagsets(featureFlagName: string, flagsets?: string[]) { + private removeFromFlagSets(featureFlagName: string, flagsets?: string[]) { if (!flagsets) return; flagsets.forEach(flagset => { @@ -300,7 +300,7 @@ export class SplitsCacheInLocal extends AbstractSplitsCacheSync { } private removeNames(flagsetName: string, featureFlagName: string) { - const flagsetKey = this.keys.buildFlagsetKey(flagsetName); + const flagsetKey = this.keys.buildFlagSetKey(flagsetName); let flagsetFromLocalStorage = localStorage.getItem(flagsetKey); diff --git a/src/storages/inLocalStorage/__tests__/SplitsCacheInLocal.spec.ts b/src/storages/inLocalStorage/__tests__/SplitsCacheInLocal.spec.ts index 7e9c25c9..e7c0df11 100644 --- a/src/storages/inLocalStorage/__tests__/SplitsCacheInLocal.spec.ts +++ b/src/storages/inLocalStorage/__tests__/SplitsCacheInLocal.spec.ts @@ -174,32 +174,32 @@ test('SPLIT CACHE / LocalStorage / flagset cache tests', () => { ]); cache.addSplit(featureFlagWithEmptyFS.name, featureFlagWithEmptyFS); - expect(cache.getNamesByFlagsets(['o'])).toEqual(new _Set(['ff_one', 'ff_two'])); - expect(cache.getNamesByFlagsets(['n'])).toEqual(new _Set(['ff_one'])); - expect(cache.getNamesByFlagsets(['e'])).toEqual(new _Set(['ff_one','ff_three'])); - expect(cache.getNamesByFlagsets(['t'])).toEqual(emptySet); // 't' not in filter - expect(cache.getNamesByFlagsets(['o','n','e'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); + expect(cache.getNamesByFlagSets(['o'])).toEqual(new _Set(['ff_one', 'ff_two'])); + expect(cache.getNamesByFlagSets(['n'])).toEqual(new _Set(['ff_one'])); + expect(cache.getNamesByFlagSets(['e'])).toEqual(new _Set(['ff_one','ff_three'])); + expect(cache.getNamesByFlagSets(['t'])).toEqual(emptySet); // 't' not in filter + expect(cache.getNamesByFlagSets(['o','n','e'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); cache.addSplit(featureFlagOne.name, {...featureFlagOne, sets: ['1']}); - expect(cache.getNamesByFlagsets(['1'])).toEqual(emptySet); // '1' not in filter - expect(cache.getNamesByFlagsets(['o'])).toEqual(new _Set(['ff_two'])); - expect(cache.getNamesByFlagsets(['n'])).toEqual(emptySet); + expect(cache.getNamesByFlagSets(['1'])).toEqual(emptySet); // '1' not in filter + expect(cache.getNamesByFlagSets(['o'])).toEqual(new _Set(['ff_two'])); + expect(cache.getNamesByFlagSets(['n'])).toEqual(emptySet); cache.addSplit(featureFlagOne.name, {...featureFlagOne, sets: ['x']}); - expect(cache.getNamesByFlagsets(['x'])).toEqual(new _Set(['ff_one'])); - expect(cache.getNamesByFlagsets(['o','e','x'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); + expect(cache.getNamesByFlagSets(['x'])).toEqual(new _Set(['ff_one'])); + expect(cache.getNamesByFlagSets(['o','e','x'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); cache.removeSplit(featureFlagOne.name); - expect(cache.getNamesByFlagsets(['x'])).toEqual(emptySet); + expect(cache.getNamesByFlagSets(['x'])).toEqual(emptySet); cache.removeSplit(featureFlagOne.name); - expect(cache.getNamesByFlagsets(['y'])).toEqual(emptySet); // 'y' not in filter - expect(cache.getNamesByFlagsets([])).toEqual(emptySet); + expect(cache.getNamesByFlagSets(['y'])).toEqual(emptySet); // 'y' not in filter + expect(cache.getNamesByFlagSets([])).toEqual(emptySet); cache.addSplit(featureFlagWithEmptyFS.name, featureFlagWithoutFS); - expect(cache.getNamesByFlagsets([])).toEqual(emptySet); + expect(cache.getNamesByFlagSets([])).toEqual(emptySet); }); // if FlagSets are not defined, it should store all FlagSets in memory. @@ -214,10 +214,10 @@ test('SPLIT CACHE / LocalStorage / flagset cache tests without filters', () => { ]); cacheWithoutFilters.addSplit(featureFlagWithEmptyFS.name, featureFlagWithEmptyFS); - expect(cacheWithoutFilters.getNamesByFlagsets(['o'])).toEqual(new _Set(['ff_one', 'ff_two'])); - expect(cacheWithoutFilters.getNamesByFlagsets(['n'])).toEqual(new _Set(['ff_one'])); - expect(cacheWithoutFilters.getNamesByFlagsets(['e'])).toEqual(new _Set(['ff_one','ff_three'])); - expect(cacheWithoutFilters.getNamesByFlagsets(['t'])).toEqual(new _Set(['ff_two','ff_three'])); - expect(cacheWithoutFilters.getNamesByFlagsets(['y'])).toEqual(emptySet); - expect(cacheWithoutFilters.getNamesByFlagsets(['o','n','e'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); + expect(cacheWithoutFilters.getNamesByFlagSets(['o'])).toEqual(new _Set(['ff_one', 'ff_two'])); + expect(cacheWithoutFilters.getNamesByFlagSets(['n'])).toEqual(new _Set(['ff_one'])); + expect(cacheWithoutFilters.getNamesByFlagSets(['e'])).toEqual(new _Set(['ff_one','ff_three'])); + expect(cacheWithoutFilters.getNamesByFlagSets(['t'])).toEqual(new _Set(['ff_two','ff_three'])); + expect(cacheWithoutFilters.getNamesByFlagSets(['y'])).toEqual(emptySet); + expect(cacheWithoutFilters.getNamesByFlagSets(['o','n','e'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); }); diff --git a/src/storages/inMemory/SplitsCacheInMemory.ts b/src/storages/inMemory/SplitsCacheInMemory.ts index d239712c..66a72dcc 100644 --- a/src/storages/inMemory/SplitsCacheInMemory.ts +++ b/src/storages/inMemory/SplitsCacheInMemory.ts @@ -36,7 +36,7 @@ export class SplitsCacheInMemory extends AbstractSplitsCacheSync { this.ttCache[previousTtName]--; if (!this.ttCache[previousTtName]) delete this.ttCache[previousTtName]; - this.removeFromFlagsets(previousSplit.name, previousSplit.sets); + this.removeFromFlagSets(previousSplit.name, previousSplit.sets); if (usesSegments(previousSplit)) { // Substract from segments count for the previous version of this Split. this.splitsWithSegmentsCount--; @@ -49,7 +49,7 @@ export class SplitsCacheInMemory extends AbstractSplitsCacheSync { // Update TT cache const ttName = split.trafficTypeName; this.ttCache[ttName] = (this.ttCache[ttName] || 0) + 1; - this.addToFlagsets(split); + this.addToFlagSets(split); // Add to segments count for the new version of the Split if (usesSegments(split)) this.splitsWithSegmentsCount++; @@ -69,7 +69,7 @@ export class SplitsCacheInMemory extends AbstractSplitsCacheSync { const ttName = split.trafficTypeName; this.ttCache[ttName]--; // Update tt cache if (!this.ttCache[ttName]) delete this.ttCache[ttName]; - this.removeFromFlagsets(split.name, split.sets); + this.removeFromFlagSets(split.name, split.sets); // Update the segments count. if (usesSegments(split)) this.splitsWithSegmentsCount--; @@ -105,7 +105,7 @@ export class SplitsCacheInMemory extends AbstractSplitsCacheSync { return this.getChangeNumber() === -1 || this.splitsWithSegmentsCount > 0; } - getNamesByFlagsets(flagsets: string[]): ISet{ + getNamesByFlagSets(flagsets: string[]): ISet{ let toReturn: ISet = new _Set([]); flagsets.forEach(flagset => { const featureFlagNames = this.flagsetsCache[flagset]; @@ -117,19 +117,19 @@ export class SplitsCacheInMemory extends AbstractSplitsCacheSync { } - private addToFlagsets(featureFlag: ISplit) { + private addToFlagSets(featureFlag: ISplit) { if (!featureFlag.sets) return; - featureFlag.sets.forEach(featureFlagset => { + featureFlag.sets.forEach(featureFlagSet => { - if (this.flagsetsFilter.length > 0 && !this.flagsetsFilter.some(filterFlagset => filterFlagset === featureFlagset)) return; + if (this.flagsetsFilter.length > 0 && !this.flagsetsFilter.some(filterFlagSet => filterFlagSet === featureFlagSet)) return; - if (!this.flagsetsCache[featureFlagset]) this.flagsetsCache[featureFlagset] = new _Set([]); + if (!this.flagsetsCache[featureFlagSet]) this.flagsetsCache[featureFlagSet] = new _Set([]); - this.flagsetsCache[featureFlagset].add(featureFlag.name); + this.flagsetsCache[featureFlagSet].add(featureFlag.name); }); } - private removeFromFlagsets(featureFlagName :string, flagsets: string[] | undefined) { + private removeFromFlagSets(featureFlagName :string, flagsets: string[] | undefined) { if (!flagsets) return; flagsets.forEach(flagset => { this.removeNames(flagset, featureFlagName); diff --git a/src/storages/inMemory/__tests__/SplitsCacheInMemory.spec.ts b/src/storages/inMemory/__tests__/SplitsCacheInMemory.spec.ts index 62f4e08f..1752d000 100644 --- a/src/storages/inMemory/__tests__/SplitsCacheInMemory.spec.ts +++ b/src/storages/inMemory/__tests__/SplitsCacheInMemory.spec.ts @@ -127,32 +127,32 @@ test('SPLITS CACHE / In Memory / flagset cache tests', () => { ]); cache.addSplit(featureFlagWithEmptyFS.name, featureFlagWithEmptyFS); - expect(cache.getNamesByFlagsets(['o'])).toEqual(new _Set(['ff_one', 'ff_two'])); - expect(cache.getNamesByFlagsets(['n'])).toEqual(new _Set(['ff_one'])); - expect(cache.getNamesByFlagsets(['e'])).toEqual(new _Set(['ff_one','ff_three'])); - expect(cache.getNamesByFlagsets(['t'])).toEqual(emptySet); // 't' not in filter - expect(cache.getNamesByFlagsets(['o','n','e'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); + expect(cache.getNamesByFlagSets(['o'])).toEqual(new _Set(['ff_one', 'ff_two'])); + expect(cache.getNamesByFlagSets(['n'])).toEqual(new _Set(['ff_one'])); + expect(cache.getNamesByFlagSets(['e'])).toEqual(new _Set(['ff_one','ff_three'])); + expect(cache.getNamesByFlagSets(['t'])).toEqual(emptySet); // 't' not in filter + expect(cache.getNamesByFlagSets(['o','n','e'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); cache.addSplit(featureFlagOne.name, {...featureFlagOne, sets: ['1']}); - expect(cache.getNamesByFlagsets(['1'])).toEqual(emptySet); // '1' not in filter - expect(cache.getNamesByFlagsets(['o'])).toEqual(new _Set(['ff_two'])); - expect(cache.getNamesByFlagsets(['n'])).toEqual(emptySet); + expect(cache.getNamesByFlagSets(['1'])).toEqual(emptySet); // '1' not in filter + expect(cache.getNamesByFlagSets(['o'])).toEqual(new _Set(['ff_two'])); + expect(cache.getNamesByFlagSets(['n'])).toEqual(emptySet); cache.addSplit(featureFlagOne.name, {...featureFlagOne, sets: ['x']}); - expect(cache.getNamesByFlagsets(['x'])).toEqual(new _Set(['ff_one'])); - expect(cache.getNamesByFlagsets(['o','e','x'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); + expect(cache.getNamesByFlagSets(['x'])).toEqual(new _Set(['ff_one'])); + expect(cache.getNamesByFlagSets(['o','e','x'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); cache.removeSplit(featureFlagOne.name); - expect(cache.getNamesByFlagsets(['x'])).toEqual(emptySet); + expect(cache.getNamesByFlagSets(['x'])).toEqual(emptySet); cache.removeSplit(featureFlagOne.name); - expect(cache.getNamesByFlagsets(['y'])).toEqual(emptySet); // 'y' not in filter - expect(cache.getNamesByFlagsets([])).toEqual(emptySet); + expect(cache.getNamesByFlagSets(['y'])).toEqual(emptySet); // 'y' not in filter + expect(cache.getNamesByFlagSets([])).toEqual(emptySet); cache.addSplit(featureFlagWithEmptyFS.name, featureFlagWithoutFS); - expect(cache.getNamesByFlagsets([])).toEqual(emptySet); + expect(cache.getNamesByFlagSets([])).toEqual(emptySet); }); // if FlagSets are not defined, it should store all FlagSets in memory. @@ -167,10 +167,10 @@ test('SPLIT CACHE / LocalStorage / flagset cache tests without filters', () => { ]); cacheWithoutFilters.addSplit(featureFlagWithEmptyFS.name, featureFlagWithEmptyFS); - expect(cacheWithoutFilters.getNamesByFlagsets(['o'])).toEqual(new _Set(['ff_one', 'ff_two'])); - expect(cacheWithoutFilters.getNamesByFlagsets(['n'])).toEqual(new _Set(['ff_one'])); - expect(cacheWithoutFilters.getNamesByFlagsets(['e'])).toEqual(new _Set(['ff_one','ff_three'])); - expect(cacheWithoutFilters.getNamesByFlagsets(['t'])).toEqual(new _Set(['ff_two','ff_three'])); - expect(cacheWithoutFilters.getNamesByFlagsets(['y'])).toEqual(emptySet); - expect(cacheWithoutFilters.getNamesByFlagsets(['o','n','e'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); + expect(cacheWithoutFilters.getNamesByFlagSets(['o'])).toEqual(new _Set(['ff_one', 'ff_two'])); + expect(cacheWithoutFilters.getNamesByFlagSets(['n'])).toEqual(new _Set(['ff_one'])); + expect(cacheWithoutFilters.getNamesByFlagSets(['e'])).toEqual(new _Set(['ff_one','ff_three'])); + expect(cacheWithoutFilters.getNamesByFlagSets(['t'])).toEqual(new _Set(['ff_two','ff_three'])); + expect(cacheWithoutFilters.getNamesByFlagSets(['y'])).toEqual(emptySet); + expect(cacheWithoutFilters.getNamesByFlagSets(['o','n','e'])).toEqual(new _Set(['ff_one','ff_two','ff_three'])); }); diff --git a/src/storages/inRedis/SplitsCacheInRedis.ts b/src/storages/inRedis/SplitsCacheInRedis.ts index 43f86481..ac6004b0 100644 --- a/src/storages/inRedis/SplitsCacheInRedis.ts +++ b/src/storages/inRedis/SplitsCacheInRedis.ts @@ -5,6 +5,7 @@ import { ILogger } from '../../logger/types'; import { LOG_PREFIX } from './constants'; import { ISplit } from '../../dtos/types'; import { AbstractSplitsCacheAsync } from '../AbstractSplitsCacheAsync'; +import { ISet, _Set } from '../../utils/lang/sets'; /** * Discard errors for an answer of multiple operations. @@ -188,6 +189,17 @@ export class SplitsCacheInRedis extends AbstractSplitsCacheAsync { ); } + /** + * Get list of split names related to a given flagset names list. + * The returned promise is resolved with the list of split names, + * or rejected if wrapper operation fails. + * @todo this is a no-op method to be implemented + */ + getNamesByFlagSets(): Promise> { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + return new Promise(flagSets => new _Set([])); + } + /** * Check traffic type existence. * The returned promise is resolved with a boolean indicating whether the TT exist or not. diff --git a/src/storages/pluggable/SplitsCachePluggable.ts b/src/storages/pluggable/SplitsCachePluggable.ts index 47421987..4eba04e0 100644 --- a/src/storages/pluggable/SplitsCachePluggable.ts +++ b/src/storages/pluggable/SplitsCachePluggable.ts @@ -5,6 +5,7 @@ import { ILogger } from '../../logger/types'; import { ISplit } from '../../dtos/types'; import { LOG_PREFIX } from './constants'; import { AbstractSplitsCacheAsync } from '../AbstractSplitsCacheAsync'; +import { ISet, _Set } from '../../utils/lang/sets'; /** * ISplitsCacheAsync implementation for pluggable storages. @@ -154,6 +155,17 @@ export class SplitsCachePluggable extends AbstractSplitsCacheAsync { ); } + /** + * Get list of split names related to a given flagset names list. + * The returned promise is resolved with the list of split names, + * or rejected if wrapper operation fails. + * @todo this is a no-op method to be implemented + */ + getNamesByFlagSets(): Promise> { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + return new Promise(flagSets => new _Set([])); + } + /** * Check traffic type existence. * The returned promise is resolved with a boolean indicating whether the TT exist or not. diff --git a/src/storages/types.ts b/src/storages/types.ts index dc2dfbc2..ab24a479 100644 --- a/src/storages/types.ts +++ b/src/storages/types.ts @@ -1,6 +1,7 @@ import { MaybeThenable, ISplit } from '../dtos/types'; import { EventDataType, HttpErrors, HttpLatencies, ImpressionDataType, LastSync, Method, MethodExceptions, MethodLatencies, MultiMethodExceptions, MultiMethodLatencies, MultiConfigs, OperationType, StoredEventWithMetadata, StoredImpressionWithMetadata, StreamingEvent, UniqueKeysPayloadCs, UniqueKeysPayloadSs, TelemetryUsageStatsPayload, UpdatesFromSSEEnum } from '../sync/submitters/types'; import { SplitIO, ImpressionDTO, ISettings } from '../types'; +import { ISet } from '../utils/lang/sets'; /** * Interface of a pluggable storage wrapper. @@ -208,7 +209,8 @@ export interface ISplitsCacheBase { clear(): MaybeThenable, // should never reject or throw an exception. Instead return false by default, to avoid emitting SDK_READY_FROM_CACHE. checkCache(): MaybeThenable, - killLocally(name: string, defaultTreatment: string, changeNumber: number): MaybeThenable + killLocally(name: string, defaultTreatment: string, changeNumber: number): MaybeThenable, + getNamesByFlagSets(flagsets: string[]): MaybeThenable> } export interface ISplitsCacheSync extends ISplitsCacheBase { @@ -224,7 +226,8 @@ export interface ISplitsCacheSync extends ISplitsCacheBase { usesSegments(): boolean, clear(): void, checkCache(): boolean, - killLocally(name: string, defaultTreatment: string, changeNumber: number): boolean + killLocally(name: string, defaultTreatment: string, changeNumber: number): boolean, + getNamesByFlagSets(flagsets: string[]): ISet } export interface ISplitsCacheAsync extends ISplitsCacheBase { @@ -240,7 +243,8 @@ export interface ISplitsCacheAsync extends ISplitsCacheBase { usesSegments(): Promise, clear(): Promise, checkCache(): Promise, - killLocally(name: string, defaultTreatment: string, changeNumber: number): Promise + killLocally(name: string, defaultTreatment: string, changeNumber: number): Promise, + getNamesByFlagSets(flagsets: string[]): Promise> } /** Segments cache */