@frontegg/rest-api 3.1.78 → 3.1.79-alpha.9987430273
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/BaseApiClient.d.ts +16 -0
- package/BaseApiClient.js +39 -0
- package/ContextHolder/index.d.ts +113 -28
- package/ContextHolder/index.js +163 -54
- package/FetchClient.d.ts +42 -0
- package/FetchClient.js +308 -0
- package/account-settings/index.d.ts +19 -7
- package/account-settings/index.js +23 -13
- package/applications/index.d.ts +49 -44
- package/applications/index.js +51 -37
- package/audits/index.d.ts +27 -15
- package/audits/index.js +27 -17
- package/auth/index.d.ts +817 -768
- package/auth/index.js +902 -721
- package/auth/secutiry-poilicy/index.d.ts +58 -102
- package/auth/secutiry-poilicy/index.js +122 -90
- package/auth/utils.d.ts +2 -2
- package/auth/utils.js +9 -8
- package/connectivity/index.d.ts +126 -27
- package/connectivity/index.js +147 -114
- package/directory/index.d.ts +31 -22
- package/directory/index.js +27 -15
- package/entitlements/index.d.ts +14 -8
- package/entitlements/index.js +12 -4
- package/feature-flags/index.d.ts +8 -2
- package/feature-flags/index.js +16 -8
- package/groups/index.d.ts +73 -49
- package/groups/index.js +64 -45
- package/impersonate/index.d.ts +15 -6
- package/impersonate/index.js +13 -5
- package/index.d.ts +154 -108
- package/index.js +109 -78
- package/interfaces.d.ts +10 -0
- package/metadata/index.d.ts +67 -7
- package/metadata/index.js +52 -32
- package/node/BaseApiClient.js +49 -0
- package/node/ContextHolder/index.js +163 -54
- package/node/FetchClient.js +326 -0
- package/node/account-settings/index.js +27 -16
- package/node/applications/index.js +51 -44
- package/node/audits/index.js +31 -20
- package/node/auth/index.js +768 -1035
- package/node/auth/secutiry-poilicy/index.js +125 -136
- package/node/auth/utils.js +9 -7
- package/node/connectivity/index.js +148 -187
- package/node/directory/index.js +29 -20
- package/node/entitlements/index.js +18 -5
- package/node/feature-flags/index.js +21 -9
- package/node/groups/index.js +65 -63
- package/node/impersonate/index.js +18 -5
- package/node/index.js +116 -71
- package/node/metadata/index.js +61 -52
- package/node/notifications/index.js +37 -27
- package/node/reports/index.js +78 -70
- package/node/roles/index.js +56 -51
- package/node/security-center/index.js +21 -9
- package/node/sub-tenants/index.js +90 -89
- package/node/subscriptions/index.js +69 -107
- package/node/subscriptions/invoices.js +25 -17
- package/node/subscriptions/managedSubscriptions.js +32 -27
- package/node/subscriptions/paymentMethods.js +27 -20
- package/node/subscriptions/paymentProviders.js +15 -6
- package/node/subscriptions/plans.js +17 -9
- package/node/subscriptions/providers/stripe/index.js +26 -21
- package/node/subscriptions/subscriptions.js +32 -27
- package/node/subscriptions/summaries.js +15 -6
- package/node/subscriptions/tenantConfiguration.js +17 -9
- package/node/subscriptions/vendorPublicConfigurations.js +15 -6
- package/node/teams/index.js +138 -148
- package/node/tenants/index.js +65 -60
- package/node/user-phone-numbers/index.js +32 -24
- package/node/users/index.js +58 -53
- package/node/vendor/index.js +17 -6
- package/notifications/index.d.ts +22 -16
- package/notifications/index.js +33 -22
- package/package.json +1 -1
- package/reports/index.d.ts +50 -44
- package/reports/index.js +75 -62
- package/roles/index.d.ts +44 -38
- package/roles/index.js +57 -41
- package/security-center/index.d.ts +14 -2
- package/security-center/index.js +15 -6
- package/sub-tenants/index.d.ts +57 -15
- package/sub-tenants/index.js +88 -68
- package/subscriptions/index.d.ts +56 -11
- package/subscriptions/index.js +58 -11
- package/subscriptions/invoices.d.ts +16 -13
- package/subscriptions/invoices.js +24 -14
- package/subscriptions/managedSubscriptions.d.ts +18 -15
- package/subscriptions/managedSubscriptions.js +33 -22
- package/subscriptions/paymentMethods.d.ts +16 -13
- package/subscriptions/paymentMethods.js +26 -17
- package/subscriptions/paymentProviders.d.ts +8 -5
- package/subscriptions/paymentProviders.js +11 -4
- package/subscriptions/plans.d.ts +11 -8
- package/subscriptions/plans.js +14 -6
- package/subscriptions/providers/stripe/index.d.ts +24 -21
- package/subscriptions/providers/stripe/index.js +27 -16
- package/subscriptions/subscriptions.d.ts +24 -21
- package/subscriptions/subscriptions.js +33 -22
- package/subscriptions/summaries.d.ts +7 -4
- package/subscriptions/summaries.js +10 -3
- package/subscriptions/tenantConfiguration.d.ts +6 -3
- package/subscriptions/tenantConfiguration.js +15 -7
- package/subscriptions/vendorPublicConfigurations.d.ts +5 -2
- package/subscriptions/vendorPublicConfigurations.js +11 -4
- package/teams/index.d.ts +37 -139
- package/teams/index.js +130 -99
- package/tenants/index.d.ts +25 -37
- package/tenants/index.js +62 -46
- package/user-phone-numbers/index.d.ts +32 -26
- package/user-phone-numbers/index.js +32 -19
- package/users/index.d.ts +21 -15
- package/users/index.js +60 -44
- package/vendor/index.d.ts +12 -6
- package/vendor/index.js +11 -4
- package/fetch.d.ts +0 -24
- package/fetch.js +0 -265
- package/node/fetch.js +0 -306
- package/node/subscriptions/providers/index.js +0 -18
- package/subscriptions/providers/index.d.ts +0 -1
- package/subscriptions/providers/index.js +0 -1
package/node/metadata/index.js
CHANGED
|
@@ -3,60 +3,69 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
exports.default = exports.MetadataApi = void 0;
|
|
7
|
+
|
|
8
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
9
|
+
|
|
10
|
+
class MetadataApi extends _BaseApiClient.BaseApiClient {
|
|
11
|
+
constructor(appName) {
|
|
12
|
+
super(appName);
|
|
13
|
+
|
|
14
|
+
this.getMetadata = async body => {
|
|
15
|
+
var _data$rows, _data$rows2;
|
|
16
|
+
|
|
17
|
+
const data = await this.get('/metadata', body);
|
|
18
|
+
if (data != null && (_data$rows = data.rows) != null && _data$rows[0]) return data == null ? void 0 : (_data$rows2 = data.rows) == null ? void 0 : _data$rows2[0];
|
|
19
|
+
throw new Error(`metadata not found: ${body.entityName}`);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
this.getAdminBoxMetadata = async () => {
|
|
23
|
+
return this.get('/metadata/admin-box');
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
this.updateAdminBoxMetadata = async body => {
|
|
27
|
+
return this.post('/metadata/admin-box', body);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
this.getIpMetadata = async ip => {
|
|
31
|
+
const data = await this.get(`/metadata/ip/${ip}`);
|
|
32
|
+
if (data) return data;
|
|
33
|
+
throw new Error(`ip metadata not found`);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
this.getCurrentUserIpMetadata = async () => {
|
|
37
|
+
const data = await this.get(`/metadata/ipme`);
|
|
38
|
+
if (data) return data;
|
|
39
|
+
throw new Error(`ip metadata not found`);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
this.getNotificationsMetadata = async () => {
|
|
43
|
+
return this.getMetadata({
|
|
44
|
+
entityName: 'notifications'
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
this.getSamlMetadata = async () => {
|
|
49
|
+
return this.getMetadata({
|
|
50
|
+
entityName: 'saml'
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
this.getAuditsMetadata = async () => {
|
|
55
|
+
return this.getMetadata({
|
|
56
|
+
entityName: 'audits'
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
this.getIpAdressMetadata = async ip => {
|
|
61
|
+
return this.getIpMetadata(ip);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
11
64
|
|
|
12
|
-
var _fetch = require("../fetch");
|
|
13
|
-
|
|
14
|
-
async function getMetadata(body) {
|
|
15
|
-
var _data$rows, _data$rows2;
|
|
16
|
-
|
|
17
|
-
const data = await (0, _fetch.Get)('/metadata', body);
|
|
18
|
-
if (data != null && (_data$rows = data.rows) != null && _data$rows[0]) return data == null ? void 0 : (_data$rows2 = data.rows) == null ? void 0 : _data$rows2[0];
|
|
19
|
-
throw new Error(`metadata not found: ${body.entityName}`);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async function getAdminBoxMetadata() {
|
|
23
|
-
return (0, _fetch.Get)('/metadata/admin-box');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async function updateAdminBoxMetadata(body) {
|
|
27
|
-
return (0, _fetch.Post)('/metadata/admin-box', body);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async function getIpMetadata(ip) {
|
|
31
|
-
const data = await (0, _fetch.Get)(`/metadata/ip/${ip}`);
|
|
32
|
-
if (data) return data;
|
|
33
|
-
throw new Error(`ip metadata not found`);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async function getCurrentUserIpMetadata() {
|
|
37
|
-
const data = await (0, _fetch.Get)(`/metadata/ipme`);
|
|
38
|
-
if (data) return data;
|
|
39
|
-
throw new Error(`ip metadata not found`);
|
|
40
65
|
}
|
|
41
66
|
|
|
42
|
-
|
|
43
|
-
entityName: 'notifications'
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
exports.getNotificationsMetadata = getNotificationsMetadata;
|
|
47
|
-
|
|
48
|
-
const getSamlMetadata = async () => getMetadata({
|
|
49
|
-
entityName: 'saml'
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
exports.getSamlMetadata = getSamlMetadata;
|
|
53
|
-
|
|
54
|
-
const getAuditsMetadata = async () => getMetadata({
|
|
55
|
-
entityName: 'audits'
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
exports.getAuditsMetadata = getAuditsMetadata;
|
|
67
|
+
exports.MetadataApi = MetadataApi;
|
|
59
68
|
|
|
60
|
-
|
|
69
|
+
var _default = new MetadataApi('default');
|
|
61
70
|
|
|
62
|
-
exports.
|
|
71
|
+
exports.default = _default;
|
|
@@ -3,37 +3,47 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.markAllAsRead = markAllAsRead;
|
|
8
|
-
exports.updateNotificationIsPinned = updateNotificationIsPinned;
|
|
9
|
-
exports.updateNotificationStatus = updateNotificationStatus;
|
|
10
|
-
|
|
11
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.default = exports.NotificationsApi = void 0;
|
|
12
7
|
|
|
13
8
|
var _constants = require("../constants");
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
return (0, _fetch.Get)(_constants.urls.notifications.v1, {
|
|
17
|
-
params
|
|
18
|
-
});
|
|
19
|
-
}
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
20
11
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
class NotificationsApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(appName) {
|
|
14
|
+
super(appName);
|
|
15
|
+
|
|
16
|
+
this.getNotifications = async params => {
|
|
17
|
+
return this.get(_constants.urls.notifications.v1, {
|
|
18
|
+
params
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
this.updateNotificationStatus = async params => {
|
|
23
|
+
return this.put(`${_constants.urls.notifications.v1}/status`, {
|
|
24
|
+
params
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
this.updateNotificationIsPinned = async params => {
|
|
29
|
+
const {
|
|
30
|
+
notificationId,
|
|
31
|
+
pinStatus
|
|
32
|
+
} = params;
|
|
33
|
+
return this.put(`${_constants.urls.notifications.v1}/${pinStatus}`, {
|
|
34
|
+
notificationId
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
this.markAllAsRead = async () => {
|
|
39
|
+
return this.post(`${_constants.urls.notifications.v1}/status/mark-all-read`);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
26
42
|
|
|
27
|
-
async function updateNotificationIsPinned(params) {
|
|
28
|
-
const {
|
|
29
|
-
notificationId,
|
|
30
|
-
pinStatus
|
|
31
|
-
} = params;
|
|
32
|
-
return (0, _fetch.Put)(`${_constants.urls.notifications.v1}/${pinStatus}`, {
|
|
33
|
-
notificationId
|
|
34
|
-
});
|
|
35
43
|
}
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
exports.NotificationsApi = NotificationsApi;
|
|
46
|
+
|
|
47
|
+
var _default = new NotificationsApi('default');
|
|
48
|
+
|
|
49
|
+
exports.default = _default;
|
package/node/reports/index.js
CHANGED
|
@@ -5,92 +5,100 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
exports.getReport = getReport;
|
|
10
|
-
exports.getReports = getReports;
|
|
11
|
-
exports.renderReport = renderReport;
|
|
12
|
-
exports.scheduleReport = scheduleReport;
|
|
13
|
-
exports.sendReport = sendReport;
|
|
8
|
+
exports.default = exports.ReportsApi = void 0;
|
|
14
9
|
|
|
15
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
11
|
|
|
17
12
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
18
13
|
|
|
19
|
-
var _fetch = require("../fetch");
|
|
20
|
-
|
|
21
14
|
var _constants = require("../constants");
|
|
22
15
|
|
|
16
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
17
|
+
|
|
23
18
|
const _excluded = ["dataFilters"],
|
|
24
19
|
_excluded2 = ["templateId", "dataFilters"],
|
|
25
20
|
_excluded3 = ["dataFilters"];
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
class ReportsApi extends _BaseApiClient.BaseApiClient {
|
|
23
|
+
constructor(appName) {
|
|
24
|
+
super(appName);
|
|
30
25
|
|
|
31
|
-
async
|
|
32
|
-
|
|
33
|
-
}
|
|
26
|
+
this.getReports = async body => {
|
|
27
|
+
return this.get(`${_constants.urls.reports.service.v2}/tenant-reports`, body);
|
|
28
|
+
};
|
|
34
29
|
|
|
35
|
-
async
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} = _ref,
|
|
39
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
40
|
-
const html = await (0, _fetch.Get)(`${_constants.urls.reports.trigger.v1}/preview-report`, (0, _extends2.default)({}, body, {
|
|
41
|
-
dataFilters: btoa(JSON.stringify(dataFilters || {})),
|
|
42
|
-
responseType: 'html'
|
|
43
|
-
}), {
|
|
44
|
-
responseType: 'plain'
|
|
45
|
-
});
|
|
46
|
-
return {
|
|
47
|
-
html
|
|
48
|
-
};
|
|
49
|
-
}
|
|
30
|
+
this.getReport = async body => {
|
|
31
|
+
return this.get(`${_constants.urls.reports.service.v2}/${body.id}/tenant-reports`);
|
|
32
|
+
};
|
|
50
33
|
|
|
51
|
-
async
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
34
|
+
this.renderReport = async _ref => {
|
|
35
|
+
let {
|
|
36
|
+
dataFilters
|
|
37
|
+
} = _ref,
|
|
38
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
39
|
+
const html = await this.get(`${_constants.urls.reports.trigger.v1}/preview-report`, (0, _extends2.default)({}, body, {
|
|
40
|
+
dataFilters: btoa(JSON.stringify(dataFilters || {})),
|
|
41
|
+
responseType: 'html'
|
|
42
|
+
}), {
|
|
43
|
+
responseType: 'plain'
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
html
|
|
47
|
+
};
|
|
48
|
+
};
|
|
61
49
|
|
|
62
|
-
async
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
50
|
+
this.scheduleReport = async _ref2 => {
|
|
51
|
+
let {
|
|
52
|
+
templateId,
|
|
53
|
+
dataFilters
|
|
54
|
+
} = _ref2,
|
|
55
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
|
|
56
|
+
return this.post(`${_constants.urls.reports.service.v2}/${templateId}/tenant-reports`, (0, _extends2.default)({}, body, {
|
|
57
|
+
dataFilters: btoa(JSON.stringify(dataFilters || {}))
|
|
58
|
+
}));
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
this.downloadReport = async _ref3 => {
|
|
62
|
+
let {
|
|
63
|
+
dataFilters
|
|
64
|
+
} = _ref3,
|
|
65
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded3);
|
|
66
|
+
const blob = await this.get(`${_constants.urls.reports.trigger.v1}/preview-report`, (0, _extends2.default)({}, body, {
|
|
67
|
+
dataFilters: btoa(JSON.stringify(dataFilters || {}))
|
|
68
|
+
}), {
|
|
69
|
+
responseType: 'blob'
|
|
70
|
+
});
|
|
71
|
+
let contentType = 'text/html';
|
|
72
|
+
let contentExt = 'html';
|
|
73
|
+
|
|
74
|
+
if (body.responseType === 'pdf') {
|
|
75
|
+
contentType = 'application/pdf';
|
|
76
|
+
contentExt = 'pdf';
|
|
77
|
+
} else if (body.responseType === 'image') {
|
|
78
|
+
contentType = 'image/jpeg';
|
|
79
|
+
contentExt = 'jpg';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const newBlob = new Blob([blob], {
|
|
83
|
+
type: contentType
|
|
84
|
+
});
|
|
85
|
+
const fileURL = URL.createObjectURL(newBlob);
|
|
86
|
+
const tempLink = document.createElement('a');
|
|
87
|
+
tempLink.href = fileURL;
|
|
88
|
+
tempLink.setAttribute('download', `report_${body.name || ''}.${contentExt}`);
|
|
89
|
+
tempLink.click();
|
|
90
|
+
setTimeout(tempLink.remove.bind(tempLink));
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
this.sendReport = async body => {
|
|
94
|
+
return this.post(`${_constants.urls.reports.trigger.v1}/tenant-reports`, body);
|
|
95
|
+
};
|
|
81
96
|
}
|
|
82
97
|
|
|
83
|
-
const newBlob = new Blob([blob], {
|
|
84
|
-
type: contentType
|
|
85
|
-
});
|
|
86
|
-
const fileURL = URL.createObjectURL(newBlob);
|
|
87
|
-
const tempLink = document.createElement('a');
|
|
88
|
-
tempLink.href = fileURL;
|
|
89
|
-
tempLink.setAttribute('download', `report_${body.name || ''}.${contentExt}`);
|
|
90
|
-
tempLink.click();
|
|
91
|
-
setTimeout(tempLink.remove.bind(tempLink));
|
|
92
98
|
}
|
|
93
99
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
exports.ReportsApi = ReportsApi;
|
|
101
|
+
|
|
102
|
+
var _default = new ReportsApi('default');
|
|
103
|
+
|
|
104
|
+
exports.default = _default;
|
package/node/roles/index.js
CHANGED
|
@@ -5,72 +5,77 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
exports.addRoleV2 = addRoleV2;
|
|
10
|
-
exports.attachPermissionToRoles = attachPermissionToRoles;
|
|
11
|
-
exports.attachPermissionsToRole = attachPermissionsToRole;
|
|
12
|
-
exports.deleteRole = deleteRole;
|
|
13
|
-
exports.getPermissionCategories = getPermissionCategories;
|
|
14
|
-
exports.getPermissions = getPermissions;
|
|
15
|
-
exports.getRoles = getRoles;
|
|
16
|
-
exports.updateRole = updateRole;
|
|
8
|
+
exports.default = exports.RolesApi = void 0;
|
|
17
9
|
|
|
18
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
19
11
|
|
|
20
|
-
var _fetch = require("../fetch");
|
|
21
|
-
|
|
22
12
|
var _constants = require("../constants");
|
|
23
13
|
|
|
14
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
15
|
+
|
|
24
16
|
const _excluded = ["roleId"],
|
|
25
17
|
_excluded2 = ["roleId"],
|
|
26
18
|
_excluded3 = ["permissionId"];
|
|
27
19
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
class RolesApi extends _BaseApiClient.BaseApiClient {
|
|
21
|
+
constructor(appName) {
|
|
22
|
+
super(appName);
|
|
31
23
|
|
|
32
|
-
async
|
|
33
|
-
|
|
34
|
-
}
|
|
24
|
+
this.getRoles = async () => {
|
|
25
|
+
return this.get(_constants.urls.identity.roles.v1);
|
|
26
|
+
};
|
|
35
27
|
|
|
36
|
-
async
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
return (0, _fetch.Delete)(`${_constants.urls.identity.roles.v1}/${roleId}`);
|
|
40
|
-
}
|
|
28
|
+
this.addRole = async body => {
|
|
29
|
+
return this.post(_constants.urls.identity.roles.v1, body);
|
|
30
|
+
};
|
|
41
31
|
|
|
42
|
-
async
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return (0, _fetch.Patch)(`${_constants.urls.identity.roles.v1}/${roleId}`, body);
|
|
48
|
-
}
|
|
32
|
+
this.deleteRole = async ({
|
|
33
|
+
roleId
|
|
34
|
+
}) => {
|
|
35
|
+
return this.delete(`${_constants.urls.identity.roles.v1}/${roleId}`);
|
|
36
|
+
};
|
|
49
37
|
|
|
50
|
-
async
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
38
|
+
this.updateRole = async _ref => {
|
|
39
|
+
let {
|
|
40
|
+
roleId
|
|
41
|
+
} = _ref,
|
|
42
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
43
|
+
return this.patch(`${_constants.urls.identity.roles.v1}/${roleId}`, body);
|
|
44
|
+
};
|
|
57
45
|
|
|
58
|
-
async
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
this.attachPermissionsToRole = async _ref2 => {
|
|
47
|
+
let {
|
|
48
|
+
roleId
|
|
49
|
+
} = _ref2,
|
|
50
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
|
|
51
|
+
return this.put(`${_constants.urls.identity.roles.v1}/${roleId}/permissions`, body);
|
|
52
|
+
};
|
|
61
53
|
|
|
62
|
-
async
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
this.getPermissions = async () => {
|
|
55
|
+
return this.get(_constants.urls.identity.permissions.v1);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
this.attachPermissionToRoles = async _ref3 => {
|
|
59
|
+
let {
|
|
60
|
+
permissionId
|
|
61
|
+
} = _ref3,
|
|
62
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded3);
|
|
63
|
+
return this.put(`${_constants.urls.identity.permissions.v1}/${permissionId}/roles`, body);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
this.getPermissionCategories = async () => {
|
|
67
|
+
return this.get(`${_constants.urls.identity.permissions.v1}/categories`);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
this.addRoleV2 = async body => {
|
|
71
|
+
return this.post(_constants.urls.identity.roles.v2, body);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
69
74
|
|
|
70
|
-
async function getPermissionCategories() {
|
|
71
|
-
return (0, _fetch.Get)(`${_constants.urls.identity.permissions.v1}/categories`);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
exports.RolesApi = RolesApi;
|
|
78
|
+
|
|
79
|
+
var _default = new RolesApi('default');
|
|
80
|
+
|
|
81
|
+
exports.default = _default;
|
|
@@ -3,17 +3,29 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.getRecommendations = getRecommendations;
|
|
8
|
-
|
|
9
|
-
var _fetch = require("../fetch");
|
|
6
|
+
exports.default = exports.SecurityCenterApi = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../constants");
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
11
|
+
|
|
12
|
+
class SecurityCenterApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(appName) {
|
|
14
|
+
super(appName);
|
|
15
|
+
|
|
16
|
+
this.getRecommendations = async () => {
|
|
17
|
+
return this.get(_constants.urls.securityCenter.recommendations.v1);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
this.getInsights = async () => {
|
|
21
|
+
return this.get(_constants.urls.securityCenter.insights.v1);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
15
25
|
}
|
|
16
26
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
exports.SecurityCenterApi = SecurityCenterApi;
|
|
28
|
+
|
|
29
|
+
var _default = new SecurityCenterApi('default');
|
|
30
|
+
|
|
31
|
+
exports.default = _default;
|