@acorex-platform/framework-client 0.0.10

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 (112) hide show
  1. package/README.md +7 -0
  2. package/auth/README.md +3 -0
  3. package/common/README.md +3 -0
  4. package/core/README.md +4 -0
  5. package/fesm2022/acorex-platform-framework-client-auth.mjs +1383 -0
  6. package/fesm2022/acorex-platform-framework-client-auth.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-framework-client-common-common-settings.provider-CbzOYCnI.mjs +190 -0
  8. package/fesm2022/acorex-platform-framework-client-common-common-settings.provider-CbzOYCnI.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-framework-client-common.mjs +9467 -0
  10. package/fesm2022/acorex-platform-framework-client-common.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-framework-client-core.mjs +4655 -0
  12. package/fesm2022/acorex-platform-framework-client-core.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-framework-client-domain.mjs +3189 -0
  14. package/fesm2022/acorex-platform-framework-client-domain.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-framework-client-layout-builder.mjs +3439 -0
  16. package/fesm2022/acorex-platform-framework-client-layout-builder.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-CWVU3wXL.mjs +134 -0
  18. package/fesm2022/acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-CWVU3wXL.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-framework-client-layout-components.mjs +9777 -0
  20. package/fesm2022/acorex-platform-framework-client-layout-components.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-framework-client-layout-designer.mjs +2799 -0
  22. package/fesm2022/acorex-platform-framework-client-layout-designer.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-framework-client-layout-entity-attachments-page.component-CxBxxpmA.mjs +376 -0
  24. package/fesm2022/acorex-platform-framework-client-layout-entity-attachments-page.component-CxBxxpmA.mjs.map +1 -0
  25. package/fesm2022/acorex-platform-framework-client-layout-entity-file-list-popup.component-l0JAHKIH.mjs +100 -0
  26. package/fesm2022/acorex-platform-framework-client-layout-entity-file-list-popup.component-l0JAHKIH.mjs.map +1 -0
  27. package/fesm2022/acorex-platform-framework-client-layout-entity.mjs +26299 -0
  28. package/fesm2022/acorex-platform-framework-client-layout-entity.mjs.map +1 -0
  29. package/fesm2022/acorex-platform-framework-client-layout-views.mjs +2960 -0
  30. package/fesm2022/acorex-platform-framework-client-layout-views.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-framework-client-layout-widget-core.mjs +4711 -0
  32. package/fesm2022/acorex-platform-framework-client-layout-widget-core.mjs.map +1 -0
  33. package/fesm2022/acorex-platform-framework-client-layout-widgets-button-widget-designer.component-CpkWwygb.mjs +72 -0
  34. package/fesm2022/acorex-platform-framework-client-layout-widgets-button-widget-designer.component-CpkWwygb.mjs.map +1 -0
  35. package/fesm2022/acorex-platform-framework-client-layout-widgets-image-preview.popup-C_EPAvCU.mjs +29 -0
  36. package/fesm2022/acorex-platform-framework-client-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map +1 -0
  37. package/fesm2022/acorex-platform-framework-client-layout-widgets-page-widget-designer.component-CmtTq2Mt.mjs +172 -0
  38. package/fesm2022/acorex-platform-framework-client-layout-widgets-page-widget-designer.component-CmtTq2Mt.mjs.map +1 -0
  39. package/fesm2022/acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DSx0E3NV.mjs +513 -0
  40. package/fesm2022/acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DSx0E3NV.mjs.map +1 -0
  41. package/fesm2022/acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-DdfcGV1C.mjs +274 -0
  42. package/fesm2022/acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-DdfcGV1C.mjs.map +1 -0
  43. package/fesm2022/acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-CntopmDS.mjs +64 -0
  44. package/fesm2022/acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-CntopmDS.mjs.map +1 -0
  45. package/fesm2022/acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-B5kSWxGk.mjs +34 -0
  46. package/fesm2022/acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-B5kSWxGk.mjs.map +1 -0
  47. package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs +28553 -0
  48. package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs.map +1 -0
  49. package/fesm2022/acorex-platform-framework-client-native.mjs +155 -0
  50. package/fesm2022/acorex-platform-framework-client-native.mjs.map +1 -0
  51. package/fesm2022/acorex-platform-framework-client-runtime.mjs +911 -0
  52. package/fesm2022/acorex-platform-framework-client-runtime.mjs.map +1 -0
  53. package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-create-view.component-DnTHwsDJ.mjs +160 -0
  54. package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-create-view.component-DnTHwsDJ.mjs.map +1 -0
  55. package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BpR9g6QS.mjs +121 -0
  56. package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BpR9g6QS.mjs.map +1 -0
  57. package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-single-view.component-D1a7UI71.mjs +236 -0
  58. package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-single-view.component-D1a7UI71.mjs.map +1 -0
  59. package/fesm2022/acorex-platform-framework-client-themes-default-error-401.component-D--_MIar.mjs +48 -0
  60. package/fesm2022/acorex-platform-framework-client-themes-default-error-401.component-D--_MIar.mjs.map +1 -0
  61. package/fesm2022/acorex-platform-framework-client-themes-default-error-404.component-Byyqk8pH.mjs +42 -0
  62. package/fesm2022/acorex-platform-framework-client-themes-default-error-404.component-Byyqk8pH.mjs.map +1 -0
  63. package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-DR6G8gPC.mjs +19 -0
  64. package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-DR6G8gPC.mjs.map +1 -0
  65. package/fesm2022/acorex-platform-framework-client-themes-default.mjs +4160 -0
  66. package/fesm2022/acorex-platform-framework-client-themes-default.mjs.map +1 -0
  67. package/fesm2022/acorex-platform-framework-client-themes-shared-icon-chooser-column.component-CXSGiTCK.mjs +55 -0
  68. package/fesm2022/acorex-platform-framework-client-themes-shared-icon-chooser-column.component-CXSGiTCK.mjs.map +1 -0
  69. package/fesm2022/acorex-platform-framework-client-themes-shared-icon-chooser-view.component-BY5clQ1J.mjs +57 -0
  70. package/fesm2022/acorex-platform-framework-client-themes-shared-icon-chooser-view.component-BY5clQ1J.mjs.map +1 -0
  71. package/fesm2022/acorex-platform-framework-client-themes-shared-settings.provider-DEL2YOTP.mjs +234 -0
  72. package/fesm2022/acorex-platform-framework-client-themes-shared-settings.provider-DEL2YOTP.mjs.map +1 -0
  73. package/fesm2022/acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-BXl8u4Yp.mjs +94 -0
  74. package/fesm2022/acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-BXl8u4Yp.mjs.map +1 -0
  75. package/fesm2022/acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-i2sOOkVj.mjs +86 -0
  76. package/fesm2022/acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-i2sOOkVj.mjs.map +1 -0
  77. package/fesm2022/acorex-platform-framework-client-themes-shared.mjs +2375 -0
  78. package/fesm2022/acorex-platform-framework-client-themes-shared.mjs.map +1 -0
  79. package/fesm2022/acorex-platform-framework-client-workflow.mjs +2836 -0
  80. package/fesm2022/acorex-platform-framework-client-workflow.mjs.map +1 -0
  81. package/fesm2022/acorex-platform-framework-client.mjs +6 -0
  82. package/fesm2022/acorex-platform-framework-client.mjs.map +1 -0
  83. package/layout/builder/README.md +1578 -0
  84. package/layout/components/README.md +3 -0
  85. package/layout/designer/README.md +4 -0
  86. package/layout/entity/README.md +4 -0
  87. package/layout/views/README.md +3 -0
  88. package/layout/widget-core/README.md +4 -0
  89. package/layout/widgets/README.md +3 -0
  90. package/native/README.md +4 -0
  91. package/package.json +98 -0
  92. package/runtime/README.md +3 -0
  93. package/themes/default/README.md +3 -0
  94. package/themes/shared/README.md +3 -0
  95. package/types/acorex-platform-framework-client-auth.d.ts +690 -0
  96. package/types/acorex-platform-framework-client-common.d.ts +3287 -0
  97. package/types/acorex-platform-framework-client-core.d.ts +1849 -0
  98. package/types/acorex-platform-framework-client-domain.d.ts +1968 -0
  99. package/types/acorex-platform-framework-client-layout-builder.d.ts +1058 -0
  100. package/types/acorex-platform-framework-client-layout-components.d.ts +3362 -0
  101. package/types/acorex-platform-framework-client-layout-designer.d.ts +501 -0
  102. package/types/acorex-platform-framework-client-layout-entity.d.ts +4374 -0
  103. package/types/acorex-platform-framework-client-layout-views.d.ts +975 -0
  104. package/types/acorex-platform-framework-client-layout-widget-core.d.ts +1080 -0
  105. package/types/acorex-platform-framework-client-layout-widgets.d.ts +5263 -0
  106. package/types/acorex-platform-framework-client-native.d.ts +28 -0
  107. package/types/acorex-platform-framework-client-runtime.d.ts +301 -0
  108. package/types/acorex-platform-framework-client-themes-default.d.ts +889 -0
  109. package/types/acorex-platform-framework-client-themes-shared.d.ts +202 -0
  110. package/types/acorex-platform-framework-client-workflow.d.ts +1345 -0
  111. package/types/acorex-platform-framework-client.d.ts +2 -0
  112. package/workflow/README.md +4 -0
@@ -0,0 +1,690 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, TemplateRef, ViewContainerRef, ModuleWithProviders, Injector, Type } from '@angular/core';
3
+ import { AXPLogoConfig, AXPOptionsData } from '@acorex-platform/framework-shared/core';
4
+ import { CanActivateFn } from '@angular/router';
5
+ import { AXPDataSourceDefinitionProvider, AXPDataSourceDefinition, AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex-platform/framework-client/core';
6
+ import { Observable } from 'rxjs';
7
+
8
+ interface AXPEdition {
9
+ id: string;
10
+ title: string;
11
+ description?: string;
12
+ }
13
+ interface AXPApplication {
14
+ id: string;
15
+ name: string;
16
+ title?: string;
17
+ version?: string;
18
+ edition?: AXPEdition;
19
+ description?: string;
20
+ logo?: AXPLogoConfig;
21
+ }
22
+
23
+ interface AXPTenant {
24
+ id: string;
25
+ name: string;
26
+ title: string;
27
+ description?: string;
28
+ logo?: AXPLogoConfig;
29
+ }
30
+
31
+ interface AXPUser {
32
+ id: string;
33
+ name: string;
34
+ title: string;
35
+ avatar?: string;
36
+ }
37
+
38
+ declare class AXPSessionContext {
39
+ private _user;
40
+ get user(): AXPUser | null;
41
+ private _tenant;
42
+ get tenant(): AXPTenant | null;
43
+ private _application;
44
+ get application(): AXPApplication | null;
45
+ constructor(context: {
46
+ user: AXPUser | null;
47
+ tenant: AXPTenant | null;
48
+ application: AXPApplication | null;
49
+ });
50
+ }
51
+ declare enum AXPSessionStatus {
52
+ Authenticated = "authenticated",
53
+ Unauthenticated = "unauthenticated",
54
+ Unauthorized = "unauthorized",
55
+ Authorized = "authorized",
56
+ Expired = "expired",
57
+ SignedOut = "signedOut"
58
+ }
59
+
60
+ interface AXPApplicationLoader {
61
+ getList(context: AXPSessionContext): Promise<AXPApplication[]>;
62
+ }
63
+ declare const AXP_APPLICATION_LOADER: InjectionToken<AXPApplicationLoader>;
64
+
65
+ /** Platform auth datasource registry names. */
66
+ declare const AXPPlatformAuthDataSourceKeys: {
67
+ readonly PermissionDefinitions: "platform-permission-definitions";
68
+ };
69
+
70
+ declare class AXPUnauthorizedError extends Error {
71
+ data?: {
72
+ redirectUrl?: string;
73
+ } | undefined;
74
+ constructor(message?: string, data?: {
75
+ redirectUrl?: string;
76
+ } | undefined);
77
+ }
78
+ declare class AXPUnauthenticatedError extends Error {
79
+ data?: {
80
+ redirectUrl?: string;
81
+ } | undefined;
82
+ constructor(message?: string, data?: {
83
+ redirectUrl?: string;
84
+ } | undefined);
85
+ }
86
+
87
+ interface AXPTenantLoader {
88
+ getList(context: AXPSessionContext): Promise<AXPTenant[]>;
89
+ }
90
+ declare const AXP_TENANT_LOADER: InjectionToken<AXPTenantLoader>;
91
+
92
+ declare class AXPPermissionDirective {
93
+ private templateRef;
94
+ private viewContainer;
95
+ private hasView;
96
+ private subscription;
97
+ private sessionService;
98
+ constructor(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef);
99
+ set permission(permissionKeys: string | string[] | null);
100
+ set permissionElse(elseTemplateRef: TemplateRef<any>);
101
+ ngOnDestroy(): void;
102
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPPermissionDirective, never>;
103
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AXPPermissionDirective, "[permission]", never, { "permission": { "alias": "permission"; "required": false; }; "permissionElse": { "alias": "permissionElse"; "required": false; }; }, {}, never, never, false, never>;
104
+ }
105
+
106
+ declare const AXPPermissionGuard: CanActivateFn;
107
+
108
+ type AXPPermission = string;
109
+ interface AXPPermissionGroupDefinition {
110
+ name: string;
111
+ title: string;
112
+ description?: string;
113
+ permissions: AXPPermissionDefinition[];
114
+ }
115
+ type AXPPermissionDefinition = {
116
+ name: AXPPermission;
117
+ title: string;
118
+ description?: string;
119
+ children: AXPPermissionDefinition[];
120
+ /**
121
+ * Required features for this permission to be available.
122
+ * Format: Array of feature names (e.g., ['PlatformManagement.menu-customization'])
123
+ * If any required feature is not enabled, this permission will be filtered out.
124
+ */
125
+ requiredFeatures?: string[];
126
+ };
127
+
128
+ interface AXPPermissionLoader {
129
+ getList(context: AXPSessionContext): Promise<AXPPermission[]>;
130
+ }
131
+ declare const AXP_PERMISSION_LOADER: InjectionToken<AXPPermissionLoader>;
132
+
133
+ /**
134
+ * Data source definition for leaf permissions from {@link AXPPermissionDefinitionService#getGroups}.
135
+ */
136
+ declare class AXPPermissionDefinitionsDataSourceDefinition implements AXPDataSourceDefinitionProvider {
137
+ private readonly permissionDefinitionService;
138
+ items(): Promise<AXPDataSourceDefinition[]>;
139
+ }
140
+
141
+ declare class AXPPermissionDefinitionProviderContext {
142
+ private builders;
143
+ addGroup(name: string, title: string, description?: string): AXPPermissionDefinitionGroupBuilder;
144
+ getGroupDefinitions(): AXPPermissionGroupDefinition[];
145
+ findGroup(name: string): AXPPermissionDefinitionGroupBuilder | undefined;
146
+ isGroupDefined(name: string): boolean;
147
+ }
148
+ declare class AXPPermissionDefinitionGroupBuilder {
149
+ private context;
150
+ private _group;
151
+ get group(): AXPPermissionGroupDefinition;
152
+ constructor(context: AXPPermissionDefinitionProviderContext, group: AXPPermissionGroupDefinition);
153
+ addPermission(name: string, title: string, description?: string, requiredFeatures?: string[]): AXPPermissionDefinitionBuilder;
154
+ endGroup(): AXPPermissionDefinitionProviderContext;
155
+ findPermission(path: string): AXPPermissionDefinition | undefined;
156
+ findGroup(name: string): AXPPermissionDefinitionGroupBuilder | undefined;
157
+ }
158
+ declare class AXPPermissionDefinitionBuilder {
159
+ private groupBuilder;
160
+ private permission;
161
+ constructor(groupBuilder: AXPPermissionDefinitionGroupBuilder, permission: AXPPermissionDefinition);
162
+ addChild(name: string, title: string, description?: string, requiredFeatures?: string[]): AXPPermissionDefinitionBuilder;
163
+ /**
164
+ * Set required features for this permission.
165
+ * @param features - Array of feature names (e.g., ['PlatformManagement.menu-customization'])
166
+ */
167
+ requireFeatures(...features: string[]): AXPPermissionDefinitionBuilder;
168
+ endPermission(): AXPPermissionDefinitionGroupBuilder;
169
+ }
170
+
171
+ interface AXPPermissionDefinitionProvider {
172
+ define(context: AXPPermissionDefinitionProviderContext): Promise<void>;
173
+ }
174
+ declare const AXP_PERMISSION_DEFINITION_PROVIDER: InjectionToken<AXPPermissionDefinitionProvider[]>;
175
+ declare class AXPPermissionDefinitionService {
176
+ private providers;
177
+ private sessionService;
178
+ private cache;
179
+ private load;
180
+ /**
181
+ * Filter permissions based on required features.
182
+ * Removes permissions that have required features that are not enabled.
183
+ */
184
+ private filterByFeatures;
185
+ /**
186
+ * Recursively filter permissions and their children based on required features.
187
+ */
188
+ private filterPermissions;
189
+ reload(): Promise<void>;
190
+ getGroups(): Promise<AXPPermissionGroupDefinition[]>;
191
+ getPermissions(): Promise<AXPPermissionDefinition[]>;
192
+ getGroup(name: string): Promise<AXPPermissionGroupDefinition | null>;
193
+ getPermission(name: string): Promise<AXPPermissionDefinition | null>;
194
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPPermissionDefinitionService, never>;
195
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPPermissionDefinitionService>;
196
+ }
197
+
198
+ interface AXPBaseCredentials {
199
+ strategy: string;
200
+ [key: string]: string;
201
+ }
202
+ interface AXPTokenResult {
203
+ accessToken: string;
204
+ expiresIn?: string | null;
205
+ refreshToken?: string;
206
+ idToken?: string;
207
+ tenant?: AXPTenant | null;
208
+ application?: AXPApplication | null;
209
+ }
210
+ interface AXPSignInResult {
211
+ succeed: boolean;
212
+ data?: {
213
+ accessToken: string;
214
+ idToken?: string | null;
215
+ expiresIn?: string | null;
216
+ refreshToken: string;
217
+ user: AXPUser;
218
+ tenant?: AXPTenant | null;
219
+ application?: AXPApplication | null;
220
+ };
221
+ }
222
+ declare abstract class AXPAuthStrategy {
223
+ abstract get name(): string;
224
+ abstract signin(credentials: AXPBaseCredentials): Promise<AXPSignInResult | void>;
225
+ abstract signout(): Promise<void>;
226
+ abstract refreshToken(context: AXPSessionContext): Promise<AXPSignInResult>;
227
+ abstract updateToken(params?: {
228
+ [key: string]: any;
229
+ }): Promise<AXPSignInResult | void>;
230
+ }
231
+ interface AXPSessionData {
232
+ accessToken: string;
233
+ refreshToken: string;
234
+ idToken: string | null;
235
+ strategy: string;
236
+ user?: AXPUser | null;
237
+ tenant?: AXPTenant | null;
238
+ application?: AXPApplication | null;
239
+ expiresIn?: string | null;
240
+ /** When true, the client lock overlay stays active until PIN/password unlock or sign-out. */
241
+ locked?: boolean;
242
+ }
243
+
244
+ interface AXPFeature {
245
+ name: string;
246
+ title: string;
247
+ description?: string;
248
+ value?: any;
249
+ interface?: {
250
+ type: string;
251
+ options?: AXPOptionsData;
252
+ };
253
+ }
254
+
255
+ interface AXPFeatureLoader {
256
+ getList(context: AXPSessionContext): Promise<AXPFeature[]>;
257
+ }
258
+ declare const AXP_FEATURE_LOADER: InjectionToken<AXPFeatureLoader>;
259
+
260
+ declare class AXPFeatureDirective {
261
+ private templateRef;
262
+ private viewContainer;
263
+ private hasView;
264
+ private subscription;
265
+ private sessionService;
266
+ constructor(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef);
267
+ set feature(featureKeys: string | string[] | null);
268
+ set featureElse(elseTemplateRef: TemplateRef<any>);
269
+ ngOnDestroy(): void;
270
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPFeatureDirective, never>;
271
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AXPFeatureDirective, "[feature]", never, { "feature": { "alias": "feature"; "required": false; }; "featureElse": { "alias": "featureElse"; "required": false; }; }, {}, never, never, false, never>;
272
+ }
273
+
274
+ declare const AXPFeatureGuard: CanActivateFn;
275
+
276
+ /**
277
+ * Interface for feature checkers that can override feature enablement results.
278
+ * Checkers receive the feature keys, current context, and base result,
279
+ * and can return a modified result based on custom logic.
280
+ */
281
+ interface AXPFeatureChecker {
282
+ /**
283
+ * Checks and potentially overrides the feature enablement result.
284
+ * @param keys - The feature keys being checked
285
+ * @param context - Current session context (user, tenant, application)
286
+ * @param baseResult - The result from the base feature check logic
287
+ * @returns The final feature enablement result (true or false)
288
+ */
289
+ check(keys: string[], context: AXPSessionContext, baseResult: boolean): boolean;
290
+ }
291
+
292
+ /**
293
+ * Optional injection token for feature checker.
294
+ * If provided, the checker will be called to potentially override
295
+ * feature enablement results based on custom logic.
296
+ */
297
+ declare const AXP_FEATURE_CHECKER: InjectionToken<AXPFeatureChecker>;
298
+
299
+ declare class AXPSessionService {
300
+ private eventService;
301
+ private authStrategyRegistry;
302
+ private readonly injector;
303
+ static readonly SESSION_KEY = "AXP_SESSION";
304
+ private readonly permissionLoader;
305
+ private readonly featureLoader;
306
+ private readonly tenantLoader;
307
+ private readonly applicationLoader;
308
+ private readonly permissionChecker;
309
+ private readonly featureChecker;
310
+ private status;
311
+ readonly status$: Observable<AXPSessionStatus>;
312
+ private isLoading;
313
+ readonly isLoading$: Observable<boolean>;
314
+ private currentUserSubject;
315
+ readonly user$: Observable<AXPUser | null>;
316
+ get user(): AXPUser | null;
317
+ private currentTenantSubject;
318
+ readonly tenant$: Observable<AXPTenant | null>;
319
+ get tenant(): AXPTenant | null;
320
+ get tenants$(): Observable<AXPTenant[]>;
321
+ private currentApplicationSubject;
322
+ readonly application$: Observable<AXPApplication | null>;
323
+ get application(): AXPApplication | null;
324
+ get applications$(): Observable<AXPApplication[]>;
325
+ private permissionsSubject;
326
+ readonly permissions$: Observable<never[] | string[]>;
327
+ get permissions(): AXPPermission[];
328
+ private featuresSubject;
329
+ readonly features$: Observable<never[] | AXPFeature[]>;
330
+ get features(): AXPFeature[];
331
+ readonly isAuthenticated$: Observable<boolean>;
332
+ readonly isAuthenticatedWithLoading$: Observable<boolean>;
333
+ readonly isAuthorized$: Observable<boolean>;
334
+ /** Waits for session restore to finish, then emits whether the session is fully authorized. */
335
+ readonly isAuthorizedWithLoading$: Observable<boolean>;
336
+ restoreSession(): Promise<void>;
337
+ signin(credentials: AXPBaseCredentials): Promise<void>;
338
+ updateToken(params?: {
339
+ [key: string]: any;
340
+ }): Promise<void>;
341
+ signout(): Promise<void>;
342
+ refreshToken(): Promise<any>;
343
+ private loadPermissions;
344
+ private loadFeatures;
345
+ signInComplete(): Promise<void>;
346
+ setSession(tokens: Partial<AXPSessionData>): void;
347
+ /** Whether the client lock overlay should remain active after reload. */
348
+ isLocked(): boolean;
349
+ /** Persists client lock state inside {@link AXPSessionService.SESSION_KEY}. */
350
+ setLocked(locked: boolean): void;
351
+ setStrategy(strategy: string): void;
352
+ getSessionData(): AXPSessionData | null;
353
+ private clearSession;
354
+ authorize(...keys: string[]): boolean;
355
+ isFeatureEnabled(...keys: string[]): boolean;
356
+ /**
357
+ * Checks if a module is enabled for the current tenant/application.
358
+ * Module names are stored as features with value: true when enabled.
359
+ * Module names can be provided in PascalCase (e.g., 'SecurityManagement') or kebab-case (e.g., 'security-management').
360
+ */
361
+ isModuleEnabled(moduleName: string): boolean;
362
+ getToken(): string | undefined;
363
+ getContext(): AXPSessionContext;
364
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPSessionService, never>;
365
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPSessionService>;
366
+ }
367
+
368
+ declare class AXPPermissionEvaluatorScopeProvider implements AXPExpressionEvaluatorScopeProvider {
369
+ protected sessionService: AXPSessionService;
370
+ provide(context: AXPExpressionEvaluatorScopeProviderContext): Promise<void>;
371
+ }
372
+
373
+ /**
374
+ * Interface for permission checkers that can override authorization results.
375
+ * Checkers receive the permission keys, current context, and base result,
376
+ * and can return a modified result based on custom logic.
377
+ */
378
+ interface AXPPermissionChecker {
379
+ /**
380
+ * Checks and potentially overrides the authorization result.
381
+ * @param keys - The permission keys being checked
382
+ * @param context - Current session context (user, tenant, application)
383
+ * @param baseResult - The result from the base authorization logic
384
+ * @returns The final authorization result (true or false)
385
+ */
386
+ check(keys: string[], context: AXPSessionContext, baseResult: boolean): boolean;
387
+ }
388
+
389
+ /**
390
+ * Optional injection token for permission checker.
391
+ * If provided, the checker will be called to potentially override
392
+ * authorization results based on custom logic.
393
+ */
394
+ declare const AXP_PERMISSION_CHECKER: InjectionToken<AXPPermissionChecker>;
395
+
396
+ declare const AXPAuthGuard: CanActivateFn;
397
+
398
+ interface AXPAuthModuleConfigs {
399
+ strategies: (new () => AXPAuthStrategy)[];
400
+ }
401
+ declare function initializeAppState(service: AXPSessionService): () => Promise<void>;
402
+ declare class AXPAuthModule {
403
+ static forRoot(configs?: AXPAuthModuleConfigs): ModuleWithProviders<AXPAuthModule>;
404
+ static forChild(configs?: AXPAuthModuleConfigs): ModuleWithProviders<AXPAuthModule>;
405
+ /**
406
+ * @ignore
407
+ */
408
+ constructor(instances: any[]);
409
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPAuthModule, [{ optional: true; }]>;
410
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AXPAuthModule, [typeof AXPPermissionDirective, typeof AXPFeatureDirective], never, [typeof AXPPermissionDirective, typeof AXPFeatureDirective]>;
411
+ static ɵinj: i0.ɵɵInjectorDeclaration<AXPAuthModule>;
412
+ }
413
+
414
+ declare class AXPAuthStrategyRegistryService {
415
+ private strategies;
416
+ private injector;
417
+ constructor(injector: Injector);
418
+ register(...plugins: (new () => AXPAuthStrategy)[]): void;
419
+ get(strategyKey: string): AXPAuthStrategy | undefined;
420
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPAuthStrategyRegistryService, never>;
421
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPAuthStrategyRegistryService>;
422
+ }
423
+
424
+ /**
425
+ * Utility class for JWT token operations
426
+ */
427
+ declare class JwtUtil {
428
+ /**
429
+ * Parses a JWT token and returns the payload
430
+ */
431
+ static parseJwt(token: string): any;
432
+ }
433
+ /**
434
+ * Utility class for PKCE (Proof Key for Code Exchange) operations
435
+ */
436
+ declare class PkceUtil {
437
+ /**
438
+ * Generates a random string for PKCE code verifier
439
+ */
440
+ static generateRandomString(length: number): string;
441
+ /**
442
+ * Generates PKCE code challenge from verifier
443
+ */
444
+ static generateCodeChallenge(codeVerifier: string): Promise<string>;
445
+ /**
446
+ * Base64 URL encoding for PKCE
447
+ */
448
+ private static base64UrlEncode;
449
+ }
450
+ /**
451
+ * Utility class for time and date operations
452
+ */
453
+ declare class TimeUtil {
454
+ /**
455
+ * Calculates the time difference in milliseconds between a future date and now
456
+ */
457
+ static expiresInMilliseconds(expiresInDate: string): number;
458
+ /**
459
+ * Calculates expiration date from seconds
460
+ */
461
+ static calculateExpireInDate(expireInSeconds: number): string;
462
+ }
463
+
464
+ /**
465
+ * Supported content types for challenge display
466
+ */
467
+ type AXPChallengeContentType = 'image-url' | 'image-base64' | 'text' | 'audio-url';
468
+ /**
469
+ * Challenge data returned from the server
470
+ * Contains all information needed to display and submit a challenge
471
+ */
472
+ interface AXPLoginChallengeData {
473
+ /**
474
+ * Unique identifier for this challenge
475
+ * Must be sent back with credentials when submitting login
476
+ */
477
+ id: string;
478
+ /**
479
+ * The challenge content to display
480
+ * Could be an image URL, base64 encoded image, text, or audio URL
481
+ */
482
+ content: string;
483
+ /**
484
+ * Type of content for proper rendering
485
+ */
486
+ contentType: AXPChallengeContentType;
487
+ /**
488
+ * When this challenge expires (optional)
489
+ * After expiration, a new challenge should be fetched
490
+ */
491
+ expiresAt?: Date;
492
+ /**
493
+ * Additional metadata from server (optional)
494
+ */
495
+ metadata?: Record<string, unknown>;
496
+ }
497
+ /**
498
+ * Result of checking a login error response
499
+ * Determines if a challenge should be displayed
500
+ */
501
+ interface AXPChallengeCheckResult {
502
+ /**
503
+ * Whether a challenge is required
504
+ */
505
+ required: boolean;
506
+ /**
507
+ * Optional message to display to the user
508
+ */
509
+ message?: string;
510
+ /**
511
+ * Additional data from server that may be needed for getChallenge()
512
+ * For example: sessionId, attemptId, etc.
513
+ */
514
+ serverData?: Record<string, unknown>;
515
+ }
516
+
517
+ /**
518
+ * Base class for login challenge UI components
519
+ *
520
+ * Providers can extend this class to create custom challenge UIs.
521
+ * The login component will render this component and listen to its outputs.
522
+ *
523
+ * @example
524
+ * ```typescript
525
+ * @Component({
526
+ * selector: 'my-captcha-challenge',
527
+ * template: `
528
+ * <div class="captcha-container">
529
+ * <img [src]="'data:image/png;base64,' + challengeData().content" />
530
+ * <input
531
+ * type="text"
532
+ * [value]="response()"
533
+ * (input)="onResponseChange($event)"
534
+ * />
535
+ * <button (click)="onRefreshClick()">Refresh</button>
536
+ * </div>
537
+ * `
538
+ * })
539
+ * export class MyCaptchaChallengeComponent extends AXPLoginChallengeComponentBase {
540
+ * response = signal('');
541
+ *
542
+ * onResponseChange(event: Event) {
543
+ * const value = (event.target as HTMLInputElement).value;
544
+ * this.response.set(value);
545
+ * this.responseChange.emit(value);
546
+ * }
547
+ *
548
+ * onRefreshClick() {
549
+ * this.refreshRequest.emit();
550
+ * }
551
+ * }
552
+ * ```
553
+ */
554
+ declare abstract class AXPLoginChallengeComponentBase {
555
+ /**
556
+ * Challenge data to display
557
+ * Contains the image/content and metadata from the server
558
+ */
559
+ challengeData: i0.InputSignal<AXPLoginChallengeData>;
560
+ /**
561
+ * Whether the challenge is currently loading (e.g., refreshing)
562
+ */
563
+ isLoading: i0.InputSignal<boolean>;
564
+ /**
565
+ * Emits when the user enters or changes their response
566
+ * The login component will capture this value and include it in credentials
567
+ */
568
+ responseChange: i0.OutputEmitterRef<string>;
569
+ /**
570
+ * Emits when the user requests a new challenge (e.g., clicks refresh button)
571
+ * The login component will call provider.refreshChallenge()
572
+ */
573
+ refreshRequest: i0.OutputEmitterRef<void>;
574
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPLoginChallengeComponentBase, never>;
575
+ static ɵcmp: i0.ɵɵComponentDeclaration<AXPLoginChallengeComponentBase, "ng-component", never, { "challengeData": { "alias": "challengeData"; "required": true; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; }, { "responseChange": "responseChange"; "refreshRequest": "refreshRequest"; }, never, never, true, never>;
576
+ }
577
+
578
+ /**
579
+ * Abstract base class for login challenge providers
580
+ *
581
+ * Implement this class to create custom challenge mechanisms like:
582
+ * - Image CAPTCHA
583
+ * - reCAPTCHA
584
+ * - SMS verification
585
+ * - Email verification
586
+ *
587
+ * @example
588
+ * ```typescript
589
+ * @Injectable()
590
+ * export class MyImageCaptchaProvider extends AXPLoginChallengeProvider {
591
+ * readonly name = 'image-captcha';
592
+ *
593
+ * checkResponse(error: unknown): AXPChallengeCheckResult | null {
594
+ * if (error instanceof HttpErrorResponse) {
595
+ * if (error.error?.requiresCaptcha) {
596
+ * return { required: true };
597
+ * }
598
+ * }
599
+ * return null;
600
+ * }
601
+ *
602
+ * async getChallenge(): Promise<AXPLoginChallengeData> {
603
+ * const response = await this.http.get('/api/captcha').toPromise();
604
+ * return {
605
+ * id: response.id,
606
+ * content: response.image,
607
+ * contentType: 'image-base64'
608
+ * };
609
+ * }
610
+ *
611
+ * async refreshChallenge(): Promise<AXPLoginChallengeData> {
612
+ * return this.getChallenge();
613
+ * }
614
+ *
615
+ * getChallengeComponent(): Type<AXPLoginChallengeComponentBase> {
616
+ * return MyCaptchaChallengeComponent;
617
+ * }
618
+ * }
619
+ * ```
620
+ */
621
+ declare abstract class AXPLoginChallengeProvider {
622
+ /**
623
+ * Unique name identifier for this provider
624
+ */
625
+ abstract readonly name: string;
626
+ /**
627
+ * Checks the login error response to determine if a challenge is required
628
+ *
629
+ * This method is called after a failed login attempt. The implementation
630
+ * should inspect the error and return a result indicating whether a
631
+ * challenge should be displayed.
632
+ *
633
+ * @param error - The error from the failed login attempt (type varies by implementation)
634
+ * @returns Challenge check result, or null if this provider doesn't handle this error
635
+ */
636
+ abstract checkResponse(error: unknown): AXPChallengeCheckResult | null;
637
+ /**
638
+ * Fetches a new challenge from the server
639
+ *
640
+ * Called when checkResponse indicates a challenge is required.
641
+ * Should make an API call to get challenge data (e.g., CAPTCHA image).
642
+ *
643
+ * @param serverData - Optional data from checkResponse result that may be needed
644
+ * @returns Promise resolving to challenge data for display
645
+ */
646
+ abstract getChallenge(serverData?: Record<string, unknown>): Promise<AXPLoginChallengeData>;
647
+ /**
648
+ * Fetches a fresh challenge, replacing the current one
649
+ *
650
+ * Called when user requests a new challenge (e.g., clicks "new image" button).
651
+ * Typically delegates to getChallenge() but may have different behavior.
652
+ *
653
+ * @returns Promise resolving to new challenge data
654
+ */
655
+ abstract refreshChallenge(): Promise<AXPLoginChallengeData>;
656
+ /**
657
+ * Returns the component type for rendering the challenge UI
658
+ *
659
+ * Override this method to provide a custom challenge UI component.
660
+ * If not overridden (returns null), the login component will use
661
+ * a default built-in UI.
662
+ *
663
+ * @returns Component type extending AXPLoginChallengeComponentBase, or null for default UI
664
+ */
665
+ getChallengeComponent(): Type<AXPLoginChallengeComponentBase> | null;
666
+ }
667
+
668
+ /**
669
+ * Injection token for the login challenge provider
670
+ *
671
+ * This token is optional - if not provided, no challenge mechanism will be used.
672
+ *
673
+ * @example
674
+ * ```typescript
675
+ * // In your app module or provider configuration:
676
+ * providers: [
677
+ * {
678
+ * provide: AXP_LOGIN_CHALLENGE_PROVIDER,
679
+ * useClass: MyImageCaptchaProvider
680
+ * }
681
+ * ]
682
+ *
683
+ * // In a component:
684
+ * private challengeProvider = inject(AXP_LOGIN_CHALLENGE_PROVIDER, { optional: true });
685
+ * ```
686
+ */
687
+ declare const AXP_LOGIN_CHALLENGE_PROVIDER: InjectionToken<AXPLoginChallengeProvider>;
688
+
689
+ 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 };
690
+ export type { AXPApplication, AXPApplicationLoader, AXPAuthModuleConfigs, AXPBaseCredentials, AXPChallengeCheckResult, AXPChallengeContentType, AXPEdition, AXPFeature, AXPFeatureChecker, AXPFeatureLoader, AXPLoginChallengeData, AXPPermission, AXPPermissionChecker, AXPPermissionDefinition, AXPPermissionDefinitionProvider, AXPPermissionGroupDefinition, AXPPermissionLoader, AXPSessionData, AXPSignInResult, AXPTenant, AXPTenantLoader, AXPTokenResult, AXPUser };