@voltro/plugin-mail 0.84.0 → 0.85.0
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.
- package/CHANGELOG.md +549 -0
- package/THIRD-PARTY-NOTICES.md +104 -704
- package/dist/index.d.ts +15 -18
- package/dist/index.js +260 -260
- package/package.json +6 -8
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { PluginEgressDeclaration } from '@voltro/protocol';
|
|
|
6
6
|
import { PluginHttpRouteRequest } from '@voltro/protocol';
|
|
7
7
|
import { Schema } from 'effect';
|
|
8
8
|
import { VoltroPlugin } from '@voltro/protocol';
|
|
9
|
+
import { YieldableError } from 'effect/Cause';
|
|
9
10
|
|
|
10
11
|
/** Any template regardless of its props type — for registries/collections.
|
|
11
12
|
* `P` is invariant across `EmailTemplate` (it appears in the `props` Schema
|
|
@@ -16,7 +17,7 @@ import { VoltroPlugin } from '@voltro/protocol';
|
|
|
16
17
|
export declare interface AnyEmailTemplate {
|
|
17
18
|
readonly name: string;
|
|
18
19
|
readonly subject: (props: never) => string;
|
|
19
|
-
readonly props: Schema.
|
|
20
|
+
readonly props: Schema.Top;
|
|
20
21
|
readonly render: (props: never) => unknown;
|
|
21
22
|
readonly locale?: string | undefined;
|
|
22
23
|
readonly preview?: unknown;
|
|
@@ -57,7 +58,7 @@ export declare const createOutbox: (max?: number) => Outbox;
|
|
|
57
58
|
|
|
58
59
|
/** Define a template. Infers the props type from the `props` Schema so
|
|
59
60
|
* `subject` / `render` receive the decoded shape. */
|
|
60
|
-
export declare const defineEmail: <S extends Schema.
|
|
61
|
+
export declare const defineEmail: <S extends Schema.Top>(template: {
|
|
61
62
|
readonly name: string;
|
|
62
63
|
readonly props: S;
|
|
63
64
|
readonly subject: (props: Schema.Schema.Type<S>) => string;
|
|
@@ -78,7 +79,7 @@ export declare const defineEmail: <S extends Schema.Schema.Any>(template: {
|
|
|
78
79
|
export declare interface EmailTemplate<P = unknown> {
|
|
79
80
|
readonly name: string;
|
|
80
81
|
readonly subject: (props: P) => string;
|
|
81
|
-
readonly props: Schema.
|
|
82
|
+
readonly props: Schema.Codec<P, P, never, never> | Schema.Top;
|
|
82
83
|
readonly render: (props: P) => unknown;
|
|
83
84
|
readonly locale?: string;
|
|
84
85
|
/** Realistic example props — pre-fills the dashboard preview box (and
|
|
@@ -177,14 +178,12 @@ export declare const mailEgressOf: (options: {
|
|
|
177
178
|
export declare class MailError extends MailError_base {
|
|
178
179
|
}
|
|
179
180
|
|
|
180
|
-
declare const MailError_base: Schema.
|
|
181
|
-
readonly
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
status: Schema.optional<typeof Schema.Number>;
|
|
187
|
-
}>;
|
|
181
|
+
declare const MailError_base: Schema.Class<MailError, Schema.TaggedStruct<"MailError", {
|
|
182
|
+
readonly provider: Schema.String;
|
|
183
|
+
readonly message: Schema.String;
|
|
184
|
+
readonly transient: Schema.Boolean;
|
|
185
|
+
readonly status: Schema.optional<Schema.Number>;
|
|
186
|
+
}>, YieldableError>;
|
|
188
187
|
|
|
189
188
|
export declare interface MailEvent {
|
|
190
189
|
readonly type: MailEventType;
|
|
@@ -385,7 +384,7 @@ export declare interface MailSendRecord {
|
|
|
385
384
|
export declare class MailService extends MailService_base {
|
|
386
385
|
}
|
|
387
386
|
|
|
388
|
-
declare const MailService_base: Context.
|
|
387
|
+
declare const MailService_base: Context.ServiceClass<MailService, "@voltro/plugin-mail/MailService", MailServiceShape>;
|
|
389
388
|
|
|
390
389
|
export declare const mailServiceLayer: (options: MailServiceOptions) => Layer.Layer<MailService>;
|
|
391
390
|
|
|
@@ -465,12 +464,10 @@ export declare interface MailUnsubscribe {
|
|
|
465
464
|
export declare class MailWebhookError extends MailWebhookError_base {
|
|
466
465
|
}
|
|
467
466
|
|
|
468
|
-
declare const MailWebhookError_base: Schema.
|
|
469
|
-
readonly
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
message: typeof Schema.String;
|
|
473
|
-
}>;
|
|
467
|
+
declare const MailWebhookError_base: Schema.Class<MailWebhookError, Schema.TaggedStruct<"MailWebhookError", {
|
|
468
|
+
readonly provider: Schema.String;
|
|
469
|
+
readonly message: Schema.String;
|
|
470
|
+
}>, YieldableError>;
|
|
474
471
|
|
|
475
472
|
/**
|
|
476
473
|
* The provider's delivery-event webhook, mounted by the plugin. Bounces and
|