@acorex/platform 21.0.0-next.1 → 21.0.0-next.11

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 (87) hide show
  1. package/auth/index.d.ts +235 -5
  2. package/common/index.d.ts +220 -218
  3. package/core/index.d.ts +370 -434
  4. package/fesm2022/acorex-platform-auth.mjs +200 -37
  5. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  6. package/fesm2022/{acorex-platform-common-common-settings.provider-zhqNP3xb.mjs → acorex-platform-common-common-settings.provider-O8usQ0VC.mjs} +4 -4
  7. package/fesm2022/{acorex-platform-common-common-settings.provider-zhqNP3xb.mjs.map → acorex-platform-common-common-settings.provider-O8usQ0VC.mjs.map} +1 -1
  8. package/fesm2022/acorex-platform-common.mjs +215 -198
  9. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-core.mjs +548 -585
  11. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-domain.mjs +16 -16
  13. package/fesm2022/acorex-platform-domain.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-layout-builder.mjs +84 -37
  15. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-layout-components.mjs +303 -195
  17. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  18. package/fesm2022/acorex-platform-layout-designer.mjs +72 -72
  19. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  20. package/fesm2022/acorex-platform-layout-entity.mjs +3528 -1698
  21. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  22. package/fesm2022/acorex-platform-layout-views.mjs +25 -17
  23. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  24. package/fesm2022/acorex-platform-layout-widget-core.mjs +190 -110
  25. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  26. package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs → acorex-platform-layout-widgets-button-widget-designer.component-D-NsRvRl.mjs} +4 -4
  27. package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs.map → acorex-platform-layout-widgets-button-widget-designer.component-D-NsRvRl.mjs.map} +1 -1
  28. package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs → acorex-platform-layout-widgets-file-list-popup.component-CCcKHSHj.mjs} +4 -4
  29. package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map → acorex-platform-layout-widgets-file-list-popup.component-CCcKHSHj.mjs.map} +1 -1
  30. package/fesm2022/{acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs → acorex-platform-layout-widgets-image-preview.popup-IrT52Nh1.mjs} +4 -4
  31. package/fesm2022/{acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map → acorex-platform-layout-widgets-image-preview.popup-IrT52Nh1.mjs.map} +1 -1
  32. package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs → acorex-platform-layout-widgets-page-widget-designer.component-DFbfh-OX.mjs} +4 -4
  33. package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs.map → acorex-platform-layout-widgets-page-widget-designer.component-DFbfh-OX.mjs.map} +1 -1
  34. package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-Dw6naXvq.mjs +111 -0
  35. package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-Dw6naXvq.mjs.map +1 -0
  36. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component--4R3TUdJ.mjs} +4 -4
  37. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map → acorex-platform-layout-widgets-tabular-data-edit-popup.component--4R3TUdJ.mjs.map} +1 -1
  38. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-BeVQuHFj.mjs} +4 -4
  39. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map → acorex-platform-layout-widgets-tabular-data-view-popup.component-BeVQuHFj.mjs.map} +1 -1
  40. package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-CdQxqi0D.mjs} +4 -4
  41. package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs.map → acorex-platform-layout-widgets-text-block-widget-designer.component-CdQxqi0D.mjs.map} +1 -1
  42. package/fesm2022/acorex-platform-layout-widgets.mjs +2247 -1226
  43. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  44. package/fesm2022/acorex-platform-native.mjs +7 -7
  45. package/fesm2022/acorex-platform-native.mjs.map +1 -1
  46. package/fesm2022/acorex-platform-runtime.mjs +43 -43
  47. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  48. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs → acorex-platform-themes-default-entity-master-create-view.component-D2ucwC3F.mjs} +4 -4
  49. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-D2ucwC3F.mjs.map} +1 -1
  50. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs → acorex-platform-themes-default-entity-master-list-view.component-CD4Q_UIG.mjs} +13 -13
  51. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CD4Q_UIG.mjs.map +1 -0
  52. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs → acorex-platform-themes-default-entity-master-modify-view.component-D5BYbUGK.mjs} +7 -8
  53. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-D5BYbUGK.mjs.map +1 -0
  54. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs → acorex-platform-themes-default-entity-master-single-view.component-Cf4ei46_.mjs} +7 -7
  55. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map → acorex-platform-themes-default-entity-master-single-view.component-Cf4ei46_.mjs.map} +1 -1
  56. package/fesm2022/{acorex-platform-themes-default-error-401.component-cfREo88K.mjs → acorex-platform-themes-default-error-401.component-DdMToZ9q.mjs} +4 -4
  57. package/fesm2022/{acorex-platform-themes-default-error-401.component-cfREo88K.mjs.map → acorex-platform-themes-default-error-401.component-DdMToZ9q.mjs.map} +1 -1
  58. package/fesm2022/{acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs → acorex-platform-themes-default-error-404.component-CKsa5aPE.mjs} +4 -4
  59. package/fesm2022/{acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs.map → acorex-platform-themes-default-error-404.component-CKsa5aPE.mjs.map} +1 -1
  60. package/fesm2022/{acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs → acorex-platform-themes-default-error-offline.component-1gxFTAuX.mjs} +4 -4
  61. package/fesm2022/{acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs.map → acorex-platform-themes-default-error-offline.component-1gxFTAuX.mjs.map} +1 -1
  62. package/fesm2022/acorex-platform-themes-default.mjs +39 -42
  63. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  64. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs → acorex-platform-themes-shared-icon-chooser-column.component-Ds8eRMuV.mjs} +4 -4
  65. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map → acorex-platform-themes-shared-icon-chooser-column.component-Ds8eRMuV.mjs.map} +1 -1
  66. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs → acorex-platform-themes-shared-icon-chooser-view.component-Dv38sOzr.mjs} +4 -4
  67. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs.map → acorex-platform-themes-shared-icon-chooser-view.component-Dv38sOzr.mjs.map} +1 -1
  68. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-DcO6P6OG.mjs} +11 -11
  69. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DcO6P6OG.mjs.map +1 -0
  70. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-B7T2qtaI.mjs} +4 -4
  71. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs.map → acorex-platform-themes-shared-theme-color-chooser-view.component-B7T2qtaI.mjs.map} +1 -1
  72. package/fesm2022/acorex-platform-themes-shared.mjs +41 -41
  73. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  74. package/fesm2022/acorex-platform-workflow.mjs +1529 -1758
  75. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  76. package/layout/builder/index.d.ts +15 -3
  77. package/layout/components/index.d.ts +23 -6
  78. package/layout/entity/index.d.ts +438 -159
  79. package/layout/views/index.d.ts +16 -11
  80. package/layout/widget-core/index.d.ts +47 -10
  81. package/layout/widgets/index.d.ts +213 -42
  82. package/package.json +5 -5
  83. package/themes/default/index.d.ts +0 -1
  84. package/workflow/index.d.ts +1050 -1759
  85. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +0 -1
  86. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +0 -1
  87. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs.map +0 -1
@@ -1,6 +1,6 @@
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, AXP_MODULE_PROVIDER_LOADER, AXPModuleProviderRegistry, AXP_SESSION_SERVICE } from '@acorex/platform/core';
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
6
 
@@ -72,10 +72,10 @@ class AXPAuthStrategyRegistryService {
72
72
  get(strategyKey) {
73
73
  return this.strategies.get(strategyKey);
74
74
  }
75
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthStrategyRegistryService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
76
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthStrategyRegistryService, providedIn: 'root' }); }
75
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPAuthStrategyRegistryService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
76
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPAuthStrategyRegistryService, providedIn: 'root' }); }
77
77
  }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthStrategyRegistryService, decorators: [{
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPAuthStrategyRegistryService, decorators: [{
79
79
  type: Injectable,
80
80
  args: [{
81
81
  providedIn: 'root'
@@ -132,10 +132,10 @@ class AXPFeatureDirective {
132
132
  ngOnDestroy() {
133
133
  this.subscription?.unsubscribe();
134
134
  }
135
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPFeatureDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
136
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: AXPFeatureDirective, isStandalone: false, selector: "[feature]", inputs: { feature: "feature", featureElse: "featureElse" }, ngImport: i0 }); }
135
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPFeatureDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
136
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: AXPFeatureDirective, isStandalone: false, selector: "[feature]", inputs: { feature: "feature", featureElse: "featureElse" }, ngImport: i0 }); }
137
137
  }
138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPFeatureDirective, decorators: [{
138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPFeatureDirective, decorators: [{
139
139
  type: Directive,
140
140
  args: [{
141
141
  selector: '[feature]',
@@ -236,11 +236,11 @@ class AXPSessionService {
236
236
  constructor() {
237
237
  this.eventService = inject(AXPBroadcastEventService);
238
238
  this.authStrategyRegistry = inject(AXPAuthStrategyRegistryService);
239
+ this.injector = inject(Injector);
239
240
  this.permissionLoader = inject(AXP_PERMISSION_LOADER);
240
241
  this.featureLoader = inject(AXP_FEATURE_LOADER);
241
242
  this.tenantLoader = inject(AXP_TENANT_LOADER);
242
243
  this.applicationLoader = inject(AXP_APPLICATION_LOADER);
243
- this.moduleProviderLoader = inject(AXP_MODULE_PROVIDER_LOADER);
244
244
  this.permissionChecker = inject(AXP_PERMISSION_CHECKER, { optional: true });
245
245
  this.featureChecker = inject(AXP_FEATURE_CHECKER, { optional: true });
246
246
  this.status = new BehaviorSubject(AXPSessionStatus.Unauthenticated);
@@ -322,10 +322,6 @@ class AXPSessionService {
322
322
  this.currentApplicationSubject.next(sessionData.application);
323
323
  }
324
324
  this.status.next(AXPSessionStatus.Authenticated);
325
- // Load required modules first to ensure entities are available for loaders
326
- // This is critical because loaders (like application.loader) need entities
327
- // from required modules (ApplicationManagement, TenantManagement, SecurityManagement)
328
- await this.moduleProviderLoader.loadRequiredModules();
329
325
  await this.loadPermissions();
330
326
  await this.loadFeatures();
331
327
  await this.signInComplete();
@@ -443,9 +439,6 @@ class AXPSessionService {
443
439
  }
444
440
  //
445
441
  const userId = this.user?.id;
446
- // Clear module provider loader cache before clearing session
447
- // This ensures modules and providers from previous user are not cached
448
- await this.moduleProviderLoader.clear();
449
442
  this.clearSession();
450
443
  this.eventService.publish(AXPSessionStatus.SignedOut, { id: userId });
451
444
  this.isLoading.next(false);
@@ -613,6 +606,22 @@ class AXPSessionService {
613
606
  }
614
607
  return baseResult;
615
608
  }
609
+ /**
610
+ * Checks if a module is enabled for the current tenant/application.
611
+ * Module names are stored as features with value: true when enabled.
612
+ * Module names can be provided in PascalCase (e.g., 'SecurityManagement') or kebab-case (e.g., 'security-management').
613
+ */
614
+ isModuleEnabled(moduleName) {
615
+ if (!moduleName) {
616
+ return false;
617
+ }
618
+ // Normalize module name: convert kebab-case to PascalCase if needed
619
+ const normalizedModuleName = moduleName.includes('-')
620
+ ? moduleName.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('')
621
+ : moduleName;
622
+ // Module names are stored as features with value: true when enabled
623
+ return this.features.some(f => f.name === normalizedModuleName && f.value === true);
624
+ }
616
625
  getToken() {
617
626
  const sessionData = this.getSessionData();
618
627
  return sessionData?.accessToken;
@@ -624,10 +633,10 @@ class AXPSessionService {
624
633
  application: this.application,
625
634
  });
626
635
  }
627
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPSessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
628
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPSessionService, providedIn: 'root' }); }
636
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPSessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
637
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPSessionService, providedIn: 'root' }); }
629
638
  }
630
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPSessionService, decorators: [{
639
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPSessionService, decorators: [{
631
640
  type: Injectable,
632
641
  args: [{
633
642
  providedIn: 'root',
@@ -671,10 +680,10 @@ class AXPPermissionDirective {
671
680
  ngOnDestroy() {
672
681
  this.subscription?.unsubscribe();
673
682
  }
674
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
675
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: AXPPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission", permissionElse: "permissionElse" }, ngImport: i0 }); }
683
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPPermissionDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
684
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: AXPPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission", permissionElse: "permissionElse" }, ngImport: i0 }); }
676
685
  }
677
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDirective, decorators: [{
686
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPPermissionDirective, decorators: [{
678
687
  type: Directive,
679
688
  args: [{
680
689
  selector: '[permission]',
@@ -796,7 +805,6 @@ const AXP_PERMISSION_DEFINITION_PROVIDER = new InjectionToken('AXP_PERMISSION_DE
796
805
  class AXPPermissionDefinitionService {
797
806
  constructor() {
798
807
  this.providers = inject(AXP_PERMISSION_DEFINITION_PROVIDER, { optional: true });
799
- this.providerRegistry = inject(AXPModuleProviderRegistry);
800
808
  this.sessionService = inject(AXPSessionService);
801
809
  this.cache = null;
802
810
  }
@@ -805,7 +813,7 @@ class AXPPermissionDefinitionService {
805
813
  return;
806
814
  }
807
815
  const context = new AXPPermissionDefinitionProviderContext();
808
- // Load providers from DI tokens (backward compatibility)
816
+ // Load providers from DI tokens
809
817
  if (Array.isArray(this.providers)) {
810
818
  for (const provider of this.providers) {
811
819
  if (provider instanceof Promise) {
@@ -819,11 +827,6 @@ class AXPPermissionDefinitionService {
819
827
  }
820
828
  }
821
829
  }
822
- // Load providers from registry (manifest-based, conditionally loaded)
823
- const registryProviders = this.providerRegistry.getPermissionProviders();
824
- for (const provider of registryProviders) {
825
- await provider.define(context);
826
- }
827
830
  // Filter permissions based on required features
828
831
  const allGroups = context.getGroupDefinitions();
829
832
  this.cache = this.filterByFeatures(allGroups);
@@ -883,10 +886,10 @@ class AXPPermissionDefinitionService {
883
886
  await this.load();
884
887
  return this.cache?.find(g => g.permissions.find(p => p.name === name))?.permissions.find(p => p.name === name) ?? null;
885
888
  }
886
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
887
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDefinitionService, providedIn: 'root' }); }
889
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPPermissionDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
890
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPPermissionDefinitionService, providedIn: 'root' }); }
888
891
  }
889
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDefinitionService, decorators: [{
892
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPPermissionDefinitionService, decorators: [{
890
893
  type: Injectable,
891
894
  args: [{ providedIn: 'root' }]
892
895
  }] });
@@ -980,9 +983,9 @@ class AXPAuthModule {
980
983
  f();
981
984
  });
982
985
  }
983
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, deps: [{ token: 'AXPAuthModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
984
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, declarations: [AXPPermissionDirective, AXPFeatureDirective], exports: [AXPPermissionDirective, AXPFeatureDirective] }); }
985
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, providers: [
986
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPAuthModule, deps: [{ token: 'AXPAuthModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
987
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXPAuthModule, declarations: [AXPPermissionDirective, AXPFeatureDirective], exports: [AXPPermissionDirective, AXPFeatureDirective] }); }
988
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPAuthModule, providers: [
986
989
  provideAppInitializer(() => {
987
990
  const initializerFn = initializeAppState(inject(AXPSessionService));
988
991
  return initializerFn();
@@ -993,7 +996,7 @@ class AXPAuthModule {
993
996
  },
994
997
  ] }); }
995
998
  }
996
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, decorators: [{
999
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPAuthModule, decorators: [{
997
1000
  type: NgModule,
998
1001
  args: [{
999
1002
  imports: [],
@@ -1097,9 +1100,169 @@ class TimeUtil {
1097
1100
  }
1098
1101
  //#endregion
1099
1102
 
1103
+ //#region ---- Challenge Data Types ----
1104
+ //#endregion
1105
+
1106
+ //#region ---- Abstract Challenge Provider ----
1107
+ /**
1108
+ * Abstract base class for login challenge providers
1109
+ *
1110
+ * Implement this class to create custom challenge mechanisms like:
1111
+ * - Image CAPTCHA
1112
+ * - reCAPTCHA
1113
+ * - SMS verification
1114
+ * - Email verification
1115
+ *
1116
+ * @example
1117
+ * ```typescript
1118
+ * @Injectable()
1119
+ * export class MyImageCaptchaProvider extends AXPLoginChallengeProvider {
1120
+ * readonly name = 'image-captcha';
1121
+ *
1122
+ * checkResponse(error: unknown): AXPChallengeCheckResult | null {
1123
+ * if (error instanceof HttpErrorResponse) {
1124
+ * if (error.error?.requiresCaptcha) {
1125
+ * return { required: true };
1126
+ * }
1127
+ * }
1128
+ * return null;
1129
+ * }
1130
+ *
1131
+ * async getChallenge(): Promise<AXPLoginChallengeData> {
1132
+ * const response = await this.http.get('/api/captcha').toPromise();
1133
+ * return {
1134
+ * id: response.id,
1135
+ * content: response.image,
1136
+ * contentType: 'image-base64'
1137
+ * };
1138
+ * }
1139
+ *
1140
+ * async refreshChallenge(): Promise<AXPLoginChallengeData> {
1141
+ * return this.getChallenge();
1142
+ * }
1143
+ *
1144
+ * getChallengeComponent(): Type<AXPLoginChallengeComponentBase> {
1145
+ * return MyCaptchaChallengeComponent;
1146
+ * }
1147
+ * }
1148
+ * ```
1149
+ */
1150
+ class AXPLoginChallengeProvider {
1151
+ /**
1152
+ * Returns the component type for rendering the challenge UI
1153
+ *
1154
+ * Override this method to provide a custom challenge UI component.
1155
+ * If not overridden (returns null), the login component will use
1156
+ * a default built-in UI.
1157
+ *
1158
+ * @returns Component type extending AXPLoginChallengeComponentBase, or null for default UI
1159
+ */
1160
+ getChallengeComponent() {
1161
+ return null;
1162
+ }
1163
+ }
1164
+ //#endregion
1165
+
1166
+ //#region ---- Injection Token ----
1167
+ /**
1168
+ * Injection token for the login challenge provider
1169
+ *
1170
+ * This token is optional - if not provided, no challenge mechanism will be used.
1171
+ *
1172
+ * @example
1173
+ * ```typescript
1174
+ * // In your app module or provider configuration:
1175
+ * providers: [
1176
+ * {
1177
+ * provide: AXP_LOGIN_CHALLENGE_PROVIDER,
1178
+ * useClass: MyImageCaptchaProvider
1179
+ * }
1180
+ * ]
1181
+ *
1182
+ * // In a component:
1183
+ * private challengeProvider = inject(AXP_LOGIN_CHALLENGE_PROVIDER, { optional: true });
1184
+ * ```
1185
+ */
1186
+ const AXP_LOGIN_CHALLENGE_PROVIDER = new InjectionToken('AXP_LOGIN_CHALLENGE_PROVIDER');
1187
+ //#endregion
1188
+
1189
+ //#region ---- Base Challenge Component ----
1190
+ /**
1191
+ * Base class for login challenge UI components
1192
+ *
1193
+ * Providers can extend this class to create custom challenge UIs.
1194
+ * The login component will render this component and listen to its outputs.
1195
+ *
1196
+ * @example
1197
+ * ```typescript
1198
+ * @Component({
1199
+ * selector: 'my-captcha-challenge',
1200
+ * template: `
1201
+ * <div class="captcha-container">
1202
+ * <img [src]="'data:image/png;base64,' + challengeData().content" />
1203
+ * <input
1204
+ * type="text"
1205
+ * [value]="response()"
1206
+ * (input)="onResponseChange($event)"
1207
+ * />
1208
+ * <button (click)="onRefreshClick()">Refresh</button>
1209
+ * </div>
1210
+ * `
1211
+ * })
1212
+ * export class MyCaptchaChallengeComponent extends AXPLoginChallengeComponentBase {
1213
+ * response = signal('');
1214
+ *
1215
+ * onResponseChange(event: Event) {
1216
+ * const value = (event.target as HTMLInputElement).value;
1217
+ * this.response.set(value);
1218
+ * this.responseChange.emit(value);
1219
+ * }
1220
+ *
1221
+ * onRefreshClick() {
1222
+ * this.refreshRequest.emit();
1223
+ * }
1224
+ * }
1225
+ * ```
1226
+ */
1227
+ class AXPLoginChallengeComponentBase {
1228
+ constructor() {
1229
+ //#region ---- Inputs ----
1230
+ /**
1231
+ * Challenge data to display
1232
+ * Contains the image/content and metadata from the server
1233
+ */
1234
+ this.challengeData = input.required(...(ngDevMode ? [{ debugName: "challengeData" }] : []));
1235
+ /**
1236
+ * Whether the challenge is currently loading (e.g., refreshing)
1237
+ */
1238
+ this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
1239
+ //#endregion
1240
+ //#region ---- Outputs ----
1241
+ /**
1242
+ * Emits when the user enters or changes their response
1243
+ * The login component will capture this value and include it in credentials
1244
+ */
1245
+ this.responseChange = output();
1246
+ /**
1247
+ * Emits when the user requests a new challenge (e.g., clicks refresh button)
1248
+ * The login component will call provider.refreshChallenge()
1249
+ */
1250
+ this.refreshRequest = output();
1251
+ }
1252
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPLoginChallengeComponentBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1253
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.15", 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 }); }
1254
+ }
1255
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPLoginChallengeComponentBase, decorators: [{
1256
+ type: Component,
1257
+ args: [{
1258
+ template: '',
1259
+ standalone: true,
1260
+ }]
1261
+ }], 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"] }] } });
1262
+
1100
1263
  /**
1101
1264
  * Generated bundle index. Do not edit.
1102
1265
  */
1103
1266
 
1104
- 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 };
1267
+ export { AXPAuthGuard, AXPAuthModule, AXPAuthStrategy, AXPAuthStrategyRegistryService, AXPFeatureDirective, AXPFeatureGuard, AXPLoginChallengeComponentBase, AXPLoginChallengeProvider, AXPPermissionDefinitionBuilder, AXPPermissionDefinitionGroupBuilder, AXPPermissionDefinitionProviderContext, AXPPermissionDefinitionService, 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, PkceUtil, TimeUtil, initializeAppState };
1105
1268
  //# sourceMappingURL=acorex-platform-auth.mjs.map