@aws-amplify/core 4.7.13-unstable.2 → 4.7.13
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/CHANGELOG.md +19 -0
- package/build.js +5 -0
- package/dist/aws-amplify-core.js +42702 -0
- package/dist/aws-amplify-core.js.map +1 -0
- package/dist/aws-amplify-core.min.js +32 -0
- package/dist/aws-amplify-core.min.js.map +1 -0
- package/index.js +7 -0
- package/lib/Amplify.js +21 -3
- package/lib/Amplify.js.map +1 -1
- package/lib/ClientDevice/android.js +12 -2
- package/lib/ClientDevice/android.js.map +1 -1
- package/lib/ClientDevice/browser.js +12 -2
- package/lib/ClientDevice/browser.js.map +1 -1
- package/lib/ClientDevice/index.js +16 -2
- package/lib/ClientDevice/index.js.map +1 -1
- package/lib/ClientDevice/ios.js +12 -2
- package/lib/ClientDevice/ios.js.map +1 -1
- package/lib/ClientDevice/reactnative.js +16 -2
- package/lib/ClientDevice/reactnative.js.map +1 -1
- package/lib/Credentials.js +90 -59
- package/lib/Credentials.js.map +1 -1
- package/lib/Errors.js +12 -2
- package/lib/Errors.js.map +1 -1
- package/lib/Hub.js +57 -41
- package/lib/Hub.js.map +1 -1
- package/lib/I18n/I18n.js +12 -2
- package/lib/I18n/I18n.js.map +1 -1
- package/lib/I18n/index.js +16 -2
- package/lib/I18n/index.js.map +1 -1
- package/lib/I18n/types.js +12 -2
- package/lib/I18n/types.js.map +1 -1
- package/lib/JS.js +39 -4
- package/lib/JS.js.map +1 -1
- package/lib/Logger/ConsoleLogger.js +50 -10
- package/lib/Logger/ConsoleLogger.js.map +1 -1
- package/lib/Logger/index.js +16 -5
- package/lib/Logger/index.js.map +1 -1
- package/lib/Logger/logger-interface.js +12 -2
- package/lib/Logger/logger-interface.js.map +1 -1
- package/lib/OAuthHelper/FacebookOAuth.js +54 -5
- package/lib/OAuthHelper/FacebookOAuth.js.map +1 -1
- package/lib/OAuthHelper/GoogleOAuth.js +54 -5
- package/lib/OAuthHelper/GoogleOAuth.js.map +1 -1
- package/lib/OAuthHelper/index.js +12 -2
- package/lib/OAuthHelper/index.js.map +1 -1
- package/lib/{parseAWSExports.js → Parser.js} +28 -4
- package/lib/Parser.js.map +1 -0
- package/lib/Platform/index.js +16 -2
- package/lib/Platform/index.js.map +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/Platform/version.js.map +1 -1
- package/lib/Providers/AWSCloudWatchProvider.js +97 -32
- package/lib/Providers/AWSCloudWatchProvider.js.map +1 -1
- package/lib/Providers/index.js +4 -2
- package/lib/Providers/index.js.map +1 -1
- package/lib/RNComponents/index.js +12 -2
- package/lib/RNComponents/index.js.map +1 -1
- package/lib/RNComponents/reactnative.js +16 -4
- package/lib/RNComponents/reactnative.js.map +1 -1
- package/lib/ServiceWorker/ServiceWorker.js +4 -0
- package/lib/ServiceWorker/ServiceWorker.js.map +1 -1
- package/lib/Signer.js +43 -8
- package/lib/Signer.js.map +1 -1
- package/lib/StorageHelper/index.js +16 -2
- package/lib/StorageHelper/index.js.map +1 -1
- package/lib/StorageHelper/reactnative.js +20 -4
- package/lib/StorageHelper/reactnative.js.map +1 -1
- package/lib/UniversalStorage/index.js +4 -2
- package/lib/UniversalStorage/index.js.map +1 -1
- package/lib/Util/BackgroundProcessManager.js +69 -10
- package/lib/Util/BackgroundProcessManager.js.map +1 -1
- package/lib/Util/CognitoIdentityClient.js +41 -0
- package/lib/Util/CognitoIdentityClient.js.map +1 -0
- package/lib/Util/Constants.js +12 -2
- package/lib/Util/Constants.js.map +1 -1
- package/lib/Util/DateUtils.js +17 -2
- package/lib/Util/DateUtils.js.map +1 -1
- package/lib/Util/Reachability.js +16 -3
- package/lib/Util/Reachability.js.map +1 -1
- package/lib/Util/Reachability.native.js +4 -2
- package/lib/Util/Reachability.native.js.map +1 -1
- package/lib/Util/Retry.js +78 -10
- package/lib/Util/Retry.js.map +1 -1
- package/lib/Util/index.js +8 -23
- package/lib/Util/index.js.map +1 -1
- package/lib/constants.js +12 -2
- package/lib/constants.js.map +1 -1
- package/lib/index.js +25 -54
- package/lib/index.js.map +1 -1
- package/lib-esm/Amplify.d.ts +4 -1
- package/lib-esm/Amplify.js +20 -2
- package/lib-esm/Amplify.js.map +1 -1
- package/lib-esm/ClientDevice/android.js +12 -2
- package/lib-esm/ClientDevice/android.js.map +1 -1
- package/lib-esm/ClientDevice/browser.js +12 -2
- package/lib-esm/ClientDevice/browser.js.map +1 -1
- package/lib-esm/ClientDevice/index.d.ts +4 -0
- package/lib-esm/ClientDevice/index.js +16 -2
- package/lib-esm/ClientDevice/index.js.map +1 -1
- package/lib-esm/ClientDevice/ios.js +12 -2
- package/lib-esm/ClientDevice/ios.js.map +1 -1
- package/lib-esm/ClientDevice/reactnative.d.ts +7 -0
- package/lib-esm/ClientDevice/reactnative.js +16 -2
- package/lib-esm/ClientDevice/reactnative.js.map +1 -1
- package/lib-esm/Credentials.d.ts +4 -0
- package/lib-esm/Credentials.js +63 -32
- package/lib-esm/Credentials.js.map +1 -1
- package/lib-esm/Errors.js +12 -2
- package/lib-esm/Errors.js.map +1 -1
- package/lib-esm/Hub.d.ts +4 -28
- package/lib-esm/Hub.js +52 -36
- package/lib-esm/Hub.js.map +1 -1
- package/lib-esm/I18n/I18n.js +12 -2
- package/lib-esm/I18n/I18n.js.map +1 -1
- package/lib-esm/I18n/index.d.ts +4 -0
- package/lib-esm/I18n/index.js +16 -2
- package/lib-esm/I18n/index.js.map +1 -1
- package/lib-esm/I18n/types.js +12 -2
- package/lib-esm/I18n/types.js.map +1 -1
- package/lib-esm/JS.d.ts +24 -0
- package/lib-esm/JS.js +39 -4
- package/lib-esm/JS.js.map +1 -1
- package/lib-esm/Logger/ConsoleLogger.js +43 -3
- package/lib-esm/Logger/ConsoleLogger.js.map +1 -1
- package/lib-esm/Logger/index.d.ts +1 -1
- package/lib-esm/Logger/index.js +13 -3
- package/lib-esm/Logger/index.js.map +1 -1
- package/lib-esm/Logger/logger-interface.d.ts +4 -0
- package/lib-esm/Logger/logger-interface.js +12 -2
- package/lib-esm/Logger/logger-interface.js.map +1 -1
- package/lib-esm/OAuthHelper/FacebookOAuth.d.ts +4 -0
- package/lib-esm/OAuthHelper/FacebookOAuth.js +52 -3
- package/lib-esm/OAuthHelper/FacebookOAuth.js.map +1 -1
- package/lib-esm/OAuthHelper/GoogleOAuth.d.ts +4 -0
- package/lib-esm/OAuthHelper/GoogleOAuth.js +52 -3
- package/lib-esm/OAuthHelper/GoogleOAuth.js.map +1 -1
- package/lib-esm/OAuthHelper/index.js +12 -2
- package/lib-esm/OAuthHelper/index.js.map +1 -1
- package/lib-esm/Parser.d.ts +12 -0
- package/lib-esm/{parseAWSExports.js → Parser.js} +27 -3
- package/lib-esm/Parser.js.map +1 -0
- package/lib-esm/Platform/index.d.ts +4 -0
- package/lib-esm/Platform/index.js +16 -2
- package/lib-esm/Platform/index.js.map +1 -1
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/Platform/version.js.map +1 -1
- package/lib-esm/Providers/AWSCloudWatchProvider.js +70 -5
- package/lib-esm/Providers/AWSCloudWatchProvider.js.map +1 -1
- package/lib-esm/Providers/index.d.ts +1 -1
- package/lib-esm/Providers/index.js +1 -1
- package/lib-esm/Providers/index.js.map +1 -1
- package/lib-esm/RNComponents/index.js +12 -2
- package/lib-esm/RNComponents/index.js.map +1 -1
- package/lib-esm/RNComponents/reactnative.js +12 -2
- package/lib-esm/RNComponents/reactnative.js.map +1 -1
- package/lib-esm/ServiceWorker/ServiceWorker.d.ts +4 -0
- package/lib-esm/ServiceWorker/ServiceWorker.js +4 -0
- package/lib-esm/ServiceWorker/ServiceWorker.js.map +1 -1
- package/lib-esm/Signer.d.ts +4 -0
- package/lib-esm/Signer.js +38 -3
- package/lib-esm/Signer.js.map +1 -1
- package/lib-esm/StorageHelper/index.d.ts +4 -0
- package/lib-esm/StorageHelper/index.js +16 -2
- package/lib-esm/StorageHelper/index.js.map +1 -1
- package/lib-esm/StorageHelper/reactnative.d.ts +4 -0
- package/lib-esm/StorageHelper/reactnative.js +16 -2
- package/lib-esm/StorageHelper/reactnative.js.map +1 -1
- package/lib-esm/Util/BackgroundProcessManager.js +60 -1
- package/lib-esm/Util/BackgroundProcessManager.js.map +1 -1
- package/lib-esm/Util/CognitoIdentityClient.d.ts +14 -0
- package/lib-esm/Util/CognitoIdentityClient.js +37 -0
- package/lib-esm/Util/CognitoIdentityClient.js.map +1 -0
- package/lib-esm/Util/Constants.js +12 -2
- package/lib-esm/Util/Constants.js.map +1 -1
- package/lib-esm/Util/DateUtils.js +16 -1
- package/lib-esm/Util/DateUtils.js.map +1 -1
- package/lib-esm/Util/Reachability.js +11 -1
- package/lib-esm/Util/Reachability.js.map +1 -1
- package/lib-esm/Util/Retry.d.ts +0 -1
- package/lib-esm/Util/Retry.js +70 -2
- package/lib-esm/Util/Retry.js.map +1 -1
- package/lib-esm/Util/index.d.ts +5 -5
- package/lib-esm/Util/index.js +5 -5
- package/lib-esm/Util/index.js.map +1 -1
- package/lib-esm/constants.js +12 -2
- package/lib-esm/constants.js.map +1 -1
- package/lib-esm/index.d.ts +9 -8
- package/lib-esm/index.js +21 -10
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/types/types.d.ts +0 -3
- package/package.json +9 -13
- package/src/Amplify.ts +5 -1
- package/src/ClientDevice/android.ts +12 -2
- package/src/ClientDevice/browser.ts +12 -2
- package/src/ClientDevice/index.ts +17 -2
- package/src/ClientDevice/ios.ts +12 -2
- package/src/ClientDevice/reactnative.ts +17 -2
- package/src/Credentials.ts +10 -42
- package/src/Errors.ts +12 -2
- package/src/Hub.ts +23 -40
- package/src/I18n/I18n.ts +12 -2
- package/src/I18n/index.ts +17 -2
- package/src/I18n/types.ts +12 -2
- package/src/JS.ts +37 -6
- package/src/Logger/ConsoleLogger.ts +12 -2
- package/src/Logger/index.ts +13 -3
- package/src/Logger/logger-interface.ts +17 -2
- package/src/OAuthHelper/FacebookOAuth.ts +17 -2
- package/src/OAuthHelper/GoogleOAuth.ts +17 -2
- package/src/OAuthHelper/index.ts +12 -2
- package/src/{parseAWSExports.ts → Parser.ts} +13 -1
- package/src/Platform/index.ts +17 -2
- package/src/Platform/version.ts +1 -1
- package/src/Providers/AWSCloudWatchProvider.ts +14 -4
- package/src/Providers/index.ts +1 -1
- package/src/RNComponents/index.ts +12 -2
- package/src/RNComponents/reactnative.ts +12 -2
- package/src/ServiceWorker/ServiceWorker.ts +6 -1
- package/src/Signer.ts +17 -2
- package/src/StorageHelper/index.ts +17 -2
- package/src/StorageHelper/reactnative.ts +17 -2
- package/src/Util/CognitoIdentityClient.ts +48 -0
- package/src/Util/Constants.ts +12 -2
- package/src/Util/Retry.ts +1 -1
- package/src/Util/index.ts +5 -23
- package/src/constants.ts +12 -2
- package/src/index.ts +21 -48
- package/src/types/types.ts +0 -3
- package/webpack.config.dev.js +6 -0
- package/lib/.tsbuildinfo +0 -3
- package/lib/Amplify.d.ts +0 -28
- package/lib/ClientDevice/android.d.ts +0 -5
- package/lib/ClientDevice/browser.d.ts +0 -25
- package/lib/ClientDevice/index.d.ts +0 -23
- package/lib/ClientDevice/ios.d.ts +0 -7
- package/lib/ClientDevice/reactnative.d.ts +0 -7
- package/lib/Credentials.d.ts +0 -47
- package/lib/Errors.d.ts +0 -2
- package/lib/Hub.d.ts +0 -55
- package/lib/I18n/I18n.d.ts +0 -59
- package/lib/I18n/index.d.ts +0 -49
- package/lib/I18n/types.d.ts +0 -3
- package/lib/JS.d.ts +0 -32
- package/lib/Logger/ConsoleLogger.d.ts +0 -80
- package/lib/Logger/index.d.ts +0 -1
- package/lib/Logger/logger-interface.d.ts +0 -8
- package/lib/OAuthHelper/FacebookOAuth.d.ts +0 -6
- package/lib/OAuthHelper/GoogleOAuth.d.ts +0 -6
- package/lib/OAuthHelper/index.d.ts +0 -4
- package/lib/Platform/index.d.ts +0 -7
- package/lib/Platform/version.d.ts +0 -1
- package/lib/Providers/AWSCloudWatchProvider.d.ts +0 -34
- package/lib/Providers/index.d.ts +0 -1
- package/lib/RNComponents/index.d.ts +0 -5
- package/lib/RNComponents/reactnative.d.ts +0 -3
- package/lib/ServiceWorker/ServiceWorker.d.ts +0 -68
- package/lib/ServiceWorker/index.d.ts +0 -13
- package/lib/Signer.d.ts +0 -41
- package/lib/StorageHelper/index.d.ts +0 -41
- package/lib/StorageHelper/reactnative.d.ts +0 -13
- package/lib/UniversalStorage/index.d.ts +0 -23
- package/lib/Util/BackgroundProcessManager.d.ts +0 -204
- package/lib/Util/Constants.d.ts +0 -8
- package/lib/Util/DateUtils.d.ts +0 -7
- package/lib/Util/Mutex.d.ts +0 -45
- package/lib/Util/Reachability.d.ts +0 -13
- package/lib/Util/Reachability.native.d.ts +0 -11
- package/lib/Util/Retry.d.ts +0 -21
- package/lib/Util/StringUtils.d.ts +0 -2
- package/lib/Util/index.d.ts +0 -7
- package/lib/constants.d.ts +0 -6
- package/lib/index.d.ts +0 -29
- package/lib/parseAWSExports.d.ts +0 -2
- package/lib/parseAWSExports.js.map +0 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/types.d.ts +0 -46
- package/lib-esm/.tsbuildinfo +0 -3
- package/lib-esm/parseAWSExports.d.ts +0 -2
- package/lib-esm/parseAWSExports.js.map +0 -1
package/src/Signer.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
+
* the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://aws.amazon.com/apache2.0/
|
|
8
|
+
*
|
|
9
|
+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
3
13
|
|
|
4
14
|
import { ConsoleLogger as Logger } from './Logger';
|
|
5
15
|
import { Sha256 as jsSha256 } from '@aws-crypto/sha256-js';
|
|
@@ -429,3 +439,8 @@ export class Signer {
|
|
|
429
439
|
return result;
|
|
430
440
|
}
|
|
431
441
|
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* @deprecated use per-function import
|
|
445
|
+
*/
|
|
446
|
+
export default Signer;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
+
* the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://aws.amazon.com/apache2.0/
|
|
8
|
+
*
|
|
9
|
+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
3
13
|
|
|
4
14
|
let dataMemory = {};
|
|
5
15
|
|
|
@@ -71,3 +81,8 @@ export class StorageHelper {
|
|
|
71
81
|
return this.storageWindow;
|
|
72
82
|
}
|
|
73
83
|
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated use named import
|
|
87
|
+
*/
|
|
88
|
+
export default StorageHelper;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
+
* the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://aws.amazon.com/apache2.0/
|
|
8
|
+
*
|
|
9
|
+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
3
13
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
4
14
|
|
|
5
15
|
const MEMORY_KEY_PREFIX = '@MemoryStorage:';
|
|
@@ -100,3 +110,8 @@ export class StorageHelper {
|
|
|
100
110
|
return this.storageWindow;
|
|
101
111
|
}
|
|
102
112
|
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @deprecated use named import
|
|
116
|
+
*/
|
|
117
|
+
export default StorageHelper;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
CognitoIdentityClient,
|
|
6
|
+
CognitoIdentityClientConfig,
|
|
7
|
+
} from '@aws-sdk/client-cognito-identity';
|
|
8
|
+
import { Provider } from '@aws-sdk/types';
|
|
9
|
+
import { getAmplifyUserAgent } from '../Platform';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Returns a CognitoIdentityClient with middleware
|
|
13
|
+
* @param {CognitoIdentityClientConfig} config
|
|
14
|
+
* @return {CognitoIdentityClient}
|
|
15
|
+
*/
|
|
16
|
+
export function createCognitoIdentityClient(
|
|
17
|
+
config: CognitoIdentityClientConfig
|
|
18
|
+
): CognitoIdentityClient {
|
|
19
|
+
const client = new CognitoIdentityClient({
|
|
20
|
+
region: config.region,
|
|
21
|
+
customUserAgent: getAmplifyUserAgent(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
client.middlewareStack.add(
|
|
25
|
+
(next, _) => (args: any) => {
|
|
26
|
+
return next(middlewareArgs(args));
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
step: 'build',
|
|
30
|
+
name: 'cacheControlMiddleWare',
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return client;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function middlewareArgs(args: { request: any; input: any }) {
|
|
38
|
+
return {
|
|
39
|
+
...args,
|
|
40
|
+
request: {
|
|
41
|
+
...args.request,
|
|
42
|
+
headers: {
|
|
43
|
+
...args.request.headers,
|
|
44
|
+
'cache-control': 'no-store',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
package/src/Util/Constants.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
+
* the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://aws.amazon.com/apache2.0/
|
|
8
|
+
*
|
|
9
|
+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
3
13
|
|
|
4
14
|
// Logging constants
|
|
5
15
|
const AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;
|
package/src/Util/Retry.ts
CHANGED
|
@@ -9,7 +9,7 @@ export class NonRetryableError extends Error {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const isNonRetryableError = (obj: any): obj is NonRetryableError => {
|
|
13
13
|
const key: keyof NonRetryableError = 'nonRetryable';
|
|
14
14
|
return obj && obj[key];
|
|
15
15
|
};
|
package/src/Util/index.ts
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
NonRetryableError,
|
|
3
|
-
isNonRetryableError,
|
|
4
|
-
jitteredBackoff,
|
|
5
|
-
jitteredExponentialRetry,
|
|
6
|
-
retry,
|
|
7
|
-
} from './Retry';
|
|
1
|
+
export * from './Retry';
|
|
8
2
|
export { default as Mutex } from './Mutex';
|
|
9
3
|
export { default as Reachability } from './Reachability';
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
AWS_CLOUDWATCH_CATEGORY,
|
|
15
|
-
AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE,
|
|
16
|
-
AWS_CLOUDWATCH_MAX_EVENT_SIZE,
|
|
17
|
-
AWS_CLOUDWATCH_PROVIDER_NAME,
|
|
18
|
-
NO_CREDS_ERROR_STRING,
|
|
19
|
-
RETRY_ERROR_CODES,
|
|
20
|
-
} from './Constants';
|
|
21
|
-
export {
|
|
22
|
-
BackgroundProcessManager,
|
|
23
|
-
BackgroundManagerNotOpenError,
|
|
24
|
-
BackgroundProcessManagerState,
|
|
25
|
-
} from './BackgroundProcessManager';
|
|
4
|
+
export * from './DateUtils';
|
|
5
|
+
export * from './StringUtils';
|
|
6
|
+
export * from './Constants';
|
|
7
|
+
export * from './BackgroundProcessManager';
|
package/src/constants.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
+
* the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://aws.amazon.com/apache2.0/
|
|
8
|
+
*
|
|
9
|
+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
3
13
|
|
|
4
14
|
/**
|
|
5
15
|
* This Symbol is used to reference an internal-only PubSub provider that
|
package/src/index.ts
CHANGED
|
@@ -1,74 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
+
* the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://aws.amazon.com/apache2.0/
|
|
8
|
+
*
|
|
9
|
+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
3
13
|
|
|
4
14
|
import { Amplify } from './Amplify';
|
|
5
15
|
import { Platform } from './Platform';
|
|
6
16
|
|
|
7
|
-
export { Amplify } from './Amplify';
|
|
8
17
|
export { AmplifyClass } from './Amplify';
|
|
9
18
|
export { ClientDevice } from './ClientDevice';
|
|
10
19
|
export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
|
|
11
|
-
export
|
|
20
|
+
export * from './Errors';
|
|
12
21
|
export { Hub, HubCapsule, HubCallback, HubPayload } from './Hub';
|
|
13
22
|
export { I18n } from './I18n';
|
|
14
|
-
export
|
|
15
|
-
browserOrNode,
|
|
16
|
-
filenameToContentType,
|
|
17
|
-
generateRandomString,
|
|
18
|
-
isEmpty,
|
|
19
|
-
isStrictObject,
|
|
20
|
-
isTextFile,
|
|
21
|
-
isWebWorker,
|
|
22
|
-
makeQuerablePromise,
|
|
23
|
-
objectLessAttributes,
|
|
24
|
-
sortByField,
|
|
25
|
-
transferKeyToLowerCase,
|
|
26
|
-
transferKeyToUpperCase,
|
|
27
|
-
} from './JS';
|
|
23
|
+
export * from './JS';
|
|
28
24
|
export { Signer } from './Signer';
|
|
29
|
-
export
|
|
30
|
-
export
|
|
25
|
+
export * from './Parser';
|
|
26
|
+
export * from './Providers';
|
|
31
27
|
export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
|
|
32
|
-
export
|
|
28
|
+
export * from './RNComponents';
|
|
33
29
|
export { Credentials, CredentialsClass } from './Credentials';
|
|
34
30
|
export { ServiceWorker } from './ServiceWorker';
|
|
35
31
|
export { ICredentials } from './types';
|
|
36
32
|
export { StorageHelper, MemoryStorage } from './StorageHelper';
|
|
37
33
|
export { UniversalStorage } from './UniversalStorage';
|
|
38
34
|
export { Platform, getAmplifyUserAgent } from './Platform';
|
|
39
|
-
export
|
|
40
|
-
INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER,
|
|
41
|
-
INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER,
|
|
42
|
-
USER_AGENT_HEADER,
|
|
43
|
-
} from './constants';
|
|
35
|
+
export * from './constants';
|
|
44
36
|
|
|
45
37
|
export const Constants = {
|
|
46
38
|
userAgent: Platform.userAgent,
|
|
47
39
|
};
|
|
48
40
|
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
AWS_CLOUDWATCH_CATEGORY,
|
|
52
|
-
AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE,
|
|
53
|
-
AWS_CLOUDWATCH_MAX_EVENT_SIZE,
|
|
54
|
-
AWS_CLOUDWATCH_PROVIDER_NAME,
|
|
55
|
-
BackgroundManagerNotOpenError,
|
|
56
|
-
BackgroundProcessManager,
|
|
57
|
-
BackgroundProcessManagerState,
|
|
58
|
-
DateUtils,
|
|
59
|
-
Mutex,
|
|
60
|
-
NO_CREDS_ERROR_STRING,
|
|
61
|
-
NonRetryableError,
|
|
62
|
-
RETRY_ERROR_CODES,
|
|
63
|
-
Reachability,
|
|
64
|
-
isNonRetryableError,
|
|
65
|
-
jitteredBackoff,
|
|
66
|
-
jitteredExponentialRetry,
|
|
67
|
-
retry,
|
|
68
|
-
urlSafeDecode,
|
|
69
|
-
urlSafeEncode,
|
|
70
|
-
} from './Util';
|
|
41
|
+
export * from './constants';
|
|
42
|
+
export * from './Util';
|
|
71
43
|
|
|
44
|
+
export { Amplify };
|
|
72
45
|
/**
|
|
73
46
|
* @deprecated use named import
|
|
74
47
|
*/
|
package/src/types/types.ts
CHANGED
package/lib/.tsbuildinfo
DELETED
package/lib/Amplify.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ConsoleLogger as LoggerClass } from './Logger';
|
|
2
|
-
export declare class AmplifyClass {
|
|
3
|
-
private _components;
|
|
4
|
-
private _config;
|
|
5
|
-
private _modules;
|
|
6
|
-
Auth: any;
|
|
7
|
-
Analytics: any;
|
|
8
|
-
API: any;
|
|
9
|
-
Credentials: any;
|
|
10
|
-
Storage: any;
|
|
11
|
-
I18n: any;
|
|
12
|
-
Cache: any;
|
|
13
|
-
PubSub: any;
|
|
14
|
-
Interactions: any;
|
|
15
|
-
Pushnotification: any;
|
|
16
|
-
UI: any;
|
|
17
|
-
XR: any;
|
|
18
|
-
Predictions: any;
|
|
19
|
-
DataStore: any;
|
|
20
|
-
Geo: any;
|
|
21
|
-
Notifications: any;
|
|
22
|
-
Logger: typeof LoggerClass;
|
|
23
|
-
ServiceWorker: any;
|
|
24
|
-
register(comp: any): void;
|
|
25
|
-
configure(config?: any): {};
|
|
26
|
-
addPluggable(pluggable: any): void;
|
|
27
|
-
}
|
|
28
|
-
export declare const Amplify: AmplifyClass;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare function clientInfo(): {
|
|
2
|
-
platform?: undefined;
|
|
3
|
-
make?: undefined;
|
|
4
|
-
model?: undefined;
|
|
5
|
-
version?: undefined;
|
|
6
|
-
appVersion?: undefined;
|
|
7
|
-
language?: undefined;
|
|
8
|
-
timezone?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
platform: string;
|
|
11
|
-
make: string;
|
|
12
|
-
model: string;
|
|
13
|
-
version: string;
|
|
14
|
-
appVersion: string;
|
|
15
|
-
language: string;
|
|
16
|
-
timezone: string;
|
|
17
|
-
};
|
|
18
|
-
export declare function dimension(): {
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
};
|
|
22
|
-
export declare function browserType(userAgent: string): {
|
|
23
|
-
type: string;
|
|
24
|
-
version: string;
|
|
25
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare class ClientDevice {
|
|
2
|
-
static clientInfo(): {
|
|
3
|
-
platform?: undefined;
|
|
4
|
-
make?: undefined;
|
|
5
|
-
model?: undefined;
|
|
6
|
-
version?: undefined;
|
|
7
|
-
appVersion?: undefined;
|
|
8
|
-
language?: undefined;
|
|
9
|
-
timezone?: undefined;
|
|
10
|
-
} | {
|
|
11
|
-
platform: string;
|
|
12
|
-
make: string;
|
|
13
|
-
model: string;
|
|
14
|
-
version: string;
|
|
15
|
-
appVersion: string;
|
|
16
|
-
language: string;
|
|
17
|
-
timezone: string;
|
|
18
|
-
};
|
|
19
|
-
static dimension(): {
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
};
|
|
23
|
-
}
|
package/lib/Credentials.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ICredentials } from './types';
|
|
2
|
-
export declare class CredentialsClass {
|
|
3
|
-
private _config;
|
|
4
|
-
private _credentials;
|
|
5
|
-
private _credentials_source;
|
|
6
|
-
private _gettingCredPromise;
|
|
7
|
-
private _refreshHandlers;
|
|
8
|
-
private _storage;
|
|
9
|
-
private _storageSync;
|
|
10
|
-
private _identityId;
|
|
11
|
-
private _nextCredentialsRefresh;
|
|
12
|
-
Auth: any;
|
|
13
|
-
constructor(config: any);
|
|
14
|
-
getModuleName(): string;
|
|
15
|
-
getCredSource(): any;
|
|
16
|
-
configure(config: any): any;
|
|
17
|
-
get(): any;
|
|
18
|
-
private _getCognitoIdentityIdStorageKey;
|
|
19
|
-
private _pickupCredentials;
|
|
20
|
-
private _keepAlive;
|
|
21
|
-
refreshFederatedToken(federatedInfo: any): Promise<ICredentials>;
|
|
22
|
-
private _providerRefreshWithRetry;
|
|
23
|
-
private _isExpired;
|
|
24
|
-
private _isPastTTL;
|
|
25
|
-
private _setCredentialsForGuest;
|
|
26
|
-
private _setCredentialsFromFederation;
|
|
27
|
-
private _setCredentialsFromSession;
|
|
28
|
-
private _loadCredentials;
|
|
29
|
-
set(params: any, source: any): Promise<ICredentials>;
|
|
30
|
-
clear(): Promise<void>;
|
|
31
|
-
private _getGuestIdentityId;
|
|
32
|
-
private _setGuestIdentityId;
|
|
33
|
-
private _removeGuestIdentityId;
|
|
34
|
-
/**
|
|
35
|
-
* Compact version of credentials
|
|
36
|
-
* @param {Object} credentials
|
|
37
|
-
* @return {Object} - Credentials
|
|
38
|
-
*/
|
|
39
|
-
shear(credentials: any): {
|
|
40
|
-
accessKeyId: any;
|
|
41
|
-
sessionToken: any;
|
|
42
|
-
secretAccessKey: any;
|
|
43
|
-
identityId: any;
|
|
44
|
-
authenticated: any;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export declare const Credentials: CredentialsClass;
|
package/lib/Errors.d.ts
DELETED
package/lib/Hub.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export declare type HubCapsule = {
|
|
2
|
-
channel: string;
|
|
3
|
-
payload: HubPayload;
|
|
4
|
-
source: string;
|
|
5
|
-
patternInfo?: string[];
|
|
6
|
-
};
|
|
7
|
-
export declare type HubPayload = {
|
|
8
|
-
event: string;
|
|
9
|
-
data?: any;
|
|
10
|
-
message?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare type HubCallback = (capsule: HubCapsule) => void;
|
|
13
|
-
export declare type LegacyCallback = {
|
|
14
|
-
onHubCapsule: HubCallback;
|
|
15
|
-
};
|
|
16
|
-
export declare class HubClass {
|
|
17
|
-
name: string;
|
|
18
|
-
private listeners;
|
|
19
|
-
private patterns;
|
|
20
|
-
protectedChannels: string[];
|
|
21
|
-
constructor(name: string);
|
|
22
|
-
/**
|
|
23
|
-
* Used internally to remove a Hub listener.
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.
|
|
27
|
-
*/
|
|
28
|
-
private _remove;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated Instead of calling Hub.remove, call the result of Hub.listen.
|
|
31
|
-
*/
|
|
32
|
-
remove(channel: string | RegExp, listener: HubCallback): void;
|
|
33
|
-
/**
|
|
34
|
-
* Used to send a Hub event.
|
|
35
|
-
*
|
|
36
|
-
* @param channel - The channel on which the event will be broadcast
|
|
37
|
-
* @param payload - The HubPayload
|
|
38
|
-
* @param source - The source of the event; defaults to ''
|
|
39
|
-
* @param ampSymbol - Symbol used to determine if the event is dispatched internally on a protected channel
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
dispatch(channel: string, payload: HubPayload, source?: string, ampSymbol?: Symbol): void;
|
|
43
|
-
/**
|
|
44
|
-
* Used to listen for Hub events.
|
|
45
|
-
*
|
|
46
|
-
* @param channel - The channel on which to listen
|
|
47
|
-
* @param callback - The callback to execute when an event is received on the specified channel
|
|
48
|
-
* @param listenerName - The name of the listener; defaults to 'noname'
|
|
49
|
-
* @returns A function which can be called to cancel the listener.
|
|
50
|
-
*
|
|
51
|
-
*/
|
|
52
|
-
listen(channel: string | RegExp, callback?: HubCallback | LegacyCallback, listenerName?: string): () => void;
|
|
53
|
-
private _toListeners;
|
|
54
|
-
}
|
|
55
|
-
export declare const Hub: HubClass;
|
package/lib/I18n/I18n.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { I18nOptions } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Language transition class
|
|
4
|
-
*/
|
|
5
|
-
export declare class I18n {
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
_options: I18nOptions;
|
|
10
|
-
/**
|
|
11
|
-
* @private
|
|
12
|
-
*/
|
|
13
|
-
_lang: any;
|
|
14
|
-
/**
|
|
15
|
-
* @private
|
|
16
|
-
*/
|
|
17
|
-
_dict: {};
|
|
18
|
-
/**
|
|
19
|
-
* @constructor
|
|
20
|
-
* Initialize with configurations
|
|
21
|
-
* @param {Object} options
|
|
22
|
-
*/
|
|
23
|
-
constructor(options: I18nOptions);
|
|
24
|
-
/**
|
|
25
|
-
* @method
|
|
26
|
-
* Explicitly setting language
|
|
27
|
-
* @param {String} lang
|
|
28
|
-
*/
|
|
29
|
-
setLanguage(lang: string): void;
|
|
30
|
-
/**
|
|
31
|
-
* @method
|
|
32
|
-
* Get value
|
|
33
|
-
* @param {String} key
|
|
34
|
-
* @param {String} defVal - Default value
|
|
35
|
-
*/
|
|
36
|
-
get(key: any, defVal?: any): any;
|
|
37
|
-
/**
|
|
38
|
-
* @method
|
|
39
|
-
* Get value according to specified language
|
|
40
|
-
* @param {String} key
|
|
41
|
-
* @param {String} language - Specified langurage to be used
|
|
42
|
-
* @param {String} defVal - Default value
|
|
43
|
-
*/
|
|
44
|
-
getByLanguage(key: any, language: any, defVal?: any): any;
|
|
45
|
-
/**
|
|
46
|
-
* @method
|
|
47
|
-
* Add vocabularies for one language
|
|
48
|
-
* @param {String} language - Language of the dictionary
|
|
49
|
-
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
50
|
-
*/
|
|
51
|
-
putVocabulariesForLanguage(language: any, vocabularies: any): void;
|
|
52
|
-
/**
|
|
53
|
-
* @method
|
|
54
|
-
* Add vocabularies for one language
|
|
55
|
-
* @param {Object} vocabularies - Object that has language as key,
|
|
56
|
-
* vocabularies of each language as value
|
|
57
|
-
*/
|
|
58
|
-
putVocabularies(vocabularies: any): void;
|
|
59
|
-
}
|
package/lib/I18n/index.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Export I18n APIs
|
|
3
|
-
*/
|
|
4
|
-
export declare class I18n {
|
|
5
|
-
/**
|
|
6
|
-
* @static
|
|
7
|
-
* @method
|
|
8
|
-
* Configure I18n part
|
|
9
|
-
* @param {Object} config - Configuration of the I18n
|
|
10
|
-
*/
|
|
11
|
-
static configure(config: any): any;
|
|
12
|
-
static getModuleName(): string;
|
|
13
|
-
/**
|
|
14
|
-
* @static
|
|
15
|
-
* @method
|
|
16
|
-
* Create an instance of I18n for the library
|
|
17
|
-
*/
|
|
18
|
-
static createInstance(): void;
|
|
19
|
-
/**
|
|
20
|
-
* @static @method
|
|
21
|
-
* Explicitly setting language
|
|
22
|
-
* @param {String} lang
|
|
23
|
-
*/
|
|
24
|
-
static setLanguage(lang: any): any;
|
|
25
|
-
/**
|
|
26
|
-
* @static @method
|
|
27
|
-
* Get value
|
|
28
|
-
* @param {String} key
|
|
29
|
-
* @param {String} defVal - Default value
|
|
30
|
-
*/
|
|
31
|
-
static get(key: any, defVal?: any): any;
|
|
32
|
-
/**
|
|
33
|
-
* @static
|
|
34
|
-
* @method
|
|
35
|
-
* Add vocabularies for one language
|
|
36
|
-
* @param {String} langurage - Language of the dictionary
|
|
37
|
-
* @param {Object} vocabularies - Object that has key-value as dictionary entry
|
|
38
|
-
*/
|
|
39
|
-
static putVocabulariesForLanguage(language: any, vocabularies: any): any;
|
|
40
|
-
/**
|
|
41
|
-
* @static
|
|
42
|
-
* @method
|
|
43
|
-
* Add vocabularies for one language
|
|
44
|
-
* @param {Object} vocabularies - Object that has language as key,
|
|
45
|
-
* vocabularies of each language as value
|
|
46
|
-
*/
|
|
47
|
-
static putVocabularies(vocabularies: any): any;
|
|
48
|
-
static checkConfig(): boolean;
|
|
49
|
-
}
|
package/lib/I18n/types.d.ts
DELETED