@ever-works/mailgun-plugin 1.0.0 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,30 @@
1
+ import { IEmailOutboundPlugin, IEmailInboundPlugin, PluginCategory, JsonSchema, EmailSendInput, EmailOptions, EmailSendResult, EmailVerification, EmailInboundMessage } from '@ever-works/plugin';
2
+
3
+ /**
4
+ * Mailgun email provider plugin (outbound + inbound).
5
+ *
6
+ * Outbound uses the official `mailgun.js` SDK (Messages API, US/EU
7
+ * regions). Inbound verifies the Mailgun HMAC-SHA256 signature
8
+ * (`HMAC(signingKey, timestamp + token)`) with Node `crypto` — Mailgun
9
+ * ships no SDK helper for inbound-route parsing/verification — and
10
+ * decodes the parsed message.
11
+ */
12
+ declare class MailgunPlugin implements IEmailOutboundPlugin, IEmailInboundPlugin {
13
+ readonly id = "mailgun";
14
+ readonly name = "Mailgun";
15
+ readonly version = "1.0.0";
16
+ readonly category: PluginCategory;
17
+ readonly capabilities: readonly ["email-outbound", "email-inbound"];
18
+ readonly settingsSchema: JsonSchema;
19
+ onLoad(): Promise<void>;
20
+ onUnload(): Promise<void>;
21
+ private readonly idempotencyCache;
22
+ sendEmail(input: EmailSendInput, options: EmailOptions): Promise<EmailSendResult>;
23
+ verifyAddress(address: string, _options: EmailOptions): Promise<EmailVerification>;
24
+ verifyWebhookSignature(rawBody: Buffer, _headers: Readonly<Record<string, string>>, options: EmailOptions): void;
25
+ extractInboundRecipients(rawBody: Buffer, _headers: Readonly<Record<string, string>>): readonly string[];
26
+ parseInboundWebhook(rawBody: Buffer, _headers: Readonly<Record<string, string>>, _options: EmailOptions): Promise<EmailInboundMessage>;
27
+ }
28
+ declare const mailgunPlugin: MailgunPlugin;
29
+
30
+ export { MailgunPlugin, mailgunPlugin };
@@ -0,0 +1,30 @@
1
+ import { IEmailOutboundPlugin, IEmailInboundPlugin, PluginCategory, JsonSchema, EmailSendInput, EmailOptions, EmailSendResult, EmailVerification, EmailInboundMessage } from '@ever-works/plugin';
2
+
3
+ /**
4
+ * Mailgun email provider plugin (outbound + inbound).
5
+ *
6
+ * Outbound uses the official `mailgun.js` SDK (Messages API, US/EU
7
+ * regions). Inbound verifies the Mailgun HMAC-SHA256 signature
8
+ * (`HMAC(signingKey, timestamp + token)`) with Node `crypto` — Mailgun
9
+ * ships no SDK helper for inbound-route parsing/verification — and
10
+ * decodes the parsed message.
11
+ */
12
+ declare class MailgunPlugin implements IEmailOutboundPlugin, IEmailInboundPlugin {
13
+ readonly id = "mailgun";
14
+ readonly name = "Mailgun";
15
+ readonly version = "1.0.0";
16
+ readonly category: PluginCategory;
17
+ readonly capabilities: readonly ["email-outbound", "email-inbound"];
18
+ readonly settingsSchema: JsonSchema;
19
+ onLoad(): Promise<void>;
20
+ onUnload(): Promise<void>;
21
+ private readonly idempotencyCache;
22
+ sendEmail(input: EmailSendInput, options: EmailOptions): Promise<EmailSendResult>;
23
+ verifyAddress(address: string, _options: EmailOptions): Promise<EmailVerification>;
24
+ verifyWebhookSignature(rawBody: Buffer, _headers: Readonly<Record<string, string>>, options: EmailOptions): void;
25
+ extractInboundRecipients(rawBody: Buffer, _headers: Readonly<Record<string, string>>): readonly string[];
26
+ parseInboundWebhook(rawBody: Buffer, _headers: Readonly<Record<string, string>>, _options: EmailOptions): Promise<EmailInboundMessage>;
27
+ }
28
+ declare const mailgunPlugin: MailgunPlugin;
29
+
30
+ export { MailgunPlugin, mailgunPlugin };