| 1 | import * as Alchemy from "alchemy"; |
| 2 | import * as GCP from "alchemy/GCP"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import Drain from "./src/Drain.ts"; |
| 5 | import Ingest from "./src/Ingest.ts"; |
| 6 | import { EventsTable, Inbox } from "./src/resources.ts"; |
| 7 | |
| 8 | export default Alchemy.Stack( |
| 9 | "GcpEventPipelineExample", |
| 10 | { providers: GCP.providers(), state: Alchemy.localState() }, |
| 11 | Effect.gen(function* () { |
| 12 | const inbox = yield* Inbox; |
| 13 | const table = yield* EventsTable; |
| 14 | const ingest = yield* Ingest; |
| 15 | const drain = yield* Drain; |
| 16 | |
| 17 | return { |
| 18 | url: ingest.uri, |
| 19 | jobName: drain.name, |
| 20 | subscriptionId: inbox.subscriptionId, |
| 21 | tableId: table.tableId, |
| 22 | }; |
| 23 | }), |
| 24 | ); |