diff --git a/package.json b/package.json index 4908fca2f9e..7a2957d42de 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "build:watch": "concurrently 'lerna run build:cjs:watch --parallel' 'lerna run build:esm:watch --parallel' --raw", "build:esm:watch": "lerna run build:esm:watch --parallel", "build:cjs:watch": "lerna run build:cjs:watch --parallel", + "build:client-types": "cd scripts/dts-bundler && yarn && yarn run build", "clean": "lerna run clean --parallel", "clean:size": "lerna run clean:size --parallel", "format": "lerna run format", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index a108300657d..d8d9ee8d22a 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -58,9 +58,6 @@ "tslib": "^1.8.0", "uuid": "^3.2.1" }, - "devDependencies": { - "@aws-sdk/client-pinpoint": "3.186.1" - }, "size-limit": [ { "name": "Analytics (Pinpoint)", @@ -72,7 +69,7 @@ "name": "Analytics (Kinesis)", "path": "./lib-esm/index.js", "import": "{ Amplify, Analytics, AWSKinesisProvider }", - "limit": "58.1 kB" + "limit": "58.2 kB" } ], "jest": { diff --git a/packages/core/package.json b/packages/core/package.json index 9d25c89e03d..ac9ea9e6bd4 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -48,8 +48,6 @@ }, "homepage": "https://aws-amplify.github.io/", "devDependencies": { - "@aws-sdk/client-cognito-identity": "3.6.1", - "@aws-sdk/client-pinpoint": "3.186.1", "@react-native-async-storage/async-storage": "1.15.17", "find": "^0.2.7", "genversion": "^2.2.0", diff --git a/packages/core/src/AwsClients/CognitoIdentity/getCredentialsForIdentity.ts b/packages/core/src/AwsClients/CognitoIdentity/getCredentialsForIdentity.ts index 041f5bb2f97..84aa2566711 100644 --- a/packages/core/src/AwsClients/CognitoIdentity/getCredentialsForIdentity.ts +++ b/packages/core/src/AwsClients/CognitoIdentity/getCredentialsForIdentity.ts @@ -1,11 +1,6 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import type { - GetCredentialsForIdentityCommandInput as GetCredentialsForIdentityInput, - GetCredentialsForIdentityCommandOutput as GetCredentialsForIdentityOutput, - Credentials, -} from '@aws-sdk/client-cognito-identity'; import { buildHttpRpcRequest, cognitoIdentityTransferHandler, @@ -21,6 +16,11 @@ import { parseJsonError, parseMetadata, } from '../../clients'; +import type { + GetCredentialsForIdentityCommandInput as GetCredentialsForIdentityInput, + GetCredentialsForIdentityCommandOutput as GetCredentialsForIdentityOutput, + Credentials, +} from './types'; export type { GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput }; diff --git a/packages/core/src/AwsClients/CognitoIdentity/getId.ts b/packages/core/src/AwsClients/CognitoIdentity/getId.ts index 87cc3a326e1..9e5e68e941e 100644 --- a/packages/core/src/AwsClients/CognitoIdentity/getId.ts +++ b/packages/core/src/AwsClients/CognitoIdentity/getId.ts @@ -1,10 +1,6 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import { - GetIdCommandInput as GetIdInput, - GetIdCommandOutput as GetIdOutput, -} from '@aws-sdk/client-cognito-identity'; import { buildHttpRpcRequest, cognitoIdentityTransferHandler, @@ -20,6 +16,10 @@ import { parseJsonError, parseMetadata, } from '../../clients'; +import { + GetIdCommandInput as GetIdInput, + GetIdCommandOutput as GetIdOutput, +} from './types'; export type { GetIdInput, GetIdOutput }; diff --git a/packages/core/src/AwsClients/CognitoIdentity/types.ts b/packages/core/src/AwsClients/CognitoIdentity/types.ts new file mode 100644 index 00000000000..6ce1d27ca2a --- /dev/null +++ b/packages/core/src/AwsClients/CognitoIdentity/types.ts @@ -0,0 +1,159 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// Generated by scripts/dts-bundler/README.md + +import { MetadataBearer as __MetadataBearer } from '@aws-sdk/types'; + +/** + * @public + *

Credentials for the provided identity ID.

+ */ +export interface Credentials { + /** + *

The Access Key portion of the credentials.

+ */ + AccessKeyId?: string; + /** + *

The Secret Access Key portion of the credentials

+ */ + SecretKey?: string; + /** + *

The Session Token portion of the credentials

+ */ + SessionToken?: string; + /** + *

The date at which these credentials will expire.

+ */ + Expiration?: Date; +} +/** + * @public + * + * The input for {@link GetCredentialsForIdentityCommand}. + */ +export interface GetCredentialsForIdentityCommandInput + extends GetCredentialsForIdentityInput {} +/** + * @public + * + * The output of {@link GetCredentialsForIdentityCommand}. + */ +export interface GetCredentialsForIdentityCommandOutput + extends GetCredentialsForIdentityResponse, + __MetadataBearer {} +/** + * @public + *

Input to the GetCredentialsForIdentity action.

+ */ +export interface GetCredentialsForIdentityInput { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId: string | undefined; + /** + *

A set of optional name-value pairs that map provider names to provider tokens. The + * name-value pair will follow the syntax "provider_name": + * "provider_user_identifier".

+ *

Logins should not be specified when trying to get credentials for an unauthenticated + * identity.

+ *

The Logins parameter is required when using identities associated with external + * identity providers such as Facebook. For examples of Logins maps, see the code + * examples in the External Identity Providers section of the Amazon Cognito Developer + * Guide.

+ */ + Logins?: Record; + /** + *

The Amazon Resource Name (ARN) of the role to be assumed when multiple roles were + * received in the token from the identity provider. For example, a SAML-based identity + * provider. This parameter is optional for identity providers that do not support role + * customization.

+ */ + CustomRoleArn?: string; +} +/** + * @public + *

Returned in response to a successful GetCredentialsForIdentity + * operation.

+ */ +export interface GetCredentialsForIdentityResponse { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; + /** + *

Credentials for the provided identity ID.

+ */ + Credentials?: Credentials; +} +/** + * @public + * + * The input for {@link GetIdCommand}. + */ +export interface GetIdCommandInput extends GetIdInput {} +/** + * @public + * + * The output of {@link GetIdCommand}. + */ +export interface GetIdCommandOutput extends GetIdResponse, __MetadataBearer {} +/** + * @public + *

Input to the GetId action.

+ */ +export interface GetIdInput { + /** + *

A standard AWS account ID (9+ digits).

+ */ + AccountId?: string; + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; + /** + *

A set of optional name-value pairs that map provider names to provider tokens. The + * available provider names for Logins are as follows:

+ * + */ + Logins?: Record; +} +/** + * @public + *

Returned in response to a GetId request.

+ */ +export interface GetIdResponse { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; +} + +export {}; diff --git a/packages/core/src/AwsClients/Pinpoint/getInAppMessages.ts b/packages/core/src/AwsClients/Pinpoint/getInAppMessages.ts index 672ab0a2110..17a74e8b95c 100644 --- a/packages/core/src/AwsClients/Pinpoint/getInAppMessages.ts +++ b/packages/core/src/AwsClients/Pinpoint/getInAppMessages.ts @@ -1,10 +1,6 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import type { - GetInAppMessagesCommandInput as GetInAppMessagesInput, - GetInAppMessagesCommandOutput as GetInAppMessagesOutput, -} from '@aws-sdk/client-pinpoint'; import { authenticatedHandler } from '../../clients/handlers/authenticated'; import { composeServiceApi } from '../../clients/internal/composeServiceApi'; import { extendedEncodeURIComponent } from '../../clients/middleware/signing/utils/extendedEncodeURIComponent'; @@ -15,6 +11,10 @@ import { } from '../../clients/serde'; import { Endpoint, HttpRequest, HttpResponse } from '../../clients/types'; import { defaultConfig, getSharedHeaders } from './base'; +import type { + GetInAppMessagesCommandInput as GetInAppMessagesInput, + GetInAppMessagesCommandOutput as GetInAppMessagesOutput, +} from './types'; export type { GetInAppMessagesInput, GetInAppMessagesOutput }; diff --git a/packages/core/src/AwsClients/Pinpoint/index.ts b/packages/core/src/AwsClients/Pinpoint/index.ts index 445ada9ac97..72a08a15ce3 100644 --- a/packages/core/src/AwsClients/Pinpoint/index.ts +++ b/packages/core/src/AwsClients/Pinpoint/index.ts @@ -12,3 +12,4 @@ export { UpdateEndpointInput, UpdateEndpointOutput, } from './updateEndpoint'; +export { Event, InAppMessageCampaign } from './types'; diff --git a/packages/core/src/AwsClients/Pinpoint/putEvents.ts b/packages/core/src/AwsClients/Pinpoint/putEvents.ts index 2185386cb13..c072a11e40d 100644 --- a/packages/core/src/AwsClients/Pinpoint/putEvents.ts +++ b/packages/core/src/AwsClients/Pinpoint/putEvents.ts @@ -1,10 +1,6 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import type { - PutEventsCommandInput as PutEventsInput, - PutEventsCommandOutput as PutEventsOutput, -} from '@aws-sdk/client-pinpoint'; import { authenticatedHandler } from '../../clients/handlers/authenticated'; import { composeServiceApi } from '../../clients/internal/composeServiceApi'; import { extendedEncodeURIComponent } from '../../clients/middleware/signing/utils/extendedEncodeURIComponent'; @@ -15,6 +11,10 @@ import { } from '../../clients/serde'; import { Endpoint, HttpRequest, HttpResponse } from '../../clients/types'; import { defaultConfig, getSharedHeaders } from './base'; +import type { + PutEventsCommandInput as PutEventsInput, + PutEventsCommandOutput as PutEventsOutput, +} from './types'; export type { PutEventsInput, PutEventsOutput }; diff --git a/packages/core/src/AwsClients/Pinpoint/types.ts b/packages/core/src/AwsClients/Pinpoint/types.ts new file mode 100644 index 00000000000..efd08fa884c --- /dev/null +++ b/packages/core/src/AwsClients/Pinpoint/types.ts @@ -0,0 +1,844 @@ +/* tslint:disable:max-line-length */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// Generated by scripts/dts-bundler/README.md + +import { MetadataBearer as __MetadataBearer } from '@aws-sdk/types'; + +declare const Alignment: { + readonly CENTER: 'CENTER'; + readonly LEFT: 'LEFT'; + readonly RIGHT: 'RIGHT'; +}; +declare const AttributeType: { + readonly AFTER: 'AFTER'; + readonly BEFORE: 'BEFORE'; + readonly BETWEEN: 'BETWEEN'; + readonly CONTAINS: 'CONTAINS'; + readonly EXCLUSIVE: 'EXCLUSIVE'; + readonly INCLUSIVE: 'INCLUSIVE'; + readonly ON: 'ON'; +}; +declare const ButtonAction: { + readonly CLOSE: 'CLOSE'; + readonly DEEP_LINK: 'DEEP_LINK'; + readonly LINK: 'LINK'; +}; +declare const ChannelType: { + readonly ADM: 'ADM'; + readonly APNS: 'APNS'; + readonly APNS_SANDBOX: 'APNS_SANDBOX'; + readonly APNS_VOIP: 'APNS_VOIP'; + readonly APNS_VOIP_SANDBOX: 'APNS_VOIP_SANDBOX'; + readonly BAIDU: 'BAIDU'; + readonly CUSTOM: 'CUSTOM'; + readonly EMAIL: 'EMAIL'; + readonly GCM: 'GCM'; + readonly IN_APP: 'IN_APP'; + readonly PUSH: 'PUSH'; + readonly SMS: 'SMS'; + readonly VOICE: 'VOICE'; +}; +declare const DimensionType: { + readonly EXCLUSIVE: 'EXCLUSIVE'; + readonly INCLUSIVE: 'INCLUSIVE'; +}; +declare const FilterType: { + readonly ENDPOINT: 'ENDPOINT'; + readonly SYSTEM: 'SYSTEM'; +}; +declare const Layout: { + readonly BOTTOM_BANNER: 'BOTTOM_BANNER'; + readonly CAROUSEL: 'CAROUSEL'; + readonly MIDDLE_BANNER: 'MIDDLE_BANNER'; + readonly MOBILE_FEED: 'MOBILE_FEED'; + readonly OVERLAYS: 'OVERLAYS'; + readonly TOP_BANNER: 'TOP_BANNER'; +}; +/** + * @public + *

Specifies attribute-based criteria for including or excluding endpoints from a segment.

+ */ +export interface AttributeDimension { + /** + *

The type of segment dimension to use. Valid values are: