@stackfactor/client-api 1.1.12-9.1 → 1.1.12

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.
Files changed (41) hide show
  1. package/{exports.ts → exports.js} +0 -14
  2. package/index.js +3 -0
  3. package/lib/{actionNotifications.ts → actionNotifications.js} +11 -21
  4. package/lib/{address.ts → address.js} +5 -4
  5. package/lib/axiosClient.js +85 -0
  6. package/lib/{config.ts → config.js} +9 -20
  7. package/lib/{constants.ts → constants.js} +41 -11
  8. package/lib/{dashboard.ts → dashboard.js} +10 -19
  9. package/lib/{departmentTrainingPlans.ts → departmentTrainingPlans.js} +32 -63
  10. package/lib/{groups.ts → groups.js} +29 -68
  11. package/lib/{integration.ts → integration.js} +47 -103
  12. package/lib/{integrationConfiguration.ts → integrationConfiguration.js} +22 -27
  13. package/lib/integrations/{contentGenerator.ts → contentGenerator.js} +18 -38
  14. package/lib/{learningContent.ts → learningContent.js} +62 -218
  15. package/lib/{learningPath.ts → learningPath.js} +30 -57
  16. package/lib/{logger.ts → logger.js} +8 -18
  17. package/lib/{role.ts → role.js} +69 -117
  18. package/lib/{roleTemplate.ts → roleTemplate.js} +30 -65
  19. package/lib/{skill.ts → skill.js} +87 -125
  20. package/lib/skillAssessmentTestingSession.js +148 -0
  21. package/lib/{skillAssessments.ts → skillAssessments.js} +16 -63
  22. package/lib/{skillTemplate.ts → skillTemplate.js} +42 -73
  23. package/lib/{teams.ts → teams.js} +38 -73
  24. package/lib/{tenants.ts → tenants.js} +10 -17
  25. package/lib/{trainingPlans.ts → trainingPlans.js} +56 -159
  26. package/lib/{userInformation.ts → userInformation.js} +26 -27
  27. package/lib/{users.ts → users.js} +140 -239
  28. package/lib/utils.js +48 -0
  29. package/package.json +1 -12
  30. package/.eslintrc.json +0 -13
  31. package/index.ts +0 -1
  32. package/lib/aiAssistant.ts +0 -197
  33. package/lib/avatar.ts +0 -41
  34. package/lib/axiosClient.ts +0 -92
  35. package/lib/microSkillsQuizes.ts +0 -70
  36. package/lib/quotas.ts +0 -59
  37. package/lib/security.ts +0 -99
  38. package/lib/skillAssessmentTestingSession.ts +0 -192
  39. package/lib/talentTransfromation.ts +0 -126
  40. package/lib/trainingPlansProficiencyLevels.ts +0 -132
  41. package/lib/utils.ts +0 -64
@@ -4,10 +4,9 @@ import { client } from "./axiosClient.js";
4
4
  * Create skill template and set information
5
5
  * @param {Object} data
6
6
  * @param {String} token Authorization token
7
- * @returns {Promise<Object>}
8
7
  */
9
- const createSkillTemplate = (data: object, token: string): Promise<object> => {
10
- return new Promise((resolve, reject) => {
8
+ export const createSkillTemplate = (data, token) => {
9
+ return new Promise(function (resolve, reject) {
11
10
  const requestData = {
12
11
  data: data,
13
12
  };
@@ -29,18 +28,13 @@ const createSkillTemplate = (data: object, token: string): Promise<object> => {
29
28
  * @param {number} id The id of the template to be deleted
30
29
  * @param {String} comments The comments included with the deletion
31
30
  * @param {String} token Authorization token
32
- * @returns {Promise<Object>}
33
31
  */
34
- const deleteSkillTemplate = (
35
- id: number,
36
- comments: string,
37
- token: string
38
- ): Promise<object> => {
39
- const data: { id: number; comments?: string } = {
32
+ export const deleteSkillTemplate = (id, comments, token) => {
33
+ const data = {
40
34
  id: id,
41
35
  };
42
36
  if (comments) data.comments = comments;
43
- return new Promise((resolve, reject) => {
37
+ return new Promise(function (resolve, reject) {
44
38
  const request = client.delete(`api/v1/skilltemplates/`, {
45
39
  headers: { authorization: token },
46
40
  data: data,
@@ -59,13 +53,9 @@ const deleteSkillTemplate = (
59
53
  * Discard the skill template draft changes
60
54
  * @param {String} id The id of the skill template to be deleted
61
55
  * @param {String} token Authorization token
62
- * @returns {Promise<Object>}
63
56
  */
64
- const discardSkillTemplateChanges = (
65
- id: string,
66
- token: string
67
- ): Promise<object> => {
68
- return new Promise((resolve, reject) => {
57
+ export const discardSkillTemplateChanges = (id, token) => {
58
+ return new Promise(function (resolve, reject) {
69
59
  const data = {};
70
60
  const request = client.get(`api/v1/skilltemplates/discard/${id}`, {
71
61
  headers: { authorization: token },
@@ -87,15 +77,14 @@ const discardSkillTemplateChanges = (
87
77
  * @param {String} version The version of the template
88
78
  * @param {Boolean} returnNullIfVersionNotFound When true it will return null if the version is not found
89
79
  * @param {String} token Authorization token
90
- * @returns {Promise<Object>}
91
80
  */
92
- const getSkillTemplateInformationById = (
93
- id: string,
94
- version: string,
95
- returnNullIfVersionNotFound: boolean,
96
- token: string
97
- ): Promise<object> => {
98
- return new Promise((resolve, reject) => {
81
+ export const getSkillTemplateInformationById = (
82
+ id,
83
+ version,
84
+ returnNullIfVersionNotFound,
85
+ token
86
+ ) => {
87
+ return new Promise(function (resolve, reject) {
99
88
  let confirmationRequest = client.get(
100
89
  `api/v1/skilltemplates/${id}/${version}/${returnNullIfVersionNotFound}`,
101
90
  {
@@ -119,17 +108,16 @@ const getSkillTemplateInformationById = (
119
108
  * @param {Boolean} includeDeleted When true it will return the deleted records as well
120
109
  * @param {Boolean} namesOnly When true it will return only the names of the templates
121
110
  * @param {String} token Authorization token
122
- * @returns {Promise<Object>}
123
111
  */
124
- const getSkillTemplateList = (
125
- filter: string[],
126
- version: string,
127
- includeDeleted: boolean,
128
- namesOnly: boolean,
129
- token: string
130
- ): Promise<object> => {
131
- return new Promise((resolve, reject) => {
132
- const requestData: { includeDeleted: boolean; namesOnly: boolean; version: string; filter?: string[] } = {
112
+ export const getSkillTemplateList = (
113
+ filter,
114
+ version,
115
+ includeDeleted,
116
+ namesOnly,
117
+ token
118
+ ) => {
119
+ return new Promise(function (resolve, reject) {
120
+ const requestData = {
133
121
  includeDeleted: includeDeleted,
134
122
  namesOnly: namesOnly,
135
123
  version: version,
@@ -153,12 +141,11 @@ const getSkillTemplateList = (
153
141
  };
154
142
 
155
143
  /**
156
- * Get skill technology stacks template list
144
+ * Get skill tecnology stacks template list
157
145
  * @param {String} token Authorization token
158
- * @returns {Promise<Object>}
159
146
  */
160
- const getTechnologyStacks = (token: string): Promise<object> => {
161
- return new Promise((resolve, reject) => {
147
+ export const getTechnologyStacks = (token) => {
148
+ return new Promise(function (resolve, reject) {
162
149
  let confirmationRequest = client.get(`api/v1/skilltemplates/stacks`, {
163
150
  headers: { authorization: token },
164
151
  });
@@ -177,15 +164,10 @@ const getTechnologyStacks = (token: string): Promise<object> => {
177
164
  * @param {number} id The id of the template to be published
178
165
  * @param {String} comments The comments to be include with the request
179
166
  * @param {String} token Authorization token
180
- * @returns {Promise<Object>}
181
167
  */
182
- const publishTemplate = (
183
- id: number,
184
- comments: string,
185
- token: string
186
- ): Promise<object> => {
187
- return new Promise((resolve, reject) => {
188
- let data: { comments?: string } = {};
168
+ export const publishTemplate = (id, comments, token) => {
169
+ return new Promise(function (resolve, reject) {
170
+ let data = {};
189
171
  if (comments) data.comments = comments;
190
172
  let confirmationRequest = client.post(
191
173
  `api/v1/skilltemplates/publish/${id}`,
@@ -209,14 +191,9 @@ const publishTemplate = (
209
191
  * @param {String} id The id of the template to be updated
210
192
  * @param {Object} data Data used to update the template
211
193
  * @param {String} token Authorization token
212
- * @returns {Promise<Object>}
213
194
  */
214
- const setTemplateInformation = (
215
- id: string,
216
- data: object,
217
- token: string
218
- ): Promise<object> => {
219
- return new Promise((resolve, reject) => {
195
+ export const setTemplateInformation = (id, data, token) => {
196
+ return new Promise(function (resolve, reject) {
220
197
  const requestData = {
221
198
  data: data,
222
199
  id: id,
@@ -243,14 +220,9 @@ const setTemplateInformation = (
243
220
  * @param {String} id The id of the template to be updated
244
221
  * @param {Object} tags Updated template tags
245
222
  * @param {String} token Authorization token
246
- * @returns {Promise<Object>}
247
223
  */
248
- const setTemplateTags = (
249
- id: string,
250
- tags: object,
251
- token: string
252
- ): Promise<object> => {
253
- return new Promise((resolve, reject) => {
224
+ export const setTemplateTags = (id, tags, token) => {
225
+ return new Promise(function (resolve, reject) {
254
226
  const requestData = {
255
227
  tags: tags,
256
228
  id: id,
@@ -272,14 +244,14 @@ const setTemplateTags = (
272
244
  });
273
245
  };
274
246
 
275
- /**
247
+ /*
276
248
  * Validate skill template information
277
249
  * @param {String} id The id of the skill to be updated
278
250
  * @param {String} token Authorization token
279
- * @returns {Promise<Object>}
251
+ * @returns {Promise}
280
252
  */
281
- const validateTemplate = (id: string, token: string): Promise<object> => {
282
- return new Promise((resolve, reject) => {
253
+ export const validateTemplate = (id, token) => {
254
+ return new Promise(function (resolve, reject) {
283
255
  const requestData = {
284
256
  id: id,
285
257
  };
@@ -305,14 +277,9 @@ const validateTemplate = (id: string, token: string): Promise<object> => {
305
277
  * @param {String} id The id of the skill template to be updated
306
278
  * @param {Boolean} watch Set to true or false
307
279
  * @param {String} token Authorization token
308
- * @returns {Promise<Object>}
309
280
  */
310
- const watchSkillTemplate = (
311
- id: string,
312
- watch: boolean,
313
- token: string
314
- ): Promise<object> => {
315
- return new Promise((resolve, reject) => {
281
+ export const watchSkillTemplate = (id, watch, token) => {
282
+ return new Promise(function (resolve, reject) {
316
283
  const requestData = {
317
284
  id: id,
318
285
  watch: watch,
@@ -334,7 +301,7 @@ const watchSkillTemplate = (
334
301
  });
335
302
  };
336
303
 
337
- export default {
304
+ const skillTemplate = {
338
305
  createSkillTemplate,
339
306
  deleteSkillTemplate,
340
307
  discardSkillTemplateChanges,
@@ -347,3 +314,5 @@ export default {
347
314
  validateTemplate,
348
315
  watchSkillTemplate,
349
316
  };
317
+
318
+ export default skillTemplate;
@@ -5,14 +5,9 @@ import { client } from "./axiosClient.js";
5
5
  * @param {String} teamId The team Id
6
6
  * @param {Array<String>} users The users to be added
7
7
  * @param {String} authToken - Authentication token
8
- * @returns {Promise<Object>}
9
8
  */
10
- const addUsersToTeam = (
11
- teamId: string,
12
- users: string[],
13
- authToken: string
14
- ): Promise<object> => {
15
- return new Promise((resolve, reject) => {
9
+ export const addUsersToTeam = (teamId, users, authToken) => {
10
+ return new Promise(function (resolve, reject) {
16
11
  const request = client.post(
17
12
  `api/v1/teams/users/add`,
18
13
  {
@@ -37,15 +32,9 @@ const addUsersToTeam = (
37
32
  * @param {String} managerId The id of the manager
38
33
  * @param {String} description The description of the team
39
34
  * @param {String} authToken The authorization token
40
- * @returns {Promise<Object>}
41
35
  */
42
- const createTeam = (
43
- name: string,
44
- managerId: string,
45
- description: string,
46
- authToken: string
47
- ): Promise<object> => {
48
- return new Promise((resolve, reject) => {
36
+ export const createTeam = (name, managerId, description, authToken) => {
37
+ return new Promise(function (resolve, reject) {
49
38
  const request = client.post(
50
39
  `api/v1/teams/team`,
51
40
  {
@@ -70,14 +59,9 @@ const createTeam = (
70
59
  * @param {String} teamId The team to be deleted
71
60
  * @param {String} defaultTeamId The default team all the users will be moved to
72
61
  * @param {String} authToken The authentication token
73
- * @returns {Promise<Object>}
74
62
  */
75
- const deleteTeam = (
76
- teamId: string,
77
- defaultTeamId: string,
78
- authToken: string
79
- ): Promise<object> => {
80
- return new Promise((resolve, reject) => {
63
+ export const deleteTeam = (teamId, defaultTeamId, authToken) => {
64
+ return new Promise(function (resolve, reject) {
81
65
  const request = client.delete(`api/v1/teams/delete`, {
82
66
  headers: { authorization: authToken },
83
67
  data: {
@@ -100,14 +84,13 @@ const deleteTeam = (
100
84
  * @param {String} teamId The team Id
101
85
  * @param {Boolean} includeUserSummaryInformation True if request to load user summary information
102
86
  * @param {String} authToken The authentication token
103
- * @returns {Promise<Object>}
104
87
  */
105
- const getTeamById = (
106
- teamId: string,
107
- includeUserSummaryInformation: boolean,
108
- authToken: string
109
- ): Promise<object> => {
110
- return new Promise((resolve, reject) => {
88
+ export const getTeamById = (
89
+ teamId,
90
+ includeUserSummaryInformation,
91
+ authToken
92
+ ) => {
93
+ return new Promise(function (resolve, reject) {
111
94
  const request = client.post(
112
95
  `api/v1/teams/team/${teamId}`,
113
96
  {
@@ -129,13 +112,9 @@ const getTeamById = (
129
112
  * Get team roles
130
113
  * @param {String} teamId The team Id
131
114
  * @param {String} authToken The authentication token
132
- * @returns {Promise<Object>}
133
115
  */
134
- const getTeamByIdRoles = (
135
- teamId: string,
136
- authToken: string
137
- ): Promise<object> => {
138
- return new Promise((resolve, reject) => {
116
+ export const getTeamByIdRoles = (teamId, authToken) => {
117
+ return new Promise(function (resolve, reject) {
139
118
  const request = client.get(`api/v1/teams/getroles/${teamId}`, {
140
119
  headers: { authorization: authToken },
141
120
  });
@@ -151,11 +130,11 @@ const getTeamByIdRoles = (
151
130
 
152
131
  /**
153
132
  * Get teams for current tenant
133
+ * @param {String} userId
154
134
  * @param {String} authToken The authentication token
155
- * @returns {Promise<Object>}
156
135
  */
157
- const getTeams = (authToken: string): Promise<object> => {
158
- return new Promise((resolve, reject) => {
136
+ export const getTeams = (authToken) => {
137
+ return new Promise(function (resolve, reject) {
159
138
  const request = client.get(`api/v1/teams/`, {
160
139
  headers: { authorization: authToken },
161
140
  });
@@ -174,16 +153,15 @@ const getTeams = (authToken: string): Promise<object> => {
174
153
  * @param {String} userId
175
154
  * @param {Boolean} includeUserSummaryInformation True if request to load user summary information
176
155
  * @param {String} authToken The authentication token
177
- * @returns {Promise<Object>}
178
156
  */
179
- const getTeamByUserId = (
180
- userId: string,
181
- includeUserSummaryInformation: boolean,
182
- authToken: string
183
- ): Promise<object> => {
184
- return new Promise((resolve, reject) => {
157
+ export const getTeamByUserId = (
158
+ userId,
159
+ includeUserSummaryInformation,
160
+ authToken
161
+ ) => {
162
+ return new Promise(function (resolve, reject) {
185
163
  const request = client.post(
186
- `/api/v1/teams/getuserteam/${userId || ""}`,
164
+ `/api/v1/teams/getuserteam/${userId ? userId : ""}`,
187
165
  {
188
166
  includeUserSummaryInformation: includeUserSummaryInformation,
189
167
  },
@@ -203,13 +181,9 @@ const getTeamByUserId = (
203
181
  * Get top team in the organization, usually the executive team
204
182
  * @param {Boolean} includeUserSummaryInformation True if request to load user summary information
205
183
  * @param {String} authToken The authentication token
206
- * @returns {Promise<Object>}
207
184
  */
208
- const getTopTeam = (
209
- includeUserSummaryInformation: boolean,
210
- authToken: string
211
- ): Promise<object> => {
212
- return new Promise((resolve, reject) => {
185
+ export const getTopTeam = (includeUserSummaryInformation, authToken) => {
186
+ return new Promise(function (resolve, reject) {
213
187
  const request = client.post(
214
188
  `api/v1/teams/gettopteam`,
215
189
  {
@@ -232,14 +206,9 @@ const getTopTeam = (
232
206
  * @param {String} teamId The team Id
233
207
  * @param {Array<String>} users The users to be removed from the team
234
208
  * @param {String} authToken The authentication token
235
- * @returns {Promise<Object>}
236
209
  */
237
- const removeUsersFromTeam = (
238
- teamId: string,
239
- users: string[],
240
- authToken: string
241
- ): Promise<object> => {
242
- return new Promise((resolve, reject) => {
210
+ export const removeUsersFromTeam = (teamId, users, authToken) => {
211
+ return new Promise(function (resolve, reject) {
243
212
  const request = client.post(
244
213
  `api/v1/teams/users/remove/`,
245
214
  {
@@ -258,14 +227,13 @@ const removeUsersFromTeam = (
258
227
  });
259
228
  };
260
229
 
261
- /**
262
- * Set team as default
230
+ /*
231
+ * Set team as defualt
263
232
  * @param {String} teamId The team Id
264
233
  * @param {String} authToken The authentication token
265
- * @returns {Promise<Object>}
266
234
  */
267
- const setDefault = (teamId: string, authToken: string): Promise<object> => {
268
- return new Promise((resolve, reject) => {
235
+ export const setDefault = (teamId, authToken) => {
236
+ return new Promise(function (resolve, reject) {
269
237
  const request = client.put(
270
238
  `api/v1/teams/setDefault/`,
271
239
  {
@@ -286,16 +254,11 @@ const setDefault = (teamId: string, authToken: string): Promise<object> => {
286
254
  /**
287
255
  * Update team
288
256
  * @param {String} teamId The team Id
289
- * @param {Object} data The updated data of the team
257
+ * @param {String} data The updated name of the team
290
258
  * @param {String} authToken The authentication token
291
- * @returns {Promise<Object>}
292
259
  */
293
- const updateTeam = (
294
- teamId: string,
295
- data: object,
296
- authToken: string
297
- ): Promise<object> => {
298
- return new Promise((resolve, reject) => {
260
+ export const updateTeam = (teamId, data, authToken) => {
261
+ return new Promise(function (resolve, reject) {
299
262
  const request = client.patch(
300
263
  `api/v1/teams/team/`,
301
264
  {
@@ -314,7 +277,7 @@ const updateTeam = (
314
277
  });
315
278
  };
316
279
 
317
- export default {
280
+ const team = {
318
281
  addUsersToTeam,
319
282
  createTeam,
320
283
  deleteTeam,
@@ -327,3 +290,5 @@ export default {
327
290
  setDefault,
328
291
  updateTeam,
329
292
  };
293
+
294
+ export default team;
@@ -4,15 +4,11 @@ import { client } from "./axiosClient.js";
4
4
  * Get tenant information
5
5
  * @param {String} category Tenant information category
6
6
  * @param {String} token Authorization token
7
- * @returns {Promise<Object>}
8
7
  */
9
- const getTenantInformation = (
10
- category: string,
11
- token: string
12
- ): Promise<object> => {
13
- return new Promise((resolve, reject) => {
8
+ export const getTenantInformation = (categories, token) => {
9
+ return new Promise(function (resolve, reject) {
14
10
  const requestData = {
15
- categories: category,
11
+ categories: categories,
16
12
  };
17
13
  let request = client.post("api/v1/tenants/tenant/get", requestData, {
18
14
  headers: { authorization: token },
@@ -30,16 +26,11 @@ const getTenantInformation = (
30
26
  /**
31
27
  * Set tenant profile information
32
28
  * @param {String} category Tenant information category
33
- * @param {Object} data New or updated tenant data information
34
- * @param {String} token Authorization token
35
- * @returns {Promise<Object>}
29
+ * @param {String} data New or updated tenant data information
30
+ * @param {Object} token Authorization token
36
31
  */
37
- const setTenantInformation = (
38
- category: string,
39
- data: object,
40
- token: string
41
- ): Promise<object> => {
42
- return new Promise((resolve, reject) => {
32
+ export const setTenantInformation = (category, data, token) => {
33
+ return new Promise(function (resolve, reject) {
43
34
  const requestData = {
44
35
  category: category,
45
36
  data: data,
@@ -61,4 +52,6 @@ const setTenantInformation = (
61
52
  });
62
53
  };
63
54
 
64
- export default { getTenantInformation, setTenantInformation };
55
+ const tenant = { getTenantInformation, setTenantInformation };
56
+
57
+ export default tenant;