| 1 | import * as ivsrealtime from "@distilled.cloud/aws/ivs-realtime"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { toWireMinutes } from "../../Util/Duration.ts"; |
| 4 | import { makeIvsRealtimeStageHttpBinding } from "./BindingHttp.ts"; |
| 5 | import { |
| 6 | CreateParticipantToken, |
| 7 | type CreateParticipantTokenRequest, |
| 8 | } from "./CreateParticipantToken.ts"; |
| 9 | |
| 10 | export const CreateParticipantTokenHttp = Layer.effect( |
| 11 | CreateParticipantToken, |
| 12 | makeIvsRealtimeStageHttpBinding({ |
| 13 | tag: "AWS.IVSRealtime.CreateParticipantToken", |
| 14 | operation: ivsrealtime.createParticipantToken, |
| 15 | actions: ["ivs:CreateParticipantToken"], |
| 16 | prepare: ({ duration, ...request }: CreateParticipantTokenRequest) => ({ |
| 17 | ...request, |
| 18 | duration: toWireMinutes(duration), |
| 19 | }), |
| 20 | }), |
| 21 | ); |