Skip to content

Standardize auth-next style #2983

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 3 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { deleteAccount, deleteLinkedAccounts, getAccountInfo } from './account';

use(chaiAsPromised);

describe('deleteAccount', () => {
describe('api/account_management/deleteAccount', () => {
const request = {
idToken: 'id-token'
};
Expand Down Expand Up @@ -73,7 +73,7 @@ describe('deleteAccount', () => {
});
});

describe('deleteLinkedAccounts', () => {
describe('api/account_management/deleteLinkedAccounts', () => {
const request = {
idToken: 'id-token',
deleteProvider: [ProviderId.GOOGLE]
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('deleteLinkedAccounts', () => {
});
});

describe('getAccountInfo', () => {
describe('api/account_management/getAccountInfo', () => {
const request = {
idToken: 'id-token'
};
Expand Down
8 changes: 4 additions & 4 deletions packages-exp/auth-exp/src/api/account_management/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { Endpoint, HttpMethod, performApiRequest } from '../';
import { Endpoint, HttpMethod, _performApiRequest } from '../';
import { Auth } from '../../model/auth';
import { APIMFAInfo } from '../../model/id_token';

Expand All @@ -27,7 +27,7 @@ export async function deleteAccount(
auth: Auth,
request: DeleteAccountRequest
): Promise<void> {
return performApiRequest<DeleteAccountRequest, void>(
return _performApiRequest<DeleteAccountRequest, void>(
auth,
HttpMethod.POST,
Endpoint.DELETE_ACCOUNT,
Expand Down Expand Up @@ -57,7 +57,7 @@ export async function deleteLinkedAccounts(
auth: Auth,
request: DeleteLinkedAccountsRequest
): Promise<DeleteLinkedAccountsResponse> {
return performApiRequest<
return _performApiRequest<
DeleteLinkedAccountsRequest,
DeleteLinkedAccountsResponse
>(auth, HttpMethod.POST, Endpoint.SET_ACCOUNT_INFO, request);
Expand Down Expand Up @@ -90,7 +90,7 @@ export async function getAccountInfo(
auth: Auth,
request: GetAccountInfoRequest
): Promise<GetAccountInfoResponse> {
return performApiRequest<GetAccountInfoRequest, GetAccountInfoResponse>(
return _performApiRequest<GetAccountInfoRequest, GetAccountInfoResponse>(
auth,
HttpMethod.POST,
Endpoint.GET_ACCOUNT_INFO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { resetPassword, updateEmailPassword } from './email_and_password';

use(chaiAsPromised);

describe('resetPassword', () => {
describe('api/account_management/resetPassword', () => {
const request = {
oobCode: 'oob-code',
newPassword: 'new-password'
Expand Down Expand Up @@ -76,7 +76,7 @@ describe('resetPassword', () => {
});
});

describe('updateEmailPassword', () => {
describe('api/account_management/updateEmailPassword', () => {
const request = {
idToken: 'id-token',
returnSecureToken: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { Endpoint, HttpMethod, performApiRequest } from '..';
import { Endpoint, HttpMethod, _performApiRequest } from '..';
import { Operation } from '../../model/action_code_info';
import { Auth } from '../../model/auth';
import { IdTokenResponse } from '../../model/id_token';
Expand All @@ -35,7 +35,7 @@ export async function resetPassword(
auth: Auth,
request: ResetPasswordRequest
): Promise<ResetPasswordResponse> {
return performApiRequest<ResetPasswordRequest, ResetPasswordResponse>(
return _performApiRequest<ResetPasswordRequest, ResetPasswordResponse>(
auth,
HttpMethod.POST,
Endpoint.RESET_PASSWORD,
Expand All @@ -55,7 +55,7 @@ export async function updateEmailPassword(
auth: Auth,
request: UpdateEmailPasswordRequest
): Promise<UpdateEmailPasswordResponse> {
return performApiRequest<
return _performApiRequest<
UpdateEmailPasswordRequest,
UpdateEmailPasswordResponse
>(auth, HttpMethod.POST, Endpoint.SET_ACCOUNT_INFO, request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { enrollPhoneMfa, startEnrollPhoneMfa, withdrawMfa } from './mfa';

use(chaiAsPromised);

describe('startEnrollPhoneMfa', () => {
describe('api/account_management/startEnrollPhoneMfa', () => {
const request = {
idToken: 'id-token',
phoneEnrollmentInfo: {
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('startEnrollPhoneMfa', () => {
});
});

describe('enrollPhoneMfa', () => {
describe('api/account_management/enrollPhoneMfa', () => {
const request = {
phoneVerificationInfo: {
temporaryProof: 'temporary-proof',
Expand Down Expand Up @@ -136,7 +136,7 @@ describe('enrollPhoneMfa', () => {
});
});

describe('withdrawMfa', () => {
describe('api/account_management/withdrawMfa', () => {
const request = {
idToken: 'id-token',
mfaEnrollmentId: 'mfa-enrollment-id'
Expand Down
8 changes: 4 additions & 4 deletions packages-exp/auth-exp/src/api/account_management/mfa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { Endpoint, HttpMethod, performApiRequest } from '..';
import { Endpoint, HttpMethod, _performApiRequest } from '..';
import { Auth } from '../../model/auth';
import { IdTokenResponse } from '../../model/id_token';
import { SignInWithPhoneNumberRequest } from '../authentication/sms';
Expand All @@ -39,7 +39,7 @@ export function startEnrollPhoneMfa(
auth: Auth,
request: StartPhoneMfaEnrollmentRequest
): Promise<StartPhoneMfaEnrollmentResponse> {
return performApiRequest<
return _performApiRequest<
StartPhoneMfaEnrollmentRequest,
StartPhoneMfaEnrollmentResponse
>(auth, HttpMethod.POST, Endpoint.START_PHONE_MFA_ENROLLMENT, request);
Expand All @@ -55,7 +55,7 @@ export function enrollPhoneMfa(
auth: Auth,
request: PhoneMfaEnrollmentRequest
): Promise<PhoneMfaEnrollmentResponse> {
return performApiRequest<
return _performApiRequest<
PhoneMfaEnrollmentRequest,
PhoneMfaEnrollmentResponse
>(auth, HttpMethod.POST, Endpoint.FINALIZE_PHONE_MFA_ENROLLMENT, request);
Expand All @@ -72,7 +72,7 @@ export function withdrawMfa(
auth: Auth,
request: WithdrawMfaRequest
): Promise<WithdrawMfaResponse> {
return performApiRequest<WithdrawMfaRequest, WithdrawMfaResponse>(
return _performApiRequest<WithdrawMfaRequest, WithdrawMfaResponse>(
auth,
HttpMethod.POST,
Endpoint.WITHDRAW_MFA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { updateProfile } from './profile';

use(chaiAsPromised);

describe('updateProfile', () => {
describe('api/account_management/updateProfile', () => {
const request = {
idToken: 'my-token',
email: '[email protected]',
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/auth-exp/src/api/account_management/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { Endpoint, HttpMethod, performApiRequest } from '..';
import { Endpoint, HttpMethod, _performApiRequest } from '..';
import { Auth } from '../../model/auth';
import { IdTokenResponse } from '../../model/id_token';

Expand All @@ -34,7 +34,7 @@ export async function updateProfile(
auth: Auth,
request: UpdateProfileRequest
): Promise<UpdateProfileResponse> {
return performApiRequest<UpdateProfileRequest, UpdateProfileResponse>(
return _performApiRequest<UpdateProfileRequest, UpdateProfileResponse>(
auth,
HttpMethod.POST,
Endpoint.SET_ACCOUNT_INFO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { createAuthUri } from './create_auth_uri';

use(chaiAsPromised);

describe('createAuthUri', () => {
describe('api/authentication/createAuthUri', () => {
const request = {
identifier: 'my-id',
continueUri: 'example.com/redirectUri'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { Endpoint, HttpMethod, performApiRequest } from '..';
import { Endpoint, HttpMethod, _performApiRequest } from '..';
import { Auth } from '../../model/auth';

export interface CreateAuthUriRequest {
Expand All @@ -31,7 +31,7 @@ export async function createAuthUri(
auth: Auth,
request: CreateAuthUriRequest
): Promise<CreateAuthUriResponse> {
return performApiRequest<CreateAuthUriRequest, CreateAuthUriResponse>(
return _performApiRequest<CreateAuthUriRequest, CreateAuthUriResponse>(
auth,
HttpMethod.POST,
Endpoint.CREATE_AUTH_URI,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { signInWithCustomToken } from './custom_token';

use(chaiAsPromised);

describe('signInWithCustomToken', () => {
describe('api/authentication/signInWithCustomToken', () => {
const request = {
token: 'my-token'
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { Endpoint, HttpMethod, performSignInRequest } from '..';
import { Endpoint, HttpMethod, _performSignInRequest } from '..';
import { Auth } from '../../model/auth';
import { IdTokenResponse } from '../../model/id_token';

Expand All @@ -29,7 +29,7 @@ export async function signInWithCustomToken(
auth: Auth,
request: SignInWithCustomTokenRequest
): Promise<SignInWithCustomTokenResponse> {
return performSignInRequest<
return _performSignInRequest<
SignInWithCustomTokenRequest,
SignInWithCustomTokenResponse
>(auth, HttpMethod.POST, Endpoint.SIGN_IN_WITH_CUSTOM_TOKEN, request);
Expand Down
Loading