@acorex-platform/framework-client 0.0.61 → 0.0.63
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/fesm2022/acorex-platform-framework-client-auth.mjs +35 -8
- package/fesm2022/acorex-platform-framework-client-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-common.mjs +4 -4
- package/fesm2022/acorex-platform-framework-client-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-components.mjs +2 -2
- package/fesm2022/acorex-platform-framework-client-layout-components.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-D0jDsA6M.mjs → acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-BTWZPZdi.mjs} +8 -8
- package/fesm2022/acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-BTWZPZdi.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-entity-attachments-page.component-Bdvd1iYt.mjs → acorex-platform-framework-client-layout-entity-attachments-page.component-DfKVRQ4H.mjs} +2 -2
- package/fesm2022/{acorex-platform-framework-client-layout-entity-attachments-page.component-Bdvd1iYt.mjs.map → acorex-platform-framework-client-layout-entity-attachments-page.component-DfKVRQ4H.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-entity-bulk-entity.command-CsTP8YHv.mjs → acorex-platform-framework-client-layout-entity-bulk-entity.command-BoWGmORO.mjs} +2 -2
- package/fesm2022/{acorex-platform-framework-client-layout-entity-bulk-entity.command-CsTP8YHv.mjs.map → acorex-platform-framework-client-layout-entity-bulk-entity.command-BoWGmORO.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-entity-gallery-page.component-UvMk0GbU.mjs → acorex-platform-framework-client-layout-entity-gallery-page.component-Bt7qewAz.mjs} +2 -2
- package/fesm2022/{acorex-platform-framework-client-layout-entity-gallery-page.component-UvMk0GbU.mjs.map → acorex-platform-framework-client-layout-entity-gallery-page.component-Bt7qewAz.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity.mjs +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-acorex-platform-framework-client-layout-widgets-KrDsAa3H.mjs → acorex-platform-framework-client-layout-widgets-acorex-platform-framework-client-layout-widgets-dbA2oqec.mjs} +16 -7
- package/fesm2022/acorex-platform-framework-client-layout-widgets-acorex-platform-framework-client-layout-widgets-dbA2oqec.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-BDlo6nTx.mjs → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-CGzcXbHp.mjs} +2 -2
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-BDlo6nTx.mjs.map → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-CGzcXbHp.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-By3wntCB.mjs → acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-CdjBKzLK.mjs} +2 -2
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-By3wntCB.mjs.map → acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-CdjBKzLK.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs +1 -1
- package/package.json +2 -2
- package/types/acorex-platform-framework-client-layout-widgets.d.ts +9 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-D0jDsA6M.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets-acorex-platform-framework-client-layout-widgets-KrDsAa3H.mjs.map +0 -1
|
@@ -4,9 +4,9 @@ import { map, BehaviorSubject, shareReplay, defaultIfEmpty, switchMap, filter, d
|
|
|
4
4
|
import { AXPDebugService, AXPBroadcastEventService, AXP_SESSION_SERVICE, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, provideAppStartUpTask, AXP_APP_STARTUP_PRIORITY } from '@acorex-platform/framework-client/core';
|
|
5
5
|
import { Router } from '@angular/router';
|
|
6
6
|
import { isEmpty } from 'lodash-es';
|
|
7
|
+
import { coerceUnknownToTrimmedString, runtimeQueryCollectionData, runtimeQueryObjectData, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';
|
|
7
8
|
import { AXPCommandService, AXPQueryService } from '@acorex-platform/framework-client/runtime';
|
|
8
9
|
import { AUTH_LOGOUT_DEFAULT, AUTH_REFRESH_DEFAULT, AUTH_UPDATE_SESSION_DEFAULT, AUTH_LIST_OWN_DEVICE_SESSIONS_DEFAULT, AUTH_TERMINATE_OWN_DEVICE_SESSION_DEFAULT, AUTH_LIST_PROVIDERS_DEFAULT } from '@acorex-platform/framework-shared/runtime';
|
|
9
|
-
import { runtimeQueryCollectionData, runtimeQueryObjectData, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';
|
|
10
10
|
|
|
11
11
|
const AXP_APPLICATION_LOADER = new InjectionToken('AXP_APPLICATION_LOADER', {
|
|
12
12
|
providedIn: 'root',
|
|
@@ -555,6 +555,25 @@ function isDefinitiveAuthRefreshFailure(error) {
|
|
|
555
555
|
}
|
|
556
556
|
//#endregion
|
|
557
557
|
|
|
558
|
+
//#region ----- Imports -----
|
|
559
|
+
//#endregion
|
|
560
|
+
//#region ----- Session actor ids -----
|
|
561
|
+
/**
|
|
562
|
+
* Session contracts type actor ids as strings. Hosts may still send numeric ids.
|
|
563
|
+
* Returns the same reference when `id` is already a non-empty trimmed string.
|
|
564
|
+
*/
|
|
565
|
+
function normalizeSessionActorId(actor) {
|
|
566
|
+
if (actor == null) {
|
|
567
|
+
return actor;
|
|
568
|
+
}
|
|
569
|
+
const id = coerceUnknownToTrimmedString(actor.id);
|
|
570
|
+
if (!id || actor.id === id) {
|
|
571
|
+
return actor;
|
|
572
|
+
}
|
|
573
|
+
return { ...actor, id };
|
|
574
|
+
}
|
|
575
|
+
//#endregion
|
|
576
|
+
|
|
558
577
|
//#region ----- Soft restore authorization status -----
|
|
559
578
|
/**
|
|
560
579
|
* After soft restore: keep identity without promoting to Authorized when
|
|
@@ -982,7 +1001,6 @@ class AXPSessionService {
|
|
|
982
1001
|
this.clearCatalogCaches();
|
|
983
1002
|
this.permissionsSubject.next([]);
|
|
984
1003
|
this.featuresSubject.next([]);
|
|
985
|
-
this.currentUserSubject.next(result.data.user);
|
|
986
1004
|
this.setSession({
|
|
987
1005
|
strategy,
|
|
988
1006
|
user: result.data.user,
|
|
@@ -1051,7 +1069,6 @@ class AXPSessionService {
|
|
|
1051
1069
|
this.featuresSubject.next([]);
|
|
1052
1070
|
this.invalidateAccessPolicyCache();
|
|
1053
1071
|
}
|
|
1054
|
-
this.currentUserSubject.next(result.data.user);
|
|
1055
1072
|
this.setSession({
|
|
1056
1073
|
strategy: strategyName,
|
|
1057
1074
|
user: result.data.user,
|
|
@@ -1381,24 +1398,29 @@ class AXPSessionService {
|
|
|
1381
1398
|
this.status.next(AXPSessionStatus.Authenticated);
|
|
1382
1399
|
}
|
|
1383
1400
|
setSession(partial) {
|
|
1384
|
-
const existing = this.getSessionData() ?? {
|
|
1401
|
+
const existing = this.getSessionData() ?? {
|
|
1402
|
+
strategy: partial.strategy ?? 'user-pass',
|
|
1403
|
+
};
|
|
1385
1404
|
const sessionData = {
|
|
1386
1405
|
...existing,
|
|
1387
1406
|
...partial,
|
|
1388
1407
|
strategy: partial.strategy ?? existing.strategy ?? 'user-pass',
|
|
1408
|
+
user: normalizeSessionActorId('user' in partial ? partial.user : existing.user),
|
|
1409
|
+
tenant: normalizeSessionActorId('tenant' in partial ? partial.tenant : existing.tenant),
|
|
1410
|
+
application: normalizeSessionActorId('application' in partial ? partial.application : existing.application),
|
|
1389
1411
|
};
|
|
1390
1412
|
// Never persist tokens in browser storage — HttpOnly cookies are authoritative.
|
|
1391
1413
|
delete sessionData.accessToken;
|
|
1392
1414
|
delete sessionData.refreshToken;
|
|
1393
1415
|
delete sessionData.idToken;
|
|
1394
1416
|
if (partial.user) {
|
|
1395
|
-
this.currentUserSubject.next(
|
|
1417
|
+
this.currentUserSubject.next(sessionData.user ?? null);
|
|
1396
1418
|
}
|
|
1397
1419
|
if ('tenant' in partial) {
|
|
1398
|
-
this.currentTenantSubject.next(
|
|
1420
|
+
this.currentTenantSubject.next(sessionData.tenant ?? null);
|
|
1399
1421
|
}
|
|
1400
1422
|
if ('application' in partial) {
|
|
1401
|
-
this.currentApplicationSubject.next(
|
|
1423
|
+
this.currentApplicationSubject.next(sessionData.application ?? null);
|
|
1402
1424
|
}
|
|
1403
1425
|
localStorage.setItem(AXPSessionService.SESSION_KEY, JSON.stringify(sessionData));
|
|
1404
1426
|
}
|
|
@@ -1434,7 +1456,12 @@ class AXPSessionService {
|
|
|
1434
1456
|
const sessionDataString = localStorage.getItem(AXPSessionService.SESSION_KEY);
|
|
1435
1457
|
if (sessionDataString) {
|
|
1436
1458
|
const sessionData = JSON.parse(sessionDataString);
|
|
1437
|
-
return
|
|
1459
|
+
return {
|
|
1460
|
+
...sessionData,
|
|
1461
|
+
user: normalizeSessionActorId(sessionData.user),
|
|
1462
|
+
tenant: normalizeSessionActorId(sessionData.tenant),
|
|
1463
|
+
application: normalizeSessionActorId(sessionData.application),
|
|
1464
|
+
};
|
|
1438
1465
|
}
|
|
1439
1466
|
else {
|
|
1440
1467
|
return null;
|