UNPKG

2.29 kBSource Map (JSON)View Raw
1{"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"","sourcesContent":["import { DsnLike } from './dsn';\nimport { Event } from './event';\nimport { Response } from './response';\nimport { SdkMetadata } from './sdkmetadata';\nimport { Session, SessionAggregates } from './session';\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/** 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 /**\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