@stackfactor/client-api 1.1.134 → 1.1.135
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 +4 -3
- package/declarations/axios.d.ts +1 -0
- package/declarations/html2plaintext.d.ts +1 -0
- package/dist/actionNotifications.d.ts +7 -0
- package/dist/actionNotifications.d.ts.map +1 -0
- package/dist/actionNotifications.js +9 -10
- package/dist/actionNotifications.js.map +1 -0
- package/dist/address.d.ts +5 -0
- package/dist/address.d.ts.map +1 -0
- package/dist/address.js +5 -6
- package/dist/address.js.map +1 -0
- package/dist/aiAssistant.d.ts +9 -0
- package/dist/aiAssistant.d.ts.map +1 -0
- package/dist/aiAssistant.js +16 -17
- package/dist/aiAssistant.js.map +1 -0
- package/dist/avatar.d.ts +5 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +4 -5
- package/dist/avatar.js.map +1 -0
- package/dist/axiosClient.d.ts +32 -0
- package/dist/axiosClient.d.ts.map +1 -0
- package/dist/axiosClient.js +17 -27
- package/dist/axiosClient.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +9 -10
- package/dist/config.js.map +1 -0
- package/dist/constants.d.ts +70 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +2 -7
- package/dist/constants.js.map +1 -0
- package/dist/dashboard.d.ts +7 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/dashboard.js +9 -10
- package/dist/dashboard.js.map +1 -0
- package/dist/departmentTrainingPlans.d.ts +13 -0
- package/dist/departmentTrainingPlans.d.ts.map +1 -0
- package/dist/departmentTrainingPlans.js +16 -17
- package/dist/departmentTrainingPlans.js.map +1 -0
- package/dist/groups.d.ts +16 -0
- package/dist/groups.d.ts.map +1 -0
- package/dist/groups.js +27 -28
- package/dist/groups.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -77
- package/dist/index.js.map +1 -0
- package/dist/integration.d.ts +95 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +62 -69
- package/dist/integration.js.map +1 -0
- package/dist/integrationConfiguration.d.ts +7 -0
- package/dist/integrationConfiguration.d.ts.map +1 -0
- package/dist/integrationConfiguration.js +10 -11
- package/dist/integrationConfiguration.js.map +1 -0
- package/dist/integrations/contentGenerator.d.ts +27 -0
- package/dist/integrations/contentGenerator.d.ts.map +1 -0
- package/dist/integrations/contentGenerator.js +12 -16
- package/dist/integrations/contentGenerator.js.map +1 -0
- package/dist/learningContent.d.ts +19 -0
- package/dist/learningContent.d.ts.map +1 -0
- package/dist/learningContent.js +30 -31
- package/dist/learningContent.js.map +1 -0
- package/dist/learningPath.d.ts +12 -0
- package/dist/learningPath.d.ts.map +1 -0
- package/dist/learningPath.js +19 -20
- package/dist/learningPath.js.map +1 -0
- package/dist/logger.d.ts +6 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +8 -9
- package/dist/logger.js.map +1 -0
- package/dist/microSkillsQuizes.d.ts +6 -0
- package/dist/microSkillsQuizes.d.ts.map +1 -0
- package/dist/microSkillsQuizes.js +8 -9
- package/dist/microSkillsQuizes.js.map +1 -0
- package/dist/quotas.d.ts +6 -0
- package/dist/quotas.d.ts.map +1 -0
- package/dist/quotas.js +7 -8
- package/dist/quotas.js.map +1 -0
- package/dist/role.d.ts +18 -0
- package/dist/role.d.ts.map +1 -0
- package/dist/role.js +32 -33
- package/dist/role.js.map +1 -0
- package/dist/roleTemplate.d.ts +13 -0
- package/dist/roleTemplate.d.ts.map +1 -0
- package/dist/roleTemplate.js +22 -23
- package/dist/roleTemplate.js.map +1 -0
- package/dist/security.d.ts +8 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +11 -12
- package/dist/security.js.map +1 -0
- package/dist/skill.d.ts +22 -0
- package/dist/skill.d.ts.map +1 -0
- package/dist/skill.js +40 -41
- package/dist/skill.js.map +1 -0
- package/dist/skillAssessmentTestingSession.d.ts +10 -0
- package/dist/skillAssessmentTestingSession.d.ts.map +1 -0
- package/dist/skillAssessmentTestingSession.js +15 -16
- package/dist/skillAssessmentTestingSession.js.map +1 -0
- package/dist/skillAssessments.d.ts +10 -0
- package/dist/skillAssessments.d.ts.map +1 -0
- package/dist/skillAssessments.js +15 -16
- package/dist/skillAssessments.js.map +1 -0
- package/dist/skillTemplate.d.ts +15 -0
- package/dist/skillTemplate.d.ts.map +1 -0
- package/dist/skillTemplate.js +26 -27
- package/dist/skillTemplate.js.map +1 -0
- package/dist/talentTransfromation.d.ts +8 -0
- package/dist/talentTransfromation.d.ts.map +1 -0
- package/dist/talentTransfromation.js +11 -12
- package/dist/talentTransfromation.js.map +1 -0
- package/dist/teams.d.ts +15 -0
- package/dist/teams.d.ts.map +1 -0
- package/dist/teams.js +25 -26
- package/dist/teams.js.map +1 -0
- package/dist/tenants.d.ts +6 -0
- package/dist/tenants.d.ts.map +1 -0
- package/dist/tenants.js +7 -8
- package/dist/tenants.js.map +1 -0
- package/dist/trainingPlans.d.ts +16 -0
- package/dist/trainingPlans.d.ts.map +1 -0
- package/dist/trainingPlans.js +19 -20
- package/dist/trainingPlans.js.map +1 -0
- package/dist/trainingPlansProficiencyLevels.d.ts +8 -0
- package/dist/trainingPlansProficiencyLevels.d.ts.map +1 -0
- package/dist/trainingPlansProficiencyLevels.js +9 -10
- package/dist/trainingPlansProficiencyLevels.js.map +1 -0
- package/dist/userInformation.d.ts +7 -0
- package/dist/userInformation.d.ts.map +1 -0
- package/dist/userInformation.js +9 -10
- package/dist/userInformation.js.map +1 -0
- package/dist/users.d.ts +31 -0
- package/dist/users.d.ts.map +1 -0
- package/dist/users.js +37 -39
- package/dist/users.js.map +1 -0
- package/dist/utils.d.ts +8 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +8 -21
- package/dist/utils.js.map +1 -0
- package/package.json +15 -14
- package/src/lib/actionNotifications.ts +10 -9
- package/src/lib/address.ts +4 -3
- package/src/lib/aiAssistant.ts +24 -23
- package/src/lib/avatar.ts +3 -2
- package/src/lib/axiosClient.ts +20 -7
- package/src/lib/config.ts +10 -9
- package/src/lib/dashboard.ts +10 -9
- package/src/lib/departmentTrainingPlans.ts +28 -31
- package/src/lib/groups.ts +37 -36
- package/src/lib/integration.ts +55 -54
- package/src/lib/integrationConfiguration.ts +14 -13
- package/src/lib/integrations/contentGenerator.ts +9 -8
- package/src/lib/learningContent.ts +55 -54
- package/src/lib/learningPath.ts +31 -30
- package/src/lib/logger.ts +8 -7
- package/src/lib/microSkillsQuizes.ts +10 -9
- package/src/lib/quotas.ts +9 -8
- package/src/lib/role.ts +55 -54
- package/src/lib/roleTemplate.ts +36 -35
- package/src/lib/security.ts +13 -12
- package/src/lib/skill.ts +71 -70
- package/src/lib/skillAssessmentTestingSession.ts +24 -23
- package/src/lib/skillAssessments.ts +24 -23
- package/src/lib/skillTemplate.ts +44 -43
- package/src/lib/talentTransfromation.ts +14 -13
- package/src/lib/teams.ts +34 -33
- package/src/lib/tenants.ts +9 -8
- package/src/lib/trainingPlans.ts +36 -35
- package/src/lib/trainingPlansProficiencyLevels.ts +13 -12
- package/src/lib/userInformation.ts +12 -11
- package/src/lib/users.ts +71 -71
- package/src/lib/utils.ts +7 -16
- package/tsconfig.json +16 -5
- package/dist/exports.js +0 -77
- package/index.d.ts +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AxiosError, AxiosResponse } from "axios";
|
|
1
2
|
import { client } from "./axiosClient";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -6,7 +7,7 @@ import { client } from "./axiosClient";
|
|
|
6
7
|
* @param {Object} data
|
|
7
8
|
* @param {String} comments
|
|
8
9
|
* @param {String} token Authorization token
|
|
9
|
-
* @returns {Promise<
|
|
10
|
+
* @returns {Promise<object>}
|
|
10
11
|
*/
|
|
11
12
|
const addEntry = (
|
|
12
13
|
id: string,
|
|
@@ -20,7 +21,7 @@ const addEntry = (
|
|
|
20
21
|
data: data,
|
|
21
22
|
id: id,
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
+
const confirmationRequest = client.put(
|
|
24
25
|
"api/v1/skillassessments/addentry",
|
|
25
26
|
requestData,
|
|
26
27
|
{
|
|
@@ -28,10 +29,10 @@ const addEntry = (
|
|
|
28
29
|
}
|
|
29
30
|
);
|
|
30
31
|
confirmationRequest
|
|
31
|
-
.then((response) => {
|
|
32
|
+
.then((response : AxiosResponse) => {
|
|
32
33
|
resolve(response.data);
|
|
33
34
|
})
|
|
34
|
-
.catch((error) => {
|
|
35
|
+
.catch((error : AxiosError) => {
|
|
35
36
|
reject(error);
|
|
36
37
|
});
|
|
37
38
|
});
|
|
@@ -43,7 +44,7 @@ const addEntry = (
|
|
|
43
44
|
* @param {String} comments
|
|
44
45
|
* @param {String} userId
|
|
45
46
|
* @param {String} token Authorization token
|
|
46
|
-
* @returns {Promise<
|
|
47
|
+
* @returns {Promise<object>}
|
|
47
48
|
*/
|
|
48
49
|
const create = (
|
|
49
50
|
data: object,
|
|
@@ -57,7 +58,7 @@ const create = (
|
|
|
57
58
|
data: data,
|
|
58
59
|
userId: userId,
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
+
const confirmationRequest = client.put(
|
|
61
62
|
"api/v1/skillassessments/",
|
|
62
63
|
requestData,
|
|
63
64
|
{
|
|
@@ -65,10 +66,10 @@ const create = (
|
|
|
65
66
|
}
|
|
66
67
|
);
|
|
67
68
|
confirmationRequest
|
|
68
|
-
.then((response) => {
|
|
69
|
+
.then((response : AxiosResponse) => {
|
|
69
70
|
resolve(response.data);
|
|
70
71
|
})
|
|
71
|
-
.catch((error) => {
|
|
72
|
+
.catch((error : AxiosError) => {
|
|
72
73
|
reject(error);
|
|
73
74
|
});
|
|
74
75
|
});
|
|
@@ -79,7 +80,7 @@ const create = (
|
|
|
79
80
|
* @param {number} id The id of the skill to be deleted
|
|
80
81
|
* @param {String} comments The comments included with the deletion
|
|
81
82
|
* @param {String} token Authorization token
|
|
82
|
-
* @returns {Promise<
|
|
83
|
+
* @returns {Promise<object>}
|
|
83
84
|
*/
|
|
84
85
|
const deleteSkillAssessment = (
|
|
85
86
|
id: number,
|
|
@@ -96,10 +97,10 @@ const deleteSkillAssessment = (
|
|
|
96
97
|
data: data,
|
|
97
98
|
});
|
|
98
99
|
request
|
|
99
|
-
.then((response) => {
|
|
100
|
+
.then((response : AxiosResponse) => {
|
|
100
101
|
resolve(response.data);
|
|
101
102
|
})
|
|
102
|
-
.catch((error) => {
|
|
103
|
+
.catch((error : AxiosError) => {
|
|
103
104
|
reject(error);
|
|
104
105
|
});
|
|
105
106
|
});
|
|
@@ -109,18 +110,18 @@ const deleteSkillAssessment = (
|
|
|
109
110
|
* Get skill assessment by id
|
|
110
111
|
* @param {String} id
|
|
111
112
|
* @param {String} token
|
|
112
|
-
* @returns {Promise<
|
|
113
|
+
* @returns {Promise<object>}
|
|
113
114
|
*/
|
|
114
115
|
const getById = (id: string, token: string): Promise<object> => {
|
|
115
116
|
return new Promise((resolve, reject) => {
|
|
116
|
-
|
|
117
|
+
const confirmationRequest = client.get(`api/v1/skillassessments/${id}`, {
|
|
117
118
|
headers: { authorization: token },
|
|
118
119
|
});
|
|
119
120
|
confirmationRequest
|
|
120
|
-
.then((response) => {
|
|
121
|
+
.then((response : AxiosResponse) => {
|
|
121
122
|
resolve(response.data);
|
|
122
123
|
})
|
|
123
|
-
.catch((error) => {
|
|
124
|
+
.catch((error : AxiosError) => {
|
|
124
125
|
reject(error);
|
|
125
126
|
});
|
|
126
127
|
});
|
|
@@ -131,7 +132,7 @@ const getById = (id: string, token: string): Promise<object> => {
|
|
|
131
132
|
* @param {String} userId
|
|
132
133
|
* @param {String} skillId
|
|
133
134
|
* @param {String} token
|
|
134
|
-
* @returns {Promise<
|
|
135
|
+
* @returns {Promise<object>} The skill assessment
|
|
135
136
|
*/
|
|
136
137
|
const getByUserAndSkill = (
|
|
137
138
|
userId: string,
|
|
@@ -139,17 +140,17 @@ const getByUserAndSkill = (
|
|
|
139
140
|
token: string
|
|
140
141
|
): Promise<object> => {
|
|
141
142
|
return new Promise((resolve, reject) => {
|
|
142
|
-
|
|
143
|
+
const confirmationRequest = client.get(
|
|
143
144
|
`api/v1/skillassessments/getbyuserandskill/${userId}/${skillId}`,
|
|
144
145
|
{
|
|
145
146
|
headers: { authorization: token },
|
|
146
147
|
}
|
|
147
148
|
);
|
|
148
149
|
confirmationRequest
|
|
149
|
-
.then((response) => {
|
|
150
|
+
.then((response : AxiosResponse) => {
|
|
150
151
|
resolve(response.data);
|
|
151
152
|
})
|
|
152
|
-
.catch((error) => {
|
|
153
|
+
.catch((error : AxiosError) => {
|
|
153
154
|
reject(error);
|
|
154
155
|
});
|
|
155
156
|
});
|
|
@@ -159,13 +160,13 @@ const getByUserAndSkill = (
|
|
|
159
160
|
* Get list
|
|
160
161
|
* @param {String} userId The user used to select the skill
|
|
161
162
|
* @param {String} token Authorization token
|
|
162
|
-
* @returns {Promise<
|
|
163
|
+
* @returns {Promise<object>}
|
|
163
164
|
*/
|
|
164
165
|
const getList = (userId: string, token: string): Promise<object> => {
|
|
165
166
|
return new Promise((resolve, reject) => {
|
|
166
167
|
const requestData: { userId?: string } = {};
|
|
167
168
|
if (userId) requestData.userId = userId;
|
|
168
|
-
|
|
169
|
+
const confirmationRequest = client.post(
|
|
169
170
|
`api/v1/skillassessments`,
|
|
170
171
|
requestData,
|
|
171
172
|
{
|
|
@@ -173,10 +174,10 @@ const getList = (userId: string, token: string): Promise<object> => {
|
|
|
173
174
|
}
|
|
174
175
|
);
|
|
175
176
|
confirmationRequest
|
|
176
|
-
.then((response) => {
|
|
177
|
+
.then((response : AxiosResponse) => {
|
|
177
178
|
resolve(response.data);
|
|
178
179
|
})
|
|
179
|
-
.catch((error) => {
|
|
180
|
+
.catch((error : AxiosError) => {
|
|
180
181
|
reject(error);
|
|
181
182
|
});
|
|
182
183
|
});
|
package/src/lib/skillTemplate.ts
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
+
import { AxiosError, AxiosResponse } from "axios";
|
|
1
2
|
import { client } from "./axiosClient";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Create skill template and set information
|
|
5
6
|
* @param {Object} data
|
|
6
7
|
* @param {String} token Authorization token
|
|
7
|
-
* @returns {Promise<
|
|
8
|
+
* @returns {Promise<object>}
|
|
8
9
|
*/
|
|
9
10
|
const createSkillTemplate = (data: object, token: string): Promise<object> => {
|
|
10
11
|
return new Promise((resolve, reject) => {
|
|
11
12
|
const requestData = {
|
|
12
13
|
data: data,
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
+
const confirmationRequest = client.put("api/v1/skilltemplates", requestData, {
|
|
15
16
|
headers: { authorization: token },
|
|
16
17
|
});
|
|
17
18
|
confirmationRequest
|
|
18
|
-
.then((response) => {
|
|
19
|
+
.then((response : AxiosResponse) => {
|
|
19
20
|
resolve(response.data);
|
|
20
21
|
})
|
|
21
|
-
.catch((error) => {
|
|
22
|
+
.catch((error : AxiosError) => {
|
|
22
23
|
reject(error);
|
|
23
24
|
});
|
|
24
25
|
});
|
|
@@ -29,7 +30,7 @@ const createSkillTemplate = (data: object, token: string): Promise<object> => {
|
|
|
29
30
|
* @param {number} id The id of the template to be deleted
|
|
30
31
|
* @param {String} comments The comments included with the deletion
|
|
31
32
|
* @param {String} token Authorization token
|
|
32
|
-
* @returns {Promise<
|
|
33
|
+
* @returns {Promise<object>}
|
|
33
34
|
*/
|
|
34
35
|
const deleteSkillTemplate = (
|
|
35
36
|
id: number,
|
|
@@ -46,10 +47,10 @@ const deleteSkillTemplate = (
|
|
|
46
47
|
data: data,
|
|
47
48
|
});
|
|
48
49
|
request
|
|
49
|
-
.then((response) => {
|
|
50
|
+
.then((response : AxiosResponse) => {
|
|
50
51
|
resolve(response.data);
|
|
51
52
|
})
|
|
52
|
-
.catch((error) => {
|
|
53
|
+
.catch((error : AxiosError) => {
|
|
53
54
|
reject(error);
|
|
54
55
|
});
|
|
55
56
|
});
|
|
@@ -59,7 +60,7 @@ const deleteSkillTemplate = (
|
|
|
59
60
|
* Discard the skill template draft changes
|
|
60
61
|
* @param {String} id The id of the skill template to be deleted
|
|
61
62
|
* @param {String} token Authorization token
|
|
62
|
-
* @returns {Promise<
|
|
63
|
+
* @returns {Promise<object>}
|
|
63
64
|
*/
|
|
64
65
|
const discardSkillTemplateChanges = (
|
|
65
66
|
id: string,
|
|
@@ -72,10 +73,10 @@ const discardSkillTemplateChanges = (
|
|
|
72
73
|
data: data,
|
|
73
74
|
});
|
|
74
75
|
request
|
|
75
|
-
.then((response) => {
|
|
76
|
+
.then((response : AxiosResponse) => {
|
|
76
77
|
resolve(response.data);
|
|
77
78
|
})
|
|
78
|
-
.catch((error) => {
|
|
79
|
+
.catch((error : AxiosError) => {
|
|
79
80
|
reject(error);
|
|
80
81
|
});
|
|
81
82
|
});
|
|
@@ -87,7 +88,7 @@ const discardSkillTemplateChanges = (
|
|
|
87
88
|
* @param {String} version The version of the template
|
|
88
89
|
* @param {Boolean} returnNullIfVersionNotFound When true it will return null if the version is not found
|
|
89
90
|
* @param {String} token Authorization token
|
|
90
|
-
* @returns {Promise<
|
|
91
|
+
* @returns {Promise<object>}
|
|
91
92
|
*/
|
|
92
93
|
const getSkillTemplateInformationById = (
|
|
93
94
|
id: string,
|
|
@@ -96,17 +97,17 @@ const getSkillTemplateInformationById = (
|
|
|
96
97
|
token: string
|
|
97
98
|
): Promise<object> => {
|
|
98
99
|
return new Promise((resolve, reject) => {
|
|
99
|
-
|
|
100
|
+
const confirmationRequest = client.get(
|
|
100
101
|
`api/v1/skilltemplates/${id}/${version}/${returnNullIfVersionNotFound}`,
|
|
101
102
|
{
|
|
102
103
|
headers: { authorization: token },
|
|
103
104
|
}
|
|
104
105
|
);
|
|
105
106
|
confirmationRequest
|
|
106
|
-
.then((response) => {
|
|
107
|
+
.then((response : AxiosResponse) => {
|
|
107
108
|
resolve(response.data);
|
|
108
109
|
})
|
|
109
|
-
.catch((error) => {
|
|
110
|
+
.catch((error : AxiosError) => {
|
|
110
111
|
reject(error);
|
|
111
112
|
});
|
|
112
113
|
});
|
|
@@ -119,7 +120,7 @@ const getSkillTemplateInformationById = (
|
|
|
119
120
|
* @param {Boolean} includeDeleted When true it will return the deleted records as well
|
|
120
121
|
* @param {Boolean} namesOnly When true it will return only the names of the templates
|
|
121
122
|
* @param {String} token Authorization token
|
|
122
|
-
* @returns {Promise<
|
|
123
|
+
* @returns {Promise<object>}
|
|
123
124
|
*/
|
|
124
125
|
const getSkillTemplateList = (
|
|
125
126
|
filter: string[],
|
|
@@ -135,7 +136,7 @@ const getSkillTemplateList = (
|
|
|
135
136
|
version: version,
|
|
136
137
|
};
|
|
137
138
|
if (filter) requestData.filter = filter;
|
|
138
|
-
|
|
139
|
+
const confirmationRequest = client.post(
|
|
139
140
|
`api/v1/skilltemplates`,
|
|
140
141
|
requestData,
|
|
141
142
|
{
|
|
@@ -143,10 +144,10 @@ const getSkillTemplateList = (
|
|
|
143
144
|
}
|
|
144
145
|
);
|
|
145
146
|
confirmationRequest
|
|
146
|
-
.then((response) => {
|
|
147
|
+
.then((response : AxiosResponse) => {
|
|
147
148
|
resolve(response.data);
|
|
148
149
|
})
|
|
149
|
-
.catch((error) => {
|
|
150
|
+
.catch((error : AxiosError) => {
|
|
150
151
|
reject(error);
|
|
151
152
|
});
|
|
152
153
|
});
|
|
@@ -155,18 +156,18 @@ const getSkillTemplateList = (
|
|
|
155
156
|
/**
|
|
156
157
|
* Get skill technology stacks template list
|
|
157
158
|
* @param {String} token Authorization token
|
|
158
|
-
* @returns {Promise<
|
|
159
|
+
* @returns {Promise<object>}
|
|
159
160
|
*/
|
|
160
161
|
const getTechnologyStacks = (token: string): Promise<object> => {
|
|
161
162
|
return new Promise((resolve, reject) => {
|
|
162
|
-
|
|
163
|
+
const confirmationRequest = client.get(`api/v1/skilltemplates/stacks`, {
|
|
163
164
|
headers: { authorization: token },
|
|
164
165
|
});
|
|
165
166
|
confirmationRequest
|
|
166
|
-
.then((response) => {
|
|
167
|
+
.then((response : AxiosResponse) => {
|
|
167
168
|
resolve(response.data);
|
|
168
169
|
})
|
|
169
|
-
.catch((error) => {
|
|
170
|
+
.catch((error : AxiosError) => {
|
|
170
171
|
reject(error);
|
|
171
172
|
});
|
|
172
173
|
});
|
|
@@ -177,7 +178,7 @@ const getTechnologyStacks = (token: string): Promise<object> => {
|
|
|
177
178
|
* @param {number} id The id of the template to be published
|
|
178
179
|
* @param {String} comments The comments to be include with the request
|
|
179
180
|
* @param {String} token Authorization token
|
|
180
|
-
* @returns {Promise<
|
|
181
|
+
* @returns {Promise<object>}
|
|
181
182
|
*/
|
|
182
183
|
const publishTemplate = (
|
|
183
184
|
id: number,
|
|
@@ -185,9 +186,9 @@ const publishTemplate = (
|
|
|
185
186
|
token: string
|
|
186
187
|
): Promise<object> => {
|
|
187
188
|
return new Promise((resolve, reject) => {
|
|
188
|
-
|
|
189
|
+
const data: { comments?: string } = {};
|
|
189
190
|
if (comments) data.comments = comments;
|
|
190
|
-
|
|
191
|
+
const confirmationRequest = client.post(
|
|
191
192
|
`api/v1/skilltemplates/publish/${id}`,
|
|
192
193
|
data,
|
|
193
194
|
{
|
|
@@ -195,10 +196,10 @@ const publishTemplate = (
|
|
|
195
196
|
}
|
|
196
197
|
);
|
|
197
198
|
confirmationRequest
|
|
198
|
-
.then((response) => {
|
|
199
|
+
.then((response : AxiosResponse) => {
|
|
199
200
|
resolve(response.data);
|
|
200
201
|
})
|
|
201
|
-
.catch((error) => {
|
|
202
|
+
.catch((error : AxiosError) => {
|
|
202
203
|
reject(error);
|
|
203
204
|
});
|
|
204
205
|
});
|
|
@@ -209,7 +210,7 @@ const publishTemplate = (
|
|
|
209
210
|
* @param {String} id The id of the template to be updated
|
|
210
211
|
* @param {Object} data Data used to update the template
|
|
211
212
|
* @param {String} token Authorization token
|
|
212
|
-
* @returns {Promise<
|
|
213
|
+
* @returns {Promise<object>}
|
|
213
214
|
*/
|
|
214
215
|
const setTemplateInformation = (
|
|
215
216
|
id: string,
|
|
@@ -221,7 +222,7 @@ const setTemplateInformation = (
|
|
|
221
222
|
data: data,
|
|
222
223
|
id: id,
|
|
223
224
|
};
|
|
224
|
-
|
|
225
|
+
const confirmationRequest = client.post(
|
|
225
226
|
`api/v1/skilltemplates/update`,
|
|
226
227
|
requestData,
|
|
227
228
|
{
|
|
@@ -229,10 +230,10 @@ const setTemplateInformation = (
|
|
|
229
230
|
}
|
|
230
231
|
);
|
|
231
232
|
confirmationRequest
|
|
232
|
-
.then((response) => {
|
|
233
|
+
.then((response : AxiosResponse) => {
|
|
233
234
|
resolve(response.data);
|
|
234
235
|
})
|
|
235
|
-
.catch((error) => {
|
|
236
|
+
.catch((error : AxiosError) => {
|
|
236
237
|
reject(error);
|
|
237
238
|
});
|
|
238
239
|
});
|
|
@@ -243,7 +244,7 @@ const setTemplateInformation = (
|
|
|
243
244
|
* @param {String} id The id of the template to be updated
|
|
244
245
|
* @param {Object} tags Updated template tags
|
|
245
246
|
* @param {String} token Authorization token
|
|
246
|
-
* @returns {Promise<
|
|
247
|
+
* @returns {Promise<object>}
|
|
247
248
|
*/
|
|
248
249
|
const setTemplateTags = (
|
|
249
250
|
id: string,
|
|
@@ -255,7 +256,7 @@ const setTemplateTags = (
|
|
|
255
256
|
tags: tags,
|
|
256
257
|
id: id,
|
|
257
258
|
};
|
|
258
|
-
|
|
259
|
+
const confirmationRequest = client.post(
|
|
259
260
|
`api/v1/skilltemplates/updatetags/`,
|
|
260
261
|
requestData,
|
|
261
262
|
{
|
|
@@ -263,10 +264,10 @@ const setTemplateTags = (
|
|
|
263
264
|
}
|
|
264
265
|
);
|
|
265
266
|
confirmationRequest
|
|
266
|
-
.then((response) => {
|
|
267
|
+
.then((response : AxiosResponse) => {
|
|
267
268
|
resolve(response.data);
|
|
268
269
|
})
|
|
269
|
-
.catch((error) => {
|
|
270
|
+
.catch((error : AxiosError) => {
|
|
270
271
|
reject(error);
|
|
271
272
|
});
|
|
272
273
|
});
|
|
@@ -276,14 +277,14 @@ const setTemplateTags = (
|
|
|
276
277
|
* Validate skill template information
|
|
277
278
|
* @param {String} id The id of the skill to be updated
|
|
278
279
|
* @param {String} token Authorization token
|
|
279
|
-
* @returns {Promise<
|
|
280
|
+
* @returns {Promise<object>}
|
|
280
281
|
*/
|
|
281
282
|
const validateTemplate = (id: string, token: string): Promise<object> => {
|
|
282
283
|
return new Promise((resolve, reject) => {
|
|
283
284
|
const requestData = {
|
|
284
285
|
id: id,
|
|
285
286
|
};
|
|
286
|
-
|
|
287
|
+
const confirmationRequest = client.post(
|
|
287
288
|
`api/v1/skilltemplates/validate/`,
|
|
288
289
|
requestData,
|
|
289
290
|
{
|
|
@@ -291,10 +292,10 @@ const validateTemplate = (id: string, token: string): Promise<object> => {
|
|
|
291
292
|
}
|
|
292
293
|
);
|
|
293
294
|
confirmationRequest
|
|
294
|
-
.then((response) => {
|
|
295
|
+
.then((response : AxiosResponse) => {
|
|
295
296
|
resolve(response.data);
|
|
296
297
|
})
|
|
297
|
-
.catch((error) => {
|
|
298
|
+
.catch((error : AxiosError) => {
|
|
298
299
|
reject(error);
|
|
299
300
|
});
|
|
300
301
|
});
|
|
@@ -305,7 +306,7 @@ const validateTemplate = (id: string, token: string): Promise<object> => {
|
|
|
305
306
|
* @param {String} id The id of the skill template to be updated
|
|
306
307
|
* @param {Boolean} watch Set to true or false
|
|
307
308
|
* @param {String} token Authorization token
|
|
308
|
-
* @returns {Promise<
|
|
309
|
+
* @returns {Promise<object>}
|
|
309
310
|
*/
|
|
310
311
|
const watchSkillTemplate = (
|
|
311
312
|
id: string,
|
|
@@ -317,7 +318,7 @@ const watchSkillTemplate = (
|
|
|
317
318
|
id: id,
|
|
318
319
|
watch: watch,
|
|
319
320
|
};
|
|
320
|
-
|
|
321
|
+
const confirmationRequest = client.post(
|
|
321
322
|
`api/v1/skilltemplates/watch`,
|
|
322
323
|
requestData,
|
|
323
324
|
{
|
|
@@ -325,10 +326,10 @@ const watchSkillTemplate = (
|
|
|
325
326
|
}
|
|
326
327
|
);
|
|
327
328
|
confirmationRequest
|
|
328
|
-
.then((response) => {
|
|
329
|
+
.then((response : AxiosResponse) => {
|
|
329
330
|
resolve(response.data);
|
|
330
331
|
})
|
|
331
|
-
.catch((error) => {
|
|
332
|
+
.catch((error : AxiosError) => {
|
|
332
333
|
reject(error);
|
|
333
334
|
});
|
|
334
335
|
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { AxiosError, AxiosResponse } from "axios";
|
|
1
2
|
import { client } from "./axiosClient";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Get talent transformation steps for the current user
|
|
5
6
|
* @param {String} authToken The authentication token
|
|
6
|
-
* @returns {Promise<
|
|
7
|
+
* @returns {Promise<object>}
|
|
7
8
|
*/
|
|
8
9
|
const getTalentTransformationStepsForCurrentUser = (
|
|
9
10
|
authToken: string
|
|
@@ -18,10 +19,10 @@ const getTalentTransformationStepsForCurrentUser = (
|
|
|
18
19
|
: {}
|
|
19
20
|
);
|
|
20
21
|
request
|
|
21
|
-
.then((response) => {
|
|
22
|
+
.then((response : AxiosResponse) => {
|
|
22
23
|
resolve(response.data);
|
|
23
24
|
})
|
|
24
|
-
.catch((error) => {
|
|
25
|
+
.catch((error : AxiosError) => {
|
|
25
26
|
reject(error);
|
|
26
27
|
});
|
|
27
28
|
});
|
|
@@ -30,7 +31,7 @@ const getTalentTransformationStepsForCurrentUser = (
|
|
|
30
31
|
/**
|
|
31
32
|
* Get the talent transformation summary for the whole organization
|
|
32
33
|
* @param {String} authToken
|
|
33
|
-
* @returns {Promise<
|
|
34
|
+
* @returns {Promise<object>} The talent transformation summary
|
|
34
35
|
*/
|
|
35
36
|
const getTalentTransformationSummary = (authToken: string): Promise<object> => {
|
|
36
37
|
return new Promise((resolve, reject) => {
|
|
@@ -43,10 +44,10 @@ const getTalentTransformationSummary = (authToken: string): Promise<object> => {
|
|
|
43
44
|
: {}
|
|
44
45
|
);
|
|
45
46
|
request
|
|
46
|
-
.then((response) => {
|
|
47
|
+
.then((response : AxiosResponse) => {
|
|
47
48
|
resolve(response.data);
|
|
48
49
|
})
|
|
49
|
-
.catch((error) => {
|
|
50
|
+
.catch((error : AxiosError) => {
|
|
50
51
|
reject(error);
|
|
51
52
|
});
|
|
52
53
|
});
|
|
@@ -56,7 +57,7 @@ const getTalentTransformationSummary = (authToken: string): Promise<object> => {
|
|
|
56
57
|
* Get the talent transformation summary for the team
|
|
57
58
|
* @param {String} teamId
|
|
58
59
|
* @param {String} authToken
|
|
59
|
-
* @returns {Promise<
|
|
60
|
+
* @returns {Promise<object>} The talent transformation summary
|
|
60
61
|
*/
|
|
61
62
|
const getTalentTransformationSummaryForTeam = (
|
|
62
63
|
teamId: string,
|
|
@@ -72,10 +73,10 @@ const getTalentTransformationSummaryForTeam = (
|
|
|
72
73
|
: {}
|
|
73
74
|
);
|
|
74
75
|
request
|
|
75
|
-
.then((response) => {
|
|
76
|
+
.then((response : AxiosResponse) => {
|
|
76
77
|
resolve(response.data);
|
|
77
78
|
})
|
|
78
|
-
.catch((error) => {
|
|
79
|
+
.catch((error : AxiosError) => {
|
|
79
80
|
reject(error);
|
|
80
81
|
});
|
|
81
82
|
});
|
|
@@ -87,7 +88,7 @@ const getTalentTransformationSummaryForTeam = (
|
|
|
87
88
|
* @param {Object} data Data used to update the talent transformation step
|
|
88
89
|
* @param {Boolean} returnAllStepsStatuses If true, return all steps statuses
|
|
89
90
|
* @param {String} token Authorization token
|
|
90
|
-
* @returns {Promise<
|
|
91
|
+
* @returns {Promise<object>}
|
|
91
92
|
*/
|
|
92
93
|
const setTalentTransformationStepData = (
|
|
93
94
|
id: string,
|
|
@@ -101,7 +102,7 @@ const setTalentTransformationStepData = (
|
|
|
101
102
|
id: id,
|
|
102
103
|
returnAllStepsStatuses: returnAllStepsStatuses,
|
|
103
104
|
};
|
|
104
|
-
|
|
105
|
+
const confirmationRequest = client.post(
|
|
105
106
|
`api/v1/talenttransformation/setdata/`,
|
|
106
107
|
requestData,
|
|
107
108
|
{
|
|
@@ -109,10 +110,10 @@ const setTalentTransformationStepData = (
|
|
|
109
110
|
}
|
|
110
111
|
);
|
|
111
112
|
confirmationRequest
|
|
112
|
-
.then((response) => {
|
|
113
|
+
.then((response : AxiosResponse) => {
|
|
113
114
|
resolve(response.data);
|
|
114
115
|
})
|
|
115
|
-
.catch((error) => {
|
|
116
|
+
.catch((error : AxiosError) => {
|
|
116
117
|
reject(error);
|
|
117
118
|
});
|
|
118
119
|
});
|