@stackfactor/client-api 1.0.63 → 1.0.64

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
@@ -4,6 +4,7 @@ import { client } from "./axiosClient.js";
4
4
  * Create role and set information
5
5
  * @param {Object} data
6
6
  * @param {String} token Authorization token
7
+ * @returns {Promise}
7
8
  */
8
9
  export const createRole = (data, token) => {
9
10
  return new Promise(function (resolve, reject) {
@@ -29,6 +30,7 @@ export const createRole = (data, token) => {
29
30
  * @param {String} templateId
30
31
  * @param {Object} data
31
32
  * @param {String} token Authorization token
33
+ * @returns {Promise}
32
34
  */
33
35
  export const createRoleFromTemplate = (templateId, data, token) => {
34
36
  return new Promise(function (resolve, reject) {
@@ -58,6 +60,7 @@ export const createRoleFromTemplate = (templateId, data, token) => {
58
60
  * @param {String} id The id of the role to be deleted
59
61
  * @param {String} comment The comment included with the deletion
60
62
  * @param {String} token Authorization token
63
+ * @returns {Promise}
61
64
  */
62
65
  export const deleteRole = (id, comment, token) => {
63
66
  return new Promise(function (resolve, reject) {
@@ -83,6 +86,7 @@ export const deleteRole = (id, comment, token) => {
83
86
  * Discard the role draft changes
84
87
  * @param {String} id The id of the role to be deleted
85
88
  * @param {String} token Authorization token
89
+ * @returns {Promise}
86
90
  */
87
91
  export const discardRoleChanges = (id, token) => {
88
92
  return new Promise(function (resolve, reject) {
@@ -101,10 +105,32 @@ export const discardRoleChanges = (id, token) => {
101
105
  });
102
106
  };
103
107
 
108
+ /**
109
+ * Get the list of imported role templates
110
+ * @param {String} token
111
+ * @returns {Promise}
112
+ */
113
+ export const getImportedRoleTemplates = (token) => {
114
+ return new Promise(function (resolve, reject) {
115
+ const request = client.get(`api/v1/roles/getImportedRoleTemplates`, {
116
+ headers: { authorization: token },
117
+ });
118
+ request
119
+
120
+ .then((response) => {
121
+ resolve(response.data);
122
+ })
123
+ .catch((error) => {
124
+ reject(error);
125
+ });
126
+ });
127
+ };
128
+
104
129
  /**
105
130
  * Get role information
106
131
  * @param {number} id The id of the role
107
132
  * @param {String} token Authorization token
133
+ * @returns {Promise}
108
134
  */
109
135
  export const getRoleInformationById = (id, version, token) => {
110
136
  return new Promise(function (resolve, reject) {
@@ -129,6 +155,7 @@ export const getRoleInformationById = (id, version, token) => {
129
155
  * @param {boolean} includeDetailedInformation If true it will return detailed information
130
156
  * @param {Boolean} returnDefaultIfVersionNotAvailable Return the default version if published not available
131
157
  * @param {String} token Authorization token
158
+ * @returns {Promise}
132
159
  */
133
160
  export const getRolesList = (
134
161
  filter,
@@ -164,6 +191,7 @@ export const getRolesList = (
164
191
  * @param {number} id The id of the role to be published
165
192
  * @param {String} comment The comment to be include with the request
166
193
  * @param {String} token Authorization token
194
+ * @returns {Promise}
167
195
  */
168
196
  export const publishRole = (id, comment, token) => {
169
197
  return new Promise(function (resolve, reject) {
@@ -187,6 +215,7 @@ export const publishRole = (id, comment, token) => {
187
215
  * @param {String} id The id of the role to be updated
188
216
  * @param {Object} data Data used to update the role
189
217
  * @param {String} token Authorization token
218
+ * @returns {Promise}
190
219
  */
191
220
  export const setRoleInformation = (id, data, token) => {
192
221
  return new Promise(function (resolve, reject) {
@@ -212,6 +241,7 @@ export const setRoleInformation = (id, data, token) => {
212
241
  * @param {String} id
213
242
  * @param {Array<Object>} roles
214
243
  * @param {String} token
244
+ * @returns {Promise}
215
245
  */
216
246
  export const setUserRoles = (id, roles, roleDescription, token) => {
217
247
  return new Promise(function (resolve, reject) {
@@ -238,6 +268,7 @@ export const setUserRoles = (id, roles, roleDescription, token) => {
238
268
  * @param {String} id The id of the skill to be updated
239
269
  * @param {Boolean} watch Set to true or false
240
270
  * @param {String} token Authorization token
271
+ * @returns {Promise}
241
272
  */
242
273
  export const watchRole = (id, watch, token) => {
243
274
  return new Promise(function (resolve, reject) {
@@ -263,6 +294,7 @@ const role = {
263
294
  createRoleFromTemplate,
264
295
  deleteRole,
265
296
  discardRoleChanges,
297
+ getImportedRoleTemplates,
266
298
  getRoleInformationById,
267
299
  getRolesList,
268
300
  publishRole,
package/lib/skill.js CHANGED
@@ -4,6 +4,7 @@ import { client } from "./axiosClient.js";
4
4
  * Create skill and set information
5
5
  * @param {Object} data
6
6
  * @param {String} token Authorization token
7
+ * @returns {Promise}
7
8
  */
8
9
  export const createSkill = (data, token) => {
9
10
  return new Promise(function (resolve, reject) {
@@ -28,6 +29,7 @@ export const createSkill = (data, token) => {
28
29
  * Create skills from templates
29
30
  * @param {Array<String>} templateIds,
30
31
  * @param {String} token Authorization token
32
+ * @returns {Promise}
31
33
  */
32
34
  export const createSkillsFromTemplates = (templateIds, token) => {
33
35
  return new Promise(function (resolve, reject) {
@@ -56,6 +58,7 @@ export const createSkillsFromTemplates = (templateIds, token) => {
56
58
  * @param {String} id The id of the skill to be deleted
57
59
  * @param {String} comment The comment included with the deletion
58
60
  * @param {String} token Authorization token
61
+ * @returns {Promise}
59
62
  */
60
63
  export const deleteSkill = (id, comment, token) => {
61
64
  return new Promise(function (resolve, reject) {
@@ -81,6 +84,7 @@ export const deleteSkill = (id, comment, token) => {
81
84
  * Discard the skill draft changes
82
85
  * @param {String} id The id of the skill to be deleted
83
86
  * @param {String} token Authorization token
87
+ * @returns {Promise}
84
88
  */
85
89
  export const discardSkillChanges = (id, token) => {
86
90
  return new Promise(function (resolve, reject) {
@@ -99,11 +103,32 @@ export const discardSkillChanges = (id, token) => {
99
103
  });
100
104
  };
101
105
 
106
+ /**
107
+ * Get the list of imported skill templates
108
+ * @param {String} token
109
+ * @returns {Promise}
110
+ */
111
+ export const getImportedRoleTemplates = (token) => {
112
+ return new Promise(function (resolve, reject) {
113
+ const request = client.get(`api/v1/skills/getImportedSkillTemplates`, {
114
+ headers: { authorization: token },
115
+ });
116
+ request
117
+
118
+ .then((response) => {
119
+ resolve(response.data);
120
+ })
121
+ .catch((error) => {
122
+ reject(error);
123
+ });
124
+ });
125
+ };
126
+
102
127
  /**
103
128
  * Get the skill related roles
104
129
  * @param {String} id
105
130
  * @param {String} token
106
- * @returns
131
+ * @returns {Promise}
107
132
  */
108
133
  export const getSkillRelatedRoles = (id, token) => {
109
134
  return new Promise(function (resolve, reject) {
@@ -127,6 +152,7 @@ export const getSkillRelatedRoles = (id, token) => {
127
152
  * Get skill required assessment type
128
153
  * @param {String} id
129
154
  * @param {String} token
155
+ * @returns {Promise}
130
156
  */
131
157
  export const getSkillRequiredAssessmentType = (id, token) => {
132
158
  return new Promise(function (resolve, reject) {
@@ -150,6 +176,7 @@ export const getSkillRequiredAssessmentType = (id, token) => {
150
176
  * Get skill skill information
151
177
  * @param {String} id The id of the skill
152
178
  * @param {String} token Authorization token
179
+ * @returns {Promise}
153
180
  */
154
181
  export const getSkillInformationById = (id, version, token) => {
155
182
  return new Promise(function (resolve, reject) {
@@ -176,6 +203,7 @@ export const getSkillInformationById = (id, version, token) => {
176
203
  * @param {Boolean} includeDeleted If true it will return deleted records as well
177
204
  * @param {Boolean} returnDefaultIfVersionNotAvailable Return the default version if published not available
178
205
  * @param {String} token Authorization token
206
+ * @returns {Promise}
179
207
  */
180
208
  export const getSkillList = (
181
209
  filter,
@@ -209,6 +237,7 @@ export const getSkillList = (
209
237
  * @param {String} teamId The ID of the team for which skills will be loaded
210
238
  * @param {Number} maxDepth How many levels down in the organization the skills will be loaded
211
239
  * @param {String} token Authorization token
240
+ * @returns {Promise}
212
241
  */
213
242
  export const getTeamSkillsById = (teamId, maxDepth, token) => {
214
243
  return new Promise(function (resolve, reject) {
@@ -232,6 +261,7 @@ export const getTeamSkillsById = (teamId, maxDepth, token) => {
232
261
  * Get current user team skills
233
262
  * @param {Number} maxDepth How many levels down in the organization the skills will be loaded
234
263
  * @param {String} token Authorization token
264
+ * @returns {Promise}
235
265
  */
236
266
  export const getCurrentUserTeamSkills = (maxDepth, token) => {
237
267
  return new Promise(function (resolve, reject) {
@@ -256,6 +286,7 @@ export const getCurrentUserTeamSkills = (maxDepth, token) => {
256
286
  * @param {String} id The id of the skill to be published
257
287
  * @param {String} comment The comment to be include with the request
258
288
  * @param {String} token Authorization token
289
+ * @returns {Promise}
259
290
  */
260
291
  export const publishSkill = (id, comment, token) => {
261
292
  return new Promise(function (resolve, reject) {
@@ -279,6 +310,7 @@ export const publishSkill = (id, comment, token) => {
279
310
  * @param {String} id The id of the skill to be updated
280
311
  * @param {Object} data Data used to update the skill
281
312
  * @param {String} token Authorization token
313
+ * @returns {Promise}
282
314
  */
283
315
  export const setSkillInformation = (id, data, token) => {
284
316
  return new Promise(function (resolve, reject) {
@@ -308,6 +340,7 @@ export const setSkillInformation = (id, data, token) => {
308
340
  * @param {String} id The id of the skill to be updated
309
341
  * @param {Boolean} watch Set to true or false
310
342
  * @param {String} token Authorization token
343
+ * @returns {Promise}
311
344
  */
312
345
  export const watchSkill = (id, watch, token) => {
313
346
  return new Promise(function (resolve, reject) {
@@ -333,6 +366,7 @@ const skill = {
333
366
  createSkillsFromTemplates,
334
367
  deleteSkill,
335
368
  discardSkillChanges,
369
+ getImportedSkillTemplates,
336
370
  getSkillRelatedRoles,
337
371
  getSkillRequiredAssessmentType,
338
372
  getSkillInformationById,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.0.63",
3
+ "version": "1.0.64",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {