@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 49 lines 1.52 KB
Raw
1 import type * as qbusiness from "@distilled.cloud/aws/qbusiness";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Index } from "./SearchIndex.ts";
5
6 /**
7 * `CheckDocumentAccess` request with `applicationId` + `indexId` injected from the bound index.
8 */
9 export interface CheckDocumentAccessRequest extends Omit<
10 qbusiness.CheckDocumentAccessRequest,
11 "applicationId" | "indexId"
12 > {}
13
14 /**
15 * Runtime binding for the `CheckDocumentAccess` operation (IAM action
16 * `qbusiness:CheckDocumentAccess`), scoped to one {@link Index}.
17 *
18 * Checks whether a specific user can access a document, returning
19 * the user's groups/aliases and the document's ACL evaluation.
20 * Provide the implementation with
21 * `Effect.provide(AWS.QBusiness.CheckDocumentAccessHttp)`.
22 *
23 * ### Document Ingestion
24 * **Example:** Check a User's Document Access
25 * ```typescript
26 * const checkAccess = yield* AWS.QBusiness.CheckDocumentAccess(index);
27 *
28 * const { hasAccess } = yield* checkAccess({
29 * userId: "user@example.com",
30 * documentId: "welcome",
31 * });
32 * ```
33 *
34 * @binding
35 */
36 export interface CheckDocumentAccess extends Binding.Service<
37 CheckDocumentAccess,
38 "AWS.QBusiness.CheckDocumentAccess",
39 (
40 index: Index,
41 ) => Effect.Effect<
42 (
43 request: CheckDocumentAccessRequest,
44 ) => Effect.Effect<qbusiness.CheckDocumentAccessResponse, qbusiness.CheckDocumentAccessError>
45 >
46 > {}
47 export const CheckDocumentAccess = Binding.Service<CheckDocumentAccess>(
48 "AWS.QBusiness.CheckDocumentAccess",
49 );