@aws-amplify/core 6.0.1-console-preview.814dea6.0 → 6.0.1-console-preview.047a1dd.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/lib/AwsClients/CognitoIdentity/base.d.ts +12 -4
- package/lib/AwsClients/CognitoIdentity/base.js +1 -0
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +15 -3
- package/lib/AwsClients/CognitoIdentity/getId.d.ts +15 -3
- package/lib/AwsClients/Pinpoint/base.d.ts +10 -2
- package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +17 -3
- package/lib/AwsClients/Pinpoint/putEvents.d.ts +17 -3
- package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +17 -3
- package/lib/Cache/Utils/CacheUtils.js +2 -4
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/ServiceWorker/ServiceWorker.js +1 -1
- package/lib/Util/JS.d.ts +1 -4
- package/lib/Util/JS.js +4 -11
- package/lib/Util/Reachability.js +0 -3
- package/lib/clients/handlers/authenticated.d.ts +1 -1
- package/lib/clients/handlers/fetch.d.ts +0 -1
- package/lib/clients/handlers/fetch.js +2 -2
- package/lib/clients/handlers/unauthenticated.d.ts +1 -1
- package/lib/clients/internal/composeServiceApi.d.ts +5 -3
- package/lib/clients/types/aws.d.ts +1 -5
- package/lib/clients/types/http.d.ts +8 -0
- package/lib/clients/types/index.d.ts +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.js +6 -10
- package/lib/libraryUtils.d.ts +3 -3
- package/lib/libraryUtils.js +5 -10
- package/lib/parseAWSExports.js +20 -1
- package/lib/providers/pinpoint/apis/record.d.ts +2 -2
- package/lib/providers/pinpoint/apis/record.js +3 -3
- package/lib/providers/pinpoint/apis/updateEndpoint.d.ts +2 -2
- package/lib/providers/pinpoint/types/buffer.d.ts +1 -1
- package/lib/providers/pinpoint/types/pinpoint.d.ts +3 -3
- package/lib/providers/pinpoint/utils/PinpointEventBuffer.js +7 -5
- package/lib/providers/pinpoint/utils/isAppInForeground.d.ts +1 -0
- package/lib/{RNComponents → providers/pinpoint/utils}/isAppInForeground.js +1 -4
- package/lib/providers/pinpoint/utils/isAppInForeground.native.d.ts +1 -0
- package/lib/providers/pinpoint/utils/isAppInForeground.native.js +9 -0
- package/lib/singleton/API/types.d.ts +34 -0
- package/lib/singleton/API/types.js +2 -0
- package/lib/singleton/Amplify.d.ts +2 -2
- package/lib/singleton/Amplify.js +9 -1
- package/lib/singleton/Auth/index.d.ts +2 -1
- package/lib/singleton/Auth/index.js +22 -12
- package/lib/singleton/Auth/utils/index.js +3 -3
- package/lib/singleton/Storage/types.d.ts +5 -0
- package/lib/singleton/types.d.ts +10 -1
- package/lib/{StorageHelper/cookieStorage.d.ts → storage/CookieStorage.d.ts} +4 -3
- package/lib/{StorageHelper/cookieStorage.js → storage/CookieStorage.js} +35 -83
- package/lib/storage/CookieStorage.native.d.ts +7 -0
- package/lib/storage/CookieStorage.native.js +32 -0
- package/lib/storage/DefaultStorage.d.ts +7 -0
- package/lib/storage/DefaultStorage.js +33 -0
- package/{lib-esm/StorageHelper/localStorage.d.ts → lib/storage/DefaultStorage.native.d.ts} +7 -6
- package/lib/{StorageHelper/sessionStorage.js → storage/DefaultStorage.native.js} +46 -43
- package/lib/storage/InMemoryStorage.d.ts +12 -0
- package/lib/storage/InMemoryStorage.js +41 -0
- package/lib/{StorageHelper/sessionStorage.d.ts → storage/KeyValueStorage.d.ts} +5 -4
- package/lib/{StorageHelper/localStorage.js → storage/KeyValueStorage.js} +13 -15
- package/lib/storage/SessionStorage.d.ts +7 -0
- package/lib/storage/SessionStorage.js +33 -0
- package/lib/storage/index.d.ts +7 -0
- package/lib/storage/index.js +14 -0
- package/lib/storage/utils.d.ts +10 -0
- package/lib/storage/utils.js +26 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/storage.d.ts +3 -0
- package/lib-esm/AwsClients/CognitoIdentity/base.d.ts +12 -4
- package/lib-esm/AwsClients/CognitoIdentity/base.js +1 -0
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +15 -3
- package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +15 -3
- package/lib-esm/AwsClients/Pinpoint/base.d.ts +10 -2
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +17 -3
- package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +17 -3
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +17 -3
- package/lib-esm/Cache/Utils/CacheUtils.js +2 -4
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/ServiceWorker/ServiceWorker.js +2 -2
- package/lib-esm/Util/JS.d.ts +1 -4
- package/lib-esm/Util/JS.js +2 -9
- package/lib-esm/Util/Reachability.js +1 -4
- package/lib-esm/clients/handlers/authenticated.d.ts +1 -1
- package/lib-esm/clients/handlers/fetch.d.ts +0 -1
- package/lib-esm/clients/handlers/fetch.js +2 -2
- package/lib-esm/clients/handlers/unauthenticated.d.ts +1 -1
- package/lib-esm/clients/internal/composeServiceApi.d.ts +5 -3
- package/lib-esm/clients/types/aws.d.ts +1 -5
- package/lib-esm/clients/types/http.d.ts +8 -0
- package/lib-esm/clients/types/index.d.ts +1 -1
- package/lib-esm/index.d.ts +1 -2
- package/lib-esm/index.js +1 -2
- package/lib-esm/libraryUtils.d.ts +3 -3
- package/lib-esm/libraryUtils.js +2 -3
- package/lib-esm/parseAWSExports.js +20 -1
- package/lib-esm/providers/pinpoint/apis/record.d.ts +2 -2
- package/lib-esm/providers/pinpoint/apis/record.js +3 -3
- package/lib-esm/providers/pinpoint/apis/updateEndpoint.d.ts +2 -2
- package/lib-esm/providers/pinpoint/types/buffer.d.ts +1 -1
- package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +3 -3
- package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.js +7 -5
- package/lib-esm/providers/pinpoint/utils/isAppInForeground.js +3 -0
- package/lib-esm/providers/pinpoint/utils/isAppInForeground.native.js +5 -0
- package/lib-esm/singleton/API/types.d.ts +34 -0
- package/lib-esm/singleton/API/types.js +1 -0
- package/lib-esm/singleton/Amplify.d.ts +2 -2
- package/lib-esm/singleton/Amplify.js +9 -1
- package/lib-esm/singleton/Auth/index.d.ts +2 -1
- package/lib-esm/singleton/Auth/index.js +22 -12
- package/lib-esm/singleton/Auth/utils/index.js +3 -3
- package/lib-esm/singleton/Storage/types.d.ts +5 -0
- package/lib-esm/singleton/types.d.ts +10 -1
- package/lib-esm/{StorageHelper/cookieStorage.d.ts → storage/CookieStorage.d.ts} +4 -3
- package/lib-esm/{StorageHelper/cookieStorage.js → storage/CookieStorage.js} +36 -61
- package/lib-esm/storage/CookieStorage.native.d.ts +7 -0
- package/lib-esm/storage/CookieStorage.native.js +29 -0
- package/lib-esm/storage/DefaultStorage.d.ts +7 -0
- package/lib-esm/storage/DefaultStorage.js +30 -0
- package/{lib/StorageHelper/localStorage.d.ts → lib-esm/storage/DefaultStorage.native.d.ts} +7 -6
- package/lib-esm/{StorageHelper/sessionStorage.js → storage/DefaultStorage.native.js} +45 -42
- package/lib-esm/storage/InMemoryStorage.d.ts +12 -0
- package/lib-esm/storage/InMemoryStorage.js +38 -0
- package/lib-esm/{StorageHelper/sessionStorage.d.ts → storage/KeyValueStorage.d.ts} +5 -4
- package/lib-esm/{StorageHelper/localStorage.js → storage/KeyValueStorage.js} +12 -14
- package/lib-esm/storage/SessionStorage.d.ts +7 -0
- package/lib-esm/storage/SessionStorage.js +30 -0
- package/lib-esm/storage/index.d.ts +7 -0
- package/lib-esm/storage/index.js +10 -0
- package/lib-esm/storage/utils.d.ts +10 -0
- package/lib-esm/storage/utils.js +21 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/storage.d.ts +3 -0
- package/package.json +3 -6
- package/src/AwsClients/CognitoIdentity/base.ts +2 -2
- package/src/AwsClients/Pinpoint/base.ts +2 -6
- package/src/Cache/Utils/CacheUtils.ts +2 -4
- package/src/Platform/version.ts +1 -1
- package/src/ServiceWorker/ServiceWorker.ts +2 -2
- package/src/Util/JS.ts +2 -13
- package/src/Util/Reachability.ts +1 -5
- package/src/clients/handlers/authenticated.ts +2 -1
- package/src/clients/handlers/fetch.ts +2 -2
- package/src/clients/handlers/unauthenticated.ts +2 -1
- package/src/clients/internal/composeServiceApi.ts +10 -3
- package/src/clients/types/aws.ts +4 -11
- package/src/clients/types/http.ts +8 -0
- package/src/clients/types/index.ts +0 -1
- package/src/index.ts +4 -8
- package/src/libraryUtils.ts +3 -4
- package/src/parseAWSExports.ts +26 -0
- package/src/providers/pinpoint/apis/record.ts +8 -8
- package/src/providers/pinpoint/apis/updateEndpoint.ts +2 -2
- package/src/providers/pinpoint/types/buffer.ts +1 -1
- package/src/providers/pinpoint/types/pinpoint.ts +8 -7
- package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +16 -12
- package/src/providers/pinpoint/utils/isAppInForeground.native.ts +7 -0
- package/src/providers/pinpoint/utils/isAppInForeground.ts +4 -0
- package/src/singleton/API/types.ts +31 -0
- package/src/singleton/Amplify.ts +12 -3
- package/src/singleton/Auth/index.ts +9 -2
- package/src/singleton/Auth/utils/index.ts +3 -3
- package/src/singleton/Storage/types.ts +6 -2
- package/src/singleton/types.ts +11 -1
- package/src/storage/CookieStorage.native.ts +13 -0
- package/src/storage/CookieStorage.ts +72 -0
- package/src/storage/DefaultStorage.native.ts +78 -0
- package/src/storage/DefaultStorage.ts +14 -0
- package/src/storage/InMemoryStorage.ts +36 -0
- package/src/{StorageHelper/sessionStorage.ts → storage/KeyValueStorage.ts} +10 -13
- package/src/storage/SessionStorage.ts +14 -0
- package/src/storage/index.ts +13 -0
- package/src/storage/utils.ts +22 -0
- package/src/types/storage.ts +4 -0
- package/lib/OAuthHelper/FacebookOAuth.d.ts +0 -6
- package/lib/OAuthHelper/FacebookOAuth.js +0 -124
- package/lib/OAuthHelper/GoogleOAuth.d.ts +0 -6
- package/lib/OAuthHelper/GoogleOAuth.js +0 -134
- package/lib/OAuthHelper/index.d.ts +0 -4
- package/lib/OAuthHelper/index.js +0 -9
- package/lib/RNComponents/index.d.ts +0 -6
- package/lib/RNComponents/index.js +0 -16
- package/lib/RNComponents/reactnative.d.ts +0 -3
- package/lib/RNComponents/reactnative.js +0 -14
- package/lib/StorageHelper/inMemoryStorage.d.ts +0 -10
- package/lib/StorageHelper/inMemoryStorage.js +0 -82
- package/lib/StorageHelper/index.d.ts +0 -45
- package/lib/StorageHelper/index.js +0 -83
- package/lib/StorageHelper/reactnative.d.ts +0 -83
- package/lib/StorageHelper/reactnative.js +0 -250
- package/lib-esm/OAuthHelper/FacebookOAuth.d.ts +0 -6
- package/lib-esm/OAuthHelper/FacebookOAuth.js +0 -121
- package/lib-esm/OAuthHelper/GoogleOAuth.d.ts +0 -6
- package/lib-esm/OAuthHelper/GoogleOAuth.js +0 -131
- package/lib-esm/OAuthHelper/index.d.ts +0 -4
- package/lib-esm/OAuthHelper/index.js +0 -6
- package/lib-esm/RNComponents/index.d.ts +0 -6
- package/lib-esm/RNComponents/index.js +0 -13
- package/lib-esm/RNComponents/isAppInForeground.js +0 -6
- package/lib-esm/RNComponents/reactnative.d.ts +0 -3
- package/lib-esm/RNComponents/reactnative.js +0 -6
- package/lib-esm/StorageHelper/inMemoryStorage.d.ts +0 -10
- package/lib-esm/StorageHelper/inMemoryStorage.js +0 -79
- package/lib-esm/StorageHelper/index.d.ts +0 -45
- package/lib-esm/StorageHelper/index.js +0 -76
- package/lib-esm/StorageHelper/reactnative.d.ts +0 -83
- package/lib-esm/StorageHelper/reactnative.js +0 -244
- package/src/OAuthHelper/FacebookOAuth.ts +0 -83
- package/src/OAuthHelper/GoogleOAuth.ts +0 -97
- package/src/OAuthHelper/index.ts +0 -7
- package/src/RNComponents/index.ts +0 -16
- package/src/RNComponents/isAppInForeground.ts +0 -8
- package/src/RNComponents/reactnative.ts +0 -6
- package/src/StorageHelper/cookieStorage.ts +0 -99
- package/src/StorageHelper/inMemoryStorage.ts +0 -32
- package/src/StorageHelper/index.ts +0 -78
- package/src/StorageHelper/localStorage.ts +0 -60
- package/src/StorageHelper/reactnative.ts +0 -182
- /package/lib-esm/{RNComponents → providers/pinpoint/utils}/isAppInForeground.d.ts +0 -0
- /package/{lib/RNComponents/isAppInForeground.d.ts → lib-esm/providers/pinpoint/utils/isAppInForeground.native.d.ts} +0 -0
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import { Endpoint, Headers, HttpRequest, HttpResponse } from '../../clients';
|
|
2
|
-
import { DefaultConfigOptions } from '../../clients/types';
|
|
1
|
+
import { Endpoint, EndpointResolverOptions, Headers, HttpRequest, HttpResponse } from '../../clients';
|
|
3
2
|
/**
|
|
4
3
|
* A Cognito Identity-specific transfer handler that does NOT sign requests, and
|
|
5
4
|
* disables caching.
|
|
6
5
|
*
|
|
7
6
|
* @internal
|
|
8
7
|
*/
|
|
9
|
-
export declare const cognitoIdentityTransferHandler: (request: HttpRequest, options: import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse>) => Promise<HttpResponse>;
|
|
8
|
+
export declare const cognitoIdentityTransferHandler: (request: HttpRequest, options: import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").HttpTransferOptions) => Promise<HttpResponse>;
|
|
10
9
|
/**
|
|
11
10
|
* @internal
|
|
12
11
|
*/
|
|
13
|
-
export declare const defaultConfig:
|
|
12
|
+
export declare const defaultConfig: {
|
|
13
|
+
service: string;
|
|
14
|
+
endpointResolver: ({ region }: EndpointResolverOptions) => {
|
|
15
|
+
url: URL;
|
|
16
|
+
};
|
|
17
|
+
retryDecider: (response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>;
|
|
18
|
+
computeDelay: (attempt: number) => number;
|
|
19
|
+
userAgentValue: string;
|
|
20
|
+
cache: string;
|
|
21
|
+
};
|
|
14
22
|
/**
|
|
15
23
|
* @internal
|
|
16
24
|
*/
|
|
@@ -86,6 +86,7 @@ exports.defaultConfig = {
|
|
|
86
86
|
retryDecider: (0, retry_1.getRetryDecider)(clients_1.parseJsonError),
|
|
87
87
|
computeDelay: retry_1.jitteredBackoff,
|
|
88
88
|
userAgentValue: (0, Platform_1.getAmplifyUserAgent)(),
|
|
89
|
+
cache: 'no-store',
|
|
89
90
|
};
|
|
90
91
|
(0, detectFramework_1.observeFrameworkChanges)(function () {
|
|
91
92
|
exports.defaultConfig.userAgentValue = (0, Platform_1.getAmplifyUserAgent)();
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import { HttpResponse } from '../../clients';
|
|
1
|
+
import { Endpoint, HttpResponse } from '../../clients';
|
|
2
2
|
import type { GetCredentialsForIdentityCommandInput as GetCredentialsForIdentityInput, GetCredentialsForIdentityCommandOutput as GetCredentialsForIdentityOutput } from './types';
|
|
3
3
|
export type { GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput };
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const getCredentialsForIdentity: (config:
|
|
8
|
-
|
|
7
|
+
export declare const getCredentialsForIdentity: (config: {
|
|
8
|
+
service?: string | undefined;
|
|
9
|
+
endpointResolver?: (((options: import("../../clients").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients").EndpointResolverOptions) => {
|
|
10
|
+
url: URL;
|
|
11
|
+
})) | undefined;
|
|
12
|
+
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
|
|
13
|
+
computeDelay?: ((attempt: number) => number) | undefined;
|
|
14
|
+
userAgentValue?: string | undefined;
|
|
15
|
+
cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
region: string;
|
|
18
|
+
abortSignal?: AbortSignal | undefined;
|
|
19
|
+
maxAttempts?: number | undefined;
|
|
20
|
+
userAgentHeader?: string | undefined;
|
|
9
21
|
}, input: GetCredentialsForIdentityInput) => Promise<GetCredentialsForIdentityOutput>;
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import { HttpResponse } from '../../clients';
|
|
1
|
+
import { Endpoint, HttpResponse } from '../../clients';
|
|
2
2
|
import { GetIdCommandInput as GetIdInput, GetIdCommandOutput as GetIdOutput } from './types';
|
|
3
3
|
export type { GetIdInput, GetIdOutput };
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const getId: (config:
|
|
8
|
-
|
|
7
|
+
export declare const getId: (config: {
|
|
8
|
+
service?: string | undefined;
|
|
9
|
+
endpointResolver?: (((options: import("../../clients").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients").EndpointResolverOptions) => {
|
|
10
|
+
url: URL;
|
|
11
|
+
})) | undefined;
|
|
12
|
+
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
|
|
13
|
+
computeDelay?: ((attempt: number) => number) | undefined;
|
|
14
|
+
userAgentValue?: string | undefined;
|
|
15
|
+
cache?: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
region: string;
|
|
18
|
+
abortSignal?: AbortSignal | undefined;
|
|
19
|
+
maxAttempts?: number | undefined;
|
|
20
|
+
userAgentHeader?: string | undefined;
|
|
9
21
|
}, input: GetIdInput) => Promise<GetIdOutput>;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EndpointResolverOptions, Headers } from '../../clients/types';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const defaultConfig:
|
|
5
|
+
export declare const defaultConfig: {
|
|
6
|
+
service: string;
|
|
7
|
+
endpointResolver: ({ region }: EndpointResolverOptions) => {
|
|
8
|
+
url: URL;
|
|
9
|
+
};
|
|
10
|
+
retryDecider: (response?: import("../../clients/types").HttpResponse | undefined, error?: unknown) => Promise<boolean>;
|
|
11
|
+
computeDelay: (attempt: number) => number;
|
|
12
|
+
userAgentValue: string;
|
|
13
|
+
};
|
|
6
14
|
/**
|
|
7
15
|
* @internal
|
|
8
16
|
*/
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import { HttpResponse } from '../../clients/types';
|
|
1
|
+
import { Endpoint, HttpResponse } from '../../clients/types';
|
|
2
2
|
import type { GetInAppMessagesCommandInput as GetInAppMessagesInput, GetInAppMessagesCommandOutput as GetInAppMessagesOutput } from './types';
|
|
3
3
|
export type { GetInAppMessagesInput, GetInAppMessagesOutput };
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const getInAppMessages: (config:
|
|
8
|
-
|
|
7
|
+
export declare const getInAppMessages: (config: {
|
|
8
|
+
service?: string | undefined;
|
|
9
|
+
endpointResolver?: (((options: import("../../clients/types").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients/types").EndpointResolverOptions) => {
|
|
10
|
+
url: URL;
|
|
11
|
+
})) | undefined;
|
|
12
|
+
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
|
|
13
|
+
computeDelay?: ((attempt: number) => number) | undefined;
|
|
14
|
+
userAgentValue?: string | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
uriEscapePath?: boolean | undefined;
|
|
17
|
+
credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
|
|
18
|
+
region: string;
|
|
19
|
+
abortSignal?: AbortSignal | undefined;
|
|
20
|
+
cache?: RequestCache | undefined;
|
|
21
|
+
maxAttempts?: number | undefined;
|
|
22
|
+
userAgentHeader?: string | undefined;
|
|
9
23
|
}, input: GetInAppMessagesInput) => Promise<GetInAppMessagesOutput>;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import { HttpResponse } from '../../clients/types';
|
|
1
|
+
import { Endpoint, HttpResponse } from '../../clients/types';
|
|
2
2
|
import type { PutEventsCommandInput as PutEventsInput, PutEventsCommandOutput as PutEventsOutput } from './types';
|
|
3
3
|
export type { PutEventsInput, PutEventsOutput };
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const putEvents: (config:
|
|
8
|
-
|
|
7
|
+
export declare const putEvents: (config: {
|
|
8
|
+
service?: string | undefined;
|
|
9
|
+
endpointResolver?: (((options: import("../../clients/types").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients/types").EndpointResolverOptions) => {
|
|
10
|
+
url: URL;
|
|
11
|
+
})) | undefined;
|
|
12
|
+
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
|
|
13
|
+
computeDelay?: ((attempt: number) => number) | undefined;
|
|
14
|
+
userAgentValue?: string | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
uriEscapePath?: boolean | undefined;
|
|
17
|
+
credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
|
|
18
|
+
region: string;
|
|
19
|
+
abortSignal?: AbortSignal | undefined;
|
|
20
|
+
cache?: RequestCache | undefined;
|
|
21
|
+
maxAttempts?: number | undefined;
|
|
22
|
+
userAgentHeader?: string | undefined;
|
|
9
23
|
}, input: PutEventsInput) => Promise<PutEventsOutput>;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import { HttpResponse } from '../../clients/types';
|
|
1
|
+
import { Endpoint, HttpResponse } from '../../clients/types';
|
|
2
2
|
import type { UpdateEndpointCommandInput as UpdateEndpointInput, UpdateEndpointCommandOutput as UpdateEndpointOutput } from './types';
|
|
3
3
|
export type { UpdateEndpointInput, UpdateEndpointOutput };
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const updateEndpoint: (config:
|
|
8
|
-
|
|
7
|
+
export declare const updateEndpoint: (config: {
|
|
8
|
+
service?: string | undefined;
|
|
9
|
+
endpointResolver?: (((options: import("../../clients/types").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients/types").EndpointResolverOptions) => {
|
|
10
|
+
url: URL;
|
|
11
|
+
})) | undefined;
|
|
12
|
+
retryDecider?: (((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse | undefined, error?: unknown) => Promise<boolean>)) | undefined;
|
|
13
|
+
computeDelay?: ((attempt: number) => number) | undefined;
|
|
14
|
+
userAgentValue?: string | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
uriEscapePath?: boolean | undefined;
|
|
17
|
+
credentials: import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity | (() => Promise<import("@smithy/types/dist-types/identity/awsCredentialIdentity").AwsCredentialIdentity>);
|
|
18
|
+
region: string;
|
|
19
|
+
abortSignal?: AbortSignal | undefined;
|
|
20
|
+
cache?: RequestCache | undefined;
|
|
21
|
+
maxAttempts?: number | undefined;
|
|
22
|
+
userAgentHeader?: string | undefined;
|
|
9
23
|
}, input: UpdateEndpointInput) => Promise<UpdateEndpointOutput>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.getCurrSizeKey = exports.CacheObject = exports.isInteger = exports.getCurrTime = exports.getByteLength = exports.defaultConfig = void 0;
|
|
6
|
-
var
|
|
6
|
+
var utils_1 = require("../../storage/utils");
|
|
7
7
|
/**
|
|
8
8
|
* Default cache config
|
|
9
9
|
*/
|
|
@@ -14,9 +14,7 @@ exports.defaultConfig = {
|
|
|
14
14
|
defaultTTL: 259200000,
|
|
15
15
|
defaultPriority: 5,
|
|
16
16
|
warningThreshold: 0.8,
|
|
17
|
-
|
|
18
|
-
// if not, will use a in-memory object instead
|
|
19
|
-
storage: new StorageHelper_1.StorageHelper().getStorage(),
|
|
17
|
+
storage: (0, utils_1.getDefaultStorageWithFallback)(),
|
|
20
18
|
};
|
|
21
19
|
/**
|
|
22
20
|
* return the byte size of the string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.1-console-preview.
|
|
1
|
+
export declare const version = "6.0.1-console-preview.047a1dd.0+047a1dd";
|
package/lib/Platform/version.js
CHANGED
|
@@ -127,7 +127,7 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
127
127
|
});
|
|
128
128
|
this._publicKey = publicKey;
|
|
129
129
|
return new Promise(function (resolve, reject) {
|
|
130
|
-
if ((0, JS_1.
|
|
130
|
+
if ((0, JS_1.isBrowser)()) {
|
|
131
131
|
(0, AssertError_1.asserts)(_this._registration !== undefined, {
|
|
132
132
|
name: Constants_1.SERVICE_WORKER_EXCEPTION,
|
|
133
133
|
message: 'Service Worker registration is undefined',
|
package/lib/Util/JS.d.ts
CHANGED
|
@@ -6,10 +6,7 @@ export declare const isTextFile: (contentType: string) => boolean;
|
|
|
6
6
|
export declare const generateRandomString: () => string;
|
|
7
7
|
export declare const makeQuerablePromise: (promise: any) => any;
|
|
8
8
|
export declare const isWebWorker: () => boolean;
|
|
9
|
-
export declare const
|
|
10
|
-
isBrowser: boolean;
|
|
11
|
-
isNode: boolean;
|
|
12
|
-
};
|
|
9
|
+
export declare const isBrowser: () => boolean;
|
|
13
10
|
/**
|
|
14
11
|
* transfer the first letter of the keys to lowercase
|
|
15
12
|
* @param {Object} obj - the object need to be transferred
|
package/lib/Util/JS.js
CHANGED
|
@@ -2,7 +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.isStrictObject = exports.transferKeyToUpperCase = exports.transferKeyToLowerCase = exports.
|
|
5
|
+
exports.isStrictObject = exports.transferKeyToUpperCase = exports.transferKeyToLowerCase = exports.isBrowser = exports.isWebWorker = exports.makeQuerablePromise = exports.generateRandomString = exports.isTextFile = exports.filenameToContentType = exports.objectLessAttributes = exports.sortByField = exports.isEmpty = void 0;
|
|
6
6
|
var MIME_MAP = [
|
|
7
7
|
{ type: 'text/plain', ext: 'txt' },
|
|
8
8
|
{ type: 'text/html', ext: 'html' },
|
|
@@ -144,17 +144,10 @@ var isWebWorker = function () {
|
|
|
144
144
|
self instanceof selfContext.WorkerGlobalScope);
|
|
145
145
|
};
|
|
146
146
|
exports.isWebWorker = isWebWorker;
|
|
147
|
-
var
|
|
148
|
-
|
|
149
|
-
var isNode = typeof process !== 'undefined' &&
|
|
150
|
-
process.versions != null &&
|
|
151
|
-
process.versions.node != null;
|
|
152
|
-
return {
|
|
153
|
-
isBrowser: isBrowser,
|
|
154
|
-
isNode: isNode,
|
|
155
|
-
};
|
|
147
|
+
var isBrowser = function () {
|
|
148
|
+
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
156
149
|
};
|
|
157
|
-
exports.
|
|
150
|
+
exports.isBrowser = isBrowser;
|
|
158
151
|
/**
|
|
159
152
|
* transfer the first letter of the keys to lowercase
|
|
160
153
|
* @param {Object} obj - the object need to be transferred
|
package/lib/Util/Reachability.js
CHANGED
|
@@ -22,9 +22,6 @@ var ReachabilityNavigator = /** @class */ (function () {
|
|
|
22
22
|
function ReachabilityNavigator() {
|
|
23
23
|
}
|
|
24
24
|
ReachabilityNavigator.prototype.networkMonitor = function (netInfo) {
|
|
25
|
-
if ((0, JS_1.browserOrNode)().isNode) {
|
|
26
|
-
return zen_observable_ts_1.default.from([{ online: true }]);
|
|
27
|
-
}
|
|
28
25
|
var globalObj = (0, JS_1.isWebWorker)() ? self : window;
|
|
29
26
|
return new zen_observable_ts_1.default(function (observer) {
|
|
30
27
|
observer.next({ online: globalObj.navigator.onLine });
|
|
@@ -2,4 +2,4 @@ import { RetryOptions } from '../middleware/retry';
|
|
|
2
2
|
import { SigningOptions } from '../middleware/signing';
|
|
3
3
|
import { UserAgentOptions } from '../middleware/userAgent';
|
|
4
4
|
import { HttpRequest, HttpResponse } from '../types';
|
|
5
|
-
export declare const authenticatedHandler: (request: HttpRequest, options: UserAgentOptions & RetryOptions<HttpResponse> & SigningOptions) => Promise<HttpResponse>;
|
|
5
|
+
export declare const authenticatedHandler: (request: HttpRequest, options: UserAgentOptions & RetryOptions<HttpResponse> & SigningOptions & import("../types").HttpTransferOptions) => Promise<HttpResponse>;
|
|
@@ -50,7 +50,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
50
50
|
};
|
|
51
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
52
|
exports.fetchTransferHandler = void 0;
|
|
53
|
-
require("isomorphic-unfetch"); // TODO: remove this dependency in v6
|
|
54
53
|
var memoization_1 = require("../utils/memoization");
|
|
55
54
|
var shouldSendBody = function (method) {
|
|
56
55
|
return !['HEAD', 'GET', 'DELETE'].includes(method.toUpperCase());
|
|
@@ -58,7 +57,7 @@ var shouldSendBody = function (method) {
|
|
|
58
57
|
// TODO[AllanZhengYP]: we need to provide isCanceledError utility
|
|
59
58
|
var fetchTransferHandler = function (_a, _b) {
|
|
60
59
|
var url = _a.url, method = _a.method, headers = _a.headers, body = _a.body;
|
|
61
|
-
var abortSignal = _b.abortSignal;
|
|
60
|
+
var abortSignal = _b.abortSignal, cache = _b.cache;
|
|
62
61
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
63
62
|
var resp, e_1, responseHeaders, httpResponse, bodyWithMixin;
|
|
64
63
|
var _c, _d;
|
|
@@ -71,6 +70,7 @@ var fetchTransferHandler = function (_a, _b) {
|
|
|
71
70
|
headers: headers,
|
|
72
71
|
body: shouldSendBody(method) ? body : undefined,
|
|
73
72
|
signal: abortSignal,
|
|
73
|
+
cache: cache,
|
|
74
74
|
})];
|
|
75
75
|
case 1:
|
|
76
76
|
resp = _e.sent();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RetryOptions } from '../middleware/retry';
|
|
2
2
|
import { UserAgentOptions } from '../middleware/userAgent';
|
|
3
3
|
import { HttpRequest, HttpResponse } from '../types';
|
|
4
|
-
export declare const unauthenticatedHandler: (request: HttpRequest, options: UserAgentOptions & RetryOptions<HttpResponse>) => Promise<HttpResponse>;
|
|
4
|
+
export declare const unauthenticatedHandler: (request: HttpRequest, options: UserAgentOptions & RetryOptions<HttpResponse> & import("../types").HttpTransferOptions) => Promise<HttpResponse>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ServiceClientOptions } from '../types/aws';
|
|
2
2
|
import { TransferHandler, Endpoint } from '../types/core';
|
|
3
3
|
import { HttpRequest, HttpResponse } from '../types/http';
|
|
4
|
-
export declare const composeServiceApi: <TransferHandlerOptions, Input, Output, DefaultConfig>(transferHandler: TransferHandler<HttpRequest, HttpResponse, TransferHandlerOptions>, serializer: (input: Input, endpoint: Endpoint) => Promise<HttpRequest> | HttpRequest, deserializer: (output: HttpResponse) => Promise<Output>, defaultConfig: Partial<DefaultConfig>) => (config: OptionalizeKey<TransferHandlerOptions & ServiceClientOptions & Partial<DefaultConfig> & InferEndpointResolverOptionType<DefaultConfig>,
|
|
5
|
-
type OptionalizeKey<
|
|
6
|
-
[
|
|
4
|
+
export declare const composeServiceApi: <TransferHandlerOptions, Input, Output, DefaultConfig>(transferHandler: TransferHandler<HttpRequest, HttpResponse, TransferHandlerOptions>, serializer: (input: Input, endpoint: Endpoint) => Promise<HttpRequest> | HttpRequest, deserializer: (output: HttpResponse) => Promise<Output>, defaultConfig: Partial<DefaultConfig>) => (config: OptionalizeKey<TransferHandlerOptions & ServiceClientOptions & Partial<DefaultConfig> & InferEndpointResolverOptionType<DefaultConfig>, DefaultConfig>, input: Input) => Promise<Output>;
|
|
5
|
+
type OptionalizeKey<InputType, InputDefaultsType> = {
|
|
6
|
+
[KeyWithDefaultValue in keyof InputDefaultsType]?: KeyWithDefaultValue extends keyof InputType ? InputType[KeyWithDefaultValue] : never;
|
|
7
|
+
} & {
|
|
8
|
+
[KeyWithoutDefaultValue in keyof Omit<InputType, keyof InputDefaultsType>]: InputType[KeyWithoutDefaultValue];
|
|
7
9
|
};
|
|
8
10
|
type InferEndpointResolverOptionType<T> = T extends {
|
|
9
11
|
endpointResolver: (options: infer EndpointOptions) => any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MetadataBearer } from '@aws-sdk/types';
|
|
2
2
|
import { Endpoint } from './core';
|
|
3
3
|
import { HttpResponse } from './http';
|
|
4
|
-
export type { Credentials, MetadataBearer } from '@aws-sdk/types';
|
|
4
|
+
export type { AwsCredentialIdentity as Credentials, MetadataBearer, } from '@aws-sdk/types';
|
|
5
5
|
export type SourceData = string | ArrayBuffer | ArrayBufferView;
|
|
6
6
|
/**
|
|
7
7
|
* Basic option type for endpoint resolvers. It contains region only.
|
|
@@ -18,7 +18,3 @@ export interface ServiceClientOptions {
|
|
|
18
18
|
* This function is protocol-specific (e.g. JSON, XML, etc.)
|
|
19
19
|
*/
|
|
20
20
|
export type ErrorParser = (response?: HttpResponse) => Promise<(Error & MetadataBearer) | undefined>;
|
|
21
|
-
/**
|
|
22
|
-
* Default config options for the `composeServiceApi`.
|
|
23
|
-
*/
|
|
24
|
-
export type DefaultConfigOptions<TransferHandlerOptions extends Record<string, unknown> = Record<string, unknown>> = Partial<TransferHandlerOptions & ServiceClientOptions>;
|
|
@@ -26,5 +26,13 @@ export interface HttpResponse extends Response {
|
|
|
26
26
|
}
|
|
27
27
|
export interface HttpTransferOptions {
|
|
28
28
|
abortSignal?: AbortSignal;
|
|
29
|
+
/**
|
|
30
|
+
* Cache mode for the request. Note that this is only effective when the underlying HTTP handler is fetch.
|
|
31
|
+
* For XHR handler, or Node.js `"http(s)"` module or running on React Native, this option is ignored.
|
|
32
|
+
* Instead, you can configure the `Cache-Control` headers to achieve similar effects.
|
|
33
|
+
* @default 'default'
|
|
34
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/cache}
|
|
35
|
+
*/
|
|
36
|
+
cache?: RequestCache;
|
|
29
37
|
}
|
|
30
38
|
export type HttpTransferHandler = TransferHandler<HttpRequest, HttpResponse, HttpTransferOptions>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Middleware, MiddlewareHandler, Request, Response, TransferHandler, Endpoint, } from './core';
|
|
2
2
|
export { Headers, HttpRequest, HttpResponse, HttpTransferHandler, HttpTransferOptions, ResponseBodyMixin, } from './http';
|
|
3
|
-
export { Credentials, EndpointResolverOptions, ErrorParser, ServiceClientOptions,
|
|
3
|
+
export { Credentials, EndpointResolverOptions, ErrorParser, ServiceClientOptions, } from './aws';
|
package/lib/index.d.ts
CHANGED
|
@@ -5,11 +5,10 @@ export { AuthConfig, AuthUserPoolConfig, AuthUserPoolAndIdentityPoolConfig, Stor
|
|
|
5
5
|
export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, clearCredentials, } from './singleton';
|
|
6
6
|
export { getCredentialsForIdentity, getId, GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, } from './AwsClients/CognitoIdentity';
|
|
7
7
|
export { UserProfile } from './types';
|
|
8
|
-
export {
|
|
8
|
+
export { CookieStorage, defaultStorage, sessionStorage, sharedInMemoryStorage, } from './storage';
|
|
9
9
|
export { KeyValueStorageInterface } from './types';
|
|
10
10
|
import { BrowserStorageCache } from './Cache/BrowserStorageCache';
|
|
11
11
|
export { InMemoryCache } from './Cache/InMemoryCache';
|
|
12
12
|
export { BrowserStorageCache };
|
|
13
13
|
export { BrowserStorageCache as Cache };
|
|
14
14
|
export { I18n } from './I18n';
|
|
15
|
-
export { parseAWSExports } from './parseAWSExports';
|
package/lib/index.js
CHANGED
|
@@ -2,7 +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.
|
|
5
|
+
exports.I18n = exports.Cache = exports.BrowserStorageCache = exports.InMemoryCache = exports.sharedInMemoryStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.getId = exports.getCredentialsForIdentity = exports.clearCredentials = exports.AmplifyClassV6 = exports.fetchAuthSession = exports.Amplify = exports.Hub = void 0;
|
|
6
6
|
/*
|
|
7
7
|
This file maps top-level exports from `@aws-amplify/core`. These are intended to be potentially customer-facing exports.
|
|
8
8
|
*/
|
|
@@ -19,13 +19,11 @@ var CognitoIdentity_1 = require("./AwsClients/CognitoIdentity");
|
|
|
19
19
|
Object.defineProperty(exports, "getCredentialsForIdentity", { enumerable: true, get: function () { return CognitoIdentity_1.getCredentialsForIdentity; } });
|
|
20
20
|
Object.defineProperty(exports, "getId", { enumerable: true, get: function () { return CognitoIdentity_1.getId; } });
|
|
21
21
|
// Storage helpers
|
|
22
|
-
var
|
|
23
|
-
Object.defineProperty(exports, "
|
|
24
|
-
Object.defineProperty(exports, "
|
|
25
|
-
Object.defineProperty(exports, "
|
|
26
|
-
Object.defineProperty(exports, "
|
|
27
|
-
Object.defineProperty(exports, "SessionStorage", { enumerable: true, get: function () { return StorageHelper_1.SessionStorage; } });
|
|
28
|
-
Object.defineProperty(exports, "MemoryKeyValueStorage", { enumerable: true, get: function () { return StorageHelper_1.MemoryKeyValueStorage; } });
|
|
22
|
+
var storage_1 = require("./storage");
|
|
23
|
+
Object.defineProperty(exports, "CookieStorage", { enumerable: true, get: function () { return storage_1.CookieStorage; } });
|
|
24
|
+
Object.defineProperty(exports, "defaultStorage", { enumerable: true, get: function () { return storage_1.defaultStorage; } });
|
|
25
|
+
Object.defineProperty(exports, "sessionStorage", { enumerable: true, get: function () { return storage_1.sessionStorage; } });
|
|
26
|
+
Object.defineProperty(exports, "sharedInMemoryStorage", { enumerable: true, get: function () { return storage_1.sharedInMemoryStorage; } });
|
|
29
27
|
// Cache exports
|
|
30
28
|
var BrowserStorageCache_1 = require("./Cache/BrowserStorageCache");
|
|
31
29
|
Object.defineProperty(exports, "BrowserStorageCache", { enumerable: true, get: function () { return BrowserStorageCache_1.BrowserStorageCache; } });
|
|
@@ -35,5 +33,3 @@ Object.defineProperty(exports, "InMemoryCache", { enumerable: true, get: functio
|
|
|
35
33
|
// Internationalization utilities
|
|
36
34
|
var I18n_1 = require("./I18n");
|
|
37
35
|
Object.defineProperty(exports, "I18n", { enumerable: true, get: function () { return I18n_1.I18n; } });
|
|
38
|
-
var parseAWSExports_1 = require("./parseAWSExports");
|
|
39
|
-
Object.defineProperty(exports, "parseAWSExports", { enumerable: true, get: function () { return parseAWSExports_1.parseAWSExports; } });
|
package/lib/libraryUtils.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { isBrowser, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './Util/JS';
|
|
2
|
+
export { parseAWSExports } from './parseAWSExports';
|
|
3
|
+
export { LegacyConfig } from './singleton/types';
|
|
2
4
|
export { JWT, StrictUnion, CognitoIdentityPoolConfig, } from './singleton/Auth/types';
|
|
3
5
|
export { decodeJWT, assertTokenProviderConfig, assertIdentityPooIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
|
|
4
6
|
export { isTokenExpired } from './singleton/Auth';
|
|
@@ -14,8 +16,6 @@ export { ServiceWorker } from './ServiceWorker';
|
|
|
14
16
|
export { AWS_CLOUDWATCH_CATEGORY, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
|
|
15
17
|
export { asserts } from './Util/errors/AssertError';
|
|
16
18
|
export { invalidParameter, missingConfig, AmplifyError, AmplifyErrorString, } from './Util/Errors';
|
|
17
|
-
export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
|
|
18
|
-
export { AppState, AsyncStorage, Linking } from './RNComponents';
|
|
19
19
|
export { ErrorParams, AmplifyErrorMap, ServiceError } from './types';
|
|
20
20
|
export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './Util/Constants';
|
|
21
21
|
export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
|
package/lib/libraryUtils.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
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.
|
|
6
|
-
exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.
|
|
5
|
+
exports.Reachability = exports.RETRY_ERROR_CODES = exports.NonRetryableError = exports.NO_CREDS_ERROR_STRING = exports.Mutex = exports.DateUtils = exports.BackgroundProcessManagerState = exports.BackgroundProcessManager = exports.BackgroundManagerNotOpenError = exports.AWS_CLOUDWATCH_CATEGORY = exports.ServiceWorker = exports.Constants = exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InAppMessagingAction = exports.InteractionsAction = exports.GeoAction = exports.Framework = exports.DataStoreAction = exports.Category = exports.AnalyticsAction = exports.AuthAction = exports.ApiAction = exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.ClientDevice = exports.Logger = exports.ConsoleLogger = exports.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPooIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.parseAWSExports = exports.transferKeyToUpperCase = exports.transferKeyToLowerCase = exports.sortByField = exports.objectLessAttributes = exports.makeQuerablePromise = exports.isWebWorker = exports.isTextFile = exports.isStrictObject = exports.isEmpty = exports.generateRandomString = exports.filenameToContentType = exports.isBrowser = void 0;
|
|
6
|
+
exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.AmplifyErrorString = exports.AmplifyError = exports.missingConfig = exports.invalidParameter = exports.asserts = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isNonRetryableError = void 0;
|
|
7
7
|
/*
|
|
8
8
|
This file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal
|
|
9
9
|
utils for use throughout the library.
|
|
10
10
|
*/
|
|
11
11
|
// JS utilities
|
|
12
12
|
var JS_1 = require("./Util/JS");
|
|
13
|
-
Object.defineProperty(exports, "
|
|
13
|
+
Object.defineProperty(exports, "isBrowser", { enumerable: true, get: function () { return JS_1.isBrowser; } });
|
|
14
14
|
Object.defineProperty(exports, "filenameToContentType", { enumerable: true, get: function () { return JS_1.filenameToContentType; } });
|
|
15
15
|
Object.defineProperty(exports, "generateRandomString", { enumerable: true, get: function () { return JS_1.generateRandomString; } });
|
|
16
16
|
Object.defineProperty(exports, "isEmpty", { enumerable: true, get: function () { return JS_1.isEmpty; } });
|
|
@@ -22,6 +22,8 @@ Object.defineProperty(exports, "objectLessAttributes", { enumerable: true, get:
|
|
|
22
22
|
Object.defineProperty(exports, "sortByField", { enumerable: true, get: function () { return JS_1.sortByField; } });
|
|
23
23
|
Object.defineProperty(exports, "transferKeyToLowerCase", { enumerable: true, get: function () { return JS_1.transferKeyToLowerCase; } });
|
|
24
24
|
Object.defineProperty(exports, "transferKeyToUpperCase", { enumerable: true, get: function () { return JS_1.transferKeyToUpperCase; } });
|
|
25
|
+
var parseAWSExports_1 = require("./parseAWSExports");
|
|
26
|
+
Object.defineProperty(exports, "parseAWSExports", { enumerable: true, get: function () { return parseAWSExports_1.parseAWSExports; } });
|
|
25
27
|
// Auth utilities
|
|
26
28
|
var utils_1 = require("./singleton/Auth/utils");
|
|
27
29
|
Object.defineProperty(exports, "decodeJWT", { enumerable: true, get: function () { return utils_1.decodeJWT; } });
|
|
@@ -89,13 +91,6 @@ Object.defineProperty(exports, "invalidParameter", { enumerable: true, get: func
|
|
|
89
91
|
Object.defineProperty(exports, "missingConfig", { enumerable: true, get: function () { return Errors_1.missingConfig; } });
|
|
90
92
|
Object.defineProperty(exports, "AmplifyError", { enumerable: true, get: function () { return Errors_1.AmplifyError; } });
|
|
91
93
|
Object.defineProperty(exports, "AmplifyErrorString", { enumerable: true, get: function () { return Errors_1.AmplifyErrorString; } });
|
|
92
|
-
var OAuthHelper_1 = require("./OAuthHelper");
|
|
93
|
-
Object.defineProperty(exports, "FacebookOAuth", { enumerable: true, get: function () { return OAuthHelper_1.FacebookOAuth; } });
|
|
94
|
-
Object.defineProperty(exports, "GoogleOAuth", { enumerable: true, get: function () { return OAuthHelper_1.GoogleOAuth; } });
|
|
95
|
-
var RNComponents_1 = require("./RNComponents");
|
|
96
|
-
Object.defineProperty(exports, "AppState", { enumerable: true, get: function () { return RNComponents_1.AppState; } });
|
|
97
|
-
Object.defineProperty(exports, "AsyncStorage", { enumerable: true, get: function () { return RNComponents_1.AsyncStorage; } });
|
|
98
|
-
Object.defineProperty(exports, "Linking", { enumerable: true, get: function () { return RNComponents_1.Linking; } });
|
|
99
94
|
var Constants_1 = require("./Util/Constants");
|
|
100
95
|
Object.defineProperty(exports, "INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER", { enumerable: true, get: function () { return Constants_1.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER; } });
|
|
101
96
|
Object.defineProperty(exports, "USER_AGENT_HEADER", { enumerable: true, get: function () { return Constants_1.USER_AGENT_HEADER; } });
|
package/lib/parseAWSExports.js
CHANGED
|
@@ -12,6 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.parseAWSExports = void 0;
|
|
15
|
+
var authTypeMapping = {
|
|
16
|
+
API_KEY: 'apiKey',
|
|
17
|
+
AWS_IAM: 'iam',
|
|
18
|
+
AMAZON_COGNITO_USER_POOLS: 'jwt',
|
|
19
|
+
};
|
|
15
20
|
/**
|
|
16
21
|
* This utility converts the `aws-exports.js` file generated by the Amplify CLI into a {@link ResourcesConfig} object
|
|
17
22
|
* consumable by Amplify.
|
|
@@ -22,7 +27,7 @@ exports.parseAWSExports = void 0;
|
|
|
22
27
|
*/
|
|
23
28
|
var parseAWSExports = function (config) {
|
|
24
29
|
if (config === void 0) { config = {}; }
|
|
25
|
-
var aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth;
|
|
30
|
+
var aws_appsync_apiKey = config.aws_appsync_apiKey, aws_appsync_authenticationType = config.aws_appsync_authenticationType, aws_appsync_graphqlEndpoint = config.aws_appsync_graphqlEndpoint, aws_appsync_region = config.aws_appsync_region, aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth;
|
|
26
31
|
var amplifyConfig = {};
|
|
27
32
|
// Analytics
|
|
28
33
|
if (aws_mobile_analytics_app_id) {
|
|
@@ -33,6 +38,20 @@ var parseAWSExports = function (config) {
|
|
|
33
38
|
},
|
|
34
39
|
};
|
|
35
40
|
}
|
|
41
|
+
// TODO: Need to support all API configurations
|
|
42
|
+
// API
|
|
43
|
+
if (aws_appsync_graphqlEndpoint) {
|
|
44
|
+
amplifyConfig.API = {
|
|
45
|
+
AppSync: {
|
|
46
|
+
defaultAuthMode: {
|
|
47
|
+
type: authTypeMapping[aws_appsync_authenticationType],
|
|
48
|
+
apiKey: aws_appsync_apiKey,
|
|
49
|
+
},
|
|
50
|
+
endpoint: aws_appsync_graphqlEndpoint,
|
|
51
|
+
region: aws_appsync_region,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
36
55
|
// Auth
|
|
37
56
|
if (aws_cognito_identity_pool_id || aws_user_pools_id) {
|
|
38
57
|
amplifyConfig.Auth = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PinpointRecordInput } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const record: ({ appId, category, credentials, event, identityId, region, userAgentValue, }:
|
|
5
|
+
export declare const record: ({ appId, category, credentials, event, identityId, region, userAgentValue, }: PinpointRecordInput) => Promise<void>;
|
|
@@ -71,7 +71,7 @@ var record = function (_a) {
|
|
|
71
71
|
identityId: identityId,
|
|
72
72
|
region: region,
|
|
73
73
|
resendLimit: constants_1.RESEND_LIMIT,
|
|
74
|
-
userAgentValue: userAgentValue
|
|
74
|
+
userAgentValue: userAgentValue,
|
|
75
75
|
});
|
|
76
76
|
if (!!endpointId) return [3 /*break*/, 4];
|
|
77
77
|
return [4 /*yield*/, (0, updateEndpoint_1.updateEndpoint)({
|
|
@@ -92,7 +92,7 @@ var record = function (_a) {
|
|
|
92
92
|
if (!endpointId) {
|
|
93
93
|
throw new libraryUtils_1.AmplifyError({
|
|
94
94
|
name: 'ENDPOINT_NOT_CREATED',
|
|
95
|
-
message: 'Endpoint was not created.'
|
|
95
|
+
message: 'Endpoint was not created.',
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
// Generate session if required
|
|
@@ -110,7 +110,7 @@ var record = function (_a) {
|
|
|
110
110
|
event: event,
|
|
111
111
|
session: session,
|
|
112
112
|
timestamp: timestampISOString,
|
|
113
|
-
resendLimit: constants_1.RESEND_LIMIT
|
|
113
|
+
resendLimit: constants_1.RESEND_LIMIT,
|
|
114
114
|
});
|
|
115
115
|
return [2 /*return*/];
|
|
116
116
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PinpointUpdateEndpointInput } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const updateEndpoint: ({ address, appId, category, channelType, credentials, identityId, optOut, region, userId, userProfile, userAgentValue, }:
|
|
5
|
+
export declare const updateEndpoint: ({ address, appId, category, channelType, credentials, identityId, optOut, region, userId, userProfile, userAgentValue, }: PinpointUpdateEndpointInput) => Promise<void>;
|