import { DocumentNode, GraphQLError } from 'graphql'; import { Trace } from 'apollo-engine-reporting-protobuf'; import { RequestAgent } from 'apollo-server-env'; import { EngineReportingExtension } from './extension'; import { GraphQLRequestContext } from 'apollo-server-types'; export interface ClientInfo { clientName?: string; clientVersion?: string; clientReferenceId?: string; } export declare type SendValuesBaseOptions = { onlyNames: Array; } | { exceptNames: Array; } | { all: true; } | { none: true; }; declare type VariableValueTransformOptions = { variables: Record; operationString?: string; }; export declare type VariableValueOptions = { transform: (options: VariableValueTransformOptions) => Record; } | SendValuesBaseOptions; export declare type GenerateClientInfo = (requestContext: GraphQLRequestContext) => ClientInfo; export interface EngineReportingOptions { apiKey?: string; calculateSignature?: (ast: DocumentNode, operationName: string) => string; reportIntervalMs?: number; maxUncompressedReportSize?: number; endpointUrl?: string; debugPrintReports?: boolean; requestAgent?: RequestAgent | false; maxAttempts?: number; minimumRetryDelayMs?: number; reportErrorFunction?: (err: Error) => void; sendVariableValues?: VariableValueOptions; privateVariables?: Array | boolean; sendHeaders?: SendValuesBaseOptions; privateHeaders?: Array | boolean; handleSignals?: boolean; sendReportsImmediately?: boolean; maskErrorDetails?: boolean; rewriteError?: (err: GraphQLError) => GraphQLError | null; schemaTag?: string; generateClientInfo?: GenerateClientInfo; } export interface AddTraceArgs { trace: Trace; operationName: string; queryHash: string; schemaHash: string; queryString?: string; documentAST?: DocumentNode; } export declare class EngineReportingAgent { private options; private apiKey; private reports; private reportSizes; private reportTimer; private sendReportsImmediately?; private stopped; private reportHeaders; private signatureCache; private signalHandlers; constructor(options?: EngineReportingOptions); newExtension(schemaHash: string): EngineReportingExtension; addTrace({ trace, queryHash, documentAST, operationName, queryString, schemaHash, }: AddTraceArgs): Promise; sendAllReports(): Promise; sendReport(schemaHash: string): Promise; stop(): void; private getTraceSignature; private sendAllReportsAndReportErrors; private sendReportAndReportErrors; private resetReport; } export declare function signatureCacheKey(queryHash: string, operationName: string): string; export declare function handleLegacyOptions(options: EngineReportingOptions): void; export {}; //# sourceMappingURL=agent.d.ts.map