@mojaloop/central-services-shared 18.30.7-snapshot.2 → 18.30.7

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [18.30.7](https://github.com/mojaloop/central-services-shared/compare/v18.30.6...v18.30.7) (2025-08-08)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * http keep alive new object ([#473](https://github.com/mojaloop/central-services-shared/issues/473)) ([ef4b287](https://github.com/mojaloop/central-services-shared/commit/ef4b2871d6f0c39319d55efa8e512de5d9483cff))
11
+
5
12
  ### [18.30.6](https://github.com/mojaloop/central-services-shared/compare/v18.30.5...v18.30.6) (2025-07-23)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/central-services-shared",
3
- "version": "18.30.7-snapshot.2",
3
+ "version": "18.30.7",
4
4
  "description": "Shared code for mojaloop central services",
5
5
  "license": "Apache-2.0",
6
6
  "author": "ModusBox",
@@ -28,8 +28,10 @@
28
28
 
29
29
  'use strict'
30
30
 
31
- const { logger } = require('../logger')
32
- const { statusEnum } = require('./HealthCheckEnums')
31
+ const {
32
+ statusEnum
33
+ } = require('./HealthCheckEnums')
34
+ const Logger = require('@mojaloop/central-services-logger')
33
35
 
34
36
  /**
35
37
  * @class HealthCheck
@@ -80,7 +82,6 @@ class HealthCheck {
80
82
  constructor (packageJson, serviceChecks) {
81
83
  this.packageJson = packageJson
82
84
  this.serviceChecks = serviceChecks
83
- this.log = logger.child({ component: this.constructor.name })
84
85
 
85
86
  this.getHealth = this.getHealth.bind(this)
86
87
  }
@@ -109,7 +110,7 @@ class HealthCheck {
109
110
  services
110
111
  }
111
112
  } catch (err) {
112
- this.log.warn(`HealthCheck.getHealth failed with error: ${err?.message}`)
113
+ Logger.isErrorEnabled && Logger.error(`HealthCheck.getSubServiceHealth failed with error: ${err.message}`)
113
114
  isHealthy = false
114
115
  }
115
116
 
package/src/index.d.ts CHANGED
@@ -778,7 +778,7 @@ declare namespace CentralServicesShared {
778
778
  RedisCache: RedisCache;
779
779
  }
780
780
 
781
- type RedisInstanceConfig =
781
+ type RedisInstanceConfig =
782
782
  | {
783
783
  type: 'redis';
784
784
  host: string;
@@ -830,69 +830,7 @@ declare namespace CentralServicesShared {
830
830
 
831
831
  const Enum: Enum
832
832
  const Util: Util
833
-
834
- namespace HealthCheck {
835
- enum StatusEnum {
836
- OK = 'OK',
837
- DOWN = 'DOWN'
838
- }
839
-
840
- enum ServiceNameEnum {
841
- participantEndpointService = 'participantEndpointService',
842
- smtpServer = 'smtpServer',
843
- datastore = 'datastore',
844
- broker = 'broker',
845
- sidecar = 'sidecar',
846
- cache = 'cache',
847
- proxyCache = 'proxyCache'
848
- }
849
-
850
- enum ResponseCodeEnum {
851
- success = 200,
852
- gatewayTimeout = 502
853
- }
854
-
855
- interface SubServiceHealth {
856
- status: StatusEnum;
857
- service: ServiceNameEnum;
858
- }
859
-
860
- type ServiceCheckerFunc = (context?: any) => Promise<SubServiceHealth>;
861
-
862
- interface HealthCheckResult {
863
- status: StatusEnum;
864
- uptime: number;
865
- startTime: string;
866
- versionNumber: string;
867
- services?: SubServiceHealth[];
868
- }
869
-
870
- export const HealthCheckEnums: {
871
- responseCode: {
872
- success: ResponseCodeEnum.success;
873
- gatewayTimeout: ResponseCodeEnum.gatewayTimeout;
874
- };
875
- serviceName: {
876
- participantEndpointService: ServiceNameEnum.participantEndpointService;
877
- smtpServer: ServiceNameEnum.smtpServer;
878
- datastore: ServiceNameEnum.datastore;
879
- broker: ServiceNameEnum.broker;
880
- sidecar: ServiceNameEnum.sidecar;
881
- cache: ServiceNameEnum.cache;
882
- proxyCache: ServiceNameEnum.proxyCache;
883
- };
884
- statusEnum: {
885
- OK: StatusEnum.OK;
886
- DOWN: StatusEnum.DOWN;
887
- };
888
- }
889
-
890
- export class HealthCheck {
891
- constructor(packageJson: { version: string }, serviceChecks: ServiceCheckerFunc[]);
892
- getHealth(context?: any): Promise<HealthCheckResult>;
893
- static evaluateServiceHealth(services: SubServiceHealth[]): boolean;
894
- }
895
- }
833
+ const HealthCheck: any
896
834
 
897
835
  namespace mysql {
898
836
  class KnexWrapper {
@@ -125,10 +125,8 @@ const sendRequest = async ({
125
125
  data: payload, // todo: think, if it's better to transform to ISO format here (based on apiType)
126
126
  params,
127
127
  responseType,
128
- httpAgent: new http.Agent({ keepAlive: true }),
129
128
  ...axiosRequestOptionsOverride
130
129
  }
131
- requestOptions.httpAgent.toJSON = () => ({})
132
130
  // if jwsSigner is passed then sign the request
133
131
  if (jwsSigner != null && typeof (jwsSigner) === 'object') {
134
132
  requestOptions.headers['fspiop-signature'] = jwsSigner.getSignature(requestOptions)