| 1 | import * as Alchemy from "alchemy"; |
| 2 | import * as Cloudflare from "alchemy/Cloudflare"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | |
| 5 | import Api from "./src/Api.ts"; |
| 6 | import { Destination, INBOX } from "./src/Email.ts"; |
| 7 | |
| 8 | export default Alchemy.Stack( |
| 9 | "CloudflareEmailExample", |
| 10 | { |
| 11 | providers: Cloudflare.providers(), |
| 12 | state: Cloudflare.state(), |
| 13 | }, |
| 14 | Effect.gen(function* () { |
| 15 | const destination = yield* Destination; |
| 16 | const api = yield* Api; |
| 17 | |
| 18 | return { |
| 19 | url: api.url.as<string>(), |
| 20 | destinationEmail: destination.email, |
| 21 | destinationVerified: destination.verified, |
| 22 | inbox: INBOX, |
| 23 | }; |
| 24 | }), |
| 25 | ); |