@aws-amplify/core 6.0.1-console-preview.431c340.0 → 6.0.1-console-preview.4b7d177.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/Pinpoint/getInAppMessages.d.ts +1 -1
- package/lib/AwsClients/Pinpoint/putEvents.d.ts +1 -1
- package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
- package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
- package/lib/BackgroundProcessManager/BackgroundManagerNotOpenError.js +28 -0
- package/{lib-esm/Util → lib/BackgroundProcessManager}/BackgroundProcessManager.d.ts +1 -23
- package/lib/{Util → BackgroundProcessManager}/BackgroundProcessManager.js +13 -56
- package/lib/BackgroundProcessManager/index.d.ts +1 -0
- package/lib/BackgroundProcessManager/index.js +7 -0
- package/lib/BackgroundProcessManager/types.d.ts +41 -0
- package/lib/BackgroundProcessManager/types.js +23 -0
- package/lib/Hub/index.js +2 -2
- package/lib/I18n/I18n.d.ts +2 -18
- package/lib/I18n/I18n.js +5 -20
- package/lib/I18n/index.d.ts +2 -14
- package/lib/I18n/index.js +0 -12
- package/lib/I18n/types.d.ts +1 -4
- package/lib/I18n/types.js +5 -8
- package/lib/Logger/ConsoleLogger.js +2 -2
- package/lib/{Util → Mutex}/Mutex.d.ts +2 -15
- package/lib/{Util → Mutex}/Mutex.js +2 -1
- package/lib/Mutex/index.d.ts +1 -0
- package/lib/Mutex/index.js +7 -0
- package/lib/Mutex/types.d.ts +13 -0
- package/lib/Mutex/types.js +4 -0
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/Reachability/Reachability.d.ts +6 -0
- package/lib/Reachability/Reachability.js +29 -0
- package/lib/Reachability/Reachability.native.d.ts +6 -0
- package/lib/{Util → Reachability}/Reachability.native.js +8 -10
- package/lib/Reachability/index.d.ts +1 -0
- package/lib/Reachability/index.js +7 -0
- package/lib/Reachability/types.d.ts +3 -0
- package/lib/Reachability/types.js +4 -0
- package/lib/ServiceWorker/ServiceWorker.js +2 -2
- package/lib/{Signer.js → Signer/Signer.js} +3 -3
- package/lib/Signer/index.d.ts +1 -0
- package/lib/Signer/index.js +7 -0
- package/lib/clients/middleware/retry/jitteredBackoff.js +2 -2
- package/lib/{Util/Constants.d.ts → constants.d.ts} +0 -2
- package/lib/{Util/Constants.js → constants.js} +1 -6
- package/lib/libraryUtils.d.ts +7 -6
- package/lib/libraryUtils.js +37 -49
- package/lib/singleton/Auth/utils/index.js +2 -1
- package/lib/singleton/types.d.ts +2 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/convert/base64/base64Decoder.d.ts +2 -0
- package/lib/utils/convert/base64/base64Decoder.js +11 -0
- package/lib/utils/convert/base64/base64Encoder.d.ts +2 -0
- package/lib/utils/convert/base64/base64Encoder.js +18 -0
- package/lib/utils/convert/base64/bytesToString.d.ts +1 -0
- package/lib/utils/convert/base64/bytesToString.js +9 -0
- package/lib/utils/convert/index.d.ts +2 -0
- package/lib/utils/convert/index.js +9 -0
- package/lib/utils/convert/types.d.ts +9 -0
- package/lib/utils/convert/types.js +4 -0
- package/lib/utils/generateRandomString.d.ts +1 -0
- package/lib/utils/generateRandomString.js +14 -0
- package/lib/utils/globalHelpers/index.d.ts +3 -0
- package/lib/utils/globalHelpers/index.js +50 -0
- package/lib/utils/globalHelpers/index.native.d.ts +5 -0
- package/lib/utils/globalHelpers/index.native.js +27 -0
- package/lib/utils/index.d.ts +6 -0
- package/lib/utils/index.js +21 -0
- package/lib/utils/isBrowser.d.ts +1 -0
- package/lib/utils/isBrowser.js +9 -0
- package/lib/utils/isWebWorker.d.ts +1 -0
- package/lib/utils/isWebWorker.js +14 -0
- package/lib/utils/retry/NonRetryableError.d.ts +4 -0
- package/lib/utils/retry/NonRetryableError.js +30 -0
- package/lib/utils/retry/constants.d.ts +1 -0
- package/lib/utils/retry/constants.js +6 -0
- package/lib/utils/retry/index.d.ts +5 -0
- package/lib/utils/retry/index.js +15 -0
- package/lib/utils/retry/isNonRetryableError.d.ts +2 -0
- package/lib/utils/retry/isNonRetryableError.js +10 -0
- package/lib/utils/retry/jitteredBackoff.d.ts +6 -0
- package/lib/utils/retry/jitteredBackoff.js +20 -0
- package/lib/utils/retry/jitteredExponentialRetry.d.ts +5 -0
- package/lib/utils/retry/jitteredExponentialRetry.js +17 -0
- package/lib/utils/retry/retry.d.ts +6 -0
- package/lib/{Util/Retry.js → utils/retry/retry.js} +6 -57
- package/lib/utils/urlSafeDecode.d.ts +1 -0
- package/lib/{Util/StringUtils.js → utils/urlSafeDecode.js} +2 -9
- package/lib/utils/urlSafeEncode.d.ts +1 -0
- package/lib/utils/urlSafeEncode.js +12 -0
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +1 -1
- package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +1 -1
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
- package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.d.ts +3 -0
- package/lib-esm/BackgroundProcessManager/BackgroundManagerNotOpenError.js +25 -0
- package/{lib/Util → lib-esm/BackgroundProcessManager}/BackgroundProcessManager.d.ts +1 -23
- package/lib-esm/{Util → BackgroundProcessManager}/BackgroundProcessManager.js +4 -47
- package/lib-esm/BackgroundProcessManager/index.d.ts +1 -0
- package/lib-esm/BackgroundProcessManager/index.js +3 -0
- package/lib-esm/BackgroundProcessManager/types.d.ts +41 -0
- package/lib-esm/BackgroundProcessManager/types.js +20 -0
- package/lib-esm/Hub/index.js +1 -1
- package/lib-esm/I18n/I18n.d.ts +2 -18
- package/lib-esm/I18n/I18n.js +5 -20
- package/lib-esm/I18n/index.d.ts +2 -14
- package/lib-esm/I18n/index.js +0 -12
- package/lib-esm/I18n/types.d.ts +1 -4
- package/lib-esm/I18n/types.js +4 -7
- package/lib-esm/Logger/ConsoleLogger.js +1 -1
- package/lib-esm/{Util → Mutex}/Mutex.d.ts +2 -15
- package/lib-esm/{Util → Mutex}/Mutex.js +1 -1
- package/lib-esm/Mutex/index.d.ts +1 -0
- package/lib-esm/Mutex/index.js +3 -0
- package/lib-esm/Mutex/types.d.ts +13 -0
- package/lib-esm/Mutex/types.js +3 -0
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/Reachability/Reachability.d.ts +6 -0
- package/lib-esm/Reachability/Reachability.js +26 -0
- package/lib-esm/Reachability/Reachability.native.d.ts +6 -0
- package/lib-esm/{Util → Reachability}/Reachability.native.js +6 -6
- package/lib-esm/Reachability/index.d.ts +1 -0
- package/lib-esm/Reachability/index.js +3 -0
- package/lib-esm/Reachability/types.d.ts +3 -0
- package/lib-esm/Reachability/types.js +3 -0
- package/lib-esm/ServiceWorker/ServiceWorker.js +1 -1
- package/lib-esm/{Signer.js → Signer/Signer.js} +2 -2
- package/lib-esm/Signer/index.d.ts +1 -0
- package/lib-esm/Signer/index.js +3 -0
- package/lib-esm/clients/middleware/retry/jitteredBackoff.js +1 -1
- package/lib-esm/{Util/Constants.d.ts → constants.d.ts} +0 -2
- package/lib-esm/{Util/Constants.js → constants.js} +0 -5
- package/lib-esm/libraryUtils.d.ts +7 -6
- package/lib-esm/libraryUtils.js +8 -8
- package/lib-esm/singleton/Auth/utils/index.js +2 -1
- package/lib-esm/singleton/types.d.ts +2 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/utils/convert/base64/base64Decoder.d.ts +2 -0
- package/lib-esm/utils/convert/base64/base64Decoder.js +8 -0
- package/lib-esm/utils/convert/base64/base64Encoder.d.ts +2 -0
- package/lib-esm/utils/convert/base64/base64Encoder.js +15 -0
- package/lib-esm/utils/convert/base64/bytesToString.d.ts +1 -0
- package/lib-esm/utils/convert/base64/bytesToString.js +5 -0
- package/lib-esm/utils/convert/index.d.ts +2 -0
- package/lib-esm/utils/convert/index.js +4 -0
- package/lib-esm/utils/convert/types.d.ts +9 -0
- package/lib-esm/utils/convert/types.js +3 -0
- package/lib-esm/utils/generateRandomString.d.ts +1 -0
- package/lib-esm/utils/generateRandomString.js +10 -0
- package/lib-esm/utils/globalHelpers/index.d.ts +3 -0
- package/lib-esm/utils/globalHelpers/index.js +44 -0
- package/lib-esm/utils/globalHelpers/index.native.d.ts +5 -0
- package/lib-esm/utils/globalHelpers/index.native.js +21 -0
- package/lib-esm/utils/index.d.ts +6 -0
- package/lib-esm/utils/index.js +8 -0
- package/lib-esm/utils/isBrowser.d.ts +1 -0
- package/lib-esm/utils/isBrowser.js +5 -0
- package/lib-esm/utils/isWebWorker.d.ts +1 -0
- package/lib-esm/utils/isWebWorker.js +10 -0
- package/lib-esm/utils/retry/NonRetryableError.d.ts +4 -0
- package/lib-esm/utils/retry/NonRetryableError.js +27 -0
- package/lib-esm/utils/retry/constants.d.ts +1 -0
- package/lib-esm/utils/retry/constants.js +3 -0
- package/lib-esm/utils/retry/index.d.ts +5 -0
- package/lib-esm/utils/retry/index.js +7 -0
- package/lib-esm/utils/retry/isNonRetryableError.d.ts +2 -0
- package/lib-esm/utils/retry/isNonRetryableError.js +6 -0
- package/lib-esm/utils/retry/jitteredBackoff.d.ts +6 -0
- package/lib-esm/utils/retry/jitteredBackoff.js +16 -0
- package/lib-esm/utils/retry/jitteredExponentialRetry.d.ts +5 -0
- package/lib-esm/utils/retry/jitteredExponentialRetry.js +13 -0
- package/lib-esm/utils/retry/retry.d.ts +6 -0
- package/lib-esm/{Util/Retry.js → utils/retry/retry.js} +4 -52
- package/lib-esm/{Util/StringUtils.d.ts → utils/urlSafeDecode.d.ts} +0 -1
- package/lib-esm/{Util/StringUtils.js → utils/urlSafeDecode.js} +0 -6
- package/{lib/Util/StringUtils.d.ts → lib-esm/utils/urlSafeEncode.d.ts} +0 -1
- package/lib-esm/utils/urlSafeEncode.js +8 -0
- package/package.json +8 -5
- package/src/BackgroundProcessManager/BackgroundManagerNotOpenError.ts +8 -0
- package/src/{Util → BackgroundProcessManager}/BackgroundProcessManager.ts +4 -58
- package/src/BackgroundProcessManager/index.ts +4 -0
- package/src/BackgroundProcessManager/types.ts +49 -0
- package/src/Hub/index.ts +1 -1
- package/src/I18n/I18n.ts +4 -20
- package/src/I18n/index.ts +2 -14
- package/src/I18n/types.ts +1 -4
- package/src/Logger/ConsoleLogger.ts +1 -1
- package/src/{Util → Mutex}/Mutex.ts +2 -20
- package/src/Mutex/index.ts +4 -0
- package/src/Mutex/types.ts +20 -0
- package/src/Platform/version.ts +1 -1
- package/src/{Util → Reachability}/Reachability.native.ts +4 -11
- package/src/Reachability/Reachability.ts +35 -0
- package/src/Reachability/index.ts +4 -0
- package/src/Reachability/types.ts +6 -0
- package/src/ServiceWorker/ServiceWorker.ts +1 -1
- package/src/{Signer.ts → Signer/Signer.ts} +2 -2
- package/src/Signer/index.ts +4 -0
- package/src/clients/middleware/retry/jitteredBackoff.ts +1 -1
- package/src/{Util/Constants.ts → constants.ts} +0 -5
- package/src/libraryUtils.ts +16 -35
- package/src/singleton/Auth/utils/index.ts +2 -1
- package/src/singleton/types.ts +2 -1
- package/src/utils/convert/base64/base64Decoder.ts +11 -0
- package/src/utils/convert/base64/base64Encoder.ts +18 -0
- package/src/utils/convert/base64/bytesToString.ts +6 -0
- package/src/utils/convert/index.ts +5 -0
- package/src/utils/convert/types.ts +17 -0
- package/src/utils/generateRandomString.ts +16 -0
- package/src/utils/globalHelpers/index.native.ts +28 -0
- package/src/utils/globalHelpers/index.ts +54 -0
- package/src/utils/index.ts +15 -0
- package/src/utils/isBrowser.ts +5 -0
- package/src/utils/isWebWorker.ts +13 -0
- package/src/utils/retry/NonRetryableError.ts +9 -0
- package/src/utils/retry/constants.ts +4 -0
- package/src/utils/retry/index.ts +8 -0
- package/src/utils/retry/isNonRetryableError.ts +9 -0
- package/src/utils/retry/jitteredBackoff.ts +21 -0
- package/src/utils/retry/jitteredExponentialRetry.ts +18 -0
- package/src/{Util/Retry.ts → utils/retry/retry.ts} +4 -44
- package/src/{Util/StringUtils.ts → utils/urlSafeDecode.ts} +0 -6
- package/src/utils/urlSafeEncode.ts +9 -0
- package/lib/Util/JS.d.ts +0 -29
- package/lib/Util/JS.js +0 -214
- package/lib/Util/Reachability.d.ts +0 -13
- package/lib/Util/Reachability.js +0 -69
- package/lib/Util/Reachability.native.d.ts +0 -12
- package/lib/Util/Retry.d.ts +0 -21
- package/lib/Util/index.d.ts +0 -7
- package/lib/Util/index.js +0 -31
- package/lib-esm/Util/JS.d.ts +0 -29
- package/lib-esm/Util/JS.js +0 -199
- package/lib-esm/Util/Reachability.d.ts +0 -13
- package/lib-esm/Util/Reachability.js +0 -64
- package/lib-esm/Util/Reachability.native.d.ts +0 -12
- package/lib-esm/Util/Retry.d.ts +0 -21
- package/lib-esm/Util/index.d.ts +0 -7
- package/lib-esm/Util/index.js +0 -9
- package/src/Util/JS.ts +0 -255
- package/src/Util/Reachability.ts +0 -58
- package/src/Util/index.ts +0 -23
- /package/lib/{Util → Signer}/DateUtils.d.ts +0 -0
- /package/lib/{Util → Signer}/DateUtils.js +0 -0
- /package/lib/{Signer.d.ts → Signer/Signer.d.ts} +0 -0
- /package/lib-esm/{Util → Signer}/DateUtils.d.ts +0 -0
- /package/lib-esm/{Util → Signer}/DateUtils.js +0 -0
- /package/lib-esm/{Signer.d.ts → Signer/Signer.d.ts} +0 -0
- /package/src/{Util → Signer}/DateUtils.ts +0 -0
|
@@ -21,20 +21,8 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
22
|
* THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
|
|
27
|
-
isLocked(): boolean;
|
|
28
|
-
}
|
|
29
|
-
declare namespace MutexInterface {
|
|
30
|
-
interface Releaser {
|
|
31
|
-
(): void;
|
|
32
|
-
}
|
|
33
|
-
interface Worker<T> {
|
|
34
|
-
(): Promise<T> | T;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
declare class Mutex implements MutexInterface {
|
|
24
|
+
import { MutexInterface } from './types';
|
|
25
|
+
export declare class Mutex implements MutexInterface {
|
|
38
26
|
isLocked(): boolean;
|
|
39
27
|
acquire(): Promise<MutexInterface.Releaser>;
|
|
40
28
|
runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
|
|
@@ -42,4 +30,3 @@ declare class Mutex implements MutexInterface {
|
|
|
42
30
|
private _queue;
|
|
43
31
|
private _pending;
|
|
44
32
|
}
|
|
45
|
-
export default Mutex;
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* THE SOFTWARE.
|
|
26
26
|
*/
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.Mutex = void 0;
|
|
28
29
|
var Mutex = /** @class */ (function () {
|
|
29
30
|
function Mutex() {
|
|
30
31
|
this._queue = [];
|
|
@@ -70,4 +71,4 @@ var Mutex = /** @class */ (function () {
|
|
|
70
71
|
};
|
|
71
72
|
return Mutex;
|
|
72
73
|
}());
|
|
73
|
-
exports.
|
|
74
|
+
exports.Mutex = Mutex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Mutex } from './Mutex';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Mutex = void 0;
|
|
6
|
+
var Mutex_1 = require("./Mutex");
|
|
7
|
+
Object.defineProperty(exports, "Mutex", { enumerable: true, get: function () { return Mutex_1.Mutex; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface MutexInterface {
|
|
2
|
+
acquire(): Promise<MutexInterface.Releaser>;
|
|
3
|
+
runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
|
|
4
|
+
isLocked(): boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare namespace MutexInterface {
|
|
7
|
+
interface Releaser {
|
|
8
|
+
(): void;
|
|
9
|
+
}
|
|
10
|
+
interface Worker<T> {
|
|
11
|
+
(): Promise<T> | T;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.1-console-preview.
|
|
1
|
+
export declare const version = "6.0.1-console-preview.4b7d177.0+4b7d177";
|
package/lib/Platform/version.js
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Reachability = void 0;
|
|
6
|
+
var rxjs_1 = require("rxjs");
|
|
7
|
+
var libraryUtils_1 = require("../libraryUtils");
|
|
8
|
+
var Reachability = exports.Reachability = /** @class */ (function () {
|
|
9
|
+
function Reachability() {
|
|
10
|
+
}
|
|
11
|
+
Reachability.prototype.networkMonitor = function (_) {
|
|
12
|
+
var globalObj = (0, libraryUtils_1.isWebWorker)() ? self : window;
|
|
13
|
+
return new rxjs_1.Observable(function (observer) {
|
|
14
|
+
observer.next({ online: globalObj.navigator.onLine });
|
|
15
|
+
var notifyOnline = function () { return observer.next({ online: true }); };
|
|
16
|
+
var notifyOffline = function () { return observer.next({ online: false }); };
|
|
17
|
+
globalObj.addEventListener('online', notifyOnline);
|
|
18
|
+
globalObj.addEventListener('offline', notifyOffline);
|
|
19
|
+
Reachability._observers.push(observer);
|
|
20
|
+
return function () {
|
|
21
|
+
globalObj.removeEventListener('online', notifyOnline);
|
|
22
|
+
globalObj.removeEventListener('offline', notifyOffline);
|
|
23
|
+
Reachability._observers = Reachability._observers.filter(function (_observer) { return _observer !== observer; });
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
Reachability._observers = [];
|
|
28
|
+
return Reachability;
|
|
29
|
+
}());
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Reachability = void 0;
|
|
6
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
8
|
-
var
|
|
6
|
+
var rxjs_1 = require("rxjs");
|
|
9
7
|
var Logger_1 = require("../Logger");
|
|
10
8
|
var logger = new Logger_1.ConsoleLogger('Reachability', 'DEBUG');
|
|
11
|
-
var
|
|
12
|
-
function
|
|
9
|
+
var Reachability = /** @class */ (function () {
|
|
10
|
+
function Reachability() {
|
|
13
11
|
}
|
|
14
|
-
|
|
12
|
+
Reachability.prototype.networkMonitor = function (netInfo) {
|
|
15
13
|
/**
|
|
16
14
|
* Here netinfo refers to @react-native-community/netinfo
|
|
17
15
|
* This is needed in React Native to enable network detection
|
|
@@ -22,7 +20,7 @@ var ReachabilityNavigator = /** @class */ (function () {
|
|
|
22
20
|
if (!(netInfo && netInfo.addEventListener)) {
|
|
23
21
|
throw new Error('NetInfo must be passed to networkMonitor to enable reachability in React Native');
|
|
24
22
|
}
|
|
25
|
-
return new
|
|
23
|
+
return new rxjs_1.Observable(function (observer) {
|
|
26
24
|
logger.log('subscribing to reachability in React Native');
|
|
27
25
|
var unsubscribe = netInfo.addEventListener(function (_a) {
|
|
28
26
|
var isInternetReachable = _a.isInternetReachable;
|
|
@@ -39,6 +37,6 @@ var ReachabilityNavigator = /** @class */ (function () {
|
|
|
39
37
|
};
|
|
40
38
|
});
|
|
41
39
|
};
|
|
42
|
-
return
|
|
40
|
+
return Reachability;
|
|
43
41
|
}());
|
|
44
|
-
exports.
|
|
42
|
+
exports.Reachability = Reachability;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Reachability } from './Reachability';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Reachability = void 0;
|
|
6
|
+
var Reachability_1 = require("./Reachability");
|
|
7
|
+
Object.defineProperty(exports, "Reachability", { enumerable: true, get: function () { return Reachability_1.Reachability; } });
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.ServiceWorkerClass = void 0;
|
|
6
6
|
var Logger_1 = require("../Logger");
|
|
7
|
-
var
|
|
7
|
+
var utils_1 = require("../utils");
|
|
8
8
|
var Amplify_1 = require("../Amplify");
|
|
9
9
|
var errors_1 = require("../errors");
|
|
10
10
|
var errorHelpers_1 = require("./errorHelpers");
|
|
@@ -108,7 +108,7 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
108
108
|
(0, errorHelpers_1.assert)(this._registration !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedRegistration);
|
|
109
109
|
this._publicKey = publicKey;
|
|
110
110
|
return new Promise(function (resolve, reject) {
|
|
111
|
-
if ((0,
|
|
111
|
+
if ((0, utils_1.isBrowser)()) {
|
|
112
112
|
(0, errorHelpers_1.assert)(_this._registration !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedRegistration);
|
|
113
113
|
_this._registration.pushManager.getSubscription().then(function (subscription) {
|
|
114
114
|
if (subscription) {
|
|
@@ -14,8 +14,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.Signer = void 0;
|
|
17
|
-
var
|
|
18
|
-
var signatureV4_1 = require("
|
|
17
|
+
var DateUtils_1 = require("./DateUtils");
|
|
18
|
+
var signatureV4_1 = require("../clients/middleware/signing/signer/signatureV4");
|
|
19
19
|
var IOT_SERVICE_NAME = 'iotdevicegateway';
|
|
20
20
|
// Best practice regex to parse the service and region from an AWS endpoint
|
|
21
21
|
var AWS_ENDPOINT_REGEX = /([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(.cn)?$/;
|
|
@@ -105,7 +105,7 @@ var getOptions = function (request, accessInfo, serviceInfo, expiration) {
|
|
|
105
105
|
var credentials = __assign({ accessKeyId: access_key, secretAccessKey: secret_key }, (sessionTokenRequiredInSigning(service)
|
|
106
106
|
? { sessionToken: session_token }
|
|
107
107
|
: {}));
|
|
108
|
-
return __assign({ credentials: credentials, signingDate:
|
|
108
|
+
return __assign({ credentials: credentials, signingDate: DateUtils_1.DateUtils.getDateWithClockOffset(), signingRegion: region, signingService: service }, (expiration && { expiration: expiration }));
|
|
109
109
|
};
|
|
110
110
|
// TODO: V6 investigate whether add to custom clients' general signer implementation.
|
|
111
111
|
var parseServiceInfo = function (url) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Signer } from './Signer';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Signer = void 0;
|
|
6
|
+
var Signer_1 = require("./Signer");
|
|
7
|
+
Object.defineProperty(exports, "Signer", { enumerable: true, get: function () { return Signer_1.Signer; } });
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.jitteredBackoff = void 0;
|
|
6
6
|
// TODO: [v6] The separate retry utility is used by Data packages now and will replaced by retry middleware.
|
|
7
|
-
var
|
|
7
|
+
var utils_1 = require("../../../utils");
|
|
8
8
|
var DEFAULT_MAX_DELAY_MS = 5 * 60 * 1000;
|
|
9
9
|
var jitteredBackoff = function (attempt) {
|
|
10
|
-
var delayFunction = (0,
|
|
10
|
+
var delayFunction = (0, utils_1.jitteredBackoff)(DEFAULT_MAX_DELAY_MS);
|
|
11
11
|
var delay = delayFunction(attempt);
|
|
12
12
|
// The delayFunction returns false when the delay is greater than the max delay(5 mins).
|
|
13
13
|
// In this case, the retry middleware will delay 5 mins instead, as a ceiling of the delay.
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export declare const AWS_CLOUDWATCH_CATEGORY = "Logging";
|
|
2
|
-
export declare const NO_CREDS_ERROR_STRING = "No credentials";
|
|
3
|
-
export declare const RETRY_ERROR_CODES: string[];
|
|
4
2
|
export declare const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER: string | symbol;
|
|
5
3
|
export declare const USER_AGENT_HEADER = "x-amz-user-agent";
|
|
6
4
|
export declare const NO_HUBCALLBACK_PROVIDED_EXCEPTION = "NoHubcallbackProvidedException";
|
|
@@ -2,14 +2,9 @@
|
|
|
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.NO_HUBCALLBACK_PROVIDED_EXCEPTION = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.
|
|
5
|
+
exports.NO_HUBCALLBACK_PROVIDED_EXCEPTION = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.AWS_CLOUDWATCH_CATEGORY = void 0;
|
|
6
6
|
// Logging constants
|
|
7
7
|
exports.AWS_CLOUDWATCH_CATEGORY = 'Logging';
|
|
8
|
-
exports.NO_CREDS_ERROR_STRING = 'No credentials';
|
|
9
|
-
exports.RETRY_ERROR_CODES = [
|
|
10
|
-
'ResourceNotFoundException',
|
|
11
|
-
'InvalidSequenceTokenException',
|
|
12
|
-
];
|
|
13
8
|
/**
|
|
14
9
|
* This Symbol is used to reference an internal-only PubSub provider that
|
|
15
10
|
* is used for AppSync/GraphQL subscriptions in the API category.
|
package/lib/libraryUtils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { generateRandomString, isBrowser, isNonRetryableError, isWebWorker, jitteredBackoff, jitteredExponentialRetry, NonRetryableError, retry, urlSafeDecode, urlSafeEncode, } from './utils';
|
|
2
2
|
export { parseAWSExports } from './parseAWSExports';
|
|
3
3
|
export { LegacyConfig } from './singleton/types';
|
|
4
4
|
export { JWT, StrictUnion, CognitoIdentityPoolConfig, JwtPayload, } from './singleton/Auth/types';
|
|
@@ -10,13 +10,14 @@ export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
|
|
|
10
10
|
export { ClientDevice } from './ClientDevice';
|
|
11
11
|
export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
|
|
12
12
|
export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
|
|
13
|
-
export declare const Constants: {
|
|
14
|
-
userAgent: string;
|
|
15
|
-
};
|
|
16
13
|
export { ServiceWorker } from './ServiceWorker';
|
|
17
|
-
export {
|
|
14
|
+
export { BackgroundProcessManager } from './BackgroundProcessManager';
|
|
15
|
+
export { Mutex } from './Mutex';
|
|
16
|
+
export { Reachability } from './Reachability';
|
|
18
17
|
export { AmplifyError, PlatformNotSupportedError, createAssertionFunction, } from './errors';
|
|
19
18
|
export { AmplifyErrorCode, AmplifyErrorMap, AmplifyErrorParams, AssertionFunction, ServiceError, } from './types';
|
|
20
|
-
export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './
|
|
19
|
+
export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './constants';
|
|
21
20
|
export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
|
|
22
21
|
export { AMPLIFY_SYMBOL } from './Hub';
|
|
22
|
+
export { base64Decoder, base64Encoder } from './utils/convert';
|
|
23
|
+
export { getCrypto } from './utils/globalHelpers';
|
package/lib/libraryUtils.js
CHANGED
|
@@ -2,34 +2,32 @@
|
|
|
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.
|
|
5
|
+
exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.AmplifyErrorCode = exports.createAssertionFunction = exports.PlatformNotSupportedError = exports.AmplifyError = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.ServiceWorker = 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.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.parseAWSExports = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;
|
|
6
|
+
exports.getCrypto = 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
|
-
//
|
|
12
|
-
var
|
|
13
|
-
Object.defineProperty(exports, "
|
|
14
|
-
Object.defineProperty(exports, "
|
|
15
|
-
Object.defineProperty(exports, "
|
|
16
|
-
Object.defineProperty(exports, "
|
|
17
|
-
Object.defineProperty(exports, "
|
|
18
|
-
Object.defineProperty(exports, "
|
|
19
|
-
Object.defineProperty(exports, "
|
|
20
|
-
Object.defineProperty(exports, "
|
|
21
|
-
Object.defineProperty(exports, "
|
|
22
|
-
Object.defineProperty(exports, "
|
|
23
|
-
Object.defineProperty(exports, "transferKeyToLowerCase", { enumerable: true, get: function () { return JS_1.transferKeyToLowerCase; } });
|
|
24
|
-
Object.defineProperty(exports, "transferKeyToUpperCase", { enumerable: true, get: function () { return JS_1.transferKeyToUpperCase; } });
|
|
11
|
+
// Core utilities
|
|
12
|
+
var utils_1 = require("./utils");
|
|
13
|
+
Object.defineProperty(exports, "generateRandomString", { enumerable: true, get: function () { return utils_1.generateRandomString; } });
|
|
14
|
+
Object.defineProperty(exports, "isBrowser", { enumerable: true, get: function () { return utils_1.isBrowser; } });
|
|
15
|
+
Object.defineProperty(exports, "isNonRetryableError", { enumerable: true, get: function () { return utils_1.isNonRetryableError; } });
|
|
16
|
+
Object.defineProperty(exports, "isWebWorker", { enumerable: true, get: function () { return utils_1.isWebWorker; } });
|
|
17
|
+
Object.defineProperty(exports, "jitteredBackoff", { enumerable: true, get: function () { return utils_1.jitteredBackoff; } });
|
|
18
|
+
Object.defineProperty(exports, "jitteredExponentialRetry", { enumerable: true, get: function () { return utils_1.jitteredExponentialRetry; } });
|
|
19
|
+
Object.defineProperty(exports, "NonRetryableError", { enumerable: true, get: function () { return utils_1.NonRetryableError; } });
|
|
20
|
+
Object.defineProperty(exports, "retry", { enumerable: true, get: function () { return utils_1.retry; } });
|
|
21
|
+
Object.defineProperty(exports, "urlSafeDecode", { enumerable: true, get: function () { return utils_1.urlSafeDecode; } });
|
|
22
|
+
Object.defineProperty(exports, "urlSafeEncode", { enumerable: true, get: function () { return utils_1.urlSafeEncode; } });
|
|
25
23
|
var parseAWSExports_1 = require("./parseAWSExports");
|
|
26
24
|
Object.defineProperty(exports, "parseAWSExports", { enumerable: true, get: function () { return parseAWSExports_1.parseAWSExports; } });
|
|
27
25
|
// Auth utilities
|
|
28
|
-
var
|
|
29
|
-
Object.defineProperty(exports, "decodeJWT", { enumerable: true, get: function () { return
|
|
30
|
-
Object.defineProperty(exports, "assertTokenProviderConfig", { enumerable: true, get: function () { return
|
|
31
|
-
Object.defineProperty(exports, "assertIdentityPoolIdConfig", { enumerable: true, get: function () { return
|
|
32
|
-
Object.defineProperty(exports, "assertOAuthConfig", { enumerable: true, get: function () { return
|
|
26
|
+
var utils_2 = require("./singleton/Auth/utils");
|
|
27
|
+
Object.defineProperty(exports, "decodeJWT", { enumerable: true, get: function () { return utils_2.decodeJWT; } });
|
|
28
|
+
Object.defineProperty(exports, "assertTokenProviderConfig", { enumerable: true, get: function () { return utils_2.assertTokenProviderConfig; } });
|
|
29
|
+
Object.defineProperty(exports, "assertIdentityPoolIdConfig", { enumerable: true, get: function () { return utils_2.assertIdentityPoolIdConfig; } });
|
|
30
|
+
Object.defineProperty(exports, "assertOAuthConfig", { enumerable: true, get: function () { return utils_2.assertOAuthConfig; } });
|
|
33
31
|
var Auth_1 = require("./singleton/Auth");
|
|
34
32
|
Object.defineProperty(exports, "isTokenExpired", { enumerable: true, get: function () { return Auth_1.isTokenExpired; } });
|
|
35
33
|
var Signer_1 = require("./Signer");
|
|
@@ -39,13 +37,12 @@ var Logger_1 = require("./Logger");
|
|
|
39
37
|
Object.defineProperty(exports, "ConsoleLogger", { enumerable: true, get: function () { return Logger_1.ConsoleLogger; } });
|
|
40
38
|
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return Logger_1.ConsoleLogger; } });
|
|
41
39
|
// Platform & device utils
|
|
42
|
-
var Platform_1 = require("./Platform");
|
|
43
40
|
var ClientDevice_1 = require("./ClientDevice");
|
|
44
41
|
Object.defineProperty(exports, "ClientDevice", { enumerable: true, get: function () { return ClientDevice_1.ClientDevice; } });
|
|
45
|
-
var
|
|
46
|
-
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return
|
|
47
|
-
Object.defineProperty(exports, "getAmplifyUserAgentObject", { enumerable: true, get: function () { return
|
|
48
|
-
Object.defineProperty(exports, "getAmplifyUserAgent", { enumerable: true, get: function () { return
|
|
42
|
+
var Platform_1 = require("./Platform");
|
|
43
|
+
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return Platform_1.Platform; } });
|
|
44
|
+
Object.defineProperty(exports, "getAmplifyUserAgentObject", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgentObject; } });
|
|
45
|
+
Object.defineProperty(exports, "getAmplifyUserAgent", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgent; } });
|
|
49
46
|
var types_1 = require("./Platform/types");
|
|
50
47
|
Object.defineProperty(exports, "ApiAction", { enumerable: true, get: function () { return types_1.ApiAction; } });
|
|
51
48
|
Object.defineProperty(exports, "AuthAction", { enumerable: true, get: function () { return types_1.AuthAction; } });
|
|
@@ -60,40 +57,31 @@ Object.defineProperty(exports, "PredictionsAction", { enumerable: true, get: fun
|
|
|
60
57
|
Object.defineProperty(exports, "PubSubAction", { enumerable: true, get: function () { return types_1.PubSubAction; } });
|
|
61
58
|
Object.defineProperty(exports, "PushNotificationAction", { enumerable: true, get: function () { return types_1.PushNotificationAction; } });
|
|
62
59
|
Object.defineProperty(exports, "StorageAction", { enumerable: true, get: function () { return types_1.StorageAction; } });
|
|
63
|
-
exports.Constants = {
|
|
64
|
-
userAgent: Platform_1.Platform.userAgent,
|
|
65
|
-
};
|
|
66
60
|
// Service worker
|
|
67
61
|
var ServiceWorker_1 = require("./ServiceWorker");
|
|
68
62
|
Object.defineProperty(exports, "ServiceWorker", { enumerable: true, get: function () { return ServiceWorker_1.ServiceWorker; } });
|
|
69
63
|
// Other utilities & constants
|
|
70
|
-
var
|
|
71
|
-
Object.defineProperty(exports, "
|
|
72
|
-
|
|
73
|
-
Object.defineProperty(exports, "
|
|
74
|
-
|
|
75
|
-
Object.defineProperty(exports, "
|
|
76
|
-
Object.defineProperty(exports, "Mutex", { enumerable: true, get: function () { return Util_1.Mutex; } });
|
|
77
|
-
Object.defineProperty(exports, "NO_CREDS_ERROR_STRING", { enumerable: true, get: function () { return Util_1.NO_CREDS_ERROR_STRING; } });
|
|
78
|
-
Object.defineProperty(exports, "NonRetryableError", { enumerable: true, get: function () { return Util_1.NonRetryableError; } });
|
|
79
|
-
Object.defineProperty(exports, "RETRY_ERROR_CODES", { enumerable: true, get: function () { return Util_1.RETRY_ERROR_CODES; } });
|
|
80
|
-
Object.defineProperty(exports, "Reachability", { enumerable: true, get: function () { return Util_1.Reachability; } });
|
|
81
|
-
Object.defineProperty(exports, "isNonRetryableError", { enumerable: true, get: function () { return Util_1.isNonRetryableError; } });
|
|
82
|
-
Object.defineProperty(exports, "jitteredBackoff", { enumerable: true, get: function () { return Util_1.jitteredBackoff; } });
|
|
83
|
-
Object.defineProperty(exports, "jitteredExponentialRetry", { enumerable: true, get: function () { return Util_1.jitteredExponentialRetry; } });
|
|
84
|
-
Object.defineProperty(exports, "retry", { enumerable: true, get: function () { return Util_1.retry; } });
|
|
85
|
-
Object.defineProperty(exports, "urlSafeDecode", { enumerable: true, get: function () { return Util_1.urlSafeDecode; } });
|
|
86
|
-
Object.defineProperty(exports, "urlSafeEncode", { enumerable: true, get: function () { return Util_1.urlSafeEncode; } });
|
|
64
|
+
var BackgroundProcessManager_1 = require("./BackgroundProcessManager");
|
|
65
|
+
Object.defineProperty(exports, "BackgroundProcessManager", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManager; } });
|
|
66
|
+
var Mutex_1 = require("./Mutex");
|
|
67
|
+
Object.defineProperty(exports, "Mutex", { enumerable: true, get: function () { return Mutex_1.Mutex; } });
|
|
68
|
+
var Reachability_1 = require("./Reachability");
|
|
69
|
+
Object.defineProperty(exports, "Reachability", { enumerable: true, get: function () { return Reachability_1.Reachability; } });
|
|
87
70
|
var errors_1 = require("./errors");
|
|
88
71
|
Object.defineProperty(exports, "AmplifyError", { enumerable: true, get: function () { return errors_1.AmplifyError; } });
|
|
89
72
|
Object.defineProperty(exports, "PlatformNotSupportedError", { enumerable: true, get: function () { return errors_1.PlatformNotSupportedError; } });
|
|
90
73
|
Object.defineProperty(exports, "createAssertionFunction", { enumerable: true, get: function () { return errors_1.createAssertionFunction; } });
|
|
91
74
|
var types_2 = require("./types");
|
|
92
75
|
Object.defineProperty(exports, "AmplifyErrorCode", { enumerable: true, get: function () { return types_2.AmplifyErrorCode; } });
|
|
93
|
-
var
|
|
94
|
-
Object.defineProperty(exports, "INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER", { enumerable: true, get: function () { return
|
|
95
|
-
Object.defineProperty(exports, "USER_AGENT_HEADER", { enumerable: true, get: function () { return
|
|
76
|
+
var constants_1 = require("./constants");
|
|
77
|
+
Object.defineProperty(exports, "INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER", { enumerable: true, get: function () { return constants_1.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER; } });
|
|
78
|
+
Object.defineProperty(exports, "USER_AGENT_HEADER", { enumerable: true, get: function () { return constants_1.USER_AGENT_HEADER; } });
|
|
96
79
|
var fetchAuthSession_1 = require("./singleton/apis/internal/fetchAuthSession");
|
|
97
80
|
Object.defineProperty(exports, "fetchAuthSession", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });
|
|
98
81
|
var Hub_1 = require("./Hub");
|
|
99
82
|
Object.defineProperty(exports, "AMPLIFY_SYMBOL", { enumerable: true, get: function () { return Hub_1.AMPLIFY_SYMBOL; } });
|
|
83
|
+
var convert_1 = require("./utils/convert");
|
|
84
|
+
Object.defineProperty(exports, "base64Decoder", { enumerable: true, get: function () { return convert_1.base64Decoder; } });
|
|
85
|
+
Object.defineProperty(exports, "base64Encoder", { enumerable: true, get: function () { return convert_1.base64Encoder; } });
|
|
86
|
+
var globalHelpers_1 = require("./utils/globalHelpers");
|
|
87
|
+
Object.defineProperty(exports, "getCrypto", { enumerable: true, get: function () { return globalHelpers_1.getCrypto; } });
|
|
@@ -4,6 +4,7 @@ exports.decodeJWT = exports.assertIdentityPoolIdConfig = exports.assertOAuthConf
|
|
|
4
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
var errorHelpers_1 = require("./errorHelpers");
|
|
7
|
+
var convert_1 = require("../../../utils/convert");
|
|
7
8
|
function assertTokenProviderConfig(cognitoConfig) {
|
|
8
9
|
var assertionValid = true; // assume valid until otherwise proveed
|
|
9
10
|
if (!cognitoConfig) {
|
|
@@ -55,6 +56,6 @@ function decodeJWT(token) {
|
|
|
55
56
|
}
|
|
56
57
|
exports.decodeJWT = decodeJWT;
|
|
57
58
|
function base64ToBytes(base64) {
|
|
58
|
-
var binString =
|
|
59
|
+
var binString = convert_1.base64Decoder.convert(base64);
|
|
59
60
|
return Uint8Array.from(binString, function (m) { return m.codePointAt(0) || 0; });
|
|
60
61
|
}
|
package/lib/singleton/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AnalyticsConfig } from './Analytics/types';
|
|
|
3
3
|
import { AuthConfig, LibraryAuthOptions, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, CognitoIdentityPoolConfig } from './Auth/types';
|
|
4
4
|
import { GeoConfig } from './Geo/types';
|
|
5
5
|
import { LibraryStorageOptions, StorageAccessLevel, StorageConfig } from './Storage/types';
|
|
6
|
+
import { I18nConfig } from '../I18n/types';
|
|
6
7
|
export type LegacyConfig = {
|
|
7
8
|
/**
|
|
8
9
|
* @deprecated The field should not be used.
|
|
@@ -13,6 +14,7 @@ export type ResourcesConfig = {
|
|
|
13
14
|
API?: APIConfig;
|
|
14
15
|
Analytics?: AnalyticsConfig;
|
|
15
16
|
Auth?: AuthConfig;
|
|
17
|
+
I18n?: I18nConfig;
|
|
16
18
|
Storage?: StorageConfig;
|
|
17
19
|
Geo?: GeoConfig;
|
|
18
20
|
};
|