# nodes

node_type: n8n-nodes-base.Brevo
name: Brevo
display_name: Brevo
description: Consume Brevo API
category: Other
code_hash: 691cbbec034dc3012f9590e1c47879bb65e1a6a21fdb311777d7aac37a33cc62
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/brevo
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:19
updated_at: 2025-06-08 08:05:19
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Brevo = void 0;
  const AttributeDescription_1 = require("./AttributeDescription");
  const ContactDescription_1 = require("./ContactDescription");
  const EmailDescription_1 = require("./EmailDescription");
  const SenderDescrition_1 = require("./SenderDescrition");
  class Brevo {
      constructor() {
          this.description = {
              displayName: 'Brevo',
              name: 'sendInBlue',
              icon: 'file:brevo.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Brevo API',
              defaults: {
                  name: 'Brevo',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'sendInBlueApi',
                      required: true,
                  },
              ],
              requestDefaults: {
                  baseURL: 'https://api.brevo.com',
              },
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                          {
                              name: 'Contact Attribute',
                              value: 'attribute',
                          },
                          {
                              name: 'Email',
                              value: 'email',
                          },
                          {
                              name: 'Sender',
                              value: 'sender',
                          },
                      ],
                      default: 'email',
                  },
                  ...AttributeDescription_1.attributeOperations,
                  ...AttributeDescription_1.attributeFields,
                  ...SenderDescrition_1.senderOperations,
                  ...SenderDescrition_1.senderFields,
                  ...ContactDescription_1.contactOperations,
                  ...ContactDescription_1.contactFields,
                  ...EmailDescription_1.emailOperations,
                  ...EmailDescription_1.emailFields,
              ],
          };
      }
  }
  exports.Brevo = Brevo;
  //# sourceMappingURL=Brevo.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Brevo credentials
  description: Documentation for Brevo credentials. Use these credentials to authenticate Brevo in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Brevo credentials

  You can use these credentials to authenticate the following nodes:

  * [Brevo node](/integrations/builtin/app-nodes/n8n-nodes-base.brevo.md)
  * [Brevo Trigger node](/integrations/builtin/trigger-nodes/n8n-nodes-base.brevotrigger.md)

  ## Prerequisites

  Create a [Brevo](https://www.brevo.com/){:target=_blank .external-link} developer account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Brevo's API documentation](https://developers.brevo.com/reference/getting-started-1){:target=_blank .external-link} for more information about authenticating with the service.

  ## API key

  To configure this credential, you'll need:

  - An **API Key**: Refer to the [Brevo API Quick Start documentation](https://developers.brevo.com/docs/getting-started#quick-start){:target=_blank .external-class} for instructions on creating a new API key.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"5603fd80-ec4f-49eb-a2b8-a8ee306ffabe","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"314b78f9ecdbed178d0efb0c28cede3c5276111d04d059f95baeb7265c97e6d4"}}


node_type: n8n-nodes-base.Bubble
name: Bubble
display_name: Bubble
description: Consume the Bubble Data API
category: Other
code_hash: 4ea5888876efa4a1c16ff346276bc08b8a08076dbe41f7205d5b5ca1cfb18705
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/bubble
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:19
updated_at: 2025-06-08 08:05:19
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Bubble = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const ObjectDescription_1 = require("./ObjectDescription");
  class Bubble {
      constructor() {
          this.description = {
              displayName: 'Bubble',
              name: 'bubble',
              icon: 'file:bubble.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Bubble Data API',
              defaults: {
                  name: 'Bubble',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'bubbleApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Object',
                              value: 'object',
                          },
                      ],
                      default: 'object',
                  },
                  ...ObjectDescription_1.objectOperations,
                  ...ObjectDescription_1.objectFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const qs = {};
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              if (resource === 'object') {
                  if (operation === 'create') {
                      const typeNameInput = this.getNodeParameter('typeName', i);
                      const typeName = typeNameInput.replace(/\s/g, '').toLowerCase();
                      const { property } = this.getNodeParameter('properties', i);
                      const body = {};
                      property.forEach((data) => (body[data.key] = data.value));
                      responseData = await GenericFunctions_1.bubbleApiRequest.call(this, 'POST', `/obj/${typeName}`, body, {});
                  }
                  else if (operation === 'delete') {
                      const typeNameInput = this.getNodeParameter('typeName', i);
                      const typeName = typeNameInput.replace(/\s/g, '').toLowerCase();
                      const objectId = this.getNodeParameter('objectId', i);
                      const endpoint = `/obj/${typeName}/${objectId}`;
                      responseData = await GenericFunctions_1.bubbleApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      responseData = { success: true };
                  }
                  else if (operation === 'get') {
                      const typeNameInput = this.getNodeParameter('typeName', i);
                      const typeName = typeNameInput.replace(/\s/g, '').toLowerCase();
                      const objectId = this.getNodeParameter('objectId', i);
                      const endpoint = `/obj/${typeName}/${objectId}`;
                      responseData = await GenericFunctions_1.bubbleApiRequest.call(this, 'GET', endpoint, {}, {});
                      responseData = responseData.response;
                  }
                  else if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', 0);
                      const typeNameInput = this.getNodeParameter('typeName', i);
                      const typeName = typeNameInput.replace(/\s/g, '').toLowerCase();
                      const endpoint = `/obj/${typeName}`;
                      const jsonParameters = this.getNodeParameter('jsonParameters', 0);
                      const options = this.getNodeParameter('options', i);
                      if (!jsonParameters) {
                          if (options.filters) {
                              const { filter } = options.filters;
                              qs.constraints = JSON.stringify(filter);
                          }
                      }
                      else {
                          const filter = options.filtersJson;
                          const data = (0, GenericFunctions_1.validateJSON)(filter);
                          if (data === undefined) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Filters must be a valid JSON', {
                                  itemIndex: i,
                              });
                          }
                          qs.constraints = JSON.stringify(data);
                      }
                      if (options.sort) {
                          const { sortValue } = options.sort;
                          Object.assign(qs, sortValue);
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.bubbleApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', 0);
                          responseData = await GenericFunctions_1.bubbleApiRequest.call(this, 'GET', endpoint, {}, qs);
                          responseData = responseData.response.results;
                      }
                  }
                  else if (operation === 'update') {
                      const typeNameInput = this.getNodeParameter('typeName', i);
                      const typeName = typeNameInput.replace(/\s/g, '').toLowerCase();
                      const objectId = this.getNodeParameter('objectId', i);
                      const endpoint = `/obj/${typeName}/${objectId}`;
                      const { property } = this.getNodeParameter('properties', i);
                      const body = {};
                      property.forEach((data) => (body[data.key] = data.value));
                      responseData = await GenericFunctions_1.bubbleApiRequest.call(this, 'PATCH', endpoint, body, {});
                      responseData = { success: true };
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Bubble = Bubble;
  //# sourceMappingURL=Bubble.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Bubble credentials
  description: Documentation for Bubble credentials. Use these credentials to authenticate Bubble in n8n, a workflow automation platform.
  contentType: [integration, reference]
  priority: medium
  ---

  # Bubble credentials

  You can use these credentials to authenticate the following nodes:

  - [Bubble](/integrations/builtin/app-nodes/n8n-nodes-base.bubble.md)

  /// note | API access
  You need a paid plan to access the Bubble APIs.
  ///

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Bubble's API documentation](https://manual.bubble.io/help-guides/integrations/api){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need a paid [Bubble](https://bubble.io){:target=_blank .external-link} account and:

  - An **API Token**
  - An **App Name**
  - Your **Domain**, if you're using a custom domain

  To set it up, you'll need to create an app:

  1. Go to the [**Apps**](https://bubble.io/home/apps){:target=_blank .external-link} page in Bubble.
  1. Select **Create an app**.
  1. Enter a **Name** for your app, like `n8n-integration`.
  1. Select **Get started**. The app's details open.
  1. In the left navigation, select **Settings** (the gear cog icon).
  1. Select the **API** tab.
  1. In the **Public API Endpoints** section, check the box to **Enable Data API**.
  1. The page displays the **Data API root URL**, for example: `https://n8n-integration.bubbleapps.io/version-test/api/1.1/obj`.
  1. Copy the part of the URL after `https://` and before `.bubbleapps.io` and enter it in n8n as the **App Name**. In the above example, you'd enter `n8n-integration`.
  1. Select **Generate a new API token**.
  8. Enter an **API Token Label**, like `n8n integration`.
  1. Copy the **Private key** and enter it as the **API Token** in your n8n credential.
      - Refer to [Data API | Authentication](https://manual.bubble.io/core-resources/api/the-bubble-api/the-data-api/authentication){:target=_blank .external-link} for more information on generating API tokens.
  1. In n8n, select the **Environment** that best matches your app:
      - Select **Development** for an app that you haven't deployed, accessed at `https://appname.bubbleapps.io/version-test` or `https://www.mydomain.com/version-test`.
      - Select **Live** for an app that you've [deployed](https://manual.bubble.io/help-guides/getting-started/navigating-the-bubble-editor/deploying-your-app){:target=_blank .external-link}, accessed at `https://appname.bubbleapps.io` or `https://www.mydomain.com`.
  1. In n8n, select your **Hosting**:
      - If you haven't set up a custom domain, select **Bubble Hosting**.
      - If you've set up a [custom domain](https://manual.bubble.io/help-guides/getting-started/navigating-the-bubble-editor/tabs-and-sections/settings-tab/custom-domain-and-dns){:target=_blank .external-link}, select **Self Hosted** and enter your custom **Domain**.

  Refer to Bubble's [Creating and managing apps](https://manual.bubble.io/help-guides/getting-started/creating-and-managing-apps){:target=_blank .external-link} documentation for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"3e17ce87-4bb2-4734-9dd8-cd7d5b00d25a","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"d644989313e9eb48f6693ea6bff8343d8560f0f309fbb9d753cb8c1c3b9e6307"}}


node_type: n8n-nodes-base.Chargebee
name: Chargebee
display_name: Chargebee
description: Retrieve data from Chargebee API
category: Other
code_hash: 367d5735be9647c6eb21693357b0c24ebb1278532c2a8ccca6cbdb452bd9038f
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/chargebee
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:19
updated_at: 2025-06-08 08:05:19
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Chargebee = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class Chargebee {
      constructor() {
          this.description = {
              displayName: 'Chargebee',
              name: 'chargebee',
              icon: 'file:chargebee.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Retrieve data from Chargebee API',
              defaults: {
                  name: 'Chargebee',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'chargebeeApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Customer',
                              value: 'customer',
                          },
                          {
                              name: 'Invoice',
                              value: 'invoice',
                          },
                          {
                              name: 'Subscription',
                              value: 'subscription',
                          },
                      ],
                      default: 'invoice',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['customer'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a customer',
                              action: 'Create a customer',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Properties',
                      name: 'properties',
                      type: 'collection',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['customer'],
                          },
                      },
                      default: {},
                      description: 'Properties to set on the new user',
                      placeholder: 'Add Property',
                      options: [
                          {
                              displayName: 'User ID',
                              name: 'id',
                              type: 'string',
                              default: '',
                              description: 'ID for the new customer. If not given, this will be auto-generated.',
                          },
                          {
                              displayName: 'First Name',
                              name: 'first_name',
                              type: 'string',
                              default: '',
                              description: 'The first name of the customer',
                          },
                          {
                              displayName: 'Last Name',
                              name: 'last_name',
                              type: 'string',
                              default: '',
                              description: 'The last name of the customer',
                          },
                          {
                              displayName: 'Email',
                              name: 'email',
                              type: 'string',
                              placeholder: 'name@email.com',
                              default: '',
                              description: 'The email address of the customer',
                          },
                          {
                              displayName: 'Phone',
                              name: 'phone',
                              type: 'string',
                              default: '',
                              description: 'The phone number of the customer',
                          },
                          {
                              displayName: 'Company',
                              name: 'company',
                              type: 'string',
                              default: '',
                              description: 'The company of the customer',
                          },
                          {
                              displayName: 'Custom Properties',
                              name: 'customProperties',
                              placeholder: 'Add Custom Property',
                              description: 'Adds a custom property to set also values which have not been predefined',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: {},
                              options: [
                                  {
                                      name: 'property',
                                      displayName: 'Property',
                                      values: [
                                          {
                                              displayName: 'Property Name',
                                              name: 'name',
                                              type: 'string',
                                              default: '',
                                              description: 'Name of the property to set',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      default: 'list',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['invoice'],
                          },
                      },
                      options: [
                          {
                              name: 'List',
                              value: 'list',
                              description: 'Return the invoices',
                              action: 'List an invoice',
                          },
                          {
                              name: 'PDF Invoice URL',
                              value: 'pdfUrl',
                              description: 'Get URL for the invoice PDF',
                              action: 'Get URL for the invoice PDF',
                          },
                      ],
                  },
                  {
                      displayName: 'Max Results',
                      name: 'maxResults',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 10,
                      displayOptions: {
                          show: {
                              operation: ['list'],
                              resource: ['invoice'],
                          },
                      },
                      description: 'Max. amount of results to return(< 100).',
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      placeholder: 'Add Filter',
                      description: 'Filter for invoices',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['list'],
                              resource: ['invoice'],
                          },
                      },
                      options: [
                          {
                              name: 'date',
                              displayName: 'Invoice Date',
                              values: [
                                  {
                                      displayName: 'Operation',
                                      name: 'operation',
                                      type: 'options',
                                      noDataExpression: true,
                                      options: [
                                          {
                                              name: 'Is',
                                              value: 'is',
                                          },
                                          {
                                              name: 'Is Not',
                                              value: 'is_not',
                                          },
                                          {
                                              name: 'After',
                                              value: 'after',
                                          },
                                          {
                                              name: 'Before',
                                              value: 'before',
                                          },
                                      ],
                                      default: 'after',
                                      description: 'Operation to decide where the the data should be mapped to',
                                  },
                                  {
                                      displayName: 'Date',
                                      name: 'value',
                                      type: 'dateTime',
                                      default: '',
                                      description: 'Query date',
                                  },
                              ],
                          },
                          {
                              name: 'total',
                              displayName: 'Invoice Amount',
                              values: [
                                  {
                                      displayName: 'Operation',
                                      name: 'operation',
                                      type: 'options',
                                      noDataExpression: true,
                                      options: [
                                          {
                                              name: 'Greater Equal Than',
                                              value: 'gte',
                                          },
                                          {
                                              name: 'Greater Than',
                                              value: 'gt',
                                          },
                                          {
                                              name: 'Is',
                                              value: 'is',
                                          },
                                          {
                                              name: 'Is Not',
                                              value: 'is_not',
                                          },
                                          {
                                              name: 'Less Equal Than',
                                              value: 'lte',
                                          },
                                          {
                                              name: 'Less Than',
                                              value: 'lt',
                                          },
                                      ],
                                      default: 'gt',
                                      description: 'Operation to decide where the the data should be mapped to',
                                  },
                                  {
                                      displayName: 'Amount',
                                      name: 'value',
                                      type: 'number',
                                      typeOptions: {
                                          numberPrecision: 2,
                                      },
                                      default: 0,
                                      description: 'Query amount',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Invoice ID',
                      name: 'invoiceId',
                      description: 'The ID of the invoice to get',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['pdfUrl'],
                              resource: ['invoice'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['subscription'],
                          },
                      },
                      options: [
                          {
                              name: 'Cancel',
                              value: 'cancel',
                              description: 'Cancel a subscription',
                              action: 'Cancel a subscription',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a subscription',
                              action: 'Delete a subscription',
                          },
                      ],
                      default: 'delete',
                  },
                  {
                      displayName: 'Subscription ID',
                      name: 'subscriptionId',
                      description: 'The ID of the subscription to cancel',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['cancel'],
                              resource: ['subscription'],
                          },
                      },
                  },
                  {
                      displayName: 'Schedule End of Term',
                      name: 'endOfTerm',
                      type: 'boolean',
                      default: false,
                      displayOptions: {
                          show: {
                              operation: ['cancel'],
                              resource: ['subscription'],
                          },
                      },
                      description: 'Whether it will not cancel it directly in will instead schedule the cancelation for the end of the term',
                  },
                  {
                      displayName: 'Subscription ID',
                      name: 'subscriptionId',
                      description: 'The ID of the subscription to delete',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['subscription'],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const credentials = await this.getCredentials('chargebeeApi');
          const baseUrl = `https://${credentials.accountName}.chargebee.com/api/v2`;
          let body;
          let qs;
          for (let i = 0; i < items.length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', i);
                  const operation = this.getNodeParameter('operation', i);
                  let requestMethod = 'GET';
                  let endpoint = '';
                  body = {};
                  qs = {};
                  if (resource === 'customer') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          const properties = this.getNodeParameter('properties', i, {});
                          for (const key of Object.keys(properties)) {
                              if (key === 'customProperties' &&
                                  properties.customProperties.property !== undefined) {
                                  for (const customProperty of properties.customProperties
                                      .property) {
                                      qs[customProperty.name] = customProperty.value;
                                  }
                              }
                              else {
                                  qs[key] = properties[key];
                              }
                          }
                          endpoint = 'customers';
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'invoice') {
                      if (operation === 'list') {
                          endpoint = 'invoices';
                          qs['sort_by[desc]'] = 'date';
                          qs.limit = this.getNodeParameter('maxResults', i, {});
                          const setFilters = this.getNodeParameter('filters', i, {});
                          let filter;
                          let value;
                          for (const filterProperty of Object.keys(setFilters)) {
                              for (filter of setFilters[filterProperty]) {
                                  value = filter.value;
                                  if (filterProperty === 'date') {
                                      value = Math.floor(new Date(value).getTime() / 1000);
                                  }
                                  qs[`${filterProperty}[${filter.operation}]`] = value;
                              }
                          }
                      }
                      else if (operation === 'pdfUrl') {
                          requestMethod = 'POST';
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          endpoint = `invoices/${invoiceId.trim()}/pdf`;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'subscription') {
                      if (operation === 'cancel') {
                          requestMethod = 'POST';
                          const subscriptionId = this.getNodeParameter('subscriptionId', i, '');
                          body.end_of_term = this.getNodeParameter('endOfTerm', i, false);
                          endpoint = `subscriptions/${subscriptionId.trim()}/cancel`;
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'POST';
                          const subscriptionId = this.getNodeParameter('subscriptionId', i, '');
                          endpoint = `subscriptions/${subscriptionId.trim()}/delete`;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  const options = {
                      method: requestMethod,
                      body,
                      qs,
                      uri: `${baseUrl}/${endpoint}`,
                      auth: {
                          user: credentials.apiKey,
                          pass: '',
                      },
                      json: true,
                  };
                  let responseData;
                  try {
                      responseData = await this.helpers.request(options);
                  }
                  catch (error) {
                      throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                  }
                  if (resource === 'invoice' && operation === 'list') {
                      responseData.list.forEach((data) => {
                          responseData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ ...data.invoice }), { itemData: { item: i } });
                          returnData.push(...responseData);
                      });
                  }
                  else if (resource === 'invoice' && operation === 'pdfUrl') {
                      const data = {};
                      Object.assign(data, items[i].json);
                      data.pdfUrl = responseData.download.download_url;
                      responseData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ ...data }), { itemData: { item: i } });
                      returnData.push(...responseData);
                  }
                  else {
                      responseData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {}, itemIndex: i });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Chargebee = Chargebee;
  //# sourceMappingURL=Chargebee.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Chargebee credentials
  description: Documentation for Chargebee credentials. Use these credentials to authenticate Chargebee in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Chargebee credentials

  You can use these credentials to authenticate the following nodes:

  - [Chargebee](/integrations/builtin/app-nodes/n8n-nodes-base.chargebee.md)
  - [Chargebee Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.chargebeetrigger.md)

  ## Prerequisites

  Create a [Chargebee](https://www.chargebee.com/) account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Chargebee's API documentation](https://apidocs.chargebee.com/docs/api/){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **Account Name**: This is your Chargebee Site Name or subdomain, for example if `https://n8n.chargebee.com` is the full site name, the Account Name is `n8n`.
  - An **API Key**: Refer to the [Chargebee Creating an API key documentation](https://www.chargebee.com/docs/api_keys.html#creating-an-api-key){:target=_blank .external-link} for steps on how to generate an API key. 

  Refer to their more general [API authentication documentation](https://apidocs.chargebee.com/docs/api/auth?lang=curl){:target=_blank .external-link} for further clarification.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"4e66ac61-d748-40a1-a31a-774d6e35cbd0","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"abe83d04a9404e4e7a6bf2c61db9a11b6736759f438967c05f5f47f3573b6404"}}


node_type: n8n-nodes-base.CircleCi
name: CircleCi
display_name: CircleCI
description: Consume CircleCI API
category: Other
code_hash: b4f772e8c2b54b7f9a6a77051c090ed520de646b39b5959bd158b0d90c5f4723
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/circleci
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:19
updated_at: 2025-06-08 08:05:19
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CircleCi = void 0;
  const PipelineDescription_1 = require("./PipelineDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  class CircleCi {
      constructor() {
          this.description = {
              displayName: 'CircleCI',
              name: 'circleCi',
              icon: 'file:circleCi.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume CircleCI API',
              defaults: {
                  name: 'CircleCI',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'circleCiApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Pipeline',
                              value: 'pipeline',
                          },
                      ],
                      default: 'pipeline',
                  },
                  ...PipelineDescription_1.pipelineOperations,
                  ...PipelineDescription_1.pipelineFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'pipeline') {
                      if (operation === 'get') {
                          const vcs = this.getNodeParameter('vcs', i);
                          let slug = this.getNodeParameter('projectSlug', i);
                          const pipelineNumber = this.getNodeParameter('pipelineNumber', i);
                          slug = slug.replace(new RegExp(/\//g), '%2F');
                          const endpoint = `/project/${vcs}/${slug}/pipeline/${pipelineNumber}`;
                          responseData = await GenericFunctions_1.circleciApiRequest.call(this, 'GET', endpoint, {}, qs);
                          responseData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      }
                      if (operation === 'getAll') {
                          const vcs = this.getNodeParameter('vcs', i);
                          const filters = this.getNodeParameter('filters', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          let slug = this.getNodeParameter('projectSlug', i);
                          slug = slug.replace(new RegExp(/\//g), '%2F');
                          if (filters.branch) {
                              qs.branch = filters.branch;
                          }
                          const endpoint = `/project/${vcs}/${slug}/pipeline`;
                          if (returnAll) {
                              responseData = await GenericFunctions_1.circleciApiRequestAllItems.call(this, 'items', 'GET', endpoint, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.circleciApiRequest.call(this, 'GET', endpoint, {}, qs);
                              responseData = responseData.items;
                              responseData = responseData.splice(0, qs.limit);
                          }
                          responseData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      }
                      if (operation === 'trigger') {
                          const vcs = this.getNodeParameter('vcs', i);
                          let slug = this.getNodeParameter('projectSlug', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          slug = slug.replace(new RegExp(/\//g), '%2F');
                          const endpoint = `/project/${vcs}/${slug}/pipeline`;
                          const body = {};
                          if (additionalFields.branch) {
                              body.branch = additionalFields.branch;
                          }
                          if (additionalFields.tag) {
                              body.tag = additionalFields.tag;
                          }
                          responseData = await GenericFunctions_1.circleciApiRequest.call(this, 'POST', endpoint, body, qs);
                          responseData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      }
                  }
                  returnData.push(...responseData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {}, itemIndex: i });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.CircleCi = CircleCi;
  //# sourceMappingURL=CircleCi.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: CircleCI credentials
  description: Documentation for CircleCI credentials. Use these credentials to authenticate CircleCI in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # CircleCI credentials

  You can use these credentials to authenticate the following nodes:

  - [CircleCI](/integrations/builtin/app-nodes/n8n-nodes-base.circleci.md)

  ## Prerequisites

  Create a [CircleCI](https://circleci.com/) account. 

  ## Supported authentication methods

  - Personal API token

  ## Related resources

  Refer to [CircleCI's API documentation](https://circleci.com/docs/api/v2/index.html){:target=_blank .external-link} for more information about the service.

  ## Using personal API token

  To configure this credential, you'll need: 

  - A **Personal API Token**: Refer to the [CircleCI Creating a Personal API token documentation](https://circleci.com/docs/managing-api-tokens/#creating-a-personal-api-token){:target=_blank .external-link} for instructions on creating your token.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"faf7c6fb-a157-47b9-aef5-5ed3c71ed2fb","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"6ebd50cfe30671dabd78c912e4b0ffe4958b3db5fcf2d7c43f6510bbfaacbb57"}}


node_type: n8n-nodes-base.Clearbit
name: Clearbit
display_name: Clearbit
description: Consume Clearbit API
category: Other
code_hash: eec0f3d468a671e9f42c4a28863ea587e325aa5b5f1d6f33e1124d6a60740257
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/clearbit
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:19
updated_at: 2025-06-08 08:05:19
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Clearbit = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const CompanyDescription_1 = require("./CompanyDescription");
  const PersonDescription_1 = require("./PersonDescription");
  class Clearbit {
      constructor() {
          this.description = {
              displayName: 'Clearbit',
              name: 'clearbit',
              icon: 'file:clearbit.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ":" + $parameter["resource"]}}',
              description: 'Consume Clearbit API',
              defaults: {
                  name: 'Clearbit',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'clearbitApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Company',
                              value: 'company',
                              description: 'The Company API allows you to look up a company by their domain',
                          },
                          {
                              name: 'Person',
                              value: 'person',
                              description: 'The Person API lets you retrieve social information associated with an email address, such as a person’s name, location and Twitter handle',
                          },
                      ],
                      default: 'company',
                  },
                  ...CompanyDescription_1.companyOperations,
                  ...CompanyDescription_1.companyFields,
                  ...PersonDescription_1.personOperations,
                  ...PersonDescription_1.personFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'person') {
                      if (operation === 'enrich') {
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          qs.email = email;
                          if (additionalFields.givenName) {
                              qs.given_name = additionalFields.givenName;
                          }
                          if (additionalFields.familyName) {
                              qs.family_name = additionalFields.familyName;
                          }
                          if (additionalFields.ipAddress) {
                              qs.ip_address = additionalFields.ipAddress;
                          }
                          if (additionalFields.location) {
                              qs.location = additionalFields.location;
                          }
                          if (additionalFields.company) {
                              qs.company = additionalFields.company;
                          }
                          if (additionalFields.companyDomain) {
                              qs.company_domain = additionalFields.companyDomain;
                          }
                          if (additionalFields.linkedIn) {
                              qs.linkedin = additionalFields.linkedIn;
                          }
                          if (additionalFields.twitter) {
                              qs.twitter = additionalFields.twitter;
                          }
                          if (additionalFields.facebook) {
                              qs.facebook = additionalFields.facebook;
                          }
                          responseData = await GenericFunctions_1.clearbitApiRequest.call(this, 'GET', `${resource}-stream`, '/v2/people/find', {}, qs);
                      }
                  }
                  if (resource === 'company') {
                      if (operation === 'enrich') {
                          const domain = this.getNodeParameter('domain', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          qs.domain = domain;
                          if (additionalFields.companyName) {
                              qs.company_name = additionalFields.companyName;
                          }
                          if (additionalFields.linkedin) {
                              qs.linkedin = additionalFields.linkedin;
                          }
                          if (additionalFields.twitter) {
                              qs.twitter = additionalFields.twitter;
                          }
                          if (additionalFields.facebook) {
                              qs.facebook = additionalFields.facebook;
                          }
                          responseData = await GenericFunctions_1.clearbitApiRequest.call(this, 'GET', `${resource}-stream`, '/v2/companies/find', {}, qs);
                      }
                      if (operation === 'autocomplete') {
                          const name = this.getNodeParameter('name', i);
                          qs.query = name;
                          responseData = await GenericFunctions_1.clearbitApiRequest.call(this, 'GET', 'autocomplete', '/v1/companies/suggest', {}, qs);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {} });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Clearbit = Clearbit;
  //# sourceMappingURL=Clearbit.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Clearbit credentials
  description: Documentation for Clearbit credentials. Use these credentials to authenticate Clearbit in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Clearbit credentials

  You can use these credentials to authenticate the following node:

  - [Clearbit](/integrations/builtin/app-nodes/n8n-nodes-base.clearbit.md)

  ## Prerequisites

  Create a [Clearbit](https://www.clearbit.com/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Clearbit's API documentation](https://dashboard.clearbit.com/docs){:target=_blank .external-link} for more information about authenticating with the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Refer to [Clearbit's API Authentication documentation](https://dashboard.clearbit.com/docs#authentication) for more information on creating and viewing API keys.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"3e01cb4f-2247-46ef-a9b1-f11659111ad6","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"2a242725b47931661e14f6f258cc453433df8e1ea30f02cabd85458bb3064d0b"}}


node_type: n8n-nodes-base.ClickUp
name: ClickUp
display_name: ClickUp
description: Consume ClickUp API (Beta)
category: Other
code_hash: a2d9a4ef05079c6644a086b884c5177b197bc8821bcd47ba8e9331a962758bd4
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/clickup
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:19
updated_at: 2025-06-08 08:05:19
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ClickUp = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const ChecklistDescription_1 = require("./ChecklistDescription");
  const ChecklistItemDescription_1 = require("./ChecklistItemDescription");
  const CommentDescription_1 = require("./CommentDescription");
  const FolderDescription_1 = require("./FolderDescription");
  const GoalDescription_1 = require("./GoalDescription");
  const GoalKeyResultDescription_1 = require("./GoalKeyResultDescription");
  const TaskDescription_1 = require("./TaskDescription");
  const TaskListDescription_1 = require("./TaskListDescription");
  const TaskTagDescription_1 = require("./TaskTagDescription");
  const SpaceTagDescription_1 = require("./SpaceTagDescription");
  const TaskDependencyDescription_1 = require("./TaskDependencyDescription");
  const TimeEntryDescription_1 = require("./TimeEntryDescription");
  const TimeEntryTagDescription_1 = require("./TimeEntryTagDescription");
  const ListDescription_1 = require("./ListDescription");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class ClickUp {
      constructor() {
          this.description = {
              displayName: 'ClickUp',
              name: 'clickUp',
              icon: 'file:clickup.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ":" + $parameter["resource"]}}',
              description: 'Consume ClickUp API (Beta)',
              defaults: {
                  name: 'ClickUp',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'clickUpApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'clickUpOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Access Token',
                              value: 'accessToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'accessToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Checklist',
                              value: 'checklist',
                          },
                          {
                              name: 'Checklist Item',
                              value: 'checklistItem',
                          },
                          {
                              name: 'Comment',
                              value: 'comment',
                          },
                          {
                              name: 'Folder',
                              value: 'folder',
                          },
                          {
                              name: 'Goal',
                              value: 'goal',
                          },
                          {
                              name: 'Goal Key Result',
                              value: 'goalKeyResult',
                          },
                          {
                              name: 'List',
                              value: 'list',
                          },
                          {
                              name: 'Space Tag',
                              value: 'spaceTag',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                          {
                              name: 'Task Dependency',
                              value: 'taskDependency',
                          },
                          {
                              name: 'Task List',
                              value: 'taskList',
                          },
                          {
                              name: 'Task Tag',
                              value: 'taskTag',
                          },
                          {
                              name: 'Time Entry',
                              value: 'timeEntry',
                          },
                          {
                              name: 'Time Entry Tag',
                              value: 'timeEntryTag',
                          },
                      ],
                      default: 'task',
                  },
                  ...ChecklistDescription_1.checklistOperations,
                  ...ChecklistDescription_1.checklistFields,
                  ...ChecklistItemDescription_1.checklistItemOperations,
                  ...ChecklistItemDescription_1.checklistItemFields,
                  ...CommentDescription_1.commentOperations,
                  ...CommentDescription_1.commentFields,
                  ...FolderDescription_1.folderOperations,
                  ...FolderDescription_1.folderFields,
                  ...GoalDescription_1.goalOperations,
                  ...GoalDescription_1.goalFields,
                  ...GoalKeyResultDescription_1.goalKeyResultOperations,
                  ...GoalKeyResultDescription_1.goalKeyResultFields,
                  ...TaskTagDescription_1.taskTagOperations,
                  ...TaskTagDescription_1.taskTagFields,
                  ...TaskListDescription_1.taskListOperations,
                  ...TaskListDescription_1.taskListFields,
                  ...SpaceTagDescription_1.spaceTagOperations,
                  ...SpaceTagDescription_1.spaceTagFields,
                  ...TaskDescription_1.taskOperations,
                  ...TaskDescription_1.taskFields,
                  ...TaskDependencyDescription_1.taskDependencyOperations,
                  ...TaskDependencyDescription_1.taskDependencyFields,
                  ...TimeEntryDescription_1.timeEntryOperations,
                  ...TimeEntryDescription_1.timeEntryFields,
                  ...TaskDependencyDescription_1.taskDependencyFields,
                  ...TimeEntryTagDescription_1.timeEntryTagOperations,
                  ...TimeEntryTagDescription_1.timeEntryTagFields,
                  ...ListDescription_1.listOperations,
                  ...ListDescription_1.listFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTeams() {
                      const returnData = [];
                      const { teams } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', '/team');
                      for (const team of teams) {
                          const teamName = team.name;
                          const teamId = team.id;
                          returnData.push({
                              name: teamName,
                              value: teamId,
                          });
                      }
                      return returnData;
                  },
                  async getSpaces() {
                      const teamId = this.getCurrentNodeParameter('team');
                      const returnData = [];
                      const { spaces } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/team/${teamId}/space`);
                      for (const space of spaces) {
                          const spaceName = space.name;
                          const spaceId = space.id;
                          returnData.push({
                              name: spaceName,
                              value: spaceId,
                          });
                      }
                      return returnData;
                  },
                  async getFolders() {
                      const spaceId = this.getCurrentNodeParameter('space');
                      const returnData = [];
                      const { folders } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/space/${spaceId}/folder`);
                      for (const folder of folders) {
                          const folderName = folder.name;
                          const folderId = folder.id;
                          returnData.push({
                              name: folderName,
                              value: folderId,
                          });
                      }
                      return returnData;
                  },
                  async getLists() {
                      const folderId = this.getCurrentNodeParameter('folder');
                      const returnData = [];
                      const { lists } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/folder/${folderId}/list`);
                      for (const list of lists) {
                          const listName = list.name;
                          const listId = list.id;
                          returnData.push({
                              name: listName,
                              value: listId,
                          });
                      }
                      return returnData;
                  },
                  async getFolderlessLists() {
                      const spaceId = this.getCurrentNodeParameter('space');
                      const returnData = [];
                      const { lists } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/space/${spaceId}/list`);
                      for (const list of lists) {
                          const listName = list.name;
                          const listId = list.id;
                          returnData.push({
                              name: listName,
                              value: listId,
                          });
                      }
                      return returnData;
                  },
                  async getAssignees() {
                      const listId = this.getCurrentNodeParameter('list');
                      const taskId = this.getCurrentNodeParameter('task');
                      const returnData = [];
                      let url;
                      if (listId) {
                          url = `/list/${listId}/member`;
                      }
                      else if (taskId) {
                          url = `/task/${taskId}/member`;
                      }
                      else {
                          return returnData;
                      }
                      const { members } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', url);
                      for (const member of members) {
                          const memberName = member.username;
                          const menberId = member.id;
                          returnData.push({
                              name: memberName,
                              value: menberId,
                          });
                      }
                      return returnData;
                  },
                  async getTags() {
                      const spaceId = this.getCurrentNodeParameter('space');
                      const returnData = [];
                      const { tags } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/space/${spaceId}/tag`);
                      for (const tag of tags) {
                          const tagName = tag.name;
                          const tagId = tag.name;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
                  async getTimeEntryTags() {
                      const teamId = this.getCurrentNodeParameter('team');
                      const returnData = [];
                      const { data: tags } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/team/${teamId}/time_entries/tags`);
                      for (const tag of tags) {
                          const tagName = tag.name;
                          const tagId = JSON.stringify(tag);
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
                  async getStatuses() {
                      const listId = this.getCurrentNodeParameter('list');
                      const returnData = [];
                      const { statuses } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/list/${listId}`);
                      for (const status of statuses) {
                          const statusName = status.status;
                          const statusId = status.status;
                          returnData.push({
                              name: statusName,
                              value: statusId,
                          });
                      }
                      return returnData;
                  },
                  async getCustomFields() {
                      const listId = this.getCurrentNodeParameter('list');
                      const returnData = [];
                      const { fields } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/list/${listId}/field`);
                      for (const field of fields) {
                          const fieldName = field.name;
                          const fieldId = field.id;
                          returnData.push({
                              name: fieldName,
                              value: fieldId,
                          });
                      }
                      return returnData;
                  },
                  async getTasks() {
                      const listId = this.getCurrentNodeParameter('list');
                      const archived = this.getCurrentNodeParameter('archived');
                      const returnData = [];
                      const { tasks } = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/list/${listId}/task?archived=${archived}`);
                      for (const task of tasks) {
                          const taskName = task.name;
                          const taskId = task.id;
                          returnData.push({
                              name: taskName,
                              value: taskId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'checklist') {
                      if (operation === 'create') {
                          const taskId = this.getNodeParameter('task', i);
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/task/${taskId}/checklist`, body);
                          responseData = responseData.checklist;
                      }
                      if (operation === 'delete') {
                          const checklistId = this.getNodeParameter('checklist', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/checklist/${checklistId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'update') {
                          const checklistId = this.getNodeParameter('checklist', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.position) {
                              body.position = updateFields.position;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/checklist/${checklistId}`, body);
                          responseData = responseData.checklist;
                      }
                  }
                  if (resource === 'checklistItem') {
                      if (operation === 'create') {
                          const checklistId = this.getNodeParameter('checklist', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                          };
                          if (additionalFields.assignee) {
                              body.assignee = parseInt(additionalFields.assignee, 10);
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/checklist/${checklistId}/checklist_item`, body);
                          responseData = responseData.checklist;
                      }
                      if (operation === 'delete') {
                          const checklistId = this.getNodeParameter('checklist', i);
                          const checklistItemId = this.getNodeParameter('checklistItem', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/checklist/${checklistId}/checklist_item/${checklistItemId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'update') {
                          const checklistId = this.getNodeParameter('checklist', i);
                          const checklistItemId = this.getNodeParameter('checklistItem', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.parent) {
                              body.parent = updateFields.parent;
                          }
                          if (updateFields.assignee) {
                              body.assignee = parseInt(updateFields.assignee, 10);
                          }
                          if (updateFields.resolved) {
                              body.resolved = updateFields.resolved;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/checklist/${checklistId}/checklist_item/${checklistItemId}`, body);
                          responseData = responseData.checklist;
                      }
                  }
                  if (resource === 'comment') {
                      if (operation === 'create') {
                          const commentOn = this.getNodeParameter('commentOn', i);
                          const id = this.getNodeParameter('id', i);
                          const commentText = this.getNodeParameter('commentText', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              comment_text: commentText,
                          };
                          if (additionalFields.assignee) {
                              body.assignee = parseInt(additionalFields.assignee, 10);
                          }
                          if (additionalFields.notifyAll) {
                              body.notify_all = additionalFields.notifyAll;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/${commentOn}/${id}/comment`, body);
                      }
                      if (operation === 'delete') {
                          const commentId = this.getNodeParameter('comment', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/comment/${commentId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'getAll') {
                          const commentsOn = this.getNodeParameter('commentsOn', i);
                          const id = this.getNodeParameter('id', i);
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/${commentsOn}/${id}/comment`, {}, qs);
                          responseData = responseData.comments;
                          responseData = responseData.splice(0, qs.limit);
                      }
                      if (operation === 'update') {
                          const commentId = this.getNodeParameter('comment', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.commentText) {
                              body.comment_text = updateFields.commentText;
                          }
                          if (updateFields.assignee) {
                              body.assignee = parseInt(updateFields.assignee, 10);
                          }
                          if (updateFields.resolved) {
                              body.resolved = updateFields.resolved;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/comment/${commentId}`, body);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'folder') {
                      if (operation === 'create') {
                          const spaceId = this.getNodeParameter('space', i);
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/space/${spaceId}/folder`, body);
                      }
                      if (operation === 'delete') {
                          const folderId = this.getNodeParameter('folder', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/folder/${folderId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const folderId = this.getNodeParameter('folder', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/folder/${folderId}`);
                      }
                      if (operation === 'getAll') {
                          const filters = this.getNodeParameter('filters', i);
                          const spaceId = this.getNodeParameter('space', i);
                          if (filters.archived) {
                              qs.archived = filters.archived;
                          }
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/space/${spaceId}/folder`, {}, qs);
                          responseData = responseData.folders;
                          responseData = responseData.splice(0, qs.limit);
                      }
                      if (operation === 'update') {
                          const folderId = this.getNodeParameter('folder', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/folder/${folderId}`, body);
                      }
                  }
                  if (resource === 'goal') {
                      if (operation === 'create') {
                          const teamId = this.getNodeParameter('team', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                          };
                          if (additionalFields.dueDate) {
                              body.due_date = new Date(additionalFields.dueDate).getTime();
                          }
                          if (additionalFields.description) {
                              body.description = additionalFields.description;
                          }
                          if (additionalFields.multipleOwners) {
                              body.multiple_owners = additionalFields.multipleOwners;
                          }
                          if (additionalFields.color) {
                              body.color = additionalFields.color;
                          }
                          if (additionalFields.owners) {
                              body.owners = additionalFields.owners
                                  .split(',')
                                  .map((e) => parseInt(e, 10));
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/team/${teamId}/goal`, body);
                          responseData = responseData.goal;
                      }
                      if (operation === 'delete') {
                          const goalId = this.getNodeParameter('goal', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/goal/${goalId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const goalId = this.getNodeParameter('goal', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/goal/${goalId}`);
                          responseData = responseData.goal;
                      }
                      if (operation === 'getAll') {
                          const teamId = this.getNodeParameter('team', i);
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/team/${teamId}/goal`, {}, qs);
                          responseData = responseData.goals;
                          responseData = responseData.splice(0, qs.limit);
                      }
                      if (operation === 'update') {
                          const goalId = this.getNodeParameter('goal', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.dueDate) {
                              body.due_date = new Date(updateFields.dueDate).getTime();
                          }
                          if (updateFields.description) {
                              body.description = updateFields.description;
                          }
                          if (updateFields.color) {
                              body.color = updateFields.color;
                          }
                          if (updateFields.addOwners) {
                              body.add_owners = updateFields.addOwners
                                  .split(',')
                                  .map((e) => parseInt(e, 10));
                          }
                          if (updateFields.removeOwners) {
                              body.rem_owners = updateFields.removeOwners
                                  .split(',')
                                  .map((e) => parseInt(e, 10));
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/goal/${goalId}`, body);
                          responseData = responseData.goal;
                      }
                  }
                  if (resource === 'goalKeyResult') {
                      if (operation === 'create') {
                          const goalId = this.getNodeParameter('goal', i);
                          const name = this.getNodeParameter('name', i);
                          const type = this.getNodeParameter('type', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                              type,
                          };
                          if (type === 'number' || type === 'currency') {
                              if (!additionalFields.unit) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Unit field must be set', {
                                      itemIndex: i,
                                  });
                              }
                          }
                          if (type === 'number' ||
                              type === 'percentaje' ||
                              type === 'automatic' ||
                              type === 'currency') {
                              if (additionalFields.stepsStart === undefined ||
                                  !additionalFields.stepsEnd === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Steps start and steps end fields must be set', { itemIndex: i });
                              }
                          }
                          if (additionalFields.unit) {
                              body.unit = additionalFields.unit;
                          }
                          if (additionalFields.stepsStart) {
                              body.steps_start = additionalFields.stepsStart;
                          }
                          if (additionalFields.stepsEnd) {
                              body.steps_end = additionalFields.stepsEnd;
                          }
                          if (additionalFields.taskIds) {
                              body.task_ids = additionalFields.taskIds.split(',');
                          }
                          if (additionalFields.listIds) {
                              body.list_ids = additionalFields.listIds.split(',');
                          }
                          if (additionalFields.owners) {
                              body.owners = additionalFields.owners
                                  .split(',')
                                  .map((e) => parseInt(e, 10));
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/goal/${goalId}/key_result`, body);
                          responseData = responseData.key_result;
                      }
                      if (operation === 'delete') {
                          const keyResultId = this.getNodeParameter('keyResult', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/key_result/${keyResultId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'update') {
                          const keyResultId = this.getNodeParameter('keyResult', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.note) {
                              body.note = updateFields.note;
                          }
                          if (updateFields.stepsCurrent) {
                              body.steps_current = updateFields.stepsCurrent;
                          }
                          if (updateFields.stepsStart) {
                              body.steps_start = updateFields.stepsStart;
                          }
                          if (updateFields.stepsEnd) {
                              body.steps_end = updateFields.stepsEnd;
                          }
                          if (updateFields.unit) {
                              body.unit = updateFields.unit;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/key_result/${keyResultId}`, body);
                          responseData = responseData.key_result;
                      }
                  }
                  if (resource === 'guest') {
                      if (operation === 'create') {
                          const teamId = this.getNodeParameter('team', i);
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              email,
                          };
                          if (additionalFields.canEditTags) {
                              body.can_edit_tags = additionalFields.canEditTags;
                          }
                          if (additionalFields.canSeeTimeSpend) {
                              body.can_see_time_spend = additionalFields.canSeeTimeSpend;
                          }
                          if (additionalFields.canSeeTimeEstimated) {
                              body.can_see_time_estimated = additionalFields.canSeeTimeEstimated;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/team/${teamId}/guest`, body);
                          responseData = responseData.team;
                      }
                      if (operation === 'delete') {
                          const teamId = this.getNodeParameter('team', i);
                          const guestId = this.getNodeParameter('guest', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/team/${teamId}/guest/${guestId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const teamId = this.getNodeParameter('team', i);
                          const guestId = this.getNodeParameter('guest', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/team/${teamId}/guest/${guestId}`);
                          responseData = responseData.team;
                      }
                      if (operation === 'update') {
                          const teamId = this.getNodeParameter('team', i);
                          const guestId = this.getNodeParameter('guest', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.username) {
                              body.username = updateFields.username;
                          }
                          if (updateFields.canEditTags) {
                              body.can_edit_tags = updateFields.canEditTags;
                          }
                          if (updateFields.canSeeTimeSpend) {
                              body.can_see_time_spend = updateFields.canSeeTimeSpend;
                          }
                          if (updateFields.canSeeTimeEstimated) {
                              body.can_see_time_estimated = updateFields.canSeeTimeEstimated;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/team/${teamId}/guest/${guestId}`, body);
                          responseData = responseData.team;
                      }
                  }
                  if (resource === 'task') {
                      if (operation === 'create') {
                          const listId = this.getNodeParameter('list', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                          };
                          if (additionalFields.customFieldsJson) {
                              const customFields = (0, GenericFunctions_1.validateJSON)(additionalFields.customFieldsJson);
                              if (customFields === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom Fields: Invalid JSON', {
                                      itemIndex: i,
                                  });
                              }
                              body.custom_fields = customFields;
                          }
                          if (additionalFields.content) {
                              body.content = additionalFields.content;
                          }
                          if (additionalFields.assignees) {
                              body.assignees = additionalFields.assignees;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          if (additionalFields.status) {
                              body.status = additionalFields.status;
                          }
                          if (additionalFields.priority) {
                              body.priority = additionalFields.priority;
                          }
                          if (additionalFields.dueDate) {
                              body.due_date = new Date(additionalFields.dueDate).getTime();
                          }
                          if (additionalFields.dueDateTime) {
                              body.due_date_time = additionalFields.dueDateTime;
                          }
                          if (additionalFields.timeEstimate) {
                              body.time_estimate = additionalFields.timeEstimate * 6000;
                          }
                          if (additionalFields.startDate) {
                              body.start_date = new Date(additionalFields.startDate).getTime();
                          }
                          if (additionalFields.startDateTime) {
                              body.start_date_time = additionalFields.startDateTime;
                          }
                          if (additionalFields.notifyAll) {
                              body.notify_all = additionalFields.notifyAll;
                          }
                          if (additionalFields.parentId) {
                              body.parent = additionalFields.parentId;
                          }
                          if (additionalFields.markdownContent) {
                              delete body.content;
                              body.markdown_content = additionalFields.content;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/list/${listId}/task`, body);
                      }
                      if (operation === 'update') {
                          const taskId = this.getNodeParameter('id', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              assignees: {
                                  add: [],
                                  rem: [],
                              },
                          };
                          if (updateFields.content) {
                              body.content = updateFields.content;
                          }
                          if (updateFields.priority) {
                              body.priority = updateFields.priority;
                          }
                          if (updateFields.dueDate) {
                              body.due_date = new Date(updateFields.dueDate).getTime();
                          }
                          if (updateFields.dueDateTime) {
                              body.due_date_time = updateFields.dueDateTime;
                          }
                          if (updateFields.timeEstimate) {
                              body.time_estimate = updateFields.timeEstimate * 6000;
                          }
                          if (updateFields.startDate) {
                              body.start_date = new Date(updateFields.startDate).getTime();
                          }
                          if (updateFields.startDateTime) {
                              body.start_date_time = updateFields.startDateTime;
                          }
                          if (updateFields.notifyAll) {
                              body.notify_all = updateFields.notifyAll;
                          }
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.parentId) {
                              body.parent = updateFields.parentId;
                          }
                          if (updateFields.addAssignees) {
                              body.assignees.add = updateFields.addAssignees
                                  .split(',')
                                  .map((e) => parseInt(e, 10));
                          }
                          if (updateFields.removeAssignees) {
                              body.assignees.rem = updateFields.removeAssignees
                                  .split(',')
                                  .map((e) => parseInt(e, 10));
                          }
                          if (updateFields.status) {
                              body.status = updateFields.status;
                          }
                          if (updateFields.markdownContent) {
                              delete body.content;
                              body.markdown_content = updateFields.content;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/task/${taskId}`, body);
                      }
                      if (operation === 'get') {
                          const taskId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/task/${taskId}`);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          if (filters.archived) {
                              qs.archived = filters.archived;
                          }
                          if (filters.subtasks) {
                              qs.subtasks = filters.subtasks;
                          }
                          if (filters.includeClosed) {
                              qs.include_closed = filters.includeClosed;
                          }
                          if (filters.orderBy) {
                              qs.order_by = filters.orderBy;
                          }
                          if (filters.statuses) {
                              qs.statuses = filters.statuses;
                          }
                          if (filters.assignees) {
                              qs.assignees = filters.assignees;
                          }
                          if (filters.tags) {
                              qs.tags = filters.tags;
                          }
                          if (filters.dueDateGt) {
                              qs.due_date_gt = new Date(filters.dueDateGt).getTime();
                          }
                          if (filters.dueDateLt) {
                              qs.due_date_lt = new Date(filters.dueDateLt).getTime();
                          }
                          if (filters.dateCreatedGt) {
                              qs.date_created_gt = new Date(filters.dateCreatedGt).getTime();
                          }
                          if (filters.dateCreatedLt) {
                              qs.date_created_lt = new Date(filters.dateCreatedLt).getTime();
                          }
                          if (filters.dateUpdatedGt) {
                              qs.date_updated_gt = new Date(filters.dateUpdatedGt).getTime();
                          }
                          if (filters.dateUpdatedLt) {
                              qs.date_updated_lt = new Date(filters.dateUpdatedLt).getTime();
                          }
                          if (filters.customFieldsUi) {
                              const customFieldsValues = filters.customFieldsUi
                                  .customFieldsValues;
                              if (customFieldsValues) {
                                  const customFields = [];
                                  for (const customFieldValue of customFieldsValues) {
                                      customFields.push({
                                          field_id: customFieldValue.fieldId,
                                          operator: customFieldValue.operator === 'equal' ? '=' : customFieldValue.operator,
                                          value: customFieldValue.value,
                                      });
                                  }
                                  qs.custom_fields = JSON.stringify(customFields);
                              }
                          }
                          const listId = this.getNodeParameter('list', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.clickupApiRequestAllItems.call(this, 'tasks', 'GET', `/list/${listId}/task`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.clickupApiRequestAllItems.call(this, 'tasks', 'GET', `/list/${listId}/task`, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'member') {
                          const taskId = this.getNodeParameter('id', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/task/${taskId}/member`, {}, qs);
                              responseData = responseData.members;
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/task/${taskId}/member`, {}, qs);
                              responseData = responseData.members;
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'setCustomField') {
                          const taskId = this.getNodeParameter('task', i);
                          const fieldId = this.getNodeParameter('field', i);
                          const value = this.getNodeParameter('value', i);
                          const jsonParse = this.getNodeParameter('jsonParse', i);
                          const body = {};
                          body.value = value;
                          if (jsonParse) {
                              body.value = (0, GenericFunctions_1.validateJSON)(body.value);
                              if (body.value === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Value is invalid JSON!', {
                                      itemIndex: i,
                                  });
                              }
                          }
                          else {
                              if (!isNaN(body.value)) {
                                  body.value = parseInt(body.value, 10);
                              }
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/task/${taskId}/field/${fieldId}`, body);
                      }
                      if (operation === 'delete') {
                          const taskId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/task/${taskId}`, {});
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'taskTag') {
                      if (operation === 'add') {
                          const taskId = this.getNodeParameter('taskId', i);
                          const name = this.getNodeParameter('tagName', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/task/${taskId}/tag/${name}`, {}, additionalFields);
                          responseData = { success: true };
                      }
                      if (operation === 'remove') {
                          const taskId = this.getNodeParameter('taskId', i);
                          const name = this.getNodeParameter('tagName', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/task/${taskId}/tag/${name}`, {}, additionalFields);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'taskList') {
                      if (operation === 'add') {
                          const taskId = this.getNodeParameter('taskId', i);
                          const listId = this.getNodeParameter('listId', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/list/${listId}/task/${taskId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'remove') {
                          const taskId = this.getNodeParameter('taskId', i);
                          const listId = this.getNodeParameter('listId', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/list/${listId}/task/${taskId}`);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'taskDependency') {
                      if (operation === 'create') {
                          const taskId = this.getNodeParameter('task', i);
                          const dependsOnTaskId = this.getNodeParameter('dependsOnTask', i);
                          const body = {};
                          body.depends_on = dependsOnTaskId;
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/task/${taskId}/dependency`, body);
                          responseData = { success: true };
                      }
                      if (operation === 'delete') {
                          const taskId = this.getNodeParameter('task', i);
                          const dependsOnTaskId = this.getNodeParameter('dependsOnTask', i);
                          qs.depends_on = dependsOnTaskId;
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/task/${taskId}/dependency`, {}, qs);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'timeEntry') {
                      if (operation === 'update') {
                          const teamId = this.getNodeParameter('team', i);
                          const timeEntryId = this.getNodeParameter('timeEntry', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const timezone = this.getTimezone();
                          const body = {};
                          Object.assign(body, updateFields);
                          if (body.start) {
                              body.start = moment_timezone_1.default.tz(body.start, timezone).valueOf();
                          }
                          if (body.duration) {
                              body.duration = body.duration * 60000;
                          }
                          if (body.task) {
                              body.tid = body.task;
                              body.custom_task_ids = true;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/team/${teamId}/time_entries/${timeEntryId}`, body);
                          responseData = responseData.data;
                      }
                      if (operation === 'getAll') {
                          const teamId = this.getNodeParameter('team', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          const timezone = this.getTimezone();
                          Object.assign(qs, filters);
                          if (filters.start_date) {
                              qs.start_date = moment_timezone_1.default.tz(qs.start_date, timezone).valueOf();
                          }
                          if (filters.end_date) {
                              qs.end_date = moment_timezone_1.default.tz(qs.end_date, timezone).valueOf();
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/team/${teamId}/time_entries`, {}, qs);
                          responseData = responseData.data;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'get') {
                          const teamId = this.getNodeParameter('team', i);
                          const running = this.getNodeParameter('running', i);
                          let endpoint = `/team/${teamId}/time_entries/current`;
                          if (!running) {
                              const timeEntryId = this.getNodeParameter('timeEntry', i);
                              endpoint = `/team/${teamId}/time_entries/${timeEntryId}`;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.data;
                      }
                      if (operation === 'create') {
                          const teamId = this.getNodeParameter('team', i);
                          const taskId = this.getNodeParameter('task', i);
                          const start = this.getNodeParameter('start', i);
                          const duration = this.getNodeParameter('duration', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const timezone = this.getTimezone();
                          const body = {
                              start: moment_timezone_1.default.tz(start, timezone).valueOf(),
                              duration: duration * 60000,
                              tid: taskId,
                          };
                          Object.assign(body, additionalFields);
                          if (body.tags) {
                              body.tags = body.tags.map((tag) => JSON.parse(tag));
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/team/${teamId}/time_entries`, body);
                          responseData = responseData.data;
                      }
                      if (operation === 'start') {
                          const teamId = this.getNodeParameter('team', i);
                          const taskId = this.getNodeParameter('task', i);
                          const body = {};
                          body.tid = taskId;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/team/${teamId}/time_entries/start`, body);
                          responseData = responseData.data;
                      }
                      if (operation === 'stop') {
                          const teamId = this.getNodeParameter('team', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/team/${teamId}/time_entries/stop`);
                          if (responseData.data) {
                              responseData = responseData.data;
                          }
                          else {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'There seems to be nothing to stop.', {
                                  itemIndex: i,
                              });
                          }
                      }
                      if (operation === 'delete') {
                          const teamId = this.getNodeParameter('team', i);
                          const timeEntryId = this.getNodeParameter('timeEntry', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/team/${teamId}/time_entries/${timeEntryId}`);
                          responseData = responseData.data;
                      }
                  }
                  if (resource === 'timeEntryTag') {
                      if (operation === 'add') {
                          const teamId = this.getNodeParameter('team', i);
                          const timeEntryIds = this.getNodeParameter('timeEntryIds', i);
                          const tagsUi = this.getNodeParameter('tagsUi', i);
                          const body = {};
                          body.time_entry_ids = timeEntryIds.split(',');
                          if (tagsUi) {
                              const tags = tagsUi.tagsValues;
                              if (tags === undefined) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'At least one tag must be set', {
                                      itemIndex: i,
                                  });
                              }
                              body.tags = tags;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/team/${teamId}/time_entries/tags`, body);
                          responseData = { success: true };
                      }
                      if (operation === 'getAll') {
                          const teamId = this.getNodeParameter('team', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/team/${teamId}/time_entries/tags`);
                          responseData = responseData.data;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'remove') {
                          const teamId = this.getNodeParameter('team', i);
                          const timeEntryIds = this.getNodeParameter('timeEntryIds', i);
                          const tagNames = this.getNodeParameter('tagNames', i);
                          const body = {};
                          body.time_entry_ids = timeEntryIds.split(',');
                          body.tags = tagNames.map((tag) => JSON.parse(tag).name);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/team/${teamId}/time_entries/tags`, body);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'spaceTag') {
                      if (operation === 'create') {
                          const spaceId = this.getNodeParameter('space', i);
                          const name = this.getNodeParameter('name', i);
                          const foregroundColor = this.getNodeParameter('foregroundColor', i);
                          const backgroundColor = this.getNodeParameter('backgroundColor', i);
                          const body = {
                              tag: {
                                  name,
                                  tag_bg: backgroundColor,
                                  tag_fg: foregroundColor,
                              },
                          };
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/space/${spaceId}/tag`, body);
                          responseData = { success: true };
                      }
                      if (operation === 'delete') {
                          const spaceId = this.getNodeParameter('space', i);
                          const name = this.getNodeParameter('name', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/space/${spaceId}/tag/${name}`);
                          responseData = { success: true };
                      }
                      if (operation === 'getAll') {
                          const spaceId = this.getNodeParameter('space', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/space/${spaceId}/tag`);
                          responseData = responseData.tags;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const spaceId = this.getNodeParameter('space', i);
                          const tagName = this.getNodeParameter('name', i);
                          const newTagName = this.getNodeParameter('newName', i);
                          const foregroundColor = this.getNodeParameter('foregroundColor', i);
                          const backgroundColor = this.getNodeParameter('backgroundColor', i);
                          const body = {
                              tag: {
                                  name: newTagName,
                                  tag_bg: backgroundColor,
                                  tag_fg: foregroundColor,
                              },
                          };
                          await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/space/${spaceId}/tag/${tagName}`, body);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'list') {
                      if (operation === 'create') {
                          const spaceId = this.getNodeParameter('space', i);
                          const folderless = this.getNodeParameter('folderless', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                          };
                          if (additionalFields.content) {
                              body.content = additionalFields.content;
                          }
                          if (additionalFields.dueDate) {
                              body.due_date = new Date(additionalFields.dueDate).getTime();
                          }
                          if (additionalFields.dueDateTime) {
                              body.due_date_time = additionalFields.dueDateTime;
                          }
                          if (additionalFields.priority) {
                              body.priority = additionalFields.priority;
                          }
                          if (additionalFields.assignee) {
                              body.assignee = parseInt(additionalFields.assignee, 10);
                          }
                          if (additionalFields.status) {
                              body.status = additionalFields.status;
                          }
                          if (folderless) {
                              responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/space/${spaceId}/list`, body);
                          }
                          else {
                              const folderId = this.getNodeParameter('folder', i);
                              responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'POST', `/folder/${folderId}/list`, body);
                          }
                      }
                      if (operation === 'member') {
                          const listId = this.getNodeParameter('id', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/list/${listId}/member`, {}, qs);
                              responseData = responseData.members;
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/list/${listId}/member`, {}, qs);
                              responseData = responseData.members;
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'customFields') {
                          const listId = this.getNodeParameter('list', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/list/${listId}/field`);
                          responseData = responseData.fields;
                      }
                      if (operation === 'delete') {
                          const listId = this.getNodeParameter('list', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'DELETE', `/list/${listId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const listId = this.getNodeParameter('list', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', `/list/${listId}`);
                      }
                      if (operation === 'getAll') {
                          const filters = this.getNodeParameter('filters', i);
                          const spaceId = this.getNodeParameter('space', i);
                          const folderless = this.getNodeParameter('folderless', i);
                          if (filters.archived) {
                              qs.archived = filters.archived;
                          }
                          let endpoint = `/space/${spaceId}/list`;
                          if (!folderless) {
                              const folderId = this.getNodeParameter('folder', i);
                              endpoint = `/folder/${folderId}/list`;
                          }
                          qs.limit = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'GET', endpoint, {}, qs);
                          responseData = responseData.lists;
                          responseData = responseData.splice(0, qs.limit);
                      }
                      if (operation === 'update') {
                          const listId = this.getNodeParameter('list', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.content) {
                              body.content = updateFields.content;
                          }
                          if (updateFields.dueDate) {
                              body.due_date = new Date(updateFields.dueDate).getTime();
                          }
                          if (updateFields.dueDateTime) {
                              body.due_date_time = updateFields.dueDateTime;
                          }
                          if (updateFields.priority) {
                              body.priority = updateFields.priority;
                          }
                          if (updateFields.assignee) {
                              body.assignee = parseInt(updateFields.assignee, 10);
                          }
                          if (updateFields.unsetStatus) {
                              body.unset_status = updateFields.unsetStatus;
                          }
                          responseData = await GenericFunctions_1.clickupApiRequest.call(this, 'PUT', `/list/${listId}`, body);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {} });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.ClickUp = ClickUp;
  //# sourceMappingURL=ClickUp.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: ClickUp credentials
  description: Documentation for ClickUp credentials. Use these credentials to authenticate ClickUp in n8n, a workflow automation platform.
  contentType: [integration, reference]
  priority: medium
  ---

  # ClickUp credentials

  You can use these credentials to authenticate the following nodes:

  - [ClickUp](/integrations/builtin/app-nodes/n8n-nodes-base.clickup.md)
  - [ClickUp Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.clickuptrigger.md)

  ## Supported authentication methods

  - API access token
  - OAuth2

  ## Related resources

  Refer to [ClickUp's documentation](https://clickup.com/api/){:target=_blank .external-link} for more information about the service.

  ## Using API access token

  To configure this credential, you'll need a [ClickUp](https://www.clickup.com/){:target=_blank .external-link} account and:

  - A Personal API **Access Token**

  To get your personal API token:

  1. If you're using ClickUp 2.0, select your avatar in the lower-left corner and select **Apps**. If you're using ClickUp 3.0, select your avatar in the upper-right corner, select **Settings**, and scroll down to select **Apps** in the sidebar.
  2. Under **API Token**, select **Generate**.
  3. Copy your **Personal API token** and enter it in your n8n credential as the **Access Token**.

  Refer to [ClickUp's Personal Token documentation](https://clickup.com/api/developer-portal/authentication#personal-token){:target=_blank .external-link} for more information.

  ## Using OAuth2

  --8<-- "_snippets/integrations/builtin/credentials/cloud-oauth-button.md"

  If you're [self-hosting](/hosting/index.md) n8n, you'll need to create an OAuth app:

  1. In ClickUp, select your avatar and select **Integrations**.
  2. Select **ClickUp API**.
  3. Select **Create an App**.
  4. Enter a **Name** for your app.
  5. In n8n, copy the **OAuth Redirect URL**. Enter this as your ClickUp app's **Redirect URL**.
  6. Once you create your app, copy the **client_id** and **secret** and enter them in your n8n credential.
  7. Select **Connect my account** and follow the on-screen prompts to finish connecting the credential.

   Refer to the [ClickUp Oauth flow documentation](https://clickup.com/api/developer-portal/authentication#oauth-flow){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"0e53d856-0a95-4d9c-bd83-e2abe7319333","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"4828149a0ac2da3642cc7ce303fb8ac21caf5e340df820430200cbacf3b570f0"}}


node_type: n8n-nodes-base.Cloudflare
name: Cloudflare
display_name: Cloudflare
description: Consume Cloudflare API
category: Other
code_hash: 6fde79b2d00dc711ed477b46193db62b6bd974cc9bf41b1bebfaad9f4398d1c5
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/cloudflare
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:19
updated_at: 2025-06-08 08:05:19
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Cloudflare = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ZoneCertificateDescription_1 = require("./ZoneCertificateDescription");
  class Cloudflare {
      constructor() {
          this.description = {
              displayName: 'Cloudflare',
              name: 'cloudflare',
              icon: 'file:cloudflare.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Cloudflare API',
              defaults: {
                  name: 'Cloudflare',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'cloudflareApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Zone Certificate',
                              value: 'zoneCertificate',
                          },
                      ],
                      default: 'zoneCertificate',
                  },
                  ...ZoneCertificateDescription_1.zoneCertificateOperations,
                  ...ZoneCertificateDescription_1.zoneCertificateFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getZones() {
                      const returnData = [];
                      const { result: zones } = await GenericFunctions_1.cloudflareApiRequest.call(this, 'GET', '/zones');
                      for (const zone of zones) {
                          returnData.push({
                              name: zone.name,
                              value: zone.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'zoneCertificate') {
                      if (operation === 'delete') {
                          const zoneId = this.getNodeParameter('zoneId', i);
                          const certificateId = this.getNodeParameter('certificateId', i);
                          responseData = await GenericFunctions_1.cloudflareApiRequest.call(this, 'DELETE', `/zones/${zoneId}/origin_tls_client_auth/${certificateId}`, {});
                          responseData = responseData.result;
                      }
                      if (operation === 'get') {
                          const zoneId = this.getNodeParameter('zoneId', i);
                          const certificateId = this.getNodeParameter('certificateId', i);
                          responseData = await GenericFunctions_1.cloudflareApiRequest.call(this, 'GET', `/zones/${zoneId}/origin_tls_client_auth/${certificateId}`, {});
                          responseData = responseData.result;
                      }
                      if (operation === 'getMany') {
                          const zoneId = this.getNodeParameter('zoneId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i, {});
                          Object.assign(qs, filters);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.cloudflareApiRequestAllItems.call(this, 'result', 'GET', `/zones/${zoneId}/origin_tls_client_auth`, {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              Object.assign(qs, { per_page: limit });
                              responseData = await GenericFunctions_1.cloudflareApiRequest.call(this, 'GET', `/zones/${zoneId}/origin_tls_client_auth`, {}, qs);
                              responseData = responseData.result;
                          }
                      }
                      if (operation === 'upload') {
                          const zoneId = this.getNodeParameter('zoneId', i);
                          const certificate = this.getNodeParameter('certificate', i);
                          const privateKey = this.getNodeParameter('privateKey', i);
                          const body = {
                              certificate,
                              private_key: privateKey,
                          };
                          responseData = await GenericFunctions_1.cloudflareApiRequest.call(this, 'POST', `/zones/${zoneId}/origin_tls_client_auth`, body, qs);
                          responseData = responseData.result;
                      }
                  }
                  returnData.push(...this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), {
                      itemData: { item: i },
                  }));
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Cloudflare = Cloudflare;
  //# sourceMappingURL=Cloudflare.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Cloudflare credentials
  description: Documentation for Cloudflare credentials. Use these credentials to authenticate Cloudflare in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Cloudflare credentials

  You can use these credentials to authenticate the following nodes:

  * [Cloudflare node](/integrations/builtin/app-nodes/n8n-nodes-base.cloudflare.md)

  ## Prerequisites

  - Create a [Cloudflare account](https://developers.cloudflare.com/fundamentals/setup/account/){:target=_blank .external-link}.
  - [Add a domain](https://developers.cloudflare.com/fundamentals/setup/manage-domains/add-site/){:target=_blank .external-link}.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Cloudflare's API documentation](https://developers.cloudflare.com/fundamentals/api/){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Follow the [Cloudflare documentation to create an API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/){:target=_blank .external-link}.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"4c631cfb-2bd1-4094-9de3-a4a2d88eb904","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"32aa69f52df1d19fce5b6df8331292796f5f9406bfa66c617104b1d66d6c4112"}}


node_type: n8n-nodes-base.Clockify
name: Clockify
display_name: Clockify
description: Consume Clockify REST API
category: Other
code_hash: 41064737ff7074e050dad37d7450df2ee493f2db1129fb3a189207435c99426f
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/clockify
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:19
updated_at: 2025-06-08 08:05:19
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Clockify = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ClientDescription_1 = require("./ClientDescription");
  const ProjectDescription_1 = require("./ProjectDescription");
  const TagDescription_1 = require("./TagDescription");
  const TaskDescription_1 = require("./TaskDescription");
  const TimeEntryDescription_1 = require("./TimeEntryDescription");
  const UserDescription_1 = require("./UserDescription");
  const WorkspaceDescription_1 = require("./WorkspaceDescription");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class Clockify {
      constructor() {
          this.description = {
              displayName: 'Clockify',
              name: 'clockify',
              icon: 'file:clockify.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Clockify REST API',
              defaults: {
                  name: 'Clockify',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'clockifyApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Client',
                              value: 'client',
                          },
                          {
                              name: 'Project',
                              value: 'project',
                          },
                          {
                              name: 'Tag',
                              value: 'tag',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                          {
                              name: 'Time Entry',
                              value: 'timeEntry',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                          {
                              name: 'Workspace',
                              value: 'workspace',
                          },
                      ],
                      default: 'project',
                  },
                  ...ClientDescription_1.clientOperations,
                  ...ProjectDescription_1.projectOperations,
                  ...TagDescription_1.tagOperations,
                  ...TaskDescription_1.taskOperations,
                  ...TimeEntryDescription_1.timeEntryOperations,
                  ...UserDescription_1.userOperations,
                  ...WorkspaceDescription_1.workspaceOperations,
                  ...WorkspaceDescription_1.workspaceFields,
                  {
                      displayName: 'Workspace Name or ID',
                      name: 'workspaceId',
                      type: 'options',
                      description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                      typeOptions: {
                          loadOptionsMethod: 'listWorkspaces',
                      },
                      required: true,
                      default: [],
                      displayOptions: {
                          hide: {
                              resource: ['workspace'],
                          },
                      },
                  },
                  ...ClientDescription_1.clientFields,
                  ...ProjectDescription_1.projectFields,
                  ...TagDescription_1.tagFields,
                  ...TaskDescription_1.taskFields,
                  ...UserDescription_1.userFields,
                  ...TimeEntryDescription_1.timeEntryFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async listWorkspaces() {
                      const rtv = [];
                      const workspaces = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', 'workspaces');
                      if (undefined !== workspaces) {
                          workspaces.forEach((value) => {
                              rtv.push({
                                  name: value.name,
                                  value: value.id,
                              });
                          });
                      }
                      return rtv;
                  },
                  async loadUsersForWorkspace() {
                      const rtv = [];
                      const workspaceId = this.getCurrentNodeParameter('workspaceId');
                      if (undefined !== workspaceId) {
                          const resource = `workspaces/${workspaceId}/users`;
                          const users = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', resource);
                          if (undefined !== users) {
                              users.forEach((value) => {
                                  rtv.push({
                                      name: value.name,
                                      value: value.id,
                                  });
                              });
                          }
                      }
                      return rtv;
                  },
                  async loadClientsForWorkspace() {
                      const rtv = [];
                      const workspaceId = this.getCurrentNodeParameter('workspaceId');
                      if (undefined !== workspaceId) {
                          const resource = `workspaces/${workspaceId}/clients`;
                          const clients = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', resource);
                          if (undefined !== clients) {
                              clients.forEach((value) => {
                                  rtv.push({
                                      name: value.name,
                                      value: value.id,
                                  });
                              });
                          }
                      }
                      return rtv;
                  },
                  async loadProjectsForWorkspace() {
                      const rtv = [];
                      const workspaceId = this.getCurrentNodeParameter('workspaceId');
                      if (undefined !== workspaceId) {
                          const resource = `workspaces/${workspaceId}/projects`;
                          const users = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', resource);
                          if (undefined !== users) {
                              users.forEach((value) => {
                                  rtv.push({
                                      name: value.name,
                                      value: value.id,
                                  });
                              });
                          }
                      }
                      return rtv;
                  },
                  async loadTagsForWorkspace() {
                      const rtv = [];
                      const workspaceId = this.getCurrentNodeParameter('workspaceId');
                      if (undefined !== workspaceId) {
                          const resource = `workspaces/${workspaceId}/tags`;
                          const users = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', resource);
                          if (undefined !== users) {
                              users.forEach((value) => {
                                  rtv.push({
                                      name: value.name,
                                      value: value.id,
                                  });
                              });
                          }
                      }
                      return rtv;
                  },
                  async loadCustomFieldsForWorkspace() {
                      const rtv = [];
                      const workspaceId = this.getCurrentNodeParameter('workspaceId');
                      if (undefined !== workspaceId) {
                          const resource = `workspaces/${workspaceId}/custom-fields`;
                          const customFields = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', resource);
                          for (const customField of customFields) {
                              rtv.push({
                                  name: customField.name,
                                  value: customField.id,
                              });
                          }
                      }
                      return rtv;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'client') {
                      if (operation === 'create') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'POST', `/workspaces/${workspaceId}/clients`, body, qs);
                      }
                      if (operation === 'delete') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const clientId = this.getNodeParameter('clientId', i);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'DELETE', `/workspaces/${workspaceId}/clients/${clientId}`, {}, qs);
                      }
                      if (operation === 'update') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const clientId = this.getNodeParameter('clientId', i);
                          const name = this.getNodeParameter('name', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              name,
                          };
                          Object.assign(body, updateFields);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'PUT', `/workspaces/${workspaceId}/clients/${clientId}`, body, qs);
                      }
                      if (operation === 'get') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const clientId = this.getNodeParameter('clientId', i);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', `/workspaces/${workspaceId}/clients/${clientId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `/workspaces/${workspaceId}/clients`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `/workspaces/${workspaceId}/clients`, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                  }
                  if (resource === 'project') {
                      if (operation === 'create') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                          };
                          Object.assign(body, additionalFields);
                          if (body.estimateUi) {
                              body.estimate = body.estimateUi.estimateValues;
                              delete body.estimateUi;
                          }
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'POST', `/workspaces/${workspaceId}/projects`, body, qs);
                      }
                      if (operation === 'delete') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const projectId = this.getNodeParameter('projectId', i);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'DELETE', `/workspaces/${workspaceId}/projects/${projectId}`, {}, qs);
                      }
                      if (operation === 'get') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const projectId = this.getNodeParameter('projectId', i);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', `/workspaces/${workspaceId}/projects/${projectId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `/workspaces/${workspaceId}/projects`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `/workspaces/${workspaceId}/projects`, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'update') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const projectId = this.getNodeParameter('projectId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          Object.assign(body, updateFields);
                          if (body.estimateUi) {
                              body.estimate = body.estimateUi.estimateValues;
                              delete body.estimateUi;
                          }
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'PUT', `/workspaces/${workspaceId}/projects/${projectId}`, body, qs);
                      }
                  }
                  if (resource === 'tag') {
                      if (operation === 'create') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'POST', `/workspaces/${workspaceId}/tags`, body, qs);
                      }
                      if (operation === 'delete') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const tagId = this.getNodeParameter('tagId', i);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'DELETE', `/workspaces/${workspaceId}/tags/${tagId}`, {}, qs);
                          responseData = { success: true };
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `/workspaces/${workspaceId}/tags`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `/workspaces/${workspaceId}/tags`, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                      if (operation === 'update') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const tagId = this.getNodeParameter('tagId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          Object.assign(body, updateFields);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'PUT', `/workspaces/${workspaceId}/tags/${tagId}`, body, qs);
                      }
                  }
                  if (resource === 'task') {
                      if (operation === 'create') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const projectId = this.getNodeParameter('projectId', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                          };
                          Object.assign(body, additionalFields);
                          if (body.estimate) {
                              const [hour, minute] = body.estimate.split(':');
                              body.estimate = `PT${hour}H${minute}M`;
                          }
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'POST', `/workspaces/${workspaceId}/projects/${projectId}/tasks`, body, qs);
                      }
                      if (operation === 'delete') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const projectId = this.getNodeParameter('projectId', i);
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'DELETE', `/workspaces/${workspaceId}/projects/${projectId}/tasks/${taskId}`, {}, qs);
                      }
                      if (operation === 'get') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const projectId = this.getNodeParameter('projectId', i);
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', `/workspaces/${workspaceId}/projects/${projectId}/tasks/${taskId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const projectId = this.getNodeParameter('projectId', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `/workspaces/${workspaceId}/projects/${projectId}/tasks`, {}, qs);
                          }
                          else {
                              qs['page-size'] = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', `/workspaces/${workspaceId}/projects/${projectId}/tasks`, {}, qs);
                          }
                      }
                      if (operation === 'update') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const projectId = this.getNodeParameter('projectId', i);
                          const taskId = this.getNodeParameter('taskId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          Object.assign(body, updateFields);
                          if (body.estimate) {
                              const [hour, minute] = body.estimate.split(':');
                              body.estimate = `PT${hour}H${minute}M`;
                          }
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'PUT', `/workspaces/${workspaceId}/projects/${projectId}/tasks/${taskId}`, body, qs);
                      }
                  }
                  if (resource === 'timeEntry') {
                      if (operation === 'create') {
                          const timezone = this.getTimezone();
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const start = this.getNodeParameter('start', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              start: moment_timezone_1.default.tz(start, timezone).utc().format(),
                          };
                          Object.assign(body, additionalFields);
                          if (body.end) {
                              body.end = moment_timezone_1.default.tz(body.end, timezone).utc().format();
                          }
                          if (body.customFieldsUi) {
                              const customFields = body.customFieldsUi
                                  .customFieldsValues;
                              body.customFields = customFields;
                          }
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'POST', `/workspaces/${workspaceId}/time-entries`, body, qs);
                      }
                      if (operation === 'delete') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const timeEntryId = this.getNodeParameter('timeEntryId', i);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'DELETE', `/workspaces/${workspaceId}/time-entries/${timeEntryId}`, {}, qs);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const timeEntryId = this.getNodeParameter('timeEntryId', i);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', `/workspaces/${workspaceId}/time-entries/${timeEntryId}`, {}, qs);
                      }
                      if (operation === 'update') {
                          const timezone = this.getTimezone();
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const timeEntryId = this.getNodeParameter('timeEntryId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          Object.assign(body, updateFields);
                          if (body.end) {
                              body.end = moment_timezone_1.default.tz(body.end, timezone).utc().format();
                          }
                          if (body.start) {
                              body.start = moment_timezone_1.default.tz(body.start, timezone).utc().format();
                          }
                          else {
                              const { timeInterval: { start }, } = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', `/workspaces/${workspaceId}/time-entries/${timeEntryId}`, {}, qs);
                              body.start = start;
                          }
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'PUT', `/workspaces/${workspaceId}/time-entries/${timeEntryId}`, body, qs);
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const workspaceId = this.getNodeParameter('workspaceId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `/workspaces/${workspaceId}/users`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `/workspaces/${workspaceId}/users`, {}, qs);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                  }
                  if (resource === 'workspace') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.clockifyApiRequest.call(this, 'GET', '/workspaces', {}, qs);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, qs.limit);
                          }
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {} });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Clockify = Clockify;
  //# sourceMappingURL=Clockify.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Clockify credentials
  description: Documentation for Clockify credentials. Use these credentials to authenticate Clockify in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Clockify credentials

  You can use these credentials to authenticate the following nodes:

  - [Clockify](/integrations/builtin/app-nodes/n8n-nodes-base.clockify.md)
  - [Clockify Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.clockifytrigger.md)

  ## Prerequisites

  Create a [Clockify](https://www.clockify.com/) account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Clockify's API documentation](https://docs.developer.clockify.me/){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Access your API key from your [Clockify Profile Settings](https://clockify.me/help/users/profile-settings){:target=_blank .external-link}.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"cc373b58-ab9b-4629-b362-f9264041122a","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"0f3bbaf851cc39009c65ff60a31cf52edd02b32f5386e4dece238508e6ba61b3"}}


node_type: n8n-nodes-base.Cockpit
name: Cockpit
display_name: Cockpit
description: Consume Cockpit API
category: Other
code_hash: 44a2a2fa971e41be52bf195599c4f3c927e29f2c0a47fad162ddfbcbb144574e
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/cockpit
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Cockpit = void 0;
  const CollectionDescription_1 = require("./CollectionDescription");
  const CollectionFunctions_1 = require("./CollectionFunctions");
  const FormDescription_1 = require("./FormDescription");
  const FormFunctions_1 = require("./FormFunctions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const SingletonDescription_1 = require("./SingletonDescription");
  const SingletonFunctions_1 = require("./SingletonFunctions");
  class Cockpit {
      constructor() {
          this.description = {
              displayName: 'Cockpit',
              name: 'cockpit',
              icon: 'file:cockpit.png',
              group: ['output'],
              version: 1,
              subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
              description: 'Consume Cockpit API',
              defaults: {
                  name: 'Cockpit',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'cockpitApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      default: 'collection',
                      options: [
                          {
                              name: 'Collection',
                              value: 'collection',
                          },
                          {
                              name: 'Form',
                              value: 'form',
                          },
                          {
                              name: 'Singleton',
                              value: 'singleton',
                          },
                      ],
                  },
                  ...CollectionDescription_1.collectionOperations,
                  ...CollectionDescription_1.collectionFields,
                  ...FormDescription_1.formOperations,
                  ...FormDescription_1.formFields,
                  ...SingletonDescription_1.singletonOperations,
                  ...SingletonDescription_1.singletonFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCollections() {
                      const collections = await CollectionFunctions_1.getAllCollectionNames.call(this);
                      return collections.map((itemName) => {
                          return {
                              name: itemName,
                              value: itemName,
                          };
                      });
                  },
                  async getSingletons() {
                      const singletons = await SingletonFunctions_1.getAllSingletonNames.call(this);
                      return singletons.map((itemName) => {
                          return {
                              name: itemName,
                              value: itemName,
                          };
                      });
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'collection') {
                      const collectionName = this.getNodeParameter('collection', i);
                      if (operation === 'create') {
                          const data = GenericFunctions_1.createDataFromParameters.call(this, i);
                          responseData = await CollectionFunctions_1.createCollectionEntry.call(this, collectionName, data);
                      }
                      else if (operation === 'getAll') {
                          const options = this.getNodeParameter('options', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              options.limit = this.getNodeParameter('limit', i);
                          }
                          responseData = await CollectionFunctions_1.getAllCollectionEntries.call(this, collectionName, options);
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const data = GenericFunctions_1.createDataFromParameters.call(this, i);
                          responseData = await CollectionFunctions_1.createCollectionEntry.call(this, collectionName, data, id);
                      }
                  }
                  else if (resource === 'form') {
                      const formName = this.getNodeParameter('form', i);
                      if (operation === 'submit') {
                          const form = GenericFunctions_1.createDataFromParameters.call(this, i);
                          responseData = await FormFunctions_1.submitForm.call(this, formName, form);
                      }
                  }
                  else if (resource === 'singleton') {
                      const singletonName = this.getNodeParameter('singleton', i);
                      if (operation === 'get') {
                          responseData = await SingletonFunctions_1.getSingleton.call(this, singletonName);
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Cockpit = Cockpit;
  //# sourceMappingURL=Cockpit.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Cockpit credentials
  description: Documentation for Cockpit credentials. Use these credentials to authenticate Cockpit in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Cockpit credentials

  You can use these credentials to authenticate the following nodes:

  - [Cockpit](/integrations/builtin/app-nodes/n8n-nodes-base.cockpit.md)

  ## Prerequisites

  - Create a [Cockpit](https://getcockpit.com/){:target=_blank .external-link} account.
  - Set up a [self-hosted instance of Cockpit](https://getcockpit.com/documentation/core/quickstart/installation){:target=_blank .external-link}.

  ## Supported authentication methods

  - API access token

  ## Related resources

  Refer to [Cockpit's API documentation](https://getcockpit.com/documentation/core/api/introduction){:target=_blank .external-link} for more information about the service.

  ## Using API access token

  To configure this credential, you'll need:

  - Your **Cockpit URL**: The URL you use to access your Cockpit instance
  - An **Access Token**: Refer to the [Cockpit Managing tokens documentation](https://getcockpit.com/documentation/core/api/authentication/#managing-tokens){:target=_blank .external-link} for instructions on creating an API token. Use the **API token** as the n8n **Access Token**.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"0843c2e4-d20a-4227-a75d-37086c50f8a5","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"1e84f8a70f124e9f5bf23e14b08344b9148a1544c78ae54005a6c2e3ceec6d06"}}


node_type: n8n-nodes-base.CoinGecko
name: CoinGecko
display_name: CoinGecko
description: Consume CoinGecko API
category: Other
code_hash: aaa78f27ab82cdfe6f8cd785e12016812261d619aa833ab5952f9999f55f44ab
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.coingecko
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CoinGecko = void 0;
  const CoinDescription_1 = require("./CoinDescription");
  const EventDescription_1 = require("./EventDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class CoinGecko {
      constructor() {
          this.description = {
              displayName: 'CoinGecko',
              name: 'coinGecko',
              icon: 'file:coinGecko.svg',
              group: ['output'],
              version: 1,
              description: 'Consume CoinGecko API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'CoinGecko',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Coin',
                              value: 'coin',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                          },
                      ],
                      default: 'coin',
                  },
                  ...CoinDescription_1.coinOperations,
                  ...CoinDescription_1.coinFields,
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCurrencies() {
                      const returnData = [];
                      const currencies = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', '/simple/supported_vs_currencies');
                      currencies.sort();
                      for (const currency of currencies) {
                          returnData.push({
                              name: currency.toUpperCase(),
                              value: currency,
                          });
                      }
                      return returnData;
                  },
                  async getCoins() {
                      const returnData = [];
                      const coins = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', '/coins/list');
                      for (const coin of coins) {
                          returnData.push({
                              name: coin.symbol.toUpperCase(),
                              value: coin.id,
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
                  async getExchanges() {
                      const returnData = [];
                      const exchanges = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', '/exchanges/list');
                      for (const exchange of exchanges) {
                          returnData.push({
                              name: exchange.name,
                              value: exchange.id,
                          });
                      }
                      return returnData;
                  },
                  async getEventCountryCodes() {
                      const returnData = [];
                      const countryCodes = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', '/events/countries');
                      for (const code of countryCodes.data) {
                          if (!code.code) {
                              continue;
                          }
                          returnData.push({
                              name: code.country,
                              value: code.code,
                          });
                      }
                      return returnData;
                  },
                  async getEventTypes() {
                      const returnData = [];
                      const eventTypes = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', '/events/types');
                      for (const type of eventTypes.data) {
                          returnData.push({
                              name: type,
                              value: type,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'coin') {
                      if (operation === 'get') {
                          const options = this.getNodeParameter('options', i);
                          qs.community_data = false;
                          qs.developer_data = false;
                          qs.localization = false;
                          qs.market_data = false;
                          qs.sparkline = false;
                          qs.tickers = false;
                          Object.assign(qs, options);
                          const searchBy = this.getNodeParameter('searchBy', i);
                          if (searchBy === 'coinId') {
                              const coinId = this.getNodeParameter('coinId', i);
                              responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', `/coins/${coinId}`, {}, qs);
                          }
                          if (searchBy === 'contractAddress') {
                              const platformId = this.getNodeParameter('platformId', i);
                              const contractAddress = this.getNodeParameter('contractAddress', i);
                              responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', `/coins/${platformId}/contract/${contractAddress}`, {}, qs);
                          }
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          let limit;
                          responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', '/coins/list', {}, qs);
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'market') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const baseCurrency = this.getNodeParameter('baseCurrency', i);
                          const options = this.getNodeParameter('options', i);
                          qs.vs_currency = baseCurrency;
                          Object.assign(qs, options);
                          if (options.price_change_percentage) {
                              qs.price_change_percentage = options.price_change_percentage.join(',');
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.coinGeckoRequestAllItems.call(this, '', 'GET', '/coins/markets', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', '/coins/markets', {}, qs);
                          }
                      }
                      if (operation === 'price') {
                          const searchBy = this.getNodeParameter('searchBy', i);
                          const quoteCurrencies = this.getNodeParameter('quoteCurrencies', i);
                          const options = this.getNodeParameter('options', i);
                          qs.vs_currencies = quoteCurrencies.join(',');
                          Object.assign(qs, options);
                          if (searchBy === 'coinId') {
                              const baseCurrencies = this.getNodeParameter('baseCurrencies', i);
                              qs.ids = baseCurrencies.join(',');
                              responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', '/simple/price', {}, qs);
                          }
                          if (searchBy === 'contractAddress') {
                              const platformId = this.getNodeParameter('platformId', i);
                              const contractAddresses = this.getNodeParameter('contractAddresses', i);
                              qs.contract_addresses = contractAddresses;
                              responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', `/simple/token_price/${platformId}`, {}, qs);
                          }
                      }
                      if (operation === 'ticker') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const coinId = this.getNodeParameter('coinId', i);
                          const options = this.getNodeParameter('options', i);
                          Object.assign(qs, options);
                          if (options.exchange_ids) {
                              qs.exchange_ids = options.exchange_ids.join(',');
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.coinGeckoRequestAllItems.call(this, 'tickers', 'GET', `/coins/${coinId}/tickers`, {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', `/coins/${coinId}/tickers`, {}, qs);
                              responseData = responseData.tickers;
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'history') {
                          const coinId = this.getNodeParameter('coinId', i);
                          const date = this.getNodeParameter('date', i);
                          const options = this.getNodeParameter('options', i);
                          Object.assign(qs, options);
                          qs.date = (0, moment_timezone_1.default)(date).format('DD-MM-YYYY');
                          responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', `/coins/${coinId}/history`, {}, qs);
                      }
                      if (operation === 'marketChart') {
                          let respData;
                          const searchBy = this.getNodeParameter('searchBy', i);
                          const quoteCurrency = this.getNodeParameter('quoteCurrency', i);
                          const days = this.getNodeParameter('days', i);
                          qs.vs_currency = quoteCurrency;
                          qs.days = days;
                          if (searchBy === 'coinId') {
                              const coinId = this.getNodeParameter('baseCurrency', i);
                              respData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', `/coins/${coinId}/market_chart`, {}, qs);
                          }
                          if (searchBy === 'contractAddress') {
                              const platformId = this.getNodeParameter('platformId', i);
                              const contractAddress = this.getNodeParameter('contractAddress', i);
                              respData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', `/coins/${platformId}/contract/${contractAddress}/market_chart`, {}, qs);
                          }
                          responseData = [];
                          for (let idx = 0; idx < respData.prices.length; idx++) {
                              const [time, price] = respData.prices[idx];
                              const marketCaps = respData.market_caps[idx][1];
                              const totalVolume = respData.total_volumes[idx][1];
                              responseData.push({
                                  time: (0, moment_timezone_1.default)(time).toISOString(),
                                  price,
                                  marketCaps,
                                  totalVolume,
                              });
                          }
                      }
                      if (operation === 'candlestick') {
                          const baseCurrency = this.getNodeParameter('baseCurrency', i);
                          const quoteCurrency = this.getNodeParameter('quoteCurrency', i);
                          const days = this.getNodeParameter('days', i);
                          qs.vs_currency = quoteCurrency;
                          qs.days = days;
                          responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', `/coins/${baseCurrency}/ohlc`, {}, qs);
                          for (let idx = 0; idx < responseData.length; idx++) {
                              const [time, open, high, low, close] = responseData[idx];
                              responseData[idx] = {
                                  time: (0, moment_timezone_1.default)(time).toISOString(),
                                  open,
                                  high,
                                  low,
                                  close,
                              };
                          }
                      }
                  }
                  if (resource === 'event') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          Object.assign(qs, options);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.coinGeckoRequestAllItems.call(this, 'data', 'GET', '/events', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', '/events', {}, qs);
                              responseData = responseData.data;
                          }
                      }
                  }
                  if (resource === 'simple') {
                      if (operation === 'price') {
                          const ids = this.getNodeParameter('ids', i);
                          const currencies = this.getNodeParameter('currencies', i);
                          const options = this.getNodeParameter('options', i);
                          qs.ids = ids;
                          qs.vs_currencies = currencies.join(',');
                          Object.assign(qs, options);
                          responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', '/simple/price', {}, qs);
                      }
                      if (operation === 'tokenPrice') {
                          const id = this.getNodeParameter('id', i);
                          const contractAddresses = this.getNodeParameter('contractAddresses', i);
                          const currencies = this.getNodeParameter('currencies', i);
                          const options = this.getNodeParameter('options', i);
                          qs.contract_addresses = contractAddresses;
                          qs.vs_currencies = currencies.join(',');
                          Object.assign(qs, options);
                          responseData = await GenericFunctions_1.coinGeckoApiRequest.call(this, 'GET', `/simple/token_price/${id}`, {}, qs);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {} });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.CoinGecko = CoinGecko;
  //# sourceMappingURL=CoinGecko.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: CoinGecko node documentation
  description: Learn how to use the CoinGecko node in n8n. Follow technical documentation to integrate CoinGecko node into your workflows.
  contentType: [integration, reference]
  ---

  # CoinGecko node

  Use the CoinGecko node to automate work in CoinGecko, and integrate CoinGecko with other applications. n8n has built-in support for a wide range of CoinGecko features, including getting coins and events.

  On this page, you'll find a list of operations the CoinGecko node supports and links to more resources.

  --8<-- "_snippets/integrations/builtin/app-nodes/ai-tools.md"

  ## Operations

  * Coin
      * Get a candlestick open-high-low-close chart for the selected currency
      * Get current data for a coin
      * Get all coins
      * Get historical data (name, price, market, stats) at a given date for a coin
      * Get prices and market related data for all trading pairs that match the selected currency
      * Get historical market data include price, market cap, and 24h volume (granularity auto)
      * Get the current price of any cryptocurrencies in any other supported currencies that you need
      * Get coin tickers
  * Event
      * Get all events

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'coingecko') ]]

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"a44f6f7e-5ab7-4320-8cea-3f15c69b550b","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"67b6f59b5f64661614f0edaff012c154cfc7f899e66fbd6f735046c894053862"}}


node_type: n8n-nodes-base.Coda
name: Coda
display_name: Coda
description: Consume Coda API
category: Other
code_hash: 5dd1a766378cacc5c6b79498186281fd173e22556616300209e9994394f87c9e
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/coda
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Coda = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const TableDescription_1 = require("./TableDescription");
  const FormulaDescription_1 = require("./FormulaDescription");
  const ControlDescription_1 = require("./ControlDescription");
  const ViewDescription_1 = require("./ViewDescription");
  class Coda {
      constructor() {
          this.description = {
              displayName: 'Coda',
              name: 'coda',
              icon: 'file:coda.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Coda API',
              defaults: {
                  name: 'Coda',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'codaApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Control',
                              value: 'control',
                              description: 'Controls provide a user-friendly way to input a value that can affect other parts of the doc',
                          },
                          {
                              name: 'Formula',
                              value: 'formula',
                              description: 'Formulas can be great for performing one-off computations',
                          },
                          {
                              name: 'Table',
                              value: 'table',
                              description: 'Access data of tables in documents',
                          },
                          {
                              name: 'View',
                              value: 'view',
                              description: 'Access data of views in documents',
                          },
                      ],
                      default: 'table',
                  },
                  ...TableDescription_1.tableOperations,
                  ...TableDescription_1.tableFields,
                  ...FormulaDescription_1.formulaOperations,
                  ...FormulaDescription_1.formulaFields,
                  ...ControlDescription_1.controlOperations,
                  ...ControlDescription_1.controlFields,
                  ...ViewDescription_1.viewOperations,
                  ...ViewDescription_1.viewFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getDocs() {
                      const returnData = [];
                      const qs = {};
                      const docs = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', '/docs', {}, qs);
                      for (const doc of docs) {
                          const docName = doc.name;
                          const docId = doc.id;
                          returnData.push({
                              name: docName,
                              value: docId,
                          });
                      }
                      return returnData;
                  },
                  async getTables() {
                      const returnData = [];
                      const docId = this.getCurrentNodeParameter('docId');
                      const tables = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', `/docs/${docId}/tables`, {});
                      for (const table of tables) {
                          const tableName = table.name;
                          const tableId = table.id;
                          returnData.push({
                              name: tableName,
                              value: tableId,
                          });
                      }
                      return returnData;
                  },
                  async getColumns() {
                      const returnData = [];
                      const docId = this.getCurrentNodeParameter('docId');
                      const tableId = this.getCurrentNodeParameter('tableId');
                      const columns = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', `/docs/${docId}/tables/${tableId}/columns`, {});
                      for (const column of columns) {
                          const columnName = column.name;
                          const columnId = column.id;
                          returnData.push({
                              name: columnName,
                              value: columnId,
                          });
                      }
                      return returnData;
                  },
                  async getViews() {
                      const returnData = [];
                      const docId = this.getCurrentNodeParameter('docId');
                      const views = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', `/docs/${docId}/tables?tableTypes=view`, {});
                      for (const view of views) {
                          const viewName = view.name;
                          const viewId = view.id;
                          returnData.push({
                              name: viewName,
                              value: viewId,
                          });
                      }
                      return returnData;
                  },
                  async getFormulas() {
                      const returnData = [];
                      const docId = this.getCurrentNodeParameter('docId');
                      const formulas = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', `/docs/${docId}/formulas`, {});
                      for (const formula of formulas) {
                          const formulaName = formula.name;
                          const formulaId = formula.id;
                          returnData.push({
                              name: formulaName,
                              value: formulaId,
                          });
                      }
                      return returnData;
                  },
                  async getViewRows() {
                      const returnData = [];
                      const docId = this.getCurrentNodeParameter('docId');
                      const viewId = this.getCurrentNodeParameter('viewId');
                      const viewRows = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', `/docs/${docId}/tables/${viewId}/rows`, {});
                      for (const viewRow of viewRows) {
                          const viewRowName = viewRow.name;
                          const viewRowId = viewRow.id;
                          returnData.push({
                              name: viewRowName,
                              value: viewRowId,
                          });
                      }
                      return returnData;
                  },
                  async getViewColumns() {
                      const returnData = [];
                      const docId = this.getCurrentNodeParameter('docId');
                      const viewId = this.getCurrentNodeParameter('viewId');
                      const viewColumns = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', `/docs/${docId}/tables/${viewId}/columns`, {});
                      for (const viewColumn of viewColumns) {
                          const viewColumnName = viewColumn.name;
                          const viewColumnId = viewColumn.id;
                          returnData.push({
                              name: viewColumnName,
                              value: viewColumnId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const returnData = [];
          const items = this.getInputData();
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          let qs = {};
          const operation = this.getNodeParameter('operation', 0);
          if (resource === 'table') {
              if (operation === 'createRow') {
                  try {
                      const sendData = {};
                      for (let i = 0; i < items.length; i++) {
                          qs = {};
                          const docId = this.getNodeParameter('docId', i);
                          const tableId = this.getNodeParameter('tableId', i);
                          const options = this.getNodeParameter('options', i);
                          const endpoint = `/docs/${docId}/tables/${tableId}/rows`;
                          if (options.disableParsing) {
                              qs.disableParsing = options.disableParsing;
                          }
                          const cells = [];
                          cells.length = 0;
                          for (const key of Object.keys(items[i].json)) {
                              cells.push({
                                  column: key,
                                  value: items[i].json[key],
                              });
                          }
                          if (sendData[endpoint] === undefined) {
                              sendData[endpoint] = {
                                  rows: [],
                                  qs,
                              };
                          }
                          sendData[endpoint].rows.push({ cells });
                          if (options.keyColumns) {
                              sendData[endpoint].keyColumns = options.keyColumns.split(',');
                          }
                      }
                      for (const endpoint of Object.keys(sendData)) {
                          await GenericFunctions_1.codaApiRequest.call(this, 'POST', endpoint, sendData[endpoint], sendData[endpoint].qs);
                      }
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          return [this.helpers.returnJsonArray({ error: error.message })];
                      }
                      throw error;
                  }
                  return [items];
              }
              if (operation === 'getRow') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const docId = this.getNodeParameter('docId', i);
                          const tableId = this.getNodeParameter('tableId', i);
                          const rowId = this.getNodeParameter('rowId', i);
                          const options = this.getNodeParameter('options', i);
                          const endpoint = `/docs/${docId}/tables/${tableId}/rows/${rowId}`;
                          if (options.useColumnNames === false) {
                              qs.useColumnNames = options.useColumnNames;
                          }
                          else {
                              qs.useColumnNames = true;
                          }
                          if (options.valueFormat) {
                              qs.valueFormat = options.valueFormat;
                          }
                          responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {}, qs);
                          if (options.rawData === true) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          else {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({
                                  id: responseData.id,
                                  ...responseData.values,
                              }), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [returnData];
              }
              if (operation === 'getAllRows') {
                  const docId = this.getNodeParameter('docId', 0);
                  const returnAll = this.getNodeParameter('returnAll', 0);
                  const tableId = this.getNodeParameter('tableId', 0);
                  const options = this.getNodeParameter('options', 0);
                  const endpoint = `/docs/${docId}/tables/${tableId}/rows`;
                  if (options.useColumnNames === false) {
                      qs.useColumnNames = options.useColumnNames;
                  }
                  else {
                      qs.useColumnNames = true;
                  }
                  if (options.valueFormat) {
                      qs.valueFormat = options.valueFormat;
                  }
                  if (options.sortBy) {
                      qs.sortBy = options.sortBy;
                  }
                  if (options.visibleOnly) {
                      qs.visibleOnly = options.visibleOnly;
                  }
                  if (options.query) {
                      qs.query = options.query;
                  }
                  try {
                      if (returnAll) {
                          responseData = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', 0);
                          responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {}, qs);
                          responseData = responseData.items;
                      }
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          return [this.helpers.returnJsonArray({ error: error.message })];
                      }
                      throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                  }
                  if (options.rawData === true) {
                      return [this.helpers.returnJsonArray(responseData)];
                  }
                  else {
                      for (const item of responseData) {
                          returnData.push({
                              id: item.id,
                              ...item.values,
                          });
                      }
                      return [this.helpers.returnJsonArray(returnData)];
                  }
              }
              if (operation === 'deleteRow') {
                  try {
                      const sendData = {};
                      for (let i = 0; i < items.length; i++) {
                          const docId = this.getNodeParameter('docId', i);
                          const tableId = this.getNodeParameter('tableId', i);
                          const rowId = this.getNodeParameter('rowId', i);
                          const endpoint = `/docs/${docId}/tables/${tableId}/rows`;
                          if (sendData[endpoint] === undefined) {
                              sendData[endpoint] = [];
                          }
                          sendData[endpoint].push(rowId);
                      }
                      for (const endpoint of Object.keys(sendData)) {
                          await GenericFunctions_1.codaApiRequest.call(this, 'DELETE', endpoint, { rowIds: sendData[endpoint] }, qs);
                      }
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          return [this.helpers.returnJsonArray({ error: error.message })];
                      }
                      throw error;
                  }
                  return [items];
              }
              if (operation === 'pushButton') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const docId = this.getNodeParameter('docId', i);
                          const tableId = this.getNodeParameter('tableId', i);
                          const rowId = this.getNodeParameter('rowId', i);
                          const columnId = this.getNodeParameter('columnId', i);
                          const endpoint = `/docs/${docId}/tables/${tableId}/rows/${rowId}/buttons/${columnId}`;
                          responseData = await GenericFunctions_1.codaApiRequest.call(this, 'POST', endpoint, {});
                          returnData.push(responseData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [this.helpers.returnJsonArray(returnData)];
              }
              if (operation === 'getColumn') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const docId = this.getNodeParameter('docId', i);
                          const tableId = this.getNodeParameter('tableId', i);
                          const columnId = this.getNodeParameter('columnId', i);
                          const endpoint = `/docs/${docId}/tables/${tableId}/columns/${columnId}`;
                          responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {});
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [this.helpers.returnJsonArray(returnData)];
              }
              if (operation === 'getAllColumns') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const docId = this.getNodeParameter('docId', i);
                          const tableId = this.getNodeParameter('tableId', i);
                          const endpoint = `/docs/${docId}/tables/${tableId}/columns`;
                          if (returnAll) {
                              responseData = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {});
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {}, qs);
                              responseData = responseData.items;
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [returnData];
              }
          }
          if (resource === 'formula') {
              if (operation === 'get') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const docId = this.getNodeParameter('docId', i);
                          const formulaId = this.getNodeParameter('formulaId', i);
                          const endpoint = `/docs/${docId}/formulas/${formulaId}`;
                          responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {});
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [returnData];
              }
              if (operation === 'getAll') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const docId = this.getNodeParameter('docId', i);
                          const endpoint = `/docs/${docId}/formulas`;
                          if (returnAll) {
                              responseData = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {});
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {}, qs);
                              responseData = responseData.items;
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [returnData];
              }
          }
          if (resource === 'control') {
              if (operation === 'get') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const docId = this.getNodeParameter('docId', i);
                          const controlId = this.getNodeParameter('controlId', i);
                          const endpoint = `/docs/${docId}/controls/${controlId}`;
                          responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {});
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [returnData];
              }
              if (operation === 'getAll') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const docId = this.getNodeParameter('docId', i);
                          const endpoint = `/docs/${docId}/controls`;
                          if (returnAll) {
                              responseData = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {});
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {}, qs);
                              responseData = responseData.items;
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [returnData];
              }
          }
          if (resource === 'view') {
              if (operation === 'get') {
                  for (let i = 0; i < items.length; i++) {
                      const docId = this.getNodeParameter('docId', i);
                      const viewId = this.getNodeParameter('viewId', i);
                      const endpoint = `/docs/${docId}/tables/${viewId}`;
                      responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  return [returnData];
              }
              if (operation === 'getAll') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const docId = this.getNodeParameter('docId', i);
                          const endpoint = `/docs/${docId}/tables?tableTypes=view`;
                          if (returnAll) {
                              responseData = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {});
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {}, qs);
                              responseData = responseData.items;
                          }
                          responseData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...responseData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [returnData];
              }
              if (operation === 'getAllViewRows') {
                  const docId = this.getNodeParameter('docId', 0);
                  const returnAll = this.getNodeParameter('returnAll', 0);
                  const viewId = this.getNodeParameter('viewId', 0);
                  const options = this.getNodeParameter('options', 0);
                  const endpoint = `/docs/${docId}/tables/${viewId}/rows`;
                  if (options.useColumnNames === false) {
                      qs.useColumnNames = options.useColumnNames;
                  }
                  else {
                      qs.useColumnNames = true;
                  }
                  if (options.valueFormat) {
                      qs.valueFormat = options.valueFormat;
                  }
                  if (options.sortBy) {
                      qs.sortBy = options.sortBy;
                  }
                  if (options.query) {
                      qs.query = options.query;
                  }
                  try {
                      if (returnAll) {
                          responseData = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {}, qs);
                      }
                      else {
                          qs.limit = this.getNodeParameter('limit', 0);
                          responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {}, qs);
                          responseData = responseData.items;
                      }
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          return [this.helpers.returnJsonArray({ error: error.message })];
                      }
                      throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                  }
                  if (options.rawData === true) {
                      return [this.helpers.returnJsonArray(responseData)];
                  }
                  else {
                      for (const item of responseData) {
                          returnData.push({
                              id: item.id,
                              ...item.values,
                          });
                      }
                      return [this.helpers.returnJsonArray(returnData)];
                  }
              }
              if (operation === 'deleteViewRow') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const docId = this.getNodeParameter('docId', i);
                          const viewId = this.getNodeParameter('viewId', i);
                          const rowId = this.getNodeParameter('rowId', i);
                          const endpoint = `/docs/${docId}/tables/${viewId}/rows/${rowId}`;
                          responseData = await GenericFunctions_1.codaApiRequest.call(this, 'DELETE', endpoint);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [returnData];
              }
              if (operation === 'pushViewButton') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const docId = this.getNodeParameter('docId', i);
                          const viewId = this.getNodeParameter('viewId', i);
                          const rowId = this.getNodeParameter('rowId', i);
                          const columnId = this.getNodeParameter('columnId', i);
                          const endpoint = `/docs/${docId}/tables/${viewId}/rows/${rowId}/buttons/${columnId}`;
                          responseData = await GenericFunctions_1.codaApiRequest.call(this, 'POST', endpoint);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [returnData];
              }
              if (operation === 'getAllViewColumns') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const docId = this.getNodeParameter('docId', i);
                          const viewId = this.getNodeParameter('viewId', i);
                          const endpoint = `/docs/${docId}/tables/${viewId}/columns`;
                          if (returnAll) {
                              responseData = await GenericFunctions_1.codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {});
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.codaApiRequest.call(this, 'GET', endpoint, {}, qs);
                              responseData = responseData.items;
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.messsage }), { itemData: { item: i } });
                              returnData.push(...executionErrorData);
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [returnData];
              }
              if (operation === 'updateViewRow') {
                  for (let i = 0; i < items.length; i++) {
                      try {
                          qs = {};
                          const docId = this.getNodeParameter('docId', i);
                          const viewId = this.getNodeParameter('viewId', i);
                          const rowId = this.getNodeParameter('rowId', i);
                          const keyName = this.getNodeParameter('keyName', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {};
                          const endpoint = `/docs/${docId}/tables/${viewId}/rows/${rowId}`;
                          if (options.disableParsing) {
                              qs.disableParsing = options.disableParsing;
                          }
                          const cells = [];
                          cells.length = 0;
                          for (const key of Object.keys(items[i].json[keyName])) {
                              cells.push({
                                  column: key,
                                  value: items[i].json[keyName][key],
                              });
                          }
                          body.row = {
                              cells,
                          };
                          await GenericFunctions_1.codaApiRequest.call(this, 'PUT', endpoint, body, qs);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              items[i].json = { error: error.message };
                              continue;
                          }
                          throw error;
                      }
                  }
                  return [items];
              }
          }
          return [];
      }
  }
  exports.Coda = Coda;
  //# sourceMappingURL=Coda.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Coda credentials
  description: Documentation for Coda credentials. Use these credentials to authenticate Coda in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Coda credentials

  You can use these credentials to authenticate the following nodes:

  - [Coda](/integrations/builtin/app-nodes/n8n-nodes-base.coda.md)

  ## Prerequisites

  Create a [Coda](https://www.coda.io/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API access token

  ## Related resources

  Refer to [Coda's API documentation](https://coda.io/developers/apis/v1){:target=_blank .external-link} for more information about the service.

  ## Using API access token

  To configure this credential, you'll need:

  - An API **Access Token**: Generate an API access token in your Coda [**Account settings**](https://coda.io/@oleg/getting-started-guide-coda-api/start-here-5#_luxC4){:target=_blank .external-link}.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"78e29d3d-21ef-43ba-87e2-871bb7db6760","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"fb15753f3bd2280d87328d24845050c242acff8c55cee154649b28c7c4d99adb"}}


node_type: n8n-nodes-base.CompareDatasets
name: CompareDatasets
display_name: Compare Datasets
description: Compare two inputs for changes
category: Other
code_hash: 1228e4985663cca8c9ac56b8daa9c825e9d730846ba5c2722fa65a302c81ee00
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.comparedatasets
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CompareDatasets = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class CompareDatasets {
      constructor() {
          this.description = {
              displayName: 'Compare Datasets',
              name: 'compareDatasets',
              icon: 'file:compare.svg',
              group: ['transform'],
              version: [1, 2, 2.1, 2.2, 2.3],
              description: 'Compare two inputs for changes',
              defaults: { name: 'Compare Datasets' },
              inputs: ['main', 'main'],
              inputNames: ['Input A', 'Input B'],
              requiredInputs: 1,
              outputs: ['main', 'main', 'main', 'main'],
              outputNames: ['In A only', 'Same', 'Different', 'In B only'],
              properties: [
                  {
                      displayName: 'Items from different branches are paired together when the fields below match. If paired, the rest of the fields are compared to determine whether the items are the same or different',
                      name: 'infoBox',
                      type: 'notice',
                      default: '',
                  },
                  {
                      displayName: 'Fields to Match',
                      name: 'mergeByFields',
                      type: 'fixedCollection',
                      placeholder: 'Add Fields to Match',
                      default: { values: [{ field1: '', field2: '' }] },
                      typeOptions: {
                          multipleValues: true,
                      },
                      options: [
                          {
                              displayName: 'Values',
                              name: 'values',
                              values: [
                                  {
                                      displayName: 'Input A Field',
                                      name: 'field1',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'e.g. id',
                                      hint: ' Enter the field name as text',
                                      requiresDataPath: 'single',
                                  },
                                  {
                                      displayName: 'Input B Field',
                                      name: 'field2',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'e.g. id',
                                      hint: ' Enter the field name as text',
                                      requiresDataPath: 'single',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'When There Are Differences',
                      name: 'resolve',
                      type: 'options',
                      default: 'preferInput2',
                      options: [
                          {
                              name: 'Use Input A Version',
                              value: 'preferInput1',
                          },
                          {
                              name: 'Use Input B Version',
                              value: 'preferInput2',
                          },
                          {
                              name: 'Use a Mix of Versions',
                              value: 'mix',
                              description: 'Output uses different inputs for different fields',
                          },
                          {
                              name: 'Include Both Versions',
                              value: 'includeBoth',
                              description: 'Output contains all data (but structure more complex)',
                          },
                      ],
                      displayOptions: {
                          show: {
                              '@version': [1, 2],
                          },
                      },
                  },
                  {
                      displayName: 'When There Are Differences',
                      name: 'resolve',
                      type: 'options',
                      default: 'includeBoth',
                      options: [
                          {
                              name: 'Use Input A Version',
                              value: 'preferInput1',
                          },
                          {
                              name: 'Use Input B Version',
                              value: 'preferInput2',
                          },
                          {
                              name: 'Use a Mix of Versions',
                              value: 'mix',
                              description: 'Output uses different inputs for different fields',
                          },
                          {
                              name: 'Include Both Versions',
                              value: 'includeBoth',
                              description: 'Output contains all data (but structure more complex)',
                          },
                      ],
                      displayOptions: {
                          hide: {
                              '@version': [1, 2],
                          },
                      },
                  },
                  {
                      displayName: 'Fuzzy Compare',
                      name: 'fuzzyCompare',
                      type: 'boolean',
                      default: false,
                      description: "Whether to tolerate small type differences when comparing fields. E.g. the number 3 and the string '3' are treated as the same.",
                      displayOptions: {
                          hide: {
                              '@version': [1],
                          },
                      },
                  },
                  {
                      displayName: 'Prefer',
                      name: 'preferWhenMix',
                      type: 'options',
                      default: 'input1',
                      options: [
                          {
                              name: 'Input A Version',
                              value: 'input1',
                          },
                          {
                              name: 'Input B Version',
                              value: 'input2',
                          },
                      ],
                      displayOptions: {
                          show: {
                              resolve: ['mix'],
                          },
                      },
                  },
                  {
                      displayName: 'For Everything Except',
                      name: 'exceptWhenMix',
                      type: 'string',
                      default: '',
                      placeholder: 'e.g. id, country',
                      hint: 'Enter the names of the input fields as text, separated by commas',
                      displayOptions: {
                          show: {
                              resolve: ['mix'],
                          },
                      },
                      requiresDataPath: 'multiple',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Fields to Skip Comparing',
                              name: 'skipFields',
                              type: 'string',
                              default: '',
                              placeholder: 'e.g. updated_at, updated_by',
                              hint: 'Enter the field names as text, separated by commas',
                              description: "Fields that shouldn't be included when checking whether two items are the same",
                              requiresDataPath: 'multiple',
                          },
                          {
                              displayName: 'Fuzzy Compare',
                              name: 'fuzzyCompare',
                              type: 'boolean',
                              default: false,
                              description: "Whether to tolerate small type differences when comparing fields. E.g. the number 3 and the string '3' are treated as the same.",
                              displayOptions: {
                                  show: {
                                      '@version': [1],
                                  },
                              },
                          },
                          {
                              displayName: 'Disable Dot Notation',
                              name: 'disableDotNotation',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to disallow referencing child fields using `parent.child` in the field name',
                          },
                          {
                              displayName: 'Multiple Matches',
                              name: 'multipleMatches',
                              type: 'options',
                              default: 'first',
                              options: [
                                  {
                                      name: 'Include First Match Only',
                                      value: 'first',
                                      description: 'Only ever output a single item per match',
                                  },
                                  {
                                      name: 'Include All Matches',
                                      value: 'all',
                                      description: 'Output multiple items if there are multiple matches',
                                  },
                              ],
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const matchFields = (0, GenericFunctions_1.checkMatchFieldsInput)(this.getNodeParameter('mergeByFields.values', 0, []));
          const options = this.getNodeParameter('options', 0, {});
          options.nodeVersion = this.getNode().typeVersion;
          if (options.nodeVersion >= 2) {
              options.fuzzyCompare = this.getNodeParameter('fuzzyCompare', 0, false);
          }
          let input1 = this.getInputData(0);
          let input2 = this.getInputData(1);
          if (options.nodeVersion < 2.2) {
              input1 = (0, GenericFunctions_1.checkInputAndThrowError)(input1, matchFields.map((pair) => pair.field1), options.disableDotNotation || false, 'Input A');
              input2 = (0, GenericFunctions_1.checkInputAndThrowError)(input2, matchFields.map((pair) => pair.field2), options.disableDotNotation || false, 'Input B');
          }
          else {
              input1 = (0, GenericFunctions_1.checkInput)(input1);
              input2 = (0, GenericFunctions_1.checkInput)(input2);
          }
          const resolve = this.getNodeParameter('resolve', 0, '');
          options.resolve = resolve;
          if (resolve === 'mix') {
              options.preferWhenMix = this.getNodeParameter('preferWhenMix', 0, '');
              options.exceptWhenMix = this.getNodeParameter('exceptWhenMix', 0, '');
          }
          const matches = (0, GenericFunctions_1.findMatches)(input1, input2, matchFields, options);
          return matches;
      }
  }
  exports.CompareDatasets = CompareDatasets;
  //# sourceMappingURL=CompareDatasets.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Compare Datasets
  description: Documentation for the Compare Datasets node in n8n, a workflow automation platform. Includes guidance on usage, and links to examples.
  contentType: [integration, reference]
  priority: high
  ---

  # Compare Datasets

  The Compare Datasets node helps you compare data from two input streams.

  ## Node parameters

  1. Decide which fields to compare. In **Input A Field**, enter the name of the field you want to use from input stream A. In **Input B Field**, enter the name of the field you want to use from input stream B. 
  2. **Optional**: You can compare by multiple fields. Select **Add Fields to Match** to set up more comparisons.
  3. Choose how to handle differences between the datasets. In **When There Are Differences**, select one of the following:
  	* **Use Input A Version** to treat input stream A as the source of truth.
  	* **Use Input B Version** to treat input stream B as the source of truth.
  	* **Use a Mix of Versions** to use different inputs for different fields.
  		* Use **Prefer** to select either **Input A Version** or **Input B Version** as the main source of truth.
  		* Enter input fields that are exceptions to **For Everything Except** to pull from the other input source. To add multiple input fields, enter a comma-separated list.
  	* **Include Both Versions** to include both input streams in the output, which may make the structure more complex.
  4. Decide whether to use **Fuzzy Compare**. When turned on, the comparison will tolerate small type differences when comparing fields. For example, the number 3 and the string `3` are treated as the same with **Fuzzy Compare** turned on, but wouldn't be treated the same with it turned off.

  ## Understand item comparison

  Item comparison is a two stage process:

  1. n8n checks if the values of the fields you selected to compare match across both inputs.
  2. If the fields to compare match, n8n then compares all fields within the items, to determine if the items are the same or different.

  ## Node options

  Use the node **Options** to refine your comparison or tweak comparison behavior.

  ### Fields to Skip Comparing

  Enter field names that you want to ignore in the comparison.

  For example, if you compare the two datasets below using `person.language` as the **Fields to Match**, n8n returns them as different. If you add `person.name` to **Fields to Skip Comparing**, n8n returns them as matching.

  ```json
  	// Input 1
  	[
  		{
  			"person":
  			{
  				"name":	"Stefan",
  				"language":	"de"
  			}
  		},
  		{
  			"person":
  			{
  				"name":	"Jim",
  				"language":	"en"
  			}
  		},
  		{
  			"person":
  			{
  				"name":	"Hans",
  				"language":	"de"
  			}
  		}
  	]
  	// Input 2
  		[
  		{
  			"person":
  			{
  				"name":	"Sara",
  				"language":	"de"
  			}
  		},
  		{
  			"person":
  			{
  				"name":	"Jane",
  				"language":	"en"
  			}
  		},
  		{
  			"person":
  			{
  				"name":	"Harriet",
  				"language":	"de"
  			}
  		}
  	]
  ```

  ### Disable Dot Notation

  Whether to disallow referencing child fields using `parent.child` in the field name (turned on) or allow it (turned off, default).

  ### Multiple Matches

  Choose how to handle duplicate data. The default is **Include All Matches**. You can choose **Include First Match Only**.

  For example, given these two datasets:
  ```json
  	// Input 1
  	[
  		{
  			"fruit": {
  				"type": "apple",
  				"color": "red"
  			}
  		},
  				{
  			"fruit": {
  				"type": "apple",
  				"color": "red"
  			}
  		},
  				{
  			"fruit": {
  				"type": "banana",
  				"color": "yellow"
  			}
  		}
  	]
  	// Input 2
  	[
  		{
  			"fruit": {
  				"type": "apple",
  				"color": "red"
  			}
  		},
  				{
  			"fruit": {
  				"type": "apple",
  				"color": "red"
  			}
  		},
  				{
  			"fruit": {
  				"type": "banana",
  				"color": "yellow"
  			}
  		}
  	]
  ```

  n8n returns three items in the **Same Branch** tab. The data is the same in both branches.

  If you select **Include First Match Only**, n8n returns two items, in the **Same Branch** tab. The data is the same in both branches, but n8n only returns the first occurrence of the matching "apple" items.


  ## Understand the output

  There are four output options:

  * **In A only Branch**: Contains data that occurs only in the first input.
  * **Same Branch**: Contains data that's the same in both inputs.
  * **Different Branch**: Contains data that's different between inputs.
  * **In B only Branch**: Contains data that occurs only in the second output.

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'compare-datasets') ]]

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"2db91270-4335-4ace-a81f-d582b34b83b5","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"21e08c2d9aab65ad055538aaabe3f6b939a81c13d2c64a7e89d3ae6b0261aa66"}}


node_type: n8n-nodes-base.Contentful
name: Contentful
display_name: Contentful
description: Consume Contentful API
category: Other
code_hash: 6f3781a04c10511e8692ba49827eb10317ba66b23720b978e9ec69423e57ea05
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/contentful
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() { return m[k]; } };
      }
      Object.defineProperty(o, k2, desc);
  }) : (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      o[k2] = m[k];
  }));
  var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
  }) : function(o, v) {
      o["default"] = v;
  });
  var __importStar = (this && this.__importStar) || function (mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      __setModuleDefault(result, mod);
      return result;
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Contentful = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const SpaceDescription = __importStar(require("./SpaceDescription"));
  const ContentTypeDescription = __importStar(require("./ContentTypeDescription"));
  const EntryDescription = __importStar(require("./EntryDescription"));
  const AssetDescription = __importStar(require("./AssetDescription"));
  const LocaleDescription = __importStar(require("./LocaleDescription"));
  class Contentful {
      constructor() {
          this.description = {
              displayName: 'Contentful',
              name: 'contentful',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              icon: 'file:contentful.png',
              group: ['input'],
              version: 1,
              description: 'Consume Contentful API',
              defaults: {
                  name: 'Contentful',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'contentfulApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Source',
                      name: 'source',
                      type: 'options',
                      default: 'deliveryApi',
                      description: 'Pick where your data comes from, delivery or preview API',
                      options: [
                          {
                              name: 'Delivery API',
                              value: 'deliveryApi',
                          },
                          {
                              name: 'Preview API',
                              value: 'previewApi',
                          },
                      ],
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          AssetDescription.resource,
                          ContentTypeDescription.resource,
                          EntryDescription.resource,
                          LocaleDescription.resource,
                          SpaceDescription.resource,
                      ],
                      default: 'entry',
                  },
                  ...SpaceDescription.operations,
                  ...ContentTypeDescription.operations,
                  ...EntryDescription.operations,
                  ...AssetDescription.operations,
                  ...LocaleDescription.operations,
                  ...SpaceDescription.fields,
                  ...ContentTypeDescription.fields,
                  ...EntryDescription.fields,
                  ...AssetDescription.fields,
                  ...LocaleDescription.fields,
              ],
          };
      }
      async execute() {
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const items = this.getInputData();
          const returnData = [];
          const qs = {};
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'space') {
                      if (operation === 'get') {
                          const credentials = await this.getCredentials('contentfulApi');
                          responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}`);
                      }
                  }
                  if (resource === 'contentType') {
                      if (operation === 'get') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const env = this.getNodeParameter('environmentId', 0);
                          const id = this.getNodeParameter('contentTypeId', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/content_types/${id}`);
                          if (!additionalFields.rawData) {
                              responseData = responseData.fields;
                          }
                      }
                  }
                  if (resource === 'entry') {
                      if (operation === 'get') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const env = this.getNodeParameter('environmentId', 0);
                          const id = this.getNodeParameter('entryId', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/entries/${id}`, {}, qs);
                          if (!additionalFields.rawData) {
                              responseData = responseData.fields;
                          }
                      }
                      else if (operation === 'getAll') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const rawData = additionalFields.rawData;
                          additionalFields.rawData = undefined;
                          const env = this.getNodeParameter('environmentId', i);
                          Object.assign(qs, additionalFields);
                          if (qs.equal) {
                              const [atribute, value] = qs.equal.split('=');
                              qs[atribute] = value;
                              delete qs.equal;
                          }
                          if (qs.notEqual) {
                              const [atribute, value] = qs.notEqual.split('=');
                              qs[atribute] = value;
                              delete qs.notEqual;
                          }
                          if (qs.include) {
                              const [atribute, value] = qs.include.split('=');
                              qs[atribute] = value;
                              delete qs.include;
                          }
                          if (qs.exclude) {
                              const [atribute, value] = qs.exclude.split('=');
                              qs[atribute] = value;
                              delete qs.exclude;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.contentfulApiRequestAllItems.call(this, 'items', 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/entries`, {}, qs);
                              if (!rawData) {
                                  const assets = [];
                                  responseData.map((asset) => {
                                      assets.push(asset.fields);
                                  });
                                  responseData = assets;
                              }
                          }
                          else {
                              const limit = this.getNodeParameter('limit', 0);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/entries`, {}, qs);
                              responseData = responseData.items;
                              if (!rawData) {
                                  const assets = [];
                                  responseData.map((asset) => {
                                      assets.push(asset.fields);
                                  });
                                  responseData = assets;
                              }
                          }
                      }
                  }
                  if (resource === 'asset') {
                      if (operation === 'get') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const env = this.getNodeParameter('environmentId', 0);
                          const id = this.getNodeParameter('assetId', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/assets/${id}`, {}, qs);
                          if (!additionalFields.rawData) {
                              responseData = responseData.fields;
                          }
                      }
                      else if (operation === 'getAll') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const rawData = additionalFields.rawData;
                          additionalFields.rawData = undefined;
                          const env = this.getNodeParameter('environmentId', i);
                          Object.assign(qs, additionalFields);
                          if (qs.equal) {
                              const [atribute, value] = qs.equal.split('=');
                              qs[atribute] = value;
                              delete qs.equal;
                          }
                          if (qs.notEqual) {
                              const [atribute, value] = qs.notEqual.split('=');
                              qs[atribute] = value;
                              delete qs.notEqual;
                          }
                          if (qs.include) {
                              const [atribute, value] = qs.include.split('=');
                              qs[atribute] = value;
                              delete qs.include;
                          }
                          if (qs.exclude) {
                              const [atribute, value] = qs.exclude.split('=');
                              qs[atribute] = value;
                              delete qs.exclude;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.contentfulApiRequestAllItems.call(this, 'items', 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/assets`, {}, qs);
                              if (!rawData) {
                                  const assets = [];
                                  responseData.map((asset) => {
                                      assets.push(asset.fields);
                                  });
                                  responseData = assets;
                              }
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/assets`, {}, qs);
                              responseData = responseData.items;
                              if (!rawData) {
                                  const assets = [];
                                  responseData.map((asset) => {
                                      assets.push(asset.fields);
                                  });
                                  responseData = assets;
                              }
                          }
                      }
                  }
                  if (resource === 'locale') {
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('contentfulApi');
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const env = this.getNodeParameter('environmentId', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.contentfulApiRequestAllItems.call(this, 'items', 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/locales`, {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', 0);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.contentfulApiRequest.call(this, 'GET', `/spaces/${credentials === null || credentials === void 0 ? void 0 : credentials.spaceId}/environments/${env}/locales`, {}, qs);
                              responseData = responseData.items;
                          }
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {} });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Contentful = Contentful;
  //# sourceMappingURL=Contentful.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Contentful credentials
  description: Documentation for Contentful credentials. Use these credentials to authenticate Contentful in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Contentful credentials

  You can use these credentials to authenticate the following nodes:

  - [Contentful](/integrations/builtin/app-nodes/n8n-nodes-base.contentful.md)

  ## Prerequisites

  - Create a [Contentful](https://www.contentful.com/){:target=_blank .external-link} account.
  - Create a [Contentful space](https://www.contentful.com/help/contentful-101/#step-2-create-a-space){:target=_blank .external-link}.

  ## Supported authentication methods

  - API access token

  ## Related resources

  Refer to [Contentful's API documentation](https://www.contentful.com/developers/docs/references/){:target=_blank .external-link} for more information about the service.

  ## Using API access token

  To configure this credential, you'll need:

  - Your Contentful **Space ID**: The Space ID displays as you generate the tokens;  You can also refer to the [Contentful Find space ID documentation](https://www.contentful.com/help/find-space-id/){:target=_blank .external-link} to view the Space ID.
  - A **Content Delivery API Access Token**: Required if you want to use the [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/){:target=_blank .external-link}. Leave blank if you don't intend to use this API.
  - A **Content Preview API Access Token**: Required if you want to use the [Content Preview API](https://www.contentful.com/developers/docs/references/content-preview-api/){:target=_blank .external-link}. Leave blank if you don't intend to use this API.

  View and generate access tokens in Contentful in **Settings > API keys**. Contentful generates tokens for both Content Delivery API and Content Preview API as part of a single key. Refer to [Contentful Creating and managing API keys](https://training.contentful.com/student/activity/1050378-creating-and-managing-api-keys){:target=_blank .external-link} for detailed instructions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"c7dfde8a-1890-4076-ba8f-18d2676b91f0","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"135a88978c3880ffd896d69dee3f92a32181f37aa9e62e86342ad70e319d1339"}}


node_type: n8n-nodes-base.Copper
name: Copper
display_name: Copper
description: Consume the Copper API
category: Other
code_hash: 58626d8463fe950ea43cdbf38c7f1922aa76e79c36751703680e2885527e52b9
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/copper
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Copper = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class Copper {
      constructor() {
          this.description = {
              displayName: 'Copper',
              name: 'copper',
              icon: 'file:copper.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Copper API',
              defaults: {
                  name: 'Copper',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'copperApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Company',
                              value: 'company',
                          },
                          {
                              name: 'Customer Source',
                              value: 'customerSource',
                          },
                          {
                              name: 'Lead',
                              value: 'lead',
                          },
                          {
                              name: 'Opportunity',
                              value: 'opportunity',
                          },
                          {
                              name: 'Person',
                              value: 'person',
                          },
                          {
                              name: 'Project',
                              value: 'project',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'company',
                  },
                  ...descriptions_1.companyOperations,
                  ...descriptions_1.companyFields,
                  ...descriptions_1.customerSourceOperations,
                  ...descriptions_1.customerSourceFields,
                  ...descriptions_1.leadOperations,
                  ...descriptions_1.leadFields,
                  ...descriptions_1.opportunityOperations,
                  ...descriptions_1.opportunityFields,
                  ...descriptions_1.personOperations,
                  ...descriptions_1.personFields,
                  ...descriptions_1.projectOperations,
                  ...descriptions_1.projectFields,
                  ...descriptions_1.taskOperations,
                  ...descriptions_1.taskFields,
                  ...descriptions_1.userOperations,
                  ...descriptions_1.userFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'company') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustCompanyFields)(additionalFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/companies', body);
                      }
                      else if (operation === 'delete') {
                          const companyId = this.getNodeParameter('companyId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/companies/${companyId}`);
                      }
                      else if (operation === 'get') {
                          const companyId = this.getNodeParameter('companyId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/companies/${companyId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, filterFields);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/companies/search', body);
                      }
                      else if (operation === 'update') {
                          const companyId = this.getNodeParameter('companyId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustCompanyFields)(updateFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/companies/${companyId}`, body);
                      }
                  }
                  else if (resource === 'customerSource') {
                      if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/customer_sources');
                      }
                  }
                  else if (resource === 'lead') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustLeadFields)(additionalFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/leads', body);
                      }
                      else if (operation === 'delete') {
                          const leadId = this.getNodeParameter('leadId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/leads/${leadId}`);
                      }
                      else if (operation === 'get') {
                          const leadId = this.getNodeParameter('leadId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/leads/${leadId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, filterFields);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/leads/search', body);
                      }
                      else if (operation === 'update') {
                          const leadId = this.getNodeParameter('leadId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustLeadFields)(updateFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/leads/${leadId}`, body);
                      }
                  }
                  else if (resource === 'opportunity') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                              customer_source_id: this.getNodeParameter('customerSourceId', i),
                              primary_contact_id: this.getNodeParameter('primaryContactId', i),
                          };
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/opportunities', body);
                      }
                      else if (operation === 'delete') {
                          const opportunityId = this.getNodeParameter('opportunityId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/opportunities/${opportunityId}`);
                      }
                      else if (operation === 'get') {
                          const opportunityId = this.getNodeParameter('opportunityId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/opportunities/${opportunityId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, filterFields);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/opportunities/search', body);
                      }
                      else if (operation === 'update') {
                          const opportunityId = this.getNodeParameter('opportunityId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/opportunities/${opportunityId}`, body);
                      }
                  }
                  else if (resource === 'person') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustPersonFields)(additionalFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/people', body);
                      }
                      else if (operation === 'delete') {
                          const personId = this.getNodeParameter('personId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/people/${personId}`);
                      }
                      else if (operation === 'get') {
                          const personId = this.getNodeParameter('personId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/people/${personId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, filterFields);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/people/search', body);
                      }
                      else if (operation === 'update') {
                          const personId = this.getNodeParameter('personId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustPersonFields)(updateFields));
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/people/${personId}`, body);
                      }
                  }
                  else if (resource === 'project') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/projects', body);
                      }
                      else if (operation === 'delete') {
                          const projectId = this.getNodeParameter('projectId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/projects/${projectId}`);
                      }
                      else if (operation === 'get') {
                          const projectId = this.getNodeParameter('projectId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/projects/${projectId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, filterFields);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/projects/search', body);
                      }
                      else if (operation === 'update') {
                          const projectId = this.getNodeParameter('projectId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/projects/${projectId}`, body);
                      }
                  }
                  else if (resource === 'task') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'POST', '/tasks', body);
                      }
                      else if (operation === 'delete') {
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'DELETE', `/tasks/${taskId}`);
                      }
                      else if (operation === 'get') {
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'GET', `/tasks/${taskId}`);
                      }
                      else if (operation === 'getAll') {
                          const body = {};
                          const filterFields = this.getNodeParameter('filterFields', i);
                          if (Object.keys(filterFields).length) {
                              Object.assign(body, (0, GenericFunctions_1.adjustTaskFields)(filterFields));
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/tasks/search', body);
                      }
                      else if (operation === 'update') {
                          const taskId = this.getNodeParameter('taskId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.copperApiRequest.call(this, 'PUT', `/tasks/${taskId}`, body);
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.handleListing.call(this, 'POST', '/users/search');
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.toString(), json: {} });
                      continue;
                  }
                  throw error;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Copper = Copper;
  //# sourceMappingURL=Copper.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Copper credentials
  description: Documentation for Copper credentials. Use these credentials to authenticate Copper in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Copper credentials

  You can use these credentials to authenticate the following nodes:

  - [Copper](/integrations/builtin/app-nodes/n8n-nodes-base.copper.md)
  - [Copper Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.coppertrigger.md)

  ## Prerequisites

  Create a [Copper](https://www.copper.com/) account at the **Professional** or **Business** plan level.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Copper's API documentation](https://developer.copper.com/){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Refer to the [Copper Generating an API key documentation](https://support.copper.com/en/articles/8823347-generating-an-api-key){:target=_blank .external-link} for information on generating an API key.
  - An **Email** address: Use the API key creator's email address

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"ef2a7a40-a81e-435a-a785-d14b34af4b6d","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"94f035251b23291f4c8ed9909782f03df13b1f89518b2ce0ceeaa93388f7bbde"}}


node_type: n8n-nodes-base.Code
name: Code
display_name: Code
description: Run custom JavaScript or Python code
category: Other
code_hash: 97df4024967b2e5c96a0738b9aaa3e94926e65bbe65b3a7e0f0b3e45baa8c879
documentation_url: https://docs.n8n.io/data/data-mapping/data-item-linking/item-linking-code-node
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Code = void 0;
  const JavascriptCodeDescription_1 = require("./descriptions/JavascriptCodeDescription");
  const PythonCodeDescription_1 = require("./descriptions/PythonCodeDescription");
  const JavaScriptSandbox_1 = require("./JavaScriptSandbox");
  const PythonSandbox_1 = require("./PythonSandbox");
  const Sandbox_1 = require("./Sandbox");
  const utils_1 = require("./utils");
  const { CODE_ENABLE_STDOUT } = process.env;
  class Code {
      constructor() {
          this.description = {
              displayName: 'Code',
              name: 'code',
              icon: 'fa:code',
              group: ['transform'],
              version: [1, 2],
              defaultVersion: 2,
              description: 'Run custom JavaScript or Python code',
              defaults: {
                  name: 'Code',
                  color: '#FF9922',
              },
              inputs: ['main'],
              outputs: ['main'],
              parameterPane: 'wide',
              properties: [
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Run Once for All Items',
                              value: 'runOnceForAllItems',
                              description: 'Run this code only once, no matter how many input items there are',
                          },
                          {
                              name: 'Run Once for Each Item',
                              value: 'runOnceForEachItem',
                              description: 'Run this code as many times as there are input items',
                          },
                      ],
                      default: 'runOnceForAllItems',
                  },
                  {
                      displayName: 'Language',
                      name: 'language',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              '@version': [2],
                          },
                      },
                      options: [
                          {
                              name: 'JavaScript',
                              value: 'javaScript',
                          },
                          {
                              name: 'Python (Beta)',
                              value: 'python',
                          },
                      ],
                      default: 'javaScript',
                  },
                  {
                      displayName: 'Language',
                      name: 'language',
                      type: 'hidden',
                      displayOptions: {
                          show: {
                              '@version': [1],
                          },
                      },
                      default: 'javaScript',
                  },
                  ...JavascriptCodeDescription_1.javascriptCodeDescription,
                  ...PythonCodeDescription_1.pythonCodeDescription,
              ],
          };
      }
      async execute() {
          const nodeMode = this.getNodeParameter('mode', 0);
          const workflowMode = this.getMode();
          const node = this.getNode();
          const language = node.typeVersion === 2
              ? this.getNodeParameter('language', 0)
              : 'javaScript';
          const codeParameterName = language === 'python' ? 'pythonCode' : 'jsCode';
          const getSandbox = (index = 0) => {
              const code = this.getNodeParameter(codeParameterName, index);
              const context = Sandbox_1.getSandboxContext.call(this, index);
              if (nodeMode === 'runOnceForAllItems') {
                  context.items = context.$input.all();
              }
              else {
                  context.item = context.$input.item;
              }
              const Sandbox = language === 'python' ? PythonSandbox_1.PythonSandbox : JavaScriptSandbox_1.JavaScriptSandbox;
              const sandbox = new Sandbox(context, code, index, this.helpers);
              sandbox.on('output', workflowMode === 'manual'
                  ? this.sendMessageToUI
                  : CODE_ENABLE_STDOUT === 'true'
                      ? (...args) => console.log(`[Workflow "${this.getWorkflow().id}"][Node "${node.name}"]`, ...args)
                      : () => { });
              return sandbox;
          };
          if (nodeMode === 'runOnceForAllItems') {
              const sandbox = getSandbox();
              let items;
              try {
                  items = await sandbox.runCodeAllItems();
              }
              catch (error) {
                  if (!this.continueOnFail())
                      throw error;
                  items = [{ json: { error: error.message } }];
              }
              for (const item of items) {
                  (0, utils_1.standardizeOutput)(item.json);
              }
              return [items];
          }
          const returnData = [];
          const items = this.getInputData();
          for (let index = 0; index < items.length; index++) {
              const sandbox = getSandbox(index);
              let result;
              try {
                  result = await sandbox.runCodeEachItem();
              }
              catch (error) {
                  if (!this.continueOnFail())
                      throw error;
                  returnData.push({ json: { error: error.message } });
              }
              if (result) {
                  returnData.push({
                      json: (0, utils_1.standardizeOutput)(result.json),
                      pairedItem: { item: index },
                      ...(result.binary && { binary: result.binary }),
                  });
              }
          }
          return [returnData];
      }
  }
  exports.Code = Code;
  //# sourceMappingURL=Code.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  contentType: howto
  ---

  # Item linking in the Code node
  --8<-- "_snippets/data/data-mapping/item-linking-code-node.md"

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"d6e59c75-ae17-47cd-a627-5e9abbbe52bf","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"b342face289820dd2291dca9d05138c40b1bf79e388eab7c8ef5fbfaf5f20110"}}


node_type: n8n-nodes-base.ConvertKit
name: ConvertKit
display_name: ConvertKit
description: Consume ConvertKit API
category: Other
code_hash: f7753276ed6031dda1d07432d51218d88822fad961e6f03e0d1ec1709895c87f
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/convertkit
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ConvertKit = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const CustomFieldDescription_1 = require("./CustomFieldDescription");
  const FormDescription_1 = require("./FormDescription");
  const SequenceDescription_1 = require("./SequenceDescription");
  const TagDescription_1 = require("./TagDescription");
  const TagSubscriberDescription_1 = require("./TagSubscriberDescription");
  class ConvertKit {
      constructor() {
          this.description = {
              displayName: 'ConvertKit',
              name: 'convertKit',
              icon: 'file:convertKit.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume ConvertKit API',
              defaults: {
                  name: 'ConvertKit',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'convertKitApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Custom Field',
                              value: 'customField',
                          },
                          {
                              name: 'Form',
                              value: 'form',
                          },
                          {
                              name: 'Sequence',
                              value: 'sequence',
                          },
                          {
                              name: 'Tag',
                              value: 'tag',
                          },
                          {
                              name: 'Tag Subscriber',
                              value: 'tagSubscriber',
                          },
                      ],
                      default: 'form',
                  },
                  ...CustomFieldDescription_1.customFieldOperations,
                  ...CustomFieldDescription_1.customFieldFields,
                  ...FormDescription_1.formOperations,
                  ...FormDescription_1.formFields,
                  ...SequenceDescription_1.sequenceOperations,
                  ...SequenceDescription_1.sequenceFields,
                  ...TagDescription_1.tagOperations,
                  ...TagDescription_1.tagFields,
                  ...TagSubscriberDescription_1.tagSubscriberOperations,
                  ...TagSubscriberDescription_1.tagSubscriberFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTags() {
                      const returnData = [];
                      const { tags } = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/tags');
                      for (const tag of tags) {
                          const tagName = tag.name;
                          const tagId = tag.id;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
                  async getForms() {
                      const returnData = [];
                      const { forms } = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/forms');
                      for (const form of forms) {
                          const formName = form.name;
                          const formId = form.id;
                          returnData.push({
                              name: formName,
                              value: formId,
                          });
                      }
                      return returnData;
                  },
                  async getSequences() {
                      const returnData = [];
                      const { courses } = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/sequences');
                      for (const course of courses) {
                          const courseName = course.name;
                          const courseId = course.id;
                          returnData.push({
                              name: courseName,
                              value: courseId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'customField') {
                      if (operation === 'create') {
                          const label = this.getNodeParameter('label', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', '/custom_fields', { label }, qs);
                      }
                      if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'DELETE', `/custom_fields/${id}`);
                      }
                      if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', `/custom_fields/${id}`);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/custom_fields');
                          responseData = responseData.custom_fields;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const label = this.getNodeParameter('label', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'PUT', `/custom_fields/${id}`, {
                              label,
                          });
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'form') {
                      if (operation === 'addSubscriber') {
                          const email = this.getNodeParameter('email', i);
                          const formId = this.getNodeParameter('id', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              email,
                          };
                          if (additionalFields.firstName) {
                              body.first_name = additionalFields.firstName;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          if (additionalFields.fieldsUi) {
                              const fieldValues = additionalFields.fieldsUi
                                  .fieldsValues;
                              if (fieldValues) {
                                  body.fields = {};
                                  for (const fieldValue of fieldValues) {
                                      body.fields[fieldValue.key] = fieldValue.value;
                                  }
                              }
                          }
                          const { subscription } = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', `/forms/${formId}/subscribe`, body);
                          responseData = subscription;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/forms');
                          responseData = responseData.forms;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      if (operation === 'getSubscriptions') {
                          const formId = this.getNodeParameter('id', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.subscriberState) {
                              qs.subscriber_state = additionalFields.subscriberState;
                          }
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', `/forms/${formId}/subscriptions`, {}, qs);
                          responseData = responseData.subscriptions;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  if (resource === 'sequence') {
                      if (operation === 'addSubscriber') {
                          const email = this.getNodeParameter('email', i);
                          const sequenceId = this.getNodeParameter('id', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              email,
                          };
                          if (additionalFields.firstName) {
                              body.first_name = additionalFields.firstName;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          if (additionalFields.fieldsUi) {
                              const fieldValues = additionalFields.fieldsUi
                                  .fieldsValues;
                              if (fieldValues) {
                                  body.fields = {};
                                  for (const fieldValue of fieldValues) {
                                      body.fields[fieldValue.key] = fieldValue.value;
                                  }
                              }
                          }
                          const { subscription } = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', `/sequences/${sequenceId}/subscribe`, body);
                          responseData = subscription;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/sequences');
                          responseData = responseData.courses;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      if (operation === 'getSubscriptions') {
                          const sequenceId = this.getNodeParameter('id', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.subscriberState) {
                              qs.subscriber_state = additionalFields.subscriberState;
                          }
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', `/sequences/${sequenceId}/subscriptions`, {}, qs);
                          responseData = responseData.subscriptions;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  if (resource === 'tag') {
                      if (operation === 'create') {
                          const names = this.getNodeParameter('name', i)
                              .split(',')
                              .map((e) => ({ name: e }));
                          const body = {
                              tag: names,
                          };
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', '/tags', body);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', '/tags');
                          responseData = responseData.tags;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  if (resource === 'tagSubscriber') {
                      if (operation === 'add') {
                          const tagId = this.getNodeParameter('tagId', i);
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              email,
                          };
                          if (additionalFields.firstName) {
                              body.first_name = additionalFields.firstName;
                          }
                          if (additionalFields.fieldsUi) {
                              const fieldValues = additionalFields.fieldsUi
                                  .fieldsValues;
                              if (fieldValues) {
                                  body.fields = {};
                                  for (const fieldValue of fieldValues) {
                                      body.fields[fieldValue.key] = fieldValue.value;
                                  }
                              }
                          }
                          const { subscription } = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', `/tags/${tagId}/subscribe`, body);
                          responseData = subscription;
                      }
                      if (operation === 'getAll') {
                          const tagId = this.getNodeParameter('tagId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'GET', `/tags/${tagId}/subscriptions`);
                          responseData = responseData.subscriptions;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                      if (operation === 'delete') {
                          const tagId = this.getNodeParameter('tagId', i);
                          const email = this.getNodeParameter('email', i);
                          responseData = await GenericFunctions_1.convertKitApiRequest.call(this, 'POST', `/tags/${tagId}>/unsubscribe`, { email });
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {} });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.ConvertKit = ConvertKit;
  //# sourceMappingURL=ConvertKit.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: ConvertKit credentials
  description: Documentation for ConvertKit credentials. Use these credentials to authenticate ConvertKit in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # ConvertKit credentials

  You can use these credentials to authenticate the following nodes:

  - [ConvertKit](/integrations/builtin/app-nodes/n8n-nodes-base.convertkit.md)
  - [ConvertKit Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.convertkittrigger.md)

  ## Prerequisites

  Create a [ConvertKit](https://convertkit.com/) account.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [ConvertKit's API documentation](https://developers.convertkit.com/#overview){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Secret**: Access your ConvertKit API key in [**Account Settings > Advanced**](https://app.convertkit.com/account_settings/advanced_settings){:target=_blank .external-link}. Add this key as the **API Secret** in n8n.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"b973f4f2-7355-46fc-ad04-f2539d0fccc6","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"9d12735cd0fc59c347e1a060a62d1e1f893a4b9cdf8d695603597fdb8619eba5"}}


node_type: n8n-nodes-base.Compression
name: Compression
display_name: Compression
description: Compress and decompress files
category: Other
code_hash: 9a2aa09c05ff773f096e2cae51c7267a5809dc8931ea7f87deb9dc17178877bc
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.compression
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() { return m[k]; } };
      }
      Object.defineProperty(o, k2, desc);
  }) : (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      o[k2] = m[k];
  }));
  var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
  }) : function(o, v) {
      o["default"] = v;
  });
  var __importStar = (this && this.__importStar) || function (mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      __setModuleDefault(result, mod);
      return result;
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Compression = void 0;
  const fflate = __importStar(require("fflate"));
  const util_1 = require("util");
  const gunzip = (0, util_1.promisify)(fflate.gunzip);
  const gzip = (0, util_1.promisify)(fflate.gzip);
  const unzip = (0, util_1.promisify)(fflate.unzip);
  const zip = (0, util_1.promisify)(fflate.zip);
  const mime = __importStar(require("mime-types"));
  const ALREADY_COMPRESSED = [
      '7z',
      'aifc',
      'bz2',
      'doc',
      'docx',
      'gif',
      'gz',
      'heic',
      'heif',
      'jpg',
      'jpeg',
      'mov',
      'mp3',
      'mp4',
      'pdf',
      'png',
      'ppt',
      'pptx',
      'rar',
      'webm',
      'webp',
      'xls',
      'xlsx',
      'zip',
  ];
  class Compression {
      constructor() {
          this.description = {
              displayName: 'Compression',
              name: 'compression',
              icon: 'fa:file-archive',
              group: ['transform'],
              subtitle: '={{$parameter["operation"]}}',
              version: 1,
              description: 'Compress and decompress files',
              defaults: {
                  name: 'Compression',
                  color: '#408000',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Compress',
                              value: 'compress',
                          },
                          {
                              name: 'Decompress',
                              value: 'decompress',
                          },
                      ],
                      default: 'decompress',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['compress', 'decompress'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file(s) to be compress/decompress. Multiple can be used separated by a comma (,).',
                  },
                  {
                      displayName: 'Output Format',
                      name: 'outputFormat',
                      type: 'options',
                      default: '',
                      options: [
                          {
                              name: 'Gzip',
                              value: 'gzip',
                          },
                          {
                              name: 'Zip',
                              value: 'zip',
                          },
                      ],
                      displayOptions: {
                          show: {
                              operation: ['compress'],
                          },
                      },
                      description: 'Format of the output file',
                  },
                  {
                      displayName: 'File Name',
                      name: 'fileName',
                      type: 'string',
                      default: '',
                      placeholder: 'data.zip',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['compress'],
                              outputFormat: ['zip'],
                          },
                      },
                      description: 'Name of the file to be compressed',
                  },
                  {
                      displayName: 'Binary Property Output',
                      name: 'binaryPropertyOutput',
                      type: 'string',
                      default: 'data',
                      displayOptions: {
                          show: {
                              outputFormat: ['zip'],
                              operation: ['compress'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property to which to write the data of the compressed files',
                  },
                  {
                      displayName: 'Output Prefix',
                      name: 'outputPrefix',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['compress'],
                              outputFormat: ['gzip'],
                          },
                      },
                      description: 'Prefix use for all gzip compressed files',
                  },
                  {
                      displayName: 'Output Prefix',
                      name: 'outputPrefix',
                      type: 'string',
                      default: 'file_',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['decompress'],
                          },
                      },
                      description: 'Prefix use for all decompressed files',
                  },
              ],
          };
      }
      async execute() {
          var _a, _b, _c, _d;
          const items = this.getInputData();
          const length = items.length;
          const returnData = [];
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (operation === 'decompress') {
                      const binaryPropertyNames = this.getNodeParameter('binaryPropertyName', 0)
                          .split(',')
                          .map((key) => key.trim());
                      const outputPrefix = this.getNodeParameter('outputPrefix', 0);
                      const binaryObject = {};
                      let zipIndex = 0;
                      for (const [index, binaryPropertyName] of binaryPropertyNames.entries()) {
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          if (((_a = binaryData.fileExtension) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'zip') {
                              const files = await unzip(binaryDataBuffer);
                              for (const key of Object.keys(files)) {
                                  if (key.includes('__MACOSX')) {
                                      continue;
                                  }
                                  const data = await this.helpers.prepareBinaryData(Buffer.from(files[key].buffer), key);
                                  binaryObject[`${outputPrefix}${zipIndex++}`] = data;
                              }
                          }
                          else if (((_b = binaryData.fileExtension) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'gz') {
                              const file = await gunzip(binaryDataBuffer);
                              const fileName = (_c = binaryData.fileName) === null || _c === void 0 ? void 0 : _c.split('.')[0];
                              const propertyName = `${outputPrefix}${index}`;
                              binaryObject[propertyName] = await this.helpers.prepareBinaryData(Buffer.from(file.buffer), fileName);
                              const fileExtension = mime.extension(binaryObject[propertyName].mimeType);
                              binaryObject[propertyName].fileName = `${fileName}.${fileExtension}`;
                              binaryObject[propertyName].fileExtension = fileExtension;
                          }
                      }
                      returnData.push({
                          json: items[i].json,
                          binary: binaryObject,
                          pairedItem: {
                              item: i,
                          },
                      });
                  }
                  if (operation === 'compress') {
                      const binaryPropertyNames = this.getNodeParameter('binaryPropertyName', 0)
                          .split(',')
                          .map((key) => key.trim());
                      const outputFormat = this.getNodeParameter('outputFormat', 0);
                      const zipData = {};
                      const binaryObject = {};
                      for (const [index, binaryPropertyName] of binaryPropertyNames.entries()) {
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          if (outputFormat === 'zip') {
                              zipData[binaryData.fileName] = [
                                  binaryDataBuffer,
                                  {
                                      level: ALREADY_COMPRESSED.includes(binaryData.fileExtension) ? 0 : 6,
                                  },
                              ];
                          }
                          else if (outputFormat === 'gzip') {
                              const outputPrefix = this.getNodeParameter('outputPrefix', 0);
                              const data = await gzip(binaryDataBuffer);
                              const fileName = (_d = binaryData.fileName) === null || _d === void 0 ? void 0 : _d.split('.')[0];
                              binaryObject[`${outputPrefix}${index}`] = await this.helpers.prepareBinaryData(Buffer.from(data), `${fileName}.gzip`);
                          }
                      }
                      if (outputFormat === 'zip') {
                          const fileName = this.getNodeParameter('fileName', 0);
                          const binaryPropertyOutput = this.getNodeParameter('binaryPropertyOutput', 0);
                          const buffer = await zip(zipData);
                          const data = await this.helpers.prepareBinaryData(Buffer.from(buffer), fileName);
                          returnData.push({
                              json: items[i].json,
                              binary: {
                                  [binaryPropertyOutput]: data,
                              },
                              pairedItem: {
                                  item: i,
                              },
                          });
                      }
                      if (outputFormat === 'gzip') {
                          returnData.push({
                              json: items[i].json,
                              binary: binaryObject,
                              pairedItem: {
                                  item: i,
                              },
                          });
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: i,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Compression = Compression;
  //# sourceMappingURL=Compression.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Compression
  description: Documentation for the Compression node in n8n, a workflow automation platform. Includes guidance on usage, and links to examples.
  contentType: [integration, reference]
  priority: medium
  ---

  # Compression

  Use the Compression node to compress and decompress files. Supports Zip and Gzip formats.

  ## Node parameters

  --8<-- "_snippets/integrations/builtin/app-nodes/ai-tools.md"

  The node parameters depend on which **Operation** you select. Choose to:

  * **Compress**: Create a compressed file from your input data.
  * **Decompress**: Decompress an existing compressed file.

  Refer to the sections below for parameters specific to each **Operation**.

  ### Compress

  - **Input Binary Field(s)**: Enter the name of the fields in the input data that contain the binary files you want to compress. To compress more than one file, use a comma-separated list.
  - **Output Format**: Choose whether to format the compressed output as **Zip** or **Gzip**.
  - **File Name**: Enter the name of the zip file the node creates.
  - **Put Output File in Field**: Enter the name of the field in the output data to contain the file.

  ### Decompress

  - **Put Output File in Field**: Enter the name of the fields in the input data that contain the binary files you want to decompress. To decompress more than one file, use a comma-separated list.
  - **Output Prefix**: Enter a prefix to add to the output file name.

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'compression') ]]

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"00e58581-1c84-473c-8673-5ced22523c05","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"abbc423618bc8cc9550702cad4cad5125b3d66a02cc48afdde600cff0ce32221"}}


node_type: n8n-nodes-base.Cron
name: Cron
display_name: Cron
description: Triggers the workflow at a specific time
category: Other
code_hash: 1007935f771c6c047d905b9d18670c642e442bffb3587f1b054ebd817dc1604c
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Cron = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const cron_1 = require("cron");
  class Cron {
      constructor() {
          this.description = {
              displayName: 'Cron',
              name: 'cron',
              icon: 'fa:clock',
              group: ['trigger', 'schedule'],
              version: 1,
              hidden: true,
              description: 'Triggers the workflow at a specific time',
              eventTriggerDescription: '',
              activationMessage: 'Your cron trigger will now trigger executions on the schedule you have defined.',
              defaults: {
                  name: 'Cron',
                  color: '#29a568',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'This workflow will run on the schedule you define here once you <a data-key="activate">activate</a> it.<br><br>For testing, you can also trigger it manually: by going back to the canvas and clicking ‘execute workflow’',
                      name: 'notice',
                      type: 'notice',
                      default: '',
                  },
                  {
                      displayName: 'Trigger Times',
                      name: 'triggerTimes',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                          multipleValueButtonText: 'Add Time',
                      },
                      default: {},
                      description: 'Triggers for the workflow',
                      placeholder: 'Add Cron Time',
                      options: n8n_workflow_1.NodeHelpers.cronNodeOptions,
                  },
              ],
          };
      }
      async trigger() {
          const triggerTimes = this.getNodeParameter('triggerTimes');
          const cronTimes = (triggerTimes.item || []).map(n8n_workflow_1.toCronExpression);
          const executeTrigger = () => {
              this.emit([this.helpers.returnJsonArray([{}])]);
          };
          const timezone = this.getTimezone();
          const cronJobs = cronTimes.map((cronTime) => new cron_1.CronJob(cronTime, executeTrigger, undefined, true, timezone));
          async function closeFunction() {
              for (const cronJob of cronJobs) {
                  cronJob.stop();
              }
          }
          async function manualTriggerFunction() {
              executeTrigger();
          }
          return {
              closeFunction,
              manualTriggerFunction,
          };
      }
  }
  exports.Cron = Cron;
  //# sourceMappingURL=Cron.node.js.map

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"e2a5a0a7-6c34-4cff-8551-799a2a444bdd","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"284e5d0cfd5c132b526c27dab04ec950629361a1999bfd7f757aca826e361c41"}}


node_type: n8n-nodes-base.Cortex
name: Cortex
display_name: Cortex
description: Apply the Cortex analyzer/responder on the given entity
category: Other
code_hash: 8f389c8f2baaa7c8b3f6baa6e6f1207c28c8d3f75ad14339b2f345e321864b98
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/cortex
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() { return m[k]; } };
      }
      Object.defineProperty(o, k2, desc);
  }) : (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      o[k2] = m[k];
  }));
  var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
  }) : function(o, v) {
      o["default"] = v;
  });
  var __importStar = (this && this.__importStar) || function (mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      __setModuleDefault(result, mod);
      return result;
  };
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Cortex = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const AnalyzerDescriptions_1 = require("./AnalyzerDescriptions");
  const ResponderDescription_1 = require("./ResponderDescription");
  const JobDescription_1 = require("./JobDescription");
  const upperFirst_1 = __importDefault(require("lodash/upperFirst"));
  const crypto_1 = require("crypto");
  const changeCase = __importStar(require("change-case"));
  class Cortex {
      constructor() {
          this.description = {
              displayName: 'Cortex',
              name: 'cortex',
              icon: 'file:cortex.svg',
              group: ['transform'],
              subtitle: '={{$parameter["operation"]+ ": " + $parameter["resource"]}}',
              version: 1,
              description: 'Apply the Cortex analyzer/responder on the given entity',
              defaults: {
                  name: 'Cortex',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'cortexApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Analyzer',
                              value: 'analyzer',
                          },
                          {
                              name: 'Job',
                              value: 'job',
                          },
                          {
                              name: 'Responder',
                              value: 'responder',
                          },
                      ],
                      default: 'analyzer',
                      description: 'Choose a resource',
                      required: true,
                  },
                  ...AnalyzerDescriptions_1.analyzersOperations,
                  ...AnalyzerDescriptions_1.analyzerFields,
                  ...ResponderDescription_1.respondersOperations,
                  ...ResponderDescription_1.responderFields,
                  ...JobDescription_1.jobOperations,
                  ...JobDescription_1.jobFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async loadActiveAnalyzers() {
                      const requestResult = await GenericFunctions_1.cortexApiRequest.call(this, 'POST', '/analyzer/_search?range=all');
                      const returnData = [];
                      for (const analyzer of requestResult) {
                          returnData.push({
                              name: analyzer.name,
                              value: `${analyzer.id}::${analyzer.name}`,
                              description: analyzer.description,
                          });
                      }
                      return returnData;
                  },
                  async loadActiveResponders() {
                      const requestResult = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', '/responder');
                      const returnData = [];
                      for (const responder of requestResult) {
                          returnData.push({
                              name: responder.name,
                              value: `${responder.id}::${responder.name}`,
                              description: responder.description,
                          });
                      }
                      return returnData;
                  },
                  async loadObservableOptions() {
                      const selectedAnalyzerId = this.getNodeParameter('analyzer').split('::')[0];
                      const requestResult = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', `/analyzer/${selectedAnalyzerId}`);
                      const returnData = [];
                      for (const dataType of requestResult.dataTypeList) {
                          returnData.push({
                              name: (0, upperFirst_1.default)(dataType),
                              value: dataType,
                          });
                      }
                      return returnData;
                  },
                  async loadDataTypeOptions() {
                      const selectedResponderId = this.getNodeParameter('responder').split('::')[0];
                      const requestResult = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', `/responder/${selectedResponderId}`);
                      const returnData = [];
                      for (const dataType of requestResult.dataTypeList) {
                          returnData.push({
                              value: dataType.split(':')[1],
                              name: changeCase.capitalCase(dataType.split(':')[1]),
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'analyzer') {
                      if (operation === 'execute') {
                          let force = false;
                          const analyzer = this.getNodeParameter('analyzer', i);
                          const observableType = this.getNodeParameter('observableType', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const tlp = this.getNodeParameter('tlp', i);
                          const body = {
                              dataType: observableType,
                              tlp,
                          };
                          if (additionalFields.force === true) {
                              force = true;
                          }
                          if (observableType === 'file') {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              const fileBufferData = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              const options = {
                                  formData: {
                                      data: {
                                          value: fileBufferData,
                                          options: {
                                              contentType: binaryData.mimeType,
                                              filename: binaryData.fileName,
                                          },
                                      },
                                      _json: JSON.stringify({
                                          dataType: observableType,
                                          tlp,
                                      }),
                                  },
                              };
                              responseData = (await GenericFunctions_1.cortexApiRequest.call(this, 'POST', `/analyzer/${analyzer.split('::')[0]}/run`, {}, { force }, '', options));
                              continue;
                          }
                          else {
                              const observableValue = this.getNodeParameter('observableValue', i);
                              body.data = observableValue;
                              responseData = (await GenericFunctions_1.cortexApiRequest.call(this, 'POST', `/analyzer/${analyzer.split('::')[0]}/run`, body, { force }));
                          }
                          if (additionalFields.timeout) {
                              responseData = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', `/job/${responseData.id}/waitreport`, {}, { atMost: `${additionalFields.timeout}second` });
                          }
                      }
                  }
                  if (resource === 'job') {
                      if (operation === 'get') {
                          const jobId = this.getNodeParameter('jobId', i);
                          responseData = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', `/job/${jobId}`);
                      }
                      if (operation === 'report') {
                          const jobId = this.getNodeParameter('jobId', i);
                          responseData = await GenericFunctions_1.cortexApiRequest.call(this, 'GET', `/job/${jobId}/report`);
                      }
                  }
                  if (resource === 'responder') {
                      if (operation === 'execute') {
                          const responderId = this.getNodeParameter('responder', i).split('::')[0];
                          const entityType = this.getNodeParameter('entityType', i);
                          const isJSON = this.getNodeParameter('jsonObject', i);
                          let body;
                          if (isJSON) {
                              const entityJson = JSON.parse(this.getNodeParameter('objectData', i));
                              body = {
                                  responderId,
                                  label: (0, GenericFunctions_1.getEntityLabel)(entityJson),
                                  dataType: `thehive:${entityType}`,
                                  data: entityJson,
                                  tlp: entityJson.tlp || 2,
                                  pap: entityJson.pap || 2,
                                  message: entityJson.message || '',
                                  parameters: [],
                              };
                          }
                          else {
                              const values = this.getNodeParameter('parameters', i)
                                  .values;
                              body = {
                                  responderId,
                                  dataType: `thehive:${entityType}`,
                                  data: {
                                      _type: entityType,
                                      ...(0, GenericFunctions_1.prepareParameters)(values),
                                  },
                              };
                              if (entityType === 'alert') {
                                  const artifacts = body.data.artifacts;
                                  if (artifacts) {
                                      const artifactValues = artifacts.artifactValues;
                                      if (artifactValues) {
                                          const artifactData = [];
                                          for (const artifactvalue of artifactValues) {
                                              const element = {};
                                              element.message = artifactvalue.message;
                                              element.tags = (0, GenericFunctions_1.splitTags)(artifactvalue.tags);
                                              element.dataType = artifactvalue.dataType;
                                              element.data = artifactvalue.data;
                                              if (artifactvalue.dataType === 'file') {
                                                  const binaryPropertyName = artifactvalue.binaryProperty;
                                                  const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                                  element.data = `${binaryData.fileName};${binaryData.mimeType};${binaryData.data}`;
                                              }
                                              artifactData.push(element);
                                          }
                                          body.data.artifacts = artifactData;
                                      }
                                  }
                              }
                              if (entityType === 'case_artifact') {
                                  if (body.data.dataType === 'file') {
                                      const binaryPropertyName = body.data
                                          .binaryPropertyName;
                                      const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                      const fileBufferData = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                                      const sha256 = (0, crypto_1.createHash)('sha256').update(fileBufferData).digest('hex');
                                      body.data.attachment = {
                                          name: binaryData.fileName,
                                          hashes: [
                                              sha256,
                                              (0, crypto_1.createHash)('sha1').update(fileBufferData).digest('hex'),
                                              (0, crypto_1.createHash)('md5').update(fileBufferData).digest('hex'),
                                          ],
                                          size: fileBufferData.byteLength,
                                          contentType: binaryData.mimeType,
                                          id: sha256,
                                      };
                                      delete body.data.binaryPropertyName;
                                  }
                              }
                              body = {
                                  label: (0, GenericFunctions_1.getEntityLabel)(body.data),
                                  ...body,
                              };
                          }
                          responseData = (await GenericFunctions_1.cortexApiRequest.call(this, 'POST', `/responder/${responderId}/run`, body));
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else if (responseData !== undefined) {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Cortex = Cortex;
  //# sourceMappingURL=Cortex.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Cortex credentials
  description: Documentation for the Cortex credentials. Use these credentials to authenticate Cortex in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Cortex credentials

  You can use these credentials to authenticate the following nodes:

  - [Cortex](/integrations/builtin/app-nodes/n8n-nodes-base.cortex.md)

  ## Prerequisites

  Install [Cortex](https://docs.strangebee.com/cortex/installation-and-configuration/){:target=_blank .external-link} on your server.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [Cortex's API documentation](https://docs.strangebee.com/cortex/api/api-guide/){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: Refer to the [Cortex API Authentication documentation](https://docs.strangebee.com/cortex/api/api-guide/#authentication){:target=_blank .external-link} for detailed instructions on generating API keys.
  - The URL/Server Address for your **Cortex Instance** (defaults to `http://<your_server_address>:9001/`)

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"25b05ff0-bd15-4b44-ab6e-dcf07e55c20b","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"de97078a7ed1120716f07713fd69ab2e3b6c1815956c91f9dd801ece2254ff50"}}


node_type: n8n-nodes-base.CrowdDev
name: CrowdDev
display_name: crowd.dev
category: Other
code_hash: b178a065b61c6a7c856f8750043d0f368f7c2561ccb062a045c83c17eabe4328
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/crowddev
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
description:
  crowd.dev is an open-source suite of community and data tools built to unlock community-led growth for your organization.

source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CrowdDev = void 0;
  const descriptions_1 = require("./descriptions");
  class CrowdDev {
      constructor() {
          this.description = {
              displayName: 'crowd.dev',
              name: 'crowdDev',
              icon: 'file:crowdDev.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
              description: 'crowd.dev is an open-source suite of community and data tools built to unlock community-led growth for your organization.',
              defaults: {
                  name: 'crowd.dev',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'crowdDevApi',
                      required: true,
                  },
              ],
              requestDefaults: {
                  baseURL: '={{$credentials.url}}/api/tenant/{{$credentials.tenantId}}',
                  json: true,
                  skipSslCertificateValidation: '={{ $credentials.allowUnauthorizedCerts }}',
              },
              properties: descriptions_1.allProperties,
          };
      }
  }
  exports.CrowdDev = CrowdDev;
  //# sourceMappingURL=CrowdDev.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: crowd.dev credentials
  description: Documentation for the crowd.dev credentials. Use these credentials to authenticate crowd.dev in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # crowd.dev credentials

  You can use these credentials to authenticate the following nodes:

  * [crowd.dev](/integrations/builtin/app-nodes/n8n-nodes-base.crowddev.md)
  * [crowd.dev Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.crowddevtrigger.md)

  ## Prerequisites

  Create a working instance of [crowd.dev](https://www.crowd.dev/){:target=_blank .external-link}.

  ## Supported authentication methods

  - API key

  ## Related resources

  Refer to [crowd.dev's documentation](https://docs.crowd.dev/docs){:target=_blank .external-link} for more information about the service, and their [API documentation](https://api.crowd.dev/api-reference){:target=_blank .external-link} for working with the API.

  ## Using API key

  To configure this credential, you'll need:

  - A **URL**:
      - If your crowd.dev instance is hosted on crowd.dev, keep the default of `https://app.crowd.dev`.
      - If your crowd.dev instance is [self-hosted](https://docs.crowd.dev/docs/technical-docs/self-hosting){:target=_blank .external-link}, use the URL you use to access your crowd.dev instance.
  - Your crowd.dev **Tenant ID**: Displayed in the **Settings** section of the crowd.dev app
  - An API **Token**: Displayed in the **Settings** section of the crowd.dev app

  Refer to the [crowd.dev API documentation](https://api.crowd.dev/api-reference){:target=_blank .external-link} for more detailed instructions.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"a1c10dca-1569-4b45-b35d-0e9a5aeb1a64","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"e29ea08064374aa1c6c49c13a137fd0a2e79b065be6d9bf6ae904ee22190ddc8"}}


node_type: n8n-nodes-base.DateTime
name: DateTime
display_name: Date & Time
description: Allows you to manipulate date and time values
category: Other
code_hash: 5b2d624ad5788edd31b5c0bcec8b91e25d0cdc5ba56f41c1b9e21350e7193fa7
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.datetime
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DateTime = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const DateTimeV1_node_1 = require("./V1/DateTimeV1.node");
  const DateTimeV2_node_1 = require("./V2/DateTimeV2.node");
  class DateTime extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Date & Time',
              name: 'dateTime',
              icon: 'fa:clock',
              group: ['transform'],
              defaultVersion: 2,
              description: 'Allows you to manipulate date and time values',
              subtitle: '={{$parameter["action"]}}',
          };
          const nodeVersions = {
              1: new DateTimeV1_node_1.DateTimeV1(baseDescription),
              2: new DateTimeV2_node_1.DateTimeV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.DateTime = DateTime;
  //# sourceMappingURL=DateTime.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Date & Time
  description: Documentation for the Date & Time node in n8n, a workflow automation platform. Includes guidance on usage, and links to examples.
  contentType: [integration, reference]
  priority: high
  ---

  # Date & Time

  The Date & Time node manipulates date and time data and convert it to different formats.

  --8<-- "_snippets/integrations/builtin/core-nodes/schedule/timezone-settings.md"

  /// note | Date and time in other nodes
  You can work with data and time in the Code node, and in expressions in any node. n8n supports Luxon to help work with date and time in JavaScript. Refer to [Date and time with Luxon](/code/cookbook/luxon.md) for more information.
  ///

  ## Operations

  * **Add to a Date**: Add a specified amount of time to a date.
  * **Extract Part of a Date**: Extract part of a date, such as the year, month, or day.
  * **Format a Date**: Transform a date's format to a new format using preset options or a custom expression.
  * **Get Current Date**: Get the current date and choose whether to include the current time or not. Useful for triggering other flows and conditional logic.
  * **Get Time Between Dates**: Calculate the amount of time in specific units between two dates.
  * **Round a Date**: Round a date up or down to the nearest unit of your choice, such as month, day, or hour.
  * **Subtract From a Date**: Subtract a specified amount of time from a date.

  Refer to the sections below for parameters and options specific to each operation.

  ## Add to a Date

  Configure the node for this operation using these parameters:

  * **Date to Add To**: Enter the date you want to change.
  * **Time Unit to Add**: Select the time unit for the **Duration** parameter.
  * **Duration**: Enter the number of time units to add to the date.
  * **Output Field Name**: Enter the name of the field to output the new date to.

  ### Add to a Date options

  This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.

  ## Extract Part of a Date

  Configure the node for this operation using these parameters:

  * **Date**: Enter the date you want to round or extract part of.
  * **Part**: Select the part of the date you want to extract. Choose from:
      * **Year**
      * **Month**
      * **Week**
      * **Day**
      * **Hour**
      * **Minute**
      * **Second**
  * **Output Field Name**: Enter the name of the field to output the extracted date part to.

  ### Extract Part of a Date options

  This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.

  ## Format a Date

  Configure the node for this operation using these parameters:

  * **Date**: Enter the date you want to format.
  * **Format**: Select the format you want to change the date to. Choose from:
      * **Custom Format**: Enter your own custom format using Luxon's [special tokens](https://moment.github.io/luxon/#/formatting?id=table-of-tokens){:target=_blank .external-link}. Tokens are case-sensitive.
      * **MM/DD/YYYY**: For `4 September 1986`, this formats the date as `09/04/1986`.
      * **YYYY/MM/DD**: For `4 September 1986`, this formats the date as `1986/09/04`.
      * **MMMM DD YYYY**: For `4 September 1986`, this formats the date as `September 04 1986`.
      * **MM-DD-YYYY**: For `4 September 1986`, this formats the date as `09-04-1986`.
      * **YYYY-MM-DD**: For `4 September 1986`, this formats the date as `1986-09-04`.
  * **Output Field Name**: Enter the name of the field to output the formatted date to.

  ### Format a Date options

  This operation includes these options:

  * **Include Input Fields**: If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.
  * **From Date Format**: If the node isn't recognizing the **Date** format correctly, enter the format for that **Date** here so the node can process it properly. Use Luxon's [special tokens](https://moment.github.io/luxon/#/formatting?id=table-of-tokens){:target=_blank .external-link} to enter the format. Tokens are case-sensitive
  * **Use Workflow Timezone**: Whether to use the input's time zone (turned off) or the workflow's timezone (turned on).

  ## Get Current Date

  Configure the node for this operation using these parameters:

  * **Include Current Time**: Choose whether to include the current time (turned on) or to set the time to midnight (turned off).
  * **Output Field Name**: Enter the name of the field to output the current date to.

  ### Get Current Date options

  This operation includes these options:

  * **Include Input Fields**: If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.
  * **Timezone**: Set the timezone to use. If left blank, the node uses the n8n instance's timezone.

  /// note | +00:00 timezone
  Use `GMT` for +00:00 timezone.
  ///

  ## Get Time Between Dates

  Configure the node for this operation using these parameters:

  * **Start Date**: Enter the earlier date you want to compare.
  * **End Date**: Enter the later date you want to compare.
  * **Units**: Select the units you want to calculate the time between. You can include multiple units. Choose from:
      * **Year**
      * **Month**
      * **Week**
      * **Day**
      * **Hour**
      * **Minute**
      * **Second**
      * **Millisecond**
  * **Output Field Name**: Enter the name of the field to output the calculated time between to.

  ### Get Time Between Dates options

  The Get Time Between Dates operation includes the **Include Input Fields** option as well as an **Output as ISO String** option. If you leave this option off, each unit you selected will return its own time difference calculation, for example:

      timeDifference
      years : 1
      months : 3
      days : 13

  If you turn on the **Output as ISO String** option, the node formats the output as a single ISO duration string, for example: `P1Y3M13D`.

  ISO duration format displays a format as `P<n>Y<n>M<n>DT<n>H<n>M<n>S`. `<n>` is the number for the unit after it.

  * P = period (duration). It begins all ISO duration strings.
  * Y = years
  * M = months
  * W = weeks
  * D = days
  * T = delineator between dates and times, used to avoid confusion between months and minutes
  * H = hours
  * M = minutes
  * S = seconds

  Milliseconds don't get their own unit, but instead are decimal seconds. For example, 2.1 milliseconds is `0.0021S`.

  ## Round a Date

  Configure the node for this operation using these parameters:

  * **Date**: Enter the date you'd like to round.
  * **Mode**: Choose whether to **Round Down** or **Round Up**.
  * **To Nearest**: Select the unit you'd like to round to. Choose from:
      * **Year**
      * **Month**
      * **Week**
      * **Day**
      * **Hour**
      * **Minute**
      * **Second**
  * **Output Field Name**: Enter the name of the field to output the rounded date to.

  ### Round a Date options

  This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.

  ## Subtract From a Date

  Configure the node for this operation using these parameters:

  * **Date to Subtract From**: Enter the date you'd like to subtract from.
  * **Time Unit to Subtract**: Select the unit for the **Duration** amount you want to subtract.
  * **Duration**: Enter the amount of the time units you want to subtract from the **Date to Subtract From**.
  * **Output Field Name**: Enter the name of the field to output the rounded date to.

  ### Subtract From a Date options

  This operation has one option: **Include Input Fields**. If you'd like to include all of the input fields in the output, turn this option on. If turned off, only the **Output Field Name** and its contents are output.

  ## Templates and examples

  <!-- see https://www.notion.so/n8n/Pull-in-templates-for-the-integrations-pages-37c716837b804d30a33b47475f6e3780 -->
  [[ templatesWidget(page.title, 'date-and-time') ]]

  ## Related resources

  The Date & Time node uses [Luxon](https://moment.github.io/luxon){:target=_blank .external-link}. You can also use Luxon in the [Code](/code/code-node.md) node and [expressions](/code/expressions.md). Refer to [Date and time with Luxon](/code/cookbook/luxon.md) for more information.

  ### Supported date formats

  n8n supports all date formats [supported by Luxon](https://moment.github.io/luxon/#/formatting?id=table-of-tokens){:target=_blank .external-link}. Tokens are case-sensitive.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"8a322602-0464-44e8-ae8a-8675358e452c","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"91f37ccc70cdbd5c48062c41ba7098a0f5a8bca14bedf6fd00255b541805b5e9"}}


node_type: n8n-nodes-base.CrateDb
name: CrateDb
display_name: CrateDB
description: Add and update data in CrateDB
category: Other
code_hash: 704a03f54931b635bbfaf8d0beb88dca10188c162ebc6170338ec17dfbecd649
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/cratedb
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CrateDb = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const genericFunctions_1 = require("../Postgres/v1/genericFunctions");
  const pg_promise_1 = __importDefault(require("pg-promise"));
  class CrateDb {
      constructor() {
          this.description = {
              displayName: 'CrateDB',
              name: 'crateDb',
              icon: 'file:cratedb.png',
              group: ['input'],
              version: 1,
              description: 'Add and update data in CrateDB',
              defaults: {
                  name: 'CrateDB',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'crateDb',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Execute Query',
                              value: 'executeQuery',
                              description: 'Execute an SQL query',
                              action: 'Execute a SQL query',
                          },
                          {
                              name: 'Insert',
                              value: 'insert',
                              description: 'Insert rows in database',
                              action: 'Insert rows in database',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update rows in database',
                              action: 'Update rows in database',
                          },
                      ],
                      default: 'insert',
                  },
                  {
                      displayName: 'Query',
                      name: 'query',
                      type: 'string',
                      noDataExpression: true,
                      typeOptions: {
                          editor: 'sqlEditor',
                          rows: 5,
                          sqlDialect: 'PostgreSQL',
                      },
                      displayOptions: {
                          show: {
                              operation: ['executeQuery'],
                          },
                      },
                      default: '',
                      placeholder: 'SELECT id, name FROM product WHERE quantity > $1 AND price <= $2',
                      required: true,
                      description: 'The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.',
                  },
                  {
                      displayName: 'Schema',
                      name: 'schema',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: 'doc',
                      required: true,
                      description: 'Name of the schema the table belongs to',
                  },
                  {
                      displayName: 'Table',
                      name: 'table',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the table in which to insert data to',
                  },
                  {
                      displayName: 'Columns',
                      name: 'columns',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert'],
                          },
                      },
                      default: '',
                      placeholder: 'id,name,description',
                      description: 'Comma-separated list of the properties which should used as columns for the new rows',
                  },
                  {
                      displayName: 'Schema',
                      name: 'schema',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: 'doc',
                      required: true,
                      description: 'Name of the schema the table belongs to',
                  },
                  {
                      displayName: 'Table',
                      name: 'table',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'Name of the table in which to update data in',
                  },
                  {
                      displayName: 'Update Key',
                      name: 'updateKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: 'id',
                      required: true,
                      description: 'Comma-separated list of the properties which decides which rows in the database should be updated. Normally that would be "id".',
                  },
                  {
                      displayName: 'Columns',
                      name: 'columns',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      default: '',
                      placeholder: 'name,description',
                      description: 'Comma-separated list of the properties which should used as columns for rows to update',
                  },
                  {
                      displayName: 'Return Fields',
                      name: 'returnFields',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['insert', 'update'],
                          },
                      },
                      default: '*',
                      description: 'Comma-separated list of the fields that the operation will return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      options: [
                          {
                              displayName: 'Mode',
                              name: 'mode',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Independently',
                                      value: 'independently',
                                      description: 'Execute each query independently',
                                  },
                                  {
                                      name: 'Multiple Queries',
                                      value: 'multiple',
                                      description: '<b>Default</b>. Sends multiple queries at once to database.',
                                  },
                              ],
                              default: 'multiple',
                              description: 'The way queries should be sent to database. Can be used in conjunction with <b>Continue on Fail</b>. See <a href="https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.cratedb/">the docs</a> for more examples.',
                          },
                          {
                              displayName: 'Query Parameters',
                              name: 'queryParams',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['executeQuery'],
                                  },
                              },
                              default: '',
                              placeholder: 'quantity,price',
                              description: 'Comma-separated list of properties which should be used as query parameters',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          var _a;
          const credentials = await this.getCredentials('crateDb');
          const pgp = (0, pg_promise_1.default)();
          const config = {
              host: credentials.host,
              port: credentials.port,
              database: credentials.database,
              user: credentials.user,
              password: credentials.password,
              ssl: !['disable', undefined].includes(credentials.ssl),
              sslmode: credentials.ssl || 'disable',
          };
          const db = pgp(config);
          let returnItems = [];
          const items = this.getInputData();
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'executeQuery') {
              const queryResult = await genericFunctions_1.pgQueryV2.call(this, pgp, db, items, this.continueOnFail(), {
                  resolveExpression: true,
              });
              returnItems = this.helpers.returnJsonArray(queryResult);
          }
          else if (operation === 'insert') {
              const insertData = await (0, genericFunctions_1.pgInsert)(this.getNodeParameter, pgp, db, items, this.continueOnFail());
              for (let i = 0; i < insertData.length; i++) {
                  returnItems.push({
                      json: insertData[i],
                  });
              }
          }
          else if (operation === 'update') {
              const additionalFields = this.getNodeParameter('additionalFields', 0);
              const mode = (_a = additionalFields.mode) !== null && _a !== void 0 ? _a : 'multiple';
              if (mode === 'independently') {
                  const updateItems = await (0, genericFunctions_1.pgUpdate)(this.getNodeParameter, pgp, db, items, this.continueOnFail());
                  returnItems = this.helpers.returnJsonArray(updateItems);
              }
              else if (mode === 'multiple') {
                  const table = this.getNodeParameter('table', 0);
                  const schema = this.getNodeParameter('schema', 0);
                  const updateKeys = this.getNodeParameter('updateKey', 0)
                      .split(',')
                      .map((column) => column.trim());
                  const columns = this.getNodeParameter('columns', 0)
                      .split(',')
                      .map((column) => column.trim());
                  const queryColumns = columns.slice();
                  updateKeys.forEach((updateKey) => {
                      if (!queryColumns.includes(updateKey)) {
                          columns.unshift(updateKey);
                          queryColumns.unshift('?' + updateKey);
                      }
                  });
                  const cs = new pgp.helpers.ColumnSet(queryColumns, { table: { table, schema } });
                  const where = ' WHERE ' +
                      updateKeys
                          .map((updateKey) => pgp.as.name(updateKey) + ' = ${' + updateKey + '}')
                          .join(' AND ');
                  const returning = (0, genericFunctions_1.generateReturning)(pgp, this.getNodeParameter('returnFields', 0));
                  const queries = [];
                  for (let i = 0; i < items.length; i++) {
                      const itemCopy = (0, genericFunctions_1.getItemCopy)(items[i], columns);
                      queries.push(pgp.helpers.update(itemCopy, cs) +
                          pgp.as.format(where, itemCopy) +
                          returning);
                  }
                  await db.multi(pgp.helpers.concat(queries));
                  returnItems = this.helpers.returnJsonArray((0, genericFunctions_1.getItemsCopy)(items, columns));
              }
          }
          else {
              await db.$pool.end();
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`);
          }
          await db.$pool.end();
          return [returnItems];
      }
  }
  exports.CrateDb = CrateDb;
  //# sourceMappingURL=CrateDb.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: CrateDB credentials
  description: Documentation for CrateDB credentials. Use these credentials to authenticate CrateDB in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # CrateDB credentials

  You can use these credentials to authenticate the following nodes:

  - [CrateDB](/integrations/builtin/app-nodes/n8n-nodes-base.cratedb.md)

  ## Prerequisites

  An available instance of CrateDB. 

  ## Supported authentication methods

  - account connection

  ## Related resources

  Refer to [CrateDB's documentation](https://cratedb.com/docs/crate/reference/en/latest/){:target=_blank .external-link} for more information about the service.

  ## Using account connection

  To configure this credential, you'll need:

  - Your **Host** name
  - Your **Database** name
  - A **User** name
  - A user **Password**
  - To set the **SSL** parameter. Refer to the [CrateDB Secured Communications (SSL/TLS) documentation](https://cratedb.com/docs/crate/reference/en/5.7/admin/ssl.html#admin-ssl){:target=_blank .external-link} for more information. The options n8n supports are:
      - Allow 
      - Disable
      - Require
  - A **Port** number

  Refer to the [Connect to a CrateDB cluster documentation](https://cratedb.com/docs/crate/clients-tools/en/latest/connect/){:target=_blank .external-link} for detailed instructions on these fields and their default values.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"6f08ea0b-3069-420b-a029-cc9935f2ed74","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"c81a1b562f499937553413b3d5c026419a8eda297ab13022497e1d8e8cf02a13"}}


node_type: n8n-nodes-base.CustomerIo
name: CustomerIo
display_name: Customer.io
description: Consume Customer.io API
category: Other
code_hash: cea979a578e3bfc8f652d96a2b0de3466bef19f7a53deab9ce49df57f9137c63
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/customerio
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:20
updated_at: 2025-06-08 08:05:20
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.CustomerIo = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const CampaignDescription_1 = require("./CampaignDescription");
  const CustomerDescription_1 = require("./CustomerDescription");
  const EventDescription_1 = require("./EventDescription");
  const SegmentDescription_1 = require("./SegmentDescription");
  class CustomerIo {
      constructor() {
          this.description = {
              displayName: 'Customer.io',
              name: 'customerIo',
              icon: 'file:customerio.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Customer.io API',
              defaults: {
                  name: 'Customer.io',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'customerIoApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Customer',
                              value: 'customer',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Campaign',
                              value: 'campaign',
                          },
                          {
                              name: 'Segment',
                              value: 'segment',
                          },
                      ],
                      default: 'customer',
                  },
                  ...CampaignDescription_1.campaignOperations,
                  ...CampaignDescription_1.campaignFields,
                  ...CustomerDescription_1.customerOperations,
                  ...CustomerDescription_1.customerFields,
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...SegmentDescription_1.segmentOperations,
                  ...SegmentDescription_1.segmentFields,
              ],
          };
      }
      async execute() {
          const returnData = [];
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          const body = {};
          let responseData;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'campaign') {
                      if (operation === 'get') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          const endpoint = `/campaigns/${campaignId}`;
                          responseData = await GenericFunctions_1.customerIoApiRequest.call(this, 'GET', endpoint, body, 'beta');
                          responseData = responseData.campaign;
                      }
                      if (operation === 'getAll') {
                          const endpoint = '/campaigns';
                          responseData = await GenericFunctions_1.customerIoApiRequest.call(this, 'GET', endpoint, body, 'beta');
                          responseData = responseData.campaigns;
                      }
                      if (operation === 'getMetrics') {
                          const campaignId = this.getNodeParameter('campaignId', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              const period = this.getNodeParameter('period', i);
                              let endpoint = `/campaigns/${campaignId}/metrics`;
                              if (period !== 'days') {
                                  endpoint = `${endpoint}?period=${period}`;
                              }
                              if (additionalFields.steps) {
                                  body.steps = additionalFields.steps;
                              }
                              if (additionalFields.type) {
                                  if (additionalFields.type === 'urbanAirship') {
                                      additionalFields.type = 'urban_airship';
                                  }
                                  else {
                                      body.type = additionalFields.type;
                                  }
                              }
                              responseData = await GenericFunctions_1.customerIoApiRequest.call(this, 'GET', endpoint, body, 'beta');
                              responseData = responseData.metric;
                          }
                      }
                  }
                  if (resource === 'customer') {
                      if (operation === 'upsert') {
                          const id = this.getNodeParameter('id', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.customProperties) {
                                  const data = {};
                                  additionalFields.customProperties.customProperty.map((property) => {
                                      data[property.key] = property.value;
                                  });
                                  body.data = data;
                              }
                              if (additionalFields.email) {
                                  body.email = additionalFields.email;
                              }
                              if (additionalFields.createdAt) {
                                  body.created_at = new Date(additionalFields.createdAt).getTime() / 1000;
                              }
                          }
                          const endpoint = `/customers/${id}`;
                          responseData = await GenericFunctions_1.customerIoApiRequest.call(this, 'PUT', endpoint, body, 'tracking');
                          responseData = Object.assign({ id }, body);
                      }
                      if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          body.id = id;
                          const endpoint = `/customers/${id}`;
                          await GenericFunctions_1.customerIoApiRequest.call(this, 'DELETE', endpoint, body, 'tracking');
                          responseData = {
                              success: true,
                          };
                      }
                  }
                  if (resource === 'event') {
                      if (operation === 'track') {
                          const customerId = this.getNodeParameter('customerId', i);
                          const eventName = this.getNodeParameter('eventName', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          body.name = eventName;
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              const data = {};
                              if (additionalFields.customAttributes) {
                                  additionalFields.customAttributes.customAttribute.map((property) => {
                                      data[property.key] = property.value;
                                  });
                              }
                              if (additionalFields.type) {
                                  data.type = additionalFields.type;
                              }
                              body.data = data;
                          }
                          const endpoint = `/customers/${customerId}/events`;
                          await GenericFunctions_1.customerIoApiRequest.call(this, 'POST', endpoint, body, 'tracking');
                          responseData = {
                              success: true,
                          };
                      }
                      if (operation === 'trackAnonymous') {
                          const eventName = this.getNodeParameter('eventName', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          body.name = eventName;
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              const data = {};
                              if (additionalFields.customAttributes) {
                                  additionalFields.customAttributes.customAttribute.map((property) => {
                                      data[property.key] = property.value;
                                  });
                              }
                              body.data = data;
                          }
                          const endpoint = '/events';
                          await GenericFunctions_1.customerIoApiRequest.call(this, 'POST', endpoint, body, 'tracking');
                          responseData = {
                              success: true,
                          };
                      }
                  }
                  if (resource === 'segment') {
                      const segmentId = this.getNodeParameter('segmentId', i);
                      const customerIds = this.getNodeParameter('customerIds', i);
                      body.id = segmentId;
                      body.ids = customerIds.split(',');
                      let endpoint = '';
                      if (operation === 'add') {
                          endpoint = `/segments/${segmentId}/add_customers`;
                      }
                      else {
                          endpoint = `/segments/${segmentId}/remove_customers`;
                      }
                      responseData = await GenericFunctions_1.customerIoApiRequest.call(this, 'POST', endpoint, body, 'tracking');
                      responseData = {
                          success: true,
                      };
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.CustomerIo = CustomerIo;
  //# sourceMappingURL=CustomerIo.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: Customer.io credentials
  description: Documentation for Customer.io credentials. Use these credentials to authenticate Customer.io in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---

  # Customer.io credentials

  You can use these credentials to authenticate the following nodes with Customer.io.

  - [Customer.io](/integrations/builtin/app-nodes/n8n-nodes-base.customerio.md)
  - [Customer.io Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.customeriotrigger.md)

  ## Prerequisites

  Create a [Customer.io](https://customer.io/) account.

  ## Supported authentication methods

  - API Key

  ## Related resources

  Refer to [Customer.io's summary API documentation](https://customer.io/docs/api/?api=journeys){:target=_blank .external-link} for more information about the service.

  For detailed API reference documentation for each API, refer to the [Track API documentation](https://customer.io/docs/api/track/){:target=_blank .external-link} and the [App API documentation](https://customer.io/docs/api/app/){:target=_blank .external-link}.

  ## Using API key

  To configure this credential, you'll need:

  - A **Tracking API Key**: For use with the [Track API](https://customer.io/docs/api/track/){:target=_blank .external-link} at `https://track.customer.io/api/v1/`. See the FAQs below for more details.
  - Your **Region**: Customer.io uses different API subdomains depending on the region you select. Options include:
      - **Global region**: Keeps the default URLs for both APIs; for use in all non-EU countries/regions.
      - **EU region**: Adjusts the Track API subdomain to `track-eu` and the App API subdomain to `api-eu`; only use this if you are in the EU.
  - A **Tracking Site ID**: Required with your **Tracking API Key**
  - An **App API Key**: For use with the [App API](https://customer.io/docs/api/app/){:target=_blank .external-link} at `https://api.customer.io/v1/api/`. See the FAQs below for more details.

  Refer to the [Customer.io Finding and managing your API credentials documentation](https://customer.io/docs/accounts-and-workspaces/managing-credentials/){:target=_blank .external-link} for instructions on creating both Tracking API and App API keys.

  ## Why you need a Tracking API Key and an App API Key

  Customer.io has two different API endpoints and generates and stores the keys for each slightly differently:

  - The [Track API](https://customer.io/docs/api/track/){:target=_blank .external-link} at `https://track.customer.io/api/v1/`
  - The [App API](https://customer.io/docs/api/app/){:target=_blank .external-link} at `https://api.customer.io/v1/api/`

  The Track API requires a Tracking Site ID; the App API doesn't.

  Based on the operation you want to perform, n8n uses the correct API key and its corresponding endpoint.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"784e302c-e0c4-4558-9f6a-7ddfd49ae9ae","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"44b00539db722309d80f84a7de170b52401f0ffbc4ce9809d3059b972fa73f5e"}}


