@cofondateurauchomage/libs 1.1.5 → 1.1.8

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
@@ -2,9 +2,11 @@ import { IProject, IUser } from "./db.model";
2
2
  export type CloudFunctionNames = "createProjectCall" | "updateProjectCall" | "deleteProjectCall" | "addStripeIdToProjectCall" | "activeProjectCall" | "createUserCall" | "updateUserCall" | "deleteUserCall" | "addStatsAssociationCall";
3
3
  export type RouteNames = "checkout_session" | "delete_customer" | "portal_session" | "webhook";
4
4
  export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
5
- createProjectCall: Omit<IProject, "active" | "clicks" | "creationDate" | "likes" | "stripeId">;
5
+ createProjectCall: Omit<IProject, "id" | "active" | "clicks" | "creationDate" | "lastConnection" | "likes" | "stripeId"> & {
6
+ newsletterMatch?: boolean;
7
+ };
6
8
  deleteProjectCall: {};
7
- updateProjectCall: Pick<IProject, "city" | "description" | "invest" | "linkedin" | "partner" | "skills" | "zipCode">;
9
+ updateProjectCall: Pick<IProject, "city" | "description" | "invest" | "linkedin" | "name" | "partner" | "skills" | "zipCode">;
8
10
  addStripeIdToProjectCall: {
9
11
  email: string;
10
12
  stripeId: string;
@@ -13,7 +15,9 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
13
15
  stripeId: string;
14
16
  active: boolean;
15
17
  };
16
- createUserCall: Omit<IUser, "clicks" | "creationDate" | "likes">;
18
+ createUserCall: Omit<IUser, "id" | "clicks" | "creationDate" | "lastConnection" | "likes"> & {
19
+ newsletterMatch?: boolean;
20
+ };
17
21
  deleteUserCall: {};
18
22
  updateUserCall: Pick<IUser, "business" | "city" | "invest" | "linkedin" | "motivations" | "partner" | "skills" | "zipCode">;
19
23
  addStatsAssociationCall: {};
@@ -15,6 +15,7 @@ const invest = (0, validate_1.isNumber)().setMin(0).setMax(1000000).isOptional()
15
15
  const lastName = (0, validate_1.isMatchRegex)(regex_1.RGX.Name.regex);
16
16
  const linkedin = (0, validate_1.isMatchRegex)(regex_1.RGX.Linkedin.regex);
17
17
  const motivations = (0, validate_1.isString)().setMin(10).setMax(500);
18
+ const name = (0, validate_1.isString)().setMin(2).setMax(50);
18
19
  const partner = (0, validate_1.isString)().setMin(10).setMax(300);
19
20
  const skills = new validate_1.Validator((value) => !!(value &&
20
21
  Array.isArray(value) &&
@@ -23,6 +24,7 @@ const skills = new validate_1.Validator((value) => !!(value &&
23
24
  value.every((skill) => const_1.SKILLS.includes(skill))));
24
25
  const stripeId = (0, validate_1.isString)().setMin(4).setMax(50);
25
26
  const zipCode = (0, validate_1.isNumber)().setMin(1000).setMax(97680);
27
+ const newsletterMatch = (0, validate_1.isBoolean)().isOptional();
26
28
  const validatorsForAllRoutes = {
27
29
  ///////////////////
28
30
  // Cloud functions
@@ -34,11 +36,12 @@ const validatorsForAllRoutes = {
34
36
  invest,
35
37
  lastName,
36
38
  linkedin,
37
- name: (0, validate_1.isString)().setMin(2).setMax(50),
39
+ name,
38
40
  partner,
39
41
  redstart: (0, validate_1.isBoolean)().isOptional(),
40
42
  skills,
41
43
  zipCode,
44
+ newsletterMatch,
42
45
  },
43
46
  deleteProjectCall: {},
44
47
  updateProjectCall: {
@@ -46,6 +49,7 @@ const validatorsForAllRoutes = {
46
49
  description,
47
50
  invest,
48
51
  linkedin,
52
+ name,
49
53
  partner,
50
54
  skills,
51
55
  zipCode,
@@ -71,6 +75,7 @@ const validatorsForAllRoutes = {
71
75
  partner,
72
76
  skills,
73
77
  zipCode,
78
+ newsletterMatch,
74
79
  },
75
80
  deleteUserCall: {},
76
81
  updateUserCall: {
@@ -11,6 +11,7 @@ export interface IClicks {
11
11
  share: number;
12
12
  }
13
13
  export interface IUser {
14
+ id: string;
14
15
  business: string;
15
16
  city: string;
16
17
  email: string;
@@ -25,9 +26,11 @@ export interface IUser {
25
26
  zipCode: number;
26
27
  clicks: IClicks;
27
28
  creationDate: number;
29
+ lastConnection: number;
28
30
  likes: string[];
29
31
  }
30
32
  export interface IProject {
33
+ id: string;
31
34
  city: string;
32
35
  description: string;
33
36
  email: string;
@@ -43,9 +46,14 @@ export interface IProject {
43
46
  active: boolean;
44
47
  clicks: IClicks;
45
48
  creationDate: number;
49
+ lastConnection: number;
46
50
  likes: string[];
47
51
  stripeId?: string;
48
52
  }
49
53
  export interface IStatsAssociation {
50
54
  liste: string[];
51
55
  }
56
+ export interface INewsletter {
57
+ contact_id: string;
58
+ match?: boolean;
59
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofondateurauchomage/libs",
3
- "version": "1.1.5",
3
+ "version": "1.1.8",
4
4
  "description": "",
5
5
  "main": "build/index",
6
6
  "scripts": {