@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, 06:00 UTC

main
ts 48 lines 1.6 KB
Raw
1 import type * as sitewise from "@distilled.cloud/aws/iotsitewise";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * Request for {@link ExecuteQuery}.
7 */
8 export interface ExecuteQueryRequest extends sitewise.ExecuteQueryRequest {}
9
10 /**
11 * Runtime binding for `iotsitewise:ExecuteQuery` — run a SiteWise SQL
12 * query across all asset models, assets, measurements, metrics, and
13 * transforms in the account from a deployed Lambda or Task.
14 *
15 * The query surface is account-wide, so the binding grants the action on
16 * `Resource: ["*"]` and takes no bound resource.
17 *
18 * ### Querying Asset Data with SQL
19 * Provide the `ExecuteQueryHttp` implementation layer on the Function
20 * effect, bind in the init phase (no resource argument), then call the
21 * returned client at runtime.
22 *
23 * **Example:** Find an Asset by Name
24 * ```typescript
25 * // init — account-level binding takes no resource
26 * const executeQuery = yield* AWS.IoTSiteWise.ExecuteQuery();
27 *
28 * // runtime
29 * const { rows } = yield* executeQuery({
30 * queryStatement:
31 * "SELECT asset_id, asset_name FROM asset WHERE asset_name = 'Pump1'",
32 * });
33 * // on the Function effect:
34 * // .pipe(Effect.provide(AWS.IoTSiteWise.ExecuteQueryHttp))
35 * ```
36 *
37 * @binding
38 */
39 export interface ExecuteQuery extends Binding.Service<
40 ExecuteQuery,
41 "AWS.IoTSiteWise.ExecuteQuery",
42 () => Effect.Effect<
43 (
44 request: ExecuteQueryRequest,
45 ) => Effect.Effect<sitewise.ExecuteQueryResponse, sitewise.ExecuteQueryError>
46 >
47 > {}
48 export const ExecuteQuery = Binding.Service<ExecuteQuery>("AWS.IoTSiteWise.ExecuteQuery");