From 4dbef3fcd7a14437d55c555cf10d50de8e50d7d1 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Fri, 9 Dec 2022 11:57:12 +0900 Subject: feat: Move everything out of $lib --- code/app/src/lib/configuration.ts | 60 --------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 code/app/src/lib/configuration.ts (limited to 'code/app/src/lib/configuration.ts') diff --git a/code/app/src/lib/configuration.ts b/code/app/src/lib/configuration.ts deleted file mode 100644 index 8debef6..0000000 --- a/code/app/src/lib/configuration.ts +++ /dev/null @@ -1,60 +0,0 @@ -export const BASE_DOMAIN = "dev.greatoffice.life"; -export const DEV_BASE_DOMAIN = "http://localhost"; -export const API_ADDRESS = "https://api." + BASE_DOMAIN; -export const DEV_API_ADDRESS = "http://localhost:5000"; -export const SECONDS_BETWEEN_SESSION_CHECK = 600; - -export function api_base(path: string = "", useDefaultVersion = false): string { - return (is_development() ? DEV_API_ADDRESS : API_ADDRESS) + (path !== "" ? "/" + path : ""); -} - -export function is_development(): boolean { - return import.meta.env.DEV; -} - -export function is_testing(): boolean { - return import.meta.env.VITE_TESTING; -} - -export function is_debug(): boolean { - return localStorage.getItem(StorageKeys.debug) !== "true"; -} - -export const CookieNames = { - theme: "go_theme", - locale: "go_locale", - session: "go_session" -}; - -export function get_test_context(): TestContext { - return { - user: { - username: import.meta.env.VITE_TEST_USERNAME, - password: import.meta.env.VITE_TEST_PASSWORD - } - } -} - -export interface TestContext { - user: { - username: string, - password: string - } -} - -export const QueryKeys = { - labels: "labels", - categories: "categories", - entries: "entries", -}; - -export const StorageKeys = { - session: "sessionData", - theme: "theme", - debug: "debug", - categories: "categories", - labels: "labels", - entries: "entries", - stopwatch: "stopwatchState", - logLevel: "logLevel" -}; \ No newline at end of file -- cgit v1.3