@acorex/platform 21.0.0-next.8 → 21.0.0-next.85

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 (133) hide show
  1. package/contracts/README.md +3 -0
  2. package/fesm2022/acorex-platform-auth.mjs +201 -81
  3. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  4. package/fesm2022/acorex-platform-common-common-settings.provider-Ytey9uhY.mjs +177 -0
  5. package/fesm2022/acorex-platform-common-common-settings.provider-Ytey9uhY.mjs.map +1 -0
  6. package/fesm2022/acorex-platform-common.mjs +4490 -880
  7. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-contracts.mjs +38 -0
  9. package/fesm2022/acorex-platform-contracts.mjs.map +1 -0
  10. package/fesm2022/acorex-platform-core.mjs +2612 -667
  11. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-domain.mjs +557 -826
  13. package/fesm2022/acorex-platform-domain.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-layout-builder.mjs +1255 -209
  15. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs +121 -0
  17. package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs.map +1 -0
  18. package/fesm2022/acorex-platform-layout-components.mjs +6493 -1920
  19. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  20. package/fesm2022/acorex-platform-layout-designer.mjs +612 -287
  21. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  22. package/fesm2022/acorex-platform-layout-entity-attachments-page.component-CwG6n_Yb.mjs +376 -0
  23. package/fesm2022/acorex-platform-layout-entity-attachments-page.component-CwG6n_Yb.mjs.map +1 -0
  24. package/fesm2022/acorex-platform-layout-entity-file-list-popup.component--IeMZLIr.mjs +100 -0
  25. package/fesm2022/acorex-platform-layout-entity-file-list-popup.component--IeMZLIr.mjs.map +1 -0
  26. package/fesm2022/acorex-platform-layout-entity.mjs +22502 -9964
  27. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  28. package/fesm2022/acorex-platform-layout-views.mjs +1395 -387
  29. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  30. package/fesm2022/acorex-platform-layout-widget-core.mjs +2226 -524
  31. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  32. 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
  33. package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs.map +1 -0
  34. package/fesm2022/{acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs → acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs} +6 -7
  35. package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map +1 -0
  36. package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs → acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs} +12 -12
  37. package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs.map +1 -0
  38. package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-J0zcGKBX.mjs +116 -0
  39. package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-J0zcGKBX.mjs.map +1 -0
  40. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-DjpZU6gz.mjs} +6 -6
  41. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-DjpZU6gz.mjs.map +1 -0
  42. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-gX-3Kx9I.mjs} +5 -5
  43. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-gX-3Kx9I.mjs.map +1 -0
  44. 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
  45. package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs.map +1 -0
  46. package/fesm2022/acorex-platform-layout-widgets.mjs +18746 -16718
  47. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  48. package/fesm2022/acorex-platform-native.mjs +8 -7
  49. package/fesm2022/acorex-platform-native.mjs.map +1 -1
  50. package/fesm2022/acorex-platform-runtime.mjs +391 -166
  51. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  52. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CWLfNqV0.mjs +160 -0
  53. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CWLfNqV0.mjs.map +1 -0
  54. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-C7cT82K2.mjs +120 -0
  55. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-C7cT82K2.mjs.map +1 -0
  56. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs → acorex-platform-themes-default-entity-master-single-view.component-Br9p5aXT.mjs} +21 -28
  57. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Br9p5aXT.mjs.map +1 -0
  58. package/fesm2022/acorex-platform-themes-default-error-401.component-B1nsdpTY.mjs +48 -0
  59. package/fesm2022/acorex-platform-themes-default-error-401.component-B1nsdpTY.mjs.map +1 -0
  60. package/fesm2022/acorex-platform-themes-default-error-404.component-D4UvRe8u.mjs +42 -0
  61. package/fesm2022/acorex-platform-themes-default-error-404.component-D4UvRe8u.mjs.map +1 -0
  62. package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs +19 -0
  63. package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs.map +1 -0
  64. package/fesm2022/acorex-platform-themes-default.mjs +2337 -94
  65. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  66. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs → acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs} +6 -6
  67. package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs.map +1 -0
  68. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs → acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs} +6 -6
  69. package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs.map +1 -0
  70. package/fesm2022/{acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs → acorex-platform-themes-shared-settings.provider-BjuzSe0T.mjs} +52 -33
  71. package/fesm2022/acorex-platform-themes-shared-settings.provider-BjuzSe0T.mjs.map +1 -0
  72. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs +94 -0
  73. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs.map +1 -0
  74. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs +86 -0
  75. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs.map +1 -0
  76. package/fesm2022/acorex-platform-themes-shared.mjs +793 -612
  77. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  78. package/fesm2022/acorex-platform-workflow.mjs +997 -274
  79. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  80. package/fesm2022/acorex-platform.mjs.map +1 -1
  81. package/package.json +41 -35
  82. package/{auth/index.d.ts → types/acorex-platform-auth.d.ts} +40 -19
  83. package/types/acorex-platform-common.d.ts +3673 -0
  84. package/types/acorex-platform-contracts.d.ts +940 -0
  85. package/{core/index.d.ts → types/acorex-platform-core.d.ts} +1029 -170
  86. package/{domain/index.d.ts → types/acorex-platform-domain.d.ts} +744 -412
  87. package/{layout/builder/index.d.ts → types/acorex-platform-layout-builder.d.ts} +262 -55
  88. package/types/acorex-platform-layout-components.d.ts +3329 -0
  89. package/{layout/designer/index.d.ts → types/acorex-platform-layout-designer.d.ts} +96 -18
  90. package/types/acorex-platform-layout-entity.d.ts +4512 -0
  91. package/{layout/views/index.d.ts → types/acorex-platform-layout-views.d.ts} +334 -91
  92. package/{layout/widget-core/index.d.ts → types/acorex-platform-layout-widget-core.d.ts} +438 -162
  93. package/{layout/widgets/index.d.ts → types/acorex-platform-layout-widgets.d.ts} +1152 -507
  94. package/{native/index.d.ts → types/acorex-platform-native.d.ts} +0 -7
  95. package/types/acorex-platform-runtime.d.ts +571 -0
  96. package/{themes/default/index.d.ts → types/acorex-platform-themes-default.d.ts} +268 -11
  97. package/{themes/shared/index.d.ts → types/acorex-platform-themes-shared.d.ts} +30 -2
  98. package/{workflow/index.d.ts → types/acorex-platform-workflow.d.ts} +436 -748
  99. package/common/index.d.ts +0 -2470
  100. package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs +0 -71
  101. package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs.map +0 -1
  103. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs +0 -135
  104. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +0 -1
  105. package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map +0 -1
  106. package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +0 -1
  108. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map +0 -1
  109. package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs.map +0 -1
  110. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs +0 -157
  111. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +0 -1
  112. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D3qZa5fM.mjs +0 -1542
  113. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D3qZa5fM.mjs.map +0 -1
  114. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +0 -101
  115. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +0 -1
  116. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +0 -1
  117. package/fesm2022/acorex-platform-themes-default-error-401.component-cfREo88K.mjs +0 -31
  118. package/fesm2022/acorex-platform-themes-default-error-401.component-cfREo88K.mjs.map +0 -1
  119. package/fesm2022/acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs +0 -25
  120. package/fesm2022/acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs.map +0 -1
  121. package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs +0 -19
  122. package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs.map +0 -1
  123. package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map +0 -1
  124. package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs.map +0 -1
  125. package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +0 -1
  126. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-Dz0cylyQ.mjs +0 -65
  127. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-Dz0cylyQ.mjs.map +0 -1
  128. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs +0 -64
  129. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs.map +0 -1
  130. package/layout/components/index.d.ts +0 -1670
  131. package/layout/entity/index.d.ts +0 -2294
  132. package/runtime/index.d.ts +0 -307
  133. /package/{index.d.ts → types/acorex-platform.d.ts} +0 -0
@@ -0,0 +1,3 @@
1
+ # @acorex/platform/contracts
2
+
3
+ Secondary entry point of `@acorex/platform`. It can be used by importing from `@acorex/platform/contracts`.
@@ -3,6 +3,8 @@ import { InjectionToken, Injector, Injectable, signal, inject, Input, Directive,
3
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',
@@ -37,6 +39,60 @@ class AXPApplicationDefaultLoader {
37
39
  }
38
40
  }
39
41
 
42
+ //#region ---- Datasource keys ----
43
+ /** Platform auth datasource registry names. */
44
+ const AXPPlatformAuthDataSourceKeys = {
45
+ PermissionDefinitions: 'platform-permission-definitions',
46
+ };
47
+ //#endregion
48
+
49
+ class AXPUnauthorizedError extends Error {
50
+ constructor(message, data) {
51
+ super(message);
52
+ this.data = data;
53
+ this.name = 'AXPUnauthorizedError';
54
+ }
55
+ }
56
+ class AXPUnauthenticatedError extends Error {
57
+ constructor(message, data) {
58
+ super(message);
59
+ this.data = data;
60
+ this.name = 'AXPUnauthenticatedError';
61
+ }
62
+ }
63
+
64
+ class AXPSessionContext {
65
+ get user() {
66
+ return this._user;
67
+ }
68
+ get tenant() {
69
+ return this._tenant;
70
+ }
71
+ get application() {
72
+ return this._application;
73
+ }
74
+ constructor(context) {
75
+ this._user = null;
76
+ this._tenant = null;
77
+ this._application = null;
78
+ this._user = context.user;
79
+ this._tenant = context.tenant;
80
+ this._application = context.application;
81
+ }
82
+ }
83
+ var AXPSessionStatus;
84
+ (function (AXPSessionStatus) {
85
+ AXPSessionStatus["Authenticated"] = "authenticated";
86
+ AXPSessionStatus["Unauthenticated"] = "unauthenticated";
87
+ AXPSessionStatus["Unauthorized"] = "unauthorized";
88
+ AXPSessionStatus["Authorized"] = "authorized";
89
+ AXPSessionStatus["Expired"] = "expired";
90
+ AXPSessionStatus["SignedOut"] = "signedOut";
91
+ })(AXPSessionStatus || (AXPSessionStatus = {}));
92
+
93
+ //#region ---- Contracts barrel ----
94
+ //#endregion
95
+
40
96
  const AXP_TENANT_LOADER = new InjectionToken('AXP_TENANT_LOADER', {
41
97
  providedIn: 'root',
42
98
  factory: () => {
@@ -72,10 +128,10 @@ class AXPAuthStrategyRegistryService {
72
128
  get(strategyKey) {
73
129
  return this.strategies.get(strategyKey);
74
130
  }
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' }); }
131
+ 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 }); }
132
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthStrategyRegistryService, providedIn: 'root' }); }
77
133
  }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthStrategyRegistryService, decorators: [{
134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthStrategyRegistryService, decorators: [{
79
135
  type: Injectable,
80
136
  args: [{
81
137
  providedIn: 'root'
@@ -98,7 +154,7 @@ class AXPFeatureDirective {
98
154
  constructor(templateRef, viewContainer) {
99
155
  this.templateRef = templateRef;
100
156
  this.viewContainer = viewContainer;
101
- this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : []));
157
+ this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : /* istanbul ignore next */ []));
102
158
  this.sessionService = inject(AXPSessionService);
103
159
  }
104
160
  set feature(featureKeys) {
@@ -132,10 +188,10 @@ class AXPFeatureDirective {
132
188
  ngOnDestroy() {
133
189
  this.subscription?.unsubscribe();
134
190
  }
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 }); }
191
+ 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 }); }
192
+ 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
193
  }
138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPFeatureDirective, decorators: [{
194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPFeatureDirective, decorators: [{
139
195
  type: Directive,
140
196
  args: [{
141
197
  selector: '[feature]',
@@ -147,21 +203,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
147
203
  type: Input
148
204
  }] } });
149
205
 
150
- class AXPUnauthorizedError extends Error {
151
- constructor(message, data) {
152
- super(message);
153
- this.data = data;
154
- this.name = 'AXPUnauthorizedError';
155
- }
156
- }
157
- class AXPUnauthenticatedError extends Error {
158
- constructor(message, data) {
159
- super(message);
160
- this.data = data;
161
- this.name = 'AXPUnauthenticatedError';
162
- }
163
- }
164
-
165
206
  const AXPFeatureGuard = (route, state) => {
166
207
  const sessionService = inject(AXPSessionService);
167
208
  const requiredFeatures = route.data['requiredFeature'];
@@ -203,35 +244,6 @@ class AXPPermissionDefaultLoader {
203
244
  */
204
245
  const AXP_PERMISSION_CHECKER = new InjectionToken('AXP_PERMISSION_CHECKER');
205
246
 
206
- class AXPSessionContext {
207
- get user() {
208
- return this._user;
209
- }
210
- get tenant() {
211
- return this._tenant;
212
- }
213
- get application() {
214
- return this._application;
215
- }
216
- constructor(context) {
217
- this._user = null;
218
- this._tenant = null;
219
- this._application = null;
220
- this._user = context.user;
221
- this._tenant = context.tenant;
222
- this._application = context.application;
223
- }
224
- }
225
- var AXPSessionStatus;
226
- (function (AXPSessionStatus) {
227
- AXPSessionStatus["Authenticated"] = "authenticated";
228
- AXPSessionStatus["Unauthenticated"] = "unauthenticated";
229
- AXPSessionStatus["Unauthorized"] = "unauthorized";
230
- AXPSessionStatus["Authorized"] = "authorized";
231
- AXPSessionStatus["Expired"] = "expired";
232
- AXPSessionStatus["SignedOut"] = "signedOut";
233
- })(AXPSessionStatus || (AXPSessionStatus = {}));
234
-
235
247
  class AXPSessionService {
236
248
  constructor() {
237
249
  this.eventService = inject(AXPBroadcastEventService);
@@ -272,6 +284,13 @@ class AXPSessionService {
272
284
  return this.isAuthenticated$;
273
285
  }), shareReplay(1));
274
286
  this.isAuthorized$ = this.status$.pipe(map((status) => status === AXPSessionStatus.Authorized), shareReplay(1));
287
+ /** Waits for session restore to finish, then emits whether the session is fully authorized. */
288
+ this.isAuthorizedWithLoading$ = this.isLoading$.pipe(switchMap((loading) => {
289
+ if (loading) {
290
+ return this.isLoading$.pipe(filter((isLoading) => !isLoading), switchMap(() => this.isAuthorized$));
291
+ }
292
+ return this.isAuthorized$;
293
+ }), shareReplay(1));
275
294
  }
276
295
  static { this.SESSION_KEY = 'AXP_SESSION'; }
277
296
  get user() {
@@ -352,6 +371,8 @@ class AXPSessionService {
352
371
  if (!result)
353
372
  return;
354
373
  if (result?.succeed) {
374
+ this.permissionsSubject.next([]);
375
+ this.featuresSubject.next([]);
355
376
  this.currentUserSubject.next(result.data.user);
356
377
  this.setSession({
357
378
  accessToken: result.data.accessToken,
@@ -362,7 +383,10 @@ class AXPSessionService {
362
383
  tenant: result.data?.tenant,
363
384
  expiresIn: result.data?.expiresIn,
364
385
  idToken: result.data?.idToken ?? null,
386
+ locked: false,
365
387
  });
388
+ await this.loadPermissions();
389
+ await this.loadFeatures();
366
390
  }
367
391
  else {
368
392
  this.status.next(AXPSessionStatus.Unauthenticated);
@@ -519,15 +543,10 @@ class AXPSessionService {
519
543
  }, 100);
520
544
  }
521
545
  setSession(tokens) {
546
+ const existing = this.getSessionData() ?? {};
522
547
  const sessionData = {
523
- accessToken: tokens.accessToken,
524
- refreshToken: tokens.refreshToken,
525
- strategy: tokens.strategy,
526
- user: tokens.user,
527
- application: tokens.application,
528
- tenant: tokens.tenant,
529
- expiresIn: tokens.expiresIn,
530
- idToken: tokens.idToken,
548
+ ...existing,
549
+ ...tokens,
531
550
  };
532
551
  // Update subjects
533
552
  if (tokens.user) {
@@ -541,6 +560,18 @@ class AXPSessionService {
541
560
  }
542
561
  localStorage.setItem(AXPSessionService.SESSION_KEY, JSON.stringify(sessionData));
543
562
  }
563
+ /** Whether the client lock overlay should remain active after reload. */
564
+ isLocked() {
565
+ return this.getSessionData()?.locked === true;
566
+ }
567
+ /** Persists client lock state inside {@link AXPSessionService.SESSION_KEY}. */
568
+ setLocked(locked) {
569
+ const existing = this.getSessionData();
570
+ if (!existing) {
571
+ return;
572
+ }
573
+ this.setSession({ locked });
574
+ }
544
575
  setStrategy(strategy) {
545
576
  const sessionData = this.getSessionData();
546
577
  const newSessionData = { ...sessionData, strategy };
@@ -633,10 +664,10 @@ class AXPSessionService {
633
664
  application: this.application,
634
665
  });
635
666
  }
636
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPSessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
637
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPSessionService, providedIn: 'root' }); }
667
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
668
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSessionService, providedIn: 'root' }); }
638
669
  }
639
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPSessionService, decorators: [{
670
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSessionService, decorators: [{
640
671
  type: Injectable,
641
672
  args: [{
642
673
  providedIn: 'root',
@@ -647,7 +678,7 @@ class AXPPermissionDirective {
647
678
  constructor(templateRef, viewContainer) {
648
679
  this.templateRef = templateRef;
649
680
  this.viewContainer = viewContainer;
650
- this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : []));
681
+ this.hasView = signal(false, ...(ngDevMode ? [{ debugName: "hasView" }] : /* istanbul ignore next */ []));
651
682
  this.sessionService = inject(AXPSessionService);
652
683
  }
653
684
  set permission(permissionKeys) {
@@ -680,10 +711,10 @@ class AXPPermissionDirective {
680
711
  ngOnDestroy() {
681
712
  this.subscription?.unsubscribe();
682
713
  }
683
- 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 }); }
684
- 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 }); }
714
+ 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 }); }
715
+ 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 }); }
685
716
  }
686
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDirective, decorators: [{
717
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDirective, decorators: [{
687
718
  type: Directive,
688
719
  args: [{
689
720
  selector: '[permission]',
@@ -698,12 +729,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
698
729
  const AXPPermissionGuard = (route, state) => {
699
730
  const sessionService = inject(AXPSessionService);
700
731
  const permissionKeys = route.data['requiredPermission'];
701
- return sessionService.isAuthorized$.pipe(first(), map((value) => {
732
+ return sessionService.isAuthorizedWithLoading$.pipe(first(), map((value) => {
733
+ debugger;
702
734
  const keys = !permissionKeys ? [] : Array.isArray(permissionKeys) ? permissionKeys : [permissionKeys];
703
735
  const hasPermission = keys.length == 0 || sessionService.authorize(...keys);
704
736
  if (!hasPermission) {
705
737
  throw new AXPUnauthorizedError(`Access denied. Required permissions: ${keys.join(', ')}. Please contact your administrator if you believe this is an error.`, {
706
- redirectUrl: state.url
738
+ redirectUrl: state.url,
707
739
  });
708
740
  }
709
741
  return true;
@@ -886,14 +918,102 @@ class AXPPermissionDefinitionService {
886
918
  await this.load();
887
919
  return this.cache?.find(g => g.permissions.find(p => p.name === name))?.permissions.find(p => p.name === name) ?? null;
888
920
  }
889
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
890
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDefinitionService, providedIn: 'root' }); }
921
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
922
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDefinitionService, providedIn: 'root' }); }
891
923
  }
892
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPPermissionDefinitionService, decorators: [{
924
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPPermissionDefinitionService, decorators: [{
893
925
  type: Injectable,
894
926
  args: [{ providedIn: 'root' }]
895
927
  }] });
896
928
 
929
+ //#region ---- Imports ----
930
+ //#endregion
931
+ //#region ---- Helpers ----
932
+ function flattenPermissionDefinitions(nodes, groupPrefix) {
933
+ const rows = [];
934
+ for (const node of nodes) {
935
+ const displayTitle = groupPrefix ? `${groupPrefix} / ${node.title}` : node.title;
936
+ if (node.children?.length) {
937
+ rows.push(...flattenPermissionDefinitions(node.children, displayTitle));
938
+ }
939
+ else {
940
+ rows.push({
941
+ id: String(node.name),
942
+ title: displayTitle,
943
+ });
944
+ }
945
+ }
946
+ return rows;
947
+ }
948
+ //#endregion
949
+ //#region ---- Permission definitions data source ----
950
+ /**
951
+ * Data source definition for leaf permissions from {@link AXPPermissionDefinitionService#getGroups}.
952
+ */
953
+ class AXPPermissionDefinitionsDataSourceDefinition {
954
+ constructor() {
955
+ //#region ---- Services & Dependencies ----
956
+ this.permissionDefinitionService = inject(AXPPermissionDefinitionService);
957
+ //#endregion
958
+ }
959
+ //#endregion
960
+ //#region ---- Public API ----
961
+ async items() {
962
+ return [
963
+ {
964
+ name: AXPPlatformAuthDataSourceKeys.PermissionDefinitions,
965
+ title: 'Permissions',
966
+ source: () => new AXDataSource({
967
+ key: 'id',
968
+ load: async () => {
969
+ const groups = await this.permissionDefinitionService.getGroups();
970
+ const list = [];
971
+ for (const g of groups) {
972
+ list.push(...flattenPermissionDefinitions(g.permissions, g.title));
973
+ }
974
+ return { items: list, total: list.length };
975
+ },
976
+ byKey: async (key) => {
977
+ const groups = await this.permissionDefinitionService.getGroups();
978
+ const list = [];
979
+ for (const g of groups) {
980
+ list.push(...flattenPermissionDefinitions(g.permissions, g.title));
981
+ }
982
+ return list.find((item) => item.id === key);
983
+ },
984
+ pageSize: 1000,
985
+ }),
986
+ columns: [
987
+ {
988
+ name: 'id',
989
+ title: 'ID',
990
+ datatype: 'string',
991
+ type: AXPWidgetsCatalog.text,
992
+ },
993
+ {
994
+ name: 'title',
995
+ title: 'Title',
996
+ datatype: 'string',
997
+ type: AXPWidgetsCatalog.text,
998
+ },
999
+ ],
1000
+ filters: [
1001
+ {
1002
+ field: 'title',
1003
+ title: 'Title',
1004
+ operator: { type: 'equal' },
1005
+ widget: { type: AXPWidgetsCatalog.text },
1006
+ filterType: { advance: true, inline: true },
1007
+ },
1008
+ ],
1009
+ textField: { name: 'title', title: 'Title' },
1010
+ valueField: { name: 'id', title: 'ID' },
1011
+ },
1012
+ ];
1013
+ }
1014
+ }
1015
+ //#endregion
1016
+
897
1017
  class AXPPermissionEvaluatorScopeProvider {
898
1018
  constructor() {
899
1019
  this.sessionService = inject(AXPSessionService);
@@ -983,9 +1103,9 @@ class AXPAuthModule {
983
1103
  f();
984
1104
  });
985
1105
  }
986
- 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 }); }
987
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, declarations: [AXPPermissionDirective, AXPFeatureDirective], exports: [AXPPermissionDirective, AXPFeatureDirective] }); }
988
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, providers: [
1106
+ 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 }); }
1107
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, declarations: [AXPPermissionDirective, AXPFeatureDirective], exports: [AXPPermissionDirective, AXPFeatureDirective] }); }
1108
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, providers: [
989
1109
  provideAppInitializer(() => {
990
1110
  const initializerFn = initializeAppState(inject(AXPSessionService));
991
1111
  return initializerFn();
@@ -996,7 +1116,7 @@ class AXPAuthModule {
996
1116
  },
997
1117
  ] }); }
998
1118
  }
999
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAuthModule, decorators: [{
1119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthModule, decorators: [{
1000
1120
  type: NgModule,
1001
1121
  args: [{
1002
1122
  imports: [],
@@ -1231,11 +1351,11 @@ class AXPLoginChallengeComponentBase {
1231
1351
  * Challenge data to display
1232
1352
  * Contains the image/content and metadata from the server
1233
1353
  */
1234
- this.challengeData = input.required(...(ngDevMode ? [{ debugName: "challengeData" }] : []));
1354
+ this.challengeData = input.required(...(ngDevMode ? [{ debugName: "challengeData" }] : /* istanbul ignore next */ []));
1235
1355
  /**
1236
1356
  * Whether the challenge is currently loading (e.g., refreshing)
1237
1357
  */
1238
- this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
1358
+ this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
1239
1359
  //#endregion
1240
1360
  //#region ---- Outputs ----
1241
1361
  /**
@@ -1249,10 +1369,10 @@ class AXPLoginChallengeComponentBase {
1249
1369
  */
1250
1370
  this.refreshRequest = output();
1251
1371
  }
1252
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPLoginChallengeComponentBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1253
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.12", 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 }); }
1372
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLoginChallengeComponentBase, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1373
+ 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 }); }
1254
1374
  }
1255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPLoginChallengeComponentBase, decorators: [{
1375
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLoginChallengeComponentBase, decorators: [{
1256
1376
  type: Component,
1257
1377
  args: [{
1258
1378
  template: '',
@@ -1264,5 +1384,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
1264
1384
  * Generated bundle index. Do not edit.
1265
1385
  */
1266
1386
 
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 };
1387
+ export { AXPAuthGuard, AXPAuthModule, AXPAuthStrategy, AXPAuthStrategyRegistryService, AXPFeatureDirective, AXPFeatureGuard, AXPLoginChallengeComponentBase, AXPLoginChallengeProvider, AXPPermissionDefinitionBuilder, AXPPermissionDefinitionGroupBuilder, AXPPermissionDefinitionProviderContext, AXPPermissionDefinitionService, AXPPermissionDefinitionsDataSourceDefinition, AXPPermissionDirective, AXPPermissionEvaluatorScopeProvider, AXPPermissionGuard, AXPPlatformAuthDataSourceKeys, AXPSessionContext, AXPSessionService, AXPSessionStatus, AXPUnauthenticatedError, AXPUnauthorizedError, AXP_APPLICATION_LOADER, AXP_FEATURE_CHECKER, AXP_FEATURE_LOADER, AXP_LOGIN_CHALLENGE_PROVIDER, AXP_PERMISSION_CHECKER, AXP_PERMISSION_DEFINITION_PROVIDER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER, JwtUtil, PkceUtil, TimeUtil, initializeAppState };
1268
1388
  //# sourceMappingURL=acorex-platform-auth.mjs.map