@stackfactor/client-api 1.0.93 → 1.0.95
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/skill.js +56 -0
- package/package.json +1 -1
package/lib/skill.js
CHANGED
|
@@ -297,6 +297,30 @@ export const getCurrentUserTeamSkills = (maxDepth, token) => {
|
|
|
297
297
|
});
|
|
298
298
|
};
|
|
299
299
|
|
|
300
|
+
/**
|
|
301
|
+
* Get skill template updates
|
|
302
|
+
* @param {String} id The skill id
|
|
303
|
+
* @param {String} token
|
|
304
|
+
* @returns {Promise}
|
|
305
|
+
*/
|
|
306
|
+
export const getSkillTemplateUpdates = (id, token) => {
|
|
307
|
+
return new Promise(function (resolve, reject) {
|
|
308
|
+
let confirmationRequest = client.get(
|
|
309
|
+
`api/v1/skills/getskilltemplateupdates/${id}`,
|
|
310
|
+
{
|
|
311
|
+
headers: { authorization: token },
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
confirmationRequest
|
|
315
|
+
.then((response) => {
|
|
316
|
+
resolve(response.data);
|
|
317
|
+
})
|
|
318
|
+
.catch((error) => {
|
|
319
|
+
reject(error);
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
|
|
300
324
|
/**
|
|
301
325
|
* Import skill templates
|
|
302
326
|
* @param {Array<String>} data The list of role templates to be imported
|
|
@@ -382,6 +406,36 @@ export const setSkillInformation = (id, data, token) => {
|
|
|
382
406
|
});
|
|
383
407
|
};
|
|
384
408
|
|
|
409
|
+
/**
|
|
410
|
+
* Set the skill information from template
|
|
411
|
+
* @param {String} id The id of the skill to be updated
|
|
412
|
+
* @param {Object} data Data used to update the skill
|
|
413
|
+
* @param {String} token Authorization token
|
|
414
|
+
* @returns {Promise}
|
|
415
|
+
*/
|
|
416
|
+
export const setSkillInformationFromTemplate = (id, data, token) => {
|
|
417
|
+
return new Promise(function (resolve, reject) {
|
|
418
|
+
const requestData = {
|
|
419
|
+
data: data,
|
|
420
|
+
id: id,
|
|
421
|
+
};
|
|
422
|
+
let confirmationRequest = client.post(
|
|
423
|
+
`api/v1/skills/updatefromtemplate/`,
|
|
424
|
+
requestData,
|
|
425
|
+
{
|
|
426
|
+
headers: { authorization: token },
|
|
427
|
+
}
|
|
428
|
+
);
|
|
429
|
+
confirmationRequest
|
|
430
|
+
.then((response) => {
|
|
431
|
+
resolve(response.data);
|
|
432
|
+
})
|
|
433
|
+
.catch((error) => {
|
|
434
|
+
reject(error);
|
|
435
|
+
});
|
|
436
|
+
});
|
|
437
|
+
};
|
|
438
|
+
|
|
385
439
|
/**
|
|
386
440
|
* Watch skill
|
|
387
441
|
* @param {String} id The id of the skill to be updated
|
|
@@ -418,11 +472,13 @@ const skill = {
|
|
|
418
472
|
getSkillRequiredAssessmentType,
|
|
419
473
|
getSkillInformationById,
|
|
420
474
|
getSkillList,
|
|
475
|
+
getSkillTemplateUpdates,
|
|
421
476
|
getTeamSkillsById,
|
|
422
477
|
getCurrentUserTeamSkills,
|
|
423
478
|
importSkillTemplates,
|
|
424
479
|
publishSkill,
|
|
425
480
|
setSkillInformation,
|
|
481
|
+
setSkillInformationFromTemplate,
|
|
426
482
|
watchSkill,
|
|
427
483
|
};
|
|
428
484
|
|