emilsoftware-utilities 1.4.0-dev.9 → 1.5.0-dev.1
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/accessi-module/AccessiModule.d.ts +10 -2
- package/dist/accessi-module/AccessiModule.js +3 -14
- package/dist/accessi-module/Controllers/EmailController.d.ts +0 -1
- package/dist/accessi-module/Controllers/EmailController.js +27 -15
- package/dist/accessi-module/Controllers/UserController.d.ts +2 -0
- package/dist/accessi-module/Controllers/UserController.js +132 -30
- package/dist/accessi-module/Dtos/FiltriUtente.d.ts +3 -2
- package/dist/accessi-module/Dtos/FiltriUtente.js +10 -6
- package/dist/accessi-module/Dtos/RegisterRequest.d.ts +5 -5
- package/dist/accessi-module/Dtos/RegisterRequest.js +16 -16
- package/dist/accessi-module/Dtos/SetStatoRegistrazione.d.ts +5 -0
- package/dist/accessi-module/Dtos/SetStatoRegistrazione.js +32 -0
- package/dist/accessi-module/Dtos/StatoRegistrazione.d.ts +1 -0
- package/dist/accessi-module/Dtos/StatoRegistrazione.js +2 -1
- package/dist/accessi-module/Dtos/UserDto.d.ts +5 -4
- package/dist/accessi-module/Dtos/UserDto.js +85 -34
- package/dist/accessi-module/Services/EmailService/EmailService.d.ts +1 -1
- package/dist/accessi-module/Services/EmailService/EmailService.js +62 -32
- package/dist/accessi-module/Services/UserService/UserService.d.ts +10 -7
- package/dist/accessi-module/Services/UserService/UserService.js +125 -39
- package/dist/emilsoftware-utilities-1.5.0-dev.1.tgz +0 -0
- package/package.json +1 -1
- package/dist/emilsoftware-utilities-1.4.0-dev.9.tgz +0 -0
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @module AccessiModule
|
|
5
5
|
* @author mttdev382
|
|
6
6
|
*/
|
|
7
|
-
import { Options } from
|
|
8
|
-
import { DynamicModule } from
|
|
7
|
+
import { Options } from 'es-node-firebird';
|
|
8
|
+
import { DynamicModule } from '@nestjs/common';
|
|
9
9
|
export interface JwtOptions {
|
|
10
10
|
secret: string;
|
|
11
11
|
expiresIn: string;
|
|
@@ -29,7 +29,15 @@ export interface ExtensionFieldsOptions {
|
|
|
29
29
|
}
|
|
30
30
|
export interface AccessiOptions {
|
|
31
31
|
databaseOptions: Options;
|
|
32
|
+
/**
|
|
33
|
+
* Basepath del sito es: 'http://www.il-mio-sito.it/nome-progetto(se c'è)'
|
|
34
|
+
*/
|
|
32
35
|
confirmationEmailUrl: string;
|
|
36
|
+
/**
|
|
37
|
+
* Percorso della pagina di reset personalizzata es. http://localhost:4200/#/admin/reset-password
|
|
38
|
+
* N.B si sostituisce al confirmationMailURl
|
|
39
|
+
*/
|
|
40
|
+
customResetPage?: string;
|
|
33
41
|
confirmationEmailReturnUrl: string;
|
|
34
42
|
confirmationEmailPrefix?: string;
|
|
35
43
|
encryptionKey: string;
|
|
@@ -23,7 +23,7 @@ let AccessiModule = AccessiModule_1 = class AccessiModule {
|
|
|
23
23
|
module: AccessiModule_1,
|
|
24
24
|
providers: [
|
|
25
25
|
{
|
|
26
|
-
provide:
|
|
26
|
+
provide: 'ACCESSI_OPTIONS',
|
|
27
27
|
useValue: options,
|
|
28
28
|
},
|
|
29
29
|
AuthService_1.AuthService,
|
|
@@ -31,13 +31,7 @@ let AccessiModule = AccessiModule_1 = class AccessiModule {
|
|
|
31
31
|
EmailService_1.EmailService,
|
|
32
32
|
PermissionService_1.PermissionService,
|
|
33
33
|
],
|
|
34
|
-
exports: [
|
|
35
|
-
"ACCESSI_OPTIONS",
|
|
36
|
-
AuthService_1.AuthService,
|
|
37
|
-
UserService_1.UserService,
|
|
38
|
-
EmailService_1.EmailService,
|
|
39
|
-
PermissionService_1.PermissionService,
|
|
40
|
-
],
|
|
34
|
+
exports: ['ACCESSI_OPTIONS', AuthService_1.AuthService, UserService_1.UserService, EmailService_1.EmailService, PermissionService_1.PermissionService],
|
|
41
35
|
};
|
|
42
36
|
}
|
|
43
37
|
};
|
|
@@ -45,12 +39,7 @@ exports.AccessiModule = AccessiModule;
|
|
|
45
39
|
exports.AccessiModule = AccessiModule = AccessiModule_1 = __decorate([
|
|
46
40
|
(0, common_1.Global)(),
|
|
47
41
|
(0, common_1.Module)({
|
|
48
|
-
controllers: [
|
|
49
|
-
EmailController_1.EmailController,
|
|
50
|
-
AuthController_1.AuthController,
|
|
51
|
-
PermissionController_1.PermissionController,
|
|
52
|
-
UserController_1.UserController,
|
|
53
|
-
],
|
|
42
|
+
controllers: [EmailController_1.EmailController, AuthController_1.AuthController, PermissionController_1.PermissionController, UserController_1.UserController],
|
|
54
43
|
providers: [AuthService_1.AuthService, UserService_1.UserService, EmailService_1.EmailService, PermissionService_1.PermissionService],
|
|
55
44
|
exports: [AuthService_1.AuthService, UserService_1.UserService, EmailService_1.EmailService, PermissionService_1.PermissionService],
|
|
56
45
|
})
|
|
@@ -8,7 +8,6 @@ export declare class EmailController {
|
|
|
8
8
|
serveResetPasswordPage(res: Response, token: string, returnUrl?: string): Promise<void>;
|
|
9
9
|
sendPasswordResetEmail(request: Request, sendResetPasswordData: {
|
|
10
10
|
email: string;
|
|
11
|
-
resetUrlCustom?: string;
|
|
12
11
|
htmlMail?: string;
|
|
13
12
|
}, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
14
13
|
}
|
|
@@ -41,7 +41,7 @@ let EmailController = EmailController_1 = class EmailController {
|
|
|
41
41
|
sendPasswordResetEmail(request, sendResetPasswordData, res) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
try {
|
|
44
|
-
yield this.emailService.sendPasswordResetEmail(sendResetPasswordData.email, sendResetPasswordData.
|
|
44
|
+
yield this.emailService.sendPasswordResetEmail(sendResetPasswordData.email, sendResetPasswordData.htmlMail);
|
|
45
45
|
return Utilities_1.RestUtilities.sendOKMessage(res, "L'email di reset è stata inoltrata al destinatario.");
|
|
46
46
|
}
|
|
47
47
|
catch (error) {
|
|
@@ -52,9 +52,16 @@ let EmailController = EmailController_1 = class EmailController {
|
|
|
52
52
|
};
|
|
53
53
|
exports.EmailController = EmailController;
|
|
54
54
|
__decorate([
|
|
55
|
-
(0, swagger_1.ApiOperation)({
|
|
55
|
+
(0, swagger_1.ApiOperation)({
|
|
56
|
+
summary: 'Serve una pagina per il reset della password',
|
|
57
|
+
operationId: 'serveResetPasswordPage',
|
|
58
|
+
}),
|
|
56
59
|
(0, swagger_1.ApiParam)({ name: 'token', description: 'Token per il reset della password', required: true }),
|
|
57
|
-
(0, swagger_1.ApiQuery)({
|
|
60
|
+
(0, swagger_1.ApiQuery)({
|
|
61
|
+
name: 'returnUrl',
|
|
62
|
+
description: 'Url di ritorno della pagina. Default: https://google.com',
|
|
63
|
+
required: false,
|
|
64
|
+
}),
|
|
58
65
|
(0, swagger_1.ApiResponse)({ status: 200, description: 'Pagina di reset password servita con successo' }),
|
|
59
66
|
(0, common_1.Get)('reset-password-page/:token'),
|
|
60
67
|
__param(0, (0, common_1.Res)()),
|
|
@@ -65,25 +72,30 @@ __decorate([
|
|
|
65
72
|
__metadata("design:returntype", Promise)
|
|
66
73
|
], EmailController.prototype, "serveResetPasswordPage", null);
|
|
67
74
|
__decorate([
|
|
68
|
-
(0, swagger_1.ApiOperation)({
|
|
69
|
-
|
|
75
|
+
(0, swagger_1.ApiOperation)({
|
|
76
|
+
summary: 'Invia una e-mail per il reset della password',
|
|
77
|
+
operationId: 'sendPasswordResetEmail',
|
|
78
|
+
}),
|
|
79
|
+
(0, swagger_1.ApiBody)({
|
|
80
|
+
schema: {
|
|
81
|
+
properties: {
|
|
70
82
|
email: {
|
|
71
83
|
type: 'string',
|
|
72
|
-
description: "L'email dell'utente che richiede il reset"
|
|
73
|
-
},
|
|
74
|
-
resetUrlCustom: {
|
|
75
|
-
type: 'string',
|
|
76
|
-
description: "Pagina di reset della password personalizzata",
|
|
84
|
+
description: "L'email dell'utente che richiede il reset",
|
|
77
85
|
},
|
|
78
86
|
htmlMail: {
|
|
79
87
|
type: 'string',
|
|
80
|
-
description: 'Corpo della mail in HTML'
|
|
81
|
-
}
|
|
88
|
+
description: 'Corpo della mail in HTML',
|
|
89
|
+
},
|
|
82
90
|
},
|
|
83
|
-
required: ['email']
|
|
84
|
-
}
|
|
91
|
+
required: ['email'],
|
|
92
|
+
},
|
|
93
|
+
}),
|
|
85
94
|
(0, swagger_1.ApiResponse)({ status: 200, description: "L'email di reset è stata inviata con successo" }),
|
|
86
|
-
(0, swagger_1.ApiResponse)({
|
|
95
|
+
(0, swagger_1.ApiResponse)({
|
|
96
|
+
status: 400,
|
|
97
|
+
description: 'Errore nella richiesta: protocollo o host non impostati',
|
|
98
|
+
}),
|
|
87
99
|
(0, swagger_1.ApiResponse)({ status: 500, description: "Errore interno durante l'invio dell'email" }),
|
|
88
100
|
(0, common_1.Post)('send-reset-password-email'),
|
|
89
101
|
__param(0, (0, common_1.Req)()),
|
|
@@ -4,6 +4,7 @@ import { UserService } from '../Services/UserService/UserService';
|
|
|
4
4
|
import { EmailService } from '../Services/EmailService/EmailService';
|
|
5
5
|
import { UserDto } from '../Dtos';
|
|
6
6
|
import { RegisterRequest } from '../Dtos/RegisterRequest';
|
|
7
|
+
import { SetStatoRegistrazioneDto } from '../Dtos/SetStatoRegistrazione';
|
|
7
8
|
export declare class UserController {
|
|
8
9
|
private readonly userService;
|
|
9
10
|
private readonly emailService;
|
|
@@ -13,6 +14,7 @@ export declare class UserController {
|
|
|
13
14
|
serveResetPasswordPage(res: Response, token: string): Promise<void>;
|
|
14
15
|
getUsers(res: Response, email?: string, codiceUtente?: number, includeExtensionFields?: boolean, includeGrants?: boolean): Promise<Response<any, Record<string, any>>>;
|
|
15
16
|
deleteUser(codiceUtente: number, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
17
|
+
setStatoRegistrazione(body: SetStatoRegistrazioneDto, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
16
18
|
register(request: Request, registrationData: RegisterRequest, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
17
19
|
updateUtente(codiceUtente: number, user: UserDto, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
18
20
|
setGdpr(codiceUtente: number, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
@@ -34,6 +34,7 @@ const Dtos_1 = require("../Dtos");
|
|
|
34
34
|
const RegisterResponse_1 = require("../Dtos/RegisterResponse");
|
|
35
35
|
const RegisterRequest_1 = require("../Dtos/RegisterRequest");
|
|
36
36
|
const Logger_1 = require("../../Logger");
|
|
37
|
+
const SetStatoRegistrazione_1 = require("../Dtos/SetStatoRegistrazione");
|
|
37
38
|
let UserController = UserController_1 = class UserController {
|
|
38
39
|
constructor(userService, emailService, options) {
|
|
39
40
|
this.userService = userService;
|
|
@@ -50,7 +51,10 @@ let UserController = UserController_1 = class UserController {
|
|
|
50
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
52
|
try {
|
|
52
53
|
let filters = { email, codiceUtente };
|
|
53
|
-
let options = {
|
|
54
|
+
let options = {
|
|
55
|
+
includeExtensionFields: includeExtensionFields !== null && includeExtensionFields !== void 0 ? includeExtensionFields : true,
|
|
56
|
+
includeGrants: includeGrants !== null && includeGrants !== void 0 ? includeGrants : true,
|
|
57
|
+
};
|
|
54
58
|
const users = yield this.userService.getUsers(filters, options);
|
|
55
59
|
return Utilities_1.RestUtilities.sendBaseResponse(res, users);
|
|
56
60
|
}
|
|
@@ -73,11 +77,27 @@ let UserController = UserController_1 = class UserController {
|
|
|
73
77
|
}
|
|
74
78
|
});
|
|
75
79
|
}
|
|
80
|
+
setStatoRegistrazione(body, res) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
try {
|
|
83
|
+
let { codiceUtente, statoRegistrazione } = body;
|
|
84
|
+
if (!codiceUtente)
|
|
85
|
+
throw new Error('Il codice utente è obbligatorio.');
|
|
86
|
+
if (statoRegistrazione === undefined)
|
|
87
|
+
throw new Error('Lo stato registrazione è obbligatorio.');
|
|
88
|
+
yield this.userService.setStato(codiceUtente, statoRegistrazione);
|
|
89
|
+
return Utilities_1.RestUtilities.sendOKMessage(res, `Lo stato dell'utente ${codiceUtente} è stato aggiornato a ${statoRegistrazione}.`);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
return Utilities_1.RestUtilities.sendErrorMessage(res, error, UserController_1.name);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
76
96
|
register(request, registrationData, res) {
|
|
77
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
98
|
try {
|
|
79
99
|
const codiceUtente = yield this.userService.register(registrationData);
|
|
80
|
-
yield this.emailService.sendPasswordResetEmail(registrationData.email, registrationData.
|
|
100
|
+
yield this.emailService.sendPasswordResetEmail(registrationData.email, registrationData.htmlMail);
|
|
81
101
|
return Utilities_1.RestUtilities.sendBaseResponse(res, codiceUtente);
|
|
82
102
|
}
|
|
83
103
|
catch (error) {
|
|
@@ -89,7 +109,7 @@ let UserController = UserController_1 = class UserController {
|
|
|
89
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
110
|
try {
|
|
91
111
|
if (!codiceUtente)
|
|
92
|
-
throw new Error(
|
|
112
|
+
throw new Error('Il codice utente è obbligatorio.');
|
|
93
113
|
yield this.userService.updateUser(codiceUtente, user);
|
|
94
114
|
return Utilities_1.RestUtilities.sendOKMessage(res, `L'utente ${codiceUtente} è stato aggiornato con successo.`);
|
|
95
115
|
}
|
|
@@ -102,7 +122,7 @@ let UserController = UserController_1 = class UserController {
|
|
|
102
122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
123
|
try {
|
|
104
124
|
if (!codiceUtente)
|
|
105
|
-
throw new Error(
|
|
125
|
+
throw new Error('Il codice utente è obbligatorio.');
|
|
106
126
|
yield this.userService.setGdpr(codiceUtente);
|
|
107
127
|
return Utilities_1.RestUtilities.sendOKMessage(res, `L'utente ${codiceUtente} ha accettato il GDPR.`);
|
|
108
128
|
}
|
|
@@ -114,8 +134,15 @@ let UserController = UserController_1 = class UserController {
|
|
|
114
134
|
};
|
|
115
135
|
exports.UserController = UserController;
|
|
116
136
|
__decorate([
|
|
117
|
-
(0, swagger_1.ApiOperation)({
|
|
118
|
-
|
|
137
|
+
(0, swagger_1.ApiOperation)({
|
|
138
|
+
summary: 'Servire la pagina di reset password',
|
|
139
|
+
operationId: 'serveResetPasswordPageUser',
|
|
140
|
+
}),
|
|
141
|
+
(0, swagger_1.ApiParam)({
|
|
142
|
+
name: 'token',
|
|
143
|
+
description: 'Token per il reset della password',
|
|
144
|
+
required: true,
|
|
145
|
+
}),
|
|
119
146
|
(0, common_1.Get)('reset-password/:token'),
|
|
120
147
|
__param(0, (0, common_1.Res)()),
|
|
121
148
|
__param(1, (0, common_1.Param)('token')),
|
|
@@ -124,13 +151,36 @@ __decorate([
|
|
|
124
151
|
__metadata("design:returntype", Promise)
|
|
125
152
|
], UserController.prototype, "serveResetPasswordPage", null);
|
|
126
153
|
__decorate([
|
|
127
|
-
(0, swagger_1.ApiOperation)({
|
|
128
|
-
|
|
154
|
+
(0, swagger_1.ApiOperation)({
|
|
155
|
+
summary: 'Recupera la lista degli utenti',
|
|
156
|
+
operationId: 'getUsers',
|
|
157
|
+
}),
|
|
158
|
+
(0, swagger_1.ApiResponse)({
|
|
159
|
+
status: 200,
|
|
160
|
+
description: 'Lista utenti recuperata con successo',
|
|
161
|
+
type: GetUsersResponse_1.GetUsersResponse,
|
|
162
|
+
}),
|
|
129
163
|
(0, swagger_1.ApiResponse)({ status: 401, description: 'Credenziali non valide' }),
|
|
130
|
-
(0, swagger_1.ApiQuery)({
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
164
|
+
(0, swagger_1.ApiQuery)({
|
|
165
|
+
name: 'email',
|
|
166
|
+
required: false,
|
|
167
|
+
description: "Email dell'utente da cercare",
|
|
168
|
+
}),
|
|
169
|
+
(0, swagger_1.ApiQuery)({
|
|
170
|
+
name: 'codiceUtente',
|
|
171
|
+
required: false,
|
|
172
|
+
description: "Codice dell'utente da cercare",
|
|
173
|
+
}),
|
|
174
|
+
(0, swagger_1.ApiQuery)({
|
|
175
|
+
name: 'includeExtensionFields',
|
|
176
|
+
required: false,
|
|
177
|
+
description: 'Includi extension fields (chiamata più pesante)',
|
|
178
|
+
}),
|
|
179
|
+
(0, swagger_1.ApiQuery)({
|
|
180
|
+
name: 'includeGrants',
|
|
181
|
+
required: false,
|
|
182
|
+
description: 'Includi Permessi (chiamata più pesante)',
|
|
183
|
+
}),
|
|
134
184
|
(0, common_1.Get)('get-users'),
|
|
135
185
|
__param(0, (0, common_1.Res)()),
|
|
136
186
|
__param(1, (0, common_1.Query)('email')),
|
|
@@ -142,16 +192,24 @@ __decorate([
|
|
|
142
192
|
__metadata("design:returntype", Promise)
|
|
143
193
|
], UserController.prototype, "getUsers", null);
|
|
144
194
|
__decorate([
|
|
145
|
-
(0, swagger_1.ApiOperation)({
|
|
195
|
+
(0, swagger_1.ApiOperation)({
|
|
196
|
+
summary: 'Elimina un utente',
|
|
197
|
+
operationId: 'deleteUser',
|
|
198
|
+
description: `Imposta lo stato di un utente a 50(eliminato)
|
|
199
|
+
Non esegue una eliminazione dei record`,
|
|
200
|
+
}),
|
|
146
201
|
(0, swagger_1.ApiParam)({
|
|
147
202
|
name: 'codiceUtente',
|
|
148
203
|
description: "Codice identificativo dell'utente da eliminare",
|
|
149
204
|
required: true,
|
|
150
|
-
example:
|
|
205
|
+
example: 'USR123',
|
|
206
|
+
}),
|
|
207
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Utente eliminato con successo' }),
|
|
208
|
+
(0, swagger_1.ApiResponse)({
|
|
209
|
+
status: 400,
|
|
210
|
+
description: 'Errore nei parametri della richiesta',
|
|
151
211
|
}),
|
|
152
|
-
(0, swagger_1.ApiResponse)({ status:
|
|
153
|
-
(0, swagger_1.ApiResponse)({ status: 400, description: "Errore nei parametri della richiesta" }),
|
|
154
|
-
(0, swagger_1.ApiResponse)({ status: 500, description: "Errore interno del server" }),
|
|
212
|
+
(0, swagger_1.ApiResponse)({ status: 500, description: 'Errore interno del server' }),
|
|
155
213
|
(0, common_1.Delete)('delete-user/:codiceUtente'),
|
|
156
214
|
__param(0, (0, common_1.Param)('codiceUtente')),
|
|
157
215
|
__param(1, (0, common_1.Res)()),
|
|
@@ -159,6 +217,38 @@ __decorate([
|
|
|
159
217
|
__metadata("design:paramtypes", [Number, Object]),
|
|
160
218
|
__metadata("design:returntype", Promise)
|
|
161
219
|
], UserController.prototype, "deleteUser", null);
|
|
220
|
+
__decorate([
|
|
221
|
+
(0, swagger_1.ApiOperation)({
|
|
222
|
+
summary: 'Imposta lo stato di registrazione di un utente',
|
|
223
|
+
operationId: 'setStatoRegistrazione',
|
|
224
|
+
description: `Imposta lo stato di registrazione di un utente. Stati possibili:
|
|
225
|
+
- 0: NULL (non definito)
|
|
226
|
+
- 5: INSERT (inserito)
|
|
227
|
+
- 10: INVIO (inviato)
|
|
228
|
+
- 20: CONF (confermato)
|
|
229
|
+
- 50: DELETE (eliminato)
|
|
230
|
+
- 99: BLOCC (bloccato)`,
|
|
231
|
+
}),
|
|
232
|
+
(0, swagger_1.ApiResponse)({
|
|
233
|
+
status: 200,
|
|
234
|
+
description: 'Stato registrazione aggiornato con successo',
|
|
235
|
+
}),
|
|
236
|
+
(0, swagger_1.ApiResponse)({
|
|
237
|
+
status: 400,
|
|
238
|
+
description: 'Errore nei parametri della richiesta',
|
|
239
|
+
}),
|
|
240
|
+
(0, swagger_1.ApiResponse)({
|
|
241
|
+
status: 500,
|
|
242
|
+
description: 'Errore interno del server',
|
|
243
|
+
}),
|
|
244
|
+
(0, swagger_1.ApiBody)({ type: SetStatoRegistrazione_1.SetStatoRegistrazioneDto }),
|
|
245
|
+
(0, common_1.Post)('set-stato'),
|
|
246
|
+
__param(0, (0, common_1.Body)()),
|
|
247
|
+
__param(1, (0, common_1.Res)()),
|
|
248
|
+
__metadata("design:type", Function),
|
|
249
|
+
__metadata("design:paramtypes", [SetStatoRegistrazione_1.SetStatoRegistrazioneDto, Object]),
|
|
250
|
+
__metadata("design:returntype", Promise)
|
|
251
|
+
], UserController.prototype, "setStatoRegistrazione", null);
|
|
162
252
|
__decorate([
|
|
163
253
|
(0, swagger_1.ApiOperation)({
|
|
164
254
|
summary: 'Registra un nuovo utente',
|
|
@@ -166,19 +256,19 @@ __decorate([
|
|
|
166
256
|
}),
|
|
167
257
|
(0, swagger_1.ApiBody)({
|
|
168
258
|
type: RegisterRequest_1.RegisterRequest,
|
|
169
|
-
description: "Dati necessari per la registrazione dell'utente"
|
|
259
|
+
description: "Dati necessari per la registrazione dell'utente",
|
|
170
260
|
}),
|
|
171
261
|
(0, swagger_1.ApiCreatedResponse)({
|
|
172
262
|
description: 'Utente registrato con successo. Restituisce il codice utente e invia una mail di conferma/reset password.',
|
|
173
|
-
type: RegisterResponse_1.RegisterResponse
|
|
263
|
+
type: RegisterResponse_1.RegisterResponse,
|
|
174
264
|
}),
|
|
175
265
|
(0, swagger_1.ApiResponse)({
|
|
176
266
|
status: common_1.HttpStatus.BAD_REQUEST,
|
|
177
|
-
description: 'Errore nella registrazione. Potrebbe essere dovuto a dati mancanti, email già esistente o configurazione non valida.'
|
|
267
|
+
description: 'Errore nella registrazione. Potrebbe essere dovuto a dati mancanti, email già esistente o configurazione non valida.',
|
|
178
268
|
}),
|
|
179
269
|
(0, swagger_1.ApiResponse)({
|
|
180
270
|
status: common_1.HttpStatus.INTERNAL_SERVER_ERROR,
|
|
181
|
-
description: 'Errore interno del server durante la registrazione o l’invio dell’email.'
|
|
271
|
+
description: 'Errore interno del server durante la registrazione o l’invio dell’email.',
|
|
182
272
|
}),
|
|
183
273
|
(0, common_1.Post)('register'),
|
|
184
274
|
__param(0, (0, common_1.Req)()),
|
|
@@ -189,18 +279,24 @@ __decorate([
|
|
|
189
279
|
__metadata("design:returntype", Promise)
|
|
190
280
|
], UserController.prototype, "register", null);
|
|
191
281
|
__decorate([
|
|
192
|
-
(0, swagger_1.ApiOperation)({
|
|
282
|
+
(0, swagger_1.ApiOperation)({
|
|
283
|
+
summary: 'Aggiorna un utente esistente',
|
|
284
|
+
operationId: 'updateUtente',
|
|
285
|
+
}),
|
|
193
286
|
(0, swagger_1.ApiParam)({
|
|
194
287
|
name: 'codiceUtente',
|
|
195
288
|
description: "Codice identificativo dell'utente da aggiornare",
|
|
196
289
|
required: true,
|
|
197
|
-
example:
|
|
290
|
+
example: 'USR123',
|
|
198
291
|
}),
|
|
199
292
|
(0, swagger_1.ApiBody)({
|
|
200
293
|
type: Dtos_1.UserDto,
|
|
201
|
-
description: "Dati aggiornati dell'utente (escluso il codice utente, che è nel path)"
|
|
294
|
+
description: "Dati aggiornati dell'utente (escluso il codice utente, che è nel path)",
|
|
295
|
+
}),
|
|
296
|
+
(0, swagger_1.ApiResponse)({
|
|
297
|
+
status: common_1.HttpStatus.OK,
|
|
298
|
+
description: 'Utente aggiornato con successo',
|
|
202
299
|
}),
|
|
203
|
-
(0, swagger_1.ApiResponse)({ status: common_1.HttpStatus.OK, description: "Utente aggiornato con successo" }),
|
|
204
300
|
(0, swagger_1.ApiResponse)({ status: 400, description: "Errore nell'aggiornamento" }),
|
|
205
301
|
(0, common_1.Put)('update-user/:codiceUtente'),
|
|
206
302
|
__param(0, (0, common_1.Param)('codiceUtente')),
|
|
@@ -211,15 +307,21 @@ __decorate([
|
|
|
211
307
|
__metadata("design:returntype", Promise)
|
|
212
308
|
], UserController.prototype, "updateUtente", null);
|
|
213
309
|
__decorate([
|
|
214
|
-
(0, swagger_1.ApiOperation)({
|
|
310
|
+
(0, swagger_1.ApiOperation)({
|
|
311
|
+
summary: 'Imposta il consenso GDPR per un utente',
|
|
312
|
+
operationId: 'setGdpr',
|
|
313
|
+
}),
|
|
215
314
|
(0, swagger_1.ApiParam)({
|
|
216
|
-
name:
|
|
315
|
+
name: 'codiceUtente',
|
|
217
316
|
description: "Codice identificativo dell'utente che accetta il GDPR",
|
|
218
317
|
required: true,
|
|
219
|
-
example:
|
|
318
|
+
example: 'USR123',
|
|
319
|
+
}),
|
|
320
|
+
(0, swagger_1.ApiResponse)({
|
|
321
|
+
status: 200,
|
|
322
|
+
description: 'Consenso GDPR impostato con successo',
|
|
220
323
|
}),
|
|
221
|
-
(0, swagger_1.ApiResponse)({ status:
|
|
222
|
-
(0, swagger_1.ApiResponse)({ status: 400, description: "Errore nella richiesta" }),
|
|
324
|
+
(0, swagger_1.ApiResponse)({ status: 400, description: 'Errore nella richiesta' }),
|
|
223
325
|
(0, common_1.Patch)('set-gdpr/:codiceUtente'),
|
|
224
326
|
__param(0, (0, common_1.Param)('codiceUtente')),
|
|
225
327
|
__param(1, (0, common_1.Res)()),
|
|
@@ -3,8 +3,9 @@ export declare class FiltriUtente {
|
|
|
3
3
|
numeroReport?: number;
|
|
4
4
|
indicePersonale?: number;
|
|
5
5
|
codiceClienteSuper?: string | null;
|
|
6
|
-
|
|
6
|
+
codAge?: number;
|
|
7
7
|
codiceClienteCollegato?: string;
|
|
8
8
|
codiceClienti?: string;
|
|
9
|
-
tipoFiltro?:
|
|
9
|
+
tipoFiltro?: number;
|
|
10
|
+
idxPostazione?: number;
|
|
10
11
|
}
|
|
@@ -51,13 +51,13 @@ __decorate([
|
|
|
51
51
|
], FiltriUtente.prototype, "codiceClienteSuper", void 0);
|
|
52
52
|
__decorate([
|
|
53
53
|
(0, swagger_1.ApiPropertyOptional)({
|
|
54
|
-
description: 'Codice dell\'
|
|
55
|
-
example:
|
|
54
|
+
description: 'Codice dell\'agente associato',
|
|
55
|
+
example: 1
|
|
56
56
|
}),
|
|
57
|
-
(0, class_validator_1.
|
|
57
|
+
(0, class_validator_1.IsNumber)(),
|
|
58
58
|
(0, class_validator_1.IsOptional)(),
|
|
59
|
-
__metadata("design:type",
|
|
60
|
-
], FiltriUtente.prototype, "
|
|
59
|
+
__metadata("design:type", Number)
|
|
60
|
+
], FiltriUtente.prototype, "codAge", void 0);
|
|
61
61
|
__decorate([
|
|
62
62
|
(0, swagger_1.ApiPropertyOptional)({
|
|
63
63
|
description: 'Codice del cliente collegato',
|
|
@@ -83,5 +83,9 @@ __decorate([
|
|
|
83
83
|
}),
|
|
84
84
|
(0, class_validator_1.IsString)(),
|
|
85
85
|
(0, class_validator_1.IsOptional)(),
|
|
86
|
-
__metadata("design:type",
|
|
86
|
+
__metadata("design:type", Number)
|
|
87
87
|
], FiltriUtente.prototype, "tipoFiltro", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "idx della postazione nella tabella ANTENNE_POS di PROLAV", example: "12" }),
|
|
90
|
+
__metadata("design:type", Number)
|
|
91
|
+
], FiltriUtente.prototype, "idxPostazione", void 0);
|
|
@@ -9,15 +9,15 @@ export declare class RegisterRequest {
|
|
|
9
9
|
permissions?: Permission[];
|
|
10
10
|
numeroReport?: number;
|
|
11
11
|
indicePersonale?: number;
|
|
12
|
-
codiceClienteSuper?:
|
|
13
|
-
|
|
14
|
-
codiceClienteCollegato?:
|
|
12
|
+
codiceClienteSuper?: number;
|
|
13
|
+
codAge?: number;
|
|
14
|
+
codiceClienteCollegato?: number;
|
|
15
15
|
codiceClienti?: string;
|
|
16
|
-
tipoFiltro?:
|
|
16
|
+
tipoFiltro?: number;
|
|
17
17
|
avatar?: string;
|
|
18
18
|
flagDueFattori?: boolean;
|
|
19
19
|
paginaDefault?: string;
|
|
20
20
|
ragSocCli?: string;
|
|
21
|
-
resetUrlCustom?: string;
|
|
22
21
|
htmlMail?: string;
|
|
22
|
+
idxPostazione?: number;
|
|
23
23
|
}
|
|
@@ -83,23 +83,23 @@ __decorate([
|
|
|
83
83
|
__decorate([
|
|
84
84
|
(0, swagger_1.ApiPropertyOptional)({
|
|
85
85
|
description: "Codice del cliente principale (super).",
|
|
86
|
-
example:
|
|
86
|
+
example: 123,
|
|
87
87
|
}),
|
|
88
|
-
__metadata("design:type",
|
|
88
|
+
__metadata("design:type", Number)
|
|
89
89
|
], RegisterRequest.prototype, "codiceClienteSuper", void 0);
|
|
90
90
|
__decorate([
|
|
91
91
|
(0, swagger_1.ApiPropertyOptional)({
|
|
92
|
-
description: "Codice dell'
|
|
93
|
-
example:
|
|
92
|
+
description: "Codice dell'agen te associato.",
|
|
93
|
+
example: 123,
|
|
94
94
|
}),
|
|
95
|
-
__metadata("design:type",
|
|
96
|
-
], RegisterRequest.prototype, "
|
|
95
|
+
__metadata("design:type", Number)
|
|
96
|
+
], RegisterRequest.prototype, "codAge", void 0);
|
|
97
97
|
__decorate([
|
|
98
98
|
(0, swagger_1.ApiPropertyOptional)({
|
|
99
99
|
description: "Codice del cliente collegato.",
|
|
100
|
-
example: "
|
|
100
|
+
example: "123",
|
|
101
101
|
}),
|
|
102
|
-
__metadata("design:type",
|
|
102
|
+
__metadata("design:type", Number)
|
|
103
103
|
], RegisterRequest.prototype, "codiceClienteCollegato", void 0);
|
|
104
104
|
__decorate([
|
|
105
105
|
(0, swagger_1.ApiPropertyOptional)({
|
|
@@ -113,7 +113,7 @@ __decorate([
|
|
|
113
113
|
description: "Tipo di filtro applicato.",
|
|
114
114
|
example: "esclusivo",
|
|
115
115
|
}),
|
|
116
|
-
__metadata("design:type",
|
|
116
|
+
__metadata("design:type", Number)
|
|
117
117
|
], RegisterRequest.prototype, "tipoFiltro", void 0);
|
|
118
118
|
__decorate([
|
|
119
119
|
(0, swagger_1.ApiPropertyOptional)({
|
|
@@ -143,13 +143,6 @@ __decorate([
|
|
|
143
143
|
}),
|
|
144
144
|
__metadata("design:type", String)
|
|
145
145
|
], RegisterRequest.prototype, "ragSocCli", void 0);
|
|
146
|
-
__decorate([
|
|
147
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
148
|
-
description: "Link a una pagina di reset personalizzata",
|
|
149
|
-
example: "http://www.mio-progetto.it/reset-password",
|
|
150
|
-
}),
|
|
151
|
-
__metadata("design:type", String)
|
|
152
|
-
], RegisterRequest.prototype, "resetUrlCustom", void 0);
|
|
153
146
|
__decorate([
|
|
154
147
|
(0, swagger_1.ApiPropertyOptional)({
|
|
155
148
|
description: "HTML mail personalizzato",
|
|
@@ -157,3 +150,10 @@ __decorate([
|
|
|
157
150
|
}),
|
|
158
151
|
__metadata("design:type", String)
|
|
159
152
|
], RegisterRequest.prototype, "htmlMail", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
155
|
+
description: 'idx della postazione nella tabella ANTENNE_POS di PROLAV',
|
|
156
|
+
example: '12',
|
|
157
|
+
}),
|
|
158
|
+
__metadata("design:type", Number)
|
|
159
|
+
], RegisterRequest.prototype, "idxPostazione", void 0);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SetStatoRegistrazioneDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const StatoRegistrazione_1 = require("./StatoRegistrazione");
|
|
15
|
+
class SetStatoRegistrazioneDto {
|
|
16
|
+
}
|
|
17
|
+
exports.SetStatoRegistrazioneDto = SetStatoRegistrazioneDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({
|
|
20
|
+
description: "Codice identificativo dell'utente",
|
|
21
|
+
example: 123,
|
|
22
|
+
}),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], SetStatoRegistrazioneDto.prototype, "codiceUtente", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, swagger_1.ApiProperty)({
|
|
27
|
+
description: 'Nuovo stato di registrazione',
|
|
28
|
+
enum: StatoRegistrazione_1.StatoRegistrazione,
|
|
29
|
+
example: StatoRegistrazione_1.StatoRegistrazione.DELETE,
|
|
30
|
+
}),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], SetStatoRegistrazioneDto.prototype, "statoRegistrazione", void 0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StatoRegistrazione = void 0;
|
|
3
|
+
exports.StatoRegistrazioneValues = exports.StatoRegistrazione = void 0;
|
|
4
4
|
var StatoRegistrazione;
|
|
5
5
|
(function (StatoRegistrazione) {
|
|
6
6
|
StatoRegistrazione[StatoRegistrazione["NULL"] = 0] = "NULL";
|
|
@@ -10,3 +10,4 @@ var StatoRegistrazione;
|
|
|
10
10
|
StatoRegistrazione[StatoRegistrazione["DELETE"] = 50] = "DELETE";
|
|
11
11
|
StatoRegistrazione[StatoRegistrazione["BLOCC"] = 99] = "BLOCC";
|
|
12
12
|
})(StatoRegistrazione || (exports.StatoRegistrazione = StatoRegistrazione = {}));
|
|
13
|
+
exports.StatoRegistrazioneValues = [0, 5, 10, 20, 50, 99];
|
|
@@ -25,9 +25,10 @@ export declare class UserDto {
|
|
|
25
25
|
prog?: number;
|
|
26
26
|
numRep?: number;
|
|
27
27
|
idxPers?: number;
|
|
28
|
-
codiceClienteSuper?:
|
|
29
|
-
|
|
30
|
-
codiceClienteCol?:
|
|
28
|
+
codiceClienteSuper?: number;
|
|
29
|
+
codAge?: number;
|
|
30
|
+
codiceClienteCol?: number;
|
|
31
31
|
codiceClienti?: string;
|
|
32
|
-
|
|
32
|
+
tipoFiltro?: number;
|
|
33
|
+
idxPostazione?: number;
|
|
33
34
|
}
|