@aws-amplify/core 4.7.13-unstable.4 → 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/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/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/Credentials.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { makeQuerablePromise } from './JS';
|
|
|
4
4
|
import { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
|
|
5
5
|
import { jitteredExponentialRetry } from './Util';
|
|
6
6
|
import { ICredentials } from './types';
|
|
7
|
-
import { getAmplifyUserAgent } from './Platform';
|
|
8
7
|
import { Amplify } from './Amplify';
|
|
9
8
|
import {
|
|
10
9
|
fromCognitoIdentity,
|
|
@@ -13,13 +12,11 @@ import {
|
|
|
13
12
|
FromCognitoIdentityPoolParameters,
|
|
14
13
|
} from '@aws-sdk/credential-provider-cognito-identity';
|
|
15
14
|
import {
|
|
16
|
-
CognitoIdentityClient,
|
|
17
15
|
GetIdCommand,
|
|
18
16
|
GetCredentialsForIdentityCommand,
|
|
19
17
|
} from '@aws-sdk/client-cognito-identity';
|
|
20
18
|
import { CredentialProvider } from '@aws-sdk/types';
|
|
21
|
-
import {
|
|
22
|
-
import { Hub } from './Hub';
|
|
19
|
+
import { createCognitoIdentityClient } from './Util/CognitoIdentityClient';
|
|
23
20
|
|
|
24
21
|
const logger = new Logger('Credentials');
|
|
25
22
|
|
|
@@ -27,20 +24,6 @@ const CREDENTIALS_TTL = 50 * 60 * 1000; // 50 min, can be modified on config if
|
|
|
27
24
|
|
|
28
25
|
const COGNITO_IDENTITY_KEY_PREFIX = 'CognitoIdentityId-';
|
|
29
26
|
|
|
30
|
-
const AMPLIFY_SYMBOL = (
|
|
31
|
-
typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
|
|
32
|
-
? Symbol.for('amplify_default')
|
|
33
|
-
: '@@amplify_default'
|
|
34
|
-
) as Symbol;
|
|
35
|
-
|
|
36
|
-
const dispatchCredentialsEvent = (
|
|
37
|
-
event: string,
|
|
38
|
-
data: any,
|
|
39
|
-
message: string
|
|
40
|
-
) => {
|
|
41
|
-
Hub.dispatch('core', { event, data, message }, 'Credentials', AMPLIFY_SYMBOL);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
27
|
export class CredentialsClass {
|
|
45
28
|
private _config;
|
|
46
29
|
private _credentials;
|
|
@@ -94,12 +77,6 @@ export class CredentialsClass {
|
|
|
94
77
|
this._storageSync = this._storage['sync']();
|
|
95
78
|
}
|
|
96
79
|
|
|
97
|
-
dispatchCredentialsEvent(
|
|
98
|
-
'credentials_configured',
|
|
99
|
-
null,
|
|
100
|
-
`Credentials has been configured successfully`
|
|
101
|
-
);
|
|
102
|
-
|
|
103
80
|
return this._config;
|
|
104
81
|
}
|
|
105
82
|
|
|
@@ -139,8 +116,7 @@ export class CredentialsClass {
|
|
|
139
116
|
const { Auth = Amplify.Auth } = this;
|
|
140
117
|
|
|
141
118
|
if (!Auth || typeof Auth.currentUserCredentials !== 'function') {
|
|
142
|
-
|
|
143
|
-
return this._setCredentialsForGuest();
|
|
119
|
+
return Promise.reject('No Auth module registered in Amplify');
|
|
144
120
|
}
|
|
145
121
|
|
|
146
122
|
if (!this._isExpired(cred) && this._isPastTTL()) {
|
|
@@ -256,17 +232,7 @@ export class CredentialsClass {
|
|
|
256
232
|
|
|
257
233
|
private async _setCredentialsForGuest() {
|
|
258
234
|
logger.debug('setting credentials for guest');
|
|
259
|
-
if (!this._config?.identityPoolId) {
|
|
260
|
-
// If Credentials are not configured thru Auth module,
|
|
261
|
-
// doing best effort to check if the library was configured
|
|
262
|
-
this._config = Object.assign(
|
|
263
|
-
{},
|
|
264
|
-
this._config,
|
|
265
|
-
parseAWSExports(this._config || {}).Auth
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
235
|
const { identityPoolId, region, mandatorySignIn } = this._config;
|
|
269
|
-
|
|
270
236
|
if (mandatorySignIn) {
|
|
271
237
|
return Promise.reject(
|
|
272
238
|
'cannot get guest credentials when mandatory signin enabled'
|
|
@@ -291,9 +257,8 @@ export class CredentialsClass {
|
|
|
291
257
|
|
|
292
258
|
const identityId = (this._identityId = await this._getGuestIdentityId());
|
|
293
259
|
|
|
294
|
-
const cognitoClient =
|
|
260
|
+
const cognitoClient = createCognitoIdentityClient({
|
|
295
261
|
region,
|
|
296
|
-
customUserAgent: getAmplifyUserAgent(),
|
|
297
262
|
});
|
|
298
263
|
|
|
299
264
|
let credentials = undefined;
|
|
@@ -408,9 +373,8 @@ export class CredentialsClass {
|
|
|
408
373
|
);
|
|
409
374
|
}
|
|
410
375
|
|
|
411
|
-
const cognitoClient =
|
|
376
|
+
const cognitoClient = createCognitoIdentityClient({
|
|
412
377
|
region,
|
|
413
|
-
customUserAgent: getAmplifyUserAgent(),
|
|
414
378
|
});
|
|
415
379
|
|
|
416
380
|
let credentials = undefined;
|
|
@@ -450,9 +414,8 @@ export class CredentialsClass {
|
|
|
450
414
|
const logins = {};
|
|
451
415
|
logins[key] = idToken;
|
|
452
416
|
|
|
453
|
-
const cognitoClient =
|
|
417
|
+
const cognitoClient = createCognitoIdentityClient({
|
|
454
418
|
region,
|
|
455
|
-
customUserAgent: getAmplifyUserAgent(),
|
|
456
419
|
});
|
|
457
420
|
|
|
458
421
|
/*
|
|
@@ -657,3 +620,8 @@ export class CredentialsClass {
|
|
|
657
620
|
export const Credentials = new CredentialsClass(null);
|
|
658
621
|
|
|
659
622
|
Amplify.register(Credentials);
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* @deprecated use named import
|
|
626
|
+
*/
|
|
627
|
+
export default Credentials;
|
package/src/Errors.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
|
export function missingConfig(name: string) {
|
|
5
15
|
return new Error('Missing config value of ' + name);
|
package/src/Hub.ts
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
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
|
|
|
6
16
|
const logger = new Logger('Hub');
|
|
7
17
|
|
|
8
|
-
const AMPLIFY_SYMBOL = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
) as Symbol;
|
|
18
|
+
const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' &&
|
|
19
|
+
typeof Symbol.for === 'function'
|
|
20
|
+
? Symbol.for('amplify_default')
|
|
21
|
+
: '@@amplify_default') as Symbol;
|
|
13
22
|
interface IPattern {
|
|
14
23
|
pattern: RegExp;
|
|
15
24
|
callback: HubCallback;
|
|
@@ -62,13 +71,8 @@ export class HubClass {
|
|
|
62
71
|
this.name = name;
|
|
63
72
|
}
|
|
64
73
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*
|
|
68
|
-
* @remarks
|
|
69
|
-
* This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.
|
|
70
|
-
*/
|
|
71
|
-
private _remove(channel: string | RegExp, listener: HubCallback) {
|
|
74
|
+
// Note - Need to pass channel as a reference for removal to work and not anonymous function
|
|
75
|
+
remove(channel: string | RegExp, listener: HubCallback) {
|
|
72
76
|
if (channel instanceof RegExp) {
|
|
73
77
|
const pattern = this.patterns.find(
|
|
74
78
|
({ pattern }) => pattern.source === channel.source
|
|
@@ -90,22 +94,6 @@ export class HubClass {
|
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
96
|
|
|
93
|
-
/**
|
|
94
|
-
* @deprecated Instead of calling Hub.remove, call the result of Hub.listen.
|
|
95
|
-
*/
|
|
96
|
-
remove(channel: string | RegExp, listener: HubCallback) {
|
|
97
|
-
this._remove(channel, listener);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Used to send a Hub event.
|
|
102
|
-
*
|
|
103
|
-
* @param channel - The channel on which the event will be broadcast
|
|
104
|
-
* @param payload - The HubPayload
|
|
105
|
-
* @param source - The source of the event; defaults to ''
|
|
106
|
-
* @param ampSymbol - Symbol used to determine if the event is dispatched internally on a protected channel
|
|
107
|
-
*
|
|
108
|
-
*/
|
|
109
97
|
dispatch(
|
|
110
98
|
channel: string,
|
|
111
99
|
payload: HubPayload,
|
|
@@ -136,15 +124,6 @@ export class HubClass {
|
|
|
136
124
|
}
|
|
137
125
|
}
|
|
138
126
|
|
|
139
|
-
/**
|
|
140
|
-
* Used to listen for Hub events.
|
|
141
|
-
*
|
|
142
|
-
* @param channel - The channel on which to listen
|
|
143
|
-
* @param callback - The callback to execute when an event is received on the specified channel
|
|
144
|
-
* @param listenerName - The name of the listener; defaults to 'noname'
|
|
145
|
-
* @returns A function which can be called to cancel the listener.
|
|
146
|
-
*
|
|
147
|
-
*/
|
|
148
127
|
listen(
|
|
149
128
|
channel: string | RegExp,
|
|
150
129
|
callback?: HubCallback | LegacyCallback,
|
|
@@ -183,7 +162,7 @@ export class HubClass {
|
|
|
183
162
|
}
|
|
184
163
|
|
|
185
164
|
return () => {
|
|
186
|
-
this.
|
|
165
|
+
this.remove(channel, cb);
|
|
187
166
|
};
|
|
188
167
|
}
|
|
189
168
|
|
|
@@ -233,3 +212,7 @@ export class HubClass {
|
|
|
233
212
|
pseudo Singleton for the main messaging bus, however you can still create
|
|
234
213
|
your own instance of HubClass() for a separate "private bus" of events.*/
|
|
235
214
|
export const Hub = new HubClass('__default__');
|
|
215
|
+
/**
|
|
216
|
+
* @deprecated use named import
|
|
217
|
+
*/
|
|
218
|
+
export default Hub;
|
package/src/I18n/I18n.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 { I18nOptions } from './types';
|
|
5
15
|
import { ConsoleLogger as Logger } from '../Logger';
|
package/src/I18n/index.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 { I18n as I18nClass } from './I18n';
|
|
5
15
|
|
|
@@ -112,3 +122,8 @@ export class I18n {
|
|
|
112
122
|
}
|
|
113
123
|
|
|
114
124
|
Amplify.register(I18n);
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated use named import
|
|
128
|
+
*/
|
|
129
|
+
export default I18n;
|
package/src/I18n/types.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
|
export class I18nOptions {
|
|
5
15
|
language = null;
|
package/src/JS.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
|
const MIME_MAP = [
|
|
5
15
|
{ type: 'text/plain', ext: 'txt' },
|
|
@@ -157,10 +167,8 @@ export const isWebWorker = () => {
|
|
|
157
167
|
return false;
|
|
158
168
|
}
|
|
159
169
|
const selfContext = self as { WorkerGlobalScope? };
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
self instanceof selfContext.WorkerGlobalScope
|
|
163
|
-
);
|
|
170
|
+
return typeof selfContext.WorkerGlobalScope !== 'undefined' &&
|
|
171
|
+
self instanceof selfContext.WorkerGlobalScope;
|
|
164
172
|
};
|
|
165
173
|
|
|
166
174
|
export const browserOrNode = () => {
|
|
@@ -257,3 +265,26 @@ export const isStrictObject = obj => {
|
|
|
257
265
|
!(obj instanceof Boolean)
|
|
258
266
|
);
|
|
259
267
|
};
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @deprecated use per-function imports
|
|
271
|
+
*/
|
|
272
|
+
export class JS {
|
|
273
|
+
static isEmpty = isEmpty;
|
|
274
|
+
static sortByField = sortByField;
|
|
275
|
+
static objectLessAttributes = objectLessAttributes;
|
|
276
|
+
static filenameToContentType = filenameToContentType;
|
|
277
|
+
static isTextFile = isTextFile;
|
|
278
|
+
static generateRandomString = generateRandomString;
|
|
279
|
+
static makeQuerablePromise = makeQuerablePromise;
|
|
280
|
+
static isWebWorker = isWebWorker;
|
|
281
|
+
static browserOrNode = browserOrNode;
|
|
282
|
+
static transferKeyToLowerCase = transferKeyToLowerCase;
|
|
283
|
+
static transferKeyToUpperCase = transferKeyToUpperCase;
|
|
284
|
+
static isStrictObject = isStrictObject;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* @deprecated use per-function imports
|
|
289
|
+
*/
|
|
290
|
+
export default JS;
|
|
@@ -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
|
import { InputLogEvent } from '@aws-sdk/client-cloudwatch-logs';
|
|
5
15
|
import { LoggingProvider } from '../types';
|
package/src/Logger/index.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
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
|
-
export
|
|
14
|
+
export * from './ConsoleLogger';
|
|
@@ -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
|
import { LoggingProvider } from '../types';
|
|
5
15
|
|
|
@@ -10,3 +20,8 @@ export interface Logger {
|
|
|
10
20
|
error(msg: string): void;
|
|
11
21
|
addPluggable(pluggable: LoggingProvider): void;
|
|
12
22
|
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated use named import
|
|
26
|
+
*/
|
|
27
|
+
export default Logger;
|
|
@@ -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 { ConsoleLogger as Logger } from '../Logger';
|
|
4
14
|
import { browserOrNode } from '../JS';
|
|
5
15
|
import { NonRetryableError } from '../Util';
|
|
@@ -81,3 +91,8 @@ export class FacebookOAuth {
|
|
|
81
91
|
});
|
|
82
92
|
}
|
|
83
93
|
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated use named import
|
|
97
|
+
*/
|
|
98
|
+
export default FacebookOAuth;
|
|
@@ -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 { ConsoleLogger as Logger } from '../Logger';
|
|
4
14
|
import { browserOrNode } from '../JS';
|
|
5
15
|
import { NonRetryableError } from '../Util';
|
|
@@ -92,3 +102,8 @@ export class GoogleOAuth {
|
|
|
92
102
|
});
|
|
93
103
|
}
|
|
94
104
|
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated use named import
|
|
108
|
+
*/
|
|
109
|
+
export default GoogleOAuth;
|
package/src/OAuthHelper/index.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
|
import { GoogleOAuth as GoogleOAuthClass } from './GoogleOAuth';
|
|
4
14
|
import { FacebookOAuth as FacebookOAuthClass } from './FacebookOAuth';
|
|
5
15
|
|
|
@@ -3,7 +3,7 @@ import { ConsoleLogger as Logger } from './Logger';
|
|
|
3
3
|
|
|
4
4
|
const logger = new Logger('Parser');
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const parseMobileHubConfig = (config): AmplifyConfig => {
|
|
7
7
|
const amplifyConfig: AmplifyConfig = {};
|
|
8
8
|
// Analytics
|
|
9
9
|
if (config['aws_mobile_analytics_app_id']) {
|
|
@@ -80,3 +80,15 @@ export const parseAWSExports = (config): AmplifyConfig => {
|
|
|
80
80
|
logger.debug('parse config', config, 'to amplifyconfig', amplifyConfig);
|
|
81
81
|
return amplifyConfig;
|
|
82
82
|
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated use per-function export
|
|
86
|
+
*/
|
|
87
|
+
export class Parser {
|
|
88
|
+
static parseMobilehubConfig = parseMobileHubConfig;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated use per-function export
|
|
93
|
+
*/
|
|
94
|
+
export default Parser;
|
package/src/Platform/index.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
|
import { version } from './version';
|
|
4
14
|
|
|
5
15
|
const BASE_USER_AGENT = `aws-amplify/${version}`;
|
|
@@ -28,3 +38,8 @@ if (typeof navigator !== 'undefined' && navigator.product) {
|
|
|
28
38
|
export const getAmplifyUserAgent = (content?: string) => {
|
|
29
39
|
return `${Platform.userAgent}${content ? content : ''}`;
|
|
30
40
|
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated use named import
|
|
44
|
+
*/
|
|
45
|
+
export default Platform;
|
package/src/Platform/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '4.7.
|
|
2
|
+
export const version = '4.7.12';
|
|
@@ -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
|
import {
|
|
5
15
|
CloudWatchLogsClient,
|
|
@@ -33,7 +43,7 @@ import {
|
|
|
33
43
|
import { Credentials } from '../..';
|
|
34
44
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
35
45
|
import { getAmplifyUserAgent } from '../Platform';
|
|
36
|
-
import {
|
|
46
|
+
import { parseMobileHubConfig } from '../Parser';
|
|
37
47
|
import {
|
|
38
48
|
AWS_CLOUDWATCH_BASE_BUFFER_SIZE,
|
|
39
49
|
AWS_CLOUDWATCH_CATEGORY,
|
|
@@ -86,7 +96,7 @@ class AWSCloudWatchProvider implements LoggingProvider {
|
|
|
86
96
|
const conf = Object.assign(
|
|
87
97
|
{},
|
|
88
98
|
this._config,
|
|
89
|
-
|
|
99
|
+
parseMobileHubConfig(config).Logging,
|
|
90
100
|
config
|
|
91
101
|
);
|
|
92
102
|
this._config = conf;
|
package/src/Providers/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './AWSCloudWatchProvider';
|
|
@@ -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 { browserOrNode } from '../JS';
|
|
5
15
|
import { StorageHelper } from '../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
|
|
|
4
14
|
import { Linking, AppState } from 'react-native';
|
|
5
15
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
@@ -42,7 +42,7 @@ export class ServiceWorkerClass {
|
|
|
42
42
|
// The AWS Amplify logger
|
|
43
43
|
private _logger: Logger = new Logger('ServiceWorker');
|
|
44
44
|
|
|
45
|
-
constructor() {}
|
|
45
|
+
constructor() { }
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Get the currently active service worker
|
|
@@ -202,3 +202,8 @@ export class ServiceWorkerClass {
|
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @deprecated use named import
|
|
208
|
+
*/
|
|
209
|
+
export default ServiceWorkerClass;
|