emilsoftware-utilities 1.3.104 → 1.3.106
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/Controllers/AccessiController.d.ts +2 -2
- package/dist/accessi-module/Controllers/AccessiController.js +1 -1
- package/dist/accessi-module/Controllers/AuthController.js +1 -1
- package/dist/accessi-module/Controllers/PermissionController.js +4 -3
- package/dist/accessi-module/Controllers/UserController.d.ts +3 -3
- package/dist/accessi-module/Controllers/UserController.js +6 -5
- package/dist/accessi-module/Dtos/BaseResponse.d.ts +3 -4
- package/dist/accessi-module/Dtos/BaseResponse.js +8 -12
- package/dist/accessi-module/Dtos/GetRolesResponse.d.ts +5 -0
- package/dist/accessi-module/Dtos/GetRolesResponse.js +26 -0
- package/dist/accessi-module/Dtos/GetUsersResponse.d.ts +4 -27
- package/dist/accessi-module/Dtos/GetUsersResponse.js +10 -236
- package/dist/accessi-module/Dtos/LoginResponse.d.ts +7 -3
- package/dist/accessi-module/Dtos/LoginResponse.js +37 -15
- package/dist/accessi-module/Dtos/UserDto.d.ts +32 -0
- package/dist/accessi-module/Dtos/UserDto.js +129 -0
- package/dist/accessi-module/Dtos/index.d.ts +1 -1
- package/dist/accessi-module/Dtos/index.js +1 -1
- package/dist/accessi-module/Services/AuthService/AuthService.d.ts +4 -4
- package/dist/accessi-module/Services/UserService/UserService.d.ts +4 -4
- package/dist/accessi-module/Services/UserService/UserService.js +64 -12
- package/package.json +1 -1
- package/dist/accessi-module/Dtos/User.d.ts +0 -20
- package/dist/accessi-module/Dtos/User.js +0 -132
|
@@ -4,7 +4,7 @@ import { AuthService } from '../Services/AuthService/AuthService';
|
|
|
4
4
|
import { PermissionService } from '../Services/PermissionService/PermissionService';
|
|
5
5
|
import { UserService } from '../Services/UserService/UserService';
|
|
6
6
|
import { EmailService } from '../Services/EmailService/EmailService';
|
|
7
|
-
import {
|
|
7
|
+
import { UserDto } from '../Dtos';
|
|
8
8
|
export declare class AccessiController {
|
|
9
9
|
private readonly userService;
|
|
10
10
|
private readonly authService;
|
|
@@ -21,7 +21,7 @@ export declare class AccessiController {
|
|
|
21
21
|
}, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
22
22
|
getUsers(res: Response): Promise<Response<any, Record<string, any>>>;
|
|
23
23
|
deleteUser(codiceUtente: number, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
24
|
-
register(request: Request, registrationData:
|
|
24
|
+
register(request: Request, registrationData: UserDto, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
25
25
|
encrypt(data: string, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
26
26
|
decrypt(data: string, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
27
27
|
resetAbilitazioni(codiceUtente: number, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
@@ -281,7 +281,7 @@ __decorate([
|
|
|
281
281
|
__param(1, (0, common_1.Body)()),
|
|
282
282
|
__param(2, (0, common_1.Res)()),
|
|
283
283
|
__metadata("design:type", Function),
|
|
284
|
-
__metadata("design:paramtypes", [Request, Dtos_1.
|
|
284
|
+
__metadata("design:paramtypes", [Request, Dtos_1.UserDto, Object]),
|
|
285
285
|
__metadata("design:returntype", Promise)
|
|
286
286
|
], AccessiController.prototype, "register", null);
|
|
287
287
|
__decorate([
|
|
@@ -30,7 +30,8 @@ const PermissionService_1 = require("../Services/PermissionService/PermissionSer
|
|
|
30
30
|
const Role_1 = require("../Dtos/Role");
|
|
31
31
|
const AssignRolesToUserRequest_1 = require("../Dtos/AssignRolesToUserRequest");
|
|
32
32
|
const AssignPermissionsToUserRequest_1 = require("../Dtos/AssignPermissionsToUserRequest");
|
|
33
|
-
const
|
|
33
|
+
const GetMenusResponse_1 = require("../Dtos/GetMenusResponse");
|
|
34
|
+
const GetRolesResponse_1 = require("../Dtos/GetRolesResponse");
|
|
34
35
|
let PermissionController = PermissionController_1 = class PermissionController {
|
|
35
36
|
constructor(permissionService, options) {
|
|
36
37
|
this.permissionService = permissionService;
|
|
@@ -159,7 +160,7 @@ let PermissionController = PermissionController_1 = class PermissionController {
|
|
|
159
160
|
exports.PermissionController = PermissionController;
|
|
160
161
|
__decorate([
|
|
161
162
|
(0, swagger_1.ApiOperation)({ summary: 'Ritorna i ruoli disponibili con i relativi menù', operationId: "getRoles", description: 'Recupera tutti i ruoli presenti nel sistema con le relative voci di menu accessibili.' }),
|
|
162
|
-
(0, swagger_1.ApiOkResponse)({ description: 'Elenco dei ruoli con i rispettivi menù', type:
|
|
163
|
+
(0, swagger_1.ApiOkResponse)({ description: 'Elenco dei ruoli con i rispettivi menù', type: GetRolesResponse_1.GetRolesResponse }),
|
|
163
164
|
(0, swagger_1.ApiInternalServerErrorResponse)({ description: 'Errore interno del server' }),
|
|
164
165
|
(0, swagger_1.ApiResponse)({ status: common_1.HttpStatus.OK, description: 'Lista dei ruoli con i menù restituita con successo.' }),
|
|
165
166
|
(0, swagger_1.ApiResponse)({ status: common_1.HttpStatus.INTERNAL_SERVER_ERROR, description: 'Errore interno del server durante il recupero dei ruoli.' }),
|
|
@@ -275,7 +276,7 @@ __decorate([
|
|
|
275
276
|
], PermissionController.prototype, "deleteRole", null);
|
|
276
277
|
__decorate([
|
|
277
278
|
(0, swagger_1.ApiOperation)({ summary: 'Recupera tutti i menù disponibili', operationId: "getMenus" }),
|
|
278
|
-
(0, swagger_1.ApiOkResponse)({ description: 'Elenco menù', type:
|
|
279
|
+
(0, swagger_1.ApiOkResponse)({ description: 'Elenco menù', type: GetMenusResponse_1.MenuEntity }),
|
|
279
280
|
(0, swagger_1.ApiResponse)({ status: 200, description: "Lista dei menù recuperata con successo" }),
|
|
280
281
|
(0, swagger_1.ApiResponse)({ status: 500, description: "Errore interno del server" }),
|
|
281
282
|
(0, common_1.Get)('menus'),
|
|
@@ -2,7 +2,7 @@ import { Response, Request } from 'express';
|
|
|
2
2
|
import { AccessiOptions } from '../AccessiModule';
|
|
3
3
|
import { UserService } from '../Services/UserService/UserService';
|
|
4
4
|
import { EmailService } from '../Services/EmailService/EmailService';
|
|
5
|
-
import {
|
|
5
|
+
import { UserDto } from '../Dtos';
|
|
6
6
|
export declare class UserController {
|
|
7
7
|
private readonly userService;
|
|
8
8
|
private readonly emailService;
|
|
@@ -11,7 +11,7 @@ export declare class UserController {
|
|
|
11
11
|
serveResetPasswordPage(res: Response, token: string): Promise<void>;
|
|
12
12
|
getUsers(res: Response): Promise<Response<any, Record<string, any>>>;
|
|
13
13
|
deleteUser(codiceUtente: number, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
14
|
-
register(request: Request, registrationData:
|
|
15
|
-
updateUtente(codiceUtente: number, user:
|
|
14
|
+
register(request: Request, registrationData: UserDto, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
15
|
+
updateUtente(codiceUtente: number, user: UserDto, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
16
16
|
setGdpr(codiceUtente: number, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
17
17
|
}
|
|
@@ -29,6 +29,7 @@ const Utilities_1 = require("../../Utilities");
|
|
|
29
29
|
const UserService_1 = require("../Services/UserService/UserService");
|
|
30
30
|
const EmailService_1 = require("../Services/EmailService/EmailService");
|
|
31
31
|
const path_1 = require("path");
|
|
32
|
+
const GetUsersResponse_1 = require("../Dtos/GetUsersResponse");
|
|
32
33
|
const Dtos_1 = require("../Dtos");
|
|
33
34
|
let UserController = UserController_1 = class UserController {
|
|
34
35
|
constructor(userService, emailService, options) {
|
|
@@ -123,7 +124,7 @@ __decorate([
|
|
|
123
124
|
], UserController.prototype, "serveResetPasswordPage", null);
|
|
124
125
|
__decorate([
|
|
125
126
|
(0, swagger_1.ApiOperation)({ summary: 'Recupera la lista degli utenti', operationId: "getUsers" }),
|
|
126
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'Lista utenti recuperata con successo', type:
|
|
127
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Lista utenti recuperata con successo', type: GetUsersResponse_1.GetUsersResponse }),
|
|
127
128
|
(0, swagger_1.ApiResponse)({ status: 401, description: 'Credenziali non valide' }),
|
|
128
129
|
(0, common_1.Get)('get-users'),
|
|
129
130
|
__param(0, (0, common_1.Res)()),
|
|
@@ -151,7 +152,7 @@ __decorate([
|
|
|
151
152
|
], UserController.prototype, "deleteUser", null);
|
|
152
153
|
__decorate([
|
|
153
154
|
(0, swagger_1.ApiOperation)({ summary: 'Registra un nuovo utente', operationId: "register" }),
|
|
154
|
-
(0, swagger_1.ApiBody)({ type: Dtos_1.
|
|
155
|
+
(0, swagger_1.ApiBody)({ type: Dtos_1.UserDto, description: 'Dati dell\'utente da registrare' }),
|
|
155
156
|
(0, swagger_1.ApiResponse)({ status: 201, description: 'Utente registrato con successo' }),
|
|
156
157
|
(0, swagger_1.ApiResponse)({ status: 400, description: 'Errore nella registrazione' }),
|
|
157
158
|
(0, common_1.Post)('register'),
|
|
@@ -159,7 +160,7 @@ __decorate([
|
|
|
159
160
|
__param(1, (0, common_1.Body)()),
|
|
160
161
|
__param(2, (0, common_1.Res)()),
|
|
161
162
|
__metadata("design:type", Function),
|
|
162
|
-
__metadata("design:paramtypes", [Object, Dtos_1.
|
|
163
|
+
__metadata("design:paramtypes", [Object, Dtos_1.UserDto, Object]),
|
|
163
164
|
__metadata("design:returntype", Promise)
|
|
164
165
|
], UserController.prototype, "register", null);
|
|
165
166
|
__decorate([
|
|
@@ -171,7 +172,7 @@ __decorate([
|
|
|
171
172
|
example: "USR123"
|
|
172
173
|
}),
|
|
173
174
|
(0, swagger_1.ApiBody)({
|
|
174
|
-
type: Dtos_1.
|
|
175
|
+
type: Dtos_1.UserDto,
|
|
175
176
|
description: "Dati aggiornati dell'utente (escluso il codice utente, che è nel path)"
|
|
176
177
|
}),
|
|
177
178
|
(0, swagger_1.ApiResponse)({ status: 200, description: "Utente aggiornato con successo" }),
|
|
@@ -181,7 +182,7 @@ __decorate([
|
|
|
181
182
|
__param(1, (0, common_1.Body)()),
|
|
182
183
|
__param(2, (0, common_1.Res)()),
|
|
183
184
|
__metadata("design:type", Function),
|
|
184
|
-
__metadata("design:paramtypes", [Number, Dtos_1.
|
|
185
|
+
__metadata("design:paramtypes", [Number, Dtos_1.UserDto, Object]),
|
|
185
186
|
__metadata("design:returntype", Promise)
|
|
186
187
|
], UserController.prototype, "updateUtente", null);
|
|
187
188
|
__decorate([
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export declare class
|
|
1
|
+
export declare class Status {
|
|
2
2
|
errorCode: string;
|
|
3
3
|
errorDescription: string;
|
|
4
4
|
}
|
|
5
|
-
export declare class BaseResponse
|
|
6
|
-
Status:
|
|
7
|
-
Result: T;
|
|
5
|
+
export declare abstract class BaseResponse {
|
|
6
|
+
Status: Status;
|
|
8
7
|
}
|
|
@@ -9,34 +9,30 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.BaseResponse = exports.
|
|
12
|
+
exports.BaseResponse = exports.Status = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const class_validator_1 = require("class-validator");
|
|
16
|
-
class
|
|
16
|
+
class Status {
|
|
17
17
|
}
|
|
18
|
-
exports.
|
|
18
|
+
exports.Status = Status;
|
|
19
19
|
__decorate([
|
|
20
20
|
(0, swagger_1.ApiProperty)({ example: '0', description: 'Codice di errore, "0" se tutto ok' }),
|
|
21
21
|
(0, class_validator_1.IsString)(),
|
|
22
22
|
__metadata("design:type", String)
|
|
23
|
-
],
|
|
23
|
+
], Status.prototype, "errorCode", void 0);
|
|
24
24
|
__decorate([
|
|
25
25
|
(0, swagger_1.ApiProperty)({ example: 'Success', description: 'Descrizione dell\'errore o successo' }),
|
|
26
26
|
(0, class_validator_1.IsString)(),
|
|
27
27
|
__metadata("design:type", String)
|
|
28
|
-
],
|
|
28
|
+
], Status.prototype, "errorDescription", void 0);
|
|
29
29
|
class BaseResponse {
|
|
30
30
|
}
|
|
31
31
|
exports.BaseResponse = BaseResponse;
|
|
32
32
|
__decorate([
|
|
33
|
-
(0, swagger_1.ApiProperty)({ type:
|
|
33
|
+
(0, swagger_1.ApiProperty)({ type: Status }),
|
|
34
34
|
(0, class_validator_1.ValidateNested)(),
|
|
35
|
-
(0, class_transformer_1.Type)(() =>
|
|
35
|
+
(0, class_transformer_1.Type)(() => Status),
|
|
36
36
|
(0, class_validator_1.IsObject)(),
|
|
37
|
-
__metadata("design:type",
|
|
37
|
+
__metadata("design:type", Status)
|
|
38
38
|
], BaseResponse.prototype, "Status", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, swagger_1.ApiProperty)({ description: 'Risultato della richiesta', required: false }),
|
|
41
|
-
__metadata("design:type", Object)
|
|
42
|
-
], BaseResponse.prototype, "Result", void 0);
|
|
@@ -0,0 +1,26 @@
|
|
|
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.GetRolesResponse = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const BaseResponse_1 = require("./BaseResponse");
|
|
15
|
+
const Role_1 = require("./Role");
|
|
16
|
+
const class_transformer_1 = require("class-transformer");
|
|
17
|
+
const class_validator_1 = require("class-validator");
|
|
18
|
+
class GetRolesResponse extends BaseResponse_1.BaseResponse {
|
|
19
|
+
}
|
|
20
|
+
exports.GetRolesResponse = GetRolesResponse;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, swagger_1.ApiProperty)({ type: [Role_1.Role] }),
|
|
23
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
24
|
+
(0, class_transformer_1.Type)(() => Role_1.Role),
|
|
25
|
+
__metadata("design:type", Array)
|
|
26
|
+
], GetRolesResponse.prototype, "Result", void 0);
|
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
dataGdpr?: string;
|
|
6
|
-
dataInserimento?: string;
|
|
7
|
-
dataScadenzaPassword?: string;
|
|
8
|
-
dataLastLogin?: string;
|
|
9
|
-
statoRegistrazione?: number;
|
|
10
|
-
keyRegistrazione?: string;
|
|
11
|
-
cognome?: string;
|
|
12
|
-
nome?: string;
|
|
13
|
-
avatar?: string;
|
|
14
|
-
flagDueFattori?: boolean;
|
|
15
|
-
codiceLingua?: string;
|
|
16
|
-
cellulare?: string;
|
|
17
|
-
flagSuper?: boolean;
|
|
18
|
-
pagDef?: string;
|
|
19
|
-
jsonMetadata?: string;
|
|
20
|
-
prog?: number;
|
|
21
|
-
numRep?: number;
|
|
22
|
-
idxPers?: number;
|
|
23
|
-
codiceClienteSuper?: string;
|
|
24
|
-
codiceAge?: string;
|
|
25
|
-
codiceClienteCol?: string;
|
|
26
|
-
codiceClienti?: string;
|
|
27
|
-
tipoFil?: string;
|
|
1
|
+
import { BaseResponse } from './BaseResponse';
|
|
2
|
+
import { UserDto } from './UserDto';
|
|
3
|
+
export declare class GetUsersResponse extends BaseResponse {
|
|
4
|
+
Result: UserDto[];
|
|
28
5
|
}
|
|
@@ -11,242 +11,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.GetUsersResponse = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
-
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const class_transformer_1 = require("class-transformer");
|
|
16
|
+
const BaseResponse_1 = require("./BaseResponse");
|
|
17
|
+
const UserDto_1 = require("./UserDto");
|
|
18
|
+
class GetUsersResponse extends BaseResponse_1.BaseResponse {
|
|
15
19
|
}
|
|
16
20
|
exports.GetUsersResponse = GetUsersResponse;
|
|
17
21
|
__decorate([
|
|
18
|
-
(0, swagger_1.ApiProperty)({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
__metadata("design:type", Number)
|
|
24
|
-
], GetUsersResponse.prototype, "codiceUtente", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, swagger_1.ApiProperty)({
|
|
27
|
-
description: "Email dell'utente.",
|
|
28
|
-
type: String,
|
|
29
|
-
example: "mario.rossi@dev.it"
|
|
30
|
-
}),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], GetUsersResponse.prototype, "email", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, swagger_1.ApiProperty)({
|
|
35
|
-
description: "Flag che indica se l'utente ha accettato il GDPR.",
|
|
36
|
-
type: Boolean,
|
|
37
|
-
example: true,
|
|
38
|
-
required: false
|
|
39
|
-
}),
|
|
40
|
-
__metadata("design:type", Boolean)
|
|
41
|
-
], GetUsersResponse.prototype, "flagGdpr", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, swagger_1.ApiProperty)({
|
|
44
|
-
description: "Data di accettazione del GDPR.",
|
|
45
|
-
type: String,
|
|
46
|
-
format: "date-time",
|
|
47
|
-
example: "2024-03-18T12:34:56Z",
|
|
48
|
-
required: false
|
|
49
|
-
}),
|
|
50
|
-
__metadata("design:type", String)
|
|
51
|
-
], GetUsersResponse.prototype, "dataGdpr", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, swagger_1.ApiProperty)({
|
|
54
|
-
description: "Data di inserimento dell'utente nel sistema.",
|
|
55
|
-
type: String,
|
|
56
|
-
format: "date-time",
|
|
57
|
-
example: "2023-01-01T08:30:00Z",
|
|
58
|
-
required: false
|
|
59
|
-
}),
|
|
60
|
-
__metadata("design:type", String)
|
|
61
|
-
], GetUsersResponse.prototype, "dataInserimento", void 0);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, swagger_1.ApiProperty)({
|
|
64
|
-
description: "Data di scadenza della password dell'utente.",
|
|
65
|
-
type: String,
|
|
66
|
-
format: "date-time",
|
|
67
|
-
example: "2024-06-30T23:59:59Z",
|
|
68
|
-
required: false
|
|
69
|
-
}),
|
|
70
|
-
__metadata("design:type", String)
|
|
71
|
-
], GetUsersResponse.prototype, "dataScadenzaPassword", void 0);
|
|
72
|
-
__decorate([
|
|
73
|
-
(0, swagger_1.ApiProperty)({
|
|
74
|
-
description: "Ultima data di accesso dell'utente.",
|
|
75
|
-
type: String,
|
|
76
|
-
format: "date-time",
|
|
77
|
-
example: "2024-03-15T14:45:00Z",
|
|
78
|
-
required: false
|
|
79
|
-
}),
|
|
80
|
-
__metadata("design:type", String)
|
|
81
|
-
], GetUsersResponse.prototype, "dataLastLogin", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
(0, swagger_1.ApiProperty)({
|
|
84
|
-
description: "Stato della registrazione dell'utente (es. 1 = attivo, 0 = inattivo).",
|
|
85
|
-
type: Number,
|
|
86
|
-
example: 1,
|
|
87
|
-
required: false
|
|
88
|
-
}),
|
|
89
|
-
__metadata("design:type", Number)
|
|
90
|
-
], GetUsersResponse.prototype, "statoRegistrazione", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
(0, swagger_1.ApiProperty)({
|
|
93
|
-
description: "Chiave di registrazione dell'utente.",
|
|
94
|
-
type: String,
|
|
95
|
-
example: "abc123xyz",
|
|
96
|
-
required: false
|
|
97
|
-
}),
|
|
98
|
-
__metadata("design:type", String)
|
|
99
|
-
], GetUsersResponse.prototype, "keyRegistrazione", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
(0, swagger_1.ApiProperty)({
|
|
102
|
-
description: "Cognome dell'utente.",
|
|
103
|
-
type: String,
|
|
104
|
-
example: "Rossi",
|
|
105
|
-
required: false
|
|
106
|
-
}),
|
|
107
|
-
__metadata("design:type", String)
|
|
108
|
-
], GetUsersResponse.prototype, "cognome", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
(0, swagger_1.ApiProperty)({
|
|
111
|
-
description: "Nome dell'utente.",
|
|
112
|
-
type: String,
|
|
113
|
-
example: "Mario",
|
|
114
|
-
required: false
|
|
115
|
-
}),
|
|
116
|
-
__metadata("design:type", String)
|
|
117
|
-
], GetUsersResponse.prototype, "nome", void 0);
|
|
118
|
-
__decorate([
|
|
119
|
-
(0, swagger_1.ApiProperty)({
|
|
120
|
-
description: "Avatar dell'utente (URL o base64).",
|
|
121
|
-
type: String,
|
|
122
|
-
example: "https://example.com/avatar.jpg",
|
|
123
|
-
required: false
|
|
124
|
-
}),
|
|
125
|
-
__metadata("design:type", String)
|
|
126
|
-
], GetUsersResponse.prototype, "avatar", void 0);
|
|
127
|
-
__decorate([
|
|
128
|
-
(0, swagger_1.ApiProperty)({
|
|
129
|
-
description: "Flag che indica se l'utente ha attivato l'autenticazione a due fattori.",
|
|
130
|
-
type: Boolean,
|
|
131
|
-
example: true,
|
|
132
|
-
required: false
|
|
133
|
-
}),
|
|
134
|
-
__metadata("design:type", Boolean)
|
|
135
|
-
], GetUsersResponse.prototype, "flagDueFattori", void 0);
|
|
136
|
-
__decorate([
|
|
137
|
-
(0, swagger_1.ApiProperty)({
|
|
138
|
-
description: "Codice lingua preferito dall'utente.",
|
|
139
|
-
type: String,
|
|
140
|
-
example: "it",
|
|
141
|
-
required: false
|
|
142
|
-
}),
|
|
143
|
-
__metadata("design:type", String)
|
|
144
|
-
], GetUsersResponse.prototype, "codiceLingua", void 0);
|
|
145
|
-
__decorate([
|
|
146
|
-
(0, swagger_1.ApiProperty)({
|
|
147
|
-
description: "Numero di cellulare dell'utente.",
|
|
148
|
-
type: String,
|
|
149
|
-
example: "+393401234567",
|
|
150
|
-
required: false
|
|
151
|
-
}),
|
|
152
|
-
__metadata("design:type", String)
|
|
153
|
-
], GetUsersResponse.prototype, "cellulare", void 0);
|
|
154
|
-
__decorate([
|
|
155
|
-
(0, swagger_1.ApiProperty)({
|
|
156
|
-
description: "Flag che indica se l'utente è un super utente.",
|
|
157
|
-
type: Boolean,
|
|
158
|
-
example: false,
|
|
159
|
-
required: false
|
|
160
|
-
}),
|
|
161
|
-
__metadata("design:type", Boolean)
|
|
162
|
-
], GetUsersResponse.prototype, "flagSuper", void 0);
|
|
163
|
-
__decorate([
|
|
164
|
-
(0, swagger_1.ApiProperty)({
|
|
165
|
-
description: "Pagina di default dell'utente all'accesso.",
|
|
166
|
-
type: String,
|
|
167
|
-
example: "/dashboard",
|
|
168
|
-
required: false
|
|
169
|
-
}),
|
|
170
|
-
__metadata("design:type", String)
|
|
171
|
-
], GetUsersResponse.prototype, "pagDef", void 0);
|
|
172
|
-
__decorate([
|
|
173
|
-
(0, swagger_1.ApiProperty)({
|
|
174
|
-
description: "Metadata JSON personalizzato dell'utente.",
|
|
175
|
-
type: String,
|
|
176
|
-
example: "{\"theme\": \"dark\", \"notifications\": true}",
|
|
177
|
-
required: false
|
|
178
|
-
}),
|
|
179
|
-
__metadata("design:type", String)
|
|
180
|
-
], GetUsersResponse.prototype, "jsonMetadata", void 0);
|
|
181
|
-
__decorate([
|
|
182
|
-
(0, swagger_1.ApiProperty)({
|
|
183
|
-
description: "Progressivo interno dell'utente.",
|
|
184
|
-
type: Number,
|
|
185
|
-
example: 1001,
|
|
186
|
-
required: false
|
|
187
|
-
}),
|
|
188
|
-
__metadata("design:type", Number)
|
|
189
|
-
], GetUsersResponse.prototype, "prog", void 0);
|
|
190
|
-
__decorate([
|
|
191
|
-
(0, swagger_1.ApiProperty)({
|
|
192
|
-
description: "Numero di report associati all'utente.",
|
|
193
|
-
type: Number,
|
|
194
|
-
example: 5,
|
|
195
|
-
required: false
|
|
196
|
-
}),
|
|
197
|
-
__metadata("design:type", Number)
|
|
198
|
-
], GetUsersResponse.prototype, "numRep", void 0);
|
|
199
|
-
__decorate([
|
|
200
|
-
(0, swagger_1.ApiProperty)({
|
|
201
|
-
description: "Indice personalizzato dell'utente.",
|
|
202
|
-
type: Number,
|
|
203
|
-
example: 200,
|
|
204
|
-
required: false
|
|
205
|
-
}),
|
|
206
|
-
__metadata("design:type", Number)
|
|
207
|
-
], GetUsersResponse.prototype, "idxPers", void 0);
|
|
208
|
-
__decorate([
|
|
209
|
-
(0, swagger_1.ApiProperty)({
|
|
210
|
-
description: "Codice cliente super associato all'utente.",
|
|
211
|
-
type: String,
|
|
212
|
-
example: "CLI001",
|
|
213
|
-
required: false
|
|
214
|
-
}),
|
|
215
|
-
__metadata("design:type", String)
|
|
216
|
-
], GetUsersResponse.prototype, "codiceClienteSuper", void 0);
|
|
217
|
-
__decorate([
|
|
218
|
-
(0, swagger_1.ApiProperty)({
|
|
219
|
-
description: "Codice agente associato all'utente.",
|
|
220
|
-
type: String,
|
|
221
|
-
example: "AGT456",
|
|
222
|
-
required: false
|
|
223
|
-
}),
|
|
224
|
-
__metadata("design:type", String)
|
|
225
|
-
], GetUsersResponse.prototype, "codiceAge", void 0);
|
|
226
|
-
__decorate([
|
|
227
|
-
(0, swagger_1.ApiProperty)({
|
|
228
|
-
description: "Codice cliente collettivo associato all'utente.",
|
|
229
|
-
type: String,
|
|
230
|
-
example: "CLCOL789",
|
|
231
|
-
required: false
|
|
232
|
-
}),
|
|
233
|
-
__metadata("design:type", String)
|
|
234
|
-
], GetUsersResponse.prototype, "codiceClienteCol", void 0);
|
|
235
|
-
__decorate([
|
|
236
|
-
(0, swagger_1.ApiProperty)({
|
|
237
|
-
description: "Codice clienti multipli associati all'utente.",
|
|
238
|
-
type: String,
|
|
239
|
-
example: "CLI001, CLI002",
|
|
240
|
-
required: false
|
|
241
|
-
}),
|
|
242
|
-
__metadata("design:type", String)
|
|
243
|
-
], GetUsersResponse.prototype, "codiceClienti", void 0);
|
|
244
|
-
__decorate([
|
|
245
|
-
(0, swagger_1.ApiProperty)({
|
|
246
|
-
description: "Tipo di filiale a cui appartiene l'utente.",
|
|
247
|
-
type: String,
|
|
248
|
-
example: "HQ",
|
|
249
|
-
required: false
|
|
250
|
-
}),
|
|
251
|
-
__metadata("design:type", String)
|
|
252
|
-
], GetUsersResponse.prototype, "tipoFil", void 0);
|
|
22
|
+
(0, swagger_1.ApiProperty)({ type: [UserDto_1.UserDto] }),
|
|
23
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
24
|
+
(0, class_transformer_1.Type)(() => UserDto_1.UserDto),
|
|
25
|
+
__metadata("design:type", Array)
|
|
26
|
+
], GetUsersResponse.prototype, "Result", void 0);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseResponse } from "./BaseResponse";
|
|
2
2
|
import { FiltriUtente } from "./FiltriUtente";
|
|
3
3
|
import { AbilitazioneMenu } from "./AbilitazioneMenu";
|
|
4
4
|
import { TokenResult } from "./TokenResult";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { UserDto } from "./UserDto";
|
|
6
|
+
export declare class LoginResult {
|
|
7
|
+
utente?: UserDto;
|
|
7
8
|
filtri?: FiltriUtente[];
|
|
8
9
|
abilitazioni?: AbilitazioneMenu[];
|
|
9
10
|
extensionFields?: any[];
|
|
10
11
|
token?: TokenResult;
|
|
11
12
|
}
|
|
13
|
+
export declare class LoginResponse extends BaseResponse {
|
|
14
|
+
Result: LoginResult;
|
|
15
|
+
}
|
|
@@ -9,30 +9,52 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LoginResponse = void 0;
|
|
12
|
+
exports.LoginResponse = exports.LoginResult = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
-
const
|
|
14
|
+
const BaseResponse_1 = require("./BaseResponse");
|
|
15
|
+
const FiltriUtente_1 = require("./FiltriUtente");
|
|
16
|
+
const AbilitazioneMenu_1 = require("./AbilitazioneMenu");
|
|
15
17
|
const TokenResult_1 = require("./TokenResult");
|
|
16
|
-
|
|
18
|
+
const UserDto_1 = require("./UserDto");
|
|
19
|
+
const class_transformer_1 = require("class-transformer");
|
|
20
|
+
const class_validator_1 = require("class-validator");
|
|
21
|
+
class LoginResult {
|
|
17
22
|
}
|
|
18
|
-
exports.
|
|
23
|
+
exports.LoginResult = LoginResult;
|
|
19
24
|
__decorate([
|
|
20
|
-
(0, swagger_1.ApiProperty)({ description: 'Dati utente' }),
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
(0, swagger_1.ApiProperty)({ description: 'Dati utente', type: UserDto_1.UserDto }),
|
|
26
|
+
(0, class_validator_1.ValidateNested)(),
|
|
27
|
+
(0, class_transformer_1.Type)(() => UserDto_1.UserDto),
|
|
28
|
+
__metadata("design:type", UserDto_1.UserDto)
|
|
29
|
+
], LoginResult.prototype, "utente", void 0);
|
|
23
30
|
__decorate([
|
|
24
|
-
(0, swagger_1.ApiProperty)({ description: 'Filtri utente' }),
|
|
31
|
+
(0, swagger_1.ApiProperty)({ description: 'Filtri utente', type: [FiltriUtente_1.FiltriUtente] }),
|
|
32
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
33
|
+
(0, class_transformer_1.Type)(() => FiltriUtente_1.FiltriUtente),
|
|
25
34
|
__metadata("design:type", Array)
|
|
26
|
-
],
|
|
35
|
+
], LoginResult.prototype, "filtri", void 0);
|
|
27
36
|
__decorate([
|
|
28
|
-
(0, swagger_1.ApiProperty)({ description: 'Abilitazioni utente' }),
|
|
37
|
+
(0, swagger_1.ApiProperty)({ description: 'Abilitazioni utente', type: [AbilitazioneMenu_1.AbilitazioneMenu] }),
|
|
38
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
39
|
+
(0, class_transformer_1.Type)(() => AbilitazioneMenu_1.AbilitazioneMenu),
|
|
29
40
|
__metadata("design:type", Array)
|
|
30
|
-
],
|
|
41
|
+
], LoginResult.prototype, "abilitazioni", void 0);
|
|
31
42
|
__decorate([
|
|
32
|
-
(0, swagger_1.ApiProperty)({ description: 'Extension Fields' }),
|
|
43
|
+
(0, swagger_1.ApiProperty)({ description: 'Extension Fields', type: [Object] }),
|
|
33
44
|
__metadata("design:type", Array)
|
|
34
|
-
],
|
|
45
|
+
], LoginResult.prototype, "extensionFields", void 0);
|
|
35
46
|
__decorate([
|
|
36
|
-
(0, swagger_1.ApiProperty)({ description: 'Token' }),
|
|
47
|
+
(0, swagger_1.ApiProperty)({ description: 'Token', type: TokenResult_1.TokenResult }),
|
|
48
|
+
(0, class_validator_1.ValidateNested)(),
|
|
49
|
+
(0, class_transformer_1.Type)(() => TokenResult_1.TokenResult),
|
|
37
50
|
__metadata("design:type", TokenResult_1.TokenResult)
|
|
38
|
-
],
|
|
51
|
+
], LoginResult.prototype, "token", void 0);
|
|
52
|
+
class LoginResponse extends BaseResponse_1.BaseResponse {
|
|
53
|
+
}
|
|
54
|
+
exports.LoginResponse = LoginResponse;
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, swagger_1.ApiProperty)({ type: LoginResult }),
|
|
57
|
+
(0, class_validator_1.ValidateNested)(),
|
|
58
|
+
(0, class_transformer_1.Type)(() => LoginResult),
|
|
59
|
+
__metadata("design:type", LoginResult)
|
|
60
|
+
], LoginResponse.prototype, "Result", void 0);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { StatoRegistrazione } from './StatoRegistrazione';
|
|
2
|
+
import { Permission } from './Permission';
|
|
3
|
+
export declare class UserDto {
|
|
4
|
+
codiceUtente: number;
|
|
5
|
+
email: string;
|
|
6
|
+
flagGdpr?: boolean;
|
|
7
|
+
dataGdpr?: string;
|
|
8
|
+
dataInserimento?: string;
|
|
9
|
+
dataScadenzaPassword?: string;
|
|
10
|
+
dataLastLogin?: string;
|
|
11
|
+
statoRegistrazione?: StatoRegistrazione;
|
|
12
|
+
keyRegistrazione?: string;
|
|
13
|
+
cognome?: string;
|
|
14
|
+
nome?: string;
|
|
15
|
+
avatar?: string | null;
|
|
16
|
+
flagDueFattori?: boolean;
|
|
17
|
+
codiceLingua?: string;
|
|
18
|
+
cellulare?: string | null;
|
|
19
|
+
flagSuper?: boolean;
|
|
20
|
+
paginaDefault?: string;
|
|
21
|
+
jsonMetadata?: string;
|
|
22
|
+
roles?: string[];
|
|
23
|
+
permissions?: Permission[];
|
|
24
|
+
prog?: number;
|
|
25
|
+
numRep?: number;
|
|
26
|
+
idxPers?: number;
|
|
27
|
+
codiceClienteSuper?: string;
|
|
28
|
+
codiceAge?: string;
|
|
29
|
+
codiceClienteCol?: string;
|
|
30
|
+
codiceClienti?: string;
|
|
31
|
+
tipoFil?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
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.UserDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const StatoRegistrazione_1 = require("./StatoRegistrazione");
|
|
15
|
+
class UserDto {
|
|
16
|
+
}
|
|
17
|
+
exports.UserDto = UserDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({ description: "Codice identificativo univoco dell'utente.", example: "USR123" }),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], UserDto.prototype, "codiceUtente", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, swagger_1.ApiProperty)({ description: "Email dell'utente.", example: "mario.rossi@dev.it" }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], UserDto.prototype, "email", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Flag per l'accettazione del GDPR.", example: true }),
|
|
28
|
+
__metadata("design:type", Boolean)
|
|
29
|
+
], UserDto.prototype, "flagGdpr", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Data di accettazione del GDPR.", format: "date-time", example: "2024-03-18T12:34:56Z" }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], UserDto.prototype, "dataGdpr", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Data di inserimento dell'utente nel sistema.", format: "date-time", example: "2023-01-01T08:30:00Z" }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], UserDto.prototype, "dataInserimento", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Data scadenza password.", format: "date-time", example: "2025-06-01" }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], UserDto.prototype, "dataScadenzaPassword", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Ultima data di accesso dell'utente.", format: "date-time", example: "2024-03-15T14:45:00Z" }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], UserDto.prototype, "dataLastLogin", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Stato della registrazione dell'utente.", enum: StatoRegistrazione_1.StatoRegistrazione, example: StatoRegistrazione_1.StatoRegistrazione.CONF }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], UserDto.prototype, "statoRegistrazione", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Chiave di registrazione dell'utente.", example: "abc123xyz" }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], UserDto.prototype, "keyRegistrazione", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Cognome dell'utente.", example: "Rossi" }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], UserDto.prototype, "cognome", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Nome dell'utente.", example: "Mario" }),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], UserDto.prototype, "nome", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Avatar (URL o base64).", example: "https://example.com/avatar.jpg", nullable: true }),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], UserDto.prototype, "avatar", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Flag che indica se l'autenticazione a due fattori è attivata.", example: true }),
|
|
68
|
+
__metadata("design:type", Boolean)
|
|
69
|
+
], UserDto.prototype, "flagDueFattori", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Codice lingua preferito.", example: "it" }),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], UserDto.prototype, "codiceLingua", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Numero di cellulare.", example: "+393401234567", nullable: true }),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], UserDto.prototype, "cellulare", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Flag superutente.", example: false }),
|
|
80
|
+
__metadata("design:type", Boolean)
|
|
81
|
+
], UserDto.prototype, "flagSuper", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Pagina di default dell'utente all'accesso.", example: "/dashboard" }),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], UserDto.prototype, "paginaDefault", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Metadata JSON personalizzato.", example: "{\"theme\": \"dark\"}" }),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], UserDto.prototype, "jsonMetadata", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Ruoli assegnati all'utente.", example: ["admin", "editor"] }),
|
|
92
|
+
__metadata("design:type", Array)
|
|
93
|
+
], UserDto.prototype, "roles", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Permessi assegnati all'utente.", example: [{ action: "read", resource: "posts" }] }),
|
|
96
|
+
__metadata("design:type", Array)
|
|
97
|
+
], UserDto.prototype, "permissions", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Progressivo interno.", example: 1001 }),
|
|
100
|
+
__metadata("design:type", Number)
|
|
101
|
+
], UserDto.prototype, "prog", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Numero di report.", example: 5 }),
|
|
104
|
+
__metadata("design:type", Number)
|
|
105
|
+
], UserDto.prototype, "numRep", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Indice personalizzato.", example: 200 }),
|
|
108
|
+
__metadata("design:type", Number)
|
|
109
|
+
], UserDto.prototype, "idxPers", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Codice cliente super.", example: "CLI001" }),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], UserDto.prototype, "codiceClienteSuper", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Codice agente.", example: "AGT456" }),
|
|
116
|
+
__metadata("design:type", String)
|
|
117
|
+
], UserDto.prototype, "codiceAge", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Codice cliente collettivo.", example: "CLCOL789" }),
|
|
120
|
+
__metadata("design:type", String)
|
|
121
|
+
], UserDto.prototype, "codiceClienteCol", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Codici multipli clienti.", example: "CLI001, CLI002" }),
|
|
124
|
+
__metadata("design:type", String)
|
|
125
|
+
], UserDto.prototype, "codiceClienti", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Tipo di filiale.", example: "HQ" }),
|
|
128
|
+
__metadata("design:type", String)
|
|
129
|
+
], UserDto.prototype, "tipoFil", void 0);
|
|
@@ -27,4 +27,4 @@ __exportStar(require("./Role"), exports);
|
|
|
27
27
|
__exportStar(require("./StatoRegistrazione"), exports);
|
|
28
28
|
__exportStar(require("./TipoAbilitazione"), exports);
|
|
29
29
|
__exportStar(require("./TokenResult"), exports);
|
|
30
|
-
__exportStar(require("./
|
|
30
|
+
__exportStar(require("./UserDto"), exports);
|
|
@@ -2,16 +2,16 @@ import { AccessiOptions } from "../../AccessiModule";
|
|
|
2
2
|
import { UserService } from "../UserService/UserService";
|
|
3
3
|
import { PermissionService } from "../PermissionService/PermissionService";
|
|
4
4
|
import { LoginRequest } from "../../Dtos/LoginRequest";
|
|
5
|
-
import {
|
|
5
|
+
import { LoginResult } from "../../Dtos/LoginResponse";
|
|
6
6
|
export declare class AuthService {
|
|
7
7
|
private userService;
|
|
8
8
|
private permissionService;
|
|
9
9
|
private readonly accessiOptions;
|
|
10
10
|
constructor(userService: UserService, permissionService: PermissionService, accessiOptions: AccessiOptions);
|
|
11
|
-
login(request: LoginRequest): Promise<
|
|
11
|
+
login(request: LoginRequest): Promise<LoginResult>;
|
|
12
12
|
setPassword(codiceUtente: number, nuovaPassword: string): Promise<any>;
|
|
13
13
|
verifyPassword(codiceUtente: number, passwordCifrata: string): Promise<boolean>;
|
|
14
|
-
getAdminUser(): Promise<
|
|
15
|
-
getDemoUser():
|
|
14
|
+
getAdminUser(): Promise<LoginResult>;
|
|
15
|
+
getDemoUser(): LoginResult;
|
|
16
16
|
confirmResetPassword(token: string, newPassword: string): Promise<void>;
|
|
17
17
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AccessiOptions } from "../../AccessiModule";
|
|
2
2
|
import { EmailService } from "../EmailService/EmailService";
|
|
3
|
-
import { User } from "../../Dtos/User";
|
|
4
3
|
import { FiltriUtente } from "../../Dtos/FiltriUtente";
|
|
5
4
|
import { GetUsersResponse } from "../../Dtos/GetUsersResponse";
|
|
6
5
|
import { PermissionService } from "../PermissionService/PermissionService";
|
|
6
|
+
import { UserDto } from "../../Dtos";
|
|
7
7
|
export declare class UserService {
|
|
8
8
|
private readonly accessiOptions;
|
|
9
9
|
private readonly emailService;
|
|
@@ -13,10 +13,10 @@ export declare class UserService {
|
|
|
13
13
|
getCodiceUtenteByEmail(email: string): Promise<{
|
|
14
14
|
codiceUtente: number;
|
|
15
15
|
}>;
|
|
16
|
-
getUserByEmail(email: string): Promise<
|
|
16
|
+
getUserByEmail(email: string): Promise<UserDto | null>;
|
|
17
17
|
getUserFilters(codiceUtente: number): Promise<FiltriUtente[]>;
|
|
18
|
-
register(registrationData:
|
|
19
|
-
updateUser(codiceUtente: number, user:
|
|
18
|
+
register(registrationData: UserDto): Promise<void>;
|
|
19
|
+
updateUser(codiceUtente: number, user: UserDto): Promise<void>;
|
|
20
20
|
deleteUser(codiceCliente: number): Promise<void>;
|
|
21
21
|
setGdpr(codiceUtente: number): Promise<any>;
|
|
22
22
|
}
|
|
@@ -155,18 +155,70 @@ let UserService = class UserService {
|
|
|
155
155
|
try {
|
|
156
156
|
if (!codiceUtente)
|
|
157
157
|
throw new Error("Impossibile aggiornare senza codice utente.");
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
158
|
+
// Costruzione dinamica della query per UTENTI
|
|
159
|
+
const utentiUpdates = [];
|
|
160
|
+
const utentiParams = [];
|
|
161
|
+
if (user.email !== undefined) {
|
|
162
|
+
utentiUpdates.push("usrname = ?");
|
|
163
|
+
utentiParams.push(user.email);
|
|
164
|
+
}
|
|
165
|
+
if (user.flagGdpr !== undefined) {
|
|
166
|
+
utentiUpdates.push("flggdpr = ?");
|
|
167
|
+
utentiParams.push(user.flagGdpr);
|
|
168
|
+
}
|
|
169
|
+
if (user.statoRegistrazione !== undefined) {
|
|
170
|
+
utentiUpdates.push("stareg = ?");
|
|
171
|
+
utentiParams.push(user.statoRegistrazione);
|
|
172
|
+
}
|
|
173
|
+
if (utentiUpdates.length > 0) {
|
|
174
|
+
const queryUtenti = `UPDATE UTENTI SET ${utentiUpdates.join(", ")} WHERE CODUTE = ?`;
|
|
175
|
+
utentiParams.push(codiceUtente);
|
|
176
|
+
yield Orm_1.Orm.execute(this.accessiOptions.databaseOptions, queryUtenti, utentiParams);
|
|
177
|
+
}
|
|
178
|
+
// Costruzione dinamica della query per UTENTI_CONFIG
|
|
179
|
+
const utentiConfigUpdates = [];
|
|
180
|
+
const utentiConfigParams = [];
|
|
181
|
+
if (user.cognome !== undefined) {
|
|
182
|
+
utentiConfigUpdates.push("cognome = ?");
|
|
183
|
+
utentiConfigParams.push(user.cognome);
|
|
184
|
+
}
|
|
185
|
+
if (user.nome !== undefined) {
|
|
186
|
+
utentiConfigUpdates.push("nome = ?");
|
|
187
|
+
utentiConfigParams.push(user.nome);
|
|
188
|
+
}
|
|
189
|
+
if (user.avatar !== undefined) {
|
|
190
|
+
utentiConfigUpdates.push("avatar = ?");
|
|
191
|
+
utentiConfigParams.push(user.avatar);
|
|
192
|
+
}
|
|
193
|
+
if (user.flagDueFattori !== undefined) {
|
|
194
|
+
utentiConfigUpdates.push("flg2fatt = ?");
|
|
195
|
+
utentiConfigParams.push(user.flagDueFattori);
|
|
196
|
+
}
|
|
197
|
+
if (user.codiceLingua !== undefined) {
|
|
198
|
+
utentiConfigUpdates.push("codlingua = ?");
|
|
199
|
+
utentiConfigParams.push(user.codiceLingua);
|
|
200
|
+
}
|
|
201
|
+
if (user.cellulare !== undefined) {
|
|
202
|
+
utentiConfigUpdates.push("cellulare = ?");
|
|
203
|
+
utentiConfigParams.push(user.cellulare);
|
|
204
|
+
}
|
|
205
|
+
if (user.flagSuper !== undefined) {
|
|
206
|
+
utentiConfigUpdates.push("flgsuper = ?");
|
|
207
|
+
utentiConfigParams.push(user.flagSuper);
|
|
208
|
+
}
|
|
209
|
+
if (user.paginaDefault !== undefined) {
|
|
210
|
+
utentiConfigUpdates.push("pagdef = ?");
|
|
211
|
+
utentiConfigParams.push(user.paginaDefault);
|
|
212
|
+
}
|
|
213
|
+
if (user.jsonMetadata !== undefined) {
|
|
214
|
+
utentiConfigUpdates.push("json_metadata = ?");
|
|
215
|
+
utentiConfigParams.push(user.jsonMetadata);
|
|
216
|
+
}
|
|
217
|
+
if (utentiConfigUpdates.length > 0) {
|
|
218
|
+
const queryUtentiConfig = `UPDATE UTENTI_CONFIG SET ${utentiConfigUpdates.join(", ")} WHERE CODUTE = ?`;
|
|
219
|
+
utentiConfigParams.push(codiceUtente);
|
|
220
|
+
yield Orm_1.Orm.execute(this.accessiOptions.databaseOptions, queryUtentiConfig, utentiConfigParams);
|
|
221
|
+
}
|
|
170
222
|
}
|
|
171
223
|
catch (error) {
|
|
172
224
|
throw error;
|
package/package.json
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { StatoRegistrazione } from "./StatoRegistrazione";
|
|
2
|
-
import { Permission } from "./Permission";
|
|
3
|
-
export declare class User {
|
|
4
|
-
codiceUtente?: number;
|
|
5
|
-
email?: string;
|
|
6
|
-
flagGdpr?: boolean;
|
|
7
|
-
statoRegistrazione?: StatoRegistrazione;
|
|
8
|
-
cognome?: string;
|
|
9
|
-
nome?: string;
|
|
10
|
-
avatar?: string | null;
|
|
11
|
-
flagDueFattori?: boolean;
|
|
12
|
-
codiceLingua?: string;
|
|
13
|
-
dataScadenzaPassword?: string;
|
|
14
|
-
cellulare?: string | null;
|
|
15
|
-
flagSuper?: boolean;
|
|
16
|
-
paginaDefault?: string;
|
|
17
|
-
jsonMetadata?: string;
|
|
18
|
-
roles: string[];
|
|
19
|
-
permissions: Permission[];
|
|
20
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
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.User = void 0;
|
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
-
const StatoRegistrazione_1 = require("./StatoRegistrazione");
|
|
15
|
-
class User {
|
|
16
|
-
}
|
|
17
|
-
exports.User = User;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
20
|
-
description: "Codice identificativo dell'utente",
|
|
21
|
-
example: 123123
|
|
22
|
-
}),
|
|
23
|
-
__metadata("design:type", Number)
|
|
24
|
-
], User.prototype, "codiceUtente", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
27
|
-
description: "Email per l'autenticazione",
|
|
28
|
-
example: "m.rossi@dev.it"
|
|
29
|
-
}),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], User.prototype, "email", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
34
|
-
description: "Flag per l'accettazione del GDPR",
|
|
35
|
-
example: true
|
|
36
|
-
}),
|
|
37
|
-
__metadata("design:type", Boolean)
|
|
38
|
-
], User.prototype, "flagGdpr", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
41
|
-
description: "Stato della registrazione dell'utente",
|
|
42
|
-
enum: StatoRegistrazione_1.StatoRegistrazione,
|
|
43
|
-
example: StatoRegistrazione_1.StatoRegistrazione.CONF
|
|
44
|
-
}),
|
|
45
|
-
__metadata("design:type", Number)
|
|
46
|
-
], User.prototype, "statoRegistrazione", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
49
|
-
description: "Cognome dell'utente",
|
|
50
|
-
example: "Rossi"
|
|
51
|
-
}),
|
|
52
|
-
__metadata("design:type", String)
|
|
53
|
-
], User.prototype, "cognome", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
56
|
-
description: "Nome dell'utente",
|
|
57
|
-
example: "Mario"
|
|
58
|
-
}),
|
|
59
|
-
__metadata("design:type", String)
|
|
60
|
-
], User.prototype, "nome", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
63
|
-
description: "URL dell'avatar dell'utente",
|
|
64
|
-
example: "https://example.com/avatar.jpg",
|
|
65
|
-
nullable: true
|
|
66
|
-
}),
|
|
67
|
-
__metadata("design:type", String)
|
|
68
|
-
], User.prototype, "avatar", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
71
|
-
description: "Indica se l'autenticazione a due fattori è attivata",
|
|
72
|
-
example: true
|
|
73
|
-
}),
|
|
74
|
-
__metadata("design:type", Boolean)
|
|
75
|
-
], User.prototype, "flagDueFattori", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
78
|
-
description: "Codice lingua preferito dall'utente",
|
|
79
|
-
example: "it"
|
|
80
|
-
}),
|
|
81
|
-
__metadata("design:type", String)
|
|
82
|
-
], User.prototype, "codiceLingua", void 0);
|
|
83
|
-
__decorate([
|
|
84
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
85
|
-
description: "Data scadenza password",
|
|
86
|
-
example: "2025-06-01"
|
|
87
|
-
}),
|
|
88
|
-
__metadata("design:type", String)
|
|
89
|
-
], User.prototype, "dataScadenzaPassword", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
92
|
-
description: "Numero di cellulare dell'utente",
|
|
93
|
-
example: "+393331234567",
|
|
94
|
-
nullable: true
|
|
95
|
-
}),
|
|
96
|
-
__metadata("design:type", String)
|
|
97
|
-
], User.prototype, "cellulare", void 0);
|
|
98
|
-
__decorate([
|
|
99
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
100
|
-
description: "Indica se l'utente ha privilegi di superutente",
|
|
101
|
-
example: false
|
|
102
|
-
}),
|
|
103
|
-
__metadata("design:type", Boolean)
|
|
104
|
-
], User.prototype, "flagSuper", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
107
|
-
description: "Pagina di default visualizzata dall'utente dopo il login",
|
|
108
|
-
example: "/dashboard"
|
|
109
|
-
}),
|
|
110
|
-
__metadata("design:type", String)
|
|
111
|
-
], User.prototype, "paginaDefault", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
114
|
-
description: "Metadati non relazionali dell'utente",
|
|
115
|
-
example: "{ \"key\": \"value\" }",
|
|
116
|
-
}),
|
|
117
|
-
__metadata("design:type", String)
|
|
118
|
-
], User.prototype, "jsonMetadata", void 0);
|
|
119
|
-
__decorate([
|
|
120
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
121
|
-
description: "Roles assigned to the user",
|
|
122
|
-
example: ["admin", "editor"],
|
|
123
|
-
}),
|
|
124
|
-
__metadata("design:type", Array)
|
|
125
|
-
], User.prototype, "roles", void 0);
|
|
126
|
-
__decorate([
|
|
127
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
128
|
-
description: "Permissions granted to the user",
|
|
129
|
-
example: [{ action: "read", resource: "posts" }],
|
|
130
|
-
}),
|
|
131
|
-
__metadata("design:type", Array)
|
|
132
|
-
], User.prototype, "permissions", void 0);
|