@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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { MAX_DELAY_MS } from './constants';
|
|
5
|
+
import { jitteredBackoff } from './jitteredBackoff';
|
|
6
|
+
import { retry } from './retry';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
* Internal use of Amplify only
|
|
11
|
+
*/
|
|
12
|
+
export const jitteredExponentialRetry = <T>(
|
|
13
|
+
functionToRetry: (...args: any[]) => T,
|
|
14
|
+
args: any[],
|
|
15
|
+
maxDelayMs: number = MAX_DELAY_MS,
|
|
16
|
+
onTerminate?: Promise<void>
|
|
17
|
+
): Promise<T> =>
|
|
18
|
+
retry(functionToRetry, args, jitteredBackoff(maxDelayMs), onTerminate);
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { DelayFunction } from '../types';
|
|
4
|
-
import { ConsoleLogger as Logger } from '../Logger/ConsoleLogger';
|
|
5
|
-
const logger = new Logger('Util');
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
super(message);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
4
|
+
import { DelayFunction } from '../../types';
|
|
5
|
+
import { ConsoleLogger as Logger } from '../../Logger/ConsoleLogger';
|
|
6
|
+
import { isNonRetryableError } from './isNonRetryableError';
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
const key: keyof NonRetryableError = 'nonRetryable';
|
|
16
|
-
return obj && obj[key];
|
|
17
|
-
};
|
|
8
|
+
const logger = new Logger('Util');
|
|
18
9
|
|
|
19
10
|
/**
|
|
20
11
|
* @private
|
|
@@ -61,7 +52,6 @@ export async function retry<T>(
|
|
|
61
52
|
try {
|
|
62
53
|
return resolve(await functionToRetry(...args));
|
|
63
54
|
} catch (err) {
|
|
64
|
-
|
|
65
55
|
lastError = err;
|
|
66
56
|
logger.debug(`error on ${functionToRetry.name}`, err);
|
|
67
57
|
|
|
@@ -90,33 +80,3 @@ export async function retry<T>(
|
|
|
90
80
|
reject(lastError);
|
|
91
81
|
});
|
|
92
82
|
}
|
|
93
|
-
|
|
94
|
-
const MAX_DELAY_MS = 5 * 60 * 1000;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* @private
|
|
98
|
-
* Internal use of Amplify only
|
|
99
|
-
*/
|
|
100
|
-
export function jitteredBackoff(
|
|
101
|
-
maxDelayMs: number = MAX_DELAY_MS
|
|
102
|
-
): DelayFunction {
|
|
103
|
-
const BASE_TIME_MS = 100;
|
|
104
|
-
const JITTER_FACTOR = 100;
|
|
105
|
-
|
|
106
|
-
return attempt => {
|
|
107
|
-
const delay = 2 ** attempt * BASE_TIME_MS + JITTER_FACTOR * Math.random();
|
|
108
|
-
return delay > maxDelayMs ? false : delay;
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* @private
|
|
114
|
-
* Internal use of Amplify only
|
|
115
|
-
*/
|
|
116
|
-
export const jitteredExponentialRetry = <T>(
|
|
117
|
-
functionToRetry: (...args: any[]) => T,
|
|
118
|
-
args: any[],
|
|
119
|
-
maxDelayMs: number = MAX_DELAY_MS,
|
|
120
|
-
onTerminate?: Promise<void>
|
|
121
|
-
): Promise<T> =>
|
|
122
|
-
retry(functionToRetry, args, jitteredBackoff(maxDelayMs), onTerminate);
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
export function urlSafeEncode(str: string) {
|
|
4
|
-
return str
|
|
5
|
-
.split('')
|
|
6
|
-
.map(char => char.charCodeAt(0).toString(16).padStart(2, '0'))
|
|
7
|
-
.join('');
|
|
8
|
-
}
|
|
9
3
|
|
|
10
4
|
export function urlSafeDecode(hex: string) {
|
|
11
5
|
const matchArr = hex.match(/.{2}/g) || [];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export function urlSafeEncode(str: string) {
|
|
5
|
+
return str
|
|
6
|
+
.split('')
|
|
7
|
+
.map(char => char.charCodeAt(0).toString(16).padStart(2, '0'))
|
|
8
|
+
.join('');
|
|
9
|
+
}
|
package/lib/Util/JS.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare const isEmpty: (obj?: {}) => boolean;
|
|
2
|
-
export declare const sortByField: (list: any[], field: string | number, dir: string) => boolean;
|
|
3
|
-
export declare const objectLessAttributes: (obj: Record<string, any>, less: string | string[]) => Record<string, any>;
|
|
4
|
-
export declare const filenameToContentType: (filename: string, defVal?: string) => string;
|
|
5
|
-
export declare const isTextFile: (contentType: string) => boolean;
|
|
6
|
-
export declare const generateRandomString: () => string;
|
|
7
|
-
export declare const makeQuerablePromise: (promise: any) => any;
|
|
8
|
-
export declare const isWebWorker: () => boolean;
|
|
9
|
-
export declare const isBrowser: () => boolean;
|
|
10
|
-
/**
|
|
11
|
-
* transfer the first letter of the keys to lowercase
|
|
12
|
-
* @param {Object} obj - the object need to be transferred
|
|
13
|
-
* @param {Array} whiteListForItself - whitelist itself from being transferred
|
|
14
|
-
* @param {Array} whiteListForChildren - whitelist its children keys from being transferred
|
|
15
|
-
*/
|
|
16
|
-
export declare const transferKeyToLowerCase: (obj: Record<string, any>, whiteListForItself?: string[], whiteListForChildren?: string[]) => Record<string, any>;
|
|
17
|
-
/**
|
|
18
|
-
* transfer the first letter of the keys to lowercase
|
|
19
|
-
* @param {Object} obj - the object need to be transferred
|
|
20
|
-
* @param {Array} whiteListForItself - whitelist itself from being transferred
|
|
21
|
-
* @param {Array} whiteListForChildren - whitelist its children keys from being transferred
|
|
22
|
-
*/
|
|
23
|
-
export declare const transferKeyToUpperCase: (obj: Record<string, any>, whiteListForItself?: string[], whiteListForChildren?: string[]) => Record<string, any>;
|
|
24
|
-
/**
|
|
25
|
-
* Return true if the object is a strict object
|
|
26
|
-
* which means it's not Array, Function, Number, String, Boolean or Null
|
|
27
|
-
* @param obj the Object
|
|
28
|
-
*/
|
|
29
|
-
export declare const isStrictObject: (obj: any) => boolean;
|
package/lib/Util/JS.js
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
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.isStrictObject = exports.transferKeyToUpperCase = exports.transferKeyToLowerCase = exports.isBrowser = exports.isWebWorker = exports.makeQuerablePromise = exports.generateRandomString = exports.isTextFile = exports.filenameToContentType = exports.objectLessAttributes = exports.sortByField = exports.isEmpty = void 0;
|
|
6
|
-
var MIME_MAP = [
|
|
7
|
-
{ type: 'text/plain', ext: 'txt' },
|
|
8
|
-
{ type: 'text/html', ext: 'html' },
|
|
9
|
-
{ type: 'text/javascript', ext: 'js' },
|
|
10
|
-
{ type: 'text/css', ext: 'css' },
|
|
11
|
-
{ type: 'text/csv', ext: 'csv' },
|
|
12
|
-
{ type: 'text/yaml', ext: 'yml' },
|
|
13
|
-
{ type: 'text/yaml', ext: 'yaml' },
|
|
14
|
-
{ type: 'text/calendar', ext: 'ics' },
|
|
15
|
-
{ type: 'text/calendar', ext: 'ical' },
|
|
16
|
-
{ type: 'image/apng', ext: 'apng' },
|
|
17
|
-
{ type: 'image/bmp', ext: 'bmp' },
|
|
18
|
-
{ type: 'image/gif', ext: 'gif' },
|
|
19
|
-
{ type: 'image/x-icon', ext: 'ico' },
|
|
20
|
-
{ type: 'image/x-icon', ext: 'cur' },
|
|
21
|
-
{ type: 'image/jpeg', ext: 'jpg' },
|
|
22
|
-
{ type: 'image/jpeg', ext: 'jpeg' },
|
|
23
|
-
{ type: 'image/jpeg', ext: 'jfif' },
|
|
24
|
-
{ type: 'image/jpeg', ext: 'pjp' },
|
|
25
|
-
{ type: 'image/jpeg', ext: 'pjpeg' },
|
|
26
|
-
{ type: 'image/png', ext: 'png' },
|
|
27
|
-
{ type: 'image/svg+xml', ext: 'svg' },
|
|
28
|
-
{ type: 'image/tiff', ext: 'tif' },
|
|
29
|
-
{ type: 'image/tiff', ext: 'tiff' },
|
|
30
|
-
{ type: 'image/webp', ext: 'webp' },
|
|
31
|
-
{ type: 'application/json', ext: 'json' },
|
|
32
|
-
{ type: 'application/xml', ext: 'xml' },
|
|
33
|
-
{ type: 'application/x-sh', ext: 'sh' },
|
|
34
|
-
{ type: 'application/zip', ext: 'zip' },
|
|
35
|
-
{ type: 'application/x-rar-compressed', ext: 'rar' },
|
|
36
|
-
{ type: 'application/x-tar', ext: 'tar' },
|
|
37
|
-
{ type: 'application/x-bzip', ext: 'bz' },
|
|
38
|
-
{ type: 'application/x-bzip2', ext: 'bz2' },
|
|
39
|
-
{ type: 'application/pdf', ext: 'pdf' },
|
|
40
|
-
{ type: 'application/java-archive', ext: 'jar' },
|
|
41
|
-
{ type: 'application/msword', ext: 'doc' },
|
|
42
|
-
{ type: 'application/vnd.ms-excel', ext: 'xls' },
|
|
43
|
-
{ type: 'application/vnd.ms-excel', ext: 'xlsx' },
|
|
44
|
-
{ type: 'message/rfc822', ext: 'eml' },
|
|
45
|
-
];
|
|
46
|
-
var isEmpty = function (obj) {
|
|
47
|
-
if (obj === void 0) { obj = {}; }
|
|
48
|
-
return Object.keys(obj).length === 0;
|
|
49
|
-
};
|
|
50
|
-
exports.isEmpty = isEmpty;
|
|
51
|
-
var sortByField = function (list, field, dir) {
|
|
52
|
-
if (!list || !list.sort) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
var dirX = dir && dir === 'desc' ? -1 : 1;
|
|
56
|
-
list.sort(function (a, b) {
|
|
57
|
-
var a_val = a[field];
|
|
58
|
-
var b_val = b[field];
|
|
59
|
-
if (typeof b_val === 'undefined') {
|
|
60
|
-
return typeof a_val === 'undefined' ? 0 : 1 * dirX;
|
|
61
|
-
}
|
|
62
|
-
if (typeof a_val === 'undefined') {
|
|
63
|
-
return -1 * dirX;
|
|
64
|
-
}
|
|
65
|
-
if (a_val < b_val) {
|
|
66
|
-
return -1 * dirX;
|
|
67
|
-
}
|
|
68
|
-
if (a_val > b_val) {
|
|
69
|
-
return 1 * dirX;
|
|
70
|
-
}
|
|
71
|
-
return 0;
|
|
72
|
-
});
|
|
73
|
-
return true;
|
|
74
|
-
};
|
|
75
|
-
exports.sortByField = sortByField;
|
|
76
|
-
var objectLessAttributes = function (obj, less) {
|
|
77
|
-
var ret = Object.assign({}, obj);
|
|
78
|
-
if (less) {
|
|
79
|
-
if (typeof less === 'string') {
|
|
80
|
-
delete ret[less];
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
less.forEach(function (attr) {
|
|
84
|
-
delete ret[attr];
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return ret;
|
|
89
|
-
};
|
|
90
|
-
exports.objectLessAttributes = objectLessAttributes;
|
|
91
|
-
var filenameToContentType = function (filename, defVal) {
|
|
92
|
-
if (defVal === void 0) { defVal = 'application/octet-stream'; }
|
|
93
|
-
var name = filename.toLowerCase();
|
|
94
|
-
var filtered = MIME_MAP.filter(function (mime) { return name.endsWith('.' + mime.ext); });
|
|
95
|
-
return filtered.length > 0 ? filtered[0].type : defVal;
|
|
96
|
-
};
|
|
97
|
-
exports.filenameToContentType = filenameToContentType;
|
|
98
|
-
var isTextFile = function (contentType) {
|
|
99
|
-
var type = contentType.toLowerCase();
|
|
100
|
-
if (type.startsWith('text/')) {
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
return ('application/json' === type ||
|
|
104
|
-
'application/xml' === type ||
|
|
105
|
-
'application/sh' === type);
|
|
106
|
-
};
|
|
107
|
-
exports.isTextFile = isTextFile;
|
|
108
|
-
var generateRandomString = function () {
|
|
109
|
-
var result = '';
|
|
110
|
-
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
111
|
-
for (var i = 32; i > 0; i -= 1) {
|
|
112
|
-
result += chars[Math.floor(Math.random() * chars.length)];
|
|
113
|
-
}
|
|
114
|
-
return result;
|
|
115
|
-
};
|
|
116
|
-
exports.generateRandomString = generateRandomString;
|
|
117
|
-
var makeQuerablePromise = function (promise) {
|
|
118
|
-
if (promise.isResolved)
|
|
119
|
-
return promise;
|
|
120
|
-
var isPending = true;
|
|
121
|
-
var isRejected = false;
|
|
122
|
-
var isFullfilled = false;
|
|
123
|
-
var result = promise.then(function (data) {
|
|
124
|
-
isFullfilled = true;
|
|
125
|
-
isPending = false;
|
|
126
|
-
return data;
|
|
127
|
-
}, function (e) {
|
|
128
|
-
isRejected = true;
|
|
129
|
-
isPending = false;
|
|
130
|
-
throw e;
|
|
131
|
-
});
|
|
132
|
-
result.isFullfilled = function () { return isFullfilled; };
|
|
133
|
-
result.isPending = function () { return isPending; };
|
|
134
|
-
result.isRejected = function () { return isRejected; };
|
|
135
|
-
return result;
|
|
136
|
-
};
|
|
137
|
-
exports.makeQuerablePromise = makeQuerablePromise;
|
|
138
|
-
var isWebWorker = function () {
|
|
139
|
-
if (typeof self === 'undefined') {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
var selfContext = self;
|
|
143
|
-
return (typeof selfContext.WorkerGlobalScope !== 'undefined' &&
|
|
144
|
-
self instanceof selfContext.WorkerGlobalScope);
|
|
145
|
-
};
|
|
146
|
-
exports.isWebWorker = isWebWorker;
|
|
147
|
-
var isBrowser = function () {
|
|
148
|
-
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
149
|
-
};
|
|
150
|
-
exports.isBrowser = isBrowser;
|
|
151
|
-
/**
|
|
152
|
-
* transfer the first letter of the keys to lowercase
|
|
153
|
-
* @param {Object} obj - the object need to be transferred
|
|
154
|
-
* @param {Array} whiteListForItself - whitelist itself from being transferred
|
|
155
|
-
* @param {Array} whiteListForChildren - whitelist its children keys from being transferred
|
|
156
|
-
*/
|
|
157
|
-
var transferKeyToLowerCase = function (obj, whiteListForItself, whiteListForChildren) {
|
|
158
|
-
if (whiteListForItself === void 0) { whiteListForItself = []; }
|
|
159
|
-
if (whiteListForChildren === void 0) { whiteListForChildren = []; }
|
|
160
|
-
if (!(0, exports.isStrictObject)(obj))
|
|
161
|
-
return obj;
|
|
162
|
-
var ret = {};
|
|
163
|
-
for (var key in obj) {
|
|
164
|
-
if (obj.hasOwnProperty(key)) {
|
|
165
|
-
var transferedKey = whiteListForItself.includes(key)
|
|
166
|
-
? key
|
|
167
|
-
: key[0].toLowerCase() + key.slice(1);
|
|
168
|
-
ret[transferedKey] = whiteListForChildren.includes(key)
|
|
169
|
-
? obj[key]
|
|
170
|
-
: (0, exports.transferKeyToLowerCase)(obj[key], whiteListForItself, whiteListForChildren);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return ret;
|
|
174
|
-
};
|
|
175
|
-
exports.transferKeyToLowerCase = transferKeyToLowerCase;
|
|
176
|
-
/**
|
|
177
|
-
* transfer the first letter of the keys to lowercase
|
|
178
|
-
* @param {Object} obj - the object need to be transferred
|
|
179
|
-
* @param {Array} whiteListForItself - whitelist itself from being transferred
|
|
180
|
-
* @param {Array} whiteListForChildren - whitelist its children keys from being transferred
|
|
181
|
-
*/
|
|
182
|
-
var transferKeyToUpperCase = function (obj, whiteListForItself, whiteListForChildren) {
|
|
183
|
-
if (whiteListForItself === void 0) { whiteListForItself = []; }
|
|
184
|
-
if (whiteListForChildren === void 0) { whiteListForChildren = []; }
|
|
185
|
-
if (!(0, exports.isStrictObject)(obj))
|
|
186
|
-
return obj;
|
|
187
|
-
var ret = {};
|
|
188
|
-
for (var key in obj) {
|
|
189
|
-
if (obj.hasOwnProperty(key)) {
|
|
190
|
-
var transferredKey = whiteListForItself.includes(key)
|
|
191
|
-
? key
|
|
192
|
-
: key[0].toUpperCase() + key.slice(1);
|
|
193
|
-
ret[transferredKey] = whiteListForChildren.includes(key)
|
|
194
|
-
? obj[key]
|
|
195
|
-
: (0, exports.transferKeyToUpperCase)(obj[key], whiteListForItself, whiteListForChildren);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return ret;
|
|
199
|
-
};
|
|
200
|
-
exports.transferKeyToUpperCase = transferKeyToUpperCase;
|
|
201
|
-
/**
|
|
202
|
-
* Return true if the object is a strict object
|
|
203
|
-
* which means it's not Array, Function, Number, String, Boolean or Null
|
|
204
|
-
* @param obj the Object
|
|
205
|
-
*/
|
|
206
|
-
var isStrictObject = function (obj) {
|
|
207
|
-
return (obj instanceof Object &&
|
|
208
|
-
!(obj instanceof Array) &&
|
|
209
|
-
!(obj instanceof Function) &&
|
|
210
|
-
!(obj instanceof Number) &&
|
|
211
|
-
!(obj instanceof String) &&
|
|
212
|
-
!(obj instanceof Boolean));
|
|
213
|
-
};
|
|
214
|
-
exports.isStrictObject = isStrictObject;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Observable from 'zen-observable-ts';
|
|
2
|
-
type NetworkStatus = {
|
|
3
|
-
online: boolean;
|
|
4
|
-
};
|
|
5
|
-
export default class ReachabilityNavigator implements Reachability {
|
|
6
|
-
private static _observers;
|
|
7
|
-
networkMonitor(netInfo?: any): Observable<NetworkStatus>;
|
|
8
|
-
private static _observerOverride;
|
|
9
|
-
}
|
|
10
|
-
interface Reachability {
|
|
11
|
-
networkMonitor(netInfo?: any): Observable<NetworkStatus>;
|
|
12
|
-
}
|
|
13
|
-
export {};
|
package/lib/Util/Reachability.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __values = (this && this.__values) || function(o) {
|
|
3
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
-
if (m) return m.call(o);
|
|
5
|
-
if (o && typeof o.length === "number") return {
|
|
6
|
-
next: function () {
|
|
7
|
-
if (o && i >= o.length) o = void 0;
|
|
8
|
-
return { value: o && o[i++], done: !o };
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
18
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
19
|
-
var zen_observable_ts_1 = __importDefault(require("zen-observable-ts"));
|
|
20
|
-
var JS_1 = require("./JS");
|
|
21
|
-
var ReachabilityNavigator = /** @class */ (function () {
|
|
22
|
-
function ReachabilityNavigator() {
|
|
23
|
-
}
|
|
24
|
-
ReachabilityNavigator.prototype.networkMonitor = function (netInfo) {
|
|
25
|
-
var globalObj = (0, JS_1.isWebWorker)() ? self : window;
|
|
26
|
-
return new zen_observable_ts_1.default(function (observer) {
|
|
27
|
-
observer.next({ online: globalObj.navigator.onLine });
|
|
28
|
-
var notifyOnline = function () { return observer.next({ online: true }); };
|
|
29
|
-
var notifyOffline = function () { return observer.next({ online: false }); };
|
|
30
|
-
globalObj.addEventListener('online', notifyOnline);
|
|
31
|
-
globalObj.addEventListener('offline', notifyOffline);
|
|
32
|
-
ReachabilityNavigator._observers.push(observer);
|
|
33
|
-
return function () {
|
|
34
|
-
globalObj.removeEventListener('online', notifyOnline);
|
|
35
|
-
globalObj.removeEventListener('offline', notifyOffline);
|
|
36
|
-
ReachabilityNavigator._observers =
|
|
37
|
-
ReachabilityNavigator._observers.filter(function (_observer) { return _observer !== observer; });
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
// expose observers to simulate offline mode for integration testing
|
|
42
|
-
ReachabilityNavigator._observerOverride = function (status) {
|
|
43
|
-
var e_1, _a;
|
|
44
|
-
var _loop_1 = function (observer) {
|
|
45
|
-
if (observer.closed) {
|
|
46
|
-
ReachabilityNavigator._observers =
|
|
47
|
-
ReachabilityNavigator._observers.filter(function (_observer) { return _observer !== observer; });
|
|
48
|
-
return "continue";
|
|
49
|
-
}
|
|
50
|
-
observer.next(status);
|
|
51
|
-
};
|
|
52
|
-
try {
|
|
53
|
-
for (var _b = __values(ReachabilityNavigator._observers), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
54
|
-
var observer = _c.value;
|
|
55
|
-
_loop_1(observer);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
59
|
-
finally {
|
|
60
|
-
try {
|
|
61
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
62
|
-
}
|
|
63
|
-
finally { if (e_1) throw e_1.error; }
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
ReachabilityNavigator._observers = [];
|
|
67
|
-
return ReachabilityNavigator;
|
|
68
|
-
}());
|
|
69
|
-
exports.default = ReachabilityNavigator;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import Observable from 'zen-observable-ts';
|
|
2
|
-
import type NetInfo from '@react-native-community/netinfo';
|
|
3
|
-
type NetworkStatus = {
|
|
4
|
-
online: boolean;
|
|
5
|
-
};
|
|
6
|
-
export default class ReachabilityNavigator implements Reachability {
|
|
7
|
-
networkMonitor(netInfo?: typeof NetInfo): Observable<NetworkStatus>;
|
|
8
|
-
}
|
|
9
|
-
interface Reachability {
|
|
10
|
-
networkMonitor(netInfo?: typeof NetInfo): Observable<NetworkStatus>;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
package/lib/Util/Retry.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DelayFunction } from '../types';
|
|
2
|
-
export declare class NonRetryableError extends Error {
|
|
3
|
-
readonly nonRetryable = true;
|
|
4
|
-
constructor(message: string);
|
|
5
|
-
}
|
|
6
|
-
export declare const isNonRetryableError: (obj: any) => obj is NonRetryableError;
|
|
7
|
-
/**
|
|
8
|
-
* @private
|
|
9
|
-
* Internal use of Amplify only
|
|
10
|
-
*/
|
|
11
|
-
export declare function retry<T>(functionToRetry: (...args: any[]) => T, args: any[], delayFn: DelayFunction, onTerminate?: Promise<void>): Promise<T>;
|
|
12
|
-
/**
|
|
13
|
-
* @private
|
|
14
|
-
* Internal use of Amplify only
|
|
15
|
-
*/
|
|
16
|
-
export declare function jitteredBackoff(maxDelayMs?: number): DelayFunction;
|
|
17
|
-
/**
|
|
18
|
-
* @private
|
|
19
|
-
* Internal use of Amplify only
|
|
20
|
-
*/
|
|
21
|
-
export declare const jitteredExponentialRetry: <T>(functionToRetry: (...args: any[]) => T, args: any[], maxDelayMs?: number, onTerminate?: Promise<void>) => Promise<T>;
|
package/lib/Util/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { NonRetryableError, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, } from './Retry';
|
|
2
|
-
export { default as Mutex } from './Mutex';
|
|
3
|
-
export { default as Reachability } from './Reachability';
|
|
4
|
-
export { DateUtils } from './DateUtils';
|
|
5
|
-
export { urlSafeDecode, urlSafeEncode } from './StringUtils';
|
|
6
|
-
export { AWS_CLOUDWATCH_CATEGORY, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, } from './Constants';
|
|
7
|
-
export { BackgroundProcessManager, BackgroundManagerNotOpenError, BackgroundProcessManagerState, } from './BackgroundProcessManager';
|
package/lib/Util/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BackgroundProcessManagerState = exports.BackgroundManagerNotOpenError = exports.BackgroundProcessManager = exports.RETRY_ERROR_CODES = exports.NO_CREDS_ERROR_STRING = exports.AWS_CLOUDWATCH_CATEGORY = exports.urlSafeEncode = exports.urlSafeDecode = exports.DateUtils = exports.Reachability = exports.Mutex = exports.retry = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isNonRetryableError = exports.NonRetryableError = void 0;
|
|
7
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
-
var Retry_1 = require("./Retry");
|
|
10
|
-
Object.defineProperty(exports, "NonRetryableError", { enumerable: true, get: function () { return Retry_1.NonRetryableError; } });
|
|
11
|
-
Object.defineProperty(exports, "isNonRetryableError", { enumerable: true, get: function () { return Retry_1.isNonRetryableError; } });
|
|
12
|
-
Object.defineProperty(exports, "jitteredBackoff", { enumerable: true, get: function () { return Retry_1.jitteredBackoff; } });
|
|
13
|
-
Object.defineProperty(exports, "jitteredExponentialRetry", { enumerable: true, get: function () { return Retry_1.jitteredExponentialRetry; } });
|
|
14
|
-
Object.defineProperty(exports, "retry", { enumerable: true, get: function () { return Retry_1.retry; } });
|
|
15
|
-
var Mutex_1 = require("./Mutex");
|
|
16
|
-
Object.defineProperty(exports, "Mutex", { enumerable: true, get: function () { return __importDefault(Mutex_1).default; } });
|
|
17
|
-
var Reachability_1 = require("./Reachability");
|
|
18
|
-
Object.defineProperty(exports, "Reachability", { enumerable: true, get: function () { return __importDefault(Reachability_1).default; } });
|
|
19
|
-
var DateUtils_1 = require("./DateUtils");
|
|
20
|
-
Object.defineProperty(exports, "DateUtils", { enumerable: true, get: function () { return DateUtils_1.DateUtils; } });
|
|
21
|
-
var StringUtils_1 = require("./StringUtils");
|
|
22
|
-
Object.defineProperty(exports, "urlSafeDecode", { enumerable: true, get: function () { return StringUtils_1.urlSafeDecode; } });
|
|
23
|
-
Object.defineProperty(exports, "urlSafeEncode", { enumerable: true, get: function () { return StringUtils_1.urlSafeEncode; } });
|
|
24
|
-
var Constants_1 = require("./Constants");
|
|
25
|
-
Object.defineProperty(exports, "AWS_CLOUDWATCH_CATEGORY", { enumerable: true, get: function () { return Constants_1.AWS_CLOUDWATCH_CATEGORY; } });
|
|
26
|
-
Object.defineProperty(exports, "NO_CREDS_ERROR_STRING", { enumerable: true, get: function () { return Constants_1.NO_CREDS_ERROR_STRING; } });
|
|
27
|
-
Object.defineProperty(exports, "RETRY_ERROR_CODES", { enumerable: true, get: function () { return Constants_1.RETRY_ERROR_CODES; } });
|
|
28
|
-
var BackgroundProcessManager_1 = require("./BackgroundProcessManager");
|
|
29
|
-
Object.defineProperty(exports, "BackgroundProcessManager", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManager; } });
|
|
30
|
-
Object.defineProperty(exports, "BackgroundManagerNotOpenError", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundManagerNotOpenError; } });
|
|
31
|
-
Object.defineProperty(exports, "BackgroundProcessManagerState", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManagerState; } });
|
package/lib-esm/Util/JS.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare const isEmpty: (obj?: {}) => boolean;
|
|
2
|
-
export declare const sortByField: (list: any[], field: string | number, dir: string) => boolean;
|
|
3
|
-
export declare const objectLessAttributes: (obj: Record<string, any>, less: string | string[]) => Record<string, any>;
|
|
4
|
-
export declare const filenameToContentType: (filename: string, defVal?: string) => string;
|
|
5
|
-
export declare const isTextFile: (contentType: string) => boolean;
|
|
6
|
-
export declare const generateRandomString: () => string;
|
|
7
|
-
export declare const makeQuerablePromise: (promise: any) => any;
|
|
8
|
-
export declare const isWebWorker: () => boolean;
|
|
9
|
-
export declare const isBrowser: () => boolean;
|
|
10
|
-
/**
|
|
11
|
-
* transfer the first letter of the keys to lowercase
|
|
12
|
-
* @param {Object} obj - the object need to be transferred
|
|
13
|
-
* @param {Array} whiteListForItself - whitelist itself from being transferred
|
|
14
|
-
* @param {Array} whiteListForChildren - whitelist its children keys from being transferred
|
|
15
|
-
*/
|
|
16
|
-
export declare const transferKeyToLowerCase: (obj: Record<string, any>, whiteListForItself?: string[], whiteListForChildren?: string[]) => Record<string, any>;
|
|
17
|
-
/**
|
|
18
|
-
* transfer the first letter of the keys to lowercase
|
|
19
|
-
* @param {Object} obj - the object need to be transferred
|
|
20
|
-
* @param {Array} whiteListForItself - whitelist itself from being transferred
|
|
21
|
-
* @param {Array} whiteListForChildren - whitelist its children keys from being transferred
|
|
22
|
-
*/
|
|
23
|
-
export declare const transferKeyToUpperCase: (obj: Record<string, any>, whiteListForItself?: string[], whiteListForChildren?: string[]) => Record<string, any>;
|
|
24
|
-
/**
|
|
25
|
-
* Return true if the object is a strict object
|
|
26
|
-
* which means it's not Array, Function, Number, String, Boolean or Null
|
|
27
|
-
* @param obj the Object
|
|
28
|
-
*/
|
|
29
|
-
export declare const isStrictObject: (obj: any) => boolean;
|