@cofondateurauchomage/libs 1.1.35 → 1.1.37
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.d.ts +7 -2
- package/build/api.validate.js +6 -1
- package/build/db.model.d.ts +5 -1
- package/build/db.model.js +1 -0
- package/package.json +1 -1
package/build/api.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { IContact, INewsletter, IProject, IUser, TPlan } from "./db.model";
|
|
2
|
-
export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "activeProject" | "createUser" | "updateUser" | "deleteUser" | "activeUser" | "addStripeId" | "updatePlan" | "addStatsAssociation" | "updateNewsletter";
|
|
1
|
+
import { IContact, INewsletter, IProject, IProspect, IUser, TPlan } from "./db.model";
|
|
2
|
+
export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "activeProject" | "createUser" | "updateUser" | "deleteUser" | "activeUser" | "addStripeId" | "updatePlan" | "addStatsAssociation" | "updateNewsletter" | "createProspect";
|
|
3
3
|
export type RouteNames = "checkout_session" | "delete_customer" | "portal_session" | "webhook";
|
|
4
4
|
export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
|
|
5
5
|
createProject: Omit<IProject, "id" | "plan" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & IContact & {
|
|
6
6
|
newsletterMatch?: boolean;
|
|
7
7
|
newsletterMarketing?: boolean;
|
|
8
|
+
} & {
|
|
9
|
+
emailProspect: string;
|
|
8
10
|
};
|
|
9
11
|
deleteProject: {};
|
|
10
12
|
updateProject: Pick<IProject, "city" | "description" | "invest" | "name" | "partner" | "skills" | "zipCode" | "status" | "status_detail" | "logo"> & Omit<IContact, "email">;
|
|
@@ -14,6 +16,8 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
|
|
|
14
16
|
createUser: Omit<IUser, "id" | "plan" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & IContact & {
|
|
15
17
|
newsletterMatch?: boolean;
|
|
16
18
|
newsletterMarketing?: boolean;
|
|
19
|
+
} & {
|
|
20
|
+
emailProspect: string;
|
|
17
21
|
};
|
|
18
22
|
deleteUser: {};
|
|
19
23
|
updateUser: Pick<IUser, "business" | "city" | "invest" | "motivations" | "partner" | "skills" | "zipCode" | "photo"> & Omit<IContact, "email">;
|
|
@@ -32,6 +36,7 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
|
|
|
32
36
|
};
|
|
33
37
|
addStatsAssociation: {};
|
|
34
38
|
updateNewsletter: INewsletter;
|
|
39
|
+
createProspect: IProspect;
|
|
35
40
|
checkout_session: {
|
|
36
41
|
stripeId?: string;
|
|
37
42
|
email: string;
|
package/build/api.validate.js
CHANGED
|
@@ -32,7 +32,7 @@ const photo = (0, validate_1.isString)().isOptional();
|
|
|
32
32
|
const logo = (0, validate_1.isString)().isOptional();
|
|
33
33
|
const plan = (0, validate_1.isMatchEnum)(["free", "pro", "premium"]);
|
|
34
34
|
const apiSecretKey = (0, validate_1.isString)();
|
|
35
|
-
const tel = (0, validate_1.isMatchRegex)(regex_1.RGX.Tel.regex)
|
|
35
|
+
const tel = (0, validate_1.isMatchRegex)(regex_1.RGX.Tel.regex);
|
|
36
36
|
const validatorsForAllRoutes = {
|
|
37
37
|
///////////////////
|
|
38
38
|
// Cloud functions
|
|
@@ -56,6 +56,7 @@ const validatorsForAllRoutes = {
|
|
|
56
56
|
newsletterMarketing,
|
|
57
57
|
logo,
|
|
58
58
|
tel,
|
|
59
|
+
emailProspect: email,
|
|
59
60
|
},
|
|
60
61
|
deleteProject: {},
|
|
61
62
|
updateProject: {
|
|
@@ -92,6 +93,7 @@ const validatorsForAllRoutes = {
|
|
|
92
93
|
newsletterMarketing,
|
|
93
94
|
photo,
|
|
94
95
|
tel,
|
|
96
|
+
emailProspect: email,
|
|
95
97
|
},
|
|
96
98
|
deleteUser: {},
|
|
97
99
|
updateUser: {
|
|
@@ -124,6 +126,9 @@ const validatorsForAllRoutes = {
|
|
|
124
126
|
match: (0, validate_1.isBoolean)().isOptional(),
|
|
125
127
|
marketing: (0, validate_1.isBoolean)().isOptional(),
|
|
126
128
|
},
|
|
129
|
+
createProspect: {
|
|
130
|
+
email,
|
|
131
|
+
},
|
|
127
132
|
//////////
|
|
128
133
|
// Routes
|
|
129
134
|
checkout_session: {
|
package/build/db.model.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export declare enum Collections {
|
|
|
4
4
|
contacts = "contacts",
|
|
5
5
|
newsletters = "newsletters",
|
|
6
6
|
stats = "stats",
|
|
7
|
-
notifications = "notifications"
|
|
7
|
+
notifications = "notifications",
|
|
8
|
+
prospects = "prospects"
|
|
8
9
|
}
|
|
9
10
|
export type TSkill = "Business" | "Design" | "Marketing" | "Produit" | "Tech";
|
|
10
11
|
export type TPlan = "free" | "pro" | "premium";
|
|
@@ -80,3 +81,6 @@ export interface INotification {
|
|
|
80
81
|
body?: string;
|
|
81
82
|
link?: string;
|
|
82
83
|
}
|
|
84
|
+
export interface IProspect {
|
|
85
|
+
email: string;
|
|
86
|
+
}
|
package/build/db.model.js
CHANGED