@frontegg/rest-api 3.1.74-alpha.9437937621 → 3.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.
- package/ContextHolder/index.d.ts +27 -108
- package/ContextHolder/index.js +50 -155
- package/account-settings/index.d.ts +7 -19
- package/account-settings/index.js +13 -23
- package/applications/index.d.ts +44 -49
- package/applications/index.js +37 -51
- package/audits/index.d.ts +15 -27
- package/audits/index.js +17 -27
- package/auth/index.d.ts +768 -817
- package/auth/index.js +721 -902
- package/auth/secutiry-poilicy/index.d.ts +102 -58
- package/auth/secutiry-poilicy/index.js +90 -122
- package/auth/utils.d.ts +2 -2
- package/auth/utils.js +8 -9
- package/connectivity/index.d.ts +26 -125
- package/connectivity/index.js +114 -147
- package/directory/index.d.ts +22 -31
- package/directory/index.js +15 -27
- package/entitlements/index.d.ts +8 -14
- package/entitlements/index.js +4 -12
- package/feature-flags/index.d.ts +2 -8
- package/feature-flags/index.js +8 -16
- package/fetch.d.ts +24 -0
- package/fetch.js +265 -0
- package/groups/index.d.ts +49 -73
- package/groups/index.js +45 -64
- package/impersonate/index.d.ts +6 -15
- package/impersonate/index.js +5 -13
- package/index.d.ts +108 -154
- package/index.js +78 -109
- package/interfaces.d.ts +0 -10
- package/metadata/index.d.ts +7 -67
- package/metadata/index.js +32 -52
- package/node/ContextHolder/index.js +50 -155
- package/node/account-settings/index.js +16 -27
- package/node/applications/index.js +44 -51
- package/node/audits/index.js +20 -31
- package/node/auth/index.js +1035 -768
- package/node/auth/secutiry-poilicy/index.js +136 -125
- package/node/auth/utils.js +7 -9
- package/node/connectivity/index.js +187 -148
- package/node/directory/index.js +20 -29
- package/node/entitlements/index.js +5 -18
- package/node/feature-flags/index.js +9 -21
- package/node/fetch.js +306 -0
- package/node/groups/index.js +63 -65
- package/node/impersonate/index.js +5 -18
- package/node/index.js +71 -116
- package/node/metadata/index.js +52 -61
- package/node/notifications/index.js +27 -37
- package/node/reports/index.js +70 -78
- package/node/roles/index.js +51 -56
- package/node/security-center/index.js +9 -21
- package/node/sub-tenants/index.js +89 -90
- package/node/subscriptions/index.js +107 -79
- package/node/subscriptions/invoices.js +17 -25
- package/node/subscriptions/managedSubscriptions.js +27 -32
- package/node/subscriptions/paymentMethods.js +20 -27
- package/node/subscriptions/paymentProviders.js +6 -15
- package/node/subscriptions/plans.js +9 -17
- package/node/subscriptions/providers/index.js +18 -0
- package/node/subscriptions/providers/stripe/index.js +21 -26
- package/node/subscriptions/subscriptions.js +27 -32
- package/node/subscriptions/summaries.js +6 -15
- package/node/subscriptions/tenantConfiguration.js +9 -17
- package/node/subscriptions/vendorPublicConfigurations.js +6 -15
- package/node/teams/index.js +138 -130
- package/node/tenants/index.js +60 -65
- package/node/user-phone-numbers/index.js +24 -32
- package/node/users/index.js +53 -58
- package/node/vendor/index.js +6 -17
- package/notifications/index.d.ts +16 -22
- package/notifications/index.js +22 -33
- package/package.json +1 -1
- package/reports/index.d.ts +44 -50
- package/reports/index.js +62 -75
- package/roles/index.d.ts +38 -44
- package/roles/index.js +41 -57
- package/security-center/index.d.ts +2 -14
- package/security-center/index.js +6 -15
- package/sub-tenants/index.d.ts +15 -57
- package/sub-tenants/index.js +68 -88
- package/subscriptions/index.d.ts +11 -56
- package/subscriptions/index.js +11 -68
- package/subscriptions/invoices.d.ts +13 -16
- package/subscriptions/invoices.js +14 -24
- package/subscriptions/managedSubscriptions.d.ts +15 -18
- package/subscriptions/managedSubscriptions.js +22 -33
- package/subscriptions/paymentMethods.d.ts +13 -16
- package/subscriptions/paymentMethods.js +17 -26
- package/subscriptions/paymentProviders.d.ts +5 -8
- package/subscriptions/paymentProviders.js +4 -11
- package/subscriptions/plans.d.ts +8 -11
- package/subscriptions/plans.js +6 -14
- package/subscriptions/providers/index.d.ts +1 -0
- package/subscriptions/providers/index.js +1 -0
- package/subscriptions/providers/stripe/index.d.ts +21 -24
- package/subscriptions/providers/stripe/index.js +16 -27
- package/subscriptions/subscriptions.d.ts +21 -24
- package/subscriptions/subscriptions.js +22 -33
- package/subscriptions/summaries.d.ts +4 -7
- package/subscriptions/summaries.js +3 -10
- package/subscriptions/tenantConfiguration.d.ts +3 -6
- package/subscriptions/tenantConfiguration.js +7 -15
- package/subscriptions/vendorPublicConfigurations.d.ts +2 -5
- package/subscriptions/vendorPublicConfigurations.js +4 -11
- package/teams/index.d.ts +131 -35
- package/teams/index.js +93 -122
- package/tenants/index.d.ts +37 -25
- package/tenants/index.js +46 -62
- package/user-phone-numbers/index.d.ts +26 -32
- package/user-phone-numbers/index.js +19 -32
- package/users/index.d.ts +15 -21
- package/users/index.js +44 -60
- package/vendor/index.d.ts +6 -12
- package/vendor/index.js +4 -11
- package/BaseApiClient.d.ts +0 -16
- package/BaseApiClient.js +0 -39
- package/FetchClient.d.ts +0 -42
- package/FetchClient.js +0 -308
- package/node/BaseApiClient.js +0 -49
- package/node/FetchClient.js +0 -326
package/notifications/index.d.ts
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { ILoadMessages, IMessage, IUpdateNotificationStatus, IUpdateNotificationIsPinned } from './interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Mark all notifications as read
|
|
19
|
-
*/
|
|
20
|
-
markAllAsRead: () => Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
declare const _default: NotificationsApi;
|
|
23
|
-
export default _default;
|
|
2
|
+
/**
|
|
3
|
+
* get Notifications
|
|
4
|
+
*/
|
|
5
|
+
export declare function getNotifications(params: ILoadMessages): Promise<Array<IMessage>>;
|
|
6
|
+
/**
|
|
7
|
+
* update Notification status
|
|
8
|
+
*/
|
|
9
|
+
export declare function updateNotificationStatus(params: IUpdateNotificationStatus): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* update Notification pin status
|
|
12
|
+
*/
|
|
13
|
+
export declare function updateNotificationIsPinned(params: IUpdateNotificationIsPinned): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* mark all notifications as read
|
|
16
|
+
*/
|
|
17
|
+
export declare function markAllAsRead(): Promise<void>;
|
package/notifications/index.js
CHANGED
|
@@ -1,35 +1,24 @@
|
|
|
1
|
+
import { Get, Post, Put } from '../fetch';
|
|
1
2
|
import { urls } from '../constants';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
this.getNotifications = async params => {
|
|
8
|
-
return this.get(urls.notifications.v1, {
|
|
9
|
-
params
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
this.updateNotificationStatus = async params => {
|
|
14
|
-
return this.put(`${urls.notifications.v1}/status`, {
|
|
15
|
-
params
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
this.updateNotificationIsPinned = async params => {
|
|
20
|
-
const {
|
|
21
|
-
notificationId,
|
|
22
|
-
pinStatus
|
|
23
|
-
} = params;
|
|
24
|
-
return this.put(`${urls.notifications.v1}/${pinStatus}`, {
|
|
25
|
-
notificationId
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
this.markAllAsRead = async () => {
|
|
30
|
-
return this.post(`${urls.notifications.v1}/status/mark-all-read`);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
3
|
+
export async function getNotifications(params) {
|
|
4
|
+
return Get(urls.notifications.v1, {
|
|
5
|
+
params
|
|
6
|
+
});
|
|
34
7
|
}
|
|
35
|
-
export
|
|
8
|
+
export async function updateNotificationStatus(params) {
|
|
9
|
+
return Put(`${urls.notifications.v1}/status`, {
|
|
10
|
+
params
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export async function updateNotificationIsPinned(params) {
|
|
14
|
+
const {
|
|
15
|
+
notificationId,
|
|
16
|
+
pinStatus
|
|
17
|
+
} = params;
|
|
18
|
+
return Put(`${urls.notifications.v1}/${pinStatus}`, {
|
|
19
|
+
notificationId
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export async function markAllAsRead() {
|
|
23
|
+
return Post(`${urls.notifications.v1}/status/mark-all-read`);
|
|
24
|
+
}
|
package/package.json
CHANGED
package/reports/index.d.ts
CHANGED
|
@@ -1,51 +1,45 @@
|
|
|
1
1
|
import { IDownloadReport, IGetReport, IGetReports, IRenderReport, IRenderReportResponse, IReportRecord, IScheduleReport, ISendReport } from './interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
* @throws exception if report not found or the data api unreached.
|
|
47
|
-
*/
|
|
48
|
-
sendReport: (body: ISendReport) => Promise<void>;
|
|
49
|
-
}
|
|
50
|
-
declare const _default: ReportsApi;
|
|
51
|
-
export default _default;
|
|
2
|
+
/**
|
|
3
|
+
* Get all active tenant reports from reports service by active vendor.
|
|
4
|
+
* Optional: pass filters and sort options to reports.
|
|
5
|
+
*
|
|
6
|
+
* @returns list of reports objects
|
|
7
|
+
*/
|
|
8
|
+
export declare function getReports(body: IGetReports): Promise<IReportRecord[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Get report record by id.
|
|
11
|
+
*
|
|
12
|
+
* @returns list of report object
|
|
13
|
+
* @throws exception if report not found.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getReport(body: IGetReport): Promise<IReportRecord>;
|
|
16
|
+
/**
|
|
17
|
+
* Render report by id.
|
|
18
|
+
* Optional: pass data filters if exists to render report by specific data.
|
|
19
|
+
*
|
|
20
|
+
* @returns html content of the rendered reports
|
|
21
|
+
* @throws exception if report not found or the data api unreached.
|
|
22
|
+
*/
|
|
23
|
+
export declare function renderReport({ dataFilters, ...body }: IRenderReport): Promise<IRenderReportResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* schedule report by providing cron expression and data filters.
|
|
26
|
+
*
|
|
27
|
+
* @returns the updated report object
|
|
28
|
+
* @throws exception if report not found or the data api unreached.
|
|
29
|
+
*/
|
|
30
|
+
export declare function scheduleReport({ templateId, dataFilters, ...body }: IScheduleReport): Promise<IReportRecord>;
|
|
31
|
+
/**
|
|
32
|
+
* download report as file in specific format.
|
|
33
|
+
* this function will add a href element with url to trigger file download.
|
|
34
|
+
* Optional: pass data filters if exists to generate report by specific data.
|
|
35
|
+
*
|
|
36
|
+
* @throws exception if report not found or the data api unreached.
|
|
37
|
+
*/
|
|
38
|
+
export declare function downloadReport({ dataFilters, ...body }: IDownloadReport): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* send report to specific email address.
|
|
41
|
+
* Optional: pass data filters if exists to send report by specific data.
|
|
42
|
+
*
|
|
43
|
+
* @throws exception if report not found or the data api unreached.
|
|
44
|
+
*/
|
|
45
|
+
export declare function sendReport(body: ISendReport): Promise<void>;
|
package/reports/index.js
CHANGED
|
@@ -3,86 +3,73 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["dataFilters"],
|
|
4
4
|
_excluded2 = ["templateId", "dataFilters"],
|
|
5
5
|
_excluded3 = ["dataFilters"];
|
|
6
|
+
import { Get, Post } from '../fetch';
|
|
6
7
|
import { urls } from '../constants';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
this.renderReport = async _ref => {
|
|
21
|
-
let {
|
|
22
|
-
dataFilters
|
|
23
|
-
} = _ref,
|
|
24
|
-
body = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
25
|
-
|
|
26
|
-
const html = await this.get(`${urls.reports.trigger.v1}/preview-report`, _extends({}, body, {
|
|
27
|
-
dataFilters: btoa(JSON.stringify(dataFilters || {})),
|
|
28
|
-
responseType: 'html'
|
|
29
|
-
}), {
|
|
30
|
-
responseType: 'plain'
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
html
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
this.scheduleReport = async _ref2 => {
|
|
38
|
-
let {
|
|
39
|
-
templateId,
|
|
40
|
-
dataFilters
|
|
41
|
-
} = _ref2,
|
|
42
|
-
body = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
43
|
-
|
|
44
|
-
return this.post(`${urls.reports.service.v2}/${templateId}/tenant-reports`, _extends({}, body, {
|
|
45
|
-
dataFilters: btoa(JSON.stringify(dataFilters || {}))
|
|
46
|
-
}));
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
this.downloadReport = async _ref3 => {
|
|
50
|
-
let {
|
|
51
|
-
dataFilters
|
|
52
|
-
} = _ref3,
|
|
53
|
-
body = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
8
|
+
export async function getReports(body) {
|
|
9
|
+
return Get(`${urls.reports.service.v2}/tenant-reports`, body);
|
|
10
|
+
}
|
|
11
|
+
export async function getReport(body) {
|
|
12
|
+
return Get(`${urls.reports.service.v2}/${body.id}/tenant-reports`);
|
|
13
|
+
}
|
|
14
|
+
export async function renderReport(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
dataFilters
|
|
17
|
+
} = _ref,
|
|
18
|
+
body = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
54
19
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
20
|
+
const html = await Get(`${urls.reports.trigger.v1}/preview-report`, _extends({}, body, {
|
|
21
|
+
dataFilters: btoa(JSON.stringify(dataFilters || {})),
|
|
22
|
+
responseType: 'html'
|
|
23
|
+
}), {
|
|
24
|
+
responseType: 'plain'
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
html
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export async function scheduleReport(_ref2) {
|
|
31
|
+
let {
|
|
32
|
+
templateId,
|
|
33
|
+
dataFilters
|
|
34
|
+
} = _ref2,
|
|
35
|
+
body = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
62
36
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
37
|
+
return Post(`${urls.reports.service.v2}/${templateId}/tenant-reports`, _extends({}, body, {
|
|
38
|
+
dataFilters: btoa(JSON.stringify(dataFilters || {}))
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
export async function downloadReport(_ref3) {
|
|
42
|
+
let {
|
|
43
|
+
dataFilters
|
|
44
|
+
} = _ref3,
|
|
45
|
+
body = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
70
46
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
tempLink.click();
|
|
79
|
-
setTimeout(tempLink.remove.bind(tempLink));
|
|
80
|
-
};
|
|
47
|
+
const blob = await Get(`${urls.reports.trigger.v1}/preview-report`, _extends({}, body, {
|
|
48
|
+
dataFilters: btoa(JSON.stringify(dataFilters || {}))
|
|
49
|
+
}), {
|
|
50
|
+
responseType: 'blob'
|
|
51
|
+
});
|
|
52
|
+
let contentType = 'text/html';
|
|
53
|
+
let contentExt = 'html';
|
|
81
54
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
55
|
+
if (body.responseType === 'pdf') {
|
|
56
|
+
contentType = 'application/pdf';
|
|
57
|
+
contentExt = 'pdf';
|
|
58
|
+
} else if (body.responseType === 'image') {
|
|
59
|
+
contentType = 'image/jpeg';
|
|
60
|
+
contentExt = 'jpg';
|
|
85
61
|
}
|
|
86
62
|
|
|
63
|
+
const newBlob = new Blob([blob], {
|
|
64
|
+
type: contentType
|
|
65
|
+
});
|
|
66
|
+
const fileURL = URL.createObjectURL(newBlob);
|
|
67
|
+
const tempLink = document.createElement('a');
|
|
68
|
+
tempLink.href = fileURL;
|
|
69
|
+
tempLink.setAttribute('download', `report_${body.name || ''}.${contentExt}`);
|
|
70
|
+
tempLink.click();
|
|
71
|
+
setTimeout(tempLink.remove.bind(tempLink));
|
|
87
72
|
}
|
|
88
|
-
export
|
|
73
|
+
export async function sendReport(body) {
|
|
74
|
+
return Post(`${urls.reports.trigger.v1}/tenant-reports`, body);
|
|
75
|
+
}
|
package/roles/index.d.ts
CHANGED
|
@@ -1,45 +1,39 @@
|
|
|
1
1
|
import { IRole, IRolePermission, IRolePermissionCategory, IAddRole, IDeleteRole, IUpdateRole, IAttachPermissionsToRole, IAttachPermissionToRoles, IAddRoleV2 } from './interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* @param body - IAddRoleV2
|
|
41
|
-
*/
|
|
42
|
-
addRoleV2: (body: IAddRoleV2) => Promise<IRole>;
|
|
43
|
-
}
|
|
44
|
-
declare const _default: RolesApi;
|
|
45
|
-
export default _default;
|
|
2
|
+
/**
|
|
3
|
+
* Gets tenant related roles
|
|
4
|
+
*/
|
|
5
|
+
export declare function getRoles(): Promise<IRole[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Adds tenant related roles
|
|
8
|
+
* @param body: IAddRole
|
|
9
|
+
*/
|
|
10
|
+
export declare function addRole(body: IAddRole): Promise<IRole>;
|
|
11
|
+
/**
|
|
12
|
+
* Deletes role given role ID
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteRole({ roleId }: IDeleteRole): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Updates role using a given role ID and IUpdateRole object
|
|
17
|
+
*/
|
|
18
|
+
export declare function updateRole({ roleId, ...body }: IUpdateRole): Promise<IRole>;
|
|
19
|
+
/**
|
|
20
|
+
* Attaches permissions to role given a role ID
|
|
21
|
+
*/
|
|
22
|
+
export declare function attachPermissionsToRole({ roleId, ...body }: IAttachPermissionsToRole): Promise<IRole>;
|
|
23
|
+
/**
|
|
24
|
+
* Gets all vendor permissions
|
|
25
|
+
*/
|
|
26
|
+
export declare function getPermissions(): Promise<IRolePermission[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Associate permission to roles
|
|
29
|
+
*/
|
|
30
|
+
export declare function attachPermissionToRoles({ permissionId, ...body }: IAttachPermissionToRoles): Promise<IRolePermission>;
|
|
31
|
+
/**
|
|
32
|
+
* Gets all vendor categories including the permissions
|
|
33
|
+
*/
|
|
34
|
+
export declare function getPermissionCategories(): Promise<IRolePermissionCategory[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Adds tenant related roles v2
|
|
37
|
+
* @param body: IAddRoleV2
|
|
38
|
+
*/
|
|
39
|
+
export declare function addRoleV2(body: IAddRoleV2): Promise<IRole>;
|
package/roles/index.js
CHANGED
|
@@ -2,65 +2,49 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
2
2
|
const _excluded = ["roleId"],
|
|
3
3
|
_excluded2 = ["roleId"],
|
|
4
4
|
_excluded3 = ["permissionId"];
|
|
5
|
+
import { Delete, Get, Patch, Post, Put } from '../fetch';
|
|
5
6
|
import { urls } from '../constants';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return this.delete(`${urls.identity.roles.v1}/${roleId}`);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
this.updateRole = async _ref => {
|
|
26
|
-
let {
|
|
27
|
-
roleId
|
|
28
|
-
} = _ref,
|
|
29
|
-
body = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
30
|
-
|
|
31
|
-
return this.patch(`${urls.identity.roles.v1}/${roleId}`, body);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
this.attachPermissionsToRole = async _ref2 => {
|
|
35
|
-
let {
|
|
36
|
-
roleId
|
|
37
|
-
} = _ref2,
|
|
38
|
-
body = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
39
|
-
|
|
40
|
-
return this.put(`${urls.identity.roles.v1}/${roleId}/permissions`, body);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
this.getPermissions = async () => {
|
|
44
|
-
return this.get(urls.identity.permissions.v1);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
this.attachPermissionToRoles = async _ref3 => {
|
|
48
|
-
let {
|
|
49
|
-
permissionId
|
|
50
|
-
} = _ref3,
|
|
51
|
-
body = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
52
|
-
|
|
53
|
-
return this.put(`${urls.identity.permissions.v1}/${permissionId}/roles`, body);
|
|
54
|
-
};
|
|
7
|
+
export async function getRoles() {
|
|
8
|
+
return Get(urls.identity.roles.v1);
|
|
9
|
+
}
|
|
10
|
+
export async function addRole(body) {
|
|
11
|
+
return Post(urls.identity.roles.v1, body);
|
|
12
|
+
}
|
|
13
|
+
export async function deleteRole({
|
|
14
|
+
roleId
|
|
15
|
+
}) {
|
|
16
|
+
return Delete(`${urls.identity.roles.v1}/${roleId}`);
|
|
17
|
+
}
|
|
18
|
+
export async function updateRole(_ref) {
|
|
19
|
+
let {
|
|
20
|
+
roleId
|
|
21
|
+
} = _ref,
|
|
22
|
+
body = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
55
23
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
24
|
+
return Patch(`${urls.identity.roles.v1}/${roleId}`, body);
|
|
25
|
+
}
|
|
26
|
+
export async function attachPermissionsToRole(_ref2) {
|
|
27
|
+
let {
|
|
28
|
+
roleId
|
|
29
|
+
} = _ref2,
|
|
30
|
+
body = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
59
31
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
32
|
+
return Put(`${urls.identity.roles.v1}/${roleId}/permissions`, body);
|
|
33
|
+
}
|
|
34
|
+
export async function getPermissions() {
|
|
35
|
+
return Get(urls.identity.permissions.v1);
|
|
36
|
+
}
|
|
37
|
+
export async function attachPermissionToRoles(_ref3) {
|
|
38
|
+
let {
|
|
39
|
+
permissionId
|
|
40
|
+
} = _ref3,
|
|
41
|
+
body = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
64
42
|
|
|
43
|
+
return Put(`${urls.identity.permissions.v1}/${permissionId}/roles`, body);
|
|
44
|
+
}
|
|
45
|
+
export async function getPermissionCategories() {
|
|
46
|
+
return Get(`${urls.identity.permissions.v1}/categories`);
|
|
65
47
|
}
|
|
66
|
-
export
|
|
48
|
+
export async function addRoleV2(body) {
|
|
49
|
+
return Post(urls.identity.roles.v2, body);
|
|
50
|
+
}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
1
|
import { GetInsightsResponse, GetRecommendationsResponse } from './interfaces';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
constructor(appName: string);
|
|
5
|
-
/**
|
|
6
|
-
* Get security center recommendations.
|
|
7
|
-
*/
|
|
8
|
-
getRecommendations: () => Promise<GetRecommendationsResponse>;
|
|
9
|
-
/**
|
|
10
|
-
* Get security center insights.
|
|
11
|
-
*/
|
|
12
|
-
getInsights: () => Promise<GetInsightsResponse>;
|
|
13
|
-
}
|
|
14
|
-
declare const _default: SecurityCenterApi;
|
|
15
|
-
export default _default;
|
|
2
|
+
export declare function getRecommendations(): Promise<GetRecommendationsResponse>;
|
|
3
|
+
export declare function getInsights(): Promise<GetInsightsResponse>;
|
package/security-center/index.js
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
+
import { Get } from '../fetch';
|
|
1
2
|
import { urls } from '../constants';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
constructor(appName) {
|
|
5
|
-
super(appName);
|
|
6
|
-
|
|
7
|
-
this.getRecommendations = async () => {
|
|
8
|
-
return this.get(urls.securityCenter.recommendations.v1);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
this.getInsights = async () => {
|
|
12
|
-
return this.get(urls.securityCenter.insights.v1);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
3
|
+
export async function getRecommendations() {
|
|
4
|
+
return Get(urls.securityCenter.recommendations.v1);
|
|
16
5
|
}
|
|
17
|
-
export
|
|
6
|
+
export async function getInsights() {
|
|
7
|
+
return Get(urls.securityCenter.insights.v1);
|
|
8
|
+
}
|