@manyos/smileconnect-api 1.41.0 → 1.41.2
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 +2 -1
- package/conf/mapping.json +4 -0
- package/controller/ticketWorkLogController.js +8 -9
- package/docs/_sidebar.md +14 -13
- package/docs/adapter.md +14 -14
- package/docs/releases.md +22 -3
- package/package.json +1 -1
- package/routes/ticketWorkLogRoutes.js +1 -6
- package/test/workorderTest.js +1 -1
package/conf/clients.json
CHANGED
package/conf/mapping.json
CHANGED
|
@@ -11,16 +11,13 @@ const scriptController = require('./scriptController');
|
|
|
11
11
|
|
|
12
12
|
const ticketCache = new CacheService(process.env.CACHETTL_TICKETS || 1); // Create a new cache service instance
|
|
13
13
|
|
|
14
|
-
async function createWorklog(ticketConfig, clientConfig, ticketId,
|
|
14
|
+
async function createWorklog(ticketConfig, clientConfig, ticketId, data, globalScriptParams) {
|
|
15
15
|
const scripts = clientConfig[ticketConfig.requestTypeWorkLog].scripts.POST;
|
|
16
16
|
const mapping = config.getMapping(ticketConfig.requestTypeWorkLog);
|
|
17
17
|
const fields = clientConfig[ticketConfig.requestTypeWorkLog].fields;
|
|
18
18
|
|
|
19
19
|
log.debug('mapping', mapping);
|
|
20
|
-
|
|
21
|
-
"summary" : summary,
|
|
22
|
-
"text" : text
|
|
23
|
-
};
|
|
20
|
+
|
|
24
21
|
const requestType = ticketConfig.requestType;
|
|
25
22
|
if (requestType === 'incident') {
|
|
26
23
|
data[searchUtil.mapFieldNameReverse('Incident Number', mapping)] = ticketId;
|
|
@@ -53,10 +50,12 @@ async function createWorklog(ticketConfig, clientConfig, ticketId, summary, text
|
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
const clientConstants = clientConfig[ticketConfig.requestTypeWorkLog].constants;
|
|
56
|
-
if (isPublic
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
if (data.isPublic) {
|
|
54
|
+
if (data.isPublic === true) {
|
|
55
|
+
clientConstants.push({"name": "View Access", "value" : "Public"});
|
|
56
|
+
} else {
|
|
57
|
+
clientConstants.push({"name": "View Access", "value" : "Internal"});
|
|
58
|
+
}
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
//run preScripts
|
package/docs/_sidebar.md
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
- Getting started
|
|
2
2
|
|
|
3
|
-
- [Quick start](quickstart
|
|
4
|
-
- [Architecture](architecture
|
|
3
|
+
- [Quick start](quickstart)
|
|
4
|
+
- [Architecture](architecture)
|
|
5
5
|
- [API Specification](https://smileconnect.manyosdocs.de/spec/index.html)
|
|
6
|
+
- [Release notes](releases)
|
|
6
7
|
|
|
7
8
|
- Configuration
|
|
8
9
|
|
|
9
|
-
- [Global Settings](configuration/config
|
|
10
|
-
- [Mapping](configuration/mapping
|
|
11
|
-
- [Client Configuration](configuration/clients
|
|
12
|
-
- [Events](configuration/events
|
|
10
|
+
- [Global Settings](configuration/config)
|
|
11
|
+
- [Mapping](configuration/mapping)
|
|
12
|
+
- [Client Configuration](configuration/clients)
|
|
13
|
+
- [Events](configuration/events)
|
|
13
14
|
|
|
14
15
|
- Data manipulation
|
|
15
16
|
|
|
16
|
-
- [Scripts](scripts
|
|
17
|
-
- [Adapter](adapter
|
|
17
|
+
- [Scripts](scripts)
|
|
18
|
+
- [Adapter](adapter)
|
|
18
19
|
|
|
19
20
|
- How-Tos
|
|
20
21
|
|
|
21
|
-
- [Authentication](howto/token
|
|
22
|
-
- [Incident Requests](howto/incidents
|
|
23
|
-
- [Handle Worklogs](howto/worklogs
|
|
24
|
-
- [Handle Attachments](howto/attachments
|
|
25
|
-
- [Read Configuration Items](howto/cmdbobjects
|
|
22
|
+
- [Authentication](howto/token)
|
|
23
|
+
- [Incident Requests](howto/incidents)
|
|
24
|
+
- [Handle Worklogs](howto/worklogs)
|
|
25
|
+
- [Handle Attachments](howto/attachments)
|
|
26
|
+
- [Read Configuration Items](howto/cmdbobjects)
|
package/docs/adapter.md
CHANGED
|
@@ -49,11 +49,11 @@ return adapterParams;
|
|
|
49
49
|
|
|
50
50
|
The different Adapter and their configuration values are described in detail below.
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
# Remedy
|
|
53
53
|
|
|
54
54
|
The Remedy Adapter is used to connect to BMC Remedy Action Request Servers. It allows you to create, query and update records.
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
## Configuration values
|
|
57
57
|
|
|
58
58
|
**arServer**: The name of the arsystem server. e.g. ars1.mydomain.com
|
|
59
59
|
|
|
@@ -71,9 +71,9 @@ The Remedy Adapter is used to connect to BMC Remedy Action Request Servers. It a
|
|
|
71
71
|
|
|
72
72
|
**limitMax**: The maximum number of records retrieved in a query. This parameter can be used to enforce a limit. The limit can not be overwritten by queries.
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
## Functions
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
### Search
|
|
77
77
|
|
|
78
78
|
```javascript
|
|
79
79
|
async function search(form, query, fields, options)
|
|
@@ -125,7 +125,7 @@ Will return an object with a data array and some meta data.
|
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
### Create
|
|
129
129
|
|
|
130
130
|
```javascript
|
|
131
131
|
async function create(form, entry, options)
|
|
@@ -172,7 +172,7 @@ const resultCreate = await adapter.remedy.create(settings.createForm, settings.e
|
|
|
172
172
|
|
|
173
173
|
Will return return the id of the created record. e.g. REQ00000002893 or throw an error.
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
### Update
|
|
176
176
|
|
|
177
177
|
```javascript
|
|
178
178
|
async function update(form, id, entry, options)
|
|
@@ -222,7 +222,7 @@ const resultUpdate = await adapter.remedy.update(settings.form, settings.id, set
|
|
|
222
222
|
Will return return the id of the updated record. e.g. 000000000000115 or throw an error.
|
|
223
223
|
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
### Options
|
|
226
226
|
|
|
227
227
|
* limit
|
|
228
228
|
|
|
@@ -267,10 +267,10 @@ const options = {
|
|
|
267
267
|
}
|
|
268
268
|
```
|
|
269
269
|
|
|
270
|
-
|
|
270
|
+
# LDAP
|
|
271
271
|
|
|
272
272
|
|
|
273
|
-
|
|
273
|
+
## Configuration values
|
|
274
274
|
|
|
275
275
|
* ldapUrl
|
|
276
276
|
|
|
@@ -284,10 +284,10 @@ The Bind DN to authenticate with. e.g. cn=smilecatalog-user,dc=example,dc=com
|
|
|
284
284
|
|
|
285
285
|
The secret to use with the Bind DN. e.g. password
|
|
286
286
|
|
|
287
|
-
|
|
287
|
+
## Functions
|
|
288
288
|
|
|
289
289
|
|
|
290
|
-
|
|
290
|
+
### Search
|
|
291
291
|
|
|
292
292
|
```javascript
|
|
293
293
|
async search(base, options)
|
|
@@ -338,11 +338,11 @@ Returns an array of records. e.g.
|
|
|
338
338
|
]
|
|
339
339
|
```
|
|
340
340
|
|
|
341
|
-
|
|
341
|
+
# SMILEconnect
|
|
342
342
|
|
|
343
343
|
The SMILEconnect Adapter can be used to do calls against SMILEconnect. It will act as it is called externally.
|
|
344
344
|
|
|
345
|
-
|
|
345
|
+
## Configuration values
|
|
346
346
|
|
|
347
347
|
**smileConnectUrl**: The url of your SMILEconnect installation e.g. https://smileconnect.mydomain.io
|
|
348
348
|
|
|
@@ -352,7 +352,7 @@ The SMILEconnect Adapter can be used to do calls against SMILEconnect. It will a
|
|
|
352
352
|
|
|
353
353
|
**secret**: The secret of the client. e.g. jd92hd-03283d-2293s-232
|
|
354
354
|
|
|
355
|
-
|
|
355
|
+
## Functions
|
|
356
356
|
|
|
357
357
|
The SMILEconnect adapter is an open source project.
|
|
358
358
|
|
package/docs/releases.md
CHANGED
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## API
|
|
4
4
|
|
|
5
|
-
### 1.41.
|
|
5
|
+
### 1.41.2 - 10.08.21
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Fix mapping for Ticket Worklogs
|
|
8
|
+
|
|
9
|
+
### 1.41.1 - 10.08.21
|
|
10
|
+
|
|
11
|
+
Fix issue with sort in Remedy Adapter
|
|
8
12
|
|
|
13
|
+
### 1.41.0 - 03.08.21
|
|
14
|
+
|
|
15
|
+
Update Record added to [Remedy Adapter](adapter#remedy).
|
|
9
16
|
|
|
10
17
|
### 1.40.0 - 30.07.21
|
|
11
18
|
|
|
@@ -19,8 +26,20 @@ e.g.
|
|
|
19
26
|
|
|
20
27
|
## Event Manager
|
|
21
28
|
|
|
29
|
+
### 1.16.0 - 03.08.21
|
|
30
|
+
|
|
31
|
+
Update Record added to [Remedy Adapter](adapter#remedy).
|
|
32
|
+
|
|
22
33
|
### 1.15.0 - 30.07.21
|
|
23
34
|
|
|
24
35
|
The eventmanager will check all outbound webhooks for an event. If one fails, the whole Event will be set to error and the details will be added to the error message.
|
|
25
36
|
|
|
26
|
-
## GUI
|
|
37
|
+
## GUI
|
|
38
|
+
|
|
39
|
+
### 1.4.17 - 09.08.21
|
|
40
|
+
|
|
41
|
+
Multiple events caused an error in the UI.
|
|
42
|
+
|
|
43
|
+
### 1.4.16 - 02.08.21
|
|
44
|
+
|
|
45
|
+
Add Auth + Scripts to Event config
|
package/package.json
CHANGED
|
@@ -159,13 +159,8 @@ module.exports = (function() {
|
|
|
159
159
|
next({validationErrors: result.array()});
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
const reqPublic = req.body.data.isPublic;
|
|
163
|
-
let isPublic = false;
|
|
164
|
-
if (reqPublic != null && reqPublic != undefined && reqPublic === true) {
|
|
165
|
-
isPublic = true;
|
|
166
|
-
}
|
|
167
162
|
|
|
168
|
-
ticketWorkLogController.createWorklog(req.ticketConfig, req.user.config, ticketId, req.body.data
|
|
163
|
+
ticketWorkLogController.createWorklog(req.ticketConfig, req.user.config, ticketId, req.body.data, req.globalScriptParams)
|
|
169
164
|
.then(result => {
|
|
170
165
|
const worklogId = result['0'];
|
|
171
166
|
req.eventData.ticketNumber2 = worklogId;
|
package/test/workorderTest.js
CHANGED
|
@@ -273,7 +273,7 @@ describe('Integration Tests - Workorders', function () {
|
|
|
273
273
|
chai.request(server)
|
|
274
274
|
.post(`/v1/workorders/${workorder.id}/worklogs`)
|
|
275
275
|
.set('Authorization', 'Bearer ' + authUser.access_token)
|
|
276
|
-
.send({data: {summary: "Worklog Summary", text: "Worklog Text"}})
|
|
276
|
+
.send({data: {summary: "Worklog Summary", text: "Worklog Text", viewAccess: "Internal"}})
|
|
277
277
|
.end(function (err, res) {
|
|
278
278
|
res.should.have.status(200);
|
|
279
279
|
res.body.data.should.be.an('object');
|