emilsoftware-utilities 1.8.0-dev.1 → 2.0.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.MD +4 -0
  2. package/dist/Utilities.d.ts +18 -0
  3. package/dist/Utilities.js +90 -1
  4. package/dist/Utilities.js.map +1 -1
  5. package/dist/accessi-module/AccessiModule.d.ts +15 -0
  6. package/dist/accessi-module/AccessiModule.js.map +1 -1
  7. package/dist/accessi-module/Controllers/AuthController.d.ts +4 -4
  8. package/dist/accessi-module/Controllers/AuthController.js +36 -21
  9. package/dist/accessi-module/Controllers/AuthController.js.map +1 -1
  10. package/dist/accessi-module/Controllers/EmailController.d.ts +3 -3
  11. package/dist/accessi-module/Controllers/EmailController.js +15 -15
  12. package/dist/accessi-module/Controllers/EmailController.js.map +1 -1
  13. package/dist/accessi-module/Controllers/FiltriController.d.ts +3 -3
  14. package/dist/accessi-module/Controllers/FiltriController.js +32 -15
  15. package/dist/accessi-module/Controllers/FiltriController.js.map +1 -1
  16. package/dist/accessi-module/Controllers/PermissionController.d.ts +12 -17
  17. package/dist/accessi-module/Controllers/PermissionController.js +140 -124
  18. package/dist/accessi-module/Controllers/PermissionController.js.map +1 -1
  19. package/dist/accessi-module/Controllers/UserController.d.ts +12 -11
  20. package/dist/accessi-module/Controllers/UserController.js +112 -79
  21. package/dist/accessi-module/Controllers/UserController.js.map +1 -1
  22. package/dist/accessi-module/Dtos/AssignPermissionsToUserRequest.js +6 -0
  23. package/dist/accessi-module/Dtos/AssignPermissionsToUserRequest.js.map +1 -1
  24. package/dist/accessi-module/Dtos/AssignRolesToUserRequest.js +6 -0
  25. package/dist/accessi-module/Dtos/AssignRolesToUserRequest.js.map +1 -1
  26. package/dist/accessi-module/Dtos/Permission.js +5 -0
  27. package/dist/accessi-module/Dtos/Permission.js.map +1 -1
  28. package/dist/accessi-module/Dtos/RegisterRequest.d.ts +1 -0
  29. package/dist/accessi-module/Dtos/RegisterRequest.js +44 -1
  30. package/dist/accessi-module/Dtos/RegisterRequest.js.map +1 -1
  31. package/dist/accessi-module/Dtos/Role.js +13 -2
  32. package/dist/accessi-module/Dtos/Role.js.map +1 -1
  33. package/dist/accessi-module/Dtos/SetStatoRegistrazione.js +6 -0
  34. package/dist/accessi-module/Dtos/SetStatoRegistrazione.js.map +1 -1
  35. package/dist/accessi-module/Dtos/UserDto.d.ts +1 -0
  36. package/dist/accessi-module/Dtos/UserDto.js +66 -1
  37. package/dist/accessi-module/Dtos/UserDto.js.map +1 -1
  38. package/dist/accessi-module/Services/AuthService/AuthService.d.ts +7 -3
  39. package/dist/accessi-module/Services/AuthService/AuthService.js +147 -25
  40. package/dist/accessi-module/Services/AuthService/AuthService.js.map +1 -1
  41. package/dist/accessi-module/Services/EmailService/EmailService.js +33 -10
  42. package/dist/accessi-module/Services/EmailService/EmailService.js.map +1 -1
  43. package/dist/accessi-module/Services/UserService/UserService.d.ts +15 -6
  44. package/dist/accessi-module/Services/UserService/UserService.js +117 -84
  45. package/dist/accessi-module/Services/UserService/UserService.js.map +1 -1
  46. package/dist/accessi-module/Views/reset-password.html +39 -21
  47. package/dist/accessi-module/index.js +17 -3
  48. package/dist/accessi-module/index.js.map +1 -1
  49. package/dist/accessi-module/jwt/jwt.strategy.d.ts +4 -2
  50. package/dist/accessi-module/jwt/jwt.strategy.js +47 -19
  51. package/dist/accessi-module/jwt/jwt.strategy.js.map +1 -1
  52. package/dist/accessi-module/middleware/authenticateGen.d.ts +3 -1
  53. package/dist/accessi-module/middleware/authenticateGen.js +17 -11
  54. package/dist/accessi-module/middleware/authenticateGen.js.map +1 -1
  55. package/dist/accessi-module/security/accessControl.d.ts +17 -0
  56. package/dist/accessi-module/security/accessControl.js +44 -0
  57. package/dist/accessi-module/security/accessControl.js.map +1 -0
  58. package/dist/accessi-module/security/authenticatedToken.d.ts +11 -0
  59. package/dist/accessi-module/security/authenticatedToken.js +39 -0
  60. package/dist/accessi-module/security/authenticatedToken.js.map +1 -0
  61. package/dist/accessi-module/security/passwordResetToken.d.ts +8 -0
  62. package/dist/accessi-module/security/passwordResetToken.js +73 -0
  63. package/dist/accessi-module/security/passwordResetToken.js.map +1 -0
  64. package/dist/accessi-module/security/publicAuthRateLimit.d.ts +10 -0
  65. package/dist/accessi-module/security/publicAuthRateLimit.js +105 -0
  66. package/dist/accessi-module/security/publicAuthRateLimit.js.map +1 -0
  67. package/dist/emilsoftware-utilities-2.0.0-dev.1.tgz +0 -0
  68. package/package.json +1 -1
  69. package/dist/emilsoftware-utilities-1.8.0-dev.1.tgz +0 -0
@@ -11,6 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RegisterRequest = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const class_validator_1 = require("class-validator");
14
16
  const Permission_1 = require("./Permission");
15
17
  const TipoAbilitazione_1 = require("./TipoAbilitazione");
16
18
  const FiltriUtente_1 = require("./FiltriUtente");
@@ -22,6 +24,8 @@ __decorate([
22
24
  description: "Email dell'utente.",
23
25
  example: "mario.rossi@dev.it",
24
26
  }),
27
+ (0, class_validator_1.IsString)({ message: "L'email deve essere una stringa." }),
28
+ (0, class_validator_1.Length)(3, 254, { message: "L'email deve essere compresa tra 3 e 254 caratteri." }),
25
29
  __metadata("design:type", String)
26
30
  ], RegisterRequest.prototype, "email", void 0);
27
31
  __decorate([
@@ -29,10 +33,16 @@ __decorate([
29
33
  description: "Cognome dell'utente.",
30
34
  example: "Rossi",
31
35
  }),
36
+ (0, class_validator_1.IsOptional)(),
37
+ (0, class_validator_1.IsString)({ message: "Il cognome deve essere una stringa." }),
38
+ (0, class_validator_1.Length)(1, 255, { message: "Il cognome deve essere compreso tra 1 e 255 caratteri." }),
32
39
  __metadata("design:type", String)
33
40
  ], RegisterRequest.prototype, "cognome", void 0);
34
41
  __decorate([
35
42
  (0, swagger_1.ApiPropertyOptional)({ description: "Nome dell'utente.", example: "Mario" }),
43
+ (0, class_validator_1.IsOptional)(),
44
+ (0, class_validator_1.IsString)({ message: "Il nome deve essere una stringa." }),
45
+ (0, class_validator_1.Length)(1, 255, { message: "Il nome deve essere compreso tra 1 e 255 caratteri." }),
36
46
  __metadata("design:type", String)
37
47
  ], RegisterRequest.prototype, "nome", void 0);
38
48
  __decorate([
@@ -41,17 +51,24 @@ __decorate([
41
51
  example: "+393401234567",
42
52
  nullable: true,
43
53
  }),
54
+ (0, class_validator_1.IsOptional)(),
55
+ (0, class_validator_1.IsString)({ message: "Il cellulare deve essere una stringa." }),
56
+ (0, class_validator_1.Length)(1, 50, { message: "Il cellulare deve essere compreso tra 1 e 50 caratteri." }),
44
57
  __metadata("design:type", String)
45
58
  ], RegisterRequest.prototype, "cellulare", void 0);
46
59
  __decorate([
47
60
  (0, swagger_1.ApiPropertyOptional)({ description: "Flag superutente.", example: false }),
61
+ (0, class_validator_1.IsOptional)(),
62
+ (0, class_validator_1.IsBoolean)({ message: "Il flag superutente deve essere booleano." }),
48
63
  __metadata("design:type", Boolean)
49
64
  ], RegisterRequest.prototype, "flagSuper", void 0);
50
65
  __decorate([
51
66
  (0, swagger_1.ApiPropertyOptional)({
52
67
  description: "Flag che indica se l'utente è configuratore",
53
- example: false
68
+ example: false,
54
69
  }),
70
+ (0, class_validator_1.IsOptional)(),
71
+ (0, class_validator_1.IsBoolean)({ message: "Il flag configuratore deve essere booleano." }),
55
72
  __metadata("design:type", Boolean)
56
73
  ], RegisterRequest.prototype, "flagAdminConfigurator", void 0);
57
74
  __decorate([
@@ -59,6 +76,11 @@ __decorate([
59
76
  description: "Ruoli assegnati all'utente.",
60
77
  example: [1, 2],
61
78
  }),
79
+ (0, class_validator_1.IsOptional)(),
80
+ (0, class_validator_1.IsArray)({ message: "I ruoli devono essere un array." }),
81
+ (0, class_validator_1.ArrayUnique)({ message: "I ruoli non possono contenere duplicati." }),
82
+ (0, class_transformer_1.Type)(() => Number),
83
+ (0, class_validator_1.IsInt)({ each: true, message: "Ogni ruolo deve essere un intero." }),
62
84
  __metadata("design:type", Array)
63
85
  ], RegisterRequest.prototype, "roles", void 0);
64
86
  __decorate([
@@ -72,6 +94,10 @@ __decorate([
72
94
  },
73
95
  ],
74
96
  }),
97
+ (0, class_validator_1.IsOptional)(),
98
+ (0, class_validator_1.IsArray)({ message: "I permessi devono essere un array." }),
99
+ (0, class_validator_1.ValidateNested)({ each: true }),
100
+ (0, class_transformer_1.Type)(() => Permission_1.Permission),
75
101
  __metadata("design:type", Array)
76
102
  ], RegisterRequest.prototype, "permissions", void 0);
77
103
  __decorate([
@@ -79,6 +105,8 @@ __decorate([
79
105
  description: "Avatar dell'utente.",
80
106
  example: "user.svg",
81
107
  }),
108
+ (0, class_validator_1.IsOptional)(),
109
+ (0, class_validator_1.IsString)({ message: "L'avatar deve essere una stringa." }),
82
110
  __metadata("design:type", String)
83
111
  ], RegisterRequest.prototype, "avatar", void 0);
84
112
  __decorate([
@@ -86,6 +114,8 @@ __decorate([
86
114
  description: "Flag autenticazione a due fattori.",
87
115
  example: false,
88
116
  }),
117
+ (0, class_validator_1.IsOptional)(),
118
+ (0, class_validator_1.IsBoolean)({ message: "Il flag due fattori deve essere booleano." }),
89
119
  __metadata("design:type", Boolean)
90
120
  ], RegisterRequest.prototype, "flagDueFattori", void 0);
91
121
  __decorate([
@@ -93,13 +123,24 @@ __decorate([
93
123
  description: "Pagina di default dell'utente.",
94
124
  example: "/dashboard",
95
125
  }),
126
+ (0, class_validator_1.IsOptional)(),
127
+ (0, class_validator_1.IsString)({ message: "La pagina di default deve essere una stringa." }),
96
128
  __metadata("design:type", String)
97
129
  ], RegisterRequest.prototype, "paginaDefault", void 0);
130
+ __decorate([
131
+ (0, swagger_1.ApiPropertyOptional)({
132
+ description: "Numero MAC associato all'utente.",
133
+ example: 12,
134
+ }),
135
+ __metadata("design:type", Number)
136
+ ], RegisterRequest.prototype, "nummac", void 0);
98
137
  __decorate([
99
138
  (0, swagger_1.ApiPropertyOptional)({
100
139
  description: "Ragione sociale cliente.",
101
140
  example: "ALIVAL STOCK",
102
141
  }),
142
+ (0, class_validator_1.IsOptional)(),
143
+ (0, class_validator_1.IsString)({ message: "La ragione sociale deve essere una stringa." }),
103
144
  __metadata("design:type", String)
104
145
  ], RegisterRequest.prototype, "ragSocCli", void 0);
105
146
  __decorate([
@@ -107,6 +148,8 @@ __decorate([
107
148
  description: "HTML mail personalizzato",
108
149
  example: "<html></html>",
109
150
  }),
151
+ (0, class_validator_1.IsOptional)(),
152
+ (0, class_validator_1.IsString)({ message: "L'HTML della mail deve essere una stringa." }),
110
153
  __metadata("design:type", String)
111
154
  ], RegisterRequest.prototype, "htmlMail", void 0);
112
155
  //# sourceMappingURL=RegisterRequest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RegisterRequest.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/RegisterRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6E;AAE7E,6CAA0C;AAC1C,yDAAsD;AACtD,iDAA8C;AAE9C,MAAa,eAAgB,SAAQ,IAAA,kBAAQ,EAAC,2BAAY,EAAE,CAAC,QAAQ,CAAU,CAAC;CAmF/E;AAnFD,0CAmFC;AA9EC;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,oBAAoB;QACjC,OAAO,EAAE,oBAAoB;KAC9B,CAAC;;8CACY;AAMd;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,sBAAsB;QACnC,OAAO,EAAE,OAAO;KACjB,CAAC;;gDACe;AAGjB;IADC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;;6CAC9D;AAOd;IALC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,sBAAsB;QACnC,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,IAAI;KACf,CAAC;;kDACwB;AAG1B;IADC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;kDACtD;AAOpB;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,6CAA6C;QAC1D,OAAO,EAAE,KAAK;KACf,CAAC;;8DAC8B;AAMhC;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,6BAA6B;QAC1C,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;KAChB,CAAC;;8CACe;AAYjB;IAVC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,gCAAgC;QAC7C,IAAI,EAAE,CAAC,uBAAU,CAAC;QAClB,OAAO,EAAE;YACP;gBACE,UAAU,EAAE,aAAa;gBACzB,gBAAgB,EAAE,mCAAgB,CAAC,SAAS;aAC7C;SACF;KACF,CAAC;;oDACyB;AAQ3B;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,qBAAqB;QAClC,OAAO,EAAE,UAAU;KACpB,CAAC;;+CACc;AAMhB;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,oCAAoC;QACjD,OAAO,EAAE,KAAK;KACf,CAAC;;uDACuB;AAMzB;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,YAAY;KACtB,CAAC;;sDACqB;AAMvB;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,cAAc;KACxB,CAAC;;kDACiB;AAMnB;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,eAAe;KACzB,CAAC;;iDACgB","sourcesContent":["import { ApiProperty, ApiPropertyOptional, OmitType } from \"@nestjs/swagger\";\nimport { StatoRegistrazione } from \"./StatoRegistrazione\";\nimport { Permission } from \"./Permission\";\nimport { TipoAbilitazione } from \"./TipoAbilitazione\";\nimport { FiltriUtente } from \"./FiltriUtente\";\n\nexport class RegisterRequest extends OmitType(FiltriUtente, ['codUte'] as const) {\n @ApiProperty({\n description: \"Email dell'utente.\",\n example: \"mario.rossi@dev.it\",\n })\n email: string;\n\n @ApiPropertyOptional({\n description: \"Cognome dell'utente.\",\n example: \"Rossi\",\n })\n cognome?: string;\n\n @ApiPropertyOptional({ description: \"Nome dell'utente.\", example: \"Mario\" })\n nome?: string;\n\n @ApiPropertyOptional({\n description: \"Numero di cellulare.\",\n example: \"+393401234567\",\n nullable: true,\n })\n cellulare?: string | null;\n\n @ApiPropertyOptional({ description: \"Flag superutente.\", example: false })\n flagSuper?: boolean;\n\n \n @ApiPropertyOptional({\n description: \"Flag che indica se l'utente è configuratore\",\n example: false\n })\n flagAdminConfigurator?: boolean;\n\n @ApiPropertyOptional({\n description: \"Ruoli assegnati all'utente.\",\n example: [1, 2],\n })\n roles?: number[];\n\n @ApiPropertyOptional({\n description: \"Permessi assegnati all'utente.\",\n type: [Permission],\n example: [\n {\n codiceMenu: \"MNUOFFICINA\",\n tipoAbilitazione: TipoAbilitazione.SCRITTURA,\n },\n ],\n })\n permissions?: Permission[];\n\n\n // Campi aggiuntivi utente\n @ApiPropertyOptional({\n description: \"Avatar dell'utente.\",\n example: \"user.svg\",\n })\n avatar?: string;\n\n @ApiPropertyOptional({\n description: \"Flag autenticazione a due fattori.\",\n example: false,\n })\n flagDueFattori?: boolean;\n\n @ApiPropertyOptional({\n description: \"Pagina di default dell'utente.\",\n example: \"/dashboard\",\n })\n paginaDefault?: string;\n\n @ApiPropertyOptional({\n description: \"Ragione sociale cliente.\",\n example: \"ALIVAL STOCK\",\n })\n ragSocCli?: string;\n\n @ApiPropertyOptional({\n description: \"HTML mail personalizzato\",\n example: \"<html></html>\",\n })\n htmlMail?: string;\n \n}\n"]}
1
+ {"version":3,"file":"RegisterRequest.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/RegisterRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AA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"class-transformer\";\nimport {\n ArrayUnique,\n IsArray,\n IsBoolean,\n IsInt,\n IsOptional,\n IsString,\n Length,\n ValidateNested,\n} from \"class-validator\";\nimport { Permission } from \"./Permission\";\nimport { TipoAbilitazione } from \"./TipoAbilitazione\";\nimport { FiltriUtente } from \"./FiltriUtente\";\n\nexport class RegisterRequest extends OmitType(FiltriUtente, ['codUte'] as const) {\n @ApiProperty({\n description: \"Email dell'utente.\",\n example: \"mario.rossi@dev.it\",\n })\n @IsString({ message: \"L'email deve essere una stringa.\" })\n @Length(3, 254, { message: \"L'email deve essere compresa tra 3 e 254 caratteri.\" })\n email: string;\n\n @ApiPropertyOptional({\n description: \"Cognome dell'utente.\",\n example: \"Rossi\",\n })\n @IsOptional()\n @IsString({ message: \"Il cognome deve essere una stringa.\" })\n @Length(1, 255, { message: \"Il cognome deve essere compreso tra 1 e 255 caratteri.\" })\n cognome?: string;\n\n @ApiPropertyOptional({ description: \"Nome dell'utente.\", example: \"Mario\" })\n @IsOptional()\n @IsString({ message: \"Il nome deve essere una stringa.\" })\n @Length(1, 255, { message: \"Il nome deve essere compreso tra 1 e 255 caratteri.\" })\n nome?: string;\n\n @ApiPropertyOptional({\n description: \"Numero di cellulare.\",\n example: \"+393401234567\",\n nullable: true,\n })\n @IsOptional()\n @IsString({ message: \"Il cellulare deve essere una stringa.\" })\n @Length(1, 50, { message: \"Il cellulare deve essere compreso tra 1 e 50 caratteri.\" })\n cellulare?: string | null;\n\n @ApiPropertyOptional({ description: \"Flag superutente.\", example: false })\n @IsOptional()\n @IsBoolean({ message: \"Il flag superutente deve essere booleano.\" })\n flagSuper?: boolean;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se l'utente è configuratore\",\n example: false,\n })\n @IsOptional()\n @IsBoolean({ message: \"Il flag configuratore deve essere booleano.\" })\n flagAdminConfigurator?: boolean;\n\n @ApiPropertyOptional({\n description: \"Ruoli assegnati all'utente.\",\n example: [1, 2],\n })\n @IsOptional()\n @IsArray({ message: \"I ruoli devono essere un array.\" })\n @ArrayUnique({ message: \"I ruoli non possono contenere duplicati.\" })\n @Type(() => Number)\n @IsInt({ each: true, message: \"Ogni ruolo deve essere un intero.\" })\n roles?: number[];\n\n @ApiPropertyOptional({\n description: \"Permessi assegnati all'utente.\",\n type: [Permission],\n example: [\n {\n codiceMenu: \"MNUOFFICINA\",\n tipoAbilitazione: TipoAbilitazione.SCRITTURA,\n },\n ],\n })\n @IsOptional()\n @IsArray({ message: \"I permessi devono essere un array.\" })\n @ValidateNested({ each: true })\n @Type(() => Permission)\n permissions?: Permission[];\n\n @ApiPropertyOptional({\n description: \"Avatar dell'utente.\",\n example: \"user.svg\",\n })\n @IsOptional()\n @IsString({ message: \"L'avatar deve essere una stringa.\" })\n avatar?: string;\n\n @ApiPropertyOptional({\n description: \"Flag autenticazione a due fattori.\",\n example: false,\n })\n @IsOptional()\n @IsBoolean({ message: \"Il flag due fattori deve essere booleano.\" })\n flagDueFattori?: boolean;\n\n @ApiPropertyOptional({\n description: \"Pagina di default dell'utente.\",\n example: \"/dashboard\",\n })\n @IsOptional()\n @IsString({ message: \"La pagina di default deve essere una stringa.\" })\n paginaDefault?: string;\n\n @ApiPropertyOptional({\n description: \"Numero MAC associato all'utente.\",\n example: 12,\n })\n nummac?: number;\n\n @ApiPropertyOptional({\n description: \"Ragione sociale cliente.\",\n example: \"ALIVAL STOCK\",\n })\n @IsOptional()\n @IsString({ message: \"La ragione sociale deve essere una stringa.\" })\n ragSocCli?: string;\n\n @ApiPropertyOptional({\n description: \"HTML mail personalizzato\",\n example: \"<html></html>\",\n })\n @IsOptional()\n @IsString({ message: \"L'HTML della mail deve essere una stringa.\" })\n htmlMail?: string;\n}\n"]}
@@ -11,23 +11,34 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Role = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const class_validator_1 = require("class-validator");
14
16
  const RuoliMenu_1 = require("./RuoliMenu");
15
17
  class Role {
16
18
  }
17
19
  exports.Role = Role;
18
20
  __decorate([
19
21
  (0, swagger_1.ApiPropertyOptional)({ description: 'Codice univoco del ruolo', required: false, type: Number, example: 1 }),
22
+ (0, class_validator_1.IsOptional)(),
23
+ (0, class_transformer_1.Type)(() => Number),
24
+ (0, class_validator_1.IsInt)({ message: 'Il codice ruolo deve essere un intero.' }),
20
25
  __metadata("design:type", Number)
21
26
  ], Role.prototype, "codiceRuolo", void 0);
22
27
  __decorate([
23
28
  (0, swagger_1.ApiProperty)({ description: 'Descrizione del ruolo' }),
29
+ (0, class_validator_1.IsString)({ message: 'La descrizione del ruolo deve essere una stringa.' }),
30
+ (0, class_validator_1.Length)(1, 255, { message: 'La descrizione del ruolo deve essere compresa tra 1 e 255 caratteri.' }),
24
31
  __metadata("design:type", String)
25
32
  ], Role.prototype, "descrizioneRuolo", void 0);
26
33
  __decorate([
27
34
  (0, swagger_1.ApiProperty)({
28
- description: 'Lista di menù associati al ruolo',
29
- type: [RuoliMenu_1.RuoliMenu]
35
+ description: 'Lista di menu associati al ruolo',
36
+ type: [RuoliMenu_1.RuoliMenu],
30
37
  }),
38
+ (0, class_validator_1.IsArray)({ message: 'I menu del ruolo devono essere un array.' }),
39
+ (0, class_validator_1.ArrayNotEmpty)({ message: 'Il ruolo deve contenere almeno un menu.' }),
40
+ (0, class_validator_1.ValidateNested)({ each: true }),
41
+ (0, class_transformer_1.Type)(() => RuoliMenu_1.RuoliMenu),
31
42
  __metadata("design:type", Array)
32
43
  ], Role.prototype, "menu", void 0);
33
44
  //# sourceMappingURL=Role.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Role.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/Role.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AAEnE,2CAAwC;AAExC,MAAa,IAAI;CAahB;AAbD,oBAaC;AAXG;IADC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;yCACvF;AAGrB;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;;8CAC7B;AAOzB;IAJC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,kCAAkC;QAC/C,IAAI,EAAE,CAAC,qBAAS,CAAC;KACpB,CAAC;;kCACgB","sourcesContent":["import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';\nimport { AbilitazioneMenu } from './AbilitazioneMenu';\nimport { RuoliMenu } from './RuoliMenu';\n\nexport class Role {\n @ApiPropertyOptional({ description: 'Codice univoco del ruolo', required: false, type: Number, example: 1 })\n codiceRuolo?: number;\n\n @ApiProperty({ description: 'Descrizione del ruolo' })\n descrizioneRuolo: string;\n\n\n @ApiProperty({\n description: 'Lista di menù associati al ruolo',\n type: [RuoliMenu]\n })\n menu: RuoliMenu[];\n}\n\n"]}
1
+ {"version":3,"file":"Role.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/Role.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,yDAAyC;AACzC,qDAQyB;AACzB,2CAAwC;AAExC,MAAa,IAAI;CAqBhB;AArBD,oBAqBC;AAhBC;IAJC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC3G,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,uBAAK,EAAC,EAAE,OAAO,EAAE,wCAAwC,EAAE,CAAC;;yCACxC;AAKrB;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;IACrD,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,mDAAmD,EAAE,CAAC;IAC1E,IAAA,wBAAM,EAAC,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,sEAAsE,EAAE,CAAC;;8CAC3E;AAUzB;IARC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,kCAAkC;QAC/C,IAAI,EAAE,CAAC,qBAAS,CAAC;KAClB,CAAC;IACD,IAAA,yBAAO,EAAC,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;IAChE,IAAA,+BAAa,EAAC,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;IACrE,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,qBAAS,CAAC;;kCACJ","sourcesContent":["import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';\nimport { Type } from 'class-transformer';\nimport {\n ArrayNotEmpty,\n IsArray,\n IsInt,\n IsOptional,\n IsString,\n Length,\n ValidateNested,\n} from 'class-validator';\nimport { RuoliMenu } from './RuoliMenu';\n\nexport class Role {\n @ApiPropertyOptional({ description: 'Codice univoco del ruolo', required: false, type: Number, example: 1 })\n @IsOptional()\n @Type(() => Number)\n @IsInt({ message: 'Il codice ruolo deve essere un intero.' })\n codiceRuolo?: number;\n\n @ApiProperty({ description: 'Descrizione del ruolo' })\n @IsString({ message: 'La descrizione del ruolo deve essere una stringa.' })\n @Length(1, 255, { message: 'La descrizione del ruolo deve essere compresa tra 1 e 255 caratteri.' })\n descrizioneRuolo: string;\n\n @ApiProperty({\n description: 'Lista di menu associati al ruolo',\n type: [RuoliMenu],\n })\n @IsArray({ message: 'I menu del ruolo devono essere un array.' })\n @ArrayNotEmpty({ message: 'Il ruolo deve contenere almeno un menu.' })\n @ValidateNested({ each: true })\n @Type(() => RuoliMenu)\n menu: RuoliMenu[];\n}\n"]}
@@ -11,6 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SetStatoRegistrazioneDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const class_validator_1 = require("class-validator");
14
16
  const StatoRegistrazione_1 = require("./StatoRegistrazione");
15
17
  class SetStatoRegistrazioneDto {
16
18
  }
@@ -20,6 +22,9 @@ __decorate([
20
22
  description: "Codice identificativo dell'utente",
21
23
  example: 123,
22
24
  }),
25
+ (0, class_transformer_1.Type)(() => Number),
26
+ (0, class_validator_1.IsInt)({ message: 'Il codice utente deve essere un intero.' }),
27
+ (0, class_validator_1.Min)(1, { message: 'Il codice utente deve essere maggiore di zero.' }),
23
28
  __metadata("design:type", Number)
24
29
  ], SetStatoRegistrazioneDto.prototype, "codiceUtente", void 0);
25
30
  __decorate([
@@ -28,6 +33,7 @@ __decorate([
28
33
  enum: StatoRegistrazione_1.StatoRegistrazione,
29
34
  example: StatoRegistrazione_1.StatoRegistrazione.DELETE,
30
35
  }),
36
+ (0, class_validator_1.IsEnum)(StatoRegistrazione_1.StatoRegistrazione, { message: 'Lo stato di registrazione non e valido.' }),
31
37
  __metadata("design:type", Number)
32
38
  ], SetStatoRegistrazioneDto.prototype, "statoRegistrazione", void 0);
33
39
  //# sourceMappingURL=SetStatoRegistrazione.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SetStatoRegistrazione.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/SetStatoRegistrazione.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,6DAA0D;AAE1D,MAAa,wBAAwB;CAapC;AAbD,4DAaC;AARC;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,GAAG;KACb,CAAC;;8DACmB;AAOrB;IALC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,8BAA8B;QAC3C,IAAI,EAAE,uCAAkB;QACxB,OAAO,EAAE,uCAAkB,CAAC,MAAM;KACnC,CAAC;;oEACqC","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { StatoRegistrazione } from './StatoRegistrazione';\n\nexport class SetStatoRegistrazioneDto {\n @ApiProperty({\n description: \"Codice identificativo dell'utente\",\n example: 123,\n })\n codiceUtente: number;\n\n @ApiProperty({\n description: 'Nuovo stato di registrazione',\n enum: StatoRegistrazione,\n example: StatoRegistrazione.DELETE,\n })\n statoRegistrazione: StatoRegistrazione;\n}\n"]}
1
+ {"version":3,"file":"SetStatoRegistrazione.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/SetStatoRegistrazione.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,yDAAyC;AACzC,qDAAqD;AACrD,6DAA0D;AAE1D,MAAa,wBAAwB;CAiBpC;AAjBD,4DAiBC;AATC;IAPC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,GAAG;KACb,CAAC;IACD,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,uBAAK,EAAC,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;IAC7D,IAAA,qBAAG,EAAC,CAAC,EAAE,EAAE,OAAO,EAAE,gDAAgD,EAAE,CAAC;;8DACjD;AAQrB;IANC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,8BAA8B;QAC3C,IAAI,EAAE,uCAAkB;QACxB,OAAO,EAAE,uCAAkB,CAAC,MAAM;KACnC,CAAC;IACD,IAAA,wBAAM,EAAC,uCAAkB,EAAE,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;;oEAC5C","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { Type } from 'class-transformer';\nimport { IsEnum, IsInt, Min } from 'class-validator';\nimport { StatoRegistrazione } from './StatoRegistrazione';\n\nexport class SetStatoRegistrazioneDto {\n @ApiProperty({\n description: \"Codice identificativo dell'utente\",\n example: 123,\n })\n @Type(() => Number)\n @IsInt({ message: 'Il codice utente deve essere un intero.' })\n @Min(1, { message: 'Il codice utente deve essere maggiore di zero.' })\n codiceUtente: number;\n\n @ApiProperty({\n description: 'Nuovo stato di registrazione',\n enum: StatoRegistrazione,\n example: StatoRegistrazione.DELETE,\n })\n @IsEnum(StatoRegistrazione, { message: 'Lo stato di registrazione non e valido.' })\n statoRegistrazione: StatoRegistrazione;\n}\n"]}
@@ -21,6 +21,7 @@ export declare class UserDto extends UserDto_base {
21
21
  flagSuper?: boolean;
22
22
  flagAdminConfigurator?: boolean;
23
23
  paginaDefault?: string;
24
+ nummac?: number;
24
25
  jsonMetadata?: string;
25
26
  ragSocCli?: string;
26
27
  roles?: number[];
@@ -11,6 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.UserDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const class_validator_1 = require("class-validator");
14
16
  const StatoRegistrazione_1 = require("./StatoRegistrazione");
15
17
  const Permission_1 = require("./Permission");
16
18
  const TipoAbilitazione_1 = require("./TipoAbilitazione");
@@ -20,14 +22,23 @@ class UserDto extends (0, swagger_1.OmitType)(FiltriUtente_1.FiltriUtente, ['cod
20
22
  exports.UserDto = UserDto;
21
23
  __decorate([
22
24
  (0, swagger_1.ApiProperty)({ description: "Codice identificativo univoco dell'utente.", example: 'USR123' }),
25
+ (0, class_validator_1.IsOptional)(),
26
+ (0, class_transformer_1.Type)(() => Number),
27
+ (0, class_validator_1.IsInt)({ message: 'Il codice utente deve essere un intero.' }),
28
+ (0, class_validator_1.Min)(1, { message: 'Il codice utente deve essere maggiore di zero.' }),
23
29
  __metadata("design:type", Number)
24
30
  ], UserDto.prototype, "codiceUtente", void 0);
25
31
  __decorate([
26
32
  (0, swagger_1.ApiProperty)({ description: "Email dell'utente.", example: 'mario.rossi@dev.it' }),
33
+ (0, class_validator_1.IsOptional)(),
34
+ (0, class_validator_1.IsString)({ message: "L'email deve essere una stringa." }),
35
+ (0, class_validator_1.Length)(3, 254, { message: "L'email deve essere compresa tra 3 e 254 caratteri." }),
27
36
  __metadata("design:type", String)
28
37
  ], UserDto.prototype, "email", void 0);
29
38
  __decorate([
30
39
  (0, swagger_1.ApiPropertyOptional)({ description: "Flag per l'accettazione del GDPR.", example: true }),
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.IsBoolean)({ message: 'Il flag GDPR deve essere booleano.' }),
31
42
  __metadata("design:type", Boolean)
32
43
  ], UserDto.prototype, "flagGdpr", void 0);
33
44
  __decorate([
@@ -36,6 +47,8 @@ __decorate([
36
47
  format: 'date-time',
37
48
  example: '2024-03-18T12:34:56Z',
38
49
  }),
50
+ (0, class_validator_1.IsOptional)(),
51
+ (0, class_validator_1.IsString)({ message: 'La data GDPR deve essere una stringa.' }),
39
52
  __metadata("design:type", String)
40
53
  ], UserDto.prototype, "dataGdpr", void 0);
41
54
  __decorate([
@@ -44,6 +57,8 @@ __decorate([
44
57
  format: 'date-time',
45
58
  example: '2023-01-01T08:30:00Z',
46
59
  }),
60
+ (0, class_validator_1.IsOptional)(),
61
+ (0, class_validator_1.IsString)({ message: 'La data di inserimento deve essere una stringa.' }),
47
62
  __metadata("design:type", String)
48
63
  ], UserDto.prototype, "dataInserimento", void 0);
49
64
  __decorate([
@@ -52,6 +67,8 @@ __decorate([
52
67
  format: 'date-time',
53
68
  example: '2025-06-01',
54
69
  }),
70
+ (0, class_validator_1.IsOptional)(),
71
+ (0, class_validator_1.IsString)({ message: 'La data scadenza password deve essere una stringa.' }),
55
72
  __metadata("design:type", String)
56
73
  ], UserDto.prototype, "dataScadenzaPassword", void 0);
57
74
  __decorate([
@@ -60,6 +77,8 @@ __decorate([
60
77
  format: 'date-time',
61
78
  example: '2024-03-15T14:45:00Z',
62
79
  }),
80
+ (0, class_validator_1.IsOptional)(),
81
+ (0, class_validator_1.IsString)({ message: 'La data ultimo accesso deve essere una stringa.' }),
63
82
  __metadata("design:type", String)
64
83
  ], UserDto.prototype, "dataLastLogin", void 0);
65
84
  __decorate([
@@ -68,6 +87,8 @@ __decorate([
68
87
  enum: StatoRegistrazione_1.StatoRegistrazione,
69
88
  example: StatoRegistrazione_1.StatoRegistrazione.CONF,
70
89
  }),
90
+ (0, class_validator_1.IsOptional)(),
91
+ (0, class_validator_1.IsEnum)(StatoRegistrazione_1.StatoRegistrazione, { message: 'Lo stato di registrazione non e valido.' }),
71
92
  __metadata("design:type", Number)
72
93
  ], UserDto.prototype, "statoRegistrazione", void 0);
73
94
  __decorate([
@@ -75,14 +96,22 @@ __decorate([
75
96
  description: "Chiave di registrazione dell'utente.",
76
97
  example: 'abc123xyz',
77
98
  }),
99
+ (0, class_validator_1.IsOptional)(),
100
+ (0, class_validator_1.IsString)({ message: 'La chiave registrazione deve essere una stringa.' }),
78
101
  __metadata("design:type", String)
79
102
  ], UserDto.prototype, "keyRegistrazione", void 0);
80
103
  __decorate([
81
104
  (0, swagger_1.ApiPropertyOptional)({ description: "Cognome dell'utente.", example: 'Rossi' }),
105
+ (0, class_validator_1.IsOptional)(),
106
+ (0, class_validator_1.IsString)({ message: 'Il cognome deve essere una stringa.' }),
107
+ (0, class_validator_1.Length)(1, 255, { message: 'Il cognome deve essere compreso tra 1 e 255 caratteri.' }),
82
108
  __metadata("design:type", String)
83
109
  ], UserDto.prototype, "cognome", void 0);
84
110
  __decorate([
85
111
  (0, swagger_1.ApiPropertyOptional)({ description: "Nome dell'utente.", example: 'Mario' }),
112
+ (0, class_validator_1.IsOptional)(),
113
+ (0, class_validator_1.IsString)({ message: 'Il nome deve essere una stringa.' }),
114
+ (0, class_validator_1.Length)(1, 255, { message: 'Il nome deve essere compreso tra 1 e 255 caratteri.' }),
86
115
  __metadata("design:type", String)
87
116
  ], UserDto.prototype, "nome", void 0);
88
117
  __decorate([
@@ -91,6 +120,8 @@ __decorate([
91
120
  example: 'https://example.com/avatar.jpg',
92
121
  nullable: true,
93
122
  }),
123
+ (0, class_validator_1.IsOptional)(),
124
+ (0, class_validator_1.IsString)({ message: "L'avatar deve essere una stringa." }),
94
125
  __metadata("design:type", String)
95
126
  ], UserDto.prototype, "avatar", void 0);
96
127
  __decorate([
@@ -98,10 +129,15 @@ __decorate([
98
129
  description: "Flag che indica se l'autenticazione a due fattori è attivata.",
99
130
  example: true,
100
131
  }),
132
+ (0, class_validator_1.IsOptional)(),
133
+ (0, class_validator_1.IsBoolean)({ message: 'Il flag due fattori deve essere booleano.' }),
101
134
  __metadata("design:type", Boolean)
102
135
  ], UserDto.prototype, "flagDueFattori", void 0);
103
136
  __decorate([
104
137
  (0, swagger_1.ApiPropertyOptional)({ description: 'Codice lingua preferito.', example: 'it' }),
138
+ (0, class_validator_1.IsOptional)(),
139
+ (0, class_validator_1.IsString)({ message: 'Il codice lingua deve essere una stringa.' }),
140
+ (0, class_validator_1.Length)(1, 20, { message: 'Il codice lingua deve essere compreso tra 1 e 20 caratteri.' }),
105
141
  __metadata("design:type", String)
106
142
  ], UserDto.prototype, "codiceLingua", void 0);
107
143
  __decorate([
@@ -110,17 +146,24 @@ __decorate([
110
146
  example: '+393401234567',
111
147
  nullable: true,
112
148
  }),
149
+ (0, class_validator_1.IsOptional)(),
150
+ (0, class_validator_1.IsString)({ message: 'Il cellulare deve essere una stringa.' }),
151
+ (0, class_validator_1.Length)(1, 50, { message: 'Il cellulare deve essere compreso tra 1 e 50 caratteri.' }),
113
152
  __metadata("design:type", String)
114
153
  ], UserDto.prototype, "cellulare", void 0);
115
154
  __decorate([
116
155
  (0, swagger_1.ApiPropertyOptional)({ description: 'Flag superutente.', example: false }),
156
+ (0, class_validator_1.IsOptional)(),
157
+ (0, class_validator_1.IsBoolean)({ message: 'Il flag superutente deve essere booleano.' }),
117
158
  __metadata("design:type", Boolean)
118
159
  ], UserDto.prototype, "flagSuper", void 0);
119
160
  __decorate([
120
161
  (0, swagger_1.ApiPropertyOptional)({
121
162
  description: "Flag che indica se l'utente è configuratore",
122
- example: false
163
+ example: false,
123
164
  }),
165
+ (0, class_validator_1.IsOptional)(),
166
+ (0, class_validator_1.IsBoolean)({ message: 'Il flag configuratore deve essere booleano.' }),
124
167
  __metadata("design:type", Boolean)
125
168
  ], UserDto.prototype, "flagAdminConfigurator", void 0);
126
169
  __decorate([
@@ -128,21 +171,39 @@ __decorate([
128
171
  description: "Pagina di default dell'utente all'accesso.",
129
172
  example: '/dashboard',
130
173
  }),
174
+ (0, class_validator_1.IsOptional)(),
175
+ (0, class_validator_1.IsString)({ message: 'La pagina di default deve essere una stringa.' }),
131
176
  __metadata("design:type", String)
132
177
  ], UserDto.prototype, "paginaDefault", void 0);
178
+ __decorate([
179
+ (0, swagger_1.ApiPropertyOptional)({
180
+ description: "Numero MAC associato all'utente.",
181
+ example: 12,
182
+ }),
183
+ __metadata("design:type", Number)
184
+ ], UserDto.prototype, "nummac", void 0);
133
185
  __decorate([
134
186
  (0, swagger_1.ApiPropertyOptional)({
135
187
  description: 'Metadata JSON personalizzato.',
136
188
  example: '{"theme": "dark"}',
137
189
  }),
190
+ (0, class_validator_1.IsOptional)(),
191
+ (0, class_validator_1.IsString)({ message: 'I metadata JSON devono essere una stringa.' }),
138
192
  __metadata("design:type", String)
139
193
  ], UserDto.prototype, "jsonMetadata", void 0);
140
194
  __decorate([
141
195
  (0, swagger_1.ApiPropertyOptional)({ description: 'Ragione sociale cliente.', example: 'ACME Corp SpA' }),
196
+ (0, class_validator_1.IsOptional)(),
197
+ (0, class_validator_1.IsString)({ message: 'La ragione sociale deve essere una stringa.' }),
142
198
  __metadata("design:type", String)
143
199
  ], UserDto.prototype, "ragSocCli", void 0);
144
200
  __decorate([
145
201
  (0, swagger_1.ApiPropertyOptional)({ description: "Ruoli assegnati all'utente.", example: [1, 2] }),
202
+ (0, class_validator_1.IsOptional)(),
203
+ (0, class_validator_1.IsArray)({ message: 'I ruoli devono essere un array.' }),
204
+ (0, class_validator_1.ArrayUnique)({ message: 'I ruoli non possono contenere duplicati.' }),
205
+ (0, class_transformer_1.Type)(() => Number),
206
+ (0, class_validator_1.IsInt)({ each: true, message: 'Ogni ruolo deve essere un intero.' }),
146
207
  __metadata("design:type", Array)
147
208
  ], UserDto.prototype, "roles", void 0);
148
209
  __decorate([
@@ -151,6 +212,10 @@ __decorate([
151
212
  type: [Permission_1.Permission],
152
213
  example: [{ codiceMenu: 'MNUOFFICINA', tipoAbilitazione: TipoAbilitazione_1.TipoAbilitazione.SCRITTURA }],
153
214
  }),
215
+ (0, class_validator_1.IsOptional)(),
216
+ (0, class_validator_1.IsArray)({ message: 'I permessi devono essere un array.' }),
217
+ (0, class_validator_1.ValidateNested)({ each: true }),
218
+ (0, class_transformer_1.Type)(() => Permission_1.Permission),
154
219
  __metadata("design:type", Array)
155
220
  ], UserDto.prototype, "permissions", void 0);
156
221
  //# sourceMappingURL=UserDto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserDto.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/UserDto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6E;AAC7E,6DAA0D;AAC1D,6CAA0C;AAC1C,yDAAsD;AACtD,iDAA8C;AAE9C,MAAa,OAAQ,SAAQ,IAAA,kBAAQ,EAAC,2BAAY,EAAE,CAAC,QAAQ,CAAU,CAAC;CAkHvE;AAlHD,0BAkHC;AAhHC;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4CAA4C,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;;6CACzE;AAGrB;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;;sCACpE;AAGd;IADC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;yCACtE;AAOnB;IALC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,gCAAgC;Q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AI,EAAE,CAAC;;6CAC1D;AAOtB;IALC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,sBAAsB;QACnC,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,IAAI;KACf,CAAC;;0CACwB;AAG1B;IADC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;0CACtD;AAMpB;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,6CAA6C;QAC1D,OAAO,EAAE,KAAK;KACf,CAAC;;sDAC8B;AAMhC;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,4CAA4C;QACzD,OAAO,EAAE,YAAY;KACtB,CAAC;;8CACqB;AAMvB;IAJC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,+BAA+B;QAC5C,OAAO,EAAE,mBAAmB;KAC7B,CAAC;;6CACoB;AAGtB;IADC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;;0CACxE;AAGnB;IADC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,OAAO,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,CAAC;;sCACnE;AAOjB;IALC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,gCAAgC;QAC7C,IAAI,EAAE,CAAC,uBAAU,CAAC;QAClB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,mCAAgB,CAAC,SAAS,EAAE,CAAC;KACvF,CAAC;;4CACyB","sourcesContent":["import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger';\nimport { StatoRegistrazione } from './StatoRegistrazione';\nimport { Permission } from './Permission';\nimport { TipoAbilitazione } from './TipoAbilitazione';\nimport { FiltriUtente } from './FiltriUtente';\n\nexport class UserDto extends OmitType(FiltriUtente, ['codUte'] as const) {\n @ApiProperty({ description: \"Codice identificativo univoco dell'utente.\", example: 'USR123' })\n codiceUtente: number;\n\n @ApiProperty({ description: \"Email dell'utente.\", example: 'mario.rossi@dev.it' })\n email: string;\n\n @ApiPropertyOptional({ description: \"Flag per l'accettazione del GDPR.\", example: true })\n flagGdpr?: boolean;\n\n @ApiPropertyOptional({\n description: 'Data di accettazione del GDPR.',\n format: 'date-time',\n example: '2024-03-18T12:34:56Z',\n })\n dataGdpr?: string;\n\n @ApiPropertyOptional({\n description: \"Data di inserimento dell'utente nel sistema.\",\n format: 'date-time',\n example: '2023-01-01T08:30:00Z',\n })\n dataInserimento?: string;\n\n @ApiPropertyOptional({\n description: 'Data scadenza password.',\n format: 'date-time',\n example: '2025-06-01',\n })\n dataScadenzaPassword?: string;\n\n @ApiPropertyOptional({\n description: \"Ultima data di accesso dell'utente.\",\n format: 'date-time',\n example: '2024-03-15T14:45:00Z',\n })\n dataLastLogin?: string;\n\n @ApiPropertyOptional({\n description: \"Stato della registrazione dell'utente.\",\n enum: StatoRegistrazione,\n example: StatoRegistrazione.CONF,\n })\n statoRegistrazione?: StatoRegistrazione;\n\n @ApiPropertyOptional({\n description: \"Chiave di registrazione dell'utente.\",\n example: 'abc123xyz',\n })\n keyRegistrazione?: string;\n\n @ApiPropertyOptional({ description: \"Cognome dell'utente.\", example: 'Rossi' })\n cognome?: string;\n\n @ApiPropertyOptional({ description: \"Nome dell'utente.\", example: 'Mario' })\n nome?: string;\n\n @ApiPropertyOptional({\n description: 'Avatar (URL o base64).',\n example: 'https://example.com/avatar.jpg',\n nullable: true,\n })\n avatar?: string | null;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se l'autenticazione a due fattori è attivata.\",\n example: true,\n })\n flagDueFattori?: boolean;\n\n @ApiPropertyOptional({ description: 'Codice lingua preferito.', example: 'it' })\n codiceLingua?: string;\n\n @ApiPropertyOptional({\n description: 'Numero di cellulare.',\n example: '+393401234567',\n nullable: true,\n })\n cellulare?: string | null;\n\n @ApiPropertyOptional({ description: 'Flag superutente.', example: false })\n flagSuper?: boolean;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se l'utente è configuratore\",\n example: false\n })\n flagAdminConfigurator?: boolean;\n\n @ApiPropertyOptional({\n description: \"Pagina di default dell'utente all'accesso.\",\n example: '/dashboard',\n })\n paginaDefault?: string;\n\n @ApiPropertyOptional({\n description: 'Metadata JSON personalizzato.',\n example: '{\"theme\": \"dark\"}',\n })\n jsonMetadata?: string;\n\n @ApiPropertyOptional({ description: 'Ragione sociale cliente.', example: 'ACME Corp SpA' })\n ragSocCli?: string;\n\n @ApiPropertyOptional({ description: \"Ruoli assegnati all'utente.\", example: [1,2] })\n roles?: number[];\n\n @ApiPropertyOptional({\n description: \"Permessi assegnati all'utente.\",\n type: [Permission],\n example: [{ codiceMenu: 'MNUOFFICINA', tipoAbilitazione: TipoAbilitazione.SCRITTURA }],\n })\n permissions?: Permission[];\n\n}\n"]}
1
+ {"version":3,"file":"UserDto.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/UserDto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6E;AAC7E,yDAAyC;AACzC,qDAWyB;AACzB,6DAA0D;AAC1D,6CAA0C;AAC1C,yDAAsD;AACtD,iDAA8C;AAE9C,MAAa,OAAQ,SAAQ,IAAA,kBAAQ,EAAC,2BAAY,EAAE,CAAC,QAAQ,CAAU,CAAC;CA+KvE;AA/KD,0BA+KC;AAzKC;IALC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4CAA4C,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IAC7F,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,uBAAK,EAAC,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;IAC7D,IAAA,qBAAG,EAAC,CAAC,EAAE,EAAE,OAAO,EAAE,gDAAgD,EAAE,CAAC;;6CACjD;AAMrB;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AAI,EAAE,CAAC,uBAAU,CAAC;QAClB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,mCAAgB,CAAC,SAAS,EAAE,CAAC;KACvF,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,EAAE,OAAO,EAAE,oCAAoC,EAAE,CAAC;IAC1D,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,uBAAU,CAAC;;4CACI","sourcesContent":["import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger';\nimport { Type } from 'class-transformer';\nimport {\n ArrayUnique,\n IsArray,\n IsBoolean,\n IsEnum,\n IsInt,\n IsOptional,\n IsString,\n Length,\n Min,\n ValidateNested,\n} from 'class-validator';\nimport { StatoRegistrazione } from './StatoRegistrazione';\nimport { Permission } from './Permission';\nimport { TipoAbilitazione } from './TipoAbilitazione';\nimport { FiltriUtente } from './FiltriUtente';\n\nexport class UserDto extends OmitType(FiltriUtente, ['codUte'] as const) {\n @ApiProperty({ description: \"Codice identificativo univoco dell'utente.\", example: 'USR123' })\n @IsOptional()\n @Type(() => Number)\n @IsInt({ message: 'Il codice utente deve essere un intero.' })\n @Min(1, { message: 'Il codice utente deve essere maggiore di zero.' })\n codiceUtente: number;\n\n @ApiProperty({ description: \"Email dell'utente.\", example: 'mario.rossi@dev.it' })\n @IsOptional()\n @IsString({ message: \"L'email deve essere una stringa.\" })\n @Length(3, 254, { message: \"L'email deve essere compresa tra 3 e 254 caratteri.\" })\n email: string;\n\n @ApiPropertyOptional({ description: \"Flag per l'accettazione del GDPR.\", example: true })\n @IsOptional()\n @IsBoolean({ message: 'Il flag GDPR deve essere booleano.' })\n flagGdpr?: boolean;\n\n @ApiPropertyOptional({\n description: 'Data di accettazione del GDPR.',\n format: 'date-time',\n example: '2024-03-18T12:34:56Z',\n })\n @IsOptional()\n @IsString({ message: 'La data GDPR deve essere una stringa.' })\n dataGdpr?: string;\n\n @ApiPropertyOptional({\n description: \"Data di inserimento dell'utente nel sistema.\",\n format: 'date-time',\n example: '2023-01-01T08:30:00Z',\n })\n @IsOptional()\n @IsString({ message: 'La data di inserimento deve essere una stringa.' })\n dataInserimento?: string;\n\n @ApiPropertyOptional({\n description: 'Data scadenza password.',\n format: 'date-time',\n example: '2025-06-01',\n })\n @IsOptional()\n @IsString({ message: 'La data scadenza password deve essere una stringa.' })\n dataScadenzaPassword?: string;\n\n @ApiPropertyOptional({\n description: \"Ultima data di accesso dell'utente.\",\n format: 'date-time',\n example: '2024-03-15T14:45:00Z',\n })\n @IsOptional()\n @IsString({ message: 'La data ultimo accesso deve essere una stringa.' })\n dataLastLogin?: string;\n\n @ApiPropertyOptional({\n description: \"Stato della registrazione dell'utente.\",\n enum: StatoRegistrazione,\n example: StatoRegistrazione.CONF,\n })\n @IsOptional()\n @IsEnum(StatoRegistrazione, { message: 'Lo stato di registrazione non e valido.' })\n statoRegistrazione?: StatoRegistrazione;\n\n @ApiPropertyOptional({\n description: \"Chiave di registrazione dell'utente.\",\n example: 'abc123xyz',\n })\n @IsOptional()\n @IsString({ message: 'La chiave registrazione deve essere una stringa.' })\n keyRegistrazione?: string;\n\n @ApiPropertyOptional({ description: \"Cognome dell'utente.\", example: 'Rossi' })\n @IsOptional()\n @IsString({ message: 'Il cognome deve essere una stringa.' })\n @Length(1, 255, { message: 'Il cognome deve essere compreso tra 1 e 255 caratteri.' })\n cognome?: string;\n\n @ApiPropertyOptional({ description: \"Nome dell'utente.\", example: 'Mario' })\n @IsOptional()\n @IsString({ message: 'Il nome deve essere una stringa.' })\n @Length(1, 255, { message: 'Il nome deve essere compreso tra 1 e 255 caratteri.' })\n nome?: string;\n\n @ApiPropertyOptional({\n description: 'Avatar (URL o base64).',\n example: 'https://example.com/avatar.jpg',\n nullable: true,\n })\n @IsOptional()\n @IsString({ message: \"L'avatar deve essere una stringa.\" })\n avatar?: string | null;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se l'autenticazione a due fattori è attivata.\",\n example: true,\n })\n @IsOptional()\n @IsBoolean({ message: 'Il flag due fattori deve essere booleano.' })\n flagDueFattori?: boolean;\n\n @ApiPropertyOptional({ description: 'Codice lingua preferito.', example: 'it' })\n @IsOptional()\n @IsString({ message: 'Il codice lingua deve essere una stringa.' })\n @Length(1, 20, { message: 'Il codice lingua deve essere compreso tra 1 e 20 caratteri.' })\n codiceLingua?: string;\n\n @ApiPropertyOptional({\n description: 'Numero di cellulare.',\n example: '+393401234567',\n nullable: true,\n })\n @IsOptional()\n @IsString({ message: 'Il cellulare deve essere una stringa.' })\n @Length(1, 50, { message: 'Il cellulare deve essere compreso tra 1 e 50 caratteri.' })\n cellulare?: string | null;\n\n @ApiPropertyOptional({ description: 'Flag superutente.', example: false })\n @IsOptional()\n @IsBoolean({ message: 'Il flag superutente deve essere booleano.' })\n flagSuper?: boolean;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se l'utente è configuratore\",\n example: false,\n })\n @IsOptional()\n @IsBoolean({ message: 'Il flag configuratore deve essere booleano.' })\n flagAdminConfigurator?: boolean;\n\n @ApiPropertyOptional({\n description: \"Pagina di default dell'utente all'accesso.\",\n example: '/dashboard',\n })\n @IsOptional()\n @IsString({ message: 'La pagina di default deve essere una stringa.' })\n paginaDefault?: string;\n\n @ApiPropertyOptional({\n description: \"Numero MAC associato all'utente.\",\n example: 12,\n })\n nummac?: number;\n\n @ApiPropertyOptional({\n description: 'Metadata JSON personalizzato.',\n example: '{\"theme\": \"dark\"}',\n })\n @IsOptional()\n @IsString({ message: 'I metadata JSON devono essere una stringa.' })\n jsonMetadata?: string;\n\n @ApiPropertyOptional({ description: 'Ragione sociale cliente.', example: 'ACME Corp SpA' })\n @IsOptional()\n @IsString({ message: 'La ragione sociale deve essere una stringa.' })\n ragSocCli?: string;\n\n @ApiPropertyOptional({ description: \"Ruoli assegnati all'utente.\", example: [1, 2] })\n @IsOptional()\n @IsArray({ message: 'I ruoli devono essere un array.' })\n @ArrayUnique({ message: 'I ruoli non possono contenere duplicati.' })\n @Type(() => Number)\n @IsInt({ each: true, message: 'Ogni ruolo deve essere un intero.' })\n roles?: number[];\n\n @ApiPropertyOptional({\n description: \"Permessi assegnati all'utente.\",\n type: [Permission],\n example: [{ codiceMenu: 'MNUOFFICINA', tipoAbilitazione: TipoAbilitazione.SCRITTURA }],\n })\n @IsOptional()\n @IsArray({ message: 'I permessi devono essere un array.' })\n @ValidateNested({ each: true })\n @Type(() => Permission)\n permissions?: Permission[];\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import { AccessiOptions } from "../../AccessiModule";
2
- import { UserService } from "../UserService/UserService";
3
- import { PermissionService } from "../PermissionService/PermissionService";
4
2
  import { LoginRequest } from "../../Dtos/LoginRequest";
5
3
  import { LoginResult } from "../../Dtos/LoginResponse";
4
+ import { UserService } from "../UserService/UserService";
5
+ import { PermissionService } from "../PermissionService/PermissionService";
6
6
  import { FiltriService } from "../FiltriService/FiltriService";
7
7
  export declare class AuthService {
8
8
  private userService;
@@ -10,9 +10,13 @@ export declare class AuthService {
10
10
  private filtriService;
11
11
  private readonly accessiOptions;
12
12
  constructor(userService: UserService, permissionService: PermissionService, filtriService: FiltriService, accessiOptions: AccessiOptions);
13
+ private refreshPasswordExpiration;
14
+ private isMockDemoUserEnabled;
13
15
  login(request: LoginRequest): Promise<LoginResult>;
16
+ getAuthenticatedTokenPayload(token: string): Promise<Record<string, unknown>>;
14
17
  setPassword(codiceUtente: number, nuovaPassword: string): Promise<any>;
15
- verifyPassword(codiceUtente: number, passwordCifrata: string): Promise<boolean>;
18
+ migrateLegacyEncryptedPasswords(): Promise<void>;
19
+ verifyPassword(codiceUtente: number, plainPassword: string): Promise<boolean>;
16
20
  getAdminUser(): Promise<LoginResult>;
17
21
  getDemoUser(): LoginResult;
18
22
  confirmResetPassword(token: string, newPassword: string): Promise<void>;