@frontegg/redux-store 5.22.0 → 5.23.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/node/subscriptions/index.js +20 -16
- package/package.json +1 -1
- package/subscriptions/index.js +20 -16
|
@@ -55,11 +55,11 @@ const configInitialState = {
|
|
|
55
55
|
fetching: true,
|
|
56
56
|
config: null,
|
|
57
57
|
};
|
|
58
|
-
const reducers$
|
|
58
|
+
const reducers$6 = Object.assign({}, createModuleCaseReducers());
|
|
59
59
|
const { actions: configActions, reducer: reducer$7, name: name$6, } = toolkit.createSlice({
|
|
60
60
|
name: `${constants.subscriptionsStoreName}/config`,
|
|
61
61
|
initialState: configInitialState,
|
|
62
|
-
reducers: reducers$
|
|
62
|
+
reducers: reducers$6,
|
|
63
63
|
});
|
|
64
64
|
const actions$7 = Object.assign({ loadPaymentConfiguration: toolkit.createAction(`${name$6}/loadPaymentConfiguration`) }, configActions);
|
|
65
65
|
|
|
@@ -78,14 +78,14 @@ const initialBillingInformationState = {
|
|
|
78
78
|
error: null,
|
|
79
79
|
},
|
|
80
80
|
};
|
|
81
|
-
const reducers$
|
|
81
|
+
const reducers$5 = Object.assign(Object.assign({}, createModuleCaseReducers()), { setBillingInformation: {
|
|
82
82
|
prepare: (payload) => ({ payload }),
|
|
83
83
|
reducer: (state, action) => (Object.assign(Object.assign({}, state), action.payload)),
|
|
84
84
|
}, setCancellationLoading: createKeyCaseLoadingReducer('cancellation'), setCancellationError: createKeyCaseErrorReducer('cancellation'), setRenewalLoading: createKeyCaseLoadingReducer('renewal'), setRenewalError: createKeyCaseErrorReducer('renewal') });
|
|
85
85
|
const { reducer: reducer$6, actions: overviewActions, name: name$5, } = toolkit.createSlice({
|
|
86
86
|
name: `${constants.subscriptionsStoreName}/billing/information`,
|
|
87
87
|
initialState: initialBillingInformationState,
|
|
88
|
-
reducers: reducers$
|
|
88
|
+
reducers: reducers$5,
|
|
89
89
|
});
|
|
90
90
|
const actions$6 = Object.assign({ loadBillingInformation: toolkit.createAction(`${name$5}/loadBillingInformation`), cancelSubscription: toolkit.createAction(`${name$5}/cancelSubscription`), renewSubscription: toolkit.createAction(`${name$5}/renewSubscription`) }, overviewActions);
|
|
91
91
|
|
|
@@ -94,14 +94,14 @@ const initialPaymentMethodState = {
|
|
|
94
94
|
error: null,
|
|
95
95
|
fetching: true,
|
|
96
96
|
};
|
|
97
|
-
const reducers$
|
|
97
|
+
const reducers$4 = Object.assign(Object.assign({}, createModuleCaseReducers()), { setState: {
|
|
98
98
|
prepare: (payload) => ({ payload }),
|
|
99
99
|
reducer: (state, action) => (Object.assign(Object.assign({}, state), action.payload)),
|
|
100
100
|
} });
|
|
101
101
|
const { reducer: reducer$5, actions: paymentActions, name: name$4, } = toolkit.createSlice({
|
|
102
102
|
name: `${constants.subscriptionsStoreName}/billing/payment`,
|
|
103
103
|
initialState: initialPaymentMethodState,
|
|
104
|
-
reducers: reducers$
|
|
104
|
+
reducers: reducers$4,
|
|
105
105
|
});
|
|
106
106
|
const actions$5 = Object.assign({ loadPaymentMethod: toolkit.createAction(`${name$4}/loadPaymentMethod`), submitPaymentMethod: toolkit.createAction(`${name$4}/submitPaymentMethod`), submitPaymentMethodError: toolkit.createAction(`${name$4}/submitPaymentMethodError`), submitPaymentMethodSuccess: toolkit.createAction(`${name$4}/submitPaymentMethodSuccess`), updatePaymentMethodBillingDetails: toolkit.createAction(`${name$4}/updateBillingDetails`, (payload) => ({ payload })) }, paymentActions);
|
|
107
107
|
|
|
@@ -115,14 +115,14 @@ const initialInvoicesState = {
|
|
|
115
115
|
error: null
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
|
-
const reducers$
|
|
118
|
+
const reducers$3 = Object.assign(Object.assign({}, createModuleCaseReducers()), { setInvoiceDownloadState: {
|
|
119
119
|
prepare: (payload) => ({ payload }),
|
|
120
120
|
reducer: (state, action) => (Object.assign(Object.assign({}, state), { invoiceDownload: Object.assign(Object.assign({}, state.invoiceDownload), action.payload) })),
|
|
121
121
|
} });
|
|
122
122
|
const { reducer: reducer$4, actions: sliceActions$1, name: name$3, } = toolkit.createSlice({
|
|
123
123
|
name: `${constants.subscriptionsStoreName}/billing/invoices`,
|
|
124
124
|
initialState: initialInvoicesState,
|
|
125
|
-
reducers: reducers$
|
|
125
|
+
reducers: reducers$3,
|
|
126
126
|
});
|
|
127
127
|
const actions$4 = Object.assign({ loadInvoices: toolkit.createAction(`${name$3}/loadInvoices`), downloadInvoice: toolkit.createAction(`${name$3}/downloadInvoice`, (payload) => ({ payload })) }, sliceActions$1);
|
|
128
128
|
|
|
@@ -165,7 +165,7 @@ const checkoutInitialState = {
|
|
|
165
165
|
status: exports.CheckoutStatus.SELECTION,
|
|
166
166
|
checkoutPlanId: null,
|
|
167
167
|
};
|
|
168
|
-
const reducers$
|
|
168
|
+
const reducers$2 = Object.assign(Object.assign({}, createModuleCaseReducers()), { setStatus: {
|
|
169
169
|
prepare: (payload) => ({ payload }),
|
|
170
170
|
reducer: (state, action) => (Object.assign(Object.assign({}, state), { status: action.payload })),
|
|
171
171
|
}, selectPlan: {
|
|
@@ -175,7 +175,7 @@ const reducers$1 = Object.assign(Object.assign({}, createModuleCaseReducers()),
|
|
|
175
175
|
const { actions: checkoutActions, reducer: reducer$3, name: name$2 } = toolkit.createSlice({
|
|
176
176
|
name: `${constants.subscriptionsStoreName}/checkout`,
|
|
177
177
|
initialState: checkoutInitialState,
|
|
178
|
-
reducers: reducers$
|
|
178
|
+
reducers: reducers$2,
|
|
179
179
|
});
|
|
180
180
|
const actions$3 = Object.assign({ checkoutPlan: toolkit.createAction(`${name$2}/checkoutPlan`, (payload) => ({ payload })), resetCheckout: toolkit.createAction(`${name$2}/resetCheckout`), confirmCheckout: toolkit.createAction(`${name$2}/confirmCheckout`, (payload) => ({ payload, })), cancelCheckout: toolkit.createAction(`${name$2}/cancelCheckout`), submitCheckout: toolkit.createAction(`${name$2}/submitCheckout`), errorCheckout: toolkit.createAction(`${name$2}/errorCheckout`, (payload) => ({ payload, })), checkoutEvent: toolkit.createAction(`${name$2}/checkoutEvent`, (payload) => ({ payload, })) }, checkoutActions);
|
|
181
181
|
|
|
@@ -184,14 +184,14 @@ const initialSubscriptionStripeState = {
|
|
|
184
184
|
error: null,
|
|
185
185
|
cardSetupIntentSecret: null,
|
|
186
186
|
};
|
|
187
|
-
const reducers = Object.assign(Object.assign({}, createModuleCaseReducers()), { setStripeState: {
|
|
187
|
+
const reducers$1 = Object.assign(Object.assign({}, createModuleCaseReducers()), { setStripeState: {
|
|
188
188
|
prepare: (payload) => ({ payload }),
|
|
189
189
|
reducer: (state, action) => (Object.assign(Object.assign({}, state), action.payload)),
|
|
190
190
|
} });
|
|
191
191
|
const { reducer: reducer$2, actions: reducerActions, name: name$1, } = toolkit.createSlice({
|
|
192
192
|
name: `${constants.subscriptionsStoreName}/stripe`,
|
|
193
193
|
initialState: initialSubscriptionStripeState,
|
|
194
|
-
reducers,
|
|
194
|
+
reducers: reducers$1,
|
|
195
195
|
});
|
|
196
196
|
const actions$2 = Object.assign({ loadCustomer: toolkit.createAction(`${name$1}/loadCustomer`), createCardSetupIntentSecret: toolkit.createAction(`${name$1}/createCardSetupIntentSecret`) }, reducerActions);
|
|
197
197
|
|
|
@@ -201,11 +201,11 @@ const managedSubscriptionsInitialState = {
|
|
|
201
201
|
fetching: true,
|
|
202
202
|
managedSubscriptions: [],
|
|
203
203
|
};
|
|
204
|
-
Object.assign({}, createModuleCaseReducers());
|
|
204
|
+
const reducers = Object.assign({}, createModuleCaseReducers());
|
|
205
205
|
const { reducer: reducer$1, actions: sliceActions, name } = toolkit.createSlice({
|
|
206
206
|
name: `${constants.subscriptionsStoreName}/managedSubscriptions`,
|
|
207
207
|
initialState: managedSubscriptionsInitialState,
|
|
208
|
-
reducers
|
|
208
|
+
reducers,
|
|
209
209
|
});
|
|
210
210
|
const actions$1 = Object.assign({ loadManagedSubscriptions: toolkit.createAction(`${name}/loadManagedSubscriptions`) }, sliceActions);
|
|
211
211
|
|
|
@@ -906,8 +906,12 @@ function* createCardSetupIntentSecret({ payload }) {
|
|
|
906
906
|
function* loadManagedSubscriptions() {
|
|
907
907
|
yield effects.put(actions$1.setLoading(true));
|
|
908
908
|
try {
|
|
909
|
-
const
|
|
910
|
-
yield effects.put(actions$1.setState(
|
|
909
|
+
const managedSubscriptions = yield effects.call(restApi.api.subscriptions.getManagedSubscriptions);
|
|
910
|
+
yield effects.put(actions$1.setState({
|
|
911
|
+
fetching: false,
|
|
912
|
+
loading: false,
|
|
913
|
+
managedSubscriptions,
|
|
914
|
+
}));
|
|
911
915
|
}
|
|
912
916
|
catch (e) {
|
|
913
917
|
yield effects.put(actions$1.setError(e.message));
|
package/package.json
CHANGED
package/subscriptions/index.js
CHANGED
|
@@ -52,11 +52,11 @@ const configInitialState = {
|
|
|
52
52
|
fetching: true,
|
|
53
53
|
config: null,
|
|
54
54
|
};
|
|
55
|
-
const reducers$
|
|
55
|
+
const reducers$6 = Object.assign({}, createModuleCaseReducers());
|
|
56
56
|
const { actions: configActions, reducer: reducer$7, name: name$6, } = createSlice({
|
|
57
57
|
name: `${subscriptionsStoreName}/config`,
|
|
58
58
|
initialState: configInitialState,
|
|
59
|
-
reducers: reducers$
|
|
59
|
+
reducers: reducers$6,
|
|
60
60
|
});
|
|
61
61
|
const actions$7 = Object.assign({ loadPaymentConfiguration: createAction(`${name$6}/loadPaymentConfiguration`) }, configActions);
|
|
62
62
|
|
|
@@ -75,14 +75,14 @@ const initialBillingInformationState = {
|
|
|
75
75
|
error: null,
|
|
76
76
|
},
|
|
77
77
|
};
|
|
78
|
-
const reducers$
|
|
78
|
+
const reducers$5 = Object.assign(Object.assign({}, createModuleCaseReducers()), { setBillingInformation: {
|
|
79
79
|
prepare: (payload) => ({ payload }),
|
|
80
80
|
reducer: (state, action) => (Object.assign(Object.assign({}, state), action.payload)),
|
|
81
81
|
}, setCancellationLoading: createKeyCaseLoadingReducer('cancellation'), setCancellationError: createKeyCaseErrorReducer('cancellation'), setRenewalLoading: createKeyCaseLoadingReducer('renewal'), setRenewalError: createKeyCaseErrorReducer('renewal') });
|
|
82
82
|
const { reducer: reducer$6, actions: overviewActions, name: name$5, } = createSlice({
|
|
83
83
|
name: `${subscriptionsStoreName}/billing/information`,
|
|
84
84
|
initialState: initialBillingInformationState,
|
|
85
|
-
reducers: reducers$
|
|
85
|
+
reducers: reducers$5,
|
|
86
86
|
});
|
|
87
87
|
const actions$6 = Object.assign({ loadBillingInformation: createAction(`${name$5}/loadBillingInformation`), cancelSubscription: createAction(`${name$5}/cancelSubscription`), renewSubscription: createAction(`${name$5}/renewSubscription`) }, overviewActions);
|
|
88
88
|
|
|
@@ -91,14 +91,14 @@ const initialPaymentMethodState = {
|
|
|
91
91
|
error: null,
|
|
92
92
|
fetching: true,
|
|
93
93
|
};
|
|
94
|
-
const reducers$
|
|
94
|
+
const reducers$4 = Object.assign(Object.assign({}, createModuleCaseReducers()), { setState: {
|
|
95
95
|
prepare: (payload) => ({ payload }),
|
|
96
96
|
reducer: (state, action) => (Object.assign(Object.assign({}, state), action.payload)),
|
|
97
97
|
} });
|
|
98
98
|
const { reducer: reducer$5, actions: paymentActions, name: name$4, } = createSlice({
|
|
99
99
|
name: `${subscriptionsStoreName}/billing/payment`,
|
|
100
100
|
initialState: initialPaymentMethodState,
|
|
101
|
-
reducers: reducers$
|
|
101
|
+
reducers: reducers$4,
|
|
102
102
|
});
|
|
103
103
|
const actions$5 = Object.assign({ loadPaymentMethod: createAction(`${name$4}/loadPaymentMethod`), submitPaymentMethod: createAction(`${name$4}/submitPaymentMethod`), submitPaymentMethodError: createAction(`${name$4}/submitPaymentMethodError`), submitPaymentMethodSuccess: createAction(`${name$4}/submitPaymentMethodSuccess`), updatePaymentMethodBillingDetails: createAction(`${name$4}/updateBillingDetails`, (payload) => ({ payload })) }, paymentActions);
|
|
104
104
|
|
|
@@ -112,14 +112,14 @@ const initialInvoicesState = {
|
|
|
112
112
|
error: null
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
const reducers$
|
|
115
|
+
const reducers$3 = Object.assign(Object.assign({}, createModuleCaseReducers()), { setInvoiceDownloadState: {
|
|
116
116
|
prepare: (payload) => ({ payload }),
|
|
117
117
|
reducer: (state, action) => (Object.assign(Object.assign({}, state), { invoiceDownload: Object.assign(Object.assign({}, state.invoiceDownload), action.payload) })),
|
|
118
118
|
} });
|
|
119
119
|
const { reducer: reducer$4, actions: sliceActions$1, name: name$3, } = createSlice({
|
|
120
120
|
name: `${subscriptionsStoreName}/billing/invoices`,
|
|
121
121
|
initialState: initialInvoicesState,
|
|
122
|
-
reducers: reducers$
|
|
122
|
+
reducers: reducers$3,
|
|
123
123
|
});
|
|
124
124
|
const actions$4 = Object.assign({ loadInvoices: createAction(`${name$3}/loadInvoices`), downloadInvoice: createAction(`${name$3}/downloadInvoice`, (payload) => ({ payload })) }, sliceActions$1);
|
|
125
125
|
|
|
@@ -162,7 +162,7 @@ const checkoutInitialState = {
|
|
|
162
162
|
status: CheckoutStatus.SELECTION,
|
|
163
163
|
checkoutPlanId: null,
|
|
164
164
|
};
|
|
165
|
-
const reducers$
|
|
165
|
+
const reducers$2 = Object.assign(Object.assign({}, createModuleCaseReducers()), { setStatus: {
|
|
166
166
|
prepare: (payload) => ({ payload }),
|
|
167
167
|
reducer: (state, action) => (Object.assign(Object.assign({}, state), { status: action.payload })),
|
|
168
168
|
}, selectPlan: {
|
|
@@ -172,7 +172,7 @@ const reducers$1 = Object.assign(Object.assign({}, createModuleCaseReducers()),
|
|
|
172
172
|
const { actions: checkoutActions, reducer: reducer$3, name: name$2 } = createSlice({
|
|
173
173
|
name: `${subscriptionsStoreName}/checkout`,
|
|
174
174
|
initialState: checkoutInitialState,
|
|
175
|
-
reducers: reducers$
|
|
175
|
+
reducers: reducers$2,
|
|
176
176
|
});
|
|
177
177
|
const actions$3 = Object.assign({ checkoutPlan: createAction(`${name$2}/checkoutPlan`, (payload) => ({ payload })), resetCheckout: createAction(`${name$2}/resetCheckout`), confirmCheckout: createAction(`${name$2}/confirmCheckout`, (payload) => ({ payload, })), cancelCheckout: createAction(`${name$2}/cancelCheckout`), submitCheckout: createAction(`${name$2}/submitCheckout`), errorCheckout: createAction(`${name$2}/errorCheckout`, (payload) => ({ payload, })), checkoutEvent: createAction(`${name$2}/checkoutEvent`, (payload) => ({ payload, })) }, checkoutActions);
|
|
178
178
|
|
|
@@ -181,14 +181,14 @@ const initialSubscriptionStripeState = {
|
|
|
181
181
|
error: null,
|
|
182
182
|
cardSetupIntentSecret: null,
|
|
183
183
|
};
|
|
184
|
-
const reducers = Object.assign(Object.assign({}, createModuleCaseReducers()), { setStripeState: {
|
|
184
|
+
const reducers$1 = Object.assign(Object.assign({}, createModuleCaseReducers()), { setStripeState: {
|
|
185
185
|
prepare: (payload) => ({ payload }),
|
|
186
186
|
reducer: (state, action) => (Object.assign(Object.assign({}, state), action.payload)),
|
|
187
187
|
} });
|
|
188
188
|
const { reducer: reducer$2, actions: reducerActions, name: name$1, } = createSlice({
|
|
189
189
|
name: `${subscriptionsStoreName}/stripe`,
|
|
190
190
|
initialState: initialSubscriptionStripeState,
|
|
191
|
-
reducers,
|
|
191
|
+
reducers: reducers$1,
|
|
192
192
|
});
|
|
193
193
|
const actions$2 = Object.assign({ loadCustomer: createAction(`${name$1}/loadCustomer`), createCardSetupIntentSecret: createAction(`${name$1}/createCardSetupIntentSecret`) }, reducerActions);
|
|
194
194
|
|
|
@@ -198,11 +198,11 @@ const managedSubscriptionsInitialState = {
|
|
|
198
198
|
fetching: true,
|
|
199
199
|
managedSubscriptions: [],
|
|
200
200
|
};
|
|
201
|
-
Object.assign({}, createModuleCaseReducers());
|
|
201
|
+
const reducers = Object.assign({}, createModuleCaseReducers());
|
|
202
202
|
const { reducer: reducer$1, actions: sliceActions, name } = createSlice({
|
|
203
203
|
name: `${subscriptionsStoreName}/managedSubscriptions`,
|
|
204
204
|
initialState: managedSubscriptionsInitialState,
|
|
205
|
-
reducers
|
|
205
|
+
reducers,
|
|
206
206
|
});
|
|
207
207
|
const actions$1 = Object.assign({ loadManagedSubscriptions: createAction(`${name}/loadManagedSubscriptions`) }, sliceActions);
|
|
208
208
|
|
|
@@ -903,8 +903,12 @@ function* createCardSetupIntentSecret({ payload }) {
|
|
|
903
903
|
function* loadManagedSubscriptions() {
|
|
904
904
|
yield put(actions$1.setLoading(true));
|
|
905
905
|
try {
|
|
906
|
-
const
|
|
907
|
-
yield put(actions$1.setState(
|
|
906
|
+
const managedSubscriptions = yield call(api.subscriptions.getManagedSubscriptions);
|
|
907
|
+
yield put(actions$1.setState({
|
|
908
|
+
fetching: false,
|
|
909
|
+
loading: false,
|
|
910
|
+
managedSubscriptions,
|
|
911
|
+
}));
|
|
908
912
|
}
|
|
909
913
|
catch (e) {
|
|
910
914
|
yield put(actions$1.setError(e.message));
|