From 63616a6e1b420c7173a2d479311c3e31cff5c2fb Mon Sep 17 00:00:00 2001 From: Katie Goines <30757403+katiegoines@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:39:44 -0700 Subject: [PATCH] a11y- Use nested list for

links within the table of contents (#7883) --------- Co-authored-by: katiegoines Co-authored-by: Heather --- src/components/Layout/Layout.tsx | 9 ++- .../TableOfContents/TableOfContents.tsx | 64 +++++++++++++++---- .../lib-v1/analytics/js/personalize.mdx | 4 +- .../signin_next_steps/common.mdx | 18 +++--- .../lib-v1/geo/android/escapehatch.mdx | 2 +- src/fragments/lib-v1/geo/ios/escapehatch.mdx | 2 +- .../integrate-your-application.mdx | 2 +- .../js/install-dependencies.mdx | 2 +- .../react-native/configure-amplify.mdx | 2 +- .../react-native/install-dependencies.mdx | 2 +- .../common/receive-device-token.mdx | 2 +- .../lib-v1/react-native-polyfills.mdx | 2 +- .../lib-v1/storage/android/download.mdx | 2 +- src/fragments/lib-v1/storage/ios/download.mdx | 4 +- src/fragments/lib-v1/storage/js/autotrack.mdx | 4 +- .../lib/analytics/js/personalize.mdx | 4 +- .../signin_next_steps/80_current_user.mdx | 2 +- .../10_fetchAuthSession.mdx | 2 +- .../signin_next_steps/common.mdx | 18 +++--- src/fragments/lib/geo/android/escapehatch.mdx | 2 +- src/fragments/lib/geo/ios/escapehatch.mdx | 2 +- .../lib/graphqlapi/ios/upgrade-guide.mdx | 4 +- .../integrate-your-application.mdx | 4 +- .../js/install-ui-dependencies.mdx | 2 +- .../react-native/install-dependencies.mdx | 4 +- .../common/access_logs/access_logs.mdx | 2 +- .../flutter/escape-hatch/escape-hatch.mdx | 4 +- .../common/receive-device-token.mdx | 2 +- .../lib/storage/android/download.mdx | 6 +- src/fragments/sdk/api/android/graphql.mdx | 42 ++++++------ src/fragments/sdk/api/ios/graphql.mdx | 42 ++++++------ .../sdk/auth/android/federated-identities.mdx | 14 ++-- .../sdk/storage/ios/getting-started.mdx | 10 +-- .../getting-started/flutter/nextsteps.mdx | 2 +- .../personalize-recommendations/index.mdx | 4 +- .../geo/amazon-location-sdk/index.mdx | 4 +- .../integrate-application/index.mdx | 8 +-- .../interactions/chatbot/index.mdx | 4 +- .../logging/view-logs/index.mdx | 2 +- .../predictions/text-to-speech/index.mdx | 2 +- .../manage-user-sessions/index.mdx | 2 +- .../auth/multi-step-sign-in/index.mdx | 56 ++++++++-------- .../storage/data-usage/index.mdx | 24 +++---- .../fullstack-branching/pr-previews/index.mdx | 6 +- .../query-with-sorting/index.mdx | 4 +- .../warehouse-management/index.mdx | 34 +++++----- .../customize-authorization-rules/index.mdx | 2 +- .../cli-legacy/relational-databases/index.mdx | 2 +- .../tools/cli-legacy/storage/index.mdx | 2 +- .../cli/migration/list-nullability/index.mdx | 10 +-- .../tools/cli/plugins/authoring/index.mdx | 10 +-- .../tools/cli/reference/diagnose/index.mdx | 2 +- .../tools/cli/reference/usage-data/index.mdx | 2 +- .../gen1/[platform]/tools/cli/teams/index.mdx | 4 +- 54 files changed, 259 insertions(+), 214 deletions(-) diff --git a/src/components/Layout/Layout.tsx b/src/components/Layout/Layout.tsx index 86aa98bbc11..4638d637994 100644 --- a/src/components/Layout/Layout.tsx +++ b/src/components/Layout/Layout.tsx @@ -149,8 +149,15 @@ export const Layout = ({ pageHeadings.forEach((node) => { const { innerText, id, localName } = node as HTMLElement; - if (innerText && id && (localName == 'h2' || localName == 'h3')) { + if (innerText && id && localName == 'h2') { headings.push({ + linkText: innerText, + hash: id, + level: localName, + subheadings: [] + }); + } else if (innerText && id && localName == 'h3') { + headings[headings.length - 1].subheadings.push({ linkText: innerText, hash: id, level: localName diff --git a/src/components/TableOfContents/TableOfContents.tsx b/src/components/TableOfContents/TableOfContents.tsx index 041c0a1e724..c415a5575da 100644 --- a/src/components/TableOfContents/TableOfContents.tsx +++ b/src/components/TableOfContents/TableOfContents.tsx @@ -4,6 +4,7 @@ export interface HeadingInterface { linkText: string; hash: string; level: string; + subheadings: Array; } interface TableOfContents { headers?: HeadingInterface[]; @@ -21,20 +22,57 @@ export const TableOfContents = ({ headers }) => { )} {headers.map(({ linkText, hash, level }, index) => { - return ( - - - {linkText} - - - ); + + {linkText} + + + ); + } else { + return ( + + + {linkText} + + + {headers[index].subheadings?.map( + ({ linkText, hash, level }, index) => { + return ( + + + {linkText} + + + ); + } + )} + + + ); + } })} diff --git a/src/fragments/lib-v1/analytics/js/personalize.mdx b/src/fragments/lib-v1/analytics/js/personalize.mdx index 300ad039769..3f5cccc55de 100644 --- a/src/fragments/lib-v1/analytics/js/personalize.mdx +++ b/src/fragments/lib-v1/analytics/js/personalize.mdx @@ -7,7 +7,7 @@ To record event data, you need the following: For more information, see [Record Events](https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html). -### Installation and Configuration +## Installation and Configuration Register the *AmazonPersonalizeProvider* with the Analytics category: You need the tracking ID of your event tracker. For more information, see [Get a Tracking ID](https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html#event-get-tracker). @@ -38,7 +38,7 @@ Analytics.configure({ } }); ``` -### Working with the API +## Working with the API You can use the `Identify` event type to track a user identity. This lets you connect a user to their actions and record traits about them. To identify a user, specify a unique identifier for the userId property. Consider the following user interactions when choosing when and how often to call record with the Identify eventType: diff --git a/src/fragments/lib-v1/auth/native_common/signin_next_steps/common.mdx b/src/fragments/lib-v1/auth/native_common/signin_next_steps/common.mdx index c3310606b28..eaeb26fbbd0 100644 --- a/src/fragments/lib-v1/auth/native_common/signin_next_steps/common.mdx +++ b/src/fragments/lib-v1/auth/native_common/signin_next_steps/common.mdx @@ -10,7 +10,7 @@ import flutter0 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/10_si -### Confirm signin with SMS MFA +## Confirm signin with SMS MFA import ios1 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/20_confirm_sms_mfa.mdx'; @@ -19,7 +19,7 @@ import flutter1 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/20_co -### Confirm signin with TOTP MFA +## Confirm signin with TOTP MFA import flutter7 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/80_totp.mdx'; @@ -27,7 +27,7 @@ import flutter7 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/80_to -### Continue signin with MFA Selection +## Continue signin with MFA Selection import flutter8 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/90_mfa_selection.mdx'; @@ -35,14 +35,14 @@ import flutter8 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/90_mf -### Continue signin with TOTP Setup +## Continue signin with TOTP Setup import flutter9 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/100_totp_setup.mdx'; -### Confirm signin with custom challenge +## Confirm signin with custom challenge import ios2 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/30_confirm_custom_challenge.mdx'; @@ -50,7 +50,7 @@ import flutter2 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/30_co -### Confirm signin with new password +## Confirm signin with new password import ios3 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/40_confirm_new_password.mdx'; @@ -58,7 +58,7 @@ import flutter3 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/40_co -### Reset password +## Reset password import ios4 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/50_reset_password.mdx'; @@ -66,7 +66,7 @@ import flutter4 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/50_re -### Confirm Signup +## Confirm Signup import ios5 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/60_confirm_signup.mdx'; @@ -74,7 +74,7 @@ import flutter5 from '/src/fragments/lib-v1/auth/flutter/signin_next_steps/60_co -### Done +## Done import ios6 from '/src/fragments/lib-v1/auth/ios/signin_next_steps/70_done.mdx'; diff --git a/src/fragments/lib-v1/geo/android/escapehatch.mdx b/src/fragments/lib-v1/geo/android/escapehatch.mdx index eee50df3e9f..88b6772b41b 100644 --- a/src/fragments/lib-v1/geo/android/escapehatch.mdx +++ b/src/fragments/lib-v1/geo/android/escapehatch.mdx @@ -51,7 +51,7 @@ Log.i("MyAmplifyApp", response.entries.toString()) -### Documentation Resources +## Documentation Resources * [How to manage Amazon Location Service resources through console](https://docs.aws.amazon.com/location/latest/developerguide/welcome.html) diff --git a/src/fragments/lib-v1/geo/ios/escapehatch.mdx b/src/fragments/lib-v1/geo/ios/escapehatch.mdx index 9f710cf01ab..70be0439244 100644 --- a/src/fragments/lib-v1/geo/ios/escapehatch.mdx +++ b/src/fragments/lib-v1/geo/ios/escapehatch.mdx @@ -47,7 +47,7 @@ do { } ``` -### Documentation Resources +## Documentation Resources * [How to manage Amazon Location Service resources through console](https://docs.aws.amazon.com/location/latest/developerguide/welcome.html) diff --git a/src/fragments/lib-v1/in-app-messaging/integrate-your-application/integrate-your-application.mdx b/src/fragments/lib-v1/in-app-messaging/integrate-your-application/integrate-your-application.mdx index f30fecd99ed..784c5d40468 100644 --- a/src/fragments/lib-v1/in-app-messaging/integrate-your-application/integrate-your-application.mdx +++ b/src/fragments/lib-v1/in-app-messaging/integrate-your-application/integrate-your-application.mdx @@ -16,7 +16,7 @@ import js1 from '/src/fragments/lib-v1/in-app-messaging/integrate-your-applicati -### Integrate In-App Messaging +## Integrate In-App Messaging Amplify UI provides a Higher-Order Component for ease of integrating the In-App Messaging UI with your application. Simply wrap your application root component in, for example, `App.js`. diff --git a/src/fragments/lib-v1/in-app-messaging/integrate-your-application/js/install-dependencies.mdx b/src/fragments/lib-v1/in-app-messaging/integrate-your-application/js/install-dependencies.mdx index a0f47aad688..26ed63d4294 100644 --- a/src/fragments/lib-v1/in-app-messaging/integrate-your-application/js/install-dependencies.mdx +++ b/src/fragments/lib-v1/in-app-messaging/integrate-your-application/js/install-dependencies.mdx @@ -1,6 +1,6 @@ {/* TODO What should be done with this page for non-react frameworks */} -### Install Amplify UI for React +## Install Amplify UI for React import js0 from '/src/fragments/lib-v1/in-app-messaging/integrate-your-application/ui-integration.mdx'; diff --git a/src/fragments/lib-v1/in-app-messaging/integrate-your-application/react-native/configure-amplify.mdx b/src/fragments/lib-v1/in-app-messaging/integrate-your-application/react-native/configure-amplify.mdx index 170b23dfe39..1d8e2333076 100644 --- a/src/fragments/lib-v1/in-app-messaging/integrate-your-application/react-native/configure-amplify.mdx +++ b/src/fragments/lib-v1/in-app-messaging/integrate-your-application/react-native/configure-amplify.mdx @@ -1,4 +1,4 @@ -### Configure Amplify +## Configure Amplify import rn1 from '/src/fragments/lib-v1/common/react-native/import_configuration.mdx'; diff --git a/src/fragments/lib-v1/in-app-messaging/integrate-your-application/react-native/install-dependencies.mdx b/src/fragments/lib-v1/in-app-messaging/integrate-your-application/react-native/install-dependencies.mdx index 0965237d597..7775307ceca 100644 --- a/src/fragments/lib-v1/in-app-messaging/integrate-your-application/react-native/install-dependencies.mdx +++ b/src/fragments/lib-v1/in-app-messaging/integrate-your-application/react-native/install-dependencies.mdx @@ -2,7 +2,7 @@ import reactnative0 from '/src/fragments/lib-v1/react-native-polyfills.mdx'; -### Install Amplify UI for React Native and its dependencies +## Install Amplify UI for React Native and its dependencies import reactnative1 from '/src/fragments/lib-v1/in-app-messaging/integrate-your-application/ui-integration.mdx'; diff --git a/src/fragments/lib-v1/push-notifications/common/receive-device-token.mdx b/src/fragments/lib-v1/push-notifications/common/receive-device-token.mdx index 88d87abc058..116ae4ca15a 100644 --- a/src/fragments/lib-v1/push-notifications/common/receive-device-token.mdx +++ b/src/fragments/lib-v1/push-notifications/common/receive-device-token.mdx @@ -1,6 +1,6 @@ Push notifications are delivered to your user's devices through a device token which uniquely identifies your app. Although Amplify will automatically register this token with Amazon Pinpoint, it can still be useful to have access to this token for your app's use cases (e.g. to send direct notifications to a specific device). -### onTokenReceived +## onTokenReceived Add `onTokenReceived` listeners to respond to a token being received by your app. diff --git a/src/fragments/lib-v1/react-native-polyfills.mdx b/src/fragments/lib-v1/react-native-polyfills.mdx index 4386092db05..f1e0906c3df 100644 --- a/src/fragments/lib-v1/react-native-polyfills.mdx +++ b/src/fragments/lib-v1/react-native-polyfills.mdx @@ -1,4 +1,4 @@ -### Install Amplify and its dependencies +## Install Amplify and its dependencies ```bash npm install aws-amplify@^5 amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage react-native-get-random-values react-native-url-polyfill diff --git a/src/fragments/lib-v1/storage/android/download.mdx b/src/fragments/lib-v1/storage/android/download.mdx index 26d512c00ba..926fd213d79 100644 --- a/src/fragments/lib-v1/storage/android/download.mdx +++ b/src/fragments/lib-v1/storage/android/download.mdx @@ -1,4 +1,4 @@ -### Download to file +## Download to file If you uploaded the data using the key `ExampleKey`, you can retrieve the data using `Amplify.Storage.downloadFile`. diff --git a/src/fragments/lib-v1/storage/ios/download.mdx b/src/fragments/lib-v1/storage/ios/download.mdx index 7c85b1d6658..e715bc7963a 100644 --- a/src/fragments/lib-v1/storage/ios/download.mdx +++ b/src/fragments/lib-v1/storage/ios/download.mdx @@ -1,6 +1,6 @@ There are three ways of getting data that was previously uploaded: -### Download data +## Download data You can download to in-memory buffer [Data](https://developer.apple.com/documentation/foundation/data) object with `Amplify.Storage.downloadData`: @@ -46,7 +46,7 @@ receiveValue: { data in -### Download to file +## Download to file You can download to a file [URL](https://developer.apple.com/documentation/foundation/url) with `Amplify.Storage.downloadFile`: diff --git a/src/fragments/lib-v1/storage/js/autotrack.mdx b/src/fragments/lib-v1/storage/js/autotrack.mdx index aecdfd931c7..b25c10a47ee 100644 --- a/src/fragments/lib-v1/storage/js/autotrack.mdx +++ b/src/fragments/lib-v1/storage/js/autotrack.mdx @@ -8,13 +8,13 @@ You can enable automatic tracking of Storage Events such as uploads and download the event, e.g. *Storage {'>'} Method {'>'} Put*. -### Track all the Storage events +## Track all the Storage events ```javascript Storage.configure({ track: true }); ``` -### Track a specific storage action +## Track a specific storage action ```javascript Storage.get('welcome.png', { track: true }); diff --git a/src/fragments/lib/analytics/js/personalize.mdx b/src/fragments/lib/analytics/js/personalize.mdx index 87aebc29bc3..247ad480e41 100644 --- a/src/fragments/lib/analytics/js/personalize.mdx +++ b/src/fragments/lib/analytics/js/personalize.mdx @@ -7,7 +7,7 @@ To record event data, you need the following: For more information, see [Record Events](https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html). -### Installation and Configuration +## Installation and Configuration After creating the Amazon Personalize dataset group, you need to add the `personalize:PutEvents` permission to your Amplify IAM user roles. @@ -49,7 +49,7 @@ Amplify.configure({ } }); ``` -### Working with the API +## Working with the API You can use the `Identify` event type to track a user identity. This lets you connect a user to their actions and record traits about them. To identify a user, specify a unique identifier for the userId property. Consider the following user interactions when choosing when and how often to call record with the Identify eventType: diff --git a/src/fragments/lib/auth/android/signin_next_steps/80_current_user.mdx b/src/fragments/lib/auth/android/signin_next_steps/80_current_user.mdx index fdbef661b2d..607c30f52a8 100644 --- a/src/fragments/lib/auth/android/signin_next_steps/80_current_user.mdx +++ b/src/fragments/lib/auth/android/signin_next_steps/80_current_user.mdx @@ -1,4 +1,4 @@ -### Get Current User +## Get Current User This call fetches the current logged in user and should be used after a user has been successfully signed in. If the user is signed in, it will return the current userId and username. diff --git a/src/fragments/lib/auth/flutter/access_credentials/10_fetchAuthSession.mdx b/src/fragments/lib/auth/flutter/access_credentials/10_fetchAuthSession.mdx index 34434da6f25..710e6c668af 100644 --- a/src/fragments/lib/auth/flutter/access_credentials/10_fetchAuthSession.mdx +++ b/src/fragments/lib/auth/flutter/access_credentials/10_fetchAuthSession.mdx @@ -11,7 +11,7 @@ Future fetchAuthSession() async { } ``` -### Retrieving AWS credentials +## Retrieving AWS credentials Sometimes it can be helpful to retrieve the instance of the underlying plugin which has more specific typing. In the case of Cognito, calling `fetchAuthSession` diff --git a/src/fragments/lib/auth/native_common/signin_next_steps/common.mdx b/src/fragments/lib/auth/native_common/signin_next_steps/common.mdx index 8c615f36156..0f1ab188ea9 100644 --- a/src/fragments/lib/auth/native_common/signin_next_steps/common.mdx +++ b/src/fragments/lib/auth/native_common/signin_next_steps/common.mdx @@ -19,7 +19,7 @@ import flutter0 from '/src/fragments/lib/auth/flutter/signin_next_steps/10_signi -### Confirm signin with SMS MFA +## Confirm signin with SMS MFA import ios1 from '/src/fragments/lib/auth/ios/signin_next_steps/20_confirm_sms_mfa.mdx'; @@ -33,7 +33,7 @@ import flutter1 from '/src/fragments/lib/auth/flutter/signin_next_steps/20_confi -### Confirm signin with TOTP MFA +## Confirm signin with TOTP MFA If the next step is `CONFIRM_SIGN_IN_WITH_TOTP_CODE`, you should prompt the user to enter the TOTP code from their associated authenticator app during set up. The code is a six-digit number that changes every 30 seconds. The user must enter the code before the 30-second window expires. @@ -167,7 +167,7 @@ Future confirmTotpUser(String totpCode) async { -### Continue signin with MFA Selection +## Continue signin with MFA Selection If the next step is `CONTINUE_SIGN_IN_WITH_MFA_SELECTION`, the user must select the MFA method to use. Amplify Auth currently only supports SMS and TOTP as MFA methods. After the user selects an MFA method, your implementation must pass the selected MFA method to Amplify Auth using `confirmSignIn` API. @@ -288,7 +288,7 @@ Future _handleMfaSelection(MfaType selection) async { -### Continue signin with TOTP Setup +## Continue signin with TOTP Setup If the next step is `CONTINUE_SIGN_IN_WITH_TOTP_SETUP`, then the user must provide a TOTP code to complete the sign in process. The step returns an associated value of type `TOTPSetupDetails` which would be used for generating TOTP. `TOTPSetupDetails` provides a helper method called `getSetupURI` that can be used to generate a URI, which can be used by native password managers for TOTP association. For example. if the URI is used on Apple platforms, it will trigger the platform's native password manager to associate TOTP with the account. For more advanced use cases, `TOTPSetupDetails` also contains the `sharedSecret` that will be used to either generate a QR code or can be manually entered into an authenticator app. @@ -476,7 +476,7 @@ Future confirmTotpUser(String totpCode) async { -### Confirm signin with custom challenge +## Confirm signin with custom challenge import ios2 from '/src/fragments/lib/auth/ios/signin_next_steps/30_confirm_custom_challenge.mdx'; @@ -490,7 +490,7 @@ import flutter2 from '/src/fragments/lib/auth/flutter/signin_next_steps/30_confi -### Confirm signin with new password +## Confirm signin with new password import ios3 from '/src/fragments/lib/auth/ios/signin_next_steps/40_confirm_new_password.mdx'; @@ -504,7 +504,7 @@ import flutter3 from '/src/fragments/lib/auth/flutter/signin_next_steps/40_confi -### Reset password +## Reset password import ios4 from '/src/fragments/lib/auth/ios/signin_next_steps/50_reset_password.mdx'; @@ -518,7 +518,7 @@ import flutter4 from '/src/fragments/lib/auth/flutter/signin_next_steps/50_reset -### Confirm Signup +## Confirm Signup import ios5 from '/src/fragments/lib/auth/ios/signin_next_steps/60_confirm_signup.mdx'; @@ -536,7 +536,7 @@ import flutter5 from '/src/fragments/lib/auth/flutter/signin_next_steps/60_confi -### Done +## Done import ios6 from '/src/fragments/lib/auth/ios/signin_next_steps/70_done.mdx'; diff --git a/src/fragments/lib/geo/android/escapehatch.mdx b/src/fragments/lib/geo/android/escapehatch.mdx index 335a5605f43..564f203c85f 100644 --- a/src/fragments/lib/geo/android/escapehatch.mdx +++ b/src/fragments/lib/geo/android/escapehatch.mdx @@ -74,7 +74,7 @@ Log.i("MyAmplifyApp", response.entries.toString()) -### Documentation Resources +## Documentation Resources * [How to manage Amazon Location Service resources through console](https://docs.aws.amazon.com/location/latest/developerguide/welcome.html) diff --git a/src/fragments/lib/geo/ios/escapehatch.mdx b/src/fragments/lib/geo/ios/escapehatch.mdx index d0b54d22fe2..85113283ea5 100644 --- a/src/fragments/lib/geo/ios/escapehatch.mdx +++ b/src/fragments/lib/geo/ios/escapehatch.mdx @@ -29,7 +29,7 @@ do { } ``` -### Documentation Resources +## Documentation Resources - [How to manage Amazon Location Service resources through console](https://docs.aws.amazon.com/location/latest/developerguide/welcome.html) diff --git a/src/fragments/lib/graphqlapi/ios/upgrade-guide.mdx b/src/fragments/lib/graphqlapi/ios/upgrade-guide.mdx index 719971cdb00..1e3250514a2 100644 --- a/src/fragments/lib/graphqlapi/ios/upgrade-guide.mdx +++ b/src/fragments/lib/graphqlapi/ios/upgrade-guide.mdx @@ -66,10 +66,10 @@ do { } ``` -### Optimistic UI and cached data revalidation +## Optimistic UI and cached data revalidation If you've used the AWS AppSync SDK's caching capabilities for optimistic UI, then we recommend you to follow our [Optimistic UI](/gen1/[platform]/build-a-backend/graphqlapi/optimistic-ui/) guide. In this guide, you'll learn how to use AWS Amplify's API category in conjunction with SwiftUI to achieve optimistic UI and cached data invalidation use cases. -### Complex objects support +## Complex objects support If you were using complex objects in the AWS AppSync SDK for iOS (Maintenance mode), then we recommend you to follow our [Working with Files](/gen1/[platform]/build-a-backend/graphqlapi/working-with-files) guide. This guide details the recommended path to store file metadata in your GraphQL API records and use Amplify Storage to store blob data in Amazon S3. diff --git a/src/fragments/lib/in-app-messaging/integrate-your-application/integrate-your-application.mdx b/src/fragments/lib/in-app-messaging/integrate-your-application/integrate-your-application.mdx index 7075de6f09e..3701f39833e 100644 --- a/src/fragments/lib/in-app-messaging/integrate-your-application/integrate-your-application.mdx +++ b/src/fragments/lib/in-app-messaging/integrate-your-application/integrate-your-application.mdx @@ -4,7 +4,7 @@ In your application directory, you should first install the necessary dependenci npm install aws-amplify ``` -### Initialize In-App Messaging +## Initialize In-App Messaging To finish setting up your application with Amplify, you need to configure it using the `configure` API. Next, to interact with In-App Messaging APIs, you need to first initialize In-App Messaging by calling the `initializeInAppMessaging` API directly imported from the `in-app-messaging` sub-path. This is required to be called as early as possible in the app lifecycle. @@ -29,7 +29,7 @@ import js0 from '/src/fragments/lib/in-app-messaging/integrate-your-application/ -### Integrate Amplify UI +## Integrate Amplify UI Amplify UI provides a Higher-Order Component for ease of integrating the In-App Messaging UI with your application. Simply wrap your application root component in, for example, `App.js`. diff --git a/src/fragments/lib/in-app-messaging/integrate-your-application/js/install-ui-dependencies.mdx b/src/fragments/lib/in-app-messaging/integrate-your-application/js/install-ui-dependencies.mdx index a8f06c5716c..80883dad9d5 100644 --- a/src/fragments/lib/in-app-messaging/integrate-your-application/js/install-ui-dependencies.mdx +++ b/src/fragments/lib/in-app-messaging/integrate-your-application/js/install-ui-dependencies.mdx @@ -1,6 +1,6 @@ {/* TODO What should be done with this page for non-react frameworks */} -### Install Amplify UI for React +## Install Amplify UI for React import js0 from '/src/fragments/lib/in-app-messaging/integrate-your-application/ui-integration.mdx'; diff --git a/src/fragments/lib/in-app-messaging/integrate-your-application/react-native/install-dependencies.mdx b/src/fragments/lib/in-app-messaging/integrate-your-application/react-native/install-dependencies.mdx index db8c2e07ef5..1aacbf80a69 100644 --- a/src/fragments/lib/in-app-messaging/integrate-your-application/react-native/install-dependencies.mdx +++ b/src/fragments/lib/in-app-messaging/integrate-your-application/react-native/install-dependencies.mdx @@ -1,4 +1,4 @@ -### Install the Amplify React Native Package and other dependencies +## Install the Amplify React Native Package and other dependencies Installing the `@aws-amplify/react-native` will bring in the necessary polyfills. import rnVersionCallout from '/src/fragments/common/react-native-version-deployment-target.mdx'; @@ -9,7 +9,7 @@ import rnVersionCallout from '/src/fragments/common/react-native-version-deploym npm install @aws-amplify/react-native @react-native-community/netinfo @react-native-async-storage/async-storage ``` -### Install Amplify UI for React Native and its dependencies +## Install Amplify UI for React Native and its dependencies import reactnative1 from '/src/fragments/lib/in-app-messaging/integrate-your-application/ui-integration.mdx'; diff --git a/src/fragments/lib/logging/common/access_logs/access_logs.mdx b/src/fragments/lib/logging/common/access_logs/access_logs.mdx index cae5a69cecc..bcec9e381de 100644 --- a/src/fragments/lib/logging/common/access_logs/access_logs.mdx +++ b/src/fragments/lib/logging/common/access_logs/access_logs.mdx @@ -3,7 +3,7 @@ For an authenticated user, the log stream name is `. -### Track download progress +## Track download progress To track progress of the download, use the `downloadFile` API that includes a progress listener callback. @@ -264,7 +264,7 @@ download -### Generate a download URL +## Generate a download URL You can also retrieve a URL for the object in storage: diff --git a/src/fragments/sdk/api/android/graphql.mdx b/src/fragments/sdk/api/android/graphql.mdx index 1da60b2fb84..d2a4ab50ca8 100644 --- a/src/fragments/sdk/api/android/graphql.mdx +++ b/src/fragments/sdk/api/android/graphql.mdx @@ -8,7 +8,7 @@ You can integrate with AWS AppSync using the following steps: The Amplify CLI provides support for AppSync that make this process easy. Using the CLI, you can configure an AWS AppSync API, download required client side configuration files, and generate client side code within minutes by running a few simple commands on the command line. -### Configuration +## Configuration The AWS SDKs support configuration through a centralized file called `awsconfiguration.json` that defines your AWS regions and service endpoints. You obtain this file in one of two ways, depending on whether you are creating your AppSync API in the AppSync console or using the Amplify CLI. @@ -16,11 +16,11 @@ The AWS SDKs support configuration through a centralized file called `awsconfigu - If you are creating your API with the Amplify CLI (using `amplify add api`), the `awsconfiguration.json` file is automatically downloaded and updated each time you run `amplify push` to update your cloud resources. The file is placed in the `./app/src/main/res/raw` directory of your Android Studio project. -### Code Generation +## Code Generation To execute GraphQL operations in Android you need to run a code generation process, which requires both the GraphQL schema and the statements (for example, queries, mutations, or subscriptions) that your client defines. The Amplify CLI toolchain makes this easy for you by automatically pulling down your schema and generating default GraphQL queries, mutations, and subscriptions before kicking off the code generation process using Gradle. If your client requirements change, you can alter these GraphQL statements and kick off a Gradle build again to regenerate the types. -#### AppSync APIs Created in the Console +### AppSync APIs Created in the Console After installing the Amplify CLI open a terminal, go to your Android Studio project root, and then run the following: @@ -33,7 +33,7 @@ The `XXXXXX` is the unique AppSync API identifier that you can find in the conso **Note:** It is not necessary to run the command `amplify codegen` after adding an API, as code generation is done by the Gradle build process. However, if you subsequently update your API in the AppSync Console, you will need to re-run `amplify codegen` to update the local `schema.json` and `.graphql` with the modified schema. -#### AppSync APIs Created Using the CLI +### AppSync APIs Created Using the CLI Navigate in your terminal to an Android Studio project directory and run the following: @@ -83,7 +83,7 @@ amplify console api When prompted, select **GraphQL**. This will open the AWS AppSync console for you to run Queries, Mutations, or Subscriptions at the server and see the changes in your client app. -### Import SDK and Config +## Import SDK and Config To use AppSync in your Android studio project, modify the project's `build.gradle` by adding the Maven plugin repositories, and the AppSync Gradle plugin to `dependencies`. @@ -154,11 +154,11 @@ Finally, update your AndroidManifest.xml with updates to `` fo ``` -### Build your Project +## Build your Project Do not skip this step! Run `gradlew build`, or build your application via Android Studio. This will trigger the AppSync Gradle plugin that you added above to generate Java classes in your build folder based off of your schema files. These classes will be needed before proceeding to the steps below. -### Client Initialization +## Client Initialization Inside your application code, such as the `onCreate()` lifecycle method of your activity class, you can initialize the AppSync client using an instance of `AWSConfiguration()` in the `AWSAppSyncClient` builder like the following: @@ -180,7 +180,7 @@ protected void onCreate(Bundle savedInstanceState) { `AWSConfiguration()` reads configuration information in the `awsconfiguration.json` file. By default, the information in the `Default` section of the json file is used. -### Run a Query +## Run a Query Now that the client is configured, you can run a GraphQL query. The syntax of the callback is `GraphQLCall.Callback<{NAME}Query.Data>` where `{NAME}` comes from the GraphQL statements that `amplify codegen` created after you ran a Gradle build. You invoke this from an instance of the AppSync client with a similar syntax of `.query({NAME}Query.builder().build())`. For example, if you have a `ListTodos` query, your code will look like the following: @@ -206,7 +206,7 @@ private GraphQLCall.Callback todosCallback = new GraphQLCal Optionally, you can change the cache policy on `AppSyncResponseFetchers`, but we recommend leaving `CACHE_AND_NETWORK` because it pulls results from the local cache first before retrieving data over the network. This gives a snappy UX and offline support. -### Run a Mutation +## Run a Mutation To add data you need to run a GraphQL mutation. The syntax of the callback is `GraphQLCall.Callback<{NAME}Mutation.Data>` where `{NAME}` comes from the GraphQL statements that `amplify codegen` created after a Gradle build. However, most GraphQL schemas organize mutations with an `input` type for maintainability, which is what the Amplify CLI does as well. Therefore you'll pass this as a parameter called `input` created with a second builder. You invoke this from an instance of the AppSync client with a similar syntax of `.mutate({NAME}Mutation.builder().input({Name}Input).build())` like the following: @@ -234,7 +234,7 @@ private GraphQLCall.Callback mutationCallback = new Gra }; ``` -### Subscribe to Data +## Subscribe to Data Finally, it's time to set up a subscription to real-time data. The callback is just `AppSyncSubscriptionCall.Callback` and you invoke it with a client `.subscribe()` call and pass in a builder with syntax of `{NAME}Subscription.builder()` where `{NAME}` comes from the GraphQL statements that `amplify codegen` and Gradle build created. Note that the AppSync console and Amplify GraphQL transformer have a common nomenclature that puts the word `On` in front of a subscription as in the following example: @@ -267,7 +267,7 @@ private AppSyncSubscriptionCall.Callback subCallb Subscriptions can also take input types like mutations, in which case they will be subscribing to particular events based on the input. -### Background Tasks +## Background Tasks All GraphQL operations in the Android client are automatically run as asynchronous tasks and can be safely called from any thread. If you have a need to run GraphQL operations from a background thread you can do it with a `Runnable()` like the example below: @@ -318,7 +318,7 @@ try { } ``` -### Client Architecture +## Client Architecture The AppSync client supports offline scenarios with a programming model that provides a "write through cache". This allows you to both render data in the UI when offline as well as add/update through an "optimistic response". The below diagram shows how the AppSync client interfaces with the network GraphQL calls, it's offline mutation queue, the Apollo cache, and your application code. @@ -362,7 +362,7 @@ AWSAppSyncClient.builder() If you are performing a mutation, you can write an “optimistic response” anytime to this cache even if you are offline. You use the AppSync client to connect by passing in the query to update, reading the items off the cache. This normally returns a single item or list of items, depending on the GraphQL response type of the query to update. At this point you would add to the list, remove, or update it as appropriate and write back the response to the store persisting it to disk. When you reconnect to the network any responses from the service will overwrite the changes as the authoritative response. -#### Offline Mutations +### Offline Mutations As outlined in the architecture section, all query results are automatically persisted to disc with the AppSync client. For updating data through mutations when offline you will need to use an "optimistic response" by writing directly to the store. This is done by querying the store directly with `client.query().responseFetcher()` and passing in `AppSyncResponseFetchers.CACHE_ONLY` to pull the records for a specific query that you wish to update. @@ -449,11 +449,11 @@ private AWSAppSyncClient mAWSAppSyncClient = AWSAppSyncClient.builder() .build(); ``` -### Authorization Modes +## Authorization Modes For client authorization AppSync supports API Keys, Amazon IAM credentials (we recommend using Amazon Cognito Identity Pools for this option), Amazon Cognito User Pools, and 3rd party OIDC providers. This is inferred from the `awsconfiguration.json` when you call `.awsConfiguration()` on the `AWSAppSyncClient` builder. -#### API Key +### API Key API Key is the easiest way to setup and prototype your application with AppSync. It's also a good option if your application is completely public. If your application needs to interact with other AWS services besides AppSync, such as S3, you will need to use IAM credentials provided by Cognito Identity Pools, which also supports "Guest" access. See [the authentication section for more details](/gen1/[platform]/sdk/auth/getting-started/). For manual configuration, add the following snippet to your `awsconfiguration.json` file: @@ -479,7 +479,7 @@ private AWSAppSyncClient mAWSAppSyncClient = AWSAppSyncClient.builder() .build(); ``` -#### Cognito User Pools +### Cognito User Pools Amazon Cognito User Pools is the most common service to use with AppSync when adding user Sign-Up and Sign-In to your application. If your application needs to interact with other AWS services besides AppSync, such as S3, you will need to use IAM credentials with Cognito Identity Pools. The Amplify CLI can automatically configure this for you when running `amplify add auth` and can also automatically federate User Pools with Identity Pools. This allows you to have both User Pool credentials for AppSync and AWS credentials for S3. You can then use the `AWSMobileClient` for automatic credentials refresh [as outlined in the authentication section](/gen1/[platform]/sdk/auth/getting-started/). For manual configuration, add the following snippet to your `awsconfiguration.json` file: @@ -521,7 +521,7 @@ private AWSAppSyncClient mAWSAppSyncClient = AWSAppSyncClient.builder() }).build(); ``` -#### IAM +### IAM When using AWS IAM in a mobile application you should leverage Amazon Cognito Identity Pools. The Amplify CLI can automatically configure this for you when running `amplify add auth`. You can then use the `AWSMobileClient` for automatic credentials refresh [as outlined in the authentication section](/gen1/[platform]/sdk/auth/getting-started/) For manual configuration, add the following snippet to your `awsconfiguration.json` file: @@ -555,7 +555,7 @@ private AWSAppSyncClient mAWSAppSyncClient = AWSAppSyncClient.builder() .build(); ``` -#### OIDC +### OIDC If you are using a 3rd party OIDC provider you will need to configure it and manage the details of token refreshes yourself. Update the `awsconfiguration.json` file and code snippet as follows: @@ -592,7 +592,7 @@ private static String MyOIDCAuthProvider(){ } ``` -#### Multi-Auth +### Multi-Auth This section talks about the capability of AWS AppSync to configure multiple authorization modes for a single AWS AppSync endpoint and region. Follow the [AWS AppSync Multi-Auth](https://docs.aws.amazon.com/appsync/latest/devguide/security.html#using-additional-authorization-modes) to configure multiple authorization modes for your AWS AppSync endpoint. @@ -800,7 +800,7 @@ public class ClientFactory { } ``` -### Clear cache +## Clear cache Clears the data cached by the `AWSAppSyncClient` object on the local device. @@ -827,7 +827,7 @@ try { } ``` -### Delta Sync +## Delta Sync DeltaSync allows you to perform automatic synchronization with an AWS AppSync GraphQL server. The client will perform reconnection, exponential backoff, and retries when network errors take place for simplified data replication to devices. It does this by taking the results of a GraphQL query and caching it in the local Apollo cache. The DeltaSync API manages writes to the Apollo cache for you, and all rendering in your app (such as from React components, Angular bindings) should be done through a read-only fetch. diff --git a/src/fragments/sdk/api/ios/graphql.mdx b/src/fragments/sdk/api/ios/graphql.mdx index 7f3011ee440..88f07cea37b 100644 --- a/src/fragments/sdk/api/ios/graphql.mdx +++ b/src/fragments/sdk/api/ios/graphql.mdx @@ -8,7 +8,7 @@ You can integrate with AWS AppSync using the following steps: The Amplify CLI provides support for AppSync that make this process easy. Using the CLI, you can configure an AWS AppSync API, download required client side configuration files, and generate client side code within minutes by running a few simple commands on the command line. -### Configuration +## Configuration The AWS SDKs support configuration through a centralized file called `awsconfiguration.json` that defines your AWS regions and service endpoints. You obtain this file in one of two ways, depending on whether you are creating your AppSync API in the AppSync console or using the Amplify CLI. @@ -16,11 +16,11 @@ The AWS SDKs support configuration through a centralized file called `awsconfigu - If you are creating your API with the Amplify CLI (using `amplify add api`), the `awsconfiguration.json` file is automatically downloaded and updated each time you run `amplify push` to update your cloud resources. The file is placed in the root directory of your iOS project, and you need to add it to your Xcode project. -### Code Generation +## Code Generation To execute GraphQL operations in iOS you need to run a code generation process, which requires both the GraphQL schema and the statements (for example, queries, mutations, or subscriptions) that your client defines. The Amplify CLI toolchain helps you do this by automatically pulling down your schema and generating default GraphQL queries, mutations, and subscriptions before kicking off the code generation process. If your client requirements change, you can alter these GraphQL statements and regenerate your types. -#### AppSync APIs Created in the Console +### AppSync APIs Created in the Console After installing the Amplify CLI open a terminal, go to your Xcode project root, and then run the following: @@ -31,7 +31,7 @@ amplify add codegen --apiId XXXXXX The `XXXXXX` is the unique AppSync API identifier that you can find in the console in the root of your API's integration page. When you run this command you can accept the defaults, which create an `API.swift` file, and a `graphql` folder with your statements, in your root directory. -#### AppSync APIs Created Using the CLI +### AppSync APIs Created Using the CLI Navigate in your terminal to an Xcode project directory and run the following: @@ -81,7 +81,7 @@ amplify console api When prompted, select **GraphQL**. This will open the AWS AppSync console for you to run Queries, Mutations, or Subscriptions at the server and see the changes in your client app. -### Import SDK and Config +## Import SDK and Config To use AppSync in your Xcode project, modify your Podfile with a dependency of the AWS AppSync SDK as follows: @@ -94,7 +94,7 @@ end Run `pod install` from your terminal and open up the `.xcworkspace` Xcode project. Add the `API.swift` and `awsconfiguration.json` files to your project **(File->Add Files to ..->Add)** and then build your project, ensuring there are no issues. -### Client Initialization +## Client Initialization Initialize the AppSync client your application delegate by creating `AWSAppSyncClientConfiguration` and `AWSAppSyncClient` like the following: @@ -167,7 +167,7 @@ struct ContentView: View { } ``` -### Run a Query +## Run a Query Now that the client is set up, you can run a GraphQL query. The syntax is `appSyncClient?.fetch(query: Query() {(result, error)})` where `` comes from the GraphQL statements that `amplify codegen` created. For example, if you have a `ListTodos` query your code will look like the following: @@ -190,7 +190,7 @@ appSyncClient?.fetch(query: ListTodosQuery(), cachePolicy: .returnCacheDataAndFe `returnCacheDataAndFetch` pulls results from the local cache first before retrieving data over the network. This gives a snappy UX and offline support. -#### Considerations for SwiftUI +### Considerations for SwiftUI When using `List` and `ForEach` for SwiftUI the structure needs to conform to `Identifiable`. The code generated for Swift does not make the structure `Identifiable` but as long as you have a unique id associated with the object then you can retroactively mark a field as unique. Here is some example code for `ListTodosQuery()` @@ -201,7 +201,7 @@ ForEach(listTodosStore.listTodos.identified(by:\.id)){ todo in ``` -### Run a Mutation +## Run a Mutation To add data you need to run a GraphQL mutation. The syntax is `appSyncClient?.perform(mutation: Mutation() {(result, error)})` where `` comes from the GraphQL statements that `amplify codegen` created. However, most GraphQL schemas organize mutations with an `input` type for maintainability, which is what the AppSync console and Amplify CLI do as well. Therefore, you need to pass this as a parameter called `input`, as in the following example: @@ -219,11 +219,11 @@ appSyncClient?.perform(mutation: CreateTodoMutation(input: mutationInput)) { (re } ``` -#### Working with Complex Objects +### Working with Complex Objects Sometimes you might want to create logical objects that have more complex data, such as images or videos, as part of their structure. For example, you might create a Person type with a profile picture or a Post type that has an associated image. You can use AWS AppSync to model these as GraphQL types and [automatically store them to S3](/gen1/[platform]/sdk/storage/graphql-api/). -### Subscribe to Data +## Subscribe to Data Finally, it's time to set up a subscription to real-time data. The syntax `appSyncClient?.subscribe(subscription: Subscription() {(result, transaction, error)})` where `` comes from the GraphQL statements that `amplify codegen` created. Note that the AppSync console and Amplify GraphQL transformer have a common nomenclature that puts the word `On` in front of a subscription as in the following example: @@ -252,7 +252,7 @@ do { Like mutations, subscriptions can also take input types, in which case they will be subscribing to particular events based on the input. To learn more about subscription arguments, see [AWS AppSync Subscription Arguments](https://docs.aws.amazon.com/appsync/latest/devguide/real-time-data.html#using-subscription-arguments). -### Client Architecture +## Client Architecture The AppSync client supports offline scenarios with a programming model that provides a "write through cache". This allows you to both render data in the UI when offline as well as add/update through an "optimistic response". The below diagram shows how the AppSync client interfaces with the network GraphQL calls, its offline mutation queue, the Apollo cache, and your application code. @@ -281,7 +281,7 @@ appSyncClient?.apolloClient?.cacheKeyForObject = { $0["id"] } If you are performing a mutation, you can write an “optimistic response” anytime to this cache even if you are offline. You use the AppSync client to connect by passing in the query to update, reading the items off the cache. This normally returns a single item or list of items, depending on the GraphQL response type of the query to update. At this point you would add to the list, remove, or update it as appropriate and write back the response to the store persisting it to disk. When you reconnect to the network any responses from the service will overwrite the changes as the authoritative response. -#### Offline Mutations +### Offline Mutations As outlined in the architecture section, all query results are automatically persisted to disc with the AppSync client. For updating data through mutations when offline you will need to use an "optimistic response" with a transaction. This is done by passing an `optimisticUpdate` in the `appSyncClient?.perform()` mutation method using a `transaction`, where you pass in a query that will be updated in the cache. Inside of this transaction, you can write to the store via `appSyncClient?.store?.withinReadWriteTransaction`. @@ -341,11 +341,11 @@ func optimisticCreateTodo(input: CreateTodoInput, query:ListTodosQuery) { You might add similar code in your app for updating or deleting items using an optimistic response, it would look largely similar except that you might overwrite or remove an element from the `data.listTodos?.items` array. -### Authorization Modes +## Authorization Modes For client authorization AppSync supports API Keys, Amazon IAM credentials (we recommend using Amazon Cognito Identity Pools for this option), Amazon Cognito User Pools, and 3rd party OIDC providers. This is inferred from the `awsconfiguration.json` file when you call `AWSAppSyncClientConfiguration(appSyncServiceConfig: AWSAppSyncServiceConfig()`. -#### API Key +### API Key API Key is the easiest way to setup and prototype your application with AppSync. It's also a good option if your application is completely public. If your application needs to interact with other AWS services besides AppSync, such as S3, you will need to use IAM credentials provided by Cognito Identity Pools, which also supports "Guest" access. See [the authentication section for more details](/gen1/[platform]/sdk/auth/). For manual configuration, add the following snippet to your `awsconfiguration.json` file: @@ -379,7 +379,7 @@ do { } ``` -#### Cognito User Pools +### Cognito User Pools Amazon Cognito User Pools is the most common service to use with AppSync when adding user Sign-Up and Sign-In to your application. If your application needs to interact with other AWS services besides AppSync, such as S3, you will need to use IAM credentials with Cognito Identity Pools. The Amplify CLI can automatically configure this for you when running `amplify add auth` and can also automatically federate User Pools with Identity Pools. This allows you to have both User Pool credentials for AppSync and AWS credentials for S3. You can then use the `AWSMobileClient` for automatic credentials refresh [as outlined in the authentication section](/gen1/[platform]/sdk/auth/). For manual configuration, add the following snippet to your `awsconfiguration.json` file: @@ -438,7 +438,7 @@ class MyCognitoUserPoolsAuthProvider : AWSCognitoUserPoolsAuthProviderAsync { } ``` -#### IAM +### IAM When using AWS IAM in a mobile application you should leverage Amazon Cognito Identity Pools. The Amplify CLI can automatically configure this for you when running `amplify add auth`. You can then use the `AWSMobileClient` for automatic credentials refresh [as outlined in the authentication section](/gen1/[platform]/sdk/auth/) For manual configuration, add the following snippet to your `awsconfiguration.json` file: @@ -480,7 +480,7 @@ do { } ``` -#### OIDC +### OIDC If you are using a 3rd party OIDC provider you will need to configure it and manage the details of token refreshes yourself. Update the `awsconfiguration.json` file and code snippet as follows: @@ -521,7 +521,7 @@ do { } ``` -#### Multi-Auth +### Multi-Auth This section talks about the capability of AWS AppSync to configure multiple authorization modes for a single AWS AppSync endpoint and region. Follow the [AWS AppSync Multi-Auth](https://docs.aws.amazon.com/appsync/latest/devguide/security.html#using-additional-authorization-modes) to configure multiple authorization modes for your AWS AppSync endpoint. @@ -683,7 +683,7 @@ appSyncClient?.fetch(query: GetPostQuery()) { (result, error) in } ``` -### Clear cache +## Clear cache Clears the data cached by the `AWSAppSyncClient` object on the local device. @@ -703,7 +703,7 @@ let clearCacheOptions = ClearCacheOptions( appSyncClient.clearCaches(options: clearCacheOptions) ``` -### Delta Sync +## Delta Sync DeltaSync allows you to perform automatic synchronization with an AWS AppSync GraphQL server. The client will perform reconnection, exponential backoff, and retries when network errors take place for simplified data replication to devices. It does this by taking the results of a GraphQL query and caching it in the local Apollo cache. diff --git a/src/fragments/sdk/auth/android/federated-identities.mdx b/src/fragments/sdk/auth/android/federated-identities.mdx index 5d95a9d863f..18b6934da4e 100644 --- a/src/fragments/sdk/auth/android/federated-identities.mdx +++ b/src/fragments/sdk/auth/android/federated-identities.mdx @@ -1,6 +1,6 @@ Currently, the federation feature in the AWSMobileClient supports Cognito Identity Pools only. -### Federated Sign In +## Federated Sign In ```java AWSMobileClient.getInstance().federatedSignIn(IdentityProvider.FACEBOOK.toString(), "FACEBOOK_TOKEN_HERE", new Callback() { @@ -20,7 +20,7 @@ AWSMobileClient.getInstance().federatedSignIn(IdentityProvider.FACEBOOK.toString The API calls to get AWS credentials will be asynchronously blocked until you fetch the social provider's token and give it to `AWSMobileClient`. Once you pass the tokens, the `AWSMobileClient` will fetch AWS Credentials using the new tokens and unblock all waiting calls. It will then use the new credentials. -#### SAML with Cognito Identity +### SAML with Cognito Identity To federate your SAML sign-in provider as a user sign-in provider for AWS services called in your app, you will pass tokens to `AWSMobileClient.getInstance().federatedSignIn()`. You must first register your SAML application with AWS IAM by using the following [instructions](https://docs.aws.amazon.com/cognito/latest/developerguide/saml-identity-provider.html). @@ -60,7 +60,7 @@ AWSMobileClient.getInstance().federatedSignIn("YOUR_SAML_PROVIDER_NAME", "YOUR_S }); ``` -### Set up Facebook +## Set up Facebook To federate Facebook as a user sign-in provider for AWS services called in your app, you will pass tokens to `AWSMobileClient.getInstance().federatedSignIn()`. You must first register your application with Facebook by using the [Facebook Developers portal](https://developers.facebook.com/) and configure this with Amazon Cognito Identity Pools. @@ -111,7 +111,7 @@ You can now [configure Facebook in your mobile app](#facebook-login-in-your-mobi Note that the CLI allows you to select more than one identity provider for your app. You can also run `amplify auth update` to add an identity provider to an existing auth configuration. -### Set up Google +## Set up Google To federate Google as a user sign-in provider for AWS services called in your app, you will pass tokens to `AWSMobileClient.getInstance().federatedSignIn()`. You must first register your application with Google Sign-In in the Google Developers Console, and then configure this with Amazon Cognito Identity Pools. @@ -156,7 +156,7 @@ You can now [configure Google in your mobile app](#google-login-in-your-mobile-a > Note that the CLI allows you to select more than one identity provider for your app. You can also run `amplify update auth` to add an identity provider to an existing auth configuration. -### Set up Sign in with Apple +## Set up Sign in with Apple To federate Sign in with Apple as a user sign-in provider for AWS services called in your app, you will pass tokens to `AWSMobileClient.getInstance().federatedSignIn()`. You must set up your application to use Sign in with Apple, and then configure Amazon Cognito Identity Pools to use Apple as an authentication provider. There are three main steps to setting up Sign in with Apple: implementing Sign in with Apple in your app, configuring Sign in with Apple as an authentication provider in your Amazon Cognito Identity Pool, and passing the Sign in with Apple token to AWSMobileClient via `federatedSignIn`. @@ -197,7 +197,7 @@ To federate Sign in with Apple as a user sign-in provider for AWS services calle After the `federatedSignIn` method successfully completes, `AWSMobileClient` will automatically use the federated identity to obtain credentials to make AWS service calls. -### Facebook Login in Your Mobile App +## Facebook Login in Your Mobile App > **Use Android API level 23 or higher** The `AWSMobileClient` library for Android sign-in provides the activity and view for presenting a `SignInUI` for the sign-in providers you configure. This library depends on the Android SDK API Level 23 or higher. @@ -307,7 +307,7 @@ public class AuthenticatorActivity extends Activity { } ``` -### Google Login in Your Mobile App +## Google Login in Your Mobile App > **Use Android API level 23 or higher** The `AWSMobileClient` library for Android sign-in provides the activity and view for presenting a `SignInUI` for the sign-in providers you configure. This library depends on the Android SDK API Level 23 or higher. diff --git a/src/fragments/sdk/storage/ios/getting-started.mdx b/src/fragments/sdk/storage/ios/getting-started.mdx index bb4f900a6f4..2a4239f3853 100644 --- a/src/fragments/sdk/storage/ios/getting-started.mdx +++ b/src/fragments/sdk/storage/ios/getting-started.mdx @@ -1,8 +1,8 @@ -### Overview +## Overview Enable your app to store and retrieve user files from cloud storage with the permissions model that suits your purpose. The Amplify CLI will deploy and configures cloud storage buckets using [Amazon Simple Storage Service](http://docs.aws.amazon.com/AmazonS3/latest/dev/). -### Storage Access +## Storage Access The CLI configures three different access levels on the storage bucket: public, protected and private. When you run `amplify add storage`, the CLI will configure appropriate IAM policies on the bucket using an Amazon Cognito Identity Pools IAM Role. You will have the option of adding CRUD (Create, Read, Update, and Delete) permissions as well so that Authenticated and Guest users will be granted different permissions based on these levels. @@ -14,7 +14,7 @@ If you had previously enabled user sign-in by running `amplify add auth` in your > The `cognito_user_identity_id` corresponds to the owner's unique Amazon Cognito Identity ID. See [Authentication](/gen1/[platform]/sdk/auth/working-with-api/#utility-properties) for more information on how to get the `cognito_user_identity_id` for a signed in user. -### Set Up Your Backend +## Set Up Your Backend 1. Complete the [Get Started](/gen1/[platform]/start/getting-started/introduction/) steps before you proceed. @@ -56,11 +56,11 @@ If you had previously enabled user sign-in by running `amplify add auth` in your - Clear the `Copy items if needed` check box. - Choose `Create groups`, and then choose `Finish`. -##### Lambda Triggers +### Lambda Triggers The Amplify CLI supports associating Lambda triggers for Amazon S3 and DynamoDB events. This can be useful for a use case where you want to invoke a Lambda function after a create or update operation on a DynamoDB table managed by the CLI. [Read More](/gen1/[platform]/tools/cli/usage/lambda-triggers/#s3-lambda-triggers) -### Connect to Your Backend +## Connect to Your Backend Use the following steps to add storage services to your app. diff --git a/src/fragments/start/getting-started/flutter/nextsteps.mdx b/src/fragments/start/getting-started/flutter/nextsteps.mdx index c3e8a7a957b..0f3863fe743 100644 --- a/src/fragments/start/getting-started/flutter/nextsteps.mdx +++ b/src/fragments/start/getting-started/flutter/nextsteps.mdx @@ -8,7 +8,7 @@ in more depth or dive into the other categories and add them to your application - [REST API](/gen1/[platform]/build-a-backend/restapi/set-up-rest-api/) - [Storage](/gen1/[platform]/build-a-backend/storage/set-up-storage/) -### Escape Hatch +## Escape Hatch As an alternative to the Amplify client libraries, or in situations where the libraries do not provide the functionality you require, the underlying AWS services can be communicated with [directly](/gen1/[platform]/start/project-setup/escape-hatch/) diff --git a/src/pages/[platform]/build-a-backend/add-aws-services/analytics/personalize-recommendations/index.mdx b/src/pages/[platform]/build-a-backend/add-aws-services/analytics/personalize-recommendations/index.mdx index 5bb220ff0a3..e71f032ca08 100644 --- a/src/pages/[platform]/build-a-backend/add-aws-services/analytics/personalize-recommendations/index.mdx +++ b/src/pages/[platform]/build-a-backend/add-aws-services/analytics/personalize-recommendations/index.mdx @@ -35,7 +35,7 @@ To record event data, you need the following: For more information, see [Record Events](https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html). -### Installation and Configuration +## Installation and Configuration After creating the Amazon Personalize dataset group, you need to add the `personalize:PutEvents` permission to your AWS Identity and Access Management (IAM) user roles. @@ -73,7 +73,7 @@ Amplify.configure({ } }); ``` -### Working with the API +## Working with the API You can use the `Identify` event type to track a user identity. This lets you connect a user to their actions and record traits about them. To identify a user, specify a unique identifier for the userId property. Consider the following user interactions when choosing when and how often to call record with the Identify eventType: diff --git a/src/pages/[platform]/build-a-backend/add-aws-services/geo/amazon-location-sdk/index.mdx b/src/pages/[platform]/build-a-backend/add-aws-services/geo/amazon-location-sdk/index.mdx index 1497aececea..eda1a60200e 100644 --- a/src/pages/[platform]/build-a-backend/add-aws-services/geo/amazon-location-sdk/index.mdx +++ b/src/pages/[platform]/build-a-backend/add-aws-services/geo/amazon-location-sdk/index.mdx @@ -203,7 +203,7 @@ Log.i("MyAmplifyApp", response.entries.toString()) -### Documentation Resources +## Documentation Resources * [How to manage Amazon Location Service resources through console](https://docs.aws.amazon.com/location/latest/developerguide/welcome.html) @@ -254,7 +254,7 @@ do { } ``` -### Documentation Resources +## Documentation Resources - [How to manage Amazon Location Service resources through console](https://docs.aws.amazon.com/location/latest/developerguide/welcome.html) diff --git a/src/pages/[platform]/build-a-backend/add-aws-services/in-app-messaging/integrate-application/index.mdx b/src/pages/[platform]/build-a-backend/add-aws-services/in-app-messaging/integrate-application/index.mdx index 634260d1949..4cd767ad511 100644 --- a/src/pages/[platform]/build-a-backend/add-aws-services/in-app-messaging/integrate-application/index.mdx +++ b/src/pages/[platform]/build-a-backend/add-aws-services/in-app-messaging/integrate-application/index.mdx @@ -27,7 +27,7 @@ export function getStaticProps(context) { } -### Install the Amplify React Native Package and other dependencies +## Install the Amplify React Native Package and other dependencies Installing the `@aws-amplify/react-native` will bring in the necessary polyfills for React Native. @@ -45,7 +45,7 @@ Installing the `@aws-amplify/react-native` will bring in the necessary polyfills npm add @aws-amplify/react-native @react-native-community/netinfo @react-native-async-storage/async-storage ``` -### Install Amplify UI for React Native and its dependencies +## Install Amplify UI for React Native and its dependencies Although Amplify In-App Messaging can be used as a standalone JavaScript library, this guide will show you how to use it together with Amplify UI, which currently supports integration with React and React Native, to get started quickly. @@ -63,7 +63,7 @@ npm add @aws-amplify/ui-react-native react-native-safe-area-context {/* TODO What should be done with this page for non-react frameworks */} -### Install Amplify UI for React +## Install Amplify UI for React Although Amplify In-App Messaging can be used as a standalone JavaScript library, this guide will show you how to use it together with Amplify UI, which currently supports integration with React and React Native, to get started quickly. @@ -78,7 +78,7 @@ npm add @aws-amplify/ui-react @aws-amplify/ui-react-notifications ``` -### Integrate Amplify UI +## Integrate Amplify UI Amplify UI provides a Higher-Order Component for ease of integrating the In-App Messaging UI with your application. Simply wrap your application root component in, for example, `App.js`. diff --git a/src/pages/[platform]/build-a-backend/add-aws-services/interactions/chatbot/index.mdx b/src/pages/[platform]/build-a-backend/add-aws-services/interactions/chatbot/index.mdx index 6c8044c5779..79ee6609bde 100644 --- a/src/pages/[platform]/build-a-backend/add-aws-services/interactions/chatbot/index.mdx +++ b/src/pages/[platform]/build-a-backend/add-aws-services/interactions/chatbot/index.mdx @@ -27,7 +27,7 @@ export function getStaticProps(context) { } -### Send messages to bot +## Send messages to bot You can send a text message to chatbot backend with `send()` command. The method returns a promise that includes the chatbot response. ```javascript title="src/App.tsx" @@ -45,7 +45,7 @@ const response = await Interactions.send({ console.log(response.message); ``` -### Display end of chat message +## Display end of chat message You can use `onComplete()` method to register a function to catch errors or chatbot confirmations when the session successfully ends. diff --git a/src/pages/[platform]/build-a-backend/add-aws-services/logging/view-logs/index.mdx b/src/pages/[platform]/build-a-backend/add-aws-services/logging/view-logs/index.mdx index 684659f4c2a..0959835eec2 100644 --- a/src/pages/[platform]/build-a-backend/add-aws-services/logging/view-logs/index.mdx +++ b/src/pages/[platform]/build-a-backend/add-aws-services/logging/view-logs/index.mdx @@ -27,7 +27,7 @@ For an authenticated user, the log stream name is `. -### Working with the API +## Working with the API Generate an audio buffer for playback from a text input. diff --git a/src/pages/[platform]/build-a-backend/auth/connect-your-frontend/manage-user-sessions/index.mdx b/src/pages/[platform]/build-a-backend/auth/connect-your-frontend/manage-user-sessions/index.mdx index 5cc42d9189e..67cae9f1983 100644 --- a/src/pages/[platform]/build-a-backend/auth/connect-your-frontend/manage-user-sessions/index.mdx +++ b/src/pages/[platform]/build-a-backend/auth/connect-your-frontend/manage-user-sessions/index.mdx @@ -105,7 +105,7 @@ Future fetchAuthSession() async { } ``` -### Retrieving AWS credentials +## Retrieving AWS credentials Sometimes it can be helpful to retrieve the instance of the underlying plugin which has more specific typing. In case of Cognito, calling `fetchAuthSession` on the Cognito plugin returns AWS-specific values such as the identity ID, AWS credentials, and Cognito User Pool tokens. diff --git a/src/pages/[platform]/build-a-backend/auth/multi-step-sign-in/index.mdx b/src/pages/[platform]/build-a-backend/auth/multi-step-sign-in/index.mdx index 4a738a3fbde..0e624c40ff9 100644 --- a/src/pages/[platform]/build-a-backend/auth/multi-step-sign-in/index.mdx +++ b/src/pages/[platform]/build-a-backend/auth/multi-step-sign-in/index.mdx @@ -82,7 +82,7 @@ Future _handleSignInResult(SignInResult result) async { } } ``` -### Confirm signin with SMS MFA +## Confirm signin with SMS MFA If the next step is `confirmSignInWithSmsMfaCode`, Amplify Auth has sent the user a random code over SMS and is waiting for the user to verify that code. To handle this step, your app's UI must prompt the user to enter the code. After the user enters the code, pass the value to the `confirmSignIn` API. @@ -125,7 +125,7 @@ Future confirmMfaUser(String mfaCode) async { } ``` -### Confirm signin with TOTP MFA +## Confirm signin with TOTP MFA If the next step is `confirmSignInWithTOTPCode`, you should prompt the user to enter the TOTP code from their associated authenticator app during set up. The code is a six-digit number that changes every 30 seconds. The user must enter the code before the 30-second window expires. @@ -156,7 +156,7 @@ Future confirmTotpUser(String totpCode) async { } ``` -### Continue signin with MFA Selection +## Continue signin with MFA Selection If the next step is `continueSignInWithMFASelection`, the user must select the MFA method to use. Amplify Auth currently only supports SMS and TOTP as MFA methods. After the user selects an MFA method, your implementation must pass the selected MFA method to Amplify Auth using `confirmSignIn` API. @@ -193,7 +193,7 @@ Future _handleMfaSelection(MfaType selection) async { } ``` -### Continue signin with TOTP Setup +## Continue signin with TOTP Setup If the next step is `continueSignInWithTOTPSetup`, then the user must provide a TOTP code to complete the sign in process. The step returns an associated value of type `TOTPSetupDetails` which would be used for generating TOTP. `TOTPSetupDetails` provides a helper method called `getSetupURI` that can be used to generate a URI, which can be used by native password managers for TOTP association. For example. if the URI is used on Apple platforms, it will trigger the platform's native password manager to associate TOTP with the account. For more advanced use cases, `TOTPSetupDetails` also contains the `sharedSecret` that will be used to either generate a QR code or can be manually entered into an authenticator app. @@ -225,7 +225,7 @@ Future confirmTotpUser(String totpCode) async { } } ``` -### Confirm signin with custom challenge +## Confirm signin with custom challenge If the next step is `confirmSignInWithCustomChallenge`, Amplify Auth is awaiting completion of a custom authentication challenge. The challenge is based on the AWS Lambda trigger you configured as part of a [custom sign in flow](/[platform]/build-a-backend/auth/customize-auth-lifecycle/custom-auth-flows/#sign-in-a-user). @@ -267,7 +267,7 @@ If `failAuthentication=true` is returned by the Lambda, Cognito will invalidate -### Confirm signin with new password +## Confirm signin with new password If the next step is `confirmSignInWithNewPassword`, Amplify Auth requires the user choose a new password they proceeding with the sign in. Prompt the user for a new password and pass it to the `confirmSignIn` API. @@ -296,7 +296,7 @@ Future confirmNewPassword(String newPassword) async { } ``` -### Reset password +## Reset password If the next step is `resetPassword`, Amplify Auth requires that the user reset their password before proceeding. Use the `resetPassword` API to guide the user through resetting their password, then call `Amplify.Auth.signIn` when that's complete to restart the sign-in flow. @@ -333,7 +333,7 @@ void _handleCodeDelivery(AuthCodeDeliveryDetails codeDeliveryDetails) { ); } ``` -### Confirm Signup +## Confirm Signup If the next step is `resetPassword`, Amplify Auth requires that the user confirm their email or phone number before proceeding. Use the `resendSignUpCode` API to send a new sign up code to the registered email or phone number, followed by `confirmSignUp` to complete the sign up. @@ -387,7 +387,7 @@ Future confirmSignUp({ Once the sign up is confirmed, call `Amplify.Auth.signIn` again to restart the sign-in flow. -### Done +## Done The sign-in flow is complete when the next step is `done`, which means the user is successfully authenticated. As a convenience, the `SignInResult` also provides the `isSignedIn` property, which will be true if the next step is `done`. @@ -746,7 +746,7 @@ RxAmplify.Auth.signIn("username", "password", options).subscribe( -### Confirm signin with SMS MFA +## Confirm signin with SMS MFA If the next step is `CONFIRM_SIGN_IN_WITH_SMS_MFA_CODE`, Amplify Auth has sent the user a random code over SMS, and is waiting to find out if the user successfully received it. To handle this step, your app's UI must prompt the user to enter the code. After the user enters the code, your implementation must pass the value to Amplify Auth `confirmSignIn` API. @@ -846,23 +846,23 @@ RxAmplify.Auth.confirmSignIn( -### Confirm signin with TOTP MFA +## Confirm signin with TOTP MFA If the next step is `confirmSignInWithTOTPCode`, you should prompt the user to enter the TOTP code from their associated authenticator app during set up. The code is a six-digit number that changes every 30 seconds. The user must enter the code before the 30-second window expires. After the user enters the code, your implementation must pass the value to Amplify Auth `confirmSignIn` API. -### Continue signin with MFA Selection +## Continue signin with MFA Selection If the next step is `continueSignInWithMFASelection`, the user must select the MFA method to use. Amplify Auth currently only supports SMS and TOTP as MFA methods. After the user selects an MFA method, your implementation must pass the selected MFA method to Amplify Auth using `confirmSignIn` API. -### Continue signin with TOTP Setup +## Continue signin with TOTP Setup If the next step is `continueSignInWithTOTPSetup`, then the user must provide a TOTP code to complete the sign in process. The step returns an associated value of type `TOTPSetupDetails` which would be used for generating TOTP. `TOTPSetupDetails` provides a helper method called `getSetupURI` that can be used to generate a URI, which can be used by native password managers for TOTP association. For example. if the URI is used on Apple platforms, it will trigger the platform's native password manager to associate TOTP with the account. For more advanced use cases, `TOTPSetupDetails` also contains the `sharedSecret` that will be used to either generate a QR code or can be manually entered into an authenticator app. Once the authenticator app is set up, the user can generate a TOTP code and provide it to the library to complete the sign in process. -### Confirm signin with custom challenge +## Confirm signin with custom challenge If the next step is `CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE`, Amplify Auth is awaiting completion of a custom authentication challenge. The challenge is based on the Lambda trigger you setup when you configured a [custom sign in flow](/[platform]/build-a-backend/auth/customize-auth-lifecycle/custom-auth-flows/#sign-in-a-user). To complete this step, you should prompt the user for the custom challenge answer, and pass the answer to the `confirmSignIn` API. @@ -976,7 +976,7 @@ NotAuthorizedException{message=Failed since user is not authorized., cause=NotAu -### Confirm signin with new password +## Confirm signin with new password If you receive a `UserNotConfirmedException` while signing in, Amplify Auth requires a new password for the user before they can proceed. Prompt the user for a new password and pass it to the `confirmSignIn` API. @@ -1067,7 +1067,7 @@ RxAmplify.Auth.confirmSignIn( -### Reset password +## Reset password If you receive `PasswordResetRequiredException`, authentication flow could not proceed without resetting the password. The next step is to invoke `resetPassword` api and follow the reset password flow. @@ -1129,7 +1129,7 @@ RxAmplify.Auth.resetPassword( -### Confirm Signup +## Confirm Signup If you receive `CONFIRM_SIGN_UP` as a next step, sign up could not proceed without confirming user information such as email or phone number. The next step is to invoke the `confirmSignUp` API and follow the confirm signup flow. @@ -1199,7 +1199,7 @@ RxAmplify.Auth.confirmSignUp( -### Get Current User +## Get Current User This call fetches the current logged in user and should be used after a user has been successfully signed in. If the user is signed in, it will return the current userId and username. @@ -1255,7 +1255,7 @@ try { -### Done +## Done Sign In flow is complete when you get `done`. This means the user is successfully authenticated. As a convenience, the SignInResult also provides the `isSignedIn` property, which will be true if the next step is `done`. @@ -1353,7 +1353,7 @@ func signIn(username: String, password: String) async { The `nextStep` property is of enum type `AuthSignInStep`. Depending on its value, your code should take one of the following actions: -### Confirm signin with SMS MFA +## Confirm signin with SMS MFA If the next step is `confirmSignInWithSMSMFACode`, Amplify Auth has sent the user a random code over SMS, and is waiting to find out if the user successfully received it. To handle this step, your app's UI must prompt the user to enter the code. After the user enters the code, your implementation must pass the value to Amplify Auth `confirmSignIn` API. Note: the signin result also includes an `AuthCodeDeliveryDetails` member. It includes additional information about the code delivery such as the partial phone number of the SMS recipient. @@ -1414,7 +1414,7 @@ func confirmSignIn(confirmationCodeFromUser: String) -> AnyCancellable { -### Confirm signin with TOTP MFA +## Confirm signin with TOTP MFA If the next step is `confirmSignInWithTOTPCode`, you should prompt the user to enter the TOTP code from their associated authenticator app during set up. The code is a six-digit number that changes every 30 seconds. The user must enter the code before the 30-second window expires. @@ -1474,7 +1474,7 @@ func confirmSignIn(totpCode: String) -> AnyCancellable { -### Continue signin with MFA Selection +## Continue signin with MFA Selection If the next step is `continueSignInWithMFASelection`, the user must select the MFA method to use. Amplify Auth currently only supports SMS and TOTP as MFA methods. After the user selects an MFA method, your implementation must pass the selected MFA method to Amplify Auth using `confirmSignIn` API. @@ -1523,7 +1523,7 @@ func confirmSignInWithTOTPAsMFASelection() -> AnyCancellable { -### Continue signin with TOTP Setup +## Continue signin with TOTP Setup If the next step is `continueSignInWithTOTPSetup`, then the user must provide a TOTP code to complete the sign in process. The step returns an associated value of type `TOTPSetupDetails` which would be used for generating TOTP. `TOTPSetupDetails` provides a helper method called `getSetupURI` that can be used to generate a URI, which can be used by native password managers for TOTP association. For example. if the URI is used on Apple platforms, it will trigger the platform's native password manager to associate TOTP with the account. For more advanced use cases, `TOTPSetupDetails` also contains the `sharedSecret` that will be used to either generate a QR code or can be manually entered into an authenticator app. @@ -1596,7 +1596,7 @@ func confirmSignInWithTOTPSetup(totpCodeFromAuthenticatorApp: String) -> AnyCanc -### Confirm signin with custom challenge +## Confirm signin with custom challenge If the next step is `confirmSignInWithCustomChallenge`, Amplify Auth is awaiting completion of a custom authentication challenge. The challenge is based on the Lambda trigger you setup when you configured a [custom sign in flow](/[platform]/build-a-backend/auth/customize-auth-lifecycle/custom-auth-flows/#sign-in-a-user). To complete this step, you should prompt the user for the custom challenge answer, and pass the answer to the `confirmSignIn` API. @@ -1667,7 +1667,7 @@ Exception: notAuthorized{message=Failed since user is not authorized., cause=No -### Confirm signin with new password +## Confirm signin with new password If the next step is `confirmSignInWithNewPassword`, Amplify Auth requires a new password for the user before they can proceed. Prompt the user for a new password and pass it to the `confirmSignIn` API. @@ -1727,7 +1727,7 @@ func confirmSignIn(newPasswordFromUser: String) -> AnyCancellable { -### Reset password +## Reset password If you receive `resetPassword`, authentication flow could not proceed without resetting the password. The next step is to invoke `resetPassword` api and follow the reset password flow. @@ -1773,7 +1773,7 @@ func resetPassword(username: String) -> AnyCancellable { -### Confirm Signup +## Confirm Signup If you receive `confirmSignUp` as a next step, sign up could not proceed without confirming user information such as email or phone number. The next step is to invoke the `confirmSignUp` API and follow the confirm signup flow. @@ -1820,7 +1820,7 @@ func confirmSignUp(for username: String, with confirmationCode: String) -> AnyCa -### Done +## Done Signin flow is complete when you get `done`. This means the user is successfully authenticated. As a convenience, the SignInResult also provides the `isSignedIn` property, which will be true if the next step is `done`. diff --git a/src/pages/[platform]/build-a-backend/storage/data-usage/index.mdx b/src/pages/[platform]/build-a-backend/storage/data-usage/index.mdx index c21bf429637..24e3435c4d1 100644 --- a/src/pages/[platform]/build-a-backend/storage/data-usage/index.mdx +++ b/src/pages/[platform]/build-a-backend/storage/data-usage/index.mdx @@ -26,7 +26,7 @@ By utilizing the library, Amplify gathers API usage metrics from the AWS service Should you have any specific concerns or require additional information for the enhancement of your privacy manifest, please don't hesitate to reach out. -### Contact info +## Contact info | Data Type | Amplify Category | Purpose | Linked To Identity | Tracking | Provided by developer | | ------------------------------ | ------------------ | ------------------- | :------------------: | :--------: | :---------------------: | @@ -37,7 +37,7 @@ Should you have any specific concerns or require additional information for the | **Phone Number** | | | | | | | | Auth | App Functionality | ✅ | ❌ | ✅ | -### User Content +## User Content | Data Type | Amplify Category | Purpose | Linked To Identity | Tracking | Provided by developer | | ------------------------------ | ------------------ | ------------------- | :------------------: | :--------: | :---------------------: | @@ -47,7 +47,7 @@ Should you have any specific concerns or require additional information for the | **Audio Data** | | | | | | | | Predictions | App Functionality | ❌ | ❌ | ✅ | -### Identifiers +## Identifiers | Data Type | Amplify Category | Purpose | Linked To Identity | Tracking | Provided by developer | | ------------------------------ | ------------------ | ------------------- | :------------------: | :--------: | :---------------------: | @@ -58,7 +58,7 @@ Should you have any specific concerns or require additional information for the | | Auth | App Functionality | ✅ | ❌ | ❌ | | | Analytics | Analytics | ✅ | ❌ | ❌ | -### Other Data +## Other Data | Data Type | Amplify Category | Purpose | Linked To Identity | Tracking | Provided by developer | | ------------------------------ | ------------------ | ------------------- | :------------------: | :--------: | :---------------------: | @@ -94,28 +94,28 @@ Should you have any specific concerns or require additional information for the | | Auth | App Functionality | ✅ | ❌ | ❌ | -### Health and Fitness +## Health and Fitness No data is collected -### Financial Info +## Financial Info No data is collected -### Location +## Location No data is collected -### Sensitive Info +## Sensitive Info No data is collected -### Contacts +## Contacts No data is collected -### Browsing History +## Browsing History No data is collected -### Search History +## Search History No data is collected -### Diagnostics +## Diagnostics No data is collected ## Clearing data diff --git a/src/pages/[platform]/deploy-and-host/fullstack-branching/pr-previews/index.mdx b/src/pages/[platform]/deploy-and-host/fullstack-branching/pr-previews/index.mdx index 1481e7dcf98..99b0c39b910 100644 --- a/src/pages/[platform]/deploy-and-host/fullstack-branching/pr-previews/index.mdx +++ b/src/pages/[platform]/deploy-and-host/fullstack-branching/pr-previews/index.mdx @@ -40,7 +40,7 @@ With fullstack previews, you can set up ephemeral fullstack environments on ever 1. The pull request preview is deployed on Amplify and available at `pr-1.appid.amplifyapp.com`. 1. Once the pull request is merged into `main`, the request is closed and the fullstack environment is also automatically torn down. -### Prerequisites +## Prerequisites Before you get started, make sure you have the following: @@ -48,7 +48,7 @@ Before you get started, make sure you have the following: - Ensure that your git repository is private. For security purposes, fullstack previews are disabled for public repositories with Amplify backend templates. -### Enable fullstack previews +## Enable fullstack previews To enable fullstack web previews for your Amplify app, follow these steps: @@ -72,7 +72,7 @@ For **GitHub repositories only**, you can access your preview URL directly on th After the pull request is merged or closed, the preview URL is deleted and any ephemeral fullstack environment is also deleted. -### Share backend resources across Preview branches +## Share backend resources across Preview branches Fullstack previews allow teams a way to preview changes from pull requests before merging code to a production branch. Pull requests let you tell others about changes you’ve pushed to a branch in a repository and the changes can be reviewed by accessing the preview URL. When previews are enabled on a git branch, by default every pull request created against the git branch creates an ephemeral fullstack environment. diff --git a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/best-practice/query-with-sorting/index.mdx b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/best-practice/query-with-sorting/index.mdx index 4d4d3ebe6e1..2985630ccf4 100644 --- a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/best-practice/query-with-sorting/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/best-practice/query-with-sorting/index.mdx @@ -31,7 +31,7 @@ export function getStaticProps(context) { In this guide you will learn how to implement sorting in a GraphQL API. In our example, you will implement sorting results by date in either an ascending or descending order by implementing an additional data access pattern leveraging a DynamoDB Global Secondary Index using the `@index` GraphQL Transformer directive. -### Overview +## Overview To get started, let's start with a basic GraphQL schema for a Todo app: @@ -68,7 +68,7 @@ By default, the `listTodos` query will return the `items` array **unordered**. M To enable this, you can use the [@index](/gen1/[platform]/build-a-backend/graphqlapi/data-modeling/) directive. This directive will allow you to set a custom `sortKey` on any field in your API. -### Implementation +## Implementation In this example, you will enable sorting by the `createdAt` field. By default, Amplify will populate this `createdAt` field with a timestamp if none is passed in. diff --git a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/best-practice/warehouse-management/index.mdx b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/best-practice/warehouse-management/index.mdx index 2feb1fa7cc8..6ab8c656dc2 100644 --- a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/best-practice/warehouse-management/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/best-practice/warehouse-management/index.mdx @@ -225,7 +225,7 @@ mutation createOrder { } ``` -### 1. Look up employee details by employee ID +## 1. Look up employee details by employee ID This can simply be done by querying the employee model with an employee ID, no `@primaryKey` or `@index` need to be explicitly specified to make this work. @@ -241,7 +241,7 @@ query getEmployee($id: ID!) { } ``` -### 2. Query employee details by employee name +## 2. Query employee details by employee name The `@index` `byName` on the `Employee` type makes this access-pattern feasible because under the hood an index is created and a query is used to match against the name field. You can use this query: @@ -259,11 +259,11 @@ query employeeByName($name: String!) { } ``` -### 3. Find an Employee’s phone number +## 3. Find an Employee’s phone number Either one of the previous queries would work to find an employee’s phone number as long as one has their ID or name. -### 4. Find a customer’s phone number +## 4. Find a customer’s phone number A similar query to those given above but on the Customer model would give you a customer’s phone number. @@ -275,7 +275,7 @@ query getCustomer($customerID: ID!) { } ``` -### 5. Get orders for a given customer within a given date range +## 5. Get orders for a given customer within a given date range There is a one-to-many relation that lets all the orders of a customer be queried. @@ -301,7 +301,7 @@ query getCustomerWithOrdersByDate($customerID: ID!) { } ``` -### 6. Show all open orders within a given date range across all customers +## 6. Show all open orders within a given date range across all customers The `@index` `byCustomerByStatusByDate` enables you to run a query that would work for this access pattern. @@ -327,7 +327,7 @@ query listCustomersWithOrdersByStatusDate { } ``` -### 7. See all employees hired recently +## 7. See all employees hired recently Having `@index(name: "newHire", fields: ["newHire", "id"])` on the `Employee` model allows one to query by whether an employee has been hired recently. @@ -361,7 +361,7 @@ query employeesNewHireByDate { } ``` -### 8. Find all employees working in a given warehouse +## 8. Find all employees working in a given warehouse This needs a one to many relationship from warehouses to employees. As can be seen from the `@hasMany` relationship in the `Warehouse` model, this relationship uses the `byWarehouse` index on the `Employee` model. The relevant query would look like this: @@ -382,7 +382,7 @@ query getWarehouse($warehouseID: ID!) { } ``` -### 9. Get all items on order for a given product +## 9. Get all items on order for a given product This access-pattern would use a one-to-many relation from products to orders. With this query you can get all orders of a given product: @@ -402,7 +402,7 @@ query getProductOrders($productID: ID!) { } ``` -### 10. Get current inventories for a product at all warehouses +## 10. Get current inventories for a product at all warehouses The query needed to get the inventories of a product in all warehouses would be: @@ -420,7 +420,7 @@ query getProductInventoryInfo($productID: ID!) { } ``` -### 11. Get customers by account representative +## 11. Get customers by account representative This uses a has-many relationship between account representatives and customers: @@ -440,7 +440,7 @@ query getCustomersForAccountRepresentative($representativeId: ID!) { } ``` -### 12. Get orders by account representative and date +## 12. Get orders by account representative and date As can be seen in the AccountRepresentative model this relationship uses the `byRepresentativebyDate` field on the `Order` model to create the connection needed. The query needed would look like this: @@ -464,11 +464,11 @@ query getOrdersForAccountRepresentative($representativeId: ID!) { } ``` -### 13. Get all items on order for a given product +## 13. Get all items on order for a given product This is the same as number 9. -### 14. Get all employees with a given job title +## 14. Get all employees with a given job title Using the `byTitle` `@index` makes this access pattern quite easy. @@ -485,7 +485,7 @@ query employeesByJobTitle { } ``` -### 15. Get inventory by product by warehouse +## 15. Get inventory by product by warehouse Here having the inventories be held in a separate model is particularly useful since this model can have its own partition key and sort key such that the inventories themselves can be queried as is needed for this access-pattern. @@ -515,7 +515,7 @@ query byWarehouseId($warehouseID: ID!) { } ``` -### 16. Get total product inventory +## 16. Get total product inventory How this would be done depends on the use case. If one just wants a list of all inventories in all warehouses, one could just run a list inventories on the Inventory model: @@ -531,7 +531,7 @@ query listInventorys { } ``` -### 17. Get sales representatives ranked by order total and sales period +## 17. Get sales representatives ranked by order total and sales period The sales period is either a date range or maybe even a month or week. Therefore you can set the sales period as a string and query using the combination of `salesPeriod` and `orderTotal`. You can also set the `sortDirection` in order to get the return values from largest to smallest: diff --git a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/customize-authorization-rules/index.mdx b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/customize-authorization-rules/index.mdx index 6735fe03231..5baab1fa45b 100644 --- a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/customize-authorization-rules/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/customize-authorization-rules/index.mdx @@ -53,7 +53,7 @@ type Todo In the example above, everyone (`public`) can read every Todo but owner (authenticated users) can create, read, update, and delete their own Todos. -### Global authorization rule (only for getting started) +## Global authorization rule (only for getting started) To help you get started, there's a global authorization rule defined when you create a new GraphQL schema. For production environments, remove the global authorization rule and apply rules on each model instead. diff --git a/src/pages/gen1/[platform]/tools/cli-legacy/relational-databases/index.mdx b/src/pages/gen1/[platform]/tools/cli-legacy/relational-databases/index.mdx index 51219f3fa79..c335921c24b 100644 --- a/src/pages/gen1/[platform]/tools/cli-legacy/relational-databases/index.mdx +++ b/src/pages/gen1/[platform]/tools/cli-legacy/relational-databases/index.mdx @@ -141,6 +141,6 @@ SELECT * FROM Customers; ![SQL Results](/images/sql-results.png) -### How does this work? +## How does this work? The `add-graphql-datasource` will add a custom stack to your project that provides a basic set of functionality for working with an existing data source. You can find the new stack in the `stacks/` directory, a set of new resolvers in the `resolvers/` directory, and will also find a few additions to your `schema.graphql`. You may edit details in the custom stack and/or resolver files without worry. You may run `add-graphql-datasource` again to update your project with changes in the database but be careful as these will overwrite any existing templates in the `stacks/` or `resolvers/` directories. When using multiple environment with the Amplify CLI, you will be asked to configure the data source once per environment. diff --git a/src/pages/gen1/[platform]/tools/cli-legacy/storage/index.mdx b/src/pages/gen1/[platform]/tools/cli-legacy/storage/index.mdx index b426e9839b0..087d4f38045 100644 --- a/src/pages/gen1/[platform]/tools/cli-legacy/storage/index.mdx +++ b/src/pages/gen1/[platform]/tools/cli-legacy/storage/index.mdx @@ -48,7 +48,7 @@ Note: Complex objects are not supported by DataStore-enabled GraphQL APIs. -### Basics +## Basics At a minimum the steps to add S3 Object support are as follows: diff --git a/src/pages/gen1/[platform]/tools/cli/migration/list-nullability/index.mdx b/src/pages/gen1/[platform]/tools/cli/migration/list-nullability/index.mdx index 60d16f2c934..148b05d010e 100644 --- a/src/pages/gen1/[platform]/tools/cli/migration/list-nullability/index.mdx +++ b/src/pages/gen1/[platform]/tools/cli/migration/list-nullability/index.mdx @@ -29,7 +29,7 @@ export function getStaticProps(context) { }; } -### **What is changing?** +## **What is changing?** Amplify CLI 5.1.2 has updated the codegen process to correctly set the optionality for types in models. @@ -53,11 +53,11 @@ In this example, there are four fields with different combinations of optionalit > The list component in this example is a String type, however, this applies for other types as well such as Int, Bool, and embedded types that you define yourself. -### **Why are we introducing this change?** +## **Why are we introducing this change?** This is to align the optionality of the generated Swift models as closely as possible to the type defined in the schema. -### **Who is impacted?** +## **Who is impacted?** Developers building an iOS app with Amplify DataStore or Amplify API generates Swift models by running the command `amplify codegen models`. @@ -92,11 +92,11 @@ The difference between the current and previous code: - `optionalElementRequiredList` - the list component was required and is now optional. The list was optional and is now required - `optionalElementOptionalList` - the list component was required and is now optional. -### **When do I have to upgrade?** +## **When do I have to upgrade?** This is behind a feature flag in Amplify CLI 5.1.2 and will be deprecated by November 1st, 2021. Developers with existing apps should upgrade to the latest CLI, set the feature flag, and update their app code or their schema (see recommendations following) to account for the change in optionality of the types. Developers building a new app will automatically generate code with the latest changes and no action is required. -### **Where do I make these changes?** +## **Where do I make these changes?** 1. Update Amplify CLI to the latest version diff --git a/src/pages/gen1/[platform]/tools/cli/plugins/authoring/index.mdx b/src/pages/gen1/[platform]/tools/cli/plugins/authoring/index.mdx index 59faf7c2e05..77cf0453b93 100644 --- a/src/pages/gen1/[platform]/tools/cli/plugins/authoring/index.mdx +++ b/src/pages/gen1/[platform]/tools/cli/plugins/authoring/index.mdx @@ -34,13 +34,13 @@ export function getStaticProps(context) { The Amplify CLI provides the command `amplify plugin init` (with alias `amplify plugin new`) for the development of plugins. This command first collects requirements, and then creates the skeleton of the plugin package for you to start the development. The newly created plugin is added to your local Amplify CLI plugin platform, so you can conveniently test its functionalities while it is being developed. It can be easily removed from the local plugin platform with the `amplify plugin remove` command, and added back with the `amplify plugin add` command. -### Step 1: Install Amplify CLI +## Step 1: Install Amplify CLI import all0 from "/src/fragments/cli-install-block.mdx"; -### Step 2: Initialize plugin +## Step 2: Initialize plugin ```bash amplify plugin init @@ -48,7 +48,7 @@ amplify plugin init You will be prompted to enter the plugin name, then select the plugin type, and event subscriptions. The CLI will then create a plugin package for you and add it to the local Amplify CLI plugin platform. -### Step 3: Test your plugin +## Step 3: Test your plugin The newly created plugin package is already added to the local Amplify CLI, so you can start testing it immediately. Let's say you have chosen to use the default plugin name: `my-amplify-plugin` @@ -63,11 +63,11 @@ At this point, there are only two sub commands in the plugin package, `help` and From here, you can start to develop the plugin package. See below for the detailed explanation of the package structure. -### Step 4: Publish to npm +## Step 4: Publish to npm After the completion of one development cycle and you are ready to release your plugin to the public, you can publish it to the npm: [https://docs.npmjs.com/getting-started/publishing-npm-packages](https://docs.npmjs.com/getting-started/publishing-npm-packages) -### Step 5: Install and Use +## Step 5: Install and Use Once your plugin is published to the npm, other developers can install and use it diff --git a/src/pages/gen1/[platform]/tools/cli/reference/diagnose/index.mdx b/src/pages/gen1/[platform]/tools/cli/reference/diagnose/index.mdx index f58f1e8b454..76dbcaa86a5 100644 --- a/src/pages/gen1/[platform]/tools/cli/reference/diagnose/index.mdx +++ b/src/pages/gen1/[platform]/tools/cli/reference/diagnose/index.mdx @@ -54,7 +54,7 @@ After the zip file is transmitted successfully the current project’s unique id Project Identifier: 56b5981ed6cf5caad90fb2f8aed150e2 ``` -### Automatic Report Sharing +## Automatic Report Sharing To help improve Amplify CLI you can opt in to automatically share your project configurations with Amplify CLI on failures. The is a project level setting and can be toggled per project. The project can opt out by running diff --git a/src/pages/gen1/[platform]/tools/cli/reference/usage-data/index.mdx b/src/pages/gen1/[platform]/tools/cli/reference/usage-data/index.mdx index 49ec79ddd1f..0103832c29a 100644 --- a/src/pages/gen1/[platform]/tools/cli/reference/usage-data/index.mdx +++ b/src/pages/gen1/[platform]/tools/cli/reference/usage-data/index.mdx @@ -36,7 +36,7 @@ At AWS, we develop and launch services based on what we learn from interactions Amplify CLI sends anonymized information such as system metadata, usage metrics, and errors. The data is marked for deletion in a year from the point of it being collected. Amplify CLI does **not** collect personally identifiable information such as email addresses, usernames, keys, ARNs or project information such as names, ARNs, and keys. -### Manage usage data collection for your Amplify CLI Instance +## Manage usage data collection for your Amplify CLI Instance **Disable usage data collection** diff --git a/src/pages/gen1/[platform]/tools/cli/teams/index.mdx b/src/pages/gen1/[platform]/tools/cli/teams/index.mdx index bb729b6a58b..61751d307fa 100644 --- a/src/pages/gen1/[platform]/tools/cli/teams/index.mdx +++ b/src/pages/gen1/[platform]/tools/cli/teams/index.mdx @@ -56,11 +56,11 @@ You can alternatively, have developers setup their own isolated replica of these This workflow can be used to share complete Amplify projects with people outside of your organization as well by committing the project into a Git repository. If you are doing this remove (or add to the `.gitignore` file) the **team-provider-info.json** which is located in the `amplify` directory. You can learn more about this file [here](/gen1/[platform]/tools/cli/teams/shared/#sharing-projects-outside-the-team). -### Continuous deployment and Hosting +## Continuous deployment and Hosting The Amplify CLI supports basic web application hosting with Amazon S3 and CloudFront. You can use the multi-environments feature with the Amplify Console for a fully managed web application hosting and continuous deployment solution. For more information please learn more in the [official documentation](https://docs.aws.amazon.com/amplify/latest/userguide/multi-environments.html). -### Setting up prod and dev environments +## Setting up prod and dev environments Create a Git repository for your project if you haven't already. It is recommended managing separate Git branches for different environments (try to have the same branch name as your environment name to avoid confusion). From the root of your project, execute the following commands: