2024-06-14 11:09:53 +00:00
|
|
|
import Protocol from "Common/Types/API/Protocol";
|
|
|
|
import URL from "Common/Types/API/URL";
|
2024-04-25 11:27:36 +00:00
|
|
|
|
|
|
|
type GetEnvFunction = (key: string) => string;
|
|
|
|
|
|
|
|
export const env: GetEnvFunction = (key: string): string => {
|
2024-06-14 11:09:53 +00:00
|
|
|
return (process.env[key] as string) || "";
|
2024-04-25 11:27:36 +00:00
|
|
|
};
|
|
|
|
|
2024-06-14 11:09:53 +00:00
|
|
|
export const HOST: string = env("HOST") || "localhost";
|
2024-04-25 11:27:36 +00:00
|
|
|
|
|
|
|
export const HTTP_PROTOCOL: Protocol =
|
2024-06-14 11:09:53 +00:00
|
|
|
env("HTTP_PROTOCOL") === "https" ? Protocol.HTTPS : Protocol.HTTP;
|
2024-04-25 11:27:36 +00:00
|
|
|
|
2024-04-25 11:45:08 +00:00
|
|
|
export const BASE_URL: URL = URL.fromString(`${HTTP_PROTOCOL}${HOST}`);
|
2024-04-25 20:53:51 +00:00
|
|
|
|
2024-04-25 21:03:12 +00:00
|
|
|
export const IS_USER_REGISTERED: boolean =
|
2024-06-14 11:09:53 +00:00
|
|
|
env("E2E_TEST_IS_USER_REGISTERED") === "true";
|
2024-04-25 21:03:12 +00:00
|
|
|
export const REGISTERED_USER_EMAIL: string =
|
2024-06-14 11:09:53 +00:00
|
|
|
env("E2E_TEST_REGISTERED_USER_EMAIL") || "";
|
2024-04-25 21:03:12 +00:00
|
|
|
export const REGISTERED_USER_PASSWORD: string =
|
2024-06-14 11:09:53 +00:00
|
|
|
env("E2E_TEST_REGISTERED_USER_PASSWORD") || "";
|
2024-04-26 17:46:10 +00:00
|
|
|
|
2024-06-14 11:09:53 +00:00
|
|
|
export const IS_BILLING_ENABLED: boolean = env("BILLING_ENABLED") === "true";
|
2024-04-26 20:15:01 +00:00
|
|
|
|
2024-06-14 11:09:53 +00:00
|
|
|
export const STATUS_PAGE_URL: URL | null = env("E2E_TEST_STATUS_PAGE_URL")
|
|
|
|
? URL.fromString(env("E2E_TEST_STATUS_PAGE_URL"))
|
|
|
|
: null;
|