@stackfactor/client-api 1.0.32 → 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 +1 -1
- 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,143 +1,138 @@
|
|
|
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
|
-
reject(error);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
},
|
|
3
|
+
/**
|
|
4
|
+
* End an existing testing session
|
|
5
|
+
* @param {String} testingSessionId
|
|
6
|
+
* @param {String} token Authorization token
|
|
7
|
+
*/
|
|
8
|
+
export const endSession = (testingSessionId, token) => {
|
|
9
|
+
return new Promise(function (resolve, reject) {
|
|
10
|
+
let confirmationRequest = axios.put(
|
|
11
|
+
"api/v1/skillassessmenttestingsession/endsession",
|
|
12
|
+
{ id: testingSessionId },
|
|
13
|
+
{
|
|
14
|
+
headers: { authorization: token },
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
confirmationRequest
|
|
18
|
+
.then((response) => {
|
|
19
|
+
resolve(response.data);
|
|
20
|
+
})
|
|
21
|
+
.catch((error) => {
|
|
22
|
+
reject(error);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
};
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
27
|
+
/**
|
|
28
|
+
* End an existing testing session
|
|
29
|
+
* @param {String} testingSessionId
|
|
30
|
+
* @param {Array<String>} selectedAnswers
|
|
31
|
+
* @param {String} token Authorization token
|
|
32
|
+
*/
|
|
33
|
+
export const getNextStep = (testingSessionId, selectedAnswers, token) => {
|
|
34
|
+
return new Promise(function (resolve, reject) {
|
|
35
|
+
let data = {
|
|
36
|
+
id: testingSessionId,
|
|
37
|
+
};
|
|
38
|
+
if (selectedAnswers) data.selectedAnswers = selectedAnswers;
|
|
39
|
+
let confirmationRequest = axios.post(
|
|
40
|
+
`api/v1/skillassessmenttestingsession/getnextstep`,
|
|
41
|
+
data,
|
|
42
|
+
{
|
|
43
|
+
headers: { authorization: token },
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
confirmationRequest
|
|
47
|
+
.then((response) => {
|
|
48
|
+
resolve(response.data);
|
|
49
|
+
})
|
|
50
|
+
.catch((error) => {
|
|
51
|
+
reject(error);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
};
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Get skill assessment by user and skill
|
|
58
|
+
* @param {String} userId
|
|
59
|
+
* @param {String} skillId
|
|
60
|
+
* @param {String} token
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
export const getSkillTestAssessment = (userId, skillId, token) => {
|
|
64
|
+
return new Promise(function (resolve, reject) {
|
|
65
|
+
let confirmationRequest = axios.post(
|
|
66
|
+
`api/v1/skillassessmenttestingsession/getbyuserandskill`,
|
|
67
|
+
{
|
|
68
|
+
userId: userId,
|
|
69
|
+
skillId: skillId,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
headers: { authorization: token },
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
confirmationRequest
|
|
76
|
+
.then((response) => {
|
|
77
|
+
resolve(response.data);
|
|
78
|
+
})
|
|
79
|
+
.catch((error) => {
|
|
80
|
+
reject(error);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Pause skill assessment
|
|
87
|
+
* @param {String} testingSessionId
|
|
88
|
+
* @param {String} token
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
91
|
+
export const pause = (testingSessionId, token) => {
|
|
92
|
+
return new Promise(function (resolve, reject) {
|
|
93
|
+
let confirmationRequest = axios.post(
|
|
94
|
+
`api/v1/skillassessmenttestingsession/pausesession`,
|
|
95
|
+
{
|
|
96
|
+
id: testingSessionId,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
headers: { authorization: token },
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
confirmationRequest
|
|
103
|
+
.then((response) => {
|
|
104
|
+
resolve(response.data);
|
|
105
|
+
})
|
|
106
|
+
.catch((error) => {
|
|
107
|
+
reject(error);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
115
111
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
},
|
|
112
|
+
/**
|
|
113
|
+
* Start a new test skill test assessment session
|
|
114
|
+
* @param {String} skillId
|
|
115
|
+
* @param {Boolean} saveSession
|
|
116
|
+
* @param {String} token
|
|
117
|
+
*/
|
|
118
|
+
export const startSession = (skillId, saveSession, token) => {
|
|
119
|
+
return new Promise(function (resolve, reject) {
|
|
120
|
+
let confirmationRequest = axios.post(
|
|
121
|
+
"api/v1/skillassessmenttestingsession/startsession",
|
|
122
|
+
{
|
|
123
|
+
saveSession: saveSession,
|
|
124
|
+
skillId: skillId,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
headers: { authorization: token },
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
confirmationRequest
|
|
131
|
+
.then((response) => {
|
|
132
|
+
resolve(response.data);
|
|
133
|
+
})
|
|
134
|
+
.catch((error) => {
|
|
135
|
+
reject(error);
|
|
136
|
+
});
|
|
137
|
+
});
|
|
143
138
|
};
|
package/lib/skillAssessments.js
CHANGED
|
@@ -1,139 +1,135 @@
|
|
|
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
|
-
"api/v1/skillassessments/addentry",
|
|
22
|
-
requestData,
|
|
23
|
-
{
|
|
24
|
-
headers: { authorization: token },
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
confirmationRequest
|
|
28
|
-
.then((response) => {
|
|
29
|
-
resolve(response.data);
|
|
30
|
-
})
|
|
31
|
-
.catch((error) => {
|
|
32
|
-
reject(error);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Create skill assessment
|
|
39
|
-
* @param {Object} data
|
|
40
|
-
* @param {String} comments
|
|
41
|
-
* @param {String} userId
|
|
42
|
-
* @param {String} token Authorization token
|
|
43
|
-
*/
|
|
44
|
-
create: (data, comments, userId, token) => {
|
|
45
|
-
return new Promise(function (resolve, reject) {
|
|
46
|
-
const requestData = {
|
|
47
|
-
comments: comments,
|
|
48
|
-
data: data,
|
|
49
|
-
userId: userId,
|
|
50
|
-
};
|
|
51
|
-
let confirmationRequest = axios.put(
|
|
52
|
-
"api/v1/skillassessments/",
|
|
53
|
-
requestData,
|
|
54
|
-
{
|
|
55
|
-
headers: { authorization: token },
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
confirmationRequest
|
|
59
|
-
.then((response) => {
|
|
60
|
-
resolve(response.data);
|
|
61
|
-
})
|
|
62
|
-
.catch((error) => {
|
|
63
|
-
reject(error);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Delete skill assessment
|
|
70
|
-
* @param {number} id The id of the skill to be deleted
|
|
71
|
-
* @param {String} comments The comment included with the deletion
|
|
72
|
-
* @param {String} token Authorization token
|
|
73
|
-
*/
|
|
74
|
-
deleteSkillAssessment: (id, comments, token) => {
|
|
75
|
-
return new Promise(function (resolve, reject) {
|
|
76
|
-
const data = {
|
|
77
|
-
id: id,
|
|
78
|
-
};
|
|
79
|
-
if (comments) data.comments = comments;
|
|
80
|
-
const request = axios.delete(`api/v1/skillassessments`, {
|
|
3
|
+
/**
|
|
4
|
+
* Add new entry skill assessment
|
|
5
|
+
* @param {String} id
|
|
6
|
+
* @param {Object} data
|
|
7
|
+
* @param {String} comments
|
|
8
|
+
* @param {String} token Authorization token
|
|
9
|
+
*/
|
|
10
|
+
export const addEntry = (id, data, comments, token) => {
|
|
11
|
+
return new Promise(function (resolve, reject) {
|
|
12
|
+
const requestData = {
|
|
13
|
+
comments: comments,
|
|
14
|
+
data: data,
|
|
15
|
+
id: id,
|
|
16
|
+
};
|
|
17
|
+
let confirmationRequest = axios.put(
|
|
18
|
+
"api/v1/skillassessments/addentry",
|
|
19
|
+
requestData,
|
|
20
|
+
{
|
|
81
21
|
headers: { authorization: token },
|
|
82
|
-
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
confirmationRequest
|
|
25
|
+
.then((response) => {
|
|
26
|
+
resolve(response.data);
|
|
27
|
+
})
|
|
28
|
+
.catch((error) => {
|
|
29
|
+
reject(error);
|
|
83
30
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
resolve(response.data);
|
|
87
|
-
})
|
|
88
|
-
.catch((error) => {
|
|
89
|
-
reject(error);
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
},
|
|
31
|
+
});
|
|
32
|
+
};
|
|
93
33
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Create skill assessment
|
|
36
|
+
* @param {Object} data
|
|
37
|
+
* @param {String} comments
|
|
38
|
+
* @param {String} userId
|
|
39
|
+
* @param {String} token Authorization token
|
|
40
|
+
*/
|
|
41
|
+
export const create = (data, comments, userId, token) => {
|
|
42
|
+
return new Promise(function (resolve, reject) {
|
|
43
|
+
const requestData = {
|
|
44
|
+
comments: comments,
|
|
45
|
+
data: data,
|
|
46
|
+
userId: userId,
|
|
47
|
+
};
|
|
48
|
+
let confirmationRequest = axios.put(
|
|
49
|
+
"api/v1/skillassessments/",
|
|
50
|
+
requestData,
|
|
51
|
+
{
|
|
102
52
|
headers: { authorization: token },
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
confirmationRequest
|
|
56
|
+
.then((response) => {
|
|
57
|
+
resolve(response.data);
|
|
58
|
+
})
|
|
59
|
+
.catch((error) => {
|
|
60
|
+
reject(error);
|
|
103
61
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Delete skill assessment
|
|
67
|
+
* @param {number} id The id of the skill to be deleted
|
|
68
|
+
* @param {String} comments The comment included with the deletion
|
|
69
|
+
* @param {String} token Authorization token
|
|
70
|
+
*/
|
|
71
|
+
export const deleteSkillAssessment = (id, comments, token) => {
|
|
72
|
+
return new Promise(function (resolve, reject) {
|
|
73
|
+
const data = {
|
|
74
|
+
id: id,
|
|
75
|
+
};
|
|
76
|
+
if (comments) data.comments = comments;
|
|
77
|
+
const request = axios.delete(`api/v1/skillassessments`, {
|
|
78
|
+
headers: { authorization: token },
|
|
79
|
+
data: data,
|
|
111
80
|
});
|
|
112
|
-
|
|
81
|
+
request
|
|
82
|
+
.then((response) => {
|
|
83
|
+
resolve(response.data);
|
|
84
|
+
})
|
|
85
|
+
.catch((error) => {
|
|
86
|
+
reject(error);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
};
|
|
113
90
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
let confirmationRequest = axios.post(
|
|
124
|
-
`api/v1/skillassessments`,
|
|
125
|
-
requestData,
|
|
126
|
-
{
|
|
127
|
-
headers: { authorization: token },
|
|
128
|
-
}
|
|
129
|
-
);
|
|
130
|
-
confirmationRequest
|
|
131
|
-
.then((response) => {
|
|
132
|
-
resolve(response.data);
|
|
133
|
-
})
|
|
134
|
-
.catch((error) => {
|
|
135
|
-
reject(error);
|
|
136
|
-
});
|
|
91
|
+
/**
|
|
92
|
+
* Get skill assessment by id
|
|
93
|
+
* @param {String} id
|
|
94
|
+
* @param {String} token
|
|
95
|
+
*/
|
|
96
|
+
export const getById = (id, token) => {
|
|
97
|
+
return new Promise(function (resolve, reject) {
|
|
98
|
+
let confirmationRequest = axios.get(`api/v1/skillassessments/${id}`, {
|
|
99
|
+
headers: { authorization: token },
|
|
137
100
|
});
|
|
138
|
-
|
|
101
|
+
confirmationRequest
|
|
102
|
+
.then((response) => {
|
|
103
|
+
resolve(response.data);
|
|
104
|
+
})
|
|
105
|
+
.catch((error) => {
|
|
106
|
+
reject(error);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Get list
|
|
113
|
+
* @param {Object} userId The user used to select the skill
|
|
114
|
+
* @param {String} token Authorization token
|
|
115
|
+
*/
|
|
116
|
+
export const getList = (userId, token) => {
|
|
117
|
+
return new Promise(function (resolve, reject) {
|
|
118
|
+
const requestData = {};
|
|
119
|
+
if (userId) requestData.userId = userId;
|
|
120
|
+
let confirmationRequest = axios.post(
|
|
121
|
+
`api/v1/skillassessments`,
|
|
122
|
+
requestData,
|
|
123
|
+
{
|
|
124
|
+
headers: { authorization: token },
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
confirmationRequest
|
|
128
|
+
.then((response) => {
|
|
129
|
+
resolve(response.data);
|
|
130
|
+
})
|
|
131
|
+
.catch((error) => {
|
|
132
|
+
reject(error);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
139
135
|
};
|