emilsoftware-utilities 1.3.71 → 1.3.73
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 +2 -29
- package/dist/accessi-module/AccessiModule.js +35 -43
- package/dist/accessi-module/Controllers/AccessiController.d.ts +28 -49
- package/dist/accessi-module/Controllers/AccessiController.js +179 -95
- package/dist/accessi-module/Services/AuthService/AuthService.d.ts +4 -4
- package/dist/accessi-module/Services/AuthService/AuthService.js +7 -6
- package/dist/accessi-module/Services/EmailService/EmailService.d.ts +1 -1
- package/dist/accessi-module/Services/EmailService/EmailService.js +3 -3
- package/dist/accessi-module/Services/PermissionService/PermissionService.d.ts +1 -1
- package/dist/accessi-module/Services/PermissionService/PermissionService.js +3 -3
- package/dist/accessi-module/Services/UserService/UserService.d.ts +1 -1
- package/dist/accessi-module/Services/UserService/UserService.js +3 -2
- package/dist/accessi-module/index.d.ts +3 -0
- package/dist/accessi-module/index.js +23 -2
- package/dist/accessi-module/swagger/SwaggerConfig.d.ts +2 -1
- package/dist/accessi-module/swagger/SwaggerConfig.js +9 -29
- package/package.json +7 -2
- package/dist/accessi-module/Controllers/AccessiControllerBase.d.ts +0 -387
- package/dist/accessi-module/Controllers/AccessiControllerBase.js +0 -11
- package/dist/accessi-module/IAccessiRoutes.d.ts +0 -5
- package/dist/accessi-module/IAccessiRoutes.js +0 -2
- package/dist/accessi-module/Routes/AccessiRoutes.d.ts +0 -10
- package/dist/accessi-module/Routes/AccessiRoutes.js +0 -55
- package/dist/accessi-module/inversify.config.d.ts +0 -3
- package/dist/accessi-module/inversify.config.js +0 -65
|
@@ -22,10 +22,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.AuthService = void 0;
|
|
25
|
-
const inversify_1 = require("inversify");
|
|
26
25
|
const Orm_1 = require("../../../Orm");
|
|
27
26
|
const Utilities_1 = require("../../../Utilities");
|
|
28
27
|
const StatoRegistrazione_1 = require("../../models/StatoRegistrazione");
|
|
28
|
+
const common_1 = require("@nestjs/common");
|
|
29
|
+
const UserService_1 = require("../UserService/UserService");
|
|
30
|
+
const PermissionService_1 = require("../PermissionService/PermissionService");
|
|
29
31
|
let AuthService = class AuthService {
|
|
30
32
|
constructor(userService, permissionService, accessiOptions) {
|
|
31
33
|
this.userService = userService;
|
|
@@ -148,9 +150,8 @@ let AuthService = class AuthService {
|
|
|
148
150
|
};
|
|
149
151
|
exports.AuthService = AuthService;
|
|
150
152
|
exports.AuthService = AuthService = __decorate([
|
|
151
|
-
(0,
|
|
152
|
-
__param(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
__metadata("design:paramtypes", [Object, Object, Object])
|
|
153
|
+
(0, common_1.Injectable)(),
|
|
154
|
+
__param(2, (0, common_1.Inject)('ACCESSI_OPTIONS')),
|
|
155
|
+
__metadata("design:paramtypes", [UserService_1.UserService,
|
|
156
|
+
PermissionService_1.PermissionService, Object])
|
|
156
157
|
], AuthService);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AccessiOptions } from '../../AccessiModule';
|
|
2
2
|
import { IEmailService } from './IEmailService';
|
|
3
3
|
export declare class EmailService implements IEmailService {
|
|
4
|
-
private accessiOptions;
|
|
4
|
+
private readonly accessiOptions;
|
|
5
5
|
constructor(accessiOptions: AccessiOptions);
|
|
6
6
|
sendAccountUpdateEmail(email: string, message: string): Promise<void>;
|
|
7
7
|
private transporter;
|
|
@@ -28,7 +28,7 @@ exports.EmailService = void 0;
|
|
|
28
28
|
const nodemailer_1 = __importDefault(require("nodemailer"));
|
|
29
29
|
const uuid_1 = require("uuid");
|
|
30
30
|
const Orm_1 = require("../../../Orm");
|
|
31
|
-
const
|
|
31
|
+
const common_1 = require("@nestjs/common");
|
|
32
32
|
let EmailService = class EmailService {
|
|
33
33
|
constructor(accessiOptions) {
|
|
34
34
|
this.accessiOptions = accessiOptions;
|
|
@@ -86,7 +86,7 @@ let EmailService = class EmailService {
|
|
|
86
86
|
};
|
|
87
87
|
exports.EmailService = EmailService;
|
|
88
88
|
exports.EmailService = EmailService = __decorate([
|
|
89
|
-
(0,
|
|
90
|
-
__param(0, (0,
|
|
89
|
+
(0, common_1.Injectable)(),
|
|
90
|
+
__param(0, (0, common_1.Inject)('ACCESSI_OPTIONS')),
|
|
91
91
|
__metadata("design:paramtypes", [Object])
|
|
92
92
|
], EmailService);
|
|
@@ -2,7 +2,7 @@ import { AccessiOptions } from "../../AccessiModule";
|
|
|
2
2
|
import { IAbilitazioneMenu } from "../UserService/IUserService";
|
|
3
3
|
import { IPermissionService, IRoleWithMenus } from "./IPermissionService";
|
|
4
4
|
export declare class PermissionService implements IPermissionService {
|
|
5
|
-
private accessiOptions;
|
|
5
|
+
private readonly accessiOptions;
|
|
6
6
|
constructor(accessiOptions: AccessiOptions);
|
|
7
7
|
addAbilitazioni(codiceUtente: string, menuAbilitazioni: any[]): Promise<void>;
|
|
8
8
|
resetAbilitazioni(codiceUtente: string): Promise<void>;
|
|
@@ -22,9 +22,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.PermissionService = void 0;
|
|
25
|
-
const inversify_1 = require("inversify");
|
|
26
25
|
const Orm_1 = require("../../../Orm");
|
|
27
26
|
const Utilities_1 = require("../../../Utilities");
|
|
27
|
+
const common_1 = require("@nestjs/common");
|
|
28
28
|
let PermissionService = class PermissionService {
|
|
29
29
|
constructor(accessiOptions) {
|
|
30
30
|
this.accessiOptions = accessiOptions;
|
|
@@ -133,7 +133,7 @@ let PermissionService = class PermissionService {
|
|
|
133
133
|
};
|
|
134
134
|
exports.PermissionService = PermissionService;
|
|
135
135
|
exports.PermissionService = PermissionService = __decorate([
|
|
136
|
-
(0,
|
|
137
|
-
__param(0, (0,
|
|
136
|
+
(0, common_1.Injectable)(),
|
|
137
|
+
__param(0, (0, common_1.Inject)('ACCESSI_OPTIONS')),
|
|
138
138
|
__metadata("design:paramtypes", [Object])
|
|
139
139
|
], PermissionService);
|
|
@@ -3,7 +3,7 @@ import { UserQueryResult } from "../../models/QueryResults/UserQueryResult";
|
|
|
3
3
|
import { StatoRegistrazione } from "../../models/StatoRegistrazione";
|
|
4
4
|
import { IFiltriUtente, IUser, IUserService } from "./IUserService";
|
|
5
5
|
export declare class UserService implements IUserService {
|
|
6
|
-
private accessiOptions;
|
|
6
|
+
private readonly accessiOptions;
|
|
7
7
|
constructor(accessiOptions: AccessiOptions);
|
|
8
8
|
getUsers(): Promise<UserQueryResult[]>;
|
|
9
9
|
getCodiceUtenteByUsername(username: string): Promise<{
|
|
@@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.UserService = void 0;
|
|
25
|
-
const
|
|
25
|
+
const common_1 = require("@nestjs/common");
|
|
26
26
|
const autobind_1 = require("../../../autobind");
|
|
27
27
|
const Orm_1 = require("../../../Orm");
|
|
28
28
|
const Utilities_1 = require("../../../Utilities");
|
|
@@ -231,6 +231,7 @@ let UserService = class UserService {
|
|
|
231
231
|
exports.UserService = UserService;
|
|
232
232
|
exports.UserService = UserService = __decorate([
|
|
233
233
|
autobind_1.autobind,
|
|
234
|
-
|
|
234
|
+
(0, common_1.Injectable)(),
|
|
235
|
+
__param(0, (0, common_1.Inject)('ACCESSI_OPTIONS')),
|
|
235
236
|
__metadata("design:paramtypes", [Object])
|
|
236
237
|
], UserService);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Application } from "express";
|
|
2
|
+
import { AccessiOptions } from "./AccessiModule";
|
|
1
3
|
export { StatoRegistrazione } from "./models/StatoRegistrazione";
|
|
2
4
|
export { AccessiModule } from "./AccessiModule";
|
|
3
5
|
export { ILoginResult } from "./Services/AuthService/IAuthService";
|
|
6
|
+
export declare function initializeAccessiModule(app: Application, options: AccessiOptions): Promise<void>;
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.AccessiModule = exports.StatoRegistrazione = void 0;
|
|
13
|
+
exports.initializeAccessiModule = initializeAccessiModule;
|
|
14
|
+
const AccessiModule_1 = require("./AccessiModule");
|
|
15
|
+
const core_1 = require("@nestjs/core");
|
|
16
|
+
const platform_express_1 = require("@nestjs/platform-express");
|
|
17
|
+
const SwaggerConfig_1 = require("./swagger/SwaggerConfig");
|
|
4
18
|
var StatoRegistrazione_1 = require("./models/StatoRegistrazione");
|
|
5
19
|
Object.defineProperty(exports, "StatoRegistrazione", { enumerable: true, get: function () { return StatoRegistrazione_1.StatoRegistrazione; } });
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "AccessiModule", { enumerable: true, get: function () { return
|
|
20
|
+
var AccessiModule_2 = require("./AccessiModule");
|
|
21
|
+
Object.defineProperty(exports, "AccessiModule", { enumerable: true, get: function () { return AccessiModule_2.AccessiModule; } });
|
|
22
|
+
function initializeAccessiModule(app, options) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const nestApp = yield core_1.NestFactory.create(AccessiModule_1.AccessiModule.forRoot(options), new platform_express_1.ExpressAdapter(app));
|
|
25
|
+
yield nestApp.init();
|
|
26
|
+
(0, SwaggerConfig_1.serveSwaggerDocs)(nestApp);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -1,34 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.serveSwaggerDocs = serveSwaggerDocs;
|
|
7
|
-
const
|
|
8
|
-
const swagger_ui_express_1 = __importDefault(require("swagger-ui-express"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
// Definisci la configurazione di Swagger
|
|
11
|
-
const swaggerDefinition = {
|
|
12
|
-
openapi: '3.0.0',
|
|
13
|
-
info: {
|
|
14
|
-
title: 'Accessi API',
|
|
15
|
-
version: '1.0.0',
|
|
16
|
-
description: 'Documentazione delle API per la gestione degli accessi',
|
|
17
|
-
},
|
|
18
|
-
servers: [
|
|
19
|
-
{
|
|
20
|
-
url: 'http://localhost:3000/api/accessi', // Modifica se necessario
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
};
|
|
24
|
-
const options = {
|
|
25
|
-
swaggerDefinition,
|
|
26
|
-
// Specifica i file sorgenti che contengono le annotazioni Swagger
|
|
27
|
-
apis: [path_1.default.resolve(__dirname, '../../../dist/accessi-module/**/*.js')],
|
|
28
|
-
};
|
|
29
|
-
// Funzione per esporre la documentazione Swagger tramite Express
|
|
4
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
30
5
|
function serveSwaggerDocs(app) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
6
|
+
const config = new swagger_1.DocumentBuilder()
|
|
7
|
+
.setTitle('Accessi API')
|
|
8
|
+
.setDescription('Documentazione delle API per la gestione degli accessi')
|
|
9
|
+
.setVersion('1.0')
|
|
10
|
+
.addServer('http://localhost:3000/api/accessi') // Cambia se necessario
|
|
11
|
+
.build();
|
|
12
|
+
const document = swagger_1.SwaggerModule.createDocument(app, config);
|
|
13
|
+
swagger_1.SwaggerModule.setup('/swagger/accessi', app, document);
|
|
34
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emilsoftware-utilities",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.73",
|
|
4
4
|
"description": "Utilities for EmilSoftware",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -22,10 +22,15 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/mttdev382/emilsoftware-utilities#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@nestjs/common": "^11.0.11",
|
|
26
|
+
"@nestjs/core": "^11.0.11",
|
|
27
|
+
"@nestjs/platform-express": "^11.0.11",
|
|
28
|
+
"@nestjs/swagger": "^11.0.6",
|
|
25
29
|
"axios": "^1.7.9",
|
|
30
|
+
"class-transformer": "^0.5.1",
|
|
31
|
+
"class-validator": "^0.14.1",
|
|
26
32
|
"colorette": "^2.0.20",
|
|
27
33
|
"es-node-firebird": "^1.2.6",
|
|
28
|
-
"inversify": "^6.2.2",
|
|
29
34
|
"jsonwebtoken": "^9.0.2",
|
|
30
35
|
"jspdf": "^3.0.0",
|
|
31
36
|
"jspdf-autotable": "^5.0.2",
|
|
@@ -1,387 +0,0 @@
|
|
|
1
|
-
import { Request, Response } from "express";
|
|
2
|
-
/**
|
|
3
|
-
* Controller per la gestione degli accessi e delle operazioni correlate.
|
|
4
|
-
* Fornisce metodi per login, registrazione, crittografia, decrittografia e gestione delle autorizzazioni utente.
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class AccessiControllerBase {
|
|
7
|
-
constructor();
|
|
8
|
-
/**
|
|
9
|
-
* @swagger
|
|
10
|
-
* /get-user-by-token:
|
|
11
|
-
* post:
|
|
12
|
-
* summary: Recupera le informazioni utente dal token JWT
|
|
13
|
-
* description: Estrae e restituisce le informazioni utente decodificate da un token JWT valido.
|
|
14
|
-
* requestBody:
|
|
15
|
-
* required: true
|
|
16
|
-
* content:
|
|
17
|
-
* application/json:
|
|
18
|
-
* schema:
|
|
19
|
-
* type: object
|
|
20
|
-
* properties:
|
|
21
|
-
* token:
|
|
22
|
-
* type: string
|
|
23
|
-
* required:
|
|
24
|
-
* - token
|
|
25
|
-
* responses:
|
|
26
|
-
* 200:
|
|
27
|
-
* description: Informazioni utente recuperate con successo
|
|
28
|
-
* content:
|
|
29
|
-
* application/json:
|
|
30
|
-
* schema:
|
|
31
|
-
* type: object
|
|
32
|
-
* properties:
|
|
33
|
-
* userData:
|
|
34
|
-
* type: object
|
|
35
|
-
* 400:
|
|
36
|
-
* description: Token non valido o assente
|
|
37
|
-
* 500:
|
|
38
|
-
* description: Errore del server
|
|
39
|
-
*/
|
|
40
|
-
abstract getUserByToken(req: Request<{}, {}, {
|
|
41
|
-
token: string;
|
|
42
|
-
}>, res: Response): any;
|
|
43
|
-
/**
|
|
44
|
-
* @swagger
|
|
45
|
-
* /login:
|
|
46
|
-
* post:
|
|
47
|
-
* summary: Effettua il login di un utente
|
|
48
|
-
* description: Autentica un utente e restituisce un token JWT.
|
|
49
|
-
* requestBody:
|
|
50
|
-
* required: true
|
|
51
|
-
* content:
|
|
52
|
-
* application/json:
|
|
53
|
-
* schema:
|
|
54
|
-
* type: object
|
|
55
|
-
* properties:
|
|
56
|
-
* username:
|
|
57
|
-
* type: string
|
|
58
|
-
* password:
|
|
59
|
-
* type: string
|
|
60
|
-
* required:
|
|
61
|
-
* - username
|
|
62
|
-
* - password
|
|
63
|
-
* responses:
|
|
64
|
-
* 200:
|
|
65
|
-
* description: Login effettuato con successo
|
|
66
|
-
* content:
|
|
67
|
-
* application/json:
|
|
68
|
-
* schema:
|
|
69
|
-
* type: string
|
|
70
|
-
* example: 'jwt_token_here'
|
|
71
|
-
* 400:
|
|
72
|
-
* description: Credenziali errate
|
|
73
|
-
* 500:
|
|
74
|
-
* description: Errore del server
|
|
75
|
-
*/
|
|
76
|
-
abstract login(req: Request, res: Response): any;
|
|
77
|
-
/**
|
|
78
|
-
* @swagger
|
|
79
|
-
* /users:
|
|
80
|
-
* get:
|
|
81
|
-
* summary: Recupera la lista degli utenti
|
|
82
|
-
* description: Restituisce una lista di utenti dal sistema.
|
|
83
|
-
* responses:
|
|
84
|
-
* 200:
|
|
85
|
-
* description: Lista degli utenti recuperata con successo
|
|
86
|
-
* content:
|
|
87
|
-
* application/json:
|
|
88
|
-
* schema:
|
|
89
|
-
* type: array
|
|
90
|
-
* items:
|
|
91
|
-
* type: object
|
|
92
|
-
* properties:
|
|
93
|
-
* id:
|
|
94
|
-
* type: string
|
|
95
|
-
* description: ID univoco dell'utente
|
|
96
|
-
* name:
|
|
97
|
-
* type: string
|
|
98
|
-
* description: Nome dell'utente
|
|
99
|
-
* email:
|
|
100
|
-
* type: string
|
|
101
|
-
* description: Email dell'utente
|
|
102
|
-
* 400:
|
|
103
|
-
* description: Richiesta non valida
|
|
104
|
-
* 500:
|
|
105
|
-
* description: Errore del server
|
|
106
|
-
*/
|
|
107
|
-
abstract getUsers(req: Request, res: Response): any;
|
|
108
|
-
/**
|
|
109
|
-
* @swagger
|
|
110
|
-
* /users/{id}:
|
|
111
|
-
* delete:
|
|
112
|
-
* summary: Elimina un utente
|
|
113
|
-
* description: Elimina un utente dal sistema utilizzando il suo ID univoco.
|
|
114
|
-
* parameters:
|
|
115
|
-
* - in: path
|
|
116
|
-
* name: id
|
|
117
|
-
* required: true
|
|
118
|
-
* description: ID univoco dell'utente da eliminare
|
|
119
|
-
* schema:
|
|
120
|
-
* type: string
|
|
121
|
-
* responses:
|
|
122
|
-
* 200:
|
|
123
|
-
* description: Utente eliminato con successo
|
|
124
|
-
* 400:
|
|
125
|
-
* description: Richiesta non valida
|
|
126
|
-
* 404:
|
|
127
|
-
* description: Utente non trovato
|
|
128
|
-
* 500:
|
|
129
|
-
* description: Errore del server
|
|
130
|
-
*/
|
|
131
|
-
abstract deleteUser(req: Request, res: Response): any;
|
|
132
|
-
/**
|
|
133
|
-
* @swagger
|
|
134
|
-
* /register:
|
|
135
|
-
* post:
|
|
136
|
-
* summary: Registra un nuovo utente
|
|
137
|
-
* description: Registra un nuovo utente nel sistema.
|
|
138
|
-
* requestBody:
|
|
139
|
-
* required: true
|
|
140
|
-
* content:
|
|
141
|
-
* application/json:
|
|
142
|
-
* schema:
|
|
143
|
-
* type: object
|
|
144
|
-
* properties:
|
|
145
|
-
* username:
|
|
146
|
-
* type: string
|
|
147
|
-
* password:
|
|
148
|
-
* type: string
|
|
149
|
-
* email:
|
|
150
|
-
* type: string
|
|
151
|
-
* required:
|
|
152
|
-
* - username
|
|
153
|
-
* - password
|
|
154
|
-
* - email
|
|
155
|
-
* responses:
|
|
156
|
-
* 200:
|
|
157
|
-
* description: Utente registrato con successo
|
|
158
|
-
* 400:
|
|
159
|
-
* description: Dati di registrazione non validi
|
|
160
|
-
* 500:
|
|
161
|
-
* description: Errore del server
|
|
162
|
-
*/
|
|
163
|
-
abstract register(req: Request, res: Response): any;
|
|
164
|
-
/**
|
|
165
|
-
* @swagger
|
|
166
|
-
* /encrypt:
|
|
167
|
-
* post:
|
|
168
|
-
* summary: Crittografa i dati forniti
|
|
169
|
-
* description: Crittografa i dati passati nel corpo della richiesta.
|
|
170
|
-
* requestBody:
|
|
171
|
-
* required: true
|
|
172
|
-
* content:
|
|
173
|
-
* application/json:
|
|
174
|
-
* schema:
|
|
175
|
-
* type: object
|
|
176
|
-
* properties:
|
|
177
|
-
* data:
|
|
178
|
-
* type: string
|
|
179
|
-
* required:
|
|
180
|
-
* - data
|
|
181
|
-
* responses:
|
|
182
|
-
* 200:
|
|
183
|
-
* description: Dati crittografati con successo
|
|
184
|
-
* content:
|
|
185
|
-
* application/json:
|
|
186
|
-
* schema:
|
|
187
|
-
* type: string
|
|
188
|
-
* example: 'encrypted_data_here'
|
|
189
|
-
* 400:
|
|
190
|
-
* description: Dati non validi
|
|
191
|
-
* 500:
|
|
192
|
-
* description: Errore del server
|
|
193
|
-
*/
|
|
194
|
-
abstract encrypt(req: Request<{}, {}, {
|
|
195
|
-
data: string;
|
|
196
|
-
}>, res: Response): any;
|
|
197
|
-
/**
|
|
198
|
-
* @swagger
|
|
199
|
-
* /decrypt:
|
|
200
|
-
* post:
|
|
201
|
-
* summary: Decrittografa i dati forniti
|
|
202
|
-
* description: Decrittografa i dati passati nel corpo della richiesta.
|
|
203
|
-
* requestBody:
|
|
204
|
-
* required: true
|
|
205
|
-
* content:
|
|
206
|
-
* application/json:
|
|
207
|
-
* schema:
|
|
208
|
-
* type: object
|
|
209
|
-
* properties:
|
|
210
|
-
* data:
|
|
211
|
-
* type: string
|
|
212
|
-
* required:
|
|
213
|
-
* - data
|
|
214
|
-
* responses:
|
|
215
|
-
* 200:
|
|
216
|
-
* description: Dati decrittografati con successo
|
|
217
|
-
* content:
|
|
218
|
-
* application/json:
|
|
219
|
-
* schema:
|
|
220
|
-
* type: string
|
|
221
|
-
* example: 'decrypted_data_here'
|
|
222
|
-
* 400:
|
|
223
|
-
* description: Dati non validi
|
|
224
|
-
* 500:
|
|
225
|
-
* description: Errore del server
|
|
226
|
-
*/
|
|
227
|
-
abstract decrypt(req: Request<{}, {}, {
|
|
228
|
-
data: string;
|
|
229
|
-
}>, res: Response): any;
|
|
230
|
-
/**
|
|
231
|
-
* @swagger
|
|
232
|
-
* /reset-abilitazioni:
|
|
233
|
-
* post:
|
|
234
|
-
* summary: Resetta le abilitazioni di un utente
|
|
235
|
-
* description: Resetta le abilitazioni di un utente dato il codice utente.
|
|
236
|
-
* requestBody:
|
|
237
|
-
* required: true
|
|
238
|
-
* content:
|
|
239
|
-
* application/json:
|
|
240
|
-
* schema:
|
|
241
|
-
* type: object
|
|
242
|
-
* properties:
|
|
243
|
-
* codiceUtente:
|
|
244
|
-
* type: string
|
|
245
|
-
* required:
|
|
246
|
-
* - codiceUtente
|
|
247
|
-
* responses:
|
|
248
|
-
* 200:
|
|
249
|
-
* description: Abilitazioni resettate con successo
|
|
250
|
-
* 400:
|
|
251
|
-
* description: Codice utente non valido
|
|
252
|
-
* 500:
|
|
253
|
-
* description: Errore del server
|
|
254
|
-
*/
|
|
255
|
-
abstract resetAbilitazioni(req: Request<{}, {}, {
|
|
256
|
-
codiceUtente: string;
|
|
257
|
-
}>, res: Response): any;
|
|
258
|
-
/**
|
|
259
|
-
* @swagger
|
|
260
|
-
* /set-password:
|
|
261
|
-
* post:
|
|
262
|
-
* summary: Imposta una nuova password per un utente
|
|
263
|
-
* description: Imposta una nuova password per un utente dato il codice utente e la nuova password.
|
|
264
|
-
* requestBody:
|
|
265
|
-
* required: true
|
|
266
|
-
* content:
|
|
267
|
-
* application/json:
|
|
268
|
-
* schema:
|
|
269
|
-
* type: object
|
|
270
|
-
* properties:
|
|
271
|
-
* codiceUtente:
|
|
272
|
-
* type: string
|
|
273
|
-
* nuovaPassword:
|
|
274
|
-
* type: string
|
|
275
|
-
* required:
|
|
276
|
-
* - codiceUtente
|
|
277
|
-
* - nuovaPassword
|
|
278
|
-
* responses:
|
|
279
|
-
* 200:
|
|
280
|
-
* description: Password impostata con successo
|
|
281
|
-
* 400:
|
|
282
|
-
* description: Dati non validi
|
|
283
|
-
* 500:
|
|
284
|
-
* description: Errore del server
|
|
285
|
-
*/
|
|
286
|
-
abstract setPassword(req: Request<{}, {}, {
|
|
287
|
-
codiceUtente: string;
|
|
288
|
-
nuovaPassword: string;
|
|
289
|
-
}>, res: Response): any;
|
|
290
|
-
/**
|
|
291
|
-
* @swagger
|
|
292
|
-
* /update-utente:
|
|
293
|
-
* post:
|
|
294
|
-
* summary: Aggiorna un utente esistente.
|
|
295
|
-
* description: Questo endpoint permette di aggiornare i dati di un utente esistente.
|
|
296
|
-
* tags:
|
|
297
|
-
* - Utenti
|
|
298
|
-
* requestBody:
|
|
299
|
-
* required: true
|
|
300
|
-
* content:
|
|
301
|
-
* application/json:
|
|
302
|
-
* schema:
|
|
303
|
-
* type: object
|
|
304
|
-
* properties:
|
|
305
|
-
* codiceUtente:
|
|
306
|
-
* type: string
|
|
307
|
-
* description: Il codice identificativo dell'utente.
|
|
308
|
-
* example: "U12345"
|
|
309
|
-
* campo1:
|
|
310
|
-
* type: string
|
|
311
|
-
* description: Primo campo fittizio dell'utente da aggiornare.
|
|
312
|
-
* example: "NuovoValore1"
|
|
313
|
-
* campo2:
|
|
314
|
-
* type: string
|
|
315
|
-
* description: Secondo campo fittizio dell'utente da aggiornare.
|
|
316
|
-
* example: "NuovoValore2"
|
|
317
|
-
* responses:
|
|
318
|
-
* 200:
|
|
319
|
-
* description: Utente aggiornato con successo.
|
|
320
|
-
* content:
|
|
321
|
-
* application/json:
|
|
322
|
-
* schema:
|
|
323
|
-
* type: object
|
|
324
|
-
* properties:
|
|
325
|
-
* message:
|
|
326
|
-
* type: string
|
|
327
|
-
* example: "Utente U12345 aggiornato con successo."
|
|
328
|
-
* 400:
|
|
329
|
-
* description: Errore di validazione o richiesta non valida.
|
|
330
|
-
* content:
|
|
331
|
-
* application/json:
|
|
332
|
-
* schema:
|
|
333
|
-
* type: object
|
|
334
|
-
* properties:
|
|
335
|
-
* error:
|
|
336
|
-
* type: string
|
|
337
|
-
* example: "Impossibile aggiornare senza codice utente."
|
|
338
|
-
* 500:
|
|
339
|
-
* description: Errore interno del server.
|
|
340
|
-
* content:
|
|
341
|
-
* application/json:
|
|
342
|
-
* schema:
|
|
343
|
-
* type: object
|
|
344
|
-
* properties:
|
|
345
|
-
* error:
|
|
346
|
-
* type: string
|
|
347
|
-
* example: "Errore interno del server."
|
|
348
|
-
*/
|
|
349
|
-
abstract updateUtente(req: Request, res: Response): any;
|
|
350
|
-
/**
|
|
351
|
-
* @swagger
|
|
352
|
-
* /set-gdpr:
|
|
353
|
-
* post:
|
|
354
|
-
* summary: Imposta il consenso GDPR per un utente
|
|
355
|
-
* description: Imposta il consenso GDPR per un utente dato il codice utente.
|
|
356
|
-
* requestBody:
|
|
357
|
-
* required: true
|
|
358
|
-
* content:
|
|
359
|
-
* application/json:
|
|
360
|
-
* schema:
|
|
361
|
-
* type: object
|
|
362
|
-
* properties:
|
|
363
|
-
* codiceUtente:
|
|
364
|
-
* type: string
|
|
365
|
-
* required:
|
|
366
|
-
* - codiceUtente
|
|
367
|
-
* responses:
|
|
368
|
-
* 200:
|
|
369
|
-
* description: GDPR accettato con successo
|
|
370
|
-
* 400:
|
|
371
|
-
* description: Codice utente non valido
|
|
372
|
-
* 500:
|
|
373
|
-
* description: Errore del server
|
|
374
|
-
*/
|
|
375
|
-
abstract setGdpr(req: Request<{}, {}, {
|
|
376
|
-
codiceUtente: string;
|
|
377
|
-
}>, res: Response): any;
|
|
378
|
-
abstract verifyEmail(req: Request<{
|
|
379
|
-
token: string;
|
|
380
|
-
}>, res: Response): any;
|
|
381
|
-
abstract requestPasswordReset(req: Request, res: Response): any;
|
|
382
|
-
abstract resetPassword(req: Request<{
|
|
383
|
-
token: string;
|
|
384
|
-
}, {}, {
|
|
385
|
-
newPassword: string;
|
|
386
|
-
}>, res: Response): any;
|
|
387
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AccessiControllerBase = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Controller per la gestione degli accessi e delle operazioni correlate.
|
|
6
|
-
* Fornisce metodi per login, registrazione, crittografia, decrittografia e gestione delle autorizzazioni utente.
|
|
7
|
-
*/
|
|
8
|
-
class AccessiControllerBase {
|
|
9
|
-
constructor() { }
|
|
10
|
-
}
|
|
11
|
-
exports.AccessiControllerBase = AccessiControllerBase;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AccessiController } from "../Controllers/AccessiController";
|
|
2
|
-
import { Router } from "express";
|
|
3
|
-
import { IAccessiRoutes } from "../IAccessiRoutes";
|
|
4
|
-
export declare class AccessiRoutes implements IAccessiRoutes {
|
|
5
|
-
private accessiController;
|
|
6
|
-
private logger;
|
|
7
|
-
router: Router;
|
|
8
|
-
constructor(accessiController: AccessiController);
|
|
9
|
-
initializeRoutes(): void;
|
|
10
|
-
}
|