@stackfactor/client-api 1.1.134 → 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 (175) 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 -77
  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 +10 -9
  142. package/src/lib/address.ts +4 -3
  143. package/src/lib/aiAssistant.ts +24 -23
  144. package/src/lib/avatar.ts +3 -2
  145. package/src/lib/axiosClient.ts +20 -7
  146. package/src/lib/config.ts +10 -9
  147. package/src/lib/dashboard.ts +10 -9
  148. package/src/lib/departmentTrainingPlans.ts +28 -31
  149. package/src/lib/groups.ts +37 -36
  150. package/src/lib/integration.ts +55 -54
  151. package/src/lib/integrationConfiguration.ts +14 -13
  152. package/src/lib/integrations/contentGenerator.ts +9 -8
  153. package/src/lib/learningContent.ts +55 -54
  154. package/src/lib/learningPath.ts +31 -30
  155. package/src/lib/logger.ts +8 -7
  156. package/src/lib/microSkillsQuizes.ts +10 -9
  157. package/src/lib/quotas.ts +9 -8
  158. package/src/lib/role.ts +55 -54
  159. package/src/lib/roleTemplate.ts +36 -35
  160. package/src/lib/security.ts +13 -12
  161. package/src/lib/skill.ts +71 -70
  162. package/src/lib/skillAssessmentTestingSession.ts +24 -23
  163. package/src/lib/skillAssessments.ts +24 -23
  164. package/src/lib/skillTemplate.ts +44 -43
  165. package/src/lib/talentTransfromation.ts +14 -13
  166. package/src/lib/teams.ts +34 -33
  167. package/src/lib/tenants.ts +9 -8
  168. package/src/lib/trainingPlans.ts +36 -35
  169. package/src/lib/trainingPlansProficiencyLevels.ts +13 -12
  170. package/src/lib/userInformation.ts +12 -11
  171. package/src/lib/users.ts +71 -71
  172. package/src/lib/utils.ts +7 -16
  173. package/tsconfig.json +16 -5
  174. package/dist/exports.js +0 -77
  175. package/index.d.ts +0 -1
@@ -1,24 +1,25 @@
1
+ import { AxiosError, AxiosResponse } from "axios";
1
2
  import { client } from "./axiosClient";
2
3
 
3
4
  /**
4
5
  * Create role 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 createRoleTemplate = (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/roletemplates", requestData, {
15
+ const confirmationRequest = client.put("api/v1/roletemplates", 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 createRoleTemplate = (data: object, token: string): Promise<object> => {
29
30
  * @param {String} 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 deleteRoleTemplate = (
35
36
  id: string,
@@ -46,10 +47,10 @@ const deleteRoleTemplate = (
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 deleteRoleTemplate = (
59
60
  * Discard the role template draft changes
60
61
  * @param {String} id The id of the role template to be deleted
61
62
  * @param {String} token Authorization token
62
- * @returns {Promise<Object>}
63
+ * @returns {Promise<object>}
63
64
  */
64
65
  const discardRoleTemplateChanges = (
65
66
  id: string,
@@ -72,10 +73,10 @@ const discardRoleTemplateChanges = (
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
  });
@@ -86,7 +87,7 @@ const discardRoleTemplateChanges = (
86
87
  * @param {String} id The id of the template
87
88
  * @param {String} version The version of the template
88
89
  * @param {String} token Authorization token
89
- * @returns {Promise<Object>}
90
+ * @returns {Promise<object>}
90
91
  */
91
92
  const getRoleTemplateInformationById = (
92
93
  id: string,
@@ -94,17 +95,17 @@ const getRoleTemplateInformationById = (
94
95
  token: string
95
96
  ): Promise<object> => {
96
97
  return new Promise((resolve, reject) => {
97
- let confirmationRequest = client.get(
98
+ const confirmationRequest = client.get(
98
99
  `api/v1/roletemplates/${id}/${version}`,
99
100
  {
100
101
  headers: { authorization: token },
101
102
  }
102
103
  );
103
104
  confirmationRequest
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
  });
@@ -117,7 +118,7 @@ const getRoleTemplateInformationById = (
117
118
  * @param {Boolean} includeDeleted When true it will return the deleted records as well
118
119
  * @param {Boolean} namesOnly When true it will return only the names of the templates
119
120
  * @param {String} token Authorization token
120
- * @returns {Promise<Object>}
121
+ * @returns {Promise<object>}
121
122
  */
122
123
  const getRoleTemplateList = (
123
124
  filter: string[],
@@ -133,14 +134,14 @@ const getRoleTemplateList = (
133
134
  version: version,
134
135
  };
135
136
  if (filter) requestData.filter = filter;
136
- let confirmationRequest = client.post(`api/v1/roletemplates`, requestData, {
137
+ const confirmationRequest = client.post(`api/v1/roletemplates`, requestData, {
137
138
  headers: { authorization: token },
138
139
  });
139
140
  confirmationRequest
140
- .then((response) => {
141
+ .then((response : AxiosResponse) => {
141
142
  resolve(response.data);
142
143
  })
143
- .catch((error) => {
144
+ .catch((error : AxiosError) => {
144
145
  reject(error);
145
146
  });
146
147
  });
@@ -151,7 +152,7 @@ const getRoleTemplateList = (
151
152
  * @param {number} id The id of the template to be published
152
153
  * @param {String} comments The comments to be include with the request
153
154
  * @param {String} token Authorization token
154
- * @returns {Promise<Object>}
155
+ * @returns {Promise<object>}
155
156
  */
156
157
  const publishTemplate = (
157
158
  id: number,
@@ -159,9 +160,9 @@ const publishTemplate = (
159
160
  token: string
160
161
  ): Promise<object> => {
161
162
  return new Promise((resolve, reject) => {
162
- let data: { comments?: string } = {};
163
+ const data: { comments?: string } = {};
163
164
  if (comments) data.comments = comments;
164
- let confirmationRequest = client.post(
165
+ const confirmationRequest = client.post(
165
166
  `api/v1/roletemplates/publish/${id}`,
166
167
  data,
167
168
  {
@@ -169,10 +170,10 @@ const publishTemplate = (
169
170
  }
170
171
  );
171
172
  confirmationRequest
172
- .then((response) => {
173
+ .then((response : AxiosResponse) => {
173
174
  resolve(response.data);
174
175
  })
175
- .catch((error) => {
176
+ .catch((error : AxiosError) => {
176
177
  reject(error);
177
178
  });
178
179
  });
@@ -183,7 +184,7 @@ const publishTemplate = (
183
184
  * @param {String} id The id of the template to be updated
184
185
  * @param {Object} data Data used to update the template
185
186
  * @param {String} token Authorization token
186
- * @returns {Promise<Object>}
187
+ * @returns {Promise<object>}
187
188
  */
188
189
  const setTemplateInformation = (
189
190
  id: string,
@@ -195,7 +196,7 @@ const setTemplateInformation = (
195
196
  data: data,
196
197
  id: id,
197
198
  };
198
- let confirmationRequest = client.post(
199
+ const confirmationRequest = client.post(
199
200
  `api/v1/roletemplates/update`,
200
201
  requestData,
201
202
  {
@@ -203,10 +204,10 @@ const setTemplateInformation = (
203
204
  }
204
205
  );
205
206
  confirmationRequest
206
- .then((response) => {
207
+ .then((response : AxiosResponse) => {
207
208
  resolve(response.data);
208
209
  })
209
- .catch((error) => {
210
+ .catch((error : AxiosError) => {
210
211
  reject(error);
211
212
  });
212
213
  });
@@ -217,7 +218,7 @@ const setTemplateInformation = (
217
218
  * @param {String} id The id of the template to be updated
218
219
  * @param {Object} tags Updated template tags
219
220
  * @param {String} token Authorization token
220
- * @returns {Promise<Object>}
221
+ * @returns {Promise<object>}
221
222
  */
222
223
  const setTemplateTags = (
223
224
  id: string,
@@ -229,7 +230,7 @@ const setTemplateTags = (
229
230
  tags: tags,
230
231
  id: id,
231
232
  };
232
- let confirmationRequest = client.post(
233
+ const confirmationRequest = client.post(
233
234
  `api/v1/roletemplates/updatetags/`,
234
235
  requestData,
235
236
  {
@@ -237,10 +238,10 @@ const setTemplateTags = (
237
238
  }
238
239
  );
239
240
  confirmationRequest
240
- .then((response) => {
241
+ .then((response : AxiosResponse) => {
241
242
  resolve(response.data);
242
243
  })
243
- .catch((error) => {
244
+ .catch((error : AxiosError) => {
244
245
  reject(error);
245
246
  });
246
247
  });
@@ -251,7 +252,7 @@ const setTemplateTags = (
251
252
  * @param {String} id The id of the skill to be updated
252
253
  * @param {Boolean} watch Set to true or false
253
254
  * @param {String} token Authorization token
254
- * @returns {Promise<Object>}
255
+ * @returns {Promise<object>}
255
256
  */
256
257
  const watchRoleTemplate = (
257
258
  id: string,
@@ -263,7 +264,7 @@ const watchRoleTemplate = (
263
264
  id: id,
264
265
  watch: watch,
265
266
  };
266
- let confirmationRequest = client.post(
267
+ const confirmationRequest = client.post(
267
268
  `api/v1/roletemplates/watch`,
268
269
  requestData,
269
270
  {
@@ -271,10 +272,10 @@ const watchRoleTemplate = (
271
272
  }
272
273
  );
273
274
  confirmationRequest
274
- .then((response) => {
275
+ .then((response : AxiosResponse) => {
275
276
  resolve(response.data);
276
277
  })
277
- .catch((error) => {
278
+ .catch((error : AxiosError) => {
278
279
  reject(error);
279
280
  });
280
281
  });
@@ -1,9 +1,10 @@
1
+ import { AxiosError, AxiosResponse } from "axios";
1
2
  import { client } from "./axiosClient";
2
3
 
3
4
  /**
4
5
  * Get the enabled authentication connections for current organization.
5
6
  * @param {String} authToken - Authorization token
6
- * @returns {Promise<Object>}
7
+ * @returns {Promise<object>}
7
8
  */
8
9
  const getAuthConnections = (authToken: string): Promise<object> => {
9
10
  return new Promise((resolve, reject) => {
@@ -12,10 +13,10 @@ const getAuthConnections = (authToken: string): Promise<object> => {
12
13
  { headers: { authorization: authToken } }
13
14
  );
14
15
  getConfigInformationRequest
15
- .then((response) => {
16
+ .then((response : AxiosResponse) => {
16
17
  resolve(response.data);
17
18
  })
18
- .catch((error) => {
19
+ .catch((error : AxiosError) => {
19
20
  reject(error);
20
21
  });
21
22
  });
@@ -25,7 +26,7 @@ const getAuthConnections = (authToken: string): Promise<object> => {
25
26
  * Set the enabled authentication connections for current organization.
26
27
  * @param {Object} data - the object containing the updated configuration
27
28
  * @param {String} authToken - Authorization token
28
- * @returns {Promise<Object>}
29
+ * @returns {Promise<object>}
29
30
  */
30
31
  const setAuthConnections = (
31
32
  data: object,
@@ -38,10 +39,10 @@ const setAuthConnections = (
38
39
  { headers: { authorization: authToken } }
39
40
  );
40
41
  setConfigInformationRequest
41
- .then((response) => {
42
+ .then((response : AxiosResponse) => {
42
43
  resolve(response.data);
43
44
  })
44
- .catch((error) => {
45
+ .catch((error : AxiosError) => {
45
46
  reject(error);
46
47
  });
47
48
  });
@@ -51,7 +52,7 @@ const setAuthConnections = (
51
52
  * Reset the MFA for the user.
52
53
  * @param {String} userId
53
54
  * @param {String} authToken
54
- * @returns {Promise<Object>}
55
+ * @returns {Promise<object>}
55
56
  */
56
57
  const resetMFA = (userId: string, authToken: string): Promise<object> => {
57
58
  return new Promise((resolve, reject) => {
@@ -61,10 +62,10 @@ const resetMFA = (userId: string, authToken: string): Promise<object> => {
61
62
  { headers: { authorization: authToken } }
62
63
  );
63
64
  resetMFARequest
64
- .then((response) => {
65
+ .then((response : AxiosResponse) => {
65
66
  resolve(response.data);
66
67
  })
67
- .catch((error) => {
68
+ .catch((error : AxiosError) => {
68
69
  reject(error);
69
70
  });
70
71
  });
@@ -73,7 +74,7 @@ const resetMFA = (userId: string, authToken: string): Promise<object> => {
73
74
  /**
74
75
  * Synchronize the authentication connections with Auth0.
75
76
  * @param {String} authToken
76
- * @returns {Promise<Object>}
77
+ * @returns {Promise<object>}
77
78
  */
78
79
  const synchronizeWithAuth0 = (authToken: string): Promise<object> => {
79
80
  return new Promise((resolve, reject) => {
@@ -82,10 +83,10 @@ const synchronizeWithAuth0 = (authToken: string): Promise<object> => {
82
83
  { headers: { authorization: authToken } }
83
84
  );
84
85
  synchronizeRequest
85
- .then((response) => {
86
+ .then((response : AxiosResponse) => {
86
87
  resolve(response.data);
87
88
  })
88
- .catch((error) => {
89
+ .catch((error : AxiosError) => {
89
90
  reject(error);
90
91
  });
91
92
  });