The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as ivschat from "@distilled.cloud/aws/ivschat"; |
| 2 | import { toWireMinutes } from "alchemy/Util/Duration"; |
| 3 | import * as Layer from "effect/Layer"; |
| 4 | import { makeIvsChatRoomHttpBinding } from "./BindingHttp.ts"; |
| 5 | import { CreateChatToken, type CreateChatTokenRequest } from "./CreateChatToken.ts"; |
| 6 | |
| 7 | export const CreateChatTokenHttp = Layer.effect( |
| 8 | CreateChatToken, |
| 9 | makeIvsChatRoomHttpBinding({ |
| 10 | tag: "AWS.IVSChat.CreateChatToken", |
| 11 | operation: ivschat.createChatToken, |
| 12 | actions: ["ivschat:CreateChatToken"], |
| 13 | prepare: ({ sessionDuration, ...request }: CreateChatTokenRequest) => ({ |
| 14 | ...request, |
| 15 | sessionDurationInMinutes: toWireMinutes(sessionDuration), |
| 16 | }), |
| 17 | }), |
| 18 | ); |