@manyos/smileconnect-api 1.53.1 → 1.54.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 +8 -0
- package/conf/clients.json +31 -0
- package/conf/customFormMapping.json +45 -0
- package/conf/scripts/p4.js +2 -0
- package/docs/releases.md +13 -1
- package/docs/scripts.md +11 -0
- package/package.json +1 -1
- package/util/mappingUtil.js +4 -1
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
|
|
package/conf/clients.json
CHANGED
|
@@ -161,6 +161,37 @@
|
|
|
161
161
|
"Full Name"
|
|
162
162
|
]
|
|
163
163
|
},
|
|
164
|
+
"custom_TMS:Task": {
|
|
165
|
+
"basequery": "1=1",
|
|
166
|
+
"fields": [
|
|
167
|
+
"Task ID",
|
|
168
|
+
"Summary",
|
|
169
|
+
"z1D_WorkInfoNotes",
|
|
170
|
+
"Notes",
|
|
171
|
+
"Assignee Group",
|
|
172
|
+
"Assignee Group ID",
|
|
173
|
+
"Assignee Organization",
|
|
174
|
+
"Support Company",
|
|
175
|
+
"Status"
|
|
176
|
+
],
|
|
177
|
+
"constants": [],
|
|
178
|
+
"scripts": {
|
|
179
|
+
"GET": {
|
|
180
|
+
"preMapping": [],
|
|
181
|
+
"postMapping": []
|
|
182
|
+
},
|
|
183
|
+
"PUT": {
|
|
184
|
+
"preMapping": [],
|
|
185
|
+
"postMapping": [],
|
|
186
|
+
"afterExecution": []
|
|
187
|
+
},
|
|
188
|
+
"POST": {
|
|
189
|
+
"preMapping": [],
|
|
190
|
+
"postMapping": [],
|
|
191
|
+
"afterExecution": []
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
164
195
|
"cmdbobject": {
|
|
165
196
|
"basequery": "'Data Set Id' = \"BMC.ASSET\" AND ('Mark As Deleted' = \"No\" OR 'Mark As Deleted' = $NULL$)",
|
|
166
197
|
"fields": [
|
|
@@ -19,6 +19,51 @@
|
|
|
19
19
|
"Department": "Department"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
+
"Tasks": {
|
|
23
|
+
"formName": "TMS:Task",
|
|
24
|
+
"mapping": {
|
|
25
|
+
"Summary": "summary",
|
|
26
|
+
"Task ID": "id",
|
|
27
|
+
"Notes": "notes",
|
|
28
|
+
"Status": "status",
|
|
29
|
+
"StatusReasonSelection": "statusReason",
|
|
30
|
+
"Actual Start Date": "actualStartDate",
|
|
31
|
+
"Actual End Date": "actualEndDate",
|
|
32
|
+
"Scheduled Start Date": "scheduledStartDate",
|
|
33
|
+
"Scheduled End Date": "scheduledEndDate",
|
|
34
|
+
"InstanceId": "instanceId",
|
|
35
|
+
"RootRequestFormName": "rootRequestForm",
|
|
36
|
+
"RootRequestID": "rootRequest",
|
|
37
|
+
"Sequence": "sequence",
|
|
38
|
+
"Service Cat Tier 1": "opsCat1",
|
|
39
|
+
"Service Cat Tier 2": "opsCat2",
|
|
40
|
+
"Service Cat Tier 3": "opsCat3",
|
|
41
|
+
"Product Cat Tier 1": "prodCat1",
|
|
42
|
+
"Product Cat Tier 2": "prodCat2",
|
|
43
|
+
"Product Cat Tier 3": "prodCat3",
|
|
44
|
+
"Product Name": "productName",
|
|
45
|
+
"Assignee Group ID": "assignedGroup",
|
|
46
|
+
"Customer Person ID": "customerid",
|
|
47
|
+
"Requested By Person ID": "requestorid",
|
|
48
|
+
"Support Company": "supportCompany",
|
|
49
|
+
"Assignee Organization": "supportOrganization",
|
|
50
|
+
"Assignee Group": "supportGroup",
|
|
51
|
+
"TemplateID": "templateid",
|
|
52
|
+
"TaskName": "taskName",
|
|
53
|
+
"z1D_WorkInfoNotes": "workInfoNotes",
|
|
54
|
+
"z1D_WorkInfoSummary": "workInfoSummary",
|
|
55
|
+
"z1D_WorkInfoType": "workInfoType",
|
|
56
|
+
"z1D_WorkInfoViewAccess": "workInfoViewAccess",
|
|
57
|
+
"z1D_WorkInfoSecureLog": "workInfoSecureLog",
|
|
58
|
+
"Incident Resolution": "incidentResolution",
|
|
59
|
+
"Incident Resolution2": "incidentResolution2",
|
|
60
|
+
"z1D Action": "action",
|
|
61
|
+
"Assignee": "assignee",
|
|
62
|
+
"Assignee Login": "assigneeLogin",
|
|
63
|
+
"Assigned To": "assignedTo",
|
|
64
|
+
"Assignee Id": "assigneeID"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
22
67
|
"baseElement": {
|
|
23
68
|
"formName": "AST:BaseElement",
|
|
24
69
|
"mapping": {
|
package/conf/scripts/p4.js
CHANGED
package/docs/releases.md
CHANGED
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## API
|
|
4
4
|
|
|
5
|
+
### 1.54.0 - 04.02.22
|
|
6
|
+
Add sourceData to globalScriptParams
|
|
7
|
+
|
|
8
|
+
### 1.53.2 - 03.02.22
|
|
9
|
+
Fix issue: Remove error message on custom form mapping
|
|
10
|
+
|
|
5
11
|
### 1.53.1 - 01.02.22
|
|
6
|
-
Fix Task Flow Activation for Problems
|
|
12
|
+
Fix issue: Task Flow Activation for Problems
|
|
7
13
|
|
|
8
14
|
### 1.53.0 - 17.11.21
|
|
9
15
|
Update NodeJs to v16
|
|
@@ -146,6 +152,12 @@ The eventmanager will check all outbound webhooks for an event. If one fails, th
|
|
|
146
152
|
|
|
147
153
|
## GUI
|
|
148
154
|
|
|
155
|
+
### 1.8.0 - 3.2.22
|
|
156
|
+
Fixed wrong Script Config for Custom Form Scripts (attribute clients instead of scripts)
|
|
157
|
+
Fixed Scrolling
|
|
158
|
+
Fixed navigation error from "Import/Export" to a client
|
|
159
|
+
Prepared GUI for open API
|
|
160
|
+
|
|
149
161
|
### 1.7.0 - 09.11.21
|
|
150
162
|
Added Parameter REACT_APP_DISABLED_MODULES to disable Modules
|
|
151
163
|
|
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
package/util/mappingUtil.js
CHANGED
|
@@ -106,11 +106,14 @@ function getFieldsForCreate(mapping, mappingNew, clientFields) {
|
|
|
106
106
|
}*/
|
|
107
107
|
|
|
108
108
|
function applyCustomFormMapping(object, mapping, requestIdField) {
|
|
109
|
+
//log.debug('apply mapping', object, mapping)
|
|
109
110
|
//Apply mapping
|
|
110
111
|
Object.keys(mapping).forEach(remedyName => {
|
|
111
112
|
try {
|
|
112
113
|
const mappedName = mapping[remedyName]
|
|
113
|
-
|
|
114
|
+
if (object[remedyName] !== undefined) {
|
|
115
|
+
Object.defineProperty(object, mappedName, Object.getOwnPropertyDescriptor(object, remedyName));
|
|
116
|
+
}
|
|
114
117
|
//delete only if names are different
|
|
115
118
|
if (mappedName !== remedyName) {
|
|
116
119
|
delete object[remedyName];
|