@manyos/smileconnect-api 1.53.2 → 1.55.0

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/app.js CHANGED
@@ -266,6 +266,14 @@ app.use(function (req, res, next) {
266
266
  req.globalScriptParams = {
267
267
  query: req.query
268
268
  }
269
+ // Für Scripte einen globalen parameter bereitstellen, der den org. Body enthält. Damit hat man auch noch in Post Scripten Zugriff auf customAttributes die beim Mapping entfernt werden.
270
+ if (req.body) {
271
+ try {
272
+ req.globalScriptParams.sourceData = JSON.parse(JSON.stringify(req.body))
273
+ } catch (e) {
274
+ log.warn('Could not parse body', e)
275
+ }
276
+ }
269
277
  next()
270
278
  });
271
279
 
@@ -1,3 +1,5 @@
1
+ reject(globalScriptParams)
2
+
1
3
  try {
2
4
  const settings = {
3
5
  "createForm":"HPD:IncidentInterface_Create",
@@ -413,8 +413,14 @@ async function createCmdbObject(assetConfig, clientConfig, classId, ciData, glob
413
413
  await scriptController.runScripts(scripts.postMapping, ciData, clientConfig.clientId, globalScriptParams);
414
414
  }
415
415
 
416
- ciData['Data Set Id'] = "BMC.ASSET"
417
- ciData['400129200'] = reconId;
416
+ //Default to BMC.ASSET if no Dataset is provided
417
+ if (!ciData['Data Set Id']) {
418
+ ciData['Data Set Id'] = "BMC.ASSET"
419
+ }
420
+ //Add reconId only for Asset Dataset
421
+ if (ciData['Data Set Id'] !== "BMC.ASSET") {
422
+ ciData['400129200'] = reconId;
423
+ }
418
424
  ciData['Instance Id'] = instanceId;
419
425
 
420
426
  const update = await arquery.createEntry(classId, ciData);
package/docs/releases.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## API
4
4
 
5
+ ### 1.55.0 - 09.02.22
6
+ Allow CI creation in other datasets than BMC.ASSET. CI Relations not yet possible.
7
+
8
+ ### 1.54.0 - 04.02.22
9
+ Add sourceData to globalScriptParams
10
+
5
11
  ### 1.53.2 - 03.02.22
6
12
  Fix issue: Remove error message on custom form mapping
7
13
 
@@ -149,6 +155,12 @@ The eventmanager will check all outbound webhooks for an event. If one fails, th
149
155
 
150
156
  ## GUI
151
157
 
158
+ ### 1.8.0 - 3.2.22
159
+ Fixed wrong Script Config for Custom Form Scripts (attribute clients instead of scripts)
160
+ Fixed Scrolling
161
+ Fixed navigation error from "Import/Export" to a client
162
+ Prepared GUI for open API
163
+
152
164
  ### 1.7.0 - 09.11.21
153
165
  Added Parameter REACT_APP_DISABLED_MODULES to disable Modules
154
166
 
package/docs/scripts.md CHANGED
@@ -115,6 +115,8 @@ Global script params are set by the application and handed over to the script. T
115
115
 
116
116
  **classId**: the classId of cmdbobjects. Only set in POST & PUT actions
117
117
 
118
+ **sourceData**: Contains the original body for PUT/POST request. This can be used scripts to access custom data that was removed during mapping.
119
+
118
120
  ```json
119
121
  {
120
122
  "query": {
@@ -122,6 +124,15 @@ Global script params are set by the application and handed over to the script. T
122
124
  "limit": "3",
123
125
  "include": "supportGroupRelations,persons"
124
126
  },
127
+ "sourceData": {
128
+ "data": {
129
+ "summary": "Short summary",
130
+ "notes": "Some details here",
131
+ },
132
+ "customData": {
133
+ "foo": "bar"
134
+ }
135
+ },
125
136
  "id": "INC000000001507"
126
137
  }
127
138
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.53.2",
3
+ "version": "1.55.0",
4
4
  "description": "A proxy and abstraction layer for BMCs IT Service Management Suite",
5
5
  "main": "app.js",
6
6
  "scripts": {