@acorex/platform 21.0.0-next.2 → 21.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/index.d.ts +97 -238
- package/common/index.d.ts +778 -213
- package/core/index.d.ts +562 -433
- package/fesm2022/acorex-platform-auth.mjs +160 -200
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +1012 -125
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +685 -400
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +54 -11
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +412 -270
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +2112 -3153
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +7 -7
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +756 -648
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +4 -4
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +248 -174
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs → acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-m8rHZP8L.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +3058 -1038
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-mARj77Mr.mjs → acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs} +26 -5
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-Cym8pq0v.mjs → acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs} +4 -5
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +101 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs → acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs} +3 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +166 -30
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +27 -27
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/layout/builder/index.d.ts +4 -1
- package/layout/components/index.d.ts +405 -327
- package/layout/designer/index.d.ts +3 -3
- package/layout/entity/index.d.ts +163 -108
- package/layout/widget-core/index.d.ts +39 -49
- package/layout/widgets/index.d.ts +368 -54
- package/package.json +5 -5
- package/themes/default/index.d.ts +15 -2
- package/themes/shared/index.d.ts +10 -10
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs +0 -50
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs +0 -42
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs +0 -55
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs +0 -50
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs +0 -48
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs +0 -42
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-m8rHZP8L.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-mARj77Mr.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-Cym8pq0v.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs.map +0 -1
package/auth/index.d.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, TemplateRef, ViewContainerRef, ModuleWithProviders, Injector
|
|
3
|
-
import {
|
|
4
|
-
import { AXPLogoConfig, AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex/platform/core';
|
|
2
|
+
import { InjectionToken, TemplateRef, ViewContainerRef, ModuleWithProviders, Injector } from '@angular/core';
|
|
3
|
+
import { AXPLogoConfig, AXPOptionsData, AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex/platform/core';
|
|
5
4
|
import { CanActivateFn } from '@angular/router';
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
6
6
|
|
|
7
|
+
interface AXPEdition {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
7
12
|
interface AXPApplication {
|
|
8
13
|
id: string;
|
|
9
14
|
name: string;
|
|
10
15
|
title?: string;
|
|
11
16
|
version?: string;
|
|
12
|
-
|
|
17
|
+
edition?: AXPEdition;
|
|
13
18
|
description?: string;
|
|
14
19
|
logo?: AXPLogoConfig;
|
|
15
20
|
}
|
|
@@ -52,12 +57,12 @@ declare enum AXPSessionStatus {
|
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
interface AXPApplicationLoader {
|
|
55
|
-
getList(context: AXPSessionContext):
|
|
60
|
+
getList(context: AXPSessionContext): Promise<AXPApplication[]>;
|
|
56
61
|
}
|
|
57
62
|
declare const AXP_APPLICATION_LOADER: InjectionToken<AXPApplicationLoader>;
|
|
58
63
|
|
|
59
64
|
interface AXPTenantLoader {
|
|
60
|
-
getList(context: AXPSessionContext):
|
|
65
|
+
getList(context: AXPSessionContext): Promise<AXPTenant[]>;
|
|
61
66
|
}
|
|
62
67
|
declare const AXP_TENANT_LOADER: InjectionToken<AXPTenantLoader>;
|
|
63
68
|
|
|
@@ -89,10 +94,16 @@ type AXPPermissionDefinition = {
|
|
|
89
94
|
title: string;
|
|
90
95
|
description?: string;
|
|
91
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[];
|
|
92
103
|
};
|
|
93
104
|
|
|
94
105
|
interface AXPPermissionLoader {
|
|
95
|
-
getList(context: AXPSessionContext):
|
|
106
|
+
getList(context: AXPSessionContext): Promise<AXPPermission[]>;
|
|
96
107
|
}
|
|
97
108
|
declare const AXP_PERMISSION_LOADER: InjectionToken<AXPPermissionLoader>;
|
|
98
109
|
|
|
@@ -108,7 +119,7 @@ declare class AXPPermissionDefinitionGroupBuilder {
|
|
|
108
119
|
private _group;
|
|
109
120
|
get group(): AXPPermissionGroupDefinition;
|
|
110
121
|
constructor(context: AXPPermissionDefinitionProviderContext, group: AXPPermissionGroupDefinition);
|
|
111
|
-
addPermission(name: string, title: string, description?: string): AXPPermissionDefinitionBuilder;
|
|
122
|
+
addPermission(name: string, title: string, description?: string, requiredFeatures?: string[]): AXPPermissionDefinitionBuilder;
|
|
112
123
|
endGroup(): AXPPermissionDefinitionProviderContext;
|
|
113
124
|
findPermission(path: string): AXPPermissionDefinition | undefined;
|
|
114
125
|
findGroup(name: string): AXPPermissionDefinitionGroupBuilder | undefined;
|
|
@@ -117,7 +128,12 @@ declare class AXPPermissionDefinitionBuilder {
|
|
|
117
128
|
private groupBuilder;
|
|
118
129
|
private permission;
|
|
119
130
|
constructor(groupBuilder: AXPPermissionDefinitionGroupBuilder, permission: AXPPermissionDefinition);
|
|
120
|
-
addChild(name: string, title: string, description?: string): AXPPermissionDefinitionBuilder;
|
|
131
|
+
addChild(name: string, title: string, description?: string, requiredFeatures?: string[]): AXPPermissionDefinitionBuilder;
|
|
132
|
+
/**
|
|
133
|
+
* Set required features for this permission.
|
|
134
|
+
* @param features - Array of feature names (e.g., ['PlatformManagement.menu-customization'])
|
|
135
|
+
*/
|
|
136
|
+
requireFeatures(...features: string[]): AXPPermissionDefinitionBuilder;
|
|
121
137
|
endPermission(): AXPPermissionDefinitionGroupBuilder;
|
|
122
138
|
}
|
|
123
139
|
|
|
@@ -127,8 +143,19 @@ interface AXPPermissionDefinitionProvider {
|
|
|
127
143
|
declare const AXP_PERMISSION_DEFINITION_PROVIDER: InjectionToken<AXPPermissionDefinitionProvider[]>;
|
|
128
144
|
declare class AXPPermissionDefinitionService {
|
|
129
145
|
private providers;
|
|
146
|
+
private providerRegistry;
|
|
147
|
+
private sessionService;
|
|
130
148
|
private cache;
|
|
131
149
|
private load;
|
|
150
|
+
/**
|
|
151
|
+
* Filter permissions based on required features.
|
|
152
|
+
* Removes permissions that have required features that are not enabled.
|
|
153
|
+
*/
|
|
154
|
+
private filterByFeatures;
|
|
155
|
+
/**
|
|
156
|
+
* Recursively filter permissions and their children based on required features.
|
|
157
|
+
*/
|
|
158
|
+
private filterPermissions;
|
|
132
159
|
reload(): Promise<void>;
|
|
133
160
|
getGroups(): Promise<AXPPermissionGroupDefinition[]>;
|
|
134
161
|
getPermissions(): Promise<AXPPermissionDefinition[]>;
|
|
@@ -187,10 +214,14 @@ interface AXPFeature {
|
|
|
187
214
|
title: string;
|
|
188
215
|
description?: string;
|
|
189
216
|
value?: any;
|
|
217
|
+
interface?: {
|
|
218
|
+
type: string;
|
|
219
|
+
options?: AXPOptionsData;
|
|
220
|
+
};
|
|
190
221
|
}
|
|
191
222
|
|
|
192
223
|
interface AXPFeatureLoader {
|
|
193
|
-
getList(context: AXPSessionContext):
|
|
224
|
+
getList(context: AXPSessionContext): Promise<AXPFeature[]>;
|
|
194
225
|
}
|
|
195
226
|
declare const AXP_FEATURE_LOADER: InjectionToken<AXPFeatureLoader>;
|
|
196
227
|
|
|
@@ -210,14 +241,45 @@ declare class AXPFeatureDirective {
|
|
|
210
241
|
|
|
211
242
|
declare const AXPFeatureGuard: CanActivateFn;
|
|
212
243
|
|
|
244
|
+
/**
|
|
245
|
+
* Interface for feature checkers that can override feature enablement results.
|
|
246
|
+
* Checkers receive the feature keys, current context, and base result,
|
|
247
|
+
* and can return a modified result based on custom logic.
|
|
248
|
+
*/
|
|
249
|
+
interface AXPFeatureChecker {
|
|
250
|
+
/**
|
|
251
|
+
* Checks and potentially overrides the feature enablement result.
|
|
252
|
+
* @param keys - The feature keys being checked
|
|
253
|
+
* @param context - Current session context (user, tenant, application)
|
|
254
|
+
* @param baseResult - The result from the base feature check logic
|
|
255
|
+
* @returns The final feature enablement result (true or false)
|
|
256
|
+
*/
|
|
257
|
+
check(keys: string[], context: AXPSessionContext, baseResult: boolean): boolean;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Optional injection token for feature checker.
|
|
262
|
+
* If provided, the checker will be called to potentially override
|
|
263
|
+
* feature enablement results based on custom logic.
|
|
264
|
+
*/
|
|
265
|
+
declare const AXP_FEATURE_CHECKER: InjectionToken<AXPFeatureChecker>;
|
|
266
|
+
|
|
213
267
|
declare class AXPSessionService {
|
|
214
268
|
private eventService;
|
|
215
269
|
private authStrategyRegistry;
|
|
270
|
+
private readonly injector;
|
|
216
271
|
static readonly SESSION_KEY = "AXP_SESSION";
|
|
217
272
|
private readonly permissionLoader;
|
|
218
273
|
private readonly featureLoader;
|
|
219
274
|
private readonly tenantLoader;
|
|
220
275
|
private readonly applicationLoader;
|
|
276
|
+
private readonly permissionChecker;
|
|
277
|
+
private readonly featureChecker;
|
|
278
|
+
/**
|
|
279
|
+
* Get module provider loader lazily to avoid circular dependency.
|
|
280
|
+
* ModuleProviderLoader depends on AXPSessionService, which is this service.
|
|
281
|
+
*/
|
|
282
|
+
private getModuleProviderLoader;
|
|
221
283
|
private status;
|
|
222
284
|
readonly status$: Observable<AXPSessionStatus>;
|
|
223
285
|
private isLoading;
|
|
@@ -259,7 +321,6 @@ declare class AXPSessionService {
|
|
|
259
321
|
authorize(...keys: string[]): boolean;
|
|
260
322
|
isFeatureEnabled(...keys: string[]): boolean;
|
|
261
323
|
getToken(): string | undefined;
|
|
262
|
-
private checkTokenValidation;
|
|
263
324
|
getContext(): AXPSessionContext;
|
|
264
325
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPSessionService, never>;
|
|
265
326
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPSessionService>;
|
|
@@ -270,6 +331,29 @@ declare class AXPPermissionEvaluatorScopeProvider implements AXPExpressionEvalua
|
|
|
270
331
|
provide(context: AXPExpressionEvaluatorScopeProviderContext): Promise<void>;
|
|
271
332
|
}
|
|
272
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Interface for permission checkers that can override authorization results.
|
|
336
|
+
* Checkers receive the permission keys, current context, and base result,
|
|
337
|
+
* and can return a modified result based on custom logic.
|
|
338
|
+
*/
|
|
339
|
+
interface AXPPermissionChecker {
|
|
340
|
+
/**
|
|
341
|
+
* Checks and potentially overrides the authorization result.
|
|
342
|
+
* @param keys - The permission keys being checked
|
|
343
|
+
* @param context - Current session context (user, tenant, application)
|
|
344
|
+
* @param baseResult - The result from the base authorization logic
|
|
345
|
+
* @returns The final authorization result (true or false)
|
|
346
|
+
*/
|
|
347
|
+
check(keys: string[], context: AXPSessionContext, baseResult: boolean): boolean;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Optional injection token for permission checker.
|
|
352
|
+
* If provided, the checker will be called to potentially override
|
|
353
|
+
* authorization results based on custom logic.
|
|
354
|
+
*/
|
|
355
|
+
declare const AXP_PERMISSION_CHECKER: InjectionToken<AXPPermissionChecker>;
|
|
356
|
+
|
|
273
357
|
declare const AXPAuthGuard: CanActivateFn;
|
|
274
358
|
|
|
275
359
|
interface AXPAuthModuleConfigs {
|
|
@@ -355,230 +439,5 @@ declare class AXPUnauthenticatedError extends Error {
|
|
|
355
439
|
} | undefined);
|
|
356
440
|
}
|
|
357
441
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
*/
|
|
361
|
-
type AXPChallengeContentType = 'image-url' | 'image-base64' | 'text' | 'audio-url';
|
|
362
|
-
/**
|
|
363
|
-
* Challenge data returned from the server
|
|
364
|
-
* Contains all information needed to display and submit a challenge
|
|
365
|
-
*/
|
|
366
|
-
interface AXPLoginChallengeData {
|
|
367
|
-
/**
|
|
368
|
-
* Unique identifier for this challenge
|
|
369
|
-
* Must be sent back with credentials when submitting login
|
|
370
|
-
*/
|
|
371
|
-
id: string;
|
|
372
|
-
/**
|
|
373
|
-
* The challenge content to display
|
|
374
|
-
* Could be an image URL, base64 encoded image, text, or audio URL
|
|
375
|
-
*/
|
|
376
|
-
content: string;
|
|
377
|
-
/**
|
|
378
|
-
* Type of content for proper rendering
|
|
379
|
-
*/
|
|
380
|
-
contentType: AXPChallengeContentType;
|
|
381
|
-
/**
|
|
382
|
-
* When this challenge expires (optional)
|
|
383
|
-
* After expiration, a new challenge should be fetched
|
|
384
|
-
*/
|
|
385
|
-
expiresAt?: Date;
|
|
386
|
-
/**
|
|
387
|
-
* Additional metadata from server (optional)
|
|
388
|
-
*/
|
|
389
|
-
metadata?: Record<string, unknown>;
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* Result of checking a login error response
|
|
393
|
-
* Determines if a challenge should be displayed
|
|
394
|
-
*/
|
|
395
|
-
interface AXPChallengeCheckResult {
|
|
396
|
-
/**
|
|
397
|
-
* Whether a challenge is required
|
|
398
|
-
*/
|
|
399
|
-
required: boolean;
|
|
400
|
-
/**
|
|
401
|
-
* Optional message to display to the user
|
|
402
|
-
*/
|
|
403
|
-
message?: string;
|
|
404
|
-
/**
|
|
405
|
-
* Additional data from server that may be needed for getChallenge()
|
|
406
|
-
* For example: sessionId, attemptId, etc.
|
|
407
|
-
*/
|
|
408
|
-
serverData?: Record<string, unknown>;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Base class for login challenge UI components
|
|
413
|
-
*
|
|
414
|
-
* Providers can extend this class to create custom challenge UIs.
|
|
415
|
-
* The login component will render this component and listen to its outputs.
|
|
416
|
-
*
|
|
417
|
-
* @example
|
|
418
|
-
* ```typescript
|
|
419
|
-
* @Component({
|
|
420
|
-
* selector: 'my-captcha-challenge',
|
|
421
|
-
* template: `
|
|
422
|
-
* <div class="captcha-container">
|
|
423
|
-
* <img [src]="'data:image/png;base64,' + challengeData().content" />
|
|
424
|
-
* <input
|
|
425
|
-
* type="text"
|
|
426
|
-
* [value]="response()"
|
|
427
|
-
* (input)="onResponseChange($event)"
|
|
428
|
-
* />
|
|
429
|
-
* <button (click)="onRefreshClick()">Refresh</button>
|
|
430
|
-
* </div>
|
|
431
|
-
* `
|
|
432
|
-
* })
|
|
433
|
-
* export class MyCaptchaChallengeComponent extends AXPLoginChallengeComponentBase {
|
|
434
|
-
* response = signal('');
|
|
435
|
-
*
|
|
436
|
-
* onResponseChange(event: Event) {
|
|
437
|
-
* const value = (event.target as HTMLInputElement).value;
|
|
438
|
-
* this.response.set(value);
|
|
439
|
-
* this.responseChange.emit(value);
|
|
440
|
-
* }
|
|
441
|
-
*
|
|
442
|
-
* onRefreshClick() {
|
|
443
|
-
* this.refreshRequest.emit();
|
|
444
|
-
* }
|
|
445
|
-
* }
|
|
446
|
-
* ```
|
|
447
|
-
*/
|
|
448
|
-
declare abstract class AXPLoginChallengeComponentBase {
|
|
449
|
-
/**
|
|
450
|
-
* Challenge data to display
|
|
451
|
-
* Contains the image/content and metadata from the server
|
|
452
|
-
*/
|
|
453
|
-
challengeData: i0.InputSignal<AXPLoginChallengeData>;
|
|
454
|
-
/**
|
|
455
|
-
* Whether the challenge is currently loading (e.g., refreshing)
|
|
456
|
-
*/
|
|
457
|
-
isLoading: i0.InputSignal<boolean>;
|
|
458
|
-
/**
|
|
459
|
-
* Emits when the user enters or changes their response
|
|
460
|
-
* The login component will capture this value and include it in credentials
|
|
461
|
-
*/
|
|
462
|
-
responseChange: i0.OutputEmitterRef<string>;
|
|
463
|
-
/**
|
|
464
|
-
* Emits when the user requests a new challenge (e.g., clicks refresh button)
|
|
465
|
-
* The login component will call provider.refreshChallenge()
|
|
466
|
-
*/
|
|
467
|
-
refreshRequest: i0.OutputEmitterRef<void>;
|
|
468
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXPLoginChallengeComponentBase, never>;
|
|
469
|
-
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>;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Abstract base class for login challenge providers
|
|
474
|
-
*
|
|
475
|
-
* Implement this class to create custom challenge mechanisms like:
|
|
476
|
-
* - Image CAPTCHA
|
|
477
|
-
* - reCAPTCHA
|
|
478
|
-
* - SMS verification
|
|
479
|
-
* - Email verification
|
|
480
|
-
*
|
|
481
|
-
* @example
|
|
482
|
-
* ```typescript
|
|
483
|
-
* @Injectable()
|
|
484
|
-
* export class MyImageCaptchaProvider extends AXPLoginChallengeProvider {
|
|
485
|
-
* readonly name = 'image-captcha';
|
|
486
|
-
*
|
|
487
|
-
* checkResponse(error: unknown): AXPChallengeCheckResult | null {
|
|
488
|
-
* if (error instanceof HttpErrorResponse) {
|
|
489
|
-
* if (error.error?.requiresCaptcha) {
|
|
490
|
-
* return { required: true };
|
|
491
|
-
* }
|
|
492
|
-
* }
|
|
493
|
-
* return null;
|
|
494
|
-
* }
|
|
495
|
-
*
|
|
496
|
-
* async getChallenge(): Promise<AXPLoginChallengeData> {
|
|
497
|
-
* const response = await this.http.get('/api/captcha').toPromise();
|
|
498
|
-
* return {
|
|
499
|
-
* id: response.id,
|
|
500
|
-
* content: response.image,
|
|
501
|
-
* contentType: 'image-base64'
|
|
502
|
-
* };
|
|
503
|
-
* }
|
|
504
|
-
*
|
|
505
|
-
* async refreshChallenge(): Promise<AXPLoginChallengeData> {
|
|
506
|
-
* return this.getChallenge();
|
|
507
|
-
* }
|
|
508
|
-
*
|
|
509
|
-
* getChallengeComponent(): Type<AXPLoginChallengeComponentBase> {
|
|
510
|
-
* return MyCaptchaChallengeComponent;
|
|
511
|
-
* }
|
|
512
|
-
* }
|
|
513
|
-
* ```
|
|
514
|
-
*/
|
|
515
|
-
declare abstract class AXPLoginChallengeProvider {
|
|
516
|
-
/**
|
|
517
|
-
* Unique name identifier for this provider
|
|
518
|
-
*/
|
|
519
|
-
abstract readonly name: string;
|
|
520
|
-
/**
|
|
521
|
-
* Checks the login error response to determine if a challenge is required
|
|
522
|
-
*
|
|
523
|
-
* This method is called after a failed login attempt. The implementation
|
|
524
|
-
* should inspect the error and return a result indicating whether a
|
|
525
|
-
* challenge should be displayed.
|
|
526
|
-
*
|
|
527
|
-
* @param error - The error from the failed login attempt (type varies by implementation)
|
|
528
|
-
* @returns Challenge check result, or null if this provider doesn't handle this error
|
|
529
|
-
*/
|
|
530
|
-
abstract checkResponse(error: unknown): AXPChallengeCheckResult | null;
|
|
531
|
-
/**
|
|
532
|
-
* Fetches a new challenge from the server
|
|
533
|
-
*
|
|
534
|
-
* Called when checkResponse indicates a challenge is required.
|
|
535
|
-
* Should make an API call to get challenge data (e.g., CAPTCHA image).
|
|
536
|
-
*
|
|
537
|
-
* @param serverData - Optional data from checkResponse result that may be needed
|
|
538
|
-
* @returns Promise resolving to challenge data for display
|
|
539
|
-
*/
|
|
540
|
-
abstract getChallenge(serverData?: Record<string, unknown>): Promise<AXPLoginChallengeData>;
|
|
541
|
-
/**
|
|
542
|
-
* Fetches a fresh challenge, replacing the current one
|
|
543
|
-
*
|
|
544
|
-
* Called when user requests a new challenge (e.g., clicks "new image" button).
|
|
545
|
-
* Typically delegates to getChallenge() but may have different behavior.
|
|
546
|
-
*
|
|
547
|
-
* @returns Promise resolving to new challenge data
|
|
548
|
-
*/
|
|
549
|
-
abstract refreshChallenge(): Promise<AXPLoginChallengeData>;
|
|
550
|
-
/**
|
|
551
|
-
* Returns the component type for rendering the challenge UI
|
|
552
|
-
*
|
|
553
|
-
* Override this method to provide a custom challenge UI component.
|
|
554
|
-
* If not overridden (returns null), the login component will use
|
|
555
|
-
* a default built-in UI.
|
|
556
|
-
*
|
|
557
|
-
* @returns Component type extending AXPLoginChallengeComponentBase, or null for default UI
|
|
558
|
-
*/
|
|
559
|
-
getChallengeComponent(): Type<AXPLoginChallengeComponentBase> | null;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* Injection token for the login challenge provider
|
|
564
|
-
*
|
|
565
|
-
* This token is optional - if not provided, no challenge mechanism will be used.
|
|
566
|
-
*
|
|
567
|
-
* @example
|
|
568
|
-
* ```typescript
|
|
569
|
-
* // In your app module or provider configuration:
|
|
570
|
-
* providers: [
|
|
571
|
-
* {
|
|
572
|
-
* provide: AXP_LOGIN_CHALLENGE_PROVIDER,
|
|
573
|
-
* useClass: MyImageCaptchaProvider
|
|
574
|
-
* }
|
|
575
|
-
* ]
|
|
576
|
-
*
|
|
577
|
-
* // In a component:
|
|
578
|
-
* private challengeProvider = inject(AXP_LOGIN_CHALLENGE_PROVIDER, { optional: true });
|
|
579
|
-
* ```
|
|
580
|
-
*/
|
|
581
|
-
declare const AXP_LOGIN_CHALLENGE_PROVIDER: InjectionToken<AXPLoginChallengeProvider>;
|
|
582
|
-
|
|
583
|
-
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_LOADER, AXP_LOGIN_CHALLENGE_PROVIDER, AXP_PERMISSION_DEFINITION_PROVIDER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER, JwtUtil, PkceUtil, TimeUtil, initializeAppState };
|
|
584
|
-
export type { AXPApplication, AXPApplicationLoader, AXPAuthModuleConfigs, AXPBaseCredentials, AXPChallengeCheckResult, AXPChallengeContentType, AXPFeature, AXPFeatureLoader, AXPLoginChallengeData, AXPPermission, AXPPermissionDefinition, AXPPermissionDefinitionProvider, AXPPermissionGroupDefinition, AXPPermissionLoader, AXPSessionData, AXPSignInResult, AXPTenant, AXPTenantLoader, AXPTokenResult, AXPUser };
|
|
442
|
+
export { AXPAuthGuard, AXPAuthModule, AXPAuthStrategy, AXPAuthStrategyRegistryService, AXPFeatureDirective, AXPFeatureGuard, AXPPermissionDefinitionBuilder, AXPPermissionDefinitionGroupBuilder, AXPPermissionDefinitionProviderContext, AXPPermissionDefinitionService, AXPPermissionDirective, AXPPermissionEvaluatorScopeProvider, AXPPermissionGuard, AXPSessionContext, AXPSessionService, AXPSessionStatus, AXPUnauthenticatedError, AXPUnauthorizedError, AXP_APPLICATION_LOADER, AXP_FEATURE_CHECKER, AXP_FEATURE_LOADER, AXP_PERMISSION_CHECKER, AXP_PERMISSION_DEFINITION_PROVIDER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER, JwtUtil, PkceUtil, TimeUtil, initializeAppState };
|
|
443
|
+
export type { AXPApplication, AXPApplicationLoader, AXPAuthModuleConfigs, AXPBaseCredentials, AXPEdition, AXPFeature, AXPFeatureChecker, AXPFeatureLoader, AXPPermission, AXPPermissionChecker, AXPPermissionDefinition, AXPPermissionDefinitionProvider, AXPPermissionGroupDefinition, AXPPermissionLoader, AXPSessionData, AXPSignInResult, AXPTenant, AXPTenantLoader, AXPTokenResult, AXPUser };
|