| 1 | import * as Alchemy from "alchemy"; |
| 2 | import * as GCP from "alchemy/GCP"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import Api from "./src/Api.ts"; |
| 5 | import Indexer from "./src/Indexer.ts"; |
| 6 | import { Files, Uploads } from "./src/resources.ts"; |
| 7 | |
| 8 | export default Alchemy.Stack( |
| 9 | "GcpStorageUploadsExample", |
| 10 | { providers: GCP.providers(), state: Alchemy.localState() }, |
| 11 | Effect.gen(function* () { |
| 12 | const bucket = yield* Uploads; |
| 13 | const database = yield* Files; |
| 14 | const api = yield* Api; |
| 15 | const indexer = yield* Indexer; |
| 16 | |
| 17 | return { |
| 18 | url: api.uri, |
| 19 | indexerUrl: indexer.uri, |
| 20 | location: api.location, |
| 21 | bucketName: bucket.bucketName, |
| 22 | databaseName: database.name, |
| 23 | }; |
| 24 | }), |
| 25 | ); |