Open History to see the last commit
1import * as Context from "effect/Context";
2import * as Layer from "effect/Layer";
3import * as Redacted from "effect/Redacted";
4import * as Schema from "effect/Schema";
5
6export const ApnsEnvironment = Schema.Literals(["sandbox", "production"]);
7export type ApnsEnvironment = typeof ApnsEnvironment.Type;
8
9export interface ApnsCredentials {
10 readonly teamId: string;
11 readonly keyId: string;
12 readonly privateKey: Redacted.Redacted<string>;
13 readonly bundleId: string;
14 readonly environment: ApnsEnvironment;
15}
16
17export class RelayConfiguration extends Context.Service<
18 RelayConfiguration,
19 {
20 readonly relayIssuer: string;
21 readonly apns: ApnsCredentials;
22 readonly clerkSecretKey: Redacted.Redacted<string>;
23 readonly clerkPublishableKey: string;
24 readonly clerkJwtAudience: string;
25 readonly apnsDeliveryJobSigningSecret: Redacted.Redacted<string>;
26 readonly cloudMintPrivateKey: Redacted.Redacted<string>;
27 readonly cloudMintPublicKey: string;
28 readonly managedEndpointBaseDomain: string | undefined;
29 readonly managedEndpointNamespace: string | undefined;
30 }
31>()("t3code-relay/Config/RelayConfiguration") {}
32
33export const make = (configuration: RelayConfiguration["Service"]) =>
34 RelayConfiguration.of(configuration);
35
36export const layer = (configuration: RelayConfiguration["Service"]) =>
37 Layer.succeed(RelayConfiguration, make(configuration));