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