@acorex/platform 21.0.0-next.72 → 21.0.0-next.73
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/contracts/README.md +3 -0
- package/fesm2022/acorex-platform-auth.mjs +72 -58
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +12 -6
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-contracts.mjs +10 -0
- package/fesm2022/acorex-platform-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-core.mjs +15 -12
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +3 -0
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +185 -8
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +64 -44
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +11 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widgets.mjs +279 -108
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +4 -4
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-BjuzSe0T.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +3 -0
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +57 -54
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/package.json +5 -1
- package/types/acorex-platform-auth.d.ts +29 -22
- package/types/acorex-platform-common.d.ts +7 -6
- package/types/acorex-platform-contracts.d.ts +39 -0
- package/types/acorex-platform-core.d.ts +8 -8
- package/types/acorex-platform-layout-components.d.ts +77 -7
- package/types/acorex-platform-layout-entity.d.ts +185 -175
- package/types/acorex-platform-layout-widget-core.d.ts +3 -1
- package/types/acorex-platform-layout-widgets.d.ts +45 -45
|
@@ -39,6 +39,60 @@ class AXPApplicationDefaultLoader {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
//#region ---- Datasource keys ----
|
|
43
|
+
/** Platform auth datasource registry names. */
|
|
44
|
+
const AXPPlatformAuthDataSourceKeys = {
|
|
45
|
+
PermissionDefinitions: 'platform-permission-definitions',
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
|
|
49
|
+
class AXPUnauthorizedError extends Error {
|
|
50
|
+
constructor(message, data) {
|
|
51
|
+
super(message);
|
|
52
|
+
this.data = data;
|
|
53
|
+
this.name = 'AXPUnauthorizedError';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
class AXPUnauthenticatedError extends Error {
|
|
57
|
+
constructor(message, data) {
|
|
58
|
+
super(message);
|
|
59
|
+
this.data = data;
|
|
60
|
+
this.name = 'AXPUnauthenticatedError';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
class AXPSessionContext {
|
|
65
|
+
get user() {
|
|
66
|
+
return this._user;
|
|
67
|
+
}
|
|
68
|
+
get tenant() {
|
|
69
|
+
return this._tenant;
|
|
70
|
+
}
|
|
71
|
+
get application() {
|
|
72
|
+
return this._application;
|
|
73
|
+
}
|
|
74
|
+
constructor(context) {
|
|
75
|
+
this._user = null;
|
|
76
|
+
this._tenant = null;
|
|
77
|
+
this._application = null;
|
|
78
|
+
this._user = context.user;
|
|
79
|
+
this._tenant = context.tenant;
|
|
80
|
+
this._application = context.application;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
var AXPSessionStatus;
|
|
84
|
+
(function (AXPSessionStatus) {
|
|
85
|
+
AXPSessionStatus["Authenticated"] = "authenticated";
|
|
86
|
+
AXPSessionStatus["Unauthenticated"] = "unauthenticated";
|
|
87
|
+
AXPSessionStatus["Unauthorized"] = "unauthorized";
|
|
88
|
+
AXPSessionStatus["Authorized"] = "authorized";
|
|
89
|
+
AXPSessionStatus["Expired"] = "expired";
|
|
90
|
+
AXPSessionStatus["SignedOut"] = "signedOut";
|
|
91
|
+
})(AXPSessionStatus || (AXPSessionStatus = {}));
|
|
92
|
+
|
|
93
|
+
//#region ---- Contracts barrel ----
|
|
94
|
+
//#endregion
|
|
95
|
+
|
|
42
96
|
const AXP_TENANT_LOADER = new InjectionToken('AXP_TENANT_LOADER', {
|
|
43
97
|
providedIn: 'root',
|
|
44
98
|
factory: () => {
|
|
@@ -149,21 +203,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
149
203
|
type: Input
|
|
150
204
|
}] } });
|
|
151
205
|
|
|
152
|
-
class AXPUnauthorizedError extends Error {
|
|
153
|
-
constructor(message, data) {
|
|
154
|
-
super(message);
|
|
155
|
-
this.data = data;
|
|
156
|
-
this.name = 'AXPUnauthorizedError';
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
class AXPUnauthenticatedError extends Error {
|
|
160
|
-
constructor(message, data) {
|
|
161
|
-
super(message);
|
|
162
|
-
this.data = data;
|
|
163
|
-
this.name = 'AXPUnauthenticatedError';
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
206
|
const AXPFeatureGuard = (route, state) => {
|
|
168
207
|
const sessionService = inject(AXPSessionService);
|
|
169
208
|
const requiredFeatures = route.data['requiredFeature'];
|
|
@@ -205,35 +244,6 @@ class AXPPermissionDefaultLoader {
|
|
|
205
244
|
*/
|
|
206
245
|
const AXP_PERMISSION_CHECKER = new InjectionToken('AXP_PERMISSION_CHECKER');
|
|
207
246
|
|
|
208
|
-
class AXPSessionContext {
|
|
209
|
-
get user() {
|
|
210
|
-
return this._user;
|
|
211
|
-
}
|
|
212
|
-
get tenant() {
|
|
213
|
-
return this._tenant;
|
|
214
|
-
}
|
|
215
|
-
get application() {
|
|
216
|
-
return this._application;
|
|
217
|
-
}
|
|
218
|
-
constructor(context) {
|
|
219
|
-
this._user = null;
|
|
220
|
-
this._tenant = null;
|
|
221
|
-
this._application = null;
|
|
222
|
-
this._user = context.user;
|
|
223
|
-
this._tenant = context.tenant;
|
|
224
|
-
this._application = context.application;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
var AXPSessionStatus;
|
|
228
|
-
(function (AXPSessionStatus) {
|
|
229
|
-
AXPSessionStatus["Authenticated"] = "authenticated";
|
|
230
|
-
AXPSessionStatus["Unauthenticated"] = "unauthenticated";
|
|
231
|
-
AXPSessionStatus["Unauthorized"] = "unauthorized";
|
|
232
|
-
AXPSessionStatus["Authorized"] = "authorized";
|
|
233
|
-
AXPSessionStatus["Expired"] = "expired";
|
|
234
|
-
AXPSessionStatus["SignedOut"] = "signedOut";
|
|
235
|
-
})(AXPSessionStatus || (AXPSessionStatus = {}));
|
|
236
|
-
|
|
237
247
|
class AXPSessionService {
|
|
238
248
|
constructor() {
|
|
239
249
|
this.eventService = inject(AXPBroadcastEventService);
|
|
@@ -373,6 +383,7 @@ class AXPSessionService {
|
|
|
373
383
|
tenant: result.data?.tenant,
|
|
374
384
|
expiresIn: result.data?.expiresIn,
|
|
375
385
|
idToken: result.data?.idToken ?? null,
|
|
386
|
+
locked: false,
|
|
376
387
|
});
|
|
377
388
|
await this.loadPermissions();
|
|
378
389
|
await this.loadFeatures();
|
|
@@ -532,15 +543,10 @@ class AXPSessionService {
|
|
|
532
543
|
}, 100);
|
|
533
544
|
}
|
|
534
545
|
setSession(tokens) {
|
|
546
|
+
const existing = this.getSessionData() ?? {};
|
|
535
547
|
const sessionData = {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
strategy: tokens.strategy,
|
|
539
|
-
user: tokens.user,
|
|
540
|
-
application: tokens.application,
|
|
541
|
-
tenant: tokens.tenant,
|
|
542
|
-
expiresIn: tokens.expiresIn,
|
|
543
|
-
idToken: tokens.idToken,
|
|
548
|
+
...existing,
|
|
549
|
+
...tokens,
|
|
544
550
|
};
|
|
545
551
|
// Update subjects
|
|
546
552
|
if (tokens.user) {
|
|
@@ -554,6 +560,18 @@ class AXPSessionService {
|
|
|
554
560
|
}
|
|
555
561
|
localStorage.setItem(AXPSessionService.SESSION_KEY, JSON.stringify(sessionData));
|
|
556
562
|
}
|
|
563
|
+
/** Whether the client lock overlay should remain active after reload. */
|
|
564
|
+
isLocked() {
|
|
565
|
+
return this.getSessionData()?.locked === true;
|
|
566
|
+
}
|
|
567
|
+
/** Persists client lock state inside {@link AXPSessionService.SESSION_KEY}. */
|
|
568
|
+
setLocked(locked) {
|
|
569
|
+
const existing = this.getSessionData();
|
|
570
|
+
if (!existing) {
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
this.setSession({ locked });
|
|
574
|
+
}
|
|
557
575
|
setStrategy(strategy) {
|
|
558
576
|
const sessionData = this.getSessionData();
|
|
559
577
|
const newSessionData = { ...sessionData, strategy };
|
|
@@ -929,10 +947,6 @@ function flattenPermissionDefinitions(nodes, groupPrefix) {
|
|
|
929
947
|
}
|
|
930
948
|
//#endregion
|
|
931
949
|
//#region ---- Permission definitions data source ----
|
|
932
|
-
/**
|
|
933
|
-
* Registered permission definitions for select widgets via dataSource name {@link PERMISSION_DEFINITIONS_DATASOURCE_NAME}.
|
|
934
|
-
*/
|
|
935
|
-
const PERMISSION_DEFINITIONS_DATASOURCE_NAME = 'platform-permission-definitions';
|
|
936
950
|
/**
|
|
937
951
|
* Data source definition for leaf permissions from {@link AXPPermissionDefinitionService#getGroups}.
|
|
938
952
|
*/
|
|
@@ -947,7 +961,7 @@ class AXPPermissionDefinitionsDataSourceDefinition {
|
|
|
947
961
|
async items() {
|
|
948
962
|
return [
|
|
949
963
|
{
|
|
950
|
-
name:
|
|
964
|
+
name: AXPPlatformAuthDataSourceKeys.PermissionDefinitions,
|
|
951
965
|
title: 'Permissions',
|
|
952
966
|
source: () => new AXDataSource({
|
|
953
967
|
key: 'id',
|
|
@@ -1370,5 +1384,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1370
1384
|
* Generated bundle index. Do not edit.
|
|
1371
1385
|
*/
|
|
1372
1386
|
|
|
1373
|
-
export { AXPAuthGuard, AXPAuthModule, AXPAuthStrategy, AXPAuthStrategyRegistryService, AXPFeatureDirective, AXPFeatureGuard, AXPLoginChallengeComponentBase, AXPLoginChallengeProvider, AXPPermissionDefinitionBuilder, AXPPermissionDefinitionGroupBuilder, AXPPermissionDefinitionProviderContext, AXPPermissionDefinitionService, AXPPermissionDefinitionsDataSourceDefinition, AXPPermissionDirective, AXPPermissionEvaluatorScopeProvider, AXPPermissionGuard, AXPSessionContext, AXPSessionService, AXPSessionStatus, AXPUnauthenticatedError, AXPUnauthorizedError, AXP_APPLICATION_LOADER, AXP_FEATURE_CHECKER, AXP_FEATURE_LOADER, AXP_LOGIN_CHALLENGE_PROVIDER, AXP_PERMISSION_CHECKER, AXP_PERMISSION_DEFINITION_PROVIDER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER, JwtUtil,
|
|
1387
|
+
export { AXPAuthGuard, AXPAuthModule, AXPAuthStrategy, AXPAuthStrategyRegistryService, AXPFeatureDirective, AXPFeatureGuard, AXPLoginChallengeComponentBase, AXPLoginChallengeProvider, AXPPermissionDefinitionBuilder, AXPPermissionDefinitionGroupBuilder, AXPPermissionDefinitionProviderContext, AXPPermissionDefinitionService, AXPPermissionDefinitionsDataSourceDefinition, AXPPermissionDirective, AXPPermissionEvaluatorScopeProvider, AXPPermissionGuard, AXPPlatformAuthDataSourceKeys, AXPSessionContext, AXPSessionService, AXPSessionStatus, AXPUnauthenticatedError, AXPUnauthorizedError, AXP_APPLICATION_LOADER, AXP_FEATURE_CHECKER, AXP_FEATURE_LOADER, AXP_LOGIN_CHALLENGE_PROVIDER, AXP_PERMISSION_CHECKER, AXP_PERMISSION_DEFINITION_PROVIDER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER, JwtUtil, PkceUtil, TimeUtil, initializeAppState };
|
|
1374
1388
|
//# sourceMappingURL=acorex-platform-auth.mjs.map
|