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
| 1 | import type * as grafana from "@distilled.cloud/aws/grafana"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { Workspace } from "./Workspace.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `ListWorkspaceServiceAccountTokens` operation |
| 8 | * (IAM action `grafana:ListWorkspaceServiceAccountTokens`), scoped to one |
| 9 | * {@link Workspace}. |
| 10 | * |
| 11 | * Lists the API tokens of a Grafana service account (metadata only — the |
| 12 | * secret key is only returned at mint time). Provide the implementation with |
| 13 | * `Effect.provide(AWS.Grafana.ListWorkspaceServiceAccountTokensHttp)`. |
| 14 | * ### Managing Service Accounts |
| 15 | * **Example:** Find Expired Tokens to Revoke |
| 16 | * ```typescript |
| 17 | * const listTokens = |
| 18 | * yield* Grafana.ListWorkspaceServiceAccountTokens(workspace); |
| 19 | * |
| 20 | * const { serviceAccountTokens } = yield* listTokens({ |
| 21 | * serviceAccountId: account.id, |
| 22 | * }); |
| 23 | * const expired = serviceAccountTokens.filter( |
| 24 | * (token) => token.expiresAt.getTime() < Date.now(), |
| 25 | * ); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface ListWorkspaceServiceAccountTokens extends Binding.Service< |
| 31 | ListWorkspaceServiceAccountTokens, |
| 32 | "AWS.Grafana.ListWorkspaceServiceAccountTokens", |
| 33 | ( |
| 34 | workspace: Workspace, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request: Omit<grafana.ListWorkspaceServiceAccountTokensRequest, "workspaceId">, |
| 38 | ) => Effect.Effect< |
| 39 | grafana.ListWorkspaceServiceAccountTokensResponse, |
| 40 | grafana.ListWorkspaceServiceAccountTokensError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const ListWorkspaceServiceAccountTokens = Binding.Service<ListWorkspaceServiceAccountTokens>( |
| 45 | "AWS.Grafana.ListWorkspaceServiceAccountTokens", |
| 46 | ); |