@@ -544,6 +544,48 @@ declare namespace admin.auth {
544
544
toJSON ( ) : Object ;
545
545
}
546
546
547
+ /**
548
+ * Interface representing the common properties of a user enrolled second factor.
549
+ */
550
+ interface MultiFactorInfo {
551
+
552
+ /**
553
+ * The ID of the enrolled second factor. This ID is unique to the user.
554
+ */
555
+ uid : string ;
556
+
557
+ /**
558
+ * The optional display name of the enrolled second factor.
559
+ */
560
+ displayName ?: string ;
561
+
562
+ /**
563
+ * The optional date the second factor was enrolled, formatted as a UTC string.
564
+ */
565
+ enrollmentTime ?: string ;
566
+
567
+ /**
568
+ * The type identifier of the second factor. For SMS second factors, this is `phone`.
569
+ */
570
+ factorId : string ;
571
+
572
+ /**
573
+ * @return A JSON-serializable representation of this object.
574
+ */
575
+ toJSON ( ) : Object ;
576
+ }
577
+
578
+ /**
579
+ * Interface representing a phone specific user enrolled second factor.
580
+ */
581
+ interface PhoneMultiFactorInfo extends MultiFactorInfo {
582
+
583
+ /**
584
+ * The phone number associated with a phone second factor.
585
+ */
586
+ phoneNumber : string ;
587
+ }
588
+
547
589
/**
548
590
* Interface representing a user.
549
591
*/
@@ -639,14 +681,21 @@ declare namespace admin.auth {
639
681
*/
640
682
tenantId ?: string | null ;
641
683
684
+ /**
685
+ * The multi-factor related properties for the current user, if available.
686
+ */
642
687
multiFactor ?: {
643
- enrolledFactors : Array < {
644
- uid : string ;
645
- phoneNumber : string ;
646
- displayName ?: string ;
647
- enrollmentTime ?: string ;
648
- factorId : string ;
649
- } > ;
688
+
689
+ /**
690
+ * List of second factors enrolled with the current user.
691
+ * Currently only phone second factors are supported.
692
+ */
693
+ enrolledFactors : PhoneMultiFactorInfo [ ] ;
694
+
695
+ /**
696
+ * @return A JSON-serializable representation of this multi-factor object.
697
+ */
698
+ toJSON ( ) : Object ;
650
699
} ;
651
700
652
701
/**
@@ -655,6 +704,46 @@ declare namespace admin.auth {
655
704
toJSON ( ) : Object ;
656
705
}
657
706
707
+ /**
708
+ * Interface representing common properties of a user enrolled second factor
709
+ * for an `UpdateRequest`.
710
+ */
711
+ interface UpdateMultiFactorInfoRequest {
712
+
713
+ /**
714
+ * The ID of the enrolled second factor. This ID is unique to the user. When not provided,
715
+ * a new one is provisioned by the Auth server.
716
+ */
717
+ uid ?: string ;
718
+
719
+ /**
720
+ * The optional display name for an enrolled second factor.
721
+ */
722
+ displayName ?: string ;
723
+
724
+ /**
725
+ * The optional date the second factor was enrolled, formatted as a UTC string.
726
+ */
727
+ enrollmentTime ?: string ;
728
+
729
+ /**
730
+ * The type identifier of the second factor. For SMS second factors, this is `phone`.
731
+ */
732
+ factorId : string ;
733
+ }
734
+
735
+ /**
736
+ * Interface representing a phone specific user enrolled second factor
737
+ * for an `UpdateRequest`.
738
+ */
739
+ interface UpdatePhoneMultiFactorInfoRequest extends UpdateMultiFactorInfoRequest {
740
+
741
+ /**
742
+ * The phone number associated with a phone second factor.
743
+ */
744
+ phoneNumber : string ;
745
+ }
746
+
658
747
/**
659
748
* Interface representing the properties to update on the provided user.
660
749
*/
@@ -696,17 +785,49 @@ declare namespace admin.auth {
696
785
*/
697
786
photoURL ?: string | null ;
698
787
788
+ /**
789
+ * The user's updated multi-factor related properties.
790
+ */
699
791
multiFactor ?: {
700
- enrolledFactors : Array < {
701
- uid ?: string ;
702
- phoneNumber : string ;
703
- displayName ?: string ;
704
- enrollmentTime ?: string ;
705
- factorId : string ;
706
- } > | null ;
792
+
793
+ /**
794
+ * The updated list of enrolled second factors. The provided list overwrites the user's
795
+ * existing list of second factors.
796
+ * When null is passed, all of the user's existing second factors are removed.
797
+ */
798
+ enrolledFactors : UpdatePhoneMultiFactorInfoRequest [ ] | null ;
707
799
} ;
708
800
}
709
801
802
+ /**
803
+ * Interface representing base properties of a user enrolled second factor for a
804
+ * `CreateRequest`.
805
+ */
806
+ interface CreateMultiFactorInfoRequest {
807
+
808
+ /**
809
+ * The optional display name for an enrolled second factor.
810
+ */
811
+ displayName ?: string ;
812
+
813
+ /**
814
+ * The type identifier of the second factor. For SMS second factors, this is `phone`.
815
+ */
816
+ factorId : string ;
817
+ }
818
+
819
+ /**
820
+ * Interface representing a phone specific user enrolled second factor for a
821
+ * `CreateRequest`.
822
+ */
823
+ interface CreatePhoneMultiFactorInfoRequest extends CreateMultiFactorInfoRequest {
824
+
825
+ /**
826
+ * The phone number associated with a phone second factor.
827
+ */
828
+ phoneNumber : string ;
829
+ }
830
+
710
831
/**
711
832
* Interface representing the properties to set on a new user record to be
712
833
* created.
@@ -718,12 +839,15 @@ declare namespace admin.auth {
718
839
*/
719
840
uid ?: string ;
720
841
842
+ /**
843
+ * The user's multi-factor related properties.
844
+ */
721
845
multiFactor ?: {
722
- enrolledFactors : Array < {
723
- phoneNumber : string ;
724
- displayName ?: string ;
725
- factorId : string ;
726
- } > ;
846
+
847
+ /**
848
+ * The user's list of enrolled second factors.
849
+ */
850
+ enrolledFactors : CreatePhoneMultiFactorInfoRequest [ ] ;
727
851
} ;
728
852
}
729
853
@@ -791,6 +915,19 @@ declare namespace admin.auth {
791
915
*/
792
916
sign_in_provider : string ;
793
917
918
+ /**
919
+ * The type identifier or `factorId` of the second factor, provided the
920
+ * ID token was obtained from a multi-factor authenticated user.
921
+ * For phone, this is `“phone”`.
922
+ */
923
+ sign_in_second_factor ?: string ;
924
+
925
+ /**
926
+ * The `uid` of the second factor used to sign in, provided the
927
+ * ID token was obtained from a multi-factor authenticated user.
928
+ */
929
+ second_factor_identifier ?: string ;
930
+
794
931
/**
795
932
* The ID of the tenant the user belongs to, if available.
796
933
*/
@@ -1029,14 +1166,15 @@ declare namespace admin.auth {
1029
1166
*/
1030
1167
tenantId ?: string | null ;
1031
1168
1169
+ /**
1170
+ * The multi-factor related properties for the imported user if available.
1171
+ */
1032
1172
multiFactor ?: {
1033
- enrolledFactors : Array < {
1034
- uid : string ;
1035
- phoneNumber : string ;
1036
- displayName ?: string ;
1037
- enrollmentTime ?: string ;
1038
- factorId : string ;
1039
- } > ;
1173
+
1174
+ /**
1175
+ * List of enrolled second factors on the user to import.
1176
+ */
1177
+ enrolledFactors : PhoneMultiFactorInfo [ ] ;
1040
1178
} ;
1041
1179
}
1042
1180
0 commit comments