@frontegg/redux-store 6.0.3-alpha.3 → 6.2.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 +11 -0
- package/audits/AuditLogsState/saga.js +3 -0
- package/audits/AuditsMetadataState/index.js +11 -0
- package/audits/AuditsMetadataState/saga.js +3 -0
- package/audits/backward-compatibility/saga.js +1 -0
- package/audits/index.js +4 -2
- package/auth/AcceptInvitationState/index.js +11 -0
- package/auth/AccountSettingsState/index.js +11 -0
- package/auth/AccountSettingsState/saga.js +3 -0
- package/auth/ActivateState/index.d.ts +12 -3
- package/auth/ActivateState/index.js +11 -0
- package/auth/ApiTokensState/index.js +11 -0
- package/auth/ApiTokensState/saga.js +3 -0
- package/auth/ForgotPasswordState/index.js +11 -0
- package/auth/LoginState/index.js +11 -0
- package/auth/LoginState/saga.js +24 -8
- package/auth/MfaState/index.d.ts +8 -2
- package/auth/MfaState/index.js +11 -0
- package/auth/MfaState/saga.js +3 -0
- package/auth/ProfileState/index.js +11 -0
- package/auth/ProfileState/saga.js +11 -4
- package/auth/ResetPhoneNumberState/index.js +11 -0
- package/auth/RolesState/index.js +11 -0
- package/auth/SSOState/index.js +12 -0
- package/auth/SSOState/saga.js +3 -0
- package/auth/SecurityPolicyState/index.js +11 -0
- package/auth/SecurityPolicyState/saga.js +4 -0
- package/auth/SessionsPolicyState/index.js +11 -0
- package/auth/SessionsState/index.d.ts +8 -0
- package/auth/SessionsState/index.js +11 -0
- package/auth/SessionsState/saga.js +3 -0
- package/auth/SignUp/index.js +11 -0
- package/auth/SocialLogins/index.d.ts +2 -8
- package/auth/SocialLogins/index.js +11 -0
- package/auth/TeamState/index.js +11 -0
- package/auth/TeamState/saga.js +3 -0
- package/auth/TenantsState/index.js +11 -0
- package/auth/TenantsState/saga.js +3 -0
- package/auth/dummy.js +2 -1
- package/auth/index.js +4 -2
- package/auth/interfaces.d.ts +1 -0
- package/auth/saga.js +7 -1
- package/connectivity/ConnectivityState/index.js +7 -0
- package/connectivity/index.js +4 -2
- package/connectivity/saga.js +40 -10
- package/helpers.js +2 -1
- package/index.js +1 -1
- package/node/audits/AuditLogsState/index.js +11 -0
- package/node/audits/AuditLogsState/saga.js +4 -0
- package/node/audits/AuditsMetadataState/index.js +11 -0
- package/node/audits/AuditsMetadataState/saga.js +4 -0
- package/node/audits/backward-compatibility/saga.js +1 -0
- package/node/audits/index.js +2 -0
- package/node/auth/AcceptInvitationState/index.js +11 -0
- package/node/auth/AccountSettingsState/index.js +11 -0
- package/node/auth/AccountSettingsState/saga.js +4 -0
- package/node/auth/ActivateState/index.js +11 -0
- package/node/auth/ApiTokensState/index.js +11 -0
- package/node/auth/ApiTokensState/saga.js +4 -0
- package/node/auth/ForgotPasswordState/index.js +11 -0
- package/node/auth/LoginState/index.js +11 -0
- package/node/auth/LoginState/saga.js +25 -8
- package/node/auth/MfaState/index.js +11 -0
- package/node/auth/MfaState/saga.js +4 -0
- package/node/auth/ProfileState/index.js +11 -0
- package/node/auth/ProfileState/saga.js +12 -4
- package/node/auth/ResetPhoneNumberState/index.js +11 -0
- package/node/auth/RolesState/index.js +11 -0
- package/node/auth/SSOState/index.js +12 -0
- package/node/auth/SSOState/saga.js +4 -0
- package/node/auth/SecurityPolicyState/index.js +11 -0
- package/node/auth/SecurityPolicyState/saga.js +4 -0
- package/node/auth/SessionsPolicyState/index.js +11 -0
- package/node/auth/SessionsState/index.js +11 -0
- package/node/auth/SessionsState/saga.js +4 -0
- package/node/auth/SignUp/index.js +11 -0
- package/node/auth/SocialLogins/index.js +11 -0
- package/node/auth/TeamState/index.js +11 -0
- package/node/auth/TeamState/saga.js +4 -0
- package/node/auth/TenantsState/index.js +11 -0
- package/node/auth/TenantsState/saga.js +4 -0
- package/node/auth/dummy.js +2 -1
- package/node/auth/index.js +2 -0
- package/node/auth/saga.js +7 -1
- package/node/connectivity/ConnectivityState/index.js +7 -0
- package/node/connectivity/index.js +2 -0
- package/node/connectivity/saga.js +40 -10
- package/node/helpers.js +2 -1
- package/node/index.js +1 -1
- package/node/subscriptions/Billing/Information/saga.js +4 -0
- package/node/subscriptions/Billing/Invoices/saga.js +4 -0
- package/node/subscriptions/Billing/PaymentMethod/index.js +2 -1
- package/node/subscriptions/Billing/PaymentMethod/interfaces.js +1 -0
- package/node/subscriptions/Billing/PaymentMethod/saga.js +4 -0
- package/node/subscriptions/Billing/Subscription/saga.js +6 -1
- package/node/subscriptions/Checkout/saga.js +8 -0
- package/node/subscriptions/Config/saga.js +4 -0
- package/node/subscriptions/Plans/saga.js +4 -0
- package/node/subscriptions/VendorPublicConfig/saga.js +4 -0
- package/node/subscriptions/dummy.js +15 -1
- package/node/subscriptions/index.js +2 -0
- package/node/toolkit/redux-types.js +5 -0
- package/node/vendor/VendorState/index.js +11 -0
- package/node/vendor/index.js +2 -0
- package/node/vendor/saga.js +4 -0
- package/package.json +1 -1
- package/subscriptions/Billing/Information/saga.js +3 -0
- package/subscriptions/Billing/Invoices/saga.js +4 -0
- package/subscriptions/Billing/PaymentMethod/index.js +2 -1
- package/subscriptions/Billing/PaymentMethod/interfaces.js +1 -0
- package/subscriptions/Billing/PaymentMethod/saga.js +4 -0
- package/subscriptions/Billing/Subscription/saga.js +6 -1
- package/subscriptions/Billing/interfaces.js +1 -0
- package/subscriptions/Checkout/saga.js +8 -0
- package/subscriptions/Config/saga.js +4 -0
- package/subscriptions/Plans/saga.js +4 -0
- package/subscriptions/VendorPublicConfig/saga.js +4 -0
- package/subscriptions/dummy.js +15 -1
- package/subscriptions/index.js +3 -1
- package/toolkit/index.d.ts +1 -1
- package/toolkit/redux-types.d.ts +3 -0
- package/toolkit/redux-types.js +1 -0
- package/toolkit/redux.d.ts +2 -1
- package/vendor/VendorState/index.js +11 -0
- package/vendor/index.js +4 -2
- package/vendor/saga.js +3 -0
|
@@ -17,8 +17,22 @@ const subscriptionResponseMock = {
|
|
|
17
17
|
currentPeriodStart: '2021-09-20T08:08:51.000Z',
|
|
18
18
|
currentPeriodEnd: '2021-10-20T08:08:51.000Z',
|
|
19
19
|
plan: {
|
|
20
|
+
// TODO: fix dummy data
|
|
20
21
|
slug: 'test'
|
|
21
|
-
}
|
|
22
|
+
} // items: [
|
|
23
|
+
// {
|
|
24
|
+
// id: 'si_KGE0p5himocPXH',
|
|
25
|
+
// externalId: 'prod_J60fUEvI7qV1eL',
|
|
26
|
+
// planId: 'prod_J60fUEvI7qV1eL',
|
|
27
|
+
// price: {
|
|
28
|
+
// id: 'price_1IToe8Ewsu4qiqnndAV76J69',
|
|
29
|
+
// externalId: 'price_1IToe8Ewsu4qiqnndAV76J69',
|
|
30
|
+
// currency: 'usd',
|
|
31
|
+
// amount: 10000,
|
|
32
|
+
// },
|
|
33
|
+
// },
|
|
34
|
+
// ],
|
|
35
|
+
|
|
22
36
|
};
|
|
23
37
|
exports.subscriptionResponseMock = subscriptionResponseMock;
|
|
24
38
|
const planResponseMock = [{
|
|
@@ -22,5 +22,16 @@ exports.vendorReducers = reducers;
|
|
|
22
22
|
const actions = {
|
|
23
23
|
loadVendorPublicInfo: (0, _toolkit.createAction)(`${_constants.vendorStoreName}/loadVendorPublicInfo`)
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* To be used for actions types after dispatch, and should contains
|
|
27
|
+
* the reducers and actions as standalone function
|
|
28
|
+
*/
|
|
29
|
+
|
|
25
30
|
exports.vendorActions = actions;
|
|
31
|
+
// noinspection JSUnusedLocalSymbols
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
35
|
+
* contains the same functions in reducers and actions
|
|
36
|
+
*/
|
|
26
37
|
const Matcher = {};
|
package/node/vendor/index.js
CHANGED
package/node/vendor/saga.js
CHANGED
package/package.json
CHANGED
|
@@ -84,6 +84,9 @@ export function* loadSummaries(tenantId, forceActive) {
|
|
|
84
84
|
yield put(informationActions.setError(e.message));
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
+
/*********************************
|
|
88
|
+
* Preview Sagas
|
|
89
|
+
*********************************/
|
|
87
90
|
|
|
88
91
|
function* loadBillingInformationMock() {
|
|
89
92
|
yield loadSummariesMock();
|
|
@@ -35,6 +35,7 @@ const actions = _extends({
|
|
|
35
35
|
updatePaymentMethodBillingDetails: createAction(`${name}/updateBillingDetails`, payload => ({
|
|
36
36
|
payload
|
|
37
37
|
}))
|
|
38
|
-
}, paymentActions);
|
|
38
|
+
}, paymentActions); //TODO: refactor to general code-style like export type ConnectivityActions = DispatchedActions;
|
|
39
|
+
|
|
39
40
|
|
|
40
41
|
export { reducer as subscriptionsPaymentMethodReducer, actions as subscriptionsPaymentMethodActions };
|
|
@@ -64,6 +64,10 @@ function* submitPaymentMethodError({
|
|
|
64
64
|
function* submitPaymentMethodSuccess() {
|
|
65
65
|
yield put(subscriptionsPaymentMethodActions.loadPaymentMethod());
|
|
66
66
|
}
|
|
67
|
+
/*********************************
|
|
68
|
+
* Preview Sagas
|
|
69
|
+
*********************************/
|
|
70
|
+
|
|
67
71
|
|
|
68
72
|
function* loadPaymentMethodMock() {
|
|
69
73
|
yield put(subscriptionsPaymentMethodActions.setLoading(true));
|
|
@@ -16,7 +16,8 @@ function* loadSubscriptionTenant() {
|
|
|
16
16
|
return (_state$auth = state.auth) == null ? void 0 : (_state$auth$user = _state$auth.user) == null ? void 0 : _state$auth$user.tenantId;
|
|
17
17
|
});
|
|
18
18
|
yield loadSummaries(tenantId);
|
|
19
|
-
}
|
|
19
|
+
} // @ts-ignore
|
|
20
|
+
|
|
20
21
|
|
|
21
22
|
export function* loadSubscription() {
|
|
22
23
|
yield put(subscriptionActions.setLoading(true));
|
|
@@ -100,6 +101,10 @@ function* renewSubscription() {
|
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
}
|
|
104
|
+
/*********************************
|
|
105
|
+
* Preview Sagas
|
|
106
|
+
*********************************/
|
|
107
|
+
|
|
103
108
|
|
|
104
109
|
function* loadMock() {
|
|
105
110
|
yield put(subscriptionActions.setLoading(true));
|
|
@@ -31,6 +31,10 @@ function* resetCheckout() {
|
|
|
31
31
|
confirmed: false
|
|
32
32
|
}));
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Based on payment provider type
|
|
36
|
+
*/
|
|
37
|
+
|
|
34
38
|
|
|
35
39
|
function* submitCheckout() {
|
|
36
40
|
yield put(checkoutActions.setState({
|
|
@@ -104,6 +108,10 @@ function* errorCheckout({
|
|
|
104
108
|
error: payload
|
|
105
109
|
}));
|
|
106
110
|
}
|
|
111
|
+
/*********************************
|
|
112
|
+
* Preview Sagas
|
|
113
|
+
*********************************/
|
|
114
|
+
|
|
107
115
|
|
|
108
116
|
export function* checkoutSagasMock() {
|
|
109
117
|
yield takeEvery(checkoutActions.resetCheckout, resetCheckout);
|
|
@@ -40,6 +40,10 @@ function* loadStripePaymentConfiguration() {
|
|
|
40
40
|
yield put(configActions.setError(e.message));
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
/*********************************
|
|
44
|
+
* Preview Sagas
|
|
45
|
+
*********************************/
|
|
46
|
+
|
|
43
47
|
|
|
44
48
|
function* loadPaymentConfigurationMock() {
|
|
45
49
|
yield put(configActions.setLoading(true));
|
|
@@ -34,6 +34,10 @@ function* loadPlans() {
|
|
|
34
34
|
yield put(plansActions.setError(e.message));
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
/*********************************
|
|
38
|
+
* Preview Sagas
|
|
39
|
+
*********************************/
|
|
40
|
+
|
|
37
41
|
|
|
38
42
|
function* loadPlansMock() {
|
|
39
43
|
yield put(plansActions.setLoading(true));
|
|
@@ -20,6 +20,10 @@ function* loadVendorPublicConfiguration() {
|
|
|
20
20
|
yield put(vendorPublicConfigActions.setError(e.message));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
/*********************************
|
|
24
|
+
* Preview Sagas
|
|
25
|
+
*********************************/
|
|
26
|
+
|
|
23
27
|
|
|
24
28
|
function* loadVendorPublicConfigurationMock() {
|
|
25
29
|
yield put(vendorPublicConfigActions.setLoading(true));
|
package/subscriptions/dummy.js
CHANGED
|
@@ -9,8 +9,22 @@ export const subscriptionResponseMock = {
|
|
|
9
9
|
currentPeriodStart: '2021-09-20T08:08:51.000Z',
|
|
10
10
|
currentPeriodEnd: '2021-10-20T08:08:51.000Z',
|
|
11
11
|
plan: {
|
|
12
|
+
// TODO: fix dummy data
|
|
12
13
|
slug: 'test'
|
|
13
|
-
}
|
|
14
|
+
} // items: [
|
|
15
|
+
// {
|
|
16
|
+
// id: 'si_KGE0p5himocPXH',
|
|
17
|
+
// externalId: 'prod_J60fUEvI7qV1eL',
|
|
18
|
+
// planId: 'prod_J60fUEvI7qV1eL',
|
|
19
|
+
// price: {
|
|
20
|
+
// id: 'price_1IToe8Ewsu4qiqnndAV76J69',
|
|
21
|
+
// externalId: 'price_1IToe8Ewsu4qiqnndAV76J69',
|
|
22
|
+
// currency: 'usd',
|
|
23
|
+
// amount: 10000,
|
|
24
|
+
// },
|
|
25
|
+
// },
|
|
26
|
+
// ],
|
|
27
|
+
|
|
14
28
|
};
|
|
15
29
|
export const planResponseMock = [{
|
|
16
30
|
id: 'prod_J60fUEvI7qV1eL',
|
package/subscriptions/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
// export store
|
|
1
2
|
import { subscriptionsStoreName as storeName } from '../constants';
|
|
2
3
|
import { actions, initialState, reducer } from './reducer';
|
|
3
4
|
import { sagas, mockSagas } from './saga';
|
|
4
5
|
export * from './interfaces';
|
|
5
|
-
export { sagas as subscriptionSagas, mockSagas as subscriptionSagasMock, reducer as subscriptionReducers, actions as subscriptionActions, initialState as subscriptionInitialState, storeName as subscriptionsStoreName };
|
|
6
|
+
export { sagas as subscriptionSagas, mockSagas as subscriptionSagasMock, reducer as subscriptionReducers, actions as subscriptionActions, initialState as subscriptionInitialState, storeName as subscriptionsStoreName }; // export store
|
|
7
|
+
|
|
6
8
|
export default {
|
|
7
9
|
sagas,
|
|
8
10
|
mockSagas,
|
package/toolkit/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AuthPageRoutes, AuthState } from '../auth';
|
|
2
|
-
import { EnhancedStore } from '@reduxjs/toolkit';
|
|
3
2
|
import { ContextOptions } from '@frontegg/rest-api';
|
|
4
3
|
import { AuditsState } from '../audits';
|
|
5
4
|
import { OldAuditsState } from '../audits/backward-compatibility';
|
|
5
|
+
import { EnhancedStore } from './redux-types';
|
|
6
6
|
export * from './redux';
|
|
7
7
|
export * from './redux-saga';
|
|
8
8
|
declare type InitialState = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/toolkit/redux.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { Middleware } from 'redux';
|
|
2
2
|
export { getDefaultMiddleware, combineReducers, configureStore, bindActionCreators, createSelector, createSlice } from '@reduxjs/toolkit';
|
|
3
|
-
export type { PayloadAction, Reducer,
|
|
3
|
+
export type { PayloadAction, Reducer, Dispatch, } from '@reduxjs/toolkit';
|
|
4
|
+
export type { EnhancedStore, } from './redux-types';
|
|
@@ -9,5 +9,16 @@ const reducers = {
|
|
|
9
9
|
const actions = {
|
|
10
10
|
loadVendorPublicInfo: createAction(`${vendorStoreName}/loadVendorPublicInfo`)
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* To be used for actions types after dispatch, and should contains
|
|
14
|
+
* the reducers and actions as standalone function
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// noinspection JSUnusedLocalSymbols
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
21
|
+
* contains the same functions in reducers and actions
|
|
22
|
+
*/
|
|
12
23
|
const Matcher = {};
|
|
13
24
|
export { reducers as vendorReducers, actions as vendorActions };
|
package/vendor/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
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'; // export types
|
|
4
|
+
|
|
4
5
|
export * from './interfaces';
|
|
5
|
-
export { sagas as vendorSagas, reducer as vendorReducers, actions as vendorActions, initialState as vendorInitialState, storeName as vendorStoreName };
|
|
6
|
+
export { sagas as vendorSagas, reducer as vendorReducers, actions as vendorActions, initialState as vendorInitialState, storeName as vendorStoreName }; // export store
|
|
7
|
+
|
|
6
8
|
export default {
|
|
7
9
|
sagas,
|
|
8
10
|
storeName,
|
package/vendor/saga.js
CHANGED