import basicCharsRegexp from "../common/basicCharsRegexp" ; import { AppNameNotValidError } from "../common/errors" ; import { IConfiguration } from "./Configuration" ; export interface IApp { id : string ; name : string ; defaultConfiguration : IConfiguration ; createdAt : Date ; updatedAt : Date ; } export function isAppNameValid ( name ) { return basicCharsRegexp . test ( name ) ; } export function validateAppName ( name ) { if ( ! isAppNameValid ( name ) ) { throw new AppNameNotValidError ( name ) ; } }