@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/skillTemplate.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
|
-
createSkillTemplate(data, token) {
|
|
11
|
+
createSkillTemplate: (data, token) => {
|
|
12
12
|
return new Promise(function (resolve, reject) {
|
|
13
13
|
const requestData = {
|
|
14
14
|
data: data,
|
|
@@ -34,7 +34,7 @@ export default {
|
|
|
34
34
|
* @param {String} comment The comment included with the deletion
|
|
35
35
|
* @param {String} token Authorization token
|
|
36
36
|
*/
|
|
37
|
-
deleteSkillTemplate(id, comment, token) {
|
|
37
|
+
deleteSkillTemplate: (id, comment, token) => {
|
|
38
38
|
const data = {
|
|
39
39
|
id: id,
|
|
40
40
|
};
|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
59
59
|
* @param {String} id The id of the skill template to be deleted
|
|
60
60
|
* @param {String} token Authorization token
|
|
61
61
|
*/
|
|
62
|
-
discardSkillTemplateChanges(id, token) {
|
|
62
|
+
discardSkillTemplateChanges: (id, token) => {
|
|
63
63
|
return new Promise(function (resolve, reject) {
|
|
64
64
|
const data = {};
|
|
65
65
|
const request = axios.get(`api/v1/skilltemplates/discard/${id}`, {
|
|
@@ -82,7 +82,7 @@ export default {
|
|
|
82
82
|
* @param {String} version The version of the template
|
|
83
83
|
* @param {String} token Authorization token
|
|
84
84
|
*/
|
|
85
|
-
getSkillTemplateInformationById(id, version, token) {
|
|
85
|
+
getSkillTemplateInformationById: (id, version, token) => {
|
|
86
86
|
return new Promise(function (resolve, reject) {
|
|
87
87
|
let confirmationRequest = axios.get(
|
|
88
88
|
`api/v1/skilltemplates/${id}/${version}`,
|
|
@@ -107,7 +107,7 @@ export default {
|
|
|
107
107
|
* @param {boolean} includeDeleted When true it will return the deleted records as well
|
|
108
108
|
* @param {String} token Authorization token
|
|
109
109
|
*/
|
|
110
|
-
getSkillTemplateList(filter, version, includeDeleted, token) {
|
|
110
|
+
getSkillTemplateList: (filter, version, includeDeleted, token) => {
|
|
111
111
|
return new Promise(function (resolve, reject) {
|
|
112
112
|
const requestData = {
|
|
113
113
|
version: version,
|
|
@@ -137,7 +137,7 @@ export default {
|
|
|
137
137
|
* @param {String} comment The comment to be include with the request
|
|
138
138
|
* @param {String} token Authorization token
|
|
139
139
|
*/
|
|
140
|
-
publishTemplate(id, comment, token) {
|
|
140
|
+
publishTemplate: (id, comment, token) => {
|
|
141
141
|
return new Promise(function (resolve, reject) {
|
|
142
142
|
let data = {};
|
|
143
143
|
if (comment) data.comment = comment;
|
|
@@ -165,7 +165,7 @@ export default {
|
|
|
165
165
|
* @param {Object} data Data used to update the template
|
|
166
166
|
* @param {String} token Authorization token
|
|
167
167
|
*/
|
|
168
|
-
setTemplateInformation(id, data, token) {
|
|
168
|
+
setTemplateInformation: (id, data, token) => {
|
|
169
169
|
return new Promise(function (resolve, reject) {
|
|
170
170
|
const requestData = {
|
|
171
171
|
data: data,
|
|
@@ -194,7 +194,7 @@ export default {
|
|
|
194
194
|
* @param {Object} tags Updated template tags
|
|
195
195
|
* @param {String} token Authorization token
|
|
196
196
|
*/
|
|
197
|
-
setTemplateTags(id, tags, token) {
|
|
197
|
+
setTemplateTags: (id, tags, token) => {
|
|
198
198
|
return new Promise(function (resolve, reject) {
|
|
199
199
|
const requestData = {
|
|
200
200
|
tags: tags,
|
|
@@ -223,7 +223,7 @@ export default {
|
|
|
223
223
|
* @param {Boolean} watch Set to true or false
|
|
224
224
|
* @param {String} token Authorization token
|
|
225
225
|
*/
|
|
226
|
-
watchSkillTemplate(id, watch, token) {
|
|
226
|
+
watchSkillTemplate: (id, watch, token) => {
|
|
227
227
|
return new Promise(function (resolve, reject) {
|
|
228
228
|
const requestData = {
|
|
229
229
|
id: id,
|
package/lib/teams.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
// Team specific requests
|
|
3
|
-
//
|
|
4
|
-
import axios from "./axios";
|
|
1
|
+
const { axios } = require("./axios");
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
module.exports = {
|
|
7
4
|
axios: axios,
|
|
8
5
|
|
|
9
6
|
/**
|
|
@@ -12,7 +9,7 @@ export default {
|
|
|
12
9
|
* @param {Array<String>} users The users to be added
|
|
13
10
|
* @param {String} authToken - Authentication token
|
|
14
11
|
*/
|
|
15
|
-
addUsersToTeam(teamId, users, authToken) {
|
|
12
|
+
addUsersToTeam: (teamId, users, authToken) => {
|
|
16
13
|
return new Promise(function (resolve, reject) {
|
|
17
14
|
const request = axios.post(
|
|
18
15
|
`api/v1/teams/users/add`,
|
|
@@ -39,7 +36,7 @@ export default {
|
|
|
39
36
|
* @param {String} description The description of the team
|
|
40
37
|
* @param {String} authToken The authorization token
|
|
41
38
|
*/
|
|
42
|
-
createTeam(name, managerId, description, authToken) {
|
|
39
|
+
createTeam: (name, managerId, description, authToken) => {
|
|
43
40
|
return new Promise(function (resolve, reject) {
|
|
44
41
|
const request = axios.post(
|
|
45
42
|
`api/v1/teams/team`,
|
|
@@ -66,7 +63,7 @@ export default {
|
|
|
66
63
|
* @param {String} defaultTeamId The default team all the users will be moved to
|
|
67
64
|
* @param {String} authToken The authentication token
|
|
68
65
|
*/
|
|
69
|
-
deleteTeam(teamId, defaultTeamId, authToken) {
|
|
66
|
+
deleteTeam: (teamId, defaultTeamId, authToken) => {
|
|
70
67
|
return new Promise(function (resolve, reject) {
|
|
71
68
|
const request = axios.delete(`api/v1/teams/delete`, {
|
|
72
69
|
headers: { authorization: authToken },
|
|
@@ -91,7 +88,7 @@ export default {
|
|
|
91
88
|
* @param {Boolean} includeUserSummaryInformation True if request to load user summary information
|
|
92
89
|
* @param {String} authToken The authentication token
|
|
93
90
|
*/
|
|
94
|
-
getTeamById(teamId, includeUserSummaryInformation, authToken) {
|
|
91
|
+
getTeamById: (teamId, includeUserSummaryInformation, authToken) => {
|
|
95
92
|
return new Promise(function (resolve, reject) {
|
|
96
93
|
const request = axios.post(
|
|
97
94
|
`api/v1/teams/team/${teamId}`,
|
|
@@ -113,9 +110,9 @@ export default {
|
|
|
113
110
|
/**
|
|
114
111
|
* Get team roles
|
|
115
112
|
* @param {String} teamId The team Id
|
|
116
|
-
* @param {
|
|
113
|
+
* @param {String} authToken The authentication token
|
|
117
114
|
*/
|
|
118
|
-
getTeamByIdRoles(teamId, authToken) {
|
|
115
|
+
getTeamByIdRoles: (teamId, authToken) => {
|
|
119
116
|
return new Promise(function (resolve, reject) {
|
|
120
117
|
const request = axios.get(`api/v1/teams/getroles/${teamId}`, {
|
|
121
118
|
headers: { authorization: authToken },
|
|
@@ -133,9 +130,9 @@ export default {
|
|
|
133
130
|
/**
|
|
134
131
|
* Get teams for current tenant
|
|
135
132
|
* @param {String} userId
|
|
136
|
-
* @param {
|
|
133
|
+
* @param {String} authToken The authentication token
|
|
137
134
|
*/
|
|
138
|
-
getTeams(authToken) {
|
|
135
|
+
getTeams: (authToken) => {
|
|
139
136
|
return new Promise(function (resolve, reject) {
|
|
140
137
|
const request = axios.get(`api/v1/teams/`, {
|
|
141
138
|
headers: { authorization: authToken },
|
|
@@ -156,7 +153,7 @@ export default {
|
|
|
156
153
|
* @param {Boolean} includeUserSummaryInformation True if request to load user summary information
|
|
157
154
|
* @param {String} authToken The authentication token
|
|
158
155
|
*/
|
|
159
|
-
getTeamByUserId(userId, includeUserSummaryInformation, authToken) {
|
|
156
|
+
getTeamByUserId: (userId, includeUserSummaryInformation, authToken) => {
|
|
160
157
|
return new Promise(function (resolve, reject) {
|
|
161
158
|
const request = axios.post(
|
|
162
159
|
`/api/v1/teams/getuserteam/${userId ? userId : ""}`,
|
|
@@ -180,7 +177,7 @@ export default {
|
|
|
180
177
|
* @param {Boolean} includeUserSummaryInformation True if request to load user summary information
|
|
181
178
|
* @param {String} authToken The authentication token
|
|
182
179
|
*/
|
|
183
|
-
getTopTeam(includeUserSummaryInformation, authToken) {
|
|
180
|
+
getTopTeam: (includeUserSummaryInformation, authToken) => {
|
|
184
181
|
return new Promise(function (resolve, reject) {
|
|
185
182
|
const request = axios.post(
|
|
186
183
|
`api/v1/teams/gettopteam`,
|
|
@@ -205,7 +202,7 @@ export default {
|
|
|
205
202
|
* @param {Array<String>} users The users to be removed from the team
|
|
206
203
|
* @param {String} authToken The authentication token
|
|
207
204
|
*/
|
|
208
|
-
removeUsersFromTeam(teamId, users, authToken) {
|
|
205
|
+
removeUsersFromTeam: (teamId, users, authToken) => {
|
|
209
206
|
return new Promise(function (resolve, reject) {
|
|
210
207
|
const request = axios.post(
|
|
211
208
|
`api/v1/teams/users/remove/`,
|
|
@@ -230,7 +227,7 @@ export default {
|
|
|
230
227
|
* @param {String} teamId The team Id
|
|
231
228
|
* @param {String} authToken The authentication token
|
|
232
229
|
*/
|
|
233
|
-
setDefault(teamId, authToken) {
|
|
230
|
+
setDefault: (teamId, authToken) => {
|
|
234
231
|
return new Promise(function (resolve, reject) {
|
|
235
232
|
const request = axios.put(
|
|
236
233
|
`api/v1/teams/setDefault/`,
|
|
@@ -255,7 +252,7 @@ export default {
|
|
|
255
252
|
* @param {String} data The updated name of the team
|
|
256
253
|
* @param {String} authToken The authentication token
|
|
257
254
|
*/
|
|
258
|
-
updateTeam(teamId, data, authToken) {
|
|
255
|
+
updateTeam: (teamId, data, authToken) => {
|
|
259
256
|
return new Promise(function (resolve, reject) {
|
|
260
257
|
const request = axios.patch(
|
|
261
258
|
`api/v1/teams/team/`,
|
package/lib/templateDocument.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module.exports = {
|
|
4
4
|
/**
|
|
5
5
|
* Create a new document to an existing template
|
|
6
|
-
*
|
|
7
6
|
* @param {String} templateId - the template id
|
|
8
7
|
* @param {String} parentPhaseId - the parent of the new phase. If null, it will add the phase to the
|
|
9
8
|
* root of the template
|
|
10
9
|
* @param {Object} data - new phase data information
|
|
11
10
|
* @param {String} token - authorization token
|
|
12
|
-
*
|
|
13
11
|
*/
|
|
14
|
-
create(templateId, parentPhaseId, data, token) {
|
|
12
|
+
create: (templateId, parentPhaseId, data, token) => {
|
|
15
13
|
return new Promise(function (resolve, reject) {
|
|
16
14
|
const requestData = {
|
|
17
15
|
templateId: templateId,
|
|
@@ -37,13 +35,11 @@ export default {
|
|
|
37
35
|
|
|
38
36
|
/**
|
|
39
37
|
* Delete an existing document from a template
|
|
40
|
-
*
|
|
41
38
|
* @param {String} templateId - the template id
|
|
42
39
|
* @param {String} documentId - the document id
|
|
43
40
|
* @param {String} token - authorization token
|
|
44
|
-
*
|
|
45
41
|
*/
|
|
46
|
-
delete(templateId, documentId, token) {
|
|
42
|
+
delete: (templateId, documentId, token) => {
|
|
47
43
|
return new Promise(function (resolve, reject) {
|
|
48
44
|
const requestData = {
|
|
49
45
|
templateId: templateId,
|
|
@@ -65,14 +61,12 @@ export default {
|
|
|
65
61
|
|
|
66
62
|
/**
|
|
67
63
|
* Move an existing document
|
|
68
|
-
*
|
|
69
64
|
* @param {String} templateId - the template id
|
|
70
65
|
* @param {String} documentId - the id of the document to be moved
|
|
71
66
|
* @param {String} newParentPhaseId - the new parent phase id
|
|
72
67
|
* @param {String} token - authorization token
|
|
73
|
-
*
|
|
74
68
|
*/
|
|
75
|
-
move(templateId, documentId, newParentPhaseId, token) {
|
|
69
|
+
move: (templateId, documentId, newParentPhaseId, token) => {
|
|
76
70
|
return new Promise(function (resolve, reject) {
|
|
77
71
|
const requestData = {
|
|
78
72
|
templateId: templateId,
|
|
@@ -98,14 +92,12 @@ export default {
|
|
|
98
92
|
|
|
99
93
|
/**
|
|
100
94
|
* Update an existing document phase
|
|
101
|
-
*
|
|
102
95
|
* @param {String} templateId - template id
|
|
103
96
|
* @param {String} documentId - document id
|
|
104
97
|
* @param {Object} data - data containing the updated document information
|
|
105
98
|
* @param {String} token - authorization token
|
|
106
|
-
*
|
|
107
99
|
*/
|
|
108
|
-
update(templateId, documentId, data, token) {
|
|
100
|
+
update: (templateId, documentId, data, token) => {
|
|
109
101
|
return new Promise(function (resolve, reject) {
|
|
110
102
|
const requestData = {
|
|
111
103
|
templateId: templateId,
|
package/lib/templatePhase.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
/**
|
|
5
5
|
* Add a new phase to an existing template
|
|
6
|
-
*
|
|
7
6
|
* @param {String} templateId - the template id
|
|
8
7
|
* @param {String} parentPhaseId - the parent of the new phase. If null, it will add the phase to the root
|
|
9
8
|
* of the template
|
|
10
9
|
* @param {Object} data - new phase data information
|
|
11
10
|
* @param {String} token - authorization token
|
|
12
|
-
*
|
|
13
11
|
*/
|
|
14
|
-
create(templateId, parentPhaseId, data, token) {
|
|
12
|
+
create: (templateId, parentPhaseId, data, token) => {
|
|
15
13
|
return new Promise(function (resolve, reject) {
|
|
16
14
|
const requestData = {
|
|
17
15
|
templateId: templateId,
|
|
@@ -37,13 +35,11 @@ export default {
|
|
|
37
35
|
|
|
38
36
|
/**
|
|
39
37
|
* Delete an existing phase
|
|
40
|
-
*
|
|
41
38
|
* @param {String} templateId - the template id
|
|
42
39
|
* @param {String} phaseId - the phase id
|
|
43
40
|
* @param {String} token - authorization token
|
|
44
|
-
*
|
|
45
41
|
*/
|
|
46
|
-
delete(templateId, phaseId, token) {
|
|
42
|
+
delete: (templateId, phaseId, token) => {
|
|
47
43
|
return new Promise(function (resolve, reject) {
|
|
48
44
|
const requestData = {
|
|
49
45
|
templateId: templateId,
|
|
@@ -68,14 +64,12 @@ export default {
|
|
|
68
64
|
|
|
69
65
|
/**
|
|
70
66
|
* Move an existing phase
|
|
71
|
-
*
|
|
72
67
|
* @param {String} templateId - the template id
|
|
73
68
|
* @param {String} phaseId - the id of the phase to be moved
|
|
74
69
|
* @param {String} newParentPhaseId - the new parent phase id
|
|
75
70
|
* @param {String} token - authorization token
|
|
76
|
-
*
|
|
77
71
|
*/
|
|
78
|
-
move(templateId, phaseId, newParentPhaseId, token) {
|
|
72
|
+
move: (templateId, phaseId, newParentPhaseId, token) => {
|
|
79
73
|
return new Promise(function (resolve, reject) {
|
|
80
74
|
const requestData = {
|
|
81
75
|
templateId: templateId,
|
|
@@ -101,14 +95,12 @@ export default {
|
|
|
101
95
|
|
|
102
96
|
/**
|
|
103
97
|
* Update an existing template phase
|
|
104
|
-
*
|
|
105
98
|
* @param {String} templateId - template id
|
|
106
99
|
* @param {String} phaseId - phase id
|
|
107
100
|
* @param {Object} data - data containing the new phase information
|
|
108
101
|
* @param {String} token - authorization token
|
|
109
|
-
*
|
|
110
102
|
*/
|
|
111
|
-
update(templateId, phaseId, data, token) {
|
|
103
|
+
update: (templateId, phaseId, data, token) => {
|
|
112
104
|
return new Promise(function (resolve, reject) {
|
|
113
105
|
const requestData = {
|
|
114
106
|
templateId: templateId,
|
package/lib/templateRelease.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
/**
|
|
5
5
|
* Create a new release to an existing template
|
|
6
|
-
*
|
|
7
6
|
* @param {string} templateId - the template id
|
|
8
7
|
* @param {Object} data - new phase data information
|
|
9
8
|
* @param {string} token - authorization token
|
|
10
|
-
*
|
|
11
9
|
*/
|
|
12
|
-
create(templateId, data, token) {
|
|
10
|
+
create: (templateId, data, token) => {
|
|
13
11
|
return new Promise(function (resolve, reject) {
|
|
14
12
|
const requestData = {
|
|
15
13
|
templateId: templateId,
|
|
@@ -34,13 +32,11 @@ export default {
|
|
|
34
32
|
|
|
35
33
|
/**
|
|
36
34
|
* Delete an existing release from a template
|
|
37
|
-
*
|
|
38
35
|
* @param {string} templateId - the template id
|
|
39
36
|
* @param {string} releaseId - the document id
|
|
40
37
|
* @param {string} token - authorization token
|
|
41
|
-
*
|
|
42
38
|
*/
|
|
43
|
-
delete(templateId, releaseId, token) {
|
|
39
|
+
delete: (templateId, releaseId, token) => {
|
|
44
40
|
return new Promise(function (resolve, reject) {
|
|
45
41
|
const requestData = {
|
|
46
42
|
templateId: templateId,
|
|
@@ -65,14 +61,12 @@ export default {
|
|
|
65
61
|
|
|
66
62
|
/**
|
|
67
63
|
* Update an existing release
|
|
68
|
-
*
|
|
69
64
|
* @param {string} templateId - template id
|
|
70
65
|
* @param {string} releaseId - release id
|
|
71
66
|
* @param {Object} data - data containing the updated document information
|
|
72
67
|
* @param {string} token - authorization token
|
|
73
|
-
*
|
|
74
68
|
*/
|
|
75
|
-
update(templateId, releaseId, data, token) {
|
|
69
|
+
update: (templateId, releaseId, data, token) => {
|
|
76
70
|
return new Promise(function (resolve, reject) {
|
|
77
71
|
const requestData = {
|
|
78
72
|
templateId: templateId,
|
package/lib/templates.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module.exports = {
|
|
4
4
|
axios: axios,
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
7
|
* Create template and set information
|
|
9
|
-
*
|
|
10
8
|
* @param {Object} data New template data information
|
|
11
9
|
* @param {String} token Authorization token
|
|
12
|
-
*
|
|
13
10
|
*/
|
|
14
|
-
createTemplate(data, token) {
|
|
11
|
+
createTemplate: (data, token) => {
|
|
15
12
|
return new Promise(function (resolve, reject) {
|
|
16
13
|
const requestData = {
|
|
17
14
|
data: data,
|
|
@@ -31,12 +28,10 @@ export default {
|
|
|
31
28
|
|
|
32
29
|
/**
|
|
33
30
|
* Delete template
|
|
34
|
-
*
|
|
35
31
|
* @param {number} id The id of the template to be deleted
|
|
36
32
|
* @param {String} token Authorization token
|
|
37
|
-
*
|
|
38
33
|
*/
|
|
39
|
-
deleteTemplate(id, token) {
|
|
34
|
+
deleteTemplate: (id, token) => {
|
|
40
35
|
return new Promise(function (resolve, reject) {
|
|
41
36
|
const requestData = {
|
|
42
37
|
id: id,
|
|
@@ -57,12 +52,10 @@ export default {
|
|
|
57
52
|
|
|
58
53
|
/**
|
|
59
54
|
* Get template information
|
|
60
|
-
*
|
|
61
55
|
* @param {number} id The id of the template
|
|
62
56
|
* @param {String} token Authorization token
|
|
63
|
-
*
|
|
64
57
|
*/
|
|
65
|
-
getTemplateInformationById(id, version, token) {
|
|
58
|
+
getTemplateInformationById: (id, version, token) => {
|
|
66
59
|
return new Promise(function (resolve, reject) {
|
|
67
60
|
let confirmationRequest = axios.get(`api/v1/templates/${id}/${version}`, {
|
|
68
61
|
headers: { authorization: token },
|
|
@@ -79,11 +72,10 @@ export default {
|
|
|
79
72
|
|
|
80
73
|
/**
|
|
81
74
|
* Get template information
|
|
82
|
-
*
|
|
83
75
|
* @param {Object} filter The filter used to select the template
|
|
84
76
|
* @param {String} token Authorization token
|
|
85
77
|
*/
|
|
86
|
-
getTemplateList(filter, version, token) {
|
|
78
|
+
getTemplateList: (filter, version, token) => {
|
|
87
79
|
return new Promise(function (resolve, reject) {
|
|
88
80
|
const requestData = {
|
|
89
81
|
filter: filter ? filter : "",
|
|
@@ -104,11 +96,10 @@ export default {
|
|
|
104
96
|
|
|
105
97
|
/**
|
|
106
98
|
* Publish template
|
|
107
|
-
*
|
|
108
99
|
* @param {number} id The id of the template to be published
|
|
109
100
|
* @param {String} token Authorization token
|
|
110
101
|
*/
|
|
111
|
-
publishTemplate(id, token) {
|
|
102
|
+
publishTemplate: (id, token) => {
|
|
112
103
|
return new Promise(function (resolve, reject) {
|
|
113
104
|
let confirmationRequest = axios.post(
|
|
114
105
|
`api/v1/templates/publish/${id}`,
|
|
@@ -129,13 +120,11 @@ export default {
|
|
|
129
120
|
|
|
130
121
|
/**
|
|
131
122
|
* Set template profile information
|
|
132
|
-
*
|
|
133
123
|
* @param {String} id The id of the template to be updated
|
|
134
124
|
* @param {Object} data Data used to update the template
|
|
135
125
|
* @param {String} token Authorization token
|
|
136
|
-
*
|
|
137
126
|
*/
|
|
138
|
-
setTemplateInformation(id, data, token) {
|
|
127
|
+
setTemplateInformation: (id, data, token) => {
|
|
139
128
|
return new Promise(function (resolve, reject) {
|
|
140
129
|
const requestData = {
|
|
141
130
|
data: data,
|
package/lib/tenants.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
const { axios } = require("./axios");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module.exports = {
|
|
4
4
|
axios: axios,
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Get tenant information
|
|
8
|
-
*
|
|
9
8
|
* @param {String} category Tenant information category
|
|
10
9
|
* @param {String} token Authorization token
|
|
11
10
|
*/
|
|
12
|
-
getTenantInformation(categories, token) {
|
|
11
|
+
getTenantInformation: (categories, token) => {
|
|
13
12
|
return new Promise(function (resolve, reject) {
|
|
14
13
|
const requestData = {
|
|
15
14
|
categories: categories,
|
|
@@ -29,13 +28,11 @@ export default {
|
|
|
29
28
|
|
|
30
29
|
/**
|
|
31
30
|
* Set tenant profile information
|
|
32
|
-
*
|
|
33
31
|
* @param {String} category Tenant information category
|
|
34
32
|
* @param {String} data New or updated tenant data information
|
|
35
33
|
* @param {Object} token Authorization token
|
|
36
|
-
*
|
|
37
34
|
*/
|
|
38
|
-
setTenantInformation(category, data, token) {
|
|
35
|
+
setTenantInformation: (category, data, token) => {
|
|
39
36
|
return new Promise(function (resolve, reject) {
|
|
40
37
|
const requestData = {
|
|
41
38
|
category: category,
|
|
@@ -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
|
-
createTrainingPlanTemplate(data, token) {
|
|
11
|
+
createTrainingPlanTemplate: (data, token) => {
|
|
12
12
|
return new Promise(function (resolve, reject) {
|
|
13
13
|
let confirmationRequest = axios.put(
|
|
14
14
|
"api/v1/trainingplantemplates",
|
|
@@ -33,7 +33,7 @@ export default {
|
|
|
33
33
|
* @param {String} comment The comment for approver
|
|
34
34
|
* @param {String} token Authorization token
|
|
35
35
|
*/
|
|
36
|
-
deleteTrainingPlanTemplate(id, comment, token) {
|
|
36
|
+
deleteTrainingPlanTemplate: (id, comment, token) => {
|
|
37
37
|
return new Promise(function (resolve, reject) {
|
|
38
38
|
const data = {
|
|
39
39
|
id: id,
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
* @param {String} id The id of the training plan to be deleted
|
|
59
59
|
* @param {String} token Authorization token
|
|
60
60
|
*/
|
|
61
|
-
discardTrainingPlanChanges(id, token) {
|
|
61
|
+
discardTrainingPlanChanges: (id, token) => {
|
|
62
62
|
return new Promise(function (resolve, reject) {
|
|
63
63
|
const data = {};
|
|
64
64
|
const request = axios.get(`api/v1/trainingplantemplates/discard/${id}`, {
|
|
@@ -80,7 +80,7 @@ export default {
|
|
|
80
80
|
* @param {String} id The id of the template
|
|
81
81
|
* @param {String} token Authorization token
|
|
82
82
|
*/
|
|
83
|
-
getTrainingPlanTemplateInformationById(id, version, token) {
|
|
83
|
+
getTrainingPlanTemplateInformationById: (id, version, token) => {
|
|
84
84
|
return new Promise(function (resolve, reject) {
|
|
85
85
|
let confirmationRequest = axios.get(
|
|
86
86
|
`api/v1/trainingplantemplates/${id}/${version}`,
|
|
@@ -104,7 +104,7 @@ export default {
|
|
|
104
104
|
* @param {String} version The version to be retrieved
|
|
105
105
|
* @param {String} token Authorization token
|
|
106
106
|
*/
|
|
107
|
-
getTrainingPlanTemplatesList(list, version, includeDeleted, token) {
|
|
107
|
+
getTrainingPlanTemplatesList: (list, version, includeDeleted, token) => {
|
|
108
108
|
return new Promise(function (resolve, reject) {
|
|
109
109
|
const requestData = {
|
|
110
110
|
version: version,
|
|
@@ -134,7 +134,7 @@ export default {
|
|
|
134
134
|
* @param {String} comment The comment to be include with the request
|
|
135
135
|
* @param {String} token Authorization token
|
|
136
136
|
*/
|
|
137
|
-
publishTrainingPlanTemplate(id, comment, token) {
|
|
137
|
+
publishTrainingPlanTemplate: (id, comment, token) => {
|
|
138
138
|
return new Promise(function (resolve, reject) {
|
|
139
139
|
let data = {};
|
|
140
140
|
if (comment) data.comment = comment;
|
|
@@ -161,7 +161,7 @@ export default {
|
|
|
161
161
|
* @param {Object} data Data used to update the template
|
|
162
162
|
* @param {String} token Authorization token
|
|
163
163
|
*/
|
|
164
|
-
setTrainingPlanTemplateInformation(id, data, token) {
|
|
164
|
+
setTrainingPlanTemplateInformation: (id, data, token) => {
|
|
165
165
|
return new Promise(function (resolve, reject) {
|
|
166
166
|
const requestData = {
|
|
167
167
|
data: data,
|
|
@@ -190,7 +190,7 @@ export default {
|
|
|
190
190
|
* @param {Object} tags The updated tags
|
|
191
191
|
* @param {String} token Authorization token
|
|
192
192
|
*/
|
|
193
|
-
setTrainingPlanTemplateTags(id, tags, token) {
|
|
193
|
+
setTrainingPlanTemplateTags: (id, tags, token) => {
|
|
194
194
|
return new Promise(function (resolve, reject) {
|
|
195
195
|
const requestData = {
|
|
196
196
|
tags: tags,
|
package/lib/trainingPlans.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 {Boolean} saveAsDraft Save as draft flag
|
|
11
11
|
* @param {String} token Authorization token
|
|
12
12
|
*/
|
|
13
|
-
createTrainingPlan(data, type, saveAsDraft, token) {
|
|
13
|
+
createTrainingPlan: (data, type, saveAsDraft, token) => {
|
|
14
14
|
return new Promise(function (resolve, reject) {
|
|
15
15
|
const requestData = {
|
|
16
16
|
data: {
|
|
@@ -38,7 +38,7 @@ export default {
|
|
|
38
38
|
* @param {String} comment The comment for approver
|
|
39
39
|
* @param {String} token Authorization token
|
|
40
40
|
*/
|
|
41
|
-
deleteTrainingPlan(id, comment, token) {
|
|
41
|
+
deleteTrainingPlan: (id, comment, token) => {
|
|
42
42
|
return new Promise(function (resolve, reject) {
|
|
43
43
|
const data = {
|
|
44
44
|
id: id,
|
|
@@ -63,7 +63,7 @@ export default {
|
|
|
63
63
|
* @param {String} id The id of the training plan to be deleted
|
|
64
64
|
* @param {String} token Authorization token
|
|
65
65
|
*/
|
|
66
|
-
discardTrainingPlanChanges(id, token) {
|
|
66
|
+
discardTrainingPlanChanges: (id, token) => {
|
|
67
67
|
return new Promise(function (resolve, reject) {
|
|
68
68
|
const request = axios.get(`api/v1/trainingplans/discard/${id}`, {
|
|
69
69
|
headers: { authorization: token },
|
|
@@ -86,7 +86,7 @@ export default {
|
|
|
86
86
|
* @param {Boolean} saveBaseline If set to true it will save the baseline
|
|
87
87
|
* @param {String} token Authorization token
|
|
88
88
|
*/
|
|
89
|
-
generateNewBaseline(id, data, returnMinimized, saveBaseline, token) {
|
|
89
|
+
generateNewBaseline: (id, data, returnMinimized, saveBaseline, token) => {
|
|
90
90
|
return new Promise(function (resolve, reject) {
|
|
91
91
|
const requestData = {
|
|
92
92
|
data: data,
|
|
@@ -116,7 +116,7 @@ export default {
|
|
|
116
116
|
* @param {String} id The id of the training plan
|
|
117
117
|
* @param {String} token Authorization token
|
|
118
118
|
*/
|
|
119
|
-
getTrainingPlanById(id, version, token) {
|
|
119
|
+
getTrainingPlanById: (id, version, token) => {
|
|
120
120
|
return new Promise(function (resolve, reject) {
|
|
121
121
|
let confirmationRequest = axios.get(
|
|
122
122
|
`api/v1/trainingplans/${id}/${version}`,
|
|
@@ -144,7 +144,7 @@ export default {
|
|
|
144
144
|
* @param {Boolean} returnDefaultIfVersionNotAvailable If set to true it will load the draft information if the plan was never published
|
|
145
145
|
* @param {String} token Authorization token
|
|
146
146
|
*/
|
|
147
|
-
getListOfTrainingPlans(
|
|
147
|
+
getListOfTrainingPlans: (
|
|
148
148
|
users,
|
|
149
149
|
types,
|
|
150
150
|
version,
|
|
@@ -153,7 +153,7 @@ export default {
|
|
|
153
153
|
includeDetailedInformation,
|
|
154
154
|
returnDefaultIfVersionNotAvailable,
|
|
155
155
|
token
|
|
156
|
-
) {
|
|
156
|
+
) => {
|
|
157
157
|
return new Promise(function (resolve, reject) {
|
|
158
158
|
const requestData = {
|
|
159
159
|
version: version,
|
|
@@ -187,7 +187,7 @@ export default {
|
|
|
187
187
|
* @param {String} comment The comment to be include with the request
|
|
188
188
|
* @param {String} token Authorization token
|
|
189
189
|
*/
|
|
190
|
-
publishTrainingPlan(id, comment, token) {
|
|
190
|
+
publishTrainingPlan: (id, comment, token) => {
|
|
191
191
|
return new Promise(function (resolve, reject) {
|
|
192
192
|
let data = {};
|
|
193
193
|
if (comment) data.comment = comment;
|
|
@@ -214,7 +214,7 @@ export default {
|
|
|
214
214
|
* @param {Object} data The updated data
|
|
215
215
|
* @param {String} token Authorization token
|
|
216
216
|
*/
|
|
217
|
-
updateTrainingPlan(planId, data, saveAsDraft, token) {
|
|
217
|
+
updateTrainingPlan: (planId, data, saveAsDraft, token) => {
|
|
218
218
|
return new Promise(function (resolve, reject) {
|
|
219
219
|
const requestData = {
|
|
220
220
|
data: data,
|
|
@@ -246,7 +246,7 @@ export default {
|
|
|
246
246
|
* @param {Function} failCallBack
|
|
247
247
|
* @returns {Object} An object containing the task information
|
|
248
248
|
*/
|
|
249
|
-
updateActivities(planId, data, token) {
|
|
249
|
+
updateActivities: (planId, data, token) => {
|
|
250
250
|
return new Promise(function (resolve, reject) {
|
|
251
251
|
let confirmationRequest = axios.post(
|
|
252
252
|
`api/v1/trainingplans/${planId}/activities`,
|