@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
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
var universal_cookie_1 =
|
|
17
|
+
exports.UniversalStorage = void 0;
|
|
18
|
+
var universal_cookie_1 = __importDefault(require("universal-cookie"));
|
|
5
19
|
var JS_1 = require("../JS");
|
|
6
|
-
var isBrowser = JS_1.browserOrNode().isBrowser;
|
|
20
|
+
var isBrowser = (0, JS_1.browserOrNode)().isBrowser;
|
|
7
21
|
var ONE_YEAR_IN_MS = 365 * 24 * 60 * 60 * 1000;
|
|
8
22
|
var UniversalStorage = /** @class */ (function () {
|
|
9
23
|
function UniversalStorage(context) {
|
|
@@ -19,7 +33,7 @@ var UniversalStorage = /** @class */ (function () {
|
|
|
19
33
|
get: function () {
|
|
20
34
|
return Object.entries(this.store).length;
|
|
21
35
|
},
|
|
22
|
-
enumerable:
|
|
36
|
+
enumerable: false,
|
|
23
37
|
configurable: true
|
|
24
38
|
});
|
|
25
39
|
UniversalStorage.prototype.clear = function () {
|
|
@@ -68,6 +82,11 @@ var UniversalStorage = /** @class */ (function () {
|
|
|
68
82
|
'refreshToken',
|
|
69
83
|
// Required for CognitoUserSession
|
|
70
84
|
'idToken',
|
|
85
|
+
// userData is used when `Auth.currentAuthenticatedUser({ bypassCache: false })`.
|
|
86
|
+
// Can be persisted to speed up calls to `Auth.currentAuthenticatedUser()`
|
|
87
|
+
// 'userData',
|
|
88
|
+
// Ignoring clockDrift on the server for now, but needs testing
|
|
89
|
+
// 'clockDrift',
|
|
71
90
|
];
|
|
72
91
|
if (sessionTokenTypes.includes(tokenType !== null && tokenType !== void 0 ? tokenType : '')) {
|
|
73
92
|
this.setUniversalItem(key, value, {
|
|
@@ -80,7 +99,7 @@ var UniversalStorage = /** @class */ (function () {
|
|
|
80
99
|
};
|
|
81
100
|
UniversalStorage.prototype.setUniversalItem = function (key, value, options) {
|
|
82
101
|
if (options === void 0) { options = {}; }
|
|
83
|
-
this.cookies.set(key, value,
|
|
102
|
+
this.cookies.set(key, value, __assign(__assign({}, options), { path: '/',
|
|
84
103
|
// `httpOnly` cannot be set via JavaScript: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#JavaScript_access_using_Document.cookie
|
|
85
104
|
sameSite: true,
|
|
86
105
|
// Allow unsecure requests to http://localhost:3000/ when in development.
|
|
@@ -89,4 +108,3 @@ var UniversalStorage = /** @class */ (function () {
|
|
|
89
108
|
return UniversalStorage;
|
|
90
109
|
}());
|
|
91
110
|
exports.UniversalStorage = UniversalStorage;
|
|
92
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
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;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var __values = (this && this.__values) || function(o) {
|
|
54
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
55
|
+
if (m) return m.call(o);
|
|
56
|
+
if (o && typeof o.length === "number") return {
|
|
57
|
+
next: function () {
|
|
58
|
+
if (o && i >= o.length) o = void 0;
|
|
59
|
+
return { value: o && o[i++], done: !o };
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
63
|
+
};
|
|
2
64
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
65
|
+
exports.BackgroundProcessManagerState = exports.BackgroundManagerNotOpenError = exports.BackgroundProcessManager = void 0;
|
|
4
66
|
/**
|
|
5
67
|
* @private For internal Amplify use.
|
|
6
68
|
*
|
|
@@ -69,8 +131,8 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
69
131
|
BackgroundProcessManager.prototype.addCleaner = function (clean, description) {
|
|
70
132
|
var _this = this;
|
|
71
133
|
var _a = this.addHook(description), resolve = _a.resolve, onTerminate = _a.onTerminate;
|
|
72
|
-
var proxy = function () { return
|
|
73
|
-
return
|
|
134
|
+
var proxy = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
135
|
+
return __generator(this, function (_a) {
|
|
74
136
|
switch (_a.label) {
|
|
75
137
|
case 0: return [4 /*yield*/, clean()];
|
|
76
138
|
case 1:
|
|
@@ -104,7 +166,7 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
104
166
|
};
|
|
105
167
|
BackgroundProcessManager.prototype.addManager = function (manager, description) {
|
|
106
168
|
var _this = this;
|
|
107
|
-
this.addCleaner(function () { return
|
|
169
|
+
this.addCleaner(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
108
170
|
switch (_a.label) {
|
|
109
171
|
case 0: return [4 /*yield*/, manager.close()];
|
|
110
172
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -190,7 +252,7 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
190
252
|
get: function () {
|
|
191
253
|
return this.jobs.size;
|
|
192
254
|
},
|
|
193
|
-
enumerable:
|
|
255
|
+
enumerable: false,
|
|
194
256
|
configurable: true
|
|
195
257
|
});
|
|
196
258
|
Object.defineProperty(BackgroundProcessManager.prototype, "state", {
|
|
@@ -204,7 +266,7 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
204
266
|
get: function () {
|
|
205
267
|
return this._state;
|
|
206
268
|
},
|
|
207
|
-
enumerable:
|
|
269
|
+
enumerable: false,
|
|
208
270
|
configurable: true
|
|
209
271
|
});
|
|
210
272
|
Object.defineProperty(BackgroundProcessManager.prototype, "pending", {
|
|
@@ -216,7 +278,7 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
216
278
|
get: function () {
|
|
217
279
|
return Array.from(this.jobs).map(function (job) { return job.description; });
|
|
218
280
|
},
|
|
219
|
-
enumerable:
|
|
281
|
+
enumerable: false,
|
|
220
282
|
configurable: true
|
|
221
283
|
});
|
|
222
284
|
Object.defineProperty(BackgroundProcessManager.prototype, "isOpen", {
|
|
@@ -226,7 +288,7 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
226
288
|
get: function () {
|
|
227
289
|
return this._state === BackgroundProcessManagerState.Open;
|
|
228
290
|
},
|
|
229
|
-
enumerable:
|
|
291
|
+
enumerable: false,
|
|
230
292
|
configurable: true
|
|
231
293
|
});
|
|
232
294
|
Object.defineProperty(BackgroundProcessManager.prototype, "isClosing", {
|
|
@@ -237,7 +299,7 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
237
299
|
get: function () {
|
|
238
300
|
return this._state === BackgroundProcessManagerState.Closing;
|
|
239
301
|
},
|
|
240
|
-
enumerable:
|
|
302
|
+
enumerable: false,
|
|
241
303
|
configurable: true
|
|
242
304
|
});
|
|
243
305
|
Object.defineProperty(BackgroundProcessManager.prototype, "isClosed", {
|
|
@@ -248,17 +310,17 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
248
310
|
get: function () {
|
|
249
311
|
return this._state === BackgroundProcessManagerState.Closed;
|
|
250
312
|
},
|
|
251
|
-
enumerable:
|
|
313
|
+
enumerable: false,
|
|
252
314
|
configurable: true
|
|
253
315
|
});
|
|
254
316
|
BackgroundProcessManager.prototype.closedFailure = function (description) {
|
|
255
317
|
if (!this.isOpen) {
|
|
256
318
|
return Promise.reject(new BackgroundManagerNotOpenError([
|
|
257
|
-
"The manager is "
|
|
258
|
-
"You tried to add \""
|
|
259
|
-
"Pending jobs: [\n"
|
|
319
|
+
"The manager is ".concat(this.state, "."),
|
|
320
|
+
"You tried to add \"".concat(description, "\"."),
|
|
321
|
+
"Pending jobs: [\n".concat(this.pending
|
|
260
322
|
.map(function (t) { return ' ' + t; })
|
|
261
|
-
.join(',\n')
|
|
323
|
+
.join(',\n'), "\n]"),
|
|
262
324
|
].join('\n')));
|
|
263
325
|
}
|
|
264
326
|
};
|
|
@@ -280,16 +342,16 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
280
342
|
* manager's `close()` was called in an `Open` state.
|
|
281
343
|
*/
|
|
282
344
|
BackgroundProcessManager.prototype.close = function () {
|
|
283
|
-
return
|
|
345
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
284
346
|
var _a, _b, job;
|
|
285
347
|
var e_1, _c;
|
|
286
|
-
return
|
|
348
|
+
return __generator(this, function (_d) {
|
|
287
349
|
switch (_d.label) {
|
|
288
350
|
case 0:
|
|
289
351
|
if (!this.isOpen) return [3 /*break*/, 2];
|
|
290
352
|
this._state = BackgroundProcessManagerState.Closing;
|
|
291
353
|
try {
|
|
292
|
-
for (_a =
|
|
354
|
+
for (_a = __values(Array.from(this.jobs)), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
293
355
|
job = _b.value;
|
|
294
356
|
try {
|
|
295
357
|
job.terminate();
|
|
@@ -298,7 +360,7 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
298
360
|
// Due to potential races with a job's natural completion, it's
|
|
299
361
|
// reasonable to expect the termination call to fail. Hence,
|
|
300
362
|
// not logging as an error.
|
|
301
|
-
console.warn("Failed to send termination signal to job. Error: "
|
|
363
|
+
console.warn("Failed to send termination signal to job. Error: ".concat(error.message), job);
|
|
302
364
|
}
|
|
303
365
|
}
|
|
304
366
|
}
|
|
@@ -334,8 +396,8 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
334
396
|
* updates the state and returns.
|
|
335
397
|
*/
|
|
336
398
|
BackgroundProcessManager.prototype.open = function () {
|
|
337
|
-
return
|
|
338
|
-
return
|
|
399
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
400
|
+
return __generator(this, function (_a) {
|
|
339
401
|
switch (_a.label) {
|
|
340
402
|
case 0:
|
|
341
403
|
if (!this.isClosing) return [3 /*break*/, 2];
|
|
@@ -357,9 +419,9 @@ exports.BackgroundProcessManager = BackgroundProcessManager;
|
|
|
357
419
|
*
|
|
358
420
|
*/
|
|
359
421
|
var BackgroundManagerNotOpenError = /** @class */ (function (_super) {
|
|
360
|
-
|
|
422
|
+
__extends(BackgroundManagerNotOpenError, _super);
|
|
361
423
|
function BackgroundManagerNotOpenError(message) {
|
|
362
|
-
return _super.call(this, "BackgroundManagerNotOpenError: "
|
|
424
|
+
return _super.call(this, "BackgroundManagerNotOpenError: ".concat(message)) || this;
|
|
363
425
|
}
|
|
364
426
|
return BackgroundManagerNotOpenError;
|
|
365
427
|
}(Error));
|
|
@@ -382,4 +444,3 @@ var BackgroundProcessManagerState;
|
|
|
382
444
|
*/
|
|
383
445
|
BackgroundProcessManagerState["Closed"] = "Closed";
|
|
384
446
|
})(BackgroundProcessManagerState = exports.BackgroundProcessManagerState || (exports.BackgroundProcessManagerState = {}));
|
|
385
|
-
//# sourceMappingURL=BackgroundProcessManager.js.map
|
package/lib/Util/Constants.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.RETRY_ERROR_CODES = exports.NO_CREDS_ERROR_STRING = exports.AWS_CLOUDWATCH_PROVIDER_NAME = exports.AWS_CLOUDWATCH_MAX_EVENT_SIZE = exports.AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE = exports.AWS_CLOUDWATCH_CATEGORY = exports.AWS_CLOUDWATCH_BASE_BUFFER_SIZE = void 0;
|
|
5
6
|
// Logging constants
|
|
6
7
|
var AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;
|
|
7
8
|
exports.AWS_CLOUDWATCH_BASE_BUFFER_SIZE = AWS_CLOUDWATCH_BASE_BUFFER_SIZE;
|
|
@@ -20,4 +21,3 @@ var RETRY_ERROR_CODES = [
|
|
|
20
21
|
'InvalidSequenceTokenException',
|
|
21
22
|
];
|
|
22
23
|
exports.RETRY_ERROR_CODES = RETRY_ERROR_CODES;
|
|
23
|
-
//# sourceMappingURL=Constants.js.map
|
package/lib/Util/DateUtils.js
CHANGED
|
@@ -5,8 +5,24 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/aws/aws-sdk-js/blob/6edf586dcc1de7fe8fbfbbd9a0d2b1847921e6e1/lib/util.js#L262
|
|
7
7
|
*/
|
|
8
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
9
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
10
|
+
if (!m) return o;
|
|
11
|
+
var i = m.call(o), r, ar = [], e;
|
|
12
|
+
try {
|
|
13
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
14
|
+
}
|
|
15
|
+
catch (error) { e = { error: error }; }
|
|
16
|
+
finally {
|
|
17
|
+
try {
|
|
18
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
19
|
+
}
|
|
20
|
+
finally { if (e) throw e.error; }
|
|
21
|
+
}
|
|
22
|
+
return ar;
|
|
23
|
+
};
|
|
8
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
|
|
25
|
+
exports.DateUtils = void 0;
|
|
10
26
|
// Comment - TODO: remove
|
|
11
27
|
var FIVE_MINUTES_IN_MS = 1000 * 60 * 5;
|
|
12
28
|
exports.DateUtils = {
|
|
@@ -33,7 +49,7 @@ exports.DateUtils = {
|
|
|
33
49
|
return date.toISOString().replace(/[:\-]|\.\d{3}/g, '');
|
|
34
50
|
},
|
|
35
51
|
getDateFromHeaderString: function (header) {
|
|
36
|
-
var _a =
|
|
52
|
+
var _a = __read(header.match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2}).+/), 7), year = _a[1], month = _a[2], day = _a[3], hour = _a[4], minute = _a[5], second = _a[6];
|
|
37
53
|
return new Date(Date.UTC(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute), Number(second)));
|
|
38
54
|
},
|
|
39
55
|
isClockSkewed: function (serverDate) {
|
|
@@ -55,4 +71,3 @@ exports.DateUtils = {
|
|
|
55
71
|
exports.DateUtils.clockOffset = offset;
|
|
56
72
|
},
|
|
57
73
|
};
|
|
58
|
-
//# sourceMappingURL=DateUtils.js.map
|
package/lib/Util/Mutex.js
CHANGED
package/lib/Util/Reachability.js
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __values = (this && this.__values) || function(o) {
|
|
3
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
+
if (m) return m.call(o);
|
|
5
|
+
if (o && typeof o.length === "number") return {
|
|
6
|
+
next: function () {
|
|
7
|
+
if (o && i >= o.length) o = void 0;
|
|
8
|
+
return { value: o && o[i++], done: !o };
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
17
|
var core_1 = require("@aws-amplify/core");
|
|
5
|
-
var zen_observable_ts_1 =
|
|
18
|
+
var zen_observable_ts_1 = __importDefault(require("zen-observable-ts"));
|
|
6
19
|
var ReachabilityNavigator = /** @class */ (function () {
|
|
7
20
|
function ReachabilityNavigator() {
|
|
8
21
|
}
|
|
9
22
|
ReachabilityNavigator.prototype.networkMonitor = function (netInfo) {
|
|
10
|
-
if (core_1.browserOrNode().isNode) {
|
|
23
|
+
if ((0, core_1.browserOrNode)().isNode) {
|
|
11
24
|
return zen_observable_ts_1.default.from([{ online: true }]);
|
|
12
25
|
}
|
|
13
|
-
var globalObj = core_1.isWebWorker() ? self : window;
|
|
26
|
+
var globalObj = (0, core_1.isWebWorker)() ? self : window;
|
|
14
27
|
return new zen_observable_ts_1.default(function (observer) {
|
|
15
28
|
observer.next({ online: globalObj.navigator.onLine });
|
|
16
29
|
var notifyOnline = function () { return observer.next({ online: true }); };
|
|
@@ -36,7 +49,7 @@ var ReachabilityNavigator = /** @class */ (function () {
|
|
|
36
49
|
observer.next(status);
|
|
37
50
|
};
|
|
38
51
|
try {
|
|
39
|
-
for (var _b =
|
|
52
|
+
for (var _b = __values(ReachabilityNavigator._observers), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
40
53
|
var observer = _c.value;
|
|
41
54
|
_loop_1(observer);
|
|
42
55
|
}
|
|
@@ -53,4 +66,3 @@ var ReachabilityNavigator = /** @class */ (function () {
|
|
|
53
66
|
return ReachabilityNavigator;
|
|
54
67
|
}());
|
|
55
68
|
exports.default = ReachabilityNavigator;
|
|
56
|
-
//# sourceMappingURL=Reachability.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var
|
|
4
|
-
var zen_observable_ts_1 = tslib_1.__importDefault(require("zen-observable-ts"));
|
|
6
|
+
var zen_observable_ts_1 = __importDefault(require("zen-observable-ts"));
|
|
5
7
|
var Logger_1 = require("../Logger");
|
|
6
8
|
var logger = new Logger_1.ConsoleLogger('Reachability', 'DEBUG');
|
|
7
9
|
var ReachabilityNavigator = /** @class */ (function () {
|
|
@@ -38,4 +40,3 @@ var ReachabilityNavigator = /** @class */ (function () {
|
|
|
38
40
|
return ReachabilityNavigator;
|
|
39
41
|
}());
|
|
40
42
|
exports.default = ReachabilityNavigator;
|
|
41
|
-
//# sourceMappingURL=Reachability.native.js.map
|
package/lib/Util/Retry.js
CHANGED
|
@@ -1,10 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
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;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
54
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
55
|
+
if (!m) return o;
|
|
56
|
+
var i = m.call(o), r, ar = [], e;
|
|
57
|
+
try {
|
|
58
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
59
|
+
}
|
|
60
|
+
catch (error) { e = { error: error }; }
|
|
61
|
+
finally {
|
|
62
|
+
try {
|
|
63
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
64
|
+
}
|
|
65
|
+
finally { if (e) throw e.error; }
|
|
66
|
+
}
|
|
67
|
+
return ar;
|
|
68
|
+
};
|
|
69
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
70
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
71
|
+
if (ar || !(i in from)) {
|
|
72
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
73
|
+
ar[i] = from[i];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
77
|
+
};
|
|
2
78
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
79
|
+
exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.retry = exports.isNonRetryableError = exports.NonRetryableError = void 0;
|
|
4
80
|
var ConsoleLogger_1 = require("../Logger/ConsoleLogger");
|
|
5
81
|
var logger = new ConsoleLogger_1.ConsoleLogger('Util');
|
|
6
82
|
var NonRetryableError = /** @class */ (function (_super) {
|
|
7
|
-
|
|
83
|
+
__extends(NonRetryableError, _super);
|
|
8
84
|
function NonRetryableError(message) {
|
|
9
85
|
var _this = _super.call(this, message) || this;
|
|
10
86
|
_this.nonRetryable = true;
|
|
@@ -13,24 +89,25 @@ var NonRetryableError = /** @class */ (function (_super) {
|
|
|
13
89
|
return NonRetryableError;
|
|
14
90
|
}(Error));
|
|
15
91
|
exports.NonRetryableError = NonRetryableError;
|
|
16
|
-
|
|
92
|
+
var isNonRetryableError = function (obj) {
|
|
17
93
|
var key = 'nonRetryable';
|
|
18
94
|
return obj && obj[key];
|
|
19
95
|
};
|
|
96
|
+
exports.isNonRetryableError = isNonRetryableError;
|
|
20
97
|
/**
|
|
21
98
|
* @private
|
|
22
99
|
* Internal use of Amplify only
|
|
23
100
|
*/
|
|
24
101
|
function retry(functionToRetry, args, delayFn, onTerminate) {
|
|
25
|
-
return
|
|
102
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
26
103
|
var _this = this;
|
|
27
|
-
return
|
|
104
|
+
return __generator(this, function (_a) {
|
|
28
105
|
if (typeof functionToRetry !== 'function') {
|
|
29
106
|
throw Error('functionToRetry must be a function');
|
|
30
107
|
}
|
|
31
|
-
return [2 /*return*/, new Promise(function (resolve, reject) { return
|
|
108
|
+
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
32
109
|
var attempt, terminated, timeout, wakeUp, lastError, _loop_1, state_1;
|
|
33
|
-
return
|
|
110
|
+
return __generator(this, function (_a) {
|
|
34
111
|
switch (_a.label) {
|
|
35
112
|
case 0:
|
|
36
113
|
attempt = 0;
|
|
@@ -45,29 +122,29 @@ function retry(functionToRetry, args, delayFn, onTerminate) {
|
|
|
45
122
|
wakeUp();
|
|
46
123
|
});
|
|
47
124
|
_loop_1 = function () {
|
|
48
|
-
var
|
|
49
|
-
return
|
|
50
|
-
switch (
|
|
125
|
+
var _b, _c, err_1, retryIn_1;
|
|
126
|
+
return __generator(this, function (_d) {
|
|
127
|
+
switch (_d.label) {
|
|
51
128
|
case 0:
|
|
52
129
|
attempt++;
|
|
53
|
-
logger.debug(functionToRetry.name
|
|
54
|
-
|
|
130
|
+
logger.debug("".concat(functionToRetry.name, " attempt #").concat(attempt, " with this vars: ").concat(JSON.stringify(args)));
|
|
131
|
+
_d.label = 1;
|
|
55
132
|
case 1:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return [4 /*yield*/, functionToRetry.apply(void 0,
|
|
60
|
-
case 2: return [2 /*return*/, (
|
|
133
|
+
_d.trys.push([1, 3, , 7]);
|
|
134
|
+
_b = {};
|
|
135
|
+
_c = resolve;
|
|
136
|
+
return [4 /*yield*/, functionToRetry.apply(void 0, __spreadArray([], __read(args), false))];
|
|
137
|
+
case 2: return [2 /*return*/, (_b.value = _c.apply(void 0, [_d.sent()]), _b)];
|
|
61
138
|
case 3:
|
|
62
|
-
err_1 =
|
|
139
|
+
err_1 = _d.sent();
|
|
63
140
|
lastError = err_1;
|
|
64
|
-
logger.debug("error on "
|
|
65
|
-
if (exports.isNonRetryableError(err_1)) {
|
|
66
|
-
logger.debug(functionToRetry.name
|
|
141
|
+
logger.debug("error on ".concat(functionToRetry.name), err_1);
|
|
142
|
+
if ((0, exports.isNonRetryableError)(err_1)) {
|
|
143
|
+
logger.debug("".concat(functionToRetry.name, " non retryable error"), err_1);
|
|
67
144
|
return [2 /*return*/, { value: reject(err_1) }];
|
|
68
145
|
}
|
|
69
146
|
retryIn_1 = delayFn(attempt, args, err_1);
|
|
70
|
-
logger.debug(functionToRetry.name
|
|
147
|
+
logger.debug("".concat(functionToRetry.name, " retrying in ").concat(retryIn_1, " ms"));
|
|
71
148
|
if (!(retryIn_1 === false || terminated)) return [3 /*break*/, 4];
|
|
72
149
|
return [2 /*return*/, { value: reject(err_1) }];
|
|
73
150
|
case 4: return [4 /*yield*/, new Promise(function (r) {
|
|
@@ -75,8 +152,8 @@ function retry(functionToRetry, args, delayFn, onTerminate) {
|
|
|
75
152
|
timeout = setTimeout(wakeUp, retryIn_1);
|
|
76
153
|
})];
|
|
77
154
|
case 5:
|
|
78
|
-
|
|
79
|
-
|
|
155
|
+
_d.sent();
|
|
156
|
+
_d.label = 6;
|
|
80
157
|
case 6: return [3 /*break*/, 7];
|
|
81
158
|
case 7: return [2 /*return*/];
|
|
82
159
|
}
|
|
@@ -121,8 +198,8 @@ exports.jitteredBackoff = jitteredBackoff;
|
|
|
121
198
|
* @private
|
|
122
199
|
* Internal use of Amplify only
|
|
123
200
|
*/
|
|
124
|
-
|
|
201
|
+
var jitteredExponentialRetry = function (functionToRetry, args, maxDelayMs, onTerminate) {
|
|
125
202
|
if (maxDelayMs === void 0) { maxDelayMs = MAX_DELAY_MS; }
|
|
126
203
|
return retry(functionToRetry, args, jitteredBackoff(maxDelayMs), onTerminate);
|
|
127
204
|
};
|
|
128
|
-
|
|
205
|
+
exports.jitteredExponentialRetry = jitteredExponentialRetry;
|
package/lib/Util/StringUtils.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.urlSafeDecode = exports.urlSafeEncode = void 0;
|
|
3
4
|
function urlSafeEncode(str) {
|
|
4
5
|
return str
|
|
5
6
|
.split('')
|
|
@@ -19,4 +20,3 @@ function urlSafeDecode(hex) {
|
|
|
19
20
|
.join('');
|
|
20
21
|
}
|
|
21
22
|
exports.urlSafeDecode = urlSafeDecode;
|
|
22
|
-
//# sourceMappingURL=StringUtils.js.map
|