@aws-amplify/core 4.7.9-unstable.3 → 4.7.9

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/aws-amplify-core.js +673 -45
  3. package/dist/aws-amplify-core.js.map +1 -1
  4. package/dist/aws-amplify-core.min.js +4 -4
  5. package/dist/aws-amplify-core.min.js.map +1 -1
  6. package/lib/Credentials.js +1 -1
  7. package/lib/Credentials.js.map +1 -1
  8. package/lib/Util/BackgroundProcessManager.js +444 -0
  9. package/lib/Util/BackgroundProcessManager.js.map +1 -0
  10. package/lib/Util/Retry.js +76 -34
  11. package/lib/Util/Retry.js.map +1 -1
  12. package/lib/Util/index.js +1 -0
  13. package/lib/Util/index.js.map +1 -1
  14. package/lib-esm/Credentials.d.ts +1 -1
  15. package/lib-esm/Credentials.js +1 -1
  16. package/lib-esm/Credentials.js.map +1 -1
  17. package/lib-esm/Util/BackgroundProcessManager.d.ts +204 -0
  18. package/lib-esm/Util/BackgroundProcessManager.js +442 -0
  19. package/lib-esm/Util/BackgroundProcessManager.js.map +1 -0
  20. package/lib-esm/Util/Retry.d.ts +2 -2
  21. package/lib-esm/Util/Retry.js +76 -34
  22. package/lib-esm/Util/Retry.js.map +1 -1
  23. package/lib-esm/Util/index.d.ts +1 -0
  24. package/lib-esm/Util/index.js +1 -0
  25. package/lib-esm/Util/index.js.map +1 -1
  26. package/package.json +2 -2
  27. package/src/Credentials.ts +13 -14
  28. package/src/Util/BackgroundProcessManager.ts +449 -0
  29. package/src/Util/Retry.ts +66 -31
  30. package/src/Util/index.ts +1 -0
  31. package/lib/Amplify.d.ts +0 -31
  32. package/lib/ClientDevice/android.d.ts +0 -5
  33. package/lib/ClientDevice/browser.d.ts +0 -25
  34. package/lib/ClientDevice/index.d.ts +0 -27
  35. package/lib/ClientDevice/ios.d.ts +0 -7
  36. package/lib/ClientDevice/reactnative.d.ts +0 -14
  37. package/lib/Credentials.d.ts +0 -51
  38. package/lib/Errors.d.ts +0 -2
  39. package/lib/Hub.d.ts +0 -31
  40. package/lib/I18n/I18n.d.ts +0 -59
  41. package/lib/I18n/index.d.ts +0 -53
  42. package/lib/I18n/types.d.ts +0 -3
  43. package/lib/JS.d.ts +0 -56
  44. package/lib/Logger/ConsoleLogger.d.ts +0 -80
  45. package/lib/Logger/index.d.ts +0 -1
  46. package/lib/Logger/logger-interface.d.ts +0 -12
  47. package/lib/OAuthHelper/FacebookOAuth.d.ts +0 -10
  48. package/lib/OAuthHelper/GoogleOAuth.d.ts +0 -10
  49. package/lib/OAuthHelper/index.d.ts +0 -4
  50. package/lib/Parser.d.ts +0 -12
  51. package/lib/Platform/index.d.ts +0 -11
  52. package/lib/Platform/version.d.ts +0 -1
  53. package/lib/Providers/AWSCloudWatchProvider.d.ts +0 -34
  54. package/lib/Providers/index.d.ts +0 -1
  55. package/lib/RNComponents/index.d.ts +0 -5
  56. package/lib/RNComponents/reactnative.d.ts +0 -3
  57. package/lib/ServiceWorker/ServiceWorker.d.ts +0 -72
  58. package/lib/ServiceWorker/index.d.ts +0 -13
  59. package/lib/Signer.d.ts +0 -45
  60. package/lib/StorageHelper/index.d.ts +0 -45
  61. package/lib/StorageHelper/reactnative.d.ts +0 -17
  62. package/lib/UniversalStorage/index.d.ts +0 -23
  63. package/lib/Util/Constants.d.ts +0 -8
  64. package/lib/Util/DateUtils.d.ts +0 -7
  65. package/lib/Util/Mutex.d.ts +0 -45
  66. package/lib/Util/Reachability.d.ts +0 -13
  67. package/lib/Util/Reachability.native.d.ts +0 -11
  68. package/lib/Util/Retry.d.ts +0 -20
  69. package/lib/Util/StringUtils.d.ts +0 -2
  70. package/lib/Util/index.d.ts +0 -6
  71. package/lib/constants.d.ts +0 -6
  72. package/lib/index.d.ts +0 -30
  73. package/lib/types/index.d.ts +0 -1
  74. package/lib/types/types.d.ts +0 -43
@@ -1,45 +0,0 @@
1
- /** @class */
2
- export declare class MemoryStorage {
3
- /**
4
- * This is used to set a specific item in storage
5
- * @param {string} key - the key for the item
6
- * @param {object} value - the value
7
- * @returns {string} value that was set
8
- */
9
- static setItem(key: string, value: any): any;
10
- /**
11
- * This is used to get a specific key from storage
12
- * @param {string} key - the key for the item
13
- * This is used to clear the storage
14
- * @returns {string} the data item
15
- */
16
- static getItem(key: string): any;
17
- /**
18
- * This is used to remove an item from storage
19
- * @param {string} key - the key being set
20
- * @returns {string} value - value that was deleted
21
- */
22
- static removeItem(key: string): boolean;
23
- /**
24
- * This is used to clear the storage
25
- * @returns {string} nothing
26
- */
27
- static clear(): {};
28
- }
29
- export declare class StorageHelper {
30
- private storageWindow;
31
- /**
32
- * This is used to get a storage object
33
- * @returns {object} the storage
34
- */
35
- constructor();
36
- /**
37
- * This is used to return the storage
38
- * @returns {object} the storage
39
- */
40
- getStorage(): any;
41
- }
42
- /**
43
- * @deprecated use named import
44
- */
45
- export default StorageHelper;
@@ -1,17 +0,0 @@
1
- export declare class StorageHelper {
2
- private storageWindow;
3
- /**
4
- * This is used to get a storage object
5
- * @returns {object} the storage
6
- */
7
- constructor();
8
- /**
9
- * This is used to return the storage
10
- * @returns {object} the storage
11
- */
12
- getStorage(): any;
13
- }
14
- /**
15
- * @deprecated use named import
16
- */
17
- export default StorageHelper;
@@ -1,23 +0,0 @@
1
- import Cookies from 'universal-cookie';
2
- declare type Store = Record<string, string>;
3
- declare type Context = {
4
- req?: any;
5
- };
6
- export declare class UniversalStorage implements Storage {
7
- cookies: Cookies;
8
- store: Store;
9
- constructor(context?: Context);
10
- get length(): number;
11
- clear(): void;
12
- getItem(key: keyof Store): string;
13
- protected getLocalItem(key: keyof Store): string;
14
- protected getUniversalItem(key: keyof Store): any;
15
- key(index: number): string;
16
- removeItem(key: string): void;
17
- protected removeLocalItem(key: keyof Store): void;
18
- protected removeUniversalItem(key: keyof Store): void;
19
- setItem(key: keyof Store, value: string): void;
20
- protected setLocalItem(key: keyof Store, value: string): void;
21
- protected setUniversalItem(key: keyof Store, value: string): void;
22
- }
23
- export {};
@@ -1,8 +0,0 @@
1
- declare const AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;
2
- declare const AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE = 1048576;
3
- declare const AWS_CLOUDWATCH_MAX_EVENT_SIZE = 256000;
4
- declare const AWS_CLOUDWATCH_CATEGORY = "Logging";
5
- declare const AWS_CLOUDWATCH_PROVIDER_NAME = "AWSCloudWatch";
6
- declare const NO_CREDS_ERROR_STRING = "No credentials";
7
- declare const RETRY_ERROR_CODES: string[];
8
- export { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, };
@@ -1,7 +0,0 @@
1
- /**
2
- * Date & time utility functions to abstract the `aws-sdk` away from users.
3
- * (v2 => v3 modularization is a breaking change)
4
- *
5
- * @see https://github.com/aws/aws-sdk-js/blob/6edf586dcc1de7fe8fbfbbd9a0d2b1847921e6e1/lib/util.js#L262
6
- */
7
- export declare const DateUtils: any;
@@ -1,45 +0,0 @@
1
- /*!
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2016 Christian Speckner <cnspeckn@googlemail.com>
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
23
- */
24
- interface MutexInterface {
25
- acquire(): Promise<MutexInterface.Releaser>;
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 {
38
- isLocked(): boolean;
39
- acquire(): Promise<MutexInterface.Releaser>;
40
- runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
41
- private _dispatchNext;
42
- private _queue;
43
- private _pending;
44
- }
45
- export default Mutex;
@@ -1,13 +0,0 @@
1
- import Observable from 'zen-observable-ts';
2
- declare 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 {};
@@ -1,11 +0,0 @@
1
- import Observable from 'zen-observable-ts';
2
- declare type NetworkStatus = {
3
- online: boolean;
4
- };
5
- export default class ReachabilityNavigator implements Reachability {
6
- networkMonitor(netInfo?: any): Observable<NetworkStatus>;
7
- }
8
- interface Reachability {
9
- networkMonitor(netInfo?: any): Observable<NetworkStatus>;
10
- }
11
- export {};
@@ -1,20 +0,0 @@
1
- import { DelayFunction } from '../types';
2
- export declare class NonRetryableError extends Error {
3
- readonly nonRetryable = true;
4
- constructor(message: string);
5
- }
6
- /**
7
- * @private
8
- * Internal use of Amplify only
9
- */
10
- export declare function retry(functionToRetry: Function, args: any[], delayFn: DelayFunction, attempt?: number): any;
11
- /**
12
- * @private
13
- * Internal use of Amplify only
14
- */
15
- export declare function jitteredBackoff(maxDelayMs?: number): DelayFunction;
16
- /**
17
- * @private
18
- * Internal use of Amplify only
19
- */
20
- export declare const jitteredExponentialRetry: (functionToRetry: Function, args: any[], maxDelayMs?: number) => any;
@@ -1,2 +0,0 @@
1
- export declare function urlSafeEncode(str: string): string;
2
- export declare function urlSafeDecode(hex: string): string;
@@ -1,6 +0,0 @@
1
- export * from './Retry';
2
- export { default as Mutex } from './Mutex';
3
- export { default as Reachability } from './Reachability';
4
- export * from './DateUtils';
5
- export * from './StringUtils';
6
- export * from './Constants';
@@ -1,6 +0,0 @@
1
- /**
2
- * @deprecated Unused, all usecases have migrated to INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER
3
- */
4
- export declare const INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER: string | symbol;
5
- export declare const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER: string | symbol;
6
- export declare const USER_AGENT_HEADER = "x-amz-user-agent";
package/lib/index.d.ts DELETED
@@ -1,30 +0,0 @@
1
- import { Amplify } from './Amplify';
2
- export { AmplifyClass } from './Amplify';
3
- export { ClientDevice } from './ClientDevice';
4
- export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
5
- export * from './Errors';
6
- export { Hub, HubCapsule, HubCallback, HubPayload } from './Hub';
7
- export { I18n } from './I18n';
8
- export * from './JS';
9
- export { Signer } from './Signer';
10
- export * from './Parser';
11
- export * from './Providers';
12
- export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
13
- export * from './RNComponents';
14
- export { Credentials, CredentialsClass } from './Credentials';
15
- export { ServiceWorker } from './ServiceWorker';
16
- export { ICredentials } from './types';
17
- export { StorageHelper, MemoryStorage } from './StorageHelper';
18
- export { UniversalStorage } from './UniversalStorage';
19
- export { Platform, getAmplifyUserAgent } from './Platform';
20
- export * from './constants';
21
- export declare const Constants: {
22
- userAgent: string;
23
- };
24
- export * from './constants';
25
- export * from './Util';
26
- export { Amplify };
27
- /**
28
- * @deprecated use named import
29
- */
30
- export default Amplify;
@@ -1 +0,0 @@
1
- export * from './types';
@@ -1,43 +0,0 @@
1
- import { InputLogEvent, LogGroup } from '@aws-sdk/client-cloudwatch-logs';
2
- import { Credentials } from '@aws-sdk/types';
3
- export interface AmplifyConfig {
4
- Analytics?: object;
5
- Auth?: object;
6
- API?: object;
7
- Logging?: object;
8
- Storage?: object;
9
- Cache?: object;
10
- Geo?: object;
11
- ssr?: boolean;
12
- }
13
- export interface ICredentials {
14
- accessKeyId: string;
15
- sessionToken: string;
16
- secretAccessKey: string;
17
- identityId: string;
18
- authenticated: boolean;
19
- expiration?: Date;
20
- }
21
- /**
22
- * @private
23
- * Internal use of Amplify only
24
- */
25
- export declare type DelayFunction = (attempt: number, args?: any[], error?: Error) => number | false;
26
- export interface LoggingProvider {
27
- getProviderName(): string;
28
- getCategoryName(): string;
29
- configure(config?: object): object;
30
- pushLogs(logs: InputLogEvent[]): void;
31
- }
32
- export interface AWSCloudWatchProviderOptions {
33
- logGroupName?: string;
34
- logStreamName?: string;
35
- region?: string;
36
- credentials?: Credentials;
37
- endpoint?: string;
38
- }
39
- export interface CloudWatchDataTracker {
40
- eventUploadInProgress: boolean;
41
- logEvents: InputLogEvent[];
42
- verifiedLogGroup?: LogGroup;
43
- }