@acorex/platform 0.0.0-ACOREX

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