@stackfactor/client-api 1.1.133 → 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 -17
- 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 +11 -10
- package/src/lib/address.ts +5 -4
- package/src/lib/aiAssistant.ts +25 -24
- package/src/lib/avatar.ts +4 -3
- package/src/lib/axiosClient.ts +22 -9
- package/src/lib/config.ts +11 -10
- package/src/lib/dashboard.ts +11 -10
- package/src/lib/departmentTrainingPlans.ts +29 -32
- package/src/lib/groups.ts +38 -37
- package/src/lib/index.ts +85 -1
- package/src/lib/integration.ts +56 -55
- package/src/lib/integrationConfiguration.ts +15 -14
- package/src/lib/integrations/contentGenerator.ts +10 -9
- package/src/lib/learningContent.ts +56 -55
- package/src/lib/learningPath.ts +32 -31
- package/src/lib/logger.ts +9 -8
- package/src/lib/microSkillsQuizes.ts +11 -10
- package/src/lib/quotas.ts +10 -9
- package/src/lib/role.ts +56 -55
- package/src/lib/roleTemplate.ts +37 -36
- package/src/lib/security.ts +14 -13
- package/src/lib/skill.ts +72 -71
- package/src/lib/skillAssessmentTestingSession.ts +25 -24
- package/src/lib/skillAssessments.ts +25 -24
- package/src/lib/skillTemplate.ts +45 -44
- package/src/lib/talentTransfromation.ts +15 -14
- package/src/lib/teams.ts +35 -34
- package/src/lib/tenants.ts +10 -9
- package/src/lib/trainingPlans.ts +37 -36
- package/src/lib/trainingPlansProficiencyLevels.ts +14 -13
- package/src/lib/userInformation.ts +13 -12
- package/src/lib/users.ts +72 -72
- package/src/lib/utils.ts +7 -16
- package/tsconfig.json +16 -5
- package/dist/exports.js +0 -77
- package/index.d.ts +0 -1
- package/src/lib/exports.ts +0 -85
package/src/lib/security.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxiosError, AxiosResponse } from "axios";
|
|
2
|
+
import { client } from "./axiosClient";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Get the enabled authentication connections for current organization.
|
|
5
6
|
* @param {String} authToken - Authorization token
|
|
6
|
-
* @returns {Promise<
|
|
7
|
+
* @returns {Promise<object>}
|
|
7
8
|
*/
|
|
8
9
|
const getAuthConnections = (authToken: string): Promise<object> => {
|
|
9
10
|
return new Promise((resolve, reject) => {
|
|
@@ -12,10 +13,10 @@ const getAuthConnections = (authToken: string): Promise<object> => {
|
|
|
12
13
|
{ headers: { authorization: authToken } }
|
|
13
14
|
);
|
|
14
15
|
getConfigInformationRequest
|
|
15
|
-
.then((response) => {
|
|
16
|
+
.then((response : AxiosResponse) => {
|
|
16
17
|
resolve(response.data);
|
|
17
18
|
})
|
|
18
|
-
.catch((error) => {
|
|
19
|
+
.catch((error : AxiosError) => {
|
|
19
20
|
reject(error);
|
|
20
21
|
});
|
|
21
22
|
});
|
|
@@ -25,7 +26,7 @@ const getAuthConnections = (authToken: string): Promise<object> => {
|
|
|
25
26
|
* Set the enabled authentication connections for current organization.
|
|
26
27
|
* @param {Object} data - the object containing the updated configuration
|
|
27
28
|
* @param {String} authToken - Authorization token
|
|
28
|
-
* @returns {Promise<
|
|
29
|
+
* @returns {Promise<object>}
|
|
29
30
|
*/
|
|
30
31
|
const setAuthConnections = (
|
|
31
32
|
data: object,
|
|
@@ -38,10 +39,10 @@ const setAuthConnections = (
|
|
|
38
39
|
{ headers: { authorization: authToken } }
|
|
39
40
|
);
|
|
40
41
|
setConfigInformationRequest
|
|
41
|
-
.then((response) => {
|
|
42
|
+
.then((response : AxiosResponse) => {
|
|
42
43
|
resolve(response.data);
|
|
43
44
|
})
|
|
44
|
-
.catch((error) => {
|
|
45
|
+
.catch((error : AxiosError) => {
|
|
45
46
|
reject(error);
|
|
46
47
|
});
|
|
47
48
|
});
|
|
@@ -51,7 +52,7 @@ const setAuthConnections = (
|
|
|
51
52
|
* Reset the MFA for the user.
|
|
52
53
|
* @param {String} userId
|
|
53
54
|
* @param {String} authToken
|
|
54
|
-
* @returns {Promise<
|
|
55
|
+
* @returns {Promise<object>}
|
|
55
56
|
*/
|
|
56
57
|
const resetMFA = (userId: string, authToken: string): Promise<object> => {
|
|
57
58
|
return new Promise((resolve, reject) => {
|
|
@@ -61,10 +62,10 @@ const resetMFA = (userId: string, authToken: string): Promise<object> => {
|
|
|
61
62
|
{ headers: { authorization: authToken } }
|
|
62
63
|
);
|
|
63
64
|
resetMFARequest
|
|
64
|
-
.then((response) => {
|
|
65
|
+
.then((response : AxiosResponse) => {
|
|
65
66
|
resolve(response.data);
|
|
66
67
|
})
|
|
67
|
-
.catch((error) => {
|
|
68
|
+
.catch((error : AxiosError) => {
|
|
68
69
|
reject(error);
|
|
69
70
|
});
|
|
70
71
|
});
|
|
@@ -73,7 +74,7 @@ const resetMFA = (userId: string, authToken: string): Promise<object> => {
|
|
|
73
74
|
/**
|
|
74
75
|
* Synchronize the authentication connections with Auth0.
|
|
75
76
|
* @param {String} authToken
|
|
76
|
-
* @returns {Promise<
|
|
77
|
+
* @returns {Promise<object>}
|
|
77
78
|
*/
|
|
78
79
|
const synchronizeWithAuth0 = (authToken: string): Promise<object> => {
|
|
79
80
|
return new Promise((resolve, reject) => {
|
|
@@ -82,10 +83,10 @@ const synchronizeWithAuth0 = (authToken: string): Promise<object> => {
|
|
|
82
83
|
{ headers: { authorization: authToken } }
|
|
83
84
|
);
|
|
84
85
|
synchronizeRequest
|
|
85
|
-
.then((response) => {
|
|
86
|
+
.then((response : AxiosResponse) => {
|
|
86
87
|
resolve(response.data);
|
|
87
88
|
})
|
|
88
|
-
.catch((error) => {
|
|
89
|
+
.catch((error : AxiosError) => {
|
|
89
90
|
reject(error);
|
|
90
91
|
});
|
|
91
92
|
});
|
package/src/lib/skill.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxiosError, AxiosResponse } from "axios";
|
|
2
|
+
import { client } from "./axiosClient";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Create skill 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 createSkill = (data: object, token: string): Promise<object> => {
|
|
10
11
|
return new Promise((resolve, reject) => {
|
|
11
|
-
|
|
12
|
+
const confirmationRequest = client.put(
|
|
12
13
|
"api/v1/skills",
|
|
13
14
|
{ data: data },
|
|
14
15
|
{
|
|
@@ -16,10 +17,10 @@ const createSkill = (data: object, token: string): Promise<object> => {
|
|
|
16
17
|
}
|
|
17
18
|
);
|
|
18
19
|
confirmationRequest
|
|
19
|
-
.then((response) => {
|
|
20
|
+
.then((response : AxiosResponse) => {
|
|
20
21
|
resolve(response.data);
|
|
21
22
|
})
|
|
22
|
-
.catch((error) => {
|
|
23
|
+
.catch((error : AxiosError) => {
|
|
23
24
|
reject(error);
|
|
24
25
|
});
|
|
25
26
|
});
|
|
@@ -29,7 +30,7 @@ const createSkill = (data: object, token: string): Promise<object> => {
|
|
|
29
30
|
* Create skills from templates
|
|
30
31
|
* @param {Array<String>} templateIds
|
|
31
32
|
* @param {String} token Authorization token
|
|
32
|
-
* @returns {Promise<
|
|
33
|
+
* @returns {Promise<object>}
|
|
33
34
|
*/
|
|
34
35
|
const createSkillsFromTemplates = (
|
|
35
36
|
templateIds: string[],
|
|
@@ -39,7 +40,7 @@ const createSkillsFromTemplates = (
|
|
|
39
40
|
const requestData = {
|
|
40
41
|
templateIds: templateIds,
|
|
41
42
|
};
|
|
42
|
-
|
|
43
|
+
const confirmationRequest = client.put(
|
|
43
44
|
"api/v1/skills/createfromtemplate/",
|
|
44
45
|
requestData,
|
|
45
46
|
{
|
|
@@ -47,10 +48,10 @@ const createSkillsFromTemplates = (
|
|
|
47
48
|
}
|
|
48
49
|
);
|
|
49
50
|
confirmationRequest
|
|
50
|
-
.then((response) => {
|
|
51
|
+
.then((response : AxiosResponse) => {
|
|
51
52
|
resolve(response.data);
|
|
52
53
|
})
|
|
53
|
-
.catch((error) => {
|
|
54
|
+
.catch((error : AxiosError) => {
|
|
54
55
|
reject(error);
|
|
55
56
|
});
|
|
56
57
|
});
|
|
@@ -61,7 +62,7 @@ const createSkillsFromTemplates = (
|
|
|
61
62
|
* @param {String} id The id of the skill to be deleted
|
|
62
63
|
* @param {String} comments The comments included with the deletion
|
|
63
64
|
* @param {String} token Authorization token
|
|
64
|
-
* @returns {Promise<
|
|
65
|
+
* @returns {Promise<object>}
|
|
65
66
|
*/
|
|
66
67
|
const deleteSkill = (
|
|
67
68
|
id: string,
|
|
@@ -78,10 +79,10 @@ const deleteSkill = (
|
|
|
78
79
|
data: data,
|
|
79
80
|
});
|
|
80
81
|
request
|
|
81
|
-
.then((response) => {
|
|
82
|
+
.then((response : AxiosResponse) => {
|
|
82
83
|
resolve(response.data);
|
|
83
84
|
})
|
|
84
|
-
.catch((error) => {
|
|
85
|
+
.catch((error : AxiosError) => {
|
|
85
86
|
reject(error);
|
|
86
87
|
});
|
|
87
88
|
});
|
|
@@ -91,7 +92,7 @@ const deleteSkill = (
|
|
|
91
92
|
* Discard the skill draft changes
|
|
92
93
|
* @param {String} id The id of the skill to be discarded
|
|
93
94
|
* @param {String} token Authorization token
|
|
94
|
-
* @returns {Promise<
|
|
95
|
+
* @returns {Promise<object>}
|
|
95
96
|
*/
|
|
96
97
|
const discardSkillChanges = (id: string, token: string): Promise<object> => {
|
|
97
98
|
return new Promise((resolve, reject) => {
|
|
@@ -101,10 +102,10 @@ const discardSkillChanges = (id: string, token: string): Promise<object> => {
|
|
|
101
102
|
data: data,
|
|
102
103
|
});
|
|
103
104
|
request
|
|
104
|
-
.then((response) => {
|
|
105
|
+
.then((response : AxiosResponse) => {
|
|
105
106
|
resolve(response.data);
|
|
106
107
|
})
|
|
107
|
-
.catch((error) => {
|
|
108
|
+
.catch((error : AxiosError) => {
|
|
108
109
|
reject(error);
|
|
109
110
|
});
|
|
110
111
|
});
|
|
@@ -113,7 +114,7 @@ const discardSkillChanges = (id: string, token: string): Promise<object> => {
|
|
|
113
114
|
/**
|
|
114
115
|
* Get the list of imported skill templates
|
|
115
116
|
* @param {String} token Authorization token
|
|
116
|
-
* @returns {Promise<
|
|
117
|
+
* @returns {Promise<object>}
|
|
117
118
|
*/
|
|
118
119
|
const getImportedSkillTemplates = (token: string): Promise<object> => {
|
|
119
120
|
return new Promise((resolve, reject) => {
|
|
@@ -121,10 +122,10 @@ const getImportedSkillTemplates = (token: string): Promise<object> => {
|
|
|
121
122
|
headers: { authorization: token },
|
|
122
123
|
});
|
|
123
124
|
request
|
|
124
|
-
.then((response) => {
|
|
125
|
+
.then((response : AxiosResponse) => {
|
|
125
126
|
resolve(response.data);
|
|
126
127
|
})
|
|
127
|
-
.catch((error) => {
|
|
128
|
+
.catch((error : AxiosError) => {
|
|
128
129
|
reject(error);
|
|
129
130
|
});
|
|
130
131
|
});
|
|
@@ -135,7 +136,7 @@ const getImportedSkillTemplates = (token: string): Promise<object> => {
|
|
|
135
136
|
* @param {String} id
|
|
136
137
|
* @param {String} token Authorization token
|
|
137
138
|
* @param {Boolean} includeRoleInformation
|
|
138
|
-
* @returns {Promise<
|
|
139
|
+
* @returns {Promise<object>}
|
|
139
140
|
*/
|
|
140
141
|
const getSkillRelatedRoles = (
|
|
141
142
|
id: string,
|
|
@@ -143,17 +144,17 @@ const getSkillRelatedRoles = (
|
|
|
143
144
|
includeRoleInformation = false
|
|
144
145
|
): Promise<object> => {
|
|
145
146
|
return new Promise((resolve, reject) => {
|
|
146
|
-
|
|
147
|
+
const confirmationRequest = client.get(
|
|
147
148
|
`api/v1/skills/getskillrelatedroles/${id}/${includeRoleInformation}`,
|
|
148
149
|
{
|
|
149
150
|
headers: { authorization: token },
|
|
150
151
|
}
|
|
151
152
|
);
|
|
152
153
|
confirmationRequest
|
|
153
|
-
.then((response) => {
|
|
154
|
+
.then((response : AxiosResponse) => {
|
|
154
155
|
resolve(response.data);
|
|
155
156
|
})
|
|
156
|
-
.catch((error) => {
|
|
157
|
+
.catch((error : AxiosError) => {
|
|
157
158
|
reject(error);
|
|
158
159
|
});
|
|
159
160
|
});
|
|
@@ -163,24 +164,24 @@ const getSkillRelatedRoles = (
|
|
|
163
164
|
* Get skill required assessment type
|
|
164
165
|
* @param {String} id
|
|
165
166
|
* @param {String} token Authorization token
|
|
166
|
-
* @returns {Promise<
|
|
167
|
+
* @returns {Promise<object>}
|
|
167
168
|
*/
|
|
168
169
|
const getSkillRequiredAssessmentType = (
|
|
169
170
|
id: string,
|
|
170
171
|
token: string
|
|
171
172
|
): Promise<object> => {
|
|
172
173
|
return new Promise((resolve, reject) => {
|
|
173
|
-
|
|
174
|
+
const confirmationRequest = client.get(
|
|
174
175
|
`api/v1/skills/getrequiredassessmenttype/${id}`,
|
|
175
176
|
{
|
|
176
177
|
headers: { authorization: token },
|
|
177
178
|
}
|
|
178
179
|
);
|
|
179
180
|
confirmationRequest
|
|
180
|
-
.then((response) => {
|
|
181
|
+
.then((response : AxiosResponse) => {
|
|
181
182
|
resolve(response.data);
|
|
182
183
|
})
|
|
183
|
-
.catch((error) => {
|
|
184
|
+
.catch((error : AxiosError) => {
|
|
184
185
|
reject(error);
|
|
185
186
|
});
|
|
186
187
|
});
|
|
@@ -192,7 +193,7 @@ const getSkillRequiredAssessmentType = (
|
|
|
192
193
|
* @param {String} version The version of the skill
|
|
193
194
|
* @param {Boolean} returnNullIfVersionNotFound When true it will return null if the version is not found
|
|
194
195
|
* @param {String} token Authorization token
|
|
195
|
-
* @returns {Promise<
|
|
196
|
+
* @returns {Promise<object>}
|
|
196
197
|
*/
|
|
197
198
|
const getSkillInformationById = (
|
|
198
199
|
id: string,
|
|
@@ -201,17 +202,17 @@ const getSkillInformationById = (
|
|
|
201
202
|
token: string
|
|
202
203
|
): Promise<object> => {
|
|
203
204
|
return new Promise((resolve, reject) => {
|
|
204
|
-
|
|
205
|
+
const confirmationRequest = client.get(
|
|
205
206
|
`api/v1/skills/skill/${id}/${version}/${returnNullIfVersionNotFound}`,
|
|
206
207
|
{
|
|
207
208
|
headers: { authorization: token },
|
|
208
209
|
}
|
|
209
210
|
);
|
|
210
211
|
confirmationRequest
|
|
211
|
-
.then((response) => {
|
|
212
|
+
.then((response : AxiosResponse) => {
|
|
212
213
|
resolve(response.data);
|
|
213
214
|
})
|
|
214
|
-
.catch((error) => {
|
|
215
|
+
.catch((error : AxiosError) => {
|
|
215
216
|
reject(error);
|
|
216
217
|
});
|
|
217
218
|
});
|
|
@@ -225,7 +226,7 @@ const getSkillInformationById = (
|
|
|
225
226
|
* @param {Boolean} returnDefaultIfVersionNotAvailable Return the default version if published not available
|
|
226
227
|
* @param {Boolean} namesOnly Return only the names of the skills
|
|
227
228
|
* @param {String} token Authorization token
|
|
228
|
-
* @returns {Promise<
|
|
229
|
+
* @returns {Promise<object>}
|
|
229
230
|
*/
|
|
230
231
|
const getSkillList = (
|
|
231
232
|
filter: string[],
|
|
@@ -244,14 +245,14 @@ const getSkillList = (
|
|
|
244
245
|
filter: filter,
|
|
245
246
|
};
|
|
246
247
|
if (filter) requestData.filter = filter;
|
|
247
|
-
|
|
248
|
+
const confirmationRequest = client.post(`api/v1/skills`, requestData, {
|
|
248
249
|
headers: { authorization: token },
|
|
249
250
|
});
|
|
250
251
|
confirmationRequest
|
|
251
|
-
.then((response) => {
|
|
252
|
+
.then((response : AxiosResponse) => {
|
|
252
253
|
resolve(response.data);
|
|
253
254
|
})
|
|
254
|
-
.catch((error) => {
|
|
255
|
+
.catch((error : AxiosError) => {
|
|
255
256
|
reject(error);
|
|
256
257
|
});
|
|
257
258
|
});
|
|
@@ -263,7 +264,7 @@ const getSkillList = (
|
|
|
263
264
|
* @param {Number} maxDepth How many levels down in the organization the skills will be loaded
|
|
264
265
|
* @param {Boolean} returnNullIfVersionNotFound Return null if the version is not found
|
|
265
266
|
* @param {String} token Authorization token
|
|
266
|
-
* @returns {Promise<
|
|
267
|
+
* @returns {Promise<object>}
|
|
267
268
|
*/
|
|
268
269
|
const getTeamSkillsById = (
|
|
269
270
|
teamId: string,
|
|
@@ -272,17 +273,17 @@ const getTeamSkillsById = (
|
|
|
272
273
|
token: string
|
|
273
274
|
): Promise<object> => {
|
|
274
275
|
return new Promise((resolve, reject) => {
|
|
275
|
-
|
|
276
|
+
const confirmationRequest = client.get(
|
|
276
277
|
`api/v1/skills/getteambyid/${teamId}/${maxDepth}/${returnNullIfVersionNotFound}`,
|
|
277
278
|
{
|
|
278
279
|
headers: { authorization: token },
|
|
279
280
|
}
|
|
280
281
|
);
|
|
281
282
|
confirmationRequest
|
|
282
|
-
.then((response) => {
|
|
283
|
+
.then((response : AxiosResponse) => {
|
|
283
284
|
resolve(response.data);
|
|
284
285
|
})
|
|
285
|
-
.catch((error) => {
|
|
286
|
+
.catch((error : AxiosError) => {
|
|
286
287
|
reject(error);
|
|
287
288
|
});
|
|
288
289
|
});
|
|
@@ -292,24 +293,24 @@ const getTeamSkillsById = (
|
|
|
292
293
|
* Get current user team skills
|
|
293
294
|
* @param {Number} maxDepth How many levels down in the organization the skills will be loaded
|
|
294
295
|
* @param {String} token Authorization token
|
|
295
|
-
* @returns {Promise<
|
|
296
|
+
* @returns {Promise<object>}
|
|
296
297
|
*/
|
|
297
298
|
const getCurrentUserTeamSkills = (
|
|
298
299
|
maxDepth: number,
|
|
299
300
|
token: string
|
|
300
301
|
): Promise<object> => {
|
|
301
302
|
return new Promise((resolve, reject) => {
|
|
302
|
-
|
|
303
|
+
const confirmationRequest = client.get(
|
|
303
304
|
`api/v1/skills/getcurrentuserteam/${maxDepth}`,
|
|
304
305
|
{
|
|
305
306
|
headers: { authorization: token },
|
|
306
307
|
}
|
|
307
308
|
);
|
|
308
309
|
confirmationRequest
|
|
309
|
-
.then((response) => {
|
|
310
|
+
.then((response : AxiosResponse) => {
|
|
310
311
|
resolve(response.data);
|
|
311
312
|
})
|
|
312
|
-
.catch((error) => {
|
|
313
|
+
.catch((error : AxiosError) => {
|
|
313
314
|
reject(error);
|
|
314
315
|
});
|
|
315
316
|
});
|
|
@@ -319,24 +320,24 @@ const getCurrentUserTeamSkills = (
|
|
|
319
320
|
* Get skill template updates
|
|
320
321
|
* @param {String} id The skill id
|
|
321
322
|
* @param {String} token Authorization token
|
|
322
|
-
* @returns {Promise<
|
|
323
|
+
* @returns {Promise<object>}
|
|
323
324
|
*/
|
|
324
325
|
const getSkillTemplateUpdates = (
|
|
325
326
|
id: string,
|
|
326
327
|
token: string
|
|
327
328
|
): Promise<object> => {
|
|
328
329
|
return new Promise((resolve, reject) => {
|
|
329
|
-
|
|
330
|
+
const confirmationRequest = client.get(
|
|
330
331
|
`api/v1/skills/getskilltemplateupdates/${id}`,
|
|
331
332
|
{
|
|
332
333
|
headers: { authorization: token },
|
|
333
334
|
}
|
|
334
335
|
);
|
|
335
336
|
confirmationRequest
|
|
336
|
-
.then((response) => {
|
|
337
|
+
.then((response : AxiosResponse) => {
|
|
337
338
|
resolve(response.data);
|
|
338
339
|
})
|
|
339
|
-
.catch((error) => {
|
|
340
|
+
.catch((error : AxiosError) => {
|
|
340
341
|
reject(error);
|
|
341
342
|
});
|
|
342
343
|
});
|
|
@@ -347,7 +348,7 @@ const getSkillTemplateUpdates = (
|
|
|
347
348
|
* @param {Array<String>} data The list of role templates to be imported
|
|
348
349
|
* @param {Boolean} publish If true the imported templates will be published
|
|
349
350
|
* @param {String} token Authorization token
|
|
350
|
-
* @returns {Promise<
|
|
351
|
+
* @returns {Promise<object>}
|
|
351
352
|
*/
|
|
352
353
|
const importSkillTemplates = (
|
|
353
354
|
data: string[],
|
|
@@ -359,7 +360,7 @@ const importSkillTemplates = (
|
|
|
359
360
|
data: data,
|
|
360
361
|
publish: publish,
|
|
361
362
|
};
|
|
362
|
-
|
|
363
|
+
const confirmationRequest = client.post(
|
|
363
364
|
`api/v1/skills/importtemplates`,
|
|
364
365
|
requestData,
|
|
365
366
|
{
|
|
@@ -367,10 +368,10 @@ const importSkillTemplates = (
|
|
|
367
368
|
}
|
|
368
369
|
);
|
|
369
370
|
confirmationRequest
|
|
370
|
-
.then((response) => {
|
|
371
|
+
.then((response : AxiosResponse) => {
|
|
371
372
|
resolve(response.data);
|
|
372
373
|
})
|
|
373
|
-
.catch((error) => {
|
|
374
|
+
.catch((error : AxiosError) => {
|
|
374
375
|
reject(error);
|
|
375
376
|
});
|
|
376
377
|
});
|
|
@@ -381,7 +382,7 @@ const importSkillTemplates = (
|
|
|
381
382
|
* @param {String} id The id of the skill to be published
|
|
382
383
|
* @param {String} comments The comments to be include with the request
|
|
383
384
|
* @param {String} token Authorization token
|
|
384
|
-
* @returns {Promise<
|
|
385
|
+
* @returns {Promise<object>}
|
|
385
386
|
*/
|
|
386
387
|
const publishSkill = (
|
|
387
388
|
id: string,
|
|
@@ -389,16 +390,16 @@ const publishSkill = (
|
|
|
389
390
|
token: string
|
|
390
391
|
): Promise<object> => {
|
|
391
392
|
return new Promise((resolve, reject) => {
|
|
392
|
-
|
|
393
|
+
const data: { comments?: string } = {};
|
|
393
394
|
if (comments) data.comments = comments;
|
|
394
|
-
|
|
395
|
+
const confirmationRequest = client.post(`api/v1/skills/publish/${id}`, data, {
|
|
395
396
|
headers: { authorization: token },
|
|
396
397
|
});
|
|
397
398
|
confirmationRequest
|
|
398
|
-
.then((response) => {
|
|
399
|
+
.then((response : AxiosResponse) => {
|
|
399
400
|
resolve(response.data);
|
|
400
401
|
})
|
|
401
|
-
.catch((error) => {
|
|
402
|
+
.catch((error : AxiosError) => {
|
|
402
403
|
reject(error);
|
|
403
404
|
});
|
|
404
405
|
});
|
|
@@ -409,7 +410,7 @@ const publishSkill = (
|
|
|
409
410
|
* @param {String} id The id of the skill to be updated
|
|
410
411
|
* @param {Object} data Data used to update the skill
|
|
411
412
|
* @param {String} token Authorization token
|
|
412
|
-
* @returns {Promise<
|
|
413
|
+
* @returns {Promise<object>}
|
|
413
414
|
*/
|
|
414
415
|
const setSkillInformation = (
|
|
415
416
|
id: string,
|
|
@@ -421,7 +422,7 @@ const setSkillInformation = (
|
|
|
421
422
|
data: data,
|
|
422
423
|
id: id,
|
|
423
424
|
};
|
|
424
|
-
|
|
425
|
+
const confirmationRequest = client.post(
|
|
425
426
|
`api/v1/skills/update/`,
|
|
426
427
|
requestData,
|
|
427
428
|
{
|
|
@@ -429,10 +430,10 @@ const setSkillInformation = (
|
|
|
429
430
|
}
|
|
430
431
|
);
|
|
431
432
|
confirmationRequest
|
|
432
|
-
.then((response) => {
|
|
433
|
+
.then((response : AxiosResponse) => {
|
|
433
434
|
resolve(response.data);
|
|
434
435
|
})
|
|
435
|
-
.catch((error) => {
|
|
436
|
+
.catch((error : AxiosError) => {
|
|
436
437
|
reject(error);
|
|
437
438
|
});
|
|
438
439
|
});
|
|
@@ -443,7 +444,7 @@ const setSkillInformation = (
|
|
|
443
444
|
* @param {String} id The id of the skill to be updated
|
|
444
445
|
* @param {Object} data Data used to update the skill
|
|
445
446
|
* @param {String} token Authorization token
|
|
446
|
-
* @returns {Promise<
|
|
447
|
+
* @returns {Promise<object>}
|
|
447
448
|
*/
|
|
448
449
|
const setSkillInformationFromTemplate = (
|
|
449
450
|
id: string,
|
|
@@ -455,7 +456,7 @@ const setSkillInformationFromTemplate = (
|
|
|
455
456
|
data: data,
|
|
456
457
|
id: id,
|
|
457
458
|
};
|
|
458
|
-
|
|
459
|
+
const confirmationRequest = client.post(
|
|
459
460
|
`api/v1/skills/updatefromtemplate/`,
|
|
460
461
|
requestData,
|
|
461
462
|
{
|
|
@@ -463,10 +464,10 @@ const setSkillInformationFromTemplate = (
|
|
|
463
464
|
}
|
|
464
465
|
);
|
|
465
466
|
confirmationRequest
|
|
466
|
-
.then((response) => {
|
|
467
|
+
.then((response : AxiosResponse) => {
|
|
467
468
|
resolve(response.data);
|
|
468
469
|
})
|
|
469
|
-
.catch((error) => {
|
|
470
|
+
.catch((error : AxiosError) => {
|
|
470
471
|
reject(error);
|
|
471
472
|
});
|
|
472
473
|
});
|
|
@@ -476,14 +477,14 @@ const setSkillInformationFromTemplate = (
|
|
|
476
477
|
* Validate skill information
|
|
477
478
|
* @param {String} id The id of the skill to be updated
|
|
478
479
|
* @param {String} token Authorization token
|
|
479
|
-
* @returns {Promise<
|
|
480
|
+
* @returns {Promise<object>}
|
|
480
481
|
*/
|
|
481
482
|
const validateSkill = (id: string, token: string): Promise<object> => {
|
|
482
483
|
return new Promise((resolve, reject) => {
|
|
483
484
|
const requestData = {
|
|
484
485
|
id: id,
|
|
485
486
|
};
|
|
486
|
-
|
|
487
|
+
const confirmationRequest = client.post(
|
|
487
488
|
`api/v1/skills/validate/`,
|
|
488
489
|
requestData,
|
|
489
490
|
{
|
|
@@ -491,10 +492,10 @@ const validateSkill = (id: string, token: string): Promise<object> => {
|
|
|
491
492
|
}
|
|
492
493
|
);
|
|
493
494
|
confirmationRequest
|
|
494
|
-
.then((response) => {
|
|
495
|
+
.then((response : AxiosResponse) => {
|
|
495
496
|
resolve(response.data);
|
|
496
497
|
})
|
|
497
|
-
.catch((error) => {
|
|
498
|
+
.catch((error : AxiosError) => {
|
|
498
499
|
reject(error);
|
|
499
500
|
});
|
|
500
501
|
});
|
|
@@ -505,7 +506,7 @@ const validateSkill = (id: string, token: string): Promise<object> => {
|
|
|
505
506
|
* @param {String} id The id of the skill to be updated
|
|
506
507
|
* @param {Boolean} watch Set to true or false
|
|
507
508
|
* @param {String} token Authorization token
|
|
508
|
-
* @returns {Promise<
|
|
509
|
+
* @returns {Promise<object>}
|
|
509
510
|
*/
|
|
510
511
|
const watchSkill = (
|
|
511
512
|
id: string,
|
|
@@ -517,14 +518,14 @@ const watchSkill = (
|
|
|
517
518
|
id: id,
|
|
518
519
|
watch: watch,
|
|
519
520
|
};
|
|
520
|
-
|
|
521
|
+
const confirmationRequest = client.post(`api/v1/skills/watch`, requestData, {
|
|
521
522
|
headers: { authorization: token },
|
|
522
523
|
});
|
|
523
524
|
confirmationRequest
|
|
524
|
-
.then((response) => {
|
|
525
|
+
.then((response : AxiosResponse) => {
|
|
525
526
|
resolve(response.data);
|
|
526
527
|
})
|
|
527
|
-
.catch((error) => {
|
|
528
|
+
.catch((error : AxiosError) => {
|
|
528
529
|
reject(error);
|
|
529
530
|
});
|
|
530
531
|
});
|