# nodes

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

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


node_type: n8n-nodes-base.CrowdDev
name: CrowdDev
package_name: n8n-nodes-base
display_name: crowd.dev
code_hash: b178a065b61c6a7c856f8750043d0f368f7c2561ccb062a045c83c17eabe4328
source_location: node_modules/n8n-nodes-base/dist/nodes/CrowdDev/CrowdDev.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
description:
  crowd.dev is an open-source suite of community and data tools built to unlock community-led growth for your organization.

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

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


node_type: n8n-nodes-base.Crypto
name: Crypto
package_name: n8n-nodes-base
display_name: Crypto
description: Provide cryptographic utilities
code_hash: 7a50ea2285a5de3700af151f5206c08e3d41cc364c489065753c65892983c9f9
source_location: node_modules/n8n-nodes-base/dist/nodes/Crypto/Crypto.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
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.Crypto = void 0;
  const set_1 = __importDefault(require("lodash/set"));
  const n8n_workflow_1 = require("n8n-workflow");
  const crypto_1 = require("crypto");
  const stream_1 = __importDefault(require("stream"));
  const util_1 = require("util");
  const uuid_1 = require("uuid");
  const pipeline = (0, util_1.promisify)(stream_1.default.pipeline);
  const unsupportedAlgorithms = [
      'RSA-MD4',
      'RSA-MDC2',
      'md4',
      'md4WithRSAEncryption',
      'mdc2',
      'mdc2WithRSA',
  ];
  const supportedAlgorithms = (0, crypto_1.getHashes)()
      .filter((algorithm) => !unsupportedAlgorithms.includes(algorithm))
      .map((algorithm) => ({ name: algorithm, value: algorithm }));
  class Crypto {
      constructor() {
          this.description = {
              displayName: 'Crypto',
              name: 'crypto',
              icon: 'fa:key',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["action"]}}',
              description: 'Provide cryptographic utilities',
              defaults: {
                  name: 'Crypto',
                  color: '#408000',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Action',
                      name: 'action',
                      type: 'options',
                      options: [
                          {
                              name: 'Generate',
                              description: 'Generate random string',
                              value: 'generate',
                              action: 'Generate random string',
                          },
                          {
                              name: 'Hash',
                              description: 'Hash a text or file in a specified format',
                              value: 'hash',
                              action: 'Hash a text or file in a specified format',
                          },
                          {
                              name: 'Hmac',
                              description: 'Hmac a text or file in a specified format',
                              value: 'hmac',
                              action: 'HMAC a text or file in a specified format',
                          },
                          {
                              name: 'Sign',
                              description: 'Sign a string using a private key',
                              value: 'sign',
                              action: 'Sign a string using a private key',
                          },
                      ],
                      default: 'hash',
                  },
                  {
                      displayName: 'Type',
                      name: 'type',
                      displayOptions: {
                          show: {
                              action: ['hash'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'MD5',
                              value: 'MD5',
                          },
                          {
                              name: 'SHA256',
                              value: 'SHA256',
                          },
                          {
                              name: 'SHA3-256',
                              value: 'SHA3-256',
                          },
                          {
                              name: 'SHA3-384',
                              value: 'SHA3-384',
                          },
                          {
                              name: 'SHA3-512',
                              value: 'SHA3-512',
                          },
                          {
                              name: 'SHA384',
                              value: 'SHA384',
                          },
                          {
                              name: 'SHA512',
                              value: 'SHA512',
                          },
                      ],
                      default: 'MD5',
                      description: 'The hash type to use',
                      required: true,
                  },
                  {
                      displayName: 'Binary Data',
                      name: 'binaryData',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['hash', 'hmac'],
                          },
                      },
                      description: 'Whether the data to hashed should be taken from binary field',
                  },
                  {
                      displayName: 'Binary Property Name',
                      name: 'binaryPropertyName',
                      displayOptions: {
                          show: {
                              action: ['hash', 'hmac'],
                              binaryData: [true],
                          },
                      },
                      type: 'string',
                      default: 'data',
                      description: 'Name of the binary property which contains the input data',
                      required: true,
                  },
                  {
                      displayName: 'Value',
                      name: 'value',
                      displayOptions: {
                          show: {
                              action: ['hash'],
                              binaryData: [false],
                          },
                      },
                      type: 'string',
                      default: '',
                      description: 'The value that should be hashed',
                      required: true,
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['hash'],
                          },
                      },
                      description: 'Name of the property to which to write the hash',
                  },
                  {
                      displayName: 'Encoding',
                      name: 'encoding',
                      displayOptions: {
                          show: {
                              action: ['hash'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'BASE64',
                              value: 'base64',
                          },
                          {
                              name: 'HEX',
                              value: 'hex',
                          },
                      ],
                      default: 'hex',
                      required: true,
                  },
                  {
                      displayName: 'Type',
                      name: 'type',
                      displayOptions: {
                          show: {
                              action: ['hmac'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'MD5',
                              value: 'MD5',
                          },
                          {
                              name: 'SHA256',
                              value: 'SHA256',
                          },
                          {
                              name: 'SHA3-256',
                              value: 'SHA3-256',
                          },
                          {
                              name: 'SHA3-384',
                              value: 'SHA3-384',
                          },
                          {
                              name: 'SHA3-512',
                              value: 'SHA3-512',
                          },
                          {
                              name: 'SHA384',
                              value: 'SHA384',
                          },
                          {
                              name: 'SHA512',
                              value: 'SHA512',
                          },
                      ],
                      default: 'MD5',
                      description: 'The hash type to use',
                      required: true,
                  },
                  {
                      displayName: 'Value',
                      name: 'value',
                      displayOptions: {
                          show: {
                              action: ['hmac'],
                              binaryData: [false],
                          },
                      },
                      type: 'string',
                      default: '',
                      description: 'The value of which the hmac should be created',
                      required: true,
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['hmac'],
                          },
                      },
                      description: 'Name of the property to which to write the hmac',
                  },
                  {
                      displayName: 'Secret',
                      name: 'secret',
                      displayOptions: {
                          show: {
                              action: ['hmac'],
                          },
                      },
                      type: 'string',
                      typeOptions: { password: true },
                      default: '',
                      required: true,
                  },
                  {
                      displayName: 'Encoding',
                      name: 'encoding',
                      displayOptions: {
                          show: {
                              action: ['hmac'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'BASE64',
                              value: 'base64',
                          },
                          {
                              name: 'HEX',
                              value: 'hex',
                          },
                      ],
                      default: 'hex',
                      required: true,
                  },
                  {
                      displayName: 'Value',
                      name: 'value',
                      displayOptions: {
                          show: {
                              action: ['sign'],
                              binaryData: [false],
                          },
                      },
                      type: 'string',
                      default: '',
                      description: 'The value that should be signed',
                      required: true,
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['sign'],
                          },
                      },
                      description: 'Name of the property to which to write the signed value',
                  },
                  {
                      displayName: 'Algorithm Name or ID',
                      name: 'algorithm',
                      displayOptions: {
                          show: {
                              action: ['sign'],
                          },
                      },
                      type: 'options',
                      description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                      options: supportedAlgorithms,
                      default: '',
                      required: true,
                  },
                  {
                      displayName: 'Encoding',
                      name: 'encoding',
                      displayOptions: {
                          show: {
                              action: ['sign'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'BASE64',
                              value: 'base64',
                          },
                          {
                              name: 'HEX',
                              value: 'hex',
                          },
                      ],
                      default: 'hex',
                      required: true,
                  },
                  {
                      displayName: 'Private Key',
                      name: 'privateKey',
                      displayOptions: {
                          show: {
                              action: ['sign'],
                          },
                      },
                      type: 'string',
                      description: 'Private key to use when signing the string',
                      default: '',
                      required: true,
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['generate'],
                          },
                      },
                      description: 'Name of the property to which to write the random string',
                  },
                  {
                      displayName: 'Type',
                      name: 'encodingType',
                      displayOptions: {
                          show: {
                              action: ['generate'],
                          },
                      },
                      type: 'options',
                      options: [
                          {
                              name: 'ASCII',
                              value: 'ascii',
                          },
                          {
                              name: 'BASE64',
                              value: 'base64',
                          },
                          {
                              name: 'HEX',
                              value: 'hex',
                          },
                          {
                              name: 'UUID',
                              value: 'uuid',
                          },
                      ],
                      default: 'uuid',
                      description: 'Encoding that will be used to generate string',
                      required: true,
                  },
                  {
                      displayName: 'Length',
                      name: 'stringLength',
                      type: 'number',
                      default: 32,
                      description: 'Length of the generated string',
                      displayOptions: {
                          show: {
                              action: ['generate'],
                              encodingType: ['ascii', 'base64', 'hex'],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const action = this.getNodeParameter('action', 0);
          let item;
          for (let i = 0; i < length; i++) {
              try {
                  item = items[i];
                  const dataPropertyName = this.getNodeParameter('dataPropertyName', i);
                  const value = this.getNodeParameter('value', i, '');
                  let newValue;
                  let binaryProcessed = false;
                  if (action === 'generate') {
                      const encodingType = this.getNodeParameter('encodingType', i);
                      if (encodingType === 'uuid') {
                          newValue = (0, uuid_1.v4)();
                      }
                      else {
                          const stringLength = this.getNodeParameter('stringLength', i);
                          if (encodingType === 'base64') {
                              newValue = (0, crypto_1.randomBytes)(stringLength)
                                  .toString(encodingType)
                                  .replace(/\W/g, '')
                                  .slice(0, stringLength);
                          }
                          else {
                              newValue = (0, crypto_1.randomBytes)(stringLength)
                                  .toString(encodingType)
                                  .slice(0, stringLength);
                          }
                      }
                  }
                  if (action === 'hash' || action === 'hmac') {
                      const type = this.getNodeParameter('type', i);
                      const encoding = this.getNodeParameter('encoding', i);
                      const hashOrHmac = action === 'hash'
                          ? (0, crypto_1.createHash)(type)
                          : (0, crypto_1.createHmac)(type, this.getNodeParameter('secret', i));
                      if (this.getNodeParameter('binaryData', i)) {
                          const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                          const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                          if (binaryData.id) {
                              const binaryStream = await this.helpers.getBinaryStream(binaryData.id);
                              hashOrHmac.setEncoding(encoding);
                              await pipeline(binaryStream, hashOrHmac);
                              newValue = hashOrHmac.read();
                          }
                          else {
                              newValue = hashOrHmac
                                  .update(Buffer.from(binaryData.data, n8n_workflow_1.BINARY_ENCODING))
                                  .digest(encoding);
                          }
                          binaryProcessed = true;
                      }
                      else {
                          newValue = hashOrHmac.update(value).digest(encoding);
                      }
                  }
                  if (action === 'sign') {
                      const algorithm = this.getNodeParameter('algorithm', i);
                      const encoding = this.getNodeParameter('encoding', i);
                      const privateKey = this.getNodeParameter('privateKey', i);
                      const sign = (0, crypto_1.createSign)(algorithm);
                      sign.write(value);
                      sign.end();
                      newValue = sign.sign(privateKey, encoding);
                  }
                  let newItem;
                  if (dataPropertyName.includes('.')) {
                      newItem = {
                          json: (0, n8n_workflow_1.deepCopy)(item.json),
                          pairedItem: {
                              item: i,
                          },
                      };
                  }
                  else {
                      newItem = {
                          json: { ...item.json },
                          pairedItem: {
                              item: i,
                          },
                      };
                  }
                  if (item.binary !== undefined && !binaryProcessed) {
                      newItem.binary = item.binary;
                  }
                  (0, set_1.default)(newItem, `json.${dataPropertyName}`, newValue);
                  returnData.push(newItem);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: i,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Crypto = Crypto;
  //# sourceMappingURL=Crypto.node.js.map

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


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

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


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

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


node_type: n8n-nodes-base.DebugHelper
name: DebugHelper
package_name: n8n-nodes-base
display_name: DebugHelper
description: Causes problems intentionally and generates useful data for debugging
code_hash: 99860b55ee895e997c0b43cadcbc1cd28f38a4470e193192da8c35415129dd2e
source_location: node_modules/n8n-nodes-base/dist/nodes/DebugHelper/DebugHelper.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DebugHelper = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const randomData_1 = require("./randomData");
  const minifaker_1 = require("minifaker");
  const functions_1 = require("./functions");
  class DebugHelper {
      constructor() {
          this.description = {
              displayName: 'DebugHelper',
              name: 'debugHelper',
              icon: 'file:DebugHelper.svg',
              group: ['output'],
              subtitle: '={{$parameter["category"]}}',
              description: 'Causes problems intentionally and generates useful data for debugging',
              version: 1,
              defaults: {
                  name: 'DebugHelper',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [],
              properties: [
                  {
                      displayName: 'Category',
                      name: 'category',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Do Nothing',
                              value: 'doNothing',
                              description: 'Does nothing',
                          },
                          {
                              name: 'Throw Error',
                              value: 'throwError',
                              description: 'Throws an error with the specified type and message',
                          },
                          {
                              name: 'Out Of Memory',
                              value: 'oom',
                              description: 'Generates a large amount of memory to cause an out of memory error',
                          },
                          {
                              name: 'Generate Random Data',
                              value: 'randomData',
                              description: 'Generates random data sets',
                          },
                      ],
                      default: 'throwError',
                  },
                  {
                      displayName: 'Error Type',
                      name: 'throwErrorType',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'NodeApiError',
                              value: 'NodeApiError',
                          },
                          {
                              name: 'NodeOperationError',
                              value: 'NodeOperationError',
                          },
                          {
                              name: 'Error',
                              value: 'Error',
                          },
                      ],
                      default: 'NodeApiError',
                      displayOptions: {
                          show: {
                              category: ['throwError'],
                          },
                      },
                  },
                  {
                      displayName: 'Error Message',
                      name: 'throwErrorMessage',
                      type: 'string',
                      default: 'Node has thrown an error',
                      description: 'The message to send as part of the error',
                      displayOptions: {
                          show: {
                              category: ['throwError'],
                          },
                      },
                  },
                  {
                      displayName: 'Memory Size to Generate',
                      name: 'memorySizeValue',
                      type: 'number',
                      default: 10,
                      description: 'The approximate amount of memory to generate. Be generous...',
                      displayOptions: {
                          show: {
                              category: ['oom'],
                          },
                      },
                  },
                  {
                      displayName: 'Data Type',
                      name: 'randomDataType',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Address',
                              value: 'address',
                          },
                          {
                              name: 'Coordinates',
                              value: 'latLong',
                          },
                          {
                              name: 'Credit Card',
                              value: 'creditCard',
                          },
                          {
                              name: 'Email',
                              value: 'email',
                          },
                          {
                              name: 'IPv4',
                              value: 'ipv4',
                          },
                          {
                              name: 'IPv6',
                              value: 'ipv6',
                          },
                          {
                              name: 'MAC',
                              value: 'macAddress',
                          },
                          {
                              name: 'NanoIds',
                              value: 'nanoid',
                          },
                          {
                              name: 'URL',
                              value: 'url',
                          },
                          {
                              name: 'User Data',
                              value: 'user',
                          },
                          {
                              name: 'UUID',
                              value: 'uuid',
                          },
                          {
                              name: 'Version',
                              value: 'semver',
                          },
                      ],
                      default: 'user',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                          },
                      },
                  },
                  {
                      displayName: 'NanoId Alphabet',
                      name: 'nanoidAlphabet',
                      type: 'string',
                      default: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
                      description: 'The alphabet to use for generating the nanoIds',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                              randomDataType: ['nanoid'],
                          },
                      },
                  },
                  {
                      displayName: 'NanoId Length',
                      name: 'nanoidLength',
                      type: 'string',
                      default: '16',
                      description: 'The length of each nanoIds',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                              randomDataType: ['nanoid'],
                          },
                      },
                  },
                  {
                      displayName: 'Seed',
                      name: 'randomDataSeed',
                      type: 'string',
                      default: '',
                      placeholder: 'Leave empty for random seed',
                      description: 'If set, seed to use for generating the data (same seed will generate the same data)',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                          },
                      },
                  },
                  {
                      displayName: 'Number of Items to Generate',
                      name: 'randomDataCount',
                      type: 'number',
                      default: 10,
                      description: 'The number of random data items to generate into an array',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                          },
                      },
                  },
                  {
                      displayName: 'Output as Single Array',
                      name: 'randomDataSingleArray',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to output a single array instead of multiple items',
                      displayOptions: {
                          show: {
                              category: ['randomData'],
                          },
                      },
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const category = this.getNodeParameter('category', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  switch (category) {
                      case 'doNothing':
                          break;
                      case 'throwError':
                          const throwErrorType = this.getNodeParameter('throwErrorType', 0);
                          const throwErrorMessage = this.getNodeParameter('throwErrorMessage', 0);
                          switch (throwErrorType) {
                              case 'NodeApiError':
                                  throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: throwErrorMessage }, { message: throwErrorMessage });
                              case 'NodeOperationError':
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), throwErrorMessage, {
                                      message: throwErrorMessage,
                                  });
                              case 'Error':
                                  throw new Error(throwErrorMessage);
                              default:
                                  break;
                          }
                      case 'oom':
                          const memorySizeValue = this.getNodeParameter('memorySizeValue', 0);
                          (0, functions_1.runGarbageCollector)();
                          const memUsed = (0, functions_1.generateGarbageMemory)(memorySizeValue);
                          items[i].json = memUsed;
                          returnData.push(items[i]);
                          break;
                      case 'randomData':
                          const randomDataType = this.getNodeParameter('randomDataType', 0);
                          const randomDataCount = this.getNodeParameter('randomDataCount', 0);
                          const randomDataSeed = this.getNodeParameter('randomDataSeed', 0);
                          const randomDataSingleArray = this.getNodeParameter('randomDataSingleArray', 0);
                          const newItem = {
                              json: {},
                              pairedItem: { item: i },
                          };
                          if (randomDataSeed !== '') {
                              (0, minifaker_1.setSeed)(randomDataSeed);
                          }
                          let randomFn = randomData_1.generateRandomUser;
                          switch (randomDataType) {
                              case 'user':
                                  randomFn = randomData_1.generateRandomUser;
                                  break;
                              case 'email':
                                  randomFn = randomData_1.generateRandomEmail;
                                  break;
                              case 'address':
                                  randomFn = randomData_1.generateRandomAddress;
                                  break;
                              case 'creditCard':
                                  randomFn = randomData_1.generateCreditCard;
                                  break;
                              case 'uuid':
                                  randomFn = randomData_1.generateUUID;
                                  break;
                              case 'macAddress':
                                  randomFn = randomData_1.generateMAC;
                                  break;
                              case 'ipv4':
                                  randomFn = randomData_1.generateIPv4;
                                  break;
                              case 'ipv6':
                                  randomFn = randomData_1.generateIPv6;
                                  break;
                              case 'latLong':
                                  randomFn = randomData_1.generateLocation;
                                  break;
                              case 'semver':
                                  randomFn = randomData_1.generateVersion;
                                  break;
                              case 'url':
                                  randomFn = randomData_1.generateURL;
                                  break;
                              case 'nanoid':
                                  const nanoidAlphabet = this.getNodeParameter('nanoidAlphabet', 0);
                                  const nanoidLength = this.getNodeParameter('nanoidLength', 0);
                                  randomFn = () => (0, randomData_1.generateNanoid)(nanoidAlphabet, nanoidLength);
                                  break;
                          }
                          const generatedItems = (0, minifaker_1.array)(randomDataCount, randomFn);
                          if (randomDataSingleArray) {
                              newItem.json = { generatedItems };
                              returnData.push(newItem);
                          }
                          else {
                              for (const generatedItem of generatedItems) {
                                  returnData.push({
                                      json: generatedItem,
                                      pairedItem: { item: i },
                                  });
                              }
                          }
                          break;
                      default:
                          break;
                  }
              }
              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.DebugHelper = DebugHelper;
  //# sourceMappingURL=DebugHelper.node.js.map

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


node_type: n8n-nodes-base.DeepL
name: DeepL
package_name: n8n-nodes-base
display_name: DeepL
description: Translate data using DeepL
code_hash: 2f0799ff8ae4cf89ec968e13020a9731fa3ab1c20901ec795d3ba76c39ab01da
source_location: node_modules/n8n-nodes-base/dist/nodes/DeepL/DeepL.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DeepL = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const TextDescription_1 = require("./TextDescription");
  class DeepL {
      constructor() {
          this.description = {
              displayName: 'DeepL',
              name: 'deepL',
              icon: 'file:deepl.svg',
              group: ['input', 'output'],
              version: 1,
              description: 'Translate data using DeepL',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'DeepL',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'deepLApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Language',
                              value: 'language',
                          },
                      ],
                      default: 'language',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['language'],
                          },
                      },
                      options: [
                          {
                              name: 'Translate',
                              value: 'translate',
                              description: 'Translate data',
                              action: 'Translate a language',
                          },
                      ],
                      default: 'translate',
                  },
                  ...TextDescription_1.textOperations,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLanguages() {
                      const returnData = [];
                      const languages = await GenericFunctions_1.deepLApiRequest.call(this, 'GET', '/languages', {}, { type: 'target' });
                      for (const language of languages) {
                          returnData.push({
                              name: language.name,
                              value: language.language,
                          });
                      }
                      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 length = items.length;
          const responseData = [];
          for (let i = 0; i < length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', i);
                  const operation = this.getNodeParameter('operation', i);
                  const additionalFields = this.getNodeParameter('additionalFields', i);
                  if (resource === 'language') {
                      if (operation === 'translate') {
                          let body = {};
                          const text = this.getNodeParameter('text', i);
                          const translateTo = this.getNodeParameter('translateTo', i);
                          body = { target_lang: translateTo, text };
                          if (additionalFields.sourceLang !== undefined) {
                              body.source_lang = ['EN-GB', 'EN-US'].includes(additionalFields.sourceLang)
                                  ? 'EN'
                                  : additionalFields.sourceLang;
                          }
                          const { translations } = await GenericFunctions_1.deepLApiRequest.call(this, 'GET', '/translate', body);
                          const [translation] = translations;
                          const translationJsonArray = this.helpers.returnJsonArray(translation);
                          const executionData = this.helpers.constructExecutionMetaData(translationJsonArray, {
                              itemData: { item: i },
                          });
                          responseData.push(...executionData);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = {
                          json: {},
                          error: error.message,
                          itemIndex: i,
                      };
                      responseData.push(executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [responseData];
      }
  }
  exports.DeepL = DeepL;
  //# sourceMappingURL=DeepL.node.js.map

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


node_type: n8n-nodes-base.Demio
name: Demio
package_name: n8n-nodes-base
display_name: Demio
description: Consume the Demio API
code_hash: d6ea744bbf875d383eda88e547a021439f0d054f320f0c969131e2c79ffbec5f
source_location: node_modules/n8n-nodes-base/dist/nodes/Demio/Demio.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Demio = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const EventDescription_1 = require("./EventDescription");
  const ReportDescription_1 = require("./ReportDescription");
  class Demio {
      constructor() {
          this.description = {
              displayName: 'Demio',
              name: 'demio',
              icon: 'file:demio.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Demio API',
              defaults: {
                  name: 'Demio',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'demioApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Report',
                              value: 'report',
                          },
                      ],
                      default: 'event',
                  },
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...ReportDescription_1.reportOperations,
                  ...ReportDescription_1.reportFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getEvents() {
                      const returnData = [];
                      const events = await GenericFunctions_1.demioApiRequest.call(this, 'GET', '/events', {}, { type: 'upcoming' });
                      for (const event of events) {
                          returnData.push({
                              name: event.name,
                              value: event.id,
                          });
                      }
                      return returnData;
                  },
                  async getEventSessions() {
                      const eventId = this.getCurrentNodeParameter('eventId');
                      const qs = {};
                      const resource = this.getCurrentNodeParameter('resource');
                      if (resource !== 'report') {
                          qs.active = true;
                      }
                      const returnData = [];
                      const { dates } = await GenericFunctions_1.demioApiRequest.call(this, 'GET', `/event/${eventId}`, {});
                      for (const date of dates) {
                          returnData.push({
                              name: date.datetime,
                              value: date.date_id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          var _a;
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'event') {
                      if (operation === 'get') {
                          const id = this.getNodeParameter('eventId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.date_id !== undefined) {
                              responseData = await GenericFunctions_1.demioApiRequest.call(this, 'GET', `/event/${id}/date/${additionalFields.date_id}`);
                          }
                          else {
                              Object.assign(qs, additionalFields);
                              responseData = await GenericFunctions_1.demioApiRequest.call(this, 'GET', `/event/${id}`, {}, qs);
                          }
                      }
                      if (operation === 'getAll') {
                          const filters = this.getNodeParameter('filters', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          Object.assign(qs, filters);
                          responseData = await GenericFunctions_1.demioApiRequest.call(this, 'GET', '/events', {}, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'register') {
                          const eventId = this.getNodeParameter('eventId', i);
                          const firstName = this.getNodeParameter('firstName', i);
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name: firstName,
                              email,
                              id: eventId,
                          };
                          Object.assign(body, additionalFields);
                          if (additionalFields.customFieldsUi) {
                              const customFields = ((_a = additionalFields.customFieldsUi) === null || _a === void 0 ? void 0 : _a.customFieldsValues) || [];
                              const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldId}`]: value.value }), {});
                              Object.assign(body, data);
                              delete additionalFields.customFields;
                          }
                          responseData = await GenericFunctions_1.demioApiRequest.call(this, 'PUT', '/event/register', body);
                      }
                  }
                  if (resource === 'report') {
                      if (operation === 'get') {
                          const sessionId = this.getNodeParameter('dateId', i);
                          const filters = this.getNodeParameter('filters', i);
                          Object.assign(qs, filters);
                          responseData = await GenericFunctions_1.demioApiRequest.call(this, 'GET', `/report/${sessionId}/participants`, {}, qs);
                          responseData = responseData.participants;
                      }
                  }
                  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.Demio = Demio;
  //# sourceMappingURL=Demio.node.js.map

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


node_type: n8n-nodes-base.Dhl
name: Dhl
package_name: n8n-nodes-base
display_name: DHL
description: Consume DHL API
code_hash: 5ba971626f7a362156d95e63342aa84feae7892e38bf3e03ba7b6fd0027b98f6
source_location: node_modules/n8n-nodes-base/dist/nodes/Dhl/Dhl.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Dhl = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Dhl {
      constructor() {
          this.description = {
              displayName: 'DHL',
              name: 'dhl',
              icon: 'file:dhl.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume DHL API',
              defaults: {
                  name: 'DHL',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'dhlApi',
                      required: true,
                      testedBy: 'dhlApiCredentialTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'hidden',
                      options: [
                          {
                              name: 'Shipment',
                              value: 'shipment',
                          },
                      ],
                      default: 'shipment',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['shipment'],
                          },
                      },
                      options: [
                          {
                              name: 'Get Tracking Details',
                              value: 'get',
                              action: 'Get tracking details for a shipment',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Tracking Number',
                      name: 'trackingNumber',
                      type: 'string',
                      required: true,
                      default: '',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: "Recipient's Postal Code",
                              name: 'recipientPostalCode',
                              type: 'string',
                              default: '',
                              description: "DHL will return more detailed information on the shipment when you provide the Recipient's Postal Code - it acts as a verification step",
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              credentialTest: {
                  async dhlApiCredentialTest(credential) {
                      try {
                          await GenericFunctions_1.validateCredentials.call(this, credential.data);
                      }
                      catch (error) {
                          if (error.statusCode === 401) {
                              return {
                                  status: 'Error',
                                  message: 'The API Key included in the request is invalid',
                              };
                          }
                      }
                      return {
                          status: 'OK',
                          message: 'Connection successful!',
                      };
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'shipment') {
                      if (operation === 'get') {
                          const trackingNumber = this.getNodeParameter('trackingNumber', i);
                          const options = this.getNodeParameter('options', i);
                          qs = {
                              trackingNumber,
                          };
                          Object.assign(qs, options);
                          responseData = await GenericFunctions_1.dhlApiRequest.call(this, 'GET', '/track/shipments', {}, qs);
                          returnData.push(...responseData.shipments);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.description });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Dhl = Dhl;
  //# sourceMappingURL=Dhl.node.js.map

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


node_type: n8n-nodes-base.Discord
name: Discord
package_name: n8n-nodes-base
display_name: Discord
description: Sends data to Discord
code_hash: 4995f9ca5c5b57d2486c2e320cc7505238e7f2260861f7e321b44b45ccabeb00
source_location: node_modules/n8n-nodes-base/dist/nodes/Discord/Discord.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Discord = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class Discord {
      constructor() {
          this.description = {
              displayName: 'Discord',
              name: 'discord',
              icon: 'file:discord.svg',
              group: ['output'],
              version: 1,
              description: 'Sends data to Discord',
              defaults: {
                  name: 'Discord',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Webhook URL',
                      name: 'webhookUri',
                      type: 'string',
                      required: true,
                      default: '',
                      placeholder: 'https://discord.com/api/webhooks/ID/TOKEN',
                  },
                  {
                      displayName: 'Content',
                      name: 'text',
                      type: 'string',
                      typeOptions: {
                          maxValue: 2000,
                      },
                      default: '',
                      placeholder: 'Hello World!',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Allowed Mentions',
                              name: 'allowedMentions',
                              type: 'json',
                              typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
                              default: '',
                          },
                          {
                              displayName: 'Attachments',
                              name: 'attachments',
                              type: 'json',
                              typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
                              default: '',
                          },
                          {
                              displayName: 'Avatar URL',
                              name: 'avatarUrl',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Components',
                              name: 'components',
                              type: 'json',
                              typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
                              default: '',
                          },
                          {
                              displayName: 'Embeds',
                              name: 'embeds',
                              type: 'json',
                              typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
                              default: '',
                          },
                          {
                              displayName: 'Flags',
                              name: 'flags',
                              type: 'number',
                              default: '',
                          },
                          {
                              displayName: 'JSON Payload',
                              name: 'payloadJson',
                              type: 'json',
                              typeOptions: { alwaysOpenEditWindow: true, editor: 'code' },
                              default: '',
                          },
                          {
                              displayName: 'Username',
                              name: 'username',
                              type: 'string',
                              default: '',
                              placeholder: 'User',
                          },
                          {
                              displayName: 'TTS',
                              name: 'tts',
                              type: 'boolean',
                              default: false,
                              description: 'Whether this message be sent as a Text To Speech message',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          var _a;
          const returnData = [];
          const webhookUri = this.getNodeParameter('webhookUri', 0, '');
          if (!webhookUri)
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Webhook uri is required.');
          const items = this.getInputData();
          const length = items.length;
          for (let i = 0; i < length; i++) {
              const body = {};
              const iterationWebhookUri = this.getNodeParameter('webhookUri', i);
              body.content = this.getNodeParameter('text', i);
              const options = this.getNodeParameter('options', i);
              if (!body.content && !options.embeds) {
                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Either content or embeds must be set.', {
                      itemIndex: i,
                  });
              }
              if (options.embeds) {
                  try {
                      body.embeds = JSON.parse(options.embeds);
                  }
                  catch (e) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Embeds must be valid JSON.', {
                          itemIndex: i,
                      });
                  }
                  if (!Array.isArray(body.embeds)) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Embeds must be an array of embeds.', {
                          itemIndex: i,
                      });
                  }
              }
              if (options.username) {
                  body.username = options.username;
              }
              if (options.components) {
                  try {
                      body.components = JSON.parse(options.components);
                  }
                  catch (e) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Components must be valid JSON.', {
                          itemIndex: i,
                      });
                  }
              }
              if (options.allowed_mentions) {
                  body.allowed_mentions = (0, n8n_workflow_1.jsonParse)(options.allowed_mentions);
              }
              if (options.avatarUrl) {
                  body.avatar_url = options.avatarUrl;
              }
              if (options.flags) {
                  body.flags = options.flags;
              }
              if (options.tts) {
                  body.tts = options.tts;
              }
              if (options.payloadJson) {
                  body.payload_json = (0, n8n_workflow_1.jsonParse)(options.payloadJson);
              }
              if (options.attachments) {
                  body.attachments = (0, n8n_workflow_1.jsonParse)(options.attachments);
              }
              if (!body.content)
                  delete body.content;
              if (!body.username)
                  delete body.username;
              if (!body.avatar_url)
                  delete body.avatar_url;
              if (!body.embeds)
                  delete body.embeds;
              if (!body.allowed_mentions)
                  delete body.allowed_mentions;
              if (!body.flags)
                  delete body.flags;
              if (!body.components)
                  delete body.components;
              if (!body.payload_json)
                  delete body.payload_json;
              if (!body.attachments)
                  delete body.attachments;
              let requestOptions;
              if (!body.payload_json) {
                  requestOptions = {
                      resolveWithFullResponse: true,
                      method: 'POST',
                      body,
                      uri: iterationWebhookUri,
                      headers: {
                          'content-type': 'application/json; charset=utf-8',
                      },
                      json: true,
                  };
              }
              else {
                  requestOptions = {
                      resolveWithFullResponse: true,
                      method: 'POST',
                      body,
                      uri: iterationWebhookUri,
                      headers: {
                          'content-type': 'multipart/form-data; charset=utf-8',
                      },
                  };
              }
              let maxTries = 5;
              let response;
              do {
                  try {
                      response = await this.helpers.request(requestOptions);
                      const resetAfter = response.headers['x-ratelimit-reset-after'] * 1000;
                      const remainingRatelimit = response.headers['x-ratelimit-remaining'];
                      if (!+remainingRatelimit) {
                          await (0, n8n_workflow_1.sleep)(resetAfter !== null && resetAfter !== void 0 ? resetAfter : 1000);
                      }
                      break;
                  }
                  catch (error) {
                      if (error.statusCode === 429) {
                          const retryAfter = ((_a = error.response) === null || _a === void 0 ? void 0 : _a.headers['retry-after']) || 1000;
                          await (0, n8n_workflow_1.sleep)(+retryAfter);
                          continue;
                      }
                      throw error;
                  }
              } while (--maxTries);
              if (maxTries <= 0) {
                  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
                      error: 'Could not send Webhook message. Max amount of rate-limit retries reached.',
                  });
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Discord = Discord;
  //# sourceMappingURL=Discord.node.js.map

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


node_type: n8n-nodes-base.Discourse
name: Discourse
package_name: n8n-nodes-base
display_name: Discourse
description: Consume Discourse API
code_hash: 2f5ce8de0ffd9c8043ec6593bec94991a63023117f784366a8628ec0778e08cf
source_location: node_modules/n8n-nodes-base/dist/nodes/Discourse/Discourse.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Discourse = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const PostDescription_1 = require("./PostDescription");
  const CategoryDescription_1 = require("./CategoryDescription");
  const GroupDescription_1 = require("./GroupDescription");
  const UserDescription_1 = require("./UserDescription");
  const UserGroupDescription_1 = require("./UserGroupDescription");
  class Discourse {
      constructor() {
          this.description = {
              displayName: 'Discourse',
              name: 'discourse',
              icon: 'file:discourse.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Discourse API',
              defaults: {
                  name: 'Discourse',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'discourseApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Category',
                              value: 'category',
                          },
                          {
                              name: 'Group',
                              value: 'group',
                          },
                          {
                              name: 'Post',
                              value: 'post',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                          {
                              name: 'User Group',
                              value: 'userGroup',
                          },
                      ],
                      default: 'post',
                  },
                  ...CategoryDescription_1.categoryOperations,
                  ...CategoryDescription_1.categoryFields,
                  ...GroupDescription_1.groupOperations,
                  ...GroupDescription_1.groupFields,
                  ...PostDescription_1.postOperations,
                  ...PostDescription_1.postFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
                  ...UserGroupDescription_1.userGroupOperations,
                  ...UserGroupDescription_1.userGroupFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCategories() {
                      const returnData = [];
                      const { category_list } = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', '/categories.json');
                      for (const category of category_list.categories) {
                          returnData.push({
                              name: category.name,
                              value: category.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'category') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const color = this.getNodeParameter('color', i);
                          const textColor = this.getNodeParameter('textColor', i);
                          const body = {
                              name,
                              color,
                              text_color: textColor,
                          };
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'POST', '/categories.json', body);
                          responseData = responseData.category;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', '/categories.json', {}, qs);
                          responseData = responseData.category_list.categories;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const categoryId = this.getNodeParameter('categoryId', i);
                          const name = this.getNodeParameter('name', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              name,
                          };
                          Object.assign(body, updateFields);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'PUT', `/categories/${categoryId}.json`, body);
                          responseData = responseData.category;
                      }
                  }
                  if (resource === 'group') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'POST', '/admin/groups.json', {
                              group: body,
                          });
                          responseData = responseData.basic_group;
                      }
                      if (operation === 'get') {
                          const name = this.getNodeParameter('name', i);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', `/groups/${name}`, {}, qs);
                          responseData = responseData.group;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', '/groups.json', {}, qs);
                          responseData = responseData.groups;
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const groupId = this.getNodeParameter('groupId', i);
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'PUT', `/groups/${groupId}.json`, {
                              group: body,
                          });
                      }
                  }
                  if (resource === 'post') {
                      if (operation === 'create') {
                          const content = this.getNodeParameter('content', i);
                          const title = this.getNodeParameter('title', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              title,
                              raw: content,
                          };
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'POST', '/posts.json', body);
                      }
                      if (operation === 'get') {
                          const postId = this.getNodeParameter('postId', i);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', `/posts/${postId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = this.getNodeParameter('limit', i, 0);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', '/posts.json', {}, qs);
                          responseData = responseData.latest_posts;
                          let lastPost = responseData.pop();
                          let previousLastPostID;
                          while (lastPost.id !== previousLastPostID) {
                              if (limit && responseData.length > limit) {
                                  break;
                              }
                              const chunk = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', `/posts.json?before=${lastPost.id}`, {}, qs);
                              responseData = responseData.concat(chunk.latest_posts);
                              previousLastPostID = lastPost.id;
                              lastPost = responseData.pop();
                          }
                          responseData.push(lastPost);
                          if (!returnAll) {
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const postId = this.getNodeParameter('postId', i);
                          const content = this.getNodeParameter('content', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              raw: content,
                          };
                          Object.assign(body, updateFields);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'PUT', `/posts/${postId}.json`, body);
                          responseData = responseData.post;
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const email = this.getNodeParameter('email', i);
                          const password = this.getNodeParameter('password', i);
                          const username = this.getNodeParameter('username', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                              password,
                              email,
                              username,
                          };
                          Object.assign(body, additionalFields);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'POST', '/users.json', body);
                      }
                      if (operation === 'get') {
                          const by = this.getNodeParameter('by', i);
                          let endpoint = '';
                          if (by === 'username') {
                              const username = this.getNodeParameter('username', i);
                              endpoint = `/users/${username}`;
                          }
                          else if (by === 'externalId') {
                              const externalId = this.getNodeParameter('externalId', i);
                              endpoint = `/u/by-external/${externalId}.json`;
                          }
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', endpoint);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const flag = this.getNodeParameter('flag', i);
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'GET', `/admin/users/list/${flag}.json`, {}, qs);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  if (resource === 'userGroup') {
                      if (operation === 'add') {
                          const usernames = this.getNodeParameter('usernames', i);
                          const groupId = this.getNodeParameter('groupId', i);
                          const body = {
                              usernames,
                          };
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'PUT', `/groups/${groupId}/members.json`, body);
                      }
                      if (operation === 'remove') {
                          const usernames = this.getNodeParameter('usernames', i);
                          const groupId = this.getNodeParameter('groupId', i);
                          const body = {
                              usernames,
                          };
                          responseData = await GenericFunctions_1.discourseApiRequest.call(this, 'DELETE', `/groups/${groupId}/members.json`, body);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Discourse = Discourse;
  //# sourceMappingURL=Discourse.node.js.map

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


node_type: n8n-nodes-base.Disqus
name: Disqus
package_name: n8n-nodes-base
display_name: Disqus
description: Access data on Disqus
code_hash: c60402500e1aea71c7e4e7a76fe768b72f3894831b6a69851fd8ec5bdfa43931
source_location: node_modules/n8n-nodes-base/dist/nodes/Disqus/Disqus.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Disqus = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Disqus {
      constructor() {
          this.description = {
              displayName: 'Disqus',
              name: 'disqus',
              icon: 'file:disqus.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Access data on Disqus',
              defaults: {
                  name: 'Disqus',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'disqusApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Forum',
                              value: 'forum',
                          },
                      ],
                      default: 'forum',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                          },
                      },
                      options: [
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Return forum details',
                              action: 'Get a forum',
                          },
                          {
                              name: 'Get All Categories',
                              value: 'getCategories',
                              description: 'Return a list of categories within a forum',
                              action: 'Get all categories in a forum',
                          },
                          {
                              name: 'Get All Threads',
                              value: 'getThreads',
                              description: 'Return a list of threads within a forum',
                              action: 'Get all threads in a forum',
                          },
                          {
                              name: 'Get All Posts',
                              value: 'getPosts',
                              description: 'Return a list of posts within a forum',
                              action: 'Get all posts in a forum',
                          },
                      ],
                      default: 'get',
                  },
                  {
                      displayName: 'Forum Name',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['forum'],
                          },
                      },
                      description: 'The short name(aka ID) of the forum to get',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['forum'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Attach',
                              name: 'attach',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Counters',
                                      value: 'counters',
                                  },
                                  {
                                      name: 'followsForum',
                                      value: 'followsForum',
                                  },
                                  {
                                      name: 'forumCanDisableAds',
                                      value: 'forumCanDisableAds',
                                  },
                                  {
                                      name: 'forumDaysAlive',
                                      value: 'forumDaysAlive',
                                  },
                                  {
                                      name: 'forumFeatures',
                                      value: 'forumFeatures',
                                  },
                                  {
                                      name: 'forumForumCategory',
                                      value: 'forumForumCategory',
                                  },
                                  {
                                      name: 'forumIntegration',
                                      value: 'forumIntegration',
                                  },
                                  {
                                      name: 'forumNewPolicy',
                                      value: 'forumNewPolicy',
                                  },
                                  {
                                      name: 'forumPermissions',
                                      value: 'forumPermissions',
                                  },
                              ],
                              default: [],
                          },
                          {
                              displayName: 'Related',
                              name: 'related',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'author',
                                      value: 'author',
                                  },
                              ],
                              default: [],
                              description: 'You may specify relations to include with your response',
                          },
                      ],
                  },
                  {
                      displayName: 'Forum Name',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getPosts'],
                              resource: ['forum'],
                          },
                      },
                      description: 'The short name(aka ID) of the forum to get',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getPosts'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getPosts'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getPosts'],
                              resource: ['forum'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Filters',
                              name: 'filters',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Has_Bad_Word',
                                      value: 'Has_Bad_Word',
                                  },
                                  {
                                      name: 'Has_Link',
                                      value: 'Has_Link',
                                  },
                                  {
                                      name: 'Has_Low_Rep_Author',
                                      value: 'Has_Low_Rep_Author',
                                  },
                                  {
                                      name: 'Has_Media',
                                      value: 'Has_Media',
                                  },
                                  {
                                      name: 'Is_Anonymous',
                                      value: 'Is_Anonymous',
                                  },
                                  {
                                      name: 'Is_At_Flag_Limit',
                                      value: 'Is_At_Flag_Limit',
                                  },
                                  {
                                      name: 'Is_Flagged',
                                      value: 'Is_Flagged',
                                  },
                                  {
                                      name: 'Is_Toxic',
                                      value: 'Is_Toxic',
                                  },
                                  {
                                      name: 'Modified_By_Rule',
                                      value: 'Modified_By_Rule',
                                  },
                                  {
                                      name: 'No_Issue',
                                      value: 'No_Issue',
                                  },
                                  {
                                      name: 'Shadow_Banned',
                                      value: 'Shadow_Banned',
                                  },
                              ],
                              default: [],
                              description: 'You may specify filters for your response',
                          },
                          {
                              displayName: 'Include',
                              name: 'include',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Approved',
                                      value: 'approved',
                                  },
                              ],
                              default: [],
                              description: 'You may specify relations to include with your response',
                          },
                          {
                              displayName: 'Order',
                              name: 'order',
                              type: 'options',
                              options: [
                                  {
                                      name: 'ASC',
                                      value: 'asc',
                                  },
                                  {
                                      name: 'DESC',
                                      value: 'desc',
                                  },
                              ],
                              default: 'asc',
                              description: 'You may specify order to sort your response',
                          },
                          {
                              displayName: 'Query',
                              name: 'query',
                              type: 'string',
                              default: '',
                              description: 'You may specify query forChoices: asc, desc your response',
                          },
                          {
                              displayName: 'Related',
                              name: 'related',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Thread',
                                      value: 'thread',
                                  },
                              ],
                              default: [],
                              description: 'You may specify relations to include with your response',
                          },
                          {
                              displayName: 'Since',
                              name: 'since',
                              type: 'dateTime',
                              default: '',
                              description: 'Unix timestamp (or ISO datetime standard)',
                          },
                      ],
                  },
                  {
                      displayName: 'Forum Name',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getCategories'],
                              resource: ['forum'],
                          },
                      },
                      description: 'The short name(aka ID) of the forum to get Categories',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getCategories'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getCategories'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getCategories'],
                              resource: ['forum'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Order',
                              name: 'order',
                              type: 'options',
                              options: [
                                  {
                                      name: 'ASC',
                                      value: 'asc',
                                  },
                                  {
                                      name: 'DESC',
                                      value: 'desc',
                                  },
                              ],
                              default: 'asc',
                              description: 'You may specify order to sort your response',
                          },
                      ],
                  },
                  {
                      displayName: 'Forum Name',
                      name: 'id',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['getThreads'],
                              resource: ['forum'],
                          },
                      },
                      description: 'The short name(aka ID) of the forum to get Threads',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getThreads'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resource: ['forum'],
                              operation: ['getThreads'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 100,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['getThreads'],
                              resource: ['forum'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Related',
                              name: 'related',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'author',
                                      value: 'author',
                                  },
                                  {
                                      name: 'Forum',
                                      value: 'forum',
                                  },
                              ],
                              default: [],
                              description: 'You may specify relations to include with your response',
                          },
                          {
                              displayName: 'Include',
                              name: 'include',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Closed',
                                      value: 'closed',
                                  },
                                  {
                                      name: 'Open',
                                      value: 'open',
                                  },
                                  {
                                      name: 'Killed',
                                      value: 'killed',
                                  },
                              ],
                              default: [],
                              description: 'You may specify relations to include with your response',
                          },
                          {
                              displayName: 'Order',
                              name: 'order',
                              type: 'options',
                              options: [
                                  {
                                      name: 'ASC',
                                      value: 'asc',
                                  },
                                  {
                                      name: 'DESC',
                                      value: 'desc',
                                  },
                              ],
                              default: 'asc',
                              description: 'You may specify order to sort your response',
                          },
                          {
                              displayName: 'Since',
                              name: 'since',
                              type: 'dateTime',
                              default: '',
                              description: 'Unix timestamp (or ISO datetime standard)',
                          },
                          {
                              displayName: 'Thread',
                              name: 'thread',
                              type: 'string',
                              default: '',
                              description: 'Looks up a thread by ID. You may pass us the "ident" query type instead of an ID by including "forum". You may pass us the "link" query type to filter by URL. You must pass the "forum" if you do not have the Pro API Access addon.',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let endpoint = '';
          let requestMethod = '';
          let qs;
          for (let i = 0; i < items.length; i++) {
              try {
                  qs = {};
                  if (resource === 'forum') {
                      if (operation === 'get') {
                          requestMethod = 'GET';
                          endpoint = 'forums/details.json';
                          const id = this.getNodeParameter('id', i);
                          qs.forum = id;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          try {
                              const responseData = await GenericFunctions_1.disqusApiRequest.call(this, requestMethod, qs, endpoint);
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.response), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          catch (error) {
                              throw error;
                          }
                      }
                      else if (operation === 'getPosts') {
                          requestMethod = 'GET';
                          endpoint = 'forums/listPosts.json';
                          const id = this.getNodeParameter('id', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs.forum = id;
                          qs.limit = 100;
                          try {
                              let responseData = {};
                              if (returnAll) {
                                  responseData.response = await GenericFunctions_1.disqusApiRequestAllItems.call(this, requestMethod, qs, endpoint);
                              }
                              else {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs.limit = limit;
                                  responseData = await GenericFunctions_1.disqusApiRequest.call(this, requestMethod, qs, endpoint);
                              }
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.response), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          catch (error) {
                              throw error;
                          }
                      }
                      else if (operation === 'getCategories') {
                          requestMethod = 'GET';
                          endpoint = 'forums/listCategories.json';
                          const id = this.getNodeParameter('id', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          qs.forum = id;
                          qs.limit = 100;
                          try {
                              let responseData = {};
                              if (returnAll) {
                                  responseData.response = await GenericFunctions_1.disqusApiRequestAllItems.call(this, requestMethod, qs, endpoint);
                              }
                              else {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs.limit = limit;
                                  responseData = (await GenericFunctions_1.disqusApiRequest.call(this, requestMethod, qs, endpoint));
                              }
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.response), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          catch (error) {
                              throw error;
                          }
                      }
                      else if (operation === 'getThreads') {
                          requestMethod = 'GET';
                          endpoint = 'forums/listThreads.json';
                          const id = this.getNodeParameter('id', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          qs.forum = id;
                          qs.limit = 100;
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(qs, additionalFields);
                          try {
                              let responseData = {};
                              if (returnAll) {
                                  responseData.response = await GenericFunctions_1.disqusApiRequestAllItems.call(this, requestMethod, qs, endpoint);
                              }
                              else {
                                  const limit = this.getNodeParameter('limit', i);
                                  qs.limit = limit;
                                  responseData = await GenericFunctions_1.disqusApiRequest.call(this, requestMethod, qs, endpoint);
                              }
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.response), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          catch (error) {
                              throw error;
                          }
                      }
                      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,
                      });
                  }
              }
              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.Disqus = Disqus;
  //# sourceMappingURL=Disqus.node.js.map

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


node_type: n8n-nodes-base.Drift
name: Drift
package_name: n8n-nodes-base
display_name: Drift
description: Consume Drift API
code_hash: 0f95bfe43e877d5dbf5e06e74b9a9896c10df575ba3080ff99a30f95cb5f3625
source_location: node_modules/n8n-nodes-base/dist/nodes/Drift/Drift.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Drift = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ContactDescription_1 = require("./ContactDescription");
  class Drift {
      constructor() {
          this.description = {
              displayName: 'Drift',
              name: 'drift',
              icon: 'file:drift.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Drift API',
              defaults: {
                  name: 'Drift',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'driftApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'driftOAuth2Api',
                      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: 'Contact',
                              value: 'contact',
                          },
                      ],
                      default: 'contact',
                  },
                  ...ContactDescription_1.contactOperations,
                  ...ContactDescription_1.contactFields,
              ],
          };
      }
      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 === 'contact') {
                      if (operation === 'create') {
                          const email = this.getNodeParameter('email', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              email,
                          };
                          if (additionalFields.name) {
                              body.name = additionalFields.name;
                          }
                          if (additionalFields.phone) {
                              body.phone = additionalFields.phone;
                          }
                          responseData = await GenericFunctions_1.driftApiRequest.call(this, 'POST', '/contacts', {
                              attributes: body,
                          });
                          responseData = responseData.data;
                      }
                      if (operation === 'update') {
                          const contactId = this.getNodeParameter('contactId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.phone) {
                              body.phone = updateFields.phone;
                          }
                          if (updateFields.email) {
                              body.email = updateFields.email;
                          }
                          responseData = await GenericFunctions_1.driftApiRequest.call(this, 'PATCH', `/contacts/${contactId}`, {
                              attributes: body,
                          });
                          responseData = responseData.data;
                      }
                      if (operation === 'get') {
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.driftApiRequest.call(this, 'GET', `/contacts/${contactId}`);
                          responseData = responseData.data;
                      }
                      if (operation === 'getCustomAttributes') {
                          responseData = await GenericFunctions_1.driftApiRequest.call(this, 'GET', '/contacts/attributes');
                          responseData = responseData.data.properties;
                      }
                      if (operation === 'delete') {
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.driftApiRequest.call(this, 'DELETE', `/contacts/${contactId}`);
                          responseData = { success: true };
                      }
                  }
                  if (Array.isArray(responseData)) {
                      returnData.push.apply(returnData, responseData);
                  }
                  else {
                      returnData.push(responseData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Drift = Drift;
  //# sourceMappingURL=Drift.node.js.map

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


node_type: n8n-nodes-base.Dropbox
name: Dropbox
package_name: n8n-nodes-base
display_name: Dropbox
description: Access data on Dropbox
code_hash: 2c1ed766c39f4be2f863f96b50ead7190d2e4a9f8197ac574ea1410e58165ea2
source_location: node_modules/n8n-nodes-base/dist/nodes/Dropbox/Dropbox.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Dropbox = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Dropbox {
      constructor() {
          this.description = {
              displayName: 'Dropbox',
              name: 'dropbox',
              icon: 'file:dropbox.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Access data on Dropbox',
              defaults: {
                  name: 'Dropbox',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'dropboxApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'dropboxOAuth2Api',
                      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',
                      description: 'Means of authenticating with the service',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Folder',
                              value: 'folder',
                          },
                          {
                              name: 'Search',
                              value: 'search',
                          },
                      ],
                      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: '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 files and folders in a given folder',
                              action: 'List a folder',
                          },
                          {
                              name: 'Move',
                              value: 'move',
                              description: 'Move a folder',
                              action: 'Move a folder',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      displayOptions: {
                          show: {
                              resource: ['search'],
                          },
                      },
                      options: [
                          {
                              name: 'Query',
                              value: 'query',
                              action: 'Query',
                          },
                      ],
                      default: 'query',
                  },
                  {
                      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',
                  },
                  {
                      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',
                  },
                  {
                      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.',
                  },
                  {
                      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',
                  },
                  {
                      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',
                  },
                  {
                      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.',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      required: true,
                      default: 'data',
                      displayOptions: {
                          show: {
                              operation: ['download'],
                              resource: ['file'],
                          },
                      },
                      description: 'Name of the binary property to which to write the data of the 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 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: 'binaryData',
                      type: 'boolean',
                      default: false,
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                          },
                      },
                      description: 'Whether the data to upload should be taken from binary field',
                  },
                  {
                      displayName: 'File Content',
                      name: 'fileContent',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                              binaryData: [false],
                          },
                      },
                      placeholder: '',
                      description: 'The text content of the file to upload',
                  },
                  {
                      displayName: 'Binary Property',
                      name: 'binaryPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['upload'],
                              resource: ['file'],
                              binaryData: [true],
                          },
                      },
                      placeholder: '',
                      description: 'Name of the binary property which contains the data for the file to be uploaded',
                  },
                  {
                      displayName: 'Query',
                      name: 'query',
                      type: 'string',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['query'],
                              resource: ['search'],
                          },
                      },
                      description: 'The string to search for. May match across multiple fields based on the request arguments.',
                  },
                  {
                      displayName: 'File Status',
                      name: 'fileStatus',
                      type: 'options',
                      options: [
                          {
                              name: 'Active',
                              value: 'active',
                          },
                          {
                              name: 'Deleted',
                              value: 'deleted',
                          },
                      ],
                      default: 'active',
                      displayOptions: {
                          show: {
                              operation: ['query'],
                              resource: ['search'],
                          },
                      },
                      description: 'The string to search for. May match across multiple fields based on the request arguments.',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['query'],
                              resource: ['search'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      displayOptions: {
                          show: {
                              resource: ['search'],
                              operation: ['query'],
                              returnAll: [false],
                          },
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Simplify',
                      name: 'simple',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['query'],
                              resource: ['search'],
                          },
                      },
                      default: true,
                      description: 'Whether to return a simplified version of the response instead of the raw data',
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['search'],
                              operation: ['query'],
                          },
                      },
                      options: [
                          {
                              displayName: 'File Categories',
                              name: 'file_categories',
                              type: 'multiOptions',
                              options: [
                                  {
                                      name: 'Audio (mp3, qav, mid, etc.)',
                                      value: 'audio',
                                  },
                                  {
                                      name: 'Document (doc, docx, txt, etc.)',
                                      value: 'document',
                                  },
                                  {
                                      name: 'Dropbox Paper',
                                      value: 'paper',
                                  },
                                  {
                                      name: 'Folder',
                                      value: 'folder',
                                  },
                                  {
                                      name: 'Image (jpg, png, gif, etc.)',
                                      value: 'image',
                                  },
                                  {
                                      name: 'Other',
                                      value: 'other',
                                  },
                                  {
                                      name: 'PDF',
                                      value: 'pdf',
                                  },
                                  {
                                      name: 'Presentation (ppt, pptx, key, etc.)',
                                      value: 'presentation',
                                  },
                                  {
                                      name: 'Spreadsheet (xlsx, xls, csv, etc.)',
                                      value: 'spreadsheet',
                                  },
                                  {
                                      name: 'Video (avi, wmv, mp4, etc.)',
                                      value: 'video',
                                  },
                              ],
                              default: [],
                          },
                          {
                              displayName: 'File Extensions',
                              name: 'file_extensions',
                              type: 'string',
                              default: '',
                              description: 'Multiple file extensions can be set separated by comma. Example: jpg,pdf.',
                          },
                          {
                              displayName: 'Folder',
                              name: 'path',
                              type: 'string',
                              default: '',
                              description: 'If this field is not specified, this module searches the entire Dropbox',
                          },
                      ],
                  },
                  {
                      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.',
                  },
                  {
                      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',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['list'],
                              resource: ['folder'],
                          },
                      },
                      default: false,
                      description: 'Whether to return all results or only up to a given limit',
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      displayOptions: {
                          show: {
                              resource: ['folder'],
                              operation: ['list'],
                              returnAll: [false],
                          },
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Filters',
                      name: 'filters',
                      type: 'collection',
                      placeholder: 'Add Filter',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['folder'],
                              operation: ['list'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Include Deleted',
                              name: 'include_deleted',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the results will include entries for files and folders that used to exist but were deleted. The default for this field is False.',
                          },
                          {
                              displayName: 'Include Shared Members',
                              name: 'include_has_explicit_shared_members',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the results will include a flag for each file indicating whether or not that file has any explicit members. The default for this field is False.',
                          },
                          {
                              displayName: 'Include Mounted Folders',
                              name: 'include_mounted_folders',
                              type: 'boolean',
                              default: true,
                              description: 'Whether the results will include entries under mounted folders which includes app folder, shared folder and team folder. The default for this field is True.',
                          },
                          {
                              displayName: 'Include Non Downloadable Files',
                              name: 'include_non_downloadable_files',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to include files that are not downloadable, i.e. Google Docs. The default for this field is True.',
                          },
                          {
                              displayName: 'Recursive',
                              name: 'recursive',
                              type: 'boolean',
                              default: false,
                              description: 'Whether the list folder operation will be applied recursively to all subfolders and the response will contain contents of all subfolders. The default for this field is False.',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let endpoint = '';
          let requestMethod = '';
          let returnAll = false;
          let property = '';
          let body;
          let options;
          const query = {};
          let headers = {};
          let simple = false;
          const { accessType } = await GenericFunctions_1.getCredentials.call(this);
          if (accessType === 'full') {
              const { root_info: { root_namespace_id }, } = await GenericFunctions_1.getRootDirectory.call(this);
              headers = {
                  'dropbox-api-path-root': JSON.stringify({
                      '.tag': 'root',
                      root: root_namespace_id,
                  }),
              };
          }
          for (let i = 0; i < items.length; i++) {
              try {
                  body = {};
                  if (resource === 'file') {
                      if (operation === 'download') {
                          requestMethod = 'POST';
                          query.arg = JSON.stringify({
                              path: this.getNodeParameter('path', i),
                          });
                          endpoint = 'https://content.dropboxapi.com/2/files/download';
                      }
                      else if (operation === 'upload') {
                          requestMethod = 'POST';
                          headers['Content-Type'] = 'application/octet-stream';
                          query.arg = JSON.stringify({
                              mode: 'overwrite',
                              path: this.getNodeParameter('path', i),
                          });
                          endpoint = 'https://content.dropboxapi.com/2/files/upload';
                          options = { json: false };
                          if (this.getNodeParameter('binaryData', i)) {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              this.helpers.assertBinaryData(i, binaryPropertyName);
                              body = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                          }
                          else {
                              body = Buffer.from(this.getNodeParameter('fileContent', i), 'utf8');
                          }
                      }
                  }
                  else if (resource === 'folder') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          body = {
                              path: this.getNodeParameter('path', i),
                          };
                          endpoint = 'https://api.dropboxapi.com/2/files/create_folder_v2';
                      }
                      else if (operation === 'list') {
                          returnAll = this.getNodeParameter('returnAll', 0);
                          const filters = this.getNodeParameter('filters', i);
                          property = 'entries';
                          requestMethod = 'POST';
                          body = {
                              path: this.getNodeParameter('path', i),
                              limit: 1000,
                          };
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', 0);
                              body.limit = limit;
                          }
                          Object.assign(body, filters);
                          endpoint = 'https://api.dropboxapi.com/2/files/list_folder';
                      }
                  }
                  else if (resource === 'search') {
                      if (operation === 'query') {
                          returnAll = this.getNodeParameter('returnAll', 0);
                          simple = this.getNodeParameter('simple', 0);
                          const filters = this.getNodeParameter('filters', i);
                          property = 'matches';
                          requestMethod = 'POST';
                          body = {
                              query: this.getNodeParameter('query', i),
                              options: {
                                  filename_only: true,
                              },
                          };
                          if (filters.file_extensions) {
                              filters.file_extensions = filters.file_extensions.split(',');
                          }
                          Object.assign(body.options, filters);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              Object.assign(body.options, { max_results: limit });
                          }
                          endpoint = 'https://api.dropboxapi.com/2/files/search_v2';
                      }
                  }
                  if (['file', 'folder', 'search'].includes(resource)) {
                      if (operation === 'copy') {
                          requestMethod = 'POST';
                          body = {
                              from_path: this.getNodeParameter('path', i),
                              to_path: this.getNodeParameter('toPath', i),
                          };
                          endpoint = 'https://api.dropboxapi.com/2/files/copy_v2';
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'POST';
                          body = {
                              path: this.getNodeParameter('path', i),
                          };
                          endpoint = 'https://api.dropboxapi.com/2/files/delete_v2';
                      }
                      else if (operation === 'move') {
                          requestMethod = 'POST';
                          body = {
                              from_path: this.getNodeParameter('path', i),
                              to_path: this.getNodeParameter('toPath', i),
                          };
                          endpoint = 'https://api.dropboxapi.com/2/files/move_v2';
                      }
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
                          itemIndex: i,
                      });
                  }
                  if (resource === 'file' && operation === 'download') {
                      options = { encoding: null };
                  }
                  let responseData;
                  if (returnAll) {
                      responseData = await GenericFunctions_1.dropboxpiRequestAllItems.call(this, property, requestMethod, endpoint, body, query, headers);
                  }
                  else {
                      responseData = await GenericFunctions_1.dropboxApiRequest.call(this, requestMethod, endpoint, body, query, headers, options);
                  }
                  if (resource === 'file' && operation === 'upload') {
                      const data = JSON.parse(responseData);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(data), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (resource === 'file' && operation === 'download') {
                      const newItem = {
                          json: items[i].json,
                          binary: {},
                          pairedItem: { item: i },
                      };
                      if (items[i].binary !== undefined) {
                          Object.assign(newItem.binary, items[i].binary);
                      }
                      items[i] = newItem;
                      const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i);
                      const filePathDownload = this.getNodeParameter('path', i);
                      items[i].binary[dataPropertyNameDownload] = await this.helpers.prepareBinaryData(Buffer.from(responseData), filePathDownload);
                  }
                  else if (resource === 'folder' && operation === 'list') {
                      const propNames = {
                          id: 'id',
                          name: 'name',
                          client_modified: 'lastModifiedClient',
                          server_modified: 'lastModifiedServer',
                          rev: 'rev',
                          size: 'contentSize',
                          '.tag': 'type',
                          content_hash: 'contentHash',
                          path_lower: 'pathLower',
                          path_display: 'pathDisplay',
                          has_explicit_shared_members: 'hasExplicitSharedMembers',
                          is_downloadable: 'isDownloadable',
                      };
                      if (!returnAll) {
                          responseData = responseData.entries;
                      }
                      for (const item of responseData) {
                          const newItem = {};
                          for (const propName of Object.keys(propNames)) {
                              if (item[propName] !== undefined) {
                                  newItem[propNames[propName]] = item[propName];
                              }
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(newItem), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
                  else if (resource === 'search' && operation === 'query') {
                      let data = responseData;
                      if (returnAll) {
                          data = simple ? (0, GenericFunctions_1.simplify)(responseData) : responseData;
                      }
                      else {
                          data = simple
                              ? (0, GenericFunctions_1.simplify)(responseData[property])
                              : responseData[property];
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(data), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      if (resource === 'file' && operation === 'download') {
                          items[i].json = { error: error.message };
                      }
                      else {
                          returnData.push({ json: { error: error.message } });
                      }
                      continue;
                  }
                  throw error;
              }
          }
          if (resource === 'file' && operation === 'download') {
              return [items];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.Dropbox = Dropbox;
  //# sourceMappingURL=Dropbox.node.js.map

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


node_type: n8n-nodes-base.Dropcontact
name: Dropcontact
package_name: n8n-nodes-base
display_name: Dropcontact
description: Find B2B emails and enrich contacts
code_hash: cd7a9edf467fd1288617b3ecb6e11942c3dab69d3fc91a543624ca2bed582dc6
source_location: node_modules/n8n-nodes-base/dist/nodes/Dropcontact/Dropcontact.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Dropcontact = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunction_1 = require("./GenericFunction");
  class Dropcontact {
      constructor() {
          this.description = {
              displayName: 'Dropcontact',
              name: 'dropcontact',
              icon: 'file:dropcontact.svg',
              group: ['transform'],
              version: 1,
              description: 'Find B2B emails and enrich contacts',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Dropcontact',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'dropcontactApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      noDataExpression: true,
                      name: 'resource',
                      type: 'options',
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                      ],
                      default: 'contact',
                      required: true,
                  },
                  {
                      displayName: 'Operation',
                      noDataExpression: true,
                      name: 'operation',
                      type: 'options',
                      options: [
                          {
                              name: 'Enrich',
                              value: 'enrich',
                              description: 'Find B2B emails and enrich your contact from his name and his website',
                              action: 'Find B2B emails',
                          },
                          {
                              name: 'Fetch Request',
                              value: 'fetchRequest',
                          },
                      ],
                      default: 'enrich',
                      required: true,
                  },
                  {
                      displayName: 'Request ID',
                      name: 'requestId',
                      type: 'string',
                      required: true,
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['fetchRequest'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['enrich'],
                          },
                      },
                      default: '',
                  },
                  {
                      displayName: 'Simplify Output (Faster)',
                      name: 'simplify',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['enrich'],
                          },
                      },
                      default: false,
                      description: 'When off, waits for the contact data before completing. Waiting time can be adjusted with Extend Wait Time option. When on, returns a request_id that can be used later in the Fetch Request operation.',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['enrich'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Company SIREN Number',
                              name: 'num_siren',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Company SIRET Code',
                              name: 'siret',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Company Name',
                              name: 'company',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Country',
                              name: 'country',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'First Name',
                              name: 'first_name',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Full Name',
                              name: 'full_name',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Last Name',
                              name: 'last_name',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'LinkedIn Profile',
                              name: 'linkedin',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Phone Number',
                              name: 'phone',
                              type: 'string',
                              default: '',
                          },
                          {
                              displayName: 'Website',
                              name: 'website',
                              type: 'string',
                              default: '',
                          },
                      ],
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['enrich'],
                          },
                      },
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Data Fetch Wait Time',
                              name: 'waitTime',
                              type: 'number',
                              typeOptions: {
                                  minValue: 1,
                              },
                              displayOptions: {
                                  show: {
                                      '/simplify': [false],
                                  },
                              },
                              default: 45,
                              description: 'When not simplifying the response, data will be fetched in two steps. This parameter controls how long to wait (in seconds) before trying the second step.',
                          },
                          {
                              displayName: 'French Company Enrich',
                              name: 'siren',
                              type: 'boolean',
                              default: false,
                              description: 'Whether you want the <a href="https://en.wikipedia.org/wiki/SIREN_code" target="_blank">SIREN number</a>, NAF code, TVA number, company address and informations about the company leader. Only applies to french companies.',
                          },
                          {
                              displayName: 'Language',
                              name: 'language',
                              type: 'options',
                              options: [
                                  {
                                      name: 'English',
                                      value: 'en',
                                  },
                                  {
                                      name: 'French',
                                      value: 'fr',
                                  },
                              ],
                              default: 'en',
                              description: 'Whether the response is in English or French',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const entryData = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          if (resource === 'contact') {
              if (operation === 'enrich') {
                  const options = this.getNodeParameter('options', 0);
                  const data = [];
                  const simplify = this.getNodeParameter('simplify', 0);
                  const siren = options.siren === true ? true : false;
                  const language = options.language ? options.language : 'en';
                  for (let i = 0; i < entryData.length; i++) {
                      const email = this.getNodeParameter('email', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {};
                      if (email !== '') {
                          body.email = email;
                      }
                      Object.assign(body, additionalFields);
                      data.push(body);
                  }
                  responseData = (await GenericFunction_1.dropcontactApiRequest.call(this, 'POST', '/batch', { data, siren, language }, {}));
                  if (!responseData.success) {
                      if (this.continueOnFail()) {
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: responseData.reason || 'invalid request' }), {
                              itemData: (0, GenericFunction_1.mapPairedItemsFrom)(entryData),
                          });
                          returnData.push(...executionData);
                      }
                      else {
                          throw new n8n_workflow_1.NodeApiError(this.getNode(), {
                              error: responseData.reason || 'invalid request',
                          });
                      }
                  }
                  if (!simplify) {
                      const waitTime = this.getNodeParameter('options.waitTime', 0, 45);
                      const delay = async (ms) => new Promise((res) => setTimeout(res, ms * 1000));
                      await delay(waitTime);
                      responseData = await GenericFunction_1.dropcontactApiRequest.call(this, 'GET', `/batch/${responseData.request_id}`, {}, {});
                      if (!responseData.success) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: responseData.reason }), {
                                  itemData: (0, GenericFunction_1.mapPairedItemsFrom)(entryData),
                              });
                              returnData.push(...executionData);
                          }
                          else {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), {
                                  error: responseData.reason,
                                  description: 'Hint: Increase the Wait Time to avoid this error',
                              });
                          }
                      }
                      else {
                          responseData.data.forEach((d, index) => {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(d), { itemData: { item: index } });
                              returnData.push(...executionData);
                          });
                      }
                  }
                  else {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), {
                          itemData: (0, GenericFunction_1.mapPairedItemsFrom)(entryData),
                      });
                      returnData.push(...executionData);
                  }
              }
              if (operation === 'fetchRequest') {
                  for (let i = 0; i < entryData.length; i++) {
                      const requestId = this.getNodeParameter('requestId', i);
                      responseData = (await GenericFunction_1.dropcontactApiRequest.call(this, 'GET', `/batch/${requestId}`, {}, {}));
                      if (!responseData.success) {
                          if (this.continueOnFail()) {
                              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: responseData.reason || 'invalid request' }), { itemData: { item: i } });
                              returnData.push(...executionData);
                          }
                          else {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), {
                                  error: responseData.reason || 'invalid request',
                              });
                          }
                      }
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.data), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
          }
          return [returnData];
      }
  }
  exports.Dropcontact = Dropcontact;
  //# sourceMappingURL=Dropcontact.node.js.map

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


node_type: n8n-nodes-base.E2eTest
name: E2eTest
package_name: n8n-nodes-base
display_name: E2E Test
description: Dummy node used for e2e testing
code_hash: 2bdc344d2866f7e3a961538270c732f5f44ed4b8e88d8287b757f159df2aac08
source_location: node_modules/n8n-nodes-base/dist/nodes/E2eTest/E2eTest.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.E2eTest = void 0;
  const mock_1 = require("./mock");
  class E2eTest {
      constructor() {
          this.description = {
              displayName: 'E2E Test',
              name: 'e2eTest',
              icon: 'fa:play',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"]}}',
              description: 'Dummy node used for e2e testing',
              defaults: {
                  name: 'E2E Test',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Remote Options',
                              value: 'remoteOptions',
                          },
                          {
                              name: 'Resource Locator',
                              value: 'resourceLocator',
                          },
                          {
                              name: 'Resource Mapping Component',
                              value: 'resourceMapper',
                          },
                      ],
                      default: 'remoteOptions',
                  },
                  {
                      displayName: 'Field ID',
                      name: 'fieldId',
                      type: 'string',
                      default: '',
                  },
                  {
                      displayName: 'Remote Options Name or ID',
                      name: 'remoteOptions',
                      description: 'Remote options to load. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                      type: 'options',
                      typeOptions: {
                          loadOptionsDependsOn: ['fieldId'],
                          loadOptionsMethod: 'getOptions',
                      },
                      required: true,
                      default: [],
                      displayOptions: {
                          show: {
                              operation: ['remoteOptions'],
                          },
                      },
                  },
                  {
                      displayName: 'Resource Locator',
                      name: 'rlc',
                      type: 'resourceLocator',
                      default: { mode: 'list', value: '' },
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['resourceLocator'],
                          },
                      },
                      modes: [
                          {
                              displayName: 'From List',
                              name: 'list',
                              type: 'list',
                              typeOptions: {
                                  searchListMethod: 'optionsSearch',
                                  searchable: true,
                              },
                          },
                          {
                              displayName: 'By URL',
                              name: 'url',
                              type: 'string',
                              placeholder: 'https://example.com/user/a4071e98-7d40-41fb-8911-ce3e7bf94fb2',
                              validation: [
                                  {
                                      type: 'regex',
                                      properties: {
                                          regex: 'https://example.com/user/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}',
                                          errorMessage: 'Not a valid example URL',
                                      },
                                  },
                              ],
                              extractValue: {
                                  type: 'regex',
                                  regex: 'https://example.com/user/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})',
                              },
                          },
                          {
                              displayName: 'ID',
                              name: 'id',
                              type: 'string',
                              validation: [
                                  {
                                      type: 'regex',
                                      properties: {
                                          regex: '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}',
                                          errorMessage: 'Not a valid UUI',
                                      },
                                  },
                              ],
                              placeholder: 'a4071e98-7d40-41fb-8911-ce3e7bf94fb2',
                          },
                      ],
                  },
                  {
                      displayName: 'Resource Mapping Component',
                      name: 'resourceMapper',
                      type: 'resourceMapper',
                      noDataExpression: true,
                      default: {
                          mappingMode: 'defineBelow',
                          value: null,
                      },
                      required: true,
                      typeOptions: {
                          loadOptionsDependsOn: ['fieldId'],
                          resourceMapper: {
                              resourceMapperMethod: 'getMappingColumns',
                              mode: 'upsert',
                              fieldWords: {
                                  singular: 'column',
                                  plural: 'columns',
                              },
                              addAllFields: true,
                              multiKeyMatch: false,
                          },
                      },
                      displayOptions: {
                          show: {
                              operation: ['resourceMapper'],
                          },
                      },
                  },
                  {
                      displayName: 'Other Non Important Field',
                      name: 'otherField',
                      type: 'string',
                      default: '',
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getOptions() {
                      return mock_1.remoteOptions;
                  },
              },
              listSearch: {
                  async optionsSearch(filter, paginationToken) {
                      const pageSize = 5;
                      let results = mock_1.searchOptions;
                      if (filter) {
                          results = results.filter((option) => option.name.includes(filter));
                      }
                      const offset = paginationToken ? parseInt(paginationToken, 10) : 0;
                      results = results.slice(offset, offset + pageSize);
                      return {
                          results,
                          paginationToken: offset + pageSize,
                      };
                  },
              },
              resourceMapping: {
                  async getMappingColumns() {
                      return mock_1.resourceMapperFields;
                  },
              },
          };
      }
      async execute() {
          const operation = this.getNodeParameter('operation', 0);
          if (operation === 'resourceMapper') {
              const rmValue = this.getNodeParameter('resourceMapper.value', 0);
              if (rmValue) {
                  return [[{ json: rmValue }]];
              }
          }
          return [mock_1.returnData];
      }
  }
  exports.E2eTest = E2eTest;
  //# sourceMappingURL=E2eTest.node.js.map

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


node_type: n8n-nodes-base.ERPNext
name: ERPNext
package_name: n8n-nodes-base
display_name: ERPNext
description: Consume ERPNext API
code_hash: 29efdfa1b7a2885ae746d55c9bf1487a1cb4ad084e0eae6cb82e06adccb14e19
source_location: node_modules/n8n-nodes-base/dist/nodes/ERPNext/ERPNext.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ERPNext = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const DocumentDescription_1 = require("./DocumentDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utils_1 = require("./utils");
  class ERPNext {
      constructor() {
          this.description = {
              displayName: 'ERPNext',
              name: 'erpNext',
              icon: 'file:erpnext.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
              description: 'Consume ERPNext API',
              defaults: {
                  name: 'ERPNext',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'erpNextApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Document',
                              value: 'document',
                          },
                      ],
                      default: 'document',
                  },
                  ...DocumentDescription_1.documentOperations,
                  ...DocumentDescription_1.documentFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getDocTypes() {
                      const data = await GenericFunctions_1.erpNextApiRequestAllItems.call(this, 'data', 'GET', '/api/resource/DocType', {});
                      const docTypes = data.map(({ name }) => {
                          return { name, value: encodeURI(name) };
                      });
                      return (0, utils_1.processNames)(docTypes);
                  },
                  async getDocFilters() {
                      const docType = this.getCurrentNodeParameter('docType');
                      const { data } = await GenericFunctions_1.erpNextApiRequest.call(this, 'GET', `/api/resource/DocType/${docType}`, {});
                      const docFields = data.fields.map(({ label, fieldname }) => {
                          return { name: label, value: fieldname };
                      });
                      docFields.unshift({ name: '*', value: '*' });
                      return (0, utils_1.processNames)(docFields);
                  },
                  async getDocFields() {
                      const docType = this.getCurrentNodeParameter('docType');
                      const { data } = await GenericFunctions_1.erpNextApiRequest.call(this, 'GET', `/api/resource/DocType/${docType}`, {});
                      const docFields = data.fields.map(({ label, fieldname }) => {
                          return { name: label, value: fieldname };
                      });
                      return (0, utils_1.processNames)(docFields);
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let responseData;
          const body = {};
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              if (resource === 'document') {
                  if (operation === 'get') {
                      const docType = this.getNodeParameter('docType', i);
                      const documentName = this.getNodeParameter('documentName', i);
                      responseData = await GenericFunctions_1.erpNextApiRequest.call(this, 'GET', `/api/resource/${docType}/${documentName}`);
                      responseData = responseData.data;
                  }
                  if (operation === 'getAll') {
                      const docType = this.getNodeParameter('docType', i);
                      const endpoint = `/api/resource/${docType}`;
                      const { fields, filters } = this.getNodeParameter('options', i);
                      if (fields) {
                          if (fields.includes('*')) {
                              qs.fields = JSON.stringify(['*']);
                          }
                          else {
                              qs.fields = JSON.stringify(fields);
                          }
                      }
                      if (filters) {
                          qs.filters = JSON.stringify(filters.customProperty.map((filter) => {
                              return [docType, filter.field, (0, utils_1.toSQL)(filter.operator), filter.value];
                          }));
                      }
                      const returnAll = this.getNodeParameter('returnAll', i);
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', i);
                          qs.limit_page_length = limit;
                          qs.limit_start = 0;
                          responseData = await GenericFunctions_1.erpNextApiRequest.call(this, 'GET', endpoint, {}, qs);
                          responseData = responseData.data;
                      }
                      else {
                          responseData = await GenericFunctions_1.erpNextApiRequestAllItems.call(this, 'data', 'GET', endpoint, {}, qs);
                      }
                  }
                  else if (operation === 'create') {
                      const properties = this.getNodeParameter('properties', i);
                      if (!properties.customProperty.length) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter at least one property for the document to create.', { itemIndex: i });
                      }
                      properties.customProperty.forEach((property) => {
                          body[property.field] = property.value;
                      });
                      const docType = this.getNodeParameter('docType', i);
                      responseData = await GenericFunctions_1.erpNextApiRequest.call(this, 'POST', `/api/resource/${docType}`, body);
                      responseData = responseData.data;
                  }
                  else if (operation === 'delete') {
                      const docType = this.getNodeParameter('docType', i);
                      const documentName = this.getNodeParameter('documentName', i);
                      responseData = await GenericFunctions_1.erpNextApiRequest.call(this, 'DELETE', `/api/resource/${docType}/${documentName}`);
                  }
                  else if (operation === 'update') {
                      const properties = this.getNodeParameter('properties', i);
                      if (!properties.customProperty.length) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter at least one property for the document to update.', { itemIndex: i });
                      }
                      properties.customProperty.forEach((property) => {
                          body[property.field] = property.value;
                      });
                      const docType = this.getNodeParameter('docType', i);
                      const documentName = this.getNodeParameter('documentName', i);
                      responseData = await GenericFunctions_1.erpNextApiRequest.call(this, 'PUT', `/api/resource/${docType}/${documentName}`, body);
                      responseData = responseData.data;
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.ERPNext = ERPNext;
  //# sourceMappingURL=ERPNext.node.js.map

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


node_type: n8n-nodes-base.EditImage
name: EditImage
package_name: n8n-nodes-base
display_name: Background Color
description: Adds a blur to the image and so makes it less sharp
code_hash: 091299be6339bea30743c8263f8773f388c8c9ce936efa20be50765b608a38c7
source_location: node_modules/n8n-nodes-base/dist/nodes/EditImage/EditImage.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
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.EditImage = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const gm_1 = __importDefault(require("gm"));
  const tmp_promise_1 = require("tmp-promise");
  const path_1 = require("path");
  const fs_1 = require("fs");
  const util_1 = require("util");
  const fsWriteFileAsync = (0, util_1.promisify)(fs_1.writeFile);
  const get_system_fonts_1 = __importDefault(require("get-system-fonts"));
  const nodeOperations = [
      {
          name: 'Blur',
          value: 'blur',
          description: 'Adds a blur to the image and so makes it less sharp',
          action: 'Blur Image',
      },
      {
          name: 'Border',
          value: 'border',
          description: 'Adds a border to the image',
          action: 'Border Image',
      },
      {
          name: 'Composite',
          value: 'composite',
          description: 'Composite image on top of another one',
          action: 'Composite Image',
      },
      {
          name: 'Create',
          value: 'create',
          description: 'Create a new image',
          action: 'Create Image',
      },
      {
          name: 'Crop',
          value: 'crop',
          description: 'Crops the image',
          action: 'Crop Image',
      },
      {
          name: 'Draw',
          value: 'draw',
          description: 'Draw on image',
          action: 'Draw Image',
      },
      {
          name: 'Rotate',
          value: 'rotate',
          description: 'Rotate image',
          action: 'Rotate Image',
      },
      {
          name: 'Resize',
          value: 'resize',
          description: 'Change the size of image',
          action: 'Resize Image',
      },
      {
          name: 'Shear',
          value: 'shear',
          description: 'Shear image along the X or Y axis',
          action: 'Shear Image',
      },
      {
          name: 'Text',
          value: 'text',
          description: 'Adds text to image',
          action: 'Apply Text to Image',
      },
      {
          name: 'Transparent',
          value: 'transparent',
          description: 'Make a color in image transparent',
          action: 'Add Transparency to Image',
      },
  ];
  const nodeOperationOptions = [
      {
          displayName: 'Background Color',
          name: 'backgroundColor',
          type: 'color',
          default: '#ffffff00',
          typeOptions: {
              showAlpha: true,
          },
          displayOptions: {
              show: {
                  operation: ['create'],
              },
          },
          description: 'The background color of the image to create',
      },
      {
          displayName: 'Image Width',
          name: 'width',
          type: 'number',
          default: 50,
          typeOptions: {
              minValue: 1,
          },
          displayOptions: {
              show: {
                  operation: ['create'],
              },
          },
          description: 'The width of the image to create',
      },
      {
          displayName: 'Image Height',
          name: 'height',
          type: 'number',
          default: 50,
          typeOptions: {
              minValue: 1,
          },
          displayOptions: {
              show: {
                  operation: ['create'],
              },
          },
          description: 'The height of the image to create',
      },
      {
          displayName: 'Primitive',
          name: 'primitive',
          type: 'options',
          displayOptions: {
              show: {
                  operation: ['draw'],
              },
          },
          options: [
              {
                  name: 'Circle',
                  value: 'circle',
              },
              {
                  name: 'Line',
                  value: 'line',
              },
              {
                  name: 'Rectangle',
                  value: 'rectangle',
              },
          ],
          default: 'rectangle',
          description: 'The primitive to draw',
      },
      {
          displayName: 'Color',
          name: 'color',
          type: 'color',
          default: '#ff000000',
          typeOptions: {
              showAlpha: true,
          },
          displayOptions: {
              show: {
                  operation: ['draw'],
              },
          },
          description: 'The color of the primitive to draw',
      },
      {
          displayName: 'Start Position X',
          name: 'startPositionX',
          type: 'number',
          default: 50,
          displayOptions: {
              show: {
                  operation: ['draw'],
                  primitive: ['circle', 'line', 'rectangle'],
              },
          },
          description: 'X (horizontal) start position of the primitive',
      },
      {
          displayName: 'Start Position Y',
          name: 'startPositionY',
          type: 'number',
          default: 50,
          displayOptions: {
              show: {
                  operation: ['draw'],
                  primitive: ['circle', 'line', 'rectangle'],
              },
          },
          description: 'Y (horizontal) start position of the primitive',
      },
      {
          displayName: 'End Position X',
          name: 'endPositionX',
          type: 'number',
          default: 250,
          displayOptions: {
              show: {
                  operation: ['draw'],
                  primitive: ['circle', 'line', 'rectangle'],
              },
          },
          description: 'X (horizontal) end position of the primitive',
      },
      {
          displayName: 'End Position Y',
          name: 'endPositionY',
          type: 'number',
          default: 250,
          displayOptions: {
              show: {
                  operation: ['draw'],
                  primitive: ['circle', 'line', 'rectangle'],
              },
          },
          description: 'Y (horizontal) end position of the primitive',
      },
      {
          displayName: 'Corner Radius',
          name: 'cornerRadius',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['draw'],
                  primitive: ['rectangle'],
              },
          },
          description: 'The radius of the corner to create round corners',
      },
      {
          displayName: 'Text',
          name: 'text',
          typeOptions: {
              rows: 5,
          },
          type: 'string',
          default: '',
          placeholder: 'Text to render',
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'Text to write on the image',
      },
      {
          displayName: 'Font Size',
          name: 'fontSize',
          type: 'number',
          default: 18,
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'Size of the text',
      },
      {
          displayName: 'Font Color',
          name: 'fontColor',
          type: 'color',
          default: '#000000',
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'Color of the text',
      },
      {
          displayName: 'Position X',
          name: 'positionX',
          type: 'number',
          default: 50,
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'X (horizontal) position of the text',
      },
      {
          displayName: 'Position Y',
          name: 'positionY',
          type: 'number',
          default: 50,
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'Y (vertical) position of the text',
      },
      {
          displayName: 'Max Line Length',
          name: 'lineLength',
          type: 'number',
          typeOptions: {
              minValue: 1,
          },
          default: 80,
          displayOptions: {
              show: {
                  operation: ['text'],
              },
          },
          description: 'Max amount of characters in a line before a line-break should get added',
      },
      {
          displayName: 'Blur',
          name: 'blur',
          type: 'number',
          typeOptions: {
              minValue: 0,
              maxValue: 1000,
          },
          default: 5,
          displayOptions: {
              show: {
                  operation: ['blur'],
              },
          },
          description: 'How strong the blur should be',
      },
      {
          displayName: 'Sigma',
          name: 'sigma',
          type: 'number',
          typeOptions: {
              minValue: 0,
              maxValue: 1000,
          },
          default: 2,
          displayOptions: {
              show: {
                  operation: ['blur'],
              },
          },
          description: 'The sigma of the blur',
      },
      {
          displayName: 'Border Width',
          name: 'borderWidth',
          type: 'number',
          default: 10,
          displayOptions: {
              show: {
                  operation: ['border'],
              },
          },
          description: 'The width of the border',
      },
      {
          displayName: 'Border Height',
          name: 'borderHeight',
          type: 'number',
          default: 10,
          displayOptions: {
              show: {
                  operation: ['border'],
              },
          },
          description: 'The height of the border',
      },
      {
          displayName: 'Border Color',
          name: 'borderColor',
          type: 'color',
          default: '#000000',
          displayOptions: {
              show: {
                  operation: ['border'],
              },
          },
          description: 'Color of the border',
      },
      {
          displayName: 'Composite Image Property',
          name: 'dataPropertyNameComposite',
          type: 'string',
          default: '',
          placeholder: 'data2',
          displayOptions: {
              show: {
                  operation: ['composite'],
              },
          },
          description: 'The name of the binary property which contains the data of the image to composite on top of image which is found in Property Name',
      },
      {
          displayName: 'Operator',
          name: 'operator',
          type: 'options',
          displayOptions: {
              show: {
                  operation: ['composite'],
              },
          },
          options: [
              {
                  name: 'Add',
                  value: 'Add',
              },
              {
                  name: 'Atop',
                  value: 'Atop',
              },
              {
                  name: 'Bumpmap',
                  value: 'Bumpmap',
              },
              {
                  name: 'Copy',
                  value: 'Copy',
              },
              {
                  name: 'Copy Black',
                  value: 'CopyBlack',
              },
              {
                  name: 'Copy Blue',
                  value: 'CopyBlue',
              },
              {
                  name: 'Copy Cyan',
                  value: 'CopyCyan',
              },
              {
                  name: 'Copy Green',
                  value: 'CopyGreen',
              },
              {
                  name: 'Copy Magenta',
                  value: 'CopyMagenta',
              },
              {
                  name: 'Copy Opacity',
                  value: 'CopyOpacity',
              },
              {
                  name: 'Copy Red',
                  value: 'CopyRed',
              },
              {
                  name: 'Copy Yellow',
                  value: 'CopyYellow',
              },
              {
                  name: 'Difference',
                  value: 'Difference',
              },
              {
                  name: 'Divide',
                  value: 'Divide',
              },
              {
                  name: 'In',
                  value: 'In',
              },
              {
                  name: 'Minus',
                  value: 'Minus',
              },
              {
                  name: 'Multiply',
                  value: 'Multiply',
              },
              {
                  name: 'Out',
                  value: 'Out',
              },
              {
                  name: 'Over',
                  value: 'Over',
              },
              {
                  name: 'Plus',
                  value: 'Plus',
              },
              {
                  name: 'Subtract',
                  value: 'Subtract',
              },
              {
                  name: 'Xor',
                  value: 'Xor',
              },
          ],
          default: 'Over',
          description: 'The operator to use to combine the images',
      },
      {
          displayName: 'Position X',
          name: 'positionX',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['composite'],
              },
          },
          description: 'X (horizontal) position of composite image',
      },
      {
          displayName: 'Position Y',
          name: 'positionY',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['composite'],
              },
          },
          description: 'Y (vertical) position of composite image',
      },
      {
          displayName: 'Width',
          name: 'width',
          type: 'number',
          default: 500,
          displayOptions: {
              show: {
                  operation: ['crop'],
              },
          },
          description: 'Crop width',
      },
      {
          displayName: 'Height',
          name: 'height',
          type: 'number',
          default: 500,
          displayOptions: {
              show: {
                  operation: ['crop'],
              },
          },
          description: 'Crop height',
      },
      {
          displayName: 'Position X',
          name: 'positionX',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['crop'],
              },
          },
          description: 'X (horizontal) position to crop from',
      },
      {
          displayName: 'Position Y',
          name: 'positionY',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['crop'],
              },
          },
          description: 'Y (vertical) position to crop from',
      },
      {
          displayName: 'Width',
          name: 'width',
          type: 'number',
          default: 500,
          displayOptions: {
              show: {
                  operation: ['resize'],
              },
          },
          description: 'New width of the image',
      },
      {
          displayName: 'Height',
          name: 'height',
          type: 'number',
          default: 500,
          displayOptions: {
              show: {
                  operation: ['resize'],
              },
          },
          description: 'New height of the image',
      },
      {
          displayName: 'Option',
          name: 'resizeOption',
          type: 'options',
          options: [
              {
                  name: 'Ignore Aspect Ratio',
                  value: 'ignoreAspectRatio',
                  description: 'Ignore aspect ratio and resize exactly to specified values',
              },
              {
                  name: 'Maximum Area',
                  value: 'maximumArea',
                  description: 'Specified values are maximum area',
              },
              {
                  name: 'Minimum Area',
                  value: 'minimumArea',
                  description: 'Specified values are minimum area',
              },
              {
                  name: 'Only if Larger',
                  value: 'onlyIfLarger',
                  description: 'Resize only if image is larger than width or height',
              },
              {
                  name: 'Only if Smaller',
                  value: 'onlyIfSmaller',
                  description: 'Resize only if image is smaller than width or height',
              },
              {
                  name: 'Percent',
                  value: 'percent',
                  description: 'Width and height are specified in percents',
              },
          ],
          default: 'maximumArea',
          displayOptions: {
              show: {
                  operation: ['resize'],
              },
          },
          description: 'How to resize the image',
      },
      {
          displayName: 'Rotate',
          name: 'rotate',
          type: 'number',
          typeOptions: {
              minValue: -360,
              maxValue: 360,
          },
          default: 0,
          displayOptions: {
              show: {
                  operation: ['rotate'],
              },
          },
          description: 'How much the image should be rotated',
      },
      {
          displayName: 'Background Color',
          name: 'backgroundColor',
          type: 'color',
          default: '#ffffffff',
          typeOptions: {
              showAlpha: true,
          },
          displayOptions: {
              show: {
                  operation: ['rotate'],
              },
          },
          description: 'The color to use for the background when image gets rotated by anything which is not a multiple of 90',
      },
      {
          displayName: 'Degrees X',
          name: 'degreesX',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['shear'],
              },
          },
          description: 'X (horizontal) shear degrees',
      },
      {
          displayName: 'Degrees Y',
          name: 'degreesY',
          type: 'number',
          default: 0,
          displayOptions: {
              show: {
                  operation: ['shear'],
              },
          },
          description: 'Y (vertical) shear degrees',
      },
      {
          displayName: 'Color',
          name: 'color',
          type: 'color',
          default: '#ff0000',
          displayOptions: {
              show: {
                  operation: ['transparent'],
              },
          },
          description: 'The color to make transparent',
      },
  ];
  class EditImage {
      constructor() {
          this.description = {
              displayName: 'Edit Image',
              name: 'editImage',
              icon: 'fa:image',
              group: ['transform'],
              version: 1,
              description: 'Edits an image like blur, resize or adding border and text',
              defaults: {
                  name: 'Edit Image',
                  color: '#553399',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Get Information',
                              value: 'information',
                              description: 'Returns image information like resolution',
                          },
                          {
                              name: 'Multi Step',
                              value: 'multiStep',
                              description: 'Perform multiple operations',
                          },
                          ...nodeOperations,
                      ].sort((a, b) => {
                          if (a.name.toLowerCase() < b.name.toLowerCase()) {
                              return -1;
                          }
                          if (a.name.toLowerCase() > b.name.toLowerCase()) {
                              return 1;
                          }
                          return 0;
                      }),
                      default: 'border',
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      description: 'Name of the binary property in which the image data can be found',
                  },
                  {
                      displayName: 'Operations',
                      name: 'operations',
                      placeholder: 'Add Operation',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                          sortable: true,
                      },
                      displayOptions: {
                          show: {
                              operation: ['multiStep'],
                          },
                      },
                      description: 'The operations to perform',
                      default: {},
                      options: [
                          {
                              name: 'operations',
                              displayName: 'Operations',
                              values: [
                                  {
                                      displayName: 'Operation',
                                      name: 'operation',
                                      type: 'options',
                                      noDataExpression: true,
                                      options: nodeOperations,
                                      default: '',
                                  },
                                  ...nodeOperationOptions,
                                  {
                                      displayName: 'Font Name or ID',
                                      name: 'font',
                                      type: 'options',
                                      displayOptions: {
                                          show: {
                                              operation: ['text'],
                                          },
                                      },
                                      typeOptions: {
                                          loadOptionsMethod: 'getFonts',
                                      },
                                      default: 'default',
                                      description: 'The font to use. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                  },
                              ],
                          },
                      ],
                  },
                  ...nodeOperationOptions,
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      displayOptions: {
                          hide: {
                              operation: ['information'],
                          },
                      },
                      options: [
                          {
                              displayName: 'File Name',
                              name: 'fileName',
                              type: 'string',
                              default: '',
                              description: 'File name to set in binary data',
                          },
                          {
                              displayName: 'Font Name or ID',
                              name: 'font',
                              type: 'options',
                              displayOptions: {
                                  show: {
                                      '/operation': ['text'],
                                  },
                              },
                              typeOptions: {
                                  loadOptionsMethod: 'getFonts',
                              },
                              default: 'default',
                              description: 'The font to use. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                          {
                              displayName: 'Format',
                              name: 'format',
                              type: 'options',
                              options: [
                                  {
                                      name: 'bmp',
                                      value: 'bmp',
                                  },
                                  {
                                      name: 'gif',
                                      value: 'gif',
                                  },
                                  {
                                      name: 'jpeg',
                                      value: 'jpeg',
                                  },
                                  {
                                      name: 'png',
                                      value: 'png',
                                  },
                                  {
                                      name: 'tiff',
                                      value: 'tiff',
                                  },
                                  {
                                      name: 'WebP',
                                      value: 'webp',
                                  },
                              ],
                              default: 'jpeg',
                              description: 'Set the output image format',
                          },
                          {
                              displayName: 'Quality',
                              name: 'quality',
                              type: 'number',
                              typeOptions: {
                                  minValue: 0,
                                  maxValue: 100,
                              },
                              default: 100,
                              displayOptions: {
                                  show: {
                                      format: ['jpeg', 'png', 'tiff'],
                                  },
                              },
                              description: 'Sets the jpeg|png|tiff compression level from 0 to 100 (best)',
                          },
                      ],
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getFonts() {
                      const files = await (0, get_system_fonts_1.default)();
                      const returnData = [];
                      files.forEach((entry) => {
                          const pathParts = (0, path_1.parse)(entry);
                          if (!pathParts.ext) {
                              return;
                          }
                          returnData.push({
                              name: pathParts.name,
                              value: entry,
                          });
                      });
                      returnData.sort((a, b) => {
                          if (a.name < b.name) {
                              return -1;
                          }
                          if (a.name > b.name) {
                              return 1;
                          }
                          return 0;
                      });
                      returnData.unshift({
                          name: 'default',
                          value: 'default',
                      });
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let item;
          for (let itemIndex = 0; itemIndex < length; itemIndex++) {
              try {
                  item = items[itemIndex];
                  const operation = this.getNodeParameter('operation', itemIndex);
                  const dataPropertyName = this.getNodeParameter('dataPropertyName', itemIndex);
                  const options = this.getNodeParameter('options', itemIndex, {});
                  const cleanupFunctions = [];
                  let gmInstance;
                  const requiredOperationParameters = {
                      blur: ['blur', 'sigma'],
                      border: ['borderColor', 'borderWidth', 'borderHeight'],
                      create: ['backgroundColor', 'height', 'width'],
                      crop: ['height', 'positionX', 'positionY', 'width'],
                      composite: ['dataPropertyNameComposite', 'operator', 'positionX', 'positionY'],
                      draw: [
                          'color',
                          'cornerRadius',
                          'endPositionX',
                          'endPositionY',
                          'primitive',
                          'startPositionX',
                          'startPositionY',
                      ],
                      information: [],
                      resize: ['height', 'resizeOption', 'width'],
                      rotate: ['backgroundColor', 'rotate'],
                      shear: ['degreesX', 'degreesY'],
                      text: ['font', 'fontColor', 'fontSize', 'lineLength', 'positionX', 'positionY', 'text'],
                      transparent: ['color'],
                  };
                  let operations = [];
                  if (operation === 'multiStep') {
                      const operationsData = this.getNodeParameter('operations', itemIndex, {
                          operations: [],
                      });
                      operations = operationsData.operations;
                  }
                  else {
                      const operationParameters = {};
                      requiredOperationParameters[operation].forEach((parameterName) => {
                          try {
                              operationParameters[parameterName] = this.getNodeParameter(parameterName, itemIndex);
                          }
                          catch (error) { }
                      });
                      operations = [
                          {
                              operation,
                              ...operationParameters,
                          },
                      ];
                  }
                  if (operations[0].operation !== 'create') {
                      this.helpers.assertBinaryData(itemIndex, dataPropertyName);
                      const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(itemIndex, dataPropertyName);
                      gmInstance = (0, gm_1.default)(binaryDataBuffer);
                      gmInstance = gmInstance.background('transparent');
                  }
                  const newItem = {
                      json: item.json,
                      binary: {},
                      pairedItem: {
                          item: itemIndex,
                      },
                  };
                  if (operation === 'information') {
                      const imageData = await new Promise((resolve, reject) => {
                          gmInstance = gmInstance.identify((error, data) => {
                              if (error) {
                                  reject(error);
                                  return;
                              }
                              resolve(data);
                          });
                      });
                      newItem.json = imageData;
                  }
                  for (let i = 0; i < operations.length; i++) {
                      const operationData = operations[i];
                      if (operationData.operation === 'blur') {
                          gmInstance = gmInstance.blur(operationData.blur, operationData.sigma);
                      }
                      else if (operationData.operation === 'border') {
                          gmInstance = gmInstance
                              .borderColor(operationData.borderColor)
                              .border(operationData.borderWidth, operationData.borderHeight);
                      }
                      else if (operationData.operation === 'composite') {
                          const positionX = operationData.positionX;
                          const positionY = operationData.positionY;
                          const operator = operationData.operator;
                          const geometryString = (positionX >= 0 ? '+' : '') + positionX + (positionY >= 0 ? '+' : '') + positionY;
                          const binaryPropertyName = operationData.dataPropertyNameComposite;
                          this.helpers.assertBinaryData(itemIndex, binaryPropertyName);
                          const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(itemIndex, binaryPropertyName);
                          const { fd, path, cleanup } = await (0, tmp_promise_1.file)();
                          cleanupFunctions.push(cleanup);
                          await fsWriteFileAsync(fd, binaryDataBuffer);
                          if (operations[0].operation === 'create') {
                              gmInstance = (0, gm_1.default)(gmInstance.stream('png'))
                                  .compose(operator)
                                  .geometry(geometryString)
                                  .composite(path);
                          }
                          else {
                              gmInstance = gmInstance.compose(operator).geometry(geometryString).composite(path);
                          }
                          if (operations.length !== i + 1) {
                              gmInstance = (0, gm_1.default)(gmInstance.stream());
                          }
                      }
                      else if (operationData.operation === 'create') {
                          gmInstance = (0, gm_1.default)(operationData.width, operationData.height, operationData.backgroundColor);
                          if (!options.format) {
                              options.format = 'png';
                          }
                      }
                      else if (operationData.operation === 'crop') {
                          gmInstance = gmInstance.crop(operationData.width, operationData.height, operationData.positionX, operationData.positionY);
                      }
                      else if (operationData.operation === 'draw') {
                          gmInstance = gmInstance.fill(operationData.color);
                          if (operationData.primitive === 'line') {
                              gmInstance = gmInstance.drawLine(operationData.startPositionX, operationData.startPositionY, operationData.endPositionX, operationData.endPositionY);
                          }
                          else if (operationData.primitive === 'circle') {
                              gmInstance = gmInstance.drawCircle(operationData.startPositionX, operationData.startPositionY, operationData.endPositionX, operationData.endPositionY);
                          }
                          else if (operationData.primitive === 'rectangle') {
                              gmInstance = gmInstance.drawRectangle(operationData.startPositionX, operationData.startPositionY, operationData.endPositionX, operationData.endPositionY, operationData.cornerRadius || undefined);
                          }
                      }
                      else if (operationData.operation === 'resize') {
                          const resizeOption = operationData.resizeOption;
                          let option = '@';
                          if (resizeOption === 'ignoreAspectRatio') {
                              option = '!';
                          }
                          else if (resizeOption === 'minimumArea') {
                              option = '^';
                          }
                          else if (resizeOption === 'onlyIfSmaller') {
                              option = '<';
                          }
                          else if (resizeOption === 'onlyIfLarger') {
                              option = '>';
                          }
                          else if (resizeOption === 'percent') {
                              option = '%';
                          }
                          gmInstance = gmInstance.resize(operationData.width, operationData.height, option);
                      }
                      else if (operationData.operation === 'rotate') {
                          gmInstance = gmInstance.rotate(operationData.backgroundColor, operationData.rotate);
                      }
                      else if (operationData.operation === 'shear') {
                          gmInstance = gmInstance.shear(operationData.degreesX, operationData.degreesY);
                      }
                      else if (operationData.operation === 'text') {
                          const lines = [];
                          let currentLine = '';
                          operationData.text.split('\n').forEach((textLine) => {
                              textLine.split(' ').forEach((textPart) => {
                                  if (currentLine.length + textPart.length + 1 >
                                      operationData.lineLength) {
                                      lines.push(currentLine.trim());
                                      currentLine = `${textPart} `;
                                      return;
                                  }
                                  currentLine += `${textPart} `;
                              });
                              lines.push(currentLine.trim());
                              currentLine = '';
                          });
                          const renderText = lines.join('\n');
                          const font = options.font || operationData.font;
                          if (font && font !== 'default') {
                              gmInstance = gmInstance.font(font);
                          }
                          gmInstance = gmInstance
                              .fill(operationData.fontColor)
                              .fontSize(operationData.fontSize)
                              .drawText(operationData.positionX, operationData.positionY, renderText);
                      }
                      else if (operationData.operation === 'transparent') {
                          gmInstance = gmInstance.transparent(operationData.color);
                      }
                  }
                  if (item.binary !== undefined && newItem.binary) {
                      Object.assign(newItem.binary, item.binary);
                      if (newItem.binary[dataPropertyName]) {
                          newItem.binary[dataPropertyName] = (0, n8n_workflow_1.deepCopy)(newItem.binary[dataPropertyName]);
                      }
                  }
                  if (newItem.binary[dataPropertyName] === undefined) {
                      newItem.binary[dataPropertyName] = {
                          data: '',
                          mimeType: '',
                      };
                  }
                  if (options.quality !== undefined) {
                      gmInstance = gmInstance.quality(options.quality);
                  }
                  if (options.format !== undefined) {
                      gmInstance = gmInstance.setFormat(options.format);
                      newItem.binary[dataPropertyName].fileExtension = options.format;
                      newItem.binary[dataPropertyName].mimeType = `image/${options.format}`;
                      const fileName = newItem.binary[dataPropertyName].fileName;
                      if (fileName === null || fileName === void 0 ? void 0 : fileName.includes('.')) {
                          newItem.binary[dataPropertyName].fileName =
                              fileName.split('.').slice(0, -1).join('.') + '.' + options.format;
                      }
                  }
                  if (options.fileName !== undefined) {
                      newItem.binary[dataPropertyName].fileName = options.fileName;
                  }
                  returnData.push(await new Promise((resolve, reject) => {
                      gmInstance.toBuffer(async (error, buffer) => {
                          cleanupFunctions.forEach(async (cleanup) => cleanup());
                          if (error) {
                              return reject(error);
                          }
                          const binaryData = await this.helpers.prepareBinaryData(Buffer.from(buffer));
                          newItem.binary[dataPropertyName] = {
                              ...newItem.binary[dataPropertyName],
                              ...binaryData,
                          };
                          return resolve(newItem);
                      });
                  }));
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.EditImage = EditImage;
  //# sourceMappingURL=EditImage.node.js.map

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


node_type: n8n-nodes-base.Egoi
name: Egoi
package_name: n8n-nodes-base
display_name: E-goi
description: Consume E-goi API
code_hash: 7959ec1b723673e5851fff364a8c113937b48cf3ed38305425b2874697670c8a
source_location: node_modules/n8n-nodes-base/dist/nodes/Egoi/Egoi.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
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.Egoi = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class Egoi {
      constructor() {
          this.description = {
              displayName: 'E-goi',
              name: 'egoi',
              icon: 'file:egoi.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume E-goi API',
              defaults: {
                  name: 'E-goi',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'egoiApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      required: true,
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                      ],
                      default: 'contact',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      required: true,
                      options: [
                          {
                              name: 'Create',
                              value: 'create',
                              description: 'Create a member',
                              action: 'Create a member',
                          },
                          {
                              name: 'Get',
                              value: 'get',
                              description: 'Get a member',
                              action: 'Get a member',
                          },
                          {
                              name: 'Get Many',
                              value: 'getAll',
                              description: 'Get many members',
                              action: 'Get many members',
                          },
                          {
                              name: 'Update',
                              value: 'update',
                              description: 'Update a member',
                              action: 'Update a member',
                          },
                      ],
                      default: 'create',
                  },
                  {
                      displayName: 'List Name or ID',
                      name: 'list',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLists',
                      },
                      displayOptions: {
                          show: {
                              operation: ['getAll', 'create', 'update', 'get'],
                          },
                      },
                      default: '',
                      description: 'ID of list to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                          },
                      },
                      default: '',
                      description: 'Email address for a subscriber',
                  },
                  {
                      displayName: 'Contact ID',
                      name: 'contactId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['update'],
                          },
                      },
                      default: '',
                      description: 'Contact ID of the subscriber',
                  },
                  {
                      displayName: 'Resolve Data',
                      name: 'resolveData',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['create', 'update'],
                          },
                      },
                      default: true,
                      description: 'By default the response just includes the contact ID. If this option gets activated, it will resolve the data automatically.',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              operation: ['create'],
                              resource: ['contact'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Birth Date',
                              name: 'birth_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Birth date of a subscriber',
                          },
                          {
                              displayName: 'Cellphone',
                              name: 'cellphone',
                              type: 'string',
                              default: '',
                              description: 'Cellphone of a subscriber',
                          },
                          {
                              displayName: 'Extra Fields',
                              name: 'extraFieldsUi',
                              type: 'fixedCollection',
                              placeholder: 'Add Field',
                              default: {},
                              typeOptions: {
                                  multipleValues: true,
                              },
                              options: [
                                  {
                                      displayName: 'Extra Field',
                                      name: 'extraFieldValues',
                                      typeOptions: {
                                          multipleValueButtonText: 'Add Field',
                                      },
                                      values: [
                                          {
                                              displayName: 'Field Name or ID',
                                              name: 'field_id',
                                              type: 'options',
                                              description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getExtraFields',
                                                  loadOptionsDependsOn: ['list'],
                                              },
                                              default: '',
                                          },
                                          {
                                              displayName: 'Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'First Name',
                              name: 'first_name',
                              type: 'string',
                              default: '',
                              description: 'Name of a subscriber',
                          },
                          {
                              displayName: 'Last Name',
                              name: 'last_name',
                              type: 'string',
                              default: '',
                              description: 'Name of a subscriber',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Unconfirmed',
                                      value: 'unconfirmed',
                                  },
                                  {
                                      name: 'Active',
                                      value: 'active',
                                  },
                                  {
                                      name: 'Inactive',
                                      value: 'inactive',
                                  },
                                  {
                                      name: 'Removed',
                                      value: 'removed',
                                  },
                              ],
                              default: 'active',
                              description: "Subscriber's current status",
                          },
                          {
                              displayName: 'Tag Names or IDs',
                              name: 'tagIds',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getListTags',
                              },
                              default: [],
                              description: 'List of tag IDs to be added. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
                  {
                      displayName: 'Update Fields',
                      name: 'updateFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      default: {},
                      displayOptions: {
                          show: {
                              operation: ['update'],
                          },
                      },
                      options: [
                          {
                              displayName: 'Birth Date',
                              name: 'birth_date',
                              type: 'dateTime',
                              default: '',
                              description: 'Birth date of subscriber',
                          },
                          {
                              displayName: 'Cellphone',
                              name: 'cellphone',
                              type: 'string',
                              default: '',
                              description: 'Cellphone of subscriber',
                          },
                          {
                              displayName: 'Email',
                              name: 'email',
                              type: 'string',
                              placeholder: 'name@email.com',
                              default: '',
                              description: 'Email address for subscriber',
                          },
                          {
                              displayName: 'Extra Fields',
                              name: 'extraFieldsUi',
                              type: 'fixedCollection',
                              placeholder: 'Add Field',
                              default: {},
                              typeOptions: {
                                  multipleValues: true,
                              },
                              options: [
                                  {
                                      displayName: 'Extra Field',
                                      name: 'extraFieldValues',
                                      typeOptions: {
                                          multipleValueButtonText: 'Add Field',
                                      },
                                      values: [
                                          {
                                              displayName: 'Field Name or ID',
                                              name: 'field_id',
                                              type: 'options',
                                              description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                                              typeOptions: {
                                                  loadOptionsMethod: 'getExtraFields',
                                                  loadOptionsDependsOn: ['list'],
                                              },
                                              default: '',
                                          },
                                          {
                                              displayName: 'Value',
                                              name: 'value',
                                              type: 'string',
                                              default: '',
                                          },
                                      ],
                                  },
                              ],
                          },
                          {
                              displayName: 'First Name',
                              name: 'first_name',
                              type: 'string',
                              default: '',
                              description: 'Name of subscriber',
                          },
                          {
                              displayName: 'Last Name',
                              name: 'last_name',
                              type: 'string',
                              default: '',
                              description: 'Name of subscriber',
                          },
                          {
                              displayName: 'Status',
                              name: 'status',
                              type: 'options',
                              options: [
                                  {
                                      name: 'Unconfirmed',
                                      value: 'unconfirmed',
                                  },
                                  {
                                      name: 'Active',
                                      value: 'active',
                                  },
                                  {
                                      name: 'Inactive',
                                      value: 'inactive',
                                  },
                                  {
                                      name: 'Removed',
                                      value: 'removed',
                                  },
                              ],
                              default: 'active',
                              description: "Subscriber's current status",
                          },
                          {
                              displayName: 'Tag Names or IDs',
                              name: 'tagIds',
                              type: 'multiOptions',
                              typeOptions: {
                                  loadOptionsMethod: 'getListTags',
                              },
                              default: [],
                              description: 'List of tag IDs to be added. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                          },
                      ],
                  },
                  {
                      displayName: 'By',
                      name: 'by',
                      type: 'options',
                      options: [
                          {
                              name: 'Contact ID',
                              value: 'id',
                          },
                          {
                              name: 'Email',
                              value: 'email',
                          },
                      ],
                      displayOptions: {
                          show: {
                              operation: ['get'],
                              resource: ['contact'],
                          },
                      },
                      default: 'id',
                      description: 'Search by',
                  },
                  {
                      displayName: 'Contact ID',
                      name: 'contactId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['get'],
                              by: ['id'],
                          },
                      },
                      default: '',
                      description: 'Contact ID of the subscriber',
                  },
                  {
                      displayName: 'Email',
                      name: 'email',
                      type: 'string',
                      placeholder: 'name@email.com',
                      displayOptions: {
                          show: {
                              resource: ['contact'],
                              operation: ['get'],
                              by: ['email'],
                          },
                      },
                      default: '',
                      description: 'Email address for subscriber',
                  },
                  {
                      displayName: 'Return All',
                      name: 'returnAll',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['getAll'],
                              resource: ['contact'],
                          },
                      },
                      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: ['contact'],
                              returnAll: [false],
                          },
                      },
                      typeOptions: {
                          minValue: 1,
                          maxValue: 500,
                      },
                      default: 100,
                      description: 'Max number of results to return',
                  },
                  {
                      displayName: 'Simplify',
                      name: 'simple',
                      type: 'boolean',
                      displayOptions: {
                          show: {
                              operation: ['get', 'getAll'],
                              resource: ['contact'],
                          },
                      },
                      default: true,
                      description: 'Whether to return a simplified version of the response instead of the raw data',
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLists() {
                      const returnData = [];
                      const lists = await GenericFunctions_1.egoiApiRequestAllItems.call(this, 'items', 'GET', '/lists');
                      for (const list of lists) {
                          const listName = list.internal_name;
                          const listId = list.list_id;
                          returnData.push({
                              name: listName,
                              value: listId,
                          });
                      }
                      return returnData;
                  },
                  async getExtraFields() {
                      const returnData = [];
                      const listId = this.getCurrentNodeParameter('list');
                      const extraFields = await GenericFunctions_1.egoiApiRequest.call(this, 'GET', `/lists/${listId}/fields`);
                      for (const field of extraFields) {
                          if (field.type === 'extra') {
                              const fieldName = field.name;
                              const fieldId = field.field_id;
                              returnData.push({
                                  name: fieldName,
                                  value: fieldId,
                              });
                          }
                      }
                      return returnData;
                  },
                  async getListTags() {
                      const returnData = [];
                      const tagList = await GenericFunctions_1.egoiApiRequestAllItems.call(this, 'items', 'GET', '/tags');
                      for (const tag of tagList) {
                          const tagName = tag.name;
                          const tagId = tag.tag_id;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          let responseData;
          const returnData = [];
          const items = this.getInputData();
          const length = items.length;
          const operation = this.getNodeParameter('operation', 0);
          const resource = this.getNodeParameter('resource', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'contact') {
                      if (operation === 'create') {
                          const listId = this.getNodeParameter('list', i);
                          const email = this.getNodeParameter('email', i);
                          const resolveData = this.getNodeParameter('resolveData', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              base: {
                                  email,
                              },
                              extra: [],
                          };
                          if (additionalFields.birth_date) {
                              additionalFields.birth_date = (0, moment_timezone_1.default)(additionalFields.birth_date).format('YYYY-MM-DD');
                          }
                          if (additionalFields.extraFieldsUi) {
                              const extraFields = additionalFields.extraFieldsUi
                                  .extraFieldValues;
                              if (extraFields) {
                                  body.extra = extraFields;
                              }
                          }
                          Object.assign(body.base, additionalFields);
                          responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'POST', `/lists/${listId}/contacts`, body);
                          const contactId = responseData.contact_id;
                          if (additionalFields.tagIds) {
                              const tags = additionalFields.tagIds;
                              for (const tag of tags) {
                                  await GenericFunctions_1.egoiApiRequest.call(this, 'POST', `/lists/${listId}/contacts/actions/attach-tag`, { tag_id: tag, contacts: [contactId] });
                              }
                          }
                          if (resolveData) {
                              responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'GET', `/lists/${listId}/contacts/${contactId}`);
                          }
                      }
                      if (operation === 'get') {
                          const listId = this.getNodeParameter('list', i);
                          const simple = this.getNodeParameter('simple', i);
                          const by = this.getNodeParameter('by', 0);
                          let endpoint = '';
                          if (by === 'id') {
                              const contactId = this.getNodeParameter('contactId', i);
                              endpoint = `/lists/${listId}/contacts/${contactId}`;
                          }
                          else {
                              const email = this.getNodeParameter('email', i);
                              endpoint = `/lists/${listId}/contacts?email=${email}`;
                          }
                          responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'GET', endpoint, {});
                          if (responseData.items) {
                              responseData = responseData.items;
                          }
                          if (simple) {
                              const data = (await GenericFunctions_1.simplify.call(this, [responseData], listId))[0];
                              responseData = {
                                  ...data,
                                  email_stats: responseData.email_stats,
                                  sms_stats: responseData.sms_stats,
                                  push_stats: responseData.push_stats,
                                  webpush_stats: responseData.webpush_stats,
                                  voice_stats: responseData.voice_stats,
                              };
                          }
                      }
                      if (operation === 'getAll') {
                          const listId = this.getNodeParameter('list', i);
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const simple = this.getNodeParameter('simple', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.egoiApiRequestAllItems.call(this, 'items', 'GET', `/lists/${listId}/contacts`, {});
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'GET', `/lists/${listId}/contacts`, {}, { limit });
                              responseData = responseData.items;
                          }
                          if (simple) {
                              responseData = await GenericFunctions_1.simplify.call(this, responseData, listId);
                          }
                      }
                      if (operation === 'update') {
                          const listId = this.getNodeParameter('list', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          const resolveData = this.getNodeParameter('resolveData', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              base: {},
                              extra: [],
                          };
                          if (updateFields.birth_date) {
                              updateFields.birth_date = (0, moment_timezone_1.default)(updateFields.birth_date).format('YYYY-MM-DD');
                          }
                          if (updateFields.extraFieldsUi) {
                              const extraFields = updateFields.extraFieldsUi
                                  .extraFieldValues;
                              if (extraFields) {
                                  body.extra = extraFields;
                              }
                          }
                          Object.assign(body.base, updateFields);
                          responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'PATCH', `/lists/${listId}/contacts/${contactId}`, body);
                          if (updateFields.tagIds) {
                              const tags = updateFields.tagIds;
                              for (const tag of tags) {
                                  await GenericFunctions_1.egoiApiRequest.call(this, 'POST', `/lists/${listId}/contacts/actions/attach-tag`, { tag_id: tag, contacts: [contactId] });
                              }
                          }
                          if (resolveData) {
                              responseData = await GenericFunctions_1.egoiApiRequest.call(this, 'GET', `/lists/${listId}/contacts/${contactId}`);
                          }
                      }
                  }
              }
              catch (error) {
                  if (!this.continueOnFail()) {
                      throw error;
                  }
                  else {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Egoi = Egoi;
  //# sourceMappingURL=Egoi.node.js.map

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


node_type: n8n-nodes-base.ElasticSecurity
name: ElasticSecurity
package_name: n8n-nodes-base
display_name: Elastic Security
description: Consume the Elastic Security API
code_hash: d63c1501e626316617d40fe0f6070a3506e512574eba3c6663360949ee49cb87
source_location: node_modules/n8n-nodes-base/dist/nodes/Elastic/ElasticSecurity/ElasticSecurity.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ElasticSecurity = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  class ElasticSecurity {
      constructor() {
          this.description = {
              displayName: 'Elastic Security',
              name: 'elasticSecurity',
              icon: 'file:elasticSecurity.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Elastic Security API',
              defaults: {
                  name: 'Elastic Security',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'elasticSecurityApi',
                      required: true,
                      testedBy: 'elasticSecurityApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'options',
                      options: [
                          {
                              name: 'Case',
                              value: 'case',
                          },
                          {
                              name: 'Case Comment',
                              value: 'caseComment',
                          },
                          {
                              name: 'Case Tag',
                              value: 'caseTag',
                          },
                          {
                              name: 'Connector',
                              value: 'connector',
                          },
                      ],
                      default: 'case',
                  },
                  ...descriptions_1.caseOperations,
                  ...descriptions_1.caseFields,
                  ...descriptions_1.caseCommentOperations,
                  ...descriptions_1.caseCommentFields,
                  ...descriptions_1.caseTagOperations,
                  ...descriptions_1.caseTagFields,
                  ...descriptions_1.connectorOperations,
                  ...descriptions_1.connectorFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTags() {
                      const tags = (await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', '/cases/tags'));
                      return tags.map((tag) => ({ name: tag, value: tag }));
                  },
                  async getConnectors() {
                      const endpoint = '/cases/configure/connectors/_find';
                      const connectors = (await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', endpoint));
                      return connectors.map(({ name, id }) => ({ name, value: id }));
                  },
              },
              credentialTest: {
                  async elasticSecurityApiTest(credential) {
                      const { username, password, baseUrl: rawBaseUrl, } = credential.data;
                      const baseUrl = (0, GenericFunctions_1.tolerateTrailingSlash)(rawBaseUrl);
                      const token = Buffer.from(`${username}:${password}`).toString('base64');
                      const endpoint = '/cases/status';
                      const options = {
                          headers: {
                              Authorization: `Basic ${token}`,
                              'kbn-xsrf': true,
                          },
                          method: 'GET',
                          body: {},
                          qs: {},
                          uri: `${baseUrl}/api${endpoint}`,
                          json: true,
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          var _a, _b;
          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 === 'case') {
                      if (operation === 'create') {
                          const body = {
                              title: this.getNodeParameter('title', i),
                              connector: {},
                              owner: 'securitySolution',
                              description: '',
                              tags: [],
                              settings: {
                                  syncAlerts: this.getNodeParameter('additionalFields.syncAlerts', i, false),
                              },
                          };
                          const connectorId = this.getNodeParameter('connectorId', i);
                          const { id: fetchedId, name: fetchedName, type: fetchedType, } = await GenericFunctions_1.getConnector.call(this, connectorId);
                          const selectedConnectorType = this.getNodeParameter('connectorType', i);
                          if (fetchedType !== selectedConnectorType) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Connector Type does not match the type of the connector in Connector Name', { itemIndex: i });
                          }
                          const connector = {
                              id: fetchedId,
                              name: fetchedName,
                              type: fetchedType,
                              fields: {},
                          };
                          if (selectedConnectorType === '.jira') {
                              connector.fields = {
                                  issueType: this.getNodeParameter('issueType', i),
                                  priority: this.getNodeParameter('priority', i),
                                  parent: null,
                              };
                          }
                          else if (selectedConnectorType === '.servicenow') {
                              connector.fields = {
                                  urgency: this.getNodeParameter('urgency', i),
                                  severity: this.getNodeParameter('severity', i),
                                  impact: this.getNodeParameter('impact', i),
                                  category: this.getNodeParameter('category', i),
                                  subcategory: null,
                              };
                          }
                          else if (selectedConnectorType === '.resilient') {
                              const rawIssueTypes = this.getNodeParameter('issueTypes', i);
                              connector.fields = {
                                  issueTypes: rawIssueTypes.split(',').map(Number),
                                  severityCode: this.getNodeParameter('severityCode', i),
                                  incidentTypes: null,
                              };
                          }
                          body.connector = connector;
                          const { syncAlerts, ...rest } = this.getNodeParameter('additionalFields', i);
                          if (Object.keys(rest).length) {
                              Object.assign(body, rest);
                          }
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'POST', '/cases', body);
                      }
                      else if (operation === 'delete') {
                          const caseId = this.getNodeParameter('caseId', i);
                          await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'DELETE', `/cases?ids=["${caseId}"]`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const caseId = this.getNodeParameter('caseId', i);
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', `/cases/${caseId}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const { tags, status } = this.getNodeParameter('filters', i);
                          const sortOptions = this.getNodeParameter('sortOptions', i);
                          qs.sortField = (_a = sortOptions.sortField) !== null && _a !== void 0 ? _a : 'createdAt';
                          qs.sortOrder = (_b = sortOptions.sortOrder) !== null && _b !== void 0 ? _b : 'asc';
                          if (status) {
                              qs.status = status;
                          }
                          if (tags === null || tags === void 0 ? void 0 : tags.length) {
                              qs.tags = tags.join(',');
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', '/cases/_find', {}, qs);
                      }
                      else if (operation === 'getStatus') {
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', '/cases/status');
                      }
                      else if (operation === 'update') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { syncAlerts, ...rest } = updateFields;
                          Object.assign(body, {
                              cases: [
                                  {
                                      id: caseId,
                                      version: await GenericFunctions_1.getVersion.call(this, `/cases/${caseId}`),
                                      ...(syncAlerts && { settings: { syncAlerts } }),
                                      ...rest,
                                  },
                              ],
                          });
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'PATCH', '/cases', body);
                      }
                  }
                  else if (resource === 'caseTag') {
                      if (operation === 'add') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const { title, connector, owner, description, settings, tags } = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', `/cases/${caseId}`);
                          const tagToAdd = this.getNodeParameter('tag', i);
                          if (tags.includes(tagToAdd)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Cannot add tag "${tagToAdd}" to case ID ${caseId} because this case already has this tag.`, { itemIndex: i });
                          }
                          const body = {};
                          Object.assign(body, {
                              cases: [
                                  {
                                      id: caseId,
                                      title,
                                      connector,
                                      owner,
                                      description,
                                      settings,
                                      version: await GenericFunctions_1.getVersion.call(this, `/cases/${caseId}`),
                                      tags: [...tags, tagToAdd],
                                  },
                              ],
                          });
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'PATCH', '/cases', body);
                      }
                      else if (operation === 'remove') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const tagToRemove = this.getNodeParameter('tag', i);
                          const { title, connector, owner, description, settings, tags } = (await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', `/cases/${caseId}`));
                          if (!tags.includes(tagToRemove)) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Cannot remove tag "${tagToRemove}" from case ID ${caseId} because this case does not have this tag.`, { itemIndex: i });
                          }
                          const body = {};
                          Object.assign(body, {
                              cases: [
                                  {
                                      id: caseId,
                                      title,
                                      connector,
                                      owner,
                                      description,
                                      settings,
                                      version: await GenericFunctions_1.getVersion.call(this, `/cases/${caseId}`),
                                      tags: tags.filter((tag) => tag !== tagToRemove),
                                  },
                              ],
                          });
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'PATCH', '/cases', body);
                      }
                  }
                  else if (resource === 'caseComment') {
                      if (operation === 'add') {
                          const simple = this.getNodeParameter('simple', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              comment: this.getNodeParameter('comment', i),
                              type: 'user',
                              owner: additionalFields.owner || 'securitySolution',
                          };
                          const caseId = this.getNodeParameter('caseId', i);
                          const endpoint = `/cases/${caseId}/comments`;
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'POST', endpoint, body);
                          if (simple) {
                              const { comments } = responseData;
                              responseData = comments[comments.length - 1];
                          }
                      }
                      else if (operation === 'get') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const commentId = this.getNodeParameter('commentId', i);
                          const endpoint = `/cases/${caseId}/comments/${commentId}`;
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'getAll') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const endpoint = `/cases/${caseId}/comments`;
                          responseData = await GenericFunctions_1.handleListing.call(this, 'GET', endpoint);
                      }
                      else if (operation === 'remove') {
                          const caseId = this.getNodeParameter('caseId', i);
                          const commentId = this.getNodeParameter('commentId', i);
                          const endpoint = `/cases/${caseId}/comments/${commentId}`;
                          await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'DELETE', endpoint);
                          responseData = { success: true };
                      }
                      else if (operation === 'update') {
                          const simple = this.getNodeParameter('simple', i);
                          const caseId = this.getNodeParameter('caseId', i);
                          const commentId = this.getNodeParameter('commentId', i);
                          const body = {
                              comment: this.getNodeParameter('comment', i),
                              id: commentId,
                              type: 'user',
                              owner: 'securitySolution',
                              version: await GenericFunctions_1.getVersion.call(this, `/cases/${caseId}/comments/${commentId}`),
                          };
                          const patchEndpoint = `/cases/${caseId}/comments`;
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'PATCH', patchEndpoint, body);
                          if (simple) {
                              const { comments } = responseData;
                              responseData = comments[comments.length - 1];
                          }
                      }
                  }
                  else if (resource === 'connector') {
                      if (operation === 'create') {
                          const connectorType = this.getNodeParameter('connectorType', i);
                          const body = {
                              connector_type_id: connectorType,
                              name: this.getNodeParameter('name', i),
                          };
                          if (connectorType === '.jira') {
                              body.config = {
                                  apiUrl: this.getNodeParameter('apiUrl', i),
                                  projectKey: this.getNodeParameter('projectKey', i),
                              };
                              body.secrets = {
                                  email: this.getNodeParameter('email', i),
                                  apiToken: this.getNodeParameter('apiToken', i),
                              };
                          }
                          else if (connectorType === '.resilient') {
                              body.config = {
                                  apiUrl: this.getNodeParameter('apiUrl', i),
                                  orgId: this.getNodeParameter('orgId', i),
                              };
                              body.secrets = {
                                  apiKeyId: this.getNodeParameter('apiKeyId', i),
                                  apiKeySecret: this.getNodeParameter('apiKeySecret', i),
                              };
                          }
                          else if (connectorType === '.servicenow') {
                              body.config = {
                                  apiUrl: this.getNodeParameter('apiUrl', i),
                              };
                              body.secrets = {
                                  username: this.getNodeParameter('username', i),
                                  password: this.getNodeParameter('password', i),
                              };
                          }
                          responseData = await GenericFunctions_1.elasticSecurityApiRequest.call(this, 'POST', '/actions/connector', body);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.ElasticSecurity = ElasticSecurity;
  //# sourceMappingURL=ElasticSecurity.node.js.map

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


node_type: n8n-nodes-base.Elasticsearch
name: Elasticsearch
package_name: n8n-nodes-base
display_name: Elasticsearch
description: Consume the Elasticsearch API
code_hash: 1a912478e4feb858d6fae8d87b347488d464bc2349ae630d36f52c53db076273
source_location: node_modules/n8n-nodes-base/dist/nodes/Elastic/Elasticsearch/Elasticsearch.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
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.Elasticsearch = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const descriptions_1 = require("./descriptions");
  const omit_1 = __importDefault(require("lodash/omit"));
  class Elasticsearch {
      constructor() {
          this.description = {
              displayName: 'Elasticsearch',
              name: 'elasticsearch',
              icon: 'file:elasticsearch.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Elasticsearch API',
              defaults: {
                  name: 'Elasticsearch',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'elasticsearchApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Document',
                              value: 'document',
                          },
                          {
                              name: 'Index',
                              value: 'index',
                          },
                      ],
                      default: 'document',
                  },
                  ...descriptions_1.documentOperations,
                  ...descriptions_1.documentFields,
                  ...descriptions_1.indexOperations,
                  ...descriptions_1.indexFields,
              ],
          };
      }
      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++) {
              if (resource === 'document') {
                  if (operation === 'delete') {
                      const indexId = this.getNodeParameter('indexId', i);
                      const documentId = this.getNodeParameter('documentId', i);
                      const endpoint = `/${indexId}/_doc/${documentId}`;
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'DELETE', endpoint);
                  }
                  else if (operation === 'get') {
                      const indexId = this.getNodeParameter('indexId', i);
                      const documentId = this.getNodeParameter('documentId', i);
                      const qs = {};
                      const options = this.getNodeParameter('options', i);
                      if (Object.keys(options).length) {
                          Object.assign(qs, options);
                          qs._source = true;
                      }
                      const endpoint = `/${indexId}/_doc/${documentId}`;
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'GET', endpoint, {}, qs);
                      const simple = this.getNodeParameter('simple', i);
                      if (simple) {
                          responseData = {
                              _id: responseData._id,
                              ...responseData._source,
                          };
                      }
                  }
                  else if (operation === 'getAll') {
                      const indexId = this.getNodeParameter('indexId', i);
                      const body = {};
                      const qs = {};
                      const options = this.getNodeParameter('options', i);
                      if (Object.keys(options).length) {
                          const { query, ...rest } = options;
                          if (query) {
                              Object.assign(body, (0, n8n_workflow_1.jsonParse)(query, { errorMessage: "Invalid JSON in 'Query' option" }));
                          }
                          Object.assign(qs, rest);
                          qs._source = true;
                      }
                      const returnAll = this.getNodeParameter('returnAll', 0);
                      if (returnAll) {
                          qs.size = 10000;
                          if (qs.sort) {
                              responseData = await GenericFunctions_1.elasticsearchApiRequestAllItems.call(this, indexId, body, qs);
                          }
                          else {
                              responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'GET', `/${indexId}/_search`, body, qs);
                              responseData = responseData.hits.hits;
                          }
                      }
                      else {
                          qs.size = this.getNodeParameter('limit', 0);
                          responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'GET', `/${indexId}/_search`, body, qs);
                          responseData = responseData.hits.hits;
                      }
                      const simple = this.getNodeParameter('simple', 0);
                      if (simple) {
                          responseData = responseData.map((item) => {
                              return {
                                  _id: item._id,
                                  ...item._source,
                              };
                          });
                      }
                  }
                  else if (operation === 'create') {
                      const body = {};
                      const dataToSend = this.getNodeParameter('dataToSend', 0);
                      if (dataToSend === 'defineBelow') {
                          const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          fields.forEach(({ fieldId, fieldValue }) => (body[fieldId] = fieldValue));
                      }
                      else {
                          const inputData = items[i].json;
                          const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i);
                          const inputsToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
                          for (const key of Object.keys(inputData)) {
                              if (inputsToIgnore.includes(key))
                                  continue;
                              body[key] = inputData[key];
                          }
                      }
                      const qs = {};
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (Object.keys(additionalFields).length) {
                          Object.assign(qs, (0, omit_1.default)(additionalFields, ['documentId']));
                      }
                      const indexId = this.getNodeParameter('indexId', i);
                      const { documentId } = additionalFields;
                      if (documentId) {
                          const endpoint = `/${indexId}/_doc/${documentId}`;
                          responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'PUT', endpoint, body);
                      }
                      else {
                          const endpoint = `/${indexId}/_doc`;
                          responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'POST', endpoint, body);
                      }
                  }
                  else if (operation === 'update') {
                      const body = { doc: {} };
                      const dataToSend = this.getNodeParameter('dataToSend', 0);
                      if (dataToSend === 'defineBelow') {
                          const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          fields.forEach(({ fieldId, fieldValue }) => (body.doc[fieldId] = fieldValue));
                      }
                      else {
                          const inputData = items[i].json;
                          const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i);
                          const inputsToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
                          for (const key of Object.keys(inputData)) {
                              if (inputsToIgnore.includes(key))
                                  continue;
                              body.doc[key] = inputData[key];
                          }
                      }
                      const indexId = this.getNodeParameter('indexId', i);
                      const documentId = this.getNodeParameter('documentId', i);
                      const endpoint = `/${indexId}/_update/${documentId}`;
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'POST', endpoint, body);
                  }
              }
              else if (resource === 'index') {
                  if (operation === 'create') {
                      const indexId = this.getNodeParameter('indexId', i);
                      const body = {};
                      const qs = {};
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (Object.keys(additionalFields).length) {
                          const { aliases, mappings, settings, ...rest } = additionalFields;
                          Object.assign(body, aliases, mappings, settings);
                          Object.assign(qs, rest);
                      }
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'PUT', `/${indexId}`);
                      responseData = { id: indexId, ...responseData };
                      delete responseData.index;
                  }
                  else if (operation === 'delete') {
                      const indexId = this.getNodeParameter('indexId', i);
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'DELETE', `/${indexId}`);
                      responseData = { success: true };
                  }
                  else if (operation === 'get') {
                      const indexId = this.getNodeParameter('indexId', i);
                      const qs = {};
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (Object.keys(additionalFields).length) {
                          Object.assign(qs, additionalFields);
                      }
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'GET', `/${indexId}`, {}, qs);
                      responseData = { id: indexId, ...responseData[indexId] };
                  }
                  else if (operation === 'getAll') {
                      responseData = await GenericFunctions_1.elasticsearchApiRequest.call(this, 'GET', '/_aliases');
                      responseData = Object.keys(responseData).map((index) => ({
                          indexId: index,
                      }));
                      const returnAll = this.getNodeParameter('returnAll', i);
                      if (!returnAll) {
                          const limit = this.getNodeParameter('limit', i);
                          responseData = responseData.slice(0, limit);
                      }
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.Elasticsearch = Elasticsearch;
  //# sourceMappingURL=Elasticsearch.node.js.map

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


node_type: n8n-nodes-base.EmailReadImap
name: EmailReadImap
package_name: n8n-nodes-base
display_name: Email Trigger (IMAP)
description: Triggers the workflow when a new email is received
code_hash: b3d4946398bf3fb32954b1d50cef910b0831f468d4d364cf5288676b41d43a53
source_location: node_modules/n8n-nodes-base/dist/nodes/EmailReadImap/EmailReadImap.node.js
extracted_at: 2025-06-07 19:36:30
updated_at: 2025-06-07 19:36:30
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.EmailReadImap = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const EmailReadImapV1_node_1 = require("./v1/EmailReadImapV1.node");
  const EmailReadImapV2_node_1 = require("./v2/EmailReadImapV2.node");
  class EmailReadImap extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Email Trigger (IMAP)',
              name: 'emailReadImap',
              icon: 'fa:inbox',
              group: ['trigger'],
              description: 'Triggers the workflow when a new email is received',
              defaultVersion: 2,
          };
          const nodeVersions = {
              1: new EmailReadImapV1_node_1.EmailReadImapV1(baseDescription),
              2: new EmailReadImapV2_node_1.EmailReadImapV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.EmailReadImap = EmailReadImap;
  //# sourceMappingURL=EmailReadImap.node.js.map

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


node_type: n8n-nodes-base.EmailSend
name: EmailSend
package_name: n8n-nodes-base
display_name: Send Email
description: Sends an email using SMTP protocol
code_hash: d76e18808343c4d0a7c35db3213e8e69bdb684cdda5c613e60b184da12c76b4c
source_location: node_modules/n8n-nodes-base/dist/nodes/EmailSend/EmailSend.node.js
extracted_at: 2025-06-07 19:36:33
updated_at: 2025-06-07 19:36:33
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.EmailSend = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const EmailSendV1_node_1 = require("./v1/EmailSendV1.node");
  const EmailSendV2_node_1 = require("./v2/EmailSendV2.node");
  class EmailSend extends n8n_workflow_1.VersionedNodeType {
      constructor() {
          const baseDescription = {
              displayName: 'Send Email',
              name: 'emailSend',
              icon: 'fa:envelope',
              group: ['output'],
              defaultVersion: 2.1,
              description: 'Sends an email using SMTP protocol',
          };
          const nodeVersions = {
              1: new EmailSendV1_node_1.EmailSendV1(baseDescription),
              2: new EmailSendV2_node_1.EmailSendV2(baseDescription),
              2.1: new EmailSendV2_node_1.EmailSendV2(baseDescription),
          };
          super(nodeVersions, baseDescription);
      }
  }
  exports.EmailSend = EmailSend;
  //# sourceMappingURL=EmailSend.node.js.map

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


node_type: n8n-nodes-base.Emelia
name: Emelia
package_name: n8n-nodes-base
display_name: Emelia
description: Consume the Emelia API
code_hash: 6766c6cf35962c2279f103df5e159989ed84476fefdc6612dc6e482526b19271
source_location: node_modules/n8n-nodes-base/dist/nodes/Emelia/Emelia.node.js
extracted_at: 2025-06-07 19:36:33
updated_at: 2025-06-07 19:36:33
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.Emelia = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const CampaignDescription_1 = require("./CampaignDescription");
  const ContactListDescription_1 = require("./ContactListDescription");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  class Emelia {
      constructor() {
          this.description = {
              displayName: 'Emelia',
              name: 'emelia',
              icon: 'file:emelia.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Emelia API',
              defaults: {
                  name: 'Emelia',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'emeliaApi',
                      required: true,
                      testedBy: 'emeliaApiTest',
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Campaign',
                              value: 'campaign',
                          },
                          {
                              name: 'Contact List',
                              value: 'contactList',
                          },
                      ],
                      default: 'campaign',
                      required: true,
                  },
                  ...CampaignDescription_1.campaignOperations,
                  ...CampaignDescription_1.campaignFields,
                  ...ContactListDescription_1.contactListOperations,
                  ...ContactListDescription_1.contactListFields,
              ],
          };
          this.methods = {
              credentialTest: {
                  emeliaApiTest: GenericFunctions_1.emeliaApiTest,
              },
              loadOptions: {
                  async getCampaigns() {
                      return GenericFunctions_1.loadResource.call(this, 'campaign');
                  },
                  async getContactLists() {
                      return GenericFunctions_1.loadResource.call(this, 'contactList');
                  },
              },
          };
      }
      async execute() {
          var _a, _b;
          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 {
                  if (resource === 'campaign') {
                      if (operation === 'addContact') {
                          const contact = {
                              email: this.getNodeParameter('contactEmail', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(contact, additionalFields);
                          }
                          if (additionalFields.customFieldsUi) {
                              const customFields = ((_a = additionalFields.customFieldsUi) === null || _a === void 0 ? void 0 : _a.customFieldsValues) || [];
                              const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldName}`]: value.value }), {});
                              Object.assign(contact, data);
                              delete contact.customFieldsUi;
                          }
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									mutation AddContactToCampaignHook($id: ID!, $contact: JSON!) {
  										addContactToCampaignHook(id: $id, contact: $contact)
  								}`,
                              operationName: 'AddContactToCampaignHook',
                              variables: {
                                  id: this.getNodeParameter('campaignId', i),
                                  contact,
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({
                              contactId: responseData.data.addContactToCampaignHook,
                          }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'create') {
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              operationName: 'createCampaign',
                              query: `
  									mutation createCampaign($name: String!) {
  										createCampaign(name: $name) {
  											_id
  											name
  											status
  											createdAt
  											provider
  											startAt
  											estimatedEnd
  										}
  									}`,
                              variables: {
                                  name: this.getNodeParameter('campaignName', i),
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.data.createCampaign), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'get') {
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									query campaign($id: ID!){
  										campaign(id: $id){
  											_id
  											name
  											status
  											createdAt
  											schedule{
  												dailyContact
  												dailyLimit
  												minInterval
  												maxInterval
  												trackLinks
  												trackOpens
  												timeZone
  												days
  												start
  												end
  												eventToStopMails
  											}
  											provider
  											startAt
  											recipients{
  												total_count
  											}
  											estimatedEnd
  										}
  									}`,
                              operationName: 'campaign',
                              variables: {
                                  id: this.getNodeParameter('campaignId', i),
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData.data.campaign), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'getAll') {
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									query all_campaigns {
  										all_campaigns {
  											_id
  											name
  											status
  											createdAt
  											stats {
  												mailsSent
  												uniqueOpensPercent
  												opens
  												linkClickedPercent
  												repliedPercent
  												bouncedPercent
  												unsubscribePercent
  												progressPercent
  											}
  										}
  									}`,
                              operationName: 'all_campaigns',
                          });
                          let campaigns = responseData.data.all_campaigns;
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              campaigns = campaigns.slice(0, limit);
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(campaigns), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'pause') {
                          await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									mutation pauseCampaign($id: ID!) {
  										pauseCampaign(id: $id)
  									}`,
                              operationName: 'pauseCampaign',
                              variables: {
                                  id: this.getNodeParameter('campaignId', i),
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'start') {
                          await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									mutation startCampaign($id: ID!) {
  										startCampaign(id: $id)
  									}`,
                              operationName: 'startCampaign',
                              variables: {
                                  id: this.getNodeParameter('campaignId', i),
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'duplicate') {
                          const options = this.getNodeParameter('options', i);
                          const variables = {
                              fromId: this.getNodeParameter('campaignId', i),
                              name: this.getNodeParameter('campaignName', i),
                              copySettings: true,
                              copyMails: true,
                              copyContacts: false,
                              copyProvider: true,
                              ...options,
                          };
                          const { data: { duplicateCampaign }, } = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									mutation duplicateCampaign(
  										$fromId: ID!
  										$name: String!
  										$copySettings: Boolean!
  										$copyMails: Boolean!
  										$copyContacts: Boolean!
  										$copyProvider: Boolean!
  									) {
  										duplicateCampaign(
  											fromId: $fromId
  											name: $name
  											copySettings: $copySettings
  											copyMails: $copyMails
  											copyContacts: $copyContacts
  											copyProvider: $copyProvider
  										)
  									}`,
                              operationName: 'duplicateCampaign',
                              variables,
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ _id: duplicateCampaign }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                  }
                  else if (resource === 'contactList') {
                      if (operation === 'add') {
                          const contact = {
                              email: this.getNodeParameter('contactEmail', i),
                          };
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (!(0, isEmpty_1.default)(additionalFields)) {
                              Object.assign(contact, additionalFields);
                          }
                          if (additionalFields.customFieldsUi) {
                              const customFields = ((_b = additionalFields.customFieldsUi) === null || _b === void 0 ? void 0 : _b.customFieldsValues) || [];
                              const data = customFields.reduce((obj, value) => Object.assign(obj, { [`${value.fieldName}`]: value.value }), {});
                              Object.assign(contact, data);
                              delete contact.customFieldsUi;
                          }
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									mutation AddContactsToListHook($id: ID!, $contact: JSON!) {
  										addContactsToListHook(id: $id, contact: $contact)
  									}`,
                              operationName: 'AddContactsToListHook',
                              variables: {
                                  id: this.getNodeParameter('contactListId', i),
                                  contact,
                              },
                          });
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ contactId: responseData.data.addContactsToListHook }), { itemData: { item: i } });
                          returnData.push(...executionData);
                      }
                      else if (operation === 'getAll') {
                          const responseData = await GenericFunctions_1.emeliaGraphqlRequest.call(this, {
                              query: `
  									query contact_lists{
  										contact_lists{
  											_id
  											name
  											contactCount
  											fields
  											usedInCampaign
  										}
  									}`,
                              operationName: 'contact_lists',
                          });
                          let contactLists = responseData.data.contact_lists;
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              contactLists = contactLists.slice(0, limit);
                          }
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(contactLists), { 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.Emelia = Emelia;
  //# sourceMappingURL=Emelia.node.js.map

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


node_type: n8n-nodes-base.ErrorTrigger
name: ErrorTrigger
package_name: n8n-nodes-base
display_name: Error Trigger
description: Triggers the workflow when another workflow has an error
code_hash: 433bf91938992037c402b9331a9acbac3ece630c83526bdf8b1b33bde151d98c
source_location: node_modules/n8n-nodes-base/dist/nodes/ErrorTrigger/ErrorTrigger.node.js
extracted_at: 2025-06-07 19:36:33
updated_at: 2025-06-07 19:36:33
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ErrorTrigger = void 0;
  class ErrorTrigger {
      constructor() {
          this.description = {
              displayName: 'Error Trigger',
              name: 'errorTrigger',
              icon: 'fa:bug',
              group: ['trigger'],
              version: 1,
              description: 'Triggers the workflow when another workflow has an error',
              eventTriggerDescription: '',
              mockManualExecution: true,
              maxNodes: 1,
              defaults: {
                  name: 'Error Trigger',
                  color: '#0000FF',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'This node will trigger when there is an error in another workflow, as long as that workflow is set up to do so. <a href="https://docs.n8n.io/integrations/core-nodes/n8n-nodes-base.errortrigger" target="_blank">More info<a>',
                      name: 'notice',
                      type: 'notice',
                      default: '',
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const mode = this.getMode();
          if (mode === 'manual' &&
              items.length === 1 &&
              Object.keys(items[0].json).length === 0 &&
              items[0].binary === undefined) {
              const restApiUrl = this.getRestApiUrl();
              const urlParts = restApiUrl.split('/');
              urlParts.pop();
              urlParts.push('execution');
              const id = 231;
              items[0].json = {
                  execution: {
                      id,
                      url: `${urlParts.join('/')}/workflow/1/${id}`,
                      retryOf: '34',
                      error: {
                          message: 'Example Error Message',
                          stack: 'Stacktrace',
                      },
                      lastNodeExecuted: 'Node With Error',
                      mode: 'manual',
                  },
                  workflow: {
                      id: '1',
                      name: 'Example Workflow',
                  },
              };
          }
          return [items];
      }
  }
  exports.ErrorTrigger = ErrorTrigger;
  //# sourceMappingURL=ErrorTrigger.node.js.map

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


node_type: n8n-nodes-base.ExecuteCommand
name: ExecuteCommand
package_name: n8n-nodes-base
display_name: Execute Command
description: Executes a command on the host
code_hash: bf8ab1b48895981a9c275e2cb6b6d840dc705e9e3815ef70f3881402b51fe537
source_location: node_modules/n8n-nodes-base/dist/nodes/ExecuteCommand/ExecuteCommand.node.js
extracted_at: 2025-06-07 19:36:33
updated_at: 2025-06-07 19:36:33
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ExecuteCommand = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const child_process_1 = require("child_process");
  async function execPromise(command) {
      const returnData = {
          error: undefined,
          exitCode: 0,
          stderr: '',
          stdout: '',
      };
      return new Promise((resolve, _reject) => {
          (0, child_process_1.exec)(command, { cwd: process.cwd() }, (error, stdout, stderr) => {
              returnData.stdout = stdout.trim();
              returnData.stderr = stderr.trim();
              if (error) {
                  returnData.error = error;
              }
              resolve(returnData);
          }).on('exit', (code) => {
              returnData.exitCode = code || 0;
          });
      });
  }
  class ExecuteCommand {
      constructor() {
          this.description = {
              displayName: 'Execute Command',
              name: 'executeCommand',
              icon: 'fa:terminal',
              group: ['transform'],
              version: 1,
              description: 'Executes a command on the host',
              defaults: {
                  name: 'Execute Command',
                  color: '#886644',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Execute Once',
                      name: 'executeOnce',
                      type: 'boolean',
                      default: true,
                      description: 'Whether to execute only once instead of once for each entry',
                  },
                  {
                      displayName: 'Command',
                      name: 'command',
                      typeOptions: {
                          rows: 5,
                      },
                      type: 'string',
                      default: '',
                      placeholder: 'echo "test"',
                      description: 'The command to execute',
                      required: true,
                  },
              ],
          };
      }
      async execute() {
          let items = this.getInputData();
          let command;
          const executeOnce = this.getNodeParameter('executeOnce', 0);
          if (executeOnce) {
              items = [items[0]];
          }
          const returnItems = [];
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              try {
                  command = this.getNodeParameter('command', itemIndex);
                  const { error, exitCode, stdout, stderr } = await execPromise(command);
                  if (error !== undefined) {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), error.message, { itemIndex });
                  }
                  returnItems.push({
                      json: {
                          exitCode,
                          stderr,
                          stdout,
                      },
                      pairedItem: {
                          item: itemIndex,
                      },
                  });
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnItems.push({
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnItems];
      }
  }
  exports.ExecuteCommand = ExecuteCommand;
  //# sourceMappingURL=ExecuteCommand.node.js.map

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


node_type: n8n-nodes-base.ExecuteWorkflow
name: ExecuteWorkflow
package_name: n8n-nodes-base
display_name: Execute Workflow
description: Execute another workflow
code_hash: f1565eb6ca9041c9444299bdf264ba10953d71afc7913c5e2ac7c14beead0c9e
source_location: node_modules/n8n-nodes-base/dist/nodes/ExecuteWorkflow/ExecuteWorkflow.node.js
extracted_at: 2025-06-07 19:36:33
updated_at: 2025-06-07 19:36:33
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ExecuteWorkflow = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const utilities_1 = require("../../utils/utilities");
  class ExecuteWorkflow {
      constructor() {
          this.description = {
              displayName: 'Execute Workflow',
              name: 'executeWorkflow',
              icon: 'fa:sign-in-alt',
              group: ['transform'],
              version: 1,
              subtitle: '={{"Workflow: " + $parameter["workflowId"]}}',
              description: 'Execute another workflow',
              defaults: {
                  name: 'Execute Workflow',
                  color: '#ff6d5a',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'hidden',
                      noDataExpression: true,
                      default: 'call_workflow',
                      options: [
                          {
                              name: 'Call Another Workflow',
                              value: 'call_workflow',
                          },
                      ],
                  },
                  {
                      displayName: 'Source',
                      name: 'source',
                      type: 'options',
                      options: [
                          {
                              name: 'Database',
                              value: 'database',
                              description: 'Load the workflow from the database by ID',
                          },
                          {
                              name: 'Local File',
                              value: 'localFile',
                              description: 'Load the workflow from a locally saved file',
                          },
                          {
                              name: 'Parameter',
                              value: 'parameter',
                              description: 'Load the workflow from a parameter',
                          },
                          {
                              name: 'URL',
                              value: 'url',
                              description: 'Load the workflow from an URL',
                          },
                      ],
                      default: 'database',
                      description: 'Where to get the workflow to execute from',
                  },
                  {
                      displayName: 'Workflow ID',
                      name: 'workflowId',
                      type: 'string',
                      displayOptions: {
                          show: {
                              source: ['database'],
                          },
                      },
                      default: '',
                      required: true,
                      hint: 'Can be found in the URL of the workflow',
                      description: "Note on using an expression here: if this node is set to run once with all items, they will all be sent to the <em>same</em> workflow. That workflow's ID will be calculated by evaluating the expression for the <strong>first input item</strong>.",
                  },
                  {
                      displayName: 'Workflow Path',
                      name: 'workflowPath',
                      type: 'string',
                      displayOptions: {
                          show: {
                              source: ['localFile'],
                          },
                      },
                      default: '',
                      placeholder: '/data/workflow.json',
                      required: true,
                      description: 'The path to local JSON workflow file to execute',
                  },
                  {
                      displayName: 'Workflow JSON',
                      name: 'workflowJson',
                      type: 'string',
                      typeOptions: {
                          editor: 'json',
                          rows: 10,
                      },
                      displayOptions: {
                          show: {
                              source: ['parameter'],
                          },
                      },
                      default: '\n\n\n',
                      required: true,
                      description: 'The workflow JSON code to execute',
                  },
                  {
                      displayName: 'Workflow URL',
                      name: 'workflowUrl',
                      type: 'string',
                      displayOptions: {
                          show: {
                              source: ['url'],
                          },
                      },
                      default: '',
                      placeholder: 'https://example.com/workflow.json',
                      required: true,
                      description: 'The URL from which to load the workflow from',
                  },
                  {
                      displayName: 'Any data you pass into this node will be output by the Execute Workflow Trigger. <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/" target="_blank">More info</a>',
                      name: 'executeWorkflowNotice',
                      type: 'notice',
                      default: '',
                  },
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Run once with all items',
                              value: 'once',
                              description: 'Pass all items into a single execution of the sub-workflow',
                          },
                          {
                              name: 'Run once for each item',
                              value: 'each',
                              description: 'Call the sub-workflow individually for each item',
                          },
                      ],
                      default: 'once',
                  },
              ],
          };
      }
      async execute() {
          const source = this.getNodeParameter('source', 0);
          const mode = this.getNodeParameter('mode', 0, false);
          const items = this.getInputData();
          if (mode === 'each') {
              const returnData = [];
              for (let i = 0; i < items.length; i++) {
                  try {
                      const workflowInfo = await GenericFunctions_1.getWorkflowInfo.call(this, source, i);
                      const workflowResult = await this.executeWorkflow(workflowInfo, [
                          items[i],
                      ]);
                      for (const [outputIndex, outputData] of workflowResult.entries()) {
                          for (const item of outputData) {
                              item.pairedItem = { item: i };
                          }
                          if (returnData[outputIndex] === undefined) {
                              returnData[outputIndex] = [];
                          }
                          returnData[outputIndex].push(...outputData);
                      }
                  }
                  catch (error) {
                      if (this.continueOnFail()) {
                          return [[{ json: { error: error.message }, pairedItem: { item: i } }]];
                      }
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {
                          message: `Error executing workflow with item at index ${i}`,
                          description: error.message,
                          itemIndex: i,
                      });
                  }
              }
              return returnData;
          }
          else {
              try {
                  const workflowInfo = await GenericFunctions_1.getWorkflowInfo.call(this, source);
                  const workflowResult = await this.executeWorkflow(workflowInfo, items);
                  const pairedItem = (0, utilities_1.generatePairedItemData)(items.length);
                  for (const output of workflowResult) {
                      for (const item of output) {
                          item.pairedItem = pairedItem;
                      }
                  }
                  return workflowResult;
              }
              catch (error) {
                  const pairedItem = (0, utilities_1.generatePairedItemData)(items.length);
                  if (this.continueOnFail()) {
                      return [[{ json: { error: error.message }, pairedItem }]];
                  }
                  throw error;
              }
          }
      }
  }
  exports.ExecuteWorkflow = ExecuteWorkflow;
  //# sourceMappingURL=ExecuteWorkflow.node.js.map

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


node_type: n8n-nodes-base.ExecuteWorkflowTrigger
name: ExecuteWorkflowTrigger
package_name: n8n-nodes-base
display_name: Execute Workflow Trigger
description: Helpers for calling other n8n workflows. Used for designing modular, microservice-like workflows.
code_hash: f1d84b2742ef34b0a1cb589ca488d87263fbd1890f844cd1a964c4221a0eefd5
source_location: node_modules/n8n-nodes-base/dist/nodes/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js
extracted_at: 2025-06-07 19:36:33
updated_at: 2025-06-07 19:36:33
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ExecuteWorkflowTrigger = void 0;
  class ExecuteWorkflowTrigger {
      constructor() {
          this.description = {
              displayName: 'Execute Workflow Trigger',
              name: 'executeWorkflowTrigger',
              icon: 'fa:sign-out-alt',
              group: ['trigger'],
              version: 1,
              description: 'Helpers for calling other n8n workflows. Used for designing modular, microservice-like workflows.',
              eventTriggerDescription: '',
              maxNodes: 1,
              defaults: {
                  name: 'Execute Workflow Trigger',
                  color: '#ff6d5a',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: "When an ‘execute workflow’ node calls this workflow, the execution starts here. Any data passed into the 'execute workflow' node will be output by this node.",
                      name: 'notice',
                      type: 'notice',
                      default: '',
                  },
                  {
                      displayName: 'Events',
                      name: 'events',
                      type: 'hidden',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Workflow Call',
                              value: 'worklfow_call',
                              description: 'When called by another workflow using Execute Workflow Trigger',
                              action: 'When Called by Another Workflow',
                          },
                      ],
                      default: 'worklfow_call',
                  },
              ],
          };
      }
      async execute() {
          return [this.getInputData()];
      }
  }
  exports.ExecuteWorkflowTrigger = ExecuteWorkflowTrigger;
  //# sourceMappingURL=ExecuteWorkflowTrigger.node.js.map

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


node_type: n8n-nodes-base.ExecutionData
name: ExecutionData
package_name: n8n-nodes-base
display_name: Execution Data
description: Add execution data for search
code_hash: 8d02375f5d0b6c49c900adcf415e46aead0c89e0033ccff2456c4ba5bb2ed769
source_location: node_modules/n8n-nodes-base/dist/nodes/ExecutionData/ExecutionData.node.js
extracted_at: 2025-06-07 19:36:33
updated_at: 2025-06-07 19:36:33
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.ExecutionData = void 0;
  class ExecutionData {
      constructor() {
          this.description = {
              displayName: 'Execution Data',
              name: 'executionData',
              icon: 'fa:tasks',
              group: ['input'],
              version: 1,
              description: 'Add execution data for search',
              defaults: {
                  name: 'Execution Data',
                  color: '#29A568',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: "Use this node to save fields you want to use later to easily find an execution (e.g. a user ID). You'll be able to search by this data in the 'executions' tab.<br>This feature is available on our Pro and Enterprise plans. <a href='https://n8n.io/pricing/' target='_blank'>More Info</a>.",
                      name: 'notice',
                      type: 'notice',
                      default: '',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      default: 'save',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Save Execution Data for Search',
                              value: 'save',
                              action: 'Save execution data for search',
                          },
                      ],
                  },
                  {
                      displayName: 'Data to Save',
                      name: 'dataToSave',
                      placeholder: 'Add Saved Field',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValueButtonText: 'Add Saved Field',
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              operation: ['save'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Values',
                              name: 'values',
                              values: [
                                  {
                                      displayName: 'Key',
                                      name: 'key',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'e.g. myKey',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'string',
                                      default: '',
                                      placeholder: 'e.g. myValue',
                                  },
                              ],
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const context = this.getWorkflowDataProxy(0);
          const items = this.getInputData();
          const operations = this.getNodeParameter('operation', 0);
          if (operations === 'save') {
              for (let i = 0; i < items.length; i++) {
                  const dataToSave = this.getNodeParameter('dataToSave', i, {}).values ||
                      [];
                  const values = dataToSave.reduce((acc, { key, value }) => {
                      acc[key] = value;
                      return acc;
                  }, {});
                  context.$execution.customData.setAll(values);
              }
          }
          return [items];
      }
  }
  exports.ExecutionData = ExecutionData;
  //# sourceMappingURL=ExecutionData.node.js.map

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


node_type: n8n-nodes-base.FileMaker
name: FileMaker
package_name: n8n-nodes-base
display_name: FileMaker
description: Retrieve data from the FileMaker data API
code_hash: d3aa71438148e0dd63bebb11eaff551e9d6e0435bea93d1946b143f720183540
source_location: node_modules/n8n-nodes-base/dist/nodes/FileMaker/FileMaker.node.js
extracted_at: 2025-06-07 19:36:33
updated_at: 2025-06-07 19:36:33
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.FileMaker = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  class FileMaker {
      constructor() {
          this.description = {
              displayName: 'FileMaker',
              name: 'filemaker',
              icon: 'file:filemaker.png',
              group: ['input'],
              version: 1,
              description: 'Retrieve data from the FileMaker data API',
              defaults: {
                  name: 'FileMaker',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'fileMaker',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Action',
                      name: 'action',
                      type: 'options',
                      default: 'record',
                      options: [
                          {
                              name: 'Create Record',
                              value: 'create',
                          },
                          {
                              name: 'Delete Record',
                              value: 'delete',
                          },
                          {
                              name: 'Duplicate Record',
                              value: 'duplicate',
                          },
                          {
                              name: 'Edit Record',
                              value: 'edit',
                          },
                          {
                              name: 'Find Records',
                              value: 'find',
                          },
                          {
                              name: 'Get Records',
                              value: 'records',
                          },
                          {
                              name: 'Get Records By ID',
                              value: 'record',
                          },
                          {
                              name: 'Perform Script',
                              value: 'performscript',
                          },
                      ],
                  },
                  {
                      displayName: 'Layout Name or ID',
                      name: 'layout',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getLayouts',
                      },
                      options: [],
                      default: '',
                      required: true,
                      displayOptions: {},
                      placeholder: 'Layout Name',
                      description: 'FileMaker Layout Name. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Record ID',
                      name: 'recid',
                      type: 'number',
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['record', 'edit', 'delete', 'duplicate'],
                          },
                      },
                      placeholder: 'Record ID',
                      description: 'Internal Record ID returned by get (recordid)',
                  },
                  {
                      displayName: 'Offset',
                      name: 'offset',
                      placeholder: '0',
                      description: 'The record number of the first record in the range of records',
                      type: 'number',
                      default: 1,
                      displayOptions: {
                          show: {
                              action: ['find', 'records'],
                          },
                      },
                  },
                  {
                      displayName: 'Limit',
                      name: 'limit',
                      placeholder: '100',
                      description: 'Max number of results to return',
                      type: 'number',
                      typeOptions: {
                          minValue: 1,
                      },
                      default: 100,
                      displayOptions: {
                          show: {
                              action: ['find', 'records'],
                          },
                      },
                  },
                  {
                      displayName: 'Get Portals',
                      name: 'getPortals',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to get portal data as well',
                      displayOptions: {
                          show: {
                              action: ['record', 'records', 'find'],
                          },
                      },
                  },
                  {
                      displayName: 'Portals Name or ID',
                      name: 'portals',
                      type: 'options',
                      typeOptions: {
                          multipleValues: true,
                          multipleValueButtonText: 'Add portal',
                          loadOptionsMethod: 'getPortals',
                      },
                      options: [],
                      default: [],
                      displayOptions: {
                          show: {
                              action: ['record', 'records', 'find'],
                              getPortals: [true],
                          },
                      },
                      placeholder: 'Portals',
                      description: 'The portal result set to return. Use the portal object name or portal table name. If this parameter is omitted, the API will return all portal objects and records in the layout. For best performance, pass the portal object name or portal table name. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Response Layout Name or ID',
                      name: 'responseLayout',
                      type: 'options',
                      description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
                      typeOptions: {
                          loadOptionsMethod: 'getResponseLayouts',
                      },
                      options: [],
                      default: '',
                      displayOptions: {
                          show: {
                              action: ['find'],
                          },
                      },
                  },
                  {
                      displayName: 'Queries',
                      name: 'queries',
                      placeholder: 'Add query',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              action: ['find'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              name: 'query',
                              displayName: 'Query',
                              values: [
                                  {
                                      displayName: 'Fields',
                                      name: 'fields',
                                      placeholder: 'Add field',
                                      type: 'fixedCollection',
                                      default: {},
                                      typeOptions: {
                                          multipleValues: true,
                                      },
                                      options: [
                                          {
                                              name: 'field',
                                              displayName: 'Field',
                                              values: [
                                                  {
                                                      displayName: 'Field Name or ID',
                                                      name: 'name',
                                                      type: 'options',
                                                      default: '',
                                                      typeOptions: {
                                                          loadOptionsMethod: 'getFields',
                                                      },
                                                      options: [],
                                                      description: 'Search Field. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                                  },
                                                  {
                                                      displayName: 'Value',
                                                      name: 'value',
                                                      type: 'string',
                                                      default: '',
                                                      description: 'Value to search',
                                                  },
                                              ],
                                          },
                                      ],
                                      description: 'Field Name',
                                  },
                                  {
                                      displayName: 'Omit',
                                      name: 'omit',
                                      type: 'boolean',
                                      default: false,
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Sort Data?',
                      name: 'setSort',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to sort data',
                      displayOptions: {
                          show: {
                              action: ['find', 'record', 'records'],
                          },
                      },
                  },
                  {
                      displayName: 'Sort',
                      name: 'sortParametersUi',
                      placeholder: 'Add Sort Rules',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              setSort: [true],
                              action: ['find', 'records'],
                          },
                      },
                      description: 'Sort rules',
                      default: {},
                      options: [
                          {
                              name: 'rules',
                              displayName: 'Rules',
                              values: [
                                  {
                                      displayName: 'Field Name or ID',
                                      name: 'name',
                                      type: 'options',
                                      default: '',
                                      typeOptions: {
                                          loadOptionsMethod: 'getFields',
                                      },
                                      options: [],
                                      description: 'Field Name. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                  },
                                  {
                                      displayName: 'Order',
                                      name: 'value',
                                      type: 'options',
                                      default: 'ascend',
                                      options: [
                                          {
                                              name: 'Ascend',
                                              value: 'ascend',
                                          },
                                          {
                                              name: 'Descend',
                                              value: 'descend',
                                          },
                                      ],
                                      description: 'Sort order',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Before Find Script',
                      name: 'setScriptBefore',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to define a script to be run before the action specified by the API call and after the subsequent sort',
                      displayOptions: {
                          show: {
                              action: ['find', 'record', 'records'],
                          },
                      },
                  },
                  {
                      displayName: 'Script Name or ID',
                      name: 'scriptBefore',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getScripts',
                      },
                      options: [],
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['find', 'record', 'records'],
                              setScriptBefore: [true],
                          },
                      },
                      placeholder: 'Script Name',
                      description: 'The name of the FileMaker script to be run after the action specified by the API call and after the subsequent sort. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Script Parameter',
                      name: 'scriptBeforeParam',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              action: ['find', 'record', 'records'],
                              setScriptBefore: [true],
                          },
                      },
                      placeholder: 'Script Parameters',
                      description: 'A parameter for the FileMaker script',
                  },
                  {
                      displayName: 'Before Sort Script',
                      name: 'setScriptSort',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to define a script to be run after the action specified by the API call but before the subsequent sort',
                      displayOptions: {
                          show: {
                              action: ['find', 'record', 'records'],
                          },
                      },
                  },
                  {
                      displayName: 'Script Name or ID',
                      name: 'scriptSort',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getScripts',
                      },
                      options: [],
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['find', 'record', 'records'],
                              setScriptSort: [true],
                          },
                      },
                      placeholder: 'Script Name',
                      description: 'The name of the FileMaker script to be run after the action specified by the API call but before the subsequent sort. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Script Parameter',
                      name: 'scriptSortParam',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              action: ['find', 'record', 'records'],
                              setScriptSort: [true],
                          },
                      },
                      placeholder: 'Script Parameters',
                      description: 'A parameter for the FileMaker script',
                  },
                  {
                      displayName: 'After Sort Script',
                      name: 'setScriptAfter',
                      type: 'boolean',
                      default: false,
                      description: 'Whether to define a script to be run after the action specified by the API call but before the subsequent sort',
                      displayOptions: {
                          show: {
                              action: ['find', 'record', 'records'],
                          },
                      },
                  },
                  {
                      displayName: 'Script Name or ID',
                      name: 'scriptAfter',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getScripts',
                      },
                      options: [],
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['find', 'record', 'records'],
                              setScriptAfter: [true],
                          },
                      },
                      placeholder: 'Script Name',
                      description: 'The name of the FileMaker script to be run after the action specified by the API call and after the subsequent sort. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Script Parameter',
                      name: 'scriptAfterParam',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              action: ['find', 'record', 'records'],
                              setScriptAfter: [true],
                          },
                      },
                      placeholder: 'Script Parameters',
                      description: 'A parameter for the FileMaker script',
                  },
                  {
                      displayName: 'Mod ID',
                      name: 'modId',
                      description: 'The last modification ID. When you use modId, a record is edited only when the modId matches.',
                      type: 'number',
                      default: '',
                      displayOptions: {
                          show: {
                              action: ['edit'],
                          },
                      },
                  },
                  {
                      displayName: 'Fields',
                      name: 'fieldsParametersUi',
                      placeholder: 'Add field',
                      type: 'fixedCollection',
                      typeOptions: {
                          multipleValues: true,
                      },
                      displayOptions: {
                          show: {
                              action: ['create', 'edit'],
                          },
                      },
                      description: 'Fields to define',
                      default: {},
                      options: [
                          {
                              name: 'fields',
                              displayName: 'Fields',
                              values: [
                                  {
                                      displayName: 'Field Name or ID',
                                      name: 'name',
                                      type: 'options',
                                      default: '',
                                      typeOptions: {
                                          loadOptionsMethod: 'getFields',
                                      },
                                      options: [],
                                      description: 'Field Name. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                                  },
                                  {
                                      displayName: 'Value',
                                      name: 'value',
                                      type: 'string',
                                      default: '',
                                  },
                              ],
                          },
                      ],
                  },
                  {
                      displayName: 'Script Name or ID',
                      name: 'script',
                      type: 'options',
                      typeOptions: {
                          loadOptionsMethod: 'getScripts',
                      },
                      options: [],
                      default: '',
                      required: true,
                      displayOptions: {
                          show: {
                              action: ['performscript'],
                          },
                      },
                      placeholder: 'Script Name',
                      description: 'The name of the FileMaker script to be run. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
                  },
                  {
                      displayName: 'Script Parameter',
                      name: 'scriptParam',
                      type: 'string',
                      default: '',
                      displayOptions: {
                          show: {
                              action: ['performscript'],
                          },
                      },
                      placeholder: 'Script Parameters',
                      description: 'A parameter for the FileMaker script',
                  },
              ],
          };
          this.methods = {
              loadOptions: {
                  async getLayouts() {
                      let returnData;
                      try {
                          returnData = await GenericFunctions_1.layoutsApiRequest.call(this);
                      }
                      catch (error) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
                      }
                      return returnData;
                  },
                  async getResponseLayouts() {
                      const returnData = [];
                      returnData.push({
                          name: 'Use main layout',
                          value: '',
                      });
                      let layouts;
                      try {
                          layouts = await GenericFunctions_1.layoutsApiRequest.call(this);
                      }
                      catch (error) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
                      }
                      for (const layout of layouts) {
                          returnData.push({
                              name: layout.name,
                              value: layout.name,
                          });
                      }
                      return returnData;
                  },
                  async getFields() {
                      const returnData = [];
                      let fields;
                      try {
                          fields = await GenericFunctions_1.getFields.call(this);
                      }
                      catch (error) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
                      }
                      for (const field of fields) {
                          returnData.push({
                              name: field.name,
                              value: field.name,
                          });
                      }
                      return returnData;
                  },
                  async getScripts() {
                      const returnData = [];
                      let scripts;
                      try {
                          scripts = await GenericFunctions_1.getScripts.call(this);
                      }
                      catch (error) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
                      }
                      for (const script of scripts) {
                          if (!script.isFolder) {
                              returnData.push({
                                  name: script.name,
                                  value: script.name,
                              });
                          }
                      }
                      return returnData;
                  },
                  async getPortals() {
                      const returnData = [];
                      let portals;
                      try {
                          portals = await GenericFunctions_1.getPortals.call(this);
                      }
                      catch (error) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
                      }
                      Object.keys(portals).forEach((portal) => {
                          returnData.push({
                              name: portal,
                              value: portal,
                          });
                      });
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const credentials = await this.getCredentials('fileMaker');
          let token;
          try {
              token = await GenericFunctions_1.getToken.call(this);
          }
          catch (error) {
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
          }
          let requestOptions;
          const host = credentials.host;
          const database = credentials.db;
          const url = `https://${host}/fmi/data/v1`;
          const action = this.getNodeParameter('action', 0);
          try {
              for (let i = 0; i < items.length; i++) {
                  requestOptions = {
                      uri: '',
                      headers: {
                          Authorization: `Bearer ${token}`,
                      },
                      method: 'GET',
                      json: true,
                  };
                  const layout = this.getNodeParameter('layout', i);
                  if (action === 'record') {
                      const recid = this.getNodeParameter('recid', i);
                      requestOptions.uri = url + `/databases/${database}/layouts/${layout}/records/${recid}`;
                      requestOptions.qs = {
                          portal: JSON.stringify(GenericFunctions_1.parsePortals.call(this, i)),
                          ...GenericFunctions_1.parseScripts.call(this, i),
                      };
                  }
                  else if (action === 'records') {
                      requestOptions.uri = url + `/databases/${database}/layouts/${layout}/records`;
                      requestOptions.qs = {
                          _offset: this.getNodeParameter('offset', i),
                          _limit: this.getNodeParameter('limit', i),
                          portal: JSON.stringify(GenericFunctions_1.parsePortals.call(this, i)),
                          ...GenericFunctions_1.parseScripts.call(this, i),
                      };
                      const sort = GenericFunctions_1.parseSort.call(this, i);
                      if (sort) {
                          requestOptions.body.sort = sort;
                      }
                  }
                  else if (action === 'find') {
                      requestOptions.uri = url + `/databases/${database}/layouts/${layout}/_find`;
                      requestOptions.method = 'POST';
                      requestOptions.body = {
                          query: GenericFunctions_1.parseQuery.call(this, i),
                          offset: this.getNodeParameter('offset', i),
                          limit: this.getNodeParameter('limit', i),
                          'layout.response': this.getNodeParameter('responseLayout', i),
                          ...GenericFunctions_1.parseScripts.call(this, i),
                      };
                      const sort = GenericFunctions_1.parseSort.call(this, i);
                      if (sort) {
                          requestOptions.body.sort = sort;
                      }
                  }
                  else if (action === 'create') {
                      requestOptions.uri = url + `/databases/${database}/layouts/${layout}/records`;
                      requestOptions.method = 'POST';
                      requestOptions.headers['Content-Type'] = 'application/json';
                      requestOptions.body = {
                          fieldData: { ...GenericFunctions_1.parseFields.call(this, i) },
                          portalData: {},
                          ...GenericFunctions_1.parseScripts.call(this, i),
                      };
                  }
                  else if (action === 'edit') {
                      const recid = this.getNodeParameter('recid', i);
                      requestOptions.uri = url + `/databases/${database}/layouts/${layout}/records/${recid}`;
                      requestOptions.method = 'PATCH';
                      requestOptions.headers['Content-Type'] = 'application/json';
                      requestOptions.body = {
                          fieldData: { ...GenericFunctions_1.parseFields.call(this, i) },
                          portalData: {},
                          ...GenericFunctions_1.parseScripts.call(this, i),
                      };
                  }
                  else if (action === 'performscript') {
                      const scriptName = this.getNodeParameter('script', i);
                      requestOptions.uri =
                          url + `/databases/${database}/layouts/${layout}/script/${scriptName}`;
                      requestOptions.qs = {
                          'script.param': this.getNodeParameter('scriptParam', i),
                      };
                  }
                  else if (action === 'duplicate') {
                      const recid = this.getNodeParameter('recid', i);
                      requestOptions.uri = url + `/databases/${database}/layouts/${layout}/records/${recid}`;
                      requestOptions.method = 'POST';
                      requestOptions.headers['Content-Type'] = 'application/json';
                      requestOptions.qs = {
                          ...GenericFunctions_1.parseScripts.call(this, i),
                      };
                  }
                  else if (action === 'delete') {
                      const recid = this.getNodeParameter('recid', i);
                      requestOptions.uri = url + `/databases/${database}/layouts/${layout}/records/${recid}`;
                      requestOptions.method = 'DELETE';
                      requestOptions.qs = {
                          ...GenericFunctions_1.parseScripts.call(this, i),
                      };
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The action "${action}" is not implemented yet!`, { itemIndex: i });
                  }
                  let response;
                  try {
                      response = await this.helpers.request(requestOptions);
                  }
                  catch (error) {
                      response = error.error;
                  }
                  if (typeof response === 'string') {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'DataAPI response body is not valid JSON. Is the DataAPI enabled?', { itemIndex: i });
                  }
                  returnData.push({ json: response });
              }
          }
          catch (error) {
              if (error.node) {
                  throw error;
              }
              throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The action "${error.message}" is not implemented yet!`);
          }
          await GenericFunctions_1.logout.call(this, token);
          return [returnData];
      }
  }
  exports.FileMaker = FileMaker;
  //# sourceMappingURL=FileMaker.node.js.map

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


