@vibesdotdev/integrations-resend 0.0.0-stage → 1.0.0-rc.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.
Files changed (83) hide show
  1. package/LICENSE +126 -0
  2. package/README.md +21 -2
  3. package/dist/client/index.d.ts +3 -0
  4. package/dist/client/index.d.ts.map +1 -0
  5. package/dist/client/index.js +2 -0
  6. package/dist/client/index.js.map +1 -0
  7. package/dist/client/runtime-client.d.ts +12 -0
  8. package/dist/client/runtime-client.d.ts.map +1 -0
  9. package/dist/client/runtime-client.js +61 -0
  10. package/dist/client/runtime-client.js.map +1 -0
  11. package/dist/config/resend.config.descriptor.d.ts +46 -0
  12. package/dist/config/resend.config.descriptor.d.ts.map +1 -0
  13. package/dist/config/resend.config.descriptor.js +50 -0
  14. package/dist/config/resend.config.descriptor.js.map +1 -0
  15. package/dist/index.d.ts +15 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +15 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/resend/index.d.ts +10 -0
  20. package/dist/resend/index.d.ts.map +1 -0
  21. package/dist/resend/index.js +10 -0
  22. package/dist/resend/index.js.map +1 -0
  23. package/dist/resend/resend-events.descriptors.d.ts +62 -0
  24. package/dist/resend/resend-events.descriptors.d.ts.map +1 -0
  25. package/dist/resend/resend-events.descriptors.js +55 -0
  26. package/dist/resend/resend-events.descriptors.js.map +1 -0
  27. package/dist/resend/resend-events.impls.d.ts +35 -0
  28. package/dist/resend/resend-events.impls.d.ts.map +1 -0
  29. package/dist/resend/resend-events.impls.js +115 -0
  30. package/dist/resend/resend-events.impls.js.map +1 -0
  31. package/dist/resend/resend-message-source.descriptor.d.ts +30 -0
  32. package/dist/resend/resend-message-source.descriptor.d.ts.map +1 -0
  33. package/dist/resend/resend-message-source.descriptor.js +24 -0
  34. package/dist/resend/resend-message-source.descriptor.js.map +1 -0
  35. package/dist/resend/resend-normalize.d.ts +24 -0
  36. package/dist/resend/resend-normalize.d.ts.map +1 -0
  37. package/dist/resend/resend-normalize.js +22 -0
  38. package/dist/resend/resend-normalize.js.map +1 -0
  39. package/dist/resend/resend-received.d.ts +25 -0
  40. package/dist/resend/resend-received.d.ts.map +1 -0
  41. package/dist/resend/resend-received.js +26 -0
  42. package/dist/resend/resend-received.js.map +1 -0
  43. package/dist/resend/resend-response.d.ts +3 -0
  44. package/dist/resend/resend-response.d.ts.map +1 -0
  45. package/dist/resend/resend-response.js +14 -0
  46. package/dist/resend/resend-response.js.map +1 -0
  47. package/dist/resend/resend-signature-verifier.descriptor.d.ts +20 -0
  48. package/dist/resend/resend-signature-verifier.descriptor.d.ts.map +1 -0
  49. package/dist/resend/resend-signature-verifier.descriptor.js +20 -0
  50. package/dist/resend/resend-signature-verifier.descriptor.js.map +1 -0
  51. package/dist/resend/resend-signature-verifier.impl.d.ts +16 -0
  52. package/dist/resend/resend-signature-verifier.impl.d.ts.map +1 -0
  53. package/dist/resend/resend-signature-verifier.impl.js +19 -0
  54. package/dist/resend/resend-signature-verifier.impl.js.map +1 -0
  55. package/dist/resend/resend-signature.d.ts +32 -0
  56. package/dist/resend/resend-signature.d.ts.map +1 -0
  57. package/dist/resend/resend-signature.js +77 -0
  58. package/dist/resend/resend-signature.js.map +1 -0
  59. package/dist/resend/resend-webhook.descriptor.d.ts +39 -0
  60. package/dist/resend/resend-webhook.descriptor.d.ts.map +1 -0
  61. package/dist/resend/resend-webhook.descriptor.js +24 -0
  62. package/dist/resend/resend-webhook.descriptor.js.map +1 -0
  63. package/dist/resend/resend-webhook.impl.d.ts +19 -0
  64. package/dist/resend/resend-webhook.impl.d.ts.map +1 -0
  65. package/dist/resend/resend-webhook.impl.js +111 -0
  66. package/dist/resend/resend-webhook.impl.js.map +1 -0
  67. package/dist/resend/resend.descriptor.d.ts +37 -0
  68. package/dist/resend/resend.descriptor.d.ts.map +1 -0
  69. package/dist/resend/resend.descriptor.js +107 -0
  70. package/dist/resend/resend.descriptor.js.map +1 -0
  71. package/dist/resend/resend.impl.d.ts +24 -0
  72. package/dist/resend/resend.impl.d.ts.map +1 -0
  73. package/dist/resend/resend.impl.js +258 -0
  74. package/dist/resend/resend.impl.js.map +1 -0
  75. package/dist/resend.plugin.d.ts +19 -0
  76. package/dist/resend.plugin.d.ts.map +1 -0
  77. package/dist/resend.plugin.js +88 -0
  78. package/dist/resend.plugin.js.map +1 -0
  79. package/dist/schemas/resend.d.ts +421 -0
  80. package/dist/schemas/resend.d.ts.map +1 -0
  81. package/dist/schemas/resend.js +97 -0
  82. package/dist/schemas/resend.js.map +1 -0
  83. package/package.json +107 -4
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Runtime plugin for the Resend email integration vendor pack.
3
+ *
4
+ * Registers:
5
+ * 1. The `integration/provider` descriptor + `ResendEmailIntegration` loader.
6
+ * `packages/email`'s `EmailClient` picks this up automatically by
7
+ * filtering `category === 'email'` at dispatch time.
8
+ * 2. The `email/webhook-handler` descriptor + loader for the platform-app
9
+ * `+server.ts` route that ingests Resend webhooks.
10
+ *
11
+ * Also registers the account-aware consumer client and inbound agent source.
12
+ * Hosts register the owning kind plugins before this vendor plugin.
13
+ */
14
+ import { createRuntimePlugin, loader } from '@vibesdotdev/kernel/factory';
15
+ import { IntegrationBackedEmailTransport, createIntegrationBackedEmailTransportDescriptor } from '@vibesdotdev/email/services/email-transport';
16
+ import resendSettingsDescriptor from "./config/resend.config.descriptor.js";
17
+ import baseResendDescriptor, { createHostResendDescriptor } from "./resend/resend.descriptor.js";
18
+ import resendWebhookDescriptor from "./resend/resend-webhook.descriptor.js";
19
+ import resendMessageSourceDescriptor from "./resend/resend-message-source.descriptor.js";
20
+ import resendSignatureVerifierDescriptor from "./resend/resend-signature-verifier.descriptor.js";
21
+ import { resendWebhookEventDescriptors } from "./resend/resend-events.descriptors.js";
22
+ const SIGNATURE_VERIFIER = { kind: 'tools/signature-verifier' };
23
+ const WEBHOOK_EVENT_DEFINITION = { kind: 'tools/webhook-event-definition' };
24
+ /** Omit options to leave the sender to callers; pass options to declare the host's default sender. */
25
+ export function createResendPlugin(options) {
26
+ const resendDescriptor = options ? createHostResendDescriptor(options) : baseResendDescriptor;
27
+ const resendTransportDescriptor = createIntegrationBackedEmailTransportDescriptor(resendDescriptor);
28
+ return createRuntimePlugin({
29
+ id: 'integrations-resend',
30
+ name: 'Resend Email Integration',
31
+ description: 'Resend email provider, account-aware runtime client, inbound agent source, and verified webhook ingestion.',
32
+ dependencies: ['integrations', 'email', 'tools', 'tools/agents', 'runtime-client'],
33
+ descriptors: [
34
+ resendSettingsDescriptor,
35
+ resendDescriptor,
36
+ { id: 'resend', kind: 'runtime/client', description: 'Resend operations through Platform account authority' },
37
+ resendTransportDescriptor,
38
+ resendWebhookDescriptor,
39
+ resendMessageSourceDescriptor,
40
+ resendSignatureVerifierDescriptor,
41
+ ...resendWebhookEventDescriptors
42
+ ],
43
+ // The webhook handler resolves the integration on the runtime it is registered on,
44
+ // so its loader is registered here with that runtime in hand.
45
+ onRegister(runtime) {
46
+ runtime.registerLoader('email/webhook-handler', resendWebhookDescriptor.id, async () => {
47
+ const { createResendWebhookHandler } = await import("./resend/resend-webhook.impl.js");
48
+ return { impl: createResendWebhookHandler(runtime, resendWebhookDescriptor, resendDescriptor.id) };
49
+ });
50
+ },
51
+ loaders: [
52
+ loader('resend', { kind: 'runtime/client' }, async () => {
53
+ const { ResendClient } = await import("./client/runtime-client.js");
54
+ return { impl: ResendClient };
55
+ }),
56
+ loader(resendDescriptor.id, { kind: 'integration/provider' }, async () => {
57
+ const { ResendEmailIntegration } = await import("./resend/resend.impl.js");
58
+ return { default: ResendEmailIntegration };
59
+ }),
60
+ loader(resendTransportDescriptor.id, { kind: 'email/transport' }, async () => ({
61
+ default: IntegrationBackedEmailTransport
62
+ })),
63
+ loader(resendSignatureVerifierDescriptor.id, SIGNATURE_VERIFIER, async () => {
64
+ const mod = await import("./resend/resend-signature-verifier.impl.js");
65
+ return { impl: new mod.ResendSignatureVerifier() };
66
+ }),
67
+ loader('webhook-event.resend.email.received', WEBHOOK_EVENT_DEFINITION, async () => {
68
+ const mod = await import("./resend/resend-events.impls.js");
69
+ return { impl: new mod.ResendEmailReceived() };
70
+ }),
71
+ loader('webhook-event.resend.email.bounced', WEBHOOK_EVENT_DEFINITION, async () => {
72
+ const mod = await import("./resend/resend-events.impls.js");
73
+ return { impl: new mod.ResendEmailBounced() };
74
+ }),
75
+ loader('webhook-event.resend.email.delivered', WEBHOOK_EVENT_DEFINITION, async () => {
76
+ const mod = await import("./resend/resend-events.impls.js");
77
+ return { impl: new mod.ResendEmailDelivered() };
78
+ }),
79
+ loader('webhook-event.resend.email.complained', WEBHOOK_EVENT_DEFINITION, async () => {
80
+ const mod = await import("./resend/resend-events.impls.js");
81
+ return { impl: new mod.ResendEmailComplained() };
82
+ })
83
+ ]
84
+ });
85
+ }
86
+ export const resendPlugin = createResendPlugin();
87
+ export default resendPlugin;
88
+ //# sourceMappingURL=resend.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resend.plugin.js","sourceRoot":"","sources":["../src/resend.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EACN,+BAA+B,EAC/B,+CAA+C,EAC/C,MAAM,6CAA6C,CAAC;AACrD,OAAO,wBAAwB,MAAM,sCAAsC,CAAC;AAC5E,OAAO,oBAAoB,EAAE,EAAE,0BAA0B,EAA0B,MAAM,+BAA+B,CAAC;AACzH,OAAO,uBAAuB,MAAM,uCAAuC,CAAC;AAC5E,OAAO,6BAA6B,MAAM,8CAA8C,CAAC;AACzF,OAAO,iCAAiC,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAEtF,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,0BAA0B,EAAW,CAAC;AACzE,MAAM,wBAAwB,GAAG,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,GAAG,GAAG,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC;gBAC5D,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,oBAAoB,EAAE,EAAE,CAAC;YACjD,CAAC,CAAC;YACF,MAAM,CAAC,uCAAuC,EAAE,wBAAwB,EAAE,KAAK,IAAI,EAAE;gBACpF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC;gBAC5D,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,qBAAqB,EAAE,EAAE,CAAC;YAClD,CAAC,CAAC;SACF;KACD,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,EAAE,CAAC;AAEjD,eAAe,YAAY,CAAC"}
@@ -0,0 +1,421 @@
1
+ import * as z from 'zod/v4';
2
+ export declare const identityValueSchema: z.ZodString;
3
+ export declare const resendInvokeIdentitySchema: z.ZodObject<{
4
+ userId: z.ZodString;
5
+ organizationId: z.ZodOptional<z.ZodString>;
6
+ jwt: z.ZodOptional<z.ZodString>;
7
+ deploymentAuthority: z.ZodOptional<z.ZodObject<{
8
+ deploymentId: z.ZodString;
9
+ agentId: z.ZodString;
10
+ ownerUserId: z.ZodString;
11
+ organizationId: z.ZodOptional<z.ZodString>;
12
+ connectionId: z.ZodOptional<z.ZodString>;
13
+ integrationId: z.ZodString;
14
+ sourceId: z.ZodString;
15
+ channelId: z.ZodString;
16
+ guildId: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>>;
18
+ }, z.core.$strip>;
19
+ export declare const resendConnectionIdentitySchema: z.ZodObject<{
20
+ userId: z.ZodString;
21
+ organizationId: z.ZodOptional<z.ZodString>;
22
+ jwt: z.ZodOptional<z.ZodString>;
23
+ deploymentAuthority: z.ZodOptional<z.ZodObject<{
24
+ deploymentId: z.ZodString;
25
+ agentId: z.ZodString;
26
+ ownerUserId: z.ZodString;
27
+ organizationId: z.ZodOptional<z.ZodString>;
28
+ connectionId: z.ZodOptional<z.ZodString>;
29
+ integrationId: z.ZodString;
30
+ sourceId: z.ZodString;
31
+ channelId: z.ZodString;
32
+ guildId: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>>;
34
+ connectionId: z.ZodString;
35
+ }, z.core.$strip>;
36
+ export type ResendInvokeIdentity = z.infer<typeof resendInvokeIdentitySchema>;
37
+ export type ResendConnectionIdentity = z.infer<typeof resendConnectionIdentitySchema>;
38
+ export declare const resendHostOptionsSchema: z.ZodObject<{
39
+ defaultFrom: z.ZodString;
40
+ }, z.core.$strict>;
41
+ export type ResendHostOptions = z.infer<typeof resendHostOptionsSchema>;
42
+ export declare const RESEND_DEFAULT_BASE_URL = "https://api.resend.com";
43
+ export declare const ResendSettingsSchema: z.ZodObject<{
44
+ baseUrl: z.ZodDefault<z.ZodURL>;
45
+ }, z.core.$strip>;
46
+ export type ResendSettings = z.infer<typeof ResendSettingsSchema>;
47
+ export declare const resendConfigSchema: z.ZodObject<{
48
+ defaultFrom: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strip>;
50
+ export declare const receivedInputSchema: z.ZodObject<{
51
+ emailId: z.ZodString;
52
+ }, z.core.$strip>;
53
+ export declare const attachmentInputSchema: z.ZodObject<{
54
+ emailId: z.ZodString;
55
+ attachmentId: z.ZodString;
56
+ }, z.core.$strip>;
57
+ export declare const retrievalInputSchema: z.ZodObject<{
58
+ emailId: z.ZodString;
59
+ apiKey: z.ZodString;
60
+ baseUrl: z.ZodURL;
61
+ signal: z.ZodOptional<z.ZodInstanceOf<AbortSignal>>;
62
+ }, z.core.$strip>;
63
+ export type ResendReceivedEmailInput = z.infer<typeof retrievalInputSchema>;
64
+ export declare const attachmentReceiptSchema: z.ZodObject<{
65
+ id: z.ZodString;
66
+ size: z.ZodNumber;
67
+ download_url: z.ZodURL;
68
+ }, z.core.$strip>;
69
+ export declare const attachmentResultSchema: z.ZodObject<{
70
+ content: z.ZodString;
71
+ }, z.core.$strip>;
72
+ export declare const sendResponseSchema: z.ZodObject<{
73
+ id: z.ZodString;
74
+ }, z.core.$strip>;
75
+ export declare const vendorTimestampSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodISODateTime>]>, z.ZodTransform<string, string>>;
76
+ export declare const statusResponseSchema: z.ZodObject<{
77
+ id: z.ZodString;
78
+ last_event: z.ZodEnum<{
79
+ created: "created";
80
+ sent: "sent";
81
+ delivered: "delivered";
82
+ bounced: "bounced";
83
+ complained: "complained";
84
+ opened: "opened";
85
+ clicked: "clicked";
86
+ delivery_delayed: "delivery_delayed";
87
+ failed: "failed";
88
+ }>;
89
+ to: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
+ created_at: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodISODateTime>]>, z.ZodTransform<string, string>>>;
91
+ }, z.core.$strip>;
92
+ export type ResendGetEmailResponse = z.infer<typeof statusResponseSchema>;
93
+ export declare const addressesSchema: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
94
+ export declare const headersSchema: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodObject<{
95
+ name: z.ZodString;
96
+ value: z.ZodString;
97
+ }, z.core.$strip>>, z.ZodTransform<{
98
+ [k: string]: string;
99
+ }, {
100
+ name: string;
101
+ value: string;
102
+ }[]>>]>>>, z.ZodTransform<{
103
+ [k: string]: string;
104
+ }, {
105
+ [k: string]: string;
106
+ } | Record<string, string> | null | undefined>>;
107
+ export declare const receivedPayloadSchema: z.ZodObject<{
108
+ id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
109
+ email_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
110
+ message_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
111
+ messageId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
112
+ from: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
113
+ to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
114
+ cc: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
115
+ bcc: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
116
+ received_for: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
117
+ subject: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
118
+ text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
119
+ html: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
120
+ body_text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
121
+ body_html: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
122
+ reply_to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
123
+ in_reply_to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
124
+ references: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string | string[], string | string[] | null | undefined>>;
125
+ headers: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodObject<{
126
+ name: z.ZodString;
127
+ value: z.ZodString;
128
+ }, z.core.$strip>>, z.ZodTransform<{
129
+ [k: string]: string;
130
+ }, {
131
+ name: string;
132
+ value: string;
133
+ }[]>>]>>>, z.ZodTransform<{
134
+ [k: string]: string;
135
+ }, {
136
+ [k: string]: string;
137
+ } | Record<string, string> | null | undefined>>;
138
+ thread_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
139
+ threadId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
140
+ attachments: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>>, z.ZodTransform<import("@vibesdotdev/kernel/bootstrap").JsonValue[], import("@vibesdotdev/kernel/bootstrap").JsonValue[] | null | undefined>>;
141
+ created_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
142
+ reason: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
143
+ bounce: z.ZodOptional<z.ZodObject<{
144
+ message: z.ZodOptional<z.ZodString>;
145
+ }, z.core.$strip>>;
146
+ }, z.core.$strip>;
147
+ export declare const receivedWebhookSchema: z.ZodObject<{
148
+ type: z.ZodLiteral<"email.received">;
149
+ created_at: z.ZodOptional<z.ZodISODateTime>;
150
+ data: z.ZodObject<{
151
+ id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
152
+ message_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
153
+ messageId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
154
+ cc: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
155
+ bcc: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
156
+ received_for: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
157
+ subject: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
158
+ text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
159
+ html: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
160
+ body_text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
161
+ body_html: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
162
+ reply_to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
163
+ in_reply_to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
164
+ references: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string | string[], string | string[] | null | undefined>>;
165
+ headers: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodObject<{
166
+ name: z.ZodString;
167
+ value: z.ZodString;
168
+ }, z.core.$strip>>, z.ZodTransform<{
169
+ [k: string]: string;
170
+ }, {
171
+ name: string;
172
+ value: string;
173
+ }[]>>]>>>, z.ZodTransform<{
174
+ [k: string]: string;
175
+ }, {
176
+ [k: string]: string;
177
+ } | Record<string, string> | null | undefined>>;
178
+ thread_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
179
+ threadId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
180
+ attachments: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>>, z.ZodTransform<import("@vibesdotdev/kernel/bootstrap").JsonValue[], import("@vibesdotdev/kernel/bootstrap").JsonValue[] | null | undefined>>;
181
+ created_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
182
+ reason: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
183
+ bounce: z.ZodOptional<z.ZodObject<{
184
+ message: z.ZodOptional<z.ZodString>;
185
+ }, z.core.$strip>>;
186
+ email_id: z.ZodString;
187
+ from: z.ZodString;
188
+ to: z.ZodArray<z.ZodString>;
189
+ }, z.core.$strip>;
190
+ }, z.core.$strip>;
191
+ export declare const receivedEnvelopeSchema: z.ZodObject<{
192
+ data: z.ZodObject<{
193
+ id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
194
+ email_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
195
+ message_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
196
+ messageId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
197
+ from: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
198
+ to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
199
+ cc: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
200
+ bcc: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
201
+ received_for: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
202
+ subject: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
203
+ text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
204
+ html: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
205
+ body_text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
206
+ body_html: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
207
+ reply_to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
208
+ in_reply_to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
209
+ references: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string | string[], string | string[] | null | undefined>>;
210
+ headers: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodObject<{
211
+ name: z.ZodString;
212
+ value: z.ZodString;
213
+ }, z.core.$strip>>, z.ZodTransform<{
214
+ [k: string]: string;
215
+ }, {
216
+ name: string;
217
+ value: string;
218
+ }[]>>]>>>, z.ZodTransform<{
219
+ [k: string]: string;
220
+ }, {
221
+ [k: string]: string;
222
+ } | Record<string, string> | null | undefined>>;
223
+ thread_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
224
+ threadId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
225
+ attachments: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>>, z.ZodTransform<import("@vibesdotdev/kernel/bootstrap").JsonValue[], import("@vibesdotdev/kernel/bootstrap").JsonValue[] | null | undefined>>;
226
+ created_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
227
+ reason: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
228
+ bounce: z.ZodOptional<z.ZodObject<{
229
+ message: z.ZodOptional<z.ZodString>;
230
+ }, z.core.$strip>>;
231
+ }, z.core.$strip>;
232
+ created_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
233
+ }, z.core.$strip>;
234
+ export declare const receivedResourceSchema: z.ZodObject<{
235
+ email_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
236
+ message_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
237
+ messageId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
238
+ from: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
239
+ to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
240
+ cc: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
241
+ bcc: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
242
+ received_for: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
243
+ subject: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
244
+ body_text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
245
+ body_html: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
246
+ reply_to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
247
+ in_reply_to: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
248
+ references: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string | string[], string | string[] | null | undefined>>;
249
+ thread_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
250
+ threadId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
251
+ attachments: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>>, z.ZodTransform<import("@vibesdotdev/kernel/bootstrap").JsonValue[], import("@vibesdotdev/kernel/bootstrap").JsonValue[] | null | undefined>>;
252
+ created_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
253
+ reason: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
254
+ bounce: z.ZodOptional<z.ZodObject<{
255
+ message: z.ZodOptional<z.ZodString>;
256
+ }, z.core.$strip>>;
257
+ id: z.ZodString;
258
+ headers: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodObject<{
259
+ name: z.ZodString;
260
+ value: z.ZodString;
261
+ }, z.core.$strip>>, z.ZodTransform<{
262
+ [k: string]: string;
263
+ }, {
264
+ name: string;
265
+ value: string;
266
+ }[]>>]>;
267
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
268
+ html: z.ZodOptional<z.ZodNullable<z.ZodString>>;
269
+ }, z.core.$strip>;
270
+ export declare const normalizedReceivedSchema: z.ZodObject<{
271
+ message_id: z.ZodString;
272
+ email_id: z.ZodString;
273
+ from: z.ZodString;
274
+ to: z.ZodString;
275
+ to_addresses: z.ZodArray<z.ZodString>;
276
+ cc: z.ZodArray<z.ZodString>;
277
+ bcc: z.ZodArray<z.ZodString>;
278
+ received_for: z.ZodArray<z.ZodString>;
279
+ subject: z.ZodString;
280
+ body_text: z.ZodString;
281
+ body_html: z.ZodString;
282
+ reply_to: z.ZodString;
283
+ reply_to_addresses: z.ZodArray<z.ZodString>;
284
+ in_reply_to: z.ZodString;
285
+ references: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
286
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
287
+ thread_id: z.ZodString;
288
+ attachments: z.ZodArray<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
289
+ created_at: z.ZodString;
290
+ }, z.core.$strip>;
291
+ export declare const webhookPayloadSchema: z.ZodObject<{
292
+ type: z.ZodEnum<{
293
+ "email.sent": "email.sent";
294
+ "email.delivered": "email.delivered";
295
+ "email.bounced": "email.bounced";
296
+ "email.complained": "email.complained";
297
+ "email.opened": "email.opened";
298
+ "email.clicked": "email.clicked";
299
+ "email.delivery_delayed": "email.delivery_delayed";
300
+ "email.failed": "email.failed";
301
+ }>;
302
+ created_at: z.ZodOptional<z.ZodISODateTime>;
303
+ data: z.ZodObject<{
304
+ email_id: z.ZodString;
305
+ to: z.ZodOptional<z.ZodArray<z.ZodString>>;
306
+ from: z.ZodOptional<z.ZodString>;
307
+ subject: z.ZodOptional<z.ZodString>;
308
+ bounce: z.ZodOptional<z.ZodObject<{
309
+ message: z.ZodOptional<z.ZodString>;
310
+ }, z.core.$strip>>;
311
+ failed: z.ZodOptional<z.ZodObject<{
312
+ reason: z.ZodOptional<z.ZodString>;
313
+ }, z.core.$strip>>;
314
+ }, z.core.$strip>;
315
+ }, z.core.$strip>;
316
+ export type ResendWebhookPayload = z.infer<typeof webhookPayloadSchema>;
317
+ export declare const resendOperationArgsSchema: z.ZodUnion<readonly [z.ZodObject<{
318
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
319
+ cc: z.ZodOptional<z.ZodArray<z.ZodString>>;
320
+ bcc: z.ZodOptional<z.ZodArray<z.ZodString>>;
321
+ from: z.ZodOptional<z.ZodString>;
322
+ replyTo: z.ZodOptional<z.ZodString>;
323
+ subject: z.ZodString;
324
+ html: z.ZodOptional<z.ZodString>;
325
+ text: z.ZodOptional<z.ZodString>;
326
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
327
+ filename: z.ZodString;
328
+ contentType: z.ZodString;
329
+ content: z.ZodString;
330
+ contentId: z.ZodOptional<z.ZodString>;
331
+ disposition: z.ZodDefault<z.ZodEnum<{
332
+ inline: "inline";
333
+ attachment: "attachment";
334
+ }>>;
335
+ }, z.core.$strip>>>;
336
+ inReplyTo: z.ZodOptional<z.ZodString>;
337
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
338
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
339
+ idempotencyKey: z.ZodOptional<z.ZodString>;
340
+ }, z.core.$strip>, z.ZodObject<{
341
+ emailId: z.ZodString;
342
+ attachmentId: z.ZodString;
343
+ }, z.core.$strip>, z.ZodObject<{
344
+ emailId: z.ZodString;
345
+ }, z.core.$strip>, z.ZodObject<{
346
+ messageId: z.ZodOptional<z.ZodString>;
347
+ }, z.core.$strip>]>;
348
+ export type ResendOperationArgs = z.infer<typeof resendOperationArgsSchema>;
349
+ export declare const resendOperationResultSchema: z.ZodUnion<readonly [z.ZodObject<{
350
+ messageId: z.ZodString;
351
+ providerId: z.ZodString;
352
+ durationMs: z.ZodOptional<z.ZodNumber>;
353
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
354
+ }, z.core.$strip>, z.ZodObject<{
355
+ messageId: z.ZodString;
356
+ status: z.ZodEnum<{
357
+ failed: "failed";
358
+ queued: "queued";
359
+ sent: "sent";
360
+ delivered: "delivered";
361
+ bounced: "bounced";
362
+ complained: "complained";
363
+ opened: "opened";
364
+ clicked: "clicked";
365
+ received: "received";
366
+ }>;
367
+ providerId: z.ZodString;
368
+ reason: z.ZodOptional<z.ZodString>;
369
+ timestamp: z.ZodOptional<z.ZodString>;
370
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
371
+ }, z.core.$strip>, z.ZodObject<{
372
+ ok: z.ZodBoolean;
373
+ providerId: z.ZodString;
374
+ from: z.ZodOptional<z.ZodString>;
375
+ error: z.ZodOptional<z.ZodString>;
376
+ }, z.core.$strip>, z.ZodObject<{
377
+ message_id: z.ZodString;
378
+ email_id: z.ZodString;
379
+ from: z.ZodString;
380
+ to: z.ZodString;
381
+ to_addresses: z.ZodArray<z.ZodString>;
382
+ cc: z.ZodArray<z.ZodString>;
383
+ bcc: z.ZodArray<z.ZodString>;
384
+ received_for: z.ZodArray<z.ZodString>;
385
+ subject: z.ZodString;
386
+ body_text: z.ZodString;
387
+ body_html: z.ZodString;
388
+ reply_to: z.ZodString;
389
+ reply_to_addresses: z.ZodArray<z.ZodString>;
390
+ in_reply_to: z.ZodString;
391
+ references: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
392
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
393
+ thread_id: z.ZodString;
394
+ attachments: z.ZodArray<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
395
+ created_at: z.ZodString;
396
+ }, z.core.$strip>, z.ZodObject<{
397
+ content: z.ZodString;
398
+ }, z.core.$strip>]>;
399
+ export type ResendOperationResult = z.infer<typeof resendOperationResultSchema>;
400
+ export declare const resendBodySchema: z.ZodObject<{
401
+ from: z.ZodString;
402
+ to: z.ZodArray<z.ZodString>;
403
+ cc: z.ZodOptional<z.ZodArray<z.ZodString>>;
404
+ bcc: z.ZodOptional<z.ZodArray<z.ZodString>>;
405
+ reply_to: z.ZodOptional<z.ZodString>;
406
+ subject: z.ZodString;
407
+ html: z.ZodOptional<z.ZodString>;
408
+ text: z.ZodOptional<z.ZodString>;
409
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
410
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
411
+ filename: z.ZodString;
412
+ content: z.ZodString;
413
+ content_type: z.ZodString;
414
+ content_id: z.ZodOptional<z.ZodString>;
415
+ }, z.core.$strip>>>;
416
+ tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
417
+ name: z.ZodString;
418
+ value: z.ZodString;
419
+ }, z.core.$strip>>>;
420
+ }, z.core.$strip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rationInvokeInputSchema } from '@vibesdotdev/platform/internal-api/schemas';
3
+ import { emailSendInputSchema, emailSendResultSchema, emailHealthResultSchema, emailStatusResultSchema } from '@vibesdotdev/email/schemas/email-data';
4
+ import { JsonValueSchema } from '@vibesdotdev/kernel/schemas/json';
5
+ export const identityValueSchema = z.string().trim().min(1);
6
+ export const resendInvokeIdentitySchema = z.object({
7
+ userId: identityValueSchema, organizationId: identityValueSchema.optional(),
8
+ jwt: z.string().optional(),
9
+ deploymentAuthority: PlatformInternalIntegrationInvokeInputSchema.shape.deploymentAuthority
10
+ });
11
+ export const resendConnectionIdentitySchema = resendInvokeIdentitySchema.extend({ connectionId: identityValueSchema });
12
+ export const resendHostOptionsSchema = z.object({
13
+ defaultFrom: z.string().trim().min(1).refine(value => /^(?:[^<>]+<)?[^\s<>@]+@[^\s<>@]+>?$/.test(value), 'defaultFrom must be an email address, optionally with a display name')
14
+ }).strict();
15
+ export const RESEND_DEFAULT_BASE_URL = 'https://api.resend.com';
16
+ export const ResendSettingsSchema = z.object({ baseUrl: z.url().default(RESEND_DEFAULT_BASE_URL) });
17
+ export const resendConfigSchema = z.object({ defaultFrom: z.string().optional() });
18
+ export const receivedInputSchema = z.object({ emailId: identityValueSchema });
19
+ export const attachmentInputSchema = receivedInputSchema.extend({ attachmentId: identityValueSchema });
20
+ export const retrievalInputSchema = receivedInputSchema.extend({
21
+ apiKey: identityValueSchema, baseUrl: z.url(), signal: z.instanceof(AbortSignal).optional()
22
+ });
23
+ export const attachmentReceiptSchema = z.object({
24
+ id: identityValueSchema, size: z.number().int().min(0).max(25 * 1024 * 1024),
25
+ download_url: z.url().refine(value => {
26
+ const url = new URL(value);
27
+ return url.protocol === 'https:' && url.hostname === 'inbound-cdn.resend.com' && !url.username && !url.password && !url.port;
28
+ })
29
+ });
30
+ export const attachmentResultSchema = z.object({ content: z.string() });
31
+ export const sendResponseSchema = z.object({ id: identityValueSchema });
32
+ export const vendorTimestampSchema = z.union([
33
+ z.iso.datetime({ offset: true }),
34
+ z.string().regex(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d{1,6})?[+-]\d{2}(?::?\d{2})?$/)
35
+ .transform(value => value.replace(' ', 'T').replace(/([+-]\d{2})$/, '$1:00'))
36
+ .pipe(z.iso.datetime({ offset: true, precision: null }))
37
+ ]).transform(value => new Date(value).toISOString());
38
+ export const statusResponseSchema = sendResponseSchema.extend({
39
+ last_event: z.enum(['created', 'sent', 'delivered', 'bounced', 'complained', 'opened', 'clicked', 'delivery_delayed', 'failed']),
40
+ to: z.array(z.string()).optional(), created_at: vendorTimestampSchema.optional()
41
+ });
42
+ const text = z.string().nullish().transform(value => value ?? '');
43
+ export const addressesSchema = z.union([z.string(), z.array(z.string())]).nullish()
44
+ .transform(value => (Array.isArray(value) ? value : [value ?? '']).map(entry => entry.trim()).filter(Boolean));
45
+ export const headersSchema = z.union([z.record(z.string(), z.string()), z.array(z.object({ name: z.string(), value: z.string() })).transform(headers => Object.fromEntries(headers.map(header => [header.name, header.value])))])
46
+ .nullish().transform(value => value ?? {});
47
+ export const receivedPayloadSchema = z.object({
48
+ id: text, email_id: text, message_id: text, messageId: text,
49
+ from: text, to: addressesSchema, cc: addressesSchema, bcc: addressesSchema, received_for: addressesSchema,
50
+ subject: text, text, html: text, body_text: text, body_html: text,
51
+ reply_to: addressesSchema, in_reply_to: text,
52
+ references: z.union([z.string(), z.array(z.string())]).nullish().transform(value => value ?? ''),
53
+ headers: headersSchema, thread_id: text, threadId: text,
54
+ attachments: z.array(JsonValueSchema).nullish().transform(value => value ?? []), created_at: text,
55
+ reason: text, bounce: z.object({ message: z.string().optional() }).optional()
56
+ });
57
+ export const receivedWebhookSchema = z.object({
58
+ type: z.literal('email.received'), created_at: z.iso.datetime().optional(),
59
+ data: receivedPayloadSchema.extend({
60
+ email_id: identityValueSchema, from: identityValueSchema,
61
+ to: z.array(identityValueSchema).min(1)
62
+ })
63
+ });
64
+ export const receivedEnvelopeSchema = z.object({ data: receivedPayloadSchema, created_at: text });
65
+ export const receivedResourceSchema = receivedPayloadSchema.extend({
66
+ id: identityValueSchema, headers: z.union([
67
+ z.record(z.string(), z.string()),
68
+ z.array(z.object({ name: z.string(), value: z.string() })).transform(headers => Object.fromEntries(headers.map(header => [header.name, header.value])))
69
+ ]),
70
+ text: z.string().nullable().optional(), html: z.string().nullable().optional()
71
+ }).refine(value => value.text !== undefined || value.html !== undefined, 'missing full content')
72
+ .refine(value => Boolean(value.message_id.trim() || Object.entries(value.headers).find(([key]) => key.toLowerCase() === 'message-id')?.[1]?.trim()), 'missing message identity');
73
+ export const normalizedReceivedSchema = z.object({
74
+ message_id: z.string(), email_id: z.string(), from: z.string(), to: z.string(), to_addresses: z.array(z.string()),
75
+ cc: z.array(z.string()), bcc: z.array(z.string()), received_for: z.array(z.string()), subject: z.string(),
76
+ body_text: z.string(), body_html: z.string(), reply_to: z.string(), reply_to_addresses: z.array(z.string()),
77
+ in_reply_to: z.string(), references: z.union([z.string(), z.array(z.string())]), headers: z.record(z.string(), z.string()),
78
+ thread_id: z.string(), attachments: z.array(JsonValueSchema), created_at: z.string()
79
+ });
80
+ export const webhookPayloadSchema = z.object({
81
+ type: z.enum(['email.sent', 'email.delivered', 'email.bounced', 'email.complained', 'email.opened', 'email.clicked', 'email.delivery_delayed', 'email.failed']),
82
+ created_at: z.iso.datetime().optional(),
83
+ data: z.object({
84
+ email_id: identityValueSchema, to: z.array(z.string()).optional(), from: z.string().optional(), subject: z.string().optional(),
85
+ bounce: z.object({ message: z.string().optional() }).optional(), failed: z.object({ reason: z.string().optional() }).optional()
86
+ })
87
+ });
88
+ export const resendOperationArgsSchema = z.union([emailSendInputSchema, attachmentInputSchema, receivedInputSchema, z.object({ messageId: z.string().optional() })]);
89
+ export const resendOperationResultSchema = z.union([emailSendResultSchema, emailStatusResultSchema, emailHealthResultSchema, normalizedReceivedSchema, attachmentResultSchema]);
90
+ export const resendBodySchema = z.object({
91
+ from: z.string(), to: z.array(z.string()), cc: z.array(z.string()).optional(), bcc: z.array(z.string()).optional(),
92
+ reply_to: z.string().optional(), subject: z.string(), html: z.string().optional(), text: z.string().optional(),
93
+ headers: z.record(z.string(), z.string()).optional(),
94
+ attachments: z.array(z.object({ filename: z.string(), content: z.string(), content_type: z.string(), content_id: z.string().optional() })).optional(),
95
+ tags: z.array(z.object({ name: z.string(), value: z.string() })).optional()
96
+ });
97
+ //# sourceMappingURL=resend.js.map