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, 04:45 UTC
| 1 | import * as amp from "@distilled.cloud/aws/amp"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Layer from "effect/Layer"; |
| 4 | import * as AWSBindings from "../AWSBindings.ts"; |
| 5 | import { GetDefaultScraperConfiguration } from "./GetDefaultScraperConfiguration.ts"; |
| 6 | import { decodeDefinition } from "./internal.ts"; |
| 7 | |
| 8 | export const GetDefaultScraperConfigurationHttp = Layer.effect( |
| 9 | GetDefaultScraperConfiguration, |
| 10 | Effect.gen(function* () { |
| 11 | const bind = yield* AWSBindings.Bind; |
| 12 | const getDefaultScraperConfiguration = yield* AWSBindings.withCredentials( |
| 13 | amp.getDefaultScraperConfiguration, |
| 14 | ); |
| 15 | |
| 16 | return Effect.fn(function* () { |
| 17 | if (!globalThis.__ALCHEMY_RUNTIME__) { |
| 18 | yield* bind`AWS.AMP.GetDefaultScraperConfiguration()`({ |
| 19 | policyStatements: [ |
| 20 | { |
| 21 | Effect: "Allow", |
| 22 | Action: ["aps:GetDefaultScraperConfiguration"], |
| 23 | Resource: ["*"], |
| 24 | }, |
| 25 | ], |
| 26 | }); |
| 27 | } |
| 28 | return Effect.fn("AWS.AMP.GetDefaultScraperConfiguration")(function* () { |
| 29 | const response = yield* getDefaultScraperConfiguration({}); |
| 30 | return yield* decodeDefinition(response.configuration); |
| 31 | }); |
| 32 | }); |
| 33 | }), |
| 34 | ); |