Open narekhovhannisyan opened 1 month ago
@coderabbitai review
The changes encompass the introduction and modification of various configuration files, examples, and tests within the project. A new CodeQL configuration file was added to streamline code analysis, while updates were made to the GitHub Actions workflow to integrate CodeQL analysis. The MailtrapClient
class was enhanced with new parameters for bulk and sandbox modes, and several files were reorganized or created to demonstrate email functionality using Mailtrap. Additionally, tests were removed and added to improve coverage and error handling.
File Path | Change Summary |
---|---|
.github/codeql/codeql-config.yml |
Added paths for analysis targeting src and ignored test files in src/__tests__ . |
.github/workflows/test.yml |
Added step to initialize CodeQL analysis using the new configuration file. |
README.md |
Reorganized section on compatibility with previous releases for clarity. |
examples/bulk/send-mail.ts |
Modified MailtrapClient instantiation to include bulk: true and changed sending method from client.bulk.send to client.send . |
examples/bulk/transport.ts |
Introduced example for sending emails using Nodemailer with Mailtrap. |
examples/general/*.ts |
Updated import statements for MailtrapClient from relative paths to direct package imports. |
examples/sending/transport.ts |
Minor syntax fix in Nodemailer transport setup. |
examples/testing/*.ts |
Updated import statements for MailtrapClient from relative paths to direct package imports; introduced examples for sending emails. |
src/__tests__/lib/api/Bulk.test.ts |
Removed unit tests for BulkAPI class. |
src/__tests__/lib/api/Testing.test.ts |
Removed tests for send() method in Testing class. |
src/__tests__/lib/mailtrap-client.test.ts |
Enhanced tests for MailtrapClient , adding scenarios for error handling and successful email sending. |
src/__tests__/lib/normalizer.test.ts |
Removed test for checking if the testing client is switched. |
src/config/index.ts |
Added new error message for bulk and sandbox mode incompatibility. |
src/lib/MailtrapClient.ts |
Updated constructor to accept bulk and sandbox parameters; introduced determineHost method for endpoint selection; improved error handling for missing parameters. |
src/lib/api/Bulk.ts |
Removed BulkAPI class. |
src/lib/api/Testing.ts |
Modified constructor to remove testInboxId ; removed send method, limiting functionality. |
src/lib/normalizer.ts |
Simplified normalizeCallback function by removing conditional logic for mailtrapClient . |
src/types/mailtrap.ts |
Added optional bulk and sandbox properties to MailtrapClientConfig . |
src/types/transport.ts |
Removed optional sandbox property from AdditionalFields type. |
.github/codeql/codeql-config.yml
file, which directly matches the main PR's introduction of the same file with similar configurations for CodeQL analysis, including the paths to be analyzed and ignored.🐇 In the garden of code, changes bloom bright,
With Mailtrap's magic, emails take flight.
New paths for testing, a workflow refined,
In the realm of the rabbit, great progress we find!
Hopping through updates, with joy we will cheer,
For every small change brings us closer, my dear! 🌼
Motivation
MailtrapClient
to accept two more params:bulk: Boolean
andsandbox: Boolean
. They are changing the behavior of the send method of the client in the following way:In the sandbox mode, the
client.send
sends the email to thesandbox
, in the bulk mode - to the Bulk API.BulkSendingAPI
andTestingAPI
classes. There should be only one send method on theMailtrapClient
that will behave as described above.Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation
Tests