New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@frontegg/redux-store

Package Overview
Dependencies
Maintainers
1
Versions
1100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frontegg/redux-store - npm Package Compare versions

Comparing version 2.7.2 to 2.8.0-alpha.938925036

connectivity/ConnectivityState/index.d.ts

378

audits/index.js

@@ -1,5 +0,375 @@

import '@reduxjs/toolkit';
export { g as auditLogsActions, f as auditLogsReducers, e as auditLogsState, c as auditsActions, i as auditsInitialState, k as auditsMetadataActions, j as auditsMetadataReducers, h as auditsMetadataState, m as auditsMockSagas, r as auditsReducers, s as auditsSagas, d as auditsStoreName, b as default } from '../index-3dc6d573.js';
import 'redux-saga/effects';
import '@frontegg/rest-api';
import { createAction, createSlice } from '@reduxjs/toolkit';
import { b as auditsStoreName } from '../constants-4e7742bd.js';
export { b as auditsStoreName } from '../constants-4e7742bd.js';
import { takeEvery, select as select$1, put, call, all } from 'redux-saga/effects';
import { api } from '@frontegg/rest-api';
const typeReducerForKey = (key) => ({
prepare: (payload) => ({ payload }),
reducer: (state, { payload }) => {
return Object.assign(Object.assign({}, state), { [key]: Object.assign(Object.assign({}, state[key]), payload) });
},
});
const auditLogsState = {
loading: true,
pageOffset: 0,
pageSize: 20,
logs: [],
sort: [],
filter: [],
totalPages: 0,
isDownloadingCsv: false,
isDownloadingPdf: false,
};
const reducers = {
setAuditLogsState: typeReducerForKey('auditLogsState'),
resetAuditLogsState: (state) => (Object.assign(Object.assign({}, state), { auditLogsState })),
};
const actions = {
exportAuditsCsv: createAction(`${auditsStoreName}/exportAuditsCsv`),
exportAuditsPdf: createAction(`${auditsStoreName}/exportAuditsPdf`),
loadAuditLogs: createAction(`${auditsStoreName}/loadAuditLogs`, (payload) => ({ payload })),
};
const auditsMetadataState = {
loading: true,
};
const reducers$1 = {
setAuditsMetadataState: typeReducerForKey('auditsMetadataState'),
resetAuditsMetadataState: (state) => (Object.assign(Object.assign({}, state), { auditsMetadataState })),
};
const actions$1 = {
loadAuditsMetadata: createAction(`${auditsStoreName}/loadAuditsMetadata`),
};
const initialState = {
auditLogsState,
auditsMetadataState,
};
const { reducer, actions: sliceActions } = createSlice({
name: auditsStoreName,
initialState,
reducers: Object.assign(Object.assign({ resetState: (state) => (Object.assign(Object.assign({}, state), initialState)), setState: (state, { payload }) => (Object.assign(Object.assign({}, state), payload)) }, reducers), reducers$1),
});
const actions$2 = Object.assign(Object.assign(Object.assign({}, sliceActions), actions), actions$1);
const dummyUsersData = [
{ user: 'Dianne Deck', email: 'dianne@frontegg.com' },
{ user: 'Betty Martin', email: 'betty@frontegg.com' },
{ user: 'Joann Schmidt', email: 'joann@frontegg.com' },
{ user: 'Kristine Bodnar', email: 'kristine@frontegg.com' },
{ user: 'Harold Marcus', email: 'harold@frontegg.com' },
{ user: 'Alice Williams', email: 'allice@frontegg.com' },
{ user: 'Beatrice Wilkinson', email: 'beatrice@frontegg.com' },
];
const randomUser = () => {
const random = Math.floor(Math.random() * dummyUsersData.length);
return dummyUsersData[random];
};
const randomAction = () => {
const random = Math.floor(Math.random() * 6);
switch (random) {
case 0:
return {
action: 'Updated profile',
description: 'User updated profile details',
severity: 'Info',
};
case 1:
return {
action: 'User logged in',
severity: 'Info',
description: 'User logged in to the product',
};
case 2:
return {
action: 'User failed to login',
severity: 'High',
description: 'User failed to login with password',
};
case 3:
return {
action: 'Added user',
severity: 'Info',
description: 'Added user david+535@frontegg.com to tenant',
};
case 4:
return {
action: 'Assigned roles',
severity: 'Info',
description: 'Assigned 0 roles for user',
};
case 5:
return {
action: 'Removed user david+108@frontegg.com from account',
severity: 'Info',
description: 'Removed access from the account for user david+108@frontegg.com',
};
}
};
const auditLogsDataDemo = {
total: 20,
data: Array.from(Array(10).keys()).map((i) => (Object.assign(Object.assign(Object.assign({ ip: '198.143.51.1' }, randomUser()), randomAction()), { json: { key1: 'value1', key2: 'value2', key3: 'value3', key4: 'value4' }, tenantId: 'my-tenant-id', vendorId: 'my-vendor-id', userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36', createdAt: `2021-04-07 10:${50 - i}:40.201` }))),
};
const auditLogsMetadataDemo = {
properties: [
{
showInTable: true,
name: 'createdAt',
displayName: 'Time',
type: 'Timestamp',
sortable: true,
filterable: true,
showInMoreInfo: 'Always',
chosen: false,
selected: false,
isPredefined: false,
},
{
showInTable: true,
name: 'email',
displayName: 'User',
type: 'Email',
filterable: true,
sortable: true,
isPredefined: true,
chosen: false,
selected: false,
},
{
showInTable: true,
name: 'action',
displayName: 'Action',
type: 'AlphaNumeric',
sortable: true,
filterable: true,
showInMoreInfo: 'Always',
chosen: false,
selected: false,
isPredefined: true,
},
{
showInTable: true,
name: 'description',
type: 'AlphaNumeric',
sortable: false,
filterable: false,
displayName: 'Description',
isPredefined: true,
chosen: false,
selected: false,
},
{
showInTable: true,
name: 'ip',
displayName: 'IP Address',
type: 'IpAddress',
sortable: true,
filterable: true,
showInMoreInfo: 'Always',
chosen: false,
selected: false,
isPredefined: true,
},
{
showInTable: false,
name: 'severity',
displayName: 'Severity',
type: 'Severity',
sortable: true,
filterable: true,
showInMoreInfo: 'Always',
chosen: false,
selected: false,
isPredefined: true,
},
{
showInTable: false,
name: 'userAgent',
displayName: 'User Agent',
type: 'AlphaNumeric',
filterable: true,
sortable: true,
isPredefined: true,
chosen: false,
selected: false,
},
{
showInTable: false,
name: 'json',
type: 'Json',
sortable: true,
filterable: true,
displayName: 'Json Data',
showInMoreInfo: 'Always',
isPredefined: false,
},
],
};
const select = () => select$1((_) => _[auditsStoreName].auditLogsState);
const selectMetadata = () => select$1((_) => _[auditsStoreName].auditsMetadataState);
function* exportAuditsCsv() {
const state = yield select();
const { columns } = yield selectMetadata();
try {
const filter = state.filter;
const sort = state.sort;
const sortParams = sort.reduce((p, n) => (Object.assign(Object.assign({}, p), { sortBy: n.id, sortDirection: n.desc ? 'desc' : 'asc' })), {});
const filterParams = filter.reduce((p, n) => (Object.assign(Object.assign({}, p), { [n.id]: encodeURIComponent(n.value) })), {});
yield put(actions$2.setAuditLogsState({ isDownloadingCsv: true }));
const outputFileName = `audits.csv`;
yield api.audits.exportAudits(Object.assign(Object.assign({ endpoint: 'csv/v2', headerProps: columns, offset: 0, outputFileName }, sortParams), filterParams));
}
catch (e) {
console.error('failed to export audits - ', e);
}
yield put(actions$2.setAuditLogsState({ isDownloadingCsv: false }));
}
function* exportAuditsPdf() {
const state = yield select();
const { columns } = yield selectMetadata();
try {
const filter = state.filter;
const sort = state.sort;
const sortParams = sort.reduce((p, n) => (Object.assign(Object.assign({}, p), { sortBy: n.id, sortDirection: n.desc ? 'desc' : 'asc' })), {});
const filterParams = filter.reduce((p, n) => (Object.assign(Object.assign({}, p), { [n.id]: encodeURIComponent(n.value) })), {});
yield put(actions$2.setAuditLogsState({ isDownloadingPdf: true }));
const outputFileName = `audits.pdf`;
yield api.audits.exportAudits(Object.assign(Object.assign({ endpoint: 'pdf', headerProps: columns, offset: 0, outputFileName }, sortParams), filterParams));
}
catch (e) {
console.error('failed to export audits - ', e);
}
yield put(actions$2.setAuditLogsState({ isDownloadingPdf: false }));
}
function* loadAuditLogs({ payload }) {
var _a, _b, _c, _d, _e, _f;
yield put(actions$2.setAuditLogsState({ loading: !(payload === null || payload === void 0 ? void 0 : payload.silentLoading), error: null }));
const state = yield select();
const { columns } = yield selectMetadata();
try {
const pageSize = (_a = payload.pageSize) !== null && _a !== void 0 ? _a : state.pageSize;
const pageOffset = (_b = payload.pageOffset) !== null && _b !== void 0 ? _b : state.pageOffset;
const filter = (_c = payload.filter) !== null && _c !== void 0 ? _c : state.filter;
const sort = (_d = payload.sort) !== null && _d !== void 0 ? _d : state.sort;
yield put(actions$2.setAuditLogsState({
pageSize,
pageOffset,
filter,
sort,
}));
const sortParams = sort.reduce((p, n) => (Object.assign(Object.assign({}, p), { sortBy: n.id, sortDirection: n.desc ? 'desc' : 'asc' })), {});
const filterParams = filter.reduce((p, n) => (Object.assign(Object.assign({}, p), { [n.id]: n.value })), {});
if (!columns) {
yield put(actions$2.loadAuditsMetadata());
}
const { data, total } = yield call(api.audits.getAudits, Object.assign(Object.assign({ offset: pageOffset, count: pageSize }, sortParams), filterParams));
yield put(actions$2.setAuditLogsState({
loading: false,
logs: data !== null && data !== void 0 ? data : [],
totalPages: +(total / pageSize).toFixed(0),
}));
(_e = payload === null || payload === void 0 ? void 0 : payload.callback) === null || _e === void 0 ? void 0 : _e.call(payload, true);
}
catch (e) {
yield put(actions$2.setAuditLogsState({ loading: false, error: e.message }));
(_f = payload === null || payload === void 0 ? void 0 : payload.callback) === null || _f === void 0 ? void 0 : _f.call(payload, null, e);
}
}
function* auditLogsSagas() {
yield takeEvery(actions$2.exportAuditsCsv, exportAuditsCsv);
yield takeEvery(actions$2.exportAuditsPdf, exportAuditsPdf);
yield takeEvery(actions$2.loadAuditLogs, loadAuditLogs);
}
/*********************************
* Preview Sagas
*********************************/
function* loadAuditLogsMock({ payload }) {
var _a, _b, _c, _d, _e, _f;
yield put(actions$2.setAuditLogsState({ loading: !(payload === null || payload === void 0 ? void 0 : payload.silentLoading), error: null }));
const state = yield select();
const { columns } = yield selectMetadata();
try {
const pageSize = (_a = payload.pageSize) !== null && _a !== void 0 ? _a : state.pageSize;
const pageOffset = (_b = payload.pageOffset) !== null && _b !== void 0 ? _b : state.pageOffset;
const filter = (_c = payload.filter) !== null && _c !== void 0 ? _c : state.filter;
const sort = (_d = payload.sort) !== null && _d !== void 0 ? _d : state.sort;
yield put(actions$2.setAuditLogsState({
pageSize,
pageOffset,
filter,
sort,
}));
if (!columns) {
yield put(actions$2.loadAuditsMetadata());
}
const { data, total } = auditLogsDataDemo;
yield put(actions$2.setAuditLogsState({
loading: false,
logs: data !== null && data !== void 0 ? data : [],
totalPages: +(total / pageSize).toFixed(0),
}));
(_e = payload === null || payload === void 0 ? void 0 : payload.callback) === null || _e === void 0 ? void 0 : _e.call(payload, true);
}
catch (e) {
yield put(actions$2.setAuditLogsState({ loading: false, error: e.message }));
(_f = payload === null || payload === void 0 ? void 0 : payload.callback) === null || _f === void 0 ? void 0 : _f.call(payload, null, e);
}
}
function* auditLogsSagasMock() {
yield takeEvery(actions$2.loadAuditLogs, loadAuditLogsMock);
}
function* loadAuditsMetadata() {
yield put(actions$2.setAuditsMetadataState({ loading: true, error: null }));
try {
const { properties } = yield call(api.metadata.getAuditsMetadata);
yield put(actions$2.setAuditsMetadataState({ columns: properties, loading: false }));
}
catch (e) {
yield put(actions$2.setAuditsMetadataState({ error: e, loading: false }));
}
}
function* auditsMetadataSagas() {
yield takeEvery(actions$2.loadAuditsMetadata, loadAuditsMetadata);
}
/*********************************
* Preview Sagas
*********************************/
function* loadAuditsMetadataMock() {
yield put(actions$2.setAuditsMetadataState({ loading: true, error: null }));
try {
const { properties } = auditLogsMetadataDemo;
yield put(actions$2.setAuditsMetadataState({ columns: properties, loading: false }));
}
catch (e) {
yield put(actions$2.setAuditsMetadataState({ error: e, loading: false }));
}
}
function* auditsMetadataSagasMock() {
yield takeEvery(actions$2.loadAuditLogs, loadAuditsMetadataMock);
}
function* sagas() {
yield all([call(auditLogsSagas), call(auditsMetadataSagas)]);
}
function* mockSagas() {
yield all([call(auditLogsSagasMock), call(auditsMetadataSagasMock)]);
}
// export store
var auditsStore = {
sagas,
mockSagas,
storeName: auditsStoreName,
initialState,
reducer,
actions: actions$2,
};
export default auditsStore;
export { actions as auditLogsActions, reducers as auditLogsReducers, auditLogsState, actions$2 as auditsActions, initialState as auditsInitialState, actions$1 as auditsMetadataActions, reducers$1 as auditsMetadataReducers, auditsMetadataState, mockSagas as auditsMockSagas, reducer as auditsReducers, sagas as auditsSagas };
//# sourceMappingURL=index.js.map

6

auth/index.js
import '@reduxjs/toolkit';
export { h as AcceptInvitationStep, A as ActivateAccountStep, Q as ApiStateKeys, F as ForgotPasswordStep, L as LoginStep, M as MFAStep, S as SamlVendors, K as SignUpStage, T as TeamStateKeys, n as acceptInvitationActions, k as acceptInvitationReducers, j as acceptInvitationState, $ as accountSettingsActions, _ as accountSettingsReducers, Z as accountSettingsState, g as activateAccountActions, f as activateAccountReducers, e as activateState, V as apiTokensActions, U as apiTokensReducers, R as apiTokensState, b as authActions, i as authInitialState, m as authMockSagas, r as authReducers, s as authSagas, a as default, q as forgotPasswordActions, p as forgotPasswordReducers, o as forgotPasswordState, d as loginActions, c as loginReducers, l as loginState, y as mfaActions, x as mfaReducers, w as mfaState, C as profileActions, B as profileReducers, z as profileState, a5 as rolesActions, a4 as rolesReducers, a3 as rolesState, Y as securityPolicyActions, X as securityPolicyReducers, W as securityPolicyState, P as signUpActions, O as signUpReducers, N as signUpState, H as socialLoginState, J as socialLoginsActions, I as socialLoginsReducer, v as ssoActions, u as ssoReducers, t as ssoState, G as teamActions, E as teamReducers, D as teamState, a2 as tenantsActions, a1 as tenantsReducers, a0 as tenantsState } from '../index-9a7f280e.js';
export { a as authStoreName } from '../index-3dc6d573.js';
export { h as AcceptInvitationStep, A as ActivateAccountStep, Q as ApiStateKeys, F as ForgotPasswordStep, L as LoginStep, M as MFAStep, S as SamlVendors, K as SignUpStage, T as TeamStateKeys, n as acceptInvitationActions, k as acceptInvitationReducers, j as acceptInvitationState, $ as accountSettingsActions, _ as accountSettingsReducers, Z as accountSettingsState, g as activateAccountActions, f as activateAccountReducers, e as activateState, V as apiTokensActions, U as apiTokensReducers, R as apiTokensState, b as authActions, i as authInitialState, m as authMockSagas, r as authReducers, s as authSagas, a as default, q as forgotPasswordActions, p as forgotPasswordReducers, o as forgotPasswordState, d as loginActions, c as loginReducers, l as loginState, y as mfaActions, x as mfaReducers, w as mfaState, C as profileActions, B as profileReducers, z as profileState, a5 as rolesActions, a4 as rolesReducers, a3 as rolesState, Y as securityPolicyActions, X as securityPolicyReducers, W as securityPolicyState, P as signUpActions, O as signUpReducers, N as signUpState, H as socialLoginState, J as socialLoginsActions, I as socialLoginsReducer, v as ssoActions, u as ssoReducers, t as ssoState, G as teamActions, E as teamReducers, D as teamState, a2 as tenantsActions, a1 as tenantsReducers, a0 as tenantsState } from '../index-3e0b669f.js';
export { a as authStoreName } from '../constants-4e7742bd.js';
import '../index-6ead0da8.js';
import 'redux-saga/effects';
import '@frontegg/rest-api';
import 'redux-saga';
import '../audits/index.js';
import 'uuid';
//# sourceMappingURL=index.js.map
export declare const FRONTEGG_AFTER_AUTH_REDIRECT_URL = "FRONTEGG_AFTER_AUTH_REDIRECT_URL";
export declare const authStoreName = "auth";
export declare const connectivityStoreName = "connectivity";
export declare const auditsStoreName = "auditLogs";

@@ -5,2 +5,3 @@ export { default as auth } from './auth';

export * from './audits';
export * from './connectivity';
export * from './toolkit';
export { bindActionCreators, combineReducers, configureStore, getDefaultMiddleware } from '@reduxjs/toolkit';
export { h as AcceptInvitationStep, A as ActivateAccountStep, Q as ApiStateKeys, F as ForgotPasswordStep, L as LoginStep, M as MFAStep, S as SamlVendors, K as SignUpStage, T as TeamStateKeys, n as acceptInvitationActions, k as acceptInvitationReducers, j as acceptInvitationState, $ as accountSettingsActions, _ as accountSettingsReducers, Z as accountSettingsState, g as activateAccountActions, f as activateAccountReducers, e as activateState, V as apiTokensActions, U as apiTokensReducers, R as apiTokensState, a as auth, b as authActions, i as authInitialState, m as authMockSagas, r as authReducers, s as authSagas, a6 as createFronteggStore, q as forgotPasswordActions, p as forgotPasswordReducers, o as forgotPasswordState, d as loginActions, c as loginReducers, l as loginState, y as mfaActions, x as mfaReducers, w as mfaState, C as profileActions, B as profileReducers, z as profileState, a5 as rolesActions, a4 as rolesReducers, a3 as rolesState, Y as securityPolicyActions, X as securityPolicyReducers, W as securityPolicyState, P as signUpActions, O as signUpReducers, N as signUpState, H as socialLoginState, J as socialLoginsActions, I as socialLoginsReducer, v as ssoActions, u as ssoReducers, t as ssoState, G as teamActions, E as teamReducers, D as teamState, a2 as tenantsActions, a1 as tenantsReducers, a0 as tenantsState } from './index-9a7f280e.js';
export { g as auditLogsActions, f as auditLogsReducers, e as auditLogsState, b as audits, c as auditsActions, i as auditsInitialState, k as auditsMetadataActions, j as auditsMetadataReducers, h as auditsMetadataState, m as auditsMockSagas, r as auditsReducers, s as auditsSagas, d as auditsStoreName, a as authStoreName } from './index-3dc6d573.js';
export { h as AcceptInvitationStep, A as ActivateAccountStep, Q as ApiStateKeys, F as ForgotPasswordStep, L as LoginStep, M as MFAStep, S as SamlVendors, K as SignUpStage, T as TeamStateKeys, n as acceptInvitationActions, k as acceptInvitationReducers, j as acceptInvitationState, $ as accountSettingsActions, _ as accountSettingsReducers, Z as accountSettingsState, g as activateAccountActions, f as activateAccountReducers, e as activateState, V as apiTokensActions, U as apiTokensReducers, R as apiTokensState, a as auth, b as authActions, i as authInitialState, m as authMockSagas, r as authReducers, s as authSagas, a6 as createFronteggStore, q as forgotPasswordActions, p as forgotPasswordReducers, o as forgotPasswordState, d as loginActions, c as loginReducers, l as loginState, y as mfaActions, x as mfaReducers, w as mfaState, C as profileActions, B as profileReducers, z as profileState, a5 as rolesActions, a4 as rolesReducers, a3 as rolesState, Y as securityPolicyActions, X as securityPolicyReducers, W as securityPolicyState, P as signUpActions, O as signUpReducers, N as signUpState, H as socialLoginState, J as socialLoginsActions, I as socialLoginsReducer, v as ssoActions, u as ssoReducers, t as ssoState, G as teamActions, E as teamReducers, D as teamState, a2 as tenantsActions, a1 as tenantsReducers, a0 as tenantsState } from './index-3e0b669f.js';
export { b as auditsStoreName, a as authStoreName, c as connectivityStoreName } from './constants-4e7742bd.js';
export { a as connectivityActions, i as connectivityInitialState, r as connectivityReducers, s as connectivitySagas, b as initialState } from './index-6ead0da8.js';
export { all, call, delay, put, select, takeEvery, takeLatest } from 'redux-saga/effects';
import '@frontegg/rest-api';
export { default as createSagaMiddleware } from 'redux-saga';
export { auditLogsActions, auditLogsReducers, auditLogsState, default as audits, auditsActions, auditsInitialState, auditsMetadataActions, auditsMetadataReducers, auditsMetadataState, auditsMockSagas, auditsReducers, auditsSagas } from './audits/index.js';
import 'uuid';
//# sourceMappingURL=index.js.map
{
"name": "@frontegg/redux-store",
"libName": "FronteggReduxStore",
"version": "2.7.2",
"version": "2.8.0-alpha.938925036",
"author": "Frontegg LTD",

@@ -15,3 +15,3 @@ "main": "index.cjs.js",

"dependencies": {
"@frontegg/rest-api": "^2.7.0",
"@frontegg/rest-api": "2.8.0-alpha.938925036",
"@reduxjs/toolkit": "^1.5.0",

@@ -18,0 +18,0 @@ "redux-saga": "^1.1.0"

export { bindActionCreators, combineReducers, configureStore, getDefaultMiddleware } from '@reduxjs/toolkit';
export { a6 as createFronteggStore } from '../index-9a7f280e.js';
import '../index-3dc6d573.js';
export { a6 as createFronteggStore } from '../index-3e0b669f.js';
import '../constants-4e7742bd.js';
import '../index-6ead0da8.js';
export { all, call, delay, put, select, takeEvery, takeLatest } from 'redux-saga/effects';
import '@frontegg/rest-api';
export { default as createSagaMiddleware } from 'redux-saga';
import '../audits/index.js';
import 'uuid';
//# sourceMappingURL=index.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc