@itentialopensource/adapter-utils 4.48.14 → 4.48.15

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
@@ -1,4 +1,14 @@
1
1
 
2
+ ## 4.48.15 [05-09-2023]
3
+
4
+ * Add healthcheck headers to adapter properties
5
+
6
+ Closes ADAPT-2662
7
+
8
+ See merge request itentialopensource/adapter-utils!256
9
+
10
+ ---
11
+
2
12
  ## 4.48.14 [05-09-2023]
3
13
 
4
14
  * modified connectorRest.js so that if there is a field named 'ca_file_content'...
@@ -256,6 +256,7 @@ class AdapterPropertyUtil {
256
256
  }
257
257
 
258
258
  // Merge the information into the entity schema
259
+ entitySchema.name = actionName;
259
260
  entitySchema.protocol = actionInfo.protocol;
260
261
  entitySchema.method = actionInfo.method;
261
262
  entitySchema.timeout = actionInfo.timeout;
@@ -690,6 +691,7 @@ class AdapterPropertyUtil {
690
691
  };
691
692
 
692
693
  // Merge the information into the entity schema
694
+ entitySchema.name = actionName;
693
695
  entitySchema.protocol = actionInfo.protocol;
694
696
  entitySchema.method = actionInfo.method;
695
697
  entitySchema.timeout = actionInfo.timeout;
@@ -24,6 +24,7 @@ let encodePath = true;
24
24
  let encodeUri = true;
25
25
  let stripEscapes = false;
26
26
  let returnResponseHeaders = true;
27
+ let healthcheckHeaders = null;
27
28
  // INTERNAL FUNCTIONS
28
29
  /*
29
30
  * INTERNAL FUNCTION: Get the best match for the mock data response
@@ -825,6 +826,13 @@ function mergeHeaders(addlHeaders, entitySchema) {
825
826
  thisAHdata = transUtilInst.mergeObjects(thisAHdata, entitySchema.headers);
826
827
  }
827
828
 
829
+ // add healthcheck headers if there are healthcheck headers to add
830
+ if (entitySchema && entitySchema.name === 'healthcheck') {
831
+ if (healthcheckHeaders && Object.keys(healthcheckHeaders).length > 0) {
832
+ thisAHdata = transUtilInst.mergeObjects(thisAHdata, healthcheckHeaders);
833
+ }
834
+ }
835
+
828
836
  // only add global headers if there are global headers to add
829
837
  if (globalRequestGl && globalRequestGl.addlHeaders && Object.keys(globalRequestGl.addlHeaders).length > 0) {
830
838
  thisAHdata = transUtilInst.mergeObjects(thisAHdata, globalRequestGl.addlHeaders);
@@ -1051,6 +1059,10 @@ class RestHandler {
1051
1059
  if (typeof properties.request.returnResponseHeaders === 'boolean') {
1052
1060
  returnResponseHeaders = properties.request.returnResponseHeaders;
1053
1061
  }
1062
+
1063
+ if (properties.healthcheck && typeof properties.healthcheck.addlHeaders === 'object') {
1064
+ healthcheckHeaders = properties.healthcheck.addlHeaders;
1065
+ }
1054
1066
  }
1055
1067
 
1056
1068
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-utils",
3
- "version": "4.48.14",
3
+ "version": "4.48.15",
4
4
  "description": "Itential Adapter Utility Libraries",
5
5
  "scripts": {
6
6
  "postinstall": "node utils/setup.js",