UNPKG

@flagship.io/js-sdk

Version:
285 lines (284 loc) 21.5 kB
import { SdkInfoType } from '../types'; /** * SDK language */ export declare const SDK_INFO: SdkInfoType; /** * Default request timeout in second */ export declare const REQUEST_TIME_OUT = 2; export declare const FETCH_FLAG_BUFFERING_DEFAULT_TIME = 2; export declare const DEFAULT_DEDUPLICATION_TIME = 2.5; export declare const DEFAULT_POLLING_INTERVAL = 5; export declare const DEFAULT_SERVER_TIME_INTERVAL = 10; export declare const DEFAULT_SERVER_POOL_MAX_SIZE = 100; export declare const DEFAULT_BROWSER_TIME_INTERVAL = 5; export declare const DEFAULT_BROWSER_POOL_MAX_SIZE = 10; export declare const BATCH_MAX_SIZE = 2500000; export declare const ANALYTIC_HIT_ALLOCATION = 1; export declare const MAX_COLLECTING_TIME_MS = 30000; export declare const MAX_LAST_COLLECTING_TIME_MS = 120000; export declare const MAX_CLICK_PATH_LENGTH = 1900; export declare const MAX_SCORING_POLLING_TIME = 120000; export declare const SCROLL_END_DELAY_MS = 200; export declare const CLICK_PATH_DELAY_MS = 500; export declare const SCORING_INTERVAL = 5000; /** * Decision api base url */ export declare const BASE_API_URL = "https://decision.flagship.io/v2/"; export declare const HIT_API_URL = "https://ariane.abtasty.com"; export declare const HIT_EVENT_URL = "https://events.flagship.io"; export declare const TROUBLESHOOTING_HIT_URL = "https://events.flagship.io/troubleshooting"; export declare const USAGE_HIT_URL = "https://events.flagship.io/analytics"; export declare const BUCKETING_API_URL = "https://cdn.flagship.io/{0}/bucketing.json"; export declare const BUCKETING_API_CONTEXT_URL = "https://decision.flagship.io/v2/{0}/events"; export declare const THIRD_PARTY_SEGMENT_URL = "https://api-data-connector.flagship.io/accounts/{0}/segments/{1}"; export declare const HIT_CONSENT_URL = "https://ariane.abtasty.com"; export declare const URL_CAMPAIGNS = "/campaigns"; export declare const URL_ACTIVATE_MODIFICATION = "activate"; export declare const QA_ASSISTANT_PROD_URL = "https://qa-assistant.flagship.io/bundle.js"; export declare const QA_ASSISTANT_STAGING_URL = "https://staging-qa-assistant.flagship.io/bundle.js"; export declare const QA_ASSISTANT_LOCAL_URL = "https://local-qa-assistant.flagship.io:5000/bundle.js"; export declare const FS_QA_ASSISTANT = "fs_qa_assistant"; export declare const FS_QA_ASSISTANT_STAGING = "fs_qa_assistant_staging"; export declare const FS_QA_ASSISTANT_LOCAL = "fs_qa_assistant_local"; export declare const TAG_QA_ASSISTANT = "abtasty_qa_assistant"; export declare const TAG_QA_ASSISTANT_STAGING = "abtasty_qa_assistant_staging"; export declare const TAG_QA_ASSISTANT_LOCAL = "abtasty_qa_assistant_local"; export declare const TAG_QA_URL = "qa-assistant.abtasty.com"; export declare const FS_QA_URL = "qa-assistant.flagship.io"; export declare const EXPOSE_ALL_KEYS = "exposeAllKeys"; export declare const SEND_CONTEXT_EVENT = "sendContextEvent"; export declare const FS_CONSENT = "fs_consent"; export declare const FS_IS_QA_MODE_ENABLED = "FS_IS_QA_MODE_ENABLED"; export declare const FS_FORCED_VARIATIONS = "FS_FORCED_VARIATIONS"; export declare const FS_QA_ASSISTANT_SCRIPT_TAG_ID = "FS_QA_ASSISTANT_SCRIPT_TAG_ID"; export declare const EMOTION_AI_UC_URL = "https://uc-info.flagship.io/v1/segments/clients/{0}/visitors/{1}"; export declare const CDN_ACCOUNT_SETTINGS_URL = "https://cdn.flagship.io/{0}/accountSettings.json"; export declare const VISITOR_EAI_SCORE_KEY = "{0}_EAIScore"; export declare const EMOTION_AI_EVENT_URL = "https://events.flagship.io/emotionsai"; export declare const SEND_EAI_EVENT = "sendEAIEvent"; export declare const SEND_EAI_EVENT_ERROR = "Failed to send Emotion AI event: {0}"; export declare const SEND_EAI_EVENT_SUCCESS = "Emotion AI event sent: {0}"; export declare const FETCH_EAI_SCORE = "fetchEAIScore"; export declare const FETCH_EAI_SCORE_ERROR = "visitor {0}, Failed to fetch EAIScore: {1}"; export declare const FETCH_EAI_SCORE_SUCCESS = "visitor {0}, EAIScore fetched: {1}"; export declare const EAI_SCORE_CONTEXT_KEY = "eai::eas"; export declare const CLIENT_CACHE_KEY = "FS_CLIENT_VISITOR"; /** * SDK version */ export declare const SDK_VERSION = "5.1.5"; export declare const VISITOR_CACHE_VERSION = 1; export declare const HIT_CACHE_VERSION = 1; export declare const DEFAULT_HIT_CACHE_TIME_MS = 14400000; export declare const MAX_ACTIVATE_HIT_PER_BATCH = 100; /** * Message Info */ export declare const SDK_STARTED_INFO = "Flagship SDK (version: {0}) {1} in **{2}** mode"; export declare const FLAGSHIP_SDK = "Flagship SDK"; export declare const EMIT_READY = "ready"; export declare const EMIT_STATUS = "status"; export declare const NO_BATCHING_WITH_CONTINUOUS_CACHING_STRATEGY = 3; export declare const JS_DOC_URL = "https://docs.developers.flagship.io/docs/js-v3"; export declare const PANIC_MODE_DOC_URL = "https://docs.developers.flagship.io/docs/glossary#panic-mode"; /** * Message Error */ export declare const INITIALIZATION_PARAM_ERROR = "Params 'envId' and 'apiKey' must not be null or empty.\n Learn more: https://docs.developers.flagship.io/docs/js-v3#initialization"; export declare const ERROR = "error"; export declare const CONTEXT_NULL_ERROR = "Context must not to be null"; export declare const CONTEXT_PARAM_ERROR = "params {0} must be a non null String, and 'value' must be one of the following types , Number, Boolean"; export declare const GET_MODIFICATION_CAST_ERROR = "Modification for key {0} has a different type. Default value is returned."; export declare const GET_MODIFICATION_MISSING_ERROR = "No modification for key {0}. Default value is returned."; export declare const GET_MODIFICATION_KEY_ERROR = "Key {0} must not be null. Default value is returned."; export declare const ACTIVATE_MODIFICATION_KEY_ERROR = "Key {0} must not be null, no activate will be sent."; export declare const GET_MODIFICATION_ERROR = "No modification for key {0}."; export declare const GET_FLAG_ERROR = "No flag for key {0}."; export declare const ACTIVATE_MODIFICATION_ERROR = "No modification for key {0}, no activate will be sent."; export declare const DECISION_MANAGER_MISSING_ERROR = "decisionManager must not be null."; export declare const TRACKER_MANAGER_MISSING_ERROR = "trackerManager must not be null."; export declare const CURL_LIBRARY_IS_NOT_LOADED = "curl library is not loaded"; export declare const TYPE_ERROR = "{0} must be a {1}"; export declare const TYPE_INTEGER_ERROR = "value of {0} is not an {1}, it will be truncated to {1}"; export declare const VISITOR_ID_ERROR = "visitorId must not be null or empty"; export declare const PANIC_MODE_ERROR = "{0} deactivated while panic mode is on."; export declare const METHOD_DEACTIVATED_CONSENT_ERROR = "Method {0} is deactivated for visitor {1} : visitor did not consent."; export declare const METHOD_DEACTIVATED_ERROR = "Visitor {0}, method {1} is deactivated while SDK status is: {2}."; export declare const METHOD_DEACTIVATED_SEND_CONSENT_ERROR = "Send consent hit is deactivated while SDK status is: {1}."; export declare const TROUBLESHOOTING_HIT_ADDED_IN_QUEUE = "The TROUBLESHOOTING HIT has been added to the pool queue : {0}"; export declare const ANALYTICS_HIT_ADDED_IN_QUEUE = "The USAGE HIT has been added to the pool queue : {0}"; export declare const ACTIVATE_ADDED_IN_QUEUE = "The ACTIVATE has been added to the pool queue : {0}"; export declare const HIT_ADDED_IN_QUEUE = "The HIT has been added into the pool queue : {0}"; export declare const ADD_HIT = "ADD HIT"; export declare const ADD_TROUBLESHOOTING_HIT = "ADD TROUBLESHOOTING HIT"; export declare const ADD_USAGE_HIT = "ADD USAGE HIT"; export declare const ADD_ACTIVATE = "ADD ACTIVATE"; export declare const BATCH_SENT_SUCCESS = "Batch hit has been sent : {0}"; export declare const TROUBLESHOOTING_SENT_SUCCESS = "Troubleshooting hit has been sent : {0}"; export declare const ANALYTICS_HIT_SENT_SUCCESS = "Usage hit has been sent : {0}"; export declare const ACTIVATE_SENT_SUCCESS = "Activate hit has been sent : {0}"; export declare const SEND_BATCH = "SEND BATCH"; export declare const SEND_TROUBLESHOOTING = "SEND TROUBLESHOOTING"; export declare const SEND_USAGE_HIT = "SEND USAGE HIT"; export declare const SEND_ACTIVATE = "SEND ACTIVATE"; export declare const SEND_SEGMENT_HIT = "SEND SEGMENT HIT"; export declare const SEND_HIT = "SEND HIT"; export declare const EVENT_SUFFIX = "events"; export declare const FETCH_FLAGS_BUFFERING_MESSAGE = "Visitor {0}, fetchFlags has been ignored and will continue to be ignored for the next {1}ms, this delay can be changed with `fetchFlagsBufferingTime` option in the SDK config"; export declare const VISITOR_SYNC_FLAGS_MESSAGE = "without calling `fetchFlags` method afterwards. So, the value of the flag `{1}` might be outdated"; export declare const NEW_VISITOR_NOT_READY = "You can't create a new visitor without first calling the \"Flagship.start\" method.\nLearn more: https://docs.developers.flagship.io/docs/js-v3#initialization\n"; export declare const LOOKUP_HITS_JSON_OBJECT_ERROR = "JSON DATA must fit the type HitCacheDTO"; export declare const ACTIVATE_BATCH_LENGTH = 5; export declare const PROCESS = "process"; export declare const PROCESS_INITIALIZATION = "INITIALIZATION"; export declare const PROCESS_UPDATE_CONTEXT = "UPDATE CONTEXT"; export declare const PROCESS_GET_MODIFICATION = "GET MODIFICATION"; export declare const PROCESS_GET_MODIFICATION_INFO = "GET MODIFICATION INFO"; export declare const PROCESS_NEW_VISITOR = "NEW VISITOR"; export declare const PROCESS_ACTIVE_MODIFICATION = "ACTIVE MODIFICATION"; export declare const PROCESS_SYNCHRONIZED_MODIFICATION = "SYNCHRONIZED MODIFICATION"; export declare const PROCESS_SEND_HIT = "ADD HIT"; export declare const PROCESS_SEND_ACTIVATE = "SEND ACTIVATE"; export declare const PROCESS_GET_CAMPAIGNS = "GET CAMPAIGNS"; export declare const PROCESS_GET_ALL_MODIFICATION = "GET ALL MODIFICATIONS"; export declare const PROCESS_MODIFICATIONS_FOR_CAMPAIGN = "GET MODIFICATION FOR CAMPAIGN"; export declare const PROCESS_CACHE_HIT = "CACHE HIT"; export declare const PROCESS_FLUSH_HIT = "FLUSH HIT"; export declare const PROCESS_LOOKUP_HIT = "LOOKUP HIT"; export declare const BATCH = "batch"; export declare const CUSTOMER_ENV_ID_API_ITEM = "cid"; export declare const CUSTOMER_ENV_ID_API_ACTIVATE = "cid"; export declare const CUSTOMER_UID = "cuid"; export declare const ANONYMOUS_ID = "aid"; export declare const VISITOR_ID_API_ITEM = "vid"; export declare const VARIATION_GROUP_ID_API_ITEM = "caid"; export declare const VARIATION_GROUP_ID_API_ITEM_ACTIVATE = "caid"; export declare const VISITOR_CONSENT = "vc"; export declare const CAMPAIGN_ID = "caid"; export declare const VARIATION_ID_API_ITEM = "vaid"; export declare const DS_API_ITEM = "ds"; export declare const T_API_ITEM = "t"; export declare const QT_API_ITEM = "qt"; export declare const QA_MODE_API_ITEM = "qa"; export declare const DL_API_ITEM = "dl"; export declare const SL_ITEM = "sl"; export declare const SDK_APP = "APP"; export declare const TID_API_ITEM = "tid"; export declare const TA_API_ITEM = "ta"; export declare const TT_API_ITEM = "tt"; export declare const TC_API_ITEM = "tc"; export declare const TCC_API_ITEM = "tcc"; export declare const ICN_API_ITEM = "icn"; export declare const SM_API_ITEM = "sm"; export declare const PM_API_ITEM = "pm"; export declare const TR_API_ITEM = "tr"; export declare const TS_API_ITEM = "ts"; export declare const IN_API_ITEM = "in"; export declare const IC_API_ITEM = "ic"; export declare const IP_API_ITEM = "ip"; export declare const IQ_API_ITEM = "iq"; export declare const IV_API_ITEM = "iv"; export declare const S_API_ITEM = "s"; export declare const EVENT_CATEGORY_API_ITEM = "ec"; export declare const EVENT_ACTION_API_ITEM = "ea"; export declare const EVENT_LABEL_API_ITEM = "el"; export declare const EVENT_VALUE_API_ITEM = "ev"; export declare const USER_IP_API_ITEM = "uip"; export declare const SCREEN_RESOLUTION_API_ITEM = "sr"; export declare const USER_LANGUAGE = "ul"; export declare const SESSION_NUMBER = "sn"; export declare const HEADER_X_API_KEY = "x-api-key"; export declare const HEADER_X_ENV_ID = "x-env-id"; export declare const HEADER_CONTENT_TYPE = "Content-Type"; export declare const HEADER_X_SDK_CLIENT = "x-sdk-client"; export declare const HEADER_X_SDK_VERSION = "x-sdk-version"; export declare const HEADER_APPLICATION_JSON = "application/json"; export declare const INITIALIZATION_STARTING = "Flagship SDK version {0} is starting in {1} mode with config {2}"; export declare const BUCKETING_POOLING_STARTED = "Bucketing polling process has been started"; export declare const BUCKETING_POOLING_STOPPED = "Bucketing polling process has been stopped"; export declare const PROCESS_BUCKETING = "BUCKETING"; export declare const POLLING_EVENT_200 = "Polling event with code status 200 : {0}"; export declare const POLLING_EVENT_300 = "Polling event with code status 304"; export declare const POLLING_EVENT_FAILED = "Polling event failed with error"; export declare const PROCESS_SDK_STATUS = "SDK STATUS"; export declare const SDK_STATUS_CHANGED = "SDK status has changed: {0}"; export declare const SAVE_VISITOR_INSTANCE = "Visitor {0} has been saved in SDK instance"; export declare const VISITOR_CREATED = "Visitor {0} has been created with context {1}, isAuthenticated:{2} and hasConsented {3}"; export declare const VISITOR_PROFILE_LOADED = "Visitor profile has been loaded {0}"; export declare const VISITOR_ID_FROM_AB_TASTY_TAG = "The visitor ID '{0}' has been retrieved from ABTasty tag"; export declare const VISITOR_ID_GENERATED = "Visitor identifier is empty. A UUID {0} has been generated."; export declare const PREDEFINED_CONTEXT_LOADED = "Predefined Context have been loaded {0}"; export declare const CONTEXT_KEY_ERROR = "Visitor {0}, the key '{1}' must be a non null String.\nLearn more: https://docs.developers.flagship.io/docs/js-v3#updating-the-visitor-context"; export declare const CONTEXT_VALUE_ERROR = "Visitor {0}, 'value' for key '{1}[], must be one of the following types : String, Number, Boolean\nLearn more: https://docs.developers.flagship.io/docs/js-v3#updating-the-visitor-context"; export declare const PREDEFINED_CONTEXT_TYPE_ERROR = "visitor {0}, Predefined Context {0} must be of type {1}\nLearn more: https://docs.developers.flagship.io/docs/js-v3#predefined-user-context-keys-"; export declare const CONTEXT_KEY_VALUE_UPDATE = "visitor `{0}`, context have been updated: key {1}, value {2}, Context {3}"; export declare const CONTEXT_OBJET_PARAM_UPDATE = "visitor `{0}`, context have been updated: key/value {1}, Context {2}"; export declare const CLEAR_CONTEXT = "visitor `{0}`, context has been cleared cleared `{1}`"; export declare const PROCESS_CLEAR_CONTEXT = "CLEAR_CONTEXT"; export declare const CONSENT_CHANGED = "Visitor `{0}` consent has been changed : {1}"; export declare const PROCESS_SET_CONSENT = "SET_CONSENT"; export declare const FETCH_CAMPAIGNS_SUCCESS = "Visitor {0}, anonymousId {1} with context {2} has just fetched campaigns {3} in {4} ms"; export declare const FETCH_CAMPAIGNS_FROM_CACHE = "Visitor {0}, anonymousId {1} with context {2} has just fetched campaigns from cache {3} in {4} ms"; export declare const FETCH_FLAGS_FROM_CAMPAIGNS = "Visitor {0}, anonymousId {1} with context {2} has just fetched flags {3} from Campaigns"; export declare const FETCH_FLAGS_STARTED = "visitor `{0}` fetchFlags process is started"; export declare const FETCH_FLAGS_PANIC_MODE = "Panic mode is enabled : all feature are disabled except fetchFlags."; export declare const PROCESS_FETCHING_FLAGS = "FETCH_FLAGS"; export declare const GET_FLAG_MISSING_ERROR = "For the visitor \"{0}\", no flags were found with the key \"{1}\". Therefore, the default value \"{2}\" has been returned."; export declare const GET_FLAG_NOT_FOUND = "For the visitor \"{0}\", no flags were found with the key \"{1}\". Therefore, an empty flag has been returned."; export declare const FETCH_FLAGS_MISSING = "Visitor {0} has {1} without calling fetchFlags method, "; export declare const FLAG_VALUE = "FLAG_VALUE"; export declare const GET_FLAG = "GET_FLAG"; export declare const GET_FLAG_CAST_ERROR = "For the visitor \"{0}\", the flag with key \"{1}\" has a different type compared to the default value. Therefore, the default value \"{2}\" has been returned."; export declare const GET_FLAG_VALUE = "Visitor {0}, Flag for key {1} returns value {2}"; export declare const USER_EXPOSED_FLAG_ERROR = "For the visitor \"{0}\", no flags were found with the key \"{1}\". As a result, user exposure will not be sent."; export declare const VISITOR_EXPOSED_VALUE_NOT_CALLED = "For the visitor `{0}`,assuming the getValue() method has not previously been invoked for the flag `{0}`. Therefore, the exposure is canceled"; export declare const FLAG_VISITOR_EXPOSED = "FLAG_VISITOR_EXPOSED"; export declare const USER_EXPOSED_CAST_ERROR = "For the visitor `{0}, the flag with the key `{0}` has a different type compared to the default value. Therefore, the exposure is interrupted"; export declare const GET_METADATA_CAST_ERROR = "Visitor {0}, Flag for key {1} has a different type with default value: Empty metadata object is returned {2}"; export declare const FLAG_METADATA = "FLAG_METADATA"; export declare const NO_FLAG_METADATA = "Visitor {0}, No Flags found for key {1}: Empty metadata object is returned"; export declare const METADATA_SDK_NOT_READY = "Visitor {0}, Flag for key {1} Method Flag.metadata is deactivated while SDK status is NOT_READY: Empty metadata object is returned {2}\nLearn more: https://docs.developers.flagship.io/docs/js-v3#getting-flags-campaigns-metadata"; export declare const METADATA_PANIC_MODE = "Visitor {0}, Flag for key {1} Method Flag.metadata is deactivated while SDK status is PANIC: Empty metadata object is returned {2}\nLearn more: https://docs.developers.flagship.io/docs/glossary#panic-mode"; export declare const AUTHENTICATE = "AUTHENTICATE"; export declare const VISITOR_AUTHENTICATE = "The visitor is authenticated with new visitor ID {0} anonymous ID {1}"; export declare const VISITOR_ALREADY_AUTHENTICATE = "The visitor is already authenticated with visitor ID {0}"; export declare const METHOD_DEACTIVATED_BUCKETING_ERROR = "Visitor {0}, Method {1} is deactivated on Bucketing mode"; export declare const VISITOR_AUTHENTICATE_VISITOR_ID_ERROR = "Visitor {0}, visitorId must not be null or empty\nLearn more: https://docs.developers.flagship.io/docs/js-v3#authenticate"; export declare const VISITOR_UNAUTHENTICATE = "The visitor is unauthenticated with visitor ID {0}"; export declare const UNAUTHENTICATE = "UNAUTHENTICATE"; export declare const FLAGSHIP_VISITOR_NOT_AUTHENTICATE = "Visitor {0} is not authenticated yet"; export declare const ALLOCATION = "ALLOCATION"; export declare const BUCKETING_VARIATION_CACHE = "Visitor {0}, Variation {1} selected from cache."; export declare const BUCKETING_NEW_ALLOCATION = "Visitor {0}, Variation {1} selected with allocation {2}."; export declare const LOOKUP_VISITOR_JSON_OBJECT_ERROR = "lookupVisitor method has loaded a bad format version ({0}) for visitor {1}.\nLearn more: https://docs.developers.flagship.io/docs/js-v3#managing-visitor-cache"; export declare const PROCESS_CACHE = "CACHE"; export declare const VISITOR_CACHE_ERROR = "visitor {0}. {1} threw an exception {2}"; export declare const HIT_CACHE_ERROR = "{0} threw an exception {1}"; export declare const VISITOR_CACHE_LOADED = "Visitor {0}, visitor cache has been loaded from database: {1}"; export declare const VISITOR_CACHE_SAVED = "Visitor {0}, visitor cache has been saved into database : {0}"; export declare const VISITOR_CACHE_FLUSHED = "Visitor {0}, visitor cache has been flushed from database."; export declare const HIT_CACHE_LOADED = "Hits cache has been loaded from database: {0}"; export declare const HIT_CACHE_SAVED = "Hit cache has been saved into database : {0}"; export declare const HIT_DATA_FLUSHED = "The following hit keys have been flushed from database : {0}"; export declare const ALL_HITS_FLUSHED = "All hits cache has been flushed from database"; export declare const BATCH_LOOP_STARTED = "The Batch Loop has been started with a time interval of {0} ms"; export declare const TRACKING_MANAGER = "TRACKING_MANAGER"; export declare const BATCH_LOOP_STOPPED = "The Batch Loop has been stopped"; export declare const TRACKING_MANAGER_ERROR = "{0} Unexpected Error occurred {1}"; export declare const HIT_SENT_SUCCESS = "{0} has been sent : {1}"; export declare const ACTIVATE_HIT = "ACTIVATE HIT"; export declare const BATCH_HIT = "BATCH HIT"; export declare const DIRECT_HIT = "HIT"; export declare const GET_THIRD_PARTY_SEGMENT = "GET_THIRD_PARTY_SEGMENT"; export declare const CONSENT_NOT_SPECIFY_WARNING = "Consent has not been specified. By default, consent is set to false, which may result in some features being deactivated."; export declare const ACTION_TRACKING = "Action Tracking"; export declare const ACTION_TRACKING_HIT_RECEIVED = "Hit received: {0}"; export declare const ACTION_TRACKING_INVALID_HIT = "Invalid hit data: {0}"; export declare const ACTION_TRACKING_INVALID_NONCE = "Invalid nonce: {0}"; export declare const ACTION_TRACKING_SENDING_HIT = "Sending hit: {0}"; export declare const ACTION_TRACKING_SENDING_HIT_ERROR = "Failed to send hit: {0}"; export declare const ACTION_TRACKING_DISPATCHED = "action tracking hits have been dispatched {0}"; export declare const TRUSTED_QA_ORIGINS: string[];