@mojaloop/sdk-scheme-adapter 24.2.0-csi-1210.2 → 24.2.0-csi-1210.3
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/.yarn/cache/{@mojaloop-sdk-standard-components-npm-19.9.0-snapshot.0-7fd1137ca5-1ea3c1ccc2.zip → @mojaloop-sdk-standard-components-npm-19.9.0-snapshot.1-35a191f95a-3de8196de7.zip} +0 -0
- package/.yarn/install-state.gz +0 -0
- package/modules/api-svc/package.json +1 -1
- package/modules/api-svc/src/lib/model/lib/requests/backendRequests.js +4 -3
- package/modules/api-svc/test/__mocks__/@mojaloop/sdk-standard-components.js +3 -1
- package/package.json +1 -1
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@mojaloop/logging-bc-client-lib": "0.5.8",
|
|
74
74
|
"@mojaloop/ml-schema-transformer-lib": "2.5.6",
|
|
75
75
|
"@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
|
|
76
|
-
"@mojaloop/sdk-standard-components": "v19.9.0-snapshot.
|
|
76
|
+
"@mojaloop/sdk-standard-components": "v19.9.0-snapshot.1",
|
|
77
77
|
"ajv": "8.17.1",
|
|
78
78
|
"axios": "1.8.1",
|
|
79
79
|
"body-parser": "1.20.3",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
******/
|
|
27
27
|
'use strict';
|
|
28
28
|
|
|
29
|
-
const http = require('http');
|
|
30
|
-
const {
|
|
29
|
+
const http = require('node:http');
|
|
30
|
+
const { createHttpRequester } = require('@mojaloop/sdk-standard-components').httpRequester;
|
|
31
31
|
const { buildUrl, HTTPResponseError } = require('./common');
|
|
32
32
|
|
|
33
33
|
|
|
@@ -38,6 +38,7 @@ class BackendRequests {
|
|
|
38
38
|
constructor(config) {
|
|
39
39
|
this.config = config;
|
|
40
40
|
this.logger = config.logger.push({ component: BackendRequests.name });
|
|
41
|
+
this.requester = createHttpRequester({ logger: this.logger });
|
|
41
42
|
|
|
42
43
|
// FSPID of THIS DFSP
|
|
43
44
|
this.dfspId = config.dfspId;
|
|
@@ -268,7 +269,7 @@ class BackendRequests {
|
|
|
268
269
|
async sendRequest(reqOptions) {
|
|
269
270
|
try {
|
|
270
271
|
this.logger.isVerboseEnabled && this.logger.push({ reqOptions }).verbose(`Executing HTTP ${reqOptions?.method}...`);
|
|
271
|
-
const res = await
|
|
272
|
+
const res = await this.requester.sendRequest({ ...reqOptions, agent: this.agent });
|
|
272
273
|
|
|
273
274
|
const data = (res.headers['content-length'] === '0' || res.statusCode === 204)
|
|
274
275
|
? null
|
|
@@ -32,6 +32,7 @@ const util = require('util');
|
|
|
32
32
|
const {
|
|
33
33
|
axios,
|
|
34
34
|
MojaloopRequests, Errors, WSO2Auth, Jws, Logger, common,
|
|
35
|
+
httpRequester,
|
|
35
36
|
Ilp: { ILP_VERSIONS }
|
|
36
37
|
} = jest.requireActual('@mojaloop/sdk-standard-components');
|
|
37
38
|
|
|
@@ -190,7 +191,7 @@ class MockJwsSigner {
|
|
|
190
191
|
constructor(config) {
|
|
191
192
|
assert(config.logger, 'Must supply a logger to JWS signer constructor');
|
|
192
193
|
this.config = config;
|
|
193
|
-
config.logger.
|
|
194
|
+
config.logger.info(`MockJwsSigner constructed with config: ${util.inspect(config)}`);
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
|
|
@@ -198,6 +199,7 @@ class MockJwsSigner {
|
|
|
198
199
|
module.exports = {
|
|
199
200
|
axios,
|
|
200
201
|
Ilp,
|
|
202
|
+
httpRequester,
|
|
201
203
|
MojaloopRequests: MockMojaloopRequests,
|
|
202
204
|
Jws: {
|
|
203
205
|
validator: MockJwsValidator,
|
package/package.json
CHANGED