@frontegg/redux-store 6.3.0 → 6.5.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.
Files changed (57) hide show
  1. package/audits/backward-compatibility/reducer.d.ts +1 -1
  2. package/audits/backward-compatibility/saga.js +4 -1
  3. package/audits/index.d.ts +1 -1
  4. package/audits/reducer.d.ts +1 -1
  5. package/auth/ApiTokensState/index.d.ts +14 -2
  6. package/auth/ApiTokensState/index.js +6 -0
  7. package/auth/ApiTokensState/saga.js +128 -2
  8. package/auth/LoginState/saga.js +9 -5
  9. package/auth/MfaState/saga.js +1 -1
  10. package/auth/SSOState/saga.js +1 -1
  11. package/auth/SecurityPolicyState/saga.d.ts +3 -2
  12. package/auth/SocialLogins/saga.d.ts +2 -2
  13. package/auth/index.d.ts +11 -1
  14. package/auth/reducer.d.ts +11 -1
  15. package/connectivity/index.d.ts +1 -1
  16. package/connectivity/reducer.d.ts +1 -1
  17. package/connectivity/saga.js +31 -10
  18. package/index.js +1 -1
  19. package/node/audits/backward-compatibility/saga.js +4 -1
  20. package/node/auth/ApiTokensState/index.js +6 -0
  21. package/node/auth/ApiTokensState/saga.js +128 -2
  22. package/node/auth/LoginState/saga.js +9 -5
  23. package/node/auth/MfaState/saga.js +1 -1
  24. package/node/auth/SSOState/saga.js +1 -1
  25. package/node/connectivity/saga.js +31 -10
  26. package/node/index.js +1 -1
  27. package/node/subscriptions/Billing/Information/saga.js +1 -1
  28. package/node/subscriptions/Billing/Subscription/saga.js +1 -2
  29. package/node/subscriptions/Checkout/saga.js +1 -3
  30. package/node/vendor/reducer.js +1 -1
  31. package/node/vendor/saga.js +9 -1
  32. package/package.json +5 -5
  33. package/subscriptions/Billing/Information/index.d.ts +1 -1
  34. package/subscriptions/Billing/Information/saga.d.ts +8 -26
  35. package/subscriptions/Billing/Information/saga.js +1 -1
  36. package/subscriptions/Billing/Invoices/index.d.ts +1 -1
  37. package/subscriptions/Billing/PaymentMethod/index.d.ts +1 -1
  38. package/subscriptions/Billing/Subscription/index.d.ts +1 -1
  39. package/subscriptions/Billing/Subscription/saga.d.ts +1 -11
  40. package/subscriptions/Billing/Subscription/saga.js +1 -2
  41. package/subscriptions/Billing/index.d.ts +1 -1
  42. package/subscriptions/Checkout/index.d.ts +1 -1
  43. package/subscriptions/Checkout/saga.js +1 -2
  44. package/subscriptions/Config/index.d.ts +1 -1
  45. package/subscriptions/Plans/index.d.ts +1 -1
  46. package/subscriptions/Stripe/index.d.ts +1 -1
  47. package/subscriptions/VendorPublicConfig/index.d.ts +1 -1
  48. package/subscriptions/index.d.ts +3 -3
  49. package/subscriptions/reducer.d.ts +3 -3
  50. package/toolkit/redux.d.ts +1 -1
  51. package/vendor/VendorState/index.d.ts +2 -1
  52. package/vendor/index.d.ts +1 -1
  53. package/vendor/interfaces.d.ts +2 -1
  54. package/vendor/reducer.d.ts +1 -1
  55. package/vendor/reducer.js +1 -1
  56. package/vendor/saga.d.ts +2 -2
  57. package/vendor/saga.js +9 -1
@@ -1,6 +1,6 @@
1
1
  import { StripeState } from './interfaces';
2
2
  export declare const initialSubscriptionStripeState: StripeState;
3
- declare const reducer: import("@reduxjs/toolkit").Reducer<StripeState, import("@reduxjs/toolkit").AnyAction>;
3
+ declare const reducer: import("redux").Reducer<StripeState, import("redux").AnyAction>;
4
4
  declare const actions: {
5
5
  setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
6
6
  setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
@@ -1,6 +1,6 @@
1
1
  import { VendorPublicConfigurationState } from './interfaces';
2
2
  export declare const vendorPublicConfigInitialState: VendorPublicConfigurationState;
3
- declare const reducer: import("@reduxjs/toolkit").Reducer<VendorPublicConfigurationState, import("@reduxjs/toolkit").AnyAction>;
3
+ declare const reducer: import("redux").Reducer<VendorPublicConfigurationState, import("redux").AnyAction>;
4
4
  declare const actions: {
5
5
  setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
6
6
  setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
@@ -6,14 +6,14 @@ export { sagas as subscriptionSagas, mockSagas as subscriptionSagasMock, reducer
6
6
  declare const _default: {
7
7
  sagas: typeof sagas;
8
8
  mockSagas: typeof mockSagas;
9
- reducer: import("@reduxjs/toolkit").Reducer<import("@reduxjs/toolkit").CombinedState<{
9
+ reducer: import("redux").Reducer<import("redux").CombinedState<{
10
10
  config: import("./interfaces").PaymentProviderConfigState;
11
- billing: import("@reduxjs/toolkit").CombinedState<import("./interfaces").BillingState>;
11
+ billing: import("redux").CombinedState<import("./interfaces").BillingState>;
12
12
  plans: import("./interfaces").PlansState;
13
13
  checkout: import("./interfaces").CheckoutState;
14
14
  stripe: import("./interfaces").StripeState;
15
15
  vendorPublicConfig: import("./interfaces").VendorPublicConfigurationState;
16
- }>, import("@reduxjs/toolkit").AnyAction>;
16
+ }>, import("redux").AnyAction>;
17
17
  actions: {
18
18
  config: {
19
19
  setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
@@ -88,12 +88,12 @@ declare const actions: {
88
88
  loadVendorPublicConfiguration: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
89
89
  };
90
90
  };
91
- declare const reducer: import("@reduxjs/toolkit").Reducer<import("@reduxjs/toolkit").CombinedState<{
91
+ declare const reducer: import("redux").Reducer<import("redux").CombinedState<{
92
92
  config: import("./interfaces").PaymentProviderConfigState;
93
- billing: import("@reduxjs/toolkit").CombinedState<import("./interfaces").BillingState>;
93
+ billing: import("redux").CombinedState<import("./interfaces").BillingState>;
94
94
  plans: import("./interfaces").PlansState;
95
95
  checkout: import("./interfaces").CheckoutState;
96
96
  stripe: import("./interfaces").StripeState;
97
97
  vendorPublicConfig: import("./interfaces").VendorPublicConfigurationState;
98
- }>, import("@reduxjs/toolkit").AnyAction>;
98
+ }>, import("redux").AnyAction>;
99
99
  export { subscriptionsStoreName as name, reducer, actions };
@@ -1,4 +1,4 @@
1
- export type { Middleware } from 'redux';
1
+ export type { Middleware, Action, AnyAction } from 'redux';
2
2
  export { getDefaultMiddleware, combineReducers, configureStore, bindActionCreators, createSelector, createSlice } from '@reduxjs/toolkit';
3
3
  export type { PayloadAction, Reducer, Dispatch, } from '@reduxjs/toolkit';
4
4
  export type { EnhancedStore, } from './redux-types';
@@ -2,7 +2,8 @@ import { VendorState } from '../interfaces';
2
2
  import { PayloadAction } from '@reduxjs/toolkit';
3
3
  declare const reducers: {
4
4
  setVendorState: (state: VendorState, { payload }: PayloadAction<Partial<VendorState>>) => {
5
- whiteLabelMode: boolean;
5
+ whiteLabelMode?: boolean | undefined;
6
+ loading: boolean;
6
7
  };
7
8
  };
8
9
  declare const actions: {
package/vendor/index.d.ts CHANGED
@@ -8,7 +8,7 @@ declare const _default: {
8
8
  sagas: typeof sagas;
9
9
  storeName: string;
10
10
  initialState: import("./interfaces").VendorState;
11
- reducer: import("@reduxjs/toolkit").Reducer<import("./interfaces").VendorState, import("@reduxjs/toolkit").AnyAction>;
11
+ reducer: import("redux").Reducer<import("./interfaces").VendorState, import("redux").AnyAction>;
12
12
  actions: {
13
13
  loadVendorPublicInfo: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
14
14
  setVendorState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<import("./interfaces").VendorState>, string>;
@@ -1,3 +1,4 @@
1
1
  export interface VendorState {
2
- whiteLabelMode: boolean;
2
+ whiteLabelMode?: boolean;
3
+ loading: boolean;
3
4
  }
@@ -1,6 +1,6 @@
1
1
  import { VendorState } from './interfaces';
2
2
  export declare const initialState: VendorState;
3
- declare const reducer: import("@reduxjs/toolkit").Reducer<VendorState, import("@reduxjs/toolkit").AnyAction>;
3
+ declare const reducer: import("redux").Reducer<VendorState, import("redux").AnyAction>;
4
4
  declare const actions: {
5
5
  loadVendorPublicInfo: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
6
6
  setVendorState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<VendorState>, string>;
package/vendor/reducer.js CHANGED
@@ -3,7 +3,7 @@ import { vendorStoreName } from '../constants';
3
3
  import { createSlice } from '@reduxjs/toolkit';
4
4
  import { vendorActions, vendorReducers } from './VendorState';
5
5
  export const initialState = {
6
- whiteLabelMode: false
6
+ loading: false
7
7
  };
8
8
  const {
9
9
  reducer,
package/vendor/saga.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export declare function loadVendorPublicInfo(): Generator<Promise<import("@frontegg/rest-api").IVendorPublicInfoResponse> | import("redux-saga/effects").PutEffect<{
1
+ export declare function loadVendorPublicInfo(): Generator<import("redux-saga/effects").PutEffect<{
2
2
  payload: Partial<import("./interfaces").VendorState>;
3
3
  type: string;
4
- }>, void, {
4
+ }> | Promise<import("@frontegg/rest-api").IVendorPublicInfoResponse>, void, {
5
5
  whiteLabelMode?: false | undefined;
6
6
  }>;
7
7
  export declare function vendorSagasMock(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
package/vendor/saga.js CHANGED
@@ -3,14 +3,22 @@ import { api } from '@frontegg/rest-api';
3
3
  import { actions } from './reducer';
4
4
  import { delay } from '../auth/utils';
5
5
  export function* loadVendorPublicInfo() {
6
+ yield put(actions.setVendorState({
7
+ loading: true
8
+ }));
9
+
6
10
  try {
7
11
  const {
8
12
  whiteLabelMode = false
9
13
  } = yield api.vendor.getVendorPublicInfo();
10
14
  yield put(actions.setVendorState({
11
- whiteLabelMode
15
+ whiteLabelMode,
16
+ loading: false
12
17
  }));
13
18
  } catch (e) {
19
+ yield put(actions.setVendorState({
20
+ loading: false
21
+ }));
14
22
  console.error('failed to getVendorPublicInfo - ', e);
15
23
  }
16
24
  }