@manyos/smileconnect-api 1.58.0 → 1.58.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/app.js CHANGED
@@ -328,6 +328,7 @@ app.use('/v1/customForms/:formAlias', async function(req, res, next) {
328
328
  configName: 'custom_' + formMapping.formName,
329
329
  mapping: formMapping.mapping
330
330
  }
331
+ req.globalScriptParams.formConfig = req.formConfig
331
332
  req.parentEventBase = 'customForm'
332
333
  next();
333
334
  }, customFormRoutes);
package/docs/scripts.md CHANGED
@@ -119,8 +119,27 @@ Global script params are set by the application and handed over to the script. T
119
119
 
120
120
  **sourceData**: Contains the original body for PUT/POST request. This can be used scripts to access custom data that was removed during mapping.
121
121
 
122
- **user**: Contains the full configuration of the client. The attribute user.config.options.impersonateUser might be overwritten by the dynamic passed value if user.config.options.allowDynamicImpersonate ist set to true.
122
+ **user**: Contains the full configuration of the client. The attribute user.config.options.impersonateUser might be overwritten by the dynamic passed value if user.config.options.allowDynamicImpersonate ist set to true.
123
123
 
124
+ **formConfig**: Contains the configuration of the cutstom form. *Only available for custom forms*
125
+
126
+ e.g.
127
+ ```json
128
+ "formConfig": {
129
+ "formName": "AST:ComputerSystem",
130
+ "configName": "custom_AST:ComputerSystem",
131
+ "mapping": {
132
+ "Name": "name",
133
+ "DatasetId": "dataSetId",
134
+ "Asset ID+": "id",
135
+ "Reconciliation Identity": "reconId",
136
+ "Instance Id": "instanceId",
137
+ "Short Description": "shortDescription"
138
+ }
139
+ }
140
+ ```
141
+
142
+ Full example:
124
143
  ```json
125
144
  {
126
145
  "query": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.58.0",
3
+ "version": "1.58.1",
4
4
  "description": "A proxy and abstraction layer for BMCs IT Service Management Suite",
5
5
  "main": "app.js",
6
6
  "scripts": {
@@ -78,7 +78,9 @@ function eventQueueHandler(req, res, next) {
78
78
  res.set('Content-disposition', 'attachment; filename=' + req.downloadResult.fileName);
79
79
  res.status(200).send(req.downloadResult.data);
80
80
  } else {
81
+ log.debug('send http repsonse', req.result)
81
82
  res.status(req.responseStatus || 200).json(req.result)
83
+ log.debug('send http done')
82
84
  }
83
85
  }).catch(error => {
84
86
  next(error);