@aws-amplify/core 4.6.2-next.32 → 4.6.2-next.36

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 (145) hide show
  1. package/lib/Amplify.d.ts +28 -0
  2. package/lib/ClientDevice/android.d.ts +5 -0
  3. package/lib/ClientDevice/android.js +1 -1
  4. package/lib/ClientDevice/browser.d.ts +25 -0
  5. package/lib/ClientDevice/browser.js +1 -1
  6. package/lib/ClientDevice/index.d.ts +23 -0
  7. package/lib/ClientDevice/index.js +1 -1
  8. package/lib/ClientDevice/ios.d.ts +7 -0
  9. package/lib/ClientDevice/ios.js +1 -1
  10. package/lib/ClientDevice/reactnative.d.ts +7 -0
  11. package/lib/ClientDevice/reactnative.js +1 -1
  12. package/lib/Credentials.d.ts +47 -0
  13. package/lib/Errors.d.ts +2 -0
  14. package/lib/Errors.js +1 -1
  15. package/lib/Hub.d.ts +55 -0
  16. package/lib/Hub.js +1 -1
  17. package/lib/I18n/I18n.d.ts +59 -0
  18. package/lib/I18n/I18n.js +1 -1
  19. package/lib/I18n/index.d.ts +49 -0
  20. package/lib/I18n/index.js +1 -1
  21. package/lib/I18n/types.d.ts +3 -0
  22. package/lib/I18n/types.js +1 -1
  23. package/lib/JS.d.ts +32 -0
  24. package/lib/JS.js +1 -1
  25. package/lib/Logger/ConsoleLogger.d.ts +80 -0
  26. package/lib/Logger/ConsoleLogger.js +1 -1
  27. package/lib/Logger/index.d.ts +1 -0
  28. package/lib/Logger/index.js +4 -3
  29. package/lib/Logger/index.js.map +1 -1
  30. package/lib/Logger/logger-interface.d.ts +8 -0
  31. package/lib/Logger/logger-interface.js +1 -1
  32. package/lib/OAuthHelper/FacebookOAuth.d.ts +6 -0
  33. package/lib/OAuthHelper/FacebookOAuth.js +1 -1
  34. package/lib/OAuthHelper/GoogleOAuth.d.ts +6 -0
  35. package/lib/OAuthHelper/GoogleOAuth.js +1 -1
  36. package/lib/OAuthHelper/index.d.ts +4 -0
  37. package/lib/OAuthHelper/index.js +1 -1
  38. package/lib/Platform/index.d.ts +7 -0
  39. package/lib/Platform/index.js +1 -1
  40. package/lib/Platform/version.d.ts +1 -0
  41. package/lib/Providers/AWSCloudWatchProvider.d.ts +34 -0
  42. package/lib/Providers/AWSCloudWatchProvider.js +1 -1
  43. package/lib/Providers/index.d.ts +1 -0
  44. package/lib/Providers/index.js +2 -2
  45. package/lib/Providers/index.js.map +1 -1
  46. package/lib/RNComponents/index.d.ts +5 -0
  47. package/lib/RNComponents/index.js +1 -1
  48. package/lib/RNComponents/reactnative.d.ts +3 -0
  49. package/lib/RNComponents/reactnative.js +1 -1
  50. package/lib/ServiceWorker/ServiceWorker.d.ts +68 -0
  51. package/lib/ServiceWorker/index.d.ts +13 -0
  52. package/lib/Signer.d.ts +41 -0
  53. package/lib/Signer.js +1 -1
  54. package/lib/StorageHelper/index.d.ts +41 -0
  55. package/lib/StorageHelper/index.js +1 -1
  56. package/lib/StorageHelper/reactnative.d.ts +13 -0
  57. package/lib/StorageHelper/reactnative.js +1 -1
  58. package/lib/UniversalStorage/index.d.ts +23 -0
  59. package/lib/Util/BackgroundProcessManager.d.ts +204 -0
  60. package/lib/Util/Constants.d.ts +8 -0
  61. package/lib/Util/Constants.js +1 -1
  62. package/lib/Util/DateUtils.d.ts +7 -0
  63. package/lib/Util/Mutex.d.ts +45 -0
  64. package/lib/Util/Reachability.d.ts +13 -0
  65. package/lib/Util/Reachability.native.d.ts +11 -0
  66. package/lib/Util/Retry.d.ts +21 -0
  67. package/lib/Util/StringUtils.d.ts +2 -0
  68. package/lib/Util/index.d.ts +7 -0
  69. package/lib/Util/index.js +23 -6
  70. package/lib/Util/index.js.map +1 -1
  71. package/lib/constants.d.ts +6 -0
  72. package/lib/constants.js +1 -1
  73. package/lib/index.d.ts +29 -0
  74. package/lib/index.js +50 -10
  75. package/lib/index.js.map +1 -1
  76. package/lib/parseAWSExports.d.ts +2 -0
  77. package/lib/types/index.d.ts +1 -0
  78. package/lib/types/types.d.ts +46 -0
  79. package/lib-esm/ClientDevice/android.js +1 -1
  80. package/lib-esm/ClientDevice/browser.js +1 -1
  81. package/lib-esm/ClientDevice/index.js +1 -1
  82. package/lib-esm/ClientDevice/ios.js +1 -1
  83. package/lib-esm/ClientDevice/reactnative.js +1 -1
  84. package/lib-esm/Errors.js +1 -1
  85. package/lib-esm/Hub.js +1 -1
  86. package/lib-esm/I18n/I18n.js +1 -1
  87. package/lib-esm/I18n/index.js +1 -1
  88. package/lib-esm/I18n/types.js +1 -1
  89. package/lib-esm/JS.js +1 -1
  90. package/lib-esm/Logger/ConsoleLogger.js +1 -1
  91. package/lib-esm/Logger/index.d.ts +1 -1
  92. package/lib-esm/Logger/index.js +2 -2
  93. package/lib-esm/Logger/index.js.map +1 -1
  94. package/lib-esm/Logger/logger-interface.js +1 -1
  95. package/lib-esm/OAuthHelper/FacebookOAuth.js +1 -1
  96. package/lib-esm/OAuthHelper/GoogleOAuth.js +1 -1
  97. package/lib-esm/OAuthHelper/index.js +1 -1
  98. package/lib-esm/Platform/index.js +1 -1
  99. package/lib-esm/Providers/AWSCloudWatchProvider.js +1 -1
  100. package/lib-esm/Providers/index.d.ts +1 -1
  101. package/lib-esm/Providers/index.js +1 -1
  102. package/lib-esm/Providers/index.js.map +1 -1
  103. package/lib-esm/RNComponents/index.js +1 -1
  104. package/lib-esm/RNComponents/reactnative.js +1 -1
  105. package/lib-esm/Signer.js +1 -1
  106. package/lib-esm/StorageHelper/index.js +1 -1
  107. package/lib-esm/StorageHelper/reactnative.js +1 -1
  108. package/lib-esm/Util/Constants.js +1 -1
  109. package/lib-esm/Util/index.d.ts +5 -5
  110. package/lib-esm/Util/index.js +5 -5
  111. package/lib-esm/Util/index.js.map +1 -1
  112. package/lib-esm/constants.js +1 -1
  113. package/lib-esm/index.d.ts +7 -8
  114. package/lib-esm/index.js +8 -9
  115. package/lib-esm/index.js.map +1 -1
  116. package/package.json +4 -3
  117. package/src/ClientDevice/android.ts +1 -1
  118. package/src/ClientDevice/browser.ts +1 -1
  119. package/src/ClientDevice/index.ts +1 -1
  120. package/src/ClientDevice/ios.ts +1 -1
  121. package/src/ClientDevice/reactnative.ts +1 -1
  122. package/src/Errors.ts +1 -1
  123. package/src/Hub.ts +1 -1
  124. package/src/I18n/I18n.ts +1 -1
  125. package/src/I18n/index.ts +1 -1
  126. package/src/I18n/types.ts +1 -1
  127. package/src/JS.ts +1 -1
  128. package/src/Logger/ConsoleLogger.ts +1 -1
  129. package/src/Logger/index.ts +2 -2
  130. package/src/Logger/logger-interface.ts +1 -1
  131. package/src/OAuthHelper/FacebookOAuth.ts +1 -1
  132. package/src/OAuthHelper/GoogleOAuth.ts +1 -1
  133. package/src/OAuthHelper/index.ts +1 -1
  134. package/src/Platform/index.ts +1 -1
  135. package/src/Providers/AWSCloudWatchProvider.ts +1 -1
  136. package/src/Providers/index.ts +1 -1
  137. package/src/RNComponents/index.ts +1 -1
  138. package/src/RNComponents/reactnative.ts +1 -1
  139. package/src/Signer.ts +1 -1
  140. package/src/StorageHelper/index.ts +1 -1
  141. package/src/StorageHelper/reactnative.ts +1 -1
  142. package/src/Util/Constants.ts +1 -1
  143. package/src/Util/index.ts +23 -5
  144. package/src/constants.ts +1 -1
  145. package/src/index.ts +46 -9
@@ -0,0 +1,28 @@
1
+ import { ConsoleLogger as LoggerClass } from './Logger';
2
+ export declare class AmplifyClass {
3
+ private _components;
4
+ private _config;
5
+ private _modules;
6
+ Auth: any;
7
+ Analytics: any;
8
+ API: any;
9
+ Credentials: any;
10
+ Storage: any;
11
+ I18n: any;
12
+ Cache: any;
13
+ PubSub: any;
14
+ Interactions: any;
15
+ Pushnotification: any;
16
+ UI: any;
17
+ XR: any;
18
+ Predictions: any;
19
+ DataStore: any;
20
+ Geo: any;
21
+ Notifications: any;
22
+ Logger: typeof LoggerClass;
23
+ ServiceWorker: any;
24
+ register(comp: any): void;
25
+ configure(config?: any): {};
26
+ addPluggable(pluggable: any): void;
27
+ }
28
+ export declare const Amplify: AmplifyClass;
@@ -0,0 +1,5 @@
1
+ export declare const clientInfo: () => {
2
+ platform: string;
3
+ version: string;
4
+ appVersion: string;
5
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -0,0 +1,25 @@
1
+ export declare function clientInfo(): {
2
+ platform?: undefined;
3
+ make?: undefined;
4
+ model?: undefined;
5
+ version?: undefined;
6
+ appVersion?: undefined;
7
+ language?: undefined;
8
+ timezone?: undefined;
9
+ } | {
10
+ platform: string;
11
+ make: string;
12
+ model: string;
13
+ version: string;
14
+ appVersion: string;
15
+ language: string;
16
+ timezone: string;
17
+ };
18
+ export declare function dimension(): {
19
+ width: number;
20
+ height: number;
21
+ };
22
+ export declare function browserType(userAgent: string): {
23
+ type: string;
24
+ version: string;
25
+ };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
7
7
  * the License. A copy of the License is located at
@@ -0,0 +1,23 @@
1
+ export declare class ClientDevice {
2
+ static clientInfo(): {
3
+ platform?: undefined;
4
+ make?: undefined;
5
+ model?: undefined;
6
+ version?: undefined;
7
+ appVersion?: undefined;
8
+ language?: undefined;
9
+ timezone?: undefined;
10
+ } | {
11
+ platform: string;
12
+ make: string;
13
+ model: string;
14
+ version: string;
15
+ appVersion: string;
16
+ language: string;
17
+ timezone: string;
18
+ };
19
+ static dimension(): {
20
+ width: number;
21
+ height: number;
22
+ };
23
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -0,0 +1,7 @@
1
+ export declare const clientInfo: () => {
2
+ platform: string;
3
+ version: string;
4
+ appVersion: string;
5
+ make: string;
6
+ model: string;
7
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -0,0 +1,7 @@
1
+ export declare class ClientDevice {
2
+ static clientInfo(): {
3
+ platform: string;
4
+ version: string;
5
+ appVersion: string;
6
+ };
7
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -0,0 +1,47 @@
1
+ import { ICredentials } from './types';
2
+ export declare class CredentialsClass {
3
+ private _config;
4
+ private _credentials;
5
+ private _credentials_source;
6
+ private _gettingCredPromise;
7
+ private _refreshHandlers;
8
+ private _storage;
9
+ private _storageSync;
10
+ private _identityId;
11
+ private _nextCredentialsRefresh;
12
+ Auth: any;
13
+ constructor(config: any);
14
+ getModuleName(): string;
15
+ getCredSource(): any;
16
+ configure(config: any): any;
17
+ get(): any;
18
+ private _getCognitoIdentityIdStorageKey;
19
+ private _pickupCredentials;
20
+ private _keepAlive;
21
+ refreshFederatedToken(federatedInfo: any): Promise<ICredentials>;
22
+ private _providerRefreshWithRetry;
23
+ private _isExpired;
24
+ private _isPastTTL;
25
+ private _setCredentialsForGuest;
26
+ private _setCredentialsFromFederation;
27
+ private _setCredentialsFromSession;
28
+ private _loadCredentials;
29
+ set(params: any, source: any): Promise<ICredentials>;
30
+ clear(): Promise<void>;
31
+ private _getGuestIdentityId;
32
+ private _setGuestIdentityId;
33
+ private _removeGuestIdentityId;
34
+ /**
35
+ * Compact version of credentials
36
+ * @param {Object} credentials
37
+ * @return {Object} - Credentials
38
+ */
39
+ shear(credentials: any): {
40
+ accessKeyId: any;
41
+ sessionToken: any;
42
+ secretAccessKey: any;
43
+ identityId: any;
44
+ authenticated: any;
45
+ };
46
+ }
47
+ export declare const Credentials: CredentialsClass;
@@ -0,0 +1,2 @@
1
+ export declare function missingConfig(name: string): Error;
2
+ export declare function invalidParameter(name: string): Error;
package/lib/Errors.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
package/lib/Hub.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ export declare type HubCapsule = {
2
+ channel: string;
3
+ payload: HubPayload;
4
+ source: string;
5
+ patternInfo?: string[];
6
+ };
7
+ export declare type HubPayload = {
8
+ event: string;
9
+ data?: any;
10
+ message?: string;
11
+ };
12
+ export declare type HubCallback = (capsule: HubCapsule) => void;
13
+ export declare type LegacyCallback = {
14
+ onHubCapsule: HubCallback;
15
+ };
16
+ export declare class HubClass {
17
+ name: string;
18
+ private listeners;
19
+ private patterns;
20
+ protectedChannels: string[];
21
+ constructor(name: string);
22
+ /**
23
+ * Used internally to remove a Hub listener.
24
+ *
25
+ * @remarks
26
+ * This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.
27
+ */
28
+ private _remove;
29
+ /**
30
+ * @deprecated Instead of calling Hub.remove, call the result of Hub.listen.
31
+ */
32
+ remove(channel: string | RegExp, listener: HubCallback): void;
33
+ /**
34
+ * Used to send a Hub event.
35
+ *
36
+ * @param channel - The channel on which the event will be broadcast
37
+ * @param payload - The HubPayload
38
+ * @param source - The source of the event; defaults to ''
39
+ * @param ampSymbol - Symbol used to determine if the event is dispatched internally on a protected channel
40
+ *
41
+ */
42
+ dispatch(channel: string, payload: HubPayload, source?: string, ampSymbol?: Symbol): void;
43
+ /**
44
+ * Used to listen for Hub events.
45
+ *
46
+ * @param channel - The channel on which to listen
47
+ * @param callback - The callback to execute when an event is received on the specified channel
48
+ * @param listenerName - The name of the listener; defaults to 'noname'
49
+ * @returns A function which can be called to cancel the listener.
50
+ *
51
+ */
52
+ listen(channel: string | RegExp, callback?: HubCallback | LegacyCallback, listenerName?: string): () => void;
53
+ private _toListeners;
54
+ }
55
+ export declare const Hub: HubClass;
package/lib/Hub.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -0,0 +1,59 @@
1
+ import { I18nOptions } from './types';
2
+ /**
3
+ * Language transition class
4
+ */
5
+ export declare class I18n {
6
+ /**
7
+ * @private
8
+ */
9
+ _options: I18nOptions;
10
+ /**
11
+ * @private
12
+ */
13
+ _lang: any;
14
+ /**
15
+ * @private
16
+ */
17
+ _dict: {};
18
+ /**
19
+ * @constructor
20
+ * Initialize with configurations
21
+ * @param {Object} options
22
+ */
23
+ constructor(options: I18nOptions);
24
+ /**
25
+ * @method
26
+ * Explicitly setting language
27
+ * @param {String} lang
28
+ */
29
+ setLanguage(lang: string): void;
30
+ /**
31
+ * @method
32
+ * Get value
33
+ * @param {String} key
34
+ * @param {String} defVal - Default value
35
+ */
36
+ get(key: any, defVal?: any): any;
37
+ /**
38
+ * @method
39
+ * Get value according to specified language
40
+ * @param {String} key
41
+ * @param {String} language - Specified langurage to be used
42
+ * @param {String} defVal - Default value
43
+ */
44
+ getByLanguage(key: any, language: any, defVal?: any): any;
45
+ /**
46
+ * @method
47
+ * Add vocabularies for one language
48
+ * @param {String} language - Language of the dictionary
49
+ * @param {Object} vocabularies - Object that has key-value as dictionary entry
50
+ */
51
+ putVocabulariesForLanguage(language: any, vocabularies: any): void;
52
+ /**
53
+ * @method
54
+ * Add vocabularies for one language
55
+ * @param {Object} vocabularies - Object that has language as key,
56
+ * vocabularies of each language as value
57
+ */
58
+ putVocabularies(vocabularies: any): void;
59
+ }
package/lib/I18n/I18n.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Export I18n APIs
3
+ */
4
+ export declare class I18n {
5
+ /**
6
+ * @static
7
+ * @method
8
+ * Configure I18n part
9
+ * @param {Object} config - Configuration of the I18n
10
+ */
11
+ static configure(config: any): any;
12
+ static getModuleName(): string;
13
+ /**
14
+ * @static
15
+ * @method
16
+ * Create an instance of I18n for the library
17
+ */
18
+ static createInstance(): void;
19
+ /**
20
+ * @static @method
21
+ * Explicitly setting language
22
+ * @param {String} lang
23
+ */
24
+ static setLanguage(lang: any): any;
25
+ /**
26
+ * @static @method
27
+ * Get value
28
+ * @param {String} key
29
+ * @param {String} defVal - Default value
30
+ */
31
+ static get(key: any, defVal?: any): any;
32
+ /**
33
+ * @static
34
+ * @method
35
+ * Add vocabularies for one language
36
+ * @param {String} langurage - Language of the dictionary
37
+ * @param {Object} vocabularies - Object that has key-value as dictionary entry
38
+ */
39
+ static putVocabulariesForLanguage(language: any, vocabularies: any): any;
40
+ /**
41
+ * @static
42
+ * @method
43
+ * Add vocabularies for one language
44
+ * @param {Object} vocabularies - Object that has language as key,
45
+ * vocabularies of each language as value
46
+ */
47
+ static putVocabularies(vocabularies: any): any;
48
+ static checkConfig(): boolean;
49
+ }
package/lib/I18n/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -0,0 +1,3 @@
1
+ export declare class I18nOptions {
2
+ language: any;
3
+ }
package/lib/I18n/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
package/lib/JS.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ export declare const isEmpty: (obj?: {}) => boolean;
2
+ export declare const sortByField: (list: any, field: any, dir: any) => boolean;
3
+ export declare const objectLessAttributes: (obj: any, less: any) => any;
4
+ export declare const filenameToContentType: (filename: any, defVal?: string) => string;
5
+ export declare const isTextFile: (contentType: any) => 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 browserOrNode: () => {
10
+ isBrowser: boolean;
11
+ isNode: boolean;
12
+ };
13
+ /**
14
+ * transfer the first letter of the keys to lowercase
15
+ * @param {Object} obj - the object need to be transferred
16
+ * @param {Array} whiteListForItself - whitelist itself from being transferred
17
+ * @param {Array} whiteListForChildren - whitelist its children keys from being transferred
18
+ */
19
+ export declare const transferKeyToLowerCase: (obj: any, whiteListForItself?: any[], whiteListForChildren?: any[]) => any;
20
+ /**
21
+ * transfer the first letter of the keys to lowercase
22
+ * @param {Object} obj - the object need to be transferred
23
+ * @param {Array} whiteListForItself - whitelist itself from being transferred
24
+ * @param {Array} whiteListForChildren - whitelist its children keys from being transferred
25
+ */
26
+ export declare const transferKeyToUpperCase: (obj: any, whiteListForItself?: any[], whiteListForChildren?: any[]) => any;
27
+ /**
28
+ * Return true if the object is a strict object
29
+ * which means it's not Array, Function, Number, String, Boolean or Null
30
+ * @param obj the Object
31
+ */
32
+ export declare const isStrictObject: (obj: any) => boolean;
package/lib/JS.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -0,0 +1,80 @@
1
+ import { LoggingProvider } from '../types';
2
+ import { Logger } from './logger-interface';
3
+ export declare enum LOG_TYPE {
4
+ DEBUG = "DEBUG",
5
+ ERROR = "ERROR",
6
+ INFO = "INFO",
7
+ WARN = "WARN",
8
+ VERBOSE = "VERBOSE"
9
+ }
10
+ /**
11
+ * Write logs
12
+ * @class Logger
13
+ */
14
+ export declare class ConsoleLogger implements Logger {
15
+ name: string;
16
+ level: LOG_TYPE | string;
17
+ private _pluggables;
18
+ private _config;
19
+ /**
20
+ * @constructor
21
+ * @param {string} name - Name of the logger
22
+ */
23
+ constructor(name: string, level?: LOG_TYPE | string);
24
+ static LOG_LEVEL: any;
25
+ _padding(n: any): string;
26
+ _ts(): string;
27
+ configure(config?: object): object;
28
+ /**
29
+ * Write log
30
+ * @method
31
+ * @memeberof Logger
32
+ * @param {LOG_TYPE|string} type - log type, default INFO
33
+ * @param {string|object} msg - Logging message or object
34
+ */
35
+ _log(type: LOG_TYPE | string, ...msg: any[]): void;
36
+ /**
37
+ * Write General log. Default to INFO
38
+ * @method
39
+ * @memeberof Logger
40
+ * @param {string|object} msg - Logging message or object
41
+ */
42
+ log(...msg: any[]): void;
43
+ /**
44
+ * Write INFO log
45
+ * @method
46
+ * @memeberof Logger
47
+ * @param {string|object} msg - Logging message or object
48
+ */
49
+ info(...msg: any[]): void;
50
+ /**
51
+ * Write WARN log
52
+ * @method
53
+ * @memeberof Logger
54
+ * @param {string|object} msg - Logging message or object
55
+ */
56
+ warn(...msg: any[]): void;
57
+ /**
58
+ * Write ERROR log
59
+ * @method
60
+ * @memeberof Logger
61
+ * @param {string|object} msg - Logging message or object
62
+ */
63
+ error(...msg: any[]): void;
64
+ /**
65
+ * Write DEBUG log
66
+ * @method
67
+ * @memeberof Logger
68
+ * @param {string|object} msg - Logging message or object
69
+ */
70
+ debug(...msg: any[]): void;
71
+ /**
72
+ * Write VERBOSE log
73
+ * @method
74
+ * @memeberof Logger
75
+ * @param {string|object} msg - Logging message or object
76
+ */
77
+ verbose(...msg: any[]): void;
78
+ addPluggable(pluggable: LoggingProvider): void;
79
+ listPluggables(): LoggingProvider[];
80
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -0,0 +1 @@
1
+ export { ConsoleLogger, LOG_TYPE } from './ConsoleLogger';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -12,6 +12,7 @@
12
12
  * and limitations under the License.
13
13
  */
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- var tslib_1 = require("tslib");
16
- tslib_1.__exportStar(require("./ConsoleLogger"), exports);
15
+ var ConsoleLogger_1 = require("./ConsoleLogger");
16
+ exports.ConsoleLogger = ConsoleLogger_1.ConsoleLogger;
17
+ exports.LOG_TYPE = ConsoleLogger_1.LOG_TYPE;
17
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Logger/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,0DAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Logger/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAEH,iDAA0D;AAAjD,wCAAA,aAAa,CAAA;AAAE,mCAAA,QAAQ,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { LoggingProvider } from '../types';
2
+ export interface Logger {
3
+ debug(msg: string): void;
4
+ info(msg: string): void;
5
+ warn(msg: string): void;
6
+ error(msg: string): void;
7
+ addPluggable(pluggable: LoggingProvider): void;
8
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
6
  * the License. A copy of the License is located at
@@ -0,0 +1,6 @@
1
+ export declare class FacebookOAuth {
2
+ initialized: boolean;
3
+ constructor();
4
+ refreshFacebookToken(): Promise<unknown>;
5
+ private _refreshFacebookTokenImpl;
6
+ }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
4
  /*
5
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
8
8
  * the License. A copy of the License is located at
@@ -0,0 +1,6 @@
1
+ export declare class GoogleOAuth {
2
+ initialized: boolean;
3
+ constructor();
4
+ refreshGoogleToken(): Promise<unknown>;
5
+ private _refreshGoogleTokenImpl;
6
+ }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
4
  /*
5
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
8
8
  * the License. A copy of the License is located at
@@ -0,0 +1,4 @@
1
+ import { GoogleOAuth as GoogleOAuthClass } from './GoogleOAuth';
2
+ import { FacebookOAuth as FacebookOAuthClass } from './FacebookOAuth';
3
+ export declare const GoogleOAuth: GoogleOAuthClass;
4
+ export declare const FacebookOAuth: FacebookOAuthClass;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
7
7
  * the License. A copy of the License is located at
@@ -0,0 +1,7 @@
1
+ export declare const Platform: {
2
+ userAgent: string;
3
+ product: string;
4
+ navigator: any;
5
+ isReactNative: boolean;
6
+ };
7
+ export declare const getAmplifyUserAgent: (content?: string) => string;