@frontegg/redux-store 6.2.5 → 6.5.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/audits/backward-compatibility/reducer.d.ts +1 -1
- package/audits/backward-compatibility/saga.js +4 -1
- package/audits/index.d.ts +1 -1
- package/audits/reducer.d.ts +1 -1
- package/auth/ApiTokensState/index.d.ts +14 -2
- package/auth/ApiTokensState/index.js +6 -0
- package/auth/ApiTokensState/saga.js +128 -2
- package/auth/LoginState/saga.js +9 -5
- package/auth/MfaState/saga.js +1 -1
- package/auth/SSOState/saga.js +1 -1
- package/auth/SecurityPolicyState/saga.d.ts +3 -2
- package/auth/SocialLogins/saga.d.ts +2 -2
- package/auth/index.d.ts +11 -1
- package/auth/reducer.d.ts +11 -1
- package/connectivity/index.d.ts +1 -1
- package/connectivity/reducer.d.ts +1 -1
- package/connectivity/saga.js +31 -10
- package/index.js +1 -1
- package/node/audits/backward-compatibility/saga.js +4 -1
- package/node/auth/ApiTokensState/index.js +6 -0
- package/node/auth/ApiTokensState/saga.js +128 -2
- package/node/auth/LoginState/saga.js +9 -5
- package/node/auth/MfaState/saga.js +1 -1
- package/node/auth/SSOState/saga.js +1 -1
- package/node/connectivity/saga.js +31 -10
- package/node/index.js +1 -1
- package/node/subscriptions/Billing/Information/saga.js +1 -1
- package/node/subscriptions/Billing/Subscription/saga.js +1 -2
- package/node/subscriptions/Checkout/saga.js +1 -3
- package/node/vendor/reducer.js +1 -1
- package/node/vendor/saga.js +9 -1
- package/package.json +5 -5
- package/subscriptions/Billing/Information/index.d.ts +1 -1
- package/subscriptions/Billing/Information/saga.d.ts +8 -26
- package/subscriptions/Billing/Information/saga.js +1 -1
- package/subscriptions/Billing/Invoices/index.d.ts +1 -1
- package/subscriptions/Billing/PaymentMethod/index.d.ts +1 -1
- package/subscriptions/Billing/Subscription/index.d.ts +1 -1
- package/subscriptions/Billing/Subscription/saga.d.ts +1 -11
- package/subscriptions/Billing/Subscription/saga.js +1 -2
- package/subscriptions/Billing/index.d.ts +1 -1
- package/subscriptions/Checkout/index.d.ts +1 -1
- package/subscriptions/Checkout/saga.js +1 -2
- package/subscriptions/Config/index.d.ts +1 -1
- package/subscriptions/Plans/index.d.ts +1 -1
- package/subscriptions/Stripe/index.d.ts +1 -1
- package/subscriptions/VendorPublicConfig/index.d.ts +1 -1
- package/subscriptions/index.d.ts +3 -3
- package/subscriptions/reducer.d.ts +3 -3
- package/toolkit/redux.d.ts +1 -1
- package/vendor/VendorState/index.d.ts +2 -1
- package/vendor/index.d.ts +1 -1
- package/vendor/interfaces.d.ts +2 -1
- package/vendor/reducer.d.ts +1 -1
- package/vendor/reducer.js +1 -1
- package/vendor/saga.d.ts +2 -2
- package/vendor/saga.js +9 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LoadAudits, Filter, DataSorting } from './interfaces';
|
|
2
2
|
export declare const defaultItemsPerPage = 20;
|
|
3
|
-
declare const storeName: "audits", reducer: import("
|
|
3
|
+
declare const storeName: "audits", reducer: import("redux").Reducer<import("./interfaces").OldAuditsState, import("redux").AnyAction>;
|
|
4
4
|
export { reducer, storeName };
|
|
5
5
|
export declare const actions: {
|
|
6
6
|
initData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
@@ -89,7 +89,10 @@ function* loadAuditsFunction({
|
|
|
89
89
|
rowsData: [...rowsData, ...data],
|
|
90
90
|
total
|
|
91
91
|
}));
|
|
92
|
-
|
|
92
|
+
|
|
93
|
+
if (onlyOneLoad) {
|
|
94
|
+
yield put(actions.finishLoading());
|
|
95
|
+
}
|
|
93
96
|
} catch (e) {
|
|
94
97
|
const errorMessage = {
|
|
95
98
|
name: 'audits',
|
package/audits/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare const _default: {
|
|
|
14
14
|
mockSagas: typeof mockSagas;
|
|
15
15
|
storeName: string;
|
|
16
16
|
initialState: import("./interfaces").AuditsState;
|
|
17
|
-
reducer: import("
|
|
17
|
+
reducer: import("redux").Reducer<import("./interfaces").AuditsState, import("redux").AnyAction>;
|
|
18
18
|
actions: {
|
|
19
19
|
loadAuditsMetadata: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
20
20
|
exportAuditsCsv: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
package/audits/reducer.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AuditsState } from './interfaces';
|
|
2
2
|
import { AuditLogsActions } from './AuditLogsState';
|
|
3
3
|
import { AuditsMetadataActions } from './AuditsMetadataState';
|
|
4
|
-
declare const reducer: import("
|
|
4
|
+
declare const reducer: import("redux").Reducer<AuditsState, import("redux").AnyAction>;
|
|
5
5
|
declare const actions: {
|
|
6
6
|
loadAuditsMetadata: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
7
7
|
exportAuditsCsv: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiTokensState, ApiStateIndicator, ApiTokenType, AddTenantApiTokenPayload, AddUserApiTokenPayload
|
|
1
|
+
import { ApiTokensState, ApiStateIndicator, ApiTokenType, AddTenantApiTokenPayload, AddUserApiTokenPayload } from './interfaces';
|
|
2
2
|
import { WithCallback, WithSilentLoad } from '../../interfaces';
|
|
3
3
|
declare const apiTokensState: ApiTokensState;
|
|
4
4
|
declare const reducers: {
|
|
@@ -99,8 +99,18 @@ declare const actions: {
|
|
|
99
99
|
}> | undefined)?], WithSilentLoad<{
|
|
100
100
|
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
101
101
|
}> | undefined, string, never, never>;
|
|
102
|
+
loadUserApiTokens: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(WithSilentLoad<{
|
|
103
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
104
|
+
}> | undefined)?], WithSilentLoad<{
|
|
105
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
106
|
+
}> | undefined, string, never, never>;
|
|
107
|
+
loadTenantApiTokens: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(WithSilentLoad<{
|
|
108
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
109
|
+
}> | undefined)?], WithSilentLoad<{
|
|
110
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
111
|
+
}> | undefined, string, never, never>;
|
|
102
112
|
initApiTokensData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[ApiTokenType], ApiTokenType, string, never, never>;
|
|
103
|
-
addTenantApiToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Pick<ITenantApiTokensData, "description" | "roleIds">, boolean>], WithCallback<Pick<ITenantApiTokensData, "description" | "roleIds">, boolean>, string, never, never>;
|
|
113
|
+
addTenantApiToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Pick<import("./interfaces").ITenantApiTokensData, "description" | "roleIds">, boolean>], WithCallback<Pick<import("./interfaces").ITenantApiTokensData, "description" | "roleIds">, boolean>, string, never, never>;
|
|
104
114
|
addUserApiToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Pick<import("./interfaces").IApiTokensData, "description">, boolean>], WithCallback<Pick<import("./interfaces").IApiTokensData, "description">, boolean>, string, never, never>;
|
|
105
115
|
deleteUserApiToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
|
|
106
116
|
deleteTenantApiToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
|
|
@@ -115,6 +125,8 @@ declare type DispatchedActions = {
|
|
|
115
125
|
setApiTokensState: (state: Partial<ApiTokensState>) => void;
|
|
116
126
|
resetApiTokensState: () => void;
|
|
117
127
|
loadApiTokens: (payload?: WithSilentLoad<WithCallback>) => void;
|
|
128
|
+
loadUserApiTokens: (payload?: WithSilentLoad<WithCallback>) => void;
|
|
129
|
+
loadTenantApiTokens: (payload?: WithSilentLoad<WithCallback>) => void;
|
|
118
130
|
initApiTokensData: (payload: ApiTokenType) => void;
|
|
119
131
|
addTenantApiToken: (payload: AddTenantApiTokenPayload) => void;
|
|
120
132
|
addUserApiToken: (payload: AddUserApiTokenPayload) => void;
|
|
@@ -34,6 +34,12 @@ const actions = {
|
|
|
34
34
|
loadApiTokens: createAction(`${authStoreName}/loadApiTokens`, payload => ({
|
|
35
35
|
payload
|
|
36
36
|
})),
|
|
37
|
+
loadUserApiTokens: createAction(`${authStoreName}/loadUserApiTokens`, payload => ({
|
|
38
|
+
payload
|
|
39
|
+
})),
|
|
40
|
+
loadTenantApiTokens: createAction(`${authStoreName}/loadTenantApiTokens`, payload => ({
|
|
41
|
+
payload
|
|
42
|
+
})),
|
|
37
43
|
initApiTokensData: createAction(`${authStoreName}/initApiTokensData`, payload => ({
|
|
38
44
|
payload
|
|
39
45
|
})),
|
|
@@ -269,8 +269,84 @@ function* loadApiTokens({
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
+
function* loadUserApiTokens({
|
|
273
|
+
payload
|
|
274
|
+
}) {
|
|
275
|
+
if (!(payload != null && payload.silentLoading)) {
|
|
276
|
+
yield put(actions.setApiTokensLoader({
|
|
277
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
278
|
+
value: true
|
|
279
|
+
}));
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
try {
|
|
283
|
+
var _payload$callback3;
|
|
284
|
+
|
|
285
|
+
const apiTokensData = yield call(api.auth.getUserApiTokensData);
|
|
286
|
+
yield put(actions.setApiTokensState({
|
|
287
|
+
apiTokensDataUser: apiTokensData != null ? apiTokensData : []
|
|
288
|
+
}));
|
|
289
|
+
yield put(actions.setApiTokensLoader({
|
|
290
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
291
|
+
value: false
|
|
292
|
+
}));
|
|
293
|
+
payload == null ? void 0 : (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
|
|
294
|
+
} catch (e) {
|
|
295
|
+
var _payload$callback4;
|
|
296
|
+
|
|
297
|
+
yield put(actions.setApiTokensError({
|
|
298
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
299
|
+
value: e.message
|
|
300
|
+
}));
|
|
301
|
+
yield put(actions.setApiTokensLoader({
|
|
302
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
303
|
+
value: false
|
|
304
|
+
}));
|
|
305
|
+
payload == null ? void 0 : (_payload$callback4 = payload.callback) == null ? void 0 : _payload$callback4.call(payload, null, e);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function* loadTenantApiTokens({
|
|
310
|
+
payload
|
|
311
|
+
}) {
|
|
312
|
+
if (!(payload != null && payload.silentLoading)) {
|
|
313
|
+
yield put(actions.setApiTokensLoader({
|
|
314
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
315
|
+
value: true
|
|
316
|
+
}));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
try {
|
|
320
|
+
var _payload$callback5;
|
|
321
|
+
|
|
322
|
+
const apiTokensData = yield call(api.auth.getTenantApiTokensData);
|
|
323
|
+
yield put(actions.setApiTokensState({
|
|
324
|
+
apiTokensDataTenant: apiTokensData != null ? apiTokensData : []
|
|
325
|
+
}));
|
|
326
|
+
yield put(actions.setApiTokensLoader({
|
|
327
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
328
|
+
value: false
|
|
329
|
+
}));
|
|
330
|
+
payload == null ? void 0 : (_payload$callback5 = payload.callback) == null ? void 0 : _payload$callback5.call(payload, true);
|
|
331
|
+
} catch (e) {
|
|
332
|
+
var _payload$callback6;
|
|
333
|
+
|
|
334
|
+
yield put(actions.setApiTokensError({
|
|
335
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
336
|
+
value: e.message
|
|
337
|
+
}));
|
|
338
|
+
yield put(actions.setApiTokensLoader({
|
|
339
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
340
|
+
value: false
|
|
341
|
+
}));
|
|
342
|
+
payload == null ? void 0 : (_payload$callback6 = payload.callback) == null ? void 0 : _payload$callback6.call(payload, null, e);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
272
346
|
export function* apiTokensSaga() {
|
|
273
347
|
yield takeLeading(actions.loadApiTokens, loadApiTokens);
|
|
348
|
+
yield takeLeading(actions.loadUserApiTokens, loadUserApiTokens);
|
|
349
|
+
yield takeLeading(actions.loadTenantApiTokens, loadTenantApiTokens);
|
|
274
350
|
yield takeLeading(actions.initApiTokensData, loadApiTokensData);
|
|
275
351
|
yield takeEvery(actions.addUserApiToken, addUserApiToken);
|
|
276
352
|
yield takeEvery(actions.addTenantApiToken, addTenantApiToken);
|
|
@@ -382,7 +458,7 @@ function* deleteTenantApiTokenMock({
|
|
|
382
458
|
function* loadApiTokensMock({
|
|
383
459
|
payload
|
|
384
460
|
}) {
|
|
385
|
-
var _payload$
|
|
461
|
+
var _payload$callback7;
|
|
386
462
|
|
|
387
463
|
if (!(payload != null && payload.silentLoading)) {
|
|
388
464
|
yield put(actions.setApiTokensLoader({
|
|
@@ -402,11 +478,61 @@ function* loadApiTokensMock({
|
|
|
402
478
|
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
403
479
|
value: false
|
|
404
480
|
}));
|
|
405
|
-
payload == null ? void 0 : (_payload$
|
|
481
|
+
payload == null ? void 0 : (_payload$callback7 = payload.callback) == null ? void 0 : _payload$callback7.call(payload, true);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function* loadUserApiTokensMock({
|
|
485
|
+
payload
|
|
486
|
+
}) {
|
|
487
|
+
var _payload$callback8;
|
|
488
|
+
|
|
489
|
+
if (!(payload != null && payload.silentLoading)) {
|
|
490
|
+
yield put(actions.setApiTokensLoader({
|
|
491
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
492
|
+
value: true
|
|
493
|
+
}));
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const apiTokensDataUser = [apiTokensDataDemo];
|
|
497
|
+
yield put(actions.setApiTokensState({
|
|
498
|
+
apiTokensDataUser
|
|
499
|
+
}));
|
|
500
|
+
yield delay(200);
|
|
501
|
+
yield put(actions.setApiTokensLoader({
|
|
502
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
503
|
+
value: false
|
|
504
|
+
}));
|
|
505
|
+
payload == null ? void 0 : (_payload$callback8 = payload.callback) == null ? void 0 : _payload$callback8.call(payload, true);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
function* loadTenantApiTokensMock({
|
|
509
|
+
payload
|
|
510
|
+
}) {
|
|
511
|
+
var _payload$callback9;
|
|
512
|
+
|
|
513
|
+
if (!(payload != null && payload.silentLoading)) {
|
|
514
|
+
yield put(actions.setApiTokensLoader({
|
|
515
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
516
|
+
value: true
|
|
517
|
+
}));
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
const apiTokensDataTenant = [apiTokensDataTenantDemo];
|
|
521
|
+
yield put(actions.setApiTokensState({
|
|
522
|
+
apiTokensDataTenant
|
|
523
|
+
}));
|
|
524
|
+
yield delay(200);
|
|
525
|
+
yield put(actions.setApiTokensLoader({
|
|
526
|
+
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
527
|
+
value: false
|
|
528
|
+
}));
|
|
529
|
+
payload == null ? void 0 : (_payload$callback9 = payload.callback) == null ? void 0 : _payload$callback9.call(payload, true);
|
|
406
530
|
}
|
|
407
531
|
|
|
408
532
|
export function* apiTokensSagaMock() {
|
|
409
533
|
yield takeLeading(actions.loadApiTokens, loadApiTokensMock);
|
|
534
|
+
yield takeLeading(actions.loadUserApiTokens, loadUserApiTokensMock);
|
|
535
|
+
yield takeLeading(actions.loadTenantApiTokens, loadTenantApiTokensMock);
|
|
410
536
|
yield takeLeading(actions.initApiTokensData, loadApiTokensDataMock);
|
|
411
537
|
yield takeEvery(actions.addTenantApiToken, addTenantApiTokenMock);
|
|
412
538
|
yield takeLatest(actions.deleteTenantApiToken, deleteTenantApiTokenMock);
|
package/auth/LoginState/saga.js
CHANGED
|
@@ -234,7 +234,7 @@ function* refreshTokenEmbedded() {
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
const quickLoginToRegister = (_ref = localStorage.getItem('register-quick-login')) != null ? _ref : loginState.quickLoginToRegister;
|
|
237
|
-
const
|
|
237
|
+
const shouldNavigateToRegisterQuickLogin = quickLoginToRegister && localStorage.getItem(`${user.id}-${quickLoginToRegister}`) !== 'true' && !window.location.pathname.endsWith(routes.logoutUrl);
|
|
238
238
|
yield put(actions.setTenantsState({
|
|
239
239
|
tenants,
|
|
240
240
|
loading: false
|
|
@@ -244,7 +244,7 @@ function* refreshTokenEmbedded() {
|
|
|
244
244
|
isAuthenticated: true,
|
|
245
245
|
loginState: _extends({}, loginState, {
|
|
246
246
|
quickLoginToRegister,
|
|
247
|
-
flow:
|
|
247
|
+
flow: shouldNavigateToRegisterQuickLogin ? LoginFlow.RegisterQuickLogin : LoginFlow.Login
|
|
248
248
|
})
|
|
249
249
|
}));
|
|
250
250
|
const url = new URL((_window2 = window) == null ? void 0 : _window2.location.href);
|
|
@@ -255,7 +255,7 @@ function* refreshTokenEmbedded() {
|
|
|
255
255
|
redirectRoutes.push(routes.loginUrl, routes.signUpUrl);
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
if (
|
|
258
|
+
if (shouldNavigateToRegisterQuickLogin) {
|
|
259
259
|
onRedirectTo(routes.loginUrl);
|
|
260
260
|
} else if (redirectRoutes.some(url => url && window.location.pathname.endsWith(url))) {
|
|
261
261
|
if (loginState.isNewUser && routes.signUpSuccessUrl && routes.socialLoginCallbackUrl === window.location.pathname) {
|
|
@@ -497,7 +497,9 @@ function* quickSmsPasswordlessPreLogin(_ref4) {
|
|
|
497
497
|
try {
|
|
498
498
|
yield put(actions.setLoginState({
|
|
499
499
|
loading: true
|
|
500
|
-
}));
|
|
500
|
+
})); // TODO: [Typescript 4.8] fix @frontegg/rest-api return value
|
|
501
|
+
// @ts-ignore
|
|
502
|
+
|
|
501
503
|
const preloginRes = yield call(api.auth.passwordlessPreLogin, _extends({}, payload, {
|
|
502
504
|
type: AuthStrategyEnum.SmsCode
|
|
503
505
|
}));
|
|
@@ -540,7 +542,9 @@ function* passwordlessPreLogin(_ref5) {
|
|
|
540
542
|
}));
|
|
541
543
|
yield put(actions.setLoginState({
|
|
542
544
|
loading: true
|
|
543
|
-
}));
|
|
545
|
+
})); // TODO: [Typescript 4.8] fix @frontegg/rest-api return value
|
|
546
|
+
// @ts-ignore
|
|
547
|
+
|
|
544
548
|
const preloginRes = yield call(api.auth.passwordlessPreLogin, payload);
|
|
545
549
|
const step = authStrategyLoginStepMap[payload.type];
|
|
546
550
|
|
package/auth/MfaState/saga.js
CHANGED
|
@@ -121,7 +121,7 @@ function* disableMfa({
|
|
|
121
121
|
var _payload$callback;
|
|
122
122
|
|
|
123
123
|
const user = yield select(state => state.auth.user);
|
|
124
|
-
yield api.auth.disableMfa
|
|
124
|
+
yield call(api.auth.disableMfa, payload);
|
|
125
125
|
yield put(actions.setMfaState({
|
|
126
126
|
loading: false,
|
|
127
127
|
error: undefined
|
package/auth/SSOState/saga.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IVendorConfig } from '@frontegg/rest-api';
|
|
2
|
+
import { IAuthStrategiesConfig } from '@frontegg/rest-api';
|
|
2
3
|
export declare function loadPublicSecurityPolicy(): Generator<import("redux-saga/effects").CallEffect<IVendorConfig> | import("redux-saga/effects").PutEffect<{
|
|
3
4
|
payload: Partial<import("../../interfaces").WithStatus & {
|
|
4
5
|
policy?: IVendorConfig | undefined;
|
|
@@ -7,10 +8,10 @@ export declare function loadPublicSecurityPolicy(): Generator<import("redux-saga
|
|
|
7
8
|
}>, void, IVendorConfig>;
|
|
8
9
|
export declare function loadPublicAuthStrategiesPolicy(): Generator<import("redux-saga/effects").PutEffect<{
|
|
9
10
|
payload: Partial<import("../../interfaces").WithStatus & {
|
|
10
|
-
policy?:
|
|
11
|
+
policy?: IAuthStrategiesConfig | undefined;
|
|
11
12
|
}>;
|
|
12
13
|
type: string;
|
|
13
|
-
}> | import("redux-saga/effects").CallEffect<
|
|
14
|
+
}> | import("redux-saga/effects").CallEffect<IAuthStrategiesConfig>, void, IAuthStrategiesConfig>;
|
|
14
15
|
export declare function securityPolicySagas(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
15
16
|
/*********************************
|
|
16
17
|
* Preview Sagas
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISocialLoginProviderConfiguration, ISocialLoginProviderConfigurationV2 } from '@frontegg/rest-api';
|
|
1
|
+
import { ContextOptions, ISocialLoginProviderConfiguration, ISocialLoginProviderConfigurationV2 } from '@frontegg/rest-api';
|
|
2
2
|
export declare function loadSocialLoginsConfigurations(): Generator<import("redux-saga/effects").PutEffect<{
|
|
3
3
|
payload: Partial<import("./interfaces").SocialLoginState>;
|
|
4
4
|
type: string;
|
|
@@ -6,5 +6,5 @@ export declare function loadSocialLoginsConfigurations(): Generator<import("redu
|
|
|
6
6
|
export declare function loadSocialLoginsConfigurationsV2(): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<{
|
|
7
7
|
payload: Partial<import("./interfaces").SocialLoginState>;
|
|
8
8
|
type: string;
|
|
9
|
-
}> | import("redux-saga/effects").CallEffect<ISocialLoginProviderConfigurationV2[]>, void, ISocialLoginProviderConfigurationV2[]>;
|
|
9
|
+
}> | import("redux-saga/effects").CallEffect<ISocialLoginProviderConfigurationV2[]>, void, ContextOptions & ISocialLoginProviderConfigurationV2[]>;
|
|
10
10
|
export declare function socialLoginsSaga(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
package/auth/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ declare const _default: {
|
|
|
46
46
|
mockSagas: typeof mockSagas;
|
|
47
47
|
storeName: string;
|
|
48
48
|
initialState: import("./interfaces").AuthState;
|
|
49
|
-
reducer: import("
|
|
49
|
+
reducer: import("redux").Reducer<import("./interfaces").AuthState, import("redux").AnyAction>;
|
|
50
50
|
actions: {
|
|
51
51
|
loadSessionsPolicy: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
52
52
|
createOrUpdateSessionsPolicy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").ISessionConfigurations, boolean>], import("..").WithCallback<import("@frontegg/rest-api").ISessionConfigurations, boolean>, string, never, never>;
|
|
@@ -112,6 +112,16 @@ declare const _default: {
|
|
|
112
112
|
}> | undefined)?], import("..").WithSilentLoad<{
|
|
113
113
|
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
114
114
|
}> | undefined, string, never, never>;
|
|
115
|
+
loadUserApiTokens: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("..").WithSilentLoad<{
|
|
116
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
117
|
+
}> | undefined)?], import("..").WithSilentLoad<{
|
|
118
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
119
|
+
}> | undefined, string, never, never>;
|
|
120
|
+
loadTenantApiTokens: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("..").WithSilentLoad<{
|
|
121
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
122
|
+
}> | undefined)?], import("..").WithSilentLoad<{
|
|
123
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
124
|
+
}> | undefined, string, never, never>;
|
|
115
125
|
initApiTokensData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./ApiTokensState/interfaces").ApiTokenType], import("./ApiTokensState/interfaces").ApiTokenType, string, never, never>;
|
|
116
126
|
addTenantApiToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<Pick<import("./ApiTokensState/interfaces").ITenantApiTokensData, "description" | "roleIds">, boolean>], import("..").WithCallback<Pick<import("./ApiTokensState/interfaces").ITenantApiTokensData, "description" | "roleIds">, boolean>, string, never, never>;
|
|
117
127
|
addUserApiToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<Pick<import("./ApiTokensState/interfaces").IApiTokensData, "description">, boolean>], import("..").WithCallback<Pick<import("./ApiTokensState/interfaces").IApiTokensData, "description">, boolean>, string, never, never>;
|
package/auth/reducer.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { TenantsActions } from './TenantsState';
|
|
|
16
16
|
import { RolesActions } from './RolesState';
|
|
17
17
|
import { ResetPhoneNumberActions } from './ResetPhoneNumberState';
|
|
18
18
|
import { SessionsActions } from './SessionsState';
|
|
19
|
-
declare const reducer: import("
|
|
19
|
+
declare const reducer: import("redux").Reducer<AuthState, import("redux").AnyAction>;
|
|
20
20
|
declare const actions: {
|
|
21
21
|
loadSessionsPolicy: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
22
22
|
createOrUpdateSessionsPolicy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").ISessionConfigurations, boolean>], import("..").WithCallback<import("@frontegg/rest-api").ISessionConfigurations, boolean>, string, never, never>;
|
|
@@ -82,6 +82,16 @@ declare const actions: {
|
|
|
82
82
|
}> | undefined)?], import("..").WithSilentLoad<{
|
|
83
83
|
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
84
84
|
}> | undefined, string, never, never>;
|
|
85
|
+
loadUserApiTokens: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("..").WithSilentLoad<{
|
|
86
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
87
|
+
}> | undefined)?], import("..").WithSilentLoad<{
|
|
88
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
89
|
+
}> | undefined, string, never, never>;
|
|
90
|
+
loadTenantApiTokens: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("..").WithSilentLoad<{
|
|
91
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
92
|
+
}> | undefined)?], import("..").WithSilentLoad<{
|
|
93
|
+
callback?: ((data: boolean | null, error?: string | undefined) => void) | undefined;
|
|
94
|
+
}> | undefined, string, never, never>;
|
|
85
95
|
initApiTokensData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").ApiTokenType], import(".").ApiTokenType, string, never, never>;
|
|
86
96
|
addTenantApiToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<Pick<import(".").ITenantApiTokensData, "description" | "roleIds">, boolean>], import("..").WithCallback<Pick<import(".").ITenantApiTokensData, "description" | "roleIds">, boolean>, string, never, never>;
|
|
87
97
|
addUserApiToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<Pick<import(".").IApiTokensData, "description">, boolean>], import("..").WithCallback<Pick<import(".").IApiTokensData, "description">, boolean>, string, never, never>;
|
package/connectivity/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare const _default: {
|
|
|
8
8
|
sagas: typeof sagas;
|
|
9
9
|
storeName: string;
|
|
10
10
|
initialState: import("./interfaces").IConnectivityState;
|
|
11
|
-
reducer: import("
|
|
11
|
+
reducer: import("redux").Reducer<import("./interfaces").IConnectivityState, import("redux").AnyAction>;
|
|
12
12
|
actions: {
|
|
13
13
|
loadSlackActions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
14
14
|
loadDataAction: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("./interfaces").TPlatform[] | undefined)?], import("./interfaces").TPlatform[] | undefined, string, never, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IConnectivityState } from './interfaces';
|
|
2
2
|
export declare const initialState: IConnectivityState;
|
|
3
|
-
declare const reducer: import("
|
|
3
|
+
declare const reducer: import("redux").Reducer<IConnectivityState, import("redux").AnyAction>;
|
|
4
4
|
declare const actions: {
|
|
5
5
|
loadSlackActions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
6
6
|
loadDataAction: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("./interfaces").TPlatform[] | undefined)?], import("./interfaces").TPlatform[] | undefined, string, never, never>;
|
package/connectivity/saga.js
CHANGED
|
@@ -8,8 +8,8 @@ import { channels, channels2Platform, type2ApiGet, type2ApiPost } from './consts
|
|
|
8
8
|
import { api } from '@frontegg/rest-api';
|
|
9
9
|
const addApi = ['categories', 'channelMap'];
|
|
10
10
|
|
|
11
|
-
function*
|
|
12
|
-
return yield loadFunction
|
|
11
|
+
function* loadPlatformData(ch) {
|
|
12
|
+
return yield call(loadFunction, {
|
|
13
13
|
payload: {
|
|
14
14
|
api: ch
|
|
15
15
|
},
|
|
@@ -25,13 +25,19 @@ function* loadDataFunction({
|
|
|
25
25
|
}));
|
|
26
26
|
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
const values = yield all([// @ts-ignore
|
|
30
|
+
...payload.map(loadPlatformData), // @ts-ignore
|
|
31
|
+
yield loadFunction({
|
|
29
32
|
payload: {
|
|
30
33
|
api: 'categories'
|
|
31
34
|
},
|
|
32
35
|
type: ''
|
|
33
|
-
}),
|
|
36
|
+
}), // @ts-ignore
|
|
37
|
+
yield function* () {
|
|
38
|
+
// @ts-ignore
|
|
34
39
|
const res = yield all(payload.map(function* (ch) {
|
|
40
|
+
// @ts-ignore
|
|
35
41
|
return yield loadFunction({
|
|
36
42
|
payload: {
|
|
37
43
|
api: 'channelMap',
|
|
@@ -43,7 +49,8 @@ function* loadDataFunction({
|
|
|
43
49
|
return res.reduce((acc, curr, idx) => _extends({}, acc, {
|
|
44
50
|
[`${payload[idx]}`]: curr
|
|
45
51
|
}), {});
|
|
46
|
-
}()]);
|
|
52
|
+
}()]); // @ts-ignore
|
|
53
|
+
|
|
47
54
|
const webhooks = yield loadFunction({
|
|
48
55
|
payload: {
|
|
49
56
|
api: 'webhook'
|
|
@@ -85,6 +92,8 @@ function* loadFunction({
|
|
|
85
92
|
}
|
|
86
93
|
}) {
|
|
87
94
|
try {
|
|
95
|
+
// TODO: [ Refactor Saga ] refactor mapping routes
|
|
96
|
+
// @ts-ignore
|
|
88
97
|
return yield call(type2ApiGet[api], params);
|
|
89
98
|
} catch (e) {
|
|
90
99
|
return undefined;
|
|
@@ -97,7 +106,9 @@ function* loadSlackFunction() {
|
|
|
97
106
|
slackChannels: {
|
|
98
107
|
isLoading: true
|
|
99
108
|
}
|
|
100
|
-
}));
|
|
109
|
+
})); // TODO: [Typescript 4.8] fix @frontegg/rest-api return value
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
|
|
101
112
|
const data = yield call(api.connectivity.getSlackChannels);
|
|
102
113
|
yield put(connectivityActions.setConnectivityState({
|
|
103
114
|
error: undefined,
|
|
@@ -169,6 +180,7 @@ function* postDataFunction({
|
|
|
169
180
|
}
|
|
170
181
|
|
|
171
182
|
if (!['sms', 'email'].includes(platform)) {
|
|
183
|
+
// @ts-ignore
|
|
172
184
|
const newData = yield loadFunction({
|
|
173
185
|
payload: {
|
|
174
186
|
api: platform
|
|
@@ -243,6 +255,7 @@ function* postSlackData({
|
|
|
243
255
|
|
|
244
256
|
return acc;
|
|
245
257
|
}, []).map(function* (el) {
|
|
258
|
+
// @ts-ignore
|
|
246
259
|
return yield call(type2ApiPost.slack, el);
|
|
247
260
|
}), ...slackSubscriptions.reduce((acc, curr) => {
|
|
248
261
|
if (curr.id && !curr.slackEvents[0].channelIds.length) {
|
|
@@ -251,6 +264,7 @@ function* postSlackData({
|
|
|
251
264
|
|
|
252
265
|
return acc;
|
|
253
266
|
}, []).map(function* (el) {
|
|
267
|
+
// @ts-ignore
|
|
254
268
|
return yield call(api.connectivity.deleteSlackConfiguration, el);
|
|
255
269
|
}) // clean the old data
|
|
256
270
|
// ...stateSlackSubscriptions
|
|
@@ -296,6 +310,8 @@ function* postEmailSMSData({
|
|
|
296
310
|
|
|
297
311
|
return acc;
|
|
298
312
|
}, []).map(function* (data) {
|
|
313
|
+
// TODO: [Typescript 4.8] fix @frontegg/rest-api return value
|
|
314
|
+
// @ts-ignore
|
|
299
315
|
return yield call(type === 'email' ? api.connectivity.postEmailConfiguration : api.connectivity.postSMSConfiguration, data);
|
|
300
316
|
}), // update exists
|
|
301
317
|
...payload.reduce((acc, curr) => {
|
|
@@ -319,12 +335,15 @@ function* postEmailSMSData({
|
|
|
319
335
|
id = '',
|
|
320
336
|
enabled
|
|
321
337
|
} = _subscriptions$,
|
|
322
|
-
body = _objectWithoutPropertiesLoose(_subscriptions$, _excluded2);
|
|
338
|
+
body = _objectWithoutPropertiesLoose(_subscriptions$, _excluded2); // @ts-ignore
|
|
323
339
|
|
|
324
|
-
|
|
340
|
+
|
|
341
|
+
return yield all([// @ts-ignore
|
|
342
|
+
yield call(type === 'email' ? api.connectivity.patchEmailConfiguration : api.connectivity.patchSMSConfiguration, {
|
|
325
343
|
eventKey,
|
|
326
344
|
enabled
|
|
327
|
-
}),
|
|
345
|
+
}), // @ts-ignore
|
|
346
|
+
yield call(type === 'email' ? api.connectivity.putEmailSubscriptions : api.connectivity.putSMSSubscriptions, id, eventKey, _extends({}, body, {
|
|
328
347
|
enabled
|
|
329
348
|
}))]);
|
|
330
349
|
}), // delete record with empty recipients
|
|
@@ -347,6 +366,7 @@ function* postEmailSMSData({
|
|
|
347
366
|
} catch {}
|
|
348
367
|
|
|
349
368
|
if (actionsResult.length) {
|
|
369
|
+
// @ts-ignore
|
|
350
370
|
const newData = yield loadFunction({
|
|
351
371
|
payload: {
|
|
352
372
|
api: type
|
|
@@ -439,7 +459,8 @@ function* deleteWebhookConfigFunction({
|
|
|
439
459
|
yield call(api.connectivity.deleteWebhooksConfiguration, webhookId);
|
|
440
460
|
} catch (e) {
|
|
441
461
|
callback == null ? void 0 : callback(null, e.message);
|
|
442
|
-
}
|
|
462
|
+
} // @ts-ignore
|
|
463
|
+
|
|
443
464
|
|
|
444
465
|
const newData = yield loadFunction({
|
|
445
466
|
payload: {
|
package/index.js
CHANGED
|
@@ -101,7 +101,10 @@ function* loadAuditsFunction({
|
|
|
101
101
|
rowsData: [...rowsData, ...data],
|
|
102
102
|
total
|
|
103
103
|
}));
|
|
104
|
-
|
|
104
|
+
|
|
105
|
+
if (onlyOneLoad) {
|
|
106
|
+
yield (0, _effects.put)(_reducer.actions.finishLoading());
|
|
107
|
+
}
|
|
105
108
|
} catch (e) {
|
|
106
109
|
const errorMessage = {
|
|
107
110
|
name: 'audits',
|
|
@@ -46,6 +46,12 @@ const actions = {
|
|
|
46
46
|
loadApiTokens: (0, _toolkit.createAction)(`${_constants.authStoreName}/loadApiTokens`, payload => ({
|
|
47
47
|
payload
|
|
48
48
|
})),
|
|
49
|
+
loadUserApiTokens: (0, _toolkit.createAction)(`${_constants.authStoreName}/loadUserApiTokens`, payload => ({
|
|
50
|
+
payload
|
|
51
|
+
})),
|
|
52
|
+
loadTenantApiTokens: (0, _toolkit.createAction)(`${_constants.authStoreName}/loadTenantApiTokens`, payload => ({
|
|
53
|
+
payload
|
|
54
|
+
})),
|
|
49
55
|
initApiTokensData: (0, _toolkit.createAction)(`${_constants.authStoreName}/initApiTokensData`, payload => ({
|
|
50
56
|
payload
|
|
51
57
|
})),
|