@cofondateurauchomage/libs 1.1.28 → 1.1.31
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 -7
- package/build/api.validate.js +4 -5
- package/build/db.model.d.ts +4 -0
- package/package.json +1 -1
package/build/api.d.ts
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { IContact, INewsletter, IProject, IUser } from "./db.model";
|
|
2
|
-
export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "
|
|
2
|
+
export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "activeProject" | "createUser" | "updateUser" | "deleteUser" | "activeUser" | "addStripeId" | "addStatsAssociation" | "updateNewsletter";
|
|
3
3
|
export type RouteNames = "checkout_session" | "delete_customer" | "portal_session" | "webhook";
|
|
4
4
|
export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
|
|
5
|
-
createProject: Omit<IProject, "id" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & IContact & {
|
|
5
|
+
createProject: Omit<IProject, "id" | "plan" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & IContact & {
|
|
6
6
|
newsletterMatch?: boolean;
|
|
7
7
|
newsletterMarketing?: boolean;
|
|
8
8
|
};
|
|
9
9
|
deleteProject: {};
|
|
10
10
|
updateProject: Pick<IProject, "city" | "description" | "invest" | "name" | "partner" | "skills" | "zipCode" | "status" | "status_detail" | "logo"> & Omit<IContact, "email">;
|
|
11
|
-
addStripeIdToProject: {
|
|
12
|
-
email: string;
|
|
13
|
-
stripeId: string;
|
|
14
|
-
};
|
|
15
11
|
activeProject: {
|
|
16
12
|
stripeId: string;
|
|
17
13
|
active: boolean;
|
|
18
14
|
};
|
|
19
|
-
createUser: Omit<IUser, "id" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes"> & IContact & {
|
|
15
|
+
createUser: Omit<IUser, "id" | "plan" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & IContact & {
|
|
20
16
|
newsletterMatch?: boolean;
|
|
21
17
|
newsletterMarketing?: boolean;
|
|
22
18
|
};
|
|
@@ -25,6 +21,10 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
|
|
|
25
21
|
activeUser: {
|
|
26
22
|
active: boolean;
|
|
27
23
|
};
|
|
24
|
+
addStripeId: {
|
|
25
|
+
email: string;
|
|
26
|
+
stripeId: string;
|
|
27
|
+
};
|
|
28
28
|
addStatsAssociation: {};
|
|
29
29
|
updateNewsletter: INewsletter;
|
|
30
30
|
checkout_session: {
|
package/build/api.validate.js
CHANGED
|
@@ -6,7 +6,6 @@ const regex_1 = require("./regex");
|
|
|
6
6
|
const validate_1 = require("./validate");
|
|
7
7
|
//////////////
|
|
8
8
|
// Validators
|
|
9
|
-
const id = (0, validate_1.isString)();
|
|
10
9
|
const business = (0, validate_1.isString)().setMin(10).setMax(300);
|
|
11
10
|
const city = (0, validate_1.isMatchRegex)(regex_1.RGX.Name.regex);
|
|
12
11
|
const description = (0, validate_1.isString)().setMin(10).setMax(500);
|
|
@@ -68,10 +67,6 @@ const validatorsForAllRoutes = {
|
|
|
68
67
|
partner,
|
|
69
68
|
logo,
|
|
70
69
|
},
|
|
71
|
-
addStripeIdToProject: {
|
|
72
|
-
email,
|
|
73
|
-
stripeId,
|
|
74
|
-
},
|
|
75
70
|
activeProject: {
|
|
76
71
|
active: (0, validate_1.isBoolean)(),
|
|
77
72
|
stripeId,
|
|
@@ -108,6 +103,10 @@ const validatorsForAllRoutes = {
|
|
|
108
103
|
activeUser: {
|
|
109
104
|
active: (0, validate_1.isBoolean)(),
|
|
110
105
|
},
|
|
106
|
+
addStripeId: {
|
|
107
|
+
email,
|
|
108
|
+
stripeId,
|
|
109
|
+
},
|
|
111
110
|
addStatsAssociation: {},
|
|
112
111
|
updateNewsletter: {
|
|
113
112
|
match: (0, validate_1.isBoolean)().isOptional(),
|
package/build/db.model.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare enum Collections {
|
|
|
7
7
|
notifications = "notifications"
|
|
8
8
|
}
|
|
9
9
|
export type TSkill = "Business" | "Design" | "Marketing" | "Produit" | "Tech";
|
|
10
|
+
export type TPlan = "free" | "pro" | "premium";
|
|
10
11
|
export interface IClicks {
|
|
11
12
|
card: number;
|
|
12
13
|
email: number;
|
|
@@ -26,11 +27,13 @@ export interface IUser {
|
|
|
26
27
|
partner: string;
|
|
27
28
|
business: string;
|
|
28
29
|
photo?: string;
|
|
30
|
+
plan: TPlan;
|
|
29
31
|
active: boolean;
|
|
30
32
|
clicks: IClicks;
|
|
31
33
|
creationDate: number;
|
|
32
34
|
lastConnection: number;
|
|
33
35
|
likes: string[];
|
|
36
|
+
stripeId?: string;
|
|
34
37
|
}
|
|
35
38
|
export interface IProject {
|
|
36
39
|
id: string;
|
|
@@ -46,6 +49,7 @@ export interface IProject {
|
|
|
46
49
|
description: string;
|
|
47
50
|
partner: string;
|
|
48
51
|
logo?: string;
|
|
52
|
+
plan: TPlan;
|
|
49
53
|
active: boolean;
|
|
50
54
|
clicks: IClicks;
|
|
51
55
|
creationDate: number;
|