import type { MapLike } from '../common/app-types'; export interface ClientSdkDeItem { nm: string; typ: string; key?: string; def?: any; cl?: boolean; lwcase?: boolean; fn?: (deHelper: any, input: any) => any; isAsync?: boolean; fnTOut?: number; stDur?: DeStorageDuration; // storage duration } export enum DeStorageDuration { NONE = 'NONE', EVENT = 'EVENT', SESSION = 'SESSION', VISITOR = 'VISITOR', } export enum ParamResourceEncodingType { URL_ENC = 'URL_ENC', BASE64 = 'BASE64', } export enum ParamResourceHashType { SHA256 = 'SHA256', SHA512 = 'SHA512', } export enum ParamResourceValSrc { STATIC = 'STATIC', DE = 'DE', TRANS_FUNC = 'TRANS_FUNC', CHILDREN = 'CHILDREN', TG_JSON_PATH = 'TG_JSON_PATH', } export interface SdkParamEncodingTransformer { nm: string; eTyp: 'URL_ENC' | 'BASE64'; o?: number; } export interface SdkParamHashingTransformer { nm: string; hTyp: ParamResourceHashType; o?: number; } export interface SdkParamIgnoreEmptyTransformer { nm: string; igEmpty: boolean; o?: number; // order } export type TFType = ( | SdkParamHashingTransformer | SdkParamEncodingTransformer | SdkParamIgnoreEmptyTransformer )[]; export interface ClientSdkParamItem { id: string; // id nm: string; // name rqd?: boolean; // is mandatory tf?: TFType; // transformation array prLvl?: boolean; // is provider level attribute pId?: string; // parent id sv?: string; // static value de?: string; // data element id tfId?: string; // transformation function id children?: ClientSdkParamItem[]; exclude_from_req_body?: boolean; fKey: string; // flat key val_src: string; } export interface ClientSdkQcCondition { param: string; // param name i?: string[]; // include conditions e?: string[]; // exclude conditions i_ect: boolean; // is exact match for include i_cs?: boolean; // is case-sensitive for include e_ect?: boolean; // is exact match for exclude e_cs?: boolean; // is case-sensitive for exclude } export interface ClientSdkPrItem { nm: string; url?: string; // base url typ: string; // js or img provider sTyp: string; // r or i sub type rParams?: MapLike; // parameters hrs?: MapLike; // headers ext?: string; // sdk extras joined into a string src?: string; // src of the sdk sync?: boolean; // should be loaded sync or async pr: string; // whitelisted or black listed chld?: boolean; // has at least one parameter whose val_src is CHILDREN } export interface ClientSdkTfnItem { nm: string; // name fn: (input: any) => any; // js function in case this is a jsv data element rParams: MapLike; // parameters } export interface ClientSdkQcItem { nm: string; id: string; c: ClientSdkQcCondition[]; } export interface ClientSdkTagItem { nm: string; // name p: string; // provider id url: string; // tag url rParams?: MapLike; st: number; // start time - in epoch seconds ex: number; // expiry time - in epoch seconds qc: string[]; img?: boolean; // is image tag wrk?: boolean; // is web worker compatible chld?: boolean; // has at least one parameter whose val_src is CHILDREN } export interface ClientSdkSettingsItem { dbg: boolean; // debug_enabled err: boolean; // error_enabled c_dom: string; // default cookie domain v_dur: number; // visit duration c_url: string; // collector_url bare_c_url?: string; // bare collector url - transient variable wh_idl?: string[]; // list of whitelisted idl events wh_domains?: string[]; // list of white listed domains c_url_lkp?: MapLike<{ v: string; ig: boolean; ect: boolean }>; // collector url look up v_id: string; // vendor_id p_id: string; // project_id ev: string; // environment ev_id: string; // environment id dly: number; // trigger_delay sst: boolean; // should enable server side. this will be set to true if there is atleast one sever side tag defined idl: boolean; // should enable ID Link service. this will be set to true if the vendor has ID Link enabled c_typ?: string; // the type of CSP, example nonce. c_src?: string; // the source of CSP, example meta_tag for nonce type. c_key?: string; // the data for CSP. v: string; // core sdk version bld_dt: string; // sdk build date and time from MP - this is not for the core sdk p_view?: boolean; // should fire page info call or not to metrics dws_c_t: 'j' | 'n'; // client side down stream (j = java, n = node) dws_s_t: 'j' | 'n'; // server side down stream (j = java, n = node) } export interface BaseResourceParamType { id: string; // id of param nm: string; // name o?: number; // order pId?: string; // parent id children?: BaseResourceParamType[]; } export interface MpClientSdk { langKey: string; // language data element id pcKey: string; // privacy compliance key cDomKey?: string; // collector domain tfn key domWListKey?: string; // domain white list tfn function d: MapLike; // data element map qc?: ClientSdkQcItem[]; // qualification criteria t?: MapLike; // tag map p?: MapLike; // provider map tfn?: MapLike; // list of transformation functions s: ClientSdkSettingsItem; // settings data item dtmE: string[]; // list of dtm direct call events magic pixel should be interested in ctmE: string[]; // list of custom javascript event magic pixel should be interested in mpDlE: string[]; // list of MagicPixel data layer event magic pixel should be interested in sseDtmE: string[]; // list of server side dtm events that we should trigger sst tag sseCtmE: string[]; // list of custom window events that we should trigger sst tag sseMpDlE: string[]; // list of mp dl events that should trigger the sst tag }