Socket
Socket
Sign inDemoInstall

@sentry/types

Package Overview
Dependencies
Maintainers
9
Versions
469
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/types - npm Package Compare versions

Comparing version 4.5.3 to 5.0.0-rc.0

dist/breadcrumb.d.ts

302

dist/index.d.ts

@@ -1,276 +0,26 @@

/** Supported Sentry transport protocols in a Dsn. */
export declare type DsnProtocol = 'http' | 'https';
/** Primitive components of a Dsn. */
export interface DsnComponents {
/** Protocol used to connect to Sentry. */
protocol: DsnProtocol;
/** Public authorization key. */
user: string;
/** Private authorization key (deprecated, optional). */
pass?: string;
/** Hostname of the Sentry instance. */
host: string;
/** Port of the Sentry instance. */
port?: string;
/** Sub path/ */
path?: string;
/** Project ID */
projectId: string;
}
/** Anything that can be parsed into a Dsn. */
export declare type DsnLike = string | DsnComponents;
/** JSDoc */
export declare enum Severity {
/** JSDoc */
Fatal = "fatal",
/** JSDoc */
Error = "error",
/** JSDoc */
Warning = "warning",
/** JSDoc */
Log = "log",
/** JSDoc */
Info = "info",
/** JSDoc */
Debug = "debug",
/** JSDoc */
Critical = "critical"
}
export declare namespace Severity {
/**
* Converts a string-based level into a {@link Severity}.
*
* @param level string representation of Severity
* @returns Severity
*/
function fromString(level: string): Severity;
}
/** JSDoc */
export interface Breadcrumb {
type?: string;
level?: Severity;
event_id?: string;
category?: string;
message?: string;
data?: any;
timestamp?: number;
}
/** JSDoc */
export interface User {
[key: string]: any;
id?: string;
ip_address?: string;
email?: string;
username?: string;
}
/** JSDoc */
export interface SdkInfo {
name: string;
version: string;
integrations?: string[];
packages?: Package[];
}
/** JSDoc */
export interface Package {
name: string;
version: string;
}
/** JSDoc */
export interface StackFrame {
filename?: string;
function?: string;
module?: string;
platform?: string;
lineno?: number;
colno?: number;
abs_path?: string;
context_line?: string;
pre_context?: string[];
post_context?: string[];
in_app?: boolean;
vars?: {
[key: string]: any;
};
}
/** JSDoc */
export interface Stacktrace {
frames?: StackFrame[];
frames_omitted?: [number, number];
}
/** JSDoc */
export interface Thread {
id?: number;
name?: string;
stacktrace?: Stacktrace;
crashed?: boolean;
current?: boolean;
}
/** JSDoc */
export interface SentryException {
type?: string;
value?: string;
module?: string;
thread_id?: number;
stacktrace?: Stacktrace;
}
/** JSDoc */
export interface Request {
url?: string;
method?: string;
data?: any;
query_string?: string;
cookies?: {
[key: string]: string;
};
env?: {
[key: string]: string;
};
headers?: {
[key: string]: string;
};
}
/** JSDoc */
export interface SentryEvent {
event_id?: string;
message?: string;
timestamp?: number;
level?: Severity;
platform?: string;
logger?: string;
server_name?: string;
release?: string;
dist?: string;
environment?: string;
sdk?: SdkInfo;
request?: Request;
transaction?: string;
modules?: {
[key: string]: string;
};
fingerprint?: string[];
exception?: {
values?: SentryException[];
mechanism?: Mechanism;
};
stacktrace?: Stacktrace;
breadcrumbs?: Breadcrumb[];
contexts?: {
[key: string]: object;
};
tags?: {
[key: string]: string;
};
extra?: {
[key: string]: any;
};
user?: User;
}
/** JSDoc */
export interface Mechanism {
type: string;
handled: boolean;
data?: {
[key: string]: string;
};
}
/** Integration interface */
export interface Integration {
/**
* Returns {@link IntegrationClass.id}
*/
name: string;
/** @deprecated */
install?(options?: object): void;
setupOnce(): void;
}
/** Integration Class Interface */
export interface IntegrationClass<T> {
new (): T;
/**
* Property that holds the integration name
*/
id: string;
}
/** JSDoc */
export interface SentryResponse {
status: Status;
event?: SentryEvent;
reason?: string;
}
/** JSDoc */
export interface TransportOptions {
[key: string]: any;
/** Sentry DSN */
dsn: DsnLike;
/** Define custom headers */
headers?: object;
/** Set a HTTP proxy that should be used for outbound requests. */
httpProxy?: string;
/** Set a HTTPS proxy that should be used for outbound requests. */
httpsProxy?: string;
/** HTTPS proxy certificates path */
caCerts?: string;
}
/** Transport used sending data to Sentry */
export interface Transport {
/**
* Sends the body to the Store endpoint in Sentry.
*
* @param body String body that should be sent to Sentry.
*/
sendEvent(body: string): Promise<SentryResponse>;
/**
* Call this function to wait until all pending requests have been sent.
*
* @param timeout Number time in ms to wait until the buffer is drained.
*/
close(timeout?: number): Promise<boolean>;
/** @deprecated Implement sendEvent instead */
captureEvent?(event: SentryEvent): Promise<SentryResponse>;
}
/** JSDoc */
export interface TransportClass<T extends Transport> {
new (options: TransportOptions): T;
}
/** The status of an event. */
export declare enum Status {
/** The status could not be determined. */
Unknown = "unknown",
/** The event was skipped due to configuration or callbacks. */
Skipped = "skipped",
/** The event was sent to Sentry successfully. */
Success = "success",
/** The client is currently rate limited and will try again later. */
RateLimit = "rate_limit",
/** The event could not be processed. */
Invalid = "invalid",
/** A server-side error ocurred during submission. */
Failed = "failed"
}
export declare namespace Status {
/**
* Converts a HTTP status code into a {@link Status}.
*
* @param code The HTTP response status code.
* @returns The send status or {@link Status.Unknown}.
*/
function fromHttpCode(code: number): Status;
}
/** JSDoc */
export interface SentryWrappedFunction extends Function {
[key: string]: any;
__sentry__?: boolean;
__sentry_wrapped__?: SentryWrappedFunction;
__sentry_original__?: SentryWrappedFunction;
}
/** JSDoc */
export interface SentryEventHint {
event_id?: string;
syntheticException?: Error | null;
originalException?: Error | null;
data?: any;
}
/** JSDoc */
export interface SentryBreadcrumbHint {
[key: string]: any;
}
export { Breadcrumb, BreadcrumbHint } from './breadcrumb';
export { Client } from './client';
export { Dsn, DsnComponents, DsnLike, DsnProtocol } from './dsn';
export { ExtendedError } from './error';
export { Event, EventHint } from './event';
export { EventProcessor } from './eventprocessor';
export { Exception } from './exception';
export { Hub } from './hub';
export { Integration, IntegrationClass } from './integration';
export { LogLevel } from './loglevel';
export { Mechanism } from './mechanism';
export { Options } from './options';
export { Package } from './package';
export { Request } from './request';
export { Response } from './response';
export { Scope } from './scope';
export { SdkInfo } from './sdkinfo';
export { Severity } from './severity';
export { Span } from './span';
export { StackFrame } from './stackframe';
export { Stacktrace } from './stacktrace';
export { Status } from './status';
export { Thread } from './thread';
export { Transport, TransportOptions, TransportClass } from './transport';
export { User } from './user';
export { WrappedFunction } from './wrappedfunction';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/** JSDoc */
var Severity;
(function (Severity) {
/** JSDoc */
Severity["Fatal"] = "fatal";
/** JSDoc */
Severity["Error"] = "error";
/** JSDoc */
Severity["Warning"] = "warning";
/** JSDoc */
Severity["Log"] = "log";
/** JSDoc */
Severity["Info"] = "info";
/** JSDoc */
Severity["Debug"] = "debug";
/** JSDoc */
Severity["Critical"] = "critical";
})(Severity = exports.Severity || (exports.Severity = {}));
// tslint:disable:no-unnecessary-qualifier no-namespace
(function (Severity) {
/**
* Converts a string-based level into a {@link Severity}.
*
* @param level string representation of Severity
* @returns Severity
*/
function fromString(level) {
switch (level) {
case 'debug':
return Severity.Debug;
case 'info':
return Severity.Info;
case 'warn':
case 'warning':
return Severity.Warning;
case 'error':
return Severity.Error;
case 'fatal':
return Severity.Fatal;
case 'critical':
return Severity.Critical;
case 'log':
default:
return Severity.Log;
}
}
Severity.fromString = fromString;
})(Severity = exports.Severity || (exports.Severity = {}));
/** The status of an event. */
var Status;
(function (Status) {
/** The status could not be determined. */
Status["Unknown"] = "unknown";
/** The event was skipped due to configuration or callbacks. */
Status["Skipped"] = "skipped";
/** The event was sent to Sentry successfully. */
Status["Success"] = "success";
/** The client is currently rate limited and will try again later. */
Status["RateLimit"] = "rate_limit";
/** The event could not be processed. */
Status["Invalid"] = "invalid";
/** A server-side error ocurred during submission. */
Status["Failed"] = "failed";
})(Status = exports.Status || (exports.Status = {}));
// tslint:disable:no-unnecessary-qualifier no-namespace
(function (Status) {
/**
* Converts a HTTP status code into a {@link Status}.
*
* @param code The HTTP response status code.
* @returns The send status or {@link Status.Unknown}.
*/
function fromHttpCode(code) {
if (code >= 200 && code < 300) {
return Status.Success;
}
if (code === 429) {
return Status.RateLimit;
}
if (code >= 400 && code < 500) {
return Status.Invalid;
}
if (code >= 500) {
return Status.Failed;
}
return Status.Unknown;
}
Status.fromHttpCode = fromHttpCode;
})(Status = exports.Status || (exports.Status = {}));
var loglevel_1 = require("./loglevel");
exports.LogLevel = loglevel_1.LogLevel;
var severity_1 = require("./severity");
exports.Severity = severity_1.Severity;
var status_1 = require("./status");
exports.Status = status_1.Status;
//# sourceMappingURL=index.js.map

@@ -1,276 +0,26 @@

/** Supported Sentry transport protocols in a Dsn. */
export declare type DsnProtocol = 'http' | 'https';
/** Primitive components of a Dsn. */
export interface DsnComponents {
/** Protocol used to connect to Sentry. */
protocol: DsnProtocol;
/** Public authorization key. */
user: string;
/** Private authorization key (deprecated, optional). */
pass?: string;
/** Hostname of the Sentry instance. */
host: string;
/** Port of the Sentry instance. */
port?: string;
/** Sub path/ */
path?: string;
/** Project ID */
projectId: string;
}
/** Anything that can be parsed into a Dsn. */
export declare type DsnLike = string | DsnComponents;
/** JSDoc */
export declare enum Severity {
/** JSDoc */
Fatal = "fatal",
/** JSDoc */
Error = "error",
/** JSDoc */
Warning = "warning",
/** JSDoc */
Log = "log",
/** JSDoc */
Info = "info",
/** JSDoc */
Debug = "debug",
/** JSDoc */
Critical = "critical"
}
export declare namespace Severity {
/**
* Converts a string-based level into a {@link Severity}.
*
* @param level string representation of Severity
* @returns Severity
*/
function fromString(level: string): Severity;
}
/** JSDoc */
export interface Breadcrumb {
type?: string;
level?: Severity;
event_id?: string;
category?: string;
message?: string;
data?: any;
timestamp?: number;
}
/** JSDoc */
export interface User {
[key: string]: any;
id?: string;
ip_address?: string;
email?: string;
username?: string;
}
/** JSDoc */
export interface SdkInfo {
name: string;
version: string;
integrations?: string[];
packages?: Package[];
}
/** JSDoc */
export interface Package {
name: string;
version: string;
}
/** JSDoc */
export interface StackFrame {
filename?: string;
function?: string;
module?: string;
platform?: string;
lineno?: number;
colno?: number;
abs_path?: string;
context_line?: string;
pre_context?: string[];
post_context?: string[];
in_app?: boolean;
vars?: {
[key: string]: any;
};
}
/** JSDoc */
export interface Stacktrace {
frames?: StackFrame[];
frames_omitted?: [number, number];
}
/** JSDoc */
export interface Thread {
id?: number;
name?: string;
stacktrace?: Stacktrace;
crashed?: boolean;
current?: boolean;
}
/** JSDoc */
export interface SentryException {
type?: string;
value?: string;
module?: string;
thread_id?: number;
stacktrace?: Stacktrace;
}
/** JSDoc */
export interface Request {
url?: string;
method?: string;
data?: any;
query_string?: string;
cookies?: {
[key: string]: string;
};
env?: {
[key: string]: string;
};
headers?: {
[key: string]: string;
};
}
/** JSDoc */
export interface SentryEvent {
event_id?: string;
message?: string;
timestamp?: number;
level?: Severity;
platform?: string;
logger?: string;
server_name?: string;
release?: string;
dist?: string;
environment?: string;
sdk?: SdkInfo;
request?: Request;
transaction?: string;
modules?: {
[key: string]: string;
};
fingerprint?: string[];
exception?: {
values?: SentryException[];
mechanism?: Mechanism;
};
stacktrace?: Stacktrace;
breadcrumbs?: Breadcrumb[];
contexts?: {
[key: string]: object;
};
tags?: {
[key: string]: string;
};
extra?: {
[key: string]: any;
};
user?: User;
}
/** JSDoc */
export interface Mechanism {
type: string;
handled: boolean;
data?: {
[key: string]: string;
};
}
/** Integration interface */
export interface Integration {
/**
* Returns {@link IntegrationClass.id}
*/
name: string;
/** @deprecated */
install?(options?: object): void;
setupOnce(): void;
}
/** Integration Class Interface */
export interface IntegrationClass<T> {
new (): T;
/**
* Property that holds the integration name
*/
id: string;
}
/** JSDoc */
export interface SentryResponse {
status: Status;
event?: SentryEvent;
reason?: string;
}
/** JSDoc */
export interface TransportOptions {
[key: string]: any;
/** Sentry DSN */
dsn: DsnLike;
/** Define custom headers */
headers?: object;
/** Set a HTTP proxy that should be used for outbound requests. */
httpProxy?: string;
/** Set a HTTPS proxy that should be used for outbound requests. */
httpsProxy?: string;
/** HTTPS proxy certificates path */
caCerts?: string;
}
/** Transport used sending data to Sentry */
export interface Transport {
/**
* Sends the body to the Store endpoint in Sentry.
*
* @param body String body that should be sent to Sentry.
*/
sendEvent(body: string): Promise<SentryResponse>;
/**
* Call this function to wait until all pending requests have been sent.
*
* @param timeout Number time in ms to wait until the buffer is drained.
*/
close(timeout?: number): Promise<boolean>;
/** @deprecated Implement sendEvent instead */
captureEvent?(event: SentryEvent): Promise<SentryResponse>;
}
/** JSDoc */
export interface TransportClass<T extends Transport> {
new (options: TransportOptions): T;
}
/** The status of an event. */
export declare enum Status {
/** The status could not be determined. */
Unknown = "unknown",
/** The event was skipped due to configuration or callbacks. */
Skipped = "skipped",
/** The event was sent to Sentry successfully. */
Success = "success",
/** The client is currently rate limited and will try again later. */
RateLimit = "rate_limit",
/** The event could not be processed. */
Invalid = "invalid",
/** A server-side error ocurred during submission. */
Failed = "failed"
}
export declare namespace Status {
/**
* Converts a HTTP status code into a {@link Status}.
*
* @param code The HTTP response status code.
* @returns The send status or {@link Status.Unknown}.
*/
function fromHttpCode(code: number): Status;
}
/** JSDoc */
export interface SentryWrappedFunction extends Function {
[key: string]: any;
__sentry__?: boolean;
__sentry_wrapped__?: SentryWrappedFunction;
__sentry_original__?: SentryWrappedFunction;
}
/** JSDoc */
export interface SentryEventHint {
event_id?: string;
syntheticException?: Error | null;
originalException?: Error | null;
data?: any;
}
/** JSDoc */
export interface SentryBreadcrumbHint {
[key: string]: any;
}
export { Breadcrumb, BreadcrumbHint } from './breadcrumb';
export { Client } from './client';
export { Dsn, DsnComponents, DsnLike, DsnProtocol } from './dsn';
export { ExtendedError } from './error';
export { Event, EventHint } from './event';
export { EventProcessor } from './eventprocessor';
export { Exception } from './exception';
export { Hub } from './hub';
export { Integration, IntegrationClass } from './integration';
export { LogLevel } from './loglevel';
export { Mechanism } from './mechanism';
export { Options } from './options';
export { Package } from './package';
export { Request } from './request';
export { Response } from './response';
export { Scope } from './scope';
export { SdkInfo } from './sdkinfo';
export { Severity } from './severity';
export { Span } from './span';
export { StackFrame } from './stackframe';
export { Stacktrace } from './stacktrace';
export { Status } from './status';
export { Thread } from './thread';
export { Transport, TransportOptions, TransportClass } from './transport';
export { User } from './user';
export { WrappedFunction } from './wrappedfunction';

@@ -1,90 +0,4 @@

/** JSDoc */
export var Severity;
(function (Severity) {
/** JSDoc */
Severity["Fatal"] = "fatal";
/** JSDoc */
Severity["Error"] = "error";
/** JSDoc */
Severity["Warning"] = "warning";
/** JSDoc */
Severity["Log"] = "log";
/** JSDoc */
Severity["Info"] = "info";
/** JSDoc */
Severity["Debug"] = "debug";
/** JSDoc */
Severity["Critical"] = "critical";
})(Severity || (Severity = {}));
// tslint:disable:no-unnecessary-qualifier no-namespace
(function (Severity) {
/**
* Converts a string-based level into a {@link Severity}.
*
* @param level string representation of Severity
* @returns Severity
*/
function fromString(level) {
switch (level) {
case 'debug':
return Severity.Debug;
case 'info':
return Severity.Info;
case 'warn':
case 'warning':
return Severity.Warning;
case 'error':
return Severity.Error;
case 'fatal':
return Severity.Fatal;
case 'critical':
return Severity.Critical;
case 'log':
default:
return Severity.Log;
}
}
Severity.fromString = fromString;
})(Severity || (Severity = {}));
/** The status of an event. */
export var Status;
(function (Status) {
/** The status could not be determined. */
Status["Unknown"] = "unknown";
/** The event was skipped due to configuration or callbacks. */
Status["Skipped"] = "skipped";
/** The event was sent to Sentry successfully. */
Status["Success"] = "success";
/** The client is currently rate limited and will try again later. */
Status["RateLimit"] = "rate_limit";
/** The event could not be processed. */
Status["Invalid"] = "invalid";
/** A server-side error ocurred during submission. */
Status["Failed"] = "failed";
})(Status || (Status = {}));
// tslint:disable:no-unnecessary-qualifier no-namespace
(function (Status) {
/**
* Converts a HTTP status code into a {@link Status}.
*
* @param code The HTTP response status code.
* @returns The send status or {@link Status.Unknown}.
*/
function fromHttpCode(code) {
if (code >= 200 && code < 300) {
return Status.Success;
}
if (code === 429) {
return Status.RateLimit;
}
if (code >= 400 && code < 500) {
return Status.Invalid;
}
if (code >= 500) {
return Status.Failed;
}
return Status.Unknown;
}
Status.fromHttpCode = fromHttpCode;
})(Status || (Status = {}));
export { LogLevel } from './loglevel';
export { Severity } from './severity';
export { Status } from './status';
//# sourceMappingURL=index.js.map
{
"name": "@sentry/types",
"version": "4.5.3",
"version": "5.0.0-rc.0",
"description": "Types for all Sentry JavaScript SDKs",

@@ -13,2 +13,3 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"main": "dist/index.js",
"module": "esm/index.js",
"types": "dist/index.d.ts",

@@ -20,6 +21,6 @@ "publishConfig": {

"npm-run-all": "^4.1.2",
"prettier": "^1.14.0",
"prettier": "^1.16.4",
"prettier-check": "^2.0.0",
"tslint": "^5.11.0",
"typescript": "^3.2.0"
"tslint": "^5.14.0",
"typescript": "^3.3.3333"
},

@@ -29,6 +30,7 @@ "scripts": {

"build:es5": "tsc -p tsconfig.build.json",
"build:esm": "run-s build:esm:transpile build:esm:rewrite",
"build:esm:transpile": "tsc -p tsconfig.esm.json",
"build:esm:rewrite": "node ../../scripts/esm-rewrite.js",
"build:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
"build:esm": "tsc -p tsconfig.esm.json",
"build:watch": "run-p build:watch:es5 build:watch:esm",
"build:watch:es5": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
"build:watch:esm": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
"link:yarn": "yarn link",
"lint": "run-s lint:prettier lint:tslint",

@@ -35,0 +37,0 @@ "lint:prettier": "prettier-check \"{src,test}/**/*.ts\"",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc