@frontegg/redux-store 7.30.0-alpha.1 → 7.30.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.
Files changed (119) hide show
  1. package/audits/AuditLogsState/actions.d.ts +2 -2
  2. package/audits/AuditLogsState/actions.js +4 -7
  3. package/audits/AuditsMetadataState/actions.d.ts +2 -2
  4. package/audits/AuditsMetadataState/actions.js +3 -3
  5. package/audits/index.d.ts +2 -2
  6. package/auth/AccountSettingsState/actions.d.ts +2 -2
  7. package/auth/AccountSettingsState/actions.js +2 -2
  8. package/auth/ApiTokensState/actions.d.ts +3 -3
  9. package/auth/ApiTokensState/actions.js +3 -3
  10. package/auth/ApplicationsState/actions.d.ts +7 -7
  11. package/auth/ApplicationsState/actions.js +19 -24
  12. package/auth/CustomLoginState/actions.d.ts +2 -2
  13. package/auth/CustomLoginState/actions.js +6 -12
  14. package/auth/GroupsState/actions.d.ts +3 -3
  15. package/auth/GroupsState/actions.js +6 -6
  16. package/auth/LoginState/actions/index.d.ts +1 -1
  17. package/auth/LoginState/actions/index.js +21 -53
  18. package/auth/LoginState/actions/mfaRequiredState.actions.d.ts +2 -2
  19. package/auth/LoginState/actions/mfaRequiredState.actions.js +5 -13
  20. package/auth/MfaState/actions.d.ts +2 -2
  21. package/auth/MfaState/actions.js +3 -3
  22. package/auth/ProvisioningState/actions.d.ts +3 -3
  23. package/auth/ProvisioningState/actions.js +6 -7
  24. package/auth/RolesState/actions.d.ts +2 -2
  25. package/auth/RolesState/actions.js +2 -3
  26. package/auth/SSOState/actions/actions.v2.d.ts +2 -2
  27. package/auth/SSOState/actions/actions.v2.js +8 -8
  28. package/auth/SSOState/actions/index.d.ts +1 -1
  29. package/auth/Security/RestrictionsState/actions.js +3 -3
  30. package/auth/Security/SecurityCenterState/actions.d.ts +3 -3
  31. package/auth/Security/SecurityCenterState/actions.js +5 -5
  32. package/auth/Security/SecurityPolicyState/actions.d.ts +14 -14
  33. package/auth/Security/SecurityPolicyState/actions.js +30 -46
  34. package/auth/SessionsState/actions.d.ts +2 -2
  35. package/auth/SessionsState/actions.js +3 -3
  36. package/auth/SignUpState/actions.d.ts +2 -3
  37. package/auth/SignUpState/actions.js +5 -10
  38. package/auth/SignUpState/interfaces.d.ts +0 -1
  39. package/auth/SmsState/actions.d.ts +2 -2
  40. package/auth/SmsState/actions.js +3 -3
  41. package/auth/SocialLoginState/actions.d.ts +2 -2
  42. package/auth/SocialLoginState/actions.js +6 -6
  43. package/auth/TeamState/actions/index.d.ts +4 -4
  44. package/auth/TeamState/actions/invitation-link.actions.d.ts +2 -2
  45. package/auth/TeamState/actions/invitation-link.actions.js +6 -7
  46. package/auth/TeamState/actions/users.actions.d.ts +4 -4
  47. package/auth/TeamState/actions/users.actions.js +13 -18
  48. package/auth/TenantsState/actions.d.ts +2 -2
  49. package/auth/TenantsState/actions.js +1 -1
  50. package/auth/index.d.ts +1 -2
  51. package/auth/index.js +1 -15
  52. package/auth/interfaces.d.ts +0 -19
  53. package/auth/interfaces.js +0 -10
  54. package/connectivity/actions.js +7 -8
  55. package/constants.d.ts +0 -3
  56. package/constants.js +0 -3
  57. package/helpers/common.d.ts +2 -5
  58. package/helpers/common.js +2 -23
  59. package/index.d.ts +0 -1
  60. package/index.js +1 -2
  61. package/interfaces.d.ts +0 -8
  62. package/mocks/audits-mocks/auditLogsActions.mocks.d.ts +1 -1
  63. package/mocks/audits-mocks/auditsMetadataActions.mocks.d.ts +1 -1
  64. package/mocks/audits-mocks/index.d.ts +2 -2
  65. package/mocks/auth-mocks/accountSettingsActions.mocks.d.ts +1 -1
  66. package/mocks/auth-mocks/apiTokensActions.mocks.d.ts +2 -2
  67. package/mocks/auth-mocks/applicationsActions.mocks.d.ts +6 -6
  68. package/mocks/auth-mocks/customLoginActions.mocks.d.ts +1 -1
  69. package/mocks/auth-mocks/groupsActions.mocks.d.ts +2 -2
  70. package/mocks/auth-mocks/index.js +0 -14
  71. package/mocks/auth-mocks/loginActions.mocks.d.ts +1 -1
  72. package/mocks/auth-mocks/mfaActions.mocks.d.ts +1 -1
  73. package/mocks/auth-mocks/provisioningActions.mocks.d.ts +2 -2
  74. package/mocks/auth-mocks/rolesActions.mocks.d.ts +1 -1
  75. package/mocks/auth-mocks/security/securityCenterActions.mocks.d.ts +2 -2
  76. package/mocks/auth-mocks/security/securityPolicyActions.mocks.d.ts +12 -12
  77. package/mocks/auth-mocks/sessionsActions.mocks.d.ts +1 -1
  78. package/mocks/auth-mocks/signUpActions.mocks.d.ts +1 -1
  79. package/mocks/auth-mocks/smsActions.mocks.d.ts +1 -1
  80. package/mocks/auth-mocks/socialLoginActions.mocks.d.ts +1 -1
  81. package/mocks/auth-mocks/ssoActions.mocks.d.ts +1 -1
  82. package/mocks/auth-mocks/teamActions.mocks.d.ts +4 -4
  83. package/mocks/auth-mocks/tenantsActions.mocks.d.ts +1 -1
  84. package/mocks/index.d.ts +4 -4
  85. package/mocks/vendor-mocks/index.d.ts +2 -2
  86. package/node/audits/AuditLogsState/actions.js +3 -6
  87. package/node/audits/AuditsMetadataState/actions.js +2 -2
  88. package/node/auth/AccountSettingsState/actions.js +1 -1
  89. package/node/auth/ApiTokensState/actions.js +2 -2
  90. package/node/auth/ApplicationsState/actions.js +18 -23
  91. package/node/auth/CustomLoginState/actions.js +5 -11
  92. package/node/auth/GroupsState/actions.js +5 -5
  93. package/node/auth/LoginState/actions/index.js +19 -51
  94. package/node/auth/LoginState/actions/mfaRequiredState.actions.js +5 -13
  95. package/node/auth/MfaState/actions.js +2 -2
  96. package/node/auth/ProvisioningState/actions.js +5 -6
  97. package/node/auth/RolesState/actions.js +1 -2
  98. package/node/auth/SSOState/actions/actions.v2.js +7 -7
  99. package/node/auth/Security/RestrictionsState/actions.js +2 -2
  100. package/node/auth/Security/SecurityCenterState/actions.js +4 -4
  101. package/node/auth/Security/SecurityPolicyState/actions.js +29 -45
  102. package/node/auth/SessionsState/actions.js +2 -2
  103. package/node/auth/SignUpState/actions.js +4 -9
  104. package/node/auth/SmsState/actions.js +2 -2
  105. package/node/auth/SocialLoginState/actions.js +5 -5
  106. package/node/auth/TeamState/actions/invitation-link.actions.js +5 -6
  107. package/node/auth/TeamState/actions/users.actions.js +12 -17
  108. package/node/auth/TenantsState/actions.js +1 -1
  109. package/node/auth/index.js +1 -15
  110. package/node/auth/interfaces.js +1 -12
  111. package/node/connectivity/actions.js +6 -7
  112. package/node/constants.js +3 -8
  113. package/node/helpers/common.js +4 -28
  114. package/node/index.js +1 -1
  115. package/node/mocks/auth-mocks/index.js +4 -14
  116. package/node/vendor/actions.js +2 -2
  117. package/package.json +2 -2
  118. package/vendor/actions.d.ts +3 -3
  119. package/vendor/actions.js +3 -3
@@ -1,9 +1,9 @@
1
- import { FronteggState, RestApi, SharedActions, WithRetryConfig } from '../../interfaces';
1
+ import { FronteggState, RestApi, SharedActions } from '../../interfaces';
2
2
  import { AuditLogsState, LoadAuditLogsPayload } from './interfaces';
3
3
  declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
4
4
  setAuditLogsState: (state: Partial<AuditLogsState>) => void;
5
5
  resetAuditLogsState: () => void;
6
6
  exportAuditsCsv: () => Promise<void>;
7
- loadAuditLogs: (payload: WithRetryConfig<LoadAuditLogsPayload>) => Promise<void>;
7
+ loadAuditLogs: (payload: LoadAuditLogsPayload) => Promise<void>;
8
8
  };
9
9
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { initialState } from './state';
3
- import { deepResetState, errorHandler, retryIfNeeded } from '../../helpers';
3
+ import { deepResetState, errorHandler } from '../../helpers';
4
4
  export default ((store, api, sharedActions) => {
5
5
  const actions = sharedActions;
6
6
  const setAuditLogsState = state => {
@@ -47,7 +47,6 @@ export default ((store, api, sharedActions) => {
47
47
  error: null
48
48
  });
49
49
  const state = store.auditLogs.auditLogsState;
50
- const retryConfig = payload == null ? void 0 : payload.retryConfig;
51
50
  const {
52
51
  columns
53
52
  } = store.auditLogs.auditsMetadataState;
@@ -71,17 +70,15 @@ export default ((store, api, sharedActions) => {
71
70
  [n.id]: n.value
72
71
  }), {});
73
72
  if (!columns) {
74
- await actions.loadAuditsMetadata({
75
- retryConfig
76
- });
73
+ await actions.loadAuditsMetadata();
77
74
  }
78
75
  const {
79
76
  data,
80
77
  total
81
- } = await retryIfNeeded(() => api.audits.getAudits(_extends({
78
+ } = await api.audits.getAudits(_extends({
82
79
  offset: pageOffset,
83
80
  count: pageSize
84
- }, sortParams, filterParams)), retryConfig);
81
+ }, sortParams, filterParams));
85
82
  setAuditLogsState({
86
83
  loading: false,
87
84
  logs: data != null ? data : [],
@@ -1,8 +1,8 @@
1
- import { FronteggState, RestApi, SharedActions, WithRetryConfig } from '../../interfaces';
1
+ import { FronteggState, RestApi, SharedActions } from '../../interfaces';
2
2
  import { AuditsMetadataState } from './interfaces';
3
3
  declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
4
4
  setAuditsMetadataState: (state: Partial<AuditsMetadataState>) => void;
5
5
  resetAuditsMetadataState: () => void;
6
- loadAuditsMetadata: (payload?: WithRetryConfig<{}>) => Promise<void>;
6
+ loadAuditsMetadata: () => Promise<void>;
7
7
  };
8
8
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { initialState } from './state';
2
- import { deepResetState, retryIfNeeded } from '../../helpers';
2
+ import { deepResetState } from '../../helpers';
3
3
  export default ((store, api, sharedActions) => {
4
4
  const actions = sharedActions;
5
5
  const setAuditsMetadataState = state => {
@@ -8,7 +8,7 @@ export default ((store, api, sharedActions) => {
8
8
  const resetAuditsMetadataState = () => {
9
9
  deepResetState(store, ['auditLogs', 'auditsMetadataState'], initialState);
10
10
  };
11
- const loadAuditsMetadata = async payload => {
11
+ const loadAuditsMetadata = async () => {
12
12
  setAuditsMetadataState({
13
13
  loading: true,
14
14
  error: null
@@ -16,7 +16,7 @@ export default ((store, api, sharedActions) => {
16
16
  try {
17
17
  const {
18
18
  properties
19
- } = await retryIfNeeded(() => api.metadata.getAuditsMetadata(), payload == null ? void 0 : payload.retryConfig);
19
+ } = await api.metadata.getAuditsMetadata();
20
20
  setAuditsMetadataState({
21
21
  columns: properties,
22
22
  loading: false
package/audits/index.d.ts CHANGED
@@ -6,10 +6,10 @@ export declare const createAuditsState: (overrideState?: DeepPartial<AuditsState
6
6
  export declare const buildAuditsActions: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
7
7
  setAuditsMetadataState: (state: Partial<import("./interfaces").AuditsMetadataState>) => void;
8
8
  resetAuditsMetadataState: () => void;
9
- loadAuditsMetadata: (payload?: import("../interfaces").WithRetryConfig<{}>) => Promise<void>;
9
+ loadAuditsMetadata: () => Promise<void>;
10
10
  setAuditLogsState: (state: Partial<import("./interfaces").AuditLogsState>) => void;
11
11
  resetAuditLogsState: () => void;
12
12
  exportAuditsCsv: () => Promise<void>;
13
- loadAuditLogs: (payload: import("../interfaces").WithRetryConfig<import("./interfaces").LoadAuditLogsPayload>) => Promise<void>;
13
+ loadAuditLogs: (payload: import("./interfaces").LoadAuditLogsPayload) => Promise<void>;
14
14
  };
15
15
  export type AuditsActions = ReturnType<typeof buildAuditLogsActions> & ReturnType<typeof buildAuditsMetadataActions>;
@@ -1,10 +1,10 @@
1
- import { FronteggState, RestApi, SharedActions, WithCallback, WithRetryConfig, WithSilentLoad } from '../../interfaces';
1
+ import { FronteggState, RestApi, SharedActions, WithCallback, WithSilentLoad } from '../../interfaces';
2
2
  import { ISettingsResponse, IUpdateSettings } from '@frontegg/rest-api';
3
3
  import { AccountSettingsState } from './interfaces';
4
4
  declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
5
5
  setAccountSettingsState: (state: Partial<AccountSettingsState>) => void;
6
6
  resetAccountSettingsState: () => void;
7
7
  saveAccountSettings: (payload: WithCallback<IUpdateSettings, ISettingsResponse>) => Promise<void>;
8
- loadAccountSettings: (payload?: WithCallback<WithRetryConfig<WithSilentLoad>>) => Promise<void>;
8
+ loadAccountSettings: (payload?: WithCallback<WithSilentLoad>) => Promise<void>;
9
9
  };
10
10
  export default _default;
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["activeTenant", "tenants"];
4
4
  import { initialState } from './state';
5
- import { errorHandler, deepResetState, retryIfNeeded } from '../../helpers';
5
+ import { errorHandler, deepResetState } from '../../helpers';
6
6
  export default ((store, api, sharedActions) => {
7
7
  const actions = sharedActions;
8
8
  const setAccountSettingsState = state => {
@@ -71,7 +71,7 @@ export default ((store, api, sharedActions) => {
71
71
  error: null
72
72
  });
73
73
  try {
74
- const body = await retryIfNeeded(() => api.accountSettings.getSettings(), payload == null ? void 0 : payload.retryConfig);
74
+ const body = await api.accountSettings.getSettings();
75
75
  setAccountSettingsState(_extends({}, body, {
76
76
  loading: false
77
77
  }));
@@ -1,4 +1,4 @@
1
- import { FronteggState, WithCallback, SharedActions, RestApi, WithSilentLoad, WithRetryConfig } from '../../interfaces';
1
+ import { FronteggState, WithCallback, SharedActions, RestApi, WithSilentLoad } from '../../interfaces';
2
2
  import { AddTenantApiTokenPayload, AddUserApiTokenPayload, ApiStateIndicator, ApiTokensState } from './interfaces';
3
3
  declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
4
4
  setApiTokensLoader: (payload: ApiStateIndicator) => void;
@@ -6,8 +6,8 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
6
6
  setApiTokensState: (state: Partial<ApiTokensState>) => void;
7
7
  resetApiTokensState: () => void;
8
8
  loadApiTokens: (payload?: WithSilentLoad<WithCallback>) => Promise<void>;
9
- loadUserApiTokens: (payload?: WithRetryConfig<WithSilentLoad<WithCallback>>) => Promise<void>;
10
- loadTenantApiTokens: (payload?: WithRetryConfig<WithSilentLoad<WithCallback>>) => Promise<void>;
9
+ loadUserApiTokens: (payload?: WithSilentLoad<WithCallback>) => Promise<void>;
10
+ loadTenantApiTokens: (payload?: WithSilentLoad<WithCallback>) => Promise<void>;
11
11
  addTenantApiToken: (payload: AddTenantApiTokenPayload) => Promise<void>;
12
12
  addUserApiToken: (payload: AddUserApiTokenPayload) => Promise<void>;
13
13
  deleteUserApiToken: (payload: string) => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { initialState } from './state';
3
3
  import { MachineToMachineAuthStrategy } from '@frontegg/rest-api';
4
- import { errorHandler, delay, deepResetState, retryIfNeeded } from '../../helpers';
4
+ import { errorHandler, delay, deepResetState } from '../../helpers';
5
5
  import { ApiStateKeys } from './interfaces';
6
6
  export default ((store, api, sharedActions) => {
7
7
  const actions = sharedActions;
@@ -70,7 +70,7 @@ export default ((store, api, sharedActions) => {
70
70
  }
71
71
  try {
72
72
  var _accessTokensData$acc, _payload$callback3;
73
- const [apiTokensData = [], accessTokensData] = await Promise.all([retryIfNeeded(() => api.auth.getUserApiTokensData(), payload == null ? void 0 : payload.retryConfig), retryIfNeeded(() => api.auth.getUserAccessTokensData(), payload == null ? void 0 : payload.retryConfig)]);
73
+ const [apiTokensData = [], accessTokensData] = await Promise.all([api.auth.getUserApiTokensData(), api.auth.getUserAccessTokensData()]);
74
74
 
75
75
  // @ts-ignore TODO: fix createAt type to Date
76
76
  const accessTokens = (_accessTokensData$acc = accessTokensData.accessTokens) != null ? _accessTokensData$acc : [];
@@ -110,7 +110,7 @@ export default ((store, api, sharedActions) => {
110
110
  }
111
111
  try {
112
112
  var _accessTokensData$acc2, _payload$callback5;
113
- const [apiTokensData = [], accessTokensData] = await Promise.all([retryIfNeeded(() => api.auth.getTenantApiTokensData(), payload == null ? void 0 : payload.retryConfig), retryIfNeeded(() => api.auth.getTenantAccessTokensData(), payload == null ? void 0 : payload.retryConfig)]);
113
+ const [apiTokensData = [], accessTokensData] = await Promise.all([api.auth.getTenantApiTokensData(), api.auth.getTenantAccessTokensData()]);
114
114
 
115
115
  // @ts-ignore TODO: fix type in rest-api
116
116
  const accessTokens = (_accessTokensData$acc2 = accessTokensData == null ? void 0 : accessTokensData.accessTokens) != null ? _accessTokensData$acc2 : [];
@@ -1,14 +1,14 @@
1
- import { FronteggState, RestApi, SharedActions, WithCallback, WithRetryConfig } from '../../interfaces';
1
+ import { FronteggState, RestApi, SharedActions, WithCallback } from '../../interfaces';
2
2
  import { ApplicationsState, UserAppsAssignmentPayload } from './interfaces';
3
3
  import { IApplicationsResponse, ITeamUser } from '@frontegg/rest-api';
4
4
  declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
5
5
  setApplicationsState: (payload: Partial<ApplicationsState>) => void;
6
6
  resetApplicationsState: () => void;
7
- loadUserApplications: (payload?: WithRetryConfig<{}>) => Promise<void>;
8
- loadAccountApplications: (payload?: WithRetryConfig<{}>) => Promise<void>;
9
- loadMultipleUsersApplications: ({ userIds, retryConfig }: WithRetryConfig<{
7
+ loadUserApplications: () => Promise<void>;
8
+ loadAccountApplications: () => Promise<void>;
9
+ loadMultipleUsersApplications: ({ userIds }: {
10
10
  userIds: string[];
11
- }>) => Promise<Record<string, IApplicationsResponse[]> | undefined>;
11
+ }) => Promise<Record<string, IApplicationsResponse[]> | undefined>;
12
12
  assignUserToApps: (payload: WithCallback<UserAppsAssignmentPayload>) => Promise<void>;
13
13
  unassignUserFromApps: (payload: WithCallback<UserAppsAssignmentPayload>) => Promise<void>;
14
14
  assignNewUserToApps: ({ appIds, user }: {
@@ -17,9 +17,9 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
17
17
  }) => Promise<((IApplicationsResponse & {
18
18
  userIds?: string[];
19
19
  }) | never[])[] | undefined>;
20
- mapUsersWithApplicationData: ({ shouldLoadApps, users, retryConfig, }: WithRetryConfig<{
20
+ mapUsersWithApplicationData: ({ shouldLoadApps, users, }: {
21
21
  shouldLoadApps?: boolean;
22
22
  users: ITeamUser[];
23
- }>) => Promise<ITeamUser[]>;
23
+ }) => Promise<ITeamUser[]>;
24
24
  };
25
25
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { ApplicationAccessType } from '@frontegg/rest-api';
3
- import { deepResetState, errorHandler, retryIfNeeded } from '../../helpers';
3
+ import { deepResetState, errorHandler } from '../../helpers';
4
4
  import { initialState } from './state';
5
5
  import { getFlattenAppIds } from './helpers';
6
6
  export default ((store, api, sharedActions) => {
@@ -11,7 +11,7 @@ export default ((store, api, sharedActions) => {
11
11
  const resetApplicationsState = () => {
12
12
  deepResetState(store, ['auth', 'applicationsState'], initialState);
13
13
  };
14
- const loadUserApplications = async payload => {
14
+ const loadUserApplications = async () => {
15
15
  setApplicationsState({
16
16
  loading: true,
17
17
  fetching: true
@@ -19,13 +19,12 @@ export default ((store, api, sharedActions) => {
19
19
  try {
20
20
  var _store$auth$user$id, _store$auth$user;
21
21
  const userId = (_store$auth$user$id = (_store$auth$user = store.auth.user) == null ? void 0 : _store$auth$user.id) != null ? _store$auth$user$id : '';
22
- const retryConfig = payload == null ? void 0 : payload.retryConfig;
23
- const appIds = await retryIfNeeded(() => api.applications.getUserApplicationsId({
22
+ const appIds = await api.applications.getUserApplicationsId({
24
23
  userId
25
- }), retryConfig);
26
- const userApplications = await retryIfNeeded(() => api.applications.getApplicationsData({
24
+ });
25
+ const userApplications = await api.applications.getApplicationsData({
27
26
  appIds
28
- }), retryConfig);
27
+ });
29
28
  setApplicationsState({
30
29
  userApplications,
31
30
  fetching: false,
@@ -39,21 +38,20 @@ export default ((store, api, sharedActions) => {
39
38
  });
40
39
  }
41
40
  };
42
- const loadAccountApplications = async payload => {
43
- const retryConfig = payload == null ? void 0 : payload.retryConfig;
41
+ const loadAccountApplications = async () => {
44
42
  setApplicationsState({
45
43
  loading: true,
46
44
  fetching: true
47
45
  });
48
46
  try {
49
- const tenantAppIds = await retryIfNeeded(() => api.applications.getTenantsApplications(), retryConfig);
47
+ const tenantAppIds = await api.applications.getTenantsApplications();
50
48
  const appIds = getFlattenAppIds(tenantAppIds);
51
- const accountApplications = await retryIfNeeded(() => api.applications.getApplicationsData({
49
+ const accountApplications = await api.applications.getApplicationsData({
52
50
  appIds
53
- }), retryConfig);
54
- const usersOfApplications = await retryIfNeeded(() => api.applications.getUsersOfApplications({
51
+ });
52
+ const usersOfApplications = await api.applications.getUsersOfApplications({
55
53
  appIds
56
- }), retryConfig);
54
+ });
57
55
  const accountApplicationsWithUsers = accountApplications.map(app => {
58
56
  var _usersOfApplications$;
59
57
  return _extends({}, app, {
@@ -74,17 +72,16 @@ export default ((store, api, sharedActions) => {
74
72
  }
75
73
  };
76
74
  const loadMultipleUsersApplications = async ({
77
- userIds,
78
- retryConfig
75
+ userIds
79
76
  }) => {
80
77
  try {
81
- const usersAppIds = await retryIfNeeded(() => api.applications.getUsersApplicationsId({
78
+ const usersAppIds = await api.applications.getUsersApplicationsId({
82
79
  userIds
83
- }), retryConfig);
80
+ });
84
81
  const appIds = getFlattenAppIds(usersAppIds);
85
- const accountApplications = await retryIfNeeded(() => api.applications.getApplicationsData({
82
+ const accountApplications = await api.applications.getApplicationsData({
86
83
  appIds
87
- }), retryConfig);
84
+ });
88
85
  return userIds.reduce((acc, userId) => {
89
86
  var _usersAppIds$find, _userAppIds$map$filte, _userAppIds$map;
90
87
  const userAppIds = (_usersAppIds$find = usersAppIds.find(app => app.userId == userId)) == null ? void 0 : _usersAppIds$find.appIds;
@@ -193,8 +190,7 @@ export default ((store, api, sharedActions) => {
193
190
  };
194
191
  const mapUsersWithApplicationData = async ({
195
192
  shouldLoadApps,
196
- users,
197
- retryConfig
193
+ users
198
194
  }) => {
199
195
  const [multiAppsFlag] = await sharedActions.getFeatureFlags(['multi-apps-admin-portal']);
200
196
  if (!multiAppsFlag || !shouldLoadApps) {
@@ -202,8 +198,7 @@ export default ((store, api, sharedActions) => {
202
198
  }
203
199
  const userIds = users.map(user => user.id);
204
200
  const userApps = await loadMultipleUsersApplications({
205
- userIds,
206
- retryConfig
201
+ userIds
207
202
  });
208
203
  if (!userApps) {
209
204
  return users;
@@ -1,4 +1,4 @@
1
- import { FronteggState, RestApi, SharedActions, WithCallback, WithRetryConfig } from '../../interfaces';
1
+ import { FronteggState, RestApi, SharedActions, WithCallback } from '../../interfaces';
2
2
  import { CustomLoginState, UpdateTenantMetadataRequest } from './interfaces';
3
3
  declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
4
4
  setCustomLoginState: (payload: Partial<CustomLoginState>) => void;
@@ -6,6 +6,6 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
6
6
  loadTenantMetadata: () => Promise<void>;
7
7
  updateTenantMetadata: (payload: WithCallback<Partial<UpdateTenantMetadataRequest>>) => Promise<void>;
8
8
  customLoginEnabled: () => Promise<boolean>;
9
- loadCustomLoginRoutes: (payload?: WithCallback<WithRetryConfig<{}>>) => Promise<void>;
9
+ loadCustomLoginRoutes: () => Promise<void>;
10
10
  };
11
11
  export default _default;
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["callback"];
4
4
  import { initialState } from './state';
5
- import { errorHandler, deepResetState, retryIfNeeded } from '../../helpers';
5
+ import { errorHandler, deepResetState } from '../../helpers';
6
6
  import { mapMetaDataObjectToActions } from '../helpers';
7
7
  import { ContextHolder } from '@frontegg/rest-api';
8
8
  import { getSearchParamsFromUrl } from '../LoginState/helpers';
@@ -72,13 +72,11 @@ export default ((store, api, sharedActions) => {
72
72
  const resolvedTenant = (_await$ContextHolder$ = await ((_ContextHolder$for$ge = ContextHolder.for(store.root.appName).getContext()) == null ? void 0 : (_ContextHolder$for$ge2 = _ContextHolder$for$ge.tenantResolver) == null ? void 0 : _ContextHolder$for$ge2.call(_ContextHolder$for$ge))) == null ? void 0 : _await$ContextHolder$.tenant;
73
73
  return !!resolvedTenant;
74
74
  };
75
- const loadCustomLoginRoutes = async payload => {
75
+ const loadCustomLoginRoutes = async () => {
76
76
  try {
77
- var _getSearchParamsFromU, _payload$callback3;
77
+ var _getSearchParamsFromU;
78
78
  const isCustomLoginEnabled = await customLoginEnabled();
79
79
  if (!isCustomLoginEnabled) {
80
- var _payload$callback;
81
- payload == null ? void 0 : (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
82
80
  return;
83
81
  }
84
82
  const isAuthenticated = store.auth.isAuthenticated;
@@ -88,10 +86,8 @@ export default ((store, api, sharedActions) => {
88
86
  } = api.accountSettings;
89
87
  const {
90
88
  applicationUrl
91
- } = await retryIfNeeded(isAuthenticated ? getSettings : getPublicSettings, payload == null ? void 0 : payload.retryConfig);
89
+ } = await (isAuthenticated ? getSettings() : getPublicSettings());
92
90
  if (!applicationUrl) {
93
- var _payload$callback2;
94
- payload == null ? void 0 : (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, true);
95
91
  return;
96
92
  }
97
93
  const routes = store.auth.routes;
@@ -105,10 +101,8 @@ export default ((store, api, sharedActions) => {
105
101
  setCustomLoginState({
106
102
  customLoginSearchParams: searchParams != null ? searchParams : undefined
107
103
  });
108
- payload == null ? void 0 : (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
109
- } catch (e) {
110
- var _payload$callback4;
111
- payload == null ? void 0 : (_payload$callback4 = payload.callback) == null ? void 0 : _payload$callback4.call(payload, null, e);
104
+ } catch {
105
+ /* empty */
112
106
  }
113
107
  };
114
108
  return {
@@ -1,11 +1,11 @@
1
- import { FronteggState, RestApi, SharedActions, WithRetryConfig } from '../../interfaces';
1
+ import { FronteggState, RestApi, SharedActions } from '../../interfaces';
2
2
  import { GroupsState, GroupsStateIndicator, IGroupsStateActionsPayloads } from './interfaces';
3
3
  declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
4
4
  setUsersGroupsLoader: (payload: GroupsStateIndicator) => void;
5
5
  setUsersGroupsError: (payload: GroupsStateIndicator) => void;
6
6
  setGroupsState: (payload: Partial<GroupsState>) => void;
7
7
  resetUsersGroupsState: () => void;
8
- loadGroups: (payload?: WithRetryConfig<{}>) => Promise<void>;
8
+ loadGroups: () => Promise<void>;
9
9
  getGroupById: (payload: IGroupsStateActionsPayloads["getGroupById"]) => Promise<void>;
10
10
  createGroup: (payload: IGroupsStateActionsPayloads["createGroup"]) => Promise<void>;
11
11
  updateGroup: (payload: IGroupsStateActionsPayloads["updateGroup"]) => Promise<void>;
@@ -14,7 +14,7 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
14
14
  deleteRolesFromGroup: (payload: IGroupsStateActionsPayloads["deleteRolesFromGroup"]) => Promise<void>;
15
15
  addUsersToGroup: (payload: IGroupsStateActionsPayloads["addUsersToGroup"]) => Promise<void>;
16
16
  deleteUsersFromGroup: (payload: IGroupsStateActionsPayloads["deleteUsersFromGroup"]) => Promise<void>;
17
- getGroupConfiguration: (payload?: WithRetryConfig<{}>) => Promise<void>;
17
+ getGroupConfiguration: () => Promise<void>;
18
18
  updateGroupConfiguration: (payload: IGroupsStateActionsPayloads["updateGroupConfiguration"]) => Promise<void>;
19
19
  getTeamUsers: (payload: IGroupsStateActionsPayloads["getTeamUsers"]) => Promise<void>;
20
20
  };
@@ -2,7 +2,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["roleIds", "userIds"];
4
4
  import { GroupRelations, GroupsStateKeys } from './interfaces';
5
- import { errorHandler, deepResetState, retryIfNeeded } from '../../helpers';
5
+ import { errorHandler, deepResetState } from '../../helpers';
6
6
  import { initialState } from './state';
7
7
  export default ((store, api, sharedActions) => {
8
8
  const setUsersGroupsLoader = payload => {
@@ -28,7 +28,7 @@ export default ((store, api, sharedActions) => {
28
28
  const resetUsersGroupsState = () => {
29
29
  deepResetState(store, ['auth', 'groupsState'], initialState);
30
30
  };
31
- const loadGroups = async payload => {
31
+ const loadGroups = async () => {
32
32
  const key = GroupsStateKeys.GET_GROUPS;
33
33
  const state = store.auth.groupsState;
34
34
  setUsersGroupsLoader({
@@ -39,9 +39,9 @@ export default ((store, api, sharedActions) => {
39
39
  // @ts-ignore TODO: fix return type in rest-api
40
40
  const {
41
41
  groups
42
- } = await retryIfNeeded(() => api.groups.getGroups({
42
+ } = await api.groups.getGroups({
43
43
  _groupsRelations: GroupRelations.rolesAndUsers
44
- }), payload == null ? void 0 : payload.retryConfig);
44
+ });
45
45
  setGroupsState(_extends({
46
46
  groups
47
47
  }, state.selectedGroup && {
@@ -304,14 +304,14 @@ export default ((store, api, sharedActions) => {
304
304
  });
305
305
  }
306
306
  };
307
- const getGroupConfiguration = async payload => {
307
+ const getGroupConfiguration = async () => {
308
308
  const key = GroupsStateKeys.GET_GROUP_CONFIGURATION;
309
309
  setUsersGroupsLoader({
310
310
  key,
311
311
  value: true
312
312
  });
313
313
  try {
314
- const groupsConfiguration = await retryIfNeeded(() => api.groups.getGroupConfiguration(), payload == null ? void 0 : payload.retryConfig);
314
+ const groupsConfiguration = await api.groups.getGroupConfiguration();
315
315
  setGroupsState({
316
316
  groupsConfiguration
317
317
  });
@@ -18,7 +18,7 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
18
18
  verifyMFAEmailCodeForLogin: (payload: WithCallback<import("@frontegg/rest-api").IVerifyMFAEmailCode>) => Promise<void>;
19
19
  mfaWithAuthenticator: ({ callback, ...loginWithMfaPayload }: WithCallback<import("@frontegg/rest-api").ILoginWithMfa>, setLoadingAction: import("../interfaces").SetLoadingAction, isStepUp: boolean) => Promise<void>;
20
20
  loginWithMfa: (payload: WithCallback<import("@frontegg/rest-api").ILoginWithMfa>) => Promise<void>;
21
- getMfaRequiredState: (user: import("../../interfaces").User | any, retryConfig?: import("../../../interfaces").RetryConfig, shouldContinueWhenFailing?: boolean) => Promise<Partial<AuthState> & {
21
+ getMfaRequiredState: (user: import("../../interfaces").User | any) => Promise<Partial<AuthState> & {
22
22
  mfaState: Partial<MFAState>;
23
23
  loginState: Partial<LoginState>;
24
24
  }>;
@@ -23,20 +23,19 @@ import mfaWithEmailCodeActions from './mfaWithEmailCode.actions';
23
23
  import mfaWithSMSActions from './mfaWithSMS.actions';
24
24
  import mfaWithWebAuthnActions from './mfaWithWebAuthn.actions';
25
25
  import { LoginFlow, LoginStep } from '../interfaces';
26
- import { base64urlDecode, deepResetState, errorHandler, errorTraceId, publicKeyCredentialToJSON, retryIfNeeded, withRetryConfig } from '../../../helpers';
26
+ import { base64urlDecode, deepResetState, errorHandler, publicKeyCredentialToJSON } from '../../../helpers';
27
27
  import { initialState } from '../state';
28
28
  import { getSearchParam, isEmailPayload, TENANT_ID_PARAM_KEY } from '../helpers';
29
29
  import { AuthStrategyEnum, ContextHolder, WebAuthnDeviceType } from '@frontegg/rest-api';
30
30
  import hostedLoginAuthorizeActions from './hostedLoginAuthorize.actions';
31
31
  import { FronteggNativeModule, isEntitlementsDeeplyEqual } from '../../../toolkit';
32
- import { REQUEST_NAME, UserVerifiedOriginTypes } from '../../interfaces';
32
+ import { UserVerifiedOriginTypes } from '../../interfaces';
33
33
  import { authStrategyLoginStepMap } from '../consts';
34
34
  import { GTMEventAction, reportGTMEvent } from '../../../helpers';
35
35
  import { isMfaRequired } from '../../helpers';
36
36
  import { MFAStep } from '../../MfaState/interfaces';
37
37
  import { SamlVendors } from '../../SSOState/interfaces';
38
38
  import { removeTabTenantFromSessionStorage } from '@frontegg/rest-api';
39
- import { DEFAULT_RETRY_CONFIG } from '../../../constants';
40
39
  export default ((store, api, sharedActions) => {
41
40
  const actions = sharedActions;
42
41
  const contextHolder = ContextHolder.for(store.root.appName);
@@ -193,31 +192,25 @@ export default ((store, api, sharedActions) => {
193
192
  };
194
193
 
195
194
  /** @private */
196
- const __loadSSOPublicConfigurationFunction = async payload => {
195
+ const __loadSSOPublicConfigurationFunction = async () => {
197
196
  try {
198
- var _payload$callback;
199
197
  const {
200
198
  isActive
201
- } = await retryIfNeeded(api.auth.getSSOPublicConfiguration, payload == null ? void 0 : payload.retryConfig);
199
+ } = await api.auth.getSSOPublicConfiguration();
202
200
  actions.setAuthState({
203
201
  isSSOAuth: isActive
204
202
  });
205
- payload == null ? void 0 : (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, {
206
- isSSOAuth: isActive
207
- });
208
203
  } catch (e) {
209
- var _payload$callback2;
210
204
  actions.setAuthState({
211
205
  isSSOAuth: false
212
206
  });
213
- payload == null ? void 0 : (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, null, e);
214
207
  }
215
208
  };
216
- const __refreshMetadata = async payload => {
209
+ const __refreshMetadata = async () => {
217
210
  let ssoACS;
218
211
  try {
219
212
  var _metadata$configurati;
220
- const metadata = await retryIfNeeded(api.metadata.getSamlMetadata, payload == null ? void 0 : payload.retryConfig);
213
+ const metadata = await api.metadata.getSamlMetadata();
221
214
  ssoACS = metadata == null ? void 0 : (_metadata$configurati = metadata.configuration) == null ? void 0 : _metadata$configurati.acsUrl;
222
215
  } catch (e) {
223
216
  console.error(e);
@@ -260,48 +253,23 @@ export default ((store, api, sharedActions) => {
260
253
  const requestAuthorize = async firstTime => {
261
254
  const calls = [];
262
255
  const callsAfterRefresh = [];
263
- calls.push(__refreshToken()); // refresh
264
-
256
+ calls.push(__refreshToken());
265
257
  if (firstTime) {
266
- // TODO dont forget to use it only in specific pages / scenarios
267
- const getRetryWithBlockingCallbackPayload = requestName => {
268
- const callback = (_, error) => {
269
- if (!error) return;
270
- actions.setErrorByRequestName({
271
- requestName,
272
- traceId: errorTraceId(error)
273
- });
274
- };
275
- return withRetryConfig({
276
- callback
277
- });
278
- };
279
-
280
- // debugger
281
258
  actions.setAuthState({
282
259
  isLoading: true
283
260
  });
284
- // identity/resources/sso/v2
285
- // /identity/resources/sso/custom/v1
286
- calls.push(actions.loadSocialLoginsConfigurationV2(withRetryConfig()));
287
- // identity/resources/configurations/v1/public
288
- // custom login box: identity/resources/configurations/v1/auth/strategies/public
289
- calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
290
- // identity/resources/configurations/v1/auth/strategies/public
291
- calls.push(actions.loadPublicAuthStrategiesPolicy(getRetryWithBlockingCallbackPayload(REQUEST_NAME.LOAD_PUBLIC_AUTH_STRATEGIES_POLICY)));
292
- // team/resources/sso/v2/configurations/public
293
- calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
294
- // vendors/public
295
- calls.push(actions.loadVendorPublicInfo(withRetryConfig()));
296
- // metadata?entityName=saml
297
- calls.push(__refreshMetadata(withRetryConfig()));
298
- // custom login routes
261
+ calls.push(actions.loadSocialLoginsConfigurationV2());
262
+ calls.push(actions.loadAllowSignUps());
263
+ calls.push(actions.loadPublicAuthStrategiesPolicy());
264
+ calls.push(__loadSSOPublicConfigurationFunction());
265
+ calls.push(actions.loadVendorPublicInfo());
266
+ calls.push(__refreshMetadata());
299
267
  /*
300
268
  We will load custom login routes only if custom login is enabled
301
269
  to check if custom login is enabled without the tenant alias (search-param/subdomain)
302
270
  we have to wait for the user state (refreshToken request)
303
271
  */
304
- callsAfterRefresh.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
272
+ callsAfterRefresh.push(actions.loadCustomLoginRoutes());
305
273
  }
306
274
  await Promise.all(calls);
307
275
  if (callsAfterRefresh.length > 0) {
@@ -471,7 +439,7 @@ export default ((store, api, sharedActions) => {
471
439
  routes
472
440
  } = store.auth;
473
441
  if (isMfaRequired(user, store.root.appName)) {
474
- const mfaRequiredState = await actions.getMfaRequiredState(user, DEFAULT_RETRY_CONFIG, true);
442
+ const mfaRequiredState = await actions.getMfaRequiredState(user);
475
443
  actions.setAuthState(mfaRequiredState);
476
444
  onRedirectTo(routes.loginUrl, {
477
445
  preserveQueryParams: true
@@ -573,8 +541,8 @@ export default ((store, api, sharedActions) => {
573
541
  removeTabTenantFromSessionStorage();
574
542
  }
575
543
  setTimeout(() => {
576
- var _payload$callback3;
577
- return payload == null ? void 0 : (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
544
+ var _payload$callback;
545
+ return payload == null ? void 0 : (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
578
546
  }, (_payload$callbackTime = payload == null ? void 0 : payload.callbackTimeout) != null ? _payload$callbackTime : 500);
579
547
  };
580
548
  const recoverMfa = async payload => {
@@ -582,7 +550,7 @@ export default ((store, api, sharedActions) => {
582
550
  loading: true
583
551
  });
584
552
  try {
585
- var _payload$callback4;
553
+ var _payload$callback2;
586
554
  await api.auth.recoverMfaToken(payload);
587
555
  setLoginState({
588
556
  loading: false,
@@ -593,14 +561,14 @@ export default ((store, api, sharedActions) => {
593
561
  user: undefined,
594
562
  isAuthenticated: false
595
563
  });
596
- (_payload$callback4 = payload.callback) == null ? void 0 : _payload$callback4.call(payload, true);
564
+ (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, true);
597
565
  } catch (e) {
598
- var _payload$callback5;
566
+ var _payload$callback3;
599
567
  setLoginState({
600
568
  error: errorHandler(e),
601
569
  loading: false
602
570
  });
603
- (_payload$callback5 = payload.callback) == null ? void 0 : _payload$callback5.call(payload, false, e);
571
+ (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, false, e);
604
572
  }
605
573
  };
606
574
  const quickSmsPasswordlessPreLogin = async _payload => {
@@ -1,9 +1,9 @@
1
1
  import { LoginState } from '../interfaces';
2
2
  import { MFAState } from '../../MfaState/interfaces';
3
3
  import { AuthState, User } from '../../interfaces';
4
- import { FronteggState, RestApi, RetryConfig, SharedActions } from '../../../interfaces';
4
+ import { FronteggState, RestApi, SharedActions } from '../../../interfaces';
5
5
  declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
6
- getMfaRequiredState: (user: User | any, retryConfig?: RetryConfig, shouldContinueWhenFailing?: boolean) => Promise<Partial<AuthState> & {
6
+ getMfaRequiredState: (user: User | any) => Promise<Partial<AuthState> & {
7
7
  mfaState: Partial<MFAState>;
8
8
  loginState: Partial<LoginState>;
9
9
  }>;