@manyos/smileconnect-api 1.36.0 → 1.36.1

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/conf/clients.json CHANGED
@@ -165,7 +165,14 @@
165
165
  "value": "Calbro Services and Weapons"
166
166
  }
167
167
  ],
168
- "scripts": {}
168
+ "scripts": {
169
+ "GET": {
170
+ "postMapping": [
171
+ "script1",
172
+ "script2"
173
+ ]
174
+ }
175
+ }
169
176
  },
170
177
  "change": {
171
178
  "fields": [
@@ -1,2 +1,2 @@
1
- //requestData.Status = "Horstdi2";
1
+ requestData.Status = "Horstdi2";
2
2
  resolve();
@@ -176,6 +176,15 @@ async function handleCMDBObjectResult(cmdbObject, mapping, clientConfig, include
176
176
  if (deleteClassId === true) {
177
177
  delete cmdbObject[CMDBOBJECT];
178
178
  }
179
+
180
+ const scripts = clientConfig[CMDBOBJECT].scripts.GET;
181
+ //const fields = clientConfig[ticketConfig.requestType].fields
182
+
183
+ //run preScripts
184
+ if (scripts && scripts.preMapping) {
185
+ await scriptController.runScripts(scripts.preMapping, cmdbObject, clientConfig.clientId);
186
+ }
187
+
179
188
  //Apply mapping
180
189
  mapping.forEach(function (mappingEntry) {
181
190
  try {
@@ -225,6 +234,11 @@ async function handleCMDBObjectResult(cmdbObject, mapping, clientConfig, include
225
234
 
226
235
  relationUtil.getRelatedObjectList(cmdbObject, includeArray, globalRelationObjects);
227
236
 
237
+ //run preScripts
238
+ if (scripts && scripts.postMapping) {
239
+ await scriptController.runScripts(scripts.postMapping, cmdbObject, clientConfig.clientId);
240
+ }
241
+
228
242
  return cmdbObject;
229
243
  }
230
244
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.36.0",
3
+ "version": "1.36.1",
4
4
  "description": "A proxy and abstraction layer for BMCs IT Service Management Suite",
5
5
  "main": "app.js",
6
6
  "scripts": {