diff --git a/frontend/src/shared b/frontend/src/shared new file mode 120000 index 0000000..f7647bb --- /dev/null +++ b/frontend/src/shared @@ -0,0 +1 @@ +../../server/shared \ No newline at end of file diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index e38bc4f..7c8c93e 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -1,4 +1,4 @@ -export * from "./shared"; +export * from "../shared/types"; export enum ButtonSize { SMALL = "small", diff --git a/frontend/src/types/shared.ts b/frontend/src/types/shared.ts deleted file mode 120000 index eecbe49..0000000 --- a/frontend/src/types/shared.ts +++ /dev/null @@ -1 +0,0 @@ -../../../server/types/shared.ts \ No newline at end of file diff --git a/server/resources/mailResource.ts b/server/resources/mailResource.ts index 240ce16..8c48ce7 100644 --- a/server/resources/mailResource.ts +++ b/server/resources/mailResource.ts @@ -1,4 +1,4 @@ -import CONSTRAINTS from "../validation/constraints"; +import CONSTRAINTS from "../shared/validation/constraints"; import ErrorTypes from "../utils/errorTypes"; import * as MailService from "../services/mailService"; import * as Resources from "../utils/resources"; diff --git a/server/resources/monitoringResource.ts b/server/resources/monitoringResource.ts index 1a78bb3..38f7573 100644 --- a/server/resources/monitoringResource.ts +++ b/server/resources/monitoringResource.ts @@ -1,4 +1,4 @@ -import CONSTRAINTS from "../validation/constraints"; +import CONSTRAINTS from "../shared/validation/constraints"; import ErrorTypes from "../utils/errorTypes"; import * as MonitoringService from "../services/monitoringService"; import * as Resources from "../utils/resources"; diff --git a/server/resources/nodeResource.ts b/server/resources/nodeResource.ts index 7b0cee6..69de0b1 100644 --- a/server/resources/nodeResource.ts +++ b/server/resources/nodeResource.ts @@ -1,4 +1,4 @@ -import Constraints from "../validation/constraints"; +import Constraints from "../shared/validation/constraints"; import ErrorTypes from "../utils/errorTypes"; import * as MonitoringService from "../services/monitoringService"; import * as NodeService from "../services/nodeService"; diff --git a/server/resources/taskResource.ts b/server/resources/taskResource.ts index 8f2e939..e983f38 100644 --- a/server/resources/taskResource.ts +++ b/server/resources/taskResource.ts @@ -1,4 +1,4 @@ -import CONSTRAINTS from "../validation/constraints"; +import CONSTRAINTS from "../shared/validation/constraints"; import ErrorTypes from "../utils/errorTypes"; import * as Resources from "../utils/resources"; import {handleJSONWithData, RequestData} from "../utils/resources"; diff --git a/server/services/monitoringService.ts b/server/services/monitoringService.ts index 11c9231..1c00f04 100644 --- a/server/services/monitoringService.ts +++ b/server/services/monitoringService.ts @@ -13,7 +13,7 @@ import * as Resources from "../utils/resources"; import {RestParams} from "../utils/resources"; import {normalizeMac, parseInteger} from "../utils/strings"; import {monitoringDisableUrl} from "../utils/urlBuilder"; -import CONSTRAINTS from "../validation/constraints"; +import CONSTRAINTS from "../shared/validation/constraints"; import {forConstraint} from "../validation/validator"; import { Domain, diff --git a/server/types/shared.ts b/server/shared/types/index.ts similarity index 100% rename from server/types/shared.ts rename to server/shared/types/index.ts diff --git a/server/validation/constraints.ts b/server/shared/validation/constraints.ts similarity index 100% rename from server/validation/constraints.ts rename to server/shared/validation/constraints.ts diff --git a/server/types/config.ts b/server/types/config.ts index 7710b39..98e0b61 100644 --- a/server/types/config.ts +++ b/server/types/config.ts @@ -1,5 +1,5 @@ import {ArrayField, Field, RawJsonField} from "sparkson" -import {ClientConfig, DurationMilliseconds, isString, toIsNewtype, Url} from "./shared"; +import {ClientConfig, DurationMilliseconds, isString, toIsNewtype, Url} from "../shared/types"; export type Username = string & { readonly __tag: unique symbol }; export const isUsername = toIsNewtype(isString, "" as Username); diff --git a/server/types/index.ts b/server/types/index.ts index 5324418..f0d76c3 100644 --- a/server/types/index.ts +++ b/server/types/index.ts @@ -15,12 +15,12 @@ import { StoredNode, toIsEnum, toIsNewtype, -} from "./shared"; +} from "../shared/types"; export * from "./config"; export * from "./database"; export * from "./logger"; -export * from "./shared"; +export * from "../shared/types"; export type NodeStateData = { site?: Site, diff --git a/server/utils/resources.ts b/server/utils/resources.ts index 5f1116b..fe8b85d 100644 --- a/server/utils/resources.ts +++ b/server/utils/resources.ts @@ -1,6 +1,6 @@ import _ from "lodash"; -import CONSTRAINTS from "../validation/constraints"; +import CONSTRAINTS from "../shared/validation/constraints"; import ErrorTypes from "../utils/errorTypes"; import Logger from "../logger"; import {Constraints, forConstraints, isConstraints} from "../validation/validator";