@stackfactor/client-api 1.1.11 → 1.1.12-9.2
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/.eslintrc.json +13 -0
- package/{exports.js → exports.ts} +14 -0
- package/index.ts +1 -0
- package/lib/{actionNotifications.js → actionNotifications.ts} +21 -11
- package/lib/{address.js → address.ts} +4 -5
- package/lib/aiAssistant.ts +197 -0
- package/lib/avatar.ts +41 -0
- package/lib/axiosClient.ts +92 -0
- package/lib/{config.js → config.ts} +20 -9
- package/lib/{constants.js → constants.ts} +11 -41
- package/lib/{dashboard.js → dashboard.ts} +19 -10
- package/lib/{departmentTrainingPlans.js → departmentTrainingPlans.ts} +63 -32
- package/lib/{groups.js → groups.ts} +68 -29
- package/lib/{integration.js → integration.ts} +103 -47
- package/lib/{integrationConfiguration.js → integrationConfiguration.ts} +27 -22
- package/lib/integrations/{contentGenerator.js → contentGenerator.ts} +38 -18
- package/lib/{learningContent.js → learningContent.ts} +218 -62
- package/lib/{learningPath.js → learningPath.ts} +57 -30
- package/lib/{logger.js → logger.ts} +18 -8
- package/lib/microSkillsQuizes.ts +70 -0
- package/lib/quotas.ts +59 -0
- package/lib/{role.js → role.ts} +117 -69
- package/lib/{roleTemplate.js → roleTemplate.ts} +65 -30
- package/lib/security.ts +99 -0
- package/lib/{skill.js → skill.ts} +125 -87
- package/lib/{skillAssessments.js → skillAssessmentTestingSession.ts} +63 -16
- package/lib/skillAssessments.ts +192 -0
- package/lib/{skillTemplate.js → skillTemplate.ts} +73 -42
- package/lib/talentTransfromation.ts +126 -0
- package/lib/{teams.js → teams.ts} +73 -38
- package/lib/{tenants.js → tenants.ts} +17 -10
- package/lib/{trainingPlans.js → trainingPlans.ts} +159 -56
- package/lib/trainingPlansProficiencyLevels.ts +132 -0
- package/lib/{userInformation.js → userInformation.ts} +27 -26
- package/lib/{users.js → users.ts} +239 -140
- package/lib/utils.ts +64 -0
- package/package.json +12 -1
- package/index.js +0 -3
- package/lib/axiosClient.js +0 -85
- package/lib/skillAssessmentTestingSession.js +0 -148
- package/lib/utils.js +0 -48
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { client } from "./axiosClient.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get training plan proficiency level
|
|
5
|
+
* @param {String} proficiencyLevelId
|
|
6
|
+
* @param {String} token
|
|
7
|
+
* @returns {Promise<Object>} An object containing the proficiency level information
|
|
8
|
+
*/
|
|
9
|
+
const getTrainingPlanProficiencyLevel = (
|
|
10
|
+
proficiencyLevelId: string,
|
|
11
|
+
token: string
|
|
12
|
+
): Promise<object> => {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
let confirmationRequest = client.get(
|
|
15
|
+
`api/v1/trainingplans/proficiencylevels/${proficiencyLevelId}`,
|
|
16
|
+
{
|
|
17
|
+
headers: { authorization: token },
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
confirmationRequest
|
|
21
|
+
.then((response) => {
|
|
22
|
+
resolve(response.data);
|
|
23
|
+
})
|
|
24
|
+
.catch((error) => {
|
|
25
|
+
reject(error);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get training plan proficiency level list
|
|
32
|
+
* @param {Boolean} includeDeleted If set true it will return deleted plans too
|
|
33
|
+
* @param {Boolean} includeDetailedInformation If set to true it will return detailed information for each plan
|
|
34
|
+
* @param {Boolean} includeArchived If set to true it will return all the closed items too
|
|
35
|
+
* @param {String} token Authorization token
|
|
36
|
+
* @returns {Promise<Object>}
|
|
37
|
+
*/
|
|
38
|
+
const getTrainingPlanProficiencyLevelList = (
|
|
39
|
+
includeDeleted: boolean,
|
|
40
|
+
includeDetailedInformation: boolean,
|
|
41
|
+
includeArchived: boolean,
|
|
42
|
+
token: string
|
|
43
|
+
): Promise<object> => {
|
|
44
|
+
return new Promise((resolve, reject) => {
|
|
45
|
+
const requestData = {
|
|
46
|
+
includeArchived: includeArchived,
|
|
47
|
+
includeDeleted: includeDeleted,
|
|
48
|
+
includeDetailedInformation: includeDetailedInformation,
|
|
49
|
+
};
|
|
50
|
+
let confirmationRequest = client.post(
|
|
51
|
+
`api/v1/trainingplans/proficiencylevels`,
|
|
52
|
+
requestData,
|
|
53
|
+
{
|
|
54
|
+
headers: { authorization: token },
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
confirmationRequest
|
|
58
|
+
.then((response) => {
|
|
59
|
+
resolve(response.data);
|
|
60
|
+
})
|
|
61
|
+
.catch((error) => {
|
|
62
|
+
reject(error);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Reorder training plan proficiency levels
|
|
69
|
+
* @param {Array<Object>} order
|
|
70
|
+
* @param {String} token
|
|
71
|
+
* @returns {Promise<void>}
|
|
72
|
+
*/
|
|
73
|
+
const reorderTrainingPlansProficiencyLevels = (
|
|
74
|
+
order: object[],
|
|
75
|
+
token: string
|
|
76
|
+
): Promise<void> => {
|
|
77
|
+
return new Promise((resolve, reject) => {
|
|
78
|
+
let confirmationRequest = client.post(
|
|
79
|
+
`api/v1/trainingplans/proficiencylevels/reorder`,
|
|
80
|
+
{ order: order },
|
|
81
|
+
{
|
|
82
|
+
headers: { authorization: token },
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
confirmationRequest
|
|
86
|
+
.then(() => {
|
|
87
|
+
resolve();
|
|
88
|
+
})
|
|
89
|
+
.catch((error) => {
|
|
90
|
+
reject(error);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Update a training plan proficiency level
|
|
97
|
+
* @param {String} proficiencyLevelId
|
|
98
|
+
* @param {Object} data Ordered array of objects containing the activity Id and the new status
|
|
99
|
+
* @param {String} token
|
|
100
|
+
* @returns {Promise<void>}
|
|
101
|
+
*/
|
|
102
|
+
const updateTrainingPlanProficiencyLevel = (
|
|
103
|
+
proficiencyLevelId: string,
|
|
104
|
+
data: object,
|
|
105
|
+
token: string
|
|
106
|
+
): Promise<void> => {
|
|
107
|
+
return new Promise((resolve, reject) => {
|
|
108
|
+
let confirmationRequest = client.post(
|
|
109
|
+
`api/v1/trainingplans/proficiencylevel/${proficiencyLevelId}`,
|
|
110
|
+
data,
|
|
111
|
+
{
|
|
112
|
+
headers: { authorization: token },
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
confirmationRequest
|
|
116
|
+
.then(() => {
|
|
117
|
+
resolve();
|
|
118
|
+
})
|
|
119
|
+
.catch((error) => {
|
|
120
|
+
reject(error);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const trainingPlanProficiencyLevel = {
|
|
126
|
+
getTrainingPlanProficiencyLevel,
|
|
127
|
+
getTrainingPlanProficiencyLevelList,
|
|
128
|
+
reorderTrainingPlansProficiencyLevels,
|
|
129
|
+
updateTrainingPlanProficiencyLevel,
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export default trainingPlanProficiencyLevel;
|
|
@@ -6,14 +6,15 @@ 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>}
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
-
userId,
|
|
12
|
-
property,
|
|
13
|
-
data,
|
|
14
|
-
token
|
|
15
|
-
) => {
|
|
16
|
-
return new Promise(
|
|
11
|
+
const addEntryToArrayBusinessProperty = (
|
|
12
|
+
userId: string,
|
|
13
|
+
property: string,
|
|
14
|
+
data: object,
|
|
15
|
+
token: string
|
|
16
|
+
): Promise<object> => {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
17
18
|
const requestData = {
|
|
18
19
|
data: data,
|
|
19
20
|
};
|
|
@@ -35,19 +36,20 @@ export const addEntryToArrayBusinessProperty = (
|
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
|
-
*
|
|
39
|
+
* Remove an entry from an array type business property such as experience, education or certifications
|
|
39
40
|
* @param {String} userId
|
|
40
41
|
* @param {String} property
|
|
41
42
|
* @param {String} id
|
|
42
43
|
* @param {String} token Authorization token
|
|
44
|
+
* @returns {Promise<Object>}
|
|
43
45
|
*/
|
|
44
|
-
|
|
45
|
-
userId,
|
|
46
|
-
property,
|
|
47
|
-
id,
|
|
48
|
-
token
|
|
49
|
-
) => {
|
|
50
|
-
return new Promise(
|
|
46
|
+
const removeEntryFromArrayBusinessProperty = (
|
|
47
|
+
userId: string,
|
|
48
|
+
property: string,
|
|
49
|
+
id: string,
|
|
50
|
+
token: string
|
|
51
|
+
): Promise<object> => {
|
|
52
|
+
return new Promise((resolve, reject) => {
|
|
51
53
|
const confirmationRequest = client.delete(
|
|
52
54
|
`api/v1/user/arrayproperty/${userId}/${property}/${id}`,
|
|
53
55
|
{
|
|
@@ -71,15 +73,16 @@ export const removeEntryFromArrayBusinessProperty = (
|
|
|
71
73
|
* @param {String} id
|
|
72
74
|
* @param {Object} data
|
|
73
75
|
* @param {String} token Authorization token
|
|
76
|
+
* @returns {Promise<Object>}
|
|
74
77
|
*/
|
|
75
|
-
|
|
76
|
-
userId,
|
|
77
|
-
property,
|
|
78
|
-
id,
|
|
79
|
-
data,
|
|
80
|
-
token
|
|
81
|
-
) => {
|
|
82
|
-
return new Promise(
|
|
78
|
+
const updateEntryfromArrayBusinessProperty = (
|
|
79
|
+
userId: string,
|
|
80
|
+
property: string,
|
|
81
|
+
id: string,
|
|
82
|
+
data: object,
|
|
83
|
+
token: string
|
|
84
|
+
): Promise<object> => {
|
|
85
|
+
return new Promise((resolve, reject) => {
|
|
83
86
|
const requestData = {
|
|
84
87
|
data: data,
|
|
85
88
|
};
|
|
@@ -100,10 +103,8 @@ export const updateEntryfromArrayBusinessProperty = (
|
|
|
100
103
|
});
|
|
101
104
|
};
|
|
102
105
|
|
|
103
|
-
export
|
|
106
|
+
export default {
|
|
104
107
|
addEntryToArrayBusinessProperty,
|
|
105
108
|
removeEntryFromArrayBusinessProperty,
|
|
106
109
|
updateEntryfromArrayBusinessProperty,
|
|
107
110
|
};
|
|
108
|
-
|
|
109
|
-
export default userInformation;
|