@dflat-core/web 1.7.2091 → 1.7.2093

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 (35) hide show
  1. package/assets/images/dflat-logo.png +0 -0
  2. package/assets/shared.scss +1 -1
  3. package/assets/variables.scss +1 -2
  4. package/fesm2022/dflat-core-web-core-model.mjs +18 -1
  5. package/fesm2022/dflat-core-web-core-model.mjs.map +1 -1
  6. package/fesm2022/dflat-core-web-core-services.mjs +119 -12
  7. package/fesm2022/dflat-core-web-core-services.mjs.map +1 -1
  8. package/fesm2022/dflat-core-web-core-ux.mjs +14 -14
  9. package/fesm2022/dflat-core-web-core-ux.mjs.map +1 -1
  10. package/fesm2022/dflat-core-web-identity-data.mjs +66 -0
  11. package/fesm2022/dflat-core-web-identity-data.mjs.map +1 -1
  12. package/fesm2022/dflat-core-web-identity-model.mjs +11 -1
  13. package/fesm2022/dflat-core-web-identity-model.mjs.map +1 -1
  14. package/fesm2022/dflat-core-web-identity-root.mjs +3 -0
  15. package/fesm2022/dflat-core-web-identity-root.mjs.map +1 -1
  16. package/fesm2022/dflat-core-web-identity-ux.mjs +290 -1
  17. package/fesm2022/dflat-core-web-identity-ux.mjs.map +1 -1
  18. package/fesm2022/dflat-core-web-meta-ux.mjs +4 -4
  19. package/fesm2022/dflat-core-web-meta-ux.mjs.map +1 -1
  20. package/fesm2022/dflat-core-web-system-ux.mjs +217 -10
  21. package/fesm2022/dflat-core-web-system-ux.mjs.map +1 -1
  22. package/package.json +1 -1
  23. package/types/dflat-core-web-core-model.d.ts +36 -0
  24. package/types/dflat-core-web-core-services.d.ts +51 -2
  25. package/types/dflat-core-web-identity-data.d.ts +15 -1
  26. package/types/dflat-core-web-identity-model.d.ts +80 -4
  27. package/types/dflat-core-web-identity-root.d.ts +1 -0
  28. package/types/dflat-core-web-identity-ux.d.ts +93 -16
  29. package/types/dflat-core-web-system-ux.d.ts +74 -20
  30. package/assets/images/map/blue/kezako.png +0 -0
  31. package/assets/images/map/blue/kezako.svg +0 -1
  32. package/assets/images/map/main/kezako.png +0 -0
  33. package/assets/images/map/main/kezako.svg +0 -1
  34. package/assets/images/map/primary/kezako.png +0 -0
  35. package/assets/images/map/primary/kezako.svg +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dflat-core/web",
3
- "version": "1.7.2091",
3
+ "version": "1.7.2093",
4
4
  "description": "Librairies Angular Dflat (core, core-*, system-*) et assets partagés, empaquetées en un module npm unique.",
5
5
  "license": "MIT",
6
6
  "peerDependencies": {
@@ -404,6 +404,23 @@ export declare class DashboardCacheChangedMessage {
404
404
  /** @param info État du cache (DashboardCacheInfo), ou null. */
405
405
  constructor(info?: any);
406
406
  }
407
+ /**
408
+ * Message du bus : message diffusé par le serveur (signal BroadcastMessage du hub, envoyé à un compte ou à tous).
409
+ * Une application s'y abonne et filtre par nom : bus.of(BroadcastMessage).pipe(filter(m => m.is('MonEvenement'))).
410
+ */
411
+ export declare class BroadcastMessage {
412
+ name: string;
413
+ message: string;
414
+ /**
415
+ * @param name Nom du message (événement ou titre), choisi par le serveur.
416
+ * @param message Contenu : texte ou JSON.
417
+ */
418
+ constructor(name: string, message: string);
419
+ /** Vrai si le message porte ce nom (casse comprise). */
420
+ is(name: string): boolean;
421
+ /** Contenu analysé en JSON, ou null s'il est vide ou n'est pas du JSON valide. */
422
+ json<T = any>(): T | null;
423
+ }
407
424
  export interface IUserCredential extends IIdentifiable {
408
425
  AccessToken: string;
409
426
  RefreshToken: string;
@@ -423,6 +440,23 @@ export interface IUserCredential extends IIdentifiable {
423
440
  Permissions: string[];
424
441
  ProfileImageUrl: string;
425
442
  AvatarUrl: string;
443
+ /** Le second facteur est demandé : aucun jeton, le code s'envoie avec TwoFactorChallenge (Connexion, B.5.8). */
444
+ TwoFactorRequired?: boolean;
445
+ /** Jeton de la connexion en attente du second facteur. */
446
+ TwoFactorChallenge?: string;
447
+ /** La politique impose la double authentification à ce compte, qui ne l'a pas encore. */
448
+ TwoFactorSetupRequired?: boolean;
449
+ /** Jeton d'appareil de confiance, à garder par le navigateur. */
450
+ TrustedDeviceToken?: string;
451
+ }
452
+ /** Moyens de connexion proposés par l'écran de connexion (Account/GetLoginOptions, Connexion, B.5.8). */
453
+ export interface ILoginOptions {
454
+ /** La connexion par un lien envoyé par e-mail est activée. */
455
+ LoginLinkEnabled?: boolean;
456
+ /** La demande de lien exige un captcha. */
457
+ LoginLinkCaptcha?: boolean;
458
+ /** Fournisseurs externes configurés. */
459
+ Providers?: IExternalLoginProvider[];
426
460
  }
427
461
  /** Fournisseur d'identité externe proposé à l'écran de connexion (Account/GetLoginProviders). */
428
462
  export interface IExternalLoginProvider {
@@ -432,6 +466,8 @@ export interface IExternalLoginProvider {
432
466
  ClientId: string;
433
467
  /** Microsoft seulement : locataire du point d'accès (common par défaut). */
434
468
  TenantId?: string;
469
+ /** Google seulement : identifiant client iOS, pour la connexion native dans l'application iPhone. */
470
+ IosClientId?: string;
435
471
  }
436
472
  export declare class User implements IUserCredential {
437
473
  AccessToken: string;
@@ -3,7 +3,7 @@ import * as i0 from "@angular/core";
3
3
  import { EventEmitter, InjectionToken, Injector, NgZone } from "@angular/core";
4
4
  import * as i1 from "@angular/common";
5
5
  import * as i2 from "@dflat-core/web/core-model";
6
- import { ApiError, DictionnaryWrapper, IExternalLoginProvider, IUserCredential, Message, Notification, User } from "@dflat-core/web/core-model";
6
+ import { ApiError, DictionnaryWrapper, IExternalLoginProvider, ILoginOptions, IUserCredential, Message, Notification, User } from "@dflat-core/web/core-model";
7
7
  import { ActivatedRouteSnapshot, Route, Router, RouterStateSnapshot } from "@angular/router";
8
8
  import { Observable, ReplaySubject, Subject, Subscription } from "rxjs";
9
9
  import { HttpClient, HttpErrorResponse, HttpEvent, HttpHandler, HttpHeaders, HttpInterceptor, HttpRequest } from "@angular/common/http";
@@ -189,6 +189,34 @@ export declare class AuthService {
189
189
  private refreshTokenSubscription;
190
190
  constructor(headersService: HeadersService, busMsg: BusMessageService, httpClient: HttpClient, router: Router, localStorage: LocalStoreManager, menuService: MenuService, env: EnvironmentBase);
191
191
  login(username: string, password: string, rememberMe: boolean): Observable<IUserCredential>;
192
+ /** Clé du jeton d'appareil de confiance dans le stockage du navigateur (Connexion, B.5.8). */
193
+ static readonly trustedDeviceKey = "dflat_trusted_device";
194
+ /**
195
+ * Termine une connexion : jetons enregistrés et rafraîchissement programmé. Une connexion en attente du second
196
+ * facteur (TwoFactorRequired) est renvoyée telle quelle, sans jeton : l'écran demande le code (Connexion, B.5.8).
197
+ */
198
+ protected completeLogin(user: IUserCredential, rememberMe: boolean): IUserCredential;
199
+ /**
200
+ * Moyens de connexion proposés : lien envoyé par e-mail et fournisseurs externes (Connexion, B.5.8).
201
+ */
202
+ getLoginOptions(): Observable<ILoginOptions>;
203
+ /**
204
+ * Demande un lien de connexion par e-mail. La réponse est la même que l'e-mail soit inscrit ou non.
205
+ */
206
+ sendLoginLink(email: string, captchaToken?: string): Observable<any>;
207
+ /**
208
+ * Connexion par le lien reçu par e-mail (paramètre code de la page login-link). Peut demander le second facteur.
209
+ */
210
+ loginWithLink(code: string, rememberMe: boolean): Observable<IUserCredential>;
211
+ /**
212
+ * Termine une connexion en attente avec le code de l'application d'authentification ou un code de secours ;
213
+ * avec trustDevice, le navigateur garde un jeton qui évite le code pendant la durée configurée.
214
+ */
215
+ loginTwoFactor(challenge: string, code: string, recoveryCode: string, trustDevice: boolean, rememberMe: boolean): Observable<IUserCredential>;
216
+ /** Jeton d'appareil de confiance gardé par ce navigateur, ou null (stockage indisponible compris). */
217
+ getTrustedDeviceToken(): string | null;
218
+ /** Garde le jeton d'appareil de confiance ; il survit à la déconnexion, comme la confiance qu'il porte. */
219
+ protected saveTrustedDeviceToken(token: string): void;
192
220
  /**
193
221
  * Fournisseurs d'identité externes (Google, Microsoft, Apple) activés et configurés côté
194
222
  * serveur (section ExternalLogin de la configuration).
@@ -309,7 +337,24 @@ export declare class ExternalLoginService {
309
337
  * de l'application chez Microsoft).
310
338
  */
311
339
  signInWithMicrosoft(provider: IExternalLoginProvider): Promise<IExternalLoginResult>;
312
- /** Connexion par un identifiant Apple, dans la fenêtre du script officiel « Sign in with Apple ». */
340
+ /**
341
+ * Application mobile (Capacitor, plateforme native) : Google refuse sa connexion dans une vue web embarquée,
342
+ * et l'App Store exige « Se connecter avec Apple » natif. La connexion passe alors par le plugin natif
343
+ * @capgo/capacitor-social-login, installé par les modèles dflat-android et dflat-ios (Connexion, B.5.11).
344
+ */
345
+ isNativeApp(): boolean;
346
+ /** Plateforme native : 'ios', 'android', ou 'web' hors application mobile. */
347
+ get nativePlatform(): string;
348
+ /**
349
+ * Connexion Google native (application mobile seulement) : le jeton d'identité est émis pour l'identifiant
350
+ * client web (Android) ou iOS, tous deux acceptés par le serveur (AdditionalClientIds).
351
+ */
352
+ signInWithGoogleNative(provider: IExternalLoginProvider): Promise<IExternalLoginResult>;
353
+ /** Connexion Apple native (iPhone) : jeton émis pour l'identifiant de l'application, accepté par le serveur (AdditionalClientIds). */
354
+ private signInWithAppleNative;
355
+ /** Plugin natif de connexion, enregistré par Capacitor ; erreur explicite s'il n'est pas installé. */
356
+ private nativePlugin;
357
+ /** Connexion par un identifiant Apple, dans la fenêtre du script officiel « Sign in with Apple » (native sur iPhone). */
313
358
  signInWithApple(provider: IExternalLoginProvider): Promise<IExternalLoginResult>;
314
359
  /** Vrai si l'erreur vient de l'utilisateur qui a fermé la fenêtre de connexion. */
315
360
  isCancellation(error: any): boolean;
@@ -485,6 +530,10 @@ export declare class ServerUrl {
485
530
  static activatePath: string;
486
531
  static refreshPath: string;
487
532
  static disconnectPath: string;
533
+ static loginOptionsPath: string;
534
+ static sendLoginLinkPath: string;
535
+ static connectLoginLinkPath: string;
536
+ static connectTwoFactorPath: string;
488
537
  }
489
538
  export declare function trimChar(str: string, c: string): string;
490
539
  /**
@@ -1,7 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "@angular/common";
3
3
  import * as i2 from "@dflat-core/web/identity-model";
4
- import { ActivationResults, ActivationViewModel, ChangePasswordViewModel, DeviceTokenFilterViewModel, DeviceTokenView, ExternalLoginProviderViewModel, ExternalLoginViewModel, LoginViewModel, PresentationProfileAssignmentFilterViewModel, PresentationProfileAssignmentView, PushSendSummary, RegisterDeviceTokenRequest, RegisterViewModel, ResetPasswordViewModel, RoleFilterViewModel, RolePermission, RolePermissionFilterViewModel, RoleView, SendPushRequest, UnregisterDeviceTokenRequest, UserAccount, UserAccountFilterViewModel, UserAccountLoginFilterViewModel, UserAccountLoginView, UserAccountRoleFilterViewModel, UserAccountRoleView, UserAccountToken, UserAccountTokenFilterViewModel, UserCredential, UserFavorite, UserFavoriteFilterViewModel, UserGroup, UserGroupDefinitionFilterViewModel, UserGroupDefinitionView, UserGroupFilterViewModel, UserHistory, UserHistoryFilterViewModel, UserPermissionView, UserPermissionViewFilterViewModel, UserProfileViewModel, UserSession, UserSessionFilterViewModel } from "@dflat-core/web/identity-model";
4
+ import { ActivationResults, ActivationViewModel, ChangePasswordViewModel, DeviceTokenFilterViewModel, DeviceTokenView, DisableUserTwoFactorViewModel, ExternalLoginProviderViewModel, ExternalLoginViewModel, LinkedLoginViewModel, LoginLinkViewModel, LoginOptionsViewModel, LoginViewModel, PresentationProfileAssignmentFilterViewModel, PresentationProfileAssignmentView, PushSendSummary, RecoveryCodesViewModel, RegisterDeviceTokenRequest, RegisterViewModel, ResetPasswordViewModel, RevokeTrustedDeviceViewModel, RoleFilterViewModel, RolePermission, RolePermissionFilterViewModel, RoleView, SendLoginLinkViewModel, SendPushRequest, TwoFactorCodeViewModel, TwoFactorLoginViewModel, TwoFactorSetupViewModel, TwoFactorStatusViewModel, UnlinkExternalViewModel, UnregisterDeviceTokenRequest, UserAccount, UserAccountFilterViewModel, UserAccountLoginFilterViewModel, UserAccountLoginView, UserAccountRoleFilterViewModel, UserAccountRoleView, UserAccountToken, UserAccountTokenFilterViewModel, UserCredential, UserFavorite, UserFavoriteFilterViewModel, UserGroup, UserGroupDefinitionFilterViewModel, UserGroupDefinitionView, UserGroupFilterViewModel, UserHistory, UserHistoryFilterViewModel, UserPermissionView, UserPermissionViewFilterViewModel, UserProfileViewModel, UserSession, UserSessionFilterViewModel } from "@dflat-core/web/identity-model";
5
5
  import * as i3 from "@dflat-core/web/core-model";
6
6
  import { DataService, EntityDataService } from "@dflat-core/web/core-data";
7
7
  import { Observable } from "rxjs";
@@ -14,15 +14,28 @@ export declare class AccountDataService {
14
14
  protected dataService: DataService;
15
15
  constructor(dataService: DataService);
16
16
  activate(activationModel: ActivationViewModel): Observable<ActivationResults>;
17
+ beginTwoFactorSetup(): Observable<TwoFactorSetupViewModel>;
17
18
  changePassword(entity: ChangePasswordViewModel): Observable<any>;
19
+ confirmTwoFactorSetup(model: TwoFactorCodeViewModel): Observable<RecoveryCodesViewModel>;
18
20
  connect(model: LoginViewModel): Observable<UserCredential>;
19
21
  connectExternal(model: ExternalLoginViewModel): Observable<UserCredential>;
22
+ connectLoginLink(model: LoginLinkViewModel): Observable<UserCredential>;
23
+ connectTwoFactor(model: TwoFactorLoginViewModel): Observable<UserCredential>;
24
+ disableTwoFactor(model: TwoFactorCodeViewModel): Observable<any>;
20
25
  disconnect(refreshToken: string): Observable<boolean>;
26
+ getLinkedLogins(): Observable<LinkedLoginViewModel[]>;
27
+ getLoginOptions(): Observable<LoginOptionsViewModel>;
21
28
  getLoginProviders(): Observable<ExternalLoginProviderViewModel[]>;
29
+ getTwoFactorStatus(): Observable<TwoFactorStatusViewModel>;
30
+ linkExternal(model: ExternalLoginViewModel): Observable<any>;
22
31
  refreshToken(refreshToken: string): Observable<UserCredential>;
32
+ regenerateRecoveryCodes(model: TwoFactorCodeViewModel): Observable<RecoveryCodesViewModel>;
23
33
  register(registerViewModel: RegisterViewModel): Observable<UserCredential>;
24
34
  resetPassword(activationModel: ResetPasswordViewModel): Observable<ActivationResults>;
35
+ revokeTrustedDevice(model: RevokeTrustedDeviceViewModel): Observable<any>;
36
+ sendLoginLink(model: SendLoginLinkViewModel): Observable<any>;
25
37
  sendSMS(): Observable<boolean>;
38
+ unlinkExternal(model: UnlinkExternalViewModel): Observable<any>;
26
39
  updateUserProfile(entity: UserProfileViewModel): Observable<any>;
27
40
  static ɵfac: i0.ɵɵFactoryDeclaration<AccountDataService, never>;
28
41
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
@@ -52,6 +65,7 @@ export declare class UserAccountDataService extends EntityDataService<UserAccoun
52
65
  protected dataService: DataService;
53
66
  getEntityKey(): string;
54
67
  constructor(dataService: DataService);
68
+ disableUserTwoFactor(request: DisableUserTwoFactorViewModel): Observable<any>;
55
69
  static ɵfac: i0.ɵɵFactoryDeclaration<UserAccountDataService, never>;
56
70
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
57
71
  }
@@ -186,6 +186,13 @@ export interface UserAccountLoginView extends EntityViewModel {
186
186
  UserAccountId?: number;
187
187
  UserAccountPseudo?: string;
188
188
  }
189
+ export interface TrustedDeviceViewModel {
190
+ CreationDate?: Date;
191
+ ExpirationDate?: Date;
192
+ Id?: number;
193
+ Label?: string;
194
+ LastUseDate?: Date;
195
+ }
189
196
  export interface RoleView extends EntityViewModel {
190
197
  Code?: string;
191
198
  CreatedBy?: string;
@@ -226,6 +233,12 @@ export interface PresentationProfileAssignmentView extends EntityViewModel {
226
233
  UserAccountId?: number;
227
234
  UserAccountPseudo?: string;
228
235
  }
236
+ export interface ExternalLoginProviderViewModel {
237
+ ClientId?: string;
238
+ IosClientId?: string;
239
+ Provider?: string;
240
+ TenantId?: string;
241
+ }
229
242
  export interface DeviceTokenFilterViewModel extends EntityFilterViewModel<DeviceTokenView> {
230
243
  PushPlatform?: number;
231
244
  Token?: string;
@@ -287,6 +300,10 @@ export interface UserCredential {
287
300
  Permissions?: string[];
288
301
  PhoneNumber?: string;
289
302
  RefreshToken?: string;
303
+ TrustedDeviceToken?: string;
304
+ TwoFactorChallenge?: string;
305
+ TwoFactorRequired?: boolean;
306
+ TwoFactorSetupRequired?: boolean;
290
307
  Username?: string;
291
308
  }
292
309
  export interface UserAccountTokenFilterViewModel extends EntityFilterViewModel<UserAccountToken> {
@@ -313,12 +330,42 @@ export interface UserAccountFilterViewModel extends EntityFilterViewModel<UserAc
313
330
  export interface UnregisterDeviceTokenRequest {
314
331
  Token?: string;
315
332
  }
333
+ export interface UnlinkExternalViewModel {
334
+ Provider?: string;
335
+ }
336
+ export interface TwoFactorStatusViewModel {
337
+ Enabled?: boolean;
338
+ EnableDate?: Date;
339
+ RecoveryCodesLeft?: number;
340
+ Required?: boolean;
341
+ TrustedDevices?: TrustedDeviceViewModel[];
342
+ }
343
+ export interface TwoFactorSetupViewModel {
344
+ QrCode?: string;
345
+ Secret?: string;
346
+ Uri?: string;
347
+ }
348
+ export interface TwoFactorLoginViewModel {
349
+ Challenge?: string;
350
+ Code?: string;
351
+ RecoveryCode?: string;
352
+ TrustDevice?: boolean;
353
+ }
354
+ export interface TwoFactorCodeViewModel {
355
+ Code?: string;
356
+ Password?: string;
357
+ RecoveryCode?: string;
358
+ }
316
359
  export interface SendPushRequest {
317
360
  Body?: string;
318
361
  Data?: Dictionary<string>;
319
362
  Title?: string;
320
363
  UserAccountIds?: number[];
321
364
  }
365
+ export interface SendLoginLinkViewModel {
366
+ CaptchaToken?: string;
367
+ Email?: string;
368
+ }
322
369
  export interface RolePermissionFilterViewModel extends EntityFilterViewModel<RolePermission> {
323
370
  PermissionId?: number;
324
371
  RoleId?: number;
@@ -327,6 +374,9 @@ export interface RoleFilterViewModel extends EntityFilterViewModel<RoleView> {
327
374
  ExceptUserRoles?: boolean;
328
375
  UserAccountId?: number;
329
376
  }
377
+ export interface RevokeTrustedDeviceViewModel {
378
+ Id?: number;
379
+ }
330
380
  export interface ResetPasswordViewModel extends ActivationViewModel {
331
381
  Password?: string;
332
382
  }
@@ -341,6 +391,9 @@ export interface RegisterDeviceTokenRequest {
341
391
  PushPlatform?: number;
342
392
  Token?: string;
343
393
  }
394
+ export interface RecoveryCodesViewModel {
395
+ Codes?: string[];
396
+ }
344
397
  export interface PushSendSummary {
345
398
  HasFailed?: boolean;
346
399
  InvalidCount?: number;
@@ -354,9 +407,26 @@ export interface PresentationProfileAssignmentFilterViewModel extends EntityFilt
354
407
  UserAccountId?: number;
355
408
  }
356
409
  export interface LoginViewModel {
410
+ DeviceToken?: string;
357
411
  Password?: string;
358
412
  Username?: string;
359
413
  }
414
+ export interface LoginOptionsViewModel {
415
+ LoginLinkCaptcha?: boolean;
416
+ LoginLinkEnabled?: boolean;
417
+ Providers?: ExternalLoginProviderViewModel[];
418
+ }
419
+ export interface LoginLinkViewModel {
420
+ Code?: string;
421
+ DeviceToken?: string;
422
+ }
423
+ export interface LinkedLoginViewModel {
424
+ CreationDate?: Date;
425
+ DisplayName?: string;
426
+ LastLoginDate?: Date;
427
+ Provider?: string;
428
+ ProviderEmail?: string;
429
+ }
360
430
  export interface ExternalLoginViewModel {
361
431
  AuthorizationCode?: string;
362
432
  FirstName?: string;
@@ -365,10 +435,8 @@ export interface ExternalLoginViewModel {
365
435
  Provider?: string;
366
436
  RedirectUri?: string;
367
437
  }
368
- export interface ExternalLoginProviderViewModel {
369
- ClientId?: string;
370
- Provider?: string;
371
- TenantId?: string;
438
+ export interface DisableUserTwoFactorViewModel {
439
+ UserAccountId?: number;
372
440
  }
373
441
  export interface ChangePasswordViewModel {
374
442
  CurrentPassword?: string;
@@ -384,6 +452,10 @@ export declare enum ActivationResults {
384
452
  SentAgain = 4,
385
453
  UnknownUser = 5
386
454
  }
455
+ export declare enum TwoFactorMethods {
456
+ None = 0,
457
+ Authenticator = 1
458
+ }
387
459
  export declare enum PushPlatforms {
388
460
  Android = 0,
389
461
  Ios = 1,
@@ -393,4 +465,8 @@ export declare enum LoginProviders {
393
465
  Google = 0,
394
466
  Microsoft = 1,
395
467
  Apple = 2
468
+ }
469
+ export declare enum ChallengeTypes {
470
+ LoginLink = 0,
471
+ TwoFactorLogin = 1
396
472
  }
@@ -42,6 +42,7 @@ export declare class IdentityPermissions {
42
42
  static readonly IDENTITY_USERACCOUNT: string;
43
43
  static readonly IDENTITY_USERACCOUNT_ADD: string;
44
44
  static readonly IDENTITY_USERACCOUNT_DELETE: string;
45
+ static readonly IDENTITY_USERACCOUNT_DISABLETWOFACTOR: string;
45
46
  static readonly IDENTITY_USERACCOUNT_EDIT: string;
46
47
  static readonly IDENTITY_USERACCOUNT_EXPORT: string;
47
48
  static readonly IDENTITY_USERACCOUNT_VIEW: string;
@@ -1,26 +1,26 @@
1
1
  import * as i0 from "@angular/core";
2
- import { EventEmitter, InjectionToken, Injector, OnInit } from "@angular/core";
2
+ import { ElementRef, EventEmitter, InjectionToken, Injector, OnInit } from "@angular/core";
3
3
  import * as i2 from "@angular/router";
4
4
  import { ActivatedRoute, Router, Routes } from "@angular/router";
5
- import * as i27 from "@dflat-core/web/core-ux";
5
+ import * as i28 from "@dflat-core/web/core-ux";
6
6
  import { AlertService, ApplicationService, BaseComponent, BaseEditorComponent, BaseEntityEditor, EntitySection, EntitySectionProvider, EntitySelector, FacadeModalService, ValidationService } from "@dflat-core/web/core-ux";
7
- import * as i30 from "@dflat-core/web/identity-model";
8
- import { ActivationResults, ChangePasswordViewModel, DeviceTokenFilterViewModel, DeviceTokenView, PresentationProfileAssignmentFilterViewModel, PresentationProfileAssignmentView, RoleFilterViewModel, RolePermission, RolePermissionFilterViewModel, RoleView, UserAccount, UserAccountFilterViewModel, UserAccountLoginFilterViewModel, UserAccountLoginView, UserAccountRoleFilterViewModel, UserAccountRoleView, UserAccountToken, UserAccountTokenFilterViewModel, UserFavorite, UserFavoriteFilterViewModel, UserGroup, UserGroupDefinitionFilterViewModel, UserGroupDefinitionView, UserGroupFilterViewModel, UserHistory, UserHistoryFilterViewModel, UserPermissionView, UserPermissionViewFilterViewModel, UserProfileViewModel, UserSession, UserSessionFilterViewModel } from "@dflat-core/web/identity-model";
9
- import * as i31 from "@dflat-core/web/identity-data";
7
+ import * as i31 from "@dflat-core/web/identity-model";
8
+ import { ActivationResults, ChangePasswordViewModel, DeviceTokenFilterViewModel, DeviceTokenView, LinkedLoginViewModel, PresentationProfileAssignmentFilterViewModel, PresentationProfileAssignmentView, RoleFilterViewModel, RolePermission, RolePermissionFilterViewModel, RoleView, TrustedDeviceViewModel, TwoFactorSetupViewModel, TwoFactorStatusViewModel, UserAccount, UserAccountFilterViewModel, UserAccountLoginFilterViewModel, UserAccountLoginView, UserAccountRoleFilterViewModel, UserAccountRoleView, UserAccountToken, UserAccountTokenFilterViewModel, UserFavorite, UserFavoriteFilterViewModel, UserGroup, UserGroupDefinitionFilterViewModel, UserGroupDefinitionView, UserGroupFilterViewModel, UserHistory, UserHistoryFilterViewModel, UserPermissionView, UserPermissionViewFilterViewModel, UserProfileViewModel, UserSession, UserSessionFilterViewModel } from "@dflat-core/web/identity-model";
9
+ import * as i32 from "@dflat-core/web/identity-data";
10
10
  import { AccountDataService, UserAccountDataService, UserAccountRoleDataService, UserGroupDefinitionDataService } from "@dflat-core/web/identity-data";
11
- import { AuthService, UserService } from "@dflat-core/web/core-services";
12
- import * as i25 from "@angular/forms";
11
+ import { AuthService, ExternalLoginService, IExternalLoginResult, UserService } from "@dflat-core/web/core-services";
12
+ import * as i26 from "@angular/forms";
13
13
  import { NgForm, UntypedFormBuilder, UntypedFormGroup } from "@angular/forms";
14
- import * as i26 from "@dflat-core/web/core-model";
15
- import { EntityViewModelWithFields, FieldDescriptor, FilterDescriptor, PropertyEditorEvent, Section, TreeItem } from "@dflat-core/web/core-model";
14
+ import * as i27 from "@dflat-core/web/core-model";
15
+ import { EntityViewModelWithFields, FieldDescriptor, FilterDescriptor, IExternalLoginProvider, PropertyEditorEvent, Section, TreeItem } from "@dflat-core/web/core-model";
16
16
  import { MetaEntityDataService, PermissionDataService } from "@dflat-core/web/meta-data";
17
17
  import { Permission } from "@dflat-core/web/meta-model";
18
- import * as i24 from "@angular/common";
19
- import * as i28 from "@dflat-core/web/core-data";
20
- import * as i29 from "@dflat-core/web/meta-ux";
21
- import * as i32 from "@dflat-core/web/identity-root";
22
- import * as i33 from "@ng-select/ng-select";
23
- import * as i34 from "ng-recaptcha-2";
18
+ import * as i25 from "@angular/common";
19
+ import * as i29 from "@dflat-core/web/core-data";
20
+ import * as i30 from "@dflat-core/web/meta-ux";
21
+ import * as i33 from "@dflat-core/web/identity-root";
22
+ import * as i34 from "@ng-select/ng-select";
23
+ import * as i35 from "ng-recaptcha-2";
24
24
  /**
25
25
  * Recherche et édition des DeviceTokenView (partie générée) : titre, lien, clé d'entité et
26
26
  * permission. Composant spécifique : DeviceTokenComponent.
@@ -528,6 +528,83 @@ export declare class UserProfileComponent {
528
528
  static ɵfac: i0.ɵɵFactoryDeclaration<UserProfileComponent, never>;
529
529
  static ɵcmp: i0.ɵɵComponentDeclaration<UserProfileComponent, "msw-user-profile", never, {}, {}, never, never, false, never>;
530
530
  }
531
+ declare namespace account_security_component_d_exports {
532
+ export { AccountSecurityComponent };
533
+ }
534
+ /**
535
+ * Page « Sécurité » du compte connecté (route user/security, Connexion, B.5.9) : activation de la double
536
+ * authentification (QR code, premier code, codes de secours remis une fois), désactivation, renouvellement des
537
+ * codes de secours, appareils de confiance. Quand la politique impose la double authentification (?required),
538
+ * la page l'annonce et ne propose pas de la désactiver.
539
+ */
540
+ export declare class AccountSecurityComponent implements OnInit {
541
+ protected accountDataService: AccountDataService;
542
+ protected authService: AuthService;
543
+ protected route: ActivatedRoute;
544
+ protected router: Router;
545
+ protected externalLoginService: ExternalLoginService;
546
+ status: TwoFactorStatusViewModel;
547
+ setup: TwoFactorSetupViewModel;
548
+ /** Codes de secours à montrer une seule fois (activation ou renouvellement). */
549
+ recoveryCodes: string[];
550
+ /** L'activation est imposée par la politique. */
551
+ required: boolean;
552
+ loading: boolean;
553
+ code: string;
554
+ disablePassword: string;
555
+ showDisable: boolean;
556
+ showRegenerate: boolean;
557
+ message: string;
558
+ errorMessage: string;
559
+ /** Identités externes liées au compte (Connexion, B.5.10). */
560
+ linkedLogins: LinkedLoginViewModel[];
561
+ /** Fournisseurs configurés sur le serveur. */
562
+ providers: IExternalLoginProvider[];
563
+ /** Emplacement du bouton officiel de Google pour lier un compte Google. */
564
+ set googleLinkButton(element: ElementRef<HTMLElement>);
565
+ constructor(accountDataService: AccountDataService, authService: AuthService, route: ActivatedRoute, router: Router, externalLoginService: ExternalLoginService);
566
+ ngOnInit(): void;
567
+ /** Relit les identités externes liées au compte. */
568
+ loadLinkedLogins(): void;
569
+ /** Fournisseur configuré, ou undefined. */
570
+ getProvider(name: string): IExternalLoginProvider;
571
+ /** Le fournisseur est configuré et pas encore lié : son bouton « Lier » est proposé. */
572
+ canLink(name: string): boolean;
573
+ /** Application mobile : liaison Google native (Connexion, B.5.11). */
574
+ get isNativeApp(): boolean;
575
+ /** Lie un compte Google, dans l'application mobile. */
576
+ linkGoogleNative(): void;
577
+ /** Lie un compte Microsoft. */
578
+ linkMicrosoft(): void;
579
+ /** Lie un identifiant Apple. */
580
+ linkApple(): void;
581
+ /** Transmet le jeton du fournisseur au serveur, qui lie l'identité au compte connecté. */
582
+ protected link(result: IExternalLoginResult): void;
583
+ /** Délie une identité ; refusé par le serveur si c'est le dernier moyen de connexion. */
584
+ unlink(login: LinkedLoginViewModel): void;
585
+ /** Erreur chez le fournisseur ; une fenêtre fermée par l'utilisateur n'en est pas une. */
586
+ protected onExternalError(error: any): void;
587
+ /** Relit l'état de la double authentification. */
588
+ load(): void;
589
+ /** Commence l'activation : QR code et clé à saisir dans l'application d'authentification. */
590
+ beginSetup(): void;
591
+ /** Confirme l'activation par un premier code ; les codes de secours sont montrés une seule fois. */
592
+ confirmSetup(): void;
593
+ /** Désactive la double authentification, sur le mot de passe. */
594
+ disable(): void;
595
+ /** Remplace les codes de secours, sur un code de l'application. */
596
+ regenerate(): void;
597
+ /** Retire la confiance d'un appareil, ou de tous. */
598
+ revoke(device?: TrustedDeviceViewModel): void;
599
+ /** Télécharge les codes de secours dans un fichier texte. */
600
+ downloadRecoveryCodes(): void;
601
+ /** Codes notés : la page reprend son état normal ; si l'activation était imposée, l'application s'ouvre. */
602
+ acknowledgeRecoveryCodes(): void;
603
+ private clearMessages;
604
+ private readError;
605
+ static ɵfac: i0.ɵɵFactoryDeclaration<AccountSecurityComponent, never>;
606
+ static ɵcmp: i0.ɵɵComponentDeclaration<AccountSecurityComponent, "idy-account-security", never, {}, {}, never, never, false, never>;
607
+ }
531
608
  /** Ligne des tableaux de permissions d'un rôle : une entité et ses permissions. */
532
609
  export interface RolePermissionRow {
533
610
  /** Identifiant de la permission de l'entité, parente de celles de la ligne. */
@@ -750,7 +827,7 @@ declare namespace identity_ux_module_d_exports {
750
827
  export declare class IdentityUxModule {
751
828
  constructor(injector: Injector);
752
829
  static ɵfac: i0.ɵɵFactoryDeclaration<IdentityUxModule, never>;
753
- static ɵmod: i0.ɵɵNgModuleDeclaration<IdentityUxModule, [typeof DeviceTokenComponent, typeof PresentationProfileAssignmentComponent, typeof RoleComponent, typeof RolePermissionComponent, typeof UserAccountComponent, typeof UserAccountLoginComponent, typeof UserAccountRoleComponent, typeof UserAccountTokenComponent, typeof UserFavoriteComponent, typeof UserGroupComponent, typeof UserGroupDefinitionComponent, typeof UserHistoryComponent, typeof UserPermissionViewComponent, typeof UserSessionComponent, typeof ActivateComponent, typeof ResetPasswordComponent, typeof UserProfileComponent, typeof RoleEditorComponent, typeof UserRoleComponent, typeof UserPermissionComponent, typeof UserAccountEditorComponent, typeof UserProfileAccountComponent, typeof UserGroupEditorComponent], [typeof i24.CommonModule, typeof i25.FormsModule, typeof i25.ReactiveFormsModule, typeof i26.CoreModelModule, typeof i27.CoreUxModule, typeof i28.CoreDataModule, typeof i29.MetaUxModule, typeof i30.IdentityModelModule, typeof i31.IdentityDataModule, typeof i32.IdentityRootModule, typeof i33.NgSelectModule, typeof i34.RecaptchaModule, typeof i34.RecaptchaFormsModule], [typeof DeviceTokenComponent, typeof PresentationProfileAssignmentComponent, typeof RoleComponent, typeof RolePermissionComponent, typeof UserAccountComponent, typeof UserAccountLoginComponent, typeof UserAccountRoleComponent, typeof UserAccountTokenComponent, typeof UserFavoriteComponent, typeof UserGroupComponent, typeof UserGroupDefinitionComponent, typeof UserHistoryComponent, typeof UserPermissionViewComponent, typeof UserSessionComponent, typeof ActivateComponent, typeof ResetPasswordComponent, typeof UserProfileComponent, typeof RoleEditorComponent, typeof UserRoleComponent, typeof UserPermissionComponent, typeof UserAccountEditorComponent, typeof UserProfileAccountComponent, typeof UserGroupEditorComponent]>;
830
+ static ɵmod: i0.ɵɵNgModuleDeclaration<IdentityUxModule, [typeof DeviceTokenComponent, typeof PresentationProfileAssignmentComponent, typeof RoleComponent, typeof RolePermissionComponent, typeof UserAccountComponent, typeof UserAccountLoginComponent, typeof UserAccountRoleComponent, typeof UserAccountTokenComponent, typeof UserFavoriteComponent, typeof UserGroupComponent, typeof UserGroupDefinitionComponent, typeof UserHistoryComponent, typeof UserPermissionViewComponent, typeof UserSessionComponent, typeof ActivateComponent, typeof ResetPasswordComponent, typeof UserProfileComponent, typeof AccountSecurityComponent, typeof RoleEditorComponent, typeof UserRoleComponent, typeof UserPermissionComponent, typeof UserAccountEditorComponent, typeof UserProfileAccountComponent, typeof UserGroupEditorComponent], [typeof i25.CommonModule, typeof i26.FormsModule, typeof i26.ReactiveFormsModule, typeof i27.CoreModelModule, typeof i28.CoreUxModule, typeof i29.CoreDataModule, typeof i30.MetaUxModule, typeof i31.IdentityModelModule, typeof i32.IdentityDataModule, typeof i33.IdentityRootModule, typeof i34.NgSelectModule, typeof i35.RecaptchaModule, typeof i35.RecaptchaFormsModule], [typeof DeviceTokenComponent, typeof PresentationProfileAssignmentComponent, typeof RoleComponent, typeof RolePermissionComponent, typeof UserAccountComponent, typeof UserAccountLoginComponent, typeof UserAccountRoleComponent, typeof UserAccountTokenComponent, typeof UserFavoriteComponent, typeof UserGroupComponent, typeof UserGroupDefinitionComponent, typeof UserHistoryComponent, typeof UserPermissionViewComponent, typeof UserSessionComponent, typeof ActivateComponent, typeof ResetPasswordComponent, typeof UserProfileComponent, typeof AccountSecurityComponent, typeof RoleEditorComponent, typeof UserRoleComponent, typeof UserPermissionComponent, typeof UserAccountEditorComponent, typeof UserProfileAccountComponent, typeof UserGroupEditorComponent]>;
754
831
  static ɵinj: i0.ɵɵInjectorDeclaration<IdentityUxModule>;
755
832
  }
756
833
  /** Composants des entités du module Identity (composants spécifiques), à déclarer dans son module Angular. */