@stackfactor/client-api 1.1.53 → 1.1.55

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.
@@ -5,7 +5,7 @@ import { client } from "./axiosClient.js";
5
5
  * @param {Object} data
6
6
  * @param {String} token Authorization token
7
7
  */
8
- export const createRoleTemplate = (data, token) => {
8
+ const createRoleTemplate = (data, token) => {
9
9
  return new Promise(function (resolve, reject) {
10
10
  const requestData = {
11
11
  data: data,
@@ -29,7 +29,7 @@ export const createRoleTemplate = (data, token) => {
29
29
  * @param {String} comments The comments included with the deletion
30
30
  * @param {String} token Authorization token
31
31
  */
32
- export const deleteRoleTemplate = (id, comments, token) => {
32
+ const deleteRoleTemplate = (id, comments, token) => {
33
33
  return new Promise(function (resolve, reject) {
34
34
  const data = {
35
35
  id: id,
@@ -54,7 +54,7 @@ export const deleteRoleTemplate = (id, comments, token) => {
54
54
  * @param {String} id The id of the role template to be deleted
55
55
  * @param {String} token Authorization token
56
56
  */
57
- export const discardRoleTemplateChanges = (id, token) => {
57
+ const discardRoleTemplateChanges = (id, token) => {
58
58
  return new Promise(function (resolve, reject) {
59
59
  const data = {};
60
60
  const request = client.get(`api/v1/roletemplates/discard/${id}`, {
@@ -76,7 +76,7 @@ export const discardRoleTemplateChanges = (id, token) => {
76
76
  * @param {String} id The id of the template
77
77
  * @param {String} token Authorization token
78
78
  */
79
- export const getRoleTemplateInformationById = (id, version, token) => {
79
+ const getRoleTemplateInformationById = (id, version, token) => {
80
80
  return new Promise(function (resolve, reject) {
81
81
  let confirmationRequest = client.get(
82
82
  `api/v1/roletemplates/${id}/${version}`,
@@ -102,7 +102,7 @@ export const getRoleTemplateInformationById = (id, version, token) => {
102
102
  * @param {Boolean} namesOnly When true it will return only the names of the templates
103
103
  * @param {String} token Authorization token
104
104
  */
105
- export const getRoleTemplateList = (
105
+ const getRoleTemplateList = (
106
106
  filter,
107
107
  version,
108
108
  includeDeleted,
@@ -135,7 +135,7 @@ export const getRoleTemplateList = (
135
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, comments, token) => {
138
+ const publishTemplate = (id, comments, token) => {
139
139
  return new Promise(function (resolve, reject) {
140
140
  let data = {};
141
141
  if (comments) data.comments = comments;
@@ -162,7 +162,7 @@ export const publishTemplate = (id, comments, token) => {
162
162
  * @param {Object} data Data used to update the template
163
163
  * @param {String} token Authorization token
164
164
  */
165
- export const setTemplateInformation = (id, data, token) => {
165
+ const setTemplateInformation = (id, data, token) => {
166
166
  return new Promise(function (resolve, reject) {
167
167
  const requestData = {
168
168
  data: data,
@@ -191,7 +191,7 @@ export const setTemplateInformation = (id, data, token) => {
191
191
  * @param {Object} tags Updated template tags
192
192
  * @param {String} token Authorization token
193
193
  */
194
- export const setTemplateTags = (id, tags, token) => {
194
+ const setTemplateTags = (id, tags, token) => {
195
195
  return new Promise(function (resolve, reject) {
196
196
  const requestData = {
197
197
  tags: tags,
@@ -220,7 +220,7 @@ export const setTemplateTags = (id, tags, token) => {
220
220
  * @param {Boolean} watch Set to true or false
221
221
  * @param {String} token Authorization token
222
222
  */
223
- export const watchRoleTemplate = (id, watch, token) => {
223
+ const watchRoleTemplate = (id, watch, token) => {
224
224
  return new Promise(function (resolve, reject) {
225
225
  const requestData = {
226
226
  id: id,
package/lib/skill.js CHANGED
@@ -6,7 +6,7 @@ import { client } from "./axiosClient.js";
6
6
  * @param {String} token Authorization token
7
7
  * @returns {Promise}
8
8
  */
9
- export const createSkill = (data, token) => {
9
+ const createSkill = (data, token) => {
10
10
  return new Promise(function (resolve, reject) {
11
11
  let confirmationRequest = client.put(
12
12
  "api/v1/skills",
@@ -31,7 +31,7 @@ export const createSkill = (data, token) => {
31
31
  * @param {String} token Authorization token
32
32
  * @returns {Promise}
33
33
  */
34
- export const createSkillsFromTemplates = (templateIds, token) => {
34
+ const createSkillsFromTemplates = (templateIds, token) => {
35
35
  return new Promise(function (resolve, reject) {
36
36
  const requestData = {
37
37
  templateIds: templateIds,
@@ -60,7 +60,7 @@ export const createSkillsFromTemplates = (templateIds, token) => {
60
60
  * @param {String} token Authorization token
61
61
  * @returns {Promise}
62
62
  */
63
- export const deleteSkill = (id, comments, token) => {
63
+ const deleteSkill = (id, comments, token) => {
64
64
  return new Promise(function (resolve, reject) {
65
65
  const data = {
66
66
  id: id,
@@ -86,7 +86,7 @@ export const deleteSkill = (id, comments, token) => {
86
86
  * @param {String} token Authorization token
87
87
  * @returns {Promise}
88
88
  */
89
- export const discardSkillChanges = (id, token) => {
89
+ const discardSkillChanges = (id, token) => {
90
90
  return new Promise(function (resolve, reject) {
91
91
  const data = {};
92
92
  const request = client.get(`api/v1/skills/discard/${id}`, {
@@ -108,7 +108,7 @@ export const discardSkillChanges = (id, token) => {
108
108
  * @param {String} token
109
109
  * @returns {Promise}
110
110
  */
111
- export const getImportedSkillTemplates = (token) => {
111
+ const getImportedSkillTemplates = (token) => {
112
112
  return new Promise(function (resolve, reject) {
113
113
  const request = client.get(`api/v1/skills/getimportedskilltemplates`, {
114
114
  headers: { authorization: token },
@@ -130,7 +130,7 @@ export const getImportedSkillTemplates = (token) => {
130
130
  * @param {String} token
131
131
  * @returns {Promise}
132
132
  */
133
- export const getSkillRelatedRoles = (id, token) => {
133
+ const getSkillRelatedRoles = (id, token) => {
134
134
  return new Promise(function (resolve, reject) {
135
135
  let confirmationRequest = client.get(
136
136
  `api/v1/skills/getskillrelatedroles/${id}`,
@@ -154,7 +154,7 @@ export const getSkillRelatedRoles = (id, token) => {
154
154
  * @param {String} token
155
155
  * @returns {Promise}
156
156
  */
157
- export const getSkillRequiredAssessmentType = (id, token) => {
157
+ const getSkillRequiredAssessmentType = (id, token) => {
158
158
  return new Promise(function (resolve, reject) {
159
159
  let confirmationRequest = client.get(
160
160
  `api/v1/skills/getrequiredassessmenttype/${id}`,
@@ -180,7 +180,7 @@ export const getSkillRequiredAssessmentType = (id, token) => {
180
180
  * @param {String} token Authorization token
181
181
  * @returns {Promise}
182
182
  */
183
- export const getSkillInformationById = (
183
+ const getSkillInformationById = (
184
184
  id,
185
185
  version,
186
186
  returnNullIfVersionNotFound,
@@ -213,7 +213,7 @@ export const getSkillInformationById = (
213
213
  * @param {String} token Authorization token
214
214
  * @returns {Promise}
215
215
  */
216
- export const getSkillList = (
216
+ const getSkillList = (
217
217
  filter,
218
218
  version,
219
219
  includeDeleted,
@@ -250,7 +250,7 @@ export const getSkillList = (
250
250
  * @param {String} token Authorization token
251
251
  * @returns {Promise}
252
252
  */
253
- export const getTeamSkillsById = (
253
+ const getTeamSkillsById = (
254
254
  teamId,
255
255
  maxDepth,
256
256
  returnNullIfVersionNotFound,
@@ -279,7 +279,7 @@ export const getTeamSkillsById = (
279
279
  * @param {String} token Authorization token
280
280
  * @returns {Promise}
281
281
  */
282
- export const getCurrentUserTeamSkills = (maxDepth, token) => {
282
+ const getCurrentUserTeamSkills = (maxDepth, token) => {
283
283
  return new Promise(function (resolve, reject) {
284
284
  let confirmationRequest = client.get(
285
285
  `api/v1/skills/getcurrentuserteam/${maxDepth}`,
@@ -303,7 +303,7 @@ export const getCurrentUserTeamSkills = (maxDepth, token) => {
303
303
  * @param {String} token
304
304
  * @returns {Promise}
305
305
  */
306
- export const getSkillTemplateUpdates = (id, token) => {
306
+ const getSkillTemplateUpdates = (id, token) => {
307
307
  return new Promise(function (resolve, reject) {
308
308
  let confirmationRequest = client.get(
309
309
  `api/v1/skills/getskilltemplateupdates/${id}`,
@@ -328,7 +328,7 @@ export const getSkillTemplateUpdates = (id, token) => {
328
328
  * @param {String} token
329
329
  * @returns {Promise}
330
330
  */
331
- export const importSkillTemplates = (data, publish, token) => {
331
+ const importSkillTemplates = (data, publish, token) => {
332
332
  return new Promise(function (resolve, reject) {
333
333
  const requestData = {
334
334
  data: data,
@@ -359,7 +359,7 @@ export const importSkillTemplates = (data, publish, token) => {
359
359
  * @param {String} token Authorization token
360
360
  * @returns {Promise}
361
361
  */
362
- export const publishSkill = (id, comments, token) => {
362
+ const publishSkill = (id, comments, token) => {
363
363
  return new Promise(function (resolve, reject) {
364
364
  let data = {};
365
365
  if (comments) data.comments = comments;
@@ -383,7 +383,7 @@ export const publishSkill = (id, comments, token) => {
383
383
  * @param {String} token Authorization token
384
384
  * @returns {Promise}
385
385
  */
386
- export const setSkillInformation = (id, data, token) => {
386
+ const setSkillInformation = (id, data, token) => {
387
387
  return new Promise(function (resolve, reject) {
388
388
  const requestData = {
389
389
  data: data,
@@ -413,7 +413,7 @@ export const setSkillInformation = (id, data, token) => {
413
413
  * @param {String} token Authorization token
414
414
  * @returns {Promise}
415
415
  */
416
- export const setSkillInformationFromTemplate = (id, data, token) => {
416
+ const setSkillInformationFromTemplate = (id, data, token) => {
417
417
  return new Promise(function (resolve, reject) {
418
418
  const requestData = {
419
419
  data: data,
@@ -442,7 +442,7 @@ export const setSkillInformationFromTemplate = (id, data, token) => {
442
442
  * @param {String} token Authorization token
443
443
  * @returns {Promise}
444
444
  */
445
- export const validateSkill = (id, token) => {
445
+ const validateSkill = (id, token) => {
446
446
  return new Promise(function (resolve, reject) {
447
447
  const requestData = {
448
448
  id: id,
@@ -471,7 +471,7 @@ export const validateSkill = (id, token) => {
471
471
  * @param {String} token Authorization token
472
472
  * @returns {Promise}
473
473
  */
474
- export const watchSkill = (id, watch, token) => {
474
+ const watchSkill = (id, watch, token) => {
475
475
  return new Promise(function (resolve, reject) {
476
476
  const requestData = {
477
477
  id: id,
@@ -5,7 +5,7 @@ import { client } from "./axiosClient.js";
5
5
  * @param {String} testingSessionId
6
6
  * @param {String} token Authorization token
7
7
  */
8
- export const endSession = (testingSessionId, token) => {
8
+ const endSession = (testingSessionId, token) => {
9
9
  return new Promise(function (resolve, reject) {
10
10
  let confirmationRequest = client.put(
11
11
  "api/v1/skillassessmenttestingsession/endsession",
@@ -30,7 +30,7 @@ export const endSession = (testingSessionId, token) => {
30
30
  * @param {Array<String>} selectedAnswers
31
31
  * @param {String} token Authorization token
32
32
  */
33
- export const getNextStep = (testingSessionId, selectedAnswers, token) => {
33
+ const getNextStep = (testingSessionId, selectedAnswers, token) => {
34
34
  return new Promise(function (resolve, reject) {
35
35
  let data = {
36
36
  id: testingSessionId,
@@ -60,7 +60,7 @@ export const getNextStep = (testingSessionId, selectedAnswers, token) => {
60
60
  * @param {String} token
61
61
  * @returns
62
62
  */
63
- export const getSkillTestAssessment = (userId, skillId, token) => {
63
+ const getSkillTestAssessment = (userId, skillId, token) => {
64
64
  return new Promise(function (resolve, reject) {
65
65
  let confirmationRequest = client.post(
66
66
  `api/v1/skillassessmenttestingsession/getbyuserandskill`,
@@ -88,7 +88,7 @@ export const getSkillTestAssessment = (userId, skillId, token) => {
88
88
  * @param {String} token
89
89
  * @returns
90
90
  */
91
- export const pause = (testingSessionId, token) => {
91
+ const pause = (testingSessionId, token) => {
92
92
  return new Promise(function (resolve, reject) {
93
93
  let confirmationRequest = client.post(
94
94
  `api/v1/skillassessmenttestingsession/pausesession`,
@@ -115,7 +115,7 @@ export const pause = (testingSessionId, token) => {
115
115
  * @param {Boolean} saveSession
116
116
  * @param {String} token
117
117
  */
118
- export const startSession = (skillId, saveSession, token) => {
118
+ const startSession = (skillId, saveSession, token) => {
119
119
  return new Promise(function (resolve, reject) {
120
120
  let confirmationRequest = client.post(
121
121
  "api/v1/skillassessmenttestingsession/startsession",
@@ -7,7 +7,7 @@ import { client } from "./axiosClient.js";
7
7
  * @param {String} comments
8
8
  * @param {String} token Authorization token
9
9
  */
10
- export const addEntry = (id, data, comments, token) => {
10
+ const addEntry = (id, data, comments, token) => {
11
11
  return new Promise(function (resolve, reject) {
12
12
  const requestData = {
13
13
  comments: comments,
@@ -38,7 +38,7 @@ export const addEntry = (id, data, comments, token) => {
38
38
  * @param {String} userId
39
39
  * @param {String} token Authorization token
40
40
  */
41
- export const create = (data, comments, userId, token) => {
41
+ const create = (data, comments, userId, token) => {
42
42
  return new Promise(function (resolve, reject) {
43
43
  const requestData = {
44
44
  comments: comments,
@@ -68,7 +68,7 @@ export const create = (data, comments, userId, token) => {
68
68
  * @param {String} comments The comments included with the deletion
69
69
  * @param {String} token Authorization token
70
70
  */
71
- export const deleteSkillAssessment = (id, comments, token) => {
71
+ const deleteSkillAssessment = (id, comments, token) => {
72
72
  return new Promise(function (resolve, reject) {
73
73
  const data = {
74
74
  id: id,
@@ -93,7 +93,7 @@ export const deleteSkillAssessment = (id, comments, token) => {
93
93
  * @param {String} id
94
94
  * @param {String} token
95
95
  */
96
- export const getById = (id, token) => {
96
+ const getById = (id, token) => {
97
97
  return new Promise(function (resolve, reject) {
98
98
  let confirmationRequest = client.get(`api/v1/skillassessments/${id}`, {
99
99
  headers: { authorization: token },
@@ -113,7 +113,7 @@ export const getById = (id, token) => {
113
113
  * @param {Object} userId The user used to select the skill
114
114
  * @param {String} token Authorization token
115
115
  */
116
- export const getList = (userId, token) => {
116
+ const getList = (userId, token) => {
117
117
  return new Promise(function (resolve, reject) {
118
118
  const requestData = {};
119
119
  if (userId) requestData.userId = userId;
@@ -5,7 +5,7 @@ import { client } from "./axiosClient.js";
5
5
  * @param {Object} data
6
6
  * @param {String} token Authorization token
7
7
  */
8
- export const createSkillTemplate = (data, token) => {
8
+ const createSkillTemplate = (data, token) => {
9
9
  return new Promise(function (resolve, reject) {
10
10
  const requestData = {
11
11
  data: data,
@@ -29,7 +29,7 @@ export const createSkillTemplate = (data, token) => {
29
29
  * @param {String} comments The comments included with the deletion
30
30
  * @param {String} token Authorization token
31
31
  */
32
- export const deleteSkillTemplate = (id, comments, token) => {
32
+ const deleteSkillTemplate = (id, comments, token) => {
33
33
  const data = {
34
34
  id: id,
35
35
  };
@@ -54,7 +54,7 @@ export const deleteSkillTemplate = (id, comments, token) => {
54
54
  * @param {String} id The id of the skill template to be deleted
55
55
  * @param {String} token Authorization token
56
56
  */
57
- export const discardSkillTemplateChanges = (id, token) => {
57
+ const discardSkillTemplateChanges = (id, token) => {
58
58
  return new Promise(function (resolve, reject) {
59
59
  const data = {};
60
60
  const request = client.get(`api/v1/skilltemplates/discard/${id}`, {
@@ -78,7 +78,7 @@ export const discardSkillTemplateChanges = (id, token) => {
78
78
  * @param {Boolean} returnNullIfVersionNotFound When true it will return null if the version is not found
79
79
  * @param {String} token Authorization token
80
80
  */
81
- export const getSkillTemplateInformationById = (
81
+ const getSkillTemplateInformationById = (
82
82
  id,
83
83
  version,
84
84
  returnNullIfVersionNotFound,
@@ -109,7 +109,7 @@ export const getSkillTemplateInformationById = (
109
109
  * @param {Boolean} namesOnly When true it will return only the names of the templates
110
110
  * @param {String} token Authorization token
111
111
  */
112
- export const getSkillTemplateList = (
112
+ const getSkillTemplateList = (
113
113
  filter,
114
114
  version,
115
115
  includeDeleted,
@@ -144,7 +144,7 @@ export const getSkillTemplateList = (
144
144
  * Get skill tecnology stacks template list
145
145
  * @param {String} token Authorization token
146
146
  */
147
- export const getTechnologyStacks = (token) => {
147
+ const getTechnologyStacks = (token) => {
148
148
  return new Promise(function (resolve, reject) {
149
149
  let confirmationRequest = client.get(`api/v1/skilltemplates/stacks`, {
150
150
  headers: { authorization: token },
@@ -165,7 +165,7 @@ export const getTechnologyStacks = (token) => {
165
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, comments, token) => {
168
+ const publishTemplate = (id, comments, token) => {
169
169
  return new Promise(function (resolve, reject) {
170
170
  let data = {};
171
171
  if (comments) data.comments = comments;
@@ -192,7 +192,7 @@ export const publishTemplate = (id, comments, token) => {
192
192
  * @param {Object} data Data used to update the template
193
193
  * @param {String} token Authorization token
194
194
  */
195
- export const setTemplateInformation = (id, data, token) => {
195
+ const setTemplateInformation = (id, data, token) => {
196
196
  return new Promise(function (resolve, reject) {
197
197
  const requestData = {
198
198
  data: data,
@@ -221,7 +221,7 @@ export const setTemplateInformation = (id, data, token) => {
221
221
  * @param {Object} tags Updated template tags
222
222
  * @param {String} token Authorization token
223
223
  */
224
- export const setTemplateTags = (id, tags, token) => {
224
+ const setTemplateTags = (id, tags, token) => {
225
225
  return new Promise(function (resolve, reject) {
226
226
  const requestData = {
227
227
  tags: tags,
@@ -250,7 +250,7 @@ export const setTemplateTags = (id, tags, token) => {
250
250
  * @param {String} token Authorization token
251
251
  * @returns {Promise}
252
252
  */
253
- export const validateTemplate = (id, token) => {
253
+ const validateTemplate = (id, token) => {
254
254
  return new Promise(function (resolve, reject) {
255
255
  const requestData = {
256
256
  id: id,
@@ -278,7 +278,7 @@ export const validateTemplate = (id, token) => {
278
278
  * @param {Boolean} watch Set to true or false
279
279
  * @param {String} token Authorization token
280
280
  */
281
- export const watchSkillTemplate = (id, watch, token) => {
281
+ const watchSkillTemplate = (id, watch, token) => {
282
282
  return new Promise(function (resolve, reject) {
283
283
  const requestData = {
284
284
  id: id,
package/lib/teams.js CHANGED
@@ -6,7 +6,7 @@ import { client } from "./axiosClient.js";
6
6
  * @param {Array<String>} users The users to be added
7
7
  * @param {String} authToken - Authentication token
8
8
  */
9
- export const addUsersToTeam = (teamId, users, authToken) => {
9
+ const addUsersToTeam = (teamId, users, authToken) => {
10
10
  return new Promise(function (resolve, reject) {
11
11
  const request = client.post(
12
12
  `api/v1/teams/users/add`,
@@ -33,7 +33,7 @@ export const addUsersToTeam = (teamId, users, authToken) => {
33
33
  * @param {String} description The description of the team
34
34
  * @param {String} authToken The authorization token
35
35
  */
36
- export const createTeam = (name, managerId, description, authToken) => {
36
+ const createTeam = (name, managerId, description, authToken) => {
37
37
  return new Promise(function (resolve, reject) {
38
38
  const request = client.post(
39
39
  `api/v1/teams/team`,
@@ -60,7 +60,7 @@ export const createTeam = (name, managerId, description, authToken) => {
60
60
  * @param {String} defaultTeamId The default team all the users will be moved to
61
61
  * @param {String} authToken The authentication token
62
62
  */
63
- export const deleteTeam = (teamId, defaultTeamId, authToken) => {
63
+ const deleteTeam = (teamId, defaultTeamId, authToken) => {
64
64
  return new Promise(function (resolve, reject) {
65
65
  const request = client.delete(`api/v1/teams/delete`, {
66
66
  headers: { authorization: authToken },
@@ -85,11 +85,7 @@ export const deleteTeam = (teamId, defaultTeamId, authToken) => {
85
85
  * @param {Boolean} includeUserSummaryInformation True if request to load user summary information
86
86
  * @param {String} authToken The authentication token
87
87
  */
88
- export const getTeamById = (
89
- teamId,
90
- includeUserSummaryInformation,
91
- authToken
92
- ) => {
88
+ const getTeamById = (teamId, includeUserSummaryInformation, authToken) => {
93
89
  return new Promise(function (resolve, reject) {
94
90
  const request = client.post(
95
91
  `api/v1/teams/team/${teamId}`,
@@ -113,7 +109,7 @@ export const getTeamById = (
113
109
  * @param {String} teamId The team Id
114
110
  * @param {String} authToken The authentication token
115
111
  */
116
- export const getTeamByIdRoles = (teamId, authToken) => {
112
+ const getTeamByIdRoles = (teamId, authToken) => {
117
113
  return new Promise(function (resolve, reject) {
118
114
  const request = client.get(`api/v1/teams/getroles/${teamId}`, {
119
115
  headers: { authorization: authToken },
@@ -133,7 +129,7 @@ export const getTeamByIdRoles = (teamId, authToken) => {
133
129
  * @param {String} userId
134
130
  * @param {String} authToken The authentication token
135
131
  */
136
- export const getTeams = (authToken) => {
132
+ const getTeams = (authToken) => {
137
133
  return new Promise(function (resolve, reject) {
138
134
  const request = client.get(`api/v1/teams/`, {
139
135
  headers: { authorization: authToken },
@@ -154,11 +150,7 @@ export const getTeams = (authToken) => {
154
150
  * @param {Boolean} includeUserSummaryInformation True if request to load user summary information
155
151
  * @param {String} authToken The authentication token
156
152
  */
157
- export const getTeamByUserId = (
158
- userId,
159
- includeUserSummaryInformation,
160
- authToken
161
- ) => {
153
+ const getTeamByUserId = (userId, includeUserSummaryInformation, authToken) => {
162
154
  return new Promise(function (resolve, reject) {
163
155
  const request = client.post(
164
156
  `/api/v1/teams/getuserteam/${userId || ""}`,
@@ -182,7 +174,7 @@ export const getTeamByUserId = (
182
174
  * @param {Boolean} includeUserSummaryInformation True if request to load user summary information
183
175
  * @param {String} authToken The authentication token
184
176
  */
185
- export const getTopTeam = (includeUserSummaryInformation, authToken) => {
177
+ const getTopTeam = (includeUserSummaryInformation, authToken) => {
186
178
  return new Promise(function (resolve, reject) {
187
179
  const request = client.post(
188
180
  `api/v1/teams/gettopteam`,
@@ -207,7 +199,7 @@ export const getTopTeam = (includeUserSummaryInformation, authToken) => {
207
199
  * @param {Array<String>} users The users to be removed from the team
208
200
  * @param {String} authToken The authentication token
209
201
  */
210
- export const removeUsersFromTeam = (teamId, users, authToken) => {
202
+ const removeUsersFromTeam = (teamId, users, authToken) => {
211
203
  return new Promise(function (resolve, reject) {
212
204
  const request = client.post(
213
205
  `api/v1/teams/users/remove/`,
@@ -232,7 +224,7 @@ export const removeUsersFromTeam = (teamId, users, authToken) => {
232
224
  * @param {String} teamId The team Id
233
225
  * @param {String} authToken The authentication token
234
226
  */
235
- export const setDefault = (teamId, authToken) => {
227
+ const setDefault = (teamId, authToken) => {
236
228
  return new Promise(function (resolve, reject) {
237
229
  const request = client.put(
238
230
  `api/v1/teams/setDefault/`,
@@ -257,7 +249,7 @@ export const setDefault = (teamId, authToken) => {
257
249
  * @param {String} data The updated name of the team
258
250
  * @param {String} authToken The authentication token
259
251
  */
260
- export const updateTeam = (teamId, data, authToken) => {
252
+ const updateTeam = (teamId, data, authToken) => {
261
253
  return new Promise(function (resolve, reject) {
262
254
  const request = client.patch(
263
255
  `api/v1/teams/team/`,
package/lib/tenants.js CHANGED
@@ -5,7 +5,7 @@ import { client } from "./axiosClient.js";
5
5
  * @param {String} category Tenant information category
6
6
  * @param {String} token Authorization token
7
7
  */
8
- export const getTenantInformation = (categories, token) => {
8
+ const getTenantInformation = (categories, token) => {
9
9
  return new Promise(function (resolve, reject) {
10
10
  const requestData = {
11
11
  categories: categories,
@@ -29,7 +29,7 @@ export const getTenantInformation = (categories, token) => {
29
29
  * @param {String} data New or updated tenant data information
30
30
  * @param {Object} token Authorization token
31
31
  */
32
- export const setTenantInformation = (category, data, token) => {
32
+ const setTenantInformation = (category, data, token) => {
33
33
  return new Promise(function (resolve, reject) {
34
34
  const requestData = {
35
35
  category: category,
@@ -1,5 +1,25 @@
1
1
  import { client } from "./axiosClient.js";
2
2
 
3
+ /**
4
+ * Archive the training plan
5
+ * @param {String} id The id of the training plan to be deleted
6
+ * @param {String} token Authorization token
7
+ */
8
+ const archiveTrainingPlan = (id, token) => {
9
+ return new Promise(function (resolve, reject) {
10
+ const request = client.get(`api/v1/trainingplans/archive/${id}`, {
11
+ headers: { authorization: token },
12
+ });
13
+ request
14
+ .then((response) => {
15
+ resolve(response.data);
16
+ })
17
+ .catch((error) => {
18
+ reject(error);
19
+ });
20
+ });
21
+ };
22
+
3
23
  /**
4
24
  * Create training plan and set information
5
25
  * @param {Object} data
@@ -7,7 +27,7 @@ import { client } from "./axiosClient.js";
7
27
  * @param {Boolean} saveAsDraft Save as draft flag
8
28
  * @param {String} token Authorization token
9
29
  */
10
- export const createTrainingPlan = (data, type, saveAsDraft, token) => {
30
+ const createTrainingPlan = (data, type, saveAsDraft, token) => {
11
31
  return new Promise(function (resolve, reject) {
12
32
  const requestData = {
13
33
  data: {
@@ -35,7 +55,7 @@ export const createTrainingPlan = (data, type, saveAsDraft, token) => {
35
55
  * @param {String} comments The comments for approver
36
56
  * @param {String} token Authorization token
37
57
  */
38
- export const deleteTrainingPlan = (id, comments, token) => {
58
+ const deleteTrainingPlan = (id, comments, token) => {
39
59
  return new Promise(function (resolve, reject) {
40
60
  const data = {
41
61
  id: id,
@@ -60,7 +80,7 @@ export const deleteTrainingPlan = (id, comments, token) => {
60
80
  * @param {String} id The id of the training plan to be deleted
61
81
  * @param {String} token Authorization token
62
82
  */
63
- export const discardTrainingPlanChanges = (id, token) => {
83
+ const discardTrainingPlanChanges = (id, token) => {
64
84
  return new Promise(function (resolve, reject) {
65
85
  const request = client.get(`api/v1/trainingplans/discard/${id}`, {
66
86
  headers: { authorization: token },
@@ -83,7 +103,7 @@ export const discardTrainingPlanChanges = (id, token) => {
83
103
  * @param {Boolean} saveBaseline If set to true it will save the baseline
84
104
  * @param {String} token Authorization token
85
105
  */
86
- export const generateNewBaseline = (
106
+ const generateNewBaseline = (
87
107
  id,
88
108
  data,
89
109
  returnMinimized,
@@ -119,7 +139,7 @@ export const generateNewBaseline = (
119
139
  * @param {String} id The id of the training plan
120
140
  * @param {String} token Authorization token
121
141
  */
122
- export const getTrainingPlanById = (id, version, token) => {
142
+ const getTrainingPlanById = (id, version, token) => {
123
143
  return new Promise(function (resolve, reject) {
124
144
  let confirmationRequest = client.get(
125
145
  `api/v1/trainingplans/${id}/${version}`,
@@ -141,7 +161,7 @@ export const getTrainingPlanById = (id, version, token) => {
141
161
  * Get tasks summary for a recipient across all of the training plans
142
162
  * @param {String} token Authorization token
143
163
  */
144
- export const getAllTrainingPlansTasksSummary = async (token = null) => {
164
+ const getAllTrainingPlansTasksSummary = async (token = null) => {
145
165
  return new Promise(function (resolve, reject) {
146
166
  let confirmationRequest = client.get(`api/v1/trainingplans/taskssummary`, {
147
167
  headers: token ? { authorization: token } : {},
@@ -165,7 +185,7 @@ export const getAllTrainingPlansTasksSummary = async (token = null) => {
165
185
  * @param {Boolean} returnDefaultIfVersionNotAvailable If set to true it will load the draft information if the plan was never published
166
186
  * @param {String} token Authorization token
167
187
  */
168
- export const getListOfTrainingPlans = (
188
+ const getListOfTrainingPlans = (
169
189
  users,
170
190
  types,
171
191
  version,
@@ -204,7 +224,7 @@ export const getListOfTrainingPlans = (
204
224
  * @param {String} comments The comments to be include with the request
205
225
  * @param {String} token Authorization token
206
226
  */
207
- export const publishTrainingPlan = (id, comments, token) => {
227
+ const publishTrainingPlan = (id, comments, token) => {
208
228
  return new Promise(function (resolve, reject) {
209
229
  let data = {};
210
230
  if (comments) data.comments = comments;
@@ -231,7 +251,7 @@ export const publishTrainingPlan = (id, comments, token) => {
231
251
  * @param {Object} data The updated data
232
252
  * @param {String} token Authorization token
233
253
  */
234
- export const updateTrainingPlan = (planId, data, saveAsDraft, token) => {
254
+ const updateTrainingPlan = (planId, data, saveAsDraft, token) => {
235
255
  return new Promise(function (resolve, reject) {
236
256
  const requestData = {
237
257
  data: data,
@@ -262,7 +282,7 @@ export const updateTrainingPlan = (planId, data, saveAsDraft, token) => {
262
282
  * @param {String} token
263
283
  * @returns {Promise<Object>}
264
284
  */
265
- export const updateTrainingPlanTaskStatus = (id, status, token) => {
285
+ const updateTrainingPlanTaskStatus = (id, status, token) => {
266
286
  return new Promise(function (resolve, reject) {
267
287
  let data = {
268
288
  id: id,
@@ -289,7 +309,7 @@ export const updateTrainingPlanTaskStatus = (id, status, token) => {
289
309
  * @param {Function} failCallBack
290
310
  * @returns {Object} An object containing the task information
291
311
  */
292
- export const updateActivities = (planId, data, token) => {
312
+ const updateActivities = (planId, data, token) => {
293
313
  return new Promise(function (resolve, reject) {
294
314
  let confirmationRequest = client.post(
295
315
  `api/v1/trainingplans/${planId}/activities`,
@@ -307,3 +327,18 @@ export const updateActivities = (planId, data, token) => {
307
327
  });
308
328
  });
309
329
  };
330
+
331
+ export default {
332
+ archiveTrainingPlan,
333
+ createTrainingPlan,
334
+ deleteTrainingPlan,
335
+ discardTrainingPlanChanges,
336
+ generateNewBaseline,
337
+ getAllTrainingPlansTasksSummary,
338
+ getTrainingPlanById,
339
+ getListOfTrainingPlans,
340
+ publishTrainingPlan,
341
+ updateTrainingPlan,
342
+ updateTrainingPlanTaskStatus,
343
+ updateActivities,
344
+ };