@frontegg/redux-store 5.65.0 → 5.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/SessionsState/saga.d.ts +1 -0
- package/auth/dummy.d.ts +2 -0
- package/auth/index.js +51 -0
- package/node/auth/index.js +1 -1
- package/node/{index-26641dee.js → index-7cc852ed.js} +51 -0
- package/node/index.js +1 -1
- package/node/toolkit/index.js +1 -1
- package/package.json +1 -1
package/auth/dummy.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { IRole, IRolePermission, ISamlConfiguration, ISamlMetadata, ISecurityPol
|
|
|
2
2
|
import { IApiTokensData, ITenantApiTokensData } from './ApiTokensState/interfaces';
|
|
3
3
|
import { User } from './interfaces';
|
|
4
4
|
import { ProfileState } from './ProfileState/interfaces';
|
|
5
|
+
import { ISession } from './SessionsState/interfaces';
|
|
5
6
|
import { SSOState } from './SSOState/interfaces';
|
|
6
7
|
export declare const apiTokensDataDemo: IApiTokensData;
|
|
7
8
|
export declare const apiTokensDataTenantDemo: ITenantApiTokensData;
|
|
@@ -26,3 +27,4 @@ export declare const userSubTenantDemo: ISubTenantUser;
|
|
|
26
27
|
export declare const usersDemo: ITeamUser[];
|
|
27
28
|
export declare const allUsersDemo: ISubTenantUser[];
|
|
28
29
|
export declare const tenantsDemo: ITenantsResponse[];
|
|
30
|
+
export declare const sessionsMock: ISession[];
|
package/auth/index.js
CHANGED
|
@@ -965,6 +965,33 @@ const tenantsDemo = [
|
|
|
965
965
|
currency: undefined,
|
|
966
966
|
logo: undefined,
|
|
967
967
|
},
|
|
968
|
+
];
|
|
969
|
+
const sessionsMock = [
|
|
970
|
+
{
|
|
971
|
+
id: `laptop`,
|
|
972
|
+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",
|
|
973
|
+
createdAt: new Date(),
|
|
974
|
+
ipAddress: "190.194.88.251",
|
|
975
|
+
current: true,
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
id: `iphone`,
|
|
979
|
+
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Mobile/15E148 Safari/604.1",
|
|
980
|
+
createdAt: new Date(Date.now() - 10000),
|
|
981
|
+
ipAddress: "191.49.203.21",
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
id: `tablet`,
|
|
985
|
+
userAgent: "Mozilla/5.0 (Linux; Android 6.0.1; SGP771 Build/32.2.A.0.253; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36",
|
|
986
|
+
createdAt: new Date(Date.now() - 30000),
|
|
987
|
+
ipAddress: "130.19.196.136",
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
id: `anotherlaptop`,
|
|
991
|
+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",
|
|
992
|
+
createdAt: new Date(Date.now() - 1002232300),
|
|
993
|
+
ipAddress: "2.228.163.92",
|
|
994
|
+
}
|
|
968
995
|
];
|
|
969
996
|
|
|
970
997
|
var UserVeirifedOriginTypes;
|
|
@@ -4153,6 +4180,29 @@ function* sessionsSaga() {
|
|
|
4153
4180
|
yield takeLatest(actions.loadUserSessions, loadCurrentUserSessions);
|
|
4154
4181
|
yield takeLatest(actions.deleteUserSession, deleteUserSession);
|
|
4155
4182
|
yield takeLatest(actions.deleteAllUserSessions, deleteAllUserSessions);
|
|
4183
|
+
}
|
|
4184
|
+
/*********************************
|
|
4185
|
+
* Preview Sagas
|
|
4186
|
+
*********************************/
|
|
4187
|
+
function* loadCurrentUserSessionsMock() {
|
|
4188
|
+
yield put(actions.setSessionsState({ loading: true, error: null }));
|
|
4189
|
+
yield put(actions.setSessionsState({ sessions: sessionsMock, loading: false }));
|
|
4190
|
+
}
|
|
4191
|
+
function* deleteUserSessionMock({ payload: { id } }) {
|
|
4192
|
+
yield put(actions.setSessionsState({ loading: true, error: null }));
|
|
4193
|
+
const currentSessions = yield select((state) => { var _a; return (_a = state.auth.sessionsState.sessions) !== null && _a !== void 0 ? _a : []; });
|
|
4194
|
+
const newSessions = currentSessions.filter(s => s.id !== id);
|
|
4195
|
+
yield put(actions.setSessionsState({ sessions: newSessions, loading: false }));
|
|
4196
|
+
}
|
|
4197
|
+
function* deleteAllUserSessionsMock() {
|
|
4198
|
+
yield put(actions.setSessionsState({ loading: true, error: null }));
|
|
4199
|
+
const newSessions = sessionsMock.filter(s => s.current);
|
|
4200
|
+
yield put(actions.setSessionsState({ sessions: newSessions, loading: false }));
|
|
4201
|
+
}
|
|
4202
|
+
function* sessionsSagaMock() {
|
|
4203
|
+
yield takeLatest(actions.loadUserSessions, loadCurrentUserSessionsMock);
|
|
4204
|
+
yield takeLatest(actions.deleteUserSession, deleteUserSessionMock);
|
|
4205
|
+
yield takeLatest(actions.deleteAllUserSessions, deleteAllUserSessionsMock);
|
|
4156
4206
|
}
|
|
4157
4207
|
|
|
4158
4208
|
function* sagas() {
|
|
@@ -4191,6 +4241,7 @@ function* mockSagas() {
|
|
|
4191
4241
|
call(teamSagasMock),
|
|
4192
4242
|
call(apiTokensSagaMock),
|
|
4193
4243
|
call(securityPolicySagasMock),
|
|
4244
|
+
call(sessionsSagaMock),
|
|
4194
4245
|
call(accountSettingsSagaMock),
|
|
4195
4246
|
call(tenantsSagasMock),
|
|
4196
4247
|
]);
|
package/node/auth/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var auth_index = require('../index-
|
|
5
|
+
var auth_index = require('../index-7cc852ed.js');
|
|
6
6
|
var constants = require('../constants-52e37c08.js');
|
|
7
7
|
var restApi = require('@frontegg/rest-api');
|
|
8
8
|
require('@reduxjs/toolkit');
|
|
@@ -884,6 +884,33 @@ const tenantsDemo = [
|
|
|
884
884
|
currency: undefined,
|
|
885
885
|
logo: undefined,
|
|
886
886
|
},
|
|
887
|
+
];
|
|
888
|
+
const sessionsMock = [
|
|
889
|
+
{
|
|
890
|
+
id: `laptop`,
|
|
891
|
+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",
|
|
892
|
+
createdAt: new Date(),
|
|
893
|
+
ipAddress: "190.194.88.251",
|
|
894
|
+
current: true,
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
id: `iphone`,
|
|
898
|
+
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Mobile/15E148 Safari/604.1",
|
|
899
|
+
createdAt: new Date(Date.now() - 10000),
|
|
900
|
+
ipAddress: "191.49.203.21",
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
id: `tablet`,
|
|
904
|
+
userAgent: "Mozilla/5.0 (Linux; Android 6.0.1; SGP771 Build/32.2.A.0.253; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36",
|
|
905
|
+
createdAt: new Date(Date.now() - 30000),
|
|
906
|
+
ipAddress: "130.19.196.136",
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
id: `anotherlaptop`,
|
|
910
|
+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",
|
|
911
|
+
createdAt: new Date(Date.now() - 1002232300),
|
|
912
|
+
ipAddress: "2.228.163.92",
|
|
913
|
+
}
|
|
887
914
|
];
|
|
888
915
|
|
|
889
916
|
exports.UserVeirifedOriginTypes = void 0;
|
|
@@ -4072,6 +4099,29 @@ function* sessionsSaga() {
|
|
|
4072
4099
|
yield effects.takeLatest(actions.loadUserSessions, loadCurrentUserSessions);
|
|
4073
4100
|
yield effects.takeLatest(actions.deleteUserSession, deleteUserSession);
|
|
4074
4101
|
yield effects.takeLatest(actions.deleteAllUserSessions, deleteAllUserSessions);
|
|
4102
|
+
}
|
|
4103
|
+
/*********************************
|
|
4104
|
+
* Preview Sagas
|
|
4105
|
+
*********************************/
|
|
4106
|
+
function* loadCurrentUserSessionsMock() {
|
|
4107
|
+
yield effects.put(actions.setSessionsState({ loading: true, error: null }));
|
|
4108
|
+
yield effects.put(actions.setSessionsState({ sessions: sessionsMock, loading: false }));
|
|
4109
|
+
}
|
|
4110
|
+
function* deleteUserSessionMock({ payload: { id } }) {
|
|
4111
|
+
yield effects.put(actions.setSessionsState({ loading: true, error: null }));
|
|
4112
|
+
const currentSessions = yield effects.select((state) => { var _a; return (_a = state.auth.sessionsState.sessions) !== null && _a !== void 0 ? _a : []; });
|
|
4113
|
+
const newSessions = currentSessions.filter(s => s.id !== id);
|
|
4114
|
+
yield effects.put(actions.setSessionsState({ sessions: newSessions, loading: false }));
|
|
4115
|
+
}
|
|
4116
|
+
function* deleteAllUserSessionsMock() {
|
|
4117
|
+
yield effects.put(actions.setSessionsState({ loading: true, error: null }));
|
|
4118
|
+
const newSessions = sessionsMock.filter(s => s.current);
|
|
4119
|
+
yield effects.put(actions.setSessionsState({ sessions: newSessions, loading: false }));
|
|
4120
|
+
}
|
|
4121
|
+
function* sessionsSagaMock() {
|
|
4122
|
+
yield effects.takeLatest(actions.loadUserSessions, loadCurrentUserSessionsMock);
|
|
4123
|
+
yield effects.takeLatest(actions.deleteUserSession, deleteUserSessionMock);
|
|
4124
|
+
yield effects.takeLatest(actions.deleteAllUserSessions, deleteAllUserSessionsMock);
|
|
4075
4125
|
}
|
|
4076
4126
|
|
|
4077
4127
|
function* sagas() {
|
|
@@ -4110,6 +4160,7 @@ function* mockSagas() {
|
|
|
4110
4160
|
effects.call(teamSagasMock),
|
|
4111
4161
|
effects.call(apiTokensSagaMock),
|
|
4112
4162
|
effects.call(securityPolicySagasMock),
|
|
4163
|
+
effects.call(sessionsSagaMock),
|
|
4113
4164
|
effects.call(accountSettingsSagaMock),
|
|
4114
4165
|
effects.call(tenantsSagasMock),
|
|
4115
4166
|
]);
|
package/node/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var auth_index = require('./index-
|
|
5
|
+
var auth_index = require('./index-7cc852ed.js');
|
|
6
6
|
var audits_index = require('./audits/index.js');
|
|
7
7
|
var connectivity_index = require('./connectivity/index.js');
|
|
8
8
|
var subscriptions_index = require('./subscriptions/index.js');
|
package/node/toolkit/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var auth_index = require('../index-
|
|
5
|
+
var auth_index = require('../index-7cc852ed.js');
|
|
6
6
|
var toolkit = require('@reduxjs/toolkit');
|
|
7
7
|
var createSagaMiddleware = require('redux-saga');
|
|
8
8
|
var effects = require('redux-saga/effects');
|