@frontegg/react-hooks 5.33.1 → 5.34.1
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/{hooks-29df4f5c.js → hooks-81e8bb80.js} +11 -8
- package/index.js +1 -1
- package/node/{hooks-be556189.js → hooks-230f0815.js} +11 -6
- package/node/index.js +3 -1
- package/node/subscriptions/index.js +3 -1
- package/package.json +2 -2
- package/subscriptions/hooks.d.ts +2 -0
- package/subscriptions/index.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { subscriptionsStoreName, bindActionCreators, subscriptionActions
|
|
1
|
+
import { subscriptionsStoreName, bindActionCreators, subscriptionActions } from '@frontegg/redux-store';
|
|
2
2
|
import { u as useSelector, a as useDispatch } from './FronteggStoreContext-d6c3b684.js';
|
|
3
3
|
import { shallowEqual } from 'react-redux';
|
|
4
4
|
import { useMemo } from 'react';
|
|
@@ -44,16 +44,19 @@ const useStripeActions = () => {
|
|
|
44
44
|
const dispatch = useDispatch();
|
|
45
45
|
return useMemo(() => bindActionCreators(subscriptionActions.stripe, dispatch), [dispatch]);
|
|
46
46
|
};
|
|
47
|
+
const useSubscriptionCancellation = () => {
|
|
48
|
+
return useSelector((state) => getSubscriptionState(state).billing.subscription.cancellation, shallowEqual);
|
|
49
|
+
};
|
|
50
|
+
const useSubscriptionRenewal = () => {
|
|
51
|
+
return useSelector((state) => getSubscriptionState(state).billing.subscription.renewal, shallowEqual);
|
|
52
|
+
};
|
|
47
53
|
const useSubscription = () => {
|
|
48
54
|
return useSelector((state) => {
|
|
49
|
-
const { billing: {
|
|
50
|
-
if ((
|
|
55
|
+
const { billing: { subscription: { subscription }, }, } = getSubscriptionState(state);
|
|
56
|
+
if ((subscription === null || subscription === void 0 ? void 0 : subscription.externallyManaged) || !subscription) {
|
|
51
57
|
return null;
|
|
52
58
|
}
|
|
53
|
-
return
|
|
54
|
-
slug: plan.id,
|
|
55
|
-
name: plan.name,
|
|
56
|
-
} });
|
|
59
|
+
return subscription;
|
|
57
60
|
}, shallowEqual);
|
|
58
61
|
};
|
|
59
62
|
const useSubscriptionActions = () => {
|
|
@@ -61,4 +64,4 @@ const useSubscriptionActions = () => {
|
|
|
61
64
|
return useMemo(() => bindActionCreators(subscriptionActions.billing.subscription, dispatch), [dispatch]);
|
|
62
65
|
};
|
|
63
66
|
|
|
64
|
-
export { usePaymentProviderActions as a, usePlans as b, usePlansActions as c, useCheckout as d, useCheckoutActions as e, useBillingInformation as f, useBillingInformationActions as g, usePaymentMethod as h, usePaymentMethodActions as i, useInvoices as j, useInvoicesActions as k, useStripeState as l, useStripeActions as m,
|
|
67
|
+
export { usePaymentProviderActions as a, usePlans as b, usePlansActions as c, useCheckout as d, useCheckoutActions as e, useBillingInformation as f, useBillingInformationActions as g, usePaymentMethod as h, usePaymentMethodActions as i, useInvoices as j, useInvoicesActions as k, useStripeState as l, useStripeActions as m, useSubscriptionCancellation as n, useSubscriptionRenewal as o, useSubscription as p, useSubscriptionActions as q, usePaymentProvider as u };
|
package/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { F as FronteggStoreContext } from './FronteggStoreContext-d6c3b684.js';
|
|
|
10
10
|
export { F as FronteggStoreContext, a as useDispatch, u as useSelector, b as useStore } from './FronteggStoreContext-d6c3b684.js';
|
|
11
11
|
export { c as useAuditLogsActions, b as useAuditLogsState, a as useAuditsActions, e as useAuditsMetadataActions, d as useAuditsMetadataState, u as useAuditsState } from './auditsMetadata-9ab88593.js';
|
|
12
12
|
export { u as useConnectivityActions, a as useConnectivityState } from './hooks-6400e233.js';
|
|
13
|
-
export { f as useBillingInformation, g as useBillingInformationActions, d as useCheckout, e as useCheckoutActions, j as useInvoices, k as useInvoicesActions, h as usePaymentMethod, i as usePaymentMethodActions, u as usePaymentProvider, a as usePaymentProviderActions, b as usePlans, c as usePlansActions, m as useStripeActions, l as useStripeState,
|
|
13
|
+
export { f as useBillingInformation, g as useBillingInformationActions, d as useCheckout, e as useCheckoutActions, j as useInvoices, k as useInvoicesActions, h as usePaymentMethod, i as usePaymentMethodActions, u as usePaymentProvider, a as usePaymentProviderActions, b as usePlans, c as usePlansActions, m as useStripeActions, l as useStripeState, p as useSubscription, q as useSubscriptionActions, n as useSubscriptionCancellation, o as useSubscriptionRenewal } from './hooks-81e8bb80.js';
|
|
14
14
|
export { u as useVendorActions, a as useVendorState } from './hooks-eaf879c9.js';
|
|
15
15
|
|
|
16
16
|
const setLoading = (loading) => {
|
|
@@ -46,16 +46,19 @@ const useStripeActions = () => {
|
|
|
46
46
|
const dispatch = FronteggStoreContext.useDispatch();
|
|
47
47
|
return React.useMemo(() => reduxStore.bindActionCreators(reduxStore.subscriptionActions.stripe, dispatch), [dispatch]);
|
|
48
48
|
};
|
|
49
|
+
const useSubscriptionCancellation = () => {
|
|
50
|
+
return FronteggStoreContext.useSelector((state) => getSubscriptionState(state).billing.subscription.cancellation, reactRedux.shallowEqual);
|
|
51
|
+
};
|
|
52
|
+
const useSubscriptionRenewal = () => {
|
|
53
|
+
return FronteggStoreContext.useSelector((state) => getSubscriptionState(state).billing.subscription.renewal, reactRedux.shallowEqual);
|
|
54
|
+
};
|
|
49
55
|
const useSubscription = () => {
|
|
50
56
|
return FronteggStoreContext.useSelector((state) => {
|
|
51
|
-
const { billing: {
|
|
52
|
-
if ((
|
|
57
|
+
const { billing: { subscription: { subscription }, }, } = getSubscriptionState(state);
|
|
58
|
+
if ((subscription === null || subscription === void 0 ? void 0 : subscription.externallyManaged) || !subscription) {
|
|
53
59
|
return null;
|
|
54
60
|
}
|
|
55
|
-
return
|
|
56
|
-
slug: plan.id,
|
|
57
|
-
name: plan.name,
|
|
58
|
-
} });
|
|
61
|
+
return subscription;
|
|
59
62
|
}, reactRedux.shallowEqual);
|
|
60
63
|
};
|
|
61
64
|
const useSubscriptionActions = () => {
|
|
@@ -79,3 +82,5 @@ exports.useStripeActions = useStripeActions;
|
|
|
79
82
|
exports.useStripeState = useStripeState;
|
|
80
83
|
exports.useSubscription = useSubscription;
|
|
81
84
|
exports.useSubscriptionActions = useSubscriptionActions;
|
|
85
|
+
exports.useSubscriptionCancellation = useSubscriptionCancellation;
|
|
86
|
+
exports.useSubscriptionRenewal = useSubscriptionRenewal;
|
package/node/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var roles = require('./roles-23d24a59.js');
|
|
6
6
|
var auditsMetadata = require('./auditsMetadata-d15799a1.js');
|
|
7
7
|
var hooks = require('./hooks-5d5a445e.js');
|
|
8
|
-
var hooks$1 = require('./hooks-
|
|
8
|
+
var hooks$1 = require('./hooks-230f0815.js');
|
|
9
9
|
var hooks$2 = require('./hooks-cf739b27.js');
|
|
10
10
|
var tslib = require('tslib');
|
|
11
11
|
var React = require('react');
|
|
@@ -160,6 +160,8 @@ exports.useStripeActions = hooks$1.useStripeActions;
|
|
|
160
160
|
exports.useStripeState = hooks$1.useStripeState;
|
|
161
161
|
exports.useSubscription = hooks$1.useSubscription;
|
|
162
162
|
exports.useSubscriptionActions = hooks$1.useSubscriptionActions;
|
|
163
|
+
exports.useSubscriptionCancellation = hooks$1.useSubscriptionCancellation;
|
|
164
|
+
exports.useSubscriptionRenewal = hooks$1.useSubscriptionRenewal;
|
|
163
165
|
exports.useVendorActions = hooks$2.useVendorActions;
|
|
164
166
|
exports.useVendorState = hooks$2.useVendorState;
|
|
165
167
|
Object.defineProperty(exports, 'Provider', {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var hooks = require('../hooks-
|
|
5
|
+
var hooks = require('../hooks-230f0815.js');
|
|
6
6
|
require('@frontegg/redux-store');
|
|
7
7
|
require('../FronteggStoreContext-6cfac56c.js');
|
|
8
8
|
require('react');
|
|
@@ -26,3 +26,5 @@ exports.useStripeActions = hooks.useStripeActions;
|
|
|
26
26
|
exports.useStripeState = hooks.useStripeState;
|
|
27
27
|
exports.useSubscription = hooks.useSubscription;
|
|
28
28
|
exports.useSubscriptionActions = hooks.useSubscriptionActions;
|
|
29
|
+
exports.useSubscriptionCancellation = hooks.useSubscriptionCancellation;
|
|
30
|
+
exports.useSubscriptionRenewal = hooks.useSubscriptionRenewal;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/react-hooks",
|
|
3
3
|
"libName": "FronteggReactHooks",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.34.1",
|
|
5
5
|
"author": "Frontegg LTD",
|
|
6
6
|
"main": "./node/index.js",
|
|
7
7
|
"module": "./index.js",
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@frontegg/redux-store": "5.
|
|
10
|
+
"@frontegg/redux-store": "5.34.1",
|
|
11
11
|
"react-redux": "^7.x"
|
|
12
12
|
}
|
|
13
13
|
}
|
package/subscriptions/hooks.d.ts
CHANGED
|
@@ -13,5 +13,7 @@ export declare const useInvoices: () => import("@frontegg/redux-store").Invoices
|
|
|
13
13
|
export declare const useInvoicesActions: () => import("@frontegg/redux-store").InvoicesActions;
|
|
14
14
|
export declare const useStripeState: () => StripeState;
|
|
15
15
|
export declare const useStripeActions: () => StripeActions;
|
|
16
|
+
export declare const useSubscriptionCancellation: () => SubscriptionState['cancellation'];
|
|
17
|
+
export declare const useSubscriptionRenewal: () => SubscriptionState['renewal'];
|
|
16
18
|
export declare const useSubscription: () => SubscriptionState['subscription'] | null;
|
|
17
19
|
export declare const useSubscriptionActions: () => SubscriptionActions;
|
package/subscriptions/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { f as useBillingInformation, g as useBillingInformationActions, d as useCheckout, e as useCheckoutActions, j as useInvoices, k as useInvoicesActions, h as usePaymentMethod, i as usePaymentMethodActions, u as usePaymentProvider, a as usePaymentProviderActions, b as usePlans, c as usePlansActions, m as useStripeActions, l as useStripeState,
|
|
1
|
+
export { f as useBillingInformation, g as useBillingInformationActions, d as useCheckout, e as useCheckoutActions, j as useInvoices, k as useInvoicesActions, h as usePaymentMethod, i as usePaymentMethodActions, u as usePaymentProvider, a as usePaymentProviderActions, b as usePlans, c as usePlansActions, m as useStripeActions, l as useStripeState, p as useSubscription, q as useSubscriptionActions, n as useSubscriptionCancellation, o as useSubscriptionRenewal } from '../hooks-81e8bb80.js';
|
|
2
2
|
import '@frontegg/redux-store';
|
|
3
3
|
import '../FronteggStoreContext-d6c3b684.js';
|
|
4
4
|
import 'react';
|