emilsoftware-utilities 1.4.0-dev.2 → 1.4.0

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.
@@ -8,7 +8,5 @@ export declare class EmailController {
8
8
  serveResetPasswordPage(res: Response, token: string, returnUrl?: string): Promise<void>;
9
9
  sendPasswordResetEmail(request: Request, sendResetPasswordData: {
10
10
  email: string;
11
- resetUrlCustom?: string;
12
- htmlMail?: string;
13
11
  }, res: Response): Promise<Response<any, Record<string, any>>>;
14
12
  }
@@ -41,7 +41,7 @@ let EmailController = EmailController_1 = class EmailController {
41
41
  sendPasswordResetEmail(request, sendResetPasswordData, res) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
43
  try {
44
- yield this.emailService.sendPasswordResetEmail(sendResetPasswordData.email, sendResetPasswordData.resetUrlCustom, sendResetPasswordData.htmlMail);
44
+ yield this.emailService.sendPasswordResetEmail(sendResetPasswordData.email);
45
45
  return Utilities_1.RestUtilities.sendOKMessage(res, "L'email di reset è stata inoltrata al destinatario.");
46
46
  }
47
47
  catch (error) {
@@ -66,22 +66,7 @@ __decorate([
66
66
  ], EmailController.prototype, "serveResetPasswordPage", null);
67
67
  __decorate([
68
68
  (0, swagger_1.ApiOperation)({ summary: 'Invia una e-mail per il reset della password', operationId: "sendPasswordResetEmail" }),
69
- (0, swagger_1.ApiBody)({ schema: { properties: {
70
- email: {
71
- type: 'string',
72
- description: "L'email dell'utente che richiede il reset"
73
- },
74
- resetCustomUrl: {
75
- type: 'string',
76
- description: "Pagina di reset della password personalizzata",
77
- },
78
- htmlMail: {
79
- type: 'string',
80
- description: 'Corpo della mail in HTML'
81
- }
82
- },
83
- required: ['email']
84
- } }),
69
+ (0, swagger_1.ApiBody)({ schema: { properties: { email: { type: 'string', description: "L'email dell'utente che richiede il reset" } } } }),
85
70
  (0, swagger_1.ApiResponse)({ status: 200, description: "L'email di reset è stata inviata con successo" }),
86
71
  (0, swagger_1.ApiResponse)({ status: 400, description: "Errore nella richiesta: protocollo o host non impostati" }),
87
72
  (0, swagger_1.ApiResponse)({ status: 500, description: "Errore interno durante l'invio dell'email" }),
@@ -4,6 +4,6 @@ export declare class EmailService {
4
4
  constructor(accessiOptions: AccessiOptions);
5
5
  sendAccountUpdateEmail(email: string, message: string): Promise<void>;
6
6
  private transporter;
7
- sendPasswordResetEmail(email: string, resetUrlCustom?: string, htmlMail?: string): Promise<void>;
7
+ sendPasswordResetEmail(email: string): Promise<void>;
8
8
  private GetHtmlMail;
9
9
  }
@@ -38,7 +38,7 @@ let EmailService = class EmailService {
38
38
  sendAccountUpdateEmail(email, message) {
39
39
  throw new Error('Method not implemented.');
40
40
  }
41
- sendPasswordResetEmail(email, resetUrlCustom, htmlMail) {
41
+ sendPasswordResetEmail(email) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
43
  var _a;
44
44
  try {
@@ -50,17 +50,9 @@ let EmailService = class EmailService {
50
50
  }
51
51
  const returnUrlQueryParams = "?returnUrl=" + this.accessiOptions.confirmationEmailReturnUrl + "&prefix=" + ((_a = this.accessiOptions.confirmationEmailPrefix) !== null && _a !== void 0 ? _a : '');
52
52
  const { confirmationEmailUrl } = this.accessiOptions;
53
- let resetUrl = `${confirmationEmailUrl}/api/accessi/email/reset-password-page/${resetToken}${returnUrlQueryParams}`;
54
- if (resetUrlCustom) {
55
- resetUrl = resetUrlCustom + "?token=" + resetToken;
56
- }
53
+ const resetUrl = `${confirmationEmailUrl}/api/accessi/email/reset-password-page/${resetToken}${returnUrlQueryParams}`;
57
54
  let sPhrase;
58
- if (htmlMail) {
59
- sPhrase = htmlMail;
60
- sPhrase.replace('#link_conferma_password_url', resetUrl);
61
- }
62
- else {
63
- sPhrase = ` Gentile utente,<br>
55
+ sPhrase = ` Gentile utente,<br>
64
56
  abbiamo ricevuto la tua richiesta.<br><br>
65
57
 
66
58
  Per completare l'operazione, clicca sul link qui sotto:<br>
@@ -72,7 +64,6 @@ let EmailService = class EmailService {
72
64
  Questa è una comunicazione automatica, ti preghiamo di non rispondere a questa email.<br><br>
73
65
 
74
66
  Grazie.<br>`;
75
- }
76
67
  const html = this.GetHtmlMail(sPhrase);
77
68
  const mailOptions = {
78
69
  from: this.accessiOptions.emailOptions.from,
@@ -89,7 +89,6 @@ let UserService = class UserService {
89
89
  if (options.includeGrants)
90
90
  userGrants = yield this.permissionService.getUserRolesAndGrants(user.codiceUtente);
91
91
  let extensionFields = options.includeExtensionFields ? {} : null;
92
- //todo: se non è prendente extensionFieldOptions va in errore. Risolvere il problema
93
92
  if (options.includeExtensionFields) {
94
93
  for (const ext of this.accessiOptions.extensionFieldsOptions) {
95
94
  const values = (yield Orm_1.Orm.query(ext.databaseOptions, `SELECT ${ext.tableFields.join(",")} FROM ${ext.tableName} WHERE ${ext.tableJoinFieldName} = ?`, [user.codiceUtente])).map(Utilities_1.RestUtilities.convertKeysToCamelCase);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emilsoftware-utilities",
3
- "version": "1.4.0-dev.2",
3
+ "version": "1.4.0",
4
4
  "description": "Utilities for EmilSoftware",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/README.MD DELETED
@@ -1,32 +0,0 @@
1
- 1. feat: → nuova feature
2
- Esempio: feat: aggiunta endpoint per notifiche
3
-
4
- Triggera: MINOR release (1.3.0 → 1.4.0)
5
-
6
- Su dev → 1.4.0-dev.0
7
-
8
- 2. fix: → correzione di bug
9
- Esempio: fix: gestione errore null in login
10
-
11
- Triggera: PATCH release (1.3.1)
12
-
13
- Su dev → 1.3.1-dev.0
14
-
15
- 3. BREAKING CHANGE: (in descrizione o ! nel tipo)
16
- Esempio:
17
- ```
18
- bash
19
- feat!: rimozione supporto legacy
20
- ```
21
-
22
- BREAKING CHANGE: cambia lo schema JWT
23
- Triggera: MAJOR release (1.0.0 → 2.0.0)
24
-
25
- 4. chore:, docs:, test:, refactor: ecc.
26
- Esempio: chore: aggiorna dipendenze
27
-
28
- Non triggerano release di default, a meno che tu non configuri esplicitamente nel commit-analyzer.
29
-
30
- 5. FORZA UNA RELEASE (utile in caso di merge ecc.):
31
- - git commit --allow-empty -m "feat: trigger test release"
32
- - git push origin dev OPPURE git push origin main