@stackfactor/client-api 1.1.73 → 1.1.74

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.
@@ -2,12 +2,13 @@ import { client } from "./axiosClient.js";
2
2
 
3
3
  /**
4
4
  * Get all permissions
5
- * @param {String} authToken The authentication token
5
+ * @param {String} token The authentication token
6
6
  */
7
- const getAllUserNotifications = (authToken) => {
7
+ const getAllUserNotifications = (token) => {
8
8
  return new Promise(function (resolve, reject) {
9
9
  const request = client.get(`api/v1/actionnotifications`, {
10
- headers: { authorization: authToken },
10
+ headers: { authorization: token },
11
+ withCredentials: true,
11
12
  });
12
13
  request
13
14
  .then((response) => {
@@ -33,7 +34,7 @@ const markNotifications = (ids, status, authToken) => {
33
34
  ids: ids,
34
35
  status: status,
35
36
  },
36
- { headers: { authorization: authToken } }
37
+ { headers: { authorization: authToken }, withCredentials: true }
37
38
  );
38
39
  request
39
40
  .then((response) => {
@@ -61,7 +62,7 @@ const processNotification = (id, action, comments, authToken) => {
61
62
  action: action,
62
63
  comments: comments,
63
64
  },
64
- { headers: { authorization: authToken } }
65
+ { headers: { authorization: authToken }, withCredentials: true }
65
66
  );
66
67
  request
67
68
  .then((response) => {
package/lib/address.js CHANGED
@@ -10,7 +10,7 @@ const autoComplete = (input, authToken) => {
10
10
  const getAddressesRequest = client.post(
11
11
  `api/v1/address/autocomplete/`,
12
12
  { input: input },
13
- { headers: { authorization: authToken } }
13
+ { headers: { authorization: authToken }, withCredentials: true }
14
14
  );
15
15
  getAddressesRequest
16
16
  .then((response) => {
@@ -20,6 +20,7 @@ const askQuestion = (conversationId, question, updatedContext, token) => {
20
20
  data,
21
21
  {
22
22
  headers: { authorization: token },
23
+ withCredentials: true,
23
24
  }
24
25
  );
25
26
  confirmationRequest
@@ -48,6 +49,7 @@ const endConversation = (conversationId, token) => {
48
49
  data,
49
50
  {
50
51
  headers: { authorization: token },
52
+ withCredentials: true,
51
53
  }
52
54
  );
53
55
  confirmationRequest
@@ -72,6 +74,7 @@ const getConversationByElementId = (elementId, token) => {
72
74
  `/api/v1/aiassistant/getconversation/${elementId}`,
73
75
  {
74
76
  headers: { authorization: token },
77
+ withCredentials: true,
75
78
  }
76
79
  );
77
80
  confirmationRequest
@@ -119,6 +122,7 @@ const startConversation = (
119
122
  data,
120
123
  {
121
124
  headers: { authorization: token },
125
+ withCredentials: true,
122
126
  }
123
127
  );
124
128
  confirmationRequest
package/lib/avatar.js CHANGED
@@ -18,6 +18,7 @@ const getAvatar = (elementId, type, width, height, token) => {
18
18
  authorization: token,
19
19
  },
20
20
  responseType: "blob",
21
+ withCredentials: true,
21
22
  }
22
23
  );
23
24
  confirmationRequest
package/lib/config.js CHANGED
@@ -9,7 +9,7 @@ const getConfigurationById = (id, authToken) => {
9
9
  return new Promise(function (resolve, reject) {
10
10
  const getConfigInformationRequest = client.get(
11
11
  `api/v1/configurations/configuration/id/${id}`,
12
- { headers: { authorization: authToken } }
12
+ { headers: { authorization: authToken }, withCredentials: true }
13
13
  );
14
14
  getConfigInformationRequest
15
15
  .then((response) => {
@@ -30,7 +30,7 @@ const getConfigurationByType = (type, authToken) => {
30
30
  return new Promise(function (resolve, reject) {
31
31
  const getConfigInformationRequest = client.get(
32
32
  `api/v1/configurations/configuration/type/${type}`,
33
- { headers: { authorization: authToken } }
33
+ { headers: { authorization: authToken }, withCredentials: true }
34
34
  );
35
35
  getConfigInformationRequest
36
36
  .then((response) => {
@@ -53,7 +53,7 @@ const setConfigurationById = (id, data, authToken) => {
53
53
  const getConfigInformationRequest = client.post(
54
54
  `api/v1/configurations/configuration/${id}`,
55
55
  { data: data },
56
- { headers: { authorization: authToken } }
56
+ { headers: { authorization: authToken }, withCredentials: true }
57
57
  );
58
58
  getConfigInformationRequest
59
59
  .then((response) => {
package/lib/dashboard.js CHANGED
@@ -16,7 +16,7 @@ const addCardToDashboard = (id, position, data, authToken) => {
16
16
  position: position,
17
17
  data: data || {},
18
18
  },
19
- { headers: { authorization: authToken } }
19
+ { headers: { authorization: authToken }, withCredentials: true }
20
20
  );
21
21
  request
22
22
  .then((response) => {
@@ -36,6 +36,7 @@ const getDashboardCardsList = (authToken) => {
36
36
  return new Promise(function (resolve, reject) {
37
37
  const request = client.get(`/api/v1/dashboard/card`, {
38
38
  headers: { authorization: authToken },
39
+ withCredentials: true,
39
40
  });
40
41
  request
41
42
  .then((response) => {
@@ -56,6 +57,7 @@ const removeCardFromDashboard = (id, authToken) => {
56
57
  return new Promise(function (resolve, reject) {
57
58
  const request = client.delete(`/api/v1/dashboard/card`, {
58
59
  headers: { authorization: authToken },
60
+ withCredentials: true,
59
61
  data: {
60
62
  id: id,
61
63
  },
@@ -26,6 +26,7 @@ const createDepartmentTrainingPlan = (
26
26
  requestData,
27
27
  {
28
28
  headers: { authorization: token },
29
+ withCredentials: true,
29
30
  }
30
31
  );
31
32
  confirmationRequest
@@ -47,6 +48,7 @@ const deleteDepartmentTrainingPlan = (id, token) => {
47
48
  return new Promise(function (resolve, reject) {
48
49
  const request = client.delete(`api/v1/departmenttrainingplans/`, {
49
50
  headers: { authorization: token },
51
+ withCredentials: true,
50
52
  data: {
51
53
  id: id,
52
54
  },
@@ -72,6 +74,7 @@ const getDepartmentTrainingPlanInformationById = (id, version, token) => {
72
74
  `api/v1/departmenttrainingplans/${id}/${version}`,
73
75
  {
74
76
  headers: { authorization: token },
77
+ withCredentials: true,
75
78
  }
76
79
  );
77
80
  confirmationRequest
@@ -100,6 +103,7 @@ const getDepartmentTrainingPlanList = (filter, version, token) => {
100
103
  requestData,
101
104
  {
102
105
  headers: { authorization: token },
106
+ withCredentials: true,
103
107
  }
104
108
  );
105
109
  confirmationRequest
@@ -124,6 +128,7 @@ const publishDepartmentTrainingPlan = (id, token) => {
124
128
  {},
125
129
  {
126
130
  headers: { authorization: token },
131
+ withCredentials: true,
127
132
  }
128
133
  );
129
134
  confirmationRequest
@@ -152,6 +157,7 @@ const setDepartmentTrainingPlanInformation = (id, data, token) => {
152
157
  requestData,
153
158
  {
154
159
  headers: { authorization: token },
160
+ withCredentials: true,
155
161
  }
156
162
  );
157
163
  confirmationRequest
package/lib/groups.js CHANGED
@@ -14,7 +14,7 @@ const addPermissionsToGroup = (groupId, permissions, authToken) => {
14
14
  groupId: groupId,
15
15
  permissions: permissions,
16
16
  },
17
- { headers: { authorization: authToken } }
17
+ { headers: { authorization: authToken }, withCredentials: true }
18
18
  );
19
19
  request
20
20
  .then((response) => {
@@ -40,7 +40,7 @@ const addUsersToGroup = (groupId, users, authToken) => {
40
40
  groupId: groupId,
41
41
  users: users,
42
42
  },
43
- { headers: { authorization: authToken } }
43
+ { headers: { authorization: authToken }, withCredentials: true }
44
44
  );
45
45
  request
46
46
  .then((response) => {
@@ -66,7 +66,7 @@ const createGroup = (name, description, authToken) => {
66
66
  name: name,
67
67
  description: description,
68
68
  },
69
- { headers: { authorization: authToken } }
69
+ { headers: { authorization: authToken }, withCredentials: true }
70
70
  );
71
71
  request
72
72
  .then((response) => {
@@ -92,6 +92,7 @@ const deleteGroup = (groupId, defaultGroupId, authToken) => {
92
92
  id: groupId,
93
93
  defaultGroupId: defaultGroupId,
94
94
  },
95
+ withCredentials: true,
95
96
  });
96
97
  request
97
98
  .then((response) => {
@@ -111,6 +112,7 @@ const getAllPermissions = (authToken) => {
111
112
  return new Promise(function (resolve, reject) {
112
113
  const request = client.get(`api/v1/groups/permissions/getAllPermissions`, {
113
114
  headers: { authorization: authToken },
115
+ withCredentials: true,
114
116
  });
115
117
  request
116
118
  .then((response) => {
@@ -131,6 +133,7 @@ const getGroupById = (groupId, authToken) => {
131
133
  return new Promise(function (resolve, reject) {
132
134
  const request = client.get(`api/v1/groups/group/${groupId}`, {
133
135
  headers: { authorization: authToken },
136
+ withCredentials: true,
134
137
  });
135
138
  request
136
139
  .then((response) => {
@@ -150,6 +153,7 @@ const getGroups = (authToken) => {
150
153
  return new Promise(function (resolve, reject) {
151
154
  const request = client.get(`api/v1/groups/`, {
152
155
  headers: { authorization: authToken },
156
+ withCredentials: true,
153
157
  });
154
158
  request
155
159
  .then((response) => {
@@ -169,6 +173,7 @@ const getUserPermissions = (authToken) => {
169
173
  return new Promise(function (resolve, reject) {
170
174
  const request = client.get(`api/v1/groups/users/getuserpermissions`, {
171
175
  headers: { authorization: authToken },
176
+ withCredentials: true,
172
177
  });
173
178
  request
174
179
  .then((response) => {
@@ -194,7 +199,7 @@ const removePermissionsFromGroup = (groupId, permissions, authToken) => {
194
199
  groupId: groupId,
195
200
  permissions: permissions,
196
201
  },
197
- { headers: { authorization: authToken } }
202
+ { headers: { authorization: authToken }, withCredentials: true }
198
203
  );
199
204
  request
200
205
  .then((response) => {
@@ -220,7 +225,7 @@ const removeUsersFromGroup = (groupId, users, authToken) => {
220
225
  groupId: groupId,
221
226
  users: users,
222
227
  },
223
- { headers: { authorization: authToken } }
228
+ { headers: { authorization: authToken }, withCredentials: true }
224
229
  );
225
230
  request
226
231
  .then((response) => {
@@ -244,7 +249,7 @@ const setDefault = (groupId, authToken) => {
244
249
  {
245
250
  id: groupId,
246
251
  },
247
- { headers: { authorization: authToken } }
252
+ { headers: { authorization: authToken }, withCredentials: true }
248
253
  );
249
254
  request
250
255
  .then((response) => {
@@ -272,7 +277,7 @@ const updateGroup = (groupId, name, description, authToken) => {
272
277
  name: name,
273
278
  description: description,
274
279
  },
275
- { headers: { authorization: authToken } }
280
+ { headers: { authorization: authToken }, withCredentials: true }
276
281
  );
277
282
  request
278
283
  .then((response) => {
@@ -15,6 +15,7 @@ export const createIntegration = (data, token) => {
15
15
  };
16
16
  let confirmationRequest = client.put("api/v1/integrations/", requestData, {
17
17
  headers: { authorization: token },
18
+ withCredentials: true,
18
19
  });
19
20
  confirmationRequest
20
21
  .then((response) => {
@@ -38,6 +39,7 @@ export const deleteIntegration = (id, token) => {
38
39
  data: {
39
40
  id: id,
40
41
  },
42
+ withCredentials: true,
41
43
  });
42
44
  request
43
45
  .then((response) => {
@@ -60,6 +62,7 @@ export const discardIntegrationChanges = (id, token) => {
60
62
  const request = client.get(`api/v1/integrations/discard/${id}`, {
61
63
  headers: { authorization: token },
62
64
  data: data,
65
+ withCredentials: true,
63
66
  });
64
67
  request
65
68
  .then((response) => {
@@ -83,6 +86,7 @@ export const getIntegrationInformationById = (id, version, token) => {
83
86
  `api/v1/integrations/${id}/${version}`,
84
87
  {
85
88
  headers: { authorization: token },
89
+ withCredentials: true,
86
90
  }
87
91
  );
88
92
  confirmationRequest
@@ -119,6 +123,7 @@ export const getIntegrationsList = (
119
123
  if (type) requestData.type = type;
120
124
  let confirmationRequest = client.post(`api/v1/integrations`, requestData, {
121
125
  headers: { authorization: token },
126
+ withCredentials: true,
122
127
  });
123
128
  confirmationRequest
124
129
  .then((response) => {
@@ -147,6 +152,7 @@ export const getContentInformationByUrl = (url, verb, token) => {
147
152
  requestData,
148
153
  {
149
154
  headers: { authorization: token },
155
+ withCredentials: true,
150
156
  }
151
157
  );
152
158
  confirmationRequest
@@ -247,6 +253,7 @@ export const getEnabledContentProviders = (userId, token) => {
247
253
  `api/v1/contentproviders/getenabledcontentproviders/${userId}`,
248
254
  {
249
255
  headers: { authorization: token },
256
+ withCredentials: true,
250
257
  }
251
258
  );
252
259
  confirmationRequest
@@ -271,6 +278,7 @@ export const publishIntegration = (id, token) => {
271
278
  {},
272
279
  {
273
280
  headers: { authorization: token },
281
+ withCredentials: true,
274
282
  }
275
283
  );
276
284
  confirmationRequest
@@ -299,6 +307,7 @@ export const setIntegrationInformation = (id, data, token) => {
299
307
  requestData,
300
308
  {
301
309
  headers: { authorization: token },
310
+ withCredentials: true,
302
311
  }
303
312
  );
304
313
  confirmationRequest
@@ -323,6 +332,7 @@ export const setDefaultIntegration = (id, token) => {
323
332
  "",
324
333
  {
325
334
  headers: { authorization: token },
335
+ withCredentials: true,
326
336
  }
327
337
  );
328
338
  confirmationRequest
@@ -15,6 +15,7 @@ const getIntegrationsConfiguration = (ids, type, token) => {
15
15
  requestData,
16
16
  {
17
17
  headers: { authorization: token },
18
+ withCredentials: true,
18
19
  }
19
20
  );
20
21
  confirmationRequest
@@ -46,6 +47,7 @@ const saveIntegrationConfiguration = (id, type, configuration, token) => {
46
47
  requestData,
47
48
  {
48
49
  headers: { authorization: token },
50
+ withCredentials: true,
49
51
  }
50
52
  );
51
53
  confirmationRequest
@@ -77,6 +79,7 @@ const testIntegrationConfiguration = (id, type, configuration, token) => {
77
79
  requestData,
78
80
  {
79
81
  headers: { authorization: token },
82
+ withCredentials: true,
80
83
  }
81
84
  );
82
85
  confirmationRequest
@@ -17,6 +17,7 @@ export const generateContent = (data, contentType, integrationId, token) => {
17
17
  if (integrationId) data.integrationId = integrationId;
18
18
  const request = client.post(`api/v1/contentgenerators/generate`, data_, {
19
19
  headers: { authorization: token },
20
+ withCredentials: true,
20
21
  });
21
22
  request
22
23
  .then((response) => {
@@ -62,6 +63,7 @@ export const generateContentAsync = (
62
63
  data_,
63
64
  {
64
65
  headers: { authorization: token },
66
+ withCredentials: true,
65
67
  }
66
68
  );
67
69
  request
@@ -16,6 +16,7 @@ const createLearningContent = (data, token) => {
16
16
  requestData,
17
17
  {
18
18
  headers: { authorization: token },
19
+ withCredentials: true,
19
20
  }
20
21
  );
21
22
  confirmationRequest
@@ -43,6 +44,7 @@ const deleteLearningContent = (id, comments, token) => {
43
44
  return new Promise(function (resolve, reject) {
44
45
  const request = client.delete(`api/v1/learningcontent/`, {
45
46
  headers: { authorization: token },
47
+ withCredentials: true,
46
48
  data: data,
47
49
  });
48
50
  request
@@ -66,6 +68,7 @@ const discardLearningContentChanges = (id, token) => {
66
68
  const data = {};
67
69
  const request = client.get(`api/v1/learningcontent/discard/${id}`, {
68
70
  headers: { authorization: token },
71
+ withCredentials: true,
69
72
  data: data,
70
73
  });
71
74
  request
@@ -112,6 +115,7 @@ const generateLearningActivityContent = (
112
115
  requestData,
113
116
  {
114
117
  headers: { authorization: token },
118
+ withCredentials: true,
115
119
  }
116
120
  );
117
121
  request
@@ -140,6 +144,7 @@ const generateMicroSkillTestKnowledge = (microSkill, token) => {
140
144
  data,
141
145
  {
142
146
  headers: { authorization: token },
147
+ withCredentials: true,
143
148
  }
144
149
  );
145
150
  confirmationRequest
@@ -165,6 +170,7 @@ const getLearningContentInformationById = (id, version, token) => {
165
170
  `api/v1/learningcontent/${id}/${version}`,
166
171
  {
167
172
  headers: { authorization: token },
173
+ withCredentials: true,
168
174
  }
169
175
  );
170
176
  confirmationRequest
@@ -197,6 +203,7 @@ const getLearningContentList = (filter, version, includeDeleted, token) => {
197
203
  requestData,
198
204
  {
199
205
  headers: { authorization: token },
206
+ withCredentials: true,
200
207
  }
201
208
  );
202
209
  confirmationRequest
@@ -226,6 +233,7 @@ const publishLearningContent = (id, comments, token) => {
226
233
  data,
227
234
  {
228
235
  headers: { authorization: token },
236
+ withCredentials: true,
229
237
  }
230
238
  );
231
239
  confirmationRequest
@@ -256,6 +264,7 @@ const setLearningContentInformation = (id, data, token) => {
256
264
  requestData,
257
265
  {
258
266
  headers: { authorization: token },
267
+ withCredentials: true,
259
268
  }
260
269
  );
261
270
  confirmationRequest
@@ -286,6 +295,7 @@ const setLearningContentPartialContentInformation = (id, data, token) => {
286
295
  requestData,
287
296
  {
288
297
  headers: { authorization: token },
298
+ withCredentials: true,
289
299
  }
290
300
  );
291
301
  confirmationRequest
@@ -326,6 +336,7 @@ const setLearningContentLearningContentInformation = (
326
336
  requestData,
327
337
  {
328
338
  headers: { authorization: token },
339
+ withCredentials: true,
329
340
  }
330
341
  );
331
342
  confirmationRequest
@@ -361,6 +372,7 @@ const setLearningContentLearningMicroSkillContentInformation = (
361
372
  requestData,
362
373
  {
363
374
  headers: { authorization: token },
375
+ withCredentials: true,
364
376
  }
365
377
  );
366
378
  confirmationRequest
@@ -390,6 +402,7 @@ const setLearningContentTags = (id, tags, token) => {
390
402
  requestData,
391
403
  {
392
404
  headers: { authorization: token },
405
+ withCredentials: true,
393
406
  }
394
407
  );
395
408
  confirmationRequest
@@ -419,6 +432,7 @@ const watchLearningContent = (id, watch, token) => {
419
432
  requestData,
420
433
  {
421
434
  headers: { authorization: token },
435
+ withCredentials: true,
422
436
  }
423
437
  );
424
438
  confirmationRequest
@@ -12,6 +12,7 @@ const createLearningPath = (data, token) => {
12
12
  { data: data },
13
13
  {
14
14
  headers: { authorization: token },
15
+ withCredentials: true,
15
16
  }
16
17
  );
17
18
  confirmationRequest
@@ -38,6 +39,7 @@ const deleteLearningPath = (id, comments, token) => {
38
39
  if (comments) data.comments = comments;
39
40
  const request = client.delete(`api/v1/learningpaths/`, {
40
41
  headers: { authorization: token },
42
+ withCredentials: true,
41
43
  data: data,
42
44
  });
43
45
  request
@@ -60,6 +62,7 @@ const discardLearningPathChanges = (id, token) => {
60
62
  const data = {};
61
63
  const request = client.get(`api/v1/learningpaths/discard/${id}`, {
62
64
  headers: { authorization: token },
65
+ withCredentials: true,
63
66
  data: data,
64
67
  });
65
68
  request
@@ -83,6 +86,7 @@ const getLearningPathInformationById = (id, version, token) => {
83
86
  `api/v1/learningpaths/${id}/${version}`,
84
87
  {
85
88
  headers: { authorization: token },
89
+ withCredentials: true,
86
90
  }
87
91
  );
88
92
  confirmationRequest
@@ -110,6 +114,7 @@ const getLearningPathsList = (list, version, includeDeleted, token) => {
110
114
  if (list) requestData.list = list;
111
115
  let confirmationRequest = client.post(`api/v1/learningpaths`, requestData, {
112
116
  headers: { authorization: token },
117
+ withCredentials: true,
113
118
  });
114
119
  confirmationRequest
115
120
  .then((response) => {
@@ -136,6 +141,7 @@ const publishLearningPath = (id, comments, token) => {
136
141
  data,
137
142
  {
138
143
  headers: { authorization: token },
144
+ withCredentials: true,
139
145
  }
140
146
  );
141
147
  confirmationRequest
@@ -165,6 +171,7 @@ const setLearningPathInformation = (id, data, token) => {
165
171
  requestData,
166
172
  {
167
173
  headers: { authorization: token },
174
+ withCredentials: true,
168
175
  }
169
176
  );
170
177
  confirmationRequest
@@ -194,6 +201,7 @@ const setLearningPathTags = (id, tags, token) => {
194
201
  requestData,
195
202
  {
196
203
  headers: { authorization: token },
204
+ withCredentials: true,
197
205
  }
198
206
  );
199
207
  confirmationRequest
package/lib/logger.js CHANGED
@@ -18,6 +18,7 @@ const comments = (elementId, elementType, data, token) => {
18
18
  },
19
19
  {
20
20
  headers: { authorization: token },
21
+ withCredentials: true,
21
22
  }
22
23
  );
23
24
  confirmationRequest
@@ -44,6 +45,7 @@ const getListByElementId = (elementId, page, elementsPerPage, token) => {
44
45
  if (page !== null) data.page = page;
45
46
  const getTokensRequest = client.post(`api/v1/logger/${elementId}`, data, {
46
47
  headers: { authorization: token },
48
+ withCredentials: true,
47
49
  });
48
50
  getTokensRequest
49
51
  .then((result) => {
@@ -13,6 +13,7 @@ const getResponses = (learningContentId, microSkillId, token) => {
13
13
  `api/v1/microskillsresponses/${learningContentId}/${microSkillId}`,
14
14
  {
15
15
  headers: { authorization: token },
16
+ withCredentials: true,
16
17
  }
17
18
  );
18
19
  confirmationRequest
@@ -43,6 +44,7 @@ const saveResponses = (learningContentId, microSkillId, responses, token) => {
43
44
  data,
44
45
  {
45
46
  headers: { authorization: token },
47
+ withCredentials: true,
46
48
  }
47
49
  );
48
50
  confirmationRequest