All files / constants index.ts

100% Statements 13/13
100% Branches 8/8
100% Functions 0/0
100% Lines 13/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77    8x                 8x 8x   8x 8x 8x 8x 8x       8x                               8x                               8x                                       8x 8x  
import { Role } from "@app/types/role";
 
export const testEnv = {
  NODEMAILER_SERVICE: "valid-service-name",
  NODEMAILER_USER: "testuser",
  NODEMAILER_PASS: "testpass",
  NODEMAILER_FROM: "testuser@email.com",
  NODEMAILER_HOST: "valid-host",
  NODEMAILER_PORT: "999",
} as Record<string, string>;
 
export const DEFAULT_ERROR_MESSAGE = "Something went wrong!";
export const DEFAULT_MONGOOSE_ERROR_MESSAGE = DEFAULT_ERROR_MESSAGE;
 
export const PORT = process.env.PORT || 3001;
export const HOST = process.env.BACKEND_HOST || "http://localhost";
export const BASE_URL = `${HOST}:${PORT}/`;
export const NODE_ENV = process.env.NODE_ENV || "local";
export const FRONTEND_HOST =
  process.env.FRONTEND_HOST || "http://localhost:3000";
 
/** this api urls can be access without need of user email verified */
export const ALLOWED_PATHS_WITHOUT_MAIL_VERIFIED = [
  {
    path: "/user/resendEmailVerification/",
    method: ["POST"],
  },
  {
    path: "/auth/getAccessToken",
    method: ["POST"],
  },
  {
    path: "/user/me/",
    method: ["GET"],
  },
];
 
/** this api urls can be access without need of user logged in */
export const ALLOWED_PATHS_WITHOUT_USER_LOGGED_IN = [
  {
    path: "/organizations/invitations/accept",
    method: ["GET"],
  },
  {
    path: "/auth/getAccessToken",
    method: ["POST"],
  },
  {
    path: "/status",
    method: ["GET"],
  },
];
 
/** when server start, default roles will be loaded automatically in Database */
export const DEFAULT_ROLES = [
  {
    name: "Owner",
    slug: "owner",
    /** only one user at a time can be owner of an organization */
    description: "This user is owner of the organization",
    isDefaultRole: true,
  },
  {
    name: "Member",
    slug: "member",
    description: "This user is member of the organization",
    isDefaultRole: true,
  },
] as Omit<Role, "_id">[];
 
/**
 * Some error messages
 */
 
export const INVALID_TOKEN_MSG = "Invalid token";
export const EMAIL_NOT_VERIFIED_MSG = "Email not verified";