@aws-amplify/pubsub 4.5.2 → 4.5.4-baby-fix.10

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 (61) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/aws-amplify-pubsub.js +78 -43
  3. package/dist/aws-amplify-pubsub.js.map +1 -1
  4. package/dist/aws-amplify-pubsub.min.js +1 -1
  5. package/dist/aws-amplify-pubsub.min.js.map +1 -1
  6. package/lib/Providers/AWSAppSyncRealTimeProvider/index.d.ts +1 -1
  7. package/lib/Providers/AWSAppSyncRealTimeProvider/index.js +9 -9
  8. package/lib/Providers/AWSAppSyncRealTimeProvider/index.js.map +1 -1
  9. package/lib/Providers/MqttOverWSProvider.d.ts +2 -1
  10. package/lib/Providers/MqttOverWSProvider.js +1 -2
  11. package/lib/Providers/MqttOverWSProvider.js.map +1 -1
  12. package/lib/Providers/PubSubProvider.d.ts +1 -1
  13. package/lib/Providers/constants.d.ts +1 -0
  14. package/lib/Providers/constants.js +1 -0
  15. package/lib/Providers/constants.js.map +1 -1
  16. package/lib/index.d.ts +3 -10
  17. package/lib/index.js +3 -10
  18. package/lib/index.js.map +1 -1
  19. package/lib/types/Provider.d.ts +10 -1
  20. package/lib/types/PubSub.d.ts +22 -8
  21. package/lib/types/PubSub.js +56 -0
  22. package/lib/types/PubSub.js.map +1 -1
  23. package/lib/types/index.d.ts +0 -17
  24. package/lib/types/index.js +4 -36
  25. package/lib/types/index.js.map +1 -1
  26. package/lib/utils/ConnectionStateMonitor.d.ts +1 -1
  27. package/lib/utils/ConnectionStateMonitor.js +9 -9
  28. package/lib/utils/ConnectionStateMonitor.js.map +1 -1
  29. package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.d.ts +1 -1
  30. package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js +2 -2
  31. package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js.map +1 -1
  32. package/lib-esm/Providers/MqttOverWSProvider.d.ts +2 -1
  33. package/lib-esm/Providers/MqttOverWSProvider.js +1 -2
  34. package/lib-esm/Providers/MqttOverWSProvider.js.map +1 -1
  35. package/lib-esm/Providers/PubSubProvider.d.ts +1 -1
  36. package/lib-esm/Providers/constants.d.ts +1 -0
  37. package/lib-esm/Providers/constants.js +1 -0
  38. package/lib-esm/Providers/constants.js.map +1 -1
  39. package/lib-esm/index.d.ts +3 -10
  40. package/lib-esm/index.js +3 -11
  41. package/lib-esm/index.js.map +1 -1
  42. package/lib-esm/types/Provider.d.ts +10 -1
  43. package/lib-esm/types/PubSub.d.ts +22 -8
  44. package/lib-esm/types/PubSub.js +56 -0
  45. package/lib-esm/types/PubSub.js.map +1 -1
  46. package/lib-esm/types/index.d.ts +0 -17
  47. package/lib-esm/types/index.js +1 -36
  48. package/lib-esm/types/index.js.map +1 -1
  49. package/lib-esm/utils/ConnectionStateMonitor.d.ts +1 -1
  50. package/lib-esm/utils/ConnectionStateMonitor.js +1 -1
  51. package/lib-esm/utils/ConnectionStateMonitor.js.map +1 -1
  52. package/package.json +5 -5
  53. package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +3 -2
  54. package/src/Providers/MqttOverWSProvider.ts +3 -3
  55. package/src/Providers/PubSubProvider.ts +1 -1
  56. package/src/Providers/constants.ts +2 -0
  57. package/src/index.ts +3 -10
  58. package/src/types/Provider.ts +13 -1
  59. package/src/types/PubSub.ts +47 -8
  60. package/src/types/index.ts +0 -43
  61. package/src/utils/ConnectionStateMonitor.ts +1 -1
@@ -10,15 +10,54 @@
10
10
  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
11
  * and limitations under the License.
12
12
  */
13
- export interface PubSubOptions {
14
- [key: string]: any;
13
+
14
+ export interface SubscriptionObserver<T> {
15
+ closed: boolean;
16
+ next(value: T): void;
17
+ error(errorValue: any): void;
18
+ complete(): void;
15
19
  }
16
20
 
17
- export interface ProviderOptions {
18
- [key: string]: any;
21
+ export enum CONTROL_MSG {
22
+ CONNECTION_CLOSED = 'Connection closed',
23
+ CONNECTION_FAILED = 'Connection failed',
24
+ REALTIME_SUBSCRIPTION_INIT_ERROR = 'AppSync Realtime subscription init error',
25
+ SUBSCRIPTION_ACK = 'Subscription ack',
26
+ TIMEOUT_DISCONNECT = 'Timeout disconnect',
19
27
  }
20
28
 
21
- /**
22
- * @deprecated Migrated to ProviderOptions
23
- */
24
- export type ProvidertOptions = ProviderOptions;
29
+ /** @enum {string} */
30
+ export enum ConnectionState {
31
+ /*
32
+ * The connection is alive and healthy
33
+ */
34
+ Connected = 'Connected',
35
+ /*
36
+ * The connection is alive, but the connection is offline
37
+ */
38
+ ConnectedPendingNetwork = 'ConnectedPendingNetwork',
39
+ /*
40
+ * The connection has been disconnected while in use
41
+ */
42
+ ConnectionDisrupted = 'ConnectionDisrupted',
43
+ /*
44
+ * The connection has been disconnected and the network is offline
45
+ */
46
+ ConnectionDisruptedPendingNetwork = 'ConnectionDisruptedPendingNetwork',
47
+ /*
48
+ * The connection is in the process of connecting
49
+ */
50
+ Connecting = 'Connecting',
51
+ /*
52
+ * The connection is not in use and is being disconnected
53
+ */
54
+ ConnectedPendingDisconnect = 'ConnectedPendingDisconnect',
55
+ /*
56
+ * The connection is not in use and has been disconnected
57
+ */
58
+ Disconnected = 'Disconnected',
59
+ /*
60
+ * The connection is alive, but a keep alive message has been missed
61
+ */
62
+ ConnectedPendingKeepAlive = 'ConnectedPendingKeepAlive',
63
+ }
@@ -12,46 +12,3 @@
12
12
  */
13
13
  export * from './Provider';
14
14
  export * from './PubSub';
15
-
16
- export interface SubscriptionObserver<T> {
17
- closed: boolean;
18
- next(value: T): void;
19
- error(errorValue: any): void;
20
- complete(): void;
21
- }
22
-
23
- /** @enum {string} */
24
- export enum ConnectionState {
25
- /*
26
- * The connection is alive and healthy
27
- */
28
- Connected = 'Connected',
29
- /*
30
- * The connection is alive, but the connection is offline
31
- */
32
- ConnectedPendingNetwork = 'ConnectedPendingNetwork',
33
- /*
34
- * The connection has been disconnected while in use
35
- */
36
- ConnectionDisrupted = 'ConnectionDisrupted',
37
- /*
38
- * The connection has been disconnected and the network is offline
39
- */
40
- ConnectionDisruptedPendingNetwork = 'ConnectionDisruptedPendingNetwork',
41
- /*
42
- * The connection is in the process of connecting
43
- */
44
- Connecting = 'Connecting',
45
- /*
46
- * The connection is not in use and is being disconnected
47
- */
48
- ConnectedPendingDisconnect = 'ConnectedPendingDisconnect',
49
- /*
50
- * The connection is not in use and has been disconnected
51
- */
52
- Disconnected = 'Disconnected',
53
- /*
54
- * The connection is alive, but a keep alive message has been missed
55
- */
56
- ConnectedPendingKeepAlive = 'ConnectedPendingKeepAlive',
57
- }
@@ -13,7 +13,7 @@
13
13
 
14
14
  import { Reachability } from '@aws-amplify/core';
15
15
  import Observable, { ZenObservable } from 'zen-observable-ts';
16
- import { ConnectionState } from '../index';
16
+ import { ConnectionState } from '../types/PubSub';
17
17
  import { ReachabilityMonitor } from './ReachabilityMonitor';
18
18
 
19
19
  // Internal types for tracking different connection states