@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/roles/index.d.ts
CHANGED
|
@@ -1,39 +1,45 @@
|
|
|
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
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class RolesApi extends BaseApiClient {
|
|
4
|
+
constructor(appName: string);
|
|
5
|
+
/**
|
|
6
|
+
* Gets tenant related roles
|
|
7
|
+
*/
|
|
8
|
+
getRoles: () => Promise<IRole[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Adds tenant related roles
|
|
11
|
+
* @param body - IAddRole
|
|
12
|
+
*/
|
|
13
|
+
addRole: (body: IAddRole) => Promise<IRole>;
|
|
14
|
+
/**
|
|
15
|
+
* Deletes role given role ID
|
|
16
|
+
*/
|
|
17
|
+
deleteRole: ({ roleId }: IDeleteRole) => Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Updates role using a given role ID and IUpdateRole object
|
|
20
|
+
*/
|
|
21
|
+
updateRole: ({ roleId, ...body }: IUpdateRole) => Promise<IRole>;
|
|
22
|
+
/**
|
|
23
|
+
* Attaches permissions to role given a role ID
|
|
24
|
+
*/
|
|
25
|
+
attachPermissionsToRole: ({ roleId, ...body }: IAttachPermissionsToRole) => Promise<IRole>;
|
|
26
|
+
/**
|
|
27
|
+
* Gets all vendor permissions
|
|
28
|
+
*/
|
|
29
|
+
getPermissions: () => Promise<IRolePermission[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Associate permission to roles
|
|
32
|
+
*/
|
|
33
|
+
attachPermissionToRoles: ({ permissionId, ...body }: IAttachPermissionToRoles) => Promise<IRolePermission>;
|
|
34
|
+
/**
|
|
35
|
+
* Gets all vendor categories including the permissions
|
|
36
|
+
*/
|
|
37
|
+
getPermissionCategories: () => Promise<IRolePermissionCategory[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Adds tenant related roles v2
|
|
40
|
+
* @param body - IAddRoleV2
|
|
41
|
+
*/
|
|
42
|
+
addRoleV2: (body: IAddRoleV2) => Promise<IRole>;
|
|
43
|
+
}
|
|
44
|
+
declare const _default: RolesApi;
|
|
45
|
+
export default _default;
|
package/roles/index.js
CHANGED
|
@@ -2,49 +2,65 @@ 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';
|
|
6
5
|
import { urls } from '../constants';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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);
|
|
6
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
7
|
+
export class RolesApi extends BaseApiClient {
|
|
8
|
+
constructor(appName) {
|
|
9
|
+
super(appName);
|
|
23
10
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
let {
|
|
28
|
-
roleId
|
|
29
|
-
} = _ref2,
|
|
30
|
-
body = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
11
|
+
this.getRoles = async () => {
|
|
12
|
+
return this.get(urls.identity.roles.v1);
|
|
13
|
+
};
|
|
31
14
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
15
|
+
this.addRole = async body => {
|
|
16
|
+
return this.post(urls.identity.roles.v1, body);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
this.deleteRole = async ({
|
|
20
|
+
roleId
|
|
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
|
+
};
|
|
55
|
+
|
|
56
|
+
this.getPermissionCategories = async () => {
|
|
57
|
+
return this.get(`${urls.identity.permissions.v1}/categories`);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
this.addRoleV2 = async body => {
|
|
61
|
+
return this.post(urls.identity.roles.v2, body);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
42
64
|
|
|
43
|
-
return Put(`${urls.identity.permissions.v1}/${permissionId}/roles`, body);
|
|
44
|
-
}
|
|
45
|
-
export async function getPermissionCategories() {
|
|
46
|
-
return Get(`${urls.identity.permissions.v1}/categories`);
|
|
47
65
|
}
|
|
48
|
-
export
|
|
49
|
-
return Post(urls.identity.roles.v2, body);
|
|
50
|
-
}
|
|
66
|
+
export default new RolesApi('default');
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
import { GetInsightsResponse, GetRecommendationsResponse } from './interfaces';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class SecurityCenterApi extends BaseApiClient {
|
|
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;
|
package/security-center/index.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { Get } from '../fetch';
|
|
2
1
|
import { urls } from '../constants';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class SecurityCenterApi extends BaseApiClient {
|
|
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
|
+
|
|
5
16
|
}
|
|
6
|
-
export
|
|
7
|
-
return Get(urls.securityCenter.insights.v1);
|
|
8
|
-
}
|
|
17
|
+
export default new SecurityCenterApi('default');
|
package/sub-tenants/index.d.ts
CHANGED
|
@@ -1,15 +1,57 @@
|
|
|
1
|
-
import { PaginationResult, UserJwtOptions } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { PaginationResult, UserJwtOptions } from '../interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
import { AddUsersToSubTenantRequest, AddUserToSubTenantsRequest, CreateSubTenantRequest, CreateSubTenantResponse, ILoadAllUsers, ISubTenantUser, RemoveUserFromSubTenantsRequest, UpdateSubAccountAccessRequestDto, UpdateSubTenantHierarchySettingsRequest, UpdateSubTenantManagementRequest, UpdateSubTenantRequest, UpdateSubTenantRequestParams, UpdateUserRolesForSubTenantsRequestDto } from './interfaces';
|
|
4
|
+
export declare class SubTenantsApi extends BaseApiClient {
|
|
5
|
+
constructor(appName: string);
|
|
6
|
+
/**
|
|
7
|
+
* Loads all users based on given parameters.
|
|
8
|
+
*/
|
|
9
|
+
loadAllUsers: (params: ILoadAllUsers) => Promise<PaginationResult<ISubTenantUser>>;
|
|
10
|
+
/**
|
|
11
|
+
* Adds a user to a tenant and its sub-tenants.
|
|
12
|
+
*/
|
|
13
|
+
addUserToTenantAndSubTenants: (body: AddUserToSubTenantsRequest) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Removes a user from a tenant and its sub-tenants.
|
|
16
|
+
*/
|
|
17
|
+
removeUserFromTenantAndSubTenants: (body: RemoveUserFromSubTenantsRequest, options?: UserJwtOptions | undefined) => Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Adds user roles for sub-tenants.
|
|
20
|
+
*/
|
|
21
|
+
addUserRolesForSubTenants: (userId: string, body: UpdateUserRolesForSubTenantsRequestDto, options?: UserJwtOptions | undefined) => Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Removes user roles from sub-tenants.
|
|
24
|
+
*/
|
|
25
|
+
removeUserRolesFromSubTenants: (userId: string, body: UpdateUserRolesForSubTenantsRequestDto, options?: UserJwtOptions | undefined) => Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Sets user roles for sub-tenants.
|
|
28
|
+
*/
|
|
29
|
+
setUserRolesForSubTenants: (userId: string, body: UpdateUserRolesForSubTenantsRequestDto, options?: UserJwtOptions | undefined) => Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new sub-tenant.
|
|
32
|
+
*/
|
|
33
|
+
createSubTenant: (body: CreateSubTenantRequest, options?: UserJwtOptions | undefined) => Promise<CreateSubTenantResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Deletes a sub-tenant.
|
|
36
|
+
*/
|
|
37
|
+
deleteSubTenant: (tenantId: string, options?: UserJwtOptions | undefined) => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Updates sub-tenant information.
|
|
40
|
+
*/
|
|
41
|
+
updateSubTenant: ({ tenantId }: UpdateSubTenantRequestParams, body: UpdateSubTenantRequest, options?: UserJwtOptions | undefined) => Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Updates sub-tenant management information.
|
|
44
|
+
*/
|
|
45
|
+
updateSubTenantManagement: ({ tenantId }: UpdateSubTenantRequestParams, body: UpdateSubTenantManagementRequest, options?: UserJwtOptions | undefined) => Promise<CreateSubTenantResponse>;
|
|
46
|
+
updateSubTenantHierarchySettings({ tenantId }: UpdateSubTenantRequestParams, body: UpdateSubTenantHierarchySettingsRequest, options?: UserJwtOptions): Promise<CreateSubTenantResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Updates sub-account access.
|
|
49
|
+
*/
|
|
50
|
+
updateSubAccountAccess: (userId: string, body: UpdateSubAccountAccessRequestDto, options?: UserJwtOptions | undefined) => Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Adds multiple users to a sub-tenant.
|
|
53
|
+
*/
|
|
54
|
+
addUsersToSubTenant: (body: AddUsersToSubTenantRequest, options?: UserJwtOptions | undefined) => Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
declare const _default: SubTenantsApi;
|
|
57
|
+
export default _default;
|
package/sub-tenants/index.js
CHANGED
|
@@ -1,69 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
import { urls } from '../constants';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class SubTenantsApi extends BaseApiClient {
|
|
4
|
+
constructor(appName) {
|
|
5
|
+
super(appName);
|
|
6
|
+
|
|
7
|
+
this.loadAllUsers = async params => {
|
|
8
|
+
return this.get(urls.identity.subTenants.v1, params);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
this.addUserToTenantAndSubTenants = async body => {
|
|
12
|
+
return this.post(urls.identity.subTenants.v1, body);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
this.removeUserFromTenantAndSubTenants = async (body, options) => {
|
|
16
|
+
return this.delete(urls.identity.subTenants.v1, body, {
|
|
17
|
+
headers: this.extractHeadersFromOptions(options)
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
this.addUserRolesForSubTenants = async (userId, body, options) => {
|
|
22
|
+
return this.post(`${urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
23
|
+
headers: this.extractHeadersFromOptions(options)
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
this.removeUserRolesFromSubTenants = async (userId, body, options) => {
|
|
28
|
+
return this.delete(`${urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
29
|
+
headers: this.extractHeadersFromOptions(options)
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
this.setUserRolesForSubTenants = async (userId, body, options) => {
|
|
34
|
+
return this.patch(`${urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
35
|
+
headers: this.extractHeadersFromOptions(options)
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
this.createSubTenant = async (body, options) => {
|
|
40
|
+
return this.post(urls.tenants.subTenants.v1, body, {
|
|
41
|
+
headers: this.extractHeadersFromOptions(options)
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
this.deleteSubTenant = async (tenantId, options) => {
|
|
46
|
+
return this.delete(`${urls.tenants.subTenants.v1}/${tenantId}`, undefined, {
|
|
47
|
+
headers: this.extractHeadersFromOptions(options)
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
this.updateSubTenant = async ({
|
|
52
|
+
tenantId
|
|
53
|
+
}, body, options) => {
|
|
54
|
+
return this.patch(`${urls.tenants.subTenants.v1}/${tenantId}`, body, {
|
|
55
|
+
headers: this.extractHeadersFromOptions(options)
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
this.updateSubTenantManagement = async ({
|
|
60
|
+
tenantId
|
|
61
|
+
}, body, options) => {
|
|
62
|
+
return this.put(`${urls.tenants.subTenants.v1}/${tenantId}/management`, body, {
|
|
63
|
+
headers: this.extractHeadersFromOptions(options)
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
this.updateSubAccountAccess = async (userId, body, options) => {
|
|
68
|
+
return this.put(`${urls.identity.subTenants.v1}/${userId}/access`, body, {
|
|
69
|
+
headers: this.extractHeadersFromOptions(options)
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
this.addUsersToSubTenant = async (body, options) => {
|
|
74
|
+
return this.post(`${urls.identity.subTenants.v2}/`, body, {
|
|
75
|
+
headers: this.extractHeadersFromOptions(options)
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
updateSubTenantHierarchySettings({
|
|
81
|
+
tenantId
|
|
82
|
+
}, body, options) {
|
|
83
|
+
return this.put(`${urls.tenants.subTenants.v1}/${tenantId}/hierarchy-settings`, body, {
|
|
84
|
+
headers: this.extractHeadersFromOptions(options)
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
5
88
|
}
|
|
6
|
-
export
|
|
7
|
-
return Post(urls.identity.subTenants.v1, body);
|
|
8
|
-
}
|
|
9
|
-
export async function removeUserFromTenantAndSubTenants(body, options) {
|
|
10
|
-
return Delete(urls.identity.subTenants.v1, body, {
|
|
11
|
-
headers: extractHeadersFromOptions(options)
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
export async function addUserRolesForSubTenants(userId, body, options) {
|
|
15
|
-
return Post(`${urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
16
|
-
headers: extractHeadersFromOptions(options)
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
export async function removeUserRolesFromSubTenants(userId, body, options) {
|
|
20
|
-
return Delete(`${urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
21
|
-
headers: extractHeadersFromOptions(options)
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
export async function setUserRolesForSubTenants(userId, body, options) {
|
|
25
|
-
return Patch(`${urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
26
|
-
headers: extractHeadersFromOptions(options)
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export async function createSubTenant(body, options) {
|
|
30
|
-
return Post(urls.tenants.subTenants.v1, body, {
|
|
31
|
-
headers: extractHeadersFromOptions(options)
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
export async function deleteSubTenant(tenantId, options) {
|
|
35
|
-
return Delete(`${urls.tenants.subTenants.v1}/${tenantId}`, undefined, {
|
|
36
|
-
headers: extractHeadersFromOptions(options)
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
export async function updateSubTenant({
|
|
40
|
-
tenantId
|
|
41
|
-
}, body, options) {
|
|
42
|
-
return Patch(`${urls.tenants.subTenants.v1}/${tenantId}`, body, {
|
|
43
|
-
headers: extractHeadersFromOptions(options)
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
export async function updateSubTenantManagement({
|
|
47
|
-
tenantId
|
|
48
|
-
}, body, options) {
|
|
49
|
-
return Put(`${urls.tenants.subTenants.v1}/${tenantId}/management`, body, {
|
|
50
|
-
headers: extractHeadersFromOptions(options)
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
export async function updateSubTenantHierarchySettings({
|
|
54
|
-
tenantId
|
|
55
|
-
}, body, options) {
|
|
56
|
-
return Put(`${urls.tenants.subTenants.v1}/${tenantId}/hierarchy-settings`, body, {
|
|
57
|
-
headers: extractHeadersFromOptions(options)
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
export async function updateSubAccountAccess(userId, body, options) {
|
|
61
|
-
return Put(`${urls.identity.subTenants.v1}/${userId}/access`, body, {
|
|
62
|
-
headers: extractHeadersFromOptions(options)
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
export async function addUsersToSubTenant(body, options) {
|
|
66
|
-
return Post(`${urls.identity.subTenants.v2}/`, body, {
|
|
67
|
-
headers: extractHeadersFromOptions(options)
|
|
68
|
-
});
|
|
69
|
-
}
|
|
89
|
+
export default new SubTenantsApi('default');
|
package/subscriptions/index.d.ts
CHANGED
|
@@ -1,11 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
2
|
+
export declare class SubscriptionsApi extends BaseApiClient {
|
|
3
|
+
constructor(appName: string);
|
|
4
|
+
private readonly invoicesApi;
|
|
5
|
+
private readonly managedSubscriptionApi;
|
|
6
|
+
private readonly paymentMethodsApi;
|
|
7
|
+
private readonly paymentProvidersApi;
|
|
8
|
+
private readonly plansApi;
|
|
9
|
+
private readonly subscriptionApi;
|
|
10
|
+
private readonly summariesApi;
|
|
11
|
+
private readonly subscriptionTenantConfigApi;
|
|
12
|
+
private readonly vendorPublicConfigApi;
|
|
13
|
+
private readonly stripeProviderApi;
|
|
14
|
+
/** InvoicesApi **/
|
|
15
|
+
getSubscriptionInvoices: () => Promise<import("./interfaces").ISubscriptionInvoiceResponse[]>;
|
|
16
|
+
getSubscriptionInvoice: (invoiceId: string) => Promise<import("./interfaces").ISubscriptionInvoiceResponse>;
|
|
17
|
+
getSubscriptionInvoicePdf: (invoiceId: string, outputFileName?: string | undefined) => Promise<void>;
|
|
18
|
+
/** ManagedSubscriptionApi **/
|
|
19
|
+
getManagedSubscription: (subscriptionId: string) => Promise<import("./interfaces").ISubscriptionResponse>;
|
|
20
|
+
getManagedSubscriptions: () => Promise<import("./interfaces").ISubscriptionResponse[]>;
|
|
21
|
+
cancelManagedSubscription: (subscriptionId: string) => Promise<void>;
|
|
22
|
+
renewManagedSubscription: (subscriptionId: string) => Promise<void>;
|
|
23
|
+
updateManagedSubscription: (subscriptionId: string, { paymentMethodId, planId }: import("./interfaces").IUpdateManagedSubscriptionRequest) => Promise<void>;
|
|
24
|
+
/** PaymentMethodsApi **/
|
|
25
|
+
getPaymentMethods: () => Promise<import("./interfaces").ISubscriptionPaymentMethodResponse[]>;
|
|
26
|
+
getPaymentMethod: (paymentMethodId: string) => Promise<import("./interfaces").ISubscriptionPaymentMethodResponse>;
|
|
27
|
+
updatePaymentMethodBillingDetails: (paymentMethodId: string, { email, ...address }: import("./interfaces").ISubscriptionUpdatePaymentMethodBillingDetails) => Promise<import("./interfaces").ISubscriptionUpdatePaymentMethodBillingDetails>;
|
|
28
|
+
/** PaymentProvidersApi **/
|
|
29
|
+
getPaymentProviders: () => Promise<import("./interfaces").IPaymentProviderResponse[]>;
|
|
30
|
+
/** PlansApi **/
|
|
31
|
+
getSubscriptionPlans: () => Promise<import("./interfaces").IPlanResponse[]>;
|
|
32
|
+
getSubscriptionPlan: (planId: string) => Promise<import("./interfaces").IPlanResponse[]>;
|
|
33
|
+
/** SubscriptionApi **/
|
|
34
|
+
getSubscriptions: () => Promise<import("./interfaces").ISubscriptionResponse[]>;
|
|
35
|
+
getSubscription: (subscriptionId: string) => Promise<import("./interfaces").ISubscriptionResponse>;
|
|
36
|
+
cancelSubscription: (subscriptionId: string) => Promise<void>;
|
|
37
|
+
renewSubscription: (subscriptionId: string) => Promise<void>;
|
|
38
|
+
updateSubscription: (subscriptionId: string, { paymentMethodId, planId }: import("./interfaces").IUpdateSubscriptionRequest) => Promise<void>;
|
|
39
|
+
/** SummariesApi **/
|
|
40
|
+
getSubscriptionSummaries: (tenantId: string) => Promise<import("./interfaces").ISubscriptionSummariesResponse>;
|
|
41
|
+
/** SubscriptionTenantConfigApi **/
|
|
42
|
+
getTenantConfiguration: (tenantId: string) => Promise<import("./interfaces").ITenantConfigurationResponse>;
|
|
43
|
+
createTenantConfiguration: (request: import("./interfaces").ICreateTenantConfigurationRequest) => Promise<import("./interfaces").ICreateTenantConfigurationResponse>;
|
|
44
|
+
/** VendorPublicConfigApi **/
|
|
45
|
+
getVendorPublicConfigurations: () => Promise<import("./interfaces").IVendorPublicConfigurationResponse[]>;
|
|
46
|
+
/** StripeProviderApi **/
|
|
47
|
+
createSubscription: (request: import("./interfaces").ICreateStripeSubscriptionRequest) => Promise<import("./interfaces").ICreateSubscriptionResponse>;
|
|
48
|
+
getStripeCustomer: (tenantId: string) => Promise<import("./interfaces").IStripeCustomerResponse>;
|
|
49
|
+
createStripeCustomer: (request: import("./interfaces").ICreateStripeCustomerRequest) => Promise<import("./interfaces").ICreateStripeCustomerResponse>;
|
|
50
|
+
getStripePaymentProviderConfiguration: () => Promise<import("./interfaces").IStripePaymentProviderConfigurationResponse>;
|
|
51
|
+
createStripePaymentMethodSetupIntentSecret: (request: import("./interfaces").ICreateStripePaymentMethodSetupRequest) => Promise<import("./interfaces").ICreateStripePaymentMethodSetupResponse>;
|
|
52
|
+
}
|
|
53
|
+
declare const _default: SubscriptionsApi;
|
|
54
|
+
export default _default;
|
|
55
|
+
export * from './interfaces';
|
|
56
|
+
export * from './enums';
|
package/subscriptions/index.js
CHANGED
|
@@ -1,11 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
2
|
+
import { InvoicesApi } from './invoices';
|
|
3
|
+
import { ManagedSubscriptionApi } from './managedSubscriptions';
|
|
4
|
+
import { PaymentMethodsApi } from './paymentMethods';
|
|
5
|
+
import { PaymentProvidersApi } from './paymentProviders';
|
|
6
|
+
import { PlansApi } from './plans';
|
|
7
|
+
import { SubscriptionApi } from './subscriptions';
|
|
8
|
+
import { SummariesApi } from './summaries';
|
|
9
|
+
import { SubscriptionTenantConfigApi } from './tenantConfiguration';
|
|
10
|
+
import { VendorPublicConfigApi } from './vendorPublicConfigurations';
|
|
11
|
+
import { StripeProviderApi } from './providers/stripe';
|
|
12
|
+
export class SubscriptionsApi extends BaseApiClient {
|
|
13
|
+
constructor(appName) {
|
|
14
|
+
super(appName);
|
|
15
|
+
this.invoicesApi = new InvoicesApi(this.appName);
|
|
16
|
+
this.managedSubscriptionApi = new ManagedSubscriptionApi(this.appName);
|
|
17
|
+
this.paymentMethodsApi = new PaymentMethodsApi(this.appName);
|
|
18
|
+
this.paymentProvidersApi = new PaymentProvidersApi(this.appName);
|
|
19
|
+
this.plansApi = new PlansApi(this.appName);
|
|
20
|
+
this.subscriptionApi = new SubscriptionApi(this.appName);
|
|
21
|
+
this.summariesApi = new SummariesApi(this.appName);
|
|
22
|
+
this.subscriptionTenantConfigApi = new SubscriptionTenantConfigApi(this.appName);
|
|
23
|
+
this.vendorPublicConfigApi = new VendorPublicConfigApi(this.appName);
|
|
24
|
+
this.stripeProviderApi = new StripeProviderApi(this.appName);
|
|
25
|
+
this.getSubscriptionInvoices = this.invoicesApi.getSubscriptionInvoices.bind(this.invoicesApi);
|
|
26
|
+
this.getSubscriptionInvoice = this.invoicesApi.getSubscriptionInvoice.bind(this.invoicesApi);
|
|
27
|
+
this.getSubscriptionInvoicePdf = this.invoicesApi.getSubscriptionInvoicePdf.bind(this.invoicesApi);
|
|
28
|
+
this.getManagedSubscription = this.managedSubscriptionApi.getManagedSubscription.bind(this.managedSubscriptionApi);
|
|
29
|
+
this.getManagedSubscriptions = this.managedSubscriptionApi.getManagedSubscriptions.bind(this.managedSubscriptionApi);
|
|
30
|
+
this.cancelManagedSubscription = this.managedSubscriptionApi.cancelManagedSubscription.bind(this.managedSubscriptionApi);
|
|
31
|
+
this.renewManagedSubscription = this.managedSubscriptionApi.renewManagedSubscription.bind(this.managedSubscriptionApi);
|
|
32
|
+
this.updateManagedSubscription = this.managedSubscriptionApi.updateManagedSubscription.bind(this.managedSubscriptionApi);
|
|
33
|
+
this.getPaymentMethods = this.paymentMethodsApi.getPaymentMethods.bind(this.paymentMethodsApi);
|
|
34
|
+
this.getPaymentMethod = this.paymentMethodsApi.getPaymentMethod.bind(this.paymentMethodsApi);
|
|
35
|
+
this.updatePaymentMethodBillingDetails = this.paymentMethodsApi.updatePaymentMethodBillingDetails.bind(this.paymentMethodsApi);
|
|
36
|
+
this.getPaymentProviders = this.paymentProvidersApi.getPaymentProviders.bind(this.paymentProvidersApi);
|
|
37
|
+
this.getSubscriptionPlans = this.plansApi.getSubscriptionPlans.bind(this.plansApi);
|
|
38
|
+
this.getSubscriptionPlan = this.plansApi.getSubscriptionPlan.bind(this.plansApi);
|
|
39
|
+
this.getSubscriptions = this.subscriptionApi.getSubscriptions.bind(this.subscriptionApi);
|
|
40
|
+
this.getSubscription = this.subscriptionApi.getSubscription.bind(this.subscriptionApi);
|
|
41
|
+
this.cancelSubscription = this.subscriptionApi.cancelSubscription.bind(this.subscriptionApi);
|
|
42
|
+
this.renewSubscription = this.subscriptionApi.renewSubscription.bind(this.subscriptionApi);
|
|
43
|
+
this.updateSubscription = this.subscriptionApi.updateSubscription.bind(this.subscriptionApi);
|
|
44
|
+
this.getSubscriptionSummaries = this.summariesApi.getSubscriptionSummaries.bind(this.summariesApi);
|
|
45
|
+
this.getTenantConfiguration = this.subscriptionTenantConfigApi.getTenantConfiguration.bind(this.subscriptionTenantConfigApi);
|
|
46
|
+
this.createTenantConfiguration = this.subscriptionTenantConfigApi.createTenantConfiguration.bind(this.subscriptionTenantConfigApi);
|
|
47
|
+
this.getVendorPublicConfigurations = this.vendorPublicConfigApi.getVendorPublicConfigurations.bind(this.vendorPublicConfigApi);
|
|
48
|
+
this.createSubscription = this.stripeProviderApi.createSubscription.bind(this.stripeProviderApi);
|
|
49
|
+
this.getStripeCustomer = this.stripeProviderApi.getStripeCustomer.bind(this.stripeProviderApi);
|
|
50
|
+
this.createStripeCustomer = this.stripeProviderApi.createStripeCustomer.bind(this.stripeProviderApi);
|
|
51
|
+
this.getStripePaymentProviderConfiguration = this.stripeProviderApi.getStripePaymentProviderConfiguration.bind(this.stripeProviderApi);
|
|
52
|
+
this.createStripePaymentMethodSetupIntentSecret = this.stripeProviderApi.createStripePaymentMethodSetupIntentSecret.bind(this.stripeProviderApi);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
export default new SubscriptionsApi('default');
|
|
57
|
+
export * from './interfaces';
|
|
58
|
+
export * from './enums';
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { ISubscriptionInvoiceResponse } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { ISubscriptionInvoiceResponse } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class InvoicesApi extends BaseApiClient {
|
|
4
|
+
/**
|
|
5
|
+
* Get subscription invoices
|
|
6
|
+
*/
|
|
7
|
+
getSubscriptionInvoices: () => Promise<ISubscriptionInvoiceResponse[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Get subscription invoice
|
|
10
|
+
*/
|
|
11
|
+
getSubscriptionInvoice: (invoiceId: string) => Promise<ISubscriptionInvoiceResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Get subscription invoice pdf file
|
|
14
|
+
*/
|
|
15
|
+
getSubscriptionInvoicePdf: (invoiceId: string, outputFileName?: string | undefined) => Promise<void>;
|
|
16
|
+
}
|