@frontegg/rest-api 3.1.76-alpha.9502349697 → 3.1.76-alpha.9794353373
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 +30 -108
- package/ContextHolder/index.js +57 -153
- 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 +27 -126
- 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 +57 -153
- 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 -69
- 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 -58
- 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/sub-tenants/index.d.ts
CHANGED
|
@@ -1,57 +1,15 @@
|
|
|
1
|
-
import { PaginationResult, UserJwtOptions } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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;
|
|
1
|
+
import { PaginationResult, UserJwtOptions } from "../interfaces";
|
|
2
|
+
import { AddUsersToSubTenantRequest, AddUserToSubTenantsRequest, CreateSubTenantRequest, CreateSubTenantResponse, ILoadAllUsers, ISubTenantUser, RemoveUserFromSubTenantsRequest, UpdateSubAccountAccessRequestDto, UpdateSubTenantHierarchySettingsRequest, UpdateSubTenantManagementRequest, UpdateSubTenantRequest, UpdateSubTenantRequestParams, UpdateUserRolesForSubTenantsRequestDto } from "./interfaces";
|
|
3
|
+
export declare function loadAllUsers(params: ILoadAllUsers): Promise<PaginationResult<ISubTenantUser>>;
|
|
4
|
+
export declare function addUserToTenantAndSubTenants(body: AddUserToSubTenantsRequest): Promise<void>;
|
|
5
|
+
export declare function removeUserFromTenantAndSubTenants(body: RemoveUserFromSubTenantsRequest, options?: UserJwtOptions): Promise<void>;
|
|
6
|
+
export declare function addUserRolesForSubTenants(userId: string, body: UpdateUserRolesForSubTenantsRequestDto, options?: UserJwtOptions): Promise<void>;
|
|
7
|
+
export declare function removeUserRolesFromSubTenants(userId: string, body: UpdateUserRolesForSubTenantsRequestDto, options?: UserJwtOptions): Promise<void>;
|
|
8
|
+
export declare function setUserRolesForSubTenants(userId: string, body: UpdateUserRolesForSubTenantsRequestDto, options?: UserJwtOptions): Promise<void>;
|
|
9
|
+
export declare function createSubTenant(body: CreateSubTenantRequest, options?: UserJwtOptions): Promise<CreateSubTenantResponse>;
|
|
10
|
+
export declare function deleteSubTenant(tenantId: string, options?: UserJwtOptions): Promise<void>;
|
|
11
|
+
export declare function updateSubTenant({ tenantId }: UpdateSubTenantRequestParams, body: UpdateSubTenantRequest, options?: UserJwtOptions): Promise<void>;
|
|
12
|
+
export declare function updateSubTenantManagement({ tenantId }: UpdateSubTenantRequestParams, body: UpdateSubTenantManagementRequest, options?: UserJwtOptions): Promise<CreateSubTenantResponse>;
|
|
13
|
+
export declare function updateSubTenantHierarchySettings({ tenantId }: UpdateSubTenantRequestParams, body: UpdateSubTenantHierarchySettingsRequest, options?: UserJwtOptions): Promise<CreateSubTenantResponse>;
|
|
14
|
+
export declare function updateSubAccountAccess(userId: string, body: UpdateSubAccountAccessRequestDto, options?: UserJwtOptions): Promise<void>;
|
|
15
|
+
export declare function addUsersToSubTenant(body: AddUsersToSubTenantRequest, options?: UserJwtOptions): Promise<void>;
|
package/sub-tenants/index.js
CHANGED
|
@@ -1,89 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
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
|
-
|
|
1
|
+
import { Delete, extractHeadersFromOptions, Get, Patch, Post, Put } from "../fetch";
|
|
2
|
+
import { urls } from "../constants";
|
|
3
|
+
export async function loadAllUsers(params) {
|
|
4
|
+
return Get(urls.identity.subTenants.v1, params);
|
|
88
5
|
}
|
|
89
|
-
export
|
|
6
|
+
export async function addUserToTenantAndSubTenants(body) {
|
|
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
|
+
}
|
package/subscriptions/index.d.ts
CHANGED
|
@@ -1,56 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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';
|
|
1
|
+
export * from "./subscriptions";
|
|
2
|
+
export * from "./managedSubscriptions";
|
|
3
|
+
export * from "./plans";
|
|
4
|
+
export * from "./invoices";
|
|
5
|
+
export * from "./paymentMethods";
|
|
6
|
+
export * from "./providers";
|
|
7
|
+
export * from "./summaries";
|
|
8
|
+
export * from "./tenantConfiguration";
|
|
9
|
+
export * from "./paymentProviders";
|
|
10
|
+
export * from "./vendorPublicConfigurations";
|
|
11
|
+
export * from "./enums";
|
package/subscriptions/index.js
CHANGED
|
@@ -1,58 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
export * from "./subscriptions";
|
|
2
|
+
export * from "./managedSubscriptions";
|
|
3
|
+
export * from "./plans";
|
|
4
|
+
export * from "./invoices";
|
|
5
|
+
export * from "./paymentMethods";
|
|
6
|
+
export * from "./providers";
|
|
7
|
+
export * from "./summaries";
|
|
8
|
+
export * from "./tenantConfiguration";
|
|
9
|
+
export * from "./paymentProviders";
|
|
10
|
+
export * from "./vendorPublicConfigurations";
|
|
11
|
+
export * from "./enums";
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { ISubscriptionInvoiceResponse } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
getSubscriptionInvoicePdf: (invoiceId: string, outputFileName?: string | undefined) => Promise<void>;
|
|
16
|
-
}
|
|
1
|
+
import { ISubscriptionInvoiceResponse } from "./interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Get subscription invoices
|
|
4
|
+
*/
|
|
5
|
+
export declare function getSubscriptionInvoices(): Promise<ISubscriptionInvoiceResponse[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Get subscription invoice
|
|
8
|
+
*/
|
|
9
|
+
export declare function getSubscriptionInvoice(invoiceId: string): Promise<ISubscriptionInvoiceResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Get subscription invoice pdf file
|
|
12
|
+
*/
|
|
13
|
+
export declare function getSubscriptionInvoicePdf(invoiceId: string, outputFileName?: string): Promise<void>;
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
super(...args);
|
|
6
|
-
|
|
7
|
-
this.getSubscriptionInvoices = async () => {
|
|
8
|
-
return this.get(urls.subscriptions.billing.invoices.v1);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
this.getSubscriptionInvoice = async invoiceId => {
|
|
12
|
-
return this.get(`${urls.subscriptions.billing.invoices.v1}/${invoiceId}`);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
this.getSubscriptionInvoicePdf = async (invoiceId, outputFileName) => {
|
|
16
|
-
return this.get(`${urls.subscriptions.billing.invoices.v1}/${invoiceId}/pdf`, {
|
|
17
|
-
outputFileName
|
|
18
|
-
}, {
|
|
19
|
-
responseType: 'blob'
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
1
|
+
import { Get } from "../fetch";
|
|
2
|
+
import { urls } from "../constants";
|
|
3
|
+
export async function getSubscriptionInvoices() {
|
|
4
|
+
return Get(urls.subscriptions.billing.invoices.v1);
|
|
24
5
|
}
|
|
25
|
-
|
|
6
|
+
export async function getSubscriptionInvoice(invoiceId) {
|
|
7
|
+
return Get(`${urls.subscriptions.billing.invoices.v1}/${invoiceId}`);
|
|
8
|
+
}
|
|
9
|
+
export async function getSubscriptionInvoicePdf(invoiceId, outputFileName) {
|
|
10
|
+
return Get(`${urls.subscriptions.billing.invoices.v1}/${invoiceId}/pdf`, {
|
|
11
|
+
outputFileName
|
|
12
|
+
}, {
|
|
13
|
+
responseType: "blob"
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { ISubscriptionResponse, IUpdateManagedSubscriptionRequest } from
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
updateManagedSubscription: (subscriptionId: string, { paymentMethodId, planId }: IUpdateManagedSubscriptionRequest) => Promise<void>;
|
|
18
|
-
}
|
|
1
|
+
import { ISubscriptionResponse, IUpdateManagedSubscriptionRequest } from "./interfaces";
|
|
2
|
+
export declare function getManagedSubscription(subscriptionId: string): Promise<ISubscriptionResponse>;
|
|
3
|
+
export declare function getManagedSubscriptions(): Promise<ISubscriptionResponse[]>;
|
|
4
|
+
/**
|
|
5
|
+
* Cancel tenant subscription
|
|
6
|
+
*/
|
|
7
|
+
export declare function cancelManagedSubscription(subscriptionId: string): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Renew tenant subscription
|
|
10
|
+
*/
|
|
11
|
+
export declare function renewManagedSubscription(subscriptionId: string): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Upgrade/Downgrade tenant subscription plan
|
|
14
|
+
*/
|
|
15
|
+
export declare function updateManagedSubscription(subscriptionId: string, { paymentMethodId, planId }: IUpdateManagedSubscriptionRequest): Promise<void>;
|
|
@@ -1,34 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this.updateManagedSubscription = async (subscriptionId, {
|
|
24
|
-
paymentMethodId,
|
|
25
|
-
planId
|
|
26
|
-
}) => {
|
|
27
|
-
return this.put(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`, {
|
|
28
|
-
paymentMethodId,
|
|
29
|
-
planId
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
1
|
+
import { Get, Put } from "../fetch";
|
|
2
|
+
import { urls } from "../constants";
|
|
3
|
+
export async function getManagedSubscription(subscriptionId) {
|
|
4
|
+
return Get(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`);
|
|
5
|
+
}
|
|
6
|
+
export async function getManagedSubscriptions() {
|
|
7
|
+
return Get(`${urls.subscriptions.managedSubscriptions.v1}`);
|
|
8
|
+
}
|
|
9
|
+
export async function cancelManagedSubscription(subscriptionId) {
|
|
10
|
+
return Put(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/cancellations/`, {});
|
|
11
|
+
}
|
|
12
|
+
export async function renewManagedSubscription(subscriptionId) {
|
|
13
|
+
return Put(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/renewals/`, {});
|
|
14
|
+
}
|
|
15
|
+
export async function updateManagedSubscription(subscriptionId, {
|
|
16
|
+
paymentMethodId,
|
|
17
|
+
planId
|
|
18
|
+
}) {
|
|
19
|
+
return Put(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`, {
|
|
20
|
+
paymentMethodId,
|
|
21
|
+
planId
|
|
22
|
+
});
|
|
34
23
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { ISubscriptionPaymentMethodResponse, ISubscriptionUpdatePaymentMethodBillingDetails } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
updatePaymentMethodBillingDetails: (paymentMethodId: string, { email, ...address }: ISubscriptionUpdatePaymentMethodBillingDetails) => Promise<ISubscriptionUpdatePaymentMethodBillingDetails>;
|
|
16
|
-
}
|
|
1
|
+
import { ISubscriptionPaymentMethodResponse, ISubscriptionUpdatePaymentMethodBillingDetails } from "./interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Get payment methods
|
|
4
|
+
*/
|
|
5
|
+
export declare function getPaymentMethods(): Promise<ISubscriptionPaymentMethodResponse[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Get payment method
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPaymentMethod(paymentMethodId: string): Promise<ISubscriptionPaymentMethodResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Update payment method billing details
|
|
12
|
+
*/
|
|
13
|
+
export declare function updatePaymentMethodBillingDetails(paymentMethodId: string, { email, ...address }: ISubscriptionUpdatePaymentMethodBillingDetails): Promise<ISubscriptionUpdatePaymentMethodBillingDetails>;
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
const _excluded = ["email"];
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.updatePaymentMethodBillingDetails = async (paymentMethodId, _ref) => {
|
|
18
|
-
let {
|
|
19
|
-
email
|
|
20
|
-
} = _ref,
|
|
21
|
-
address = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
|
-
|
|
23
|
-
return this.patch(`${urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}/billing-details`, {
|
|
24
|
-
email,
|
|
25
|
-
address
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
}
|
|
3
|
+
import { Get, Patch } from "../fetch";
|
|
4
|
+
import { urls } from "../constants";
|
|
5
|
+
export async function getPaymentMethods() {
|
|
6
|
+
return Get(urls.subscriptions.billing.paymentMethods.v1);
|
|
7
|
+
}
|
|
8
|
+
export async function getPaymentMethod(paymentMethodId) {
|
|
9
|
+
return Get(`${urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}`);
|
|
10
|
+
}
|
|
11
|
+
export async function updatePaymentMethodBillingDetails(paymentMethodId, _ref) {
|
|
12
|
+
let {
|
|
13
|
+
email
|
|
14
|
+
} = _ref,
|
|
15
|
+
address = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
29
16
|
|
|
17
|
+
return Patch(`${urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}/billing-details`, {
|
|
18
|
+
email,
|
|
19
|
+
address
|
|
20
|
+
});
|
|
30
21
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { IPaymentProviderResponse } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
getPaymentProviders: () => Promise<IPaymentProviderResponse[]>;
|
|
8
|
-
}
|
|
1
|
+
import { IPaymentProviderResponse } from "./interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Gets payment providers for vendor
|
|
4
|
+
*/
|
|
5
|
+
export declare function getPaymentProviders(): Promise<IPaymentProviderResponse[]>;
|