@stackfactor/client-api 1.1.54 → 1.1.56
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/lib/actionNotifications.js +3 -3
- package/lib/address.js +1 -1
- package/lib/aiAssistant.js +2 -7
- package/lib/avatar.js +49 -0
- package/lib/config.js +3 -3
- package/lib/dashboard.js +3 -3
- package/lib/departmentTrainingPlans.js +6 -10
- package/lib/groups.js +12 -12
- package/lib/integration.js +1 -1
- package/lib/integrationConfiguration.js +3 -13
- package/lib/learningContent.js +12 -21
- package/lib/learningPath.js +8 -8
- package/lib/logger.js +2 -2
- package/lib/role.js +14 -14
- package/lib/roleTemplate.js +9 -9
- package/lib/skill.js +18 -18
- package/lib/skillAssessmentTestingSession.js +5 -5
- package/lib/skillAssessments.js +5 -5
- package/lib/skillTemplate.js +11 -11
- package/lib/teams.js +11 -19
- package/lib/tenants.js +2 -2
- package/lib/trainingPlans.js +21 -0
- package/lib/trainingPlansProficiencyLevels.js +4 -4
- package/lib/userInformation.js +3 -13
- package/lib/users.js +26 -31
- package/lib/utils.js +3 -3
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { client } from "./axiosClient.js";
|
|
|
4
4
|
* Get all permissions
|
|
5
5
|
* @param {String} authToken The authentication token
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
const getAllUserNotifications = (authToken) => {
|
|
8
8
|
return new Promise(function (resolve, reject) {
|
|
9
9
|
const request = client.get(`api/v1/actionnotifications`, {
|
|
10
10
|
headers: { authorization: authToken },
|
|
@@ -25,7 +25,7 @@ export const getAllUserNotifications = (authToken) => {
|
|
|
25
25
|
* @param {String} status The new status
|
|
26
26
|
* @param {String} authToken The authentication token
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
const markNotifications = (ids, status, authToken) => {
|
|
29
29
|
return new Promise(function (resolve, reject) {
|
|
30
30
|
const request = client.put(
|
|
31
31
|
`api/v1/actionnotifications/mark`,
|
|
@@ -52,7 +52,7 @@ export const markNotifications = (ids, status, authToken) => {
|
|
|
52
52
|
* @param {String} comments The comments to be saved in the notification
|
|
53
53
|
* @param {String} authToken The authentication token
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
const processNotification = (id, action, comments, authToken) => {
|
|
56
56
|
return new Promise(function (resolve, reject) {
|
|
57
57
|
const request = client.put(
|
|
58
58
|
`api/v1/actionnotifications/process`,
|
package/lib/address.js
CHANGED
|
@@ -5,7 +5,7 @@ import { client } from "./axiosClient.js";
|
|
|
5
5
|
* @param {String} input - the address in raw format
|
|
6
6
|
* @param {String} authToken - Authorization token
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
const autoComplete = (input, authToken) => {
|
|
9
9
|
return new Promise(function (resolve, reject) {
|
|
10
10
|
const getAddressesRequest = client.post(
|
|
11
11
|
`api/v1/address/autocomplete/`,
|
package/lib/aiAssistant.js
CHANGED
|
@@ -8,12 +8,7 @@ import { client } from "./axiosClient.js";
|
|
|
8
8
|
* @param {String} token Authorization token
|
|
9
9
|
* @returns {Promise}
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
conversationId,
|
|
13
|
-
question,
|
|
14
|
-
updatedContext,
|
|
15
|
-
token
|
|
16
|
-
) => {
|
|
11
|
+
const askQuestion = (conversationId, question, updatedContext, token) => {
|
|
17
12
|
return new Promise(function (resolve, reject) {
|
|
18
13
|
let data = {
|
|
19
14
|
conversationId: conversationId,
|
|
@@ -43,7 +38,7 @@ export const askQuestion = (
|
|
|
43
38
|
* @param {String} token Authorization token
|
|
44
39
|
* @returns {Promise}
|
|
45
40
|
*/
|
|
46
|
-
|
|
41
|
+
const endConversation = (conversationId, token) => {
|
|
47
42
|
return new Promise(function (resolve, reject) {
|
|
48
43
|
let data = {
|
|
49
44
|
conversationId: conversationId,
|
package/lib/avatar.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { client } from "./axiosClient.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get conversation by elementId
|
|
5
|
+
* @param {String} elementId
|
|
6
|
+
* @param {String} type
|
|
7
|
+
* @param {Number} width
|
|
8
|
+
* @param {Number} height
|
|
9
|
+
* @param {String} name
|
|
10
|
+
* @param {String} description
|
|
11
|
+
* @param {Boolean} autoCreate
|
|
12
|
+
* @param {String} token
|
|
13
|
+
* @returns {Promise}
|
|
14
|
+
*/
|
|
15
|
+
const getAvatar = (
|
|
16
|
+
elementId,
|
|
17
|
+
type,
|
|
18
|
+
width,
|
|
19
|
+
height,
|
|
20
|
+
name,
|
|
21
|
+
description,
|
|
22
|
+
autoCreate,
|
|
23
|
+
token
|
|
24
|
+
) => {
|
|
25
|
+
return new Promise(function (resolve, reject) {
|
|
26
|
+
let confirmationRequest = client.get(
|
|
27
|
+
`/api/v1/avatar/${elementId}/${type}/${width}/${height}`,
|
|
28
|
+
{
|
|
29
|
+
headers: {
|
|
30
|
+
authorization: token,
|
|
31
|
+
...(autoCreate
|
|
32
|
+
? { autoCreate: autoCreate, name: name, description: description }
|
|
33
|
+
: {}),
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
confirmationRequest
|
|
38
|
+
.then((response) => {
|
|
39
|
+
resolve(response.data);
|
|
40
|
+
})
|
|
41
|
+
.catch((error) => {
|
|
42
|
+
reject(error);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
getAvatar,
|
|
49
|
+
};
|
package/lib/config.js
CHANGED
|
@@ -5,7 +5,7 @@ import { client } from "./axiosClient.js";
|
|
|
5
5
|
* @param {String} id - the id of the configuration element
|
|
6
6
|
* @param {String} authToken - Authorization token
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
const getConfigurationById = (id, authToken) => {
|
|
9
9
|
return new Promise(function (resolve, reject) {
|
|
10
10
|
const getConfigInformationRequest = client.get(
|
|
11
11
|
`api/v1/configurations/configuration/id/${id}`,
|
|
@@ -26,7 +26,7 @@ export const getConfigurationById = (id, authToken) => {
|
|
|
26
26
|
* @param {String} type - the id of the configuration element
|
|
27
27
|
* @param {String} authToken - Authorization token
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
const getConfigurationByType = (type, authToken) => {
|
|
30
30
|
return new Promise(function (resolve, reject) {
|
|
31
31
|
const getConfigInformationRequest = client.get(
|
|
32
32
|
`api/v1/configurations/configuration/type/${type}`,
|
|
@@ -48,7 +48,7 @@ export const getConfigurationByType = (type, authToken) => {
|
|
|
48
48
|
* @param {Object} data - the object containing the updated configuration element
|
|
49
49
|
* @param {String} authToken - Authorization token
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
const setConfigurationById = (id, data, authToken) => {
|
|
52
52
|
return new Promise(function (resolve, reject) {
|
|
53
53
|
const getConfigInformationRequest = client.post(
|
|
54
54
|
`api/v1/configurations/configuration/${id}`,
|
package/lib/dashboard.js
CHANGED
|
@@ -7,7 +7,7 @@ import { client } from "./axiosClient.js";
|
|
|
7
7
|
* @param {Object} data - The card settings data
|
|
8
8
|
* @param {String} authToken - Authorization token
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
const addCardToDashboard = (id, position, data, authToken) => {
|
|
11
11
|
return new Promise(function (resolve, reject) {
|
|
12
12
|
const request = client.put(
|
|
13
13
|
`/api/v1/dashboard/card`,
|
|
@@ -32,7 +32,7 @@ export const addCardToDashboard = (id, position, data, authToken) => {
|
|
|
32
32
|
* Get the list of the cards from the dashboard
|
|
33
33
|
* @param {String} authToken - Authorization token
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
const getDashboardCardsList = (authToken) => {
|
|
36
36
|
return new Promise(function (resolve, reject) {
|
|
37
37
|
const request = client.get(`/api/v1/dashboard/card`, {
|
|
38
38
|
headers: { authorization: authToken },
|
|
@@ -52,7 +52,7 @@ export const getDashboardCardsList = (authToken) => {
|
|
|
52
52
|
* @param {String} id - the id of the configuration element
|
|
53
53
|
* @param {String} authToken - Authorization token
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
const removeCardFromDashboard = (id, authToken) => {
|
|
56
56
|
return new Promise(function (resolve, reject) {
|
|
57
57
|
const request = client.delete(`/api/v1/dashboard/card`, {
|
|
58
58
|
headers: { authorization: authToken },
|
|
@@ -7,7 +7,7 @@ import { client } from "./axiosClient.js";
|
|
|
7
7
|
* @param {Array<Object>} activities
|
|
8
8
|
* @param {String} token Authorization token
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
const createDepartmentTrainingPlan = (
|
|
11
11
|
name,
|
|
12
12
|
summary,
|
|
13
13
|
skill,
|
|
@@ -43,7 +43,7 @@ export const createDepartmentTrainingPlan = (
|
|
|
43
43
|
* @param {String} id The id of the template to be deleted
|
|
44
44
|
* @param {String} token Authorization token
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
const deleteDepartmentTrainingPlan = (id, token) => {
|
|
47
47
|
return new Promise(function (resolve, reject) {
|
|
48
48
|
const request = client.delete(`api/v1/departmenttrainingplans/`, {
|
|
49
49
|
headers: { authorization: token },
|
|
@@ -66,11 +66,7 @@ export const deleteDepartmentTrainingPlan = (id, token) => {
|
|
|
66
66
|
* @param {Number} id The id of the plan
|
|
67
67
|
* @param {String} token Authorization token
|
|
68
68
|
*/
|
|
69
|
-
|
|
70
|
-
id,
|
|
71
|
-
version,
|
|
72
|
-
token
|
|
73
|
-
) => {
|
|
69
|
+
const getDepartmentTrainingPlanInformationById = (id, version, token) => {
|
|
74
70
|
return new Promise(function (resolve, reject) {
|
|
75
71
|
let confirmationRequest = client.get(
|
|
76
72
|
`api/v1/departmenttrainingplans/${id}/${version}`,
|
|
@@ -93,7 +89,7 @@ export const getDepartmentTrainingPlanInformationById = (
|
|
|
93
89
|
* @param {Object} filter The filter used to select the plan
|
|
94
90
|
* @param {String} token Authorization token
|
|
95
91
|
*/
|
|
96
|
-
|
|
92
|
+
const getDepartmentTrainingPlanList = (filter, version, token) => {
|
|
97
93
|
return new Promise(function (resolve, reject) {
|
|
98
94
|
const requestData = {
|
|
99
95
|
filter: filter || "",
|
|
@@ -121,7 +117,7 @@ export const getDepartmentTrainingPlanList = (filter, version, token) => {
|
|
|
121
117
|
* @param {number} id The id of the plan to be published
|
|
122
118
|
* @param {String} token Authorization token
|
|
123
119
|
*/
|
|
124
|
-
|
|
120
|
+
const publishDepartmentTrainingPlan = (id, token) => {
|
|
125
121
|
return new Promise(function (resolve, reject) {
|
|
126
122
|
let confirmationRequest = client.post(
|
|
127
123
|
`api/v1/departmenttrainingplans/publish/${id}`,
|
|
@@ -146,7 +142,7 @@ export const publishDepartmentTrainingPlan = (id, token) => {
|
|
|
146
142
|
* @param {Object} data Data used to update the plan
|
|
147
143
|
* @param {String} token Authorization token
|
|
148
144
|
*/
|
|
149
|
-
|
|
145
|
+
const setDepartmentTrainingPlanInformation = (id, data, token) => {
|
|
150
146
|
return new Promise(function (resolve, reject) {
|
|
151
147
|
const requestData = {
|
|
152
148
|
data: data,
|
package/lib/groups.js
CHANGED
|
@@ -6,7 +6,7 @@ import { client } from "./axiosClient.js";
|
|
|
6
6
|
* @param {Array<String>} permissions The permissions to be added
|
|
7
7
|
* @param {String} authToken - Authentication token
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
const addPermissionsToGroup = (groupId, permissions, authToken) => {
|
|
10
10
|
return new Promise(function (resolve, reject) {
|
|
11
11
|
const request = client.post(
|
|
12
12
|
`api/v1/groups/permissions/add`,
|
|
@@ -32,7 +32,7 @@ export const addPermissionsToGroup = (groupId, permissions, authToken) => {
|
|
|
32
32
|
* @param {Array<String>} users The users to be added
|
|
33
33
|
* @param {String} authToken - Authentication token
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
const addUsersToGroup = (groupId, users, authToken) => {
|
|
36
36
|
return new Promise(function (resolve, reject) {
|
|
37
37
|
const request = client.post(
|
|
38
38
|
`api/v1/groups/users/add`,
|
|
@@ -58,7 +58,7 @@ export const addUsersToGroup = (groupId, users, authToken) => {
|
|
|
58
58
|
* @param {String} description The description of the group
|
|
59
59
|
* @param {String} authToken The authorization token
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
const createGroup = (name, description, authToken) => {
|
|
62
62
|
return new Promise(function (resolve, reject) {
|
|
63
63
|
const request = client.post(
|
|
64
64
|
`api/v1/groups/group`,
|
|
@@ -84,7 +84,7 @@ export const createGroup = (name, description, authToken) => {
|
|
|
84
84
|
* @param {String} defaultGroupId The default group all the users will be moved to
|
|
85
85
|
* @param {String} authToken The authentication token
|
|
86
86
|
*/
|
|
87
|
-
|
|
87
|
+
const deleteGroup = (groupId, defaultGroupId, authToken) => {
|
|
88
88
|
return new Promise(function (resolve, reject) {
|
|
89
89
|
const request = client.delete(`api/v1/groups/delete`, {
|
|
90
90
|
headers: { authorization: authToken },
|
|
@@ -107,7 +107,7 @@ export const deleteGroup = (groupId, defaultGroupId, authToken) => {
|
|
|
107
107
|
* Get all permissions
|
|
108
108
|
* @param {String} authToken The authentication token
|
|
109
109
|
*/
|
|
110
|
-
|
|
110
|
+
const getAllPermissions = (authToken) => {
|
|
111
111
|
return new Promise(function (resolve, reject) {
|
|
112
112
|
const request = client.get(`api/v1/groups/permissions/getAllPermissions`, {
|
|
113
113
|
headers: { authorization: authToken },
|
|
@@ -127,7 +127,7 @@ export const getAllPermissions = (authToken) => {
|
|
|
127
127
|
* @param {String} groupId The group Id
|
|
128
128
|
* @param {String} authToken The authentication token
|
|
129
129
|
*/
|
|
130
|
-
|
|
130
|
+
const getGroupById = (groupId, authToken) => {
|
|
131
131
|
return new Promise(function (resolve, reject) {
|
|
132
132
|
const request = client.get(`api/v1/groups/group/${groupId}`, {
|
|
133
133
|
headers: { authorization: authToken },
|
|
@@ -146,7 +146,7 @@ export const getGroupById = (groupId, authToken) => {
|
|
|
146
146
|
* Get groups for current tenant
|
|
147
147
|
* @param {String} authToken The authentication token
|
|
148
148
|
*/
|
|
149
|
-
|
|
149
|
+
const getGroups = (authToken) => {
|
|
150
150
|
return new Promise(function (resolve, reject) {
|
|
151
151
|
const request = client.get(`api/v1/groups/`, {
|
|
152
152
|
headers: { authorization: authToken },
|
|
@@ -165,7 +165,7 @@ export const getGroups = (authToken) => {
|
|
|
165
165
|
* Get current user permissions
|
|
166
166
|
* @param {String} authToken The authentication token
|
|
167
167
|
*/
|
|
168
|
-
|
|
168
|
+
const getUserPermissions = (authToken) => {
|
|
169
169
|
return new Promise(function (resolve, reject) {
|
|
170
170
|
const request = client.get(`api/v1/groups/users/getuserpermissions`, {
|
|
171
171
|
headers: { authorization: authToken },
|
|
@@ -186,7 +186,7 @@ export const getUserPermissions = (authToken) => {
|
|
|
186
186
|
* @param {Array<String>} permissions The permissions to be removed from the group
|
|
187
187
|
* @param {String} authToken The authentication token
|
|
188
188
|
*/
|
|
189
|
-
|
|
189
|
+
const removePermissionsFromGroup = (groupId, permissions, authToken) => {
|
|
190
190
|
return new Promise(function (resolve, reject) {
|
|
191
191
|
const request = client.post(
|
|
192
192
|
`api/v1/groups/permissions/remove/`,
|
|
@@ -212,7 +212,7 @@ export const removePermissionsFromGroup = (groupId, permissions, authToken) => {
|
|
|
212
212
|
* @param {Array<String>} users The users to be removed from the group
|
|
213
213
|
* @param {String} authToken The authentication token
|
|
214
214
|
*/
|
|
215
|
-
|
|
215
|
+
const removeUsersFromGroup = (groupId, users, authToken) => {
|
|
216
216
|
return new Promise(function (resolve, reject) {
|
|
217
217
|
const request = client.post(
|
|
218
218
|
`api/v1/groups/users/remove/`,
|
|
@@ -237,7 +237,7 @@ export const removeUsersFromGroup = (groupId, users, authToken) => {
|
|
|
237
237
|
* @param {String} groupId The group Id
|
|
238
238
|
* @param {String} authToken The authentication token
|
|
239
239
|
*/
|
|
240
|
-
|
|
240
|
+
const setDefault = (groupId, authToken) => {
|
|
241
241
|
return new Promise(function (resolve, reject) {
|
|
242
242
|
const request = client.put(
|
|
243
243
|
`api/v1/groups/setDefault/`,
|
|
@@ -263,7 +263,7 @@ export const setDefault = (groupId, authToken) => {
|
|
|
263
263
|
* @param {String} description The updated description of the group
|
|
264
264
|
* @param {String} authToken The authentication token
|
|
265
265
|
*/
|
|
266
|
-
|
|
266
|
+
const updateGroup = (groupId, name, description, authToken) => {
|
|
267
267
|
return new Promise(function (resolve, reject) {
|
|
268
268
|
const request = client.patch(
|
|
269
269
|
`api/v1/groups/group/`,
|
package/lib/integration.js
CHANGED
|
@@ -222,7 +222,7 @@ export const getContentInformationByUrlFromBrowser = (url) => {
|
|
|
222
222
|
resolve({
|
|
223
223
|
description: description,
|
|
224
224
|
duration: duration,
|
|
225
|
-
icon: `http://www.google.com/s2/favicons?sz=128&domain_url=${
|
|
225
|
+
icon: `http://www.google.com/s2/favicons?sz=128&domain_url=${domain.hostname}`,
|
|
226
226
|
title: title ? title.trim() : url,
|
|
227
227
|
type: 0,
|
|
228
228
|
internal: true,
|
|
@@ -6,7 +6,7 @@ import { client } from "./axiosClient.js";
|
|
|
6
6
|
* @param {Number} type
|
|
7
7
|
* @param {String} token Authorization token
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
const getIntegrationsConfiguration = (ids, type, token) => {
|
|
10
10
|
return new Promise(function (resolve, reject) {
|
|
11
11
|
let requestData = { type: type };
|
|
12
12
|
if (ids) requestData.ids = ids;
|
|
@@ -34,12 +34,7 @@ export const getIntegrationsConfiguration = (ids, type, token) => {
|
|
|
34
34
|
* @param {Object} configuration Data used to update the integration configuration
|
|
35
35
|
* @param {String} token Authorization token
|
|
36
36
|
*/
|
|
37
|
-
|
|
38
|
-
id,
|
|
39
|
-
type,
|
|
40
|
-
configuration,
|
|
41
|
-
token
|
|
42
|
-
) => {
|
|
37
|
+
const saveIntegrationConfiguration = (id, type, configuration, token) => {
|
|
43
38
|
return new Promise(function (resolve, reject) {
|
|
44
39
|
const requestData = {
|
|
45
40
|
id: id,
|
|
@@ -70,12 +65,7 @@ export const saveIntegrationConfiguration = (
|
|
|
70
65
|
* @param {Object} configuration Configuration to be tested
|
|
71
66
|
* @param {String} token Authorization token
|
|
72
67
|
*/
|
|
73
|
-
|
|
74
|
-
id,
|
|
75
|
-
type,
|
|
76
|
-
configuration,
|
|
77
|
-
token
|
|
78
|
-
) => {
|
|
68
|
+
const testIntegrationConfiguration = (id, type, configuration, token) => {
|
|
79
69
|
return new Promise(function (resolve, reject) {
|
|
80
70
|
const requestData = {
|
|
81
71
|
id: id,
|
package/lib/learningContent.js
CHANGED
|
@@ -35,7 +35,7 @@ const createLearningContent = (data, token) => {
|
|
|
35
35
|
* @param {String} token Authorization token
|
|
36
36
|
* @returns {Promise<Object>} The response from the server
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
const deleteLearningContent = (id, comments, token) => {
|
|
39
39
|
const data = {
|
|
40
40
|
id: id,
|
|
41
41
|
};
|
|
@@ -61,7 +61,7 @@ export const deleteLearningContent = (id, comments, token) => {
|
|
|
61
61
|
* @param {String} token Authorization token
|
|
62
62
|
* @returns {Promise<Object>} The response from the server
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
const discardLearningContentChanges = (id, token) => {
|
|
65
65
|
return new Promise(function (resolve, reject) {
|
|
66
66
|
const data = {};
|
|
67
67
|
const request = client.get(`api/v1/learningcontent/discard/${id}`, {
|
|
@@ -86,7 +86,7 @@ export const discardLearningContentChanges = (id, token) => {
|
|
|
86
86
|
* @param {List<String>} sections
|
|
87
87
|
* @param {String} token
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
const generateLearningActivityContent = (
|
|
90
90
|
skillId,
|
|
91
91
|
microSkillId,
|
|
92
92
|
learningActivity,
|
|
@@ -151,7 +151,7 @@ const generateMicroSkillTestKnowledge = (microSkill, token) => {
|
|
|
151
151
|
* @param {String} token Authorization token
|
|
152
152
|
* @returns {Promise<Object>} The response from the server
|
|
153
153
|
*/
|
|
154
|
-
|
|
154
|
+
const getLearningContentInformationById = (id, version, token) => {
|
|
155
155
|
return new Promise(function (resolve, reject) {
|
|
156
156
|
let confirmationRequest = client.get(
|
|
157
157
|
`api/v1/learningcontent/${id}/${version}`,
|
|
@@ -177,12 +177,7 @@ export const getLearningContentInformationById = (id, version, token) => {
|
|
|
177
177
|
* @param {String} token Authorization token
|
|
178
178
|
* @returns {Promise<Array<Object>>} The list of available content
|
|
179
179
|
*/
|
|
180
|
-
|
|
181
|
-
filter,
|
|
182
|
-
version,
|
|
183
|
-
includeDeleted,
|
|
184
|
-
token
|
|
185
|
-
) => {
|
|
180
|
+
const getLearningContentList = (filter, version, includeDeleted, token) => {
|
|
186
181
|
return new Promise(function (resolve, reject) {
|
|
187
182
|
const requestData = {
|
|
188
183
|
version: version,
|
|
@@ -213,7 +208,7 @@ export const getLearningContentList = (
|
|
|
213
208
|
* @param {String} token Authorization token
|
|
214
209
|
* @returns {Promise<Object>} The response from the server
|
|
215
210
|
*/
|
|
216
|
-
|
|
211
|
+
const publishLearningContent = (id, comments, token) => {
|
|
217
212
|
return new Promise(function (resolve, reject) {
|
|
218
213
|
let data = {};
|
|
219
214
|
if (comments) data.comments = comments;
|
|
@@ -242,7 +237,7 @@ export const publishLearningContent = (id, comments, token) => {
|
|
|
242
237
|
* @param {String} token Authorization token
|
|
243
238
|
* @returns {Promise<Object>} The updated learning content
|
|
244
239
|
*/
|
|
245
|
-
|
|
240
|
+
const setLearningContentInformation = (id, data, token) => {
|
|
246
241
|
return new Promise(function (resolve, reject) {
|
|
247
242
|
const requestData = {
|
|
248
243
|
data: data,
|
|
@@ -272,11 +267,7 @@ export const setLearningContentInformation = (id, data, token) => {
|
|
|
272
267
|
* @param {*} token
|
|
273
268
|
* @returns
|
|
274
269
|
*/
|
|
275
|
-
|
|
276
|
-
id,
|
|
277
|
-
data,
|
|
278
|
-
token
|
|
279
|
-
) => {
|
|
270
|
+
const setLearningContentPartialContentInformation = (id, data, token) => {
|
|
280
271
|
return new Promise(function (resolve, reject) {
|
|
281
272
|
const requestData = {
|
|
282
273
|
data: data,
|
|
@@ -307,7 +298,7 @@ export const setLearningContentPartialContentInformation = (
|
|
|
307
298
|
* @param {String} token
|
|
308
299
|
* @returns {Promise<String>} OK word if the operation was succesful
|
|
309
300
|
*/
|
|
310
|
-
|
|
301
|
+
const setLearningContentLearningContentInformation = (
|
|
311
302
|
id,
|
|
312
303
|
learningcontentid,
|
|
313
304
|
data,
|
|
@@ -342,7 +333,7 @@ export const setLearningContentLearningContentInformation = (
|
|
|
342
333
|
* @param {String} token
|
|
343
334
|
* @returns {Promise<String>} OK word if the operation was succesful
|
|
344
335
|
*/
|
|
345
|
-
|
|
336
|
+
const setLearningContentLearningMicroSkillContentInformation = (
|
|
346
337
|
id,
|
|
347
338
|
microskillid,
|
|
348
339
|
data,
|
|
@@ -375,7 +366,7 @@ export const setLearningContentLearningMicroSkillContentInformation = (
|
|
|
375
366
|
* @param {Object} tags Updated learning content tags
|
|
376
367
|
* @param {String} token Authorization token
|
|
377
368
|
*/
|
|
378
|
-
|
|
369
|
+
const setLearningContentTags = (id, tags, token) => {
|
|
379
370
|
return new Promise(function (resolve, reject) {
|
|
380
371
|
const requestData = {
|
|
381
372
|
tags: tags,
|
|
@@ -404,7 +395,7 @@ export const setLearningContentTags = (id, tags, token) => {
|
|
|
404
395
|
* @param {Boolean} watch Set to true or false
|
|
405
396
|
* @param {String} token Authorization token
|
|
406
397
|
*/
|
|
407
|
-
|
|
398
|
+
const watchLearningContent = (id, watch, token) => {
|
|
408
399
|
return new Promise(function (resolve, reject) {
|
|
409
400
|
const requestData = {
|
|
410
401
|
id: id,
|
package/lib/learningPath.js
CHANGED
|
@@ -5,7 +5,7 @@ import { client } from "./axiosClient.js";
|
|
|
5
5
|
* @param {Object} data
|
|
6
6
|
* @param {String} token Authorization token
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
const createLearningPath = (data, token) => {
|
|
9
9
|
return new Promise(function (resolve, reject) {
|
|
10
10
|
let confirmationRequest = client.put(
|
|
11
11
|
"api/v1/learningpaths",
|
|
@@ -30,7 +30,7 @@ export const createLearningPath = (data, token) => {
|
|
|
30
30
|
* @param {String} comments The comments for approver
|
|
31
31
|
* @param {String} token Authorization token
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
const deleteLearningPath = (id, comments, token) => {
|
|
34
34
|
return new Promise(function (resolve, reject) {
|
|
35
35
|
const data = {
|
|
36
36
|
id: id,
|
|
@@ -55,7 +55,7 @@ export const deleteLearningPath = (id, comments, token) => {
|
|
|
55
55
|
* @param {String} id The id of the training plan to be deleted
|
|
56
56
|
* @param {String} token Authorization token
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
const discardLearningPathChanges = (id, token) => {
|
|
59
59
|
return new Promise(function (resolve, reject) {
|
|
60
60
|
const data = {};
|
|
61
61
|
const request = client.get(`api/v1/learningpaths/discard/${id}`, {
|
|
@@ -77,7 +77,7 @@ export const discardLearningPathChanges = (id, token) => {
|
|
|
77
77
|
* @param {String} id The id of the template
|
|
78
78
|
* @param {String} token Authorization token
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
const getLearningPathInformationById = (id, version, token) => {
|
|
81
81
|
return new Promise(function (resolve, reject) {
|
|
82
82
|
let confirmationRequest = client.get(
|
|
83
83
|
`api/v1/learningpaths/${id}/${version}`,
|
|
@@ -101,7 +101,7 @@ export const getLearningPathInformationById = (id, version, token) => {
|
|
|
101
101
|
* @param {String} version The version to be retrieved
|
|
102
102
|
* @param {String} token Authorization token
|
|
103
103
|
*/
|
|
104
|
-
|
|
104
|
+
const getLearningPathsList = (list, version, includeDeleted, token) => {
|
|
105
105
|
return new Promise(function (resolve, reject) {
|
|
106
106
|
const requestData = {
|
|
107
107
|
version: version,
|
|
@@ -127,7 +127,7 @@ export const getLearningPathsList = (list, version, includeDeleted, token) => {
|
|
|
127
127
|
* @param {String} comments The comments to be include with the request
|
|
128
128
|
* @param {String} token Authorization token
|
|
129
129
|
*/
|
|
130
|
-
|
|
130
|
+
const publishLearningPath = (id, comments, token) => {
|
|
131
131
|
return new Promise(function (resolve, reject) {
|
|
132
132
|
let data = {};
|
|
133
133
|
if (comments) data.comments = comments;
|
|
@@ -154,7 +154,7 @@ export const publishLearningPath = (id, comments, token) => {
|
|
|
154
154
|
* @param {Object} data Data used to update the template
|
|
155
155
|
* @param {String} token Authorization token
|
|
156
156
|
*/
|
|
157
|
-
|
|
157
|
+
const setLearningPathInformation = (id, data, token) => {
|
|
158
158
|
return new Promise(function (resolve, reject) {
|
|
159
159
|
const requestData = {
|
|
160
160
|
data: data,
|
|
@@ -183,7 +183,7 @@ export const setLearningPathInformation = (id, data, token) => {
|
|
|
183
183
|
* @param {Object} tags The updated tags
|
|
184
184
|
* @param {String} token Authorization token
|
|
185
185
|
*/
|
|
186
|
-
|
|
186
|
+
const setLearningPathTags = (id, tags, token) => {
|
|
187
187
|
return new Promise(function (resolve, reject) {
|
|
188
188
|
const requestData = {
|
|
189
189
|
tags: tags,
|
package/lib/logger.js
CHANGED
|
@@ -7,7 +7,7 @@ import { client } from "./axiosClient.js";
|
|
|
7
7
|
* @param {Object} data
|
|
8
8
|
* @param {String} token Authorization token
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
const comments = (elementId, elementType, data, token) => {
|
|
11
11
|
return new Promise(function (resolve, reject) {
|
|
12
12
|
let confirmationRequest = client.post(
|
|
13
13
|
"api/v1/logger/comments/",
|
|
@@ -37,7 +37,7 @@ export const comments = (elementId, elementType, data, token) => {
|
|
|
37
37
|
* @param {Number} elementsPerPage The number of elements per page
|
|
38
38
|
* @param {String} token
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
const getListByElementId = (elementId, page, elementsPerPage, token) => {
|
|
41
41
|
return new Promise(function (resolve, reject) {
|
|
42
42
|
let data = {};
|
|
43
43
|
if (elementsPerPage !== null) data.elementsPerPage = elementsPerPage;
|