1 | export { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';
|
2 | export declare const MAX_DELAY_MS = 5000;
|
3 | export declare const NON_RETRYABLE_CODES: number[];
|
4 | export declare const CONNECTION_STATE_CHANGE = "ConnectionStateChange";
|
5 | export declare enum MESSAGE_TYPES {
|
6 | /**
|
7 | * Client -> Server message.
|
8 | * This message type is the first message after handshake and this will initialize AWS AppSync RealTime communication
|
9 | */
|
10 | GQL_CONNECTION_INIT = "connection_init",
|
11 | /**
|
12 | * Server -> Client message
|
13 | * This message type is in case there is an issue with AWS AppSync RealTime when establishing connection
|
14 | */
|
15 | GQL_CONNECTION_ERROR = "connection_error",
|
16 | /**
|
17 | * Server -> Client message.
|
18 | * This message type is for the ack response from AWS AppSync RealTime for GQL_CONNECTION_INIT message
|
19 | */
|
20 | GQL_CONNECTION_ACK = "connection_ack",
|
21 | /**
|
22 | * Client -> Server message.
|
23 | * This message type is for register subscriptions with AWS AppSync RealTime
|
24 | */
|
25 | GQL_START = "start",
|
26 | /**
|
27 | * Server -> Client message.
|
28 | * This message type is for the ack response from AWS AppSync RealTime for GQL_START message
|
29 | */
|
30 | GQL_START_ACK = "start_ack",
|
31 | /**
|
32 | * Server -> Client message.
|
33 | * This message type is for subscription message from AWS AppSync RealTime
|
34 | */
|
35 | GQL_DATA = "data",
|
36 | /**
|
37 | * Server -> Client message.
|
38 | * This message type helps the client to know is still receiving messages from AWS AppSync RealTime
|
39 | */
|
40 | GQL_CONNECTION_KEEP_ALIVE = "ka",
|
41 | /**
|
42 | * Client -> Server message.
|
43 | * This message type is for unregister subscriptions with AWS AppSync RealTime
|
44 | */
|
45 | GQL_STOP = "stop",
|
46 | /**
|
47 | * Server -> Client message.
|
48 | * This message type is for the ack response from AWS AppSync RealTime for GQL_STOP message
|
49 | */
|
50 | GQL_COMPLETE = "complete",
|
51 | /**
|
52 | * Server -> Client message.
|
53 | * This message type is for sending error messages from AWS AppSync RealTime to the client
|
54 | */
|
55 | GQL_ERROR = "error"
|
56 | }
|
57 | export declare enum SUBSCRIPTION_STATUS {
|
58 | PENDING = 0,
|
59 | CONNECTED = 1,
|
60 | FAILED = 2
|
61 | }
|
62 | export declare enum SOCKET_STATUS {
|
63 | CLOSED = 0,
|
64 | READY = 1,
|
65 | CONNECTING = 2
|
66 | }
|
67 | export declare const AWS_APPSYNC_REALTIME_HEADERS: {
|
68 | accept: string;
|
69 | 'content-encoding': string;
|
70 | 'content-type': string;
|
71 | };
|
72 | /**
|
73 | * Time in milleseconds to wait for GQL_CONNECTION_INIT message
|
74 | */
|
75 | export declare const CONNECTION_INIT_TIMEOUT = 15000;
|
76 | /**
|
77 | * Time in milleseconds to wait for GQL_START_ACK message
|
78 | */
|
79 | export declare const START_ACK_TIMEOUT = 15000;
|
80 | /**
|
81 | * Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message
|
82 | */
|
83 | export declare const DEFAULT_KEEP_ALIVE_TIMEOUT: number;
|
84 | /**
|
85 | * Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message
|
86 | */
|
87 | export declare const DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT: number;
|
88 | /**
|
89 | * Default delay time in milleseconds between when reconnect is triggered vs when it is attempted
|
90 | */
|
91 | export declare const RECONNECT_DELAY: number;
|
92 | /**
|
93 | * Default interval time in milleseconds between when reconnect is re-attempted
|
94 | */
|
95 | export declare const RECONNECT_INTERVAL: number;
|