@cofondateurauchomage/libs 1.1.27 → 1.1.29

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
1
  import { IContact, INewsletter, IProject, IUser } from "./db.model";
2
- export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "addStripeIdToProject" | "activeProject" | "createUser" | "updateUser" | "deleteUser" | "activeUser" | "addStatsAssociation" | "updateNewsletter" | "readNotification" | "readAllNotifications";
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
5
  createProject: Omit<IProject, "id" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & IContact & {
@@ -8,15 +8,11 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
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" | "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: {
@@ -38,8 +38,4 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
38
38
  stripeId: string;
39
39
  };
40
40
  webhook: {};
41
- readNotification: {
42
- id: string;
43
- };
44
- readAllNotifications: {};
45
41
  }[O];
@@ -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,15 +103,15 @@ 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(),
114
113
  marketing: (0, validate_1.isBoolean)().isOptional(),
115
114
  },
116
- readNotification: {
117
- id,
118
- },
119
- readAllNotifications: {},
120
115
  //////////
121
116
  // Routes
122
117
  checkout_session: {
@@ -31,6 +31,7 @@ export interface IUser {
31
31
  creationDate: number;
32
32
  lastConnection: number;
33
33
  likes: string[];
34
+ stripeId?: string;
34
35
  }
35
36
  export interface IProject {
36
37
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofondateurauchomage/libs",
3
- "version": "1.1.27",
3
+ "version": "1.1.29",
4
4
  "description": "",
5
5
  "main": "build/index",
6
6
  "scripts": {