emilsoftware-utilities 1.4.0-dev.11 → 1.4.0-dev.13

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.
@@ -2,8 +2,9 @@ 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 { StatoRegistrazione, UserDto } from '../Dtos';
5
+ import { UserDto } from '../Dtos';
6
6
  import { RegisterRequest } from '../Dtos/RegisterRequest';
7
+ import { SetStatoRegistrazioneDto } from '../Dtos/SetStatoRegistrazione';
7
8
  export declare class UserController {
8
9
  private readonly userService;
9
10
  private readonly emailService;
@@ -13,7 +14,7 @@ export declare class UserController {
13
14
  serveResetPasswordPage(res: Response, token: string): Promise<void>;
14
15
  getUsers(res: Response, email?: string, codiceUtente?: number, includeExtensionFields?: boolean, includeGrants?: boolean): Promise<Response<any, Record<string, any>>>;
15
16
  deleteUser(codiceUtente: number, res: Response): Promise<Response<any, Record<string, any>>>;
16
- setStatoRegistrazione(codiceUtente: number, statoRegistrazione: StatoRegistrazione, res: Response): Promise<Response<any, Record<string, any>>>;
17
+ setStatoRegistrazione(body: SetStatoRegistrazioneDto, res: Response): Promise<Response<any, Record<string, any>>>;
17
18
  register(request: Request, registrationData: RegisterRequest, res: Response): Promise<Response<any, Record<string, any>>>;
18
19
  updateUtente(codiceUtente: number, user: UserDto, res: Response): Promise<Response<any, Record<string, any>>>;
19
20
  setGdpr(codiceUtente: number, res: Response): Promise<Response<any, Record<string, any>>>;
@@ -34,6 +34,7 @@ const Dtos_1 = require("../Dtos");
34
34
  const RegisterResponse_1 = require("../Dtos/RegisterResponse");
35
35
  const RegisterRequest_1 = require("../Dtos/RegisterRequest");
36
36
  const Logger_1 = require("../../Logger");
37
+ const SetStatoRegistrazione_1 = require("../Dtos/SetStatoRegistrazione");
37
38
  let UserController = UserController_1 = class UserController {
38
39
  constructor(userService, emailService, options) {
39
40
  this.userService = userService;
@@ -76,9 +77,10 @@ let UserController = UserController_1 = class UserController {
76
77
  }
77
78
  });
78
79
  }
79
- setStatoRegistrazione(codiceUtente, statoRegistrazione, res) {
80
+ setStatoRegistrazione(body, res) {
80
81
  return __awaiter(this, void 0, void 0, function* () {
81
82
  try {
83
+ let { codiceUtente, statoRegistrazione } = body;
82
84
  if (!codiceUtente)
83
85
  throw new Error('Il codice utente è obbligatorio.');
84
86
  if (statoRegistrazione === undefined)
@@ -227,25 +229,6 @@ __decorate([
227
229
  - 50: DELETE (eliminato)
228
230
  - 99: BLOCC (bloccato)`,
229
231
  }),
230
- (0, swagger_1.ApiBody)({
231
- schema: {
232
- type: 'object',
233
- required: ['codiceUtente', 'statoRegistrazione'],
234
- properties: {
235
- codiceUtente: {
236
- type: 'number',
237
- description: "Codice identificativo dell'utente",
238
- example: 123,
239
- },
240
- statoRegistrazione: {
241
- type: 'number',
242
- enum: [0, 5, 10, 20, 50, 99],
243
- description: 'Nuovo stato di registrazione',
244
- example: 20,
245
- },
246
- },
247
- },
248
- }),
249
232
  (0, swagger_1.ApiResponse)({
250
233
  status: 200,
251
234
  description: 'Stato registrazione aggiornato con successo',
@@ -258,12 +241,12 @@ __decorate([
258
241
  status: 500,
259
242
  description: 'Errore interno del server',
260
243
  }),
244
+ (0, swagger_1.ApiBody)({ type: SetStatoRegistrazione_1.SetStatoRegistrazioneDto }),
261
245
  (0, common_1.Post)('set-stato'),
262
- __param(0, (0, common_1.Body)('codiceUtente')),
263
- __param(1, (0, common_1.Body)('statoRegistrazione')),
264
- __param(2, (0, common_1.Res)()),
246
+ __param(0, (0, common_1.Body)()),
247
+ __param(1, (0, common_1.Res)()),
265
248
  __metadata("design:type", Function),
266
- __metadata("design:paramtypes", [Number, Number, Object]),
249
+ __metadata("design:paramtypes", [SetStatoRegistrazione_1.SetStatoRegistrazioneDto, Object]),
267
250
  __metadata("design:returntype", Promise)
268
251
  ], UserController.prototype, "setStatoRegistrazione", null);
269
252
  __decorate([
@@ -0,0 +1,5 @@
1
+ import { StatoRegistrazione } from './StatoRegistrazione';
2
+ export declare class SetStatoRegistrazioneDto {
3
+ codiceUtente: number;
4
+ statoRegistrazione: StatoRegistrazione;
5
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SetStatoRegistrazioneDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const StatoRegistrazione_1 = require("./StatoRegistrazione");
15
+ class SetStatoRegistrazioneDto {
16
+ }
17
+ exports.SetStatoRegistrazioneDto = SetStatoRegistrazioneDto;
18
+ __decorate([
19
+ (0, swagger_1.ApiProperty)({
20
+ description: "Codice identificativo dell'utente",
21
+ example: 123,
22
+ }),
23
+ __metadata("design:type", Number)
24
+ ], SetStatoRegistrazioneDto.prototype, "codiceUtente", void 0);
25
+ __decorate([
26
+ (0, swagger_1.ApiProperty)({
27
+ description: 'Nuovo stato di registrazione',
28
+ enum: StatoRegistrazione_1.StatoRegistrazione,
29
+ example: StatoRegistrazione_1.StatoRegistrazione.DELETE,
30
+ }),
31
+ __metadata("design:type", Number)
32
+ ], SetStatoRegistrazioneDto.prototype, "statoRegistrazione", void 0);
@@ -6,3 +6,4 @@ export declare enum StatoRegistrazione {
6
6
  DELETE = 50,
7
7
  BLOCC = 99
8
8
  }
9
+ export declare const StatoRegistrazioneValues: readonly [0, 5, 10, 20, 50, 99];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StatoRegistrazione = void 0;
3
+ exports.StatoRegistrazioneValues = exports.StatoRegistrazione = void 0;
4
4
  var StatoRegistrazione;
5
5
  (function (StatoRegistrazione) {
6
6
  StatoRegistrazione[StatoRegistrazione["NULL"] = 0] = "NULL";
@@ -10,3 +10,4 @@ var StatoRegistrazione;
10
10
  StatoRegistrazione[StatoRegistrazione["DELETE"] = 50] = "DELETE";
11
11
  StatoRegistrazione[StatoRegistrazione["BLOCC"] = 99] = "BLOCC";
12
12
  })(StatoRegistrazione || (exports.StatoRegistrazione = StatoRegistrazione = {}));
13
+ exports.StatoRegistrazioneValues = [0, 5, 10, 20, 50, 99];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emilsoftware-utilities",
3
- "version": "1.4.0-dev.11",
3
+ "version": "1.4.0-dev.13",
4
4
  "description": "Utilities for EmilSoftware",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",