@stackfactor/client-api 1.0.31 → 1.0.33
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 +0 -2
- package/lib/actionNotifications.js +202 -226
- package/lib/address.js +21 -27
- package/lib/axiosClient.js +58 -64
- package/lib/config.js +62 -66
- package/lib/dashboard.js +64 -68
- package/lib/departmentTrainingPlans.js +159 -153
- package/lib/groups.js +266 -291
- package/lib/integration.js +307 -312
- package/lib/integrationConfiguration.js +96 -90
- package/lib/integrations/contentGenerator.js +71 -74
- package/lib/learningContent.js +239 -240
- package/lib/logger.js +51 -56
- package/lib/role.js +238 -245
- package/lib/roleTemplate.js +247 -255
- package/lib/skill.js +299 -311
- package/lib/skillAssessmentTestingSession.js +132 -137
- package/lib/skillAssessments.js +125 -129
- package/lib/skillTemplate.js +250 -255
- package/lib/teams.js +261 -257
- package/lib/tenants.js +48 -52
- package/lib/trainingPlanTemplate.js +203 -202
- package/lib/trainingPlans.js +249 -251
- package/lib/userInformation.js +97 -85
- package/lib/users.js +557 -555
- package/lib/utils.js +38 -42
- package/package.json +1 -1
- package/lib/templates.js +0 -148
|
@@ -1,94 +1,100 @@
|
|
|
1
|
-
import
|
|
1
|
+
import axios from "./axiosClient";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
},
|
|
3
|
+
/**
|
|
4
|
+
* Get the integration configuration
|
|
5
|
+
* @param {Array<String>} ids
|
|
6
|
+
* @param {Number} type
|
|
7
|
+
* @param {String} token Authorization token
|
|
8
|
+
*/
|
|
9
|
+
export const getIntegrationsConfiguration = (ids, type, token) => {
|
|
10
|
+
return new Promise(function (resolve, reject) {
|
|
11
|
+
let requestData = { type: type };
|
|
12
|
+
if (ids) requestData.ids = ids;
|
|
13
|
+
let confirmationRequest = axios.post(
|
|
14
|
+
"api/v1/integrationsconfiguration",
|
|
15
|
+
requestData,
|
|
16
|
+
{
|
|
17
|
+
headers: { authorization: token },
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
confirmationRequest
|
|
21
|
+
.then((response) => {
|
|
22
|
+
resolve(response.data);
|
|
23
|
+
})
|
|
24
|
+
.catch((error) => {
|
|
25
|
+
reject(error);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
};
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Save integration configuration
|
|
32
|
+
* @param {String} id The id of the integration configurationto be updated
|
|
33
|
+
* @param {Number} type The type of configuration
|
|
34
|
+
* @param {Object} configuration Data used to update the integration configuration
|
|
35
|
+
* @param {String} token Authorization token
|
|
36
|
+
*/
|
|
37
|
+
export const saveIntegrationConfiguration = (
|
|
38
|
+
id,
|
|
39
|
+
type,
|
|
40
|
+
configuration,
|
|
41
|
+
token
|
|
42
|
+
) => {
|
|
43
|
+
return new Promise(function (resolve, reject) {
|
|
44
|
+
const requestData = {
|
|
45
|
+
id: id,
|
|
46
|
+
configuration: configuration,
|
|
47
|
+
type: type,
|
|
48
|
+
};
|
|
49
|
+
let confirmationRequest = axios.put(
|
|
50
|
+
`api/v1/integrationsconfiguration`,
|
|
51
|
+
requestData,
|
|
52
|
+
{
|
|
53
|
+
headers: { authorization: token },
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
confirmationRequest
|
|
57
|
+
.then((response) => {
|
|
58
|
+
resolve(response.data);
|
|
59
|
+
})
|
|
60
|
+
.catch((error) => {
|
|
61
|
+
reject(error);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
};
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Test integration configuration
|
|
68
|
+
* @param {String} id The id of the integration to be updated
|
|
69
|
+
* @param {String} type The type of configuration
|
|
70
|
+
* @param {Object} configuration Configuration to be tested
|
|
71
|
+
* @param {String} token Authorization token
|
|
72
|
+
*/
|
|
73
|
+
export const testIntegrationConfiguration = (
|
|
74
|
+
id,
|
|
75
|
+
type,
|
|
76
|
+
configuration,
|
|
77
|
+
token
|
|
78
|
+
) => {
|
|
79
|
+
return new Promise(function (resolve, reject) {
|
|
80
|
+
const requestData = {
|
|
81
|
+
id: id,
|
|
82
|
+
configuration: configuration,
|
|
83
|
+
type: type,
|
|
84
|
+
};
|
|
85
|
+
let confirmationRequest = axios.post(
|
|
86
|
+
`api/v1/integrationsconfiguration/testConfiguration`,
|
|
87
|
+
requestData,
|
|
88
|
+
{
|
|
89
|
+
headers: { authorization: token },
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
confirmationRequest
|
|
93
|
+
.then((response) => {
|
|
94
|
+
resolve(response.data);
|
|
95
|
+
})
|
|
96
|
+
.catch((error) => {
|
|
97
|
+
reject(error);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
94
100
|
};
|
|
@@ -1,78 +1,75 @@
|
|
|
1
|
-
|
|
1
|
+
import axios from "./axiosClient";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const request = axios.post(`api/v1/contentgenerators/generate`, data_, {
|
|
21
|
-
headers: { authorization: token },
|
|
22
|
-
});
|
|
23
|
-
request
|
|
24
|
-
.then((response) => {
|
|
25
|
-
resolve(response.data);
|
|
26
|
-
})
|
|
27
|
-
.catch((error) => {
|
|
28
|
-
reject(error);
|
|
29
|
-
});
|
|
3
|
+
/**
|
|
4
|
+
* Generate content
|
|
5
|
+
* @param {Array<String>} data
|
|
6
|
+
* @param {String} contentType
|
|
7
|
+
* @param {String} integrationId
|
|
8
|
+
* @param {String} token
|
|
9
|
+
* @returns {Object}
|
|
10
|
+
*/
|
|
11
|
+
export const generateContent = (data, contentType, integrationId, token) => {
|
|
12
|
+
return new Promise(function (resolve, reject) {
|
|
13
|
+
let data_ = {
|
|
14
|
+
data: data,
|
|
15
|
+
contentType: contentType,
|
|
16
|
+
};
|
|
17
|
+
if (integrationId) data.integrationId = integrationId;
|
|
18
|
+
const request = axios.post(`api/v1/contentgenerators/generate`, data_, {
|
|
19
|
+
headers: { authorization: token },
|
|
30
20
|
});
|
|
31
|
-
|
|
21
|
+
request
|
|
22
|
+
.then((response) => {
|
|
23
|
+
resolve(response.data);
|
|
24
|
+
})
|
|
25
|
+
.catch((error) => {
|
|
26
|
+
reject(error);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
};
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
31
|
+
/**
|
|
32
|
+
* Generate content aync
|
|
33
|
+
* @param {String} id
|
|
34
|
+
* @param {Object} data
|
|
35
|
+
* @param {String} contentType
|
|
36
|
+
* @param {String} elementType
|
|
37
|
+
* @param {String} integrationId
|
|
38
|
+
* @param {String} comments
|
|
39
|
+
* @param {String} token
|
|
40
|
+
* @returns {Object}
|
|
41
|
+
*/
|
|
42
|
+
export const generateContentAsync = (
|
|
43
|
+
id,
|
|
44
|
+
data,
|
|
45
|
+
contentType,
|
|
46
|
+
elementType,
|
|
47
|
+
integrationId,
|
|
48
|
+
comments,
|
|
49
|
+
token
|
|
50
|
+
) => {
|
|
51
|
+
return new Promise(function (resolve, reject) {
|
|
52
|
+
let data_ = {
|
|
53
|
+
data: data,
|
|
54
|
+
comments: comments,
|
|
55
|
+
contentType: contentType,
|
|
56
|
+
elementType: elementType,
|
|
57
|
+
id: id,
|
|
58
|
+
};
|
|
59
|
+
if (integrationId) data_.integrationId = integrationId;
|
|
60
|
+
const request = axios.post(
|
|
61
|
+
`api/v1/contentgenerators/generateasync`,
|
|
62
|
+
data_,
|
|
63
|
+
{
|
|
64
|
+
headers: { authorization: token },
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
request
|
|
68
|
+
.then((response) => {
|
|
69
|
+
resolve(response.data);
|
|
70
|
+
})
|
|
71
|
+
.catch((error) => {
|
|
72
|
+
reject(error);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
78
75
|
};
|