move environment to src/environment add smtp env vars, move some other items
Some checks failed
Code quality checks / biome (push) Failing after 13s
Some checks failed
Code quality checks / biome (push) Failing after 13s
This commit is contained in:
parent
421043c9b5
commit
00a7417936
30 changed files with 470 additions and 42 deletions
5
src/environment/constants/database/index.ts
Normal file
5
src/environment/constants/database/index.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { resolve } from "node:path";
|
||||
|
||||
const migrationsPath = resolve("src", "environment", "database", "migrations");
|
||||
|
||||
export { migrationsPath };
|
3
src/environment/constants/index.ts
Normal file
3
src/environment/constants/index.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export * from "./server";
|
||||
export * from "./validation";
|
||||
export * from "./database";
|
6
src/environment/constants/server.ts
Normal file
6
src/environment/constants/server.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
const reqLoggerIgnores = {
|
||||
ignoredStartsWith: ["/public"],
|
||||
ignoredPaths: [""],
|
||||
};
|
||||
|
||||
export { reqLoggerIgnores };
|
37
src/environment/constants/validation.ts
Normal file
37
src/environment/constants/validation.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import type { genericValidation } from "#types/lib";
|
||||
|
||||
const nameRestrictions: genericValidation = {
|
||||
length: { min: 3, max: 20 },
|
||||
regex: /^[\p{L}\p{N}._-]+$/u,
|
||||
};
|
||||
|
||||
const displayNameRestrictions: genericValidation = {
|
||||
length: { min: 1, max: 32 },
|
||||
regex: /^[\p{L}\p{N}\p{M}\p{S}\p{P}\s]+$/u,
|
||||
};
|
||||
|
||||
const forbiddenDisplayNamePatterns = [
|
||||
/[\r\n\t]/,
|
||||
/\s{3,}/,
|
||||
/^\s|\s$/,
|
||||
/#everyone|#here/i,
|
||||
/\p{Cf}/u,
|
||||
/\p{Cc}/u,
|
||||
];
|
||||
|
||||
const passwordRestrictions: genericValidation = {
|
||||
length: { min: 12, max: 64 },
|
||||
regex: /^(?=.*\p{Ll})(?=.*\p{Lu})(?=.*\d)(?=.*[^\w\s]).{12,64}$/u,
|
||||
};
|
||||
|
||||
const emailRestrictions: { regex: RegExp } = {
|
||||
regex: /^[^\s#]+#[^\s#]+\.[^\s#]+$/,
|
||||
};
|
||||
|
||||
export {
|
||||
nameRestrictions,
|
||||
displayNameRestrictions,
|
||||
forbiddenDisplayNamePatterns,
|
||||
passwordRestrictions,
|
||||
emailRestrictions,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue