| 1 | import * as firestore from "@distilled.cloud/gcp/firestore_v1"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeDocumentHttpBinding } from "./DocumentHttp.ts"; |
| 4 | import { GetDocument } from "./GetDocument.ts"; |
| 5 | |
| 6 | /** |
| 7 | * HTTP implementation of {@link GetDocument}. |
| 8 | * |
| 9 | * @layer |
| 10 | * @provides GCP.Firestore.GetDocument |
| 11 | */ |
| 12 | export const GetDocumentHttp = Layer.effect( |
| 13 | GetDocument, |
| 14 | makeDocumentHttpBinding({ |
| 15 | tag: "GCP.Firestore.GetDocument", |
| 16 | iam: { role: "roles/datastore.viewer", scopeByCondition: true }, |
| 17 | operation: firestore.getProjectsDatabasesDocuments, |
| 18 | }), |
| 19 | ); |