@onlineapps/conn-orch-api-mapper 1.0.31 → 1.0.33
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/package.json +1 -1
- package/src/ApiMapper.js +8 -4
package/package.json
CHANGED
package/src/ApiMapper.js
CHANGED
|
@@ -39,9 +39,12 @@ class ApiMapper {
|
|
|
39
39
|
|
|
40
40
|
this.openApiSpec = config.openApiSpec;
|
|
41
41
|
this.serviceUrl = config.serviceUrl;
|
|
42
|
-
this.service = config.service;
|
|
42
|
+
this.service = config.service;
|
|
43
43
|
this.directCall = config.directCall === true;
|
|
44
|
-
|
|
44
|
+
if (!config.logger || typeof config.logger.warn !== 'function') {
|
|
45
|
+
throw new Error('[ApiMapper] Logger is required — Expected object with warn() method');
|
|
46
|
+
}
|
|
47
|
+
this.logger = config.logger;
|
|
45
48
|
|
|
46
49
|
// Parse OpenAPI to create operation map
|
|
47
50
|
this.operations = this._parseOpenApiSpec(this.openApiSpec);
|
|
@@ -198,7 +201,8 @@ class ApiMapper {
|
|
|
198
201
|
const getContentResolver = () => {
|
|
199
202
|
if (!contentResolver) {
|
|
200
203
|
contentResolver = new ContentAccessor({
|
|
201
|
-
context: { workflow_id: workflowId, step_id: stepId }
|
|
204
|
+
context: { workflow_id: workflowId, step_id: stepId },
|
|
205
|
+
logger: this.logger
|
|
202
206
|
});
|
|
203
207
|
}
|
|
204
208
|
return contentResolver;
|
|
@@ -459,7 +463,7 @@ class ApiMapper {
|
|
|
459
463
|
let resolver = null;
|
|
460
464
|
const getResolver = () => {
|
|
461
465
|
if (!resolver) {
|
|
462
|
-
resolver = new ContentAccessor();
|
|
466
|
+
resolver = new ContentAccessor({ logger: this.logger });
|
|
463
467
|
}
|
|
464
468
|
return resolver;
|
|
465
469
|
};
|