@stackfactor/client-api 1.0.91 → 1.0.92

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.
@@ -49,17 +49,17 @@ export const markNotifications = (ids, status, authToken) => {
49
49
  * Process a notification
50
50
  * @param {String} id The notification id
51
51
  * @param {String} action The action to be executed
52
- * @param {String} comment The comment to be saved in the notification
52
+ * @param {String} comments The comments to be saved in the notification
53
53
  * @param {String} authToken The authentication token
54
54
  */
55
- export const processNotification = (id, action, comment, authToken) => {
55
+ export const processNotification = (id, action, comments, authToken) => {
56
56
  return new Promise(function (resolve, reject) {
57
57
  const request = client.put(
58
58
  `api/v1/actionnotifications/process`,
59
59
  {
60
60
  id: id,
61
61
  action: action,
62
- comment: comment,
62
+ comments: comments,
63
63
  },
64
64
  { headers: { authorization: authToken } }
65
65
  );
@@ -31,15 +31,15 @@ const createLearningContent = (data, token) => {
31
31
  /**
32
32
  * Delete learning content
33
33
  * @param {String} id The id of the learning content to be deleted
34
- * @param {String} comment The comment included with the deletion
34
+ * @param {String} comments The comments included with the deletion
35
35
  * @param {String} token Authorization token
36
36
  * @returns {Promise<Object>} The response from the server
37
37
  */
38
- export const deleteLearningContent = (id, comment, token) => {
38
+ export const deleteLearningContent = (id, comments, token) => {
39
39
  const data = {
40
40
  id: id,
41
41
  };
42
- if (comment) data.comment = comment;
42
+ if (comments) data.comments = comments;
43
43
  return new Promise(function (resolve, reject) {
44
44
  const request = client.delete(`api/v1/learningcontent/`, {
45
45
  headers: { authorization: token },
@@ -143,14 +143,14 @@ export const getLearningContentList = (
143
143
  /**
144
144
  * Publish learning content
145
145
  * @param {String} id The id of the content to be published
146
- * @param {String} comment The comment to be include with the request
146
+ * @param {String} comments The comments to be include with the request
147
147
  * @param {String} token Authorization token
148
148
  * @returns {Promise<Object>} The response from the server
149
149
  */
150
- export const publishLearningContent = (id, comment, token) => {
150
+ export const publishLearningContent = (id, comments, token) => {
151
151
  return new Promise(function (resolve, reject) {
152
152
  let data = {};
153
- if (comment) data.comment = comment;
153
+ if (comments) data.comments = comments;
154
154
 
155
155
  let confirmationRequest = client.post(
156
156
  `api/v1/learningcontent/publish/${id}`,
@@ -27,15 +27,15 @@ export const createLearningPath = (data, token) => {
27
27
  /**
28
28
  * Delete learning path
29
29
  * @param {String} id The id of the template to be deleted
30
- * @param {String} comment The comment for approver
30
+ * @param {String} comments The comments for approver
31
31
  * @param {String} token Authorization token
32
32
  */
33
- export const deleteLearningPath = (id, comment, token) => {
33
+ export const deleteLearningPath = (id, comments, token) => {
34
34
  return new Promise(function (resolve, reject) {
35
35
  const data = {
36
36
  id: id,
37
37
  };
38
- if (comment) data.comment = comment;
38
+ if (comments) data.comments = comments;
39
39
  const request = client.delete(`api/v1/learningpaths/`, {
40
40
  headers: { authorization: token },
41
41
  data: data,
@@ -124,13 +124,13 @@ export const getLearningPathsList = (list, version, includeDeleted, token) => {
124
124
  /**
125
125
  * Publish training pplan template
126
126
  * @param {String} id The id of the template to be published
127
- * @param {String} comment The comment to be include with the request
127
+ * @param {String} comments The comments to be include with the request
128
128
  * @param {String} token Authorization token
129
129
  */
130
- export const publishLearningPath = (id, comment, token) => {
130
+ export const publishLearningPath = (id, comments, token) => {
131
131
  return new Promise(function (resolve, reject) {
132
132
  let data = {};
133
- if (comment) data.comment = comment;
133
+ if (comments) data.comments = comments;
134
134
  let confirmationRequest = client.post(
135
135
  `api/v1/learningpaths/publish/${id}`,
136
136
  data,
package/lib/logger.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { client } from "./axiosClient.js";
2
2
 
3
3
  /**
4
- * Create a comment for a specified element id
4
+ * Create comments for a specified element id
5
5
  * @param {String} elementId
6
6
  * @param {String} elementType
7
7
  * @param {Object} data
8
8
  * @param {String} token Authorization token
9
9
  */
10
- export const comment = (elementId, elementType, data, token) => {
10
+ export const comments = (elementId, elementType, data, token) => {
11
11
  return new Promise(function (resolve, reject) {
12
12
  let confirmationRequest = client.post(
13
- "api/v1/logger/comment/",
13
+ "api/v1/logger/comments/",
14
14
  {
15
15
  data: data,
16
16
  elementId: elementId,
@@ -55,6 +55,6 @@ export const getListByElementId = (elementId, page, elementsPerPage, token) => {
55
55
  });
56
56
  };
57
57
 
58
- const logger = { comment, getListByElementId };
58
+ const logger = { comments, getListByElementId };
59
59
 
60
60
  export default logger;
package/lib/role.js CHANGED
@@ -58,16 +58,16 @@ export const createRoleFromTemplate = (templateId, data, token) => {
58
58
  /**
59
59
  * Delete role
60
60
  * @param {String} id The id of the role to be deleted
61
- * @param {String} comment The comment included with the deletion
61
+ * @param {String} comments The comments included with the deletion
62
62
  * @param {String} token Authorization token
63
63
  * @returns {Promise}
64
64
  */
65
- export const deleteRole = (id, comment, token) => {
65
+ export const deleteRole = (id, comments, token) => {
66
66
  return new Promise(function (resolve, reject) {
67
67
  const data = {
68
68
  id: id,
69
69
  };
70
- if (comment) data.comment = comment;
70
+ if (comments) data.comments = comments;
71
71
  const request = client.delete(`api/v1/roles/`, {
72
72
  headers: { authorization: token },
73
73
  data: data,
@@ -231,14 +231,14 @@ export const importRoleTemplates = (data, token) => {
231
231
  /**
232
232
  * Publish role
233
233
  * @param {number} id The id of the role to be published
234
- * @param {String} comment The comment to be include with the request
234
+ * @param {String} comments The comments to be include with the request
235
235
  * @param {String} token Authorization token
236
236
  * @returns {Promise}
237
237
  */
238
- export const publishRole = (id, comment, token) => {
238
+ export const publishRole = (id, comments, token) => {
239
239
  return new Promise(function (resolve, reject) {
240
240
  let data = {};
241
- if (comment) data.comment = comment;
241
+ if (comments) data.comments = comments;
242
242
  let confirmationRequest = client.post(`api/v1/roles/publish/${id}`, data, {
243
243
  headers: { authorization: token },
244
244
  });
@@ -26,15 +26,15 @@ export const createRoleTemplate = (data, token) => {
26
26
  /**
27
27
  * Delete role template
28
28
  * @param {String} id The id of the template to be deleted
29
- * @param {String} comment The comment included with the deletion
29
+ * @param {String} comments The comments included with the deletion
30
30
  * @param {String} token Authorization token
31
31
  */
32
- export const deleteRoleTemplate = (id, comment, token) => {
32
+ export const deleteRoleTemplate = (id, comments, token) => {
33
33
  return new Promise(function (resolve, reject) {
34
34
  const data = {
35
35
  id: id,
36
36
  };
37
- if (comment) data.comment = comment;
37
+ if (comments) data.comments = comments;
38
38
  const request = client.delete(`api/v1/roletemplates/`, {
39
39
  headers: { authorization: token },
40
40
  data: data,
@@ -132,13 +132,13 @@ export const getRoleTemplateList = (
132
132
  /**
133
133
  * Publish template
134
134
  * @param {number} id The id of the template to be published
135
- * @param {String} comment The comment to be include with the request
135
+ * @param {String} comments The comments to be include with the request
136
136
  * @param {String} token Authorization token
137
137
  */
138
- export const publishTemplate = (id, comment, token) => {
138
+ export const publishTemplate = (id, comments, token) => {
139
139
  return new Promise(function (resolve, reject) {
140
140
  let data = {};
141
- if (comment) data.comment = comment;
141
+ if (comments) data.comments = comments;
142
142
  let confirmationRequest = client.post(
143
143
  `api/v1/roletemplates/publish/${id}`,
144
144
  data,
package/lib/skill.js CHANGED
@@ -56,16 +56,16 @@ export const createSkillsFromTemplates = (templateIds, token) => {
56
56
  /**
57
57
  * Delete skill
58
58
  * @param {String} id The id of the skill to be deleted
59
- * @param {String} comment The comment included with the deletion
59
+ * @param {String} comments The comments included with the deletion
60
60
  * @param {String} token Authorization token
61
61
  * @returns {Promise}
62
62
  */
63
- export const deleteSkill = (id, comment, token) => {
63
+ export const deleteSkill = (id, comments, token) => {
64
64
  return new Promise(function (resolve, reject) {
65
65
  const data = {
66
66
  id: id,
67
67
  };
68
- if (comment) data.comment = comment;
68
+ if (comments) data.comments = comments;
69
69
  const request = client.delete(`api/v1/skills/`, {
70
70
  headers: { authorization: token },
71
71
  data: data,
@@ -331,14 +331,14 @@ export const importSkillTemplates = (data, publish, token) => {
331
331
  /**
332
332
  * Publish skill
333
333
  * @param {String} id The id of the skill to be published
334
- * @param {String} comment The comment to be include with the request
334
+ * @param {String} comments The comments to be include with the request
335
335
  * @param {String} token Authorization token
336
336
  * @returns {Promise}
337
337
  */
338
- export const publishSkill = (id, comment, token) => {
338
+ export const publishSkill = (id, comments, token) => {
339
339
  return new Promise(function (resolve, reject) {
340
340
  let data = {};
341
- if (comment) data.comment = comment;
341
+ if (comments) data.comments = comments;
342
342
  let confirmationRequest = client.post(`api/v1/skills/publish/${id}`, data, {
343
343
  headers: { authorization: token },
344
344
  });
@@ -65,7 +65,7 @@ export const create = (data, comments, userId, token) => {
65
65
  /**
66
66
  * Delete skill assessment
67
67
  * @param {number} id The id of the skill to be deleted
68
- * @param {String} comments The comment included with the deletion
68
+ * @param {String} comments The comments included with the deletion
69
69
  * @param {String} token Authorization token
70
70
  */
71
71
  export const deleteSkillAssessment = (id, comments, token) => {
@@ -26,14 +26,14 @@ export const createSkillTemplate = (data, token) => {
26
26
  /**
27
27
  * Delete skill template
28
28
  * @param {number} id The id of the template to be deleted
29
- * @param {String} comment The comment included with the deletion
29
+ * @param {String} comments The comments included with the deletion
30
30
  * @param {String} token Authorization token
31
31
  */
32
- export const deleteSkillTemplate = (id, comment, token) => {
32
+ export const deleteSkillTemplate = (id, comments, token) => {
33
33
  const data = {
34
34
  id: id,
35
35
  };
36
- if (comment) data.comment = comment;
36
+ if (comments) data.comments = comments;
37
37
  return new Promise(function (resolve, reject) {
38
38
  const request = client.delete(`api/v1/skilltemplates/`, {
39
39
  headers: { authorization: token },
@@ -162,14 +162,13 @@ export const getTechnologyStacks = (token) => {
162
162
  /**
163
163
  * Publish template
164
164
  * @param {number} id The id of the template to be published
165
- * @param {String} comment The comment to be include with the request
165
+ * @param {String} comments The comments to be include with the request
166
166
  * @param {String} token Authorization token
167
167
  */
168
- export const publishTemplate = (id, comment, token) => {
168
+ export const publishTemplate = (id, comments, token) => {
169
169
  return new Promise(function (resolve, reject) {
170
170
  let data = {};
171
- if (comment) data.comment = comment;
172
-
171
+ if (comments) data.comments = comments;
173
172
  let confirmationRequest = client.post(
174
173
  `api/v1/skilltemplates/publish/${id}`,
175
174
  data,
@@ -32,15 +32,15 @@ export const createTrainingPlan = (data, type, saveAsDraft, token) => {
32
32
  /**
33
33
  * Delete training plan
34
34
  * @param {String} id The id of the training plan to be deleted
35
- * @param {String} comment The comment for approver
35
+ * @param {String} comments The comments for approver
36
36
  * @param {String} token Authorization token
37
37
  */
38
- export const deleteTrainingPlan = (id, comment, token) => {
38
+ export const deleteTrainingPlan = (id, comments, token) => {
39
39
  return new Promise(function (resolve, reject) {
40
40
  const data = {
41
41
  id: id,
42
42
  };
43
- if (comment) data.comment = comment;
43
+ if (comments) data.comments = comments;
44
44
  const request = client.delete(`api/v1/trainingplans/`, {
45
45
  headers: { authorization: token },
46
46
  data: data,
@@ -183,13 +183,13 @@ export const getListOfTrainingPlans = (
183
183
  /**
184
184
  * Publish training plan
185
185
  * @param {String} id The id of the template to be published
186
- * @param {String} comment The comment to be include with the request
186
+ * @param {String} comments The comments to be include with the request
187
187
  * @param {String} token Authorization token
188
188
  */
189
- export const publishTrainingPlan = (id, comment, token) => {
189
+ export const publishTrainingPlan = (id, comments, token) => {
190
190
  return new Promise(function (resolve, reject) {
191
191
  let data = {};
192
- if (comment) data.comment = comment;
192
+ if (comments) data.comments = comments;
193
193
  let confirmationRequest = client.post(
194
194
  `api/v1/trainingplans/publish/${id}`,
195
195
  data,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.0.91",
3
+ "version": "1.0.92",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {