@manyos/smileconnect-api 1.28.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.
Files changed (141) hide show
  1. package/.github/workflows/nodejs.yml +26 -0
  2. package/CHANGELOG.md +75 -0
  3. package/Dockerfile +21 -0
  4. package/README.md +1 -0
  5. package/app.js +316 -0
  6. package/conf/clients.json +2491 -0
  7. package/conf/mapping.json +1048 -0
  8. package/conf/scripts/p1.js +11 -0
  9. package/conf/scripts/p2.js +1 -0
  10. package/conf/scripts/p3.js +1 -0
  11. package/conf/scripts/p4.js +2 -0
  12. package/conf/scripts/script1.js +2 -0
  13. package/conf/scripts/script2.js +2 -0
  14. package/conf/scripts/script3.js +2 -0
  15. package/controller/cmdbobjectController.js +291 -0
  16. package/controller/eventLogController.js +78 -0
  17. package/controller/orgdataController.js +440 -0
  18. package/controller/relatedObjectsController.js +194 -0
  19. package/controller/scriptController.js +213 -0
  20. package/controller/taskController.js +368 -0
  21. package/controller/templateController.js +97 -0
  22. package/controller/ticketCIRelationController.js +522 -0
  23. package/controller/ticketController.js +329 -0
  24. package/controller/ticketWorkLogController.js +195 -0
  25. package/docs/.gitattributes +48 -0
  26. package/docs/404.html +13 -0
  27. package/docs/CNAME +1 -0
  28. package/docs/Gemfile +7 -0
  29. package/docs/Gemfile.lock +249 -0
  30. package/docs/_config.yml +257 -0
  31. package/docs/_data/SocialNetworks.yml +92 -0
  32. package/docs/_data/ui-text.yml +494 -0
  33. package/docs/_includes/disqus.html +17 -0
  34. package/docs/_includes/ext-css.html +7 -0
  35. package/docs/_includes/ext-js.html +7 -0
  36. package/docs/_includes/fb-comment.html +14 -0
  37. package/docs/_includes/footer-minimal.html +16 -0
  38. package/docs/_includes/footer-scripts.html +32 -0
  39. package/docs/_includes/footer.html +51 -0
  40. package/docs/_includes/google_analytics.html +14 -0
  41. package/docs/_includes/gtag.html +11 -0
  42. package/docs/_includes/gtm_body.html +6 -0
  43. package/docs/_includes/gtm_head.html +9 -0
  44. package/docs/_includes/head.html +131 -0
  45. package/docs/_includes/header.html +76 -0
  46. package/docs/_includes/just_comments.html +4 -0
  47. package/docs/_includes/matomo.html +17 -0
  48. package/docs/_includes/nav.html +57 -0
  49. package/docs/_includes/social-share.html +42 -0
  50. package/docs/_includes/staticman-comment.html +22 -0
  51. package/docs/_includes/staticman-comments.html +81 -0
  52. package/docs/_layouts/base.html +35 -0
  53. package/docs/_layouts/default.html +9 -0
  54. package/docs/_layouts/minimal.html +26 -0
  55. package/docs/_layouts/page.html +26 -0
  56. package/docs/_layouts/post.html +82 -0
  57. package/docs/_posts/2015-02-28-test-markdown.md +77 -0
  58. package/docs/aboutme.md +18 -0
  59. package/docs/css/bootstrap-social.css +147 -0
  60. package/docs/css/bootstrap-theme.css +476 -0
  61. package/docs/css/bootstrap-theme.css.map +1 -0
  62. package/docs/css/bootstrap-theme.min.css +5 -0
  63. package/docs/css/bootstrap.css +6566 -0
  64. package/docs/css/bootstrap.css.map +1 -0
  65. package/docs/css/bootstrap.min.css +5 -0
  66. package/docs/css/main-minimal.css +13 -0
  67. package/docs/css/main.css +788 -0
  68. package/docs/css/normalize.css +427 -0
  69. package/docs/css/pygment_highlights.css +61 -0
  70. package/docs/css/staticman.css +180 -0
  71. package/docs/eventlog/events.md +65 -0
  72. package/docs/feed.xml +24 -0
  73. package/docs/general/architecture.md +10 -0
  74. package/docs/general/config.md +192 -0
  75. package/docs/general/field-management.md +119 -0
  76. package/docs/general/release-notes.md +9 -0
  77. package/docs/getting-started.md +19 -0
  78. package/docs/howto/cmdbobjects.md +339 -0
  79. package/docs/howto/incident-worklogs.md +186 -0
  80. package/docs/howto/incidents.md +244 -0
  81. package/docs/howto/sample-config.md +518 -0
  82. package/docs/howto/token.md +71 -0
  83. package/docs/howto/worklog-attachment.md +113 -0
  84. package/docs/img/404-southpark.jpg +0 -0
  85. package/docs/img/architecture.jpeg +0 -0
  86. package/docs/img/attachment-upload.png +0 -0
  87. package/docs/img/avatar-icon.png +0 -0
  88. package/docs/img/bgimage.png +0 -0
  89. package/docs/img/gb-isapi.jpg +0 -0
  90. package/docs/img/install-steps.gif +0 -0
  91. package/docs/img/workflow.png +0 -0
  92. package/docs/index.md +41 -0
  93. package/docs/installation.md +123 -0
  94. package/docs/js/bootstrap.js +2306 -0
  95. package/docs/js/bootstrap.min.js +7 -0
  96. package/docs/js/jquery-1.11.2.min.js +4 -0
  97. package/docs/js/main.js +140 -0
  98. package/docs/js/staticman.js +54 -0
  99. package/docs/openapi.json +15097 -0
  100. package/docs/postinstall.md +169 -0
  101. package/docs/preinstall.md +19 -0
  102. package/docs/spec/index.html +24 -0
  103. package/docs/staticman.yml +110 -0
  104. package/docs/tags.html +34 -0
  105. package/docs/workflow.md +127 -0
  106. package/nodemon.json +3 -0
  107. package/package.json +46 -0
  108. package/routes/appConfigRoutes.js +352 -0
  109. package/routes/ciRelationRoutes.js +38 -0
  110. package/routes/cmdbObjectRoutes.js +154 -0
  111. package/routes/organisationRoutes.js +121 -0
  112. package/routes/peopleRelationRoutes.js +38 -0
  113. package/routes/personRoutes.js +131 -0
  114. package/routes/supportgroupRoutes.js +122 -0
  115. package/routes/taskRoutes.js +306 -0
  116. package/routes/templateRoutes.js +67 -0
  117. package/routes/ticketRoutes.js +181 -0
  118. package/routes/ticketWorkLogRoutes.js +185 -0
  119. package/screwdriver.yaml +52 -0
  120. package/test/appTest.js +3 -0
  121. package/test/changeTest.js +541 -0
  122. package/test/cmdbobjectTest.js +167 -0
  123. package/test/files/logo.png +0 -0
  124. package/test/incidentTest.js +539 -0
  125. package/test/orgdataTest.js +156 -0
  126. package/test/problemTest.js +512 -0
  127. package/test/templateTest.js +80 -0
  128. package/test/testUtils.js +21 -0
  129. package/test/workorderTest.js +544 -0
  130. package/util/arquery.js +416 -0
  131. package/util/auth.js +37 -0
  132. package/util/cache.service.js +52 -0
  133. package/util/config.js +361 -0
  134. package/util/constants.js +73 -0
  135. package/util/mappingUtil.js +96 -0
  136. package/util/paramHelper.js +43 -0
  137. package/util/relationUtil.js +63 -0
  138. package/util/responsehandler.js +92 -0
  139. package/util/schemas/clientConfigSchema.js +180 -0
  140. package/util/schemas/fieldMappingSchema.js +211 -0
  141. package/util/searchUtil.js +148 -0
@@ -0,0 +1,339 @@
1
+ ---
2
+ layout: page
3
+ title: Access CMDBObjects
4
+ subtitle: In this guide you will learn to do the basic operations with an CMDB Objects.
5
+ use-site-title: true
6
+ gh-badge: [star, fork, follow]
7
+ gh-repo: daattali/beautiful-jekyll
8
+ ---
9
+
10
+ # Read a CMDBObject
11
+
12
+ We can query every cmdbobject we have access to with a simple get request.
13
+
14
+ ## Request Definition
15
+
16
+ To read a cmdbobject you need to do a GET request to the /v1/cmdbobjects/*id* endpoint of your API
17
+
18
+ ### URL
19
+
20
+ *URL*: https://*api-fqdn*/v1/cmdbobjects/*id*
21
+
22
+ *api-fqdn*: The hostname of your API Server
23
+
24
+ *id*: The instance id of the cmdbobjects you want to read.
25
+
26
+ ### Headers
27
+
28
+ *Content-Type*: application/json
29
+
30
+ ### Authorization
31
+
32
+ *Type*: Bearer
33
+
34
+ Use your [API Token](token.md)
35
+
36
+ ### Sample Response
37
+
38
+ GET:https://*api-fqdn*/v1/cmdbobjects/AGGarserver000PMIYWAPL1SMUB5AZ
39
+
40
+ {% highlight json linenos %}
41
+ {
42
+ "data": {
43
+ "id": "AGGarserver000PMIYWAPL1SMUB5AZ",
44
+ "tagNumber": null,
45
+ "name": "Hallo22",
46
+ "assetlifecycleStatus": "Deployed",
47
+ "category": "Hardware",
48
+ "item": "Server",
49
+ "type": "Processing Unit",
50
+ "productName": null,
51
+ "classId": "BMC_COMPUTERSYSTEM",
52
+ "reconId": "REGarserver000PMIYWAPL1SMUB5BC",
53
+ "shortDescription": "Shorty",
54
+ "federatedLink": "https://myit.de/smart-it/REGarserver000PMIYWAPL1SMUB5BC/BMC_COMPUTERSYSTEM",
55
+ "relations": {
56
+ "relatedCIs": [
57
+ {
58
+ "ciId": "AGGarserver000PMIX6MPL1RH6B3Y8",
59
+ "ciClass": "BMC_COMPUTERSYSTEM",
60
+ "direction": "child",
61
+ "relationClass": "BMC.CORE:BMC_DEPENDENCY"
62
+ }
63
+ ],
64
+ "relatedPersons": [
65
+ {
66
+ "personId": "PPL000000000014",
67
+ "role": "Used by"
68
+ },
69
+ {
70
+ "personId": "PPL000000000015",
71
+ "role": "Used by"
72
+ },
73
+ {
74
+ "personId": "PPL000000000016",
75
+ "role": "Used by"
76
+ },
77
+ {
78
+ "personId": "PPL000000000017",
79
+ "role": "Used by"
80
+ },
81
+ {
82
+ "personId": "PPL000000000020",
83
+ "role": "Owned by"
84
+ }
85
+ ],
86
+ "relatedOrganisations": [
87
+ {
88
+ "organisationId": "POR000000000012",
89
+ "role": "Owned by"
90
+ }
91
+ ],
92
+ "relatedSupportGroups": [
93
+ {
94
+ "groupId": "SGP000000000011",
95
+ "role": "Supported by"
96
+ }
97
+ ]
98
+ }
99
+ },
100
+ "included": {
101
+ "persons": [
102
+ {
103
+ "id": "PPL000000000014",
104
+ "name": "Bob Baxter",
105
+ "department": "Customer Service",
106
+ "login": "Bob",
107
+ "mail": "B.Baxter@calbroservices.com",
108
+ "supportGroups": [
109
+ {
110
+ "supportGroupId": "SGP000000000013",
111
+ "isDefault": "No",
112
+ "assignmentAvailability": "Yes",
113
+ "roles": []
114
+ },
115
+ {
116
+ "supportGroupId": "SGP000000000011",
117
+ "isDefault": "No",
118
+ "assignmentAvailability": "Yes",
119
+ "roles": []
120
+ },
121
+ {
122
+ "supportGroupId": "SGP000000000010",
123
+ "isDefault": "No",
124
+ "assignmentAvailability": "Yes",
125
+ "roles": []
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ "id": "PPL000000000015",
131
+ "name": "Michel Dupond",
132
+ "department": null,
133
+ "login": "Michel",
134
+ "mail": "M.Dupond@calbroservices.com",
135
+ "supportGroups": []
136
+ },
137
+ {
138
+ "id": "PPL000000000016",
139
+ "name": "Mary Mann",
140
+ "department": "Customer Service",
141
+ "login": "Mary",
142
+ "mail": "M.Mann@calbroservices.com",
143
+ "supportGroups": [
144
+ {
145
+ "supportGroupId": "SGP000000000010",
146
+ "isDefault": "No",
147
+ "assignmentAvailability": "Yes",
148
+ "roles": [
149
+ "Support Group Manager",
150
+ "Infrastructure Change Manager",
151
+ "Infrastructure Change Approver"
152
+ ]
153
+ },
154
+ {
155
+ "supportGroupId": "SGP000000000011",
156
+ "isDefault": "Yes",
157
+ "assignmentAvailability": "Yes",
158
+ "roles": [
159
+ "Support Group Manager",
160
+ "Infrastructure Change Manager",
161
+ "Infrastructure Change Approver"
162
+ ]
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ "id": "PPL000000000017",
168
+ "name": "Hans Mueller",
169
+ "department": null,
170
+ "login": "Hans",
171
+ "mail": "H.Mueller@calbroservices.com",
172
+ "supportGroups": []
173
+ },
174
+ {
175
+ "id": "PPL000000000020",
176
+ "name": "Manuel Ramirez",
177
+ "department": null,
178
+ "login": "Manuel",
179
+ "mail": "M.Ramirez@calbroservices.com",
180
+ "supportGroups": []
181
+ }
182
+ ],
183
+ "organisations": [
184
+ {
185
+ "id": "POR000000000012",
186
+ "company": "Calbro Services",
187
+ "organisation": "Human Resources",
188
+ "department": "Payroll"
189
+ }
190
+ ],
191
+ "supportgroups": [
192
+ {
193
+ "id": "SGP000000000011",
194
+ "supportGroup": "Service Desk",
195
+ "company": "Calbro Services",
196
+ "supportOrganisation": "IT Support",
197
+ "supportRole": "Help Desk",
198
+ "persons": [
199
+ {
200
+ "personId": "PPL000000000013",
201
+ "isDefaultGroup": "Yes",
202
+ "assignmentAvailability": "Yes",
203
+ "roles": [
204
+ "Support Group Manager",
205
+ "Support Group Admin",
206
+ "Availability Manager",
207
+ "Incident Manager",
208
+ "Problem Coordinator",
209
+ "Service Level Manager",
210
+ "Release Coordinator",
211
+ "Broadcast Submitter",
212
+ "Release Approver",
213
+ "Work Order Manager"
214
+ ]
215
+ },
216
+ {
217
+ "personId": "PPL000000000016",
218
+ "isDefaultGroup": "Yes",
219
+ "assignmentAvailability": "Yes",
220
+ "roles": [
221
+ "Support Group Manager",
222
+ "Infrastructure Change Manager",
223
+ "Infrastructure Change Approver"
224
+ ]
225
+ },
226
+ {
227
+ "personId": "PPL000000000021",
228
+ "isDefaultGroup": "Yes",
229
+ "assignmentAvailability": "Yes",
230
+ "roles": [
231
+ "Support Group Lead"
232
+ ]
233
+ },
234
+ {
235
+ "personId": "PPL000000000012",
236
+ "isDefaultGroup": "Yes",
237
+ "assignmentAvailability": "No",
238
+ "roles": []
239
+ },
240
+ {
241
+ "personId": "PPL000000000014",
242
+ "isDefaultGroup": "No",
243
+ "assignmentAvailability": "Yes",
244
+ "roles": []
245
+ },
246
+ {
247
+ "personId": "PPL000000000105",
248
+ "isDefaultGroup": "Yes",
249
+ "assignmentAvailability": "Yes",
250
+ "roles": [
251
+ "Work Order Manager",
252
+ "Problem Coordinator"
253
+ ]
254
+ },
255
+ {
256
+ "personId": "PPL000000000106",
257
+ "isDefaultGroup": "Yes",
258
+ "assignmentAvailability": "Yes",
259
+ "roles": [
260
+ "Work Order Manager"
261
+ ]
262
+ }
263
+ ]
264
+ }
265
+ ]
266
+ }
267
+ }
268
+ {% endhighlight %}
269
+
270
+ # Search for CMDBObjects
271
+
272
+ You can search for object by sending a POST request custom query. Let's assume you want to find all objects where the names starts with Computer.
273
+
274
+ ## Request Definition
275
+
276
+ To search for objects do a POST to the /v1/cmdbobjects/search endpoint of your API
277
+
278
+ ### URL
279
+
280
+ *URL*: https://*api-fqdn*/v1/cmdbobjects/search
281
+
282
+ *api-fqdn*: The hostname of your API Server
283
+
284
+ ### Headers
285
+
286
+ *Content-Type*: application/json
287
+
288
+ ### Authorization
289
+
290
+ *Type*: Bearer
291
+
292
+ Use your [API Token](token.md)
293
+
294
+ ### Body
295
+
296
+ Provide the searchString you want to use
297
+
298
+ ### Sample Request
299
+
300
+ POST:https://*api-fqdn*/v1/cmdbobjects/search
301
+
302
+ {% highlight json linenos %}
303
+ {
304
+ "searchString":"'name' LIKE \"Computer%\"",
305
+ "getRelations":true,
306
+ "fields": [
307
+ "name",
308
+ "id",
309
+ "assetlifecycleStatus"
310
+ ],
311
+ "sort" : {
312
+ "name" : 1,
313
+ "productName": -1
314
+ },
315
+ "limit": 100,
316
+ "offset": 4
317
+ }
318
+ {% endhighlight %}
319
+
320
+ ### Sample Response
321
+
322
+ {% highlight json linenos %}
323
+ {
324
+ "data": [
325
+ {
326
+ "id": "OI-1B9D2CFA1A9311E9878D0242AC12000A",
327
+ "name": "Computer1",
328
+ "assetlifecycleStatus": "Deployed",
329
+ "relations": {
330
+ "relatedPersons": [],
331
+ "relatedOrganisations": [],
332
+ "relatedSupportGroups": [],
333
+ "relatedCIs": []
334
+ }
335
+ }
336
+ ],
337
+ "included": {}
338
+ }
339
+ {% endhighlight %}
@@ -0,0 +1,186 @@
1
+ ---
2
+ layout: page
3
+ title: Worklogs
4
+ subtitle: In this guide we'll show you how to create and read worklogs.
5
+ use-site-title: true
6
+ gh-badge: [star, fork, follow]
7
+ gh-repo: daattali/beautiful-jekyll
8
+ ---
9
+
10
+ In this guide we'll show you how to create and read worklogs. Worklogs can be used with the following object types:
11
+
12
+ * Incident
13
+ * Problem
14
+ * Change
15
+ * Workorder
16
+ * Workorder Tasks
17
+
18
+ In this guide we'll show the usage on Incidents. For all other request types the functionality is implemented in the same way.
19
+
20
+ # Get all worklogs for an Incident
21
+
22
+ You will receive all worklogs for this incident.
23
+
24
+ ## Request Definition
25
+
26
+ You need to do a GET request to the /v1/incidents/*incidentId*/worklogs endpoint of your API
27
+
28
+ ### URL
29
+
30
+ *URL*: https://*api-fqdn*/v1/incidents/*incidentId*/worklogs
31
+
32
+ *api-fqdn*: The hostname of your API Server
33
+
34
+ *incidentId*: The id of the incident you want to read.
35
+
36
+ ### Headers
37
+
38
+ *Content-Type*: application/json
39
+
40
+ ### Authorization
41
+
42
+ *Type*: Bearer
43
+
44
+ Use your [API Token](token.md)
45
+
46
+ ### Sample Response
47
+
48
+ GET:https://*api-fqdn*/v1/incidents/INC000000000217/worklogs
49
+
50
+ {% highlight json linenos %}
51
+ {
52
+ "data": [
53
+ {
54
+ "summary": "Status Change",
55
+ "text": "Status Marked: Resolved by Allen",
56
+ "id": "WLG000000000533"
57
+ },
58
+ {
59
+ "summary": "Assignment Change",
60
+ "text": "Assigned To: Bob by Remedy Application Service",
61
+ "id": "WLG000000000531"
62
+ },
63
+ {
64
+ "summary": "Created",
65
+ "text": "Incident created by ITSM-API",
66
+ "id": "WLG000000000532"
67
+ }
68
+ ]
69
+ }
70
+ {% endhighlight %}
71
+
72
+ # Get a specifc worklog for an Incident
73
+
74
+ You will receive one specific worklog for this incident.
75
+
76
+ ## Request Definition
77
+
78
+ You need to do a GET request to the /v1/incidents/*incidentId*/worklogs/*worklogid* endpoint of your API
79
+
80
+ ### URL
81
+
82
+ *URL*: https://*api-fqdn*/v1/incidents/*incidentId*/worklogs/*worklogid*
83
+
84
+ *api-fqdn*: The hostname of your API Server
85
+
86
+ *incidentId*: The id of the incident you want to read.
87
+ *worklogid*: The id of the worklog you want to read.
88
+
89
+ ### Headers
90
+
91
+ *Content-Type*: application/json
92
+
93
+ ### Authorization
94
+
95
+ *Type*: Bearer
96
+
97
+ Use your [API Token](token.md)
98
+
99
+ ### Sample Response
100
+
101
+ GET:https://*api-fqdn*/v1/incidents/INC000000000217/worklogs/WLG000000000533
102
+
103
+ {% highlight json linenos %}
104
+ {
105
+ "data": {
106
+ "summary": "Status Change",
107
+ "text": "Status Marked: Resolved by Allen",
108
+ "id": "WLG000000000533"
109
+ },
110
+ "urls": [
111
+ {
112
+ "attachmentUrl": "/v1/incidents/INC000000000217/worklogs/WLG000000000533/attachment"
113
+ },
114
+ {
115
+ "self": "/v1/incidents/INC000000000217/worklogs/WLG000000000533"
116
+ }
117
+ ]
118
+ }
119
+ {% endhighlight %}
120
+
121
+ # Create a new worklog
122
+
123
+ You can document your work on a request in the worklog. Simply create a new one.
124
+
125
+ ## Request Definition
126
+
127
+ To create a worklog you need to do a POST to the /v1/incidents/*incidentid*/worklog endpoint of your API
128
+
129
+ ### URL
130
+
131
+ *URL*: https://*api-fqdn*/v1/incidents/*incidentid*/worklogs
132
+
133
+ *api-fqdn*: The hostname of your API Server
134
+ *incidentId*: The id of the incident you want to read.
135
+
136
+ ### Headers
137
+
138
+ *Content-Type*: application/json
139
+
140
+ ### Authorization
141
+
142
+ *Type*: Bearer
143
+
144
+ Use your [API Token](token.md)
145
+
146
+ ### Body
147
+
148
+ Provide a summary and a detailed text within the *data* attribute.
149
+
150
+ {: .box-note}
151
+ **Note:** In smartit only the detailed text is shown.
152
+
153
+ ### Sample Request
154
+
155
+ POST:https://*api-fqdn*/v1/incidents/INC000000000217/worklogs
156
+
157
+ {% highlight json linenos %}
158
+ {
159
+ "data": {
160
+ "summary": "Implementation update",
161
+ "text": "The implementation will be completed soon. Please stand by."
162
+ }
163
+ }
164
+ {% endhighlight %}
165
+
166
+ ### Sample Response
167
+
168
+ {% highlight json linenos %}
169
+ {
170
+ "data": {
171
+ "summary": "Implementation update",
172
+ "text": "The implementation will be completed soon. Please stand by.",
173
+ "id": "WLG000000001239"
174
+ },
175
+ "urls": [
176
+ {
177
+ "attachmentUrl": "/v1/incidents/INC000000000217/worklogs/WLG000000001239/attachment"
178
+ },
179
+ {
180
+ "self": "/v1/incidents/INC000000000217/worklogs/WLG000000001239"
181
+ }
182
+ ]
183
+ }
184
+ {% endhighlight %}
185
+
186
+ To learn how to hanle attachments click [here](./worklog-attachment.md)