@lu-development/ux-gdpr-consent
Advanced tools
Comparing version 1.0.7 to 1.0.8
# UX GDPR Consent Dialog | ||
## 1.0.8 | ||
- re-enable EU detection | ||
## 1.0.7 | ||
- disable EU detection for testing | ||
## 1.0.6 | ||
@@ -4,0 +12,0 @@ |
@@ -32,22 +32,19 @@ 'use strict'; | ||
default: | ||
// this.isEU = await fetch( | ||
// `https://api.ipstack.com/check?access_key=${this.accessKey}&fields=location.is_eu` | ||
// ) | ||
// .then(response => { | ||
// if (!response.ok) { | ||
// return true; | ||
// } | ||
// return response.json(); | ||
// }) | ||
// .then(data => { | ||
// if (data.hasOwnProperty("error")) { | ||
// return true; | ||
// } | ||
// return data.location.is_eu; | ||
// }) | ||
// .catch(error => { | ||
// console.error(error); | ||
// return true; | ||
// }); | ||
this.isEU = true; | ||
this.isEU = await fetch(`https://api.ipstack.com/check?access_key=${this.accessKey}&fields=location.is_eu`) | ||
.then(response => { | ||
if (!response.ok) { | ||
return true; | ||
} | ||
return response.json(); | ||
}) | ||
.then(data => { | ||
if (data.hasOwnProperty("error")) { | ||
return true; | ||
} | ||
return data.location.is_eu; | ||
}) | ||
.catch(error => { | ||
console.error(error); | ||
return true; | ||
}); | ||
this.isEU ? this.resetConsentCookie() : this.grantConsentCookie(); | ||
@@ -54,0 +51,0 @@ } |
@@ -25,22 +25,19 @@ import { h, Host } from "@stencil/core"; | ||
default: | ||
// this.isEU = await fetch( | ||
// `https://api.ipstack.com/check?access_key=${this.accessKey}&fields=location.is_eu` | ||
// ) | ||
// .then(response => { | ||
// if (!response.ok) { | ||
// return true; | ||
// } | ||
// return response.json(); | ||
// }) | ||
// .then(data => { | ||
// if (data.hasOwnProperty("error")) { | ||
// return true; | ||
// } | ||
// return data.location.is_eu; | ||
// }) | ||
// .catch(error => { | ||
// console.error(error); | ||
// return true; | ||
// }); | ||
this.isEU = true; | ||
this.isEU = await fetch(`https://api.ipstack.com/check?access_key=${this.accessKey}&fields=location.is_eu`) | ||
.then(response => { | ||
if (!response.ok) { | ||
return true; | ||
} | ||
return response.json(); | ||
}) | ||
.then(data => { | ||
if (data.hasOwnProperty("error")) { | ||
return true; | ||
} | ||
return data.location.is_eu; | ||
}) | ||
.catch(error => { | ||
console.error(error); | ||
return true; | ||
}); | ||
this.isEU ? this.resetConsentCookie() : this.grantConsentCookie(); | ||
@@ -47,0 +44,0 @@ } |
@@ -48,42 +48,51 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
this.consent = this.parseConsentCookieValue(this.getConsentCookie()); | ||
if (this.URLRevokedConsent(window.location.search)) { | ||
this.consent = "revoked"; | ||
} | ||
if (this.URLResetConsent(window.location.search)) { | ||
this.consent = "indeterminate"; | ||
} | ||
switch (this.consent) { | ||
case "revoked": | ||
var _a, _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
this.consent = this.parseConsentCookieValue(this.getConsentCookie()); | ||
if (this.URLRevokedConsent(window.location.search)) { | ||
this.consent = "revoked"; | ||
} | ||
if (this.URLResetConsent(window.location.search)) { | ||
this.consent = "indeterminate"; | ||
} | ||
_a = this.consent; | ||
switch (_a) { | ||
case "revoked": return [3 /*break*/, 1]; | ||
case "granted": return [3 /*break*/, 2]; | ||
case "indeterminate": return [3 /*break*/, 3]; | ||
} | ||
return [3 /*break*/, 3]; | ||
case 1: | ||
this.revokeConsentCookie(); | ||
break; | ||
case "granted": | ||
return [3 /*break*/, 5]; | ||
case 2: | ||
this.grantConsentCookie(); | ||
break; | ||
case "indeterminate": | ||
default: | ||
// this.isEU = await fetch( | ||
// `https://api.ipstack.com/check?access_key=${this.accessKey}&fields=location.is_eu` | ||
// ) | ||
// .then(response => { | ||
// if (!response.ok) { | ||
// return true; | ||
// } | ||
// return response.json(); | ||
// }) | ||
// .then(data => { | ||
// if (data.hasOwnProperty("error")) { | ||
// return true; | ||
// } | ||
// return data.location.is_eu; | ||
// }) | ||
// .catch(error => { | ||
// console.error(error); | ||
// return true; | ||
// }); | ||
this.isEU = true; | ||
return [3 /*break*/, 5]; | ||
case 3: | ||
_b = this; | ||
return [4 /*yield*/, fetch("https://api.ipstack.com/check?access_key=" + this.accessKey + "&fields=location.is_eu") | ||
.then(function (response) { | ||
if (!response.ok) { | ||
return true; | ||
} | ||
return response.json(); | ||
}) | ||
.then(function (data) { | ||
if (data.hasOwnProperty("error")) { | ||
return true; | ||
} | ||
return data.location.is_eu; | ||
}) | ||
.catch(function (error) { | ||
console.error(error); | ||
return true; | ||
})]; | ||
case 4: | ||
_b.isEU = _c.sent(); | ||
this.isEU ? this.resetConsentCookie() : this.grantConsentCookie(); | ||
_c.label = 5; | ||
case 5: return [2 /*return*/]; | ||
} | ||
return [2 /*return*/]; | ||
}); | ||
@@ -90,0 +99,0 @@ }); |
@@ -28,22 +28,19 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './core-fab31531.js'; | ||
default: | ||
// this.isEU = await fetch( | ||
// `https://api.ipstack.com/check?access_key=${this.accessKey}&fields=location.is_eu` | ||
// ) | ||
// .then(response => { | ||
// if (!response.ok) { | ||
// return true; | ||
// } | ||
// return response.json(); | ||
// }) | ||
// .then(data => { | ||
// if (data.hasOwnProperty("error")) { | ||
// return true; | ||
// } | ||
// return data.location.is_eu; | ||
// }) | ||
// .catch(error => { | ||
// console.error(error); | ||
// return true; | ||
// }); | ||
this.isEU = true; | ||
this.isEU = await fetch(`https://api.ipstack.com/check?access_key=${this.accessKey}&fields=location.is_eu`) | ||
.then(response => { | ||
if (!response.ok) { | ||
return true; | ||
} | ||
return response.json(); | ||
}) | ||
.then(data => { | ||
if (data.hasOwnProperty("error")) { | ||
return true; | ||
} | ||
return data.location.is_eu; | ||
}) | ||
.catch(error => { | ||
console.error(error); | ||
return true; | ||
}); | ||
this.isEU ? this.resetConsentCookie() : this.grantConsentCookie(); | ||
@@ -50,0 +47,0 @@ } |
@@ -1,1 +0,1 @@ | ||
System.register(["./p-3f6f6132.system.js"],(function(){"use strict";var e,n;return{setters:[function(t){e=t.p;n=t.b}],execute:function(){e().then((function(e){return n([["p-pipcbdjt.system",[[1,"ux-gdpr-consent",{hidden:[32],grantConsentCookie:[64],revokeConsentCookie:[64],resetConsentCookie:[64]},[[4,"gdpr-consent-revoke","handleRevoke"],[4,"gdpr-consent-reset","handleReset"]]]]]],e)}))}}})); | ||
System.register(["./p-3f6f6132.system.js"],(function(){"use strict";var e,n;return{setters:[function(t){e=t.p;n=t.b}],execute:function(){e().then((function(e){return n([["p-3as1vwo9.system",[[1,"ux-gdpr-consent",{hidden:[32],grantConsentCookie:[64],revokeConsentCookie:[64],resetConsentCookie:[64]},[[4,"gdpr-consent-revoke","handleRevoke"],[4,"gdpr-consent-reset","handleReset"]]]]]],e)}))}}})); |
@@ -1,1 +0,1 @@ | ||
import{p as e,b as o}from"./p-552631d0.js";e().then(e=>o([["p-9wzrsmip",[[1,"ux-gdpr-consent",{hidden:[32],grantConsentCookie:[64],revokeConsentCookie:[64],resetConsentCookie:[64]},[[4,"gdpr-consent-revoke","handleRevoke"],[4,"gdpr-consent-reset","handleReset"]]]]]],e)); | ||
import{p as e,b as o}from"./p-552631d0.js";e().then(e=>o([["p-7kl9iqut",[[1,"ux-gdpr-consent",{hidden:[32],grantConsentCookie:[64],revokeConsentCookie:[64],resetConsentCookie:[64]},[[4,"gdpr-consent-revoke","handleRevoke"],[4,"gdpr-consent-reset","handleReset"]]]]]],e)); |
{ | ||
"name": "@lu-development/ux-gdpr-consent", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "GDPR compliance plugin", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
777778
16