| 1 | import * as AWS from "alchemy/AWS"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Layer from "effect/Layer"; |
| 4 | import { JobNotificationsSNS } from "./JobNotifications.ts"; |
| 5 | import { JobRpcHttpEffect } from "./JobRpcApi.ts"; |
| 6 | import { JobStorageDynamoDB } from "./JobStorage.ts"; |
| 7 | |
| 8 | export default class JobFunction extends AWS.Lambda.Function<JobFunction>()( |
| 9 | "JobFunction", |
| 10 | { |
| 11 | main: import.meta.url, |
| 12 | functionUrl: true, |
| 13 | }, |
| 14 | JobRpcHttpEffect.pipe( |
| 15 | Effect.map((fetch) => ({ fetch })), |
| 16 | Effect.provide(Layer.mergeAll(JobStorageDynamoDB, JobNotificationsSNS)), |
| 17 | ), |
| 18 | ) {} |