@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.
- package/.github/workflows/nodejs.yml +26 -0
- package/CHANGELOG.md +75 -0
- package/Dockerfile +21 -0
- package/README.md +1 -0
- package/app.js +316 -0
- package/conf/clients.json +2491 -0
- package/conf/mapping.json +1048 -0
- package/conf/scripts/p1.js +11 -0
- package/conf/scripts/p2.js +1 -0
- package/conf/scripts/p3.js +1 -0
- package/conf/scripts/p4.js +2 -0
- package/conf/scripts/script1.js +2 -0
- package/conf/scripts/script2.js +2 -0
- package/conf/scripts/script3.js +2 -0
- package/controller/cmdbobjectController.js +291 -0
- package/controller/eventLogController.js +78 -0
- package/controller/orgdataController.js +440 -0
- package/controller/relatedObjectsController.js +194 -0
- package/controller/scriptController.js +213 -0
- package/controller/taskController.js +368 -0
- package/controller/templateController.js +97 -0
- package/controller/ticketCIRelationController.js +522 -0
- package/controller/ticketController.js +329 -0
- package/controller/ticketWorkLogController.js +195 -0
- package/docs/.gitattributes +48 -0
- package/docs/404.html +13 -0
- package/docs/CNAME +1 -0
- package/docs/Gemfile +7 -0
- package/docs/Gemfile.lock +249 -0
- package/docs/_config.yml +257 -0
- package/docs/_data/SocialNetworks.yml +92 -0
- package/docs/_data/ui-text.yml +494 -0
- package/docs/_includes/disqus.html +17 -0
- package/docs/_includes/ext-css.html +7 -0
- package/docs/_includes/ext-js.html +7 -0
- package/docs/_includes/fb-comment.html +14 -0
- package/docs/_includes/footer-minimal.html +16 -0
- package/docs/_includes/footer-scripts.html +32 -0
- package/docs/_includes/footer.html +51 -0
- package/docs/_includes/google_analytics.html +14 -0
- package/docs/_includes/gtag.html +11 -0
- package/docs/_includes/gtm_body.html +6 -0
- package/docs/_includes/gtm_head.html +9 -0
- package/docs/_includes/head.html +131 -0
- package/docs/_includes/header.html +76 -0
- package/docs/_includes/just_comments.html +4 -0
- package/docs/_includes/matomo.html +17 -0
- package/docs/_includes/nav.html +57 -0
- package/docs/_includes/social-share.html +42 -0
- package/docs/_includes/staticman-comment.html +22 -0
- package/docs/_includes/staticman-comments.html +81 -0
- package/docs/_layouts/base.html +35 -0
- package/docs/_layouts/default.html +9 -0
- package/docs/_layouts/minimal.html +26 -0
- package/docs/_layouts/page.html +26 -0
- package/docs/_layouts/post.html +82 -0
- package/docs/_posts/2015-02-28-test-markdown.md +77 -0
- package/docs/aboutme.md +18 -0
- package/docs/css/bootstrap-social.css +147 -0
- package/docs/css/bootstrap-theme.css +476 -0
- package/docs/css/bootstrap-theme.css.map +1 -0
- package/docs/css/bootstrap-theme.min.css +5 -0
- package/docs/css/bootstrap.css +6566 -0
- package/docs/css/bootstrap.css.map +1 -0
- package/docs/css/bootstrap.min.css +5 -0
- package/docs/css/main-minimal.css +13 -0
- package/docs/css/main.css +788 -0
- package/docs/css/normalize.css +427 -0
- package/docs/css/pygment_highlights.css +61 -0
- package/docs/css/staticman.css +180 -0
- package/docs/eventlog/events.md +65 -0
- package/docs/feed.xml +24 -0
- package/docs/general/architecture.md +10 -0
- package/docs/general/config.md +192 -0
- package/docs/general/field-management.md +119 -0
- package/docs/general/release-notes.md +9 -0
- package/docs/getting-started.md +19 -0
- package/docs/howto/cmdbobjects.md +339 -0
- package/docs/howto/incident-worklogs.md +186 -0
- package/docs/howto/incidents.md +244 -0
- package/docs/howto/sample-config.md +518 -0
- package/docs/howto/token.md +71 -0
- package/docs/howto/worklog-attachment.md +113 -0
- package/docs/img/404-southpark.jpg +0 -0
- package/docs/img/architecture.jpeg +0 -0
- package/docs/img/attachment-upload.png +0 -0
- package/docs/img/avatar-icon.png +0 -0
- package/docs/img/bgimage.png +0 -0
- package/docs/img/gb-isapi.jpg +0 -0
- package/docs/img/install-steps.gif +0 -0
- package/docs/img/workflow.png +0 -0
- package/docs/index.md +41 -0
- package/docs/installation.md +123 -0
- package/docs/js/bootstrap.js +2306 -0
- package/docs/js/bootstrap.min.js +7 -0
- package/docs/js/jquery-1.11.2.min.js +4 -0
- package/docs/js/main.js +140 -0
- package/docs/js/staticman.js +54 -0
- package/docs/openapi.json +15097 -0
- package/docs/postinstall.md +169 -0
- package/docs/preinstall.md +19 -0
- package/docs/spec/index.html +24 -0
- package/docs/staticman.yml +110 -0
- package/docs/tags.html +34 -0
- package/docs/workflow.md +127 -0
- package/nodemon.json +3 -0
- package/package.json +46 -0
- package/routes/appConfigRoutes.js +352 -0
- package/routes/ciRelationRoutes.js +38 -0
- package/routes/cmdbObjectRoutes.js +154 -0
- package/routes/organisationRoutes.js +121 -0
- package/routes/peopleRelationRoutes.js +38 -0
- package/routes/personRoutes.js +131 -0
- package/routes/supportgroupRoutes.js +122 -0
- package/routes/taskRoutes.js +306 -0
- package/routes/templateRoutes.js +67 -0
- package/routes/ticketRoutes.js +181 -0
- package/routes/ticketWorkLogRoutes.js +185 -0
- package/screwdriver.yaml +52 -0
- package/test/appTest.js +3 -0
- package/test/changeTest.js +541 -0
- package/test/cmdbobjectTest.js +167 -0
- package/test/files/logo.png +0 -0
- package/test/incidentTest.js +539 -0
- package/test/orgdataTest.js +156 -0
- package/test/problemTest.js +512 -0
- package/test/templateTest.js +80 -0
- package/test/testUtils.js +21 -0
- package/test/workorderTest.js +544 -0
- package/util/arquery.js +416 -0
- package/util/auth.js +37 -0
- package/util/cache.service.js +52 -0
- package/util/config.js +361 -0
- package/util/constants.js +73 -0
- package/util/mappingUtil.js +96 -0
- package/util/paramHelper.js +43 -0
- package/util/relationUtil.js +63 -0
- package/util/responsehandler.js +92 -0
- package/util/schemas/clientConfigSchema.js +180 -0
- package/util/schemas/fieldMappingSchema.js +211 -0
- package/util/searchUtil.js +148 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
const assert = require('chai').assert;
|
|
2
|
+
let chai = require('chai');
|
|
3
|
+
let chaiHttp = require('chai-http');
|
|
4
|
+
let should = chai.should();
|
|
5
|
+
let server = require('../app');
|
|
6
|
+
const TestUtils = require('./testUtils')
|
|
7
|
+
require('dotenv').config();
|
|
8
|
+
|
|
9
|
+
//Integrations Tests here
|
|
10
|
+
|
|
11
|
+
chai.use(chaiHttp);
|
|
12
|
+
|
|
13
|
+
describe('Integration Tests - CMDBObject', function () {
|
|
14
|
+
|
|
15
|
+
let authUser = {'id':process.env.TEST_ID, 'secret':process.env.TEST_SECRET};
|
|
16
|
+
|
|
17
|
+
before((done) => {
|
|
18
|
+
|
|
19
|
+
// Authenticate the user to get a token
|
|
20
|
+
TestUtils.authenticateUser(authUser, server)
|
|
21
|
+
.then((accessToken) => {
|
|
22
|
+
// Keep the token on the user so we can use it in the tests
|
|
23
|
+
authUser.access_token = accessToken;
|
|
24
|
+
return done();
|
|
25
|
+
})
|
|
26
|
+
.catch((err) => done(err));
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('GET CMDBObjects', function () {
|
|
30
|
+
it ('it should get all cmdbobjects', function (done) {
|
|
31
|
+
this.timeout(300000);
|
|
32
|
+
chai.request(server)
|
|
33
|
+
.get('/v1/cmdbobjects')
|
|
34
|
+
.set('Authorization', 'Bearer ' + authUser.access_token)
|
|
35
|
+
.end(function(err, res) {
|
|
36
|
+
res.should.have.status(200);
|
|
37
|
+
res.body.data.should.be.a('array');
|
|
38
|
+
res.body.data.length.should.be.above(0);
|
|
39
|
+
done();
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it ('it should get all cmdbobjects by category', function (done) {
|
|
44
|
+
this.timeout(30000);
|
|
45
|
+
chai.request(server)
|
|
46
|
+
.get('/v1/cmdbobjects?category=Hardware')
|
|
47
|
+
.set('Authorization', 'Bearer ' + authUser.access_token)
|
|
48
|
+
.end(function(err, res) {
|
|
49
|
+
res.should.have.status(200);
|
|
50
|
+
res.body.data.should.be.a('array');
|
|
51
|
+
res.body.data.length.should.be.above(0);
|
|
52
|
+
done();
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it ('it should get cmdbobjects by ids', function (done) {
|
|
57
|
+
this.timeout(5000);
|
|
58
|
+
chai.request(server)
|
|
59
|
+
.get('/v1/cmdbobjects?ciIds=OI-a2c843b3e3d14eeaa74dcefd4fdcf808, OI-94001f3f08b7415685fe72ec17f98f84')
|
|
60
|
+
.set('Authorization', 'Bearer ' + authUser.access_token)
|
|
61
|
+
.end(function(err, res) {
|
|
62
|
+
res.should.have.status(200);
|
|
63
|
+
res.body.data.should.be.a('array');
|
|
64
|
+
res.body.data.length.should.be.equal(2);
|
|
65
|
+
done();
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it ('it should get cmdbobjects by category and ids', function (done) {
|
|
70
|
+
this.timeout(5000);
|
|
71
|
+
chai.request(server)
|
|
72
|
+
.get('/v1/cmdbobjects?category=Hardware&ciIds=OI-a2c843b3e3d14eeaa74dcefd4fdcf808, OI-94001f3f08b7415685fe72ec17f98f84')
|
|
73
|
+
.set('Authorization', 'Bearer ' + authUser.access_token)
|
|
74
|
+
.end(function(err, res) {
|
|
75
|
+
res.should.have.status(200);
|
|
76
|
+
res.body.data.should.be.a('array');
|
|
77
|
+
res.body.data.length.should.be.equal(2);
|
|
78
|
+
done();
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it ('it should get a spezific cmdbobject by id', function (done) {
|
|
83
|
+
this.timeout(5000);
|
|
84
|
+
chai.request(server)
|
|
85
|
+
.get('/v1/cmdbobjects/OI-a2c843b3e3d14eeaa74dcefd4fdcf808')
|
|
86
|
+
.set('Authorization', 'Bearer ' + authUser.access_token)
|
|
87
|
+
.end(function(err, res) {
|
|
88
|
+
res.should.have.status(200);
|
|
89
|
+
res.body.data.should.be.an('object');
|
|
90
|
+
res.body.data.should.have.property('name');
|
|
91
|
+
res.body.data.should.have.property('id');
|
|
92
|
+
res.body.data.should.have.property('assetlifecycleStatus');
|
|
93
|
+
done();
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it ('it should get a spezific cmdbobject by id with included objects', function (done) {
|
|
98
|
+
this.timeout(50000);
|
|
99
|
+
chai.request(server)
|
|
100
|
+
.get('/v1/cmdbobjects/OI-a2c843b3e3d14eeaa74dcefd4fdcf808?includeObjects=true')
|
|
101
|
+
.set('Authorization', 'Bearer ' + authUser.access_token)
|
|
102
|
+
.end(function(err, res) {
|
|
103
|
+
res.should.have.status(200);
|
|
104
|
+
res.body.data.should.be.an('object');
|
|
105
|
+
res.body.data.should.have.property('name');
|
|
106
|
+
res.body.data.should.have.property('id');
|
|
107
|
+
res.body.data.should.have.property('assetlifecycleStatus');
|
|
108
|
+
|
|
109
|
+
res.body.included.should.be.an('object');
|
|
110
|
+
res.body.included.should.have.property('persons');
|
|
111
|
+
res.body.included.persons.should.be.an('array');
|
|
112
|
+
res.body.included.persons.length.should.be.above(0);
|
|
113
|
+
|
|
114
|
+
res.body.included.should.have.property('organisations');
|
|
115
|
+
res.body.included.organisations.should.be.an('array');
|
|
116
|
+
res.body.included.organisations.length.should.be.above(0);
|
|
117
|
+
|
|
118
|
+
res.body.included.should.have.property('supportgroups');
|
|
119
|
+
res.body.included.supportgroups.should.be.an('array');
|
|
120
|
+
res.body.included.supportgroups.length.should.be.above(0);
|
|
121
|
+
done();
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
it ('it should search for cmdbobjects with included objects', function (done) {
|
|
126
|
+
this.timeout(50000);
|
|
127
|
+
chai.request(server)
|
|
128
|
+
.post('/v1/cmdbobjects/search?includeObjects=true')
|
|
129
|
+
.set('Authorization', 'Bearer ' + authUser.access_token)
|
|
130
|
+
.send({
|
|
131
|
+
"searchString":"'id'LIKE\"OI-a2c843b3e3d14eeaa74dcefd4fdcf808\"",
|
|
132
|
+
"getRelations":true
|
|
133
|
+
})
|
|
134
|
+
.end(function(err, res) {
|
|
135
|
+
res.should.have.status(200);
|
|
136
|
+
res.body.data.should.be.an('array');
|
|
137
|
+
|
|
138
|
+
res.body.included.should.be.an('object');
|
|
139
|
+
res.body.included.should.have.property('persons');
|
|
140
|
+
res.body.included.persons.should.be.an('array');
|
|
141
|
+
res.body.included.persons.length.should.be.above(0);
|
|
142
|
+
|
|
143
|
+
res.body.included.should.have.property('organisations');
|
|
144
|
+
res.body.included.organisations.should.be.an('array');
|
|
145
|
+
res.body.included.organisations.length.should.be.above(0);
|
|
146
|
+
|
|
147
|
+
res.body.included.should.have.property('supportgroups');
|
|
148
|
+
res.body.included.supportgroups.should.be.an('array');
|
|
149
|
+
res.body.included.supportgroups.length.should.be.above(0);
|
|
150
|
+
done();
|
|
151
|
+
})
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
/*it ('it should find cmdbobjects by name', function (done) {
|
|
155
|
+
this.timeout(5000);
|
|
156
|
+
chai.request(server)
|
|
157
|
+
.get('/v1/cmdbobjects/findByName?name=Hallo')
|
|
158
|
+
.set('Authorization', 'Bearer ' + authUser.access_token)
|
|
159
|
+
.end(function(err, res) {
|
|
160
|
+
res.should.have.status(200);
|
|
161
|
+
res.body.data.should.be.a('array');
|
|
162
|
+
res.body.data.length.should.be.above(0);
|
|
163
|
+
done();
|
|
164
|
+
})
|
|
165
|
+
})*/
|
|
166
|
+
})
|
|
167
|
+
})
|
|
Binary file
|