Skip to content

Commit 271303f

Browse files
authored
Remove Auth internal types from the public typings (#5460)
* mark internal APIs * Create slimy-penguins-itch.md
1 parent b8462f2 commit 271303f

File tree

10 files changed

+51
-3
lines changed

10 files changed

+51
-3
lines changed

.changeset/slimy-penguins-itch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/auth": patch
3+
---
4+
5+
Remove `const enum`s from the public typing file.

packages/auth/src/api/authentication/idp.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export interface SignInWithIdpRequest {
3636
pendingToken?: string;
3737
}
3838

39+
/**
40+
* @internal
41+
*/
3942
export interface SignInWithIdpResponse extends IdTokenResponse {
4043
oauthAccessToken?: string;
4144
oauthTokenSecret?: string;

packages/auth/src/api/authentication/mfa.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export interface FinalizeMfaResponse {
3030
refreshToken: string;
3131
}
3232

33+
/**
34+
* @internal
35+
*/
3336
export interface IdTokenMfaResponse extends IdTokenResponse {
3437
mfaPendingCredential?: string;
3538
mfaInfo?: MfaEnrollment[];
@@ -84,6 +87,9 @@ export function finalizeSignInPhoneMfa(
8487
});
8588
}
8689

90+
/**
91+
* @internal
92+
*/
8793
export type PhoneOrOauthTokenResponse =
8894
| SignInWithPhoneNumberResponse
8995
| SignInWithIdpResponse

packages/auth/src/api/authentication/sms.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ export async function sendPhoneVerificationCode(
5353
);
5454
}
5555

56+
/**
57+
* @internal
58+
*/
5659
export interface SignInWithPhoneNumberRequest {
5760
temporaryProof?: string;
5861
phoneNumber?: string;
@@ -66,6 +69,9 @@ export interface LinkWithPhoneNumberRequest
6669
idToken: string;
6770
}
6871

72+
/**
73+
* @internal
74+
*/
6975
export interface SignInWithPhoneNumberResponse extends IdTokenResponse {
7076
temporaryProof?: string;
7177
phoneNumber?: string;

packages/auth/src/core/errors.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import { AuthCredential } from './credentials';
2424

2525
/**
2626
* Enumeration of Firebase Auth error codes.
27+
*
28+
* @internal
2729
*/
2830
export const enum AuthErrorCode {
2931
ADMIN_ONLY_OPERATION = 'admin-restricted-operation',
@@ -399,6 +401,9 @@ export interface NamedErrorParams {
399401
serverResponse?: object;
400402
}
401403

404+
/**
405+
* @internal
406+
*/
402407
type GenericAuthErrorParams = {
403408
[key in Exclude<
404409
AuthErrorCode,
@@ -415,6 +420,9 @@ type GenericAuthErrorParams = {
415420
};
416421
};
417422

423+
/**
424+
* @internal
425+
*/
418426
export interface AuthErrorParams extends GenericAuthErrorParams {
419427
[AuthErrorCode.ARGUMENT_ERROR]: { appName?: AppName };
420428
[AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH]: { appName?: AppName };

packages/auth/src/core/util/version.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const enum ClientImplementation {
2323
CORE = 'JsCore'
2424
}
2525

26+
/**
27+
* @internal
28+
*/
2629
export const enum ClientPlatform {
2730
BROWSER = 'Browser',
2831
NODE = 'Node',

packages/auth/src/model/auth.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ export type AppName = string;
3434
export type ApiKey = string;
3535
export type AuthDomain = string;
3636

37+
/**
38+
* @internal
39+
*/
3740
export interface ConfigInternal extends Config {
3841
/**
3942
* @readonly

packages/auth/src/model/enums.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/**
1919
* Enumeration of supported providers.
20-
*
20+
* @internal
2121
*/
2222
export const enum ProviderId {
2323
/** @internal */
@@ -42,7 +42,7 @@ export const enum ProviderId {
4242

4343
/**
4444
* Enumeration of supported sign-in methods.
45-
*
45+
* @internal
4646
*/
4747
export const enum SignInMethod {
4848
/** @internal */
@@ -65,7 +65,7 @@ export const enum SignInMethod {
6565

6666
/**
6767
* Enumeration of supported operation types.
68-
*
68+
* @internal
6969
*/
7070
export const enum OperationType {
7171
/** Operation involving linking an additional provider to an already signed-in user. */

packages/auth/src/model/id_token.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface ParsedIdToken {
4747
/**
4848
* IdToken as returned by the API
4949
*
50+
* @internal
5051
*/
5152
export interface IdTokenResponse {
5253
localId: string;
@@ -67,6 +68,7 @@ export interface IdTokenResponse {
6768
/**
6869
* The possible types of the `IdTokenResponse`
6970
*
71+
* @internal
7072
*/
7173
export const enum IdTokenResponseKind {
7274
CreateAuthUri = 'identitytoolkit#CreateAuthUriResponse',

packages/auth/src/model/popup_redirect.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export interface GapiAuthEvent extends gapi.iframes.Message {
4141
authEvent: AuthEvent;
4242
}
4343

44+
/**
45+
* @internal
46+
*/
4447
export const enum AuthEventType {
4548
LINK_VIA_POPUP = 'linkViaPopup',
4649
LINK_VIA_REDIRECT = 'linkViaRedirect',
@@ -57,6 +60,9 @@ export interface AuthEventError extends Error {
5760
message: string;
5861
}
5962

63+
/**
64+
* @internal
65+
*/
6066
export interface AuthEvent {
6167
type: AuthEventType;
6268
eventId: string | null;
@@ -67,13 +73,19 @@ export interface AuthEvent {
6773
error?: AuthEventError;
6874
}
6975

76+
/**
77+
* @internal
78+
*/
7079
export interface AuthEventConsumer {
7180
readonly filter: AuthEventType[];
7281
eventId: string | null;
7382
onAuthEvent(event: AuthEvent): unknown;
7483
onError(error: FirebaseError): unknown;
7584
}
7685

86+
/**
87+
* @internal
88+
*/
7789
export interface EventManager {
7890
registerConsumer(authEventConsumer: AuthEventConsumer): void;
7991
unregisterConsumer(authEventConsumer: AuthEventConsumer): void;

0 commit comments

Comments
 (0)