@aws-amplify/core 5.3.2-unstable.ffe65ea.1 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/internals/aws-client-utils/package.json +8 -0
- package/internals/aws-clients/pinpoint/package.json +8 -0
- package/lib/Amplify.js +18 -3
- package/lib/AwsClients/CognitoIdentity/base.d.ts +28 -0
- package/lib/AwsClients/CognitoIdentity/base.js +109 -0
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +12 -0
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +82 -0
- package/lib/AwsClients/CognitoIdentity/getId.d.ts +12 -0
- package/lib/AwsClients/CognitoIdentity/getId.js +72 -0
- package/lib/AwsClients/CognitoIdentity/index.d.ts +2 -0
- package/lib/AwsClients/CognitoIdentity/index.js +9 -0
- package/lib/AwsClients/CognitoIdentity/types.d.ts +153 -0
- package/lib/AwsClients/CognitoIdentity/types.js +4 -0
- package/lib/AwsClients/Pinpoint/base.d.ts +17 -0
- package/lib/AwsClients/Pinpoint/base.js +39 -0
- package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +13 -0
- package/lib/AwsClients/Pinpoint/getInAppMessages.js +77 -0
- package/lib/AwsClients/Pinpoint/index.d.ts +4 -0
- package/lib/AwsClients/Pinpoint/index.js +11 -0
- package/lib/AwsClients/Pinpoint/putEvents.d.ts +13 -0
- package/lib/AwsClients/Pinpoint/putEvents.js +78 -0
- package/lib/AwsClients/Pinpoint/types.d.ts +836 -0
- package/lib/AwsClients/Pinpoint/types.js +5 -0
- package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +13 -0
- package/lib/AwsClients/Pinpoint/updateEndpoint.js +81 -0
- package/lib/ClientDevice/android.js +3 -2
- package/lib/ClientDevice/browser.js +1 -1
- package/lib/ClientDevice/index.js +3 -3
- package/lib/ClientDevice/ios.js +3 -2
- package/lib/ClientDevice/reactnative.js +3 -3
- package/lib/Credentials.js +176 -113
- package/lib/Errors.js +1 -1
- package/lib/Hub.d.ts +4 -4
- package/lib/Hub.js +47 -12
- package/lib/I18n/I18n.js +13 -3
- package/lib/I18n/index.js +1 -1
- package/lib/I18n/types.js +1 -1
- package/lib/JS.js +29 -17
- package/lib/Logger/ConsoleLogger.js +51 -17
- package/lib/Logger/index.js +3 -3
- package/lib/Logger/logger-interface.js +0 -1
- package/lib/OAuthHelper/FacebookOAuth.js +41 -6
- package/lib/OAuthHelper/GoogleOAuth.js +41 -6
- package/lib/OAuthHelper/index.js +1 -1
- package/lib/Platform/index.js +8 -7
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +2 -2
- package/lib/Providers/AWSCloudWatchProvider.js +104 -44
- package/lib/Providers/index.js +2 -2
- package/lib/RNComponents/index.js +2 -2
- package/lib/RNComponents/reactnative.js +7 -5
- package/lib/ServiceWorker/ServiceWorker.js +11 -11
- package/lib/ServiceWorker/index.js +2 -2
- package/lib/Signer.js +17 -7
- package/lib/StorageHelper/index.js +1 -1
- package/lib/StorageHelper/reactnative.js +5 -3
- package/lib/UniversalStorage/index.d.ts +2 -2
- package/lib/UniversalStorage/index.js +24 -6
- package/lib/Util/BackgroundProcessManager.js +84 -23
- package/lib/Util/Constants.js +1 -1
- package/lib/Util/DateUtils.js +18 -3
- package/lib/Util/Mutex.js +0 -1
- package/lib/Util/Reachability.d.ts +1 -1
- package/lib/Util/Reachability.js +18 -6
- package/lib/Util/Reachability.native.d.ts +1 -1
- package/lib/Util/Reachability.native.js +4 -3
- package/lib/Util/Retry.js +103 -26
- package/lib/Util/StringUtils.js +1 -1
- package/lib/Util/index.js +24 -21
- package/lib/clients/endpoints/getDnsSuffix.d.ts +11 -0
- package/lib/clients/endpoints/getDnsSuffix.js +49 -0
- package/lib/clients/endpoints/index.d.ts +1 -0
- package/lib/clients/endpoints/index.js +7 -0
- package/lib/clients/endpoints/partitions.d.ts +33 -0
- package/lib/clients/endpoints/partitions.js +41 -0
- package/lib/clients/handlers/authenticated.d.ts +5 -0
- package/lib/clients/handlers/authenticated.js +15 -0
- package/lib/clients/handlers/fetch.d.ts +4 -0
- package/lib/clients/handlers/fetch.js +123 -0
- package/lib/clients/handlers/unauthenticated.d.ts +4 -0
- package/lib/clients/handlers/unauthenticated.js +10 -0
- package/lib/clients/index.d.ts +8 -0
- package/lib/clients/index.js +37 -0
- package/lib/clients/internal/composeServiceApi.d.ts +8 -0
- package/lib/clients/internal/composeServiceApi.js +75 -0
- package/lib/clients/internal/composeTransferHandler.d.ts +29 -0
- package/lib/clients/internal/composeTransferHandler.js +26 -0
- package/lib/clients/middleware/retry/defaultRetryDecider.d.ts +6 -0
- package/lib/clients/middleware/retry/defaultRetryDecider.js +101 -0
- package/lib/clients/middleware/retry/index.d.ts +3 -0
- package/lib/clients/middleware/retry/index.js +11 -0
- package/lib/clients/middleware/retry/jitteredBackoff.d.ts +2 -0
- package/lib/clients/middleware/retry/jitteredBackoff.js +16 -0
- package/lib/clients/middleware/retry/middleware.d.ts +40 -0
- package/lib/clients/middleware/retry/middleware.js +143 -0
- package/lib/clients/middleware/signing/index.d.ts +1 -0
- package/lib/clients/middleware/signing/index.js +7 -0
- package/lib/clients/middleware/signing/middleware.d.ts +13 -0
- package/lib/clients/middleware/signing/middleware.js +101 -0
- package/lib/clients/middleware/signing/signer/signatureV4/constants.js +1 -1
- package/lib/clients/middleware/signing/signer/signatureV4/index.js +4 -4
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.js +4 -4
- package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js +46 -8
- package/lib/clients/middleware/signing/signer/signatureV4/signRequest.js +22 -11
- package/lib/clients/middleware/signing/signer/signatureV4/types/index.js +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/types/signer.js +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.d.ts +3 -2
- package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +7 -5
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.d.ts +2 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +23 -7
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +24 -8
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +8 -7
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +3 -2
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +3 -2
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +3 -2
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.d.ts +2 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +4 -3
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +7 -6
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.d.ts +2 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +3 -2
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +8 -7
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +5 -4
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +3 -2
- package/lib/clients/middleware/signing/utils/extendedEncodeURIComponent.d.ts +10 -0
- package/lib/clients/middleware/signing/utils/extendedEncodeURIComponent.js +23 -0
- package/lib/clients/middleware/signing/utils/getSkewCorrectedDate.d.ts +10 -0
- package/lib/clients/middleware/signing/utils/getSkewCorrectedDate.js +18 -0
- package/lib/clients/middleware/signing/utils/getUpdatedSystemClockOffset.d.ts +9 -0
- package/lib/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js +21 -0
- package/lib/clients/middleware/signing/utils/isClockSkewed.d.ts +11 -0
- package/lib/clients/middleware/signing/utils/isClockSkewed.js +23 -0
- package/lib/clients/middleware/userAgent/index.d.ts +1 -0
- package/lib/clients/middleware/userAgent/index.js +7 -0
- package/lib/clients/middleware/userAgent/middleware.d.ts +13 -0
- package/lib/clients/middleware/userAgent/middleware.js +77 -0
- package/lib/clients/serde/index.d.ts +2 -0
- package/lib/clients/serde/index.js +10 -0
- package/lib/clients/serde/json.d.ts +12 -0
- package/lib/clients/serde/json.js +115 -0
- package/lib/clients/serde/responseInfo.d.ts +3 -0
- package/lib/clients/serde/responseInfo.js +23 -0
- package/lib/clients/types/aws.d.ts +18 -1
- package/lib/clients/types/aws.js +0 -1
- package/lib/clients/types/core.d.ts +22 -0
- package/lib/clients/types/core.js +0 -1
- package/lib/clients/types/http.d.ts +8 -4
- package/lib/clients/types/http.js +0 -1
- package/lib/clients/types/index.d.ts +3 -2
- package/lib/clients/types/index.js +0 -1
- package/lib/clients/utils/isClockSkewError.d.ts +9 -0
- package/lib/clients/utils/isClockSkewError.js +27 -0
- package/lib/constants.js +1 -1
- package/lib/index.js +61 -60
- package/lib/parseAWSExports.js +15 -4
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/index.js +15 -1
- package/lib/types/types.d.ts +1 -1
- package/lib/types/types.js +0 -1
- package/lib-esm/Amplify.js +16 -2
- package/lib-esm/AwsClients/CognitoIdentity/base.d.ts +28 -0
- package/lib-esm/AwsClients/CognitoIdentity/base.js +104 -0
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +12 -0
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +79 -0
- package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +12 -0
- package/lib-esm/AwsClients/CognitoIdentity/getId.js +69 -0
- package/lib-esm/AwsClients/CognitoIdentity/index.d.ts +2 -0
- package/lib-esm/AwsClients/CognitoIdentity/index.js +4 -0
- package/lib-esm/AwsClients/CognitoIdentity/types.d.ts +153 -0
- package/lib-esm/AwsClients/CognitoIdentity/types.js +3 -0
- package/lib-esm/AwsClients/Pinpoint/base.d.ts +17 -0
- package/lib-esm/AwsClients/Pinpoint/base.js +35 -0
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +13 -0
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.js +74 -0
- package/lib-esm/AwsClients/Pinpoint/index.d.ts +4 -0
- package/lib-esm/AwsClients/Pinpoint/index.js +5 -0
- package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +13 -0
- package/lib-esm/AwsClients/Pinpoint/putEvents.js +75 -0
- package/lib-esm/AwsClients/Pinpoint/types.d.ts +836 -0
- package/lib-esm/AwsClients/Pinpoint/types.js +4 -0
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +13 -0
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.js +78 -0
- package/lib-esm/ClientDevice/android.js +0 -1
- package/lib-esm/ClientDevice/browser.js +0 -1
- package/lib-esm/ClientDevice/index.js +0 -1
- package/lib-esm/ClientDevice/ios.js +0 -1
- package/lib-esm/ClientDevice/reactnative.js +0 -1
- package/lib-esm/Credentials.js +149 -87
- package/lib-esm/Errors.js +0 -1
- package/lib-esm/Hub.d.ts +4 -4
- package/lib-esm/Hub.js +43 -9
- package/lib-esm/I18n/I18n.js +11 -2
- package/lib-esm/I18n/index.js +0 -1
- package/lib-esm/I18n/types.js +0 -1
- package/lib-esm/JS.js +0 -1
- package/lib-esm/Logger/ConsoleLogger.js +49 -16
- package/lib-esm/Logger/index.js +0 -1
- package/lib-esm/Logger/logger-interface.js +1 -1
- package/lib-esm/OAuthHelper/FacebookOAuth.js +36 -2
- package/lib-esm/OAuthHelper/GoogleOAuth.js +36 -2
- package/lib-esm/OAuthHelper/index.js +0 -1
- package/lib-esm/Platform/index.js +5 -6
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -2
- package/lib-esm/Providers/AWSCloudWatchProvider.js +75 -16
- package/lib-esm/Providers/index.js +0 -1
- package/lib-esm/RNComponents/index.js +0 -1
- package/lib-esm/RNComponents/reactnative.js +0 -1
- package/lib-esm/ServiceWorker/ServiceWorker.js +9 -10
- package/lib-esm/ServiceWorker/index.js +0 -1
- package/lib-esm/Signer.js +11 -2
- package/lib-esm/StorageHelper/index.js +0 -1
- package/lib-esm/StorageHelper/reactnative.js +0 -1
- package/lib-esm/UniversalStorage/index.d.ts +2 -2
- package/lib-esm/UniversalStorage/index.js +17 -3
- package/lib-esm/Util/BackgroundProcessManager.js +74 -14
- package/lib-esm/Util/Constants.js +0 -1
- package/lib-esm/Util/DateUtils.js +16 -2
- package/lib-esm/Util/Mutex.js +0 -1
- package/lib-esm/Util/Reachability.d.ts +1 -1
- package/lib-esm/Util/Reachability.js +11 -2
- package/lib-esm/Util/Reachability.native.d.ts +1 -1
- package/lib-esm/Util/Reachability.native.js +0 -1
- package/lib-esm/Util/Retry.js +92 -18
- package/lib-esm/Util/StringUtils.js +0 -1
- package/lib-esm/Util/index.js +0 -1
- package/lib-esm/clients/endpoints/getDnsSuffix.d.ts +11 -0
- package/lib-esm/clients/endpoints/getDnsSuffix.js +45 -0
- package/lib-esm/clients/endpoints/index.d.ts +1 -0
- package/lib-esm/clients/endpoints/index.js +3 -0
- package/lib-esm/clients/endpoints/partitions.d.ts +33 -0
- package/lib-esm/clients/endpoints/partitions.js +38 -0
- package/lib-esm/clients/handlers/authenticated.d.ts +5 -0
- package/lib-esm/clients/handlers/authenticated.js +12 -0
- package/lib-esm/clients/handlers/fetch.d.ts +4 -0
- package/lib-esm/clients/handlers/fetch.js +119 -0
- package/lib-esm/clients/handlers/unauthenticated.d.ts +4 -0
- package/lib-esm/clients/handlers/unauthenticated.js +7 -0
- package/lib-esm/clients/index.d.ts +8 -0
- package/lib-esm/clients/index.js +10 -0
- package/lib-esm/clients/internal/composeServiceApi.d.ts +8 -0
- package/lib-esm/clients/internal/composeServiceApi.js +71 -0
- package/lib-esm/clients/internal/composeTransferHandler.d.ts +29 -0
- package/lib-esm/clients/internal/composeTransferHandler.js +22 -0
- package/lib-esm/clients/middleware/retry/defaultRetryDecider.d.ts +6 -0
- package/lib-esm/clients/middleware/retry/defaultRetryDecider.js +97 -0
- package/lib-esm/clients/middleware/retry/index.d.ts +3 -0
- package/lib-esm/clients/middleware/retry/index.js +5 -0
- package/lib-esm/clients/middleware/retry/jitteredBackoff.d.ts +2 -0
- package/lib-esm/clients/middleware/retry/jitteredBackoff.js +12 -0
- package/lib-esm/clients/middleware/retry/middleware.d.ts +40 -0
- package/lib-esm/clients/middleware/retry/middleware.js +138 -0
- package/lib-esm/clients/middleware/signing/index.d.ts +1 -0
- package/lib-esm/clients/middleware/signing/index.js +3 -0
- package/lib-esm/clients/middleware/signing/middleware.d.ts +13 -0
- package/lib-esm/clients/middleware/signing/middleware.js +97 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/constants.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js +39 -3
- package/lib-esm/clients/middleware/signing/signer/signatureV4/signRequest.js +15 -6
- package/lib-esm/clients/middleware/signing/signer/signatureV4/types/index.js +1 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/types/signer.js +1 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.d.ts +3 -2
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.d.ts +2 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +20 -6
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +18 -4
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +1 -2
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.d.ts +2 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.d.ts +2 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +1 -2
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +0 -1
- package/lib-esm/clients/middleware/signing/utils/extendedEncodeURIComponent.d.ts +10 -0
- package/lib-esm/clients/middleware/signing/utils/extendedEncodeURIComponent.js +19 -0
- package/lib-esm/clients/middleware/signing/utils/getSkewCorrectedDate.d.ts +10 -0
- package/lib-esm/clients/middleware/signing/utils/getSkewCorrectedDate.js +14 -0
- package/lib-esm/clients/middleware/signing/utils/getUpdatedSystemClockOffset.d.ts +9 -0
- package/lib-esm/clients/middleware/signing/utils/getUpdatedSystemClockOffset.js +17 -0
- package/lib-esm/clients/middleware/signing/utils/isClockSkewed.d.ts +11 -0
- package/lib-esm/clients/middleware/signing/utils/isClockSkewed.js +19 -0
- package/lib-esm/clients/middleware/userAgent/index.d.ts +1 -0
- package/lib-esm/clients/middleware/userAgent/index.js +3 -0
- package/lib-esm/clients/middleware/userAgent/middleware.d.ts +13 -0
- package/lib-esm/clients/middleware/userAgent/middleware.js +73 -0
- package/lib-esm/clients/serde/index.d.ts +2 -0
- package/lib-esm/clients/serde/index.js +4 -0
- package/lib-esm/clients/serde/json.d.ts +12 -0
- package/lib-esm/clients/serde/json.js +110 -0
- package/lib-esm/clients/serde/responseInfo.d.ts +3 -0
- package/lib-esm/clients/serde/responseInfo.js +19 -0
- package/lib-esm/clients/types/aws.d.ts +18 -1
- package/lib-esm/clients/types/aws.js +1 -1
- package/lib-esm/clients/types/core.d.ts +22 -0
- package/lib-esm/clients/types/core.js +1 -1
- package/lib-esm/clients/types/http.d.ts +8 -4
- package/lib-esm/clients/types/http.js +1 -1
- package/lib-esm/clients/types/index.d.ts +3 -2
- package/lib-esm/clients/types/index.js +1 -1
- package/lib-esm/clients/utils/isClockSkewError.d.ts +9 -0
- package/lib-esm/clients/utils/isClockSkewError.js +23 -0
- package/lib-esm/constants.js +0 -1
- package/lib-esm/index.js +0 -1
- package/lib-esm/parseAWSExports.js +11 -2
- package/lib-esm/tsconfig.tsbuildinfo +1 -0
- package/lib-esm/types/index.js +1 -1
- package/lib-esm/types/types.d.ts +1 -1
- package/lib-esm/types/types.js +1 -1
- package/package.json +56 -22
- package/src/AwsClients/CognitoIdentity/base.ts +88 -0
- package/src/AwsClients/CognitoIdentity/getCredentialsForIdentity.ts +67 -0
- package/src/AwsClients/CognitoIdentity/getId.ts +58 -0
- package/src/AwsClients/CognitoIdentity/index.ts +9 -0
- package/src/AwsClients/CognitoIdentity/types.ts +159 -0
- package/src/AwsClients/Pinpoint/base.ts +41 -0
- package/src/AwsClients/Pinpoint/getInAppMessages.ts +56 -0
- package/src/AwsClients/Pinpoint/index.ts +15 -0
- package/src/AwsClients/Pinpoint/putEvents.ts +55 -0
- package/src/AwsClients/Pinpoint/types.ts +844 -0
- package/src/AwsClients/Pinpoint/updateEndpoint.ts +60 -0
- package/src/Credentials.ts +75 -100
- package/src/OAuthHelper/FacebookOAuth.ts +1 -1
- package/src/OAuthHelper/GoogleOAuth.ts +1 -1
- package/src/Platform/version.ts +1 -1
- package/src/StorageHelper/reactnative.ts +1 -1
- package/src/clients/endpoints/getDnsSuffix.ts +25 -0
- package/src/clients/endpoints/index.ts +4 -0
- package/src/clients/endpoints/partitions.ts +40 -0
- package/src/clients/handlers/authenticated.ts +19 -0
- package/src/clients/handlers/fetch.ts +75 -0
- package/src/clients/handlers/unauthenticated.ts +14 -0
- package/src/clients/index.ts +15 -0
- package/src/clients/internal/composeServiceApi.ts +50 -0
- package/src/clients/internal/composeTransferHandler.ts +89 -0
- package/src/clients/middleware/retry/defaultRetryDecider.ts +54 -0
- package/src/clients/middleware/retry/index.ts +6 -0
- package/src/clients/middleware/retry/jitteredBackoff.ts +16 -0
- package/src/clients/middleware/retry/middleware.ts +133 -0
- package/src/clients/middleware/signing/index.ts +4 -0
- package/src/clients/middleware/signing/middleware.ts +65 -0
- package/src/clients/middleware/signing/utils/extendedEncodeURIComponent.ts +21 -0
- package/src/clients/middleware/signing/utils/getSkewCorrectedDate.ts +14 -0
- package/src/clients/middleware/signing/utils/getUpdatedSystemClockOffset.ts +22 -0
- package/src/clients/middleware/signing/utils/isClockSkewed.ts +26 -0
- package/src/clients/middleware/userAgent/index.ts +4 -0
- package/src/clients/middleware/userAgent/middleware.ts +41 -0
- package/src/clients/serde/index.ts +5 -0
- package/src/clients/serde/json.ts +51 -0
- package/src/clients/serde/responseInfo.ts +20 -0
- package/src/clients/types/aws.ts +21 -0
- package/src/clients/types/core.ts +40 -0
- package/src/clients/types/http.ts +12 -2
- package/src/clients/types/index.ts +22 -2
- package/src/clients/utils/isClockSkewError.ts +24 -0
- package/lib/.tsbuildinfo +0 -3
- package/lib/Amplify.js.map +0 -1
- package/lib/ClientDevice/android.js.map +0 -1
- package/lib/ClientDevice/browser.js.map +0 -1
- package/lib/ClientDevice/index.js.map +0 -1
- package/lib/ClientDevice/ios.js.map +0 -1
- package/lib/ClientDevice/reactnative.js.map +0 -1
- package/lib/Credentials.js.map +0 -1
- package/lib/Errors.js.map +0 -1
- package/lib/Hub.js.map +0 -1
- package/lib/I18n/I18n.js.map +0 -1
- package/lib/I18n/index.js.map +0 -1
- package/lib/I18n/types.js.map +0 -1
- package/lib/JS.js.map +0 -1
- package/lib/Logger/ConsoleLogger.js.map +0 -1
- package/lib/Logger/index.js.map +0 -1
- package/lib/Logger/logger-interface.js.map +0 -1
- package/lib/OAuthHelper/FacebookOAuth.js.map +0 -1
- package/lib/OAuthHelper/GoogleOAuth.js.map +0 -1
- package/lib/OAuthHelper/index.js.map +0 -1
- package/lib/Platform/index.js.map +0 -1
- package/lib/Platform/version.js.map +0 -1
- package/lib/Providers/AWSCloudWatchProvider.js.map +0 -1
- package/lib/Providers/index.js.map +0 -1
- package/lib/RNComponents/index.js.map +0 -1
- package/lib/RNComponents/reactnative.js.map +0 -1
- package/lib/ServiceWorker/ServiceWorker.js.map +0 -1
- package/lib/ServiceWorker/index.js.map +0 -1
- package/lib/Signer.js.map +0 -1
- package/lib/StorageHelper/index.js.map +0 -1
- package/lib/StorageHelper/reactnative.js.map +0 -1
- package/lib/UniversalStorage/index.js.map +0 -1
- package/lib/Util/BackgroundProcessManager.js.map +0 -1
- package/lib/Util/CognitoIdentityClient.d.ts +0 -14
- package/lib/Util/CognitoIdentityClient.js +0 -31
- package/lib/Util/CognitoIdentityClient.js.map +0 -1
- package/lib/Util/Constants.js.map +0 -1
- package/lib/Util/DateUtils.js.map +0 -1
- package/lib/Util/Mutex.js.map +0 -1
- package/lib/Util/Reachability.js.map +0 -1
- package/lib/Util/Reachability.native.js.map +0 -1
- package/lib/Util/Retry.js.map +0 -1
- package/lib/Util/StringUtils.js.map +0 -1
- package/lib/Util/index.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/constants.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/index.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/signRequest.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/types/index.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/types/signer.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignature.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js.map +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js.map +0 -1
- package/lib/clients/types/aws.js.map +0 -1
- package/lib/clients/types/core.js.map +0 -1
- package/lib/clients/types/http.js.map +0 -1
- package/lib/clients/types/index.js.map +0 -1
- package/lib/constants.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/parseAWSExports.js.map +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib/types/types.js.map +0 -1
- package/lib-esm/.tsbuildinfo +0 -3
- package/lib-esm/Amplify.js.map +0 -1
- package/lib-esm/ClientDevice/android.js.map +0 -1
- package/lib-esm/ClientDevice/browser.js.map +0 -1
- package/lib-esm/ClientDevice/index.js.map +0 -1
- package/lib-esm/ClientDevice/ios.js.map +0 -1
- package/lib-esm/ClientDevice/reactnative.js.map +0 -1
- package/lib-esm/Credentials.js.map +0 -1
- package/lib-esm/Errors.js.map +0 -1
- package/lib-esm/Hub.js.map +0 -1
- package/lib-esm/I18n/I18n.js.map +0 -1
- package/lib-esm/I18n/index.js.map +0 -1
- package/lib-esm/I18n/types.js.map +0 -1
- package/lib-esm/JS.js.map +0 -1
- package/lib-esm/Logger/ConsoleLogger.js.map +0 -1
- package/lib-esm/Logger/index.js.map +0 -1
- package/lib-esm/Logger/logger-interface.js.map +0 -1
- package/lib-esm/OAuthHelper/FacebookOAuth.js.map +0 -1
- package/lib-esm/OAuthHelper/GoogleOAuth.js.map +0 -1
- package/lib-esm/OAuthHelper/index.js.map +0 -1
- package/lib-esm/Platform/index.js.map +0 -1
- package/lib-esm/Platform/version.js.map +0 -1
- package/lib-esm/Providers/AWSCloudWatchProvider.js.map +0 -1
- package/lib-esm/Providers/index.js.map +0 -1
- package/lib-esm/RNComponents/index.js.map +0 -1
- package/lib-esm/RNComponents/reactnative.js.map +0 -1
- package/lib-esm/ServiceWorker/ServiceWorker.js.map +0 -1
- package/lib-esm/ServiceWorker/index.js.map +0 -1
- package/lib-esm/Signer.js.map +0 -1
- package/lib-esm/StorageHelper/index.js.map +0 -1
- package/lib-esm/StorageHelper/reactnative.js.map +0 -1
- package/lib-esm/UniversalStorage/index.js.map +0 -1
- package/lib-esm/Util/BackgroundProcessManager.js.map +0 -1
- package/lib-esm/Util/CognitoIdentityClient.d.ts +0 -14
- package/lib-esm/Util/CognitoIdentityClient.js +0 -27
- package/lib-esm/Util/CognitoIdentityClient.js.map +0 -1
- package/lib-esm/Util/Constants.js.map +0 -1
- package/lib-esm/Util/DateUtils.js.map +0 -1
- package/lib-esm/Util/Mutex.js.map +0 -1
- package/lib-esm/Util/Reachability.js.map +0 -1
- package/lib-esm/Util/Reachability.native.js.map +0 -1
- package/lib-esm/Util/Retry.js.map +0 -1
- package/lib-esm/Util/StringUtils.js.map +0 -1
- package/lib-esm/Util/index.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/constants.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/signRequest.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/types/index.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/types/signer.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js.map +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js.map +0 -1
- package/lib-esm/clients/types/aws.js.map +0 -1
- package/lib-esm/clients/types/core.js.map +0 -1
- package/lib-esm/clients/types/http.js.map +0 -1
- package/lib-esm/clients/types/index.js.map +0 -1
- package/lib-esm/constants.js.map +0 -1
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/parseAWSExports.js.map +0 -1
- package/lib-esm/types/index.js.map +0 -1
- package/lib-esm/types/types.js.map +0 -1
- package/src/Util/CognitoIdentityClient.ts +0 -48
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aws-amplify/core/internals/aws-client-utils",
|
|
3
|
+
"types": "../../../lib-esm/clients/index.d.ts",
|
|
4
|
+
"main": "../../../lib/clients/index.js",
|
|
5
|
+
"module": "../../../lib-esm/clients/index.js",
|
|
6
|
+
"react-native": "../../../lib-esm/clients/index.js",
|
|
7
|
+
"sideEffects": false
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aws-amplify/core/internals/aws-clients/pinpoint",
|
|
3
|
+
"types": "../../../lib-esm/AwsClients/Pinpoint/index.d.ts",
|
|
4
|
+
"main": "../../../lib/AwsClients/Pinpoint/index.js",
|
|
5
|
+
"module": "../../../lib-esm/AwsClients/Pinpoint/index.js",
|
|
6
|
+
"react-native": "../../../lib-esm/AwsClients/Pinpoint/index.js",
|
|
7
|
+
"sideEffects": false
|
|
8
|
+
}
|
package/lib/Amplify.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
2
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
19
|
+
exports.Amplify = exports.AmplifyClass = void 0;
|
|
4
20
|
var Logger_1 = require("./Logger");
|
|
5
21
|
var logger = new Logger_1.ConsoleLogger('Amplify');
|
|
6
22
|
var AmplifyClass = /** @class */ (function () {
|
|
@@ -59,7 +75,7 @@ var AmplifyClass = /** @class */ (function () {
|
|
|
59
75
|
// This avoids introducing a public method/interface/setter that's difficult to remove later.
|
|
60
76
|
// Plus, it reduces `if` statements within the `constructor` and `configure` of each module
|
|
61
77
|
Object.entries(this._modules).forEach(function (_a) {
|
|
62
|
-
var _b =
|
|
78
|
+
var _b = __read(_a, 2), Name = _b[0], comp = _b[1];
|
|
63
79
|
// e.g. Auth.*
|
|
64
80
|
Object.keys(comp).forEach(function (property) {
|
|
65
81
|
// e.g. Auth["Credentials"] = this._modules["Credentials"] when set
|
|
@@ -89,4 +105,3 @@ var AmplifyClass = /** @class */ (function () {
|
|
|
89
105
|
}());
|
|
90
106
|
exports.AmplifyClass = AmplifyClass;
|
|
91
107
|
exports.Amplify = new AmplifyClass();
|
|
92
|
-
//# sourceMappingURL=Amplify.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Endpoint, EndpointResolverOptions, Headers, HttpRequest, HttpResponse } from '../../clients';
|
|
2
|
+
/**
|
|
3
|
+
* A Cognito Identity-specific transfer handler that does NOT sign requests, and
|
|
4
|
+
* disables caching.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const cognitoIdentityTransferHandler: (request: HttpRequest, options: import("../../clients/middleware/userAgent").UserAgentOptions & import("../../clients/middleware/retry").RetryOptions<HttpResponse>) => Promise<HttpResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const defaultConfig: {
|
|
13
|
+
service: string;
|
|
14
|
+
endpointResolver: ({ region }: EndpointResolverOptions) => {
|
|
15
|
+
url: URL;
|
|
16
|
+
};
|
|
17
|
+
retryDecider: (response?: HttpResponse, error?: Error) => Promise<boolean>;
|
|
18
|
+
computeDelay: (attempt: number) => number;
|
|
19
|
+
userAgentValue: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare const getSharedHeaders: (operation: string) => Headers;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare const buildHttpRpcRequest: ({ url }: Endpoint, headers: Headers, body: any) => HttpRequest;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
14
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
15
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
16
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
17
|
+
function step(op) {
|
|
18
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
19
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
20
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
21
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
22
|
+
switch (op[0]) {
|
|
23
|
+
case 0: case 1: t = op; break;
|
|
24
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
25
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
26
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
27
|
+
default:
|
|
28
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
29
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
30
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
31
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
32
|
+
if (t[2]) _.ops.pop();
|
|
33
|
+
_.trys.pop(); continue;
|
|
34
|
+
}
|
|
35
|
+
op = body.call(thisArg, _);
|
|
36
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
37
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.buildHttpRpcRequest = exports.getSharedHeaders = exports.defaultConfig = exports.cognitoIdentityTransferHandler = void 0;
|
|
42
|
+
var clients_1 = require("../../clients");
|
|
43
|
+
var composeTransferHandler_1 = require("../../clients/internal/composeTransferHandler");
|
|
44
|
+
var retry_1 = require("../../clients/middleware/retry");
|
|
45
|
+
var Platform_1 = require("../../Platform");
|
|
46
|
+
/**
|
|
47
|
+
* The service name used to sign requests if the API requires authentication.
|
|
48
|
+
*/
|
|
49
|
+
var SERVICE_NAME = 'cognito-identity';
|
|
50
|
+
/**
|
|
51
|
+
* The endpoint resolver function that returns the endpoint URL for a given region.
|
|
52
|
+
*/
|
|
53
|
+
var endpointResolver = function (_a) {
|
|
54
|
+
var region = _a.region;
|
|
55
|
+
return ({
|
|
56
|
+
url: new URL("https://cognito-identity.".concat(region, ".").concat((0, clients_1.getDnsSuffix)(region))),
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* A Cognito Identity-specific middleware that disables caching for all requests.
|
|
61
|
+
*/
|
|
62
|
+
var disableCacheMiddleware = function () { return function (next, context) {
|
|
63
|
+
return function disableCacheMiddleware(request) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
return __generator(this, function (_a) {
|
|
66
|
+
request.headers['cache-control'] = 'no-store';
|
|
67
|
+
return [2 /*return*/, next(request)];
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
}; };
|
|
72
|
+
/**
|
|
73
|
+
* A Cognito Identity-specific transfer handler that does NOT sign requests, and
|
|
74
|
+
* disables caching.
|
|
75
|
+
*
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
exports.cognitoIdentityTransferHandler = (0, composeTransferHandler_1.composeTransferHandler)(clients_1.unauthenticatedHandler, [disableCacheMiddleware]);
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
exports.defaultConfig = {
|
|
83
|
+
service: SERVICE_NAME,
|
|
84
|
+
endpointResolver: endpointResolver,
|
|
85
|
+
retryDecider: (0, retry_1.getRetryDecider)(clients_1.parseJsonError),
|
|
86
|
+
computeDelay: retry_1.jitteredBackoff,
|
|
87
|
+
userAgentValue: (0, Platform_1.getAmplifyUserAgent)(), // TODO: use getAmplifyUserAgentString() when available.
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
var getSharedHeaders = function (operation) { return ({
|
|
93
|
+
'content-type': 'application/x-amz-json-1.1',
|
|
94
|
+
'x-amz-target': "AWSCognitoIdentityService.".concat(operation),
|
|
95
|
+
}); };
|
|
96
|
+
exports.getSharedHeaders = getSharedHeaders;
|
|
97
|
+
/**
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
var buildHttpRpcRequest = function (_a, headers, body) {
|
|
101
|
+
var url = _a.url;
|
|
102
|
+
return ({
|
|
103
|
+
headers: headers,
|
|
104
|
+
url: url,
|
|
105
|
+
body: body,
|
|
106
|
+
method: 'POST',
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
exports.buildHttpRpcRequest = buildHttpRpcRequest;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Endpoint, HttpResponse } from '../../clients';
|
|
2
|
+
import type { GetCredentialsForIdentityCommandInput as GetCredentialsForIdentityInput, GetCredentialsForIdentityCommandOutput as GetCredentialsForIdentityOutput } from './types';
|
|
3
|
+
export type { GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput };
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const getCredentialsForIdentity: (config: Omit<import("../../clients/middleware/userAgent").UserAgentOptions & import("../../clients/middleware/retry").RetryOptions<HttpResponse> & import("../../clients").ServiceClientOptions, "retryDecider" | "computeDelay" | "userAgentValue" | "endpointResolver"> & {
|
|
8
|
+
retryDecider?: (response?: HttpResponse, error?: unknown) => Promise<boolean>;
|
|
9
|
+
computeDelay?: (attempt: number) => number;
|
|
10
|
+
userAgentValue?: string;
|
|
11
|
+
endpointResolver?: (options: import("../../clients").EndpointResolverOptions) => Endpoint;
|
|
12
|
+
}, input: GetCredentialsForIdentityInput) => Promise<GetCredentialsForIdentityOutput>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
14
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
15
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
16
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
17
|
+
function step(op) {
|
|
18
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
19
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
20
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
21
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
22
|
+
switch (op[0]) {
|
|
23
|
+
case 0: case 1: t = op; break;
|
|
24
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
25
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
26
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
27
|
+
default:
|
|
28
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
29
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
30
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
31
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
32
|
+
if (t[2]) _.ops.pop();
|
|
33
|
+
_.trys.pop(); continue;
|
|
34
|
+
}
|
|
35
|
+
op = body.call(thisArg, _);
|
|
36
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
37
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.getCredentialsForIdentity = void 0;
|
|
42
|
+
var base_1 = require("./base");
|
|
43
|
+
var clients_1 = require("../../clients");
|
|
44
|
+
var getCredentialsForIdentitySerializer = function (input, endpoint) {
|
|
45
|
+
var headers = (0, base_1.getSharedHeaders)('GetCredentialsForIdentity');
|
|
46
|
+
var body = JSON.stringify(input);
|
|
47
|
+
return (0, base_1.buildHttpRpcRequest)(endpoint, headers, body);
|
|
48
|
+
};
|
|
49
|
+
var getCredentialsForIdentityDeserializer = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
50
|
+
var error, body;
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0:
|
|
54
|
+
if (!(response.statusCode >= 300)) return [3 /*break*/, 2];
|
|
55
|
+
return [4 /*yield*/, (0, clients_1.parseJsonError)(response)];
|
|
56
|
+
case 1:
|
|
57
|
+
error = _a.sent();
|
|
58
|
+
throw error;
|
|
59
|
+
case 2: return [4 /*yield*/, (0, clients_1.parseJsonBody)(response)];
|
|
60
|
+
case 3:
|
|
61
|
+
body = _a.sent();
|
|
62
|
+
return [2 /*return*/, {
|
|
63
|
+
IdentityId: body.IdentityId,
|
|
64
|
+
Credentials: deserializeCredentials(body.Credentials),
|
|
65
|
+
$metadata: (0, clients_1.parseMetadata)(response),
|
|
66
|
+
}];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); };
|
|
70
|
+
var deserializeCredentials = function (output) {
|
|
71
|
+
if (output === void 0) { output = {}; }
|
|
72
|
+
return ({
|
|
73
|
+
AccessKeyId: output['AccessKeyId'],
|
|
74
|
+
SecretKey: output['SecretKey'],
|
|
75
|
+
SessionToken: output['SessionToken'],
|
|
76
|
+
Expiration: new Date(output['Expiration'] * 1000),
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
exports.getCredentialsForIdentity = (0, clients_1.composeServiceApi)(base_1.cognitoIdentityTransferHandler, getCredentialsForIdentitySerializer, getCredentialsForIdentityDeserializer, base_1.defaultConfig);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Endpoint, HttpResponse } from '../../clients';
|
|
2
|
+
import { GetIdCommandInput as GetIdInput, GetIdCommandOutput as GetIdOutput } from './types';
|
|
3
|
+
export type { GetIdInput, GetIdOutput };
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const getId: (config: Omit<import("../../clients/middleware/userAgent").UserAgentOptions & import("../../clients/middleware/retry").RetryOptions<HttpResponse> & import("../../clients").ServiceClientOptions, "retryDecider" | "computeDelay" | "userAgentValue" | "endpointResolver"> & {
|
|
8
|
+
retryDecider?: (response?: HttpResponse, error?: unknown) => Promise<boolean>;
|
|
9
|
+
computeDelay?: (attempt: number) => number;
|
|
10
|
+
userAgentValue?: string;
|
|
11
|
+
endpointResolver?: (options: import("../../clients").EndpointResolverOptions) => Endpoint;
|
|
12
|
+
}, input: GetIdInput) => Promise<GetIdOutput>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
14
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
15
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
16
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
17
|
+
function step(op) {
|
|
18
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
19
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
20
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
21
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
22
|
+
switch (op[0]) {
|
|
23
|
+
case 0: case 1: t = op; break;
|
|
24
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
25
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
26
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
27
|
+
default:
|
|
28
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
29
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
30
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
31
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
32
|
+
if (t[2]) _.ops.pop();
|
|
33
|
+
_.trys.pop(); continue;
|
|
34
|
+
}
|
|
35
|
+
op = body.call(thisArg, _);
|
|
36
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
37
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.getId = void 0;
|
|
42
|
+
var base_1 = require("./base");
|
|
43
|
+
var clients_1 = require("../../clients");
|
|
44
|
+
var getIdSerializer = function (input, endpoint) {
|
|
45
|
+
var headers = (0, base_1.getSharedHeaders)('GetId');
|
|
46
|
+
var body = JSON.stringify(input);
|
|
47
|
+
return (0, base_1.buildHttpRpcRequest)(endpoint, headers, body);
|
|
48
|
+
};
|
|
49
|
+
var getIdDeserializer = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
50
|
+
var error, body;
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0:
|
|
54
|
+
if (!(response.statusCode >= 300)) return [3 /*break*/, 2];
|
|
55
|
+
return [4 /*yield*/, (0, clients_1.parseJsonError)(response)];
|
|
56
|
+
case 1:
|
|
57
|
+
error = _a.sent();
|
|
58
|
+
throw error;
|
|
59
|
+
case 2: return [4 /*yield*/, (0, clients_1.parseJsonBody)(response)];
|
|
60
|
+
case 3:
|
|
61
|
+
body = _a.sent();
|
|
62
|
+
return [2 /*return*/, {
|
|
63
|
+
IdentityId: body.IdentityId,
|
|
64
|
+
$metadata: (0, clients_1.parseMetadata)(response),
|
|
65
|
+
}];
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}); };
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
exports.getId = (0, clients_1.composeServiceApi)(base_1.cognitoIdentityTransferHandler, getIdSerializer, getIdDeserializer, base_1.defaultConfig);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getCredentialsForIdentity = exports.getId = void 0;
|
|
6
|
+
var getId_1 = require("./getId");
|
|
7
|
+
Object.defineProperty(exports, "getId", { enumerable: true, get: function () { return getId_1.getId; } });
|
|
8
|
+
var getCredentialsForIdentity_1 = require("./getCredentialsForIdentity");
|
|
9
|
+
Object.defineProperty(exports, "getCredentialsForIdentity", { enumerable: true, get: function () { return getCredentialsForIdentity_1.getCredentialsForIdentity; } });
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { MetadataBearer as __MetadataBearer } from '@aws-sdk/types';
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
* <p>Credentials for the provided identity ID.</p>
|
|
5
|
+
*/
|
|
6
|
+
export interface Credentials {
|
|
7
|
+
/**
|
|
8
|
+
* <p>The Access Key portion of the credentials.</p>
|
|
9
|
+
*/
|
|
10
|
+
AccessKeyId?: string;
|
|
11
|
+
/**
|
|
12
|
+
* <p>The Secret Access Key portion of the credentials</p>
|
|
13
|
+
*/
|
|
14
|
+
SecretKey?: string;
|
|
15
|
+
/**
|
|
16
|
+
* <p>The Session Token portion of the credentials</p>
|
|
17
|
+
*/
|
|
18
|
+
SessionToken?: string;
|
|
19
|
+
/**
|
|
20
|
+
* <p>The date at which these credentials will expire.</p>
|
|
21
|
+
*/
|
|
22
|
+
Expiration?: Date;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
*
|
|
27
|
+
* The input for {@link GetCredentialsForIdentityCommand}.
|
|
28
|
+
*/
|
|
29
|
+
export interface GetCredentialsForIdentityCommandInput extends GetCredentialsForIdentityInput {
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @public
|
|
33
|
+
*
|
|
34
|
+
* The output of {@link GetCredentialsForIdentityCommand}.
|
|
35
|
+
*/
|
|
36
|
+
export interface GetCredentialsForIdentityCommandOutput extends GetCredentialsForIdentityResponse, __MetadataBearer {
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @public
|
|
40
|
+
* <p>Input to the <code>GetCredentialsForIdentity</code> action.</p>
|
|
41
|
+
*/
|
|
42
|
+
export interface GetCredentialsForIdentityInput {
|
|
43
|
+
/**
|
|
44
|
+
* <p>A unique identifier in the format REGION:GUID.</p>
|
|
45
|
+
*/
|
|
46
|
+
IdentityId: string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* <p>A set of optional name-value pairs that map provider names to provider tokens. The
|
|
49
|
+
* name-value pair will follow the syntax "provider_name":
|
|
50
|
+
* "provider_user_identifier".</p>
|
|
51
|
+
* <p>Logins should not be specified when trying to get credentials for an unauthenticated
|
|
52
|
+
* identity.</p>
|
|
53
|
+
* <p>The Logins parameter is required when using identities associated with external
|
|
54
|
+
* identity providers such as Facebook. For examples of <code>Logins</code> maps, see the code
|
|
55
|
+
* examples in the <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/external-identity-providers.html">External Identity Providers</a> section of the Amazon Cognito Developer
|
|
56
|
+
* Guide.</p>
|
|
57
|
+
*/
|
|
58
|
+
Logins?: Record<string, string>;
|
|
59
|
+
/**
|
|
60
|
+
* <p>The Amazon Resource Name (ARN) of the role to be assumed when multiple roles were
|
|
61
|
+
* received in the token from the identity provider. For example, a SAML-based identity
|
|
62
|
+
* provider. This parameter is optional for identity providers that do not support role
|
|
63
|
+
* customization.</p>
|
|
64
|
+
*/
|
|
65
|
+
CustomRoleArn?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @public
|
|
69
|
+
* <p>Returned in response to a successful <code>GetCredentialsForIdentity</code>
|
|
70
|
+
* operation.</p>
|
|
71
|
+
*/
|
|
72
|
+
export interface GetCredentialsForIdentityResponse {
|
|
73
|
+
/**
|
|
74
|
+
* <p>A unique identifier in the format REGION:GUID.</p>
|
|
75
|
+
*/
|
|
76
|
+
IdentityId?: string;
|
|
77
|
+
/**
|
|
78
|
+
* <p>Credentials for the provided identity ID.</p>
|
|
79
|
+
*/
|
|
80
|
+
Credentials?: Credentials;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @public
|
|
84
|
+
*
|
|
85
|
+
* The input for {@link GetIdCommand}.
|
|
86
|
+
*/
|
|
87
|
+
export interface GetIdCommandInput extends GetIdInput {
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @public
|
|
91
|
+
*
|
|
92
|
+
* The output of {@link GetIdCommand}.
|
|
93
|
+
*/
|
|
94
|
+
export interface GetIdCommandOutput extends GetIdResponse, __MetadataBearer {
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @public
|
|
98
|
+
* <p>Input to the GetId action.</p>
|
|
99
|
+
*/
|
|
100
|
+
export interface GetIdInput {
|
|
101
|
+
/**
|
|
102
|
+
* <p>A standard AWS account ID (9+ digits).</p>
|
|
103
|
+
*/
|
|
104
|
+
AccountId?: string;
|
|
105
|
+
/**
|
|
106
|
+
* <p>An identity pool ID in the format REGION:GUID.</p>
|
|
107
|
+
*/
|
|
108
|
+
IdentityPoolId: string | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* <p>A set of optional name-value pairs that map provider names to provider tokens. The
|
|
111
|
+
* available provider names for <code>Logins</code> are as follows:</p>
|
|
112
|
+
* <ul>
|
|
113
|
+
* <li>
|
|
114
|
+
* <p>Facebook: <code>graph.facebook.com</code>
|
|
115
|
+
* </p>
|
|
116
|
+
* </li>
|
|
117
|
+
* <li>
|
|
118
|
+
* <p>Amazon Cognito user pool:
|
|
119
|
+
* <code>cognito-idp.<region>.amazonaws.com/<YOUR_USER_POOL_ID></code>,
|
|
120
|
+
* for example, <code>cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789</code>.
|
|
121
|
+
* </p>
|
|
122
|
+
* </li>
|
|
123
|
+
* <li>
|
|
124
|
+
* <p>Google: <code>accounts.google.com</code>
|
|
125
|
+
* </p>
|
|
126
|
+
* </li>
|
|
127
|
+
* <li>
|
|
128
|
+
* <p>Amazon: <code>www.amazon.com</code>
|
|
129
|
+
* </p>
|
|
130
|
+
* </li>
|
|
131
|
+
* <li>
|
|
132
|
+
* <p>Twitter: <code>api.twitter.com</code>
|
|
133
|
+
* </p>
|
|
134
|
+
* </li>
|
|
135
|
+
* <li>
|
|
136
|
+
* <p>Digits: <code>www.digits.com</code>
|
|
137
|
+
* </p>
|
|
138
|
+
* </li>
|
|
139
|
+
* </ul>
|
|
140
|
+
*/
|
|
141
|
+
Logins?: Record<string, string>;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @public
|
|
145
|
+
* <p>Returned in response to a GetId request.</p>
|
|
146
|
+
*/
|
|
147
|
+
export interface GetIdResponse {
|
|
148
|
+
/**
|
|
149
|
+
* <p>A unique identifier in the format REGION:GUID.</p>
|
|
150
|
+
*/
|
|
151
|
+
IdentityId?: string;
|
|
152
|
+
}
|
|
153
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { EndpointResolverOptions, Headers } from '../../clients/types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const defaultConfig: {
|
|
6
|
+
service: string;
|
|
7
|
+
endpointResolver: ({ region }: EndpointResolverOptions) => {
|
|
8
|
+
url: URL;
|
|
9
|
+
};
|
|
10
|
+
retryDecider: (response?: import("../../clients/types").HttpResponse, error?: Error) => Promise<boolean>;
|
|
11
|
+
computeDelay: (attempt: number) => number;
|
|
12
|
+
userAgentValue: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare const getSharedHeaders: () => Headers;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getSharedHeaders = exports.defaultConfig = void 0;
|
|
6
|
+
var endpoints_1 = require("../../clients/endpoints");
|
|
7
|
+
var retry_1 = require("../../clients/middleware/retry");
|
|
8
|
+
var json_1 = require("../../clients/serde/json");
|
|
9
|
+
var Platform_1 = require("../../Platform");
|
|
10
|
+
/**
|
|
11
|
+
* The service name used to sign requests if the API requires authentication.
|
|
12
|
+
*/
|
|
13
|
+
var SERVICE_NAME = 'mobiletargeting';
|
|
14
|
+
/**
|
|
15
|
+
* The endpoint resolver function that returns the endpoint URL for a given region.
|
|
16
|
+
*/
|
|
17
|
+
var endpointResolver = function (_a) {
|
|
18
|
+
var region = _a.region;
|
|
19
|
+
return ({
|
|
20
|
+
url: new URL("https://pinpoint.".concat(region, ".").concat((0, endpoints_1.getDnsSuffix)(region))),
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
exports.defaultConfig = {
|
|
27
|
+
service: SERVICE_NAME,
|
|
28
|
+
endpointResolver: endpointResolver,
|
|
29
|
+
retryDecider: (0, retry_1.getRetryDecider)(json_1.parseJsonError),
|
|
30
|
+
computeDelay: retry_1.jitteredBackoff,
|
|
31
|
+
userAgentValue: (0, Platform_1.getAmplifyUserAgent)(), // TODO: use getAmplifyUserAgentString() when available.
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
var getSharedHeaders = function () { return ({
|
|
37
|
+
'content-type': 'application/json',
|
|
38
|
+
}); };
|
|
39
|
+
exports.getSharedHeaders = getSharedHeaders;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Endpoint, HttpResponse } from '../../clients/types';
|
|
2
|
+
import type { GetInAppMessagesCommandInput as GetInAppMessagesInput, GetInAppMessagesCommandOutput as GetInAppMessagesOutput } from './types';
|
|
3
|
+
export type { GetInAppMessagesInput, GetInAppMessagesOutput };
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const getInAppMessages: (config: Omit<import("../../clients/middleware/userAgent").UserAgentOptions & import("../../clients/middleware/retry").RetryOptions<HttpResponse> & import("../../clients/middleware/signing").SigningOptions & import("../../clients/types").ServiceClientOptions, "retryDecider" | "computeDelay" | "userAgentValue" | "service" | "endpointResolver"> & {
|
|
8
|
+
retryDecider?: (response?: HttpResponse, error?: unknown) => Promise<boolean>;
|
|
9
|
+
computeDelay?: (attempt: number) => number;
|
|
10
|
+
userAgentValue?: string;
|
|
11
|
+
service?: string;
|
|
12
|
+
endpointResolver?: (options: import("../../clients/types").EndpointResolverOptions) => Endpoint;
|
|
13
|
+
}, input: GetInAppMessagesInput) => Promise<GetInAppMessagesOutput>;
|