| 1 | import type * as qapps from "@distilled.cloud/aws/qapps"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { QApp } from "./QApp.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Request for {@link ExportQAppSessionData} — `instanceId` is injected from the bound Q App. |
| 8 | */ |
| 9 | export interface ExportQAppSessionDataRequest extends Omit< |
| 10 | qapps.ExportQAppSessionDataInput, |
| 11 | "instanceId" | "appId" |
| 12 | > {} |
| 13 | |
| 14 | /** |
| 15 | * Runtime binding for `qapps:ExportQAppSessionData`. |
| 16 | * |
| 17 | * Exports a shared Q App session's collected data as a downloadable CSV file link. Provide the implementation with |
| 18 | * `Effect.provide(AWS.QApps.ExportQAppSessionDataHttp)`. |
| 19 | * ### Sessions |
| 20 | * **Example:** Export Session Data |
| 21 | * ```typescript |
| 22 | * // init — bind the operation to the Q App |
| 23 | * const exportQAppSessionData = yield* AWS.QApps.ExportQAppSessionData(app); |
| 24 | * |
| 25 | * // runtime |
| 26 | * const exported = yield* exportQAppSessionData({ sessionId }); |
| 27 | * console.log(exported.csvFileLink); |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface ExportQAppSessionData extends Binding.Service< |
| 33 | ExportQAppSessionData, |
| 34 | "AWS.QApps.ExportQAppSessionData", |
| 35 | ( |
| 36 | app: QApp, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request: ExportQAppSessionDataRequest, |
| 40 | ) => Effect.Effect< |
| 41 | qapps.ExportQAppSessionDataOutput, |
| 42 | qapps.ExportQAppSessionDataError |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | |
| 47 | export const ExportQAppSessionData = Binding.Service<ExportQAppSessionData>( |
| 48 | "AWS.QApps.ExportQAppSessionData", |
| 49 | ); |