@stackfactor/client-api 1.1.140 → 1.1.141
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/dist/cjs/actionNotifications.d.ts +24 -0
- package/dist/cjs/actionNotifications.d.ts.map +1 -0
- package/dist/cjs/actionNotifications.js +73 -0
- package/dist/cjs/actionNotifications.js.map +1 -0
- package/dist/cjs/address.d.ts +8 -0
- package/dist/cjs/address.d.ts.map +1 -0
- package/dist/cjs/address.js +24 -0
- package/dist/cjs/address.js.map +1 -0
- package/dist/cjs/aiAssistant.d.ts +42 -0
- package/dist/cjs/aiAssistant.d.ts.map +1 -0
- package/dist/cjs/aiAssistant.js +135 -0
- package/dist/cjs/aiAssistant.js.map +1 -0
- package/dist/cjs/avatar.d.ts +11 -0
- package/dist/cjs/avatar.d.ts.map +1 -0
- package/dist/cjs/avatar.js +32 -0
- package/dist/cjs/avatar.js.map +1 -0
- package/dist/cjs/axiosClient.d.ts +31 -0
- package/dist/cjs/axiosClient.d.ts.map +1 -0
- package/dist/cjs/axiosClient.js +123 -0
- package/dist/cjs/axiosClient.js.map +1 -0
- package/dist/cjs/config.d.ts +23 -0
- package/dist/cjs/config.d.ts.map +1 -0
- package/dist/cjs/config.js +63 -0
- package/dist/cjs/config.js.map +1 -0
- package/dist/cjs/constants.d.ts +69 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +91 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/dashboard.d.ts +23 -0
- package/dist/cjs/dashboard.d.ts.map +1 -0
- package/dist/cjs/dashboard.js +74 -0
- package/dist/cjs/dashboard.js.map +1 -0
- package/dist/cjs/departmentTrainingPlans.d.ts +53 -0
- package/dist/cjs/departmentTrainingPlans.d.ts.map +1 -0
- package/dist/cjs/departmentTrainingPlans.js +153 -0
- package/dist/cjs/departmentTrainingPlans.js.map +1 -0
- package/dist/cjs/groups.d.ts +90 -0
- package/dist/cjs/groups.d.ts.map +1 -0
- package/dist/cjs/groups.js +273 -0
- package/dist/cjs/groups.js.map +1 -0
- package/dist/cjs/index.d.ts +33 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +78 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/integration.d.ts +82 -0
- package/dist/cjs/integration.d.ts.map +1 -0
- package/dist/cjs/integration.js +316 -0
- package/dist/cjs/integration.js.map +1 -0
- package/dist/cjs/integrationConfiguration.d.ts +27 -0
- package/dist/cjs/integrationConfiguration.d.ts.map +1 -0
- package/dist/cjs/integrationConfiguration.js +86 -0
- package/dist/cjs/integrationConfiguration.js.map +1 -0
- package/dist/cjs/integrations/contentGenerator.d.ts +22 -0
- package/dist/cjs/integrations/contentGenerator.d.ts.map +1 -0
- package/dist/cjs/integrations/contentGenerator.js +69 -0
- package/dist/cjs/integrations/contentGenerator.js.map +1 -0
- package/dist/cjs/learningContent.d.ts +122 -0
- package/dist/cjs/learningContent.d.ts.map +1 -0
- package/dist/cjs/learningContent.js +394 -0
- package/dist/cjs/learningContent.js.map +1 -0
- package/dist/cjs/learningPath.d.ts +64 -0
- package/dist/cjs/learningPath.d.ts.map +1 -0
- package/dist/cjs/learningPath.js +205 -0
- package/dist/cjs/learningPath.js.map +1 -0
- package/dist/cjs/logger.d.ts +19 -0
- package/dist/cjs/logger.d.ts.map +1 -0
- package/dist/cjs/logger.js +60 -0
- package/dist/cjs/logger.js.map +1 -0
- package/dist/cjs/microSkillsQuizes.d.ts +18 -0
- package/dist/cjs/microSkillsQuizes.d.ts.map +1 -0
- package/dist/cjs/microSkillsQuizes.js +53 -0
- package/dist/cjs/microSkillsQuizes.js.map +1 -0
- package/dist/cjs/quotas.d.ts +15 -0
- package/dist/cjs/quotas.d.ts.map +1 -0
- package/dist/cjs/quotas.js +50 -0
- package/dist/cjs/quotas.js.map +1 -0
- package/dist/cjs/role.d.ts +113 -0
- package/dist/cjs/role.d.ts.map +1 -0
- package/dist/cjs/role.js +363 -0
- package/dist/cjs/role.js.map +1 -0
- package/dist/cjs/roleTemplate.d.ts +73 -0
- package/dist/cjs/roleTemplate.d.ts.map +1 -0
- package/dist/cjs/roleTemplate.js +236 -0
- package/dist/cjs/roleTemplate.js.map +1 -0
- package/dist/cjs/security.d.ts +27 -0
- package/dist/cjs/security.d.ts.map +1 -0
- package/dist/cjs/security.js +79 -0
- package/dist/cjs/security.js.map +1 -0
- package/dist/cjs/skill.d.ts +141 -0
- package/dist/cjs/skill.d.ts.map +1 -0
- package/dist/cjs/skill.js +440 -0
- package/dist/cjs/skill.js.map +1 -0
- package/dist/cjs/skillAssessmentTestingSession.d.ts +49 -0
- package/dist/cjs/skillAssessmentTestingSession.d.ts.map +1 -0
- package/dist/cjs/skillAssessmentTestingSession.js +156 -0
- package/dist/cjs/skillAssessmentTestingSession.js.map +1 -0
- package/dist/cjs/skillAssessments.d.ts +49 -0
- package/dist/cjs/skillAssessments.d.ts.map +1 -0
- package/dist/cjs/skillAssessments.js +156 -0
- package/dist/cjs/skillAssessments.js.map +1 -0
- package/dist/cjs/skillTemplate.d.ts +87 -0
- package/dist/cjs/skillTemplate.d.ts.map +1 -0
- package/dist/cjs/skillTemplate.js +281 -0
- package/dist/cjs/skillTemplate.js.map +1 -0
- package/dist/cjs/talentTransfromation.d.ts +29 -0
- package/dist/cjs/talentTransfromation.d.ts.map +1 -0
- package/dist/cjs/talentTransfromation.js +100 -0
- package/dist/cjs/talentTransfromation.js.map +1 -0
- package/dist/cjs/teams.d.ts +85 -0
- package/dist/cjs/teams.d.ts.map +1 -0
- package/dist/cjs/teams.js +252 -0
- package/dist/cjs/teams.js.map +1 -0
- package/dist/cjs/tenants.d.ts +16 -0
- package/dist/cjs/tenants.d.ts.map +1 -0
- package/dist/cjs/tenants.js +55 -0
- package/dist/cjs/tenants.js.map +1 -0
- package/dist/cjs/trainingPlans.d.ts +92 -0
- package/dist/cjs/trainingPlans.d.ts.map +1 -0
- package/dist/cjs/trainingPlans.js +309 -0
- package/dist/cjs/trainingPlans.js.map +1 -0
- package/dist/cjs/trainingPlansProficiencyLevels.d.ts +32 -0
- package/dist/cjs/trainingPlansProficiencyLevels.d.ts.map +1 -0
- package/dist/cjs/trainingPlansProficiencyLevels.js +97 -0
- package/dist/cjs/trainingPlansProficiencyLevels.js.map +1 -0
- package/dist/cjs/userInformation.d.ts +29 -0
- package/dist/cjs/userInformation.d.ts.map +1 -0
- package/dist/cjs/userInformation.js +81 -0
- package/dist/cjs/userInformation.js.map +1 -0
- package/dist/cjs/users.d.ts +206 -0
- package/dist/cjs/users.d.ts.map +1 -0
- package/dist/cjs/users.js +694 -0
- package/dist/cjs/users.js.map +1 -0
- package/dist/cjs/utils.d.ts +14 -0
- package/dist/cjs/utils.d.ts.map +1 -0
- package/dist/cjs/utils.js +58 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/esm/actionNotifications.d.ts +24 -0
- package/dist/esm/actionNotifications.d.ts.map +1 -0
- package/dist/esm/actionNotifications.js +67 -0
- package/dist/esm/actionNotifications.js.map +1 -0
- package/dist/esm/address.d.ts +8 -0
- package/dist/esm/address.d.ts.map +1 -0
- package/dist/esm/address.js +20 -0
- package/dist/esm/address.js.map +1 -0
- package/dist/esm/aiAssistant.d.ts +42 -0
- package/dist/esm/aiAssistant.d.ts.map +1 -0
- package/dist/esm/aiAssistant.js +126 -0
- package/dist/esm/aiAssistant.js.map +1 -0
- package/dist/esm/avatar.d.ts +11 -0
- package/dist/esm/avatar.d.ts.map +1 -0
- package/dist/esm/avatar.js +28 -0
- package/dist/esm/avatar.js.map +1 -0
- package/dist/esm/axiosClient.d.ts +31 -0
- package/dist/esm/axiosClient.d.ts.map +1 -0
- package/dist/esm/axiosClient.js +78 -0
- package/dist/esm/axiosClient.js.map +1 -0
- package/dist/esm/config.d.ts +23 -0
- package/dist/esm/config.d.ts.map +1 -0
- package/dist/esm/config.js +57 -0
- package/dist/esm/config.js.map +1 -0
- package/dist/esm/constants.d.ts +69 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +88 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/dashboard.d.ts +23 -0
- package/dist/esm/dashboard.d.ts.map +1 -0
- package/dist/esm/dashboard.js +68 -0
- package/dist/esm/dashboard.js.map +1 -0
- package/dist/esm/departmentTrainingPlans.d.ts +53 -0
- package/dist/esm/departmentTrainingPlans.d.ts.map +1 -0
- package/dist/esm/departmentTrainingPlans.js +144 -0
- package/dist/esm/departmentTrainingPlans.js.map +1 -0
- package/dist/esm/groups.d.ts +90 -0
- package/dist/esm/groups.d.ts.map +1 -0
- package/dist/esm/groups.js +258 -0
- package/dist/esm/groups.js.map +1 -0
- package/dist/esm/index.d.ts +33 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/{src/lib/index.ts → dist/esm/index.js} +3 -13
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/integration.d.ts +82 -0
- package/dist/esm/integration.d.ts.map +1 -0
- package/dist/esm/integration.js +299 -0
- package/dist/esm/integration.js.map +1 -0
- package/dist/esm/integrationConfiguration.d.ts +27 -0
- package/dist/esm/integrationConfiguration.d.ts.map +1 -0
- package/dist/esm/integrationConfiguration.js +80 -0
- package/dist/esm/integrationConfiguration.js.map +1 -0
- package/dist/esm/integrations/contentGenerator.d.ts +22 -0
- package/dist/esm/integrations/contentGenerator.d.ts.map +1 -0
- package/dist/esm/integrations/contentGenerator.js +64 -0
- package/dist/esm/integrations/contentGenerator.js.map +1 -0
- package/dist/esm/learningContent.d.ts +122 -0
- package/dist/esm/learningContent.d.ts.map +1 -0
- package/dist/esm/learningContent.js +376 -0
- package/dist/esm/learningContent.js.map +1 -0
- package/dist/esm/learningPath.d.ts +64 -0
- package/dist/esm/learningPath.d.ts.map +1 -0
- package/dist/esm/learningPath.js +194 -0
- package/dist/esm/learningPath.js.map +1 -0
- package/dist/esm/logger.d.ts +19 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +55 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/microSkillsQuizes.d.ts +18 -0
- package/dist/esm/microSkillsQuizes.d.ts.map +1 -0
- package/dist/esm/microSkillsQuizes.js +48 -0
- package/dist/esm/microSkillsQuizes.js.map +1 -0
- package/dist/esm/quotas.d.ts +15 -0
- package/dist/esm/quotas.d.ts.map +1 -0
- package/dist/esm/quotas.js +45 -0
- package/dist/esm/quotas.js.map +1 -0
- package/dist/esm/role.d.ts +113 -0
- package/dist/esm/role.d.ts.map +1 -0
- package/dist/esm/role.js +346 -0
- package/dist/esm/role.js.map +1 -0
- package/dist/esm/roleTemplate.d.ts +73 -0
- package/dist/esm/roleTemplate.d.ts.map +1 -0
- package/dist/esm/roleTemplate.js +224 -0
- package/dist/esm/roleTemplate.js.map +1 -0
- package/dist/esm/security.d.ts +27 -0
- package/dist/esm/security.d.ts.map +1 -0
- package/dist/esm/security.js +72 -0
- package/dist/esm/security.js.map +1 -0
- package/dist/esm/skill.d.ts +141 -0
- package/dist/esm/skill.d.ts.map +1 -0
- package/dist/esm/skill.js +418 -0
- package/dist/esm/skill.js.map +1 -0
- package/dist/esm/skillAssessmentTestingSession.d.ts +49 -0
- package/dist/esm/skillAssessmentTestingSession.d.ts.map +1 -0
- package/dist/esm/skillAssessmentTestingSession.js +147 -0
- package/dist/esm/skillAssessmentTestingSession.js.map +1 -0
- package/dist/esm/skillAssessments.d.ts +49 -0
- package/dist/esm/skillAssessments.d.ts.map +1 -0
- package/dist/esm/skillAssessments.js +147 -0
- package/dist/esm/skillAssessments.js.map +1 -0
- package/dist/esm/skillTemplate.d.ts +87 -0
- package/dist/esm/skillTemplate.d.ts.map +1 -0
- package/dist/esm/skillTemplate.js +267 -0
- package/dist/esm/skillTemplate.js.map +1 -0
- package/dist/esm/talentTransfromation.d.ts +29 -0
- package/dist/esm/talentTransfromation.d.ts.map +1 -0
- package/dist/esm/talentTransfromation.js +93 -0
- package/dist/esm/talentTransfromation.js.map +1 -0
- package/dist/esm/teams.d.ts +85 -0
- package/dist/esm/teams.d.ts.map +1 -0
- package/dist/esm/teams.js +238 -0
- package/dist/esm/teams.js.map +1 -0
- package/dist/esm/tenants.d.ts +16 -0
- package/dist/esm/tenants.d.ts.map +1 -0
- package/dist/esm/tenants.js +50 -0
- package/dist/esm/tenants.js.map +1 -0
- package/dist/esm/trainingPlans.d.ts +92 -0
- package/dist/esm/trainingPlans.d.ts.map +1 -0
- package/dist/esm/trainingPlans.js +293 -0
- package/dist/esm/trainingPlans.js.map +1 -0
- package/dist/esm/trainingPlansProficiencyLevels.d.ts +32 -0
- package/dist/esm/trainingPlansProficiencyLevels.d.ts.map +1 -0
- package/dist/esm/trainingPlansProficiencyLevels.js +90 -0
- package/dist/esm/trainingPlansProficiencyLevels.js.map +1 -0
- package/dist/esm/userInformation.d.ts +29 -0
- package/dist/esm/userInformation.d.ts.map +1 -0
- package/dist/esm/userInformation.js +75 -0
- package/dist/esm/userInformation.js.map +1 -0
- package/dist/esm/users.d.ts +206 -0
- package/dist/esm/users.d.ts.map +1 -0
- package/dist/esm/users.js +663 -0
- package/dist/esm/users.js.map +1 -0
- package/dist/esm/utils.d.ts +14 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +50 -0
- package/dist/esm/utils.js.map +1 -0
- package/package.json +8 -1
- package/. npmignore +0 -11
- package/.eslintrc.json +0 -14
- package/src/lib/actionNotifications.ts +0 -87
- package/src/lib/address.ts +0 -25
- package/src/lib/aiAssistant.ts +0 -190
- package/src/lib/avatar.ts +0 -38
- package/src/lib/axiosClient.ts +0 -97
- package/src/lib/config.ts +0 -80
- package/src/lib/constants.ts +0 -90
- package/src/lib/dashboard.ts +0 -83
- package/src/lib/departmentTrainingPlans.ts +0 -197
- package/src/lib/groups.ts +0 -327
- package/src/lib/integration.ts +0 -395
- package/src/lib/integrationConfiguration.ts +0 -108
- package/src/lib/integrations/contentGenerator.ts +0 -97
- package/src/lib/learningContent.ts +0 -522
- package/src/lib/learningPath.ts +0 -237
- package/src/lib/logger.ts +0 -69
- package/src/lib/microSkillsQuizes.ts +0 -66
- package/src/lib/quotas.ts +0 -55
- package/src/lib/role.ts +0 -438
- package/src/lib/roleTemplate.ts +0 -282
- package/src/lib/security.ts +0 -93
- package/src/lib/skill.ts +0 -532
- package/src/lib/skillAssessmentTestingSession.ts +0 -184
- package/src/lib/skillAssessments.ts +0 -184
- package/src/lib/skillTemplate.ts +0 -336
- package/src/lib/talentTransfromation.ts +0 -120
- package/src/lib/teams.ts +0 -316
- package/src/lib/tenants.ts +0 -63
- package/src/lib/trainingPlans.ts +0 -368
- package/src/lib/trainingPlansProficiencyLevels.ts +0 -124
- package/src/lib/userInformation.ts +0 -105
- package/src/lib/users.ts +0 -764
- package/src/lib/utils.ts +0 -51
- package/tsconfig.cjs.json +0 -9
- package/tsconfig.esm.json +0 -9
- package/tsconfig.json +0 -23
package/src/lib/security.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { AxiosError, AxiosResponse } from "axios";
|
|
2
|
-
import { client } from "./axiosClient";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Get the enabled authentication connections for current organization.
|
|
6
|
-
* @param {String} authToken - Authorization token
|
|
7
|
-
* @returns {Promise<object>}
|
|
8
|
-
*/
|
|
9
|
-
export const getAuthConnections = (authToken: string): Promise<object> => {
|
|
10
|
-
return new Promise((resolve, reject) => {
|
|
11
|
-
const getConfigInformationRequest = client.get(
|
|
12
|
-
`api/v1/security/authconnections`,
|
|
13
|
-
{ headers: { authorization: authToken } }
|
|
14
|
-
);
|
|
15
|
-
getConfigInformationRequest
|
|
16
|
-
.then((response : AxiosResponse) => {
|
|
17
|
-
resolve(response.data);
|
|
18
|
-
})
|
|
19
|
-
.catch((error : AxiosError) => {
|
|
20
|
-
reject(error);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Set the enabled authentication connections for current organization.
|
|
27
|
-
* @param {Object} data - the object containing the updated configuration
|
|
28
|
-
* @param {String} authToken - Authorization token
|
|
29
|
-
* @returns {Promise<object>}
|
|
30
|
-
*/
|
|
31
|
-
export const setAuthConnections = (
|
|
32
|
-
data: object,
|
|
33
|
-
authToken: string
|
|
34
|
-
): Promise<object> => {
|
|
35
|
-
return new Promise((resolve, reject) => {
|
|
36
|
-
const setConfigInformationRequest = client.post(
|
|
37
|
-
`api/v1/security/authconnections`,
|
|
38
|
-
{ data: data },
|
|
39
|
-
{ headers: { authorization: authToken } }
|
|
40
|
-
);
|
|
41
|
-
setConfigInformationRequest
|
|
42
|
-
.then((response : AxiosResponse) => {
|
|
43
|
-
resolve(response.data);
|
|
44
|
-
})
|
|
45
|
-
.catch((error : AxiosError) => {
|
|
46
|
-
reject(error);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Reset the MFA for the user.
|
|
53
|
-
* @param {String} userId
|
|
54
|
-
* @param {String} authToken
|
|
55
|
-
* @returns {Promise<object>}
|
|
56
|
-
*/
|
|
57
|
-
export const resetMFA = (userId: string, authToken: string): Promise<object> => {
|
|
58
|
-
return new Promise((resolve, reject) => {
|
|
59
|
-
const resetMFARequest = client.post(
|
|
60
|
-
`api/v1/security/resetmfa`,
|
|
61
|
-
userId ? {} : { userId: userId },
|
|
62
|
-
{ headers: { authorization: authToken } }
|
|
63
|
-
);
|
|
64
|
-
resetMFARequest
|
|
65
|
-
.then((response : AxiosResponse) => {
|
|
66
|
-
resolve(response.data);
|
|
67
|
-
})
|
|
68
|
-
.catch((error : AxiosError) => {
|
|
69
|
-
reject(error);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Synchronize the authentication connections with Auth0.
|
|
76
|
-
* @param {String} authToken
|
|
77
|
-
* @returns {Promise<object>}
|
|
78
|
-
*/
|
|
79
|
-
export const synchronizeWithAuth0 = (authToken: string): Promise<object> => {
|
|
80
|
-
return new Promise((resolve, reject) => {
|
|
81
|
-
const synchronizeRequest = client.get(
|
|
82
|
-
`api/v1/security/synchronizewithauth0`,
|
|
83
|
-
{ headers: { authorization: authToken } }
|
|
84
|
-
);
|
|
85
|
-
synchronizeRequest
|
|
86
|
-
.then((response : AxiosResponse) => {
|
|
87
|
-
resolve(response.data);
|
|
88
|
-
})
|
|
89
|
-
.catch((error : AxiosError) => {
|
|
90
|
-
reject(error);
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
};
|
package/src/lib/skill.ts
DELETED
|
@@ -1,532 +0,0 @@
|
|
|
1
|
-
import { AxiosError, AxiosResponse } from "axios";
|
|
2
|
-
import { client } from "./axiosClient";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Create skill and set information
|
|
6
|
-
* @param {Object} data
|
|
7
|
-
* @param {String} token Authorization token
|
|
8
|
-
* @returns {Promise<object>}
|
|
9
|
-
*/
|
|
10
|
-
export const createSkill = (data: object, token: string): Promise<object> => {
|
|
11
|
-
return new Promise((resolve, reject) => {
|
|
12
|
-
const confirmationRequest = client.put(
|
|
13
|
-
"api/v1/skills",
|
|
14
|
-
{ data: data },
|
|
15
|
-
{
|
|
16
|
-
headers: { authorization: token },
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
confirmationRequest
|
|
20
|
-
.then((response : AxiosResponse) => {
|
|
21
|
-
resolve(response.data);
|
|
22
|
-
})
|
|
23
|
-
.catch((error : AxiosError) => {
|
|
24
|
-
reject(error);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Create skills from templates
|
|
31
|
-
* @param {Array<String>} templateIds
|
|
32
|
-
* @param {String} token Authorization token
|
|
33
|
-
* @returns {Promise<object>}
|
|
34
|
-
*/
|
|
35
|
-
export const createSkillsFromTemplates = (
|
|
36
|
-
templateIds: string[],
|
|
37
|
-
token: string
|
|
38
|
-
): Promise<object> => {
|
|
39
|
-
return new Promise((resolve, reject) => {
|
|
40
|
-
const requestData = {
|
|
41
|
-
templateIds: templateIds,
|
|
42
|
-
};
|
|
43
|
-
const confirmationRequest = client.put(
|
|
44
|
-
"api/v1/skills/createfromtemplate/",
|
|
45
|
-
requestData,
|
|
46
|
-
{
|
|
47
|
-
headers: { authorization: token },
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
confirmationRequest
|
|
51
|
-
.then((response : AxiosResponse) => {
|
|
52
|
-
resolve(response.data);
|
|
53
|
-
})
|
|
54
|
-
.catch((error : AxiosError) => {
|
|
55
|
-
reject(error);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Delete skill
|
|
62
|
-
* @param {String} id The id of the skill to be deleted
|
|
63
|
-
* @param {String} comments The comments included with the deletion
|
|
64
|
-
* @param {String} token Authorization token
|
|
65
|
-
* @returns {Promise<object>}
|
|
66
|
-
*/
|
|
67
|
-
export const deleteSkill = (
|
|
68
|
-
id: string,
|
|
69
|
-
comments: string,
|
|
70
|
-
token: string
|
|
71
|
-
): Promise<object> => {
|
|
72
|
-
return new Promise((resolve, reject) => {
|
|
73
|
-
const data: { id: string; comments?: string } = {
|
|
74
|
-
id: id,
|
|
75
|
-
};
|
|
76
|
-
if (comments) data.comments = comments;
|
|
77
|
-
const request = client.delete(`api/v1/skills/`, {
|
|
78
|
-
headers: { authorization: token },
|
|
79
|
-
data: data,
|
|
80
|
-
});
|
|
81
|
-
request
|
|
82
|
-
.then((response : AxiosResponse) => {
|
|
83
|
-
resolve(response.data);
|
|
84
|
-
})
|
|
85
|
-
.catch((error : AxiosError) => {
|
|
86
|
-
reject(error);
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Discard the skill draft changes
|
|
93
|
-
* @param {String} id The id of the skill to be discarded
|
|
94
|
-
* @param {String} token Authorization token
|
|
95
|
-
* @returns {Promise<object>}
|
|
96
|
-
*/
|
|
97
|
-
export const discardSkillChanges = (id: string, token: string): Promise<object> => {
|
|
98
|
-
return new Promise((resolve, reject) => {
|
|
99
|
-
const data = {};
|
|
100
|
-
const request = client.get(`api/v1/skills/discard/${id}`, {
|
|
101
|
-
headers: { authorization: token },
|
|
102
|
-
data: data,
|
|
103
|
-
});
|
|
104
|
-
request
|
|
105
|
-
.then((response : AxiosResponse) => {
|
|
106
|
-
resolve(response.data);
|
|
107
|
-
})
|
|
108
|
-
.catch((error : AxiosError) => {
|
|
109
|
-
reject(error);
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Get the list of imported skill templates
|
|
116
|
-
* @param {String} token Authorization token
|
|
117
|
-
* @returns {Promise<object>}
|
|
118
|
-
*/
|
|
119
|
-
export const getImportedSkillTemplates = (token: string): Promise<object> => {
|
|
120
|
-
return new Promise((resolve, reject) => {
|
|
121
|
-
const request = client.get(`api/v1/skills/getimportedskilltemplates`, {
|
|
122
|
-
headers: { authorization: token },
|
|
123
|
-
});
|
|
124
|
-
request
|
|
125
|
-
.then((response : AxiosResponse) => {
|
|
126
|
-
resolve(response.data);
|
|
127
|
-
})
|
|
128
|
-
.catch((error : AxiosError) => {
|
|
129
|
-
reject(error);
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Get the skill related roles
|
|
136
|
-
* @param {String} id
|
|
137
|
-
* @param {String} token Authorization token
|
|
138
|
-
* @param {Boolean} includeRoleInformation
|
|
139
|
-
* @returns {Promise<object>}
|
|
140
|
-
*/
|
|
141
|
-
export const getSkillRelatedRoles = (
|
|
142
|
-
id: string,
|
|
143
|
-
token: string,
|
|
144
|
-
includeRoleInformation = false
|
|
145
|
-
): Promise<object> => {
|
|
146
|
-
return new Promise((resolve, reject) => {
|
|
147
|
-
const confirmationRequest = client.get(
|
|
148
|
-
`api/v1/skills/getskillrelatedroles/${id}/${includeRoleInformation}`,
|
|
149
|
-
{
|
|
150
|
-
headers: { authorization: token },
|
|
151
|
-
}
|
|
152
|
-
);
|
|
153
|
-
confirmationRequest
|
|
154
|
-
.then((response : AxiosResponse) => {
|
|
155
|
-
resolve(response.data);
|
|
156
|
-
})
|
|
157
|
-
.catch((error : AxiosError) => {
|
|
158
|
-
reject(error);
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Get skill required assessment type
|
|
165
|
-
* @param {String} id
|
|
166
|
-
* @param {String} token Authorization token
|
|
167
|
-
* @returns {Promise<object>}
|
|
168
|
-
*/
|
|
169
|
-
export const getSkillRequiredAssessmentType = (
|
|
170
|
-
id: string,
|
|
171
|
-
token: string
|
|
172
|
-
): Promise<object> => {
|
|
173
|
-
return new Promise((resolve, reject) => {
|
|
174
|
-
const confirmationRequest = client.get(
|
|
175
|
-
`api/v1/skills/getrequiredassessmenttype/${id}`,
|
|
176
|
-
{
|
|
177
|
-
headers: { authorization: token },
|
|
178
|
-
}
|
|
179
|
-
);
|
|
180
|
-
confirmationRequest
|
|
181
|
-
.then((response : AxiosResponse) => {
|
|
182
|
-
resolve(response.data);
|
|
183
|
-
})
|
|
184
|
-
.catch((error : AxiosError) => {
|
|
185
|
-
reject(error);
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Get skill information
|
|
192
|
-
* @param {String} id The id of the skill
|
|
193
|
-
* @param {String} version The version of the skill
|
|
194
|
-
* @param {Boolean} returnNullIfVersionNotFound When true it will return null if the version is not found
|
|
195
|
-
* @param {String} token Authorization token
|
|
196
|
-
* @returns {Promise<object>}
|
|
197
|
-
*/
|
|
198
|
-
export const getSkillInformationById = (
|
|
199
|
-
id: string,
|
|
200
|
-
version: string,
|
|
201
|
-
returnNullIfVersionNotFound: boolean,
|
|
202
|
-
token: string
|
|
203
|
-
): Promise<object> => {
|
|
204
|
-
return new Promise((resolve, reject) => {
|
|
205
|
-
const confirmationRequest = client.get(
|
|
206
|
-
`api/v1/skills/skill/${id}/${version}/${returnNullIfVersionNotFound}`,
|
|
207
|
-
{
|
|
208
|
-
headers: { authorization: token },
|
|
209
|
-
}
|
|
210
|
-
);
|
|
211
|
-
confirmationRequest
|
|
212
|
-
.then((response : AxiosResponse) => {
|
|
213
|
-
resolve(response.data);
|
|
214
|
-
})
|
|
215
|
-
.catch((error : AxiosError) => {
|
|
216
|
-
reject(error);
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Get skill list
|
|
223
|
-
* @param {Array<String>} filter The filter used to select the skill
|
|
224
|
-
* @param {String} version The version to be retrieved
|
|
225
|
-
* @param {Boolean} includeDeleted If true it will return deleted records as well
|
|
226
|
-
* @param {Boolean} returnDefaultIfVersionNotAvailable Return the default version if published not available
|
|
227
|
-
* @param {Boolean} namesOnly Return only the names of the skills
|
|
228
|
-
* @param {String} token Authorization token
|
|
229
|
-
* @returns {Promise<object>}
|
|
230
|
-
*/
|
|
231
|
-
export const getSkillList = (
|
|
232
|
-
filter: string[],
|
|
233
|
-
version: string,
|
|
234
|
-
includeDeleted: boolean,
|
|
235
|
-
returnDefaultIfVersionNotAvailable: boolean,
|
|
236
|
-
namesOnly: boolean,
|
|
237
|
-
token: string
|
|
238
|
-
): Promise<object> => {
|
|
239
|
-
return new Promise((resolve, reject) => {
|
|
240
|
-
const requestData = {
|
|
241
|
-
includeDeleted: includeDeleted,
|
|
242
|
-
namesOnly: namesOnly,
|
|
243
|
-
returnDefaultIfVersionNotAvailable: returnDefaultIfVersionNotAvailable,
|
|
244
|
-
version: version,
|
|
245
|
-
filter: filter,
|
|
246
|
-
};
|
|
247
|
-
if (filter) requestData.filter = filter;
|
|
248
|
-
const confirmationRequest = client.post(`api/v1/skills`, requestData, {
|
|
249
|
-
headers: { authorization: token },
|
|
250
|
-
});
|
|
251
|
-
confirmationRequest
|
|
252
|
-
.then((response : AxiosResponse) => {
|
|
253
|
-
resolve(response.data);
|
|
254
|
-
})
|
|
255
|
-
.catch((error : AxiosError) => {
|
|
256
|
-
reject(error);
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Get skills for team by id
|
|
263
|
-
* @param {String} teamId The ID of the team for which skills will be loaded
|
|
264
|
-
* @param {Number} maxDepth How many levels down in the organization the skills will be loaded
|
|
265
|
-
* @param {Boolean} returnNullIfVersionNotFound Return null if the version is not found
|
|
266
|
-
* @param {String} token Authorization token
|
|
267
|
-
* @returns {Promise<object>}
|
|
268
|
-
*/
|
|
269
|
-
export const getTeamSkillsById = (
|
|
270
|
-
teamId: string,
|
|
271
|
-
maxDepth: number,
|
|
272
|
-
returnNullIfVersionNotFound: boolean,
|
|
273
|
-
token: string
|
|
274
|
-
): Promise<object> => {
|
|
275
|
-
return new Promise((resolve, reject) => {
|
|
276
|
-
const confirmationRequest = client.get(
|
|
277
|
-
`api/v1/skills/getteambyid/${teamId}/${maxDepth}/${returnNullIfVersionNotFound}`,
|
|
278
|
-
{
|
|
279
|
-
headers: { authorization: token },
|
|
280
|
-
}
|
|
281
|
-
);
|
|
282
|
-
confirmationRequest
|
|
283
|
-
.then((response : AxiosResponse) => {
|
|
284
|
-
resolve(response.data);
|
|
285
|
-
})
|
|
286
|
-
.catch((error : AxiosError) => {
|
|
287
|
-
reject(error);
|
|
288
|
-
});
|
|
289
|
-
});
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Get current user team skills
|
|
294
|
-
* @param {Number} maxDepth How many levels down in the organization the skills will be loaded
|
|
295
|
-
* @param {String} token Authorization token
|
|
296
|
-
* @returns {Promise<object>}
|
|
297
|
-
*/
|
|
298
|
-
export const getCurrentUserTeamSkills = (
|
|
299
|
-
maxDepth: number,
|
|
300
|
-
token: string
|
|
301
|
-
): Promise<object> => {
|
|
302
|
-
return new Promise((resolve, reject) => {
|
|
303
|
-
const confirmationRequest = client.get(
|
|
304
|
-
`api/v1/skills/getcurrentuserteam/${maxDepth}`,
|
|
305
|
-
{
|
|
306
|
-
headers: { authorization: token },
|
|
307
|
-
}
|
|
308
|
-
);
|
|
309
|
-
confirmationRequest
|
|
310
|
-
.then((response : AxiosResponse) => {
|
|
311
|
-
resolve(response.data);
|
|
312
|
-
})
|
|
313
|
-
.catch((error : AxiosError) => {
|
|
314
|
-
reject(error);
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Get skill template updates
|
|
321
|
-
* @param {String} id The skill id
|
|
322
|
-
* @param {String} token Authorization token
|
|
323
|
-
* @returns {Promise<object>}
|
|
324
|
-
*/
|
|
325
|
-
export const getSkillTemplateUpdates = (
|
|
326
|
-
id: string,
|
|
327
|
-
token: string
|
|
328
|
-
): Promise<object> => {
|
|
329
|
-
return new Promise((resolve, reject) => {
|
|
330
|
-
const confirmationRequest = client.get(
|
|
331
|
-
`api/v1/skills/getskilltemplateupdates/${id}`,
|
|
332
|
-
{
|
|
333
|
-
headers: { authorization: token },
|
|
334
|
-
}
|
|
335
|
-
);
|
|
336
|
-
confirmationRequest
|
|
337
|
-
.then((response : AxiosResponse) => {
|
|
338
|
-
resolve(response.data);
|
|
339
|
-
})
|
|
340
|
-
.catch((error : AxiosError) => {
|
|
341
|
-
reject(error);
|
|
342
|
-
});
|
|
343
|
-
});
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Import skill templates
|
|
348
|
-
* @param {Array<String>} data The list of role templates to be imported
|
|
349
|
-
* @param {Boolean} publish If true the imported templates will be published
|
|
350
|
-
* @param {String} token Authorization token
|
|
351
|
-
* @returns {Promise<object>}
|
|
352
|
-
*/
|
|
353
|
-
export const importSkillTemplates = (
|
|
354
|
-
data: string[],
|
|
355
|
-
publish: boolean,
|
|
356
|
-
token: string
|
|
357
|
-
): Promise<object> => {
|
|
358
|
-
return new Promise((resolve, reject) => {
|
|
359
|
-
const requestData = {
|
|
360
|
-
data: data,
|
|
361
|
-
publish: publish,
|
|
362
|
-
};
|
|
363
|
-
const confirmationRequest = client.post(
|
|
364
|
-
`api/v1/skills/importtemplates`,
|
|
365
|
-
requestData,
|
|
366
|
-
{
|
|
367
|
-
headers: { authorization: token },
|
|
368
|
-
}
|
|
369
|
-
);
|
|
370
|
-
confirmationRequest
|
|
371
|
-
.then((response : AxiosResponse) => {
|
|
372
|
-
resolve(response.data);
|
|
373
|
-
})
|
|
374
|
-
.catch((error : AxiosError) => {
|
|
375
|
-
reject(error);
|
|
376
|
-
});
|
|
377
|
-
});
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Publish skill
|
|
382
|
-
* @param {String} id The id of the skill to be published
|
|
383
|
-
* @param {String} comments The comments to be include with the request
|
|
384
|
-
* @param {String} token Authorization token
|
|
385
|
-
* @returns {Promise<object>}
|
|
386
|
-
*/
|
|
387
|
-
export const publishSkill = (
|
|
388
|
-
id: string,
|
|
389
|
-
comments: string,
|
|
390
|
-
token: string
|
|
391
|
-
): Promise<object> => {
|
|
392
|
-
return new Promise((resolve, reject) => {
|
|
393
|
-
const data: { comments?: string } = {};
|
|
394
|
-
if (comments) data.comments = comments;
|
|
395
|
-
const confirmationRequest = client.post(`api/v1/skills/publish/${id}`, data, {
|
|
396
|
-
headers: { authorization: token },
|
|
397
|
-
});
|
|
398
|
-
confirmationRequest
|
|
399
|
-
.then((response : AxiosResponse) => {
|
|
400
|
-
resolve(response.data);
|
|
401
|
-
})
|
|
402
|
-
.catch((error : AxiosError) => {
|
|
403
|
-
reject(error);
|
|
404
|
-
});
|
|
405
|
-
});
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Set skill information
|
|
410
|
-
* @param {String} id The id of the skill to be updated
|
|
411
|
-
* @param {Object} data Data used to update the skill
|
|
412
|
-
* @param {String} token Authorization token
|
|
413
|
-
* @returns {Promise<object>}
|
|
414
|
-
*/
|
|
415
|
-
export const setSkillInformation = (
|
|
416
|
-
id: string,
|
|
417
|
-
data: object,
|
|
418
|
-
token: string
|
|
419
|
-
): Promise<object> => {
|
|
420
|
-
return new Promise((resolve, reject) => {
|
|
421
|
-
const requestData = {
|
|
422
|
-
data: data,
|
|
423
|
-
id: id,
|
|
424
|
-
};
|
|
425
|
-
const confirmationRequest = client.post(
|
|
426
|
-
`api/v1/skills/update/`,
|
|
427
|
-
requestData,
|
|
428
|
-
{
|
|
429
|
-
headers: { authorization: token },
|
|
430
|
-
}
|
|
431
|
-
);
|
|
432
|
-
confirmationRequest
|
|
433
|
-
.then((response : AxiosResponse) => {
|
|
434
|
-
resolve(response.data);
|
|
435
|
-
})
|
|
436
|
-
.catch((error : AxiosError) => {
|
|
437
|
-
reject(error);
|
|
438
|
-
});
|
|
439
|
-
});
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* Set the skill information from template
|
|
444
|
-
* @param {String} id The id of the skill to be updated
|
|
445
|
-
* @param {Object} data Data used to update the skill
|
|
446
|
-
* @param {String} token Authorization token
|
|
447
|
-
* @returns {Promise<object>}
|
|
448
|
-
*/
|
|
449
|
-
export const setSkillInformationFromTemplate = (
|
|
450
|
-
id: string,
|
|
451
|
-
data: object,
|
|
452
|
-
token: string
|
|
453
|
-
): Promise<object> => {
|
|
454
|
-
return new Promise((resolve, reject) => {
|
|
455
|
-
const requestData = {
|
|
456
|
-
data: data,
|
|
457
|
-
id: id,
|
|
458
|
-
};
|
|
459
|
-
const confirmationRequest = client.post(
|
|
460
|
-
`api/v1/skills/updatefromtemplate/`,
|
|
461
|
-
requestData,
|
|
462
|
-
{
|
|
463
|
-
headers: { authorization: token },
|
|
464
|
-
}
|
|
465
|
-
);
|
|
466
|
-
confirmationRequest
|
|
467
|
-
.then((response : AxiosResponse) => {
|
|
468
|
-
resolve(response.data);
|
|
469
|
-
})
|
|
470
|
-
.catch((error : AxiosError) => {
|
|
471
|
-
reject(error);
|
|
472
|
-
});
|
|
473
|
-
});
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* Validate skill information
|
|
478
|
-
* @param {String} id The id of the skill to be updated
|
|
479
|
-
* @param {String} token Authorization token
|
|
480
|
-
* @returns {Promise<object>}
|
|
481
|
-
*/
|
|
482
|
-
export const validateSkill = (id: string, token: string): Promise<object> => {
|
|
483
|
-
return new Promise((resolve, reject) => {
|
|
484
|
-
const requestData = {
|
|
485
|
-
id: id,
|
|
486
|
-
};
|
|
487
|
-
const confirmationRequest = client.post(
|
|
488
|
-
`api/v1/skills/validate/`,
|
|
489
|
-
requestData,
|
|
490
|
-
{
|
|
491
|
-
headers: { authorization: token },
|
|
492
|
-
}
|
|
493
|
-
);
|
|
494
|
-
confirmationRequest
|
|
495
|
-
.then((response : AxiosResponse) => {
|
|
496
|
-
resolve(response.data);
|
|
497
|
-
})
|
|
498
|
-
.catch((error : AxiosError) => {
|
|
499
|
-
reject(error);
|
|
500
|
-
});
|
|
501
|
-
});
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* Watch skill
|
|
506
|
-
* @param {String} id The id of the skill to be updated
|
|
507
|
-
* @param {Boolean} watch Set to true or false
|
|
508
|
-
* @param {String} token Authorization token
|
|
509
|
-
* @returns {Promise<object>}
|
|
510
|
-
*/
|
|
511
|
-
export const watchSkill = (
|
|
512
|
-
id: string,
|
|
513
|
-
watch: boolean,
|
|
514
|
-
token: string
|
|
515
|
-
): Promise<object> => {
|
|
516
|
-
return new Promise((resolve, reject) => {
|
|
517
|
-
const requestData = {
|
|
518
|
-
id: id,
|
|
519
|
-
watch: watch,
|
|
520
|
-
};
|
|
521
|
-
const confirmationRequest = client.post(`api/v1/skills/watch`, requestData, {
|
|
522
|
-
headers: { authorization: token },
|
|
523
|
-
});
|
|
524
|
-
confirmationRequest
|
|
525
|
-
.then((response : AxiosResponse) => {
|
|
526
|
-
resolve(response.data);
|
|
527
|
-
})
|
|
528
|
-
.catch((error : AxiosError) => {
|
|
529
|
-
reject(error);
|
|
530
|
-
});
|
|
531
|
-
});
|
|
532
|
-
};
|