@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.
- package/{exports.ts → exports.js} +0 -14
- package/index.js +3 -0
- package/lib/{actionNotifications.ts → actionNotifications.js} +11 -21
- package/lib/{address.ts → address.js} +5 -4
- package/lib/axiosClient.js +85 -0
- package/lib/{config.ts → config.js} +9 -20
- package/lib/{constants.ts → constants.js} +41 -11
- package/lib/{dashboard.ts → dashboard.js} +10 -19
- package/lib/{departmentTrainingPlans.ts → departmentTrainingPlans.js} +32 -63
- package/lib/{groups.ts → groups.js} +29 -68
- package/lib/{integration.ts → integration.js} +47 -103
- package/lib/{integrationConfiguration.ts → integrationConfiguration.js} +22 -27
- package/lib/integrations/{contentGenerator.ts → contentGenerator.js} +18 -38
- package/lib/{learningContent.ts → learningContent.js} +62 -218
- package/lib/{learningPath.ts → learningPath.js} +30 -57
- package/lib/{logger.ts → logger.js} +8 -18
- package/lib/{role.ts → role.js} +69 -117
- package/lib/{roleTemplate.ts → roleTemplate.js} +30 -65
- package/lib/{skill.ts → skill.js} +87 -125
- package/lib/skillAssessmentTestingSession.js +148 -0
- package/lib/{skillAssessments.ts → skillAssessments.js} +16 -63
- package/lib/{skillTemplate.ts → skillTemplate.js} +42 -73
- package/lib/{teams.ts → teams.js} +38 -73
- package/lib/{tenants.ts → tenants.js} +10 -17
- package/lib/{trainingPlans.ts → trainingPlans.js} +56 -159
- package/lib/{userInformation.ts → userInformation.js} +26 -27
- package/lib/{users.ts → users.js} +140 -239
- package/lib/utils.js +48 -0
- package/package.json +1 -12
- package/.eslintrc.json +0 -13
- package/index.ts +0 -1
- package/lib/aiAssistant.ts +0 -197
- package/lib/avatar.ts +0 -41
- package/lib/axiosClient.ts +0 -92
- package/lib/microSkillsQuizes.ts +0 -70
- package/lib/quotas.ts +0 -59
- package/lib/security.ts +0 -99
- package/lib/skillAssessmentTestingSession.ts +0 -192
- package/lib/talentTransfromation.ts +0 -126
- package/lib/trainingPlansProficiencyLevels.ts +0 -132
- package/lib/utils.ts +0 -64
|
@@ -1,25 +1,5 @@
|
|
|
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: string, token: string): Promise<object> => {
|
|
9
|
-
return new Promise((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
|
-
|
|
23
3
|
/**
|
|
24
4
|
* Create training plan and set information
|
|
25
5
|
* @param {Object} data
|
|
@@ -27,19 +7,14 @@ const archiveTrainingPlan = (id: string, token: string): Promise<object> => {
|
|
|
27
7
|
* @param {Boolean} saveAsDraft Save as draft flag
|
|
28
8
|
* @param {String} token Authorization token
|
|
29
9
|
*/
|
|
30
|
-
const createTrainingPlan = (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
version: "1.0",
|
|
39
|
-
includeDeleted: false,
|
|
40
|
-
includeDetailedInformation: true,
|
|
41
|
-
returnDefaultIfVersionNotAvailable: true,
|
|
42
|
-
types: [type],
|
|
10
|
+
export const createTrainingPlan = (data, type, saveAsDraft, token) => {
|
|
11
|
+
return new Promise(function (resolve, reject) {
|
|
12
|
+
const requestData = {
|
|
13
|
+
data: {
|
|
14
|
+
...data,
|
|
15
|
+
},
|
|
16
|
+
saveAsDraft,
|
|
17
|
+
type,
|
|
43
18
|
};
|
|
44
19
|
let confirmationRequest = client.put("api/v1/trainingplans", requestData, {
|
|
45
20
|
headers: { authorization: token },
|
|
@@ -60,13 +35,9 @@ const createTrainingPlan = (
|
|
|
60
35
|
* @param {String} comments The comments for approver
|
|
61
36
|
* @param {String} token Authorization token
|
|
62
37
|
*/
|
|
63
|
-
const deleteTrainingPlan = (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
token: string
|
|
67
|
-
): Promise<object> => {
|
|
68
|
-
return new Promise((resolve, reject) => {
|
|
69
|
-
const data: { id: string; comments?: string } = {
|
|
38
|
+
export const deleteTrainingPlan = (id, comments, token) => {
|
|
39
|
+
return new Promise(function (resolve, reject) {
|
|
40
|
+
const data = {
|
|
70
41
|
id: id,
|
|
71
42
|
};
|
|
72
43
|
if (comments) data.comments = comments;
|
|
@@ -89,11 +60,8 @@ const deleteTrainingPlan = (
|
|
|
89
60
|
* @param {String} id The id of the training plan to be deleted
|
|
90
61
|
* @param {String} token Authorization token
|
|
91
62
|
*/
|
|
92
|
-
const discardTrainingPlanChanges = (
|
|
93
|
-
|
|
94
|
-
token: string
|
|
95
|
-
): Promise<object> => {
|
|
96
|
-
return new Promise((resolve, reject) => {
|
|
63
|
+
export const discardTrainingPlanChanges = (id, token) => {
|
|
64
|
+
return new Promise(function (resolve, reject) {
|
|
97
65
|
const request = client.get(`api/v1/trainingplans/discard/${id}`, {
|
|
98
66
|
headers: { authorization: token },
|
|
99
67
|
});
|
|
@@ -108,22 +76,22 @@ const discardTrainingPlanChanges = (
|
|
|
108
76
|
};
|
|
109
77
|
|
|
110
78
|
/**
|
|
111
|
-
* Create a new
|
|
79
|
+
* Create a new baselie
|
|
112
80
|
* @param {String} id The Id of the plan for which a new baseline is to be generated
|
|
113
81
|
* @param {Object} data The data
|
|
114
82
|
* @param {Boolean} returnMinimized If set to true just high level plan baseline information will be returned
|
|
115
83
|
* @param {Boolean} saveBaseline If set to true it will save the baseline
|
|
116
84
|
* @param {String} token Authorization token
|
|
117
85
|
*/
|
|
118
|
-
const generateNewBaseline = (
|
|
119
|
-
id
|
|
120
|
-
data
|
|
121
|
-
returnMinimized
|
|
122
|
-
saveBaseline
|
|
123
|
-
token
|
|
124
|
-
)
|
|
125
|
-
return new Promise((resolve, reject)
|
|
126
|
-
const requestData
|
|
86
|
+
export const generateNewBaseline = (
|
|
87
|
+
id,
|
|
88
|
+
data,
|
|
89
|
+
returnMinimized,
|
|
90
|
+
saveBaseline,
|
|
91
|
+
token
|
|
92
|
+
) => {
|
|
93
|
+
return new Promise(function (resolve, reject) {
|
|
94
|
+
const requestData = {
|
|
127
95
|
data: data,
|
|
128
96
|
returnMinimized: returnMinimized,
|
|
129
97
|
saveBaseline: saveBaseline,
|
|
@@ -147,17 +115,12 @@ const generateNewBaseline = (
|
|
|
147
115
|
};
|
|
148
116
|
|
|
149
117
|
/**
|
|
150
|
-
* Get
|
|
118
|
+
* Get traing plan information
|
|
151
119
|
* @param {String} id The id of the training plan
|
|
152
|
-
* @param {String} version The version of the training plan
|
|
153
120
|
* @param {String} token Authorization token
|
|
154
121
|
*/
|
|
155
|
-
const getTrainingPlanById = (
|
|
156
|
-
|
|
157
|
-
version: string,
|
|
158
|
-
token: string
|
|
159
|
-
): Promise<object> => {
|
|
160
|
-
return new Promise((resolve, reject) => {
|
|
122
|
+
export const getTrainingPlanById = (id, version, token) => {
|
|
123
|
+
return new Promise(function (resolve, reject) {
|
|
161
124
|
let confirmationRequest = client.get(
|
|
162
125
|
`api/v1/trainingplans/${id}/${version}`,
|
|
163
126
|
{
|
|
@@ -174,50 +137,28 @@ const getTrainingPlanById = (
|
|
|
174
137
|
});
|
|
175
138
|
};
|
|
176
139
|
|
|
177
|
-
/**
|
|
178
|
-
* Get tasks summary for a recipient across all of the training plans
|
|
179
|
-
* @param {String} token Authorization token
|
|
180
|
-
*/
|
|
181
|
-
const getAllTrainingPlansTasksSummary = (
|
|
182
|
-
token: string | null = null
|
|
183
|
-
): Promise<object> => {
|
|
184
|
-
return new Promise((resolve, reject) => {
|
|
185
|
-
let confirmationRequest = client.get(`api/v1/trainingplans/taskssummary`, {
|
|
186
|
-
headers: token ? { authorization: token } : {},
|
|
187
|
-
});
|
|
188
|
-
confirmationRequest
|
|
189
|
-
.then((response) => {
|
|
190
|
-
resolve(response.data);
|
|
191
|
-
})
|
|
192
|
-
.catch((error) => {
|
|
193
|
-
reject(error);
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
};
|
|
197
|
-
|
|
198
140
|
/**
|
|
199
141
|
* Get training plans list
|
|
200
|
-
* @param {Array<
|
|
201
|
-
* @param {Array<
|
|
142
|
+
* @param {Array<ObjectId>} users The list of users for which the plans should be loaded
|
|
143
|
+
* @param {Array<Number>} types The types of plans to be loaded
|
|
202
144
|
* @param {String} version The version of the document to be retrieved
|
|
203
|
-
* @param {Array<
|
|
145
|
+
* @param {Array<String>} fields The fields to be selected
|
|
204
146
|
* @param {Boolean} includeDeleted If set true it will return deleted plans too
|
|
205
|
-
* @param {Boolean} includeDetailedInformation If set true it will return detailed information
|
|
206
147
|
* @param {Boolean} returnDefaultIfVersionNotAvailable If set to true it will load the draft information if the plan was never published
|
|
207
148
|
* @param {String} token Authorization token
|
|
208
149
|
*/
|
|
209
|
-
const getListOfTrainingPlans = (
|
|
210
|
-
users
|
|
211
|
-
types
|
|
212
|
-
version
|
|
213
|
-
fields
|
|
214
|
-
includeDeleted
|
|
215
|
-
includeDetailedInformation
|
|
216
|
-
returnDefaultIfVersionNotAvailable
|
|
217
|
-
token
|
|
218
|
-
)
|
|
219
|
-
return new Promise((resolve, reject)
|
|
220
|
-
const requestData
|
|
150
|
+
export const getListOfTrainingPlans = (
|
|
151
|
+
users,
|
|
152
|
+
types,
|
|
153
|
+
version,
|
|
154
|
+
fields,
|
|
155
|
+
includeDeleted,
|
|
156
|
+
includeDetailedInformation,
|
|
157
|
+
returnDefaultIfVersionNotAvailable,
|
|
158
|
+
token
|
|
159
|
+
) => {
|
|
160
|
+
return new Promise(function (resolve, reject) {
|
|
161
|
+
const requestData = {
|
|
221
162
|
version: version,
|
|
222
163
|
includeDeleted: includeDeleted,
|
|
223
164
|
includeDetailedInformation: includeDetailedInformation,
|
|
@@ -245,13 +186,9 @@ const getListOfTrainingPlans = (
|
|
|
245
186
|
* @param {String} comments The comments to be include with the request
|
|
246
187
|
* @param {String} token Authorization token
|
|
247
188
|
*/
|
|
248
|
-
const publishTrainingPlan = (
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
token: string
|
|
252
|
-
): Promise<object> => {
|
|
253
|
-
return new Promise((resolve, reject) => {
|
|
254
|
-
let data: { comments?: string } = {};
|
|
189
|
+
export const publishTrainingPlan = (id, comments, token) => {
|
|
190
|
+
return new Promise(function (resolve, reject) {
|
|
191
|
+
let data = {};
|
|
255
192
|
if (comments) data.comments = comments;
|
|
256
193
|
let confirmationRequest = client.post(
|
|
257
194
|
`api/v1/trainingplans/publish/${id}`,
|
|
@@ -272,18 +209,12 @@ const publishTrainingPlan = (
|
|
|
272
209
|
|
|
273
210
|
/**
|
|
274
211
|
* Update training plan
|
|
275
|
-
* @param {String}
|
|
212
|
+
* @param {String} id The ID of the training plan
|
|
276
213
|
* @param {Object} data The updated data
|
|
277
|
-
* @param {Boolean} saveAsDraft Save as draft flag
|
|
278
214
|
* @param {String} token Authorization token
|
|
279
215
|
*/
|
|
280
|
-
const updateTrainingPlan = (
|
|
281
|
-
|
|
282
|
-
data: object,
|
|
283
|
-
saveAsDraft: boolean,
|
|
284
|
-
token: string
|
|
285
|
-
): Promise<object> => {
|
|
286
|
-
return new Promise((resolve, reject) => {
|
|
216
|
+
export const updateTrainingPlan = (planId, data, saveAsDraft, token) => {
|
|
217
|
+
return new Promise(function (resolve, reject) {
|
|
287
218
|
const requestData = {
|
|
288
219
|
data: data,
|
|
289
220
|
id: planId,
|
|
@@ -306,49 +237,16 @@ const updateTrainingPlan = (
|
|
|
306
237
|
});
|
|
307
238
|
};
|
|
308
239
|
|
|
309
|
-
/**
|
|
310
|
-
* Update training plan task status
|
|
311
|
-
* @param {String} id The ID of the training plan
|
|
312
|
-
* @param {Number} status
|
|
313
|
-
* @param {String} token
|
|
314
|
-
* @returns {Promise<Object>}
|
|
315
|
-
*/
|
|
316
|
-
const updateTrainingPlanTaskStatus = (
|
|
317
|
-
id: string,
|
|
318
|
-
status: number,
|
|
319
|
-
token: string
|
|
320
|
-
): Promise<object> => {
|
|
321
|
-
return new Promise((resolve, reject) => {
|
|
322
|
-
let data = {
|
|
323
|
-
id: id,
|
|
324
|
-
status: status,
|
|
325
|
-
};
|
|
326
|
-
let confirmationRequest = client.post(`api/v1/trainingplans/task`, data, {
|
|
327
|
-
headers: { authorization: token },
|
|
328
|
-
});
|
|
329
|
-
confirmationRequest
|
|
330
|
-
.then(() => {
|
|
331
|
-
resolve({});
|
|
332
|
-
})
|
|
333
|
-
.catch((error) => {
|
|
334
|
-
reject(error);
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
|
-
};
|
|
338
|
-
|
|
339
240
|
/**
|
|
340
241
|
* Update a task
|
|
341
242
|
* @param {String} planId
|
|
342
243
|
* @param {Object} data Ordered array of objects containing the activity Id and the new status
|
|
343
|
-
* @param {
|
|
344
|
-
* @
|
|
244
|
+
* @param {Function} successCallBack
|
|
245
|
+
* @param {Function} failCallBack
|
|
246
|
+
* @returns {Object} An object containing the task information
|
|
345
247
|
*/
|
|
346
|
-
const updateActivities = (
|
|
347
|
-
|
|
348
|
-
data: object,
|
|
349
|
-
token: string
|
|
350
|
-
): Promise<object> => {
|
|
351
|
-
return new Promise((resolve, reject) => {
|
|
248
|
+
export const updateActivities = (planId, data, token) => {
|
|
249
|
+
return new Promise(function (resolve, reject) {
|
|
352
250
|
let confirmationRequest = client.post(
|
|
353
251
|
`api/v1/trainingplans/${planId}/activities`,
|
|
354
252
|
data,
|
|
@@ -358,7 +256,7 @@ const updateActivities = (
|
|
|
358
256
|
);
|
|
359
257
|
confirmationRequest
|
|
360
258
|
.then(() => {
|
|
361
|
-
resolve(
|
|
259
|
+
resolve();
|
|
362
260
|
})
|
|
363
261
|
.catch((error) => {
|
|
364
262
|
reject(error);
|
|
@@ -366,17 +264,16 @@ const updateActivities = (
|
|
|
366
264
|
});
|
|
367
265
|
};
|
|
368
266
|
|
|
369
|
-
|
|
370
|
-
archiveTrainingPlan,
|
|
267
|
+
const trainingPlan = {
|
|
371
268
|
createTrainingPlan,
|
|
372
269
|
deleteTrainingPlan,
|
|
373
270
|
discardTrainingPlanChanges,
|
|
374
271
|
generateNewBaseline,
|
|
375
|
-
getAllTrainingPlansTasksSummary,
|
|
376
272
|
getTrainingPlanById,
|
|
377
273
|
getListOfTrainingPlans,
|
|
378
274
|
publishTrainingPlan,
|
|
379
275
|
updateTrainingPlan,
|
|
380
|
-
updateTrainingPlanTaskStatus,
|
|
381
276
|
updateActivities,
|
|
382
277
|
};
|
|
278
|
+
|
|
279
|
+
export default trainingPlan;
|
|
@@ -6,15 +6,14 @@ import { client } from "./axiosClient.js";
|
|
|
6
6
|
* @param {String} property
|
|
7
7
|
* @param {Object} data
|
|
8
8
|
* @param {String} token Authorization token
|
|
9
|
-
* @returns {Promise<Object>}
|
|
10
9
|
*/
|
|
11
|
-
const addEntryToArrayBusinessProperty = (
|
|
12
|
-
userId
|
|
13
|
-
property
|
|
14
|
-
data
|
|
15
|
-
token
|
|
16
|
-
)
|
|
17
|
-
return new Promise((resolve, reject)
|
|
10
|
+
export const addEntryToArrayBusinessProperty = (
|
|
11
|
+
userId,
|
|
12
|
+
property,
|
|
13
|
+
data,
|
|
14
|
+
token
|
|
15
|
+
) => {
|
|
16
|
+
return new Promise(function (resolve, reject) {
|
|
18
17
|
const requestData = {
|
|
19
18
|
data: data,
|
|
20
19
|
};
|
|
@@ -36,20 +35,19 @@ const addEntryToArrayBusinessProperty = (
|
|
|
36
35
|
};
|
|
37
36
|
|
|
38
37
|
/**
|
|
39
|
-
*
|
|
38
|
+
* Update an entry from an array type business property such as experience, education or certifications
|
|
40
39
|
* @param {String} userId
|
|
41
40
|
* @param {String} property
|
|
42
41
|
* @param {String} id
|
|
43
42
|
* @param {String} token Authorization token
|
|
44
|
-
* @returns {Promise<Object>}
|
|
45
43
|
*/
|
|
46
|
-
const removeEntryFromArrayBusinessProperty = (
|
|
47
|
-
userId
|
|
48
|
-
property
|
|
49
|
-
id
|
|
50
|
-
token
|
|
51
|
-
)
|
|
52
|
-
return new Promise((resolve, reject)
|
|
44
|
+
export const removeEntryFromArrayBusinessProperty = (
|
|
45
|
+
userId,
|
|
46
|
+
property,
|
|
47
|
+
id,
|
|
48
|
+
token
|
|
49
|
+
) => {
|
|
50
|
+
return new Promise(function (resolve, reject) {
|
|
53
51
|
const confirmationRequest = client.delete(
|
|
54
52
|
`api/v1/user/arrayproperty/${userId}/${property}/${id}`,
|
|
55
53
|
{
|
|
@@ -73,16 +71,15 @@ const removeEntryFromArrayBusinessProperty = (
|
|
|
73
71
|
* @param {String} id
|
|
74
72
|
* @param {Object} data
|
|
75
73
|
* @param {String} token Authorization token
|
|
76
|
-
* @returns {Promise<Object>}
|
|
77
74
|
*/
|
|
78
|
-
const updateEntryfromArrayBusinessProperty = (
|
|
79
|
-
userId
|
|
80
|
-
property
|
|
81
|
-
id
|
|
82
|
-
data
|
|
83
|
-
token
|
|
84
|
-
)
|
|
85
|
-
return new Promise((resolve, reject)
|
|
75
|
+
export const updateEntryfromArrayBusinessProperty = (
|
|
76
|
+
userId,
|
|
77
|
+
property,
|
|
78
|
+
id,
|
|
79
|
+
data,
|
|
80
|
+
token
|
|
81
|
+
) => {
|
|
82
|
+
return new Promise(function (resolve, reject) {
|
|
86
83
|
const requestData = {
|
|
87
84
|
data: data,
|
|
88
85
|
};
|
|
@@ -103,8 +100,10 @@ const updateEntryfromArrayBusinessProperty = (
|
|
|
103
100
|
});
|
|
104
101
|
};
|
|
105
102
|
|
|
106
|
-
export
|
|
103
|
+
export const userInformation = {
|
|
107
104
|
addEntryToArrayBusinessProperty,
|
|
108
105
|
removeEntryFromArrayBusinessProperty,
|
|
109
106
|
updateEntryfromArrayBusinessProperty,
|
|
110
107
|
};
|
|
108
|
+
|
|
109
|
+
export default userInformation;
|