emilsoftware-utilities 1.3.97 → 1.3.99
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.js +2 -1
- package/dist/accessi-module/Controllers/AccessiController.d.ts +3 -4
- package/dist/accessi-module/Controllers/AccessiController.js +4 -23
- package/dist/accessi-module/Controllers/AuthController.d.ts +1 -1
- package/dist/accessi-module/Controllers/AuthController.js +17 -0
- package/dist/accessi-module/Controllers/EmailController.d.ts +1 -1
- package/dist/accessi-module/Controllers/EmailController.js +8 -2
- package/dist/accessi-module/Controllers/PermissionController.d.ts +14 -2
- package/dist/accessi-module/Controllers/PermissionController.js +223 -14
- package/dist/accessi-module/Controllers/UserController.d.ts +17 -0
- package/dist/accessi-module/Controllers/UserController.js +211 -0
- package/dist/accessi-module/Dtos/Abilitazione.d.ts +6 -0
- package/dist/accessi-module/Dtos/Abilitazione.js +47 -0
- package/dist/accessi-module/Dtos/AbilitazioneMenu.d.ts +11 -0
- package/dist/accessi-module/Dtos/AbilitazioneMenu.js +91 -0
- package/dist/accessi-module/Dtos/AssignPermissionsToUserRequest.d.ts +4 -0
- package/dist/accessi-module/Dtos/AssignPermissionsToUserRequest.js +28 -0
- package/dist/accessi-module/Dtos/AssignRolesToUserRequest.d.ts +3 -0
- package/dist/accessi-module/Dtos/AssignRolesToUserRequest.js +24 -0
- package/dist/accessi-module/Dtos/FiltriUtente.d.ts +10 -0
- package/dist/accessi-module/Dtos/FiltriUtente.js +87 -0
- package/dist/accessi-module/Dtos/GetMenusResponse.d.ts +12 -0
- package/dist/accessi-module/Dtos/GetMenusResponse.js +80 -0
- package/dist/accessi-module/{models/QueryResults/UserQueryResult.d.ts → Dtos/GetUsersResponse.d.ts} +2 -2
- package/dist/accessi-module/Dtos/GetUsersResponse.js +252 -0
- package/dist/accessi-module/Dtos/LoginRequest.d.ts +4 -0
- package/dist/accessi-module/Dtos/LoginRequest.js +35 -0
- package/dist/accessi-module/Dtos/LoginResult.d.ts +10 -0
- package/dist/accessi-module/Dtos/LoginResult.js +34 -0
- package/dist/accessi-module/Dtos/MenuItem.d.ts +0 -0
- package/dist/accessi-module/Dtos/MenuItem.js +0 -0
- package/dist/accessi-module/Dtos/Permission.d.ts +4 -0
- package/dist/accessi-module/Dtos/Permission.js +32 -0
- package/dist/accessi-module/Dtos/Role.d.ts +12 -0
- package/dist/accessi-module/Dtos/Role.js +50 -0
- package/dist/accessi-module/Dtos/TipoAbilitazione.d.ts +6 -0
- package/dist/accessi-module/{Services/PermissionService/IPermissionService.js → Dtos/TipoAbilitazione.js} +1 -1
- package/dist/accessi-module/Dtos/TokenResult.d.ts +5 -0
- package/dist/accessi-module/Dtos/TokenResult.js +38 -0
- package/dist/accessi-module/Dtos/User.d.ts +19 -0
- package/dist/accessi-module/Dtos/User.js +118 -0
- package/dist/accessi-module/Dtos/index.d.ts +13 -0
- package/dist/accessi-module/Dtos/index.js +29 -0
- package/dist/accessi-module/Services/AuthService/AuthService.d.ts +6 -5
- package/dist/accessi-module/Services/AuthService/AuthService.js +39 -23
- package/dist/accessi-module/Services/EmailService/EmailService.d.ts +1 -2
- package/dist/accessi-module/Services/EmailService/EmailService.js +1 -1
- package/dist/accessi-module/Services/PermissionService/PermissionService.d.ts +12 -5
- package/dist/accessi-module/Services/PermissionService/PermissionService.js +143 -5
- package/dist/accessi-module/Services/UserService/UserService.d.ts +11 -10
- package/dist/accessi-module/Services/UserService/UserService.js +20 -15
- package/dist/accessi-module/index.d.ts +1 -3
- package/dist/accessi-module/index.js +32 -15
- package/dist/accessi-module/swagger/SwaggerConfig.js +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -4
- package/package.json +1 -1
- package/dist/accessi-module/Services/AuthService/IAuthService.d.ts +0 -64
- package/dist/accessi-module/Services/AuthService/IAuthService.js +0 -2
- package/dist/accessi-module/Services/EmailService/IEmailService.d.ts +0 -21
- package/dist/accessi-module/Services/EmailService/IEmailService.js +0 -2
- package/dist/accessi-module/Services/PermissionService/IPermissionService.d.ts +0 -59
- package/dist/accessi-module/Services/UserService/IUserService.d.ts +0 -110
- package/dist/accessi-module/Services/UserService/IUserService.js +0 -2
- package/dist/accessi-module/models/QueryResults/MenuAbilitazioniResult.d.ts +0 -11
- package/dist/accessi-module/models/QueryResults/MenuAbilitazioniResult.js +0 -2
- package/dist/accessi-module/models/QueryResults/UserQueryResult.js +0 -2
- /package/dist/accessi-module/{models → Dtos}/StatoRegistrazione.d.ts +0 -0
- /package/dist/accessi-module/{models → Dtos}/StatoRegistrazione.js +0 -0
|
@@ -0,0 +1,211 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var UserController_1;
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.UserController = void 0;
|
|
26
|
+
const common_1 = require("@nestjs/common");
|
|
27
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
28
|
+
const Utilities_1 = require("../../Utilities");
|
|
29
|
+
const UserService_1 = require("../Services/UserService/UserService");
|
|
30
|
+
const EmailService_1 = require("../Services/EmailService/EmailService");
|
|
31
|
+
const path_1 = require("path");
|
|
32
|
+
const Dtos_1 = require("../Dtos");
|
|
33
|
+
const GetUsersResponse_1 = require("../Dtos/GetUsersResponse");
|
|
34
|
+
let UserController = UserController_1 = class UserController {
|
|
35
|
+
constructor(userService, emailService, options) {
|
|
36
|
+
this.userService = userService;
|
|
37
|
+
this.emailService = emailService;
|
|
38
|
+
this.options = options;
|
|
39
|
+
}
|
|
40
|
+
serveResetPasswordPage(res, token) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
return res.sendFile((0, path_1.join)(__dirname, '..', 'Views', 'reset-password.html'));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getUsers(res) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
try {
|
|
48
|
+
const users = yield this.userService.getUsers();
|
|
49
|
+
return Utilities_1.RestUtilities.sendBaseResponse(res, users);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
return Utilities_1.RestUtilities.sendInvalidCredentials(res);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
deleteUser(codiceUtente, res) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
try {
|
|
59
|
+
if (!codiceUtente)
|
|
60
|
+
throw new Error('Il campo "Codice Utente" è obbligatorio.');
|
|
61
|
+
yield this.userService.deleteUser(codiceUtente);
|
|
62
|
+
return Utilities_1.RestUtilities.sendOKMessage(res, "L'utente è stato eliminato con successo.");
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
return Utilities_1.RestUtilities.sendErrorMessage(res, error);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
register(request, registrationData, res) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
try {
|
|
72
|
+
let protocol = request["protocol"];
|
|
73
|
+
let host = request.headers["host"];
|
|
74
|
+
if (!protocol || !host) {
|
|
75
|
+
throw new Error("Impossibile procedere: protocollo e host non impostati negli header della richiesta.");
|
|
76
|
+
}
|
|
77
|
+
yield this.userService.register(registrationData);
|
|
78
|
+
let confirmationEmailPrefix = `${protocol}://${host}`;
|
|
79
|
+
yield this.emailService.sendPasswordResetEmail(registrationData.email, confirmationEmailPrefix);
|
|
80
|
+
return Utilities_1.RestUtilities.sendOKMessage(res, "L'utente è stato registrato con successo, email di conferma inoltrata al destinatario.");
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return Utilities_1.RestUtilities.sendErrorMessage(res, error, UserController_1.name);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
updateUtente(codiceUtente, user, res) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
try {
|
|
90
|
+
if (!codiceUtente)
|
|
91
|
+
throw new Error("Il codice utente è obbligatorio.");
|
|
92
|
+
yield this.userService.updateUser(codiceUtente, user);
|
|
93
|
+
return Utilities_1.RestUtilities.sendOKMessage(res, `L'utente ${codiceUtente} è stato aggiornato con successo.`);
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
return Utilities_1.RestUtilities.sendErrorMessage(res, error, UserController_1.name);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
setGdpr(codiceUtente, res) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
try {
|
|
103
|
+
if (!codiceUtente)
|
|
104
|
+
throw new Error("Il codice utente è obbligatorio.");
|
|
105
|
+
yield this.userService.setGdpr(codiceUtente);
|
|
106
|
+
return Utilities_1.RestUtilities.sendOKMessage(res, `L'utente ${codiceUtente} ha accettato il GDPR.`);
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
return Utilities_1.RestUtilities.sendErrorMessage(res, error, UserController_1.name);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
exports.UserController = UserController;
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, swagger_1.ApiOperation)({ summary: 'Servire la pagina di reset password' }),
|
|
117
|
+
(0, swagger_1.ApiParam)({ name: 'token', description: 'Token per il reset della password', required: true }),
|
|
118
|
+
(0, common_1.Get)('reset-password/:token'),
|
|
119
|
+
__param(0, (0, common_1.Res)()),
|
|
120
|
+
__param(1, (0, common_1.Param)('token')),
|
|
121
|
+
__metadata("design:type", Function),
|
|
122
|
+
__metadata("design:paramtypes", [Object, String]),
|
|
123
|
+
__metadata("design:returntype", Promise)
|
|
124
|
+
], UserController.prototype, "serveResetPasswordPage", null);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, swagger_1.ApiOperation)({ summary: 'Recupera la lista degli utenti' }),
|
|
127
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Lista utenti recuperata con successo', type: [GetUsersResponse_1.GetUsersResponse] }),
|
|
128
|
+
(0, swagger_1.ApiResponse)({ status: 401, description: 'Credenziali non valide' }),
|
|
129
|
+
(0, common_1.Get)('get-users'),
|
|
130
|
+
__param(0, (0, common_1.Res)()),
|
|
131
|
+
__metadata("design:type", Function),
|
|
132
|
+
__metadata("design:paramtypes", [Object]),
|
|
133
|
+
__metadata("design:returntype", Promise)
|
|
134
|
+
], UserController.prototype, "getUsers", null);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, swagger_1.ApiOperation)({ summary: 'Elimina un utente' }),
|
|
137
|
+
(0, swagger_1.ApiParam)({
|
|
138
|
+
name: 'codiceUtente',
|
|
139
|
+
description: "Codice identificativo dell'utente da eliminare",
|
|
140
|
+
required: true,
|
|
141
|
+
example: "USR123"
|
|
142
|
+
}),
|
|
143
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: "Utente eliminato con successo" }),
|
|
144
|
+
(0, swagger_1.ApiResponse)({ status: 400, description: "Errore nei parametri della richiesta" }),
|
|
145
|
+
(0, swagger_1.ApiResponse)({ status: 500, description: "Errore interno del server" }),
|
|
146
|
+
(0, common_1.Delete)('delete-user/:codiceUtente'),
|
|
147
|
+
__param(0, (0, common_1.Param)('codiceUtente')),
|
|
148
|
+
__param(1, (0, common_1.Res)()),
|
|
149
|
+
__metadata("design:type", Function),
|
|
150
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
151
|
+
__metadata("design:returntype", Promise)
|
|
152
|
+
], UserController.prototype, "deleteUser", null);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, swagger_1.ApiOperation)({ summary: 'Registra un nuovo utente' }),
|
|
155
|
+
(0, swagger_1.ApiBody)({ type: Dtos_1.User, description: 'Dati dell\'utente da registrare' }),
|
|
156
|
+
(0, swagger_1.ApiResponse)({ status: 201, description: 'Utente registrato con successo' }),
|
|
157
|
+
(0, swagger_1.ApiResponse)({ status: 400, description: 'Errore nella registrazione' }),
|
|
158
|
+
(0, common_1.Post)('register'),
|
|
159
|
+
__param(0, (0, common_1.Req)()),
|
|
160
|
+
__param(1, (0, common_1.Body)()),
|
|
161
|
+
__param(2, (0, common_1.Res)()),
|
|
162
|
+
__metadata("design:type", Function),
|
|
163
|
+
__metadata("design:paramtypes", [Object, Dtos_1.User, Object]),
|
|
164
|
+
__metadata("design:returntype", Promise)
|
|
165
|
+
], UserController.prototype, "register", null);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, swagger_1.ApiOperation)({ summary: 'Aggiorna un utente esistente' }),
|
|
168
|
+
(0, swagger_1.ApiParam)({
|
|
169
|
+
name: 'codiceUtente',
|
|
170
|
+
description: "Codice identificativo dell'utente da aggiornare",
|
|
171
|
+
required: true,
|
|
172
|
+
example: "USR123"
|
|
173
|
+
}),
|
|
174
|
+
(0, swagger_1.ApiBody)({
|
|
175
|
+
type: Dtos_1.User,
|
|
176
|
+
description: "Dati aggiornati dell'utente (escluso il codice utente, che è nel path)"
|
|
177
|
+
}),
|
|
178
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: "Utente aggiornato con successo" }),
|
|
179
|
+
(0, swagger_1.ApiResponse)({ status: 400, description: "Errore nell'aggiornamento" }),
|
|
180
|
+
(0, common_1.Put)('update-user/:codiceUtente'),
|
|
181
|
+
__param(0, (0, common_1.Param)('codiceUtente')),
|
|
182
|
+
__param(1, (0, common_1.Body)()),
|
|
183
|
+
__param(2, (0, common_1.Res)()),
|
|
184
|
+
__metadata("design:type", Function),
|
|
185
|
+
__metadata("design:paramtypes", [String, Dtos_1.User, Object]),
|
|
186
|
+
__metadata("design:returntype", Promise)
|
|
187
|
+
], UserController.prototype, "updateUtente", null);
|
|
188
|
+
__decorate([
|
|
189
|
+
(0, swagger_1.ApiOperation)({ summary: "Imposta il consenso GDPR per un utente" }),
|
|
190
|
+
(0, swagger_1.ApiParam)({
|
|
191
|
+
name: "codiceUtente",
|
|
192
|
+
description: "Codice identificativo dell'utente che accetta il GDPR",
|
|
193
|
+
required: true,
|
|
194
|
+
example: "USR123"
|
|
195
|
+
}),
|
|
196
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: "Consenso GDPR impostato con successo" }),
|
|
197
|
+
(0, swagger_1.ApiResponse)({ status: 400, description: "Errore nella richiesta" }),
|
|
198
|
+
(0, common_1.Patch)('set-gdpr/:codiceUtente'),
|
|
199
|
+
__param(0, (0, common_1.Param)('codiceUtente')),
|
|
200
|
+
__param(1, (0, common_1.Res)()),
|
|
201
|
+
__metadata("design:type", Function),
|
|
202
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
203
|
+
__metadata("design:returntype", Promise)
|
|
204
|
+
], UserController.prototype, "setGdpr", null);
|
|
205
|
+
exports.UserController = UserController = UserController_1 = __decorate([
|
|
206
|
+
(0, swagger_1.ApiTags)('User'),
|
|
207
|
+
(0, common_1.Controller)('accessi/user'),
|
|
208
|
+
__param(2, (0, common_1.Inject)('ACCESSI_OPTIONS')),
|
|
209
|
+
__metadata("design:paramtypes", [UserService_1.UserService,
|
|
210
|
+
EmailService_1.EmailService, Object])
|
|
211
|
+
], UserController);
|
|
@@ -0,0 +1,47 @@
|
|
|
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.Abilitazione = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const TipoAbilitazione_1 = require("./TipoAbilitazione");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
class Abilitazione {
|
|
17
|
+
}
|
|
18
|
+
exports.Abilitazione = Abilitazione;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiProperty)({
|
|
21
|
+
description: 'Codice univoco dell\'utente',
|
|
22
|
+
example: 'USR12345'
|
|
23
|
+
}),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Il codice utente è obbligatorio." }),
|
|
26
|
+
(0, class_validator_1.Length)(5, 20, { message: "Il codice utente deve essere tra 5 e 20 caratteri." }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], Abilitazione.prototype, "codiceUtente", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, swagger_1.ApiProperty)({
|
|
31
|
+
description: 'Codice univoco del menu',
|
|
32
|
+
example: 'MENU_001'
|
|
33
|
+
}),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Il codice menu è obbligatorio." }),
|
|
36
|
+
(0, class_validator_1.Length)(3, 20, { message: "Il codice menu deve essere tra 3 e 20 caratteri." }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], Abilitazione.prototype, "codiceMenu", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiProperty)({
|
|
41
|
+
description: 'Tipo di abilitazione',
|
|
42
|
+
enum: TipoAbilitazione_1.TipoAbilitazione,
|
|
43
|
+
example: TipoAbilitazione_1.TipoAbilitazione.LETTURA
|
|
44
|
+
}),
|
|
45
|
+
(0, class_validator_1.IsEnum)(TipoAbilitazione_1.TipoAbilitazione, { message: "Il tipo di abilitazione non è valido." }),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], Abilitazione.prototype, "tipoAbilitazione", void 0);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TipoAbilitazione } from "./TipoAbilitazione";
|
|
2
|
+
export declare class AbilitazioneMenu {
|
|
3
|
+
codiceMenu: string;
|
|
4
|
+
tipoAbilitazione: TipoAbilitazione;
|
|
5
|
+
descrizioneMenu: string;
|
|
6
|
+
descrizioneGruppo: string;
|
|
7
|
+
codiceGruppo: string;
|
|
8
|
+
icona: string | null;
|
|
9
|
+
tipo: string | null;
|
|
10
|
+
pagina: string | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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.AbilitazioneMenu = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const TipoAbilitazione_1 = require("./TipoAbilitazione");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
class AbilitazioneMenu {
|
|
17
|
+
}
|
|
18
|
+
exports.AbilitazioneMenu = AbilitazioneMenu;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiProperty)({
|
|
21
|
+
description: 'Codice univoco del menu',
|
|
22
|
+
example: 'MENU_001'
|
|
23
|
+
}),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Il codice menu è obbligatorio." }),
|
|
26
|
+
(0, class_validator_1.Length)(3, 20, { message: "Il codice menu deve essere tra 3 e 20 caratteri." }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AbilitazioneMenu.prototype, "codiceMenu", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, swagger_1.ApiProperty)({
|
|
31
|
+
description: 'Tipo di abilitazione',
|
|
32
|
+
enum: TipoAbilitazione_1.TipoAbilitazione,
|
|
33
|
+
example: TipoAbilitazione_1.TipoAbilitazione.LETTURA
|
|
34
|
+
}),
|
|
35
|
+
(0, class_validator_1.IsEnum)(TipoAbilitazione_1.TipoAbilitazione, { message: "Il tipo di abilitazione non è valido." }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], AbilitazioneMenu.prototype, "tipoAbilitazione", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiProperty)({
|
|
40
|
+
description: 'Descrizione del menu',
|
|
41
|
+
example: 'Gestione utenti'
|
|
42
|
+
}),
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
(0, class_validator_1.IsNotEmpty)({ message: "La descrizione del menu è obbligatoria." }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], AbilitazioneMenu.prototype, "descrizioneMenu", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, swagger_1.ApiProperty)({
|
|
49
|
+
description: 'Descrizione del gruppo a cui appartiene il menu',
|
|
50
|
+
example: 'Amministrazione'
|
|
51
|
+
}),
|
|
52
|
+
(0, class_validator_1.IsString)(),
|
|
53
|
+
(0, class_validator_1.IsNotEmpty)({ message: "La descrizione del gruppo è obbligatoria." }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], AbilitazioneMenu.prototype, "descrizioneGruppo", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, swagger_1.ApiProperty)({
|
|
58
|
+
description: 'Codice univoco del gruppo a cui appartiene il menu',
|
|
59
|
+
example: 'GRP_ADMIN'
|
|
60
|
+
}),
|
|
61
|
+
(0, class_validator_1.IsString)(),
|
|
62
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Il codice gruppo è obbligatorio." }),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], AbilitazioneMenu.prototype, "codiceGruppo", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
67
|
+
description: 'Nome dell\'icona associata al menu',
|
|
68
|
+
example: 'fa-user'
|
|
69
|
+
}),
|
|
70
|
+
(0, class_validator_1.IsString)(),
|
|
71
|
+
(0, class_validator_1.IsOptional)(),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], AbilitazioneMenu.prototype, "icona", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
76
|
+
description: 'Tipo di menu (es. statico, dinamico, ecc.)',
|
|
77
|
+
example: 'statico'
|
|
78
|
+
}),
|
|
79
|
+
(0, class_validator_1.IsString)(),
|
|
80
|
+
(0, class_validator_1.IsOptional)(),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], AbilitazioneMenu.prototype, "tipo", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
85
|
+
description: 'Percorso della pagina associata al menu',
|
|
86
|
+
example: '/admin/users'
|
|
87
|
+
}),
|
|
88
|
+
(0, class_validator_1.IsString)(),
|
|
89
|
+
(0, class_validator_1.IsOptional)(),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], AbilitazioneMenu.prototype, "pagina", void 0);
|
|
@@ -0,0 +1,28 @@
|
|
|
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.AssignPermissionsToUserRequest = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const Permission_1 = require("./Permission");
|
|
15
|
+
class AssignPermissionsToUserRequest {
|
|
16
|
+
}
|
|
17
|
+
exports.AssignPermissionsToUserRequest = AssignPermissionsToUserRequest;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({
|
|
20
|
+
description: "Lista delle abilitazioni da assegnare all'utente.",
|
|
21
|
+
type: [Permission_1.Permission],
|
|
22
|
+
example: [
|
|
23
|
+
{ codiceMenu: "MNU001", tipoAbilitazione: 30 },
|
|
24
|
+
{ codiceMenu: "MNU002", tipoAbilitazione: 10 }
|
|
25
|
+
]
|
|
26
|
+
}),
|
|
27
|
+
__metadata("design:type", Array)
|
|
28
|
+
], AssignPermissionsToUserRequest.prototype, "permissions", void 0);
|
|
@@ -0,0 +1,24 @@
|
|
|
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.AssignRolesToUserRequest = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
class AssignRolesToUserRequest {
|
|
15
|
+
}
|
|
16
|
+
exports.AssignRolesToUserRequest = AssignRolesToUserRequest;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, swagger_1.ApiProperty)({
|
|
19
|
+
description: "Lista dei codici dei ruoli da assegnare all'utente.",
|
|
20
|
+
type: [String],
|
|
21
|
+
example: ["ADMIN", "EDITOR", "USER"]
|
|
22
|
+
}),
|
|
23
|
+
__metadata("design:type", Array)
|
|
24
|
+
], AssignRolesToUserRequest.prototype, "roles", void 0);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class FiltriUtente {
|
|
2
|
+
progressivo?: number;
|
|
3
|
+
numeroReport?: number;
|
|
4
|
+
indicePersonale?: number;
|
|
5
|
+
codiceClienteSuper?: string | null;
|
|
6
|
+
codiceAgenzia?: string;
|
|
7
|
+
codiceClienteCollegato?: string;
|
|
8
|
+
codiceClienti?: string;
|
|
9
|
+
tipoFiltro?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
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.FiltriUtente = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class FiltriUtente {
|
|
16
|
+
}
|
|
17
|
+
exports.FiltriUtente = FiltriUtente;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({
|
|
20
|
+
description: 'Progressivo identificativo del filtro',
|
|
21
|
+
example: 1
|
|
22
|
+
}),
|
|
23
|
+
(0, class_validator_1.IsInt)({ message: "Il progressivo deve essere un numero intero." }),
|
|
24
|
+
(0, class_validator_1.Min)(1, { message: "Il progressivo deve essere maggiore di 0." }),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], FiltriUtente.prototype, "progressivo", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiProperty)({
|
|
29
|
+
description: 'Numero del report associato',
|
|
30
|
+
example: 1002
|
|
31
|
+
}),
|
|
32
|
+
(0, class_validator_1.IsInt)({ message: "Il numero del report deve essere un numero intero." }),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], FiltriUtente.prototype, "numeroReport", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, swagger_1.ApiProperty)({
|
|
37
|
+
description: 'Indice personale dell\'utente',
|
|
38
|
+
example: 15
|
|
39
|
+
}),
|
|
40
|
+
(0, class_validator_1.IsInt)({ message: "L'indice personale deve essere un numero intero." }),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], FiltriUtente.prototype, "indicePersonale", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
45
|
+
description: 'Codice del cliente principale (super)',
|
|
46
|
+
example: 'CLT_SUP_1234'
|
|
47
|
+
}),
|
|
48
|
+
(0, class_validator_1.IsString)(),
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], FiltriUtente.prototype, "codiceClienteSuper", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
54
|
+
description: 'Codice dell\'agenzia associata',
|
|
55
|
+
example: 'AGZ_5678'
|
|
56
|
+
}),
|
|
57
|
+
(0, class_validator_1.IsString)(),
|
|
58
|
+
(0, class_validator_1.IsOptional)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], FiltriUtente.prototype, "codiceAgenzia", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
63
|
+
description: 'Codice del cliente collegato',
|
|
64
|
+
example: 'CLT_COL_8765'
|
|
65
|
+
}),
|
|
66
|
+
(0, class_validator_1.IsString)(),
|
|
67
|
+
(0, class_validator_1.IsOptional)(),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], FiltriUtente.prototype, "codiceClienteCollegato", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
72
|
+
description: 'Lista di codici clienti separati da virgola',
|
|
73
|
+
example: 'CLT_123,CLT_456,CLT_789'
|
|
74
|
+
}),
|
|
75
|
+
(0, class_validator_1.IsString)(),
|
|
76
|
+
(0, class_validator_1.IsOptional)(),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], FiltriUtente.prototype, "codiceClienti", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
81
|
+
description: 'Tipo di filtro applicato',
|
|
82
|
+
example: 'esclusivo'
|
|
83
|
+
}),
|
|
84
|
+
(0, class_validator_1.IsString)(),
|
|
85
|
+
(0, class_validator_1.IsOptional)(),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], FiltriUtente.prototype, "tipoFiltro", void 0);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class GetMenusResponse {
|
|
2
|
+
menus: MenuEntity[];
|
|
3
|
+
}
|
|
4
|
+
export declare class MenuEntity {
|
|
5
|
+
codiceMenu: string;
|
|
6
|
+
descrizioneMenu: string;
|
|
7
|
+
codiceGruppo?: string;
|
|
8
|
+
descrizioneGruppo?: string;
|
|
9
|
+
icona?: string;
|
|
10
|
+
tipo?: string;
|
|
11
|
+
pagina?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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.MenuEntity = exports.GetMenusResponse = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
class GetMenusResponse {
|
|
15
|
+
}
|
|
16
|
+
exports.GetMenusResponse = GetMenusResponse;
|
|
17
|
+
class MenuEntity {
|
|
18
|
+
}
|
|
19
|
+
exports.MenuEntity = MenuEntity;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, swagger_1.ApiProperty)({
|
|
22
|
+
description: "Codice univoco del menù.",
|
|
23
|
+
type: String,
|
|
24
|
+
example: "MNU001"
|
|
25
|
+
}),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], MenuEntity.prototype, "codiceMenu", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, swagger_1.ApiProperty)({
|
|
30
|
+
description: "Descrizione del menù.",
|
|
31
|
+
type: String,
|
|
32
|
+
example: "Gestione Utenti"
|
|
33
|
+
}),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], MenuEntity.prototype, "descrizioneMenu", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiProperty)({
|
|
38
|
+
description: "Codice del gruppo a cui appartiene il menù.",
|
|
39
|
+
type: String,
|
|
40
|
+
example: "GRP01",
|
|
41
|
+
required: false
|
|
42
|
+
}),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], MenuEntity.prototype, "codiceGruppo", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, swagger_1.ApiProperty)({
|
|
47
|
+
description: "Descrizione del gruppo a cui appartiene il menù.",
|
|
48
|
+
type: String,
|
|
49
|
+
example: "Gestione Accessi",
|
|
50
|
+
required: false
|
|
51
|
+
}),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], MenuEntity.prototype, "descrizioneGruppo", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, swagger_1.ApiProperty)({
|
|
56
|
+
description: "Percorso dell'icona associata al menù.",
|
|
57
|
+
type: String,
|
|
58
|
+
example: "fa-users",
|
|
59
|
+
required: false
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], MenuEntity.prototype, "icona", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, swagger_1.ApiProperty)({
|
|
65
|
+
description: "Tipo di menù.",
|
|
66
|
+
type: String,
|
|
67
|
+
example: "admin",
|
|
68
|
+
required: false
|
|
69
|
+
}),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], MenuEntity.prototype, "tipo", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, swagger_1.ApiProperty)({
|
|
74
|
+
description: "Percorso della pagina associata al menù.",
|
|
75
|
+
type: String,
|
|
76
|
+
example: "/accessi/gestione-utenti",
|
|
77
|
+
required: false
|
|
78
|
+
}),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], MenuEntity.prototype, "pagina", void 0);
|