New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adv-ui/boros-tcf

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adv-ui/boros-tcf - npm Package Compare versions

Comparing version 1.15.1 to 1.16.0

dist/domain/vendorlist/VendorAcceptanceStatus.js

8

dist/application/BorosTcf.js

@@ -30,4 +30,2 @@ "use strict";

var _DomainEventBus = require("../domain/service/DomainEventBus");
var BorosTcf = /*#__PURE__*/function () {

@@ -41,3 +39,2 @@ /**

* @param {GetTCDataUseCase} param.getTCDataUseCase
* @param {DomainEventBus} param.domainEventBus
*/

@@ -57,5 +54,3 @@ function BorosTcf(_temp) {

_ref$statusRepository = _ref.statusRepository,
statusRepository = _ref$statusRepository === void 0 ? (0, _ioc.inject)(_StatusRepository.StatusRepository) : _ref$statusRepository,
_ref$domainEventBus = _ref.domainEventBus,
domainEventBus = _ref$domainEventBus === void 0 ? (0, _ioc.inject)(_DomainEventBus.DomainEventBus) : _ref$domainEventBus;
statusRepository = _ref$statusRepository === void 0 ? (0, _ioc.inject)(_StatusRepository.StatusRepository) : _ref$statusRepository;

@@ -68,3 +63,2 @@ this._getVendorListUseCase = getVendorListUseCase;

this._statusRepository = statusRepository;
this._domainEventBus = domainEventBus;
}

@@ -71,0 +65,0 @@

@@ -14,2 +14,4 @@ "use strict";

/* istanbul ignore file */
/**

@@ -16,0 +18,0 @@ * @interface

@@ -8,2 +8,4 @@ "use strict";

/* istanbul ignore file */
/**

@@ -10,0 +12,0 @@ * @interface

@@ -21,3 +21,3 @@ "use strict";

exports.PACKAGE_NAME = PACKAGE_NAME;
var BOROS_TCF_VERSION = typeof 15 !== 'undefined' && 15 || 1;
var BOROS_TCF_VERSION = typeof 16 !== 'undefined' && 16 || 1;
/**

@@ -24,0 +24,0 @@ * Boros TCF IAB's registered ID

@@ -16,2 +16,4 @@ "use strict";

var _VendorAcceptanceStatus = require("../vendorlist/VendorAcceptanceStatus");
var Consent = /*#__PURE__*/function () {

@@ -43,2 +45,3 @@ /**

policyVersion = _ref$policyVersion === void 0 ? _constants.TCF_API_VERSION : _ref$policyVersion,
vendorListVersion = _ref.vendorListVersion,
_ref$publisherCC = _ref.publisherCC,

@@ -69,2 +72,3 @@ publisherCC = _ref$publisherCC === void 0 ? _constants.PUBLISHER_CC : _ref$publisherCC,

this._policyVersion = policyVersion;
this._vendorListVersion = vendorListVersion;
this._publisherCC = publisherCC;

@@ -84,2 +88,28 @@ this._isServiceSpecific = isServiceSpecific;

_proto.updateVendors = function updateVendors(_ref2) {
var _this = this;
var oldVendorList = _ref2.oldVendorList,
newVendorList = _ref2.newVendorList;
var updated = {
consents: {},
legitimateInterests: {}
};
var consentVendorsAcceptanceStatus = new _VendorAcceptanceStatus.VendorAcceptanceStatus({
consent: this,
vendorList: oldVendorList
});
Object.keys(newVendorList.vendors).forEach(function (key) {
updated.consents[key] = consentVendorsAcceptanceStatus.resolveConsent({
current: _this._vendor.consents[key]
});
updated.legitimateInterests[key] = consentVendorsAcceptanceStatus.resolveLegitimateInterest({
current: _this._vendor.legitimateInterests[key]
});
});
this._vendor = updated;
this._vendorListVersion = newVendorList.version;
this._valid = consentVendorsAcceptanceStatus.isValid();
};
_proto.toJSON = function toJSON() {

@@ -90,2 +120,3 @@ return {

policyVersion: this._policyVersion,
vendorListVersion: this._vendorListVersion,
publisherCC: this._publisherCC,

@@ -144,2 +175,7 @@ isServiceSpecific: this._isServiceSpecific,

}
}, {
key: "vendorListVersion",
get: function get() {
return this._vendorListVersion;
}
}]);

@@ -146,0 +182,0 @@ return Consent;

@@ -17,6 +17,3 @@ "use strict";

_proto.encode = function encode(_ref) {
var vendor = _ref.vendor,
purpose = _ref.purpose,
specialFeatures = _ref.specialFeatures,
previousEncodedConsent = _ref.previousEncodedConsent;
var consent = _ref.consent;
};

@@ -23,0 +20,0 @@

@@ -26,4 +26,2 @@ "use strict";

var _VendorListHelper = require("../vendorlist/VendorListHelper");
var _Version = require("../vendorlist/Version");

@@ -43,5 +41,3 @@

_ref$vendorListReposi = _ref.vendorListRepository,
vendorListRepository = _ref$vendorListReposi === void 0 ? (0, _ioc.inject)(_VendorListRepository.VendorListRepository) : _ref$vendorListReposi,
_ref$vendorListHelper = _ref.vendorListHelper,
vendorListHelper = _ref$vendorListHelper === void 0 ? (0, _ioc.inject)(_VendorListHelper.VendorListHelper) : _ref$vendorListHelper;
vendorListRepository = _ref$vendorListReposi === void 0 ? (0, _ioc.inject)(_VendorListRepository.VendorListRepository) : _ref$vendorListReposi;

@@ -53,3 +49,2 @@ this._consentRepository = consentRepository;

this._vendorListRepository = vendorListRepository;
this._vendorListHelper = vendorListHelper;
}

@@ -61,3 +56,4 @@

var _loadConsent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
var encodedConsent, existingConsent, newVendorList, result;
var encodedConsent, decodedConsent, newVendorList, consent, oldVendorList, _encodedConsent;
return _regenerator["default"].wrap(function _callee$(_context) {

@@ -77,3 +73,3 @@ while (1) {

case 3:
existingConsent = this._consentDecoderService.decode({
decodedConsent = this._consentDecoderService.decode({
encodedConsent: encodedConsent

@@ -87,3 +83,3 @@ });

if (!(newVendorList.policyVersion !== existingConsent.policyVersion)) {
if (!(newVendorList.policyVersion !== decodedConsent.policyVersion)) {
_context.next = 9;

@@ -96,136 +92,15 @@ break;

case 9:
_context.next = 11;
return this._isValid({
newVendorList: newVendorList,
consent: existingConsent
});
case 11:
result = _context.sent;
return _context.abrupt("return", result ? this._createValidConsentWithTheSavedOne({
savedConsent: existingConsent
}) : this._createAnInValidConsentAndMergeListVendors({
existingConsent: existingConsent,
newVendorList: newVendorList
}));
case 13:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function loadConsent() {
return _loadConsent.apply(this, arguments);
}
return loadConsent;
}();
_proto._createAnInValidConsentAndMergeListVendors = function _createAnInValidConsentAndMergeListVendors(_ref2) {
var existingConsent = _ref2.existingConsent,
newVendorList = _ref2.newVendorList;
existingConsent.valid = false;
existingConsent.vendor = this._vendorListHelper.mergeVendors({
newVendorList: newVendorList.value.vendors,
oldVendors: existingConsent.vendor
});
return this._consentFactory.createConsent(existingConsent);
};
_proto._createValidConsentWithTheSavedOne = /*#__PURE__*/function () {
var _createValidConsentWithTheSavedOne2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_ref3) {
var savedConsent, consent;
return _regenerator["default"].wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
savedConsent = _ref3.savedConsent;
_context2.next = 3;
return this._renewSavedConsent({
savedConsent: savedConsent
});
case 3:
consent = _context2.sent;
consent.valid = true;
return _context2.abrupt("return", this._consentFactory.createConsent(consent));
case 6:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
function _createValidConsentWithTheSavedOne(_x) {
return _createValidConsentWithTheSavedOne2.apply(this, arguments);
}
return _createValidConsentWithTheSavedOne;
}();
_proto._renewSavedConsent = /*#__PURE__*/function () {
var _renewSavedConsent2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref4) {
var savedConsent, encodedConsent, renewedEncodedConsent, consent;
return _regenerator["default"].wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
savedConsent = _ref4.savedConsent;
_context3.next = 3;
return this._consentEncoderService.encode({
consent: savedConsent
});
case 3:
encodedConsent = _context3.sent;
this._consentRepository.saveUserConsent({
encodedConsent: encodedConsent,
decodedConsent: savedConsent
});
renewedEncodedConsent = this._consentRepository.loadUserConsent();
consent = this._consentDecoderService.decode({
encodedConsent: renewedEncodedConsent
});
return _context3.abrupt("return", consent);
case 8:
case "end":
return _context3.stop();
}
}
}, _callee3, this);
}));
function _renewSavedConsent(_x2) {
return _renewSavedConsent2.apply(this, arguments);
}
return _renewSavedConsent;
}();
_proto._isValid = /*#__PURE__*/function () {
var _isValid2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_ref5) {
var newVendorList, consent, oldVendorList;
return _regenerator["default"].wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
newVendorList = _ref5.newVendorList, consent = _ref5.consent;
if (!(newVendorList.version === consent.vendorListVersion)) {
_context4.next = 3;
if (!(newVendorList.version === decodedConsent.vendorListVersion)) {
_context.next = 14;
break;
}
return _context4.abrupt("return", true);
decodedConsent.valid = true;
consent = this._consentFactory.createConsent(decodedConsent);
_context.next = 19;
break;
case 3:
_context4.next = 5;
case 14:
consent = this._consentFactory.createConsent(decodedConsent);
_context.next = 17;
return this._vendorListRepository.getVendorList({

@@ -235,86 +110,45 @@ version: new _Version.Version(consent.vendorListVersion)

case 5:
oldVendorList = _context4.sent;
_context4.next = 8;
return this._consentHaveConsentsAndLIForAllVendorsWithTheSameValue({
consent: consent,
newVendorList: newVendorList,
value: true,
oldVendorList: oldVendorList.value.vendors
case 17:
oldVendorList = _context.sent;
consent.updateVendors({
oldVendorList: oldVendorList,
newVendorList: newVendorList
});
case 8:
_context4.t0 = _context4.sent;
if (_context4.t0) {
_context4.next = 11;
case 19:
if (!consent.valid) {
_context.next = 24;
break;
}
_context4.t0 = this._consentHaveConsentsAndLIForAllVendorsWithTheSameValue({
_context.next = 22;
return this._consentEncoderService.encode({
consent: consent,
newVendorList: newVendorList,
value: false,
oldVendorList: oldVendorList.value.vendors
vendorListVersion: consent.vendorListVersion
});
case 11:
return _context4.abrupt("return", _context4.t0);
case 22:
_encodedConsent = _context.sent;
case 12:
case "end":
return _context4.stop();
}
}
}, _callee4, this);
}));
this._consentRepository.saveUserConsent({
encodedConsent: _encodedConsent,
decodedConsent: consent
});
function _isValid(_x3) {
return _isValid2.apply(this, arguments);
}
case 24:
return _context.abrupt("return", consent);
return _isValid;
}();
_proto._consentHaveConsentsAndLIForAllVendorsWithTheSameValue = /*#__PURE__*/function () {
var _consentHaveConsentsAndLIForAllVendorsWithTheSameValue2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(_ref6) {
var consent, newVendorList, value, oldVendorList, isValid;
return _regenerator["default"].wrap(function _callee5$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
consent = _ref6.consent, newVendorList = _ref6.newVendorList, value = _ref6.value, oldVendorList = _ref6.oldVendorList;
isValid = false;
if (this._vendorListHelper.haveAllValuesTo({
object: consent.vendor.consents,
valueToVerify: value,
oldVendorList: oldVendorList
}) && this._vendorListHelper.haveAllValuesTo({
object: consent.vendor.legitimateInterests,
valueToVerify: value,
oldVendorList: oldVendorList
})) {
consent.vendor = this._vendorListHelper.setAllVendorsTo({
vendorList: newVendorList.value.vendors,
valueToSet: value
});
isValid = true;
}
return _context5.abrupt("return", isValid);
case 4:
case 25:
case "end":
return _context5.stop();
return _context.stop();
}
}
}, _callee5, this);
}, _callee, this);
}));
function _consentHaveConsentsAndLIForAllVendorsWithTheSameValue(_x4) {
return _consentHaveConsentsAndLIForAllVendorsWithTheSameValue2.apply(this, arguments);
function loadConsent() {
return _loadConsent.apply(this, arguments);
}
return _consentHaveConsentsAndLIForAllVendorsWithTheSameValue;
return loadConsent;
}();

@@ -321,0 +155,0 @@

@@ -16,3 +16,4 @@ "use strict";

policyVersion = _ref.policyVersion,
value = _ref.value;
_ref$value = _ref.value,
value = _ref$value === void 0 ? {} : _ref$value;
this._version = version;

@@ -23,2 +24,25 @@ this._policyVersion = policyVersion;

var _proto = VendorList.prototype;
_proto.vendorsWithPurposes = function vendorsWithPurposes() {
return this._vendorsWithUsage({
usageNode: VENDOR_NODE_PURPOSES
});
};
_proto.vendorsWithLegitimateInterests = function vendorsWithLegitimateInterests() {
return this._vendorsWithUsage({
usageNode: VENDOR_NODE_LEGITIMATE_INTERESTS
});
};
_proto._vendorsWithUsage = function _vendorsWithUsage(_ref2) {
var _this = this;
var usageNode = _ref2.usageNode;
return Object.keys(this._value.vendors).filter(function (id) {
return _this._value.vendors[id].deletedDate === undefined && _this._value.vendors[id][usageNode].length > 0;
});
};
(0, _createClass2["default"])(VendorList, [{

@@ -39,2 +63,17 @@ key: "version",

}
}, {
key: "purposes",
get: function get() {
return this._value.purposes;
}
}, {
key: "specialFeatures",
get: function get() {
return this._value.vendors;
}
}, {
key: "vendors",
get: function get() {
return this._value.vendors;
}
}]);

@@ -44,2 +83,4 @@ return VendorList;

exports.VendorList = VendorList;
exports.VendorList = VendorList;
var VENDOR_NODE_PURPOSES = 'purposes';
var VENDOR_NODE_LEGITIMATE_INTERESTS = 'legIntPurposes';

@@ -62,4 +62,2 @@ "use strict";

var _VendorListHelper = require("../../domain/vendorlist/VendorListHelper");
var _StatusRepository = require("../../domain/status/StatusRepository");

@@ -185,5 +183,2 @@

});
singleton(_VendorListHelper.VendorListHelper, function () {
return new _VendorListHelper.VendorListHelper();
});
},

@@ -190,0 +185,0 @@ adapter: _tcfInstanceAdapter.tcfInstanceAdapter

@@ -39,3 +39,7 @@ "use strict";

_proto.loadUserConsent = function loadUserConsent() {
return this._euconsentCookieStorage.load() || '';
try {
return this._euconsentCookieStorage.load() || '';
} catch (error) {
return '';
}
};

@@ -42,0 +46,0 @@

@@ -45,3 +45,3 @@ "use strict";

var _encode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_temp2) {
var _ref2, _ref2$consent, consent, previousEncodedConsent, _consent$vendor, vendor, _consent$purpose, purpose, _consent$specialFeatu, specialFeatures, tcModel, setIabVector;
var _ref2, _ref2$consent, consent, vendorListVersion, _consent$vendor, vendor, _consent$purpose, purpose, _consent$specialFeatu, specialFeatures, tcModel, setIabVector;

@@ -52,14 +52,7 @@ return _regenerator["default"].wrap(function _callee$(_context) {

case 0:
_ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$consent = _ref2.consent, consent = _ref2$consent === void 0 ? {} : _ref2$consent, previousEncodedConsent = _ref2.previousEncodedConsent;
_ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$consent = _ref2.consent, consent = _ref2$consent === void 0 ? {} : _ref2$consent, vendorListVersion = _ref2.vendorListVersion;
_consent$vendor = consent.vendor, vendor = _consent$vendor === void 0 ? {} : _consent$vendor, _consent$purpose = consent.purpose, purpose = _consent$purpose === void 0 ? {} : _consent$purpose, _consent$specialFeatu = consent.specialFeatures, specialFeatures = _consent$specialFeatu === void 0 ? {} : _consent$specialFeatu;
if (previousEncodedConsent) {
tcModel = _core.TCString.decode(previousEncodedConsent);
tcModel.gvl = this._gvlFactory.create({
version: tcModel.vendorListVersion
});
} else {
tcModel = new _core.TCModel(this._gvlFactory.create());
}
tcModel = new _core.TCModel(this._gvlFactory.create({
version: vendorListVersion
}));
tcModel.gdprApplies = true;

@@ -66,0 +59,0 @@ tcModel.isServiceSpecific = true;

{
"name": "@adv-ui/boros-tcf",
"version": "1.15.1",
"version": "1.16.0",
"description": "Adevinta GDPR - Transparency and Consent Framework - API",

@@ -73,3 +73,3 @@ "main": "dist",

"dependencies": {
"@iabtcf/core": "1.0.1",
"@iabtcf/core": "1.1.4",
"brusc": "1",

@@ -76,0 +76,0 @@ "core-js": "3"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc