@frontegg/redux-store 6.45.0-alpha.2 → 6.45.0-alpha.4

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.
@@ -129,7 +129,7 @@ declare const actions: {
129
129
  activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IActivateAccountPayload, boolean>], WithCallback<IActivateAccountPayload, boolean>, string, never, never>;
130
130
  preActivateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IPreActivateAccount], IPreActivateAccount, string, never, never>;
131
131
  getActivateAccountStrategy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse>], WithCallback<IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse>, string, never, never>;
132
- resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IResendActivationEmail], IResendActivationEmail, string, never, never>;
132
+ resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IResendActivationEmail, boolean>], WithCallback<IResendActivationEmail, boolean>, string, never, never>;
133
133
  };
134
134
  /**
135
135
  * To be used for actions types after dispatch, and should contains
@@ -141,7 +141,7 @@ declare type DispatchedActions = {
141
141
  setActivateStrategyState: (state: Partial<ActivateAccountStrategyState>) => void;
142
142
  activateAccount: (payload: WithCallback<IActivateAccountPayload>) => void;
143
143
  preActivateAccount: (payload: IPreActivateAccount) => void;
144
- resendActivationEmail: (payload: IResendActivationEmail) => void;
144
+ resendActivationEmail: (payload: WithCallback<IResendActivationEmail>) => void;
145
145
  getActivateAccountStrategy: (payload: WithCallback<IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse>) => void;
146
146
  };
147
147
  export declare type ActivateAccountActions = DispatchedActions;
@@ -1,12 +1,14 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  const _excluded = ["callback", "events"],
3
- _excluded2 = ["callback"];
3
+ _excluded2 = ["callback"],
4
+ _excluded3 = ["callback"];
4
5
  import { call, delay, put, select, takeLeading } from 'redux-saga/effects';
5
6
  import { api, ContextHolder } from '@frontegg/rest-api';
6
7
  import { actions } from '../reducer';
7
8
  import { afterAuthNavigation, getMfaRequiredState, isMfaRequired } from '../LoginState/saga';
8
9
  import { UserVeirifedOriginTypes } from '../interfaces';
9
10
  import { ActivateAccountStep } from './interfaces';
11
+ import { TeamStateKeys } from '../TeamState/interfaces';
10
12
 
11
13
  function* preActivateAccount({
12
14
  payload: {
@@ -158,25 +160,43 @@ function* getActivateAccountStrategy({
158
160
  function* resendActivationEmailFunction({
159
161
  payload
160
162
  }) {
163
+ const {
164
+ callback
165
+ } = payload,
166
+ body = _objectWithoutPropertiesLoose(payload, _excluded3);
167
+
168
+ yield put(actions.setTeamLoader({
169
+ key: TeamStateKeys.RESEND_ACTIVATE_LINK,
170
+ value: body.email
171
+ }));
161
172
  yield put(actions.setActivateState({
162
173
  loading: true
163
174
  }));
164
175
 
165
176
  try {
166
- yield call(api.auth.resendActivationEmail, {
167
- email: payload.email
168
- });
177
+ yield call(api.auth.resendActivationEmail, body);
169
178
  yield put(actions.setActivateState({
170
179
  loading: false,
171
180
  error: undefined,
172
181
  resentEmail: true
173
182
  }));
183
+ callback == null ? void 0 : callback(true);
174
184
  } catch (e) {
175
185
  yield put(actions.setActivateState({
176
186
  loading: false,
177
187
  error: e.message
178
188
  }));
189
+ yield put(actions.setTeamError({
190
+ key: TeamStateKeys.RESEND_ACTIVATE_LINK,
191
+ value: e.message
192
+ }));
193
+ callback == null ? void 0 : callback(null, e.message);
179
194
  }
195
+
196
+ yield put(actions.setTeamLoader({
197
+ key: TeamStateKeys.RESEND_ACTIVATE_LINK,
198
+ value: false
199
+ }));
180
200
  }
181
201
 
182
202
  export function* activateSagas() {
@@ -1,4 +1,4 @@
1
- import { IAddUser, IDeleteUser, ILoadUsers, IResendActivationLink, IResendInvitationLink, ITeamUser, IUpdateUser, ICreateOrUpdateInviteUserLink, ILoadAllUsers, ISubTenantUser, AddUserToSubTenantsRequest, RemoveUserFromSubTenantsRequest, UpdateUserRolesForSubTenantsRequestDto } from '@frontegg/rest-api';
1
+ import { IAddUser, IDeleteUser, ILoadUsers, IResendActivationLink, IResendInvitationLink, IResendInvitationEmail, ITeamUser, IUpdateUser, ICreateOrUpdateInviteUserLink, ILoadAllUsers, ISubTenantUser, AddUserToSubTenantsRequest, RemoveUserFromSubTenantsRequest, UpdateUserRolesForSubTenantsRequestDto } from '@frontegg/rest-api';
2
2
  import { ISetAddUserDialog, ISetDeleteUserDialog, TeamState, TeamStateIndicator, LoadRolesAndPermissionsPayload } from './interfaces';
3
3
  import { WithCallback, WithSilentLoad } from '../../interfaces';
4
4
  declare const teamState: TeamState;
@@ -127,6 +127,7 @@ declare const actions: {
127
127
  lockUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IDeleteUser, boolean>], WithCallback<IDeleteUser, boolean>, string, never, never>;
128
128
  resendActivationLink: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IResendActivationLink, boolean>], WithCallback<IResendActivationLink, boolean>, string, never, never>;
129
129
  resendInvitationLink: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IResendInvitationLink, boolean>], WithCallback<IResendInvitationLink, boolean>, string, never, never>;
130
+ resendInvitationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IResendInvitationEmail, boolean>], WithCallback<IResendInvitationEmail, boolean>, string, never, never>;
130
131
  resendInvitationLinkToAllSubTenants: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IResendInvitationLink, boolean>], WithCallback<IResendInvitationLink, boolean>, string, never, never>;
131
132
  getInvitationLink: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
132
133
  createInvitationLink: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<ICreateOrUpdateInviteUserLink, string>], WithCallback<ICreateOrUpdateInviteUserLink, string>, string, never, never>;
@@ -166,6 +167,7 @@ declare type DispatchedActions = {
166
167
  lockUser: (payload: WithCallback<IDeleteUser>) => void;
167
168
  resendActivationLink: (payload: WithCallback<IResendActivationLink>) => void;
168
169
  resendInvitationLink: (payload: WithCallback<IResendInvitationLink>) => void;
170
+ resendInvitationEmail: (payload: WithCallback<IResendInvitationEmail>) => void;
169
171
  resendInvitationLinkToAllSubTenants: (payload: WithCallback<IResendInvitationLink>) => void;
170
172
  getInvitationLink: () => void;
171
173
  createInvitationLink: (payload: WithCallback<ICreateOrUpdateInviteUserLink, string>) => void;
@@ -78,6 +78,9 @@ const actions = {
78
78
  resendInvitationLink: createAction(`${authStoreName}/resendInvitationLink`, payload => ({
79
79
  payload
80
80
  })),
81
+ resendInvitationEmail: createAction(`${authStoreName}/resendInvitationEmail`, payload => ({
82
+ payload
83
+ })),
81
84
  resendInvitationLinkToAllSubTenants: createAction(`${authStoreName}/resendInvitationLinkToAllSubTenants`, payload => ({
82
85
  payload
83
86
  })),
@@ -12,12 +12,14 @@ const _excluded = ["callback"],
12
12
  _excluded10 = ["callback"],
13
13
  _excluded11 = ["callback"],
14
14
  _excluded12 = ["callback"],
15
- _excluded13 = ["callback", "profileImage"],
16
- _excluded14 = ["callback"],
15
+ _excluded13 = ["callback"],
16
+ _excluded14 = ["callback", "profileImage"],
17
17
  _excluded15 = ["callback"],
18
18
  _excluded16 = ["callback"],
19
19
  _excluded17 = ["callback"],
20
- _excluded18 = ["callback"];
20
+ _excluded18 = ["callback"],
21
+ _excluded19 = ["callback"],
22
+ _excluded20 = ["callback"];
21
23
  import { takeLatest, put, call, all, takeEvery, select as sagaSelect } from 'redux-saga/effects';
22
24
  import { api } from '@frontegg/rest-api';
23
25
  import { actions } from '../reducer';
@@ -572,7 +574,7 @@ function* resendInvitationLink({
572
574
  }));
573
575
  }
574
576
 
575
- function* resendInvitationLinkToAllSubTenants({
577
+ function* resendInvitationEmail({
576
578
  payload
577
579
  }) {
578
580
  const {
@@ -585,6 +587,36 @@ function* resendInvitationLinkToAllSubTenants({
585
587
  value: body.email
586
588
  }));
587
589
 
590
+ try {
591
+ yield call(api.auth.resendInvitationEmail, body);
592
+ callback == null ? void 0 : callback(true);
593
+ } catch (e) {
594
+ yield put(actions.setTeamError({
595
+ key: TeamStateKeys.RESEND_INVITATION_LINK,
596
+ value: e.message
597
+ }));
598
+ callback == null ? void 0 : callback(null, e.message);
599
+ }
600
+
601
+ yield put(actions.setTeamLoader({
602
+ key: TeamStateKeys.RESEND_INVITATION_LINK,
603
+ value: false
604
+ }));
605
+ }
606
+
607
+ function* resendInvitationLinkToAllSubTenants({
608
+ payload
609
+ }) {
610
+ const {
611
+ callback
612
+ } = payload,
613
+ body = _objectWithoutPropertiesLoose(payload, _excluded11);
614
+
615
+ yield put(actions.setTeamLoader({
616
+ key: TeamStateKeys.RESEND_INVITATION_LINK,
617
+ value: body.email
618
+ }));
619
+
588
620
  try {
589
621
  yield call(api.teams.resendInvitationLinkToAllTenants, body);
590
622
  callback == null ? void 0 : callback(true);
@@ -807,6 +839,7 @@ export function* teamSagas() {
807
839
  yield takeEvery(actions.deleteUserFromSubTenants, deleteUserFromSubTenants);
808
840
  yield takeEvery(actions.resendActivationLink, resendActivationLink);
809
841
  yield takeEvery(actions.resendInvitationLink, resendInvitationLink);
842
+ yield takeEvery(actions.resendInvitationEmail, resendInvitationEmail);
810
843
  yield takeEvery(actions.resendInvitationLinkToAllSubTenants, resendInvitationLinkToAllSubTenants);
811
844
  yield takeEvery(actions.getInvitationLink, getInvitationLink);
812
845
  yield takeEvery(actions.createInvitationLink, createInvitationLink);
@@ -943,7 +976,7 @@ function* addUserMock({
943
976
  const {
944
977
  callback
945
978
  } = payload,
946
- body = _objectWithoutPropertiesLoose(payload, _excluded11);
979
+ body = _objectWithoutPropertiesLoose(payload, _excluded12);
947
980
 
948
981
  const teamState = yield selectTeamState();
949
982
  yield put(actions.setTeamState({
@@ -973,7 +1006,7 @@ function* addUserToSubTenantsMock({
973
1006
  const {
974
1007
  callback
975
1008
  } = payload,
976
- body = _objectWithoutPropertiesLoose(payload, _excluded12);
1009
+ body = _objectWithoutPropertiesLoose(payload, _excluded13);
977
1010
 
978
1011
  const teamState = yield selectTeamState();
979
1012
  yield put(actions.setTeamState({
@@ -1005,7 +1038,7 @@ function* updateUserMock({
1005
1038
  const {
1006
1039
  callback
1007
1040
  } = payload,
1008
- body = _objectWithoutPropertiesLoose(payload, _excluded13);
1041
+ body = _objectWithoutPropertiesLoose(payload, _excluded14);
1009
1042
 
1010
1043
  const {
1011
1044
  id: userId
@@ -1062,7 +1095,7 @@ function* deleteUserMock({
1062
1095
  const {
1063
1096
  callback
1064
1097
  } = payload,
1065
- body = _objectWithoutPropertiesLoose(payload, _excluded14);
1098
+ body = _objectWithoutPropertiesLoose(payload, _excluded15);
1066
1099
 
1067
1100
  const teamState = yield selectTeamState();
1068
1101
  yield put(actions.setTeamState({
@@ -1087,7 +1120,7 @@ function* deleteUserFromSubTenantsMock({
1087
1120
  const {
1088
1121
  callback
1089
1122
  } = payload,
1090
- body = _objectWithoutPropertiesLoose(payload, _excluded15);
1123
+ body = _objectWithoutPropertiesLoose(payload, _excluded16);
1091
1124
 
1092
1125
  const teamState = yield selectTeamState();
1093
1126
  yield put(actions.setTeamState({
@@ -1112,7 +1145,7 @@ function* resendActivationLinkMock({
1112
1145
  const {
1113
1146
  callback
1114
1147
  } = payload,
1115
- body = _objectWithoutPropertiesLoose(payload, _excluded16);
1148
+ body = _objectWithoutPropertiesLoose(payload, _excluded17);
1116
1149
 
1117
1150
  yield put(actions.setTeamLoader({
1118
1151
  key: TeamStateKeys.RESEND_ACTIVATE_LINK,
@@ -1132,7 +1165,27 @@ function* resendInvitationLinkMock({
1132
1165
  const {
1133
1166
  callback
1134
1167
  } = payload,
1135
- body = _objectWithoutPropertiesLoose(payload, _excluded17);
1168
+ body = _objectWithoutPropertiesLoose(payload, _excluded18);
1169
+
1170
+ yield put(actions.setTeamLoader({
1171
+ key: TeamStateKeys.RESEND_INVITATION_LINK,
1172
+ value: body.email
1173
+ }));
1174
+ yield delay();
1175
+ callback == null ? void 0 : callback(true);
1176
+ yield put(actions.setTeamLoader({
1177
+ key: TeamStateKeys.RESEND_INVITATION_LINK,
1178
+ value: false
1179
+ }));
1180
+ }
1181
+
1182
+ function* resendInvitationEmailMock({
1183
+ payload
1184
+ }) {
1185
+ const {
1186
+ callback
1187
+ } = payload,
1188
+ body = _objectWithoutPropertiesLoose(payload, _excluded19);
1136
1189
 
1137
1190
  yield put(actions.setTeamLoader({
1138
1191
  key: TeamStateKeys.RESEND_INVITATION_LINK,
@@ -1152,7 +1205,7 @@ function* resendInvitationLinkToAllSubTenantsMock({
1152
1205
  const {
1153
1206
  callback
1154
1207
  } = payload,
1155
- body = _objectWithoutPropertiesLoose(payload, _excluded18);
1208
+ body = _objectWithoutPropertiesLoose(payload, _excluded20);
1156
1209
 
1157
1210
  yield put(actions.setTeamLoader({
1158
1211
  key: TeamStateKeys.RESEND_INVITATION_LINK,
@@ -1177,6 +1230,7 @@ export function* teamSagasMock() {
1177
1230
  yield takeEvery(actions.deleteUserFromSubTenants, deleteUserFromSubTenantsMock);
1178
1231
  yield takeEvery(actions.resendActivationLink, resendActivationLinkMock);
1179
1232
  yield takeEvery(actions.resendInvitationLink, resendInvitationLinkMock);
1233
+ yield takeEvery(actions.resendInvitationEmail, resendInvitationEmailMock);
1180
1234
  yield takeEvery(actions.resendInvitationLinkToAllSubTenants, resendInvitationLinkToAllSubTenantsMock);
1181
1235
  yield takeEvery(actions.openAddUserDialog, openAddUserDialog);
1182
1236
  yield takeEvery(actions.closeAddUserDialog, closeAddUserDialog);
package/auth/index.d.ts CHANGED
@@ -177,6 +177,7 @@ declare const _default: {
177
177
  lockUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IDeleteUser, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IDeleteUser, boolean>, string, never, never>;
178
178
  resendActivationLink: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendActivationLink, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendActivationLink, boolean>, string, never, never>;
179
179
  resendInvitationLink: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationLink, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationLink, boolean>, string, never, never>;
180
+ resendInvitationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationEmail, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationEmail, boolean>, string, never, never>;
180
181
  resendInvitationLinkToAllSubTenants: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationLink, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationLink, boolean>, string, never, never>;
181
182
  getInvitationLink: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
182
183
  createInvitationLink: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").ICreateOrUpdateInviteUserLink, string>], import("..").WithCallback<import("@frontegg/rest-api").ICreateOrUpdateInviteUserLink, string>, string, never, never>;
@@ -315,7 +316,7 @@ declare const _default: {
315
316
  activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("./ActivateState/interfaces").IActivateAccountPayload, boolean>], import("..").WithCallback<import("./ActivateState/interfaces").IActivateAccountPayload, boolean>, string, never, never>;
316
317
  preActivateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./ActivateState/interfaces").IPreActivateAccount], import("./ActivateState/interfaces").IPreActivateAccount, string, never, never>;
317
318
  getActivateAccountStrategy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>], import("..").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>, string, never, never>;
318
- resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IResendActivationEmail], import("@frontegg/rest-api").IResendActivationEmail, string, never, never>;
319
+ resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendActivationEmail, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendActivationEmail, boolean>, string, never, never>;
319
320
  loadSocialLoginsConfiguration: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
320
321
  loadSocialLoginsConfigurationV2: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
321
322
  loginViaSocialLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./SocialLogins/interfaces").ILoginViaSocialLoginPayload], import("./SocialLogins/interfaces").ILoginViaSocialLoginPayload, string, never, never>;
package/auth/reducer.d.ts CHANGED
@@ -146,6 +146,7 @@ declare const actions: {
146
146
  lockUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IDeleteUser, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IDeleteUser, boolean>, string, never, never>;
147
147
  resendActivationLink: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendActivationLink, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendActivationLink, boolean>, string, never, never>;
148
148
  resendInvitationLink: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationLink, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationLink, boolean>, string, never, never>;
149
+ resendInvitationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationEmail, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationEmail, boolean>, string, never, never>;
149
150
  resendInvitationLinkToAllSubTenants: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationLink, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendInvitationLink, boolean>, string, never, never>;
150
151
  getInvitationLink: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
151
152
  createInvitationLink: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").ICreateOrUpdateInviteUserLink, string>], import("..").WithCallback<import("@frontegg/rest-api").ICreateOrUpdateInviteUserLink, string>, string, never, never>;
@@ -284,7 +285,7 @@ declare const actions: {
284
285
  activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import(".").IActivateAccountPayload, boolean>], import("..").WithCallback<import(".").IActivateAccountPayload, boolean>, string, never, never>;
285
286
  preActivateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").IPreActivateAccount], import(".").IPreActivateAccount, string, never, never>;
286
287
  getActivateAccountStrategy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>], import("..").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>, string, never, never>;
287
- resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IResendActivationEmail], import("@frontegg/rest-api").IResendActivationEmail, string, never, never>;
288
+ resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendActivationEmail, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendActivationEmail, boolean>, string, never, never>;
288
289
  loadSocialLoginsConfiguration: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
289
290
  loadSocialLoginsConfigurationV2: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
290
291
  loginViaSocialLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").ILoginViaSocialLoginPayload], import(".").ILoginViaSocialLoginPayload, string, never, never>;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.45.0-alpha.2
1
+ /** @license Frontegg v6.45.0-alpha.4
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -21,8 +21,11 @@ var _interfaces = require("../interfaces");
21
21
 
22
22
  var _interfaces2 = require("./interfaces");
23
23
 
24
+ var _interfaces3 = require("../TeamState/interfaces");
25
+
24
26
  const _excluded = ["callback", "events"],
25
- _excluded2 = ["callback"];
27
+ _excluded2 = ["callback"],
28
+ _excluded3 = ["callback"];
26
29
 
27
30
  function* preActivateAccount({
28
31
  payload: {
@@ -172,25 +175,42 @@ function* getActivateAccountStrategy({
172
175
  function* resendActivationEmailFunction({
173
176
  payload
174
177
  }) {
178
+ const {
179
+ callback
180
+ } = payload,
181
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded3);
182
+ yield (0, _effects.put)(_reducer.actions.setTeamLoader({
183
+ key: _interfaces3.TeamStateKeys.RESEND_ACTIVATE_LINK,
184
+ value: body.email
185
+ }));
175
186
  yield (0, _effects.put)(_reducer.actions.setActivateState({
176
187
  loading: true
177
188
  }));
178
189
 
179
190
  try {
180
- yield (0, _effects.call)(_restApi.api.auth.resendActivationEmail, {
181
- email: payload.email
182
- });
191
+ yield (0, _effects.call)(_restApi.api.auth.resendActivationEmail, body);
183
192
  yield (0, _effects.put)(_reducer.actions.setActivateState({
184
193
  loading: false,
185
194
  error: undefined,
186
195
  resentEmail: true
187
196
  }));
197
+ callback == null ? void 0 : callback(true);
188
198
  } catch (e) {
189
199
  yield (0, _effects.put)(_reducer.actions.setActivateState({
190
200
  loading: false,
191
201
  error: e.message
192
202
  }));
203
+ yield (0, _effects.put)(_reducer.actions.setTeamError({
204
+ key: _interfaces3.TeamStateKeys.RESEND_ACTIVATE_LINK,
205
+ value: e.message
206
+ }));
207
+ callback == null ? void 0 : callback(null, e.message);
193
208
  }
209
+
210
+ yield (0, _effects.put)(_reducer.actions.setTeamLoader({
211
+ key: _interfaces3.TeamStateKeys.RESEND_ACTIVATE_LINK,
212
+ value: false
213
+ }));
194
214
  }
195
215
 
196
216
  function* activateSagas() {
@@ -90,6 +90,9 @@ const actions = {
90
90
  resendInvitationLink: (0, _toolkit.createAction)(`${_constants.authStoreName}/resendInvitationLink`, payload => ({
91
91
  payload
92
92
  })),
93
+ resendInvitationEmail: (0, _toolkit.createAction)(`${_constants.authStoreName}/resendInvitationEmail`, payload => ({
94
+ payload
95
+ })),
93
96
  resendInvitationLinkToAllSubTenants: (0, _toolkit.createAction)(`${_constants.authStoreName}/resendInvitationLinkToAllSubTenants`, payload => ({
94
97
  payload
95
98
  })),
@@ -40,12 +40,14 @@ const _excluded = ["callback"],
40
40
  _excluded10 = ["callback"],
41
41
  _excluded11 = ["callback"],
42
42
  _excluded12 = ["callback"],
43
- _excluded13 = ["callback", "profileImage"],
44
- _excluded14 = ["callback"],
43
+ _excluded13 = ["callback"],
44
+ _excluded14 = ["callback", "profileImage"],
45
45
  _excluded15 = ["callback"],
46
46
  _excluded16 = ["callback"],
47
47
  _excluded17 = ["callback"],
48
- _excluded18 = ["callback"];
48
+ _excluded18 = ["callback"],
49
+ _excluded19 = ["callback"],
50
+ _excluded20 = ["callback"];
49
51
 
50
52
  const selectTeamState = () => (0, _effects.select)(_ => _[_constants.authStoreName].teamState); // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
53
 
@@ -580,7 +582,7 @@ function* resendInvitationLink({
580
582
  }));
581
583
  }
582
584
 
583
- function* resendInvitationLinkToAllSubTenants({
585
+ function* resendInvitationEmail({
584
586
  payload
585
587
  }) {
586
588
  const {
@@ -592,6 +594,35 @@ function* resendInvitationLinkToAllSubTenants({
592
594
  value: body.email
593
595
  }));
594
596
 
597
+ try {
598
+ yield (0, _effects.call)(_restApi.api.auth.resendInvitationEmail, body);
599
+ callback == null ? void 0 : callback(true);
600
+ } catch (e) {
601
+ yield (0, _effects.put)(_reducer.actions.setTeamError({
602
+ key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
603
+ value: e.message
604
+ }));
605
+ callback == null ? void 0 : callback(null, e.message);
606
+ }
607
+
608
+ yield (0, _effects.put)(_reducer.actions.setTeamLoader({
609
+ key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
610
+ value: false
611
+ }));
612
+ }
613
+
614
+ function* resendInvitationLinkToAllSubTenants({
615
+ payload
616
+ }) {
617
+ const {
618
+ callback
619
+ } = payload,
620
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded11);
621
+ yield (0, _effects.put)(_reducer.actions.setTeamLoader({
622
+ key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
623
+ value: body.email
624
+ }));
625
+
595
626
  try {
596
627
  yield (0, _effects.call)(_restApi.api.teams.resendInvitationLinkToAllTenants, body);
597
628
  callback == null ? void 0 : callback(true);
@@ -814,6 +845,7 @@ function* teamSagas() {
814
845
  yield (0, _effects.takeEvery)(_reducer.actions.deleteUserFromSubTenants, deleteUserFromSubTenants);
815
846
  yield (0, _effects.takeEvery)(_reducer.actions.resendActivationLink, resendActivationLink);
816
847
  yield (0, _effects.takeEvery)(_reducer.actions.resendInvitationLink, resendInvitationLink);
848
+ yield (0, _effects.takeEvery)(_reducer.actions.resendInvitationEmail, resendInvitationEmail);
817
849
  yield (0, _effects.takeEvery)(_reducer.actions.resendInvitationLinkToAllSubTenants, resendInvitationLinkToAllSubTenants);
818
850
  yield (0, _effects.takeEvery)(_reducer.actions.getInvitationLink, getInvitationLink);
819
851
  yield (0, _effects.takeEvery)(_reducer.actions.createInvitationLink, createInvitationLink);
@@ -951,7 +983,7 @@ function* addUserMock({
951
983
  const {
952
984
  callback
953
985
  } = payload,
954
- body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded11);
986
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded12);
955
987
  const teamState = yield selectTeamState();
956
988
  yield (0, _effects.put)(_reducer.actions.setTeamState({
957
989
  addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
@@ -978,7 +1010,7 @@ function* addUserToSubTenantsMock({
978
1010
  const {
979
1011
  callback
980
1012
  } = payload,
981
- body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded12);
1013
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded13);
982
1014
  const teamState = yield selectTeamState();
983
1015
  yield (0, _effects.put)(_reducer.actions.setTeamState({
984
1016
  addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
@@ -1007,7 +1039,7 @@ function* updateUserMock({
1007
1039
  const {
1008
1040
  callback
1009
1041
  } = payload,
1010
- body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded13);
1042
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded14);
1011
1043
  const {
1012
1044
  id: userId
1013
1045
  } = body;
@@ -1061,7 +1093,7 @@ function* deleteUserMock({
1061
1093
  const {
1062
1094
  callback
1063
1095
  } = payload,
1064
- body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded14);
1096
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded15);
1065
1097
  const teamState = yield selectTeamState();
1066
1098
  yield (0, _effects.put)(_reducer.actions.setTeamState({
1067
1099
  deleteUserDialogState: (0, _extends2.default)({}, teamState.deleteUserDialogState, {
@@ -1085,7 +1117,7 @@ function* deleteUserFromSubTenantsMock({
1085
1117
  const {
1086
1118
  callback
1087
1119
  } = payload,
1088
- body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded15);
1120
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded16);
1089
1121
  const teamState = yield selectTeamState();
1090
1122
  yield (0, _effects.put)(_reducer.actions.setTeamState({
1091
1123
  deleteUserDialogState: (0, _extends2.default)({}, teamState.deleteUserDialogState, {
@@ -1109,7 +1141,7 @@ function* resendActivationLinkMock({
1109
1141
  const {
1110
1142
  callback
1111
1143
  } = payload,
1112
- body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded16);
1144
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded17);
1113
1145
  yield (0, _effects.put)(_reducer.actions.setTeamLoader({
1114
1146
  key: _interfaces.TeamStateKeys.RESEND_ACTIVATE_LINK,
1115
1147
  value: body.userId
@@ -1128,7 +1160,26 @@ function* resendInvitationLinkMock({
1128
1160
  const {
1129
1161
  callback
1130
1162
  } = payload,
1131
- body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded17);
1163
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded18);
1164
+ yield (0, _effects.put)(_reducer.actions.setTeamLoader({
1165
+ key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
1166
+ value: body.email
1167
+ }));
1168
+ yield (0, _utils.delay)();
1169
+ callback == null ? void 0 : callback(true);
1170
+ yield (0, _effects.put)(_reducer.actions.setTeamLoader({
1171
+ key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
1172
+ value: false
1173
+ }));
1174
+ }
1175
+
1176
+ function* resendInvitationEmailMock({
1177
+ payload
1178
+ }) {
1179
+ const {
1180
+ callback
1181
+ } = payload,
1182
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded19);
1132
1183
  yield (0, _effects.put)(_reducer.actions.setTeamLoader({
1133
1184
  key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
1134
1185
  value: body.email
@@ -1147,7 +1198,7 @@ function* resendInvitationLinkToAllSubTenantsMock({
1147
1198
  const {
1148
1199
  callback
1149
1200
  } = payload,
1150
- body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded18);
1201
+ body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded20);
1151
1202
  yield (0, _effects.put)(_reducer.actions.setTeamLoader({
1152
1203
  key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
1153
1204
  value: body.email
@@ -1171,6 +1222,7 @@ function* teamSagasMock() {
1171
1222
  yield (0, _effects.takeEvery)(_reducer.actions.deleteUserFromSubTenants, deleteUserFromSubTenantsMock);
1172
1223
  yield (0, _effects.takeEvery)(_reducer.actions.resendActivationLink, resendActivationLinkMock);
1173
1224
  yield (0, _effects.takeEvery)(_reducer.actions.resendInvitationLink, resendInvitationLinkMock);
1225
+ yield (0, _effects.takeEvery)(_reducer.actions.resendInvitationEmail, resendInvitationEmailMock);
1174
1226
  yield (0, _effects.takeEvery)(_reducer.actions.resendInvitationLinkToAllSubTenants, resendInvitationLinkToAllSubTenantsMock);
1175
1227
  yield (0, _effects.takeEvery)(_reducer.actions.openAddUserDialog, openAddUserDialog);
1176
1228
  yield (0, _effects.takeEvery)(_reducer.actions.closeAddUserDialog, closeAddUserDialog);
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.45.0-alpha.2
1
+ /** @license Frontegg v6.45.0-alpha.4
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "6.45.0-alpha.2",
3
+ "version": "6.45.0-alpha.4",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",