@stackfactor/client-api 1.1.134 → 1.1.136

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