pangea-server 3.3.25 → 3.3.27

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.
@@ -122,10 +122,19 @@ class Arca {
122
122
  };
123
123
  try {
124
124
  const res = await this.__afip.ElectronicBilling.createVoucher(params);
125
- return { voucherNumber, cae: res.CAE, caeExpirationDate: res.CAEFchVto };
125
+ const finalRes = { voucherNumber, cae: res.CAE, caeExpirationDate: res.CAEFchVto };
126
+ (0, helpers_1.printSuccess)('arca', 'Voucher created successfully');
127
+ console.log('params:');
128
+ console.log(params);
129
+ console.log('res:');
130
+ console.log(finalRes);
131
+ return finalRes;
126
132
  }
127
133
  catch (err) {
128
- (0, helpers_1.printDanger)('arca', err);
134
+ (0, helpers_1.printDanger)('arca', 'Error creating voucher');
135
+ console.log('params:');
136
+ console.log(params);
137
+ console.log(err);
129
138
  helpers_1.AppError.Throw({ statusCodeName: 'INTERNAL_SERVER_ERROR', errorCode: 'VOUCHER_CREATION_FAILED' });
130
139
  }
131
140
  }
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Mailer = void 0;
7
7
  const nodemailer_1 = __importDefault(require("nodemailer"));
8
+ // helpers
9
+ const helpers_1 = require("../helpers");
8
10
  class Mailer {
9
11
  constructor(config) {
10
12
  const { smtpProvider, port, auth, name } = config;
@@ -18,10 +20,18 @@ class Mailer {
18
20
  const finalOptions = { ...restOptions, from: from || (name ? `${name} <${this.__user}>` : this.__from) };
19
21
  try {
20
22
  const res = await this.__transporter.sendMail(finalOptions);
23
+ (0, helpers_1.printSuccess)('mailer', 'Mail sent successfully');
24
+ console.log('options:');
25
+ console.log(finalOptions);
26
+ console.log('res:');
27
+ console.log(res);
21
28
  return res;
22
29
  }
23
30
  catch (err) {
24
- console.log(`Error sending mail: ${finalOptions}`);
31
+ (0, helpers_1.printDanger)('mailer', 'Error sending mail');
32
+ console.log('options:');
33
+ console.log(finalOptions);
34
+ console.log(err);
25
35
  if (config?.throwError)
26
36
  throw err;
27
37
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-server",
3
3
  "description": "",
4
- "version": "3.3.25",
4
+ "version": "3.3.27",
5
5
  "files": [
6
6
  "dist"
7
7
  ],