@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.
- package/CHANGELOG.md +19 -0
- package/dist/aws-amplify-pubsub.js +78 -43
- package/dist/aws-amplify-pubsub.js.map +1 -1
- package/dist/aws-amplify-pubsub.min.js +1 -1
- package/dist/aws-amplify-pubsub.min.js.map +1 -1
- package/lib/Providers/AWSAppSyncRealTimeProvider/index.d.ts +1 -1
- package/lib/Providers/AWSAppSyncRealTimeProvider/index.js +9 -9
- package/lib/Providers/AWSAppSyncRealTimeProvider/index.js.map +1 -1
- package/lib/Providers/MqttOverWSProvider.d.ts +2 -1
- package/lib/Providers/MqttOverWSProvider.js +1 -2
- package/lib/Providers/MqttOverWSProvider.js.map +1 -1
- package/lib/Providers/PubSubProvider.d.ts +1 -1
- package/lib/Providers/constants.d.ts +1 -0
- package/lib/Providers/constants.js +1 -0
- package/lib/Providers/constants.js.map +1 -1
- package/lib/index.d.ts +3 -10
- package/lib/index.js +3 -10
- package/lib/index.js.map +1 -1
- package/lib/types/Provider.d.ts +10 -1
- package/lib/types/PubSub.d.ts +22 -8
- package/lib/types/PubSub.js +56 -0
- package/lib/types/PubSub.js.map +1 -1
- package/lib/types/index.d.ts +0 -17
- package/lib/types/index.js +4 -36
- package/lib/types/index.js.map +1 -1
- package/lib/utils/ConnectionStateMonitor.d.ts +1 -1
- package/lib/utils/ConnectionStateMonitor.js +9 -9
- package/lib/utils/ConnectionStateMonitor.js.map +1 -1
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.d.ts +1 -1
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js +2 -2
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js.map +1 -1
- package/lib-esm/Providers/MqttOverWSProvider.d.ts +2 -1
- package/lib-esm/Providers/MqttOverWSProvider.js +1 -2
- package/lib-esm/Providers/MqttOverWSProvider.js.map +1 -1
- package/lib-esm/Providers/PubSubProvider.d.ts +1 -1
- package/lib-esm/Providers/constants.d.ts +1 -0
- package/lib-esm/Providers/constants.js +1 -0
- package/lib-esm/Providers/constants.js.map +1 -1
- package/lib-esm/index.d.ts +3 -10
- package/lib-esm/index.js +3 -11
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/types/Provider.d.ts +10 -1
- package/lib-esm/types/PubSub.d.ts +22 -8
- package/lib-esm/types/PubSub.js +56 -0
- package/lib-esm/types/PubSub.js.map +1 -1
- package/lib-esm/types/index.d.ts +0 -17
- package/lib-esm/types/index.js +1 -36
- package/lib-esm/types/index.js.map +1 -1
- package/lib-esm/utils/ConnectionStateMonitor.d.ts +1 -1
- package/lib-esm/utils/ConnectionStateMonitor.js +1 -1
- package/lib-esm/utils/ConnectionStateMonitor.js.map +1 -1
- package/package.json +5 -5
- package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +3 -2
- package/src/Providers/MqttOverWSProvider.ts +3 -3
- package/src/Providers/PubSubProvider.ts +1 -1
- package/src/Providers/constants.ts +2 -0
- package/src/index.ts +3 -10
- package/src/types/Provider.ts +13 -1
- package/src/types/PubSub.ts +47 -8
- package/src/types/index.ts +0 -43
- package/src/utils/ConnectionStateMonitor.ts +1 -1
package/src/types/PubSub.ts
CHANGED
|
@@ -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
|
-
|
|
14
|
-
|
|
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
|
|
18
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -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 '../
|
|
16
|
+
import { ConnectionState } from '../types/PubSub';
|
|
17
17
|
import { ReachabilityMonitor } from './ReachabilityMonitor';
|
|
18
18
|
|
|
19
19
|
// Internal types for tracking different connection states
|