@stackfactor/client-api 1.0.32 → 1.0.34
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 +0 -2
- package/lib/actionNotifications.js +202 -226
- package/lib/address.js +21 -27
- package/lib/axiosClient.js +1 -1
- package/lib/config.js +62 -66
- package/lib/dashboard.js +64 -68
- package/lib/departmentTrainingPlans.js +159 -153
- package/lib/groups.js +266 -291
- package/lib/integration.js +307 -312
- package/lib/integrationConfiguration.js +96 -90
- package/lib/integrations/contentGenerator.js +71 -74
- package/lib/learningContent.js +239 -240
- package/lib/logger.js +51 -56
- package/lib/role.js +238 -245
- package/lib/roleTemplate.js +247 -255
- package/lib/skill.js +299 -311
- package/lib/skillAssessmentTestingSession.js +132 -137
- package/lib/skillAssessments.js +125 -129
- package/lib/skillTemplate.js +250 -255
- package/lib/teams.js +261 -257
- package/lib/tenants.js +48 -52
- package/lib/trainingPlanTemplate.js +203 -202
- package/lib/trainingPlans.js +249 -251
- package/lib/userInformation.js +97 -85
- package/lib/users.js +557 -555
- package/lib/utils.js +38 -42
- package/package.json +2 -1
- package/lib/templates.js +0 -148
package/lib/skillTemplate.js
CHANGED
|
@@ -1,272 +1,267 @@
|
|
|
1
|
-
import
|
|
1
|
+
import axios from "./axiosClient";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
let confirmationRequest = axios.put(
|
|
17
|
-
"api/v1/skilltemplates",
|
|
18
|
-
requestData,
|
|
19
|
-
{ headers: { authorization: token } }
|
|
20
|
-
);
|
|
21
|
-
confirmationRequest
|
|
22
|
-
.then((response) => {
|
|
23
|
-
resolve(response.data);
|
|
24
|
-
})
|
|
25
|
-
.catch((error) => {
|
|
26
|
-
reject(error);
|
|
27
|
-
});
|
|
3
|
+
/**
|
|
4
|
+
* Create skill template and set information
|
|
5
|
+
* @param {Object} data
|
|
6
|
+
* @param {String} token Authorization token
|
|
7
|
+
*/
|
|
8
|
+
export const createSkillTemplate = (data, token) => {
|
|
9
|
+
return new Promise(function (resolve, reject) {
|
|
10
|
+
const requestData = {
|
|
11
|
+
data: data,
|
|
12
|
+
};
|
|
13
|
+
let confirmationRequest = axios.put("api/v1/skilltemplates", requestData, {
|
|
14
|
+
headers: { authorization: token },
|
|
28
15
|
});
|
|
29
|
-
|
|
16
|
+
confirmationRequest
|
|
17
|
+
.then((response) => {
|
|
18
|
+
resolve(response.data);
|
|
19
|
+
})
|
|
20
|
+
.catch((error) => {
|
|
21
|
+
reject(error);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
};
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Delete skill template
|
|
28
|
+
* @param {number} id The id of the template to be deleted
|
|
29
|
+
* @param {String} comment The comment included with the deletion
|
|
30
|
+
* @param {String} token Authorization token
|
|
31
|
+
*/
|
|
32
|
+
export const deleteSkillTemplate = (id, comment, token) => {
|
|
33
|
+
const data = {
|
|
34
|
+
id: id,
|
|
35
|
+
};
|
|
36
|
+
if (comment) data.comment = comment;
|
|
37
|
+
return new Promise(function (resolve, reject) {
|
|
38
|
+
const request = axios.delete(`api/v1/skilltemplates/`, {
|
|
39
|
+
headers: { authorization: token },
|
|
40
|
+
data: data,
|
|
41
|
+
});
|
|
42
|
+
request
|
|
43
|
+
.then((response) => {
|
|
44
|
+
resolve(response.data);
|
|
45
|
+
})
|
|
46
|
+
.catch((error) => {
|
|
47
|
+
reject(error);
|
|
46
48
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Discard the skill template draft changes
|
|
54
|
+
* @param {String} id The id of the skill template to be deleted
|
|
55
|
+
* @param {String} token Authorization token
|
|
56
|
+
*/
|
|
57
|
+
export const discardSkillTemplateChanges = (id, token) => {
|
|
58
|
+
return new Promise(function (resolve, reject) {
|
|
59
|
+
const data = {};
|
|
60
|
+
const request = axios.get(`api/v1/skilltemplates/discard/${id}`, {
|
|
61
|
+
headers: { authorization: token },
|
|
62
|
+
data: data,
|
|
54
63
|
});
|
|
55
|
-
|
|
64
|
+
request
|
|
65
|
+
.then((response) => {
|
|
66
|
+
resolve(response.data);
|
|
67
|
+
})
|
|
68
|
+
.catch((error) => {
|
|
69
|
+
reject(error);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
};
|
|
56
73
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Get skill template information
|
|
76
|
+
* @param {String} id The id of the template
|
|
77
|
+
* @param {String} version The version of the template
|
|
78
|
+
* @param {String} token Authorization token
|
|
79
|
+
*/
|
|
80
|
+
export const getSkillTemplateInformationById = (id, version, token) => {
|
|
81
|
+
return new Promise(function (resolve, reject) {
|
|
82
|
+
let confirmationRequest = axios.get(
|
|
83
|
+
`api/v1/skilltemplates/${id}/${version}`,
|
|
84
|
+
{
|
|
66
85
|
headers: { authorization: token },
|
|
67
|
-
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
confirmationRequest
|
|
89
|
+
.then((response) => {
|
|
90
|
+
resolve(response.data);
|
|
91
|
+
})
|
|
92
|
+
.catch((error) => {
|
|
93
|
+
reject(error);
|
|
68
94
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
resolve(response.data);
|
|
72
|
-
})
|
|
73
|
-
.catch((error) => {
|
|
74
|
-
reject(error);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Get skill template information
|
|
81
|
-
* @param {String} id The id of the template
|
|
82
|
-
* @param {String} version The version of the template
|
|
83
|
-
* @param {String} token Authorization token
|
|
84
|
-
*/
|
|
85
|
-
getSkillTemplateInformationById: (id, version, token) => {
|
|
86
|
-
return new Promise(function (resolve, reject) {
|
|
87
|
-
let confirmationRequest = axios.get(
|
|
88
|
-
`api/v1/skilltemplates/${id}/${version}`,
|
|
89
|
-
{
|
|
90
|
-
headers: { authorization: token },
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
confirmationRequest
|
|
94
|
-
.then((response) => {
|
|
95
|
-
resolve(response.data);
|
|
96
|
-
})
|
|
97
|
-
.catch((error) => {
|
|
98
|
-
reject(error);
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
},
|
|
95
|
+
});
|
|
96
|
+
};
|
|
102
97
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
confirmationRequest
|
|
125
|
-
.then((response) => {
|
|
126
|
-
resolve(response.data);
|
|
127
|
-
})
|
|
128
|
-
.catch((error) => {
|
|
129
|
-
reject(error);
|
|
130
|
-
});
|
|
98
|
+
/**
|
|
99
|
+
* Get skill template list
|
|
100
|
+
* @param {Array<String>} filter The filter used to select the template
|
|
101
|
+
* @param {String} version The version to be retrieved
|
|
102
|
+
* @param {boolean} includeDeleted When true it will return the deleted records as well
|
|
103
|
+
* @param {String} token Authorization token
|
|
104
|
+
*/
|
|
105
|
+
export const getSkillTemplateList = (
|
|
106
|
+
filter,
|
|
107
|
+
version,
|
|
108
|
+
includeDeleted,
|
|
109
|
+
token
|
|
110
|
+
) => {
|
|
111
|
+
return new Promise(function (resolve, reject) {
|
|
112
|
+
const requestData = {
|
|
113
|
+
version: version,
|
|
114
|
+
includeDeleted: includeDeleted,
|
|
115
|
+
};
|
|
116
|
+
if (filter) requestData.filter = filter;
|
|
117
|
+
let confirmationRequest = axios.post(`api/v1/skilltemplates`, requestData, {
|
|
118
|
+
headers: { authorization: token },
|
|
131
119
|
});
|
|
132
|
-
|
|
120
|
+
confirmationRequest
|
|
121
|
+
.then((response) => {
|
|
122
|
+
resolve(response.data);
|
|
123
|
+
})
|
|
124
|
+
.catch((error) => {
|
|
125
|
+
reject(error);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
133
129
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
130
|
+
/**
|
|
131
|
+
* Get skill tecnology stacks template list
|
|
132
|
+
* @param {String} token Authorization token
|
|
133
|
+
*/
|
|
134
|
+
export const getTechnologyStacks = (token) => {
|
|
135
|
+
return new Promise(function (resolve, reject) {
|
|
136
|
+
const requestData = {};
|
|
137
|
+
let confirmationRequest = axios.get(
|
|
138
|
+
`api/v1/skilltemplates/stacks`,
|
|
139
|
+
requestData,
|
|
140
|
+
{
|
|
141
|
+
headers: { authorization: token },
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
confirmationRequest
|
|
145
|
+
.then((response) => {
|
|
146
|
+
resolve(response.data);
|
|
147
|
+
})
|
|
148
|
+
.catch((error) => {
|
|
149
|
+
reject(error);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
};
|
|
157
153
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Publish template
|
|
156
|
+
* @param {number} id The id of the template to be published
|
|
157
|
+
* @param {String} comment The comment to be include with the request
|
|
158
|
+
* @param {String} token Authorization token
|
|
159
|
+
*/
|
|
160
|
+
export const publishTemplate = (id, comment, token) => {
|
|
161
|
+
return new Promise(function (resolve, reject) {
|
|
162
|
+
let data = {};
|
|
163
|
+
if (comment) data.comment = comment;
|
|
168
164
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
165
|
+
let confirmationRequest = axios.post(
|
|
166
|
+
`api/v1/skilltemplates/publish/${id}`,
|
|
167
|
+
data,
|
|
168
|
+
{
|
|
169
|
+
headers: { authorization: token },
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
confirmationRequest
|
|
173
|
+
.then((response) => {
|
|
174
|
+
resolve(response.data);
|
|
175
|
+
})
|
|
176
|
+
.catch((error) => {
|
|
177
|
+
reject(error);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
};
|
|
185
181
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
182
|
+
/**
|
|
183
|
+
* Set template profile information
|
|
184
|
+
* @param {String} id The id of the template to be updated
|
|
185
|
+
* @param {Object} data Data used to update the template
|
|
186
|
+
* @param {String} token Authorization token
|
|
187
|
+
*/
|
|
188
|
+
export const setTemplateInformation = (id, data, token) => {
|
|
189
|
+
return new Promise(function (resolve, reject) {
|
|
190
|
+
const requestData = {
|
|
191
|
+
data: data,
|
|
192
|
+
id: id,
|
|
193
|
+
};
|
|
194
|
+
let confirmationRequest = axios.post(
|
|
195
|
+
`api/v1/skilltemplates/update`,
|
|
196
|
+
requestData,
|
|
197
|
+
{
|
|
198
|
+
headers: { authorization: token },
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
confirmationRequest
|
|
202
|
+
.then((response) => {
|
|
203
|
+
resolve(response.data);
|
|
204
|
+
})
|
|
205
|
+
.catch((error) => {
|
|
206
|
+
reject(error);
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
};
|
|
214
210
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
211
|
+
/**
|
|
212
|
+
* Update the skill template tags
|
|
213
|
+
* @param {String} id The id of the template to be updated
|
|
214
|
+
* @param {Object} tags Updated template tags
|
|
215
|
+
* @param {String} token Authorization token
|
|
216
|
+
*/
|
|
217
|
+
export const setTemplateTags = (id, tags, token) => {
|
|
218
|
+
return new Promise(function (resolve, reject) {
|
|
219
|
+
const requestData = {
|
|
220
|
+
tags: tags,
|
|
221
|
+
id: id,
|
|
222
|
+
};
|
|
223
|
+
let confirmationRequest = axios.post(
|
|
224
|
+
`api/v1/skilltemplates/updatetags/`,
|
|
225
|
+
requestData,
|
|
226
|
+
{
|
|
227
|
+
headers: { authorization: token },
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
confirmationRequest
|
|
231
|
+
.then((response) => {
|
|
232
|
+
resolve(response.data);
|
|
233
|
+
})
|
|
234
|
+
.catch((error) => {
|
|
235
|
+
reject(error);
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
};
|
|
243
239
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
},
|
|
240
|
+
/**
|
|
241
|
+
* Watch skill template
|
|
242
|
+
* @param {String} id The id of the skill template to be updated
|
|
243
|
+
* @param {Boolean} watch Set to true or false
|
|
244
|
+
* @param {String} token Authorization token
|
|
245
|
+
*/
|
|
246
|
+
export const watchSkillTemplate = (id, watch, token) => {
|
|
247
|
+
return new Promise(function (resolve, reject) {
|
|
248
|
+
const requestData = {
|
|
249
|
+
id: id,
|
|
250
|
+
watch: watch,
|
|
251
|
+
};
|
|
252
|
+
let confirmationRequest = axios.post(
|
|
253
|
+
`api/v1/skilltemplates/watch`,
|
|
254
|
+
requestData,
|
|
255
|
+
{
|
|
256
|
+
headers: { authorization: token },
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
confirmationRequest
|
|
260
|
+
.then((response) => {
|
|
261
|
+
resolve(response.data);
|
|
262
|
+
})
|
|
263
|
+
.catch((error) => {
|
|
264
|
+
reject(error);
|
|
265
|
+
});
|
|
266
|
+
});
|
|
272
267
|
};
|