@stackfactor/client-api 1.1.68 → 1.1.70

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.js CHANGED
@@ -32,6 +32,7 @@ import skill from "./lib/skill.js";
32
32
  import skillAssessment from "./lib/skillAssessments.js";
33
33
  import skillAssessmentTestingSession from "./lib/skillAssessmentTestingSession.js";
34
34
  import skillTemplate from "./lib/skillTemplate.js";
35
+ import talentTransfromation from "./lib/talentTransfromation.js";
35
36
  import team from "./lib/teams.js";
36
37
  import tenant from "./lib/tenants.js";
37
38
  import trainingPlan from "./lib/trainingPlans.js";
@@ -70,6 +71,7 @@ export {
70
71
  skillAssessment,
71
72
  skillAssessmentTestingSession,
72
73
  skillTemplate,
74
+ talentTransfromation,
73
75
  team,
74
76
  tenant,
75
77
  trainingPlan,
@@ -0,0 +1,68 @@
1
+ import { client } from "./axiosClient.js";
2
+
3
+ /**
4
+ * Get talent transformation steps for the current user
5
+ * @param {String} userId
6
+ * @param {String} authToken The authentication token
7
+ */
8
+ const getTalentTransformationStepsForCurrentUser = (authToken) => {
9
+ return new Promise(function (resolve, reject) {
10
+ const request = client.get(
11
+ `api/v1/talenttransformation/getforcurrentuser`,
12
+ authToken
13
+ ? {
14
+ headers: { authorization: authToken },
15
+ }
16
+ : {}
17
+ );
18
+ request
19
+ .then((response) => {
20
+ resolve(response.data);
21
+ })
22
+ .catch((error) => {
23
+ reject(error);
24
+ });
25
+ });
26
+ };
27
+
28
+ /**
29
+ * Set talent transformation step data
30
+ * @param {String} id The id of the skill to be updated
31
+ * @param {Object} data Data used to update the skill
32
+ * @param {String} token Authorization token
33
+ * @param {Boolean} returnAllStepsStatuses If true, return all steps statuses
34
+ * @returns {Promise}
35
+ */
36
+ const setTalentTransformationStepData = (
37
+ id,
38
+ data,
39
+ token,
40
+ returnAllStepsStatuses = false
41
+ ) => {
42
+ return new Promise(function (resolve, reject) {
43
+ const requestData = {
44
+ data: data,
45
+ id: id,
46
+ returnAllStepsStatuses: returnAllStepsStatuses,
47
+ };
48
+ let confirmationRequest = client.post(
49
+ `api/v1/talenttransformation/setstep/`,
50
+ requestData,
51
+ {
52
+ headers: { authorization: token },
53
+ }
54
+ );
55
+ confirmationRequest
56
+ .then((response) => {
57
+ resolve(response.data);
58
+ })
59
+ .catch((error) => {
60
+ reject(error);
61
+ });
62
+ });
63
+ };
64
+
65
+ export default {
66
+ getTalentTransformationStepsForCurrentUser,
67
+ setTalentTransformationStepData,
68
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.1.68",
3
+ "version": "1.1.70",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {