@aws-amplify/auth
Version:
Auth category of aws-amplify
27 lines (24 loc) • 877 B
text/typescript
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';
import {
ForgotPasswordCommandInput,
ForgotPasswordCommandOutput,
ServiceClientFactoryInput,
} from './types';
import { cognitoUserPoolTransferHandler } from './shared/handler';
import {
createUserPoolDeserializer,
createUserPoolSerializer,
} from './shared/serde';
import { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants';
export const createForgotPasswordClient = (config: ServiceClientFactoryInput) =>
composeServiceApi(
cognitoUserPoolTransferHandler,
createUserPoolSerializer<ForgotPasswordCommandInput>('ForgotPassword'),
createUserPoolDeserializer<ForgotPasswordCommandOutput>(),
{
...DEFAULT_SERVICE_CLIENT_API_CONFIG,
...config,
},
);