@cofondateurauchomage/libs 1.1.29 → 1.1.32
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 +8 -5
- package/build/api.validate.js +5 -1
- package/build/const.d.ts +2 -1
- package/build/const.js +2 -1
- package/build/db.model.d.ts +3 -0
- package/package.json +1 -1
package/build/api.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { IContact, INewsletter, IProject, IUser } from "./db.model";
|
|
2
|
-
export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "activeProject" | "createUser" | "updateUser" | "deleteUser" | "activeUser" | "addStripeId" | "addStatsAssociation" | "updateNewsletter";
|
|
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";
|
|
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
11
|
activeProject: {
|
|
12
|
-
stripeId: string;
|
|
13
12
|
active: boolean;
|
|
14
13
|
};
|
|
15
|
-
createUser: Omit<IUser, "id" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & IContact & {
|
|
14
|
+
createUser: Omit<IUser, "id" | "plan" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & IContact & {
|
|
16
15
|
newsletterMatch?: boolean;
|
|
17
16
|
newsletterMarketing?: boolean;
|
|
18
17
|
};
|
|
@@ -25,6 +24,10 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
|
|
|
25
24
|
email: string;
|
|
26
25
|
stripeId: string;
|
|
27
26
|
};
|
|
27
|
+
updatePlan: {
|
|
28
|
+
stripeId: string;
|
|
29
|
+
plan: TPlan;
|
|
30
|
+
};
|
|
28
31
|
addStatsAssociation: {};
|
|
29
32
|
updateNewsletter: INewsletter;
|
|
30
33
|
checkout_session: {
|
package/build/api.validate.js
CHANGED
|
@@ -30,6 +30,7 @@ const status = (0, validate_1.isMatchEnum)(const_1.PROJECT_STATUS).isOptional();
|
|
|
30
30
|
const status_detail = (0, validate_1.isString)().setMax(300).isOptional();
|
|
31
31
|
const photo = (0, validate_1.isString)().isOptional();
|
|
32
32
|
const logo = (0, validate_1.isString)().isOptional();
|
|
33
|
+
const plan = (0, validate_1.isMatchEnum)(["free", "pro", "premium"]);
|
|
33
34
|
const validatorsForAllRoutes = {
|
|
34
35
|
///////////////////
|
|
35
36
|
// Cloud functions
|
|
@@ -69,7 +70,6 @@ const validatorsForAllRoutes = {
|
|
|
69
70
|
},
|
|
70
71
|
activeProject: {
|
|
71
72
|
active: (0, validate_1.isBoolean)(),
|
|
72
|
-
stripeId,
|
|
73
73
|
},
|
|
74
74
|
createUser: {
|
|
75
75
|
business,
|
|
@@ -107,6 +107,10 @@ const validatorsForAllRoutes = {
|
|
|
107
107
|
email,
|
|
108
108
|
stripeId,
|
|
109
109
|
},
|
|
110
|
+
updatePlan: {
|
|
111
|
+
stripeId,
|
|
112
|
+
plan,
|
|
113
|
+
},
|
|
110
114
|
addStatsAssociation: {},
|
|
111
115
|
updateNewsletter: {
|
|
112
116
|
match: (0, validate_1.isBoolean)().isOptional(),
|
package/build/const.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TProjectStatus, TSkill } from "./db.model";
|
|
1
|
+
import { TPlan, TProjectStatus, TSkill } from "./db.model";
|
|
2
2
|
export declare const EMAIL = "contact@cofondateurauchomage.fr";
|
|
3
3
|
export declare const SKILLS: TSkill[];
|
|
4
4
|
export declare const PROJECT_STATUS: TProjectStatus[];
|
|
5
|
+
export declare const PLANS: TPlan[];
|
package/build/const.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PROJECT_STATUS = exports.SKILLS = exports.EMAIL = void 0;
|
|
3
|
+
exports.PLANS = exports.PROJECT_STATUS = exports.SKILLS = exports.EMAIL = void 0;
|
|
4
4
|
exports.EMAIL = "contact@cofondateurauchomage.fr";
|
|
5
5
|
exports.SKILLS = [
|
|
6
6
|
"Business",
|
|
@@ -15,3 +15,4 @@ exports.PROJECT_STATUS = [
|
|
|
15
15
|
"launch",
|
|
16
16
|
"growth",
|
|
17
17
|
];
|
|
18
|
+
exports.PLANS = ["free", "pro"];
|
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,6 +27,7 @@ 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;
|
|
@@ -47,6 +49,7 @@ export interface IProject {
|
|
|
47
49
|
description: string;
|
|
48
50
|
partner: string;
|
|
49
51
|
logo?: string;
|
|
52
|
+
plan: TPlan;
|
|
50
53
|
active: boolean;
|
|
51
54
|
clicks: IClicks;
|
|
52
55
|
creationDate: number;
|