@stackfactor/client-api 1.1.127 → 1.1.129
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/lib/{actionNotifications.js → actionNotifications.ts} +18 -6
- package/lib/{address.js → address.ts} +3 -2
- package/lib/{aiAssistant.js → aiAssistant.ts} +58 -25
- package/lib/{avatar.js → avatar.ts} +10 -4
- package/lib/axiosClient.ts +92 -0
- package/lib/{config.js → config.ts} +19 -6
- package/lib/{constants.js → constants.ts} +6 -41
- package/lib/{dashboard.js → dashboard.ts} +17 -7
- package/lib/{departmentTrainingPlans.js → departmentTrainingPlans.ts} +57 -23
- package/lib/{groups.js → groups.ts} +67 -26
- package/lib/{integration.js → integration.ts} +100 -43
- package/lib/{integrationConfiguration.js → integrationConfiguration.ts} +25 -8
- package/lib/integrations/{contentGenerator.js → contentGenerator.ts} +38 -18
- package/lib/{learningContent.js → learningContent.ts} +152 -64
- package/lib/{learningPath.js → learningPath.ts} +56 -29
- package/lib/{logger.js → logger.ts} +17 -5
- package/lib/{microSkillsQuizes.js → microSkillsQuizes.ts} +15 -6
- package/lib/{quotas.js → quotas.ts} +10 -5
- package/lib/{role.js → role.ts} +114 -66
- package/lib/{roleTemplate.js → roleTemplate.ts} +63 -28
- package/lib/{security.js → security.ts} +14 -10
- package/lib/{skill.js → skill.ts} +119 -82
- package/lib/{skillAssessments.js → skillAssessmentTestingSession.ts} +39 -17
- package/lib/skillAssessments.ts +192 -0
- package/lib/{skillTemplate.js → skillTemplate.ts} +70 -39
- package/lib/{talentTransfromation.js → talentTransfromation.ts} +21 -15
- package/lib/{teams.js → teams.ts} +71 -27
- package/lib/{tenants.js → tenants.ts} +16 -7
- package/lib/{trainingPlans.js → trainingPlans.ts} +96 -59
- package/lib/{trainingPlansProficiencyLevels.js → trainingPlansProficiencyLevels.ts} +29 -23
- package/lib/{userInformation.js → userInformation.ts} +25 -12
- package/lib/{users.js → users.ts} +172 -154
- package/lib/{utils.js → utils.ts} +6 -6
- package/package.json +3 -1
- package/lib/axiosClient.js +0 -82
- package/lib/skillAssessmentTestingSession.js +0 -147
- /package/{exports.js → exports.ts} +0 -0
- /package/{index.js → index.ts} +0 -0
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
import { client } from "./axiosClient.js";
|
|
2
2
|
|
|
3
|
+
interface LearningContentData {
|
|
4
|
+
data?: object;
|
|
5
|
+
id?: string;
|
|
6
|
+
comments?: string;
|
|
7
|
+
learningcontentid?: string;
|
|
8
|
+
microSkillId?: string;
|
|
9
|
+
tags?: object;
|
|
10
|
+
watch?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface GenerateLearningActivityContentData {
|
|
14
|
+
learningObjectives: string;
|
|
15
|
+
learningActivity: object;
|
|
16
|
+
microSkillId: string;
|
|
17
|
+
sections: string[];
|
|
18
|
+
otherLearningActivities?: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
3
21
|
/**
|
|
4
22
|
* Create learning content and set information
|
|
5
23
|
* @param {Object} data Learning content data
|
|
6
24
|
* @param {String} token Authorization token
|
|
7
25
|
* @returns {Promise<Object>} The created learning content
|
|
8
26
|
*/
|
|
9
|
-
const createLearningContent = (
|
|
10
|
-
|
|
11
|
-
|
|
27
|
+
const createLearningContent = (
|
|
28
|
+
data: object,
|
|
29
|
+
token: string
|
|
30
|
+
): Promise<object> => {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
const requestData: LearningContentData = {
|
|
12
33
|
data: data,
|
|
13
34
|
};
|
|
14
35
|
let confirmationRequest = client.put(
|
|
@@ -35,15 +56,18 @@ const createLearningContent = (data, token) => {
|
|
|
35
56
|
* @param {String} token Authorization token
|
|
36
57
|
* @returns {Promise<Object>} The response from the server
|
|
37
58
|
*/
|
|
38
|
-
const deleteLearningContent = (
|
|
39
|
-
|
|
59
|
+
const deleteLearningContent = (
|
|
60
|
+
id: string,
|
|
61
|
+
comments: string,
|
|
62
|
+
token: string
|
|
63
|
+
): Promise<object> => {
|
|
64
|
+
const data: LearningContentData = {
|
|
40
65
|
id: id,
|
|
41
66
|
};
|
|
42
67
|
if (comments) data.comments = comments;
|
|
43
|
-
return new Promise(
|
|
68
|
+
return new Promise((resolve, reject) => {
|
|
44
69
|
const request = client.delete(`api/v1/learningcontent/`, {
|
|
45
70
|
headers: { authorization: token },
|
|
46
|
-
|
|
47
71
|
data: data,
|
|
48
72
|
});
|
|
49
73
|
request
|
|
@@ -62,12 +86,14 @@ const deleteLearningContent = (id, comments, token) => {
|
|
|
62
86
|
* @param {String} token Authorization token
|
|
63
87
|
* @returns {Promise<Object>} The response from the server
|
|
64
88
|
*/
|
|
65
|
-
const discardLearningContentChanges = (
|
|
66
|
-
|
|
89
|
+
const discardLearningContentChanges = (
|
|
90
|
+
id: string,
|
|
91
|
+
token: string
|
|
92
|
+
): Promise<object> => {
|
|
93
|
+
return new Promise((resolve, reject) => {
|
|
67
94
|
const data = {};
|
|
68
95
|
const request = client.get(`api/v1/learningcontent/discard/${id}`, {
|
|
69
96
|
headers: { authorization: token },
|
|
70
|
-
|
|
71
97
|
data: data,
|
|
72
98
|
});
|
|
73
99
|
request
|
|
@@ -91,16 +117,16 @@ const discardLearningContentChanges = (id, token) => {
|
|
|
91
117
|
* @param {String} token
|
|
92
118
|
*/
|
|
93
119
|
const generateLearningActivityContent = (
|
|
94
|
-
learningObjectives,
|
|
95
|
-
skillId,
|
|
96
|
-
microSkillId,
|
|
97
|
-
learningActivity,
|
|
98
|
-
otherLearningActivities,
|
|
99
|
-
sections,
|
|
100
|
-
token
|
|
101
|
-
) => {
|
|
102
|
-
return new Promise(
|
|
103
|
-
const requestData = {
|
|
120
|
+
learningObjectives: string,
|
|
121
|
+
skillId: string,
|
|
122
|
+
microSkillId: string,
|
|
123
|
+
learningActivity: object,
|
|
124
|
+
otherLearningActivities: string[],
|
|
125
|
+
sections: string[],
|
|
126
|
+
token: string
|
|
127
|
+
): Promise<object> => {
|
|
128
|
+
return new Promise((resolve, reject) => {
|
|
129
|
+
const requestData: GenerateLearningActivityContentData = {
|
|
104
130
|
learningObjectives: learningObjectives,
|
|
105
131
|
learningActivity: learningActivity,
|
|
106
132
|
microSkillId: microSkillId,
|
|
@@ -130,10 +156,13 @@ const generateLearningActivityContent = (
|
|
|
130
156
|
* Generate micro skill test knowledge
|
|
131
157
|
* @param {String} microSkill
|
|
132
158
|
* @param {String} token
|
|
133
|
-
* @returns {Promise}
|
|
159
|
+
* @returns {Promise<Object>}
|
|
134
160
|
*/
|
|
135
|
-
const generateMicroSkillTestKnowledge = (
|
|
136
|
-
|
|
161
|
+
const generateMicroSkillTestKnowledge = (
|
|
162
|
+
microSkill: string,
|
|
163
|
+
token: string
|
|
164
|
+
): Promise<object> => {
|
|
165
|
+
return new Promise((resolve, reject) => {
|
|
137
166
|
let data = {
|
|
138
167
|
microSkill: microSkill,
|
|
139
168
|
};
|
|
@@ -161,8 +190,12 @@ const generateMicroSkillTestKnowledge = (microSkill, token) => {
|
|
|
161
190
|
* @param {String} token Authorization token
|
|
162
191
|
* @returns {Promise<Object>} The response from the server
|
|
163
192
|
*/
|
|
164
|
-
const getLearningContentInformationById = (
|
|
165
|
-
|
|
193
|
+
const getLearningContentInformationById = (
|
|
194
|
+
id: string,
|
|
195
|
+
version: string,
|
|
196
|
+
token: string
|
|
197
|
+
): Promise<object> => {
|
|
198
|
+
return new Promise((resolve, reject) => {
|
|
166
199
|
let confirmationRequest = client.get(
|
|
167
200
|
`api/v1/learningcontent/${id}/${version}`,
|
|
168
201
|
{
|
|
@@ -187,9 +220,14 @@ const getLearningContentInformationById = (id, version, token) => {
|
|
|
187
220
|
* @param {String} token Authorization token
|
|
188
221
|
* @returns {Promise<Array<Object>>} The list of available content
|
|
189
222
|
*/
|
|
190
|
-
const getLearningContentList = (
|
|
191
|
-
|
|
192
|
-
|
|
223
|
+
const getLearningContentList = (
|
|
224
|
+
filter: string[],
|
|
225
|
+
version: string,
|
|
226
|
+
includeDeleted: boolean,
|
|
227
|
+
token: string
|
|
228
|
+
): Promise<object[]> => {
|
|
229
|
+
return new Promise((resolve, reject) => {
|
|
230
|
+
const requestData: { version: string; includeDeleted: boolean; filter?: string[] } = {
|
|
193
231
|
version: version,
|
|
194
232
|
includeDeleted: includeDeleted,
|
|
195
233
|
};
|
|
@@ -211,6 +249,35 @@ const getLearningContentList = (filter, version, includeDeleted, token) => {
|
|
|
211
249
|
});
|
|
212
250
|
};
|
|
213
251
|
|
|
252
|
+
/**
|
|
253
|
+
* Migrate learning content storage
|
|
254
|
+
* @param {String} id The id of the content to be migrated
|
|
255
|
+
* @param {String} token Authorization token
|
|
256
|
+
* @returns {Promise<Object>} The response from the server
|
|
257
|
+
*/
|
|
258
|
+
const migrateLearningContentStorageType = (
|
|
259
|
+
id: string,
|
|
260
|
+
token: string
|
|
261
|
+
): Promise<object> => {
|
|
262
|
+
return new Promise((resolve, reject) => {
|
|
263
|
+
let data = {};
|
|
264
|
+
let confirmationRequest = client.post(
|
|
265
|
+
`api/v1/learningcontent/migratestorage/${id}`,
|
|
266
|
+
data,
|
|
267
|
+
{
|
|
268
|
+
headers: { authorization: token },
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
confirmationRequest
|
|
272
|
+
.then((response) => {
|
|
273
|
+
resolve(response.data);
|
|
274
|
+
})
|
|
275
|
+
.catch((error) => {
|
|
276
|
+
reject(error);
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
|
|
214
281
|
/**
|
|
215
282
|
* Publish learning content
|
|
216
283
|
* @param {String} id The id of the content to be published
|
|
@@ -218,9 +285,13 @@ const getLearningContentList = (filter, version, includeDeleted, token) => {
|
|
|
218
285
|
* @param {String} token Authorization token
|
|
219
286
|
* @returns {Promise<Object>} The response from the server
|
|
220
287
|
*/
|
|
221
|
-
const publishLearningContent = (
|
|
222
|
-
|
|
223
|
-
|
|
288
|
+
const publishLearningContent = (
|
|
289
|
+
id: string,
|
|
290
|
+
comments: string,
|
|
291
|
+
token: string
|
|
292
|
+
): Promise<object> => {
|
|
293
|
+
return new Promise((resolve, reject) => {
|
|
294
|
+
let data: LearningContentData = {};
|
|
224
295
|
if (comments) data.comments = comments;
|
|
225
296
|
|
|
226
297
|
let confirmationRequest = client.post(
|
|
@@ -247,9 +318,13 @@ const publishLearningContent = (id, comments, token) => {
|
|
|
247
318
|
* @param {String} token Authorization token
|
|
248
319
|
* @returns {Promise<Object>} The updated learning content
|
|
249
320
|
*/
|
|
250
|
-
const setLearningContentInformation = (
|
|
251
|
-
|
|
252
|
-
|
|
321
|
+
const setLearningContentInformation = (
|
|
322
|
+
id: string,
|
|
323
|
+
data: object,
|
|
324
|
+
token: string
|
|
325
|
+
): Promise<object> => {
|
|
326
|
+
return new Promise((resolve, reject) => {
|
|
327
|
+
const requestData: LearningContentData = {
|
|
253
328
|
data: data,
|
|
254
329
|
id: id,
|
|
255
330
|
};
|
|
@@ -272,14 +347,18 @@ const setLearningContentInformation = (id, data, token) => {
|
|
|
272
347
|
|
|
273
348
|
/**
|
|
274
349
|
* Set partial content information
|
|
275
|
-
* @param {
|
|
276
|
-
* @param {
|
|
277
|
-
* @param {
|
|
278
|
-
* @returns
|
|
350
|
+
* @param {String} id
|
|
351
|
+
* @param {Object} data
|
|
352
|
+
* @param {String} token
|
|
353
|
+
* @returns {Promise<Object>}
|
|
279
354
|
*/
|
|
280
|
-
const setLearningContentPartialContentInformation = (
|
|
281
|
-
|
|
282
|
-
|
|
355
|
+
const setLearningContentPartialContentInformation = (
|
|
356
|
+
id: string,
|
|
357
|
+
data: object,
|
|
358
|
+
token: string
|
|
359
|
+
): Promise<object> => {
|
|
360
|
+
return new Promise((resolve, reject) => {
|
|
361
|
+
const requestData: LearningContentData = {
|
|
283
362
|
data: data,
|
|
284
363
|
id: id,
|
|
285
364
|
};
|
|
@@ -307,17 +386,17 @@ const setLearningContentPartialContentInformation = (id, data, token) => {
|
|
|
307
386
|
* @param {String} microSkillId
|
|
308
387
|
* @param {Object} data
|
|
309
388
|
* @param {String} token
|
|
310
|
-
* @returns {Promise<String>} OK word if the operation was
|
|
389
|
+
* @returns {Promise<String>} OK word if the operation was successful
|
|
311
390
|
*/
|
|
312
391
|
const setLearningContentLearningContentInformation = (
|
|
313
|
-
id,
|
|
314
|
-
learningcontentid,
|
|
315
|
-
microSkillId,
|
|
316
|
-
data,
|
|
317
|
-
token
|
|
318
|
-
) => {
|
|
319
|
-
return new Promise(
|
|
320
|
-
const requestData = {
|
|
392
|
+
id: string,
|
|
393
|
+
learningcontentid: string,
|
|
394
|
+
microSkillId: string,
|
|
395
|
+
data: object,
|
|
396
|
+
token: string
|
|
397
|
+
): Promise<string> => {
|
|
398
|
+
return new Promise((resolve, reject) => {
|
|
399
|
+
const requestData: LearningContentData = {
|
|
321
400
|
data: data,
|
|
322
401
|
id: id,
|
|
323
402
|
learningcontentid: learningcontentid,
|
|
@@ -346,16 +425,16 @@ const setLearningContentLearningContentInformation = (
|
|
|
346
425
|
* @param {String} microskillid
|
|
347
426
|
* @param {Object} data
|
|
348
427
|
* @param {String} token
|
|
349
|
-
* @returns {Promise<String>} OK word if the operation was
|
|
428
|
+
* @returns {Promise<String>} OK word if the operation was successful
|
|
350
429
|
*/
|
|
351
430
|
const setLearningContentLearningMicroSkillContentInformation = (
|
|
352
|
-
id,
|
|
353
|
-
microskillid,
|
|
354
|
-
data,
|
|
355
|
-
token
|
|
356
|
-
) => {
|
|
357
|
-
return new Promise(
|
|
358
|
-
const requestData = {
|
|
431
|
+
id: string,
|
|
432
|
+
microskillid: string,
|
|
433
|
+
data: object,
|
|
434
|
+
token: string
|
|
435
|
+
): Promise<string> => {
|
|
436
|
+
return new Promise((resolve, reject) => {
|
|
437
|
+
const requestData: LearningContentData = {
|
|
359
438
|
data: data,
|
|
360
439
|
};
|
|
361
440
|
let confirmationRequest = client.post(
|
|
@@ -381,9 +460,13 @@ const setLearningContentLearningMicroSkillContentInformation = (
|
|
|
381
460
|
* @param {Object} tags Updated learning content tags
|
|
382
461
|
* @param {String} token Authorization token
|
|
383
462
|
*/
|
|
384
|
-
const setLearningContentTags = (
|
|
385
|
-
|
|
386
|
-
|
|
463
|
+
const setLearningContentTags = (
|
|
464
|
+
id: string,
|
|
465
|
+
tags: object,
|
|
466
|
+
token: string
|
|
467
|
+
): Promise<object> => {
|
|
468
|
+
return new Promise((resolve, reject) => {
|
|
469
|
+
const requestData: LearningContentData = {
|
|
387
470
|
tags: tags,
|
|
388
471
|
id: id,
|
|
389
472
|
};
|
|
@@ -410,9 +493,13 @@ const setLearningContentTags = (id, tags, token) => {
|
|
|
410
493
|
* @param {Boolean} watch Set to true or false
|
|
411
494
|
* @param {String} token Authorization token
|
|
412
495
|
*/
|
|
413
|
-
const watchLearningContent = (
|
|
414
|
-
|
|
415
|
-
|
|
496
|
+
const watchLearningContent = (
|
|
497
|
+
id: string,
|
|
498
|
+
watch: boolean,
|
|
499
|
+
token: string
|
|
500
|
+
): Promise<object> => {
|
|
501
|
+
return new Promise((resolve, reject) => {
|
|
502
|
+
const requestData: LearningContentData = {
|
|
416
503
|
id: id,
|
|
417
504
|
watch: watch,
|
|
418
505
|
};
|
|
@@ -441,6 +528,7 @@ export default {
|
|
|
441
528
|
generateLearningActivityContent,
|
|
442
529
|
generateMicroSkillTestKnowledge,
|
|
443
530
|
getLearningContentList,
|
|
531
|
+
migrateLearningContentStorageType,
|
|
444
532
|
publishLearningContent,
|
|
445
533
|
setLearningContentPartialContentInformation,
|
|
446
534
|
setLearningContentLearningContentInformation,
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import { client } from "./axiosClient.js";
|
|
2
2
|
|
|
3
|
+
interface LearningPathData {
|
|
4
|
+
data?: object;
|
|
5
|
+
id?: string;
|
|
6
|
+
comments?: string;
|
|
7
|
+
tags?: object;
|
|
8
|
+
list?: string[];
|
|
9
|
+
version?: string;
|
|
10
|
+
includeDeleted?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
3
13
|
/**
|
|
4
14
|
* Create learning path and set information
|
|
5
15
|
* @param {Object} data
|
|
6
16
|
* @param {String} token Authorization token
|
|
17
|
+
* @returns {Promise<Object>}
|
|
7
18
|
*/
|
|
8
|
-
const createLearningPath = (data, token) => {
|
|
9
|
-
return new Promise(
|
|
19
|
+
const createLearningPath = (data: object, token: string): Promise<object> => {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
10
21
|
let confirmationRequest = client.put(
|
|
11
22
|
"api/v1/learningpaths",
|
|
12
23
|
{ data: data },
|
|
@@ -29,16 +40,16 @@ const createLearningPath = (data, token) => {
|
|
|
29
40
|
* @param {String} id The id of the template to be deleted
|
|
30
41
|
* @param {String} comments The comments for approver
|
|
31
42
|
* @param {String} token Authorization token
|
|
43
|
+
* @returns {Promise<Object>}
|
|
32
44
|
*/
|
|
33
|
-
const deleteLearningPath = (id, comments, token) => {
|
|
34
|
-
return new Promise(
|
|
35
|
-
const data = {
|
|
45
|
+
const deleteLearningPath = (id: string, comments: string, token: string): Promise<object> => {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
const data: LearningPathData = {
|
|
36
48
|
id: id,
|
|
37
49
|
};
|
|
38
50
|
if (comments) data.comments = comments;
|
|
39
51
|
const request = client.delete(`api/v1/learningpaths/`, {
|
|
40
52
|
headers: { authorization: token },
|
|
41
|
-
|
|
42
53
|
data: data,
|
|
43
54
|
});
|
|
44
55
|
request
|
|
@@ -55,13 +66,13 @@ const deleteLearningPath = (id, comments, token) => {
|
|
|
55
66
|
* Discard the training plan draft changes
|
|
56
67
|
* @param {String} id The id of the training plan to be deleted
|
|
57
68
|
* @param {String} token Authorization token
|
|
69
|
+
* @returns {Promise<Object>}
|
|
58
70
|
*/
|
|
59
|
-
const discardLearningPathChanges = (id, token) => {
|
|
60
|
-
return new Promise(
|
|
71
|
+
const discardLearningPathChanges = (id: string, token: string): Promise<object> => {
|
|
72
|
+
return new Promise((resolve, reject) => {
|
|
61
73
|
const data = {};
|
|
62
74
|
const request = client.get(`api/v1/learningpaths/discard/${id}`, {
|
|
63
75
|
headers: { authorization: token },
|
|
64
|
-
|
|
65
76
|
data: data,
|
|
66
77
|
});
|
|
67
78
|
request
|
|
@@ -75,12 +86,14 @@ const discardLearningPathChanges = (id, token) => {
|
|
|
75
86
|
};
|
|
76
87
|
|
|
77
88
|
/**
|
|
78
|
-
* Get
|
|
89
|
+
* Get training plan template information
|
|
79
90
|
* @param {String} id The id of the template
|
|
91
|
+
* @param {String} version The version of the template
|
|
80
92
|
* @param {String} token Authorization token
|
|
93
|
+
* @returns {Promise<Object>}
|
|
81
94
|
*/
|
|
82
|
-
const getLearningPathInformationById = (id, version, token) => {
|
|
83
|
-
return new Promise(
|
|
95
|
+
const getLearningPathInformationById = (id: string, version: string, token: string): Promise<object> => {
|
|
96
|
+
return new Promise((resolve, reject) => {
|
|
84
97
|
let confirmationRequest = client.get(
|
|
85
98
|
`api/v1/learningpaths/${id}/${version}`,
|
|
86
99
|
{
|
|
@@ -101,18 +114,29 @@ const getLearningPathInformationById = (id, version, token) => {
|
|
|
101
114
|
* Get learning path list
|
|
102
115
|
* @param {Array<String>} list The filter used to select the skill
|
|
103
116
|
* @param {String} version The version to be retrieved
|
|
117
|
+
* @param {boolean} includeDeleted When true it will return the deleted records as well
|
|
104
118
|
* @param {String} token Authorization token
|
|
119
|
+
* @returns {Promise<Array<Object>>} The list of available content
|
|
105
120
|
*/
|
|
106
|
-
const getLearningPathsList = (
|
|
107
|
-
|
|
108
|
-
|
|
121
|
+
const getLearningPathsList = (
|
|
122
|
+
list: string[],
|
|
123
|
+
version: string,
|
|
124
|
+
includeDeleted: boolean,
|
|
125
|
+
token: string
|
|
126
|
+
): Promise<object[]> => {
|
|
127
|
+
return new Promise((resolve, reject) => {
|
|
128
|
+
const requestData: LearningPathData = {
|
|
109
129
|
version: version,
|
|
110
130
|
includeDeleted: includeDeleted,
|
|
111
131
|
};
|
|
112
132
|
if (list) requestData.list = list;
|
|
113
|
-
let confirmationRequest = client.post(
|
|
114
|
-
|
|
115
|
-
|
|
133
|
+
let confirmationRequest = client.post(
|
|
134
|
+
`api/v1/learningpaths`,
|
|
135
|
+
requestData,
|
|
136
|
+
{
|
|
137
|
+
headers: { authorization: token },
|
|
138
|
+
}
|
|
139
|
+
);
|
|
116
140
|
confirmationRequest
|
|
117
141
|
.then((response) => {
|
|
118
142
|
resolve(response.data);
|
|
@@ -124,14 +148,15 @@ const getLearningPathsList = (list, version, includeDeleted, token) => {
|
|
|
124
148
|
};
|
|
125
149
|
|
|
126
150
|
/**
|
|
127
|
-
* Publish training
|
|
151
|
+
* Publish training plan template
|
|
128
152
|
* @param {String} id The id of the template to be published
|
|
129
153
|
* @param {String} comments The comments to be include with the request
|
|
130
154
|
* @param {String} token Authorization token
|
|
155
|
+
* @returns {Promise<Object>}
|
|
131
156
|
*/
|
|
132
|
-
const publishLearningPath = (id, comments, token) => {
|
|
133
|
-
return new Promise(
|
|
134
|
-
let data = {};
|
|
157
|
+
const publishLearningPath = (id: string, comments: string, token: string): Promise<object> => {
|
|
158
|
+
return new Promise((resolve, reject) => {
|
|
159
|
+
let data: LearningPathData = {};
|
|
135
160
|
if (comments) data.comments = comments;
|
|
136
161
|
let confirmationRequest = client.post(
|
|
137
162
|
`api/v1/learningpaths/publish/${id}`,
|
|
@@ -155,10 +180,11 @@ const publishLearningPath = (id, comments, token) => {
|
|
|
155
180
|
* @param {String} id The id of the template to be updated
|
|
156
181
|
* @param {Object} data Data used to update the template
|
|
157
182
|
* @param {String} token Authorization token
|
|
183
|
+
* @returns {Promise<Object>}
|
|
158
184
|
*/
|
|
159
|
-
const setLearningPathInformation = (id, data, token) => {
|
|
160
|
-
return new Promise(
|
|
161
|
-
const requestData = {
|
|
185
|
+
const setLearningPathInformation = (id: string, data: object, token: string): Promise<object> => {
|
|
186
|
+
return new Promise((resolve, reject) => {
|
|
187
|
+
const requestData: LearningPathData = {
|
|
162
188
|
data: data,
|
|
163
189
|
id: id,
|
|
164
190
|
};
|
|
@@ -184,10 +210,11 @@ const setLearningPathInformation = (id, data, token) => {
|
|
|
184
210
|
* @param {String} id The id of the template to be updated
|
|
185
211
|
* @param {Object} tags The updated tags
|
|
186
212
|
* @param {String} token Authorization token
|
|
213
|
+
* @returns {Promise<Object>}
|
|
187
214
|
*/
|
|
188
|
-
const setLearningPathTags = (id, tags, token) => {
|
|
189
|
-
return new Promise(
|
|
190
|
-
const requestData = {
|
|
215
|
+
const setLearningPathTags = (id: string, tags: object, token: string): Promise<object> => {
|
|
216
|
+
return new Promise((resolve, reject) => {
|
|
217
|
+
const requestData: LearningPathData = {
|
|
191
218
|
tags: tags,
|
|
192
219
|
id: id,
|
|
193
220
|
};
|
|
@@ -217,4 +244,4 @@ export default {
|
|
|
217
244
|
publishLearningPath,
|
|
218
245
|
setLearningPathInformation,
|
|
219
246
|
setLearningPathTags,
|
|
220
|
-
};
|
|
247
|
+
};
|
|
@@ -6,9 +6,15 @@ import { client } from "./axiosClient.js";
|
|
|
6
6
|
* @param {String} elementType
|
|
7
7
|
* @param {Object} data
|
|
8
8
|
* @param {String} token Authorization token
|
|
9
|
+
* @returns {Promise<Object>}
|
|
9
10
|
*/
|
|
10
|
-
const comments = (
|
|
11
|
-
|
|
11
|
+
const comments = (
|
|
12
|
+
elementId: string,
|
|
13
|
+
elementType: string,
|
|
14
|
+
data: object,
|
|
15
|
+
token: string
|
|
16
|
+
): Promise<object> => {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
12
18
|
let confirmationRequest = client.post(
|
|
13
19
|
"api/v1/logger/comments/",
|
|
14
20
|
{
|
|
@@ -36,10 +42,16 @@ const comments = (elementId, elementType, data, token) => {
|
|
|
36
42
|
* @param {Number} page The results page
|
|
37
43
|
* @param {Number} elementsPerPage The number of elements per page
|
|
38
44
|
* @param {String} token
|
|
45
|
+
* @returns {Promise<Object>}
|
|
39
46
|
*/
|
|
40
|
-
const getListByElementId = (
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
const getListByElementId = (
|
|
48
|
+
elementId: string,
|
|
49
|
+
page: number | null,
|
|
50
|
+
elementsPerPage: number | null,
|
|
51
|
+
token: string
|
|
52
|
+
): Promise<object> => {
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
let data: { elementsPerPage?: number, page?: number } = {};
|
|
43
55
|
if (elementsPerPage !== null) data.elementsPerPage = elementsPerPage;
|
|
44
56
|
if (page !== null) data.page = page;
|
|
45
57
|
const getTokensRequest = client.post(`api/v1/logger/${elementId}`, data, {
|
|
@@ -5,10 +5,14 @@ import { client } from "./axiosClient.js";
|
|
|
5
5
|
* @param {String} learningContentId
|
|
6
6
|
* @param {String} microSkillId
|
|
7
7
|
* @param {String} token
|
|
8
|
-
* @returns {Promise}
|
|
8
|
+
* @returns {Promise<Object>}
|
|
9
9
|
*/
|
|
10
|
-
const getResponses = (
|
|
11
|
-
|
|
10
|
+
const getResponses = (
|
|
11
|
+
learningContentId: string,
|
|
12
|
+
microSkillId: string,
|
|
13
|
+
token: string
|
|
14
|
+
): Promise<object> => {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
12
16
|
let confirmationRequest = client.get(
|
|
13
17
|
`api/v1/microskillsresponses/${learningContentId}/${microSkillId}`,
|
|
14
18
|
{
|
|
@@ -31,10 +35,15 @@ const getResponses = (learningContentId, microSkillId, token) => {
|
|
|
31
35
|
* @param {String} microSkillId
|
|
32
36
|
* @param {Array<Object>} responses
|
|
33
37
|
* @param {String} token Authorization token
|
|
34
|
-
* @returns {Promise}
|
|
38
|
+
* @returns {Promise<Object>}
|
|
35
39
|
*/
|
|
36
|
-
const saveResponses = (
|
|
37
|
-
|
|
40
|
+
const saveResponses = (
|
|
41
|
+
learningContentId: string,
|
|
42
|
+
microSkillId: string,
|
|
43
|
+
responses: object[],
|
|
44
|
+
token: string
|
|
45
|
+
): Promise<object> => {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
38
47
|
let data = {
|
|
39
48
|
responses: responses,
|
|
40
49
|
};
|
|
@@ -3,10 +3,10 @@ import { client } from "./axiosClient.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Get the current quota for the user and tenant
|
|
5
5
|
* @param {String} token
|
|
6
|
-
* @returns {Promise}
|
|
6
|
+
* @returns {Promise<Object>}
|
|
7
7
|
*/
|
|
8
|
-
const getAllQuota = (token) => {
|
|
9
|
-
return new Promise(
|
|
8
|
+
const getAllQuota = (token: string): Promise<object> => {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
10
|
let confirmationRequest = client.get(`/api/v1/quotas/getallquota`, {
|
|
11
11
|
headers: { authorization: token },
|
|
12
12
|
});
|
|
@@ -25,9 +25,14 @@ const getAllQuota = (token) => {
|
|
|
25
25
|
* @param {String} quotaId
|
|
26
26
|
* @param {Number} value
|
|
27
27
|
* @param {String} token
|
|
28
|
+
* @returns {Promise<Object>}
|
|
28
29
|
*/
|
|
29
|
-
const increaseQuotaUtilization = (
|
|
30
|
-
|
|
30
|
+
const increaseQuotaUtilization = (
|
|
31
|
+
quotaId: string,
|
|
32
|
+
value: number,
|
|
33
|
+
token: string
|
|
34
|
+
): Promise<object> => {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
31
36
|
let confirmationRequest = client.post(
|
|
32
37
|
`/api/v1/quotas/increaseutilization`,
|
|
33
38
|
{
|