@aws-amplify/core 4.7.13-unstable.2 → 4.7.13

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 (280) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/build.js +5 -0
  3. package/dist/aws-amplify-core.js +42702 -0
  4. package/dist/aws-amplify-core.js.map +1 -0
  5. package/dist/aws-amplify-core.min.js +32 -0
  6. package/dist/aws-amplify-core.min.js.map +1 -0
  7. package/index.js +7 -0
  8. package/lib/Amplify.js +21 -3
  9. package/lib/Amplify.js.map +1 -1
  10. package/lib/ClientDevice/android.js +12 -2
  11. package/lib/ClientDevice/android.js.map +1 -1
  12. package/lib/ClientDevice/browser.js +12 -2
  13. package/lib/ClientDevice/browser.js.map +1 -1
  14. package/lib/ClientDevice/index.js +16 -2
  15. package/lib/ClientDevice/index.js.map +1 -1
  16. package/lib/ClientDevice/ios.js +12 -2
  17. package/lib/ClientDevice/ios.js.map +1 -1
  18. package/lib/ClientDevice/reactnative.js +16 -2
  19. package/lib/ClientDevice/reactnative.js.map +1 -1
  20. package/lib/Credentials.js +90 -59
  21. package/lib/Credentials.js.map +1 -1
  22. package/lib/Errors.js +12 -2
  23. package/lib/Errors.js.map +1 -1
  24. package/lib/Hub.js +57 -41
  25. package/lib/Hub.js.map +1 -1
  26. package/lib/I18n/I18n.js +12 -2
  27. package/lib/I18n/I18n.js.map +1 -1
  28. package/lib/I18n/index.js +16 -2
  29. package/lib/I18n/index.js.map +1 -1
  30. package/lib/I18n/types.js +12 -2
  31. package/lib/I18n/types.js.map +1 -1
  32. package/lib/JS.js +39 -4
  33. package/lib/JS.js.map +1 -1
  34. package/lib/Logger/ConsoleLogger.js +50 -10
  35. package/lib/Logger/ConsoleLogger.js.map +1 -1
  36. package/lib/Logger/index.js +16 -5
  37. package/lib/Logger/index.js.map +1 -1
  38. package/lib/Logger/logger-interface.js +12 -2
  39. package/lib/Logger/logger-interface.js.map +1 -1
  40. package/lib/OAuthHelper/FacebookOAuth.js +54 -5
  41. package/lib/OAuthHelper/FacebookOAuth.js.map +1 -1
  42. package/lib/OAuthHelper/GoogleOAuth.js +54 -5
  43. package/lib/OAuthHelper/GoogleOAuth.js.map +1 -1
  44. package/lib/OAuthHelper/index.js +12 -2
  45. package/lib/OAuthHelper/index.js.map +1 -1
  46. package/lib/{parseAWSExports.js → Parser.js} +28 -4
  47. package/lib/Parser.js.map +1 -0
  48. package/lib/Platform/index.js +16 -2
  49. package/lib/Platform/index.js.map +1 -1
  50. package/lib/Platform/version.js +1 -1
  51. package/lib/Platform/version.js.map +1 -1
  52. package/lib/Providers/AWSCloudWatchProvider.js +97 -32
  53. package/lib/Providers/AWSCloudWatchProvider.js.map +1 -1
  54. package/lib/Providers/index.js +4 -2
  55. package/lib/Providers/index.js.map +1 -1
  56. package/lib/RNComponents/index.js +12 -2
  57. package/lib/RNComponents/index.js.map +1 -1
  58. package/lib/RNComponents/reactnative.js +16 -4
  59. package/lib/RNComponents/reactnative.js.map +1 -1
  60. package/lib/ServiceWorker/ServiceWorker.js +4 -0
  61. package/lib/ServiceWorker/ServiceWorker.js.map +1 -1
  62. package/lib/Signer.js +43 -8
  63. package/lib/Signer.js.map +1 -1
  64. package/lib/StorageHelper/index.js +16 -2
  65. package/lib/StorageHelper/index.js.map +1 -1
  66. package/lib/StorageHelper/reactnative.js +20 -4
  67. package/lib/StorageHelper/reactnative.js.map +1 -1
  68. package/lib/UniversalStorage/index.js +4 -2
  69. package/lib/UniversalStorage/index.js.map +1 -1
  70. package/lib/Util/BackgroundProcessManager.js +69 -10
  71. package/lib/Util/BackgroundProcessManager.js.map +1 -1
  72. package/lib/Util/CognitoIdentityClient.js +41 -0
  73. package/lib/Util/CognitoIdentityClient.js.map +1 -0
  74. package/lib/Util/Constants.js +12 -2
  75. package/lib/Util/Constants.js.map +1 -1
  76. package/lib/Util/DateUtils.js +17 -2
  77. package/lib/Util/DateUtils.js.map +1 -1
  78. package/lib/Util/Reachability.js +16 -3
  79. package/lib/Util/Reachability.js.map +1 -1
  80. package/lib/Util/Reachability.native.js +4 -2
  81. package/lib/Util/Reachability.native.js.map +1 -1
  82. package/lib/Util/Retry.js +78 -10
  83. package/lib/Util/Retry.js.map +1 -1
  84. package/lib/Util/index.js +8 -23
  85. package/lib/Util/index.js.map +1 -1
  86. package/lib/constants.js +12 -2
  87. package/lib/constants.js.map +1 -1
  88. package/lib/index.js +25 -54
  89. package/lib/index.js.map +1 -1
  90. package/lib-esm/Amplify.d.ts +4 -1
  91. package/lib-esm/Amplify.js +20 -2
  92. package/lib-esm/Amplify.js.map +1 -1
  93. package/lib-esm/ClientDevice/android.js +12 -2
  94. package/lib-esm/ClientDevice/android.js.map +1 -1
  95. package/lib-esm/ClientDevice/browser.js +12 -2
  96. package/lib-esm/ClientDevice/browser.js.map +1 -1
  97. package/lib-esm/ClientDevice/index.d.ts +4 -0
  98. package/lib-esm/ClientDevice/index.js +16 -2
  99. package/lib-esm/ClientDevice/index.js.map +1 -1
  100. package/lib-esm/ClientDevice/ios.js +12 -2
  101. package/lib-esm/ClientDevice/ios.js.map +1 -1
  102. package/lib-esm/ClientDevice/reactnative.d.ts +7 -0
  103. package/lib-esm/ClientDevice/reactnative.js +16 -2
  104. package/lib-esm/ClientDevice/reactnative.js.map +1 -1
  105. package/lib-esm/Credentials.d.ts +4 -0
  106. package/lib-esm/Credentials.js +63 -32
  107. package/lib-esm/Credentials.js.map +1 -1
  108. package/lib-esm/Errors.js +12 -2
  109. package/lib-esm/Errors.js.map +1 -1
  110. package/lib-esm/Hub.d.ts +4 -28
  111. package/lib-esm/Hub.js +52 -36
  112. package/lib-esm/Hub.js.map +1 -1
  113. package/lib-esm/I18n/I18n.js +12 -2
  114. package/lib-esm/I18n/I18n.js.map +1 -1
  115. package/lib-esm/I18n/index.d.ts +4 -0
  116. package/lib-esm/I18n/index.js +16 -2
  117. package/lib-esm/I18n/index.js.map +1 -1
  118. package/lib-esm/I18n/types.js +12 -2
  119. package/lib-esm/I18n/types.js.map +1 -1
  120. package/lib-esm/JS.d.ts +24 -0
  121. package/lib-esm/JS.js +39 -4
  122. package/lib-esm/JS.js.map +1 -1
  123. package/lib-esm/Logger/ConsoleLogger.js +43 -3
  124. package/lib-esm/Logger/ConsoleLogger.js.map +1 -1
  125. package/lib-esm/Logger/index.d.ts +1 -1
  126. package/lib-esm/Logger/index.js +13 -3
  127. package/lib-esm/Logger/index.js.map +1 -1
  128. package/lib-esm/Logger/logger-interface.d.ts +4 -0
  129. package/lib-esm/Logger/logger-interface.js +12 -2
  130. package/lib-esm/Logger/logger-interface.js.map +1 -1
  131. package/lib-esm/OAuthHelper/FacebookOAuth.d.ts +4 -0
  132. package/lib-esm/OAuthHelper/FacebookOAuth.js +52 -3
  133. package/lib-esm/OAuthHelper/FacebookOAuth.js.map +1 -1
  134. package/lib-esm/OAuthHelper/GoogleOAuth.d.ts +4 -0
  135. package/lib-esm/OAuthHelper/GoogleOAuth.js +52 -3
  136. package/lib-esm/OAuthHelper/GoogleOAuth.js.map +1 -1
  137. package/lib-esm/OAuthHelper/index.js +12 -2
  138. package/lib-esm/OAuthHelper/index.js.map +1 -1
  139. package/lib-esm/Parser.d.ts +12 -0
  140. package/lib-esm/{parseAWSExports.js → Parser.js} +27 -3
  141. package/lib-esm/Parser.js.map +1 -0
  142. package/lib-esm/Platform/index.d.ts +4 -0
  143. package/lib-esm/Platform/index.js +16 -2
  144. package/lib-esm/Platform/index.js.map +1 -1
  145. package/lib-esm/Platform/version.d.ts +1 -1
  146. package/lib-esm/Platform/version.js +1 -1
  147. package/lib-esm/Platform/version.js.map +1 -1
  148. package/lib-esm/Providers/AWSCloudWatchProvider.js +70 -5
  149. package/lib-esm/Providers/AWSCloudWatchProvider.js.map +1 -1
  150. package/lib-esm/Providers/index.d.ts +1 -1
  151. package/lib-esm/Providers/index.js +1 -1
  152. package/lib-esm/Providers/index.js.map +1 -1
  153. package/lib-esm/RNComponents/index.js +12 -2
  154. package/lib-esm/RNComponents/index.js.map +1 -1
  155. package/lib-esm/RNComponents/reactnative.js +12 -2
  156. package/lib-esm/RNComponents/reactnative.js.map +1 -1
  157. package/lib-esm/ServiceWorker/ServiceWorker.d.ts +4 -0
  158. package/lib-esm/ServiceWorker/ServiceWorker.js +4 -0
  159. package/lib-esm/ServiceWorker/ServiceWorker.js.map +1 -1
  160. package/lib-esm/Signer.d.ts +4 -0
  161. package/lib-esm/Signer.js +38 -3
  162. package/lib-esm/Signer.js.map +1 -1
  163. package/lib-esm/StorageHelper/index.d.ts +4 -0
  164. package/lib-esm/StorageHelper/index.js +16 -2
  165. package/lib-esm/StorageHelper/index.js.map +1 -1
  166. package/lib-esm/StorageHelper/reactnative.d.ts +4 -0
  167. package/lib-esm/StorageHelper/reactnative.js +16 -2
  168. package/lib-esm/StorageHelper/reactnative.js.map +1 -1
  169. package/lib-esm/Util/BackgroundProcessManager.js +60 -1
  170. package/lib-esm/Util/BackgroundProcessManager.js.map +1 -1
  171. package/lib-esm/Util/CognitoIdentityClient.d.ts +14 -0
  172. package/lib-esm/Util/CognitoIdentityClient.js +37 -0
  173. package/lib-esm/Util/CognitoIdentityClient.js.map +1 -0
  174. package/lib-esm/Util/Constants.js +12 -2
  175. package/lib-esm/Util/Constants.js.map +1 -1
  176. package/lib-esm/Util/DateUtils.js +16 -1
  177. package/lib-esm/Util/DateUtils.js.map +1 -1
  178. package/lib-esm/Util/Reachability.js +11 -1
  179. package/lib-esm/Util/Reachability.js.map +1 -1
  180. package/lib-esm/Util/Retry.d.ts +0 -1
  181. package/lib-esm/Util/Retry.js +70 -2
  182. package/lib-esm/Util/Retry.js.map +1 -1
  183. package/lib-esm/Util/index.d.ts +5 -5
  184. package/lib-esm/Util/index.js +5 -5
  185. package/lib-esm/Util/index.js.map +1 -1
  186. package/lib-esm/constants.js +12 -2
  187. package/lib-esm/constants.js.map +1 -1
  188. package/lib-esm/index.d.ts +9 -8
  189. package/lib-esm/index.js +21 -10
  190. package/lib-esm/index.js.map +1 -1
  191. package/lib-esm/types/types.d.ts +0 -3
  192. package/package.json +9 -13
  193. package/src/Amplify.ts +5 -1
  194. package/src/ClientDevice/android.ts +12 -2
  195. package/src/ClientDevice/browser.ts +12 -2
  196. package/src/ClientDevice/index.ts +17 -2
  197. package/src/ClientDevice/ios.ts +12 -2
  198. package/src/ClientDevice/reactnative.ts +17 -2
  199. package/src/Credentials.ts +10 -42
  200. package/src/Errors.ts +12 -2
  201. package/src/Hub.ts +23 -40
  202. package/src/I18n/I18n.ts +12 -2
  203. package/src/I18n/index.ts +17 -2
  204. package/src/I18n/types.ts +12 -2
  205. package/src/JS.ts +37 -6
  206. package/src/Logger/ConsoleLogger.ts +12 -2
  207. package/src/Logger/index.ts +13 -3
  208. package/src/Logger/logger-interface.ts +17 -2
  209. package/src/OAuthHelper/FacebookOAuth.ts +17 -2
  210. package/src/OAuthHelper/GoogleOAuth.ts +17 -2
  211. package/src/OAuthHelper/index.ts +12 -2
  212. package/src/{parseAWSExports.ts → Parser.ts} +13 -1
  213. package/src/Platform/index.ts +17 -2
  214. package/src/Platform/version.ts +1 -1
  215. package/src/Providers/AWSCloudWatchProvider.ts +14 -4
  216. package/src/Providers/index.ts +1 -1
  217. package/src/RNComponents/index.ts +12 -2
  218. package/src/RNComponents/reactnative.ts +12 -2
  219. package/src/ServiceWorker/ServiceWorker.ts +6 -1
  220. package/src/Signer.ts +17 -2
  221. package/src/StorageHelper/index.ts +17 -2
  222. package/src/StorageHelper/reactnative.ts +17 -2
  223. package/src/Util/CognitoIdentityClient.ts +48 -0
  224. package/src/Util/Constants.ts +12 -2
  225. package/src/Util/Retry.ts +1 -1
  226. package/src/Util/index.ts +5 -23
  227. package/src/constants.ts +12 -2
  228. package/src/index.ts +21 -48
  229. package/src/types/types.ts +0 -3
  230. package/webpack.config.dev.js +6 -0
  231. package/lib/.tsbuildinfo +0 -3
  232. package/lib/Amplify.d.ts +0 -28
  233. package/lib/ClientDevice/android.d.ts +0 -5
  234. package/lib/ClientDevice/browser.d.ts +0 -25
  235. package/lib/ClientDevice/index.d.ts +0 -23
  236. package/lib/ClientDevice/ios.d.ts +0 -7
  237. package/lib/ClientDevice/reactnative.d.ts +0 -7
  238. package/lib/Credentials.d.ts +0 -47
  239. package/lib/Errors.d.ts +0 -2
  240. package/lib/Hub.d.ts +0 -55
  241. package/lib/I18n/I18n.d.ts +0 -59
  242. package/lib/I18n/index.d.ts +0 -49
  243. package/lib/I18n/types.d.ts +0 -3
  244. package/lib/JS.d.ts +0 -32
  245. package/lib/Logger/ConsoleLogger.d.ts +0 -80
  246. package/lib/Logger/index.d.ts +0 -1
  247. package/lib/Logger/logger-interface.d.ts +0 -8
  248. package/lib/OAuthHelper/FacebookOAuth.d.ts +0 -6
  249. package/lib/OAuthHelper/GoogleOAuth.d.ts +0 -6
  250. package/lib/OAuthHelper/index.d.ts +0 -4
  251. package/lib/Platform/index.d.ts +0 -7
  252. package/lib/Platform/version.d.ts +0 -1
  253. package/lib/Providers/AWSCloudWatchProvider.d.ts +0 -34
  254. package/lib/Providers/index.d.ts +0 -1
  255. package/lib/RNComponents/index.d.ts +0 -5
  256. package/lib/RNComponents/reactnative.d.ts +0 -3
  257. package/lib/ServiceWorker/ServiceWorker.d.ts +0 -68
  258. package/lib/ServiceWorker/index.d.ts +0 -13
  259. package/lib/Signer.d.ts +0 -41
  260. package/lib/StorageHelper/index.d.ts +0 -41
  261. package/lib/StorageHelper/reactnative.d.ts +0 -13
  262. package/lib/UniversalStorage/index.d.ts +0 -23
  263. package/lib/Util/BackgroundProcessManager.d.ts +0 -204
  264. package/lib/Util/Constants.d.ts +0 -8
  265. package/lib/Util/DateUtils.d.ts +0 -7
  266. package/lib/Util/Mutex.d.ts +0 -45
  267. package/lib/Util/Reachability.d.ts +0 -13
  268. package/lib/Util/Reachability.native.d.ts +0 -11
  269. package/lib/Util/Retry.d.ts +0 -21
  270. package/lib/Util/StringUtils.d.ts +0 -2
  271. package/lib/Util/index.d.ts +0 -7
  272. package/lib/constants.d.ts +0 -6
  273. package/lib/index.d.ts +0 -29
  274. package/lib/parseAWSExports.d.ts +0 -2
  275. package/lib/parseAWSExports.js.map +0 -1
  276. package/lib/types/index.d.ts +0 -1
  277. package/lib/types/types.d.ts +0 -46
  278. package/lib-esm/.tsbuildinfo +0 -3
  279. package/lib-esm/parseAWSExports.d.ts +0 -2
  280. package/lib-esm/parseAWSExports.js.map +0 -1
package/lib/JS.d.ts DELETED
@@ -1,32 +0,0 @@
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;
@@ -1,80 +0,0 @@
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 +0,0 @@
1
- export { ConsoleLogger, LOG_TYPE } from './ConsoleLogger';
@@ -1,8 +0,0 @@
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 +0,0 @@
1
- export declare class FacebookOAuth {
2
- initialized: boolean;
3
- constructor();
4
- refreshFacebookToken(): Promise<unknown>;
5
- private _refreshFacebookTokenImpl;
6
- }
@@ -1,6 +0,0 @@
1
- export declare class GoogleOAuth {
2
- initialized: boolean;
3
- constructor();
4
- refreshGoogleToken(): Promise<unknown>;
5
- private _refreshGoogleTokenImpl;
6
- }
@@ -1,4 +0,0 @@
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 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export declare const version = "5.0.0";
@@ -1,34 +0,0 @@
1
- import { CreateLogGroupCommandInput, CreateLogGroupCommandOutput, CreateLogStreamCommandInput, CreateLogStreamCommandOutput, DescribeLogGroupsCommandInput, DescribeLogGroupsCommandOutput, DescribeLogStreamsCommandInput, DescribeLogStreamsCommandOutput, GetLogEventsCommandInput, GetLogEventsCommandOutput, InputLogEvent } from '@aws-sdk/client-cloudwatch-logs';
2
- import { AWSCloudWatchProviderOptions, LoggingProvider } from '../types/types';
3
- declare class AWSCloudWatchProvider implements LoggingProvider {
4
- static readonly PROVIDER_NAME = "AWSCloudWatch";
5
- static readonly CATEGORY = "Logging";
6
- private _config;
7
- private _dataTracker;
8
- private _currentLogBatch;
9
- private _timer;
10
- private _nextSequenceToken;
11
- constructor(config?: AWSCloudWatchProviderOptions);
12
- getProviderName(): string;
13
- getCategoryName(): string;
14
- getLogQueue(): InputLogEvent[];
15
- configure(config?: AWSCloudWatchProviderOptions): AWSCloudWatchProviderOptions;
16
- createLogGroup(params: CreateLogGroupCommandInput): Promise<CreateLogGroupCommandOutput>;
17
- getLogGroups(params: DescribeLogGroupsCommandInput): Promise<DescribeLogGroupsCommandOutput>;
18
- createLogStream(params: CreateLogStreamCommandInput): Promise<CreateLogStreamCommandOutput>;
19
- getLogStreams(params: DescribeLogStreamsCommandInput): Promise<DescribeLogStreamsCommandOutput>;
20
- getLogEvents(params: GetLogEventsCommandInput): Promise<GetLogEventsCommandOutput>;
21
- pushLogs(logs: InputLogEvent[]): void;
22
- private _validateLogGroupExistsAndCreate;
23
- private _validateLogStreamExists;
24
- private _sendLogEvents;
25
- private _initCloudWatchLogs;
26
- private _ensureCredentials;
27
- private _getNextSequenceToken;
28
- private _safeUploadLogEvents;
29
- private _getBufferedBatchOfLogs;
30
- private _getNewSequenceTokenAndSubmit;
31
- private _initiateLogPushInterval;
32
- private _getDocUploadPermissibility;
33
- }
34
- export { AWSCloudWatchProvider };
@@ -1 +0,0 @@
1
- export { AWSCloudWatchProvider } from './AWSCloudWatchProvider';
@@ -1,5 +0,0 @@
1
- export declare const Linking: {};
2
- export declare const AppState: {
3
- addEventListener: (action: any, handler: any) => any;
4
- };
5
- export declare const AsyncStorage: any;
@@ -1,3 +0,0 @@
1
- import { Linking, AppState } from 'react-native';
2
- import AsyncStorage from '@react-native-async-storage/async-storage';
3
- export { Linking, AppState, AsyncStorage };
@@ -1,68 +0,0 @@
1
- /**
2
- * Provides a means to registering a service worker in the browser
3
- * and communicating with it via postMessage events.
4
- * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/
5
- *
6
- * postMessage events are currently not supported in all browsers. See:
7
- * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
8
- *
9
- * At the minmum this class will register the service worker and listen
10
- * and attempt to dispatch messages on state change and record analytics
11
- * events based on the service worker lifecycle.
12
- */
13
- export declare class ServiceWorkerClass {
14
- private _serviceWorker;
15
- private _registration;
16
- private _publicKey;
17
- private _subscription;
18
- private _logger;
19
- constructor();
20
- /**
21
- * Get the currently active service worker
22
- */
23
- get serviceWorker(): ServiceWorker;
24
- /**
25
- * Register the service-worker.js file in the browser
26
- * Make sure the service-worker.js is part of the build
27
- * for example with Angular, modify the angular-cli.json file
28
- * and add to "assets" array "service-worker.js"
29
- * @param {string} - (optional) Service worker file. Defaults to "/service-worker.js"
30
- * @param {string} - (optional) The service worker scope. Defaults to "/"
31
- * - API Doc: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register
32
- * @returns {Promise}
33
- * - resolve(ServiceWorkerRegistration)
34
- * - reject(Error)
35
- **/
36
- register(filePath?: string, scope?: string): Promise<unknown>;
37
- /**
38
- * Enable web push notifications. If not subscribed, a new subscription will
39
- * be created and registered.
40
- * Test Push Server: https://web-push-codelab.glitch.me/
41
- * Push Server Libraries: https://github.com/web-push-libs/
42
- * API Doc: https://developers.google.com/web/fundamentals/codelabs/push-notifications/
43
- * @param publicKey
44
- * @returns {Promise}
45
- * - resolve(PushSubscription)
46
- * - reject(Error)
47
- */
48
- enablePush(publicKey: string): Promise<unknown>;
49
- /**
50
- * Convert a base64 encoded string to a Uint8 array for the push server key
51
- * @param base64String
52
- */
53
- private _urlB64ToUint8Array;
54
- /**
55
- * Send a message to the service worker. The service worker needs
56
- * to implement `self.addEventListener('message') to handle the
57
- * message. This ***currently*** does not work in Safari or IE.
58
- * @param {object | string} - An arbitrary JSON object or string message to send to the service worker
59
- * - see: https://developer.mozilla.org/en-US/docs/Web/API/Transferable
60
- * @returns {Promise}
61
- **/
62
- send(message: object | string): void;
63
- /**
64
- * Listen for service worker state change and message events
65
- * https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/state
66
- **/
67
- _setupListeners(): void;
68
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
13
- export { ServiceWorkerClass as ServiceWorker } from './ServiceWorker';
package/lib/Signer.d.ts DELETED
@@ -1,41 +0,0 @@
1
- export declare class Signer {
2
- /**
3
- * Sign a HTTP request, add 'Authorization' header to request param
4
- * @method sign
5
- * @memberof Signer
6
- * @static
7
- *
8
- * @param {object} request - HTTP request object
9
- <pre>
10
- request: {
11
- method: GET | POST | PUT ...
12
- url: ...,
13
- headers: {
14
- header1: ...
15
- },
16
- data: data
17
- }
18
- </pre>
19
- * @param {object} access_info - AWS access credential info
20
- <pre>
21
- access_info: {
22
- access_key: ...,
23
- secret_key: ...,
24
- session_token: ...
25
- }
26
- </pre>
27
- * @param {object} [service_info] - AWS service type and region, optional,
28
- * if not provided then parse out from url
29
- <pre>
30
- service_info: {
31
- service: ...,
32
- region: ...
33
- }
34
- </pre>
35
- *
36
- * @returns {object} Signed HTTP request
37
- */
38
- static sign(request: any, access_info: any, service_info?: any): any;
39
- static signUrl(urlToSign: string, accessInfo: any, serviceInfo?: any, expiration?: number): string;
40
- static signUrl(request: any, accessInfo: any, serviceInfo?: any, expiration?: number): string;
41
- }
@@ -1,41 +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
- }
@@ -1,13 +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
- }
@@ -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,204 +0,0 @@
1
- /**
2
- * @private For internal Amplify use.
3
- *
4
- * Creates a new scope for promises, observables, and other types of work or
5
- * processes that may be running in the background. This manager provides
6
- * an singular entrypoint to request termination and await completion.
7
- *
8
- * As work completes on its own prior to close, the manager removes them
9
- * from the registry to avoid holding references to completed jobs.
10
- */
11
- export declare class BackgroundProcessManager {
12
- /**
13
- * A string indicating whether the manager is accepting new work ("Open"),
14
- * waiting for work to complete ("Closing"), or fully done with all
15
- * submitted work and *not* accepting new jobs ("Closed").
16
- */
17
- private _state;
18
- private _closingPromise;
19
- /**
20
- * The list of outstanding jobs we'll need to wait for upon `close()`
21
- */
22
- private jobs;
23
- /**
24
- * Creates a new manager for promises, observables, and other types
25
- * of work that may be running in the background. This manager provides
26
- * a centralized mechanism to request termination and await completion.
27
- */
28
- constructor();
29
- /**
30
- * Executes an async `job` function, passing the return value through to
31
- * the caller, registering it as a running job in the manager. When the
32
- * manager *closes*, it will `await` the job.
33
- *
34
- * @param job The function to execute.
35
- * @param description Optional description to help identify pending jobs.
36
- * @returns The return value from the given function.
37
- */
38
- add<T>(job: () => Promise<T>, description?: string): Promise<T>;
39
- /**
40
- * Executes an async `job` function, passing the return value through to
41
- * the caller, registering it as a running job in the manager. When the
42
- * manager *closes*, it will request termination by resolving the
43
- * provided `onTerminate` promise. It will then `await` the job, so it is
44
- * important that the job still `resolve()` or `reject()` when responding
45
- * to a termination request.
46
- *
47
- * @param job The function to execute.
48
- * @param description Optional description to help identify pending jobs.
49
- * @returns The return value from the given function.
50
- */
51
- add<T>(job: (onTerminate: Promise<void>) => Promise<T>, description?: string): Promise<T>;
52
- /**
53
- * Create a no-op job, registers it with the manager, and returns hooks
54
- * to the caller to signal the job's completion and respond to termination
55
- * requests.
56
- *
57
- * When the manager closes, the no-op job will be `await`-ed, so its
58
- * important to always `resolve()` or `reject()` when done responding to an
59
- * `onTerminate` signal.
60
- * @param description Optional description to help identify pending jobs.
61
- * @returns Job promise hooks + onTerminate signaling promise
62
- */
63
- add(description?: string): {
64
- resolve: (value?: unknown) => void;
65
- reject: (reason?: any) => void;
66
- onTerminate: Promise<void>;
67
- };
68
- /**
69
- * Adds another job manager to await on at the time of closing. the inner
70
- * manager's termination is signaled when this manager's `close()` is
71
- * called for.
72
- *
73
- * @param job The inner job manager to await.
74
- * @param description Optional description to help identify pending jobs.
75
- */
76
- add(job: BackgroundProcessManager, description?: string): any;
77
- /**
78
- * Adds a **cleaner** function that doesn't immediately get executed.
79
- * Instead, the caller gets a **terminate** function back. The *cleaner* is
80
- * invoked only once the mananger *closes* or the returned **terminate**
81
- * function is called.
82
- *
83
- * @param clean The cleanup function.
84
- * @param description Optional description to help identify pending jobs.
85
- * @returns A terminate function.
86
- */
87
- addCleaner<T>(clean: () => Promise<T>, description?: string): () => Promise<void>;
88
- private addFunction;
89
- private addManager;
90
- /**
91
- * Creates and registers a fabricated job for processes that need to operate
92
- * with callbacks/hooks. The returned `resolve` and `reject`
93
- * functions can be used to signal the job is done successfully or not.
94
- * The returned `onTerminate` is a promise that will resolve when the
95
- * manager is requesting the termination of the job.
96
- *
97
- * @param description Optional description to help identify pending jobs.
98
- * @returns `{ resolve, reject, onTerminate }`
99
- */
100
- private addHook;
101
- /**
102
- * Adds a Promise based job to the list of jobs for monitoring and listens
103
- * for either a success or failure, upon which the job is considered "done"
104
- * and removed from the registry.
105
- *
106
- * @param promise A promise that is on its way to being returned to a
107
- * caller, which needs to be tracked as a background job.
108
- * @param terminate The termination function to register, which can be
109
- * invoked to request the job stop.
110
- * @param description Optional description to help identify pending jobs.
111
- */
112
- private registerPromise;
113
- /**
114
- * The number of jobs being waited on.
115
- *
116
- * We don't use this for anything. It's just informational for the caller,
117
- * and can be used in logging and testing.
118
- *
119
- * @returns the number of jobs.
120
- */
121
- get length(): number;
122
- /**
123
- * The execution state of the manager. One of:
124
- *
125
- * 1. "Open" -> Accepting new jobs
126
- * 1. "Closing" -> Not accepting new work. Waiting for jobs to complete.
127
- * 1. "Closed" -> Not accepting new work. All submitted jobs are complete.
128
- */
129
- get state(): BackgroundProcessManagerState;
130
- /**
131
- * The registered `description` of all still-pending jobs.
132
- *
133
- * @returns descriptions as an array.
134
- */
135
- get pending(): string[];
136
- /**
137
- * Whether the manager is accepting new jobs.
138
- */
139
- get isOpen(): boolean;
140
- /**
141
- * Whether the manager is rejecting new work, but still waiting for
142
- * submitted work to complete.
143
- */
144
- get isClosing(): boolean;
145
- /**
146
- * Whether the manager is rejecting work and done waiting for submitted
147
- * work to complete.
148
- */
149
- get isClosed(): boolean;
150
- private closedFailure;
151
- /**
152
- * Signals jobs to stop (for those that accept interruptions) and waits
153
- * for confirmation that jobs have stopped.
154
- *
155
- * This immediately puts the manager into a closing state and just begins
156
- * to reject new work. After all work in the manager is complete, the
157
- * manager goes into a `Completed` state and `close()` returns.
158
- *
159
- * This call is idempotent.
160
- *
161
- * If the manager is already closing or closed, `finalCleaup` is not executed.
162
- *
163
- * @param onClosed
164
- * @returns The settled results of each still-running job's promise. If the
165
- * manager is already closed, this will contain the results as of when the
166
- * manager's `close()` was called in an `Open` state.
167
- */
168
- close(): Promise<any>;
169
- /**
170
- * Signals the manager to start accepting work (again) and returns once
171
- * the manager is ready to do so.
172
- *
173
- * If the state is already `Open`, this call is a no-op.
174
- *
175
- * If the state is `Closed`, this call simply updates state and returns.
176
- *
177
- * If the state is `Closing`, this call waits for completion before it
178
- * updates the state and returns.
179
- */
180
- open(): Promise<void>;
181
- }
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,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;