@cofondateurauchomage/libs 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/const.d.ts +2 -1
- package/lib/const.js +7 -1
- package/lib/db.model.d.ts +5 -4
- package/lib/utils/checkSkills.d.ts +2 -1
- package/lib/utils/regex.js +9 -9
- package/package.json +7 -3
- package/src/const.ts +0 -9
- package/src/db.model.ts +0 -27
- package/src/index.ts +0 -4
- package/src/utils/checkSkills.ts +0 -15
- package/src/utils/regex.ts +0 -40
- package/tsconfig.json +0 -11
package/lib/const.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { TSkills } from "./db.model";
|
|
2
|
+
export declare const SKILLS: TSkills;
|
package/lib/const.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SKILLS = void 0;
|
|
4
|
-
exports.SKILLS = [
|
|
4
|
+
exports.SKILLS = [
|
|
5
|
+
"Business",
|
|
6
|
+
"Design",
|
|
7
|
+
"Marketing",
|
|
8
|
+
"Produit",
|
|
9
|
+
"Tech",
|
|
10
|
+
];
|
package/lib/db.model.d.ts
CHANGED
|
@@ -6,13 +6,14 @@ export interface IUser {
|
|
|
6
6
|
firstName: string;
|
|
7
7
|
email: string;
|
|
8
8
|
joblessDate: string;
|
|
9
|
-
zipCode
|
|
10
|
-
city
|
|
11
|
-
linkedin
|
|
9
|
+
zipCode?: number;
|
|
10
|
+
city?: string;
|
|
11
|
+
linkedin?: string;
|
|
12
12
|
tel?: string;
|
|
13
|
-
skills:
|
|
13
|
+
skills: TSkills[];
|
|
14
14
|
motivations: string;
|
|
15
15
|
partner: string;
|
|
16
16
|
business: string;
|
|
17
17
|
invest?: number;
|
|
18
18
|
}
|
|
19
|
+
export type TSkills = ("Business" | "Design" | "Marketing" | "Produit" | "Tech")[];
|
package/lib/utils/regex.js
CHANGED
|
@@ -7,21 +7,21 @@ exports.RGX = {
|
|
|
7
7
|
},
|
|
8
8
|
Name: {
|
|
9
9
|
regex: /^[A-Za-zÜ-ü]{1,24}([ -]{1}[A-Za-zÜ-ü]{1,24})?$/,
|
|
10
|
-
pattern:
|
|
11
|
-
message:
|
|
10
|
+
pattern: "[A-Za-zÜ-ü]{1,24}([ -]{1}[A-Za-zÜ-ü]{1,24})?",
|
|
11
|
+
message: "Accepte les noms composés (espace ou -) et les accents. Les caractères spéciaux ne sont pas autorisés.",
|
|
12
12
|
},
|
|
13
13
|
Date: {
|
|
14
14
|
regex: /^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$/,
|
|
15
15
|
},
|
|
16
16
|
City: {
|
|
17
17
|
regex: /^(?=(.*[A-Za-z]){1,45})[A-Za-z]{1,20}([ -]{1}[A-Za-z]{1,24}){0,8}$/,
|
|
18
|
-
pattern:
|
|
19
|
-
message:
|
|
18
|
+
pattern: "(?=(.*[A-Za-z]){1,45})[A-Za-z]{1,20}([ -]{1}[A-Za-z]{1,24}){0,8}",
|
|
19
|
+
message: "Veuillez entrer un nom de ville valide.",
|
|
20
20
|
},
|
|
21
21
|
Tel: {
|
|
22
22
|
regex: /^([+]{1}[1-9]{2,3}[ .-]?)?[0-9]{1,3}([ .-]?[0-9]{2,3}){3,6}$/,
|
|
23
|
-
pattern:
|
|
24
|
-
message:
|
|
23
|
+
pattern: "([+]{1}[1-9]{2,3}[ .-]?)?[0-9]{1,3}([ .-]?[0-9]{2,3}){3,6}",
|
|
24
|
+
message: "Veuillez entrer un numéro de téléphone valide.",
|
|
25
25
|
},
|
|
26
26
|
Linkedin: {
|
|
27
27
|
regex: /^(http(s)?:\/\/)?([\w]+\.)?linkedin\.com\/(pub|in|profile)\/.+$/,
|
|
@@ -31,10 +31,10 @@ exports.RGX = {
|
|
|
31
31
|
Pwd: {
|
|
32
32
|
regex: /^(?=.*[0-9])(?=.*[A-z])([^\s]){8,24}$/,
|
|
33
33
|
pattern: `(?=.*[0-9])(?=.*[A-z])([^\\s]){8,24}`,
|
|
34
|
-
message:
|
|
34
|
+
message: "Votre mot de passe doit contenir entre 8 et 24 caractères dont 1 chiffre et 1 lettre.",
|
|
35
35
|
},
|
|
36
36
|
Text: {
|
|
37
37
|
regex: /^(?=(.*[A-Za-z]){10}).{10,300}$/,
|
|
38
|
-
message:
|
|
39
|
-
}
|
|
38
|
+
message: "Le texte doit contenir au moins 10 lettres et ne pas excéder 300 caractères.",
|
|
39
|
+
},
|
|
40
40
|
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cofondateurauchomage/libs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "tsc"
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"publish": "npm version patch && pnpm build && npm publish"
|
|
8
9
|
},
|
|
9
10
|
"publishConfig": {
|
|
10
11
|
"access": "public"
|
|
@@ -14,5 +15,8 @@
|
|
|
14
15
|
"license": "ISC",
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"typescript": "^4.9.5"
|
|
17
|
-
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"lib"
|
|
21
|
+
]
|
|
18
22
|
}
|
package/src/const.ts
DELETED
package/src/db.model.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export enum Collections {
|
|
2
|
-
users = "users",
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export interface IUser {
|
|
6
|
-
lastName: string;
|
|
7
|
-
firstName: string;
|
|
8
|
-
email: string;
|
|
9
|
-
joblessDate: string;
|
|
10
|
-
zipCode?: number;
|
|
11
|
-
city?: string;
|
|
12
|
-
linkedin?: string;
|
|
13
|
-
tel?: string;
|
|
14
|
-
skills: TSkills[];
|
|
15
|
-
motivations: string;
|
|
16
|
-
partner: string;
|
|
17
|
-
business: string;
|
|
18
|
-
invest?: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export type TSkills = (
|
|
22
|
-
| "Business"
|
|
23
|
-
| "Design"
|
|
24
|
-
| "Marketing"
|
|
25
|
-
| "Produit"
|
|
26
|
-
| "Tech"
|
|
27
|
-
)[];
|
package/src/index.ts
DELETED
package/src/utils/checkSkills.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SKILLS } from "../const";
|
|
2
|
-
import { TSkills } from "../db.model";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Checks if at least one skill is checked
|
|
6
|
-
* @param skills
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export function checkSkills(skills: TSkills) {
|
|
10
|
-
let check = true;
|
|
11
|
-
skills.forEach((skill) => {
|
|
12
|
-
if (!SKILLS.includes(skill)) check = false;
|
|
13
|
-
});
|
|
14
|
-
return check;
|
|
15
|
-
}
|
package/src/utils/regex.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export const RGX = {
|
|
2
|
-
Email: {
|
|
3
|
-
regex: /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,
|
|
4
|
-
},
|
|
5
|
-
Name: {
|
|
6
|
-
regex: /^[A-Za-zÜ-ü]{1,24}([ -]{1}[A-Za-zÜ-ü]{1,24})?$/,
|
|
7
|
-
pattern: "[A-Za-zÜ-ü]{1,24}([ -]{1}[A-Za-zÜ-ü]{1,24})?",
|
|
8
|
-
message:
|
|
9
|
-
"Accepte les noms composés (espace ou -) et les accents. Les caractères spéciaux ne sont pas autorisés.",
|
|
10
|
-
},
|
|
11
|
-
Date: {
|
|
12
|
-
regex: /^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$/,
|
|
13
|
-
},
|
|
14
|
-
City: {
|
|
15
|
-
regex: /^(?=(.*[A-Za-z]){1,45})[A-Za-z]{1,20}([ -]{1}[A-Za-z]{1,24}){0,8}$/,
|
|
16
|
-
pattern: "(?=(.*[A-Za-z]){1,45})[A-Za-z]{1,20}([ -]{1}[A-Za-z]{1,24}){0,8}",
|
|
17
|
-
message: "Veuillez entrer un nom de ville valide.",
|
|
18
|
-
},
|
|
19
|
-
Tel: {
|
|
20
|
-
regex: /^([+]{1}[1-9]{2,3}[ .-]?)?[0-9]{1,3}([ .-]?[0-9]{2,3}){3,6}$/,
|
|
21
|
-
pattern: "([+]{1}[1-9]{2,3}[ .-]?)?[0-9]{1,3}([ .-]?[0-9]{2,3}){3,6}",
|
|
22
|
-
message: "Veuillez entrer un numéro de téléphone valide.",
|
|
23
|
-
},
|
|
24
|
-
Linkedin: {
|
|
25
|
-
regex: /^(http(s)?:\/\/)?([\w]+\.)?linkedin\.com\/(pub|in|profile)\/.+$/,
|
|
26
|
-
pattern: `(http(s)?:\/\/)?([\w]+\.)?linkedin\.com\/(pub|in|profile)\/.+`,
|
|
27
|
-
message: `Le lien doit être un URL LinkedIn valide. (ex: https://www.linkedin.com/in/valentin-lemaire/)`,
|
|
28
|
-
},
|
|
29
|
-
Pwd: {
|
|
30
|
-
regex: /^(?=.*[0-9])(?=.*[A-z])([^\s]){8,24}$/,
|
|
31
|
-
pattern: `(?=.*[0-9])(?=.*[A-z])([^\\s]){8,24}`,
|
|
32
|
-
message:
|
|
33
|
-
"Votre mot de passe doit contenir entre 8 et 24 caractères dont 1 chiffre et 1 lettre.",
|
|
34
|
-
},
|
|
35
|
-
Text: {
|
|
36
|
-
regex: /^(?=(.*[A-Za-z]){10}).{10,300}$/,
|
|
37
|
-
message:
|
|
38
|
-
"Le texte doit contenir au moins 10 lettres et ne pas excéder 300 caractères.",
|
|
39
|
-
},
|
|
40
|
-
};
|