@stackfactor/client-api 1.1.50 → 1.1.52
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/learningContent.js +35 -0
- package/lib/trainingPlans.js +19 -0
- package/lib/utils.js +0 -1
- package/package.json +1 -1
package/lib/learningContent.js
CHANGED
|
@@ -265,6 +265,40 @@ export const setLearningContentInformation = (id, data, token) => {
|
|
|
265
265
|
});
|
|
266
266
|
};
|
|
267
267
|
|
|
268
|
+
/**
|
|
269
|
+
* Set partial content information
|
|
270
|
+
* @param {*} id
|
|
271
|
+
* @param {*} data
|
|
272
|
+
* @param {*} token
|
|
273
|
+
* @returns
|
|
274
|
+
*/
|
|
275
|
+
export const setLearningContentPartialContentInformation = (
|
|
276
|
+
id,
|
|
277
|
+
data,
|
|
278
|
+
token
|
|
279
|
+
) => {
|
|
280
|
+
return new Promise(function (resolve, reject) {
|
|
281
|
+
const requestData = {
|
|
282
|
+
data: data,
|
|
283
|
+
id: id,
|
|
284
|
+
};
|
|
285
|
+
let confirmationRequest = client.post(
|
|
286
|
+
`api/v1/learningcontent/updatepartialcontent/${id}`,
|
|
287
|
+
requestData,
|
|
288
|
+
{
|
|
289
|
+
headers: { authorization: token },
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
confirmationRequest
|
|
293
|
+
.then((response) => {
|
|
294
|
+
resolve(response.data);
|
|
295
|
+
})
|
|
296
|
+
.catch((error) => {
|
|
297
|
+
reject(error);
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
};
|
|
301
|
+
|
|
268
302
|
/**
|
|
269
303
|
* Set the content for a specific learning activity
|
|
270
304
|
* @param {String} id
|
|
@@ -402,6 +436,7 @@ export default {
|
|
|
402
436
|
generateMicroSkillTestKnowledge,
|
|
403
437
|
getLearningContentList,
|
|
404
438
|
publishLearningContent,
|
|
439
|
+
setLearningContentPartialContentInformation,
|
|
405
440
|
setLearningContentLearningContentInformation,
|
|
406
441
|
setLearningContentLearningMicroSkillContentInformation,
|
|
407
442
|
setLearningContentInformation,
|
package/lib/trainingPlans.js
CHANGED
|
@@ -137,6 +137,24 @@ export const getTrainingPlanById = (id, version, token) => {
|
|
|
137
137
|
});
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Get tasks summary for a recipient across all of the training plans
|
|
142
|
+
* @param {String} token Authorization token
|
|
143
|
+
*/
|
|
144
|
+
const getAllTrainingPlansTasksSummary = async (token = null) => {
|
|
145
|
+
return new Promise(function (resolve, reject) {
|
|
146
|
+
let confirmationRequest = client.get(`api/v1/trainingplans/taskssummary`, {
|
|
147
|
+
headers: token ? { authorization: token } : {},
|
|
148
|
+
});
|
|
149
|
+
confirmationRequest
|
|
150
|
+
.then((response) => {
|
|
151
|
+
resolve(response.data);
|
|
152
|
+
})
|
|
153
|
+
.catch((error) => {
|
|
154
|
+
reject(error);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
};
|
|
140
158
|
/**
|
|
141
159
|
* Get training plans list
|
|
142
160
|
* @param {Array<ObjectId>} users The list of users for which the plans should be loaded
|
|
@@ -295,6 +313,7 @@ export default {
|
|
|
295
313
|
deleteTrainingPlan,
|
|
296
314
|
discardTrainingPlanChanges,
|
|
297
315
|
generateNewBaseline,
|
|
316
|
+
getAllTrainingPlansTasksSummary,
|
|
298
317
|
getTrainingPlanById,
|
|
299
318
|
getListOfTrainingPlans,
|
|
300
319
|
publishTrainingPlan,
|
package/lib/utils.js
CHANGED