diff --git a/packages/n8n-node/nodes/Probo/actions/cookieBanner/update.operation.ts b/packages/n8n-node/nodes/Probo/actions/cookieBanner/update.operation.ts index ba2c1daa5..0a7e40b43 100644 --- a/packages/n8n-node/nodes/Probo/actions/cookieBanner/update.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/cookieBanner/update.operation.ts @@ -43,19 +43,6 @@ export const description: INodeProperties[] = [ default: '', description: 'The name of the cookie banner', }, - { - displayName: 'Privacy Policy URL', - name: 'privacyPolicyUrl', - type: 'string', - displayOptions: { - show: { - resource: ['cookieBanner'], - operation: ['update'], - }, - }, - default: '', - description: 'The URL to the privacy policy', - }, { displayName: 'Cookie Policy URL', name: 'cookiePolicyUrl', @@ -122,6 +109,28 @@ export const description: INodeProperties[] = [ default: '', description: 'The default language for the cookie banner', }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: ['cookieBanner'], + operation: ['update'], + }, + }, + options: [ + { + displayName: 'Privacy Policy URL', + name: 'privacyPolicyUrl', + type: 'string', + default: '', + description: 'The URL to the privacy policy. Leave empty to clear the existing value.', + }, + ], + }, ]; export async function execute( @@ -130,11 +139,13 @@ export async function execute( ): Promise { const cookieBannerId = this.getNodeParameter('cookieBannerId', itemIndex) as string; const name = this.getNodeParameter('name', itemIndex, '') as string; - const privacyPolicyUrl = this.getNodeParameter('privacyPolicyUrl', 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; + }; const query = ` mutation UpdateCookieBanner($input: UpdateCookieBannerInput!) { @@ -159,11 +170,13 @@ export async function execute( const input: Record = { cookieBannerId }; if (name) input.name = name; - if (privacyPolicyUrl) input.privacyPolicyUrl = privacyPolicyUrl; 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; + } const responseData = await proboApiRequest.call(this, query, { input }); diff --git a/packages/n8n-node/nodes/Probo/actions/cookiePattern/update.operation.ts b/packages/n8n-node/nodes/Probo/actions/cookiePattern/update.operation.ts index 1a16ae458..ac2a25c7c 100644 --- a/packages/n8n-node/nodes/Probo/actions/cookiePattern/update.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/cookiePattern/update.operation.ts @@ -43,19 +43,6 @@ export const description: INodeProperties[] = [ default: '', description: 'The display name for the cookie pattern', }, - { - displayName: 'Max Age Seconds', - name: 'maxAgeSeconds', - type: 'number', - displayOptions: { - show: { - resource: ['cookiePattern'], - operation: ['update'], - }, - }, - default: 0, - description: 'The maximum age of the cookie in seconds (leave at 0 to keep unchanged)', - }, { displayName: 'Excluded', name: 'excluded', @@ -96,6 +83,31 @@ export const description: INodeProperties[] = [ default: '', description: 'The description of the cookie pattern', }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: ['cookiePattern'], + operation: ['update'], + }, + }, + options: [ + { + displayName: 'Max Age Seconds', + name: 'maxAgeSeconds', + type: 'number', + typeOptions: { + minValue: 0, + }, + default: 0, + description: 'The maximum age of the cookie in seconds. Set to 0 to clear the existing value.', + }, + ], + }, ]; export async function execute( @@ -104,9 +116,11 @@ export async function execute( ): Promise { const cookiePatternId = this.getNodeParameter('cookiePatternId', itemIndex) as string; const displayName = this.getNodeParameter('displayName', itemIndex, '') as string; - const maxAgeSeconds = this.getNodeParameter('maxAgeSeconds', itemIndex, 0) as number; const excluded = this.getNodeParameter('excluded', itemIndex, '') as string; const patternDescription = this.getNodeParameter('patternDescription', itemIndex, '') as string; + const additionalFields = this.getNodeParameter('additionalFields', itemIndex, {}) as { + maxAgeSeconds?: number; + }; const query = ` mutation UpdateCookiePattern($input: UpdateCookiePatternInput!) { @@ -133,9 +147,11 @@ export async function execute( const input: Record = { cookiePatternId }; if (displayName) input.displayName = displayName; - if (maxAgeSeconds > 0) input.maxAgeSeconds = maxAgeSeconds; if (excluded) input.excluded = excluded === 'true'; if (patternDescription) input.description = patternDescription; + if (additionalFields.maxAgeSeconds !== undefined) { + input.maxAgeSeconds = additionalFields.maxAgeSeconds === 0 ? null : additionalFields.maxAgeSeconds; + } const responseData = await proboApiRequest.call(this, query, { input });