@manyos/smileconnect-api 1.47.0 → 1.49.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 +2 -1
- package/conf/clients.json +73 -31
- package/conf/scripts/attachi.js +2 -0
- package/controller/scriptController.js +2 -2
- package/controller/taskController.js +31 -4
- package/controller/ticketWorkLogController.js +33 -4
- package/docs/configuration/config.md +54 -0
- package/docs/openapi.json +6 -2
- package/docs/releases.md +31 -0
- package/package.json +1 -1
- package/routes/taskRoutes.js +2 -2
- package/routes/ticketWorkLogRoutes.js +2 -2
- package/util/config.js +4 -0
package/app.js
CHANGED
|
@@ -50,6 +50,7 @@ const https = require('https');
|
|
|
50
50
|
const maxHTTPSockets = process.env.MAX_HTTP_SOCKETS || 10;
|
|
51
51
|
|
|
52
52
|
const SSO_CLIENTNAME_ATTRIBUTE = process.env.SSO_CLIENTNAME_ATTRIBUTE || 'azp';
|
|
53
|
+
const SSO_USERNAME_ATTRIBUTE = process.env.SSO_USERNAME_ATTRIBUTE || 'preferred_username';
|
|
53
54
|
|
|
54
55
|
http.globalAgent.maxSockets = maxHTTPSockets;
|
|
55
56
|
https.globalAgent.maxSockets = maxHTTPSockets;
|
|
@@ -157,7 +158,7 @@ passport.use(
|
|
|
157
158
|
'scope': jwt_payload.scope,
|
|
158
159
|
'exp': jwt_payload.exp,
|
|
159
160
|
'config': clientConfig,
|
|
160
|
-
'username': jwt_payload
|
|
161
|
+
'username': jwt_payload[SSO_USERNAME_ATTRIBUTE]
|
|
161
162
|
}
|
|
162
163
|
log.debug('Passport User', jwt_payload);
|
|
163
164
|
const resource_access = jwt_payload.resource_access;
|
package/conf/clients.json
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"basequery": "1=2",
|
|
19
19
|
"fields": [],
|
|
20
20
|
"constants": [],
|
|
21
|
-
"scripts": {}
|
|
21
|
+
"scripts": {},
|
|
22
|
+
"attachmentScripts": {}
|
|
22
23
|
},
|
|
23
24
|
"incident": {
|
|
24
25
|
"basequery": "1=1",
|
|
@@ -32,7 +33,8 @@
|
|
|
32
33
|
"basequery": "1=2",
|
|
33
34
|
"fields": [],
|
|
34
35
|
"constants": [],
|
|
35
|
-
"scripts": {}
|
|
36
|
+
"scripts": {},
|
|
37
|
+
"attachmentScripts": {}
|
|
36
38
|
},
|
|
37
39
|
"person": {
|
|
38
40
|
"basequery": "1=2",
|
|
@@ -50,7 +52,8 @@
|
|
|
50
52
|
"basequery": "1=2",
|
|
51
53
|
"fields": [],
|
|
52
54
|
"constants": [],
|
|
53
|
-
"scripts": {}
|
|
55
|
+
"scripts": {},
|
|
56
|
+
"attachmentScripts": {}
|
|
54
57
|
},
|
|
55
58
|
"supportGroup": {
|
|
56
59
|
"basequery": "1=2",
|
|
@@ -74,7 +77,8 @@
|
|
|
74
77
|
"basequery": "1=2",
|
|
75
78
|
"fields": [],
|
|
76
79
|
"constants": [],
|
|
77
|
-
"scripts": {}
|
|
80
|
+
"scripts": {},
|
|
81
|
+
"attachmentScripts": {}
|
|
78
82
|
},
|
|
79
83
|
"task": {
|
|
80
84
|
"basequery": "1=2",
|
|
@@ -86,7 +90,8 @@
|
|
|
86
90
|
"basequery": "1=2",
|
|
87
91
|
"fields": [],
|
|
88
92
|
"constants": [],
|
|
89
|
-
"scripts": {}
|
|
93
|
+
"scripts": {},
|
|
94
|
+
"attachmentScripts": {}
|
|
90
95
|
},
|
|
91
96
|
"flowBuilder": {
|
|
92
97
|
"basequery": "1=2",
|
|
@@ -303,7 +308,14 @@
|
|
|
303
308
|
"scripts": {
|
|
304
309
|
"POST": {
|
|
305
310
|
"preMapping": [
|
|
306
|
-
"
|
|
311
|
+
"attachi"
|
|
312
|
+
]
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
"attachmentScripts": {
|
|
316
|
+
"POST": {
|
|
317
|
+
"preMapping": [
|
|
318
|
+
"attachi"
|
|
307
319
|
]
|
|
308
320
|
}
|
|
309
321
|
}
|
|
@@ -523,7 +535,8 @@
|
|
|
523
535
|
}
|
|
524
536
|
],
|
|
525
537
|
"basequery": "",
|
|
526
|
-
"scripts": {}
|
|
538
|
+
"scripts": {},
|
|
539
|
+
"attachmentScripts": {}
|
|
527
540
|
},
|
|
528
541
|
"incidentWorklog": {
|
|
529
542
|
"fields": [
|
|
@@ -545,7 +558,8 @@
|
|
|
545
558
|
}
|
|
546
559
|
],
|
|
547
560
|
"basequery": "",
|
|
548
|
-
"scripts": {}
|
|
561
|
+
"scripts": {},
|
|
562
|
+
"attachmentScripts": {}
|
|
549
563
|
},
|
|
550
564
|
"problemWorklog": {
|
|
551
565
|
"fields": [
|
|
@@ -567,7 +581,8 @@
|
|
|
567
581
|
}
|
|
568
582
|
],
|
|
569
583
|
"basequery": "",
|
|
570
|
-
"scripts": {}
|
|
584
|
+
"scripts": {},
|
|
585
|
+
"attachmentScripts": {}
|
|
571
586
|
},
|
|
572
587
|
"task": {
|
|
573
588
|
"basequery": "1=1",
|
|
@@ -636,8 +651,15 @@
|
|
|
636
651
|
"value": "Other"
|
|
637
652
|
}
|
|
638
653
|
],
|
|
639
|
-
"basequery": "",
|
|
640
|
-
"scripts": {}
|
|
654
|
+
"basequery": "1=1",
|
|
655
|
+
"scripts": {},
|
|
656
|
+
"attachmentScripts": {
|
|
657
|
+
"POST": {
|
|
658
|
+
"preMapping": [
|
|
659
|
+
"attachi"
|
|
660
|
+
]
|
|
661
|
+
}
|
|
662
|
+
}
|
|
641
663
|
},
|
|
642
664
|
"flowBuilder": {
|
|
643
665
|
"constants": [
|
|
@@ -828,7 +850,8 @@
|
|
|
828
850
|
}
|
|
829
851
|
],
|
|
830
852
|
"basequery": "",
|
|
831
|
-
"scripts": {}
|
|
853
|
+
"scripts": {},
|
|
854
|
+
"attachmentScripts": {}
|
|
832
855
|
},
|
|
833
856
|
"workOrder": {
|
|
834
857
|
"fields": [
|
|
@@ -1004,7 +1027,8 @@
|
|
|
1004
1027
|
}
|
|
1005
1028
|
],
|
|
1006
1029
|
"basequery": "",
|
|
1007
|
-
"scripts": {}
|
|
1030
|
+
"scripts": {},
|
|
1031
|
+
"attachmentScripts": {}
|
|
1008
1032
|
},
|
|
1009
1033
|
"incidentWorklog": {
|
|
1010
1034
|
"fields": [
|
|
@@ -1026,7 +1050,8 @@
|
|
|
1026
1050
|
}
|
|
1027
1051
|
],
|
|
1028
1052
|
"basequery": "",
|
|
1029
|
-
"scripts": {}
|
|
1053
|
+
"scripts": {},
|
|
1054
|
+
"attachmentScripts": {}
|
|
1030
1055
|
},
|
|
1031
1056
|
"problemWorklog": {
|
|
1032
1057
|
"fields": [
|
|
@@ -1048,7 +1073,8 @@
|
|
|
1048
1073
|
}
|
|
1049
1074
|
],
|
|
1050
1075
|
"basequery": "",
|
|
1051
|
-
"scripts": {}
|
|
1076
|
+
"scripts": {},
|
|
1077
|
+
"attachmentScripts": {}
|
|
1052
1078
|
},
|
|
1053
1079
|
"task": {
|
|
1054
1080
|
"basequery": "1=1",
|
|
@@ -1119,7 +1145,8 @@
|
|
|
1119
1145
|
}
|
|
1120
1146
|
],
|
|
1121
1147
|
"basequery": "",
|
|
1122
|
-
"scripts": {}
|
|
1148
|
+
"scripts": {},
|
|
1149
|
+
"attachmentScripts": {}
|
|
1123
1150
|
},
|
|
1124
1151
|
"flowBuilder": {
|
|
1125
1152
|
"constants": [
|
|
@@ -1276,7 +1303,8 @@
|
|
|
1276
1303
|
}
|
|
1277
1304
|
],
|
|
1278
1305
|
"basequery": "",
|
|
1279
|
-
"scripts": {}
|
|
1306
|
+
"scripts": {},
|
|
1307
|
+
"attachmentScripts": {}
|
|
1280
1308
|
},
|
|
1281
1309
|
"workOrder": {
|
|
1282
1310
|
"basequery": "",
|
|
@@ -1453,7 +1481,8 @@
|
|
|
1453
1481
|
}
|
|
1454
1482
|
],
|
|
1455
1483
|
"basequery": "",
|
|
1456
|
-
"scripts": {}
|
|
1484
|
+
"scripts": {},
|
|
1485
|
+
"attachmentScripts": {}
|
|
1457
1486
|
},
|
|
1458
1487
|
"incidentWorklog": {
|
|
1459
1488
|
"fields": [
|
|
@@ -1475,7 +1504,8 @@
|
|
|
1475
1504
|
}
|
|
1476
1505
|
],
|
|
1477
1506
|
"basequery": "",
|
|
1478
|
-
"scripts": {}
|
|
1507
|
+
"scripts": {},
|
|
1508
|
+
"attachmentScripts": {}
|
|
1479
1509
|
},
|
|
1480
1510
|
"problemWorklog": {
|
|
1481
1511
|
"fields": [
|
|
@@ -1497,7 +1527,8 @@
|
|
|
1497
1527
|
}
|
|
1498
1528
|
],
|
|
1499
1529
|
"basequery": "",
|
|
1500
|
-
"scripts": {}
|
|
1530
|
+
"scripts": {},
|
|
1531
|
+
"attachmentScripts": {}
|
|
1501
1532
|
},
|
|
1502
1533
|
"task": {
|
|
1503
1534
|
"basequery": "1=1",
|
|
@@ -1568,7 +1599,8 @@
|
|
|
1568
1599
|
}
|
|
1569
1600
|
],
|
|
1570
1601
|
"basequery": "",
|
|
1571
|
-
"scripts": {}
|
|
1602
|
+
"scripts": {},
|
|
1603
|
+
"attachmentScripts": {}
|
|
1572
1604
|
},
|
|
1573
1605
|
"flowBuilder": {
|
|
1574
1606
|
"constants": [
|
|
@@ -1731,7 +1763,8 @@
|
|
|
1731
1763
|
}
|
|
1732
1764
|
],
|
|
1733
1765
|
"basequery": "",
|
|
1734
|
-
"scripts": {}
|
|
1766
|
+
"scripts": {},
|
|
1767
|
+
"attachmentScripts": {}
|
|
1735
1768
|
},
|
|
1736
1769
|
"workOrder": {
|
|
1737
1770
|
"basequery": "",
|
|
@@ -1907,7 +1940,8 @@
|
|
|
1907
1940
|
}
|
|
1908
1941
|
],
|
|
1909
1942
|
"basequery": "",
|
|
1910
|
-
"scripts": {}
|
|
1943
|
+
"scripts": {},
|
|
1944
|
+
"attachmentScripts": {}
|
|
1911
1945
|
},
|
|
1912
1946
|
"incidentWorklog": {
|
|
1913
1947
|
"fields": [
|
|
@@ -1929,7 +1963,8 @@
|
|
|
1929
1963
|
}
|
|
1930
1964
|
],
|
|
1931
1965
|
"basequery": "",
|
|
1932
|
-
"scripts": {}
|
|
1966
|
+
"scripts": {},
|
|
1967
|
+
"attachmentScripts": {}
|
|
1933
1968
|
},
|
|
1934
1969
|
"problemWorklog": {
|
|
1935
1970
|
"fields": [
|
|
@@ -1951,7 +1986,8 @@
|
|
|
1951
1986
|
}
|
|
1952
1987
|
],
|
|
1953
1988
|
"basequery": "",
|
|
1954
|
-
"scripts": {}
|
|
1989
|
+
"scripts": {},
|
|
1990
|
+
"attachmentScripts": {}
|
|
1955
1991
|
},
|
|
1956
1992
|
"task": {
|
|
1957
1993
|
"basequery": "1=1",
|
|
@@ -2022,7 +2058,8 @@
|
|
|
2022
2058
|
}
|
|
2023
2059
|
],
|
|
2024
2060
|
"basequery": "",
|
|
2025
|
-
"scripts": {}
|
|
2061
|
+
"scripts": {},
|
|
2062
|
+
"attachmentScripts": {}
|
|
2026
2063
|
},
|
|
2027
2064
|
"flowBuilder": {
|
|
2028
2065
|
"constants": [
|
|
@@ -2185,7 +2222,8 @@
|
|
|
2185
2222
|
}
|
|
2186
2223
|
],
|
|
2187
2224
|
"basequery": "",
|
|
2188
|
-
"scripts": {}
|
|
2225
|
+
"scripts": {},
|
|
2226
|
+
"attachmentScripts": {}
|
|
2189
2227
|
},
|
|
2190
2228
|
"workOrder": {
|
|
2191
2229
|
"basequery": "",
|
|
@@ -2361,7 +2399,8 @@
|
|
|
2361
2399
|
}
|
|
2362
2400
|
],
|
|
2363
2401
|
"basequery": "",
|
|
2364
|
-
"scripts": {}
|
|
2402
|
+
"scripts": {},
|
|
2403
|
+
"attachmentScripts": {}
|
|
2365
2404
|
},
|
|
2366
2405
|
"incidentWorklog": {
|
|
2367
2406
|
"fields": [
|
|
@@ -2383,7 +2422,8 @@
|
|
|
2383
2422
|
}
|
|
2384
2423
|
],
|
|
2385
2424
|
"basequery": "",
|
|
2386
|
-
"scripts": {}
|
|
2425
|
+
"scripts": {},
|
|
2426
|
+
"attachmentScripts": {}
|
|
2387
2427
|
},
|
|
2388
2428
|
"problemWorklog": {
|
|
2389
2429
|
"fields": [
|
|
@@ -2405,7 +2445,8 @@
|
|
|
2405
2445
|
}
|
|
2406
2446
|
],
|
|
2407
2447
|
"basequery": "",
|
|
2408
|
-
"scripts": {}
|
|
2448
|
+
"scripts": {},
|
|
2449
|
+
"attachmentScripts": {}
|
|
2409
2450
|
},
|
|
2410
2451
|
"task": {
|
|
2411
2452
|
"basequery": "1=1",
|
|
@@ -2476,7 +2517,8 @@
|
|
|
2476
2517
|
}
|
|
2477
2518
|
],
|
|
2478
2519
|
"basequery": "",
|
|
2479
|
-
"scripts": {}
|
|
2520
|
+
"scripts": {},
|
|
2521
|
+
"attachmentScripts": {}
|
|
2480
2522
|
},
|
|
2481
2523
|
"flowBuilder": {
|
|
2482
2524
|
"constants": [
|
|
@@ -62,7 +62,7 @@ async function executeScript(scriptId, requestData, params, clientId, globalScri
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
async function executeCode(code, requestData, params, logStream, executedByScript, clientId, scriptId, globalScriptParams) {
|
|
65
|
-
const log = require('@manyos/logger').setupLog('
|
|
65
|
+
const log = require('@manyos/logger').setupLog('SMILEconnect_Script_' + scriptId);
|
|
66
66
|
//todo should only be added once
|
|
67
67
|
/*if (logStream) {
|
|
68
68
|
log.addStream(logStream);
|
|
@@ -104,7 +104,7 @@ async function executeCode(code, requestData, params, logStream, executedByScrip
|
|
|
104
104
|
//todo Add timeout
|
|
105
105
|
try {
|
|
106
106
|
const result = await vm.run(
|
|
107
|
-
`return new Promise(async function(resolve, reject) {try {${code}} catch (error) {reject(error);}});`,
|
|
107
|
+
`return new Promise(async function(resolve, reject) {try {{${code}}resolve()} catch (error) {reject(error);}});`,
|
|
108
108
|
scriptId || 'vm.js');
|
|
109
109
|
log.debug('script ended', result);
|
|
110
110
|
return result;
|
|
@@ -445,14 +445,41 @@ async function updateTask(clientConfig, id, taskData, globalScriptParams) {
|
|
|
445
445
|
return result;
|
|
446
446
|
}
|
|
447
447
|
|
|
448
|
-
function setWorklogAttachment(clientConfig, worklogId, file, attachmentId) {
|
|
448
|
+
async function setWorklogAttachment(clientConfig, worklogId, file, attachmentId, globalScriptParams) {
|
|
449
|
+
const scripts = clientConfig.taskWorklog.attachmentScripts.POST;
|
|
450
|
+
if (!globalScriptParams) {
|
|
451
|
+
globalScriptParams = {}
|
|
452
|
+
}
|
|
453
|
+
globalScriptParams.isAttachment = true
|
|
454
|
+
globalScriptParams.attachmentId = attachmentId
|
|
455
|
+
//run preScripts
|
|
456
|
+
if (scripts && scripts.preMapping) {
|
|
457
|
+
await scriptController.runScripts(scripts.preMapping, file, clientConfig.clientId, globalScriptParams);
|
|
458
|
+
}
|
|
449
459
|
const fieldId = getAttachmentFieldId(attachmentId);
|
|
450
|
-
|
|
460
|
+
const result = await arquery.setAttachment(CONSTANTS.FORM_TASK_WORKLOG, worklogId, fieldId, file);
|
|
461
|
+
|
|
462
|
+
return result
|
|
451
463
|
}
|
|
452
464
|
|
|
453
|
-
function getWorklogAttachment(clientConfig, worklogId, attachmentId) {
|
|
465
|
+
async function getWorklogAttachment(clientConfig, worklogId, attachmentId, globalScriptParams) {
|
|
466
|
+
const scripts = clientConfig.taskWorklog.attachmentScripts.GET;
|
|
467
|
+
if (!globalScriptParams) {
|
|
468
|
+
globalScriptParams = {}
|
|
469
|
+
}
|
|
470
|
+
globalScriptParams.isAttachment = true
|
|
471
|
+
globalScriptParams.attachmentId = attachmentId
|
|
472
|
+
//run preScripts
|
|
473
|
+
if (scripts && scripts.preMapping) {
|
|
474
|
+
await scriptController.runScripts(scripts.preMapping, undefined, clientConfig.clientId, globalScriptParams);
|
|
475
|
+
}
|
|
454
476
|
const fieldId = getAttachmentFieldId(attachmentId);
|
|
455
|
-
|
|
477
|
+
const result = await arquery.getAttachment(CONSTANTS.FORM_TASK_WORKLOG, worklogId, fieldId);
|
|
478
|
+
//run afterExecution
|
|
479
|
+
if (scripts && scripts.afterExecution) {
|
|
480
|
+
await scriptController.runScripts(scripts.afterExecution, result, clientConfig.clientId, globalScriptParams);
|
|
481
|
+
}
|
|
482
|
+
return result
|
|
456
483
|
}
|
|
457
484
|
|
|
458
485
|
function getAttachmentFieldId(attachmentId) {
|
|
@@ -84,14 +84,43 @@ async function createWorklog(ticketConfig, clientConfig, ticketId, data, globalS
|
|
|
84
84
|
return result;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
function setWorklogAttachment(ticketConfig, clientConfig, worklogId, file, attachmentId) {
|
|
87
|
+
async function setWorklogAttachment(ticketConfig, clientConfig, worklogId, file, attachmentId, globalScriptParams) {
|
|
88
|
+
const scripts = clientConfig[ticketConfig.requestTypeWorkLog].attachmentScripts.POST;
|
|
89
|
+
if (!globalScriptParams) {
|
|
90
|
+
globalScriptParams = {}
|
|
91
|
+
}
|
|
92
|
+
globalScriptParams.isAttachment = true
|
|
93
|
+
globalScriptParams.attachmentId = attachmentId
|
|
94
|
+
//run preScripts
|
|
95
|
+
if (scripts && scripts.preMapping) {
|
|
96
|
+
await scriptController.runScripts(scripts.preMapping, file, clientConfig.clientId, globalScriptParams);
|
|
97
|
+
}
|
|
88
98
|
const fieldId = getAttachmentFieldId(attachmentId);
|
|
89
|
-
|
|
99
|
+
const result = await arquery.setAttachment(ticketConfig.forms.workLog, worklogId, fieldId, file);
|
|
100
|
+
//run afterExecution
|
|
101
|
+
if (scripts && scripts.afterExecution) {
|
|
102
|
+
await scriptController.runScripts(scripts.afterExecution, file, clientConfig.clientId, globalScriptParams);
|
|
103
|
+
}
|
|
104
|
+
return result
|
|
90
105
|
}
|
|
91
106
|
|
|
92
|
-
function getWorklogAttachment(ticketConfig, clientConfig, worklogId, attachmentId) {
|
|
107
|
+
async function getWorklogAttachment(ticketConfig, clientConfig, worklogId, attachmentId, globalScriptParams) {
|
|
108
|
+
const scripts = clientConfig[ticketConfig.requestTypeWorkLog].attachmentScripts.GET;
|
|
109
|
+
if (!globalScriptParams) {
|
|
110
|
+
globalScriptParams = {}
|
|
111
|
+
}
|
|
112
|
+
globalScriptParams.isAttachment = true
|
|
113
|
+
globalScriptParams.attachmentId = attachmentId
|
|
114
|
+
//run preScripts
|
|
115
|
+
if (scripts && scripts.preMapping) {
|
|
116
|
+
await scriptController.runScripts(scripts.preMapping, undefined, clientConfig.clientId, globalScriptParams);
|
|
117
|
+
}
|
|
93
118
|
const fieldId = getAttachmentFieldId(attachmentId);
|
|
94
|
-
|
|
119
|
+
const result = await arquery.getAttachment(ticketConfig.forms.workLog, worklogId, fieldId);
|
|
120
|
+
if (scripts && scripts.afterExecution) {
|
|
121
|
+
await scriptController.runScripts(scripts.afterExecution, result, clientConfig.clientId, globalScriptParams);
|
|
122
|
+
}
|
|
123
|
+
return result
|
|
95
124
|
}
|
|
96
125
|
|
|
97
126
|
function getAttachmentFieldId(attachmentId) {
|
|
@@ -86,6 +86,16 @@ Sample:
|
|
|
86
86
|
|
|
87
87
|
*SSO_CLIENTNAME_ATTRIBUTE = "preferred_username"*
|
|
88
88
|
|
|
89
|
+
### SSO_USERNAME_ATTRIBUTE
|
|
90
|
+
|
|
91
|
+
The attribute that contains the user name in the token. User name is used to identify admins. It is only needed for configuration.
|
|
92
|
+
|
|
93
|
+
Default: *preferred_username*
|
|
94
|
+
|
|
95
|
+
Sample:
|
|
96
|
+
|
|
97
|
+
*SSO_CLIENTNAME_ATTRIBUTE = "email"*
|
|
98
|
+
|
|
89
99
|
### ADMIN_USERS
|
|
90
100
|
|
|
91
101
|
List of users who are allowed to access /v1/appconfig endpoints.
|
|
@@ -267,6 +277,34 @@ Sample:
|
|
|
267
277
|
|
|
268
278
|
*SSO_ISSUER=https://sso.mydomain.io/auth/realms/itsmproxy*
|
|
269
279
|
|
|
280
|
+
### SSO_CLIENTNAME_ATTRIBUTE
|
|
281
|
+
|
|
282
|
+
The attribute that contains the client name in the token.
|
|
283
|
+
|
|
284
|
+
Default: *azp*
|
|
285
|
+
|
|
286
|
+
Set this value if you only want to use a single client in the SSO and service accounts as clients in SMILEconnect. This can be used to manage your SMILEconnect clients via a directory service like LDAP/AD. [More Info](https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.3)
|
|
287
|
+
|
|
288
|
+
Sample:
|
|
289
|
+
|
|
290
|
+
*SSO_CLIENTNAME_ATTRIBUTE = "preferred_username"*
|
|
291
|
+
|
|
292
|
+
### SSO_USERNAME_ATTRIBUTE
|
|
293
|
+
|
|
294
|
+
The attribute that contains the user name in the token. User name is used to identify admins. It is only needed for configuration.
|
|
295
|
+
|
|
296
|
+
Default: *preferred_username*
|
|
297
|
+
|
|
298
|
+
Sample:
|
|
299
|
+
|
|
300
|
+
*SSO_CLIENTNAME_ATTRIBUTE = "email"*
|
|
301
|
+
|
|
302
|
+
### ADMIN_USERS
|
|
303
|
+
|
|
304
|
+
List of users who are allowed to access /v1/appconfig endpoints.
|
|
305
|
+
|
|
306
|
+
Sample:
|
|
307
|
+
ADMIN_USERS=username1, username2
|
|
270
308
|
|
|
271
309
|
## Logging
|
|
272
310
|
|
|
@@ -306,6 +344,22 @@ The URL of the OIDC Provider for user authentication
|
|
|
306
344
|
Sample:
|
|
307
345
|
*REACT_APP_SSO_URL=https://sso.mydomain.io/auth/realms/itsmproxy*
|
|
308
346
|
|
|
347
|
+
since version 1.5.2:
|
|
348
|
+
For manual OICD endpoint configuration you must provide all of the following parameters:
|
|
349
|
+
*REACT_APP_OIDC_AUTHORIZATION_ENDPOINT=https://sso.mydomain.io/auth/realms/itsmproxy/protocol/openid-connect/auth*
|
|
350
|
+
*REACT_APP_OIDC_USERINFO_ENDPOINT=https://sso.mydomain.io/auth/realms/itsmproxy/protocol/openid-connect/userinfo*
|
|
351
|
+
*REACT_APP_OIDC_END_SESSION_ENDPOINT=https://sso.mydomain.io/auth/realms/itsmproxy/protocol/openid-connect/logout*
|
|
352
|
+
*REACT_APP_OIDC_JWKS_URI=https://sso.mydomain.io/auth/realms/itsmproxy/protocol/openid-connect/certs*
|
|
353
|
+
*REACT_APP_OIDC_TOKEN_ENDPOINT=https://sso.mydomain.io/auth/realms/itsmproxy/protocol/openid-connect/token*
|
|
354
|
+
|
|
355
|
+
To allow Authorization Flow with PKCE set
|
|
356
|
+
REACT_APP_OIDC_RESPONSE_TYPE=code
|
|
357
|
+
Default value is "token id_token", which uses Implicit Flow.
|
|
358
|
+
|
|
359
|
+
Use REACT_APP_OIDC_TOKEN to choose the token to use. Default is access_token
|
|
360
|
+
|
|
361
|
+
Use REACT_APP_OIDC_SCOPE to choose the oidc scope
|
|
362
|
+
|
|
309
363
|
## GUI
|
|
310
364
|
|
|
311
365
|
### REACT_APP_GUI_URL
|
package/docs/openapi.json
CHANGED
|
@@ -4479,7 +4479,9 @@
|
|
|
4479
4479
|
"OIDC": [
|
|
4480
4480
|
]
|
|
4481
4481
|
}
|
|
4482
|
-
]
|
|
4482
|
+
],
|
|
4483
|
+
"summary": "Get a single record",
|
|
4484
|
+
"description": "Receive a single record from a custom form, identified by its id."
|
|
4483
4485
|
},
|
|
4484
4486
|
"put": {
|
|
4485
4487
|
"requestBody": {
|
|
@@ -4505,7 +4507,9 @@
|
|
|
4505
4507
|
"OIDC": [
|
|
4506
4508
|
]
|
|
4507
4509
|
}
|
|
4508
|
-
]
|
|
4510
|
+
],
|
|
4511
|
+
"summary": "Update a record",
|
|
4512
|
+
"description": "Update a single record on a custom form, identified by its id."
|
|
4509
4513
|
},
|
|
4510
4514
|
"parameters": [
|
|
4511
4515
|
{
|
package/docs/releases.md
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## API
|
|
4
4
|
|
|
5
|
+
### 1.49.0 - 04.11.21
|
|
6
|
+
Add attachmentScripts to Worklogs
|
|
7
|
+
|
|
8
|
+
### 1.48.0 - 03.11.21
|
|
9
|
+
Add parameter SSO_USERNAME_ATTRIBUTE to config.
|
|
10
|
+
|
|
5
11
|
### 1.47.0 - 22.10.21
|
|
6
12
|
Add xmlParser to scripts.
|
|
13
|
+
|
|
7
14
|
See https://www.npmjs.com/package/fast-xml-parser
|
|
8
15
|
|
|
9
16
|
Add customForms
|
|
@@ -13,6 +20,7 @@ Fix known issue: Check for activation Task Phase and activate if reached
|
|
|
13
20
|
|
|
14
21
|
### 1.46.3 - 18.10.21
|
|
15
22
|
Fix issue: Task not activated when phase already active
|
|
23
|
+
|
|
16
24
|
Known issues: Tasks might get activated early
|
|
17
25
|
|
|
18
26
|
### 1.46.2 - 14.10.21
|
|
@@ -47,7 +55,9 @@ Allow also "isPublic": "true" instead of "isPublic": true for Ticket Worklogs
|
|
|
47
55
|
|
|
48
56
|
### 1.43.0 - 20.09.21
|
|
49
57
|
Allow bypassCache option in Remedy Adapter
|
|
58
|
+
|
|
50
59
|
Add support for Task Phasing
|
|
60
|
+
|
|
51
61
|
Regenrate Task Flow on Task Update
|
|
52
62
|
|
|
53
63
|
### 1.42.1 - 09.09.21
|
|
@@ -59,7 +69,9 @@ Add IDs to POST Actions for After Execution Scripts
|
|
|
59
69
|
### 1.41.4 - 10.08.21
|
|
60
70
|
|
|
61
71
|
Fix mapping for Ticket Worklogs
|
|
72
|
+
|
|
62
73
|
Fix mapping for Task Worklogs
|
|
74
|
+
|
|
63
75
|
Fix issue with sort in Remedy Adapter
|
|
64
76
|
|
|
65
77
|
### 1.41.0 - 03.08.21
|
|
@@ -78,6 +90,9 @@ e.g.
|
|
|
78
90
|
|
|
79
91
|
## Event Manager
|
|
80
92
|
|
|
93
|
+
### 1.18.0 - 03.11.21
|
|
94
|
+
Add parameter SSO_USERNAME_ATTRIBUTE to config.
|
|
95
|
+
|
|
81
96
|
### 1.17.1 - 01.10.21
|
|
82
97
|
Fix issue: TicketNumber3 added to Event Data
|
|
83
98
|
|
|
@@ -94,6 +109,22 @@ Update Record added to [Remedy Adapter](adapter#remedy).
|
|
|
94
109
|
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.
|
|
95
110
|
|
|
96
111
|
## GUI
|
|
112
|
+
### 1.5.5 - 03.11.21
|
|
113
|
+
Add Parameter REACT_APP_OIDC_SCOPE to choose the oicd scope
|
|
114
|
+
|
|
115
|
+
### 1.5.4 - 03.11.21
|
|
116
|
+
Add Parameter REACT_APP_OIDC_TOKEN to choose the token to use (access_token/id_token)
|
|
117
|
+
|
|
118
|
+
### 1.5.3 - 03.11.21
|
|
119
|
+
Allow Authorization Flow with PKCE. Added Parameter: REACT_APP_OIDC_RESPONSE_TYPE.
|
|
120
|
+
Default value is "token id_token". To use Authorization Flow with PKCE you need to set "REACT_APP_OIDC_RESPONSE_TYPE=code"
|
|
121
|
+
|
|
122
|
+
### 1.5.2 - 03.11.21
|
|
123
|
+
Fix: OIDC Endpoints URL are wrong for some OIDC Providers. Also added parameters for manual endpoint configuration
|
|
124
|
+
|
|
125
|
+
### 1.5.1 - 22.10.21
|
|
126
|
+
Custom Forms added
|
|
127
|
+
|
|
97
128
|
|
|
98
129
|
### 1.4.18 - 11.08.21
|
|
99
130
|
hovering on fields in mappingtable, destroys values in "new" mapping, in some situations
|
package/package.json
CHANGED
package/routes/taskRoutes.js
CHANGED
|
@@ -287,7 +287,7 @@ module.exports = (function () {
|
|
|
287
287
|
};
|
|
288
288
|
} else {
|
|
289
289
|
//fileContent = JSON.parse(file.data);
|
|
290
|
-
task.setWorklogAttachment(req.user.config, worklogId, file, attachmentId).then(
|
|
290
|
+
task.setWorklogAttachment(req.user.config, worklogId, file, attachmentId, req.globalScriptParams).then(
|
|
291
291
|
uploadResult => {
|
|
292
292
|
req.result = uploadResult;
|
|
293
293
|
next();
|
|
@@ -318,7 +318,7 @@ module.exports = (function () {
|
|
|
318
318
|
);
|
|
319
319
|
|
|
320
320
|
//fileContent = JSON.parse(file.data);
|
|
321
|
-
task.getWorklogAttachment(req.user.config, worklogId, attachmentId).then(
|
|
321
|
+
task.getWorklogAttachment(req.user.config, worklogId, attachmentId, req.globalScriptParams).then(
|
|
322
322
|
downloadResult => {
|
|
323
323
|
req.downloadResult = downloadResult;
|
|
324
324
|
next();
|
|
@@ -91,7 +91,7 @@ module.exports = (function() {
|
|
|
91
91
|
};
|
|
92
92
|
} else {
|
|
93
93
|
//fileContent = JSON.parse(file.data);
|
|
94
|
-
ticketWorkLogController.setWorklogAttachment(req.ticketConfig, req.user.config, worklogId, file, attachmentId).then(
|
|
94
|
+
ticketWorkLogController.setWorklogAttachment(req.ticketConfig, req.user.config, worklogId, file, attachmentId, req.globalScriptParams).then(
|
|
95
95
|
uploadResult => {
|
|
96
96
|
req.result = uploadResult;
|
|
97
97
|
next();
|
|
@@ -123,7 +123,7 @@ module.exports = (function() {
|
|
|
123
123
|
);
|
|
124
124
|
|
|
125
125
|
//fileContent = JSON.parse(file.data);
|
|
126
|
-
ticketWorkLogController.getWorklogAttachment(req.ticketConfig, req.user.config, worklogId, attachmentId).then(
|
|
126
|
+
ticketWorkLogController.getWorklogAttachment(req.ticketConfig, req.user.config, worklogId, attachmentId, req.globalScriptParams).then(
|
|
127
127
|
downloadResult => {
|
|
128
128
|
req.downloadResult = downloadResult;
|
|
129
129
|
next();
|
package/util/config.js
CHANGED
|
@@ -261,6 +261,10 @@ function checkClientConfig(client) {
|
|
|
261
261
|
clientConfig[key].scripts = {};
|
|
262
262
|
log.info('add scripts', key);
|
|
263
263
|
}
|
|
264
|
+
if (key.endsWith('Worklog') && !clientConfig[key].attachmentScripts) {
|
|
265
|
+
clientConfig[key].attachmentScripts = {};
|
|
266
|
+
log.info('add attachmentScripts', key);
|
|
267
|
+
}
|
|
264
268
|
}
|
|
265
269
|
});
|
|
266
270
|
//add too less
|