Skip to content

[Auth] Fix broken public typings d.ts file #5127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions common/api-review/auth-exp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ export class EmailAuthCredential extends AuthCredential {
export class EmailAuthProvider implements AuthProvider {
static credential(email: string, password: string): EmailAuthCredential;
static credentialWithLink(email: string, emailLink: string): EmailAuthCredential;
static readonly EMAIL_LINK_SIGN_IN_METHOD = SignInMethod.EMAIL_LINK;
static readonly EMAIL_PASSWORD_SIGN_IN_METHOD = SignInMethod.EMAIL_PASSWORD;
static readonly PROVIDER_ID = ProviderId.PASSWORD;
readonly providerId = ProviderId.PASSWORD;
static readonly EMAIL_LINK_SIGN_IN_METHOD: 'emailLink';
static readonly EMAIL_PASSWORD_SIGN_IN_METHOD: 'password';
static readonly PROVIDER_ID: 'password';
readonly providerId: "password";
}

export { ErrorFn }
Expand All @@ -234,8 +234,8 @@ export class FacebookAuthProvider extends BaseOAuthProvider {
static credential(accessToken: string): OAuthCredential;
static credentialFromError(error: FirebaseError): OAuthCredential | null;
static credentialFromResult(userCredential: UserCredential): OAuthCredential | null;
static readonly FACEBOOK_SIGN_IN_METHOD = SignInMethod.FACEBOOK;
static readonly PROVIDER_ID = ProviderId.FACEBOOK;
static readonly FACEBOOK_SIGN_IN_METHOD: 'facebook.com';
static readonly PROVIDER_ID: 'facebook.com';
}

// @public
Expand Down Expand Up @@ -270,8 +270,8 @@ export class GithubAuthProvider extends BaseOAuthProvider {
static credential(accessToken: string): OAuthCredential;
static credentialFromError(error: FirebaseError): OAuthCredential | null;
static credentialFromResult(userCredential: UserCredential): OAuthCredential | null;
static readonly GITHUB_SIGN_IN_METHOD = SignInMethod.GITHUB;
static readonly PROVIDER_ID = ProviderId.GITHUB;
static readonly GITHUB_SIGN_IN_METHOD: 'github.com';
static readonly PROVIDER_ID: 'github.com';
}

// @public
Expand All @@ -280,8 +280,8 @@ export class GoogleAuthProvider extends BaseOAuthProvider {
static credential(idToken?: string | null, accessToken?: string | null): OAuthCredential;
static credentialFromError(error: FirebaseError): OAuthCredential | null;
static credentialFromResult(userCredential: UserCredential): OAuthCredential | null;
static readonly GOOGLE_SIGN_IN_METHOD = SignInMethod.GOOGLE;
static readonly PROVIDER_ID = ProviderId.GOOGLE;
static readonly GOOGLE_SIGN_IN_METHOD: 'google.com';
static readonly PROVIDER_ID: 'google.com';
}

// @public
Expand Down Expand Up @@ -458,9 +458,9 @@ export class PhoneAuthProvider {
static credential(verificationId: string, verificationCode: string): PhoneAuthCredential;
static credentialFromError(error: FirebaseError): AuthCredential | null;
static credentialFromResult(userCredential: UserCredential): AuthCredential | null;
static readonly PHONE_SIGN_IN_METHOD = SignInMethod.PHONE;
static readonly PROVIDER_ID = ProviderId.PHONE;
readonly providerId = ProviderId.PHONE;
static readonly PHONE_SIGN_IN_METHOD: 'phone';
static readonly PROVIDER_ID: 'phone';
readonly providerId: "phone";
verifyPhoneNumber(phoneOptions: PhoneInfoOptions | string, applicationVerifier: ApplicationVerifier): Promise<string>;
}

Expand Down Expand Up @@ -617,8 +617,8 @@ export class TwitterAuthProvider extends BaseOAuthProvider {
static credential(token: string, secret: string): OAuthCredential;
static credentialFromError(error: FirebaseError): OAuthCredential | null;
static credentialFromResult(userCredential: UserCredential): OAuthCredential | null;
static readonly PROVIDER_ID = ProviderId.TWITTER;
static readonly TWITTER_SIGN_IN_METHOD = SignInMethod.TWITTER;
static readonly PROVIDER_ID: 'twitter.com';
static readonly TWITTER_SIGN_IN_METHOD: 'twitter.com';
}

// @public
Expand Down
8 changes: 5 additions & 3 deletions packages-exp/auth-exp/src/core/providers/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ export class EmailAuthProvider implements AuthProvider {
/**
* Always set to {@link ProviderId}.PASSWORD, even for email link.
*/
static readonly PROVIDER_ID = ProviderId.PASSWORD;
static readonly PROVIDER_ID: 'password' = ProviderId.PASSWORD;
/**
* Always set to {@link SignInMethod}.EMAIL_PASSWORD.
*/
static readonly EMAIL_PASSWORD_SIGN_IN_METHOD = SignInMethod.EMAIL_PASSWORD;
static readonly EMAIL_PASSWORD_SIGN_IN_METHOD: 'password' =
SignInMethod.EMAIL_PASSWORD;
/**
* Always set to {@link SignInMethod}.EMAIL_LINK.
*/
static readonly EMAIL_LINK_SIGN_IN_METHOD = SignInMethod.EMAIL_LINK;
static readonly EMAIL_LINK_SIGN_IN_METHOD: 'emailLink' =
SignInMethod.EMAIL_LINK;
/**
* Always set to {@link ProviderId}.PASSWORD, even for email link.
*/
Expand Down
5 changes: 3 additions & 2 deletions packages-exp/auth-exp/src/core/providers/facebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ import { BaseOAuthProvider } from './oauth';
*/
export class FacebookAuthProvider extends BaseOAuthProvider {
/** Always set to {@link SignInMethod}.FACEBOOK. */
static readonly FACEBOOK_SIGN_IN_METHOD = SignInMethod.FACEBOOK;
static readonly FACEBOOK_SIGN_IN_METHOD: 'facebook.com' =
SignInMethod.FACEBOOK;
/** Always set to {@link ProviderId}.FACEBOOK. */
static readonly PROVIDER_ID = ProviderId.FACEBOOK;
static readonly PROVIDER_ID: 'facebook.com' = ProviderId.FACEBOOK;

constructor() {
super(ProviderId.FACEBOOK);
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/auth-exp/src/core/providers/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ import { BaseOAuthProvider } from './oauth';
*/
export class GithubAuthProvider extends BaseOAuthProvider {
/** Always set to {@link SignInMethod}.GITHUB. */
static readonly GITHUB_SIGN_IN_METHOD = SignInMethod.GITHUB;
static readonly GITHUB_SIGN_IN_METHOD: 'github.com' = SignInMethod.GITHUB;
/** Always set to {@link ProviderId}.GITHUB. */
static readonly PROVIDER_ID = ProviderId.GITHUB;
static readonly PROVIDER_ID: 'github.com' = ProviderId.GITHUB;

constructor() {
super(ProviderId.GITHUB);
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/auth-exp/src/core/providers/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ import { BaseOAuthProvider } from './oauth';
*/
export class GoogleAuthProvider extends BaseOAuthProvider {
/** Always set to {@link SignInMethod}.GOOGLE. */
static readonly GOOGLE_SIGN_IN_METHOD = SignInMethod.GOOGLE;
static readonly GOOGLE_SIGN_IN_METHOD: 'google.com' = SignInMethod.GOOGLE;
/** Always set to {@link ProviderId}.GOOGLE. */
static readonly PROVIDER_ID = ProviderId.GOOGLE;
static readonly PROVIDER_ID: 'google.com' = ProviderId.GOOGLE;

constructor() {
super(ProviderId.GOOGLE);
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/auth-exp/src/core/providers/twitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ import { BaseOAuthProvider } from './oauth';
*/
export class TwitterAuthProvider extends BaseOAuthProvider {
/** Always set to {@link SignInMethod}.TWITTER. */
static readonly TWITTER_SIGN_IN_METHOD = SignInMethod.TWITTER;
static readonly TWITTER_SIGN_IN_METHOD: 'twitter.com' = SignInMethod.TWITTER;
/** Always set to {@link ProviderId}.TWITTER. */
static readonly PROVIDER_ID = ProviderId.TWITTER;
static readonly PROVIDER_ID: 'twitter.com' = ProviderId.TWITTER;

constructor() {
super(ProviderId.TWITTER);
Expand Down
4 changes: 1 addition & 3 deletions packages-exp/auth-exp/src/model/id_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* limitations under the License.
*/

import { ProviderId } from './public_types';

import { PhoneOrOauthTokenResponse } from '../api/authentication/mfa';

/**
Expand Down Expand Up @@ -55,7 +53,7 @@ export interface IdTokenResponse {
idToken?: IdToken;
refreshToken?: string;
expiresIn?: string;
providerId?: ProviderId | string;
providerId?: string;

// Used in AdditionalUserInfo
displayName?: string | null;
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/auth-exp/src/platform_browser/providers/phone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ import { TaggedWithTokenResponse } from '../../model/id_token';
*/
export class PhoneAuthProvider {
/** Always set to {@link ProviderId}.PHONE. */
static readonly PROVIDER_ID = ProviderId.PHONE;
static readonly PROVIDER_ID: 'phone' = ProviderId.PHONE;
/** Always set to {@link SignInMethod}.PHONE. */
static readonly PHONE_SIGN_IN_METHOD = SignInMethod.PHONE;
static readonly PHONE_SIGN_IN_METHOD: 'phone' = SignInMethod.PHONE;

/** Always set to {@link ProviderId}.PHONE. */
readonly providerId = PhoneAuthProvider.PROVIDER_ID;
Expand Down