@cofondateurauchomage/libs 1.1.39 → 1.1.41
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/build/api.validate.js +10 -5
- package/build/db.model.d.ts +5 -3
- package/build/regex.d.ts +5 -0
- package/build/regex.js +6 -0
- package/package.json +1 -1
package/build/api.validate.js
CHANGED
|
@@ -9,11 +9,12 @@ const validate_1 = require("./validate");
|
|
|
9
9
|
const business = (0, validate_1.isString)().setMin(10).setMax(300);
|
|
10
10
|
const city = (0, validate_1.isMatchRegex)(regex_1.RGX.Name.regex);
|
|
11
11
|
const description = (0, validate_1.isString)().setMin(10).setMax(500);
|
|
12
|
-
const email = (0, validate_1.
|
|
12
|
+
const email = (0, validate_1.isString)();
|
|
13
13
|
const firstName = (0, validate_1.isMatchRegex)(regex_1.RGX.Name.regex);
|
|
14
14
|
const invest = (0, validate_1.isNumber)().setMin(0).setMax(1000000).isOptional();
|
|
15
15
|
const lastName = (0, validate_1.isMatchRegex)(regex_1.RGX.Name.regex);
|
|
16
16
|
const linkedin = (0, validate_1.isMatchRegex)(regex_1.RGX.Linkedin.regex);
|
|
17
|
+
const website = (0, validate_1.isMatchRegex)(regex_1.RGX.Website.regex).isOptional();
|
|
17
18
|
const motivations = (0, validate_1.isString)().setMin(10).setMax(500);
|
|
18
19
|
const name = (0, validate_1.isString)().setMin(2).setMax(50);
|
|
19
20
|
const partner = (0, validate_1.isString)().setMin(10).setMax(300);
|
|
@@ -40,10 +41,11 @@ const validatorsForAllRoutes = {
|
|
|
40
41
|
email,
|
|
41
42
|
emailProspect: email,
|
|
42
43
|
tel,
|
|
44
|
+
linkedin,
|
|
45
|
+
website,
|
|
43
46
|
name,
|
|
44
47
|
lastName,
|
|
45
48
|
firstName,
|
|
46
|
-
linkedin,
|
|
47
49
|
skills,
|
|
48
50
|
zipCode,
|
|
49
51
|
city,
|
|
@@ -61,8 +63,9 @@ const validatorsForAllRoutes = {
|
|
|
61
63
|
deleteProject: {},
|
|
62
64
|
updateProject: {
|
|
63
65
|
tel,
|
|
64
|
-
name,
|
|
65
66
|
linkedin,
|
|
67
|
+
website,
|
|
68
|
+
name,
|
|
66
69
|
skills,
|
|
67
70
|
zipCode,
|
|
68
71
|
city,
|
|
@@ -80,13 +83,14 @@ const validatorsForAllRoutes = {
|
|
|
80
83
|
email,
|
|
81
84
|
emailProspect: email,
|
|
82
85
|
tel,
|
|
86
|
+
linkedin,
|
|
87
|
+
website,
|
|
83
88
|
lastName,
|
|
84
89
|
firstName,
|
|
85
|
-
linkedin,
|
|
86
90
|
business,
|
|
87
91
|
city,
|
|
88
92
|
invest,
|
|
89
|
-
joblessDate: (0, validate_1.isMatchRegex)(regex_1.RGX.Date.regex),
|
|
93
|
+
joblessDate: (0, validate_1.isMatchRegex)(regex_1.RGX.Date.regex).isOptional(),
|
|
90
94
|
motivations,
|
|
91
95
|
partner,
|
|
92
96
|
skills,
|
|
@@ -99,6 +103,7 @@ const validatorsForAllRoutes = {
|
|
|
99
103
|
updateUser: {
|
|
100
104
|
tel,
|
|
101
105
|
linkedin,
|
|
106
|
+
website,
|
|
102
107
|
business,
|
|
103
108
|
city,
|
|
104
109
|
invest,
|
package/build/db.model.d.ts
CHANGED
|
@@ -10,10 +10,11 @@ export declare enum Collections {
|
|
|
10
10
|
export type TSkill = "Business" | "Design" | "Marketing" | "Produit" | "Tech";
|
|
11
11
|
export type TPlan = "free" | "pro" | "premium";
|
|
12
12
|
export interface IClicks {
|
|
13
|
-
card: number;
|
|
14
|
-
email: number;
|
|
15
13
|
linkedin: number;
|
|
14
|
+
email: number;
|
|
15
|
+
card: number;
|
|
16
16
|
share: number;
|
|
17
|
+
website: number;
|
|
17
18
|
}
|
|
18
19
|
export interface IUser {
|
|
19
20
|
id: string;
|
|
@@ -23,7 +24,7 @@ export interface IUser {
|
|
|
23
24
|
zipCode: number;
|
|
24
25
|
city: string;
|
|
25
26
|
invest?: number;
|
|
26
|
-
joblessDate
|
|
27
|
+
joblessDate?: string;
|
|
27
28
|
motivations: string;
|
|
28
29
|
partner: string;
|
|
29
30
|
business: string;
|
|
@@ -65,6 +66,7 @@ export interface IContact {
|
|
|
65
66
|
email: string;
|
|
66
67
|
linkedin?: string;
|
|
67
68
|
tel?: string;
|
|
69
|
+
website?: string;
|
|
68
70
|
}
|
|
69
71
|
export interface INewsletter {
|
|
70
72
|
match?: boolean;
|
package/build/regex.d.ts
CHANGED
package/build/regex.js
CHANGED
|
@@ -7,6 +7,7 @@ const regex = {
|
|
|
7
7
|
linkedin: /^(http(s)?:\/\/)?([\w]+\.)?linkedin\.com\/(pub|in|profile)\/.+$/,
|
|
8
8
|
name: /^[A-Za-zÜ-ü\s\-]{1,50}$/,
|
|
9
9
|
tel: /^([+][1-9]{2,3}[ .\-]?)?[0-9]{1,3}([ .\-]?[0-9]{2,3}){3,6}$/,
|
|
10
|
+
website: /^https:\/\/([\w]+\.)?[\w-]+\.\w+(:\d+)?(\/.*)?$/,
|
|
10
11
|
};
|
|
11
12
|
const pattern = (regex) => String(regex).replace("/^", "").replace("$/", "");
|
|
12
13
|
exports.RGX = {
|
|
@@ -31,4 +32,9 @@ exports.RGX = {
|
|
|
31
32
|
pattern: pattern(regex.tel),
|
|
32
33
|
message: `Veuillez entrer un numéro de téléphone valide.`,
|
|
33
34
|
},
|
|
35
|
+
Website: {
|
|
36
|
+
regex: regex.website,
|
|
37
|
+
pattern: pattern(regex.website),
|
|
38
|
+
message: `Le lien doit être un URL HTTPS valide. (ex: https://www.monsite.com)`,
|
|
39
|
+
},
|
|
34
40
|
};
|