@cofondateurauchomage/libs 1.0.41 → 1.0.42
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/api.d.ts +24 -0
- package/lib/api.js +2 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/lib/utils/regex.d.ts +0 -28
- package/lib/utils/regex.js +0 -31
package/lib/api.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IProject, IUser } from "./db.model";
|
|
2
|
+
export type CloudFunctionNames = "createProjectCall" | "setProjectCall" | "deleteProjectCall" | "setStripeIdProjectCall" | "setActiveProjectCall" | "createUserCall" | "setUserCall" | "deleteUserCall";
|
|
3
|
+
export type RouteNames = "checkout_session" | "delete_customer" | "portal_session" | "webhook";
|
|
4
|
+
export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
|
|
5
|
+
createProjectCall: Omit<IProject, "active" | "clicks" | "creationDate" | "likes" | "stripeId">;
|
|
6
|
+
setProjectCall: Pick<IProject, "city" | "description" | "invest" | "linkedin" | "partner" | "skills" | "tel" | "zipCode">;
|
|
7
|
+
deleteProjectCall: {};
|
|
8
|
+
setStripeIdProjectCall: Pick<IProject, "email" | "stripeId">;
|
|
9
|
+
setActiveProjectCall: Pick<IProject, "stripeId" | "active">;
|
|
10
|
+
createUserCall: Omit<IUser, "clicks" | "creationDate" | "likes">;
|
|
11
|
+
setUserCall: Pick<IUser, "business" | "city" | "invest" | "linkedin" | "motivations" | "partner" | "skills" | "tel" | "zipCode">;
|
|
12
|
+
deleteUserCall: {};
|
|
13
|
+
checkout_session: {
|
|
14
|
+
stripeId?: string;
|
|
15
|
+
email: string;
|
|
16
|
+
};
|
|
17
|
+
delete_customer: {
|
|
18
|
+
stripeId: string;
|
|
19
|
+
};
|
|
20
|
+
portal_session: {
|
|
21
|
+
stripeId: string;
|
|
22
|
+
};
|
|
23
|
+
webhook: {};
|
|
24
|
+
}[O];
|
package/lib/api.js
ADDED
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./api
|
|
17
|
+
__exportStar(require("./api"), exports);
|
|
18
18
|
__exportStar(require("./const"), exports);
|
|
19
19
|
__exportStar(require("./db.model"), exports);
|
|
20
20
|
__exportStar(require("./regex"), exports);
|
package/package.json
CHANGED
package/lib/utils/regex.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare const RGX: {
|
|
2
|
-
Email: {
|
|
3
|
-
regex: RegExp;
|
|
4
|
-
};
|
|
5
|
-
Name: {
|
|
6
|
-
regex: RegExp;
|
|
7
|
-
pattern: string;
|
|
8
|
-
message: string;
|
|
9
|
-
};
|
|
10
|
-
Date: {
|
|
11
|
-
regex: RegExp;
|
|
12
|
-
};
|
|
13
|
-
Tel: {
|
|
14
|
-
regex: RegExp;
|
|
15
|
-
pattern: string;
|
|
16
|
-
message: string;
|
|
17
|
-
};
|
|
18
|
-
Linkedin: {
|
|
19
|
-
regex: RegExp;
|
|
20
|
-
pattern: string;
|
|
21
|
-
message: string;
|
|
22
|
-
};
|
|
23
|
-
Pwd: {
|
|
24
|
-
regex: RegExp;
|
|
25
|
-
pattern: string;
|
|
26
|
-
message: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
package/lib/utils/regex.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RGX = void 0;
|
|
4
|
-
exports.RGX = {
|
|
5
|
-
Email: {
|
|
6
|
-
regex: /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,
|
|
7
|
-
},
|
|
8
|
-
Name: {
|
|
9
|
-
regex: /^[A-Za-zÀ-ÖØ-öø-ÿ]{1,24}([ -]{1}[A-Za-zÀ-ÖØ-öø-ÿ]{1,24}){0,8} ?$/,
|
|
10
|
-
pattern: "[A-Za-zÀ-ÖØ-öø-ÿ]{1,24}([ -]{1}[A-Za-zÀ-ÖØ-öø-ÿ]{1,24}){0,8} ?",
|
|
11
|
-
message: "Accepte les noms composés (espace ou -) et les accents. Les caractères spéciaux ne sont pas autorisés.",
|
|
12
|
-
},
|
|
13
|
-
Date: {
|
|
14
|
-
regex: /^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$/,
|
|
15
|
-
},
|
|
16
|
-
Tel: {
|
|
17
|
-
regex: /^([+]{1}[1-9]{2,3}[ .-]?)?[0-9]{1,3}([ .-]?[0-9]{2,3}){3,6}$/,
|
|
18
|
-
pattern: "([+]{1}[1-9]{2,3}[ .-]?)?[0-9]{1,3}([ .-]?[0-9]{2,3}){3,6}",
|
|
19
|
-
message: "Veuillez entrer un numéro de téléphone valide.",
|
|
20
|
-
},
|
|
21
|
-
Linkedin: {
|
|
22
|
-
regex: /^(http(s)?:\/\/)?([\w]+\.)?linkedin\.com\/(pub|in|profile)\/.+$/,
|
|
23
|
-
pattern: `(http(s)?:\/\/)?([\w]+\.)?linkedin\.com\/(pub|in|profile)\/.+`,
|
|
24
|
-
message: `Le lien doit être un URL LinkedIn valide. (ex: https://www.linkedin.com/in/valentin-lemaire/)`,
|
|
25
|
-
},
|
|
26
|
-
Pwd: {
|
|
27
|
-
regex: /^(?=.*[0-9])(?=.*[A-z])([^\s]){8,24}$/,
|
|
28
|
-
pattern: `(?=.*[0-9])(?=.*[A-z])([^\\s]){8,24}`,
|
|
29
|
-
message: "Votre mot de passe doit contenir entre 8 et 24 caractères dont 1 chiffre et 1 lettre.",
|
|
30
|
-
},
|
|
31
|
-
};
|