@stackfactor/client-api 1.0.1 → 1.0.3
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/index.js +22 -22
- package/lib/actionNotifications.js +16 -19
- package/lib/address.js +3 -3
- package/lib/axios.js +66 -62
- package/lib/config.js +5 -12
- package/lib/dashboard.js +5 -5
- package/lib/departmentTrainingPlans.js +9 -9
- package/lib/groups.js +19 -23
- package/lib/integration.js +24 -20
- package/lib/integrationConfiguration.js +5 -5
- package/lib/integrations/contentgenerator.js +4 -5
- package/lib/logger.js +6 -6
- package/lib/role.js +14 -14
- package/lib/roleTemplate.js +11 -11
- package/lib/skill.js +16 -17
- package/lib/skillAssessmentTestingSession.js +7 -7
- package/lib/skillAssessments.js +7 -7
- package/lib/skillTemplate.js +11 -11
- package/lib/teams.js +15 -18
- package/lib/templateDocument.js +6 -14
- package/lib/templatePhase.js +5 -13
- package/lib/templateRelease.js +4 -10
- package/lib/templates.js +8 -19
- package/lib/tenants.js +4 -7
- package/lib/trainingPlanTemplate.js +10 -10
- package/lib/trainingPlans.js +12 -12
- package/lib/userInformation.js +4 -4
- package/lib/users.js +34 -44
- package/lib/utils.js +1 -5
- package/package.json +9 -2
package/lib/integration.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
|
+
const errorToString = axios.errorToString;
|
|
3
|
+
const axiosLib = require("axios");
|
|
4
|
+
const htmlParser = require("node-html-parser");
|
|
5
|
+
const htmlToText = require("html2plaintext");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
module.exports = {
|
|
8
8
|
axios: axios,
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Create integration and set information
|
|
12
|
-
* @param {
|
|
12
|
+
* @param {Object} data The new integration information
|
|
13
13
|
* @param {String} token Authorization token
|
|
14
14
|
*/
|
|
15
|
-
createIntegration(data, token) {
|
|
15
|
+
createIntegration: (data, token) => {
|
|
16
16
|
return new Promise(function (resolve, reject) {
|
|
17
17
|
const requestData = {
|
|
18
18
|
data: data,
|
|
@@ -35,7 +35,7 @@ export default {
|
|
|
35
35
|
* @param {String} id The id of the integration to be deleted
|
|
36
36
|
* @param {String} token Authorization token
|
|
37
37
|
*/
|
|
38
|
-
deleteIntegration(id, token) {
|
|
38
|
+
deleteIntegration: (id, token) => {
|
|
39
39
|
return new Promise(function (resolve, reject) {
|
|
40
40
|
const request = axios.delete(`api/v1/integrations/`, {
|
|
41
41
|
headers: { authorization: token },
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
* @param {String} id The id of the role template to be deleted
|
|
59
59
|
* @param {String} token Authorization token
|
|
60
60
|
*/
|
|
61
|
-
discardIntegrationChanges(id, token) {
|
|
61
|
+
discardIntegrationChanges: (id, token) => {
|
|
62
62
|
return new Promise(function (resolve, reject) {
|
|
63
63
|
const data = {};
|
|
64
64
|
const request = axios.get(`api/v1/integrations/discard/${id}`, {
|
|
@@ -81,7 +81,7 @@ export default {
|
|
|
81
81
|
* @param {String} version The version of the integration to be received
|
|
82
82
|
* @param {String} token Authorization token
|
|
83
83
|
*/
|
|
84
|
-
getIntegrationInformationById(id, version, token) {
|
|
84
|
+
getIntegrationInformationById: (id, version, token) => {
|
|
85
85
|
return new Promise(function (resolve, reject) {
|
|
86
86
|
let confirmationRequest = axios.get(
|
|
87
87
|
`api/v1/integrations/${id}/${version}`,
|
|
@@ -107,13 +107,13 @@ export default {
|
|
|
107
107
|
* @param {Boolean} includeSupportedCapabilities If true, the supported capabilities will be included in the response
|
|
108
108
|
* @param {String} token Authorization token
|
|
109
109
|
*/
|
|
110
|
-
getIntegrationsList(
|
|
110
|
+
getIntegrationsList: (
|
|
111
111
|
filter,
|
|
112
112
|
type,
|
|
113
113
|
version,
|
|
114
114
|
includeSupportedCapabilities,
|
|
115
115
|
token
|
|
116
|
-
) {
|
|
116
|
+
) => {
|
|
117
117
|
return new Promise(function (resolve, reject) {
|
|
118
118
|
const requestData = {
|
|
119
119
|
includeSupportedCapabilities: includeSupportedCapabilities,
|
|
@@ -140,7 +140,7 @@ export default {
|
|
|
140
140
|
* @param {String} verb The verb
|
|
141
141
|
* @param {String} token Authorization token
|
|
142
142
|
*/
|
|
143
|
-
getContentInformationByUrl(url, verb, token) {
|
|
143
|
+
getContentInformationByUrl: (url, verb, token) => {
|
|
144
144
|
return new Promise(function (resolve, reject) {
|
|
145
145
|
const requestData = {
|
|
146
146
|
url: url,
|
|
@@ -163,8 +163,12 @@ export default {
|
|
|
163
163
|
});
|
|
164
164
|
},
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Get content information by url from the browser instead of the backend
|
|
168
|
+
* @param {String} url
|
|
169
|
+
* @returns {Object}
|
|
170
|
+
*/
|
|
171
|
+
getContentInformationByUrlFromBrowser: (url) => {
|
|
168
172
|
return new Promise(function (resolve, reject) {
|
|
169
173
|
let domain = new URL(url);
|
|
170
174
|
let instance = axiosLib.create({
|
|
@@ -241,7 +245,7 @@ export default {
|
|
|
241
245
|
* @param {String} verb The verb
|
|
242
246
|
* @param {String} token Authorization token
|
|
243
247
|
*/
|
|
244
|
-
getEnabledContentProviders(userId, token) {
|
|
248
|
+
getEnabledContentProviders: (userId, token) => {
|
|
245
249
|
return new Promise(function (resolve, reject) {
|
|
246
250
|
let confirmationRequest = axios.get(
|
|
247
251
|
`api/v1/contentproviders/getenabledcontentproviders/${userId}`,
|
|
@@ -264,7 +268,7 @@ export default {
|
|
|
264
268
|
* @param {String} id The id of the integration to be published
|
|
265
269
|
* @param {String} token Authorization token
|
|
266
270
|
*/
|
|
267
|
-
publishIntegration(id, token) {
|
|
271
|
+
publishIntegration: (id, token) => {
|
|
268
272
|
return new Promise(function (resolve, reject) {
|
|
269
273
|
let confirmationRequest = axios.post(
|
|
270
274
|
`api/v1/integrations/publish/${id}`,
|
|
@@ -289,7 +293,7 @@ export default {
|
|
|
289
293
|
* @param {Object} data Data used to update the integration
|
|
290
294
|
* @param {String} token Authorization token
|
|
291
295
|
*/
|
|
292
|
-
setIntegrationInformation(id, data, token) {
|
|
296
|
+
setIntegrationInformation: (id, data, token) => {
|
|
293
297
|
return new Promise(function (resolve, reject) {
|
|
294
298
|
const requestData = {
|
|
295
299
|
data: data,
|
|
@@ -316,7 +320,7 @@ export default {
|
|
|
316
320
|
* @param {String} id The id of the integration to be set as default
|
|
317
321
|
* @param {String} token Authorization token
|
|
318
322
|
*/
|
|
319
|
-
setDefaultIntegration(id, token) {
|
|
323
|
+
setDefaultIntegration: (id, token) => {
|
|
320
324
|
return new Promise(function (resolve, reject) {
|
|
321
325
|
let confirmationRequest = axios.post(
|
|
322
326
|
`api/v1/integrations/${id}/default`,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
axios: axios,
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Get the integration configuration
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {Array<String>} ids
|
|
9
9
|
* @param {Number} type
|
|
10
10
|
* @param {String} token Authorization token
|
|
11
11
|
*/
|
|
12
|
-
getIntegrationsConfiguration(ids, type, token) {
|
|
12
|
+
getIntegrationsConfiguration: (ids, type, token) => {
|
|
13
13
|
return new Promise(function (resolve, reject) {
|
|
14
14
|
let requestData = { type: type };
|
|
15
15
|
if (ids) requestData.ids = ids;
|
|
@@ -37,7 +37,7 @@ export default {
|
|
|
37
37
|
* @param {Object} configuration Data used to update the integration configuration
|
|
38
38
|
* @param {String} token Authorization token
|
|
39
39
|
*/
|
|
40
|
-
saveIntegrationConfiguration(id, type, configuration, token) {
|
|
40
|
+
saveIntegrationConfiguration: (id, type, configuration, token) => {
|
|
41
41
|
return new Promise(function (resolve, reject) {
|
|
42
42
|
const requestData = {
|
|
43
43
|
id: id,
|
|
@@ -68,7 +68,7 @@ export default {
|
|
|
68
68
|
* @param {Object} configuration Configuration to be tested
|
|
69
69
|
* @param {String} token Authorization token
|
|
70
70
|
*/
|
|
71
|
-
testIntegrationConfiguration(id, type, configuration, token) {
|
|
71
|
+
testIntegrationConfiguration: (id, type, configuration, token) => {
|
|
72
72
|
return new Promise(function (resolve, reject) {
|
|
73
73
|
const requestData = {
|
|
74
74
|
id: id,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import axios from "../axios";
|
|
1
|
+
const axios = require("../axios");
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
axios: axios,
|
|
@@ -11,7 +10,7 @@ export default {
|
|
|
11
10
|
* @param {String} token
|
|
12
11
|
* @returns {Object}
|
|
13
12
|
*/
|
|
14
|
-
generateContent(data, contentType, integrationId, token) {
|
|
13
|
+
generateContent: (data, contentType, integrationId, token) => {
|
|
15
14
|
return new Promise(function (resolve, reject) {
|
|
16
15
|
let data_ = {
|
|
17
16
|
data: data,
|
|
@@ -42,7 +41,7 @@ export default {
|
|
|
42
41
|
* @param {String} token
|
|
43
42
|
* @returns {Object}
|
|
44
43
|
*/
|
|
45
|
-
generateContentAsync(
|
|
44
|
+
generateContentAsync: (
|
|
46
45
|
id,
|
|
47
46
|
data,
|
|
48
47
|
contentType,
|
|
@@ -50,7 +49,7 @@ export default {
|
|
|
50
49
|
integrationId,
|
|
51
50
|
comments,
|
|
52
51
|
token
|
|
53
|
-
) {
|
|
52
|
+
) => {
|
|
54
53
|
return new Promise(function (resolve, reject) {
|
|
55
54
|
let data_ = {
|
|
56
55
|
data: data,
|
package/lib/logger.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module.exports = {
|
|
4
4
|
axios: axios,
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
* @param {Object} data
|
|
11
11
|
* @param {String} token Authorization token
|
|
12
12
|
*/
|
|
13
|
-
comment(elementId, elementType, data, token) {
|
|
13
|
+
comment: (elementId, elementType, data, token) => {
|
|
14
14
|
return new Promise(function (resolve, reject) {
|
|
15
15
|
let confirmationRequest = axios.post(
|
|
16
16
|
"api/v1/logger/comment/",
|
|
@@ -36,12 +36,12 @@ export default {
|
|
|
36
36
|
/**
|
|
37
37
|
* Get the list of logger entries for selected element
|
|
38
38
|
* @param {String} elementId
|
|
39
|
-
* @param {
|
|
40
|
-
* @param {
|
|
39
|
+
* @param {Number} page The results page
|
|
40
|
+
* @param {Number} elementsPerPage The number of elements per page
|
|
41
41
|
* @param {String} token
|
|
42
42
|
* @returns
|
|
43
43
|
*/
|
|
44
|
-
getListByElementId(elementId, page, elementsPerPage, token) {
|
|
44
|
+
getListByElementId: (elementId, page, elementsPerPage, token) => {
|
|
45
45
|
return new Promise(function (resolve, reject) {
|
|
46
46
|
let data = {};
|
|
47
47
|
if (elementsPerPage !== null) data.elementsPerPage = elementsPerPage;
|
package/lib/role.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
export default {
|
|
3
|
+
module.exports = {
|
|
5
4
|
axios: axios,
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -9,7 +8,7 @@ export default {
|
|
|
9
8
|
* @param {Object} data
|
|
10
9
|
* @param {String} token Authorization token
|
|
11
10
|
*/
|
|
12
|
-
createRole(data, token) {
|
|
11
|
+
createRole: (data, token) => {
|
|
13
12
|
return new Promise(function (resolve, reject) {
|
|
14
13
|
let confirmationRequest = axios.put(
|
|
15
14
|
"api/v1/roles",
|
|
@@ -34,7 +33,7 @@ export default {
|
|
|
34
33
|
* @param {Object} data
|
|
35
34
|
* @param {String} token Authorization token
|
|
36
35
|
*/
|
|
37
|
-
createRoleFromTemplate(templateId, data, token) {
|
|
36
|
+
createRoleFromTemplate: (templateId, data, token) => {
|
|
38
37
|
return new Promise(function (resolve, reject) {
|
|
39
38
|
const requestData = {
|
|
40
39
|
templateId: templateId,
|
|
@@ -63,7 +62,7 @@ export default {
|
|
|
63
62
|
* @param {String} comment The comment included with the deletion
|
|
64
63
|
* @param {String} token Authorization token
|
|
65
64
|
*/
|
|
66
|
-
deleteRole(id, comment, token) {
|
|
65
|
+
deleteRole: (id, comment, token) => {
|
|
67
66
|
return new Promise(function (resolve, reject) {
|
|
68
67
|
const data = {
|
|
69
68
|
id: id,
|
|
@@ -88,7 +87,7 @@ export default {
|
|
|
88
87
|
* @param {String} id The id of the role to be deleted
|
|
89
88
|
* @param {String} token Authorization token
|
|
90
89
|
*/
|
|
91
|
-
discardRoleChanges(id, token) {
|
|
90
|
+
discardRoleChanges: (id, token) => {
|
|
92
91
|
return new Promise(function (resolve, reject) {
|
|
93
92
|
const data = {};
|
|
94
93
|
const request = axios.get(`api/v1/roles/discard/${id}`, {
|
|
@@ -110,7 +109,7 @@ export default {
|
|
|
110
109
|
* @param {number} id The id of the role
|
|
111
110
|
* @param {String} token Authorization token
|
|
112
111
|
*/
|
|
113
|
-
getRoleInformationById(id, version, token) {
|
|
112
|
+
getRoleInformationById: (id, version, token) => {
|
|
114
113
|
return new Promise(function (resolve, reject) {
|
|
115
114
|
let confirmationRequest = axios.get(
|
|
116
115
|
`api/v1/roles/role/${id}/${version}`,
|
|
@@ -137,14 +136,14 @@ export default {
|
|
|
137
136
|
* @param {Boolean} returnDefaultIfVersionNotAvailable Return the default version if published not available
|
|
138
137
|
* @param {String} token Authorization token
|
|
139
138
|
*/
|
|
140
|
-
getRolesList(
|
|
139
|
+
getRolesList: (
|
|
141
140
|
filter,
|
|
142
141
|
version,
|
|
143
142
|
includeDeleted,
|
|
144
143
|
includeDetailedInformation,
|
|
145
144
|
returnDefaultIfVersionNotAvailable,
|
|
146
145
|
token
|
|
147
|
-
) {
|
|
146
|
+
) => {
|
|
148
147
|
return new Promise(function (resolve, reject) {
|
|
149
148
|
const requestData = {
|
|
150
149
|
version: version,
|
|
@@ -172,7 +171,7 @@ export default {
|
|
|
172
171
|
* @param {String} comment The comment to be include with the request
|
|
173
172
|
* @param {String} token Authorization token
|
|
174
173
|
*/
|
|
175
|
-
publishRole(id, comment, token) {
|
|
174
|
+
publishRole: (id, comment, token) => {
|
|
176
175
|
return new Promise(function (resolve, reject) {
|
|
177
176
|
let data = {};
|
|
178
177
|
if (comment) data.comment = comment;
|
|
@@ -195,7 +194,7 @@ export default {
|
|
|
195
194
|
* @param {Object} data Data used to update the role
|
|
196
195
|
* @param {String} token Authorization token
|
|
197
196
|
*/
|
|
198
|
-
setRoleInformation(id, data, token) {
|
|
197
|
+
setRoleInformation: (id, data, token) => {
|
|
199
198
|
return new Promise(function (resolve, reject) {
|
|
200
199
|
const requestData = {
|
|
201
200
|
data: data,
|
|
@@ -220,7 +219,7 @@ export default {
|
|
|
220
219
|
* @param {Array<Object>} roles
|
|
221
220
|
* @param {String} token
|
|
222
221
|
*/
|
|
223
|
-
setUserRoles(id, roles, roleDescription, token) {
|
|
222
|
+
setUserRoles: (id, roles, roleDescription, token) => {
|
|
224
223
|
return new Promise(function (resolve, reject) {
|
|
225
224
|
const requestData = {
|
|
226
225
|
roles: roles,
|
|
@@ -239,13 +238,14 @@ export default {
|
|
|
239
238
|
});
|
|
240
239
|
});
|
|
241
240
|
},
|
|
241
|
+
|
|
242
242
|
/**
|
|
243
243
|
* Watch role
|
|
244
244
|
* @param {String} id The id of the skill to be updated
|
|
245
245
|
* @param {Boolean} watch Set to true or false
|
|
246
246
|
* @param {String} token Authorization token
|
|
247
247
|
*/
|
|
248
|
-
watchRole(id, watch, token) {
|
|
248
|
+
watchRole: (id, watch, token) => {
|
|
249
249
|
return new Promise(function (resolve, reject) {
|
|
250
250
|
const requestData = {
|
|
251
251
|
id: id,
|
package/lib/roleTemplate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module.exports = {
|
|
4
4
|
axios: axios,
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
* @param {Object} data
|
|
9
9
|
* @param {String} token Authorization token
|
|
10
10
|
*/
|
|
11
|
-
createRoleTemplate(data, token) {
|
|
11
|
+
createRoleTemplate: (data, token) => {
|
|
12
12
|
return new Promise(function (resolve, reject) {
|
|
13
13
|
const requestData = {
|
|
14
14
|
data: data,
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
* @param {String} comment The comment included with the deletion
|
|
33
33
|
* @param {String} token Authorization token
|
|
34
34
|
*/
|
|
35
|
-
deleteRoleTemplate(id, comment, token) {
|
|
35
|
+
deleteRoleTemplate: (id, comment, token) => {
|
|
36
36
|
return new Promise(function (resolve, reject) {
|
|
37
37
|
const data = {
|
|
38
38
|
id: id,
|
|
@@ -57,7 +57,7 @@ export default {
|
|
|
57
57
|
* @param {String} id The id of the role template to be deleted
|
|
58
58
|
* @param {String} token Authorization token
|
|
59
59
|
*/
|
|
60
|
-
discardRoleTemplateChanges(id, token) {
|
|
60
|
+
discardRoleTemplateChanges: (id, token) => {
|
|
61
61
|
return new Promise(function (resolve, reject) {
|
|
62
62
|
const data = {};
|
|
63
63
|
const request = axios.get(`api/v1/roletemplates/discard/${id}`, {
|
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
* @param {String} id The id of the template
|
|
80
80
|
* @param {String} token Authorization token
|
|
81
81
|
*/
|
|
82
|
-
getRoleTemplateInformationById(id, version, token) {
|
|
82
|
+
getRoleTemplateInformationById: (id, version, token) => {
|
|
83
83
|
return new Promise(function (resolve, reject) {
|
|
84
84
|
let confirmationRequest = axios.get(
|
|
85
85
|
`api/v1/roletemplates/${id}/${version}`,
|
|
@@ -103,7 +103,7 @@ export default {
|
|
|
103
103
|
* @param {boolean} includeDeleted When true it will return the deleted records as well
|
|
104
104
|
* @param {String} token Authorization token
|
|
105
105
|
*/
|
|
106
|
-
getRoleTemplateList(filter, version, includeDeleted, token) {
|
|
106
|
+
getRoleTemplateList: (filter, version, includeDeleted, token) => {
|
|
107
107
|
return new Promise(function (resolve, reject) {
|
|
108
108
|
const requestData = {
|
|
109
109
|
version: version,
|
|
@@ -133,7 +133,7 @@ export default {
|
|
|
133
133
|
* @param {String} comment The comment to be include with the request
|
|
134
134
|
* @param {String} token Authorization token
|
|
135
135
|
*/
|
|
136
|
-
publishTemplate(id, comment, token) {
|
|
136
|
+
publishTemplate: (id, comment, token) => {
|
|
137
137
|
return new Promise(function (resolve, reject) {
|
|
138
138
|
let data = {};
|
|
139
139
|
if (comment) data.comment = comment;
|
|
@@ -160,7 +160,7 @@ export default {
|
|
|
160
160
|
* @param {Object} data Data used to update the template
|
|
161
161
|
* @param {String} token Authorization token
|
|
162
162
|
*/
|
|
163
|
-
setTemplateInformation(id, data, token) {
|
|
163
|
+
setTemplateInformation: (id, data, token) => {
|
|
164
164
|
return new Promise(function (resolve, reject) {
|
|
165
165
|
const requestData = {
|
|
166
166
|
data: data,
|
|
@@ -189,7 +189,7 @@ export default {
|
|
|
189
189
|
* @param {Object} tags Updated template tags
|
|
190
190
|
* @param {String} token Authorization token
|
|
191
191
|
*/
|
|
192
|
-
setTemplateTags(id, tags, token) {
|
|
192
|
+
setTemplateTags: (id, tags, token) => {
|
|
193
193
|
return new Promise(function (resolve, reject) {
|
|
194
194
|
const requestData = {
|
|
195
195
|
tags: tags,
|
|
@@ -218,7 +218,7 @@ export default {
|
|
|
218
218
|
* @param {Boolean} watch Set to true or false
|
|
219
219
|
* @param {String} token Authorization token
|
|
220
220
|
*/
|
|
221
|
-
watchRoleTemplate(id, watch, token) {
|
|
221
|
+
watchRoleTemplate: (id, watch, token) => {
|
|
222
222
|
return new Promise(function (resolve, reject) {
|
|
223
223
|
const requestData = {
|
|
224
224
|
id: id,
|
package/lib/skill.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
export default {
|
|
3
|
+
module.exports = {
|
|
5
4
|
axios: axios,
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -9,7 +8,7 @@ export default {
|
|
|
9
8
|
* @param {Object} data
|
|
10
9
|
* @param {String} token Authorization token
|
|
11
10
|
*/
|
|
12
|
-
createSkill(data, token) {
|
|
11
|
+
createSkill: (data, token) => {
|
|
13
12
|
return new Promise(function (resolve, reject) {
|
|
14
13
|
let confirmationRequest = axios.put(
|
|
15
14
|
"api/v1/skills",
|
|
@@ -33,7 +32,7 @@ export default {
|
|
|
33
32
|
* @param {Array<String>} templateIds,
|
|
34
33
|
* @param {String} token Authorization token
|
|
35
34
|
*/
|
|
36
|
-
createSkillsFromTemplates(templateIds, token) {
|
|
35
|
+
createSkillsFromTemplates: (templateIds, token) => {
|
|
37
36
|
return new Promise(function (resolve, reject) {
|
|
38
37
|
const requestData = {
|
|
39
38
|
templateIds: templateIds,
|
|
@@ -61,7 +60,7 @@ export default {
|
|
|
61
60
|
* @param {String} comment The comment included with the deletion
|
|
62
61
|
* @param {String} token Authorization token
|
|
63
62
|
*/
|
|
64
|
-
deleteSkill(id, comment, token) {
|
|
63
|
+
deleteSkill: (id, comment, token) => {
|
|
65
64
|
return new Promise(function (resolve, reject) {
|
|
66
65
|
const data = {
|
|
67
66
|
id: id,
|
|
@@ -86,7 +85,7 @@ export default {
|
|
|
86
85
|
* @param {String} id The id of the skill to be deleted
|
|
87
86
|
* @param {String} token Authorization token
|
|
88
87
|
*/
|
|
89
|
-
discardSkillChanges(id, token) {
|
|
88
|
+
discardSkillChanges: (id, token) => {
|
|
90
89
|
return new Promise(function (resolve, reject) {
|
|
91
90
|
const data = {};
|
|
92
91
|
const request = axios.get(`api/v1/skills/discard/${id}`, {
|
|
@@ -109,7 +108,7 @@ export default {
|
|
|
109
108
|
* @param {String} token
|
|
110
109
|
* @returns
|
|
111
110
|
*/
|
|
112
|
-
getSkillRelatedRoles(id, token) {
|
|
111
|
+
getSkillRelatedRoles: (id, token) => {
|
|
113
112
|
return new Promise(function (resolve, reject) {
|
|
114
113
|
let confirmationRequest = axios.get(
|
|
115
114
|
`api/v1/skills/getskillrelatedroles/${id}`,
|
|
@@ -132,7 +131,7 @@ export default {
|
|
|
132
131
|
* @param {String} id
|
|
133
132
|
* @param {String} token
|
|
134
133
|
*/
|
|
135
|
-
getSkillRequiredAssessmentType(id, token) {
|
|
134
|
+
getSkillRequiredAssessmentType: (id, token) => {
|
|
136
135
|
return new Promise(function (resolve, reject) {
|
|
137
136
|
let confirmationRequest = axios.get(
|
|
138
137
|
`api/v1/skills/getrequiredassessmenttype/${id}`,
|
|
@@ -155,7 +154,7 @@ export default {
|
|
|
155
154
|
* @param {String} id The id of the skill
|
|
156
155
|
* @param {String} token Authorization token
|
|
157
156
|
*/
|
|
158
|
-
getSkillInformationById(id, version, token) {
|
|
157
|
+
getSkillInformationById: (id, version, token) => {
|
|
159
158
|
return new Promise(function (resolve, reject) {
|
|
160
159
|
let confirmationRequest = axios.get(
|
|
161
160
|
`api/v1/skills/skill/${id}/${version}`,
|
|
@@ -181,13 +180,13 @@ export default {
|
|
|
181
180
|
* @param {Boolean} returnDefaultIfVersionNotAvailable Return the default version if published not available
|
|
182
181
|
* @param {String} token Authorization token
|
|
183
182
|
*/
|
|
184
|
-
getSkillList(
|
|
183
|
+
getSkillList: (
|
|
185
184
|
filter,
|
|
186
185
|
version,
|
|
187
186
|
includeDeleted,
|
|
188
187
|
returnDefaultIfVersionNotAvailable,
|
|
189
188
|
token
|
|
190
|
-
) {
|
|
189
|
+
) => {
|
|
191
190
|
return new Promise(function (resolve, reject) {
|
|
192
191
|
const requestData = {
|
|
193
192
|
version: version,
|
|
@@ -214,7 +213,7 @@ export default {
|
|
|
214
213
|
* @param {*} maxDepth How many levels down in the organization the skills will be loaded
|
|
215
214
|
* @param {*} token Authorization token
|
|
216
215
|
*/
|
|
217
|
-
getTeamSkillsById(teamId, maxDepth, token) {
|
|
216
|
+
getTeamSkillsById: (teamId, maxDepth, token) => {
|
|
218
217
|
return new Promise(function (resolve, reject) {
|
|
219
218
|
let confirmationRequest = axios.get(
|
|
220
219
|
`api/v1/skills/getteambyid/${teamId}/${maxDepth}`,
|
|
@@ -237,7 +236,7 @@ export default {
|
|
|
237
236
|
* @param {*} maxDepth How many levels down in the organization the skills will be loaded
|
|
238
237
|
* @param {*} token Authorization token
|
|
239
238
|
*/
|
|
240
|
-
getCurrentUserTeamSkills(maxDepth, token) {
|
|
239
|
+
getCurrentUserTeamSkills: (maxDepth, token) => {
|
|
241
240
|
return new Promise(function (resolve, reject) {
|
|
242
241
|
let confirmationRequest = axios.get(
|
|
243
242
|
`api/v1/skills/getcurrentuserteam/${maxDepth}`,
|
|
@@ -261,7 +260,7 @@ export default {
|
|
|
261
260
|
* @param {String} comment The comment to be include with the request
|
|
262
261
|
* @param {String} token Authorization token
|
|
263
262
|
*/
|
|
264
|
-
publishSkill(id, comment, token) {
|
|
263
|
+
publishSkill: (id, comment, token) => {
|
|
265
264
|
return new Promise(function (resolve, reject) {
|
|
266
265
|
let data = {};
|
|
267
266
|
if (comment) data.comment = comment;
|
|
@@ -288,7 +287,7 @@ export default {
|
|
|
288
287
|
* @param {Object} data Data used to update the skill
|
|
289
288
|
* @param {String} token Authorization token
|
|
290
289
|
*/
|
|
291
|
-
setSkillInformation(id, data, token) {
|
|
290
|
+
setSkillInformation: (id, data, token) => {
|
|
292
291
|
return new Promise(function (resolve, reject) {
|
|
293
292
|
const requestData = {
|
|
294
293
|
data: data,
|
|
@@ -317,7 +316,7 @@ export default {
|
|
|
317
316
|
* @param {Boolean} watch Set to true or false
|
|
318
317
|
* @param {String} token Authorization token
|
|
319
318
|
*/
|
|
320
|
-
watchSkill(id, watch, token) {
|
|
319
|
+
watchSkill: (id, watch, token) => {
|
|
321
320
|
return new Promise(function (resolve, reject) {
|
|
322
321
|
const requestData = {
|
|
323
322
|
id: id,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line no-undef
|
|
4
|
-
|
|
4
|
+
module.exports = {
|
|
5
5
|
axios: axios,
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
* @param {String} testingSessionId
|
|
10
10
|
* @param {String} token Authorization token
|
|
11
11
|
*/
|
|
12
|
-
endSession(testingSessionId, token) {
|
|
12
|
+
endSession: (testingSessionId, token) => {
|
|
13
13
|
return new Promise(function (resolve, reject) {
|
|
14
14
|
let confirmationRequest = axios.put(
|
|
15
15
|
"api/v1/skillassessmenttestingsession/endsession",
|
|
@@ -34,7 +34,7 @@ export default {
|
|
|
34
34
|
* @param {Array<String>} selectedAnswers
|
|
35
35
|
* @param {String} token Authorization token
|
|
36
36
|
*/
|
|
37
|
-
getNextStep(testingSessionId, selectedAnswers, token) {
|
|
37
|
+
getNextStep: (testingSessionId, selectedAnswers, token) => {
|
|
38
38
|
return new Promise(function (resolve, reject) {
|
|
39
39
|
let data = {
|
|
40
40
|
id: testingSessionId,
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
64
64
|
* @param {String} token
|
|
65
65
|
* @returns
|
|
66
66
|
*/
|
|
67
|
-
getSkillTestAssessment(userId, skillId, token) {
|
|
67
|
+
getSkillTestAssessment: (userId, skillId, token) => {
|
|
68
68
|
return new Promise(function (resolve, reject) {
|
|
69
69
|
let confirmationRequest = axios.post(
|
|
70
70
|
`api/v1/skillassessmenttestingsession/getbyuserandskill`,
|
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
* @param {String} token
|
|
93
93
|
* @returns
|
|
94
94
|
*/
|
|
95
|
-
pause(testingSessionId, token) {
|
|
95
|
+
pause: (testingSessionId, token) => {
|
|
96
96
|
return new Promise(function (resolve, reject) {
|
|
97
97
|
let confirmationRequest = axios.post(
|
|
98
98
|
`api/v1/skillassessmenttestingsession/pausesession`,
|
|
@@ -119,7 +119,7 @@ export default {
|
|
|
119
119
|
* @param {Boolean} saveSession
|
|
120
120
|
* @param {String} token
|
|
121
121
|
*/
|
|
122
|
-
startSession(skillId, saveSession, token) {
|
|
122
|
+
startSession: (skillId, saveSession, token) => {
|
|
123
123
|
return new Promise(function (resolve, reject) {
|
|
124
124
|
let confirmationRequest = axios.post(
|
|
125
125
|
"api/v1/skillassessmenttestingsession/startsession",
|
package/lib/skillAssessments.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module.exports = {
|
|
4
4
|
axios: axios,
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
* @param {String} comments
|
|
11
11
|
* @param {String} token Authorization token
|
|
12
12
|
*/
|
|
13
|
-
addEntry(id, data, comments, token) {
|
|
13
|
+
addEntry: (id, data, comments, token) => {
|
|
14
14
|
return new Promise(function (resolve, reject) {
|
|
15
15
|
const requestData = {
|
|
16
16
|
comments: comments,
|
|
@@ -41,7 +41,7 @@ export default {
|
|
|
41
41
|
* @param {String} userId
|
|
42
42
|
* @param {String} token Authorization token
|
|
43
43
|
*/
|
|
44
|
-
create(data, comments, userId, token) {
|
|
44
|
+
create: (data, comments, userId, token) => {
|
|
45
45
|
return new Promise(function (resolve, reject) {
|
|
46
46
|
const requestData = {
|
|
47
47
|
comments: comments,
|
|
@@ -71,7 +71,7 @@ export default {
|
|
|
71
71
|
* @param {String} comments The comment included with the deletion
|
|
72
72
|
* @param {String} token Authorization token
|
|
73
73
|
*/
|
|
74
|
-
deleteSkillAssessment(id, comments, token) {
|
|
74
|
+
deleteSkillAssessment: (id, comments, token) => {
|
|
75
75
|
return new Promise(function (resolve, reject) {
|
|
76
76
|
const data = {
|
|
77
77
|
id: id,
|
|
@@ -96,7 +96,7 @@ export default {
|
|
|
96
96
|
* @param {String} id
|
|
97
97
|
* @param {String} token
|
|
98
98
|
*/
|
|
99
|
-
getById(id, token) {
|
|
99
|
+
getById: (id, token) => {
|
|
100
100
|
return new Promise(function (resolve, reject) {
|
|
101
101
|
let confirmationRequest = axios.get(`api/v1/skillassessments/${id}`, {
|
|
102
102
|
headers: { authorization: token },
|
|
@@ -116,7 +116,7 @@ export default {
|
|
|
116
116
|
* @param {Object} userId The user used to select the skill
|
|
117
117
|
* @param {String} token Authorization token
|
|
118
118
|
*/
|
|
119
|
-
getList(userId, token) {
|
|
119
|
+
getList: (userId, token) => {
|
|
120
120
|
return new Promise(function (resolve, reject) {
|
|
121
121
|
const requestData = {};
|
|
122
122
|
if (userId) requestData.userId = userId;
|