@stackfactor/client-api 1.1.223 → 1.1.224
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.
- package/dist/cjs/package.json +1 -0
- package/dist/esm/lib/actionNotifications.js +7 -13
- package/dist/esm/lib/actionNotifications.js.map +1 -1
- package/dist/esm/lib/address.js +3 -7
- package/dist/esm/lib/address.js.map +1 -1
- package/dist/esm/lib/aiAssistant.js +11 -19
- package/dist/esm/lib/aiAssistant.js.map +1 -1
- package/dist/esm/lib/avatar.js +3 -7
- package/dist/esm/lib/avatar.js.map +1 -1
- package/dist/esm/lib/axiosClient.d.ts +2 -2
- package/dist/esm/lib/axiosClient.d.ts.map +1 -1
- package/dist/esm/lib/axiosClient.js +12 -55
- package/dist/esm/lib/axiosClient.js.map +1 -1
- package/dist/esm/lib/config.js +7 -13
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/constants.js +4 -7
- package/dist/esm/lib/constants.js.map +1 -1
- package/dist/esm/lib/control.js +27 -43
- package/dist/esm/lib/control.js.map +1 -1
- package/dist/esm/lib/controlTemplate.js +23 -37
- package/dist/esm/lib/controlTemplate.js.map +1 -1
- package/dist/esm/lib/customFields.js +3 -7
- package/dist/esm/lib/customFields.js.map +1 -1
- package/dist/esm/lib/dashboard.js +7 -13
- package/dist/esm/lib/dashboard.js.map +1 -1
- package/dist/esm/lib/departmentTrainingPlans.js +13 -22
- package/dist/esm/lib/departmentTrainingPlans.js.map +1 -1
- package/dist/esm/lib/groups.js +25 -40
- package/dist/esm/lib/groups.js.map +1 -1
- package/dist/esm/lib/index.js +44 -89
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/lib/integration.js +29 -46
- package/dist/esm/lib/integration.js.map +1 -1
- package/dist/esm/lib/integrationConfiguration.js +7 -13
- package/dist/esm/lib/integrationConfiguration.js.map +1 -1
- package/dist/esm/lib/integrations/contentGenerator.js +7 -12
- package/dist/esm/lib/integrations/contentGenerator.js.map +1 -1
- package/dist/esm/lib/labSessions.js +17 -27
- package/dist/esm/lib/labSessions.js.map +1 -1
- package/dist/esm/lib/learningContent.js +51 -78
- package/dist/esm/lib/learningContent.js.map +1 -1
- package/dist/esm/lib/learningPath.js +17 -28
- package/dist/esm/lib/learningPath.js.map +1 -1
- package/dist/esm/lib/logger.js +5 -10
- package/dist/esm/lib/logger.js.map +1 -1
- package/dist/esm/lib/microSkillsQuizes.js +5 -10
- package/dist/esm/lib/microSkillsQuizes.js.map +1 -1
- package/dist/esm/lib/policy.js +27 -43
- package/dist/esm/lib/policy.js.map +1 -1
- package/dist/esm/lib/policyTemplate.js +23 -37
- package/dist/esm/lib/policyTemplate.js.map +1 -1
- package/dist/esm/lib/quotas.js +5 -10
- package/dist/esm/lib/quotas.js.map +1 -1
- package/dist/esm/lib/reports.js +9 -16
- package/dist/esm/lib/reports.js.map +1 -1
- package/dist/esm/lib/requirement.js +27 -43
- package/dist/esm/lib/requirement.js.map +1 -1
- package/dist/esm/lib/requirementTemplate.js +23 -37
- package/dist/esm/lib/requirementTemplate.js.map +1 -1
- package/dist/esm/lib/role.js +31 -48
- package/dist/esm/lib/role.js.map +1 -1
- package/dist/esm/lib/roleTemplate.js +19 -31
- package/dist/esm/lib/roleTemplate.js.map +1 -1
- package/dist/esm/lib/security.js +9 -16
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/lib/skill.js +37 -58
- package/dist/esm/lib/skill.js.map +1 -1
- package/dist/esm/lib/skillAssessmentTestingSession.js +23 -37
- package/dist/esm/lib/skillAssessmentTestingSession.js.map +1 -1
- package/dist/esm/lib/skillAssessments.js +13 -22
- package/dist/esm/lib/skillAssessments.js.map +1 -1
- package/dist/esm/lib/skillTemplate.js +23 -37
- package/dist/esm/lib/skillTemplate.js.map +1 -1
- package/dist/esm/lib/socketError.js +1 -5
- package/dist/esm/lib/socketError.js.map +1 -1
- package/dist/esm/lib/standard.js +27 -43
- package/dist/esm/lib/standard.js.map +1 -1
- package/dist/esm/lib/standardTemplate.js +23 -37
- package/dist/esm/lib/standardTemplate.js.map +1 -1
- package/dist/esm/lib/talentTransfromation.js +9 -16
- package/dist/esm/lib/talentTransfromation.js.map +1 -1
- package/dist/esm/lib/teams.js +25 -40
- package/dist/esm/lib/teams.js.map +1 -1
- package/dist/esm/lib/tenants.js +7 -13
- package/dist/esm/lib/tenants.js.map +1 -1
- package/dist/esm/lib/trainingPlans.js +27 -42
- package/dist/esm/lib/trainingPlans.js.map +1 -1
- package/dist/esm/lib/trainingPlansProficiencyLevels.js +9 -16
- package/dist/esm/lib/trainingPlansProficiencyLevels.js.map +1 -1
- package/dist/esm/lib/userInformation.js +7 -13
- package/dist/esm/lib/userInformation.js.map +1 -1
- package/dist/esm/lib/users.js +55 -85
- package/dist/esm/lib/users.js.map +1 -1
- package/dist/esm/lib/utils.js +5 -13
- package/dist/esm/lib/utils.js.map +1 -1
- package/dist/esm/package.json +1 -0
- package/package.json +3 -3
package/dist/esm/lib/control.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getControlRelatedPolicies = exports.getControlRelatedStandards = exports.getControlRelatedRequirements = exports.watchControl = exports.setControlInformationFromTemplate = exports.setControlInformation = exports.publishControl = exports.getControlList = exports.getControlInformationById = exports.discardControlChanges = exports.deleteControl = exports.createControlsFromTemplates = exports.createControl = void 0;
|
|
4
|
-
const axiosClient_js_1 = require("./axiosClient.js");
|
|
1
|
+
import { client } from "./axiosClient.js";
|
|
5
2
|
/**
|
|
6
3
|
* Create control and set information
|
|
7
4
|
* @param {Object} data
|
|
8
5
|
* @param {String} token Authorization token
|
|
9
6
|
* @returns {Promise<object>}
|
|
10
7
|
*/
|
|
11
|
-
const createControl = (data, token) => {
|
|
8
|
+
export const createControl = (data, token) => {
|
|
12
9
|
return new Promise((resolve, reject) => {
|
|
13
|
-
const confirmationRequest =
|
|
10
|
+
const confirmationRequest = client.put("/api/v1/controls", { data: data }, {
|
|
14
11
|
headers: { authorization: token },
|
|
15
12
|
});
|
|
16
13
|
confirmationRequest
|
|
@@ -22,19 +19,18 @@ const createControl = (data, token) => {
|
|
|
22
19
|
});
|
|
23
20
|
});
|
|
24
21
|
};
|
|
25
|
-
exports.createControl = createControl;
|
|
26
22
|
/**
|
|
27
23
|
* Create controls from templates
|
|
28
24
|
* @param {Array<String>} templateIds
|
|
29
25
|
* @param {String} token Authorization token
|
|
30
26
|
* @returns {Promise<object>}
|
|
31
27
|
*/
|
|
32
|
-
const createControlsFromTemplates = (templateIds, token) => {
|
|
28
|
+
export const createControlsFromTemplates = (templateIds, token) => {
|
|
33
29
|
return new Promise((resolve, reject) => {
|
|
34
30
|
const requestData = {
|
|
35
31
|
templateIds: templateIds,
|
|
36
32
|
};
|
|
37
|
-
const confirmationRequest =
|
|
33
|
+
const confirmationRequest = client.put("/api/v1/controls/createfromtemplate/", requestData, {
|
|
38
34
|
headers: { authorization: token },
|
|
39
35
|
});
|
|
40
36
|
confirmationRequest
|
|
@@ -46,7 +42,6 @@ const createControlsFromTemplates = (templateIds, token) => {
|
|
|
46
42
|
});
|
|
47
43
|
});
|
|
48
44
|
};
|
|
49
|
-
exports.createControlsFromTemplates = createControlsFromTemplates;
|
|
50
45
|
/**
|
|
51
46
|
* Delete control
|
|
52
47
|
* @param {String} id The id of the control to be deleted
|
|
@@ -54,14 +49,14 @@ exports.createControlsFromTemplates = createControlsFromTemplates;
|
|
|
54
49
|
* @param {String} token Authorization token
|
|
55
50
|
* @returns {Promise<object>}
|
|
56
51
|
*/
|
|
57
|
-
const deleteControl = (id, comments, token) => {
|
|
52
|
+
export const deleteControl = (id, comments, token) => {
|
|
58
53
|
return new Promise((resolve, reject) => {
|
|
59
54
|
const data = {
|
|
60
55
|
id: id,
|
|
61
56
|
};
|
|
62
57
|
if (comments)
|
|
63
58
|
data.comments = comments;
|
|
64
|
-
const request =
|
|
59
|
+
const request = client.delete(`/api/v1/controls/`, {
|
|
65
60
|
headers: { authorization: token },
|
|
66
61
|
data: data,
|
|
67
62
|
});
|
|
@@ -74,17 +69,16 @@ const deleteControl = (id, comments, token) => {
|
|
|
74
69
|
});
|
|
75
70
|
});
|
|
76
71
|
};
|
|
77
|
-
exports.deleteControl = deleteControl;
|
|
78
72
|
/**
|
|
79
73
|
* Discard the control draft changes
|
|
80
74
|
* @param {String} id The id of the control to be discarded
|
|
81
75
|
* @param {String} token Authorization token
|
|
82
76
|
* @returns {Promise<object>}
|
|
83
77
|
*/
|
|
84
|
-
const discardControlChanges = (id, token) => {
|
|
78
|
+
export const discardControlChanges = (id, token) => {
|
|
85
79
|
return new Promise((resolve, reject) => {
|
|
86
80
|
const data = {};
|
|
87
|
-
const request =
|
|
81
|
+
const request = client.get(`/api/v1/controls/discard/${id}`, {
|
|
88
82
|
headers: { authorization: token },
|
|
89
83
|
data: data,
|
|
90
84
|
});
|
|
@@ -97,7 +91,6 @@ const discardControlChanges = (id, token) => {
|
|
|
97
91
|
});
|
|
98
92
|
});
|
|
99
93
|
};
|
|
100
|
-
exports.discardControlChanges = discardControlChanges;
|
|
101
94
|
/**
|
|
102
95
|
* Get control information
|
|
103
96
|
* @param {String} id The id of the control
|
|
@@ -106,9 +99,9 @@ exports.discardControlChanges = discardControlChanges;
|
|
|
106
99
|
* @param {String} token Authorization token
|
|
107
100
|
* @returns {Promise<object>}
|
|
108
101
|
*/
|
|
109
|
-
const getControlInformationById = (id, version, returnNullIfVersionNotFound, token) => {
|
|
102
|
+
export const getControlInformationById = (id, version, returnNullIfVersionNotFound, token) => {
|
|
110
103
|
return new Promise((resolve, reject) => {
|
|
111
|
-
const confirmationRequest =
|
|
104
|
+
const confirmationRequest = client.get(`/api/v1/controls/${id}/${version}/${returnNullIfVersionNotFound}`, {
|
|
112
105
|
headers: { authorization: token },
|
|
113
106
|
});
|
|
114
107
|
confirmationRequest
|
|
@@ -120,7 +113,6 @@ const getControlInformationById = (id, version, returnNullIfVersionNotFound, tok
|
|
|
120
113
|
});
|
|
121
114
|
});
|
|
122
115
|
};
|
|
123
|
-
exports.getControlInformationById = getControlInformationById;
|
|
124
116
|
/**
|
|
125
117
|
* Get control list
|
|
126
118
|
* @param {Array<String>} filter The filter used to select the control
|
|
@@ -131,7 +123,7 @@ exports.getControlInformationById = getControlInformationById;
|
|
|
131
123
|
* @param {String} token Authorization token
|
|
132
124
|
* @returns {Promise<object>}
|
|
133
125
|
*/
|
|
134
|
-
const getControlList = (filter, version, includeDeleted, returnDefaultIfVersionNotAvailable, details, token) => {
|
|
126
|
+
export const getControlList = (filter, version, includeDeleted, returnDefaultIfVersionNotAvailable, details, token) => {
|
|
135
127
|
return new Promise((resolve, reject) => {
|
|
136
128
|
const requestData = {
|
|
137
129
|
includeDeleted: includeDeleted,
|
|
@@ -142,7 +134,7 @@ const getControlList = (filter, version, includeDeleted, returnDefaultIfVersionN
|
|
|
142
134
|
};
|
|
143
135
|
if (filter)
|
|
144
136
|
requestData.filter = filter;
|
|
145
|
-
const confirmationRequest =
|
|
137
|
+
const confirmationRequest = client.post(`/api/v1/controls`, requestData, {
|
|
146
138
|
headers: { authorization: token },
|
|
147
139
|
});
|
|
148
140
|
confirmationRequest
|
|
@@ -154,7 +146,6 @@ const getControlList = (filter, version, includeDeleted, returnDefaultIfVersionN
|
|
|
154
146
|
});
|
|
155
147
|
});
|
|
156
148
|
};
|
|
157
|
-
exports.getControlList = getControlList;
|
|
158
149
|
/**
|
|
159
150
|
* Publish control
|
|
160
151
|
* @param {String} id The id of the control to be published
|
|
@@ -162,12 +153,12 @@ exports.getControlList = getControlList;
|
|
|
162
153
|
* @param {String} token Authorization token
|
|
163
154
|
* @returns {Promise<object>}
|
|
164
155
|
*/
|
|
165
|
-
const publishControl = (id, comments, token) => {
|
|
156
|
+
export const publishControl = (id, comments, token) => {
|
|
166
157
|
return new Promise((resolve, reject) => {
|
|
167
158
|
const data = {};
|
|
168
159
|
if (comments)
|
|
169
160
|
data.comments = comments;
|
|
170
|
-
const confirmationRequest =
|
|
161
|
+
const confirmationRequest = client.post(`/api/v1/controls/publish/${id}`, data, {
|
|
171
162
|
headers: { authorization: token },
|
|
172
163
|
});
|
|
173
164
|
confirmationRequest
|
|
@@ -179,7 +170,6 @@ const publishControl = (id, comments, token) => {
|
|
|
179
170
|
});
|
|
180
171
|
});
|
|
181
172
|
};
|
|
182
|
-
exports.publishControl = publishControl;
|
|
183
173
|
/**
|
|
184
174
|
* Set control information
|
|
185
175
|
* @param {String} id The id of the control to be updated
|
|
@@ -187,13 +177,13 @@ exports.publishControl = publishControl;
|
|
|
187
177
|
* @param {String} token Authorization token
|
|
188
178
|
* @returns {Promise<object>}
|
|
189
179
|
*/
|
|
190
|
-
const setControlInformation = (id, data, token) => {
|
|
180
|
+
export const setControlInformation = (id, data, token) => {
|
|
191
181
|
return new Promise((resolve, reject) => {
|
|
192
182
|
const requestData = {
|
|
193
183
|
data: data,
|
|
194
184
|
id: id,
|
|
195
185
|
};
|
|
196
|
-
const confirmationRequest =
|
|
186
|
+
const confirmationRequest = client.post(`/api/v1/controls/update`, requestData, {
|
|
197
187
|
headers: { authorization: token },
|
|
198
188
|
});
|
|
199
189
|
confirmationRequest
|
|
@@ -205,7 +195,6 @@ const setControlInformation = (id, data, token) => {
|
|
|
205
195
|
});
|
|
206
196
|
});
|
|
207
197
|
};
|
|
208
|
-
exports.setControlInformation = setControlInformation;
|
|
209
198
|
/**
|
|
210
199
|
* Set the control information from template
|
|
211
200
|
* @param {String} id The id of the control to be updated
|
|
@@ -213,13 +202,13 @@ exports.setControlInformation = setControlInformation;
|
|
|
213
202
|
* @param {String} token Authorization token
|
|
214
203
|
* @returns {Promise<object>}
|
|
215
204
|
*/
|
|
216
|
-
const setControlInformationFromTemplate = (id, data, token) => {
|
|
205
|
+
export const setControlInformationFromTemplate = (id, data, token) => {
|
|
217
206
|
return new Promise((resolve, reject) => {
|
|
218
207
|
const requestData = {
|
|
219
208
|
data: data,
|
|
220
209
|
id: id,
|
|
221
210
|
};
|
|
222
|
-
const confirmationRequest =
|
|
211
|
+
const confirmationRequest = client.post(`/api/v1/controls/updatefromtemplate/`, requestData, {
|
|
223
212
|
headers: { authorization: token },
|
|
224
213
|
});
|
|
225
214
|
confirmationRequest
|
|
@@ -231,7 +220,6 @@ const setControlInformationFromTemplate = (id, data, token) => {
|
|
|
231
220
|
});
|
|
232
221
|
});
|
|
233
222
|
};
|
|
234
|
-
exports.setControlInformationFromTemplate = setControlInformationFromTemplate;
|
|
235
223
|
/**
|
|
236
224
|
* Watch control
|
|
237
225
|
* @param {String} id The id of the control to be updated
|
|
@@ -239,13 +227,13 @@ exports.setControlInformationFromTemplate = setControlInformationFromTemplate;
|
|
|
239
227
|
* @param {String} token Authorization token
|
|
240
228
|
* @returns {Promise<object>}
|
|
241
229
|
*/
|
|
242
|
-
const watchControl = (id, watch, token) => {
|
|
230
|
+
export const watchControl = (id, watch, token) => {
|
|
243
231
|
return new Promise((resolve, reject) => {
|
|
244
232
|
const requestData = {
|
|
245
233
|
id: id,
|
|
246
234
|
watch: watch,
|
|
247
235
|
};
|
|
248
|
-
const confirmationRequest =
|
|
236
|
+
const confirmationRequest = client.post(`/api/v1/controls/watch`, requestData, {
|
|
249
237
|
headers: { authorization: token },
|
|
250
238
|
});
|
|
251
239
|
confirmationRequest
|
|
@@ -257,16 +245,15 @@ const watchControl = (id, watch, token) => {
|
|
|
257
245
|
});
|
|
258
246
|
});
|
|
259
247
|
};
|
|
260
|
-
exports.watchControl = watchControl;
|
|
261
248
|
/**
|
|
262
249
|
* Get the control related requirements
|
|
263
250
|
* @param {String} id The control id
|
|
264
251
|
* @param {String} token Authorization token
|
|
265
252
|
* @returns {Promise<object>}
|
|
266
253
|
*/
|
|
267
|
-
const getControlRelatedRequirements = (id, token) => {
|
|
254
|
+
export const getControlRelatedRequirements = (id, token) => {
|
|
268
255
|
return new Promise((resolve, reject) => {
|
|
269
|
-
const confirmationRequest =
|
|
256
|
+
const confirmationRequest = client.get(`/api/v1/controls/requirements/${id}`, {
|
|
270
257
|
headers: { authorization: token },
|
|
271
258
|
});
|
|
272
259
|
confirmationRequest
|
|
@@ -278,16 +265,15 @@ const getControlRelatedRequirements = (id, token) => {
|
|
|
278
265
|
});
|
|
279
266
|
});
|
|
280
267
|
};
|
|
281
|
-
exports.getControlRelatedRequirements = getControlRelatedRequirements;
|
|
282
268
|
/**
|
|
283
269
|
* Get the control related standards
|
|
284
270
|
* @param {String} id The control id
|
|
285
271
|
* @param {String} token Authorization token
|
|
286
272
|
* @returns {Promise<object>}
|
|
287
273
|
*/
|
|
288
|
-
const getControlRelatedStandards = (id, token) => {
|
|
274
|
+
export const getControlRelatedStandards = (id, token) => {
|
|
289
275
|
return new Promise((resolve, reject) => {
|
|
290
|
-
const confirmationRequest =
|
|
276
|
+
const confirmationRequest = client.get(`/api/v1/controls/standards/${id}`, {
|
|
291
277
|
headers: { authorization: token },
|
|
292
278
|
});
|
|
293
279
|
confirmationRequest
|
|
@@ -299,16 +285,15 @@ const getControlRelatedStandards = (id, token) => {
|
|
|
299
285
|
});
|
|
300
286
|
});
|
|
301
287
|
};
|
|
302
|
-
exports.getControlRelatedStandards = getControlRelatedStandards;
|
|
303
288
|
/**
|
|
304
289
|
* Get the control related policies
|
|
305
290
|
* @param {String} id The control id
|
|
306
291
|
* @param {String} token Authorization token
|
|
307
292
|
* @returns {Promise<object>}
|
|
308
293
|
*/
|
|
309
|
-
const getControlRelatedPolicies = (id, token) => {
|
|
294
|
+
export const getControlRelatedPolicies = (id, token) => {
|
|
310
295
|
return new Promise((resolve, reject) => {
|
|
311
|
-
const confirmationRequest =
|
|
296
|
+
const confirmationRequest = client.get(`/api/v1/controls/policies/${id}`, {
|
|
312
297
|
headers: { authorization: token },
|
|
313
298
|
});
|
|
314
299
|
confirmationRequest
|
|
@@ -320,5 +305,4 @@ const getControlRelatedPolicies = (id, token) => {
|
|
|
320
305
|
});
|
|
321
306
|
});
|
|
322
307
|
};
|
|
323
|
-
exports.getControlRelatedPolicies = getControlRelatedPolicies;
|
|
324
308
|
//# sourceMappingURL=control.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../../src/lib/control.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../../src/lib/control.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,KAAa,EAAmB,EAAE;IAC5E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CACpC,kBAAkB,EAClB,EAAE,IAAI,EAAE,IAAI,EAAE,EACd;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CACF,CAAC;QACF,mBAAmB;aAChB,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,WAAqB,EACrB,KAAa,EACI,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,WAAW,GAAG;YAClB,WAAW,EAAE,WAAW;SACzB,CAAC;QACF,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CACpC,sCAAsC,EACtC,WAAW,EACX;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CACF,CAAC;QACF,mBAAmB;aAChB,IAAI,CA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
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getControlTemplateRelatedRequirementTemplates = exports.getControlTemplateRelatedStandardTemplates = exports.getControlTemplateRelatedPolicyTemplates = exports.setControlTemplateTags = exports.setControlTemplateInformation = exports.publishControlTemplate = exports.getControlTemplateList = exports.getControlTemplateInformationById = exports.discardControlTemplateChanges = exports.deleteControlTemplate = exports.createControlTemplate = void 0;
|
|
4
|
-
const axiosClient_js_1 = require("./axiosClient.js");
|
|
1
|
+
import { client } from "./axiosClient.js";
|
|
5
2
|
/**
|
|
6
3
|
* Create control template and set information
|
|
7
4
|
* @param {Object} data
|
|
8
5
|
* @param {String} token Authorization token
|
|
9
6
|
* @returns {Promise<object>}
|
|
10
7
|
*/
|
|
11
|
-
const createControlTemplate = (data, token) => {
|
|
8
|
+
export const createControlTemplate = (data, token) => {
|
|
12
9
|
return new Promise((resolve, reject) => {
|
|
13
10
|
const requestData = {
|
|
14
11
|
data: data,
|
|
15
12
|
};
|
|
16
|
-
const confirmationRequest =
|
|
13
|
+
const confirmationRequest = client.put("/api/v1/controltemplates", requestData, {
|
|
17
14
|
headers: { authorization: token },
|
|
18
15
|
});
|
|
19
16
|
confirmationRequest
|
|
@@ -25,7 +22,6 @@ const createControlTemplate = (data, token) => {
|
|
|
25
22
|
});
|
|
26
23
|
});
|
|
27
24
|
};
|
|
28
|
-
exports.createControlTemplate = createControlTemplate;
|
|
29
25
|
/**
|
|
30
26
|
* Delete control template
|
|
31
27
|
* @param {number} id The id of the template to be deleted
|
|
@@ -33,14 +29,14 @@ exports.createControlTemplate = createControlTemplate;
|
|
|
33
29
|
* @param {String} token Authorization token
|
|
34
30
|
* @returns {Promise<object>}
|
|
35
31
|
*/
|
|
36
|
-
const deleteControlTemplate = (id, comments, token) => {
|
|
32
|
+
export const deleteControlTemplate = (id, comments, token) => {
|
|
37
33
|
const data = {
|
|
38
34
|
id: id,
|
|
39
35
|
};
|
|
40
36
|
if (comments)
|
|
41
37
|
data.comments = comments;
|
|
42
38
|
return new Promise((resolve, reject) => {
|
|
43
|
-
const request =
|
|
39
|
+
const request = client.delete(`/api/v1/controltemplates/`, {
|
|
44
40
|
headers: { authorization: token },
|
|
45
41
|
data: data,
|
|
46
42
|
});
|
|
@@ -53,17 +49,16 @@ const deleteControlTemplate = (id, comments, token) => {
|
|
|
53
49
|
});
|
|
54
50
|
});
|
|
55
51
|
};
|
|
56
|
-
exports.deleteControlTemplate = deleteControlTemplate;
|
|
57
52
|
/**
|
|
58
53
|
* Discard the control template draft changes
|
|
59
54
|
* @param {String} id The id of the control template to be discarded
|
|
60
55
|
* @param {String} token Authorization token
|
|
61
56
|
* @returns {Promise<object>}
|
|
62
57
|
*/
|
|
63
|
-
const discardControlTemplateChanges = (id, token) => {
|
|
58
|
+
export const discardControlTemplateChanges = (id, token) => {
|
|
64
59
|
return new Promise((resolve, reject) => {
|
|
65
60
|
const data = {};
|
|
66
|
-
const request =
|
|
61
|
+
const request = client.get(`/api/v1/controltemplates/discard/${id}`, {
|
|
67
62
|
headers: { authorization: token },
|
|
68
63
|
data: data,
|
|
69
64
|
});
|
|
@@ -76,7 +71,6 @@ const discardControlTemplateChanges = (id, token) => {
|
|
|
76
71
|
});
|
|
77
72
|
});
|
|
78
73
|
};
|
|
79
|
-
exports.discardControlTemplateChanges = discardControlTemplateChanges;
|
|
80
74
|
/**
|
|
81
75
|
* Get control template information
|
|
82
76
|
* @param {String} id The id of the template
|
|
@@ -85,9 +79,9 @@ exports.discardControlTemplateChanges = discardControlTemplateChanges;
|
|
|
85
79
|
* @param {String} token Authorization token
|
|
86
80
|
* @returns {Promise<object>}
|
|
87
81
|
*/
|
|
88
|
-
const getControlTemplateInformationById = (id, version, returnNullIfVersionNotFound, token) => {
|
|
82
|
+
export const getControlTemplateInformationById = (id, version, returnNullIfVersionNotFound, token) => {
|
|
89
83
|
return new Promise((resolve, reject) => {
|
|
90
|
-
const confirmationRequest =
|
|
84
|
+
const confirmationRequest = client.get(`/api/v1/controltemplates/${id}/${version}/${returnNullIfVersionNotFound}`, {
|
|
91
85
|
headers: { authorization: token },
|
|
92
86
|
});
|
|
93
87
|
confirmationRequest
|
|
@@ -99,7 +93,6 @@ const getControlTemplateInformationById = (id, version, returnNullIfVersionNotFo
|
|
|
99
93
|
});
|
|
100
94
|
});
|
|
101
95
|
};
|
|
102
|
-
exports.getControlTemplateInformationById = getControlTemplateInformationById;
|
|
103
96
|
/**
|
|
104
97
|
* Get control template list
|
|
105
98
|
* @param {Array<String>} filter The filter used to select the template
|
|
@@ -109,7 +102,7 @@ exports.getControlTemplateInformationById = getControlTemplateInformationById;
|
|
|
109
102
|
* @param {String} token Authorization token
|
|
110
103
|
* @returns {Promise<object>}
|
|
111
104
|
*/
|
|
112
|
-
const getControlTemplateList = (filter, version, includeDeleted, details, token) => {
|
|
105
|
+
export const getControlTemplateList = (filter, version, includeDeleted, details, token) => {
|
|
113
106
|
return new Promise((resolve, reject) => {
|
|
114
107
|
const requestData = {
|
|
115
108
|
includeDeleted: includeDeleted,
|
|
@@ -118,7 +111,7 @@ const getControlTemplateList = (filter, version, includeDeleted, details, token)
|
|
|
118
111
|
};
|
|
119
112
|
if (filter)
|
|
120
113
|
requestData.filter = filter;
|
|
121
|
-
const confirmationRequest =
|
|
114
|
+
const confirmationRequest = client.post(`/api/v1/controltemplates`, requestData, {
|
|
122
115
|
headers: { authorization: token },
|
|
123
116
|
});
|
|
124
117
|
confirmationRequest
|
|
@@ -130,7 +123,6 @@ const getControlTemplateList = (filter, version, includeDeleted, details, token)
|
|
|
130
123
|
});
|
|
131
124
|
});
|
|
132
125
|
};
|
|
133
|
-
exports.getControlTemplateList = getControlTemplateList;
|
|
134
126
|
/**
|
|
135
127
|
* Publish control template
|
|
136
128
|
* @param {number} id The id of the template to be published
|
|
@@ -138,12 +130,12 @@ exports.getControlTemplateList = getControlTemplateList;
|
|
|
138
130
|
* @param {String} token Authorization token
|
|
139
131
|
* @returns {Promise<object>}
|
|
140
132
|
*/
|
|
141
|
-
const publishControlTemplate = (id, comments, token) => {
|
|
133
|
+
export const publishControlTemplate = (id, comments, token) => {
|
|
142
134
|
return new Promise((resolve, reject) => {
|
|
143
135
|
const data = {};
|
|
144
136
|
if (comments)
|
|
145
137
|
data.comments = comments;
|
|
146
|
-
const confirmationRequest =
|
|
138
|
+
const confirmationRequest = client.post(`/api/v1/controltemplates/publish/${id}`, data, {
|
|
147
139
|
headers: { authorization: token },
|
|
148
140
|
});
|
|
149
141
|
confirmationRequest
|
|
@@ -155,7 +147,6 @@ const publishControlTemplate = (id, comments, token) => {
|
|
|
155
147
|
});
|
|
156
148
|
});
|
|
157
149
|
};
|
|
158
|
-
exports.publishControlTemplate = publishControlTemplate;
|
|
159
150
|
/**
|
|
160
151
|
* Set control template information
|
|
161
152
|
* @param {String} id The id of the template to be updated
|
|
@@ -163,13 +154,13 @@ exports.publishControlTemplate = publishControlTemplate;
|
|
|
163
154
|
* @param {String} token Authorization token
|
|
164
155
|
* @returns {Promise<object>}
|
|
165
156
|
*/
|
|
166
|
-
const setControlTemplateInformation = (id, data, token) => {
|
|
157
|
+
export const setControlTemplateInformation = (id, data, token) => {
|
|
167
158
|
return new Promise((resolve, reject) => {
|
|
168
159
|
const requestData = {
|
|
169
160
|
data: data,
|
|
170
161
|
id: id,
|
|
171
162
|
};
|
|
172
|
-
const confirmationRequest =
|
|
163
|
+
const confirmationRequest = client.post(`/api/v1/controltemplates/update`, requestData, {
|
|
173
164
|
headers: { authorization: token },
|
|
174
165
|
});
|
|
175
166
|
confirmationRequest
|
|
@@ -181,7 +172,6 @@ const setControlTemplateInformation = (id, data, token) => {
|
|
|
181
172
|
});
|
|
182
173
|
});
|
|
183
174
|
};
|
|
184
|
-
exports.setControlTemplateInformation = setControlTemplateInformation;
|
|
185
175
|
/**
|
|
186
176
|
* Update the control template tags
|
|
187
177
|
* @param {String} id The id of the template to be updated
|
|
@@ -189,13 +179,13 @@ exports.setControlTemplateInformation = setControlTemplateInformation;
|
|
|
189
179
|
* @param {String} token Authorization token
|
|
190
180
|
* @returns {Promise<object>}
|
|
191
181
|
*/
|
|
192
|
-
const setControlTemplateTags = (id, tags, token) => {
|
|
182
|
+
export const setControlTemplateTags = (id, tags, token) => {
|
|
193
183
|
return new Promise((resolve, reject) => {
|
|
194
184
|
const requestData = {
|
|
195
185
|
tags: tags,
|
|
196
186
|
id: id,
|
|
197
187
|
};
|
|
198
|
-
const confirmationRequest =
|
|
188
|
+
const confirmationRequest = client.post(`/api/v1/controltemplates/updatetags`, requestData, {
|
|
199
189
|
headers: { authorization: token },
|
|
200
190
|
});
|
|
201
191
|
confirmationRequest
|
|
@@ -207,16 +197,15 @@ const setControlTemplateTags = (id, tags, token) => {
|
|
|
207
197
|
});
|
|
208
198
|
});
|
|
209
199
|
};
|
|
210
|
-
exports.setControlTemplateTags = setControlTemplateTags;
|
|
211
200
|
/**
|
|
212
201
|
* Get the control template related policy templates
|
|
213
202
|
* @param {String} id The control template id
|
|
214
203
|
* @param {String} token Authorization token
|
|
215
204
|
* @returns {Promise<object>}
|
|
216
205
|
*/
|
|
217
|
-
const getControlTemplateRelatedPolicyTemplates = (id, token) => {
|
|
206
|
+
export const getControlTemplateRelatedPolicyTemplates = (id, token) => {
|
|
218
207
|
return new Promise((resolve, reject) => {
|
|
219
|
-
const confirmationRequest =
|
|
208
|
+
const confirmationRequest = client.get(`/api/v1/controltemplates/policytemplates/${id}`, {
|
|
220
209
|
headers: { authorization: token },
|
|
221
210
|
});
|
|
222
211
|
confirmationRequest
|
|
@@ -228,16 +217,15 @@ const getControlTemplateRelatedPolicyTemplates = (id, token) => {
|
|
|
228
217
|
});
|
|
229
218
|
});
|
|
230
219
|
};
|
|
231
|
-
exports.getControlTemplateRelatedPolicyTemplates = getControlTemplateRelatedPolicyTemplates;
|
|
232
220
|
/**
|
|
233
221
|
* Get the control template related standard templates
|
|
234
222
|
* @param {String} id The control template id
|
|
235
223
|
* @param {String} token Authorization token
|
|
236
224
|
* @returns {Promise<object>}
|
|
237
225
|
*/
|
|
238
|
-
const getControlTemplateRelatedStandardTemplates = (id, token) => {
|
|
226
|
+
export const getControlTemplateRelatedStandardTemplates = (id, token) => {
|
|
239
227
|
return new Promise((resolve, reject) => {
|
|
240
|
-
const confirmationRequest =
|
|
228
|
+
const confirmationRequest = client.get(`/api/v1/controltemplates/standardtemplates/${id}`, {
|
|
241
229
|
headers: { authorization: token },
|
|
242
230
|
});
|
|
243
231
|
confirmationRequest
|
|
@@ -249,16 +237,15 @@ const getControlTemplateRelatedStandardTemplates = (id, token) => {
|
|
|
249
237
|
});
|
|
250
238
|
});
|
|
251
239
|
};
|
|
252
|
-
exports.getControlTemplateRelatedStandardTemplates = getControlTemplateRelatedStandardTemplates;
|
|
253
240
|
/**
|
|
254
241
|
* Get the control template related requirement templates
|
|
255
242
|
* @param {String} id The control template id
|
|
256
243
|
* @param {String} token Authorization token
|
|
257
244
|
* @returns {Promise<object>}
|
|
258
245
|
*/
|
|
259
|
-
const getControlTemplateRelatedRequirementTemplates = (id, token) => {
|
|
246
|
+
export const getControlTemplateRelatedRequirementTemplates = (id, token) => {
|
|
260
247
|
return new Promise((resolve, reject) => {
|
|
261
|
-
const confirmationRequest =
|
|
248
|
+
const confirmationRequest = client.get(`/api/v1/controltemplates/requirementtemplates/${id}`, {
|
|
262
249
|
headers: { authorization: token },
|
|
263
250
|
});
|
|
264
251
|
confirmationRequest
|
|
@@ -270,5 +257,4 @@ const getControlTemplateRelatedRequirementTemplates = (id, token) => {
|
|
|
270
257
|
});
|
|
271
258
|
});
|
|
272
259
|
};
|
|
273
|
-
exports.getControlTemplateRelatedRequirementTemplates = getControlTemplateRelatedRequirementTemplates;
|
|
274
260
|
//# sourceMappingURL=controlTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controlTemplate.js","sourceRoot":"","sources":["../../../src/lib/controlTemplate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"controlTemplate.js","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,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CACpC,8CAA8C,EAAE,EAAE,EAClD;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CACF,CAAC;QACF,mBAAmB;aAChB,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,6CAA6C,GAAG,CAC3D,EAAU,EACV,KAAa,EACI,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CACpC,iDAAiD,EAAE,EAAE,EACrD;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CACF,CAAC;QACF,mBAAmB;aAChB,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getByElementType = void 0;
|
|
4
|
-
const axiosClient_js_1 = require("./axiosClient.js");
|
|
1
|
+
import { client } from "./axiosClient.js";
|
|
5
2
|
/**
|
|
6
3
|
* Get custom fields by element type
|
|
7
4
|
* @param {CustomFieldElementType} elementType The element type to retrieve custom fields for
|
|
8
5
|
* @param {String} token Authorization token
|
|
9
6
|
* @returns {Promise<object>}
|
|
10
7
|
*/
|
|
11
|
-
const getByElementType = (elementType, token) => {
|
|
8
|
+
export const getByElementType = (elementType, token) => {
|
|
12
9
|
return new Promise((resolve, reject) => {
|
|
13
|
-
const request =
|
|
10
|
+
const request = client.get(`/api/v1/customfields/${encodeURIComponent(elementType)}`, {
|
|
14
11
|
headers: { authorization: token },
|
|
15
12
|
});
|
|
16
13
|
request
|
|
@@ -22,5 +19,4 @@ const getByElementType = (elementType, token) => {
|
|
|
22
19
|
});
|
|
23
20
|
});
|
|
24
21
|
};
|
|
25
|
-
exports.getByElementType = getByElementType;
|
|
26
22
|
//# sourceMappingURL=customFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customFields.js","sourceRoot":"","sources":["../../../src/lib/customFields.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customFields.js","sourceRoot":"","sources":["../../../src/lib/customFields.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAU1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,WAAmC,EACnC,KAAa,EACI,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CACxB,wBAAwB,kBAAkB,CAAC,WAAW,CAAC,EAAE,EACzD;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CACF,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|