import * as Context from "effect/Context"; import * as Layer from "effect/Layer"; import * as Redacted from "effect/Redacted"; import * as Schema from "effect/Schema"; export const ApnsEnvironment = Schema.Literals(["sandbox", "production"]); export type ApnsEnvironment = typeof ApnsEnvironment.Type; export interface ApnsCredentials { readonly teamId: string; readonly keyId: string; readonly privateKey: Redacted.Redacted; readonly bundleId: string; readonly environment: ApnsEnvironment; } export class RelayConfiguration extends Context.Service< RelayConfiguration, { readonly relayIssuer: string; readonly apns: ApnsCredentials | null; readonly fcmServiceAccount?: Redacted.Redacted; readonly clerkSecretKey: Redacted.Redacted; readonly clerkPublishableKey: string; readonly clerkJwtAudience: string; readonly apnsDeliveryJobSigningSecret: Redacted.Redacted; readonly cloudMintPrivateKey: Redacted.Redacted; readonly cloudMintPublicKey: string; readonly managedEndpointBaseDomain: string | undefined; readonly managedEndpointNamespace: string | undefined; } >()("t3code-relay/Config/RelayConfiguration") {} export const make = (configuration: RelayConfiguration["Service"]) => RelayConfiguration.of(configuration); export const layer = (configuration: RelayConfiguration["Service"]) => Layer.succeed(RelayConfiguration, make(configuration));