Add cookie banner operations to n8n node

Adds four new resources (cookieBanner, cookieCategory,
cookiePattern, cookieConsentRecord) covering all mutations
and queries from the cookie banner GraphQL resolvers.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-01 16:57:41 +04:00
parent 1d08760d3b
commit 6f849b36a1
29 changed files with 2764 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
import { proboApiRequest } from '../../GenericFunctions';
export const description: INodeProperties[] = [
{
displayName: 'Cookie Banner ID',
name: 'cookieBannerId',
type: 'string',
displayOptions: {
show: {
resource: ['cookieBanner'],
operation: ['deactivate'],
},
},
default: '',
description: 'The ID of the cookie banner to deactivate',
required: true,
},
];
export async function execute(
this: IExecuteFunctions,
itemIndex: number,
): Promise<INodeExecutionData> {
const cookieBannerId = this.getNodeParameter('cookieBannerId', itemIndex) as string;
const query = `
mutation DeactivateCookieBanner($input: DeactivateCookieBannerInput!) {
deactivateCookieBanner(input: $input) {
cookieBanner {
id
name
origin
state
privacyPolicyUrl
cookiePolicyUrl
consentExpiryDays
consentMode
showBranding
defaultLanguage
createdAt
updatedAt
}
}
}
`;
const responseData = await proboApiRequest.call(this, query, { input: { cookieBannerId } });
return {
json: responseData,
pairedItem: { item: itemIndex },
};
}