import { PublicEnvironment, PublicFeature, PublicProject, PublicVariable } from '../../config/configBody'; import type { VariableValue } from '../../config/models'; import 'reflect-metadata'; export declare const SDKTypeValues: string[]; export type SDKTypes = (typeof SDKTypeValues)[number]; export type QueryParams = { [key: string]: string; }; export declare enum EVAL_REASONS { TARGETING_MATCH = "TARGETING_MATCH", SPLIT = "SPLIT", DEFAULT = "DEFAULT", DISABLED = "DISABLED", ERROR = "ERROR", OVERRIDE = "OVERRIDE", OPT_IN = "OPT_IN" } export declare enum EVAL_REASON_DETAILS { ALL_USERS = "All Users", AUDIENCE_MATCH = "Audience Match", NOT_IN_AUDIENCE = "Not in Audience", OPT_IN = "Opt-In", NOT_OPTED_IN = "Not Opt-In", OVERRIDE = "Override", USER_ID = "User ID", EMAIL = "Email", COUNTRY = "Country", PLATFORM = "Platform", PLATFORM_VERSION = "Platform Version", APP_VERSION = "App Version", DEVICE_MODEL = "Device Model", CUSTOM_DATA = "Custom Data", RANDOM_DISTRIBUTION = "Random Distribution", ROLLOUT = "Rollout" } export declare enum DEFAULT_REASON_DETAILS { MISSING_CONFIG = "Missing Config", MISSING_VARIABLE = "Missing Variable", MISSING_FEATURE = "Missing Feature", MISSING_VARIATION = "Missing Variation", MISSING_VARIABLE_FOR_VARIATION = "Missing Variable for Variation", USER_NOT_IN_ROLLOUT = "User Not in Rollout", USER_NOT_TARGETED = "User Not Targeted", INVALID_VARIABLE_TYPE = "Invalid Variable Type", TYPE_MISMATCH = "Variable Type Mismatch", UNKNOWN = "Unknown", ERROR = "Error" } export type EvalReason = { reason: EVAL_REASONS; details?: string; target_id?: string; }; export type DVCCustomDataJSON = { [key: string]: string | number | boolean | null; }; /** * Base API User Schema used by the Bucketing API where the only required field is user_id. */ export declare class DVCAPIUser { isAnonymous?: boolean; user_id: string; /** * Email used for identifying a device user in the dashboard, * or used for audience segmentation. */ email?: string; /** * Name of the user which can be used for identifying a device user, * or used for audience segmentation. */ name?: string; /** * ISO 639-1 two-letter codes */ language?: string; /** * ISO 3166 alpha-2 */ country?: string; /** * Application Version, can be used for audience segmentation. */ appVersion?: string; /** * Application Build, can be used for audience segmentation. */ appBuild?: number; /** * Custom JSON data used for audience segmentation, must be limited to __kb in size. * Values will be logged to DevCycle's servers and available in the dashboard to view. */ customData?: DVCCustomDataJSON; /** * Private Custom JSON data used for audience segmentation, must be limited to __kb in size. * Values will not be logged to DevCycle's servers and * will not be available in the dashboard. */ privateCustomData?: DVCCustomDataJSON; /** * Set by SDK automatically */ createdDate?: Date; /** * Set by SDK automatically */ lastSeenDate?: Date; /** * Set by SDK to 'web' */ platform?: string; /** * Set by SDK to ?? */ platformVersion?: string; /** * Set by SDK to User-Agent */ deviceModel?: string; /** * SDK type */ sdkType?: SDKTypes; /** * SDK Version */ sdkVersion?: string; } export declare class DVCBucketingUser extends DVCAPIUser { /** * JSON data recording user opt-in features. */ optIns?: Record; } /** * Client API User Schema that extends the base DVCAPIUser schema to add fields * from the Client SDKs like: isAnonymous, isDebug. * Also changes certain fields to be required from the Client SDKs. */ export declare class DVCClientAPIUser implements DVCAPIUser { /** * Users must be explicitly defined as anonymous, where the SDK will * generate a random `user_id` for them. If they are `isAnonymous = false` * a `user_id` value must be provided. */ isAnonymous: boolean; user_id: string; /** * Email used for identifying a device user in the dashboard, * or used for audience segmentation. */ email?: string; /** * Name of the user which can be used for identifying a device user, * or used for audience segmentation. */ name?: string; /** * ISO 639-1 two-letter codes */ language?: string; /** * ISO 3166 alpha-2 */ country?: string; /** * Application Version, can be used for audience segmentation. */ appVersion?: string; /** * Application Build, can be used for audience segmentation. */ appBuild?: number; /** * Custom JSON data used for audience segmentation, must be limited to __kb in size. * Values will be logged to DevCycle's servers and available in the dashboard to view. */ customData?: DVCCustomDataJSON; /** * Private Custom JSON data used for audience segmentation, must be limited to __kb in size. * Values will not be logged to DevCycle's servers and * will not be available in the dashboard. */ privateCustomData?: DVCCustomDataJSON; /** * Set by SDK automatically */ createdDate: Date; /** * Set by SDK automatically */ lastSeenDate: Date; /** * Set by SDK to 'web' */ platform: string; /** * Set by SDK to ?? */ platformVersion: string; /** * Set by SDK to User-Agent */ deviceModel: string; /** * SDK type */ sdkType: SDKTypes; /** * SDK Version */ sdkVersion: string; isDebug?: boolean; } export declare class DVCOptInUser { user_id: string; } export type SDKVariable = PublicVariable & { value: VariableValue; _feature?: string; /** * @deprecated use eval instead */ evalReason?: unknown; eval?: EvalReason; }; export type SDKFeature = Pick & { _variation: string; variationName: string; variationKey: string; /** * @deprecated use eval instead */ evalReason?: unknown; eval?: EvalReason; }; type FeatureVariation = { _feature: string; _variation: string; }; export interface BucketedUserConfig { /** * Project data used for logging */ project: PublicProject; /** * Environment data used for logging */ environment: PublicEnvironment; /** * Mapping of `ClientSDKFeature.key` to `ClientSDKFeature` values. * SDK uses this object to log `allBucketedFeatures()` */ features: { [key: string]: SDKFeature; }; /** * Map of `feature._id` to `variation._id` used for event logging. */ featureVariationMap: Record; /** * Map<`variable.key`, FeatureVariation> used for aggregated event logging. */ variableVariationMap: Record; /** * Mapping of `ClientSDKDynamicVariable.key` to `ClientSDKDynamicVariable` values. * SDK uses this object to retrieve bucketed values for variables. */ variables: { [key: string]: SDKVariable; }; /** * Information about how to establish a streaming connection to receive config updates */ sse?: { url?: string; inactivityDelay?: number; }; /** * the etag representing the CDN config used to generate this bucketed config. Can be used to determine config * staleness. */ etag?: string; /** * Settings for the bucketed config. */ settings?: { /** * If true, the bucketed config will filter out featureVars per evaluation. */ filterFeatureVars?: boolean; }; } export {};