@acorex/platform 21.0.0-next.0 → 21.0.0-next.2
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 +238 -92
- package/common/index.d.ts +42 -606
- package/core/index.d.ts +432 -574
- package/fesm2022/acorex-platform-auth.mjs +200 -153
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +112 -1009
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +416 -694
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +11 -54
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +272 -414
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +3105 -2064
- 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 +648 -756
- 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 +174 -248
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs +50 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs +42 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs +55 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs +50 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs +48 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs +42 -0
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs → acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-m8rHZP8L.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-m8rHZP8L.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +974 -2994
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs → acorex-platform-themes-default-entity-master-create-view.component-mARj77Mr.mjs} +5 -26
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-mARj77Mr.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs → acorex-platform-themes-default-entity-master-list-view.component-Cym8pq0v.mjs} +5 -4
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-Cym8pq0v.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs +101 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs → acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs} +3 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +30 -166
- 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 +1 -4
- package/layout/components/index.d.ts +327 -405
- package/layout/designer/index.d.ts +3 -3
- package/layout/entity/index.d.ts +108 -163
- package/layout/widget-core/index.d.ts +49 -39
- package/layout/widgets/index.d.ts +54 -368
- package/package.json +1 -1
- package/themes/default/index.d.ts +2 -15
- package/themes/shared/index.d.ts +10 -10
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +0 -1
package/auth/index.d.ts
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, TemplateRef, ViewContainerRef, ModuleWithProviders, Injector } from '@angular/core';
|
|
3
|
-
import { AXPLogoConfig, AXPOptionsData, AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex/platform/core';
|
|
4
|
-
import { CanActivateFn } from '@angular/router';
|
|
2
|
+
import { InjectionToken, TemplateRef, ViewContainerRef, ModuleWithProviders, Injector, Type } from '@angular/core';
|
|
5
3
|
import { Observable } from 'rxjs';
|
|
4
|
+
import { AXPLogoConfig, AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex/platform/core';
|
|
5
|
+
import { CanActivateFn } from '@angular/router';
|
|
6
6
|
|
|
7
|
-
interface AXPEdition {
|
|
8
|
-
id: string;
|
|
9
|
-
title: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
}
|
|
12
7
|
interface AXPApplication {
|
|
13
8
|
id: string;
|
|
14
9
|
name: string;
|
|
15
10
|
title?: string;
|
|
16
11
|
version?: string;
|
|
17
|
-
|
|
12
|
+
editionName?: string;
|
|
18
13
|
description?: string;
|
|
19
14
|
logo?: AXPLogoConfig;
|
|
20
15
|
}
|
|
@@ -57,12 +52,12 @@ declare enum AXPSessionStatus {
|
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
interface AXPApplicationLoader {
|
|
60
|
-
getList(context: AXPSessionContext):
|
|
55
|
+
getList(context: AXPSessionContext): Observable<AXPApplication[]>;
|
|
61
56
|
}
|
|
62
57
|
declare const AXP_APPLICATION_LOADER: InjectionToken<AXPApplicationLoader>;
|
|
63
58
|
|
|
64
59
|
interface AXPTenantLoader {
|
|
65
|
-
getList(context: AXPSessionContext):
|
|
60
|
+
getList(context: AXPSessionContext): Observable<AXPTenant[]>;
|
|
66
61
|
}
|
|
67
62
|
declare const AXP_TENANT_LOADER: InjectionToken<AXPTenantLoader>;
|
|
68
63
|
|
|
@@ -94,16 +89,10 @@ type AXPPermissionDefinition = {
|
|
|
94
89
|
title: string;
|
|
95
90
|
description?: string;
|
|
96
91
|
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
92
|
};
|
|
104
93
|
|
|
105
94
|
interface AXPPermissionLoader {
|
|
106
|
-
getList(context: AXPSessionContext):
|
|
95
|
+
getList(context: AXPSessionContext): Observable<AXPPermission[]>;
|
|
107
96
|
}
|
|
108
97
|
declare const AXP_PERMISSION_LOADER: InjectionToken<AXPPermissionLoader>;
|
|
109
98
|
|
|
@@ -119,7 +108,7 @@ declare class AXPPermissionDefinitionGroupBuilder {
|
|
|
119
108
|
private _group;
|
|
120
109
|
get group(): AXPPermissionGroupDefinition;
|
|
121
110
|
constructor(context: AXPPermissionDefinitionProviderContext, group: AXPPermissionGroupDefinition);
|
|
122
|
-
addPermission(name: string, title: string, description?: string
|
|
111
|
+
addPermission(name: string, title: string, description?: string): AXPPermissionDefinitionBuilder;
|
|
123
112
|
endGroup(): AXPPermissionDefinitionProviderContext;
|
|
124
113
|
findPermission(path: string): AXPPermissionDefinition | undefined;
|
|
125
114
|
findGroup(name: string): AXPPermissionDefinitionGroupBuilder | undefined;
|
|
@@ -128,12 +117,7 @@ declare class AXPPermissionDefinitionBuilder {
|
|
|
128
117
|
private groupBuilder;
|
|
129
118
|
private permission;
|
|
130
119
|
constructor(groupBuilder: AXPPermissionDefinitionGroupBuilder, permission: AXPPermissionDefinition);
|
|
131
|
-
addChild(name: string, title: string, description?: string
|
|
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;
|
|
120
|
+
addChild(name: string, title: string, description?: string): AXPPermissionDefinitionBuilder;
|
|
137
121
|
endPermission(): AXPPermissionDefinitionGroupBuilder;
|
|
138
122
|
}
|
|
139
123
|
|
|
@@ -143,19 +127,8 @@ interface AXPPermissionDefinitionProvider {
|
|
|
143
127
|
declare const AXP_PERMISSION_DEFINITION_PROVIDER: InjectionToken<AXPPermissionDefinitionProvider[]>;
|
|
144
128
|
declare class AXPPermissionDefinitionService {
|
|
145
129
|
private providers;
|
|
146
|
-
private providerRegistry;
|
|
147
|
-
private sessionService;
|
|
148
130
|
private cache;
|
|
149
131
|
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;
|
|
159
132
|
reload(): Promise<void>;
|
|
160
133
|
getGroups(): Promise<AXPPermissionGroupDefinition[]>;
|
|
161
134
|
getPermissions(): Promise<AXPPermissionDefinition[]>;
|
|
@@ -214,14 +187,10 @@ interface AXPFeature {
|
|
|
214
187
|
title: string;
|
|
215
188
|
description?: string;
|
|
216
189
|
value?: any;
|
|
217
|
-
interface?: {
|
|
218
|
-
type: string;
|
|
219
|
-
options?: AXPOptionsData;
|
|
220
|
-
};
|
|
221
190
|
}
|
|
222
191
|
|
|
223
192
|
interface AXPFeatureLoader {
|
|
224
|
-
getList(context: AXPSessionContext):
|
|
193
|
+
getList(context: AXPSessionContext): Observable<AXPFeature[]>;
|
|
225
194
|
}
|
|
226
195
|
declare const AXP_FEATURE_LOADER: InjectionToken<AXPFeatureLoader>;
|
|
227
196
|
|
|
@@ -241,29 +210,6 @@ declare class AXPFeatureDirective {
|
|
|
241
210
|
|
|
242
211
|
declare const AXPFeatureGuard: CanActivateFn;
|
|
243
212
|
|
|
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
|
-
|
|
267
213
|
declare class AXPSessionService {
|
|
268
214
|
private eventService;
|
|
269
215
|
private authStrategyRegistry;
|
|
@@ -272,9 +218,6 @@ declare class AXPSessionService {
|
|
|
272
218
|
private readonly featureLoader;
|
|
273
219
|
private readonly tenantLoader;
|
|
274
220
|
private readonly applicationLoader;
|
|
275
|
-
private readonly moduleProviderLoader;
|
|
276
|
-
private readonly permissionChecker;
|
|
277
|
-
private readonly featureChecker;
|
|
278
221
|
private status;
|
|
279
222
|
readonly status$: Observable<AXPSessionStatus>;
|
|
280
223
|
private isLoading;
|
|
@@ -316,6 +259,7 @@ declare class AXPSessionService {
|
|
|
316
259
|
authorize(...keys: string[]): boolean;
|
|
317
260
|
isFeatureEnabled(...keys: string[]): boolean;
|
|
318
261
|
getToken(): string | undefined;
|
|
262
|
+
private checkTokenValidation;
|
|
319
263
|
getContext(): AXPSessionContext;
|
|
320
264
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPSessionService, never>;
|
|
321
265
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPSessionService>;
|
|
@@ -326,29 +270,6 @@ declare class AXPPermissionEvaluatorScopeProvider implements AXPExpressionEvalua
|
|
|
326
270
|
provide(context: AXPExpressionEvaluatorScopeProviderContext): Promise<void>;
|
|
327
271
|
}
|
|
328
272
|
|
|
329
|
-
/**
|
|
330
|
-
* Interface for permission checkers that can override authorization results.
|
|
331
|
-
* Checkers receive the permission keys, current context, and base result,
|
|
332
|
-
* and can return a modified result based on custom logic.
|
|
333
|
-
*/
|
|
334
|
-
interface AXPPermissionChecker {
|
|
335
|
-
/**
|
|
336
|
-
* Checks and potentially overrides the authorization result.
|
|
337
|
-
* @param keys - The permission keys being checked
|
|
338
|
-
* @param context - Current session context (user, tenant, application)
|
|
339
|
-
* @param baseResult - The result from the base authorization logic
|
|
340
|
-
* @returns The final authorization result (true or false)
|
|
341
|
-
*/
|
|
342
|
-
check(keys: string[], context: AXPSessionContext, baseResult: boolean): boolean;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Optional injection token for permission checker.
|
|
347
|
-
* If provided, the checker will be called to potentially override
|
|
348
|
-
* authorization results based on custom logic.
|
|
349
|
-
*/
|
|
350
|
-
declare const AXP_PERMISSION_CHECKER: InjectionToken<AXPPermissionChecker>;
|
|
351
|
-
|
|
352
273
|
declare const AXPAuthGuard: CanActivateFn;
|
|
353
274
|
|
|
354
275
|
interface AXPAuthModuleConfigs {
|
|
@@ -434,5 +355,230 @@ declare class AXPUnauthenticatedError extends Error {
|
|
|
434
355
|
} | undefined);
|
|
435
356
|
}
|
|
436
357
|
|
|
437
|
-
|
|
438
|
-
|
|
358
|
+
/**
|
|
359
|
+
* Supported content types for challenge display
|
|
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 };
|