@meetploy/types 1.19.0 → 1.21.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/dist/email.d.ts +39 -0
- package/dist/email.js +2 -0
- package/dist/email.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/ploy.d.ts +2 -0
- package/globals.d.ts +5 -0
- package/package.json +1 -1
package/dist/email.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ExecutionContext } from "./ploy.js";
|
|
2
|
+
export interface EmailSendOptions {
|
|
3
|
+
from?: string;
|
|
4
|
+
to: string | string[];
|
|
5
|
+
cc?: string | string[];
|
|
6
|
+
bcc?: string | string[];
|
|
7
|
+
replyTo?: string;
|
|
8
|
+
subject: string;
|
|
9
|
+
html?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export interface EmailSendResult {
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
export type EmailErrorCode = "invalid_request" | "invalid_sender" | "sender_not_allowed" | "invalid_recipient" | "too_many_recipients" | "access_not_approved" | "domain_not_verified" | "recipient_suppressed" | "quota_exceeded" | "recipient_rate_limited" | "email_not_configured" | "send_failed";
|
|
17
|
+
export interface EmailError extends Error {
|
|
18
|
+
name: "EmailError";
|
|
19
|
+
code: EmailErrorCode;
|
|
20
|
+
}
|
|
21
|
+
export interface EmailReplyOptions {
|
|
22
|
+
subject?: string;
|
|
23
|
+
text?: string;
|
|
24
|
+
html?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface PloyEmailMessage {
|
|
27
|
+
readonly from: string;
|
|
28
|
+
readonly to: string;
|
|
29
|
+
readonly headers: Headers;
|
|
30
|
+
readonly raw: ReadableStream<Uint8Array>;
|
|
31
|
+
readonly rawSize: number;
|
|
32
|
+
setReject: (reason: string) => void;
|
|
33
|
+
forward: (rcptTo: string, headers?: Headers | Record<string, string>) => Promise<void>;
|
|
34
|
+
reply: (options: EmailReplyOptions) => Promise<EmailSendResult>;
|
|
35
|
+
}
|
|
36
|
+
export type EmailHandler<TEnv = unknown> = (message: PloyEmailMessage, env: TEnv, ctx: ExecutionContext) => void | Promise<void>;
|
|
37
|
+
export interface EmailBinding {
|
|
38
|
+
send: (message: EmailSendOptions) => Promise<EmailSendResult>;
|
|
39
|
+
}
|
package/dist/email.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ export type { SandboxBinding, SandboxClient, SandboxSession, SandboxSessionOptio
|
|
|
10
10
|
export type { ServiceBinding } from "./service.js";
|
|
11
11
|
export type { ScheduledEvent, ScheduledHandler } from "./scheduled.js";
|
|
12
12
|
export type { PloyAuth, PloyUser } from "./auth.js";
|
|
13
|
+
export type { EmailBinding, EmailError, EmailErrorCode, EmailHandler, EmailReplyOptions, EmailSendOptions, EmailSendResult, PloyEmailMessage, } from "./email.js";
|
|
13
14
|
export type { Ai, AiGateway, AiGatewayOptions, AiGatewayRetries, AiRunOptions, } from "./ai.js";
|
package/dist/ploy.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EmailHandler } from "./email.js";
|
|
1
2
|
import type { QueueMessageEvent } from "./queue.js";
|
|
2
3
|
import type { ScheduledHandler } from "./scheduled.js";
|
|
3
4
|
import type { TimerEvent } from "./timer.js";
|
|
@@ -16,5 +17,6 @@ export interface PloyHandler<TEnv = unknown> {
|
|
|
16
17
|
timer?: TimerHandler<TEnv>;
|
|
17
18
|
workflows?: WorkflowHandlers<TEnv>;
|
|
18
19
|
scheduled?: ScheduledHandler<TEnv>;
|
|
20
|
+
email?: EmailHandler<TEnv>;
|
|
19
21
|
}
|
|
20
22
|
export type Ploy<TEnv = unknown> = PloyHandler<TEnv>;
|
package/globals.d.ts
CHANGED
|
@@ -47,6 +47,11 @@ declare global {
|
|
|
47
47
|
type SandboxSession = import("@meetploy/types").SandboxSession;
|
|
48
48
|
type PloyAuth = import("@meetploy/types").PloyAuth;
|
|
49
49
|
type PloyUser = import("@meetploy/types").PloyUser;
|
|
50
|
+
type EmailBinding = import("@meetploy/types").EmailBinding;
|
|
51
|
+
type EmailSendOptions = import("@meetploy/types").EmailSendOptions;
|
|
52
|
+
type EmailSendResult = import("@meetploy/types").EmailSendResult;
|
|
53
|
+
type EmailReplyOptions = import("@meetploy/types").EmailReplyOptions;
|
|
54
|
+
type PloyEmailMessage = import("@meetploy/types").PloyEmailMessage;
|
|
50
55
|
type Ai = import("@meetploy/types").Ai;
|
|
51
56
|
type AiGateway = import("@meetploy/types").AiGateway;
|
|
52
57
|
type AiGatewayOptions = import("@meetploy/types").AiGatewayOptions;
|