@stackfactor/client-api 1.0.41 → 1.0.42
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/index.js +25 -25
- package/lib/actionNotifications.js +4 -4
- package/lib/address.js +6 -2
- package/lib/axiosClient.js +10 -2
- package/lib/config.js +10 -4
- package/lib/constants.js +1 -1
- package/lib/dashboard.js +10 -4
- package/lib/departmentTrainingPlans.js +17 -7
- package/lib/groups.js +28 -13
- package/lib/integration.js +25 -11
- package/lib/integrationConfiguration.js +10 -4
- package/lib/learningContent.js +28 -12
- package/lib/logger.js +8 -3
- package/lib/role.js +24 -11
- package/lib/roleTemplate.js +24 -11
- package/lib/skill.js +36 -16
- package/lib/skillAssessmentTestingSession.js +14 -6
- package/lib/skillAssessments.js +14 -6
- package/lib/skillTemplate.js +30 -13
- package/lib/teams.js +26 -12
- package/lib/tenants.js +8 -3
- package/lib/trainingPlanTemplate.js +21 -9
- package/lib/trainingPlans.js +22 -10
- package/lib/userInformation.js +10 -4
- package/lib/users.js +50 -24
- package/lib/utils.js +6 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import actionNotifications from "./lib/actionNotifications";
|
|
1
|
+
import actionNotifications from "./lib/actionNotifications.js";
|
|
2
2
|
import axios, {
|
|
3
3
|
errorToString,
|
|
4
4
|
getErrorType,
|
|
5
5
|
shouldReturnError,
|
|
6
|
-
} from "./lib/axiosClient";
|
|
7
|
-
import address from "./lib/address";
|
|
8
|
-
import config from "./lib/config";
|
|
9
|
-
import constants from "./lib/constants";
|
|
10
|
-
import contentGenerator from "./lib/integrations/contentGenerator";
|
|
11
|
-
import dashboard from "./lib/dashboard";
|
|
12
|
-
import departmentTraingPlans from "./lib/departmentTrainingPlans";
|
|
13
|
-
import integration from "./lib/integration";
|
|
14
|
-
import integrationConfiguration from "./lib/integrationConfiguration";
|
|
15
|
-
import groups from "./lib/groups";
|
|
16
|
-
import learningContent from "./lib/learningContent";
|
|
17
|
-
import logger from "./lib/logger";
|
|
18
|
-
import role from "./lib/role";
|
|
19
|
-
import roleTemplate from "./lib/roleTemplate";
|
|
20
|
-
import skill from "./lib/skill";
|
|
21
|
-
import skillAssessment from "./lib/skillAssessments";
|
|
22
|
-
import skillAssessmentTestingSession from "./lib/skillAssessmentTestingSession";
|
|
23
|
-
import skillTemplate from "./lib/skillTemplate";
|
|
24
|
-
import team from "./lib/teams";
|
|
25
|
-
import tenant from "./lib/tenants";
|
|
26
|
-
import trainingPlanTemplate from "./lib/trainingPlanTemplate";
|
|
27
|
-
import trainingPlan from "./lib/trainingPlans";
|
|
28
|
-
import userInformation from "./lib/userInformation";
|
|
29
|
-
import users from "./lib/users";
|
|
6
|
+
} from "./lib/axiosClient.js";
|
|
7
|
+
import address from "./lib/address.js";
|
|
8
|
+
import config from "./lib/config.js";
|
|
9
|
+
import constants from "./lib/constants.js";
|
|
10
|
+
import contentGenerator from "./lib/integrations/contentGenerator.js";
|
|
11
|
+
import dashboard from "./lib/dashboard.js";
|
|
12
|
+
import departmentTraingPlans from "./lib/departmentTrainingPlans.js";
|
|
13
|
+
import integration from "./lib/integration.js";
|
|
14
|
+
import integrationConfiguration from "./lib/integrationConfiguration.js";
|
|
15
|
+
import groups from "./lib/groups.js";
|
|
16
|
+
import learningContent from "./lib/learningContent.js";
|
|
17
|
+
import logger from "./lib/logger.js";
|
|
18
|
+
import role from "./lib/role.js";
|
|
19
|
+
import roleTemplate from "./lib/roleTemplate.js";
|
|
20
|
+
import skill from "./lib/skill.js";
|
|
21
|
+
import skillAssessment from "./lib/skillAssessments.js";
|
|
22
|
+
import skillAssessmentTestingSession from "./lib/skillAssessmentTestingSession.js";
|
|
23
|
+
import skillTemplate from "./lib/skillTemplate.js";
|
|
24
|
+
import team from "./lib/teams.js";
|
|
25
|
+
import tenant from "./lib/tenants.js";
|
|
26
|
+
import trainingPlanTemplate from "./lib/trainingPlanTemplate.js";
|
|
27
|
+
import trainingPlan from "./lib/trainingPlans.js";
|
|
28
|
+
import userInformation from "./lib/userInformation.js";
|
|
29
|
+
import users from "./lib/users.js";
|
|
30
30
|
|
|
31
31
|
export default {
|
|
32
32
|
actionNotifications: actionNotifications,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { client } from "./axiosClient";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Get all permissions
|
|
@@ -6,7 +6,7 @@ import axios from "./axiosClient";
|
|
|
6
6
|
*/
|
|
7
7
|
export const getAllUserNotifications = (authToken) => {
|
|
8
8
|
return new Promise(function (resolve, reject) {
|
|
9
|
-
const request =
|
|
9
|
+
const request = client.get(`api/v1/actionnotifications`, {
|
|
10
10
|
headers: { authorization: authToken },
|
|
11
11
|
});
|
|
12
12
|
request
|
|
@@ -27,7 +27,7 @@ export const getAllUserNotifications = (authToken) => {
|
|
|
27
27
|
*/
|
|
28
28
|
export const markNotifications = (ids, status, authToken) => {
|
|
29
29
|
return new Promise(function (resolve, reject) {
|
|
30
|
-
const request =
|
|
30
|
+
const request = client.put(
|
|
31
31
|
`api/v1/actionnotifications/mark`,
|
|
32
32
|
{
|
|
33
33
|
ids: ids,
|
|
@@ -54,7 +54,7 @@ export const markNotifications = (ids, status, authToken) => {
|
|
|
54
54
|
*/
|
|
55
55
|
export const processNotification = (id, action, comment, authToken) => {
|
|
56
56
|
return new Promise(function (resolve, reject) {
|
|
57
|
-
const request =
|
|
57
|
+
const request = client.put(
|
|
58
58
|
`api/v1/actionnotifications/process`,
|
|
59
59
|
{
|
|
60
60
|
id: id,
|
package/lib/address.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { client } from "./axiosClient";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Validate Address
|
|
@@ -7,7 +7,7 @@ import axios from "./axiosClient";
|
|
|
7
7
|
*/
|
|
8
8
|
export const autoComplete = (input, authToken) => {
|
|
9
9
|
return new Promise(function (resolve, reject) {
|
|
10
|
-
const getAddressesRequest =
|
|
10
|
+
const getAddressesRequest = client.post(
|
|
11
11
|
`api/v1/address/autocomplete/`,
|
|
12
12
|
{ input: input },
|
|
13
13
|
{ headers: { authorization: authToken } }
|
|
@@ -21,3 +21,7 @@ export const autoComplete = (input, authToken) => {
|
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
autoComplete: autoComplete,
|
|
27
|
+
};
|
package/lib/axiosClient.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import axios from "axios";
|
|
2
2
|
import https from "https";
|
|
3
3
|
import utils from "./utils";
|
|
4
4
|
|
|
5
5
|
const baseUrl = utils.getBaseUrl();
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export const client = axios.create({
|
|
8
8
|
baseURL: baseUrl,
|
|
9
9
|
httpsAgent: new https.Agent({
|
|
10
10
|
rejectUnauthorized: false,
|
|
@@ -74,3 +74,11 @@ export const shouldReturnError = (returnAllExceptions, error) => {
|
|
|
74
74
|
return true;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
client: client,
|
|
80
|
+
errorToString: errorToString,
|
|
81
|
+
getErrorType: getErrorType,
|
|
82
|
+
getErrorInformation: getErrorInformation,
|
|
83
|
+
shouldReturnError: shouldReturnError,
|
|
84
|
+
};
|
package/lib/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { client } from "./axiosClient";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Get the specified configuration by Id. It returns a promise
|
|
@@ -7,7 +7,7 @@ import axios from "./axiosClient";
|
|
|
7
7
|
*/
|
|
8
8
|
export const getConfigurationById = (id, authToken) => {
|
|
9
9
|
return new Promise(function (resolve, reject) {
|
|
10
|
-
const getConfigInformationRequest =
|
|
10
|
+
const getConfigInformationRequest = client.get(
|
|
11
11
|
`api/v1/configurations/configuration/id/${id}`,
|
|
12
12
|
{ headers: { authorization: authToken } }
|
|
13
13
|
);
|
|
@@ -28,7 +28,7 @@ export const getConfigurationById = (id, authToken) => {
|
|
|
28
28
|
*/
|
|
29
29
|
export const getConfigurationByType = (type, authToken) => {
|
|
30
30
|
return new Promise(function (resolve, reject) {
|
|
31
|
-
const getConfigInformationRequest =
|
|
31
|
+
const getConfigInformationRequest = client.get(
|
|
32
32
|
`api/v1/configurations/configuration/type/${type}`,
|
|
33
33
|
{ headers: { authorization: authToken } }
|
|
34
34
|
);
|
|
@@ -50,7 +50,7 @@ export const getConfigurationByType = (type, authToken) => {
|
|
|
50
50
|
*/
|
|
51
51
|
export const setConfigurationById = (id, data, authToken) => {
|
|
52
52
|
return new Promise(function (resolve, reject) {
|
|
53
|
-
const getConfigInformationRequest =
|
|
53
|
+
const getConfigInformationRequest = client.post(
|
|
54
54
|
`api/v1/configurations/configuration/${id}`,
|
|
55
55
|
{ data: data },
|
|
56
56
|
{ headers: { authorization: authToken } }
|
|
@@ -64,3 +64,9 @@ export const setConfigurationById = (id, data, authToken) => {
|
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
+
|
|
68
|
+
export default {
|
|
69
|
+
getConfigurationById: getConfigurationById,
|
|
70
|
+
getConfigurationByType: getConfigurationByType,
|
|
71
|
+
setConfigurationById: setConfigurationById,
|
|
72
|
+
};
|
package/lib/constants.js
CHANGED
package/lib/dashboard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { client } from "./axiosClient";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Add a card to the dashboard
|
|
@@ -9,7 +9,7 @@ import axios from "./axiosClient";
|
|
|
9
9
|
*/
|
|
10
10
|
export const addCardToDashboard = (id, position, data, authToken) => {
|
|
11
11
|
return new Promise(function (resolve, reject) {
|
|
12
|
-
const request =
|
|
12
|
+
const request = client.put(
|
|
13
13
|
`/api/v1/dashboard/card`,
|
|
14
14
|
{
|
|
15
15
|
id: id,
|
|
@@ -34,7 +34,7 @@ export const addCardToDashboard = (id, position, data, authToken) => {
|
|
|
34
34
|
*/
|
|
35
35
|
export const getDashboardCardsList = (authToken) => {
|
|
36
36
|
return new Promise(function (resolve, reject) {
|
|
37
|
-
const request =
|
|
37
|
+
const request = client.get(`/api/v1/dashboard/card`, {
|
|
38
38
|
headers: { authorization: authToken },
|
|
39
39
|
});
|
|
40
40
|
request
|
|
@@ -54,7 +54,7 @@ export const getDashboardCardsList = (authToken) => {
|
|
|
54
54
|
*/
|
|
55
55
|
export const removeCardFromDashboard = (id, authToken) => {
|
|
56
56
|
return new Promise(function (resolve, reject) {
|
|
57
|
-
const request =
|
|
57
|
+
const request = client.delete(`/api/v1/dashboard/card`, {
|
|
58
58
|
headers: { authorization: authToken },
|
|
59
59
|
data: {
|
|
60
60
|
id: id,
|
|
@@ -69,3 +69,9 @@ export const removeCardFromDashboard = (id, authToken) => {
|
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
addCardToDashboard: addCardToDashboard,
|
|
75
|
+
getDashboardCardsList: getDashboardCardsList,
|
|
76
|
+
removeCardFromDashboard: removeCardFromDashboard,
|
|
77
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { client } from "./axiosClient";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Create training plan template and set information
|
|
@@ -21,7 +21,7 @@ export const createDepartmentTrainingPlan = (
|
|
|
21
21
|
skill: skill ? skill : "",
|
|
22
22
|
activities: activities ? activities : [],
|
|
23
23
|
};
|
|
24
|
-
let confirmationRequest =
|
|
24
|
+
let confirmationRequest = client.put(
|
|
25
25
|
"api/v1/departmentTrainingPlans",
|
|
26
26
|
requestData,
|
|
27
27
|
{
|
|
@@ -45,7 +45,7 @@ export const createDepartmentTrainingPlan = (
|
|
|
45
45
|
*/
|
|
46
46
|
export const deleteDepartmentTrainingPlan = (id, token) => {
|
|
47
47
|
return new Promise(function (resolve, reject) {
|
|
48
|
-
const request =
|
|
48
|
+
const request = client.delete(`api/v1/departmenttrainingplans/`, {
|
|
49
49
|
headers: { authorization: token },
|
|
50
50
|
data: {
|
|
51
51
|
id: id,
|
|
@@ -72,7 +72,7 @@ export const getDepartmentTrainingPlanInformationById = (
|
|
|
72
72
|
token
|
|
73
73
|
) => {
|
|
74
74
|
return new Promise(function (resolve, reject) {
|
|
75
|
-
let confirmationRequest =
|
|
75
|
+
let confirmationRequest = client.get(
|
|
76
76
|
`api/v1/departmenttrainingplans/${id}/${version}`,
|
|
77
77
|
{
|
|
78
78
|
headers: { authorization: token },
|
|
@@ -99,7 +99,7 @@ export const getDepartmentTrainingPlanList = (filter, version, token) => {
|
|
|
99
99
|
filter: filter ? filter : "",
|
|
100
100
|
version: version,
|
|
101
101
|
};
|
|
102
|
-
let confirmationRequest =
|
|
102
|
+
let confirmationRequest = client.post(
|
|
103
103
|
`api/v1/departmenttrainingplans`,
|
|
104
104
|
requestData,
|
|
105
105
|
{
|
|
@@ -123,7 +123,7 @@ export const getDepartmentTrainingPlanList = (filter, version, token) => {
|
|
|
123
123
|
*/
|
|
124
124
|
export const publishDepartmentTrainingPlan = (id, token) => {
|
|
125
125
|
return new Promise(function (resolve, reject) {
|
|
126
|
-
let confirmationRequest =
|
|
126
|
+
let confirmationRequest = client.post(
|
|
127
127
|
`api/v1/departmenttrainingplans/publish/${id}`,
|
|
128
128
|
{},
|
|
129
129
|
{
|
|
@@ -151,7 +151,7 @@ export const setDepartmentTrainingPlanInformation = (id, data, token) => {
|
|
|
151
151
|
const requestData = {
|
|
152
152
|
data: data,
|
|
153
153
|
};
|
|
154
|
-
let confirmationRequest =
|
|
154
|
+
let confirmationRequest = client.post(
|
|
155
155
|
`api/v1/departmenttrainingplans/${id}`,
|
|
156
156
|
requestData,
|
|
157
157
|
{
|
|
@@ -167,3 +167,13 @@ export const setDepartmentTrainingPlanInformation = (id, data, token) => {
|
|
|
167
167
|
});
|
|
168
168
|
});
|
|
169
169
|
};
|
|
170
|
+
|
|
171
|
+
export default {
|
|
172
|
+
createDepartmentTrainingPlan: createDepartmentTrainingPlan,
|
|
173
|
+
deleteDepartmentTrainingPlan: deleteDepartmentTrainingPlan,
|
|
174
|
+
getDepartmentTrainingPlanInformationById:
|
|
175
|
+
getDepartmentTrainingPlanInformationById,
|
|
176
|
+
getDepartmentTrainingPlanList: getDepartmentTrainingPlanList,
|
|
177
|
+
publishDepartmentTrainingPlan: publishDepartmentTrainingPlan,
|
|
178
|
+
setDepartmentTrainingPlanInformation: setDepartmentTrainingPlanInformation,
|
|
179
|
+
};
|
package/lib/groups.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { client } from "./axiosClient";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Add permissions to group
|
|
@@ -8,7 +8,7 @@ import axios from "./axiosClient";
|
|
|
8
8
|
*/
|
|
9
9
|
export const addPermissionsToGroup = (groupId, permissions, authToken) => {
|
|
10
10
|
return new Promise(function (resolve, reject) {
|
|
11
|
-
const request =
|
|
11
|
+
const request = client.post(
|
|
12
12
|
`api/v1/groups/permissions/add`,
|
|
13
13
|
{
|
|
14
14
|
groupId: groupId,
|
|
@@ -34,7 +34,7 @@ export const addPermissionsToGroup = (groupId, permissions, authToken) => {
|
|
|
34
34
|
*/
|
|
35
35
|
export const addUsersToGroup = (groupId, users, authToken) => {
|
|
36
36
|
return new Promise(function (resolve, reject) {
|
|
37
|
-
const request =
|
|
37
|
+
const request = client.post(
|
|
38
38
|
`api/v1/groups/users/add`,
|
|
39
39
|
{
|
|
40
40
|
groupId: groupId,
|
|
@@ -60,7 +60,7 @@ export const addUsersToGroup = (groupId, users, authToken) => {
|
|
|
60
60
|
*/
|
|
61
61
|
export const createGroup = (name, description, authToken) => {
|
|
62
62
|
return new Promise(function (resolve, reject) {
|
|
63
|
-
const request =
|
|
63
|
+
const request = client.post(
|
|
64
64
|
`api/v1/groups/group`,
|
|
65
65
|
{
|
|
66
66
|
name: name,
|
|
@@ -86,7 +86,7 @@ export const createGroup = (name, description, authToken) => {
|
|
|
86
86
|
*/
|
|
87
87
|
export const deleteGroup = (groupId, defaultGroupId, authToken) => {
|
|
88
88
|
return new Promise(function (resolve, reject) {
|
|
89
|
-
const request =
|
|
89
|
+
const request = client.delete(`api/v1/groups/delete`, {
|
|
90
90
|
headers: { authorization: authToken },
|
|
91
91
|
data: {
|
|
92
92
|
id: groupId,
|
|
@@ -109,7 +109,7 @@ export const deleteGroup = (groupId, defaultGroupId, authToken) => {
|
|
|
109
109
|
*/
|
|
110
110
|
export const getAllPermissions = (authToken) => {
|
|
111
111
|
return new Promise(function (resolve, reject) {
|
|
112
|
-
const request =
|
|
112
|
+
const request = client.get(`api/v1/groups/permissions/getAllPermissions`, {
|
|
113
113
|
headers: { authorization: authToken },
|
|
114
114
|
});
|
|
115
115
|
request
|
|
@@ -129,7 +129,7 @@ export const getAllPermissions = (authToken) => {
|
|
|
129
129
|
*/
|
|
130
130
|
export const getGroupById = (groupId, authToken) => {
|
|
131
131
|
return new Promise(function (resolve, reject) {
|
|
132
|
-
const request =
|
|
132
|
+
const request = client.get(`api/v1/groups/group/${groupId}`, {
|
|
133
133
|
headers: { authorization: authToken },
|
|
134
134
|
});
|
|
135
135
|
request
|
|
@@ -148,7 +148,7 @@ export const getGroupById = (groupId, authToken) => {
|
|
|
148
148
|
*/
|
|
149
149
|
export const getGroups = (authToken) => {
|
|
150
150
|
return new Promise(function (resolve, reject) {
|
|
151
|
-
const request =
|
|
151
|
+
const request = client.get(`api/v1/groups/`, {
|
|
152
152
|
headers: { authorization: authToken },
|
|
153
153
|
});
|
|
154
154
|
request
|
|
@@ -167,7 +167,7 @@ export const getGroups = (authToken) => {
|
|
|
167
167
|
*/
|
|
168
168
|
export const getUserPermissions = (authToken) => {
|
|
169
169
|
return new Promise(function (resolve, reject) {
|
|
170
|
-
const request =
|
|
170
|
+
const request = client.get(`api/v1/groups/users/getuserpermissions`, {
|
|
171
171
|
headers: { authorization: authToken },
|
|
172
172
|
});
|
|
173
173
|
request
|
|
@@ -188,7 +188,7 @@ export const getUserPermissions = (authToken) => {
|
|
|
188
188
|
*/
|
|
189
189
|
export const removePermissionsFromGroup = (groupId, permissions, authToken) => {
|
|
190
190
|
return new Promise(function (resolve, reject) {
|
|
191
|
-
const request =
|
|
191
|
+
const request = client.post(
|
|
192
192
|
`api/v1/groups/permissions/remove/`,
|
|
193
193
|
{
|
|
194
194
|
groupId: groupId,
|
|
@@ -214,7 +214,7 @@ export const removePermissionsFromGroup = (groupId, permissions, authToken) => {
|
|
|
214
214
|
*/
|
|
215
215
|
export const removeUsersFromGroup = (groupId, users, authToken) => {
|
|
216
216
|
return new Promise(function (resolve, reject) {
|
|
217
|
-
const request =
|
|
217
|
+
const request = client.post(
|
|
218
218
|
`api/v1/groups/users/remove/`,
|
|
219
219
|
{
|
|
220
220
|
groupId: groupId,
|
|
@@ -239,7 +239,7 @@ export const removeUsersFromGroup = (groupId, users, authToken) => {
|
|
|
239
239
|
*/
|
|
240
240
|
export const setDefault = (groupId, authToken) => {
|
|
241
241
|
return new Promise(function (resolve, reject) {
|
|
242
|
-
const request =
|
|
242
|
+
const request = client.put(
|
|
243
243
|
`api/v1/groups/setDefault/`,
|
|
244
244
|
{
|
|
245
245
|
id: groupId,
|
|
@@ -265,7 +265,7 @@ export const setDefault = (groupId, authToken) => {
|
|
|
265
265
|
*/
|
|
266
266
|
export const updateGroup = (groupId, name, description, authToken) => {
|
|
267
267
|
return new Promise(function (resolve, reject) {
|
|
268
|
-
const request =
|
|
268
|
+
const request = client.patch(
|
|
269
269
|
`api/v1/groups/group/`,
|
|
270
270
|
{
|
|
271
271
|
id: groupId,
|
|
@@ -283,3 +283,18 @@ export const updateGroup = (groupId, name, description, authToken) => {
|
|
|
283
283
|
});
|
|
284
284
|
});
|
|
285
285
|
};
|
|
286
|
+
|
|
287
|
+
export default {
|
|
288
|
+
addPermissionsToGroup: addPermissionsToGroup,
|
|
289
|
+
addUsersToGroup: addUsersToGroup,
|
|
290
|
+
createGroup: createGroup,
|
|
291
|
+
deleteGroup: deleteGroup,
|
|
292
|
+
getAllPermissions: getAllPermissions,
|
|
293
|
+
getGroupById: getGroupById,
|
|
294
|
+
getGroups: getGroups,
|
|
295
|
+
getUserPermissions: getUserPermissions,
|
|
296
|
+
removePermissionsFromGroup: removePermissionsFromGroup,
|
|
297
|
+
removeUsersFromGroup: removeUsersFromGroup,
|
|
298
|
+
setDefault: setDefault,
|
|
299
|
+
updateGroup: updateGroup,
|
|
300
|
+
};
|
package/lib/integration.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { client, errorToString } from "./axiosClient";
|
|
2
2
|
const axiosLib = require("axios");
|
|
3
3
|
const htmlParser = require("node-html-parser");
|
|
4
4
|
const htmlToText = require("html2plaintext");
|
|
@@ -13,7 +13,7 @@ export const createIntegration = (data, token) => {
|
|
|
13
13
|
const requestData = {
|
|
14
14
|
data: data,
|
|
15
15
|
};
|
|
16
|
-
let confirmationRequest =
|
|
16
|
+
let confirmationRequest = client.put("api/v1/integrations/", requestData, {
|
|
17
17
|
headers: { authorization: token },
|
|
18
18
|
});
|
|
19
19
|
confirmationRequest
|
|
@@ -33,7 +33,7 @@ export const createIntegration = (data, token) => {
|
|
|
33
33
|
*/
|
|
34
34
|
export const deleteIntegration = (id, token) => {
|
|
35
35
|
return new Promise(function (resolve, reject) {
|
|
36
|
-
const request =
|
|
36
|
+
const request = client.delete(`api/v1/integrations/`, {
|
|
37
37
|
headers: { authorization: token },
|
|
38
38
|
data: {
|
|
39
39
|
id: id,
|
|
@@ -57,7 +57,7 @@ export const deleteIntegration = (id, token) => {
|
|
|
57
57
|
export const discardIntegrationChanges = (id, token) => {
|
|
58
58
|
return new Promise(function (resolve, reject) {
|
|
59
59
|
const data = {};
|
|
60
|
-
const request =
|
|
60
|
+
const request = client.get(`api/v1/integrations/discard/${id}`, {
|
|
61
61
|
headers: { authorization: token },
|
|
62
62
|
data: data,
|
|
63
63
|
});
|
|
@@ -79,7 +79,7 @@ export const discardIntegrationChanges = (id, token) => {
|
|
|
79
79
|
*/
|
|
80
80
|
export const getIntegrationInformationById = (id, version, token) => {
|
|
81
81
|
return new Promise(function (resolve, reject) {
|
|
82
|
-
let confirmationRequest =
|
|
82
|
+
let confirmationRequest = client.get(
|
|
83
83
|
`api/v1/integrations/${id}/${version}`,
|
|
84
84
|
{
|
|
85
85
|
headers: { authorization: token },
|
|
@@ -117,7 +117,7 @@ export const getIntegrationsList = (
|
|
|
117
117
|
};
|
|
118
118
|
if (filter) requestData.filter = filter;
|
|
119
119
|
if (type) requestData.type = type;
|
|
120
|
-
let confirmationRequest =
|
|
120
|
+
let confirmationRequest = client.post(`api/v1/integrations`, requestData, {
|
|
121
121
|
headers: { authorization: token },
|
|
122
122
|
});
|
|
123
123
|
confirmationRequest
|
|
@@ -142,7 +142,7 @@ export const getContentInformationByUrl = (url, verb, token) => {
|
|
|
142
142
|
url: url,
|
|
143
143
|
verb: verb,
|
|
144
144
|
};
|
|
145
|
-
let confirmationRequest =
|
|
145
|
+
let confirmationRequest = client.post(
|
|
146
146
|
`api/v1/contentproviders/getcontentinformationbyurl`,
|
|
147
147
|
requestData,
|
|
148
148
|
{
|
|
@@ -243,7 +243,7 @@ export const getContentInformationByUrlFromBrowser = (url) => {
|
|
|
243
243
|
*/
|
|
244
244
|
export const getEnabledContentProviders = (userId, token) => {
|
|
245
245
|
return new Promise(function (resolve, reject) {
|
|
246
|
-
let confirmationRequest =
|
|
246
|
+
let confirmationRequest = client.get(
|
|
247
247
|
`api/v1/contentproviders/getenabledcontentproviders/${userId}`,
|
|
248
248
|
{
|
|
249
249
|
headers: { authorization: token },
|
|
@@ -266,7 +266,7 @@ export const getEnabledContentProviders = (userId, token) => {
|
|
|
266
266
|
*/
|
|
267
267
|
export const publishIntegration = (id, token) => {
|
|
268
268
|
return new Promise(function (resolve, reject) {
|
|
269
|
-
let confirmationRequest =
|
|
269
|
+
let confirmationRequest = client.post(
|
|
270
270
|
`api/v1/integrations/publish/${id}`,
|
|
271
271
|
{},
|
|
272
272
|
{
|
|
@@ -294,7 +294,7 @@ export const setIntegrationInformation = (id, data, token) => {
|
|
|
294
294
|
const requestData = {
|
|
295
295
|
data: data,
|
|
296
296
|
};
|
|
297
|
-
let confirmationRequest =
|
|
297
|
+
let confirmationRequest = client.post(
|
|
298
298
|
`api/v1/integrations/${id}`,
|
|
299
299
|
requestData,
|
|
300
300
|
{
|
|
@@ -318,7 +318,7 @@ export const setIntegrationInformation = (id, data, token) => {
|
|
|
318
318
|
*/
|
|
319
319
|
export const setDefaultIntegration = (id, token) => {
|
|
320
320
|
return new Promise(function (resolve, reject) {
|
|
321
|
-
let confirmationRequest =
|
|
321
|
+
let confirmationRequest = client.post(
|
|
322
322
|
`api/v1/integrations/${id}/default`,
|
|
323
323
|
"",
|
|
324
324
|
{
|
|
@@ -334,3 +334,17 @@ export const setDefaultIntegration = (id, token) => {
|
|
|
334
334
|
});
|
|
335
335
|
});
|
|
336
336
|
};
|
|
337
|
+
|
|
338
|
+
export default {
|
|
339
|
+
createIntegration: createIntegration,
|
|
340
|
+
deleteIntegration: deleteIntegration,
|
|
341
|
+
discardIntegrationChanges: discardIntegrationChanges,
|
|
342
|
+
getContentInformationByUrl: getContentInformationByUrl,
|
|
343
|
+
getContentInformationByUrlFromBrowser: getContentInformationByUrlFromBrowser,
|
|
344
|
+
getEnabledContentProviders: getEnabledContentProviders,
|
|
345
|
+
getIntegrationInformationById: getIntegrationInformationById,
|
|
346
|
+
getIntegrationsList: getIntegrationsList,
|
|
347
|
+
publishIntegration: publishIntegration,
|
|
348
|
+
setDefaultIntegration: setDefaultIntegration,
|
|
349
|
+
setIntegrationInformation: setIntegrationInformation,
|
|
350
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { client } from "./axiosClient";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Get the integration configuration
|
|
@@ -10,7 +10,7 @@ export 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;
|
|
13
|
-
let confirmationRequest =
|
|
13
|
+
let confirmationRequest = client.post(
|
|
14
14
|
"api/v1/integrationsconfiguration",
|
|
15
15
|
requestData,
|
|
16
16
|
{
|
|
@@ -46,7 +46,7 @@ export const saveIntegrationConfiguration = (
|
|
|
46
46
|
configuration: configuration,
|
|
47
47
|
type: type,
|
|
48
48
|
};
|
|
49
|
-
let confirmationRequest =
|
|
49
|
+
let confirmationRequest = client.put(
|
|
50
50
|
`api/v1/integrationsconfiguration`,
|
|
51
51
|
requestData,
|
|
52
52
|
{
|
|
@@ -82,7 +82,7 @@ export const testIntegrationConfiguration = (
|
|
|
82
82
|
configuration: configuration,
|
|
83
83
|
type: type,
|
|
84
84
|
};
|
|
85
|
-
let confirmationRequest =
|
|
85
|
+
let confirmationRequest = client.post(
|
|
86
86
|
`api/v1/integrationsconfiguration/testConfiguration`,
|
|
87
87
|
requestData,
|
|
88
88
|
{
|
|
@@ -98,3 +98,9 @@ export const testIntegrationConfiguration = (
|
|
|
98
98
|
});
|
|
99
99
|
});
|
|
100
100
|
};
|
|
101
|
+
|
|
102
|
+
export default {
|
|
103
|
+
getIntegrationsConfiguration: getIntegrationsConfiguration,
|
|
104
|
+
saveIntegrationConfiguration: saveIntegrationConfiguration,
|
|
105
|
+
testIntegrationConfiguration: testIntegrationConfiguration,
|
|
106
|
+
};
|