| 1 | import * as lexr from "@distilled.cloud/aws/lex-runtime-v2"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeLexAliasHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { RecognizeText, type RecognizeTextRequest } from "./RecognizeText.ts"; |
| 5 | |
| 6 | /** |
| 7 | * HTTP implementation of {@link RecognizeText} — calls the |
| 8 | * `lex-runtime-v2` `RecognizeText` operation with the Lambda role's |
| 9 | * credentials and grants the host `lex:RecognizeText` on the alias. |
| 10 | */ |
| 11 | export const RecognizeTextHttp = Layer.effect( |
| 12 | RecognizeText, |
| 13 | makeLexAliasHttpBinding< |
| 14 | RecognizeTextRequest, |
| 15 | lexr.RecognizeTextResponse, |
| 16 | lexr.RecognizeTextError |
| 17 | >({ |
| 18 | capability: "RecognizeText", |
| 19 | iamActions: ["lex:RecognizeText"], |
| 20 | operation: lexr.recognizeText, |
| 21 | }), |
| 22 | ); |