@eppo/js-client-sdk-common
Advanced tools
Comparing version 3.0.9 to 3.1.0
@@ -15,13 +15,54 @@ import { AssignmentCache, Cacheable } from '../assignment-cache'; | ||
* | ||
* @param flagKey feature flag identifier | ||
* @param subjectKey an identifier of the experiment subject, for example a user ID. | ||
* @param flagKey feature flag identifier | ||
* @param subjectAttributes optional attributes associated with the subject, for example name and email. | ||
* @param defaultValue default value to return if the subject is not part of the experiment sample | ||
* The subject attributes are used for evaluating any targeting rules tied to the experiment. | ||
* @returns a variation value if the subject is part of the experiment sample, otherwise null | ||
* @returns a variation value if the subject is part of the experiment sample, otherwise the default value | ||
* @public | ||
*/ | ||
getStringAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: string): string; | ||
/** | ||
* @deprecated use getBooleanAssignment instead. | ||
*/ | ||
getBoolAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: boolean): boolean; | ||
/** | ||
* Maps a subject to a boolean variation for a given experiment. | ||
* | ||
* @param flagKey feature flag identifier | ||
* @param subjectKey an identifier of the experiment subject, for example a user ID. | ||
* @param subjectAttributes optional attributes associated with the subject, for example name and email. | ||
* @param defaultValue default value to return if the subject is not part of the experiment sample | ||
* @returns a boolean variation value if the subject is part of the experiment sample, otherwise the default value | ||
*/ | ||
getBooleanAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: boolean): boolean; | ||
/** | ||
* Maps a subject to an Integer variation for a given experiment. | ||
* | ||
* @param flagKey feature flag identifier | ||
* @param subjectKey an identifier of the experiment subject, for example a user ID. | ||
* @param subjectAttributes optional attributes associated with the subject, for example name and email. | ||
* @param defaultValue default value to return if the subject is not part of the experiment sample | ||
* @returns a number variation value if the subject is part of the experiment sample, otherwise the default value | ||
*/ | ||
getIntegerAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: number): number; | ||
/** | ||
* Maps a subject to a Numeric variation for a given experiment. | ||
* | ||
* @param flagKey feature flag identifier | ||
* @param subjectKey an identifier of the experiment subject, for example a user ID. | ||
* @param subjectAttributes optional attributes associated with the subject, for example name and email. | ||
* @param defaultValue default value to return if the subject is not part of the experiment sample | ||
* @returns a number variation value if the subject is part of the experiment sample, otherwise the default value | ||
*/ | ||
getNumericAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: number): number; | ||
/** | ||
* Maps a subject to a JSON variation for a given experiment. | ||
* | ||
* @param flagKey feature flag identifier | ||
* @param subjectKey an identifier of the experiment subject, for example a user ID. | ||
* @param subjectAttributes optional attributes associated with the subject, for example name and email. | ||
* @param defaultValue default value to return if the subject is not part of the experiment sample | ||
* @returns a JSON object variation value if the subject is part of the experiment sample, otherwise the default value | ||
*/ | ||
getJSONAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: object): object; | ||
@@ -69,2 +110,3 @@ setLogger(logger: IAssignmentLogger): void; | ||
getBoolAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: boolean): boolean; | ||
getBooleanAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: boolean): boolean; | ||
getIntegerAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: number): number; | ||
@@ -71,0 +113,0 @@ getNumericAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: number): number; |
@@ -74,2 +74,5 @@ "use strict"; | ||
getBoolAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) { | ||
return this.getBooleanAssignment(flagKey, subjectKey, subjectAttributes, defaultValue); | ||
} | ||
getBooleanAssignment(flagKey, subjectKey, subjectAttributes, defaultValue) { | ||
var _a; | ||
@@ -76,0 +79,0 @@ return ((_a = this.getAssignmentVariation(flagKey, subjectKey, subjectAttributes, eppo_value_1.EppoValue.Bool(defaultValue), interfaces_1.VariationType.BOOLEAN).boolValue) !== null && _a !== void 0 ? _a : defaultValue); |
{ | ||
"name": "@eppo/js-client-sdk-common", | ||
"version": "3.0.9", | ||
"version": "3.1.0", | ||
"description": "Eppo SDK for client-side JavaScript applications (base for both web and react native)", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
577235
2141