@stackfactor/client-api 1.0.94 → 1.0.96
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 +54 -0
- package/lib/skill.js +31 -0
- package/package.json +1 -1
package/lib/role.js
CHANGED
|
@@ -199,6 +199,30 @@ export const getRolesList = (
|
|
|
199
199
|
});
|
|
200
200
|
};
|
|
201
201
|
|
|
202
|
+
/**
|
|
203
|
+
* Get role template updates
|
|
204
|
+
* @param {String} id The role id
|
|
205
|
+
* @param {String} token
|
|
206
|
+
* @returns {Promise}
|
|
207
|
+
*/
|
|
208
|
+
export const getRoleTemplateUpdates = (id, token) => {
|
|
209
|
+
return new Promise(function (resolve, reject) {
|
|
210
|
+
let confirmationRequest = client.get(
|
|
211
|
+
`api/v1/roles/getroletemplateupdates/${id}`,
|
|
212
|
+
{
|
|
213
|
+
headers: { authorization: token },
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
confirmationRequest
|
|
217
|
+
.then((response) => {
|
|
218
|
+
resolve(response.data);
|
|
219
|
+
})
|
|
220
|
+
.catch((error) => {
|
|
221
|
+
reject(error);
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
|
|
202
226
|
/**
|
|
203
227
|
* Import role templates
|
|
204
228
|
* @param {Array<String>} data The list of role templates to be imported
|
|
@@ -278,6 +302,36 @@ export const setRoleInformation = (id, data, token) => {
|
|
|
278
302
|
});
|
|
279
303
|
};
|
|
280
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Set the role information from template
|
|
307
|
+
* @param {String} id The id of the skill to be updated
|
|
308
|
+
* @param {Object} data Data used to update the skill
|
|
309
|
+
* @param {String} token Authorization token
|
|
310
|
+
* @returns {Promise}
|
|
311
|
+
*/
|
|
312
|
+
export const setRoleInformationFromTemplate = (id, data, token) => {
|
|
313
|
+
return new Promise(function (resolve, reject) {
|
|
314
|
+
const requestData = {
|
|
315
|
+
data: data,
|
|
316
|
+
id: id,
|
|
317
|
+
};
|
|
318
|
+
let confirmationRequest = client.post(
|
|
319
|
+
`api/v1/roles/updatefromtemplate/`,
|
|
320
|
+
requestData,
|
|
321
|
+
{
|
|
322
|
+
headers: { authorization: token },
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
confirmationRequest
|
|
326
|
+
.then((response) => {
|
|
327
|
+
resolve(response.data);
|
|
328
|
+
})
|
|
329
|
+
.catch((error) => {
|
|
330
|
+
reject(error);
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
|
|
281
335
|
/**
|
|
282
336
|
* Set user roles
|
|
283
337
|
* @param {String} id The id of the user to be updated
|
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
|
|