@frontegg/rest-api 3.1.74 → 3.1.76-alpha.9502349697
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 +108 -27
- package/ContextHolder/index.js +155 -50
- 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 +155 -50
- 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 +130 -138
- 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 +35 -131
- package/teams/index.js +122 -93
- package/tenants/index.d.ts +25 -37
- package/tenants/index.js +62 -46
- package/tenants/interfaces.d.ts +2 -0
- 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/index.js
CHANGED
|
@@ -1,93 +1,124 @@
|
|
|
1
|
-
/** @license Frontegg v3.1.
|
|
1
|
+
/** @license Frontegg v3.1.76-alpha.9502349697
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
export * from
|
|
6
|
+
import { AuthStrategyEnum, MachineToMachineAuthStrategy, SocialLoginProviders } from './auth';
|
|
7
|
+
import { ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType } from './subscriptions';
|
|
8
|
+
import { FronteggApiError } from './error';
|
|
9
|
+
import fetch, { FetchClient } from './FetchClient';
|
|
10
|
+
import { ContextHolder, FronteggContext } from './ContextHolder';
|
|
11
|
+
import DefaultAuthenticationApi, { AuthenticationApi } from './auth';
|
|
12
|
+
import DefaultSecurityPolicyApi, { SecurityPolicyApi } from './auth/secutiry-poilicy';
|
|
13
|
+
import DefaultUsersApi, { UsersApi } from './users';
|
|
14
|
+
import DefaultTeamsApi, { TeamsApi } from './teams';
|
|
15
|
+
import DefaultMetadataApi, { MetadataApi } from './metadata';
|
|
16
|
+
import DefaultReportsApi, { ReportsApi } from './reports';
|
|
17
|
+
import DefaultConnectivityApi, { ConnectivityApi } from './connectivity';
|
|
18
|
+
import DefaultNotificationsApi, { NotificationsApi } from './notifications';
|
|
19
|
+
import DefaultAuditsApi, { AuditsApi } from './audits';
|
|
20
|
+
import DefaultTenantsApi, { TenantsApi } from './tenants';
|
|
21
|
+
import DefaultAccountSettingsApi, { AccountSettingsApi } from './account-settings';
|
|
22
|
+
import DefaultRolesApi, { RolesApi } from './roles';
|
|
23
|
+
import DefaultSubscriptionsApi, { SubscriptionsApi } from './subscriptions';
|
|
24
|
+
import DefaultVendorApi, { VendorApi } from './vendor';
|
|
25
|
+
import DefaultSubTenantsApi, { SubTenantsApi } from './sub-tenants';
|
|
26
|
+
import DefaultFeatureFlagsApi, { FeatureFlagsApi } from './feature-flags';
|
|
27
|
+
import DefaultDirectoryApi, { DirectoryApi } from './directory';
|
|
28
|
+
import DefaultImpersonateApi, { ImpersonateApi } from './impersonate';
|
|
29
|
+
import DefaultGroupsApi, { GroupsApi } from './groups';
|
|
30
|
+
import DefaultEntitlementsApi, { EntitlementsApi } from './entitlements';
|
|
31
|
+
import DefaultSecurityCenterApi, { SecurityCenterApi } from './security-center';
|
|
32
|
+
import DefaultPhoneNumbersApi, { PhoneNumbersApi } from './user-phone-numbers';
|
|
33
|
+
import DefaultApplicationsApi, { ApplicationsApi } from './applications';
|
|
34
|
+
export * from './interfaces';
|
|
35
|
+
export * from './auth/interfaces';
|
|
35
36
|
export { setTabTenantInSessionStorage, getTabTenantFromSessionStorage, removeTabTenantFromSessionStorage, getCurrentUserTenantsFunction, FRONTEGG_SEPARATE_TABS_BY_TENANT } from './auth';
|
|
36
|
-
export * from
|
|
37
|
-
export * from
|
|
38
|
-
export * from
|
|
39
|
-
export * from
|
|
40
|
-
export * from
|
|
41
|
-
export * from
|
|
42
|
-
export * from
|
|
43
|
-
export * from
|
|
44
|
-
export * from
|
|
45
|
-
export * from
|
|
46
|
-
export * from
|
|
47
|
-
export * from
|
|
48
|
-
export * from
|
|
49
|
-
export * from
|
|
50
|
-
export * from
|
|
51
|
-
export * from
|
|
52
|
-
export * from
|
|
53
|
-
export * from
|
|
54
|
-
export * from
|
|
55
|
-
export * from
|
|
56
|
-
export * from
|
|
57
|
-
export * from
|
|
58
|
-
export * from
|
|
59
|
-
export * from
|
|
60
|
-
export * from
|
|
37
|
+
export * from './teams/interfaces';
|
|
38
|
+
export * from './metadata/interfaces';
|
|
39
|
+
export * from './reports/interfaces';
|
|
40
|
+
export * from './connectivity/interfaces';
|
|
41
|
+
export * from './notifications/interfaces';
|
|
42
|
+
export * from './audits/interfaces';
|
|
43
|
+
export * from './tenants/interfaces';
|
|
44
|
+
export * from './account-settings/interfaces';
|
|
45
|
+
export * from './roles/interfaces';
|
|
46
|
+
export * from './subscriptions/interfaces';
|
|
47
|
+
export * from './vendor/interfaces';
|
|
48
|
+
export * from './sub-tenants/interfaces';
|
|
49
|
+
export * from './routers';
|
|
50
|
+
export * from './feature-flags/index';
|
|
51
|
+
export * from './feature-flags/interfaces';
|
|
52
|
+
export * from './directory/index';
|
|
53
|
+
export * from './directory/interfaces';
|
|
54
|
+
export * from './impersonate/interfaces';
|
|
55
|
+
export * from './groups/interfaces';
|
|
56
|
+
export * from './groups/enums';
|
|
57
|
+
export * from './users/interfaces';
|
|
58
|
+
export * from './entitlements/interfaces';
|
|
59
|
+
export * from './security-center/interfaces';
|
|
60
|
+
export * from './user-phone-numbers/interfaces';
|
|
61
|
+
export * from './applications/interfaces';
|
|
61
62
|
const api = {
|
|
62
|
-
auth,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
63
|
+
auth: DefaultAuthenticationApi,
|
|
64
|
+
securityPolicy: DefaultSecurityPolicyApi,
|
|
65
|
+
teams: DefaultTeamsApi,
|
|
66
|
+
metadata: DefaultMetadataApi,
|
|
67
|
+
reports: DefaultReportsApi,
|
|
68
|
+
connectivity: DefaultConnectivityApi,
|
|
69
|
+
notifications: DefaultNotificationsApi,
|
|
70
|
+
audits: DefaultAuditsApi,
|
|
71
|
+
tenants: DefaultTenantsApi,
|
|
72
|
+
accountSettings: DefaultAccountSettingsApi,
|
|
73
|
+
roles: DefaultRolesApi,
|
|
74
|
+
subscriptions: DefaultSubscriptionsApi,
|
|
75
|
+
vendor: DefaultVendorApi,
|
|
76
|
+
subTenants: DefaultSubTenantsApi,
|
|
77
|
+
featureFlags: DefaultFeatureFlagsApi,
|
|
78
|
+
directory: DefaultDirectoryApi,
|
|
79
|
+
impersonate: DefaultImpersonateApi,
|
|
80
|
+
groups: DefaultGroupsApi,
|
|
81
|
+
users: DefaultUsersApi,
|
|
82
|
+
entitlements: DefaultEntitlementsApi,
|
|
83
|
+
securityCenter: DefaultSecurityCenterApi,
|
|
84
|
+
userPhoneNumbers: DefaultPhoneNumbersApi,
|
|
85
|
+
applications: DefaultApplicationsApi
|
|
84
86
|
};
|
|
85
|
-
|
|
87
|
+
|
|
88
|
+
const createApiClient = appName => ({
|
|
89
|
+
auth: new AuthenticationApi(appName),
|
|
90
|
+
securityPolicy: new SecurityPolicyApi(appName),
|
|
91
|
+
teams: new TeamsApi(appName),
|
|
92
|
+
metadata: new MetadataApi(appName),
|
|
93
|
+
reports: new ReportsApi(appName),
|
|
94
|
+
connectivity: new ConnectivityApi(appName),
|
|
95
|
+
notifications: new NotificationsApi(appName),
|
|
96
|
+
audits: new AuditsApi(appName),
|
|
97
|
+
tenants: new TenantsApi(appName),
|
|
98
|
+
accountSettings: new AccountSettingsApi(appName),
|
|
99
|
+
roles: new RolesApi(appName),
|
|
100
|
+
subscriptions: new SubscriptionsApi(appName),
|
|
101
|
+
vendor: new VendorApi(appName),
|
|
102
|
+
subTenants: new SubTenantsApi(appName),
|
|
103
|
+
featureFlags: new FeatureFlagsApi(appName),
|
|
104
|
+
directory: new DirectoryApi(appName),
|
|
105
|
+
impersonate: new ImpersonateApi(appName),
|
|
106
|
+
groups: new GroupsApi(appName),
|
|
107
|
+
users: new UsersApi(appName),
|
|
108
|
+
entitlements: new EntitlementsApi(appName),
|
|
109
|
+
securityCenter: new SecurityCenterApi(appName),
|
|
110
|
+
userPhoneNumbers: new PhoneNumbersApi(appName),
|
|
111
|
+
applications: new ApplicationsApi(appName)
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export { fetch, FetchClient, ContextHolder, FronteggContext, api, createApiClient, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy };
|
|
86
115
|
export default {
|
|
87
116
|
fetch,
|
|
117
|
+
FetchClient,
|
|
88
118
|
ContextHolder,
|
|
89
119
|
FronteggContext,
|
|
90
120
|
api,
|
|
121
|
+
createApiClient,
|
|
91
122
|
FronteggApiError,
|
|
92
123
|
AuthStrategyEnum,
|
|
93
124
|
MachineToMachineAuthStrategy,
|
package/interfaces.d.ts
CHANGED
|
@@ -102,3 +102,13 @@ export declare enum PaginationOrderEnum {
|
|
|
102
102
|
ASC = "ASC",
|
|
103
103
|
DESC = "DESC"
|
|
104
104
|
}
|
|
105
|
+
export interface RequestOptions {
|
|
106
|
+
url: string;
|
|
107
|
+
method: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
108
|
+
body?: any;
|
|
109
|
+
params?: any;
|
|
110
|
+
contentType?: string;
|
|
111
|
+
responseType?: 'json' | 'plain' | 'blob';
|
|
112
|
+
headers?: Record<string, string>;
|
|
113
|
+
credentials?: RequestCredentials;
|
|
114
|
+
}
|
package/metadata/index.d.ts
CHANGED
|
@@ -1,8 +1,68 @@
|
|
|
1
1
|
import { CommitChangesRequest, IAuditsMetadata, IMetadataIp, INotificationMetadata, ISamlMetadata } from './interfaces';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class MetadataApi extends BaseApiClient {
|
|
4
|
+
constructor(appName: string);
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves metadata based on the given criteria.
|
|
7
|
+
*
|
|
8
|
+
* @param body - Metadata request parameters.
|
|
9
|
+
* @returns Metadata matching the criteria.
|
|
10
|
+
* @throws Will throw an error if metadata is not found.
|
|
11
|
+
*/
|
|
12
|
+
private getMetadata;
|
|
13
|
+
/**
|
|
14
|
+
* Retrieves admin box metadata.
|
|
15
|
+
*
|
|
16
|
+
* @returns Admin box metadata.
|
|
17
|
+
*/
|
|
18
|
+
getAdminBoxMetadata: () => Promise<unknown>;
|
|
19
|
+
/**
|
|
20
|
+
* Updates admin box metadata.
|
|
21
|
+
*
|
|
22
|
+
* @param body - Request body for committing changes.
|
|
23
|
+
* @returns Response from the POST request.
|
|
24
|
+
*/
|
|
25
|
+
updateAdminBoxMetadata: (body: CommitChangesRequest) => Promise<unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves IP metadata for a given IP address.
|
|
28
|
+
*
|
|
29
|
+
* @param ip - IP address to get metadata for.
|
|
30
|
+
* @returns IP metadata.
|
|
31
|
+
* @throws Will throw an error if IP metadata is not found.
|
|
32
|
+
*/
|
|
33
|
+
private getIpMetadata;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves current user IP metadata.
|
|
36
|
+
*
|
|
37
|
+
* @returns Current user IP metadata.
|
|
38
|
+
* @throws Will throw an error if IP metadata is not found.
|
|
39
|
+
*/
|
|
40
|
+
getCurrentUserIpMetadata: () => Promise<IMetadataIp>;
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves notifications metadata.
|
|
43
|
+
*
|
|
44
|
+
* @returns Notifications metadata.
|
|
45
|
+
*/
|
|
46
|
+
getNotificationsMetadata: () => Promise<INotificationMetadata>;
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves SAML metadata.
|
|
49
|
+
*
|
|
50
|
+
* @returns SAML metadata.
|
|
51
|
+
*/
|
|
52
|
+
getSamlMetadata: () => Promise<ISamlMetadata>;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves audits metadata.
|
|
55
|
+
*
|
|
56
|
+
* @returns Audits metadata.
|
|
57
|
+
*/
|
|
58
|
+
getAuditsMetadata: () => Promise<IAuditsMetadata>;
|
|
59
|
+
/**
|
|
60
|
+
* Retrieves IP address metadata for a given IP.
|
|
61
|
+
*
|
|
62
|
+
* @param ip - IP address to get metadata for.
|
|
63
|
+
* @returns IP address metadata.
|
|
64
|
+
*/
|
|
65
|
+
getIpAdressMetadata: (ip: string) => Promise<IMetadataIp>;
|
|
66
|
+
}
|
|
67
|
+
declare const _default: MetadataApi;
|
|
68
|
+
export default _default;
|
package/metadata/index.js
CHANGED
|
@@ -1,38 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
2
|
+
export class MetadataApi extends BaseApiClient {
|
|
3
|
+
constructor(appName) {
|
|
4
|
+
super(appName);
|
|
2
5
|
|
|
3
|
-
async
|
|
4
|
-
|
|
6
|
+
this.getMetadata = async body => {
|
|
7
|
+
var _data$rows, _data$rows2;
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
9
|
+
const data = await this.get('/metadata', body);
|
|
10
|
+
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];
|
|
11
|
+
throw new Error(`metadata not found: ${body.entityName}`);
|
|
12
|
+
};
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
export async function updateAdminBoxMetadata(body) {
|
|
15
|
-
return Post('/metadata/admin-box', body);
|
|
16
|
-
}
|
|
14
|
+
this.getAdminBoxMetadata = async () => {
|
|
15
|
+
return this.get('/metadata/admin-box');
|
|
16
|
+
};
|
|
17
17
|
|
|
18
|
-
async
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
this.updateAdminBoxMetadata = async body => {
|
|
19
|
+
return this.post('/metadata/admin-box', body);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
this.getIpMetadata = async ip => {
|
|
23
|
+
const data = await this.get(`/metadata/ip/${ip}`);
|
|
24
|
+
if (data) return data;
|
|
25
|
+
throw new Error(`ip metadata not found`);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
this.getCurrentUserIpMetadata = async () => {
|
|
29
|
+
const data = await this.get(`/metadata/ipme`);
|
|
30
|
+
if (data) return data;
|
|
31
|
+
throw new Error(`ip metadata not found`);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
this.getNotificationsMetadata = async () => {
|
|
35
|
+
return this.getMetadata({
|
|
36
|
+
entityName: 'notifications'
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
this.getSamlMetadata = async () => {
|
|
41
|
+
return this.getMetadata({
|
|
42
|
+
entityName: 'saml'
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
this.getAuditsMetadata = async () => {
|
|
47
|
+
return this.getMetadata({
|
|
48
|
+
entityName: 'audits'
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
this.getIpAdressMetadata = async ip => {
|
|
53
|
+
return this.getIpMetadata(ip);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
23
56
|
|
|
24
|
-
export async function getCurrentUserIpMetadata() {
|
|
25
|
-
const data = await Get(`/metadata/ipme`);
|
|
26
|
-
if (data) return data;
|
|
27
|
-
throw new Error(`ip metadata not found`);
|
|
28
57
|
}
|
|
29
|
-
export
|
|
30
|
-
entityName: 'notifications'
|
|
31
|
-
});
|
|
32
|
-
export const getSamlMetadata = async () => getMetadata({
|
|
33
|
-
entityName: 'saml'
|
|
34
|
-
});
|
|
35
|
-
export const getAuditsMetadata = async () => getMetadata({
|
|
36
|
-
entityName: 'audits'
|
|
37
|
-
});
|
|
38
|
-
export const getIpAdressMetadata = async ip => getIpMetadata(ip);
|
|
58
|
+
export default new MetadataApi('default');
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BaseApiClient = void 0;
|
|
7
|
+
|
|
8
|
+
var _FetchClient = require("./FetchClient");
|
|
9
|
+
|
|
10
|
+
class BaseApiClient {
|
|
11
|
+
constructor(appName) {
|
|
12
|
+
this.appName = void 0;
|
|
13
|
+
this.fetchClient = void 0;
|
|
14
|
+
|
|
15
|
+
this.get = async (url, params, opts) => {
|
|
16
|
+
return this.fetchClient.get(url, params, opts);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
this.post = async (url, body, opts) => {
|
|
20
|
+
return this.fetchClient.post(url, body, opts);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
this.patch = async (url, body, opts) => {
|
|
24
|
+
return this.fetchClient.patch(url, body, opts);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
this.put = async (url, body, opts) => {
|
|
28
|
+
return this.fetchClient.put(url, body, opts);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
this.delete = async (url, body, opts) => {
|
|
32
|
+
return this.fetchClient.delete(url, body, opts);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
this.postDownload = async (url, body, params, opts) => {
|
|
36
|
+
return this.fetchClient.postDownload(url, body, params, opts);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
this.extractHeadersFromOptions = (options = {}) => {
|
|
40
|
+
return this.fetchClient.extractHeadersFromOptions(options);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
this.appName = appName;
|
|
44
|
+
this.fetchClient = new _FetchClient.FetchClient(appName);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
exports.BaseApiClient = BaseApiClient;
|