UNPKG

3 kBSource Map (JSON)View Raw
1{"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":";AAOA,IAAY,OAOX;AAPD,WAAY,OAAO;IACjB,qCAA0B,CAAA;IAC1B,6CAAkC,CAAA;IAClC,yCAA8B,CAAA;IAC9B,2CAAgC,CAAA;IAChC,iDAAsC,CAAA;IACtC,qCAA0B,CAAA;AAC5B,CAAC,EAPW,OAAO,GAAP,eAAO,KAAP,eAAO,QAOlB","sourcesContent":["import { DsnLike } from './dsn';\nimport { Event } from './event';\nimport { SentryRequestType } from './request';\nimport { Response } from './response';\nimport { SdkMetadata } from './sdkmetadata';\nimport { Session, SessionAggregates } from './session';\n\nexport enum Outcome {\n BeforeSend = 'before_send',\n EventProcessor = 'event_processor',\n NetworkError = 'network_error',\n QueueOverflow = 'queue_overflow',\n RateLimitBackoff = 'ratelimit_backoff',\n SampleRate = 'sample_rate',\n}\n\n/** Transport used sending data to Sentry */\nexport interface Transport {\n /**\n * Sends the event to the Store endpoint in Sentry.\n *\n * @param event Event that should be sent to Sentry.\n */\n sendEvent(event: Event): PromiseLike<Response>;\n\n /**\n * Sends the session to the Envelope endpoint in Sentry.\n *\n * @param session Session that should be sent to Sentry | Session Aggregates that should be sent to Sentry.\n */\n sendSession?(session: Session | SessionAggregates): PromiseLike<Response>;\n\n /**\n * Wait for all events to be sent or the timeout to expire, whichever comes first.\n *\n * @param timeout Maximum time in ms the transport should wait for events to be flushed. Omitting this parameter will\n * cause the transport to wait until all events are sent before resolving the promise.\n * @returns A promise that will resolve with `true` if all events are sent before the timeout, or `false` if there are\n * still events in the queue when the timeout is reached.\n */\n close(timeout?: number): PromiseLike<boolean>;\n\n /**\n * Increment the counter for the specific client outcome\n */\n recordLostEvent?(type: Outcome, category: SentryRequestType): void;\n}\n\n/** JSDoc */\nexport type TransportClass<T extends Transport> = new (options: TransportOptions) => T;\n\n/** JSDoc */\nexport interface TransportOptions {\n /** Sentry DSN */\n dsn: DsnLike;\n /** Define custom headers */\n headers?: { [key: string]: string };\n /** Set a HTTP proxy that should be used for outbound requests. */\n httpProxy?: string;\n /** Set a HTTPS proxy that should be used for outbound requests. */\n httpsProxy?: string;\n /** HTTPS proxy certificates path */\n caCerts?: string;\n /** Fetch API init parameters */\n fetchParameters?: { [key: string]: string };\n /** The envelope tunnel to use. */\n tunnel?: string;\n /** Send SDK Client Reports. Enabled by default. */\n sendClientReports?: boolean;\n /**\n * Set of metadata about the SDK that can be internally used to enhance envelopes and events,\n * and provide additional data about every request.\n * */\n _metadata?: SdkMetadata;\n}\n"]}
\No newline at end of file