@likewatt/models 1.1.20 → 1.1.22
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/dist/core/CollectiveSite.d.ts +4 -4
- package/dist/core/CollectiveSite.js +12 -4
- package/dist/core/DefaultRate.d.ts +4 -4
- package/dist/core/DefaultRate.js +19 -11
- package/dist/core/Invitation.d.ts +4 -4
- package/dist/core/Invitation.js +18 -10
- package/dist/core/License.d.ts +4 -4
- package/dist/core/License.js +24 -16
- package/dist/core/Scenario.d.ts +22 -22
- package/dist/core/Scenario.js +19 -3
- package/dist/core/ScenarioDefaultValue.d.ts +7 -6
- package/dist/core/ScenarioDefaultValue.js +18 -0
- package/dist/core/Site.d.ts +6 -6
- package/dist/core/Site.js +16 -8
- package/dist/core/User.d.ts +12 -12
- package/dist/core/User.js +81 -73
- package/dist/core/internal/enums.d.ts +1 -0
- package/dist/core/internal/enums.js +1 -0
- package/package.json +1 -1
package/dist/core/User.js
CHANGED
|
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UserSchema = exports.User = exports.WebhookParamsSchema = exports.WebhookParams = exports.tokenDataSchema = exports.tokenData = exports.RightsSchema = exports.Rights = exports.SiteTagSchema = exports.SiteTag = void 0;
|
|
13
|
-
const mongoose_1 = require("mongoose");
|
|
14
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
-
const
|
|
14
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
15
|
+
const uuid_1 = require("uuid");
|
|
16
16
|
const class_validator_1 = require("class-validator");
|
|
17
17
|
const folder_model_1 = require("./internal/folder.model");
|
|
18
18
|
const manager_licenses_1 = require("./internal/manager-licenses");
|
|
@@ -27,7 +27,7 @@ __decorate([
|
|
|
27
27
|
description: 'Indique si le site possède un tag consommateur',
|
|
28
28
|
example: true,
|
|
29
29
|
}),
|
|
30
|
-
(0,
|
|
30
|
+
(0, mongoose_1.Prop)({ type: Boolean, required: true }),
|
|
31
31
|
(0, class_validator_1.IsBoolean)(),
|
|
32
32
|
__metadata("design:type", Boolean)
|
|
33
33
|
], SiteTag.prototype, "hasConsumerTag", void 0);
|
|
@@ -36,14 +36,14 @@ __decorate([
|
|
|
36
36
|
description: 'Indique si le site possède un tag consommateur',
|
|
37
37
|
example: true,
|
|
38
38
|
}),
|
|
39
|
-
(0,
|
|
39
|
+
(0, mongoose_1.Prop)({ type: Boolean, required: true }),
|
|
40
40
|
(0, class_validator_1.IsBoolean)(),
|
|
41
41
|
__metadata("design:type", Boolean)
|
|
42
42
|
], SiteTag.prototype, "hasConsumerPlusTag", void 0);
|
|
43
43
|
exports.SiteTag = SiteTag = __decorate([
|
|
44
|
-
(0,
|
|
44
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
45
45
|
], SiteTag);
|
|
46
|
-
exports.SiteTagSchema =
|
|
46
|
+
exports.SiteTagSchema = mongoose_1.SchemaFactory.createForClass(SiteTag);
|
|
47
47
|
let Rights = class Rights {
|
|
48
48
|
};
|
|
49
49
|
exports.Rights = Rights;
|
|
@@ -52,7 +52,7 @@ __decorate([
|
|
|
52
52
|
description: "Indique si l'utilisateur peut supprimer un site",
|
|
53
53
|
example: true,
|
|
54
54
|
}),
|
|
55
|
-
(0,
|
|
55
|
+
(0, mongoose_1.Prop)({ type: Boolean, required: true, default: false }),
|
|
56
56
|
(0, class_validator_1.IsBoolean)(),
|
|
57
57
|
__metadata("design:type", Boolean)
|
|
58
58
|
], Rights.prototype, "deleteSite", void 0);
|
|
@@ -61,14 +61,14 @@ __decorate([
|
|
|
61
61
|
description: "Indique si l'utilisateur peut supprimer des sites",
|
|
62
62
|
example: true,
|
|
63
63
|
}),
|
|
64
|
-
(0,
|
|
64
|
+
(0, mongoose_1.Prop)({ type: Boolean, required: true, default: false }),
|
|
65
65
|
(0, class_validator_1.IsBoolean)(),
|
|
66
66
|
__metadata("design:type", Boolean)
|
|
67
67
|
], Rights.prototype, "deleteSites", void 0);
|
|
68
68
|
exports.Rights = Rights = __decorate([
|
|
69
|
-
(0,
|
|
69
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
70
70
|
], Rights);
|
|
71
|
-
exports.RightsSchema =
|
|
71
|
+
exports.RightsSchema = mongoose_1.SchemaFactory.createForClass(Rights);
|
|
72
72
|
let tokenData = class tokenData {
|
|
73
73
|
};
|
|
74
74
|
exports.tokenData = tokenData;
|
|
@@ -77,7 +77,7 @@ __decorate([
|
|
|
77
77
|
description: 'Token de réinitialisation du mot de passe',
|
|
78
78
|
example: true,
|
|
79
79
|
}),
|
|
80
|
-
(0,
|
|
80
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
81
81
|
(0, class_validator_1.IsString)(),
|
|
82
82
|
__metadata("design:type", String)
|
|
83
83
|
], tokenData.prototype, "resetPasswordToken", void 0);
|
|
@@ -86,14 +86,14 @@ __decorate([
|
|
|
86
86
|
description: "Date d'expiration du token de réinitialisation",
|
|
87
87
|
example: true,
|
|
88
88
|
}),
|
|
89
|
-
(0,
|
|
89
|
+
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
90
90
|
(0, class_validator_1.IsDate)(),
|
|
91
91
|
__metadata("design:type", Date)
|
|
92
92
|
], tokenData.prototype, "resetPasswordExpires", void 0);
|
|
93
93
|
exports.tokenData = tokenData = __decorate([
|
|
94
|
-
(0,
|
|
94
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
95
95
|
], tokenData);
|
|
96
|
-
exports.tokenDataSchema =
|
|
96
|
+
exports.tokenDataSchema = mongoose_1.SchemaFactory.createForClass(tokenData);
|
|
97
97
|
let WebhookParams = class WebhookParams {
|
|
98
98
|
};
|
|
99
99
|
exports.WebhookParams = WebhookParams;
|
|
@@ -102,7 +102,7 @@ __decorate([
|
|
|
102
102
|
description: "Endpoint de l'utilisateur pour le webhook",
|
|
103
103
|
example: true,
|
|
104
104
|
}),
|
|
105
|
-
(0,
|
|
105
|
+
(0, mongoose_1.Prop)({
|
|
106
106
|
type: String,
|
|
107
107
|
required: false,
|
|
108
108
|
default: 'https://example.com/webhook',
|
|
@@ -115,7 +115,7 @@ __decorate([
|
|
|
115
115
|
description: "Token de l'utilisateur pour le webhook",
|
|
116
116
|
example: true,
|
|
117
117
|
}),
|
|
118
|
-
(0,
|
|
118
|
+
(0, mongoose_1.Prop)({ type: String, required: false, default: 'myToken_XXXX' }),
|
|
119
119
|
(0, class_validator_1.IsString)(),
|
|
120
120
|
__metadata("design:type", String)
|
|
121
121
|
], WebhookParams.prototype, "token", void 0);
|
|
@@ -124,14 +124,14 @@ __decorate([
|
|
|
124
124
|
description: "API Key de l'utilisateur pour le webhook. SPECIFIQUE POUR UN SEUL CLIENT, NE PAS UTILISER AILLEURS",
|
|
125
125
|
example: true,
|
|
126
126
|
}),
|
|
127
|
-
(0,
|
|
127
|
+
(0, mongoose_1.Prop)({ type: String, required: false, default: 'myToken_XXXX' }),
|
|
128
128
|
(0, class_validator_1.IsString)(),
|
|
129
129
|
__metadata("design:type", String)
|
|
130
130
|
], WebhookParams.prototype, "apiKey", void 0);
|
|
131
131
|
exports.WebhookParams = WebhookParams = __decorate([
|
|
132
|
-
(0,
|
|
132
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
133
133
|
], WebhookParams);
|
|
134
|
-
exports.WebhookParamsSchema =
|
|
134
|
+
exports.WebhookParamsSchema = mongoose_1.SchemaFactory.createForClass(WebhookParams);
|
|
135
135
|
/**
|
|
136
136
|
* Représente un utilisateur dans le système.
|
|
137
137
|
* - @Schema/timestamps : gère createdAt et updatedAt automatiques
|
|
@@ -144,12 +144,13 @@ let User = class User {
|
|
|
144
144
|
exports.User = User;
|
|
145
145
|
__decorate([
|
|
146
146
|
(0, swagger_1.ApiProperty)({
|
|
147
|
-
description: 'Identifiant unique
|
|
147
|
+
description: 'Identifiant unique (UUID ou custom string)',
|
|
148
148
|
example: '2M61PGSm7lRpqXeaDacbAYOLTYG3',
|
|
149
|
-
type:
|
|
149
|
+
type: String,
|
|
150
150
|
readOnly: true,
|
|
151
151
|
}),
|
|
152
|
-
|
|
152
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
153
|
+
__metadata("design:type", String)
|
|
153
154
|
], User.prototype, "_id", void 0);
|
|
154
155
|
__decorate([
|
|
155
156
|
(0, swagger_1.ApiProperty)({
|
|
@@ -157,7 +158,7 @@ __decorate([
|
|
|
157
158
|
example: 'firstname.lastname@email.com',
|
|
158
159
|
format: 'email',
|
|
159
160
|
}),
|
|
160
|
-
(0,
|
|
161
|
+
(0, mongoose_1.Prop)({ type: String, required: true, unique: true }),
|
|
161
162
|
(0, class_validator_1.IsEmail)(),
|
|
162
163
|
__metadata("design:type", String)
|
|
163
164
|
], User.prototype, "email", void 0);
|
|
@@ -167,7 +168,7 @@ __decorate([
|
|
|
167
168
|
writeOnly: true,
|
|
168
169
|
minLength: 8,
|
|
169
170
|
}),
|
|
170
|
-
(0,
|
|
171
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
171
172
|
(0, class_validator_1.IsString)(),
|
|
172
173
|
__metadata("design:type", String)
|
|
173
174
|
], User.prototype, "password", void 0);
|
|
@@ -176,43 +177,43 @@ __decorate([
|
|
|
176
177
|
description: 'Prénom de l’utilisateur',
|
|
177
178
|
example: 'Jean',
|
|
178
179
|
}),
|
|
179
|
-
(0,
|
|
180
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
180
181
|
(0, class_validator_1.IsString)(),
|
|
181
182
|
__metadata("design:type", String)
|
|
182
183
|
], User.prototype, "firstname", void 0);
|
|
183
184
|
__decorate([
|
|
184
185
|
(0, swagger_1.ApiProperty)({ type: [folder_model_1.Folder] }),
|
|
185
|
-
(0,
|
|
186
|
+
(0, mongoose_1.Prop)({ type: [folder_model_1.FolderSchema], required: false, default: [] }),
|
|
186
187
|
(0, class_validator_1.IsArray)(),
|
|
187
188
|
__metadata("design:type", Array)
|
|
188
189
|
], User.prototype, "folders", void 0);
|
|
189
190
|
__decorate([
|
|
190
191
|
(0, swagger_1.ApiProperty)({ type: manager_licenses_1.ManagerLicenses }),
|
|
191
|
-
(0,
|
|
192
|
+
(0, mongoose_1.Prop)({ type: [folder_model_1.FolderSchema] }),
|
|
192
193
|
(0, class_validator_1.IsObject)(),
|
|
193
194
|
__metadata("design:type", manager_licenses_1.ManagerLicenses)
|
|
194
195
|
], User.prototype, "managerLicenses", void 0);
|
|
195
196
|
__decorate([
|
|
196
197
|
(0, swagger_1.ApiProperty)({ type: manager_licenses_1.ManagerLicenses }),
|
|
197
|
-
(0,
|
|
198
|
+
(0, mongoose_1.Prop)({ type: [folder_model_1.FolderSchema] }),
|
|
198
199
|
(0, class_validator_1.IsObject)(),
|
|
199
200
|
__metadata("design:type", manager_licenses_1.ManagerLicenses)
|
|
200
201
|
], User.prototype, "managerLicensesUsed", void 0);
|
|
201
202
|
__decorate([
|
|
202
203
|
(0, swagger_1.ApiProperty)({ type: Object }),
|
|
203
|
-
(0,
|
|
204
|
+
(0, mongoose_1.Prop)({ type: [Object] }),
|
|
204
205
|
(0, class_validator_1.IsObject)(),
|
|
205
206
|
__metadata("design:type", Object)
|
|
206
207
|
], User.prototype, "renewLicense", void 0);
|
|
207
208
|
__decorate([
|
|
208
209
|
(0, swagger_1.ApiProperty)({ type: [String] }),
|
|
209
|
-
(0,
|
|
210
|
+
(0, mongoose_1.Prop)({ type: [String], required: false, default: [] }),
|
|
210
211
|
(0, class_validator_1.IsArray)(),
|
|
211
212
|
__metadata("design:type", Array)
|
|
212
213
|
], User.prototype, "defaultRates", void 0);
|
|
213
214
|
__decorate([
|
|
214
215
|
(0, swagger_1.ApiProperty)({ type: [String] }),
|
|
215
|
-
(0,
|
|
216
|
+
(0, mongoose_1.Prop)({ type: [String], required: false, default: [] }),
|
|
216
217
|
(0, class_validator_1.IsArray)(),
|
|
217
218
|
__metadata("design:type", Array)
|
|
218
219
|
], User.prototype, "defaultScenarios", void 0);
|
|
@@ -221,7 +222,7 @@ __decorate([
|
|
|
221
222
|
description: 'Nom de famille de l’utilisateur',
|
|
222
223
|
example: 'PAUL',
|
|
223
224
|
}),
|
|
224
|
-
(0,
|
|
225
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
225
226
|
(0, class_validator_1.IsString)(),
|
|
226
227
|
__metadata("design:type", String)
|
|
227
228
|
], User.prototype, "lastname", void 0);
|
|
@@ -230,7 +231,7 @@ __decorate([
|
|
|
230
231
|
description: 'Numéro de téléphone',
|
|
231
232
|
example: '0606060606',
|
|
232
233
|
}),
|
|
233
|
-
(0,
|
|
234
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
234
235
|
(0, class_validator_1.IsOptional)(),
|
|
235
236
|
(0, class_validator_1.IsString)(),
|
|
236
237
|
__metadata("design:type", String)
|
|
@@ -240,7 +241,7 @@ __decorate([
|
|
|
240
241
|
description: 'Nom de la société',
|
|
241
242
|
example: 'LIKEWATT',
|
|
242
243
|
}),
|
|
243
|
-
(0,
|
|
244
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
244
245
|
(0, class_validator_1.IsOptional)(),
|
|
245
246
|
(0, class_validator_1.IsString)(),
|
|
246
247
|
__metadata("design:type", String)
|
|
@@ -250,7 +251,7 @@ __decorate([
|
|
|
250
251
|
description: 'Nom de la société',
|
|
251
252
|
example: 'LIKEWATT',
|
|
252
253
|
}),
|
|
253
|
-
(0,
|
|
254
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
254
255
|
(0, class_validator_1.IsOptional)(),
|
|
255
256
|
(0, class_validator_1.IsString)(),
|
|
256
257
|
__metadata("design:type", String)
|
|
@@ -260,7 +261,7 @@ __decorate([
|
|
|
260
261
|
description: 'Adresse postale',
|
|
261
262
|
example: '1 rue de la République',
|
|
262
263
|
}),
|
|
263
|
-
(0,
|
|
264
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
264
265
|
(0, class_validator_1.IsOptional)(),
|
|
265
266
|
(0, class_validator_1.IsString)(),
|
|
266
267
|
__metadata("design:type", String)
|
|
@@ -270,7 +271,7 @@ __decorate([
|
|
|
270
271
|
description: 'Ville de l’adresse',
|
|
271
272
|
example: 'VILLEURBANNE',
|
|
272
273
|
}),
|
|
273
|
-
(0,
|
|
274
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
274
275
|
(0, class_validator_1.IsOptional)(),
|
|
275
276
|
(0, class_validator_1.IsString)(),
|
|
276
277
|
__metadata("design:type", String)
|
|
@@ -280,7 +281,7 @@ __decorate([
|
|
|
280
281
|
description: 'Code postal',
|
|
281
282
|
example: '69100',
|
|
282
283
|
}),
|
|
283
|
-
(0,
|
|
284
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
284
285
|
(0, class_validator_1.IsOptional)(),
|
|
285
286
|
(0, class_validator_1.IsString)(),
|
|
286
287
|
__metadata("design:type", String)
|
|
@@ -290,7 +291,7 @@ __decorate([
|
|
|
290
291
|
description: 'Rôle administrateur',
|
|
291
292
|
example: true,
|
|
292
293
|
}),
|
|
293
|
-
(0,
|
|
294
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
294
295
|
(0, class_validator_1.IsBoolean)(),
|
|
295
296
|
__metadata("design:type", Boolean)
|
|
296
297
|
], User.prototype, "isAdmin", void 0);
|
|
@@ -299,7 +300,7 @@ __decorate([
|
|
|
299
300
|
description: 'E-mail de renouvellement envoyé',
|
|
300
301
|
example: true,
|
|
301
302
|
}),
|
|
302
|
-
(0,
|
|
303
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
303
304
|
(0, class_validator_1.IsBoolean)(),
|
|
304
305
|
__metadata("design:type", Boolean)
|
|
305
306
|
], User.prototype, "isRenewalEmailSent", void 0);
|
|
@@ -308,7 +309,7 @@ __decorate([
|
|
|
308
309
|
description: 'Rôle manager',
|
|
309
310
|
example: false,
|
|
310
311
|
}),
|
|
311
|
-
(0,
|
|
312
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
312
313
|
(0, class_validator_1.IsBoolean)(),
|
|
313
314
|
__metadata("design:type", Boolean)
|
|
314
315
|
], User.prototype, "isManager", void 0);
|
|
@@ -317,7 +318,7 @@ __decorate([
|
|
|
317
318
|
description: 'Compte actif',
|
|
318
319
|
example: true,
|
|
319
320
|
}),
|
|
320
|
-
(0,
|
|
321
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: true }),
|
|
321
322
|
(0, class_validator_1.IsBoolean)(),
|
|
322
323
|
__metadata("design:type", Boolean)
|
|
323
324
|
], User.prototype, "active", void 0);
|
|
@@ -326,7 +327,7 @@ __decorate([
|
|
|
326
327
|
description: 'Compte de démonstration',
|
|
327
328
|
example: false,
|
|
328
329
|
}),
|
|
329
|
-
(0,
|
|
330
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
330
331
|
(0, class_validator_1.IsBoolean)(),
|
|
331
332
|
__metadata("design:type", Boolean)
|
|
332
333
|
], User.prototype, "demo", void 0);
|
|
@@ -335,7 +336,7 @@ __decorate([
|
|
|
335
336
|
description: 'E-mail vérifié',
|
|
336
337
|
example: true,
|
|
337
338
|
}),
|
|
338
|
-
(0,
|
|
339
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
339
340
|
(0, class_validator_1.IsBoolean)(),
|
|
340
341
|
__metadata("design:type", Boolean)
|
|
341
342
|
], User.prototype, "emailVerified", void 0);
|
|
@@ -344,7 +345,7 @@ __decorate([
|
|
|
344
345
|
description: 'Compte principal',
|
|
345
346
|
example: true,
|
|
346
347
|
}),
|
|
347
|
-
(0,
|
|
348
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
348
349
|
(0, class_validator_1.IsBoolean)(),
|
|
349
350
|
__metadata("design:type", Boolean)
|
|
350
351
|
], User.prototype, "principal", void 0);
|
|
@@ -353,7 +354,7 @@ __decorate([
|
|
|
353
354
|
description: 'Identifiant de l’utilisateur principal (si compte secondaire)',
|
|
354
355
|
example: '2M61PGSm7lRpqXeaDacbAYOLTYG3',
|
|
355
356
|
}),
|
|
356
|
-
(0,
|
|
357
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
357
358
|
(0, class_validator_1.IsOptional)(),
|
|
358
359
|
(0, class_validator_1.IsString)(),
|
|
359
360
|
__metadata("design:type", String)
|
|
@@ -363,7 +364,7 @@ __decorate([
|
|
|
363
364
|
description: 'Type de l’utilisateur',
|
|
364
365
|
example: 'CONSUMER_PLUS',
|
|
365
366
|
}),
|
|
366
|
-
(0,
|
|
367
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
367
368
|
(0, class_validator_1.IsOptional)(),
|
|
368
369
|
(0, class_validator_1.IsString)(),
|
|
369
370
|
__metadata("design:type", String)
|
|
@@ -373,7 +374,7 @@ __decorate([
|
|
|
373
374
|
description: 'Domaine d’activité',
|
|
374
375
|
example: 'BTSUP',
|
|
375
376
|
}),
|
|
376
|
-
(0,
|
|
377
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
377
378
|
(0, class_validator_1.IsOptional)(),
|
|
378
379
|
(0, class_validator_1.IsString)(),
|
|
379
380
|
__metadata("design:type", String)
|
|
@@ -383,7 +384,7 @@ __decorate([
|
|
|
383
384
|
description: 'Licence utilisateur',
|
|
384
385
|
example: 'Standard',
|
|
385
386
|
}),
|
|
386
|
-
(0,
|
|
387
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
387
388
|
(0, class_validator_1.IsOptional)(),
|
|
388
389
|
(0, class_validator_1.IsString)(),
|
|
389
390
|
__metadata("design:type", String)
|
|
@@ -393,7 +394,7 @@ __decorate([
|
|
|
393
394
|
description: 'Identifiant de la licence',
|
|
394
395
|
example: 'Standard',
|
|
395
396
|
}),
|
|
396
|
-
(0,
|
|
397
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
397
398
|
(0, class_validator_1.IsOptional)(),
|
|
398
399
|
(0, class_validator_1.IsString)(),
|
|
399
400
|
__metadata("design:type", String)
|
|
@@ -403,7 +404,7 @@ __decorate([
|
|
|
403
404
|
description: 'Langue',
|
|
404
405
|
example: 'FR',
|
|
405
406
|
}),
|
|
406
|
-
(0,
|
|
407
|
+
(0, mongoose_1.Prop)({ type: String, required: true, default: 'FR' }),
|
|
407
408
|
(0, class_validator_1.IsOptional)(),
|
|
408
409
|
(0, class_validator_1.IsString)(),
|
|
409
410
|
__metadata("design:type", String)
|
|
@@ -413,7 +414,7 @@ __decorate([
|
|
|
413
414
|
description: 'Nombre de sites autorisés',
|
|
414
415
|
example: 50,
|
|
415
416
|
}),
|
|
416
|
-
(0,
|
|
417
|
+
(0, mongoose_1.Prop)({ type: Number, required: false }),
|
|
417
418
|
(0, class_validator_1.IsOptional)(),
|
|
418
419
|
(0, class_validator_1.IsNumber)(),
|
|
419
420
|
__metadata("design:type", Number)
|
|
@@ -423,7 +424,7 @@ __decorate([
|
|
|
423
424
|
description: 'Logo',
|
|
424
425
|
example: 'logo.png',
|
|
425
426
|
}),
|
|
426
|
-
(0,
|
|
427
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
427
428
|
(0, class_validator_1.IsOptional)(),
|
|
428
429
|
(0, class_validator_1.IsString)(),
|
|
429
430
|
__metadata("design:type", String)
|
|
@@ -433,7 +434,7 @@ __decorate([
|
|
|
433
434
|
description: 'Nombre maximum d’utilisateurs',
|
|
434
435
|
example: 1,
|
|
435
436
|
}),
|
|
436
|
-
(0,
|
|
437
|
+
(0, mongoose_1.Prop)({ type: Number, required: false }),
|
|
437
438
|
(0, class_validator_1.IsOptional)(),
|
|
438
439
|
(0, class_validator_1.IsNumber)(),
|
|
439
440
|
__metadata("design:type", Number)
|
|
@@ -443,7 +444,7 @@ __decorate([
|
|
|
443
444
|
description: 'Suivi OKD activé',
|
|
444
445
|
example: false,
|
|
445
446
|
}),
|
|
446
|
-
(0,
|
|
447
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
447
448
|
(0, class_validator_1.IsBoolean)(),
|
|
448
449
|
__metadata("design:type", Boolean)
|
|
449
450
|
], User.prototype, "trackerOkd", void 0);
|
|
@@ -452,7 +453,7 @@ __decorate([
|
|
|
452
453
|
description: 'E-mail de création envoyé',
|
|
453
454
|
example: true,
|
|
454
455
|
}),
|
|
455
|
-
(0,
|
|
456
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
456
457
|
(0, class_validator_1.IsBoolean)(),
|
|
457
458
|
__metadata("design:type", Boolean)
|
|
458
459
|
], User.prototype, "isSignUpEmailSent", void 0);
|
|
@@ -461,7 +462,7 @@ __decorate([
|
|
|
461
462
|
description: 'E-mail admin envoyé',
|
|
462
463
|
example: false,
|
|
463
464
|
}),
|
|
464
|
-
(0,
|
|
465
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
465
466
|
(0, class_validator_1.IsBoolean)(),
|
|
466
467
|
__metadata("design:type", Boolean)
|
|
467
468
|
], User.prototype, "isAdminEmailSent", void 0);
|
|
@@ -470,7 +471,7 @@ __decorate([
|
|
|
470
471
|
description: 'Renouvellement automatique de l’abonnement',
|
|
471
472
|
example: false,
|
|
472
473
|
}),
|
|
473
|
-
(0,
|
|
474
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: false }),
|
|
474
475
|
(0, class_validator_1.IsBoolean)(),
|
|
475
476
|
__metadata("design:type", Boolean)
|
|
476
477
|
], User.prototype, "automaticRenew", void 0);
|
|
@@ -479,7 +480,7 @@ __decorate([
|
|
|
479
480
|
description: 'Numéro OPTIM',
|
|
480
481
|
example: 9999,
|
|
481
482
|
}),
|
|
482
|
-
(0,
|
|
483
|
+
(0, mongoose_1.Prop)({ type: Number, required: false }),
|
|
483
484
|
(0, class_validator_1.IsOptional)(),
|
|
484
485
|
(0, class_validator_1.IsNumber)(),
|
|
485
486
|
__metadata("design:type", Number)
|
|
@@ -489,7 +490,7 @@ __decorate([
|
|
|
489
490
|
description: 'Nombre de sites actifs',
|
|
490
491
|
example: 2,
|
|
491
492
|
}),
|
|
492
|
-
(0,
|
|
493
|
+
(0, mongoose_1.Prop)({ type: Number, required: false }),
|
|
493
494
|
(0, class_validator_1.IsOptional)(),
|
|
494
495
|
(0, class_validator_1.IsNumber)(),
|
|
495
496
|
__metadata("design:type", Number)
|
|
@@ -501,7 +502,7 @@ __decorate([
|
|
|
501
502
|
isArray: true,
|
|
502
503
|
type: String,
|
|
503
504
|
}),
|
|
504
|
-
(0,
|
|
505
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
505
506
|
(0, class_validator_1.IsArray)(),
|
|
506
507
|
(0, class_validator_1.IsString)({ each: true }),
|
|
507
508
|
__metadata("design:type", Array)
|
|
@@ -513,7 +514,7 @@ __decorate([
|
|
|
513
514
|
isArray: true,
|
|
514
515
|
type: String,
|
|
515
516
|
}),
|
|
516
|
-
(0,
|
|
517
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
517
518
|
(0, class_validator_1.IsArray)(),
|
|
518
519
|
(0, class_validator_1.IsString)({ each: true }),
|
|
519
520
|
__metadata("design:type", Array)
|
|
@@ -525,7 +526,7 @@ __decorate([
|
|
|
525
526
|
isArray: true,
|
|
526
527
|
type: String,
|
|
527
528
|
}),
|
|
528
|
-
(0,
|
|
529
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
529
530
|
(0, class_validator_1.IsArray)(),
|
|
530
531
|
(0, class_validator_1.IsString)({ each: true }),
|
|
531
532
|
__metadata("design:type", Array)
|
|
@@ -537,7 +538,7 @@ __decorate([
|
|
|
537
538
|
isArray: true,
|
|
538
539
|
type: String,
|
|
539
540
|
}),
|
|
540
|
-
(0,
|
|
541
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
541
542
|
(0, class_validator_1.IsArray)(),
|
|
542
543
|
(0, class_validator_1.IsString)({ each: true }),
|
|
543
544
|
__metadata("design:type", Array)
|
|
@@ -549,7 +550,7 @@ __decorate([
|
|
|
549
550
|
isArray: true,
|
|
550
551
|
type: String,
|
|
551
552
|
}),
|
|
552
|
-
(0,
|
|
553
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
553
554
|
(0, class_validator_1.IsArray)(),
|
|
554
555
|
(0, class_validator_1.IsString)({ each: true }),
|
|
555
556
|
__metadata("design:type", Array)
|
|
@@ -559,7 +560,7 @@ __decorate([
|
|
|
559
560
|
description: 'Tags spécifiques au site',
|
|
560
561
|
type: () => SiteTag,
|
|
561
562
|
}),
|
|
562
|
-
(0,
|
|
563
|
+
(0, mongoose_1.Prop)({ type: exports.SiteTagSchema, _id: false }),
|
|
563
564
|
__metadata("design:type", SiteTag)
|
|
564
565
|
], User.prototype, "siteTag", void 0);
|
|
565
566
|
__decorate([
|
|
@@ -567,7 +568,7 @@ __decorate([
|
|
|
567
568
|
description: 'Droits spécifiques de l’utilisateur',
|
|
568
569
|
type: () => Rights,
|
|
569
570
|
}),
|
|
570
|
-
(0,
|
|
571
|
+
(0, mongoose_1.Prop)({
|
|
571
572
|
type: exports.RightsSchema,
|
|
572
573
|
_id: false,
|
|
573
574
|
default: { deleteSite: false, deleteSites: false },
|
|
@@ -579,7 +580,7 @@ __decorate([
|
|
|
579
580
|
description: 'Configuration du webhook',
|
|
580
581
|
type: () => WebhookParams,
|
|
581
582
|
}),
|
|
582
|
-
(0,
|
|
583
|
+
(0, mongoose_1.Prop)({
|
|
583
584
|
type: exports.WebhookParamsSchema,
|
|
584
585
|
_id: false,
|
|
585
586
|
default: {
|
|
@@ -595,7 +596,7 @@ __decorate([
|
|
|
595
596
|
example: '{ resetPasswordToken: "token", resetPasswordExpires: "date" }',
|
|
596
597
|
type: () => tokenData,
|
|
597
598
|
}),
|
|
598
|
-
(0,
|
|
599
|
+
(0, mongoose_1.Prop)({ type: exports.tokenDataSchema, required: false }),
|
|
599
600
|
(0, class_validator_1.IsOptional)(),
|
|
600
601
|
__metadata("design:type", tokenData)
|
|
601
602
|
], User.prototype, "tokenData", void 0);
|
|
@@ -605,7 +606,7 @@ __decorate([
|
|
|
605
606
|
example: '30-04-2024',
|
|
606
607
|
type: String,
|
|
607
608
|
}),
|
|
608
|
-
(0,
|
|
609
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
609
610
|
(0, class_validator_1.IsOptional)(),
|
|
610
611
|
(0, class_validator_1.IsString)(),
|
|
611
612
|
__metadata("design:type", String)
|
|
@@ -616,15 +617,22 @@ __decorate([
|
|
|
616
617
|
example: '28/03/2025 12:16',
|
|
617
618
|
type: String,
|
|
618
619
|
}),
|
|
619
|
-
(0,
|
|
620
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
620
621
|
(0, class_validator_1.IsOptional)(),
|
|
621
622
|
(0, class_validator_1.IsString)(),
|
|
622
623
|
__metadata("design:type", String)
|
|
623
624
|
], User.prototype, "_lastConnected", void 0);
|
|
624
625
|
exports.User = User = __decorate([
|
|
625
|
-
(0,
|
|
626
|
+
(0, mongoose_1.Schema)({
|
|
626
627
|
id: false,
|
|
627
628
|
timestamps: true,
|
|
628
629
|
})
|
|
629
630
|
], User);
|
|
630
|
-
exports.UserSchema =
|
|
631
|
+
exports.UserSchema = mongoose_1.SchemaFactory.createForClass(User);
|
|
632
|
+
// Hook pre-save pour générer automatiquement un UUID si _id n'est pas fourni
|
|
633
|
+
exports.UserSchema.pre('save', function (next) {
|
|
634
|
+
if (!this._id) {
|
|
635
|
+
this._id = (0, uuid_1.v4)();
|
|
636
|
+
}
|
|
637
|
+
next();
|
|
638
|
+
});
|
|
@@ -9,6 +9,7 @@ var SiteType;
|
|
|
9
9
|
})(SiteType || (exports.SiteType = SiteType = {}));
|
|
10
10
|
var Profiles;
|
|
11
11
|
(function (Profiles) {
|
|
12
|
+
Profiles["NONE"] = "NONE";
|
|
12
13
|
Profiles["RES_BASE_INF_6"] = "RES_BASE_INF_6";
|
|
13
14
|
Profiles["RES_BASE_SUP_6"] = "RES_BASE_SUP_6";
|
|
14
15
|
Profiles["RES_HP_HC"] = "RES_HP_HC";
|