| 1 | import type * as qbusiness from "@distilled.cloud/aws/qbusiness"; |
| 2 | import type * as Duration from "effect/Duration"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import * as Binding from "../../Binding.ts"; |
| 5 | import type { WebExperience } from "./WebExperience.ts"; |
| 6 | |
| 7 | /** |
| 8 | * `CreateAnonymousWebExperienceUrl` request with `applicationId` + |
| 9 | * `webExperienceId` injected from the bound web experience. |
| 10 | */ |
| 11 | export interface CreateAnonymousWebExperienceUrlRequest { |
| 12 | /** |
| 13 | * How long the session opened from the returned URL lasts (wire: |
| 14 | * `sessionDurationInMinutes`, 15-60 minutes). |
| 15 | * @default 15 minutes |
| 16 | */ |
| 17 | sessionDuration?: Duration.Input; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Runtime binding for the `CreateAnonymousWebExperienceUrl` operation (IAM action |
| 22 | * `qbusiness:CreateAnonymousWebExperienceUrl`), scoped to one {@link WebExperience}. |
| 23 | * |
| 24 | * Mints a short-lived URL that opens the web experience without |
| 25 | * authentication (applications created with the `ANONYMOUS` |
| 26 | * identity type). |
| 27 | * Provide the implementation with |
| 28 | * `Effect.provide(AWS.QBusiness.CreateAnonymousWebExperienceUrlHttp)`. |
| 29 | * |
| 30 | * ### Anonymous Access |
| 31 | * **Example:** Mint an Anonymous Chat URL |
| 32 | * ```typescript |
| 33 | * const createUrl = |
| 34 | * yield* AWS.QBusiness.CreateAnonymousWebExperienceUrl(web); |
| 35 | * |
| 36 | * const { anonymousUrl } = yield* createUrl({ |
| 37 | * sessionDuration: "30 minutes", |
| 38 | * }); |
| 39 | * ``` |
| 40 | * |
| 41 | * @binding |
| 42 | */ |
| 43 | export interface CreateAnonymousWebExperienceUrl extends Binding.Service< |
| 44 | CreateAnonymousWebExperienceUrl, |
| 45 | "AWS.QBusiness.CreateAnonymousWebExperienceUrl", |
| 46 | ( |
| 47 | webExperience: WebExperience, |
| 48 | ) => Effect.Effect< |
| 49 | ( |
| 50 | request?: CreateAnonymousWebExperienceUrlRequest, |
| 51 | ) => Effect.Effect< |
| 52 | qbusiness.CreateAnonymousWebExperienceUrlResponse, |
| 53 | qbusiness.CreateAnonymousWebExperienceUrlError |
| 54 | > |
| 55 | > |
| 56 | > {} |
| 57 | export const CreateAnonymousWebExperienceUrl = |
| 58 | Binding.Service<CreateAnonymousWebExperienceUrl>( |
| 59 | "AWS.QBusiness.CreateAnonymousWebExperienceUrl", |
| 60 | ); |