# nodes

node_type: n8n-nodes-base.UrlScanIo
name: UrlScanIo
package_name: n8n-nodes-base
display_name: urlscan.io
description: Provides various utilities for monitoring websites like health checks or screenshots
code_hash: 9d774c970553defa6ffa786a53b69a8392799fa2e1f24be57c6343bc85d66c0f
source_location: node_modules/n8n-nodes-base/dist/nodes/UrlScanIo/UrlScanIo.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.UrlScanIo = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  class UrlScanIo {
      constructor() {
          this.description = {
              displayName: 'urlscan.io',
              name: 'urlScanIo',
              icon: 'file:urlScanIo.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Provides various utilities for monitoring websites like health checks or screenshots',
              defaults: {
                  name: 'urlscan.io',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'urlScanIoApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'options',
                      options: [
                          {
                              name: 'Scan',
                              value: 'scan',
                          },
                      ],
                      default: 'scan',
                  },
                  ...descriptions_1.scanOperations,
                  ...descriptions_1.scanFields,
              ],
          };
      }
      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 === 'scan') {
                      if (operation === 'get') {
                          const scanId = this.getNodeParameter('scanId', i);
                          responseData = await GenericFunctions_1.urlScanIoApiRequest.call(this, 'GET', `/result/${scanId}`);
                      }
                      else if (operation === 'getAll') {
                          const filters = this.getNodeParameter('filters', i);
                          const qs = {};
                          if (filters === null || filters === void 0 ? void 0 : filters.query) {
                              qs.q = filters.query;
                          }
                          responseData = await GenericFunctions_1.handleListing.call(this, '/search', qs);
                          responseData = responseData.map(GenericFunctions_1.normalizeId);
                      }
                      else if (operation === 'perform') {
                          const { tags: rawTags, ...rest } = this.getNodeParameter('additionalFields', i);
                          const body = {
                              url: this.getNodeParameter('url', i),
                              ...rest,
                          };
                          if (rawTags) {
                              const tags = rawTags.split(',').map((tag) => tag.trim());
                              if (tags.length > 10) {
                                  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Please enter at most 10 tags', {
                                      itemIndex: i,
                                  });
                              }
                              body.tags = tags;
                          }
                          responseData = await GenericFunctions_1.urlScanIoApiRequest.call(this, 'POST', '/scan', body);
                          responseData = (0, GenericFunctions_1.normalizeId)(responseData);
                      }
                  }
                  Array.isArray(responseData)
                      ? returnData.push(...responseData)
                      : returnData.push(responseData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.UrlScanIo = UrlScanIo;
  //# sourceMappingURL=UrlScanIo.node.js.map

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


node_type: n8n-nodes-base.Vero
name: Vero
package_name: n8n-nodes-base
display_name: Vero
description: Consume Vero API
code_hash: 37d697c0a7127e11a8f6dd2ee542a7dfbbf0ba4c38649c1acd4b7496c07fbeef
source_location: node_modules/n8n-nodes-base/dist/nodes/Vero/Vero.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Vero = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const UserDescription_1 = require("./UserDescription");
  const EventDescripion_1 = require("./EventDescripion");
  class Vero {
      constructor() {
          this.description = {
              displayName: 'Vero',
              name: 'vero',
              icon: 'file:vero.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Vero API',
              defaults: {
                  name: 'Vero',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'veroApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'User',
                              value: 'user',
                              description: 'Create, update and manage the subscription status of your users',
                          },
                          {
                              name: 'Event',
                              value: 'event',
                              description: 'Track events based on actions your customers take in real time',
                          },
                      ],
                      default: 'user',
                  },
                  ...UserDescription_1.userOperations,
                  ...EventDescripion_1.eventOperations,
                  ...UserDescription_1.userFields,
                  ...EventDescripion_1.eventFields,
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          for (let i = 0; i < length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', 0);
                  const operation = this.getNodeParameter('operation', 0);
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const id = this.getNodeParameter('id', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          const body = {
                              id,
                          };
                          if (additionalFields.email) {
                              body.email = additionalFields.email;
                          }
                          if (!jsonActive) {
                              const dataAttributesValues = this.getNodeParameter('dataAttributesUi', i).dataAttributesValues;
                              if (dataAttributesValues) {
                                  const dataAttributes = {};
                                  for (let index = 0; index < dataAttributesValues.length; index++) {
                                      dataAttributes[dataAttributesValues[index].key] =
                                          dataAttributesValues[index].value;
                                      body.data = dataAttributes;
                                  }
                              }
                          }
                          else {
                              const dataAttributesJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('dataAttributesJson', i));
                              if (dataAttributesJson) {
                                  body.data = dataAttributesJson;
                              }
                          }
                          try {
                              responseData = await GenericFunctions_1.veroApiRequest.call(this, 'POST', '/users/track', body);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                      if (operation === 'alias') {
                          const id = this.getNodeParameter('id', i);
                          const newId = this.getNodeParameter('newId', i);
                          const body = {
                              id,
                              new_id: newId,
                          };
                          try {
                              responseData = await GenericFunctions_1.veroApiRequest.call(this, 'PUT', '/users/reidentify', body);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                      if (operation === 'unsubscribe' ||
                          operation === 'resubscribe' ||
                          operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          const body = {
                              id,
                          };
                          try {
                              responseData = await GenericFunctions_1.veroApiRequest.call(this, 'POST', `/users/${operation}`, body);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                      if (operation === 'addTags' || operation === 'removeTags') {
                          const id = this.getNodeParameter('id', i);
                          const tags = this.getNodeParameter('tags', i).split(',');
                          const body = {
                              id,
                          };
                          if (operation === 'addTags') {
                              body.add = JSON.stringify(tags);
                          }
                          if (operation === 'removeTags') {
                              body.remove = JSON.stringify(tags);
                          }
                          try {
                              responseData = await GenericFunctions_1.veroApiRequest.call(this, 'PUT', '/users/tags/edit', body);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                  }
                  if (resource === 'event') {
                      if (operation === 'track') {
                          const id = this.getNodeParameter('id', i);
                          const email = this.getNodeParameter('email', i);
                          const eventName = this.getNodeParameter('eventName', i);
                          const jsonActive = this.getNodeParameter('jsonParameters', i);
                          const body = {
                              identity: { id, email },
                              event_name: eventName,
                              email,
                          };
                          if (!jsonActive) {
                              const dataAttributesValues = this.getNodeParameter('dataAttributesUi', i).dataAttributesValues;
                              if (dataAttributesValues) {
                                  const dataAttributes = {};
                                  for (let index = 0; index < dataAttributesValues.length; index++) {
                                      dataAttributes[dataAttributesValues[index].key] =
                                          dataAttributesValues[index].value;
                                      body.data = JSON.stringify(dataAttributes);
                                  }
                              }
                              const extraAttributesValues = this.getNodeParameter('extraAttributesUi', i).extraAttributesValues;
                              if (extraAttributesValues) {
                                  const extraAttributes = {};
                                  for (let index = 0; index < extraAttributesValues.length; index++) {
                                      extraAttributes[extraAttributesValues[index].key] =
                                          extraAttributesValues[index].value;
                                      body.extras = JSON.stringify(extraAttributes);
                                  }
                              }
                          }
                          else {
                              const dataAttributesJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('dataAttributesJson', i));
                              if (dataAttributesJson) {
                                  body.data = JSON.stringify(dataAttributesJson);
                              }
                              const extraAttributesJson = (0, GenericFunctions_1.validateJSON)(this.getNodeParameter('extraAttributesJson', i));
                              if (extraAttributesJson) {
                                  body.extras = JSON.stringify(extraAttributesJson);
                              }
                          }
                          try {
                              responseData = await GenericFunctions_1.veroApiRequest.call(this, 'POST', '/events/track', body);
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                  }
                  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.Vero = Vero;
  //# sourceMappingURL=Vero.node.js.map

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


node_type: n8n-nodes-base.Vonage
name: Vonage
package_name: n8n-nodes-base
display_name: Vonage
description: Consume Vonage API
code_hash: e56e55473d1585492c17d8199060fe1141d9eb4abc7d0d136b4a41da521a523e
source_location: node_modules/n8n-nodes-base/dist/nodes/Vonage/Vonage.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Vonage = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  class Vonage {
      constructor() {
          this.description = {
              displayName: 'Vonage',
              name: 'vonage',
              icon: 'file:vonage.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Vonage API',
              defaults: {
                  name: 'Vonage',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'vonageApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'SMS',
                              value: 'sms',
                          },
                      ],
                      default: 'sms',
                  },
                  {
                      displayName: 'Operation',
                      name: 'operation',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Send',
                              value: 'send',
                              action: 'Send an SMS',
                          },
                      ],
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                          },
                      },
                      default: 'send',
                  },
                  {
                      displayName: 'From',
                      name: 'from',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                              operation: ['send'],
                          },
                      },
                      default: '',
                      description: 'The name or number the message should be sent from',
                  },
                  {
                      displayName: 'To',
                      name: 'to',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                              operation: ['send'],
                          },
                      },
                      default: '',
                      description: 'The number that the message should be sent to. Numbers are specified in E.164 format.',
                  },
                  {
                      displayName: 'Message',
                      name: 'message',
                      type: 'string',
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                              operation: ['send'],
                          },
                      },
                      default: '',
                      description: 'The body of the message being sent',
                  },
                  {
                      displayName: 'Additional Fields',
                      name: 'additionalFields',
                      type: 'collection',
                      placeholder: 'Add Field',
                      displayOptions: {
                          show: {
                              resource: ['sms'],
                              operation: ['send'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Account Ref',
                              name: 'account-ref',
                              type: 'string',
                              default: '',
                              description: 'An optional string used to identify separate accounts using the SMS endpoint for billing purposes. To use this feature, please email support@nexmo.com.',
                          },
                          {
                              displayName: 'Callback',
                              name: 'callback',
                              type: 'string',
                              default: '',
                              description: 'The webhook endpoint the delivery receipt for this sms is sent to. This parameter overrides the webhook endpoint you set in Dashboard.',
                          },
                          {
                              displayName: 'Client Ref',
                              name: 'client-ref',
                              type: 'string',
                              default: '',
                              description: 'You can optionally include your own reference of up to 40 characters',
                          },
                          {
                              displayName: 'Message Class',
                              name: 'message-class',
                              type: 'options',
                              options: [
                                  {
                                      name: '0',
                                      value: 0,
                                  },
                                  {
                                      name: '1',
                                      value: 1,
                                  },
                                  {
                                      name: '2',
                                      value: 2,
                                  },
                                  {
                                      name: '3',
                                      value: 3,
                                  },
                              ],
                              default: '',
                              description: 'The Data Coding Scheme value of the message',
                          },
                          {
                              displayName: 'Protocol ID',
                              name: 'protocol-id',
                              type: 'string',
                              default: '',
                              description: 'The value of the protocol identifier to use. Ensure that the value is aligned with udh.',
                          },
                          {
                              displayName: 'Status Report Req',
                              name: 'status-report-req',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to receive a Delivery Receipt',
                          },
                          {
                              displayName: 'TTL (in Minutes)',
                              name: 'ttl',
                              type: 'number',
                              default: 4320,
                              description: 'By default Nexmo attempt delivery for 72 hours',
                          },
                      ],
                  },
              ],
          };
      }
      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 === 'sms') {
                      if (operation === 'send') {
                          const from = this.getNodeParameter('from', i);
                          const to = this.getNodeParameter('to', i);
                          const type = this.getNodeParameter('type', i, 'text');
                          const body = {
                              from,
                              to,
                              type,
                          };
                          if (type === 'text' || type === 'unicode') {
                              const message = this.getNodeParameter('message', i);
                              body.text = message;
                          }
                          if (type === 'binary') {
                              const data = this.getNodeParameter('body', i);
                              const udh = this.getNodeParameter('udh', i);
                              body.udh = udh;
                              body.body = data;
                          }
                          if (type === 'wappush') {
                              const title = this.getNodeParameter('title', i);
                              const url = this.getNodeParameter('url', i);
                              const validity = this.getNodeParameter('validity', i);
                              body.title = title;
                              body.url = url;
                              body.validity = validity * 60000;
                          }
                          if (type === 'vcard') {
                              const vcard = this.getNodeParameter('vcard', i);
                              body.vcard = vcard;
                          }
                          if (type === 'vcal') {
                              const vcal = this.getNodeParameter('vcal', i);
                              body.vcal = vcal;
                          }
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                          if (body.ttl) {
                              body.ttl = body.ttl * 60000;
                          }
                          responseData = await GenericFunctions_1.vonageApiRequest.call(this, 'POST', '/sms/json', body);
                          responseData = responseData.messages;
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.message });
                      continue;
                  }
                  throw error;
              }
              if (Array.isArray(responseData)) {
                  returnData.push.apply(returnData, responseData);
              }
              else if (responseData !== undefined) {
                  returnData.push(responseData);
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Vonage = Vonage;
  //# sourceMappingURL=Vonage.node.js.map

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


node_type: n8n-nodes-base.Wait
name: Wait
package_name: n8n-nodes-base
display_name: Wait
description: Wait before continue with execution
code_hash: f333ea7964e6b65519eba2d7b53d16012d5933e9da8b9317eb76676b294e709a
source_location: node_modules/n8n-nodes-base/dist/nodes/Wait/Wait.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Wait = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const description_1 = require("../Webhook/description");
  const Webhook_node_1 = require("../Webhook/Webhook.node");
  const displayOnWebhook = {
      show: {
          resume: ['webhook'],
      },
  };
  class Wait extends Webhook_node_1.Webhook {
      constructor() {
          var _a, _b;
          super(...arguments);
          this.authPropertyName = 'incomingAuthentication';
          this.description = {
              displayName: 'Wait',
              name: 'wait',
              icon: 'fa:pause-circle',
              group: ['organization'],
              version: 1,
              description: 'Wait before continue with execution',
              defaults: {
                  name: 'Wait',
                  color: '#804050',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: (0, description_1.credentialsProperty)(this.authPropertyName),
              webhooks: [
                  {
                      ...description_1.defaultWebhookDescription,
                      responseData: '={{$parameter["responseData"]}}',
                      path: '={{$parameter["options"]["webhookSuffix"] || ""}}',
                      restartWebhook: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resume',
                      name: 'resume',
                      type: 'options',
                      options: [
                          {
                              name: 'After Time Interval',
                              value: 'timeInterval',
                              description: 'Waits for a certain amount of time',
                          },
                          {
                              name: 'At Specified Time',
                              value: 'specificTime',
                              description: 'Waits until a specific date and time to continue',
                          },
                          {
                              name: 'On Webhook Call',
                              value: 'webhook',
                              description: 'Waits for a webhook call before continuing',
                          },
                      ],
                      default: 'timeInterval',
                      description: 'Determines the waiting mode to use before the workflow continues',
                  },
                  {
                      ...(0, description_1.authenticationProperty)(this.authPropertyName),
                      description: 'If and how incoming resume-webhook-requests to $execution.resumeUrl should be authenticated for additional security',
                      displayOptions: displayOnWebhook,
                  },
                  {
                      displayName: 'Date and Time',
                      name: 'dateTime',
                      type: 'dateTime',
                      displayOptions: {
                          show: {
                              resume: ['specificTime'],
                          },
                      },
                      default: '',
                      description: 'The date and time to wait for before continuing',
                  },
                  {
                      displayName: 'Wait Amount',
                      name: 'amount',
                      type: 'number',
                      displayOptions: {
                          show: {
                              resume: ['timeInterval'],
                          },
                      },
                      typeOptions: {
                          minValue: 0,
                          numberPrecision: 2,
                      },
                      default: 1,
                      description: 'The time to wait',
                  },
                  {
                      displayName: 'Wait Unit',
                      name: 'unit',
                      type: 'options',
                      displayOptions: {
                          show: {
                              resume: ['timeInterval'],
                          },
                      },
                      options: [
                          {
                              name: 'Seconds',
                              value: 'seconds',
                          },
                          {
                              name: 'Minutes',
                              value: 'minutes',
                          },
                          {
                              name: 'Hours',
                              value: 'hours',
                          },
                          {
                              name: 'Days',
                              value: 'days',
                          },
                      ],
                      default: 'hours',
                      description: 'The time unit of the Wait Amount value',
                  },
                  {
                      displayName: 'The webhook URL will be generated at run time. It can be referenced with the <strong>$execution.resumeUrl</strong> variable. Send it somewhere before getting to this node. <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=n8n-nodes-base.wait" target="_blank">More info</a>',
                      name: 'webhookNotice',
                      type: 'notice',
                      displayOptions: displayOnWebhook,
                      default: '',
                  },
                  {
                      ...description_1.httpMethodsProperty,
                      displayOptions: displayOnWebhook,
                      description: 'The HTTP method of the Webhook call',
                  },
                  {
                      ...description_1.responseCodeProperty,
                      displayOptions: displayOnWebhook,
                  },
                  {
                      ...description_1.responseModeProperty,
                      displayOptions: displayOnWebhook,
                  },
                  {
                      ...description_1.responseDataProperty,
                      displayOptions: {
                          show: {
                              ...(_a = description_1.responseDataProperty.displayOptions) === null || _a === void 0 ? void 0 : _a.show,
                              ...displayOnWebhook.show,
                          },
                      },
                  },
                  {
                      ...description_1.responseBinaryPropertyNameProperty,
                      displayOptions: {
                          show: {
                              ...(_b = description_1.responseBinaryPropertyNameProperty.displayOptions) === null || _b === void 0 ? void 0 : _b.show,
                              ...displayOnWebhook.show,
                          },
                      },
                  },
                  {
                      displayName: 'Limit Wait Time',
                      name: 'limitWaitTime',
                      type: 'boolean',
                      default: false,
                      description: 'If no webhook call is received, the workflow will automatically resume execution after the specified limit type',
                      displayOptions: displayOnWebhook,
                  },
                  {
                      displayName: 'Limit Type',
                      name: 'limitType',
                      type: 'options',
                      default: 'afterTimeInterval',
                      description: 'Sets the condition for the execution to resume. Can be a specified date or after some time.',
                      displayOptions: {
                          show: {
                              limitWaitTime: [true],
                              ...displayOnWebhook.show,
                          },
                      },
                      options: [
                          {
                              name: 'After Time Interval',
                              description: 'Waits for a certain amount of time',
                              value: 'afterTimeInterval',
                          },
                          {
                              name: 'At Specified Time',
                              description: 'Waits until the set date and time to continue',
                              value: 'atSpecifiedTime',
                          },
                      ],
                  },
                  {
                      displayName: 'Amount',
                      name: 'resumeAmount',
                      type: 'number',
                      displayOptions: {
                          show: {
                              limitType: ['afterTimeInterval'],
                              limitWaitTime: [true],
                              ...displayOnWebhook.show,
                          },
                      },
                      typeOptions: {
                          minValue: 0,
                          numberPrecision: 2,
                      },
                      default: 1,
                      description: 'The time to wait',
                  },
                  {
                      displayName: 'Unit',
                      name: 'resumeUnit',
                      type: 'options',
                      displayOptions: {
                          show: {
                              limitType: ['afterTimeInterval'],
                              limitWaitTime: [true],
                              ...displayOnWebhook.show,
                          },
                      },
                      options: [
                          {
                              name: 'Seconds',
                              value: 'seconds',
                          },
                          {
                              name: 'Minutes',
                              value: 'minutes',
                          },
                          {
                              name: 'Hours',
                              value: 'hours',
                          },
                          {
                              name: 'Days',
                              value: 'days',
                          },
                      ],
                      default: 'hours',
                      description: 'Unit of the interval value',
                  },
                  {
                      displayName: 'Max Date and Time',
                      name: 'maxDateAndTime',
                      type: 'dateTime',
                      displayOptions: {
                          show: {
                              limitType: ['atSpecifiedTime'],
                              limitWaitTime: [true],
                              ...displayOnWebhook.show,
                          },
                      },
                      default: '',
                      description: 'Continue execution after the specified date and time',
                  },
                  {
                      ...description_1.optionsProperty,
                      displayOptions: displayOnWebhook,
                      options: [
                          ...description_1.optionsProperty.options,
                          {
                              displayName: 'Webhook Suffix',
                              name: 'webhookSuffix',
                              type: 'string',
                              default: '',
                              placeholder: 'webhook',
                              description: 'This suffix path will be appended to the restart URL. Helpful when using multiple wait nodes. Note: Does not support expressions.',
                          },
                      ],
                  },
              ],
          };
      }
      async execute(context) {
          const resume = context.getNodeParameter('resume', 0);
          if (resume === 'webhook') {
              return this.handleWebhookResume(context);
          }
          let waitTill;
          if (resume === 'timeInterval') {
              const unit = context.getNodeParameter('unit', 0);
              let waitAmount = context.getNodeParameter('amount', 0);
              if (unit === 'minutes') {
                  waitAmount *= 60;
              }
              if (unit === 'hours') {
                  waitAmount *= 60 * 60;
              }
              if (unit === 'days') {
                  waitAmount *= 60 * 60 * 24;
              }
              waitAmount *= 1000;
              waitTill = new Date(new Date().getTime() + waitAmount);
          }
          else {
              const dateTime = context.getNodeParameter('dateTime', 0);
              waitTill = new Date(dateTime);
          }
          const waitValue = Math.max(waitTill.getTime() - new Date().getTime(), 0);
          if (waitValue < 65000) {
              return new Promise((resolve, _reject) => {
                  setTimeout(() => {
                      resolve([context.getInputData()]);
                  }, waitValue);
              });
          }
          return this.putToWait(context, waitTill);
      }
      async handleWebhookResume(context) {
          let waitTill = new Date(n8n_workflow_1.WAIT_TIME_UNLIMITED);
          const limitWaitTime = context.getNodeParameter('limitWaitTime', 0);
          if (limitWaitTime === true) {
              const limitType = context.getNodeParameter('limitType', 0);
              if (limitType === 'afterTimeInterval') {
                  let waitAmount = context.getNodeParameter('resumeAmount', 0);
                  const resumeUnit = context.getNodeParameter('resumeUnit', 0);
                  if (resumeUnit === 'minutes') {
                      waitAmount *= 60;
                  }
                  if (resumeUnit === 'hours') {
                      waitAmount *= 60 * 60;
                  }
                  if (resumeUnit === 'days') {
                      waitAmount *= 60 * 60 * 24;
                  }
                  waitAmount *= 1000;
                  waitTill = new Date(new Date().getTime() + waitAmount);
              }
              else {
                  waitTill = new Date(context.getNodeParameter('maxDateAndTime', 0));
              }
          }
          return this.putToWait(context, waitTill);
      }
      async putToWait(context, waitTill) {
          await context.putExecutionToWait(waitTill);
          return [context.getInputData()];
      }
  }
  exports.Wait = Wait;
  //# sourceMappingURL=Wait.node.js.map

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


node_type: n8n-nodes-base.Webflow
name: Webflow
package_name: n8n-nodes-base
display_name: Webflow
description: Consume the Webflow API
code_hash: 6862aa4d34cdafe233189a97054c7356a36907c43238db2ef115afd5041849b0
source_location: node_modules/n8n-nodes-base/dist/nodes/Webflow/Webflow.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Webflow = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ItemDescription_1 = require("./ItemDescription");
  class Webflow {
      constructor() {
          this.description = {
              displayName: 'Webflow',
              name: 'webflow',
              icon: 'file:webflow.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Webflow API',
              defaults: {
                  name: 'Webflow',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'webflowApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'webflowOAuth2Api',
                      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: 'Item',
                              value: 'item',
                          },
                      ],
                      default: 'item',
                  },
                  ...ItemDescription_1.itemOperations,
                  ...ItemDescription_1.itemFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getSites() {
                      const returnData = [];
                      const sites = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', '/sites');
                      for (const site of sites) {
                          returnData.push({
                              name: site.name,
                              value: site._id,
                          });
                      }
                      return returnData;
                  },
                  async getCollections() {
                      const returnData = [];
                      const siteId = this.getCurrentNodeParameter('siteId');
                      const collections = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', `/sites/${siteId}/collections`);
                      for (const collection of collections) {
                          returnData.push({
                              name: collection.name,
                              value: collection._id,
                          });
                      }
                      return returnData;
                  },
                  async getFields() {
                      const returnData = [];
                      const collectionId = this.getCurrentNodeParameter('collectionId');
                      const { fields } = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', `/collections/${collectionId}`);
                      for (const field of fields) {
                          returnData.push({
                              name: `${field.name} (${field.type}) ${field.required ? ' (required)' : ''}`,
                              value: field.slug,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'item') {
                      if (operation === 'create') {
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const properties = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          const live = this.getNodeParameter('live', i);
                          const fields = {};
                          properties.forEach((data) => (fields[data.fieldId] = data.fieldValue));
                          const body = {
                              fields,
                          };
                          responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'POST', `/collections/${collectionId}/items`, body, { live });
                      }
                      else if (operation === 'delete') {
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const itemId = this.getNodeParameter('itemId', i);
                          responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'DELETE', `/collections/${collectionId}/items/${itemId}`);
                      }
                      else if (operation === 'get') {
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const itemId = this.getNodeParameter('itemId', i);
                          responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', `/collections/${collectionId}/items/${itemId}`);
                          responseData = responseData.items;
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', 0);
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const qs = {};
                          if (returnAll) {
                              responseData = await GenericFunctions_1.webflowApiRequestAllItems.call(this, 'GET', `/collections/${collectionId}/items`, {}, qs);
                          }
                          else {
                              qs.limit = this.getNodeParameter('limit', 0);
                              responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', `/collections/${collectionId}/items`, {}, qs);
                              responseData = responseData.items;
                          }
                      }
                      else if (operation === 'update') {
                          const collectionId = this.getNodeParameter('collectionId', i);
                          const itemId = this.getNodeParameter('itemId', i);
                          const properties = this.getNodeParameter('fieldsUi.fieldValues', i, []);
                          const live = this.getNodeParameter('live', i);
                          const fields = {};
                          properties.forEach((data) => (fields[data.fieldId] = data.fieldValue));
                          const body = {
                              fields,
                          };
                          responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'PUT', `/collections/${collectionId}/items/${itemId}`, body, { live });
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Webflow = Webflow;
  //# sourceMappingURL=Webflow.node.js.map

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


node_type: n8n-nodes-base.Webhook
name: Webhook
package_name: n8n-nodes-base
display_name: Webhook
description: Starts the workflow when a webhook is called
code_hash: 143d6bbdce335c5a9204112b2c1e8b92e4061d75ba3cb23301845f6fed9e6c71
source_location: node_modules/n8n-nodes-base/dist/nodes/Webhook/Webhook.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
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.Webhook = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const promises_1 = require("stream/promises");
  const fs_1 = require("fs");
  const uuid_1 = require("uuid");
  const basic_auth_1 = __importDefault(require("basic-auth"));
  const isbot_1 = __importDefault(require("isbot"));
  const tmp_promise_1 = require("tmp-promise");
  const description_1 = require("./description");
  const error_1 = require("./error");
  class Webhook extends n8n_workflow_1.Node {
      constructor() {
          super(...arguments);
          this.authPropertyName = 'authentication';
          this.description = {
              displayName: 'Webhook',
              icon: 'file:webhook.svg',
              name: 'webhook',
              group: ['trigger'],
              version: 1,
              description: 'Starts the workflow when a webhook is called',
              eventTriggerDescription: 'Waiting for you to call the Test URL',
              activationMessage: 'You can now make calls to your production webhook URL.',
              defaults: {
                  name: 'Webhook',
              },
              triggerPanel: {
                  header: '',
                  executionsHelp: {
                      inactive: 'Webhooks have two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the \'listen\' button, then make a request to the test URL. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. <a data-key="activate">Activate</a> the workflow, then make requests to the production URL. These executions will show up in the executions list, but not in the editor.',
                      active: 'Webhooks have two modes: test and production. <br /> <br /> <b>Use test mode while you build your workflow</b>. Click the \'listen\' button, then make a request to the test URL. The executions will show up in the editor.<br /> <br /> <b>Use production mode to run your workflow automatically</b>. Since the workflow is activated, you can make requests to the production URL. These executions will show up in the <a data-key="executions">executions list</a>, but not in the editor.',
                  },
                  activationHint: 'Once you’ve finished building your workflow, run it without having to click this button by using the production webhook URL.',
              },
              inputs: [],
              outputs: ['main'],
              credentials: (0, description_1.credentialsProperty)(this.authPropertyName),
              webhooks: [description_1.defaultWebhookDescription],
              properties: [
                  (0, description_1.authenticationProperty)(this.authPropertyName),
                  description_1.httpMethodsProperty,
                  {
                      displayName: 'Path',
                      name: 'path',
                      type: 'string',
                      default: '',
                      placeholder: 'webhook',
                      required: true,
                      description: 'The path to listen to',
                  },
                  description_1.responseModeProperty,
                  {
                      displayName: 'Insert a \'Respond to Webhook\' node to control when and how you respond. <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.respondtowebhook/" target="_blank">More details</a>',
                      name: 'webhookNotice',
                      type: 'notice',
                      displayOptions: {
                          show: {
                              responseMode: ['responseNode'],
                          },
                      },
                      default: '',
                  },
                  description_1.responseCodeProperty,
                  description_1.responseDataProperty,
                  description_1.responseBinaryPropertyNameProperty,
                  description_1.optionsProperty,
              ],
          };
      }
      async webhook(context) {
          var _a;
          const options = context.getNodeParameter('options', {});
          const req = context.getRequestObject();
          const resp = context.getResponseObject();
          try {
              if (options.ignoreBots && (0, isbot_1.default)(req.headers['user-agent']))
                  throw new error_1.WebhookAuthorizationError(403);
              await this.validateAuth(context);
          }
          catch (error) {
              if (error instanceof error_1.WebhookAuthorizationError) {
                  resp.writeHead(error.responseCode, { 'WWW-Authenticate': 'Basic realm="Webhook"' });
                  resp.end(error.message);
                  return { noWebhookResponse: true };
              }
              throw error;
          }
          if (options.binaryData) {
              return this.handleBinaryData(context);
          }
          if (req.contentType === 'multipart/form-data') {
              return this.handleFormData(context);
          }
          const response = {
              json: {
                  headers: req.headers,
                  params: req.params,
                  query: req.query,
                  body: req.body,
              },
              binary: options.rawBody
                  ? {
                      data: {
                          data: req.rawBody.toString(n8n_workflow_1.BINARY_ENCODING),
                          mimeType: (_a = req.contentType) !== null && _a !== void 0 ? _a : 'application/json',
                      },
                  }
                  : undefined,
          };
          return {
              webhookResponse: options.responseData,
              workflowData: [[response]],
          };
      }
      async validateAuth(context) {
          const authentication = context.getNodeParameter(this.authPropertyName);
          if (authentication === 'none')
              return;
          const req = context.getRequestObject();
          const headers = context.getHeaderData();
          if (authentication === 'basicAuth') {
              let expectedAuth;
              try {
                  expectedAuth = await context.getCredentials('httpBasicAuth');
              }
              catch { }
              if (expectedAuth === undefined || !expectedAuth.user || !expectedAuth.password) {
                  throw new error_1.WebhookAuthorizationError(500, 'No authentication data defined on node!');
              }
              const providedAuth = (0, basic_auth_1.default)(req);
              if (!providedAuth)
                  throw new error_1.WebhookAuthorizationError(401);
              if (providedAuth.name !== expectedAuth.user || providedAuth.pass !== expectedAuth.password) {
                  throw new error_1.WebhookAuthorizationError(403);
              }
          }
          else if (authentication === 'headerAuth') {
              let expectedAuth;
              try {
                  expectedAuth = await context.getCredentials('httpHeaderAuth');
              }
              catch { }
              if (expectedAuth === undefined || !expectedAuth.name || !expectedAuth.value) {
                  throw new error_1.WebhookAuthorizationError(500, 'No authentication data defined on node!');
              }
              const headerName = expectedAuth.name.toLowerCase();
              const expectedValue = expectedAuth.value;
              if (!headers.hasOwnProperty(headerName) ||
                  headers[headerName] !== expectedValue) {
                  throw new error_1.WebhookAuthorizationError(403);
              }
          }
      }
      async handleFormData(context) {
          var _a;
          const req = context.getRequestObject();
          const options = context.getNodeParameter('options', {});
          const { data, files } = req.body;
          const returnItem = {
              binary: {},
              json: {
                  headers: req.headers,
                  params: req.params,
                  query: req.query,
                  body: data,
              },
          };
          let count = 0;
          for (const key of Object.keys(files)) {
              const processFiles = [];
              let multiFile = false;
              if (Array.isArray(files[key])) {
                  processFiles.push(...files[key]);
                  multiFile = true;
              }
              else {
                  processFiles.push(files[key]);
              }
              let fileCount = 0;
              for (const file of processFiles) {
                  let binaryPropertyName = key;
                  if (binaryPropertyName.endsWith('[]')) {
                      binaryPropertyName = binaryPropertyName.slice(0, -2);
                  }
                  if (multiFile) {
                      binaryPropertyName += fileCount++;
                  }
                  if (options.binaryPropertyName) {
                      binaryPropertyName = `${options.binaryPropertyName}${count}`;
                  }
                  returnItem.binary[binaryPropertyName] = await context.nodeHelpers.copyBinaryFile(file.filepath, (_a = file.originalFilename) !== null && _a !== void 0 ? _a : file.newFilename, file.mimetype);
                  count += 1;
              }
          }
          return { workflowData: [[returnItem]] };
      }
      async handleBinaryData(context) {
          var _a, _b, _c;
          const req = context.getRequestObject();
          const options = context.getNodeParameter('options', {});
          const binaryFile = await (0, tmp_promise_1.file)({ prefix: 'n8n-webhook-' });
          try {
              await (0, promises_1.pipeline)(req, (0, fs_1.createWriteStream)(binaryFile.path));
              const returnItem = {
                  binary: {},
                  json: {
                      headers: req.headers,
                      params: req.params,
                      query: req.query,
                      body: {},
                  },
              };
              const binaryPropertyName = (options.binaryPropertyName || 'data');
              const fileName = (_b = (_a = req.contentDisposition) === null || _a === void 0 ? void 0 : _a.filename) !== null && _b !== void 0 ? _b : (0, uuid_1.v4)();
              returnItem.binary[binaryPropertyName] = await context.nodeHelpers.copyBinaryFile(binaryFile.path, fileName, (_c = req.contentType) !== null && _c !== void 0 ? _c : 'application/octet-stream');
              return { workflowData: [[returnItem]] };
          }
          catch (error) {
              throw new n8n_workflow_1.NodeOperationError(context.getNode(), error);
          }
          finally {
              await binaryFile.cleanup();
          }
      }
  }
  exports.Webhook = Webhook;
  //# sourceMappingURL=Webhook.node.js.map

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


node_type: n8n-nodes-base.Wekan
name: Wekan
package_name: n8n-nodes-base
display_name: Wekan
description: Consume Wekan API
code_hash: 7fa9339c04210a8df356f15f28131919effd00d88c7ed637e194ef9000461f1a
source_location: node_modules/n8n-nodes-base/dist/nodes/Wekan/Wekan.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Wekan = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const BoardDescription_1 = require("./BoardDescription");
  const CardDescription_1 = require("./CardDescription");
  const CardCommentDescription_1 = require("./CardCommentDescription");
  const ChecklistDescription_1 = require("./ChecklistDescription");
  const ChecklistItemDescription_1 = require("./ChecklistItemDescription");
  const ListDescription_1 = require("./ListDescription");
  const utilities_1 = require("../../utils/utilities");
  class Wekan {
      constructor() {
          this.description = {
              displayName: 'Wekan',
              name: 'wekan',
              icon: 'file:wekan.png',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Wekan API',
              defaults: {
                  name: 'Wekan',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'wekanApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Board',
                              value: 'board',
                          },
                          {
                              name: 'Card',
                              value: 'card',
                          },
                          {
                              name: 'Card Comment',
                              value: 'cardComment',
                          },
                          {
                              name: 'Checklist',
                              value: 'checklist',
                          },
                          {
                              name: 'Checklist Item',
                              value: 'checklistItem',
                          },
                          {
                              name: 'List',
                              value: 'list',
                          },
                      ],
                      default: 'card',
                  },
                  ...BoardDescription_1.boardOperations,
                  ...CardDescription_1.cardOperations,
                  ...CardCommentDescription_1.cardCommentOperations,
                  ...ChecklistDescription_1.checklistOperations,
                  ...ChecklistItemDescription_1.checklistItemOperations,
                  ...ListDescription_1.listOperations,
                  ...BoardDescription_1.boardFields,
                  ...CardDescription_1.cardFields,
                  ...CardCommentDescription_1.cardCommentFields,
                  ...ChecklistDescription_1.checklistFields,
                  ...ChecklistItemDescription_1.checklistItemFields,
                  ...ListDescription_1.listFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getUsers() {
                      const returnData = [];
                      const users = await GenericFunctions_1.apiRequest.call(this, 'GET', 'users', {}, {});
                      for (const user of users) {
                          returnData.push({
                              name: user.username,
                              value: user._id,
                          });
                      }
                      return returnData;
                  },
                  async getBoards() {
                      const returnData = [];
                      const user = await GenericFunctions_1.apiRequest.call(this, 'GET', 'user', {}, {});
                      const boards = await GenericFunctions_1.apiRequest.call(this, 'GET', `users/${user._id}/boards`, {}, {});
                      for (const board of boards) {
                          returnData.push({
                              name: board.title,
                              value: board._id,
                          });
                      }
                      return returnData;
                  },
                  async getLists() {
                      const returnData = [];
                      const boardId = this.getCurrentNodeParameter('boardId');
                      const lists = await GenericFunctions_1.apiRequest.call(this, 'GET', `boards/${boardId}/lists`, {}, {});
                      for (const list of lists) {
                          returnData.push({
                              name: list.title,
                              value: list._id,
                          });
                      }
                      return returnData;
                  },
                  async getSwimlanes() {
                      const returnData = [];
                      const boardId = this.getCurrentNodeParameter('boardId');
                      const swimlanes = await GenericFunctions_1.apiRequest.call(this, 'GET', `boards/${boardId}/swimlanes`, {}, {});
                      for (const swimlane of swimlanes) {
                          returnData.push({
                              name: swimlane.title,
                              value: swimlane._id,
                          });
                      }
                      return returnData;
                  },
                  async getCards() {
                      const returnData = [];
                      const boardId = this.getCurrentNodeParameter('boardId');
                      const listId = this.getCurrentNodeParameter('listId');
                      const cards = await GenericFunctions_1.apiRequest.call(this, 'GET', `boards/${boardId}/lists/${listId}/cards`, {}, {});
                      for (const card of cards) {
                          returnData.push({
                              name: card.title,
                              value: card._id,
                          });
                      }
                      return returnData;
                  },
                  async getChecklists() {
                      const returnData = [];
                      const boardId = this.getCurrentNodeParameter('boardId');
                      const cardId = this.getCurrentNodeParameter('cardId');
                      const checklists = await GenericFunctions_1.apiRequest.call(this, 'GET', `boards/${boardId}/cards/${cardId}/checklists`, {}, {});
                      for (const checklist of checklists) {
                          returnData.push({
                              name: checklist.title,
                              value: checklist._id,
                          });
                      }
                      return returnData;
                  },
                  async getChecklistItems() {
                      const returnData = [];
                      const boardId = this.getCurrentNodeParameter('boardId');
                      const cardId = this.getCurrentNodeParameter('cardId');
                      const checklistId = this.getCurrentNodeParameter('checklistId');
                      const checklist = await GenericFunctions_1.apiRequest.call(this, 'GET', `boards/${boardId}/cards/${cardId}/checklists/${checklistId}`, {}, {});
                      for (const item of checklist.items) {
                          returnData.push({
                              name: item.title,
                              value: item._id,
                          });
                      }
                      return returnData;
                  },
                  async getComments() {
                      const returnData = [];
                      const boardId = this.getCurrentNodeParameter('boardId');
                      const cardId = this.getCurrentNodeParameter('cardId');
                      const comments = await GenericFunctions_1.apiRequest.call(this, 'GET', `boards/${boardId}/cards/${cardId}/comments`, {}, {});
                      for (const comment of comments) {
                          returnData.push({
                              name: comment.comment,
                              value: comment._id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let returnAll;
          let limit;
          const operation = this.getNodeParameter('operation', 0);
          const resource = this.getNodeParameter('resource', 0);
          let body;
          let qs;
          let requestMethod;
          let endpoint;
          for (let i = 0; i < items.length; i++) {
              try {
                  requestMethod = 'GET';
                  endpoint = '';
                  body = {};
                  qs = {};
                  if (resource === 'board') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          endpoint = 'boards';
                          body.title = this.getNodeParameter('title', i);
                          body.owner = this.getNodeParameter('owner', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const boardId = this.getNodeParameter('boardId', i);
                          endpoint = `boards/${boardId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          endpoint = `boards/${boardId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const userId = this.getNodeParameter('IdUser', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          endpoint = `users/${userId}/boards`;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'card') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          const boardId = this.getNodeParameter('boardId', i);
                          const listId = this.getNodeParameter('listId', i);
                          endpoint = `boards/${boardId}/lists/${listId}/cards`;
                          body.title = this.getNodeParameter('title', i);
                          body.swimlaneId = this.getNodeParameter('swimlaneId', i);
                          body.authorId = this.getNodeParameter('authorId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, additionalFields);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const boardId = this.getNodeParameter('boardId', i);
                          const listId = this.getNodeParameter('listId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          endpoint = `boards/${boardId}/lists/${listId}/cards/${cardId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          const listId = this.getNodeParameter('listId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          endpoint = `boards/${boardId}/lists/${listId}/cards/${cardId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          const fromObject = this.getNodeParameter('fromObject', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          if (fromObject === 'list') {
                              const listId = this.getNodeParameter('listId', i);
                              endpoint = `boards/${boardId}/lists/${listId}/cards`;
                          }
                          if (fromObject === 'swimlane') {
                              const swimlaneId = this.getNodeParameter('swimlaneId', i);
                              endpoint = `boards/${boardId}/swimlanes/${swimlaneId}/cards`;
                          }
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const boardId = this.getNodeParameter('boardId', i);
                          const listId = this.getNodeParameter('listId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          endpoint = `boards/${boardId}/lists/${listId}/cards/${cardId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          Object.assign(body, updateFields);
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'cardComment') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/comments`;
                          body.authorId = this.getNodeParameter('authorId', i);
                          body.comment = this.getNodeParameter('comment', i);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const commentId = this.getNodeParameter('commentId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/comments/${commentId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const commentId = this.getNodeParameter('commentId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/comments/${commentId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/comments`;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'list') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          const boardId = this.getNodeParameter('boardId', i);
                          endpoint = `boards/${boardId}/lists`;
                          body.title = this.getNodeParameter('title', i);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const boardId = this.getNodeParameter('boardId', i);
                          const listId = this.getNodeParameter('listId', i);
                          endpoint = `boards/${boardId}/lists/${listId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          const listId = this.getNodeParameter('listId', i);
                          endpoint = `boards/${boardId}/lists/${listId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          endpoint = `boards/${boardId}/lists`;
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'checklist') {
                      if (operation === 'create') {
                          requestMethod = 'POST';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/checklists`;
                          body.title = this.getNodeParameter('title', i);
                          body.items = this.getNodeParameter('items', i);
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const checklistId = this.getNodeParameter('checklistId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/checklists/${checklistId}`;
                      }
                      else if (operation === 'get') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const checklistId = this.getNodeParameter('checklistId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/checklists/${checklistId}`;
                      }
                      else if (operation === 'getAll') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          returnAll = this.getNodeParameter('returnAll', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/checklists`;
                      }
                      else if (operation === 'getCheckItem') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const checklistId = this.getNodeParameter('checklistId', i);
                          const itemId = this.getNodeParameter('itemId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/checklists/${checklistId}/items/${itemId}`;
                      }
                      else if (operation === 'deleteCheckItem') {
                          requestMethod = 'DELETE';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const checklistId = this.getNodeParameter('checklistId', i);
                          const itemId = this.getNodeParameter('itemId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/checklists/${checklistId}/items/${itemId}`;
                      }
                      else if (operation === 'updateCheckItem') {
                          requestMethod = 'PUT';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const checklistId = this.getNodeParameter('checklistId', i);
                          const itemId = this.getNodeParameter('itemId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/checklists/${checklistId}/items/${itemId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          Object.assign(body, updateFields);
                      }
                      else {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
                      }
                  }
                  else if (resource === 'checklistItem') {
                      if (operation === 'get') {
                          requestMethod = 'GET';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const checklistId = this.getNodeParameter('checklistId', i);
                          const itemId = this.getNodeParameter('checklistItemId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/checklists/${checklistId}/items/${itemId}`;
                      }
                      else if (operation === 'delete') {
                          requestMethod = 'DELETE';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const checklistId = this.getNodeParameter('checklistId', i);
                          const itemId = this.getNodeParameter('checklistItemId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/checklists/${checklistId}/items/${itemId}`;
                      }
                      else if (operation === 'update') {
                          requestMethod = 'PUT';
                          const boardId = this.getNodeParameter('boardId', i);
                          const cardId = this.getNodeParameter('cardId', i);
                          const checklistId = this.getNodeParameter('checklistId', i);
                          const itemId = this.getNodeParameter('checklistItemId', i);
                          endpoint = `boards/${boardId}/cards/${cardId}/checklists/${checklistId}/items/${itemId}`;
                          const updateFields = this.getNodeParameter('updateFields', i);
                          Object.assign(body, updateFields);
                      }
                  }
                  let responseData = await GenericFunctions_1.apiRequest.call(this, requestMethod, endpoint, body, qs);
                  if (returnAll === false && Array.isArray(responseData)) {
                      limit = this.getNodeParameter('limit', i);
                      responseData = responseData.splice(0, limit);
                  }
                  const executionData = this.helpers.constructExecutionMetaData((0, utilities_1.wrapData)(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
                      continue;
                  }
                  throw error;
              }
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Wekan = Wekan;
  //# sourceMappingURL=Wekan.node.js.map

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


node_type: n8n-nodes-base.WhatsApp
name: WhatsApp
package_name: n8n-nodes-base
display_name: WhatsApp Business Cloud
description: Access WhatsApp API
code_hash: f36be4f477cb2d0526f7bfdf3caeae4ed3518eb4a3b170d72e96b88e2dc44367
source_location: node_modules/n8n-nodes-base/dist/nodes/WhatsApp/WhatsApp.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.WhatsApp = void 0;
  const MessagesDescription_1 = require("./MessagesDescription");
  const MediaDescription_1 = require("./MediaDescription");
  class WhatsApp {
      constructor() {
          this.description = {
              displayName: 'WhatsApp Business Cloud',
              name: 'whatsApp',
              icon: 'file:whatsapp.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{ $parameter["resource"] + ": " + $parameter["operation"] }}',
              description: 'Access WhatsApp API',
              defaults: {
                  name: 'WhatsApp Business Cloud',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'whatsAppApi',
                      required: true,
                  },
              ],
              requestDefaults: {
                  baseURL: 'https://graph.facebook.com/v13.0/',
              },
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Message',
                              value: 'message',
                          },
                          {
                              name: 'Media',
                              value: 'media',
                          },
                      ],
                      default: 'message',
                  },
                  ...MessagesDescription_1.messageFields,
                  ...MediaDescription_1.mediaFields,
                  ...MessagesDescription_1.messageTypeFields,
                  ...MediaDescription_1.mediaTypeFields,
              ],
          };
      }
  }
  exports.WhatsApp = WhatsApp;
  //# sourceMappingURL=WhatsApp.node.js.map

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


node_type: n8n-nodes-base.Wise
name: Wise
package_name: n8n-nodes-base
display_name: Wise
description: Consume the Wise API
code_hash: 07a5d221159d4a3ca44885812009b5ebf053effe21c97ccc94fde861dd9a5607
source_location: node_modules/n8n-nodes-base/dist/nodes/Wise/Wise.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
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.Wise = void 0;
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  const omit_1 = __importDefault(require("lodash/omit"));
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  const uuid_1 = require("uuid");
  class Wise {
      constructor() {
          this.description = {
              displayName: 'Wise',
              name: 'wise',
              icon: 'file:wise.svg',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Wise API',
              defaults: {
                  name: 'Wise',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'wiseApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Account',
                              value: 'account',
                          },
                          {
                              name: 'Exchange Rate',
                              value: 'exchangeRate',
                          },
                          {
                              name: 'Profile',
                              value: 'profile',
                          },
                          {
                              name: 'Quote',
                              value: 'quote',
                          },
                          {
                              name: 'Recipient',
                              value: 'recipient',
                          },
                          {
                              name: 'Transfer',
                              value: 'transfer',
                          },
                      ],
                      default: 'account',
                  },
                  ...descriptions_1.accountOperations,
                  ...descriptions_1.accountFields,
                  ...descriptions_1.exchangeRateOperations,
                  ...descriptions_1.exchangeRateFields,
                  ...descriptions_1.profileOperations,
                  ...descriptions_1.profileFields,
                  ...descriptions_1.quoteOperations,
                  ...descriptions_1.quoteFields,
                  ...descriptions_1.recipientOperations,
                  ...descriptions_1.recipientFields,
                  ...descriptions_1.transferOperations,
                  ...descriptions_1.transferFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getBorderlessAccounts() {
                      const qs = {
                          profileId: this.getNodeParameter('profileId', 0),
                      };
                      const accounts = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/borderless-accounts', {}, qs);
                      return accounts.map(({ id, balances }) => ({
                          name: balances.map(({ currency }) => currency).join(' - '),
                          value: id,
                      }));
                  },
                  async getProfiles() {
                      const profiles = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/profiles');
                      return profiles.map(({ id, type }) => ({
                          name: type.charAt(0).toUpperCase() + type.slice(1),
                          value: id,
                      }));
                  },
                  async getRecipients() {
                      const qs = {
                          profileId: this.getNodeParameter('profileId', 0),
                      };
                      const recipients = (await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/accounts', {}, qs));
                      return recipients.reduce((activeRecipients, { active, id, accountHolderName, currency, country, type }) => {
                          if (active) {
                              const recipient = {
                                  name: `[${currency}] ${accountHolderName} - (${country !== null ? country + ' - ' : ''}${type})`,
                                  value: id,
                              };
                              activeRecipients.push(recipient);
                          }
                          return activeRecipients;
                      }, []);
                  },
              },
          };
      }
      async execute() {
          var _a, _b;
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          const timezone = this.getTimezone();
          let responseData;
          const returnData = [];
          let binaryOutput = false;
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'account') {
                      if (operation === 'getBalances') {
                          const qs = {
                              profileId: this.getNodeParameter('profileId', i),
                          };
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/borderless-accounts', {}, qs);
                      }
                      else if (operation === 'getCurrencies') {
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/borderless-accounts/balance-currencies');
                      }
                      else if (operation === 'getStatement') {
                          const profileId = this.getNodeParameter('profileId', i);
                          const borderlessAccountId = this.getNodeParameter('borderlessAccountId', i);
                          const format = this.getNodeParameter('format', i);
                          const endpoint = `v3/profiles/${profileId}/borderless-accounts/${borderlessAccountId}/statement.${format}`;
                          const qs = {
                              currency: this.getNodeParameter('currency', i),
                          };
                          const { lineStyle, range } = this.getNodeParameter('additionalFields', i);
                          if (lineStyle !== undefined) {
                              qs.type = lineStyle;
                          }
                          if (range !== undefined) {
                              qs.intervalStart = moment_timezone_1.default
                                  .tz(range.rangeProperties.intervalStart, timezone)
                                  .utc()
                                  .format();
                              qs.intervalEnd = moment_timezone_1.default
                                  .tz(range.rangeProperties.intervalEnd, timezone)
                                  .utc()
                                  .format();
                          }
                          else {
                              qs.intervalStart = (0, moment_timezone_1.default)().subtract(1, 'months').utc().format();
                              qs.intervalEnd = (0, moment_timezone_1.default)().utc().format();
                          }
                          if (format === 'json') {
                              responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', endpoint, {}, qs);
                          }
                          else {
                              const data = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', endpoint, {}, qs, {
                                  encoding: 'arraybuffer',
                              });
                              const binaryProperty = this.getNodeParameter('binaryProperty', i);
                              items[i].binary = (_a = items[i].binary) !== null && _a !== void 0 ? _a : {};
                              items[i].binary[binaryProperty] = await this.helpers.prepareBinaryData(data, this.getNodeParameter('fileName', i));
                              responseData = items;
                              binaryOutput = true;
                          }
                      }
                  }
                  else if (resource === 'exchangeRate') {
                      if (operation === 'get') {
                          const qs = {
                              source: this.getNodeParameter('source', i),
                              target: this.getNodeParameter('target', i),
                          };
                          const { interval, range, time } = this.getNodeParameter('additionalFields', i);
                          if (interval !== undefined) {
                              qs.group = interval;
                          }
                          if (time !== undefined) {
                              qs.time = time;
                          }
                          if (range !== undefined && time === undefined) {
                              qs.from = moment_timezone_1.default.tz(range.rangeProperties.from, timezone).utc().format();
                              qs.to = moment_timezone_1.default.tz(range.rangeProperties.to, timezone).utc().format();
                          }
                          else if (time === undefined) {
                              qs.from = (0, moment_timezone_1.default)().subtract(1, 'months').utc().format();
                              qs.to = (0, moment_timezone_1.default)().format();
                          }
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/rates', {}, qs);
                      }
                  }
                  else if (resource === 'profile') {
                      if (operation === 'get') {
                          const profileId = this.getNodeParameter('profileId', i);
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', `v1/profiles/${profileId}`);
                      }
                      else if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/profiles');
                      }
                  }
                  else if (resource === 'recipient') {
                      if (operation === 'getAll') {
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/accounts');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  else if (resource === 'quote') {
                      if (operation === 'create') {
                          const body = {
                              profile: this.getNodeParameter('profileId', i),
                              sourceCurrency: this.getNodeParameter('sourceCurrency', i).toUpperCase(),
                              targetCurrency: this.getNodeParameter('targetCurrency', i).toUpperCase(),
                          };
                          const amountType = this.getNodeParameter('amountType', i);
                          if (amountType === 'source') {
                              body.sourceAmount = this.getNodeParameter('amount', i);
                          }
                          else if (amountType === 'target') {
                              body.targetAmount = this.getNodeParameter('amount', i);
                          }
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'POST', 'v2/quotes', body, {});
                      }
                      else if (operation === 'get') {
                          const quoteId = this.getNodeParameter('quoteId', i);
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', `v2/quotes/${quoteId}`);
                      }
                  }
                  else if (resource === 'transfer') {
                      if (operation === 'create') {
                          const body = {
                              quoteUuid: this.getNodeParameter('quoteId', i),
                              targetAccount: this.getNodeParameter('targetAccountId', i),
                              customerTransactionId: (0, uuid_1.v4)(),
                          };
                          const { reference } = this.getNodeParameter('additionalFields', i);
                          if (reference !== undefined) {
                              body.details = { reference };
                          }
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'POST', 'v1/transfers', body, {});
                      }
                      else if (operation === 'delete') {
                          const transferId = this.getNodeParameter('transferId', i);
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'PUT', `v1/transfers/${transferId}/cancel`);
                      }
                      else if (operation === 'execute') {
                          const profileId = this.getNodeParameter('profileId', i);
                          const transferId = this.getNodeParameter('transferId', i);
                          const endpoint = `v3/profiles/${profileId}/transfers/${transferId}/payments`;
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'POST', endpoint, { type: 'BALANCE' }, {});
                          const { environment } = await this.getCredentials('wiseApi');
                          if (environment === 'test') {
                              for (const testEndpoint of [
                                  'processing',
                                  'funds_converted',
                                  'outgoing_payment_sent',
                              ]) {
                                  await GenericFunctions_1.wiseApiRequest.call(this, 'GET', `v1/simulation/transfers/${transferId}/${testEndpoint}`);
                              }
                          }
                      }
                      else if (operation === 'get') {
                          const transferId = this.getNodeParameter('transferId', i);
                          const downloadReceipt = this.getNodeParameter('downloadReceipt', i);
                          if (downloadReceipt) {
                              const data = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', `v1/transfers/${transferId}/receipt.pdf`, {}, {}, { encoding: 'arraybuffer' });
                              const binaryProperty = this.getNodeParameter('binaryProperty', i);
                              items[i].binary = (_b = items[i].binary) !== null && _b !== void 0 ? _b : {};
                              items[i].binary[binaryProperty] = await this.helpers.prepareBinaryData(data, this.getNodeParameter('fileName', i));
                              responseData = items;
                              binaryOutput = true;
                          }
                          else {
                              responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', `v1/transfers/${transferId}`);
                          }
                      }
                      else if (operation === 'getAll') {
                          const qs = {
                              profile: this.getNodeParameter('profileId', i),
                          };
                          const filters = this.getNodeParameter('filters', i);
                          Object.keys((0, omit_1.default)(filters, 'range')).forEach((key) => {
                              qs[key] = filters[key];
                          });
                          if (filters.range !== undefined) {
                              qs.createdDateStart = (0, moment_timezone_1.default)(filters.range.rangeProperties.createdDateStart).format();
                              qs.createdDateEnd = (0, moment_timezone_1.default)(filters.range.rangeProperties.createdDateEnd).format();
                          }
                          else {
                              qs.createdDateStart = (0, moment_timezone_1.default)().subtract(1, 'months').format();
                              qs.createdDateEnd = (0, moment_timezone_1.default)().format();
                          }
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (!returnAll) {
                              qs.limit = this.getNodeParameter('limit', i);
                          }
                          responseData = await GenericFunctions_1.wiseApiRequest.call(this, 'GET', 'v1/transfers', {}, qs);
                      }
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ error: error.toString() });
                      continue;
                  }
                  throw error;
              }
              Array.isArray(responseData)
                  ? returnData.push(...responseData)
                  : returnData.push(responseData);
          }
          if (binaryOutput && responseData !== undefined) {
              return [responseData];
          }
          return [this.helpers.returnJsonArray(returnData)];
      }
  }
  exports.Wise = Wise;
  //# sourceMappingURL=Wise.node.js.map

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


node_type: n8n-nodes-base.WooCommerce
name: WooCommerce
package_name: n8n-nodes-base
display_name: WooCommerce
description: Consume WooCommerce API
code_hash: 32e6ebee88d5a70ca7263620ddae947e08465e8c9a0eede9550f542ea9ab9e60
source_location: node_modules/n8n-nodes-base/dist/nodes/WooCommerce/WooCommerce.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.WooCommerce = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const ProductDescription_1 = require("./ProductDescription");
  const OrderDescription_1 = require("./OrderDescription");
  const descriptions_1 = require("./descriptions");
  class WooCommerce {
      constructor() {
          this.description = {
              displayName: 'WooCommerce',
              name: 'wooCommerce',
              icon: 'file:wooCommerce.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume WooCommerce API',
              defaults: {
                  name: 'WooCommerce',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'wooCommerceApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Customer',
                              value: 'customer',
                          },
                          {
                              name: 'Order',
                              value: 'order',
                          },
                          {
                              name: 'Product',
                              value: 'product',
                          },
                      ],
                      default: 'product',
                  },
                  ...descriptions_1.customerOperations,
                  ...descriptions_1.customerFields,
                  ...ProductDescription_1.productOperations,
                  ...ProductDescription_1.productFields,
                  ...OrderDescription_1.orderOperations,
                  ...OrderDescription_1.orderFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCategories() {
                      const returnData = [];
                      const categories = await GenericFunctions_1.woocommerceApiRequestAllItems.call(this, 'GET', '/products/categories', {});
                      for (const category of categories) {
                          const categoryName = category.name;
                          const categoryId = category.id;
                          returnData.push({
                              name: categoryName,
                              value: categoryId,
                          });
                      }
                      return returnData;
                  },
                  async getTags() {
                      const returnData = [];
                      const tags = await GenericFunctions_1.woocommerceApiRequestAllItems.call(this, 'GET', '/products/tags', {});
                      for (const tag of tags) {
                          const tagName = tag.name;
                          const tagId = tag.id;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              if (resource === 'customer') {
                  if (operation === 'create') {
                      const body = {
                          email: this.getNodeParameter('email', i),
                      };
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      if (Object.keys(additionalFields).length) {
                          Object.assign(body, (0, GenericFunctions_1.adjustMetadata)(additionalFields));
                      }
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'POST', '/customers', body);
                  }
                  else if (operation === 'delete') {
                      const customerId = this.getNodeParameter('customerId', i);
                      qs.force = true;
                      const endpoint = `/customers/${customerId}`;
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'DELETE', endpoint, {}, qs);
                  }
                  else if (operation === 'get') {
                      const customerId = this.getNodeParameter('customerId', i);
                      const endpoint = `/customers/${customerId}`;
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'GET', endpoint);
                  }
                  else if (operation === 'getAll') {
                      const filters = this.getNodeParameter('filters', i);
                      const returnAll = this.getNodeParameter('returnAll', i);
                      if (Object.keys(filters).length) {
                          Object.assign(qs, filters);
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.woocommerceApiRequestAllItems.call(this, 'GET', '/customers', {}, {});
                      }
                      else {
                          qs.per_page = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'GET', '/customers', {}, qs);
                      }
                  }
                  else if (operation === 'update') {
                      const body = {};
                      const updateFields = this.getNodeParameter('updateFields', i);
                      if (Object.keys(updateFields).length) {
                          Object.assign(body, (0, GenericFunctions_1.adjustMetadata)(updateFields));
                      }
                      const customerId = this.getNodeParameter('customerId', i);
                      const endpoint = `/customers/${customerId}`;
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'PUT', endpoint, body);
                  }
              }
              else if (resource === 'product') {
                  if (operation === 'create') {
                      const name = this.getNodeParameter('name', i);
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {
                          name,
                      };
                      (0, GenericFunctions_1.setFields)(additionalFields, body);
                      if (additionalFields.categories) {
                          body.categories = additionalFields.categories.map((category) => ({
                              id: parseInt(category, 10),
                          }));
                      }
                      const images = this.getNodeParameter('imagesUi', i)
                          .imagesValues;
                      if (images) {
                          body.images = images;
                      }
                      const dimension = this.getNodeParameter('dimensionsUi', i)
                          .dimensionsValues;
                      if (dimension) {
                          body.dimensions = dimension;
                      }
                      const metadata = this.getNodeParameter('metadataUi', i)
                          .metadataValues;
                      if (metadata) {
                          body.meta_data = metadata;
                      }
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'POST', '/products', body);
                  }
                  if (operation === 'update') {
                      const productId = this.getNodeParameter('productId', i);
                      const updateFields = this.getNodeParameter('updateFields', i);
                      const body = {};
                      (0, GenericFunctions_1.setFields)(updateFields, body);
                      const images = this.getNodeParameter('imagesUi', i)
                          .imagesValues;
                      if (images) {
                          body.images = images;
                      }
                      const dimension = this.getNodeParameter('dimensionsUi', i)
                          .dimensionsValues;
                      if (dimension) {
                          body.dimensions = dimension;
                      }
                      const metadata = this.getNodeParameter('metadataUi', i)
                          .metadataValues;
                      if (metadata) {
                          body.meta_data = metadata;
                      }
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'PUT', `/products/${productId}`, body);
                  }
                  if (operation === 'get') {
                      const productId = this.getNodeParameter('productId', i);
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'GET', `/products/${productId}`, {}, qs);
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      if (options.after) {
                          qs.after = options.after;
                      }
                      if (options.before) {
                          qs.before = options.before;
                      }
                      if (options.category) {
                          qs.category = options.category;
                      }
                      if (options.context) {
                          qs.context = options.context;
                      }
                      if (options.featured) {
                          qs.featured = options.featured;
                      }
                      if (options.maxPrice) {
                          qs.max_price = options.maxPrice;
                      }
                      if (options.minPrice) {
                          qs.max_price = options.minPrice;
                      }
                      if (options.order) {
                          qs.order = options.order;
                      }
                      if (options.orderBy) {
                          qs.orderby = options.orderBy;
                      }
                      if (options.search) {
                          qs.search = options.search;
                      }
                      if (options.sku) {
                          qs.sku = options.sku;
                      }
                      if (options.slug) {
                          qs.slug = options.slug;
                      }
                      if (options.status) {
                          qs.status = options.status;
                      }
                      if (options.stockStatus) {
                          qs.stock_status = options.stockStatus;
                      }
                      if (options.tag) {
                          qs.tag = options.tag;
                      }
                      if (options.taxClass) {
                          qs.tax_class = options.taxClass;
                      }
                      if (options.type) {
                          qs.type = options.type;
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.woocommerceApiRequestAllItems.call(this, 'GET', '/products', {}, qs);
                      }
                      else {
                          qs.per_page = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'GET', '/products', {}, qs);
                      }
                  }
                  if (operation === 'delete') {
                      const productId = this.getNodeParameter('productId', i);
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'DELETE', `/products/${productId}`, {}, { force: true });
                  }
              }
              if (resource === 'order') {
                  if (operation === 'create') {
                      const additionalFields = this.getNodeParameter('additionalFields', i);
                      const body = {};
                      (0, GenericFunctions_1.setFields)(additionalFields, body);
                      const billing = this.getNodeParameter('billingUi', i)
                          .billingValues;
                      if (billing !== undefined) {
                          body.billing = billing;
                          (0, GenericFunctions_1.toSnakeCase)(billing);
                      }
                      const shipping = this.getNodeParameter('shippingUi', i)
                          .shippingValues;
                      if (shipping !== undefined) {
                          body.shipping = shipping;
                          (0, GenericFunctions_1.toSnakeCase)(shipping);
                      }
                      const couponLines = this.getNodeParameter('couponLinesUi', i)
                          .couponLinesValues;
                      if (couponLines) {
                          body.coupon_lines = couponLines;
                          (0, GenericFunctions_1.setMetadata)(couponLines);
                          (0, GenericFunctions_1.toSnakeCase)(couponLines);
                      }
                      const feeLines = this.getNodeParameter('feeLinesUi', i)
                          .feeLinesValues;
                      if (feeLines) {
                          body.fee_lines = feeLines;
                          (0, GenericFunctions_1.setMetadata)(feeLines);
                          (0, GenericFunctions_1.toSnakeCase)(feeLines);
                      }
                      const lineItems = this.getNodeParameter('lineItemsUi', i)
                          .lineItemsValues;
                      if (lineItems) {
                          body.line_items = lineItems;
                          (0, GenericFunctions_1.setMetadata)(lineItems);
                          (0, GenericFunctions_1.toSnakeCase)(lineItems);
                      }
                      const metadata = this.getNodeParameter('metadataUi', i)
                          .metadataValues;
                      if (metadata) {
                          body.meta_data = metadata;
                      }
                      const shippingLines = this.getNodeParameter('shippingLinesUi', i)
                          .shippingLinesValues;
                      if (shippingLines) {
                          body.shipping_lines = shippingLines;
                          (0, GenericFunctions_1.setMetadata)(shippingLines);
                          (0, GenericFunctions_1.toSnakeCase)(shippingLines);
                      }
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'POST', '/orders', body);
                  }
                  if (operation === 'update') {
                      const orderId = this.getNodeParameter('orderId', i);
                      const updateFields = this.getNodeParameter('updateFields', i);
                      const body = {};
                      if (updateFields.currency) {
                          body.currency = updateFields.currency;
                      }
                      if (updateFields.customerId) {
                          body.customer_id = parseInt(updateFields.customerId, 10);
                      }
                      if (updateFields.customerNote) {
                          body.customer_note = updateFields.customerNote;
                      }
                      if (updateFields.parentId) {
                          body.parent_id = parseInt(updateFields.parentId, 10);
                      }
                      if (updateFields.paymentMethodId) {
                          body.payment_method = updateFields.paymentMethodId;
                      }
                      if (updateFields.paymentMethodTitle) {
                          body.payment_method_title = updateFields.paymentMethodTitle;
                      }
                      if (updateFields.status) {
                          body.status = updateFields.status;
                      }
                      if (updateFields.transactionID) {
                          body.transaction_id = updateFields.transactionID;
                      }
                      const billing = this.getNodeParameter('billingUi', i)
                          .billingValues;
                      if (billing !== undefined) {
                          body.billing = billing;
                          (0, GenericFunctions_1.toSnakeCase)(billing);
                      }
                      const shipping = this.getNodeParameter('shippingUi', i)
                          .shippingValues;
                      if (shipping !== undefined) {
                          body.shipping = shipping;
                          (0, GenericFunctions_1.toSnakeCase)(shipping);
                      }
                      const couponLines = this.getNodeParameter('couponLinesUi', i)
                          .couponLinesValues;
                      if (couponLines) {
                          body.coupon_lines = couponLines;
                          (0, GenericFunctions_1.setMetadata)(couponLines);
                          (0, GenericFunctions_1.toSnakeCase)(couponLines);
                      }
                      const feeLines = this.getNodeParameter('feeLinesUi', i)
                          .feeLinesValues;
                      if (feeLines) {
                          body.fee_lines = feeLines;
                          (0, GenericFunctions_1.setMetadata)(feeLines);
                          (0, GenericFunctions_1.toSnakeCase)(feeLines);
                      }
                      const lineItems = this.getNodeParameter('lineItemsUi', i)
                          .lineItemsValues;
                      if (lineItems) {
                          body.line_items = lineItems;
                          (0, GenericFunctions_1.setMetadata)(lineItems);
                          (0, GenericFunctions_1.toSnakeCase)(lineItems);
                      }
                      const metadata = this.getNodeParameter('metadataUi', i)
                          .metadataValues;
                      if (metadata) {
                          body.meta_data = metadata;
                      }
                      const shippingLines = this.getNodeParameter('shippingLinesUi', i)
                          .shippingLinesValues;
                      if (shippingLines) {
                          body.shipping_lines = shippingLines;
                          (0, GenericFunctions_1.setMetadata)(shippingLines);
                          (0, GenericFunctions_1.toSnakeCase)(shippingLines);
                      }
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'PUT', `/orders/${orderId}`, body);
                  }
                  if (operation === 'get') {
                      const orderId = this.getNodeParameter('orderId', i);
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'GET', `/orders/${orderId}`, {}, qs);
                  }
                  if (operation === 'getAll') {
                      const returnAll = this.getNodeParameter('returnAll', i);
                      const options = this.getNodeParameter('options', i);
                      if (options.after) {
                          qs.after = options.after;
                      }
                      if (options.before) {
                          qs.before = options.before;
                      }
                      if (options.category) {
                          qs.category = options.category;
                      }
                      if (options.customer) {
                          qs.customer = parseInt(options.customer, 10);
                      }
                      if (options.decimalPoints) {
                          qs.dp = options.decimalPoints;
                      }
                      if (options.product) {
                          qs.product = parseInt(options.product, 10);
                      }
                      if (options.order) {
                          qs.order = options.order;
                      }
                      if (options.orderBy) {
                          qs.orderby = options.orderBy;
                      }
                      if (options.search) {
                          qs.search = options.search;
                      }
                      if (options.status) {
                          qs.status = options.status;
                      }
                      if (returnAll) {
                          responseData = await GenericFunctions_1.woocommerceApiRequestAllItems.call(this, 'GET', '/orders', {}, qs);
                      }
                      else {
                          qs.per_page = this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'GET', '/orders', {}, qs);
                      }
                  }
                  if (operation === 'delete') {
                      const orderId = this.getNodeParameter('orderId', i);
                      responseData = await GenericFunctions_1.woocommerceApiRequest.call(this, 'DELETE', `/orders/${orderId}`, {}, { force: true });
                  }
              }
              const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
              returnData.push(...executionData);
          }
          return [returnData];
      }
  }
  exports.WooCommerce = WooCommerce;
  //# sourceMappingURL=WooCommerce.node.js.map

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


node_type: n8n-nodes-base.Wordpress
name: Wordpress
package_name: n8n-nodes-base
display_name: Wordpress
description: Consume Wordpress API
code_hash: 1aa9205e0c6d3a7ea7839b9436e584331e3ac4a84917f24f07219a83e8fbd60f
source_location: node_modules/n8n-nodes-base/dist/nodes/Wordpress/Wordpress.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Wordpress = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const PostDescription_1 = require("./PostDescription");
  const UserDescription_1 = require("./UserDescription");
  class Wordpress {
      constructor() {
          this.description = {
              displayName: 'Wordpress',
              name: 'wordpress',
              icon: 'file:wordpress.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Wordpress API',
              defaults: {
                  name: 'Wordpress',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'wordpressApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Post',
                              value: 'post',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'post',
                  },
                  ...PostDescription_1.postOperations,
                  ...PostDescription_1.postFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCategories() {
                      const returnData = [];
                      const categories = await GenericFunctions_1.wordpressApiRequestAllItems.call(this, 'GET', '/categories', {});
                      for (const category of categories) {
                          const categoryName = category.name;
                          const categoryId = category.id;
                          returnData.push({
                              name: categoryName,
                              value: categoryId,
                          });
                      }
                      return returnData;
                  },
                  async getTags() {
                      const returnData = [];
                      const tags = await GenericFunctions_1.wordpressApiRequestAllItems.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 getAuthors() {
                      const returnData = [];
                      const authors = await GenericFunctions_1.wordpressApiRequestAllItems.call(this, 'GET', '/users', {}, { who: 'authors' });
                      for (const author of authors) {
                          const authorName = author.name;
                          const authorId = author.id;
                          returnData.push({
                              name: authorName,
                              value: authorId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let responseData;
          const qs = {};
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < length; i++) {
              try {
                  if (resource === 'post') {
                      if (operation === 'create') {
                          const title = this.getNodeParameter('title', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              title,
                          };
                          if (additionalFields.authorId) {
                              body.author = additionalFields.authorId;
                          }
                          if (additionalFields.content) {
                              body.content = additionalFields.content;
                          }
                          if (additionalFields.slug) {
                              body.slug = additionalFields.slug;
                          }
                          if (additionalFields.password) {
                              body.password = additionalFields.password;
                          }
                          if (additionalFields.status) {
                              body.status = additionalFields.status;
                          }
                          if (additionalFields.commentStatus) {
                              body.comment_status = additionalFields.commentStatus;
                          }
                          if (additionalFields.pingStatus) {
                              body.ping_status = additionalFields.pingStatus;
                          }
                          if (additionalFields.sticky) {
                              body.sticky = additionalFields.sticky;
                          }
                          if (additionalFields.postTemplate) {
                              body.template = this.getNodeParameter('additionalFields.postTemplate.values.template', i, '');
                          }
                          if (additionalFields.categories) {
                              body.categories = additionalFields.categories;
                          }
                          if (additionalFields.tags) {
                              body.tags = additionalFields.tags;
                          }
                          if (additionalFields.format) {
                              body.format = additionalFields.format;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'POST', '/posts', body);
                      }
                      if (operation === 'update') {
                          const postId = this.getNodeParameter('postId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              id: parseInt(postId, 10),
                          };
                          if (updateFields.authorId) {
                              body.author = updateFields.authorId;
                          }
                          if (updateFields.title) {
                              body.title = updateFields.title;
                          }
                          if (updateFields.content) {
                              body.content = updateFields.content;
                          }
                          if (updateFields.slug) {
                              body.slug = updateFields.slug;
                          }
                          if (updateFields.password) {
                              body.password = updateFields.password;
                          }
                          if (updateFields.status) {
                              body.status = updateFields.status;
                          }
                          if (updateFields.commentStatus) {
                              body.comment_status = updateFields.commentStatus;
                          }
                          if (updateFields.pingStatus) {
                              body.ping_status = updateFields.pingStatus;
                          }
                          if (updateFields.sticky) {
                              body.sticky = updateFields.sticky;
                          }
                          if (updateFields.postTemplate) {
                              body.template = this.getNodeParameter('updateFields.postTemplate.values.template', i, '');
                          }
                          if (updateFields.categories) {
                              body.categories = updateFields.categories;
                          }
                          if (updateFields.tags) {
                              body.tags = updateFields.tags;
                          }
                          if (updateFields.format) {
                              body.format = updateFields.format;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'POST', `/posts/${postId}`, body);
                      }
                      if (operation === 'get') {
                          const postId = this.getNodeParameter('postId', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.password) {
                              qs.password = options.password;
                          }
                          if (options.context) {
                              qs.context = options.context;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'GET', `/posts/${postId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.context) {
                              qs.context = options.context;
                          }
                          if (options.orderBy) {
                              qs.orderby = options.orderBy;
                          }
                          if (options.order) {
                              qs.order = options.order;
                          }
                          if (options.search) {
                              qs.search = options.search;
                          }
                          if (options.after) {
                              qs.after = options.after;
                          }
                          if (options.author) {
                              qs.author = options.author;
                          }
                          if (options.categories) {
                              qs.categories = options.categories;
                          }
                          if (options.excludedCategories) {
                              qs.categories_exclude = options.excludedCategories;
                          }
                          if (options.tags) {
                              qs.tags = options.tags;
                          }
                          if (options.excludedTags) {
                              qs.tags_exclude = options.excludedTags;
                          }
                          if (options.sticky) {
                              qs.sticky = options.sticky;
                          }
                          if (options.status) {
                              qs.status = options.status;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.wordpressApiRequestAllItems.call(this, 'GET', '/posts', {}, qs);
                          }
                          else {
                              qs.per_page = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'GET', '/posts', {}, qs);
                          }
                      }
                      if (operation === 'delete') {
                          const postId = this.getNodeParameter('postId', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.force) {
                              qs.force = options.force;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'DELETE', `/posts/${postId}`, {}, qs);
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const username = this.getNodeParameter('username', i);
                          const firstName = this.getNodeParameter('firstName', i);
                          const lastName = this.getNodeParameter('lastName', i);
                          const email = this.getNodeParameter('email', i);
                          const password = this.getNodeParameter('password', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                              username,
                              first_name: firstName,
                              last_name: lastName,
                              email,
                              password,
                          };
                          if (additionalFields.url) {
                              body.url = additionalFields.url;
                          }
                          if (additionalFields.description) {
                              body.description = additionalFields.description;
                          }
                          if (additionalFields.nickname) {
                              body.nickname = additionalFields.nickname;
                          }
                          if (additionalFields.slug) {
                              body.slug = additionalFields.slug;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'POST', '/users', body);
                      }
                      if (operation === 'update') {
                          const userId = this.getNodeParameter('userId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              id: userId,
                          };
                          if (updateFields.name) {
                              body.name = updateFields.name;
                          }
                          if (updateFields.firstName) {
                              body.first_name = updateFields.firstName;
                          }
                          if (updateFields.lastName) {
                              body.last_name = updateFields.lastName;
                          }
                          if (updateFields.email) {
                              body.email = updateFields.email;
                          }
                          if (updateFields.password) {
                              body.password = updateFields.password;
                          }
                          if (updateFields.username) {
                              body.username = updateFields.username;
                          }
                          if (updateFields.url) {
                              body.url = updateFields.url;
                          }
                          if (updateFields.description) {
                              body.description = updateFields.description;
                          }
                          if (updateFields.nickname) {
                              body.nickname = updateFields.nickname;
                          }
                          if (updateFields.slug) {
                              body.slug = updateFields.slug;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'POST', `/users/${userId}`, body);
                      }
                      if (operation === 'get') {
                          const userId = this.getNodeParameter('userId', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.context) {
                              qs.context = options.context;
                          }
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'GET', `/users/${userId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.context) {
                              qs.context = options.context;
                          }
                          if (options.orderBy) {
                              qs.orderby = options.orderBy;
                          }
                          if (options.order) {
                              qs.order = options.order;
                          }
                          if (options.search) {
                              qs.search = options.search;
                          }
                          if (options.who) {
                              qs.who = options.who;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.wordpressApiRequestAllItems.call(this, 'GET', '/users', {}, qs);
                          }
                          else {
                              qs.per_page = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'GET', '/users', {}, qs);
                          }
                      }
                      if (operation === 'delete') {
                          const reassign = this.getNodeParameter('reassign', i);
                          qs.reassign = reassign;
                          qs.force = true;
                          responseData = await GenericFunctions_1.wordpressApiRequest.call(this, 'DELETE', '/users/me', {}, qs);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Wordpress = Wordpress;
  //# sourceMappingURL=Wordpress.node.js.map

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


node_type: n8n-nodes-base.WorkflowTrigger
name: WorkflowTrigger
package_name: n8n-nodes-base
display_name: Workflow Trigger
description: Triggers based on various lifecycle events, like when a workflow is activated
code_hash: 254166977ea09fe9d47202b97e9ab3e90bae00f8a02f4072c9d221a554e687ce
source_location: node_modules/n8n-nodes-base/dist/nodes/WorkflowTrigger/WorkflowTrigger.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.WorkflowTrigger = void 0;
  class WorkflowTrigger {
      constructor() {
          this.description = {
              displayName: 'Workflow Trigger',
              name: 'workflowTrigger',
              icon: 'fa:network-wired',
              group: ['trigger'],
              version: 1,
              description: 'Triggers based on various lifecycle events, like when a workflow is activated',
              eventTriggerDescription: '',
              mockManualExecution: true,
              activationMessage: 'Your workflow will now trigger executions on the event you have defined.',
              defaults: {
                  name: 'Workflow Trigger',
                  color: '#ff6d5a',
              },
              inputs: [],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Events',
                      name: 'events',
                      type: 'multiOptions',
                      required: true,
                      default: [],
                      description: `Specifies under which conditions an execution should happen:
  					<ul>
  						<li><b>Active Workflow Updated</b>: Triggers when this workflow is updated</li>
  						<li><b>Workflow Activated</b>: Triggers when this workflow is activated</li>
  					</ul>`,
                      options: [
                          {
                              name: 'Active Workflow Updated',
                              value: 'update',
                              description: 'Triggers when this workflow is updated',
                          },
                          {
                              name: 'Workflow Activated',
                              value: 'activate',
                              description: 'Triggers when this workflow is activated',
                          },
                      ],
                  },
              ],
          };
      }
      async trigger() {
          const events = this.getNodeParameter('events', []);
          const activationMode = this.getActivationMode();
          if (events.includes(activationMode)) {
              let event;
              if (activationMode === 'activate') {
                  event = 'Workflow activated';
              }
              if (activationMode === 'update') {
                  event = 'Workflow updated';
              }
              this.emit([
                  this.helpers.returnJsonArray([
                      { event, timestamp: new Date().toISOString(), workflow_id: this.getWorkflow().id },
                  ]),
              ]);
          }
          const manualTriggerFunction = async () => {
              this.emit([
                  this.helpers.returnJsonArray([
                      {
                          event: 'Manual execution',
                          timestamp: new Date().toISOString(),
                          workflow_id: this.getWorkflow().id,
                      },
                  ]),
              ]);
          };
          return {
              manualTriggerFunction,
          };
      }
  }
  exports.WorkflowTrigger = WorkflowTrigger;
  //# sourceMappingURL=WorkflowTrigger.node.js.map

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


node_type: n8n-nodes-base.WriteBinaryFile
name: WriteBinaryFile
package_name: n8n-nodes-base
display_name: Write Binary File
description: Writes a binary file to disk
code_hash: 20162b6ab682660dc6c2229e1af0ac916ec38d2570006eaf9b0b6df2be10f946
source_location: node_modules/n8n-nodes-base/dist/nodes/WriteBinaryFile/WriteBinaryFile.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.WriteBinaryFile = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  class WriteBinaryFile {
      constructor() {
          this.description = {
              displayName: 'Write Binary File',
              name: 'writeBinaryFile',
              icon: 'fa:file-export',
              group: ['output'],
              version: 1,
              description: 'Writes a binary file to disk',
              defaults: {
                  name: 'Write Binary File',
                  color: '#CC2233',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'File Name',
                      name: 'fileName',
                      type: 'string',
                      default: '',
                      required: true,
                      placeholder: '/data/example.jpg',
                      description: 'Path to which the file should be written',
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      default: 'data',
                      required: true,
                      description: 'Name of the binary property which contains the data for the file to be written',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      default: {},
                      options: [
                          {
                              displayName: 'Append',
                              name: 'append',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to append to an existing file',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          let item;
          for (let itemIndex = 0; itemIndex < length; itemIndex++) {
              try {
                  const dataPropertyName = this.getNodeParameter('dataPropertyName', itemIndex);
                  const fileName = this.getNodeParameter('fileName', itemIndex);
                  const options = this.getNodeParameter('options', 0, {});
                  const flag = options.append ? 'a' : 'w';
                  item = items[itemIndex];
                  const newItem = {
                      json: {},
                      pairedItem: {
                          item: itemIndex,
                      },
                  };
                  Object.assign(newItem.json, item.json);
                  const binaryData = this.helpers.assertBinaryData(itemIndex, dataPropertyName);
                  let fileContent;
                  if (binaryData.id) {
                      fileContent = await this.helpers.getBinaryStream(binaryData.id);
                  }
                  else {
                      fileContent = Buffer.from(binaryData.data, n8n_workflow_1.BINARY_ENCODING);
                  }
                  await this.helpers.writeContentToFile(fileName, fileContent, flag);
                  if (item.binary !== undefined) {
                      newItem.binary = {};
                      Object.assign(newItem.binary, item.binary);
                  }
                  newItem.json.fileName = fileName;
                  returnData.push(newItem);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.WriteBinaryFile = WriteBinaryFile;
  //# sourceMappingURL=WriteBinaryFile.node.js.map

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


node_type: n8n-nodes-base.Xero
name: Xero
package_name: n8n-nodes-base
display_name: Xero
description: Consume Xero API
code_hash: aba95b820352106355fa38f55f10b5075b9568611f3b9bb24eb9473d6bbe146b
source_location: node_modules/n8n-nodes-base/dist/nodes/Xero/Xero.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Xero = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const InvoiceDescription_1 = require("./InvoiceDescription");
  const ContactDescription_1 = require("./ContactDescription");
  class Xero {
      constructor() {
          this.description = {
              displayName: 'Xero',
              name: 'xero',
              icon: 'file:xero.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Xero API',
              defaults: {
                  name: 'Xero',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'xeroOAuth2Api',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Contact',
                              value: 'contact',
                          },
                          {
                              name: 'Invoice',
                              value: 'invoice',
                          },
                      ],
                      default: 'invoice',
                  },
                  ...ContactDescription_1.contactOperations,
                  ...ContactDescription_1.contactFields,
                  ...InvoiceDescription_1.invoiceOperations,
                  ...InvoiceDescription_1.invoiceFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getItemCodes() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { Items: items } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/items', {
                          organizationId,
                      });
                      for (const item of items) {
                          const itemName = item.Description;
                          const itemId = item.Code;
                          returnData.push({
                              name: itemName,
                              value: itemId,
                          });
                      }
                      return returnData;
                  },
                  async getAccountCodes() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { Accounts: accounts } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Accounts', {
                          organizationId,
                      });
                      for (const account of accounts) {
                          const accountName = account.Name;
                          const accountId = account.Code;
                          returnData.push({
                              name: accountName,
                              value: accountId,
                          });
                      }
                      return returnData;
                  },
                  async getTenants() {
                      const returnData = [];
                      const tenants = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '', {}, {}, 'https://api.xero.com/connections');
                      for (const tenant of tenants) {
                          const tenantName = tenant.tenantName;
                          const tenantId = tenant.tenantId;
                          returnData.push({
                              name: tenantName,
                              value: tenantId,
                          });
                      }
                      return returnData;
                  },
                  async getBrandingThemes() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { BrandingThemes: themes } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/BrandingThemes', { organizationId });
                      for (const theme of themes) {
                          const themeName = theme.Name;
                          const themeId = theme.BrandingThemeID;
                          returnData.push({
                              name: themeName,
                              value: themeId,
                          });
                      }
                      return returnData;
                  },
                  async getCurrencies() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { Currencies: currencies } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Currencies', {
                          organizationId,
                      });
                      for (const currency of currencies) {
                          const currencyName = currency.Code;
                          const currencyId = currency.Description;
                          returnData.push({
                              name: currencyName,
                              value: currencyId,
                          });
                      }
                      return returnData;
                  },
                  async getTrakingCategories() {
                      const organizationId = this.getCurrentNodeParameter('organizationId');
                      const returnData = [];
                      const { TrackingCategories: categories } = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/TrackingCategories', { organizationId });
                      for (const category of categories) {
                          const categoryName = category.Name;
                          const categoryId = category.TrackingCategoryID;
                          returnData.push({
                              name: categoryName,
                              value: categoryId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          for (let i = 0; i < length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', 0);
                  const operation = this.getNodeParameter('operation', 0);
                  if (resource === 'invoice') {
                      if (operation === 'create') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const type = this.getNodeParameter('type', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          const lineItemsValues = this.getNodeParameter('lineItemsUi', i)
                              .lineItemsValues;
                          const body = {
                              organizationId,
                              Type: type,
                              Contact: { ContactID: contactId },
                          };
                          if (lineItemsValues) {
                              const lineItems = [];
                              for (const lineItemValue of lineItemsValues) {
                                  const lineItem = {
                                      Tracking: [],
                                  };
                                  lineItem.AccountCode = lineItemValue.accountCode;
                                  lineItem.Description = lineItemValue.description;
                                  lineItem.DiscountRate = lineItemValue.discountRate;
                                  lineItem.ItemCode = lineItemValue.itemCode;
                                  lineItem.LineAmount = lineItemValue.lineAmount;
                                  lineItem.Quantity = lineItemValue.quantity.toString();
                                  lineItem.TaxAmount = lineItemValue.taxAmount;
                                  lineItem.TaxType = lineItemValue.taxType;
                                  lineItem.UnitAmount = lineItemValue.unitAmount;
                                  lineItems.push(lineItem);
                              }
                              body.LineItems = lineItems;
                          }
                          if (additionalFields.brandingThemeId) {
                              body.BrandingThemeID = additionalFields.brandingThemeId;
                          }
                          if (additionalFields.currency) {
                              body.CurrencyCode = additionalFields.currency;
                          }
                          if (additionalFields.currencyRate) {
                              body.CurrencyRate = additionalFields.currencyRate;
                          }
                          if (additionalFields.date) {
                              body.Date = additionalFields.date;
                          }
                          if (additionalFields.dueDate) {
                              body.DueDate = additionalFields.dueDate;
                          }
                          if (additionalFields.dueDate) {
                              body.DueDate = additionalFields.dueDate;
                          }
                          if (additionalFields.expectedPaymentDate) {
                              body.ExpectedPaymentDate = additionalFields.expectedPaymentDate;
                          }
                          if (additionalFields.invoiceNumber) {
                              body.InvoiceNumber = additionalFields.invoiceNumber;
                          }
                          if (additionalFields.lineAmountType) {
                              body.LineAmountTypes = additionalFields.lineAmountType;
                          }
                          if (additionalFields.plannedPaymentDate) {
                              body.PlannedPaymentDate = additionalFields.plannedPaymentDate;
                          }
                          if (additionalFields.reference) {
                              body.Reference = additionalFields.reference;
                          }
                          if (additionalFields.sendToContact) {
                              body.SentToContact = additionalFields.sendToContact;
                          }
                          if (additionalFields.status) {
                              body.Status = additionalFields.status;
                          }
                          if (additionalFields.url) {
                              body.Url = additionalFields.url;
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', '/Invoices', body);
                          responseData = responseData.Invoices;
                      }
                      if (operation === 'update') {
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {
                              organizationId,
                          };
                          if (updateFields.lineItemsUi) {
                              const lineItemsValues = updateFields.lineItemsUi
                                  .lineItemsValues;
                              if (lineItemsValues) {
                                  const lineItems = [];
                                  for (const lineItemValue of lineItemsValues) {
                                      const lineItem = {
                                          Tracking: [],
                                      };
                                      lineItem.AccountCode = lineItemValue.accountCode;
                                      lineItem.Description = lineItemValue.description;
                                      lineItem.DiscountRate = lineItemValue.discountRate;
                                      lineItem.ItemCode = lineItemValue.itemCode;
                                      lineItem.LineAmount = lineItemValue.lineAmount;
                                      lineItem.Quantity = lineItemValue.quantity.toString();
                                      lineItem.TaxAmount = lineItemValue.taxAmount;
                                      lineItem.TaxType = lineItemValue.taxType;
                                      lineItem.UnitAmount = lineItemValue.unitAmount;
                                      lineItems.push(lineItem);
                                  }
                                  body.LineItems = lineItems;
                              }
                          }
                          if (updateFields.type) {
                              body.Type = updateFields.type;
                          }
                          if (updateFields.Contact) {
                              body.Contact = { ContactID: updateFields.contactId };
                          }
                          if (updateFields.brandingThemeId) {
                              body.BrandingThemeID = updateFields.brandingThemeId;
                          }
                          if (updateFields.currency) {
                              body.CurrencyCode = updateFields.currency;
                          }
                          if (updateFields.currencyRate) {
                              body.CurrencyRate = updateFields.currencyRate;
                          }
                          if (updateFields.date) {
                              body.Date = updateFields.date;
                          }
                          if (updateFields.dueDate) {
                              body.DueDate = updateFields.dueDate;
                          }
                          if (updateFields.dueDate) {
                              body.DueDate = updateFields.dueDate;
                          }
                          if (updateFields.expectedPaymentDate) {
                              body.ExpectedPaymentDate = updateFields.expectedPaymentDate;
                          }
                          if (updateFields.invoiceNumber) {
                              body.InvoiceNumber = updateFields.invoiceNumber;
                          }
                          if (updateFields.lineAmountType) {
                              body.LineAmountTypes = updateFields.lineAmountType;
                          }
                          if (updateFields.plannedPaymentDate) {
                              body.PlannedPaymentDate = updateFields.plannedPaymentDate;
                          }
                          if (updateFields.reference) {
                              body.Reference = updateFields.reference;
                          }
                          if (updateFields.sendToContact) {
                              body.SentToContact = updateFields.sendToContact;
                          }
                          if (updateFields.status) {
                              body.Status = updateFields.status;
                          }
                          if (updateFields.url) {
                              body.Url = updateFields.url;
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', `/Invoices/${invoiceId}`, body);
                          responseData = responseData.Invoices;
                      }
                      if (operation === 'get') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const invoiceId = this.getNodeParameter('invoiceId', i);
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', `/Invoices/${invoiceId}`, {
                              organizationId,
                          });
                          responseData = responseData.Invoices;
                      }
                      if (operation === 'getAll') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.statuses) {
                              qs.statuses = options.statuses.join(',');
                          }
                          if (options.orderBy) {
                              qs.order = `${options.orderBy} ${options.sortOrder === undefined ? 'DESC' : options.sortOrder}`;
                          }
                          if (options.where) {
                              qs.where = options.where;
                          }
                          if (options.createdByMyApp) {
                              qs.createdByMyApp = options.createdByMyApp;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.xeroApiRequestAllItems.call(this, 'Invoices', 'GET', '/Invoices', { organizationId }, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Invoices', { organizationId }, qs);
                              responseData = responseData.Invoices;
                              responseData = responseData.splice(0, limit);
                          }
                      }
                  }
                  if (resource === 'contact') {
                      if (operation === 'create') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const addressesUi = additionalFields.addressesUi;
                          const phonesUi = additionalFields.phonesUi;
                          const body = {
                              Name: name,
                          };
                          if (additionalFields.accountNumber) {
                              body.AccountNumber = additionalFields.accountNumber;
                          }
                          if (additionalFields.bankAccountDetails) {
                              body.BankAccountDetails = additionalFields.bankAccountDetails;
                          }
                          if (additionalFields.contactNumber) {
                              body.ContactNumber = additionalFields.contactNumber;
                          }
                          if (additionalFields.contactStatus) {
                              body.ContactStatus = additionalFields.contactStatus;
                          }
                          if (additionalFields.defaultCurrency) {
                              body.DefaultCurrency = additionalFields.defaultCurrency;
                          }
                          if (additionalFields.emailAddress) {
                              body.EmailAddress = additionalFields.emailAddress;
                          }
                          if (additionalFields.firstName) {
                              body.FirstName = additionalFields.firstName;
                          }
                          if (additionalFields.lastName) {
                              body.LastName = additionalFields.lastName;
                          }
                          if (additionalFields.purchasesDefaultAccountCode) {
                              body.PurchasesDefaultAccountCode =
                                  additionalFields.purchasesDefaultAccountCode;
                          }
                          if (additionalFields.salesDefaultAccountCode) {
                              body.SalesDefaultAccountCode = additionalFields.salesDefaultAccountCode;
                          }
                          if (additionalFields.skypeUserName) {
                              body.SkypeUserName = additionalFields.skypeUserName;
                          }
                          if (additionalFields.taxNumber) {
                              body.taxNumber = additionalFields.taxNumber;
                          }
                          if (additionalFields.xeroNetworkKey) {
                              body.xeroNetworkKey = additionalFields.xeroNetworkKey;
                          }
                          if (phonesUi) {
                              const phoneValues = phonesUi === null || phonesUi === void 0 ? void 0 : phonesUi.phonesValues;
                              if (phoneValues) {
                                  const phones = [];
                                  for (const phoneValue of phoneValues) {
                                      const phone = {};
                                      phone.PhoneType = phoneValue.phoneType;
                                      phone.PhoneNumber = phoneValue.phoneNumber;
                                      phone.PhoneAreaCode = phoneValue.phoneAreaCode;
                                      phone.PhoneCountryCode = phoneValue.phoneCountryCode;
                                      phones.push(phone);
                                  }
                                  body.Phones = phones;
                              }
                          }
                          if (addressesUi) {
                              const addressValues = addressesUi === null || addressesUi === void 0 ? void 0 : addressesUi.addressesValues;
                              if (addressValues) {
                                  const addresses = [];
                                  for (const addressValue of addressValues) {
                                      const address = {};
                                      address.AddressType = addressValue.type;
                                      address.AddressLine1 = addressValue.line1;
                                      address.AddressLine2 = addressValue.line2;
                                      address.City = addressValue.city;
                                      address.Region = addressValue.region;
                                      address.PostalCode = addressValue.postalCode;
                                      address.Country = addressValue.country;
                                      address.AttentionTo = addressValue.attentionTo;
                                      addresses.push(address);
                                  }
                                  body.Addresses = addresses;
                              }
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', '/Contacts', {
                              organizationId,
                              Contacts: [body],
                          });
                          responseData = responseData.Contacts;
                      }
                      if (operation === 'get') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', `/Contacts/${contactId}`, {
                              organizationId,
                          });
                          responseData = responseData.Contacts;
                      }
                      if (operation === 'getAll') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          if (options.includeArchived) {
                              qs.includeArchived = options.includeArchived;
                          }
                          if (options.orderBy) {
                              qs.order = `${options.orderBy} ${options.sortOrder === undefined ? 'DESC' : options.sortOrder}`;
                          }
                          if (options.where) {
                              qs.where = options.where;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.xeroApiRequestAllItems.call(this, 'Contacts', 'GET', '/Contacts', { organizationId }, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'GET', '/Contacts', { organizationId }, qs);
                              responseData = responseData.Contacts;
                              responseData = responseData.splice(0, limit);
                          }
                      }
                      if (operation === 'update') {
                          const organizationId = this.getNodeParameter('organizationId', i);
                          const contactId = this.getNodeParameter('contactId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const addressesUi = updateFields.addressesUi;
                          const phonesUi = updateFields.phonesUi;
                          const body = {};
                          if (updateFields.accountNumber) {
                              body.AccountNumber = updateFields.accountNumber;
                          }
                          if (updateFields.name) {
                              body.Name = updateFields.name;
                          }
                          if (updateFields.bankAccountDetails) {
                              body.BankAccountDetails = updateFields.bankAccountDetails;
                          }
                          if (updateFields.contactNumber) {
                              body.ContactNumber = updateFields.contactNumber;
                          }
                          if (updateFields.contactStatus) {
                              body.ContactStatus = updateFields.contactStatus;
                          }
                          if (updateFields.defaultCurrency) {
                              body.DefaultCurrency = updateFields.defaultCurrency;
                          }
                          if (updateFields.emailAddress) {
                              body.EmailAddress = updateFields.emailAddress;
                          }
                          if (updateFields.firstName) {
                              body.FirstName = updateFields.firstName;
                          }
                          if (updateFields.lastName) {
                              body.LastName = updateFields.lastName;
                          }
                          if (updateFields.purchasesDefaultAccountCode) {
                              body.PurchasesDefaultAccountCode = updateFields.purchasesDefaultAccountCode;
                          }
                          if (updateFields.salesDefaultAccountCode) {
                              body.SalesDefaultAccountCode = updateFields.salesDefaultAccountCode;
                          }
                          if (updateFields.skypeUserName) {
                              body.SkypeUserName = updateFields.skypeUserName;
                          }
                          if (updateFields.taxNumber) {
                              body.taxNumber = updateFields.taxNumber;
                          }
                          if (updateFields.xeroNetworkKey) {
                              body.xeroNetworkKey = updateFields.xeroNetworkKey;
                          }
                          if (phonesUi) {
                              const phoneValues = phonesUi === null || phonesUi === void 0 ? void 0 : phonesUi.phonesValues;
                              if (phoneValues) {
                                  const phones = [];
                                  for (const phoneValue of phoneValues) {
                                      const phone = {};
                                      phone.PhoneType = phoneValue.phoneType;
                                      phone.PhoneNumber = phoneValue.phoneNumber;
                                      phone.PhoneAreaCode = phoneValue.phoneAreaCode;
                                      phone.PhoneCountryCode = phoneValue.phoneCountryCode;
                                      phones.push(phone);
                                  }
                                  body.Phones = phones;
                              }
                          }
                          if (addressesUi) {
                              const addressValues = addressesUi === null || addressesUi === void 0 ? void 0 : addressesUi.addressesValues;
                              if (addressValues) {
                                  const addresses = [];
                                  for (const addressValue of addressValues) {
                                      const address = {};
                                      address.AddressType = addressValue.type;
                                      address.AddressLine1 = addressValue.line1;
                                      address.AddressLine2 = addressValue.line2;
                                      address.City = addressValue.city;
                                      address.Region = addressValue.region;
                                      address.PostalCode = addressValue.postalCode;
                                      address.Country = addressValue.country;
                                      address.AttentionTo = addressValue.attentionTo;
                                      addresses.push(address);
                                  }
                                  body.Addresses = addresses;
                              }
                          }
                          responseData = await GenericFunctions_1.xeroApiRequest.call(this, 'POST', `/Contacts/${contactId}`, {
                              organizationId,
                              Contacts: [body],
                          });
                          responseData = responseData.Contacts;
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Xero = Xero;
  //# sourceMappingURL=Xero.node.js.map

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


node_type: n8n-nodes-base.Xml
name: Xml
package_name: n8n-nodes-base
display_name: XML
description: Convert data from and to XML
code_hash: 09aee64eeb21c4566e8cd0c36ea6ba97e480c62938dc579228fb1b60c842f65b
source_location: node_modules/n8n-nodes-base/dist/nodes/Xml/Xml.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Xml = void 0;
  const xml2js_1 = require("xml2js");
  const n8n_workflow_1 = require("n8n-workflow");
  class Xml {
      constructor() {
          this.description = {
              displayName: 'XML',
              name: 'xml',
              icon: 'fa:file-code',
              group: ['transform'],
              version: 1,
              subtitle: '={{$parameter["mode"]==="jsonToxml" ? "JSON to XML" : "XML to JSON"}}',
              description: 'Convert data from and to XML',
              defaults: {
                  name: 'XML',
                  color: '#333377',
              },
              inputs: ['main'],
              outputs: ['main'],
              properties: [
                  {
                      displayName: 'Mode',
                      name: 'mode',
                      type: 'options',
                      options: [
                          {
                              name: 'JSON to XML',
                              value: 'jsonToxml',
                              description: 'Converts data from JSON to XML',
                          },
                          {
                              name: 'XML to JSON',
                              value: 'xmlToJson',
                              description: 'Converts data from XML to JSON',
                          },
                      ],
                      default: 'xmlToJson',
                      description: 'From and to what format the data should be converted',
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['jsonToxml'],
                          },
                      },
                      default: 'data',
                      required: true,
                      description: 'Name of the property to which to contains the converted XML data',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      displayOptions: {
                          show: {
                              mode: ['jsonToxml'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Allow Surrogate Chars',
                              name: 'allowSurrogateChars',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to allow using characters from the Unicode surrogate blocks',
                          },
                          {
                              displayName: 'Attribute Key',
                              name: 'attrkey',
                              type: 'string',
                              default: '$',
                              description: 'Prefix that is used to access the attributes',
                          },
                          {
                              displayName: 'Cdata',
                              name: 'cdata',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to wrap text nodes in &lt;![CDATA[ ... ]]&gt; instead of escaping when necessary. Does not add &lt;![CDATA[ ... ]]&gt; if it is not required.',
                          },
                          {
                              displayName: 'Character Key',
                              name: 'charkey',
                              type: 'string',
                              default: '_',
                              description: 'Prefix that is used to access the character content',
                          },
                          {
                              displayName: 'Headless',
                              name: 'headless',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to omit the XML header',
                          },
                          {
                              displayName: 'Root Name',
                              name: 'rootName',
                              type: 'string',
                              default: 'root',
                              description: 'Root element name to be used',
                          },
                      ],
                  },
                  {
                      displayName: 'Property Name',
                      name: 'dataPropertyName',
                      type: 'string',
                      displayOptions: {
                          show: {
                              mode: ['xmlToJson'],
                          },
                      },
                      default: 'data',
                      required: true,
                      description: 'Name of the property which contains the XML data to convert',
                  },
                  {
                      displayName: 'Options',
                      name: 'options',
                      type: 'collection',
                      placeholder: 'Add Option',
                      displayOptions: {
                          show: {
                              mode: ['xmlToJson'],
                          },
                      },
                      default: {},
                      options: [
                          {
                              displayName: 'Attribute Key',
                              name: 'attrkey',
                              type: 'string',
                              default: '$',
                              description: 'Prefix that is used to access the attributes',
                          },
                          {
                              displayName: 'Character Key',
                              name: 'charkey',
                              type: 'string',
                              default: '_',
                              description: 'Prefix that is used to access the character content',
                          },
                          {
                              displayName: 'Explicit Array',
                              name: 'explicitArray',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to always put child nodes in an array if true; otherwise an array is created only if there is more than one',
                          },
                          {
                              displayName: 'Explicit Root',
                              name: 'explicitRoot',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to set this if you want to get the root node in the resulting object',
                          },
                          {
                              displayName: 'Ignore Attributes',
                              name: 'ignoreAttrs',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to ignore all XML attributes and only create text nodes',
                          },
                          {
                              displayName: 'Merge Attributes',
                              name: 'mergeAttrs',
                              type: 'boolean',
                              default: true,
                              description: 'Whether to merge attributes and child elements as properties of the parent, instead of keying attributes off a child attribute object. This option is ignored if ignoreAttrs is true.',
                          },
                          {
                              displayName: 'Normalize',
                              name: 'normalize',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to trim whitespaces inside text nodes',
                          },
                          {
                              displayName: 'Normalize Tags',
                              name: 'normalizeTags',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to normalize all tag names to lowercase',
                          },
                          {
                              displayName: 'Trim',
                              name: 'trim',
                              type: 'boolean',
                              default: false,
                              description: 'Whether to trim the whitespace at the beginning and end of text nodes',
                          },
                      ],
                  },
              ],
          };
      }
      async execute() {
          const items = this.getInputData();
          const mode = this.getNodeParameter('mode', 0);
          const dataPropertyName = this.getNodeParameter('dataPropertyName', 0);
          const options = this.getNodeParameter('options', 0, {});
          let item;
          const returnData = [];
          for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
              try {
                  item = items[itemIndex];
                  if (mode === 'xmlToJson') {
                      const parserOptions = Object.assign({
                          mergeAttrs: true,
                          explicitArray: false,
                      }, options);
                      const parser = new xml2js_1.Parser(parserOptions);
                      if (item.json[dataPropertyName] === undefined) {
                          throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Item has no JSON property called "${dataPropertyName}"`, { itemIndex });
                      }
                      const json = await parser.parseStringPromise(item.json[dataPropertyName]);
                      returnData.push({ json: (0, n8n_workflow_1.deepCopy)(json) });
                  }
                  else if (mode === 'jsonToxml') {
                      const builder = new xml2js_1.Builder(options);
                      returnData.push({
                          json: {
                              [dataPropertyName]: builder.buildObject(items[itemIndex].json),
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      });
                  }
                  else {
                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${mode}" is not known!`, {
                          itemIndex,
                      });
                  }
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      items[itemIndex] = {
                          json: {
                              error: error.message,
                          },
                          pairedItem: {
                              item: itemIndex,
                          },
                      };
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Xml = Xml;
  //# sourceMappingURL=Xml.node.js.map

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


node_type: n8n-nodes-base.Yourls
name: Yourls
package_name: n8n-nodes-base
display_name: Yourls
description: Consume Yourls API
code_hash: f151d26502f0f4c7287ac076071905adcc0d2dded190cf040d5bebe6d06a2cf9
source_location: node_modules/n8n-nodes-base/dist/nodes/Yourls/Yourls.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Yourls = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const UrlDescription_1 = require("./UrlDescription");
  class Yourls {
      constructor() {
          this.description = {
              displayName: 'Yourls',
              name: 'yourls',
              icon: 'file:yourls.png',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Yourls API',
              defaults: {
                  name: 'Yourls',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'yourlsApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'URL',
                              value: 'url',
                          },
                      ],
                      default: 'url',
                  },
                  ...UrlDescription_1.urlOperations,
                  ...UrlDescription_1.urlFields,
              ],
          };
      }
      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 === 'url') {
                      if (operation === 'shorten') {
                          const url = this.getNodeParameter('url', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          qs.url = url;
                          qs.action = 'shorturl';
                          Object.assign(qs, additionalFields);
                          responseData = await GenericFunctions_1.yourlsApiRequest.call(this, 'GET', {}, qs);
                      }
                      if (operation === 'expand') {
                          const shortUrl = this.getNodeParameter('shortUrl', i);
                          qs.shorturl = shortUrl;
                          qs.action = 'expand';
                          responseData = await GenericFunctions_1.yourlsApiRequest.call(this, 'GET', {}, qs);
                      }
                      if (operation === 'stats') {
                          const shortUrl = this.getNodeParameter('shortUrl', i);
                          qs.shorturl = shortUrl;
                          qs.action = 'url-stats';
                          responseData = await GenericFunctions_1.yourlsApiRequest.call(this, 'GET', {}, qs);
                          responseData = responseData.link;
                      }
                  }
                  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.Yourls = Yourls;
  //# sourceMappingURL=Yourls.node.js.map

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


node_type: n8n-nodes-base.Zammad
name: Zammad
package_name: n8n-nodes-base
display_name: Zammad
description: Consume the Zammad API
code_hash: e36ae4ec17e8db702c4d105e9179bc5068a484ceaf7033667c28278b5edf87b8
source_location: node_modules/n8n-nodes-base/dist/nodes/Zammad/Zammad.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zammad = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const descriptions_1 = require("./descriptions");
  const GenericFunctions_1 = require("./GenericFunctions");
  class Zammad {
      constructor() {
          this.description = {
              displayName: 'Zammad',
              name: 'zammad',
              icon: 'file:zammad.svg',
              group: ['input'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume the Zammad API',
              defaults: {
                  name: 'Zammad',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zammadBasicAuthApi',
                      required: true,
                      testedBy: 'zammadBasicAuthApiTest',
                      displayOptions: {
                          show: {
                              authentication: ['basicAuth'],
                          },
                      },
                  },
                  {
                      name: 'zammadTokenAuthApi',
                      required: true,
                      testedBy: 'zammadTokenAuthApiTest',
                      displayOptions: {
                          show: {
                              authentication: ['tokenAuth'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'Basic Auth',
                              value: 'basicAuth',
                          },
                          {
                              name: 'Token Auth',
                              value: 'tokenAuth',
                          },
                      ],
                      default: 'tokenAuth',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      noDataExpression: true,
                      type: 'options',
                      options: [
                          {
                              name: 'Group',
                              value: 'group',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                          },
                          {
                              name: 'Ticket',
                              value: 'ticket',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'user',
                  },
                  ...descriptions_1.groupDescription,
                  ...descriptions_1.organizationDescription,
                  ...descriptions_1.ticketDescription,
                  ...descriptions_1.userDescription,
              ],
          };
          this.methods = {
              loadOptions: {
                  async loadGroupCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getGroupCustomFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadOrganizationCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getOrganizationCustomFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadUserCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getUserCustomFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadTicketCustomFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getTicketCustomFields)(allFields).map((i) => ({ name: i.name, value: i.id }));
                  },
                  async loadGroupFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getGroupFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadOrganizationFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getOrganizationFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadTicketFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getTicketFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadUserFields() {
                      const allFields = await GenericFunctions_1.getAllFields.call(this);
                      return (0, GenericFunctions_1.getUserFields)(allFields).map(GenericFunctions_1.fieldToLoadOption);
                  },
                  async loadGroupNames() {
                      const groups = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/groups'));
                      return groups.map((i) => ({ name: i.name, value: i.name }));
                  },
                  async loadOrganizationNames() {
                      const orgs = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/organizations'));
                      return orgs.filter(GenericFunctions_1.isNotZammadFoundation).map((i) => ({ name: i.name, value: i.name }));
                  },
                  async loadCustomerEmails() {
                      const users = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/users'));
                      return users.filter(GenericFunctions_1.isCustomer).map((i) => ({ name: i.email, value: i.email }));
                  },
                  async loadGroups() {
                      const groups = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/groups'));
                      return groups.map((i) => ({ name: i.name, value: i.id }));
                  },
                  async loadOrganizations() {
                      const orgs = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/organizations'));
                      return orgs.filter(GenericFunctions_1.isNotZammadFoundation).map((i) => ({ name: i.name, value: i.id }));
                  },
                  async loadUsers() {
                      const users = (await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/users'));
                      return users.filter(GenericFunctions_1.doesNotBelongToZammad).map((i) => ({ name: i.login, value: i.id }));
                  },
              },
              credentialTest: {
                  async zammadBasicAuthApiTest(credential) {
                      const credentials = credential.data;
                      const baseUrl = (0, GenericFunctions_1.tolerateTrailingSlash)(credentials.baseUrl);
                      const options = {
                          method: 'GET',
                          uri: `${baseUrl}/api/v1/users/me`,
                          json: true,
                          rejectUnauthorized: !credentials.allowUnauthorizedCerts,
                          auth: {
                              user: credentials.username,
                              pass: credentials.password,
                          },
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
                  async zammadTokenAuthApiTest(credential) {
                      const credentials = credential.data;
                      const baseUrl = (0, GenericFunctions_1.tolerateTrailingSlash)(credentials.baseUrl);
                      const options = {
                          method: 'GET',
                          uri: `${baseUrl}/api/v1/users/me`,
                          json: true,
                          rejectUnauthorized: !credentials.allowUnauthorizedCerts,
                          headers: {
                              Authorization: `Token token=${credentials.accessToken}`,
                          },
                      };
                      try {
                          await this.helpers.request(options);
                          return {
                              status: 'OK',
                              message: 'Authentication successful',
                          };
                      }
                      catch (error) {
                          return {
                              status: 'Error',
                              message: error.message,
                          };
                      }
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          let responseData;
          const returnData = [];
          for (let i = 0; i < items.length; i++) {
              try {
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const body = {
                              firstname: this.getNodeParameter('firstname', i),
                              lastname: this.getNodeParameter('lastname', i),
                          };
                          const { addressUi, customFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, addressUi === null || addressUi === void 0 ? void 0 : addressUi.addressDetails);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/users', body);
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { addressUi, customFieldsUi, ...rest } = updateFields;
                          Object.assign(body, addressUi === null || addressUi === void 0 ? void 0 : addressUi.addressDetails);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'PUT', `/users/${id}`, body);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/users/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/users/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const qs = {};
                          const { sortUi, ...rest } = this.getNodeParameter('filters', i);
                          Object.assign(qs, sortUi === null || sortUi === void 0 ? void 0 : sortUi.sortDetails);
                          Object.assign(qs, rest);
                          qs.query || (qs.query = '');
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems
                              .call(this, 'GET', '/users/search', {}, qs, limit)
                              .then((response) => {
                              return response.map((user) => {
                                  const { _preferences, ...data } = user;
                                  return data;
                              });
                          });
                      }
                      else if (operation === 'getSelf') {
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', '/users/me');
                      }
                  }
                  else if (resource === 'organization') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const { customFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/organizations', body);
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { customFieldsUi, ...rest } = updateFields;
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'PUT', `/organizations/${id}`, body);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/organizations/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/organizations/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems.call(this, 'GET', '/organizations', {}, {}, limit);
                      }
                  }
                  else if (resource === 'group') {
                      if (operation === 'create') {
                          const body = {
                              name: this.getNodeParameter('name', i),
                          };
                          const { customFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/groups', body);
                      }
                      else if (operation === 'update') {
                          const id = this.getNodeParameter('id', i);
                          const body = {};
                          const updateFields = this.getNodeParameter('updateFields', i);
                          if (!Object.keys(updateFields).length) {
                              GenericFunctions_1.throwOnEmptyUpdate.call(this, resource);
                          }
                          const { customFieldsUi, ...rest } = updateFields;
                          customFieldsUi === null || customFieldsUi === void 0 ? void 0 : customFieldsUi.customFieldPairs.forEach((pair) => {
                              body[pair.name] = pair.value;
                          });
                          Object.assign(body, rest);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'PUT', `/groups/${id}`, body);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/groups/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/groups/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems.call(this, 'GET', '/groups', {}, {}, limit);
                      }
                  }
                  else if (resource === 'ticket') {
                      if (operation === 'create') {
                          const body = {
                              article: {},
                              title: this.getNodeParameter('title', i),
                              group: this.getNodeParameter('group', i),
                              customer: this.getNodeParameter('customer', i),
                          };
                          const article = this.getNodeParameter('article', i);
                          if (!Object.keys(article).length) {
                              throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Article is required', { itemIndex: i });
                          }
                          const { articleDetails: { visibility, ...rest }, } = article;
                          body.article = {
                              ...rest,
                              internal: visibility === 'internal',
                          };
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'POST', '/tickets', body);
                          const { id } = responseData;
                          responseData.articles = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/ticket_articles/by_ticket/${id}`);
                      }
                      else if (operation === 'delete') {
                          const id = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zammadApiRequest.call(this, 'DELETE', `/tickets/${id}`);
                          responseData = { success: true };
                      }
                      else if (operation === 'get') {
                          const id = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/tickets/${id}`);
                          responseData.articles = await GenericFunctions_1.zammadApiRequest.call(this, 'GET', `/ticket_articles/by_ticket/${id}`);
                      }
                      else if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const limit = returnAll ? 0 : this.getNodeParameter('limit', i);
                          responseData = await GenericFunctions_1.zammadApiRequestAllItems.call(this, 'GET', '/tickets', {}, {}, limit);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zammad = Zammad;
  //# sourceMappingURL=Zammad.node.js.map

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


node_type: n8n-nodes-base.Zendesk
name: Zendesk
package_name: n8n-nodes-base
display_name: Zendesk
description: Consume Zendesk API
code_hash: 88e68de64c851f4c26efadf449ffbca89eabfb9b4ccda678908be23fbabe14b8
source_location: node_modules/n8n-nodes-base/dist/nodes/Zendesk/Zendesk.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zendesk = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const TicketDescription_1 = require("./TicketDescription");
  const TicketFieldDescription_1 = require("./TicketFieldDescription");
  const UserDescription_1 = require("./UserDescription");
  const OrganizationDescription_1 = require("./OrganizationDescription");
  class Zendesk {
      constructor() {
          this.description = {
              displayName: 'Zendesk',
              name: 'zendesk',
              icon: 'file:zendesk.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Zendesk API',
              defaults: {
                  name: 'Zendesk',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zendeskApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['apiToken'],
                          },
                      },
                  },
                  {
                      name: 'zendeskOAuth2Api',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['oAuth2'],
                          },
                      },
                  },
              ],
              properties: [
                  {
                      displayName: 'Authentication',
                      name: 'authentication',
                      type: 'options',
                      options: [
                          {
                              name: 'API Token',
                              value: 'apiToken',
                          },
                          {
                              name: 'OAuth2',
                              value: 'oAuth2',
                          },
                      ],
                      default: 'apiToken',
                  },
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Ticket',
                              value: 'ticket',
                              description: 'Tickets are the means through which your end users (customers) communicate with agents in Zendesk Support',
                          },
                          {
                              name: 'Ticket Field',
                              value: 'ticketField',
                              description: 'Manage system and custom ticket fields',
                          },
                          {
                              name: 'User',
                              value: 'user',
                              description: 'Manage users',
                          },
                          {
                              name: 'Organization',
                              value: 'organization',
                              description: 'Manage organizations',
                          },
                      ],
                      default: 'ticket',
                  },
                  ...TicketDescription_1.ticketOperations,
                  ...TicketDescription_1.ticketFields,
                  ...TicketFieldDescription_1.ticketFieldOperations,
                  ...TicketFieldDescription_1.ticketFieldFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
                  ...OrganizationDescription_1.organizationOperations,
                  ...OrganizationDescription_1.organizationFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getCustomFields() {
                      const returnData = [];
                      const customFields = [
                          'text',
                          'textarea',
                          'date',
                          'integer',
                          'decimal',
                          'regexp',
                          'multiselect',
                          'tagger',
                      ];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'ticket_fields', 'GET', '/ticket_fields');
                      for (const field of fields) {
                          if (customFields.includes(field.type)) {
                              const fieldName = field.title;
                              const fieldId = field.id;
                              returnData.push({
                                  name: fieldName,
                                  value: fieldId,
                              });
                          }
                      }
                      return returnData;
                  },
                  async getGroups() {
                      const returnData = [];
                      const groups = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'groups', 'GET', '/groups');
                      for (const group of groups) {
                          const groupName = group.name;
                          const groupId = group.id;
                          returnData.push({
                              name: groupName,
                              value: groupId,
                          });
                      }
                      return returnData;
                  },
                  async getTags() {
                      const returnData = [];
                      const tags = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'tags', 'GET', '/tags');
                      for (const tag of tags) {
                          const tagName = tag.name;
                          const tagId = tag.name;
                          returnData.push({
                              name: tagName,
                              value: tagId,
                          });
                      }
                      return returnData;
                  },
                  async getLocales() {
                      const returnData = [];
                      const locales = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'locales', 'GET', '/locales');
                      for (const locale of locales) {
                          const localeName = `${locale.locale} - ${locale.name}`;
                          const localeId = locale.locale;
                          returnData.push({
                              name: localeName,
                              value: localeId,
                          });
                      }
                      return returnData;
                  },
                  async getUserFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'user_fields', 'GET', '/user_fields');
                      for (const field of fields) {
                          const fieldName = field.title;
                          const fieldId = field.key;
                          returnData.push({
                              name: fieldName,
                              value: fieldId,
                          });
                      }
                      return returnData;
                  },
                  async getOrganizationFields() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'organization_fields', 'GET', '/organization_fields');
                      for (const field of fields) {
                          const fieldName = field.title;
                          const fieldId = field.key;
                          returnData.push({
                              name: fieldName,
                              value: fieldId,
                          });
                      }
                      return returnData;
                  },
                  async getOrganizations() {
                      const returnData = [];
                      const fields = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'organizations', 'GET', '/organizations', {}, {});
                      for (const field of fields) {
                          returnData.push({
                              name: field.name,
                              value: field.id,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          const length = items.length;
          const qs = {};
          let responseData;
          for (let i = 0; i < length; i++) {
              try {
                  const resource = this.getNodeParameter('resource', 0);
                  const operation = this.getNodeParameter('operation', 0);
                  if (resource === 'ticket') {
                      if (operation === 'create') {
                          const description = this.getNodeParameter('description', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const comment = {
                              body: description,
                          };
                          const body = {
                              comment,
                          };
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.type) {
                                  body.type = additionalFields.type;
                              }
                              if (additionalFields.externalId) {
                                  body.external_id = additionalFields.externalId;
                              }
                              if (additionalFields.subject) {
                                  body.subject = additionalFields.subject;
                              }
                              if (additionalFields.status) {
                                  body.status = additionalFields.status;
                              }
                              if (additionalFields.recipient) {
                                  body.recipient = additionalFields.recipient;
                              }
                              if (additionalFields.group) {
                                  body.group_id = additionalFields.group;
                              }
                              if (additionalFields.tags) {
                                  body.tags = additionalFields.tags;
                              }
                              if (additionalFields.customFieldsUi) {
                                  body.custom_fields = additionalFields.customFieldsUi
                                      .customFieldsValues;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'POST', '/tickets', { ticket: body });
                          responseData = responseData.ticket;
                      }
                      if (operation === 'update') {
                          const ticketId = this.getNodeParameter('id', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const body = {};
                          if (jsonParameters) {
                              const updateFieldsJson = this.getNodeParameter('updateFieldsJson', i);
                              if (updateFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(updateFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(updateFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const updateFields = this.getNodeParameter('updateFields', i);
                              if (updateFields.type) {
                                  body.type = updateFields.type;
                              }
                              if (updateFields.externalId) {
                                  body.external_id = updateFields.externalId;
                              }
                              if (updateFields.subject) {
                                  body.subject = updateFields.subject;
                              }
                              if (updateFields.status) {
                                  body.status = updateFields.status;
                              }
                              if (updateFields.recipient) {
                                  body.recipient = updateFields.recipient;
                              }
                              if (updateFields.group) {
                                  body.group_id = updateFields.group;
                              }
                              if (updateFields.tags) {
                                  body.tags = updateFields.tags;
                              }
                              if (updateFields.customFieldsUi) {
                                  body.custom_fields = updateFields.customFieldsUi
                                      .customFieldsValues;
                              }
                              if (updateFields.assigneeEmail) {
                                  body.assignee_email = updateFields.assigneeEmail;
                              }
                              if (updateFields.internalNote) {
                                  const comment = {
                                      html_body: updateFields.internalNote,
                                      public: false,
                                  };
                                  body.comment = comment;
                              }
                              if (updateFields.publicReply) {
                                  const comment = {
                                      body: updateFields.publicReply,
                                      public: true,
                                  };
                                  body.comment = comment;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/tickets/${ticketId}`, {
                              ticket: body,
                          });
                          responseData = responseData.ticket;
                      }
                      if (operation === 'get') {
                          const ticketType = this.getNodeParameter('ticketType', i);
                          const ticketId = this.getNodeParameter('id', i);
                          const endpoint = ticketType === 'regular' ? `/tickets/${ticketId}` : `/suspended_tickets/${ticketId}`;
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', endpoint, {});
                          responseData = responseData.ticket || responseData.suspended_ticket;
                      }
                      if (operation === 'getAll') {
                          const ticketType = this.getNodeParameter('ticketType', i);
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('options', i);
                          qs.query = 'type:ticket';
                          if (options.query) {
                              qs.query += ` ${options.query}`;
                          }
                          if (options.status) {
                              qs.query += ` status:${options.status}`;
                          }
                          if (options.group) {
                              qs.query += ` group:${options.group}`;
                          }
                          if (options.sortBy) {
                              qs.sort_by = options.sortBy;
                          }
                          if (options.sortOrder) {
                              qs.sort_order = options.sortOrder;
                          }
                          const endpoint = ticketType === 'regular' ? '/search' : '/suspended_tickets';
                          const property = ticketType === 'regular' ? 'results' : 'suspended_tickets';
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, property, 'GET', endpoint, {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', endpoint, {}, qs);
                              responseData = responseData.results || responseData.suspended_tickets;
                          }
                      }
                      if (operation === 'delete') {
                          const ticketType = this.getNodeParameter('ticketType', i);
                          const ticketId = this.getNodeParameter('id', i);
                          const endpoint = ticketType === 'regular' ? `/tickets/${ticketId}` : `/suspended_tickets/${ticketId}`;
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'DELETE', endpoint, {});
                          responseData = { success: true };
                      }
                      if (operation === 'recover') {
                          const ticketId = this.getNodeParameter('id', i);
                          try {
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/suspended_tickets/${ticketId}/recover`, {});
                              responseData = responseData.ticket;
                          }
                          catch (error) {
                              throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
                          }
                      }
                  }
                  if (resource === 'ticketField') {
                      if (operation === 'get') {
                          const ticketFieldId = this.getNodeParameter('ticketFieldId', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/ticket_fields/${ticketFieldId}`, {});
                          responseData = responseData.ticket_field;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'ticket_fields', 'GET', '/ticket_fields', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.limit = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'ticket_fields', 'GET', '/ticket_fields', {}, qs);
                              responseData = responseData.slice(0, limit);
                          }
                      }
                  }
                  if (resource === 'user') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {
                              name,
                          };
                          Object.assign(body, additionalFields);
                          if (body.userFieldsUi) {
                              const userFieldsUI = body.userFieldsUi
                                  .userFieldValues;
                              if (userFieldsUI) {
                                  body.user_fields = {};
                                  for (const userField of userFieldsUI) {
                                      body.user_fields[userField.field] = userField.value;
                                  }
                                  delete body.userFieldsUi;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'POST', '/users', { user: body });
                          responseData = responseData.user;
                      }
                      if (operation === 'update') {
                          const userId = this.getNodeParameter('id', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          Object.assign(body, updateFields);
                          if (body.userFieldsUi) {
                              const userFieldsUI = body.userFieldsUi
                                  .userFieldValues;
                              if (userFieldsUI) {
                                  body.user_fields = {};
                                  for (const userField of userFieldsUI) {
                                      body.user_fields[userField.field] = userField.value;
                                  }
                                  delete body.userFieldsUi;
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/users/${userId}`, {
                              user: body,
                          });
                          responseData = responseData.user;
                      }
                      if (operation === 'get') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/users/${userId}`, {});
                          responseData = responseData.user;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('filters', i);
                          Object.assign(qs, options);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'users', 'GET', '/users', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/users', {}, qs);
                              responseData = responseData.users;
                          }
                      }
                      if (operation === 'getOrganizations') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/users/${userId}/organizations`, {});
                          responseData = responseData.organizations;
                      }
                      if (operation === 'search') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const options = this.getNodeParameter('filters', i);
                          Object.assign(qs, options);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'users', 'GET', '/users/search', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/users/search', {}, qs);
                              responseData = responseData.users;
                          }
                      }
                      if (operation === 'delete') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'DELETE', `/users/${userId}`, {});
                          responseData = responseData.user;
                      }
                      if (operation === 'getRelatedData') {
                          const userId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/users/${userId}/related`, {});
                          responseData = responseData.user_related;
                      }
                  }
                  if (resource === 'organization') {
                      if (operation === 'create') {
                          const name = this.getNodeParameter('name', i);
                          const body = {
                              name,
                          };
                          const { organizationFieldsUi, ...rest } = this.getNodeParameter('additionalFields', i);
                          Object.assign(body, rest);
                          if (organizationFieldsUi === null || organizationFieldsUi === void 0 ? void 0 : organizationFieldsUi.organizationFieldValues.length) {
                              const organizationFieldsUI = organizationFieldsUi.organizationFieldValues;
                              if (organizationFieldsUI.length) {
                                  body.organization_fields = {};
                                  for (const organizationField of organizationFieldsUI) {
                                      body.organization_fields[organizationField.field] = organizationField.value;
                                  }
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'POST', '/organizations', {
                              organization: body,
                          });
                          responseData = responseData.organization;
                      }
                      if (operation === 'delete') {
                          const organizationId = this.getNodeParameter('id', i);
                          await GenericFunctions_1.zendeskApiRequest.call(this, 'DELETE', `/organizations/${organizationId}`, {});
                          responseData = { success: true };
                      }
                      if (operation === 'count') {
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/organizations/count', {});
                          responseData = responseData.count;
                      }
                      if (operation === 'get') {
                          const organizationId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/organizations/${organizationId}`, {});
                          responseData = responseData.organization;
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zendeskApiRequestAllItems.call(this, 'organizations', 'GET', '/organizations', {}, qs);
                          }
                          else {
                              const limit = this.getNodeParameter('limit', i);
                              qs.per_page = limit;
                              responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', '/organizations', {}, qs);
                              responseData = responseData.organizations;
                          }
                      }
                      if (operation === 'getRelatedData') {
                          const organizationId = this.getNodeParameter('id', i);
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'GET', `/organizations/${organizationId}/related`, {});
                          responseData = responseData.organization_related;
                      }
                      if (operation === 'update') {
                          const organizationId = this.getNodeParameter('id', i);
                          const body = {};
                          const { organizationFieldsUi, ...rest } = this.getNodeParameter('updateFields', i);
                          Object.assign(body, rest);
                          if (organizationFieldsUi === null || organizationFieldsUi === void 0 ? void 0 : organizationFieldsUi.organizationFieldValues.length) {
                              const organizationFieldsUI = organizationFieldsUi.organizationFieldValues;
                              if (organizationFieldsUI.length) {
                                  body.organization_fields = {};
                                  for (const organizationField of organizationFieldsUI) {
                                      body.organization_fields[organizationField.field] = organizationField.value;
                                  }
                              }
                          }
                          responseData = await GenericFunctions_1.zendeskApiRequest.call(this, 'PUT', `/organizations/${organizationId}`, { organization: body });
                          responseData = responseData.organization;
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      returnData.push({ json: { error: error.message } });
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zendesk = Zendesk;
  //# sourceMappingURL=Zendesk.node.js.map

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


node_type: n8n-nodes-base.Zoom
name: Zoom
package_name: n8n-nodes-base
display_name: Zoom
description: Consume Zoom API
code_hash: 3e25ea570d229e7c9f4e48f3ac95cff39b47a344bf1b3113609fd838b9d42038
source_location: node_modules/n8n-nodes-base/dist/nodes/Zoom/Zoom.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
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.Zoom = void 0;
  const GenericFunctions_1 = require("./GenericFunctions");
  const MeetingDescription_1 = require("./MeetingDescription");
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
  class Zoom {
      constructor() {
          this.description = {
              displayName: 'Zoom',
              name: 'zoom',
              group: ['input'],
              version: 1,
              description: 'Consume Zoom API',
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              defaults: {
                  name: 'Zoom',
              },
              icon: 'file:zoom.svg',
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zoomApi',
                      required: true,
                      displayOptions: {
                          show: {
                              authentication: ['accessToken'],
                          },
                      },
                  },
                  {
                      name: 'zoomOAuth2Api',
                      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: 'Meeting',
                              value: 'meeting',
                          },
                      ],
                      default: 'meeting',
                  },
                  ...MeetingDescription_1.meetingOperations,
                  ...MeetingDescription_1.meetingFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getTimezones() {
                      const returnData = [];
                      for (const timezone of moment_timezone_1.default.tz.names()) {
                          const timezoneName = timezone;
                          const timezoneId = timezone;
                          returnData.push({
                              name: timezoneName,
                              value: timezoneId,
                          });
                      }
                      return returnData;
                  },
              },
          };
      }
      async execute() {
          const items = this.getInputData();
          const returnData = [];
          let qs = {};
          let responseData;
          const resource = this.getNodeParameter('resource', 0);
          const operation = this.getNodeParameter('operation', 0);
          for (let i = 0; i < items.length; i++) {
              try {
                  qs = {};
                  if (resource === 'meeting') {
                      if (operation === 'get') {
                          const meetingId = this.getNodeParameter('meetingId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.showPreviousOccurrences) {
                              qs.show_previous_occurrences = additionalFields.showPreviousOccurrences;
                          }
                          if (additionalFields.occurrenceId) {
                              qs.occurrence_id = additionalFields.occurrenceId;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'GET', `/meetings/${meetingId}`, {}, qs);
                      }
                      if (operation === 'getAll') {
                          const returnAll = this.getNodeParameter('returnAll', i);
                          const filters = this.getNodeParameter('filters', i);
                          if (filters.type) {
                              qs.type = filters.type;
                          }
                          if (returnAll) {
                              responseData = await GenericFunctions_1.zoomApiRequestAllItems.call(this, 'meetings', 'GET', '/users/me/meetings', {}, qs);
                          }
                          else {
                              qs.page_size = this.getNodeParameter('limit', i);
                              responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'GET', '/users/me/meetings', {}, qs);
                              responseData = responseData.meetings;
                          }
                      }
                      if (operation === 'delete') {
                          const meetingId = this.getNodeParameter('meetingId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.scheduleForReminder) {
                              qs.schedule_for_reminder = additionalFields.scheduleForReminder;
                          }
                          if (additionalFields.occurrenceId) {
                              qs.occurrence_id = additionalFields.occurrenceId;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'DELETE', `/meetings/${meetingId}`, {}, qs);
                          responseData = { success: true };
                      }
                      if (operation === 'create') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          const body = {};
                          if (additionalFields.settings) {
                              const settingValues = {};
                              const settings = additionalFields.settings;
                              if (settings.cnMeeting) {
                                  settingValues.cn_meeting = settings.cnMeeting;
                              }
                              if (settings.inMeeting) {
                                  settingValues.in_meeting = settings.inMeeting;
                              }
                              if (settings.joinBeforeHost) {
                                  settingValues.join_before_host = settings.joinBeforeHost;
                              }
                              if (settings.muteUponEntry) {
                                  settingValues.mute_upon_entry = settings.muteUponEntry;
                              }
                              if (settings.watermark) {
                                  settingValues.watermark = settings.watermark;
                              }
                              if (settings.audio) {
                                  settingValues.audio = settings.audio;
                              }
                              if (settings.alternativeHosts) {
                                  settingValues.alternative_hosts = settings.alternativeHosts;
                              }
                              if (settings.participantVideo) {
                                  settingValues.participant_video = settings.participantVideo;
                              }
                              if (settings.hostVideo) {
                                  settingValues.host_video = settings.hostVideo;
                              }
                              if (settings.autoRecording) {
                                  settingValues.auto_recording = settings.autoRecording;
                              }
                              if (settings.registrationType) {
                                  settingValues.registration_type = settings.registrationType;
                              }
                              body.settings = settingValues;
                          }
                          body.topic = this.getNodeParameter('topic', i);
                          if (additionalFields.type) {
                              body.type = additionalFields.type;
                          }
                          if (additionalFields.startTime) {
                              if (additionalFields.timeZone) {
                                  body.start_time = (0, moment_timezone_1.default)(additionalFields.startTime).format('YYYY-MM-DDTHH:mm:ss');
                              }
                              else {
                                  body.start_time = moment_timezone_1.default
                                      .tz(additionalFields.startTime, this.getTimezone())
                                      .format();
                              }
                          }
                          if (additionalFields.duration) {
                              body.duration = additionalFields.duration;
                          }
                          if (additionalFields.scheduleFor) {
                              body.schedule_for = additionalFields.scheduleFor;
                          }
                          if (additionalFields.timeZone) {
                              body.timezone = additionalFields.timeZone;
                          }
                          if (additionalFields.password) {
                              body.password = additionalFields.password;
                          }
                          if (additionalFields.agenda) {
                              body.agenda = additionalFields.agenda;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'POST', '/users/me/meetings', body, qs);
                      }
                      if (operation === 'update') {
                          const meetingId = this.getNodeParameter('meetingId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.settings) {
                              const settingValues = {};
                              const settings = updateFields.settings;
                              if (settings.cnMeeting) {
                                  settingValues.cn_meeting = settings.cnMeeting;
                              }
                              if (settings.inMeeting) {
                                  settingValues.in_meeting = settings.inMeeting;
                              }
                              if (settings.joinBeforeHost) {
                                  settingValues.join_before_host = settings.joinBeforeHost;
                              }
                              if (settings.muteUponEntry) {
                                  settingValues.mute_upon_entry = settings.muteUponEntry;
                              }
                              if (settings.watermark) {
                                  settingValues.watermark = settings.watermark;
                              }
                              if (settings.audio) {
                                  settingValues.audio = settings.audio;
                              }
                              if (settings.alternativeHosts) {
                                  settingValues.alternative_hosts = settings.alternativeHosts;
                              }
                              if (settings.participantVideo) {
                                  settingValues.participant_video = settings.participantVideo;
                              }
                              if (settings.hostVideo) {
                                  settingValues.host_video = settings.hostVideo;
                              }
                              if (settings.autoRecording) {
                                  settingValues.auto_recording = settings.autoRecording;
                              }
                              if (settings.registrationType) {
                                  settingValues.registration_type = settings.registrationType;
                              }
                              body.settings = settingValues;
                          }
                          if (updateFields.topic) {
                              body.topic = updateFields.topic;
                          }
                          if (updateFields.type) {
                              body.type = updateFields.type;
                          }
                          if (updateFields.startTime) {
                              body.start_time = updateFields.startTime;
                          }
                          if (updateFields.duration) {
                              body.duration = updateFields.duration;
                          }
                          if (updateFields.scheduleFor) {
                              body.schedule_for = updateFields.scheduleFor;
                          }
                          if (updateFields.timeZone) {
                              body.timezone = updateFields.timeZone;
                          }
                          if (updateFields.password) {
                              body.password = updateFields.password;
                          }
                          if (updateFields.agenda) {
                              body.agenda = updateFields.agenda;
                          }
                          responseData = await GenericFunctions_1.zoomApiRequest.call(this, 'PATCH', `/meetings/${meetingId}`, body, qs);
                          responseData = { success: true };
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionErrorData = {
                          json: {},
                          error: error.message,
                          itemIndex: i,
                      };
                      returnData.push(executionErrorData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zoom = Zoom;
  //# sourceMappingURL=Zoom.node.js.map

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


node_type: n8n-nodes-base.Zulip
name: Zulip
package_name: n8n-nodes-base
display_name: Zulip
description: Consume Zulip API
code_hash: 1b814052a8925706b11e31e9ba04beb7adf7197e26060dedcbad6187f2c9159b
source_location: node_modules/n8n-nodes-base/dist/nodes/Zulip/Zulip.node.js
extracted_at: 2025-06-07 19:36:46
updated_at: 2025-06-07 19:36:46
source_code:
  "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Zulip = void 0;
  const n8n_workflow_1 = require("n8n-workflow");
  const GenericFunctions_1 = require("./GenericFunctions");
  const MessageDescription_1 = require("./MessageDescription");
  const change_case_1 = require("change-case");
  const StreamDescription_1 = require("./StreamDescription");
  const UserDescription_1 = require("./UserDescription");
  class Zulip {
      constructor() {
          this.description = {
              displayName: 'Zulip',
              name: 'zulip',
              icon: 'file:zulip.svg',
              group: ['output'],
              version: 1,
              subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
              description: 'Consume Zulip API',
              defaults: {
                  name: 'Zulip',
              },
              inputs: ['main'],
              outputs: ['main'],
              credentials: [
                  {
                      name: 'zulipApi',
                      required: true,
                  },
              ],
              properties: [
                  {
                      displayName: 'Resource',
                      name: 'resource',
                      type: 'options',
                      noDataExpression: true,
                      options: [
                          {
                              name: 'Message',
                              value: 'message',
                          },
                          {
                              name: 'Stream',
                              value: 'stream',
                          },
                          {
                              name: 'User',
                              value: 'user',
                          },
                      ],
                      default: 'message',
                  },
                  ...MessageDescription_1.messageOperations,
                  ...MessageDescription_1.messageFields,
                  ...StreamDescription_1.streamOperations,
                  ...StreamDescription_1.streamFields,
                  ...UserDescription_1.userOperations,
                  ...UserDescription_1.userFields,
              ],
          };
          this.methods = {
              loadOptions: {
                  async getStreams() {
                      const returnData = [];
                      const { streams } = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/streams');
                      for (const stream of streams) {
                          const streamName = stream.name;
                          const streamId = stream.stream_id;
                          returnData.push({
                              name: streamName,
                              value: streamId,
                          });
                      }
                      return returnData;
                  },
                  async getTopics() {
                      const streamId = this.getCurrentNodeParameter('stream');
                      const returnData = [];
                      const { topics } = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', `/users/me/${streamId}/topics`);
                      for (const topic of topics) {
                          const topicName = topic.name;
                          const topicId = topic.name;
                          returnData.push({
                              name: topicName,
                              value: topicId,
                          });
                      }
                      return returnData;
                  },
                  async getUsers() {
                      const returnData = [];
                      const { members } = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/users');
                      for (const member of members) {
                          const memberName = member.full_name;
                          const memberId = member.email;
                          returnData.push({
                              name: memberName,
                              value: memberId,
                          });
                      }
                      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 === 'message') {
                      if (operation === 'sendPrivate') {
                          const to = this.getNodeParameter('to', i).join(',');
                          const content = this.getNodeParameter('content', i);
                          const body = {
                              type: 'private',
                              to,
                              content,
                          };
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/messages', body);
                      }
                      if (operation === 'sendStream') {
                          const stream = this.getNodeParameter('stream', i);
                          const topic = this.getNodeParameter('topic', i);
                          const content = this.getNodeParameter('content', i);
                          const body = {
                              type: 'stream',
                              to: stream,
                              topic,
                              content,
                          };
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/messages', body);
                      }
                      if (operation === 'update') {
                          const messageId = this.getNodeParameter('messageId', i);
                          const updateFields = this.getNodeParameter('updateFields', i);
                          const body = {};
                          if (updateFields.content) {
                              body.content = updateFields.content;
                          }
                          if (updateFields.propagateMode) {
                              body.propagat_mode = (0, change_case_1.snakeCase)(updateFields.propagateMode);
                          }
                          if (updateFields.topic) {
                              body.topic = updateFields.topic;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'PATCH', `/messages/${messageId}`, body);
                      }
                      if (operation === 'get') {
                          const messageId = this.getNodeParameter('messageId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', `/messages/${messageId}`);
                      }
                      if (operation === 'delete') {
                          const messageId = this.getNodeParameter('messageId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'DELETE', `/messages/${messageId}`);
                      }
                      if (operation === 'updateFile') {
                          const credentials = await this.getCredentials('zulipApi');
                          const dataBinaryProperty = this.getNodeParameter('dataBinaryProperty', i);
                          const binaryData = this.helpers.assertBinaryData(i, dataBinaryProperty);
                          const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, dataBinaryProperty);
                          const formData = {
                              file: {
                                  value: binaryDataBuffer,
                                  options: {
                                      filename: binaryData.fileName,
                                      contentType: binaryData.mimeType,
                                  },
                              },
                          };
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/user_uploads', {}, {}, undefined, { formData });
                          responseData.uri = `${credentials.url}${responseData.uri}`;
                      }
                  }
                  if (resource === 'stream') {
                      const body = {};
                      if (operation === 'getAll') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.includePublic) {
                              body.include_public = additionalFields.includePublic;
                          }
                          if (additionalFields.includeSubscribed) {
                              body.include_subscribed = additionalFields.includeSubscribed;
                          }
                          if (additionalFields.includeAllActive) {
                              body.include_all_active = additionalFields.includeAllActive;
                          }
                          if (additionalFields.includeDefault) {
                              body.include_default = additionalFields.includeDefault;
                          }
                          if (additionalFields.includeOwnersubscribed) {
                              body.include_owner_subscribed = additionalFields.includeOwnersubscribed;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/streams', body);
                          responseData = responseData.streams;
                      }
                      if (operation === 'getSubscribed') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.includeSubscribers) {
                              body.include_subscribers = additionalFields.includeSubscribers;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/users/me/subscriptions', body);
                          responseData = responseData.subscriptions;
                      }
                      if (operation === 'create') {
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          const subscriptions = this.getNodeParameter('subscriptions', i);
                          body.subscriptions = JSON.stringify(subscriptions.properties);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              body.subscriptions = JSON.stringify(subscriptions.properties);
                              if (additionalFields.inviteOnly) {
                                  body.invite_only = additionalFields.inviteOnly;
                              }
                              if (additionalFields.principals) {
                                  const principals = [];
                                  additionalFields.principals.properties.map((principal) => {
                                      principals.push(principal.email);
                                  });
                                  body.principals = JSON.stringify(principals);
                              }
                              if (additionalFields.authorizationErrorsFatal) {
                                  body.authorization_errors_fatal =
                                      additionalFields.authorizationErrorsFatal;
                              }
                              if (additionalFields.historyPublicToSubscribers) {
                                  body.history_public_to_subscribers =
                                      additionalFields.historyPublicToSubscribers;
                              }
                              if (additionalFields.streamPostPolicy) {
                                  body.stream_post_policy = additionalFields.streamPostPolicy;
                              }
                              if (additionalFields.announce) {
                                  body.announce = additionalFields.announce;
                              }
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/users/me/subscriptions', body);
                      }
                      if (operation === 'delete') {
                          const streamId = this.getNodeParameter('streamId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'DELETE', `/streams/${streamId}`, {});
                      }
                      if (operation === 'update') {
                          const streamId = this.getNodeParameter('streamId', i);
                          const jsonParameters = this.getNodeParameter('jsonParameters', i);
                          if (jsonParameters) {
                              const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i);
                              if (additionalFieldsJson !== '') {
                                  if ((0, GenericFunctions_1.validateJSON)(additionalFieldsJson) !== undefined) {
                                      Object.assign(body, JSON.parse(additionalFieldsJson));
                                  }
                                  else {
                                      throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional fields must be a valid JSON', { itemIndex: i });
                                  }
                              }
                          }
                          else {
                              const additionalFields = this.getNodeParameter('additionalFields', i);
                              if (additionalFields.description) {
                                  body.description = JSON.stringify(additionalFields.description);
                              }
                              if (additionalFields.newName) {
                                  body.new_name = JSON.stringify(additionalFields.newName);
                              }
                              if (additionalFields.isPrivate) {
                                  body.is_private = additionalFields.isPrivate;
                              }
                              if (additionalFields.isAnnouncementOnly) {
                                  body.is_announcement_only = additionalFields.isAnnouncementOnly;
                              }
                              if (additionalFields.streamPostPolicy) {
                                  body.stream_post_policy = additionalFields.streamPostPolicy;
                              }
                              if (additionalFields.historyPublicToSubscribers) {
                                  body.history_public_to_subscribers =
                                      additionalFields.historyPublicToSubscribers;
                              }
                              responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'PATCH', `/streams/${streamId}`, body);
                          }
                      }
                  }
                  if (resource === 'user') {
                      const body = {};
                      if (operation === 'get') {
                          const userId = this.getNodeParameter('userId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.clientGravatar) {
                              body.client_gravatar = additionalFields.client_gravatar;
                          }
                          if (additionalFields.includeCustomProfileFields) {
                              body.include_custom_profile_fields =
                                  additionalFields.includeCustomProfileFields;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', `/users/${userId}`, body);
                      }
                      if (operation === 'getAll') {
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.clientGravatar) {
                              body.client_gravatar = additionalFields.client_gravatar;
                          }
                          if (additionalFields.includeCustomProfileFields) {
                              body.include_custom_profile_fields =
                                  additionalFields.includeCustomProfileFields;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'GET', '/users', body);
                          responseData = responseData.members;
                      }
                      if (operation === 'create') {
                          body.email = this.getNodeParameter('email', i);
                          body.password = this.getNodeParameter('password', i);
                          body.full_name = this.getNodeParameter('fullName', i);
                          body.short_name = this.getNodeParameter('shortName', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'POST', '/users', body);
                      }
                      if (operation === 'update') {
                          const userId = this.getNodeParameter('userId', i);
                          const additionalFields = this.getNodeParameter('additionalFields', i);
                          if (additionalFields.fullName) {
                              body.full_name = JSON.stringify(additionalFields.fullName);
                          }
                          if (additionalFields.isAdmin) {
                              body.is_admin = additionalFields.isAdmin;
                          }
                          if (additionalFields.isGuest) {
                              body.is_guest = additionalFields.isGuest;
                          }
                          if (additionalFields.role) {
                              body.role = additionalFields.role;
                          }
                          if (additionalFields.profileData) {
                              body.profile_data = additionalFields.profileData.properties;
                          }
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'PATCH', `/users/${userId}`, body);
                      }
                      if (operation === 'deactivate') {
                          const userId = this.getNodeParameter('userId', i);
                          responseData = await GenericFunctions_1.zulipApiRequest.call(this, 'DELETE', `/users/${userId}`, body);
                      }
                  }
                  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
                  returnData.push(...executionData);
              }
              catch (error) {
                  if (this.continueOnFail()) {
                      const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } });
                      returnData.push(...executionData);
                      continue;
                  }
                  throw error;
              }
          }
          return [returnData];
      }
  }
  exports.Zulip = Zulip;
  //# sourceMappingURL=Zulip.node.js.map

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


