@frontegg/redux-store 6.105.0-alpha.2 → 6.105.0-alpha.3
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/MSP/AllAccountsState/allAccountsDialogsState.d.ts +3 -0
- package/auth/MSP/AllAccountsState/saga.js +25 -3
- package/auth/MSP/AllAccountsState/types/dialogsStateTypes.d.ts +1 -0
- package/auth/MSP/AllAccountsState/types/stateTypes.d.ts +3 -0
- package/auth/index.d.ts +2 -0
- package/auth/reducer.d.ts +2 -0
- package/index.js +1 -1
- package/node/auth/MSP/AllAccountsState/saga.js +25 -3
- package/node/index.js +1 -1
- package/package.json +2 -2
|
@@ -301,11 +301,13 @@ declare const reducers: {
|
|
|
301
301
|
accountName?: string | undefined;
|
|
302
302
|
accountId?: string | undefined;
|
|
303
303
|
parentAccountId?: string | undefined;
|
|
304
|
+
isParentAccount?: boolean | undefined;
|
|
304
305
|
}, boolean>>) => {
|
|
305
306
|
payload: Partial<import("../../../interfaces").WithCallback<import("./types").TUserJwtPayload & import("./types").BaseAllAccountsDialogState & {
|
|
306
307
|
accountName?: string | undefined;
|
|
307
308
|
accountId?: string | undefined;
|
|
308
309
|
parentAccountId?: string | undefined;
|
|
310
|
+
isParentAccount?: boolean | undefined;
|
|
309
311
|
}, boolean>>;
|
|
310
312
|
};
|
|
311
313
|
reducer: (state: import("../..").AuthState, { payload }: {
|
|
@@ -313,6 +315,7 @@ declare const reducers: {
|
|
|
313
315
|
accountName?: string | undefined;
|
|
314
316
|
accountId?: string | undefined;
|
|
315
317
|
parentAccountId?: string | undefined;
|
|
318
|
+
isParentAccount?: boolean | undefined;
|
|
316
319
|
}, boolean>>;
|
|
317
320
|
type: string;
|
|
318
321
|
}) => {
|
|
@@ -249,7 +249,12 @@ function* createSubAccount({
|
|
|
249
249
|
const updatedSingleAccountViewAccounts = appendChildrenToNode(_extends({
|
|
250
250
|
name: '',
|
|
251
251
|
tenantId: ''
|
|
252
|
-
}, selectedAccount == null ? void 0 : selectedAccount.accounts), parentTenantId != null ? parentTenantId : '', [
|
|
252
|
+
}, selectedAccount == null ? void 0 : selectedAccount.accounts), parentTenantId != null ? parentTenantId : '', [{
|
|
253
|
+
name: createdSubTenant.name,
|
|
254
|
+
tenantId: createdSubTenant.tenantId,
|
|
255
|
+
numberOfUsers: 0,
|
|
256
|
+
createdAt: new Date()
|
|
257
|
+
}]);
|
|
253
258
|
yield put(actions.setSelectedAccountState({
|
|
254
259
|
accounts: updatedSingleAccountViewAccounts
|
|
255
260
|
}));
|
|
@@ -262,7 +267,12 @@ function* createSubAccount({
|
|
|
262
267
|
tenantId,
|
|
263
268
|
parentTenantId
|
|
264
269
|
});
|
|
265
|
-
const updatedAccounts = appendChildrenToNode(accounts, parentTenantId != null ? parentTenantId : '', [
|
|
270
|
+
const updatedAccounts = appendChildrenToNode(accounts, parentTenantId != null ? parentTenantId : '', [{
|
|
271
|
+
name: createdSubTenant.name,
|
|
272
|
+
tenantId: createdSubTenant.tenantId,
|
|
273
|
+
numberOfUsers: 0,
|
|
274
|
+
createdAt: new Date()
|
|
275
|
+
}]);
|
|
266
276
|
yield put(actions.setAllAccountsState({
|
|
267
277
|
accounts: updatedAccounts
|
|
268
278
|
}));
|
|
@@ -358,7 +368,8 @@ function* updateSubAccountSettings({
|
|
|
358
368
|
const isSelectedAccountChange = !!jwt;
|
|
359
369
|
if (isSelectedAccountChange) {
|
|
360
370
|
const {
|
|
361
|
-
selectedAccount
|
|
371
|
+
selectedAccount,
|
|
372
|
+
accounts
|
|
362
373
|
} = yield selectAllAccountsState();
|
|
363
374
|
yield call(api.subTenants.updateSubTenant, {
|
|
364
375
|
tenantId
|
|
@@ -372,6 +383,10 @@ function* updateSubAccountSettings({
|
|
|
372
383
|
name,
|
|
373
384
|
accounts: udpatedAccs
|
|
374
385
|
}));
|
|
386
|
+
const udpatedAccsForAllAccountsPage = updateNodeName(accounts, tenantId, name);
|
|
387
|
+
yield put(actions.setAllAccountsState({
|
|
388
|
+
accounts: udpatedAccsForAllAccountsPage
|
|
389
|
+
}));
|
|
375
390
|
} else {
|
|
376
391
|
const {
|
|
377
392
|
accounts
|
|
@@ -457,12 +472,19 @@ function* setUserRolesForSubAccount({
|
|
|
457
472
|
jwt,
|
|
458
473
|
callback
|
|
459
474
|
} = payload;
|
|
475
|
+
const {
|
|
476
|
+
selectedAccount
|
|
477
|
+
} = yield selectAllAccountsState();
|
|
460
478
|
try {
|
|
461
479
|
yield call(api.subTenants.setUserRolesForSubTenants, userId, {
|
|
462
480
|
subTenantsRoles
|
|
463
481
|
}, {
|
|
464
482
|
jwt
|
|
465
483
|
});
|
|
484
|
+
yield put(actions.getAccountUsers({
|
|
485
|
+
jwt,
|
|
486
|
+
_tenantId: selectedAccount.tenantId
|
|
487
|
+
}));
|
|
466
488
|
callback == null ? void 0 : callback(true);
|
|
467
489
|
} catch (e) {
|
|
468
490
|
yield put(actions.setAllAccountsError({
|
|
@@ -20,6 +20,7 @@ export declare type TDeleteSubAccountDialogState = WithCallback<TUserJwtPayload
|
|
|
20
20
|
accountName?: string;
|
|
21
21
|
accountId?: string;
|
|
22
22
|
parentAccountId?: string;
|
|
23
|
+
isParentAccount?: boolean;
|
|
23
24
|
}>;
|
|
24
25
|
export declare type TAddUsersToSubAccountDialogState = TUserJwtPayload & BaseAllAccountsDialogState & {
|
|
25
26
|
accountName?: string;
|
package/auth/index.d.ts
CHANGED
|
@@ -528,10 +528,12 @@ declare const _default: {
|
|
|
528
528
|
accountName?: string | undefined;
|
|
529
529
|
accountId?: string | undefined;
|
|
530
530
|
parentAccountId?: string | undefined;
|
|
531
|
+
isParentAccount?: boolean | undefined;
|
|
531
532
|
}, boolean>>], Partial<import("..").WithCallback<import("./MSP/AllAccountsState").TUserJwtPayload & import("./MSP/AllAccountsState").BaseAllAccountsDialogState & {
|
|
532
533
|
accountName?: string | undefined;
|
|
533
534
|
accountId?: string | undefined;
|
|
534
535
|
parentAccountId?: string | undefined;
|
|
536
|
+
isParentAccount?: boolean | undefined;
|
|
535
537
|
}, boolean>>, string, never, never>;
|
|
536
538
|
closeDeleteSubAccountDialog: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
537
539
|
openAddUsersToAccountDialog: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./MSP/AllAccountsState").TAddUsersToSubAccountDialogState>], Partial<import("./MSP/AllAccountsState").TAddUsersToSubAccountDialogState>, string, never, never>;
|
package/auth/reducer.d.ts
CHANGED
|
@@ -489,10 +489,12 @@ declare const actions: {
|
|
|
489
489
|
accountName?: string | undefined;
|
|
490
490
|
accountId?: string | undefined;
|
|
491
491
|
parentAccountId?: string | undefined;
|
|
492
|
+
isParentAccount?: boolean | undefined;
|
|
492
493
|
}, boolean>>], Partial<import("..").WithCallback<import("./MSP/AllAccountsState").TUserJwtPayload & import("./MSP/AllAccountsState").BaseAllAccountsDialogState & {
|
|
493
494
|
accountName?: string | undefined;
|
|
494
495
|
accountId?: string | undefined;
|
|
495
496
|
parentAccountId?: string | undefined;
|
|
497
|
+
isParentAccount?: boolean | undefined;
|
|
496
498
|
}, boolean>>, string, never, never>;
|
|
497
499
|
closeDeleteSubAccountDialog: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
498
500
|
openAddUsersToAccountDialog: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./MSP/AllAccountsState").TAddUsersToSubAccountDialogState>], Partial<import("./MSP/AllAccountsState").TAddUsersToSubAccountDialogState>, string, never, never>;
|
package/index.js
CHANGED
|
@@ -260,7 +260,12 @@ function* createSubAccount({
|
|
|
260
260
|
const updatedSingleAccountViewAccounts = (0, _appendChildrenToNode.appendChildrenToNode)((0, _extends2.default)({
|
|
261
261
|
name: '',
|
|
262
262
|
tenantId: ''
|
|
263
|
-
}, selectedAccount == null ? void 0 : selectedAccount.accounts), parentTenantId != null ? parentTenantId : '', [
|
|
263
|
+
}, selectedAccount == null ? void 0 : selectedAccount.accounts), parentTenantId != null ? parentTenantId : '', [{
|
|
264
|
+
name: createdSubTenant.name,
|
|
265
|
+
tenantId: createdSubTenant.tenantId,
|
|
266
|
+
numberOfUsers: 0,
|
|
267
|
+
createdAt: new Date()
|
|
268
|
+
}]);
|
|
264
269
|
yield (0, _effects.put)(_reducer.actions.setSelectedAccountState({
|
|
265
270
|
accounts: updatedSingleAccountViewAccounts
|
|
266
271
|
}));
|
|
@@ -273,7 +278,12 @@ function* createSubAccount({
|
|
|
273
278
|
tenantId,
|
|
274
279
|
parentTenantId
|
|
275
280
|
});
|
|
276
|
-
const updatedAccounts = (0, _appendChildrenToNode.appendChildrenToNode)(accounts, parentTenantId != null ? parentTenantId : '', [
|
|
281
|
+
const updatedAccounts = (0, _appendChildrenToNode.appendChildrenToNode)(accounts, parentTenantId != null ? parentTenantId : '', [{
|
|
282
|
+
name: createdSubTenant.name,
|
|
283
|
+
tenantId: createdSubTenant.tenantId,
|
|
284
|
+
numberOfUsers: 0,
|
|
285
|
+
createdAt: new Date()
|
|
286
|
+
}]);
|
|
277
287
|
yield (0, _effects.put)(_reducer.actions.setAllAccountsState({
|
|
278
288
|
accounts: updatedAccounts
|
|
279
289
|
}));
|
|
@@ -369,7 +379,8 @@ function* updateSubAccountSettings({
|
|
|
369
379
|
const isSelectedAccountChange = !!jwt;
|
|
370
380
|
if (isSelectedAccountChange) {
|
|
371
381
|
const {
|
|
372
|
-
selectedAccount
|
|
382
|
+
selectedAccount,
|
|
383
|
+
accounts
|
|
373
384
|
} = yield selectAllAccountsState();
|
|
374
385
|
yield (0, _effects.call)(_restApi.api.subTenants.updateSubTenant, {
|
|
375
386
|
tenantId
|
|
@@ -383,6 +394,10 @@ function* updateSubAccountSettings({
|
|
|
383
394
|
name,
|
|
384
395
|
accounts: udpatedAccs
|
|
385
396
|
}));
|
|
397
|
+
const udpatedAccsForAllAccountsPage = (0, _updateNodeName.updateNodeName)(accounts, tenantId, name);
|
|
398
|
+
yield (0, _effects.put)(_reducer.actions.setAllAccountsState({
|
|
399
|
+
accounts: udpatedAccsForAllAccountsPage
|
|
400
|
+
}));
|
|
386
401
|
} else {
|
|
387
402
|
const {
|
|
388
403
|
accounts
|
|
@@ -468,12 +483,19 @@ function* setUserRolesForSubAccount({
|
|
|
468
483
|
jwt,
|
|
469
484
|
callback
|
|
470
485
|
} = payload;
|
|
486
|
+
const {
|
|
487
|
+
selectedAccount
|
|
488
|
+
} = yield selectAllAccountsState();
|
|
471
489
|
try {
|
|
472
490
|
yield (0, _effects.call)(_restApi.api.subTenants.setUserRolesForSubTenants, userId, {
|
|
473
491
|
subTenantsRoles
|
|
474
492
|
}, {
|
|
475
493
|
jwt
|
|
476
494
|
});
|
|
495
|
+
yield (0, _effects.put)(_reducer.actions.getAccountUsers({
|
|
496
|
+
jwt,
|
|
497
|
+
_tenantId: selectedAccount.tenantId
|
|
498
|
+
}));
|
|
477
499
|
callback == null ? void 0 : callback(true);
|
|
478
500
|
} catch (e) {
|
|
479
501
|
yield (0, _effects.put)(_reducer.actions.setAllAccountsError({
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "6.105.0-alpha.
|
|
3
|
+
"version": "6.105.0-alpha.3",
|
|
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
|
-
"@frontegg/rest-api": "^3.0.
|
|
9
|
+
"@frontegg/rest-api": "^3.0.118",
|
|
10
10
|
"@reduxjs/toolkit": "1.8.5",
|
|
11
11
|
"redux-saga": "^1.2.1",
|
|
12
12
|
"uuid": "^8.3.2"
|