@tmlmobilidade/databases 20260519.2044.20 → 20260519.2046.53

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.
@@ -54,11 +54,29 @@ export class GOMongoClient {
54
54
  retryWrites: true,
55
55
  serverSelectionTimeoutMS: 10_000,
56
56
  });
57
+ this.client.on('connectionPoolCreated', () => {
58
+ Logger.info('[GOMongoClient] Database connection pool created.');
59
+ });
60
+ this.client.on('topologyDescriptionChanged', () => {
61
+ Logger.info('[GOMongoClient] Database topology description changed.');
62
+ });
63
+ this.client.on('serverDescriptionChanged', () => {
64
+ Logger.info('[GOMongoClient] Database server description changed.');
65
+ });
66
+ this.client.on('open', () => {
67
+ Logger.info('[GOMongoClient] Database connection opened.');
68
+ });
69
+ this.client.on('connectionReady', () => {
70
+ Logger.info('[GOMongoClient] Database connection is ready.');
71
+ });
57
72
  this.client.on('close', () => {
58
- console.warn('[GOMongoClient] Database connection closed unexpectedly.');
73
+ Logger.error('[GOMongoClient] Database connection closed unexpectedly.');
59
74
  });
60
75
  this.client.on('reconnect', () => {
61
- console.log('[GOMongoClient] Database reconnected.');
76
+ Logger.info('[GOMongoClient] Database reconnected.');
77
+ });
78
+ this.client.on('error', (error) => {
79
+ Logger.error('[GOMongoClient] Database connection error:', error);
62
80
  });
63
81
  await this.client.connect();
64
82
  }
@@ -54,11 +54,29 @@ export class PCGIFileManagerClient {
54
54
  retryWrites: true,
55
55
  serverSelectionTimeoutMS: 10_000,
56
56
  });
57
+ this.client.on('connectionPoolCreated', () => {
58
+ Logger.info('[PCGIFileManagerClient] Database connection pool created.');
59
+ });
60
+ this.client.on('topologyDescriptionChanged', () => {
61
+ Logger.info('[PCGIFileManagerClient] Database topology description changed.');
62
+ });
63
+ this.client.on('serverDescriptionChanged', () => {
64
+ Logger.info('[PCGIFileManagerClient] Database server description changed.');
65
+ });
66
+ this.client.on('open', () => {
67
+ Logger.info('[PCGIFileManagerClient] Database connection opened.');
68
+ });
69
+ this.client.on('connectionReady', () => {
70
+ Logger.info('[PCGIFileManagerClient] Database connection is ready.');
71
+ });
57
72
  this.client.on('close', () => {
58
- console.warn('[PCGIFileManagerClient] Database connection closed unexpectedly.');
73
+ Logger.error('[PCGIFileManagerClient] Database connection closed unexpectedly.');
59
74
  });
60
75
  this.client.on('reconnect', () => {
61
- console.log('[PCGIFileManagerClient] Database reconnected.');
76
+ Logger.info('[PCGIFileManagerClient] Database reconnected.');
77
+ });
78
+ this.client.on('error', (error) => {
79
+ Logger.error('[PCGIFileManagerClient] Database connection error:', error);
62
80
  });
63
81
  await this.client.connect();
64
82
  }
@@ -55,28 +55,28 @@ export class PCGIRawClient {
55
55
  serverSelectionTimeoutMS: 10_000,
56
56
  });
57
57
  this.client.on('connectionPoolCreated', () => {
58
- console.log('[PCGIRawClient] Database connection pool created.');
58
+ Logger.info('[PCGIRawClient] Database connection pool created.');
59
59
  });
60
60
  this.client.on('topologyDescriptionChanged', () => {
61
- console.log('[PCGIRawClient] Database topology description changed.');
61
+ Logger.info('[PCGIRawClient] Database topology description changed.');
62
62
  });
63
63
  this.client.on('serverDescriptionChanged', () => {
64
- console.log('[PCGIRawClient] Database server description changed.');
64
+ Logger.info('[PCGIRawClient] Database server description changed.');
65
65
  });
66
66
  this.client.on('open', () => {
67
- console.log('[PCGIRawClient] Database connection opened.');
67
+ Logger.info('[PCGIRawClient] Database connection opened.');
68
68
  });
69
69
  this.client.on('connectionReady', () => {
70
- console.log('[PCGIRawClient] Database connection is ready.');
70
+ Logger.info('[PCGIRawClient] Database connection is ready.');
71
71
  });
72
72
  this.client.on('close', () => {
73
- console.warn('[PCGIRawClient] Database connection closed unexpectedly.');
73
+ Logger.error('[PCGIRawClient] Database connection closed unexpectedly.');
74
74
  });
75
75
  this.client.on('reconnect', () => {
76
- console.log('[PCGIRawClient] Database reconnected.');
76
+ Logger.info('[PCGIRawClient] Database reconnected.');
77
77
  });
78
78
  this.client.on('error', (error) => {
79
- console.error('[PCGIRawClient] Database connection error:', error);
79
+ Logger.error('[PCGIRawClient] Database connection error:', error);
80
80
  });
81
81
  await this.client.connect();
82
82
  }
@@ -54,11 +54,29 @@ export class PCGITicketingClient {
54
54
  retryWrites: true,
55
55
  serverSelectionTimeoutMS: 10_000,
56
56
  });
57
+ this.client.on('connectionPoolCreated', () => {
58
+ Logger.info('[PCGITicketingClient] Database connection pool created.');
59
+ });
60
+ this.client.on('topologyDescriptionChanged', () => {
61
+ Logger.info('[PCGITicketingClient] Database topology description changed.');
62
+ });
63
+ this.client.on('serverDescriptionChanged', () => {
64
+ Logger.info('[PCGITicketingClient] Database server description changed.');
65
+ });
66
+ this.client.on('open', () => {
67
+ Logger.info('[PCGITicketingClient] Database connection opened.');
68
+ });
69
+ this.client.on('connectionReady', () => {
70
+ Logger.info('[PCGITicketingClient] Database connection is ready.');
71
+ });
57
72
  this.client.on('close', () => {
58
- console.warn('[PCGITicketingClient] Database connection closed unexpectedly.');
73
+ Logger.error('[PCGITicketingClient] Database connection closed unexpectedly.');
59
74
  });
60
75
  this.client.on('reconnect', () => {
61
- console.log('[PCGITicketingClient] Database reconnected.');
76
+ Logger.info('[PCGITicketingClient] Database reconnected.');
77
+ });
78
+ this.client.on('error', (error) => {
79
+ Logger.error('[PCGITicketingClient] Database connection error:', error);
62
80
  });
63
81
  await this.client.connect();
64
82
  }
@@ -54,11 +54,29 @@ export class PCGIValidationsClient {
54
54
  retryWrites: true,
55
55
  serverSelectionTimeoutMS: 10_000,
56
56
  });
57
+ this.client.on('connectionPoolCreated', () => {
58
+ Logger.info('[PCGIValidationsClient] Database connection pool created.');
59
+ });
60
+ this.client.on('topologyDescriptionChanged', () => {
61
+ Logger.info('[PCGIValidationsClient] Database topology description changed.');
62
+ });
63
+ this.client.on('serverDescriptionChanged', () => {
64
+ Logger.info('[PCGIValidationsClient] Database server description changed.');
65
+ });
66
+ this.client.on('open', () => {
67
+ Logger.info('[PCGIValidationsClient] Database connection opened.');
68
+ });
69
+ this.client.on('connectionReady', () => {
70
+ Logger.info('[PCGIValidationsClient] Database connection is ready.');
71
+ });
57
72
  this.client.on('close', () => {
58
- console.warn('[PCGIValidationsClient] Database connection closed unexpectedly.');
73
+ Logger.error('[PCGIValidationsClient] Database connection closed unexpectedly.');
59
74
  });
60
75
  this.client.on('reconnect', () => {
61
- console.log('[PCGIValidationsClient] Database reconnected.');
76
+ Logger.info('[PCGIValidationsClient] Database reconnected.');
77
+ });
78
+ this.client.on('error', (error) => {
79
+ Logger.error('[PCGIValidationsClient] Database connection error:', error);
62
80
  });
63
81
  await this.client.connect();
64
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/databases",
3
- "version": "20260519.2044.20",
3
+ "version": "20260519.2046.53",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"