@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
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
import { urls } from '../constants';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class InvoicesApi extends BaseApiClient {
|
|
4
|
+
constructor(...args) {
|
|
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
|
+
|
|
5
24
|
}
|
|
6
|
-
|
|
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
|
-
}
|
|
25
|
+
;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { ISubscriptionResponse, IUpdateManagedSubscriptionRequest } from
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { ISubscriptionResponse, IUpdateManagedSubscriptionRequest } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class ManagedSubscriptionApi extends BaseApiClient {
|
|
4
|
+
getManagedSubscription: (subscriptionId: string) => Promise<ISubscriptionResponse>;
|
|
5
|
+
getManagedSubscriptions: () => Promise<ISubscriptionResponse[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Cancel tenant subscription
|
|
8
|
+
*/
|
|
9
|
+
cancelManagedSubscription: (subscriptionId: string) => Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Renew tenant subscription
|
|
12
|
+
*/
|
|
13
|
+
renewManagedSubscription: (subscriptionId: string) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Upgrade/Downgrade tenant subscription plan
|
|
16
|
+
*/
|
|
17
|
+
updateManagedSubscription: (subscriptionId: string, { paymentMethodId, planId }: IUpdateManagedSubscriptionRequest) => Promise<void>;
|
|
18
|
+
}
|
|
@@ -1,23 +1,34 @@
|
|
|
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
|
-
|
|
1
|
+
import { urls } from '../constants';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class ManagedSubscriptionApi extends BaseApiClient {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
|
|
7
|
+
this.getManagedSubscription = async subscriptionId => {
|
|
8
|
+
return this.get(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
this.getManagedSubscriptions = async () => {
|
|
12
|
+
return this.get(urls.subscriptions.managedSubscriptions.v1);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
this.cancelManagedSubscription = async subscriptionId => {
|
|
16
|
+
return this.put(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/cancellations/`, {});
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
this.renewManagedSubscription = async subscriptionId => {
|
|
20
|
+
return this.put(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/renewals/`, {});
|
|
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
|
+
|
|
23
34
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { ISubscriptionPaymentMethodResponse, ISubscriptionUpdatePaymentMethodBillingDetails } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { ISubscriptionPaymentMethodResponse, ISubscriptionUpdatePaymentMethodBillingDetails } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class PaymentMethodsApi extends BaseApiClient {
|
|
4
|
+
/**
|
|
5
|
+
* Get payment methods
|
|
6
|
+
*/
|
|
7
|
+
getPaymentMethods: () => Promise<ISubscriptionPaymentMethodResponse[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Get payment method
|
|
10
|
+
*/
|
|
11
|
+
getPaymentMethod: (paymentMethodId: string) => Promise<ISubscriptionPaymentMethodResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Update payment method billing details
|
|
14
|
+
*/
|
|
15
|
+
updatePaymentMethodBillingDetails: (paymentMethodId: string, { email, ...address }: ISubscriptionUpdatePaymentMethodBillingDetails) => Promise<ISubscriptionUpdatePaymentMethodBillingDetails>;
|
|
16
|
+
}
|
|
@@ -1,21 +1,30 @@
|
|
|
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
|
-
|
|
3
|
+
import { urls } from '../constants';
|
|
4
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
5
|
+
export class PaymentMethodsApi extends BaseApiClient {
|
|
6
|
+
constructor(...args) {
|
|
7
|
+
super(...args);
|
|
8
|
+
|
|
9
|
+
this.getPaymentMethods = async () => {
|
|
10
|
+
return this.get(urls.subscriptions.billing.paymentMethods.v1);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
this.getPaymentMethod = async paymentMethodId => {
|
|
14
|
+
return this.get(`${urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}`);
|
|
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
|
+
}
|
|
16
29
|
|
|
17
|
-
return Patch(`${urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}/billing-details`, {
|
|
18
|
-
email,
|
|
19
|
-
address
|
|
20
|
-
});
|
|
21
30
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { IPaymentProviderResponse } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IPaymentProviderResponse } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class PaymentProvidersApi extends BaseApiClient {
|
|
4
|
+
/**
|
|
5
|
+
* Gets payment providers for vendor
|
|
6
|
+
*/
|
|
7
|
+
getPaymentProviders: () => Promise<IPaymentProviderResponse[]>;
|
|
8
|
+
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
import { urls } from '../constants';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class PaymentProvidersApi extends BaseApiClient {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
|
|
7
|
+
this.getPaymentProviders = async () => {
|
|
8
|
+
return this.get(urls.subscriptions.paymentProviders.v1);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
}
|
package/subscriptions/plans.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { IPlanResponse } from './interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class PlansApi extends BaseApiClient {
|
|
4
|
+
/**
|
|
5
|
+
* Gets subscription plans
|
|
6
|
+
*/
|
|
7
|
+
getSubscriptionPlans: () => Promise<IPlanResponse[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Gets subscription plan singular
|
|
10
|
+
*/
|
|
11
|
+
getSubscriptionPlan: (planId: string) => Promise<IPlanResponse[]>;
|
|
12
|
+
}
|
package/subscriptions/plans.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { Get } from '../fetch';
|
|
2
1
|
import { urls } from '../constants';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class PlansApi extends BaseApiClient {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
|
|
7
|
+
this.getSubscriptionPlans = async () => {
|
|
8
|
+
return this.get(urls.subscriptions.billing.plans.v1);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
this.getSubscriptionPlan = async planId => {
|
|
12
|
+
return this.get(`${urls.subscriptions.billing.plans.v1}/${planId}`);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { ICreateStripeCustomerRequest, ICreateStripeCustomerResponse, ICreateStripeSubscriptionRequest, ICreateSubscriptionResponse, IStripeCustomerResponse, IStripePaymentProviderConfigurationResponse, ICreateStripePaymentMethodSetupRequest, ICreateStripePaymentMethodSetupResponse } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { ICreateStripeCustomerRequest, ICreateStripeCustomerResponse, ICreateStripeSubscriptionRequest, ICreateSubscriptionResponse, IStripeCustomerResponse, IStripePaymentProviderConfigurationResponse, ICreateStripePaymentMethodSetupRequest, ICreateStripePaymentMethodSetupResponse } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../../../BaseApiClient';
|
|
3
|
+
export declare class StripeProviderApi extends BaseApiClient {
|
|
4
|
+
/**
|
|
5
|
+
* Creates new stripe subscription
|
|
6
|
+
* @param request
|
|
7
|
+
*/
|
|
8
|
+
createSubscription: (request: ICreateStripeSubscriptionRequest) => Promise<ICreateSubscriptionResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Fetch tenant mapping external stripe customer object
|
|
11
|
+
*/
|
|
12
|
+
getStripeCustomer: (tenantId: string) => Promise<IStripeCustomerResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Create tenant mapping external stripe customer object
|
|
15
|
+
* @param request
|
|
16
|
+
*/
|
|
17
|
+
createStripeCustomer: (request: ICreateStripeCustomerRequest) => Promise<ICreateStripeCustomerResponse>;
|
|
18
|
+
getStripePaymentProviderConfiguration: () => Promise<IStripePaymentProviderConfigurationResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Create payment method intent secret
|
|
21
|
+
* @param request
|
|
22
|
+
*/
|
|
23
|
+
createStripePaymentMethodSetupIntentSecret: (request: ICreateStripePaymentMethodSetupRequest) => Promise<ICreateStripePaymentMethodSetupResponse>;
|
|
24
|
+
}
|
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { urls } from '../../../constants';
|
|
2
|
+
import { BaseApiClient } from '../../../BaseApiClient';
|
|
3
|
+
export class StripeProviderApi extends BaseApiClient {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
|
|
7
|
+
this.createSubscription = async request => {
|
|
8
|
+
return this.post(urls.subscriptions.billing.paymentProviders.stripe.subscriptions.v1, request);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
this.getStripeCustomer = async tenantId => {
|
|
12
|
+
return this.get(`${urls.subscriptions.billing.paymentProviders.stripe.customers.v1}/${tenantId}`);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
this.createStripeCustomer = async request => {
|
|
16
|
+
return this.post(urls.subscriptions.billing.paymentProviders.stripe.customers.v1, request);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
this.getStripePaymentProviderConfiguration = async () => {
|
|
20
|
+
return this.get(urls.subscriptions.billing.paymentProviders.stripe.publicConfigurations.v1);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
this.createStripePaymentMethodSetupIntentSecret = async request => {
|
|
24
|
+
return this.post(urls.subscriptions.billing.paymentProviders.stripe.setupIntents.v1, request);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
17
28
|
}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { ISubscriptionResponse, IUpdateSubscriptionRequest } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { ISubscriptionResponse, IUpdateSubscriptionRequest } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class SubscriptionApi extends BaseApiClient {
|
|
4
|
+
/**
|
|
5
|
+
* Get tenant subscriptions
|
|
6
|
+
*/
|
|
7
|
+
getSubscriptions: () => Promise<ISubscriptionResponse[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Get tenant subscription
|
|
10
|
+
*/
|
|
11
|
+
getSubscription: (subscriptionId: string) => Promise<ISubscriptionResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Cancel tenant subscription
|
|
14
|
+
*/
|
|
15
|
+
cancelSubscription: (subscriptionId: string) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Renew tenant subscription
|
|
18
|
+
*/
|
|
19
|
+
renewSubscription: (subscriptionId: string) => Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Upgrade/Downgrade tenant subscription plan
|
|
22
|
+
*/
|
|
23
|
+
updateSubscription: (subscriptionId: string, { paymentMethodId, planId }: IUpdateSubscriptionRequest) => Promise<void>;
|
|
24
|
+
}
|
|
@@ -1,23 +1,34 @@
|
|
|
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
|
-
|
|
1
|
+
import { urls } from '../constants';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class SubscriptionApi extends BaseApiClient {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
|
|
7
|
+
this.getSubscriptions = async () => {
|
|
8
|
+
return this.get(urls.subscriptions.billing.subscriptions.v1);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
this.getSubscription = async subscriptionId => {
|
|
12
|
+
return this.get(`${urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}`);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
this.cancelSubscription = async subscriptionId => {
|
|
16
|
+
return this.put(`${urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}/cancellations/`, {});
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
this.renewSubscription = async subscriptionId => {
|
|
20
|
+
return this.put(`${urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}/renewals/`, {});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
this.updateSubscription = async (subscriptionId, {
|
|
24
|
+
paymentMethodId,
|
|
25
|
+
planId
|
|
26
|
+
}) => {
|
|
27
|
+
return this.put(`${urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}`, {
|
|
28
|
+
paymentMethodId,
|
|
29
|
+
planId
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
23
34
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ISubscriptionSummariesResponse } from './interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class SummariesApi extends BaseApiClient {
|
|
4
|
+
/**
|
|
5
|
+
* Gets subscription summaries
|
|
6
|
+
*/
|
|
7
|
+
getSubscriptionSummaries: (tenantId: string) => Promise<ISubscriptionSummariesResponse>;
|
|
8
|
+
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { Get } from '../fetch';
|
|
2
1
|
import { urls } from '../constants';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class SummariesApi extends BaseApiClient {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
|
|
7
|
+
this.getSubscriptionSummaries = async tenantId => {
|
|
8
|
+
return this.get(`${urls.subscriptions.billing.summaries.v1}/${tenantId}`);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { ICreateTenantConfigurationRequest, ICreateTenantConfigurationResponse, ITenantConfigurationResponse } from
|
|
2
|
-
|
|
3
|
-
export declare
|
|
1
|
+
import { ICreateTenantConfigurationRequest, ICreateTenantConfigurationResponse, ITenantConfigurationResponse } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class SubscriptionTenantConfigApi extends BaseApiClient {
|
|
4
|
+
getTenantConfiguration: (tenantId: string) => Promise<ITenantConfigurationResponse>;
|
|
5
|
+
createTenantConfiguration: (request: ICreateTenantConfigurationRequest) => Promise<ICreateTenantConfigurationResponse>;
|
|
6
|
+
}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { urls } from '../constants';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class SubscriptionTenantConfigApi extends BaseApiClient {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
|
|
7
|
+
this.getTenantConfiguration = async tenantId => {
|
|
8
|
+
return this.get(`${urls.subscriptions.billing.tenantConfiguration.v1}/${tenantId}`);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
this.createTenantConfiguration = async request => {
|
|
12
|
+
return this.post(urls.subscriptions.billing.tenantConfiguration.v1, request);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { IVendorPublicConfigurationResponse } from
|
|
2
|
-
|
|
1
|
+
import { IVendorPublicConfigurationResponse } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class VendorPublicConfigApi extends BaseApiClient {
|
|
4
|
+
getVendorPublicConfigurations: () => Promise<IVendorPublicConfigurationResponse[]>;
|
|
5
|
+
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
import { urls } from '../constants';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class VendorPublicConfigApi extends BaseApiClient {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
|
|
7
|
+
this.getVendorPublicConfigurations = async () => {
|
|
8
|
+
return this.get(urls.subscriptions.billing.configurations.vendorPublicConfigurations.v1);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
}
|