@cofondateurauchomage/libs 1.1.46 → 1.1.48

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, IProspect, IUser, TPlan } from "./db.model";
2
- export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "activeProject" | "createUser" | "updateUser" | "deleteUser" | "activeUser" | "addStripeId" | "updatePlan" | "addStatsAssociation" | "updateNewsletter" | "createProspect";
1
+ import { IContact, INewsletter, IProject, IProspect, IReactionStatus, IUser, TPlan } from "./db.model";
2
+ export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "activeProject" | "createUser" | "updateUser" | "deleteUser" | "activeUser" | "addStripeId" | "updatePlan" | "addStatsAssociation" | "updateNewsletter" | "createProspect" | "createReaction";
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 & {
@@ -37,6 +37,10 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
37
37
  addStatsAssociation: {};
38
38
  updateNewsletter: INewsletter;
39
39
  createProspect: IProspect;
40
+ createReaction: {
41
+ toId: "string";
42
+ status: IReactionStatus;
43
+ };
40
44
  checkout_session: {
41
45
  stripeId?: string;
42
46
  email: string;
@@ -34,6 +34,7 @@ const logo = (0, validate_1.isString)().isOptional();
34
34
  const plan = (0, validate_1.isMatchEnum)(["free", "pro", "premium"]);
35
35
  const apiSecretKey = (0, validate_1.isString)();
36
36
  const tel = (0, validate_1.isMatchRegex)(regex_1.RGX.Tel.regex);
37
+ const reactionStatus = (0, validate_1.isMatchEnum)(["like", "dislike"]);
37
38
  const validatorsForAllRoutes = {
38
39
  ///////////////////
39
40
  // Cloud functions
@@ -134,6 +135,10 @@ const validatorsForAllRoutes = {
134
135
  createProspect: {
135
136
  email,
136
137
  },
138
+ createReaction: {
139
+ toId: (0, validate_1.isString)(),
140
+ status: reactionStatus,
141
+ },
137
142
  //////////
138
143
  // Routes
139
144
  checkout_session: {
@@ -5,7 +5,8 @@ export declare enum Collections {
5
5
  newsletters = "newsletters",
6
6
  stats = "stats",
7
7
  notifications = "notifications",
8
- prospects = "prospects"
8
+ prospects = "prospects",
9
+ reactions = "reactions"
9
10
  }
10
11
  export type TSkill = "Business" | "Design" | "Marketing" | "Produit" | "Tech";
11
12
  export type TPlan = "free" | "pro" | "premium";
@@ -34,7 +35,6 @@ export interface IUser {
34
35
  clicks: IClicks;
35
36
  creationDate: number;
36
37
  lastConnection: number;
37
- likes: string[];
38
38
  stripeId?: string;
39
39
  }
40
40
  export interface IProject {
@@ -56,7 +56,6 @@ export interface IProject {
56
56
  clicks: IClicks;
57
57
  creationDate: number;
58
58
  lastConnection: number;
59
- likes: string[];
60
59
  stripeId?: string;
61
60
  redstart?: boolean;
62
61
  level?: boolean;
@@ -86,3 +85,10 @@ export interface INotification {
86
85
  export interface IProspect {
87
86
  email: string;
88
87
  }
88
+ export type IReactionStatus = "like" | "dislike";
89
+ export interface IReaction {
90
+ fromUserId: string;
91
+ toUserId: string;
92
+ status: IReactionStatus;
93
+ createdAt: number;
94
+ }
package/build/db.model.js CHANGED
@@ -10,4 +10,5 @@ var Collections;
10
10
  Collections["stats"] = "stats";
11
11
  Collections["notifications"] = "notifications";
12
12
  Collections["prospects"] = "prospects";
13
+ Collections["reactions"] = "reactions";
13
14
  })(Collections = exports.Collections || (exports.Collections = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofondateurauchomage/libs",
3
- "version": "1.1.46",
3
+ "version": "1.1.48",
4
4
  "description": "",
5
5
  "main": "build/index",
6
6
  "scripts": {