1 | import Observable from 'zen-observable-ts';
|
2 | import { ProviderOptions } from '../../types/Provider';
|
3 | import { GRAPHQL_AUTH_MODE } from '@aws-amplify/auth';
|
4 | import { AbstractPubSubProvider } from '../PubSubProvider';
|
5 | import { PubSubContent, PubSubContentObserver } from '../../types/PubSub';
|
6 | import { SUBSCRIPTION_STATUS } from '../constants';
|
7 | export declare type ObserverQuery = {
|
8 | observer: PubSubContentObserver;
|
9 | query: string;
|
10 | variables: Record<string, unknown>;
|
11 | subscriptionState: SUBSCRIPTION_STATUS;
|
12 | subscriptionReadyCallback?: Function;
|
13 | subscriptionFailedCallback?: Function;
|
14 | startAckTimeoutId?: ReturnType<typeof setTimeout>;
|
15 | };
|
16 | declare type GraphqlAuthModes = keyof typeof GRAPHQL_AUTH_MODE;
|
17 | export interface AWSAppSyncRealTimeProviderOptions extends ProviderOptions {
|
18 | appSyncGraphqlEndpoint?: string;
|
19 | authenticationType?: GraphqlAuthModes;
|
20 | query?: string;
|
21 | variables?: Record<string, unknown>;
|
22 | apiKey?: string;
|
23 | region?: string;
|
24 | graphql_headers?: () => {} | (() => Promise<{}>);
|
25 | additionalHeaders?: {
|
26 | [key: string]: string;
|
27 | };
|
28 | }
|
29 | export declare class AWSAppSyncRealTimeProvider extends AbstractPubSubProvider<AWSAppSyncRealTimeProviderOptions> {
|
30 | private awsRealTimeSocket?;
|
31 | private socketStatus;
|
32 | private keepAliveTimeoutId?;
|
33 | private keepAliveTimeout;
|
34 | private keepAliveAlertTimeoutId?;
|
35 | private subscriptionObserverMap;
|
36 | private promiseArray;
|
37 | private connectionState;
|
38 | private readonly connectionStateMonitor;
|
39 | private readonly reconnectionMonitor;
|
40 | private connectionStateMonitorSubscription;
|
41 | constructor(options?: ProviderOptions);
|
42 | /**
|
43 | * Mark the socket closed and release all active listeners
|
44 | */
|
45 | close(): void;
|
46 | getNewWebSocket(url: string, protocol: string): WebSocket;
|
47 | getProviderName(): string;
|
48 | newClient(): Promise<any>;
|
49 | publish(_topics: string[] | string, _msg: PubSubContent, _options?: AWSAppSyncRealTimeProviderOptions): Promise<void>;
|
50 | private isCustomDomain;
|
51 | subscribe(_topics: string[] | string, options?: AWSAppSyncRealTimeProviderOptions): Observable<Record<string, unknown>>;
|
52 | protected get isSSLEnabled(): boolean;
|
53 | private _startSubscriptionWithAWSAppSyncRealTime;
|
54 | private _logStartSubscriptionError;
|
55 | private _waitForSubscriptionToBeConnected;
|
56 | private _sendUnsubscriptionMessage;
|
57 | private _removeSubscriptionObserver;
|
58 | private _closeSocketIfRequired;
|
59 | private _handleIncomingSubscriptionMessage;
|
60 | private _errorDisconnect;
|
61 | private _timeoutStartSubscriptionAck;
|
62 | private _initializeWebSocketConnection;
|
63 | private _initializeRetryableHandshake;
|
64 | private _initializeHandshake;
|
65 | private _awsRealTimeHeaderBasedAuth;
|
66 | private _awsRealTimeCUPHeader;
|
67 | private _awsRealTimeOPENIDHeader;
|
68 | private _awsRealTimeApiKeyHeader;
|
69 | private _awsRealTimeIAMHeader;
|
70 | private _customAuthHeader;
|
71 | /**
|
72 | * @private
|
73 | */
|
74 | _ensureCredentials(): any;
|
75 | }
|
76 | export {};
|
77 |
|
\ | No newline at end of file |