| 1 | import * as Lambda from "@/AWS/Lambda"; |
| 2 | import * as Duration from "effect/Duration"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import * as HttpServerResponse from "effect/http/HttpServerResponse"; |
| 5 | |
| 6 | const main = import.meta.url; |
| 7 | |
| 8 | /** |
| 9 | * Minimal Lambda used as the Object Lambda transform target. The Object |
| 10 | * Lambda Access Point lifecycle only stores/validates the function ARN, so |
| 11 | * the handler body is irrelevant for the lifecycle tests. |
| 12 | */ |
| 13 | export class ObjectTransformFunction extends Lambda.Function<Lambda.Function>()( |
| 14 | "ObjectTransformFunction", |
| 15 | ) {} |
| 16 | |
| 17 | export const ObjectTransformFunctionLive = ObjectTransformFunction.make( |
| 18 | { |
| 19 | main, |
| 20 | timeout: Duration.seconds(30), |
| 21 | }, |
| 22 | Effect.gen(function* () { |
| 23 | return { |
| 24 | fetch: Effect.gen(function* () { |
| 25 | return HttpServerResponse.text("ok"); |
| 26 | }).pipe(Effect.orDie), |
| 27 | }; |
| 28 | }), |
| 29 | ); |
| 30 | |
| 31 | export default ObjectTransformFunctionLive; |