@frontegg/redux-store 6.69.0 → 6.70.0
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/audits/AuditLogsState/index.js +1 -1
- package/audits/AuditLogsState/saga.js +1 -18
- package/audits/AuditsMetadataState/index.js +1 -1
- package/audits/AuditsMetadataState/saga.js +1 -5
- package/audits/backward-compatibility/saga.js +0 -18
- package/audits/dummy.js +0 -16
- package/audits/index.js +4 -2
- package/audits/reducer.js +0 -2
- package/auth/AcceptInvitationState/index.d.ts +2 -0
- package/auth/AcceptInvitationState/index.js +1 -1
- package/auth/AcceptInvitationState/interfaces.js +0 -1
- package/auth/AcceptInvitationState/saga.js +0 -3
- package/auth/AccountSettingsState/index.d.ts +2 -0
- package/auth/AccountSettingsState/index.js +1 -1
- package/auth/AccountSettingsState/interfaces.d.ts +2 -0
- package/auth/AccountSettingsState/saga.js +1 -11
- package/auth/ActivateState/index.d.ts +3 -0
- package/auth/ActivateState/index.js +1 -1
- package/auth/ActivateState/interfaces.js +0 -1
- package/auth/ActivateState/saga.js +14 -34
- package/auth/ApiTokensState/index.d.ts +2 -0
- package/auth/ApiTokensState/index.js +1 -1
- package/auth/ApiTokensState/interfaces.d.ts +1 -0
- package/auth/ApiTokensState/interfaces.js +0 -1
- package/auth/ApiTokensState/saga.js +1 -44
- package/auth/ForgotPasswordState/index.d.ts +2 -0
- package/auth/ForgotPasswordState/index.js +1 -1
- package/auth/ForgotPasswordState/interfaces.js +0 -1
- package/auth/ForgotPasswordState/saga.js +5 -12
- package/auth/ImpersonationState/index.d.ts +2 -0
- package/auth/ImpersonationState/index.js +1 -1
- package/auth/ImpersonationState/interfaces.js +0 -1
- package/auth/ImpersonationState/saga.js +5 -9
- package/auth/LoginState/index.d.ts +2 -0
- package/auth/LoginState/index.js +1 -1
- package/auth/LoginState/interfaces.js +0 -6
- package/auth/LoginState/saga.d.ts +2 -38
- package/auth/LoginState/saga.js +132 -292
- package/auth/MfaState/index.d.ts +4 -2
- package/auth/MfaState/index.js +1 -1
- package/auth/MfaState/interfaces.d.ts +2 -2
- package/auth/MfaState/interfaces.js +0 -1
- package/auth/MfaState/saga.js +64 -143
- package/auth/ProfileState/index.d.ts +2 -0
- package/auth/ProfileState/index.js +1 -1
- package/auth/ProfileState/saga.js +22 -50
- package/auth/Provisioning/index.d.ts +2 -0
- package/auth/Provisioning/index.js +1 -1
- package/auth/Provisioning/saga.js +11 -23
- package/auth/ResetPhoneNumberState/index.d.ts +2 -0
- package/auth/ResetPhoneNumberState/index.js +1 -1
- package/auth/ResetPhoneNumberState/interfaces.js +0 -1
- package/auth/ResetPhoneNumberState/saga.js +17 -26
- package/auth/RestrictionsState/index.d.ts +3 -0
- package/auth/RestrictionsState/index.js +1 -1
- package/auth/RestrictionsState/saga.js +52 -105
- package/auth/RolesState/index.d.ts +2 -0
- package/auth/RolesState/index.js +1 -1
- package/auth/RolesState/saga.js +30 -51
- package/auth/SSOState/index.d.ts +2 -0
- package/auth/SSOState/index.js +1 -1
- package/auth/SSOState/interfaces.js +0 -3
- package/auth/SSOState/saga.js +10 -58
- package/auth/SSOState/saga.v2.js +13 -49
- package/auth/SecurityPolicyState/index.d.ts +13 -0
- package/auth/SecurityPolicyState/index.js +1 -1
- package/auth/SecurityPolicyState/saga.js +36 -90
- package/auth/SessionsPolicyState/index.d.ts +2 -0
- package/auth/SessionsPolicyState/index.js +1 -1
- package/auth/SessionsPolicyState/saga.js +7 -19
- package/auth/SessionsState/index.d.ts +2 -0
- package/auth/SessionsState/index.js +1 -1
- package/auth/SessionsState/saga.js +1 -15
- package/auth/SignUp/index.d.ts +2 -0
- package/auth/SignUp/index.js +1 -1
- package/auth/SignUp/interfaces.js +0 -1
- package/auth/SignUp/saga.js +6 -15
- package/auth/SocialLogins/index.d.ts +2 -0
- package/auth/SocialLogins/index.js +1 -1
- package/auth/SocialLogins/saga.js +10 -20
- package/auth/TeamState/index.d.ts +2 -0
- package/auth/TeamState/index.js +1 -1
- package/auth/TeamState/interfaces.js +0 -1
- package/auth/TeamState/saga.js +85 -205
- package/auth/TenantsState/index.d.ts +2 -0
- package/auth/TenantsState/index.js +1 -1
- package/auth/TenantsState/saga.js +1 -17
- package/auth/index.d.ts +2 -2
- package/auth/index.js +4 -3
- package/auth/interfaces.d.ts +2 -1
- package/auth/interfaces.js +0 -6
- package/auth/reducer.d.ts +2 -2
- package/auth/reducer.js +0 -2
- package/auth/saga.js +2 -1
- package/auth/utils.d.ts +4 -0
- package/auth/utils.js +7 -21
- package/connectivity/ConnectivityState/index.d.ts +9 -0
- package/connectivity/ConnectivityState/index.js +1 -1
- package/connectivity/consts.js +0 -5
- package/connectivity/index.js +4 -2
- package/connectivity/interfaces.d.ts +1 -0
- package/connectivity/reducer.js +0 -2
- package/connectivity/saga.js +48 -85
- package/helpers.js +4 -7
- package/index.js +1 -1
- package/node/audits/AuditLogsState/index.js +1 -8
- package/node/audits/AuditLogsState/saga.js +1 -26
- package/node/audits/AuditsMetadataState/index.js +1 -8
- package/node/audits/AuditsMetadataState/saga.js +1 -10
- package/node/audits/backward-compatibility/index.js +0 -8
- package/node/audits/backward-compatibility/reducer.js +0 -5
- package/node/audits/backward-compatibility/saga.js +0 -23
- package/node/audits/dummy.js +0 -19
- package/node/audits/index.js +0 -14
- package/node/audits/initialState.js +0 -3
- package/node/audits/reducer.js +0 -8
- package/node/audits/saga.js +0 -5
- package/node/audits/utils.js +0 -4
- package/node/auth/AcceptInvitationState/index.js +1 -7
- package/node/auth/AcceptInvitationState/interfaces.js +0 -1
- package/node/auth/AcceptInvitationState/saga.js +0 -7
- package/node/auth/AccountSettingsState/index.js +1 -6
- package/node/auth/AccountSettingsState/saga.js +1 -16
- package/node/auth/ActivateState/index.js +1 -7
- package/node/auth/ActivateState/interfaces.js +0 -1
- package/node/auth/ActivateState/saga.js +14 -41
- package/node/auth/ApiTokensState/index.js +1 -6
- package/node/auth/ApiTokensState/interfaces.js +0 -1
- package/node/auth/ApiTokensState/saga.js +1 -51
- package/node/auth/ForgotPasswordState/index.js +1 -7
- package/node/auth/ForgotPasswordState/interfaces.js +0 -1
- package/node/auth/ForgotPasswordState/saga.js +5 -19
- package/node/auth/ImpersonationState/index.js +1 -7
- package/node/auth/ImpersonationState/interfaces.js +0 -1
- package/node/auth/ImpersonationState/saga.js +5 -15
- package/node/auth/LoginState/index.js +1 -7
- package/node/auth/LoginState/interfaces.js +0 -7
- package/node/auth/LoginState/saga.js +132 -322
- package/node/auth/MfaState/index.js +1 -7
- package/node/auth/MfaState/interfaces.js +0 -1
- package/node/auth/MfaState/saga.js +64 -137
- package/node/auth/ProfileState/index.js +1 -6
- package/node/auth/ProfileState/saga.js +22 -58
- package/node/auth/Provisioning/index.js +1 -6
- package/node/auth/Provisioning/saga.js +11 -28
- package/node/auth/ResetPhoneNumberState/index.js +1 -7
- package/node/auth/ResetPhoneNumberState/interfaces.js +0 -1
- package/node/auth/ResetPhoneNumberState/saga.js +17 -32
- package/node/auth/RestrictionsState/index.js +1 -7
- package/node/auth/RestrictionsState/saga.js +52 -109
- package/node/auth/RolesState/index.js +1 -6
- package/node/auth/RolesState/saga.js +30 -54
- package/node/auth/SSOState/index.js +1 -6
- package/node/auth/SSOState/interfaces.js +0 -3
- package/node/auth/SSOState/saga.js +10 -63
- package/node/auth/SSOState/saga.v2.js +13 -53
- package/node/auth/SecurityPolicyState/index.js +1 -6
- package/node/auth/SecurityPolicyState/saga.js +36 -89
- package/node/auth/SessionsPolicyState/index.js +1 -6
- package/node/auth/SessionsPolicyState/saga.js +7 -24
- package/node/auth/SessionsState/index.js +1 -6
- package/node/auth/SessionsState/saga.js +1 -22
- package/node/auth/SignUp/index.js +1 -7
- package/node/auth/SignUp/interfaces.js +0 -1
- package/node/auth/SignUp/saga.js +6 -30
- package/node/auth/SocialLogins/index.js +1 -6
- package/node/auth/SocialLogins/saga.js +10 -33
- package/node/auth/TeamState/index.js +1 -6
- package/node/auth/TeamState/interfaces.js +0 -1
- package/node/auth/TeamState/saga.js +86 -190
- package/node/auth/TenantsState/index.js +1 -6
- package/node/auth/TenantsState/saga.js +1 -24
- package/node/auth/dummy.js +0 -5
- package/node/auth/index.js +0 -90
- package/node/auth/initialState.js +0 -23
- package/node/auth/interfaces.js +0 -6
- package/node/auth/reducer.js +0 -28
- package/node/auth/saga.js +2 -26
- package/node/auth/utils.js +7 -42
- package/node/connectivity/ConnectivityState/index.js +1 -7
- package/node/connectivity/consts.js +1 -7
- package/node/connectivity/index.js +0 -5
- package/node/connectivity/reducer.js +0 -6
- package/node/connectivity/saga.js +47 -91
- package/node/helpers.js +2 -14
- package/node/index.js +1 -17
- package/node/subscriptions/Billing/Information/index.js +0 -7
- package/node/subscriptions/Billing/Information/saga.js +1 -25
- package/node/subscriptions/Billing/Invoices/index.js +0 -6
- package/node/subscriptions/Billing/Invoices/saga.js +1 -13
- package/node/subscriptions/Billing/PaymentMethod/index.js +2 -8
- package/node/subscriptions/Billing/PaymentMethod/interfaces.js +0 -1
- package/node/subscriptions/Billing/PaymentMethod/saga.js +1 -17
- package/node/subscriptions/Billing/Subscription/index.js +0 -6
- package/node/subscriptions/Billing/Subscription/saga.js +3 -23
- package/node/subscriptions/Billing/index.js +0 -6
- package/node/subscriptions/Billing/interfaces.js +0 -8
- package/node/subscriptions/Billing/saga.js +0 -7
- package/node/subscriptions/Checkout/index.js +0 -6
- package/node/subscriptions/Checkout/saga.js +2 -22
- package/node/subscriptions/Config/index.js +0 -6
- package/node/subscriptions/Config/saga.js +1 -12
- package/node/subscriptions/Plans/index.js +0 -6
- package/node/subscriptions/Plans/saga.js +1 -13
- package/node/subscriptions/Stripe/index.js +0 -6
- package/node/subscriptions/Stripe/saga.js +0 -8
- package/node/subscriptions/VendorPublicConfig/index.js +0 -6
- package/node/subscriptions/VendorPublicConfig/saga.js +1 -9
- package/node/subscriptions/dummy.js +2 -4
- package/node/subscriptions/general.interfaces.js +0 -5
- package/node/subscriptions/index.js +0 -5
- package/node/subscriptions/interfaces.js +0 -14
- package/node/subscriptions/mapper.js +0 -11
- package/node/subscriptions/reducer.js +0 -9
- package/node/subscriptions/saga.js +0 -9
- package/node/subscriptions/utils.js +0 -6
- package/node/toolkit/index.js +0 -31
- package/node/toolkit/redux-saga.js +0 -3
- package/node/toolkit/redux.js +0 -1
- package/node/vendor/VendorState/index.js +1 -7
- package/node/vendor/index.js +0 -5
- package/node/vendor/reducer.js +0 -6
- package/node/vendor/saga.js +1 -9
- package/package.json +1 -1
- package/subscriptions/Billing/Information/index.js +0 -4
- package/subscriptions/Billing/Information/saga.js +1 -12
- package/subscriptions/Billing/Invoices/index.js +0 -4
- package/subscriptions/Billing/Invoices/saga.js +1 -5
- package/subscriptions/Billing/PaymentMethod/index.js +2 -6
- package/subscriptions/Billing/PaymentMethod/interfaces.js +1 -1
- package/subscriptions/Billing/PaymentMethod/saga.js +1 -9
- package/subscriptions/Billing/Subscription/index.js +0 -4
- package/subscriptions/Billing/Subscription/saga.js +3 -17
- package/subscriptions/Billing/interfaces.js +1 -0
- package/subscriptions/Checkout/index.js +0 -4
- package/subscriptions/Checkout/saga.js +2 -12
- package/subscriptions/Config/index.js +0 -4
- package/subscriptions/Config/saga.js +1 -7
- package/subscriptions/Plans/index.js +0 -2
- package/subscriptions/Plans/saga.js +1 -6
- package/subscriptions/Stripe/index.js +0 -4
- package/subscriptions/Stripe/saga.js +0 -4
- package/subscriptions/VendorPublicConfig/index.js +0 -2
- package/subscriptions/VendorPublicConfig/saga.js +1 -4
- package/subscriptions/dummy.js +3 -2
- package/subscriptions/general.interfaces.js +0 -5
- package/subscriptions/index.js +3 -1
- package/subscriptions/mapper.js +0 -5
- package/toolkit/index.d.ts +1 -1
- package/toolkit/index.js +0 -9
- package/vendor/VendorState/index.js +1 -0
- package/vendor/index.js +4 -2
- package/vendor/reducer.js +0 -2
- package/vendor/saga.js +1 -2
|
@@ -5,14 +5,11 @@ import { PaymentProvider } from '../interfaces';
|
|
|
5
5
|
export function* configSagas() {
|
|
6
6
|
yield takeEvery(configActions.loadPaymentConfiguration, loadPaymentConfiguration);
|
|
7
7
|
}
|
|
8
|
-
|
|
9
8
|
function* loadPaymentConfiguration() {
|
|
10
9
|
yield put(configActions.setLoading(true));
|
|
11
|
-
|
|
12
10
|
try {
|
|
13
11
|
const response = yield call(api.subscriptions.getPaymentProviders) || [];
|
|
14
12
|
const stripePaymentProvider = response.find(paymentProvider => paymentProvider.status === '1' && paymentProvider.providerType === ProviderType.Stripe);
|
|
15
|
-
|
|
16
13
|
if (stripePaymentProvider) {
|
|
17
14
|
yield loadStripePaymentConfiguration();
|
|
18
15
|
} else {
|
|
@@ -22,10 +19,8 @@ function* loadPaymentConfiguration() {
|
|
|
22
19
|
yield put(configActions.setError(e.message));
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
function* loadStripePaymentConfiguration() {
|
|
27
23
|
yield put(configActions.setLoading(true));
|
|
28
|
-
|
|
29
24
|
try {
|
|
30
25
|
const response = yield call(api.subscriptions.getStripePaymentProviderConfiguration);
|
|
31
26
|
yield put(configActions.setState({
|
|
@@ -40,11 +35,11 @@ function* loadStripePaymentConfiguration() {
|
|
|
40
35
|
yield put(configActions.setError(e.message));
|
|
41
36
|
}
|
|
42
37
|
}
|
|
38
|
+
|
|
43
39
|
/*********************************
|
|
44
40
|
* Preview Sagas
|
|
45
41
|
*********************************/
|
|
46
42
|
|
|
47
|
-
|
|
48
43
|
function* loadPaymentConfigurationMock() {
|
|
49
44
|
yield put(configActions.setLoading(true));
|
|
50
45
|
yield delay(500);
|
|
@@ -57,7 +52,6 @@ function* loadPaymentConfigurationMock() {
|
|
|
57
52
|
}
|
|
58
53
|
}));
|
|
59
54
|
}
|
|
60
|
-
|
|
61
55
|
export function* configSagasMock() {
|
|
62
56
|
yield takeEvery(configActions.loadPaymentConfiguration, loadPaymentConfigurationMock);
|
|
63
57
|
}
|
|
@@ -17,9 +17,7 @@ const {
|
|
|
17
17
|
initialState: plansInitialState,
|
|
18
18
|
reducers: _extends({}, createModuleCaseReducers())
|
|
19
19
|
});
|
|
20
|
-
|
|
21
20
|
const actions = _extends({
|
|
22
21
|
loadPlans: createAction(`${name}/loadPlans`)
|
|
23
22
|
}, sliceActions);
|
|
24
|
-
|
|
25
23
|
export { actions as plansActions, reducer as plansReducer };
|
|
@@ -6,15 +6,12 @@ import { planResponseMock } from '../dummy';
|
|
|
6
6
|
export function* plansSagas() {
|
|
7
7
|
yield takeEvery(plansActions.loadPlans, loadPlans);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
9
|
function* loadPlans() {
|
|
11
10
|
yield put(plansActions.setLoading(true));
|
|
12
|
-
|
|
13
11
|
try {
|
|
14
12
|
const products = yield call(api.subscriptions.getSubscriptionPlans);
|
|
15
13
|
const plans = products.map(item => {
|
|
16
14
|
var _item$price, _item$price2;
|
|
17
|
-
|
|
18
15
|
return {
|
|
19
16
|
id: item.id,
|
|
20
17
|
name: item.name,
|
|
@@ -34,11 +31,11 @@ function* loadPlans() {
|
|
|
34
31
|
yield put(plansActions.setError(e.message));
|
|
35
32
|
}
|
|
36
33
|
}
|
|
34
|
+
|
|
37
35
|
/*********************************
|
|
38
36
|
* Preview Sagas
|
|
39
37
|
*********************************/
|
|
40
38
|
|
|
41
|
-
|
|
42
39
|
function* loadPlansMock() {
|
|
43
40
|
yield put(plansActions.setLoading(true));
|
|
44
41
|
yield delay(500);
|
|
@@ -47,7 +44,6 @@ function* loadPlansMock() {
|
|
|
47
44
|
loading: false,
|
|
48
45
|
plans: planResponseMock.map(item => {
|
|
49
46
|
var _item$price3, _item$price4;
|
|
50
|
-
|
|
51
47
|
return _extends({}, item, {
|
|
52
48
|
price: ((_item$price3 = item.price) == null ? void 0 : _item$price3.amount) || 0,
|
|
53
49
|
currency: ((_item$price4 = item.price) == null ? void 0 : _item$price4.currency) || 'usd',
|
|
@@ -56,7 +52,6 @@ function* loadPlansMock() {
|
|
|
56
52
|
})
|
|
57
53
|
}));
|
|
58
54
|
}
|
|
59
|
-
|
|
60
55
|
export function* plansSagasMock() {
|
|
61
56
|
yield takeEvery(plansActions.loadPlans, loadPlansMock);
|
|
62
57
|
}
|
|
@@ -7,9 +7,7 @@ export const initialSubscriptionStripeState = {
|
|
|
7
7
|
error: null,
|
|
8
8
|
cardSetupIntentSecret: null
|
|
9
9
|
};
|
|
10
|
-
|
|
11
10
|
const reducers = _extends({}, createModuleCaseReducers());
|
|
12
|
-
|
|
13
11
|
const {
|
|
14
12
|
reducer,
|
|
15
13
|
actions: reducerActions,
|
|
@@ -19,10 +17,8 @@ const {
|
|
|
19
17
|
initialState: initialSubscriptionStripeState,
|
|
20
18
|
reducers
|
|
21
19
|
});
|
|
22
|
-
|
|
23
20
|
const actions = _extends({
|
|
24
21
|
loadCustomer: createAction(`${name}/loadCustomer`),
|
|
25
22
|
createCardSetupIntentSecret: createAction(`${name}/createCardSetupIntentSecret`)
|
|
26
23
|
}, reducerActions);
|
|
27
|
-
|
|
28
24
|
export { reducer as stripeReducer, actions as stripeActions };
|
|
@@ -4,7 +4,6 @@ import { api } from '@frontegg/rest-api';
|
|
|
4
4
|
export function* subscriptionStripeSagas() {
|
|
5
5
|
yield takeEvery(stripeActions.createCardSetupIntentSecret, createCardSetupIntentSecret);
|
|
6
6
|
}
|
|
7
|
-
|
|
8
7
|
function* createCardSetupIntentSecret({
|
|
9
8
|
payload
|
|
10
9
|
}) {
|
|
@@ -13,14 +12,11 @@ function* createCardSetupIntentSecret({
|
|
|
13
12
|
error: null,
|
|
14
13
|
cardSetupIntentSecret: null
|
|
15
14
|
}));
|
|
16
|
-
|
|
17
15
|
try {
|
|
18
16
|
const request = {};
|
|
19
|
-
|
|
20
17
|
if (payload) {
|
|
21
18
|
request.paymentMethodId = payload;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
const {
|
|
25
21
|
setupIntentSecret
|
|
26
22
|
} = yield call(api.subscriptions.createStripePaymentMethodSetupIntentSecret, request);
|
|
@@ -16,9 +16,7 @@ const {
|
|
|
16
16
|
initialState: vendorPublicConfigInitialState,
|
|
17
17
|
reducers: _extends({}, createModuleCaseReducers())
|
|
18
18
|
});
|
|
19
|
-
|
|
20
19
|
const actions = _extends({
|
|
21
20
|
loadVendorPublicConfiguration: createAction(`${name}/loadVendorPublicConfiguration`)
|
|
22
21
|
}, sliceActions);
|
|
23
|
-
|
|
24
22
|
export { actions as vendorPublicConfigActions, reducer as vendorPublicConfigReducer };
|
|
@@ -5,10 +5,8 @@ import { vendorPublicConfigurationResponseMock } from '../dummy';
|
|
|
5
5
|
export function* vendorPublicConfigSagas() {
|
|
6
6
|
yield takeEvery(vendorPublicConfigActions.loadVendorPublicConfiguration, loadVendorPublicConfiguration);
|
|
7
7
|
}
|
|
8
|
-
|
|
9
8
|
function* loadVendorPublicConfiguration() {
|
|
10
9
|
yield put(vendorPublicConfigActions.setLoading(true));
|
|
11
|
-
|
|
12
10
|
try {
|
|
13
11
|
const vendorPublicConfig = yield call(api.subscriptions.getVendorPublicConfigurations);
|
|
14
12
|
yield put(vendorPublicConfigActions.setState({
|
|
@@ -20,11 +18,11 @@ function* loadVendorPublicConfiguration() {
|
|
|
20
18
|
yield put(vendorPublicConfigActions.setError(e.message));
|
|
21
19
|
}
|
|
22
20
|
}
|
|
21
|
+
|
|
23
22
|
/*********************************
|
|
24
23
|
* Preview Sagas
|
|
25
24
|
*********************************/
|
|
26
25
|
|
|
27
|
-
|
|
28
26
|
function* loadVendorPublicConfigurationMock() {
|
|
29
27
|
yield put(vendorPublicConfigActions.setLoading(true));
|
|
30
28
|
yield delay(500);
|
|
@@ -34,7 +32,6 @@ function* loadVendorPublicConfigurationMock() {
|
|
|
34
32
|
vendorPublicConfig: vendorPublicConfigurationResponseMock
|
|
35
33
|
}));
|
|
36
34
|
}
|
|
37
|
-
|
|
38
35
|
export function* vendorPublicConfigSagasMock() {
|
|
39
36
|
yield takeEvery(vendorPublicConfigActions.loadVendorPublicConfiguration, loadVendorPublicConfigurationMock);
|
|
40
37
|
}
|
package/subscriptions/dummy.js
CHANGED
|
@@ -11,7 +11,8 @@ export const subscriptionResponseMock = {
|
|
|
11
11
|
plan: {
|
|
12
12
|
// TODO: fix dummy data
|
|
13
13
|
slug: 'test'
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
|
+
// items: [
|
|
15
16
|
// {
|
|
16
17
|
// id: 'si_KGE0p5himocPXH',
|
|
17
18
|
// externalId: 'prod_J60fUEvI7qV1eL',
|
|
@@ -24,8 +25,8 @@ export const subscriptionResponseMock = {
|
|
|
24
25
|
// },
|
|
25
26
|
// },
|
|
26
27
|
// ],
|
|
27
|
-
|
|
28
28
|
};
|
|
29
|
+
|
|
29
30
|
export const planResponseMock = [{
|
|
30
31
|
id: 'prod_J60fUEvI7qV1eL',
|
|
31
32
|
externalId: 'prod_J60fUEvI7qV1eL',
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
export let PaymentProvider;
|
|
2
|
-
|
|
3
2
|
(function (PaymentProvider) {
|
|
4
3
|
PaymentProvider["STRIPE"] = "Stripe";
|
|
5
4
|
})(PaymentProvider || (PaymentProvider = {}));
|
|
6
|
-
|
|
7
5
|
export let SubscriptionStatus;
|
|
8
|
-
|
|
9
6
|
(function (SubscriptionStatus) {
|
|
10
7
|
SubscriptionStatus["ACTIVE"] = "ACTIVE";
|
|
11
8
|
SubscriptionStatus["CANCELED"] = "CANCELED";
|
|
@@ -13,9 +10,7 @@ export let SubscriptionStatus;
|
|
|
13
10
|
SubscriptionStatus["EXPIRED"] = "EXPIRED";
|
|
14
11
|
SubscriptionStatus["TRIALING"] = "TRIALING";
|
|
15
12
|
})(SubscriptionStatus || (SubscriptionStatus = {}));
|
|
16
|
-
|
|
17
13
|
export let SubscriptionCancellationPolicy;
|
|
18
|
-
|
|
19
14
|
(function (SubscriptionCancellationPolicy) {
|
|
20
15
|
SubscriptionCancellationPolicy["AT_PERIOD_END"] = "atPeriodEnd";
|
|
21
16
|
})(SubscriptionCancellationPolicy || (SubscriptionCancellationPolicy = {}));
|
package/subscriptions/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// export store
|
|
2
|
+
|
|
2
3
|
import { subscriptionsStoreName as storeName } from '../constants';
|
|
3
4
|
import { actions, initialState, reducer } from './reducer';
|
|
4
5
|
import { sagas, mockSagas } from './saga';
|
|
5
6
|
export * from './interfaces';
|
|
6
|
-
export { sagas as subscriptionSagas, mockSagas as subscriptionSagasMock, reducer as subscriptionReducers, actions as subscriptionActions, initialState as subscriptionInitialState, storeName as subscriptionsStoreName };
|
|
7
|
+
export { sagas as subscriptionSagas, mockSagas as subscriptionSagasMock, reducer as subscriptionReducers, actions as subscriptionActions, initialState as subscriptionInitialState, storeName as subscriptionsStoreName };
|
|
7
8
|
|
|
9
|
+
// export store
|
|
8
10
|
export default {
|
|
9
11
|
sagas,
|
|
10
12
|
mockSagas,
|
package/subscriptions/mapper.js
CHANGED
|
@@ -17,19 +17,14 @@ export function toSubscriptionStatus(status) {
|
|
|
17
17
|
switch (status) {
|
|
18
18
|
case ISubscriptionStatus.ACTIVE:
|
|
19
19
|
return SubscriptionStatus.ACTIVE;
|
|
20
|
-
|
|
21
20
|
case ISubscriptionStatus.INCOMPLETE:
|
|
22
21
|
return SubscriptionStatus.INCOMPLETE;
|
|
23
|
-
|
|
24
22
|
case ISubscriptionStatus.CANCELED:
|
|
25
23
|
return SubscriptionStatus.CANCELED;
|
|
26
|
-
|
|
27
24
|
case ISubscriptionStatus.EXPIRED:
|
|
28
25
|
return SubscriptionStatus.EXPIRED;
|
|
29
|
-
|
|
30
26
|
case ISubscriptionStatus.TRIALING:
|
|
31
27
|
return SubscriptionStatus.TRIALING;
|
|
32
|
-
|
|
33
28
|
default:
|
|
34
29
|
return SubscriptionStatus.EXPIRED;
|
|
35
30
|
}
|
package/toolkit/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface RootState {
|
|
|
15
15
|
urlStrategy: 'hash' | 'path';
|
|
16
16
|
previewMode?: boolean;
|
|
17
17
|
}
|
|
18
|
-
export declare const createFronteggStore: (rootInitialState: InitialState, storeHolder?: any, previewMode?: boolean, authInitialState?: (Partial<Pick<AuthState, "user" | "error" | "onRedirectTo" | "isAuthenticated" | "userIp" | "isLoading" | "keepSessionAlive" | "isSSOAuth" | "ssoACS" | "loginState" | "activateState" | "acceptInvitationState" | "forgotPasswordState" | "resetPhoneNumberState" | "ssoState" | "profileState" | "mfaState" | "teamState" | "socialLoginState" | "signUpState" | "apiTokensState" | "securityPolicyState" | "restrictionsState" | "provisioningState" | "accountSettingsState" | "tenantsState" | "rolesState" | "sessionsState" | "hostedLoginBox" | "disableSilentRefresh" | "sessionsPolicyState" | "impersonateState" | "header" | "loaderComponent">> & {
|
|
18
|
+
export declare const createFronteggStore: (rootInitialState: InitialState, storeHolder?: any, previewMode?: boolean, authInitialState?: (Partial<Pick<AuthState, "user" | "error" | "onRedirectTo" | "isAuthenticated" | "userIp" | "isLoading" | "keepSessionAlive" | "isSSOAuth" | "ssoACS" | "includeQueryParam" | "loginState" | "activateState" | "acceptInvitationState" | "forgotPasswordState" | "resetPhoneNumberState" | "ssoState" | "profileState" | "mfaState" | "teamState" | "socialLoginState" | "signUpState" | "apiTokensState" | "securityPolicyState" | "restrictionsState" | "provisioningState" | "accountSettingsState" | "tenantsState" | "rolesState" | "sessionsState" | "hostedLoginBox" | "disableSilentRefresh" | "sessionsPolicyState" | "impersonateState" | "header" | "loaderComponent">> & {
|
|
19
19
|
routes?: Partial<AuthPageRoutes> | undefined;
|
|
20
20
|
}) | undefined, overrideInitialState?: Partial<{
|
|
21
21
|
auth: Partial<Omit<AuthState, 'routes'>> & {
|
package/toolkit/index.js
CHANGED
|
@@ -42,22 +42,17 @@ const {
|
|
|
42
42
|
export const createFronteggStore = (rootInitialState, storeHolder, previewMode = false, authInitialState, overrideInitialState, builderMode = false, urlStrategy = 'path') => {
|
|
43
43
|
const isSSR = typeof window === 'undefined';
|
|
44
44
|
let holder = storeHolder;
|
|
45
|
-
|
|
46
45
|
if (isSSR && storeHolder == null) {
|
|
47
46
|
throw Error('createFronteggStore(initState, storeHolder) failed, storeHolder must not be null in Server-Side rendering');
|
|
48
47
|
}
|
|
49
|
-
|
|
50
48
|
if (!holder) {
|
|
51
49
|
holder = window;
|
|
52
50
|
}
|
|
53
|
-
|
|
54
51
|
if (!holder.store) {
|
|
55
52
|
var _overrideInitialState, _authInitialState$rou, _overrideInitialState2, _overrideInitialState3, _overrideInitialState4, _overrideInitialState5, _overrideInitialState6, _overrideInitialState7, _overrideInitialState8, _overrideInitialState9;
|
|
56
|
-
|
|
57
53
|
if (!previewMode && !builderMode) {
|
|
58
54
|
ContextHolder.setContext(rootInitialState.context);
|
|
59
55
|
}
|
|
60
|
-
|
|
61
56
|
const sagaMiddleware = createSagaMiddleware();
|
|
62
57
|
const middleware = [...getDefaultMiddleware({
|
|
63
58
|
thunk: false,
|
|
@@ -94,15 +89,12 @@ export const createFronteggStore = (rootInitialState, storeHolder, previewMode =
|
|
|
94
89
|
[vendorStore.storeName]: vendorStore.reducer
|
|
95
90
|
})
|
|
96
91
|
});
|
|
97
|
-
|
|
98
92
|
const rootSaga = function* () {
|
|
99
93
|
yield all([call(authStore.sagas), call(auditsStore.sagas), call(oldAuditsStore.sagas), call(connectivityStore.sagas), call(subscriptionsStore.sagas), call(vendorStore.sagas)]);
|
|
100
94
|
};
|
|
101
|
-
|
|
102
95
|
const rootMockSaga = function* () {
|
|
103
96
|
yield all([call(authStore.mockSagas), call(auditsStore.mockSagas), call(subscriptionsStore.mockSagas)]);
|
|
104
97
|
};
|
|
105
|
-
|
|
106
98
|
if (previewMode) {
|
|
107
99
|
holder.store.destroy = sagaMiddleware.run(rootMockSaga).cancel;
|
|
108
100
|
holder.store.dispatch(authActions.requestAuthorize(true));
|
|
@@ -110,6 +102,5 @@ export const createFronteggStore = (rootInitialState, storeHolder, previewMode =
|
|
|
110
102
|
holder.store.destroy = sagaMiddleware.run(rootSaga).cancel;
|
|
111
103
|
}
|
|
112
104
|
}
|
|
113
|
-
|
|
114
105
|
return holder.store;
|
|
115
106
|
};
|
package/vendor/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { reducer, actions, initialState } from './reducer';
|
|
2
2
|
import { sagas } from './saga';
|
|
3
|
-
import { vendorStoreName as storeName } from '../constants';
|
|
3
|
+
import { vendorStoreName as storeName } from '../constants';
|
|
4
4
|
|
|
5
|
+
// export types
|
|
5
6
|
export * from './interfaces';
|
|
6
|
-
export { sagas as vendorSagas, reducer as vendorReducers, actions as vendorActions, initialState as vendorInitialState, storeName as vendorStoreName };
|
|
7
|
+
export { sagas as vendorSagas, reducer as vendorReducers, actions as vendorActions, initialState as vendorInitialState, storeName as vendorStoreName };
|
|
7
8
|
|
|
9
|
+
// export store
|
|
8
10
|
export default {
|
|
9
11
|
sagas,
|
|
10
12
|
storeName,
|
package/vendor/reducer.js
CHANGED
package/vendor/saga.js
CHANGED
|
@@ -6,7 +6,6 @@ export function* loadVendorPublicInfo() {
|
|
|
6
6
|
yield put(actions.setVendorState({
|
|
7
7
|
loading: true
|
|
8
8
|
}));
|
|
9
|
-
|
|
10
9
|
try {
|
|
11
10
|
const {
|
|
12
11
|
whiteLabelMode = false
|
|
@@ -22,6 +21,7 @@ export function* loadVendorPublicInfo() {
|
|
|
22
21
|
console.error('failed to getVendorPublicInfo - ', e);
|
|
23
22
|
}
|
|
24
23
|
}
|
|
24
|
+
|
|
25
25
|
/*********************************
|
|
26
26
|
* Preview Sagas
|
|
27
27
|
*********************************/
|
|
@@ -36,7 +36,6 @@ function* loadVendorPublicInfoMock() {
|
|
|
36
36
|
console.error('failed to getVendorPublicInfo - ', e);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
|
|
40
39
|
export function* vendorSagasMock() {
|
|
41
40
|
yield takeEvery(actions.loadVendorPublicInfo, loadVendorPublicInfoMock);
|
|
42
41
|
}
|