@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 47 lines 1.69 KB
Raw
1 import type * as xray from "@distilled.cloud/aws/xray";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 export interface StartTraceRetrievalRequest extends xray.StartTraceRetrievalRequest {}
6
7 /**
8 * Initiate a Transaction Search trace retrieval for the given trace IDs
9 * and time range, returning a `RetrievalToken` for `ListRetrievedTraces`
10 * and `GetRetrievedTracesGraph`.
11 *
12 * Bind the operation in the function's init phase to get a runtime callable;
13 * provide the implementation with `Effect.provide(XRay.StartTraceRetrievalHttp)`.
14 * The action is account-scoped: X-Ray does not support resource-level
15 * permissions for `xray:StartTraceRetrieval`, so the binding grants it on `*`.
16 * ### Transaction Search
17 * **Example:** Start retrieving traces from Transaction Search
18 * ```typescript
19 * import * as XRay from "@alchemy.run/aws/XRay";
20 *
21 * // init — grants xray:StartTraceRetrieval
22 * const startTraceRetrieval = yield* XRay.StartTraceRetrieval();
23 *
24 * // runtime
25 * const now = yield* Effect.sync(() => Date.now());
26 * const retrieval = yield* startTraceRetrieval({
27 * TraceIds: ["1-63a2090f-3f4da4bcd9b1a3e07531423b"],
28 * StartTime: new Date(now - 60 * 60 * 1000),
29 * EndTime: new Date(now),
30 * });
31 * const token = retrieval.RetrievalToken;
32 * ```
33 *
34 * @binding
35 */
36 export interface StartTraceRetrieval extends Binding.Service<
37 StartTraceRetrieval,
38 "AWS.XRay.StartTraceRetrieval",
39 () => Effect.Effect<
40 (
41 request: StartTraceRetrievalRequest,
42 ) => Effect.Effect<xray.StartTraceRetrievalResult, xray.StartTraceRetrievalError>
43 >
44 > {}
45 export const StartTraceRetrieval = Binding.Service<StartTraceRetrieval>(
46 "AWS.XRay.StartTraceRetrieval",
47 );