@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,65 @@
1
+ ---
2
+ layout: page
3
+ title: API Queue Events
4
+ subtitle: All events created / processed by the event manager
5
+ use-site-title: true
6
+ ---
7
+
8
+ # Change
9
+
10
+ * CHG_Query
11
+
12
+ * CHG_Created
13
+
14
+ # Incident
15
+
16
+ * INC_Worklog_Created
17
+
18
+ * INC_Created
19
+
20
+ * INC_Modified
21
+
22
+ # CMDB
23
+
24
+ * CMDB_Query
25
+
26
+ Query the CMDB for data. Form AST:BaseElement is used to query.
27
+
28
+ * CMDB_RelationQuery
29
+
30
+ Query the CMDB for relation data. Form BMC.CORE:BMC_BaseRelationship is used to query.
31
+
32
+ * CMDB_PeopleRelationQuery
33
+
34
+ Query the CMDB for people relation data. Form AST:AssetPeople is used to query.
35
+
36
+ # Foundation Data
37
+ * People_Query
38
+
39
+ Query People form AST:People for data.
40
+
41
+ * PeopleOrg_Query
42
+
43
+ Query People Organisations form CTM:People Organization for data.
44
+
45
+ * SupportGroup_Query
46
+
47
+ Query Suppurt Group Form CTM:Support Group for data.
48
+
49
+ # Work Order
50
+
51
+ * WOI_Created
52
+
53
+ A new Workorder was created.
54
+
55
+ * WOI_Modified
56
+
57
+ An existing Workorder was modified.
58
+
59
+ * WOI_WorkLog_Created
60
+
61
+ An new worklog has been attached to a workorder.
62
+
63
+ * WOI_WorkLog_Modified
64
+
65
+ An new worklog has been attached to a workorder.
package/docs/feed.xml ADDED
@@ -0,0 +1,24 @@
1
+ ---
2
+ layout: null
3
+ ---
4
+ <?xml version="1.0" encoding="UTF-8"?>
5
+ <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
6
+ <channel>
7
+ <title>{{ site.title | xml_escape }}</title>
8
+ <description>{{ site.description | xml_escape }}</description>
9
+ <link>{{ '' | absolute_url }}</link>
10
+ <atom:link href="{{ 'feed.xml' | absolute_url }}" rel="self" type="application/rss+xml" />
11
+ {% for post in site.posts limit:20 %}
12
+ <item>
13
+ <title>{{ post.title | xml_escape }}</title>
14
+ <description>
15
+ {% if post.subtitle %}{{ post.subtitle | xml_escape }} - {% endif %}
16
+ {{ post.content | strip_html | xml_escape | truncatewords: 50 }}
17
+ </description>
18
+ <pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
19
+ <link>{{ post.url | absolute_url }}</link>
20
+ <guid isPermaLink="true">{{ post.url | absolute_url }}</guid>
21
+ </item>
22
+ {% endfor %}
23
+ </channel>
24
+ </rss>
@@ -0,0 +1,10 @@
1
+ ---
2
+ layout: page
3
+ title: Architecture
4
+ subtitle: How it fits together
5
+ use-site-title: true
6
+ ---
7
+
8
+ In this guide we will explain the different components of ISAPI and how you can use them.
9
+
10
+ ![architecure of isapi](../img/architecture.jpeg)
@@ -0,0 +1,192 @@
1
+ ---
2
+ layout: page
3
+ title: Config Options
4
+ subtitle: The global configuration of our API
5
+ use-site-title: true
6
+ ---
7
+
8
+ All of the following config options needs to be set as Environment Variables.
9
+
10
+ ## AR Server Connection
11
+
12
+ ### BASEURL
13
+
14
+ Base URL of the used arrestfulapi
15
+
16
+ Sample:
17
+
18
+ *BASEURL=http://localhost:8080*
19
+
20
+ ### AR_SERVER
21
+
22
+ Remedy Server to connect to.
23
+
24
+ Sample:
25
+
26
+ *AR_SERVER=pier1*
27
+
28
+ ### AR_PORT
29
+
30
+ Remedy Server TCP Port.
31
+
32
+ Sample:
33
+
34
+ *AR_PORT=1234*
35
+
36
+ ### AR_USER
37
+
38
+ Remedy Admin User who is used for all queries.
39
+
40
+ Sample:
41
+
42
+ *AR_USER=Demo*
43
+
44
+ ### AR_PASSWORD
45
+
46
+ Remedy Admin User password.
47
+
48
+ Sample:
49
+
50
+ *AR_PASSWORD=password*
51
+
52
+ ## SSO Server Connection
53
+
54
+ ### SSO_PUBLIC_KEY
55
+
56
+ Public Key used to validate JWT tokens.
57
+
58
+ Sample:
59
+
60
+ *SSO_PUBLIC_KEY=1635rN5xkbubgmuNQCnKKFu7OlAD3QxiDwecg1bJvFhJW9Qj5YhOwGuX5/4sOSCjmdTcKT1mCHL61FJ5mzxtbrct97zVwXmi4F4KDKj2PsW+qxUg0Jz/06iTVjtv2H1yBq1*
61
+
62
+ ### SSO_AUDIENCE
63
+
64
+ Audience (Clients) which are allowed to use JWT tokens. This parameter is optional. If it is not set, no check against the JWT token will be performed.
65
+
66
+ Sample:
67
+
68
+ *SSO_AUDIENCE=gihub, jira*
69
+
70
+ ### SSO_ISSUER
71
+
72
+ Issuer (SSO Server) of the JWT tokens.
73
+
74
+ Sample:
75
+
76
+ *SSO_ISSUER=https://sso.manyos.it/auth/realms/itsmproxy*
77
+
78
+ ### ADMIN_USERS
79
+
80
+ List of users who are allowed to access /v1/appconfig endpoints.
81
+
82
+ Sample:
83
+ ADMIN_USERS=username1, username2
84
+
85
+ ## Cache
86
+
87
+ ### CACHETTL_CMDB
88
+ Interval in seconds in which before cached CMDB Data is deleted from the cache.
89
+
90
+ Default: *600*
91
+
92
+ Sample:
93
+
94
+ *CACHETTL_CMDB=2800*
95
+
96
+ ### CACHETTL_ORGDATA
97
+ Interval in seconds in which before cached Org Data like People, Support Groups, Organisations are deleted from the cache.
98
+
99
+ Default: *3600*
100
+
101
+ Sample:
102
+
103
+ *CACHETTL_ORGDATA=7200*
104
+
105
+ ### CACHETTL_CHANGE
106
+ Interval in seconds in which before cached Change Data is deleted from the cache.
107
+
108
+ Default: *1*
109
+
110
+ Sample:
111
+
112
+ *CACHETTL_CHANGE=600*
113
+
114
+ ### CACHETTL_INCIDENT
115
+
116
+ Interval in seconds in which before cached Incident Data is deleted from the cache.
117
+
118
+ Default: *1*
119
+
120
+ Sample:
121
+
122
+ *CACHETTL_INCIDENT=600*
123
+
124
+ ### CACHETTL_WORKORDER
125
+
126
+ Interval in seconds in which before cached Work Order Data is deleted from the cache.
127
+
128
+ Default: *1*
129
+
130
+ Sample:
131
+
132
+ *CACHETTL_WORKORDER=600*
133
+
134
+ ### CACHETTL_TASK
135
+
136
+ Interval in seconds in which before cached Task Data is deleted from the cache.
137
+
138
+ Default: *1*
139
+
140
+ Sample:
141
+
142
+ *CACHETTL_TASK=600*
143
+
144
+ ## Loglevel
145
+
146
+ Loglevel of the api. Defaults to *error*
147
+
148
+ ## RATE_LIMIT
149
+
150
+ Defines how many API requests from a single IP are allowed within a 15min timeframe.
151
+
152
+ Default *10000*
153
+
154
+ Sample:
155
+
156
+ *RATE_LIMIT=600*
157
+
158
+ ## LIMIT_DEFAULT
159
+
160
+ Limits the resultsize of all queries against the Remedy Server. Sets a default that can be overwritten by requests. Can be used to prevent performance issues.
161
+ Affects also relations.
162
+
163
+ Default *unlimited*
164
+
165
+ Sample:
166
+
167
+ *LIMIT_DEFAULT=100*
168
+
169
+ ## LIMIT_MAX
170
+
171
+ Limits the resultsize of all queries against the Remedy Server. Defines a global maximum that can not be overwritten by requests. Will only be overwritten by Limits defined for certains clients. Can be used to prevent performance issues.
172
+ Affects also relations.
173
+
174
+ Default *unlimited*
175
+
176
+ Sample:
177
+
178
+ *LIMIT_MAX=100*
179
+
180
+ ## MAX_HTTP_SOCKETS
181
+
182
+ Defines how many TCP Sockets are used for outgoing connections. (Parallel connections to the Remedy REST API.)
183
+
184
+ Reduce this parameter if you see ECONNRESET or socket hang up errors.
185
+
186
+ This parameter has direct impact on performance.
187
+
188
+ Default *10*
189
+
190
+ Sample:
191
+
192
+ *MAX_HTTP_SOCKETS=15*
@@ -0,0 +1,119 @@
1
+ # Client Config
2
+
3
+ On a per client base it can be configured which fields are returned for each object and if a basequery is applied. This expose certain fields only dedicated clients. It also allows to define which rows a client can access. Clients are configured in conf/clients.json
4
+
5
+ {% highlight json linenos %}
6
+ [
7
+ {
8
+ "name": "jira",
9
+ "config": {
10
+ "options" : {
11
+ "dateFormat" : "dd.MM.yyyy HH:mm.ss",
12
+ "clientLimit": 100
13
+ },
14
+ "cmdbobject": {
15
+ "basequery": "'Data Set Id' = \"BMC.ASSET\" AND ('Mark As Deleted' = \"No\" OR 'Mark As Deleted' = $NULL$) AND 'Class Id' = \"BMC_COMPUTERSYSTEM\"",
16
+ "fields": [
17
+ "Instance Id",
18
+ "Tag Number",
19
+ "Name",
20
+ "AssetLifecycleStatus",
21
+ "Category",
22
+ "Item",
23
+ "Type",
24
+ "Availability",
25
+ "Confidentiality",
26
+ "Integrity",
27
+ "Authenticity",
28
+ "Model Number",
29
+ "Class Id",
30
+ "Reconciliation Identity"
31
+ ]
32
+ },
33
+ "orgdata": {
34
+ "basequeryPeople": "'Profile Status' = \"Enabled\"",
35
+ "basequeryOrganisation": "'Status'=\"Enabled\"",
36
+ "basequerySupportGroup": "'Status'=\"Enabled\""
37
+ },
38
+ "change": {
39
+ "fields": [
40
+ "Infrastructure Change ID",
41
+ "Categorization Tier 1",
42
+ "Categorization Tier 2",
43
+ "Categorization Tier 3",
44
+ "Product Cat Tier 1",
45
+ "Product Cat Tier 2",
46
+ "Product Cat Tier 3",
47
+ "Product Name (2)",
48
+ "Description",
49
+ "Detailed Description",
50
+ "Status Reason",
51
+ "Change Request Status",
52
+ "Requested Start Date",
53
+ "Requested End Date",
54
+ "Scheduled Start Date",
55
+ "Scheduled End Date",
56
+ "Support Group ID",
57
+ "Support Group ID 2",
58
+ "Customer Person ID"
59
+ ],
60
+ "constants" : [
61
+ {"name": "Location Company", "value" : "Calbro Services"},
62
+ {"name": "Company", "value" : "Calbro Services"},
63
+ {"name": "RequesterLoginID", "value" : "Allen"}
64
+ ]
65
+ }
66
+ }
67
+ }
68
+ ]
69
+ {% endhighlight %}
70
+
71
+ # Field Mappings
72
+
73
+ Field mappings are configured in conf/mapping.json and are used globally for all clients.
74
+
75
+ {% highlight json linenos %}
76
+ {
77
+ "cmdbobject":[
78
+ {"oldName":"Instance Id", "newName" : "id"},
79
+ {"oldName":"Tag Number", "newName" : "tagNumber"},
80
+ {"oldName":"Name", "newName" : "name"},
81
+ {"oldName":"AssetLifecycleStatus", "newName" : "assetlifecycleStatus"},
82
+ {"oldName":"Category", "newName" : "category"},
83
+ {"oldName":"Item", "newName" : "item"},
84
+ {"oldName":"Type", "newName" : "type"},
85
+ {"oldName":"Availability", "newName" : "availability"},
86
+ {"oldName":"Confidentiality", "newName" : "confidentiality"},
87
+ {"oldName":"Integrity", "newName" : "integrity"},
88
+ {"oldName":"Authenticity", "newName" : "authenticity"},
89
+ {"oldName":"Model Number", "newName" : "model"},
90
+ {"oldName":"Class Id", "newName" : "classId"},
91
+ {"oldName":"Reconciliation Identity", "newName" : "reconId"}
92
+ ],
93
+ "change":[
94
+ {"oldName":"Infrastructure Change ID", "newName" : "id"},
95
+ {"oldName":"Categorization Tier 1", "newName" : "opsCat1"},
96
+ {"oldName":"Categorization Tier 2", "newName" : "opsCat2"},
97
+ {"oldName":"Categorization Tier 3", "newName" : "opsCat3"},
98
+ {"oldName":"Product Cat Tier 1", "newName" : "prodCat1"},
99
+ {"oldName":"Product Cat Tier 2", "newName" : "prodCat2"},
100
+ {"oldName":"Product Cat Tier 3", "newName" : "prodCat3"},
101
+ {"oldName":"Product Name (2)", "newName" : "productName"},
102
+ {"oldName":"Description", "newName" : "summary"},
103
+ {"oldName":"Detailed Description", "newName" : "detailedDescription"},
104
+ {"oldName":"Status Reason", "newName" : "statusReason"},
105
+ {"oldName":"Change Request Status", "newName" : "status"},
106
+ {"oldName":"Requested Start Date", "newName" : "requestedStartDate"},
107
+ {"oldName":"Requested End Date", "newName" : "requestedEndDate"},
108
+ {"oldName":"Scheduled Start Date", "newName" : "scheduledStartDate"},
109
+ {"oldName":"Scheduled End Date", "newName" : "scheduledEndDate"},
110
+ {"oldName":"Support Group ID", "newName" : "managerGroup"},
111
+ {"oldName":"Support Group ID 2", "newName" : "coordinatorGroup"},
112
+ {"oldName":"Customer Person ID", "newName" : "customerId"}
113
+ ],
114
+ "newChange":[
115
+ {"oldName":"Description", "newName" : "summary"},
116
+ {"oldName":"TemplateID", "newName" : "template"}
117
+ ]
118
+ }
119
+ {% endhighlight %}
@@ -0,0 +1,9 @@
1
+ ---
2
+ layout: page
3
+ title: Architecture
4
+ subtitle: How it fits together
5
+ use-site-title: true
6
+ version: 1.2.3
7
+ ---
8
+
9
+ Release Notes
@@ -0,0 +1,19 @@
1
+ ---
2
+ layout: page
3
+ title: Getting started
4
+ subtitle: Every beginning is hard. We want to help you get started as fast as possible. Follow these guides to learn the basics-
5
+ ---
6
+
7
+ First things first:
8
+ * [How to get a token](howto/token.md)
9
+ * [Setup your client and mapping config](howto/sample-config.md)
10
+
11
+ Now start with the basic stuff:
12
+ * [How to read an incident](howto/incidents.md#read-an-incident)
13
+ * [How to create an incident](howto/incidents.md#create-an-incident)
14
+ * [How to update an incident](howto/incidents.md#update-an-incident)
15
+
16
+ Read on for more advanced usage:
17
+ * [How to handle worklogs](./howto/incident-worklogs.md)
18
+ * [How to deal with attachments](./howto/worklog-attachment.md)
19
+