@stackfactor/client-api 1.1.12-9.1 → 1.1.12
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/{exports.ts → exports.js} +0 -14
- package/index.js +3 -0
- package/lib/{actionNotifications.ts → actionNotifications.js} +11 -21
- package/lib/{address.ts → address.js} +5 -4
- package/lib/axiosClient.js +85 -0
- package/lib/{config.ts → config.js} +9 -20
- package/lib/{constants.ts → constants.js} +41 -11
- package/lib/{dashboard.ts → dashboard.js} +10 -19
- package/lib/{departmentTrainingPlans.ts → departmentTrainingPlans.js} +32 -63
- package/lib/{groups.ts → groups.js} +29 -68
- package/lib/{integration.ts → integration.js} +47 -103
- package/lib/{integrationConfiguration.ts → integrationConfiguration.js} +22 -27
- package/lib/integrations/{contentGenerator.ts → contentGenerator.js} +18 -38
- package/lib/{learningContent.ts → learningContent.js} +62 -218
- package/lib/{learningPath.ts → learningPath.js} +30 -57
- package/lib/{logger.ts → logger.js} +8 -18
- package/lib/{role.ts → role.js} +69 -117
- package/lib/{roleTemplate.ts → roleTemplate.js} +30 -65
- package/lib/{skill.ts → skill.js} +87 -125
- package/lib/skillAssessmentTestingSession.js +148 -0
- package/lib/{skillAssessments.ts → skillAssessments.js} +16 -63
- package/lib/{skillTemplate.ts → skillTemplate.js} +42 -73
- package/lib/{teams.ts → teams.js} +38 -73
- package/lib/{tenants.ts → tenants.js} +10 -17
- package/lib/{trainingPlans.ts → trainingPlans.js} +56 -159
- package/lib/{userInformation.ts → userInformation.js} +26 -27
- package/lib/{users.ts → users.js} +140 -239
- package/lib/utils.js +48 -0
- package/package.json +1 -12
- package/.eslintrc.json +0 -13
- package/index.ts +0 -1
- package/lib/aiAssistant.ts +0 -197
- package/lib/avatar.ts +0 -41
- package/lib/axiosClient.ts +0 -92
- package/lib/microSkillsQuizes.ts +0 -70
- package/lib/quotas.ts +0 -59
- package/lib/security.ts +0 -99
- package/lib/skillAssessmentTestingSession.ts +0 -192
- package/lib/talentTransfromation.ts +0 -126
- package/lib/trainingPlansProficiencyLevels.ts +0 -132
- package/lib/utils.ts +0 -64
|
@@ -1,35 +1,14 @@
|
|
|
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
|
-
|
|
21
3
|
/**
|
|
22
4
|
* Create learning content and set information
|
|
23
5
|
* @param {Object} data Learning content data
|
|
24
6
|
* @param {String} token Authorization token
|
|
25
7
|
* @returns {Promise<Object>} The created learning content
|
|
26
8
|
*/
|
|
27
|
-
const createLearningContent = (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
): Promise<object> => {
|
|
31
|
-
return new Promise((resolve, reject) => {
|
|
32
|
-
const requestData: LearningContentData = {
|
|
9
|
+
const createLearningContent = (data, token) => {
|
|
10
|
+
return new Promise(function (resolve, reject) {
|
|
11
|
+
const requestData = {
|
|
33
12
|
data: data,
|
|
34
13
|
};
|
|
35
14
|
let confirmationRequest = client.put(
|
|
@@ -56,16 +35,12 @@ const createLearningContent = (
|
|
|
56
35
|
* @param {String} token Authorization token
|
|
57
36
|
* @returns {Promise<Object>} The response from the server
|
|
58
37
|
*/
|
|
59
|
-
const deleteLearningContent = (
|
|
60
|
-
|
|
61
|
-
comments: string,
|
|
62
|
-
token: string
|
|
63
|
-
): Promise<object> => {
|
|
64
|
-
const data: LearningContentData = {
|
|
38
|
+
export const deleteLearningContent = (id, comments, token) => {
|
|
39
|
+
const data = {
|
|
65
40
|
id: id,
|
|
66
41
|
};
|
|
67
42
|
if (comments) data.comments = comments;
|
|
68
|
-
return new Promise((resolve, reject)
|
|
43
|
+
return new Promise(function (resolve, reject) {
|
|
69
44
|
const request = client.delete(`api/v1/learningcontent/`, {
|
|
70
45
|
headers: { authorization: token },
|
|
71
46
|
data: data,
|
|
@@ -86,11 +61,8 @@ const deleteLearningContent = (
|
|
|
86
61
|
* @param {String} token Authorization token
|
|
87
62
|
* @returns {Promise<Object>} The response from the server
|
|
88
63
|
*/
|
|
89
|
-
const discardLearningContentChanges = (
|
|
90
|
-
|
|
91
|
-
token: string
|
|
92
|
-
): Promise<object> => {
|
|
93
|
-
return new Promise((resolve, reject) => {
|
|
64
|
+
export const discardLearningContentChanges = (id, token) => {
|
|
65
|
+
return new Promise(function (resolve, reject) {
|
|
94
66
|
const data = {};
|
|
95
67
|
const request = client.get(`api/v1/learningcontent/discard/${id}`, {
|
|
96
68
|
headers: { authorization: token },
|
|
@@ -108,33 +80,25 @@ const discardLearningContentChanges = (
|
|
|
108
80
|
|
|
109
81
|
/**
|
|
110
82
|
* Generate the learning activity content
|
|
111
|
-
* @param {String} learningObjectives
|
|
112
83
|
* @param {String} skillId
|
|
113
84
|
* @param {String} microSkillId
|
|
114
85
|
* @param {Object} learningActivity
|
|
115
|
-
* @param {List<String>} otherLearningActivities
|
|
116
86
|
* @param {List<String>} sections
|
|
117
87
|
* @param {String} token
|
|
118
88
|
*/
|
|
119
|
-
const generateLearningActivityContent = (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return new Promise((resolve, reject) => {
|
|
129
|
-
const requestData: GenerateLearningActivityContentData = {
|
|
130
|
-
learningObjectives: learningObjectives,
|
|
89
|
+
export const generateLearningActivityContent = (
|
|
90
|
+
skillId,
|
|
91
|
+
microSkillId,
|
|
92
|
+
learningActivity,
|
|
93
|
+
sections,
|
|
94
|
+
token
|
|
95
|
+
) => {
|
|
96
|
+
return new Promise(function (resolve, reject) {
|
|
97
|
+
const requestData = {
|
|
131
98
|
learningActivity: learningActivity,
|
|
132
99
|
microSkillId: microSkillId,
|
|
133
100
|
sections: sections,
|
|
134
101
|
};
|
|
135
|
-
if (otherLearningActivities) {
|
|
136
|
-
requestData.otherLearningActivities = otherLearningActivities;
|
|
137
|
-
}
|
|
138
102
|
const request = client.post(
|
|
139
103
|
`api/v1/learningcontent/generatelearningactivitycontent/${skillId}`,
|
|
140
104
|
requestData,
|
|
@@ -152,37 +116,6 @@ const generateLearningActivityContent = (
|
|
|
152
116
|
});
|
|
153
117
|
};
|
|
154
118
|
|
|
155
|
-
/**
|
|
156
|
-
* Generate micro skill test knowledge
|
|
157
|
-
* @param {String} microSkill
|
|
158
|
-
* @param {String} token
|
|
159
|
-
* @returns {Promise<Object>}
|
|
160
|
-
*/
|
|
161
|
-
const generateMicroSkillTestKnowledge = (
|
|
162
|
-
microSkill: string,
|
|
163
|
-
token: string
|
|
164
|
-
): Promise<object> => {
|
|
165
|
-
return new Promise((resolve, reject) => {
|
|
166
|
-
let data = {
|
|
167
|
-
microSkill: microSkill,
|
|
168
|
-
};
|
|
169
|
-
let confirmationRequest = client.post(
|
|
170
|
-
`api/v1/learningcontent/generatemicroskilltestknowledge`,
|
|
171
|
-
data,
|
|
172
|
-
{
|
|
173
|
-
headers: { authorization: token },
|
|
174
|
-
}
|
|
175
|
-
);
|
|
176
|
-
confirmationRequest
|
|
177
|
-
.then((response) => {
|
|
178
|
-
resolve(response.data);
|
|
179
|
-
})
|
|
180
|
-
.catch((error) => {
|
|
181
|
-
reject(error);
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
|
|
186
119
|
/**
|
|
187
120
|
* Get the learning content information by id
|
|
188
121
|
* @param {String} id The id of the learning content
|
|
@@ -190,12 +123,8 @@ const generateMicroSkillTestKnowledge = (
|
|
|
190
123
|
* @param {String} token Authorization token
|
|
191
124
|
* @returns {Promise<Object>} The response from the server
|
|
192
125
|
*/
|
|
193
|
-
const getLearningContentInformationById = (
|
|
194
|
-
|
|
195
|
-
version: string,
|
|
196
|
-
token: string
|
|
197
|
-
): Promise<object> => {
|
|
198
|
-
return new Promise((resolve, reject) => {
|
|
126
|
+
export const getLearningContentInformationById = (id, version, token) => {
|
|
127
|
+
return new Promise(function (resolve, reject) {
|
|
199
128
|
let confirmationRequest = client.get(
|
|
200
129
|
`api/v1/learningcontent/${id}/${version}`,
|
|
201
130
|
{
|
|
@@ -220,14 +149,14 @@ const getLearningContentInformationById = (
|
|
|
220
149
|
* @param {String} token Authorization token
|
|
221
150
|
* @returns {Promise<Array<Object>>} The list of available content
|
|
222
151
|
*/
|
|
223
|
-
const getLearningContentList = (
|
|
224
|
-
filter
|
|
225
|
-
version
|
|
226
|
-
includeDeleted
|
|
227
|
-
token
|
|
228
|
-
)
|
|
229
|
-
return new Promise((resolve, reject)
|
|
230
|
-
const requestData
|
|
152
|
+
export const getLearningContentList = (
|
|
153
|
+
filter,
|
|
154
|
+
version,
|
|
155
|
+
includeDeleted,
|
|
156
|
+
token
|
|
157
|
+
) => {
|
|
158
|
+
return new Promise(function (resolve, reject) {
|
|
159
|
+
const requestData = {
|
|
231
160
|
version: version,
|
|
232
161
|
includeDeleted: includeDeleted,
|
|
233
162
|
};
|
|
@@ -249,35 +178,6 @@ const getLearningContentList = (
|
|
|
249
178
|
});
|
|
250
179
|
};
|
|
251
180
|
|
|
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
|
-
|
|
281
181
|
/**
|
|
282
182
|
* Publish learning content
|
|
283
183
|
* @param {String} id The id of the content to be published
|
|
@@ -285,13 +185,9 @@ const migrateLearningContentStorageType = (
|
|
|
285
185
|
* @param {String} token Authorization token
|
|
286
186
|
* @returns {Promise<Object>} The response from the server
|
|
287
187
|
*/
|
|
288
|
-
const publishLearningContent = (
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
token: string
|
|
292
|
-
): Promise<object> => {
|
|
293
|
-
return new Promise((resolve, reject) => {
|
|
294
|
-
let data: LearningContentData = {};
|
|
188
|
+
export const publishLearningContent = (id, comments, token) => {
|
|
189
|
+
return new Promise(function (resolve, reject) {
|
|
190
|
+
let data = {};
|
|
295
191
|
if (comments) data.comments = comments;
|
|
296
192
|
|
|
297
193
|
let confirmationRequest = client.post(
|
|
@@ -318,13 +214,9 @@ const publishLearningContent = (
|
|
|
318
214
|
* @param {String} token Authorization token
|
|
319
215
|
* @returns {Promise<Object>} The updated learning content
|
|
320
216
|
*/
|
|
321
|
-
const setLearningContentInformation = (
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
token: string
|
|
325
|
-
): Promise<object> => {
|
|
326
|
-
return new Promise((resolve, reject) => {
|
|
327
|
-
const requestData: LearningContentData = {
|
|
217
|
+
export const setLearningContentInformation = (id, data, token) => {
|
|
218
|
+
return new Promise(function (resolve, reject) {
|
|
219
|
+
const requestData = {
|
|
328
220
|
data: data,
|
|
329
221
|
id: id,
|
|
330
222
|
};
|
|
@@ -345,65 +237,26 @@ const setLearningContentInformation = (
|
|
|
345
237
|
});
|
|
346
238
|
};
|
|
347
239
|
|
|
348
|
-
/**
|
|
349
|
-
* Set partial content information
|
|
350
|
-
* @param {String} id
|
|
351
|
-
* @param {Object} data
|
|
352
|
-
* @param {String} token
|
|
353
|
-
* @returns {Promise<Object>}
|
|
354
|
-
*/
|
|
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 = {
|
|
362
|
-
data: data,
|
|
363
|
-
id: id,
|
|
364
|
-
};
|
|
365
|
-
let confirmationRequest = client.post(
|
|
366
|
-
`api/v1/learningcontent/updatepartialcontent/${id}`,
|
|
367
|
-
requestData,
|
|
368
|
-
{
|
|
369
|
-
headers: { authorization: token },
|
|
370
|
-
}
|
|
371
|
-
);
|
|
372
|
-
confirmationRequest
|
|
373
|
-
.then((response) => {
|
|
374
|
-
resolve(response.data);
|
|
375
|
-
})
|
|
376
|
-
.catch((error) => {
|
|
377
|
-
reject(error);
|
|
378
|
-
});
|
|
379
|
-
});
|
|
380
|
-
};
|
|
381
|
-
|
|
382
240
|
/**
|
|
383
241
|
* Set the content for a specific learning activity
|
|
384
242
|
* @param {String} id
|
|
385
243
|
* @param {String} learningcontentid
|
|
386
|
-
* @param {String} microSkillId
|
|
387
244
|
* @param {Object} data
|
|
388
245
|
* @param {String} token
|
|
389
|
-
* @returns {Promise<String>} OK word if the operation was
|
|
246
|
+
* @returns {Promise<String>} OK word if the operation was succesful
|
|
390
247
|
*/
|
|
391
|
-
const setLearningContentLearningContentInformation = (
|
|
392
|
-
id
|
|
393
|
-
learningcontentid
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
const requestData: LearningContentData = {
|
|
248
|
+
export const setLearningContentLearningContentInformation = (
|
|
249
|
+
id,
|
|
250
|
+
learningcontentid,
|
|
251
|
+
data,
|
|
252
|
+
token
|
|
253
|
+
) => {
|
|
254
|
+
return new Promise(function (resolve, reject) {
|
|
255
|
+
const requestData = {
|
|
400
256
|
data: data,
|
|
401
|
-
id: id,
|
|
402
|
-
learningcontentid: learningcontentid,
|
|
403
|
-
microSkillId: microSkillId,
|
|
404
257
|
};
|
|
405
258
|
let confirmationRequest = client.post(
|
|
406
|
-
`api/v1/learningcontent/updatelearningcontent
|
|
259
|
+
`api/v1/learningcontent/updatelearningcontent/${id}/${learningcontentid}`,
|
|
407
260
|
requestData,
|
|
408
261
|
{
|
|
409
262
|
headers: { authorization: token },
|
|
@@ -425,16 +278,16 @@ const setLearningContentLearningContentInformation = (
|
|
|
425
278
|
* @param {String} microskillid
|
|
426
279
|
* @param {Object} data
|
|
427
280
|
* @param {String} token
|
|
428
|
-
* @returns {Promise<String>} OK word if the operation was
|
|
281
|
+
* @returns {Promise<String>} OK word if the operation was succesful
|
|
429
282
|
*/
|
|
430
|
-
const setLearningContentLearningMicroSkillContentInformation = (
|
|
431
|
-
id
|
|
432
|
-
microskillid
|
|
433
|
-
data
|
|
434
|
-
token
|
|
435
|
-
)
|
|
436
|
-
return new Promise((resolve, reject)
|
|
437
|
-
const requestData
|
|
283
|
+
export const setLearningContentLearningMicroSkillContentInformation = (
|
|
284
|
+
id,
|
|
285
|
+
microskillid,
|
|
286
|
+
data,
|
|
287
|
+
token
|
|
288
|
+
) => {
|
|
289
|
+
return new Promise(function (resolve, reject) {
|
|
290
|
+
const requestData = {
|
|
438
291
|
data: data,
|
|
439
292
|
};
|
|
440
293
|
let confirmationRequest = client.post(
|
|
@@ -460,13 +313,9 @@ const setLearningContentLearningMicroSkillContentInformation = (
|
|
|
460
313
|
* @param {Object} tags Updated learning content tags
|
|
461
314
|
* @param {String} token Authorization token
|
|
462
315
|
*/
|
|
463
|
-
const setLearningContentTags = (
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
token: string
|
|
467
|
-
): Promise<object> => {
|
|
468
|
-
return new Promise((resolve, reject) => {
|
|
469
|
-
const requestData: LearningContentData = {
|
|
316
|
+
export const setLearningContentTags = (id, tags, token) => {
|
|
317
|
+
return new Promise(function (resolve, reject) {
|
|
318
|
+
const requestData = {
|
|
470
319
|
tags: tags,
|
|
471
320
|
id: id,
|
|
472
321
|
};
|
|
@@ -493,13 +342,9 @@ const setLearningContentTags = (
|
|
|
493
342
|
* @param {Boolean} watch Set to true or false
|
|
494
343
|
* @param {String} token Authorization token
|
|
495
344
|
*/
|
|
496
|
-
const watchLearningContent = (
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
token: string
|
|
500
|
-
): Promise<object> => {
|
|
501
|
-
return new Promise((resolve, reject) => {
|
|
502
|
-
const requestData: LearningContentData = {
|
|
345
|
+
export const watchLearningContent = (id, watch, token) => {
|
|
346
|
+
return new Promise(function (resolve, reject) {
|
|
347
|
+
const requestData = {
|
|
503
348
|
id: id,
|
|
504
349
|
watch: watch,
|
|
505
350
|
};
|
|
@@ -520,20 +365,19 @@ const watchLearningContent = (
|
|
|
520
365
|
});
|
|
521
366
|
};
|
|
522
367
|
|
|
523
|
-
|
|
368
|
+
const learningContent = {
|
|
524
369
|
createLearningContent,
|
|
525
370
|
deleteLearningContent,
|
|
526
371
|
discardLearningContentChanges,
|
|
527
372
|
getLearningContentInformationById,
|
|
528
373
|
generateLearningActivityContent,
|
|
529
|
-
generateMicroSkillTestKnowledge,
|
|
530
374
|
getLearningContentList,
|
|
531
|
-
migrateLearningContentStorageType,
|
|
532
375
|
publishLearningContent,
|
|
533
|
-
setLearningContentPartialContentInformation,
|
|
534
376
|
setLearningContentLearningContentInformation,
|
|
535
|
-
|
|
377
|
+
setMicroSkillLearningContentInformation,
|
|
536
378
|
setLearningContentInformation,
|
|
537
379
|
setLearningContentTags,
|
|
538
380
|
watchLearningContent,
|
|
539
381
|
};
|
|
382
|
+
|
|
383
|
+
export default learningContent;
|
|
@@ -1,23 +1,12 @@
|
|
|
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
|
-
|
|
13
3
|
/**
|
|
14
4
|
* Create learning path and set information
|
|
15
5
|
* @param {Object} data
|
|
16
6
|
* @param {String} token Authorization token
|
|
17
|
-
* @returns {Promise<Object>}
|
|
18
7
|
*/
|
|
19
|
-
const createLearningPath = (data
|
|
20
|
-
return new Promise((resolve, reject)
|
|
8
|
+
export const createLearningPath = (data, token) => {
|
|
9
|
+
return new Promise(function (resolve, reject) {
|
|
21
10
|
let confirmationRequest = client.put(
|
|
22
11
|
"api/v1/learningpaths",
|
|
23
12
|
{ data: data },
|
|
@@ -40,11 +29,10 @@ const createLearningPath = (data: object, token: string): Promise<object> => {
|
|
|
40
29
|
* @param {String} id The id of the template to be deleted
|
|
41
30
|
* @param {String} comments The comments for approver
|
|
42
31
|
* @param {String} token Authorization token
|
|
43
|
-
* @returns {Promise<Object>}
|
|
44
32
|
*/
|
|
45
|
-
const deleteLearningPath = (id
|
|
46
|
-
return new Promise((resolve, reject)
|
|
47
|
-
const data
|
|
33
|
+
export const deleteLearningPath = (id, comments, token) => {
|
|
34
|
+
return new Promise(function (resolve, reject) {
|
|
35
|
+
const data = {
|
|
48
36
|
id: id,
|
|
49
37
|
};
|
|
50
38
|
if (comments) data.comments = comments;
|
|
@@ -66,10 +54,9 @@ const deleteLearningPath = (id: string, comments: string, token: string): Promis
|
|
|
66
54
|
* Discard the training plan draft changes
|
|
67
55
|
* @param {String} id The id of the training plan to be deleted
|
|
68
56
|
* @param {String} token Authorization token
|
|
69
|
-
* @returns {Promise<Object>}
|
|
70
57
|
*/
|
|
71
|
-
const discardLearningPathChanges = (id
|
|
72
|
-
return new Promise((resolve, reject)
|
|
58
|
+
export const discardLearningPathChanges = (id, token) => {
|
|
59
|
+
return new Promise(function (resolve, reject) {
|
|
73
60
|
const data = {};
|
|
74
61
|
const request = client.get(`api/v1/learningpaths/discard/${id}`, {
|
|
75
62
|
headers: { authorization: token },
|
|
@@ -86,14 +73,12 @@ const discardLearningPathChanges = (id: string, token: string): Promise<object>
|
|
|
86
73
|
};
|
|
87
74
|
|
|
88
75
|
/**
|
|
89
|
-
* Get
|
|
76
|
+
* Get traing plan template information
|
|
90
77
|
* @param {String} id The id of the template
|
|
91
|
-
* @param {String} version The version of the template
|
|
92
78
|
* @param {String} token Authorization token
|
|
93
|
-
* @returns {Promise<Object>}
|
|
94
79
|
*/
|
|
95
|
-
const getLearningPathInformationById = (id
|
|
96
|
-
return new Promise((resolve, reject)
|
|
80
|
+
export const getLearningPathInformationById = (id, version, token) => {
|
|
81
|
+
return new Promise(function (resolve, reject) {
|
|
97
82
|
let confirmationRequest = client.get(
|
|
98
83
|
`api/v1/learningpaths/${id}/${version}`,
|
|
99
84
|
{
|
|
@@ -114,29 +99,18 @@ const getLearningPathInformationById = (id: string, version: string, token: stri
|
|
|
114
99
|
* Get learning path list
|
|
115
100
|
* @param {Array<String>} list The filter used to select the skill
|
|
116
101
|
* @param {String} version The version to be retrieved
|
|
117
|
-
* @param {boolean} includeDeleted When true it will return the deleted records as well
|
|
118
102
|
* @param {String} token Authorization token
|
|
119
|
-
* @returns {Promise<Array<Object>>} The list of available content
|
|
120
103
|
*/
|
|
121
|
-
const getLearningPathsList = (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
includeDeleted: boolean,
|
|
125
|
-
token: string
|
|
126
|
-
): Promise<object[]> => {
|
|
127
|
-
return new Promise((resolve, reject) => {
|
|
128
|
-
const requestData: LearningPathData = {
|
|
104
|
+
export const getLearningPathsList = (list, version, includeDeleted, token) => {
|
|
105
|
+
return new Promise(function (resolve, reject) {
|
|
106
|
+
const requestData = {
|
|
129
107
|
version: version,
|
|
130
108
|
includeDeleted: includeDeleted,
|
|
131
109
|
};
|
|
132
110
|
if (list) requestData.list = list;
|
|
133
|
-
let confirmationRequest = client.post(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
{
|
|
137
|
-
headers: { authorization: token },
|
|
138
|
-
}
|
|
139
|
-
);
|
|
111
|
+
let confirmationRequest = client.post(`api/v1/learningpaths`, requestData, {
|
|
112
|
+
headers: { authorization: token },
|
|
113
|
+
});
|
|
140
114
|
confirmationRequest
|
|
141
115
|
.then((response) => {
|
|
142
116
|
resolve(response.data);
|
|
@@ -148,15 +122,14 @@ const getLearningPathsList = (
|
|
|
148
122
|
};
|
|
149
123
|
|
|
150
124
|
/**
|
|
151
|
-
* Publish training
|
|
125
|
+
* Publish training pplan template
|
|
152
126
|
* @param {String} id The id of the template to be published
|
|
153
127
|
* @param {String} comments The comments to be include with the request
|
|
154
128
|
* @param {String} token Authorization token
|
|
155
|
-
* @returns {Promise<Object>}
|
|
156
129
|
*/
|
|
157
|
-
const publishLearningPath = (id
|
|
158
|
-
return new Promise((resolve, reject)
|
|
159
|
-
let data
|
|
130
|
+
export const publishLearningPath = (id, comments, token) => {
|
|
131
|
+
return new Promise(function (resolve, reject) {
|
|
132
|
+
let data = {};
|
|
160
133
|
if (comments) data.comments = comments;
|
|
161
134
|
let confirmationRequest = client.post(
|
|
162
135
|
`api/v1/learningpaths/publish/${id}`,
|
|
@@ -180,11 +153,10 @@ const publishLearningPath = (id: string, comments: string, token: string): Promi
|
|
|
180
153
|
* @param {String} id The id of the template to be updated
|
|
181
154
|
* @param {Object} data Data used to update the template
|
|
182
155
|
* @param {String} token Authorization token
|
|
183
|
-
* @returns {Promise<Object>}
|
|
184
156
|
*/
|
|
185
|
-
const setLearningPathInformation = (id
|
|
186
|
-
return new Promise((resolve, reject)
|
|
187
|
-
const requestData
|
|
157
|
+
export const setLearningPathInformation = (id, data, token) => {
|
|
158
|
+
return new Promise(function (resolve, reject) {
|
|
159
|
+
const requestData = {
|
|
188
160
|
data: data,
|
|
189
161
|
id: id,
|
|
190
162
|
};
|
|
@@ -210,11 +182,10 @@ const setLearningPathInformation = (id: string, data: object, token: string): Pr
|
|
|
210
182
|
* @param {String} id The id of the template to be updated
|
|
211
183
|
* @param {Object} tags The updated tags
|
|
212
184
|
* @param {String} token Authorization token
|
|
213
|
-
* @returns {Promise<Object>}
|
|
214
185
|
*/
|
|
215
|
-
const setLearningPathTags = (id
|
|
216
|
-
return new Promise((resolve, reject)
|
|
217
|
-
const requestData
|
|
186
|
+
export const setLearningPathTags = (id, tags, token) => {
|
|
187
|
+
return new Promise(function (resolve, reject) {
|
|
188
|
+
const requestData = {
|
|
218
189
|
tags: tags,
|
|
219
190
|
id: id,
|
|
220
191
|
};
|
|
@@ -235,7 +206,7 @@ const setLearningPathTags = (id: string, tags: object, token: string): Promise<o
|
|
|
235
206
|
});
|
|
236
207
|
};
|
|
237
208
|
|
|
238
|
-
|
|
209
|
+
const learningPath = {
|
|
239
210
|
createLearningPath,
|
|
240
211
|
deleteLearningPath,
|
|
241
212
|
discardLearningPathChanges,
|
|
@@ -244,4 +215,6 @@ export default {
|
|
|
244
215
|
publishLearningPath,
|
|
245
216
|
setLearningPathInformation,
|
|
246
217
|
setLearningPathTags,
|
|
247
|
-
};
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export default learningPath;
|
|
@@ -6,15 +6,9 @@ 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>}
|
|
10
9
|
*/
|
|
11
|
-
const comments = (
|
|
12
|
-
|
|
13
|
-
elementType: string,
|
|
14
|
-
data: object,
|
|
15
|
-
token: string
|
|
16
|
-
): Promise<object> => {
|
|
17
|
-
return new Promise((resolve, reject) => {
|
|
10
|
+
export const comments = (elementId, elementType, data, token) => {
|
|
11
|
+
return new Promise(function (resolve, reject) {
|
|
18
12
|
let confirmationRequest = client.post(
|
|
19
13
|
"api/v1/logger/comments/",
|
|
20
14
|
{
|
|
@@ -42,16 +36,10 @@ const comments = (
|
|
|
42
36
|
* @param {Number} page The results page
|
|
43
37
|
* @param {Number} elementsPerPage The number of elements per page
|
|
44
38
|
* @param {String} token
|
|
45
|
-
* @returns {Promise<Object>}
|
|
46
39
|
*/
|
|
47
|
-
const getListByElementId = (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
elementsPerPage: number | null,
|
|
51
|
-
token: string
|
|
52
|
-
): Promise<object> => {
|
|
53
|
-
return new Promise((resolve, reject) => {
|
|
54
|
-
let data: { elementsPerPage?: number, page?: number } = {};
|
|
40
|
+
export const getListByElementId = (elementId, page, elementsPerPage, token) => {
|
|
41
|
+
return new Promise(function (resolve, reject) {
|
|
42
|
+
let data = {};
|
|
55
43
|
if (elementsPerPage !== null) data.elementsPerPage = elementsPerPage;
|
|
56
44
|
if (page !== null) data.page = page;
|
|
57
45
|
const getTokensRequest = client.post(`api/v1/logger/${elementId}`, data, {
|
|
@@ -67,4 +55,6 @@ const getListByElementId = (
|
|
|
67
55
|
});
|
|
68
56
|
};
|
|
69
57
|
|
|
70
|
-
|
|
58
|
+
const logger = { comments, getListByElementId };
|
|
59
|
+
|
|
60
|
+
export default logger;
|