@stackfactor/client-api 1.0.97 → 1.0.99

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/role.js CHANGED
@@ -398,6 +398,7 @@ const role = {
398
398
  importRoleTemplates,
399
399
  publishRole,
400
400
  setRoleInformation,
401
+ setRoleInformationFromTemplate,
401
402
  setUserRoles,
402
403
  watchRole,
403
404
  };
package/lib/skill.js CHANGED
@@ -436,6 +436,35 @@ export const setSkillInformationFromTemplate = (id, data, token) => {
436
436
  });
437
437
  };
438
438
 
439
+ /**
440
+ * Validate skill information
441
+ * @param {String} id The id of the skill to be updated
442
+ * @param {String} token Authorization token
443
+ * @returns {Promise}
444
+ */
445
+ export const validateSkill = (id, token) => {
446
+ return new Promise(function (resolve, reject) {
447
+ const requestData = {
448
+ data: data,
449
+ id: id,
450
+ };
451
+ let confirmationRequest = client.post(
452
+ `api/v1/skills/validate/`,
453
+ requestData,
454
+ {
455
+ headers: { authorization: token },
456
+ }
457
+ );
458
+ confirmationRequest
459
+ .then((response) => {
460
+ resolve(response.data);
461
+ })
462
+ .catch((error) => {
463
+ reject(error);
464
+ });
465
+ });
466
+ };
467
+
439
468
  /**
440
469
  * Watch skill
441
470
  * @param {String} id The id of the skill to be updated
@@ -479,6 +508,7 @@ const skill = {
479
508
  publishSkill,
480
509
  setSkillInformation,
481
510
  setSkillInformationFromTemplate,
511
+ validateSkill,
482
512
  watchSkill,
483
513
  };
484
514
 
@@ -244,6 +244,35 @@ export const setTemplateTags = (id, tags, token) => {
244
244
  });
245
245
  };
246
246
 
247
+ /*
248
+ * Validate skill template information
249
+ * @param {String} id The id of the skill to be updated
250
+ * @param {String} token Authorization token
251
+ * @returns {Promise}
252
+ */
253
+ export const validateSkill = (id, token) => {
254
+ return new Promise(function (resolve, reject) {
255
+ const requestData = {
256
+ data: data,
257
+ id: id,
258
+ };
259
+ let confirmationRequest = client.post(
260
+ `api/v1/skilltemplates/validate/`,
261
+ requestData,
262
+ {
263
+ headers: { authorization: token },
264
+ }
265
+ );
266
+ confirmationRequest
267
+ .then((response) => {
268
+ resolve(response.data);
269
+ })
270
+ .catch((error) => {
271
+ reject(error);
272
+ });
273
+ });
274
+ };
275
+
247
276
  /**
248
277
  * Watch skill template
249
278
  * @param {String} id The id of the skill template to be updated
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.0.97",
3
+ "version": "1.0.99",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {