@cofondateurauchomage/libs 1.1.24 → 1.1.25
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 +5 -1
- package/build/api.validate.js +5 -0
- package/build/db.model.d.ts +9 -1
- package/build/db.model.js +1 -0
- package/package.json +1 -1
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";
|
|
2
|
+
export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "addStripeIdToProject" | "activeProject" | "createUser" | "updateUser" | "deleteUser" | "activeUser" | "addStatsAssociation" | "updateNewsletter" | "readNotification" | "readAllNotifications";
|
|
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 & {
|
|
@@ -38,4 +38,8 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
|
|
|
38
38
|
stripeId: string;
|
|
39
39
|
};
|
|
40
40
|
webhook: {};
|
|
41
|
+
readNotification: {
|
|
42
|
+
id: string;
|
|
43
|
+
};
|
|
44
|
+
readAllNotifications: {};
|
|
41
45
|
}[O];
|
package/build/api.validate.js
CHANGED
|
@@ -6,6 +6,7 @@ const regex_1 = require("./regex");
|
|
|
6
6
|
const validate_1 = require("./validate");
|
|
7
7
|
//////////////
|
|
8
8
|
// Validators
|
|
9
|
+
const id = (0, validate_1.isString)();
|
|
9
10
|
const business = (0, validate_1.isString)().setMin(10).setMax(300);
|
|
10
11
|
const city = (0, validate_1.isMatchRegex)(regex_1.RGX.Name.regex);
|
|
11
12
|
const description = (0, validate_1.isString)().setMin(10).setMax(500);
|
|
@@ -112,6 +113,10 @@ const validatorsForAllRoutes = {
|
|
|
112
113
|
match: (0, validate_1.isBoolean)().isOptional(),
|
|
113
114
|
marketing: (0, validate_1.isBoolean)().isOptional(),
|
|
114
115
|
},
|
|
116
|
+
readNotification: {
|
|
117
|
+
id,
|
|
118
|
+
},
|
|
119
|
+
readAllNotifications: {},
|
|
115
120
|
//////////
|
|
116
121
|
// Routes
|
|
117
122
|
checkout_session: {
|
package/build/db.model.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export declare enum Collections {
|
|
|
3
3
|
projects = "projects",
|
|
4
4
|
contacts = "contacts",
|
|
5
5
|
newsletters = "newsletters",
|
|
6
|
-
stats = "stats"
|
|
6
|
+
stats = "stats",
|
|
7
|
+
notifications = "notifications"
|
|
7
8
|
}
|
|
8
9
|
export type TSkill = "Business" | "Design" | "Marketing" | "Produit" | "Tech";
|
|
9
10
|
export interface IClicks {
|
|
@@ -66,3 +67,10 @@ export interface INewsletter {
|
|
|
66
67
|
export interface IStatsAssociation {
|
|
67
68
|
liste: string[];
|
|
68
69
|
}
|
|
70
|
+
export interface INotification {
|
|
71
|
+
id: string;
|
|
72
|
+
read: boolean;
|
|
73
|
+
title: string;
|
|
74
|
+
body?: string;
|
|
75
|
+
link?: string;
|
|
76
|
+
}
|
package/build/db.model.js
CHANGED