@acorex/modules 21.0.0-next.1 → 21.0.0-next.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.
Files changed (57) hide show
  1. package/auth/index.d.ts +21 -25
  2. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-Xhv636ad.mjs → acorex-modules-auth-acorex-modules-auth-DyMrPzio.mjs} +128 -173
  3. package/fesm2022/acorex-modules-auth-acorex-modules-auth-DyMrPzio.mjs.map +1 -0
  4. package/fesm2022/{acorex-modules-auth-app-chooser.component-CVTPqwuU.mjs → acorex-modules-auth-app-chooser.component-CeTkWuU7.mjs} +2 -2
  5. package/fesm2022/{acorex-modules-auth-app-chooser.component-CVTPqwuU.mjs.map → acorex-modules-auth-app-chooser.component-CeTkWuU7.mjs.map} +1 -1
  6. package/fesm2022/{acorex-modules-auth-login.module-D-OyMAOZ.mjs → acorex-modules-auth-login.module-DanUC1V9.mjs} +4 -4
  7. package/fesm2022/{acorex-modules-auth-login.module-D-OyMAOZ.mjs.map → acorex-modules-auth-login.module-DanUC1V9.mjs.map} +1 -1
  8. package/fesm2022/{acorex-modules-auth-master.layout-Daxd7Nh7.mjs → acorex-modules-auth-master.layout-StFhVYaW.mjs} +2 -2
  9. package/fesm2022/{acorex-modules-auth-master.layout-Daxd7Nh7.mjs.map → acorex-modules-auth-master.layout-StFhVYaW.mjs.map} +1 -1
  10. package/fesm2022/{acorex-modules-auth-oauth-callback.component-DrpoLauM.mjs → acorex-modules-auth-oauth-callback.component-BYZyzG0Q.mjs} +2 -2
  11. package/fesm2022/{acorex-modules-auth-oauth-callback.component-DrpoLauM.mjs.map → acorex-modules-auth-oauth-callback.component-BYZyzG0Q.mjs.map} +1 -1
  12. package/fesm2022/{acorex-modules-auth-password.component-Ce1GT_9U.mjs → acorex-modules-auth-password.component-CshkJ94Y.mjs} +2 -2
  13. package/fesm2022/{acorex-modules-auth-password.component-Ce1GT_9U.mjs.map → acorex-modules-auth-password.component-CshkJ94Y.mjs.map} +1 -1
  14. package/fesm2022/{acorex-modules-auth-password.component-OFNLNftl.mjs → acorex-modules-auth-password.component-Cwnmr_K3.mjs} +2 -2
  15. package/fesm2022/{acorex-modules-auth-password.component-OFNLNftl.mjs.map → acorex-modules-auth-password.component-Cwnmr_K3.mjs.map} +1 -1
  16. package/fesm2022/{acorex-modules-auth-routes-nKIv8r0R.mjs → acorex-modules-auth-routes-QmD6HTen.mjs} +2 -2
  17. package/fesm2022/{acorex-modules-auth-routes-nKIv8r0R.mjs.map → acorex-modules-auth-routes-QmD6HTen.mjs.map} +1 -1
  18. package/fesm2022/{acorex-modules-auth-two-factor.module-CxhH6CxU.mjs → acorex-modules-auth-two-factor.module-CUrjDJKb.mjs} +2 -2
  19. package/fesm2022/{acorex-modules-auth-two-factor.module-CxhH6CxU.mjs.map → acorex-modules-auth-two-factor.module-CUrjDJKb.mjs.map} +1 -1
  20. package/fesm2022/{acorex-modules-auth-user-sessions.component-CMIlSHxl.mjs → acorex-modules-auth-user-sessions.component-f5tjvO2x.mjs} +2 -2
  21. package/fesm2022/{acorex-modules-auth-user-sessions.component-CMIlSHxl.mjs.map → acorex-modules-auth-user-sessions.component-f5tjvO2x.mjs.map} +1 -1
  22. package/fesm2022/acorex-modules-auth.mjs +1 -1
  23. package/fesm2022/{acorex-modules-document-management-acorex-modules-document-management-CHubrWiR.mjs → acorex-modules-document-management-acorex-modules-document-management-BUV6euwQ.mjs} +18 -382
  24. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-BUV6euwQ.mjs.map +1 -0
  25. package/fesm2022/{acorex-modules-document-management-attachment-widget.component-DeLipvyw.mjs → acorex-modules-document-management-attachment-widget.component-y_nPA03O.mjs} +2 -2
  26. package/fesm2022/{acorex-modules-document-management-attachment-widget.component-DeLipvyw.mjs.map → acorex-modules-document-management-attachment-widget.component-y_nPA03O.mjs.map} +1 -1
  27. package/fesm2022/{acorex-modules-document-management-details-view.component-Cnh-LFjB.mjs → acorex-modules-document-management-details-view.component-CMlHf8Um.mjs} +2 -2
  28. package/fesm2022/{acorex-modules-document-management-details-view.component-Cnh-LFjB.mjs.map → acorex-modules-document-management-details-view.component-CMlHf8Um.mjs.map} +1 -1
  29. package/fesm2022/{acorex-modules-document-management-document-signature-popup.component-BHELpzzB.mjs → acorex-modules-document-management-document-signature-popup.component-Cq00rYaJ.mjs} +2 -2
  30. package/fesm2022/{acorex-modules-document-management-document-signature-popup.component-BHELpzzB.mjs.map → acorex-modules-document-management-document-signature-popup.component-Cq00rYaJ.mjs.map} +1 -1
  31. package/fesm2022/{acorex-modules-document-management-drive-choose.component-CjVfyBBA.mjs → acorex-modules-document-management-drive-choose.component-pehj7js2.mjs} +2 -2
  32. package/fesm2022/{acorex-modules-document-management-drive-choose.component-CjVfyBBA.mjs.map → acorex-modules-document-management-drive-choose.component-pehj7js2.mjs.map} +1 -1
  33. package/fesm2022/{acorex-modules-document-management-drive.component-a7AMnvvu.mjs → acorex-modules-document-management-drive.component-dvSTOy_3.mjs} +2 -2
  34. package/fesm2022/{acorex-modules-document-management-drive.component-a7AMnvvu.mjs.map → acorex-modules-document-management-drive.component-dvSTOy_3.mjs.map} +1 -1
  35. package/fesm2022/{acorex-modules-document-management-feature-definition.provider-B4hCKUul.mjs → acorex-modules-document-management-feature-definition.provider-De2RD_N_.mjs} +2 -2
  36. package/fesm2022/{acorex-modules-document-management-feature-definition.provider-B4hCKUul.mjs.map → acorex-modules-document-management-feature-definition.provider-De2RD_N_.mjs.map} +1 -1
  37. package/fesm2022/{acorex-modules-document-management-large-icons-view.component-CETjs5Az.mjs → acorex-modules-document-management-large-icons-view.component-CcIhr_aU.mjs} +2 -2
  38. package/fesm2022/{acorex-modules-document-management-large-icons-view.component-CETjs5Az.mjs.map → acorex-modules-document-management-large-icons-view.component-CcIhr_aU.mjs.map} +1 -1
  39. package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-7agAfinH.mjs → acorex-modules-document-management-large-tiles-view.component-DP4pGOCz.mjs} +2 -2
  40. package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-7agAfinH.mjs.map → acorex-modules-document-management-large-tiles-view.component-DP4pGOCz.mjs.map} +1 -1
  41. package/fesm2022/{acorex-modules-document-management-list-view.component-CMfX3G8l.mjs → acorex-modules-document-management-list-view.component-BC5vi2Cj.mjs} +2 -2
  42. package/fesm2022/{acorex-modules-document-management-list-view.component-CMfX3G8l.mjs.map → acorex-modules-document-management-list-view.component-BC5vi2Cj.mjs.map} +1 -1
  43. package/fesm2022/{acorex-modules-document-management-permission-definition.provider-v7SvdUQO.mjs → acorex-modules-document-management-permission-definition.provider-B1P5TVdF.mjs} +2 -2
  44. package/fesm2022/{acorex-modules-document-management-permission-definition.provider-v7SvdUQO.mjs.map → acorex-modules-document-management-permission-definition.provider-B1P5TVdF.mjs.map} +1 -1
  45. package/fesm2022/{acorex-modules-document-management-small-icons-view.component-BL-IoyfV.mjs → acorex-modules-document-management-small-icons-view.component-C8Gf9Ea4.mjs} +2 -2
  46. package/fesm2022/{acorex-modules-document-management-small-icons-view.component-BL-IoyfV.mjs.map → acorex-modules-document-management-small-icons-view.component-C8Gf9Ea4.mjs.map} +1 -1
  47. package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-B3QYcehJ.mjs → acorex-modules-document-management-small-tiles-view.component-Czr_jJb-.mjs} +2 -2
  48. package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-B3QYcehJ.mjs.map → acorex-modules-document-management-small-tiles-view.component-Czr_jJb-.mjs.map} +1 -1
  49. package/fesm2022/acorex-modules-document-management.mjs +1 -1
  50. package/fesm2022/acorex-modules-settings-management.mjs +13 -3
  51. package/fesm2022/acorex-modules-settings-management.mjs.map +1 -1
  52. package/fesm2022/acorex-modules-workflow-management.mjs +0 -152
  53. package/fesm2022/acorex-modules-workflow-management.mjs.map +1 -1
  54. package/package.json +6 -6
  55. package/settings-management/index.d.ts +2 -3
  56. package/fesm2022/acorex-modules-auth-acorex-modules-auth-Xhv636ad.mjs.map +0 -1
  57. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-CHubrWiR.mjs.map +0 -1
package/auth/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import * as i2 from '@acorex/platform/layout/components';
9
9
  import { AXPEntityModel, AXMEntityCrudServiceImpl } from '@acorex/platform/layout/entity';
10
10
  import { Observable } from 'rxjs';
11
11
  import { HttpClient } from '@angular/common/http';
12
- import { AXPIModuleProviderLoader, AXPModuleAccessContext, AXPStartUpTask } from '@acorex/platform/core';
12
+ import { AXPIModuleProviderLoader, AXPModuleAccessContext } from '@acorex/platform/core';
13
13
  import { AXPApplication } from '@acorex/platform/auth';
14
14
 
15
15
  declare class AXMAuthErrorHandler implements AXPErrorHandler {
@@ -139,13 +139,32 @@ declare class AXPModuleProviderLoader implements AXPIModuleProviderLoader {
139
139
  private readonly manifestRegistry;
140
140
  private readonly providerRegistry;
141
141
  private readonly injector;
142
+ private readonly debugService;
142
143
  private readonly registeredModules;
144
+ /**
145
+ * Get session service lazily to avoid circular dependency.
146
+ * SessionService depends on AXP_MODULE_PROVIDER_LOADER, which is provided by this service.
147
+ */
148
+ private getSessionService;
143
149
  private getAccessControlService;
144
150
  loadProviders(context: AXPModuleAccessContext): Promise<void>;
145
151
  loadRequiredModules(): Promise<void>;
146
152
  private collectRequiredModules;
147
153
  isModuleRegistered(moduleName: string): boolean;
148
154
  clear(): Promise<void>;
155
+ /**
156
+ * Load module providers for a specific application.
157
+ * This method can be called from guards, components, or startup tasks.
158
+ * @param application The application to load providers for
159
+ * @returns Promise that resolves when providers are loaded
160
+ */
161
+ loadProvidersForApplication(application: AXPApplication): Promise<void>;
162
+ /**
163
+ * Load module providers if session is ready.
164
+ * Waits for session to be authenticated/authorized, then loads providers.
165
+ * @returns Promise that resolves when providers are loaded or skipped
166
+ */
167
+ loadProvidersIfReady(): Promise<void>;
149
168
  private checkModuleAccess;
150
169
  private registerProviders;
151
170
  private registerPermissionProvider;
@@ -161,28 +180,5 @@ declare class AXPModuleProviderLoader implements AXPIModuleProviderLoader {
161
180
  static ɵprov: i0.ɵɵInjectableDeclaration<AXPModuleProviderLoader>;
162
181
  }
163
182
 
164
- /**
165
- * Startup task to automatically load module providers after session restoration.
166
- * Checks if tenant and application are available, then loads providers conditionally.
167
- */
168
- declare class AXPModuleProviderInitializer {
169
- private readonly sessionService;
170
- private readonly injector;
171
- private readonly debugService;
172
- private getModuleProviderLoader;
173
- createRequiredModulesTask(): AXPStartUpTask;
174
- createStartupTask(): AXPStartUpTask;
175
- /**
176
- * Load module providers for a specific application.
177
- * This method can be called from guards, components, or startup tasks.
178
- * @param application The application to load providers for
179
- * @returns Promise that resolves when providers are loaded
180
- */
181
- loadProvidersForApplication(application: AXPApplication): Promise<void>;
182
- loadProvidersIfReady(): Promise<void>;
183
- static ɵfac: i0.ɵɵFactoryDeclaration<AXPModuleProviderInitializer, never>;
184
- static ɵprov: i0.ɵɵInjectableDeclaration<AXPModuleProviderInitializer>;
185
- }
186
-
187
- export { AXMAuthErrorHandler, AXMAuthModule, AXMAuthenticationTypes, AXMDefaultAuthConfigs, AXMDeviceSessionsService, AXMDeviceSessionsServiceImpl, AXMSessionStatusTypes, AXM_AUTH_CONFIG_TOKEN, AXPIdleService, AXPModuleProviderInitializer, AXPModuleProviderLoader, configAuthModule };
183
+ export { AXMAuthErrorHandler, AXMAuthModule, AXMAuthenticationTypes, AXMDefaultAuthConfigs, AXMDeviceSessionsService, AXMDeviceSessionsServiceImpl, AXMSessionStatusTypes, AXM_AUTH_CONFIG_TOKEN, AXPIdleService, AXPModuleProviderLoader, configAuthModule };
188
184
  export type { AXMAuthConfigs, AXMExternalProviderConfig, AXMSecurityManagementDeviceSessionsEntityModel };
@@ -1,4 +1,4 @@
1
- import { AXPUnauthorizedError, AXPUnauthenticatedError, AXPSessionService, AXPAuthStrategyRegistryService, AXPAuthGuard, AXPSessionStatus } from '@acorex/platform/auth';
1
+ import { AXPUnauthorizedError, AXPUnauthenticatedError, AXPSessionService, AXPAuthStrategyRegistryService, AXPAuthGuard, AXPSessionStatus, AXPPermissionDefinitionService } from '@acorex/platform/auth';
2
2
  import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
3
3
  import * as i1$3 from '@angular/common/http';
4
4
  import { HttpErrorResponse } from '@angular/common/http';
@@ -7,14 +7,14 @@ import { inject, isDevMode, Injectable, InjectionToken, Component, ViewChild, Vi
7
7
  import * as i1$2 from '@angular/router';
8
8
  import { Router, RouterModule, ROUTES } from '@angular/router';
9
9
  import * as i1$5 from '@acorex/platform/common';
10
- import { AXPHomePageService, AXPDataProvider, AXP_ROOT_CONFIG_TOKEN, AXPSettingsService, AXPDebugService, AXPCommonModule, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER } from '@acorex/platform/common';
11
- import { AXP_MODULE_PROVIDER_INITIALIZER, AXPPlatformScope, AXPModuleManifestRegistry, AXPModuleProviderRegistry, AXP_MODULE_ACCESS_CONTROL_SERVICE, DefaultModuleAccessControlService, AXPFeatureDefinitionProviderContext, AXP_MODULE_PROVIDER_LOADER, AXP_EDITION_SERVICE } from '@acorex/platform/core';
10
+ import { AXPHomePageService, AXPDataProvider, AXP_ROOT_CONFIG_TOKEN, AXPSettingsService, AXPDebugService, AXPMenuProviderService, AXPSettingDefinitionProviderService, AXPCommonModule, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER } from '@acorex/platform/common';
11
+ import { AXP_MODULE_PROVIDER_LOADER, AXPPlatformScope, AXPModuleManifestRegistry, AXPModuleProviderRegistry, AXP_MODULE_ACCESS_CONTROL_SERVICE, DefaultModuleAccessControlService, AXP_EDITION_SERVICE, AXPFeatureDefinitionProviderContext } from '@acorex/platform/core';
12
12
  import { AXPCommandExecutor, provideCommandSetups } from '@acorex/platform/runtime';
13
13
  import * as i1$1 from '@angular/common';
14
14
  import { CommonModule, AsyncPipe } from '@angular/common';
15
15
  import { firstValueFrom, of, first, Subject, timer, map } from 'rxjs';
16
16
  import * as i1$4 from '@acorex/platform/layout/components';
17
- import { AXPLogoComponent, AXPUserAvatarComponent, AXPComponentSlotModule } from '@acorex/platform/layout/components';
17
+ import { AXPLogoComponent, AXPUserAvatarComponent, AXPComponentSlotModule, AXPComponentSlotRegistryService } from '@acorex/platform/layout/components';
18
18
  import * as i2$1 from '@acorex/components/button';
19
19
  import { AXButtonModule } from '@acorex/components/button';
20
20
  import * as i1 from '@acorex/components/decorators';
@@ -33,7 +33,7 @@ import { AXTranslationService, AXTranslationModule } from '@acorex/core/translat
33
33
  import { AXChipsModule } from '@acorex/components/chips';
34
34
  import { AXTagModule } from '@acorex/components/tag';
35
35
  import { startWith, switchMap, tap, filter, take } from 'rxjs/operators';
36
- import { AXMEntityCrudServiceImpl } from '@acorex/platform/layout/entity';
36
+ import { AXMEntityCrudServiceImpl, AXPEntityDefinitionRegistryService } from '@acorex/platform/layout/entity';
37
37
 
38
38
  class AXMAuthErrorHandler {
39
39
  constructor() {
@@ -112,22 +112,22 @@ const routes = [
112
112
  },
113
113
  {
114
114
  path: '',
115
- loadComponent: () => import('./acorex-modules-auth-master.layout-Daxd7Nh7.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
116
- loadChildren: () => import('./acorex-modules-auth-login.module-D-OyMAOZ.mjs').then((c) => c.AXPSignInModule),
115
+ loadComponent: () => import('./acorex-modules-auth-master.layout-StFhVYaW.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
116
+ loadChildren: () => import('./acorex-modules-auth-login.module-DanUC1V9.mjs').then((c) => c.AXPSignInModule),
117
117
  },
118
118
  {
119
119
  path: '',
120
- loadComponent: () => import('./acorex-modules-auth-master.layout-Daxd7Nh7.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
121
- loadChildren: () => import('./acorex-modules-auth-two-factor.module-CxhH6CxU.mjs').then((c) => c.AXPTwoFactorModule),
120
+ loadComponent: () => import('./acorex-modules-auth-master.layout-StFhVYaW.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
121
+ loadChildren: () => import('./acorex-modules-auth-two-factor.module-CUrjDJKb.mjs').then((c) => c.AXPTwoFactorModule),
122
122
  },
123
123
  {
124
124
  path: '',
125
- loadComponent: () => import('./acorex-modules-auth-master.layout-Daxd7Nh7.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
126
- loadChildren: () => import('./acorex-modules-auth-routes-nKIv8r0R.mjs').then((c) => c),
125
+ loadComponent: () => import('./acorex-modules-auth-master.layout-StFhVYaW.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
126
+ loadChildren: () => import('./acorex-modules-auth-routes-QmD6HTen.mjs').then((c) => c),
127
127
  },
128
128
  {
129
129
  path: 'axp-oauth-callback',
130
- loadComponent: () => import('./acorex-modules-auth-oauth-callback.component-DrpoLauM.mjs').then((c) => c.AXPOAuthCallbackComponent),
130
+ loadComponent: () => import('./acorex-modules-auth-oauth-callback.component-BYZyzG0Q.mjs').then((c) => c.AXPOAuthCallbackComponent),
131
131
  },
132
132
  {
133
133
  path: 'account',
@@ -180,7 +180,7 @@ class AXPAppChooserListComponent {
180
180
  this.sessionService = inject(AXPSessionService);
181
181
  this.homePageService = inject(AXPHomePageService);
182
182
  this.authStrategyRegistry = inject(AXPAuthStrategyRegistryService);
183
- this.moduleProviderInitializer = inject(AXP_MODULE_PROVIDER_INITIALIZER);
183
+ this.moduleProviderLoader = inject(AXP_MODULE_PROVIDER_LOADER);
184
184
  this.applicationService = inject(AXMApplicationService);
185
185
  this.strategyName = this.sessionService.getSessionData()?.strategy;
186
186
  this.strategy = this.authStrategyRegistry.get(this.strategyName);
@@ -221,10 +221,10 @@ class AXPAppChooserListComponent {
221
221
  };
222
222
  await this.sessionService.updateToken(updateContext);
223
223
  }
224
- // Load module providers using the shared initializer service
224
+ // Load module providers using the loader service
225
225
  try {
226
226
  console.log('[AppChooser] Loading module providers for application:', applicationWithEdition.name);
227
- await this.moduleProviderInitializer.loadProvidersForApplication(applicationWithEdition);
227
+ await this.moduleProviderLoader.loadProvidersForApplication(applicationWithEdition);
228
228
  console.log('[AppChooser] Module providers loaded successfully');
229
229
  }
230
230
  catch (error) {
@@ -317,7 +317,7 @@ class AXMAuthProfileSlotComponent {
317
317
  this.router.navigate(['/auth/login']);
318
318
  }
319
319
  async openUserSession() {
320
- const com = await import('./acorex-modules-auth-user-sessions.component-CMIlSHxl.mjs').then((c) => c.AXMUserSessionsComponent);
320
+ const com = await import('./acorex-modules-auth-user-sessions.component-f5tjvO2x.mjs').then((c) => c.AXMUserSessionsComponent);
321
321
  this.popupService.open(com, {
322
322
  size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'sm',
323
323
  title: await this.translateService.translateAsync('@auth:profile.sessions.title'),
@@ -579,7 +579,7 @@ const canActivateAppChooser = async (route, state) => {
579
579
  const authStrategyRegistry = inject(AXPAuthStrategyRegistryService);
580
580
  const homePageService = inject(AXPHomePageService);
581
581
  const router = inject(Router);
582
- const moduleProviderInitializer = inject(AXP_MODULE_PROVIDER_INITIALIZER);
582
+ const moduleProviderLoader = inject(AXP_MODULE_PROVIDER_LOADER);
583
583
  const strategyName = sessionService.getSessionData()?.strategy;
584
584
  const strategy = authStrategyRegistry.get(strategyName);
585
585
  const apps = await firstValueFrom(sessionService.applications$);
@@ -602,7 +602,7 @@ const canActivateAppChooser = async (route, state) => {
602
602
  // Load module providers before redirecting
603
603
  try {
604
604
  console.log('[AppChooserGuard] Loading module providers for single application...');
605
- await moduleProviderInitializer.loadProvidersForApplication(apps[0]);
605
+ await moduleProviderLoader.loadProvidersForApplication(apps[0]);
606
606
  console.log('[AppChooserGuard] Module providers loaded successfully');
607
607
  }
608
608
  catch (error) {
@@ -626,7 +626,7 @@ function routesFacory() {
626
626
  },
627
627
  {
628
628
  path: 'app-chooser',
629
- loadComponent: () => import('./acorex-modules-auth-app-chooser.component-CVTPqwuU.mjs').then((c) => c.AXPAuthAppChooserComponent),
629
+ loadComponent: () => import('./acorex-modules-auth-app-chooser.component-CeTkWuU7.mjs').then((c) => c.AXPAuthAppChooserComponent),
630
630
  canActivate: [AXPAuthGuard, canActivateAppChooser],
631
631
  },
632
632
  ];
@@ -731,8 +731,16 @@ class AXPModuleProviderLoader {
731
731
  this.manifestRegistry = inject(AXPModuleManifestRegistry);
732
732
  this.providerRegistry = inject(AXPModuleProviderRegistry);
733
733
  this.injector = inject(Injector);
734
+ this.debugService = inject(AXPDebugService);
734
735
  this.registeredModules = new Set();
735
736
  }
737
+ /**
738
+ * Get session service lazily to avoid circular dependency.
739
+ * SessionService depends on AXP_MODULE_PROVIDER_LOADER, which is provided by this service.
740
+ */
741
+ getSessionService() {
742
+ return this.injector.get(AXPSessionService);
743
+ }
736
744
  getAccessControlService() {
737
745
  const customService = this.injector.get(AXP_MODULE_ACCESS_CONTROL_SERVICE, null, { optional: true });
738
746
  return customService || this.injector.get(DefaultModuleAccessControlService);
@@ -893,12 +901,110 @@ class AXPModuleProviderLoader {
893
901
  await this.clearServiceCaches(requiredModulesArray);
894
902
  }
895
903
  }
904
+ /**
905
+ * Load module providers for a specific application.
906
+ * This method can be called from guards, components, or startup tasks.
907
+ * @param application The application to load providers for
908
+ * @returns Promise that resolves when providers are loaded
909
+ */
910
+ async loadProvidersForApplication(application) {
911
+ debugger;
912
+ try {
913
+ console.log('[ModuleProviderLoader] loadProvidersForApplication called for application:', application.name);
914
+ if (!application.edition?.id) {
915
+ console.warn('[ModuleProviderLoader] Application has no edition, skipping provider loading');
916
+ return;
917
+ }
918
+ const editionService = this.injector.get(AXP_EDITION_SERVICE, null, { optional: true });
919
+ if (!editionService) {
920
+ console.warn('[ModuleProviderLoader] EditionService not available, skipping provider loading');
921
+ return;
922
+ }
923
+ // Use getOne if available, otherwise fallback to query
924
+ let edition;
925
+ const editionServiceWithGetOne = editionService;
926
+ if (typeof editionServiceWithGetOne.getOne === 'function') {
927
+ edition = await editionServiceWithGetOne.getOne(application.edition.id);
928
+ }
929
+ else {
930
+ const editionsResult = await editionService.query({ skip: 0, take: 1000 });
931
+ edition = editionsResult.items.find((e) => e.id === application.edition.id);
932
+ }
933
+ if (!edition) {
934
+ console.warn(`[ModuleProviderLoader] Edition not found: ${application.edition.id} for application ${application.id}`);
935
+ return;
936
+ }
937
+ const sessionService = this.getSessionService();
938
+ const tenant = sessionService.tenant;
939
+ const user = sessionService.user;
940
+ if (!tenant || !user) {
941
+ throw new Error('Tenant or user is missing');
942
+ }
943
+ console.log('[ModuleProviderLoader] Loading module providers for application:', application.name);
944
+ await this.loadProviders({
945
+ tenant,
946
+ application,
947
+ edition: {
948
+ id: edition.id,
949
+ title: edition.title,
950
+ modulesAndFeatures: edition.modulesAndFeatures,
951
+ },
952
+ subscription: undefined, // TODO: Get subscription if available
953
+ user,
954
+ });
955
+ console.log('[ModuleProviderLoader] Module providers loaded successfully');
956
+ // Display all loaded modules, features, and permissions
957
+ try {
958
+ await this.debugService.displayUserAccessInfo();
959
+ }
960
+ catch (debugError) {
961
+ console.warn('[ModuleProviderLoader] Failed to display user access info:', debugError);
962
+ // Don't throw - this is just for debugging
963
+ }
964
+ }
965
+ catch (error) {
966
+ console.error('[ModuleProviderLoader] Failed to load module providers:', error);
967
+ // Don't throw - allow navigation even if provider loading fails
968
+ }
969
+ }
970
+ /**
971
+ * Load module providers if session is ready.
972
+ * Waits for session to be authenticated/authorized, then loads providers.
973
+ * @returns Promise that resolves when providers are loaded or skipped
974
+ */
975
+ async loadProvidersIfReady() {
976
+ try {
977
+ const sessionService = this.getSessionService();
978
+ const isLoading = await firstValueFrom(sessionService.isLoading$);
979
+ if (isLoading) {
980
+ await firstValueFrom(sessionService.isLoading$.pipe(filter((loading) => !loading), take(1)));
981
+ }
982
+ const status = await firstValueFrom(sessionService.status$);
983
+ if (status !== AXPSessionStatus.Authenticated && status !== AXPSessionStatus.Authorized) {
984
+ console.log('[ModuleProviderLoader] User not authenticated, skipping provider loading');
985
+ return;
986
+ }
987
+ const tenant = sessionService.tenant;
988
+ const application = sessionService.application;
989
+ const user = sessionService.user;
990
+ if (!tenant || !application || !user) {
991
+ console.log('[ModuleProviderLoader] Tenant, application, or user not available, skipping provider loading');
992
+ return;
993
+ }
994
+ // Use the shared method
995
+ await this.loadProvidersForApplication(application);
996
+ }
997
+ catch (error) {
998
+ console.error('[ModuleProviderLoader] Failed to load module providers:', error);
999
+ // Don't throw - allow navigation even if provider loading fails
1000
+ }
1001
+ }
896
1002
  //#endregion
897
1003
  //#region ---- Private Methods ----
898
1004
  async checkModuleAccess(manifest, context) {
899
1005
  try {
900
1006
  const accessControlService = this.getAccessControlService();
901
- const result = await Promise.resolve(accessControlService.checkAccess(manifest.name, context));
1007
+ const result = await Promise.resolve(accessControlService.checkAccess(manifest, context));
902
1008
  return result === true;
903
1009
  }
904
1010
  catch (error) {
@@ -1002,8 +1108,6 @@ class AXPModuleProviderLoader {
1002
1108
  this.providerRegistry.registerDatasourceProvider(provider);
1003
1109
  }
1004
1110
  async registerComponentSlotsProvider(manifest) {
1005
- const componentSlotModule = await import('@acorex/platform/layout/components');
1006
- const { AXPComponentSlotRegistryService } = componentSlotModule;
1007
1111
  const configs = await manifest.componentSlots.provider();
1008
1112
  const registry = this.injector.get(AXPComponentSlotRegistryService);
1009
1113
  for (const [slotName, slotConfigs] of Object.entries(configs)) {
@@ -1015,7 +1119,6 @@ class AXPModuleProviderLoader {
1015
1119
  async clearServiceCaches(preserveModules) {
1016
1120
  // Step 1: Reload permission definitions (structure) and await completion
1017
1121
  try {
1018
- const { AXPPermissionDefinitionService } = await import('@acorex/platform/auth');
1019
1122
  const permissionService = this.injector.get(AXPPermissionDefinitionService, null, { optional: true });
1020
1123
  if (permissionService && typeof permissionService.reload === 'function') {
1021
1124
  await permissionService.reload();
@@ -1032,7 +1135,6 @@ class AXPModuleProviderLoader {
1032
1135
  // which calls loadPermissions(). updateToken only calls restoreSession() if
1033
1136
  // tenant and application are set, which they should be at this point.
1034
1137
  try {
1035
- const { AXPSessionService } = await import('@acorex/platform/auth');
1036
1138
  const sessionService = this.injector.get(AXPSessionService, null, { optional: true });
1037
1139
  if (sessionService && sessionService.user && sessionService.tenant && sessionService.application) {
1038
1140
  // updateToken will trigger restoreSession() which reloads permissions
@@ -1053,7 +1155,6 @@ class AXPModuleProviderLoader {
1053
1155
  // Step 3: Clear menu cache AFTER permissions are ready
1054
1156
  // This ensures menu visibility checks have access to updated permissions
1055
1157
  try {
1056
- const { AXPMenuProviderService } = await import('@acorex/platform/common');
1057
1158
  const menuService = this.injector.get(AXPMenuProviderService, null, { optional: true });
1058
1159
  if (menuService && typeof menuService.clearCache === 'function') {
1059
1160
  menuService.clearCache();
@@ -1064,7 +1165,6 @@ class AXPModuleProviderLoader {
1064
1165
  // Ignore
1065
1166
  }
1066
1167
  try {
1067
- const { AXPSettingDefinitionProviderService } = await import('@acorex/platform/common');
1068
1168
  const settingsService = this.injector.get(AXPSettingDefinitionProviderService, null, { optional: true });
1069
1169
  if (settingsService && typeof settingsService.reload === 'function') {
1070
1170
  settingsService.reload().catch((error) => {
@@ -1076,7 +1176,6 @@ class AXPModuleProviderLoader {
1076
1176
  // Ignore
1077
1177
  }
1078
1178
  try {
1079
- const { AXPEntityDefinitionRegistryService } = await import('@acorex/platform/layout/entity');
1080
1179
  const entityService = this.injector.get(AXPEntityDefinitionRegistryService, null, { optional: true });
1081
1180
  if (entityService && typeof entityService.clear === 'function') {
1082
1181
  entityService.clear(preserveModules);
@@ -1094,142 +1193,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
1094
1193
  args: [{ providedIn: 'root' }]
1095
1194
  }] });
1096
1195
 
1097
- //#region ---- Imports ----
1098
- //#endregion
1099
- //#region ---- Module Provider Initializer ----
1100
- /**
1101
- * Startup task to automatically load module providers after session restoration.
1102
- * Checks if tenant and application are available, then loads providers conditionally.
1103
- */
1104
- class AXPModuleProviderInitializer {
1105
- constructor() {
1106
- //#region ---- Fields ----
1107
- this.sessionService = inject(AXPSessionService);
1108
- this.injector = inject(Injector);
1109
- this.debugService = inject(AXPDebugService);
1110
- }
1111
- getModuleProviderLoader() {
1112
- return this.injector.get(AXP_MODULE_PROVIDER_LOADER);
1113
- }
1114
- //#endregion
1115
- //#region ---- Public Methods ----
1116
- createRequiredModulesTask() {
1117
- return {
1118
- name: 'RequiredModuleProviders',
1119
- statusText: 'Loading required modules...',
1120
- priority: 1.5,
1121
- run: async () => {
1122
- await this.getModuleProviderLoader().loadRequiredModules();
1123
- },
1124
- };
1125
- }
1126
- createStartupTask() {
1127
- return {
1128
- name: 'ModuleProviders',
1129
- statusText: 'Loading module providers...',
1130
- priority: 3,
1131
- run: async () => {
1132
- await this.loadProvidersIfReady();
1133
- },
1134
- };
1135
- }
1136
- /**
1137
- * Load module providers for a specific application.
1138
- * This method can be called from guards, components, or startup tasks.
1139
- * @param application The application to load providers for
1140
- * @returns Promise that resolves when providers are loaded
1141
- */
1142
- async loadProvidersForApplication(application) {
1143
- try {
1144
- console.log('[ModuleProviderInitializer] loadProvidersForApplication called for application:', application.name);
1145
- if (!application.edition?.id) {
1146
- console.warn('[ModuleProviderInitializer] Application has no edition, skipping provider loading');
1147
- return;
1148
- }
1149
- const editionService = this.injector.get(AXP_EDITION_SERVICE, null, { optional: true });
1150
- if (!editionService) {
1151
- console.warn('[ModuleProviderInitializer] EditionService not available, skipping provider loading');
1152
- return;
1153
- }
1154
- // Use getOne if available, otherwise fallback to query
1155
- let edition;
1156
- const editionServiceWithGetOne = editionService;
1157
- if (typeof editionServiceWithGetOne.getOne === 'function') {
1158
- edition = await editionServiceWithGetOne.getOne(application.edition.id);
1159
- }
1160
- else {
1161
- const editionsResult = await editionService.query({ skip: 0, take: 1000 });
1162
- edition = editionsResult.items.find((e) => e.id === application.edition.id);
1163
- }
1164
- if (!edition) {
1165
- console.warn(`[ModuleProviderInitializer] Edition not found: ${application.edition.id} for application ${application.id}`);
1166
- return;
1167
- }
1168
- const tenant = this.sessionService.tenant;
1169
- const user = this.sessionService.user;
1170
- if (!tenant || !user) {
1171
- throw new Error('Tenant or user is missing');
1172
- }
1173
- console.log('[ModuleProviderInitializer] Loading module providers for application:', application.name);
1174
- await this.getModuleProviderLoader().loadProviders({
1175
- tenant,
1176
- application,
1177
- edition: {
1178
- id: edition.id,
1179
- title: edition.title,
1180
- modulesAndFeatures: edition.modulesAndFeatures,
1181
- },
1182
- subscription: undefined, // TODO: Get subscription if available
1183
- user,
1184
- });
1185
- console.log('[ModuleProviderInitializer] Module providers loaded successfully');
1186
- // Display all loaded modules, features, and permissions
1187
- try {
1188
- await this.debugService.displayUserAccessInfo();
1189
- }
1190
- catch (debugError) {
1191
- console.warn('[ModuleProviderInitializer] Failed to display user access info:', debugError);
1192
- // Don't throw - this is just for debugging
1193
- }
1194
- }
1195
- catch (error) {
1196
- console.error('[ModuleProviderInitializer] Failed to load module providers:', error);
1197
- // Don't throw - allow navigation even if provider loading fails
1198
- }
1199
- }
1200
- async loadProvidersIfReady() {
1201
- try {
1202
- const isLoading = await firstValueFrom(this.sessionService.isLoading$);
1203
- if (isLoading) {
1204
- await firstValueFrom(this.sessionService.isLoading$.pipe(filter((loading) => !loading), take(1)));
1205
- }
1206
- const status = await firstValueFrom(this.sessionService.status$);
1207
- if (status !== AXPSessionStatus.Authenticated && status !== AXPSessionStatus.Authorized) {
1208
- console.log('[ModuleProviderInitializer] User not authenticated, skipping provider loading');
1209
- return;
1210
- }
1211
- const tenant = this.sessionService.tenant;
1212
- const application = this.sessionService.application;
1213
- const user = this.sessionService.user;
1214
- if (!tenant || !application || !user) {
1215
- console.log('[ModuleProviderInitializer] Tenant, application, or user not available, skipping provider loading');
1216
- return;
1217
- }
1218
- // Use the shared method
1219
- await this.loadProvidersForApplication(application);
1220
- }
1221
- catch (error) {
1222
- console.error('[ModuleProviderInitializer] Failed to load module providers:', error);
1223
- }
1224
- }
1225
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleProviderInitializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1226
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleProviderInitializer, providedIn: 'root' }); }
1227
- }
1228
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleProviderInitializer, decorators: [{
1229
- type: Injectable,
1230
- args: [{ providedIn: 'root' }]
1231
- }] });
1232
-
1233
1196
  class AXMAuthModule {
1234
1197
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1235
1198
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: AXMAuthModule, imports: [CommonModule, i1$5.AXPCommonModule, i1$2.RouterModule, AXPAccountModule] }); }
@@ -1253,10 +1216,6 @@ class AXMAuthModule {
1253
1216
  provide: AXP_MODULE_PROVIDER_LOADER,
1254
1217
  useClass: AXPModuleProviderLoader,
1255
1218
  },
1256
- {
1257
- provide: AXP_MODULE_PROVIDER_INITIALIZER,
1258
- useClass: AXPModuleProviderInitializer,
1259
- },
1260
1219
  provideCommandSetups([
1261
1220
  {
1262
1221
  key: 'auth:profile',
@@ -1297,10 +1256,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
1297
1256
  provide: AXP_MODULE_PROVIDER_LOADER,
1298
1257
  useClass: AXPModuleProviderLoader,
1299
1258
  },
1300
- {
1301
- provide: AXP_MODULE_PROVIDER_INITIALIZER,
1302
- useClass: AXPModuleProviderInitializer,
1303
- },
1304
1259
  provideCommandSetups([
1305
1260
  {
1306
1261
  key: 'auth:profile',
@@ -1322,5 +1277,5 @@ var AXMSessionStatusTypes;
1322
1277
  * Generated bundle index. Do not edit.
1323
1278
  */
1324
1279
 
1325
- export { AXM_AUTH_CONFIG_TOKEN as A, AXMAuthenticationTypes as a, AXPTenantChooserDropdownComponent as b, AXPAppChooserListComponent as c, AXMUserDeviceSessionsService as d, AXMAuthErrorHandler as e, AXMDefaultAuthConfigs as f, configAuthModule as g, AXMAuthModule as h, AXMSessionStatusTypes as i, AXPIdleService as j, AXMDeviceSessionsService as k, AXMDeviceSessionsServiceImpl as l, AXPModuleProviderLoader as m, AXPModuleProviderInitializer as n };
1326
- //# sourceMappingURL=acorex-modules-auth-acorex-modules-auth-Xhv636ad.mjs.map
1280
+ export { AXM_AUTH_CONFIG_TOKEN as A, AXMAuthenticationTypes as a, AXPTenantChooserDropdownComponent as b, AXPAppChooserListComponent as c, AXMUserDeviceSessionsService as d, AXMAuthErrorHandler as e, AXMDefaultAuthConfigs as f, configAuthModule as g, AXMAuthModule as h, AXMSessionStatusTypes as i, AXPIdleService as j, AXMDeviceSessionsService as k, AXMDeviceSessionsServiceImpl as l, AXPModuleProviderLoader as m };
1281
+ //# sourceMappingURL=acorex-modules-auth-acorex-modules-auth-DyMrPzio.mjs.map