# nodes

node_type: n8n-nodes-base.Npm
name: Npm
display_name: Npm
description: Consume NPM registry API
category: Other
code_hash: 89679c6261436e1c5088d99d5aa7ab0d04d15aff72f28f314d46904bc381601a
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/npm
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Npm = void 0;
  const PackageDescription_1 = require("./PackageDescription");
  const DistTagDescription_1 = require("./DistTagDescription");
  class Npm {
      constructor() {
          this.description = {
              displayName: 'Npm',
              name: 'npm',
              icon: 'file:npm.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
              description: 'Consume NPM registry API',
              defaults: {
                  name: 'npm',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'npmApi',
                      required: false,
                  },
              ],
              requestDefaults: {
                  baseURL: '={{ $credentials.registryUrl }}',
              },
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Package',
                              value: 'package',
                          },
                          {
                              name: 'Distribution Tag',
                              value: 'distTag',
                          },
                      ],
                      default: 'package',
                  },
                  ...PackageDescription_1.packageOperations,
                  ...PackageDescription_1.packageFields,
                  ...DistTagDescription_1.distTagOperations,
                  ...DistTagDescription_1.distTagFields,
              ],
          };
      }
  }
  exports.Npm = Npm;
  //# sourceMappingURL=Npm.node.js.map

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

  # npm credentials

  You can use these credentials to authenticate the following nodes:

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

  ## Prerequisites

  Create an [npm](https://www.npmjs.com/){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API access token

  ## Related resources

  Refer to [npm's external integrations documentation](https://docs.npmjs.com/integrations/integrating-npm-with-external-services){:target=_blank .external-link} for more information about the service.

  ## Using API access token

  To configure this credential, you'll need:

  - An **Access Token**: Create an access token by selecting **Access Tokens** from your profile menu. Refer to [npm's Creating and viewing access tokens documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens){:target=_blank .external-link} for more detailed instructions.
  - A **Registry URL**: If you're using a custom npm registry, update the **Registry URL** to that custom registry. Otherwise, keep the public registry value.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"114167c6-c3bd-4b8f-9bde-0c2f7846dfee","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"e6d7f0a5a816618c9271360943661f81ed59c7606cf9dcb070efb8a0bf6991b1"}}


node_type: n8n-nodes-base.Onfleet
name: Onfleet
display_name: Onfleet
description: Consume Onfleet API
category: Other
code_hash: 38b9adce484581a415e2163aa3d1f339eca8901c9bf4f36996647abb90d58f75
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/onfleet
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Onfleet = void 0;
  const TaskDescription_1 = require("./descriptions/TaskDescription");
  const DestinationDescription_1 = require("./descriptions/DestinationDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  const RecipientDescription_1 = require("./descriptions/RecipientDescription");
  const OrganizationDescription_1 = require("./descriptions/OrganizationDescription");
  const AdministratorDescription_1 = require("./descriptions/AdministratorDescription");
  const HubDescription_1 = require("./descriptions/HubDescription");
  const WorkerDescription_1 = require("./descriptions/WorkerDescription");
  const ContainerDescription_1 = require("./descriptions/ContainerDescription");
  const TeamDescription_1 = require("./descriptions/TeamDescription");
  const Onfleet_1 = require("./Onfleet");
  class Onfleet {
      constructor() {
          this.description = {
              displayName: 'Onfleet',
              name: 'onfleet',
              icon: 'file:Onfleet.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Onfleet API',
              defaults: {
                  name: 'Onfleet',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'onfleetApi',
                      required: true,
                      testedBy: 'onfleetApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Admin',
                              value: 'admin',
                          },
                          {
                              name: 'Container',
                              value: 'container',
                          },
                          {
                              name: 'Destination',
                              value: 'destination',
                          },
                          {
                              name: 'Hub',
                              value: 'hub',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Recipient',
                              value: 'recipient',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                          {
                              name: 'Team',
                              value: 'team',
                          },
                          {
                              name: 'Worker',
                              value: 'worker',
                          },
                      ],
                      default: 'task',
                      description: 'The resource to perform operations on',
                  },
                  ...AdministratorDescription_1.adminOperations,
                  ...AdministratorDescription_1.adminFields,
                  ...ContainerDescription_1.containerOperations,
                  ...ContainerDescription_1.containerFields,
                  ...DestinationDescription_1.destinationOperations,
                  ...DestinationDescription_1.destinationFields,
                  ...HubDescription_1.hubOperations,
                  ...HubDescription_1.hubFields,
                  ...OrganizationDescription_1.organizationOperations,
                  ...OrganizationDescription_1.organizationFields,
                  ...RecipientDescription_1.recipientOperations,
                  ...RecipientDescription_1.recipientFields,
                  ...TaskDescription_1.taskOperations,
                  ...TaskDescription_1.taskFields,
                  ...TeamDescription_1.teamOperations,
                  ...TeamDescription_1.teamFields,
                  ...WorkerDescription_1.workerOperations,
                  ...WorkerDescription_1.workerFields,
              ],
          };
          this.methods = {
              credentialTest: {
                  async onfleetApiTest(credential) {
                      const credentials = credential.data;
                      const options = {
                          headers: {
                              'Content-Type': 'application/json',
                              'User-Agent': 'n8n-onfleet',
                          },
                          auth: {
                              user: credentials.apiKey,
                              pass: '',
                          },
                          method: 'GET',
                          uri: 'https://onfleet.com/api/v2/auth/test',
                          json: true,
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: `Auth settings are not valid: ${error}`,
                          };
                      }
                  },
              },
              loadOptions: GenericFunctions_1.resourceLoaders,
          };
      }
      async execute() {
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          const items = this.getInputData();
          const operations = {
              task: Onfleet_1.Onfleet.executeTaskOperations,
              destination: Onfleet_1.Onfleet.executeDestinationOperations,
              organization: Onfleet_1.Onfleet.executeOrganizationOperations,
              admin: Onfleet_1.Onfleet.executeAdministratorOperations,
              recipient: Onfleet_1.Onfleet.executeRecipientOperations,
              hub: Onfleet_1.Onfleet.executeHubOperations,
              worker: Onfleet_1.Onfleet.executeWorkerOperations,
              webhook: Onfleet_1.Onfleet.executeWebhookOperations,
              container: Onfleet_1.Onfleet.executeContainerOperations,
              team: Onfleet_1.Onfleet.executeTeamOperations,
          };
          const responseData = await operations[resource].call(this, `${resource}s`, operation, items);
          return [this.helpers.returnJsonArray(responseData)];
      }
  }
  exports.Onfleet = Onfleet;
  //# sourceMappingURL=Onfleet.node.js.map

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

  # Onfleet credentials

  You can use these credentials to authenticate the following nodes:

  - [Onfleet](/integrations/builtin/app-nodes/n8n-nodes-base.onfleet.md)
  - [Onfleet Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.onfleettrigger.md)

  ## Prerequisites

  Create an [Onfleet](https://onfleet.com/){:target=_blank .external-link} administrator account.

  # Supported authentication methods

  - API key

  ## Related resources

  Refer to [Onfleet's API documentation](https://docs.onfleet.com/reference/introduction){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - An **API key**: To create an API key, log into your organization's administrator account. Select **Settings > API & Webhooks**, then select **+** to create a new key. Refer to Onfleet's [Creating an API key documentation](https://support.onfleet.com/hc/en-us/articles/360045763292-API) for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"8889c574-a20a-48b4-b388-69673560dce2","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"900bdf716e3bc5e106ede5e47efeb310cdb3cdd131299c265fbac8678faee6b3"}}


node_type: n8n-nodes-base.Odoo
name: Odoo
display_name: Odoo
description: Consume Odoo API
category: Other
code_hash: 2e1601049a43d1b157fc57aa76bb1f2fb632da84656f0641b0555435371afe55
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/odoo
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Odoo = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const change_case_1 = require("change-case");
  class Odoo {
      constructor() {
          this.description = {
              displayName: 'Odoo',
              name: 'odoo',
              icon: 'file:odoo.svg',
              group: ['transform'],
              version: 1,
              description: 'Consume Odoo API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Odoo',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'odooApi',
                      required: true,
                      testedBy: 'odooApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      default: 'contact',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                          {
                              name: 'Custom Resource',
                              value: 'custom',
                          },
                          {
                              name: 'Note',
                              value: 'note',
                          },
                          {
                              name: 'Opportunity',
                              value: 'opportunity',
                          },
                      ],
                  },
                  ...descriptions_1.customResourceOperations,
                  ...descriptions_1.customResourceDescription,
                  ...descriptions_1.opportunityOperations,
                  ...descriptions_1.opportunityDescription,
                  ...descriptions_1.contactOperations,
                  ...descriptions_1.contactDescription,
                  ...descriptions_1.noteOperations,
                  ...descriptions_1.noteDescription,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getModelFields() {
                      let resource;
                      resource = this.getCurrentNodeParameter('resource');
                      if (resource === 'custom') {
                          resource = this.getCurrentNodeParameter('customResource');
                          if (!resource)
                              return [];
                      }
                      const credentials = await this.getCredentials('odooApi');
                      const url = credentials.url;
                      const username = credentials.username;
                      const password = credentials.password;
                      const db = (0, GenericFunctions_1.odooGetDBName)(credentials.db, url);
                      const userID = await GenericFunctions_1.odooGetUserID.call(this, db, username, password, url);
                      const responce = await GenericFunctions_1.odooGetModelFields.call(this, db, userID, password, resource, url);
                      const options = Object.values(responce).map((field) => {
                          const optionField = field;
                          let name = '';
                          try {
                              name = (0, change_case_1.capitalCase)(optionField.name);
                          }
                          catch (error) {
                              name = optionField.name;
                          }
                          return {
                              name,
                              value: optionField.name,
                              description: `name: ${optionField === null || optionField === void 0 ? void 0 : optionField.name}, type: ${optionField === null || optionField === void 0 ? void 0 : optionField.type} required: ${optionField === null || optionField === void 0 ? void 0 : optionField.required}`,
                          };
                      });
                      return options.sort((a, b) => { var _a; return ((_a = a.name) === null || _a === void 0 ? void 0 : _a.localeCompare(b.name)) || 0; });
                  },
                  async getModels() {
                      const credentials = await this.getCredentials('odooApi');
                      const url = credentials.url;
                      const username = credentials.username;
                      const password = credentials.password;
                      const db = (0, GenericFunctions_1.odooGetDBName)(credentials.db, url);
                      const userID = await GenericFunctions_1.odooGetUserID.call(this, db, username, password, url);
                      const body = {
                          jsonrpc: '2.0',
                          method: 'call',
                          params: {
                              service: 'object',
                              method: 'execute',
                              args: [
                                  db,
                                  userID,
                                  password,
                                  'ir.model',
                                  'search_read',
                                  [],
                                  ['name', 'model', 'modules'],
                              ],
                          },
                          id: Math.floor(Math.random() * 100),
                      };
                      const responce = (await GenericFunctions_1.odooJSONRPCRequest.call(this, body, url));
                      const options = responce.map((model) => {
                          return {
                              name: model.name,
                              value: model.model,
                              description: `model: ${model.model}<br> modules: ${model.modules}`,
                          };
                      });
                      return options;
                  },
                  async getStates() {
                      const credentials = await this.getCredentials('odooApi');
                      const url = credentials.url;
                      const username = credentials.username;
                      const password = credentials.password;
                      const db = (0, GenericFunctions_1.odooGetDBName)(credentials.db, url);
                      const userID = await GenericFunctions_1.odooGetUserID.call(this, db, username, password, url);
                      const body = {
                          jsonrpc: '2.0',
                          method: 'call',
                          params: {
                              service: 'object',
                              method: 'execute',
                              args: [db, userID, password, 'res.country.state', 'search_read', [], ['id', 'name']],
                          },
                          id: Math.floor(Math.random() * 100),
                      };
                      const responce = (await GenericFunctions_1.odooJSONRPCRequest.call(this, body, url));
                      const options = responce.map((state) => {
                          return {
                              name: state.name,
                              value: state.id,
                          };
                      });
                      return options.sort((a, b) => { var _a; return ((_a = a.name) === null || _a === void 0 ? void 0 : _a.localeCompare(b.name)) || 0; });
                  },
                  async getCountries() {
                      const credentials = await this.getCredentials('odooApi');
                      const url = credentials.url;
                      const username = credentials.username;
                      const password = credentials.password;
                      const db = (0, GenericFunctions_1.odooGetDBName)(credentials.db, url);
                      const userID = await GenericFunctions_1.odooGetUserID.call(this, db, username, password, url);
                      const body = {
                          jsonrpc: '2.0',
                          method: 'call',
                          params: {
                              service: 'object',
                              method: 'execute',
                              args: [db, userID, password, 'res.country', 'search_read', [], ['id', 'name']],
                          },
                          id: Math.floor(Math.random() * 100),
                      };
                      const responce = (await GenericFunctions_1.odooJSONRPCRequest.call(this, body, url));
                      const options = responce.map((country) => {
                          return {
                              name: country.name,
                              value: country.id,
                          };
                      });
                      return options.sort((a, b) => { var _a; return ((_a = a.name) === null || _a === void 0 ? void 0 : _a.localeCompare(b.name)) || 0; });
                  },
              },
              credentialTest: {
                  async odooApiTest(credential) {
                      const credentials = credential.data;
                      try {
                          const body = {
                              jsonrpc: '2.0',
                              method: 'call',
                              params: {
                                  service: 'common',
                                  method: 'login',
                                  args: [
                                      (0, GenericFunctions_1.odooGetDBName)(credentials === null || credentials === void 0 ? void 0 : credentials.db, credentials === null || credentials === void 0 ? void 0 : credentials.url),
                                      credentials === null || credentials === void 0 ? void 0 : credentials.username,
                                      credentials === null || credentials === void 0 ? void 0 : credentials.password,
                                  ],
                              },
                              id: Math.floor(Math.random() * 100),
                          };
                          const options = {
                              headers: {
                                  'User-Agent': 'n8n',
                                  Connection: 'keep-alive',
                                  Accept: '*/*',
                                  'Content-Type': 'application/json',
                              },
                              method: 'POST',
                              body,
                              uri: `${(credentials === null || credentials === void 0 ? void 0 : credentials.url).replace(/\/$/, '')}/jsonrpc`,
                              json: true,
                          };
                          const result = await this.helpers.request(options);
                          if (result.error || !result.result) {
                              return {
                                  status: 'Error',
                                  message: 'Credentials are not valid',
                              };
                          }
                          else if (result.error) {
                              return {
                                  status: 'Error',
                                  message: `Credentials are not valid: ${result.error.data.message}`,
                              };
                          }
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: `Settings are not valid: ${error}`,
                          };
                      }
                      return {
                          status: 'OK',
                          message: 'Authentication successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          let items = this.getInputData();
          items = (0, n8n_workflow_1.deepCopy)(items);
          const returnData = [];
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          const credentials = await this.getCredentials('odooApi');
          const url = credentials.url.replace(/\/$/, '');
          const username = credentials.username;
          const password = credentials.password;
          const db = (0, GenericFunctions_1.odooGetDBName)(credentials.db, url);
          const userID = await GenericFunctions_1.odooGetUserID.call(this, db, username, password, url);
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'contact') {
                      if (operation === 'create') {
                          let additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.address) {
                              const addressFields = additionalFields.address.value;
                              if (addressFields) {
                                  additionalFields = {
                                      ...additionalFields,
                                      ...addressFields,
                                  };
                              }
                              delete additionalFields.address;
                          }
                          const name = this.getNodeParameter('contactName', i);
                          const fields = {
                              name,
                              ...additionalFields,
                          };
                          responseData = await GenericFunctions_1.odooCreate.call(this, db, userID, password, resource, operation, url, fields);
                      }
                      if (operation === 'delete') {
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.odooDelete.call(this, db, userID, password, resource, operation, url, contactId);
                      }
                      if (operation === 'get') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const options = this.getNodeParameter('options', i);
                          const fields = options.fieldsList || [];
                          responseData = await GenericFunctions_1.odooGet.call(this, db, userID, password, resource, operation, url, contactId, fields);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          const fields = options.fieldsList || [];
                          if (returnAll) {
                              responseData = await GenericFunctions_1.odooGetAll.call(this, db, userID, password, resource, operation, url, undefined, fields);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.odooGetAll.call(this, db, userID, password, resource, operation, url, undefined, fields, limit);
                          }
                      }
                      if (operation === 'update') {
                          const contactId = this.getNodeParameter('contactId', i);
                          let updateFields = this.getNodeParameter('updateFields', i);
                          if (updateFields.address) {
                              const addressFields = updateFields.address.value;
                              if (addressFields) {
                                  updateFields = {
                                      ...updateFields,
                                      ...addressFields,
                                  };
                              }
                              delete updateFields.address;
                          }
                          responseData = await GenericFunctions_1.odooUpdate.call(this, db, userID, password, resource, operation, url, contactId, updateFields);
                      }
                  }
                  if (resource === 'custom') {
                      const customResource = this.getNodeParameter('customResource', i);
                      if (operation === 'create') {
                          const fields = this.getNodeParameter('fieldsToCreateOrUpdate', i);
                          responseData = await GenericFunctions_1.odooCreate.call(this, db, userID, password, customResource, operation, url, (0, GenericFunctions_1.processNameValueFields)(fields));
                      }
                      if (operation === 'delete') {
                          const customResourceId = this.getNodeParameter('customResourceId', i);
                          responseData = await GenericFunctions_1.odooDelete.call(this, db, userID, password, customResource, operation, url, customResourceId);
                      }
                      if (operation === 'get') {
                          const customResourceId = this.getNodeParameter('customResourceId', i);
                          const options = this.getNodeParameter('options', i);
                          const fields = options.fieldsList || [];
                          responseData = await GenericFunctions_1.odooGet.call(this, db, userID, password, customResource, operation, url, customResourceId, fields);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          const fields = options.fieldsList || [];
                          const filter = this.getNodeParameter('filterRequest', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.odooGetAll.call(this, db, userID, password, customResource, operation, url, filter, fields);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.odooGetAll.call(this, db, userID, password, customResource, operation, url, filter, fields, limit);
                          }
                      }
                      if (operation === 'update') {
                          const customResourceId = this.getNodeParameter('customResourceId', i);
                          const fields = this.getNodeParameter('fieldsToCreateOrUpdate', i);
                          responseData = await GenericFunctions_1.odooUpdate.call(this, db, userID, password, customResource, operation, url, customResourceId, (0, GenericFunctions_1.processNameValueFields)(fields));
                      }
                  }
                  if (resource === 'note') {
                      if (operation === 'create') {
                          const memo = this.getNodeParameter('memo', i);
                          const fields = {
                              memo,
                          };
                          responseData = await GenericFunctions_1.odooCreate.call(this, db, userID, password, resource, operation, url, fields);
                      }
                      if (operation === 'delete') {
                          const noteId = this.getNodeParameter('noteId', i);
                          responseData = await GenericFunctions_1.odooDelete.call(this, db, userID, password, resource, operation, url, noteId);
                      }
                      if (operation === 'get') {
                          const noteId = this.getNodeParameter('noteId', i);
                          const options = this.getNodeParameter('options', i);
                          const fields = options.fieldsList || [];
                          responseData = await GenericFunctions_1.odooGet.call(this, db, userID, password, resource, operation, url, noteId, fields);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          const fields = options.fieldsList || [];
                          if (returnAll) {
                              responseData = await GenericFunctions_1.odooGetAll.call(this, db, userID, password, resource, operation, url, undefined, fields);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.odooGetAll.call(this, db, userID, password, resource, operation, url, undefined, fields, limit);
                          }
                      }
                      if (operation === 'update') {
                          const noteId = this.getNodeParameter('noteId', i);
                          const memo = this.getNodeParameter('memo', i);
                          const fields = {
                              memo,
                          };
                          responseData = await GenericFunctions_1.odooUpdate.call(this, db, userID, password, resource, operation, url, noteId, fields);
                      }
                  }
                  if (resource === 'opportunity') {
                      if (operation === 'create') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const name = this.getNodeParameter('opportunityName', i);
                          const fields = {
                              name,
                              ...additionalFields,
                          };
                          responseData = await GenericFunctions_1.odooCreate.call(this, db, userID, password, resource, operation, url, fields);
                      }
                      if (operation === 'delete') {
                          const opportunityId = this.getNodeParameter('opportunityId', i);
                          responseData = await GenericFunctions_1.odooDelete.call(this, db, userID, password, resource, operation, url, opportunityId);
                      }
                      if (operation === 'get') {
                          const opportunityId = this.getNodeParameter('opportunityId', i);
                          const options = this.getNodeParameter('options', i);
                          const fields = options.fieldsList || [];
                          responseData = await GenericFunctions_1.odooGet.call(this, db, userID, password, resource, operation, url, opportunityId, fields);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          const fields = options.fieldsList || [];
                          if (returnAll) {
                              responseData = await GenericFunctions_1.odooGetAll.call(this, db, userID, password, resource, operation, url, undefined, fields);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.odooGetAll.call(this, db, userID, password, resource, operation, url, undefined, fields, limit);
                          }
                      }
                      if (operation === 'update') {
                          const opportunityId = this.getNodeParameter('opportunityId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          responseData = await GenericFunctions_1.odooUpdate.call(this, db, userID, password, resource, operation, url, opportunityId, updateFields);
                      }
                  }
                  if (responseData !== undefined) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Odoo = Odoo;
  //# sourceMappingURL=Odoo.node.js.map

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

  # Odoo credentials

  You can use these credentials to authenticate the following nodes:

  - [Odoo](/integrations/builtin/app-nodes/n8n-nodes-base.odoo.md)

  ## Supported authentication methods

  - API key (Recommended)
  - Password

  ## Related resources

  Refer to [Odoo's External API documentation](https://www.odoo.com/documentation/17.0/developer/reference/external_api.html){:target=_blank .external-link} for more information about the service.

  Refer to the Odoo [Getting Started tutorial](https://www.odoo.com/slides/getting-started-15){:target=_blank .external-link} if you're new to Odoo.

  ## Using API key

  To configure this credential, you'll need a user account on an [Odoo](https://www.odoo.com/){:target=_blank .external-link} database and:

  - Your **Site URL**
  - Your **Username**
  - An **API key**
  - Your **Database name**

  To set up the credential with an API key:

  1. Enter your Odoo server or site URL as the **Site URL**.
  2. Enter your **Username** as it's displayed on your **Change password** screen in Odoo.
  4. To use an API key, go to **Your Profile > Preferences > Account Security > Developer API Keys**.
      - If you don't have this option, you may need to upgrade your Odoo plan. Refer to [Required plan type](#required-plan-type) for more information.
  5. Select **New API Key**.
  6. Enter a **Description** for the key, like `n8n integration`.
  7. Select **Generate Key**.
  8. Copy the key and enter it as the **Password or API key** in your n8n credential.
  9. Enter your Odoo **Database name**, also known as the instance name.

  Refer to [Odoo API Keys](https://www.odoo.com/documentation/15.0/developer/reference/external_api.html?#api-keys){:target=_blank .external-link} for more information.

  ## Using password

  To configure this credential, you'll need a user account on an [Odoo](https://www.odoo.com/){:target=_blank .external-link} database and:

  - Your **Site URL**
  - Your **Username**
  - Your **Password**
  - Your **Database name**

  To set up the credential with a password:

  1. Enter your Odoo server or site URL as the **Site URL**.
  2. Enter your **Username** as it's displayed on your **Change password** screen in Odoo.
  3. To use a password, enter your user password in the **Password or API key** field.
  4. Enter your Odoo **Database name**, also known as the instance name.

  /// note | Password compatibility
  If you try a password credential and it doesn't work for a specific node function, try switching to an API key. Odoo requires an API key for certain modules or based on certain settings.
  ///

  ## Required plan type

  /// note | Required plan type
  Access to the external API is only available on a **Custom** Odoo plan. (The One App Free or Standard plans won't give you access.)

  Refer to [Odoo Pricing Plans](https://www.odoo.com/pricing-plan){:target=_blank .external-link} for more information.
  ///

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"f7f942be-5a28-4a48-b038-528ed53b246b","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"1117e4f6cdc59913b07213a54a6cd005e00793c90d84904f84ef0f821b57377f"}}


node_type: n8n-nodes-base.OpenAi
name: OpenAi
display_name: OpenAI
description: Consume Open AI
category: Other
code_hash: ab879a65a91c06570e906c166bce961a1f614a01acb649d549a4467e09dfc807
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/azureopenai
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.OpenAi = void 0;
  const ImageDescription_1 = require("./ImageDescription");
  const TextDescription_1 = require("./TextDescription");
  const ChatDescription_1 = require("./ChatDescription");
  class OpenAi {
      constructor() {
          this.description = {
              displayName: 'OpenAI',
              name: 'openAi',
              icon: 'file:openAi.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Open AI',
              defaults: {
                  name: 'OpenAI',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'openAiApi',
                      required: true,
                  },
              ],
              requestDefaults: {
                  ignoreHttpStatusErrors: true,
                  baseURL: 'https://api.openai.com',
              },
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Chat',
                              value: 'chat',
                          },
                          {
                              name: 'Image',
                              value: 'image',
                          },
                          {
                              name: 'Text',
                              value: 'text',
                          },
                      ],
                      default: 'text',
                  },
                  ...ChatDescription_1.chatOperations,
                  ...ChatDescription_1.chatFields,
                  ...ImageDescription_1.imageOperations,
                  ...ImageDescription_1.imageFields,
                  ...TextDescription_1.textOperations,
                  ...TextDescription_1.textFields,
              ],
          };
      }
  }
  exports.OpenAi = OpenAi;
  //# sourceMappingURL=OpenAi.node.js.map

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

  # Azure OpenAI credentials

  You can use these credentials to authenticate the following nodes:

  - [Chat Azure OpenAI](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatazureopenai.md)
  - [Embeddings Azure OpenAI](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.embeddingsazureopenai.md)

  ## Prerequisites

  - Create an [Azure](https://azure.microsoft.com){:target=_blank .external-link} subscription.
  - Access to Azure OpenAI within that subscription. You may need to [request access](https://aka.ms/oai/access){:target=_blank .external-link} if your organization doesn't yet have it.

  ## Supported authentication methods

  - API key
  - Azure Entra ID (OAuth2)

  ## Related resources

  Refer to [Azure OpenAI's API documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference){:target=_blank .external-link} for more information about the service.

  ## Using API key

  To configure this credential, you'll need:

  - A **Resource Name**: the **Name** you give the resource
  - An **API key**: **Key 1** works well. This can be accessed before deployment in **Keys and Endpoint**.
  - The **API Version** the credentials should use. See the [Azure OpenAI API preview lifecycle documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation){:target=_blank .external-link} for more information about API versioning in Azure OpenAI.

  To get the information above, [create and deploy an Azure OpenAI Service resource](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource){:target=_blank .external-link}.

  /// note | Model name for Azure OpenAI nodes
  Once you deploy the resource, use the **Deployment name** as the model name for the Azure OpenAI nodes where you're using this credential.
  ///

  ## Using Azure Entra ID (OAuth2)

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

  For self-hosted users, there are two main steps to configure OAuth2 from scratch:

  1. [Register an application](#register-an-application) with the Microsoft Identity Platform.
  2. [Generate a client secret](#generate-a-client-secret) for that application.

  Follow the detailed instructions for each step below. For more detail on the Microsoft OAuth2 web flow, refer to [Microsoft authentication and authorization basics](https://learn.microsoft.com/en-us/graph/auth/auth-concepts). 

  ### Register an application

  Register an application with the Microsoft Identity Platform:

  1. Open the [Microsoft Application Registration Portal](https://aka.ms/appregistrations).
  2. Select **Register an application**.
  3. Enter a **Name** for your app.
  4. In **Supported account types**, select **Accounts in any organizational directory (Any Azure AD directory - Multi-tenant) and personal Microsoft accounts (for example, Skype, Xbox)**.
  5. In **Register an application**:
      1. Copy the **OAuth Callback URL** from your n8n credential.
      2. Paste it into the **Redirect URI (optional)** field.
      3. Select **Select a platform** > **Web**.
  6. Select **Register** to finish creating your application.
  7. Copy the **Application (client) ID** and paste it into n8n as the **Client ID**.

  Refer to [Register an application with the Microsoft Identity Platform](https://learn.microsoft.com/en-us/graph/auth-register-app-v2) for more information.

  ### Generate a client secret

  With your application created, generate a client secret for it:

  1. On your Microsoft application page, select **Certificates & secrets** in the left navigation.
  1. In **Client secrets**, select **+ New client secret**.
  1. Enter a **Description** for your client secret, such as `n8n credential`.
  1. Select **Add**.
  1. Copy the **Secret** in the **Value** column.
  1. Paste it into n8n as the **Client Secret**.
  1. Select **Connect my account** in n8n to finish setting up the connection.
  1. Log in to your Microsoft account and allow the app to access your info.

  Refer to Microsoft's [Add credentials](https://learn.microsoft.com/en-us/graph/auth-register-app-v2#add-credentials) for more information on adding a client secret.

  ## Setting custom scopes

  Azure Entra ID credentials use the following scopes by default:

  * [`openid`](https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc#the-openid-scope)
  * [`offline_access`](https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc#the-offline_access-scope)
  * [`AccessReview.ReadWrite.All`](https://learn.microsoft.com/en-us/graph/permissions-reference#accessreviewreadwriteall)
  * [`Directory.ReadWrite.All`](https://learn.microsoft.com/en-us/graph/permissions-reference#directoryreadwriteall)
  * [`NetworkAccessPolicy.ReadWrite.All`](https://learn.microsoft.com/en-us/graph/permissions-reference#networkaccesspolicyreadwriteall)
  * [`DelegatedAdminRelationship.ReadWrite.All`](https://learn.microsoft.com/en-us/graph/permissions-reference#delegatedadminrelationshipreadwriteall)
  * [`EntitlementManagement.ReadWrite.All`](https://learn.microsoft.com/en-us/graph/permissions-reference#entitlementmanagementreadwriteall)
  * [`User.ReadWrite.All`](https://learn.microsoft.com/en-us/graph/permissions-reference#userreadwriteall)
  * [`Directory.AccessAsUser.All`](https://learn.microsoft.com/en-us/graph/permissions-reference#directoryaccessasuserall)
  * [`Sites.FullControl.All`](https://learn.microsoft.com/en-us/graph/permissions-reference#sitesfullcontrolall)
  * [`GroupMember.ReadWrite.All`](https://learn.microsoft.com/en-us/graph/permissions-reference#groupmemberreadwriteall)

  To select different scopes for your credentials, enable the **Custom Scopes** slider and edit the **Enabled Scopes** list. Keep in mind that some features may not work as expected with more restrictive scopes.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"4af163f8-39fa-4578-b6cc-3103ca581756","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"09a34ce0f8272122010fe3f681534a38551286d1bdfead17fdd8b0f6c933ef77"}}


node_type: n8n-nodes-base.OpenThesaurus
name: OpenThesaurus
display_name: OpenThesaurus
description: Get synonmns for German words using the OpenThesaurus API
category: Other
code_hash: 2677b6788bc843f9af85a4a31778333f3cf8e2aa1ae5bf09d7610abb8494981e
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.openthesaurus
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.OpenThesaurus = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class OpenThesaurus {
      constructor() {
          this.description = {
              displayName: 'OpenThesaurus',
              name: 'openThesaurus',
              icon: 'file:openthesaurus.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Get synonmns for German words using the OpenThesaurus API',
              defaults: {
                  name: 'OpenThesaurus',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Get Synonyms',
                              value: 'getSynonyms',
                              description: 'Get synonyms for a German word in German',
                              action: 'Get synonyms',
                          },
                      ],
                      default: 'getSynonyms',
                  },
                  {
                      displayName: 'Text',
                      name: 'text',
                      type: 'string',
                      default: '',
                      description: 'The word to get synonyms for',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getSynonyms'],
                          },
                      },
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Options',
                      displayOptions: {
                          show: {
                              operation: ['getSynonyms'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Baseform',
                              name: 'baseform',
                              type: 'boolean',
                              default: false,
                              description: 'Specifies the basic form for the search term if it is not already a basic form',
                          },
                          {
                              displayName: 'Similar',
                              name: 'similar',
                              type: 'boolean',
                              default: false,
                              description: 'This also returns up to five similarly written words for each answer. This is useful to be able to make a suggestion to the user in the event of a possible typing error.',
                          },
                          {
                              displayName: 'Starts With',
                              name: 'startswith',
                              type: 'boolean',
                              default: false,
                              description: 'Like substring = true, but only finds words that begin with the specified search term',
                          },
                          {
                              displayName: 'Substring',
                              name: 'substring',
                              type: 'boolean',
                              default: false,
                              description: 'Whether up to ten words are returned for each answer that only contain the search term as a partial word',
                          },
                          {
                              displayName: 'Substring From Results',
                              name: 'substringFromResults',
                              type: 'number',
                              default: 0,
                              description: 'Specifies from which entry the partial word hits are to be returned. Only works together with substring = true.',
                          },
                          {
                              displayName: 'Substring Max Results',
                              name: 'substringMaxResults',
                              type: 'number',
                              typeOptions: {
                                  maxValue: 250,
                              },
                              default: 10,
                              description: 'Specifies how many partial word hits should be returned in total. Only works together with substring = true.',
                          },
                          {
                              displayName: 'Subsynsets',
                              name: 'subsynsets',
                              type: 'boolean',
                              default: false,
                              description: 'Whether each synonym group has its (optional) sub-terms supplied',
                          },
                          {
                              displayName: 'Supersynsets',
                              name: 'supersynsets',
                              type: 'boolean',
                              default: false,
                              description: 'Whether each synonym group is supplied with its (optional) generic terms',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (operation === 'getSynonyms') {
                      const text = this.getNodeParameter('text', i);
                      const options = this.getNodeParameter('options', i);
                      qs.q = text;
                      Object.assign(qs, options);
                      responseData = await GenericFunctions_1.openThesaurusApiRequest.call(this, 'GET', '/synonyme/search', {}, qs);
                      responseData = responseData.synsets;
                  }
                  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.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.OpenThesaurus = OpenThesaurus;
  //# sourceMappingURL=OpenThesaurus.node.js.map

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

  # OpenThesaurus node

  Use the OpenThesaurus node to automate work in OpenThesaurus, and integrate OpenThesaurus with other applications. n8n supports synonym look-up for German words. 

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

  /// note | Credentials
  OpenThesaurus node doesn't require authentication. 
  ///

  ## Operations

  * Get synonyms for a German word in German

  ## Templates and examples

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

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"b50003ea-d5d9-487b-ae6b-d63b7c1933ae","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"bf8923328f7fc0d368dc7116166f4e130d963b8404b40a19030045d573dd8404"}}


node_type: n8n-nodes-base.OneSimpleApi
name: OneSimpleApi
display_name: One Simple API
description: A toolbox of no-code utilities
category: Other
code_hash: f12c32f96a4405d7edd7a8d6bb2f024daec690414b8b1d90cbecca1105d267c6
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/onesimpleapi
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.OneSimpleApi = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class OneSimpleApi {
      constructor() {
          this.description = {
              displayName: 'One Simple API',
              name: 'oneSimpleApi',
              icon: 'file:onesimpleapi.svg',
              group: ['transform'],
              version: 1,
              description: 'A toolbox of no-code utilities',
              defaults: {
                  name: 'One Simple API',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'oneSimpleApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Information',
                              value: 'information',
                          },
                          {
                              name: 'Social Profile',
                              value: 'socialProfile',
                          },
                          {
                              name: 'Utility',
                              value: 'utility',
                          },
                          {
                              name: 'Website',
                              value: 'website',
                          },
                      ],
                      default: 'website',
                      required: true,
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['website'],
                          },
                      },
                      options: [
                          {
                              name: 'Generate PDF',
                              value: 'pdf',
                              description: 'Generate a PDF from a webpage',
                              action: 'Generate PDF',
                          },
                          {
                              name: 'Get SEO Data',
                              value: 'seo',
                              description: 'Get SEO information from website',
                              action: 'Get SEO Data',
                          },
                          {
                              name: 'Take Screenshot',
                              value: 'screenshot',
                              description: 'Create a screenshot from a webpage',
                              action: 'Screenshot',
                          },
                      ],
                      default: 'pdf',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['socialProfile'],
                          },
                      },
                      options: [
                          {
                              name: 'Instagram',
                              value: 'instagramProfile',
                              description: 'Get details about an Instagram profile',
                              action: 'Get details about an Instagram profile',
                          },
                          {
                              name: 'Spotify',
                              value: 'spotifyArtistProfile',
                              description: 'Get details about a Spotify Artist',
                              action: 'Get details about a Spotify artist',
                          },
                      ],
                      default: 'instagramProfile',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['information'],
                          },
                      },
                      options: [
                          {
                              name: 'Exchange Rate',
                              value: 'exchangeRate',
                              description: 'Convert a value between currencies',
                              action: 'Convert a value between currencies',
                          },
                          {
                              name: 'Image Metadata',
                              value: 'imageMetadata',
                              description: 'Retrieve image metadata from a URL',
                              action: 'Get image metadata from a URL',
                          },
                      ],
                      default: 'exchangeRate',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['utility'],
                          },
                      },
                      options: [
                          {
                              name: 'Expand URL',
                              value: 'expandURL',
                              description: 'Expand a shortened URL',
                              action: 'Expand a shortened URL',
                          },
                          {
                              name: 'Generate QR Code',
                              value: 'qrCode',
                              description: 'Generate a QR Code',
                              action: 'Generate a QR code utility',
                          },
                          {
                              name: 'Validate Email',
                              value: 'validateEmail',
                              description: 'Validate an email address',
                              action: 'Validate an email address',
                          },
                      ],
                      default: 'validateEmail',
                  },
                  {
                      displayName: 'Webpage URL',
                      name: 'link',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['pdf'],
                              resource: ['website'],
                          },
                      },
                      default: '',
                      description: 'Link to webpage to convert',
                  },
                  {
                      displayName: 'Download PDF?',
                      name: 'download',
                      type: 'boolean',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['pdf'],
                              resource: ['website'],
                          },
                      },
                      default: false,
                      description: 'Whether to download the PDF or return a link to it',
                  },
                  {
                      displayName: 'Put Output In Field',
                      name: 'output',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['pdf'],
                              resource: ['website'],
                              download: [true],
                          },
                      },
                      default: 'data',
                      description: 'The name of the output field to put the binary file data in',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['website'],
                              operation: ['pdf'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Page Size',
                              name: 'page',
                              type: 'options',
                              options: [
                                  {
                                      name: 'A0',
                                      value: 'A0',
                                  },
                                  {
                                      name: 'A1',
                                      value: 'A1',
                                  },
                                  {
                                      name: 'A2',
                                      value: 'A2',
                                  },
                                  {
                                      name: 'A3',
                                      value: 'A3',
                                  },
                                  {
                                      name: 'A4',
                                      value: 'A4',
                                  },
                                  {
                                      name: 'A5',
                                      value: 'A5',
                                  },
                                  {
                                      name: 'A6',
                                      value: 'A6',
                                  },
                                  {
                                      name: 'Ledger',
                                      value: 'Ledger',
                                  },
                                  {
                                      name: 'Legal',
                                      value: 'Legal',
                                  },
                                  {
                                      name: 'Letter',
                                      value: 'Letter',
                                  },
                                  {
                                      name: 'Tabloid',
                                      value: 'Tabloid',
                                  },
                              ],
                              default: '',
                          },
                          {
                              displayName: 'Force Refresh',
                              name: 'force',
                              type: 'boolean',
                              default: false,
                              description: "Normally the API will reuse a previously taken screenshot of the URL to give a faster response. This option allows you to retake the screenshot at that exact time, for those times when it's necessary.",
                          },
                      ],
                  },
                  {
                      displayName: 'QR Content',
                      name: 'message',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['qrCode'],
                              resource: ['utility'],
                          },
                      },
                      default: '',
                      description: 'The text that should be turned into a QR code - like a website URL',
                  },
                  {
                      displayName: 'Download Image?',
                      name: 'download',
                      type: 'boolean',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['qrCode'],
                              resource: ['utility'],
                          },
                      },
                      default: false,
                      description: 'Whether to download the QR code or return a link to it',
                  },
                  {
                      displayName: 'Put Output In Field',
                      name: 'output',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['qrCode'],
                              resource: ['utility'],
                              download: [true],
                          },
                      },
                      default: 'data',
                      description: 'The name of the output field to put the binary file data in',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['utility'],
                              operation: ['qrCode'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Size',
                              name: 'size',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Small',
                                      value: 'Small',
                                  },
                                  {
                                      name: 'Medium',
                                      value: 'Medium',
                                  },
                                  {
                                      name: 'Large',
                                      value: 'Large',
                                  },
                              ],
                              default: 'Small',
                              description: 'The QR Code size',
                          },
                          {
                              displayName: 'Format',
                              name: 'format',
                              type: 'options',
                              options: [
                                  {
                                      name: 'PNG',
                                      value: 'PNG',
                                  },
                                  {
                                      name: 'SVG',
                                      value: 'SVG',
                                  },
                              ],
                              default: 'PNG',
                              description: 'The QR Code format',
                          },
                      ],
                  },
                  {
                      displayName: 'Webpage URL',
                      name: 'link',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['screenshot'],
                              resource: ['website'],
                          },
                      },
                      default: '',
                      description: 'Link to webpage to convert',
                  },
                  {
                      displayName: 'Download Screenshot?',
                      name: 'download',
                      type: 'boolean',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['screenshot'],
                              resource: ['website'],
                          },
                      },
                      default: false,
                      description: 'Whether to download the screenshot or return a link to it',
                  },
                  {
                      displayName: 'Put Output In Field',
                      name: 'output',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['screenshot'],
                              resource: ['website'],
                              download: [true],
                          },
                      },
                      default: 'data',
                      description: 'The name of the output field to put the binary file data in',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['website'],
                              operation: ['screenshot'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Screen Size',
                              name: 'screen',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Phone',
                                      value: 'phone',
                                  },
                                  {
                                      name: 'Phone Landscape',
                                      value: 'phone-landscape',
                                  },
                                  {
                                      name: 'Retina',
                                      value: 'retina',
                                  },
                                  {
                                      name: 'Tablet',
                                      value: 'tablet',
                                  },
                                  {
                                      name: 'Tablet Landscape',
                                      value: 'tablet-landscape',
                                  },
                              ],
                              default: '',
                          },
                          {
                              displayName: 'Force Refresh',
                              name: 'force',
                              type: 'boolean',
                              default: false,
                              description: "Normally the API will reuse a previously taken screenshot of the URL to give a faster response. This option allows you to retake the screenshot at that exact time, for those times when it's necessary.",
                          },
                          {
                              displayName: 'Full Page',
                              name: 'fullpage',
                              type: 'boolean',
                              default: false,
                              description: 'The API takes a screenshot of the viewable area for the desired screen size. If you need a screenshot of the whole length of the page, use this option.',
                          },
                      ],
                  },
                  {
                      displayName: 'Profile Name',
                      name: 'profileName',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['instagramProfile'],
                              resource: ['socialProfile'],
                          },
                      },
                      default: '',
                      description: 'Profile name to get details of',
                  },
                  {
                      displayName: 'Artist Name',
                      name: 'artistName',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['spotifyArtistProfile'],
                              resource: ['socialProfile'],
                          },
                      },
                      default: '',
                      description: 'Artist name to get details for',
                  },
                  {
                      displayName: 'Value',
                      name: 'value',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['exchangeRate'],
                              resource: ['information'],
                          },
                      },
                      default: '',
                      description: 'Value to convert',
                  },
                  {
                      displayName: 'From Currency',
                      name: 'fromCurrency',
                      type: 'string',
                      required: true,
                      placeholder: 'USD',
                      displayOptions: {
                          show: {
                              operation: ['exchangeRate'],
                              resource: ['information'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'To Currency',
                      name: 'toCurrency',
                      type: 'string',
                      placeholder: 'EUR',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['exchangeRate'],
                              resource: ['information'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Link To Image',
                      name: 'link',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['imageMetadata'],
                              resource: ['information'],
                          },
                      },
                      default: '',
                      description: 'Image to get metadata from',
                  },
                  {
                      displayName: 'Webpage URL',
                      name: 'link',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['seo'],
                              resource: ['website'],
                          },
                      },
                      default: '',
                      description: 'Webpage to get SEO information for',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['website'],
                              operation: ['seo'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Include Headers?',
                              name: 'headers',
                              type: 'boolean',
                              default: false,
                          },
                      ],
                  },
                  {
                      displayName: 'Email Address',
                      name: 'emailAddress',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['validateEmail'],
                              resource: ['utility'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'URL',
                      name: 'link',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['expandURL'],
                              resource: ['utility'],
                          },
                      },
                      default: '',
                      description: 'URL to unshorten',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          let download;
          for (let i = 0; i < length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', 0);
                  const operation = this.getNodeParameter('operation', 0);
                  if (resource === 'website') {
                      if (operation === 'pdf') {
                          const link = this.getNodeParameter('link', i);
                          const options = this.getNodeParameter('options', i);
                          download = this.getNodeParameter('download', i);
                          qs.url = link;
                          if (options.page) {
                              qs.page = options.page;
                          }
                          if (options.force) {
                              qs.force = 'yes';
                          }
                          else {
                              qs.force = 'no';
                          }
                          const response = await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '/pdf', {}, qs);
                          if (download) {
                              const output = this.getNodeParameter('output', i);
                              const buffer = (await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '', {}, {}, response.url, { json: false, encoding: null }));
                              responseData = {
                                  json: response,
                                  binary: {
                                      [output]: await this.helpers.prepareBinaryData(buffer),
                                  },
                              };
                          }
                          else {
                              responseData = response;
                          }
                      }
                      if (operation === 'screenshot') {
                          const link = this.getNodeParameter('link', i);
                          const options = this.getNodeParameter('options', i);
                          download = this.getNodeParameter('download', i);
                          qs.url = link;
                          if (options.screen) {
                              qs.screen = options.screen;
                          }
                          if (options.fullpage) {
                              qs.fullpage = 'yes';
                          }
                          else {
                              qs.fullpage = 'no';
                          }
                          if (options.force) {
                              qs.force = 'yes';
                          }
                          else {
                              qs.force = 'no';
                          }
                          const response = await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '/screenshot', {}, qs);
                          if (download) {
                              const output = this.getNodeParameter('output', i);
                              const buffer = (await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '', {}, {}, response.url, { json: false, encoding: null }));
                              responseData = {
                                  json: response,
                                  binary: {
                                      [output]: await this.helpers.prepareBinaryData(buffer),
                                  },
                              };
                          }
                          else {
                              responseData = response;
                          }
                      }
                      if (operation === 'seo') {
                          const link = this.getNodeParameter('link', i);
                          const options = this.getNodeParameter('options', i);
                          qs.url = link;
                          if (options.headers) {
                              qs.headers = 'yes';
                          }
                          responseData = await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '/page_info', {}, qs);
                      }
                  }
                  if (resource === 'socialProfile') {
                      if (operation === 'instagramProfile') {
                          const profileName = this.getNodeParameter('profileName', i);
                          qs.profile = profileName;
                          responseData = await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '/instagram_profile', {}, qs);
                      }
                      if (operation === 'spotifyArtistProfile') {
                          const artistName = this.getNodeParameter('artistName', i);
                          qs.profile = artistName;
                          responseData = await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '/spotify_profile', {}, qs);
                      }
                  }
                  if (resource === 'information') {
                      if (operation === 'exchangeRate') {
                          const value = this.getNodeParameter('value', i);
                          const fromCurrency = this.getNodeParameter('fromCurrency', i);
                          const toCurrency = this.getNodeParameter('toCurrency', i);
                          qs.from_currency = fromCurrency;
                          qs.to_currency = toCurrency;
                          qs.from_value = value;
                          responseData = await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '/exchange_rate', {}, qs);
                      }
                      if (operation === 'imageMetadata') {
                          const link = this.getNodeParameter('link', i);
                          qs.url = link;
                          qs.raw = true;
                          responseData = await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '/image_info', {}, qs);
                      }
                  }
                  if (resource === 'utility') {
                      if (operation === 'validateEmail') {
                          const emailAddress = this.getNodeParameter('emailAddress', i);
                          qs.email = emailAddress;
                          responseData = await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '/email', {}, qs);
                      }
                      if (operation === 'expandURL') {
                          const url = this.getNodeParameter('link', i);
                          qs.url = url;
                          responseData = await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '/unshorten', {}, qs);
                      }
                      if (operation === 'qrCode') {
                          const message = this.getNodeParameter('message', i);
                          const options = this.getNodeParameter('options', i);
                          download = this.getNodeParameter('download', i);
                          qs.message = message;
                          if (options.size) {
                              qs.size = options.size;
                          }
                          if (options.format) {
                              qs.format = options.format;
                          }
                          const response = await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '/qr_code', {}, qs);
                          if (download) {
                              const output = this.getNodeParameter('output', i);
                              const buffer = (await GenericFunctions_1.oneSimpleApiRequest.call(this, 'GET', '', {}, {}, response.url, { json: false, encoding: null }));
                              responseData = {
                                  json: response,
                                  binary: {
                                      [output]: await this.helpers.prepareBinaryData(buffer),
                                  },
                              };
                          }
                          else {
                              responseData = response;
                          }
                      }
                  }
                  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;
              }
          }
          if (download) {
              return [returnData];
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.OneSimpleApi = OneSimpleApi;
  //# sourceMappingURL=OneSimpleApi.node.js.map

documentation_markdown:
  ---
  #https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
  title: One Simple API credentials
  description: Documentation for One Simple API credentials. Use these credentials to authenticate One Simple API in n8n, a workflow automation platform.
  contentType: [integration, reference]
  ---
  <!-- vale off -->
  <!-- Not adding 'Simple' to accept.txt but can't really get away from it here -->
  # One Simple API credentials

  You can use these credentials to authenticate the following nodes:

  - [One Simple API](/integrations/builtin/app-nodes/n8n-nodes-base.onesimpleapi.md)

  ## Prerequisites

  Create a [One Simple API](https://onesimpleapi.com/register){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API token

  ## Related resources

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

  ## Using API token

  To configure this credential, you'll need:

  - An **API token**: Create a new API token on the [API Tokens](https://onesimpleapi.com/user/api-tokens) page. Be sure you select appropriate permissions for the token.

  You can also access the API Tokens page by selecting your **Profile > API Tokens**.

  <!-- vale on -->

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"c6fc46a2-c1b5-4640-9697-a634a8c9c73c","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"88503c783b144b712fe682054ef7e1f9ac2fbd6487f14cfac05860ab9e83ced2"}}


node_type: n8n-nodes-base.OpenWeatherMap
name: OpenWeatherMap
display_name: OpenWeatherMap
description: Gets current and future weather information
category: Other
code_hash: 030deaa4964a0c1de6ebf4f3ab30894d4cecb9d9867ba38910083cda34889b9c
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/openweathermap
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.OpenWeatherMap = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class OpenWeatherMap {
      constructor() {
          this.description = {
              displayName: 'OpenWeatherMap',
              name: 'openWeatherMap',
              icon: 'fa:sun',
              group: ['input'],
              version: 1,
              description: 'Gets current and future weather information',
              defaults: {
                  name: 'OpenWeatherMap',
                  color: '#554455',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'openWeatherMapApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Current Weather',
                              value: 'currentWeather',
                              description: 'Returns the current weather data',
                              action: 'Return current weather data',
                          },
                          {
                              name: '5 Day Forecast',
                              value: '5DayForecast',
                              description: 'Returns the weather data for the next 5 days',
                              action: 'Return weather data for the next 5 days',
                          },
                      ],
                      default: 'currentWeather',
                  },
                  {
                      displayName: 'Format',
                      name: 'format',
                      type: 'options',
                      options: [
                          {
                              name: 'Imperial',
                              value: 'imperial',
                              description: 'Fahrenheit | miles/hour',
                          },
                          {
                              name: 'Metric',
                              value: 'metric',
                              description: 'Celsius | meter/sec',
                          },
                          {
                              name: 'Scientific',
                              value: 'standard',
                              description: 'Kelvin | meter/sec',
                          },
                      ],
                      default: 'metric',
                      description: 'The format in which format the data should be returned',
                  },
                  {
                      displayName: 'Location Selection',
                      name: 'locationSelection',
                      type: 'options',
                      options: [
                          {
                              name: 'City Name',
                              value: 'cityName',
                          },
                          {
                              name: 'City ID',
                              value: 'cityId',
                          },
                          {
                              name: 'Coordinates',
                              value: 'coordinates',
                          },
                          {
                              name: 'Zip Code',
                              value: 'zipCode',
                          },
                      ],
                      default: 'cityName',
                      description: 'How to define the location for which to return the weather',
                  },
                  {
                      displayName: 'City',
                      name: 'cityName',
                      type: 'string',
                      default: '',
                      placeholder: 'berlin,de',
                      required: true,
                      displayOptions: {
                          show: {
                              locationSelection: ['cityName'],
                          },
                      },
                      description: 'The name of the city to return the weather of',
                  },
                  {
                      displayName: 'City ID',
                      name: 'cityId',
                      type: 'number',
                      default: 160001123,
                      required: true,
                      displayOptions: {
                          show: {
                              locationSelection: ['cityId'],
                          },
                      },
                      description: 'The ID of city to return the weather of. List can be downloaded here: http://bulk.openweathermap.org/sample/.',
                  },
                  {
                      displayName: 'Latitude',
                      name: 'latitude',
                      type: 'string',
                      default: '',
                      placeholder: '13.39',
                      required: true,
                      displayOptions: {
                          show: {
                              locationSelection: ['coordinates'],
                          },
                      },
                      description: 'The latitude of the location to return the weather of',
                  },
                  {
                      displayName: 'Longitude',
                      name: 'longitude',
                      type: 'string',
                      default: '',
                      placeholder: '52.52',
                      required: true,
                      displayOptions: {
                          show: {
                              locationSelection: ['coordinates'],
                          },
                      },
                      description: 'The longitude of the location to return the weather of',
                  },
                  {
                      displayName: 'Zip Code',
                      name: 'zipCode',
                      type: 'string',
                      default: '',
                      placeholder: '10115,de',
                      required: true,
                      displayOptions: {
                          show: {
                              locationSelection: ['zipCode'],
                          },
                      },
                      description: 'The ID of city to return the weather of. List can be downloaded here: http://bulk.openweathermap.org/sample/.',
                  },
                  {
                      displayName: 'Language',
                      name: 'language',
                      type: 'string',
                      default: '',
                      placeholder: 'en',
                      description: 'The two letter language code to get your output in (eg. en, de, ...).',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const credentials = await this.getCredentials('openWeatherMapApi');
          const operation = this.getNodeParameter('operation', 0);
          let endpoint = '';
          let locationSelection;
          let language;
          let qs;
          for (let i = 0; i < items.length; i++) {
              try {
                  qs = {
                      APPID: credentials.accessToken,
                      units: this.getNodeParameter('format', i),
                  };
                  locationSelection = this.getNodeParameter('locationSelection', i);
                  if (locationSelection === 'cityName') {
                      qs.q = this.getNodeParameter('cityName', i);
                  }
                  else if (locationSelection === 'cityId') {
                      qs.id = this.getNodeParameter('cityId', i);
                  }
                  else if (locationSelection === 'coordinates') {
                      qs.lat = this.getNodeParameter('latitude', i);
                      qs.lon = this.getNodeParameter('longitude', i);
                  }
                  else if (locationSelection === 'zipCode') {
                      qs.zip = this.getNodeParameter('zipCode', i);
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The locationSelection "${locationSelection}" is not known!`, { itemIndex: i });
                  }
                  language = this.getNodeParameter('language', i);
                  if (language) {
                      qs.lang = language;
                  }
                  if (operation === 'currentWeather') {
                      endpoint = 'weather';
                  }
                  else if (operation === '5DayForecast') {
                      endpoint = 'forecast';
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                  }
                  const options = {
                      method: 'GET',
                      qs,
                      uri: `https://api.openweathermap.org/data/2.5/${endpoint}`,
                      json: true,
                  };
                  let responseData;
                  try {
                      responseData = await this.helpers.request(options);
                  }
                  catch (error) {
                      throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.OpenWeatherMap = OpenWeatherMap;
  //# sourceMappingURL=OpenWeatherMap.node.js.map

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

  # OpenWeatherMap credentials

  You can use these credentials to authenticate the following nodes:

  - [OpenWeatherMap](/integrations/builtin/app-nodes/n8n-nodes-base.openweathermap.md)

  ## Supported authentication methods

  - API access token

  ## Related resources

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

  ## Using API access token

  To configure this credential, you'll need an [OpenWeatherMap](https://openweathermap.org/){:target=_blank .external-link} account and:

  - An **Access Token**

  To get your **Access Token**:

  1. After you verify your email address, OpenWeatherMap includes an **API Key** in your welcome email.
  2. Copy that key and enter it in your n8n credential.

  If you'd prefer to create a new key:

  1. To create a new key, go to **Account >** [**API Keys**](https://home.openweathermap.org/api_keys){:target=_blank .external-link}.
  2. In the **Create Key** section, enter an **API Key Name**, like `n8n integration`.
  3. Select **Generate** to generate your key.
  4. Copy the generated key and enter it in your n8n credential.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"7f6264e1-b270-46d0-945a-6adb5f445e0c","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"ce9f28629b9f1f98a2a3f077a9cc94ce897b61c0d3744db79f5cf817766368cd"}}


node_type: n8n-nodes-base.Paddle
name: Paddle
display_name: Paddle
description: Consume Paddle API
category: Other
code_hash: 1deeb98d7a1bb1beaadc71f7e095853f024a41d1c330db6150a79906ac486135
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/paddle
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
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.Paddle = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const CouponDescription_1 = require("./CouponDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  const PaymentDescription_1 = require("./PaymentDescription");
  const PlanDescription_1 = require("./PlanDescription");
  const ProductDescription_1 = require("./ProductDescription");
  const UserDescription_1 = require("./UserDescription");
  const moment_1 = __importDefault(require("moment"));
  class Paddle {
      constructor() {
          this.description = {
              displayName: 'Paddle',
              name: 'paddle',
              icon: 'file:paddle.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Paddle API',
              defaults: {
                  name: 'Paddle',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'paddleApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Coupon',
                              value: 'coupon',
                          },
                          {
                              name: 'Payment',
                              value: 'payment',
                          },
                          {
                              name: 'Plan',
                              value: 'plan',
                          },
                          {
                              name: 'Product',
                              value: 'product',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'coupon',
                  },
                  ...CouponDescription_1.couponOperations,
                  ...CouponDescription_1.couponFields,
                  ...PaymentDescription_1.paymentOperations,
                  ...PaymentDescription_1.paymentFields,
                  ...PlanDescription_1.planOperations,
                  ...PlanDescription_1.planFields,
                  ...ProductDescription_1.productOperations,
                  ...ProductDescription_1.productFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getPayments() {
                      const returnData = [];
                      const endpoint = '/2.0/subscription/payments';
                      const paymentResponse = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', {});
                      if (paymentResponse.response === undefined || paymentResponse.response.length === 0) {
                          throw new n8n_workflow_1.NodeApiError(this.getNode(), paymentResponse, {
                              message: 'No payments on account.',
                          });
                      }
                      for (const payment of paymentResponse.response) {
                          const id = payment.id;
                          returnData.push({
                              name: id,
                              value: id,
                          });
                      }
                      return returnData;
                  },
                  async getProducts() {
                      const returnData = [];
                      const endpoint = '/2.0/product/get_products';
                      const products = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', {});
                      if (products.length === 0) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No products on account.');
                      }
                      for (const product of products) {
                          const name = product.name;
                          const id = product.id;
                          returnData.push({
                              name,
                              value: id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const body = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'coupon') {
                      if (operation === 'create') {
                          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 discountType = this.getNodeParameter('discountType', i);
                              const couponType = this.getNodeParameter('couponType', i);
                              const discountAmount = this.getNodeParameter('discountAmount', i);
                              if (couponType === 'product') {
                                  body.product_ids = this.getNodeParameter('productIds', i);
                              }
                              if (discountType === 'flat') {
                                  body.currency = this.getNodeParameter('currency', i);
                              }
                              body.coupon_type = couponType;
                              body.discount_type = discountType;
                              body.discount_amount = discountAmount;
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.allowedUses) {
                                  body.allowed_uses = additionalFields.allowedUses;
                              }
                              if (additionalFields.couponCode) {
                                  body.coupon_code = additionalFields.couponCode;
                              }
                              if (additionalFields.couponPrefix) {
                                  body.coupon_prefix = additionalFields.couponPrefix;
                              }
                              if (additionalFields.expires) {
                                  body.expires = (0, moment_1.default)(additionalFields.expires).format('YYYY-MM-DD');
                              }
                              if (additionalFields.group) {
                                  body.group = additionalFields.group;
                              }
                              if (additionalFields.recurring) {
                                  body.recurring = 1;
                              }
                              else {
                                  body.recurring = 0;
                              }
                              if (additionalFields.numberOfCoupons) {
                                  body.num_coupons = additionalFields.numberOfCoupons;
                              }
                              if (additionalFields.description) {
                                  body.description = additionalFields.description;
                              }
                              const endpoint = '/2.1/product/create_coupon';
                              responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                              responseData = responseData.response.coupon_codes.map((coupon) => ({
                                  coupon,
                              }));
                          }
                      }
                      if (operation === 'getAll') {
                          const productId = this.getNodeParameter('productId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const endpoint = '/2.0/product/list_coupons';
                          body.product_id = productId;
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          if (returnAll) {
                              responseData = responseData.response;
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.response.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          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 updateBy = this.getNodeParameter('updateBy', i);
                              if (updateBy === 'group') {
                                  body.group = this.getNodeParameter('group', i);
                              }
                              else {
                                  body.coupon_code = this.getNodeParameter('couponCode', i);
                              }
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.allowedUses) {
                                  body.allowed_uses = additionalFields.allowedUses;
                              }
                              if (additionalFields.currency) {
                                  body.currency = additionalFields.currency;
                              }
                              if (additionalFields.newCouponCode) {
                                  body.new_coupon_code = additionalFields.newCouponCode;
                              }
                              if (additionalFields.expires) {
                                  body.expires = (0, moment_1.default)(additionalFields.expires).format('YYYY-MM-DD');
                              }
                              if (additionalFields.newGroup) {
                                  body.new_group = additionalFields.newGroup;
                              }
                              if (additionalFields.recurring === true) {
                                  body.recurring = 1;
                              }
                              else if (additionalFields.recurring === false) {
                                  body.recurring = 0;
                              }
                              if (additionalFields.productIds) {
                                  body.product_ids = additionalFields.productIds;
                              }
                              if (additionalFields.discountAmount) {
                                  body.discount_amount = additionalFields.discountAmount;
                              }
                              if (additionalFields.discount) {
                                  if (additionalFields.discount.discountProperties.discountType === 'percentage') {
                                      body.discount_amount = additionalFields.discount.discountProperties
                                          .discountAmount;
                                  }
                                  else {
                                      body.currency = additionalFields.discount.discountProperties.currency;
                                      body.discount_amount = additionalFields.discount.discountProperties
                                          .discountAmount;
                                  }
                              }
                          }
                          const endpoint = '/2.1/product/update_coupon';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          responseData = responseData.response;
                      }
                  }
                  if (resource === 'payment') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', 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.subscriptionId) {
                                  body.subscription_id = additionalFields.subscriptionId;
                              }
                              if (additionalFields.plan) {
                                  body.plan = additionalFields.plan;
                              }
                              if (additionalFields.state) {
                                  body.state = additionalFields.state;
                              }
                              if (additionalFields.isPaid) {
                                  body.is_paid = 1;
                              }
                              else {
                                  body.is_paid = 0;
                              }
                              if (additionalFields.from) {
                                  body.from = (0, moment_1.default)(additionalFields.from).format('YYYY-MM-DD');
                              }
                              if (additionalFields.to) {
                                  body.to = (0, moment_1.default)(additionalFields.to).format('YYYY-MM-DD');
                              }
                              if (additionalFields.isOneOffCharge) {
                                  body.is_one_off_charge = additionalFields.isOneOffCharge;
                              }
                          }
                          const endpoint = '/2.0/subscription/payments';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          if (returnAll) {
                              responseData = responseData.response;
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.response.splice(0, limit);
                          }
                      }
                      if (operation === 'reschedule') {
                          const paymentId = this.getNodeParameter('paymentId', i);
                          const date = this.getNodeParameter('date', i);
                          body.payment_id = paymentId;
                          body.date = body.to = (0, moment_1.default)(date).format('YYYY-MM-DD');
                          const endpoint = '/2.0/subscription/payments_reschedule';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                      }
                  }
                  if (resource === 'plan') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const endpoint = '/2.0/subscription/plans';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          if (returnAll) {
                              responseData = responseData.response;
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.response.splice(0, limit);
                          }
                      }
                      if (operation === 'get') {
                          const planId = this.getNodeParameter('planId', i);
                          body.plan = planId;
                          const endpoint = '/2.0/subscription/plans';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          responseData = responseData.response;
                      }
                  }
                  if (resource === 'product') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const endpoint = '/2.0/product/get_products';
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                          if (returnAll) {
                              responseData = responseData.response.products;
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.response.products.splice(0, limit);
                          }
                      }
                  }
                  if (resource === 'order') {
                      if (operation === 'get') {
                          const endpoint = '/1.0/order';
                          const checkoutId = this.getNodeParameter('checkoutId', i);
                          body.checkout_id = checkoutId;
                          responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'GET', body);
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', 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.state) {
                                  body.state = additionalFields.state;
                              }
                              if (additionalFields.planId) {
                                  body.plan_id = additionalFields.planId;
                              }
                              if (additionalFields.subscriptionId) {
                                  body.subscription_id = additionalFields.subscriptionId;
                              }
                          }
                          const endpoint = '/2.0/subscription/users';
                          if (returnAll) {
                              responseData = await GenericFunctions_1.paddleApiRequestAllItems.call(this, 'response', endpoint, 'POST', body);
                          }
                          else {
                              body.results_per_page = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.paddleApiRequest.call(this, endpoint, 'POST', body);
                              responseData = responseData.response;
                          }
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Paddle = Paddle;
  //# sourceMappingURL=Paddle.node.js.map

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

  # Paddle credentials

  You can use these credentials to authenticate the following nodes:

  - [Paddle](/integrations/builtin/app-nodes/n8n-nodes-base.paddle.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API access token (Classic)

  /// warning | Paddle Classic API
  This credential works with Paddle Classic's API. If you joined Paddle after August 2023, you're using the [Paddle Billing API](https://developer.paddle.com/api-reference/overview){:target=_blank .external-link} and this credential may not work for you.
  ///

  ## Related resources

  Refer to [Paddle Classic's API documentation](https://developer.paddle.com/classic/api-reference/1384a288aca7a-api-reference){:target=_blank .external-link} for more information about the service.

  ## Using API access token (Classic)

  To configure this credential, you'll need:

  - A **Vendor Auth Code**: Created when you generate an API key.
  - A **Vendor ID**: Displayed when you generate an API key.
  - **Use Sandbox Environment API**: When turned on, nodes using this credential will hit the Sandbox API endpoint instead of the live API endpoint.

  To generate an auth code and view your Vendor ID, go to **Paddle > Developer Tools > Authentication > Generate Auth Code**. Select **Reveal Auth Code** to display the Auth Code. Refer to [API Authentication](https://developer.paddle.com/classic/api-reference/zg9joji1mzuzotg5-api-authentication){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"7cd99adf-6d04-4984-b9ba-cd32ed468830","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"4ea50595124d01a68af3fe806fdf3db38c7232db2535cadcf28424aa6e8631b6"}}


node_type: n8n-nodes-base.PagerDuty
name: PagerDuty
display_name: PagerDuty
description: Consume PagerDuty API
category: Other
code_hash: 3ee5770722cf0d95e6f298602b21b57dcfb1209250ecf06d50fe9a7465455ef9
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/pagerduty
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
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.PagerDuty = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const IncidentDescription_1 = require("./IncidentDescription");
  const IncidentNoteDescription_1 = require("./IncidentNoteDescription");
  const LogEntryDescription_1 = require("./LogEntryDescription");
  const UserDescription_1 = require("./UserDescription");
  const change_case_1 = require("change-case");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class PagerDuty {
      constructor() {
          this.description = {
              displayName: 'PagerDuty',
              name: 'pagerDuty',
              icon: 'file:pagerDuty.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume PagerDuty API',
              defaults: {
                  name: 'PagerDuty',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'pagerDutyApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['apiToken'],
                          },
                      },
                  },
                  {
                      name: 'pagerDutyOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'API Token',
                              value: 'apiToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'apiToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Incident',
                              value: 'incident',
                          },
                          {
                              name: 'Incident Note',
                              value: 'incidentNote',
                          },
                          {
                              name: 'Log Entry',
                              value: 'logEntry',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'incident',
                  },
                  ...IncidentDescription_1.incidentOperations,
                  ...IncidentDescription_1.incidentFields,
                  ...IncidentNoteDescription_1.incidentNoteOperations,
                  ...IncidentNoteDescription_1.incidentNoteFields,
                  ...LogEntryDescription_1.logEntryOperations,
                  ...LogEntryDescription_1.logEntryFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getEscalationPolicies() {
                      const returnData = [];
                      const escalationPolicies = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'escalation_policies', 'GET', '/escalation_policies');
                      for (const escalationPolicy of escalationPolicies) {
                          const escalationPolicyName = escalationPolicy.name;
                          const escalationPolicyId = escalationPolicy.id;
                          returnData.push({
                              name: escalationPolicyName,
                              value: escalationPolicyId,
                          });
                      }
                      return returnData;
                  },
                  async getPriorities() {
                      const returnData = [];
                      const priorities = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'priorities', 'GET', '/priorities');
                      for (const priority of priorities) {
                          const priorityName = priority.name;
                          const priorityId = priority.id;
                          const priorityDescription = priority.description;
                          returnData.push({
                              name: priorityName,
                              value: priorityId,
                              description: priorityDescription,
                          });
                      }
                      return returnData;
                  },
                  async getServices() {
                      const returnData = [];
                      const services = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'services', 'GET', '/services');
                      for (const service of services) {
                          const serviceName = service.name;
                          const serviceId = service.id;
                          returnData.push({
                              name: serviceName,
                              value: serviceId,
                          });
                      }
                      return returnData;
                  },
                  async getTimezones() {
                      const returnData = [];
                      for (const timezone of moment_timezone_1.default.tz.names()) {
                          const timezoneName = timezone;
                          const timezoneId = timezone;
                          returnData.push({
                              name: timezoneName,
                              value: timezoneId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'incident') {
                      if (operation === 'create') {
                          const title = this.getNodeParameter('title', i);
                          const serviceId = this.getNodeParameter('serviceId', i);
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const conferenceBridge = this.getNodeParameter('conferenceBridgeUi', i)
                              .conferenceBridgeValues;
                          const body = {
                              type: 'incident',
                              title,
                              service: {
                                  id: serviceId,
                                  type: 'service_reference',
                              },
                          };
                          if (additionalFields.details) {
                              body.body = {
                                  type: 'incident_body',
                                  details: additionalFields.details,
                              };
                          }
                          if (additionalFields.priorityId) {
                              body.priority = {
                                  id: additionalFields.priorityId,
                                  type: 'priority_reference',
                              };
                          }
                          if (additionalFields.escalationPolicyId) {
                              body.escalation_policy = {
                                  id: additionalFields.escalationPolicyId,
                                  type: 'escalation_policy_reference',
                              };
                          }
                          if (additionalFields.urgency) {
                              body.urgency = additionalFields.urgency;
                          }
                          if (additionalFields.incidentKey) {
                              body.incident_key = additionalFields.incidentKey;
                          }
                          if (conferenceBridge) {
                              body.conference_bridge = {
                                  conference_number: conferenceBridge.conferenceNumber,
                                  conference_url: conferenceBridge.conferenceUrl,
                              };
                          }
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'POST', '/incidents', { incident: body }, {}, undefined, { from: email });
                          responseData = responseData.incident;
                      }
                      if (operation === 'get') {
                          const incidentId = this.getNodeParameter('incidentId', i);
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', `/incidents/${incidentId}`);
                          responseData = responseData.incident;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const options = this.getNodeParameter('options', 0);
                          if (options.userIds) {
                              options.userIds = options.userIds.split(',');
                          }
                          if (options.teamIds) {
                              options.teamIds = options.teamIds.split(',');
                          }
                          if (options.include) {
                              options.include = options.include.map((e) => (0, change_case_1.snakeCase)(e));
                          }
                          if (options.sortBy) {
                              options.sortBy = options.sortBy;
                          }
                          Object.assign(qs, (0, GenericFunctions_1.keysToSnakeCase)(options)[0]);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'incidents', 'GET', '/incidents', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', '/incidents', {}, qs);
                              responseData = responseData.incidents;
                          }
                      }
                      if (operation === 'update') {
                          const incidentId = this.getNodeParameter('incidentId', i);
                          const email = this.getNodeParameter('email', i);
                          const conferenceBridge = this.getNodeParameter('conferenceBridgeUi', i)
                              .conferenceBridgeValues;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              type: 'incident',
                          };
                          if (updateFields.title) {
                              body.title = updateFields.title;
                          }
                          if (updateFields.escalationLevel) {
                              body.escalation_level = updateFields.escalationLevel;
                          }
                          if (updateFields.details) {
                              body.body = {
                                  type: 'incident_body',
                                  details: updateFields.details,
                              };
                          }
                          if (updateFields.priorityId) {
                              body.priority = {
                                  id: updateFields.priorityId,
                                  type: 'priority_reference',
                              };
                          }
                          if (updateFields.escalationPolicyId) {
                              body.escalation_policy = {
                                  id: updateFields.escalationPolicyId,
                                  type: 'escalation_policy_reference',
                              };
                          }
                          if (updateFields.urgency) {
                              body.urgency = updateFields.urgency;
                          }
                          if (updateFields.resolution) {
                              body.resolution = updateFields.resolution;
                          }
                          if (updateFields.status) {
                              body.status = updateFields.status;
                          }
                          if (conferenceBridge) {
                              body.conference_bridge = {
                                  conference_number: conferenceBridge.conferenceNumber,
                                  conference_url: conferenceBridge.conferenceUrl,
                              };
                          }
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'PUT', `/incidents/${incidentId}`, { incident: body }, {}, undefined, { from: email });
                          responseData = responseData.incident;
                      }
                  }
                  if (resource === 'incidentNote') {
                      if (operation === 'create') {
                          const incidentId = this.getNodeParameter('incidentId', i);
                          const content = this.getNodeParameter('content', i);
                          const email = this.getNodeParameter('email', i);
                          const body = {
                              content,
                          };
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'POST', `/incidents/${incidentId}/notes`, { note: body }, {}, undefined, { from: email });
                      }
                      if (operation === 'getAll') {
                          const incidentId = this.getNodeParameter('incidentId', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'notes', 'GET', `/incidents/${incidentId}/notes`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', `/incidents/${incidentId}/notes`, {}, qs);
                              responseData = responseData.notes;
                          }
                      }
                  }
                  if (resource === 'logEntry') {
                      if (operation === 'get') {
                          const logEntryId = this.getNodeParameter('logEntryId', i);
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', `/log_entries/${logEntryId}`);
                          responseData = responseData.log_entry;
                      }
                      if (operation === 'getAll') {
                          const options = this.getNodeParameter('options', i);
                          Object.assign(qs, options);
                          (0, GenericFunctions_1.keysToSnakeCase)(qs);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.pagerDutyApiRequestAllItems.call(this, 'log_entries', 'GET', '/log_entries', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', '/log_entries', {}, qs);
                              responseData = responseData.log_entries;
                          }
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'get') {
                          const userId = this.getNodeParameter('userId', i);
                          responseData = await GenericFunctions_1.pagerDutyApiRequest.call(this, 'GET', `/users/${userId}`);
                          responseData = responseData.user;
                      }
                  }
                  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.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.PagerDuty = PagerDuty;
  //# sourceMappingURL=PagerDuty.node.js.map

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

  # PagerDuty credentials

  You can use these credentials to authenticate the following nodes:

  - [PagerDuty](/integrations/builtin/app-nodes/n8n-nodes-base.pagerduty.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API token
  - OAuth2

  ## Related resources

  Refer to [PagerDuty's API documentation](https://developer.pagerduty.com/docs/531092d4c6658-rest-api-v2-overview){:target=_blank .external-link} for more information about the service.

  ## Using API token

  To configure this credential, you'll need:

  - A general access **API Token**: To generate an API token, go to **Integrations > Developer Tools > API Access Keys > Create New API Key**. Refer to [Generate a General Access REST API key](https://support.pagerduty.com/docs/api-access-keys#generate-a-general-access-rest-api-key){:target=_blank .external-link} for more information.

  ## Using OAuth2

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

  If you need to configure OAuth2 from scratch, [register a new Pagerduty app](https://developer.pagerduty.com/docs/dd91fbd09a1a1-register-an-app){:target=_blank .external-link}.

  Use these settings for registering your app:

  - In the **Category** dropdown list, select **Infrastructure Automation**.
  - In the **Functionality** section, select **OAuth 2.0**.

  Once you **Save** your app, open the app details and [edit your app configuration](https://developer.pagerduty.com/docs/dd91fbd09a1a1-register-an-app#editing-your-app-configuration){:target=_blank .external-link} to use these settings:

  - Within the **OAuth 2.0** section, select **Add**.
  - Copy the **OAuth Callback URL** from n8n and paste it into the **Redirect URL** field.
  - Copy the **Client ID** and **Client Secret** from PagerDuty and add these to your n8n credentials.
  - Select **Read/Write** from the **Set Permission Scopes** dropdown list.

  Refer to the instructions in [App functionality](https://developer.pagerduty.com/docs/b25fd1b8acb1b-app-functionality){:target=_blank .external-link} for more information on available functionality. Refer to the PagerDuty [OAuth Functionality documentation](https://developer.pagerduty.com/docs/f59fdbd94ceab-o-auth-functionality){:target=_blank .external-link} for more information on the OAuth flow.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"915befef-87e3-4439-80f8-c96bff8f3537","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"bb70ded90a1b59c105531ab0e0cbd9f4b8d8f25578195bf182363a3df2abf249"}}


node_type: n8n-nodes-base.PayPal
name: PayPal
display_name: PayPal
description: Consume PayPal API
category: Other
code_hash: 1375d7a13c2cfc4ee9d6c6abd2b20daf2503641d47214ed515cfa09d25b12ceb
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/paypal
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PayPal = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const PaymentDescription_1 = require("./PaymentDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  class PayPal {
      constructor() {
          this.description = {
              displayName: 'PayPal',
              name: 'payPal',
              icon: 'file:paypal.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume PayPal API',
              defaults: {
                  name: 'PayPal',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'payPalApi',
                      required: true,
                      testedBy: 'payPalApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Payout',
                              value: 'payout',
                          },
                          {
                              name: 'Payout Item',
                              value: 'payoutItem',
                          },
                      ],
                      default: 'payout',
                  },
                  ...PaymentDescription_1.payoutOperations,
                  ...PaymentDescription_1.payoutItemOperations,
                  ...PaymentDescription_1.payoutFields,
                  ...PaymentDescription_1.payoutItemFields,
              ],
          };
          this.methods = {
              credentialTest: {
                  async payPalApiTest(credential) {
                      const credentials = credential.data;
                      const clientId = credentials.clientId;
                      const clientSecret = credentials.secret;
                      const environment = credentials.env;
                      if (!clientId || !clientSecret || !environment) {
                          return {
                              status: 'Error',
                              message: 'Connection details not valid: missing credentials',
                          };
                      }
                      let baseUrl = '';
                      if (environment !== 'live') {
                          baseUrl = 'https://api-m.sandbox.paypal.com';
                      }
                      else {
                          baseUrl = 'https://api-m.paypal.com';
                      }
                      const base64Key = Buffer.from(`${clientId}:${clientSecret}`).toString('base64');
                      const options = {
                          headers: {
                              Authorization: `Basic ${base64Key}`,
                          },
                          method: 'POST',
                          uri: `${baseUrl}/v1/oauth2/token`,
                          form: {
                              grant_type: 'client_credentials',
                          },
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful!',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: `Connection details not valid: ${error.message}`,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'payout') {
                      if (operation === 'create') {
                          const body = {};
                          const header = {};
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          const senderBatchId = this.getNodeParameter('senderBatchId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          header.sender_batch_id = senderBatchId;
                          if (additionalFields.emailSubject) {
                              header.email_subject = additionalFields.emailSubject;
                          }
                          if (additionalFields.emailMessage) {
                              header.email_message = additionalFields.emailMessage;
                          }
                          if (additionalFields.note) {
                              header.note = additionalFields.note;
                          }
                          body.sender_batch_header = header;
                          if (!jsonActive) {
                              const payoutItems = [];
                              const itemsValues = this.getNodeParameter('itemsUi', i)
                                  .itemsValues;
                              if (itemsValues && itemsValues.length > 0) {
                                  itemsValues.forEach((o) => {
                                      const payoutItem = {};
                                      const amount = {};
                                      amount.currency = o.currency;
                                      amount.value = parseFloat(o.amount);
                                      payoutItem.amount = amount;
                                      payoutItem.note = o.note || '';
                                      payoutItem.receiver = o.receiverValue;
                                      payoutItem.recipient_type = o.recipientType;
                                      payoutItem.recipient_wallet = o.recipientWallet;
                                      payoutItem.sender_item_id = o.senderItemId || '';
                                      payoutItems.push(payoutItem);
                                  });
                                  body.items = payoutItems;
                              }
                              else {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'You must have at least one item.', {
                                      itemIndex: i,
                                  });
                              }
                          }
                          else {
                              const itemsJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('itemsJson', i));
                              body.items = itemsJson;
                          }
                          responseData = await GenericFunctions_1.payPalApiRequest.call(this, '/payments/payouts', 'POST', body);
                      }
                      if (operation === 'get') {
                          const payoutBatchId = this.getNodeParameter('payoutBatchId', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.payPalApiRequestAllItems.call(this, 'items', `/payments/payouts/${payoutBatchId}`, 'GET', {}, qs);
                          }
                          else {
                              qs.page_size = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.payPalApiRequest.call(this, `/payments/payouts/${payoutBatchId}`, 'GET', {}, qs);
                              responseData = responseData.items;
                          }
                      }
                  }
                  else if (resource === 'payoutItem') {
                      if (operation === 'get') {
                          const payoutItemId = this.getNodeParameter('payoutItemId', i);
                          responseData = await GenericFunctions_1.payPalApiRequest.call(this, `/payments/payouts-item/${payoutItemId}`, 'GET', {}, qs);
                      }
                      if (operation === 'cancel') {
                          const payoutItemId = this.getNodeParameter('payoutItemId', i);
                          responseData = await GenericFunctions_1.payPalApiRequest.call(this, `/payments/payouts-item/${payoutItemId}/cancel`, 'POST', {}, qs);
                      }
                  }
                  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.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.PayPal = PayPal;
  //# sourceMappingURL=PayPal.node.js.map

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

  # PayPal credentials

  You can use these credentials to authenticate the following nodes:

  - [PayPal](/integrations/builtin/app-nodes/n8n-nodes-base.paypal.md)
  - [PayPal Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.paypaltrigger.md)

  ## Prerequisites

  Create a [PayPal developer](https://developer.paypal.com/home){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API client and secret

  ## Related resources

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

  ## Using API client and secret

  To configure this credential, you'll need:

  - A **Client ID**: Generated when you create an app.
  - A **Secret**: Generated when you create an app.
  - An **Environment**: Select **Live** or **Sandbox**.

  To generate the **Client ID** and **Secret**, log in to your Paypal [developer dashboard](https://developer.paypal.com/dashboard/). Select **Apps & Credentials > Rest API apps > Create app**. Refer to [Get client ID and client secret](https://developer.paypal.com/api/rest/#link-getclientidandclientsecret){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"ac14ac73-4788-4fcb-b984-198f72717b15","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"6e115f2e4e221d517947c90893357086aedec10d2f4a1eaefe798e4e55dbb5e2"}}


node_type: n8n-nodes-base.Oura
name: Oura
display_name: Oura
description: Consume Oura API
category: Other
code_hash: 3c4ad8b55a2145b2a84a4b817a39d16c29d21c18a75651654c38590046103429
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/oura
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
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.Oura = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ProfileDescription_1 = require("./ProfileDescription");
  const SummaryDescription_1 = require("./SummaryDescription");
  const moment_1 = __importDefault(require("moment"));
  class Oura {
      constructor() {
          this.description = {
              displayName: 'Oura',
              name: 'oura',
              icon: 'file:oura.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Oura API',
              defaults: {
                  name: 'Oura',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'ouraApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Profile',
                              value: 'profile',
                          },
                          {
                              name: 'Summary',
                              value: 'summary',
                          },
                      ],
                      default: 'summary',
                  },
                  ...ProfileDescription_1.profileOperations,
                  ...SummaryDescription_1.summaryOperations,
                  ...SummaryDescription_1.summaryFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const length = items.length;
          let responseData;
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              if (resource === 'profile') {
                  if (operation === 'get') {
                      responseData = await GenericFunctions_1.ouraApiRequest.call(this, 'GET', '/userinfo');
                  }
              }
              else if (resource === 'summary') {
                  const qs = {};
                  const { start, end } = this.getNodeParameter('filters', i);
                  const returnAll = this.getNodeParameter('returnAll', 0);
                  if (start) {
                      qs.start = (0, moment_1.default)(start).format('YYYY-MM-DD');
                  }
                  if (end) {
                      qs.end = (0, moment_1.default)(end).format('YYYY-MM-DD');
                  }
                  if (operation === 'getActivity') {
                      responseData = await GenericFunctions_1.ouraApiRequest.call(this, 'GET', '/activity', {}, qs);
                      responseData = responseData.activity;
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', 0);
                          responseData = responseData.splice(0, limit);
                      }
                  }
                  else if (operation === 'getReadiness') {
                      responseData = await GenericFunctions_1.ouraApiRequest.call(this, 'GET', '/readiness', {}, qs);
                      responseData = responseData.readiness;
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', 0);
                          responseData = responseData.splice(0, limit);
                      }
                  }
                  else if (operation === 'getSleep') {
                      responseData = await GenericFunctions_1.ouraApiRequest.call(this, 'GET', '/sleep', {}, qs);
                      responseData = responseData.sleep;
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', 0);
                          responseData = responseData.splice(0, limit);
                      }
                  }
              }
              Array.isArray(responseData)
                  ? returnData.push(...responseData)
                  : returnData.push(responseData);
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Oura = Oura;
  //# sourceMappingURL=Oura.node.js.map

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

  # Oura credentials

  You can use these credentials to authenticate the following nodes:

  - [Oura](/integrations/builtin/app-nodes/n8n-nodes-base.oura.md)

  ## Prerequisites

  Create an [Oura](https://ouraring.com/developer){:target=_blank .external-link} account.

  ## Supported authentication methods

  - API access token

  ## Related resources

  Refer to [Oura's API documentation](https://cloud.ouraring.com/v2/docs){:target=_blank .external-link} for more information about the service.

  ## Using API access token

  To configure this credential, you'll need:

  - A **Personal Access Token**: To generate a personal access token, go to the [Personal Access Tokens](https://cloud.ouraring.com/personal-access-tokens){:target=_blank .external-link} page and select **Create A New Personal Access Token**.

  Refer to [How to Generate Personal Access Tokens](https://support.ouraring.com/hc/en-us/articles/4415266939155-The-Oura-API#h_01H5B94SP4P9YHG9ZKN1H69E7Z){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"8bfe63da-e458-462d-9fb0-83b1b427273c","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"7b78f3443fdf2706897043f759aabc0e576da29ff7ab6d51a9f2eaf36d6148b0"}}


node_type: n8n-nodes-base.Peekalink
name: Peekalink
display_name: Peekalink
description: Consume the Peekalink API
category: Other
code_hash: 68e4409200b2213e37b6cc5bf382084ddb13163d47649a3d75b775e266d27916
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/peekalink
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Peekalink = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Peekalink {
      constructor() {
          this.description = {
              displayName: 'Peekalink',
              name: 'peekalink',
              icon: 'file:peekalink.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"]',
              description: 'Consume the Peekalink API',
              defaults: {
                  name: 'Peekalink',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'peekalinkApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Is Available',
                              value: 'isAvailable',
                              description: 'Check whether preview for a given link is available',
                              action: 'Check whether the preview for a given link is available',
                          },
                          {
                              name: 'Preview',
                              value: 'preview',
                              description: 'Return the preview for a link',
                              action: 'Return the preview for a link',
                          },
                      ],
                      default: 'preview',
                  },
                  {
                      displayName: 'URL',
                      name: 'url',
                      type: 'string',
                      default: '',
                      required: true,
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (operation === 'isAvailable') {
                      const url = this.getNodeParameter('url', i);
                      const body = {
                          link: url,
                      };
                      responseData = await GenericFunctions_1.peekalinkApiRequest.call(this, 'POST', '/is-available/', body);
                  }
                  if (operation === 'preview') {
                      const url = this.getNodeParameter('url', i);
                      const body = {
                          link: url,
                      };
                      responseData = await GenericFunctions_1.peekalinkApiRequest.call(this, 'POST', '/', body);
                  }
                  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.Peekalink = Peekalink;
  //# sourceMappingURL=Peekalink.node.js.map

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

  # Peekalink credentials

  You can use these credentials to authenticate the following nodes:

  - [Peekalink](/integrations/builtin/app-nodes/n8n-nodes-base.peekalink.md)

  ## Prerequisites

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

  ## Supported authentication methods

  - API key

  ## Related resources

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

  ## Using API key

  To configure this credential, you'll need:

  - An **API Key**: To get your API key, access your Peekalink [dashboard](https://www.peekalink.io/app/overview){:target=_blank .external-link} and copy the key in the **Your API Key** section. Refer to [Get your API key](https://docs.peekalink.io/setup#get-your-api-key){:target=_blank .external-link} for more information.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"3aef5f68-c9d1-460a-aa3c-40e33c24215d","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"99200da97e1bd2a8565f28e3abe4c1241b79e94f1cf5befe2c5da69507a5d885"}}


node_type: n8n-nodes-base.PhilipsHue
name: PhilipsHue
display_name: Philips Hue
description: Consume Philips Hue API
category: Other
code_hash: 3e7b5b2ac3e8be6b7b2ca8768d73e9539b78488a21c39e00bcd2a1da7e368d8e
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/philipshue
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PhilipsHue = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const LightDescription_1 = require("./LightDescription");
  class PhilipsHue {
      constructor() {
          this.description = {
              displayName: 'Philips Hue',
              name: 'philipsHue',
              icon: 'file:philipshue.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Philips Hue API',
              defaults: {
                  name: 'Philips Hue',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'philipsHueOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Light',
                              value: 'light',
                          },
                      ],
                      default: 'light',
                  },
                  ...LightDescription_1.lightOperations,
                  ...LightDescription_1.lightFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLights() {
                      const returnData = [];
                      const user = await GenericFunctions_1.getUser.call(this);
                      const lights = await GenericFunctions_1.philipsHueApiRequest.call(this, 'GET', `/api/${user}/lights`);
                      const groups = await GenericFunctions_1.philipsHueApiRequest.call(this, 'GET', `/api/${user}/groups`);
                      for (const light of Object.keys(lights)) {
                          let lightName = lights[light].name;
                          const lightId = light;
                          for (const groupId of Object.keys(groups)) {
                              if (groups[groupId].type === 'Room' && groups[groupId].lights.includes(lightId)) {
                                  lightName = `${groups[groupId].name}: ${lightName}`;
                              }
                          }
                          returnData.push({
                              name: lightName,
                              value: lightId,
                          });
                      }
                      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++) {
              if (resource === 'light') {
                  if (operation === 'update') {
                      const lightId = this.getNodeParameter('lightId', i);
                      const on = this.getNodeParameter('on', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          on,
                      };
                      if (additionalFields.transitiontime) {
                          additionalFields.transitiontime = additionalFields.transitiontime * 100;
                      }
                      if (additionalFields.xy) {
                          additionalFields.xy = additionalFields.xy
                              .split(',')
                              .map((e) => parseFloat(e));
                      }
                      if (additionalFields.xy_inc) {
                          additionalFields.xy_inc = additionalFields.xy_inc
                              .split(',')
                              .map((e) => parseFloat(e));
                      }
                      Object.assign(body, additionalFields);
                      const user = await GenericFunctions_1.getUser.call(this);
                      const data = await GenericFunctions_1.philipsHueApiRequest.call(this, 'PUT', `/api/${user}/lights/${lightId}/state`, body);
                      responseData = {};
                      for (const response of data) {
                          Object.assign(responseData, response.success);
                      }
                  }
                  if (operation === 'delete') {
                      const lightId = this.getNodeParameter('lightId', i);
                      const user = await GenericFunctions_1.getUser.call(this);
                      responseData = await GenericFunctions_1.philipsHueApiRequest.call(this, 'DELETE', `/api/${user}/lights/${lightId}`);
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const user = await GenericFunctions_1.getUser.call(this);
                      const lights = await GenericFunctions_1.philipsHueApiRequest.call(this, 'GET', `/api/${user}/lights`);
                      responseData = Object.values(lights);
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', i);
                          responseData = responseData.splice(0, limit);
                      }
                  }
                  if (operation === 'get') {
                      const lightId = this.getNodeParameter('lightId', i);
                      const user = await GenericFunctions_1.getUser.call(this);
                      responseData = await GenericFunctions_1.philipsHueApiRequest.call(this, 'GET', `/api/${user}/lights/${lightId}`);
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.PhilipsHue = PhilipsHue;
  //# sourceMappingURL=PhilipsHue.node.js.map

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

  # Philips Hue credentials

  You can use these credentials to authenticate the following nodes:

  - [Philips Hue](/integrations/builtin/app-nodes/n8n-nodes-base.philipshue.md)

  ## Prerequisites

  Create a [Philips Hue](https://www.philips-hue.com/en-us){:target=_blank .external-link} account.

  ## Supported authentication methods

  - OAuth2

  ## Related resources

  Refer to [Philips Hue's CLIP API documentation](https://developers.meethue.com/develop/hue-api-v2/api-reference/){:target=_blank .external-link} for more information about the service.

  ## Using OAuth2

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

  If you're using the built-in OAuth connection, you don't need to enter an **APP ID**.

  If you need to configure OAuth2 from scratch, you'll need a [Philips Hue developer](https://developers.meethue.com/){:target=_blank .external-link} account

  Create a new remote app on the [Add new Hue Remote API app](https://developers.meethue.com/add-new-hue-remote-api-app/) page.

  Use these settings for your app:

  - Copy the **OAuth Callback URL** from n8n and add it as a **Callback URL**.
  - Copy the **AppId**, **ClientId**, and **ClientSecret** and enter these in the corresponding fields in n8n.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"e1e290d9-99ff-45a3-bbff-9a33c7de16ca","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"e51965680f36d194221fc49f555b97a47e029ebe5952162ca10efd24a515eaea"}}


node_type: n8n-nodes-base.Pipedrive
name: Pipedrive
display_name: Pipedrive
description: Create and edit data in Pipedrive
category: Other
code_hash: c964e69be5af2dffe6fcff880f45c47f440717ee0bba524f67cf30b0cfb8cbe2
documentation_url: https://docs.n8n.io/integrations/builtin/credentials/pipedrive
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-08 08:05:27
updated_at: 2025-06-08 08:05:27
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Pipedrive = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utils_1 = require("./utils");
  function addAdditionalFields(body, additionalFields) {
      for (const key of Object.keys(additionalFields)) {
          if (key === 'customProperties' &&
              additionalFields.customProperties.property !== undefined) {
              for (const customProperty of additionalFields.customProperties
                  .property) {
                  body[customProperty.name] = customProperty.value;
              }
          }
          else {
              body[key] = additionalFields[key];
          }
      }
  }
  class Pipedrive {
      constructor() {
          this.description = {
              displayName: 'Pipedrive',
              name: 'pipedrive',
              icon: 'file:pipedrive.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Create and edit data in Pipedrive',
              defaults: {
                  name: 'Pipedrive',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'pipedriveApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['apiToken'],
                          },
                      },
                      testedBy: {
                          request: {
                              method: 'GET',
                              url: '/users/me',
                          },
                      },
                  },
                  {
                      name: 'pipedriveOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              requestDefaults: {
                  baseURL: 'https://api.pipedrive.com/v1',
                  url: '',
              },
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'API Token',
                              value: 'apiToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'apiToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Activity',
                              value: 'activity',
                          },
                          {
                              name: 'Deal',
                              value: 'deal',
                          },
                          {
                              name: 'Deal Activity',
                              value: 'dealActivity',
                          },
                          {
                              name: 'Deal Product',
                              value: 'dealProduct',
                          },
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Lead',
                              value: 'lead',
                          },
                          {
                              name: 'Note',
                              value: 'note',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Person',
                              value: 'person',
                          },
                          {
                              name: 'Product',
                              value: 'product',
                          },
                      ],
                      default: 'deal',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['activity'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create an activity',
                              action: 'Create an activity',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete an activity',
                              action: 'Delete an activity',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of an activity',
                              action: 'Get an activity',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many activities',
                              action: 'Get many activities',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update an activity',
                              action: 'Update an activity',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['deal'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a deal',
                              action: 'Create a deal',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a deal',
                              action: 'Delete a deal',
                          },
                          {
                              name: 'Duplicate',
                              value: 'duplicate',
                              description: 'Duplicate a deal',
                              action: 'Duplicate a deal',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of a deal',
                              action: 'Get a deal',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many deals',
                              action: 'Get many deals',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search a deal',
                              action: 'Search a deal',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a deal',
                              action: 'Update a deal',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['dealActivity'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many activities of a deal',
                              action: 'Get many deal activities',
                          },
                      ],
                      default: 'getAll',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['dealProduct'],
                          },
                      },
                      options: [
                          {
                              name: 'Add',
                              value: 'add',
                              description: 'Add a product to a deal',
                              action: 'Add a deal product',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many products in a deal',
                              action: 'Get many deal products',
                          },
                          {
                              name: 'Remove',
                              value: 'remove',
                              description: 'Remove a product from a deal',
                              action: 'Remove a deal product',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a product in a deal',
                              action: 'Update a deal product',
                          },
                      ],
                      default: 'add',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a file',
                              action: 'Create a file',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a file',
                              action: 'Delete a file',
                          },
                          {
                              name: 'Download',
                              value: 'download',
                              description: 'Download a file',
                              action: 'Download a file',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of a file',
                              action: 'Get a file',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update file details',
                              action: 'update details of a file',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a lead',
                              action: 'Create a lead',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a lead',
                              action: 'Delete a lead',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of a lead',
                              action: 'Get a lead',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many leads',
                              action: 'Get many leads',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a lead',
                              action: 'Update a lead',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['note'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a note',
                              action: 'Create a note',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a note',
                              action: 'Delete a note',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of a note',
                              action: 'Get a note',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many notes',
                              action: 'Get many notes',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a note',
                              action: 'Update a note',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['organization'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create an organization',
                              action: 'Create an organization',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete an organization',
                              action: 'Delete an organization',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of an organization',
                              action: 'Get an organization',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many organizations',
                              action: 'Get many organizations',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search organizations',
                              action: 'Search an organization',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update an organization',
                              action: 'Update an organization',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['person'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a person',
                              action: 'Create a person',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a person',
                              action: 'Delete a person',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get data of a person',
                              action: 'Get a person',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many persons',
                              action: 'Get many people',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search all persons',
                              action: 'Search a person',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a person',
                              action: 'Update a person',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['product'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get data of many products',
                              action: 'Get many products',
                          },
                      ],
                      default: 'getAll',
                  },
                  {
                      displayName: 'Subject',
                      name: 'subject',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['activity'],
                          },
                      },
                      description: 'The subject of the activity to create',
                  },
                  {
                      displayName: 'Done',
                      name: 'done',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['activity'],
                          },
                      },
                      options: [
                          {
                              name: 'Not Done',
                              value: '0',
                          },
                          {
                              name: 'Done',
                              value: '1',
                          },
                      ],
                      default: '0',
                      description: 'Whether the activity is done or not',
                  },
                  {
                      displayName: 'Type',
                      name: 'type',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['activity'],
                          },
                      },
                      placeholder: 'call',
                      description: 'Type of the activity like "call", "meeting", etc',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['activity'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Deal ID',
                              name: 'deal_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the deal this activity will be associated with',
                          },
                          {
                              displayName: 'Due Date',
                              name: 'due_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Due Date to activity be done YYYY-MM-DD',
                          },
                          {
                              displayName: 'Note',
                              name: 'note',
                              type: 'string',
                              typeOptions: {
                                  rows: 5,
                              },
                              default: '',
                              description: 'Note of the activity (HTML format)',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this activity will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this activity will be associated with',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the active user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              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: 'Activity ID',
                      name: 'activityId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['activity'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the activity to delete',
                  },
                  {
                      displayName: 'Activity ID',
                      name: 'activityId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['activity'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the activity to get',
                  },
                  {
                      displayName: 'Activity ID',
                      name: 'activityId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['activity'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the activity to update',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['activity'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Deal ID',
                              name: 'deal_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the deal this activity will be associated with',
                          },
                          {
                              displayName: 'Due Date',
                              name: 'due_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Due Date to activity be done YYYY-MM-DD',
                          },
                          {
                              displayName: 'Done',
                              name: 'done',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Not Done',
                                      value: '0',
                                  },
                                  {
                                      name: 'Done',
                                      value: '1',
                                  },
                              ],
                              default: '0',
                              description: 'Whether the activity is done or not',
                          },
                          {
                              displayName: 'Note',
                              name: 'note',
                              type: 'string',
                              typeOptions: {
                                  rows: 5,
                              },
                              default: '',
                              description: 'Note of the activity (HTML format)',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this activity will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this activity will be associated with',
                          },
                          {
                              displayName: 'Subject',
                              name: 'subject',
                              type: 'string',
                              default: '',
                              description: 'The subject of the activity',
                          },
                          {
                              displayName: 'Type',
                              name: 'type',
                              type: 'string',
                              default: '',
                              placeholder: 'call',
                              description: 'Type of the activity like "call", "meeting", etc',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the active user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              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: 'Title',
                      name: 'title',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['deal'],
                          },
                      },
                      description: 'The title of the deal to create',
                  },
                  {
                      displayName: 'Associate With',
                      name: 'associateWith',
                      type: 'options',
                      options: [
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Person',
                              value: 'person',
                          },
                      ],
                      default: 'organization',
                      description: 'Type of entity to link to this deal',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['deal'],
                              operation: ['create'],
                          },
                      },
                  },
                  {
                      displayName: 'Organization ID',
                      name: 'org_id',
                      type: 'number',
                      default: 0,
                      description: 'ID of the organization this deal will be associated with',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['deal'],
                              associateWith: ['organization'],
                          },
                      },
                  },
                  {
                      displayName: 'Person ID',
                      name: 'person_id',
                      type: 'number',
                      default: 0,
                      description: 'ID of the person this deal will be associated with',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['deal'],
                              associateWith: ['person'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['deal'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Currency',
                              name: 'currency',
                              type: 'string',
                              default: 'USD',
                              description: 'Currency of the deal. Accepts a 3-character currency code. Like EUR, USD, ...',
                          },
                          {
                              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 or ID',
                                              name: 'name',
                                              type: 'options',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getDealCustomFields',
                                              },
                                              default: '',
                                              description: 'Name of the property to set. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Label Name or ID',
                              name: 'label',
                              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: 'getDealLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Lost Reason',
                              name: 'lost_reason',
                              type: 'string',
                              default: '',
                              description: 'Reason why the deal was lost',
                          },
                          {
                              displayName: 'Organization ID',
                              name: 'org_id',
                              type: 'number',
                              default: 0,
                              displayOptions: {
                                  show: {
                                      '/associateWith': ['person'],
                                  },
                              },
                              description: 'ID of the organization this deal will be associated with',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              displayOptions: {
                                  show: {
                                      '/associateWith': ['organization'],
                                  },
                              },
                              description: 'ID of the person this deal will be associated with',
                          },
                          {
                              displayName: 'Probability',
                              name: 'probability',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                                  maxValue: 100,
                              },
                              default: 0,
                              description: 'Deal success probability percentage',
                          },
                          {
                              displayName: 'Stage Name or ID',
                              name: 'stage_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getStageIds',
                              },
                              default: '',
                              description: 'ID of the stage this deal will be placed in a pipeline. If omitted, the deal will be placed in the first stage of the default pipeline. (PIPELINE > STAGE). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Open',
                                      value: 'open',
                                  },
                                  {
                                      name: 'Won',
                                      value: 'won',
                                  },
                                  {
                                      name: 'Lost',
                                      value: 'lost',
                                  },
                                  {
                                      name: 'Deleted',
                                      value: 'deleted',
                                  },
                              ],
                              default: 'open',
                              description: 'The status of the deal. If not provided it will automatically be set to "open".',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the active user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Value',
                              name: 'value',
                              type: 'number',
                              default: 0,
                              description: 'Value of the deal. If not set it will automatically be set to 0.',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the deal. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                      ],
                  },
                  {
                      displayName: 'Deal ID',
                      name: 'dealId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['deal'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the deal to delete',
                  },
                  {
                      displayName: 'Deal ID',
                      name: 'dealId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['duplicate'],
                              resource: ['deal'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the deal to duplicate',
                  },
                  {
                      displayName: 'Deal ID',
                      name: 'dealId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['deal'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the deal to get',
                  },
                  {
                      displayName: 'Deal ID',
                      name: 'dealId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['deal'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the deal to update',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['deal'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Currency',
                              name: 'currency',
                              type: 'string',
                              default: 'USD',
                              description: 'Currency of the deal. Accepts a 3-character currency code. Like EUR, USD, ...',
                          },
                          {
                              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 or ID',
                                              name: 'name',
                                              type: 'options',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getDealCustomFields',
                                              },
                                              default: '',
                                              description: 'Name of the custom field to set. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the active user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Label Name or ID',
                              name: 'label',
                              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: 'getDealLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Lost Reason',
                              name: 'lost_reason',
                              type: 'string',
                              default: '',
                              description: 'Reason why the deal was lost',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this deal will be associated with',
                          },
                          {
                              displayName: 'Probability',
                              name: 'probability',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                                  maxValue: 100,
                              },
                              default: 0,
                              description: 'Deal success probability percentage',
                          },
                          {
                              displayName: 'Stage Name or ID',
                              name: 'stage_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getStageIds',
                              },
                              default: '',
                              description: 'ID of the stage this deal will be placed in a pipeline. If omitted, the deal will be placed in the first stage of the default pipeline. (PIPELINE > STAGE). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Open',
                                      value: 'open',
                                  },
                                  {
                                      name: 'Won',
                                      value: 'won',
                                  },
                                  {
                                      name: 'Lost',
                                      value: 'lost',
                                  },
                                  {
                                      name: 'Deleted',
                                      value: 'deleted',
                                  },
                              ],
                              default: 'open',
                              description: 'The status of the deal. If not provided it will automatically be set to "open".',
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'The title of the deal',
                          },
                          {
                              displayName: 'Value',
                              name: 'value',
                              type: 'number',
                              default: 0,
                              description: 'Value of the deal. If not set it will automatically be set to 0.',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the deal. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                      ],
                  },
                  {
                      displayName: 'Deal Name or ID',
                      name: 'dealId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getDeals',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'The ID of the deal to add a product to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Product Name or ID',
                      name: 'productId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getProducts',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'The ID of the product to add to a deal. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Item Price',
                      name: 'item_price',
                      type: 'number',
                      typeOptions: {
                          numberPrecision: 2,
                      },
                      default: 0.0,
                      required: true,
                      description: 'Price at which to add or update this product in a deal',
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['dealProduct'],
                          },
                      },
                  },
                  {
                      displayName: 'Quantity',
                      name: 'quantity',
                      type: 'number',
                      default: 1,
                      typeOptions: {
                          minValue: 1,
                      },
                      required: true,
                      description: 'How many items of this product to add/update in a deal',
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['dealProduct'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['add'],
                              resource: ['dealProduct'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Comments',
                              name: 'comments',
                              type: 'string',
                              typeOptions: {
                                  rows: 4,
                              },
                              default: '',
                              description: 'Text to describe this product-deal attachment',
                          },
                          {
                              displayName: 'Discount Percentage',
                              name: 'discount_percentage',
                              type: 'number',
                              default: 0,
                              typeOptions: {
                                  minValue: 0,
                                  maxValue: 100,
                              },
                              description: 'Percentage of discount to apply',
                          },
                          {
                              displayName: 'Product Variation ID',
                              name: 'product_variation_id',
                              type: 'string',
                              default: '',
                              description: 'ID of the product variation to use',
                          },
                      ],
                  },
                  {
                      displayName: 'Deal Name or ID',
                      name: 'dealId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getDeals',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'The ID of the deal whose product to update. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Product Attachment Name or ID',
                      name: 'productAttachmentId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getProductsDeal',
                          loadOptionsDependsOn: ['dealId'],
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'ID of the deal-product (the ID of the product attached to the deal). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['dealProduct'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Comments',
                              name: 'comments',
                              type: 'string',
                              typeOptions: {
                                  rows: 4,
                              },
                              default: '',
                              description: 'Text to describe this product-deal attachment',
                          },
                          {
                              displayName: 'Discount Percentage',
                              name: 'discount_percentage',
                              type: 'number',
                              default: 0,
                              typeOptions: {
                                  minValue: 0,
                                  maxValue: 100,
                              },
                              description: 'Percentage of discount to apply',
                          },
                          {
                              displayName: 'Item Price',
                              name: 'item_price',
                              type: 'number',
                              typeOptions: {
                                  numberPrecision: 2,
                              },
                              default: 0.0,
                              description: 'Price at which to add or update this product in a deal',
                          },
                          {
                              displayName: 'Quantity',
                              name: 'quantity',
                              type: 'number',
                              default: 1,
                              typeOptions: {
                                  minValue: 1,
                              },
                              description: 'How many items of this product to add/update in a deal',
                          },
                          {
                              displayName: 'Product Variation ID',
                              name: 'product_variation_id',
                              type: 'string',
                              default: '',
                              description: 'ID of the product variation to use',
                          },
                      ],
                  },
                  {
                      displayName: 'Deal Name or ID',
                      name: 'dealId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getDeals',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['remove'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'The ID of the deal whose product to remove. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Product Attachment Name or ID',
                      name: 'productAttachmentId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getProductsDeal',
                          loadOptionsDependsOn: ['dealId'],
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['remove'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'ID of the deal-product (the ID of the product attached to the deal). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Deal Name or ID',
                      name: 'dealId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getDeals',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['dealProduct'],
                          },
                      },
                      description: 'The ID of the deal whose products to retrieve. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Term',
                      name: 'term',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['deal'],
                          },
                      },
                      default: '',
                      description: 'The search term to look for. Minimum 2 characters (or 1 if using exact_match).',
                  },
                  {
                      displayName: 'Exact Match',
                      name: 'exactMatch',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['deal'],
                          },
                      },
                      default: false,
                      description: 'Whether only full exact matches against the given term are returned. It is not case sensitive.',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 500,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['deal'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Include Fields',
                              name: 'includeFields',
                              type: 'string',
                              default: '',
                              description: 'Supports including optional fields in the results which are not provided by default. Example: deal.cc_email.',
                          },
                          {
                              displayName: 'Organization ID',
                              name: 'organizationId',
                              type: 'string',
                              default: '',
                              description: 'Will filter Deals by the provided Organization ID',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'personId',
                              type: 'string',
                              default: '',
                              description: 'Will filter Deals by the provided Person ID',
                          },
                          {
                              displayName: 'Search Fields',
                              name: 'fields',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Custom Fields',
                                      value: 'custom_fields',
                                  },
                                  {
                                      name: 'Notes',
                                      value: 'notes',
                                  },
                                  {
                                      name: 'Title',
                                      value: 'title',
                                  },
                              ],
                              default: ['custom_fields', 'notes', 'title'],
                              description: 'A comma-separated string array. The fields to perform the search from. Defaults to all of them.',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Open',
                                      value: 'open',
                                  },
                                  {
                                      name: 'Won',
                                      value: 'won',
                                  },
                                  {
                                      name: 'Lost',
                                      value: 'lost',
                                  },
                              ],
                              default: 'open',
                              description: 'The status of the deal. If not provided it will automatically be set to "open".',
                          },
                      ],
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file to be created',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['file'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Activity ID',
                              name: 'activity_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the activite this file will be associated with',
                          },
                          {
                              displayName: 'Deal ID',
                              name: 'deal_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the deal this file will be associated with',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this file will be associated with',
                          },
                          {
                              displayName: 'Product ID',
                              name: 'product_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this file will be associated with',
                          },
                      ],
                  },
                  {
                      displayName: 'File ID',
                      name: 'fileId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['file'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the file to delete',
                  },
                  {
                      displayName: 'File ID',
                      name: 'fileId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the file to download',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      description: 'Name of the binary property to which to write the data of the downloaded file',
                  },
                  {
                      displayName: 'File ID',
                      name: 'fileId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the file to get',
                  },
                  {
                      displayName: 'File ID',
                      name: 'fileId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['file'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the file to update',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['file'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Name',
                              name: 'name',
                              type: 'string',
                              default: '',
                              description: 'The updated visible name of the file',
                          },
                          {
                              displayName: 'Description',
                              name: 'description',
                              type: 'string',
                              default: '',
                              description: 'The updated description of the file',
                          },
                      ],
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      description: 'Name of the lead to create',
                      type: 'string',
                      required: true,
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['create'],
                          },
                      },
                  },
                  {
                      displayName: 'Associate With',
                      name: 'associateWith',
                      type: 'options',
                      options: [
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Person',
                              value: 'person',
                          },
                      ],
                      default: 'organization',
                      description: 'Type of entity to link to this lead',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['create'],
                          },
                      },
                  },
                  {
                      displayName: 'Organization ID',
                      name: 'organization_id',
                      type: 'number',
                      default: 0,
                      description: 'ID of the organization to link to this lead',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['create'],
                              associateWith: ['organization'],
                          },
                      },
                  },
                  {
                      displayName: 'Person ID',
                      name: 'person_id',
                      type: 'number',
                      default: 0,
                      description: 'ID of the person to link to this lead',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['create'],
                              associateWith: ['person'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['create'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Expected Close Date',
                              name: 'expected_close_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Date when the lead’s deal is expected to be closed, in ISO-8601 format',
                          },
                          {
                              displayName: 'Label Names or IDs',
                              name: 'label_ids',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getLeadLabels',
                              },
                              default: [],
                              description: 'ID of the labels to attach to the lead to create. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Organization ID',
                              name: 'organization_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the organization to link to this lead',
                              displayOptions: {
                                  show: {
                                      '/associateWith': ['person'],
                                  },
                              },
                          },
                          {
                              displayName: 'Owner Name or ID',
                              name: 'owner_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the user who will own the lead to create. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person to link to this lead',
                              displayOptions: {
                                  show: {
                                      '/associateWith': ['organization'],
                                  },
                              },
                          },
                          {
                              displayName: 'Value',
                              name: 'value',
                              type: 'fixedCollection',
                              description: 'Potential monetary value associated with the lead',
                              default: {},
                              options: [
                                  {
                                      displayName: 'Value Properties',
                                      name: 'valueProperties',
                                      values: [
                                          {
                                              displayName: 'Amount',
                                              name: 'amount',
                                              type: 'number',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Currency',
                                              name: 'currency',
                                              type: 'options',
                                              default: 'USD',
                                              options: utils_1.currencies.sort((a, b) => a.name.localeCompare(b.name)),
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Lead ID',
                      name: 'leadId',
                      description: 'ID of the lead to delete',
                      type: 'string',
                      required: true,
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['delete'],
                          },
                      },
                  },
                  {
                      displayName: 'Lead ID',
                      name: 'leadId',
                      description: 'ID of the lead to retrieve',
                      type: 'string',
                      required: true,
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['get'],
                          },
                      },
                  },
                  {
                      displayName: 'Lead ID',
                      name: 'leadId',
                      description: 'ID of the lead to update',
                      type: 'string',
                      required: true,
                      default: '',
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['update'],
                          },
                      },
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['update'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              default: '',
                              description: 'Name of the lead to update',
                          },
                          {
                              displayName: 'Owner Name or ID',
                              name: 'owner_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the user who will own the lead to update. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Label Names or IDs',
                              name: 'label_ids',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getLeadLabels',
                              },
                              default: [],
                              description: 'ID of the labels to attach to the lead to update. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person Name or ID',
                              name: 'person_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getPersons',
                              },
                              default: '',
                              description: 'ID of the person to link to this lead. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Value',
                              name: 'value',
                              type: 'fixedCollection',
                              description: 'Potential monetary value associated with the lead',
                              default: {},
                              options: [
                                  {
                                      displayName: 'Value Properties',
                                      name: 'valueProperties',
                                      values: [
                                          {
                                              displayName: 'Amount',
                                              name: 'amount',
                                              type: 'number',
                                              default: '',
                                          },
                                          {
                                              displayName: 'Currency',
                                              name: 'currency',
                                              type: 'options',
                                              default: 'USD',
                                              options: utils_1.currencies.sort((a, b) => a.name.localeCompare(b.name)),
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Expected Close Date',
                              name: 'expected_close_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Date when the lead’s deal is expected to be closed, in ISO-8601 format',
                          },
                      ],
                  },
                  {
                      displayName: 'Content',
                      name: 'content',
                      typeOptions: {
                          rows: 5,
                      },
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['note'],
                          },
                      },
                      description: 'The content of the note to create',
                  },
                  {
                      displayName: 'Note ID',
                      name: 'noteId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['note'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the note to delete',
                  },
                  {
                      displayName: 'Note ID',
                      name: 'noteId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['note'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the note to get',
                  },
                  {
                      displayName: 'Note ID',
                      name: 'noteId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['note'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the note to update',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['note'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Content',
                              name: 'content',
                              typeOptions: {
                                  rows: 5,
                              },
                              type: 'string',
                              default: '',
                              description: 'The content of the note',
                          },
                          {
                              displayName: 'Deal ID',
                              name: 'deal_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the deal this note will be associated with',
                          },
                          {
                              displayName: 'Lead ID',
                              name: 'lead_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the lead this note will be associated with',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this note will be associated with',
                          },
                      ],
                  },
                  {
                      displayName: 'Name',
                      name: 'name',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['organization'],
                          },
                      },
                      description: 'The name of the organization to create',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['organization'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              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: 'Label Name or ID',
                              name: 'label',
                              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: 'getOrganizationLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the person. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                      ],
                  },
                  {
                      displayName: 'Organization ID',
                      name: 'organizationId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['organization'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the organization to delete',
                  },
                  {
                      displayName: 'Organization ID',
                      name: 'organizationId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['organization'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the organization to get',
                  },
                  {
                      displayName: 'Term',
                      name: 'term',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['organization'],
                          },
                      },
                      default: '',
                      description: 'The search term to look for. Minimum 2 characters (or 1 if using exact_match).',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['organization'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Exact Match',
                              name: 'exactMatch',
                              type: 'boolean',
                              default: false,
                              description: 'Whether only full exact matches against the given term are returned. It is not case sensitive.',
                          },
                          {
                              displayName: 'Fields',
                              name: 'fields',
                              type: 'multiOptions',
                              default: [],
                              description: 'Fields to the search in. Defaults to all of them.',
                              options: [
                                  {
                                      name: 'Address',
                                      value: 'address',
                                  },
                                  {
                                      name: 'Custom Fields',
                                      value: 'custom_fields',
                                  },
                                  {
                                      name: 'Name',
                                      value: 'name',
                                  },
                                  {
                                      name: 'Notes',
                                      value: 'notes',
                                  },
                              ],
                          },
                          {
                              displayName: 'RAW Data',
                              name: 'rawData',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to return the data exactly in the way it got received from the API',
                          },
                      ],
                  },
                  {
                      displayName: 'Organization ID',
                      name: 'organizationId',
                      type: 'number',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['organization'],
                          },
                      },
                      description: 'The ID of the organization to create',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['organization'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              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: 'Label Name or ID',
                              name: 'label',
                              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: 'getOrganizationLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Name',
                              name: 'name',
                              type: 'string',
                              default: '',
                              description: 'Organization name',
                          },
                          {
                              displayName: 'Owner ID',
                              name: 'owner_id',
                              type: 'number',
                              default: 0,
                              description: 'The ID of the user who will be marked as the owner of this Organization. When omitted, the authorized User ID will be used.',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the person. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                      ],
                  },
                  {
                      displayName: 'Name',
                      name: 'name',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['person'],
                          },
                      },
                      description: 'The name of the person to create',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['person'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              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 or ID',
                                              name: 'name',
                                              type: 'options',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getPersonCustomFields',
                                              },
                                              default: '',
                                              description: 'Name of the custom field to set. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Email',
                              name: 'email',
                              type: 'string',
                              placeholder: 'name@email.com',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: '',
                              description: 'Email of the person',
                          },
                          {
                              displayName: 'Label Name or ID',
                              name: 'label',
                              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: 'getPersonLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Marketing Status',
                              name: 'marketing_status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'No Consent',
                                      value: 'no_consent',
                                  },
                                  {
                                      name: 'Unsubscribed',
                                      value: 'unsubscribed',
                                  },
                                  {
                                      name: 'Subscribed',
                                      value: 'subscribed',
                                  },
                                  {
                                      name: 'Archived',
                                      value: 'archived',
                                  },
                              ],
                              default: 'subscribed',
                              description: 'Please be aware that it is only allowed once to change the marketing status from an old status to a new one',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Phone',
                              name: 'phone',
                              type: 'string',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: '',
                              description: 'Phone number of the person',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the person. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'owner_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the User this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
                  {
                      displayName: 'Person ID',
                      name: 'personId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['person'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the person to delete',
                  },
                  {
                      displayName: 'Person ID',
                      name: 'personId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['person'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the person to get',
                  },
                  {
                      displayName: 'Person ID',
                      name: 'personId',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['person'],
                          },
                      },
                      default: 0,
                      required: true,
                      description: 'ID of the person to update',
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      description: 'The fields to update',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['update'],
                              resource: ['person'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              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 or ID',
                                              name: 'name',
                                              type: 'options',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getPersonCustomFields',
                                              },
                                              default: '',
                                              description: 'Name of the custom field to set. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                          },
                                          {
                                              displayName: 'Property Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                              description: 'Value of the property to set',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Email',
                              name: 'email',
                              type: 'string',
                              placeholder: 'name@email.com',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: '',
                              description: 'Email of the person',
                          },
                          {
                              displayName: 'Label Name or ID',
                              name: 'label',
                              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: 'getPersonLabels',
                              },
                              default: '',
                          },
                          {
                              displayName: 'Marketing Status',
                              name: 'marketing_status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'No Consent',
                                      value: 'no_consent',
                                  },
                                  {
                                      name: 'Unsubscribed',
                                      value: 'unsubscribed',
                                  },
                                  {
                                      name: 'Subscribed',
                                      value: 'subscribed',
                                  },
                                  {
                                      name: 'Archived',
                                      value: 'archived',
                                  },
                              ],
                              default: 'subscribed',
                              description: 'Please be aware that it is only allowed once to change the marketing status from an old status to a new one',
                          },
                          {
                              displayName: 'Name',
                              name: 'name',
                              type: 'string',
                              default: '',
                              description: 'The name of the person',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Phone',
                              name: 'phone',
                              type: 'string',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: '',
                              description: 'Phone number of the person',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'owner_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the User this person will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Visible To',
                              name: 'visible_to',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Owner & Followers (Private)',
                                      value: '1',
                                  },
                                  {
                                      name: 'Entire Company (Shared)',
                                      value: '3',
                                  },
                              ],
                              default: '3',
                              description: 'Visibility of the deal. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.',
                          },
                      ],
                  },
                  {
                      displayName: 'Resolve Properties',
                      name: 'resolveProperties',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['activity', 'deal', 'organization', 'person', 'product'],
                              operation: ['get', 'getAll'],
                          },
                      },
                      default: false,
                      description: 'By default do custom properties get returned only as ID instead of their actual name. Also option fields contain only the ID instead of their actual value. If this option gets set they get automatically resolved.',
                  },
                  {
                      displayName: 'Encode Properties',
                      name: 'encodeProperties',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['activity', 'deal', 'organization', 'person', 'product'],
                              operation: ['update'],
                          },
                      },
                      default: false,
                      description: 'By default do custom properties have to be set as ID instead of their actual name. Also option fields have to be set as ID instead of their actual value. If this option gets set they get automatically encoded.',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 500,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Deal Name or ID',
                      name: 'dealId',
                      type: 'options',
                      default: '',
                      typeOptions: {
                          loadOptionsMethod: 'getDeals',
                      },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['dealActivity'],
                          },
                      },
                      description: 'The ID of the deal whose activity to retrieve. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['dealActivity'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Done',
                              name: 'done',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the activity is done or not',
                          },
                          {
                              displayName: 'Exclude Activity IDs',
                              name: 'exclude',
                              type: 'string',
                              default: '',
                              description: 'A comma-separated Activity IDs, to exclude from result. Ex. 4, 9, 11, ...',
                          },
                      ],
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['lead'],
                              operation: ['getAll'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Archived Status',
                              name: 'archived_status',
                              type: 'options',
                              default: 'all',
                              options: [
                                  {
                                      name: 'Archived',
                                      value: 'archived',
                                  },
                                  {
                                      name: 'All',
                                      value: 'all',
                                  },
                                  {
                                      name: 'Not Archived',
                                      value: 'not_archived',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['organization'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'First Char',
                              name: 'firstChar',
                              type: 'string',
                              default: '',
                              description: 'If supplied, only organizations whose name starts with the specified letter will be returned',
                          },
                          {
                              displayName: 'Predefined Filter Name or ID',
                              name: 'filterId',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getFilters',
                              },
                              default: '',
                              description: 'ID of the filter to use. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['person'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Predefined Filter Name or ID',
                              name: 'filterId',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getFilters',
                              },
                              default: '',
                              description: 'ID of the filter to use. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'First Char',
                              name: 'firstChar',
                              type: 'string',
                              default: '',
                              description: 'If supplied, only persons whose name starts with the specified letter will be returned',
                          },
                      ],
                  },
                  {
                      displayName: 'Term',
                      name: 'term',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['person'],
                          },
                      },
                      default: '',
                      description: 'The search term to look for. Minimum 2 characters (or 1 if using exact_match).',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['search'],
                              resource: ['person'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Exact Match',
                              name: 'exactMatch',
                              type: 'boolean',
                              default: false,
                              description: 'Whether only full exact matches against the given term are returned. It is not case sensitive.',
                          },
                          {
                              displayName: 'Fields',
                              name: 'fields',
                              type: 'string',
                              default: '',
                              description: 'A comma-separated string array. The fields to perform the search from. Defaults to all of them.',
                          },
                          {
                              displayName: 'Include Fields',
                              name: 'includeFields',
                              type: 'string',
                              default: '',
                              description: 'Supports including optional fields in the results which are not provided by default',
                          },
                          {
                              displayName: 'Organization ID',
                              name: 'organizationId',
                              type: 'string',
                              default: '',
                              description: 'Will filter Deals by the provided Organization ID',
                          },
                          {
                              displayName: 'RAW Data',
                              name: 'rawData',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to return the data exactly in the way it got received from the API',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create', 'getAll'],
                              resource: ['note'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Deal ID',
                              name: 'deal_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the deal this note will be associated with',
                          },
                          {
                              displayName: 'Lead ID',
                              name: 'lead_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the lead this note will be associated with',
                          },
                          {
                              displayName: 'Organization Name or ID',
                              name: 'org_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getOrganizationIds',
                              },
                              default: '',
                              description: 'ID of the organization this deal will be associated with. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Person ID',
                              name: 'person_id',
                              type: 'number',
                              default: 0,
                              description: 'ID of the person this note will be associated with',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['activity'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Done',
                              name: 'done',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the Activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities.',
                          },
                          {
                              displayName: 'End Date',
                              name: 'end_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Use the Activity due date where you wish to stop fetching Activities from. Insert due date in YYYY-MM-DD format.',
                          },
                          {
                              displayName: 'Predefined Filter Name or ID',
                              name: 'filterId',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getFilters',
                              },
                              default: '',
                              description: 'The ID of the Filter to use (will narrow down results if used together with user_id parameter). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Star Date',
                              name: 'start_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Use the Activity due date where you wish to begin fetching Activities from. Insert due date in YYYY-MM-DD format.',
                          },
                          {
                              displayName: 'Type Names or IDs',
                              name: 'type',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getActivityTypes',
                              },
                              default: [],
                              description: 'Type of the Activity. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'The ID of the User whose Activities will be fetched. If omitted, the User associated with the API token will be used. If 0, Activities for all company Users will be fetched based on the permission sets. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['deal'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Predefined Filter Name or ID',
                              name: 'filter_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getFilters',
                              },
                              default: '',
                              description: 'Predefined filter to apply to the deals to retrieve. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Stage Name or ID',
                              name: 'stage_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getStageIds',
                              },
                              default: '',
                              description: 'ID of the stage to filter deals by. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'All Not Deleted',
                                      value: 'all_not_deleted',
                                  },
                                  {
                                      name: 'Deleted',
                                      value: 'deleted',
                                  },
                                  {
                                      name: 'Lost',
                                      value: 'lost',
                                  },
                                  {
                                      name: 'Open',
                                      value: 'open',
                                  },
                                  {
                                      name: 'Won',
                                      value: 'won',
                                  },
                              ],
                              default: 'all_not_deleted',
                              description: 'Status to filter deals by. Defaults to <code>all_not_deleted</code>',
                          },
                          {
                              displayName: 'User Name or ID',
                              name: 'user_id',
                              type: 'options',
                              typeOptions: {
                                  loadOptionsMethod: 'getUserIds',
                              },
                              default: '',
                              description: 'ID of the user to filter deals by. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getActivityTypes() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/activityTypes', {});
                      for (const activity of data) {
                          returnData.push({
                              name: activity.name,
                              value: activity.key_string,
                          });
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getFilters() {
                      const returnData = [];
                      const resource = this.getNodeParameter('resource');
                      const type = {
                          deal: 'deals',
                          activity: 'activity',
                          person: 'people',
                          organization: 'org',
                      };
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/filters', {}, { type: type[resource] });
                      for (const filter of data) {
                          returnData.push({
                              name: filter.name,
                              value: filter.id,
                          });
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getOrganizationIds() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/organizations', {});
                      for (const org of data) {
                          returnData.push({
                              name: org.name,
                              value: org.id,
                          });
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getUserIds() {
                      const returnData = [];
                      const resource = this.getCurrentNodeParameter('resource');
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/users', {});
                      for (const user of data) {
                          if (user.active_flag === true) {
                              returnData.push({
                                  name: user.name,
                                  value: user.id,
                              });
                          }
                      }
                      if (resource === 'activity') {
                          returnData.push({
                              name: 'All Users',
                              value: 0,
                          });
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getDeals() {
                      const { data } = (await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/deals', {}));
                      return (0, GenericFunctions_1.sortOptionParameters)(data.map(({ id, title }) => ({ value: id, name: title })));
                  },
                  async getProducts() {
                      const { data } = (await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/products', {}));
                      return (0, GenericFunctions_1.sortOptionParameters)(data.map(({ id, name }) => ({ value: id, name })));
                  },
                  async getProductsDeal() {
                      const dealId = this.getCurrentNodeParameter('dealId');
                      const { data } = (await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', `/deals/${dealId}/products`, {}));
                      return (0, GenericFunctions_1.sortOptionParameters)(data.map(({ id, name }) => ({ value: id, name })));
                  },
                  async getStageIds() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/stages', {});
                      for (const stage of data) {
                          returnData.push({
                              name: `${stage.pipeline_name} > ${stage.name}`,
                              value: stage.id,
                          });
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getOrganizationCustomFields() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/organizationFields', {});
                      for (const field of data) {
                          if (field.key.length === 40) {
                              returnData.push({
                                  name: field.name,
                                  value: field.key,
                              });
                          }
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getDealCustomFields() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/dealFields', {});
                      for (const field of data) {
                          if (field.key.length === 40) {
                              returnData.push({
                                  name: field.name,
                                  value: field.key,
                              });
                          }
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getPersonCustomFields() {
                      const returnData = [];
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/personFields', {});
                      for (const field of data) {
                          if (field.key.length === 40) {
                              returnData.push({
                                  name: field.name,
                                  value: field.key,
                              });
                          }
                      }
                      return (0, GenericFunctions_1.sortOptionParameters)(returnData);
                  },
                  async getPersonLabels() {
                      const returnData = [];
                      const operation = this.getCurrentNodeParameter('operation');
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/personFields', {});
                      for (const field of data) {
                          if (field.key === 'label') {
                              if (field.options) {
                                  for (const option of field.options) {
                                      returnData.push({
                                          name: option.label,
                                          value: option.id,
                                      });
                                  }
                              }
                          }
                      }
                      (0, GenericFunctions_1.sortOptionParameters)(returnData);
                      if (operation === 'update') {
                          returnData.push({
                              name: 'No Label',
                              value: 'null',
                          });
                      }
                      return returnData;
                  },
                  async getOrganizationLabels() {
                      const returnData = [];
                      const operation = this.getCurrentNodeParameter('operation');
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/organizationFields', {});
                      for (const field of data) {
                          if (field.key === 'label') {
                              if (field.options) {
                                  for (const option of field.options) {
                                      returnData.push({
                                          name: option.label,
                                          value: option.id,
                                      });
                                  }
                              }
                          }
                      }
                      (0, GenericFunctions_1.sortOptionParameters)(returnData);
                      if (operation === 'update') {
                          returnData.push({
                              name: 'No Label',
                              value: 'null',
                          });
                      }
                      return returnData;
                  },
                  async getPersons() {
                      const { data } = (await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/persons', {}));
                      return (0, GenericFunctions_1.sortOptionParameters)(data.map(({ id, name }) => ({ value: id, name })));
                  },
                  async getLeadLabels() {
                      const { data } = (await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/leadLabels', {}));
                      return (0, GenericFunctions_1.sortOptionParameters)(data.map(({ id, name }) => ({ value: id, name })));
                  },
                  async getDealLabels() {
                      const returnData = [];
                      const operation = this.getCurrentNodeParameter('operation');
                      const { data } = await GenericFunctions_1.pipedriveApiRequest.call(this, 'GET', '/dealFields', {});
                      for (const field of data) {
                          if (field.key === 'label') {
                              if (field.options) {
                                  for (const option of field.options) {
                                      returnData.push({
                                          name: option.label,
                                          value: option.id,
                                      });
                                  }
                              }
                          }
                      }
                      (0, GenericFunctions_1.sortOptionParameters)(returnData);
                      if (operation === 'update') {
                          returnData.push({
                              name: 'No Label',
                              value: 'null',
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          var _a, _b;
          const items = this.getInputData();
          const returnData = [];
          let body;
          let formData;
          let qs;
          let downloadFile;
          let requestMethod;
          let endpoint;
          let returnAll = false;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let customProperties;
          if (['get', 'getAll', 'update'].includes(operation) &&
              ['activity', 'deal', 'organization', 'person', 'product'].includes(resource)) {
              let getCustomProperties = false;
              if (['update'].includes(operation)) {
                  getCustomProperties = this.getNodeParameter('encodeProperties', 0, false);
              }
              else {
                  getCustomProperties = this.getNodeParameter('resolveProperties', 0, false);
              }
              if (getCustomProperties) {
                  customProperties = await GenericFunctions_1.pipedriveGetCustomProperties.call(this, resource);
              }
          }
          for (let i = 0; i < items.length; i++) {
              requestMethod = 'GET';
              endpoint = '';
              downloadFile = false;
              body = {};
              formData = {};
              qs = {};
              try {
                  if (resource === 'activity') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/activities';
                          body.subject = this.getNodeParameter('subject', i);
                          body.done = this.getNodeParameter('done', i);
                          body.type = this.getNodeParameter('type', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const activityId = this.getNodeParameter('activityId', i);
                          endpoint = `/activities/${activityId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const activityId = this.getNodeParameter('activityId', i);
                          endpoint = `/activities/${activityId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(qs, additionalFields);
                          if (qs.filterId) {
                              qs.filter_id = qs.filterId;
                              delete qs.filterId;
                          }
                          if (qs.type) {
                              qs.type = qs.type.join(',');
                          }
                          endpoint = '/activities';
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const activityId = this.getNodeParameter('activityId', i);
                          endpoint = `/activities/${activityId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                      }
                  }
                  else if (resource === 'deal') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/deals';
                          body.title = this.getNodeParameter('title', i);
                          const associateWith = this.getNodeParameter('associateWith', i);
                          if (associateWith === 'organization') {
                              body.org_id = this.getNodeParameter('org_id', i);
                          }
                          else {
                              body.person_id = this.getNodeParameter('person_id', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}`;
                      }
                      else if (operation === 'duplicate') {
                          requestMethod = 'POST';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}/duplicate`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const filters = this.getNodeParameter('filters', i);
                          addAdditionalFields(qs, filters);
                          endpoint = '/deals';
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                          if (body.label === 'null') {
                              body.label = null;
                          }
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          qs.term = this.getNodeParameter('term', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          qs.exact_match = this.getNodeParameter('exactMatch', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.fields) {
                              qs.fields = additionalFields.fields.join(',');
                          }
                          if (additionalFields.organizationId) {
                              qs.organization_id = parseInt(additionalFields.organizationId, 10);
                          }
                          if (additionalFields.includeFields) {
                              qs.include_fields = additionalFields.includeFields;
                          }
                          if (additionalFields.personId) {
                              qs.person_id = parseInt(additionalFields.personId, 10);
                          }
                          if (additionalFields.status) {
                              qs.status = additionalFields.status;
                          }
                          endpoint = '/deals/search';
                      }
                  }
                  else if (resource === 'dealActivity') {
                      if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const dealId = this.getNodeParameter('dealId', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.exclude) {
                              qs.exclude = additionalFields.exclude;
                          }
                          if ((additionalFields === null || additionalFields === void 0 ? void 0 : additionalFields.done) !== undefined) {
                              qs.done = additionalFields.done === true ? 1 : 0;
                          }
                          endpoint = `/deals/${dealId}/activities`;
                      }
                  }
                  else if (resource === 'dealProduct') {
                      if (operation === 'add') {
                          requestMethod = 'POST';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}/products`;
                          body.product_id = this.getNodeParameter('productId', i);
                          body.item_price = this.getNodeParameter('item_price', i);
                          body.quantity = this.getNodeParameter('quantity', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const dealId = this.getNodeParameter('dealId', i);
                          endpoint = `/deals/${dealId}/products`;
                      }
                      else if (operation === 'remove') {
                          requestMethod = 'DELETE';
                          const dealId = this.getNodeParameter('dealId', i);
                          const productAttachmentId = this.getNodeParameter('productAttachmentId', i);
                          endpoint = `/deals/${dealId}/products/${productAttachmentId}`;
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const dealId = this.getNodeParameter('dealId', i);
                          const productAttachmentId = this.getNodeParameter('productAttachmentId', i);
                          endpoint = `/deals/${dealId}/products/${productAttachmentId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                      }
                  }
                  else if (resource === 'file') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/files';
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          const fileBufferData = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          formData.file = {
                              value: fileBufferData,
                              options: {
                                  contentType: binaryData.mimeType,
                                  filename: binaryData.fileName,
                              },
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(formData, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const fileId = this.getNodeParameter('fileId', i);
                          endpoint = `/files/${fileId}`;
                      }
                      else if (operation === 'download') {
                          requestMethod = 'GET';
                          downloadFile = true;
                          const fileId = this.getNodeParameter('fileId', i);
                          endpoint = `/files/${fileId}/download`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const fileId = this.getNodeParameter('fileId', i);
                          endpoint = `/files/${fileId}`;
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const fileId = this.getNodeParameter('fileId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          endpoint = `/files/${fileId}`;
                          addAdditionalFields(body, updateFields);
                      }
                  }
                  else if (resource === 'note') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/notes';
                          body.content = this.getNodeParameter('content', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const noteId = this.getNodeParameter('noteId', i);
                          endpoint = `/notes/${noteId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const noteId = this.getNodeParameter('noteId', i);
                          endpoint = `/notes/${noteId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          endpoint = '/notes';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(qs, additionalFields);
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const noteId = this.getNodeParameter('noteId', i);
                          endpoint = `/notes/${noteId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                      }
                  }
                  else if (resource === 'lead') {
                      if (operation === 'create') {
                          body = {
                              title: this.getNodeParameter('title', i),
                          };
                          const associateWith = this.getNodeParameter('associateWith', i);
                          if (associateWith === 'organization') {
                              body.organization_id = this.getNodeParameter('organization_id', i);
                          }
                          else {
                              body.person_id = this.getNodeParameter('person_id', i);
                          }
                          const { value, expected_close_date, ...rest } = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          if (value) {
                              Object.assign(body, { value: value.valueProperties });
                          }
                          if (expected_close_date) {
                              body.expected_close_date = expected_close_date.split('T')[0];
                          }
                          requestMethod = 'POST';
                          endpoint = '/leads';
                      }
                      else if (operation === 'delete') {
                          const leadId = this.getNodeParameter('leadId', i);
                          requestMethod = 'DELETE';
                          endpoint = `/leads/${leadId}`;
                      }
                      else if (operation === 'get') {
                          const leadId = this.getNodeParameter('leadId', i);
                          requestMethod = 'GET';
                          endpoint = `/leads/${leadId}`;
                      }
                      else if (operation === 'getAll') {
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          requestMethod = 'GET';
                          endpoint = '/leads';
                      }
                      else if (operation === 'update') {
                          const { value, expected_close_date, ...rest } = this.getNodeParameter('updateFields', i);
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          if (value) {
                              Object.assign(body, { value: value.valueProperties });
                          }
                          if (expected_close_date) {
                              body.expected_close_date = expected_close_date.split('T')[0];
                          }
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          const leadId = this.getNodeParameter('leadId', i);
                          requestMethod = 'PATCH';
                          endpoint = `/leads/${leadId}`;
                      }
                  }
                  else if (resource === 'organization') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/organizations';
                          body.name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const organizationId = this.getNodeParameter('organizationId', i);
                          endpoint = `/organizations/${organizationId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const organizationId = this.getNodeParameter('organizationId', i);
                          endpoint = `/organizations/${organizationId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const filters = this.getNodeParameter('filters', i);
                          if (filters.filterId) {
                              qs.filter_id = filters.filterId;
                          }
                          if (filters.firstChar) {
                              qs.first_char = filters.firstChar;
                              qs.first_char = qs.first_char.substring(0, 1);
                          }
                          endpoint = '/organizations';
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('organizationId', i);
                          requestMethod = 'PUT';
                          endpoint = `/organizations/${id}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                          if (body.label === 'null') {
                              body.label = null;
                          }
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          qs.term = this.getNodeParameter('term', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if ((_a = additionalFields === null || additionalFields === void 0 ? void 0 : additionalFields.fields) === null || _a === void 0 ? void 0 : _a.length) {
                              qs.fields = additionalFields.fields.join(',');
                          }
                          if (additionalFields.exactMatch) {
                              qs.exact_match = additionalFields.exactMatch;
                          }
                          endpoint = '/organizations/search';
                      }
                  }
                  else if (resource === 'person') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = '/persons';
                          body.name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          addAdditionalFields(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const personId = this.getNodeParameter('personId', i);
                          endpoint = `/persons/${personId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const personId = this.getNodeParameter('personId', i);
                          endpoint = `/persons/${personId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.filterId) {
                              qs.filter_id = additionalFields.filterId;
                          }
                          if (additionalFields.firstChar) {
                              qs.first_char = additionalFields.firstChar;
                          }
                          endpoint = '/persons';
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          qs.term = this.getNodeParameter('term', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.fields) {
                              qs.fields = additionalFields.fields;
                          }
                          if (additionalFields.exactMatch) {
                              qs.exact_match = additionalFields.exactMatch;
                          }
                          if (additionalFields.organizationId) {
                              qs.organization_id = parseInt(additionalFields.organizationId, 10);
                          }
                          if (additionalFields.includeFields) {
                              qs.include_fields = additionalFields.includeFields;
                          }
                          endpoint = '/persons/search';
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const personId = this.getNodeParameter('personId', i);
                          endpoint = `/persons/${personId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          addAdditionalFields(body, updateFields);
                          if (body.label === 'null') {
                              body.label = null;
                          }
                      }
                  }
                  else if (resource === 'product') {
                      if (operation === 'getAll') {
                          requestMethod = 'GET';
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          endpoint = '/products';
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  let responseData;
                  if (returnAll) {
                      responseData = await GenericFunctions_1.pipedriveApiRequestAllItems.call(this, requestMethod, endpoint, body, qs);
                  }
                  else {
                      if (customProperties !== undefined) {
                          (0, GenericFunctions_1.pipedriveEncodeCustomProperties)(customProperties, body);
                      }
                      responseData = await GenericFunctions_1.pipedriveApiRequest.call(this, requestMethod, endpoint, body, qs, formData, downloadFile);
                  }
                  if (resource === 'file' && operation === 'download') {
                      const newItem = {
                          json: items[i].json,
                          pairedItem: { item: i },
                          binary: {},
                      };
                      if (items[i].binary !== undefined) {
                          Object.assign(newItem.binary, items[i].binary);
                      }
                      items[i] = newItem;
                      const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                      items[i].binary[binaryPropertyName] = await this.helpers.prepareBinaryData(responseData.data);
                  }
                  else {
                      if (responseData.data === null) {
                          responseData.data = [];
                      }
                      if (operation === 'search' && ((_b = responseData.data) === null || _b === void 0 ? void 0 : _b.items)) {
                          responseData.data = responseData.data.items;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.rawData !== true) {
                              responseData.data = responseData.data.map((item) => {
                                  return {
                                      result_score: item.result_score,
                                      ...item.item,
                                  };
                              });
                          }
                      }
                      responseData = responseData.data;
                      if (responseData.data === true) {
                          responseData = { success: true };
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (resource === 'file' && operation === 'download') {
                          items[i].json = { error: error.message };
                      }
                      else {
                          returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (customProperties !== undefined) {
              for (const item of returnData) {
                  (0, GenericFunctions_1.pipedriveResolveCustomProperties)(customProperties, item);
              }
          }
          if (resource === 'file' && operation === 'download') {
              return [items];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.Pipedrive = Pipedrive;
  //# sourceMappingURL=Pipedrive.node.js.map

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

  # Pipedrive credentials

  You can use these credentials to authenticate the following nodes:

  - [Pipedrive](/integrations/builtin/app-nodes/n8n-nodes-base.pipedrive.md)
  - [Pipedrive Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.pipedrivetrigger.md)

  ## Supported authentication methods

  - API token
  - OAuth2

  ## Related resources

  Refer to [Pipedrive's developer documentation](https://pipedrive.readme.io/docs/getting-started){:target=_blank .external-link} for more information about the service.

  ## Using API token

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

  - An **API Token**

  To get your API token:

  1. Open your [**API Personal Preferences**](https://app.pipedrive.com/settings/api){:target=_blank .external-link}.
  2. Copy **Your personal API token** and enter it in your n8n credential.

  If you have multiple companies, you'll need to select the correct company first:

  1. Select your account name and be sure you're viewing the correct company.
  2. Then select **Company Settings**.
  2. Select **Personal Preferences**.
  3. Select the **API** tab.
  4. Copy **Your personal API token** and enter it in your n8n credential.

  Refer to [How to find the API token](https://pipedrive.readme.io/docs/how-to-find-the-api-token){:target=_blank .external-link} for more information.

  ## Using OAuth2

  To configure this credential, you'll need a [Pipedrive developer sandbox account](https://developers.pipedrive.com/){:target=_blank .external-link} and:

  - A **Client ID**
  - A **Client Secret**

  To get both, you'll need to register a new app:

  1. Select your profile name in the upper right corner.
  2. Find the company name of your sandbox account and select **Developer Hub**.

      /// note | No Developer Hub
      If you don't see **Developer Hub** in your account dropdown, sign up for a [developer sandbox account](https://developers.pipedrive.com/){:target=_blank .external-link}.
      ///

  3. Select **Create an app**.
  4. Select **Create public app**. The app's **Basic info** tab opens.
  5. Enter an **App name** for your app, like `n8n integration`.
  6. Copy the **OAuth Redirect URL** from n8n and add it as the app's **Callback URL**.
  7. Select **Save**. The app's **OAuth & access scopes** tab opens.
  8. Turn on appropriate **Scopes** for your app. Refer to [Pipedrive node scopes](#pipedrive-node-scopes) and [Pipedrive Trigger node scopes](#pipedrive-trigger-node-scopes) below for more guidance.
  8. Copy the **Client ID** and enter it in your n8n credential.
  9. Copy the **Client Secret** and enter it in your n8n credential.

  Refer to [Registering a public app](https://pipedrive.readme.io/docs/marketplace-registering-the-app){:target=_blank .external-link} for more information.

  ### Pipedrive node scopes

  The scopes you add to your app depend on which node(s) you want to use it for in n8n and what actions you want to complete with those.

  Scopes you may need for the [Pipedrive](/integrations/builtin/app-nodes/n8n-nodes-base.pipedrive.md) node:

  | **Object** | **Node action** | **UI scope** | **Actual scope** |
  | --- | --- | --- | --- |
  | Activity | Get data of an activity <br> Get data of all activities | **Activities: Read only** or <br> **Activities: Full Access** | `activities:read` or <br> `activities:full` |
  | Activity | Create <br> Delete <br> Update | **Activities: Full Access** | `activities:full` |
  | Deal | Get data of a deal <br> Get data of all deals <br> Search a deal | **Deals: Read only** or <br> **Deals: Full Access** | `deals:read` or <br> `deals:full` |
  | Deal | Create <br> Delete <br> Duplicate <br> Update | **Deals: Full Access** | `deals:full` |
  | Deal Activity | Get all activities of a deal | **Activities: Read only** or <br> **Activities: Full Access** | `activities:read` or <br> `activities:full` |
  | Deal Product | Get all products in a deal |  **Products: Read Only** or <br> **Products: Full Access** | `products:read` or <br> `products:full` |
  | File | Download <br> Get data of a file | Refer to note below | Refer to note below |
  | File | Create <br> Delete | Refer to note below | Refer to note below |
  | Lead | Get data of a lead <br> Get data of all leads | **Leads: Read only** or <br> **Leads: Full access** | `leads:read` or <br> `leads:full` |
  | Lead | Create <br> Delete <br> Update | **Leads: Full access** | `leads:full` |
  | Note | Get data of a note <br> Get data of all notes | Refer to note below | Refer to note below |
  | Note | Create <br> Delete <br> Update | Refer to note below | Refer to note below |
  | Organization | Get data of an organization <br> Get data of all organizations <br> Search | **Contacts: Read Only** or <br> **Contacts: Full Access** | `contacts:read` or <br> `contacts:full` |
  | Organization | Create <br> Delete <br> Update | **Contacts: Full Access** | `contacts:full` |
  | Person | Get data of a person <br> Get data of all persons <br> Search | **Contacts: Read Only** or <br> **Contacts: Full Access** | `contacts:read` or <br> `contacts:full` |
  | Person | Create <br> Delete <br> Update | **Contacts: Full Access** | `contacts:full` |
  | Product | Get data of all products | **Products: Read Only** | `products:read` |

  /// note | Files and Notes
  The scopes for Files and Notes depend on which object they relate to:

  - Files relate to Deals, Activities, or Contacts.
  - Notes relate to Deals or Contacts.

  Refer to those objects' scopes.
  ///

  The Pipedrive node also supports Custom API calls. Add relevant scopes for whatever custom API calls you intend to make.

  Refer to [Scopes and permissions explanations](https://pipedrive.readme.io/docs/marketplace-scopes-and-permissions-explanations){:target=_blank .external-link} for more information.

  ### Pipedrive Trigger node scopes

  The [Pipedrive Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.pipedrivetrigger.md) node requires the **Webhooks: Full access** (`webhooks:full`) scope.

example_workflow:
  {"nodes":[{"parameters":{},"type":"n8n-nodes-base.node","typeVersion":1,"position":[220,120],"id":"12508c01-59e9-4e2a-9729-0f53c073f5cf","name":"Node"}],"connections":{"Node":{"main":[[]]}},"pinData":{},"meta":{"templateCredsSetupCompleted":true,"instanceId":"6781148e75533254e6c7f8be2be8fa837d520ad8e8772732f42d98fdf87387f0"}}


