# nodes

node_type: n8n-nodes-base.ManualTrigger
name: ManualTrigger
package_name: n8n-nodes-base
display_name: Manual Trigger
description: Runs the flow on clicking a button in n8n
code_hash: 3f35cd3f09861e28f965057221a8ecbf622153067834b57309d254a96f85c787
source_location: node_modules/n8n-nodes-base/dist/nodes/ManualTrigger/ManualTrigger.node.js
extracted_at: 2025-06-07 19:36:39
updated_at: 2025-06-07 19:36:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ManualTrigger = void 0;
  class ManualTrigger {
      constructor() {
          this.description = {
              displayName: 'Manual Trigger',
              name: 'manualTrigger',
              icon: 'fa:mouse-pointer',
              group: ['trigger'],
              version: 1,
              description: 'Runs the flow on clicking a button in n8n',
              eventTriggerDescription: '',
              maxNodes: 1,
              defaults: {
                  name: 'When clicking "Execute Workflow"',
                  color: '#909298',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'This node is where a manual workflow execution starts. To make one, go back to the canvas and click ‘execute workflow’',
                      name: 'notice',
                      type: 'notice',
                      default: '',
                  },
              ],
          };
      }
      async trigger() {
          const manualTriggerFunction = async () => {
              this.emit([this.helpers.returnJsonArray([{}])]);
          };
          return {
              manualTriggerFunction,
          };
      }
  }
  exports.ManualTrigger = ManualTrigger;
  //# sourceMappingURL=ManualTrigger.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Markdown
name: Markdown
package_name: n8n-nodes-base
display_name: Markdown
description: Convert data between Markdown and HTML
code_hash: 32b117c3ea879ef7772b83158e47c9db429370a9fd5b3a30dcb41fba78d4fd06
source_location: node_modules/n8n-nodes-base/dist/nodes/Markdown/Markdown.node.js
extracted_at: 2025-06-07 19:36:39
updated_at: 2025-06-07 19:36: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.Markdown = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const showdown_1 = require("showdown");
  const node_html_markdown_1 = require("node-html-markdown");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  const set_1 = __importDefault(require("lodash/set"));
  class Markdown {
      constructor() {
          this.description = {
              displayName: 'Markdown',
              name: 'markdown',
              icon: 'file:markdown.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["mode"]==="markdownToHtml" ? "Markdown to HTML" : "HTML to Markdown"}}',
              description: 'Convert data between Markdown and HTML',
              defaults: {
                  name: 'Markdown',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [],
              properties: [
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      options: [
                          {
                              name: 'Markdown to HTML',
                              value: 'markdownToHtml',
                              description: 'Convert data from Markdown to HTML',
                          },
                          {
                              name: 'HTML to Markdown',
                              value: 'htmlToMarkdown',
                              description: 'Convert data from HTML to Markdown',
                          },
                      ],
                      default: 'htmlToMarkdown',
                  },
                  {
                      displayName: 'HTML',
                      name: 'html',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['htmlToMarkdown'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'The HTML to be converted to markdown',
                  },
                  {
                      displayName: 'Markdown',
                      name: 'markdown',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['markdownToHtml'],
                          },
                      },
                      default: '',
                      required: true,
                      description: 'The Markdown to be converted to html',
                  },
                  {
                      displayName: 'Destination Key',
                      name: 'destinationKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['markdownToHtml', 'htmlToMarkdown'],
                          },
                      },
                      default: 'data',
                      required: true,
                      placeholder: '',
                      description: 'The field to put the output in. Specify nested fields using dots, e.g."level1.level2.newKey".',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              mode: ['htmlToMarkdown'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Bullet Marker',
                              name: 'bulletMarker',
                              type: 'string',
                              default: '*',
                              description: 'Specify bullet marker, default *',
                          },
                          {
                              displayName: 'Code Block Fence',
                              name: 'codeFence',
                              type: 'string',
                              default: '```',
                              description: 'Specify code block fence, default ```',
                          },
                          {
                              displayName: 'Emphasis Delimiter',
                              name: 'emDelimiter',
                              type: 'string',
                              default: '_',
                              description: 'Specify emphasis delimiter, default _',
                          },
                          {
                              displayName: 'Global Escape Pattern',
                              name: 'globalEscape',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: false,
                              },
                              default: {},
                              description: 'Setting this will override the default escape settings, you might want to use textReplace option instead',
                              options: [
                                  {
                                      name: 'value',
                                      displayName: 'Value',
                                      values: [
                                          {
                                              displayName: 'Pattern',
                                              name: 'pattern',
                                              type: 'string',
                                              default: '',
                                              description: 'RegEx for pattern',
                                          },
                                          {
                                              displayName: 'Replacement',
                                              name: 'replacement',
                                              type: 'string',
                                              default: '',
                                              description: 'String replacement',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Ignored Elements',
                              name: 'ignore',
                              type: 'string',
                              default: '',
                              description: 'Supplied elements will be ignored (ignores inner text does not parse children)',
                              placeholder: 'e.g. h1, p ...',
                              hint: 'Comma separated elements',
                          },
                          {
                              displayName: 'Keep Images With Data',
                              name: 'keepDataImages',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to keep images with data: URI (Note: These can be up to 1MB each), e.g. &lt;img src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSK......0o/"&gt;',
                          },
                          {
                              displayName: 'Line Start Escape Pattern',
                              name: 'lineStartEscape',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: false,
                              },
                              default: {},
                              description: 'Setting this will override the default escape settings, you might want to use textReplace option instead',
                              options: [
                                  {
                                      name: 'value',
                                      displayName: 'Value',
                                      values: [
                                          {
                                              displayName: 'Pattern',
                                              name: 'pattern',
                                              type: 'string',
                                              default: '',
                                              description: 'RegEx for pattern',
                                          },
                                          {
                                              displayName: 'Replacement',
                                              name: 'replacement',
                                              type: 'string',
                                              default: '',
                                              description: 'String replacement',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Max Consecutive New Lines',
                              name: 'maxConsecutiveNewlines',
                              type: 'number',
                              default: 3,
                              description: 'Specify max consecutive new lines allowed',
                          },
                          {
                              displayName: 'Place URLs At The Bottom',
                              name: 'useLinkReferenceDefinitions',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to Place URLS at the bottom and format links using link reference definitions',
                          },
                          {
                              displayName: 'Strong Delimiter',
                              name: 'strongDelimiter',
                              type: 'string',
                              default: '**',
                              description: 'Specify strong delimiter, default **',
                          },
                          {
                              displayName: 'Style For Code Block',
                              name: 'codeBlockStyle',
                              type: 'options',
                              default: 'fence',
                              description: 'Specify style for code block, default "fence"',
                              options: [
                                  {
                                      name: 'Fence',
                                      value: 'fence',
                                  },
                                  {
                                      name: 'Indented',
                                      value: 'indented',
                                  },
                              ],
                          },
                          {
                              displayName: 'Text Replacement Pattern',
                              name: 'textReplace',
                              type: 'fixedCollection',
                              typeOptions: {
                                  multipleValues: true,
                              },
                              default: [],
                              description: 'User-defined text replacement pattern (Replaces matching text retrieved from nodes)',
                              options: [
                                  {
                                      name: 'values',
                                      displayName: 'Values',
                                      values: [
                                          {
                                              displayName: 'Pattern',
                                              name: 'pattern',
                                              type: 'string',
                                              default: '',
                                              description: 'RegEx for pattern',
                                          },
                                          {
                                              displayName: 'Replacement',
                                              name: 'replacement',
                                              type: 'string',
                                              default: '',
                                              description: 'String replacement',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'Treat As Blocks',
                              name: 'blockElements',
                              type: 'string',
                              default: '',
                              description: 'Supplied elements will be treated as blocks (surrounded with blank lines)',
                              placeholder: 'e.g. p, div, ...',
                              hint: 'Comma separated elements',
                          },
                      ],
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              mode: ['markdownToHtml'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Add Blank To Links',
                              name: 'openLinksInNewWindow',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to open all links in new windows (by adding the attribute target="_blank" to <a> tags)',
                          },
                          {
                              displayName: 'Automatic Linking to URLs',
                              name: 'simplifiedAutoLink',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable automatic linking to URLs',
                          },
                          {
                              displayName: 'Backslash Escapes HTML Tags',
                              name: 'backslashEscapesHTMLTags',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to support for HTML Tag escaping ex: &lt;div&gt;foo&lt;/div&gt;',
                          },
                          {
                              displayName: 'Complete HTML Document',
                              name: 'completeHTMLDocument',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to output a complete html document, including &lt;html&gt;, &lt;head&gt; and &lt;body&gt; tags instead of an HTML fragment',
                          },
                          {
                              displayName: 'Customized Header ID',
                              name: 'customizedHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to use text in curly braces as header ID',
                          },
                          {
                              displayName: 'Emoji Support',
                              name: 'emoji',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable emoji support. Ex: this is a :smile: emoji For more info on available emojis, see https://github.com/showdownjs/showdown/wiki/Emojis.',
                          },
                          {
                              displayName: 'Encode Emails',
                              name: 'encodeEmails',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to enable e-mail addresses encoding through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
                          },
                          {
                              displayName: 'Exclude Trailing Punctuation From URLs',
                              name: 'excludeTrailingPunctuationFromURLs',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to exclude trailing punctuation from autolinking URLs. Punctuation excluded: . ! ? ( ). Only applies if simplifiedAutoLink option is set to true.',
                          },
                          {
                              displayName: 'GitHub Code Blocks',
                              name: 'ghCodeBlocks',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to enable support for GFM code block style',
                          },
                          {
                              displayName: 'GitHub Compatible Header IDs',
                              name: 'ghCompatibleHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to generate header IDs compatible with github style (spaces are replaced with dashes and a bunch of non alphanumeric chars are removed)',
                          },
                          {
                              displayName: 'GitHub Mention Link',
                              name: 'ghMentionsLink',
                              type: 'string',
                              default: 'https://github.com/{u}',
                              description: 'Whether to change the link generated by @mentions. Showdown will replace {u} with the username. Only applies if ghMentions option is enabled.',
                          },
                          {
                              displayName: 'GitHub Mentions',
                              name: 'ghMentions',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable github @mentions, which link to the username mentioned',
                          },
                          {
                              displayName: 'GitHub Task Lists',
                              name: 'tasklists',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable support for GFM tasklists',
                          },
                          {
                              displayName: 'Header Level Start',
                              name: 'headerLevelStart',
                              type: 'number',
                              default: 1,
                              description: 'Whether to set the header starting level',
                          },
                          {
                              displayName: 'Mandatory Space Before Header',
                              name: 'requireSpaceBeforeHeadingText',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to make adding a space between # and the header text mandatory',
                          },
                          {
                              displayName: 'Middle Word Asterisks',
                              name: 'literalMidWordAsterisks',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to stop showdown from interpreting asterisks in the middle of words as <em> and <strong> and instead treat them as literal asterisks',
                          },
                          {
                              displayName: 'Middle Word Underscores',
                              name: 'literalMidWordUnderscores',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to stop showdown from interpreting underscores in the middle of words as <em> and <strong> and instead treat them as literal underscores',
                          },
                          {
                              displayName: 'No Header ID',
                              name: 'noHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to disable the automatic generation of header IDs',
                          },
                          {
                              displayName: 'Parse Image Dimensions',
                              name: 'parseImgDimensions',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable support for setting image dimensions from within markdown syntax',
                          },
                          {
                              displayName: 'Prefix Header ID',
                              name: 'prefixHeaderId',
                              type: 'string',
                              default: 'section',
                              description: 'Add a prefix to the generated header IDs',
                          },
                          {
                              displayName: 'Raw Header ID',
                              name: 'rawHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to remove only spaces, \' and " from generated header IDs (including prefixes), replacing them with dashes (-)',
                          },
                          {
                              displayName: 'Raw Prefix Header ID',
                              name: 'rawPrefixHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to prevent showdown from modifying the prefix',
                          },
                          {
                              displayName: 'Simple Line Breaks',
                              name: 'simpleLineBreaks',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to parse line breaks as &lt;br&gt;, like GitHub does, without needing 2 spaces at the end of the line',
                          },
                          {
                              displayName: 'Smart Indentation Fix',
                              name: 'smartIndentationFix',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to try to smartly fix indentation problems related to es6 template strings in the midst of indented code',
                          },
                          {
                              displayName: 'Spaces Indented Sublists',
                              name: 'disableForced4SpacesIndentedSublists',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to disable the requirement of indenting sublists by 4 spaces for them to be nested, effectively reverting to the old behavior where 2 or 3 spaces were enough',
                          },
                          {
                              displayName: 'Split Adjacent Blockquotes',
                              name: 'splitAdjacentBlockquotes',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to split adjacent blockquote blocks',
                          },
                          {
                              displayName: 'Strikethrough',
                              name: 'strikethrough',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable support for strikethrough syntax',
                          },
                          {
                              displayName: 'Tables Header ID',
                              name: 'tablesHeaderId',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to add an ID property to table headers tags',
                          },
                          {
                              displayName: 'Tables Support',
                              name: 'tables',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to enable support for tables syntax',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const mode = this.getNodeParameter('mode', 0);
          const { length } = items;
          for (let i = 0; i < length; i++) {
              try {
                  if (mode === 'htmlToMarkdown') {
                      const options = this.getNodeParameter('options', i);
                      const destinationKey = this.getNodeParameter('destinationKey', i);
                      const textReplaceOption = this.getNodeParameter('options.textReplace.values', i, []);
                      options.textReplace = !(0, isEmpty_1.default)(textReplaceOption)
                          ? textReplaceOption.map((entry) => [entry.pattern, entry.replacement])
                          : undefined;
                      const lineStartEscapeOption = this.getNodeParameter('options.lineStartEscape.value', i, {});
                      options.lineStartEscape = !(0, isEmpty_1.default)(lineStartEscapeOption)
                          ? [lineStartEscapeOption.pattern, lineStartEscapeOption.replacement]
                          : undefined;
                      const globalEscapeOption = this.getNodeParameter('options.globalEscape.value', i, {});
                      options.globalEscape = !(0, isEmpty_1.default)(globalEscapeOption)
                          ? [globalEscapeOption.pattern, globalEscapeOption.replacement]
                          : undefined;
                      options.ignore = options.ignore
                          ? options.ignore.split(',').map((element) => element.trim())
                          : undefined;
                      options.blockElements = options.blockElements
                          ? options.blockElements.split(',').map((element) => element.trim())
                          : undefined;
                      const markdownOptions = {};
                      Object.keys(options).forEach((option) => {
                          if (options[option]) {
                              markdownOptions[option] = options[option];
                          }
                      });
                      const html = this.getNodeParameter('html', i);
                      const markdownFromHTML = node_html_markdown_1.NodeHtmlMarkdown.translate(html, markdownOptions);
                      const newItem = (0, n8n_workflow_1.deepCopy)(items[i].json);
                      (0, set_1.default)(newItem, destinationKey, markdownFromHTML);
                      returnData.push(newItem);
                  }
                  if (mode === 'markdownToHtml') {
                      const markdown = this.getNodeParameter('markdown', i);
                      const destinationKey = this.getNodeParameter('destinationKey', i);
                      const options = this.getNodeParameter('options', i);
                      const converter = new showdown_1.Converter();
                      Object.keys(options).forEach((key) => converter.setOption(key, options[key]));
                      const htmlFromMarkdown = converter.makeHtml(markdown);
                      const newItem = (0, n8n_workflow_1.deepCopy)(items[i].json);
                      (0, set_1.default)(newItem, destinationKey, htmlFromMarkdown);
                      returnData.push(newItem);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Markdown = Markdown;
  //# sourceMappingURL=Markdown.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Marketstack
name: Marketstack
package_name: n8n-nodes-base
display_name: Marketstack
description: Consume Marketstack API
code_hash: 098ff7375610f64c4f10cdaa78dbfa45ab7c388f1349b0dec97e88a16ec18538
source_location: node_modules/n8n-nodes-base/dist/nodes/Marketstack/Marketstack.node.js
extracted_at: 2025-06-07 19:36:39
updated_at: 2025-06-07 19:36:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Marketstack = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Marketstack {
      constructor() {
          this.description = {
              displayName: 'Marketstack',
              name: 'marketstack',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              icon: 'file:marketstack.svg',
              group: ['transform'],
              version: 1,
              description: 'Consume Marketstack API',
              defaults: {
                  name: 'Marketstack',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'marketstackApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'End-of-Day Data',
                              value: 'endOfDayData',
                              description: 'Stock market closing data',
                          },
                          {
                              name: 'Exchange',
                              value: 'exchange',
                              description: 'Stock market exchange',
                          },
                          {
                              name: 'Ticker',
                              value: 'ticker',
                              description: 'Stock market symbol',
                          },
                      ],
                      default: 'endOfDayData',
                      required: true,
                  },
                  ...descriptions_1.endOfDayDataOperations,
                  ...descriptions_1.endOfDayDataFields,
                  ...descriptions_1.exchangeOperations,
                  ...descriptions_1.exchangeFields,
                  ...descriptions_1.tickerOperations,
                  ...descriptions_1.tickerFields,
              ],
          };
      }
      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 === 'endOfDayData') {
                      if (operation === 'getAll') {
                          const qs = {
                              symbols: this.getNodeParameter('symbols', i),
                          };
                          const { latest, specificDate, dateFrom, dateTo, ...rest } = this.getNodeParameter('filters', i);
                          GenericFunctions_1.validateTimeOptions.call(this, [
                              latest !== undefined && latest,
                              specificDate !== undefined,
                              dateFrom !== undefined && dateTo !== undefined,
                          ]);
                          if (Object.keys(rest).length) {
                              Object.assign(qs, rest);
                          }
                          let endpoint;
                          if (latest) {
                              endpoint = '/eod/latest';
                          }
                          else if (specificDate) {
                              endpoint = `/eod/${(0, GenericFunctions_1.format)(specificDate)}`;
                          }
                          else {
                              if (!dateFrom || !dateTo) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter a start and end date to filter by timeframe.', { itemIndex: i });
                              }
                              endpoint = '/eod';
                              qs.date_from = (0, GenericFunctions_1.format)(dateFrom);
                              qs.date_to = (0, GenericFunctions_1.format)(dateTo);
                          }
                          responseData = await GenericFunctions_1.marketstackApiRequestAllItems.call(this, 'GET', endpoint, {}, qs);
                      }
                  }
                  else if (resource === 'exchange') {
                      if (operation === 'get') {
                          const exchange = this.getNodeParameter('exchange', i);
                          const endpoint = `/exchanges/${exchange}`;
                          responseData = await GenericFunctions_1.marketstackApiRequest.call(this, 'GET', endpoint);
                      }
                  }
                  else if (resource === 'ticker') {
                      if (operation === 'get') {
                          const symbol = this.getNodeParameter('symbol', i);
                          const endpoint = `/tickers/${symbol}`;
                          responseData = await GenericFunctions_1.marketstackApiRequest.call(this, 'GET', endpoint);
                      }
                  }
              }
              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.Marketstack = Marketstack;
  //# sourceMappingURL=Marketstack.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Matrix
name: Matrix
package_name: n8n-nodes-base
display_name: Matrix
description: Consume Matrix API
code_hash: 91e527aaf38b57561fef448ed86f0079de7a086d1320bda1df4c98a5c3c6a43c
source_location: node_modules/n8n-nodes-base/dist/nodes/Matrix/Matrix.node.js
extracted_at: 2025-06-07 19:36:39
updated_at: 2025-06-07 19:36:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Matrix = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const AccountDescription_1 = require("./AccountDescription");
  const EventDescription_1 = require("./EventDescription");
  const MediaDescription_1 = require("./MediaDescription");
  const MessageDescription_1 = require("./MessageDescription");
  const RoomDescription_1 = require("./RoomDescription");
  const RoomMemberDescription_1 = require("./RoomMemberDescription");
  class Matrix {
      constructor() {
          this.description = {
              displayName: 'Matrix',
              name: 'matrix',
              icon: 'file:matrix.png',
              group: ['output'],
              version: 1,
              description: 'Consume Matrix API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Matrix',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'matrixApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Account',
                              value: 'account',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Media',
                              value: 'media',
                          },
                          {
                              name: 'Message',
                              value: 'message',
                          },
                          {
                              name: 'Room',
                              value: 'room',
                          },
                          {
                              name: 'Room Member',
                              value: 'roomMember',
                          },
                      ],
                      default: 'message',
                  },
                  ...AccountDescription_1.accountOperations,
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...MediaDescription_1.mediaOperations,
                  ...MediaDescription_1.mediaFields,
                  ...MessageDescription_1.messageOperations,
                  ...MessageDescription_1.messageFields,
                  ...RoomDescription_1.roomOperations,
                  ...RoomDescription_1.roomFields,
                  ...RoomMemberDescription_1.roomMemberOperations,
                  ...RoomMemberDescription_1.roomMemberFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getChannels() {
                      const returnData = [];
                      const joinedRoomsResponse = await GenericFunctions_1.matrixApiRequest.call(this, 'GET', '/joined_rooms');
                      await Promise.all(joinedRoomsResponse.joined_rooms.map(async (roomId) => {
                          try {
                              const roomNameResponse = await GenericFunctions_1.matrixApiRequest.call(this, 'GET', `/rooms/${roomId}/state/m.room.name`);
                              returnData.push({
                                  name: roomNameResponse.name,
                                  value: roomId,
                              });
                          }
                          catch (error) {
                              returnData.push({
                                  name: `Unknown: ${roomId}`,
                                  value: roomId,
                              });
                          }
                      }));
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  const responseData = await GenericFunctions_1.handleMatrixCall.call(this, items[i], i, resource, operation);
                  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.Matrix = Matrix;
  //# sourceMappingURL=Matrix.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Mattermost
name: Mattermost
package_name: n8n-nodes-base
display_name: Mattermost
description: Sends data to Mattermost
code_hash: 9a4b0669740615e90e6eefc2f30d8de6a43dac3305dd908b29e49c48787130fb
source_location: node_modules/n8n-nodes-base/dist/nodes/Mattermost/Mattermost.node.js
extracted_at: 2025-06-07 19:36:39
updated_at: 2025-06-07 19:36:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mattermost = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const MattermostV1_node_1 = require("./v1/MattermostV1.node");
  class Mattermost extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Mattermost',
              name: 'mattermost',
              icon: 'file:mattermost.svg',
              group: ['output'],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Sends data to Mattermost',
              defaultVersion: 1,
          };
          const nodeVersions = {
              1: new MattermostV1_node_1.MattermostV1(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Mattermost = Mattermost;
  //# sourceMappingURL=Mattermost.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Mautic
name: Mautic
package_name: n8n-nodes-base
display_name: Mautic
description: Consume Mautic API
code_hash: 9fd6ac004d6538dd3a615d81114369f98b52d90f5404a73e452c9f6321c81771
source_location: node_modules/n8n-nodes-base/dist/nodes/Mautic/Mautic.node.js
extracted_at: 2025-06-07 19:36:39
updated_at: 2025-06-07 19:36:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mautic = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const ContactDescription_1 = require("./ContactDescription");
  const SegmentEmailDescription_1 = require("./SegmentEmailDescription");
  const CompanyDescription_1 = require("./CompanyDescription");
  const CompanyContactDescription_1 = require("./CompanyContactDescription");
  const ContactSegmentDescription_1 = require("./ContactSegmentDescription");
  const CampaignContactDescription_1 = require("./CampaignContactDescription");
  const change_case_1 = require("change-case");
  class Mautic {
      constructor() {
          this.description = {
              displayName: 'Mautic',
              name: 'mautic',
              icon: 'file:mautic.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Mautic API',
              defaults: {
                  name: 'Mautic',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mauticApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['credentials'],
                          },
                      },
                  },
                  {
                      name: 'mauticOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Credentials',
                              value: 'credentials',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'credentials',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Campaign Contact',
                              value: 'campaignContact',
                              description: 'Add/remove contacts to/from a campaign',
                          },
                          {
                              name: 'Company',
                              value: 'company',
                              description: 'Create or modify a company',
                          },
                          {
                              name: 'Company Contact',
                              value: 'companyContact',
                              description: 'Add/remove contacts to/from a company',
                          },
                          {
                              name: 'Contact',
                              value: 'contact',
                              description: 'Create & modify contacts',
                          },
                          {
                              name: 'Contact Segment',
                              value: 'contactSegment',
                              description: 'Add/remove contacts to/from a segment',
                          },
                          {
                              name: 'Segment Email',
                              value: 'segmentEmail',
                              description: 'Send an email',
                          },
                      ],
                      default: 'contact',
                  },
                  ...CompanyDescription_1.companyOperations,
                  ...CompanyDescription_1.companyFields,
                  ...ContactDescription_1.contactOperations,
                  ...ContactDescription_1.contactFields,
                  ...ContactSegmentDescription_1.contactSegmentOperations,
                  ...ContactSegmentDescription_1.contactSegmentFields,
                  ...CampaignContactDescription_1.campaignContactOperations,
                  ...CampaignContactDescription_1.campaignContactFields,
                  ...CompanyContactDescription_1.companyContactOperations,
                  ...CompanyContactDescription_1.companyContactFields,
                  ...SegmentEmailDescription_1.segmentEmailOperations,
                  ...SegmentEmailDescription_1.segmentEmailFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCompanies() {
                      const returnData = [];
                      const companies = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'companies', 'GET', '/companies');
                      for (const company of companies) {
                          returnData.push({
                              name: company.fields.all.companyname,
                              value: company.fields.all.companyname,
                          });
                      }
                      return returnData;
                  },
                  async getTags() {
                      const returnData = [];
                      const tags = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'tags', 'GET', '/tags');
                      for (const tag of tags) {
                          returnData.push({
                              name: tag.tag,
                              value: tag.tag,
                          });
                      }
                      return returnData;
                  },
                  async getStages() {
                      const returnData = [];
                      const stages = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'stages', 'GET', '/stages');
                      for (const stage of stages) {
                          returnData.push({
                              name: stage.name,
                              value: stage.id,
                          });
                      }
                      return returnData;
                  },
                  async getCompanyFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'fields', 'GET', '/fields/company');
                      for (const field of fields) {
                          returnData.push({
                              name: field.label,
                              value: field.alias,
                          });
                      }
                      return returnData;
                  },
                  async getIndustries() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'fields', 'GET', '/fields/company');
                      for (const field of fields) {
                          if (field.alias === 'companyindustry') {
                              for (const { label, value } of field.properties.list) {
                                  returnData.push({
                                      name: label,
                                      value,
                                  });
                              }
                          }
                      }
                      return returnData;
                  },
                  async getContactFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'fields', 'GET', '/fields/contact');
                      for (const field of fields) {
                          returnData.push({
                              name: field.label,
                              value: field.alias,
                          });
                      }
                      return returnData;
                  },
                  async getSegments() {
                      const returnData = [];
                      const segments = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'lists', 'GET', '/segments');
                      for (const segment of segments) {
                          returnData.push({
                              name: segment.name,
                              value: segment.id,
                          });
                      }
                      return returnData;
                  },
                  async getCampaigns() {
                      const returnData = [];
                      const campaings = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'campaigns', 'GET', '/campaigns');
                      for (const campaign of campaings) {
                          returnData.push({
                              name: campaign.name,
                              value: campaign.id,
                          });
                      }
                      return returnData;
                  },
                  async getEmails() {
                      const returnData = [];
                      const emails = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'emails', 'GET', '/emails');
                      for (const email of emails) {
                          returnData.push({
                              name: email.name,
                              value: email.id,
                          });
                      }
                      return returnData;
                  },
                  async getSegmentEmails() {
                      const returnData = [];
                      const emails = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'emails', 'GET', '/emails');
                      for (const email of emails) {
                          if (email.emailType === 'list') {
                              returnData.push({
                                  name: email.name,
                                  value: email.id,
                              });
                          }
                      }
                      return returnData;
                  },
                  async getCampaignEmails() {
                      const returnData = [];
                      const emails = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'emails', 'GET', '/emails');
                      for (const email of emails) {
                          if (email.emailType === 'template') {
                              returnData.push({
                                  name: email.name,
                                  value: email.id,
                              });
                          }
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let qs;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              qs = {};
              try {
                  if (resource === 'company') {
                      if (operation === 'create') {
                          const simple = this.getNodeParameter('simple', i);
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              companyname: name,
                          };
                          const { addressUi, customFieldsUi, companyEmail, fax, industry, numberOfEmpoyees, phone, website, annualRevenue, description, ...rest } = this.getNodeParameter('additionalFields', i);
                          if (addressUi === null || addressUi === void 0 ? void 0 : addressUi.addressValues) {
                              const { addressValues } = addressUi;
                              body.companyaddress1 = addressValues.address1;
                              body.companyaddress2 = addressValues.address2;
                              body.companycity = addressValues.city;
                              body.companystate = addressValues.state;
                              body.companycountry = addressValues.country;
                              body.companyzipcode = addressValues.zipCode;
                          }
                          if (companyEmail) {
                              body.companyemail = companyEmail;
                          }
                          if (fax) {
                              body.companyfax = fax;
                          }
                          if (industry) {
                              body.companyindustry = industry;
                          }
                          if (industry) {
                              body.companyindustry = industry;
                          }
                          if (numberOfEmpoyees) {
                              body.companynumber_of_employees = numberOfEmpoyees;
                          }
                          if (phone) {
                              body.companyphone = phone;
                          }
                          if (website) {
                              body.companywebsite = website;
                          }
                          if (annualRevenue) {
                              body.companyannual_revenue = annualRevenue;
                          }
                          if (description) {
                              body.companydescription = description;
                          }
                          if (customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldValues) {
                              const { customFieldValues } = customFieldsUi;
                              const data = customFieldValues.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                              Object.assign(body, data);
                          }
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', '/companies/new', body);
                          responseData = responseData.company;
                          if (simple) {
                              responseData = responseData.fields.all;
                          }
                      }
                      if (operation === 'update') {
                          const companyId = this.getNodeParameter('companyId', i);
                          const simple = this.getNodeParameter('simple', i);
                          const body = {};
                          const { addressUi, customFieldsUi, companyEmail, name, fax, industry, numberOfEmpoyees, phone, website, annualRevenue, description, ...rest } = this.getNodeParameter('updateFields', i);
                          if (addressUi === null || addressUi === void 0 ? void 0 : addressUi.addressValues) {
                              const { addressValues } = addressUi;
                              body.companyaddress1 = addressValues.address1;
                              body.companyaddress2 = addressValues.address2;
                              body.companycity = addressValues.city;
                              body.companystate = addressValues.state;
                              body.companycountry = addressValues.country;
                              body.companyzipcode = addressValues.zipCode;
                          }
                          if (companyEmail) {
                              body.companyemail = companyEmail;
                          }
                          if (name) {
                              body.companyname = name;
                          }
                          if (fax) {
                              body.companyfax = fax;
                          }
                          if (industry) {
                              body.companyindustry = industry;
                          }
                          if (industry) {
                              body.companyindustry = industry;
                          }
                          if (numberOfEmpoyees) {
                              body.companynumber_of_employees = numberOfEmpoyees;
                          }
                          if (phone) {
                              body.companyphone = phone;
                          }
                          if (website) {
                              body.companywebsite = website;
                          }
                          if (annualRevenue) {
                              body.companyannual_revenue = annualRevenue;
                          }
                          if (description) {
                              body.companydescription = description;
                          }
                          if (customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldValues) {
                              const { customFieldValues } = customFieldsUi;
                              const data = customFieldValues.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                              Object.assign(body, data);
                          }
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'PATCH', `/companies/${companyId}/edit`, body);
                          responseData = responseData.company;
                          if (simple) {
                              responseData = responseData.fields.all;
                          }
                      }
                      if (operation === 'get') {
                          const companyId = this.getNodeParameter('companyId', i);
                          const simple = this.getNodeParameter('simple', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'GET', `/companies/${companyId}`);
                          responseData = responseData.company;
                          if (simple) {
                              responseData = responseData.fields.all;
                          }
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const simple = this.getNodeParameter('simple', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          qs = Object.assign(qs, additionalFields);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'companies', 'GET', '/companies', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              qs.start = 0;
                              responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'GET', '/companies', {}, qs);
                              if (responseData.errors) {
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), responseData);
                              }
                              responseData = responseData.companies;
                              responseData = Object.values(responseData);
                          }
                          if (simple) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'delete') {
                          const simple = this.getNodeParameter('simple', i);
                          const companyId = this.getNodeParameter('companyId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'DELETE', `/companies/${companyId}/delete`);
                          responseData = responseData.company;
                          if (simple) {
                              responseData = responseData.fields.all;
                          }
                      }
                  }
                  if (resource === 'contact') {
                      if (operation === 'create') {
                          const options = this.getNodeParameter('options', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          let body = {};
                          if (!jsonActive) {
                              body.email = this.getNodeParameter('email', i);
                              body.firstname = this.getNodeParameter('firstName', i);
                              body.lastname = this.getNodeParameter('lastName', i);
                              body.company = this.getNodeParameter('company', i);
                              body.position = this.getNodeParameter('position', i);
                              body.title = this.getNodeParameter('title', i);
                          }
                          else {
                              const json = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('bodyJson', i));
                              if (json !== undefined) {
                                  body = { ...json };
                              }
                              else {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid JSON', { itemIndex: i });
                              }
                          }
                          if (additionalFields.ipAddress) {
                              body.ipAddress = additionalFields.ipAddress;
                          }
                          if (additionalFields.lastActive) {
                              body.lastActive = additionalFields.lastActive;
                          }
                          if (additionalFields.ownerId) {
                              body.owner = additionalFields.ownerId;
                          }
                          if (additionalFields.addressUi) {
                              const addressValues = additionalFields.addressUi
                                  .addressValues;
                              if (addressValues) {
                                  body.address1 = addressValues.address1;
                                  body.address2 = addressValues.address2;
                                  body.city = addressValues.city;
                                  body.state = addressValues.state;
                                  body.country = addressValues.country;
                                  body.zipcode = addressValues.zipCode;
                              }
                          }
                          if (additionalFields.socialMediaUi) {
                              const socialMediaValues = additionalFields.socialMediaUi
                                  .socialMediaValues;
                              if (socialMediaValues) {
                                  body.facebook = socialMediaValues.facebook;
                                  body.foursquare = socialMediaValues.foursquare;
                                  body.instagram = socialMediaValues.instagram;
                                  body.linkedin = socialMediaValues.linkedIn;
                                  body.skype = socialMediaValues.skype;
                                  body.twitter = socialMediaValues.twitter;
                              }
                          }
                          if (additionalFields.customFieldsUi) {
                              const customFields = additionalFields.customFieldsUi
                                  .customFieldValues;
                              if (customFields) {
                                  const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                                  Object.assign(body, data);
                              }
                          }
                          if (additionalFields.b2bOrb2c) {
                              body.b2b_or_b2c = additionalFields.b2bOrb2c;
                          }
                          if (additionalFields.crmId) {
                              body.crm_id = additionalFields.crmId;
                          }
                          if (additionalFields.fax) {
                              body.fax = additionalFields.fax;
                          }
                          if (additionalFields.hasPurchased) {
                              body.haspurchased = additionalFields.hasPurchased;
                          }
                          if (additionalFields.mobile) {
                              body.mobile = additionalFields.mobile;
                          }
                          if (additionalFields.phone) {
                              body.phone = additionalFields.phone;
                          }
                          if (additionalFields.prospectOrCustomer) {
                              body.prospect_or_customer = additionalFields.prospectOrCustomer;
                          }
                          if (additionalFields.sandbox) {
                              body.sandbox = additionalFields.sandbox;
                          }
                          if (additionalFields.stage) {
                              body.stage = additionalFields.stage;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          if (additionalFields.website) {
                              body.website = additionalFields.website;
                          }
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', '/contacts/new', body);
                          responseData = [responseData.contact];
                          if (options.rawData === false) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'update') {
                          const options = this.getNodeParameter('options', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          let body = {};
                          if (updateFields.email) {
                              body.email = updateFields.email;
                          }
                          if (updateFields.firstName) {
                              body.firstname = updateFields.firstName;
                          }
                          if (updateFields.lastName) {
                              body.lastname = updateFields.lastName;
                          }
                          if (updateFields.company) {
                              body.company = updateFields.company;
                          }
                          if (updateFields.position) {
                              body.position = updateFields.position;
                          }
                          if (updateFields.title) {
                              body.title = updateFields.title;
                          }
                          if (updateFields.bodyJson) {
                              const json = (0, GenericFunctions_1.validateJSON)(updateFields.bodyJson);
                              if (json !== undefined) {
                                  body = { ...json };
                              }
                              else {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid JSON', { itemIndex: i });
                              }
                          }
                          if (updateFields.ipAddress) {
                              body.ipAddress = updateFields.ipAddress;
                          }
                          if (updateFields.lastActive) {
                              body.lastActive = updateFields.lastActive;
                          }
                          if (updateFields.ownerId) {
                              body.owner = updateFields.ownerId;
                          }
                          if (updateFields.addressUi) {
                              const addressValues = updateFields.addressUi
                                  .addressValues;
                              if (addressValues) {
                                  body.address1 = addressValues.address1;
                                  body.address2 = addressValues.address2;
                                  body.city = addressValues.city;
                                  body.state = addressValues.state;
                                  body.country = addressValues.country;
                                  body.zipcode = addressValues.zipCode;
                              }
                          }
                          if (updateFields.socialMediaUi) {
                              const socialMediaValues = updateFields.socialMediaUi
                                  .socialMediaValues;
                              if (socialMediaValues) {
                                  body.facebook = socialMediaValues.facebook;
                                  body.foursquare = socialMediaValues.foursquare;
                                  body.instagram = socialMediaValues.instagram;
                                  body.linkedin = socialMediaValues.linkedIn;
                                  body.skype = socialMediaValues.skype;
                                  body.twitter = socialMediaValues.twitter;
                              }
                          }
                          if (updateFields.customFieldsUi) {
                              const customFields = updateFields.customFieldsUi
                                  .customFieldValues;
                              if (customFields) {
                                  const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.fieldValue }), {});
                                  Object.assign(body, data);
                              }
                          }
                          if (updateFields.b2bOrb2c) {
                              body.b2b_or_b2c = updateFields.b2bOrb2c;
                          }
                          if (updateFields.crmId) {
                              body.crm_id = updateFields.crmId;
                          }
                          if (updateFields.fax) {
                              body.fax = updateFields.fax;
                          }
                          if (updateFields.hasPurchased) {
                              body.haspurchased = updateFields.hasPurchased;
                          }
                          if (updateFields.mobile) {
                              body.mobile = updateFields.mobile;
                          }
                          if (updateFields.phone) {
                              body.phone = updateFields.phone;
                          }
                          if (updateFields.prospectOrCustomer) {
                              body.prospect_or_customer = updateFields.prospectOrCustomer;
                          }
                          if (updateFields.sandbox) {
                              body.sandbox = updateFields.sandbox;
                          }
                          if (updateFields.stage) {
                              body.stage = updateFields.stage;
                          }
                          if (updateFields.tags) {
                              body.tags = updateFields.tags;
                          }
                          if (updateFields.website) {
                              body.website = updateFields.website;
                          }
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'PATCH', `/contacts/${contactId}/edit`, body);
                          responseData = [responseData.contact];
                          if (options.rawData === false) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'get') {
                          const options = this.getNodeParameter('options', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'GET', `/contacts/${contactId}`);
                          responseData = [responseData.contact];
                          if (options.rawData === false) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          qs = Object.assign(qs, options);
                          if (qs.orderBy) {
                              qs.orderBy = (0, change_case_1.snakeCase)(qs.orderBy);
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mauticApiRequestAllItems.call(this, 'contacts', 'GET', '/contacts', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              qs.start = 0;
                              responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'GET', '/contacts', {}, qs);
                              if (responseData.errors) {
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), responseData);
                              }
                              responseData = responseData.contacts;
                              responseData = Object.values(responseData);
                          }
                          if (options.rawData === false) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'delete') {
                          const options = this.getNodeParameter('options', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'DELETE', `/contacts/${contactId}/delete`);
                          responseData = [responseData.contact];
                          if (options.rawData === false) {
                              responseData = responseData.map((item) => item.fields.all);
                          }
                      }
                      if (operation === 'sendEmail') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const campaignEmailId = this.getNodeParameter('campaignEmailId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/emails/${campaignEmailId}/contact/${contactId}/send`);
                      }
                      if (operation === 'editDoNotContactList') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const action = this.getNodeParameter('action', i);
                          const channel = this.getNodeParameter('channel', i);
                          const body = {};
                          if (action === 'add') {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/contacts/${contactId}/dnc/${channel}/${action}`, body);
                          responseData = responseData.contact;
                      }
                      if (operation === 'editContactPoint') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const action = this.getNodeParameter('action', i);
                          const points = this.getNodeParameter('points', i);
                          const path = action === 'add' ? 'plus' : 'minus';
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/contacts/${contactId}/points/${path}/${points}`);
                      }
                  }
                  if (resource === 'contactSegment') {
                      if (operation === 'add') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const segmentId = this.getNodeParameter('segmentId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/segments/${segmentId}/contact/${contactId}/add`);
                      }
                      if (operation === 'remove') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const segmentId = this.getNodeParameter('segmentId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/segments/${segmentId}/contact/${contactId}/remove`);
                      }
                  }
                  if (resource === 'campaignContact') {
                      if (operation === 'add') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const campaignId = this.getNodeParameter('campaignId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/campaigns/${campaignId}/contact/${contactId}/add`);
                      }
                      if (operation === 'remove') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const campaignId = this.getNodeParameter('campaignId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/campaigns/${campaignId}/contact/${contactId}/remove`);
                      }
                  }
                  if (resource === 'segmentEmail') {
                      if (operation === 'send') {
                          const segmentEmailId = this.getNodeParameter('segmentEmailId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/emails/${segmentEmailId}/send`);
                      }
                  }
                  if (resource === 'companyContact') {
                      if (operation === 'add') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const companyId = this.getNodeParameter('companyId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/companies/${companyId}/contact/${contactId}/add`, {});
                      }
                      if (operation === 'remove') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const companyId = this.getNodeParameter('companyId', i);
                          responseData = await GenericFunctions_1.mauticApiRequest.call(this, 'POST', `/companies/${companyId}/contact/${contactId}/remove`, {});
                      }
                  }
                  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.Mautic = Mautic;
  //# sourceMappingURL=Mautic.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Medium
name: Medium
package_name: n8n-nodes-base
display_name: Medium
description: Consume Medium API
code_hash: bdfe9b89bafe735fe0197d624433da4cc151dac20cf5436856ca2885380539f9
source_location: node_modules/n8n-nodes-base/dist/nodes/Medium/Medium.node.js
extracted_at: 2025-06-07 19:36:39
updated_at: 2025-06-07 19:36:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Medium = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Medium {
      constructor() {
          this.description = {
              displayName: 'Medium',
              name: 'medium',
              group: ['output'],
              icon: 'file:medium.png',
              version: 1,
              description: 'Consume Medium API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Medium',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mediumApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'mediumOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Access Token',
                              value: 'accessToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'accessToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Post',
                              value: 'post',
                          },
                          {
                              name: 'Publication',
                              value: 'publication',
                          },
                      ],
                      default: 'post',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['post'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a post',
                              action: 'Create a post',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Publication',
                      name: 'publication',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['post'],
                              operation: ['create'],
                          },
                      },
                      default: false,
                      description: 'Whether you are posting for a publication',
                  },
                  {
                      displayName: 'Publication Name or ID',
                      name: 'publicationId',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resource: ['post'],
                              operation: ['create'],
                              publication: [true],
                          },
                      },
                      typeOptions: {
                          loadOptionsMethod: 'getPublications',
                      },
                      default: '',
                      description: 'Publication IDs. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Title',
                      name: 'title',
                      type: 'string',
                      default: '',
                      placeholder: 'My Open Source Contribution',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['post'],
                          },
                      },
                      description: 'Title of the post. Max Length : 100 characters.',
                  },
                  {
                      displayName: 'Content Format',
                      name: 'contentFormat',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['post'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'HTML',
                              value: 'html',
                          },
                          {
                              name: 'Markdown',
                              value: 'markdown',
                          },
                      ],
                      description: 'The format of the content to be posted',
                  },
                  {
                      displayName: 'Content',
                      name: 'content',
                      type: 'string',
                      default: '',
                      placeholder: 'My open source contribution',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['post'],
                          },
                      },
                      description: 'The body of the post, in a valid semantic HTML fragment, or Markdown',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['post'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Canonical Url',
                              name: 'canonicalUrl',
                              type: 'string',
                              default: '',
                              description: 'The original home of this content, if it was originally published elsewhere',
                          },
                          {
                              displayName: 'License',
                              name: 'license',
                              type: 'options',
                              default: 'all-rights-reserved',
                              options: [
                                  {
                                      name: 'all-rights-reserved',
                                      value: 'all-rights-reserved',
                                  },
                                  {
                                      name: 'cc-40-by',
                                      value: 'cc-40-by',
                                  },
                                  {
                                      name: 'cc-40-by-nc',
                                      value: 'cc-40-by-nc',
                                  },
                                  {
                                      name: 'cc-40-by-nc-nd',
                                      value: 'cc-40-by-nc-nd',
                                  },
                                  {
                                      name: 'cc-40-by-nc-sa',
                                      value: 'cc-40-by-nc-sa',
                                  },
                                  {
                                      name: 'cc-40-by-nd',
                                      value: 'cc-40-by-nd',
                                  },
                                  {
                                      name: 'cc-40-by-sa',
                                      value: 'cc-40-by-sa',
                                  },
                                  {
                                      name: 'cc-40-zero',
                                      value: 'cc-40-zero',
                                  },
                                  {
                                      name: 'public-domain',
                                      value: 'public-domain',
                                  },
                              ],
                              description: 'License of the post',
                          },
                          {
                              displayName: 'Notify Followers',
                              name: 'notifyFollowers',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to notify followers that the user has published',
                          },
                          {
                              displayName: 'Publish Status',
                              name: 'publishStatus',
                              default: 'public',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Public',
                                      value: 'public',
                                  },
                                  {
                                      name: 'Draft',
                                      value: 'draft',
                                  },
                                  {
                                      name: 'Unlisted',
                                      value: 'unlisted',
                                  },
                              ],
                              description: 'The status of the post',
                          },
                          {
                              displayName: 'Tags',
                              name: 'tags',
                              type: 'string',
                              default: '',
                              placeholder: 'open-source,mlh,fellowship',
                              description: 'Comma-separated strings to be used as tags for post classification. Max allowed tags: 5. Max tag length: 25 characters.',
                          },
                      ],
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['publication'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many publications',
                              action: 'Get many publications',
                          },
                      ],
                      default: 'publication',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['publication'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['publication'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 200,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getPublications() {
                      const returnData = [];
                      const user = await GenericFunctions_1.mediumApiRequest.call(this, 'GET', '/me');
                      const userId = user.data.id;
                      const publications = await GenericFunctions_1.mediumApiRequest.call(this, 'GET', `/users/${userId}/publications`);
                      const publicationsList = publications.data;
                      for (const publication of publicationsList) {
                          const publicationName = publication.name;
                          const publicationId = publication.id;
                          returnData.push({
                              name: publicationName,
                              value: publicationId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let operation;
          let resource;
          let bodyRequest;
          let qs;
          let responseData;
          for (let i = 0; i < items.length; i++) {
              qs = {};
              try {
                  resource = this.getNodeParameter('resource', i);
                  operation = this.getNodeParameter('operation', i);
                  if (resource === 'post') {
                      if (operation === 'create') {
                          const title = this.getNodeParameter('title', i);
                          const contentFormat = this.getNodeParameter('contentFormat', i);
                          const content = this.getNodeParameter('content', i);
                          bodyRequest = {
                              tags: [],
                              title,
                              contentFormat,
                              content,
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.tags) {
                              const tags = additionalFields.tags;
                              bodyRequest.tags = tags.split(',').map((name) => {
                                  const returnValue = name.trim();
                                  if (returnValue.length > 25) {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The tag "${returnValue}" is to long. Maximum lenght of a tag is 25 characters.`, { itemIndex: i });
                                  }
                                  return returnValue;
                              });
                              if (bodyRequest.tags.length > 5) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'To many tags got used. Maximum 5 can be set.', { itemIndex: i });
                              }
                          }
                          if (additionalFields.canonicalUrl) {
                              bodyRequest.canonicalUrl = additionalFields.canonicalUrl;
                          }
                          if (additionalFields.publishStatus) {
                              bodyRequest.publishStatus = additionalFields.publishStatus;
                          }
                          if (additionalFields.license) {
                              bodyRequest.license = additionalFields.license;
                          }
                          if (additionalFields.notifyFollowers) {
                              bodyRequest.notifyFollowers = additionalFields.notifyFollowers;
                          }
                          const underPublication = this.getNodeParameter('publication', i);
                          if (underPublication) {
                              const publicationId = this.getNodeParameter('publicationId', i);
                              responseData = await GenericFunctions_1.mediumApiRequest.call(this, 'POST', `/publications/${publicationId}/posts`, bodyRequest, qs);
                          }
                          else {
                              const responseAuthorId = await GenericFunctions_1.mediumApiRequest.call(this, 'GET', '/me', {}, qs);
                              const authorId = responseAuthorId.data.id;
                              responseData = await GenericFunctions_1.mediumApiRequest.call(this, 'POST', `/users/${authorId}/posts`, bodyRequest, qs);
                              responseData = responseData.data;
                          }
                      }
                  }
                  if (resource === 'publication') {
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const user = await GenericFunctions_1.mediumApiRequest.call(this, 'GET', '/me');
                          const userId = user.data.id;
                          responseData = await GenericFunctions_1.mediumApiRequest.call(this, 'GET', `/users/${userId}/publications`);
                          responseData = responseData.data;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Medium = Medium;
  //# sourceMappingURL=Medium.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Merge
name: Merge
package_name: n8n-nodes-base
display_name: Merge
description: Merges data of multiple streams once data from both is available
code_hash: 7ea8c21ecbdf79a2e935cdf1aa4e4c4c9f9c1139d9ffaaea0a767c41878b1ce8
source_location: node_modules/n8n-nodes-base/dist/nodes/Merge/Merge.node.js
extracted_at: 2025-06-07 19:36:39
updated_at: 2025-06-07 19:36:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Merge = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const MergeV1_node_1 = require("./v1/MergeV1.node");
  const MergeV2_node_1 = require("./v2/MergeV2.node");
  class Merge extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Merge',
              name: 'merge',
              icon: 'fa:code-branch',
              group: ['transform'],
              subtitle: '={{$parameter["mode"]}}',
              description: 'Merges data of multiple streams once data from both is available',
              defaultVersion: 2.1,
          };
          const nodeVersions = {
              1: new MergeV1_node_1.MergeV1(baseDescription),
              2: new MergeV2_node_1.MergeV2(baseDescription),
              2.1: new MergeV2_node_1.MergeV2(baseDescription),
              2.2: new MergeV2_node_1.MergeV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.Merge = Merge;
  //# sourceMappingURL=Merge.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.MessageBird
name: MessageBird
package_name: n8n-nodes-base
display_name: MessageBird
description: Sends SMS via MessageBird
code_hash: faf1b5016a688104f7c30fde0b8b2b93731a2df58937aad8efc85e0be6ece42c
source_location: node_modules/n8n-nodes-base/dist/nodes/MessageBird/MessageBird.node.js
extracted_at: 2025-06-07 19:36:39
updated_at: 2025-06-07 19:36:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MessageBird = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class MessageBird {
      constructor() {
          this.description = {
              displayName: 'MessageBird',
              name: 'messageBird',
              icon: 'file:messagebird.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Sends SMS via MessageBird',
              defaults: {
                  name: 'MessageBird',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'messageBirdApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                          {
                              name: 'Balance',
                              value: 'balance',
                          },
                      ],
                      default: 'sms',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send text messages (SMS)',
                              action: 'Send an SMS',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['balance'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the balance',
                              action: 'Get the current balance',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'From',
                      name: 'originator',
                      type: 'string',
                      default: '',
                      placeholder: '14155238886',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The number from which to send the message',
                  },
                  {
                      displayName: 'To',
                      name: 'recipients',
                      type: 'string',
                      default: '',
                      placeholder: '14155238886/+14155238886',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'All recipients separated by commas',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The message to be send',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      placeholder: 'Add Fields',
                      default: {},
                      options: [
                          {
                              displayName: 'Created Date-Time',
                              name: 'createdDatetime',
                              type: 'dateTime',
                              default: '',
                              description: 'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP)',
                          },
                          {
                              displayName: 'Datacoding',
                              name: 'datacoding',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Auto',
                                      value: 'auto',
                                  },
                                  {
                                      name: 'Plain',
                                      value: 'plain',
                                  },
                                  {
                                      name: 'Unicode',
                                      value: 'unicode',
                                  },
                              ],
                              default: '',
                              description: 'Using unicode will limit the maximum number of characters to 70 instead of 160',
                          },
                          {
                              displayName: 'Gateway',
                              name: 'gateway',
                              type: 'number',
                              default: '',
                              description: 'The SMS route that is used to send the message',
                          },
                          {
                              displayName: 'Group IDs',
                              name: 'groupIds',
                              placeholder: '1,2',
                              type: 'string',
                              default: '',
                              description: 'Group IDs separated by commas, If provided recipients can be omitted',
                          },
                          {
                              displayName: 'Message Type',
                              name: 'mclass',
                              type: 'options',
                              placeholder: 'Permissible values from 0-3',
                              options: [
                                  {
                                      name: 'Flash',
                                      value: 1,
                                  },
                                  {
                                      name: 'Normal',
                                      value: 0,
                                  },
                              ],
                              default: 1,
                              description: 'Indicated the message type. 1 is a normal message, 0 is a flash message.',
                          },
                          {
                              displayName: 'Reference',
                              name: 'reference',
                              type: 'string',
                              default: '',
                              description: 'A client reference',
                          },
                          {
                              displayName: 'Report Url',
                              name: 'reportUrl',
                              type: 'string',
                              default: '',
                              description: 'The status report URL to be used on a per-message basis. Reference is required for a status report webhook to be sent.',
                          },
                          {
                              displayName: 'Scheduled Date-Time',
                              name: 'scheduledDatetime',
                              type: 'dateTime',
                              default: '',
                              description: 'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP)',
                          },
                          {
                              displayName: 'Type',
                              name: 'type',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Binary',
                                      value: 'binary',
                                  },
                                  {
                                      name: 'Flash',
                                      value: 'flash',
                                  },
                                  {
                                      name: 'SMS',
                                      value: 'sms',
                                  },
                              ],
                              default: '',
                              description: 'The type of message. Values can be: sms, binary, or flash.',
                          },
                          {
                              displayName: 'Type Details',
                              name: 'typeDetails',
                              type: 'string',
                              default: '',
                              description: 'A hash with extra information. Is only used when a binary message is sent.',
                          },
                          {
                              displayName: 'Validity',
                              name: 'validity',
                              type: 'number',
                              default: 1,
                              typeOptions: {
                                  minValue: 1,
                              },
                              description: 'The amount of seconds that the message is valid',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let operation;
          let resource;
          let bodyRequest = {};
          let qs;
          let requestMethod;
          let requestPath;
          for (let i = 0; i < items.length; i++) {
              qs = {};
              try {
                  resource = this.getNodeParameter('resource', i);
                  operation = this.getNodeParameter('operation', i);
                  if (resource === 'sms') {
                      if (operation === 'send') {
                          requestMethod = 'POST';
                          requestPath = '/messages';
                          const originator = this.getNodeParameter('originator', i);
                          const body = this.getNodeParameter('message', i);
                          bodyRequest = {
                              recipients: [],
                              originator,
                              body,
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.groupIds) {
                              bodyRequest.groupIds = additionalFields.groupIds;
                          }
                          if (additionalFields.type) {
                              bodyRequest.type = additionalFields.type;
                          }
                          if (additionalFields.reference) {
                              bodyRequest.reference = additionalFields.reference;
                          }
                          if (additionalFields.reportUrl) {
                              bodyRequest.reportUrl = additionalFields.reportUrl;
                          }
                          if (additionalFields.validity) {
                              bodyRequest.validity = additionalFields.reportUrl;
                          }
                          if (additionalFields.gateway) {
                              bodyRequest.gateway = additionalFields.gateway;
                          }
                          if (additionalFields.typeDetails) {
                              bodyRequest.typeDetails = additionalFields.typeDetails;
                          }
                          if (additionalFields.datacoding) {
                              bodyRequest.datacoding = additionalFields.datacoding;
                          }
                          if (additionalFields.mclass) {
                              bodyRequest.mclass = additionalFields.mclass;
                          }
                          if (additionalFields.scheduledDatetime) {
                              bodyRequest.scheduledDatetime = additionalFields.scheduledDatetime;
                          }
                          if (additionalFields.createdDatetime) {
                              bodyRequest.createdDatetime = additionalFields.createdDatetime;
                          }
                          const receivers = this.getNodeParameter('recipients', i);
                          bodyRequest.recipients = receivers.split(',').map((item) => {
                              return parseInt(item, 10);
                          });
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'balance') {
                      requestMethod = 'GET';
                      requestPath = '/balance';
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  const responseData = await GenericFunctions_1.messageBirdApiRequest.call(this, requestMethod, requestPath, bodyRequest, qs);
                  returnData.push(responseData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.MessageBird = MessageBird;
  //# sourceMappingURL=MessageBird.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Metabase
name: Metabase
package_name: n8n-nodes-base
display_name: Metabase
description: Use the Metabase API
code_hash: 629de446f4ba15b8957d92fa93685d006e99cb0fee1e36c14a0e40ceeaf99abd
source_location: node_modules/n8n-nodes-base/dist/nodes/Metabase/Metabase.node.js
extracted_at: 2025-06-07 19:36:39
updated_at: 2025-06-07 19:36:39
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Metabase = void 0;
  const QuestionsDescription_1 = require("./QuestionsDescription");
  const MetricsDescription_1 = require("./MetricsDescription");
  const DatabasesDescription_1 = require("./DatabasesDescription");
  const AlertsDescription_1 = require("./AlertsDescription");
  class Metabase {
      constructor() {
          this.description = {
              displayName: 'Metabase',
              name: 'metabase',
              icon: 'file:metabase.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Use the Metabase API',
              defaults: {
                  name: 'Metabase',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'metabaseApi',
                      required: true,
                  },
              ],
              requestDefaults: {
                  returnFullResponse: true,
                  baseURL: '={{$credentials.url.replace(new RegExp("/$"), "")}}',
                  headers: {},
              },
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Alert',
                              value: 'alerts',
                          },
                          {
                              name: 'Database',
                              value: 'databases',
                          },
                          {
                              name: 'Metric',
                              value: 'metrics',
                          },
                          {
                              name: 'Question',
                              value: 'questions',
                          },
                      ],
                      default: 'questions',
                  },
                  ...QuestionsDescription_1.questionsOperations,
                  ...QuestionsDescription_1.questionsFields,
                  ...MetricsDescription_1.metricsOperations,
                  ...MetricsDescription_1.metricsFields,
                  ...DatabasesDescription_1.databasesOperations,
                  ...DatabasesDescription_1.databasesFields,
                  ...AlertsDescription_1.alertsOperations,
                  ...AlertsDescription_1.alertsFields,
              ],
          };
      }
  }
  exports.Metabase = Metabase;
  //# sourceMappingURL=Metabase.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Mindee
name: Mindee
package_name: n8n-nodes-base
display_name: Mindee
description: Consume Mindee API
code_hash: e1b1546baf295f10ce7fdfc174b3cd8ef000536f32d745f5b0220db885ec1fa2
source_location: node_modules/n8n-nodes-base/dist/nodes/Mindee/Mindee.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mindee = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Mindee {
      constructor() {
          this.description = {
              displayName: 'Mindee',
              name: 'mindee',
              icon: 'file:mindee.svg',
              group: ['input'],
              version: [1, 2, 3],
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Mindee API',
              defaults: {
                  name: 'Mindee',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mindeeReceiptApi',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['receipt'],
                          },
                      },
                  },
                  {
                      name: 'mindeeInvoiceApi',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['invoice'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'API Version',
                      name: 'apiVersion',
                      type: 'options',
                      isNodeSetting: true,
                      displayOptions: {
                          show: {
                              '@version': [1],
                          },
                      },
                      options: [
                          {
                              name: '1',
                              value: 1,
                          },
                          {
                              name: '3',
                              value: 3,
                          },
                          {
                              name: '4',
                              value: 4,
                          },
                      ],
                      default: 1,
                      description: 'Which Mindee API Version to use',
                  },
                  {
                      displayName: 'API Version',
                      name: 'apiVersion',
                      type: 'options',
                      isNodeSetting: true,
                      displayOptions: {
                          show: {
                              '@version': [2],
                          },
                      },
                      options: [
                          {
                              name: '1',
                              value: 1,
                          },
                          {
                              name: '3',
                              value: 3,
                          },
                          {
                              name: '4',
                              value: 4,
                          },
                      ],
                      default: 3,
                      description: 'Which Mindee API Version to use',
                  },
                  {
                      displayName: 'API Version',
                      name: 'apiVersion',
                      type: 'options',
                      isNodeSetting: true,
                      displayOptions: {
                          show: {
                              '@version': [3],
                          },
                      },
                      options: [
                          {
                              name: '1',
                              value: 1,
                          },
                          {
                              name: '3',
                              value: 3,
                          },
                          {
                              name: '4',
                              value: 4,
                          },
                      ],
                      default: 4,
                      description: 'Which Mindee API Version to use',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Invoice',
                              value: 'invoice',
                          },
                          {
                              name: 'Receipt',
                              value: 'receipt',
                          },
                      ],
                      default: 'receipt',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Predict',
                              value: 'predict',
                          },
                      ],
                      default: 'predict',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              operation: ['predict'],
                              resource: ['receipt', 'invoice'],
                          },
                      },
                      description: 'Name of the binary property which containsthe data for the file to be uploaded',
                  },
                  {
                      displayName: 'RAW Data',
                      name: 'rawData',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to return the data exactly in the way it got received from the API',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const version = this.getNodeParameter('apiVersion', 0);
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let endpoint;
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'receipt') {
                      if (operation === 'predict') {
                          const rawData = this.getNodeParameter('rawData', i);
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          if (version === 1) {
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', '/expense_receipts/v2/predict', {}, {}, {
                                  formData: {
                                      file: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          else if (version === 3) {
                              endpoint = '/expense_receipts/v3/predict';
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', endpoint, {}, {}, {
                                  formData: {
                                      document: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          else if (version === 4) {
                              endpoint = '/expense_receipts/v4/predict';
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', endpoint, {}, {}, {
                                  formData: {
                                      document: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          if (!rawData) {
                              if (version === 1) {
                                  responseData = (0, GenericFunctions_1.cleanDataPreviousApiVersions)(responseData.predictions);
                              }
                              else if (version === 3 || version === 4) {
                                  responseData = (0, GenericFunctions_1.cleanData)(responseData.document);
                              }
                          }
                      }
                  }
                  if (resource === 'invoice') {
                      if (operation === 'predict') {
                          const rawData = this.getNodeParameter('rawData', i);
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          if (version === 1) {
                              endpoint = '/invoices/v1/predict';
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', endpoint, {}, {}, {
                                  formData: {
                                      file: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          else if (version === 3) {
                              endpoint = '/invoices/v3/predict';
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', endpoint, {}, {}, {
                                  formData: {
                                      document: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          else if (version === 4) {
                              endpoint = '/invoices/v4/predict';
                              responseData = await GenericFunctions_1.mindeeApiRequest.call(this, 'POST', endpoint, {}, {}, {
                                  formData: {
                                      document: {
                                          value: dataBuffer,
                                          options: {
                                              filename: binaryData.fileName,
                                          },
                                      },
                                  },
                              });
                          }
                          else {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid API version');
                          }
                          if (!rawData) {
                              if (version === 1) {
                                  responseData = (0, GenericFunctions_1.cleanDataPreviousApiVersions)(responseData.predictions);
                              }
                              else if (version === 3 || version === 4) {
                                  responseData = (0, GenericFunctions_1.cleanData)(responseData.document);
                              }
                          }
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else if (responseData !== undefined) {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Mindee = Mindee;
  //# sourceMappingURL=Mindee.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Misp
name: Misp
package_name: n8n-nodes-base
display_name: MISP
description: Consume the MISP API
code_hash: 70ea7dbd5226d92f7c70290d0f29ecb75282633ded988db37a2b68e5f40404bd
source_location: node_modules/n8n-nodes-base/dist/nodes/Misp/Misp.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Misp = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class Misp {
      constructor() {
          this.description = {
              displayName: 'MISP',
              name: 'misp',
              icon: 'file:misp.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the MISP API',
              defaults: {
                  name: 'MISP',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mispApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Attribute',
                              value: 'attribute',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Event Tag',
                              value: 'eventTag',
                          },
                          {
                              name: 'Feed',
                              value: 'feed',
                          },
                          {
                              name: 'Galaxy',
                              value: 'galaxy',
                          },
                          {
                              name: 'Noticelist',
                              value: 'noticelist',
                          },
                          {
                              name: 'Organisation',
                              value: 'organisation',
                          },
                          {
                              name: 'Tag',
                              value: 'tag',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                          {
                              name: 'Warninglist',
                              value: 'warninglist',
                          },
                      ],
                      default: 'attribute',
                  },
                  ...descriptions_1.attributeOperations,
                  ...descriptions_1.attributeFields,
                  ...descriptions_1.eventOperations,
                  ...descriptions_1.eventFields,
                  ...descriptions_1.eventTagOperations,
                  ...descriptions_1.eventTagFields,
                  ...descriptions_1.feedOperations,
                  ...descriptions_1.feedFields,
                  ...descriptions_1.galaxyOperations,
                  ...descriptions_1.galaxyFields,
                  ...descriptions_1.noticelistOperations,
                  ...descriptions_1.noticelistFields,
                  ...descriptions_1.organisationOperations,
                  ...descriptions_1.organisationFields,
                  ...descriptions_1.tagOperations,
                  ...descriptions_1.tagFields,
                  ...descriptions_1.userOperations,
                  ...descriptions_1.userFields,
                  ...descriptions_1.warninglistOperations,
                  ...descriptions_1.warninglistFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getOrgs() {
                      const responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/organisations'));
                      return responseData.map((i) => ({ name: i.Organisation.name, value: i.Organisation.id }));
                  },
                  async getSharingGroups() {
                      const responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/sharing_groups'));
                      return responseData.response.map((i) => ({
                          name: i.SharingGroup.name,
                          value: i.SharingGroup.id,
                      }));
                  },
                  async getTags() {
                      const responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/tags'));
                      return responseData.Tag.map((i) => ({ name: i.name, value: i.id }));
                  },
                  async getUsers() {
                      const responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/admin/users'));
                      return responseData.map((i) => ({ name: i.User.email, value: i.User.id }));
                  },
              },
          };
      }
      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 === 'attribute') {
                      if (operation === 'create') {
                          const body = {
                              type: this.getNodeParameter('type', i),
                              value: this.getNodeParameter('value', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          GenericFunctions_1.throwOnMissingSharingGroup.call(this, additionalFields);
                          if (Object.keys(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/attributes/add/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint, body);
                          responseData = responseData.Attribute;
                      }
                      else if (operation === 'delete') {
                          const attributeId = this.getNodeParameter('attributeId', i);
                          const endpoint = `/attributes/delete/${attributeId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const attributeId = this.getNodeParameter('attributeId', i);
                          const endpoint = `/attributes/view/${attributeId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Attribute;
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.mispApiRequestAllItems.call(this, '/attributes');
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          GenericFunctions_1.throwOnMissingSharingGroup.call(this, updateFields);
                          Object.assign(body, updateFields);
                          const attributeId = this.getNodeParameter('attributeId', i);
                          const endpoint = `/attributes/edit/${attributeId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'PUT', endpoint, body);
                          responseData = responseData.Attribute;
                      }
                  }
                  else if (resource === 'event') {
                      if (operation === 'create') {
                          const body = {
                              org_id: this.getNodeParameter('org_id', i),
                              info: this.getNodeParameter('information', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          GenericFunctions_1.throwOnMissingSharingGroup.call(this, additionalFields);
                          if (Object.keys(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', '/events', body);
                          responseData = responseData.Event;
                      }
                      else if (operation === 'delete') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/events/delete/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/events/view/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Event;
                          delete responseData.Attribute;
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.mispApiRequestAllItems.call(this, '/events');
                      }
                      else if (operation === 'publish') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/events/publish/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint);
                      }
                      else if (operation === 'unpublish') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/events/unpublish/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          GenericFunctions_1.throwOnMissingSharingGroup.call(this, updateFields);
                          Object.assign(body, updateFields);
                          const eventId = this.getNodeParameter('eventId', i);
                          const endpoint = `/events/edit/${eventId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'PUT', endpoint, body);
                          responseData = responseData.Event;
                          delete responseData.Attribute;
                      }
                  }
                  else if (resource === 'eventTag') {
                      if (operation === 'add') {
                          const body = {
                              event: this.getNodeParameter('eventId', i),
                              tag: this.getNodeParameter('tagId', i),
                          };
                          const endpoint = '/events/addTag';
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint, body);
                      }
                      else if (operation === 'remove') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const tagId = this.getNodeParameter('tagId', i);
                          const endpoint = `/events/removeTag/${eventId}/${tagId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint);
                      }
                  }
                  else if (resource === 'feed') {
                      if (operation === 'create') {
                          const url = this.getNodeParameter('url', i);
                          GenericFunctions_1.throwOnInvalidUrl.call(this, url);
                          const body = {
                              name: this.getNodeParameter('name', i),
                              provider: this.getNodeParameter('provider', i),
                              url,
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', '/feeds/add', body);
                          responseData = responseData.Feed;
                      }
                      else if (operation === 'disable') {
                          const feedId = this.getNodeParameter('feedId', i);
                          const endpoint = `/feeds/disable/${feedId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint);
                      }
                      else if (operation === 'enable') {
                          const feedId = this.getNodeParameter('feedId', i);
                          const endpoint = `/feeds/enable/${feedId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint);
                      }
                      else if (operation === 'get') {
                          const feedId = this.getNodeParameter('feedId', i);
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', `/feeds/view/${feedId}`);
                          responseData = responseData.Feed;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequestAllItems.call(this, '/feeds'));
                          responseData = responseData.map((entry) => entry.Feed);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          if (updateFields.url) {
                              GenericFunctions_1.throwOnInvalidUrl.call(this, updateFields.url);
                          }
                          Object.assign(body, updateFields);
                          const feedId = this.getNodeParameter('feedId', i);
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'PUT', `/feeds/edit/${feedId}`, body);
                          responseData = responseData.Feed;
                      }
                  }
                  else if (resource === 'galaxy') {
                      if (operation === 'delete') {
                          const galaxyId = this.getNodeParameter('galaxyId', i);
                          const endpoint = `/galaxies/delete/${galaxyId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const galaxyId = this.getNodeParameter('galaxyId', i);
                          const endpoint = `/galaxies/view/${galaxyId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Galaxy;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequestAllItems.call(this, '/galaxies'));
                          responseData = responseData.map((entry) => entry.Galaxy);
                      }
                  }
                  else if (resource === 'noticelist') {
                      if (operation === 'get') {
                          const noticelistId = this.getNodeParameter('noticelistId', i);
                          const endpoint = `/noticelists/view/${noticelistId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Noticelist;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequestAllItems.call(this, '/noticelists'));
                          responseData = responseData.map((entry) => entry.Noticelist);
                      }
                  }
                  else if (resource === 'organisation') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          const endpoint = '/admin/organisations/add';
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', endpoint, body);
                          responseData = responseData.Organisation;
                      }
                      else if (operation === 'delete') {
                          const organisationId = this.getNodeParameter('organisationId', i);
                          const endpoint = `/admin/organisations/delete/${organisationId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const organisationId = this.getNodeParameter('organisationId', i);
                          const endpoint = `/organisations/view/${organisationId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Organisation;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequestAllItems.call(this, '/organisations'));
                          responseData = responseData.map((entry) => entry.Organisation);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          Object.assign(body, updateFields);
                          const organisationId = this.getNodeParameter('organisationId', i);
                          const endpoint = `/admin/organisations/edit/${organisationId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'PUT', endpoint, body);
                          responseData = responseData.Organisation;
                      }
                  }
                  else if (resource === 'tag') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const { colour } = this.getNodeParameter('additionalFields', i);
                          if (colour) {
                              Object.assign(body, {
                                  colour: !colour.startsWith('#') ? `#${colour}` : colour,
                              });
                          }
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', '/tags/add', body);
                          responseData = responseData.Tag;
                      }
                      else if (operation === 'delete') {
                          const tagId = this.getNodeParameter('tagId', i);
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', `/tags/delete/${tagId}`);
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/tags'));
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.Tag.slice(0, limit);
                          }
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          Object.assign(body, updateFields);
                          const { colour, name } = updateFields;
                          Object.assign(body, {
                              ...(name && { name }),
                              ...(colour && { colour: !colour.startsWith('#') ? `#${colour}` : colour }),
                          });
                          const tagId = this.getNodeParameter('tagId', i);
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', `/tags/edit/${tagId}`, body);
                          responseData = responseData.Tag;
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'create') {
                          const body = {
                              email: this.getNodeParameter('email', i),
                              role_id: this.getNodeParameter('role_id', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields)) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'POST', '/admin/users/add', body);
                          responseData = responseData.User;
                      }
                      else if (operation === 'delete') {
                          const userId = this.getNodeParameter('userId', i);
                          const endpoint = `/admin/users/delete/${userId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'DELETE', endpoint);
                      }
                      else if (operation === 'get') {
                          const userId = this.getNodeParameter('userId', i);
                          const endpoint = `/admin/users/view/${userId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.User;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequestAllItems.call(this, '/admin/users'));
                          responseData = responseData.map((entry) => entry.User);
                      }
                      else if (operation === 'update') {
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          GenericFunctions_1.throwOnEmptyUpdate.call(this, resource, updateFields);
                          Object.assign(body, updateFields);
                          const userId = this.getNodeParameter('userId', i);
                          const endpoint = `/admin/users/edit/${userId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'PUT', endpoint, body);
                          responseData = responseData.User;
                      }
                  }
                  else if (resource === 'warninglist') {
                      if (operation === 'get') {
                          const warninglistId = this.getNodeParameter('warninglistId', i);
                          const endpoint = `/warninglists/view/${warninglistId}`;
                          responseData = await GenericFunctions_1.mispApiRequest.call(this, 'GET', endpoint);
                          responseData = responseData.Warninglist;
                      }
                      else if (operation === 'getAll') {
                          responseData = (await GenericFunctions_1.mispApiRequest.call(this, 'GET', '/warninglists'));
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              responseData = responseData.Warninglists.slice(0, limit).map((entry) => entry.Warninglist);
                          }
                          else {
                              responseData = responseData.Warninglists.map((entry) => entry.Warninglist);
                          }
                      }
                  }
              }
              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.Misp = Misp;
  //# sourceMappingURL=Misp.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Mocean
name: Mocean
package_name: n8n-nodes-base
display_name: Mocean
description: Send SMS and voice messages via Mocean
code_hash: bdddaf8866b35055676200185cbfc23b07a661b4300009e3eeacb5ce74fc057e
source_location: node_modules/n8n-nodes-base/dist/nodes/Mocean/Mocean.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Mocean = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Mocean {
      constructor() {
          this.description = {
              displayName: 'Mocean',
              name: 'mocean',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              icon: 'file:mocean.svg',
              group: ['transform'],
              version: 1,
              description: 'Send SMS and voice messages via Mocean',
              defaults: {
                  name: 'Mocean',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'moceanApi',
                      required: true,
                      testedBy: 'moceanApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                          {
                              name: 'Voice',
                              value: 'voice',
                          },
                      ],
                      default: 'sms',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['sms', 'voice'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send SMS/Voice message',
                              action: 'Send an SMS',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'From',
                      name: 'from',
                      type: 'string',
                      default: '',
                      placeholder: 'Sender Number',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms', 'voice'],
                          },
                      },
                      description: 'Number to which to send the message',
                  },
                  {
                      displayName: 'To',
                      name: 'to',
                      type: 'string',
                      default: '',
                      placeholder: 'Receipient number',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms', 'voice'],
                          },
                      },
                      description: 'Number from which to send the message',
                  },
                  {
                      displayName: 'Language',
                      name: 'language',
                      type: 'options',
                      options: [
                          {
                              name: 'Chinese Mandarin (China)',
                              value: 'cmn-CN',
                          },
                          {
                              name: 'English (United Kingdom)',
                              value: 'en-GB',
                          },
                          {
                              name: 'English (United States)',
                              value: 'en-US',
                          },
                          {
                              name: 'Japanese (Japan)',
                              value: 'ja-JP',
                          },
                          {
                              name: 'Korean (Korea)',
                              value: 'ko-KR',
                          },
                      ],
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['voice'],
                          },
                      },
                      default: 'en-US',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      default: '',
                      placeholder: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms', 'voice'],
                          },
                      },
                      description: 'Message to send',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Delivery Report URL',
                              name: 'dlrUrl',
                              type: 'string',
                              default: '',
                              placeholder: '',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              credentialTest: {
                  async moceanApiTest(credential) {
                      const credentials = credential.data;
                      const query = {};
                      query['mocean-api-key'] = credentials['mocean-api-key'];
                      query['mocean-api-secret'] = credentials['mocean-api-secret'];
                      const options = {
                          method: 'GET',
                          qs: query,
                          uri: 'https://rest.moceanapi.com/rest/2/account/balance',
                          json: true,
                      };
                      try {
                          await this.helpers.request(options);
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: `Connection details not valid: ${error.message}`,
                          };
                      }
                      return {
                          status: 'OK',
                          message: 'Authentication successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let endpoint;
          let operation;
          let requestMethod;
          let resource;
          let text;
          let dlrUrl;
          let dataKey;
          let body;
          let qs;
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              body = {};
              qs = {};
              try {
                  resource = this.getNodeParameter('resource', itemIndex, '');
                  operation = this.getNodeParameter('operation', itemIndex, '');
                  text = this.getNodeParameter('message', itemIndex, '');
                  requestMethod = 'POST';
                  body['mocean-from'] = this.getNodeParameter('from', itemIndex, '');
                  body['mocean-to'] = this.getNodeParameter('to', itemIndex, '');
                  if (resource === 'voice') {
                      const language = this.getNodeParameter('language', itemIndex);
                      const command = [
                          {
                              action: 'say',
                              language,
                              text,
                          },
                      ];
                      dataKey = 'voice';
                      body['mocean-command'] = JSON.stringify(command);
                      endpoint = '/rest/2/voice/dial';
                  }
                  else if (resource === 'sms') {
                      dlrUrl = this.getNodeParameter('options.dlrUrl', itemIndex, '');
                      dataKey = 'messages';
                      body['mocean-text'] = text;
                      if (dlrUrl !== '') {
                          body['mocean-dlr-url'] = dlrUrl;
                          body['mocean-dlr-mask'] = '1';
                      }
                      endpoint = '/rest/2/sms';
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource ${resource}`, {
                          itemIndex,
                      });
                  }
                  if (operation === 'send') {
                      const responseData = await GenericFunctions_1.moceanApiRequest.call(this, requestMethod, endpoint, body, qs);
                      for (const item of responseData[dataKey]) {
                          item.type = resource;
                          returnData.push(item);
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation ${operation}`, {
                          itemIndex,
                      });
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Mocean = Mocean;
  //# sourceMappingURL=Mocean.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.MondayCom
name: MondayCom
package_name: n8n-nodes-base
display_name: Monday.com
description: Consume Monday.com API
code_hash: 2d6d2778a0bd18f40f8fe7d6ba9d6fe081f822e1491320263604668ca13d5bb3
source_location: node_modules/n8n-nodes-base/dist/nodes/MondayCom/MondayCom.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MondayCom = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const BoardDescription_1 = require("./BoardDescription");
  const BoardColumnDescription_1 = require("./BoardColumnDescription");
  const BoardGroupDescription_1 = require("./BoardGroupDescription");
  const BoardItemDescription_1 = require("./BoardItemDescription");
  const change_case_1 = require("change-case");
  class MondayCom {
      constructor() {
          this.description = {
              displayName: 'Monday.com',
              name: 'mondayCom',
              icon: 'file:mondayCom.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Monday.com API',
              defaults: {
                  name: 'Monday.com',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mondayComApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'mondayComOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Access Token',
                              value: 'accessToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'accessToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Board',
                              value: 'board',
                          },
                          {
                              name: 'Board Column',
                              value: 'boardColumn',
                          },
                          {
                              name: 'Board Group',
                              value: 'boardGroup',
                          },
                          {
                              name: 'Board Item',
                              value: 'boardItem',
                          },
                      ],
                      default: 'board',
                  },
                  ...BoardDescription_1.boardOperations,
                  ...BoardDescription_1.boardFields,
                  ...BoardColumnDescription_1.boardColumnOperations,
                  ...BoardColumnDescription_1.boardColumnFields,
                  ...BoardGroupDescription_1.boardGroupOperations,
                  ...BoardGroupDescription_1.boardGroupFields,
                  ...BoardItemDescription_1.boardItemOperations,
                  ...BoardItemDescription_1.boardItemFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getBoards() {
                      const returnData = [];
                      const body = {
                          query: `query ($page: Int, $limit: Int) {
  							boards (page: $page, limit: $limit){
  								id
  								description
  								name
  							}
  						}`,
                          variables: {
                              page: 1,
                          },
                      };
                      const boards = await GenericFunctions_1.mondayComApiRequestAllItems.call(this, 'data.boards', body);
                      if (boards === undefined) {
                          return returnData;
                      }
                      for (const board of boards) {
                          const boardName = board.name;
                          const boardId = board.id;
                          const boardDescription = board.description;
                          returnData.push({
                              name: boardName,
                              value: boardId,
                              description: boardDescription,
                          });
                      }
                      return returnData;
                  },
                  async getColumns() {
                      const returnData = [];
                      const boardId = parseInt(this.getCurrentNodeParameter('boardId'), 10);
                      const body = {
                          query: `query ($boardId: [Int]) {
  							boards (ids: $boardId){
  								columns() {
  									id
  									title
  								}
  							}
  						}`,
                          variables: {
                              page: 1,
                              boardId,
                          },
                      };
                      const { data } = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                      if (data === undefined) {
                          return returnData;
                      }
                      const columns = data.boards[0].columns;
                      for (const column of columns) {
                          const columnName = column.title;
                          const columnId = column.id;
                          returnData.push({
                              name: columnName,
                              value: columnId,
                          });
                      }
                      return returnData;
                  },
                  async getGroups() {
                      const returnData = [];
                      const boardId = parseInt(this.getCurrentNodeParameter('boardId'), 10);
                      const body = {
                          query: `query ($boardId: Int!) {
  							boards ( ids: [$boardId]){
  								groups () {
  									id
  									title
  								}
  							}
  						}`,
                          variables: {
                              boardId,
                          },
                      };
                      const { data } = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                      if (data === undefined) {
                          return returnData;
                      }
                      const groups = data.boards[0].groups;
                      for (const group of groups) {
                          const groupName = group.title;
                          const groupId = group.id;
                          returnData.push({
                              name: groupName,
                              value: groupId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'board') {
                      if (operation === 'archive') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const body = {
                              query: `mutation ($id: Int!) {
  									archive_board (board_id: $id) {
  										id
  									}
  								}`,
                              variables: {
                                  id: boardId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.archive_board;
                      }
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const kind = this.getNodeParameter('kind', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              query: `mutation ($name: String!, $kind: BoardKind!, $templateId: Int) {
  									create_board (board_name: $name, board_kind: $kind, template_id: $templateId) {
  										id
  									}
  								}`,
                              variables: {
                                  name,
                                  kind,
                              },
                          };
                          if (additionalFields.templateId) {
                              body.variables.templateId = additionalFields.templateId;
                          }
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.create_board;
                      }
                      if (operation === 'get') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const body = {
                              query: `query ($id: [Int]) {
  									boards (ids: $id){
  										id
  										name
  										description
  										state
  										board_folder_id
  										board_kind
  										owner() {
  											id
  										}
  									}
  								}`,
                              variables: {
                                  id: boardId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.boards;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const body = {
                              query: `query ($page: Int, $limit: Int) {
  									boards (page: $page, limit: $limit){
  										id
  										name
  										description
  										state
  										board_folder_id
  										board_kind
  										owner() {
  											id
  										}
  									}
  								}`,
                              variables: {
                                  page: 1,
                              },
                          };
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mondayComApiRequestAllItems.call(this, 'data.boards', body);
                          }
                          else {
                              body.variables.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                              responseData = responseData.data.boards;
                          }
                      }
                  }
                  if (resource === 'boardColumn') {
                      if (operation === 'create') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const title = this.getNodeParameter('title', i);
                          const columnType = this.getNodeParameter('columnType', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $title: String!, $columnType: ColumnType, $defaults: JSON ) {
  									create_column (board_id: $boardId, title: $title, column_type: $columnType, defaults: $defaults) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  title,
                                  columnType: (0, change_case_1.snakeCase)(columnType),
                              },
                          };
                          if (additionalFields.defaults) {
                              try {
                                  JSON.parse(additionalFields.defaults);
                              }
                              catch (error) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Defauls must be a valid JSON', {
                                      itemIndex: i,
                                  });
                              }
                              body.variables.defaults = JSON.stringify(JSON.parse(additionalFields.defaults));
                          }
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.create_column;
                      }
                      if (operation === 'getAll') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const body = {
                              query: `query ($boardId: [Int]) {
  									boards (ids: $boardId){
  										columns() {
  											id
  											title
  											type
  											settings_str
  											archived
  										}
  									}
  								}`,
                              variables: {
                                  page: 1,
                                  boardId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.boards[0].columns;
                      }
                  }
                  if (resource === 'boardGroup') {
                      if (operation === 'create') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $groupName: String!) {
  									create_group (board_id: $boardId, group_name: $groupName) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  groupName: name,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.create_group;
                      }
                      if (operation === 'delete') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const groupId = this.getNodeParameter('groupId', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $groupId: String!) {
  									delete_group (board_id: $boardId, group_id: $groupId) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  groupId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.delete_group;
                      }
                      if (operation === 'getAll') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const body = {
                              query: `query ($boardId: [Int]) {
  									boards (ids: $boardId, ){
  										id
  										groups() {
  											id
  											title
  											color
  											position
  											archived
  										}
  									}
  								}`,
                              variables: {
                                  boardId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.boards[0].groups;
                      }
                  }
                  if (resource === 'boardItem') {
                      if (operation === 'addUpdate') {
                          const itemId = parseInt(this.getNodeParameter('itemId', i), 10);
                          const value = this.getNodeParameter('value', i);
                          const body = {
                              query: `mutation ($itemId: Int!, $value: String!) {
  									create_update (item_id: $itemId, body: $value) {
  										id
  									}
  								}`,
                              variables: {
                                  itemId,
                                  value,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.create_update;
                      }
                      if (operation === 'changeColumnValue') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const itemId = parseInt(this.getNodeParameter('itemId', i), 10);
                          const columnId = this.getNodeParameter('columnId', i);
                          const value = this.getNodeParameter('value', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $itemId: Int!, $columnId: String!, $value: JSON!) {
  									change_column_value (board_id: $boardId, item_id: $itemId, column_id: $columnId, value: $value) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  itemId,
                                  columnId,
                              },
                          };
                          try {
                              JSON.parse(value);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom Values must be a valid JSON', {
                                  itemIndex: i,
                              });
                          }
                          body.variables.value = JSON.stringify(JSON.parse(value));
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.change_column_value;
                      }
                      if (operation === 'changeMultipleColumnValues') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const itemId = parseInt(this.getNodeParameter('itemId', i), 10);
                          const columnValues = this.getNodeParameter('columnValues', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $itemId: Int!, $columnValues: JSON!) {
  									change_multiple_column_values (board_id: $boardId, item_id: $itemId, column_values: $columnValues) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  itemId,
                              },
                          };
                          try {
                              JSON.parse(columnValues);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom Values must be a valid JSON', {
                                  itemIndex: i,
                              });
                          }
                          body.variables.columnValues = JSON.stringify(JSON.parse(columnValues));
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.change_multiple_column_values;
                      }
                      if (operation === 'create') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const groupId = this.getNodeParameter('groupId', i);
                          const itemName = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              query: `mutation ($boardId: Int!, $groupId: String!, $itemName: String!, $columnValues: JSON) {
  									create_item (board_id: $boardId, group_id: $groupId, item_name: $itemName, column_values: $columnValues) {
  										id
  									}
  								}`,
                              variables: {
                                  boardId,
                                  groupId,
                                  itemName,
                              },
                          };
                          if (additionalFields.columnValues) {
                              try {
                                  JSON.parse(additionalFields.columnValues);
                              }
                              catch (error) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom Values must be a valid JSON', {
                                      itemIndex: i,
                                  });
                              }
                              body.variables.columnValues = JSON.stringify(JSON.parse(additionalFields.columnValues));
                          }
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.create_item;
                      }
                      if (operation === 'delete') {
                          const itemId = parseInt(this.getNodeParameter('itemId', i), 10);
                          const body = {
                              query: `mutation ($itemId: Int!) {
  									delete_item (item_id: $itemId) {
  										id
  									}
  								}`,
                              variables: {
                                  itemId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.delete_item;
                      }
                      if (operation === 'get') {
                          const itemIds = this.getNodeParameter('itemId', i)
                              .split(',')
                              .map((n) => parseInt(n, 10));
                          const body = {
                              query: `query ($itemId: [Int!]){
  									items (ids: $itemId) {
  										id
  										name
  										created_at
  										state
  										column_values() {
  											id
  											text
  											title
  											type
  											value
  											additional_info
  										}
  									}
  								}`,
                              variables: {
                                  itemId: itemIds,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.items;
                      }
                      if (operation === 'getAll') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const groupId = this.getNodeParameter('groupId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const body = {
                              query: `query ($boardId: [Int], $groupId: [String], $page: Int, $limit: Int) {
  									boards (ids: $boardId) {
  										groups (ids: $groupId) {
  											id
  											items(limit: $limit, page: $page) {
  												id
  												name
  												created_at
  												state
  												column_values() {
  													id
  													text
  													title
  													type
  													value
  													additional_info
  												}
  											}
  										}
  									}
  								}`,
                              variables: {
                                  boardId,
                                  groupId,
                              },
                          };
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mondayComApiRequestAllItems.call(this, 'data.boards[0].groups[0].items', body);
                          }
                          else {
                              body.variables.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                              responseData = responseData.data.boards[0].groups[0].items;
                          }
                      }
                      if (operation === 'getByColumnValue') {
                          const boardId = parseInt(this.getNodeParameter('boardId', i), 10);
                          const columnId = this.getNodeParameter('columnId', i);
                          const columnValue = this.getNodeParameter('columnValue', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const body = {
                              query: `query ($boardId: Int!, $columnId: String!, $columnValue: String!, $page: Int, $limit: Int ){
  									items_by_column_values (board_id: $boardId, column_id: $columnId, column_value: $columnValue, page: $page, limit: $limit) {
  										id
  										name
  										created_at
  										state
  										board {
  											id
  										}
  										column_values() {
  											id
  											text
  											title
  											type
  											value
  											additional_info
  										}
  									}
  								}`,
                              variables: {
                                  boardId,
                                  columnId,
                                  columnValue,
                              },
                          };
                          if (returnAll) {
                              responseData = await GenericFunctions_1.mondayComApiRequestAllItems.call(this, 'data.items_by_column_values', body);
                          }
                          else {
                              body.variables.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                              responseData = responseData.data.items_by_column_values;
                          }
                      }
                      if (operation === 'move') {
                          const groupId = this.getNodeParameter('groupId', i);
                          const itemId = parseInt(this.getNodeParameter('itemId', i), 10);
                          const body = {
                              query: `mutation ($groupId: String!, $itemId: Int!) {
  									move_item_to_group (group_id: $groupId, item_id: $itemId) {
  										id
  									}
  								}`,
                              variables: {
                                  groupId,
                                  itemId,
                              },
                          };
                          responseData = await GenericFunctions_1.mondayComApiRequest.call(this, body);
                          responseData = responseData.data.move_item_to_group;
                      }
                  }
                  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.MondayCom = MondayCom;
  //# sourceMappingURL=MondayCom.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.MongoDb
name: MongoDb
package_name: n8n-nodes-base
display_name: MongoDB
description: Find, insert and update documents in MongoDB
code_hash: b2ba16dd51375f7dbee76439f8443f7c8377528cce99ef36d8b45f549e6b6471
source_location: node_modules/n8n-nodes-base/dist/nodes/MongoDb/MongoDb.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MongoDb = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const mongodb_1 = require("mongodb");
  const MongoDbProperties_1 = require("./MongoDbProperties");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utilities_1 = require("../../utils/utilities");
  class MongoDb {
      constructor() {
          this.description = {
              displayName: 'MongoDB',
              name: 'mongoDb',
              icon: 'file:mongodb.svg',
              group: ['input'],
              version: 1,
              description: 'Find, insert and update documents in MongoDB',
              defaults: {
                  name: 'MongoDB',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'mongoDb',
                      required: true,
                      testedBy: 'mongoDbCredentialTest',
                  },
              ],
              properties: MongoDbProperties_1.nodeProperties,
          };
          this.methods = {
              credentialTest: {
                  async mongoDbCredentialTest(credential) {
                      const credentials = credential.data;
                      try {
                          const database = (credentials.database || '').trim();
                          let connectionString = '';
                          if (credentials.configurationType === 'connectionString') {
                              connectionString = (credentials.connectionString || '').trim();
                          }
                          else {
                              connectionString = (0, GenericFunctions_1.buildParameterizedConnString)(credentials);
                          }
                          const client = await mongodb_1.MongoClient.connect(connectionString);
                          const { databases } = await client.db().admin().listDatabases();
                          if (!databases.map((db) => db.name).includes(database)) {
                              throw new Error(`Database "${database}" does not exist`);
                          }
                          await client.close();
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          const { database, connectionString } = (0, GenericFunctions_1.validateAndResolveMongoCredentials)(this, await this.getCredentials('mongoDb'));
          const client = await mongodb_1.MongoClient.connect(connectionString);
          const mdb = client.db(database);
          const returnItems = [];
          let responseData = [];
          const items = this.getInputData();
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'aggregate') {
              try {
                  const queryParameter = JSON.parse(this.getNodeParameter('query', 0));
                  if (queryParameter._id && typeof queryParameter._id === 'string') {
                      queryParameter._id = new mongodb_1.ObjectId(queryParameter._id);
                  }
                  const query = mdb
                      .collection(this.getNodeParameter('collection', 0))
                      .aggregate(queryParameter);
                  responseData = await query.toArray();
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      responseData = [{ error: error.message }];
                  }
                  else {
                      throw error;
                  }
              }
          }
          else if (operation === 'delete') {
              try {
                  const { deletedCount } = await mdb
                      .collection(this.getNodeParameter('collection', 0))
                      .deleteMany(JSON.parse(this.getNodeParameter('query', 0)));
                  responseData = [{ deletedCount }];
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      responseData = [{ error: error.message }];
                  }
                  else {
                      throw error;
                  }
              }
          }
          else if (operation === 'find') {
              try {
                  const queryParameter = JSON.parse(this.getNodeParameter('query', 0));
                  if (queryParameter._id && typeof queryParameter._id === 'string') {
                      queryParameter._id = new mongodb_1.ObjectId(queryParameter._id);
                  }
                  let query = mdb
                      .collection(this.getNodeParameter('collection', 0))
                      .find(queryParameter);
                  const options = this.getNodeParameter('options', 0);
                  const limit = options.limit;
                  const skip = options.skip;
                  const sort = options.sort && JSON.parse(options.sort);
                  if (skip > 0) {
                      query = query.skip(skip);
                  }
                  if (limit > 0) {
                      query = query.limit(limit);
                  }
                  if (sort && Object.keys(sort).length !== 0 && sort.constructor === Object) {
                      query = query.sort(sort);
                  }
                  const queryResult = await query.toArray();
                  responseData = queryResult;
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      responseData = [{ error: error.message }];
                  }
                  else {
                      throw error;
                  }
              }
          }
          else if (operation === 'findOneAndReplace') {
              const fields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('fields', 0));
              const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false);
              const dateFields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('options.dateFields', 0, ''));
              const updateKey = (this.getNodeParameter('updateKey', 0) || '').trim();
              const updateOptions = this.getNodeParameter('upsert', 0)
                  ? { upsert: true }
                  : undefined;
              const updateItems = (0, GenericFunctions_1.prepareItems)(items, fields, updateKey, useDotNotation, dateFields);
              for (const item of updateItems) {
                  try {
                      const filter = { [updateKey]: item[updateKey] };
                      if (updateKey === '_id') {
                          filter[updateKey] = new mongodb_1.ObjectId(item[updateKey]);
                          delete item._id;
                      }
                      await mdb
                          .collection(this.getNodeParameter('collection', 0))
                          .findOneAndReplace(filter, item, updateOptions);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          item.json = { error: error.message };
                          continue;
                      }
                      throw error;
                  }
              }
              responseData = updateItems;
          }
          else if (operation === 'findOneAndUpdate') {
              const fields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('fields', 0));
              const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false);
              const dateFields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('options.dateFields', 0, ''));
              const updateKey = (this.getNodeParameter('updateKey', 0) || '').trim();
              const updateOptions = this.getNodeParameter('upsert', 0)
                  ? { upsert: true }
                  : undefined;
              const updateItems = (0, GenericFunctions_1.prepareItems)(items, fields, updateKey, useDotNotation, dateFields);
              for (const item of updateItems) {
                  try {
                      const filter = { [updateKey]: item[updateKey] };
                      if (updateKey === '_id') {
                          filter[updateKey] = new mongodb_1.ObjectId(item[updateKey]);
                          delete item._id;
                      }
                      await mdb
                          .collection(this.getNodeParameter('collection', 0))
                          .findOneAndUpdate(filter, { $set: item }, updateOptions);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          item.json = { error: error.message };
                          continue;
                      }
                      throw error;
                  }
              }
              responseData = updateItems;
          }
          else if (operation === 'insert') {
              try {
                  const fields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('fields', 0));
                  const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false);
                  const dateFields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('options.dateFields', 0, ''));
                  const insertItems = (0, GenericFunctions_1.prepareItems)(items, fields, '', useDotNotation, dateFields);
                  const { insertedIds } = await mdb
                      .collection(this.getNodeParameter('collection', 0))
                      .insertMany(insertItems);
                  for (const i of Object.keys(insertedIds)) {
                      responseData.push({
                          ...insertItems[parseInt(i, 10)],
                          id: insertedIds[parseInt(i, 10)],
                      });
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      responseData = [{ error: error.message }];
                  }
                  else {
                      throw error;
                  }
              }
          }
          else if (operation === 'update') {
              const fields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('fields', 0));
              const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false);
              const dateFields = (0, GenericFunctions_1.prepareFields)(this.getNodeParameter('options.dateFields', 0, ''));
              const updateKey = (this.getNodeParameter('updateKey', 0) || '').trim();
              const updateOptions = this.getNodeParameter('upsert', 0)
                  ? { upsert: true }
                  : undefined;
              const updateItems = (0, GenericFunctions_1.prepareItems)(items, fields, updateKey, useDotNotation, dateFields);
              for (const item of updateItems) {
                  try {
                      const filter = { [updateKey]: item[updateKey] };
                      if (updateKey === '_id') {
                          filter[updateKey] = new mongodb_1.ObjectId(item[updateKey]);
                          delete item._id;
                      }
                      await mdb
                          .collection(this.getNodeParameter('collection', 0))
                          .updateOne(filter, { $set: item }, updateOptions);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          item.json = { error: error.message };
                          continue;
                      }
                      throw error;
                  }
              }
              responseData = updateItems;
          }
          else {
              if (this.continueOnFail()) {
                  responseData = [{ error: `The operation "${operation}" is not supported!` }];
              }
              else {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`, { itemIndex: 0 });
              }
          }
          await client.close();
          (0, GenericFunctions_1.stringifyObjectIDs)(responseData);
          const itemData = (0, utilities_1.generatePairedItemData)(items.length);
          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData });
          returnItems.push(...executionData);
          return [returnItems];
      }
  }
  exports.MongoDb = MongoDb;
  //# sourceMappingURL=MongoDb.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.MonicaCrm
name: MonicaCrm
package_name: n8n-nodes-base
display_name: Monica CRM
description: Consume the Monica CRM API
code_hash: 0db18b80574c5a1563944176ada3f2416c35261c67a5e76e2b90db7993bcbf90
source_location: node_modules/n8n-nodes-base/dist/nodes/MonicaCrm/MonicaCrm.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MonicaCrm = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class MonicaCrm {
      constructor() {
          this.description = {
              displayName: 'Monica CRM',
              name: 'monicaCrm',
              icon: 'file:monicaCrm.png',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Monica CRM API',
              defaults: {
                  name: 'Monica CRM',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'monicaCrmApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Activity',
                              value: 'activity',
                          },
                          {
                              name: 'Call',
                              value: 'call',
                          },
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                          {
                              name: 'Contact Field',
                              value: 'contactField',
                          },
                          {
                              name: 'Contact Tag',
                              value: 'contactTag',
                          },
                          {
                              name: 'Conversation',
                              value: 'conversation',
                          },
                          {
                              name: 'Conversation Message',
                              value: 'conversationMessage',
                          },
                          {
                              name: 'Journal Entry',
                              value: 'journalEntry',
                          },
                          {
                              name: 'Note',
                              value: 'note',
                          },
                          {
                              name: 'Reminder',
                              value: 'reminder',
                          },
                          {
                              name: 'Tag',
                              value: 'tag',
                          },
                          {
                              name: 'Task',
                              value: 'task',
                          },
                      ],
                      default: 'contact',
                  },
                  ...descriptions_1.activityOperations,
                  ...descriptions_1.activityFields,
                  ...descriptions_1.callOperations,
                  ...descriptions_1.callFields,
                  ...descriptions_1.contactOperations,
                  ...descriptions_1.contactFields,
                  ...descriptions_1.contactFieldOperations,
                  ...descriptions_1.contactFieldFields,
                  ...descriptions_1.contactTagOperations,
                  ...descriptions_1.contactTagFields,
                  ...descriptions_1.conversationOperations,
                  ...descriptions_1.conversationFields,
                  ...descriptions_1.conversationMessageOperations,
                  ...descriptions_1.conversationMessageFields,
                  ...descriptions_1.journalEntryOperations,
                  ...descriptions_1.journalEntryFields,
                  ...descriptions_1.noteOperations,
                  ...descriptions_1.noteFields,
                  ...descriptions_1.reminderOperations,
                  ...descriptions_1.reminderFields,
                  ...descriptions_1.tagOperations,
                  ...descriptions_1.tagFields,
                  ...descriptions_1.taskOperations,
                  ...descriptions_1.taskFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getActivityTypes() {
                      const responseData = (await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', '/activitytypes'));
                      return (0, GenericFunctions_1.toOptions)(responseData);
                  },
                  async getTagsToAdd() {
                      const responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/tags', {}, {}, { forLoader: true });
                      return responseData.map(({ name }) => ({ value: name, name }));
                  },
                  async getTagsToRemove() {
                      const responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/tags', {}, {}, { forLoader: true });
                      return responseData.map(({ id, name }) => ({ value: id, name }));
                  },
                  async getContactFieldTypes() {
                      const responseData = (await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', '/contactfieldtypes'));
                      return (0, GenericFunctions_1.toOptions)(responseData);
                  },
                  async getGenders() {
                      const responseData = (await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', '/genders'));
                      return (0, GenericFunctions_1.toOptions)(responseData);
                  },
              },
          };
      }
      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 === 'activity') {
                      if (operation === 'create') {
                          const contacts = this.getNodeParameter('contacts', i);
                          const happenedAt = this.getNodeParameter('happenedAt', i);
                          const body = {
                              activity_type_id: this.getNodeParameter('activityTypeId', i),
                              contacts: contacts.split(','),
                              happened_at: happenedAt.split('T')[0],
                              summary: this.getNodeParameter('summary', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/activities', body);
                      }
                      else if (operation === 'delete') {
                          const activityId = this.getNodeParameter('activityId', i);
                          const endpoint = `/activities/${activityId}`;
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const activityId = this.getNodeParameter('activityId', i);
                          const endpoint = `/activities/${activityId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const endpoint = '/activities';
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const activityId = this.getNodeParameter('activityId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/activities/${activityId}`);
                          const body = {
                              activity_type_id: data.activity_type.id,
                              contacts: data.attendees.contacts.map((contact) => contact.id),
                              happened_at: data.happened_at,
                              summary: data.summary,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          body.happened_at = body.happened_at.split('T')[0];
                          if (typeof body.contacts === 'string') {
                              body.contacts = body.contacts.split(',');
                          }
                          const endpoint = `/activities/${activityId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'call') {
                      if (operation === 'create') {
                          const body = {
                              called_at: this.getNodeParameter('calledAt', i),
                              contact_id: this.getNodeParameter('contactId', i),
                              content: this.getNodeParameter('content', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/calls', body);
                      }
                      else if (operation === 'delete') {
                          const callId = this.getNodeParameter('callId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', `/calls/${callId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const callId = this.getNodeParameter('callId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/calls/${callId}`);
                      }
                      else if (operation === 'getAll') {
                          const endpoint = '/calls';
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const callId = this.getNodeParameter('callId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/calls/${callId}`);
                          const body = {
                              called_at: data.called_at,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', `/calls/${callId}`, body);
                      }
                  }
                  else if (resource === 'contact') {
                      if (operation === 'create') {
                          const body = {
                              first_name: this.getNodeParameter('firstName', i),
                              gender_id: this.getNodeParameter('genderId', i),
                          };
                          const { isDeceased = false, deceasedDate, birthdate, ...rest } = this.getNodeParameter('additionalFields', i);
                          body.is_birthdate_known = false;
                          body.is_deceased = isDeceased;
                          body.is_deceased_date_known = false;
                          if (birthdate) {
                              body.is_birthdate_known = true;
                              const [day, month, year] = (0, GenericFunctions_1.getDateParts)(birthdate);
                              body.birthdate_day = day;
                              body.birthdate_month = month;
                              body.birthdate_year = year;
                          }
                          if (deceasedDate) {
                              body.is_deceased = true;
                              body.is_deceased_date_known = true;
                              const [day, month, year] = (0, GenericFunctions_1.getDateParts)(deceasedDate);
                              body.deceased_date_day = day;
                              body.deceased_date_month = month;
                              body.deceased_date_year = year;
                          }
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/contacts', body);
                      }
                      else if (operation === 'delete') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const endpoint = `/contacts/${contactId}`;
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const endpoint = `/contacts/${contactId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.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.monicaCrmApiRequestAllItems.call(this, 'GET', '/contacts', {}, qs);
                      }
                      else if (operation === 'update') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/contacts/${contactId}`);
                          const body = {
                              first_name: data.first_name,
                          };
                          const { is_deaceased = false, deceased_date, birthdate, ...rest } = this.getNodeParameter('updateFields', i);
                          body.is_birthdate_known = false;
                          body.is_deceased = is_deaceased;
                          body.is_deceased_date_known = false;
                          if (birthdate) {
                              body.is_birthdate_known = true;
                              const [day, month, year] = (0, GenericFunctions_1.getDateParts)(birthdate);
                              body.birthdate_day = day;
                              body.birthdate_month = month;
                              body.birthdate_year = year;
                          }
                          if (deceased_date) {
                              body.is_deceased = true;
                              body.is_deceased_date_known = true;
                              const [day, month, year] = (0, GenericFunctions_1.getDateParts)(deceased_date);
                              body.deceased_date_day = day;
                              body.deceased_date_month = month;
                              body.deceased_date_year = year;
                          }
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          const endpoint = `/contacts/${contactId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'contactField') {
                      if (operation === 'create') {
                          const body = {
                              contact_field_type_id: this.getNodeParameter('contactFieldTypeId', i),
                              contact_id: this.getNodeParameter('contactId', i),
                              data: this.getNodeParameter('data', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/contactfields', body);
                      }
                      else if (operation === 'delete') {
                          const contactFieldId = this.getNodeParameter('contactFieldId', i);
                          const endpoint = `/contactfields/${contactFieldId}`;
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const contactFieldId = this.getNodeParameter('contactFieldId', i);
                          const endpoint = `/contactfields/${contactFieldId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const endpoint = `/contact/${contactId}/contactfields`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const body = {
                              contact_field_type_id: this.getNodeParameter('contactFieldTypeId', i),
                              contact_id: this.getNodeParameter('contactId', i),
                              data: this.getNodeParameter('data', i),
                          };
                          const contactFieldId = this.getNodeParameter('contactFieldId', i);
                          const endpoint = `/contactfields/${contactFieldId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'contactTag') {
                      if (operation === 'add') {
                          const body = {
                              tags: this.getNodeParameter('tagsToAdd', i),
                          };
                          const contactId = this.getNodeParameter('contactId', i);
                          const endpoint = `/contacts/${contactId}/setTags`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', endpoint, body);
                      }
                      else if (operation === 'remove') {
                          const body = {
                              tags: this.getNodeParameter('tagsToRemove', i),
                          };
                          const contactId = this.getNodeParameter('contactId', i);
                          const endpoint = `/contacts/${contactId}/unsetTag`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', endpoint, body);
                      }
                  }
                  else if (resource === 'conversation') {
                      if (operation === 'create') {
                          const body = {
                              contact_field_type_id: this.getNodeParameter('contactFieldTypeId', i),
                              contact_id: this.getNodeParameter('contactId', i),
                              happened_at: this.getNodeParameter('happenedAt', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/conversations', body);
                      }
                      else if (operation === 'delete') {
                          const conversationId = this.getNodeParameter('conversationId', i);
                          const endpoint = `/conversations/${conversationId}`;
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const conversationId = this.getNodeParameter('conversationId', i);
                          const endpoint = `/conversations/${conversationId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const body = {
                              contact_field_type_id: this.getNodeParameter('contactFieldTypeId', i),
                              happened_at: this.getNodeParameter('happenedAt', i),
                          };
                          const conversationId = this.getNodeParameter('conversationId', i);
                          const endpoint = `/conversations/${conversationId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'conversationMessage') {
                      if (operation === 'add') {
                          const conversationId = this.getNodeParameter('conversationId', i);
                          const endpoint = `/conversations/${conversationId}/messages`;
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/conversations/${conversationId}`);
                          const body = {
                              contact_id: data.contact.id,
                              content: this.getNodeParameter('content', i),
                              written_at: this.getNodeParameter('writtenAt', i),
                              written_by_me: this.getNodeParameter('writtenByMe', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', endpoint, body);
                      }
                      else if (operation === 'update') {
                          const conversationId = this.getNodeParameter('conversationId', i);
                          const messageId = this.getNodeParameter('messageId', i);
                          const endpoint = `/conversations/${conversationId}/messages/${messageId}`;
                          const updateFields = this.getNodeParameter('updateFields', i, {});
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/conversations/${conversationId}`);
                          const message = data.messages.filter((entry) => entry.id === parseInt(messageId, 10))[0];
                          const body = {
                              contact_id: data.contact.id,
                              content: message.content,
                              written_at: message.written_at,
                              written_by_me: message.written_by_me,
                          };
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'journalEntry') {
                      if (operation === 'create') {
                          const body = {
                              title: this.getNodeParameter('title', i),
                              post: this.getNodeParameter('post', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/journal', body);
                      }
                      else if (operation === 'delete') {
                          const journalId = this.getNodeParameter('journalId', i);
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', `/journal/${journalId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const journalId = this.getNodeParameter('journalId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/journal/${journalId}`);
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/journal');
                      }
                      else if (operation === 'update') {
                          const journalId = this.getNodeParameter('journalId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/journal/${journalId}`);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              post: data.post,
                              title: data.title,
                          };
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', `/journal/${journalId}`, body);
                      }
                  }
                  else if (resource === 'note') {
                      if (operation === 'create') {
                          const body = {
                              body: this.getNodeParameter('body', i),
                              contact_id: this.getNodeParameter('contactId', i),
                          };
                          body.is_favorited = this.getNodeParameter('additionalFields.isFavorited', i, false);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/notes', body);
                      }
                      else if (operation === 'delete') {
                          const noteId = this.getNodeParameter('noteId', i);
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', `/notes/${noteId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const noteId = this.getNodeParameter('noteId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/notes/${noteId}`);
                      }
                      else if (operation === 'getAll') {
                          const endpoint = '/notes';
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const noteId = this.getNodeParameter('noteId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/notes/${noteId}`);
                          const body = {
                              body: data.body,
                              contact_id: data.contact.id,
                          };
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', `/notes/${noteId}`, body);
                      }
                  }
                  else if (resource === 'reminder') {
                      if (operation === 'create') {
                          const initialDate = this.getNodeParameter('initialDate', i);
                          const body = {
                              contact_id: this.getNodeParameter('contactId', i),
                              frequency_type: this.getNodeParameter('frequencyType', i),
                              frequency_number: this.getNodeParameter('frequencyNumber', i, 1),
                              initial_date: initialDate.split('T')[0],
                              title: this.getNodeParameter('title', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/reminders', body);
                      }
                      else if (operation === 'delete') {
                          const reminderId = this.getNodeParameter('reminderId', i);
                          const endpoint = `/reminders/${reminderId}`;
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const reminderId = this.getNodeParameter('reminderId', i);
                          const endpoint = `/reminders/${reminderId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/reminders');
                      }
                      else if (operation === 'update') {
                          const reminderId = this.getNodeParameter('reminderId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/reminders/${reminderId}`);
                          const body = {
                              contact_id: data.contact.id,
                              frequency_type: data.frequency_type,
                              frequency_number: data.frequency_number,
                              initial_date: data.initial_date,
                              title: data.title,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          body.initial_date = body.initial_date.split('T')[0];
                          const endpoint = `/reminders/${reminderId}`;
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', endpoint, body);
                      }
                  }
                  else if (resource === 'tag') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/tags', body);
                      }
                      else if (operation === 'delete') {
                          const tagId = this.getNodeParameter('tagId', i);
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', `/tags/${tagId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const tagId = this.getNodeParameter('tagId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/tags/${tagId}`);
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', '/tags');
                      }
                      else if (operation === 'update') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const tagId = this.getNodeParameter('tagId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', `/tags/${tagId}`, body);
                      }
                  }
                  else if (resource === 'task') {
                      if (operation === 'create') {
                          const body = {
                              contact_id: this.getNodeParameter('contactId', i),
                              title: this.getNodeParameter('title', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(additionalFields).length) {
                              Object.assign(body, additionalFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'POST', '/tasks', body);
                      }
                      else if (operation === 'delete') {
                          const taskId = this.getNodeParameter('taskId', i);
                          await GenericFunctions_1.monicaCrmApiRequest.call(this, 'DELETE', `/tasks/${taskId}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const taskId = this.getNodeParameter('taskId', i);
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/tasks/${taskId}`);
                      }
                      else if (operation === 'getAll') {
                          const endpoint = '/tasks';
                          responseData = await GenericFunctions_1.monicaCrmApiRequestAllItems.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'update') {
                          const taskId = this.getNodeParameter('taskId', i);
                          const { data } = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'GET', `/tasks/${taskId}`);
                          const body = {
                              contact_id: data.contact.id,
                              title: data.title,
                              completed: data.completed,
                          };
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (Object.keys(updateFields).length) {
                              Object.assign(body, updateFields);
                          }
                          responseData = await GenericFunctions_1.monicaCrmApiRequest.call(this, 'PUT', `/tasks/${taskId}`, 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;
              }
              if (['create', 'get', 'update', 'add'].includes(operation)) {
                  responseData = responseData.data;
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.MonicaCrm = MonicaCrm;
  //# sourceMappingURL=MonicaCrm.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.MoveBinaryData
name: MoveBinaryData
package_name: n8n-nodes-base
display_name: Convert to/from binary data
description: Move data between binary and JSON properties
code_hash: ab3fdb9328e05205e42d286ec989c12c8f2379707d331ec8ad0731004bdbbd48
source_location: node_modules/n8n-nodes-base/dist/nodes/MoveBinaryData/MoveBinaryData.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
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.MoveBinaryData = void 0;
  const get_1 = __importDefault(require("lodash/get"));
  const set_1 = __importDefault(require("lodash/set"));
  const unset_1 = __importDefault(require("lodash/unset"));
  const pretty_bytes_1 = __importDefault(require("pretty-bytes"));
  const n8n_workflow_1 = require("n8n-workflow");
  const iconv_lite_1 = __importDefault(require("iconv-lite"));
  iconv_lite_1.default.encodingExists('utf8');
  const bomAware = [];
  const encodeDecodeOptions = [];
  const encodings = iconv_lite_1.default.encodings;
  Object.keys(encodings).forEach((encoding) => {
      if (!(encoding.startsWith('_') || typeof encodings[encoding] === 'string')) {
          if (encodings[encoding].bomAware) {
              bomAware.push(encoding);
          }
          encodeDecodeOptions.push({ name: encoding, value: encoding });
      }
  });
  encodeDecodeOptions.sort((a, b) => {
      if (a.name < b.name) {
          return -1;
      }
      if (a.name > b.name) {
          return 1;
      }
      return 0;
  });
  class MoveBinaryData {
      constructor() {
          this.description = {
              displayName: 'Convert to/from binary data',
              name: 'moveBinaryData',
              icon: 'fa:exchange-alt',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["mode"]==="binaryToJson" ? "Binary to JSON" : "JSON to Binary"}}',
              description: 'Move data between binary and JSON properties',
              defaults: {
                  name: 'Convert to/from binary data',
                  color: '#7722CC',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      options: [
                          {
                              name: 'Binary to JSON',
                              value: 'binaryToJson',
                              description: 'Move data from Binary to JSON',
                          },
                          {
                              name: 'JSON to Binary',
                              value: 'jsonToBinary',
                              description: 'Move data from JSON to Binary',
                          },
                      ],
                      default: 'binaryToJson',
                      description: 'From and to where data should be moved',
                  },
                  {
                      displayName: 'Set All Data',
                      name: 'setAllData',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              mode: ['binaryToJson'],
                          },
                      },
                      default: true,
                      description: 'Whether all JSON data should be replaced with the data retrieved from binary key. Else the data will be written to a single key.',
                  },
                  {
                      displayName: 'Source Key',
                      name: 'sourceKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['binaryToJson'],
                          },
                      },
                      default: 'data',
                      required: true,
                      placeholder: 'data',
                      description: 'The name of the binary key to get data from. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.currentKey".',
                  },
                  {
                      displayName: 'Destination Key',
                      name: 'destinationKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['binaryToJson'],
                              setAllData: [false],
                          },
                      },
                      default: 'data',
                      required: true,
                      placeholder: '',
                      description: 'The name the JSON key to copy data to. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.newKey".',
                  },
                  {
                      displayName: 'Convert All Data',
                      name: 'convertAllData',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              mode: ['jsonToBinary'],
                          },
                      },
                      default: true,
                      description: 'Whether all JSON data should be converted to binary. Else only the data of one key will be converted.',
                  },
                  {
                      displayName: 'Source Key',
                      name: 'sourceKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              convertAllData: [false],
                              mode: ['jsonToBinary'],
                          },
                      },
                      default: 'data',
                      required: true,
                      placeholder: 'data',
                      description: 'The name of the JSON key to get data from. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.currentKey".',
                  },
                  {
                      displayName: 'Destination Key',
                      name: 'destinationKey',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['jsonToBinary'],
                          },
                      },
                      default: 'data',
                      required: true,
                      placeholder: 'data',
                      description: 'The name the binary key to copy data to. It is also possible to define deep keys by using dot-notation like for example: "level1.level2.newKey".',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Data Is Base64',
                              name: 'dataIsBase64',
                              type: 'boolean',
                              displayOptions: {
                                  hide: {
                                      useRawData: [true],
                                  },
                                  show: {
                                      '/mode': ['jsonToBinary'],
                                      '/convertAllData': [false],
                                  },
                              },
                              default: false,
                              description: 'Whether to keep the binary data as base64 string',
                          },
                          {
                              displayName: 'Encoding',
                              name: 'encoding',
                              type: 'options',
                              options: encodeDecodeOptions,
                              displayOptions: {
                                  show: {
                                      '/mode': ['binaryToJson', 'jsonToBinary'],
                                  },
                              },
                              default: 'utf8',
                              description: 'Set the encoding of the data stream',
                          },
                          {
                              displayName: 'Strip BOM',
                              name: 'stripBOM',
                              displayOptions: {
                                  show: {
                                      '/mode': ['binaryToJson'],
                                      encoding: bomAware,
                                  },
                              },
                              type: 'boolean',
                              default: true,
                          },
                          {
                              displayName: 'Add BOM',
                              name: 'addBOM',
                              displayOptions: {
                                  show: {
                                      '/mode': ['jsonToBinary'],
                                      encoding: bomAware,
                                  },
                              },
                              type: 'boolean',
                              default: false,
                          },
                          {
                              displayName: 'File Name',
                              name: 'fileName',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/mode': ['jsonToBinary'],
                                  },
                              },
                              default: '',
                              placeholder: 'example.json',
                              description: 'The file name to set',
                          },
                          {
                              displayName: 'JSON Parse',
                              name: 'jsonParse',
                              type: 'boolean',
                              displayOptions: {
                                  hide: {
                                      keepAsBase64: [true],
                                  },
                                  show: {
                                      '/mode': ['binaryToJson'],
                                      '/setAllData': [false],
                                  },
                              },
                              default: false,
                              description: 'Whether to run JSON parse on the data to get proper object data',
                          },
                          {
                              displayName: 'Keep Source',
                              name: 'keepSource',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the source key should be kept. By default it will be deleted.',
                          },
                          {
                              displayName: 'Keep As Base64',
                              name: 'keepAsBase64',
                              type: 'boolean',
                              displayOptions: {
                                  hide: {
                                      jsonParse: [true],
                                  },
                                  show: {
                                      '/mode': ['binaryToJson'],
                                      '/setAllData': [false],
                                  },
                              },
                              default: false,
                              description: 'Whether to keep the binary data as base64 string',
                          },
                          {
                              displayName: 'MIME Type',
                              name: 'mimeType',
                              type: 'string',
                              displayOptions: {
                                  show: {
                                      '/mode': ['jsonToBinary'],
                                  },
                              },
                              default: 'application/json',
                              placeholder: 'application/json',
                              description: 'The mime-type to set. By default will the mime-type for JSON be set.',
                          },
                          {
                              displayName: 'Use Raw Data',
                              name: 'useRawData',
                              type: 'boolean',
                              displayOptions: {
                                  hide: {
                                      dataIsBase64: [true],
                                  },
                                  show: {
                                      '/mode': ['jsonToBinary'],
                                  },
                              },
                              default: false,
                              description: 'Whether to use data as is and do not JSON.stringify it',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const mode = this.getNodeParameter('mode', 0);
          const returnData = [];
          let item;
          let newItem;
          let options;
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              item = items[itemIndex];
              options = this.getNodeParameter('options', itemIndex, {});
              newItem = {
                  json: {},
                  pairedItem: {
                      item: itemIndex,
                  },
              };
              if (mode === 'binaryToJson') {
                  const setAllData = this.getNodeParameter('setAllData', itemIndex);
                  const sourceKey = this.getNodeParameter('sourceKey', itemIndex);
                  const value = (0, get_1.default)(item.binary, sourceKey);
                  if (value === undefined) {
                      continue;
                  }
                  const encoding = options.encoding || 'utf8';
                  const buffer = await this.helpers.getBinaryDataBuffer(itemIndex, sourceKey);
                  let convertedValue;
                  if (setAllData) {
                      convertedValue = iconv_lite_1.default.decode(buffer, encoding, {
                          stripBOM: options.stripBOM,
                      });
                      newItem.json = (0, n8n_workflow_1.jsonParse)(convertedValue);
                  }
                  else {
                      newItem.json = (0, n8n_workflow_1.deepCopy)(item.json);
                      if (options.keepAsBase64 !== true) {
                          convertedValue = iconv_lite_1.default.decode(buffer, encoding, {
                              stripBOM: options.stripBOM,
                          });
                      }
                      else {
                          convertedValue = Buffer.from(buffer).toString(n8n_workflow_1.BINARY_ENCODING);
                      }
                      if (options.jsonParse) {
                          convertedValue = (0, n8n_workflow_1.jsonParse)(convertedValue);
                      }
                      const destinationKey = this.getNodeParameter('destinationKey', itemIndex, '');
                      (0, set_1.default)(newItem.json, destinationKey, convertedValue);
                  }
                  if (options.keepSource === true) {
                      newItem.binary = item.binary;
                  }
                  else {
                      newItem.binary = (0, n8n_workflow_1.deepCopy)(item.binary);
                      (0, unset_1.default)(newItem.binary, sourceKey);
                  }
              }
              else if (mode === 'jsonToBinary') {
                  const convertAllData = this.getNodeParameter('convertAllData', itemIndex);
                  const destinationKey = this.getNodeParameter('destinationKey', itemIndex);
                  const encoding = options.encoding || 'utf8';
                  let value = item.json;
                  if (!convertAllData) {
                      const sourceKey = this.getNodeParameter('sourceKey', itemIndex);
                      value = (0, get_1.default)(item.json, sourceKey);
                  }
                  if (value === undefined) {
                      continue;
                  }
                  if (item.binary !== undefined) {
                      newItem.binary = (0, n8n_workflow_1.deepCopy)(item.binary);
                  }
                  else {
                      newItem.binary = {};
                  }
                  const mimeType = options.mimeType || 'application/json';
                  const convertedValue = {
                      data: '',
                      mimeType,
                      fileType: (0, n8n_workflow_1.fileTypeFromMimeType)(mimeType),
                  };
                  if (options.dataIsBase64 !== true) {
                      if (options.useRawData !== true || typeof value === 'object') {
                          value = JSON.stringify(value);
                      }
                      convertedValue.fileSize = (0, pretty_bytes_1.default)(value.length);
                      convertedValue.data = iconv_lite_1.default
                          .encode(value, encoding, { addBOM: options.addBOM })
                          .toString(n8n_workflow_1.BINARY_ENCODING);
                  }
                  else {
                      convertedValue.data = value;
                  }
                  if (options.fileName) {
                      convertedValue.fileName = options.fileName;
                  }
                  (0, set_1.default)(newItem.binary, destinationKey, convertedValue);
                  if (options.keepSource === true) {
                      newItem.json = item.json;
                  }
                  else {
                      if (convertAllData) {
                          newItem.json = {};
                      }
                      else {
                          newItem.json = (0, n8n_workflow_1.deepCopy)(item.json);
                          const sourceKey = this.getNodeParameter('sourceKey', itemIndex);
                          (0, unset_1.default)(newItem.json, sourceKey);
                      }
                  }
              }
              else {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${mode}" is not known!`, {
                      itemIndex,
                  });
              }
              returnData.push(newItem);
          }
          return [returnData];
      }
  }
  exports.MoveBinaryData = MoveBinaryData;
  //# sourceMappingURL=MoveBinaryData.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Msg91
name: Msg91
package_name: n8n-nodes-base
display_name: MSG91
description: Sends transactional SMS via MSG91
code_hash: 2f2d50fba570ecb3206112e2444333e5650effbec0b672b39030df8621bfce89
source_location: node_modules/n8n-nodes-base/dist/nodes/Msg91/Msg91.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Msg91 = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Msg91 {
      constructor() {
          this.description = {
              displayName: 'MSG91',
              name: 'msg91',
              icon: 'file:msg91.png',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Sends transactional SMS via MSG91',
              defaults: {
                  name: 'MSG91',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'msg91Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                      ],
                      default: 'sms',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                          },
                      },
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              description: 'Send SMS',
                              action: 'Send an SMS',
                          },
                      ],
                      default: 'send',
                  },
                  {
                      displayName: 'Sender ID',
                      name: 'from',
                      type: 'string',
                      default: '',
                      placeholder: '4155238886',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The number from which to send the message',
                  },
                  {
                      displayName: 'To',
                      name: 'to',
                      type: 'string',
                      default: '',
                      placeholder: '+14155238886',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The number, with coutry code, to which to send the message',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['send'],
                              resource: ['sms'],
                          },
                      },
                      description: 'The message to send',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let operation;
          let resource;
          let body;
          let qs;
          let requestMethod;
          let endpoint;
          for (let i = 0; i < items.length; i++) {
              endpoint = '';
              body = {};
              qs = {};
              resource = this.getNodeParameter('resource', i);
              operation = this.getNodeParameter('operation', i);
              if (resource === 'sms') {
                  if (operation === 'send') {
                      requestMethod = 'GET';
                      endpoint = '/sendhttp.php';
                      qs.route = 4;
                      qs.country = 0;
                      qs.sender = this.getNodeParameter('from', i);
                      qs.mobiles = this.getNodeParameter('to', i);
                      qs.message = this.getNodeParameter('message', i);
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                  }
              }
              else {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                      itemIndex: i,
                  });
              }
              const responseData = await GenericFunctions_1.msg91ApiRequest.call(this, requestMethod, endpoint, body, qs);
              returnData.push({ requestId: responseData });
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Msg91 = Msg91;
  //# sourceMappingURL=Msg91.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.MySql
name: MySql
package_name: n8n-nodes-base
display_name: MySQL
description: Get, add and update data in MySQL
code_hash: c632d9b472738f3cd1ce6ce0231920d56e6b160054dbd6ff4f5b38505f8003bb
source_location: node_modules/n8n-nodes-base/dist/nodes/MySql/MySql.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.MySql = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const MySqlV1_node_1 = require("./v1/MySqlV1.node");
  const MySqlV2_node_1 = require("./v2/MySqlV2.node");
  class MySql extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'MySQL',
              name: 'mySql',
              icon: 'file:mysql.svg',
              group: ['input'],
              defaultVersion: 2.2,
              description: 'Get, add and update data in MySQL',
          };
          const nodeVersions = {
              1: new MySqlV1_node_1.MySqlV1(baseDescription),
              2: new MySqlV2_node_1.MySqlV2(baseDescription),
              2.1: new MySqlV2_node_1.MySqlV2(baseDescription),
              2.2: new MySqlV2_node_1.MySqlV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.MySql = MySql;
  //# sourceMappingURL=MySql.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.N8n
name: N8n
package_name: n8n-nodes-base
display_name: n8n
description: Handle events and perform actions on your n8n instance
code_hash: 25e366d56d1bd2a332ffffad191bc91b827011483a2ac2e0ca54ae1573799d5f
source_location: node_modules/n8n-nodes-base/dist/nodes/N8n/N8n.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.N8n = void 0;
  const AuditDescription_1 = require("./AuditDescription");
  const CredentialDescription_1 = require("./CredentialDescription");
  const ExecutionDescription_1 = require("./ExecutionDescription");
  const WorkflowDescription_1 = require("./WorkflowDescription");
  const WorkflowLocator_1 = require("./WorkflowLocator");
  class N8n {
      constructor() {
          this.description = {
              displayName: 'n8n',
              name: 'n8n',
              icon: 'file:n8n.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Handle events and perform actions on your n8n instance',
              defaults: {
                  name: 'n8n',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'n8nApi',
                      required: true,
                  },
              ],
              requestDefaults: {
                  returnFullResponse: true,
                  baseURL: '={{ $credentials.baseUrl.replace(new RegExp("/$"), "") }}',
                  headers: {
                      Accept: 'application/json',
                      'Content-Type': 'application/json',
                  },
              },
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Audit',
                              value: 'audit',
                          },
                          {
                              name: 'Credential',
                              value: 'credential',
                          },
                          {
                              name: 'Execution',
                              value: 'execution',
                          },
                          {
                              name: 'Workflow',
                              value: 'workflow',
                          },
                      ],
                      default: 'workflow',
                  },
                  ...AuditDescription_1.auditOperations,
                  ...AuditDescription_1.auditFields,
                  ...CredentialDescription_1.credentialOperations,
                  ...CredentialDescription_1.credentialFields,
                  ...ExecutionDescription_1.executionOperations,
                  ...ExecutionDescription_1.executionFields,
                  ...WorkflowDescription_1.workflowOperations,
                  ...WorkflowDescription_1.workflowFields,
              ],
          };
          this.methods = {
              listSearch: {
                  searchWorkflows: WorkflowLocator_1.searchWorkflows,
              },
          };
      }
  }
  exports.N8n = N8n;
  //# sourceMappingURL=N8n.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.N8nTrainingCustomerDatastore
name: N8nTrainingCustomerDatastore
package_name: n8n-nodes-base
display_name: Customer Datastore (n8n training)
description: Dummy node used for n8n training
code_hash: 1eace80e610dd97823a1e152f5ba5308299a1e2b8feaf724095e37ce1c7c92cc
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_location:
  node_modules/n8n-nodes-base/dist/nodes/N8nTrainingCustomerDatastore/N8nTrainingCustomerDatastore.node.js

source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.N8nTrainingCustomerDatastore = void 0;
  const data = [
      {
          id: '23423532',
          name: 'Jay Gatsby',
          email: 'gatsby@west-egg.com',
          notes: 'Keeps asking about a green light??',
          country: 'US',
          created: '1925-04-10',
      },
      {
          id: '23423533',
          name: 'José Arcadio Buendía',
          email: 'jab@macondo.co',
          notes: 'Lots of people named after him. Very confusing',
          country: 'CO',
          created: '1967-05-05',
      },
      {
          id: '23423534',
          name: 'Max Sendak',
          email: 'info@in-and-out-of-weeks.org',
          notes: 'Keeps rolling his terrible eyes',
          country: 'US',
          created: '1963-04-09',
      },
      {
          id: '23423535',
          name: 'Zaphod Beeblebrox',
          email: 'captain@heartofgold.com',
          notes: 'Felt like I was talking to more than one person',
          country: null,
          created: '1979-10-12',
      },
      {
          id: '23423536',
          name: 'Edmund Pevensie',
          email: 'edmund@narnia.gov',
          notes: 'Passionate sailor',
          country: 'UK',
          created: '1950-10-16',
      },
  ];
  class N8nTrainingCustomerDatastore {
      constructor() {
          this.description = {
              displayName: 'Customer Datastore (n8n training)',
              name: 'n8nTrainingCustomerDatastore',
              icon: 'file:n8nTrainingCustomerDatastore.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"]}}',
              description: 'Dummy node used for n8n training',
              defaults: {
                  name: 'Customer Datastore (n8n training)',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Get One Person',
                              value: 'getOnePerson',
                          },
                          {
                              name: 'Get All People',
                              value: 'getAllPeople',
                          },
                      ],
                      default: 'getOnePerson',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAllPeople'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              operation: ['getAllPeople'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 10,
                      },
                      default: 5,
                      description: 'Max number of results to return',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          for (let i = 0; i < length; i++) {
              if (operation === 'getOnePerson') {
                  responseData = data[0];
              }
              if (operation === 'getAllPeople') {
                  const returnAll = this.getNodeParameter('returnAll', i);
                  if (returnAll) {
                      responseData = data;
                  }
                  else {
                      const limit = this.getNodeParameter('limit', i);
                      responseData = data.slice(0, limit);
                  }
              }
              if (Array.isArray(responseData)) {
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push.apply(returnData, executionData);
              }
              else if (responseData !== undefined) {
                  returnData.push({ json: responseData });
              }
          }
          return [returnData];
      }
  }
  exports.N8nTrainingCustomerDatastore = N8nTrainingCustomerDatastore;
  //# sourceMappingURL=N8nTrainingCustomerDatastore.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.N8nTrainingCustomerMessenger
name: N8nTrainingCustomerMessenger
package_name: n8n-nodes-base
display_name: Customer Messenger (n8n training)
description: Dummy node used for n8n training
code_hash: 9d9edad934e5d070c2f6c86b293bbc30e6ffe3836a7266c1abf0f68e9d89e0dc
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_location:
  node_modules/n8n-nodes-base/dist/nodes/N8nTrainingCustomerMessenger/N8nTrainingCustomerMessenger.node.js

source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.N8nTrainingCustomerMessenger = void 0;
  class N8nTrainingCustomerMessenger {
      constructor() {
          this.description = {
              displayName: 'Customer Messenger (n8n training)',
              name: 'n8nTrainingCustomerMessenger',
              icon: 'file:n8nTrainingCustomerMessenger.svg',
              group: ['transform'],
              version: 1,
              description: 'Dummy node used for n8n training',
              defaults: {
                  name: 'Customer Messenger (n8n training)',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Customer ID',
                      name: 'customerId',
                      type: 'string',
                      required: true,
                      default: '',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      required: true,
                      typeOptions: {
                          rows: 4,
                      },
                      default: '',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          for (let i = 0; i < length; i++) {
              const customerId = this.getNodeParameter('customerId', i);
              const message = this.getNodeParameter('message', i);
              responseData = { output: `Sent message to customer ${customerId}:  ${message}` };
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.N8nTrainingCustomerMessenger = N8nTrainingCustomerMessenger;
  //# sourceMappingURL=N8nTrainingCustomerMessenger.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.N8nTrigger
name: N8nTrigger
package_name: n8n-nodes-base
display_name: n8n Trigger
description: Handle events and perform actions on your n8n instance
code_hash: 49ad2807ae9b686c67c1b63651607ff4bf9d2730636ac4ee6b1ee6dac7520e05
source_location: node_modules/n8n-nodes-base/dist/nodes/N8nTrigger/N8nTrigger.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.N8nTrigger = void 0;
  class N8nTrigger {
      constructor() {
          this.description = {
              displayName: 'n8n Trigger',
              name: 'n8nTrigger',
              icon: 'file:n8nTrigger.svg',
              group: ['trigger'],
              version: 1,
              description: 'Handle events and perform actions on your n8n instance',
              eventTriggerDescription: '',
              mockManualExecution: true,
              defaults: {
                  name: 'n8n Trigger',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Events',
                      name: 'events',
                      type: 'multiOptions',
                      required: true,
                      default: [],
                      description: 'Specifies under which conditions an execution should happen: <b>Instance started</b>: Triggers when this n8n instance is started or re-started',
                      options: [
                          {
                              name: 'Instance Started',
                              value: 'init',
                              description: 'Triggers when this n8n instance is started or re-started',
                          },
                      ],
                  },
              ],
          };
      }
      async trigger() {
          const events = this.getNodeParameter('events', []);
          const activationMode = this.getActivationMode();
          if (events.includes(activationMode)) {
              let event;
              if (activationMode === 'init') {
                  event = 'Instance started';
              }
              this.emit([
                  this.helpers.returnJsonArray([
                      { event, timestamp: new Date().toISOString(), workflow_id: this.getWorkflow().id },
                  ]),
              ]);
          }
          const manualTriggerFunction = async () => {
              this.emit([
                  this.helpers.returnJsonArray([
                      {
                          event: 'Manual execution',
                          timestamp: new Date().toISOString(),
                          workflow_id: this.getWorkflow().id,
                      },
                  ]),
              ]);
          };
          return {
              manualTriggerFunction,
          };
      }
  }
  exports.N8nTrigger = N8nTrigger;
  //# sourceMappingURL=N8nTrigger.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Nasa
name: Nasa
package_name: n8n-nodes-base
display_name: NASA
description: Retrieve data from the NASA API
code_hash: f7745392ff0a92efee6e82a6d34f397404666cfd4c56ac723875c1b6aa5d0589
source_location: node_modules/n8n-nodes-base/dist/nodes/Nasa/Nasa.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
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.Nasa = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const moment_1 = __importDefault(require("moment"));
  class Nasa {
      constructor() {
          this.description = {
              displayName: 'NASA',
              name: 'nasa',
              icon: 'file:nasa.png',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ":" + $parameter["resource"]}}',
              description: 'Retrieve data from the NASA API',
              defaults: {
                  name: 'NASA',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'nasaApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Asteroid Neo-Browse',
                              value: 'asteroidNeoBrowse',
                          },
                          {
                              name: 'Asteroid Neo-Feed',
                              value: 'asteroidNeoFeed',
                          },
                          {
                              name: 'Asteroid Neo-Lookup',
                              value: 'asteroidNeoLookup',
                          },
                          {
                              name: 'Astronomy Picture of the Day',
                              value: 'astronomyPictureOfTheDay',
                          },
                          {
                              name: 'DONKI Coronal Mass Ejection',
                              value: 'donkiCoronalMassEjection',
                          },
                          {
                              name: 'DONKI High Speed Stream',
                              value: 'donkiHighSpeedStream',
                          },
                          {
                              name: 'DONKI Interplanetary Shock',
                              value: 'donkiInterplanetaryShock',
                          },
                          {
                              name: 'DONKI Magnetopause Crossing',
                              value: 'donkiMagnetopauseCrossing',
                          },
                          {
                              name: 'DONKI Notification',
                              value: 'donkiNotifications',
                          },
                          {
                              name: 'DONKI Radiation Belt Enhancement',
                              value: 'donkiRadiationBeltEnhancement',
                          },
                          {
                              name: 'DONKI Solar Energetic Particle',
                              value: 'donkiSolarEnergeticParticle',
                          },
                          {
                              name: 'DONKI Solar Flare',
                              value: 'donkiSolarFlare',
                          },
                          {
                              name: 'DONKI WSA+EnlilSimulation',
                              value: 'donkiWsaEnlilSimulation',
                          },
                          {
                              name: 'Earth Asset',
                              value: 'earthAssets',
                          },
                          {
                              name: 'Earth Imagery',
                              value: 'earthImagery',
                          },
                      ],
                      default: 'astronomyPictureOfTheDay',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['astronomyPictureOfTheDay'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get the Astronomy Picture of the Day',
                              action: 'Get the astronomy picture of the day',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['asteroidNeoFeed'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve a list of asteroids based on their closest approach date to Earth',
                              action: 'Get an asteroid neo feed',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['asteroidNeoLookup'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Look up an asteroid based on its NASA SPK-ID',
                              action: 'Get an asteroid neo lookup',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['asteroidNeoBrowse'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Browse the overall asteroid dataset',
                              action: 'Get many asteroid neos',
                          },
                      ],
                      default: 'getAll',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiCoronalMassEjection'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI coronal mass ejection data',
                              action: 'Get a DONKI coronal mass ejection',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiGeomagneticStorm'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI geomagnetic storm data',
                              action: 'Get a DONKI geomagnetic storm',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiInterplanetaryShock'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI interplanetary shock data',
                              action: 'Get a DONKI interplanetary shock',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiSolarFlare'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI solar flare data',
                              action: 'Get a DONKI solar flare',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiSolarEnergeticParticle'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI solar energetic particle data',
                              action: 'Get a DONKI solar energetic particle',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiMagnetopauseCrossing'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve data on DONKI magnetopause crossings',
                              action: 'Get a DONKI magnetopause crossing',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiRadiationBeltEnhancement'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI radiation belt enhancement data',
                              action: 'Get a DONKI radiation belt enhancement',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiHighSpeedStream'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI high speed stream data',
                              action: 'Get a DONKI high speed stream',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiWsaEnlilSimulation'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI WSA+EnlilSimulation data',
                              action: 'Get a DONKI wsa enlil simulation',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['donkiNotifications'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve DONKI notifications data',
                              action: 'Get a DONKI notifications',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['earthImagery'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve Earth imagery',
                              action: 'Get Earth imagery',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['earthAssets'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve Earth assets',
                              action: 'Get Earth assets',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['inSightMarsWeatherService'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve Insight Mars Weather Service data',
                              action: 'Get Insight Mars Weather Service',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['imageAndVideoLibrary'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve Image and Video Library data',
                              action: 'Get image and video library data',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['techTransfer'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve TechTransfer data',
                              action: 'Get a TechTransfer data',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['twoLineElementSet'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve Two-Line Element Set data',
                              action: 'Get a Two-Line Element Set',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Asteroid ID',
                      name: 'asteroidId',
                      type: 'string',
                      required: true,
                      default: '',
                      placeholder: '3542519',
                      description: 'The ID of the asteroid to be returned',
                      displayOptions: {
                          show: {
                              resource: ['asteroidNeoLookup'],
                              operation: ['get'],
                          },
                      },
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['asteroidNeoLookup'],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Include Close Approach Data',
                              name: 'includeCloseApproachData',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to include all the close approach data in the asteroid lookup',
                          },
                      ],
                  },
                  {
                      displayName: 'Download Image',
                      name: 'download',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['astronomyPictureOfTheDay'],
                          },
                      },
                      default: true,
                      description: 'By default just the URL of the image is returned. When set to true the image will be downloaded.',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['astronomyPictureOfTheDay'],
                              download: [true],
                          },
                      },
                      description: 'Name of the binary property to which to write to',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add field',
                      displayOptions: {
                          show: {
                              resource: ['astronomyPictureOfTheDay'],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Date',
                              name: 'date',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add field',
                      displayOptions: {
                          show: {
                              resource: [
                                  'asteroidNeoFeed',
                                  'donkiCoronalMassEjection',
                                  'donkiGeomagneticStorm',
                                  'donkiSolarFlare',
                                  'donkiSolarEnergeticParticle',
                                  'donkiMagnetopauseCrossing',
                                  'donkiRadiationBeltEnhancement',
                                  'donkiHighSpeedStream',
                                  'donkiWsaEnlilSimulation',
                                  'donkiNotifications',
                              ],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Start Date',
                              name: 'startDate',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                          },
                          {
                              displayName: 'End Date',
                              name: 'endDate',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                          },
                      ],
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add field',
                      displayOptions: {
                          show: {
                              resource: ['donkiInterplanetaryShock'],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Start Date',
                              name: 'startDate',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                          },
                          {
                              displayName: 'End Date',
                              name: 'endDate',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                          },
                          {
                              displayName: 'Location',
                              name: 'location',
                              type: 'options',
                              default: 'ALL',
                              description: 'The location of the geomagnetic storm',
                              options: [
                                  {
                                      name: 'All',
                                      value: 'ALL',
                                  },
                                  {
                                      name: 'Earth',
                                      value: 'earth',
                                  },
                                  {
                                      name: 'Messenger',
                                      value: 'MESSENGER',
                                  },
                                  {
                                      name: 'Stereo A',
                                      value: 'STEREO A',
                                  },
                                  {
                                      name: 'Stereo B',
                                      value: 'STEREO B',
                                  },
                              ],
                          },
                          {
                              displayName: 'Catalog',
                              name: 'catalog',
                              type: 'options',
                              default: 'ALL',
                              description: 'The catalog of the geomagnetic storm',
                              options: [
                                  {
                                      name: 'All',
                                      value: 'ALL',
                                  },
                                  {
                                      name: 'SWRC Catalog',
                                      value: 'SWRC_CATALOG',
                                  },
                                  {
                                      name: 'Winslow Messenger ICME Catalog',
                                      value: 'WINSLOW_MESSENGER_ICME_CATALOG',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Latitude',
                      name: 'lat',
                      type: 'number',
                      default: '',
                      placeholder: '47.751076',
                      description: 'Latitude for the location of the image',
                      displayOptions: {
                          show: {
                              resource: ['earthImagery', 'earthAssets'],
                              operation: ['get'],
                          },
                      },
                  },
                  {
                      displayName: 'Longitude',
                      name: 'lon',
                      type: 'number',
                      default: '',
                      placeholder: '-120.740135',
                      description: 'Longitude for the location of the image',
                      displayOptions: {
                          show: {
                              resource: ['earthImagery', 'earthAssets'],
                              operation: ['get'],
                          },
                      },
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['earthImagery'],
                          },
                      },
                      description: 'Name of the binary property to which to write to',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      default: {},
                      placeholder: 'Add field',
                      displayOptions: {
                          show: {
                              resource: ['earthImagery', 'earthAssets'],
                              operation: ['get'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Date',
                              name: 'date',
                              type: 'dateTime',
                              default: '',
                              placeholder: 'YYYY-MM-DD',
                              description: 'Date of the image',
                          },
                          {
                              displayName: 'Degrees',
                              name: 'dim',
                              type: 'number',
                              default: '',
                              placeholder: '0.025',
                              description: 'Width and height of the image in degrees',
                          },
                      ],
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      description: 'Max number of results to return',
                      default: 20,
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const qs = {};
          let returnAll = false;
          let propertyName = '';
          let download = false;
          for (let i = 0; i < items.length; i++) {
              try {
                  let endpoint = '';
                  let includeCloseApproachData = false;
                  let additionalFields;
                  try {
                      additionalFields = this.getNodeParameter('additionalFields', i);
                  }
                  catch (error) {
                      additionalFields = {};
                  }
                  if (resource === 'astronomyPictureOfTheDay') {
                      if (operation === 'get') {
                          endpoint = '/planetary/apod';
                          qs.date =
                              (0, moment_1.default)(additionalFields.date).format('YYYY-MM-DD') ||
                                  (0, moment_1.default)().format('YYYY-MM-DD');
                      }
                  }
                  if (resource === 'asteroidNeoFeed') {
                      if (operation === 'get') {
                          endpoint = '/neo/rest/v1/feed';
                          propertyName = 'near_earth_objects';
                          const currentDate = (0, moment_1.default)().format('YYYY-MM-DD');
                          qs.start_date =
                              (0, moment_1.default)(additionalFields.startDate).format('YYYY-MM-DD') || currentDate;
                          qs.end_date =
                              (0, moment_1.default)(additionalFields.endDate).format('YYYY-MM-DD') || currentDate;
                      }
                  }
                  if (resource === 'asteroidNeoLookup') {
                      if (operation === 'get') {
                          const asteroidId = this.getNodeParameter('asteroidId', i);
                          includeCloseApproachData = additionalFields.includeCloseApproachData;
                          endpoint = `/neo/rest/v1/neo/${asteroidId}`;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation '${operation}' is unknown!`, { itemIndex: i });
                      }
                  }
                  if (resource === 'asteroidNeoBrowse') {
                      if (operation === 'getAll') {
                          returnAll = this.getNodeParameter('returnAll', 0);
                          if (!returnAll) {
                              qs.size = this.getNodeParameter('limit', 0);
                          }
                          propertyName = 'near_earth_objects';
                          endpoint = '/neo/rest/v1/neo/browse';
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation '${operation}' is unknown!`, { itemIndex: i });
                      }
                  }
                  if (resource.startsWith('donki')) {
                      if (additionalFields.startDate) {
                          qs.startDate = (0, moment_1.default)(additionalFields.startDate).format('YYYY-MM-DD');
                      }
                      else {
                          qs.startDate = (0, moment_1.default)().subtract(30, 'days').format('YYYY-MM-DD');
                      }
                      if (additionalFields.endDate) {
                          qs.endDate = (0, moment_1.default)(additionalFields.endDate).format('YYYY-MM-DD');
                      }
                      else {
                          qs.endDate = (0, moment_1.default)().format('YYYY-MM-DD');
                      }
                      if (resource === 'donkiCoronalMassEjection') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/CME';
                          }
                      }
                      else if (resource === 'donkiGeomagneticStorm') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/GST';
                          }
                      }
                      else if (resource === 'donkiInterplanetaryShock') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/IPS';
                              qs.location = additionalFields.location || 'ALL';
                              qs.catalog = additionalFields.catalog || 'ALL';
                          }
                      }
                      else if (resource === 'donkiSolarFlare') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/FLR';
                          }
                      }
                      else if (resource === 'donkiSolarEnergeticParticle') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/SEP';
                          }
                      }
                      else if (resource === 'donkiMagnetopauseCrossing') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/MPC';
                          }
                      }
                      else if (resource === 'donkiRadiationBeltEnhancement') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/RBE';
                          }
                      }
                      else if (resource === 'donkiHighSpeedStream') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/HSS';
                          }
                      }
                      else if (resource === 'donkiWsaEnlilSimulation') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/WSAEnlilSimulations';
                          }
                      }
                      else if (resource === 'donkiNotifications') {
                          if (operation === 'get') {
                              endpoint = '/DONKI/notifications';
                              qs.type = additionalFields.type || 'all';
                          }
                      }
                  }
                  if (resource === 'earthImagery') {
                      if (operation === 'get') {
                          endpoint = '/planetary/earth/imagery';
                          qs.lat = this.getNodeParameter('lat', i);
                          qs.lon = this.getNodeParameter('lon', i);
                          qs.dim = additionalFields.dim || 0.025;
                          if (additionalFields.date) {
                              qs.date = (0, moment_1.default)(additionalFields.date).format('YYYY-MM-DD');
                          }
                          else {
                              qs.date = (0, moment_1.default)().format('YYYY-MM-DD');
                          }
                      }
                  }
                  if (resource === 'earthAssets') {
                      if (operation === 'get') {
                          endpoint = '/planetary/earth/assets';
                          qs.lat = this.getNodeParameter('lat', i);
                          qs.lon = this.getNodeParameter('lon', i);
                          qs.dim = additionalFields.dim || 0.025;
                          if (additionalFields.date) {
                              qs.date = (0, moment_1.default)(additionalFields.date).format('YYYY-MM-DD');
                          }
                      }
                      if (operation === 'get') {
                          endpoint = '/insight_weather/earth/imagery';
                          qs.feedtype = 'json';
                          qs.ver = '1.0';
                      }
                  }
                  if (returnAll) {
                      responseData = GenericFunctions_1.nasaApiRequestAllItems.call(this, propertyName, 'GET', endpoint, qs);
                  }
                  else {
                      responseData = await GenericFunctions_1.nasaApiRequest.call(this, 'GET', endpoint, qs);
                      if (propertyName !== '') {
                          responseData = responseData[propertyName];
                      }
                  }
                  if (resource === 'asteroidNeoLookup' && operation === 'get' && !includeCloseApproachData) {
                      delete responseData.close_approach_data;
                  }
                  if (resource === 'asteroidNeoFeed') {
                      const date = Object.keys(responseData)[0];
                      responseData = responseData[date];
                  }
                  if (resource === 'earthImagery') {
                      const binaryProperty = this.getNodeParameter('binaryPropertyName', i);
                      const data = await GenericFunctions_1.nasaApiRequest.call(this, 'GET', endpoint, qs, { encoding: null });
                      const newItem = {
                          json: items[i].json,
                          binary: {},
                      };
                      if (items[i].binary !== undefined) {
                          Object.assign(newItem.binary, items[i].binary);
                      }
                      items[i] = newItem;
                      items[i].binary[binaryProperty] = await this.helpers.prepareBinaryData(data);
                  }
                  if (resource === 'astronomyPictureOfTheDay') {
                      download = this.getNodeParameter('download', 0);
                      if (download) {
                          const binaryProperty = this.getNodeParameter('binaryPropertyName', i);
                          const data = await GenericFunctions_1.nasaApiRequest.call(this, 'GET', endpoint, qs, { encoding: null }, responseData.hdurl);
                          const filename = responseData.hdurl.split('/');
                          const newItem = {
                              json: items[i].json,
                              binary: {},
                          };
                          Object.assign(newItem.json, responseData);
                          if (items[i].binary !== undefined) {
                              Object.assign(newItem.binary, items[i].binary);
                          }
                          items[i] = newItem;
                          items[i].binary[binaryProperty] = await this.helpers.prepareBinaryData(data, filename[filename.length - 1]);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (resource === 'earthImagery' && operation === 'get') {
                          items[i].json = { error: error.message };
                      }
                      else if (resource === 'astronomyPictureOfTheDay' && operation === 'get' && download) {
                          items[i].json = { error: error.message };
                      }
                      else {
                          const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                          returnData.push(...executionErrorData);
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (resource === 'earthImagery' && operation === 'get') {
              return [items];
          }
          else if (resource === 'astronomyPictureOfTheDay' && operation === 'get' && download) {
              return [items];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.Nasa = Nasa;
  //# sourceMappingURL=Nasa.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.Netlify
name: Netlify
package_name: n8n-nodes-base
display_name: Netlify
description: Consume Netlify API
code_hash: da09d02d0d7620d84e394d150cea0f5613386191bcbea87271e7f06c30b5b31a
source_location: node_modules/n8n-nodes-base/dist/nodes/Netlify/Netlify.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Netlify = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const DeployDescription_1 = require("./DeployDescription");
  const SiteDescription_1 = require("./SiteDescription");
  class Netlify {
      constructor() {
          this.description = {
              displayName: 'Netlify',
              name: 'netlify',
              icon: 'file:netlify.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Netlify API',
              defaults: {
                  name: 'Netlify',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'netlifyApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Deploy',
                              value: 'deploy',
                          },
                          {
                              name: 'Site',
                              value: 'site',
                          },
                      ],
                      default: 'deploy',
                      required: true,
                  },
                  ...DeployDescription_1.deployOperations,
                  ...DeployDescription_1.deployFields,
                  ...SiteDescription_1.siteOperations,
                  ...SiteDescription_1.siteFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getSites() {
                      const returnData = [];
                      const sites = await GenericFunctions_1.netlifyApiRequest.call(this, 'GET', '/sites');
                      for (const site of sites) {
                          returnData.push({
                              name: site.name,
                              value: site.site_id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const length = items.length;
          let responseData;
          const returnData = [];
          const qs = {};
          const body = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'deploy') {
                      if (operation === 'cancel') {
                          const deployId = this.getNodeParameter('deployId', i);
                          responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'POST', `/deploys/${deployId}/cancel`, body, qs);
                      }
                      if (operation === 'create') {
                          const siteId = this.getNodeParameter('siteId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                          if (body.title) {
                              qs.title = body.title;
                              delete body.title;
                          }
                          responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'POST', `/sites/${siteId}/deploys`, body, qs);
                      }
                      if (operation === 'get') {
                          const siteId = this.getNodeParameter('siteId', i);
                          const deployId = this.getNodeParameter('deployId', i);
                          responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'GET', `/sites/${siteId}/deploys/${deployId}`, body, qs);
                      }
                      if (operation === 'getAll') {
                          const siteId = this.getNodeParameter('siteId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.netlifyRequestAllItems.call(this, 'GET', `/sites/${siteId}/deploys`);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'GET', `/sites/${siteId}/deploys`, {}, { per_page: limit });
                          }
                      }
                  }
                  if (resource === 'site') {
                      if (operation === 'delete') {
                          const siteId = this.getNodeParameter('siteId', i);
                          responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'DELETE', `/sites/${siteId}`);
                      }
                      if (operation === 'get') {
                          const siteId = this.getNodeParameter('siteId', i);
                          responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'GET', `/sites/${siteId}`);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.netlifyRequestAllItems.call(this, 'GET', '/sites', {}, { filter: 'all' });
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.netlifyApiRequest.call(this, 'GET', '/sites', {}, { filter: 'all', per_page: 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.Netlify = Netlify;
  //# sourceMappingURL=Netlify.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


node_type: n8n-nodes-base.NextCloud
name: NextCloud
package_name: n8n-nodes-base
display_name: Nextcloud
description: Access data on Nextcloud
code_hash: c16a62145bd04153b769ec1f971038acce59dcb941fc062aed1ae114514924ea
source_location: node_modules/n8n-nodes-base/dist/nodes/NextCloud/NextCloud.node.js
extracted_at: 2025-06-07 19:36:40
updated_at: 2025-06-07 19:36:40
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.NextCloud = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const url_1 = require("url");
  const xml2js_1 = require("xml2js");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utilities_1 = require("../../utils/utilities");
  class NextCloud {
      constructor() {
          this.description = {
              displayName: 'Nextcloud',
              name: 'nextCloud',
              icon: 'file:nextcloud.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Access data on Nextcloud',
              defaults: {
                  name: 'Nextcloud',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'nextCloudApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'nextCloudOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Access Token',
                              value: 'accessToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'accessToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Folder',
                              value: 'folder',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'file',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['file'],
                          },
                      },
                      options: [
                          {
                              name: 'Copy',
                              value: 'copy',
                              description: 'Copy a file',
                              action: 'Copy a file',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a file',
                              action: 'Delete a file',
                          },
                          {
                              name: 'Download',
                              value: 'download',
                              description: 'Download a file',
                              action: 'Download a file',
                          },
                          {
                              name: 'Move',
                              value: 'move',
                              description: 'Move a file',
                              action: 'Move a file',
                          },
                          {
                              name: 'Share',
                              value: 'share',
                              description: 'Share a file',
                              action: 'Share a file',
                          },
                          {
                              name: 'Upload',
                              value: 'upload',
                              description: 'Upload a file',
                              action: 'Upload a file',
                          },
                      ],
                      default: 'upload',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['folder'],
                          },
                      },
                      options: [
                          {
                              name: 'Copy',
                              value: 'copy',
                              description: 'Copy a folder',
                              action: 'Copy a folder',
                          },
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a folder',
                              action: 'Create a folder',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a folder',
                              action: 'Delete a folder',
                          },
                          {
                              name: 'List',
                              value: 'list',
                              description: 'Return the contents of a given folder',
                              action: 'List a folder',
                          },
                          {
                              name: 'Move',
                              value: 'move',
                              description: 'Move a folder',
                              action: 'Move a folder',
                          },
                          {
                              name: 'Share',
                              value: 'share',
                              description: 'Share a folder',
                              action: 'Share a folder',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                          },
                      },
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Invite a user to a NextCloud organization',
                              action: 'Create a user',
                          },
                          {
                              name: 'Delete',
                              value: 'delete',
                              description: 'Delete a user',
                              action: 'Delete a user',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Retrieve information about a single user',
                              action: 'Get a user',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Retrieve a list of users',
                              action: 'Get many users',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Edit attributes related to a user',
                              action: 'Update a user',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'From Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['copy'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/original.txt',
                      description: 'The path of file or folder to copy. The path should start with "/".',
                  },
                  {
                      displayName: 'To Path',
                      name: 'toPath',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['copy'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/copy.txt',
                      description: 'The destination path of file or folder. The path should start with "/".',
                  },
                  {
                      displayName: 'Delete Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['delete'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The path to delete. Can be a single file or a whole folder. The path should start with "/".',
                  },
                  {
                      displayName: 'From Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['move'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/old_name.txt',
                      description: 'The path of file or folder to move. The path should start with "/".',
                  },
                  {
                      displayName: 'To Path',
                      name: 'toPath',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['move'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/new_name.txt',
                      description: 'The new path of file or folder. The path should start with "/".',
                  },
                  {
                      displayName: 'File Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The file path of the file to download. Has to contain the full path. The path should start with "/".',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      description: 'Name of the binary property to which to write the data of the read file',
                  },
                  {
                      displayName: 'File Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The absolute file path of the file to upload. Has to contain the full path. The parent folder has to exist. Existing files get overwritten.',
                  },
                  {
                      displayName: 'Binary Data',
                      name: 'binaryDataUpload',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                  },
                  {
                      displayName: 'File Content',
                      name: 'fileContent',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              binaryDataUpload: [false],
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'The text content of the file to upload',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              binaryDataUpload: [true],
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file to be uploaded',
                  },
                  {
                      displayName: 'File Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['share'],
                              resource: ['file', 'folder'],
                          },
                      },
                      placeholder: '/invoices/2019/invoice_1.pdf',
                      description: 'The file path of the file to share. Has to contain the full path. The path should start with "/".',
                  },
                  {
                      displayName: 'Share Type',
                      name: 'shareType',
                      type: 'options',
                      displayOptions: {
                          show: {
                              operation: ['share'],
                              resource: ['file', 'folder'],
                          },
                      },
                      options: [
                          {
                              name: 'Circle',
                              value: 7,
                          },
                          {
                              name: 'Email',
                              value: 4,
                          },
                          {
                              name: 'Group',
                              value: 1,
                          },
                          {
                              name: 'Public Link',
                              value: 3,
                          },
                          {
                              name: 'User',
                              value: 0,
                          },
                      ],
                      default: 0,
                      description: 'The share permissions to set',
                  },
                  {
                      displayName: 'Circle ID',
                      name: 'circleId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['file', 'folder'],
                              operation: ['share'],
                              shareType: [7],
                          },
                      },
                      default: '',
                      description: 'The ID of the circle to share with',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      displayOptions: {
                          show: {
                              resource: ['file', 'folder'],
                              operation: ['share'],
                              shareType: [4],
                          },
                      },
                      default: '',
                      description: 'The Email address to share with',
                  },
                  {
                      displayName: 'Group ID',
                      name: 'groupId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['file', 'folder'],
                              operation: ['share'],
                              shareType: [1],
                          },
                      },
                      default: '',
                      description: 'The ID of the group to share with',
                  },
                  {
                      displayName: 'User',
                      name: 'user',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['file', 'folder'],
                              operation: ['share'],
                              shareType: [0],
                          },
                      },
                      default: '',
                      description: 'The user to share with',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['file', 'folder'],
                              operation: ['share'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Password',
                              name: 'password',
                              type: 'string',
                              typeOptions: { password: true },
                              displayOptions: {
                                  show: {
                                      '/resource': ['file', 'folder'],
                                      '/operation': ['share'],
                                      '/shareType': [3],
                                  },
                              },
                              default: '',
                              description: 'Optional search string',
                          },
                          {
                              displayName: 'Permissions',
                              name: 'permissions',
                              type: 'options',
                              options: [
                                  {
                                      name: 'All',
                                      value: 31,
                                  },
                                  {
                                      name: 'Create',
                                      value: 4,
                                  },
                                  {
                                      name: 'Delete',
                                      value: 8,
                                  },
                                  {
                                      name: 'Read',
                                      value: 1,
                                  },
                                  {
                                      name: 'Update',
                                      value: 2,
                                  },
                              ],
                              default: 1,
                              description: 'The share permissions to set',
                          },
                      ],
                  },
                  {
                      displayName: 'Folder',
                      name: 'path',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['folder'],
                          },
                      },
                      placeholder: '/invoices/2019',
                      description: 'The folder to create. The parent folder has to exist. The path should start with "/".',
                  },
                  {
                      displayName: 'Folder Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                              resource: ['folder'],
                          },
                      },
                      placeholder: '/invoices/2019/',
                      description: 'The path of which to list the content. The path should start with "/".',
                  },
                  {
                      displayName: 'Username',
                      name: 'userId',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['create'],
                          },
                      },
                      placeholder: 'john',
                      description: 'Username the user will have',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['create'],
                          },
                      },
                      placeholder: 'john@email.com',
                      description: 'The email of the user to invite',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['create'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Display Name',
                              name: 'displayName',
                              type: 'string',
                              default: '',
                              description: 'The display name of the user to invite',
                          },
                      ],
                  },
                  {
                      displayName: 'Username',
                      name: 'userId',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['delete', 'get', 'update'],
                          },
                      },
                      placeholder: 'john',
                      description: 'Username the user will have',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['getAll'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['getAll'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 50,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['getAll'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Search',
                              name: 'search',
                              type: 'string',
                              default: '',
                              description: 'Optional search string',
                          },
                          {
                              displayName: 'Offset',
                              name: 'offset',
                              type: 'number',
                              default: '',
                              description: 'Optional offset value',
                          },
                      ],
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: false,
                      },
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['user'],
                              operation: ['update'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Fields',
                              name: 'field',
                              values: [
                                  {
                                      displayName: 'Key',
                                      name: 'key',
                                      type: 'options',
                                      default: 'email',
                                      options: [
                                          {
                                              name: 'Address',
                                              value: 'address',
                                              description: 'The new address for the user',
                                          },
                                          {
                                              name: 'Display Name',
                                              value: 'displayname',
                                              description: 'The new display name for the user',
                                          },
                                          {
                                              name: 'Email',
                                              value: 'email',
                                              description: 'The new email for the user',
                                          },
                                          {
                                              name: 'Password',
                                              value: 'password',
                                              description: 'The new password for the user',
                                          },
                                          {
                                              name: 'Twitter',
                                              value: 'twitter',
                                              description: 'The new twitter handle for the user',
                                          },
                                          {
                                              name: 'Website',
                                              value: 'website',
                                              description: 'The new website for the user',
                                          },
                                      ],
                                      description: 'Key of the updated attribute',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'string',
                                      default: '',
                                      description: 'Value of the updated attribute',
                                  },
                              ],
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData().slice();
          const returnData = [];
          const authenticationMethod = this.getNodeParameter('authentication', 0);
          let credentials;
          if (authenticationMethod === 'accessToken') {
              credentials = await this.getCredentials('nextCloudApi');
          }
          else {
              credentials = await this.getCredentials('nextCloudOAuth2Api');
          }
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let endpoint = '';
          let requestMethod = '';
          let responseData;
          let body = '';
          const headers = {};
          let qs;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'file') {
                      if (operation === 'download') {
                          requestMethod = 'GET';
                          endpoint = this.getNodeParameter('path', i);
                      }
                      else if (operation === 'upload') {
                          requestMethod = 'PUT';
                          endpoint = this.getNodeParameter('path', i);
                          if (this.getNodeParameter('binaryDataUpload', i) === true) {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              this.helpers.assertBinaryData(i, binaryPropertyName);
                              body = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          }
                          else {
                              body = this.getNodeParameter('fileContent', i);
                          }
                      }
                  }
                  else if (resource === 'folder') {
                      if (operation === 'create') {
                          requestMethod = 'MKCOL';
                          endpoint = this.getNodeParameter('path', i);
                      }
                      else if (operation === 'list') {
                          requestMethod = 'PROPFIND';
                          endpoint = this.getNodeParameter('path', i);
                      }
                  }
                  if (['file', 'folder'].includes(resource)) {
                      if (operation === 'copy') {
                          requestMethod = 'COPY';
                          endpoint = this.getNodeParameter('path', i);
                          const toPath = this.getNodeParameter('toPath', i);
                          headers.Destination = `${credentials.webDavUrl}/${encodeURI(toPath)}`;
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          endpoint = this.getNodeParameter('path', i);
                      }
                      else if (operation === 'move') {
                          requestMethod = 'MOVE';
                          endpoint = this.getNodeParameter('path', i);
                          const toPath = this.getNodeParameter('toPath', i);
                          headers.Destination = `${credentials.webDavUrl}/${encodeURI(toPath)}`;
                      }
                      else if (operation === 'share') {
                          requestMethod = 'POST';
                          endpoint = 'ocs/v2.php/apps/files_sharing/api/v1/shares';
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                          const bodyParameters = this.getNodeParameter('options', i);
                          bodyParameters.path = this.getNodeParameter('path', i);
                          bodyParameters.shareType = this.getNodeParameter('shareType', i);
                          if (bodyParameters.shareType === 0) {
                              bodyParameters.shareWith = this.getNodeParameter('user', i);
                          }
                          else if (bodyParameters.shareType === 7) {
                              bodyParameters.shareWith = this.getNodeParameter('circleId', i);
                          }
                          else if (bodyParameters.shareType === 4) {
                              bodyParameters.shareWith = this.getNodeParameter('email', i);
                          }
                          else if (bodyParameters.shareType === 1) {
                              bodyParameters.shareWith = this.getNodeParameter('groupId', i);
                          }
                          body = new url_1.URLSearchParams(bodyParameters).toString();
                      }
                  }
                  else if (resource === 'user') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = 'ocs/v1.php/cloud/users';
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                          const userid = this.getNodeParameter('userId', i);
                          const email = this.getNodeParameter('email', i);
                          body = `userid=${userid}&email=${email}`;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.displayName) {
                              body += `&displayName=${additionalFields.displayName}`;
                          }
                      }
                      if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const userid = this.getNodeParameter('userId', i);
                          endpoint = `ocs/v1.php/cloud/users/${userid}`;
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                      }
                      if (operation === 'get') {
                          requestMethod = 'GET';
                          const userid = this.getNodeParameter('userId', i);
                          endpoint = `ocs/v1.php/cloud/users/${userid}`;
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                      }
                      if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs = this.getNodeParameter('options', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          endpoint = 'ocs/v1.php/cloud/users';
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                      }
                      if (operation === 'update') {
                          requestMethod = 'PUT';
                          const userid = this.getNodeParameter('userId', i);
                          endpoint = `ocs/v1.php/cloud/users/${userid}`;
                          body = Object.entries(this.getNodeParameter('updateFields', i).field)
                              .map((entry) => {
                              const [key, value] = entry;
                              return `${key}=${value}`;
                          })
                              .join('&');
                          headers['OCS-APIRequest'] = true;
                          headers['Content-Type'] = 'application/x-www-form-urlencoded';
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  let webDavUrl = credentials.webDavUrl;
                  if (webDavUrl.slice(-1) === '/') {
                      webDavUrl = webDavUrl.slice(0, -1);
                  }
                  let encoding = undefined;
                  if (resource === 'file' && operation === 'download') {
                      encoding = null;
                  }
                  try {
                      responseData = await GenericFunctions_1.nextCloudApiRequest.call(this, requestMethod, endpoint, body, headers, encoding, qs);
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          if (resource === 'file' && operation === 'download') {
                              items[i].json = { error: error.message };
                          }
                          else {
                              returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
                          }
                          continue;
                      }
                      throw error;
                  }
                  if (resource === 'file' && operation === 'download') {
                      const newItem = {
                          json: items[i].json,
                          pairedItem: { item: i },
                          binary: {},
                      };
                      if (items[i].binary !== undefined) {
                          Object.assign(newItem.binary, items[i].binary);
                      }
                      items[i] = newItem;
                      const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                      items[i].binary[binaryPropertyName] = await this.helpers.prepareBinaryData(responseData, endpoint);
                  }
                  else if (['file', 'folder'].includes(resource) && operation === 'share') {
                      const jsonResponseData = await new Promise((resolve, reject) => {
                          (0, xml2js_1.parseString)(responseData, { explicitArray: false }, (err, data) => {
                              if (err) {
                                  return reject(err);
                              }
                              if (data.ocs.meta.status !== 'ok') {
                                  return reject(new n8n_workflow_1.NodeApiError(this.getNode(), data.ocs.meta.message || data.ocs.meta.status));
                              }
                              resolve(data.ocs.data);
                          });
                      });
                      const executionData = this.helpers.constructExecutionMetaData((0, utilities_1.wrapData)(jsonResponseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (resource === 'user') {
                      if (operation !== 'getAll') {
                          const jsonResponseData = await new Promise((resolve, reject) => {
                              (0, xml2js_1.parseString)(responseData, { explicitArray: false }, (err, data) => {
                                  if (err) {
                                      return reject(err);
                                  }
                                  if (data.ocs.meta.status !== 'ok') {
                                      return reject(new n8n_workflow_1.NodeApiError(this.getNode(), (data.ocs.meta.message || data.ocs.meta.status)));
                                  }
                                  if (operation === 'delete' || operation === 'update') {
                                      resolve(data.ocs.meta);
                                  }
                                  else {
                                      resolve(data.ocs.data);
                                  }
                              });
                          });
                          const executionData = this.helpers.constructExecutionMetaData((0, utilities_1.wrapData)(jsonResponseData), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else {
                          const jsonResponseData = await new Promise((resolve, reject) => {
                              (0, xml2js_1.parseString)(responseData, { explicitArray: false }, (err, data) => {
                                  if (err) {
                                      return reject(err);
                                  }
                                  if (data.ocs.meta.status !== 'ok') {
                                      return reject(new n8n_workflow_1.NodeApiError(this.getNode(), data.ocs.meta.message));
                                  }
                                  if (typeof data.ocs.data.users.element === 'string') {
                                      resolve([data.ocs.data.users.element]);
                                  }
                                  else {
                                      resolve(data.ocs.data.users.element);
                                  }
                              });
                          });
                          jsonResponseData.forEach((value) => {
                              returnData.push({ json: { id: value }, pairedItem: { item: i } });
                          });
                      }
                  }
                  else if (resource === 'folder' && operation === 'list') {
                      const jsonResponseData = await new Promise((resolve, reject) => {
                          (0, xml2js_1.parseString)(responseData, { explicitArray: false }, (err, data) => {
                              if (err) {
                                  return reject(err);
                              }
                              resolve(data);
                          });
                      });
                      const propNames = {
                          'd:getlastmodified': 'lastModified',
                          'd:getcontentlength': 'contentLength',
                          'd:getcontenttype': 'contentType',
                      };
                      if (jsonResponseData['d:multistatus'] !== undefined &&
                          jsonResponseData['d:multistatus'] !== null &&
                          jsonResponseData['d:multistatus']['d:response'] !== undefined &&
                          jsonResponseData['d:multistatus']['d:response'] !== null) {
                          let skippedFirst = false;
                          if (Array.isArray(jsonResponseData['d:multistatus']['d:response'])) {
                              for (const item of jsonResponseData['d:multistatus']['d:response']) {
                                  if (!skippedFirst) {
                                      skippedFirst = true;
                                      continue;
                                  }
                                  const newItem = {};
                                  newItem.path = item['d:href'].slice(19);
                                  let props = {};
                                  if (Array.isArray(item['d:propstat'])) {
                                      props = item['d:propstat'][0]['d:prop'];
                                  }
                                  else {
                                      props = item['d:propstat']['d:prop'];
                                  }
                                  for (const propName of Object.keys(propNames)) {
                                      if (props[propName] !== undefined) {
                                          newItem[propNames[propName]] = props[propName];
                                      }
                                  }
                                  if (props['d:resourcetype'] === '') {
                                      newItem.type = 'file';
                                  }
                                  else {
                                      newItem.type = 'folder';
                                  }
                                  newItem.eTag = props['d:getetag'].slice(1, -1);
                                  returnData.push({ json: newItem, pairedItem: { item: i } });
                              }
                          }
                      }
                  }
                  else {
                      const executionData = this.helpers.constructExecutionMetaData((0, utilities_1.wrapData)(responseData), {
                          itemData: { item: i },
                      });
                      returnData.push(...executionData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (resource === 'file' && operation === 'download') {
                          items[i].json = { error: error.message };
                      }
                      else {
                          returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (resource === 'file' && operation === 'download') {
              return [items];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.NextCloud = NextCloud;
  //# sourceMappingURL=NextCloud.node.js.map

package_info:
[cell repeats an earlier one in this file: 36903 characters]


