@stackfactor/client-api 1.1.133 → 1.1.135

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.
Files changed (177) hide show
  1. package/.eslintrc.json +4 -3
  2. package/declarations/axios.d.ts +1 -0
  3. package/declarations/html2plaintext.d.ts +1 -0
  4. package/dist/actionNotifications.d.ts +7 -0
  5. package/dist/actionNotifications.d.ts.map +1 -0
  6. package/dist/actionNotifications.js +9 -10
  7. package/dist/actionNotifications.js.map +1 -0
  8. package/dist/address.d.ts +5 -0
  9. package/dist/address.d.ts.map +1 -0
  10. package/dist/address.js +5 -6
  11. package/dist/address.js.map +1 -0
  12. package/dist/aiAssistant.d.ts +9 -0
  13. package/dist/aiAssistant.d.ts.map +1 -0
  14. package/dist/aiAssistant.js +16 -17
  15. package/dist/aiAssistant.js.map +1 -0
  16. package/dist/avatar.d.ts +5 -0
  17. package/dist/avatar.d.ts.map +1 -0
  18. package/dist/avatar.js +4 -5
  19. package/dist/avatar.js.map +1 -0
  20. package/dist/axiosClient.d.ts +32 -0
  21. package/dist/axiosClient.d.ts.map +1 -0
  22. package/dist/axiosClient.js +17 -27
  23. package/dist/axiosClient.js.map +1 -0
  24. package/dist/config.d.ts +7 -0
  25. package/dist/config.d.ts.map +1 -0
  26. package/dist/config.js +9 -10
  27. package/dist/config.js.map +1 -0
  28. package/dist/constants.d.ts +70 -0
  29. package/dist/constants.d.ts.map +1 -0
  30. package/dist/constants.js +2 -7
  31. package/dist/constants.js.map +1 -0
  32. package/dist/dashboard.d.ts +7 -0
  33. package/dist/dashboard.d.ts.map +1 -0
  34. package/dist/dashboard.js +9 -10
  35. package/dist/dashboard.js.map +1 -0
  36. package/dist/departmentTrainingPlans.d.ts +13 -0
  37. package/dist/departmentTrainingPlans.d.ts.map +1 -0
  38. package/dist/departmentTrainingPlans.js +16 -17
  39. package/dist/departmentTrainingPlans.js.map +1 -0
  40. package/dist/groups.d.ts +16 -0
  41. package/dist/groups.d.ts.map +1 -0
  42. package/dist/groups.js +27 -28
  43. package/dist/groups.js.map +1 -0
  44. package/dist/index.d.ts +34 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +34 -17
  47. package/dist/index.js.map +1 -0
  48. package/dist/integration.d.ts +95 -0
  49. package/dist/integration.d.ts.map +1 -0
  50. package/dist/integration.js +62 -69
  51. package/dist/integration.js.map +1 -0
  52. package/dist/integrationConfiguration.d.ts +7 -0
  53. package/dist/integrationConfiguration.d.ts.map +1 -0
  54. package/dist/integrationConfiguration.js +10 -11
  55. package/dist/integrationConfiguration.js.map +1 -0
  56. package/dist/integrations/contentGenerator.d.ts +27 -0
  57. package/dist/integrations/contentGenerator.d.ts.map +1 -0
  58. package/dist/integrations/contentGenerator.js +12 -16
  59. package/dist/integrations/contentGenerator.js.map +1 -0
  60. package/dist/learningContent.d.ts +19 -0
  61. package/dist/learningContent.d.ts.map +1 -0
  62. package/dist/learningContent.js +30 -31
  63. package/dist/learningContent.js.map +1 -0
  64. package/dist/learningPath.d.ts +12 -0
  65. package/dist/learningPath.d.ts.map +1 -0
  66. package/dist/learningPath.js +19 -20
  67. package/dist/learningPath.js.map +1 -0
  68. package/dist/logger.d.ts +6 -0
  69. package/dist/logger.d.ts.map +1 -0
  70. package/dist/logger.js +8 -9
  71. package/dist/logger.js.map +1 -0
  72. package/dist/microSkillsQuizes.d.ts +6 -0
  73. package/dist/microSkillsQuizes.d.ts.map +1 -0
  74. package/dist/microSkillsQuizes.js +8 -9
  75. package/dist/microSkillsQuizes.js.map +1 -0
  76. package/dist/quotas.d.ts +6 -0
  77. package/dist/quotas.d.ts.map +1 -0
  78. package/dist/quotas.js +7 -8
  79. package/dist/quotas.js.map +1 -0
  80. package/dist/role.d.ts +18 -0
  81. package/dist/role.d.ts.map +1 -0
  82. package/dist/role.js +32 -33
  83. package/dist/role.js.map +1 -0
  84. package/dist/roleTemplate.d.ts +13 -0
  85. package/dist/roleTemplate.d.ts.map +1 -0
  86. package/dist/roleTemplate.js +22 -23
  87. package/dist/roleTemplate.js.map +1 -0
  88. package/dist/security.d.ts +8 -0
  89. package/dist/security.d.ts.map +1 -0
  90. package/dist/security.js +11 -12
  91. package/dist/security.js.map +1 -0
  92. package/dist/skill.d.ts +22 -0
  93. package/dist/skill.d.ts.map +1 -0
  94. package/dist/skill.js +40 -41
  95. package/dist/skill.js.map +1 -0
  96. package/dist/skillAssessmentTestingSession.d.ts +10 -0
  97. package/dist/skillAssessmentTestingSession.d.ts.map +1 -0
  98. package/dist/skillAssessmentTestingSession.js +15 -16
  99. package/dist/skillAssessmentTestingSession.js.map +1 -0
  100. package/dist/skillAssessments.d.ts +10 -0
  101. package/dist/skillAssessments.d.ts.map +1 -0
  102. package/dist/skillAssessments.js +15 -16
  103. package/dist/skillAssessments.js.map +1 -0
  104. package/dist/skillTemplate.d.ts +15 -0
  105. package/dist/skillTemplate.d.ts.map +1 -0
  106. package/dist/skillTemplate.js +26 -27
  107. package/dist/skillTemplate.js.map +1 -0
  108. package/dist/talentTransfromation.d.ts +8 -0
  109. package/dist/talentTransfromation.d.ts.map +1 -0
  110. package/dist/talentTransfromation.js +11 -12
  111. package/dist/talentTransfromation.js.map +1 -0
  112. package/dist/teams.d.ts +15 -0
  113. package/dist/teams.d.ts.map +1 -0
  114. package/dist/teams.js +25 -26
  115. package/dist/teams.js.map +1 -0
  116. package/dist/tenants.d.ts +6 -0
  117. package/dist/tenants.d.ts.map +1 -0
  118. package/dist/tenants.js +7 -8
  119. package/dist/tenants.js.map +1 -0
  120. package/dist/trainingPlans.d.ts +16 -0
  121. package/dist/trainingPlans.d.ts.map +1 -0
  122. package/dist/trainingPlans.js +19 -20
  123. package/dist/trainingPlans.js.map +1 -0
  124. package/dist/trainingPlansProficiencyLevels.d.ts +8 -0
  125. package/dist/trainingPlansProficiencyLevels.d.ts.map +1 -0
  126. package/dist/trainingPlansProficiencyLevels.js +9 -10
  127. package/dist/trainingPlansProficiencyLevels.js.map +1 -0
  128. package/dist/userInformation.d.ts +7 -0
  129. package/dist/userInformation.d.ts.map +1 -0
  130. package/dist/userInformation.js +9 -10
  131. package/dist/userInformation.js.map +1 -0
  132. package/dist/users.d.ts +31 -0
  133. package/dist/users.d.ts.map +1 -0
  134. package/dist/users.js +37 -39
  135. package/dist/users.js.map +1 -0
  136. package/dist/utils.d.ts +8 -0
  137. package/dist/utils.d.ts.map +1 -0
  138. package/dist/utils.js +8 -21
  139. package/dist/utils.js.map +1 -0
  140. package/package.json +15 -14
  141. package/src/lib/actionNotifications.ts +11 -10
  142. package/src/lib/address.ts +5 -4
  143. package/src/lib/aiAssistant.ts +25 -24
  144. package/src/lib/avatar.ts +4 -3
  145. package/src/lib/axiosClient.ts +22 -9
  146. package/src/lib/config.ts +11 -10
  147. package/src/lib/dashboard.ts +11 -10
  148. package/src/lib/departmentTrainingPlans.ts +29 -32
  149. package/src/lib/groups.ts +38 -37
  150. package/src/lib/index.ts +85 -1
  151. package/src/lib/integration.ts +56 -55
  152. package/src/lib/integrationConfiguration.ts +15 -14
  153. package/src/lib/integrations/contentGenerator.ts +10 -9
  154. package/src/lib/learningContent.ts +56 -55
  155. package/src/lib/learningPath.ts +32 -31
  156. package/src/lib/logger.ts +9 -8
  157. package/src/lib/microSkillsQuizes.ts +11 -10
  158. package/src/lib/quotas.ts +10 -9
  159. package/src/lib/role.ts +56 -55
  160. package/src/lib/roleTemplate.ts +37 -36
  161. package/src/lib/security.ts +14 -13
  162. package/src/lib/skill.ts +72 -71
  163. package/src/lib/skillAssessmentTestingSession.ts +25 -24
  164. package/src/lib/skillAssessments.ts +25 -24
  165. package/src/lib/skillTemplate.ts +45 -44
  166. package/src/lib/talentTransfromation.ts +15 -14
  167. package/src/lib/teams.ts +35 -34
  168. package/src/lib/tenants.ts +10 -9
  169. package/src/lib/trainingPlans.ts +37 -36
  170. package/src/lib/trainingPlansProficiencyLevels.ts +14 -13
  171. package/src/lib/userInformation.ts +13 -12
  172. package/src/lib/users.ts +72 -72
  173. package/src/lib/utils.ts +7 -16
  174. package/tsconfig.json +16 -5
  175. package/dist/exports.js +0 -77
  176. package/index.d.ts +0 -1
  177. package/src/lib/exports.ts +0 -85
@@ -1,4 +1,5 @@
1
- import { client } from "./axiosClient.js";
1
+ import { AxiosError, AxiosResponse } from "axios";
2
+ import { client } from "./axiosClient";
2
3
 
3
4
  /**
4
5
  * Add new entry skill assessment
@@ -6,7 +7,7 @@ import { client } from "./axiosClient.js";
6
7
  * @param {Object} data
7
8
  * @param {String} comments
8
9
  * @param {String} token Authorization token
9
- * @returns {Promise<Object>}
10
+ * @returns {Promise<object>}
10
11
  */
11
12
  const addEntry = (
12
13
  id: string,
@@ -20,7 +21,7 @@ const addEntry = (
20
21
  data: data,
21
22
  id: id,
22
23
  };
23
- let confirmationRequest = client.put(
24
+ const confirmationRequest = client.put(
24
25
  "api/v1/skillassessments/addentry",
25
26
  requestData,
26
27
  {
@@ -28,10 +29,10 @@ const addEntry = (
28
29
  }
29
30
  );
30
31
  confirmationRequest
31
- .then((response) => {
32
+ .then((response : AxiosResponse) => {
32
33
  resolve(response.data);
33
34
  })
34
- .catch((error) => {
35
+ .catch((error : AxiosError) => {
35
36
  reject(error);
36
37
  });
37
38
  });
@@ -43,7 +44,7 @@ const addEntry = (
43
44
  * @param {String} comments
44
45
  * @param {String} userId
45
46
  * @param {String} token Authorization token
46
- * @returns {Promise<Object>}
47
+ * @returns {Promise<object>}
47
48
  */
48
49
  const create = (
49
50
  data: object,
@@ -57,7 +58,7 @@ const create = (
57
58
  data: data,
58
59
  userId: userId,
59
60
  };
60
- let confirmationRequest = client.put(
61
+ const confirmationRequest = client.put(
61
62
  "api/v1/skillassessments/",
62
63
  requestData,
63
64
  {
@@ -65,10 +66,10 @@ const create = (
65
66
  }
66
67
  );
67
68
  confirmationRequest
68
- .then((response) => {
69
+ .then((response : AxiosResponse) => {
69
70
  resolve(response.data);
70
71
  })
71
- .catch((error) => {
72
+ .catch((error : AxiosError) => {
72
73
  reject(error);
73
74
  });
74
75
  });
@@ -79,7 +80,7 @@ const create = (
79
80
  * @param {number} id The id of the skill to be deleted
80
81
  * @param {String} comments The comments included with the deletion
81
82
  * @param {String} token Authorization token
82
- * @returns {Promise<Object>}
83
+ * @returns {Promise<object>}
83
84
  */
84
85
  const deleteSkillAssessment = (
85
86
  id: number,
@@ -96,10 +97,10 @@ const deleteSkillAssessment = (
96
97
  data: data,
97
98
  });
98
99
  request
99
- .then((response) => {
100
+ .then((response : AxiosResponse) => {
100
101
  resolve(response.data);
101
102
  })
102
- .catch((error) => {
103
+ .catch((error : AxiosError) => {
103
104
  reject(error);
104
105
  });
105
106
  });
@@ -109,18 +110,18 @@ const deleteSkillAssessment = (
109
110
  * Get skill assessment by id
110
111
  * @param {String} id
111
112
  * @param {String} token
112
- * @returns {Promise<Object>}
113
+ * @returns {Promise<object>}
113
114
  */
114
115
  const getById = (id: string, token: string): Promise<object> => {
115
116
  return new Promise((resolve, reject) => {
116
- let confirmationRequest = client.get(`api/v1/skillassessments/${id}`, {
117
+ const confirmationRequest = client.get(`api/v1/skillassessments/${id}`, {
117
118
  headers: { authorization: token },
118
119
  });
119
120
  confirmationRequest
120
- .then((response) => {
121
+ .then((response : AxiosResponse) => {
121
122
  resolve(response.data);
122
123
  })
123
- .catch((error) => {
124
+ .catch((error : AxiosError) => {
124
125
  reject(error);
125
126
  });
126
127
  });
@@ -131,7 +132,7 @@ const getById = (id: string, token: string): Promise<object> => {
131
132
  * @param {String} userId
132
133
  * @param {String} skillId
133
134
  * @param {String} token
134
- * @returns {Promise<Object>} The skill assessment
135
+ * @returns {Promise<object>} The skill assessment
135
136
  */
136
137
  const getByUserAndSkill = (
137
138
  userId: string,
@@ -139,17 +140,17 @@ const getByUserAndSkill = (
139
140
  token: string
140
141
  ): Promise<object> => {
141
142
  return new Promise((resolve, reject) => {
142
- let confirmationRequest = client.get(
143
+ const confirmationRequest = client.get(
143
144
  `api/v1/skillassessments/getbyuserandskill/${userId}/${skillId}`,
144
145
  {
145
146
  headers: { authorization: token },
146
147
  }
147
148
  );
148
149
  confirmationRequest
149
- .then((response) => {
150
+ .then((response : AxiosResponse) => {
150
151
  resolve(response.data);
151
152
  })
152
- .catch((error) => {
153
+ .catch((error : AxiosError) => {
153
154
  reject(error);
154
155
  });
155
156
  });
@@ -159,13 +160,13 @@ const getByUserAndSkill = (
159
160
  * Get list
160
161
  * @param {String} userId The user used to select the skill
161
162
  * @param {String} token Authorization token
162
- * @returns {Promise<Object>}
163
+ * @returns {Promise<object>}
163
164
  */
164
165
  const getList = (userId: string, token: string): Promise<object> => {
165
166
  return new Promise((resolve, reject) => {
166
167
  const requestData: { userId?: string } = {};
167
168
  if (userId) requestData.userId = userId;
168
- let confirmationRequest = client.post(
169
+ const confirmationRequest = client.post(
169
170
  `api/v1/skillassessments`,
170
171
  requestData,
171
172
  {
@@ -173,10 +174,10 @@ const getList = (userId: string, token: string): Promise<object> => {
173
174
  }
174
175
  );
175
176
  confirmationRequest
176
- .then((response) => {
177
+ .then((response : AxiosResponse) => {
177
178
  resolve(response.data);
178
179
  })
179
- .catch((error) => {
180
+ .catch((error : AxiosError) => {
180
181
  reject(error);
181
182
  });
182
183
  });
@@ -1,4 +1,5 @@
1
- import { client } from "./axiosClient.js";
1
+ import { AxiosError, AxiosResponse } from "axios";
2
+ import { client } from "./axiosClient";
2
3
 
3
4
  /**
4
5
  * Add new entry skill assessment
@@ -6,7 +7,7 @@ import { client } from "./axiosClient.js";
6
7
  * @param {Object} data
7
8
  * @param {String} comments
8
9
  * @param {String} token Authorization token
9
- * @returns {Promise<Object>}
10
+ * @returns {Promise<object>}
10
11
  */
11
12
  const addEntry = (
12
13
  id: string,
@@ -20,7 +21,7 @@ const addEntry = (
20
21
  data: data,
21
22
  id: id,
22
23
  };
23
- let confirmationRequest = client.put(
24
+ const confirmationRequest = client.put(
24
25
  "api/v1/skillassessments/addentry",
25
26
  requestData,
26
27
  {
@@ -28,10 +29,10 @@ const addEntry = (
28
29
  }
29
30
  );
30
31
  confirmationRequest
31
- .then((response) => {
32
+ .then((response : AxiosResponse) => {
32
33
  resolve(response.data);
33
34
  })
34
- .catch((error) => {
35
+ .catch((error : AxiosError) => {
35
36
  reject(error);
36
37
  });
37
38
  });
@@ -43,7 +44,7 @@ const addEntry = (
43
44
  * @param {String} comments
44
45
  * @param {String} userId
45
46
  * @param {String} token Authorization token
46
- * @returns {Promise<Object>}
47
+ * @returns {Promise<object>}
47
48
  */
48
49
  const create = (
49
50
  data: object,
@@ -57,7 +58,7 @@ const create = (
57
58
  data: data,
58
59
  userId: userId,
59
60
  };
60
- let confirmationRequest = client.put(
61
+ const confirmationRequest = client.put(
61
62
  "api/v1/skillassessments/",
62
63
  requestData,
63
64
  {
@@ -65,10 +66,10 @@ const create = (
65
66
  }
66
67
  );
67
68
  confirmationRequest
68
- .then((response) => {
69
+ .then((response : AxiosResponse) => {
69
70
  resolve(response.data);
70
71
  })
71
- .catch((error) => {
72
+ .catch((error : AxiosError) => {
72
73
  reject(error);
73
74
  });
74
75
  });
@@ -79,7 +80,7 @@ const create = (
79
80
  * @param {number} id The id of the skill to be deleted
80
81
  * @param {String} comments The comments included with the deletion
81
82
  * @param {String} token Authorization token
82
- * @returns {Promise<Object>}
83
+ * @returns {Promise<object>}
83
84
  */
84
85
  const deleteSkillAssessment = (
85
86
  id: number,
@@ -96,10 +97,10 @@ const deleteSkillAssessment = (
96
97
  data: data,
97
98
  });
98
99
  request
99
- .then((response) => {
100
+ .then((response : AxiosResponse) => {
100
101
  resolve(response.data);
101
102
  })
102
- .catch((error) => {
103
+ .catch((error : AxiosError) => {
103
104
  reject(error);
104
105
  });
105
106
  });
@@ -109,18 +110,18 @@ const deleteSkillAssessment = (
109
110
  * Get skill assessment by id
110
111
  * @param {String} id
111
112
  * @param {String} token
112
- * @returns {Promise<Object>}
113
+ * @returns {Promise<object>}
113
114
  */
114
115
  const getById = (id: string, token: string): Promise<object> => {
115
116
  return new Promise((resolve, reject) => {
116
- let confirmationRequest = client.get(`api/v1/skillassessments/${id}`, {
117
+ const confirmationRequest = client.get(`api/v1/skillassessments/${id}`, {
117
118
  headers: { authorization: token },
118
119
  });
119
120
  confirmationRequest
120
- .then((response) => {
121
+ .then((response : AxiosResponse) => {
121
122
  resolve(response.data);
122
123
  })
123
- .catch((error) => {
124
+ .catch((error : AxiosError) => {
124
125
  reject(error);
125
126
  });
126
127
  });
@@ -131,7 +132,7 @@ const getById = (id: string, token: string): Promise<object> => {
131
132
  * @param {String} userId
132
133
  * @param {String} skillId
133
134
  * @param {String} token
134
- * @returns {Promise<Object>} The skill assessment
135
+ * @returns {Promise<object>} The skill assessment
135
136
  */
136
137
  const getByUserAndSkill = (
137
138
  userId: string,
@@ -139,17 +140,17 @@ const getByUserAndSkill = (
139
140
  token: string
140
141
  ): Promise<object> => {
141
142
  return new Promise((resolve, reject) => {
142
- let confirmationRequest = client.get(
143
+ const confirmationRequest = client.get(
143
144
  `api/v1/skillassessments/getbyuserandskill/${userId}/${skillId}`,
144
145
  {
145
146
  headers: { authorization: token },
146
147
  }
147
148
  );
148
149
  confirmationRequest
149
- .then((response) => {
150
+ .then((response : AxiosResponse) => {
150
151
  resolve(response.data);
151
152
  })
152
- .catch((error) => {
153
+ .catch((error : AxiosError) => {
153
154
  reject(error);
154
155
  });
155
156
  });
@@ -159,13 +160,13 @@ const getByUserAndSkill = (
159
160
  * Get list
160
161
  * @param {String} userId The user used to select the skill
161
162
  * @param {String} token Authorization token
162
- * @returns {Promise<Object>}
163
+ * @returns {Promise<object>}
163
164
  */
164
165
  const getList = (userId: string, token: string): Promise<object> => {
165
166
  return new Promise((resolve, reject) => {
166
167
  const requestData: { userId?: string } = {};
167
168
  if (userId) requestData.userId = userId;
168
- let confirmationRequest = client.post(
169
+ const confirmationRequest = client.post(
169
170
  `api/v1/skillassessments`,
170
171
  requestData,
171
172
  {
@@ -173,10 +174,10 @@ const getList = (userId: string, token: string): Promise<object> => {
173
174
  }
174
175
  );
175
176
  confirmationRequest
176
- .then((response) => {
177
+ .then((response : AxiosResponse) => {
177
178
  resolve(response.data);
178
179
  })
179
- .catch((error) => {
180
+ .catch((error : AxiosError) => {
180
181
  reject(error);
181
182
  });
182
183
  });
@@ -1,24 +1,25 @@
1
- import { client } from "./axiosClient.js";
1
+ import { AxiosError, AxiosResponse } from "axios";
2
+ import { client } from "./axiosClient";
2
3
 
3
4
  /**
4
5
  * Create skill template and set information
5
6
  * @param {Object} data
6
7
  * @param {String} token Authorization token
7
- * @returns {Promise<Object>}
8
+ * @returns {Promise<object>}
8
9
  */
9
10
  const createSkillTemplate = (data: object, token: string): Promise<object> => {
10
11
  return new Promise((resolve, reject) => {
11
12
  const requestData = {
12
13
  data: data,
13
14
  };
14
- let confirmationRequest = client.put("api/v1/skilltemplates", requestData, {
15
+ const confirmationRequest = client.put("api/v1/skilltemplates", requestData, {
15
16
  headers: { authorization: token },
16
17
  });
17
18
  confirmationRequest
18
- .then((response) => {
19
+ .then((response : AxiosResponse) => {
19
20
  resolve(response.data);
20
21
  })
21
- .catch((error) => {
22
+ .catch((error : AxiosError) => {
22
23
  reject(error);
23
24
  });
24
25
  });
@@ -29,7 +30,7 @@ const createSkillTemplate = (data: object, token: string): Promise<object> => {
29
30
  * @param {number} id The id of the template to be deleted
30
31
  * @param {String} comments The comments included with the deletion
31
32
  * @param {String} token Authorization token
32
- * @returns {Promise<Object>}
33
+ * @returns {Promise<object>}
33
34
  */
34
35
  const deleteSkillTemplate = (
35
36
  id: number,
@@ -46,10 +47,10 @@ const deleteSkillTemplate = (
46
47
  data: data,
47
48
  });
48
49
  request
49
- .then((response) => {
50
+ .then((response : AxiosResponse) => {
50
51
  resolve(response.data);
51
52
  })
52
- .catch((error) => {
53
+ .catch((error : AxiosError) => {
53
54
  reject(error);
54
55
  });
55
56
  });
@@ -59,7 +60,7 @@ const deleteSkillTemplate = (
59
60
  * Discard the skill template draft changes
60
61
  * @param {String} id The id of the skill template to be deleted
61
62
  * @param {String} token Authorization token
62
- * @returns {Promise<Object>}
63
+ * @returns {Promise<object>}
63
64
  */
64
65
  const discardSkillTemplateChanges = (
65
66
  id: string,
@@ -72,10 +73,10 @@ const discardSkillTemplateChanges = (
72
73
  data: data,
73
74
  });
74
75
  request
75
- .then((response) => {
76
+ .then((response : AxiosResponse) => {
76
77
  resolve(response.data);
77
78
  })
78
- .catch((error) => {
79
+ .catch((error : AxiosError) => {
79
80
  reject(error);
80
81
  });
81
82
  });
@@ -87,7 +88,7 @@ const discardSkillTemplateChanges = (
87
88
  * @param {String} version The version of the template
88
89
  * @param {Boolean} returnNullIfVersionNotFound When true it will return null if the version is not found
89
90
  * @param {String} token Authorization token
90
- * @returns {Promise<Object>}
91
+ * @returns {Promise<object>}
91
92
  */
92
93
  const getSkillTemplateInformationById = (
93
94
  id: string,
@@ -96,17 +97,17 @@ const getSkillTemplateInformationById = (
96
97
  token: string
97
98
  ): Promise<object> => {
98
99
  return new Promise((resolve, reject) => {
99
- let confirmationRequest = client.get(
100
+ const confirmationRequest = client.get(
100
101
  `api/v1/skilltemplates/${id}/${version}/${returnNullIfVersionNotFound}`,
101
102
  {
102
103
  headers: { authorization: token },
103
104
  }
104
105
  );
105
106
  confirmationRequest
106
- .then((response) => {
107
+ .then((response : AxiosResponse) => {
107
108
  resolve(response.data);
108
109
  })
109
- .catch((error) => {
110
+ .catch((error : AxiosError) => {
110
111
  reject(error);
111
112
  });
112
113
  });
@@ -119,7 +120,7 @@ const getSkillTemplateInformationById = (
119
120
  * @param {Boolean} includeDeleted When true it will return the deleted records as well
120
121
  * @param {Boolean} namesOnly When true it will return only the names of the templates
121
122
  * @param {String} token Authorization token
122
- * @returns {Promise<Object>}
123
+ * @returns {Promise<object>}
123
124
  */
124
125
  const getSkillTemplateList = (
125
126
  filter: string[],
@@ -135,7 +136,7 @@ const getSkillTemplateList = (
135
136
  version: version,
136
137
  };
137
138
  if (filter) requestData.filter = filter;
138
- let confirmationRequest = client.post(
139
+ const confirmationRequest = client.post(
139
140
  `api/v1/skilltemplates`,
140
141
  requestData,
141
142
  {
@@ -143,10 +144,10 @@ const getSkillTemplateList = (
143
144
  }
144
145
  );
145
146
  confirmationRequest
146
- .then((response) => {
147
+ .then((response : AxiosResponse) => {
147
148
  resolve(response.data);
148
149
  })
149
- .catch((error) => {
150
+ .catch((error : AxiosError) => {
150
151
  reject(error);
151
152
  });
152
153
  });
@@ -155,18 +156,18 @@ const getSkillTemplateList = (
155
156
  /**
156
157
  * Get skill technology stacks template list
157
158
  * @param {String} token Authorization token
158
- * @returns {Promise<Object>}
159
+ * @returns {Promise<object>}
159
160
  */
160
161
  const getTechnologyStacks = (token: string): Promise<object> => {
161
162
  return new Promise((resolve, reject) => {
162
- let confirmationRequest = client.get(`api/v1/skilltemplates/stacks`, {
163
+ const confirmationRequest = client.get(`api/v1/skilltemplates/stacks`, {
163
164
  headers: { authorization: token },
164
165
  });
165
166
  confirmationRequest
166
- .then((response) => {
167
+ .then((response : AxiosResponse) => {
167
168
  resolve(response.data);
168
169
  })
169
- .catch((error) => {
170
+ .catch((error : AxiosError) => {
170
171
  reject(error);
171
172
  });
172
173
  });
@@ -177,7 +178,7 @@ const getTechnologyStacks = (token: string): Promise<object> => {
177
178
  * @param {number} id The id of the template to be published
178
179
  * @param {String} comments The comments to be include with the request
179
180
  * @param {String} token Authorization token
180
- * @returns {Promise<Object>}
181
+ * @returns {Promise<object>}
181
182
  */
182
183
  const publishTemplate = (
183
184
  id: number,
@@ -185,9 +186,9 @@ const publishTemplate = (
185
186
  token: string
186
187
  ): Promise<object> => {
187
188
  return new Promise((resolve, reject) => {
188
- let data: { comments?: string } = {};
189
+ const data: { comments?: string } = {};
189
190
  if (comments) data.comments = comments;
190
- let confirmationRequest = client.post(
191
+ const confirmationRequest = client.post(
191
192
  `api/v1/skilltemplates/publish/${id}`,
192
193
  data,
193
194
  {
@@ -195,10 +196,10 @@ const publishTemplate = (
195
196
  }
196
197
  );
197
198
  confirmationRequest
198
- .then((response) => {
199
+ .then((response : AxiosResponse) => {
199
200
  resolve(response.data);
200
201
  })
201
- .catch((error) => {
202
+ .catch((error : AxiosError) => {
202
203
  reject(error);
203
204
  });
204
205
  });
@@ -209,7 +210,7 @@ const publishTemplate = (
209
210
  * @param {String} id The id of the template to be updated
210
211
  * @param {Object} data Data used to update the template
211
212
  * @param {String} token Authorization token
212
- * @returns {Promise<Object>}
213
+ * @returns {Promise<object>}
213
214
  */
214
215
  const setTemplateInformation = (
215
216
  id: string,
@@ -221,7 +222,7 @@ const setTemplateInformation = (
221
222
  data: data,
222
223
  id: id,
223
224
  };
224
- let confirmationRequest = client.post(
225
+ const confirmationRequest = client.post(
225
226
  `api/v1/skilltemplates/update`,
226
227
  requestData,
227
228
  {
@@ -229,10 +230,10 @@ const setTemplateInformation = (
229
230
  }
230
231
  );
231
232
  confirmationRequest
232
- .then((response) => {
233
+ .then((response : AxiosResponse) => {
233
234
  resolve(response.data);
234
235
  })
235
- .catch((error) => {
236
+ .catch((error : AxiosError) => {
236
237
  reject(error);
237
238
  });
238
239
  });
@@ -243,7 +244,7 @@ const setTemplateInformation = (
243
244
  * @param {String} id The id of the template to be updated
244
245
  * @param {Object} tags Updated template tags
245
246
  * @param {String} token Authorization token
246
- * @returns {Promise<Object>}
247
+ * @returns {Promise<object>}
247
248
  */
248
249
  const setTemplateTags = (
249
250
  id: string,
@@ -255,7 +256,7 @@ const setTemplateTags = (
255
256
  tags: tags,
256
257
  id: id,
257
258
  };
258
- let confirmationRequest = client.post(
259
+ const confirmationRequest = client.post(
259
260
  `api/v1/skilltemplates/updatetags/`,
260
261
  requestData,
261
262
  {
@@ -263,10 +264,10 @@ const setTemplateTags = (
263
264
  }
264
265
  );
265
266
  confirmationRequest
266
- .then((response) => {
267
+ .then((response : AxiosResponse) => {
267
268
  resolve(response.data);
268
269
  })
269
- .catch((error) => {
270
+ .catch((error : AxiosError) => {
270
271
  reject(error);
271
272
  });
272
273
  });
@@ -276,14 +277,14 @@ const setTemplateTags = (
276
277
  * Validate skill template information
277
278
  * @param {String} id The id of the skill to be updated
278
279
  * @param {String} token Authorization token
279
- * @returns {Promise<Object>}
280
+ * @returns {Promise<object>}
280
281
  */
281
282
  const validateTemplate = (id: string, token: string): Promise<object> => {
282
283
  return new Promise((resolve, reject) => {
283
284
  const requestData = {
284
285
  id: id,
285
286
  };
286
- let confirmationRequest = client.post(
287
+ const confirmationRequest = client.post(
287
288
  `api/v1/skilltemplates/validate/`,
288
289
  requestData,
289
290
  {
@@ -291,10 +292,10 @@ const validateTemplate = (id: string, token: string): Promise<object> => {
291
292
  }
292
293
  );
293
294
  confirmationRequest
294
- .then((response) => {
295
+ .then((response : AxiosResponse) => {
295
296
  resolve(response.data);
296
297
  })
297
- .catch((error) => {
298
+ .catch((error : AxiosError) => {
298
299
  reject(error);
299
300
  });
300
301
  });
@@ -305,7 +306,7 @@ const validateTemplate = (id: string, token: string): Promise<object> => {
305
306
  * @param {String} id The id of the skill template to be updated
306
307
  * @param {Boolean} watch Set to true or false
307
308
  * @param {String} token Authorization token
308
- * @returns {Promise<Object>}
309
+ * @returns {Promise<object>}
309
310
  */
310
311
  const watchSkillTemplate = (
311
312
  id: string,
@@ -317,7 +318,7 @@ const watchSkillTemplate = (
317
318
  id: id,
318
319
  watch: watch,
319
320
  };
320
- let confirmationRequest = client.post(
321
+ const confirmationRequest = client.post(
321
322
  `api/v1/skilltemplates/watch`,
322
323
  requestData,
323
324
  {
@@ -325,10 +326,10 @@ const watchSkillTemplate = (
325
326
  }
326
327
  );
327
328
  confirmationRequest
328
- .then((response) => {
329
+ .then((response : AxiosResponse) => {
329
330
  resolve(response.data);
330
331
  })
331
- .catch((error) => {
332
+ .catch((error : AxiosError) => {
332
333
  reject(error);
333
334
  });
334
335
  });