@tmlmobilidade/external 20260616.2252.19 → 20260617.1703.12

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.
@@ -18,11 +18,11 @@ export class CPAuthClient {
18
18
  constructor() { }
19
19
  async getToken() {
20
20
  if (!this.token) {
21
- Logger.info('[CPAuthClient] No token found, fetching a new one...');
21
+ Logger.info({ message: '[CPAuthClient] No token found, fetching a new one...' });
22
22
  await this.connect();
23
23
  }
24
24
  if (this.expiresAt - Date.now() < 60 * 1000) {
25
- Logger.info('[CPAuthClient] Token is about to expire, refreshing...');
25
+ Logger.info({ message: '[CPAuthClient] Token is about to expire, refreshing...' });
26
26
  await this.connect();
27
27
  }
28
28
  return this.token;
@@ -49,7 +49,7 @@ export class CPAuthClient {
49
49
  }
50
50
  async connect() {
51
51
  //
52
- Logger.info('[CPAuthClient] Connecting and fetching token...');
52
+ Logger.info({ message: '[CPAuthClient] Connecting and fetching token...' });
53
53
  //
54
54
  // Get the authentication URL, which also sets up the SSH tunnel if needed.
55
55
  const port = await this.getAuthenticationPort();
@@ -159,7 +159,7 @@ export class CPAuthClient {
159
159
  this.tunnel = new SshTunnelService(sshConfig, sshOptions);
160
160
  await this.tunnel.connect();
161
161
  }
162
- Logger.info('[CPAuthClient] Setting up SSH Tunnel...');
162
+ Logger.info({ message: '[CPAuthClient] Setting up SSH Tunnel...' });
163
163
  const addr = this.tunnel.server.address();
164
164
  if (!addr || typeof addr !== 'object') {
165
165
  throw new Error('[CPAuthClient] Failed to retrieve SSH tunnel address.');
@@ -14,11 +14,11 @@ export class FertagusAuthClient {
14
14
  constructor() { }
15
15
  async getToken() {
16
16
  if (!this.token) {
17
- Logger.info('[FertagusAuthClient] No token found, fetching a new one...');
17
+ Logger.info({ message: '[FertagusAuthClient] No token found, fetching a new one...' });
18
18
  await this.connect();
19
19
  }
20
20
  if (this.expiresAt - Date.now() < 60 * 1000) {
21
- Logger.info('[FertagusAuthClient] Token is about to expire, refreshing...');
21
+ Logger.info({ message: '[FertagusAuthClient] Token is about to expire, refreshing...' });
22
22
  await this.connect();
23
23
  }
24
24
  return this.token;
@@ -45,7 +45,7 @@ export class FertagusAuthClient {
45
45
  }
46
46
  async connect() {
47
47
  //
48
- Logger.info('[FertagusAuthClient] Connecting and fetching token...');
48
+ Logger.info({ message: '[FertagusAuthClient] Connecting and fetching token...' });
49
49
  //
50
50
  // Make the POST request to the Authentication API through the SSH tunnel,
51
51
  // and handle the response, extracting the access token or throwing an error if the request fails.
@@ -16,11 +16,11 @@ export class MLAuthClient {
16
16
  constructor() { }
17
17
  async getToken() {
18
18
  if (!this.token) {
19
- Logger.info('[MLAuthClient] No token found, fetching a new one...');
19
+ Logger.info({ message: '[MLAuthClient] No token found, fetching a new one...' });
20
20
  await this.connect();
21
21
  }
22
22
  if (this.expiresAt - Date.now() < 60 * 1000) {
23
- Logger.info('[MLAuthClient] Token is about to expire, refreshing...');
23
+ Logger.info({ message: '[MLAuthClient] Token is about to expire, refreshing...' });
24
24
  await this.connect();
25
25
  }
26
26
  return this.token;
@@ -47,7 +47,7 @@ export class MLAuthClient {
47
47
  }
48
48
  async connect() {
49
49
  //
50
- Logger.info('[MLAuthClient] Connecting and fetching token...');
50
+ Logger.info({ message: '[MLAuthClient] Connecting and fetching token...' });
51
51
  //
52
52
  // Make the POST request to the Authentication API through the SSH tunnel,
53
53
  // and handle the response, extracting the access token or throwing an error if the request fails.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/external",
3
- "version": "20260616.2252.19",
3
+ "version": "20260617.1703.12",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"