@frontegg/redux-store 6.185.0-alpha.3 → 6.186.0-alpha.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 (63) hide show
  1. package/auth/AcceptInvitationState/index.d.ts +2 -0
  2. package/auth/AccountSettingsState/index.d.ts +2 -0
  3. package/auth/ActivateState/index.d.ts +3 -0
  4. package/auth/ApiTokensState/index.d.ts +2 -0
  5. package/auth/ApplicationsState/index.d.ts +83 -0
  6. package/auth/ApplicationsState/index.js +36 -0
  7. package/auth/ApplicationsState/interfaces.d.ts +12 -0
  8. package/auth/ApplicationsState/interfaces.js +1 -0
  9. package/auth/ApplicationsState/saga.d.ts +48 -0
  10. package/auth/ApplicationsState/saga.js +250 -0
  11. package/auth/ApplicationsState/utils/getFlattenAppIds.d.ts +3 -0
  12. package/auth/ApplicationsState/utils/getFlattenAppIds.js +13 -0
  13. package/auth/CustomLoginState/index.d.ts +2 -0
  14. package/auth/ForgotPasswordState/index.d.ts +2 -0
  15. package/auth/GroupsState/groupsDialogsState.d.ts +12 -0
  16. package/auth/GroupsState/index.d.ts +2 -0
  17. package/auth/ImpersonationState/index.d.ts +2 -0
  18. package/auth/LoginState/index.d.ts +2 -0
  19. package/auth/LoginState/saga.js +1 -1
  20. package/auth/MSP/AllAccountsState/allAccountsDialogsState.d.ts +14 -0
  21. package/auth/MSP/AllAccountsState/index.d.ts +3 -0
  22. package/auth/MfaState/index.d.ts +2 -0
  23. package/auth/PasskeysState/index.d.ts +2 -0
  24. package/auth/ProfileState/index.d.ts +2 -0
  25. package/auth/Provisioning/index.d.ts +2 -0
  26. package/auth/ResetPhoneNumberState/index.d.ts +2 -0
  27. package/auth/RolesState/index.d.ts +2 -0
  28. package/auth/SSOState/index.d.ts +2 -0
  29. package/auth/Security/RestrictionsState/index.d.ts +3 -0
  30. package/auth/Security/SecurityCenterState/index.d.ts +2 -0
  31. package/auth/Security/SecurityPolicyState/index.d.ts +13 -0
  32. package/auth/Security/SessionsPolicyState/index.d.ts +2 -0
  33. package/auth/SessionsState/index.d.ts +2 -0
  34. package/auth/SignUp/index.d.ts +2 -0
  35. package/auth/SmsState/index.d.ts +2 -0
  36. package/auth/SocialLogins/index.d.ts +2 -0
  37. package/auth/StepUpState/index.d.ts +2 -0
  38. package/auth/TeamState/index.d.ts +6 -4
  39. package/auth/TeamState/interfaces.d.ts +7 -1
  40. package/auth/TeamState/saga.js +21 -6
  41. package/auth/TenantsState/index.d.ts +2 -0
  42. package/auth/index.d.ts +9 -2
  43. package/auth/index.js +2 -0
  44. package/auth/initialState.js +2 -0
  45. package/auth/interfaces.d.ts +2 -0
  46. package/auth/reducer.d.ts +9 -3
  47. package/auth/reducer.js +3 -2
  48. package/auth/saga.js +2 -1
  49. package/auth/utils.d.ts +6 -0
  50. package/index.js +1 -1
  51. package/node/auth/ApplicationsState/index.js +43 -0
  52. package/node/auth/ApplicationsState/interfaces.js +5 -0
  53. package/node/auth/ApplicationsState/saga.js +264 -0
  54. package/node/auth/ApplicationsState/utils/getFlattenAppIds.js +20 -0
  55. package/node/auth/LoginState/saga.js +1 -1
  56. package/node/auth/TeamState/saga.js +21 -6
  57. package/node/auth/index.js +24 -0
  58. package/node/auth/initialState.js +2 -0
  59. package/node/auth/reducer.js +3 -2
  60. package/node/auth/saga.js +2 -1
  61. package/node/index.js +1 -1
  62. package/package.json +2 -2
  63. package/toolkit/index.d.ts +1 -1
@@ -587,7 +587,7 @@ function* requestHostedLoginAuthorize(additionalParams) {
587
587
  const oauthUrl = `${baseUrl}/oauth/authorize`;
588
588
  const params = (0, _extends2.default)({
589
589
  response_type: 'code',
590
- client_id: context.clientId || 'INVALID-CLIENT-ID',
590
+ client_id: context.appId || context.clientId || 'INVALID-CLIENT-ID',
591
591
  scope: 'openid email profile',
592
592
  redirect_uri: redirectUrl,
593
593
  code_challenge: code_challenge,
@@ -18,7 +18,8 @@ var _dummy = require("../dummy");
18
18
  var _uuid = require("uuid");
19
19
  var _interfaces2 = require("../GroupsState/interfaces");
20
20
  var _utils2 = require("../../utils");
21
- const _excluded = ["callback"],
21
+ var _saga = require("../ApplicationsState/saga");
22
+ const _excluded = ["callback", "appIds"],
22
23
  _excluded2 = ["roles"],
23
24
  _excluded3 = ["callback"],
24
25
  _excluded4 = ["callback", "profileImage"],
@@ -63,7 +64,8 @@ function* loadUsersV2({
63
64
  var _payload$pageSize, _payload$pageOffset, _payload$filter, _payload$sort, _payload$shouldShowSu;
64
65
  const {
65
66
  silentLoading,
66
- callback
67
+ callback,
68
+ shouldLoadApps
67
69
  } = payload;
68
70
  const teamState = yield selectTeamState();
69
71
  const pageSize = (_payload$pageSize = payload.pageSize) != null ? _payload$pageSize : teamState.pageSize;
@@ -112,10 +114,15 @@ function* loadUsersV2({
112
114
  groups: userGroupsFullData
113
115
  });
114
116
  });
117
+ const userWithRoleIds = usersWithGroups.map(user => (0, _extends2.default)({}, user, {
118
+ roleIds: user.roles.map(role => role.id)
119
+ }));
120
+ const mappedUsers = yield (0, _effects.call)(_saga.mapUsersWithApplicationData, {
121
+ shouldLoadApps,
122
+ users: userWithRoleIds
123
+ });
115
124
  yield (0, _effects.put)(_reducer.actions.setTeamState({
116
- users: usersWithGroups.map(user => (0, _extends2.default)({}, user, {
117
- roleIds: user.roles.map(role => role.id)
118
- })),
125
+ users: mappedUsers,
119
126
  totalPages,
120
127
  totalItems,
121
128
  roles,
@@ -307,7 +314,8 @@ function* addUser({
307
314
  payload
308
315
  }) {
309
316
  const {
310
- callback
317
+ callback,
318
+ appIds
311
319
  } = payload,
312
320
  body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded);
313
321
  const teamState = yield selectTeamState();
@@ -327,6 +335,13 @@ function* addUser({
327
335
  const newUser = (0, _extends2.default)({}, userWithoutRoleIds, {
328
336
  roleIds
329
337
  });
338
+ const apps = yield (0, _effects.call)(_saga.assignNewUserToApps, {
339
+ appIds,
340
+ user: newUser
341
+ });
342
+ if (apps) {
343
+ newUser.applications = apps;
344
+ }
330
345
  callback == null ? void 0 : callback(newUser);
331
346
  yield (0, _effects.put)(_reducer.actions.setTeamState({
332
347
  users: [newUser, ...teamState.users],
@@ -760,6 +760,30 @@ Object.keys(_interfaces29).forEach(function (key) {
760
760
  }
761
761
  });
762
762
  });
763
+ var _ApplicationsState = require("./ApplicationsState");
764
+ Object.keys(_ApplicationsState).forEach(function (key) {
765
+ if (key === "default" || key === "__esModule") return;
766
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
767
+ if (key in exports && exports[key] === _ApplicationsState[key]) return;
768
+ Object.defineProperty(exports, key, {
769
+ enumerable: true,
770
+ get: function () {
771
+ return _ApplicationsState[key];
772
+ }
773
+ });
774
+ });
775
+ var _interfaces30 = require("./ApplicationsState/interfaces");
776
+ Object.keys(_interfaces30).forEach(function (key) {
777
+ if (key === "default" || key === "__esModule") return;
778
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
779
+ if (key in exports && exports[key] === _interfaces30[key]) return;
780
+ Object.defineProperty(exports, key, {
781
+ enumerable: true,
782
+ get: function () {
783
+ return _interfaces30[key];
784
+ }
785
+ });
786
+ });
763
787
  var _AllAccountsState = require("./MSP/AllAccountsState");
764
788
  Object.keys(_AllAccountsState).forEach(function (key) {
765
789
  if (key === "default" || key === "__esModule") return;
@@ -36,6 +36,7 @@ var _SecurityCenterState = require("./Security/SecurityCenterState");
36
36
  var _consts = require("./LoginState/consts");
37
37
  var _SmsState = require("./SmsState");
38
38
  var _StepUpState = require("./StepUpState");
39
+ var _ApplicationsState = require("./ApplicationsState");
39
40
  const reinitializeState = {
40
41
  isAuthenticated: false,
41
42
  isLoading: true,
@@ -50,6 +51,7 @@ const reinitializeState = {
50
51
  ssoState: _SSOState.ssoState,
51
52
  profileState: _ProfileState.profileState,
52
53
  customLoginState: _CustomLoginState.customLoginState,
54
+ applicationsState: _ApplicationsState.applicationsState,
53
55
  mfaState: _MfaState.mfaState,
54
56
  teamState: _TeamState.teamState,
55
57
  groupsState: _GroupsState.groupsState,
@@ -40,6 +40,7 @@ var _AllAccountsState = require("./MSP/AllAccountsState");
40
40
  var _allAccountsDialogsState = require("./MSP/AllAccountsState/allAccountsDialogsState");
41
41
  var _SecurityCenterState = require("./Security/SecurityCenterState");
42
42
  var _SmsState = require("./SmsState");
43
+ var _ApplicationsState = require("./ApplicationsState");
43
44
  const {
44
45
  reducer,
45
46
  actions: sliceActions
@@ -53,12 +54,12 @@ const {
53
54
  }) => (0, _extends2.default)({}, state, payload),
54
55
  setUser: (0, _utils.typeReducer)('user'),
55
56
  setEntitlements: (0, _utils.typeReducerNestedKey)('user', 'entitlements')
56
- }, _LoginState.loginReducers, _StepUpState.stepUpReducers, _SocialLogins.socialLoginsReducer, _ActivateState.activateAccountReducers, _ImpersonationState.impersonateReducers, _AcceptInvitationState.acceptInvitationReducers, _ForgotPasswordState.forgotPasswordReducers, _ResetPhoneNumberState.resetPhoneNumberReducers, _SignUp.signUpReducers, _ProfileState.profileReducers, _CustomLoginState.customLoginReducers, _SSOState.ssoReducers, _MfaState.mfaReducers, _TeamState.teamReducers, _GroupsState.groupsReducers, _groupsDialogsState.groupsDialogsReducers, _ApiTokensState.apiTokensReducers, _SecurityPolicyState.securityPolicyReducers, _AccountSettingsState.accountSettingsReducers, _TenantsState.tenantsReducers, _RolesState.rolesReducers, _SessionsState.sessionsReducers, _SessionsPolicyState.sessionsPolicyReducers, _RestrictionsState.restrictionsReducers, _Provisioning.provisioningReducers, _PasskeysState.passkeysReducers, _AllAccountsState.allAccountsReducers, _allAccountsDialogsState.allAccountsDialogsReducers, _SecurityCenterState.securityCenterReducers, _SmsState.smsReducers)
57
+ }, _LoginState.loginReducers, _StepUpState.stepUpReducers, _SocialLogins.socialLoginsReducer, _ActivateState.activateAccountReducers, _ImpersonationState.impersonateReducers, _AcceptInvitationState.acceptInvitationReducers, _ForgotPasswordState.forgotPasswordReducers, _ResetPhoneNumberState.resetPhoneNumberReducers, _SignUp.signUpReducers, _ProfileState.profileReducers, _ApplicationsState.applicationsReducers, _CustomLoginState.customLoginReducers, _SSOState.ssoReducers, _MfaState.mfaReducers, _TeamState.teamReducers, _GroupsState.groupsReducers, _groupsDialogsState.groupsDialogsReducers, _ApiTokensState.apiTokensReducers, _SecurityPolicyState.securityPolicyReducers, _AccountSettingsState.accountSettingsReducers, _TenantsState.tenantsReducers, _RolesState.rolesReducers, _SessionsState.sessionsReducers, _SessionsPolicyState.sessionsPolicyReducers, _RestrictionsState.restrictionsReducers, _Provisioning.provisioningReducers, _PasskeysState.passkeysReducers, _AllAccountsState.allAccountsReducers, _allAccountsDialogsState.allAccountsDialogsReducers, _SecurityCenterState.securityCenterReducers, _SmsState.smsReducers)
57
58
  });
58
59
  exports.reducer = reducer;
59
60
  const actions = (0, _extends2.default)({
60
61
  loadEntitlements: (0, _toolkit.createAction)(`${_constants.authStoreName}/loadEntitlements`, payload => ({
61
62
  payload
62
63
  }))
63
- }, sliceActions, _LoginState.loginActions, _StepUpState.stepUpActions, _SocialLogins.socialLoginsActions, _ActivateState.activateAccountActions, _AcceptInvitationState.acceptInvitationActions, _ForgotPasswordState.forgotPasswordActions, _ResetPhoneNumberState.resetPhoneNumberActions, _SignUp.signUpActions, _ProfileState.profileActions, _CustomLoginState.customLoginActions, _SSOState.ssoActions, _MfaState.mfaActions, _TeamState.teamActions, _GroupsState.groupsActions, _groupsDialogsState.groupsDialogsActions, _ApiTokensState.apiTokensActions, _SecurityPolicyState.securityPolicyActions, _AccountSettingsState.accountSettingsActions, _TenantsState.tenantsActions, _RolesState.rolesActions, _SessionsState.sessionsActions, _SessionsPolicyState.sessionsPolicyActions, _RestrictionsState.restrictionsActions, _Provisioning.provisioningActions, _ImpersonationState.impersonateActions, _PasskeysState.passkeysActions, _AllAccountsState.allAccountsActions, _SecurityCenterState.securityCenterActions, _SmsState.smsActions);
64
+ }, sliceActions, _LoginState.loginActions, _StepUpState.stepUpActions, _SocialLogins.socialLoginsActions, _ActivateState.activateAccountActions, _AcceptInvitationState.acceptInvitationActions, _ForgotPasswordState.forgotPasswordActions, _ResetPhoneNumberState.resetPhoneNumberActions, _SignUp.signUpActions, _ProfileState.profileActions, _CustomLoginState.customLoginActions, _ApplicationsState.applicationsActions, _SSOState.ssoActions, _MfaState.mfaActions, _TeamState.teamActions, _GroupsState.groupsActions, _groupsDialogsState.groupsDialogsActions, _ApiTokensState.apiTokensActions, _SecurityPolicyState.securityPolicyActions, _AccountSettingsState.accountSettingsActions, _TenantsState.tenantsActions, _RolesState.rolesActions, _SessionsState.sessionsActions, _SessionsPolicyState.sessionsPolicyActions, _RestrictionsState.restrictionsActions, _Provisioning.provisioningActions, _ImpersonationState.impersonateActions, _PasskeysState.passkeysActions, _AllAccountsState.allAccountsActions, _SecurityCenterState.securityCenterActions, _SmsState.smsActions);
64
65
  exports.actions = actions;
package/node/auth/saga.js CHANGED
@@ -36,8 +36,9 @@ var _saga27 = require("./Entitlements/saga");
36
36
  var _saga28 = require("./Security/SecurityCenterState/saga");
37
37
  var _saga29 = require("./SmsState/saga");
38
38
  var _saga30 = require("./StepUpState/saga");
39
+ var _saga31 = require("./ApplicationsState/saga");
39
40
  function* sagas() {
40
- yield (0, _effects.all)([(0, _effects.call)(_saga8.loginSagas), (0, _effects.call)(_saga30.stepUpSagas), (0, _effects.call)(_saga6.activateSagas), (0, _effects.call)(_saga7.acceptInvitationSagas), (0, _effects.call)(_saga5.forgotPasswordSagas), (0, _effects.call)(_saga17.resetPhoneNumberSagas), (0, _effects.call)(_saga.ssoSagas), (0, _effects.call)(_saga2.ssoSagas), (0, _effects.call)(_saga3.profileSagas), (0, _effects.call)(_saga25.customLoginSagas), (0, _effects.call)(_saga4.mfaSagas), (0, _effects.call)(_saga9.teamSagas), (0, _effects.call)(_saga24.groupsSagas), (0, _effects.call)(_saga10.socialLoginsSaga), (0, _effects.call)(_saga11.signUpSaga), (0, _effects.call)(_saga12.apiTokensSaga), (0, _effects.call)(_saga13.securityPolicySagas), (0, _effects.call)(_saga14.accountSettingsSaga), (0, _effects.call)(_saga15.tenantsSagas), (0, _effects.call)(_saga16.rolesSagas), (0, _effects.call)(_saga18.sessionsSaga), (0, _effects.call)(_saga19.sessionsPolicySaga), (0, _effects.call)(_saga20.restrictionsSagas), (0, _effects.call)(_saga21.provisionSagas), (0, _effects.call)(_saga22.impersonateSagas), (0, _effects.call)(_saga23.passkeysSagas), (0, _effects.call)(_saga26.allAccountsSagas), (0, _effects.call)(_saga27.entitlementsSagas), (0, _effects.call)(_saga28.securityCenterSagas), (0, _effects.call)(_saga29.smsSagas)]);
41
+ yield (0, _effects.all)([(0, _effects.call)(_saga8.loginSagas), (0, _effects.call)(_saga30.stepUpSagas), (0, _effects.call)(_saga6.activateSagas), (0, _effects.call)(_saga7.acceptInvitationSagas), (0, _effects.call)(_saga5.forgotPasswordSagas), (0, _effects.call)(_saga17.resetPhoneNumberSagas), (0, _effects.call)(_saga.ssoSagas), (0, _effects.call)(_saga2.ssoSagas), (0, _effects.call)(_saga3.profileSagas), (0, _effects.call)(_saga25.customLoginSagas), (0, _effects.call)(_saga4.mfaSagas), (0, _effects.call)(_saga9.teamSagas), (0, _effects.call)(_saga24.groupsSagas), (0, _effects.call)(_saga10.socialLoginsSaga), (0, _effects.call)(_saga11.signUpSaga), (0, _effects.call)(_saga12.apiTokensSaga), (0, _effects.call)(_saga13.securityPolicySagas), (0, _effects.call)(_saga14.accountSettingsSaga), (0, _effects.call)(_saga15.tenantsSagas), (0, _effects.call)(_saga16.rolesSagas), (0, _effects.call)(_saga18.sessionsSaga), (0, _effects.call)(_saga19.sessionsPolicySaga), (0, _effects.call)(_saga20.restrictionsSagas), (0, _effects.call)(_saga21.provisionSagas), (0, _effects.call)(_saga22.impersonateSagas), (0, _effects.call)(_saga23.passkeysSagas), (0, _effects.call)(_saga26.allAccountsSagas), (0, _effects.call)(_saga27.entitlementsSagas), (0, _effects.call)(_saga28.securityCenterSagas), (0, _effects.call)(_saga29.smsSagas), (0, _effects.call)(_saga31.applicationsSaga)]);
41
42
  }
42
43
  function* mockSagas() {
43
44
  yield (0, _effects.all)([(0, _effects.call)(_saga8.loginSagasMock),
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.185.0-alpha.3
1
+ /** @license Frontegg v6.186.0-alpha.0
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,13 +1,13 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "6.185.0-alpha.3",
3
+ "version": "6.186.0-alpha.0",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
7
7
  "dependencies": {
8
8
  "@babel/runtime": "^7.18.6",
9
9
  "@frontegg/entitlements-javascript-commons": "1.1.2",
10
- "@frontegg/rest-api": "3.1.68",
10
+ "@frontegg/rest-api": "3.1.69",
11
11
  "@reduxjs/toolkit": "1.8.5",
12
12
  "fast-deep-equal": "3.1.3",
13
13
  "redux-saga": "^1.2.1",
@@ -13,7 +13,7 @@ declare type InitialState = {
13
13
  export { bindActionCreators } from '@reduxjs/toolkit';
14
14
  export type { CaseReducerActions, SliceCaseReducers } from '@reduxjs/toolkit';
15
15
  export type { RootState } from './interfaces';
16
- export declare const createFronteggStore: (rootInitialState: InitialState, storeHolder?: any, previewMode?: boolean, authInitialState?: (Partial<Pick<AuthState, "user" | "error" | "isLoading" | "onRedirectTo" | "isAuthenticated" | "userIp" | "keepSessionAlive" | "socialLoginOptions" | "isSSOAuth" | "ssoACS" | "includeQueryParam" | "loginState" | "activateState" | "acceptInvitationState" | "forgotPasswordState" | "resetPhoneNumberState" | "ssoState" | "profileState" | "mfaState" | "teamState" | "groupsState" | "groupsDialogsState" | "socialLoginState" | "signUpState" | "apiTokensState" | "securityPolicyState" | "restrictionsState" | "provisioningState" | "accountSettingsState" | "tenantsState" | "rolesState" | "sessionsState" | "hostedLoginBox" | "disableSilentRefresh" | "sessionsPolicyState" | "impersonateState" | "passkeysState" | "customLoginState" | "allAccountsState" | "allAccountsDialogsState" | "securityCenterState" | "smsState" | "stepUpState" | "header" | "loaderComponent">> & {
16
+ export declare const createFronteggStore: (rootInitialState: InitialState, storeHolder?: any, previewMode?: boolean, authInitialState?: (Partial<Pick<AuthState, "user" | "error" | "isLoading" | "onRedirectTo" | "isAuthenticated" | "userIp" | "keepSessionAlive" | "socialLoginOptions" | "isSSOAuth" | "ssoACS" | "includeQueryParam" | "loginState" | "activateState" | "acceptInvitationState" | "forgotPasswordState" | "resetPhoneNumberState" | "ssoState" | "profileState" | "mfaState" | "teamState" | "groupsState" | "groupsDialogsState" | "socialLoginState" | "signUpState" | "apiTokensState" | "securityPolicyState" | "restrictionsState" | "provisioningState" | "accountSettingsState" | "tenantsState" | "rolesState" | "sessionsState" | "hostedLoginBox" | "disableSilentRefresh" | "sessionsPolicyState" | "impersonateState" | "passkeysState" | "customLoginState" | "allAccountsState" | "allAccountsDialogsState" | "securityCenterState" | "smsState" | "stepUpState" | "applicationsState" | "header" | "loaderComponent">> & {
17
17
  routes?: Partial<AuthPageRoutes> | undefined;
18
18
  }) | undefined, overrideInitialState?: Partial<{
19
19
  auth: Partial<Omit<AuthState, 'routes'>> & {