@stackfactor/client-api 1.0.65 → 1.0.66

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
@@ -112,7 +112,7 @@ export const discardRoleChanges = (id, token) => {
112
112
  */
113
113
  export const getImportedRoleTemplates = (token) => {
114
114
  return new Promise(function (resolve, reject) {
115
- const request = client.get(`api/v1/roles/getImportedRoleTemplates`, {
115
+ const request = client.get(`api/v1/roles/getimportedroletemplates`, {
116
116
  headers: { authorization: token },
117
117
  });
118
118
  request
@@ -186,6 +186,37 @@ export const getRolesList = (
186
186
  });
187
187
  };
188
188
 
189
+ /**
190
+ * Import role templates
191
+ * @param {Array<String>} data The list of role templates to be imported
192
+ * @param {Boolean} publish If true the imported templates will be published
193
+ * @param {String} token
194
+ * @returns {Promise}
195
+ */
196
+ export const importRoleTemplates = (data, publish, token) => {
197
+ return new Promise(function (resolve, reject) {
198
+ const requestData = {
199
+ data: data,
200
+ publish: publish,
201
+ };
202
+ let confirmationRequest = client.post(
203
+ `api/v1/roles/importtemplates`,
204
+ requestData,
205
+ {
206
+ headers: { authorization: token },
207
+ }
208
+ );
209
+ confirmationRequest
210
+
211
+ .then((response) => {
212
+ resolve(response.data);
213
+ })
214
+ .catch((error) => {
215
+ reject(error);
216
+ });
217
+ });
218
+ };
219
+
189
220
  /**
190
221
  * Publish role
191
222
  * @param {number} id The id of the role to be published
@@ -297,6 +328,7 @@ const role = {
297
328
  getImportedRoleTemplates,
298
329
  getRoleInformationById,
299
330
  getRolesList,
331
+ importRoleTemplates,
300
332
  publishRole,
301
333
  setRoleInformation,
302
334
  setUserRoles,
@@ -120,35 +120,6 @@ export const getRoleTemplateList = (filter, version, includeDeleted, token) => {
120
120
  });
121
121
  };
122
122
 
123
- /**
124
- * Import role templates
125
- * @param {Array<String>} data The list of role templates to be imported
126
- * @param {String} token
127
- * @returns
128
- */
129
- export const importRoleTemplates = (data, token) => {
130
- return new Promise(function (resolve, reject) {
131
- const requestData = {
132
- data: data,
133
- };
134
- let confirmationRequest = client.post(
135
- `api/v1/roletemplates/import`,
136
- requestData,
137
- {
138
- headers: { authorization: token },
139
- }
140
- );
141
- confirmationRequest
142
-
143
- .then((response) => {
144
- resolve(response.data);
145
- })
146
- .catch((error) => {
147
- reject(error);
148
- });
149
- });
150
- };
151
-
152
123
  /**
153
124
  * Publish template
154
125
  * @param {number} id The id of the template to be published
@@ -269,7 +240,6 @@ const roleTemplate = {
269
240
  discardRoleTemplateChanges,
270
241
  getRoleTemplateInformationById,
271
242
  getRoleTemplateList,
272
- importRoleTemplates,
273
243
  publishTemplate,
274
244
  setTemplateInformation,
275
245
  setTemplateTags,
package/lib/skill.js CHANGED
@@ -110,7 +110,7 @@ export const discardSkillChanges = (id, token) => {
110
110
  */
111
111
  export const getImportedSkillTemplates = (token) => {
112
112
  return new Promise(function (resolve, reject) {
113
- const request = client.get(`api/v1/skills/getImportedSkillTemplates`, {
113
+ const request = client.get(`api/v1/skills/getimportedskilltemplates`, {
114
114
  headers: { authorization: token },
115
115
  });
116
116
  request
@@ -281,6 +281,37 @@ export const getCurrentUserTeamSkills = (maxDepth, token) => {
281
281
  });
282
282
  };
283
283
 
284
+ /**
285
+ * Import skill templates
286
+ * @param {Array<String>} data The list of role templates to be imported
287
+ * @param {Boolean} publish If true the imported templates will be published
288
+ * @param {String} token
289
+ * @returns {Promise}
290
+ */
291
+ export const importSkillTemplates = (data, publish, token) => {
292
+ return new Promise(function (resolve, reject) {
293
+ const requestData = {
294
+ data: data,
295
+ publish: publish,
296
+ };
297
+ let confirmationRequest = client.post(
298
+ `api/v1/skills/importtemplates`,
299
+ requestData,
300
+ {
301
+ headers: { authorization: token },
302
+ }
303
+ );
304
+ confirmationRequest
305
+
306
+ .then((response) => {
307
+ resolve(response.data);
308
+ })
309
+ .catch((error) => {
310
+ reject(error);
311
+ });
312
+ });
313
+ };
314
+
284
315
  /**
285
316
  * Publish skill
286
317
  * @param {String} id The id of the skill to be published
@@ -373,6 +404,7 @@ const skill = {
373
404
  getSkillList,
374
405
  getTeamSkillsById,
375
406
  getCurrentUserTeamSkills,
407
+ importSkillTemplates,
376
408
  publishSkill,
377
409
  setSkillInformation,
378
410
  watchSkill,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.0.65",
3
+ "version": "1.0.66",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {