@stackfactor/client-api 1.1.123 → 1.1.125
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 +1 -3
- package/lib/skillAssessments.js +25 -0
- package/package.json +1 -1
package/lib/role.js
CHANGED
|
@@ -229,14 +229,12 @@ const getRoleTemplateUpdates = (id, token) => {
|
|
|
229
229
|
* Import role templates
|
|
230
230
|
* @param {Array<String>} data The list of role templates to be imported
|
|
231
231
|
* @param {String} token
|
|
232
|
-
* @param {Boolean} skipIfAlreadyImported Skip if the role template is already imported
|
|
233
232
|
* @returns {Promise}
|
|
234
233
|
*/
|
|
235
|
-
const importRoleTemplates = (data, token
|
|
234
|
+
const importRoleTemplates = (data, token) => {
|
|
236
235
|
return new Promise(function (resolve, reject) {
|
|
237
236
|
const requestData = {
|
|
238
237
|
data: data,
|
|
239
|
-
skipIfAlreadyImported: skipIfAlreadyImported,
|
|
240
238
|
};
|
|
241
239
|
let confirmationRequest = client.post(
|
|
242
240
|
`api/v1/roles/importRoleTemplates`,
|
package/lib/skillAssessments.js
CHANGED
|
@@ -109,6 +109,31 @@ const getById = (id, token) => {
|
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Get skill assessment by user and skill
|
|
114
|
+
* @param {String} userId
|
|
115
|
+
* @param {String} skillId
|
|
116
|
+
* @param {String} token
|
|
117
|
+
* @returns {Promise<Object>} The skill assessment
|
|
118
|
+
*/
|
|
119
|
+
const getByUserAndSkill = (userId, skillId, token) => {
|
|
120
|
+
return new Promise(function (resolve, reject) {
|
|
121
|
+
let confirmationRequest = client.get(
|
|
122
|
+
`api/v1/skillassessments/getbyuserandskill/${userId}/${skillId}`,
|
|
123
|
+
{
|
|
124
|
+
headers: { authorization: token },
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
confirmationRequest
|
|
128
|
+
.then((response) => {
|
|
129
|
+
resolve(response.data);
|
|
130
|
+
})
|
|
131
|
+
.catch((error) => {
|
|
132
|
+
reject(error);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
112
137
|
/**
|
|
113
138
|
* Get list
|
|
114
139
|
* @param {Object} userId The user used to select the skill
|