[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\nindent_style = space\nindent_size = 2\ntrim_trailing_whitespace = true\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": "* @mailersend/nodejs-sdk-maintainers\n"
  },
  {
    "path": ".github/workflows/publish.yaml",
    "content": "name: NPM Publish\non:\n  release:\n    types: [created]\njobs:\n  build:\n    runs-on: ubuntu-24.04\n    permissions:\n      id-token: write\n    steps:\n      - uses: actions/checkout@v6\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          registry-url: \"https://registry.npmjs.org\"\n      - run: npm install\n      - run: npm publish\n"
  },
  {
    "path": ".github/workflows/test.yaml",
    "content": "name: Tests\non:\n  push:\n    branches: [main]\n  pull_request:\njobs:\n  test:\n    runs-on: ubuntu-24.04\n    strategy:\n      matrix:\n        node-version: [20, 22, 24]\n    name: Node ${{ matrix.node-version }} Tests\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n      - name: Setup Node\n        uses: actions/setup-node@v4\n        with:\n          node-version: ${{ matrix.node-version }}\n      - name: Cache node_modules\n        id: node-cache\n        uses: actions/cache@v4\n        with:\n          path: node_modules\n          key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}\n          restore-keys: ${{ runner.os }}-node${{ matrix.node-version }}-\n      - name: Install dependencies\n        if: steps.node-cache.outputs.cache-hit != 'true'\n        run: npm install\n      - name: Run test suite\n        run: npm test\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\n.env\n.DS_Store\n.idea\n/lib\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2020 MailerSend\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "README.md",
    "content": "<a href=\"https://www.mailersend.com\"><img src=\"https://www.mailersend.com/images/logo.svg\" width=\"200px\"/></a>\n\nMailerSend Node.js SDK\n\n[![MIT licensed](https://img.shields.io/npm/l/mailersend)](./LICENSE.md)\n![NPM Version](https://img.shields.io/npm/v/mailersend)\n![Top language](https://img.shields.io/github/languages/top/IARKI/mailer-send-ts)\n\n<br/>\n\n## Welcome to MailerSend 👋\n\n_Send emails and SMS in minutes_\n\nDevelopers come for the high deliverability, and stay because our intuitive API and built-in integrations make life easier. 🤝\n\nFor more info, you can:\n\n- Visit our [Developers site 💻](https://developers.mailersend.com/) for REST API reference\n- Read our [Knowledge base ❓](https://www.mailersend.com/help) for guides on how to use MailerSend\n- Contact our [Support team 📨](https://www.mailersend.com/contact-us) if you require more assistance\n\n#### V1 Documentation can be found [here](https://github.com/mailersend/mailersend-nodejs/tree/v1#readme)\n\n<br/>\n\n# Table of Contents\n\n- [Installation](#installation)\n  - [Setup](#setup)\n- [Usage](#usage)\n  - [Email](#email)\n    - [Send an email](#send-an-email)\n    - [Add CC, BCC recipients](#add-cc-bcc-recipients)\n    - [Send a template-based email](#send-a-template-based-email)\n    - [Personalization](#advanced-personalization)\n    - [Send email with attachment](#send-email-with-attachment)\n    - [Send email with inline attachment](#send-email-with-inline-attachment)\n    - [Send email with references (threading)](#send-email-with-references-threading)\n    - [Send email with list-unsubscribe](#send-email-with-list-unsubscribe)\n    - [Send a scheduled email](#send-a-scheduled-email)\n    - [Send email with precedence bulk header](#send-email-with-precedence-bulk-header)\n    - [Send an email with tracking](#send-an-email-with-tracking)\n    - [Send email with custom headers](#send-email-with-custom-headers)\n    - [Send an email with RCPT TO recipients](#send-an-email-with-rcpt-to-recipients)\n  - [Bulk email API](#bulk-email-api)\n    - [Send bulk emails](#send-bulk-emails)\n    - [Get bulk request status](#get-bulk-request-status)\n  - [Inbound Routing](#inbound)\n    - [Get inbound list](#get-inbound-list)\n    - [Get inbound](#get-inbound)\n    - [Create inbound](#create-inbound)\n    - [Update inbound](#update-inbound)\n    - [Delete inbound](#delete-inbound)\n  - [Activity](#activity)\n    - [Get activity list](#get-activity-list)\n    - [Get single activity](#get-single-activity)\n  - [Analytics](#analytics)\n    - [Get activity data by date](#get-activity-data-by-date)\n    - [Opens by country](#opens-by-country)\n    - [Opens by user-agent](#opens-by-user-agent)\n    - [Opens by reading environment](#opens-by-reading-environment)\n  - [Domains](#domains)\n    - [Get a list of domains](#get-a-list-of-domains)\n    - [Get domain](#get-domain)\n    - [Add a domain](#add-a-domain)\n    - [Delete domain](#delete-domain)\n    - [Get a list of recipients per domain](#get-a-list-of-recipients-per-domain)\n    - [Update domain settings](#update-domain-settings)\n    - [Verify a domain](#verify-a-domain)\n    - [Get DNS records](#get-dns-records)\n  - [Messages](#messages)\n    - [Get a list of messages](#get-a-list-of-messages)\n    - [Get info on a message](#get-info-on-a-message)\n  - [Scheduled Messages](#scheduled-messages)\n    - [Get scheduled email list](#get-scheduled-email-list)\n    - [Get scheduled email](#get-scheduled-email)\n    - [Delete scheduled email](#delete-scheduled-email)\n  - [Tokens](#tokens)\n    - [List tokens](#list-tokens)\n    - [Get token](#get-token)\n    - [Create a token](#create-a-token)\n    - [Update token name](#update-token-name)\n    - [Update token status](#update-token-status)\n    - [Delete token](#delete-token)\n  - [Recipients](#recipients)\n    - [Get a list of recipients](#get-a-list-of-recipients)\n    - [Get single recipient](#get-single-recipient)\n    - [Delete recipient](#delete-recipient)\n    - [Add recipients to a suppression list](#add-recipients-to-a-suppression-list)\n    - [Delete recipients from a suppression list](#delete-recipients-from-a-suppression-list)\n    - [Get recipients from a suppression list](#get-recipients-from-a-suppression-list)\n    - [Delete all recipients from a suppression list](#delete-all-recipients-from-a-suppression-list)\n    - [Get recipients from the on-hold list](#get-recipients-from-the-on-hold-list)\n    - [Delete recipients from the on-hold list](#delete-recipients-from-the-on-hold-list)\n  - [Webhooks](#webhooks)\n    - [Get a list of webhooks](#get-a-list-of-webhooks)\n    - [Get webhook](#get-webhook)\n    - [Create webhook](#create-webhook)\n    - [Update webhook](#update-webhook)\n    - [Delete webhook](#delete-webhook)\n  - [Templates](#templates)\n    - [Get a list of templates](#get-a-list-of-templates)\n    - [Get a single template](#get-a-single-template)\n    - [Create a template](#create-a-template)\n    - [Update a template](#update-a-template)\n    - [Delete a template](#delete-a-template)\n  - [Email Verification](#email-verification)\n    - [Get all email verification lists](#get-all-email-verification-lists)\n    - [Get an email verification list](#get-an-email-verification-list)\n    - [Create an email verification list](#create-an-email-verification-list)\n    - [Verify an email list](#verify-an-email-list)\n    - [Get email verification list results](#get-email-verification-list-results)\n    - [Verify a single email](#verify-a-single-email)\n    - [Verify a single email asynchronously](#verify-a-single-email-asynchronously)\n    - [Get async email verification status](#get-async-email-verification-status)\n  - [SMS](#sms)\n    - [Send SMS](#send-sms)\n    - [SMS personalization](#sms-personalization)\n  - [Phone Numbers](#phone-numbers)\n    - [Get phone number list](#get-phone-number-list)\n    - [Get phone number](#get-phone-number)\n    - [Update phone number](#update-phone-number)\n    - [Delete phone number](#delete-phone-number)\n  - [SMS Messages](#messages-1)\n    - [Get messages list](#get-messages-list)\n    - [Get a message](#get-a-message)\n  - [SMS Activity](#activity-1)\n    - [Get activity list](#get-activity-list-1)\n  - [SMS Recipients](#recipients-1)\n    - [Get recipient list](#get-recipient-list)\n    - [Get recipient](#get-recipient)\n    - [Update recipient](#update-recipient)\n  - [SMS Webhooks](#webhooks-1)\n    - [Get webhook list for a number](#get-webhook-list-for-a-number)\n    - [Get webhook](#get-webhook-1)\n    - [Create webhook](#create-webhook-1)\n    - [Update webhook](#update-webhook-1)\n    - [Delete webhook](#delete-webhook-1)\n  - [SMS Inbound](#inbound-1)\n    - [Get inbound list](#get-inbound-list-1)\n    - [Get inbound](#get-inbound-1)\n    - [Add inbound](#add-inbound)\n    - [Update inbound](#update-inbound-1)\n    - [Delete inbound](#delete-inbound-1)\n  - [Identity](#identity)\n    - [Get identity list](#get-identity-list)\n    - [Get identity](#get-identity)\n    - [Get identity by email](#get-identity-by-email-address)\n    - [Create identity](#create-identity)\n    - [Update identity](#update-identity)\n    - [Update identity by email](#update-identity-by-email-address)\n    - [Delete identity](#delete-identity)\n    - [Delete identity by email](#delete-identity-by-email-address)\n    - [Resend identity verification](#resend-identity-verification)\n  - [SMTP Users](#smtp-users)\n    - [List SMTP users](#list-smtp-users)\n    - [Get SMTP user](#get-smtp-user)\n    - [Create SMTP user](#create-smtp-user)\n    - [Update SMTP user](#update-smtp-user)\n    - [Delete SMTP user](#delete-smtp-user)\n  - [Users](#users)\n    - [Get user list](#get-user-list)\n    - [Get single user](#get-single-user)\n    - [Invite a user](#invite-a-user)\n    - [Update user](#update-user)\n    - [Delete user](#delete-user)\n    - [Get invite list](#get-invite-list)\n    - [Get single invite](#get-single-invite)\n    - [Resend invite](#resend-invite)\n    - [Cancel invite](#cancel-invite)\n  - [DMARC Monitoring](#dmarc-monitoring)\n    - [List monitors](#list-monitors)\n    - [Create monitor](#create-monitor)\n    - [Update monitor](#update-monitor)\n    - [Delete monitor](#delete-monitor)\n    - [Get aggregated reports](#get-aggregated-reports)\n    - [Get IP-specific reports](#get-ip-specific-reports)\n    - [Get report sources](#get-report-sources)\n    - [Mark IP as favorite](#mark-ip-as-favorite)\n    - [Remove IP from favorites](#remove-ip-from-favorites)\n  - [Blocklist Monitoring](#blocklist-monitoring)\n    - [List blocklist monitors](#list-blocklist-monitors)\n    - [Get single blocklist monitor](#get-single-blocklist-monitor)\n    - [Create blocklist monitor](#create-blocklist-monitor)\n    - [Update blocklist monitor](#update-blocklist-monitor)\n    - [Delete blocklist monitor](#delete-blocklist-monitor)\n  - [Other endpoints](#other-endpoints)\n    - [Get API quota](#get-api-quota)\n- [Utils](#utils)\n  - [Verify a webhook signature](#verify-a-webhook-signature)\n- [Support and Feedback](#support-and-feedback)\n- [License](#license)\n\n## Installation\n\n### Setup\n\n```bash\nnpm install mailersend\n```\n\nif you would like to use the env approach as shown in the examples, please run\n\n```bash\nnpm install dotenv --save\n```\n\n## Usage\n\n## Email\n\n### Send an email\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\");\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Add CC, BCC recipients\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"bbbb@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\nconst cc = [\n  new Recipient(\"your_cc@client.com\", \"Your Client CC\")\n];\nconst bcc = [\n  new Recipient(\"your_bcc@client.com\", \"Your Client BCC\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setCc(cc)\n  .setBcc(bcc)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\");\n\nawait mailerSend.email.send(emailParams);\n```\n\n### Send a template-based email\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"This is a Subject\")\n  .setTemplateId('templateId');\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Personalization\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst personalization = [\n  {\n    email: \"your@client.com\",\n    data: {\n      test: 'Test Value'\n    },\n  }\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setPersonalization(personalization)\n  .setSubject(\"Subject, {{ test }}\")\n  .setHtml(\"This is the HTML content, {{ test }}\")\n  .setText(\"This is the text content, {{ test }}\");\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Send email with attachment\n\n```js\nimport 'dotenv/config';\nimport fs from \"fs\";\nimport { MailerSend, EmailParams, Sender, Recipient, Attachment } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst attachments = [\n  new Attachment(\n    fs.readFileSync('/path/to/file.pdf', { encoding: 'base64' }),\n    'file.pdf',\n    'attachment'\n  )\n]\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setAttachments(attachments)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\");\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Send email with inline attachment\n\n```js\nimport 'dotenv/config';\nimport fs from \"fs\";\nimport { MailerSend, EmailParams, Sender, Recipient, Attachment } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst attachments = [\n  new Attachment(\n    fs.readFileSync('/path/to/file.png', { encoding: 'base64' }),\n    'file.png',\n    'inline',\n    '0123456789'\n  )\n]\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setAttachments(attachments)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content with an inline image attachment <img src=\\\"cid:0123456789\\\"/></strong>\")\n  .setText(\"This is the text content\");\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Send email with references (threading)\n\n> **Note:** The `references` field is available on paid plan accounts only.\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"Re: This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\")\n  .setInReplyTo(\"<original-message-id@yourdomain.com>\")\n  .setReferences([\n    \"<original-message-id@yourdomain.com>\",\n    \"<another-message-id@yourdomain.com>\",\n  ]);\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Send email with list-unsubscribe\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\")\n  .setListUnsubscribe(\"https://www.yourdomain.com/unsubscribe\");\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Send a scheduled message\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"This is a scheduled Subject\")\n  .setHtml(\"<strong>This is a scheduled HTML content</strong>\")\n  .setText(\"This is a scheduled text content\")\n  // Accepts a Unix timestamp (integer) or an ISO 8601 date string\n  .setSendAt(Math.floor((new Date(Date.now() + 30 * 60 * 1000)).getTime() / 1000)); // Unix timestamp – send in 30 mins\n  // .setSendAt(\"2040-11-21T14:00:00+00:00\"); // ISO 8601 alternative\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Send email with precedence bulk header\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\")\n  .setPrecedenceBulk(true);\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Send an email with tracking\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\")\n  .setSettings({\n    track_clicks: true,\n    track_opens: true,\n    track_content: true,\n  });\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Send email with custom headers\n\n> **Note:** Custom headers are available on Professional and Enterprise accounts only.\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst headers = [\n  { name: \"X-Custom-Header\", value: \"custom-value\" },\n  { name: \"X-Another-Header\", value: \"another-value\" },\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\")\n  .setHeaders(headers);\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n### Send an email with RCPT TO recipients\n\n> `rcptTo` is intended for SMTP source delivery and accepts a list of recipients.\n> When `to` is empty and `rcptTo` is provided, the addresses are forwarded as BCC.\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst rcptTo = [\n  new Recipient(\"rcpt@client.com\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\")\n  .setRcptTo(rcptTo);\n\nawait mailerSend.email.send(emailParams);\n\n```\n\n## Bulk email API\n\n### Send bulk email\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"your@yourdomain.com\", \"Your name\");\n\nconst bulkEmails = [];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo([\n    new Recipient(\"your@client.com\", \"Your Client\")\n  ])\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\");\n\nbulkEmails.push(emailParams);\n\nconst emailParams2 = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo([\n    new Recipient(\"your_2@client.com\", \"Your Client 2\")\n  ])\n  .setSubject(\"This is a Subject 2\")\n  .setHtml(\"<strong>This is the HTML content 2</strong>\")\n  .setText(\"This is the text content 2\");\n\nbulkEmails.push(emailParams2);\n\nawait mailerSend.email.sendBulk(bulkEmails);\n\n```\n\n### Get bulk request status\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.getBulkStatus('bulk_email_id') // bulk email Id e.g 63af1fdb790d97105a090001\n  .then((response) => {\n    console.log(response.body);\n  });\n\n```\n\n## Inbound routing\n\n### Get a list of inbound routes\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.inbound.list()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\nWith query parameters:\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.inbound.list({\n  domain_id: \"domain_id\",\n  page: 1,\n  limit: 25,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get a single inbound route\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.inbound.single(\"inbound_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Add an inbound route\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, Inbound, InboundFilterType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst inbound = new Inbound('inbound test', true, 'domain_id')\n  .setInboundDomain('inbound.yourdomain.com')\n  .setInboundPriority(50)\n  .setMatchFilter({\n    type: InboundFilterType.MATCH_ALL,\n  })\n  .setCatchFilter({\n    type: InboundFilterType.CATCH_RECIPIENT,\n  })\n  .setForwards([\n    {\n      type: \"webhook\",\n      value: \"https://www.yourdomain.com/hook\"\n    }\n  ]);\n\nmailerSend.email.inbound.create(inbound)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update an inbound route\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, InboundUpdateParams, InboundFilterType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst inbound = new InboundUpdateParams('inbound test 2', false)\n  .setInboundDomain('inbound.yourdomain.com')\n  .setInboundPriority(25)\n  .setMatchFilter({\n    type: InboundFilterType.MATCH_ALL,\n  })\n  .setCatchFilter({\n    type: InboundFilterType.CATCH_ALL,\n  })\n  .setForwards([\n    {\n      type: \"webhook\",\n      value: \"https://www.yourdomain.com/hook\"\n    }\n  ]);\n\nmailerSend.email.inbound.update('inbound_id', inbound)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete an inbound route\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.inbound.delete(\"inbound_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Activity\n\n### Get activity list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, ActivityEventType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst queryParams = {\n  limit: 10, // Min: 10, Max: 100, Default: 25\n  page: 2,\n  date_from: 1443651141, // Unix timestamp\n  date_to: 1443651141, // Unix timestamp\n  event: [ActivityEventType.SENT, ActivityEventType.SOFT_BOUNCED]\n}\n\nmailerSend.email.activity.domain(\"domain_id\", queryParams)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error));\n\n```\n\n### Get single activity\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.activity.single(\"activity_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Analytics\n\n### Get activity data by date\n\n```js\nimport 'dotenv/config';\nimport { ActivityEventType, AnalyticsDateQueryParams, AnalyticsGroupByType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst queryParams: AnalyticsDateQueryParams = {\n  date_from: 1443651141,\n  date_to: 2443651141,\n  event: [ActivityEventType.CLICKED, ActivityEventType.OPENED],\n  // group_by: AnalyticsGroupByType.DAYS, // optional: days, weeks, months, years\n};\n\nmailerSend.email.analytics.byDate(queryParams).then(response => {\n  console.log(response.body);\n}).catch(error => {\n  console.log(error.body);\n});\n\n```\n\n### Opens by country\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.analytics.byCountry({\n  date_from: 1443651141,\n  date_to: 2443651141,\n}).then(response => {\n  console.log(response.body);\n}).catch(error => {\n  console.log(error.body);\n});\n\n```\n\n### Opens by user-agent\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.analytics.byUserAgent({\n  date_from: 1443651141,\n  date_to: 2443651141,\n}).then(response => {\n  console.log(response.body);\n}).catch(error => {\n  console.log(error.body);\n});\n\n```\n\n### Opens by reading environment\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.analytics.byReadingEnvironment({\n  date_from: 1443651141,\n  date_to: 2443651141,\n}).then(response => {\n  console.log(response.body);\n}).catch(error => {\n  console.log(error.body);\n});\n\n```\n\n## Domains\n\n### Get a list of domains\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.list()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.list({ page: 1, limit: 10, verified: true })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get domain\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.single(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Add a domain\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, Domain } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst domain = new Domain(\n  \"example.com\",\n  \"rp_subdomain\",\n  \"ct_subdomain\",\n  \"ir_subdomain\",\n)\n\nmailerSend.email.domain.create(domain)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete domain\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.delete(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get a list of recipients per domain\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.recipients(\"domain_id\", {\n  page: 1,\n  limit: 10\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update domain settings\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.updateSettings(\"domain_id\", {\n  send_paused: true,\n  track_clicks: true,\n  track_opens: true,\n  track_unsubscribe: true,\n  track_unsubscribe_html: \"<strong> Unsubscribe now </strong>\",\n  track_unsubscribe_plain: \"Unsubscribe now\",\n  track_unsubscribe_html_enabled: true,\n  track_unsubscribe_plain_enabled: true,\n  track_content: true,\n  custom_tracking_enabled: true,\n  custom_tracking_subdomain: \"subdomain\",\n  precedence_bulk: true,\n  ignore_duplicated_recipients: true,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Verify a domain\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.verify(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get DNS records\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.dns(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Messages\n\n### Get a list of messages\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\n\nmailerSend.email.message.list()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get info on a message\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.message.single(\"message_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Scheduled Messages\n\n### Get scheduled email list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.schedule.list({\n  domain_id: \"domain_id\",\n  status: \"scheduled\",  // \"scheduled\" | \"sent\" | \"error\"\n  limit: 10,\n  page: 1,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get scheduled email\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.schedule.single(\"message_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete scheduled email\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.schedule.delete(\"message_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Tokens\n\n### List tokens\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.token.list({ page: 1, limit: 25 })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get token\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.token.single(\"token_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Create a token\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, Token, TokenScopeType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst token = new Token(\"Token name\", [\n  TokenScopeType.EMAIL_FULL,\n  TokenScopeType.DOMAINS_READ,\n  TokenScopeType.DOMAINS_FULL,\n  TokenScopeType.ACTIVITY_READ,\n  TokenScopeType.ACTIVITY_FULL,\n  TokenScopeType.ANALYTICS_READ,\n  TokenScopeType.ANALYTICS_FULL,\n  TokenScopeType.TOKENS_FULL,\n], \"domain_id\");\n\nmailerSend.token.create(token)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update token name\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.token.update(\"token_id\", { name: \"New token name\" })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update token status\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.token.updateSettings(\"token_id\", {\n  status: \"pause\",\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete token\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.token.delete(\"token_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Recipients\n\n### Get a list of recipients\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.list({\n  domain_id: \"domain_id\",\n  limit: 10,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get single recipient\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.single(\"recipient_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete recipient\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delete(\"recipient_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Add recipients to a suppression list\n\n#### Blocklist\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockRecipients({\n  domain_id: 'domain_id',\n  recipients: [\n    \"test@example.com\"\n  ]\n}, BlockListType.BLOCK_LIST)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n#### Hard Bounces\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockRecipients({\n  domain_id: 'domain_id',\n  recipients: [\n    \"test@example.com\"\n  ]\n}, BlockListType.HARD_BOUNCES_LIST)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n#### Spam Complaints\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockRecipients({\n  domain_id: 'domain_id',\n  recipients: [\n    \"test@example.com\"\n  ]\n}, BlockListType.SPAM_COMPLAINTS_LIST)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n#### Unsubscribe\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockRecipients({\n  domain_id: 'domain_id',\n  recipients: [\n    \"test@example.com\"\n  ]\n}, BlockListType.UNSUBSCRIBES_LIST)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete recipients from a suppression list\n\n#### Blocklist\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delBlockListRecipients(\n  [\"recipient_id\", \"recipient_id\"],\n  BlockListType.BLOCK_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n#### Hard Bounce\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delBlockListRecipients(\n  [\"recipient_id\", \"recipient_id\"],\n  BlockListType.HARD_BOUNCES_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n#### Spam Complaint\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delBlockListRecipients(\n  [\"recipient_id\", \"recipient_id\"],\n  BlockListType.SPAM_COMPLAINTS_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n#### Unsubscribe\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delBlockListRecipients(\n  [\"recipient_id\", \"recipient_id\"],\n  BlockListType.UNSUBSCRIBES_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get recipients from a suppression list\n\n#### Blocklist\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockList(\n  { domain_id: \"domain_id\", },\n  BlockListType.BLOCK_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n#### Hard Bounce\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockList(\n  { domain_id: \"domain_id\", },\n  BlockListType.HARD_BOUNCES_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n#### Spam Complaint\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockList(\n  { domain_id: \"domain_id\", },\n  BlockListType.SPAM_COMPLAINTS_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n#### Unsubscribe\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockList(\n  { domain_id: \"domain_id\", },\n  BlockListType.UNSUBSCRIBES_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete all recipients from a suppression list\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delAllBlockListRecipients(BlockListType.BLOCK_LIST)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get recipients from the on-hold list\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockList(\n  { page: 1, limit: 25 },\n  BlockListType.ON_HOLD_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete recipients from the on-hold list\n\n```js\nimport 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delBlockListRecipients(\n  [\"recipient_id\", \"recipient_id\"],\n  BlockListType.ON_HOLD_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Webhooks\n\n### Get a list of webhooks\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.webhook.list(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.webhook.list(\"domain_id\", { limit: 25, page: 2 })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get webhook\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.webhook.single(\"webhook_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Create webhook\n\n```js\nimport 'dotenv/config';\nimport { EmailWebhook, EmailWebhookEventType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst emailWebhook = new EmailWebhook()\n  .setName(\"Webhook Name\")\n  .setUrl(\"https://example.com\")\n  .setDomainId(\"domain_id\")\n  .setEnabled(true)\n  .setEvents([EmailWebhookEventType.SENT, EmailWebhookEventType.OPENED]);\n\nmailerSend.email.webhook.create(emailWebhook)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n```js\nimport 'dotenv/config';\nimport { EmailWebhook, EmailWebhookEventType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst emailWebhook = new EmailWebhook()\n  .setName(\"Webhook Name\")\n  .setUrl(\"https://example.com\")\n  .setDomainId(\"domain_id\")\n  .setEnabled(true)\n  .setVersion(2)\n  .setEditable(true)\n  .setEvents([EmailWebhookEventType.SENT, EmailWebhookEventType.OPENED]);\n\nmailerSend.email.webhook.create(emailWebhook)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n```js\nimport 'dotenv/config';\nimport { EmailWebhook, EmailWebhookEventType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst emailWebhook = new EmailWebhook()\n  .setName(\"Webhook Name\")\n  .setUrl(\"https://example.com\")\n  .setDomainId(\"domain_id\")\n  .setEnabled(false)\n  .setEvents([EmailWebhookEventType.SENT, EmailWebhookEventType.OPENED]);\n\nmailerSend.email.webhook.create(emailWebhook)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update webhook\n\n```js\nimport 'dotenv/config';\nimport { EmailWebhookEventType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.webhook.update(\"webhook_id\", {\n  name: \"Webhook Name 2\",\n  url: \"https://example.com/updated-hook\",\n  enabled: false,\n  events: [EmailWebhookEventType.SENT, EmailWebhookEventType.OPENED],\n  version: 2,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete webhook\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.webhook.delete(\"webhook_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Templates\n\n### Get a list of templates\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.template.list({\n    domain_id: \"domain_id\"\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.template.list({\n    domain_id: \"domain_id\",\n    page: 1,\n    limit: 25,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get a single template\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.template.single(\"template_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Create a template\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.template.create({\n  name: \"My Template\",\n  html: \"<p>Hello, {{name}}!</p>\",\n  text: \"Hello, {{name}}!\",\n  domain_id: \"domain_id\",\n  categories: [\"welcome\"],\n  tags: [\"welcome\"],\n  auto_generate: false,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update a template\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.template.update(\"template_id\", {\n  name: \"Updated Template Name\",\n  html: \"<p>Hello, {{name}}! Updated.</p>\",\n  text: \"Hello, {{name}}! Updated.\",\n  auto_generate: true,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete a template\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.template.delete(\"template_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Email Verification\n\n### Get all email verification lists\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.list({ page: 1, limit: 25 })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get an email verification list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.single(\"email_verification_id\", {\n  detailed: true,\n  page: 1,\n  limit: 25,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Create an email verification list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailVerification } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst emailVerification = new EmailVerification(\"My List\", [\n  \"test1@example.com\",\n  \"test2@example.com\",\n]);\n\n// Optional: link to an existing list and trigger verification automatically\n// emailVerification.setListId(\"existing_list_id\");\n// emailVerification.setVerify(true);\n\nmailerSend.emailVerification.create(emailVerification)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Verify an email list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.verifyList(\"email_verification_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get email verification list results\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, EmailVerificationResultType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.getListResult(\"email_verification_id\", {\n  page: 1,\n  limit: 25,\n  results: [EmailVerificationResultType.VALID, EmailVerificationResultType.CATCH_ALL],\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Verify a single email\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.verifyEmail(\"test@example.com\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Verify a single email asynchronously\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.verifyEmailAsync(\"test@example.com\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get async email verification status\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.getVerifyEmailAsyncStatus(\"verification_job_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## SMS\n\n### Send SMS\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, SMSParams } from \"mailersend\";\n\nconst mailersend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst recipients = [\n  \"+18332647501\"\n];\n\nconst smsParams = new SMSParams()\n  .setFrom(\"+18332647501\")\n  .setTo(recipients)\n  .setText(\"This is the text content\");\n\nawait mailersend.sms.send(smsParams);\n\n```\n\n### SMS personalization\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, SMSParams, SMSPersonalization } from \"mailersend\";\n\nconst mailersend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst recipients = [\n  \"+18332647501\",\n  \"+18332647502\"\n];\n\nconst personalization = [\n  new SMSPersonalization(\"+18332647501\", {\n    \"name\": \"Dummy\"\n  }),\n  new SMSPersonalization(\"+18332647502\", {\n    \"name\": \"Not Dummy\"\n  }),\n];\n\nconst smsParams = new SMSParams()\n  .setFrom(\"+18332647501\")\n  .setTo(recipients)\n  .setPersonalization(personalization)\n  .setText(\"Hey {{name}} welcome to our organization\");\n\nawait mailersend.sms.send(smsParams);\n\n```\n\n## Phone Numbers\n\n### Get phone number list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.number.list({\n  paused: false,\n  limit: 10,\n  page: 1\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get phone number\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.number.single(\"sms_number_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update phone number\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.number.update(\"sms_number_id\", true)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete phone number\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.number.delete(\"sms_number_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Messages\n\n### Get messages list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.message.list({\n  limit: 10,\n  page: 1\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get a message\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.message.single(\"sms_message_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Activity\n\n### Get activity list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, SmsActivityStatusType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.activity.list({\n  sms_number_id: \"number_id\",\n  status: [SmsActivityStatusType.SENT, SmsActivityStatusType.DELIVERED],\n  limit: 10,\n  page: 1\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Recipients\n\n### Get recipient list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.recipient.list({\n  sms_number_id: \"sms_number_id\",\n  status: \"active\",\n  limit: 10,\n  page: 1,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get recipient\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.recipient.single(\"sms_recipient_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update recipient\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.recipient.update(\"sms_recipient_id\", \"active\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Webhooks\n\n### Get webhook list for a number\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.webhook.list(\"sms_number_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get webhook\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.webhook.single(\"sms_webhook_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Create webhook\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, SmsWebhook, SmsWebhookEventType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst smsWebhook = new SmsWebhook()\n  .setName(\"Sms Webhook\")\n  .setUrl(\"https:://yourapp.com/hook\")\n  .setSmsNumberId(\"sms_number_id\")\n  .setEnabled(true)\n  .setEvents([SmsWebhookEventType.SENT, SmsWebhookEventType.DELIVERED])\n\nmailerSend.sms.webhook.create(smsWebhook)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update webhook\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.webhook.update(\"sms_webhook_id\", {\n  name: \"Webhook\",\n  url: \"https:://yourapp.com/hook\",\n  enabled: [\"sms.sent\", \"sms.delivered\", \"sms.failed\"],\n  enabled: true\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete webhook\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.webhook.delete(\"sms_webhook_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Verify webhook signature\n\nSee [Utils — Verify a webhook signature](#verify-a-webhook-signature).\n\n## Inbound\n\n### Get inbound list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.inbound.list({\n  enabled: 1,\n  sms_number_id: \"sms_number_id\",\n  limit: 10,\n  page: 1,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get inbound\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.inbound.single(\"sms_inbound_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Add inbound\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, SmsInbound } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst smsInbound = new SmsInbound()\n  .setSmsNumberId(\"sms_number_id\")\n  .setEnabled(true)\n  .setName(\"Inbound Name\")\n  .setForwardUrl(\"yourapp.com/hook\")\n  .setFilter({\n    comparer: \"equal\",\n    value: \"START\"\n  });\n\nmailerSend.sms.inbound.create(smsInbound)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update inbound\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, SmsInbound } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst smsInbound = new SmsInbound()\n  .setSmsNumberId(\"sms_number_id\")\n  .setEnabled(true)\n  .setName(\"Inbound Name Update\")\n  .setForwardUrl(\"yourapp.com/hook\")\n  .setFilter({\n    comparer: \"equal\",\n    value: \"START\"\n  });\n\nmailerSend.sms.inbound.update(\"sms_inbound_id\", {...smsInbound})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete inbound\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.inbound.delete(\"sms_inbound_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Identity\n\n### Get identity list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.list()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get identity\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.single(\"identity_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get identity by email address\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.singleByEmail('email_address')\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Create identity\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, Inbound, InboundFilterType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst identity = new Identity()\n  .setDomainId('domain_id')\n  .setEmail('identity@yourdomain.com')\n  .setName('Name')\n  .setReplyToEmail('reply_identity@yourdomain.com')\n  .setReplyToName('Reply Name')\n  .setAddNote(false);\n\nmailerSend.email.identity.create(identity)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update identity\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst data = {\n  name: 'name',\n  reply_to_name: 'Reply Name',\n  reply_to_email: 'reply@yourdomain.com',\n};\n\nmailerSend.email.identity.update('identity_id', data)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update identity by email address\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst data = {\n  name: 'name',\n  reply_to_name: 'Reply Name',\n  reply_to_email: 'reply@yourdomain.com',\n};\n\nmailerSend.email.identity.updateByEmail('email_address', data)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete identity\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.delete(\"identity_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete identity by email address\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.deleteByEmail('email_address')\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Resend identity verification\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.resend(\"identity_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## SMTP Users\n\n### List SMTP users\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.smtpUser.list(\"domain_id\", { page: 1, limit: 25 })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get SMTP user\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.smtpUser.single(\"domain_id\", \"smtp_user_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Create SMTP user\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.smtpUser.create(\"domain_id\", {\n  name: \"My SMTP User\",\n  enabled: true,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update SMTP user\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.smtpUser.update(\"domain_id\", \"smtp_user_id\", {\n  name: \"Updated SMTP User\",\n  enabled: false,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete SMTP user\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.smtpUser.delete(\"domain_id\", \"smtp_user_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Users\n\n### Get user list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.user.list({ page: 1, limit: 25 })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get single user\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.user.single(\"user_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Invite a user\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.user.create({\n  email: \"user@example.com\",\n  role: \"manager\",\n  // For role \"custom\", permissions is required:\n  // permissions: [\"read-activity\", \"read-analytics\"],\n  // templates: [\"template_id\"],\n  // domains: [\"domain_id\"],\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update user\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.user.update(\"user_id\", {\n  role: \"designer\",\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete user\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.user.delete(\"user_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get invite list\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.user.listInvites({ page: 1, limit: 25 })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get single invite\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.user.singleInvite(\"invite_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Resend invite\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.user.resendInvite(\"invite_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Cancel invite\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.user.deleteInvite(\"invite_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## DMARC Monitoring\n\n### List monitors\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.dmarc.list({ page: 1, limit: 25 })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n```\n\n### Create monitor\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, Dmarc } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst dmarc = new Dmarc(\"domain_id\");\n\nmailerSend.dmarc.create(dmarc)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n```\n\n### Update monitor\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.dmarc.update(\"monitor_id\", { wanted_dmarc_record: \"v=DMARC1; p=reject;\" })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n```\n\n### Delete monitor\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.dmarc.delete(\"monitor_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n```\n\n### Get aggregated reports\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.dmarc.report(\"monitor_id\", { page: 1, limit: 25 })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n```\n\n### Get IP-specific reports\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.dmarc.reportByIp(\"monitor_id\", \"1.2.3.4\", { page: 1, limit: 25 })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n```\n\n### Get report sources\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.dmarc.reportSources(\"monitor_id\", {\n  date_from: 1700000000,\n  date_to: 1700100000,\n  status: \"accepted\", // optional: \"accepted\" | \"rejected\" | \"quarantined\"\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n```\n\n### Mark IP as favorite\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.dmarc.addFavorite(\"monitor_id\", \"1.2.3.4\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n```\n\n### Remove IP from favorites\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.dmarc.removeFavorite(\"monitor_id\", \"1.2.3.4\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n```\n\n## Blocklist Monitoring\n\n### List blocklist monitors\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.blocklistMonitor.list({ page: 1, limit: 25 })\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Get single blocklist monitor\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.blocklistMonitor.single(\"monitor_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Create blocklist monitor\n\n```js\nimport 'dotenv/config';\nimport { MailerSend, BlocklistMonitor } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst monitor = new BlocklistMonitor(\"example.com\")\n  .setName(\"My Domain Monitor\")\n  .setNotify(true)\n  .setNotifyEmail(\"alerts@example.com\");\n\nmailerSend.blocklistMonitor.create(monitor)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Update blocklist monitor\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.blocklistMonitor.update(\"monitor_id\", {\n  name: \"Updated Monitor Name\",\n  notify: true,\n  notify_email: \"alerts@example.com\",\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n### Delete blocklist monitor\n\n```js\nimport 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.blocklistMonitor.delete(\"monitor_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Other endpoints\n\n### Get API quota\n\n```js\nimport 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.others.getApiQuota()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n\n```\n\n## Utils\n\n### Verify a webhook signature\n\nUse `MailerSendUtils.verifyWebHook()` to verify the HMAC signature on incoming webhook requests. This works for both email and SMS webhooks.\n\n```js\nimport { MailerSendUtils } from \"mailersend\";\n\n// rawBody must be the raw Buffer from the request (do not parse it as JSON first)\nconst isValid = MailerSendUtils.verifyWebHook(\n  rawBody,\n  request.headers['x-mailersend-signature'],\n  process.env.WEBHOOK_SIGNING_SECRET\n);\n```\n\n# Support and Feedback\n\nIn case you find any bugs, submit an issue directly here in GitHub.\n\nYou are welcome to create SDK for any other programming language.\n\nIf you have any troubles using our API or SDK free to contact our support by email [info@mailersend.com](mailto:info@mailersend.com)\n\nThe official documentation is at [https://developers.mailersend.com](https://developers.mailersend.com)\n\n# License\n\n[The MIT License (MIT)](LICENSE)\n"
  },
  {
    "path": "examples/v1/activity/byCountry.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.activityByCountry({\n  date_from: 1443651141,\n  date_to: 2443651141\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/activity/byDate.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.activityByDate({\n  date_from: 1443651141,\n  date_to: 2443651141,\n  event: [\"sent\"]\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/activity/byReadingEnvironment.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.activityByReadingEnvironment({\n  date_from: 1443651141,\n  date_to: 2443651141\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/activity/byUserAgent.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.activityByUserAgent({\n  date_from: 1443651141,\n  date_to: 2443651141\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/activity/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.activityList({\n  domain_id: \"xxx\",\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/domains/add.js",
    "content": "\"use strict\";\nrequire(\"dotenv\").config();\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.addDomain({\n    name: \"example.com\",\n    return_path_subdomain: \"rp_subdomain\",\n    custom_tracking_subdomain: \"ct_subdomain\",\n    inbound_routing_subdomain: \"ir_subdomain\",\n  })\n  .then((response) => response.json())\n  .then((data) => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/domains/delete.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteDomain({\n  domain_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/domains/dns.js",
    "content": "\"use strict\";\nrequire(\"dotenv\").config();\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getDNS({\n    domain_id: \"xxx\",\n  })\n  .then((response) => {\n    response.json();\n  })\n  .then((data) => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/domains/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.domainList({\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/domains/recipients.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.domainRecipients({\n  domain_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/domains/settings.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.domainSettings({\n  domain_id: 'xxx',\n  send_paused: false\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/domains/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.domain({\n  domain_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/domains/verify.js",
    "content": "\"use strict\";\nrequire(\"dotenv\").config();\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.verifyDomain({\n    domain_id: \"xxx\",\n  })\n  .then((response) => {\n    response.json();\n  })\n  .then((data) => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/email/advancedPersonalization.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst Recipient = require(\"../../src/Recipient\");\nconst EmailParams = require(\"../../src/EmailParams\");\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n    api_key: process.env.API_KEY,\n});\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst personalization = [\n  {\n    email: \"your@client.com\",\n    data: {\n      test: 'Test Value'\n    },\n  }\n];\n\nconst emailParams = new EmailParams()\n      .setFrom(\"your@domain.com\")\n      .setFromName(\"Your Name\")\n      .setRecipients(recipients)\n      .setPersonalization(personalization)\n      .setSubject(\"Subject, {{ test }}\")\n      .setHtml(\"This is the HTML content, {{ test }}\")\n      .setText(\"This is the text content, {{ test }}\");\n\nmailersend.send(emailParams);\n"
  },
  {
    "path": "examples/v1/email/ccBccRecipients.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst Recipient = require(\"../../src/Recipient\");\nconst EmailParams = require(\"../../src/EmailParams\");\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\nconst cc = [\n  new Recipient(\"your_cc@client.com\", \"Your CC Client\")\n];\nconst bcc = [\n  new Recipient(\"your_bcc@client.com\", \"Your BCC Client\")\n];\n\nconst emailParams = new EmailParams()\n      .setFrom(\"your@domain.com\")\n      .setFromName(\"Your Name\")\n      .setRecipients(recipients)\n      .setCc(cc)\n      .setBcc(bcc)\n      .setSubject(\"Subject\")\n      .setHtml(\"This is the HTML content\")\n      .setText(\"This is the text content\");\n\nmailersend.send(emailParams);\n"
  },
  {
    "path": "examples/v1/email/getBulkEmailRequestStatus.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getBulkEmailRequestStatus({\n  bulk_email_id: 'xxx'\n})\n  .then((response) => response.json())\n  .then((data) => {\n    console.log(data);\n  });\n\n\n"
  },
  {
    "path": "examples/v1/email/sendAnEmail.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst Recipient = require(\"../../src/Recipient\");\nconst EmailParams = require(\"../../src/EmailParams\");\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n    api_key: process.env.API_KEY,\n});\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n      .setFrom(\"your@domain.com\")\n      .setFromName(\"Your Name\")\n      .setRecipients(recipients)\n      .setReplyTo(\"reply@domain.com\")\n      .setReplyToName(\"Reply to name\")\n      .setSubject(\"Subject\")\n      .setHtml(\"This is the HTML content\")\n      .setText(\"This is the text content\");\n\nmailersend.send(emailParams);\n"
  },
  {
    "path": "examples/v1/email/sendBulkEmail.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst Recipient = require(\"../../src/Recipient\");\nconst EmailParams = require(\"../../src/EmailParams\");\nconst MailerSend = require(\"../../src/MailerSend\");\nconst BulkEmails = require(\"../../src/BulkEmails\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nconst bulkEmails = new BulkEmails();\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(\"your@domain.com\")\n  .setFromName(\"Your Name\")\n  .setRecipients(recipients)\n  .setSubject(\"Subject\")\n  .setHtml(\"This is the HTML content\")\n  .setText(\"This is the text content\");\n\n\nbulkEmails.addEmail(emailParams)\nbulkEmails.addEmails([\n  emailParams,\n  emailParams\n])\n\nmailersend.sendBulk(bulkEmails)\n  .then((response) => response.json())\n  .then((data) => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/email/sendScheduleEmail.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst Recipient = require(\"../../src/Recipient\");\nconst EmailParams = require(\"../../src/EmailParams\");\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n    api_key: process.env.API_KEY,\n});\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n      .setFrom(\"your@domain.com\")\n      .setFromName(\"Your Name\")\n      .setRecipients(recipients)\n      .setReplyTo(\"reply@domain.com\")\n      .setReplyToName(\"Reply to name\")\n      .setSubject(\"Subject\")\n      .setSendAt(2443651141) //set sendAt is a timestamp - min: now, max: now + 72hours\n      .setHtml(\"This is the HTML content\")\n      .setText(\"This is the text content\");\n\nmailersend.send(emailParams);\n"
  },
  {
    "path": "examples/v1/email/simplePersonalization.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\n// const Recipient = require(\"../../src/Recipient\");\nconst EmailParams = require(\"../../src/EmailParams\");\nconst MailerSend = require(\"../../src/MailerSend\");\nconst { default: Recipient } = require('../../src/Recipient');\n\nconst mailersend = new MailerSend({\n    api_key: process.env.API_KEY,\n});\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst variables = [\n  {\n    email: \"your@client.com\",\n    substitutions: [\n      {\n        var: 'test',\n        value: 'Test Value'\n      }\n    ],\n  }\n];\n\nconst emailParams = new EmailParams()\n      .setFrom(\"your@domain.com\")\n      .setFromName(\"Your Name\")\n      .setRecipients(recipients)\n      .setVariables(variables)\n      .setSubject(\"Subject, {$test}\")\n      .setHtml(\"This is the HTML content, {$test}\")\n      .setText(\"This is the text content, {$test}\");\n\nmailersend.send(emailParams);\n"
  },
  {
    "path": "examples/v1/email/templatedEmail.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst Recipient = require(\"../../src/Recipient\");\nconst EmailParams = require(\"../../src/EmailParams\");\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n      .setFrom(\"your@domain.com\")\n      .setFromName(\"Your Name\")\n      .setRecipients(recipients)\n      .setTemplateId('templateId')\n      .setSubject(\"Subject\")\n\nmailersend.send(emailParams);\n"
  },
  {
    "path": "examples/v1/email/withAttachment.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\nconst fs = require('fs');\n\nconst Recipient = require(\"../../src/Recipient\");\nconst Attachment = require(\"../../src/Attachment\");\nconst EmailParams = require(\"../../src/EmailParams\");\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n    api_key: process.env.API_KEY,\n});\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst attachments = [\n  new Attachment(fs.readFileSync('/path/to/file.pdf', {encoding: 'base64'}), 'file.pdf', 'attachment')\n]\n\nconst emailParams = new EmailParams()\n      .setFrom(\"your@domain.com\")\n      .setFromName(\"Your Name\")\n      .setRecipients(recipients)\n      .setAttachments(attachments)\n      .setSubject(\"Subject\")\n      .setHtml(\"This is the HTML content\")\n      .setText(\"This is the text content\");\n\nmailersend.send(emailParams);\n"
  },
  {
    "path": "examples/v1/email-verification/create.js",
    "content": "\"use strict\";\nrequire(\"dotenv\").config();\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.createEmailVerificationList({\n  name: \"List example\",\n  emails: [\n    \"info@mailersend.com\",\n    \"test@mailersend.com\"\n  ]\n})\n  .then((response) => response.json())\n  .then((data) => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/email-verification/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.emailVerificationLists({\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/email-verification/results.js",
    "content": "\"use strict\";\nrequire(\"dotenv\").config();\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.emailVerificationResults({\n  email_verification_id: \"xxx\",\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/email-verification/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.emailVerificationList({\n  email_verification_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/email-verification/verify.js",
    "content": "\"use strict\";\nrequire(\"dotenv\").config();\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.verifyEmailVerificationList({\n  email_verification_id: \"xxx\",\n})\n  .then((response) => response.json())\n  .then((data) => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/inbounds/create.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.createInbound({\n  domain_id: \"xxx\",\n  name: \"Test name\",\n  domain_enabled: true,\n  inbound_domain: \"test.yourdomain.com\",\n  inbound_address: \"test@inbound.yourdomain.com\",\n  inbound_subdomain: \"inbound\",\n  inbound_priority: 100,\n  match_filter: {\n    type: \"match_all\"\n  },\n  catch_filter: {\n    type: \"catch_recipient\",\n    filters: [\n      {\n        comparer: \"equal\",\n        value: \"test\"\n        }\n    ]\n  },\n  forwards: [\n    {\n      type: \"webhook\",\n      value: \"https://www.yourdomain.com/hook\"\n    }\n  ]\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/inbounds/delete.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteInbound({\n  inbound_id: 'xxx'\n});\n"
  },
  {
    "path": "examples/v1/inbounds/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.inboundList()\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/inbounds/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.inbound({\n  inbound_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/inbounds/update.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.updateInbound({\n  inbound_id: \"xxx\",\n  domain_id: \"xxx\",\n  name: \"Test name\",\n  domain_enabled: true,\n  inbound_domain: \"test.yourdomain.com\",\n  inbound_address: \"test@inbound.yourdomain.com\",\n  inbound_subdomain: \"inbound\",\n  inbound_priority: 100,\n  match_filter: {\n    type: \"match_all\"\n  },\n  catch_filter: {\n    type: \"catch_recipient\",\n    filters: [\n      {\n        comparer: \"equal\",\n        value: \"test\"\n        }\n    ]\n  },\n  forwards: [\n    {\n      type: \"webhook\",\n      value: \"https://www.yourdomain.com/hook\"\n    }\n  ]\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/messages/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.messagesList()\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/messages/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.message({\n  message_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/recipients/addRecipientsToBlocklist.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.addRecipientsToBlocklist({\n  domain_id: 'xxx',\n  recipients: [\n    \"test@example.com\"\n  ]\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/recipients/addRecipientsToHardBounceList.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.addRecipientsToHardBounceList({\n  domain_id: 'xxx',\n  recipients: [\n    \"test@example.com\"\n  ]\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/recipients/addRecipientsToSpamComplaintList.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.addRecipientsToSpamComplaintList({\n  domain_id: 'xxx',\n  recipients: [\n    \"test@example.com\"\n  ]\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/recipients/addRecipientsToUnsubscribeList.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.addRecipientsToUnsubscribeList({\n  domain_id: 'xxx',\n  recipients: [\n    \"test@example.com\"\n  ]\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/recipients/delete.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteRecipient({\n  recipient_id: 'xxx'\n});\n"
  },
  {
    "path": "examples/v1/recipients/deleteRecipientsFromBlocklist.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteRecipientsFromBlocklist({\n  ids: [\n    \"xxxxxxxxxxx\",\n    \"yyyyyyyyyyy\"\n  ]\n});\n"
  },
  {
    "path": "examples/v1/recipients/deleteRecipientsFromHardBounceList.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteRecipientsFromHardBounceList({\n  ids: [\n    \"xxxxxxxxxxx\",\n    \"yyyyyyyyyyy\"\n  ]\n});\n"
  },
  {
    "path": "examples/v1/recipients/deleteRecipientsFromSpamComplaintList.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteRecipientsFromSpamComplaintList({\n  ids: [\n    \"xxxxxxxxxxx\",\n    \"yyyyyyyyyyy\"\n  ]\n});\n"
  },
  {
    "path": "examples/v1/recipients/deleteRecipientsFromUnsubscribeList.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteRecipientsFromUnsubscribeList({\n  ids: [\n    \"xxxxxxxxxxx\",\n    \"yyyyyyyyyyy\"\n  ]\n});\n"
  },
  {
    "path": "examples/v1/recipients/getRecipientsFromBlocklist.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getRecipientsFromBlocklist({\n  domain_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/recipients/getRecipientsFromHardBounceList.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getRecipientsFromHardBounceList({\n  domain_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/recipients/getRecipientsFromSpamComplaintList.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getRecipientsFromSpamComplaintList({\n  domain_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/recipients/getRecipientsFromUnsubscribeList.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getRecipientsFromUnsubscribeList({\n  domain_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/recipients/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.recipientsList()\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/recipients/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.recipient({\n  recipient_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/scheduled/delete.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteSchedule({\n  message_id: 'xxx'\n});\n"
  },
  {
    "path": "examples/v1/scheduled/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.scheduleList()\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/scheduled/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.schedule({\n  message_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/activities/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsActivities()\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/activities/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsActivity({\n  sms_message_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/inbounds/create.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.createSmsInbound({\n  sms_number_id: \"xxx\",\n  name: \"Inbound\",\n  forward_url: \"https:://yourapp.com/hook\",\n  filter: {\n    comparer: \"equal\",\n    value: \"START\"\n  },\n  enabled: true\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/inbounds/delete.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteSmsInbound({\n  sms_inbound_id: 'xxx'\n});\n"
  },
  {
    "path": "examples/v1/sms/inbounds/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsInbounds()\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/inbounds/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsInbound({\n  sms_inbound_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/inbounds/update.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.updateSmsInbound({\n  sms_inbound_id: \"xxx\",\n  name: \"Inbound\",\n  forward_url: \"https:://yourapp.com/hook\",\n  filter: {\n    comparer: \"equal\",\n    value: \"START\"\n  },\n  enabled: true\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/messages/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsMessages()\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/messages/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsMessage({\n  sms_message_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/numbers/delete.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteSmsNumber({\n  sms_number_id: 'xxx'\n});\n"
  },
  {
    "path": "examples/v1/sms/numbers/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsNumbers()\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/numbers/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsNumber({\n  sms_number_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/numbers/update.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.updateSmsNumber({\n  sms_number_id: 'xxx',\n  paused: false\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/recipients/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsRecipients()\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/recipients/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsRecipient({\n  sms_recipient_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/recipients/update.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.updateSmsRecipient({\n  sms_recipient_id: \"xxx\",\n  status: \"active\"\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/sendAnSms.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\nconst SmsParams = require(\"../../src/SmsParams\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nconst to = [\n  \"+18332647501\"\n];\n\nconst smsParams = new SmsParams()\n  .setFrom(\"+18332647501\")\n  .setTo(to)\n  .setText(\"This is the text content\");\n\nmailersend.sendSms(smsParams);\n"
  },
  {
    "path": "examples/v1/sms/smsPersonalization.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\nconst SmsParams = require(\"../../src/SmsParams\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nconst to = [\n  \"+18332647501\",\n  \"+18332647502\"\n];\n\nconst personalization = [\n  {\n    \"phone_number\": \"+18332647501\",\n    \"data\": {\n      \"name\": \"Dummy\"\n    }\n  },\n  {\n    \"phone_number\": \"+18332647502\",\n    \"data\": {\n      \"name\": \"Not Dummy\"\n    }\n  }\n];\n\nconst smsParams = new SmsParams()\n  .setFrom(\"+18332647501\")\n  .setTo(to)\n  .setPersonalization(personalization)\n  .setText(\"Hey {{name}} welcome to our organization\");\n\nmailersend.sendSms(smsParams);\n"
  },
  {
    "path": "examples/v1/sms/webhooks/create.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.createSmsWebhook({\n  sms_number_id: \"xxx\",\n  name: \"Webhook\",\n  url: \"https:://yourapp.com/hook\",\n  enabled: [\"sms.sent\", \"sms.delivered\", \"sms.failed\"],\n  enabled: true\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/webhooks/delete.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteSmsWebhook({\n  sms_webhook_id: 'xxx'\n});\n"
  },
  {
    "path": "examples/v1/sms/webhooks/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsWebhooks({\n  sms_number_id: 'xxx',\n  limit: 10\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/webhooks/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.getSmsWebhook({\n  sms_webhook_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/sms/webhooks/update.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.updateSmsWebhook({\n  sms_webhook_id: \"xxx\",\n  name: \"Webhook\",\n  url: \"https:://yourapp.com/hook\",\n  enabled: [\"sms.sent\", \"sms.delivered\", \"sms.failed\"],\n  enabled: true\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/templates/delete.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n    api_key: process.env.API_KEY,\n});\n\nmailersend.deleteTemplate({\n    template_id: 'xxx'\n});"
  },
  {
    "path": "examples/v1/templates/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n    api_key: process.env.API_KEY,\n});\n\nmailersend.templateList()\n.then(response => response.json())\n.then(data => {\n    console.log(data);\n});"
  },
  {
    "path": "examples/v1/templates/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n    api_key: process.env.API_KEY,\n});\n\nmailersend.template({\n    template_id: 'xxx'\n})\n.then(response => response.json())\n.then(data => {\n    console.log(data);\n});"
  },
  {
    "path": "examples/v1/tokens/createToken.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.createToken({\n  name: \"Token name\",\n  domain_id: \"xxx\",\n  scopes: [\n    \"email_full\",\n    \"domains_read\",\n    \"domains_full\",\n    \"activity_read\",\n    \"activity_full\",\n    \"analytics_read\",\n    \"analytics_full\",\n    \"tokens_full\",\n  ]\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/tokens/deleteToken.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteToken({\n  token_id: \"xxx\"\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/tokens/updateToken.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.updateToken({\n  token_id: \"xxx\",\n  status: \"pause\"\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/webhooks/create.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.createWebhook({\n  url: \"https://example.com\",\n  name: \"Webhook name\",\n  events: [\"activity.sent\"],\n  domain_id: \"xxx\"\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/webhooks/delete.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.deleteWebhook({\n  webhook_id: 'xxx'\n});\n"
  },
  {
    "path": "examples/v1/webhooks/list.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.webhooksList({\n  domain_id: \"xxx\"\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/webhooks/single.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.webhook({\n  webhook_id: 'xxx'\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v1/webhooks/update.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nmailersend.updateWebhook({\n  webhook_id: \"xxx\",\n  name: \"New name\"\n})\n  .then(response => response.json())\n  .then(data => {\n    console.log(data);\n  });\n"
  },
  {
    "path": "examples/v2/email/activity/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, ActivityEventType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst queryParams = {\n  limit: 10, // Min: 10, Max: 100, Default: 25\n  page: 2,\n  date_from: 1443651141, // Unix timestamp\n  date_to: 1443651141, // Unix timestamp\n  event: [ActivityEventType.SENT, ActivityEventType.SOFT_BOUNCED]\n}\n\nmailerSend.email.activity.domain(\"domain_id\", queryParams)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error));\n"
  },
  {
    "path": "examples/v2/email/advancedPersonalization.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst personalization = [\n  {\n    email: \"your@client.com\",\n    data: {\n      test: 'Test Value'\n    },\n  }\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setPersonalization(personalization)\n  .setSubject(\"Subject, {{ test }}\")\n  .setHtml(\"This is the HTML content, {{ test }}\")\n  .setText(\"This is the text content, {{ test }}\");\n\nawait mailerSend.email.send(emailParams);\n"
  },
  {
    "path": "examples/v2/email/analytics/byCountry.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.analytics.byCountry({\n  date_from: 1443651141,\n  date_to: 2443651141,\n}).then(response => {\n  console.log(response.body);\n}).catch(error => {\n  console.log(error.body);\n});\n"
  },
  {
    "path": "examples/v2/email/analytics/byDate.js",
    "content": "import 'dotenv/config';\nimport { ActivityEventType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.analytics.byDate({\n  date_from: 1443651141,\n  date_to: 2443651141,\n  event: [ActivityEventType.CLICKED, ActivityEventType.OPENED],\n}).then(response => {\n  console.log(response.body);\n}).catch(error => {\n  console.log(error.body);\n});\n"
  },
  {
    "path": "examples/v2/email/analytics/byReadingEnvironment.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.analytics.byReadingEnvironment({\n  date_from: 1443651141,\n  date_to: 2443651141,\n}).then(response => {\n  console.log(response.body);\n}).catch(error => {\n  console.log(error.body);\n});\n"
  },
  {
    "path": "examples/v2/email/analytics/byUserAgent.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.analytics.byUserAgent({\n  date_from: 1443651141,\n  date_to: 2443651141,\n}).then(response => {\n  console.log(response.body);\n}).catch(error => {\n  console.log(error.body);\n});\n"
  },
  {
    "path": "examples/v2/email/ccBccRecipients.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"bbbb@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\nconst cc = [\n  new Recipient(\"your_cc@client.com\", \"Your Client CC\")\n];\nconst bcc = [\n  new Recipient(\"your_bcc@client.com\", \"Your Client BCC\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setCc(cc)\n  .setBcc(bcc)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\");\n\nawait mailerSend.email.send(emailParams);"
  },
  {
    "path": "examples/v2/email/domains/add.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, Domain } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst domain = new Domain({\n  name: \"example.com\",\n  returnPathSubdomain: \"rp_subdomain\",\n  customTrackingSubdomain: \"ct_subdomain\",\n  inboundRoutingSubdomain: \"ir_subdomain\",\n})\n\nmailerSend.email.domain.create(domain)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/domains/delete.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.delete(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/domains/dns.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.dns(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/domains/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.list()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/domains/recipients.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.recipients(\"domain_id\", {\n  page: 1,\n  limit: 10\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/domains/settings.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.updateSettings(\"domain_id\", {\n  send_paused: 1,\n  track_clicks: 1,\n  track_opens: 1,\n  track_unsubscribe: 1,\n  track_unsubscribe_html: \"<strong> Unsubscribe now </strong>\",\n  track_unsubscribe_plain: \"Unsubscribe now\",\n  track_content: 1,\n  custom_tracking_enabled: 1,\n  custom_tracking_subdomain: \"subdomain\",\n  precedence_bulk: 1,\n  ignore_duplicated_recipients: 1,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/domains/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.single(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/domains/verify.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.domain.verify(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/getBulkEmailRequestStatus.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.getBulkStatus('bulk_email_id') // bulk email Id e.g 63af1fdb790d97105a090001\n  .then((response) => {\n    console.log(response.body);\n  });\n"
  },
  {
    "path": "examples/v2/email/identities/create.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, Identity } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst identity = new Identity()\n  .setDomainId('domain_id')\n  .setEmail('identity@yourdomain.com')\n  .setName('Name')\n  .setReplyToEmail('reply_identity@yourdomain.com')\n  .setReplyToName('Reply Name')\n  .setAddNote(false);\n\nmailerSend.email.identity.create(identity)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/identities/delete.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.delete(\"identity_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n  "
  },
  {
    "path": "examples/v2/email/identities/deleteByEmail.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.deleteByEmail('email_address')\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n  "
  },
  {
    "path": "examples/v2/email/identities/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.list()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/identities/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.single(\"identity_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/identities/singleByEmail.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.identity.singleByEmail('email_address')\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/identities/update.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, Inbound, InboundFilterType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst data = {\n  domain_id: 'string',\n  email: 'email@yourdomain.com',\n  name: 'name',\n  personal_note: 'Personal note',\n  reply_to_name: 'Reply Name',\n  reply_to_email: 'repy@yourdomain.com',\n  add_note: true,\n};\n\nmailerSend.email.identity.update('identiy_id', data)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/identities/updateByEmail.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, Inbound, InboundFilterType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst data = {\n  domain_id: 'string',\n  email: 'email@yourdomain.com',\n  name: 'name',\n  personal_note: 'Personal note',\n  reply_to_name: 'Reply Name',\n  reply_to_email: 'repy@yourdomain.com',\n  add_note: true,\n};\n\nmailerSend.email.identity.updateByEmail('email_address', data)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/inbounds/create.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, Inbound, InboundFilterType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst inbound = new Inbound('inbound test', true, 'domain_id')\n  .setInboundPriority(100)\n  .setMatchFilter({\n    type: InboundFilterType.MATCH_ALL,\n  })\n  .setForwards([\n    {\n      type: \"webhook\",\n      value: \"https://www.yourdomain.com/hook\"\n    }\n  ]);\n\nmailerSend.email.inbound.create(inbound)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/inbounds/delete.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.inbound.delete(\"inbound_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n  "
  },
  {
    "path": "examples/v2/email/inbounds/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.inbound.list()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/inbounds/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.inbound.single(\"inbound_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/inbounds/update.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, Inbound, InboundFilterType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst inbound = new Inbound('inbound test 2', false, 'domain_id')\n  .setMatchFilter({\n    type: InboundFilterType.MATCH_ALL,\n  })\n  .setForwards([\n    {\n      type: \"webhook\",\n      value: \"https://www.yourdomain.com/hook\"\n    }\n  ]);\n\nmailerSend.email.inbound.update('inbound_id', inbound)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/messages/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\n\nmailerSend.email.message.list()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/messages/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.message.single(\"message_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/addRecipientsToBlocklist.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockRecipients({\n  domain_id: 'domain_id',\n  recipients: [\n    \"test@example.com\"\n  ]\n}, BlockListType.BLOCK_LIST)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/addRecipientsToHardBounceList.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockRecipients({\n  domain_id: 'domain_id',\n  recipients: [\n    \"test@example.com\"\n  ]\n}, BlockListType.HARD_BOUNCES_LIST)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/addRecipientsToSpamComplaintList.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockRecipients({\n  domain_id: 'domain_id',\n  recipients: [\n    \"test@example.com\"\n  ]\n}, BlockListType.SPAM_COMPLAINTS_LIST)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/addRecipientsToUnsubscribeList.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockRecipients({\n  domain_id: 'domain_id',\n  recipients: [\n    \"test@example.com\"\n  ]\n}, BlockListType.UNSUBSCRIBES_LIST)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/delete.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delete(\"recipient_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/deleteAllBlocklistRecipients.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delAllBlockListRecipients(BlockListType.BLOCK_LIST)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/deleteRecipientsFromBlocklist.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delBlockListRecipients(\n  [\"recipient_id\", \"recipient_id\"],\n  BlockListType.BLOCK_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/deleteRecipientsFromHardBounceList.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delBlockListRecipients(\n  [\"recipient_id\", \"recipient_id\"],\n  BlockListType.HARD_BOUNCES_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/deleteRecipientsFromSpamComplaintList.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delBlockListRecipients(\n  [\"recipient_id\", \"recipient_id\"],\n  BlockListType.SPAM_COMPLAINTS_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/deleteRecipientsFromUnsubscribeList.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.delBlockListRecipients(\n  [\"recipient_id\", \"recipient_id\"],\n  BlockListType.UNSUBSCRIBES_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/getRecipientsFromBlocklist.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockList(\n  { domain_id: \"domain_id\", },\n  BlockListType.BLOCK_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/getRecipientsFromHardBounceList.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockList(\n  { domain_id: \"domain_id\", },\n  BlockListType.HARD_BOUNCES_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/getRecipientsFromSpamComplaintList.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockList(\n  { domain_id: \"domain_id\", },\n  BlockListType.SPAM_COMPLAINTS_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/getRecipientsFromUnsubscribeList.js",
    "content": "import 'dotenv/config';\nimport { BlockListType, MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.blockList(\n  { domain_id: \"domain_id\", },\n  BlockListType.UNSUBSCRIBES_LIST\n)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.list({\n  domain_id: \"domain_id\",\n  limit: 10,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/recipients/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.recipient.single(\"recipient_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/scheduled/delete.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.schedule.delete(\"message_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/scheduled/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.schedule.list()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/scheduled/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.schedule.single(\"message_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/sendAnEmail.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\");\n\nawait mailerSend.email.send(emailParams);\n"
  },
  {
    "path": "examples/v2/email/sendBulkEmail.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"your@yourdomain.com\", \"Your name\");\n\nconst bulkEmails = [];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo([\n    new Recipient(\"your@client.com\", \"Your Client\")\n  ])\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\");\n\nbulkEmails.push(emailParams);\n\nconst emailParams2 = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo([\n    new Recipient(\"your_2@client.com\", \"Your Client 2\")\n  ])\n  .setSubject(\"This is a Subject 2\")\n  .setHtml(\"<strong>This is the HTML content 2</strong>\")\n  .setText(\"This is the text content 2\");\n\nbulkEmails.push(emailParams2);\n\nawait mailerSend.email.sendBulk(bulkEmails);"
  },
  {
    "path": "examples/v2/email/sendScheduleEmail.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"This is a scheduled Subject\")\n  .setHtml(\"<strong>This is a scheduled HTML content</strong>\")\n  .setText(\"This is a scheduled text content\")\n  .setSendAt(Math.floor((new Date(Date.now()+ 30*60*1000)).getTime() / 1000)); //send in 30mins NB:param has to be a Unix timestamp e.g 2443651141\n\nawait mailerSend.email.send(emailParams);"
  },
  {
    "path": "examples/v2/email/simplePersonalization.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst variables = [\n  {\n    email: \"your@client.com\",\n    substitutions: [\n      {\n        var: 'test',\n        value: 'Test Value'\n      }\n    ],\n  }\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setVariables(variables)\n  .setSubject(\"Subject, {$test}\")\n  .setHtml(\"This is the HTML content, {$test}\")\n  .setText(\"This is the text content, {$test}\");\n\nawait mailerSend.email.send(emailParams);"
  },
  {
    "path": "examples/v2/email/templatedEmail.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, EmailParams, Sender, Recipient } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setSubject(\"This is a Subject\")\n  .setTemplateId('templateId');\n\nawait mailerSend.email.send(emailParams);\n"
  },
  {
    "path": "examples/v2/email/templates/delete.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.template.single(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/templates/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.template.list({\n    domain_id: \"domain_id\"\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/templates/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.template.single(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/webhooks/create.js",
    "content": "import 'dotenv/config';\nimport { EmailWebhook, EmailWebhookEventType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst emailWebhook = new EmailWebhook()\n  .setName(\"Webhook Name\")\n  .setUrl(\"https://example.com\")\n  .setDomainId(\"domain_id\")\n  .setEnabled(true)\n  .setEvents([EmailWebhookEventType.SENT, EmailWebhookEventType.OPENED]);\n\nmailerSend.email.webhook.create(emailWebhook)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/webhooks/delete.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.webhook.delete(\"webhook_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/webhooks/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.webhook.list(\"domain_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/webhooks/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.email.webhook.single(\"webhook_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/webhooks/update.js",
    "content": "import 'dotenv/config';\nimport { EmailWebhook, EmailWebhookEventType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst emailWebhook = new EmailWebhook()\n  .setName(\"Webhook Name 2\")\n  .setEnabled(false)\n  .setEvents([EmailWebhookEventType.SENT, EmailWebhookEventType.OPENED]);\n\nmailerSend.email.webhook.update(\"webhook_id\", emailWebhook)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email/withAttachment.js",
    "content": "import 'dotenv/config';\nimport fs from \"fs\";\nimport { MailerSend, EmailParams, Sender, Recipient, Attachment } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst sentFrom = new Sender(\"you@yourdomain.com\", \"Your name\");\n\nconst recipients = [\n  new Recipient(\"your@client.com\", \"Your Client\")\n];\n\nconst attachments = [\n  new Attachment(\n    fs.readFileSync('/path/to/file.pdf', { encoding: 'base64' }),\n    'file.pdf',\n    'attachment'\n  )\n]\n\nconst emailParams = new EmailParams()\n  .setFrom(sentFrom)\n  .setTo(recipients)\n  .setReplyTo(sentFrom)\n  .setAttachments(attachments)\n  .setSubject(\"This is a Subject\")\n  .setHtml(\"<strong>This is the HTML content</strong>\")\n  .setText(\"This is the text content\");\n\nawait mailerSend.email.send(emailParams);\n"
  },
  {
    "path": "examples/v2/email-verification/create.js",
    "content": "import 'dotenv/config';\nimport { EmailVerification, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst emailVerification = new EmailVerification()\n  .setName(\"List example\")\n  .setEmails([\n    \"info@mailersend.com\",\n    \"test@mailersend.com\"\n  ]);\n\nmailerSend.emailVerification.create(emailVerification)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email-verification/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.list({\n  limit: 10,\n  page: 1\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email-verification/results.js",
    "content": "import 'dotenv/config';\nimport { EmailVerificationResultType, MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.getListResult(\"email_verification_id\",{\n  limit: 10,\n  page: 1,\n  result: [EmailVerificationResultType.CATCH_ALL, EmailVerificationResultType.DISPOSABLE]\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email-verification/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.single(\"email_verification_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email-verification/verifyEmail.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.verifyEmail(\"client@domain.com\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/email-verification/verifyList.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.emailVerification.verifyList(\"email_verification_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/others/getApiQuota.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.others.getApiQuota()\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/activities/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, SmsActivityStatusType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.activity.list({\n  sms_number_id: \"number_id\",\n  status: [SmsActivityStatusType.SENT, SmsActivityStatusType.DELIVERED],\n  limit: 10,\n  page: 1\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/activities/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.activity.single(\"sms_message_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/inbounds/create.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, SmsInbound } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst smsInbound = new SmsInbound()\n  .setSmsNumberId(\"sms_number_id\")\n  .setEnabled(true)\n  .setName(\"Inbound Name\")\n  .setForwardUrl(\"yourapp.com/hook\")\n  .setFilter({\n    comparer: \"equal\",\n    value: \"START\"\n  });\n\nmailerSend.sms.inbound.create(smsInbound)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/inbounds/delete.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.inbound.delete(\"sms_inbound_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/inbounds/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.inbound.list({\n  enabled: 1,\n  sms_number_id: \"sms_number_id\",\n  limit: 10,\n  page: 1,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/inbounds/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.inbound.single(\"sms_inbound_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/inbounds/update.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, SmsInbound } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst smsInbound = new SmsInbound()\n  .setSmsNumberId(\"sms_number_id\")\n  .setEnabled(true)\n  .setName(\"Inbound Name Update\")\n  .setForwardUrl(\"yourapp.com/hook\")\n  .setFilter({\n    comparer: \"equal\",\n    value: \"START\"\n  });\n\nmailerSend.sms.inbound.update(\"sms_inbound_id\", {...smsInbound})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/messages/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.message.list({\n  limit: 10,\n  page: 1\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/messages/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.message.single(\"sms_message_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/numbers/delete.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.number.delete(\"sms_number_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/numbers/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.number.list({\n  paused: false,\n  limit: 10,\n  page: 1\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/numbers/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.number.single(\"sms_number_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/numbers/update.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.number.update(\"sms_number_id\", true)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/recipients/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.recipient.list({\n  sms_number_id: \"sms_number_id\",\n  status: \"active\",\n  limit: 10,\n  page: 1,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/recipients/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.recipient.single(\"sms_recipient_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/recipients/update.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.recipient.list({\n  sms_number_id: \"sms_number_id\",\n  status: \"active\",\n  limit: 10,\n  page: 1,\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/sendAnSms.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\nconst SmsParams = require(\"../../src/SmsParams\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nconst to = [\n  \"+18332647501\"\n];\n\nconst smsParams = new SmsParams()\n  .setFrom(\"+18332647501\")\n  .setTo(to)\n  .setText(\"This is the text content\");\n\nmailersend.sendSms(smsParams);\n"
  },
  {
    "path": "examples/v2/sms/smsPersonalization.js",
    "content": "\"use strict\";\nrequire('dotenv').config()\n\nconst MailerSend = require(\"../../src/MailerSend\");\nconst SmsParams = require(\"../../src/SmsParams\");\n\nconst mailersend = new MailerSend({\n  api_key: process.env.API_KEY,\n});\n\nconst to = [\n  \"+18332647501\",\n  \"+18332647502\"\n];\n\nconst personalization = [\n  {\n    \"phone_number\": \"+18332647501\",\n    \"data\": {\n      \"name\": \"Dummy\"\n    }\n  },\n  {\n    \"phone_number\": \"+18332647502\",\n    \"data\": {\n      \"name\": \"Not Dummy\"\n    }\n  }\n];\n\nconst smsParams = new SmsParams()\n  .setFrom(\"+18332647501\")\n  .setTo(to)\n  .setPersonalization(personalization)\n  .setText(\"Hey {{name}} welcome to our organization\");\n\nmailersend.sendSms(smsParams);\n"
  },
  {
    "path": "examples/v2/sms/webhooks/create.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, SmsWebhook, SmsWebhookEventType } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst smsWebhook = new SmsWebhook()\n  .setName(\"Sms Webhook\")\n  .setUrl(\"https:://yourapp.com/hook\")\n  .setSmsNumberId(\"sms_number_id\")\n  .setEnabled(true)\n  .setEvents([SmsWebhookEventType.SENT, SmsWebhookEventType.DELIVERED])\n\nmailerSend.sms.webhook.create(smsWebhook)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/webhooks/delete.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.webhook.delete(\"sms_webhook_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/webhooks/list.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.webhook.list(\"sms_number_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/webhooks/single.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.webhook.single(\"sms_webhook_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/sms/webhooks/update.js",
    "content": "import 'dotenv/config';\nimport { MailerSend } from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.sms.webhook.update(\"sms_webhook_id\", {\n  name: \"Webhook\",\n  url: \"https:://yourapp.com/hook\",\n  enabled: [\"sms.sent\", \"sms.delivered\", \"sms.failed\"],\n  enabled: true\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/tokens/createToken.js",
    "content": "import 'dotenv/config';\nimport { MailerSend, Token} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nconst token = new Token()\n  .setName(\"Token name\")\n  .setDomainId(\"domain_id\")\n  .setScopes([\n    \"email_full\",\n    \"domains_read\",\n    \"domains_full\",\n    \"activity_read\",\n    \"activity_full\",\n    \"analytics_read\",\n    \"analytics_full\",\n    \"tokens_full\",\n  ]);\n\nmailerSend.token.create(token)\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/tokens/deleteToken.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.token.delete(\"token_id\")\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "examples/v2/tokens/updateToken.js",
    "content": "import 'dotenv/config';\nimport { MailerSend} from \"mailersend\";\n\nconst mailerSend = new MailerSend({\n  apiKey: process.env.API_KEY,\n});\n\nmailerSend.token.updateSettings(\"token_id\", {\n  status: \"pause\",\n})\n  .then((response) => console.log(response.body))\n  .catch((error) => console.log(error.body));\n"
  },
  {
    "path": "jestconfig.json",
    "content": "{\n    \"transform\": {\n      \"^.+\\\\.(t|j)sx?$\": \"ts-jest\"\n    },\n    \"testRegex\": \"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$\",\n    \"moduleFileExtensions\": [\"ts\", \"tsx\", \"js\", \"jsx\", \"json\", \"node\"],\n    \"coverageReporters\": [\"json-summary\", \"text\", \"lcov\"]\n  }\n  "
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"mailersend\",\n  \"version\": \"3.0.0\",\n  \"description\": \"Node.js helper module for MailerSend API\",\n  \"main\": \"./lib/index.js\",\n  \"typings\": \"./lib/index.d.ts\",\n  \"files\": [\n    \"lib/**/*\"\n  ],\n  \"directories\": {\n    \"lib\": \"./lib\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/mailersend/mailersend-nodejs.git\"\n  },\n  \"keywords\": [\n    \"mailersend\",\n    \"mailersend-ts\",\n    \"mailer_send\",\n    \"smtp-sender\",\n    \"email-sender\",\n    \"email-api\",\n    \"transactional-emails\",\n    \"transactional-sms\",\n    \"typescript\",\n    \"mailer-send\",\n    \"types\",\n    \"email\"\n  ],\n  \"author\": \"MailerSend\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mailersend/mailersend-nodejs/issues\"\n  },\n  \"homepage\": \"https://www.mailersend.com/\",\n  \"scripts\": {\n    \"build\": \"tsc\",\n    \"watch\": \"tsc --watch\",\n    \"test\": \"jest --config jestconfig.json\",\n    \"prepare\": \"npm run build\",\n    \"prepublishOnly\": \"npm test\",\n    \"version\": \"git add -A src\",\n    \"postversion\": \"git push && git push --tags\"\n  },\n  \"dependencies\": {\n    \"gaxios\": \"^7.0.0\",\n    \"qs\": \"^6.11.0\"\n  },\n  \"devDependencies\": {\n    \"@types/jest\": \"^29.0.0\",\n    \"dotenv\": \"^17.0.0\",\n    \"jest\": \"^29.7.0\",\n    \"jest-coverage-badges\": \"^1.1.2\",\n    \"nock\": \"^14.0.0\",\n    \"prettier\": \"^3.0.0\",\n    \"ts-jest\": \"^29.2.6\",\n    \"typescript\": \"^5.0.0\"\n  }\n}\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"extends\": [\"github>mailerlite/renovate-config:base\"]\n}\n"
  },
  {
    "path": "src/__tests__/modules/Activity.test.ts",
    "content": "import nock from \"nock\";\nimport { ActivityModule } from \"../../modules/email/Activity.module\";\nimport { ActivityEventType } from \"../../models/email/Activity\";\n\ndescribe(\"Activity Module\", () => {\n  const activityModule = new ActivityModule(\"test_key\", \"http://test.com\");\n\n  it(\"domain\", async () => {\n    nock(\"http://test.com\")\n      .get(\"/activity/test_id\")\n      .query({ limit: 20, page: 2, date_from: 1672531200, date_to: 1675209600 })\n      .reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const getActivities = await activityModule.domain(\"test_id\", { limit: 20, page: 2, date_from: 1672531200, date_to: 1675209600 });\n    expect(getActivities.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(getActivities.body).toMatchObject({ key1: \"key1_value\" });\n    expect(getActivities.statusCode).toBe(200);\n  });\n\n  it(\"domain with event filter\", async () => {\n    nock(\"http://test.com\")\n      .get(\"/activity/test_id\")\n      .query({ date_from: 1672531200, date_to: 1675209600, \"event[0]\": ActivityEventType.QUEUED, \"event[1]\": ActivityEventType.SENT })\n      .reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const getActivities = await activityModule.domain(\"test_id\", { date_from: 1672531200, date_to: 1675209600, event: [ActivityEventType.QUEUED, ActivityEventType.SENT] });\n    expect(getActivities.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(getActivities.body).toMatchObject({ key1: \"key1_value\" });\n    expect(getActivities.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/activities/test_activity_id\").reply(200, { key1: \"activity_value\" }, { header1: \"test\" });\n    const result = await activityModule.single(\"test_activity_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"activity_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Analytics.test.ts",
    "content": "import nock from \"nock\";\nimport { AnalyticsModule } from \"../../modules/email/Analytics.module\";\nimport { ActivityEventType } from \"../../models/email/Activity\";\nimport { AnalyticsGroupByType } from \"../../models\";\n\ndescribe(\"Analytics Module\", () => {\n  const analyticsModule = new AnalyticsModule(\"test_key\", \"http://test.com\");\n  const baseParams = { date_from: 1672531200, date_to: 1675209600, domain_id: \"test_domain_id\" };\n\n  it(\"byDate\", async () => {\n    nock(\"http://test.com\").get(\"/analytics/date\").query(baseParams).reply(200, { key1: \"date_value\" }, { header1: \"test\" });\n    const result = await analyticsModule.byDate(baseParams);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"date_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"byCountry\", async () => {\n    nock(\"http://test.com\").get(\"/analytics/country\").query(baseParams).reply(200, { key1: \"country_value\" }, { header1: \"test\" });\n    const result = await analyticsModule.byCountry(baseParams);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"country_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"byUserAgent\", async () => {\n    nock(\"http://test.com\").get(\"/analytics/ua-name\").query(baseParams).reply(200, { key1: \"ua_value\" }, { header1: \"test\" });\n    const result = await analyticsModule.byUserAgent(baseParams);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"ua_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"byReadingEnvironment\", async () => {\n    nock(\"http://test.com\").get(\"/analytics/ua-type\").query(baseParams).reply(200, { key1: \"ua_type_value\" }, { header1: \"test\" });\n    const result = await analyticsModule.byReadingEnvironment(baseParams);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"ua_type_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"byDate with event and group_by\", async () => {\n    const dateParams = { ...baseParams, group_by: AnalyticsGroupByType.DAYS, event: [ActivityEventType.CLICKED, ActivityEventType.OPENED] };\n    nock(\"http://test.com\").get(\"/analytics/date\").query(dateParams).reply(200, { key1: \"date_grouped_value\" }, { header1: \"test\" });\n    const result = await analyticsModule.byDate(dateParams);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"date_grouped_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"byDate with tags and recipient_id\", async () => {\n    const params = { ...baseParams, tags: [\"tag1\", \"tag2\"], recipient_id: [\"rcpt_id_1\"] };\n    nock(\"http://test.com\").get(\"/analytics/date\").query(params).reply(200, { key1: \"date_value\" }, { header1: \"test\" });\n    const result = await analyticsModule.byDate(params);\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"byCountry with tags and recipient_id\", async () => {\n    const params = { ...baseParams, tags: [\"tag1\"], recipient_id: [\"rcpt_id_1\"] };\n    nock(\"http://test.com\").get(\"/analytics/country\").query(params).reply(200, { key1: \"country_value\" }, { header1: \"test\" });\n    const result = await analyticsModule.byCountry(params);\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"byUserAgent with tags and recipient_id\", async () => {\n    const params = { ...baseParams, tags: [\"tag1\"], recipient_id: [\"rcpt_id_1\"] };\n    nock(\"http://test.com\").get(\"/analytics/ua-name\").query(params).reply(200, { key1: \"ua_value\" }, { header1: \"test\" });\n    const result = await analyticsModule.byUserAgent(params);\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"byReadingEnvironment with tags and recipient_id\", async () => {\n    const params = { ...baseParams, tags: [\"tag1\"], recipient_id: [\"rcpt_id_1\"] };\n    nock(\"http://test.com\").get(\"/analytics/ua-type\").query(params).reply(200, { key1: \"ua_type_value\" }, { header1: \"test\" });\n    const result = await analyticsModule.byReadingEnvironment(params);\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/BlocklistMonitor.test.ts",
    "content": "import nock from \"nock\";\nimport { BlocklistMonitorModule } from \"../../modules/BlocklistMonitor.module\";\nimport { BlocklistMonitor } from \"../../models\";\n\ndescribe(\"Blocklist Monitor Module\", () => {\n  const blocklistMonitorModule = new BlocklistMonitorModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    const params = { page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/blocklist-monitoring\").query(params).reply(200, { key1: \"monitor_list\" }, { header1: \"test\" });\n    const result = await blocklistMonitorModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"monitor_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"list with query and ordering\", async () => {\n    const params = { query: \"example.com\", sort_by: \"name\" as const, order: \"asc\" as const };\n    nock(\"http://test.com\").get(\"/blocklist-monitoring\").query(params).reply(200, { key1: \"monitor_list\" }, { header1: \"test\" });\n    const result = await blocklistMonitorModule.list(params);\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/blocklist-monitoring/test_monitor_id\").reply(200, { key1: \"monitor_value\" }, { header1: \"test\" });\n    const result = await blocklistMonitorModule.single(\"test_monitor_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"monitor_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"create\", async () => {\n    const monitor = new BlocklistMonitor(\"example.com\");\n    nock(\"http://test.com\").post(\"/blocklist-monitoring\", (body: any) => body.address === \"example.com\").reply(201, { key1: \"monitor_created\" }, { header1: \"test\" });\n    const result = await blocklistMonitorModule.create(monitor);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"monitor_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"create with all fields\", async () => {\n    const monitor = new BlocklistMonitor(\"example.com\")\n      .setName(\"My Monitor\")\n      .setNotify(true)\n      .setNotifyEmail(\"alerts@example.com\")\n      .setNotifyAddress(\"https://example.com/webhook\");\n    nock(\"http://test.com\")\n      .post(\"/blocklist-monitoring\", (body: any) =>\n        body.address === \"example.com\" &&\n        body.name === \"My Monitor\" &&\n        body.notify === true &&\n        body.notify_email === \"alerts@example.com\" &&\n        body.notify_address === \"https://example.com/webhook\"\n      )\n      .reply(201, { key1: \"monitor_created\" }, { header1: \"test\" });\n    const result = await blocklistMonitorModule.create(monitor);\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"update\", async () => {\n    const data = { name: \"Updated Monitor\" };\n    nock(\"http://test.com\").put(\"/blocklist-monitoring/test_monitor_id\", (body: any) => body.name === \"Updated Monitor\").reply(200, { key1: \"monitor_updated\" }, { header1: \"test\" });\n    const result = await blocklistMonitorModule.update(\"test_monitor_id\", data);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"monitor_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update with notify fields\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/blocklist-monitoring/test_monitor_id\", (body: any) =>\n        body.notify === true &&\n        body.notify_email === \"alerts@example.com\" &&\n        body.notify_address === \"https://example.com/webhook\"\n      )\n      .reply(200, { key1: \"monitor_updated\" }, { header1: \"test\" });\n    const result = await blocklistMonitorModule.update(\"test_monitor_id\", {\n      notify: true,\n      notify_email: \"alerts@example.com\",\n      notify_address: \"https://example.com/webhook\",\n    });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/blocklist-monitoring/test_monitor_id\").reply(204, {}, { header1: \"test\" });\n    const result = await blocklistMonitorModule.delete(\"test_monitor_id\");\n    expect(result.statusCode).toBe(204);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Dmarc.test.ts",
    "content": "import nock from \"nock\";\nimport { DmarcModule } from \"../../modules/Dmarc.module\";\nimport { Dmarc } from \"../../models\";\n\ndescribe(\"Dmarc Module\", () => {\n  const dmarcModule = new DmarcModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    const params = { limit: 20, page: 2 };\n    nock(\"http://test.com\").get(\"/dmarc-monitoring\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const response = await dmarcModule.list(params);\n    expect(response.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(response.body).toMatchObject({ key1: \"key1_value\" });\n    expect(response.statusCode).toBe(200);\n  });\n\n  it(\"list with query and ordering\", async () => {\n    const params = { query: \"example.com\", sort_by: \"created_at\" as const, order: \"desc\" as const };\n    nock(\"http://test.com\").get(\"/dmarc-monitoring\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const response = await dmarcModule.list(params);\n    expect(response.statusCode).toBe(200);\n  });\n\n  it(\"create\", async () => {\n    const dmarc = new Dmarc(\"domain_id_123\");\n    nock(\"http://test.com\").post(\"/dmarc-monitoring\").reply(201, { id: \"monitor_id_123\" }, { header1: \"test\" });\n    const response = await dmarcModule.create(dmarc);\n    expect(response.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(response.body).toMatchObject({ id: \"monitor_id_123\" });\n    expect(response.statusCode).toBe(201);\n  });\n\n  it(\"update\", async () => {\n    nock(\"http://test.com\").put(\"/dmarc-monitoring/test_id\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const response = await dmarcModule.update(\"test_id\", { wanted_dmarc_record: \"v=DMARC1; p=reject;\" });\n    expect(response.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(response.body).toMatchObject({ key1: \"key1_value\" });\n    expect(response.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/dmarc-monitoring/test_id\").reply(204, {}, { header1: \"test\" });\n    const response = await dmarcModule.delete(\"test_id\");\n    expect(response.statusCode).toBe(204);\n  });\n\n  it(\"report\", async () => {\n    const params = { limit: 10, page: 1 };\n    nock(\"http://test.com\").get(\"/dmarc-monitoring/test_id/report\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const response = await dmarcModule.report(\"test_id\", params);\n    expect(response.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(response.body).toMatchObject({ key1: \"key1_value\" });\n    expect(response.statusCode).toBe(200);\n  });\n\n  it(\"report with filters\", async () => {\n    const params = { date_from: \"2024-01-01\", date_to: \"2024-01-31\", search: \"192.0.2.1\", category: \"fail\", report_source: \"google.com\" };\n    nock(\"http://test.com\").get(\"/dmarc-monitoring/test_id/report\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const response = await dmarcModule.report(\"test_id\", params);\n    expect(response.statusCode).toBe(200);\n  });\n\n  it(\"reportByIp\", async () => {\n    const params = { limit: 10, page: 1 };\n    nock(\"http://test.com\").get(\"/dmarc-monitoring/test_id/report/1.2.3.4\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const response = await dmarcModule.reportByIp(\"test_id\", \"1.2.3.4\", params);\n    expect(response.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(response.body).toMatchObject({ key1: \"key1_value\" });\n    expect(response.statusCode).toBe(200);\n  });\n\n  it(\"reportByIp with filters\", async () => {\n    const params = { date_from: \"2024-01-01\", date_to: \"2024-01-31\", search: \"test\", category: \"fail\", report_source: \"google.com\" };\n    nock(\"http://test.com\").get(\"/dmarc-monitoring/test_id/report/1.2.3.4\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const response = await dmarcModule.reportByIp(\"test_id\", \"1.2.3.4\", params);\n    expect(response.statusCode).toBe(200);\n  });\n\n  it(\"reportSources\", async () => {\n    const params = { date_from: \"2024-01-01\", date_to: \"2024-01-31\" };\n    nock(\"http://test.com\").get(\"/dmarc-monitoring/test_id/report-sources\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const response = await dmarcModule.reportSources(\"test_id\", params);\n    expect(response.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(response.body).toMatchObject({ key1: \"key1_value\" });\n    expect(response.statusCode).toBe(200);\n  });\n\n  it(\"reportSources with status\", async () => {\n    const params = { date_from: \"2024-01-01\", date_to: \"2024-01-31\", status: \"rejected\" as const };\n    nock(\"http://test.com\").get(\"/dmarc-monitoring/test_id/report-sources\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const response = await dmarcModule.reportSources(\"test_id\", params);\n    expect(response.statusCode).toBe(200);\n  });\n\n  it(\"addFavorite\", async () => {\n    nock(\"http://test.com\").put(\"/dmarc-monitoring/test_id/favorite/1.2.3.4\").reply(200, {}, { header1: \"test\" });\n    const response = await dmarcModule.addFavorite(\"test_id\", \"1.2.3.4\");\n    expect(response.statusCode).toBe(200);\n  });\n\n  it(\"removeFavorite\", async () => {\n    nock(\"http://test.com\").delete(\"/dmarc-monitoring/test_id/favorite/1.2.3.4\").reply(204, {}, { header1: \"test\" });\n    const response = await dmarcModule.removeFavorite(\"test_id\", \"1.2.3.4\");\n    expect(response.statusCode).toBe(204);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Domain.test.ts",
    "content": "import nock from \"nock\";\nimport { DomainModule } from \"../../modules/email/Domain.module\";\nimport { Domain } from \"../../models\";\n\ndescribe(\"Domain Module\", () => {\n  const domainModule = new DomainModule(\"test_key\", \"http://test.com\");\n\n  it(\"create\", async () => {\n    const domain = new Domain(\"mydomain.com\", \"rp_subdomain\", \"ct_subdomain\", \"ir_subdomain\");\n    nock(\"http://test.com\")\n      .post(\"/domains\", {\n        name: \"mydomain.com\",\n        return_path_subdomain: \"rp_subdomain\",\n        custom_tracking_subdomain: \"ct_subdomain\",\n        inbound_routing_subdomain: \"ir_subdomain\",\n      })\n      .reply(\n        200,\n        {\n          id: \"dle1krod2jvn8gwm\",\n          name: \"mydomain.com\",\n        },\n        { header1: \"test\" },\n      );\n    const createDomain = await domainModule.create(domain);\n    expect(createDomain.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(createDomain.body).toMatchObject({ id: \"dle1krod2jvn8gwm\", name: \"mydomain.com\" });\n    expect(createDomain.statusCode).toBe(200);\n  });\n\n  it(\"create with only name\", async () => {\n    const domain = new Domain(\"mydomain.com\");\n    nock(\"http://test.com\")\n      .post(\"/domains\", { name: \"mydomain.com\" })\n      .reply(200, { id: \"dle1krod2jvn8gwm\", name: \"mydomain.com\" }, { header1: \"test\" });\n    const createDomain = await domainModule.create(domain);\n    expect(createDomain.body).toMatchObject({ id: \"dle1krod2jvn8gwm\", name: \"mydomain.com\" });\n    expect(createDomain.statusCode).toBe(200);\n  });\n\n  it(\"list\", async () => {\n    const params = { limit: 20, page: 2, verified: true };\n    nock(\"http://test.com\").get(\"/domains\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const getDomains = await domainModule.list(params);\n    expect(getDomains.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(getDomains.body).toMatchObject({ key1: \"key1_value\" });\n    expect(getDomains.statusCode).toBe(200);\n  });\n\n  it(\"recipients\", async () => {\n    const params = { limit: 20, page: 2 };\n    nock(\"http://test.com\")\n      .get(\"/domains/test_id/recipients\")\n      .query(params)\n      .reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const getDomains = await domainModule.recipients(\"test_id\", params);\n    expect(getDomains.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(getDomains.body).toMatchObject({ key1: \"key1_value\" });\n    expect(getDomains.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/domains/test_id\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const getDomain = await domainModule.single(\"test_id\");\n    expect(getDomain.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(getDomain.body).toMatchObject({ key1: \"key1_value\" });\n    expect(getDomain.statusCode).toBe(200);\n  });\n\n  it(\"settings\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/domains/test_id/settings\", {\n        send_paused: true,\n        track_clicks: true,\n        track_unsubscribe_html: \"<b>html here</b>\",\n      })\n      .reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const updateSettings = await domainModule.updateSettings(\"test_id\", {\n      send_paused: true,\n      track_clicks: true,\n      track_unsubscribe_html: \"<b>html here</b>\",\n    });\n    expect(updateSettings.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(updateSettings.body).toMatchObject({ key1: \"key1_value\" });\n    expect(updateSettings.statusCode).toBe(200);\n  });\n\n  it(\"settings with all remaining fields\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/domains/test_id/settings\", {\n        track_opens: true,\n        track_unsubscribe: true,\n        track_unsubscribe_plain: \"Unsubscribe now\",\n        track_unsubscribe_html_enabled: true,\n        track_unsubscribe_plain_enabled: true,\n        track_content: true,\n        custom_tracking_enabled: true,\n        custom_tracking_subdomain: \"track_subdomain\",\n        precedence_bulk: true,\n        ignore_duplicated_recipients: true,\n      })\n      .reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const updateSettings = await domainModule.updateSettings(\"test_id\", {\n      track_opens: true,\n      track_unsubscribe: true,\n      track_unsubscribe_plain: \"Unsubscribe now\",\n      track_unsubscribe_html_enabled: true,\n      track_unsubscribe_plain_enabled: true,\n      track_content: true,\n      custom_tracking_enabled: true,\n      custom_tracking_subdomain: \"track_subdomain\",\n      precedence_bulk: true,\n      ignore_duplicated_recipients: true,\n    });\n    expect(updateSettings.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(updateSettings.body).toMatchObject({ key1: \"key1_value\" });\n    expect(updateSettings.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/domains/test_id\").reply(204);\n    const deleteDomain = await domainModule.delete(\"test_id\");\n    expect(deleteDomain.statusCode).toBe(204);\n  });\n\n  it(\"dns\", async () => {\n    nock(\"http://test.com\").get(\"/domains/test_id/dns-records\").reply(200, { key1: \"dns\" }, { header1: \"dns-header\" });\n    const getDNS = await domainModule.dns(\"test_id\");\n    expect(getDNS.headers).toMatchObject({ header1: \"dns-header\", \"content-type\": \"application/json\" });\n    expect(getDNS.body).toMatchObject({ key1: \"dns\" });\n    expect(getDNS.statusCode).toBe(200);\n  });\n\n  it(\"verify\", async () => {\n    nock(\"http://test.com\").get(\"/domains/test_id/verify\").reply(200, { key1: \"verify\" }, { header1: \"verify-header\" });\n    const verifyDomain = await domainModule.verify(\"test_id\");\n    expect(verifyDomain.headers).toMatchObject({ header1: \"verify-header\", \"content-type\": \"application/json\" });\n    expect(verifyDomain.body).toMatchObject({ key1: \"verify\" });\n    expect(verifyDomain.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Email.test.ts",
    "content": "import nock from \"nock\";\nimport { EmailModule } from \"../../modules/Email.module\";\nimport { EmailParams, Recipient, EmailWebhook, EmailWebhookEventType } from \"../../models\";\nimport { Attachment } from \"../../models/email/Attachment\";\nimport { ActivityModule } from \"../../modules/email/Activity.module\";\nimport { AnalyticsModule } from \"../../modules/email/Analytics.module\";\nimport { DomainModule } from \"../../modules/email/Domain.module\";\nimport { InboundModule } from \"../../modules/email/Inbound.module\";\nimport { MessageModule } from \"../../modules/email/Message.module\";\nimport { ScheduleModule } from \"../../modules/email/Schedule.module\";\nimport { RecipientModule } from \"../../modules/email/Recipient.module\";\nimport { TemplateModule } from \"../../modules/email/Template.module\";\nimport { EmailWebhookModule } from \"../../modules/email/Webhook.module\";\n\ndescribe(\"Email Module\", () => {\n  const emailModule = new EmailModule(\"test_key\", \"http://test.com\");\n\n  it(\"Constructor\", () => {\n    expect(emailModule.activity instanceof ActivityModule).toBe(true);\n    expect(emailModule.analytics instanceof AnalyticsModule).toBe(true);\n    expect(emailModule.domain instanceof DomainModule).toBe(true);\n    expect(emailModule.inbound instanceof InboundModule).toBe(true);\n    expect(emailModule.message instanceof MessageModule).toBe(true);\n    expect(emailModule.schedule instanceof ScheduleModule).toBe(true);\n    expect(emailModule.recipient instanceof RecipientModule).toBe(true);\n    expect(emailModule.template instanceof TemplateModule).toBe(true);\n    expect(emailModule.webhook instanceof EmailWebhookModule).toBe(true);\n  });\n\n  it(\"send email\", async () => {\n    nock(\"http://test.com\").post(\"/email\").reply(202, { key1: \"key1_value\" }, { header1: \"test\" });\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setHtml(\"Some html\");\n    const sendEmail = await emailModule.send(emailParams);\n    expect(sendEmail.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(sendEmail.body).toMatchObject({ key1: \"key1_value\" });\n    expect(sendEmail.statusCode).toBe(202);\n  });\n\n  it(\"send email with personalization\", async () => {\n    const personalization = [\n      {\n        email: \"your@client.com\",\n        data: {\n          test: {\n            number: 123434,\n          }\n        },\n      }\n    ];\n    nock(\"http://test.com\").post(\"/email\").reply(202, { key1: \"key1_value\" }, { header1: \"test\" });\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setPersonalization(personalization)\n      .setText(\"Some text\")\n      .setHtml(\"Some html\");\n    const sendEmail = await emailModule.send(emailParams);\n    expect(sendEmail.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(sendEmail.body).toMatchObject({ key1: \"key1_value\" });\n    expect(sendEmail.statusCode).toBe(202);\n  });\n\n  it(\"send email with send_at as unix timestamp\", async () => {\n    const sendAt = 1893456000;\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.send_at === sendAt)\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setSendAt(sendAt);\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with send_at as ISO string\", async () => {\n    const sendAt = \"2030-01-01T12:00:00Z\";\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.send_at === sendAt)\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setSendAt(sendAt);\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with attachments\", async () => {\n    const attachment = new Attachment(\"base64content\", \"file.pdf\", \"attachment\", \"attach_id\");\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => {\n        const a = body.attachments[0];\n        return a.content === \"base64content\" && a.filename === \"file.pdf\" && a.disposition === \"attachment\" && a.id === \"attach_id\";\n      })\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setAttachments([attachment]);\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with template_id\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.template_id === \"tmpl_abc123\")\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setTemplateId(\"tmpl_abc123\");\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with cc\", async () => {\n    const cc = [new Recipient(\"cc@example.com\", \"CC Person\")];\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.cc[0].email === \"cc@example.com\" && body.cc[0].name === \"CC Person\")\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setCc(cc);\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with bcc\", async () => {\n    const bcc = [new Recipient(\"bcc@example.com\", \"BCC Person\")];\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.bcc[0].email === \"bcc@example.com\" && body.bcc[0].name === \"BCC Person\")\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setBcc(bcc);\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with reply_to\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.reply_to.email === \"reply@example.com\" && body.reply_to.name === \"Reply Person\")\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setReplyTo(new Recipient(\"reply@example.com\", \"Reply Person\"));\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with in_reply_to\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.in_reply_to === \"<original-message-id@example.com>\")\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setInReplyTo(\"<original-message-id@example.com>\");\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with references\", async () => {\n    const references = [\"<ref1@example.com>\", \"<ref2@example.com>\"];\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => Array.isArray(body.references) && body.references[0] === \"<ref1@example.com>\" && body.references[1] === \"<ref2@example.com>\")\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setReferences(references);\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with tags\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => Array.isArray(body.tags) && body.tags[0] === \"tag1\" && body.tags[1] === \"tag2\")\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setTags([\"tag1\", \"tag2\"]);\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with headers\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.headers[0].name === \"X-Custom\" && body.headers[0].value === \"custom-value\")\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setHeaders([{ name: \"X-Custom\", value: \"custom-value\" }]);\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with settings\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.settings.track_clicks === true && body.settings.track_opens === false && body.settings.track_content === true)\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setSettings({ track_clicks: true, track_opens: false, track_content: true });\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with precedence_bulk\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.precedence_bulk === true)\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setPrecedenceBulk(true);\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with list_unsubscribe\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.list_unsubscribe === \"https://www.example.com/unsubscribe\")\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setListUnsubscribe(\"https://www.example.com/unsubscribe\");\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send email with rcpt_to\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/email\", (body: any) => body.rcpt_to[0].email === \"rcpt@example.com\")\n      .reply(202, {}, {});\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setRcptTo([new Recipient(\"rcpt@example.com\")]);\n    const result = await emailModule.send(emailParams);\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"send bulk\", async () => {\n    nock(\"http://test.com\").post(\"/bulk-email\").reply(202, { key1: \"key1_value\" }, { header1: \"test\" });\n    const emailParams = new EmailParams()\n      .setFrom({ email: \"some@email.com\" })\n      .setTo([new Recipient(\"some_recipient@mail.com\")])\n      .setSubject(\"Some subject\")\n      .setText(\"Some text\")\n      .setHtml(\"Some html\");\n\n    const sendEmail = await emailModule.sendBulk([emailParams]);\n\n    expect(sendEmail.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(sendEmail.body).toMatchObject({ key1: \"key1_value\" });\n\n    expect(sendEmail.statusCode).toBe(202);\n  });\n\n  it(\"send bulk email serializes each EmailParams item\", async () => {\n    const emailParams1 = new EmailParams()\n      .setFrom({ email: \"sender1@example.com\" })\n      .setTo([new Recipient(\"recipient1@example.com\", \"Recipient One\")])\n      .setSubject(\"Subject One\")\n      .setText(\"Body One\");\n    const emailParams2 = new EmailParams()\n      .setFrom({ email: \"sender2@example.com\" })\n      .setTo([new Recipient(\"recipient2@example.com\", \"Recipient Two\")])\n      .setSubject(\"Subject Two\")\n      .setText(\"Body Two\");\n\n    nock(\"http://test.com\")\n      .post(\"/bulk-email\", (body: any) => {\n        return (\n          Array.isArray(body) &&\n          body[0].from.email === \"sender1@example.com\" &&\n          body[0].to[0].email === \"recipient1@example.com\" &&\n          body[0].subject === \"Subject One\" &&\n          body[1].from.email === \"sender2@example.com\" &&\n          body[1].to[0].email === \"recipient2@example.com\" &&\n          body[1].subject === \"Subject Two\"\n        );\n      })\n      .reply(202, { bulk_email_id: \"bulk_123\" }, {});\n\n    const result = await emailModule.sendBulk([emailParams1, emailParams2]);\n    expect(result.statusCode).toBe(202);\n    expect(result.body).toMatchObject({ bulk_email_id: \"bulk_123\" });\n  });\n\n  it(\"get bulk\", async () => {\n    nock(\"http://test.com\").get(\"/bulk-email/test_id_bulk\").reply(202, { key1: \"key1_value\" }, { header1: \"test\" });\n\n    const sendEmail = await emailModule.getBulkStatus(\"test_id_bulk\");\n\n    expect(sendEmail.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(sendEmail.body).toMatchObject({ key1: \"key1_value\" });\n\n    expect(sendEmail.statusCode).toBe(202);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/EmailVerification.test.ts",
    "content": "import nock from \"nock\";\nimport { EmailVerification, EmailVerificationResultType } from \"../../models\";\nimport { EmailVerificationModule } from \"../../modules/EmailVerification.module\";\n\ndescribe(\"Email Verification Module\", () => {\n    const emailVerificationModule = new EmailVerificationModule(\"test_key\", \"http://test.com\");\n\n    it(\"create\", async () => {\n        const emailVerification = new EmailVerification(\"List example\", [\n            \"info@mailersend.com\",\n            \"test@mailersend.com\"\n        ]);\n\n        nock(\"http://test.com\").post(\"/email-verification\").reply(\n            200,\n            {\n                id: \"dle1krod2jvn8gwm\",\n                name: \"Example List\"\n            },\n            { header1: \"test\" },\n        );\n        const createEmailVerificationList = await emailVerificationModule.create(emailVerification);\n        expect(createEmailVerificationList.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n        expect(createEmailVerificationList.body).toMatchObject({ id: \"dle1krod2jvn8gwm\", name: \"Example List\" });\n        expect(createEmailVerificationList.statusCode).toBe(200);\n    });\n\n    it(\"create with list_id and verify\", async () => {\n        const emailVerification = new EmailVerification(\"List example\", [\"info@mailersend.com\"])\n            .setListId(\"existing_list_id\")\n            .setVerify(true);\n        nock(\"http://test.com\")\n            .post(\"/email-verification\", (body: any) =>\n                body.list_id === \"existing_list_id\" && body.verify === true\n            )\n            .reply(200, { id: \"dle1krod2jvn8gwm\" }, { header1: \"test\" });\n        const result = await emailVerificationModule.create(emailVerification);\n        expect(result.statusCode).toBe(200);\n    });\n\n    it(\"list\", async () => {\n        const params = { limit: 20, page: 2};\n        nock(\"http://test.com\").get(\"/email-verification\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n        const getEmailVerifications = await emailVerificationModule.list(params);\n        expect(getEmailVerifications.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n        expect(getEmailVerifications.body).toMatchObject({ key1: \"key1_value\" });\n        expect(getEmailVerifications.statusCode).toBe(200);\n    });\n\n    it(\"single\", async () => {\n        nock(\"http://test.com\").get(\"/email-verification/test_id\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n        const getEmailVerification = await emailVerificationModule.single(\"test_id\");\n        expect(getEmailVerification.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n        expect(getEmailVerification.body).toMatchObject({ key1: \"key1_value\" });\n        expect(getEmailVerification.statusCode).toBe(200);\n    });\n\n    it(\"single with query params\", async () => {\n        const params = { detailed: true, page: 1, limit: 10 };\n        nock(\"http://test.com\").get(\"/email-verification/test_id\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n        const getEmailVerification = await emailVerificationModule.single(\"test_id\", params);\n        expect(getEmailVerification.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n        expect(getEmailVerification.body).toMatchObject({ key1: \"key1_value\" });\n        expect(getEmailVerification.statusCode).toBe(200);\n    });\n\n    it(\"verify list\", async () => {\n        nock(\"http://test.com\").get(\"/email-verification/test_id/verify\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n        const verifyEmailVerification = await emailVerificationModule.verifyList(\"test_id\");\n        expect(verifyEmailVerification.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n        expect(verifyEmailVerification.body).toMatchObject({ key1: \"key1_value\" });\n        expect(verifyEmailVerification.statusCode).toBe(200);\n    });\n\n    it(\"get list result\", async () => {\n        const params = { limit: 10, page: 1};\n        nock(\"http://test.com\").get(\"/email-verification/test_id/results\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n        const getListResult = await emailVerificationModule.getListResult(\"test_id\", params);\n        expect(getListResult.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n        expect(getListResult.body).toMatchObject({ key1: \"key1_value\" });\n        expect(getListResult.statusCode).toBe(200);\n    });\n\n    it(\"get list result with results filter\", async () => {\n        const params = { limit: 10, page: 1, results: [EmailVerificationResultType.CATCH_ALL, EmailVerificationResultType.DISPOSABLE] };\n        nock(\"http://test.com\").get(\"/email-verification/test_id/results\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n        const result = await emailVerificationModule.getListResult(\"test_id\", params);\n        expect(result.statusCode).toBe(200);\n    });\n\n    it(\"verify email\", async () => {\n        nock(\"http://test.com\").post(\"/email-verification/verify\").reply(200, { message: \"valid\" }, { header1: \"test\" });\n        const verifyEmail = await emailVerificationModule.verifyEmail(\"email@email.com\");\n        expect(verifyEmail.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n        expect(verifyEmail.body).toMatchObject({ message: \"valid\" });\n        expect(verifyEmail.statusCode).toBe(200);\n    });\n\n    it(\"verify email async\", async () => {\n        nock(\"http://test.com\").post(\"/email-verification/verify-async\").reply(200, { id: \"async_job_id\" }, { header1: \"test\" });\n        const result = await emailVerificationModule.verifyEmailAsync(\"email@email.com\");\n        expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n        expect(result.body).toMatchObject({ id: \"async_job_id\" });\n        expect(result.statusCode).toBe(200);\n    });\n\n    it(\"get verify email async status\", async () => {\n        nock(\"http://test.com\").get(\"/email-verification/verify-async/async_job_id\").reply(200, { status: \"completed\" }, { header1: \"test\" });\n        const result = await emailVerificationModule.getVerifyEmailAsyncStatus(\"async_job_id\");\n        expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n        expect(result.body).toMatchObject({ status: \"completed\" });\n        expect(result.statusCode).toBe(200);\n    });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Identity.test.ts",
    "content": "import nock from \"nock\";\nimport { IdentityModule } from \"../../modules/email/Identity.module\";\nimport { Identity } from \"../../models\";\n\ndescribe(\"Identity Module\", () => {\n  const identityModule = new IdentityModule(\"test_key\", \"http://test.com\");\n  const identity = new Identity(\"domain_id\", \"sender@example.com\", \"Sender Name\");\n\n  it(\"create\", async () => {\n    nock(\"http://test.com\").post(\"/identities\").reply(201, { key1: \"identity_created\" }, { header1: \"test\" });\n    const result = await identityModule.create(identity);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"identity_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"list\", async () => {\n    const params = { domain_id: \"domain_id\", page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/identities\").query(params).reply(200, { key1: \"identity_list\" }, { header1: \"test\" });\n    const result = await identityModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"identity_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"list with query and ordering\", async () => {\n    const params = { query: \"sender\", order_by: \"email\" as const, order: \"asc\" as const };\n    nock(\"http://test.com\").get(\"/identities\").query(params).reply(200, { key1: \"identity_list\" }, { header1: \"test\" });\n    const result = await identityModule.list(params);\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/identities/test_identity_id\").reply(200, { key1: \"identity_value\" }, { header1: \"test\" });\n    const result = await identityModule.single(\"test_identity_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"identity_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"singleByEmail\", async () => {\n    nock(\"http://test.com\").get(\"/identities/email/sender@example.com\").reply(200, { key1: \"identity_by_email\" }, { header1: \"test\" });\n    const result = await identityModule.singleByEmail(\"sender@example.com\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"identity_by_email\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update\", async () => {\n    nock(\"http://test.com\").put(\"/identities/test_identity_id\").reply(200, { key1: \"identity_updated\" }, { header1: \"test\" });\n    const result = await identityModule.update(\"test_identity_id\", { name: \"New Name\" });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"identity_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"updateByEMail\", async () => {\n    nock(\"http://test.com\").put(\"/identities/email/sender@example.com\").reply(200, { key1: \"identity_updated_by_email\" }, { header1: \"test\" });\n    const result = await identityModule.updateByEMail(\"sender@example.com\", { name: \"New Name\" });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"identity_updated_by_email\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/identities/test_identity_id\").reply(204, {}, { header1: \"test\" });\n    const result = await identityModule.delete(\"test_identity_id\");\n    expect(result.statusCode).toBe(204);\n  });\n\n  it(\"deleteByEmail\", async () => {\n    nock(\"http://test.com\").delete(\"/identities/email/sender@example.com\").reply(202, {}, { header1: \"test\" });\n    const result = await identityModule.deleteByEmail(\"sender@example.com\");\n    expect(result.statusCode).toBe(202);\n  });\n\n  it(\"resend\", async () => {\n    nock(\"http://test.com\").post(\"/identities/test_identity_id/resend\").reply(200, { key1: \"identity_resent\" }, { header1: \"test\" });\n    const result = await identityModule.resend(\"test_identity_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"identity_resent\" });\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Inbound.test.ts",
    "content": "import nock from \"nock\";\nimport { InboundModule } from \"../../modules/email/Inbound.module\";\nimport { Inbound, InboundUpdateParams, InboundFilterType, ComparerType } from \"../../models\";\n\ndescribe(\"Inbound Module\", () => {\n  const inboundModule = new InboundModule(\"test_key\", \"http://test.com\");\n  const inbound = new Inbound(\"test inbound\", true, \"domain_id\");\n\n  it(\"create sends POST to /inbound with required fields\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/inbound\", (body) => {\n        return body.name === \"test inbound\" &&\n          body.domain_enabled === true &&\n          body.domain_id === \"domain_id\";\n      })\n      .reply(201, { key1: \"inbound_created\" }, { header1: \"test\" });\n    const result = await inboundModule.create(inbound);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"inbound_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"create sends POST to /inbound with all optional fields\", async () => {\n    const fullInbound = new Inbound(\"full inbound\", true, \"domain_id_full\")\n      .setInboundDomain(\"inbound.example.com\")\n      .setInboundPriority(50)\n      .setForwards([{ type: \"webhook\", value: \"https://example.com/hook\" }])\n      .setMatchFilter({\n        type: InboundFilterType.MATCH_SENDER,\n        filters: [{ comparer: ComparerType.EQUAL, value: \"sender@example.com\" }],\n      })\n      .setCatchFilter({\n        type: InboundFilterType.CATCH_RECIPIENT,\n        filters: [{ comparer: ComparerType.EQUAL, value: \"recipient@example.com\" }],\n      });\n\n    nock(\"http://test.com\")\n      .post(\"/inbound\", (body) => {\n        return body.name === \"full inbound\" &&\n          body.domain_enabled === true &&\n          body.domain_id === \"domain_id_full\" &&\n          body.inbound_domain === \"inbound.example.com\" &&\n          body.inbound_priority === 50 &&\n          Array.isArray(body.forwards) &&\n          body.forwards.length === 1 &&\n          body.forwards[0].type === \"webhook\" &&\n          body.forwards[0].value === \"https://example.com/hook\" &&\n          body.match_filter !== undefined &&\n          body.catch_filter !== undefined;\n      })\n      .reply(201, { key1: \"inbound_created_full\" }, { header1: \"test\" });\n\n    const result = await inboundModule.create(fullInbound);\n    expect(result.statusCode).toBe(201);\n    expect(result.body).toMatchObject({ key1: \"inbound_created_full\" });\n  });\n\n  it(\"list sends GET to /inbound with query params\", async () => {\n    const params = { domain_id: \"domain_id\", page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/inbound\").query(params).reply(200, { key1: \"inbound_list\" }, { header1: \"test\" });\n    const result = await inboundModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"inbound_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"list sends GET to /inbound with no arguments\", async () => {\n    nock(\"http://test.com\").get(\"/inbound\").reply(200, { key1: \"inbound_list_all\" }, { header1: \"test\" });\n    const result = await inboundModule.list();\n    expect(result.statusCode).toBe(200);\n    expect(result.body).toMatchObject({ key1: \"inbound_list_all\" });\n  });\n\n  it(\"single sends GET to /inbound/{id}\", async () => {\n    nock(\"http://test.com\").get(\"/inbound/test_inbound_id\").reply(200, { key1: \"inbound_value\" }, { header1: \"test\" });\n    const result = await inboundModule.single(\"test_inbound_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"inbound_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update sends PUT to /inbound/{id} with required fields and no domain_id\", async () => {\n    const updateParams = new InboundUpdateParams(\"test inbound\", true);\n\n    nock(\"http://test.com\")\n      .put(\"/inbound/test_inbound_id\", (body) => {\n        return body.name === \"test inbound\" &&\n          body.domain_enabled === true &&\n          !Object.prototype.hasOwnProperty.call(body, \"domain_id\");\n      })\n      .reply(200, { key1: \"inbound_updated\" }, { header1: \"test\" });\n\n    const result = await inboundModule.update(\"test_inbound_id\", updateParams);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"inbound_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update sends PUT to /inbound/{id} with all optional fields\", async () => {\n    const updateParams = new InboundUpdateParams(\"full inbound\", false)\n      .setInboundDomain(\"inbound.example.com\")\n      .setInboundPriority(25)\n      .setForwards([{ type: \"webhook\", value: \"https://example.com/hook\" }])\n      .setMatchFilter({\n        type: InboundFilterType.MATCH_ALL,\n      })\n      .setCatchFilter({\n        type: InboundFilterType.CATCH_ALL,\n      });\n\n    nock(\"http://test.com\")\n      .put(\"/inbound/test_inbound_id\", (body) => {\n        return body.name === \"full inbound\" &&\n          body.domain_enabled === false &&\n          !Object.prototype.hasOwnProperty.call(body, \"domain_id\") &&\n          body.inbound_domain === \"inbound.example.com\" &&\n          body.inbound_priority === 25 &&\n          Array.isArray(body.forwards) &&\n          body.forwards.length === 1 &&\n          body.match_filter !== undefined &&\n          body.catch_filter !== undefined;\n      })\n      .reply(200, { key1: \"inbound_updated_full\" }, { header1: \"test\" });\n\n    const result = await inboundModule.update(\"test_inbound_id\", updateParams);\n    expect(result.statusCode).toBe(200);\n    expect(result.body).toMatchObject({ key1: \"inbound_updated_full\" });\n  });\n\n  it(\"delete sends DELETE to /inbound/{id} and returns 204\", async () => {\n    nock(\"http://test.com\").delete(\"/inbound/test_inbound_id\").reply(204, {}, { header1: \"test\" });\n    const result = await inboundModule.delete(\"test_inbound_id\");\n    expect(result.statusCode).toBe(204);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/MailerSend.test.ts",
    "content": "import { MailerSend } from \"../../modules/MailerSend.module\";\nimport { EmailModule } from \"../../modules/Email.module\";\nimport { SMSModule } from \"../../modules/SMS.module\";\nimport { TokenModule } from \"../../modules/Token.module\";\nimport { EmailVerificationModule } from \"../../modules/EmailVerification.module\";\n\ndescribe(\"MailerSend module\", () => {\n  it(\"Constructor\", () => {\n    const mailerSend = new MailerSend({ apiKey: \"your_api_key\" });\n    expect(mailerSend.sms instanceof SMSModule).toBe(true);\n    expect(mailerSend.email instanceof EmailModule).toBe(true);\n    expect(mailerSend.token instanceof TokenModule).toBe(true);\n    expect(mailerSend.emailVerification instanceof EmailVerificationModule).toBe(true);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Message.test.ts",
    "content": "import nock from \"nock\";\nimport { MessageModule } from \"../../modules/email/Message.module\";\n\ndescribe(\"Message Module\", () => {\n  const messageModule = new MessageModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    nock(\"http://test.com\")\n      .get(\"/messages\")\n      .query({ limit: 20, page: 2 })\n      .reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const getMessages = await messageModule.list({ limit: 20, page: 2 });\n    expect(getMessages.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(getMessages.body).toMatchObject({ key1: \"key1_value\" });\n    expect(getMessages.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/messages/test_id\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const getMessage = await messageModule.single(\"test_id\");\n    expect(getMessage.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(getMessage.body).toMatchObject({ key1: \"key1_value\" });\n    expect(getMessage.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Others.test.ts",
    "content": "import nock from \"nock\";\nimport { OthersModule } from \"../../modules/Others.module\";\n\ndescribe(\"Others Module\", () => {\n  const othersModule = new OthersModule(\"test_key\", \"http://test.com\");\n\n  it(\"getApiQuota\", async () => {\n    nock(\"http://test.com\").get(\"/api-quota\").reply(200, { quota: 1000, used: 42 }, { header1: \"test\" });\n    const result = await othersModule.getApiQuota();\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ quota: 1000, used: 42 });\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Recipient.test.ts",
    "content": "import nock from \"nock\";\nimport { RecipientModule } from \"../../modules/email/Recipient.module\";\nimport { BlockListRecipients, BlockListRecipientsPost, BlockListType } from \"../../models\";\n\ndescribe(\"Recipient Module\", () => {\n  const recipientModule = new RecipientModule(\"test_key\", \"http://test.com\");\n  it(\"list\", async () => {\n    const params = { limit: 20, page: 2, domain_id: \"domain_id\" };\n    nock(\"http://test.com\").get(\"/recipients\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const getRecipients = await recipientModule.list(params);\n    expect(getRecipients.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(getRecipients.body).toMatchObject({ key1: \"key1_value\" });\n    expect(getRecipients.statusCode).toBe(200);\n  });\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/recipients/test_id\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const getRecipient = await recipientModule.single(\"test_id\");\n    expect(getRecipient.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(getRecipient.body).toMatchObject({ key1: \"key1_value\" });\n    expect(getRecipient.statusCode).toBe(200);\n  });\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/recipients/test_id\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const deleteRecipient = await recipientModule.delete(\"test_id\");\n    expect(deleteRecipient.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(deleteRecipient.body).toMatchObject({ key1: \"key1_value\" });\n    expect(deleteRecipient.statusCode).toBe(200);\n  });\n  it(\"block list\", async () => {\n    const params = { limit: 20, page: 2, domain_id: \"domain_id\" };\n    nock(\"http://test.com\")\n      .get(\"/suppressions/blocklist\")\n      .query(params)\n      .reply(200, { data: [{ id: \"id_here\" }] }, { header1: \"blocklist-header\" });\n    const blockList = await recipientModule.blockList(params);\n    expect(blockList.headers).toMatchObject({ header1: \"blocklist-header\", \"content-type\": \"application/json\" });\n    expect(blockList.body).toMatchObject({ data: [{ id: \"id_here\" }] });\n    expect(blockList.statusCode).toBe(200);\n  });\n  it(\"block recipients\", async () => {\n    const recipients: BlockListRecipients = {\n      domain_id: \"83gwk2j7zqz1nxyd\", // not required\n      recipients: [\"test@example.com\"], // If patterns is not defined, this property is required.\n      patterns: [\".*@example.com\"], // If recipients is not defined, this property is required.\n    };\n    nock(\"http://test.com\")\n      .post(\"/suppressions/blocklist\", (body: any) => body.domain_id === \"83gwk2j7zqz1nxyd\" && body.recipients[0] === \"test@example.com\" && body.patterns[0] === \".*@example.com\")\n      .reply(200, { data: [{ id: \"block_id\" }] }, { header1: \"block-header\" });\n    const blockedRecipient = await recipientModule.blockRecipients(recipients);\n    expect(blockedRecipient.headers).toMatchObject({ header1: \"block-header\", \"content-type\": \"application/json\" });\n    expect(blockedRecipient.body).toMatchObject({ data: [{ id: \"block_id\" }] });\n    expect(blockedRecipient.statusCode).toBe(200);\n  });\n  it(\"delete block recipients by ids\", async () => {\n    nock(\"http://test.com\").delete(\"/suppressions/blocklist\", (body: any) => Array.isArray(body.ids) && body.ids[0] === \"60f198790542d97fb66dfe52\").reply(200, {}, { header1: \"block-header\" });\n    const ids = [\"60f198790542d97fb66dfe52\", \"60f198790542d97fb66dfe53\"];\n    const removed = await recipientModule.delBlockListRecipients(ids);\n    expect(removed.headers).toMatchObject({ header1: \"block-header\", \"content-type\": \"application/json\" });\n    expect(removed.body).toMatchObject({});\n    expect(removed.statusCode).toBe(200);\n  });\n  it(\"delete all block recipients\", async () => {\n    nock(\"http://test.com\").delete(\"/suppressions/blocklist\", (body: any) => body.all === true).reply(200, {}, { header1: \"block-header\" });\n    const removed = await recipientModule.delAllBlockListRecipients();\n    expect(removed.headers).toMatchObject({ header1: \"block-header\", \"content-type\": \"application/json\" });\n    expect(removed.body).toMatchObject({});\n    expect(removed.statusCode).toBe(200);\n  });\n  it(\"hard bounce list\", async () => {\n    const params = { limit: 20, page: 2, domain_id: \"domain_id\" };\n    nock(\"http://test.com\")\n      .get(\"/suppressions/hard-bounces\")\n      .query(params)\n      .reply(200, { data: [{ id: \"id_here\" }] }, { header1: \"hard-bounces-header\" });\n    const hardBouncedList = await recipientModule.blockList(params, BlockListType.HARD_BOUNCES_LIST);\n    expect(hardBouncedList.headers).toMatchObject({\n      header1: \"hard-bounces-header\",\n      \"content-type\": \"application/json\",\n    });\n    expect(hardBouncedList.body).toMatchObject({ data: [{ id: \"id_here\" }] });\n    expect(hardBouncedList.statusCode).toBe(200);\n  });\n  it(\"spam complaints list\", async () => {\n    const params = { limit: 20, page: 2, domain_id: \"domain_id\" };\n    nock(\"http://test.com\")\n      .get(\"/suppressions/spam-complaints\")\n      .query(params)\n      .reply(200, { data: [{ id: \"id_here\" }] }, { header1: \"spam-complaints-header\" });\n    const spamComplaintsList = await recipientModule.blockList(params, BlockListType.SPAM_COMPLAINTS_LIST);\n    expect(spamComplaintsList.headers).toMatchObject({\n      header1: \"spam-complaints-header\",\n      \"content-type\": \"application/json\",\n    });\n    expect(spamComplaintsList.body).toMatchObject({ data: [{ id: \"id_here\" }] });\n    expect(spamComplaintsList.statusCode).toBe(200);\n  });\n  it(\"unsubscribes list\", async () => {\n    const params = { limit: 20, page: 2, domain_id: \"domain_id\" };\n    nock(\"http://test.com\")\n      .get(\"/suppressions/unsubscribes\")\n      .query(params)\n      .reply(200, { data: [{ id: \"id_here\" }] }, { header1: \"unsubscribes-header\" });\n    const unsubscribesList = await recipientModule.blockList(params, BlockListType.UNSUBSCRIBES_LIST);\n    expect(unsubscribesList.headers).toMatchObject({\n      header1: \"unsubscribes-header\",\n      \"content-type\": \"application/json\",\n    });\n    expect(unsubscribesList.body).toMatchObject({ data: [{ id: \"id_here\" }] });\n    expect(unsubscribesList.statusCode).toBe(200);\n  });\n  it(\"on-hold-list\", async () => {\n    const params = { limit: 20, page: 2 };\n    nock(\"http://test.com\")\n      .get(\"/suppressions/on-hold-list\")\n      .query(params)\n      .reply(200, { data: [{ id: \"id_here\" }] }, { header1: \"on-hold-header\" });\n    const onHoldList = await recipientModule.blockList(params, BlockListType.ON_HOLD_LIST);\n    expect(onHoldList.headers).toMatchObject({ header1: \"on-hold-header\", \"content-type\": \"application/json\" });\n    expect(onHoldList.body).toMatchObject({ data: [{ id: \"id_here\" }] });\n    expect(onHoldList.statusCode).toBe(200);\n  });\n  it(\"block hard bounces\", async () => {\n    const data: BlockListRecipientsPost = { domain_id: \"test_domain_id\", recipients: [\"bounce@example.com\"] };\n    nock(\"http://test.com\")\n      .post(\"/suppressions/hard-bounces\", (body: any) => body.domain_id === \"test_domain_id\" && body.recipients[0] === \"bounce@example.com\")\n      .reply(200, { data: [{ id: \"block_id\" }] }, { header1: \"hard-bounces-header\" });\n    const result = await recipientModule.blockRecipients(data, BlockListType.HARD_BOUNCES_LIST);\n    expect(result.statusCode).toBe(200);\n  });\n  it(\"block spam complaints\", async () => {\n    const data: BlockListRecipientsPost = { domain_id: \"test_domain_id\", recipients: [\"spam@example.com\"] };\n    nock(\"http://test.com\")\n      .post(\"/suppressions/spam-complaints\", (body: any) => body.domain_id === \"test_domain_id\" && body.recipients[0] === \"spam@example.com\")\n      .reply(200, { data: [{ id: \"block_id\" }] }, { header1: \"spam-complaints-header\" });\n    const result = await recipientModule.blockRecipients(data, BlockListType.SPAM_COMPLAINTS_LIST);\n    expect(result.statusCode).toBe(200);\n  });\n  it(\"block unsubscribes\", async () => {\n    const data: BlockListRecipientsPost = { domain_id: \"test_domain_id\", recipients: [\"unsub@example.com\"] };\n    nock(\"http://test.com\")\n      .post(\"/suppressions/unsubscribes\", (body: any) => body.domain_id === \"test_domain_id\" && body.recipients[0] === \"unsub@example.com\")\n      .reply(200, { data: [{ id: \"block_id\" }] }, { header1: \"unsubscribes-header\" });\n    const result = await recipientModule.blockRecipients(data, BlockListType.UNSUBSCRIBES_LIST);\n    expect(result.statusCode).toBe(200);\n  });\n  it(\"delete hard bounces by ids\", async () => {\n    const ids = [\"hb_id_1\", \"hb_id_2\"];\n    nock(\"http://test.com\")\n      .delete(\"/suppressions/hard-bounces\", (body: any) => Array.isArray(body.ids) && body.ids[0] === \"hb_id_1\")\n      .reply(204, {}, { header1: \"hard-bounces-header\" });\n    const result = await recipientModule.delBlockListRecipients(ids, BlockListType.HARD_BOUNCES_LIST);\n    expect(result.statusCode).toBe(204);\n  });\n  it(\"delete all hard bounces\", async () => {\n    nock(\"http://test.com\")\n      .delete(\"/suppressions/hard-bounces\", (body: any) => body.all === true)\n      .reply(204, {}, { header1: \"hard-bounces-header\" });\n    const result = await recipientModule.delAllBlockListRecipients(BlockListType.HARD_BOUNCES_LIST);\n    expect(result.statusCode).toBe(204);\n  });\n  it(\"delete spam complaints by ids\", async () => {\n    const ids = [\"sc_id_1\", \"sc_id_2\"];\n    nock(\"http://test.com\")\n      .delete(\"/suppressions/spam-complaints\", (body: any) => Array.isArray(body.ids) && body.ids[0] === \"sc_id_1\")\n      .reply(204, {}, { header1: \"spam-complaints-header\" });\n    const result = await recipientModule.delBlockListRecipients(ids, BlockListType.SPAM_COMPLAINTS_LIST);\n    expect(result.statusCode).toBe(204);\n  });\n  it(\"delete all spam complaints\", async () => {\n    nock(\"http://test.com\")\n      .delete(\"/suppressions/spam-complaints\", (body: any) => body.all === true)\n      .reply(204, {}, { header1: \"spam-complaints-header\" });\n    const result = await recipientModule.delAllBlockListRecipients(BlockListType.SPAM_COMPLAINTS_LIST);\n    expect(result.statusCode).toBe(204);\n  });\n  it(\"delete unsubscribes by ids\", async () => {\n    const ids = [\"unsub_id_1\", \"unsub_id_2\"];\n    nock(\"http://test.com\")\n      .delete(\"/suppressions/unsubscribes\", (body: any) => Array.isArray(body.ids) && body.ids[0] === \"unsub_id_1\")\n      .reply(204, {}, { header1: \"unsubscribes-header\" });\n    const result = await recipientModule.delBlockListRecipients(ids, BlockListType.UNSUBSCRIBES_LIST);\n    expect(result.statusCode).toBe(204);\n  });\n  it(\"delete all unsubscribes\", async () => {\n    nock(\"http://test.com\")\n      .delete(\"/suppressions/unsubscribes\", (body: any) => body.all === true)\n      .reply(204, {}, { header1: \"unsubscribes-header\" });\n    const result = await recipientModule.delAllBlockListRecipients(BlockListType.UNSUBSCRIBES_LIST);\n    expect(result.statusCode).toBe(204);\n  });\n  it(\"delete on-hold-list by ids\", async () => {\n    const ids = [\"oh_id_1\", \"oh_id_2\"];\n    nock(\"http://test.com\")\n      .delete(\"/suppressions/on-hold-list\", (body: any) => Array.isArray(body.ids) && body.ids[0] === \"oh_id_1\")\n      .reply(204, {}, { header1: \"on-hold-header\" });\n    const result = await recipientModule.delBlockListRecipients(ids, BlockListType.ON_HOLD_LIST);\n    expect(result.statusCode).toBe(204);\n  });\n  it(\"delete all on-hold-list\", async () => {\n    nock(\"http://test.com\")\n      .delete(\"/suppressions/on-hold-list\", (body: any) => body.all === true)\n      .reply(204, {}, { header1: \"on-hold-header\" });\n    const result = await recipientModule.delAllBlockListRecipients(BlockListType.ON_HOLD_LIST);\n    expect(result.statusCode).toBe(204);\n  });\n\n  describe(\"limit validation\", () => {\n    test.each([\n      [\"blocklist limit below minimum\", 9],\n      [\"blocklist limit above maximum\", 101],\n    ])(\"%s\", async (_label, limit) => {\n      await expect(recipientModule.blockList({ limit }, BlockListType.BLOCK_LIST)).rejects.toThrow(\"Limit must be between 10 and 100.\");\n    });\n\n    test.each([\n      [\"hard-bounces limit below minimum\", 9],\n      [\"hard-bounces limit above maximum\", 101],\n    ])(\"%s\", async (_label, limit) => {\n      await expect(recipientModule.blockList({ limit }, BlockListType.HARD_BOUNCES_LIST)).rejects.toThrow(\"Limit must be between 10 and 100.\");\n    });\n\n    test.each([\n      [\"spam-complaints limit below minimum\", 9],\n      [\"spam-complaints limit above maximum\", 101],\n    ])(\"%s\", async (_label, limit) => {\n      await expect(recipientModule.blockList({ limit }, BlockListType.SPAM_COMPLAINTS_LIST)).rejects.toThrow(\"Limit must be between 10 and 100.\");\n    });\n\n    test.each([\n      [\"unsubscribes limit below minimum\", 9],\n      [\"unsubscribes limit above maximum\", 101],\n    ])(\"%s\", async (_label, limit) => {\n      await expect(recipientModule.blockList({ limit }, BlockListType.UNSUBSCRIBES_LIST)).rejects.toThrow(\"Limit must be between 10 and 100.\");\n    });\n\n    test.each([\n      [\"on-hold-list limit below minimum\", 9],\n      [\"on-hold-list limit above maximum\", 101],\n    ])(\"%s\", async (_label, limit) => {\n      await expect(recipientModule.blockList({ limit }, BlockListType.ON_HOLD_LIST)).rejects.toThrow(\"Limit must be between 10 and 100.\");\n    });\n  });\n\n  describe(\"blockRecipients blocklist — mutual requirement\", () => {\n    it(\"throws when neither recipients nor patterns are provided\", async () => {\n      await expect(recipientModule.blockRecipients({})).rejects.toThrow(\"Either recipients or patterns must be provided.\");\n    });\n\n    it(\"throws when recipients is empty and patterns is absent\", async () => {\n      await expect(recipientModule.blockRecipients({ recipients: [] })).rejects.toThrow(\"Either recipients or patterns must be provided.\");\n    });\n\n    it(\"throws when patterns is empty and recipients is absent\", async () => {\n      await expect(recipientModule.blockRecipients({ patterns: [] })).rejects.toThrow(\"Either recipients or patterns must be provided.\");\n    });\n\n    it(\"succeeds with only recipients\", async () => {\n      nock(\"http://test.com\")\n        .post(\"/suppressions/blocklist\", (body: any) => Array.isArray(body.recipients) && body.recipients[0] === \"only@example.com\")\n        .reply(200, { data: [] }, {});\n      const result = await recipientModule.blockRecipients({ recipients: [\"only@example.com\"] });\n      expect(result.statusCode).toBe(200);\n    });\n\n    it(\"succeeds with only patterns\", async () => {\n      nock(\"http://test.com\")\n        .post(\"/suppressions/blocklist\", (body: any) => Array.isArray(body.patterns) && body.patterns[0] === \".*@example.com\")\n        .reply(200, { data: [] }, {});\n      const result = await recipientModule.blockRecipients({ patterns: [\".*@example.com\"] });\n      expect(result.statusCode).toBe(200);\n    });\n  });\n\n  describe(\"blockRecipients — empty recipients validation\", () => {\n    test.each([\n      [\"hard-bounces\", BlockListType.HARD_BOUNCES_LIST],\n      [\"spam-complaints\", BlockListType.SPAM_COMPLAINTS_LIST],\n      [\"unsubscribes\", BlockListType.UNSUBSCRIBES_LIST],\n    ])(\"throws when recipients is empty for %s\", async (_label, type) => {\n      await expect(\n        recipientModule.blockRecipients({ domain_id: \"test_domain_id\", recipients: [] }, type as BlockListType.HARD_BOUNCES_LIST | BlockListType.SPAM_COMPLAINTS_LIST | BlockListType.UNSUBSCRIBES_LIST)\n      ).rejects.toThrow(\"Recipients must not be empty.\");\n    });\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/SMS.test.ts",
    "content": "import { SMSModule } from \"../../modules/SMS.module\";\nimport { SMSPersonalization, SMSParams } from \"../../models\";\nimport nock from \"nock\";\nimport { SmsActivityModule } from \"../../modules/sms/Activity.module\";\nimport { SmsNumberModule } from \"../../modules/sms/Number.module\";\nimport { SmsInboundModule } from \"../../modules/sms/Inbound.module\";\nimport { SmsMessageModule } from \"../../modules/sms/Message.module\";\nimport { SmsRecipientModule } from \"../../modules/sms/Recipient.module\";\nimport { SmsWebhookModule } from \"../../modules/sms/Webhook.module\";\n\ndescribe(\"SMS Module\", () => {\n  const smsModule = new SMSModule(\"test_key\", \"http://test.com\");\n\n  it(\"Constructor\", () => {\n    expect(smsModule.activity instanceof SmsActivityModule).toBe(true);\n    expect(smsModule.number instanceof SmsNumberModule).toBe(true);\n    expect(smsModule.inbound instanceof SmsInboundModule).toBe(true);\n    expect(smsModule.message instanceof SmsMessageModule).toBe(true);\n    expect(smsModule.recipient instanceof SmsRecipientModule).toBe(true);\n    expect(smsModule.webhook instanceof SmsWebhookModule).toBe(true);\n  });\n\n  it(\"send\", async () => {\n    nock(\"http://test.com\").post(\"/sms\").reply(202, { key1: \"key1_value\" }, { \"x-sms-message-id\": \"test\" });\n    const personalization: SMSPersonalization[] = [];\n\n    personalization.push(new SMSPersonalization(\"+19191234567\", { name: \"Dummy\" }));\n    personalization.push(new SMSPersonalization(\"+19199876543\", { name: \"Not Dummy\" }));\n\n    const params = new SMSParams()\n      .setFrom(\"+19191234567\")\n      .setTo([\"+19191234567\", \"+19199876543\"])\n      .setText(\"Hey {{name}}! This is just a friendly hello :D\")\n      .setPersonalization(personalization);\n\n    const sendEmail = await smsModule.send(params);\n\n    expect(sendEmail.headers).toMatchObject({ \"x-sms-message-id\": \"test\", \"content-type\": \"application/json\" });\n    expect(sendEmail.body).toMatchObject({ key1: \"key1_value\" });\n\n    expect(sendEmail.statusCode).toBe(202);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Schedule.test.ts",
    "content": "import nock from \"nock\";\nimport { ScheduleModule } from \"../../modules/email/Schedule.module\";\n\ndescribe(\"Schedule Module\", () => {\n  const scheduleModule = new ScheduleModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    const params = { domain_id: \"domain_id\", status: \"scheduled\" as const, page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/message-schedules\").query(params).reply(200, { key1: \"schedule_list\" }, { header1: \"test\" });\n    const result = await scheduleModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"schedule_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/message-schedules/test_message_id\").reply(200, { key1: \"schedule_value\" }, { header1: \"test\" });\n    const result = await scheduleModule.single(\"test_message_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"schedule_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/message-schedules/test_message_id\").reply(204);\n    const result = await scheduleModule.delete(\"test_message_id\");\n    expect(result.statusCode).toBe(204);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/SmsActivity.test.ts",
    "content": "import nock from \"nock\";\nimport { SmsActivityModule } from \"../../modules/sms/Activity.module\";\n\ndescribe(\"SMS Activity Module\", () => {\n  const smsActivityModule = new SmsActivityModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    const params = { sms_number_id: \"sms_number_id\", page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/sms-activity\").query(params).reply(200, { key1: \"sms_activity_list\" }, { header1: \"test\" });\n    const result = await smsActivityModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_activity_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n});\n"
  },
  {
    "path": "src/__tests__/modules/SmsInbound.test.ts",
    "content": "import nock from \"nock\";\nimport { SmsInboundModule } from \"../../modules/sms/Inbound.module\";\nimport { SmsInbound } from \"../../models\";\n\ndescribe(\"SMS Inbound Module\", () => {\n  const smsInboundModule = new SmsInboundModule(\"test_key\", \"http://test.com\");\n  const smsInbound = new SmsInbound(\"Test Inbound\", \"sms_number_id\", \"https://example.com/forward\", true);\n\n  it(\"create\", async () => {\n    nock(\"http://test.com\").post(\"/sms-inbounds\").reply(201, { key1: \"sms_inbound_created\" }, { header1: \"test\" });\n    const result = await smsInboundModule.create(smsInbound);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_inbound_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"list\", async () => {\n    const params = { sms_number_id: \"sms_number_id\", page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/sms-inbounds\").query(params).reply(200, { key1: \"sms_inbound_list\" }, { header1: \"test\" });\n    const result = await smsInboundModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_inbound_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/sms-inbounds/test_sms_inbound_id\").reply(200, { key1: \"sms_inbound_value\" }, { header1: \"test\" });\n    const result = await smsInboundModule.single(\"test_sms_inbound_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_inbound_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update\", async () => {\n    nock(\"http://test.com\").put(\"/sms-inbounds/test_sms_inbound_id\").reply(200, { key1: \"sms_inbound_updated\" }, { header1: \"test\" });\n    const result = await smsInboundModule.update(\"test_sms_inbound_id\", { name: \"Updated Inbound\", enabled: false });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_inbound_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/sms-inbounds/test_sms_inbound_id\").reply(200, { key1: \"sms_inbound_deleted\" }, { header1: \"test\" });\n    const result = await smsInboundModule.delete(\"test_sms_inbound_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_inbound_deleted\" });\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/SmsMessage.test.ts",
    "content": "import nock from \"nock\";\nimport { SmsMessageModule } from \"../../modules/sms/Message.module\";\n\ndescribe(\"SMS Message Module\", () => {\n  const smsMessageModule = new SmsMessageModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    const params = { page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/sms-messages\").query(params).reply(200, { key1: \"sms_message_list\" }, { header1: \"test\" });\n    const result = await smsMessageModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_message_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/sms-messages/test_sms_message_id\").reply(200, { key1: \"sms_message_value\" }, { header1: \"test\" });\n    const result = await smsMessageModule.single(\"test_sms_message_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_message_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/SmsNumber.test.ts",
    "content": "import nock from \"nock\";\nimport { SmsNumberModule } from \"../../modules/sms/Number.module\";\n\ndescribe(\"SMS Number Module\", () => {\n  const smsNumberModule = new SmsNumberModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    const params = { page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/sms-numbers\").query(params).reply(200, { key1: \"sms_number_list\" }, { header1: \"test\" });\n    const result = await smsNumberModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_number_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/sms-numbers/test_sms_number_id\").reply(200, { key1: \"sms_number_value\" }, { header1: \"test\" });\n    const result = await smsNumberModule.single(\"test_sms_number_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_number_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update\", async () => {\n    nock(\"http://test.com\").put(\"/sms-numbers/test_sms_number_id\").reply(200, { key1: \"sms_number_updated\" }, { header1: \"test\" });\n    const result = await smsNumberModule.update(\"test_sms_number_id\", true);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_number_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/sms-numbers/test_sms_number_id\").reply(200, { key1: \"sms_number_deleted\" }, { header1: \"test\" });\n    const result = await smsNumberModule.delete(\"test_sms_number_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_number_deleted\" });\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/SmsRecipient.test.ts",
    "content": "import nock from \"nock\";\nimport { SmsRecipientModule } from \"../../modules/sms/Recipient.module\";\n\ndescribe(\"SMS Recipient Module\", () => {\n  const smsRecipientModule = new SmsRecipientModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    const params = { sms_number_id: \"sms_number_id\", status: \"active\" as const, page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/sms-recipients\").query(params).reply(200, { key1: \"sms_recipient_list\" }, { header1: \"test\" });\n    const result = await smsRecipientModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_recipient_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/sms-recipients/test_sms_recipient_id\").reply(200, { key1: \"sms_recipient_value\" }, { header1: \"test\" });\n    const result = await smsRecipientModule.single(\"test_sms_recipient_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_recipient_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update - opt_out\", async () => {\n    nock(\"http://test.com\").put(\"/sms-recipients/test_sms_recipient_id\").reply(200, { key1: \"sms_recipient_updated\" }, { header1: \"test\" });\n    const result = await smsRecipientModule.update(\"test_sms_recipient_id\", \"opt_out\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_recipient_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update - active\", async () => {\n    nock(\"http://test.com\").put(\"/sms-recipients/test_sms_recipient_id\").reply(200, { key1: \"sms_recipient_activated\" }, { header1: \"test\" });\n    const result = await smsRecipientModule.update(\"test_sms_recipient_id\", \"active\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_recipient_activated\" });\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/SmsWebhook.test.ts",
    "content": "import nock from \"nock\";\nimport { SmsWebhookModule } from \"../../modules/sms/Webhook.module\";\nimport { SmsWebhook, SmsWebhookEventType } from \"../../models\";\n\ndescribe(\"SMS Webhook Module\", () => {\n  const smsWebhookModule = new SmsWebhookModule(\"test_key\", \"http://test.com\");\n  const smsWebhook = new SmsWebhook(\n    \"Test SMS Webhook\",\n    \"https://example.com/sms-webhook\",\n    [SmsWebhookEventType.SENT, SmsWebhookEventType.DELIVERED],\n    \"sms_number_id\",\n    true,\n  );\n\n  it(\"create\", async () => {\n    nock(\"http://test.com\").post(\"/sms-webhooks\").reply(201, { key1: \"sms_webhook_created\" }, { header1: \"test\" });\n    const result = await smsWebhookModule.create(smsWebhook);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_webhook_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"list\", async () => {\n    nock(\"http://test.com\")\n      .get(\"/sms-webhooks\")\n      .query({ sms_number_id: \"sms_number_id\" })\n      .reply(200, { key1: \"sms_webhook_list\" }, { header1: \"test\" });\n    const result = await smsWebhookModule.list({ sms_number_id: \"sms_number_id\" });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_webhook_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/sms-webhooks/test_sms_webhook_id\").reply(200, { key1: \"sms_webhook_value\" }, { header1: \"test\" });\n    const result = await smsWebhookModule.single(\"test_sms_webhook_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_webhook_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update\", async () => {\n    nock(\"http://test.com\").put(\"/sms-webhooks/test_sms_webhook_id\").reply(200, { key1: \"sms_webhook_updated\" }, { header1: \"test\" });\n    const result = await smsWebhookModule.update(\"test_sms_webhook_id\", { name: \"Updated Webhook\", enabled: false });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_webhook_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/sms-webhooks/test_sms_webhook_id\").reply(200, { key1: \"sms_webhook_deleted\" }, { header1: \"test\" });\n    const result = await smsWebhookModule.delete(\"test_sms_webhook_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"sms_webhook_deleted\" });\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/SmtpUser.test.ts",
    "content": "import nock from \"nock\";\nimport { SmtpUserModule } from \"../../modules/email/SmtpUser.module\";\n\ndescribe(\"SmtpUser Module\", () => {\n  const smtpUserModule = new SmtpUserModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    const params = { page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/domains/test_id/smtp-users\").query(params).reply(200, { key1: \"smtp_list\" }, { header1: \"test\" });\n    const result = await smtpUserModule.list(\"test_id\", params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"smtp_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/domains/test_id/smtp-users/smtp_user_id\").reply(200, { key1: \"smtp_user\" }, { header1: \"test\" });\n    const result = await smtpUserModule.single(\"test_id\", \"smtp_user_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"smtp_user\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"create\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/domains/test_id/smtp-users\", { name: \"smtp_user_name\" })\n      .reply(201, { key1: \"smtp_created\" }, { header1: \"test\" });\n    const result = await smtpUserModule.create(\"test_id\", { name: \"smtp_user_name\" });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"smtp_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"create with enabled field\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/domains/test_id/smtp-users\", { name: \"smtp_user_name\", enabled: true })\n      .reply(201, { key1: \"smtp_created\" }, { header1: \"test\" });\n    const result = await smtpUserModule.create(\"test_id\", { name: \"smtp_user_name\", enabled: true });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"smtp_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"update\", async () => {\n    nock(\"http://test.com\").put(\"/domains/test_id/smtp-users/smtp_user_id\").reply(200, { key1: \"smtp_updated\" }, { header1: \"test\" });\n    const result = await smtpUserModule.update(\"test_id\", \"smtp_user_id\", { name: \"new_name\" });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"smtp_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update with enabled field\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/domains/test_id/smtp-users/smtp_user_id\", { name: \"new_name\", enabled: false })\n      .reply(200, { key1: \"smtp_updated\" }, { header1: \"test\" });\n    const result = await smtpUserModule.update(\"test_id\", \"smtp_user_id\", { name: \"new_name\", enabled: false });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"smtp_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/domains/test_id/smtp-users/smtp_user_id\").reply(204);\n    const result = await smtpUserModule.delete(\"test_id\", \"smtp_user_id\");\n    expect(result.statusCode).toBe(204);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Template.test.ts",
    "content": "import nock from \"nock\";\nimport { TemplateModule } from \"../../modules/email/Template.module\";\n\ndescribe(\"Template Module\", () => {\n  const templateModule = new TemplateModule(\"test_key\", \"http://test.com\");\n  const templateParams = { name: \"Test Template\", text: \"Hello {{name}}\", html: \"<p>Hello {{name}}</p>\" };\n\n  it(\"list\", async () => {\n    const params = { domain_id: \"domain_id\", page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/templates\").query(params).reply(200, { key1: \"template_list\" }, { header1: \"test\" });\n    const result = await templateModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"template_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"list with no arguments\", async () => {\n    nock(\"http://test.com\").get(\"/templates\").reply(200, { key1: \"template_list_all\" }, { header1: \"test\" });\n    const result = await templateModule.list();\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"template_list_all\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/templates/test_template_id\").reply(200, { key1: \"template_value\" }, { header1: \"test\" });\n    const result = await templateModule.single(\"test_template_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"template_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"create\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/templates\", { name: \"Test Template\", text: \"Hello {{name}}\", html: \"<p>Hello {{name}}</p>\" })\n      .reply(201, { key1: \"template_created\" }, { header1: \"test\" });\n    const result = await templateModule.create(templateParams);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"template_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"create with optional fields\", async () => {\n    const params = {\n      name: \"Test Template\",\n      text: \"Hello {{name}}\",\n      html: \"<p>Hello {{name}}</p>\",\n      categories: [\"cat1\", \"cat2\"],\n      domain_id: \"domain_id\",\n      tags: [\"tag1\", \"tag2\"],\n      auto_generate: true,\n    };\n    nock(\"http://test.com\")\n      .post(\"/templates\", {\n        name: \"Test Template\",\n        text: \"Hello {{name}}\",\n        html: \"<p>Hello {{name}}</p>\",\n        categories: [\"cat1\", \"cat2\"],\n        domain_id: \"domain_id\",\n        tags: [\"tag1\", \"tag2\"],\n        auto_generate: true,\n      })\n      .reply(201, { key1: \"template_created\" }, { header1: \"test\" });\n    const result = await templateModule.create(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"template_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"update\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/templates/test_template_id\", { name: \"Updated Template\" })\n      .reply(200, { key1: \"template_updated\" }, { header1: \"test\" });\n    const result = await templateModule.update(\"test_template_id\", { name: \"Updated Template\" });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"template_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update with optional fields\", async () => {\n    const params = {\n      name: \"Updated Template\",\n      categories: [\"cat1\"],\n      domain_id: \"domain_id\",\n      tags: [\"tag1\"],\n      text: \"Hello {{name}}\",\n      html: \"<p>Hello {{name}}</p>\",\n      auto_generate: false,\n    };\n    nock(\"http://test.com\")\n      .put(\"/templates/test_template_id\", {\n        name: \"Updated Template\",\n        categories: [\"cat1\"],\n        domain_id: \"domain_id\",\n        tags: [\"tag1\"],\n        text: \"Hello {{name}}\",\n        html: \"<p>Hello {{name}}</p>\",\n        auto_generate: false,\n      })\n      .reply(200, { key1: \"template_updated\" }, { header1: \"test\" });\n    const result = await templateModule.update(\"test_template_id\", params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"template_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/templates/test_template_id\").reply(200, { key1: \"template_deleted\" }, { header1: \"test\" });\n    const result = await templateModule.delete(\"test_template_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"template_deleted\" });\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Token.test.ts",
    "content": "import nock from \"nock\";\nimport { TokenModule } from \"../../modules/Token.module\";\nimport { Token, TokenScopeType } from \"../../models\";\n\ndescribe(\"Token Module\", () => {\n  const token = new Token(\"token1\", [TokenScopeType.EMAIL_FULL, TokenScopeType.ANALYTICS_FULL], \"domain_id_test\");\n  const tokenModule = new TokenModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    const params = { page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/token\").query(params).reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const result = await tokenModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"key1_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"list without params\", async () => {\n    nock(\"http://test.com\").get(\"/token\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const result = await tokenModule.list();\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/token/test_id\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const result = await tokenModule.single(\"test_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"key1_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"create\", async () => {\n    nock(\"http://test.com\").post(\"/token\", (body: any) => body.name === \"token1\" && Array.isArray(body.scopes) && body.scopes[0] === \"email_full\" && body.domain_id === \"domain_id_test\").reply(200, { key1: \"token1_value\" }, { header1: \"test\" });\n    const createToken = await tokenModule.create(token);\n    expect(createToken.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(createToken.body).toMatchObject({ key1: \"token1_value\" });\n    expect(createToken.statusCode).toBe(200);\n  });\n\n  it(\"update\", async () => {\n    nock(\"http://test.com\").put(\"/token/test_id\", (body: any) => body.name === \"updated_token\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const result = await tokenModule.update(\"test_id\", { name: \"updated_token\" });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"key1_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update with status\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/token/test_id\", (body: any) => body.status === \"pause\")\n      .reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const result = await tokenModule.update(\"test_id\", { status: \"pause\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"settings\", async () => {\n    nock(\"http://test.com\").put(\"/token/test_id\", (body: any) => body.status === \"pause\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const updateSettings = await tokenModule.updateSettings(\"test_id\", { status: \"pause\" });\n    expect(updateSettings.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(updateSettings.body).toMatchObject({ key1: \"key1_value\" });\n    expect(updateSettings.statusCode).toBe(200);\n  });\n\n  it(\"settings with name\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/token/test_id\", (body: any) => body.name === \"renamed_token\")\n      .reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const result = await tokenModule.updateSettings(\"test_id\", { name: \"renamed_token\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/token/test_id\").reply(200, { key1: \"key1_value\" }, { header1: \"test\" });\n    const deleteDomain = await tokenModule.delete(\"test_id\");\n    expect(deleteDomain.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(deleteDomain.body).toMatchObject({ key1: \"key1_value\" });\n    expect(deleteDomain.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/User.test.ts",
    "content": "import nock from \"nock\";\nimport { UserModule } from \"../../modules/User.module\";\nimport { UserRole, UserPermission } from \"../../models\";\n\ndescribe(\"User Module\", () => {\n  const userModule = new UserModule(\"test_key\", \"http://test.com\");\n\n  it(\"list\", async () => {\n    const params = { page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/users\").query(params).reply(200, { key1: \"user_list\" }, { header1: \"test\" });\n    const result = await userModule.list(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"user_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/users/test_user_id\").reply(200, { key1: \"user_value\" }, { header1: \"test\" });\n    const result = await userModule.single(\"test_user_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"user_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"create\", async () => {\n    const data = { email: \"user@example.com\", role: \"admin\" };\n    nock(\"http://test.com\").post(\"/users\", (body: any) => body.email === \"user@example.com\" && body.role === \"admin\").reply(201, { key1: \"user_created\" }, { header1: \"test\" });\n    const result = await userModule.create(data);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"user_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"create with all fields\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/users\", (body: any) =>\n        body.email === \"user@example.com\" &&\n        body.role === \"Custom User\" &&\n        Array.isArray(body.permissions) &&\n        body.permissions[0] === \"read-activity\" &&\n        Array.isArray(body.templates) &&\n        Array.isArray(body.domains) &&\n        body.requires_periodic_password_change === true\n      )\n      .reply(201, { key1: \"user_created\" }, { header1: \"test\" });\n    const result = await userModule.create({\n      email: \"user@example.com\",\n      role: UserRole.CustomUser,\n      permissions: [UserPermission.ReadActivity, UserPermission.ReadEmail],\n      templates: [\"tmpl_123\"],\n      domains: [\"domain_123\"],\n      requires_periodic_password_change: true,\n    });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"update\", async () => {\n    const data = { role: \"manager\" };\n    nock(\"http://test.com\").put(\"/users/test_user_id\", (body: any) => body.role === \"manager\").reply(200, { key1: \"user_updated\" }, { header1: \"test\" });\n    const result = await userModule.update(\"test_user_id\", data);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"user_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update with permissions and domains\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/users/test_user_id\", (body: any) =>\n        body.role === \"Custom User\" &&\n        Array.isArray(body.permissions) &&\n        Array.isArray(body.domains) &&\n        body.requires_periodic_password_change === false\n      )\n      .reply(200, { key1: \"user_updated\" }, { header1: \"test\" });\n    const result = await userModule.update(\"test_user_id\", {\n      role: UserRole.CustomUser,\n      permissions: [UserPermission.ManageDomain],\n      domains: [\"domain_123\"],\n      requires_periodic_password_change: false,\n    });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/users/test_user_id\").reply(204, {}, { header1: \"test\" });\n    const result = await userModule.delete(\"test_user_id\");\n    expect(result.statusCode).toBe(204);\n  });\n\n  it(\"listInvites\", async () => {\n    const params = { page: 1, limit: 10 };\n    nock(\"http://test.com\").get(\"/invites\").query(params).reply(200, { key1: \"invite_list\" }, { header1: \"test\" });\n    const result = await userModule.listInvites(params);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"invite_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"singleInvite\", async () => {\n    nock(\"http://test.com\").get(\"/invites/test_invite_id\").reply(200, { key1: \"invite_value\" }, { header1: \"test\" });\n    const result = await userModule.singleInvite(\"test_invite_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"invite_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"resendInvite\", async () => {\n    nock(\"http://test.com\").post(\"/invites/test_invite_id/resend\").reply(200, { key1: \"invite_resent\" }, { header1: \"test\" });\n    const result = await userModule.resendInvite(\"test_invite_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"invite_resent\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"deleteInvite\", async () => {\n    nock(\"http://test.com\").delete(\"/invites/test_invite_id\").reply(204, {}, { header1: \"test\" });\n    const result = await userModule.deleteInvite(\"test_invite_id\");\n    expect(result.statusCode).toBe(204);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/modules/Webhook.test.ts",
    "content": "import nock from \"nock\";\nimport { EmailWebhookModule } from \"../../modules/email/Webhook.module\";\nimport { EmailWebhook, EmailWebhookEventType } from \"../../models\";\n\ndescribe(\"Email Webhook Module\", () => {\n  const webhookModule = new EmailWebhookModule(\"test_key\", \"http://test.com\");\n  const webhook = new EmailWebhook({\n    url: \"https://example.com/webhook\",\n    name: \"Test Webhook\",\n    events: [EmailWebhookEventType.SENT, EmailWebhookEventType.DELIVERED],\n    domain_id: \"test_domain_id\",\n  });\n\n  it(\"create sends POST to /webhooks with required fields\", async () => {\n    nock(\"http://test.com\")\n      .post(\"/webhooks\", {\n        url: \"https://example.com/webhook\",\n        name: \"Test Webhook\",\n        events: [EmailWebhookEventType.SENT, EmailWebhookEventType.DELIVERED],\n        domain_id: \"test_domain_id\",\n      })\n      .reply(201, { key1: \"webhook_created\" }, { header1: \"test\" });\n    const result = await webhookModule.create(webhook);\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"webhook_created\" });\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"create with enabled field\", async () => {\n    const webhookWithEnabled = new EmailWebhook({\n      url: \"https://example.com/webhook\",\n      name: \"Test Webhook\",\n      events: [EmailWebhookEventType.SENT],\n      domain_id: \"test_domain_id\",\n      enabled: false,\n    });\n    nock(\"http://test.com\")\n      .post(\"/webhooks\", (body) => body.enabled === false)\n      .reply(201, { key1: \"webhook_created\" }, {});\n    const result = await webhookModule.create(webhookWithEnabled);\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"create with version field\", async () => {\n    const webhookWithVersion = new EmailWebhook({\n      url: \"https://example.com/webhook\",\n      name: \"Test Webhook\",\n      events: [EmailWebhookEventType.SENT],\n      domain_id: \"test_domain_id\",\n      version: 2,\n    });\n    nock(\"http://test.com\")\n      .post(\"/webhooks\", (body) => body.version === 2)\n      .reply(201, { key1: \"webhook_created\" }, {});\n    const result = await webhookModule.create(webhookWithVersion);\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"create with editable field\", async () => {\n    const webhookWithEditable = new EmailWebhook({\n      url: \"https://example.com/webhook\",\n      name: \"Test Webhook\",\n      events: [EmailWebhookEventType.SENT],\n      domain_id: \"test_domain_id\",\n      editable: true,\n    });\n    nock(\"http://test.com\")\n      .post(\"/webhooks\", (body) => body.editable === true)\n      .reply(201, { key1: \"webhook_created\" }, {});\n    const result = await webhookModule.create(webhookWithEditable);\n    expect(result.statusCode).toBe(201);\n  });\n\n  it(\"list sends GET to /webhooks with domain_id and limit\", async () => {\n    nock(\"http://test.com\")\n      .get(\"/webhooks\")\n      .query({ domain_id: \"test_domain_id\", limit: 10 })\n      .reply(200, { key1: \"webhook_list\" }, { header1: \"test\" });\n    const result = await webhookModule.list(\"test_domain_id\", { limit: 10 });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"webhook_list\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"list sends GET to /webhooks with page query param\", async () => {\n    nock(\"http://test.com\")\n      .get(\"/webhooks\")\n      .query({ domain_id: \"test_domain_id\", page: 2 })\n      .reply(200, { key1: \"webhook_list\" }, {});\n    const result = await webhookModule.list(\"test_domain_id\", { page: 2 });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"single\", async () => {\n    nock(\"http://test.com\").get(\"/webhooks/test_webhook_id\").reply(200, { key1: \"webhook_value\" }, { header1: \"test\" });\n    const result = await webhookModule.single(\"test_webhook_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"webhook_value\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update sends PUT to /webhooks/{id} with body fields\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/webhooks/test_webhook_id\", { name: \"Updated Webhook\", enabled: false })\n      .reply(200, { key1: \"webhook_updated\" }, { header1: \"test\" });\n    const result = await webhookModule.update(\"test_webhook_id\", { name: \"Updated Webhook\", enabled: false });\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"webhook_updated\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update with url field\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/webhooks/test_webhook_id\", (body) => body.url === \"https://example.com/new-hook\")\n      .reply(200, { key1: \"webhook_updated\" }, {});\n    const result = await webhookModule.update(\"test_webhook_id\", { url: \"https://example.com/new-hook\" });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update with events field\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/webhooks/test_webhook_id\", (body) => Array.isArray(body.events) && body.events.includes(EmailWebhookEventType.CLICKED))\n      .reply(200, { key1: \"webhook_updated\" }, {});\n    const result = await webhookModule.update(\"test_webhook_id\", { events: [EmailWebhookEventType.CLICKED] });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"update with version field\", async () => {\n    nock(\"http://test.com\")\n      .put(\"/webhooks/test_webhook_id\", (body) => body.version === 2)\n      .reply(200, { key1: \"webhook_updated\" }, {});\n    const result = await webhookModule.update(\"test_webhook_id\", { version: 2 });\n    expect(result.statusCode).toBe(200);\n  });\n\n  it(\"delete\", async () => {\n    nock(\"http://test.com\").delete(\"/webhooks/test_webhook_id\").reply(200, { key1: \"webhook_deleted\" }, { header1: \"test\" });\n    const result = await webhookModule.delete(\"test_webhook_id\");\n    expect(result.headers).toMatchObject({ header1: \"test\", \"content-type\": \"application/json\" });\n    expect(result.body).toMatchObject({ key1: \"webhook_deleted\" });\n    expect(result.statusCode).toBe(200);\n  });\n});\n"
  },
  {
    "path": "src/__tests__/services/mailersend.utils.test.ts",
    "content": "import { MailerSendUtils } from \"../../services/mailersend.utils\";\n\ndescribe(\"utils\", () => {\n  it(\"webhook check\", async () => {\n    const body = Buffer.from(\n      '{\"type\":\"activity.sent\",\"domain_id\":\"test_domain\",\"created_at\":\"2022-09-08T20:06:12.062074Z\",\"webhook_id\":\"webhook_test\",\"url\":\"https:\\\\/\\\\/webhook.site\\\\/test\",\"data\":{\"object\":\"activity\",\"id\":\"631a6250bd4f6bd6844a2307\",\"type\":\"sent\",\"created_at\":\"2022-09-08T20:06:12.051000Z\",\"email\":{\"object\":\"email\",\"id\":\"631a6250bd4f6bd6844a2307\",\"created_at\":\"2022-09-08T20:06:11.887000Z\",\"from\":\"donotreply@mailsender.com\",\"subject\":\"Test Message\",\"status\":\"sent\",\"tags\":null,\"message\":{\"object\":\"message\",\"id\":\"631a6250bd4f6bd6844a2307\",\"created_at\":\"2022-09-08T20:06:11.399000Z\"},\"recipient\":{\"object\":\"recipient\",\"id\":\"631a6250bd4f6bd6844a2307\",\"email\":\"test@test.com\",\"created_at\":\"2022-03-31T21:31:37.304000Z\"}},\"morph\":null,\"template_id\":\"\"}}',\n    );\n    const secret = \"yXdTVu1YewsKiuN2bcILlFHsljmR9kaU\";\n    const signature = \"445e75aab3d8ea9169d134189a2814f06858977bd9cdc69324264e39f47bda2e\";\n    const isLegit = MailerSendUtils.verifyWebHook(body, signature, secret);\n    expect(isLegit).toBeTruthy();\n  });\n\n  it(\"no body\", async () => {\n    try {\n      MailerSendUtils.verifyWebHook(undefined as any, \"test\", \"test\");\n    } catch (e: any) {\n      expect(e?.message).toBe(\"No raw body provided\");\n    }\n  });\n\n  it(\"no signature\", async () => {\n    try {\n      MailerSendUtils.verifyWebHook(Buffer.from(\"test\"), undefined as any, \"test\");\n    } catch (e: any) {\n      expect(e?.message).toBe(\"No signature provided\");\n    }\n  });\n\n  it(\"no secret\", async () => {\n    try {\n      MailerSendUtils.verifyWebHook(Buffer.from(\"test\"), \"test\", undefined as any);\n    } catch (e: any) {\n      expect(e?.message).toBe(\"No secret provided\");\n    }\n  });\n});\n"
  },
  {
    "path": "src/__tests__/services/request.test.ts",
    "content": "import nock from \"nock\";\nimport { TokenModule } from \"../../modules/Token.module\";\nimport { Token, TokenScopeType } from \"../../models\";\n\ndescribe(\"Request service test\", () => {\n  const token = new Token(\"token1\", [TokenScopeType.EMAIL_FULL, TokenScopeType.ANALYTICS_FULL], \"domain_id_test\");\n  const tokenModule = new TokenModule(\"test_key\", \"http://test.com\");\n\n  it(\"exception\", async () => {\n    nock(\"http://test.com\").post(\"/token\").reply(500, { key1: \"test_exception\" }, { header1: \"test_exp\" });\n    try {\n      await tokenModule.create(token);\n      expect(true).toBeFalsy();\n    } catch (e) {\n      const exception = e as any;\n      expect(exception.headers).toMatchObject({ header1: \"test_exp\", \"content-type\": \"application/json\" });\n      expect(exception.body).toMatchObject({ key1: \"test_exception\" });\n      expect(exception.statusCode).toBe(500);\n    }\n  });\n});\n"
  },
  {
    "path": "src/index.ts",
    "content": "export * from \"./modules/MailerSend.module\";\nexport * from \"./models\";\n"
  },
  {
    "path": "src/models/BlocklistMonitor.ts",
    "content": "import { Pagination } from \"./Pagination\";\n\nexport interface BlocklistMonitorQueryParams extends Pagination {\n  query?: string;\n  sort_by?: 'name' | 'address' | 'created_at' | 'updated_at' | 'blocklisted';\n  order?: 'asc' | 'desc';\n}\n\nexport class BlocklistMonitor {\n  address: string;\n  name?: string;\n  notify?: boolean;\n  notify_email?: string;\n  notify_address?: string;\n\n  constructor(address: string) {\n    this.address = address;\n  }\n\n  setAddress(address: string): BlocklistMonitor {\n    this.address = address;\n    return this;\n  }\n\n  setName(name: string): BlocklistMonitor {\n    this.name = name;\n    return this;\n  }\n\n  setNotify(notify: boolean): BlocklistMonitor {\n    this.notify = notify;\n    return this;\n  }\n\n  setNotifyEmail(notifyEmail: string): BlocklistMonitor {\n    this.notify_email = notifyEmail;\n    return this;\n  }\n\n  setNotifyAddress(notifyAddress: string): BlocklistMonitor {\n    this.notify_address = notifyAddress;\n    return this;\n  }\n}\n\nexport interface BlocklistMonitorUpdate {\n  name?: string;\n  notify?: boolean;\n  notify_email?: string;\n  notify_address?: string;\n}\n"
  },
  {
    "path": "src/models/EmailVerification.ts",
    "content": "import { Pagination } from \"./Pagination\";\n\nexport interface EmailVerificationQueryParams extends Pagination {}\nexport interface EmailVerificationSingleQueryParams {\n    detailed?: boolean;\n    page?: number;\n    limit?: number;\n}\nexport interface EmailVerificationResultQueryParams extends Pagination {\n    results?: EmailVerificationResultType[];\n}\n\nexport class EmailVerification {\n    name: string;\n    emails: string[];\n    list_id?: string;\n    verify?: boolean;\n\n    constructor(\n        name: string,\n        emails: string[],\n    ) {\n        this.name = name;\n        this.emails = emails;\n    }\n\n    setName(name: string): EmailVerification {\n      this.name = name;\n      return this;\n    }\n\n    setEmails(emails: string[]): EmailVerification {\n      this.emails = emails;\n      return this;\n    }\n\n    setListId(listId: string): EmailVerification {\n      this.list_id = listId;\n      return this;\n    }\n\n    setVerify(verify: boolean): EmailVerification {\n      this.verify = verify;\n      return this;\n    }\n}\n\nexport enum EmailVerificationResultType {\n    VALID = 'valid',\n    CATCH_ALL = 'catch_all',\n    MAILBOX_FULL = 'mailbox_full',\n    ROLE_BASED = 'role_based',\n    UNKNOWN = 'unknown',\n    SYNTAX_ERROR = 'syntax_error',\n    TYPO = 'typo',\n    MAILBOX_NOT_FOUND = 'mailbox_not_found',\n    DISPOSABLE = 'disposable',\n    MAILBOX_BLOCKED = 'mailbox_blocked',\n    FAILED = 'failed',\n}\n  "
  },
  {
    "path": "src/models/Pagination.ts",
    "content": "export interface Pagination {\n  page?: number;\n  limit?: number;\n}\n"
  },
  {
    "path": "src/models/Token.ts",
    "content": "export class Token {\n  name: string;\n  domain_id?: string;\n  scopes: TokenScopeType[];\n\n  constructor(name: string, scopes: TokenScopeType[], domainId?: string) {\n    this.name = name;\n    this.scopes = scopes;\n    this.domain_id = domainId;\n  }\n\n  setName(name: string): Token {\n    this.name = name;\n    return this\n  }\n\n  setDomainId(domainId: string): Token {\n    this.domain_id = domainId;\n    return this\n  }\n\n  setScopes(scopes: TokenScopeType[]): Token {\n    this.scopes = scopes;\n    return this\n  }\n}\n\nexport enum TokenScopeType {\n  EMAIL_FULL = \"email_full\",\n  DOMAINS_FULL = \"domains_full\",\n  ACTIVITY_READ = \"activity_read\",\n  ACTIVITY_FULL = \"activity_full\",\n  ANALYTICS_READ = \"analytics_read\",\n  ANALYTICS_FULL = \"analytics_full\",\n  TOKENS_FULL = \"tokens_full\",\n  WEBHOOKS_FULL = \"webhooks_full\",\n  TEMPLATES_FULL = \"templates_full\",\n  SUPPRESSIONS_READ = 'suppressions_read',\n  SUPPRESSIONS_FULL = 'suppressions_full',\n  SMS_READ = 'sms_read',\n  SMS_FULL = 'sms_full',\n  EMAIL_VERIFICATION_READ = 'email_verification_read',\n  EMAIL_VERIFICATION_FULL = 'email_verification_full',\n  INBOUNDS_FULL = 'inbounds_full',\n  RECIPIENTS_READ = 'recipients_read',\n  RECIPIENTS_FULL = 'recipients_full',\n  DOMAINS_READ = \"domains_read\",\n  SENDER_IDENTITY_READ = \"sender_identity_read\",\n  SENDER_IDENTITY_FULL = \"sender_identity_full\",\n  USERS_READ = \"users_read\",\n  USERS_FULL = \"users_full\",\n  SMTP_USERS_READ = \"smtp_users_read\",\n  SMTP_USERS_FULL = \"smtp_users_full\",\n  DMARC_MONITORING_READ = \"dmarc_monitoring_read\",\n  DMARC_MONITORING_FULL = \"dmarc_monitoring_full\",\n  BLOCKLIST_MONITORING_READ = \"blocklist_monitoring_read\",\n  BLOCKLIST_MONITORING_FULL = \"blocklist_monitoring_full\",\n  WHATSAPP_FULL = \"whatsapp_full\",\n  IFTTT = \"ifttt\",\n}\n\nexport interface TokenUpdates {\n  name?: string;\n  status?: \"pause\" | \"unpause\";\n}\n"
  },
  {
    "path": "src/models/User.ts",
    "content": "import { Pagination } from \"./Pagination\";\n\nexport interface UserQueryParams extends Pagination {}\n\nexport interface UserCreate {\n  email: string;\n  role: UserRole | string;\n  permissions?: UserPermission[] | string[];\n  templates?: string[];\n  domains?: string[];\n  requires_periodic_password_change?: boolean;\n}\n\nexport interface UserUpdate {\n  role?: UserRole | string;\n  permissions?: UserPermission[] | string[];\n  templates?: string[];\n  domains?: string[];\n  requires_periodic_password_change?: boolean;\n}\n\nexport interface InviteQueryParams extends Pagination {}\n\nexport enum UserRole {\n  Admin = 'Admin',\n  Manager = 'Manager',\n  Designer = 'Designer',\n  Accountant = 'Accountant',\n  CustomUser = 'Custom User',\n}\n\nexport enum UserPermission {\n  ReadAllTemplates = 'read-all-templates',\n  ReadOwnTemplates = 'read-own-templates',\n  ManageTemplates = 'manage-template',\n  ReadFilemanager = 'read-filemanager',\n  ManageDomain = 'manage-domain',\n  ManageInbound = 'manage-inbound',\n  ManageWebhook = 'manage-webhook',\n  ControlSendings = 'control-sendings',\n  ControlTrackingOptions = 'control-tracking-options',\n  AccessSmtpCredentials = 'access-smtp-credentials',\n  ViewSmtpUsers = 'view-smtp-users',\n  ManageSmtpUsers = 'manage-smtp-users',\n  ReadRecipient = 'read-recipient',\n  ReadActivity = 'read-activity',\n  ReadEmail = 'read-email',\n  ReadAnalytics = 'read-analytics',\n  ReadSenderIdentities = 'read-sender-identities',\n  ManageSenderIdentities = 'manage-sender-identities',\n  ReadEmailVerification = 'read-email-verification',\n  ManageEmailVerification = 'manage-email-verification',\n  ManageSms = 'manage-sms',\n  ReadSms = 'read-sms',\n  ManageVerifiedRecipients = 'manage-verified-recipients',\n  ViewSmsWebhooks = 'view-sms-webhooks',\n  ManageSmsWebhooks = 'manage-sms-webhooks',\n  ViewSmsInbound = 'view-sms-inbound',\n  ManageSmsInbound = 'manage-sms-inbound',\n  UpdatePlan = 'update-plan',\n  ManageAccount = 'manage-account',\n  ReadInvoice = 'read-invoice',\n  ManageApiToken = 'manage-api-token',\n  ReadSuppressions = 'read-suppressions',\n  ManageSuppressions = 'manage-suppressions',\n  ReadIpAddresses = 'read-ip-addresses',\n  ManageIpAddresses = 'manage-ip-addresses',\n  ReadErrorLog = 'read-error-log',\n}\n"
  },
  {
    "path": "src/models/email/Activity.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface ActivityQueryParams extends Pagination {\n  date_from: number | string;\n  date_to: number | string;\n  event?: ActivityEventType[];\n}\n\nexport enum ActivityEventType {\n  QUEUED = \"queued\",\n  SENT = \"sent\",\n  DELIVERED = \"delivered\",\n  SOFT_BOUNCED = \"soft_bounced\",\n  HARD_BOUNCED = \"hard_bounced\",\n  OPENED = \"opened\",\n  OPENED_UNIQUE = \"opened_unique\",\n  CLICKED = \"clicked\",\n  CLICKED_UNIQUE = \"clicked_unique\",\n  UNSUBSCRIBED = \"unsubscribed\",\n  SPAM_COMPLAINTS = \"spam_complaints\",\n  SURVEY_OPENED = \"survey_opened\",\n  SURVEY_SUBMITTED = \"survey_submitted\",\n  DEFERRED = \"deferred\",\n}\n"
  },
  {
    "path": "src/models/email/Analytics.ts",
    "content": "import { ActivityEventType } from \"./Activity\";\n\nexport interface AnalyticsOpensQueryParams {\n  date_from: number;\n  date_to: number;\n  recipient_id?: string[];\n  tags?: string[];\n  domain_id?: string;\n}\n\nexport interface AnalyticsDateQueryParams extends AnalyticsOpensQueryParams {\n  group_by?: AnalyticsGroupByType;\n  event?: ActivityEventType[];\n}\n\nexport enum AnalyticsGroupByType {\n  DAYS = \"days\",\n  WEEKS = \"weeks\",\n  MONTHS = \"months\",\n  YEARS = \"years\"\n}\n\n"
  },
  {
    "path": "src/models/email/Attachment.ts",
    "content": "export class Attachment {\n  content: string;\n  filename: string;\n  disposition: 'inline' | 'attachment';\n  id?: string;\n\n  constructor(content: string, fileName: string, disposition: 'inline' | 'attachment' = \"attachment\", id?: string) {\n    this.content = content;\n    this.filename = fileName;\n    this.disposition = disposition;\n    this.id = id;\n  }\n}\n"
  },
  {
    "path": "src/models/email/Dmarc.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport class Dmarc {\n  domain_id: string;\n\n  constructor(domainId: string) {\n    this.domain_id = domainId;\n  }\n}\n\nexport interface DmarcQueryParams extends Pagination {\n  query?: string;\n  sort_by?: 'created_at' | 'updated_at' | 'dmarc_valid' | 'spf_status';\n  order?: 'asc' | 'desc';\n}\n\nexport interface DmarcReportQueryParams extends Pagination {\n  date_from?: string;\n  date_to?: string;\n  search?: string;\n  category?: string;\n  report_source?: string;\n}\n\nexport interface DmarcReportSourcesQueryParams {\n  date_from: string;\n  date_to: string;\n  status?: 'accepted' | 'rejected' | 'quarantined';\n}\n\nexport interface DmarcUpdate {\n  wanted_dmarc_record: string;\n}\n"
  },
  {
    "path": "src/models/email/Domain.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport class Domain {\n  name: string;\n  return_path_subdomain?: string;\n  custom_tracking_subdomain?: string;\n  inbound_routing_subdomain?: string;\n\n  constructor(\n    name: string,\n    returnPathSubdomain?: string,\n    customTrackingSubdomain?: string,\n    inboundRoutingSubdomain?: string,\n  ) {\n    this.name = name;\n    this.return_path_subdomain = returnPathSubdomain;\n    this.custom_tracking_subdomain = customTrackingSubdomain;\n    this.inbound_routing_subdomain = inboundRoutingSubdomain;\n  }\n}\n\nexport interface DomainQueryParams extends Pagination {\n  verified?: boolean;\n}\n\nexport interface DomainRecipientsQueryParams extends Pagination {}\n\nexport interface DomainSettings {\n  send_paused?: boolean;\n  track_clicks?: boolean;\n  track_opens?: boolean;\n  track_unsubscribe?: boolean;\n  track_unsubscribe_html?: string;\n  track_unsubscribe_plain?: string;\n  track_unsubscribe_html_enabled?: boolean;\n  track_unsubscribe_plain_enabled?: boolean;\n  track_content?: boolean;\n  custom_tracking_enabled?: boolean;\n  custom_tracking_subdomain?: string;\n  precedence_bulk?: boolean;\n  ignore_duplicated_recipients?: boolean;\n}\n\n"
  },
  {
    "path": "src/models/email/EmailParams.ts",
    "content": "import { Recipient } from \"./Recipient\";\nimport { Sender } from \"./Sender\";\nimport { Attachment } from \"./Attachment\";\nimport { Personalization } from \"../../modules/Email.module\";\n\nexport class EmailParams {\n  from?: Sender;\n  to: Recipient[];\n  cc?: Recipient[];\n  bcc?: Recipient[];\n  rcpt_to?: Recipient[];\n  reply_to?: Recipient;\n  subject?: string;\n  text?: string;\n  html?: string;\n  send_at?: number | string;\n  attachments?: Attachment[];\n  template_id?: string;\n  in_reply_to?: string;\n  references?: string[];\n  tags?: string[];\n  personalization?: Personalization[];\n  headers?: EmailHeader[];\n  settings?: EmailSettings;\n  precedence_bulk?: boolean;\n  list_unsubscribe?: string;\n\n  constructor(config?: any) {\n    this.from = config?.from;\n    this.to = config?.to;\n    this.cc = config?.cc;\n    this.bcc = config?.bcc;\n    this.rcpt_to = config?.rcptTo;\n    this.reply_to = config?.replyTo;\n    this.in_reply_to = config?.inReplyTo;\n    this.subject = config?.subject;\n    this.text = config?.text;\n    this.html = config?.html;\n    this.send_at = config?.sendAt;\n    this.attachments = config?.attachments;\n    this.template_id = config?.templateId;\n    this.tags = config?.tags;\n    this.personalization = config?.personalization;\n    this.references = config?.references;\n    this.headers = config?.headers;\n    this.settings = config?.settings;\n    this.precedence_bulk = config?.precedenceBulk;\n    this.list_unsubscribe = config?.listUnsubscribe;\n  }\n\n  setFrom(from: Sender): EmailParams {\n    this.from = from;\n    return this;\n  }\n\n  setTo(to: Recipient[]): EmailParams {\n    this.to = to;\n    return this;\n  }\n\n  setCc(cc: Recipient[]): EmailParams {\n    this.cc = cc;\n    return this;\n  }\n\n  setBcc(bcc: Recipient[]): EmailParams {\n    this.bcc = bcc;\n    return this;\n  }\n\n  setRcptTo(rcptTo: Recipient[]): EmailParams {\n    this.rcpt_to = rcptTo;\n    return this;\n  }\n\n  setReplyTo(replyTo: Recipient): EmailParams {\n    this.reply_to = replyTo;\n    return this;\n  }\n\n  setInReplyTo(inReplyTo: string): EmailParams {\n    this.in_reply_to = inReplyTo;\n    return this;\n  }\n\n  setSubject(subject: string): EmailParams {\n    this.subject = subject;\n    return this;\n  }\n\n  setText(text: string): EmailParams {\n    this.text = text;\n    return this;\n  }\n\n  setHtml(html: string): EmailParams {\n    this.html = html;\n    return this;\n  }\n\n  setSendAt(sendAt: number | string): EmailParams {\n    this.send_at = sendAt;\n    return this;\n  }\n\n  setAttachments(attachments: Attachment[]): EmailParams {\n    this.attachments = attachments;\n    return this;\n  }\n\n  setTemplateId(id: string): EmailParams {\n    this.template_id = id;\n    return this;\n  }\n\n  setTags(tags: string[]): EmailParams {\n    this.tags = tags;\n    return this;\n  }\n\n  setPersonalization(personalization: Personalization[]): EmailParams {\n    this.personalization = personalization;\n    return this;\n  }\n\n  setPrecedenceBulk(precedenceBulk: boolean): EmailParams {\n    this.precedence_bulk = precedenceBulk;\n    return this;\n  }\n\n  setSettings(settings: EmailSettings): EmailParams {\n    this.settings = settings;\n    return this;\n  }\n\n  setReferences(references: string[]): EmailParams {\n    this.references = references;\n    return this;\n  }\n\n  setHeaders(headers: EmailHeader[]): EmailParams {\n    this.headers = headers;\n    return this;\n  }\n\n  setListUnsubscribe(listUnsubscribe: string): EmailParams {\n    this.list_unsubscribe = listUnsubscribe;\n    return this;\n  }\n}\n\nexport interface EmailSettings {\n  track_clicks?: boolean;\n  track_opens?: boolean;\n  track_content?: boolean;\n}\n\nexport interface EmailHeader {\n  name: string;\n  value: string;\n}\n"
  },
  {
    "path": "src/models/email/EmailWebhook.ts",
    "content": "export class EmailWebhook {\n  url!: string;\n  name!: string;\n  events!: EmailWebhookEventType[];\n  domain_id!: string;\n  enabled?: boolean;\n  version?: number;\n  editable?: boolean;\n\n  constructor(config?: IEmailWebhook) {\n    if (config) {\n      this.url = config.url;\n      this.name = config.name;\n      this.events = config.events;\n      this.domain_id = config.domain_id;\n      this.enabled = config.enabled;\n      this.version = config.version;\n      this.editable = config.editable;\n    }\n  }\n\n  setUrl(url: string): EmailWebhook {\n    this.url = url;\n    return this;\n  }\n\n  setName(name: string): EmailWebhook {\n    this.name = name;\n    return this;\n  }\n\n  setEvents(events: any[]): EmailWebhook {\n    this.events = events;\n    return this;\n  }\n\n  /**\n   * Set domain id\n   * @param domainId - Existing hashed domain ID.\n   */\n  setDomainId(domainId: string): EmailWebhook {\n    this.domain_id = domainId;\n    return this;\n  }\n\n  setEnabled(enabled: boolean): EmailWebhook {\n    this.enabled = enabled;\n    return this;\n  }\n\n  setEditable(editable: boolean): EmailWebhook {\n    this.editable = editable;\n    return this;\n  }\n\n  setVersion(version: 1 | 2): EmailWebhook {\n    this.version = version;\n    return this;\n  }\n}\n\nexport enum EmailWebhookEventType {\n  SENT = \"activity.sent\",\n  DELIVERED = \"activity.delivered\",\n  SOFT_BOUNCED = \"activity.soft_bounced\",\n  HARD_BOUNCED = \"activity.hard_bounced\",\n  OPENED = \"activity.opened\",\n  OPENED_UNIQUE = \"activity.opened_unique\",\n  CLICKED = \"activity.clicked\",\n  CLICKED_UNIQUE = \"activity.clicked_unique\",\n  UNSUBSCRIBED = \"activity.unsubscribed\",\n  SPAM_COMPLAINT = \"activity.spam_complaint\",\n  SURVEY_OPENED = \"activity.survey_opened\",\n  SURVEY_SUBMITTED = \"activity.survey_submitted\",\n  IDENTITY_VERIFIED = \"sender_identity.verified\",\n  MAINTENANCE_START = \"maintenance.start\",\n  MAINTENANCE_END = \"maintenance.end\",\n  DEFERRED = \"activity.deferred\",\n  INBOUND_FORWARD_FAILED = \"inbound_forward.failed\",\n  EMAIL_SINGLE_VERIFIED = \"email_single.verified\",\n  EMAIL_LIST_VERIFIED = \"email_list.verified\",\n  BULK_EMAIL_COMPLETED = \"bulk_email.completed\",\n  RECIPIENT_ON_HOLD_ADDED = \"recipient.on_hold_added\",\n  RECIPIENT_ON_HOLD_REMOVED = \"recipient.on_hold_removed\",\n}\n\nexport interface IEmailWebhook extends IEmailWebhookUpdate {\n  domain_id: string;\n}\n\nexport interface IEmailWebhookUpdate {\n  url: string;\n  name: string;\n  events: EmailWebhookEventType[];\n  enabled?: boolean;\n  version?: number;\n  editable?: boolean;\n}\n\nexport interface IEmailWebhookUpdateParams {\n  url?: string;\n  name?: string;\n  events?: EmailWebhookEventType[];\n  enabled?: boolean;\n  version?: number;\n  editable?: boolean;\n}\n"
  },
  {
    "path": "src/models/email/Identity.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport class Identity {\n    domain_id: string;\n    email: string;\n    name?: string;\n    personal_note?: string;\n    reply_to_name?: string;\n    reply_to_email?: string;\n    add_note?: boolean;\n\n    constructor(\n        domainId: string,\n        email: string,\n        name?: string,\n        personalNote?: string,\n        replyToName?: string,\n        replyToEmail?: string,\n        addNote?: boolean,\n    ) {\n        this.domain_id = domainId;\n        this.email = email;\n        this.name = name;\n        this.personal_note = personalNote;\n        this.reply_to_name = replyToName;\n        this.reply_to_email = replyToEmail;\n        this.add_note = addNote;\n    }\n\n    setDomainId(domainId: string): Identity {\n      this.domain_id = domainId;\n      return this;\n    }\n\n    setEmail(email: string): Identity {\n      this.email = email;\n      return this;\n    }\n\n    setName(name: string): Identity {\n      this.name = name;\n      return this;\n    }\n\n    setPersonalNote(personalNote: string): Identity {\n      this.personal_note = personalNote;\n      return this;\n    }\n\n    setReplyToName(replyToName: string): Identity {\n      this.reply_to_name = replyToName;\n      return this;\n    }\n\n    setReplyToEmail(replyToEmail: string): Identity {\n      this.reply_to_email = replyToEmail;\n      return this;\n    }\n\n    setAddNote(addNote: boolean): Identity {\n      this.add_note = addNote;\n      return this;\n    }\n}\n\nexport interface IdentityQueryParams extends Pagination {\n    domain_id?: string;\n    query?: string;\n    order_by?: 'email' | 'created_at' | 'verified_at';\n    order?: 'asc' | 'desc';\n}\n\nexport interface IdentityUpdate {\n    name?: string;\n    reply_to_email?: string;\n    reply_to_name?: string;\n}"
  },
  {
    "path": "src/models/email/Inbound.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface InboundQueryParams extends Pagination {\n    domain_id?: string;\n}\n\nexport class Inbound {\n    name: string;\n    domain_enabled: boolean;\n    domain_id: string;\n    inbound_domain?: string;\n    inbound_priority?: number;\n    catch_type?: 'all' | 'one';\n    match_type?: 'all' | 'one';\n    forwards?: InboundForward[];\n    match_filter?: MatchFilter;\n    catch_filter?: CatchFilter;\n\n    constructor(\n        name: string,\n        domainEnabled: boolean,\n        domainId: string,\n        inboundDomain?: string,\n        inboundPriority?: number,\n        forwards?: InboundForward[],\n        matchFilter?: MatchFilter,\n        catchFilter?: CatchFilter,\n    ) {\n        this.name = name;\n        this.domain_enabled = domainEnabled;\n        this.domain_id = domainId;\n        this.inbound_domain = inboundDomain;\n        this.inbound_priority = inboundPriority;\n        this.forwards = forwards;\n        this.match_filter = matchFilter;\n        this.catch_filter = catchFilter;\n    }\n\n    setDomainId(domainId: string): Inbound {\n      this.domain_id = domainId;\n      return this;\n    }\n\n    setName(name: string): Inbound {\n      this.name = name;\n      return this;\n    }\n\n    setDomainEnabled(domainEnabled: boolean): Inbound {\n      this.domain_enabled = domainEnabled;\n      return this;\n    }\n\n    setInboundDomain(inboundDomain: string): Inbound {\n      this.inbound_domain = inboundDomain;\n      return this;\n    }\n\n    setInboundPriority(inboundPriority: number): Inbound {\n      this.inbound_priority = inboundPriority;\n      return this;\n    }\n\n    setForwards(forwards: InboundForward[]): Inbound {\n      this.forwards = forwards;\n      return this;\n    }\n\n    setMatchFilter(matchFilter: MatchFilter): Inbound {\n      this.match_filter = matchFilter;\n      return this;\n    }\n\n    setCatchFilter(catchFilter: CatchFilter): Inbound {\n      this.catch_filter = catchFilter;\n      return this;\n    }\n}\n\nexport class InboundUpdateParams {\n    name: string;\n    domain_enabled: boolean;\n    inbound_domain?: string;\n    inbound_priority?: number;\n    catch_type?: 'all' | 'one';\n    match_type?: 'all' | 'one';\n    forwards?: InboundForward[];\n    match_filter?: MatchFilter;\n    catch_filter?: CatchFilter;\n\n    constructor(\n        name: string,\n        domainEnabled: boolean,\n        inboundDomain?: string,\n        inboundPriority?: number,\n        forwards?: InboundForward[],\n        matchFilter?: MatchFilter,\n        catchFilter?: CatchFilter,\n    ) {\n        this.name = name;\n        this.domain_enabled = domainEnabled;\n        this.inbound_domain = inboundDomain;\n        this.inbound_priority = inboundPriority;\n        this.forwards = forwards;\n        this.match_filter = matchFilter;\n        this.catch_filter = catchFilter;\n    }\n\n    setName(name: string): InboundUpdateParams {\n      this.name = name;\n      return this;\n    }\n\n    setDomainEnabled(domainEnabled: boolean): InboundUpdateParams {\n      this.domain_enabled = domainEnabled;\n      return this;\n    }\n\n    setInboundDomain(inboundDomain: string): InboundUpdateParams {\n      this.inbound_domain = inboundDomain;\n      return this;\n    }\n\n    setInboundPriority(inboundPriority: number): InboundUpdateParams {\n      this.inbound_priority = inboundPriority;\n      return this;\n    }\n\n    setForwards(forwards: InboundForward[]): InboundUpdateParams {\n      this.forwards = forwards;\n      return this;\n    }\n\n    setMatchFilter(matchFilter: MatchFilter): InboundUpdateParams {\n      this.match_filter = matchFilter;\n      return this;\n    }\n\n    setCatchFilter(catchFilter: CatchFilter): InboundUpdateParams {\n      this.catch_filter = catchFilter;\n      return this;\n    }\n}\n\nexport interface InboundForward {\n    type: 'webhook' | 'email';\n    value: string;\n}\n\nexport enum InboundFilterType {\n    CATCH_ALL = 'catch_all',\n    CATCH_RECIPIENT = 'catch_recipient',\n    MATCH_ALL = 'match_all',\n    MATCH_SENDER = 'match_sender',\n    MATCH_DOMAIN = 'match_domain',\n    MATCH_HEADER = 'match_header',\n}\n\nexport enum ComparerType {\n    EQUAL = 'equal',\n    NOT_EQUAL = 'not-equal',\n    CONTAINS = 'contains',\n    NOT_CONTAINS = 'not-contains',\n    STARTS_WITH = 'starts-with',\n    ENDS_WITH = 'ends-with',\n    NOT_STARTS_WITH = 'not-starts-with',\n    NOT_ENDS_WITH = 'not-ends-with',\n}\n\nexport interface InboundFilter {\n    comparer: ComparerType;\n    value: string;\n}\n\nexport interface MatchInboundFilter extends InboundFilter {\n    key?: string;\n}\n\nexport interface CatchFilter {\n    type: InboundFilterType;\n    filters?: InboundFilter[];\n}\n\nexport interface MatchFilter {\n    type: InboundFilterType;\n    filters?: MatchInboundFilter[];\n}\n"
  },
  {
    "path": "src/models/email/Message.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface MessageQueryParams extends Pagination {} \n"
  },
  {
    "path": "src/models/email/Recipient.ts",
    "content": "import { Sender } from \"./Sender\";\nimport { Pagination } from \"../Pagination\";\n\nexport class Recipient extends Sender {\n  constructor(email: string, name?: string) {\n    super(email, name);\n  }\n}\nexport interface RecipientsQueryParams extends Pagination {\n  domain_id?: string;\n}\n\nexport interface BlockListQueryParams extends Pagination {\n  domain_id?: string;\n}\n\nexport interface OnHoldListQueryParams extends Pagination {\n  domain_id?: string;\n}\n\nexport interface BlockListRecipients {\n  domain_id?: string;\n  recipients?: string[];\n  patterns?: string[];\n}\n\nexport interface BlockListRecipientsPost {\n  domain_id: string;\n  recipients: string[];\n}\n\nexport enum BlockListType {\n  BLOCK_LIST = 'blocklist',\n  HARD_BOUNCES_LIST = 'hard-bounces',\n  SPAM_COMPLAINTS_LIST = 'spam-complaints',\n  UNSUBSCRIBES_LIST = 'unsubscribes',\n  ON_HOLD_LIST = 'on-hold-list',\n}\n"
  },
  {
    "path": "src/models/email/Schedule.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface ScheduleQueryParams extends Pagination {\n    domain_id?: string;\n    status?: 'scheduled' | 'sent' | 'error';\n}\n"
  },
  {
    "path": "src/models/email/Sender.ts",
    "content": "export class Sender {\n  email: string;\n  name?: string;\n\n  constructor(email: string, name?: string) {\n    this.email = email;\n    this.name = name;\n  }\n}\n"
  },
  {
    "path": "src/models/email/SmtpUser.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface SmtpUserParams {\n  name: string;\n  enabled?: boolean;\n}\n\nexport interface SmtpUserQueryParams extends Pagination {}\n"
  },
  {
    "path": "src/models/email/Template.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface TemplateQueryParams extends Pagination {\n    domain_id?: string;\n}\n\nexport interface TemplateParams {\n    name?: string;\n    categories?: string[];\n    domain_id?: string;\n    tags?: string[];\n    text: string;\n    html: string;\n    auto_generate?: boolean;\n}\n\nexport interface TemplateUpdateParams {\n    name?: string;\n    categories?: string[];\n    domain_id?: string;\n    tags?: string[];\n    text?: string;\n    html?: string;\n    auto_generate?: boolean;\n}\n"
  },
  {
    "path": "src/models/index.ts",
    "content": "export * from \"./Token\";\nexport * from \"./EmailVerification\";\nexport * from \"./Pagination\";\nexport * from \"./User\";\nexport * from \"./BlocklistMonitor\";\n\n//Email Models\nexport * from \"./email/Attachment\";\nexport * from \"./email/EmailParams\";\nexport * from \"./email/EmailWebhook\";\nexport * from \"./email/Recipient\";\nexport * from \"./email/Sender\";\nexport * from \"./email/Activity\";\nexport * from \"./email/Analytics\";\nexport * from \"./email/Domain\";\nexport * from \"./email/SmtpUser\";\nexport * from \"./email/Inbound\";\nexport * from \"./email/Message\";\nexport * from \"./email/Schedule\";\nexport * from \"./email/Template\";\nexport * from \"./email/Identity\";\nexport * from \"./email/Dmarc\";\n\n//SMS Models\nexport * from \"./sms/Activity\";\nexport * from \"./sms/Message\";\nexport * from \"./sms/Number\";\nexport * from \"./sms/Inbound\";\nexport * from \"./sms/SMSParams\";\nexport * from \"./sms/SMSPersonalization\";\nexport * from \"./sms/Recipient\";\nexport * from \"./sms/Webhook\";\n"
  },
  {
    "path": "src/models/sms/Activity.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface SmsActivityQueryParams extends Pagination {\n  date_from?: number;\n  date_to?: number;\n  status?: SmsActivityStatusType[];\n  sms_number_id?: string;\n}\n\nexport enum SmsActivityStatusType {\n  QUEUED = \"queued\",\n  SENT = \"sent\",\n  DELIVERED = \"delivered\",\n  FAILED = \"failed\",\n  PROCESSED = \"processed\",\n}\n"
  },
  {
    "path": "src/models/sms/Inbound.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface SmsInboundQueryParams extends Pagination {\n  sms_number_id?: string;\n  enabled?: boolean;\n}\n\nexport class SmsInbound {\n  name: string;\n  enabled?: boolean;\n  sms_number_id?: string;\n  forward_url: string;\n  filter?: SmsInboundFilter;\n\n  constructor(\n    name: string,\n    smsNumberId: string,\n    forwardUrl: string,\n    enabled?: boolean,\n    filter?: SmsInboundFilter,\n  ) {\n    this.name = name;\n    this.enabled = enabled;\n    this.sms_number_id = smsNumberId;\n    this.forward_url = forwardUrl;\n    this.filter = filter;\n  }\n\n  setSmsNumberId(smsNumberId: string): SmsInbound {\n    this.sms_number_id = smsNumberId;\n    return this;\n  }\n\n  setName(name: string): SmsInbound {\n    this.name = name;\n    return this;\n  }\n\n  setEnabled(enabled: boolean): SmsInbound {\n    this.enabled = enabled;\n    return this;\n  }\n\n  setForwardUrl(forward_url: string): SmsInbound {\n    this.forward_url = forward_url;\n    return this;\n  }\n\n  setFilter(filter: SmsInboundFilter): SmsInbound {\n    this.filter = filter;\n    return this;\n  }\n}\n\nexport enum SmsComparerType {\n  EQUAL = 'equal',\n  NOT_EQUAL = 'not-equal',\n  CONTAINS = 'contains',\n  NOT_CONTAINS = 'not-contains',\n  STARTS_WITH = 'starts-with',\n  ENDS_WITH = 'ends-with',\n  NOT_STARTS_WITH = 'not-starts-with',\n  NOT_ENDS_WITH = 'not-ends-with',\n}\n\nexport interface SmsInboundFilter {\n  comparer: SmsComparerType;\n  value: string;\n}\n\nexport interface SmsInboundUpdate {\n  name?: string;\n  enabled?: boolean;\n  sms_number_id?: string;\n  forward_url?: string;\n  filter?: SmsInboundFilter;\n}\n"
  },
  {
    "path": "src/models/sms/Message.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface SmsMessageQueryParams extends Pagination {}\n"
  },
  {
    "path": "src/models/sms/Number.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface SmsNumberQueryParams extends Pagination {\n    paused?: boolean;\n}\n"
  },
  {
    "path": "src/models/sms/Recipient.ts",
    "content": "import { Pagination } from \"../Pagination\";\n\nexport interface SmsRecipientQueryParams extends Pagination {\n  status?: \"active\" | \"opt_out\";\n  sms_number_id?: string;\n}\n"
  },
  {
    "path": "src/models/sms/SMSParams.ts",
    "content": "import { SMSPersonalization } from \"./SMSPersonalization\";\n\nexport class SMSParams {\n  from: string;\n  to: string[];\n  text: string;\n  personalization?: SMSPersonalization[];\n\n  constructor(config?: any) {\n    this.from = config?.from;\n    this.to = config?.to;\n    this.text = config?.text;\n    if (config?.personalization?.length) {\n      this.personalization = config?.personalization;\n    }\n  }\n\n  setFrom(from: string): SMSParams {\n    this.from = from;\n    return this;\n  }\n\n  setTo(to: string[]): SMSParams {\n    this.to = to;\n    return this;\n  }\n\n  setText(text: string): SMSParams {\n    this.text = text;\n    return this;\n  }\n\n  setPersonalization(personalization: SMSPersonalization[]): SMSParams {\n    this.personalization = personalization;\n    return this;\n  }\n}\n"
  },
  {
    "path": "src/models/sms/SMSPersonalization.ts",
    "content": "export class SMSPersonalization {\n  phone_number: string; \n  data: {\n    [key: string]: string;\n  };\n\n  constructor(phoneNumber: string, data: { [key: string]: string }) {\n    this.phone_number = phoneNumber;\n    this.data = data;\n  }\n}\n"
  },
  {
    "path": "src/models/sms/Webhook.ts",
    "content": "export interface SmsWebhookQueryParams {\n    sms_number_id: string;\n    page?: number;\n    limit?: number;\n}\n\nexport class SmsWebhook {\n    url: string;\n    name: string;\n    events: SmsWebhookEventType[];\n    sms_number_id: string;\n    enabled?: boolean;\n\n    constructor(\n        name: string,\n        url: string,\n        events: SmsWebhookEventType[],\n        smsNumberId: string,\n        enabled?: boolean\n    ) {\n        this.url = url;\n        this.name = name;\n        this.events = events;\n        this.sms_number_id = smsNumberId;\n        this.enabled = enabled;\n    }\n\n    setUrl(url: string): SmsWebhook {\n        this.url = url;\n        return this;\n    }\n\n    setName(name: string): SmsWebhook {\n        this.name = name;\n        return this;\n    }\n\n    setEvents(events: SmsWebhookEventType[]): SmsWebhook {\n        this.events = events;\n        return this;\n    }\n\n    setSmsNumberId(smsNumberId: string): SmsWebhook {\n        this.sms_number_id = smsNumberId;\n        return this;\n    }\n\n    setEnabled(enabled: boolean): SmsWebhook {\n        this.enabled = enabled;\n        return this;\n    }\n}\n\nexport interface SmsWebhookUpdate {\n    url?: string;\n    name?: string;\n    events?: SmsWebhookEventType[];\n    enabled?: boolean;\n}\n\nexport enum SmsWebhookEventType {\n    SENT = \"sms.sent\",\n    DELIVERED = \"sms.delivered\",\n    FAILED = \"sms.failed\",\n}\n"
  },
  {
    "path": "src/modules/BlocklistMonitor.module.ts",
    "content": "import { RequestService, APIResponse } from \"../services/request.service\";\nimport { BlocklistMonitor, BlocklistMonitorQueryParams, BlocklistMonitorUpdate } from \"../models\";\n\nexport class BlocklistMonitorModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: BlocklistMonitorQueryParams): Promise<APIResponse> {\n    return await this.get(`/blocklist-monitoring`, queryParams);\n  }\n\n  async single(monitorId: string): Promise<APIResponse> {\n    return await this.get(`/blocklist-monitoring/${monitorId}`);\n  }\n\n  async create(data: BlocklistMonitor): Promise<APIResponse> {\n    return await this.post<BlocklistMonitor>(`/blocklist-monitoring`, data);\n  }\n\n  async update(monitorId: string, data: BlocklistMonitorUpdate): Promise<APIResponse> {\n    return await this.put(`/blocklist-monitoring/${monitorId}`, data);\n  }\n\n  async delete(monitorId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/blocklist-monitoring/${monitorId}`);\n  }\n}\n"
  },
  {
    "path": "src/modules/Dmarc.module.ts",
    "content": "import { RequestService, APIResponse } from \"../services/request.service\";\nimport { Dmarc, DmarcQueryParams, DmarcReportQueryParams, DmarcReportSourcesQueryParams, DmarcUpdate } from \"../models\";\n\nexport class DmarcModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: DmarcQueryParams): Promise<APIResponse> {\n    return await this.get(`/dmarc-monitoring`, queryParams);\n  }\n\n  async create(data: Dmarc): Promise<APIResponse> {\n    return await this.post<Dmarc>(`/dmarc-monitoring`, data);\n  }\n\n  async update(monitorId: string, data: DmarcUpdate): Promise<APIResponse> {\n    return await this.put(`/dmarc-monitoring/${monitorId}`, data);\n  }\n\n  async delete(monitorId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/dmarc-monitoring/${monitorId}`);\n  }\n\n  async report(monitorId: string, queryParams?: DmarcReportQueryParams): Promise<APIResponse> {\n    return await this.get(`/dmarc-monitoring/${monitorId}/report`, queryParams);\n  }\n\n  async reportByIp(monitorId: string, ip: string, queryParams?: DmarcReportQueryParams): Promise<APIResponse> {\n    return await this.get(`/dmarc-monitoring/${monitorId}/report/${ip}`, queryParams);\n  }\n\n  async reportSources(monitorId: string, queryParams: DmarcReportSourcesQueryParams): Promise<APIResponse> {\n    return await this.get(`/dmarc-monitoring/${monitorId}/report-sources`, queryParams);\n  }\n\n  async addFavorite(monitorId: string, ip: string): Promise<APIResponse> {\n    return await this.put(`/dmarc-monitoring/${monitorId}/favorite/${ip}`, {});\n  }\n\n  async removeFavorite(monitorId: string, ip: string): Promise<APIResponse> {\n    return await this.deleteReq(`/dmarc-monitoring/${monitorId}/favorite/${ip}`);\n  }\n}\n"
  },
  {
    "path": "src/modules/Email.module.ts",
    "content": "import { EmailParams } from \"../models\";\nimport { RequestService, APIResponse } from \"../services/request.service\";\n\nimport { ActivityModule } from \"./email/Activity.module\";\nimport { AnalyticsModule } from \"./email/Analytics.module\";\nimport { DomainModule } from \"./email/Domain.module\";\nimport { InboundModule } from \"./email/Inbound.module\";\nimport { MessageModule } from \"./email/Message.module\";\nimport { ScheduleModule } from \"./email/Schedule.module\";\nimport { RecipientModule } from \"./email/Recipient.module\";\nimport { TemplateModule } from \"./email/Template.module\";\nimport { EmailWebhookModule } from \"./email/Webhook.module\";\nimport { IdentityModule } from \"./email/Identity.module\";\nimport { SmtpUserModule } from \"./email/SmtpUser.module\";\n\nexport class EmailModule extends RequestService {\n  activity: ActivityModule;\n  analytics: AnalyticsModule;\n  domain: DomainModule;\n  inbound: InboundModule;\n  message: MessageModule;\n  schedule: ScheduleModule;\n  recipient: RecipientModule;\n  template: TemplateModule;\n  webhook: EmailWebhookModule;\n  identity: IdentityModule;\n  smtpUser: SmtpUserModule;\n\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n\n    this.activity = new ActivityModule(apiKey, baseUrl);\n    this.analytics = new AnalyticsModule(apiKey, baseUrl);\n    this.domain = new DomainModule(apiKey, baseUrl);\n    this.inbound = new InboundModule(apiKey, baseUrl);\n    this.message = new MessageModule(apiKey, baseUrl);\n    this.schedule = new ScheduleModule(apiKey, baseUrl);\n    this.recipient = new RecipientModule(apiKey, baseUrl);\n    this.template = new TemplateModule(apiKey, baseUrl);\n    this.webhook = new EmailWebhookModule(apiKey, baseUrl);\n    this.identity = new IdentityModule(apiKey, baseUrl);\n    this.smtpUser = new SmtpUserModule(apiKey, baseUrl);\n  }\n\n  async send(params: EmailParams): Promise<APIResponse> {\n    return await this.post<EmailParams>(\"/email\", params);\n  }\n\n  async sendBulk(params: EmailParams[]): Promise<APIResponse> {\n    return await this.post<EmailParams[]>(\"/bulk-email\", params);\n  }\n\n  async getBulkStatus(bulkId: string): Promise<APIResponse> {\n    return await this.get(`/bulk-email/${bulkId}`);\n  }\n}\n\nexport interface Personalization {\n  email: string;\n  data: {\n    [key: string]: any;\n  };\n}\n"
  },
  {
    "path": "src/modules/EmailVerification.module.ts",
    "content": "import { RequestService, APIResponse } from \"../services/request.service\";\nimport { EmailVerification, EmailVerificationQueryParams, EmailVerificationResultQueryParams, EmailVerificationSingleQueryParams } from \"../models\";\n\nexport class EmailVerificationModule extends RequestService {\n    constructor(apiKey: string, baseUrl: string) {\n        super(apiKey, baseUrl);\n    }\n\n    async list(queryParams?: EmailVerificationQueryParams): Promise<APIResponse> {\n        return await this.get(`/email-verification`, queryParams);\n    }\n\n    async single(emailVerificationId: string, queryParams?: EmailVerificationSingleQueryParams): Promise<APIResponse> {\n        return await this.get(`/email-verification/${emailVerificationId}`, queryParams);\n    }\n\n    async create(emailVerification: EmailVerification): Promise<APIResponse> {\n        return await this.post<EmailVerification>(`/email-verification`, emailVerification);\n    }\n\n    async verifyList(emailVerificationId: string): Promise<APIResponse> {\n        return await this.get(`/email-verification/${emailVerificationId}/verify`);\n    }\n\n    async getListResult(emailVerificationId: string, queryParams: EmailVerificationResultQueryParams): Promise<APIResponse> {\n        return await this.get(`/email-verification/${emailVerificationId}/results`, queryParams);\n    }\n\n    async verifyEmail(email: string): Promise<APIResponse> {\n        return await this.post<{ email: string }>(`/email-verification/verify`, { email: email });\n    }\n\n    async verifyEmailAsync(email: string): Promise<APIResponse> {\n        return await this.post<{ email: string }>(`/email-verification/verify-async`, { email: email });\n    }\n\n    async getVerifyEmailAsyncStatus(id: string): Promise<APIResponse> {\n        return await this.get(`/email-verification/verify-async/${id}`);\n    }\n}\n"
  },
  {
    "path": "src/modules/MailerSend.module.ts",
    "content": "import { EmailModule } from \"./Email.module\";\nimport { TokenModule } from \"./Token.module\";\nimport { EmailVerificationModule } from \"./EmailVerification.module\";\nimport { SMSModule } from \"./SMS.module\";\nimport { OthersModule } from \"./Others.module\";\nimport { DmarcModule } from \"./Dmarc.module\";\nimport { UserModule } from \"./User.module\";\nimport { BlocklistMonitorModule } from \"./BlocklistMonitor.module\";\n\nexport class MailerSend {\n  private readonly apiKey: string;\n  private baseUrl: string = \"https://api.mailersend.com/v1\";\n  sms: SMSModule;\n  token: TokenModule;\n  email: EmailModule;\n  emailVerification: EmailVerificationModule;\n  others: OthersModule;\n  dmarc: DmarcModule;\n  user: UserModule;\n  blocklistMonitor: BlocklistMonitorModule;\n\n  constructor(config: MailerSendConfig) {\n    this.apiKey = config.apiKey;\n    this.token = new TokenModule(config.apiKey, this.baseUrl);\n    this.email = new EmailModule(config.apiKey, this.baseUrl);\n    this.emailVerification = new EmailVerificationModule(config.apiKey, this.baseUrl);\n    this.sms = new SMSModule(config.apiKey, this.baseUrl);\n    this.others = new OthersModule(config.apiKey, this.baseUrl);\n    this.dmarc = new DmarcModule(config.apiKey, this.baseUrl);\n    this.user = new UserModule(config.apiKey, this.baseUrl);\n    this.blocklistMonitor = new BlocklistMonitorModule(config.apiKey, this.baseUrl);\n  }\n}\n\nexport interface MailerSendConfig {\n  apiKey: string;\n}\n"
  },
  {
    "path": "src/modules/Others.module.ts",
    "content": "import { RequestService, APIResponse } from \"../services/request.service\";\n\nexport class OthersModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async getApiQuota(): Promise<APIResponse> {\n    return await this.get(\"/api-quota\");\n  }\n}\n"
  },
  {
    "path": "src/modules/SMS.module.ts",
    "content": "import { SMSParams } from \"../models\";\nimport { APIResponse, RequestService } from \"../services/request.service\";\nimport { SmsActivityModule } from \"./sms/Activity.module\";\nimport { SmsInboundModule } from \"./sms/Inbound.module\";\nimport { SmsMessageModule } from \"./sms/Message.module\";\nimport { SmsNumberModule } from \"./sms/Number.module\";\nimport { SmsRecipientModule } from \"./sms/Recipient.module\";\nimport { SmsWebhookModule } from \"./sms/Webhook.module\";\n\nexport class SMSModule extends RequestService  {\n  activity: SmsActivityModule;\n  number: SmsNumberModule;\n  message: SmsMessageModule;\n  inbound: SmsInboundModule;\n  recipient: SmsRecipientModule;\n  webhook: SmsWebhookModule;\n\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n\n    this.activity = new SmsActivityModule(apiKey, baseUrl);\n    this.number = new SmsNumberModule(apiKey, baseUrl);\n    this.message = new SmsMessageModule(apiKey, baseUrl);\n    this.inbound = new SmsInboundModule(apiKey, baseUrl);\n    this.recipient = new SmsRecipientModule(apiKey, baseUrl);\n    this.webhook = new SmsWebhookModule(apiKey, baseUrl);\n  }\n\n  async send(params: SMSParams): Promise<APIResponse> {\n    return await this.post(\"/sms\", params);\n  }\n}\n"
  },
  {
    "path": "src/modules/Token.module.ts",
    "content": "import { RequestService, APIResponse } from \"../services/request.service\";\nimport { Token, TokenUpdates } from \"../models\";\n\nexport class TokenModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(params?: { page?: number; limit?: number }): Promise<APIResponse> {\n    return await this.get(`/token`, params);\n  }\n\n  async single(tokenId: string): Promise<APIResponse> {\n    return await this.get(`/token/${tokenId}`);\n  }\n\n  async create(token: Token): Promise<APIResponse> {\n    return await this.post<Token>(\"/token\", token);\n  }\n\n  async update(tokenId: string, data: { name?: string; status?: \"pause\" | \"unpause\" }): Promise<APIResponse> {\n    return await this.put(`/token/${tokenId}`, data);\n  }\n\n  async updateSettings(tokenId: string, updates: TokenUpdates): Promise<APIResponse> {\n    return await this.put(`/token/${tokenId}`, updates);\n  }\n\n  async delete(tokenId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/token/${tokenId}`);\n  }\n}\n"
  },
  {
    "path": "src/modules/User.module.ts",
    "content": "import { RequestService, APIResponse } from \"../services/request.service\";\nimport { UserCreate, UserQueryParams, UserUpdate, InviteQueryParams } from \"../models\";\n\nexport class UserModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: UserQueryParams): Promise<APIResponse> {\n    return await this.get(`/users`, queryParams);\n  }\n\n  async single(userId: string): Promise<APIResponse> {\n    return await this.get(`/users/${userId}`);\n  }\n\n  async create(data: UserCreate): Promise<APIResponse> {\n    return await this.post<UserCreate>(`/users`, data);\n  }\n\n  async update(userId: string, data: UserUpdate): Promise<APIResponse> {\n    return await this.put(`/users/${userId}`, data);\n  }\n\n  async delete(userId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/users/${userId}`);\n  }\n\n  async listInvites(queryParams?: InviteQueryParams): Promise<APIResponse> {\n    return await this.get(`/invites`, queryParams);\n  }\n\n  async singleInvite(inviteId: string): Promise<APIResponse> {\n    return await this.get(`/invites/${inviteId}`);\n  }\n\n  async resendInvite(inviteId: string): Promise<APIResponse> {\n    return await this.post(`/invites/${inviteId}/resend`, {});\n  }\n\n  async deleteInvite(inviteId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/invites/${inviteId}`);\n  }\n}\n"
  },
  {
    "path": "src/modules/email/Activity.module.ts",
    "content": "import { ActivityQueryParams } from \"../../models\";\nimport { RequestService, APIResponse } from \"../../services/request.service\";\n\nexport class ActivityModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async domain(domainId: string, queryParams?: ActivityQueryParams): Promise<APIResponse> {\n    return await this.get(`/activity/${domainId}`, queryParams);\n  }\n\n  async single(activityId: string): Promise<APIResponse> {\n    return await this.get(`/activities/${activityId}`);\n  }\n}\n"
  },
  {
    "path": "src/modules/email/Analytics.module.ts",
    "content": "import { AnalyticsDateQueryParams, AnalyticsOpensQueryParams } from \"../../models\";\nimport { RequestService, APIResponse } from \"../../services/request.service\";\n\nexport class AnalyticsModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async byDate(queryParams: AnalyticsDateQueryParams): Promise<APIResponse> {\n    return await this.get(`/analytics/date`, queryParams);\n  }\n\n  async byCountry(queryParams: AnalyticsOpensQueryParams): Promise<APIResponse> {\n    return await this.get(`/analytics/country`, queryParams);\n  }\n\n  async byUserAgent(queryParams: AnalyticsOpensQueryParams): Promise<APIResponse> {\n    return await this.get(`/analytics/ua-name`, queryParams);\n  }\n\n  async byReadingEnvironment(queryParams: AnalyticsOpensQueryParams): Promise<APIResponse> {\n    return await this.get(`/analytics/ua-type`, queryParams);\n  }\n}\n"
  },
  {
    "path": "src/modules/email/Domain.module.ts",
    "content": "import { RequestService, APIResponse } from \"../../services/request.service\";\nimport { Domain, DomainQueryParams, DomainRecipientsQueryParams, DomainSettings } from \"../../models\";\n\nexport class DomainModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async create(domain: Domain) {\n    return await this.post<Domain>(`/domains`, domain);\n  }\n\n  async list(queryParams?: DomainQueryParams): Promise<APIResponse> {\n    return await this.get(`/domains`, queryParams);\n  }\n\n  async single(domainId: string): Promise<APIResponse> {\n    return await this.get(`/domains/${domainId}`);\n  }\n\n  async delete(domainId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/domains/${domainId}`);\n  }\n\n  async updateSettings(domainId: string, data: DomainSettings): Promise<APIResponse> {\n    return await this.put(`/domains/${domainId}/settings`, data);\n  }\n\n  async recipients(domainId: string, queryParams?: DomainRecipientsQueryParams): Promise<APIResponse> {\n    return await this.get(`/domains/${domainId}/recipients`, queryParams);\n  }\n\n  async dns(domainId: string): Promise<APIResponse> {\n    return await this.get(`/domains/${domainId}/dns-records`);\n  }\n\n  async verify(domainId: string): Promise<APIResponse> {\n    return await this.get(`/domains/${domainId}/verify`);\n  }\n}\n"
  },
  {
    "path": "src/modules/email/Identity.module.ts",
    "content": "import { RequestService, APIResponse } from \"../../services/request.service\";\nimport { Identity, IdentityQueryParams, IdentityUpdate } from \"../../models\";\n\nexport class IdentityModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async create(identity: Identity) {\n    return await this.post<Identity>(`/identities`, identity);\n  }\n\n  async list(queryParams?: IdentityQueryParams): Promise<APIResponse> {\n    return await this.get(`/identities`, queryParams);\n  }\n\n  async single(identityId: string): Promise<APIResponse> {\n    return await this.get(`/identities/${identityId}`);\n  }\n\n  async singleByEmail(email: string): Promise<APIResponse> {\n    return await this.get(`/identities/email/${email}`);\n  }\n\n  async update(identityId: string, data: IdentityUpdate): Promise<APIResponse> {\n    return await this.put(`/identities/${identityId}`, data);\n  }\n\n  async updateByEMail(email: string, data: IdentityUpdate): Promise<APIResponse> {\n    return await this.put(`/identities/email/${email}`, data);\n  }\n\n  async delete(identityId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/identities/${identityId}`);\n  }\n\n  async deleteByEmail(email: string): Promise<APIResponse> {\n    return await this.deleteReq(`/identities/email/${email}`);\n  }\n\n  async resend(identityId: string): Promise<APIResponse> {\n    return await this.post(`/identities/${identityId}/resend`, {});\n  }\n}\n"
  },
  {
    "path": "src/modules/email/Inbound.module.ts",
    "content": "import { RequestService, APIResponse } from \"../../services/request.service\";\nimport { Inbound, InboundUpdateParams, InboundQueryParams } from \"../../models\";\n\nexport class InboundModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async create(inbound: Inbound) {\n    return await this.post<Inbound>(`/inbound`, inbound);\n  }\n\n  async list(queryParams?: InboundQueryParams): Promise<APIResponse> {\n    return await this.get(`/inbound`, queryParams);\n  }\n\n  async single(inboundId: string): Promise<APIResponse> {\n    return await this.get(`/inbound/${inboundId}`);\n  }\n\n  async delete(inboundId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/inbound/${inboundId}`);\n  }\n\n  async update(inboundId: string, data: InboundUpdateParams): Promise<APIResponse> {\n    return await this.put(`/inbound/${inboundId}`, data);\n  }\n}\n"
  },
  {
    "path": "src/modules/email/Message.module.ts",
    "content": "import { RequestService, APIResponse } from \"../../services/request.service\";\nimport { MessageQueryParams } from \"../../models\";\n\nexport class MessageModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: MessageQueryParams): Promise<APIResponse> {\n    return await this.get(`/messages`, queryParams);\n  }\n\n  async single(messageId: string): Promise<APIResponse> {\n    return await this.get(`/messages/${messageId}`);\n  }\n}\n"
  },
  {
    "path": "src/modules/email/Recipient.module.ts",
    "content": "import { RequestService, APIResponse } from \"../../services/request.service\";\nimport { BlockListQueryParams, BlockListRecipients, BlockListRecipientsPost, BlockListType, OnHoldListQueryParams, RecipientsQueryParams } from \"../../models\";\n\nconst MIN_LIMIT = 10;\nconst MAX_LIMIT = 100;\n\nexport class RecipientModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: RecipientsQueryParams): Promise<APIResponse> {\n    return await this.get(`/recipients`, queryParams);\n  }\n\n  async single(recipientId: string): Promise<APIResponse> {\n    return await this.get(`/recipients/${recipientId}`);\n  }\n\n  async delete(recipientId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/recipients/${recipientId}`);\n  }\n\n  async blockList(queryParams?: BlockListQueryParams, type?: BlockListType.BLOCK_LIST | BlockListType.HARD_BOUNCES_LIST | BlockListType.SPAM_COMPLAINTS_LIST | BlockListType.UNSUBSCRIBES_LIST): Promise<APIResponse>;\n  async blockList(queryParams?: OnHoldListQueryParams, type?: BlockListType.ON_HOLD_LIST): Promise<APIResponse>;\n  async blockList(queryParams?: BlockListQueryParams | OnHoldListQueryParams, type: BlockListType = BlockListType.BLOCK_LIST): Promise<APIResponse> {\n    if (queryParams?.limit !== undefined) {\n      if (queryParams.limit < MIN_LIMIT || queryParams.limit > MAX_LIMIT) {\n        throw new Error(`Limit must be between ${MIN_LIMIT} and ${MAX_LIMIT}.`);\n      }\n    }\n    return await this.get(`/suppressions/${type}`, queryParams);\n  }\n\n  async blockRecipients(blockRecipients: BlockListRecipients, type?: BlockListType.BLOCK_LIST): Promise<APIResponse>;\n  async blockRecipients(blockRecipients: BlockListRecipientsPost, type: BlockListType.HARD_BOUNCES_LIST | BlockListType.SPAM_COMPLAINTS_LIST | BlockListType.UNSUBSCRIBES_LIST): Promise<APIResponse>;\n  async blockRecipients(blockRecipients: BlockListRecipients | BlockListRecipientsPost, type: BlockListType = BlockListType.BLOCK_LIST): Promise<APIResponse> {\n    if (type === BlockListType.BLOCK_LIST) {\n      const params = blockRecipients as BlockListRecipients;\n      if (!params.recipients?.length && !params.patterns?.length) {\n        throw new Error('Either recipients or patterns must be provided.');\n      }\n    } else {\n      const params = blockRecipients as BlockListRecipientsPost;\n      if (!params.recipients.length) {\n        throw new Error('Recipients must not be empty.');\n      }\n    }\n    return await this.post<BlockListRecipients | BlockListRecipientsPost>(`/suppressions/${type}`, blockRecipients);\n  }\n\n  async delBlockListRecipients(ids: string[], type: BlockListType = BlockListType.BLOCK_LIST, domainId?: string): Promise<APIResponse> {\n    return await this.deleteReq<{ ids: string[], domain_id?: string }>(`/suppressions/${type}`, { ids, ...(domainId && { domain_id: domainId }) });\n  }\n\n  async delAllBlockListRecipients(type: BlockListType = BlockListType.BLOCK_LIST, domainId?: string): Promise<APIResponse> {\n    return await this.deleteReq<{ all: boolean, domain_id?: string }>(`/suppressions/${type}`, { all: true, ...(domainId && { domain_id: domainId }) });\n  }\n}\n"
  },
  {
    "path": "src/modules/email/Schedule.module.ts",
    "content": "import { RequestService, APIResponse } from \"../../services/request.service\";\nimport { ScheduleQueryParams } from \"../../models\";\n\nexport class ScheduleModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: ScheduleQueryParams): Promise<APIResponse> {\n    return await this.get(`/message-schedules`, queryParams);\n  }\n\n  async single(messageId: string): Promise<APIResponse> {\n    return await this.get(`/message-schedules/${messageId}`);\n  }\n\n  async delete(messageId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/message-schedules/${messageId}`);\n  }\n}\n"
  },
  {
    "path": "src/modules/email/SmtpUser.module.ts",
    "content": "import { RequestService, APIResponse } from \"../../services/request.service\";\nimport { SmtpUserParams, SmtpUserQueryParams } from \"../../models\";\n\nexport class SmtpUserModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(domainId: string, queryParams?: SmtpUserQueryParams): Promise<APIResponse> {\n    return await this.get(`/domains/${domainId}/smtp-users`, queryParams);\n  }\n\n  async single(domainId: string, smtpUserId: string): Promise<APIResponse> {\n    return await this.get(`/domains/${domainId}/smtp-users/${smtpUserId}`);\n  }\n\n  async create(domainId: string, data: SmtpUserParams): Promise<APIResponse> {\n    return await this.post<SmtpUserParams>(`/domains/${domainId}/smtp-users`, data);\n  }\n\n  async update(domainId: string, smtpUserId: string, data: Partial<SmtpUserParams>): Promise<APIResponse> {\n    return await this.put(`/domains/${domainId}/smtp-users/${smtpUserId}`, data);\n  }\n\n  async delete(domainId: string, smtpUserId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/domains/${domainId}/smtp-users/${smtpUserId}`);\n  }\n}\n"
  },
  {
    "path": "src/modules/email/Template.module.ts",
    "content": "import { RequestService, APIResponse } from \"../../services/request.service\";\nimport { TemplateQueryParams, TemplateParams, TemplateUpdateParams } from \"../../models\";\n\nexport class TemplateModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: TemplateQueryParams): Promise<APIResponse> {\n    return await this.get(`/templates`, queryParams);\n  }\n\n  async single(templateId: string): Promise<APIResponse> {\n    return await this.get(`/templates/${templateId}`);\n  }\n\n  async delete(templateId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/templates/${templateId}`);\n  }\n\n  async create(params: TemplateParams): Promise<APIResponse> {\n    return await this.post<TemplateParams>(`/templates`, params);\n  }\n\n  async update(templateId: string, params: TemplateUpdateParams): Promise<APIResponse> {\n    return await this.put(`/templates/${templateId}`, params);\n  }\n}\n"
  },
  {
    "path": "src/modules/email/Webhook.module.ts",
    "content": "import { RequestService, APIResponse } from \"../../services/request.service\";\nimport { EmailWebhook, IEmailWebhookUpdateParams } from \"../../models\";\n\nexport class EmailWebhookModule extends RequestService {\n    constructor(apiKey: string, baseUrl: string) {\n        super(apiKey, baseUrl);\n    }\n\n    async create(params: EmailWebhook): Promise<APIResponse> {\n        return await this.post<EmailWebhook>(\"/webhooks\", params);\n    }\n\n    async list(domainId: string, queryParams?: { limit?: number; page?: number }): Promise<APIResponse> {\n        return await this.get(\"/webhooks\", { domain_id: domainId, ...queryParams });\n    }\n\n    async single(webhookId: string): Promise<APIResponse> {\n        return await this.get(`/webhooks/${webhookId}`);\n    }\n\n    async update(webhookId: string, updates: IEmailWebhookUpdateParams): Promise<APIResponse> {\n        return await this.put(`/webhooks/${webhookId}`, updates);\n    }\n\n    async delete(webhookId: string): Promise<APIResponse> {\n        return await this.deleteReq(`/webhooks/${webhookId}`);\n    }\n}\n"
  },
  {
    "path": "src/modules/sms/Activity.module.ts",
    "content": "import { SmsActivityQueryParams } from \"../../models\";\nimport { RequestService, APIResponse } from \"../../services/request.service\";\n\nexport class SmsActivityModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: SmsActivityQueryParams): Promise<APIResponse> {\n    return await this.get(`/sms-activity`, queryParams);\n  }\n}\n"
  },
  {
    "path": "src/modules/sms/Inbound.module.ts",
    "content": "import { ActivityQueryParams, SmsInbound, SmsInboundQueryParams, SmsInboundUpdate } from \"../../models\";\nimport { RequestService, APIResponse } from \"../../services/request.service\";\n\nexport class SmsInboundModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async create(smsInbound: SmsInbound) {\n    return await this.post<SmsInbound>(`/sms-inbounds`, smsInbound);\n  }\n\n  async list(queryParams?: SmsInboundQueryParams): Promise<APIResponse> {\n    return await this.get(`/sms-inbounds`, queryParams);\n  }\n\n  async single(smsInboundId: string): Promise<APIResponse> {\n    return await this.get(`/sms-inbounds/${smsInboundId}`);\n  }\n\n  async delete(smsInboundId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/sms-inbounds/${smsInboundId}`);\n  }\n\n  async update(smsInboundId: string, data: SmsInboundUpdate): Promise<APIResponse> {\n    return await this.put(`/sms-inbounds/${smsInboundId}`, data);\n  }\n}\n"
  },
  {
    "path": "src/modules/sms/Message.module.ts",
    "content": "import { SmsMessageQueryParams } from \"../../models\";\nimport { RequestService, APIResponse } from \"../../services/request.service\";\n\nexport class SmsMessageModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: SmsMessageQueryParams): Promise<APIResponse> {\n    return await this.get(`/sms-messages`, queryParams);\n  }\n\n  async single(smsMessageId: string): Promise<APIResponse> {\n    return await this.get(`/sms-messages/${smsMessageId}`);\n  }\n}\n"
  },
  {
    "path": "src/modules/sms/Number.module.ts",
    "content": "import { SmsNumberQueryParams } from \"../../models\";\nimport { RequestService, APIResponse } from \"../../services/request.service\";\n\nexport class SmsNumberModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: SmsNumberQueryParams): Promise<APIResponse> {\n    return await this.get(`/sms-numbers`, queryParams);\n  }\n\n  async single(smsNumberId: string): Promise<APIResponse> {\n    return await this.get(`/sms-numbers/${smsNumberId}`);\n  }\n\n  async update(smsNumberId: string, paused: boolean): Promise<APIResponse> {\n    return await this.put(`/sms-numbers/${smsNumberId}`, { paused });\n  }\n\n  async delete(smsNumberId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/sms-numbers/${smsNumberId}`);\n  }\n}\n"
  },
  {
    "path": "src/modules/sms/Recipient.module.ts",
    "content": "import { SmsRecipientQueryParams } from \"../../models\";\nimport { RequestService, APIResponse } from \"../../services/request.service\";\n\nexport class SmsRecipientModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n\n  async list(queryParams?: SmsRecipientQueryParams): Promise<APIResponse> {\n    return await this.get(`/sms-recipients`, queryParams);\n  }\n\n  async single(smsRecipientId: string): Promise<APIResponse> {\n    return await this.get(`/sms-recipients/${smsRecipientId}`);\n  }\n\n  async update(smsRecipientId: string, status: \"active\" | \"opt_out\"): Promise<APIResponse> {\n    return await this.put(`/sms-recipients/${smsRecipientId}`, { status });\n  }\n}\n"
  },
  {
    "path": "src/modules/sms/Webhook.module.ts",
    "content": "import { SmsWebhook, SmsWebhookQueryParams, SmsWebhookUpdate } from \"../../models\";\nimport { RequestService, APIResponse } from \"../../services/request.service\";\n\nexport class SmsWebhookModule extends RequestService {\n  constructor(apiKey: string, baseUrl: string) {\n    super(apiKey, baseUrl);\n  }\n  \n  async create(params: SmsWebhook): Promise<APIResponse> {\n    return await this.post<SmsWebhook>(\"/sms-webhooks\", params);\n  }\n\n  async list(queryParams: SmsWebhookQueryParams): Promise<APIResponse> {\n    return await this.get(\"/sms-webhooks\", queryParams);\n  }\n\n  async single(smsWebhookId: string): Promise<APIResponse> {\n    return await this.get(`/sms-webhooks/${smsWebhookId}`);\n  }\n\n  async update(smsWebhookId: string, data: SmsWebhookUpdate): Promise<APIResponse> {\n    return await this.put(`/sms-webhooks/${smsWebhookId}`, data);\n  }\n\n  async delete(smsWebhookId: string): Promise<APIResponse> {\n    return await this.deleteReq(`/sms-webhooks/${smsWebhookId}`);\n  }\n}\n"
  },
  {
    "path": "src/services/mailersend.utils.ts",
    "content": "import { createHmac, timingSafeEqual } from \"crypto\";\n\nexport class MailerSendUtils {\n  static verifyWebHook(rawBody: Buffer, signature: string, signingSecret: string): boolean {\n    if (!signature) {\n      throw new Error(\"No signature provided\");\n    }\n\n    if (!rawBody) {\n      throw new Error(\"No raw body provided\");\n    }\n\n    if (!signingSecret) {\n      throw new Error(\"No secret provided\");\n    }\n\n    const rawData = rawBody.toString(\"utf8\");\n    const hmacSignature = createHmac(\"sha256\", signingSecret).update(rawData, \"utf8\").digest(\"hex\");\n\n    return timingSafeEqual(Buffer.from(signature), Buffer.from(hmacSignature));\n  }\n}\n"
  },
  {
    "path": "src/services/request.service.ts",
    "content": "import { request as gRequest } from \"gaxios\";\nimport { GaxiosOptions } from \"gaxios\";\nvar qs = require('qs');\n\nexport class RequestService {\n  private readonly apiKey: string;\n  private readonly baseUrl: string;\n\n  constructor(apiKey: string, baseUrl: string) {\n    this.apiKey = apiKey;\n    this.baseUrl = baseUrl;\n  }\n\n  private normalizeHeaders(headers: any): Record<string, string> {\n    if (headers instanceof Headers) {\n      return Object.fromEntries(headers.entries());\n    }\n    return headers;\n  }\n\n  protected async post<T>(path: string, data: T): Promise<APIResponse> {\n    return this.request(\"POST\", path, data);\n  }\n\n  protected async get(path: string, queryParams?: any): Promise<APIResponse> {\n    return this.request(\"GET\", path, null, queryParams);\n  }\n\n  protected async deleteReq<T>(path: string, data?: T): Promise<APIResponse> {\n    return this.request(\"DELETE\", path, data);\n  }\n\n  protected async put(path: string, data: any): Promise<APIResponse> {\n    return this.request(\"PUT\", path, data);\n  }\n\n  private async request(method: \"POST\" | \"GET\" | \"DELETE\" | \"PUT\", path: string, body?: any, queryParams?: any) {\n    try {\n      const requestParams: GaxiosOptions = {\n        url: path.replace(/^\\//, ''),\n        baseURL: this.baseUrl.endsWith('/') ? this.baseUrl : this.baseUrl + '/',\n        method,\n        headers: { Authorization: `Bearer ${this.apiKey}` },\n        responseType: \"json\",\n        fetchImplementation: globalThis.fetch,\n      } as any;\n\n      if (body) {\n        requestParams.data = body;\n      }\n      if (queryParams) {\n        requestParams.params = new URLSearchParams(qs.stringify(queryParams));\n      }\n\n      const { headers, data, status } = await gRequest<APIResponse>(requestParams);\n\n      return { headers: this.normalizeHeaders(headers), body: data, statusCode: status };\n    } catch (e: any) {\n      if (e?.response) {\n        const { headers, data, status } = e.response;\n        throw { headers: this.normalizeHeaders(headers), body: data, statusCode: status };\n      } else {\n        throw e;\n      }\n    }\n  }\n}\n\nexport interface APIResponse {\n  headers: any;\n  body: any;\n  statusCode: number;\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"ES2015\",\n        \"module\": \"commonjs\",\n        \"declaration\": true,\n        \"outDir\": \"./lib\",\n        \"strict\": true,\n        \"esModuleInterop\": true\n    },\n    \"include\": [\n        \"./src/\"\n    ],\n    \"exclude\": [\n        \"node_modules\",\n        \"**/__tests__/*\",\n        \"src/backup/**\"\n    ]\n}\n"
  }
]