Options
All
  • Public
  • Public/Protected
  • All
Menu

class with utilities for managing the global vendor list. Will use JSON to fetch the vendor list from specified url and will serialize it into this object and provide accessors. Provides ways to group vendors on the list by purpose and feature.

Hierarchy

Implements

Index

Constructors

constructor

Properties

features

features: IntMap<Feature>
param

collection of Features

gvlSpecificationVersion

gvlSpecificationVersion: number
param

schema version for the GVL that is used

lastUpdated

lastUpdated: string | Date
param

the date in which the vendor list json file was last updated.

purposes

purposes: IntMap<Purpose>
param

collection of Purposes

readyPromise

readyPromise: Promise<void | GVLError>
param

when this GVL object is populated with the data or rejected if there is an error.

specialFeatures

specialFeatures: IntMap<Feature>
param

collection of Features

specialPurposes

specialPurposes: IntMap<Purpose>
param

collection of Purposes

stacks

stacks: IntMap<Stack>
param

collection of Stacks

tcfPolicyVersion

tcfPolicyVersion: number
param

The TCF MO will increment this value whenever a GVL change (such as adding a new Purpose or Feature or a change in Purpose wording) legally invalidates existing TC Strings and requires CMPs to re-establish transparency and consent from users. If the policy version number in the latest GVL is different from the value in your TC String, then you need to re-establish transparency and consent for that user. A version 1 format TC String is considered to have a version value of 1.

vendorListVersion

vendorListVersion: number
param

with each published file change

Static DEFAULT_LANGUAGE

DEFAULT_LANGUAGE: string = "EN"

Static consentLanguages

consentLanguages: ConsentLanguages = new ConsentLanguages()

Set of available consent languages published by the IAB

Static languageFilename

languageFilename: string = "purposes-[LANG].json"
param

Translations of the names and descriptions for Purposes, Special Purposes, Features, and Special Features to non-English languages are contained in a file where attributes containing English content (except vendor declaration information) are translated. The iab publishes one following the scheme below where the LANG is the iso639-1 language code. For a list of available translations please go here.

eg.

GVL.baseUrl = "http://www.mydomain.com/iabcmp/";
GVL.languageFilename = "purposes?getPurposes=[LANG]";

Static latestFilename

latestFilename: string = "vendor-list.json"
static
param

the latest is assumed to be vendor-list.json because that is what the iab uses, but it could be different... if you want

Static versionedFilename

versionedFilename: string = "archives/vendor-list-v[VERSION].json"
static
param

the versioned name is assumed to be vendor-list-v[VERSION].json where [VERSION] will be replaced with the specified version. But it could be different... if you want just make sure to include the [VERSION] macro if you have a numbering scheme, it's a simple string substitution.

eg.

GVL.baseUrl = "http://www.mydomain.com/iabcmp/";
GVL.versionedFilename = "vendorlist?getVersion=[VERSION]";

Accessors

language

language:

vendors

vendors:

Static baseUrl

baseUrl:

baseUrl - Entities using the vendor-list.json are required by the iab to host their own copy of it to reduce the load on the iab's infrastructure so a 'base' url must be set to be put together with the versioning scheme of the filenames. baseUrl - Entities using the vendor-list.json are required by the iab to host their own copy of it to reduce the load on the iab's infrastructure so a 'base' url must be set to be put together with the versioning scheme of the filenames.

static
throws

{GVLError} - If the url is http[s]://vendorlist.consensu.org/... this will throw an error. IAB Europe requires that that CMPs and Vendors cache their own copies of the GVL to minimize load on their infrastructure. For more information regarding caching of the vendor-list.json, please see the TCF documentation on 'Caching the Global Vendor List'

static

Methods

changeLanguage

  • changeLanguage(lang: string): Promise<void | GVLError>
  • changeLanguage - retrieves the purpose language translation and sets the internal language variable

    Parameters

    • lang: string

      ISO 639-1 langauge code to change language to

    Returns Promise<void | GVLError>

    • returns the readyPromise and resolves when this GVL is populated with the data from the language file.

clone

  • clone - overrides base clone() method since GVL is a special class that represents a JSON structure with some additional functionality

    Returns GVL

emptyLanguageCache

  • emptyLanguageCache(lang?: string): boolean
  • emptyLanguageCache

    Parameters

    • Optional lang: string

    Returns boolean

    • whether or not the item specified was in the cache and subsequently removed

getJson

  • getJson - Method for getting the JSON that was downloaded to created this GVL object

    Returns VendorList

    • The basic JSON structure without the extra functionality and methods of this class.

getVendorsWithConsentPurpose

  • getVendorsWithConsentPurpose(purposeId: number): IntMap<Vendor>
  • getVendorsWithConsentPurpose

    Parameters

    • purposeId: number

    Returns IntMap<Vendor>

    • list of vendors that have declared the consent purpose id

getVendorsWithFeature

  • getVendorsWithFeature

    Parameters

    • featureId: number

    Returns IntMap<Vendor>

    • list of vendors that have declared the feature id

getVendorsWithFlexiblePurpose

  • getVendorsWithFlexiblePurpose(purposeId: number): IntMap<Vendor>
  • getVendorsWithFlexiblePurpose

    Parameters

    • purposeId: number

    Returns IntMap<Vendor>

    • list of vendors that have declared the flexible purpose id

getVendorsWithLegIntPurpose

  • getVendorsWithLegIntPurpose(purposeId: number): IntMap<Vendor>
  • getVendorsWithLegIntPurpose

    Parameters

    • purposeId: number

    Returns IntMap<Vendor>

    • list of vendors that have declared the legInt (Legitimate Interest) purpose id

getVendorsWithSpecialFeature

  • getVendorsWithSpecialFeature(specialFeatureId: number): IntMap<Vendor>
  • getVendorsWithSpecialFeature

    Parameters

    • specialFeatureId: number

    Returns IntMap<Vendor>

    • list of vendors that have declared the special feature id

getVendorsWithSpecialPurpose

  • getVendorsWithSpecialPurpose(specialPurposeId: number): IntMap<Vendor>
  • getVendorsWithSpecialPurpose

    Parameters

    • specialPurposeId: number

    Returns IntMap<Vendor>

    • list of vendors that have declared the special purpose id

narrowVendorsTo

  • narrowVendorsTo(vendorIds: number[]): void
  • narrowVendorsTo - narrows vendors represented in this GVL to the list of ids passed in

    Parameters

    • vendorIds: number[]

      list of ids to narrow this GVL to

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc