@stackfactor/client-api 1.1.128 → 1.1.130
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/exports.ts +85 -0
- package/index.ts +1 -0
- package/lib/{actionNotifications.js → actionNotifications.ts} +18 -6
- package/lib/{address.js → address.ts} +3 -2
- package/lib/{aiAssistant.js → aiAssistant.ts} +58 -25
- package/lib/{avatar.js → avatar.ts} +10 -4
- package/lib/axiosClient.ts +92 -0
- package/lib/{config.js → config.ts} +19 -6
- package/lib/{constants.js → constants.ts} +6 -41
- package/lib/{dashboard.js → dashboard.ts} +17 -7
- package/lib/{departmentTrainingPlans.js → departmentTrainingPlans.ts} +57 -23
- package/lib/{groups.js → groups.ts} +67 -26
- package/lib/{integration.js → integration.ts} +100 -43
- package/lib/{integrationConfiguration.js → integrationConfiguration.ts} +25 -8
- package/lib/integrations/{contentGenerator.js → contentGenerator.ts} +38 -18
- package/lib/{learningContent.js → learningContent.ts} +127 -66
- package/lib/{learningPath.js → learningPath.ts} +56 -29
- package/lib/{logger.js → logger.ts} +17 -5
- package/lib/{microSkillsQuizes.js → microSkillsQuizes.ts} +15 -6
- package/lib/{quotas.js → quotas.ts} +10 -5
- package/lib/{role.js → role.ts} +114 -66
- package/lib/{roleTemplate.js → roleTemplate.ts} +63 -28
- package/lib/{security.js → security.ts} +14 -10
- package/lib/{skill.js → skill.ts} +119 -82
- package/lib/{skillAssessments.js → skillAssessmentTestingSession.ts} +39 -17
- package/lib/skillAssessments.ts +192 -0
- package/lib/{skillTemplate.js → skillTemplate.ts} +70 -39
- package/lib/{talentTransfromation.js → talentTransfromation.ts} +21 -15
- package/lib/{teams.js → teams.ts} +71 -27
- package/lib/{tenants.js → tenants.ts} +16 -7
- package/lib/{trainingPlans.js → trainingPlans.ts} +96 -59
- package/lib/{trainingPlansProficiencyLevels.js → trainingPlansProficiencyLevels.ts} +29 -23
- package/lib/{userInformation.js → userInformation.ts} +25 -12
- package/lib/{users.js → users.ts} +172 -154
- package/lib/{utils.js → utils.ts} +6 -6
- package/package.json +8 -6
- package/exports.js +0 -85
- package/index.js +0 -1
- package/lib/axiosClient.js +0 -82
- package/lib/skillAssessmentTestingSession.js +0 -147
|
@@ -4,9 +4,10 @@ import { client } from "./axiosClient.js";
|
|
|
4
4
|
* Create skill template and set information
|
|
5
5
|
* @param {Object} data
|
|
6
6
|
* @param {String} token Authorization token
|
|
7
|
+
* @returns {Promise<Object>}
|
|
7
8
|
*/
|
|
8
|
-
const createSkillTemplate = (data, token) => {
|
|
9
|
-
return new Promise(
|
|
9
|
+
const createSkillTemplate = (data: object, token: string): Promise<object> => {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
10
11
|
const requestData = {
|
|
11
12
|
data: data,
|
|
12
13
|
};
|
|
@@ -28,16 +29,20 @@ const createSkillTemplate = (data, token) => {
|
|
|
28
29
|
* @param {number} id The id of the template to be deleted
|
|
29
30
|
* @param {String} comments The comments included with the deletion
|
|
30
31
|
* @param {String} token Authorization token
|
|
32
|
+
* @returns {Promise<Object>}
|
|
31
33
|
*/
|
|
32
|
-
const deleteSkillTemplate = (
|
|
33
|
-
|
|
34
|
+
const deleteSkillTemplate = (
|
|
35
|
+
id: number,
|
|
36
|
+
comments: string,
|
|
37
|
+
token: string
|
|
38
|
+
): Promise<object> => {
|
|
39
|
+
const data: { id: number; comments?: string } = {
|
|
34
40
|
id: id,
|
|
35
41
|
};
|
|
36
42
|
if (comments) data.comments = comments;
|
|
37
|
-
return new Promise(
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
38
44
|
const request = client.delete(`api/v1/skilltemplates/`, {
|
|
39
45
|
headers: { authorization: token },
|
|
40
|
-
|
|
41
46
|
data: data,
|
|
42
47
|
});
|
|
43
48
|
request
|
|
@@ -54,13 +59,16 @@ const deleteSkillTemplate = (id, comments, token) => {
|
|
|
54
59
|
* Discard the skill template draft changes
|
|
55
60
|
* @param {String} id The id of the skill template to be deleted
|
|
56
61
|
* @param {String} token Authorization token
|
|
62
|
+
* @returns {Promise<Object>}
|
|
57
63
|
*/
|
|
58
|
-
const discardSkillTemplateChanges = (
|
|
59
|
-
|
|
64
|
+
const discardSkillTemplateChanges = (
|
|
65
|
+
id: string,
|
|
66
|
+
token: string
|
|
67
|
+
): Promise<object> => {
|
|
68
|
+
return new Promise((resolve, reject) => {
|
|
60
69
|
const data = {};
|
|
61
70
|
const request = client.get(`api/v1/skilltemplates/discard/${id}`, {
|
|
62
71
|
headers: { authorization: token },
|
|
63
|
-
|
|
64
72
|
data: data,
|
|
65
73
|
});
|
|
66
74
|
request
|
|
@@ -79,14 +87,15 @@ const discardSkillTemplateChanges = (id, token) => {
|
|
|
79
87
|
* @param {String} version The version of the template
|
|
80
88
|
* @param {Boolean} returnNullIfVersionNotFound When true it will return null if the version is not found
|
|
81
89
|
* @param {String} token Authorization token
|
|
90
|
+
* @returns {Promise<Object>}
|
|
82
91
|
*/
|
|
83
92
|
const getSkillTemplateInformationById = (
|
|
84
|
-
id,
|
|
85
|
-
version,
|
|
86
|
-
returnNullIfVersionNotFound,
|
|
87
|
-
token
|
|
88
|
-
) => {
|
|
89
|
-
return new Promise(
|
|
93
|
+
id: string,
|
|
94
|
+
version: string,
|
|
95
|
+
returnNullIfVersionNotFound: boolean,
|
|
96
|
+
token: string
|
|
97
|
+
): Promise<object> => {
|
|
98
|
+
return new Promise((resolve, reject) => {
|
|
90
99
|
let confirmationRequest = client.get(
|
|
91
100
|
`api/v1/skilltemplates/${id}/${version}/${returnNullIfVersionNotFound}`,
|
|
92
101
|
{
|
|
@@ -110,16 +119,17 @@ const getSkillTemplateInformationById = (
|
|
|
110
119
|
* @param {Boolean} includeDeleted When true it will return the deleted records as well
|
|
111
120
|
* @param {Boolean} namesOnly When true it will return only the names of the templates
|
|
112
121
|
* @param {String} token Authorization token
|
|
122
|
+
* @returns {Promise<Object>}
|
|
113
123
|
*/
|
|
114
124
|
const getSkillTemplateList = (
|
|
115
|
-
filter,
|
|
116
|
-
version,
|
|
117
|
-
includeDeleted,
|
|
118
|
-
namesOnly,
|
|
119
|
-
token
|
|
120
|
-
) => {
|
|
121
|
-
return new Promise(
|
|
122
|
-
const requestData = {
|
|
125
|
+
filter: string[],
|
|
126
|
+
version: string,
|
|
127
|
+
includeDeleted: boolean,
|
|
128
|
+
namesOnly: boolean,
|
|
129
|
+
token: string
|
|
130
|
+
): Promise<object> => {
|
|
131
|
+
return new Promise((resolve, reject) => {
|
|
132
|
+
const requestData: { includeDeleted: boolean; namesOnly: boolean; version: string; filter?: string[] } = {
|
|
123
133
|
includeDeleted: includeDeleted,
|
|
124
134
|
namesOnly: namesOnly,
|
|
125
135
|
version: version,
|
|
@@ -143,11 +153,12 @@ const getSkillTemplateList = (
|
|
|
143
153
|
};
|
|
144
154
|
|
|
145
155
|
/**
|
|
146
|
-
* Get skill
|
|
156
|
+
* Get skill technology stacks template list
|
|
147
157
|
* @param {String} token Authorization token
|
|
158
|
+
* @returns {Promise<Object>}
|
|
148
159
|
*/
|
|
149
|
-
const getTechnologyStacks = (token) => {
|
|
150
|
-
return new Promise(
|
|
160
|
+
const getTechnologyStacks = (token: string): Promise<object> => {
|
|
161
|
+
return new Promise((resolve, reject) => {
|
|
151
162
|
let confirmationRequest = client.get(`api/v1/skilltemplates/stacks`, {
|
|
152
163
|
headers: { authorization: token },
|
|
153
164
|
});
|
|
@@ -166,10 +177,15 @@ const getTechnologyStacks = (token) => {
|
|
|
166
177
|
* @param {number} id The id of the template to be published
|
|
167
178
|
* @param {String} comments The comments to be include with the request
|
|
168
179
|
* @param {String} token Authorization token
|
|
180
|
+
* @returns {Promise<Object>}
|
|
169
181
|
*/
|
|
170
|
-
const publishTemplate = (
|
|
171
|
-
|
|
172
|
-
|
|
182
|
+
const publishTemplate = (
|
|
183
|
+
id: number,
|
|
184
|
+
comments: string,
|
|
185
|
+
token: string
|
|
186
|
+
): Promise<object> => {
|
|
187
|
+
return new Promise((resolve, reject) => {
|
|
188
|
+
let data: { comments?: string } = {};
|
|
173
189
|
if (comments) data.comments = comments;
|
|
174
190
|
let confirmationRequest = client.post(
|
|
175
191
|
`api/v1/skilltemplates/publish/${id}`,
|
|
@@ -193,9 +209,14 @@ const publishTemplate = (id, comments, token) => {
|
|
|
193
209
|
* @param {String} id The id of the template to be updated
|
|
194
210
|
* @param {Object} data Data used to update the template
|
|
195
211
|
* @param {String} token Authorization token
|
|
212
|
+
* @returns {Promise<Object>}
|
|
196
213
|
*/
|
|
197
|
-
const setTemplateInformation = (
|
|
198
|
-
|
|
214
|
+
const setTemplateInformation = (
|
|
215
|
+
id: string,
|
|
216
|
+
data: object,
|
|
217
|
+
token: string
|
|
218
|
+
): Promise<object> => {
|
|
219
|
+
return new Promise((resolve, reject) => {
|
|
199
220
|
const requestData = {
|
|
200
221
|
data: data,
|
|
201
222
|
id: id,
|
|
@@ -222,9 +243,14 @@ const setTemplateInformation = (id, data, token) => {
|
|
|
222
243
|
* @param {String} id The id of the template to be updated
|
|
223
244
|
* @param {Object} tags Updated template tags
|
|
224
245
|
* @param {String} token Authorization token
|
|
246
|
+
* @returns {Promise<Object>}
|
|
225
247
|
*/
|
|
226
|
-
const setTemplateTags = (
|
|
227
|
-
|
|
248
|
+
const setTemplateTags = (
|
|
249
|
+
id: string,
|
|
250
|
+
tags: object,
|
|
251
|
+
token: string
|
|
252
|
+
): Promise<object> => {
|
|
253
|
+
return new Promise((resolve, reject) => {
|
|
228
254
|
const requestData = {
|
|
229
255
|
tags: tags,
|
|
230
256
|
id: id,
|
|
@@ -246,14 +272,14 @@ const setTemplateTags = (id, tags, token) => {
|
|
|
246
272
|
});
|
|
247
273
|
};
|
|
248
274
|
|
|
249
|
-
|
|
275
|
+
/**
|
|
250
276
|
* Validate skill template information
|
|
251
277
|
* @param {String} id The id of the skill to be updated
|
|
252
278
|
* @param {String} token Authorization token
|
|
253
|
-
* @returns {Promise}
|
|
279
|
+
* @returns {Promise<Object>}
|
|
254
280
|
*/
|
|
255
|
-
const validateTemplate = (id, token) => {
|
|
256
|
-
return new Promise(
|
|
281
|
+
const validateTemplate = (id: string, token: string): Promise<object> => {
|
|
282
|
+
return new Promise((resolve, reject) => {
|
|
257
283
|
const requestData = {
|
|
258
284
|
id: id,
|
|
259
285
|
};
|
|
@@ -279,9 +305,14 @@ const validateTemplate = (id, token) => {
|
|
|
279
305
|
* @param {String} id The id of the skill template to be updated
|
|
280
306
|
* @param {Boolean} watch Set to true or false
|
|
281
307
|
* @param {String} token Authorization token
|
|
308
|
+
* @returns {Promise<Object>}
|
|
282
309
|
*/
|
|
283
|
-
const watchSkillTemplate = (
|
|
284
|
-
|
|
310
|
+
const watchSkillTemplate = (
|
|
311
|
+
id: string,
|
|
312
|
+
watch: boolean,
|
|
313
|
+
token: string
|
|
314
|
+
): Promise<object> => {
|
|
315
|
+
return new Promise((resolve, reject) => {
|
|
285
316
|
const requestData = {
|
|
286
317
|
id: id,
|
|
287
318
|
watch: watch,
|
|
@@ -2,11 +2,13 @@ import { client } from "./axiosClient.js";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Get talent transformation steps for the current user
|
|
5
|
-
* @param {String} userId
|
|
6
5
|
* @param {String} authToken The authentication token
|
|
6
|
+
* @returns {Promise<Object>}
|
|
7
7
|
*/
|
|
8
|
-
const getTalentTransformationStepsForCurrentUser = (
|
|
9
|
-
|
|
8
|
+
const getTalentTransformationStepsForCurrentUser = (
|
|
9
|
+
authToken: string
|
|
10
|
+
): Promise<object> => {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
10
12
|
const request = client.get(
|
|
11
13
|
`api/v1/talenttransformation/getforcurrentuser`,
|
|
12
14
|
authToken
|
|
@@ -30,8 +32,8 @@ const getTalentTransformationStepsForCurrentUser = (authToken) => {
|
|
|
30
32
|
* @param {String} authToken
|
|
31
33
|
* @returns {Promise<Object>} The talent transformation summary
|
|
32
34
|
*/
|
|
33
|
-
const getTalentTransformationSummary = (authToken) => {
|
|
34
|
-
return new Promise(
|
|
35
|
+
const getTalentTransformationSummary = (authToken: string): Promise<object> => {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
35
37
|
const request = client.get(
|
|
36
38
|
`api/v1/talenttransformation/summary`,
|
|
37
39
|
authToken
|
|
@@ -51,12 +53,16 @@ const getTalentTransformationSummary = (authToken) => {
|
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
/**
|
|
54
|
-
* Get the talent transformation summary for the
|
|
56
|
+
* Get the talent transformation summary for the team
|
|
57
|
+
* @param {String} teamId
|
|
55
58
|
* @param {String} authToken
|
|
56
59
|
* @returns {Promise<Object>} The talent transformation summary
|
|
57
60
|
*/
|
|
58
|
-
const getTalentTransformationSummaryForTeam = (
|
|
59
|
-
|
|
61
|
+
const getTalentTransformationSummaryForTeam = (
|
|
62
|
+
teamId: string,
|
|
63
|
+
authToken: string
|
|
64
|
+
): Promise<object> => {
|
|
65
|
+
return new Promise((resolve, reject) => {
|
|
60
66
|
const request = client.get(
|
|
61
67
|
`api/v1/talenttransformation/summaryforteam/${teamId}`,
|
|
62
68
|
authToken
|
|
@@ -81,15 +87,15 @@ const getTalentTransformationSummaryForTeam = (teamId, authToken) => {
|
|
|
81
87
|
* @param {Object} data Data used to update the talent transformation step
|
|
82
88
|
* @param {Boolean} returnAllStepsStatuses If true, return all steps statuses
|
|
83
89
|
* @param {String} token Authorization token
|
|
84
|
-
* @returns {Promise}
|
|
90
|
+
* @returns {Promise<Object>}
|
|
85
91
|
*/
|
|
86
92
|
const setTalentTransformationStepData = (
|
|
87
|
-
id,
|
|
88
|
-
data,
|
|
89
|
-
returnAllStepsStatuses,
|
|
90
|
-
token
|
|
91
|
-
) => {
|
|
92
|
-
return new Promise(
|
|
93
|
+
id: string,
|
|
94
|
+
data: object,
|
|
95
|
+
returnAllStepsStatuses: boolean,
|
|
96
|
+
token: string
|
|
97
|
+
): Promise<object> => {
|
|
98
|
+
return new Promise((resolve, reject) => {
|
|
93
99
|
const requestData = {
|
|
94
100
|
data: data,
|
|
95
101
|
id: id,
|
|
@@ -5,9 +5,14 @@ import { client } from "./axiosClient.js";
|
|
|
5
5
|
* @param {String} teamId The team Id
|
|
6
6
|
* @param {Array<String>} users The users to be added
|
|
7
7
|
* @param {String} authToken - Authentication token
|
|
8
|
+
* @returns {Promise<Object>}
|
|
8
9
|
*/
|
|
9
|
-
const addUsersToTeam = (
|
|
10
|
-
|
|
10
|
+
const addUsersToTeam = (
|
|
11
|
+
teamId: string,
|
|
12
|
+
users: string[],
|
|
13
|
+
authToken: string
|
|
14
|
+
): Promise<object> => {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
11
16
|
const request = client.post(
|
|
12
17
|
`api/v1/teams/users/add`,
|
|
13
18
|
{
|
|
@@ -32,9 +37,15 @@ const addUsersToTeam = (teamId, users, authToken) => {
|
|
|
32
37
|
* @param {String} managerId The id of the manager
|
|
33
38
|
* @param {String} description The description of the team
|
|
34
39
|
* @param {String} authToken The authorization token
|
|
40
|
+
* @returns {Promise<Object>}
|
|
35
41
|
*/
|
|
36
|
-
const createTeam = (
|
|
37
|
-
|
|
42
|
+
const createTeam = (
|
|
43
|
+
name: string,
|
|
44
|
+
managerId: string,
|
|
45
|
+
description: string,
|
|
46
|
+
authToken: string
|
|
47
|
+
): Promise<object> => {
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
38
49
|
const request = client.post(
|
|
39
50
|
`api/v1/teams/team`,
|
|
40
51
|
{
|
|
@@ -59,12 +70,16 @@ const createTeam = (name, managerId, description, authToken) => {
|
|
|
59
70
|
* @param {String} teamId The team to be deleted
|
|
60
71
|
* @param {String} defaultTeamId The default team all the users will be moved to
|
|
61
72
|
* @param {String} authToken The authentication token
|
|
73
|
+
* @returns {Promise<Object>}
|
|
62
74
|
*/
|
|
63
|
-
const deleteTeam = (
|
|
64
|
-
|
|
75
|
+
const deleteTeam = (
|
|
76
|
+
teamId: string,
|
|
77
|
+
defaultTeamId: string,
|
|
78
|
+
authToken: string
|
|
79
|
+
): Promise<object> => {
|
|
80
|
+
return new Promise((resolve, reject) => {
|
|
65
81
|
const request = client.delete(`api/v1/teams/delete`, {
|
|
66
82
|
headers: { authorization: authToken },
|
|
67
|
-
|
|
68
83
|
data: {
|
|
69
84
|
id: teamId,
|
|
70
85
|
defaultTeamId: defaultTeamId,
|
|
@@ -85,9 +100,14 @@ const deleteTeam = (teamId, defaultTeamId, authToken) => {
|
|
|
85
100
|
* @param {String} teamId The team Id
|
|
86
101
|
* @param {Boolean} includeUserSummaryInformation True if request to load user summary information
|
|
87
102
|
* @param {String} authToken The authentication token
|
|
103
|
+
* @returns {Promise<Object>}
|
|
88
104
|
*/
|
|
89
|
-
const getTeamById = (
|
|
90
|
-
|
|
105
|
+
const getTeamById = (
|
|
106
|
+
teamId: string,
|
|
107
|
+
includeUserSummaryInformation: boolean,
|
|
108
|
+
authToken: string
|
|
109
|
+
): Promise<object> => {
|
|
110
|
+
return new Promise((resolve, reject) => {
|
|
91
111
|
const request = client.post(
|
|
92
112
|
`api/v1/teams/team/${teamId}`,
|
|
93
113
|
{
|
|
@@ -109,9 +129,13 @@ const getTeamById = (teamId, includeUserSummaryInformation, authToken) => {
|
|
|
109
129
|
* Get team roles
|
|
110
130
|
* @param {String} teamId The team Id
|
|
111
131
|
* @param {String} authToken The authentication token
|
|
132
|
+
* @returns {Promise<Object>}
|
|
112
133
|
*/
|
|
113
|
-
const getTeamByIdRoles = (
|
|
114
|
-
|
|
134
|
+
const getTeamByIdRoles = (
|
|
135
|
+
teamId: string,
|
|
136
|
+
authToken: string
|
|
137
|
+
): Promise<object> => {
|
|
138
|
+
return new Promise((resolve, reject) => {
|
|
115
139
|
const request = client.get(`api/v1/teams/getroles/${teamId}`, {
|
|
116
140
|
headers: { authorization: authToken },
|
|
117
141
|
});
|
|
@@ -127,11 +151,11 @@ const getTeamByIdRoles = (teamId, authToken) => {
|
|
|
127
151
|
|
|
128
152
|
/**
|
|
129
153
|
* Get teams for current tenant
|
|
130
|
-
* @param {String} userId
|
|
131
154
|
* @param {String} authToken The authentication token
|
|
155
|
+
* @returns {Promise<Object>}
|
|
132
156
|
*/
|
|
133
|
-
const getTeams = (authToken) => {
|
|
134
|
-
return new Promise(
|
|
157
|
+
const getTeams = (authToken: string): Promise<object> => {
|
|
158
|
+
return new Promise((resolve, reject) => {
|
|
135
159
|
const request = client.get(`api/v1/teams/`, {
|
|
136
160
|
headers: { authorization: authToken },
|
|
137
161
|
});
|
|
@@ -150,9 +174,14 @@ const getTeams = (authToken) => {
|
|
|
150
174
|
* @param {String} userId
|
|
151
175
|
* @param {Boolean} includeUserSummaryInformation True if request to load user summary information
|
|
152
176
|
* @param {String} authToken The authentication token
|
|
177
|
+
* @returns {Promise<Object>}
|
|
153
178
|
*/
|
|
154
|
-
const getTeamByUserId = (
|
|
155
|
-
|
|
179
|
+
const getTeamByUserId = (
|
|
180
|
+
userId: string,
|
|
181
|
+
includeUserSummaryInformation: boolean,
|
|
182
|
+
authToken: string
|
|
183
|
+
): Promise<object> => {
|
|
184
|
+
return new Promise((resolve, reject) => {
|
|
156
185
|
const request = client.post(
|
|
157
186
|
`/api/v1/teams/getuserteam/${userId || ""}`,
|
|
158
187
|
{
|
|
@@ -174,9 +203,13 @@ const getTeamByUserId = (userId, includeUserSummaryInformation, authToken) => {
|
|
|
174
203
|
* Get top team in the organization, usually the executive team
|
|
175
204
|
* @param {Boolean} includeUserSummaryInformation True if request to load user summary information
|
|
176
205
|
* @param {String} authToken The authentication token
|
|
206
|
+
* @returns {Promise<Object>}
|
|
177
207
|
*/
|
|
178
|
-
const getTopTeam = (
|
|
179
|
-
|
|
208
|
+
const getTopTeam = (
|
|
209
|
+
includeUserSummaryInformation: boolean,
|
|
210
|
+
authToken: string
|
|
211
|
+
): Promise<object> => {
|
|
212
|
+
return new Promise((resolve, reject) => {
|
|
180
213
|
const request = client.post(
|
|
181
214
|
`api/v1/teams/gettopteam`,
|
|
182
215
|
{
|
|
@@ -199,9 +232,14 @@ const getTopTeam = (includeUserSummaryInformation, authToken) => {
|
|
|
199
232
|
* @param {String} teamId The team Id
|
|
200
233
|
* @param {Array<String>} users The users to be removed from the team
|
|
201
234
|
* @param {String} authToken The authentication token
|
|
235
|
+
* @returns {Promise<Object>}
|
|
202
236
|
*/
|
|
203
|
-
const removeUsersFromTeam = (
|
|
204
|
-
|
|
237
|
+
const removeUsersFromTeam = (
|
|
238
|
+
teamId: string,
|
|
239
|
+
users: string[],
|
|
240
|
+
authToken: string
|
|
241
|
+
): Promise<object> => {
|
|
242
|
+
return new Promise((resolve, reject) => {
|
|
205
243
|
const request = client.post(
|
|
206
244
|
`api/v1/teams/users/remove/`,
|
|
207
245
|
{
|
|
@@ -220,13 +258,14 @@ const removeUsersFromTeam = (teamId, users, authToken) => {
|
|
|
220
258
|
});
|
|
221
259
|
};
|
|
222
260
|
|
|
223
|
-
|
|
224
|
-
* Set team as
|
|
261
|
+
/**
|
|
262
|
+
* Set team as default
|
|
225
263
|
* @param {String} teamId The team Id
|
|
226
264
|
* @param {String} authToken The authentication token
|
|
265
|
+
* @returns {Promise<Object>}
|
|
227
266
|
*/
|
|
228
|
-
const setDefault = (teamId, authToken) => {
|
|
229
|
-
return new Promise(
|
|
267
|
+
const setDefault = (teamId: string, authToken: string): Promise<object> => {
|
|
268
|
+
return new Promise((resolve, reject) => {
|
|
230
269
|
const request = client.put(
|
|
231
270
|
`api/v1/teams/setDefault/`,
|
|
232
271
|
{
|
|
@@ -247,11 +286,16 @@ const setDefault = (teamId, authToken) => {
|
|
|
247
286
|
/**
|
|
248
287
|
* Update team
|
|
249
288
|
* @param {String} teamId The team Id
|
|
250
|
-
* @param {
|
|
289
|
+
* @param {Object} data The updated data of the team
|
|
251
290
|
* @param {String} authToken The authentication token
|
|
291
|
+
* @returns {Promise<Object>}
|
|
252
292
|
*/
|
|
253
|
-
const updateTeam = (
|
|
254
|
-
|
|
293
|
+
const updateTeam = (
|
|
294
|
+
teamId: string,
|
|
295
|
+
data: object,
|
|
296
|
+
authToken: string
|
|
297
|
+
): Promise<object> => {
|
|
298
|
+
return new Promise((resolve, reject) => {
|
|
255
299
|
const request = client.patch(
|
|
256
300
|
`api/v1/teams/team/`,
|
|
257
301
|
{
|
|
@@ -4,11 +4,15 @@ import { client } from "./axiosClient.js";
|
|
|
4
4
|
* Get tenant information
|
|
5
5
|
* @param {String} category Tenant information category
|
|
6
6
|
* @param {String} token Authorization token
|
|
7
|
+
* @returns {Promise<Object>}
|
|
7
8
|
*/
|
|
8
|
-
const getTenantInformation = (
|
|
9
|
-
|
|
9
|
+
const getTenantInformation = (
|
|
10
|
+
category: string,
|
|
11
|
+
token: string
|
|
12
|
+
): Promise<object> => {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
10
14
|
const requestData = {
|
|
11
|
-
categories:
|
|
15
|
+
categories: category,
|
|
12
16
|
};
|
|
13
17
|
let request = client.post("api/v1/tenants/tenant/get", requestData, {
|
|
14
18
|
headers: { authorization: token },
|
|
@@ -26,11 +30,16 @@ const getTenantInformation = (categories, token) => {
|
|
|
26
30
|
/**
|
|
27
31
|
* Set tenant profile information
|
|
28
32
|
* @param {String} category Tenant information category
|
|
29
|
-
* @param {
|
|
30
|
-
* @param {
|
|
33
|
+
* @param {Object} data New or updated tenant data information
|
|
34
|
+
* @param {String} token Authorization token
|
|
35
|
+
* @returns {Promise<Object>}
|
|
31
36
|
*/
|
|
32
|
-
const setTenantInformation = (
|
|
33
|
-
|
|
37
|
+
const setTenantInformation = (
|
|
38
|
+
category: string,
|
|
39
|
+
data: object,
|
|
40
|
+
token: string
|
|
41
|
+
): Promise<object> => {
|
|
42
|
+
return new Promise((resolve, reject) => {
|
|
34
43
|
const requestData = {
|
|
35
44
|
category: category,
|
|
36
45
|
data: data,
|