1import * as AWS from "alchemy/AWS";
2import * as Effect from "effect/Effect";
3import * as Layer from "effect/Layer";
4import { JobNotificationsSNS } from "./JobNotifications.ts";
5import { JobRpcHttpEffect } from "./JobRpcApi.ts";
6import { JobStorageDynamoDB } from "./JobStorage.ts";
7
8export 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) {}