@stackfactor/client-api 1.1.51 → 1.1.53

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.
@@ -137,6 +137,24 @@ export const getTrainingPlanById = (id, version, token) => {
137
137
  });
138
138
  };
139
139
 
140
+ /**
141
+ * Get tasks summary for a recipient across all of the training plans
142
+ * @param {String} token Authorization token
143
+ */
144
+ export const getAllTrainingPlansTasksSummary = async (token = null) => {
145
+ return new Promise(function (resolve, reject) {
146
+ let confirmationRequest = client.get(`api/v1/trainingplans/taskssummary`, {
147
+ headers: token ? { authorization: token } : {},
148
+ });
149
+ confirmationRequest
150
+ .then((response) => {
151
+ resolve(response.data);
152
+ })
153
+ .catch((error) => {
154
+ reject(error);
155
+ });
156
+ });
157
+ };
140
158
  /**
141
159
  * Get training plans list
142
160
  * @param {Array<ObjectId>} users The list of users for which the plans should be loaded
@@ -244,7 +262,7 @@ export const updateTrainingPlan = (planId, data, saveAsDraft, token) => {
244
262
  * @param {String} token
245
263
  * @returns {Promise<Object>}
246
264
  */
247
- const updateTrainingPlanTaskStatus = (id, status, token) => {
265
+ export const updateTrainingPlanTaskStatus = (id, status, token) => {
248
266
  return new Promise(function (resolve, reject) {
249
267
  let data = {
250
268
  id: id,
@@ -289,16 +307,3 @@ export const updateActivities = (planId, data, token) => {
289
307
  });
290
308
  });
291
309
  };
292
-
293
- export default {
294
- createTrainingPlan,
295
- deleteTrainingPlan,
296
- discardTrainingPlanChanges,
297
- generateNewBaseline,
298
- getTrainingPlanById,
299
- getListOfTrainingPlans,
300
- publishTrainingPlan,
301
- updateTrainingPlan,
302
- updateTrainingPlanTaskStatus,
303
- updateActivities,
304
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.1.51",
3
+ "version": "1.1.53",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {