@stackfactor/client-api 1.1.128 → 1.1.129
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 → 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 +3 -1
- package/lib/axiosClient.js +0 -82
- package/lib/skillAssessmentTestingSession.js +0 -147
- /package/{exports.js → exports.ts} +0 -0
- /package/{index.js → index.ts} +0 -0
package/lib/{role.js → role.ts}
RENAMED
|
@@ -4,10 +4,10 @@ import { client } from "./axiosClient.js";
|
|
|
4
4
|
* Create role and set information
|
|
5
5
|
* @param {Object} data
|
|
6
6
|
* @param {String} token Authorization token
|
|
7
|
-
* @returns {Promise}
|
|
7
|
+
* @returns {Promise<Object>}
|
|
8
8
|
*/
|
|
9
|
-
const createRole = (data, token) => {
|
|
10
|
-
return new Promise(
|
|
9
|
+
const createRole = (data: object, token: string): Promise<object> => {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
11
|
let confirmationRequest = client.put(
|
|
12
12
|
"api/v1/roles",
|
|
13
13
|
{ data: data },
|
|
@@ -30,13 +30,29 @@ const createRole = (data, token) => {
|
|
|
30
30
|
* @param {String} templateId
|
|
31
31
|
* @param {Object} data
|
|
32
32
|
* @param {String} token Authorization token
|
|
33
|
-
* @returns {Promise}
|
|
33
|
+
* @returns {Promise<Object>}
|
|
34
34
|
*/
|
|
35
|
-
const createRoleFromTemplate = (
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
const createRoleFromTemplate = (
|
|
36
|
+
templateId: string,
|
|
37
|
+
data: object,
|
|
38
|
+
token: string
|
|
39
|
+
): Promise<object> => {
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
const requestData: {
|
|
42
|
+
includeDeleted: boolean;
|
|
43
|
+
includeDetailedInformation: boolean;
|
|
44
|
+
namesOnly: boolean;
|
|
45
|
+
returnDefaultIfVersionNotAvailable: boolean;
|
|
46
|
+
version: string;
|
|
47
|
+
filter?: object;
|
|
48
|
+
templateId: string;
|
|
49
|
+
} = {
|
|
38
50
|
templateId: templateId,
|
|
39
|
-
|
|
51
|
+
includeDeleted: false,
|
|
52
|
+
includeDetailedInformation: false,
|
|
53
|
+
namesOnly: false,
|
|
54
|
+
returnDefaultIfVersionNotAvailable: false,
|
|
55
|
+
version: "1.0",
|
|
40
56
|
};
|
|
41
57
|
let confirmationRequest = client.put(
|
|
42
58
|
"api/v1/roles/createfromtemplate/",
|
|
@@ -60,17 +76,20 @@ const createRoleFromTemplate = (templateId, data, token) => {
|
|
|
60
76
|
* @param {String} id The id of the role to be deleted
|
|
61
77
|
* @param {String} comments The comments included with the deletion
|
|
62
78
|
* @param {String} token Authorization token
|
|
63
|
-
* @returns {Promise}
|
|
79
|
+
* @returns {Promise<Object>}
|
|
64
80
|
*/
|
|
65
|
-
const deleteRole = (
|
|
66
|
-
|
|
67
|
-
|
|
81
|
+
const deleteRole = (
|
|
82
|
+
id: string,
|
|
83
|
+
comments: string,
|
|
84
|
+
token: string
|
|
85
|
+
): Promise<object> => {
|
|
86
|
+
return new Promise((resolve, reject) => {
|
|
87
|
+
const data: { id: string, comments?: string } = {
|
|
68
88
|
id: id,
|
|
69
89
|
};
|
|
70
90
|
if (comments) data.comments = comments;
|
|
71
91
|
const request = client.delete(`api/v1/roles/`, {
|
|
72
92
|
headers: { authorization: token },
|
|
73
|
-
|
|
74
93
|
data: data,
|
|
75
94
|
});
|
|
76
95
|
request
|
|
@@ -87,14 +106,13 @@ const deleteRole = (id, comments, token) => {
|
|
|
87
106
|
* Discard the role draft changes
|
|
88
107
|
* @param {String} id The id of the role to be deleted
|
|
89
108
|
* @param {String} token Authorization token
|
|
90
|
-
* @returns {Promise}
|
|
109
|
+
* @returns {Promise<Object>}
|
|
91
110
|
*/
|
|
92
|
-
const discardRoleChanges = (id, token) => {
|
|
93
|
-
return new Promise(
|
|
111
|
+
const discardRoleChanges = (id: string, token: string): Promise<object> => {
|
|
112
|
+
return new Promise((resolve, reject) => {
|
|
94
113
|
const data = {};
|
|
95
114
|
const request = client.get(`api/v1/roles/discard/${id}`, {
|
|
96
115
|
headers: { authorization: token },
|
|
97
|
-
|
|
98
116
|
data: data,
|
|
99
117
|
});
|
|
100
118
|
request
|
|
@@ -110,15 +128,14 @@ const discardRoleChanges = (id, token) => {
|
|
|
110
128
|
/**
|
|
111
129
|
* Get the list of imported role templates
|
|
112
130
|
* @param {String} token
|
|
113
|
-
* @returns {Promise}
|
|
131
|
+
* @returns {Promise<Object>}
|
|
114
132
|
*/
|
|
115
|
-
const getImportedRoleTemplates = (token) => {
|
|
116
|
-
return new Promise(
|
|
133
|
+
const getImportedRoleTemplates = (token: string): Promise<object> => {
|
|
134
|
+
return new Promise((resolve, reject) => {
|
|
117
135
|
const request = client.get(`api/v1/roles/getimportedroletemplates`, {
|
|
118
136
|
headers: { authorization: token },
|
|
119
137
|
});
|
|
120
138
|
request
|
|
121
|
-
|
|
122
139
|
.then((response) => {
|
|
123
140
|
resolve(response.data);
|
|
124
141
|
})
|
|
@@ -134,15 +151,15 @@ const getImportedRoleTemplates = (token) => {
|
|
|
134
151
|
* @param {String} version The version to be retrieved
|
|
135
152
|
* @param {Boolean} returnNullIfVersionNotFound Return null if the version is not found
|
|
136
153
|
* @param {String} token Authorization token
|
|
137
|
-
* @returns {Promise}
|
|
154
|
+
* @returns {Promise<Object>}
|
|
138
155
|
*/
|
|
139
156
|
const getRoleInformationById = (
|
|
140
|
-
id,
|
|
141
|
-
version,
|
|
142
|
-
returnNullIfVersionNotFound,
|
|
143
|
-
token
|
|
144
|
-
) => {
|
|
145
|
-
return new Promise(
|
|
157
|
+
id: number,
|
|
158
|
+
version: string,
|
|
159
|
+
returnNullIfVersionNotFound: boolean,
|
|
160
|
+
token: string
|
|
161
|
+
): Promise<object> => {
|
|
162
|
+
return new Promise((resolve, reject) => {
|
|
146
163
|
let confirmationRequest = client.get(
|
|
147
164
|
`api/v1/roles/role/${id}/${version}/${returnNullIfVersionNotFound}`,
|
|
148
165
|
{
|
|
@@ -168,19 +185,26 @@ const getRoleInformationById = (
|
|
|
168
185
|
* @param {Boolean} returnDefaultIfVersionNotAvailable Return the default version if published not available
|
|
169
186
|
* @param {Boolean} namesOnly Return only the names of the roles
|
|
170
187
|
* @param {String} token Authorization token
|
|
171
|
-
* @returns {Promise}
|
|
188
|
+
* @returns {Promise<Object>}
|
|
172
189
|
*/
|
|
173
190
|
const getRolesList = (
|
|
174
|
-
filter,
|
|
175
|
-
version,
|
|
176
|
-
includeDeleted,
|
|
177
|
-
includeDetailedInformation,
|
|
178
|
-
returnDefaultIfVersionNotAvailable,
|
|
179
|
-
namesOnly,
|
|
180
|
-
token
|
|
181
|
-
) => {
|
|
182
|
-
return new Promise(
|
|
183
|
-
const requestData
|
|
191
|
+
filter: object,
|
|
192
|
+
version: string,
|
|
193
|
+
includeDeleted: boolean,
|
|
194
|
+
includeDetailedInformation: boolean,
|
|
195
|
+
returnDefaultIfVersionNotAvailable: boolean,
|
|
196
|
+
namesOnly: boolean,
|
|
197
|
+
token: string
|
|
198
|
+
): Promise<object> => {
|
|
199
|
+
return new Promise((resolve, reject) => {
|
|
200
|
+
const requestData: {
|
|
201
|
+
includeDeleted: boolean;
|
|
202
|
+
includeDetailedInformation: boolean;
|
|
203
|
+
namesOnly: boolean;
|
|
204
|
+
returnDefaultIfVersionNotAvailable: boolean;
|
|
205
|
+
version: string;
|
|
206
|
+
filter?: object;
|
|
207
|
+
} = {
|
|
184
208
|
includeDeleted: includeDeleted,
|
|
185
209
|
includeDetailedInformation: includeDetailedInformation,
|
|
186
210
|
namesOnly: namesOnly,
|
|
@@ -205,10 +229,10 @@ const getRolesList = (
|
|
|
205
229
|
* Get role template updates
|
|
206
230
|
* @param {String} id The role id
|
|
207
231
|
* @param {String} token
|
|
208
|
-
* @returns {Promise}
|
|
232
|
+
* @returns {Promise<Object>}
|
|
209
233
|
*/
|
|
210
|
-
const getRoleTemplateUpdates = (id, token) => {
|
|
211
|
-
return new Promise(
|
|
234
|
+
const getRoleTemplateUpdates = (id: string, token: string): Promise<object> => {
|
|
235
|
+
return new Promise((resolve, reject) => {
|
|
212
236
|
let confirmationRequest = client.get(
|
|
213
237
|
`api/v1/roles/getroletemplateupdates/${id}`,
|
|
214
238
|
{
|
|
@@ -227,14 +251,18 @@ const getRoleTemplateUpdates = (id, token) => {
|
|
|
227
251
|
|
|
228
252
|
/**
|
|
229
253
|
* Import role templates
|
|
230
|
-
* @param {Array<
|
|
254
|
+
* @param {Array<Object>} data The list of role templates to be imported
|
|
231
255
|
* @param {String} token
|
|
232
|
-
* @returns {Promise}
|
|
256
|
+
* @returns {Promise<Object>}
|
|
233
257
|
*/
|
|
234
|
-
const importRoleTemplates = (
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
258
|
+
const importRoleTemplates = (
|
|
259
|
+
data: object[],
|
|
260
|
+
token: string
|
|
261
|
+
): Promise<object> => {
|
|
262
|
+
return new Promise((resolve, reject) => {
|
|
263
|
+
const requestData: { roles: object[]; jobDescription: string; userid?: string } = {
|
|
264
|
+
roles: data,
|
|
265
|
+
jobDescription: "default job description", // Add a default job description or pass it as a parameter
|
|
238
266
|
};
|
|
239
267
|
let confirmationRequest = client.post(
|
|
240
268
|
`api/v1/roles/importRoleTemplates`,
|
|
@@ -244,7 +272,6 @@ const importRoleTemplates = (data, token) => {
|
|
|
244
272
|
}
|
|
245
273
|
);
|
|
246
274
|
confirmationRequest
|
|
247
|
-
|
|
248
275
|
.then((response) => {
|
|
249
276
|
resolve(response.data);
|
|
250
277
|
})
|
|
@@ -259,11 +286,15 @@ const importRoleTemplates = (data, token) => {
|
|
|
259
286
|
* @param {number} id The id of the role to be published
|
|
260
287
|
* @param {String} comments The comments to be include with the request
|
|
261
288
|
* @param {String} token Authorization token
|
|
262
|
-
* @returns {Promise}
|
|
289
|
+
* @returns {Promise<Object>}
|
|
263
290
|
*/
|
|
264
|
-
const publishRole = (
|
|
265
|
-
|
|
266
|
-
|
|
291
|
+
const publishRole = (
|
|
292
|
+
id: number,
|
|
293
|
+
comments: string,
|
|
294
|
+
token: string
|
|
295
|
+
): Promise<object> => {
|
|
296
|
+
return new Promise((resolve, reject) => {
|
|
297
|
+
let data: { comments?: string } = {};
|
|
267
298
|
if (comments) data.comments = comments;
|
|
268
299
|
let confirmationRequest = client.post(`api/v1/roles/publish/${id}`, data, {
|
|
269
300
|
headers: { authorization: token },
|
|
@@ -283,10 +314,14 @@ const publishRole = (id, comments, token) => {
|
|
|
283
314
|
* @param {String} id The id of the role to be updated
|
|
284
315
|
* @param {Object} data Data used to update the role
|
|
285
316
|
* @param {String} token Authorization token
|
|
286
|
-
* @returns {Promise}
|
|
317
|
+
* @returns {Promise<Object>}
|
|
287
318
|
*/
|
|
288
|
-
const setRoleInformation = (
|
|
289
|
-
|
|
319
|
+
const setRoleInformation = (
|
|
320
|
+
id: string,
|
|
321
|
+
data: object,
|
|
322
|
+
token: string
|
|
323
|
+
): Promise<object> => {
|
|
324
|
+
return new Promise((resolve, reject) => {
|
|
290
325
|
const requestData = {
|
|
291
326
|
data: data,
|
|
292
327
|
id: id,
|
|
@@ -309,10 +344,14 @@ const setRoleInformation = (id, data, token) => {
|
|
|
309
344
|
* @param {String} id The id of the role to be updated
|
|
310
345
|
* @param {Object} data Data used to update the role
|
|
311
346
|
* @param {String} token Authorization token
|
|
312
|
-
* @returns {Promise}
|
|
347
|
+
* @returns {Promise<Object>}
|
|
313
348
|
*/
|
|
314
|
-
const setRoleInformationFromTemplate = (
|
|
315
|
-
|
|
349
|
+
const setRoleInformationFromTemplate = (
|
|
350
|
+
id: string,
|
|
351
|
+
data: object,
|
|
352
|
+
token: string
|
|
353
|
+
): Promise<object> => {
|
|
354
|
+
return new Promise((resolve, reject) => {
|
|
316
355
|
const requestData = {
|
|
317
356
|
data: data,
|
|
318
357
|
id: id,
|
|
@@ -340,11 +379,16 @@ const setRoleInformationFromTemplate = (id, data, token) => {
|
|
|
340
379
|
* @param {Array<Object>} roles The list of roles to be assigned to the user
|
|
341
380
|
* @param {String} jobDescription The job description to be assigned to the user
|
|
342
381
|
* @param {String} token Authorization token
|
|
343
|
-
* @returns {Promise}
|
|
382
|
+
* @returns {Promise<Object>}
|
|
344
383
|
*/
|
|
345
|
-
const setUserRoles = (
|
|
346
|
-
|
|
347
|
-
|
|
384
|
+
const setUserRoles = (
|
|
385
|
+
id: string,
|
|
386
|
+
roles: object[],
|
|
387
|
+
jobDescription: string,
|
|
388
|
+
token: string
|
|
389
|
+
): Promise<object> => {
|
|
390
|
+
return new Promise((resolve, reject) => {
|
|
391
|
+
const requestData: { roles: object[]; jobDescription: string; userid?: string } = {
|
|
348
392
|
roles: roles,
|
|
349
393
|
jobDescription: jobDescription,
|
|
350
394
|
};
|
|
@@ -367,10 +411,14 @@ const setUserRoles = (id, roles, jobDescription, token) => {
|
|
|
367
411
|
* @param {String} id The id of the role to be updated
|
|
368
412
|
* @param {Boolean} watch Set to true or false
|
|
369
413
|
* @param {String} token Authorization token
|
|
370
|
-
* @returns {Promise}
|
|
414
|
+
* @returns {Promise<Object>}
|
|
371
415
|
*/
|
|
372
|
-
const watchRole = (
|
|
373
|
-
|
|
416
|
+
const watchRole = (
|
|
417
|
+
id: string,
|
|
418
|
+
watch: boolean,
|
|
419
|
+
token: string
|
|
420
|
+
): Promise<object> => {
|
|
421
|
+
return new Promise((resolve, reject) => {
|
|
374
422
|
const requestData = {
|
|
375
423
|
id: id,
|
|
376
424
|
watch: watch,
|
|
@@ -4,9 +4,10 @@ import { client } from "./axiosClient.js";
|
|
|
4
4
|
* Create role template and set information
|
|
5
5
|
* @param {Object} data
|
|
6
6
|
* @param {String} token Authorization token
|
|
7
|
+
* @returns {Promise<Object>}
|
|
7
8
|
*/
|
|
8
|
-
const createRoleTemplate = (data, token) => {
|
|
9
|
-
return new Promise(
|
|
9
|
+
const createRoleTemplate = (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 createRoleTemplate = (data, token) => {
|
|
|
28
29
|
* @param {String} 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 deleteRoleTemplate = (
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
const deleteRoleTemplate = (
|
|
35
|
+
id: string,
|
|
36
|
+
comments: string,
|
|
37
|
+
token: string
|
|
38
|
+
): Promise<object> => {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
const data: { id: string, comments?: string } = {
|
|
35
41
|
id: id,
|
|
36
42
|
};
|
|
37
43
|
if (comments) data.comments = comments;
|
|
38
44
|
const request = client.delete(`api/v1/roletemplates/`, {
|
|
39
45
|
headers: { authorization: token },
|
|
40
|
-
|
|
41
46
|
data: data,
|
|
42
47
|
});
|
|
43
48
|
request
|
|
@@ -54,13 +59,16 @@ const deleteRoleTemplate = (id, comments, token) => {
|
|
|
54
59
|
* Discard the role template draft changes
|
|
55
60
|
* @param {String} id The id of the role template to be deleted
|
|
56
61
|
* @param {String} token Authorization token
|
|
62
|
+
* @returns {Promise<Object>}
|
|
57
63
|
*/
|
|
58
|
-
const discardRoleTemplateChanges = (
|
|
59
|
-
|
|
64
|
+
const discardRoleTemplateChanges = (
|
|
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/roletemplates/discard/${id}`, {
|
|
62
71
|
headers: { authorization: token },
|
|
63
|
-
|
|
64
72
|
data: data,
|
|
65
73
|
});
|
|
66
74
|
request
|
|
@@ -76,10 +84,16 @@ const discardRoleTemplateChanges = (id, token) => {
|
|
|
76
84
|
/**
|
|
77
85
|
* Get role template information
|
|
78
86
|
* @param {String} id The id of the template
|
|
87
|
+
* @param {String} version The version of the template
|
|
79
88
|
* @param {String} token Authorization token
|
|
89
|
+
* @returns {Promise<Object>}
|
|
80
90
|
*/
|
|
81
|
-
const getRoleTemplateInformationById = (
|
|
82
|
-
|
|
91
|
+
const getRoleTemplateInformationById = (
|
|
92
|
+
id: string,
|
|
93
|
+
version: string,
|
|
94
|
+
token: string
|
|
95
|
+
): Promise<object> => {
|
|
96
|
+
return new Promise((resolve, reject) => {
|
|
83
97
|
let confirmationRequest = client.get(
|
|
84
98
|
`api/v1/roletemplates/${id}/${version}`,
|
|
85
99
|
{
|
|
@@ -103,16 +117,17 @@ const getRoleTemplateInformationById = (id, version, token) => {
|
|
|
103
117
|
* @param {Boolean} includeDeleted When true it will return the deleted records as well
|
|
104
118
|
* @param {Boolean} namesOnly When true it will return only the names of the templates
|
|
105
119
|
* @param {String} token Authorization token
|
|
120
|
+
* @returns {Promise<Object>}
|
|
106
121
|
*/
|
|
107
122
|
const getRoleTemplateList = (
|
|
108
|
-
filter,
|
|
109
|
-
version,
|
|
110
|
-
includeDeleted,
|
|
111
|
-
namesOnly,
|
|
112
|
-
token
|
|
113
|
-
) => {
|
|
114
|
-
return new Promise(
|
|
115
|
-
const requestData = {
|
|
123
|
+
filter: string[],
|
|
124
|
+
version: string,
|
|
125
|
+
includeDeleted: boolean,
|
|
126
|
+
namesOnly: boolean,
|
|
127
|
+
token: string
|
|
128
|
+
): Promise<object> => {
|
|
129
|
+
return new Promise((resolve, reject) => {
|
|
130
|
+
const requestData: { includeDeleted: boolean; namesOnly: boolean; version: string; filter?: string[] } = {
|
|
116
131
|
includeDeleted: includeDeleted,
|
|
117
132
|
namesOnly: namesOnly,
|
|
118
133
|
version: version,
|
|
@@ -136,10 +151,15 @@ const getRoleTemplateList = (
|
|
|
136
151
|
* @param {number} id The id of the template to be published
|
|
137
152
|
* @param {String} comments The comments to be include with the request
|
|
138
153
|
* @param {String} token Authorization token
|
|
154
|
+
* @returns {Promise<Object>}
|
|
139
155
|
*/
|
|
140
|
-
const publishTemplate = (
|
|
141
|
-
|
|
142
|
-
|
|
156
|
+
const publishTemplate = (
|
|
157
|
+
id: number,
|
|
158
|
+
comments: string,
|
|
159
|
+
token: string
|
|
160
|
+
): Promise<object> => {
|
|
161
|
+
return new Promise((resolve, reject) => {
|
|
162
|
+
let data: { comments?: string } = {};
|
|
143
163
|
if (comments) data.comments = comments;
|
|
144
164
|
let confirmationRequest = client.post(
|
|
145
165
|
`api/v1/roletemplates/publish/${id}`,
|
|
@@ -163,9 +183,14 @@ const publishTemplate = (id, comments, token) => {
|
|
|
163
183
|
* @param {String} id The id of the template to be updated
|
|
164
184
|
* @param {Object} data Data used to update the template
|
|
165
185
|
* @param {String} token Authorization token
|
|
186
|
+
* @returns {Promise<Object>}
|
|
166
187
|
*/
|
|
167
|
-
const setTemplateInformation = (
|
|
168
|
-
|
|
188
|
+
const setTemplateInformation = (
|
|
189
|
+
id: string,
|
|
190
|
+
data: object,
|
|
191
|
+
token: string
|
|
192
|
+
): Promise<object> => {
|
|
193
|
+
return new Promise((resolve, reject) => {
|
|
169
194
|
const requestData = {
|
|
170
195
|
data: data,
|
|
171
196
|
id: id,
|
|
@@ -192,9 +217,14 @@ const setTemplateInformation = (id, data, token) => {
|
|
|
192
217
|
* @param {String} id The id of the template to be updated
|
|
193
218
|
* @param {Object} tags Updated template tags
|
|
194
219
|
* @param {String} token Authorization token
|
|
220
|
+
* @returns {Promise<Object>}
|
|
195
221
|
*/
|
|
196
|
-
const setTemplateTags = (
|
|
197
|
-
|
|
222
|
+
const setTemplateTags = (
|
|
223
|
+
id: string,
|
|
224
|
+
tags: object,
|
|
225
|
+
token: string
|
|
226
|
+
): Promise<object> => {
|
|
227
|
+
return new Promise((resolve, reject) => {
|
|
198
228
|
const requestData = {
|
|
199
229
|
tags: tags,
|
|
200
230
|
id: id,
|
|
@@ -221,9 +251,14 @@ const setTemplateTags = (id, tags, token) => {
|
|
|
221
251
|
* @param {String} id The id of the skill to be updated
|
|
222
252
|
* @param {Boolean} watch Set to true or false
|
|
223
253
|
* @param {String} token Authorization token
|
|
254
|
+
* @returns {Promise<Object>}
|
|
224
255
|
*/
|
|
225
|
-
const watchRoleTemplate = (
|
|
226
|
-
|
|
256
|
+
const watchRoleTemplate = (
|
|
257
|
+
id: string,
|
|
258
|
+
watch: boolean,
|
|
259
|
+
token: string
|
|
260
|
+
): Promise<object> => {
|
|
261
|
+
return new Promise((resolve, reject) => {
|
|
227
262
|
const requestData = {
|
|
228
263
|
id: id,
|
|
229
264
|
watch: watch,
|
|
@@ -5,8 +5,8 @@ import { client } from "./axiosClient.js";
|
|
|
5
5
|
* @param {String} authToken - Authorization token
|
|
6
6
|
* @returns {Promise<Object>}
|
|
7
7
|
*/
|
|
8
|
-
const getAuthConnections = (authToken) => {
|
|
9
|
-
return new Promise(
|
|
8
|
+
const getAuthConnections = (authToken: string): Promise<object> => {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
10
|
const getConfigInformationRequest = client.get(
|
|
11
11
|
`api/v1/security/authconnections`,
|
|
12
12
|
{ headers: { authorization: authToken } }
|
|
@@ -25,9 +25,13 @@ const getAuthConnections = (authToken) => {
|
|
|
25
25
|
* Set the enabled authentication connections for current organization.
|
|
26
26
|
* @param {Object} data - the object containing the updated configuration
|
|
27
27
|
* @param {String} authToken - Authorization token
|
|
28
|
+
* @returns {Promise<Object>}
|
|
28
29
|
*/
|
|
29
|
-
const setAuthConnections = (
|
|
30
|
-
|
|
30
|
+
const setAuthConnections = (
|
|
31
|
+
data: object,
|
|
32
|
+
authToken: string
|
|
33
|
+
): Promise<object> => {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
31
35
|
const setConfigInformationRequest = client.post(
|
|
32
36
|
`api/v1/security/authconnections`,
|
|
33
37
|
{ data: data },
|
|
@@ -49,8 +53,8 @@ const setAuthConnections = (data, authToken) => {
|
|
|
49
53
|
* @param {String} authToken
|
|
50
54
|
* @returns {Promise<Object>}
|
|
51
55
|
*/
|
|
52
|
-
const resetMFA = (userId, authToken) => {
|
|
53
|
-
return new Promise(
|
|
56
|
+
const resetMFA = (userId: string, authToken: string): Promise<object> => {
|
|
57
|
+
return new Promise((resolve, reject) => {
|
|
54
58
|
const resetMFARequest = client.post(
|
|
55
59
|
`api/v1/security/resetmfa`,
|
|
56
60
|
userId ? {} : { userId: userId },
|
|
@@ -71,13 +75,13 @@ const resetMFA = (userId, authToken) => {
|
|
|
71
75
|
* @param {String} authToken
|
|
72
76
|
* @returns {Promise<Object>}
|
|
73
77
|
*/
|
|
74
|
-
const synchronizeWithAuth0 = (authToken) => {
|
|
75
|
-
return new Promise(
|
|
76
|
-
const
|
|
78
|
+
const synchronizeWithAuth0 = (authToken: string): Promise<object> => {
|
|
79
|
+
return new Promise((resolve, reject) => {
|
|
80
|
+
const synchronizeRequest = client.get(
|
|
77
81
|
`api/v1/security/synchronizewithauth0`,
|
|
78
82
|
{ headers: { authorization: authToken } }
|
|
79
83
|
);
|
|
80
|
-
|
|
84
|
+
synchronizeRequest
|
|
81
85
|
.then((response) => {
|
|
82
86
|
resolve(response.data);
|
|
83
87
|
})
|