UNPKG

@didomi/iabtcf-cmpapi

Version:

Ensures other in-page digital marketing technologies have access to CMP transparency and consent information for the iab. Transparency and Consent Framework (TCF).

26 lines (25 loc) 735 B
import { CmpApiModel } from '../CmpApiModel.js'; import { Command } from './Command.js'; import { GVL } from '@didomi/iabtcf-core'; /** * Gets a version of the Global Vendors List */ export class GetVendorListCommand extends Command { respond() { const tcModel = CmpApiModel.tcModel; const tcModelVersion = tcModel.vendorListVersion; let gvl; if (this.param === undefined) { this.param = tcModelVersion; } if (this.param === tcModelVersion && tcModel.gvl) { gvl = tcModel.gvl; } else { gvl = new GVL(this.param); } gvl.readyPromise.then(() => { this.invokeCallback(gvl.getJson()); }); } }