How to use the @iabtcf/core.GVL function in @iabtcf/core

To help you get started, we’ve selected a few @iabtcf/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github InteractiveAdvertisingBureau / iabtcf-es / modules / testing / src / GVLFactory.ts View on Github external
public static getLatest(): GVL {

    return new GVL(require('./vendorlist/vendor-list.json'));

  }
github InteractiveAdvertisingBureau / iabtcf-es / modules / testing / src / GVLFactory.ts View on Github external
public static getVersion(version: number): GVL {

    return new GVL(require(`./vendorlist/vendor-list-v${version}.json`));

  }
github InteractiveAdvertisingBureau / iabtcf-es / modules / cmpapi / src / command / commands / GetVendorListCommand.ts View on Github external
public execute(): void {

    /**
     * Return a clone of the current GVL if no param/version was used. Otherwise, create a new GVL with the
     * specific version.
     */

    const _gvl: GVL = this.param ? new GVL(this.param as string | number) : this.cmpData.getTcModel().gvl.clone();

    _gvl.readyPromise.then(() => {

      const gvl = new GlobalVendorListBldr(_gvl);
      this.setBaseReturnFields(gvl);

      (this.callback.function as VendorListCallback)(gvl.buildResponse(), true);

    }, ((reason) => this.callback.fail(reason))).catch((reason) => this.callback.fail(reason));

  }
github InteractiveAdvertisingBureau / iabtcf-es / modules / cmpapi / src / command / GetVendorListCommand.ts View on Github external
protected success(): void {

    let gvl: GVL;
    const callback = this.callback as VendorListCallback;

    if (!this.param) {

      const tcModel = CmpApiModel.tcModel as TCModel;

      if (tcModel.gvl) {

        callback(tcModel.gvl.getJson(), true);

      } else {

        tcModel.gvl = new GVL(tcModel.vendorListVersion);
        tcModel.gvl.readyPromise.then(() => {

          callback(tcModel.gvl.getJson(), true);

        }, this.fail).catch(this.fail);

      }

    } else {

      gvl = new GVL(this.param);

      const woops = (): void => {

        this.fail();
github InteractiveAdvertisingBureau / iabtcf-es / modules / cmpapi / src / command / GetVendorListCommand.ts View on Github external
callback(tcModel.gvl.getJson(), true);

      } else {

        tcModel.gvl = new GVL(tcModel.vendorListVersion);
        tcModel.gvl.readyPromise.then(() => {

          callback(tcModel.gvl.getJson(), true);

        }, this.fail).catch(this.fail);

      }

    } else {

      gvl = new GVL(this.param);

      const woops = (): void => {

        this.fail();

      };

      gvl.readyPromise.then(() => {

        callback(gvl.getJson(), true);

      }, woops).catch(woops);

    }

  }

@iabtcf/core

Ensures consistent encoding and decoding of TC Signals for the iab. Transparency and Consent Framework (TCF).

Apache-2.0
Latest version published 1 year ago

Package Health Score

68 / 100
Full package analysis