@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
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxiosError, AxiosResponse } from "axios";
|
|
2
|
+
import { client } from "./axiosClient";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Get the integration configuration
|
|
5
6
|
* @param {Array<String>} ids
|
|
6
7
|
* @param {Number} type
|
|
7
8
|
* @param {String} token Authorization token
|
|
8
|
-
* @returns {Promise<
|
|
9
|
+
* @returns {Promise<object>}
|
|
9
10
|
*/
|
|
10
11
|
const getIntegrationsConfiguration = (
|
|
11
12
|
ids: string[],
|
|
@@ -13,9 +14,9 @@ const getIntegrationsConfiguration = (
|
|
|
13
14
|
token: string
|
|
14
15
|
): Promise<object> => {
|
|
15
16
|
return new Promise((resolve, reject) => {
|
|
16
|
-
|
|
17
|
+
const requestData: { type: number; ids?: string[] } = { type: type };
|
|
17
18
|
if (ids) requestData.ids = ids;
|
|
18
|
-
|
|
19
|
+
const confirmationRequest = client.post(
|
|
19
20
|
"api/v1/integrationsconfiguration",
|
|
20
21
|
requestData,
|
|
21
22
|
{
|
|
@@ -23,10 +24,10 @@ const getIntegrationsConfiguration = (
|
|
|
23
24
|
}
|
|
24
25
|
);
|
|
25
26
|
confirmationRequest
|
|
26
|
-
.then((response) => {
|
|
27
|
+
.then((response : AxiosResponse) => {
|
|
27
28
|
resolve(response.data);
|
|
28
29
|
})
|
|
29
|
-
.catch((error) => {
|
|
30
|
+
.catch((error : AxiosError) => {
|
|
30
31
|
reject(error);
|
|
31
32
|
});
|
|
32
33
|
});
|
|
@@ -38,7 +39,7 @@ const getIntegrationsConfiguration = (
|
|
|
38
39
|
* @param {Number} type The type of configuration
|
|
39
40
|
* @param {Object} configuration Data used to update the integration configuration
|
|
40
41
|
* @param {String} token Authorization token
|
|
41
|
-
* @returns {Promise<
|
|
42
|
+
* @returns {Promise<object>}
|
|
42
43
|
*/
|
|
43
44
|
const saveIntegrationConfiguration = (
|
|
44
45
|
id: string,
|
|
@@ -52,7 +53,7 @@ const saveIntegrationConfiguration = (
|
|
|
52
53
|
configuration: configuration,
|
|
53
54
|
type: type,
|
|
54
55
|
};
|
|
55
|
-
|
|
56
|
+
const confirmationRequest = client.put(
|
|
56
57
|
`api/v1/integrationsconfiguration`,
|
|
57
58
|
requestData,
|
|
58
59
|
{
|
|
@@ -60,10 +61,10 @@ const saveIntegrationConfiguration = (
|
|
|
60
61
|
}
|
|
61
62
|
);
|
|
62
63
|
confirmationRequest
|
|
63
|
-
.then((response) => {
|
|
64
|
+
.then((response : AxiosResponse) => {
|
|
64
65
|
resolve(response.data);
|
|
65
66
|
})
|
|
66
|
-
.catch((error) => {
|
|
67
|
+
.catch((error : AxiosError) => {
|
|
67
68
|
reject(error);
|
|
68
69
|
});
|
|
69
70
|
});
|
|
@@ -75,7 +76,7 @@ const saveIntegrationConfiguration = (
|
|
|
75
76
|
* @param {String} type The type of configuration
|
|
76
77
|
* @param {Object} configuration Configuration to be tested
|
|
77
78
|
* @param {String} token Authorization token
|
|
78
|
-
* @returns {Promise<
|
|
79
|
+
* @returns {Promise<object>}
|
|
79
80
|
*/
|
|
80
81
|
const testIntegrationConfiguration = (
|
|
81
82
|
id: string,
|
|
@@ -89,7 +90,7 @@ const testIntegrationConfiguration = (
|
|
|
89
90
|
configuration: configuration,
|
|
90
91
|
type: type,
|
|
91
92
|
};
|
|
92
|
-
|
|
93
|
+
const confirmationRequest = client.post(
|
|
93
94
|
`api/v1/integrationsconfiguration/testConfiguration`,
|
|
94
95
|
requestData,
|
|
95
96
|
{
|
|
@@ -97,10 +98,10 @@ const testIntegrationConfiguration = (
|
|
|
97
98
|
}
|
|
98
99
|
);
|
|
99
100
|
confirmationRequest
|
|
100
|
-
.then((response) => {
|
|
101
|
+
.then((response : AxiosResponse) => {
|
|
101
102
|
resolve(response.data);
|
|
102
103
|
})
|
|
103
|
-
.catch((error) => {
|
|
104
|
+
.catch((error : AxiosError) => {
|
|
104
105
|
reject(error);
|
|
105
106
|
});
|
|
106
107
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxiosError, AxiosResponse } from "axios";
|
|
2
|
+
import { client } from "../axiosClient";
|
|
2
3
|
|
|
3
4
|
interface GenerateContentData {
|
|
4
5
|
data: string[];
|
|
@@ -21,7 +22,7 @@ interface GenerateContentAsyncData {
|
|
|
21
22
|
* @param {String} contentType
|
|
22
23
|
* @param {String} integrationId
|
|
23
24
|
* @param {String} token
|
|
24
|
-
* @returns {Promise<
|
|
25
|
+
* @returns {Promise<object>}
|
|
25
26
|
*/
|
|
26
27
|
export const generateContent = (
|
|
27
28
|
data: string[],
|
|
@@ -30,7 +31,7 @@ export const generateContent = (
|
|
|
30
31
|
token: string
|
|
31
32
|
): Promise<object> => {
|
|
32
33
|
return new Promise((resolve, reject) => {
|
|
33
|
-
|
|
34
|
+
const data_: GenerateContentData = {
|
|
34
35
|
data: data,
|
|
35
36
|
contentType: contentType,
|
|
36
37
|
};
|
|
@@ -39,10 +40,10 @@ export const generateContent = (
|
|
|
39
40
|
headers: { authorization: token },
|
|
40
41
|
});
|
|
41
42
|
request
|
|
42
|
-
.then((response) => {
|
|
43
|
+
.then((response : AxiosResponse) => {
|
|
43
44
|
resolve(response.data);
|
|
44
45
|
})
|
|
45
|
-
.catch((error) => {
|
|
46
|
+
.catch((error : AxiosError) => {
|
|
46
47
|
reject(error);
|
|
47
48
|
});
|
|
48
49
|
});
|
|
@@ -57,7 +58,7 @@ export const generateContent = (
|
|
|
57
58
|
* @param {String} integrationId
|
|
58
59
|
* @param {String} comments
|
|
59
60
|
* @param {String} token
|
|
60
|
-
* @returns {Promise<
|
|
61
|
+
* @returns {Promise<object>}
|
|
61
62
|
*/
|
|
62
63
|
export const generateContentAsync = (
|
|
63
64
|
id: string,
|
|
@@ -69,7 +70,7 @@ export const generateContentAsync = (
|
|
|
69
70
|
token: string
|
|
70
71
|
): Promise<object> => {
|
|
71
72
|
return new Promise((resolve, reject) => {
|
|
72
|
-
|
|
73
|
+
const data_: GenerateContentAsyncData = {
|
|
73
74
|
id: id,
|
|
74
75
|
data: data,
|
|
75
76
|
comments: comments,
|
|
@@ -85,10 +86,10 @@ export const generateContentAsync = (
|
|
|
85
86
|
}
|
|
86
87
|
);
|
|
87
88
|
request
|
|
88
|
-
.then((response) => {
|
|
89
|
+
.then((response : AxiosResponse) => {
|
|
89
90
|
resolve(response.data);
|
|
90
91
|
})
|
|
91
|
-
.catch((error) => {
|
|
92
|
+
.catch((error : AxiosError) => {
|
|
92
93
|
reject(error);
|
|
93
94
|
});
|
|
94
95
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxiosError, AxiosResponse } from "axios";
|
|
2
|
+
import { client } from "./axiosClient";
|
|
2
3
|
|
|
3
4
|
interface LearningContentData {
|
|
4
5
|
data?: object;
|
|
@@ -22,7 +23,7 @@ interface GenerateLearningActivityContentData {
|
|
|
22
23
|
* Create learning content and set information
|
|
23
24
|
* @param {Object} data Learning content data
|
|
24
25
|
* @param {String} token Authorization token
|
|
25
|
-
* @returns {Promise<
|
|
26
|
+
* @returns {Promise<object>} The created learning content
|
|
26
27
|
*/
|
|
27
28
|
const createLearningContent = (
|
|
28
29
|
data: object,
|
|
@@ -32,7 +33,7 @@ const createLearningContent = (
|
|
|
32
33
|
const requestData: LearningContentData = {
|
|
33
34
|
data: data,
|
|
34
35
|
};
|
|
35
|
-
|
|
36
|
+
const confirmationRequest = client.put(
|
|
36
37
|
"api/v1/learningcontent",
|
|
37
38
|
requestData,
|
|
38
39
|
{
|
|
@@ -40,10 +41,10 @@ const createLearningContent = (
|
|
|
40
41
|
}
|
|
41
42
|
);
|
|
42
43
|
confirmationRequest
|
|
43
|
-
.then((response) => {
|
|
44
|
+
.then((response : AxiosResponse) => {
|
|
44
45
|
resolve(response.data);
|
|
45
46
|
})
|
|
46
|
-
.catch((error) => {
|
|
47
|
+
.catch((error : AxiosError) => {
|
|
47
48
|
reject(error);
|
|
48
49
|
});
|
|
49
50
|
});
|
|
@@ -54,7 +55,7 @@ const createLearningContent = (
|
|
|
54
55
|
* @param {String} id The id of the learning content to be deleted
|
|
55
56
|
* @param {String} comments The comments included with the deletion
|
|
56
57
|
* @param {String} token Authorization token
|
|
57
|
-
* @returns {Promise<
|
|
58
|
+
* @returns {Promise<object>} The response from the server
|
|
58
59
|
*/
|
|
59
60
|
const deleteLearningContent = (
|
|
60
61
|
id: string,
|
|
@@ -71,10 +72,10 @@ const deleteLearningContent = (
|
|
|
71
72
|
data: data,
|
|
72
73
|
});
|
|
73
74
|
request
|
|
74
|
-
.then((response) => {
|
|
75
|
+
.then((response : AxiosResponse) => {
|
|
75
76
|
resolve(response.data);
|
|
76
77
|
})
|
|
77
|
-
.catch((error) => {
|
|
78
|
+
.catch((error : AxiosError) => {
|
|
78
79
|
reject(error);
|
|
79
80
|
});
|
|
80
81
|
});
|
|
@@ -84,7 +85,7 @@ const deleteLearningContent = (
|
|
|
84
85
|
* Discard the learning content draft changes
|
|
85
86
|
* @param {String} id The id of the learning content to be deleted
|
|
86
87
|
* @param {String} token Authorization token
|
|
87
|
-
* @returns {Promise<
|
|
88
|
+
* @returns {Promise<object>} The response from the server
|
|
88
89
|
*/
|
|
89
90
|
const discardLearningContentChanges = (
|
|
90
91
|
id: string,
|
|
@@ -97,10 +98,10 @@ const discardLearningContentChanges = (
|
|
|
97
98
|
data: data,
|
|
98
99
|
});
|
|
99
100
|
request
|
|
100
|
-
.then((response) => {
|
|
101
|
+
.then((response : AxiosResponse) => {
|
|
101
102
|
resolve(response.data);
|
|
102
103
|
})
|
|
103
|
-
.catch((error) => {
|
|
104
|
+
.catch((error : AxiosError) => {
|
|
104
105
|
reject(error);
|
|
105
106
|
});
|
|
106
107
|
});
|
|
@@ -143,10 +144,10 @@ const generateLearningActivityContent = (
|
|
|
143
144
|
}
|
|
144
145
|
);
|
|
145
146
|
request
|
|
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
|
});
|
|
@@ -156,17 +157,17 @@ const generateLearningActivityContent = (
|
|
|
156
157
|
* Generate micro skill test knowledge
|
|
157
158
|
* @param {String} microSkill
|
|
158
159
|
* @param {String} token
|
|
159
|
-
* @returns {Promise<
|
|
160
|
+
* @returns {Promise<object>}
|
|
160
161
|
*/
|
|
161
162
|
const generateMicroSkillTestKnowledge = (
|
|
162
163
|
microSkill: string,
|
|
163
164
|
token: string
|
|
164
165
|
): Promise<object> => {
|
|
165
166
|
return new Promise((resolve, reject) => {
|
|
166
|
-
|
|
167
|
+
const data = {
|
|
167
168
|
microSkill: microSkill,
|
|
168
169
|
};
|
|
169
|
-
|
|
170
|
+
const confirmationRequest = client.post(
|
|
170
171
|
`api/v1/learningcontent/generatemicroskilltestknowledge`,
|
|
171
172
|
data,
|
|
172
173
|
{
|
|
@@ -174,10 +175,10 @@ const generateMicroSkillTestKnowledge = (
|
|
|
174
175
|
}
|
|
175
176
|
);
|
|
176
177
|
confirmationRequest
|
|
177
|
-
.then((response) => {
|
|
178
|
+
.then((response : AxiosResponse) => {
|
|
178
179
|
resolve(response.data);
|
|
179
180
|
})
|
|
180
|
-
.catch((error) => {
|
|
181
|
+
.catch((error : AxiosError) => {
|
|
181
182
|
reject(error);
|
|
182
183
|
});
|
|
183
184
|
});
|
|
@@ -188,7 +189,7 @@ const generateMicroSkillTestKnowledge = (
|
|
|
188
189
|
* @param {String} id The id of the learning content
|
|
189
190
|
* @param {String} version The version of the learning content
|
|
190
191
|
* @param {String} token Authorization token
|
|
191
|
-
* @returns {Promise<
|
|
192
|
+
* @returns {Promise<object>} The response from the server
|
|
192
193
|
*/
|
|
193
194
|
const getLearningContentInformationById = (
|
|
194
195
|
id: string,
|
|
@@ -196,17 +197,17 @@ const getLearningContentInformationById = (
|
|
|
196
197
|
token: string
|
|
197
198
|
): Promise<object> => {
|
|
198
199
|
return new Promise((resolve, reject) => {
|
|
199
|
-
|
|
200
|
+
const confirmationRequest = client.get(
|
|
200
201
|
`api/v1/learningcontent/${id}/${version}`,
|
|
201
202
|
{
|
|
202
203
|
headers: { authorization: token },
|
|
203
204
|
}
|
|
204
205
|
);
|
|
205
206
|
confirmationRequest
|
|
206
|
-
.then((response) => {
|
|
207
|
+
.then((response : AxiosResponse) => {
|
|
207
208
|
resolve(response.data);
|
|
208
209
|
})
|
|
209
|
-
.catch((error) => {
|
|
210
|
+
.catch((error : AxiosError) => {
|
|
210
211
|
reject(error);
|
|
211
212
|
});
|
|
212
213
|
});
|
|
@@ -232,7 +233,7 @@ const getLearningContentList = (
|
|
|
232
233
|
includeDeleted: includeDeleted,
|
|
233
234
|
};
|
|
234
235
|
if (filter) requestData.filter = filter;
|
|
235
|
-
|
|
236
|
+
const confirmationRequest = client.post(
|
|
236
237
|
`api/v1/learningcontent`,
|
|
237
238
|
requestData,
|
|
238
239
|
{
|
|
@@ -240,10 +241,10 @@ const getLearningContentList = (
|
|
|
240
241
|
}
|
|
241
242
|
);
|
|
242
243
|
confirmationRequest
|
|
243
|
-
.then((response) => {
|
|
244
|
+
.then((response : AxiosResponse) => {
|
|
244
245
|
resolve(response.data);
|
|
245
246
|
})
|
|
246
|
-
.catch((error) => {
|
|
247
|
+
.catch((error : AxiosError) => {
|
|
247
248
|
reject(error);
|
|
248
249
|
});
|
|
249
250
|
});
|
|
@@ -253,15 +254,15 @@ const getLearningContentList = (
|
|
|
253
254
|
* Migrate learning content storage
|
|
254
255
|
* @param {String} id The id of the content to be migrated
|
|
255
256
|
* @param {String} token Authorization token
|
|
256
|
-
* @returns {Promise<
|
|
257
|
+
* @returns {Promise<object>} The response from the server
|
|
257
258
|
*/
|
|
258
259
|
const migrateLearningContentStorageType = (
|
|
259
260
|
id: string,
|
|
260
261
|
token: string
|
|
261
262
|
): Promise<object> => {
|
|
262
263
|
return new Promise((resolve, reject) => {
|
|
263
|
-
|
|
264
|
-
|
|
264
|
+
const data = {};
|
|
265
|
+
const confirmationRequest = client.post(
|
|
265
266
|
`api/v1/learningcontent/migratestorage/${id}`,
|
|
266
267
|
data,
|
|
267
268
|
{
|
|
@@ -269,10 +270,10 @@ const migrateLearningContentStorageType = (
|
|
|
269
270
|
}
|
|
270
271
|
);
|
|
271
272
|
confirmationRequest
|
|
272
|
-
.then((response) => {
|
|
273
|
+
.then((response : AxiosResponse) => {
|
|
273
274
|
resolve(response.data);
|
|
274
275
|
})
|
|
275
|
-
.catch((error) => {
|
|
276
|
+
.catch((error : AxiosError) => {
|
|
276
277
|
reject(error);
|
|
277
278
|
});
|
|
278
279
|
});
|
|
@@ -283,7 +284,7 @@ const migrateLearningContentStorageType = (
|
|
|
283
284
|
* @param {String} id The id of the content to be published
|
|
284
285
|
* @param {String} comments The comments to be include with the request
|
|
285
286
|
* @param {String} token Authorization token
|
|
286
|
-
* @returns {Promise<
|
|
287
|
+
* @returns {Promise<object>} The response from the server
|
|
287
288
|
*/
|
|
288
289
|
const publishLearningContent = (
|
|
289
290
|
id: string,
|
|
@@ -291,10 +292,10 @@ const publishLearningContent = (
|
|
|
291
292
|
token: string
|
|
292
293
|
): Promise<object> => {
|
|
293
294
|
return new Promise((resolve, reject) => {
|
|
294
|
-
|
|
295
|
+
const data: LearningContentData = {};
|
|
295
296
|
if (comments) data.comments = comments;
|
|
296
297
|
|
|
297
|
-
|
|
298
|
+
const confirmationRequest = client.post(
|
|
298
299
|
`api/v1/learningcontent/publish/${id}`,
|
|
299
300
|
data,
|
|
300
301
|
{
|
|
@@ -302,10 +303,10 @@ const publishLearningContent = (
|
|
|
302
303
|
}
|
|
303
304
|
);
|
|
304
305
|
confirmationRequest
|
|
305
|
-
.then((response) => {
|
|
306
|
+
.then((response : AxiosResponse) => {
|
|
306
307
|
resolve(response.data);
|
|
307
308
|
})
|
|
308
|
-
.catch((error) => {
|
|
309
|
+
.catch((error : AxiosError) => {
|
|
309
310
|
reject(error);
|
|
310
311
|
});
|
|
311
312
|
});
|
|
@@ -316,7 +317,7 @@ const publishLearningContent = (
|
|
|
316
317
|
* @param {String} id The id of the learning content to be updated
|
|
317
318
|
* @param {Object} data Data used to update the learning content
|
|
318
319
|
* @param {String} token Authorization token
|
|
319
|
-
* @returns {Promise<
|
|
320
|
+
* @returns {Promise<object>} The updated learning content
|
|
320
321
|
*/
|
|
321
322
|
const setLearningContentInformation = (
|
|
322
323
|
id: string,
|
|
@@ -328,7 +329,7 @@ const setLearningContentInformation = (
|
|
|
328
329
|
data: data,
|
|
329
330
|
id: id,
|
|
330
331
|
};
|
|
331
|
-
|
|
332
|
+
const confirmationRequest = client.post(
|
|
332
333
|
`api/v1/learningcontent/update`,
|
|
333
334
|
requestData,
|
|
334
335
|
{
|
|
@@ -336,10 +337,10 @@ const setLearningContentInformation = (
|
|
|
336
337
|
}
|
|
337
338
|
);
|
|
338
339
|
confirmationRequest
|
|
339
|
-
.then((response) => {
|
|
340
|
+
.then((response : AxiosResponse) => {
|
|
340
341
|
resolve(response.data);
|
|
341
342
|
})
|
|
342
|
-
.catch((error) => {
|
|
343
|
+
.catch((error : AxiosError) => {
|
|
343
344
|
reject(error);
|
|
344
345
|
});
|
|
345
346
|
});
|
|
@@ -350,7 +351,7 @@ const setLearningContentInformation = (
|
|
|
350
351
|
* @param {String} id
|
|
351
352
|
* @param {Object} data
|
|
352
353
|
* @param {String} token
|
|
353
|
-
* @returns {Promise<
|
|
354
|
+
* @returns {Promise<object>}
|
|
354
355
|
*/
|
|
355
356
|
const setLearningContentPartialContentInformation = (
|
|
356
357
|
id: string,
|
|
@@ -362,7 +363,7 @@ const setLearningContentPartialContentInformation = (
|
|
|
362
363
|
data: data,
|
|
363
364
|
id: id,
|
|
364
365
|
};
|
|
365
|
-
|
|
366
|
+
const confirmationRequest = client.post(
|
|
366
367
|
`api/v1/learningcontent/updatepartialcontent/${id}`,
|
|
367
368
|
requestData,
|
|
368
369
|
{
|
|
@@ -370,10 +371,10 @@ const setLearningContentPartialContentInformation = (
|
|
|
370
371
|
}
|
|
371
372
|
);
|
|
372
373
|
confirmationRequest
|
|
373
|
-
.then((response) => {
|
|
374
|
+
.then((response : AxiosResponse) => {
|
|
374
375
|
resolve(response.data);
|
|
375
376
|
})
|
|
376
|
-
.catch((error) => {
|
|
377
|
+
.catch((error : AxiosError) => {
|
|
377
378
|
reject(error);
|
|
378
379
|
});
|
|
379
380
|
});
|
|
@@ -402,7 +403,7 @@ const setLearningContentLearningContentInformation = (
|
|
|
402
403
|
learningcontentid: learningcontentid,
|
|
403
404
|
microSkillId: microSkillId,
|
|
404
405
|
};
|
|
405
|
-
|
|
406
|
+
const confirmationRequest = client.post(
|
|
406
407
|
`api/v1/learningcontent/updatelearningcontent/`,
|
|
407
408
|
requestData,
|
|
408
409
|
{
|
|
@@ -410,10 +411,10 @@ const setLearningContentLearningContentInformation = (
|
|
|
410
411
|
}
|
|
411
412
|
);
|
|
412
413
|
confirmationRequest
|
|
413
|
-
.then((response) => {
|
|
414
|
+
.then((response : AxiosResponse) => {
|
|
414
415
|
resolve(response.data);
|
|
415
416
|
})
|
|
416
|
-
.catch((error) => {
|
|
417
|
+
.catch((error : AxiosError) => {
|
|
417
418
|
reject(error);
|
|
418
419
|
});
|
|
419
420
|
});
|
|
@@ -437,7 +438,7 @@ const setLearningContentLearningMicroSkillContentInformation = (
|
|
|
437
438
|
const requestData: LearningContentData = {
|
|
438
439
|
data: data,
|
|
439
440
|
};
|
|
440
|
-
|
|
441
|
+
const confirmationRequest = client.post(
|
|
441
442
|
`api/v1/learningcontent/updatemicroskilllearningcontent/${id}/${microskillid}`,
|
|
442
443
|
requestData,
|
|
443
444
|
{
|
|
@@ -445,10 +446,10 @@ const setLearningContentLearningMicroSkillContentInformation = (
|
|
|
445
446
|
}
|
|
446
447
|
);
|
|
447
448
|
confirmationRequest
|
|
448
|
-
.then((response) => {
|
|
449
|
+
.then((response : AxiosResponse) => {
|
|
449
450
|
resolve(response.data);
|
|
450
451
|
})
|
|
451
|
-
.catch((error) => {
|
|
452
|
+
.catch((error : AxiosError) => {
|
|
452
453
|
reject(error);
|
|
453
454
|
});
|
|
454
455
|
});
|
|
@@ -470,7 +471,7 @@ const setLearningContentTags = (
|
|
|
470
471
|
tags: tags,
|
|
471
472
|
id: id,
|
|
472
473
|
};
|
|
473
|
-
|
|
474
|
+
const confirmationRequest = client.post(
|
|
474
475
|
`api/v1/learningcontent/updatetags/`,
|
|
475
476
|
requestData,
|
|
476
477
|
{
|
|
@@ -478,10 +479,10 @@ const setLearningContentTags = (
|
|
|
478
479
|
}
|
|
479
480
|
);
|
|
480
481
|
confirmationRequest
|
|
481
|
-
.then((response) => {
|
|
482
|
+
.then((response : AxiosResponse) => {
|
|
482
483
|
resolve(response.data);
|
|
483
484
|
})
|
|
484
|
-
.catch((error) => {
|
|
485
|
+
.catch((error : AxiosError) => {
|
|
485
486
|
reject(error);
|
|
486
487
|
});
|
|
487
488
|
});
|
|
@@ -503,7 +504,7 @@ const watchLearningContent = (
|
|
|
503
504
|
id: id,
|
|
504
505
|
watch: watch,
|
|
505
506
|
};
|
|
506
|
-
|
|
507
|
+
const confirmationRequest = client.post(
|
|
507
508
|
`api/v1/learningcontent/watch`,
|
|
508
509
|
requestData,
|
|
509
510
|
{
|
|
@@ -511,10 +512,10 @@ const watchLearningContent = (
|
|
|
511
512
|
}
|
|
512
513
|
);
|
|
513
514
|
confirmationRequest
|
|
514
|
-
.then((response) => {
|
|
515
|
+
.then((response : AxiosResponse) => {
|
|
515
516
|
resolve(response.data);
|
|
516
517
|
})
|
|
517
|
-
.catch((error) => {
|
|
518
|
+
.catch((error : AxiosError) => {
|
|
518
519
|
reject(error);
|
|
519
520
|
});
|
|
520
521
|
});
|