# nodes

node_type: n8n-nodes-base.SseTrigger
name: SseTrigger
display_name: SSE Trigger
description: Triggers the workflow when Server-Sent Events occur
category: trigger
icon: fa:cloud-download-alt
code_hash: 05f0871eb011af3c8b264d9249c442aca37fbbc12533aca5e843312cf67942fb
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.SseTrigger
documentation_title: SSE Trigger node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"sse-trigger","description":"Templates for sse-trigger"}]
related_resources: []
required_scopes: []
example_parameters: {"pollTimes":{"item":[{"mode":"everyMinute"}]}}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:37
updated_at: 2025-06-09 15:18:37
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.SseTrigger = void 0;
  const eventsource_1 = __importDefault(require("eventsource"));
  const n8n_workflow_1 = require("n8n-workflow");
  class SseTrigger {
      constructor() {
          this.description = {
              displayName: 'SSE Trigger',
              name: 'sseTrigger',
              icon: 'fa:cloud-download-alt',
              group: ['trigger'],
              version: 1,
              description: 'Triggers the workflow when Server-Sent Events occur',
              eventTriggerDescription: '',
              activationMessage: 'You can now make calls to your SSE URL to trigger executions.',
              defaults: {
                  name: 'SSE Trigger',
                  color: '#225577',
              },
              triggerPanel: {
                  header: '',
                  executionsHelp: {
                      inactive: "<b>While building your workflow</b>, click the 'listen' button, then trigger an SSE event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time a change is detected, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.",
                      active: "<b>While building your workflow</b>, click the 'listen' button, then trigger an SSE event. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time a change is detected, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.",
                  },
                  activationHint: "Once you’ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won’t see those executions here).",
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'URL',
                      name: 'url',
                      type: 'string',
                      default: '',
                      placeholder: 'http://example.com',
                      description: 'The URL to receive the SSE from',
                      required: true,
                  },
              ],
          };
      }
      async trigger() {
          const url = this.getNodeParameter('url');
          const eventSource = new eventsource_1.default(url);
          eventSource.onmessage = (event) => {
              const eventData = (0, n8n_workflow_1.jsonParse)(event.data, {
                  errorMessage: 'Invalid JSON for event data',
              });
              this.emit([this.helpers.returnJsonArray([eventData])]);
          };
          async function closeFunction() {
              eventSource.close();
          }
          return {
              closeFunction,
          };
      }
  }
  exports.SseTrigger = SseTrigger;
  //# sourceMappingURL=SseTrigger.node.js.map

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

  # SSE Trigger node

  Server-Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server using HTTP connection. The SSE Trigger node is used to receive server-sent events.

  ## Node parameters

  The SSE Trigger node has one parameter, the **URL**. Enter the URL from which to receive the server-sent events (SSE).


  ## Templates and examples

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

example_workflow:
  {"name":"SSE Trigger Example Workflow","nodes":[{"parameters":{"pollTimes":{"item":[{"mode":"everyMinute"}]}},"id":"ifds3t989vmisvtdmj2vbe","name":"SSE Trigger","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.StickyNote
name: StickyNote
display_name: Sticky Note
description: Make your workflow easier to understand
category: input
icon: fa:sticky-note
code_hash: 71536993abcfd47e981e96d368c60bcc43b74fc57c1cb59cf8688071356f8bf0
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:37
updated_at: 2025-06-09 15:18:37
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StickyNote = void 0;
  class StickyNote {
      constructor() {
          this.description = {
              displayName: 'Sticky Note',
              name: 'stickyNote',
              icon: 'fa:sticky-note',
              group: ['input'],
              version: 1,
              description: 'Make your workflow easier to understand',
              defaults: {
                  name: 'Sticky Note',
                  color: '#FFD233',
              },
              inputs: [],
              outputs: [],
              properties: [
                  {
                      displayName: 'Content',
                      name: 'content',
                      type: 'string',
                      required: true,
                      default: "## I'm a note \n**Double click** to edit me. [Guide](https://docs.n8n.io/workflows/sticky-notes/)",
                  },
                  {
                      displayName: 'Height',
                      name: 'height',
                      type: 'number',
                      required: true,
                      default: 160,
                  },
                  {
                      displayName: 'Width',
                      name: 'width',
                      type: 'number',
                      required: true,
                      default: 240,
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          return [items];
      }
  }
  exports.StickyNote = StickyNote;
  //# sourceMappingURL=StickyNote.node.js.map

example_workflow:
  {"name":"Sticky Note Example Workflow","nodes":[{"parameters":{},"id":"t2jzjaamjfvhyv2iz2goq","name":"Sticky Note","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.StopAndError
name: StopAndError
display_name: Stop and Error
description: Throw an error in the workflow
category: input
icon: fa:exclamation-triangle
code_hash: 79f3b665f4ccdb01a1faacf08233e29fbd6878e69d5d611b5dd2bf0bf9b25308
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.StopAndError
documentation_title: Stop And Error
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"stop-and-error","description":"Templates for stop-and-error"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:37
updated_at: 2025-06-09 15:18:37
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StopAndError = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const errorObjectPlaceholder = `{
  	"code": "404",
  	"description": "The resource could not be fetched"
  }`;
  class StopAndError {
      constructor() {
          this.description = {
              displayName: 'Stop and Error',
              name: 'stopAndError',
              icon: 'fa:exclamation-triangle',
              group: ['input'],
              version: 1,
              description: 'Throw an error in the workflow',
              defaults: {
                  name: 'Stop and Error',
                  color: '#ff0000',
              },
              inputs: ['main'],
              outputs: [],
              properties: [
                  {
                      displayName: 'Error Type',
                      name: 'errorType',
                      type: 'options',
                      options: [
                          {
                              name: 'Error Message',
                              value: 'errorMessage',
                          },
                          {
                              name: 'Error Object',
                              value: 'errorObject',
                          },
                      ],
                      default: 'errorMessage',
                      description: 'Type of error to throw',
                  },
                  {
                      displayName: 'Error Message',
                      name: 'errorMessage',
                      type: 'string',
                      placeholder: 'An error occurred!',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              errorType: ['errorMessage'],
                          },
                      },
                  },
                  {
                      displayName: 'Error Object',
                      name: 'errorObject',
                      type: 'json',
                      description: 'Object containing error properties',
                      default: '',
                      typeOptions: {
                          alwaysOpenEditWindow: true,
                      },
                      placeholder: errorObjectPlaceholder,
                      required: true,
                      displayOptions: {
                          show: {
                              errorType: ['errorObject'],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const errorType = this.getNodeParameter('errorType', 0);
          const { id: workflowId, name: workflowName } = this.getWorkflow();
          let toThrow;
          if (errorType === 'errorMessage') {
              toThrow = this.getNodeParameter('errorMessage', 0);
          }
          else {
              const json = this.getNodeParameter('errorObject', 0);
              const errorObject = (0, n8n_workflow_1.jsonParse)(json);
              toThrow = {
                  name: 'User-thrown error',
                  message: `Workflow ID ${workflowId} "${workflowName}" has failed`,
                  ...errorObject,
              };
          }
          throw new n8n_workflow_1.NodeOperationError(this.getNode(), toThrow);
      }
  }
  exports.StopAndError = StopAndError;
  //# sourceMappingURL=StopAndError.node.js.map

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

  # Stop And Error

  Use the Stop And Error node to display custom error messages, cause executions to fail under certain conditions, and send custom error information to error workflows.

  ## Operations

  * Error Message
  * Error Object

  ## Node parameters

  Both operations include one node parameter, the **Error Type**. Use this parameter to select the type of error to throw. Choose between the two operations: **Error Message** and **Error Object**.

  The other parameters depend on which operation you select.

  ### Error Message parameters

  The Error Message Error Type adds one parameter, the **Error Message** field. Enter the message you'd like to throw.

  ### Error Object parameters

  The Error Object Error Type adds one parameter, the **Error Object**. Enter a JSON object that contains the error properties you'd like to throw.

  ## Templates and examples

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

  ## Related resources

  You can use the Stop And Error node with the [Error trigger](/integrations/builtin/core-nodes/n8n-nodes-base.errortrigger.md) node.

  Read more about [Error workflows](/flow-logic/error-handling.md) in n8n workflows.

related_resources:
  [{"title":"Error trigger","url":"/integrations/builtin/core-nodes/n8n-nodes-base.errortrigger.md","type":"documentation"},{"title":"Error workflows","url":"/flow-logic/error-handling.md","type":"documentation"}]

example_workflow:
  {"name":"Stop and Error Example Workflow","nodes":[{"parameters":{},"id":"3xlpe5uuq8r6bcz4d1vw3x","name":"Stop and Error","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Spotify
name: Spotify
display_name: Spotify
description: Access public song data via the Spotify API
category: input
icon: file:spotify.svg
code_hash: 1a821c70bcb95f1080d2a7f8f2884b566c30771e6de24c0a9a28da9a76c8f677
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Spotify
documentation_title: Spotify node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"spotify","description":"Templates for spotify"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:37
updated_at: 2025-06-09 15:18:37
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Spotify = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const IsoCountryCodes_1 = require("./IsoCountryCodes");
  class Spotify {
      constructor() {
          this.description = {
              displayName: 'Spotify',
              name: 'spotify',
              icon: 'file:spotify.svg',
              group: ['input'],
              version: 1,
              description: 'Access public song data via the Spotify API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Spotify',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'spotifyOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Album',
                              value: 'album',
                          },
                          {
                              name: 'Artist',
                              value: 'artist',
                          },
                          {
                              name: 'Library',
                              value: 'library',
                          },
                          {
                              name: 'My Data',
                              value: 'myData',
                          },
                          {
                              name: 'Player',
                              value: 'player',
                          },
                          {
                              name: 'Playlist',
                              value: 'playlist',
                          },
                          {
                              name: 'Track',
                              value: 'track',
                          },
                      ],
                      default: 'player',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['player'],
                          },
                      },
                      options: [
                          {
                              name: 'Add Song to Queue',
                              value: 'addSongToQueue',
                              description: 'Add a song to your queue',
                              action: 'Add a song to a queue',
                          },
                          {
                              name: 'Currently Playing',
                              value: 'currentlyPlaying',
                              description: 'Get your currently playing track',
                              action: 'Get the currently playing track',
                          },
                          {
                              name: 'Next Song',
                              value: 'nextSong',
                              description: 'Skip to your next track',
                              action: 'Skip to the next track',
                          },
                          {
                              name: 'Pause',
                              value: 'pause',
                              description: 'Pause your music',
                              action: 'Pause the player',
                          },
                          {
                              name: 'Previous Song',
                              value: 'previousSong',
                              description: 'Skip to your previous song',
                              action: 'Skip to the previous song',
                          },
                          {
                              name: 'Recently Played',
                              value: 'recentlyPlayed',
                              description: 'Get your recently played tracks',
                              action: 'Get the recently played tracks',
                          },
                          {
                              name: 'Resume',
                              value: 'resume',
                              description: 'Resume playback on the current active device',
                              action: 'Resume the player',
                          },
                          {
                              name: 'Set Volume',
                              value: 'volume',
                              description: 'Set volume on the current active device',
                              action: 'Set volume on the player',
                          },
                          {
                              name: 'Start Music',
                              value: 'startMusic',
                              description: 'Start playing a playlist, artist, or album',
                              action: 'Start music on the player',
                          },
                      ],
                      default: 'addSongToQueue',
                  },
                  {
                      displayName: 'Resource ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['player'],
                              operation: ['startMusic'],
                          },
                      },
                      placeholder: 'spotify:album:1YZ3k65Mqw3G8FzYlW1mmp',
                      description: 'Enter a playlist, artist, or album URI or ID',
                  },
                  {
                      displayName: 'Track ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['player'],
                              operation: ['addSongToQueue'],
                          },
                      },
                      placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU',
                      description: 'Enter a track URI or ID',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['album'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get an album by URI or ID',
                              action: 'Get an album',
                          },
                          {
                              name: 'Get New Releases',
                              value: 'getNewReleases',
                              description: 'Get a list of new album releases',
                              action: 'Get new album releases',
                          },
                          {
                              name: 'Get Tracks',
                              value: 'getTracks',
                              description: "Get an album's tracks by URI or ID",
                              action: "Get an album's tracks by URI or ID",
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search albums by keyword',
                              action: 'Search albums by keyword',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Album ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['album'],
                              operation: ['get', 'getTracks'],
                          },
                          hide: {
                              operation: ['search'],
                          },
                      },
                      placeholder: 'spotify:album:1YZ3k65Mqw3G8FzYlW1mmp',
                      description: "The album's Spotify URI or ID",
                  },
                  {
                      displayName: 'Search Keyword',
                      name: 'query',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The keyword term to search for',
                      displayOptions: {
                          show: {
                              resource: ['album'],
                              operation: ['search'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['artist'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get an artist by URI or ID',
                              action: 'Get an artist',
                          },
                          {
                              name: 'Get Albums',
                              value: 'getAlbums',
                              description: "Get an artist's albums by URI or ID",
                              action: "Get an artist's albums by URI or ID",
                          },
                          {
                              name: 'Get Related Artists',
                              value: 'getRelatedArtists',
                              description: "Get an artist's related artists by URI or ID",
                              action: "Get an artist's related artists by URI or ID",
                          },
                          {
                              name: 'Get Top Tracks',
                              value: 'getTopTracks',
                              description: "Get an artist's top tracks by URI or ID",
                              action: "Get an artist's top tracks by URI or ID",
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search artists by keyword',
                              action: 'Search artists by keyword',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Artist ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['artist'],
                          },
                          hide: {
                              operation: ['search'],
                          },
                      },
                      placeholder: 'spotify:artist:4LLpKhyESsyAXpc4laK94U',
                      description: "The artist's Spotify URI or ID",
                  },
                  {
                      displayName: 'Country',
                      name: 'country',
                      type: 'string',
                      default: 'US',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['artist'],
                              operation: ['getTopTracks'],
                          },
                      },
                      placeholder: 'US',
                      description: 'Top tracks in which country? Enter the postal abbreviation',
                  },
                  {
                      displayName: 'Search Keyword',
                      name: 'query',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The keyword term to search for',
                      displayOptions: {
                          show: {
                              resource: ['artist'],
                              operation: ['search'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                          },
                      },
                      options: [
                          {
                              name: 'Add an Item',
                              value: 'add',
                              description: 'Add tracks to a playlist by track and playlist URI or ID',
                              action: 'Add an Item to a playlist',
                          },
                          {
                              name: 'Create a Playlist',
                              value: 'create',
                              description: 'Create a new playlist',
                              action: 'Create a playlist',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a playlist by URI or ID',
                              action: 'Get a playlist',
                          },
                          {
                              name: "Get the User's Playlists",
                              value: 'getUserPlaylists',
                              description: "Get a user's playlists",
                              action: "Get a user's playlists",
                          },
                          {
                              name: 'Get Tracks',
                              value: 'getTracks',
                              description: "Get a playlist's tracks by URI or ID",
                              action: "Get a playlist's tracks by URI or ID",
                          },
                          {
                              name: 'Remove an Item',
                              value: 'delete',
                              description: 'Remove tracks from a playlist by track and playlist URI or ID',
                              action: 'Remove an item from a playlist',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search playlists by keyword',
                              action: 'Search playlists by keyword',
                          },
                      ],
                      default: 'add',
                  },
                  {
                      displayName: 'Playlist ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['add', 'delete', 'get', 'getTracks'],
                          },
                      },
                      placeholder: 'spotify:playlist:37i9dQZF1DWUhI3iC1khPH',
                      description: "The playlist's Spotify URI or its ID",
                  },
                  {
                      displayName: 'Name',
                      name: 'name',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['create'],
                          },
                      },
                      placeholder: 'Favorite Songs',
                      description: 'Name of the playlist to create',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['create'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Description',
                              name: 'description',
                              type: 'string',
                              default: '',
                              placeholder: 'These are all my favorite songs.',
                              description: 'Description for the playlist to create',
                          },
                          {
                              displayName: 'Public',
                              name: 'public',
                              type: 'boolean',
                              default: true,
                              description: 'Whether the playlist is publicly accessible',
                          },
                      ],
                  },
                  {
                      displayName: 'Track ID',
                      name: 'trackID',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['add', 'delete'],
                          },
                      },
                      placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU',
                      description: "The track's Spotify URI or its ID. The track to add/delete from the playlist.",
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['add'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Position',
                              name: 'position',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              default: 0,
                              placeholder: '0',
                              description: "The new track's position in the playlist",
                          },
                      ],
                  },
                  {
                      displayName: 'Search Keyword',
                      name: 'query',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The keyword term to search for',
                      displayOptions: {
                          show: {
                              resource: ['playlist'],
                              operation: ['search'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['track'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a track by its URI or ID',
                              action: 'Get a track',
                          },
                          {
                              name: 'Get Audio Features',
                              value: 'getAudioFeatures',
                              description: 'Get audio features for a track by URI or ID',
                              action: 'Get audio features of a track',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                              description: 'Search tracks by keyword',
                              action: 'Search tracks by keyword',
                          },
                      ],
                      default: 'track',
                  },
                  {
                      displayName: 'Track ID',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['track'],
                          },
                          hide: {
                              operation: ['search'],
                          },
                      },
                      placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU',
                      description: "The track's Spotify URI or ID",
                  },
                  {
                      displayName: 'Search Keyword',
                      name: 'query',
                      type: 'string',
                      required: true,
                      default: '',
                      description: 'The keyword term to search for',
                      displayOptions: {
                          show: {
                              resource: ['track'],
                              operation: ['search'],
                          },
                      },
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['library'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Liked Tracks',
                              value: 'getLikedTracks',
                              description: "Get the user's liked tracks",
                              action: 'Get liked tracks',
                          },
                      ],
                      default: 'getLikedTracks',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['myData'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Following Artists',
                              value: 'getFollowingArtists',
                              description: 'Get your followed artists',
                              action: 'Get your followed artists',
                          },
                      ],
                      default: 'getFollowingArtists',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['album', 'artist', 'library', 'myData', 'playlist', 'track', 'player'],
                              operation: [
                                  'getTracks',
                                  'getAlbums',
                                  'getUserPlaylists',
                                  'getNewReleases',
                                  'getLikedTracks',
                                  'getFollowingArtists',
                                  'search',
                                  'recentlyPlayed',
                              ],
                          },
                      },
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      default: 50,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['album', 'artist', 'library', 'playlist', 'track'],
                              operation: [
                                  'getTracks',
                                  'getAlbums',
                                  'getUserPlaylists',
                                  'getNewReleases',
                                  'getLikedTracks',
                                  'search',
                              ],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      default: 50,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['myData', 'player'],
                              operation: ['getFollowingArtists', 'recentlyPlayed'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 50,
                      },
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Volume',
                      name: 'volumePercent',
                      type: 'number',
                      default: 50,
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['player'],
                              operation: ['volume'],
                          },
                      },
                      typeOptions: {
                          minValue: 0,
                          maxValue: 100,
                      },
                      description: 'The volume percentage to set',
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['album'],
                              operation: ['getNewReleases'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Country',
                              name: 'country',
                              type: 'options',
                              default: 'US',
                              options: IsoCountryCodes_1.isoCountryCodes.map(({ name, alpha2 }) => ({ name, value: alpha2 })),
                              description: 'Country to filter new releases by',
                          },
                      ],
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['playlist', 'artist', 'track', 'album'],
                              operation: ['search'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Country',
                              name: 'market',
                              type: 'options',
                              options: IsoCountryCodes_1.isoCountryCodes.map(({ name, alpha2 }) => ({ name, value: alpha2 })),
                              default: '',
                              description: 'If a country code is specified, only content that is playable in that market is returned',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const body = {};
          let qs;
          let requestMethod;
          let endpoint;
          let returnAll;
          let propertyName = '';
          let responseData;
          const operation = this.getNodeParameter('operation', 0);
          const resource = this.getNodeParameter('resource', 0);
          requestMethod = 'GET';
          endpoint = '';
          qs = {};
          returnAll = false;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'player') {
                      if (operation === 'pause') {
                          requestMethod = 'PUT';
                          endpoint = '/me/player/pause';
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'recentlyPlayed') {
                          requestMethod = 'GET';
                          endpoint = '/me/player/recently-played';
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'items';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.items;
                          }
                      }
                      else if (operation === 'currentlyPlaying') {
                          requestMethod = 'GET';
                          endpoint = '/me/player/currently-playing';
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                      }
                      else if (operation === 'nextSong') {
                          requestMethod = 'POST';
                          endpoint = '/me/player/next';
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'previousSong') {
                          requestMethod = 'POST';
                          endpoint = '/me/player/previous';
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'startMusic') {
                          requestMethod = 'PUT';
                          endpoint = '/me/player/play';
                          const id = this.getNodeParameter('id', i);
                          body.context_uri = id;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'addSongToQueue') {
                          requestMethod = 'POST';
                          endpoint = '/me/player/queue';
                          const id = this.getNodeParameter('id', i);
                          qs = {
                              uri: id,
                          };
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'resume') {
                          requestMethod = 'PUT';
                          endpoint = '/me/player/play';
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                      else if (operation === 'volume') {
                          requestMethod = 'PUT';
                          endpoint = '/me/player/volume';
                          const volumePercent = this.getNodeParameter('volumePercent', i);
                          qs = {
                              volume_percent: volumePercent,
                          };
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = { success: true };
                      }
                  }
                  else if (resource === 'album') {
                      if (operation === 'get') {
                          const uri = this.getNodeParameter('id', i);
                          const id = uri.replace('spotify:album:', '');
                          requestMethod = 'GET';
                          endpoint = `/albums/${id}`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                      }
                      else if (operation === 'getNewReleases') {
                          endpoint = '/browse/new-releases';
                          requestMethod = 'GET';
                          propertyName = 'albums.items';
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.albums.items;
                          }
                      }
                      else if (operation === 'getTracks') {
                          const uri = this.getNodeParameter('id', i);
                          const id = uri.replace('spotify:album:', '');
                          requestMethod = 'GET';
                          endpoint = `/albums/${id}/tracks`;
                          propertyName = 'tracks';
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'items';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.items;
                          }
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          endpoint = '/search';
                          propertyName = 'albums.items';
                          returnAll = this.getNodeParameter('returnAll', i);
                          const q = this.getNodeParameter('query', i);
                          const filters = this.getNodeParameter('filters', i);
                          qs = {
                              q,
                              type: 'album',
                              ...filters,
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.albums.items;
                          }
                      }
                  }
                  else if (resource === 'artist') {
                      const uri = this.getNodeParameter('id', i, '');
                      const id = uri.replace('spotify:artist:', '');
                      if (operation === 'getAlbums') {
                          endpoint = `/artists/${id}/albums`;
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'items';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.items;
                          }
                      }
                      else if (operation === 'getRelatedArtists') {
                          endpoint = `/artists/${id}/related-artists`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = responseData.artists;
                      }
                      else if (operation === 'getTopTracks') {
                          const country = this.getNodeParameter('country', i);
                          qs = {
                              country,
                          };
                          endpoint = `/artists/${id}/top-tracks`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          responseData = responseData.tracks;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          endpoint = `/artists/${id}`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          endpoint = '/search';
                          propertyName = 'artists.items';
                          returnAll = this.getNodeParameter('returnAll', i);
                          const q = this.getNodeParameter('query', i);
                          const filters = this.getNodeParameter('filters', i);
                          qs = {
                              q,
                              limit: 50,
                              type: 'artist',
                              ...filters,
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.artists.items;
                          }
                      }
                  }
                  else if (resource === 'playlist') {
                      if (['delete', 'get', 'getTracks', 'add'].includes(operation)) {
                          const uri = this.getNodeParameter('id', i);
                          const id = uri.replace('spotify:playlist:', '');
                          if (operation === 'delete') {
                              requestMethod = 'DELETE';
                              const trackId = this.getNodeParameter('trackID', i);
                              body.tracks = [
                                  {
                                      uri: trackId,
                                  },
                              ];
                              endpoint = `/playlists/${id}/tracks`;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = { success: true };
                          }
                          else if (operation === 'get') {
                              requestMethod = 'GET';
                              endpoint = `/playlists/${id}`;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          }
                          else if (operation === 'getTracks') {
                              requestMethod = 'GET';
                              endpoint = `/playlists/${id}/tracks`;
                              returnAll = this.getNodeParameter('returnAll', i);
                              propertyName = 'items';
                              if (!returnAll) {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs = {
                                      limit,
                                  };
                                  responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                                  responseData = responseData.items;
                              }
                          }
                          else if (operation === 'add') {
                              requestMethod = 'POST';
                              const trackId = this.getNodeParameter('trackID', i);
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              qs = {
                                  uris: trackId,
                              };
                              if (additionalFields.position !== undefined) {
                                  qs.position = additionalFields.position;
                              }
                              endpoint = `/playlists/${id}/tracks`;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                          }
                      }
                      else if (operation === 'getUserPlaylists') {
                          requestMethod = 'GET';
                          endpoint = '/me/playlists';
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'items';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.items;
                          }
                      }
                      else if (operation === 'create') {
                          body.name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, 'POST', '/me/playlists', body, qs);
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          endpoint = '/search';
                          propertyName = 'playlists.items';
                          returnAll = this.getNodeParameter('returnAll', i);
                          const q = this.getNodeParameter('query', i);
                          const filters = this.getNodeParameter('filters', i);
                          qs = {
                              q,
                              type: 'playlist',
                              limit: 50,
                              ...filters,
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.playlists.items;
                          }
                      }
                  }
                  else if (resource === 'track') {
                      const uri = this.getNodeParameter('id', i, '');
                      const id = uri.replace('spotify:track:', '');
                      requestMethod = 'GET';
                      if (operation === 'getAudioFeatures') {
                          endpoint = `/audio-features/${id}`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                      }
                      else if (operation === 'get') {
                          endpoint = `/tracks/${id}`;
                          responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                      }
                      else if (operation === 'search') {
                          requestMethod = 'GET';
                          endpoint = '/search';
                          propertyName = 'tracks.items';
                          returnAll = this.getNodeParameter('returnAll', i);
                          const q = this.getNodeParameter('query', i);
                          const filters = this.getNodeParameter('filters', i);
                          qs = {
                              q,
                              type: 'track',
                              limit: 50,
                              ...filters,
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.tracks.items;
                          }
                      }
                  }
                  else if (resource === 'library') {
                      if (operation === 'getLikedTracks') {
                          requestMethod = 'GET';
                          endpoint = '/me/tracks';
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'items';
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.items;
                          }
                      }
                  }
                  else if (resource === 'myData') {
                      if (operation === 'getFollowingArtists') {
                          requestMethod = 'GET';
                          endpoint = '/me/following';
                          returnAll = this.getNodeParameter('returnAll', i);
                          propertyName = 'artists.items';
                          qs = {
                              type: 'artist',
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              qs = {
                                  type: 'artist',
                                  limit,
                              };
                              responseData = await GenericFunctions_1.spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
                              responseData = responseData.artists.items;
                          }
                      }
                  }
                  if (returnAll) {
                      responseData = await GenericFunctions_1.spotifyApiRequestAllItems.call(this, propertyName, requestMethod, endpoint, body, qs);
                  }
                  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.Spotify = Spotify;
  //# sourceMappingURL=Spotify.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SpotifyOAuth2Api = void 0;
  class SpotifyOAuth2Api {
      constructor() {
          this.name = 'spotifyOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Spotify OAuth2 API';
          this.documentationUrl = 'spotify';
          this.properties = [
              {
                  displayName: 'Spotify Server',
                  name: 'server',
                  type: 'hidden',
                  default: 'https://api.spotify.com/',
              },
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://accounts.spotify.com/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://accounts.spotify.com/api/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'user-read-playback-state playlist-read-collaborative user-modify-playback-state playlist-modify-public user-read-currently-playing playlist-read-private user-read-recently-played playlist-modify-private user-library-read user-follow-read',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.SpotifyOAuth2Api = SpotifyOAuth2Api;
  //# sourceMappingURL=SpotifyOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SpotifyOAuth2Api = void 0;
  class SpotifyOAuth2Api {
      constructor() {
          this.name = 'spotifyOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Spotify OAuth2 API';
          this.documentationUrl = 'spotify';
          this.properties = [
              {
                  displayName: 'Spotify Server',
                  name: 'server',
                  type: 'hidden',
                  default: 'https://api.spotify.com/',
              },
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://accounts.spotify.com/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://accounts.spotify.com/api/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'user-read-playback-state playlist-read-collaborative user-modify-playback-state playlist-modify-public user-read-currently-playing playlist-read-private user-read-recently-played playlist-modify-private user-library-read user-follow-read',
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'header',
              },
          ];
      }
  }
  exports.SpotifyOAuth2Api = SpotifyOAuth2Api;
  //# sourceMappingURL=SpotifyOAuth2Api.credentials.js.map

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

  # Spotify node

  Use the Spotify node to automate work in Spotify, and integrate Spotify with other applications. n8n has built-in support for a wide range of Spotify features, including getting album and artist information. 

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

  /// note | Credentials
  Refer to [Spotify credentials](/integrations/builtin/credentials/spotify.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Album
      * Get an album by URI or ID.
      * Get a list of new album releases.
      * Get an album's tracks by URI or ID.
      * Search albums by keyword.
  * Artist
      * Get an artist by URI or ID.
      * Get an artist's albums by URI or ID.
      * Get an artist's related artists by URI or ID.
      * Get an artist's top tracks by URI or ID.
      * Search artists by keyword.
  * Library
      * Get the user's liked tracks.
  * My Data
      * Get your followed artists.
  * Player
      * Add a song to your queue.
      * Get your currently playing track.
      * Skip to your next track.
      * Pause your music.
      * Skip to your previous song.
      * Get your recently played tracks.
      * Resume playback on the current active device.
      * Set volume on the current active device.
      * Start playing a playlist, artist, or album.
  * Playlist
      * Add tracks from a playlist by track and playlist URI or ID.
      * Create a new playlist.
      * Get a playlist by URI or ID.
      * Get a playlist's tracks by URI or ID.
      * Get a user's playlists.
      * Remove tracks from a playlist by track and playlist URI or ID.
      * Search playlists by keyword.
  * Track
      * Get a track by its URI or ID.
      * Get audio features for a track by URI or ID.
      * Search tracks by keyword

  ## Templates and examples

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

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"Spotify Example Workflow","nodes":[{"parameters":{},"id":"nofg575vf3myhn98kmra4","name":"Spotify","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Stackby
name: Stackby
display_name: Stackby
description: Read, write, and delete data in Stackby
category: transform
icon: file:stackby.png
code_hash: 01e67da38c6f9be77eccfb21b9551d9c8fc64893991b678ddd9b4f56e2a8f463
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Stackby
documentation_title: Stackby node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"stackby","description":"Templates for stackby"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:37
updated_at: 2025-06-09 15:18:37
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Stackby = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunction_1 = require("./GenericFunction");
  const utilities_1 = require("../../utils/utilities");
  class Stackby {
      constructor() {
          this.description = {
              displayName: 'Stackby',
              name: 'stackby',
              icon: 'file:stackby.png',
              group: ['transform'],
              version: 1,
              description: 'Read, write, and delete data in Stackby',
              defaults: {
                  name: 'Stackby',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'stackbyApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Append',
                              value: 'append',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                          },
                          {
                              name: 'List',
                              value: 'list',
                          },
                          {
                              name: 'Read',
                              value: 'read',
                          },
                      ],
                      default: 'append',
                      placeholder: 'Action to perform',
                  },
                  {
                      displayName: 'Stack ID',
                      name: 'stackId',
                      type: 'string',
                      default: '',
                      required: true,
                      description: 'The ID of the stack to access',
                  },
                  {
                      displayName: 'Table',
                      name: 'table',
                      type: 'string',
                      default: '',
                      placeholder: 'Stories',
                      required: true,
                      description: 'Enter Table Name',
                  },
                  {
                      displayName: 'ID',
                      name: 'id',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['read', 'delete'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'ID of the record to return',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                          },
                      },
                      default: true,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 1000,
                      },
                      default: 1000,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                          },
                      },
                      default: {},
                      placeholder: 'Add Field',
                      options: [
                          {
                              displayName: 'View',
                              name: 'view',
                              type: 'string',
                              default: '',
                              placeholder: 'All Stories',
                              description: 'The name or ID of a view in the Stories table. If set, only the records in that view will be returned. The records will be sorted according to the order of the view.',
                          },
                      ],
                  },
                  {
                      displayName: 'Columns',
                      name: 'columns',
                      type: 'string',
                      displayOptions: {
                          show: {
                              operation: ['append'],
                          },
                      },
                      default: '',
                      required: true,
                      placeholder: 'id,name,description',
                      description: 'Comma-separated list of the properties which should used as columns for the new rows',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'read') {
              for (let i = 0; i < length; i++) {
                  try {
                      const stackId = this.getNodeParameter('stackId', i);
                      const table = encodeURI(this.getNodeParameter('table', i));
                      const rowIds = this.getNodeParameter('id', i);
                      qs.rowIds = [rowIds];
                      responseData = await GenericFunction_1.apiRequest.call(this, 'GET', `/rowlist/${stackId}/${table}`, {}, qs);
                      returnData.push.apply(returnData, responseData.map((data) => data.field));
                  }
                  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;
                  }
              }
          }
          if (operation === 'delete') {
              for (let i = 0; i < length; i++) {
                  try {
                      const stackId = this.getNodeParameter('stackId', i);
                      const table = encodeURI(this.getNodeParameter('table', i));
                      const rowIds = this.getNodeParameter('id', i);
                      qs.rowIds = [rowIds];
                      responseData = await GenericFunction_1.apiRequest.call(this, 'DELETE', `/rowdelete/${stackId}/${table}`, {}, qs);
                      responseData = responseData.records;
                      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;
                  }
              }
          }
          if (operation === 'append') {
              try {
                  const records = {};
                  let key = '';
                  for (let i = 0; i < length; i++) {
                      const stackId = this.getNodeParameter('stackId', i);
                      const table = encodeURI(this.getNodeParameter('table', i));
                      const columns = this.getNodeParameter('columns', i);
                      const columnList = columns.split(',').map((column) => column.trim());
                      const record = {};
                      for (const column of columnList) {
                          if (items[i].json[column] === undefined) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Column ${column} does not exist on input`, { itemIndex: i });
                          }
                          else {
                              record[column] = items[i].json[column];
                          }
                      }
                      key = `${stackId}/${table}`;
                      if (records[key] === undefined) {
                          records[key] = [];
                      }
                      records[key].push({ field: record });
                  }
                  for (const recordKey of Object.keys(records)) {
                      responseData = await GenericFunction_1.apiRequest.call(this, 'POST', `/rowcreate/${recordKey}`, {
                          records: records[recordKey],
                      });
                  }
                  returnData.push.apply(returnData, responseData.map((data) => data.field));
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const itemData = (0, utilities_1.generatePairedItemData)(items.length);
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData });
                      returnData.push(...executionErrorData);
                  }
                  else {
                      throw error;
                  }
              }
          }
          if (operation === 'list') {
              for (let i = 0; i < length; i++) {
                  try {
                      const stackId = this.getNodeParameter('stackId', i);
                      const table = encodeURI(this.getNodeParameter('table', i));
                      const returnAll = this.getNodeParameter('returnAll', 0);
                      const additionalFields = this.getNodeParameter('additionalFields', i, {});
                      if (additionalFields.view) {
                          qs.view = additionalFields.view;
                      }
                      if (returnAll) {
                          responseData = await GenericFunction_1.apiRequestAllItems.call(this, 'GET', `/rowlist/${stackId}/${table}`, {}, qs);
                      }
                      else {
                          qs.maxrecord = this.getNodeParameter('limit', 0);
                          responseData = await GenericFunction_1.apiRequest.call(this, 'GET', `/rowlist/${stackId}/${table}`, {}, qs);
                      }
                      returnData.push.apply(returnData, responseData.map((data) => data.field));
                  }
                  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.Stackby = Stackby;
  //# sourceMappingURL=Stackby.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StackbyApi = void 0;
  class StackbyApi {
      constructor() {
          this.name = 'stackbyApi';
          this.displayName = 'Stackby API';
          this.documentationUrl = 'stackby';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.StackbyApi = StackbyApi;
  //# sourceMappingURL=StackbyApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StackbyApi = void 0;
  class StackbyApi {
      constructor() {
          this.name = 'stackbyApi';
          this.displayName = 'Stackby API';
          this.documentationUrl = 'stackby';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.StackbyApi = StackbyApi;
  //# sourceMappingURL=StackbyApi.credentials.js.map

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

  # Stackby node

  Use the Stackby node to automate work in Stackby, and integrate Stackby with other applications. n8n has built-in support for a wide range of Stackby features, including appending, deleting, listing and reading. 

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

  /// note | Credentials
  Refer to [Stackby credentials](/integrations/builtin/credentials/stackby.md) for guidance on setting up authentication. 
  ///

  ## Operations

  - Append
  - Delete
  - List
  - Read

  ## Templates and examples

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

example_workflow:
  {"name":"Stackby Example Workflow","nodes":[{"parameters":{},"id":"ohpassmfwakq87gcml3ne9","name":"Stackby","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.SpreadsheetFile
name: SpreadsheetFile
display_name: Spreadsheet File
description: Reads and writes data from a spreadsheet file like CSV, XLS, ODS, etc
category: transform
icon: fa:table
code_hash: 6e655ee1172b11636b5c4634ce0a591a107d5056c258f5cdf9cda099aa7973ea
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-09 15:18:37
updated_at: 2025-06-09 15:18:37
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SpreadsheetFile = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const SpreadsheetFileV1_node_1 = require("./v1/SpreadsheetFileV1.node");
  const SpreadsheetFileV2_node_1 = require("./v2/SpreadsheetFileV2.node");
  class SpreadsheetFile extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Spreadsheet File',
              name: 'spreadsheetFile',
              icon: 'fa:table',
              group: ['transform'],
              description: 'Reads and writes data from a spreadsheet file like CSV, XLS, ODS, etc',
              defaultVersion: 2,
          };
          const nodeVersions = {
              1: new SpreadsheetFileV1_node_1.SpreadsheetFileV1(baseDescription),
              2: new SpreadsheetFileV2_node_1.SpreadsheetFileV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.SpreadsheetFile = SpreadsheetFile;
  //# sourceMappingURL=SpreadsheetFile.node.js.map

example_workflow:
  {"name":"Spreadsheet File Example Workflow","nodes":[{"parameters":{},"id":"3hd92apac8798yvacga3h8","name":"Spreadsheet File","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Strapi
name: Strapi
display_name: Strapi
description: Consume Strapi API
category: input
icon: file:strapi.svg
code_hash: 6d23d2bca4436fba9185d08178d05af5842389779fe3c06be65ca04239b1eaad
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Strapi
documentation_title: Strapi node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"strapi","description":"Templates for strapi"}]
related_resources: [{"title":"Strapi's documentation","url":"https://docs.strapi.io/dev-docs/api/rest","type":"api"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:37
updated_at: 2025-06-09 15:18:37
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Strapi = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const EntryDescription_1 = require("./EntryDescription");
  class Strapi {
      constructor() {
          this.description = {
              displayName: 'Strapi',
              name: 'strapi',
              icon: 'file:strapi.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Strapi API',
              defaults: {
                  name: 'Strapi',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'strapiApi',
                      required: true,
                      testedBy: 'strapiApiTest',
                      displayOptions: {
                          show: {
                              authentication: ['password'],
                          },
                      },
                  },
                  {
                      name: 'strapiTokenApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['token'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Username & Password',
                              value: 'password',
                          },
                          {
                              name: 'API Token',
                              value: 'token',
                          },
                      ],
                      default: 'password',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'options',
                      options: [
                          {
                              name: 'Entry',
                              value: 'entry',
                          },
                      ],
                      default: 'entry',
                  },
                  ...EntryDescription_1.entryOperations,
                  ...EntryDescription_1.entryFields,
              ],
          };
          this.methods = {
              credentialTest: {
                  async strapiApiTest(credential) {
                      const credentials = credential.data;
                      let options = {};
                      const url = (0, GenericFunctions_1.removeTrailingSlash)(credentials.url);
                      options = {
                          headers: {
                              'content-type': 'application/json',
                          },
                          method: 'POST',
                          body: {
                              identifier: credentials.email,
                              password: credentials.password,
                          },
                          uri: credentials.apiVersion === 'v4' ? `${url}/api/auth/local` : `${url}/auth/local`,
                          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}`,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          const headers = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          const authenticationMethod = this.getNodeParameter('authentication', 0);
          let apiVersion;
          if (authenticationMethod === 'password') {
              const { jwt } = await GenericFunctions_1.getToken.call(this);
              apiVersion = (await this.getCredentials('strapiApi')).apiVersion;
              headers.Authorization = `Bearer ${jwt}`;
          }
          else {
              apiVersion = (await this.getCredentials('strapiTokenApi')).apiVersion;
          }
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'entry') {
                      if (operation === 'create') {
                          const body = {};
                          const contentType = this.getNodeParameter('contentType', i);
                          const columns = this.getNodeParameter('columns', i);
                          const columnList = columns.split(',').map((column) => column.trim());
                          for (const key of Object.keys(items[i].json)) {
                              if (columnList.includes(key)) {
                                  apiVersion === 'v4'
                                      ? (body.data = items[i].json)
                                      : (body[key] = items[i].json[key]);
                              }
                          }
                          responseData = await GenericFunctions_1.strapiApiRequest.call(this, 'POST', `/${contentType}`, body, qs, undefined, headers);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'delete') {
                          const contentType = this.getNodeParameter('contentType', i);
                          const entryId = this.getNodeParameter('entryId', i);
                          responseData = await GenericFunctions_1.strapiApiRequest.call(this, 'DELETE', `/${contentType}/${entryId}`, {}, qs, undefined, headers);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const contentType = this.getNodeParameter('contentType', i);
                          const options = this.getNodeParameter('options', i);
                          if (apiVersion === 'v4') {
                              if (options.sort && options.sort.length !== 0) {
                                  const sortFields = options.sort;
                                  qs.sort = sortFields.join(',');
                              }
                              if (options.where) {
                                  const query = (0, GenericFunctions_1.validateJSON)(options.where);
                                  if (query !== undefined) {
                                      qs.filters = query;
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Query must be a valid JSON', {
                                          itemIndex: i,
                                      });
                                  }
                              }
                              if (options.publicationState) {
                                  qs.publicationState = options.publicationState;
                              }
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.strapiApiRequestAllItems.call(this, 'GET', `/${contentType}`, {}, qs, headers, apiVersion);
                              }
                              else {
                                  qs['pagination[pageSize]'] = this.getNodeParameter('limit', i);
                                  ({ data: responseData } = await GenericFunctions_1.strapiApiRequest.call(this, 'GET', `/${contentType}`, {}, qs, undefined, headers));
                              }
                          }
                          else {
                              if (options.sort && options.sort.length !== 0) {
                                  const sortFields = options.sort;
                                  qs._sort = sortFields.join(',');
                              }
                              if (options.where) {
                                  const query = (0, GenericFunctions_1.validateJSON)(options.where);
                                  if (query !== undefined) {
                                      qs._where = query;
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Query must be a valid JSON', {
                                          itemIndex: i,
                                      });
                                  }
                              }
                              if (options.publicationState) {
                                  qs._publicationState = options.publicationState;
                              }
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.strapiApiRequestAllItems.call(this, 'GET', `/${contentType}`, {}, qs, headers, apiVersion);
                              }
                              else {
                                  qs._limit = this.getNodeParameter('limit', i);
                                  responseData = await GenericFunctions_1.strapiApiRequest.call(this, 'GET', `/${contentType}`, {}, qs, undefined, headers);
                              }
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'get') {
                          const contentType = this.getNodeParameter('contentType', i);
                          const entryId = this.getNodeParameter('entryId', i);
                          responseData = await GenericFunctions_1.strapiApiRequest.call(this, 'GET', `/${contentType}/${entryId}`, {}, qs, undefined, headers);
                          if (apiVersion === 'v4') {
                              responseData = responseData.data;
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      if (operation === 'update') {
                          const body = {};
                          const contentType = this.getNodeParameter('contentType', i);
                          const columns = this.getNodeParameter('columns', i);
                          const updateKey = this.getNodeParameter('updateKey', i);
                          const columnList = columns.split(',').map((column) => column.trim());
                          const entryId = items[i].json[updateKey];
                          for (const key of Object.keys(items[i].json)) {
                              if (columnList.includes(key)) {
                                  apiVersion === 'v4'
                                      ? (body.data = items[i].json)
                                      : (body[key] = items[i].json[key]);
                              }
                          }
                          responseData = await GenericFunctions_1.strapiApiRequest.call(this, 'PUT', `/${contentType}/${entryId}`, body, qs, undefined, headers);
                          if (apiVersion === 'v4') {
                              responseData = responseData.data;
                          }
                          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.Strapi = Strapi;
  //# sourceMappingURL=Strapi.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StrapiApi = void 0;
  class StrapiApi {
      constructor() {
          this.name = 'strapiApi';
          this.displayName = 'Strapi API';
          this.documentationUrl = 'strapi';
          this.properties = [
              {
                  displayName: 'Make sure you are using a user account not an admin account',
                  name: 'notice',
                  type: 'notice',
                  default: '',
              },
              {
                  displayName: 'Email',
                  name: 'email',
                  type: 'string',
                  placeholder: 'name@email.com',
                  default: '',
              },
              {
                  displayName: 'Password',
                  name: 'password',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  placeholder: 'https://api.example.com',
              },
              {
                  displayName: 'API Version',
                  name: 'apiVersion',
                  default: 'v3',
                  type: 'options',
                  description: 'The version of api to be used',
                  options: [
                      {
                          name: 'Version 4',
                          value: 'v4',
                          description: 'API version supported by Strapi 4',
                      },
                      {
                          name: 'Version 3',
                          value: 'v3',
                          description: 'API version supported by Strapi 3',
                      },
                  ],
              },
          ];
      }
  }
  exports.StrapiApi = StrapiApi;
  //# sourceMappingURL=StrapiApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StrapiApi = void 0;
  class StrapiApi {
      constructor() {
          this.name = 'strapiApi';
          this.displayName = 'Strapi API';
          this.documentationUrl = 'strapi';
          this.properties = [
              {
                  displayName: 'Make sure you are using a user account not an admin account',
                  name: 'notice',
                  type: 'notice',
                  default: '',
              },
              {
                  displayName: 'Email',
                  name: 'email',
                  type: 'string',
                  placeholder: 'name@email.com',
                  default: '',
              },
              {
                  displayName: 'Password',
                  name: 'password',
                  type: 'string',
                  typeOptions: {
                      password: true,
                  },
                  default: '',
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  placeholder: 'https://api.example.com',
              },
              {
                  displayName: 'API Version',
                  name: 'apiVersion',
                  default: 'v3',
                  type: 'options',
                  description: 'The version of api to be used',
                  options: [
                      {
                          name: 'Version 4',
                          value: 'v4',
                          description: 'API version supported by Strapi 4',
                      },
                      {
                          name: 'Version 3',
                          value: 'v3',
                          description: 'API version supported by Strapi 3',
                      },
                  ],
              },
          ];
      }
  }
  exports.StrapiApi = StrapiApi;
  //# sourceMappingURL=StrapiApi.credentials.js.map

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

  # Strapi node

  Use the Strapi node to automate work in Strapi, and integrate Strapi with other applications. n8n has built-in support for a wide range of Strapi features, including creating and deleting entries. 

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

  /// note | Credentials
  Refer to [Strapi credentials](/integrations/builtin/credentials/strapi.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Entry
      * Create
      * Delete
      * Get
      * Get Many
      * Update

  ## Templates and examples

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

  ## Related resources

  Refer to [Strapi's documentation](https://docs.strapi.io/dev-docs/api/rest){:target=_blank .external-link} for more information about the service.

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"Strapi Example Workflow","nodes":[{"parameters":{},"id":"fripza26d8gc9eomu9v7yr","name":"Strapi","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Storyblok
name: Storyblok
display_name: Storyblok
description: Consume Storyblok API
category: output
icon: file:storyblok.svg
code_hash: 883eea1ccd320f86c2501929a0fa7ef6e0721ae17abc05a8e5c65d7b16983f24
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Storyblok
documentation_title: Storyblok node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"storyblok","description":"Templates for storyblok"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:37
updated_at: 2025-06-09 15:18:37
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Storyblok = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const StoryContentDescription_1 = require("./StoryContentDescription");
  const StoryManagementDescription_1 = require("./StoryManagementDescription");
  class Storyblok {
      constructor() {
          this.description = {
              displayName: 'Storyblok',
              name: 'storyblok',
              icon: 'file:storyblok.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Storyblok API',
              defaults: {
                  name: 'Storyblok',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'storyblokContentApi',
                      required: true,
                      displayOptions: {
                          show: {
                              source: ['contentApi'],
                          },
                      },
                  },
                  {
                      name: 'storyblokManagementApi',
                      required: true,
                      displayOptions: {
                          show: {
                              source: ['managementApi'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Source',
                      name: 'source',
                      type: 'options',
                      default: 'contentApi',
                      description: 'Pick where your data comes from, Content or Management API',
                      options: [
                          {
                              name: 'Content API',
                              value: 'contentApi',
                          },
                          {
                              name: 'Management API',
                              value: 'managementApi',
                          },
                      ],
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Story',
                              value: 'story',
                          },
                      ],
                      default: 'story',
                      displayOptions: {
                          show: {
                              source: ['contentApi'],
                          },
                      },
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Story',
                              value: 'story',
                          },
                      ],
                      default: 'story',
                      displayOptions: {
                          show: {
                              source: ['managementApi'],
                          },
                      },
                  },
                  ...StoryContentDescription_1.storyContentOperations,
                  ...StoryContentDescription_1.storyContentFields,
                  ...StoryManagementDescription_1.storyManagementOperations,
                  ...StoryManagementDescription_1.storyManagementFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getSpaces() {
                      const returnData = [];
                      const { spaces } = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', '/v1/spaces');
                      for (const space of spaces) {
                          returnData.push({
                              name: space.name,
                              value: space.id,
                          });
                      }
                      return returnData;
                  },
                  async getComponents() {
                      const returnData = [];
                      const space = this.getCurrentNodeParameter('space');
                      const { components } = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/spaces/${space}/components`);
                      for (const component of components) {
                          returnData.push({
                              name: `${component.name} ${component.is_root ? '(root)' : ''}`,
                              value: component.name,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const source = this.getNodeParameter('source', 0);
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (source === 'contentApi') {
                      if (resource === 'story') {
                          if (operation === 'get') {
                              const identifier = this.getNodeParameter('identifier', i);
                              responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/cdn/stories/${identifier}`);
                              responseData = responseData.story;
                          }
                          if (operation === 'getAll') {
                              const filters = this.getNodeParameter('filters', i);
                              const returnAll = this.getNodeParameter('returnAll', i);
                              Object.assign(qs, filters);
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.storyblokApiRequestAllItems.call(this, 'stories', 'GET', '/v1/cdn/stories', {}, qs);
                              }
                              else {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs.per_page = limit;
                                  responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', '/v1/cdn/stories', {}, qs);
                                  responseData = responseData.stories;
                              }
                          }
                      }
                  }
                  if (source === 'managementApi') {
                      if (resource === 'story') {
                          if (operation === 'delete') {
                              const space = this.getNodeParameter('space', i);
                              const storyId = this.getNodeParameter('storyId', i);
                              responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'DELETE', `/v1/spaces/${space}/stories/${storyId}`);
                              responseData = responseData.story;
                          }
                          if (operation === 'get') {
                              const space = this.getNodeParameter('space', i);
                              const storyId = this.getNodeParameter('storyId', i);
                              responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/spaces/${space}/stories/${storyId}`);
                              responseData = responseData.story;
                          }
                          if (operation === 'getAll') {
                              const space = this.getNodeParameter('space', i);
                              const filters = this.getNodeParameter('filters', i);
                              const returnAll = this.getNodeParameter('returnAll', i);
                              Object.assign(qs, filters);
                              if (returnAll) {
                                  responseData = await GenericFunctions_1.storyblokApiRequestAllItems.call(this, 'stories', 'GET', `/v1/spaces/${space}/stories`, {}, qs);
                              }
                              else {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs.per_page = limit;
                                  responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/spaces/${space}/stories`, {}, qs);
                                  responseData = responseData.stories;
                              }
                          }
                          if (operation === 'publish') {
                              const space = this.getNodeParameter('space', i);
                              const storyId = this.getNodeParameter('storyId', i);
                              const options = this.getNodeParameter('options', i);
                              const query = {};
                              if (options.releaseId) {
                                  query.release_id = options.releaseId;
                              }
                              if (options.language) {
                                  query.lang = options.language;
                              }
                              responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/spaces/${space}/stories/${storyId}/publish`, {}, query);
                              responseData = responseData.story;
                          }
                          if (operation === 'unpublish') {
                              const space = this.getNodeParameter('space', i);
                              const storyId = this.getNodeParameter('storyId', i);
                              responseData = await GenericFunctions_1.storyblokApiRequest.call(this, 'GET', `/v1/spaces/${space}/stories/${storyId}/unpublish`);
                              responseData = responseData.story;
                          }
                      }
                  }
                  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.Storyblok = Storyblok;
  //# sourceMappingURL=Storyblok.node.js.map

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

  # Storyblok node

  Use the Storyblok node to automate work in Storyblok, and integrate Storyblok with other applications. n8n has built-in support for a wide range of Storyblok features, including getting, deleting, and publishing stories. 

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

  /// note | Credentials
  Refer to [Storyblok credentials](/integrations/builtin/credentials/storyblok.md) for guidance on setting up authentication. 
  ///

  ## Operations

  ### Content API

  - **Story**
      - Get a story
      - Get all stories


  ### Management API

  - **Story**
      - Delete a story
      - Get a story
      - Get all stories
      - Publish a story
      - Unpublish a story

  ## Templates and examples

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

example_workflow:
  {"name":"Storyblok Example Workflow","nodes":[{"parameters":{},"id":"lfg776yj7nerjs1irqlbrm","name":"Storyblok","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Switch
name: Switch
display_name: Switch
description: Route items depending on defined expression or rules
category: transform
icon: fa:map-signs
code_hash: c1b9c3794375e6db2acbdf04c54a05bfeec3053a08c530f04f57e173953e77c9
documentation_url: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.Switch
documentation_title: Switch
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"switch","description":"Templates for switch"}]
related_resources: [{"title":"Splitting with conditionals","url":"/flow-logic/splitting.md","type":"documentation"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-09 15:18:38
updated_at: 2025-06-09 15:18:38
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Switch = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const SwitchV1_node_1 = require("./V1/SwitchV1.node");
  const SwitchV2_node_1 = require("./V2/SwitchV2.node");
  class Switch extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Switch',
              name: 'switch',
              icon: 'fa:map-signs',
              group: ['transform'],
              description: 'Route items depending on defined expression or rules',
              defaultVersion: 2,
          };
          const nodeVersions = {
              1: new SwitchV1_node_1.SwitchV1(baseDescription),
              2: new SwitchV2_node_1.SwitchV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Switch = Switch;
  //# sourceMappingURL=Switch.node.js.map

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

  # Switch

  Use the Switch node to route a workflow conditionally based on comparison operations. It's similar to the [IF](/integrations/builtin/core-nodes/n8n-nodes-base.if.md) node, but supports multiple output routes.

  ## Node parameters

  Select the **Mode** the node should use:

  * **Rules**: Select this mode to build a matching rule for each output.
  * **Expression**: Select this mode to write an expression to return the output index programmatically.

  Node configuration depends on the **Mode** you select.

  ### Rules

  To configure the node with this operation, use these parameters:

  * Create **Routing Rules** to define comparison conditions.
      * Use the data type dropdown to select the data type and comparison operation type for your condition. For example, to create a rules for dates after a particular date, select **Date & Time > is after**.
      * The fields and values to enter into the condition change based on the data type and comparison you select. Refer to [Available data type comparisons](#available-data-type-comparisons) for a full list of all comparisons by data type.
  * **Rename Output**: Turn this control on to rename the output field to put matching data into. Enter your desired **Output Name**.

  Select **Add Routing Rule** to add more rules.

  #### Rule options

  You can further configure the node with this operation using these **Options**:

  - **Fallback Output**: Choose how to route the workflow when an item doesn't match any of the rules or conditions.
      - **None**: Ignore the item. This is the default behavior.
      - **Extra Output**: Send items to an extra, separate output.
      - **Output 0**: Send items to the same output as those matching the first rule.
  - **Ignore Case**: Set whether to ignore letter case when evaluating conditions (turned on) or enforce letter case (turned off).
  - **Less Strict Type Validation**: Set whether you want n8n to attempt to convert value types based on the operator you choose (turned on) or not (turned off).
  - **Send data to all matching outputs**: Set whether to send data to all outputs meeting conditions (turned on) or whether to send the data to the first output matching the conditions (turned off).

  ### Expression

  To configure the node with this operation, use these parameters:

  - **Number of Outputs**: Set how many outputs the node should have.
  - **Output Index**: Create an expression to calculate which input item should be routed to which output. The expression must return a number.

  ## Templates and examples

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

  ## Related resources

  Refer to [Splitting with conditionals](/flow-logic/splitting.md) for more information on using conditionals to create complex logic in n8n.

  --8<-- "_snippets/integrations/builtin/core-nodes/data-types.md"

example_workflow:
  {"name":"Switch Example Workflow","nodes":[{"parameters":{},"id":"o3jzbg38dtog0avy5z4a","name":"Switch","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Stripe
name: Stripe
display_name: Stripe
description: Consume the Stripe API
category: transform
icon: file:stripe.svg
code_hash: a140efa1ba344639e26ed3feb6d57c8e4e5ed6c063161e3d63c831962c1f45ad
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Stripe
documentation_title: Stripe node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"stripe","description":"Templates for stripe"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:38
updated_at: 2025-06-09 15:18:38
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.Stripe = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  const helpers_1 = require("./helpers");
  const descriptions_1 = require("./descriptions");
  class Stripe {
      constructor() {
          this.description = {
              displayName: 'Stripe',
              name: 'stripe',
              icon: 'file:stripe.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Stripe API',
              defaults: {
                  name: 'Stripe',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'stripeApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Balance',
                              value: 'balance',
                          },
                          {
                              name: 'Charge',
                              value: 'charge',
                          },
                          {
                              name: 'Coupon',
                              value: 'coupon',
                          },
                          {
                              name: 'Customer',
                              value: 'customer',
                          },
                          {
                              name: 'Customer Card',
                              value: 'customerCard',
                          },
                          {
                              name: 'Source',
                              value: 'source',
                          },
                          {
                              name: 'Token',
                              value: 'token',
                          },
                      ],
                      default: 'balance',
                  },
                  ...descriptions_1.balanceOperations,
                  ...descriptions_1.customerCardOperations,
                  ...descriptions_1.customerCardFields,
                  ...descriptions_1.chargeOperations,
                  ...descriptions_1.chargeFields,
                  ...descriptions_1.couponOperations,
                  ...descriptions_1.couponFields,
                  ...descriptions_1.customerOperations,
                  ...descriptions_1.customerFields,
                  ...descriptions_1.sourceOperations,
                  ...descriptions_1.sourceFields,
                  ...descriptions_1.tokenOperations,
                  ...descriptions_1.tokenFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCustomers() {
                      return helpers_1.loadResource.call(this, 'customer');
                  },
                  async getCurrencies() {
                      const returnData = [];
                      const { data } = await helpers_1.stripeApiRequest.call(this, 'GET', '/country_specs', {});
                      for (const currency of data[0].supported_payment_currencies) {
                          returnData.push({
                              name: currency.toUpperCase(),
                              value: currency,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'balance') {
                      if (operation === 'get') {
                          responseData = await helpers_1.stripeApiRequest.call(this, 'GET', '/balance', {}, {});
                      }
                  }
                  else if (resource === 'customerCard') {
                      if (operation === 'add') {
                          const body = {
                              source: this.getNodeParameter('token', i),
                          };
                          const customerId = this.getNodeParameter('customerId', i);
                          const endpoint = `/customers/${customerId}/sources`;
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', endpoint, body, {});
                      }
                      else if (operation === 'remove') {
                          const customerId = this.getNodeParameter('customerId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const endpoint = `/customers/${customerId}/sources/${cardId}`;
                          responseData = await helpers_1.stripeApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      }
                      else if (operation === 'get') {
                          const customerId = this.getNodeParameter('customerId', i);
                          const sourceId = this.getNodeParameter('sourceId', i);
                          const endpoint = `/customers/${customerId}/sources/${sourceId}`;
                          responseData = await helpers_1.stripeApiRequest.call(this, 'GET', endpoint, {}, {});
                      }
                  }
                  else if (resource === 'charge') {
                      if (operation === 'create') {
                          const body = {
                              customer: this.getNodeParameter('customerId', i),
                              currency: this.getNodeParameter('currency', i).toLowerCase(),
                              amount: this.getNodeParameter('amount', i),
                              source: this.getNodeParameter('source', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(body, (0, helpers_1.adjustChargeFields)(additionalFields));
                          }
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', '/charges', body, {});
                      }
                      else if (operation === 'get') {
                          const chargeId = this.getNodeParameter('chargeId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'GET', `/charges/${chargeId}`, {}, {});
                      }
                      else if (operation === 'getAll') {
                          responseData = await helpers_1.handleListing.call(this, resource, i);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          Object.assign(body, (0, helpers_1.adjustChargeFields)(updateFields));
                          const chargeId = this.getNodeParameter('chargeId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', `/charges/${chargeId}`, body, {});
                      }
                  }
                  else if (resource === 'coupon') {
                      if (operation === 'create') {
                          const body = {
                              duration: this.getNodeParameter('duration', i),
                          };
                          const type = this.getNodeParameter('type', i);
                          if (type === 'fixedAmount') {
                              body.amount_off = this.getNodeParameter('amountOff', i);
                              body.currency = this.getNodeParameter('currency', i);
                          }
                          else {
                              body.percent_off = this.getNodeParameter('percentOff', i);
                          }
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', '/coupons', body, {});
                      }
                      else if (operation === 'getAll') {
                          responseData = await helpers_1.handleListing.call(this, resource, i);
                      }
                  }
                  else if (resource === 'customer') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(body, (0, helpers_1.adjustCustomerFields)(additionalFields));
                          }
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', '/customers', body, {});
                      }
                      else if (operation === 'delete') {
                          const customerId = this.getNodeParameter('customerId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'DELETE', `/customers/${customerId}`, {}, {});
                      }
                      else if (operation === 'get') {
                          const customerId = this.getNodeParameter('customerId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'GET', `/customers/${customerId}`, {}, {});
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (!(0, isEmpty_1.default)(filters)) {
                              qs.email = filters.email;
                          }
                          responseData = await helpers_1.handleListing.call(this, resource, i, qs);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if ((0, isEmpty_1.default)(updateFields)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                          }
                          Object.assign(body, (0, helpers_1.adjustCustomerFields)(updateFields));
                          const customerId = this.getNodeParameter('customerId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', `/customers/${customerId}`, body, {});
                      }
                  }
                  else if (resource === 'source') {
                      if (operation === 'create') {
                          const customerId = this.getNodeParameter('customerId', i);
                          const body = {
                              type: this.getNodeParameter('type', i),
                              amount: this.getNodeParameter('amount', i),
                              currency: this.getNodeParameter('currency', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(body, (0, helpers_1.adjustMetadata)(additionalFields));
                          }
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', '/sources', body, {});
                          const endpoint = `/customers/${customerId}/sources`;
                          await helpers_1.stripeApiRequest.call(this, 'POST', endpoint, { source: responseData.id }, {});
                      }
                      else if (operation === 'delete') {
                          const sourceId = this.getNodeParameter('sourceId', i);
                          const customerId = this.getNodeParameter('customerId', i);
                          const endpoint = `/customers/${customerId}/sources/${sourceId}`;
                          responseData = await helpers_1.stripeApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      }
                      else if (operation === 'get') {
                          const sourceId = this.getNodeParameter('sourceId', i);
                          responseData = await helpers_1.stripeApiRequest.call(this, 'GET', `/sources/${sourceId}`, {}, {});
                      }
                  }
                  else if (resource === 'token') {
                      if (operation === 'create') {
                          const type = this.getNodeParameter('type', i);
                          const body = {};
                          if (type !== 'cardToken') {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Only card token creation implemented.', { itemIndex: i });
                          }
                          body.card = {
                              number: this.getNodeParameter('number', i),
                              exp_month: this.getNodeParameter('expirationMonth', i),
                              exp_year: this.getNodeParameter('expirationYear', i),
                              cvc: this.getNodeParameter('cvc', i),
                          };
                          responseData = await helpers_1.stripeApiRequest.call(this, 'POST', '/tokens', body, {});
                      }
                  }
              }
              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.Stripe = Stripe;
  //# sourceMappingURL=Stripe.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StripeApi = void 0;
  class StripeApi {
      constructor() {
          this.name = 'stripeApi';
          this.displayName = 'Stripe API';
          this.documentationUrl = 'stripe';
          this.properties = [
              {
                  displayName: 'Secret Key',
                  name: 'secretKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.secretKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://api.stripe.com/v1',
                  url: '/charges',
                  json: true,
              },
          };
      }
  }
  exports.StripeApi = StripeApi;
  //# sourceMappingURL=StripeApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StripeApi = void 0;
  class StripeApi {
      constructor() {
          this.name = 'stripeApi';
          this.displayName = 'Stripe API';
          this.documentationUrl = 'stripe';
          this.properties = [
              {
                  displayName: 'Secret Key',
                  name: 'secretKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials.secretKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: 'https://api.stripe.com/v1',
                  url: '/charges',
                  json: true,
              },
          };
      }
  }
  exports.StripeApi = StripeApi;
  //# sourceMappingURL=StripeApi.credentials.js.map

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

  # Stripe node

  Use the Stripe node to automate work in Stripe, and integrate Stripe with other applications. n8n has built-in support for a wide range of Stripe features, including getting balance, creating charge, and deleting customers. 

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

  /// note | Credentials
  Refer to [Stripe credentials](/integrations/builtin/credentials/stripe.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Balance
      * Get a balance
  * Charge
      * Create a charge
      * Get a charge
      * Get all charges
      * Update a charge
  * Coupon
      * Create a coupon
      * Get all coupons
  * Customer
      * Create a customer
      * Delete a customer
      * Get a customer
      * Get all customers
      * Update a customer
  * Customer Card
      * Add a customer card
      * Get a customer card
      * Remove a customer card
  * Source
      * Create a source
      * Delete a source
      * Get a source
  * Token
      * Create a token

  ## Templates and examples

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

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"Stripe Example Workflow","nodes":[{"parameters":{},"id":"9ihegzddpjnpivcesxjtm","name":"Stripe","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Strava
name: Strava
display_name: Strava
description: Consume Strava API
category: input
icon: file:strava.svg
code_hash: 7a22dfb2e271c2501cb569ed4956c2717f03c82004e50494b33660c19bd5d9a5
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Strava
documentation_title: Strava node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"strava","description":"Templates for strava"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:38
updated_at: 2025-06-09 15:18:38
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.Strava = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ActivityDescription_1 = require("./ActivityDescription");
  const moment_1 = __importDefault(require("moment"));
  class Strava {
      constructor() {
          this.description = {
              displayName: 'Strava',
              name: 'strava',
              icon: 'file:strava.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Strava API',
              defaults: {
                  name: 'Strava',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'stravaOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Activity',
                              value: 'activity',
                          },
                      ],
                      default: 'activity',
                  },
                  ...ActivityDescription_1.activityOperations,
                  ...ActivityDescription_1.activityFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'activity') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const type = this.getNodeParameter('type', i);
                          const startDate = this.getNodeParameter('startDate', i);
                          const elapsedTime = this.getNodeParameter('elapsedTime', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.trainer === true) {
                              additionalFields.trainer = 1;
                          }
                          if (additionalFields.commute === true) {
                              additionalFields.commute = 1;
                          }
                          const body = {
                              name,
                              type,
                              start_date_local: (0, moment_1.default)(startDate).toISOString(),
                              elapsed_time: elapsedTime,
                          };
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'POST', '/activities', body);
                      }
                      if (operation === 'get') {
                          const activityId = this.getNodeParameter('activityId', i);
                          responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'GET', `/activities/${activityId}`);
                      }
                      if (['getLaps', 'getZones', 'getKudos', 'getComments'].includes(operation)) {
                          const path = {
                              getComments: 'comments',
                              getZones: 'zones',
                              getKudos: 'kudos',
                              getLaps: 'laps',
                          };
                          const activityId = this.getNodeParameter('activityId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'GET', `/activities/${activityId}/${path[operation]}`);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'getStreams') {
                          const activityId = this.getNodeParameter('activityId', i);
                          const keys = this.getNodeParameter('keys', i);
                          qs.keys = keys.toString();
                          qs.key_by_type = true;
                          responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'GET', `/activities/${activityId}/streams`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.stravaApiRequestAllItems.call(this, 'GET', '/activities', {}, qs);
                          }
                          else {
                              qs.per_page = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'GET', '/activities', {}, qs);
                          }
                      }
                      if (operation === 'update') {
                          const activityId = this.getNodeParameter('activityId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          Object.assign(body, updateFields);
                          responseData = await GenericFunctions_1.stravaApiRequest.call(this, 'PUT', `/activities/${activityId}`, body);
                      }
                  }
                  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.Strava = Strava;
  //# sourceMappingURL=Strava.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StravaOAuth2Api = void 0;
  class StravaOAuth2Api {
      constructor() {
          this.name = 'stravaOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Strava OAuth2 API';
          this.documentationUrl = 'strava';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://www.strava.com/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://www.strava.com/oauth/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'activity:read_all,activity:write',
                  required: true,
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.StravaOAuth2Api = StravaOAuth2Api;
  //# sourceMappingURL=StravaOAuth2Api.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.StravaOAuth2Api = void 0;
  class StravaOAuth2Api {
      constructor() {
          this.name = 'stravaOAuth2Api';
          this.extends = ['oAuth2Api'];
          this.displayName = 'Strava OAuth2 API';
          this.documentationUrl = 'strava';
          this.properties = [
              {
                  displayName: 'Grant Type',
                  name: 'grantType',
                  type: 'hidden',
                  default: 'authorizationCode',
              },
              {
                  displayName: 'Authorization URL',
                  name: 'authUrl',
                  type: 'hidden',
                  default: 'https://www.strava.com/oauth/authorize',
                  required: true,
              },
              {
                  displayName: 'Access Token URL',
                  name: 'accessTokenUrl',
                  type: 'hidden',
                  default: 'https://www.strava.com/oauth/token',
                  required: true,
              },
              {
                  displayName: 'Scope',
                  name: 'scope',
                  type: 'hidden',
                  default: 'activity:read_all,activity:write',
                  required: true,
              },
              {
                  displayName: 'Auth URI Query Parameters',
                  name: 'authQueryParameters',
                  type: 'hidden',
                  default: '',
              },
              {
                  displayName: 'Authentication',
                  name: 'authentication',
                  type: 'hidden',
                  default: 'body',
              },
          ];
      }
  }
  exports.StravaOAuth2Api = StravaOAuth2Api;
  //# sourceMappingURL=StravaOAuth2Api.credentials.js.map

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

  # Strava node

  Use the Strava node to automate work in Strava, and integrate Strava with other applications. n8n has built-in support for a wide range of Strava features, including creating new activities, and getting activity information. 

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

  /// note | Credentials
  Refer to [Strava credentials](/integrations/builtin/credentials/strava.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Activity
      * Create a new activity
      * Get an activity
      * Get all activities
      * Get all activity comments
      * Get all activity kudos
      * Get all activity laps
      * Get all activity zones
      * Update an activity

  ## Templates and examples

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

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

example_workflow:
  {"name":"Strava Example Workflow","nodes":[{"parameters":{},"id":"c8zf4hjb5l5f6rl4va2apc","name":"Strava","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Supabase
name: Supabase
display_name: Supabase
description: Add, get, delete and update data in a table
category: input
icon: file:supabase.svg
code_hash: 6690085b257b8dfeb9738fd6b9f1ff9c39e50ee8432805b445f1c3c7f934bf41
documentation_title: Supabase Vector Store node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"supabase-vector-store","description":"Templates for supabase-vector-store"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:38
updated_at: 2025-06-09 15:18:38
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Supabase = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const RowDescription_1 = require("./RowDescription");
  class Supabase {
      constructor() {
          this.description = {
              displayName: 'Supabase',
              name: 'supabase',
              icon: 'file:supabase.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Add, get, delete and update data in a table',
              defaults: {
                  name: 'Supabase',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'supabaseApi',
                      required: true,
                      testedBy: 'supabaseApiCredentialTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Row',
                              value: 'row',
                          },
                      ],
                      default: 'row',
                  },
                  ...RowDescription_1.rowOperations,
                  ...RowDescription_1.rowFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTables() {
                      const returnData = [];
                      const { paths } = await GenericFunctions_1.supabaseApiRequest.call(this, 'GET', '/');
                      for (const path of Object.keys(paths)) {
                          if (path === '/')
                              continue;
                          returnData.push({
                              name: path.replace('/', ''),
                              value: path.replace('/', ''),
                          });
                      }
                      return returnData;
                  },
                  async getTableColumns() {
                      const returnData = [];
                      const tableName = this.getCurrentNodeParameter('tableId');
                      const { definitions } = await GenericFunctions_1.supabaseApiRequest.call(this, 'GET', '/');
                      for (const column of Object.keys(definitions[tableName].properties)) {
                          returnData.push({
                              name: `${column} - (${definitions[tableName].properties[column].type})`,
                              value: column,
                          });
                      }
                      return returnData;
                  },
              },
              credentialTest: {
                  async supabaseApiCredentialTest(credential) {
                      try {
                          await GenericFunctions_1.validateCredentials.call(this, credential.data);
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: 'The Service Key is invalid',
                          };
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          if (resource === 'row') {
              if (operation === 'create') {
                  const records = [];
                  const tableId = this.getNodeParameter('tableId', 0);
                  for (let i = 0; i < length; i++) {
                      const record = {};
                      const dataToSend = this.getNodeParameter('dataToSend', 0);
                      if (dataToSend === 'autoMapInputData') {
                          const incomingKeys = Object.keys(items[i].json);
                          const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i);
                          const inputDataToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
                          for (const key of incomingKeys) {
                              if (inputDataToIgnore.includes(key))
                                  continue;
                              record[key] = items[i].json[key];
                          }
                      }
                      else {
                          const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          for (const field of fields) {
                              record[`${field.fieldId}`] = field.fieldValue;
                          }
                      }
                      records.push(record);
                  }
                  const endpoint = `/${tableId}`;
                  try {
                      const createdRows = await GenericFunctions_1.supabaseApiRequest.call(this, 'POST', endpoint, records);
                      createdRows.forEach((row, i) => {
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(row), { itemData: { item: i } });
                          returnData.push(...executionData);
                      });
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.description }), { itemData: (0, GenericFunctions_1.mapPairedItemsFrom)(records) });
                          returnData.push(...executionData);
                      }
                      else {
                          throw error;
                      }
                  }
              }
              if (operation === 'delete') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const filterType = this.getNodeParameter('filterType', 0);
                  let endpoint = `/${tableId}`;
                  for (let i = 0; i < length; i++) {
                      if (filterType === 'manual') {
                          const matchType = this.getNodeParameter('matchType', 0);
                          const keys = this.getNodeParameter('filters.conditions', i, []);
                          if (!keys.length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'At least one select condition must be defined', { itemIndex: i });
                          }
                          if (matchType === 'allFilters') {
                              const data = keys.reduce((obj, value) => (0, GenericFunctions_1.buildQuery)(obj, value), {});
                              Object.assign(qs, data);
                          }
                          if (matchType === 'anyFilter') {
                              const data = keys.map((key) => (0, GenericFunctions_1.buildOrQuery)(key));
                              Object.assign(qs, { or: `(${data.join(',')})` });
                          }
                      }
                      if (filterType === 'string') {
                          const filterString = this.getNodeParameter('filterString', i);
                          endpoint = `${endpoint}?${encodeURI(filterString)}`;
                      }
                      let rows;
                      try {
                          rows = await GenericFunctions_1.supabaseApiRequest.call(this, 'DELETE', endpoint, {}, qs);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.description }), { itemData: { item: i } });
                              returnData.push(...executionData);
                              continue;
                          }
                          throw error;
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(rows), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'get') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const endpoint = `/${tableId}`;
                  for (let i = 0; i < length; i++) {
                      const keys = this.getNodeParameter('filters.conditions', i, []);
                      const data = keys.reduce((obj, value) => (0, GenericFunctions_1.buildGetQuery)(obj, value), {});
                      Object.assign(qs, data);
                      let rows;
                      if (!keys.length) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'At least one select condition must be defined', { itemIndex: i });
                      }
                      try {
                          rows = await GenericFunctions_1.supabaseApiRequest.call(this, 'GET', endpoint, {}, qs);
                      }
                      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;
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(rows), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'getAll') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const returnAll = this.getNodeParameter('returnAll', 0);
                  const filterType = this.getNodeParameter('filterType', 0);
                  let endpoint = `/${tableId}`;
                  for (let i = 0; i < length; i++) {
                      if (filterType === 'manual') {
                          const matchType = this.getNodeParameter('matchType', 0);
                          const keys = this.getNodeParameter('filters.conditions', i, []);
                          if (keys.length !== 0) {
                              if (matchType === 'allFilters') {
                                  const data = keys.reduce((obj, value) => (0, GenericFunctions_1.buildQuery)(obj, value), {});
                                  Object.assign(qs, data);
                              }
                              if (matchType === 'anyFilter') {
                                  const data = keys.map((key) => (0, GenericFunctions_1.buildOrQuery)(key));
                                  Object.assign(qs, { or: `(${data.join(',')})` });
                              }
                          }
                      }
                      if (filterType === 'string') {
                          const filterString = this.getNodeParameter('filterString', i);
                          endpoint = `${endpoint}?${encodeURI(filterString)}`;
                      }
                      if (!returnAll) {
                          qs.limit = this.getNodeParameter('limit', 0);
                      }
                      let rows;
                      try {
                          rows = await GenericFunctions_1.supabaseApiRequest.call(this, 'GET', endpoint, {}, qs);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(rows), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.description }), { itemData: { item: i } });
                              returnData.push(...executionData);
                              continue;
                          }
                          throw error;
                      }
                  }
              }
              if (operation === 'update') {
                  const tableId = this.getNodeParameter('tableId', 0);
                  const filterType = this.getNodeParameter('filterType', 0);
                  let endpoint = `/${tableId}`;
                  for (let i = 0; i < length; i++) {
                      if (filterType === 'manual') {
                          const matchType = this.getNodeParameter('matchType', 0);
                          const keys = this.getNodeParameter('filters.conditions', i, []);
                          if (!keys.length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'At least one select condition must be defined', { itemIndex: i });
                          }
                          if (matchType === 'allFilters') {
                              const data = keys.reduce((obj, value) => (0, GenericFunctions_1.buildQuery)(obj, value), {});
                              Object.assign(qs, data);
                          }
                          if (matchType === 'anyFilter') {
                              const data = keys.map((key) => (0, GenericFunctions_1.buildOrQuery)(key));
                              Object.assign(qs, { or: `(${data.join(',')})` });
                          }
                      }
                      if (filterType === 'string') {
                          const filterString = this.getNodeParameter('filterString', i);
                          endpoint = `${endpoint}?${encodeURI(filterString)}`;
                      }
                      const record = {};
                      const dataToSend = this.getNodeParameter('dataToSend', 0);
                      if (dataToSend === 'autoMapInputData') {
                          const incomingKeys = Object.keys(items[i].json);
                          const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i);
                          const inputDataToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
                          for (const key of incomingKeys) {
                              if (inputDataToIgnore.includes(key))
                                  continue;
                              record[key] = items[i].json[key];
                          }
                      }
                      else {
                          const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          for (const field of fields) {
                              record[`${field.fieldId}`] = field.fieldValue;
                          }
                      }
                      let updatedRow;
                      try {
                          updatedRow = await GenericFunctions_1.supabaseApiRequest.call(this, 'PATCH', endpoint, record, qs);
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(updatedRow), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      catch (error) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.description }), { itemData: { item: i } });
                              returnData.push(...executionData);
                              continue;
                          }
                          throw error;
                      }
                  }
              }
          }
          return [returnData];
      }
  }
  exports.Supabase = Supabase;
  //# sourceMappingURL=Supabase.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SupabaseApi = void 0;
  class SupabaseApi {
      constructor() {
          this.name = 'supabaseApi';
          this.displayName = 'Supabase API';
          this.documentationUrl = 'supabase';
          this.properties = [
              {
                  displayName: 'Host',
                  name: 'host',
                  type: 'string',
                  placeholder: 'https://your_account.supabase.co',
                  default: '',
              },
              {
                  displayName: 'Service Role Secret',
                  name: 'serviceRole',
                  type: 'string',
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      apikey: '={{$credentials.serviceRole}}',
                      Authorization: '=Bearer {{$credentials.serviceRole}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.host}}/rest/v1',
                  headers: {
                      Prefer: 'return=representation',
                  },
                  url: '/',
              },
          };
      }
  }
  exports.SupabaseApi = SupabaseApi;
  //# sourceMappingURL=SupabaseApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SupabaseApi = void 0;
  class SupabaseApi {
      constructor() {
          this.name = 'supabaseApi';
          this.displayName = 'Supabase API';
          this.documentationUrl = 'supabase';
          this.properties = [
              {
                  displayName: 'Host',
                  name: 'host',
                  type: 'string',
                  placeholder: 'https://your_account.supabase.co',
                  default: '',
              },
              {
                  displayName: 'Service Role Secret',
                  name: 'serviceRole',
                  type: 'string',
                  default: '',
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      apikey: '={{$credentials.serviceRole}}',
                      Authorization: '=Bearer {{$credentials.serviceRole}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials.host}}/rest/v1',
                  headers: {
                      Prefer: 'return=representation',
                  },
                  url: '/',
              },
          };
      }
  }
  exports.SupabaseApi = SupabaseApi;
  //# sourceMappingURL=SupabaseApi.credentials.js.map

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

  # Supabase Vector Store node

  Use the Supabase Vector Store to interact with your Supabase database as [vector store](/glossary.md#ai-vector-store). You can insert documents into a vector database, get documents from a vector database, retrieve documents to provide them to a retriever connected to a [chain](/glossary.md#ai-chain), or connect it directly to an [agent](/glossary.md#ai-agent) to use as a [tool](/glossary.md#ai-tool).

  On this page, you'll find the node parameters for the Supabase node, and links to more resources.

  /// note | Credentials
  You can find authentication information for this node [here](/integrations/builtin/credentials/supabase.md).
  ///

  --8<-- "_snippets/integrations/builtin/cluster-nodes/sub-node-expression-resolution.md"
  	
  Supabase provides a [quickstart for setting up your vector store](https://supabase.com/docs/guides/ai/langchain?database-method=sql){:target=_blank .external-link}. If you use settings other than the defaults in the quickstart, this may affect parameter settings in n8n. Make sure you understand what you're doing.

  ## Node usage patterns

  You can use the Supabase Vector Store node in the following patterns.

  ### Use as a regular node to insert, update, and retrieve documents

  You can use the Supabase Vector Store as a regular node to insert, update, or get documents. This pattern places the Supabase Vector Store in the regular connection flow without using an agent.

  You can see an example of this in scenario 1 of [this template](https://n8n.io/workflows/2621-ai-agent-to-chat-with-files-in-supabase-storage/).

  ### Connect directly to an AI agent as a tool

  You can connect the Supabase Vector Store node directly to the tool connector of an [AI agent](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/index.md) to use a vector store as a resource when answering queries.

  Here, the connection would be: AI agent (tools connector) -> Supabase Vector Store node.

  ### Use a retriever to fetch documents

  You can use the [Vector Store Retriever](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.retrievervectorstore.md) node with the Supabase Vector Store node to fetch documents from the Supabase Vector Store node. This is often used with the [Question and Answer Chain](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainretrievalqa/index.md) node to fetch documents from the vector store that match the given chat input.

  An [example of the connection flow](https://n8n.io/workflows/1960-ask-questions-about-a-pdf-using-ai/) (the example uses Pinecone, but the pattern in the same) would be: Question and Answer Chain (Retriever connector) -> Vector Store Retriever (Vector Store connector) -> Supabase Vector Store.

  ### Use the Vector Store Question Answer Tool to answer questions

  Another pattern uses the [Vector Store Question Answer Tool](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolvectorstore.md) to summarize results and answer questions from the Supabase Vector Store node. Rather than connecting the Supabase Vector Store directly as a tool, this pattern uses a tool specifically designed to summarizes data in the vector store.

  The [connections flow](https://n8n.io/workflows/2621-ai-agent-to-chat-with-files-in-supabase-storage/) in this case would look like this: AI agent (tools connector) -> Vector Store Question Answer Tool (Vector Store connector) -> Supabase Vector store.

  ## Node parameters

  --8<-- "_snippets/integrations/builtin/cluster-nodes/vector-store-mode-with-update.md"

  <!-- vale from-write-good.Weasel = NO -->
  ### Get Many parameters
  <!-- vale from-write-good.Weasel = YES -->

  * **Table Name**: Enter the Supabase table to use.
  * **Prompt**: Enter the search query.
  * **Limit**: Enter how many results to retrieve from the vector store. For example, set this to `10` to get the ten best results.

  ### Insert Documents parameters

  * **Table Name**: Enter the Supabase table to use.

  ### Retrieve Documents (As Vector Store for Chain/Tool) parameters

  * **Table Name**: Enter the Supabase table to use.

  ### Retrieve Documents (As Tool for AI Agent) parameters

  * **Name**: The name of the vector store.
  * **Description**: Explain to the LLM what this tool does. A good, specific description allows LLMs to produce expected results more often.
  * **Table Name**: Enter the Supabase table to use.
  * **Limit**: Enter how many results to retrieve from the vector store. For example, set this to `10` to get the ten best results.

  ### Update Documents

  * **Table Name**: Enter the Supabase table to use.
  * **ID**: The ID of an embedding entry.

  ## Node options

  ### Query Name

  The name of the matching function you set up in Supabase. If you follow the [Supabase quickstart](https://supabase.com/docs/guides/ai/langchain?database-method=sql){:target=_blank .external-link}, this will be `match_documents`.

  ### Metadata Filter

  --8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-root-nodes/vector-store-metadata-filter.md"

  ## Templates and examples

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

  ## Related resources

  Refer to [LangChain's Supabase documentation](https://js.langchain.com/docs/integrations/vectorstores/supabase/){:target=_blank .external-link} for more information about the service.

  --8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-overview-link.md"
  --8<-- "_glossary/ai-glossary.md"

documentation_url:
  https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoresupabase

related_resources:
  [{"title":"LangChain's Supabase documentation","url":"https://js.langchain.com/docs/integrations/vectorstores/supabase/","type":"external"}]

example_workflow:
  {"name":"Supabase Example Workflow","nodes":[{"parameters":{},"id":"5wg25io1j36zxebxxfugv","name":"Supabase","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.SyncroMsp
name: SyncroMsp
display_name: SyncroMSP
description: Manage contacts, tickets and more from Syncro MSP
category: output
icon: file:syncromsp.png
code_hash: c44903a2bc514e7a1c98052f565802f0d82e466c953f0bda06cf0bcaab6f8c89
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.SyncroMsp
documentation_title: SyncroMSP node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"syncromsp","description":"Templates for syncromsp"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-09 15:18:38
updated_at: 2025-06-09 15:18:38
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SyncroMsp = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const SyncroMspV1_node_1 = require("./v1/SyncroMspV1.node");
  class SyncroMsp extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'SyncroMSP',
              name: 'syncroMsp',
              icon: 'file:syncromsp.png',
              group: ['output'],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Manage contacts, tickets and more from Syncro MSP',
              defaultVersion: 1,
          };
          const nodeVersions = {
              1: new SyncroMspV1_node_1.SyncroMspV1(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.SyncroMsp = SyncroMsp;
  //# sourceMappingURL=SyncroMsp.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SyncroMspApi = void 0;
  class SyncroMspApi {
      constructor() {
          this.name = 'syncroMspApi';
          this.displayName = 'SyncroMSP API';
          this.documentationUrl = 'syncromsp';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Subdomain',
                  name: 'subdomain',
                  type: 'string',
                  default: '',
              },
          ];
      }
  }
  exports.SyncroMspApi = SyncroMspApi;
  //# sourceMappingURL=SyncroMspApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.SyncroMspApi = void 0;
  class SyncroMspApi {
      constructor() {
          this.name = 'syncroMspApi';
          this.displayName = 'SyncroMSP API';
          this.documentationUrl = 'syncromsp';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Subdomain',
                  name: 'subdomain',
                  type: 'string',
                  default: '',
              },
          ];
      }
  }
  exports.SyncroMspApi = SyncroMspApi;
  //# sourceMappingURL=SyncroMspApi.credentials.js.map

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

  # SyncroMSP node

  Use the SyncroMSP node to automate work in SyncroMSP, and integrate SyncroMSP with other applications. n8n has built-in support for a wide range of SyncroMSP features, including creating and deleting new customers, tickets, and contacts. 

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

  /// note | Credentials
  Refer to [SyncroMSP credentials](/integrations/builtin/credentials/syncromsp.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Contact
      * Create new contact
      * Delete contact
      * Retrieve contact
      * Retrieve all contacts
      * Update contact
  * Customer
      * Create new customer
      * Delete customer
      * Retrieve customer
      * Retrieve all customers
      * Update customer
  * RMM
      * Create new RMM Alert
      * Delete RMM Alert
      * Retrieve RMM Alert
      * Retrieve all RMM Alerts
      * Mute RMM Alert
  * Ticket
      * Create new ticket
      * Delete ticket
      * Retrieve ticket
      * Retrieve all tickets
      * Update ticket

  ## Templates and examples

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

example_workflow:
  {"name":"SyncroMSP Example Workflow","nodes":[{"parameters":{},"id":"xylkjdtgag2u1rdztl04j","name":"SyncroMSP","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Tapfiliate
name: Tapfiliate
display_name: Tapfiliate
description: Consume Tapfiliate API
category: transform
icon: file:tapfiliate.svg
code_hash: 322284a7aa45ad766d6bfbf77223992d532b8fa418f9f4a1c231747871981d2e
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Tapfiliate
documentation_title: Tapfiliate node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"tapfiliate","description":"Templates for tapfiliate"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:39
updated_at: 2025-06-09 15:18:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Tapfiliate = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const AffiliateDescription_1 = require("./AffiliateDescription");
  const AffiliateMetadataDescription_1 = require("./AffiliateMetadataDescription");
  const ProgramAffiliateDescription_1 = require("./ProgramAffiliateDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Tapfiliate {
      constructor() {
          this.description = {
              displayName: 'Tapfiliate',
              name: 'tapfiliate',
              icon: 'file:tapfiliate.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ":" + $parameter["resource"]}}',
              description: 'Consume Tapfiliate API',
              defaults: {
                  name: 'Tapfiliate',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'tapfiliateApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Affiliate',
                              value: 'affiliate',
                          },
                          {
                              name: 'Affiliate Metadata',
                              value: 'affiliateMetadata',
                          },
                          {
                              name: 'Program Affiliate',
                              value: 'programAffiliate',
                          },
                      ],
                      default: 'affiliate',
                      required: true,
                  },
                  ...AffiliateDescription_1.affiliateOperations,
                  ...AffiliateDescription_1.affiliateFields,
                  ...AffiliateMetadataDescription_1.affiliateMetadataOperations,
                  ...AffiliateMetadataDescription_1.affiliateMetadataFields,
                  ...ProgramAffiliateDescription_1.programAffiliateOperations,
                  ...ProgramAffiliateDescription_1.programAffiliateFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getPrograms() {
                      const returnData = [];
                      const programs = await GenericFunctions_1.tapfiliateApiRequestAllItems.call(this, 'GET', '/programs/');
                      for (const program of programs) {
                          returnData.push({
                              name: program.title,
                              value: program.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          var _a;
          const items = this.getInputData();
          const length = items.length;
          const qs = {};
          let responseData;
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'affiliate') {
                      if (operation === 'create') {
                          const firstname = this.getNodeParameter('firstname', i);
                          const lastname = this.getNodeParameter('lastname', i);
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              firstname,
                              lastname,
                              email,
                          };
                          Object.assign(body, additionalFields);
                          if (body.addressUi) {
                              body.address = body.addressUi.addressValues;
                              delete body.addressUi;
                              if (body.address.country) {
                                  body.address.country = {
                                      code: body.address.country,
                                  };
                              }
                          }
                          if (body.companyName) {
                              body.company = {
                                  name: body.companyName,
                              };
                              delete body.companyName;
                          }
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'POST', '/affiliates/', body);
                          returnData.push(responseData);
                      }
                      if (operation === 'delete') {
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'DELETE', `/affiliates/${affiliateId}/`);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'GET', `/affiliates/${affiliateId}/`);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.tapfiliateApiRequestAllItems.call(this, 'GET', '/affiliates/', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'GET', '/affiliates/', {}, qs);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  if (resource === 'affiliateMetadata') {
                      if (operation === 'add') {
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          const metadata = ((_a = this.getNodeParameter('metadataUi', i)) === null || _a === void 0 ? void 0 : _a.metadataValues) || [];
                          if (metadata.length === 0) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Metadata cannot be empty.', {
                                  itemIndex: i,
                              });
                          }
                          for (const { key, value } of metadata) {
                              await GenericFunctions_1.tapfiliateApiRequest.call(this, 'PUT', `/affiliates/${affiliateId}/meta-data/${key}/`, { value });
                          }
                          responseData = { success: true };
                      }
                      if (operation === 'remove') {
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          const key = this.getNodeParameter('key', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'DELETE', `/affiliates/${affiliateId}/meta-data/${key}/`);
                          responseData = { success: true };
                      }
                      if (operation === 'update') {
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          const key = this.getNodeParameter('key', i);
                          const value = this.getNodeParameter('value', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'PUT', `/affiliates/${affiliateId}/meta-data/`, { [key]: value });
                      }
                  }
                  if (resource === 'programAffiliate') {
                      if (operation === 'add') {
                          const programId = this.getNodeParameter('programId', i);
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              affiliate: {
                                  id: affiliateId,
                              },
                          };
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'POST', `/programs/${programId}/affiliates/`, body);
                      }
                      if (operation === 'approve') {
                          const programId = this.getNodeParameter('programId', i);
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'PUT', `/programs/${programId}/affiliates/${affiliateId}/approved/`);
                      }
                      if (operation === 'disapprove') {
                          const programId = this.getNodeParameter('programId', i);
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'DELETE', `/programs/${programId}/affiliates/${affiliateId}/approved/`);
                      }
                      if (operation === 'get') {
                          const programId = this.getNodeParameter('programId', i);
                          const affiliateId = this.getNodeParameter('affiliateId', i);
                          responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'GET', `/programs/${programId}/affiliates/${affiliateId}/`);
                      }
                      if (operation === 'getAll') {
                          const programId = this.getNodeParameter('programId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.tapfiliateApiRequestAllItems.call(this, 'GET', `/programs/${programId}/affiliates/`, {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.tapfiliateApiRequest.call(this, 'GET', `/programs/${programId}/affiliates/`, {}, qs);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  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.Tapfiliate = Tapfiliate;
  //# sourceMappingURL=Tapfiliate.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TapfiliateApi = void 0;
  class TapfiliateApi {
      constructor() {
          this.name = 'tapfiliateApi';
          this.displayName = 'Tapfiliate API';
          this.documentationUrl = 'tapfiliate';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  required: true,
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.TapfiliateApi = TapfiliateApi;
  //# sourceMappingURL=TapfiliateApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TapfiliateApi = void 0;
  class TapfiliateApi {
      constructor() {
          this.name = 'tapfiliateApi';
          this.displayName = 'Tapfiliate API';
          this.documentationUrl = 'tapfiliate';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'apiKey',
                  required: true,
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
          ];
      }
  }
  exports.TapfiliateApi = TapfiliateApi;
  //# sourceMappingURL=TapfiliateApi.credentials.js.map

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

  # Tapfiliate node

  Use the Tapfiliate node to automate work in Tapfiliate, and integrate Tapfiliate with other applications. n8n has built-in support for a wide range of Tapfiliate features, including creating and deleting affiliates, and adding affiliate metadata. 

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

  /// note | Credentials
  Refer to [Tapfiliate credentials](/integrations/builtin/credentials/tapfiliate.md) for guidance on setting up authentication. 
  ///

  ## Operations

  * Affiliate
      * Create an affiliate
      * Delete an affiliate
      * Get an affiliate by ID
      * Get all affiliates
  * Affiliate Metadata
      * Add metadata to affiliate
      * Remove metadata from affiliate
      * Update affiliate's metadata
  * Program Affiliate
      * Add affiliate to program
      * Approve an affiliate for a program
      * Disapprove an affiliate
      * Get an affiliate in a program
      * Get all affiliates in program

  ## Templates and examples

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

example_workflow:
  {"name":"Tapfiliate Example Workflow","nodes":[{"parameters":{},"id":"kuehz1z2iho10qellql33r","name":"Tapfiliate","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Taiga
name: Taiga
display_name: Taiga
description: Consume Taiga API
category: transform
icon: file:taiga.svg
code_hash: b5515948bd59b70034e4508dd755ebad7d28139a4db63a8d93f64faf53aaa923
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.Taiga
documentation_title: Taiga node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"taiga","description":"Templates for taiga"}]
related_resources: []
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:39
updated_at: 2025-06-09 15:18:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Taiga = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class Taiga {
      constructor() {
          this.description = {
              displayName: 'Taiga',
              name: 'taiga',
              icon: 'file:taiga.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Taiga API',
              defaults: {
                  name: 'Taiga',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'taigaApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Epic',
                              value: 'epic',
                          },
                          {
                              name: 'Issue',
                              value: 'issue',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                          {
                              name: 'User Story',
                              value: 'userStory',
                          },
                      ],
                      default: 'issue',
                  },
                  ...descriptions_1.epicOperations,
                  ...descriptions_1.epicFields,
                  ...descriptions_1.issueOperations,
                  ...descriptions_1.issueFields,
                  ...descriptions_1.taskOperations,
                  ...descriptions_1.taskFields,
                  ...descriptions_1.userStoryOperations,
                  ...descriptions_1.userStoryFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getEpics() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const epics = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/epics', {}, { project }));
                      return epics.map(({ subject, id }) => ({ name: subject, value: id }));
                  },
                  async getMilestones() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const milestones = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/milestones', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(milestones);
                  },
                  async getPriorities() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const priorities = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/priorities', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(priorities);
                  },
                  async getProjects() {
                      const { id } = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/users/me'));
                      const projects = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/projects', {}, { member: id }));
                      return (0, GenericFunctions_1.toOptions)(projects);
                  },
                  async getRoles() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const roles = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/roles', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(roles);
                  },
                  async getSeverities() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const severities = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/severities', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(severities);
                  },
                  async getTags() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const tags = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', `/projects/${project}/tags_colors`));
                      return Object.keys(tags).map((tag) => ({ name: tag, value: tag }));
                  },
                  async getTypes() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const types = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/issue-types', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(types);
                  },
                  async getUsers() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const users = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/users', {}, { project }));
                      return users.map(({ full_name_display, id }) => ({ name: full_name_display, value: id }));
                  },
                  async getUserStories() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const userStories = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/userstories', {}, { project }));
                      return userStories.map(({ subject, id }) => ({ name: subject, value: id }));
                  },
                  async getIssueStatuses() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const statuses = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/issue-statuses', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(statuses);
                  },
                  async getTaskStatuses() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const statuses = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/task-statuses', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(statuses);
                  },
                  async getUserStoryStatuses() {
                      const project = this.getCurrentNodeParameter('projectId');
                      const statuses = (await GenericFunctions_1.taigaApiRequest.call(this, 'GET', '/userstory-statuses', {}, { project }));
                      return (0, GenericFunctions_1.toOptions)(statuses);
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'epic') {
                      if (operation === 'create') {
                          const body = {
                              project: this.getNodeParameter('projectId', i),
                              subject: this.getNodeParameter('subject', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'POST', '/epics', body);
                      }
                      else if (operation === 'delete') {
                          const epicId = this.getNodeParameter('epicId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'DELETE', `/epics/${epicId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const epicId = this.getNodeParameter('epicId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'GET', `/epics/${epicId}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/epics', {}, qs, i);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          else {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const epicId = this.getNodeParameter('epicId', i);
                          body.version = await GenericFunctions_1.getVersionForUpdate.call(this, `/epics/${epicId}`);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'PATCH', `/epics/${epicId}`, body);
                      }
                  }
                  else if (resource === 'issue') {
                      if (operation === 'create') {
                          const body = {
                              project: this.getNodeParameter('projectId', i),
                              subject: this.getNodeParameter('subject', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'POST', '/issues', body);
                      }
                      else if (operation === 'delete') {
                          const issueId = this.getNodeParameter('issueId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'DELETE', `/issues/${issueId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const issueId = this.getNodeParameter('issueId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'GET', `/issues/${issueId}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/issues', {}, qs, i);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          else {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const issueId = this.getNodeParameter('issueId', i);
                          body.version = await GenericFunctions_1.getVersionForUpdate.call(this, `/issues/${issueId}`);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'PATCH', `/issues/${issueId}`, body);
                      }
                  }
                  else if (resource === 'task') {
                      if (operation === 'create') {
                          const body = {
                              project: this.getNodeParameter('projectId', i),
                              subject: this.getNodeParameter('subject', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'POST', '/tasks', body);
                      }
                      else if (operation === 'delete') {
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'DELETE', `/tasks/${taskId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'GET', `/tasks/${taskId}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/tasks', {}, qs, i);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          else {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const taskId = this.getNodeParameter('taskId', i);
                          body.version = await GenericFunctions_1.getVersionForUpdate.call(this, `/tasks/${taskId}`);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'PATCH', `/tasks/${taskId}`, body);
                      }
                  }
                  else if (resource === 'userStory') {
                      if (operation === 'create') {
                          const body = {
                              project: this.getNodeParameter('projectId', i),
                              subject: this.getNodeParameter('subject', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'POST', '/userstories', body);
                      }
                      else if (operation === 'delete') {
                          const userStoryId = this.getNodeParameter('userStoryId', i);
                          const endpoint = `/userstories/${userStoryId}`;
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const userStoryId = this.getNodeParameter('userStoryId', i);
                          const endpoint = `/userstories/${userStoryId}`;
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const filters = this.getNodeParameter('filters', i);
                          if (Object.keys(filters).length) {
                              Object.assign(qs, filters);
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/userstories', {}, qs, i);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          else {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const userStoryId = this.getNodeParameter('userStoryId', i);
                          body.version = await GenericFunctions_1.getVersionForUpdate.call(this, `/userstories/${userStoryId}`);
                          responseData = await GenericFunctions_1.taigaApiRequest.call(this, 'PATCH', `/userstories/${userStoryId}`, body);
                      }
                  }
              }
              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.Taiga = Taiga;
  //# sourceMappingURL=Taiga.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TaigaApi = void 0;
  class TaigaApi {
      constructor() {
          this.name = 'taigaApi';
          this.displayName = 'Taiga API';
          this.documentationUrl = 'taiga';
          this.properties = [
              {
                  displayName: 'Username',
                  name: 'username',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Password',
                  name: 'password',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Environment',
                  name: 'environment',
                  type: 'options',
                  default: 'cloud',
                  options: [
                      {
                          name: 'Cloud',
                          value: 'cloud',
                      },
                      {
                          name: 'Self-Hosted',
                          value: 'selfHosted',
                      },
                  ],
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  placeholder: 'https://taiga.yourdomain.com',
                  displayOptions: {
                      show: {
                          environment: ['selfHosted'],
                      },
                  },
              },
          ];
      }
  }
  exports.TaigaApi = TaigaApi;
  //# sourceMappingURL=TaigaApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TaigaApi = void 0;
  class TaigaApi {
      constructor() {
          this.name = 'taigaApi';
          this.displayName = 'Taiga API';
          this.documentationUrl = 'taiga';
          this.properties = [
              {
                  displayName: 'Username',
                  name: 'username',
                  type: 'string',
                  default: '',
              },
              {
                  displayName: 'Password',
                  name: 'password',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'Environment',
                  name: 'environment',
                  type: 'options',
                  default: 'cloud',
                  options: [
                      {
                          name: 'Cloud',
                          value: 'cloud',
                      },
                      {
                          name: 'Self-Hosted',
                          value: 'selfHosted',
                      },
                  ],
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  type: 'string',
                  default: '',
                  placeholder: 'https://taiga.yourdomain.com',
                  displayOptions: {
                      show: {
                          environment: ['selfHosted'],
                      },
                  },
              },
          ];
      }
  }
  exports.TaigaApi = TaigaApi;
  //# sourceMappingURL=TaigaApi.credentials.js.map

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

  # Taiga node

  Use the Taiga node to automate work in Taiga, and integrate Taiga with other applications. n8n has built-in support for a wide range of Taiga features, including creating, updating, deleting, and getting issues. 

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

  /// note | Credentials
  Refer to [Taiga credentials](/integrations/builtin/credentials/taiga.md) for guidance on setting up authentication. 
  ///

  ## Operations

  - **Issue**
      - Create an issue
      - Delete an issue
      - Get an issue
      - Get all issues
      - Update an issue

  ## Templates and examples

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

example_workflow:
  {"name":"Taiga Example Workflow","nodes":[{"parameters":{},"id":"s16g7m7yi2kuijt79bhl0m","name":"Taiga","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.TheHive
name: TheHive
display_name: TheHive
description: Consume TheHive API
category: transform
icon: file:thehive.svg
code_hash: 4693e13130108cbcdb7b8541cea40e18dff162d3e1cdd41ddc11bb95d829a947
documentation_url: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.TheHive
documentation_title: TheHive node documentation
operations: []
api_methods: []
documentation_examples: []
templates: [{"name":"thehive","description":"Templates for thehive"}]
required_scopes: []
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
version: 1.0
extracted_at: 2025-06-09 15:18:39
updated_at: 2025-06-09 15:18:39
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.TheHive = void 0;
  const AlertDescription_1 = require("./descriptions/AlertDescription");
  const ObservableDescription_1 = require("./descriptions/ObservableDescription");
  const CaseDescription_1 = require("./descriptions/CaseDescription");
  const TaskDescription_1 = require("./descriptions/TaskDescription");
  const LogDescription_1 = require("./descriptions/LogDescription");
  const QueryFunctions_1 = require("./QueryFunctions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const set_1 = __importDefault(require("lodash/set"));
  class TheHive {
      constructor() {
          this.description = {
              displayName: 'TheHive',
              name: 'theHive',
              icon: 'file:thehive.svg',
              group: ['transform'],
              subtitle: '={{$parameter["operation"]}} : {{$parameter["resource"]}}',
              version: 1,
              description: 'Consume TheHive API',
              defaults: {
                  name: 'TheHive',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'theHiveApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      required: true,
                      options: [
                          {
                              name: 'Alert',
                              value: 'alert',
                          },
                          {
                              name: 'Case',
                              value: 'case',
                          },
                          {
                              name: 'Log',
                              value: 'log',
                          },
                          {
                              name: 'Observable',
                              value: 'observable',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                      ],
                      default: 'alert',
                  },
                  ...AlertDescription_1.alertOperations,
                  ...AlertDescription_1.alertFields,
                  ...ObservableDescription_1.observableOperations,
                  ...ObservableDescription_1.observableFields,
                  ...CaseDescription_1.caseOperations,
                  ...CaseDescription_1.caseFields,
                  ...TaskDescription_1.taskOperations,
                  ...TaskDescription_1.taskFields,
                  ...LogDescription_1.logOperations,
                  ...LogDescription_1.logFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async loadResponders() {
                      const resource = (0, GenericFunctions_1.mapResource)(this.getNodeParameter('resource'));
                      const resourceId = this.getNodeParameter('id');
                      const endpoint = `/connector/cortex/responder/${resource}/${resourceId}`;
                      const responders = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', endpoint);
                      const returnData = [];
                      for (const responder of responders) {
                          returnData.push({
                              name: responder.name,
                              value: responder.id,
                              description: responder.description,
                          });
                      }
                      return returnData;
                  },
                  async loadAnalyzers() {
                      const dataType = this.getNodeParameter('dataType');
                      const endpoint = `/connector/cortex/analyzer/type/${dataType}`;
                      const requestResult = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', endpoint);
                      const returnData = [];
                      for (const analyzer of requestResult) {
                          for (const cortexId of analyzer.cortexIds) {
                              returnData.push({
                                  name: `[${cortexId}] ${analyzer.name}`,
                                  value: `${analyzer.id}::${cortexId}`,
                                  description: analyzer.description,
                              });
                          }
                      }
                      return returnData;
                  },
                  async loadCustomFields() {
                      const credentials = await this.getCredentials('theHiveApi');
                      const version = credentials.apiVersion;
                      const endpoint = version === 'v1' ? '/customField' : '/list/custom_fields';
                      const requestResult = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', endpoint);
                      const returnData = [];
                      const customFields = version === 'v1'
                          ? requestResult
                          : Object.keys(requestResult).map((key) => requestResult[key]);
                      for (const field of customFields) {
                          returnData.push({
                              name: `${field.name}: ${field.reference}`,
                              value: field.reference,
                              description: `${field.type}: ${field.description}`,
                          });
                      }
                      return returnData;
                  },
                  async loadObservableOptions() {
                      const version = (await this.getCredentials('theHiveApi')).apiVersion;
                      const options = [
                          ...(version === 'v1'
                              ? [{ name: 'Count', value: 'count', description: 'Count observables' }]
                              : []),
                          { name: 'Create', value: 'create', description: 'Create observable' },
                          {
                              name: 'Execute Analyzer',
                              value: 'executeAnalyzer',
                              description: 'Execute an responder on selected observable',
                          },
                          {
                              name: 'Execute Responder',
                              value: 'executeResponder',
                              description: 'Execute a responder on selected observable',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get all observables of a specific case',
                          },
                          { name: 'Get', value: 'get', description: 'Get a single observable' },
                          { name: 'Search', value: 'search', description: 'Search observables' },
                          { name: 'Update', value: 'update', description: 'Update observable' },
                      ];
                      return options;
                  },
                  async loadObservableTypes() {
                      const version = (await this.getCredentials('theHiveApi')).apiVersion;
                      const endpoint = version === 'v1' ? '/observable/type?range=all' : '/list/list_artifactDataType';
                      const dataTypes = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', endpoint);
                      let returnData = [];
                      if (version === 'v1') {
                          returnData = dataTypes.map((dataType) => {
                              return {
                                  name: dataType.name,
                                  value: dataType.name,
                              };
                          });
                      }
                      else {
                          returnData = Object.keys(dataTypes).map((key) => {
                              const dataType = dataTypes[key];
                              return {
                                  name: dataType,
                                  value: dataType,
                              };
                          });
                      }
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
                  async loadTaskOptions() {
                      const credentials = await this.getCredentials('theHiveApi');
                      const version = credentials.apiVersion;
                      const options = [
                          ...(version === 'v1'
                              ? [{ name: 'Count', value: 'count', description: 'Count tasks' }]
                              : []),
                          { name: 'Create', value: 'create', description: 'Create a task' },
                          {
                              name: 'Execute Responder',
                              value: 'executeResponder',
                              description: 'Execute a responder on the specified task',
                          },
                          { name: 'Get Many', value: 'getAll', description: 'Get all asks of a specific case' },
                          { name: 'Get', value: 'get', description: 'Get a single task' },
                          { name: 'Search', value: 'search', description: 'Search tasks' },
                          { name: 'Update', value: 'update', description: 'Update a task' },
                      ];
                      return options;
                  },
                  async loadAlertOptions() {
                      const credentials = await this.getCredentials('theHiveApi');
                      const version = credentials.apiVersion;
                      const options = [
                          ...(version === 'v1'
                              ? [{ name: 'Count', value: 'count', description: 'Count alerts' }]
                              : []),
                          { name: 'Create', value: 'create', description: 'Create alert' },
                          {
                              name: 'Execute Responder',
                              value: 'executeResponder',
                              description: 'Execute a responder on the specified alert',
                          },
                          { name: 'Get', value: 'get', description: 'Get an alert' },
                          { name: 'Get Many', value: 'getAll', description: 'Get all alerts' },
                          { name: 'Mark as Read', value: 'markAsRead', description: 'Mark the alert as read' },
                          {
                              name: 'Mark as Unread',
                              value: 'markAsUnread',
                              description: 'Mark the alert as unread',
                          },
                          { name: 'Merge', value: 'merge', description: 'Merge alert into an existing case' },
                          { name: 'Promote', value: 'promote', description: 'Promote an alert into a case' },
                          { name: 'Update', value: 'update', description: 'Update alert' },
                      ];
                      return options;
                  },
                  async loadCaseOptions() {
                      const credentials = await this.getCredentials('theHiveApi');
                      const version = credentials.apiVersion;
                      const options = [
                          ...(version === 'v1'
                              ? [{ name: 'Count', value: 'count', description: 'Count a case' }]
                              : []),
                          { name: 'Create', value: 'create', description: 'Create a case' },
                          {
                              name: 'Execute Responder',
                              value: 'executeResponder',
                              description: 'Execute a responder on the specified case',
                          },
                          { name: 'Get Many', value: 'getAll', description: 'Get all cases' },
                          { name: 'Get', value: 'get', description: 'Get a single case' },
                          { name: 'Update', value: 'update', description: 'Update a case' },
                      ];
                      return options;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'alert') {
                      if (operation === 'count') {
                          const filters = this.getNodeParameter('filters', i, {});
                          const countQueryAttributs = (0, GenericFunctions_1.prepareOptional)(filters);
                          const _countSearchQuery = (0, QueryFunctions_1.And)();
                          if ('customFieldsUi' in filters) {
                              const customFields = (await GenericFunctions_1.prepareCustomFields.call(this, filters));
                              const searchQueries = (0, GenericFunctions_1.buildCustomFieldSearch)(customFields);
                              _countSearchQuery['_and'].push(...searchQueries);
                          }
                          for (const key of Object.keys(countQueryAttributs)) {
                              if (key === 'tags') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.In)(key, countQueryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'title') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, countQueryAttributs[key]));
                              }
                              else {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, countQueryAttributs[key]));
                              }
                          }
                          const body = {
                              query: [
                                  {
                                      _name: 'listAlert',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: _countSearchQuery['_and'],
                                  },
                              ],
                          };
                          body['query'].push({
                              _name: 'count',
                          });
                          qs.name = 'count-Alert';
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          responseData = { count: responseData };
                      }
                      if (operation === 'create') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const customFields = await GenericFunctions_1.prepareCustomFields.call(this, additionalFields, jsonParameters);
                          const body = {
                              title: this.getNodeParameter('title', i),
                              description: this.getNodeParameter('description', i),
                              severity: this.getNodeParameter('severity', i),
                              date: Date.parse(this.getNodeParameter('date', i)),
                              tags: (0, GenericFunctions_1.splitTags)(this.getNodeParameter('tags', i)),
                              tlp: this.getNodeParameter('tlp', i),
                              status: this.getNodeParameter('status', i),
                              type: this.getNodeParameter('type', i),
                              source: this.getNodeParameter('source', i),
                              sourceRef: this.getNodeParameter('sourceRef', i),
                              follow: this.getNodeParameter('follow', i, true),
                              ...(0, GenericFunctions_1.prepareOptional)(additionalFields),
                          };
                          if (customFields) {
                              Object.keys(customFields).forEach((key) => {
                                  (0, set_1.default)(body, key, customFields[key]);
                              });
                          }
                          const artifactUi = this.getNodeParameter('artifactUi', i);
                          if (artifactUi) {
                              const artifactValues = artifactUi.artifactValues;
                              if (artifactValues) {
                                  const artifactData = [];
                                  for (const artifactvalue of artifactValues) {
                                      const element = {};
                                      element.message = artifactvalue.message;
                                      element.tags = artifactvalue.tags.split(',');
                                      element.dataType = artifactvalue.dataType;
                                      element.data = artifactvalue.data;
                                      if (artifactvalue.dataType === 'file') {
                                          const binaryPropertyName = artifactvalue.binaryProperty;
                                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                          element.data = `${binaryData.fileName};${binaryData.mimeType};${binaryData.data}`;
                                      }
                                      artifactData.push(element);
                                  }
                                  body.artifacts = artifactData;
                              }
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/alert', body);
                      }
                      if (operation === 'executeResponder') {
                          const alertId = this.getNodeParameter('id', i);
                          const responderId = this.getNodeParameter('responder', i);
                          let body;
                          let response;
                          responseData = [];
                          body = {
                              responderId,
                              objectId: alertId,
                              objectType: 'alert',
                          };
                          response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/action', body);
                          body = {
                              query: [
                                  {
                                      _name: 'listAction',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: [
                                          {
                                              _field: 'cortexId',
                                              _value: response.cortexId,
                                          },
                                          {
                                              _field: 'objectId',
                                              _value: response.objectId,
                                          },
                                          {
                                              _field: 'startDate',
                                              _value: response.startDate,
                                          },
                                      ],
                                  },
                              ],
                          };
                          qs.name = 'log-actions';
                          do {
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          } while (response.status === 'Waiting' || response.status === 'InProgress');
                          responseData = response;
                      }
                      if (operation === 'get') {
                          const alertId = this.getNodeParameter('id', i);
                          const includeSimilar = this.getNodeParameter('options.includeSimilar', i, false);
                          if (includeSimilar) {
                              qs.similarity = true;
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', `/alert/${alertId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const filters = this.getNodeParameter('filters', i, {});
                          const queryAttributs = (0, GenericFunctions_1.prepareOptional)(filters);
                          const options = this.getNodeParameter('options', i);
                          const _searchQuery = (0, QueryFunctions_1.And)();
                          if ('customFieldsUi' in filters) {
                              const customFields = (await GenericFunctions_1.prepareCustomFields.call(this, filters));
                              const searchQueries = (0, GenericFunctions_1.buildCustomFieldSearch)(customFields);
                              _searchQuery['_and'].push(...searchQueries);
                          }
                          for (const key of Object.keys(queryAttributs)) {
                              if (key === 'tags') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.In)(key, queryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'title') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, queryAttributs[key]));
                              }
                              else {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, queryAttributs[key]));
                              }
                          }
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'listAlert',
                                      },
                                      {
                                          _name: 'filter',
                                          _and: _searchQuery['_and'],
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'alerts';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/alert/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = _searchQuery;
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'markAsRead') {
                          const alertId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/alert/${alertId}/markAsRead`);
                      }
                      if (operation === 'markAsUnread') {
                          const alertId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/alert/${alertId}/markAsUnread`);
                      }
                      if (operation === 'merge') {
                          const alertId = this.getNodeParameter('id', i);
                          const caseId = this.getNodeParameter('caseId', i);
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/alert/${alertId}/merge/${caseId}`, {});
                      }
                      if (operation === 'promote') {
                          const alertId = this.getNodeParameter('id', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {};
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/alert/${alertId}/createCase`, body);
                      }
                      if (operation === 'update') {
                          const alertId = this.getNodeParameter('id', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const customFields = await GenericFunctions_1.prepareCustomFields.call(this, updateFields, jsonParameters);
                          const artifactUi = updateFields.artifactUi;
                          delete updateFields.artifactUi;
                          const body = {
                              ...customFields,
                          };
                          Object.assign(body, updateFields);
                          if (artifactUi) {
                              const artifactValues = artifactUi.artifactValues;
                              if (artifactValues) {
                                  const artifactData = [];
                                  for (const artifactvalue of artifactValues) {
                                      const element = {};
                                      element.message = artifactvalue.message;
                                      element.tags = artifactvalue.tags.split(',');
                                      element.dataType = artifactvalue.dataType;
                                      element.data = artifactvalue.data;
                                      if (artifactvalue.dataType === 'file') {
                                          const binaryPropertyName = artifactvalue.binaryProperty;
                                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                          element.data = `${binaryData.fileName};${binaryData.mimeType};${binaryData.data}`;
                                      }
                                      artifactData.push(element);
                                  }
                                  body.artifacts = artifactData;
                              }
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'PATCH', `/alert/${alertId}`, body);
                      }
                  }
                  if (resource === 'observable') {
                      if (operation === 'count') {
                          const countQueryAttributs = (0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('filters', i, {}));
                          const _countSearchQuery = (0, QueryFunctions_1.And)();
                          for (const key of Object.keys(countQueryAttributs)) {
                              if (key === 'dataType' || key === 'tags') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.In)(key, countQueryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'keywork' || key === 'message') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, countQueryAttributs[key]));
                              }
                              else if (key === 'range') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.Between)('startDate', countQueryAttributs['range']['dateRange']['fromDate'], countQueryAttributs['range']['dateRange']['toDate']));
                              }
                              else {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, countQueryAttributs[key]));
                              }
                          }
                          const body = {
                              query: [
                                  {
                                      _name: 'listObservable',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: _countSearchQuery['_and'],
                                  },
                              ],
                          };
                          body['query'].push({
                              _name: 'count',
                          });
                          qs.name = 'count-observables';
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          responseData = { count: responseData };
                      }
                      if (operation === 'executeAnalyzer') {
                          const observableId = this.getNodeParameter('id', i);
                          const analyzers = this.getNodeParameter('analyzers', i).map((analyzer) => {
                              const parts = analyzer.split('::');
                              return {
                                  analyzerId: parts[0],
                                  cortexId: parts[1],
                              };
                          });
                          let response;
                          let body;
                          responseData = [];
                          for (const analyzer of analyzers) {
                              body = {
                                  ...analyzer,
                                  artifactId: observableId,
                              };
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/job', body, qs);
                              const jobId = response.id;
                              qs.name = 'observable-jobs';
                              do {
                                  responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'GET', `/connector/cortex/job/${jobId}`, body, qs);
                              } while (responseData.status === 'Waiting' || responseData.status === 'InProgress');
                          }
                      }
                      if (operation === 'executeResponder') {
                          const observableId = this.getNodeParameter('id', i);
                          const responderId = this.getNodeParameter('responder', i);
                          let body;
                          let response;
                          responseData = [];
                          body = {
                              responderId,
                              objectId: observableId,
                              objectType: 'case_artifact',
                          };
                          response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/action', body);
                          body = {
                              query: [
                                  {
                                      _name: 'listAction',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: [
                                          {
                                              _field: 'cortexId',
                                              _value: response.cortexId,
                                          },
                                          {
                                              _field: 'objectId',
                                              _value: response.objectId,
                                          },
                                          {
                                              _field: 'startDate',
                                              _value: response.startDate,
                                          },
                                      ],
                                  },
                              ],
                          };
                          qs.name = 'log-actions';
                          do {
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          } while (response.status === 'Waiting' || response.status === 'InProgress');
                          responseData = response;
                      }
                      if (operation === 'create') {
                          const caseId = this.getNodeParameter('caseId', i);
                          let body = {
                              dataType: this.getNodeParameter('dataType', i),
                              message: this.getNodeParameter('message', i),
                              startDate: Date.parse(this.getNodeParameter('startDate', i)),
                              tlp: this.getNodeParameter('tlp', i),
                              ioc: this.getNodeParameter('ioc', i),
                              sighted: this.getNodeParameter('sighted', i),
                              status: this.getNodeParameter('status', i),
                              ...(0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('options', i, {})),
                          };
                          let options = {};
                          if (body.dataType === 'file') {
                              const binaryPropertyName = this.getNodeParameter('binaryProperty', i);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              options = {
                                  formData: {
                                      attachment: {
                                          value: dataBuffer,
                                          options: {
                                              contentType: binaryData.mimeType,
                                              filename: binaryData.fileName,
                                          },
                                      },
                                      _json: JSON.stringify(body),
                                  },
                              };
                              body = {};
                          }
                          else {
                              body.data = this.getNodeParameter('data', i);
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/case/${caseId}/artifact`, body, qs, '', options);
                      }
                      if (operation === 'get') {
                          const observableId = this.getNodeParameter('id', i);
                          const credentials = await this.getCredentials('theHiveApi');
                          const version = credentials.apiVersion;
                          let endpoint;
                          let method;
                          let body = {};
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getObservable',
                                          idOrName: observableId,
                                      },
                                  ],
                              };
                              qs.name = `get-observable-${observableId}`;
                          }
                          else {
                              method = 'GET';
                              endpoint = `/case/artifact/${observableId}`;
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const options = this.getNodeParameter('options', i);
                          const caseId = this.getNodeParameter('caseId', i);
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getCase',
                                          idOrName: caseId,
                                      },
                                      {
                                          _name: 'observables',
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'observables';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/artifact/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = (0, QueryFunctions_1.Parent)('case', (0, QueryFunctions_1.Id)(caseId));
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'search') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const queryAttributs = (0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('filters', i, {}));
                          const _searchQuery = (0, QueryFunctions_1.And)();
                          const options = this.getNodeParameter('options', i);
                          for (const key of Object.keys(queryAttributs)) {
                              if (key === 'dataType' || key === 'tags') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.In)(key, queryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'keywork' || key === 'message') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, queryAttributs[key]));
                              }
                              else if (key === 'range') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.Between)('startDate', queryAttributs['range']['dateRange']['fromDate'], queryAttributs['range']['dateRange']['toDate']));
                              }
                              else {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, queryAttributs[key]));
                              }
                          }
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'listObservable',
                                      },
                                      {
                                          _name: 'filter',
                                          _and: _searchQuery['_and'],
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'observables';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/artifact/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = _searchQuery;
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {
                              ...(0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('updateFields', i, {})),
                          };
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'PATCH', `/case/artifact/${id}`, body, qs);
                          responseData = { success: true };
                      }
                  }
                  if (resource === 'case') {
                      if (operation === 'count') {
                          const filters = this.getNodeParameter('filters', i, {});
                          const countQueryAttributs = (0, GenericFunctions_1.prepareOptional)(filters);
                          const _countSearchQuery = (0, QueryFunctions_1.And)();
                          if ('customFieldsUi' in filters) {
                              const customFields = (await GenericFunctions_1.prepareCustomFields.call(this, filters));
                              const searchQueries = (0, GenericFunctions_1.buildCustomFieldSearch)(customFields);
                              _countSearchQuery['_and'].push(...searchQueries);
                          }
                          for (const key of Object.keys(countQueryAttributs)) {
                              if (key === 'tags') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.In)(key, countQueryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'summary' || key === 'title') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, countQueryAttributs[key]));
                              }
                              else {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, countQueryAttributs[key]));
                              }
                          }
                          const body = {
                              query: [
                                  {
                                      _name: 'listCase',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: _countSearchQuery['_and'],
                                  },
                              ],
                          };
                          body['query'].push({
                              _name: 'count',
                          });
                          qs.name = 'count-cases';
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          responseData = { count: responseData };
                      }
                      if (operation === 'executeResponder') {
                          const caseId = this.getNodeParameter('id', i);
                          const responderId = this.getNodeParameter('responder', i);
                          let body;
                          let response;
                          responseData = [];
                          body = {
                              responderId,
                              objectId: caseId,
                              objectType: 'case',
                          };
                          response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/action', body);
                          body = {
                              query: [
                                  {
                                      _name: 'listAction',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: [
                                          {
                                              _field: 'cortexId',
                                              _value: response.cortexId,
                                          },
                                          {
                                              _field: 'objectId',
                                              _value: response.objectId,
                                          },
                                          {
                                              _field: 'startDate',
                                              _value: response.startDate,
                                          },
                                      ],
                                  },
                              ],
                          };
                          qs.name = 'log-actions';
                          do {
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          } while (response.status === 'Waiting' || response.status === 'InProgress');
                          responseData = response;
                      }
                      if (operation === 'create') {
                          const options = this.getNodeParameter('options', i, {});
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const customFields = await GenericFunctions_1.prepareCustomFields.call(this, options, jsonParameters);
                          const body = {
                              title: this.getNodeParameter('title', i),
                              description: this.getNodeParameter('description', i),
                              severity: this.getNodeParameter('severity', i),
                              startDate: Date.parse(this.getNodeParameter('startDate', i)),
                              owner: this.getNodeParameter('owner', i),
                              flag: this.getNodeParameter('flag', i),
                              tlp: this.getNodeParameter('tlp', i),
                              tags: (0, GenericFunctions_1.splitTags)(this.getNodeParameter('tags', i)),
                              ...(0, GenericFunctions_1.prepareOptional)(options),
                          };
                          if (customFields) {
                              Object.keys(customFields).forEach((key) => {
                                  (0, set_1.default)(body, key, customFields[key]);
                              });
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/case', body);
                      }
                      if (operation === 'get') {
                          const caseId = this.getNodeParameter('id', i);
                          const credentials = await this.getCredentials('theHiveApi');
                          const version = credentials.apiVersion;
                          let endpoint;
                          let method;
                          let body = {};
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getCase',
                                          idOrName: caseId,
                                      },
                                  ],
                              };
                              qs.name = `get-case-${caseId}`;
                          }
                          else {
                              method = 'GET';
                              endpoint = `/case/${caseId}`;
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const filters = this.getNodeParameter('filters', i, {});
                          const queryAttributs = (0, GenericFunctions_1.prepareOptional)(filters);
                          const _searchQuery = (0, QueryFunctions_1.And)();
                          const options = this.getNodeParameter('options', i);
                          if ('customFieldsUi' in filters) {
                              const customFields = (await GenericFunctions_1.prepareCustomFields.call(this, filters));
                              const searchQueries = (0, GenericFunctions_1.buildCustomFieldSearch)(customFields);
                              _searchQuery['_and'].push(...searchQueries);
                          }
                          for (const key of Object.keys(queryAttributs)) {
                              if (key === 'tags') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.In)(key, queryAttributs[key]));
                              }
                              else if (key === 'description' || key === 'summary' || key === 'title') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, queryAttributs[key]));
                              }
                              else {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, queryAttributs[key]));
                              }
                          }
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'listCase',
                                      },
                                      {
                                          _name: 'filter',
                                          _and: _searchQuery['_and'],
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'cases';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = _searchQuery;
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const updateFields = this.getNodeParameter('updateFields', i, {});
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const customFields = await GenericFunctions_1.prepareCustomFields.call(this, updateFields, jsonParameters);
                          const body = {
                              ...customFields,
                              ...(0, GenericFunctions_1.prepareOptional)(updateFields),
                          };
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'PATCH', `/case/${id}`, body);
                      }
                  }
                  if (resource === 'task') {
                      if (operation === 'count') {
                          const countQueryAttributs = (0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('filters', i, {}));
                          const _countSearchQuery = (0, QueryFunctions_1.And)();
                          for (const key of Object.keys(countQueryAttributs)) {
                              if (key === 'title' || key === 'description') {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, countQueryAttributs[key]));
                              }
                              else {
                                  _countSearchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, countQueryAttributs[key]));
                              }
                          }
                          const body = {
                              query: [
                                  {
                                      _name: 'listTask',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: _countSearchQuery['_and'],
                                  },
                              ],
                          };
                          body['query'].push({
                              _name: 'count',
                          });
                          qs.name = 'count-tasks';
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          responseData = { count: responseData };
                      }
                      if (operation === 'create') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const body = {
                              title: this.getNodeParameter('title', i),
                              status: this.getNodeParameter('status', i),
                              flag: this.getNodeParameter('flag', i),
                              ...(0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('options', i, {})),
                          };
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/case/${caseId}/task`, body);
                      }
                      if (operation === 'executeResponder') {
                          const taskId = this.getNodeParameter('id', i);
                          const responderId = this.getNodeParameter('responder', i);
                          let body;
                          let response;
                          responseData = [];
                          body = {
                              responderId,
                              objectId: taskId,
                              objectType: 'case_task',
                          };
                          response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/action', body);
                          body = {
                              query: [
                                  {
                                      _name: 'listAction',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: [
                                          {
                                              _field: 'cortexId',
                                              _value: response.cortexId,
                                          },
                                          {
                                              _field: 'objectId',
                                              _value: response.objectId,
                                          },
                                          {
                                              _field: 'startDate',
                                              _value: response.startDate,
                                          },
                                      ],
                                  },
                              ],
                          };
                          qs.name = 'task-actions';
                          do {
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          } while (response.status === 'Waiting' || response.status === 'InProgress');
                          responseData = response;
                      }
                      if (operation === 'get') {
                          const taskId = this.getNodeParameter('id', i);
                          const credentials = await this.getCredentials('theHiveApi');
                          const version = credentials.apiVersion;
                          let endpoint;
                          let method;
                          let body = {};
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getTask',
                                          idOrName: taskId,
                                      },
                                  ],
                              };
                              qs.name = `get-task-${taskId}`;
                          }
                          else {
                              method = 'GET';
                              endpoint = `/case/task/${taskId}`;
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const caseId = this.getNodeParameter('caseId', i);
                          const options = this.getNodeParameter('options', i);
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getCase',
                                          idOrName: caseId,
                                      },
                                      {
                                          _name: 'tasks',
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'case-tasks';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/task/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = (0, QueryFunctions_1.And)((0, QueryFunctions_1.Parent)('case', (0, QueryFunctions_1.Id)(caseId)));
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'search') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const queryAttributs = (0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('filters', i, {}));
                          const _searchQuery = (0, QueryFunctions_1.And)();
                          const options = this.getNodeParameter('options', i);
                          for (const key of Object.keys(queryAttributs)) {
                              if (key === 'title' || key === 'description') {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.ContainsString)(key, queryAttributs[key]));
                              }
                              else {
                                  _searchQuery['_and'].push((0, QueryFunctions_1.Eq)(key, queryAttributs[key]));
                              }
                          }
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'listTask',
                                      },
                                      {
                                          _name: 'filter',
                                          _and: _searchQuery['_and'],
                                      },
                                  ],
                              };
                              (0, GenericFunctions_1.prepareSortQuery)(options.sort, body);
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'tasks';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/task/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = _searchQuery;
                              Object.assign(qs, (0, GenericFunctions_1.prepareOptional)(options));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {
                              ...(0, GenericFunctions_1.prepareOptional)(this.getNodeParameter('updateFields', i, {})),
                          };
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'PATCH', `/case/task/${id}`, body);
                      }
                  }
                  if (resource === 'log') {
                      if (operation === 'create') {
                          const taskId = this.getNodeParameter('taskId', i);
                          let body = {
                              message: this.getNodeParameter('message', i),
                              startDate: Date.parse(this.getNodeParameter('startDate', i)),
                              status: this.getNodeParameter('status', i),
                          };
                          const optionals = this.getNodeParameter('options', i);
                          let options = {};
                          if (optionals.attachementUi) {
                              const attachmentValues = optionals.attachementUi
                                  .attachmentValues;
                              if (attachmentValues) {
                                  const binaryPropertyName = attachmentValues.binaryProperty;
                                  const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                                  const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                                  options = {
                                      formData: {
                                          attachment: {
                                              value: dataBuffer,
                                              options: {
                                                  contentType: binaryData.mimeType,
                                                  filename: binaryData.fileName,
                                              },
                                          },
                                          _json: JSON.stringify(body),
                                      },
                                  };
                                  body = {};
                              }
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', `/case/task/${taskId}/log`, body, qs, '', options);
                      }
                      if (operation === 'executeResponder') {
                          const logId = this.getNodeParameter('id', i);
                          const responderId = this.getNodeParameter('responder', i);
                          let body;
                          let response;
                          responseData = [];
                          body = {
                              responderId,
                              objectId: logId,
                              objectType: 'case_task_log',
                          };
                          response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/connector/cortex/action', body);
                          body = {
                              query: [
                                  {
                                      _name: 'listAction',
                                  },
                                  {
                                      _name: 'filter',
                                      _and: [
                                          {
                                              _field: 'cortexId',
                                              _value: response.cortexId,
                                          },
                                          {
                                              _field: 'objectId',
                                              _value: response.objectId,
                                          },
                                          {
                                              _field: 'startDate',
                                              _value: response.startDate,
                                          },
                                      ],
                                  },
                              ],
                          };
                          qs.name = 'log-actions';
                          do {
                              response = await GenericFunctions_1.theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
                          } while (response.status === 'Waiting' || response.status === 'InProgress');
                          responseData = response;
                      }
                      if (operation === 'get') {
                          const logId = this.getNodeParameter('id', i);
                          const credentials = await this.getCredentials('theHiveApi');
                          const version = credentials.apiVersion;
                          let endpoint;
                          let method;
                          let body = {};
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getLog',
                                          idOrName: logId,
                                      },
                                  ],
                              };
                              qs.name = `get-log-${logId}`;
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/task/log/_search';
                              body.query = { _id: logId };
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                      if (operation === 'getAll') {
                          const credentials = await this.getCredentials('theHiveApi');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const version = credentials.apiVersion;
                          const taskId = this.getNodeParameter('taskId', i);
                          let endpoint;
                          let method;
                          let body = {};
                          let limit = undefined;
                          if (!returnAll) {
                              limit = this.getNodeParameter('limit', i);
                          }
                          if (version === 'v1') {
                              endpoint = '/v1/query';
                              method = 'POST';
                              body = {
                                  query: [
                                      {
                                          _name: 'getTask',
                                          idOrName: taskId,
                                      },
                                      {
                                          _name: 'logs',
                                      },
                                  ],
                              };
                              if (limit !== undefined) {
                                  (0, GenericFunctions_1.prepareRangeQuery)(`0-${limit}`, body);
                              }
                              qs.name = 'case-task-logs';
                          }
                          else {
                              method = 'POST';
                              endpoint = '/case/task/log/_search';
                              if (limit !== undefined) {
                                  qs.range = `0-${limit}`;
                              }
                              body.query = (0, QueryFunctions_1.And)((0, QueryFunctions_1.Parent)('task', (0, QueryFunctions_1.Id)(taskId)));
                          }
                          responseData = await GenericFunctions_1.theHiveApiRequest.call(this, method, endpoint, body, qs);
                      }
                  }
                  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.TheHive = TheHive;
  //# sourceMappingURL=TheHive.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TheHiveApi = void 0;
  class TheHiveApi {
      constructor() {
          this.name = 'theHiveApi';
          this.displayName = 'The Hive API';
          this.documentationUrl = 'theHive';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'ApiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  default: '',
                  type: 'string',
                  description: 'The URL of TheHive instance',
                  placeholder: 'https://localhost:9000',
              },
              {
                  displayName: 'API Version',
                  name: 'apiVersion',
                  default: '',
                  type: 'options',
                  description: 'The version of api to be used',
                  options: [
                      {
                          name: 'TheHive 4+ (api v1)',
                          value: 'v1',
                          description: 'API version with TheHive 4 support, also works with TheHive 5 but not all features are supported',
                      },
                      {
                          name: 'TheHive 3 (api v0)',
                          value: '',
                          description: 'API version with TheHive 3 support',
                      },
                  ],
              },
              {
                  displayName: 'Ignore SSL Issues',
                  name: 'allowUnauthorizedCerts',
                  type: 'boolean',
                  description: 'Whether to connect even if SSL certificate validation is not possible',
                  default: false,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials?.ApiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials?.url}}',
                  url: '/api/case',
              },
          };
      }
  }
  exports.TheHiveApi = TheHiveApi;
  //# sourceMappingURL=TheHiveApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TheHiveApi = void 0;
  class TheHiveApi {
      constructor() {
          this.name = 'theHiveApi';
          this.displayName = 'The Hive API';
          this.documentationUrl = 'theHive';
          this.properties = [
              {
                  displayName: 'API Key',
                  name: 'ApiKey',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
              },
              {
                  displayName: 'URL',
                  name: 'url',
                  default: '',
                  type: 'string',
                  description: 'The URL of TheHive instance',
                  placeholder: 'https://localhost:9000',
              },
              {
                  displayName: 'API Version',
                  name: 'apiVersion',
                  default: '',
                  type: 'options',
                  description: 'The version of api to be used',
                  options: [
                      {
                          name: 'TheHive 4+ (api v1)',
                          value: 'v1',
                          description: 'API version with TheHive 4 support, also works with TheHive 5 but not all features are supported',
                      },
                      {
                          name: 'TheHive 3 (api v0)',
                          value: '',
                          description: 'API version with TheHive 3 support',
                      },
                  ],
              },
              {
                  displayName: 'Ignore SSL Issues',
                  name: 'allowUnauthorizedCerts',
                  type: 'boolean',
                  description: 'Whether to connect even if SSL certificate validation is not possible',
                  default: false,
              },
          ];
          this.authenticate = {
              type: 'generic',
              properties: {
                  headers: {
                      Authorization: '=Bearer {{$credentials?.ApiKey}}',
                  },
              },
          };
          this.test = {
              request: {
                  baseURL: '={{$credentials?.url}}',
                  url: '/api/case',
              },
          };
      }
  }
  exports.TheHiveApi = TheHiveApi;
  //# sourceMappingURL=TheHiveApi.credentials.js.map

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

  # TheHive node

  Use the TheHive node to automate work in TheHive, and integrate TheHive with other applications. n8n has built-in support for a wide range of TheHive features, including creating alerts, counting tasks logs, cases, and observables. 

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

  /// note | TheHive and TheHive 5
  n8n provides two nodes for TheHive. Use this node (TheHive) if you want to use TheHive's version 3 or 4 API. If you want to use version 5, use [TheHive 5](/integrations/builtin/app-nodes/n8n-nodes-base.thehive5.md).
  ///
  /// note | Credentials
  Refer to [TheHive credentials](/integrations/builtin/credentials/thehive.md) for guidance on setting up authentication. 
  ///

  ## Operations

  The available operations depend on your API version. To see the operations list, create your credentials, including selecting your API version. Then return to the node, select the resource you want to use, and n8n displays the available operations for your API version. 

  * Alert
  * Case
  * Log
  * Observable
  * Task

  ## Templates and examples

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

  --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md"

  ## Related resources

  n8n provides a trigger node for TheHive. You can find the trigger node docs [here](/integrations/builtin/trigger-nodes/n8n-nodes-base.thehivetrigger.md).

  Refer to TheHive's documentation for more information about the service:

  * [Version 3](https://docs.thehive-project.org/thehive/legacy/thehive3/api/){:target=_blank .external-link}
  * [Version 4](https://docs.thehive-project.org/cortex/api/api-guide/){:target=_blank .external-link}

related_resources:
  [{"title":"here","url":"/integrations/builtin/trigger-nodes/n8n-nodes-base.thehivetrigger.md","type":"documentation"},{"title":"Version 3","url":"https://docs.thehive-project.org/thehive/legacy/thehive3/api/","type":"external"},{"title":"Version 4","url":"https://docs.thehive-project.org/cortex/api/api-guide/","type":"external"}]

example_workflow:
  {"name":"TheHive Example Workflow","nodes":[{"parameters":{},"id":"nx4vad1fqvn2y2jixy1pv1","name":"TheHive","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


node_type: n8n-nodes-base.Telegram
name: Telegram
display_name: Telegram
description: Sends data to Telegram
category: output
icon: file:telegram.svg
code_hash: f3c5a39bf643219deb3a2978b9bea87fc66b9bd893b076fa8339233a39fd38c7
example_parameters: {}
properties_schema: []
package_name: n8n-nodes-base
extracted_at: 2025-06-09 15:18:40
updated_at: 2025-06-09 15:18:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Telegram = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Telegram {
      constructor() {
          this.description = {
              displayName: 'Telegram',
              name: 'telegram',
              icon: 'file:telegram.svg',
              group: ['output'],
              version: [1, 1.1],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Sends data to Telegram',
              defaults: {
                  name: 'Telegram',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'telegramApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Chat',
                              value: 'chat',
                          },
                          {
                              name: 'Callback',
                              value: 'callback',
                          },
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Message',
                              value: 'message',
                          },
                      ],
                      default: 'message',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['chat'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get up to date information about a chat',
                              action: 'Get a chat',
                          },
                          {
                              name: 'Get Administrators',
                              value: 'administrators',
                              description: 'Get the Administrators of a chat',
                              action: 'Get all administrators in a chat',
                          },
                          {
                              name: 'Get Member',
                              value: 'member',
                              description: 'Get the member of a chat',
                              action: 'Get a member in a chat',
                          },
                          {
                              name: 'Leave',
                              value: 'leave',
                              description: 'Leave a group, supergroup or channel',
                              action: 'Leave a chat',
                          },
                          {
                              name: 'Set Description',
                              value: 'setDescription',
                              description: 'Set the description of a chat',
                              action: 'Set description on a chat',
                          },
                          {
                              name: 'Set Title',
                              value: 'setTitle',
                              description: 'Set the title of a chat',
                              action: 'Set a title on a chat',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['callback'],
                          },
                      },
                      options: [
                          {
                              name: 'Answer Query',
                              value: 'answerQuery',
                              description: 'Send answer to callback query sent from inline keyboard',
                              action: 'Answer Query a callback',
                          },
                          {
                              name: 'Answer Inline Query',
                              value: 'answerInlineQuery',
                              description: 'Send answer to callback query sent from inline bot',
                              action: 'Answer an inline query callback',
                          },
                      ],
                      default: 'answerQuery',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a file',
                              action: 'Get a file',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['message'],
                          },
                      },
                      options: [
                          {
                              name: 'Delete Chat Message',
                              value: 'deleteMessage',
                              description: 'Delete a chat message',
                              action: 'Delete a chat message',
                          },
                          {
                              name: 'Edit Message Text',
                              value: 'editMessageText',
                              description: 'Edit a text message',
                              action: 'Edit a test message',
                          },
                          {
                              name: 'Pin Chat Message',
                              value: 'pinChatMessage',
                              description: 'Pin a chat message',
                              action: 'Pin a chat message',
                          },
                          {
                              name: 'Send Animation',
                              value: 'sendAnimation',
                              description: 'Send an animated file',
                              action: 'Send an animated file',
                          },
                          {
                              name: 'Send Audio',
                              value: 'sendAudio',
                              description: 'Send a audio file',
                              action: 'Send an audio file',
                          },
                          {
                              name: 'Send Chat Action',
                              value: 'sendChatAction',
                              description: 'Send a chat action',
                              action: 'Send a chat action',
                          },
                          {
                              name: 'Send Document',
                              value: 'sendDocument',
                              description: 'Send a document',
                              action: 'Send a document',
                          },
                          {
                              name: 'Send Location',
                              value: 'sendLocation',
                              description: 'Send a location',
                              action: 'Send a location',
                          },
                          {
                              name: 'Send Media Group',
                              value: 'sendMediaGroup',
                              description: 'Send group of photos or videos to album',
                              action: 'Send a media group message',
                          },
                          {
                              name: 'Send Message',
                              value: 'sendMessage',
                              description: 'Send a text message',
                              action: 'Send a text message',
                          },
                          {
                              name: 'Send Photo',
                              value: 'sendPhoto',
                              description: 'Send a photo',
                              action: 'Send a photo message',
                          },
                          {
                              name: 'Send Sticker',
                              value: 'sendSticker',
                              description: 'Send a sticker',
                              action: 'Send a sticker',
                          },
                          {
                              name: 'Send Video',
                              value: 'sendVideo',
                              description: 'Send a video',
                              action: 'Send a video',
                          },
                          {
                              name: 'Unpin Chat Message',
                              value: 'unpinChatMessage',
                              description: 'Unpin a chat message',
                              action: 'Unpin a chat message',
                          },
                      ],
                      default: 'sendMessage',
                  },
                  {
                      displayName: 'Chat ID',
                      name: 'chatId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: [
                                  'administrators',
                                  'deleteMessage',
                                  'get',
                                  'leave',
                                  'member',
                                  'pinChatMessage',
                                  'setDescription',
                                  'setTitle',
                                  'sendAnimation',
                                  'sendAudio',
                                  'sendChatAction',
                                  'sendDocument',
                                  'sendLocation',
                                  'sendMessage',
                                  'sendMediaGroup',
                                  'sendPhoto',
                                  'sendSticker',
                                  'sendVideo',
                                  'unpinChatMessage',
                              ],
                              resource: ['chat', 'message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier for the target chat or username of the target channel (in the format @channelusername)',
                  },
                  {
                      displayName: 'Message ID',
                      name: 'messageId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['deleteMessage'],
                              resource: ['message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier of the message to delete',
                  },
                  {
                      displayName: 'Message ID',
                      name: 'messageId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['pinChatMessage', 'unpinChatMessage'],
                              resource: ['message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier of the message to pin or unpin',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['pinChatMessage'],
                              resource: ['message'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Disable Notification',
                              name: 'disable_notification',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to send a notification to all chat members about the new pinned message',
                          },
                      ],
                  },
                  {
                      displayName: 'User ID',
                      name: 'userId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['member'],
                              resource: ['chat'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier of the target user',
                  },
                  {
                      displayName: 'Description',
                      name: 'description',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['setDescription'],
                              resource: ['chat'],
                          },
                      },
                      required: true,
                      description: 'New chat description, 0-255 characters',
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['setTitle'],
                              resource: ['chat'],
                          },
                      },
                      required: true,
                      description: 'New chat title, 1-255 characters',
                  },
                  {
                      displayName: 'Query ID',
                      name: 'queryId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['answerQuery'],
                              resource: ['callback'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier for the query to be answered',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['answerQuery'],
                              resource: ['callback'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Cache Time',
                              name: 'cache_time',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              default: 0,
                              description: 'The maximum amount of time in seconds that the result of the callback query may be cached client-side',
                          },
                          {
                              displayName: 'Show Alert',
                              name: 'show_alert',
                              type: 'boolean',
                              default: false,
                              description: 'Whether an alert will be shown by the client instead of a notification at the top of the chat screen',
                          },
                          {
                              displayName: 'Text',
                              name: 'text',
                              type: 'string',
                              default: '',
                              description: 'Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.',
                          },
                          {
                              displayName: 'URL',
                              name: 'url',
                              type: 'string',
                              default: '',
                              description: "URL that will be opened by the user's client",
                          },
                      ],
                  },
                  {
                      displayName: 'Query ID',
                      name: 'queryId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['answerInlineQuery'],
                              resource: ['callback'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier for the answered query',
                  },
                  {
                      displayName: 'Results',
                      name: 'results',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['answerInlineQuery'],
                              resource: ['callback'],
                          },
                      },
                      required: true,
                      description: 'A JSON-serialized array of results for the inline query',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['answerInlineQuery'],
                              resource: ['callback'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Cache Time',
                              name: 'cache_time',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              default: 0,
                              description: 'The maximum amount of time in seconds that the result of the callback query may be cached client-side',
                          },
                          {
                              displayName: 'Show Alert',
                              name: 'show_alert',
                              type: 'boolean',
                              default: false,
                              description: 'Whether an alert will be shown by the client instead of a notification at the top of the chat screen',
                          },
                          {
                              displayName: 'Text',
                              name: 'text',
                              type: 'string',
                              default: '',
                              description: 'Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.',
                          },
                          {
                              displayName: 'URL',
                              name: 'url',
                              type: 'string',
                              default: '',
                              description: "URL that will be opened by the user's client",
                          },
                      ],
                  },
                  {
                      displayName: 'File ID',
                      name: 'fileId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      required: true,
                      description: 'The ID of the file',
                  },
                  {
                      displayName: 'Download',
                      name: 'download',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['file'],
                          },
                      },
                      default: true,
                      description: 'Whether to download the file',
                  },
                  {
                      displayName: 'Message Type',
                      name: 'messageType',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['editMessageText'],
                              resource: ['message'],
                          },
                      },
                      options: [
                          {
                              name: 'Inline Message',
                              value: 'inlineMessage',
                          },
                          {
                              name: 'Message',
                              value: 'message',
                          },
                      ],
                      default: 'message',
                      description: 'The type of the message to edit',
                  },
                  {
                      displayName: 'Chat ID',
                      name: 'chatId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              messageType: ['message'],
                              operation: ['editMessageText'],
                              resource: ['message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier for the target chat or username of the target channel (in the format @channelusername). To find your chat ID ask @get_id_bot.',
                  },
                  {
                      displayName: 'Binary Data',
                      name: 'binaryData',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: [
                                  'sendAnimation',
                                  'sendAudio',
                                  'sendDocument',
                                  'sendPhoto',
                                  'sendVideo',
                                  'sendSticker',
                              ],
                              resource: ['message'],
                          },
                      },
                      description: 'Whether the data to upload should be taken from binary field',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: [
                                  'sendAnimation',
                                  'sendAudio',
                                  'sendDocument',
                                  'sendPhoto',
                                  'sendVideo',
                                  'sendSticker',
                              ],
                              resource: ['message'],
                              binaryData: [true],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property that contains the data to upload',
                  },
                  {
                      displayName: 'Message ID',
                      name: 'messageId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              messageType: ['message'],
                              operation: ['editMessageText'],
                              resource: ['message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier of the message to edit',
                  },
                  {
                      displayName: 'Inline Message ID',
                      name: 'inlineMessageId',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              messageType: ['inlineMessage'],
                              operation: ['editMessageText'],
                              resource: ['message'],
                          },
                      },
                      required: true,
                      description: 'Unique identifier of the inline message to edit',
                  },
                  {
                      displayName: 'Reply Markup',
                      name: 'replyMarkup',
                      displayOptions: {
                          show: {
                              operation: ['editMessageText'],
                              resource: ['message'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'None',
                              value: 'none',
                          },
                          {
                              name: 'Inline Keyboard',
                              value: 'inlineKeyboard',
                          },
                      ],
                      default: 'none',
                      description: 'Additional interface options',
                  },
                  {
                      displayName: 'Animation',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendAnimation'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Animation to send. Pass a file_id to send an animation that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get an animation from the Internet.',
                  },
                  {
                      displayName: 'Audio',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendAudio'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Audio file to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
                  },
                  {
                      displayName: 'Action',
                      name: 'action',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['sendChatAction'],
                              resource: ['message'],
                          },
                      },
                      options: [
                          {
                              name: 'Find Location',
                              value: 'find_location',
                              action: 'Find location',
                          },
                          {
                              name: 'Record Audio',
                              value: 'record_audio',
                              action: 'Record audio',
                          },
                          {
                              name: 'Record Video',
                              value: 'record_video',
                              action: 'Record video',
                          },
                          {
                              name: 'Record Video Note',
                              value: 'record_video_note',
                              action: 'Record video note',
                          },
                          {
                              name: 'Typing',
                              value: 'typing',
                              action: 'Typing a message',
                          },
                          {
                              name: 'Upload Audio',
                              value: 'upload_audio',
                              action: 'Upload audio',
                          },
                          {
                              name: 'Upload Document',
                              value: 'upload_document',
                              action: 'Upload document',
                          },
                          {
                              name: 'Upload Photo',
                              value: 'upload_photo',
                              action: 'Upload photo',
                          },
                          {
                              name: 'Upload Video',
                              value: 'upload_video',
                              action: 'Upload video',
                          },
                          {
                              name: 'Upload Video Note',
                              value: 'upload_video_note',
                              action: 'Upload video note',
                          },
                      ],
                      default: 'typing',
                      description: 'Type of action to broadcast. Choose one, depending on what the user is about to receive. The status is set for 5 seconds or less (when a message arrives from your bot).',
                  },
                  {
                      displayName: 'Document',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendDocument'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Document to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
                  },
                  {
                      displayName: 'Latitude',
                      name: 'latitude',
                      type: 'number',
                      default: 0.0,
                      typeOptions: {
                          numberPrecision: 10,
                          minValue: -90,
                          maxValue: 90,
                      },
                      displayOptions: {
                          show: {
                              operation: ['sendLocation'],
                              resource: ['message'],
                          },
                      },
                      description: 'Location latitude',
                  },
                  {
                      displayName: 'Longitude',
                      name: 'longitude',
                      type: 'number',
                      typeOptions: {
                          numberPrecision: 10,
                          minValue: -180,
                          maxValue: 180,
                      },
                      default: 0.0,
                      displayOptions: {
                          show: {
                              operation: ['sendLocation'],
                              resource: ['message'],
                          },
                      },
                      description: 'Location longitude',
                  },
                  {
                      displayName: 'Media',
                      name: 'media',
                      type: 'fixedCollection',
                      displayOptions: {
                          show: {
                              operation: ['sendMediaGroup'],
                              resource: ['message'],
                          },
                      },
                      description: 'The media to add',
                      placeholder: 'Add Media',
                      typeOptions: {
                          multipleValues: true,
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Media',
                              name: 'media',
                              values: [
                                  {
                                      displayName: 'Type',
                                      name: 'type',
                                      type: 'options',
                                      options: [
                                          {
                                              name: 'Photo',
                                              value: 'photo',
                                          },
                                          {
                                              name: 'Video',
                                              value: 'video',
                                          },
                                      ],
                                      default: 'photo',
                                      description: 'The type of the media to add',
                                  },
                                  {
                                      displayName: 'Media File',
                                      name: 'media',
                                      type: 'string',
                                      default: '',
                                      description: 'Media to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass an HTTP URL for Telegram to get a file from the Internet.',
                                  },
                                  {
                                      displayName: 'Additional Fields',
                                      name: 'additionalFields',
                                      type: 'collection',
                                      placeholder: 'Add Field',
                                      default: {},
                                      options: [
                                          {
                                              displayName: 'Caption',
                                              name: 'caption',
                                              type: 'string',
                                              default: '',
                                              description: 'Caption text to set, 0-1024 characters',
                                          },
                                          {
                                              displayName: 'Parse Mode',
                                              name: 'parse_mode',
                                              type: 'options',
                                              options: [
                                                  {
                                                      name: 'Markdown',
                                                      value: 'Markdown',
                                                  },
                                                  {
                                                      name: 'HTML',
                                                      value: 'HTML',
                                                  },
                                              ],
                                              default: 'HTML',
                                              description: 'How to parse the text',
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Text',
                      name: 'text',
                      type: 'string',
                      required: true,
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['editMessageText', 'sendMessage'],
                              resource: ['message'],
                          },
                      },
                      description: 'Text of the message to be sent',
                  },
                  {
                      displayName: 'Photo',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendPhoto'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Photo to send. Pass a file_id to send a photo that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a photo from the Internet.',
                  },
                  {
                      displayName: 'Sticker',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendSticker'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Sticker to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a .webp file from the Internet.',
                  },
                  {
                      displayName: 'Video',
                      name: 'file',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['sendVideo'],
                              resource: ['message'],
                              binaryData: [false],
                          },
                      },
                      description: 'Video file to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
                  },
                  {
                      displayName: 'Reply Markup',
                      name: 'replyMarkup',
                      displayOptions: {
                          show: {
                              operation: [
                                  'sendAnimation',
                                  'sendDocument',
                                  'sendMessage',
                                  'sendPhoto',
                                  'sendSticker',
                                  'sendVideo',
                                  'sendAudio',
                                  'sendLocation',
                              ],
                              resource: ['message'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'Force Reply',
                              value: 'forceReply',
                          },
                          {
                              name: 'Inline Keyboard',
                              value: 'inlineKeyboard',
                          },
                          {
                              name: 'None',
                              value: 'none',
                          },
                          {
                              name: 'Reply Keyboard',
                              value: 'replyKeyboard',
                          },
                          {
                              name: 'Reply Keyboard Remove',
                              value: 'replyKeyboardRemove',
                          },
                      ],
                      default: 'none',
                      description: 'Additional interface options',
                  },
                  {
                      displayName: 'Force Reply',
                      name: 'forceReply',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              replyMarkup: ['forceReply'],
                              resource: ['message'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Force Reply',
                              name: 'force_reply',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to show reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply',
                          },
                          {
                              displayName: 'Selective',
                              name: 'selective',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to force reply from specific users only',
                          },
                      ],
                  },
                  {
                      displayName: 'Inline Keyboard',
                      name: 'inlineKeyboard',
                      placeholder: 'Add Keyboard Row',
                      description: 'Adds an inline keyboard that appears right next to the message it belongs to',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              replyMarkup: ['inlineKeyboard'],
                              resource: ['message'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Rows',
                              name: 'rows',
                              values: [
                                  {
                                      displayName: 'Row',
                                      name: 'row',
                                      type: 'fixedCollection',
                                      description: 'The value to set',
                                      placeholder: 'Add Button',
                                      typeOptions: {
                                          multipleValues: true,
                                      },
                                      default: {},
                                      options: [
                                          {
                                              displayName: 'Buttons',
                                              name: 'buttons',
                                              values: [
                                                  {
                                                      displayName: 'Text',
                                                      name: 'text',
                                                      type: 'string',
                                                      default: '',
                                                      description: 'Label text on the button',
                                                  },
                                                  {
                                                      displayName: 'Additional Fields',
                                                      name: 'additionalFields',
                                                      type: 'collection',
                                                      placeholder: 'Add Field',
                                                      default: {},
                                                      options: [
                                                          {
                                                              displayName: 'Callback Data',
                                                              name: 'callback_data',
                                                              type: 'string',
                                                              default: '',
                                                              description: 'Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes',
                                                          },
                                                          {
                                                              displayName: 'Pay',
                                                              name: 'pay',
                                                              type: 'boolean',
                                                              default: false,
                                                              description: 'Whether to send a Pay button',
                                                          },
                                                          {
                                                              displayName: 'Switch Inline Query Current Chat',
                                                              name: 'switch_inline_query_current_chat',
                                                              type: 'string',
                                                              default: '',
                                                              description: "If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field.Can be empty, in which case only the bot’s username will be inserted",
                                                          },
                                                          {
                                                              displayName: 'Switch Inline Query',
                                                              name: 'switch_inline_query',
                                                              type: 'string',
                                                              default: '',
                                                              description: 'If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.',
                                                          },
                                                          {
                                                              displayName: 'URL',
                                                              name: 'url',
                                                              type: 'string',
                                                              default: '',
                                                              description: 'HTTP or tg:// URL to be opened when button is pressed',
                                                          },
                                                      ],
                                                  },
                                              ],
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Reply Keyboard',
                      name: 'replyKeyboard',
                      placeholder: 'Add Reply Keyboard Row',
                      description: 'Adds a custom keyboard with reply options',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              replyMarkup: ['replyKeyboard'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Rows',
                              name: 'rows',
                              values: [
                                  {
                                      displayName: 'Row',
                                      name: 'row',
                                      type: 'fixedCollection',
                                      description: 'The value to set',
                                      placeholder: 'Add Button',
                                      typeOptions: {
                                          multipleValues: true,
                                      },
                                      default: {},
                                      options: [
                                          {
                                              displayName: 'Buttons',
                                              name: 'buttons',
                                              values: [
                                                  {
                                                      displayName: 'Text',
                                                      name: 'text',
                                                      type: 'string',
                                                      default: '',
                                                      description: 'Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed.',
                                                  },
                                                  {
                                                      displayName: 'Additional Fields',
                                                      name: 'additionalFields',
                                                      type: 'collection',
                                                      placeholder: 'Add Field',
                                                      default: {},
                                                      options: [
                                                          {
                                                              displayName: 'Request Contact',
                                                              name: 'request_contact',
                                                              type: 'boolean',
                                                              default: false,
                                                              description: "Whether the user's phone number will be sent as a contact when the button is pressed.Available in private chats only",
                                                          },
                                                          {
                                                              displayName: 'Request Location',
                                                              name: 'request_location',
                                                              type: 'boolean',
                                                              default: false,
                                                              description: "Whether the user's request_location",
                                                          },
                                                      ],
                                                  },
                                              ],
                                          },
                                      ],
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Reply Keyboard Options',
                      name: 'replyKeyboardOptions',
                      type: 'collection',
                      placeholder: 'Add Option',
                      displayOptions: {
                          show: {
                              replyMarkup: ['replyKeyboard'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Resize Keyboard',
                              name: 'resize_keyboard',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to request clients to resize the keyboard vertically for optimal fit',
                          },
                          {
                              displayName: 'One Time Keyboard',
                              name: 'one_time_keyboard',
                              type: 'boolean',
                              default: false,
                              description: "Whether to request clients to hide the keyboard as soon as it's been used",
                          },
                          {
                              displayName: 'Selective',
                              name: 'selective',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to show the keyboard to specific users only',
                          },
                      ],
                  },
                  {
                      displayName: 'Reply Keyboard Remove',
                      name: 'replyKeyboardRemove',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              replyMarkup: ['replyKeyboardRemove'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Remove Keyboard',
                              name: 'remove_keyboard',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to request clients to remove the custom keyboard',
                          },
                          {
                              displayName: 'Selective',
                              name: 'selective',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to force reply from specific users only',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: [
                                  'editMessageText',
                                  'sendAnimation',
                                  'sendAudio',
                                  'sendDocument',
                                  'sendLocation',
                                  'sendMessage',
                                  'sendMediaGroup',
                                  'sendPhoto',
                                  'sendSticker',
                                  'sendVideo',
                              ],
                              resource: ['message'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Append n8n Attribution',
                              name: 'appendAttribution',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to include the phrase “This message was sent automatically with n8n” to the end of the message',
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendMessage'],
                                  },
                              },
                          },
                          {
                              displayName: 'Caption',
                              name: 'caption',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': [
                                          'sendAnimation',
                                          'sendAudio',
                                          'sendDocument',
                                          'sendPhoto',
                                          'sendVideo',
                                      ],
                                  },
                              },
                              default: '',
                              description: 'Caption text to set, 0-1024 characters',
                          },
                          {
                              displayName: 'Disable Notification',
                              name: 'disable_notification',
                              type: 'boolean',
                              default: false,
                              displayOptions: {
                                  hide: {
                                      '/operation': ['editMessageText'],
                                  },
                              },
                              description: 'Whether to send the message silently. Users will receive a notification with no sound.',
                          },
                          {
                              displayName: 'Disable WebPage Preview',
                              name: 'disable_web_page_preview',
                              type: 'boolean',
                              displayOptions: {
                                  show: {
                                      '/operation': ['editMessageText', 'sendMessage'],
                                  },
                              },
                              default: false,
                              description: 'Whether to disable link previews for links in this message',
                          },
                          {
                              displayName: 'Duration',
                              name: 'duration',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAnimation', 'sendAudio', 'sendVideo'],
                                  },
                              },
                              default: 0,
                              description: 'Duration of clip in seconds',
                          },
                          {
                              displayName: 'File Name',
                              name: 'fileName',
                              type: 'string',
                              default: '',
                              displayOptions: {
                                  show: {
                                      '/operation': [
                                          'sendAnimation',
                                          'sendAudio',
                                          'sendDocument',
                                          'sendPhoto',
                                          'sendVideo',
                                          'sendSticker',
                                      ],
                                      '/resource': ['message'],
                                      '/binaryData': [true],
                                  },
                              },
                              placeholder: 'image.jpeg',
                          },
                          {
                              displayName: 'Height',
                              name: 'height',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAnimation', 'sendVideo'],
                                  },
                              },
                              default: 0,
                              description: 'Height of the video',
                          },
                          {
                              displayName: 'Parse Mode',
                              name: 'parse_mode',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Markdown',
                                      value: 'Markdown',
                                  },
                                  {
                                      name: 'HTML',
                                      value: 'HTML',
                                  },
                              ],
                              displayOptions: {
                                  show: {
                                      '/operation': [
                                          'editMessageText',
                                          'sendAnimation',
                                          'sendAudio',
                                          'sendMessage',
                                          'sendPhoto',
                                          'sendVideo',
                                          'sendDocument',
                                      ],
                                  },
                              },
                              default: 'HTML',
                              description: 'How to parse the text',
                          },
                          {
                              displayName: 'Performer',
                              name: 'performer',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAudio'],
                                  },
                              },
                              default: '',
                              description: 'Name of the performer',
                          },
                          {
                              displayName: 'Reply To Message ID',
                              name: 'reply_to_message_id',
                              type: 'number',
                              displayOptions: {
                                  hide: {
                                      '/operation': ['editMessageText'],
                                  },
                              },
                              default: 0,
                              description: 'If the message is a reply, ID of the original message',
                          },
                          {
                              displayName: 'Message Thread ID',
                              name: 'message_thread_id',
                              type: 'number',
                              displayOptions: {
                                  show: {
                                      '/operation': [
                                          'sendAnimation',
                                          'sendAudio',
                                          'sendChatAction',
                                          'sendDocument',
                                          'sendLocation',
                                          'sendMediaGroup',
                                          'sendMessage',
                                          'sendPhoto',
                                          'sendSticker',
                                          'sendVideo',
                                      ],
                                  },
                              },
                              default: 0,
                              description: 'The unique identifier of the forum topic',
                          },
                          {
                              displayName: 'Title',
                              name: 'title',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAudio'],
                                  },
                              },
                              default: '',
                              description: 'Title of the track',
                          },
                          {
                              displayName: 'Thumbnail',
                              name: 'thumb',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAnimation', 'sendAudio', 'sendDocument', 'sendVideo'],
                                  },
                              },
                              default: '',
                              description: 'Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320.',
                          },
                          {
                              displayName: 'Width',
                              name: 'width',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                              },
                              displayOptions: {
                                  show: {
                                      '/operation': ['sendAnimation', 'sendVideo'],
                                  },
                              },
                              default: 0,
                              description: 'Width of the video',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          var _a, _b;
          const items = this.getInputData();
          const returnData = [];
          let body;
          let qs;
          let requestMethod;
          let endpoint;
          const operation = this.getNodeParameter('operation', 0);
          const resource = this.getNodeParameter('resource', 0);
          const binaryData = this.getNodeParameter('binaryData', 0, false);
          const nodeVersion = this.getNode().typeVersion;
          const instanceId = this.getInstanceId();
          for (let i = 0; i < items.length; i++) {
              try {
                  requestMethod = 'POST';
                  endpoint = '';
                  body = {};
                  qs = {};
                  if (resource === 'callback') {
                      if (operation === 'answerQuery') {
                          endpoint = 'answerCallbackQuery';
                          body.callback_query_id = this.getNodeParameter('queryId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                      }
                      else if (operation === 'answerInlineQuery') {
                          endpoint = 'answerInlineQuery';
                          body.inline_query_id = this.getNodeParameter('queryId', i);
                          body.results = this.getNodeParameter('results', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                      }
                  }
                  else if (resource === 'chat') {
                      if (operation === 'get') {
                          endpoint = 'getChat';
                          body.chat_id = this.getNodeParameter('chatId', i);
                      }
                      else if (operation === 'administrators') {
                          endpoint = 'getChatAdministrators';
                          body.chat_id = this.getNodeParameter('chatId', i);
                      }
                      else if (operation === 'leave') {
                          endpoint = 'leaveChat';
                          body.chat_id = this.getNodeParameter('chatId', i);
                      }
                      else if (operation === 'member') {
                          endpoint = 'getChatMember';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.user_id = this.getNodeParameter('userId', i);
                      }
                      else if (operation === 'setDescription') {
                          endpoint = 'setChatDescription';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.description = this.getNodeParameter('description', i);
                      }
                      else if (operation === 'setTitle') {
                          endpoint = 'setChatTitle';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.title = this.getNodeParameter('title', i);
                      }
                  }
                  else if (resource === 'file') {
                      if (operation === 'get') {
                          endpoint = 'getFile';
                          body.file_id = this.getNodeParameter('fileId', i);
                      }
                  }
                  else if (resource === 'message') {
                      if (operation === 'editMessageText') {
                          endpoint = 'editMessageText';
                          const messageType = this.getNodeParameter('messageType', i);
                          if (messageType === 'inlineMessage') {
                              body.inline_message_id = this.getNodeParameter('inlineMessageId', i);
                          }
                          else {
                              body.chat_id = this.getNodeParameter('chatId', i);
                              body.message_id = this.getNodeParameter('messageId', i);
                          }
                          body.text = this.getNodeParameter('text', i);
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'deleteMessage') {
                          endpoint = 'deleteMessage';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.message_id = this.getNodeParameter('messageId', i);
                      }
                      else if (operation === 'pinChatMessage') {
                          endpoint = 'pinChatMessage';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.message_id = this.getNodeParameter('messageId', i);
                          const { disable_notification } = this.getNodeParameter('additionalFields', i);
                          if (disable_notification) {
                              body.disable_notification = true;
                          }
                      }
                      else if (operation === 'unpinChatMessage') {
                          endpoint = 'unpinChatMessage';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.message_id = this.getNodeParameter('messageId', i);
                      }
                      else if (operation === 'sendAnimation') {
                          endpoint = 'sendAnimation';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.animation = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendAudio') {
                          endpoint = 'sendAudio';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.audio = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendChatAction') {
                          endpoint = 'sendChatAction';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.action = this.getNodeParameter('action', i);
                      }
                      else if (operation === 'sendDocument') {
                          endpoint = 'sendDocument';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.document = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendLocation') {
                          endpoint = 'sendLocation';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.latitude = this.getNodeParameter('latitude', i);
                          body.longitude = this.getNodeParameter('longitude', i);
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendMessage') {
                          endpoint = 'sendMessage';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.text = this.getNodeParameter('text', i);
                          GenericFunctions_1.addAdditionalFields.call(this, body, i, nodeVersion, instanceId);
                      }
                      else if (operation === 'sendMediaGroup') {
                          endpoint = 'sendMediaGroup';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                          const mediaItems = this.getNodeParameter('media', i);
                          body.media = [];
                          for (const mediaItem of mediaItems.media) {
                              if (mediaItem.additionalFields !== undefined) {
                                  Object.assign(mediaItem, mediaItem.additionalFields);
                                  delete mediaItem.additionalFields;
                              }
                              body.media.push(mediaItem);
                          }
                      }
                      else if (operation === 'sendPhoto') {
                          endpoint = 'sendPhoto';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.photo = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendSticker') {
                          endpoint = 'sendSticker';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.sticker = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                      else if (operation === 'sendVideo') {
                          endpoint = 'sendVideo';
                          body.chat_id = this.getNodeParameter('chatId', i);
                          body.video = this.getNodeParameter('file', i, '');
                          GenericFunctions_1.addAdditionalFields.call(this, body, i);
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  let responseData;
                  if (binaryData) {
                      const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0);
                      const itemBinaryData = items[i].binary[binaryPropertyName];
                      const propertyName = (0, GenericFunctions_1.getPropertyName)(operation);
                      const fileName = this.getNodeParameter('additionalFields.fileName', 0, '');
                      const filename = fileName || ((_a = itemBinaryData.fileName) === null || _a === void 0 ? void 0 : _a.toString());
                      if (!fileName && !itemBinaryData.fileName) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `File name is needed to ${operation}. Make sure the property that holds the binary data
  						has the file name property set or set it manually in the node using the File Name parameter under
  						Additional Fields.`);
                      }
                      body.disable_notification = ((_b = body.disable_notification) === null || _b === void 0 ? void 0 : _b.toString()) || 'false';
                      let uploadData;
                      if (itemBinaryData.id) {
                          uploadData = await this.helpers.getBinaryStream(itemBinaryData.id);
                      }
                      else {
                          uploadData = Buffer.from(itemBinaryData.data, n8n_workflow_1.BINARY_ENCODING);
                      }
                      const formData = {
                          ...body,
                          [propertyName]: {
                              value: uploadData,
                              options: {
                                  filename,
                                  contentType: itemBinaryData.mimeType,
                              },
                          },
                      };
                      responseData = await GenericFunctions_1.apiRequest.call(this, requestMethod, endpoint, {}, qs, { formData });
                  }
                  else {
                      responseData = await GenericFunctions_1.apiRequest.call(this, requestMethod, endpoint, body, qs);
                  }
                  if (resource === 'file' && operation === 'get') {
                      if (this.getNodeParameter('download', i, false)) {
                          const filePath = responseData.result.file_path;
                          const credentials = await this.getCredentials('telegramApi');
                          const file = await GenericFunctions_1.apiRequest.call(this, 'GET', '', {}, {}, {
                              json: false,
                              encoding: null,
                              uri: `https://api.telegram.org/file/bot${credentials.accessToken}/${filePath}`,
                              resolveWithFullResponse: true,
                              useStream: true,
                          });
                          const fileName = filePath.split('/').pop();
                          const data = await this.helpers.prepareBinaryData(file.body, fileName);
                          returnData.push({
                              json: responseData,
                              binary: { data },
                              pairedItem: { item: i },
                          });
                          continue;
                      }
                  }
                  else if (resource === 'chat' && operation === 'administrators') {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.result), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  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.Telegram = Telegram;
  //# sourceMappingURL=Telegram.node.js.map

credential_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TelegramApi = void 0;
  class TelegramApi {
      constructor() {
          this.name = 'telegramApi';
          this.displayName = 'Telegram API';
          this.documentationUrl = 'telegram';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Chat with the <a href="https://telegram.me/botfather">bot father</a> to obtain the access token',
              },
          ];
          this.test = {
              request: {
                  baseURL: '=https://api.telegram.org/bot{{$credentials.accessToken}}',
                  url: '/getMe',
              },
          };
      }
  }
  exports.TelegramApi = TelegramApi;
  //# sourceMappingURL=TelegramApi.credentials.js.map

  // --- Next Credential File ---

  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TelegramApi = void 0;
  class TelegramApi {
      constructor() {
          this.name = 'telegramApi';
          this.displayName = 'Telegram API';
          this.documentationUrl = 'telegram';
          this.properties = [
              {
                  displayName: 'Access Token',
                  name: 'accessToken',
                  type: 'string',
                  typeOptions: { password: true },
                  default: '',
                  description: 'Chat with the <a href="https://telegram.me/botfather">bot father</a> to obtain the access token',
              },
          ];
          this.test = {
              request: {
                  baseURL: '=https://api.telegram.org/bot{{$credentials.accessToken}}',
                  url: '/getMe',
              },
          };
      }
  }
  exports.TelegramApi = TelegramApi;
  //# sourceMappingURL=TelegramApi.credentials.js.map

example_workflow:
  {"name":"Telegram Example Workflow","nodes":[{"parameters":{},"id":"45qllsh6zkc7z9xyij5pwl","name":"Telegram","type":"n8n-nodes-base.exampleNode","typeVersion":1,"position":[250,300]}],"connections":{},"active":false,"settings":{},"tags":["example","generated"]}


