@acorex/platform 21.0.0-next.3 → 21.0.0-next.33
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-auth.mjs +295 -45
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/{acorex-platform-common-common-settings.provider-zhqNP3xb.mjs → acorex-platform-common-common-settings.provider-G9XcXXOG.mjs} +60 -4
- package/fesm2022/acorex-platform-common-common-settings.provider-G9XcXXOG.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +960 -319
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +1352 -832
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +554 -826
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +530 -154
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs +121 -0
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-components.mjs +5969 -2347
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +169 -154
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +15380 -9274
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +393 -110
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +511 -450
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs → acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs} +10 -10
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs → acorex-platform-layout-widgets-file-list-popup.component-9uCkMxcc.mjs} +39 -16
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-9uCkMxcc.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs → acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs} +6 -7
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs → acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs} +12 -12
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGQqY5Mw.mjs +111 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGQqY5Mw.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs} +6 -6
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs} +5 -5
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs} +6 -6
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +7865 -4026
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-native.mjs +8 -7
- package/fesm2022/acorex-platform-native.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +220 -169
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cvvr4HnL.mjs +160 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cvvr4HnL.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-TYoLN1Jq.mjs +120 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-TYoLN1Jq.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs → acorex-platform-themes-default-entity-master-single-view.component-C2z5Lq9y.mjs} +18 -25
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-C2z5Lq9y.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-401.component-cfREo88K.mjs → acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs → acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs +19 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +1717 -66
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs → acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs} +6 -6
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs → acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs} +6 -6
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-CHfrTtol.mjs} +11 -11
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-CHfrTtol.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-BSmvnUVq.mjs} +9 -9
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BSmvnUVq.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +563 -561
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +1735 -1750
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/fesm2022/acorex-platform.mjs.map +1 -1
- package/package.json +31 -31
- package/{auth/index.d.ts → types/acorex-platform-auth.d.ts} +247 -10
- package/{common/index.d.ts → types/acorex-platform-common.d.ts} +492 -31
- package/{core/index.d.ts → types/acorex-platform-core.d.ts} +606 -392
- package/{domain/index.d.ts → types/acorex-platform-domain.d.ts} +719 -413
- package/{layout/builder/index.d.ts → types/acorex-platform-layout-builder.d.ts} +128 -56
- package/types/acorex-platform-layout-components.d.ts +2927 -0
- package/{layout/designer/index.d.ts → types/acorex-platform-layout-designer.d.ts} +9 -3
- package/{layout/entity/index.d.ts → types/acorex-platform-layout-entity.d.ts} +1133 -237
- package/{layout/views/index.d.ts → types/acorex-platform-layout-views.d.ts} +90 -31
- package/{layout/widget-core/index.d.ts → types/acorex-platform-layout-widget-core.d.ts} +206 -102
- package/{layout/widgets/index.d.ts → types/acorex-platform-layout-widgets.d.ts} +942 -137
- package/{native/index.d.ts → types/acorex-platform-native.d.ts} +0 -7
- package/{runtime/index.d.ts → types/acorex-platform-runtime.d.ts} +237 -74
- package/{themes/default/index.d.ts → types/acorex-platform-themes-default.d.ts} +113 -5
- package/{themes/shared/index.d.ts → types/acorex-platform-themes-shared.d.ts} +1 -1
- package/types/acorex-platform-workflow.d.ts +1806 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs +0 -157
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs +0 -1542
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-401.component-cfREo88K.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs +0 -19
- package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs.map +0 -1
- package/layout/components/index.d.ts +0 -1669
- package/workflow/index.d.ts +0 -2443
- /package/{index.d.ts → types/acorex-platform.d.ts} +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injector, Injectable, signal, inject, Input, Directive, provideAppInitializer, Optional, Inject, NgModule } from '@angular/core';
|
|
3
|
-
import { AXPBroadcastEventService,
|
|
2
|
+
import { InjectionToken, Injector, Injectable, signal, inject, Input, Directive, provideAppInitializer, Optional, Inject, NgModule, input, output, Component } from '@angular/core';
|
|
3
|
+
import { AXPBroadcastEventService, AXP_SESSION_SERVICE } from '@acorex/platform/core';
|
|
4
4
|
import { isEmpty } from 'lodash-es';
|
|
5
5
|
import { map, BehaviorSubject, shareReplay, defaultIfEmpty, switchMap, filter, from, first } from 'rxjs';
|
|
6
|
+
import { AXDataSource } from '@acorex/cdk/common';
|
|
7
|
+
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
|
|
6
8
|
|
|
7
9
|
const AXP_APPLICATION_LOADER = new InjectionToken('AXP_APPLICATION_LOADER', {
|
|
8
10
|
providedIn: 'root',
|
|
@@ -72,10 +74,10 @@ class AXPAuthStrategyRegistryService {
|
|
|
72
74
|
get(strategyKey) {
|
|
73
75
|
return this.strategies.get(strategyKey);
|
|
74
76
|
}
|
|
75
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
76
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
77
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthStrategyRegistryService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
78
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthStrategyRegistryService, providedIn: 'root' }); }
|
|
77
79
|
}
|
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthStrategyRegistryService, decorators: [{
|
|
79
81
|
type: Injectable,
|
|
80
82
|
args: [{
|
|
81
83
|
providedIn: 'root'
|
|
@@ -98,7 +100,7 @@ class AXPFeatureDirective {
|
|
|
98
100
|
constructor(templateRef, viewContainer) {
|
|
99
101
|
this.templateRef = templateRef;
|
|
100
102
|
this.viewContainer = viewContainer;
|
|
101
|
-
this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : []));
|
|
103
|
+
this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : /* istanbul ignore next */ []));
|
|
102
104
|
this.sessionService = inject(AXPSessionService);
|
|
103
105
|
}
|
|
104
106
|
set feature(featureKeys) {
|
|
@@ -132,10 +134,10 @@ class AXPFeatureDirective {
|
|
|
132
134
|
ngOnDestroy() {
|
|
133
135
|
this.subscription?.unsubscribe();
|
|
134
136
|
}
|
|
135
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
136
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
137
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPFeatureDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
138
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: AXPFeatureDirective, isStandalone: false, selector: "[feature]", inputs: { feature: "feature", featureElse: "featureElse" }, ngImport: i0 }); }
|
|
137
139
|
}
|
|
138
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPFeatureDirective, decorators: [{
|
|
139
141
|
type: Directive,
|
|
140
142
|
args: [{
|
|
141
143
|
selector: '[feature]',
|
|
@@ -274,13 +276,6 @@ class AXPSessionService {
|
|
|
274
276
|
this.isAuthorized$ = this.status$.pipe(map((status) => status === AXPSessionStatus.Authorized), shareReplay(1));
|
|
275
277
|
}
|
|
276
278
|
static { this.SESSION_KEY = 'AXP_SESSION'; }
|
|
277
|
-
/**
|
|
278
|
-
* Get module provider loader lazily to avoid circular dependency.
|
|
279
|
-
* ModuleProviderLoader depends on AXPSessionService, which is this service.
|
|
280
|
-
*/
|
|
281
|
-
getModuleProviderLoader() {
|
|
282
|
-
return this.injector.get(AXP_MODULE_PROVIDER_LOADER);
|
|
283
|
-
}
|
|
284
279
|
get user() {
|
|
285
280
|
const session = this.getSessionData();
|
|
286
281
|
if (session?.user && !this.currentUserSubject.value) {
|
|
@@ -329,10 +324,6 @@ class AXPSessionService {
|
|
|
329
324
|
this.currentApplicationSubject.next(sessionData.application);
|
|
330
325
|
}
|
|
331
326
|
this.status.next(AXPSessionStatus.Authenticated);
|
|
332
|
-
// Load required modules first to ensure entities are available for loaders
|
|
333
|
-
// This is critical because loaders (like application.loader) need entities
|
|
334
|
-
// from required modules (ApplicationManagement, TenantManagement, SecurityManagement)
|
|
335
|
-
await this.getModuleProviderLoader().loadRequiredModules();
|
|
336
327
|
await this.loadPermissions();
|
|
337
328
|
await this.loadFeatures();
|
|
338
329
|
await this.signInComplete();
|
|
@@ -450,9 +441,6 @@ class AXPSessionService {
|
|
|
450
441
|
}
|
|
451
442
|
//
|
|
452
443
|
const userId = this.user?.id;
|
|
453
|
-
// Clear module provider loader cache before clearing session
|
|
454
|
-
// This ensures modules and providers from previous user are not cached
|
|
455
|
-
await this.getModuleProviderLoader().clear();
|
|
456
444
|
this.clearSession();
|
|
457
445
|
this.eventService.publish(AXPSessionStatus.SignedOut, { id: userId });
|
|
458
446
|
this.isLoading.next(false);
|
|
@@ -620,6 +608,22 @@ class AXPSessionService {
|
|
|
620
608
|
}
|
|
621
609
|
return baseResult;
|
|
622
610
|
}
|
|
611
|
+
/**
|
|
612
|
+
* Checks if a module is enabled for the current tenant/application.
|
|
613
|
+
* Module names are stored as features with value: true when enabled.
|
|
614
|
+
* Module names can be provided in PascalCase (e.g., 'SecurityManagement') or kebab-case (e.g., 'security-management').
|
|
615
|
+
*/
|
|
616
|
+
isModuleEnabled(moduleName) {
|
|
617
|
+
if (!moduleName) {
|
|
618
|
+
return false;
|
|
619
|
+
}
|
|
620
|
+
// Normalize module name: convert kebab-case to PascalCase if needed
|
|
621
|
+
const normalizedModuleName = moduleName.includes('-')
|
|
622
|
+
? moduleName.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('')
|
|
623
|
+
: moduleName;
|
|
624
|
+
// Module names are stored as features with value: true when enabled
|
|
625
|
+
return this.features.some(f => f.name === normalizedModuleName && f.value === true);
|
|
626
|
+
}
|
|
623
627
|
getToken() {
|
|
624
628
|
const sessionData = this.getSessionData();
|
|
625
629
|
return sessionData?.accessToken;
|
|
@@ -631,10 +635,10 @@ class AXPSessionService {
|
|
|
631
635
|
application: this.application,
|
|
632
636
|
});
|
|
633
637
|
}
|
|
634
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
635
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
638
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
639
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSessionService, providedIn: 'root' }); }
|
|
636
640
|
}
|
|
637
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
641
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSessionService, decorators: [{
|
|
638
642
|
type: Injectable,
|
|
639
643
|
args: [{
|
|
640
644
|
providedIn: 'root',
|
|
@@ -645,7 +649,7 @@ class AXPPermissionDirective {
|
|
|
645
649
|
constructor(templateRef, viewContainer) {
|
|
646
650
|
this.templateRef = templateRef;
|
|
647
651
|
this.viewContainer = viewContainer;
|
|
648
|
-
this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : []));
|
|
652
|
+
this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : /* istanbul ignore next */ []));
|
|
649
653
|
this.sessionService = inject(AXPSessionService);
|
|
650
654
|
}
|
|
651
655
|
set permission(permissionKeys) {
|
|
@@ -678,10 +682,10 @@ class AXPPermissionDirective {
|
|
|
678
682
|
ngOnDestroy() {
|
|
679
683
|
this.subscription?.unsubscribe();
|
|
680
684
|
}
|
|
681
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
682
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
685
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
686
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: AXPPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission", permissionElse: "permissionElse" }, ngImport: i0 }); }
|
|
683
687
|
}
|
|
684
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDirective, decorators: [{
|
|
685
689
|
type: Directive,
|
|
686
690
|
args: [{
|
|
687
691
|
selector: '[permission]',
|
|
@@ -803,7 +807,6 @@ const AXP_PERMISSION_DEFINITION_PROVIDER = new InjectionToken('AXP_PERMISSION_DE
|
|
|
803
807
|
class AXPPermissionDefinitionService {
|
|
804
808
|
constructor() {
|
|
805
809
|
this.providers = inject(AXP_PERMISSION_DEFINITION_PROVIDER, { optional: true });
|
|
806
|
-
this.providerRegistry = inject(AXPModuleProviderRegistry);
|
|
807
810
|
this.sessionService = inject(AXPSessionService);
|
|
808
811
|
this.cache = null;
|
|
809
812
|
}
|
|
@@ -812,7 +815,7 @@ class AXPPermissionDefinitionService {
|
|
|
812
815
|
return;
|
|
813
816
|
}
|
|
814
817
|
const context = new AXPPermissionDefinitionProviderContext();
|
|
815
|
-
// Load providers from DI tokens
|
|
818
|
+
// Load providers from DI tokens
|
|
816
819
|
if (Array.isArray(this.providers)) {
|
|
817
820
|
for (const provider of this.providers) {
|
|
818
821
|
if (provider instanceof Promise) {
|
|
@@ -826,11 +829,6 @@ class AXPPermissionDefinitionService {
|
|
|
826
829
|
}
|
|
827
830
|
}
|
|
828
831
|
}
|
|
829
|
-
// Load providers from registry (manifest-based, conditionally loaded)
|
|
830
|
-
const registryProviders = this.providerRegistry.getPermissionProviders();
|
|
831
|
-
for (const provider of registryProviders) {
|
|
832
|
-
await provider.define(context);
|
|
833
|
-
}
|
|
834
832
|
// Filter permissions based on required features
|
|
835
833
|
const allGroups = context.getGroupDefinitions();
|
|
836
834
|
this.cache = this.filterByFeatures(allGroups);
|
|
@@ -890,14 +888,106 @@ class AXPPermissionDefinitionService {
|
|
|
890
888
|
await this.load();
|
|
891
889
|
return this.cache?.find(g => g.permissions.find(p => p.name === name))?.permissions.find(p => p.name === name) ?? null;
|
|
892
890
|
}
|
|
893
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
894
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
891
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
892
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDefinitionService, providedIn: 'root' }); }
|
|
895
893
|
}
|
|
896
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDefinitionService, decorators: [{
|
|
897
895
|
type: Injectable,
|
|
898
896
|
args: [{ providedIn: 'root' }]
|
|
899
897
|
}] });
|
|
900
898
|
|
|
899
|
+
//#region ---- Imports ----
|
|
900
|
+
//#endregion
|
|
901
|
+
//#region ---- Helpers ----
|
|
902
|
+
function flattenPermissionDefinitions(nodes, groupPrefix) {
|
|
903
|
+
const rows = [];
|
|
904
|
+
for (const node of nodes) {
|
|
905
|
+
const displayTitle = groupPrefix ? `${groupPrefix} / ${node.title}` : node.title;
|
|
906
|
+
if (node.children?.length) {
|
|
907
|
+
rows.push(...flattenPermissionDefinitions(node.children, displayTitle));
|
|
908
|
+
}
|
|
909
|
+
else {
|
|
910
|
+
rows.push({
|
|
911
|
+
id: String(node.name),
|
|
912
|
+
title: displayTitle,
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
return rows;
|
|
917
|
+
}
|
|
918
|
+
//#endregion
|
|
919
|
+
//#region ---- Permission definitions data source ----
|
|
920
|
+
/**
|
|
921
|
+
* Registered permission definitions for select widgets via dataSource name {@link PERMISSION_DEFINITIONS_DATASOURCE_NAME}.
|
|
922
|
+
*/
|
|
923
|
+
const PERMISSION_DEFINITIONS_DATASOURCE_NAME = 'platform-permission-definitions';
|
|
924
|
+
/**
|
|
925
|
+
* Data source definition for leaf permissions from {@link AXPPermissionDefinitionService#getGroups}.
|
|
926
|
+
*/
|
|
927
|
+
class AXPPermissionDefinitionsDataSourceDefinition {
|
|
928
|
+
constructor() {
|
|
929
|
+
//#region ---- Services & Dependencies ----
|
|
930
|
+
this.permissionDefinitionService = inject(AXPPermissionDefinitionService);
|
|
931
|
+
//#endregion
|
|
932
|
+
}
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region ---- Public API ----
|
|
935
|
+
async items() {
|
|
936
|
+
return [
|
|
937
|
+
{
|
|
938
|
+
name: PERMISSION_DEFINITIONS_DATASOURCE_NAME,
|
|
939
|
+
title: 'Permissions',
|
|
940
|
+
source: () => new AXDataSource({
|
|
941
|
+
key: 'id',
|
|
942
|
+
load: async () => {
|
|
943
|
+
const groups = await this.permissionDefinitionService.getGroups();
|
|
944
|
+
const list = [];
|
|
945
|
+
for (const g of groups) {
|
|
946
|
+
list.push(...flattenPermissionDefinitions(g.permissions, g.title));
|
|
947
|
+
}
|
|
948
|
+
return { items: list, total: list.length };
|
|
949
|
+
},
|
|
950
|
+
byKey: async (key) => {
|
|
951
|
+
const groups = await this.permissionDefinitionService.getGroups();
|
|
952
|
+
const list = [];
|
|
953
|
+
for (const g of groups) {
|
|
954
|
+
list.push(...flattenPermissionDefinitions(g.permissions, g.title));
|
|
955
|
+
}
|
|
956
|
+
return list.find((item) => item.id === key);
|
|
957
|
+
},
|
|
958
|
+
pageSize: 1000,
|
|
959
|
+
}),
|
|
960
|
+
columns: [
|
|
961
|
+
{
|
|
962
|
+
name: 'id',
|
|
963
|
+
title: 'ID',
|
|
964
|
+
datatype: 'string',
|
|
965
|
+
type: AXPWidgetsCatalog.text,
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
name: 'title',
|
|
969
|
+
title: 'Title',
|
|
970
|
+
datatype: 'string',
|
|
971
|
+
type: AXPWidgetsCatalog.text,
|
|
972
|
+
},
|
|
973
|
+
],
|
|
974
|
+
filters: [
|
|
975
|
+
{
|
|
976
|
+
field: 'title',
|
|
977
|
+
title: 'Title',
|
|
978
|
+
operator: { type: 'equal' },
|
|
979
|
+
widget: { type: AXPWidgetsCatalog.text },
|
|
980
|
+
filterType: { advance: true, inline: true },
|
|
981
|
+
},
|
|
982
|
+
],
|
|
983
|
+
textField: { name: 'title', title: 'Title' },
|
|
984
|
+
valueField: { name: 'id', title: 'ID' },
|
|
985
|
+
},
|
|
986
|
+
];
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
//#endregion
|
|
990
|
+
|
|
901
991
|
class AXPPermissionEvaluatorScopeProvider {
|
|
902
992
|
constructor() {
|
|
903
993
|
this.sessionService = inject(AXPSessionService);
|
|
@@ -987,9 +1077,9 @@ class AXPAuthModule {
|
|
|
987
1077
|
f();
|
|
988
1078
|
});
|
|
989
1079
|
}
|
|
990
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
991
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
992
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1080
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, deps: [{ token: 'AXPAuthModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1081
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, declarations: [AXPPermissionDirective, AXPFeatureDirective], exports: [AXPPermissionDirective, AXPFeatureDirective] }); }
|
|
1082
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, providers: [
|
|
993
1083
|
provideAppInitializer(() => {
|
|
994
1084
|
const initializerFn = initializeAppState(inject(AXPSessionService));
|
|
995
1085
|
return initializerFn();
|
|
@@ -1000,7 +1090,7 @@ class AXPAuthModule {
|
|
|
1000
1090
|
},
|
|
1001
1091
|
] }); }
|
|
1002
1092
|
}
|
|
1003
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, decorators: [{
|
|
1004
1094
|
type: NgModule,
|
|
1005
1095
|
args: [{
|
|
1006
1096
|
imports: [],
|
|
@@ -1104,9 +1194,169 @@ class TimeUtil {
|
|
|
1104
1194
|
}
|
|
1105
1195
|
//#endregion
|
|
1106
1196
|
|
|
1197
|
+
//#region ---- Challenge Data Types ----
|
|
1198
|
+
//#endregion
|
|
1199
|
+
|
|
1200
|
+
//#region ---- Abstract Challenge Provider ----
|
|
1201
|
+
/**
|
|
1202
|
+
* Abstract base class for login challenge providers
|
|
1203
|
+
*
|
|
1204
|
+
* Implement this class to create custom challenge mechanisms like:
|
|
1205
|
+
* - Image CAPTCHA
|
|
1206
|
+
* - reCAPTCHA
|
|
1207
|
+
* - SMS verification
|
|
1208
|
+
* - Email verification
|
|
1209
|
+
*
|
|
1210
|
+
* @example
|
|
1211
|
+
* ```typescript
|
|
1212
|
+
* @Injectable()
|
|
1213
|
+
* export class MyImageCaptchaProvider extends AXPLoginChallengeProvider {
|
|
1214
|
+
* readonly name = 'image-captcha';
|
|
1215
|
+
*
|
|
1216
|
+
* checkResponse(error: unknown): AXPChallengeCheckResult | null {
|
|
1217
|
+
* if (error instanceof HttpErrorResponse) {
|
|
1218
|
+
* if (error.error?.requiresCaptcha) {
|
|
1219
|
+
* return { required: true };
|
|
1220
|
+
* }
|
|
1221
|
+
* }
|
|
1222
|
+
* return null;
|
|
1223
|
+
* }
|
|
1224
|
+
*
|
|
1225
|
+
* async getChallenge(): Promise<AXPLoginChallengeData> {
|
|
1226
|
+
* const response = await this.http.get('/api/captcha').toPromise();
|
|
1227
|
+
* return {
|
|
1228
|
+
* id: response.id,
|
|
1229
|
+
* content: response.image,
|
|
1230
|
+
* contentType: 'image-base64'
|
|
1231
|
+
* };
|
|
1232
|
+
* }
|
|
1233
|
+
*
|
|
1234
|
+
* async refreshChallenge(): Promise<AXPLoginChallengeData> {
|
|
1235
|
+
* return this.getChallenge();
|
|
1236
|
+
* }
|
|
1237
|
+
*
|
|
1238
|
+
* getChallengeComponent(): Type<AXPLoginChallengeComponentBase> {
|
|
1239
|
+
* return MyCaptchaChallengeComponent;
|
|
1240
|
+
* }
|
|
1241
|
+
* }
|
|
1242
|
+
* ```
|
|
1243
|
+
*/
|
|
1244
|
+
class AXPLoginChallengeProvider {
|
|
1245
|
+
/**
|
|
1246
|
+
* Returns the component type for rendering the challenge UI
|
|
1247
|
+
*
|
|
1248
|
+
* Override this method to provide a custom challenge UI component.
|
|
1249
|
+
* If not overridden (returns null), the login component will use
|
|
1250
|
+
* a default built-in UI.
|
|
1251
|
+
*
|
|
1252
|
+
* @returns Component type extending AXPLoginChallengeComponentBase, or null for default UI
|
|
1253
|
+
*/
|
|
1254
|
+
getChallengeComponent() {
|
|
1255
|
+
return null;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
//#endregion
|
|
1259
|
+
|
|
1260
|
+
//#region ---- Injection Token ----
|
|
1261
|
+
/**
|
|
1262
|
+
* Injection token for the login challenge provider
|
|
1263
|
+
*
|
|
1264
|
+
* This token is optional - if not provided, no challenge mechanism will be used.
|
|
1265
|
+
*
|
|
1266
|
+
* @example
|
|
1267
|
+
* ```typescript
|
|
1268
|
+
* // In your app module or provider configuration:
|
|
1269
|
+
* providers: [
|
|
1270
|
+
* {
|
|
1271
|
+
* provide: AXP_LOGIN_CHALLENGE_PROVIDER,
|
|
1272
|
+
* useClass: MyImageCaptchaProvider
|
|
1273
|
+
* }
|
|
1274
|
+
* ]
|
|
1275
|
+
*
|
|
1276
|
+
* // In a component:
|
|
1277
|
+
* private challengeProvider = inject(AXP_LOGIN_CHALLENGE_PROVIDER, { optional: true });
|
|
1278
|
+
* ```
|
|
1279
|
+
*/
|
|
1280
|
+
const AXP_LOGIN_CHALLENGE_PROVIDER = new InjectionToken('AXP_LOGIN_CHALLENGE_PROVIDER');
|
|
1281
|
+
//#endregion
|
|
1282
|
+
|
|
1283
|
+
//#region ---- Base Challenge Component ----
|
|
1284
|
+
/**
|
|
1285
|
+
* Base class for login challenge UI components
|
|
1286
|
+
*
|
|
1287
|
+
* Providers can extend this class to create custom challenge UIs.
|
|
1288
|
+
* The login component will render this component and listen to its outputs.
|
|
1289
|
+
*
|
|
1290
|
+
* @example
|
|
1291
|
+
* ```typescript
|
|
1292
|
+
* @Component({
|
|
1293
|
+
* selector: 'my-captcha-challenge',
|
|
1294
|
+
* template: `
|
|
1295
|
+
* <div class="captcha-container">
|
|
1296
|
+
* <img [src]="'data:image/png;base64,' + challengeData().content" />
|
|
1297
|
+
* <input
|
|
1298
|
+
* type="text"
|
|
1299
|
+
* [value]="response()"
|
|
1300
|
+
* (input)="onResponseChange($event)"
|
|
1301
|
+
* />
|
|
1302
|
+
* <button (click)="onRefreshClick()">Refresh</button>
|
|
1303
|
+
* </div>
|
|
1304
|
+
* `
|
|
1305
|
+
* })
|
|
1306
|
+
* export class MyCaptchaChallengeComponent extends AXPLoginChallengeComponentBase {
|
|
1307
|
+
* response = signal('');
|
|
1308
|
+
*
|
|
1309
|
+
* onResponseChange(event: Event) {
|
|
1310
|
+
* const value = (event.target as HTMLInputElement).value;
|
|
1311
|
+
* this.response.set(value);
|
|
1312
|
+
* this.responseChange.emit(value);
|
|
1313
|
+
* }
|
|
1314
|
+
*
|
|
1315
|
+
* onRefreshClick() {
|
|
1316
|
+
* this.refreshRequest.emit();
|
|
1317
|
+
* }
|
|
1318
|
+
* }
|
|
1319
|
+
* ```
|
|
1320
|
+
*/
|
|
1321
|
+
class AXPLoginChallengeComponentBase {
|
|
1322
|
+
constructor() {
|
|
1323
|
+
//#region ---- Inputs ----
|
|
1324
|
+
/**
|
|
1325
|
+
* Challenge data to display
|
|
1326
|
+
* Contains the image/content and metadata from the server
|
|
1327
|
+
*/
|
|
1328
|
+
this.challengeData = input.required(...(ngDevMode ? [{ debugName: "challengeData" }] : /* istanbul ignore next */ []));
|
|
1329
|
+
/**
|
|
1330
|
+
* Whether the challenge is currently loading (e.g., refreshing)
|
|
1331
|
+
*/
|
|
1332
|
+
this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
1333
|
+
//#endregion
|
|
1334
|
+
//#region ---- Outputs ----
|
|
1335
|
+
/**
|
|
1336
|
+
* Emits when the user enters or changes their response
|
|
1337
|
+
* The login component will capture this value and include it in credentials
|
|
1338
|
+
*/
|
|
1339
|
+
this.responseChange = output();
|
|
1340
|
+
/**
|
|
1341
|
+
* Emits when the user requests a new challenge (e.g., clicks refresh button)
|
|
1342
|
+
* The login component will call provider.refreshChallenge()
|
|
1343
|
+
*/
|
|
1344
|
+
this.refreshRequest = output();
|
|
1345
|
+
}
|
|
1346
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLoginChallengeComponentBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1347
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: AXPLoginChallengeComponentBase, isStandalone: true, selector: "ng-component", inputs: { challengeData: { classPropertyName: "challengeData", publicName: "challengeData", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { responseChange: "responseChange", refreshRequest: "refreshRequest" }, ngImport: i0, template: '', isInline: true }); }
|
|
1348
|
+
}
|
|
1349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLoginChallengeComponentBase, decorators: [{
|
|
1350
|
+
type: Component,
|
|
1351
|
+
args: [{
|
|
1352
|
+
template: '',
|
|
1353
|
+
standalone: true,
|
|
1354
|
+
}]
|
|
1355
|
+
}], propDecorators: { challengeData: [{ type: i0.Input, args: [{ isSignal: true, alias: "challengeData", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], responseChange: [{ type: i0.Output, args: ["responseChange"] }], refreshRequest: [{ type: i0.Output, args: ["refreshRequest"] }] } });
|
|
1356
|
+
|
|
1107
1357
|
/**
|
|
1108
1358
|
* Generated bundle index. Do not edit.
|
|
1109
1359
|
*/
|
|
1110
1360
|
|
|
1111
|
-
export { AXPAuthGuard, AXPAuthModule, AXPAuthStrategy, AXPAuthStrategyRegistryService, AXPFeatureDirective, AXPFeatureGuard, AXPPermissionDefinitionBuilder, AXPPermissionDefinitionGroupBuilder, AXPPermissionDefinitionProviderContext, AXPPermissionDefinitionService, AXPPermissionDirective, AXPPermissionEvaluatorScopeProvider, AXPPermissionGuard, AXPSessionContext, AXPSessionService, AXPSessionStatus, AXPUnauthenticatedError, AXPUnauthorizedError, AXP_APPLICATION_LOADER, AXP_FEATURE_CHECKER, AXP_FEATURE_LOADER, AXP_PERMISSION_CHECKER, AXP_PERMISSION_DEFINITION_PROVIDER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER, JwtUtil, PkceUtil, TimeUtil, initializeAppState };
|
|
1361
|
+
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, PERMISSION_DEFINITIONS_DATASOURCE_NAME, PkceUtil, TimeUtil, initializeAppState };
|
|
1112
1362
|
//# sourceMappingURL=acorex-platform-auth.mjs.map
|