@newheap/platform-common 1.3.1 → 1.4.0

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.
@@ -33,6 +33,32 @@ class EndpointsAuthenticationNhCommonModuleConfig {
33
33
  this.impersonate = '/authentication/impersonate';
34
34
  this.revertImpersonate = '/authentication/ImpersonateRevert';
35
35
  this.accountInformation = '/account';
36
+ this.twoFactorVerify = '/authentication/two-factor/verify';
37
+ this.twoFactorStatus = '/account/two-factor';
38
+ this.twoFactorAuthenticator = '/account/two-factor/authenticator';
39
+ this.twoFactorAuthenticatorConfirm = '/account/two-factor/authenticator/confirm';
40
+ this.twoFactorRecoveryCodes = '/account/two-factor/recovery-codes';
41
+ this.twoFactorDisable = '/account/two-factor/disable';
42
+ this.twoFactorForgetDevices = '/account/two-factor/forget-devices';
43
+ this.twoFactorEmailSetup = '/account/two-factor/email';
44
+ this.twoFactorEmailConfirm = '/account/two-factor/email/confirm';
45
+ this.twoFactorEmail = '/authentication/two-factor/email';
46
+ this.twoFactorPasskeyOptions = '/authentication/two-factor/passkey/options';
47
+ this.twoFactorPasskey = '/authentication/two-factor/passkey';
48
+ this.twoFactorEnrollmentAuthenticator = '/authentication/two-factor/enrollment/authenticator';
49
+ this.twoFactorEnrollmentAuthenticatorConfirm = '/authentication/two-factor/enrollment/authenticator/confirm';
50
+ this.twoFactorEnrollmentEmail = '/authentication/two-factor/enrollment/email';
51
+ this.twoFactorEnrollmentEmailConfirm = '/authentication/two-factor/enrollment/email/confirm';
52
+ this.twoFactorEnrollmentPasskeyOptions = '/authentication/two-factor/enrollment/passkey/options';
53
+ this.twoFactorEnrollmentPasskey = '/authentication/two-factor/enrollment/passkey';
54
+ /** Administration route; `{userId}` is replaced with the user ID. */
55
+ this.twoFactorUserReset = '/authentication/two-factor/users/{userId}/reset';
56
+ this.twoFactorEnrollmentReminders = '/authentication/two-factor/operations/enrollment-reminders';
57
+ this.twoFactorSessionRevocation = '/authentication/two-factor/operations/session-revocation';
58
+ this.passkeySignInOptions = '/authentication/passkey/options';
59
+ this.passkeySignIn = '/authentication/passkey/login';
60
+ this.passkeys = '/account/passkeys';
61
+ this.passkeyRegistrationOptions = '/account/passkeys/options';
36
62
  Object.assign(this, init);
37
63
  }
38
64
  }
@@ -617,6 +643,174 @@ class RevertImpersonateAuthenticateModel {
617
643
  Object.assign(this, init);
618
644
  }
619
645
  }
646
+ /**
647
+ * Second-factor methods a user can present after the first factor succeeded.
648
+ */
649
+ const NhTwoFactorMethods = {
650
+ authenticator: 'authenticator',
651
+ recoveryCode: 'recovery-code',
652
+ email: 'email',
653
+ passkey: 'passkey'
654
+ };
655
+ /**
656
+ * Safe failure codes returned by the two-factor endpoints. Each error item uses the code as
657
+ * its name and `nh-two-factor.<suffix>` as its translation key.
658
+ */
659
+ var NhTwoFactorFailureCodes;
660
+ (function (NhTwoFactorFailureCodes) {
661
+ NhTwoFactorFailureCodes["Required"] = "two-factor-required";
662
+ NhTwoFactorFailureCodes["EnrollmentRequired"] = "two-factor-enrollment-required";
663
+ NhTwoFactorFailureCodes["InvalidCode"] = "two-factor-invalid-code";
664
+ NhTwoFactorFailureCodes["ChallengeExpired"] = "two-factor-challenge-expired";
665
+ NhTwoFactorFailureCodes["LockedOut"] = "two-factor-locked-out";
666
+ NhTwoFactorFailureCodes["MethodNotAllowed"] = "two-factor-method-not-allowed";
667
+ NhTwoFactorFailureCodes["NotEnabled"] = "two-factor-not-enabled";
668
+ NhTwoFactorFailureCodes["AlreadyEnabled"] = "two-factor-already-enabled";
669
+ NhTwoFactorFailureCodes["SetupNotStarted"] = "two-factor-setup-not-started";
670
+ NhTwoFactorFailureCodes["ReauthenticationRequired"] = "two-factor-reauthentication-required";
671
+ NhTwoFactorFailureCodes["ReauthenticationFailed"] = "two-factor-reauthentication-failed";
672
+ NhTwoFactorFailureCodes["RequiredByPolicy"] = "two-factor-required-by-policy";
673
+ NhTwoFactorFailureCodes["NotAllowedWhileImpersonating"] = "two-factor-not-allowed-while-impersonating";
674
+ NhTwoFactorFailureCodes["ConfigurationInvalid"] = "two-factor-configuration-invalid";
675
+ NhTwoFactorFailureCodes["EmailCooldown"] = "two-factor-email-cooldown";
676
+ NhTwoFactorFailureCodes["EmailUnavailable"] = "two-factor-email-unavailable";
677
+ NhTwoFactorFailureCodes["UserNotFound"] = "two-factor-user-not-found";
678
+ NhTwoFactorFailureCodes["PasskeyInvalid"] = "two-factor-passkey-invalid";
679
+ NhTwoFactorFailureCodes["PasskeyNotFound"] = "two-factor-passkey-not-found";
680
+ /** The browser does not support passkeys or the user cancelled the passkey prompt. */
681
+ NhTwoFactorFailureCodes["PasskeyUnavailable"] = "two-factor-passkey-unavailable";
682
+ })(NhTwoFactorFailureCodes || (NhTwoFactorFailureCodes = {}));
683
+ /**
684
+ * Status values of a pending authentication step.
685
+ */
686
+ const NhAuthenticationStepStatuses = {
687
+ twoFactorRequired: 'two-factor-required',
688
+ enrollmentRequired: 'enrollment-required'
689
+ };
690
+ /**
691
+ * A pending sign-in step. With status `two-factor-required` the user presents a second
692
+ * factor; with `enrollment-required` the policy requires the user to enroll one first, and
693
+ * `challengeToken` is the enrollment token.
694
+ */
695
+ class NhTwoFactorChallenge {
696
+ constructor(init) {
697
+ this.status = NhAuthenticationStepStatuses.twoFactorRequired;
698
+ this.challengeToken = '';
699
+ this.expiresAt = '';
700
+ this.methods = [];
701
+ /** Whether completing the challenge can remember this device for later sign-ins. */
702
+ this.rememberDeviceAvailable = false;
703
+ Object.assign(this, init);
704
+ }
705
+ }
706
+ /**
707
+ * Outcome of an interactive sign-in step: the stored authorization, a second-factor
708
+ * challenge or a required enrollment.
709
+ */
710
+ class NhAuthenticationStep {
711
+ constructor(init) {
712
+ this.status = 'authenticated';
713
+ Object.assign(this, init);
714
+ }
715
+ }
716
+ class NhTwoFactorVerifyModel {
717
+ constructor(init) {
718
+ this.challengeToken = '';
719
+ this.method = NhTwoFactorMethods.authenticator;
720
+ this.code = '';
721
+ Object.assign(this, init);
722
+ }
723
+ }
724
+ /**
725
+ * Proof that the signed-in user is present before a sensitive change: the current password
726
+ * or a valid second-factor code.
727
+ */
728
+ class NhTwoFactorReauthentication {
729
+ constructor(init) {
730
+ Object.assign(this, init);
731
+ }
732
+ }
733
+ class NhTwoFactorStatus {
734
+ constructor(init) {
735
+ this.enabled = false;
736
+ this.required = false;
737
+ this.methods = [];
738
+ this.availableMethods = [];
739
+ this.recoveryCodesLeft = 0;
740
+ this.authenticatorSetupPending = false;
741
+ this.emailSetupPending = false;
742
+ this.rememberDeviceAvailable = false;
743
+ this.passkeyCount = 0;
744
+ Object.assign(this, init);
745
+ }
746
+ }
747
+ /**
748
+ * Pending authenticator enrollment. `qrCodeDataUri` is a PNG data URI rendered by the server.
749
+ */
750
+ class NhAuthenticatorSetup {
751
+ constructor(init) {
752
+ this.sharedKey = '';
753
+ this.authenticatorUri = '';
754
+ Object.assign(this, init);
755
+ }
756
+ }
757
+ /**
758
+ * Result of a two-factor change. Recovery codes are returned once. When the change ended
759
+ * every session, the service has already stored the renewed session for this device.
760
+ */
761
+ class NhTwoFactorChange {
762
+ constructor(init) {
763
+ this.sessionRenewed = false;
764
+ Object.assign(this, init);
765
+ }
766
+ }
767
+ /**
768
+ * Confirmation that the server e-mailed a code.
769
+ */
770
+ class NhTwoFactorEmailCodeSent {
771
+ constructor(init) {
772
+ this.expiresAt = '';
773
+ /** When another code can be requested. */
774
+ this.resendAvailableAt = '';
775
+ Object.assign(this, init);
776
+ }
777
+ }
778
+ /**
779
+ * Result of an enrollment that the policy required during sign-in. The session is already
780
+ * stored; the recovery codes are returned once.
781
+ */
782
+ class NhTwoFactorEnrollmentResult {
783
+ constructor(init) {
784
+ Object.assign(this, init);
785
+ }
786
+ }
787
+ /**
788
+ * WebAuthn options from the server for one passkey ceremony. `options` is the JSON form of
789
+ * the creation or request options; `ceremonyToken` goes back with the credential.
790
+ */
791
+ class NhPasskeyOptions {
792
+ constructor(init) {
793
+ this.options = {};
794
+ this.ceremonyToken = '';
795
+ this.expiresAt = '';
796
+ Object.assign(this, init);
797
+ }
798
+ }
799
+ /**
800
+ * A registered passkey. The public key is never returned.
801
+ */
802
+ class NhPasskey {
803
+ constructor(init) {
804
+ /** Credential ID, base64url encoded. */
805
+ this.id = '';
806
+ this.name = '';
807
+ this.createdAt = '';
808
+ /** Whether a passkey provider, such as a password manager, syncs the passkey. */
809
+ this.isBackedUp = false;
810
+ this.transports = [];
811
+ Object.assign(this, init);
812
+ }
813
+ }
620
814
 
621
815
  class NhUserNotificationCollectionHttpRequestOptions extends CollectionHttpRequestOptions {
622
816
  constructor(init) {
@@ -2340,9 +2534,131 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.28", ngImpo
2340
2534
  args: [REQUEST_CONTEXT]
2341
2535
  }] }, { type: i1.CookieService }] });
2342
2536
 
2537
+ /**
2538
+ * Runs WebAuthn ceremonies in the browser. The server returns the options in their JSON form
2539
+ * and expects the credential in its JSON form; this client converts both, with a fallback for
2540
+ * browsers without `PublicKeyCredential.parseCreationOptionsFromJSON` and `toJSON()`.
2541
+ */
2542
+ class NhPasskeyClient {
2543
+ constructor() {
2544
+ this.platformId = inject(PLATFORM_ID);
2545
+ }
2546
+ /**
2547
+ * Whether the browser supports passkeys. Always false during server-side rendering.
2548
+ */
2549
+ isSupported() {
2550
+ return isPlatformBrowser(this.platformId)
2551
+ && typeof window !== 'undefined'
2552
+ && typeof window.PublicKeyCredential !== 'undefined'
2553
+ && !!navigator.credentials;
2554
+ }
2555
+ /**
2556
+ * Creates a passkey for WebAuthn creation options and returns the credential JSON.
2557
+ * Rejects when the user cancels the prompt or the browser refuses the request.
2558
+ */
2559
+ async create(options) {
2560
+ this.ensureSupported();
2561
+ const parse = PublicKeyCredential.parseCreationOptionsFromJSON;
2562
+ const publicKey = typeof parse === 'function'
2563
+ ? parse.call(PublicKeyCredential, options)
2564
+ : this.creationOptionsFromJSON(options);
2565
+ const credential = await navigator.credentials.create({ publicKey: publicKey });
2566
+ return this.credentialToJSON(this.requireCredential(credential));
2567
+ }
2568
+ /**
2569
+ * Signs WebAuthn request options with a passkey and returns the credential JSON.
2570
+ * Rejects when the user cancels the prompt or the browser refuses the request.
2571
+ */
2572
+ async get(options) {
2573
+ this.ensureSupported();
2574
+ const parse = PublicKeyCredential.parseRequestOptionsFromJSON;
2575
+ const publicKey = typeof parse === 'function'
2576
+ ? parse.call(PublicKeyCredential, options)
2577
+ : this.requestOptionsFromJSON(options);
2578
+ const credential = await navigator.credentials.get({ publicKey: publicKey });
2579
+ return this.credentialToJSON(this.requireCredential(credential));
2580
+ }
2581
+ ensureSupported() {
2582
+ if (!this.isSupported()) {
2583
+ throw new Error('Passkeys are not supported in this browser.');
2584
+ }
2585
+ }
2586
+ requireCredential(credential) {
2587
+ if (!credential || credential.type !== 'public-key') {
2588
+ throw new Error('No passkey was selected.');
2589
+ }
2590
+ return credential;
2591
+ }
2592
+ creationOptionsFromJSON(json) {
2593
+ return {
2594
+ ...json,
2595
+ challenge: NhPasskeyClient.fromBase64Url(json.challenge),
2596
+ user: { ...json.user, id: NhPasskeyClient.fromBase64Url(json.user.id) },
2597
+ excludeCredentials: (json.excludeCredentials ?? []).map((descriptor) => ({
2598
+ ...descriptor,
2599
+ id: NhPasskeyClient.fromBase64Url(descriptor.id)
2600
+ }))
2601
+ };
2602
+ }
2603
+ requestOptionsFromJSON(json) {
2604
+ return {
2605
+ ...json,
2606
+ challenge: NhPasskeyClient.fromBase64Url(json.challenge),
2607
+ allowCredentials: (json.allowCredentials ?? []).map((descriptor) => ({
2608
+ ...descriptor,
2609
+ id: NhPasskeyClient.fromBase64Url(descriptor.id)
2610
+ }))
2611
+ };
2612
+ }
2613
+ credentialToJSON(credential) {
2614
+ const toJSON = credential.toJSON;
2615
+ if (typeof toJSON === 'function') {
2616
+ return toJSON.call(credential);
2617
+ }
2618
+ const response = credential.response;
2619
+ const json = {
2620
+ id: credential.id,
2621
+ rawId: NhPasskeyClient.toBase64Url(credential.rawId),
2622
+ type: credential.type,
2623
+ authenticatorAttachment: credential.authenticatorAttachment ?? undefined,
2624
+ clientExtensionResults: credential.getClientExtensionResults?.() ?? {},
2625
+ response: {
2626
+ clientDataJSON: NhPasskeyClient.toBase64Url(response.clientDataJSON)
2627
+ }
2628
+ };
2629
+ if (response.attestationObject) {
2630
+ json.response.attestationObject = NhPasskeyClient.toBase64Url(response.attestationObject);
2631
+ json.response.transports = typeof response.getTransports === 'function' ? response.getTransports() : [];
2632
+ }
2633
+ if (response.authenticatorData) {
2634
+ json.response.authenticatorData = NhPasskeyClient.toBase64Url(response.authenticatorData);
2635
+ json.response.signature = NhPasskeyClient.toBase64Url(response.signature);
2636
+ json.response.userHandle = response.userHandle ? NhPasskeyClient.toBase64Url(response.userHandle) : null;
2637
+ }
2638
+ return json;
2639
+ }
2640
+ static fromBase64Url(value) {
2641
+ const bytes = Base64.toUint8Array(value);
2642
+ return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
2643
+ }
2644
+ static toBase64Url(buffer) {
2645
+ return Base64.fromUint8Array(new Uint8Array(buffer), true);
2646
+ }
2647
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.28", ngImport: i0, type: NhPasskeyClient, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2648
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.28", ngImport: i0, type: NhPasskeyClient, providedIn: 'root' }); }
2649
+ }
2650
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.28", ngImport: i0, type: NhPasskeyClient, decorators: [{
2651
+ type: Injectable,
2652
+ args: [{ providedIn: 'root' }]
2653
+ }] });
2654
+
2343
2655
  class BaseNhAuthService {
2656
+ static { this.pendingTwoFactorChallengeStorageKey = 'nh-two-factor-challenge'; }
2657
+ static { this.externalTwoFactorChallengePrefix = 'nh-two-factor='; }
2658
+ static { this.rememberDeviceStorageKey = 'nh-two-factor-device'; }
2344
2659
  constructor() {
2345
2660
  this.authorization = undefined;
2661
+ this.pendingTwoFactorChallenge = undefined;
2346
2662
  this.authSession = undefined;
2347
2663
  this.authSubject = new BehaviorSubject(this.getAuthorization());
2348
2664
  this._sessionExpirationInformation = new BehaviorSubject(this.getSessionExpirationInformation());
@@ -2352,6 +2668,7 @@ class BaseNhAuthService {
2352
2668
  this.httpClient = inject(HttpClient);
2353
2669
  this.platformId = inject(PLATFORM_ID);
2354
2670
  this.requestContext = inject(REQUEST_CONTEXT, { optional: true });
2671
+ this.passkeyClient = inject(NhPasskeyClient);
2355
2672
  this.authReady = new Promise(resolve => {
2356
2673
  this.onReady = resolve;
2357
2674
  });
@@ -2590,23 +2907,44 @@ class BaseNhAuthService {
2590
2907
  withCredentials: true
2591
2908
  }).taskResultLastValueFrom();
2592
2909
  }
2910
+ /**
2911
+ * Signs in with username and password and stores the complete session.
2912
+ *
2913
+ * When the server requires a second factor this method fails with
2914
+ * `NhTwoFactorFailureCodes.Required` and stores nothing. Use `authenticateInteractive`
2915
+ * to receive the challenge, or read it with `getPendingTwoFactorChallenge()`.
2916
+ */
2593
2917
  async authenticate(model, loginAsUser = false) {
2594
2918
  const result = new TaskResult();
2595
- let httpParams = new HttpParams();
2596
- if (httpParams.get('language') === null) {
2597
- httpParams = httpParams.set('language', this.moduleConfig.language);
2919
+ const stepResult = await this.authenticateInteractive(model);
2920
+ if (!stepResult.isSuccess) {
2921
+ stepResult.copyTo(result);
2922
+ return result;
2598
2923
  }
2924
+ if (stepResult.data?.status === 'two-factor-required') {
2925
+ return result.withError(NhTwoFactorFailureCodes.Required, 'nh-two-factor.required');
2926
+ }
2927
+ if (stepResult.data?.status === 'enrollment-required') {
2928
+ return result.withError(NhTwoFactorFailureCodes.EnrollmentRequired, 'nh-two-factor.enrollment-required');
2929
+ }
2930
+ result.data = stepResult.data?.authorization;
2931
+ return result;
2932
+ }
2933
+ /**
2934
+ * Signs in with username and password. Returns the stored authorization, the
2935
+ * second-factor challenge or the required enrollment. A pending step is never stored as
2936
+ * an authorization.
2937
+ */
2938
+ async authenticateInteractive(model) {
2939
+ const result = new TaskResult();
2599
2940
  model.realm = this.moduleConfig.authenticationRealm;
2941
+ model.rememberDeviceToken = model.rememberDeviceToken ?? this.getRememberDeviceToken();
2600
2942
  const request$ = this.httpClient.post(this.moduleConfig.authApiBaseUrl + this.moduleConfig.authentication.endpoints.login, model, {
2601
- params: httpParams,
2943
+ params: this.languageParams(),
2602
2944
  withCredentials: true
2603
2945
  });
2604
2946
  try {
2605
- result.data = await lastValueFrom(request$);
2606
- if (result.isSuccess) {
2607
- result.data.realm = this.moduleConfig.authenticationRealm;
2608
- }
2609
- this.setAuthorization(result.data);
2947
+ result.data = this.completeAuthenticationStep(await lastValueFrom(request$));
2610
2948
  }
2611
2949
  catch (ex) {
2612
2950
  if (this.isAuthenticated()) {
@@ -2617,6 +2955,523 @@ class BaseNhAuthService {
2617
2955
  }
2618
2956
  return result;
2619
2957
  }
2958
+ /**
2959
+ * Completes a second-factor challenge and stores the session.
2960
+ */
2961
+ async verifyTwoFactor(model) {
2962
+ const result = new TaskResult();
2963
+ const request$ = this.httpClient.post(this.moduleConfig.authApiBaseUrl + this.twoFactorEndpoints().twoFactorVerify, model, {
2964
+ params: this.languageParams(),
2965
+ withCredentials: true
2966
+ });
2967
+ try {
2968
+ result.data = this.completeAuthenticationStep(await lastValueFrom(request$)).authorization;
2969
+ }
2970
+ catch (ex) {
2971
+ this.pendingStepFailed(ex).copyTo(result);
2972
+ }
2973
+ return result;
2974
+ }
2975
+ /**
2976
+ * E-mails a sign-in code for the pending challenge when the user enrolled the e-mail factor.
2977
+ */
2978
+ sendTwoFactorEmailCode(challengeToken) {
2979
+ return this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(this.twoFactorEndpoints().twoFactorEmail), { challengeToken: challengeToken }, this.twoFactorStepRequestOptions()), response => new NhTwoFactorEmailCodeSent(response));
2980
+ }
2981
+ /**
2982
+ * Whether this browser can use passkeys.
2983
+ */
2984
+ isPasskeySupported() {
2985
+ return this.passkeyClient.isSupported();
2986
+ }
2987
+ /**
2988
+ * Completes the pending challenge with a passkey and stores the session.
2989
+ */
2990
+ async verifyTwoFactorWithPasskey(challengeToken, rememberDevice = false) {
2991
+ const result = new TaskResult();
2992
+ const endpoints = this.twoFactorEndpoints();
2993
+ const options = await this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(endpoints.twoFactorPasskeyOptions), { challengeToken: challengeToken }, this.twoFactorStepRequestOptions()), response => new NhPasskeyOptions(response));
2994
+ if (!options.isSuccess) {
2995
+ options.copyTo(result);
2996
+ return result;
2997
+ }
2998
+ const credential = await this.runPasskeyCeremony(() => this.passkeyClient.get(options.data.options));
2999
+ if (!credential.isSuccess) {
3000
+ credential.copyTo(result);
3001
+ return result;
3002
+ }
3003
+ const request$ = this.httpClient.post(this.twoFactorUrl(endpoints.twoFactorPasskey), {
3004
+ challengeToken: challengeToken,
3005
+ ceremonyToken: options.data.ceremonyToken,
3006
+ credential: credential.data,
3007
+ rememberDevice: rememberDevice
3008
+ }, this.twoFactorStepRequestOptions());
3009
+ try {
3010
+ result.data = this.completeAuthenticationStep(await lastValueFrom(request$)).authorization;
3011
+ }
3012
+ catch (ex) {
3013
+ this.pendingStepFailed(ex).copyTo(result);
3014
+ }
3015
+ return result;
3016
+ }
3017
+ /**
3018
+ * Signs in with a discoverable passkey, without a username or password. Returns the
3019
+ * stored authorization, or a pending step when the server's policy asks for more.
3020
+ */
3021
+ async signInWithPasskey() {
3022
+ const result = new TaskResult();
3023
+ const endpoints = this.twoFactorEndpoints();
3024
+ const options = await this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(endpoints.passkeySignInOptions), {}, this.twoFactorStepRequestOptions()), response => new NhPasskeyOptions(response));
3025
+ if (!options.isSuccess) {
3026
+ options.copyTo(result);
3027
+ return result;
3028
+ }
3029
+ const credential = await this.runPasskeyCeremony(() => this.passkeyClient.get(options.data.options));
3030
+ if (!credential.isSuccess) {
3031
+ credential.copyTo(result);
3032
+ return result;
3033
+ }
3034
+ const request$ = this.httpClient.post(this.twoFactorUrl(endpoints.passkeySignIn), {
3035
+ ceremonyToken: options.data.ceremonyToken,
3036
+ credential: credential.data,
3037
+ rememberDeviceToken: this.getRememberDeviceToken()
3038
+ }, this.twoFactorStepRequestOptions());
3039
+ try {
3040
+ result.data = this.completeAuthenticationStep(await lastValueFrom(request$));
3041
+ }
3042
+ catch (ex) {
3043
+ NhApiUtil.taskResultFromResponse(ex).copyTo(result);
3044
+ }
3045
+ return result;
3046
+ }
3047
+ /**
3048
+ * Starts authenticator enrollment for a user whom the policy requires to enroll during
3049
+ * sign-in. `enrollmentToken` is the `challengeToken` of the enrollment step.
3050
+ */
3051
+ beginEnrollmentAuthenticatorSetup(enrollmentToken) {
3052
+ return this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(this.twoFactorEndpoints().twoFactorEnrollmentAuthenticator), { enrollmentToken: enrollmentToken }, this.twoFactorStepRequestOptions()), response => new NhAuthenticatorSetup(response));
3053
+ }
3054
+ /**
3055
+ * Confirms the authenticator during a required enrollment and stores the session.
3056
+ */
3057
+ confirmEnrollmentAuthenticator(enrollmentToken, code) {
3058
+ return this.sendEnrollmentCompletion(this.twoFactorEndpoints().twoFactorEnrollmentAuthenticatorConfirm, { enrollmentToken: enrollmentToken, code: code });
3059
+ }
3060
+ /**
3061
+ * E-mails a confirmation code during a required enrollment.
3062
+ */
3063
+ sendEnrollmentEmailCode(enrollmentToken) {
3064
+ return this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(this.twoFactorEndpoints().twoFactorEnrollmentEmail), { enrollmentToken: enrollmentToken }, this.twoFactorStepRequestOptions()), response => new NhTwoFactorEmailCodeSent(response));
3065
+ }
3066
+ /**
3067
+ * Confirms the e-mail factor during a required enrollment and stores the session.
3068
+ */
3069
+ confirmEnrollmentEmail(enrollmentToken, code) {
3070
+ return this.sendEnrollmentCompletion(this.twoFactorEndpoints().twoFactorEnrollmentEmailConfirm, { enrollmentToken: enrollmentToken, code: code });
3071
+ }
3072
+ /**
3073
+ * Registers a passkey during a required enrollment and stores the session.
3074
+ */
3075
+ async enrollPasskey(enrollmentToken, name) {
3076
+ const result = new TaskResult();
3077
+ const endpoints = this.twoFactorEndpoints();
3078
+ const options = await this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(endpoints.twoFactorEnrollmentPasskeyOptions), { enrollmentToken: enrollmentToken }, this.twoFactorStepRequestOptions()), response => new NhPasskeyOptions(response));
3079
+ if (!options.isSuccess) {
3080
+ options.copyTo(result);
3081
+ return result;
3082
+ }
3083
+ const credential = await this.runPasskeyCeremony(() => this.passkeyClient.create(options.data.options));
3084
+ if (!credential.isSuccess) {
3085
+ credential.copyTo(result);
3086
+ return result;
3087
+ }
3088
+ return this.sendEnrollmentCompletion(endpoints.twoFactorEnrollmentPasskey, {
3089
+ enrollmentToken: enrollmentToken,
3090
+ ceremonyToken: options.data.ceremonyToken,
3091
+ credential: credential.data,
3092
+ name: name
3093
+ });
3094
+ }
3095
+ /**
3096
+ * Returns the pending second-factor challenge of this browser tab, if it has not expired.
3097
+ */
3098
+ getPendingTwoFactorChallenge() {
3099
+ const challenge = this.pendingTwoFactorChallenge ?? this.readStoredTwoFactorChallenge();
3100
+ if (!challenge) {
3101
+ return undefined;
3102
+ }
3103
+ if (challenge.expiresAt && DateTime.fromISO(challenge.expiresAt) <= DateTime.now()) {
3104
+ this.clearPendingTwoFactorChallenge();
3105
+ return undefined;
3106
+ }
3107
+ this.pendingTwoFactorChallenge = challenge;
3108
+ return challenge;
3109
+ }
3110
+ clearPendingTwoFactorChallenge() {
3111
+ this.pendingTwoFactorChallenge = undefined;
3112
+ if (isPlatformServer(this.platformId)) {
3113
+ return;
3114
+ }
3115
+ try {
3116
+ sessionStorage.removeItem(BaseNhAuthService.pendingTwoFactorChallengeStorageKey);
3117
+ }
3118
+ catch {
3119
+ // Storage can be unavailable in private browsing; the in-memory challenge is cleared.
3120
+ }
3121
+ }
3122
+ /**
3123
+ * Reads a challenge that an external sign-in (Microsoft OAuth) passed back in the URL
3124
+ * fragment, stores it as the pending challenge and removes it from the address bar.
3125
+ */
3126
+ consumeExternalTwoFactorChallenge(fragment) {
3127
+ const browser = !isPlatformServer(this.platformId);
3128
+ const source = fragment ?? (browser ? window.location.hash : '');
3129
+ const value = source.startsWith('#') ? source.substring(1) : source;
3130
+ if (!value.startsWith(BaseNhAuthService.externalTwoFactorChallengePrefix)) {
3131
+ return undefined;
3132
+ }
3133
+ let challenge;
3134
+ try {
3135
+ const payload = value.substring(BaseNhAuthService.externalTwoFactorChallengePrefix.length);
3136
+ challenge = new NhTwoFactorChallenge(JSON.parse(Base64.decode(payload)));
3137
+ }
3138
+ catch {
3139
+ return undefined;
3140
+ }
3141
+ if (!challenge.challengeToken) {
3142
+ return undefined;
3143
+ }
3144
+ this.setPendingTwoFactorChallenge(challenge);
3145
+ if (browser && fragment === undefined) {
3146
+ window.history.replaceState(window.history.state, '', window.location.pathname + window.location.search);
3147
+ }
3148
+ return challenge;
3149
+ }
3150
+ async getTwoFactorStatus() {
3151
+ const result = new TaskResult();
3152
+ const request$ = this.httpClient.get(this.moduleConfig.authApiBaseUrl + this.twoFactorEndpoints().twoFactorStatus, this.twoFactorAccountRequestOptions());
3153
+ try {
3154
+ result.data = new NhTwoFactorStatus(await lastValueFrom(request$));
3155
+ }
3156
+ catch (ex) {
3157
+ const errResult = NhApiUtil.taskResultFromResponse(ex);
3158
+ errResult.copyTo(result);
3159
+ }
3160
+ return result;
3161
+ }
3162
+ /**
3163
+ * Starts authenticator enrollment. Restarting enrollment while two-factor authentication
3164
+ * is enabled requires reauthentication.
3165
+ */
3166
+ async beginAuthenticatorSetup(reauthentication) {
3167
+ const result = new TaskResult();
3168
+ const request$ = this.httpClient.post(this.moduleConfig.authApiBaseUrl + this.twoFactorEndpoints().twoFactorAuthenticator, { reauthentication: reauthentication }, this.twoFactorAccountRequestOptions());
3169
+ try {
3170
+ result.data = new NhAuthenticatorSetup(await lastValueFrom(request$));
3171
+ }
3172
+ catch (ex) {
3173
+ const errResult = NhApiUtil.taskResultFromResponse(ex);
3174
+ errResult.copyTo(result);
3175
+ }
3176
+ return result;
3177
+ }
3178
+ /**
3179
+ * Confirms authenticator enrollment. The server ends every other session; the renewed
3180
+ * session for this device is stored before the promise resolves.
3181
+ */
3182
+ confirmAuthenticator(code) {
3183
+ return this.sendTwoFactorChange(this.twoFactorEndpoints().twoFactorAuthenticatorConfirm, { code: code });
3184
+ }
3185
+ regenerateRecoveryCodes(reauthentication) {
3186
+ return this.sendTwoFactorChange(this.twoFactorEndpoints().twoFactorRecoveryCodes, { reauthentication: reauthentication });
3187
+ }
3188
+ disableTwoFactor(reauthentication) {
3189
+ return this.sendTwoFactorChange(this.twoFactorEndpoints().twoFactorDisable, { reauthentication: reauthentication });
3190
+ }
3191
+ /**
3192
+ * E-mails a code that confirms the user's e-mail address as a second factor. Requires
3193
+ * reauthentication while two-factor authentication is enabled.
3194
+ */
3195
+ beginEmailSetup(reauthentication) {
3196
+ return this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(this.twoFactorEndpoints().twoFactorEmailSetup), { reauthentication: reauthentication }, this.twoFactorAccountRequestOptions()), response => new NhTwoFactorEmailCodeSent(response));
3197
+ }
3198
+ confirmEmailSetup(code) {
3199
+ return this.sendTwoFactorChange(this.twoFactorEndpoints().twoFactorEmailConfirm, { code: code });
3200
+ }
3201
+ /**
3202
+ * Forgets every remembered device, including this one, and ends every other session.
3203
+ */
3204
+ async forgetTwoFactorDevices(reauthentication) {
3205
+ const result = await this.sendTwoFactorChange(this.twoFactorEndpoints().twoFactorForgetDevices, { reauthentication: reauthentication });
3206
+ if (result.isSuccess) {
3207
+ this.storeRememberDeviceToken(undefined);
3208
+ }
3209
+ return result;
3210
+ }
3211
+ getPasskeys() {
3212
+ return this.sendTwoFactorRequest(this.httpClient.get(this.twoFactorUrl(this.twoFactorEndpoints().passkeys), this.twoFactorAccountRequestOptions()), response => (response ?? []).map(passkey => new NhPasskey(passkey)));
3213
+ }
3214
+ /**
3215
+ * Registers a passkey on this device. Adding a passkey while two-factor authentication is
3216
+ * enabled requires reauthentication. The server ends every other session; the renewed
3217
+ * session for this device is stored before the promise resolves.
3218
+ */
3219
+ async registerPasskey(name, reauthentication) {
3220
+ const result = new TaskResult();
3221
+ const endpoints = this.twoFactorEndpoints();
3222
+ const options = await this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(endpoints.passkeyRegistrationOptions), { reauthentication: reauthentication }, this.twoFactorAccountRequestOptions()), response => new NhPasskeyOptions(response));
3223
+ if (!options.isSuccess) {
3224
+ options.copyTo(result);
3225
+ return result;
3226
+ }
3227
+ const credential = await this.runPasskeyCeremony(() => this.passkeyClient.create(options.data.options));
3228
+ if (!credential.isSuccess) {
3229
+ credential.copyTo(result);
3230
+ return result;
3231
+ }
3232
+ return this.sendTwoFactorChange(endpoints.passkeys, {
3233
+ ceremonyToken: options.data.ceremonyToken,
3234
+ credential: credential.data,
3235
+ name: name
3236
+ });
3237
+ }
3238
+ renamePasskey(passkeyId, name) {
3239
+ return this.sendTwoFactorRequest(this.httpClient.put(this.twoFactorUrl(this.twoFactorEndpoints().passkeys) + '/' + encodeURIComponent(passkeyId), { name: name }, this.twoFactorAccountRequestOptions()), () => undefined);
3240
+ }
3241
+ /**
3242
+ * Removes a passkey. Removing the last second factor disables two-factor authentication,
3243
+ * which fails when the policy requires it.
3244
+ */
3245
+ removePasskey(passkeyId, reauthentication) {
3246
+ return this.sendTwoFactorChange(this.twoFactorEndpoints().passkeys + '/' + encodeURIComponent(passkeyId) + '/remove', { reauthentication: reauthentication });
3247
+ }
3248
+ /**
3249
+ * Removes every second factor of another user who lost access to them. Requires the
3250
+ * server's two-factor administration policy.
3251
+ */
3252
+ resetUserTwoFactor(userId) {
3253
+ const endpoint = this.twoFactorEndpoints().twoFactorUserReset.replace('{userId}', encodeURIComponent(userId));
3254
+ return this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(endpoint), {}, this.twoFactorAccountRequestOptions()), () => undefined);
3255
+ }
3256
+ /**
3257
+ * Starts a background operation that reminds every user whom the policy requires to
3258
+ * enroll. A repeated idempotency key returns the operation that was already started.
3259
+ */
3260
+ startTwoFactorEnrollmentReminders(idempotencyKey) {
3261
+ return this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(this.twoFactorEndpoints().twoFactorEnrollmentReminders), { idempotencyKey: idempotencyKey }, this.twoFactorAccountRequestOptions()), response => response);
3262
+ }
3263
+ /**
3264
+ * Starts a background operation that ends the sessions of every user whom the policy
3265
+ * requires to enroll, so their next sign-in enrolls them.
3266
+ */
3267
+ startTwoFactorSessionRevocation(idempotencyKey) {
3268
+ return this.sendTwoFactorRequest(this.httpClient.post(this.twoFactorUrl(this.twoFactorEndpoints().twoFactorSessionRevocation), { idempotencyKey: idempotencyKey }, this.twoFactorAccountRequestOptions()), response => response);
3269
+ }
3270
+ async sendTwoFactorChange(endpoint, body) {
3271
+ const result = new TaskResult();
3272
+ const request$ = this.httpClient.post(this.moduleConfig.authApiBaseUrl + endpoint, body, this.twoFactorAccountRequestOptions());
3273
+ try {
3274
+ const response = await lastValueFrom(request$);
3275
+ const sessionRenewed = this.applyRenewedSession(response?.session);
3276
+ result.data = new NhTwoFactorChange({
3277
+ recoveryCodes: response?.recoveryCodes ?? undefined,
3278
+ sessionRenewed: sessionRenewed
3279
+ });
3280
+ }
3281
+ catch (ex) {
3282
+ const errResult = NhApiUtil.taskResultFromResponse(ex);
3283
+ errResult.copyTo(result);
3284
+ }
3285
+ return result;
3286
+ }
3287
+ /**
3288
+ * Stores the session that the server issued for this device after a change that ended
3289
+ * every session. The user, claims and divisions of the current authorization are kept.
3290
+ */
3291
+ applyRenewedSession(session) {
3292
+ const authorization = this.getAuthorization();
3293
+ if (!session?.token || !authorization) {
3294
+ return false;
3295
+ }
3296
+ authorization.token = session.token;
3297
+ authorization.validTo = session.validTo ?? authorization.validTo;
3298
+ authorization.refreshToken = session.refreshToken ?? undefined;
3299
+ authorization.refreshTokenExpires = session.refreshValidTo ?? undefined;
3300
+ this.setAuthorization(authorization);
3301
+ return true;
3302
+ }
3303
+ toAuthorization(response) {
3304
+ const authorization = response;
3305
+ delete authorization.twoFactor;
3306
+ delete authorization.rememberDeviceToken;
3307
+ authorization.realm = this.moduleConfig.authenticationRealm;
3308
+ return authorization;
3309
+ }
3310
+ /**
3311
+ * Stores a complete session, or keeps a second-factor challenge or enrollment as the
3312
+ * pending step of this browser tab.
3313
+ */
3314
+ completeAuthenticationStep(response) {
3315
+ if (response?.twoFactor) {
3316
+ const challenge = new NhTwoFactorChallenge(response.twoFactor);
3317
+ this.setPendingTwoFactorChallenge(challenge);
3318
+ return new NhAuthenticationStep({
3319
+ status: challenge.status === NhAuthenticationStepStatuses.enrollmentRequired ? 'enrollment-required' : 'two-factor-required',
3320
+ challenge: challenge
3321
+ });
3322
+ }
3323
+ if (response?.rememberDeviceToken) {
3324
+ this.storeRememberDeviceToken(response.rememberDeviceToken);
3325
+ }
3326
+ const authorization = this.toAuthorization(response);
3327
+ this.setAuthorization(authorization);
3328
+ this.clearPendingTwoFactorChallenge();
3329
+ return new NhAuthenticationStep({ status: 'authenticated', authorization: authorization });
3330
+ }
3331
+ /**
3332
+ * Converts a failed challenge or enrollment request and forgets the pending step when the
3333
+ * server ended it.
3334
+ */
3335
+ pendingStepFailed(ex) {
3336
+ const errResult = NhApiUtil.taskResultFromResponse(ex);
3337
+ const stepEnded = errResult.items.some(item => item.name === NhTwoFactorFailureCodes.ChallengeExpired || item.name === NhTwoFactorFailureCodes.LockedOut);
3338
+ if (stepEnded) {
3339
+ this.clearPendingTwoFactorChallenge();
3340
+ }
3341
+ return errResult;
3342
+ }
3343
+ async sendEnrollmentCompletion(endpoint, body) {
3344
+ const result = new TaskResult();
3345
+ const request$ = this.httpClient.post(this.twoFactorUrl(endpoint), body, this.twoFactorStepRequestOptions());
3346
+ try {
3347
+ const response = await lastValueFrom(request$);
3348
+ const authorization = response?.session ? this.completeAuthenticationStep(response.session).authorization : undefined;
3349
+ result.data = new NhTwoFactorEnrollmentResult({
3350
+ authorization: authorization,
3351
+ recoveryCodes: response?.recoveryCodes ?? undefined
3352
+ });
3353
+ }
3354
+ catch (ex) {
3355
+ this.pendingStepFailed(ex).copyTo(result);
3356
+ }
3357
+ return result;
3358
+ }
3359
+ async sendTwoFactorRequest(request$, map) {
3360
+ const result = new TaskResult();
3361
+ try {
3362
+ result.data = map(await lastValueFrom(request$, { defaultValue: undefined }));
3363
+ }
3364
+ catch (ex) {
3365
+ NhApiUtil.taskResultFromResponse(ex).copyTo(result);
3366
+ }
3367
+ return result;
3368
+ }
3369
+ /**
3370
+ * Runs a WebAuthn prompt. A cancelled prompt or an unsupported browser becomes a failed
3371
+ * result with `NhTwoFactorFailureCodes.PasskeyUnavailable`.
3372
+ */
3373
+ async runPasskeyCeremony(ceremony) {
3374
+ const result = new TaskResult();
3375
+ try {
3376
+ result.data = await ceremony();
3377
+ }
3378
+ catch {
3379
+ return result.withError(NhTwoFactorFailureCodes.PasskeyUnavailable, 'nh-two-factor.passkey-unavailable');
3380
+ }
3381
+ return result;
3382
+ }
3383
+ /**
3384
+ * Returns the remember-device token of header clients. Cookie clients receive it as an
3385
+ * HttpOnly cookie, so nothing is stored in the browser.
3386
+ */
3387
+ getRememberDeviceToken() {
3388
+ if (this.moduleConfig.authType !== 'header' || isPlatformServer(this.platformId)) {
3389
+ return undefined;
3390
+ }
3391
+ try {
3392
+ return localStorage.getItem(this.rememberDeviceStorageKey()) ?? undefined;
3393
+ }
3394
+ catch {
3395
+ return undefined;
3396
+ }
3397
+ }
3398
+ storeRememberDeviceToken(token) {
3399
+ if (this.moduleConfig.authType !== 'header' || isPlatformServer(this.platformId)) {
3400
+ return;
3401
+ }
3402
+ try {
3403
+ if (token) {
3404
+ localStorage.setItem(this.rememberDeviceStorageKey(), token);
3405
+ }
3406
+ else {
3407
+ localStorage.removeItem(this.rememberDeviceStorageKey());
3408
+ }
3409
+ }
3410
+ catch {
3411
+ // Storage can be unavailable in private browsing; the device is then not remembered.
3412
+ }
3413
+ }
3414
+ rememberDeviceStorageKey() {
3415
+ return BaseNhAuthService.rememberDeviceStorageKey + ':' + this.moduleConfig.authenticationRealm;
3416
+ }
3417
+ setPendingTwoFactorChallenge(challenge) {
3418
+ this.pendingTwoFactorChallenge = challenge;
3419
+ if (isPlatformServer(this.platformId)) {
3420
+ return;
3421
+ }
3422
+ try {
3423
+ sessionStorage.setItem(BaseNhAuthService.pendingTwoFactorChallengeStorageKey, JSON.stringify(challenge));
3424
+ }
3425
+ catch {
3426
+ // Storage can be unavailable in private browsing; the in-memory challenge still works.
3427
+ }
3428
+ }
3429
+ readStoredTwoFactorChallenge() {
3430
+ if (isPlatformServer(this.platformId)) {
3431
+ return undefined;
3432
+ }
3433
+ try {
3434
+ const stored = sessionStorage.getItem(BaseNhAuthService.pendingTwoFactorChallengeStorageKey);
3435
+ if (!stored) {
3436
+ return undefined;
3437
+ }
3438
+ return new NhTwoFactorChallenge(JSON.parse(stored));
3439
+ }
3440
+ catch {
3441
+ return undefined;
3442
+ }
3443
+ }
3444
+ twoFactorEndpoints() {
3445
+ // Consumers that passed a plain endpoints object keep working with the default routes.
3446
+ return new EndpointsAuthenticationNhCommonModuleConfig({
3447
+ ...new EndpointsAuthenticationNhCommonModuleConfig(),
3448
+ ...this.moduleConfig.authentication.endpoints
3449
+ });
3450
+ }
3451
+ twoFactorUrl(endpoint) {
3452
+ return this.moduleConfig.authApiBaseUrl + endpoint;
3453
+ }
3454
+ twoFactorStepRequestOptions() {
3455
+ return {
3456
+ params: this.languageParams(),
3457
+ withCredentials: true
3458
+ };
3459
+ }
3460
+ twoFactorAccountRequestOptions() {
3461
+ let headers = new HttpHeaders();
3462
+ const authorization = this.getAuthorization();
3463
+ if (this.moduleConfig.authType === 'header' && authorization?.token) {
3464
+ headers = headers.set('Authorization', `Bearer ${authorization.token}`);
3465
+ }
3466
+ return {
3467
+ params: this.languageParams(),
3468
+ headers: headers,
3469
+ withCredentials: true
3470
+ };
3471
+ }
3472
+ languageParams() {
3473
+ return new HttpParams().set('language', this.moduleConfig.language);
3474
+ }
2620
3475
  async reloadAuthorizationProfile() {
2621
3476
  const result = new TaskResult();
2622
3477
  const auth = this.getAuthorization();
@@ -8769,5 +9624,5 @@ function nhTranslateBrowserLoaderFactory(httpClient, transferState) {
8769
9624
  * Generated bundle index. Do not edit.
8770
9625
  */
8771
9626
 
8772
- export { AbstractValueAccessor, AspMvcFormServerSideFormValidator, AuthSessionExpirationInformation, AuthenticateModel, AuthenticationNhCommonModuleConfig, AuthenticationSessionCreateResponse, BackgroundOperationsNhCommonModuleConfig, BaseNhAuthService, CheckAuthenticateSessionModel, Claim, ClaimAuthenticateSessionAccountMutateModel, ClaimAuthenticateSessionAccountViewModel, ClaimTypes, CollectionHttpRequestOptions, CollectionHttpResponse, DefaultMultiSelectSettings, DefaultMultiSelectTexts, EndpointsAuthenticationNhCommonModuleConfig, FilterRequestOptions, FormError, FormValidationResult, HttpDownloadRequestOptions, HttpRequestOptions, HttpRequestOptionsArrayBuffer, HttpRequestOptionsText, ImpersonateAuthenticateModel, IsAllPermissionsGrantedPipe, IsAuthenticatedPipe, IsClaimGrantedPipe, IsDefined, IsGrantedRolePipe, IsOneActiveDivisionPermissionGrantedGuard, IsOneActiveDivisionPermissionGrantedPipe, IsOneActiveDivisionRoleGrantedGuard, IsOneActiveDivisionRoleGrantedPipe, IsOneClaimGrantedPipe, IsOneDivisionPermissionGrantedPipe, IsOneDivisionRoleGrantedPipe, IsOnePermissionGrantedPipe, IsOneRoleGrantedPipe, JsonLdDataChanged, ListSortDirection, MakeProvider, MutationType, NH_ERROR_HANDLERS, NH_ROUTER_LANGUAGE_CHANGE_METHOD, NH_ROUTER_ROOT_ROUTES, NhAccountInformationResponse, NhAngularUtil, NhApiService, NhApiUtil, NhAppService, NhAsyncLock, NhAuthService, NhAuthorization, NhBackgroundOperationAdministrationCollectionHttpRequestOptions, NhBackgroundOperationAdministrationService, NhBackgroundOperationCollectionHttpRequestOptions, NhBackgroundOperationLiveUpdateService, NhBackgroundOperationProgressComponent, NhBackgroundOperationService, NhBackgroundOperationStore, NhBaseApiService, NhBooleanToStringPipe, NhBreadCrumb, NhBreadCrumbItem, NhButtonDebounceDirective, NhCanCancelNavigationGuard, NhCollectionBaseComponent, NhCollectionTypeBaseComponent, NhCommonConfig, NhCommonConfigChanged, NhCommonModule, NhCommonModuleConfig, NhConfigCommonService, NhContextMenu, NhContextMenuItem, NhContextMenuService, NhContextMenuServiceConfig, NhCookieService, NhDatePipe, NhDateTimePipe, NhDateUtcPipe, NhDebounceDirective, NhDeduplicateGetRequestsInterceptor, NhDivision, NhDivisionRole, NhDivisionUser, NhEncodeHttpParamsInterceptor, NhEncodingUtil, NhErrorComponent, NhErrorHandlerService, NhFormDropDownComponent, NhFormDropDownNhCommonModuleConfig, NhFormDropDownSettings, NhFormErrorMessageComponent, NhFormHelper, NhHeadService, NhHttpNhCommonModuleConfig, NhHttpUtil, NhInternetConnectionService, NhIsAllPermissionsGrantedGuard, NhIsAuthenticatedGuard, NhIsOneClaimGrantedGuard, NhIsOnePermissionGrantedGuard, NhIsOneRoleGrantedGuard, NhJsonLdComponent, NhJsonLdData, NhJsonLdDataItem, NhJsonLdService, NhLoaderComponent, NhMetaService, NhModalComponent, NhModalComponentClosed, NhModalComponentImpl, NhModalComponentRef, NhModalConfirmComponent, NhModalContentDirective, NhModalLoadingComponent, NhModalMutateBaseComponent, NhModalMutateBaseTypeComponent, NhModalOptions, NhModalService, NhMutateBaseComponent, NhMutateBaseTypeComponent, NhMutex, NhPageBaseComponent, NhPageService, NhPageSettings, NhPageSizeComponent, NhPageTypeBaseComponent, NhRegisterRoute, NhRequestScopedServerHttpInterceptorService, NhRoute, NhRouteInfo, NhRouteNavigationItem, NhRouterLinkDirective, NhRouterService, NhRouterSetupService, NhSearchInputComponent, NhServerHttpInterceptor, NhServerService, NhServerSideFormValidationService, NhSitemap, NhSitemapEntry, NhSitemapEntryItem, NhStringUtil, NhTaskResultFormValidationService, NhTitleService, NhToHeadDirective, NhTranslateBrowserLoader, NhTranslationNhCommonModuleConfig, NhTypedPageBaseComponent, NhTypedPageTypeBaseComponent, NhUrlEncodePipe, NhUser, NhUserNotification, NhUserNotificationCollectionHttpRequestOptions, NhUserNotificationData, NhUserNotificationMessage, NhUserNotificationOverview, NhUserNotificationService, NhUserNotificationState, NhUserNotificationsAbstractComponent, OrderByRequestOptions, PreConnectUrlItem, PreLoadUrlItem, REVIEW_AGGREGATE_RATING_KEY, REVIEW_KEY, RefreshTokenLoginAccountMutateModel, RevertImpersonateAuthenticateModel, SafeHtmlPipe, SafeResourceUrlPipe, SafeUrlPipe, SearchableCollectionHttpRequestOptions, SimpleCollectionHttpRequestOptions, SimpleCollectionHttpResponse, TaskResult, TaskResultItem, TypedNhPageSettings, UserNotificationNhCommonModuleConfig, enumIntValuesToArray, enumKeysToArray, enumStringValuesToArray, enumValuesToArray, getEmptyGuid, getRandomIdentifier, groupBy, languageToCultureMap, nameof, nhBackgroundOperationStatusName, nhBackgroundOperationStepStatusName, nhBackgroundOperationTranslationSegment, nhTranslateBrowserLoaderFactory, nhUserNotificationSeverityName, uppercaseFirst };
9627
+ export { AbstractValueAccessor, AspMvcFormServerSideFormValidator, AuthSessionExpirationInformation, AuthenticateModel, AuthenticationNhCommonModuleConfig, AuthenticationSessionCreateResponse, BackgroundOperationsNhCommonModuleConfig, BaseNhAuthService, CheckAuthenticateSessionModel, Claim, ClaimAuthenticateSessionAccountMutateModel, ClaimAuthenticateSessionAccountViewModel, ClaimTypes, CollectionHttpRequestOptions, CollectionHttpResponse, DefaultMultiSelectSettings, DefaultMultiSelectTexts, EndpointsAuthenticationNhCommonModuleConfig, FilterRequestOptions, FormError, FormValidationResult, HttpDownloadRequestOptions, HttpRequestOptions, HttpRequestOptionsArrayBuffer, HttpRequestOptionsText, ImpersonateAuthenticateModel, IsAllPermissionsGrantedPipe, IsAuthenticatedPipe, IsClaimGrantedPipe, IsDefined, IsGrantedRolePipe, IsOneActiveDivisionPermissionGrantedGuard, IsOneActiveDivisionPermissionGrantedPipe, IsOneActiveDivisionRoleGrantedGuard, IsOneActiveDivisionRoleGrantedPipe, IsOneClaimGrantedPipe, IsOneDivisionPermissionGrantedPipe, IsOneDivisionRoleGrantedPipe, IsOnePermissionGrantedPipe, IsOneRoleGrantedPipe, JsonLdDataChanged, ListSortDirection, MakeProvider, MutationType, NH_ERROR_HANDLERS, NH_ROUTER_LANGUAGE_CHANGE_METHOD, NH_ROUTER_ROOT_ROUTES, NhAccountInformationResponse, NhAngularUtil, NhApiService, NhApiUtil, NhAppService, NhAsyncLock, NhAuthService, NhAuthenticationStep, NhAuthenticationStepStatuses, NhAuthenticatorSetup, NhAuthorization, NhBackgroundOperationAdministrationCollectionHttpRequestOptions, NhBackgroundOperationAdministrationService, NhBackgroundOperationCollectionHttpRequestOptions, NhBackgroundOperationLiveUpdateService, NhBackgroundOperationProgressComponent, NhBackgroundOperationService, NhBackgroundOperationStore, NhBaseApiService, NhBooleanToStringPipe, NhBreadCrumb, NhBreadCrumbItem, NhButtonDebounceDirective, NhCanCancelNavigationGuard, NhCollectionBaseComponent, NhCollectionTypeBaseComponent, NhCommonConfig, NhCommonConfigChanged, NhCommonModule, NhCommonModuleConfig, NhConfigCommonService, NhContextMenu, NhContextMenuItem, NhContextMenuService, NhContextMenuServiceConfig, NhCookieService, NhDatePipe, NhDateTimePipe, NhDateUtcPipe, NhDebounceDirective, NhDeduplicateGetRequestsInterceptor, NhDivision, NhDivisionRole, NhDivisionUser, NhEncodeHttpParamsInterceptor, NhEncodingUtil, NhErrorComponent, NhErrorHandlerService, NhFormDropDownComponent, NhFormDropDownNhCommonModuleConfig, NhFormDropDownSettings, NhFormErrorMessageComponent, NhFormHelper, NhHeadService, NhHttpNhCommonModuleConfig, NhHttpUtil, NhInternetConnectionService, NhIsAllPermissionsGrantedGuard, NhIsAuthenticatedGuard, NhIsOneClaimGrantedGuard, NhIsOnePermissionGrantedGuard, NhIsOneRoleGrantedGuard, NhJsonLdComponent, NhJsonLdData, NhJsonLdDataItem, NhJsonLdService, NhLoaderComponent, NhMetaService, NhModalComponent, NhModalComponentClosed, NhModalComponentImpl, NhModalComponentRef, NhModalConfirmComponent, NhModalContentDirective, NhModalLoadingComponent, NhModalMutateBaseComponent, NhModalMutateBaseTypeComponent, NhModalOptions, NhModalService, NhMutateBaseComponent, NhMutateBaseTypeComponent, NhMutex, NhPageBaseComponent, NhPageService, NhPageSettings, NhPageSizeComponent, NhPageTypeBaseComponent, NhPasskey, NhPasskeyClient, NhPasskeyOptions, NhRegisterRoute, NhRequestScopedServerHttpInterceptorService, NhRoute, NhRouteInfo, NhRouteNavigationItem, NhRouterLinkDirective, NhRouterService, NhRouterSetupService, NhSearchInputComponent, NhServerHttpInterceptor, NhServerService, NhServerSideFormValidationService, NhSitemap, NhSitemapEntry, NhSitemapEntryItem, NhStringUtil, NhTaskResultFormValidationService, NhTitleService, NhToHeadDirective, NhTranslateBrowserLoader, NhTranslationNhCommonModuleConfig, NhTwoFactorChallenge, NhTwoFactorChange, NhTwoFactorEmailCodeSent, NhTwoFactorEnrollmentResult, NhTwoFactorFailureCodes, NhTwoFactorMethods, NhTwoFactorReauthentication, NhTwoFactorStatus, NhTwoFactorVerifyModel, NhTypedPageBaseComponent, NhTypedPageTypeBaseComponent, NhUrlEncodePipe, NhUser, NhUserNotification, NhUserNotificationCollectionHttpRequestOptions, NhUserNotificationData, NhUserNotificationMessage, NhUserNotificationOverview, NhUserNotificationService, NhUserNotificationState, NhUserNotificationsAbstractComponent, OrderByRequestOptions, PreConnectUrlItem, PreLoadUrlItem, REVIEW_AGGREGATE_RATING_KEY, REVIEW_KEY, RefreshTokenLoginAccountMutateModel, RevertImpersonateAuthenticateModel, SafeHtmlPipe, SafeResourceUrlPipe, SafeUrlPipe, SearchableCollectionHttpRequestOptions, SimpleCollectionHttpRequestOptions, SimpleCollectionHttpResponse, TaskResult, TaskResultItem, TypedNhPageSettings, UserNotificationNhCommonModuleConfig, enumIntValuesToArray, enumKeysToArray, enumStringValuesToArray, enumValuesToArray, getEmptyGuid, getRandomIdentifier, groupBy, languageToCultureMap, nameof, nhBackgroundOperationStatusName, nhBackgroundOperationStepStatusName, nhBackgroundOperationTranslationSegment, nhTranslateBrowserLoaderFactory, nhUserNotificationSeverityName, uppercaseFirst };
8773
9628
  //# sourceMappingURL=newheap-platform-common.mjs.map