Skip to content

Commit

Permalink
chore(types): expose CodeDeliveryDetails, HubCapsule types (#12501)
Browse files Browse the repository at this point in the history
* chore(types): expose CodeDeliveryDetails, HubCapsule types

* resolve conflicts

---------

Co-authored-by: Ashwin Kumar <[email protected]>
Co-authored-by: erinleigh90 <[email protected]>
  • Loading branch information
3 people authored Nov 3, 2023
1 parent e1d88c2 commit 3ae78c7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export {
fetchDevices,
autoSignIn,
AuthUser,
CodeDeliveryDetails,
UserAttributeKey,
VerifiableUserAttributeKey,
} from './providers/cognito';

export {
Expand Down
8 changes: 6 additions & 2 deletions packages/auth/src/providers/cognito/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export {
DeleteUserAttributesInput,
ForgetDeviceInput,
} from './types/inputs';

export {
FetchUserAttributesOutput,
GetCurrentUserOutput,
Expand All @@ -64,7 +63,12 @@ export {
SendUserAttributeVerificationCodeOutput,
FetchDevicesOutput,
} from './types/outputs';
export { AuthUser } from './types/models';
export {
AuthUser,
CodeDeliveryDetails,
UserAttributeKey,
VerifiableUserAttributeKey,
} from './types/models';
export {
cognitoCredentialsProvider,
CognitoAWSCredentialsAndIdentityIdProvider,
Expand Down
1 change: 1 addition & 0 deletions packages/auth/src/providers/cognito/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export {
AWSAuthDevice,
AuthUser,
CognitoAuthSignInDetails,
CodeDeliveryDetails,
} from './models';

export {
Expand Down
16 changes: 15 additions & 1 deletion packages/auth/src/providers/cognito/types/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import {
AuthStandardAttributeKey,
AuthVerifiableAttributeKey,
} from '@aws-amplify/core/internals/utils';
import { AuthUserAttribute, AuthDevice, AWSAuthUser } from '../../../types';

import {
AuthUserAttribute,
AuthDevice,
AWSAuthUser,
AuthCodeDeliveryDetails,
} from '../../../types';

import { AuthProvider } from '../../../types/inputs';
import { SignUpOutput } from './outputs';

Expand Down Expand Up @@ -95,3 +102,10 @@ export type CognitoAuthSignInDetails = {
export interface AuthUser extends AWSAuthUser {
signInDetails?: CognitoAuthSignInDetails;
}

/**
* Holds data describing the dispatch of a confirmation code.
*/
export type CodeDeliveryDetails<
CognitoUserAttributeKey extends UserAttributeKey = UserAttributeKey
> = AuthCodeDeliveryDetails<CognitoUserAttributeKey>;
1 change: 1 addition & 0 deletions packages/aws-amplify/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This file maps exports from `aws-amplify/utils`.
*/
export {
Hub,
HubCapsule,
I18n,
Cache,
ConsoleLogger,
Expand Down

0 comments on commit 3ae78c7

Please sign in to comment.