# nodes

node_type: n8n-nodes-base.Bitly
name: Bitly
package_name: n8n-nodes-base
display_name: Bitly
description: Consume Bitly API
code_hash: a012d39ba8285831be8baa99132776572dc3645db429a731b51ee41fdceea1ed
source_location: node_modules/n8n-nodes-base/dist/nodes/Bitly/Bitly.node.js
extracted_at: 2025-06-07 19:36:28
updated_at: 2025-06-07 19:36:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Bitly = void 0;
  const LinkDescription_1 = require("./LinkDescription");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Bitly {
      constructor() {
          this.description = {
              displayName: 'Bitly',
              name: 'bitly',
              icon: 'file:bitly.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Bitly API',
              defaults: {
                  name: 'Bitly',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'bitlyApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'bitlyOAuth2Api',
                      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: 'Link',
                              value: 'link',
                          },
                      ],
                      default: 'link',
                  },
                  ...LinkDescription_1.linkOperations,
                  ...LinkDescription_1.linkFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getGroups() {
                      const returnData = [];
                      const groups = await GenericFunctions_1.bitlyApiRequestAllItems.call(this, 'groups', 'GET', '/groups');
                      for (const group of groups) {
                          const groupName = group.name;
                          const groupId = group.guid;
                          returnData.push({
                              name: groupName,
                              value: groupId,
                          });
                      }
                      return returnData;
                  },
                  async getTags() {
                      const groupId = this.getCurrentNodeParameter('group');
                      const returnData = [];
                      const tags = await GenericFunctions_1.bitlyApiRequestAllItems.call(this, 'tags', 'GET', `groups/${groupId}/tags`);
                      for (const tag of tags) {
                          const tagName = tag;
                          const tagId = tag;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'link') {
                      if (operation === 'create') {
                          const longUrl = this.getNodeParameter('longUrl', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              long_url: longUrl,
                          };
                          if (additionalFields.title) {
                              body.title = additionalFields.title;
                          }
                          if (additionalFields.domain) {
                              body.domain = additionalFields.domain;
                          }
                          if (additionalFields.group) {
                              body.group = additionalFields.group;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          const deeplinks = this.getNodeParameter('deeplink', i)
                              .deeplinkUi;
                          if (deeplinks) {
                              for (const deeplink of deeplinks) {
                                  body.deeplinks.push({
                                      app_uri_path: deeplink.appUriPath,
                                      install_type: deeplink.installType,
                                      install_url: deeplink.installUrl,
                                      app_id: deeplink.appId,
                                  });
                              }
                          }
                          responseData = await GenericFunctions_1.bitlyApiRequest.call(this, 'POST', '/bitlinks', body);
                      }
                      if (operation === 'update') {
                          const linkId = this.getNodeParameter('id', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.longUrl) {
                              body.long_url = updateFields.longUrl;
                          }
                          if (updateFields.title) {
                              body.title = updateFields.title;
                          }
                          if (updateFields.archived !== undefined) {
                              body.archived = updateFields.archived;
                          }
                          if (updateFields.group) {
                              body.group = updateFields.group;
                          }
                          if (updateFields.tags) {
                              body.tags = updateFields.tags;
                          }
                          const deeplinks = this.getNodeParameter('deeplink', i)
                              .deeplinkUi;
                          if (deeplinks) {
                              for (const deeplink of deeplinks) {
                                  body.deeplinks.push({
                                      app_uri_path: deeplink.appUriPath,
                                      install_type: deeplink.installType,
                                      install_url: deeplink.installUrl,
                                      app_id: deeplink.appId,
                                  });
                              }
                          }
                          responseData = await GenericFunctions_1.bitlyApiRequest.call(this, 'PATCH', `/bitlinks/${linkId}`, body);
                      }
                      if (operation === 'get') {
                          const linkId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.bitlyApiRequest.call(this, 'GET', `/bitlinks/${linkId}`);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message, json: {}, itemIndex: i });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Bitly = Bitly;
  //# sourceMappingURL=Bitly.node.js.map

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


node_type: n8n-nodes-base.Bitwarden
name: Bitwarden
package_name: n8n-nodes-base
display_name: Bitwarden
description: Consume the Bitwarden API
code_hash: 20bdb447182caf7742ac1e31d75b73fd993e9add607facca5fb2273d51707339
source_location: node_modules/n8n-nodes-base/dist/nodes/Bitwarden/Bitwarden.node.js
extracted_at: 2025-06-07 19:36:28
updated_at: 2025-06-07 19:36:28
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.Bitwarden = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const CollectionDescription_1 = require("./descriptions/CollectionDescription");
  const EventDescription_1 = require("./descriptions/EventDescription");
  const GroupDescription_1 = require("./descriptions/GroupDescription");
  const MemberDescription_1 = require("./descriptions/MemberDescription");
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
  const partialRight_1 = __importDefault(require("lodash/partialRight"));
  class Bitwarden {
      constructor() {
          this.description = {
              displayName: 'Bitwarden',
              name: 'bitwarden',
              icon: 'file:bitwarden.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Bitwarden API',
              defaults: {
                  name: 'Bitwarden',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'bitwardenApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Collection',
                              value: 'collection',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                          },
                          {
                              name: 'Group',
                              value: 'group',
                          },
                          {
                              name: 'Member',
                              value: 'member',
                          },
                      ],
                      default: 'collection',
                  },
                  ...CollectionDescription_1.collectionOperations,
                  ...CollectionDescription_1.collectionFields,
                  ...EventDescription_1.eventOperations,
                  ...EventDescription_1.eventFields,
                  ...GroupDescription_1.groupOperations,
                  ...GroupDescription_1.groupFields,
                  ...MemberDescription_1.memberOperations,
                  ...MemberDescription_1.memberFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getGroups() {
                      return GenericFunctions_1.loadResource.call(this, 'groups');
                  },
                  async getCollections() {
                      return GenericFunctions_1.loadResource.call(this, 'collections');
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          const token = await GenericFunctions_1.getAccessToken.call(this);
          const bitwardenApiRequest = (0, partialRight_1.default)(GenericFunctions_1.bitwardenApiRequest, token);
          const handleGetAll = (0, partialRight_1.default)(GenericFunctions_1.handleGetAll, token);
          for (let i = 0; i < items.length; i++) {
              if (resource === 'collection') {
                  if (operation === 'delete') {
                      const id = this.getNodeParameter('collectionId', i);
                      const endpoint = `/public/collections/${id}`;
                      responseData = await bitwardenApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'get') {
                      const id = this.getNodeParameter('collectionId', i);
                      const endpoint = `/public/collections/${id}`;
                      responseData = await bitwardenApiRequest.call(this, 'GET', endpoint, {}, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'getAll') {
                      const endpoint = '/public/collections';
                      responseData = await handleGetAll.call(this, i, 'GET', endpoint, {}, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'update') {
                      const updateFields = this.getNodeParameter('updateFields', i);
                      if ((0, isEmpty_1.default)(updateFields)) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                      }
                      const { groups, externalId } = updateFields;
                      const body = {};
                      if (groups) {
                          body.groups = groups.map((groupId) => ({
                              id: groupId,
                              ReadOnly: false,
                          }));
                      }
                      if (externalId) {
                          body.externalId = externalId;
                      }
                      const id = this.getNodeParameter('collectionId', i);
                      const endpoint = `/public/collections/${id}`;
                      responseData = await bitwardenApiRequest.call(this, 'PUT', endpoint, {}, body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              else if (resource === 'event') {
                  if (operation === 'getAll') {
                      const filters = this.getNodeParameter('filters', i);
                      const qs = (0, isEmpty_1.default)(filters) ? {} : filters;
                      const endpoint = '/public/events';
                      responseData = await handleGetAll.call(this, i, 'GET', endpoint, qs, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              else if (resource === 'group') {
                  if (operation === 'create') {
                      const body = {
                          name: this.getNodeParameter('name', i),
                          AccessAll: this.getNodeParameter('accessAll', i),
                      };
                      const { collections, externalId } = this.getNodeParameter('additionalFields', i);
                      if (collections) {
                          body.collections = collections.map((collectionId) => ({
                              id: collectionId,
                              ReadOnly: false,
                          }));
                      }
                      if (externalId) {
                          body.externalId = externalId;
                      }
                      const endpoint = '/public/groups';
                      responseData = await bitwardenApiRequest.call(this, 'POST', endpoint, {}, body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'delete') {
                      const id = this.getNodeParameter('groupId', i);
                      const endpoint = `/public/groups/${id}`;
                      responseData = await bitwardenApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'get') {
                      const id = this.getNodeParameter('groupId', i);
                      const endpoint = `/public/groups/${id}`;
                      responseData = await bitwardenApiRequest.call(this, 'GET', endpoint, {}, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'getAll') {
                      const endpoint = '/public/groups';
                      responseData = await handleGetAll.call(this, i, 'GET', endpoint, {}, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'getMembers') {
                      const id = this.getNodeParameter('groupId', i);
                      const endpoint = `/public/groups/${id}/member-ids`;
                      responseData = await bitwardenApiRequest.call(this, 'GET', endpoint, {}, {});
                      responseData = responseData.map((memberId) => ({ memberId }));
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'update') {
                      const groupId = this.getNodeParameter('groupId', i);
                      const updateFields = this.getNodeParameter('updateFields', i);
                      if ((0, isEmpty_1.default)(updateFields)) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                      }
                      let { name, accessAll } = updateFields;
                      if (name === undefined) {
                          responseData = (await bitwardenApiRequest.call(this, 'GET', `/public/groups/${groupId}`, {}, {}));
                          name = responseData.name;
                      }
                      if (accessAll === undefined) {
                          accessAll = false;
                      }
                      const body = {
                          name,
                          AccessAll: accessAll,
                      };
                      const { collections, externalId } = updateFields;
                      if (collections) {
                          body.collections = collections.map((collectionId) => ({
                              id: collectionId,
                              ReadOnly: false,
                          }));
                      }
                      if (externalId) {
                          body.externalId = externalId;
                      }
                      const endpoint = `/public/groups/${groupId}`;
                      responseData = await bitwardenApiRequest.call(this, 'PUT', endpoint, {}, body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'updateMembers') {
                      const memberIds = this.getNodeParameter('memberIds', i);
                      const body = {
                          memberIds: memberIds.includes(',') ? memberIds.split(',') : [memberIds],
                      };
                      const groupId = this.getNodeParameter('groupId', i);
                      const endpoint = `/public/groups/${groupId}/member-ids`;
                      responseData = await bitwardenApiRequest.call(this, 'PUT', endpoint, {}, body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
              else if (resource === 'member') {
                  if (operation === 'create') {
                      const body = {
                          email: this.getNodeParameter('email', i),
                          type: this.getNodeParameter('type', i),
                          AccessAll: this.getNodeParameter('accessAll', i),
                      };
                      const { collections, externalId } = this.getNodeParameter('additionalFields', i);
                      if (collections) {
                          body.collections = collections.map((collectionId) => ({
                              id: collectionId,
                              ReadOnly: false,
                          }));
                      }
                      if (externalId) {
                          body.externalId = externalId;
                      }
                      const endpoint = '/public/members/';
                      responseData = await bitwardenApiRequest.call(this, 'POST', endpoint, {}, body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'delete') {
                      const id = this.getNodeParameter('memberId', i);
                      const endpoint = `/public/members/${id}`;
                      responseData = await bitwardenApiRequest.call(this, 'DELETE', endpoint, {}, {});
                      responseData = { success: true };
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'get') {
                      const id = this.getNodeParameter('memberId', i);
                      const endpoint = `/public/members/${id}`;
                      responseData = await bitwardenApiRequest.call(this, 'GET', endpoint, {}, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'getAll') {
                      const endpoint = '/public/members';
                      responseData = await handleGetAll.call(this, i, 'GET', endpoint, {}, {});
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'getGroups') {
                      const id = this.getNodeParameter('memberId', i);
                      const endpoint = `/public/members/${id}/group-ids`;
                      responseData = await bitwardenApiRequest.call(this, 'GET', endpoint, {}, {});
                      responseData = responseData.map((groupId) => ({ groupId }));
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'update') {
                      const body = {};
                      const updateFields = this.getNodeParameter('updateFields', i);
                      if ((0, isEmpty_1.default)(updateFields)) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Please enter at least one field to update for the ${resource}.`, { itemIndex: i });
                      }
                      const { accessAll, collections, externalId, type } = updateFields;
                      if (accessAll !== undefined) {
                          body.AccessAll = accessAll;
                      }
                      if (collections) {
                          body.collections = collections.map((collectionId) => ({
                              id: collectionId,
                              ReadOnly: false,
                          }));
                      }
                      if (externalId) {
                          body.externalId = externalId;
                      }
                      if (type !== undefined) {
                          body.Type = type;
                      }
                      const id = this.getNodeParameter('memberId', i);
                      const endpoint = `/public/members/${id}`;
                      responseData = await bitwardenApiRequest.call(this, 'PUT', endpoint, {}, body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
                  else if (operation === 'updateGroups') {
                      const groupIds = this.getNodeParameter('groupIds', i);
                      const body = {
                          groupIds: groupIds.includes(',') ? groupIds.split(',') : [groupIds],
                      };
                      const memberId = this.getNodeParameter('memberId', i);
                      const endpoint = `/public/members/${memberId}/group-ids`;
                      responseData = await bitwardenApiRequest.call(this, 'PUT', endpoint, {}, body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } });
                      returnData.push(...executionData);
                  }
              }
          }
          return [returnData];
      }
  }
  exports.Bitwarden = Bitwarden;
  //# sourceMappingURL=Bitwarden.node.js.map

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


node_type: n8n-nodes-base.Box
name: Box
package_name: n8n-nodes-base
display_name: Box
description: Consume Box API
code_hash: adbb3d35327ec674e32fee22a6b0472a3aba104f8f8ea1cb269791562cce9f7f
source_location: node_modules/n8n-nodes-base/dist/nodes/Box/Box.node.js
extracted_at: 2025-06-07 19:36:28
updated_at: 2025-06-07 19:36:28
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.Box = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const FileDescription_1 = require("./FileDescription");
  const FolderDescription_1 = require("./FolderDescription");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  const change_case_1 = require("change-case");
  class Box {
      constructor() {
          this.description = {
              displayName: 'Box',
              name: 'box',
              icon: 'file:box.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Box API',
              defaults: {
                  name: 'Box',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'boxOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'File',
                              value: 'file',
                          },
                          {
                              name: 'Folder',
                              value: 'folder',
                          },
                      ],
                      default: 'file',
                  },
                  ...FileDescription_1.fileOperations,
                  ...FileDescription_1.fileFields,
                  ...FolderDescription_1.folderOperations,
                  ...FolderDescription_1.folderFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          const timezone = this.getTimezone();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'file') {
                      if (operation === 'copy') {
                          const fileId = this.getNodeParameter('fileId', i);
                          const parentId = this.getNodeParameter('parentId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {};
                          if (additionalFields.name) {
                              body.name = additionalFields.name;
                          }
                          if (parentId) {
                              body.parent = { id: parentId };
                          }
                          else {
                              body.parent = { id: 0 };
                          }
                          if (additionalFields.fields) {
                              qs.fields = additionalFields.fields;
                          }
                          if (additionalFields.version) {
                              body.version = additionalFields.version;
                          }
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'POST', `/files/${fileId}/copy`, body, qs);
                      }
                      if (operation === 'delete') {
                          const fileId = this.getNodeParameter('fileId', i);
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'DELETE', `/files/${fileId}`);
                          responseData = { success: true };
                      }
                      if (operation === 'download') {
                          const fileId = this.getNodeParameter('fileId', i);
                          const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i);
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'GET', `/files/${fileId}`);
                          const fileName = responseData.name;
                          let mimeType;
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'GET', `/files/${fileId}/content`, {}, {}, undefined, { encoding: null, resolveWithFullResponse: true });
                          const newItem = {
                              json: items[i].json,
                              binary: {},
                          };
                          if (mimeType === undefined && responseData.headers['content-type']) {
                              mimeType = responseData.headers['content-type'];
                          }
                          if (items[i].binary !== undefined) {
                              Object.assign(newItem.binary, items[i].binary);
                          }
                          items[i] = newItem;
                          const data = Buffer.from(responseData.body);
                          items[i].binary[dataPropertyNameDownload] = await this.helpers.prepareBinaryData(data, fileName, mimeType);
                      }
                      if (operation === 'get') {
                          const fileId = this.getNodeParameter('fileId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.fields) {
                              qs.fields = additionalFields.fields;
                          }
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'GET', `/files/${fileId}`, {}, qs);
                      }
                      if (operation === 'search') {
                          const query = this.getNodeParameter('query', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const tz = this.getTimezone();
                          qs.type = 'file';
                          qs.query = query;
                          Object.assign(qs, additionalFields);
                          if (qs.content_types) {
                              qs.content_types = qs.content_types.split(',');
                          }
                          if (additionalFields.createdRangeUi) {
                              const createdRangeValues = additionalFields.createdRangeUi
                                  .createdRangeValuesUi;
                              if (createdRangeValues) {
                                  const from = moment_timezone_1.default.tz(createdRangeValues.from, tz).format();
                                  const to = moment_timezone_1.default.tz(createdRangeValues.to, tz).format();
                                  qs.created_at_range = `${from},${to}`;
                              }
                              delete qs.createdRangeUi;
                          }
                          if (additionalFields.updatedRangeUi) {
                              const updateRangeValues = additionalFields.updatedRangeUi
                                  .updatedRangeValuesUi;
                              if (updateRangeValues) {
                                  qs.updated_at_range = `${moment_timezone_1.default.tz(updateRangeValues.from, tz).format()},${moment_timezone_1.default
                                      .tz(updateRangeValues.to, tz)
                                      .format()}`;
                              }
                              delete qs.updatedRangeUi;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.boxApiRequestAllItems.call(this, 'entries', 'GET', '/search', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.boxApiRequest.call(this, 'GET', '/search', {}, qs);
                              responseData = responseData.entries;
                          }
                      }
                      if (operation === 'share') {
                          const fileId = this.getNodeParameter('fileId', i);
                          const role = this.getNodeParameter('role', i);
                          const accessibleBy = this.getNodeParameter('accessibleBy', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {
                              accessible_by: {},
                              item: {
                                  id: fileId,
                                  type: 'file',
                              },
                              role: role === 'coOwner' ? 'co-owner' : (0, change_case_1.noCase)(role),
                              ...options,
                          };
                          if (body.fields) {
                              qs.fields = body.fields;
                              delete body.fields;
                          }
                          if (body.expires_at) {
                              body.expires_at = moment_timezone_1.default.tz(body.expires_at, timezone).format();
                          }
                          if (body.notify) {
                              qs.notify = body.notify;
                              delete body.notify;
                          }
                          if (accessibleBy === 'user') {
                              const useEmail = this.getNodeParameter('useEmail', i);
                              if (useEmail) {
                                  body.accessible_by.login = this.getNodeParameter('email', i);
                              }
                              else {
                                  body.accessible_by.id = this.getNodeParameter('userId', i);
                              }
                          }
                          else {
                              body.accessible_by.id = this.getNodeParameter('groupId', i);
                          }
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'POST', '/collaborations', body, qs);
                      }
                      if (operation === 'upload') {
                          const parentId = this.getNodeParameter('parentId', i);
                          const isBinaryData = this.getNodeParameter('binaryData', i);
                          const fileName = this.getNodeParameter('fileName', i);
                          const attributes = {};
                          if (parentId !== '') {
                              attributes.parent = { id: parentId };
                          }
                          else {
                              attributes.parent = { id: 0 };
                          }
                          if (isBinaryData) {
                              const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
                              const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
                              const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
                              const body = {};
                              attributes.name = fileName || binaryData.fileName;
                              body.attributes = JSON.stringify(attributes);
                              body.file = {
                                  value: binaryDataBuffer,
                                  options: {
                                      filename: binaryData.fileName,
                                      contentType: binaryData.mimeType,
                                  },
                              };
                              responseData = await GenericFunctions_1.boxApiRequest.call(this, 'POST', '', {}, {}, 'https://upload.box.com/api/2.0/files/content', { formData: body });
                              responseData = responseData.entries;
                          }
                          else {
                              const content = this.getNodeParameter('fileContent', i);
                              if (fileName === '') {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'File name must be set!', {
                                      itemIndex: i,
                                  });
                              }
                              attributes.name = fileName;
                              const body = {};
                              body.attributes = JSON.stringify(attributes);
                              body.file = {
                                  value: Buffer.from(content),
                                  options: {
                                      filename: fileName,
                                      contentType: 'text/plain',
                                  },
                              };
                              responseData = await GenericFunctions_1.boxApiRequest.call(this, 'POST', '', {}, {}, 'https://upload.box.com/api/2.0/files/content', { formData: body });
                              responseData = responseData.entries;
                          }
                      }
                  }
                  if (resource === 'folder') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const parentId = this.getNodeParameter('parentId', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {
                              name,
                          };
                          if (parentId) {
                              body.parent = { id: parentId };
                          }
                          else {
                              body.parent = { id: 0 };
                          }
                          if (options.access) {
                              body.folder_upload_email = {
                                  access: options.access,
                              };
                          }
                          if (options.fields) {
                              qs.fields = options.fields;
                          }
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'POST', '/folders', body, qs);
                      }
                      if (operation === 'delete') {
                          const folderId = this.getNodeParameter('folderId', i);
                          const recursive = this.getNodeParameter('recursive', i);
                          qs.recursive = recursive;
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'DELETE', `/folders/${folderId}`, qs);
                          responseData = { success: true };
                      }
                      if (operation === 'get') {
                          const folderId = this.getNodeParameter('folderId', i);
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'GET', `/folders/${folderId}`, qs);
                      }
                      if (operation === 'search') {
                          const query = this.getNodeParameter('query', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const tz = this.getTimezone();
                          qs.type = 'folder';
                          qs.query = query;
                          Object.assign(qs, additionalFields);
                          if (qs.content_types) {
                              qs.content_types = qs.content_types.split(',');
                          }
                          if (additionalFields.createdRangeUi) {
                              const createdRangeValues = additionalFields.createdRangeUi
                                  .createdRangeValuesUi;
                              if (createdRangeValues) {
                                  qs.created_at_range = `${moment_timezone_1.default.tz(createdRangeValues.from, tz).format()},${moment_timezone_1.default
                                      .tz(createdRangeValues.to, tz)
                                      .format()}`;
                              }
                              delete qs.createdRangeUi;
                          }
                          if (additionalFields.updatedRangeUi) {
                              const updateRangeValues = additionalFields.updatedRangeUi
                                  .updatedRangeValuesUi;
                              if (updateRangeValues) {
                                  qs.updated_at_range = `${moment_timezone_1.default.tz(updateRangeValues.from, tz).format()},${moment_timezone_1.default
                                      .tz(updateRangeValues.to, tz)
                                      .format()}`;
                              }
                              delete qs.updatedRangeUi;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.boxApiRequestAllItems.call(this, 'entries', 'GET', '/search', {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.boxApiRequest.call(this, 'GET', '/search', {}, qs);
                              responseData = responseData.entries;
                          }
                      }
                      if (operation === 'share') {
                          const folderId = this.getNodeParameter('folderId', i);
                          const role = this.getNodeParameter('role', i);
                          const accessibleBy = this.getNodeParameter('accessibleBy', i);
                          const options = this.getNodeParameter('options', i);
                          const body = {
                              accessible_by: {},
                              item: {
                                  id: folderId,
                                  type: 'folder',
                              },
                              role: role === 'coOwner' ? 'co-owner' : (0, change_case_1.noCase)(role),
                              ...options,
                          };
                          if (body.fields) {
                              qs.fields = body.fields;
                              delete body.fields;
                          }
                          if (body.expires_at) {
                              body.expires_at = moment_timezone_1.default.tz(body.expires_at, timezone).format();
                          }
                          if (body.notify) {
                              qs.notify = body.notify;
                              delete body.notify;
                          }
                          if (accessibleBy === 'user') {
                              const useEmail = this.getNodeParameter('useEmail', i);
                              if (useEmail) {
                                  body.accessible_by.login = this.getNodeParameter('email', i);
                              }
                              else {
                                  body.accessible_by.id = this.getNodeParameter('userId', i);
                              }
                          }
                          else {
                              body.accessible_by.id = this.getNodeParameter('groupId', i);
                          }
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'POST', '/collaborations', body, qs);
                      }
                      if (operation === 'update') {
                          const folderId = this.getNodeParameter('folderId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (updateFields.fields) {
                              qs.fields = updateFields.fields;
                              delete updateFields.fields;
                          }
                          const body = {
                              ...updateFields,
                          };
                          if (body.parentId) {
                              body.parent = {
                                  id: body.parentId,
                              };
                              delete body.parentId;
                          }
                          if (body.tags) {
                              body.tags = body.tags.split(',');
                          }
                          responseData = await GenericFunctions_1.boxApiRequest.call(this, 'PUT', `/folders/${folderId}`, body, qs);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          if (resource === 'file' && operation === 'download') {
              return [items];
          }
          else {
              return [returnData];
          }
      }
  }
  exports.Box = Box;
  //# sourceMappingURL=Box.node.js.map

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


node_type: n8n-nodes-base.Brandfetch
name: Brandfetch
package_name: n8n-nodes-base
display_name: Brandfetch
description: Consume Brandfetch API
code_hash: 37953ddb0d892d663b7a8e1111feeb644f02c854a5c9bccf11b590e68ff5d7e1
source_location: node_modules/n8n-nodes-base/dist/nodes/Brandfetch/Brandfetch.node.js
extracted_at: 2025-06-07 19:36:28
updated_at: 2025-06-07 19:36:28
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Brandfetch = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Brandfetch {
      constructor() {
          this.description = {
              displayName: 'Brandfetch',
              name: 'Brandfetch',
              icon: 'file:brandfetch.png',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"]}}',
              description: 'Consume Brandfetch API',
              defaults: {
                  name: 'Brandfetch',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'brandfetchApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Color',
                              value: 'color',
                              description: "Return a company's colors",
                              action: "Return a company's colors",
                          },
                          {
                              name: 'Company',
                              value: 'company',
                              description: "Return a company's data",
                              action: "Return a company's data",
                          },
                          {
                              name: 'Font',
                              value: 'font',
                              description: "Return a company's fonts",
                              action: "Return a company's fonts",
                          },
                          {
                              name: 'Industry',
                              value: 'industry',
                              description: "Return a company's industry",
                              action: "Return a company's industry",
                          },
                          {
                              name: 'Logo',
                              value: 'logo',
                              description: "Return a company's logo & icon",
                              action: "Return a company's logo & icon",
                          },
                      ],
                      default: 'logo',
                  },
                  {
                      displayName: 'Domain',
                      name: 'domain',
                      type: 'string',
                      default: '',
                      description: 'The domain name of the company',
                      required: true,
                  },
                  {
                      displayName: 'Download',
                      name: 'download',
                      type: 'boolean',
                      default: false,
                      required: true,
                      displayOptions: {
                          show: {
                              operation: ['logo'],
                          },
                      },
                      description: 'Name of the binary property to which to write the data of the read file',
                  },
                  {
                      displayName: 'Image Type',
                      name: 'imageTypes',
                      type: 'multiOptions',
                      displayOptions: {
                          show: {
                              operation: ['logo'],
                              download: [true],
                          },
                      },
                      options: [
                          {
                              name: 'Icon',
                              value: 'icon',
                          },
                          {
                              name: 'Logo',
                              value: 'logo',
                          },
                      ],
                      default: ['logo', 'icon'],
                      required: true,
                  },
                  {
                      displayName: 'Image Format',
                      name: 'imageFormats',
                      type: 'multiOptions',
                      displayOptions: {
                          show: {
                              operation: ['logo'],
                              download: [true],
                          },
                      },
                      options: [
                          {
                              name: 'PNG',
                              value: 'png',
                          },
                          {
                              name: 'SVG',
                              value: 'svg',
                          },
                      ],
                      default: ['png'],
                      description: 'The image format in which the logo should be returned as',
                      required: true,
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const length = items.length;
          const operation = this.getNodeParameter('operation', 0);
          const responseData = [];
          for (let i = 0; i < length; i++) {
              try {
                  if (operation === 'logo') {
                      const domain = this.getNodeParameter('domain', i);
                      const download = this.getNodeParameter('download', i);
                      const body = {
                          domain,
                      };
                      const response = await GenericFunctions_1.brandfetchApiRequest.call(this, 'POST', '/logo', body);
                      if (download) {
                          const imageTypes = this.getNodeParameter('imageTypes', i);
                          const imageFormats = this.getNodeParameter('imageFormats', i);
                          const newItem = {
                              json: {},
                              binary: {},
                          };
                          if (items[i].binary !== undefined) {
                              Object.assign(newItem.binary, items[i].binary);
                          }
                          newItem.json = response.response;
                          for (const imageType of imageTypes) {
                              for (const imageFormat of imageFormats) {
                                  const url = response.response[imageType][imageFormat === 'png' ? 'image' : imageFormat];
                                  if (url !== null) {
                                      const data = await GenericFunctions_1.brandfetchApiRequest.call(this, 'GET', '', {}, {}, url, {
                                          json: false,
                                          encoding: null,
                                      });
                                      newItem.binary[`${imageType}_${imageFormat}`] =
                                          await this.helpers.prepareBinaryData(data, `${imageType}_${domain}.${imageFormat}`);
                                      items[i] = newItem;
                                  }
                                  items[i] = newItem;
                              }
                          }
                          if (Object.keys(items[i].binary).length === 0) {
                              delete items[i].binary;
                          }
                      }
                      else {
                          const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(response.response), { itemData: { item: i } });
                          responseData.push(...executionData);
                      }
                  }
                  if (operation === 'color') {
                      const domain = this.getNodeParameter('domain', i);
                      const body = {
                          domain,
                      };
                      const response = await GenericFunctions_1.brandfetchApiRequest.call(this, 'POST', '/color', body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(response), { itemData: { item: i } });
                      responseData.push(...executionData);
                  }
                  if (operation === 'font') {
                      const domain = this.getNodeParameter('domain', i);
                      const body = {
                          domain,
                      };
                      const response = await GenericFunctions_1.brandfetchApiRequest.call(this, 'POST', '/font', body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(response), { itemData: { item: i } });
                      responseData.push(...executionData);
                  }
                  if (operation === 'company') {
                      const domain = this.getNodeParameter('domain', i);
                      const body = {
                          domain,
                      };
                      const response = await GenericFunctions_1.brandfetchApiRequest.call(this, 'POST', '/company', body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(response), { itemData: { item: i } });
                      responseData.push(...executionData);
                  }
                  if (operation === 'industry') {
                      const domain = this.getNodeParameter('domain', i);
                      const body = {
                          domain,
                      };
                      const response = await GenericFunctions_1.brandfetchApiRequest.call(this, 'POST', '/industry', body);
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(response), { itemData: { item: i } });
                      responseData.push(...executionData);
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      responseData.push({ error: error.message, json: {}, itemIndex: i });
                      continue;
                  }
                  throw error;
              }
          }
          if (operation === 'logo' && this.getNodeParameter('download', 0)) {
              return [items];
          }
          else {
              return [responseData];
          }
      }
  }
  exports.Brandfetch = Brandfetch;
  //# sourceMappingURL=Brandfetch.node.js.map

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


