Derive consent mode from geolocation, not banner config

The consent mode is now determined dynamically by the visitor's
country and its applicable regulation. The configured consent_mode
column is dropped from cookie_banners and added to
cookie_consent_records to persist the geo-derived mode at
consent-recording time. When no regulation matches, the default
is OPT_OUT.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-13 12:17:34 +04:00
parent e9d786c5d6
commit e739473bcd
30 changed files with 68 additions and 246 deletions

View File

@@ -69,33 +69,6 @@ export const description: INodeProperties[] = [
default: 0,
description: 'Number of days before consent expires (0 to leave unchanged)',
},
{
displayName: 'Consent Mode',
name: 'consentMode',
type: 'options',
displayOptions: {
show: {
resource: ['cookieBanner'],
operation: ['update'],
},
},
options: [
{
name: '(Unchanged)',
value: '',
},
{
name: 'Opt In',
value: 'OPT_IN',
},
{
name: 'Opt Out',
value: 'OPT_OUT',
},
],
default: '',
description: 'The consent mode for the cookie banner',
},
{
displayName: 'Default Language',
name: 'defaultLanguage',
@@ -141,7 +114,6 @@ export async function execute(
const name = this.getNodeParameter('name', itemIndex, '') as string;
const cookiePolicyUrl = this.getNodeParameter('cookiePolicyUrl', itemIndex, '') as string;
const consentExpiryDays = this.getNodeParameter('consentExpiryDays', itemIndex, 0) as number;
const consentMode = this.getNodeParameter('consentMode', itemIndex, '') as string;
const defaultLanguage = this.getNodeParameter('defaultLanguage', itemIndex, '') as string;
const additionalFields = this.getNodeParameter('additionalFields', itemIndex, {}) as {
privacyPolicyUrl?: string;
@@ -158,7 +130,6 @@ export async function execute(
privacyPolicyUrl
cookiePolicyUrl
consentExpiryDays
consentMode
showBranding
defaultLanguage
createdAt
@@ -172,7 +143,6 @@ export async function execute(
if (name) input.name = name;
if (cookiePolicyUrl) input.cookiePolicyUrl = cookiePolicyUrl;
if (consentExpiryDays) input.consentExpiryDays = consentExpiryDays;
if (consentMode) input.consentMode = consentMode;
if (defaultLanguage) input.defaultLanguage = defaultLanguage;
if (additionalFields.privacyPolicyUrl !== undefined) {
input.privacyPolicyUrl = additionalFields.privacyPolicyUrl === '' ? null : additionalFields.privacyPolicyUrl;