@aws-amplify/core 6.0.1-console-preview.67f944e.0 → 6.0.1-console-preview.0bbe168.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/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/providers/pinpoint/apis/updateEndpoint.d.ts +1 -1
- package/lib/providers/pinpoint/apis/updateEndpoint.js +7 -5
- package/lib/providers/pinpoint/types/pinpoint.d.ts +1 -0
- package/lib/singleton/Auth/utils/index.js +2 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core.d.ts +4 -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/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/providers/pinpoint/apis/updateEndpoint.d.ts +1 -1
- package/lib-esm/providers/pinpoint/apis/updateEndpoint.js +7 -5
- package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +1 -0
- package/lib-esm/singleton/Auth/utils/index.js +2 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/core.d.ts +4 -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 +7 -4
- 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/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/providers/pinpoint/apis/updateEndpoint.ts +19 -3
- package/src/providers/pinpoint/types/pinpoint.ts +1 -0
- package/src/singleton/Auth/utils/index.ts +2 -1
- package/src/types/core.ts +4 -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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BackgroundProcessManagerState } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* @private For internal Amplify use.
|
|
3
4
|
*
|
|
@@ -179,26 +180,3 @@ export declare class BackgroundProcessManager {
|
|
|
179
180
|
*/
|
|
180
181
|
open(): Promise<void>;
|
|
181
182
|
}
|
|
182
|
-
/**
|
|
183
|
-
*
|
|
184
|
-
*/
|
|
185
|
-
export declare class BackgroundManagerNotOpenError extends Error {
|
|
186
|
-
constructor(message: string);
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* All possible states a `BackgroundProcessManager` instance can be in.
|
|
190
|
-
*/
|
|
191
|
-
export declare enum BackgroundProcessManagerState {
|
|
192
|
-
/**
|
|
193
|
-
* Accepting new jobs.
|
|
194
|
-
*/
|
|
195
|
-
Open = "Open",
|
|
196
|
-
/**
|
|
197
|
-
* Not accepting new jobs. Waiting for submitted jobs to complete.
|
|
198
|
-
*/
|
|
199
|
-
Closing = "Closing",
|
|
200
|
-
/**
|
|
201
|
-
* Not accepting new jobs. All submitted jobs are complete.
|
|
202
|
-
*/
|
|
203
|
-
Closed = "Closed"
|
|
204
|
-
}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
16
3
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
4
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
5
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -60,8 +47,8 @@ var __values = (this && this.__values) || function(o) {
|
|
|
60
47
|
};
|
|
61
48
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
62
49
|
};
|
|
63
|
-
|
|
64
|
-
|
|
50
|
+
import { BackgroundManagerNotOpenError } from './BackgroundManagerNotOpenError';
|
|
51
|
+
import { BackgroundProcessManagerState } from './types';
|
|
65
52
|
/**
|
|
66
53
|
* @private For internal Amplify use.
|
|
67
54
|
*
|
|
@@ -414,33 +401,3 @@ var BackgroundProcessManager = /** @class */ (function () {
|
|
|
414
401
|
return BackgroundProcessManager;
|
|
415
402
|
}());
|
|
416
403
|
export { BackgroundProcessManager };
|
|
417
|
-
/**
|
|
418
|
-
*
|
|
419
|
-
*/
|
|
420
|
-
var BackgroundManagerNotOpenError = /** @class */ (function (_super) {
|
|
421
|
-
__extends(BackgroundManagerNotOpenError, _super);
|
|
422
|
-
function BackgroundManagerNotOpenError(message) {
|
|
423
|
-
return _super.call(this, "BackgroundManagerNotOpenError: ".concat(message)) || this;
|
|
424
|
-
}
|
|
425
|
-
return BackgroundManagerNotOpenError;
|
|
426
|
-
}(Error));
|
|
427
|
-
export { BackgroundManagerNotOpenError };
|
|
428
|
-
/**
|
|
429
|
-
* All possible states a `BackgroundProcessManager` instance can be in.
|
|
430
|
-
*/
|
|
431
|
-
export var BackgroundProcessManagerState;
|
|
432
|
-
(function (BackgroundProcessManagerState) {
|
|
433
|
-
/**
|
|
434
|
-
* Accepting new jobs.
|
|
435
|
-
*/
|
|
436
|
-
BackgroundProcessManagerState["Open"] = "Open";
|
|
437
|
-
/**
|
|
438
|
-
* Not accepting new jobs. Waiting for submitted jobs to complete.
|
|
439
|
-
*/
|
|
440
|
-
BackgroundProcessManagerState["Closing"] = "Closing";
|
|
441
|
-
/**
|
|
442
|
-
* Not accepting new jobs. All submitted jobs are complete.
|
|
443
|
-
*/
|
|
444
|
-
BackgroundProcessManagerState["Closed"] = "Closed";
|
|
445
|
-
})(BackgroundProcessManagerState || (BackgroundProcessManagerState = {}));
|
|
446
|
-
var process = new BackgroundProcessManager();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BackgroundProcessManager } from './BackgroundProcessManager';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All possible states a `BackgroundProcessManager` instance can be in.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum BackgroundProcessManagerState {
|
|
5
|
+
/**
|
|
6
|
+
* Accepting new jobs.
|
|
7
|
+
*/
|
|
8
|
+
Open = "Open",
|
|
9
|
+
/**
|
|
10
|
+
* Not accepting new jobs. Waiting for submitted jobs to complete.
|
|
11
|
+
*/
|
|
12
|
+
Closing = "Closing",
|
|
13
|
+
/**
|
|
14
|
+
* Not accepting new jobs. All submitted jobs are complete.
|
|
15
|
+
*/
|
|
16
|
+
Closed = "Closed"
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Completely internal to `BackgroundProcessManager`, and describes the structure of
|
|
20
|
+
* an entry in the jobs registry.
|
|
21
|
+
*/
|
|
22
|
+
export type JobEntry = {
|
|
23
|
+
/**
|
|
24
|
+
* The underlying promise provided by the job function to wait for.
|
|
25
|
+
*/
|
|
26
|
+
promise: Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Request the termination of the job.
|
|
29
|
+
*/
|
|
30
|
+
terminate: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* An object provided by the caller that can be used to identify the description
|
|
33
|
+
* of the job, which can otherwise be unclear from the `promise` and
|
|
34
|
+
* `terminate` function. The `description` can be a string. (May be extended
|
|
35
|
+
* later to also support object refs.)
|
|
36
|
+
*
|
|
37
|
+
* Useful for troubleshooting why a manager is waiting for long periods of time
|
|
38
|
+
* on `close()`.
|
|
39
|
+
*/
|
|
40
|
+
description?: string;
|
|
41
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* All possible states a `BackgroundProcessManager` instance can be in.
|
|
5
|
+
*/
|
|
6
|
+
export var BackgroundProcessManagerState;
|
|
7
|
+
(function (BackgroundProcessManagerState) {
|
|
8
|
+
/**
|
|
9
|
+
* Accepting new jobs.
|
|
10
|
+
*/
|
|
11
|
+
BackgroundProcessManagerState["Open"] = "Open";
|
|
12
|
+
/**
|
|
13
|
+
* Not accepting new jobs. Waiting for submitted jobs to complete.
|
|
14
|
+
*/
|
|
15
|
+
BackgroundProcessManagerState["Closing"] = "Closing";
|
|
16
|
+
/**
|
|
17
|
+
* Not accepting new jobs. All submitted jobs are complete.
|
|
18
|
+
*/
|
|
19
|
+
BackgroundProcessManagerState["Closed"] = "Closed";
|
|
20
|
+
})(BackgroundProcessManagerState || (BackgroundProcessManagerState = {}));
|
package/lib-esm/Hub/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
37
37
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
38
38
|
};
|
|
39
39
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
40
|
-
import { NO_HUBCALLBACK_PROVIDED_EXCEPTION } from '../
|
|
40
|
+
import { NO_HUBCALLBACK_PROVIDED_EXCEPTION } from '../constants';
|
|
41
41
|
import { AmplifyError } from '../errors';
|
|
42
42
|
export var AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
|
|
43
43
|
? Symbol.for('amplify_default')
|
|
@@ -36,7 +36,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
36
36
|
}
|
|
37
37
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
38
38
|
};
|
|
39
|
-
import { AWS_CLOUDWATCH_CATEGORY } from '../
|
|
39
|
+
import { AWS_CLOUDWATCH_CATEGORY } from '../constants';
|
|
40
40
|
var LOG_LEVELS = {
|
|
41
41
|
VERBOSE: 1,
|
|
42
42
|
DEBUG: 2,
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Mutex } from './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.0bbe168.0+0bbe168";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export var version = '6.0.1-console-preview.
|
|
2
|
+
export var version = '6.0.1-console-preview.0bbe168.0+0bbe168';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { isWebWorker } from '../libraryUtils';
|
|
5
|
+
export var Reachability = /** @class */ (function () {
|
|
6
|
+
function Reachability() {
|
|
7
|
+
}
|
|
8
|
+
Reachability.prototype.networkMonitor = function (_) {
|
|
9
|
+
var globalObj = isWebWorker() ? self : window;
|
|
10
|
+
return new Observable(function (observer) {
|
|
11
|
+
observer.next({ online: globalObj.navigator.onLine });
|
|
12
|
+
var notifyOnline = function () { return observer.next({ online: true }); };
|
|
13
|
+
var notifyOffline = function () { return observer.next({ online: false }); };
|
|
14
|
+
globalObj.addEventListener('online', notifyOnline);
|
|
15
|
+
globalObj.addEventListener('offline', notifyOffline);
|
|
16
|
+
Reachability._observers.push(observer);
|
|
17
|
+
return function () {
|
|
18
|
+
globalObj.removeEventListener('online', notifyOnline);
|
|
19
|
+
globalObj.removeEventListener('offline', notifyOffline);
|
|
20
|
+
Reachability._observers = Reachability._observers.filter(function (_observer) { return _observer !== observer; });
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Reachability._observers = [];
|
|
25
|
+
return Reachability;
|
|
26
|
+
}());
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import Observable from '
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
4
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
5
5
|
var logger = new Logger('Reachability', 'DEBUG');
|
|
6
|
-
var
|
|
7
|
-
function
|
|
6
|
+
var Reachability = /** @class */ (function () {
|
|
7
|
+
function Reachability() {
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
Reachability.prototype.networkMonitor = function (netInfo) {
|
|
10
10
|
/**
|
|
11
11
|
* Here netinfo refers to @react-native-community/netinfo
|
|
12
12
|
* This is needed in React Native to enable network detection
|
|
@@ -34,6 +34,6 @@ var ReachabilityNavigator = /** @class */ (function () {
|
|
|
34
34
|
};
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
return
|
|
37
|
+
return Reachability;
|
|
38
38
|
}());
|
|
39
|
-
export
|
|
39
|
+
export { Reachability };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Reachability } from './Reachability';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
4
|
-
import { isBrowser } from '../
|
|
4
|
+
import { isBrowser } from '../utils';
|
|
5
5
|
import { Amplify } from '../Amplify';
|
|
6
6
|
import { AmplifyError } from '../errors';
|
|
7
7
|
import { assert, ServiceWorkerErrorCode } from './errorHelpers';
|
|
@@ -11,8 +11,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
return __assign.apply(this, arguments);
|
|
13
13
|
};
|
|
14
|
-
import { DateUtils } from './
|
|
15
|
-
import { presignUrl, signRequest, TOKEN_QUERY_PARAM, } from '
|
|
14
|
+
import { DateUtils } from './DateUtils';
|
|
15
|
+
import { presignUrl, signRequest, TOKEN_QUERY_PARAM, } from '../clients/middleware/signing/signer/signatureV4';
|
|
16
16
|
var IOT_SERVICE_NAME = 'iotdevicegateway';
|
|
17
17
|
// Best practice regex to parse the service and region from an AWS endpoint
|
|
18
18
|
var AWS_ENDPOINT_REGEX = /([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(.cn)?$/;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Signer } from './Signer';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
// TODO: [v6] The separate retry utility is used by Data packages now and will replaced by retry middleware.
|
|
4
|
-
import { jitteredBackoff as jitteredBackoffUtil } from '../../../
|
|
4
|
+
import { jitteredBackoff as jitteredBackoffUtil } from '../../../utils';
|
|
5
5
|
var DEFAULT_MAX_DELAY_MS = 5 * 60 * 1000;
|
|
6
6
|
export var jitteredBackoff = function (attempt) {
|
|
7
7
|
var delayFunction = jitteredBackoffUtil(DEFAULT_MAX_DELAY_MS);
|
|
@@ -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,11 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
// Logging constants
|
|
4
4
|
export var AWS_CLOUDWATCH_CATEGORY = 'Logging';
|
|
5
|
-
export var NO_CREDS_ERROR_STRING = 'No credentials';
|
|
6
|
-
export var RETRY_ERROR_CODES = [
|
|
7
|
-
'ResourceNotFoundException',
|
|
8
|
-
'InvalidSequenceTokenException',
|
|
9
|
-
];
|
|
10
5
|
/**
|
|
11
6
|
* This Symbol is used to reference an internal-only PubSub provider that
|
|
12
7
|
* is used for AppSync/GraphQL subscriptions in the API category.
|
|
@@ -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-esm/libraryUtils.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
This file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal
|
|
5
5
|
utils for use throughout the library.
|
|
6
6
|
*/
|
|
7
|
-
//
|
|
8
|
-
export {
|
|
7
|
+
// Core utilities
|
|
8
|
+
export { generateRandomString, isBrowser, isNonRetryableError, isWebWorker, jitteredBackoff, jitteredExponentialRetry, NonRetryableError, retry, urlSafeDecode, urlSafeEncode, } from './utils';
|
|
9
9
|
export { parseAWSExports } from './parseAWSExports';
|
|
10
10
|
// Auth utilities
|
|
11
11
|
export { decodeJWT, assertTokenProviderConfig, assertIdentityPoolIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
|
|
@@ -14,19 +14,19 @@ export { Signer } from './Signer';
|
|
|
14
14
|
// Logging utilities
|
|
15
15
|
export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
|
|
16
16
|
// Platform & device utils
|
|
17
|
-
import { Platform } from './Platform';
|
|
18
17
|
export { ClientDevice } from './ClientDevice';
|
|
19
18
|
export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
|
|
20
19
|
export { ApiAction, AuthAction, AnalyticsAction, Category, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
|
|
21
|
-
export var Constants = {
|
|
22
|
-
userAgent: Platform.userAgent,
|
|
23
|
-
};
|
|
24
20
|
// Service worker
|
|
25
21
|
export { ServiceWorker } from './ServiceWorker';
|
|
26
22
|
// Other utilities & constants
|
|
27
|
-
export {
|
|
23
|
+
export { BackgroundProcessManager } from './BackgroundProcessManager';
|
|
24
|
+
export { Mutex } from './Mutex';
|
|
25
|
+
export { Reachability } from './Reachability';
|
|
28
26
|
export { AmplifyError, PlatformNotSupportedError, createAssertionFunction, } from './errors';
|
|
29
27
|
export { AmplifyErrorCode, } from './types';
|
|
30
|
-
export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './
|
|
28
|
+
export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './constants';
|
|
31
29
|
export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
|
|
32
30
|
export { AMPLIFY_SYMBOL } from './Hub';
|
|
31
|
+
export { base64Decoder, base64Encoder } from './utils/convert';
|
|
32
|
+
export { getCrypto } from './utils/globalHelpers';
|
|
@@ -2,4 +2,4 @@ import { PinpointUpdateEndpointInput } from '../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const updateEndpoint: ({ address, appId, category, channelType, credentials, identityId, optOut, region, userId, userProfile, userAgentValue, }: PinpointUpdateEndpointInput) => Promise<void>;
|
|
5
|
+
export declare const updateEndpoint: ({ address, appId, category, channelType, credentials, identityId, optOut, region, userAttributes, userId, userProfile, userAgentValue, }: PinpointUpdateEndpointInput) => Promise<void>;
|
|
@@ -55,18 +55,20 @@ import { cacheEndpointId, getEndpointId } from '../utils';
|
|
|
55
55
|
* @internal
|
|
56
56
|
*/
|
|
57
57
|
export var updateEndpoint = function (_a) {
|
|
58
|
-
var address = _a.address, appId = _a.appId, category = _a.category, channelType = _a.channelType, credentials = _a.credentials, identityId = _a.identityId, optOut = _a.optOut, region = _a.region, userId = _a.userId, userProfile = _a.userProfile, userAgentValue = _a.userAgentValue;
|
|
58
|
+
var address = _a.address, appId = _a.appId, category = _a.category, channelType = _a.channelType, credentials = _a.credentials, identityId = _a.identityId, optOut = _a.optOut, region = _a.region, userAttributes = _a.userAttributes, userId = _a.userId, userProfile = _a.userProfile, userAgentValue = _a.userAgentValue;
|
|
59
59
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
60
|
-
var endpointId, createdEndpointId, _b,
|
|
60
|
+
var endpointId, createdEndpointId, _b, customProperties, demographic, email, location, metrics, name, plan, clientInfo, mergedDemographic, shouldAddAttributes, attributes, input;
|
|
61
61
|
return __generator(this, function (_c) {
|
|
62
62
|
switch (_c.label) {
|
|
63
63
|
case 0: return [4 /*yield*/, getEndpointId(appId, category)];
|
|
64
64
|
case 1:
|
|
65
65
|
endpointId = _c.sent();
|
|
66
66
|
createdEndpointId = !endpointId ? uuidv4() : undefined;
|
|
67
|
-
_b = userProfile !== null && userProfile !== void 0 ? userProfile : {},
|
|
67
|
+
_b = userProfile !== null && userProfile !== void 0 ? userProfile : {}, customProperties = _b.customProperties, demographic = _b.demographic, email = _b.email, location = _b.location, metrics = _b.metrics, name = _b.name, plan = _b.plan;
|
|
68
68
|
clientInfo = ClientDevice.clientInfo();
|
|
69
69
|
mergedDemographic = __assign({ appVersion: clientInfo.appVersion, make: clientInfo.make, model: clientInfo.model, modelVersion: clientInfo.version, platform: clientInfo.platform }, demographic);
|
|
70
|
+
shouldAddAttributes = email || customProperties || name || plan;
|
|
71
|
+
attributes = __assign(__assign(__assign(__assign({}, (email && { email: [email] })), (name && { name: [name] })), (plan && { plan: [plan] })), customProperties);
|
|
70
72
|
input = {
|
|
71
73
|
ApplicationId: appId,
|
|
72
74
|
EndpointId: endpointId !== null && endpointId !== void 0 ? endpointId : createdEndpointId,
|
|
@@ -75,7 +77,7 @@ export var updateEndpoint = function (_a) {
|
|
|
75
77
|
EffectiveDate: new Date().toISOString(),
|
|
76
78
|
ChannelType: channelType,
|
|
77
79
|
Address: address,
|
|
78
|
-
Attributes: attributes,
|
|
80
|
+
Attributes: shouldAddAttributes ? attributes : undefined,
|
|
79
81
|
Demographic: {
|
|
80
82
|
AppVersion: mergedDemographic.appVersion,
|
|
81
83
|
Locale: mergedDemographic.locale,
|
|
@@ -98,7 +100,7 @@ export var updateEndpoint = function (_a) {
|
|
|
98
100
|
OptOut: optOut,
|
|
99
101
|
User: {
|
|
100
102
|
UserId: userId !== null && userId !== void 0 ? userId : identityId,
|
|
101
|
-
UserAttributes:
|
|
103
|
+
UserAttributes: userAttributes,
|
|
102
104
|
},
|
|
103
105
|
},
|
|
104
106
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { AuthConfigurationErrorCode, assert } from './errorHelpers';
|
|
4
|
+
import { base64Decoder } from '../../../utils/convert';
|
|
4
5
|
export function assertTokenProviderConfig(cognitoConfig) {
|
|
5
6
|
var assertionValid = true; // assume valid until otherwise proveed
|
|
6
7
|
if (!cognitoConfig) {
|
|
@@ -48,6 +49,6 @@ export function decodeJWT(token) {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
function base64ToBytes(base64) {
|
|
51
|
-
var binString =
|
|
52
|
+
var binString = base64Decoder.convert(base64);
|
|
52
53
|
return Uint8Array.from(binString, function (m) { return m.codePointAt(0) || 0; });
|
|
53
54
|
}
|