@cofondateurauchomage/libs 1.1.31 → 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 CHANGED
@@ -1,5 +1,5 @@
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
5
  createProject: Omit<IProject, "id" | "plan" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & IContact & {
@@ -9,7 +9,6 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
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
14
  createUser: Omit<IUser, "id" | "plan" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & IContact & {
@@ -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: {
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofondateurauchomage/libs",
3
- "version": "1.1.31",
3
+ "version": "1.1.32",
4
4
  "description": "",
5
5
  "main": "build/index",
6
6
  "scripts": {