@adv-ui/boros-tcf
Version:
Adevinta GDPR - Transparency and Consent Framework - API
137 lines (118 loc) • 2.96 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PingReturn = void 0;
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
var _constants = require("../../core/constants");
var PingReturn = /*#__PURE__*/function () {
/**
*
* @param {Object} param
* @param {import('./../status/Status').Status} param.status
*/
function PingReturn(_temp) {
var _ref = _temp === void 0 ? {} : _temp,
status = _ref.status;
this._status = status;
}
/**
* true - GDPR Applies
* false - GDPR Does not apply
* undefined - unknown whether GDPR Applies
* see the section: "What does the gdprApplies value mean?"
*/
var _proto = PingReturn.prototype;
_proto.value = function value() {
return {
gdprApplies: this.gdprApplies,
cmpLoaded: this.cmpLoaded,
cmpStatus: this.cmpStatus,
displayStatus: this.displayStatus,
apiVersion: this.apiVersion,
cmpVersion: this.cmpVersion,
cmpId: this.cmpId,
gvlVersion: this.gvlVersion,
tcfPolicyVersion: this.tcfPolicyVersion
};
};
(0, _createClass2["default"])(PingReturn, [{
key: "gdprApplies",
get: function get() {
return true;
}
/**
* true - CMP main script is loaded
* false - still running stub
* @returns {Boolean}
*/
}, {
key: "cmpLoaded",
get: function get() {
return this._status.loaded;
}
/**
* see Ping Status Codes in following table
*/
}, {
key: "cmpStatus",
get: function get() {
return this._status.cmpStatus;
}
/**
* see Ping Status Codes in following table
*/
}, {
key: "displayStatus",
get: function get() {
return this._status.displayStatus;
}
/**
* version of the CMP API that is supported e.g. "2.0"
*/
}, {
key: "apiVersion",
get: function get() {
return _constants.TCF_API_SUPPORTED_VERSION;
}
/**
* CMPs own/internal version that is currently running
* undefined if still the stub
*/
}, {
key: "cmpVersion",
get: function get() {
return _constants.BOROS_TCF_VERSION;
}
/**
* IAB Assigned CMP ID
* undefined if still the stub
*/
}, {
key: "cmpId",
get: function get() {
return _constants.BOROS_TCF_ID;
}
/**
* Version of the GVL currently loaded by the CMP
* undefined if still the stub
*/
}, {
key: "gvlVersion",
get: function get() {
return this._status.gvlVersion;
}
/**
* Number of the supported TCF version
* undefined if still the stub
*/
}, {
key: "tcfPolicyVersion",
get: function get() {
return _constants.TCF_API_VERSION;
}
}]);
return PingReturn;
}();
exports.PingReturn = PingReturn;