@stackfactor/client-api 1.0.94 → 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.
Files changed (2) hide show
  1. package/lib/skill.js +31 -0
  2. package/package.json +1 -1
package/lib/skill.js CHANGED
@@ -406,6 +406,36 @@ export const setSkillInformation = (id, data, token) => {
406
406
  });
407
407
  };
408
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
+
409
439
  /**
410
440
  * Watch skill
411
441
  * @param {String} id The id of the skill to be updated
@@ -448,6 +478,7 @@ const skill = {
448
478
  importSkillTemplates,
449
479
  publishSkill,
450
480
  setSkillInformation,
481
+ setSkillInformationFromTemplate,
451
482
  watchSkill,
452
483
  };
453
484
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.0.94",
3
+ "version": "1.0.95",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {