@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 74 lines 2.55 KB
Raw
1 import type * as quicksight from "@distilled.cloud/aws/quicksight";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Dashboard } from "./Dashboard.ts";
5
6 /**
7 * Request for {@link GenerateEmbedUrlForAnonymousUser}. `AwsAccountId` is
8 * injected from the bound dashboard's ARN; `Namespace`,
9 * `AuthorizedResourceArns`, and `ExperienceConfiguration` default to the
10 * `default` namespace and the bound dashboard when omitted.
11 */
12 export interface GenerateEmbedUrlForAnonymousUserRequest extends Omit<
13 quicksight.GenerateEmbedUrlForAnonymousUserRequest,
14 "AwsAccountId" | "Namespace" | "AuthorizedResourceArns" | "ExperienceConfiguration"
15 > {
16 /**
17 * The QuickSight namespace the anonymous session belongs to.
18 * @default "default"
19 */
20 Namespace?: string;
21
22 /**
23 * The ARNs the anonymous session is authorized to access.
24 * @default the bound dashboard's ARN
25 */
26 AuthorizedResourceArns?: string[];
27
28 /**
29 * The Quick Sight experience to embed.
30 * @default the bound dashboard
31 */
32 ExperienceConfiguration?: quicksight.AnonymousUserEmbeddingExperienceConfiguration;
33 }
34
35 /**
36 * Runtime binding for `quicksight:GenerateEmbedUrlForAnonymousUser`.
37 *
38 * Generates a single-use embed URL for an anonymous (unregistered) visitor,
39 * defaulting the authorized resources and embedded experience to the bound
40 * {@link Dashboard}. Requires a QuickSight account with session-capacity
41 * pricing. Provide the implementation with
42 * `Effect.provide(AWS.QuickSight.GenerateEmbedUrlForAnonymousUserHttp)`.
43 * ### Embedding Dashboards
44 * **Example:** Embed The Bound Dashboard Anonymously
45 * ```typescript
46 * // init — bind the operation to the dashboard
47 * const generateEmbedUrl =
48 * yield* AWS.QuickSight.GenerateEmbedUrlForAnonymousUser(dashboard);
49 *
50 * // runtime — namespace, authorized ARNs, and experience default to the dashboard
51 * const { EmbedUrl } = yield* generateEmbedUrl({
52 * SessionLifetimeInMinutes: 60,
53 * });
54 * ```
55 *
56 * @binding
57 */
58 export interface GenerateEmbedUrlForAnonymousUser extends Binding.Service<
59 GenerateEmbedUrlForAnonymousUser,
60 "AWS.QuickSight.GenerateEmbedUrlForAnonymousUser",
61 (
62 dashboard: Dashboard,
63 ) => Effect.Effect<
64 (
65 request?: GenerateEmbedUrlForAnonymousUserRequest,
66 ) => Effect.Effect<
67 quicksight.GenerateEmbedUrlForAnonymousUserResponse,
68 quicksight.GenerateEmbedUrlForAnonymousUserError
69 >
70 >
71 > {}
72 export const GenerateEmbedUrlForAnonymousUser = Binding.Service<GenerateEmbedUrlForAnonymousUser>(
73 "AWS.QuickSight.GenerateEmbedUrlForAnonymousUser",
74 );