fix: prevent asset conflicts between React and Grid.js versions

Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
dwindown
2026-04-18 17:02:14 +07:00
parent bd9cdac02e
commit e8fbfb14c1
74973 changed files with 6658406 additions and 71 deletions

83
node_modules/@sentry/core/dist/api.d.ts generated vendored Normal file
View File

@@ -0,0 +1,83 @@
import { DsnComponents, DsnLike, SdkMetadata } from '@sentry/types';
/**
* Stores details about a Sentry SDK
*/
export interface APIDetails {
/** The DSN as passed to Sentry.init() */
initDsn: DsnLike;
/** Metadata about the SDK (name, version, etc) for inclusion in envelope headers */
metadata: SdkMetadata;
/** The internally used Dsn object. */
readonly dsn: DsnComponents;
/** The envelope tunnel to use. */
readonly tunnel?: string;
}
/**
* Helper class to provide urls, headers and metadata that can be used to form
* different types of requests to Sentry endpoints.
* Supports both envelopes and regular event requests.
*
* @deprecated Please use APIDetails
**/
export declare class API {
/** The DSN as passed to Sentry.init() */
dsn: DsnLike;
/** Metadata about the SDK (name, version, etc) for inclusion in envelope headers */
metadata: SdkMetadata;
/** The internally used Dsn object. */
private readonly _dsnObject;
/** The envelope tunnel to use. */
private readonly _tunnel?;
/** Create a new instance of API */
constructor(dsn: DsnLike, metadata?: SdkMetadata, tunnel?: string);
/** Returns the Dsn object. */
getDsn(): DsnComponents;
/** Does this transport force envelopes? */
forceEnvelope(): boolean;
/** Returns the prefix to construct Sentry ingestion API endpoints. */
getBaseApiEndpoint(): string;
/** Returns the store endpoint URL. */
getStoreEndpoint(): string;
/**
* Returns the store endpoint URL with auth in the query string.
*
* Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
*/
getStoreEndpointWithUrlEncodedAuth(): string;
/**
* Returns the envelope endpoint URL with auth in the query string.
*
* Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
*/
getEnvelopeEndpointWithUrlEncodedAuth(): string;
}
/** Initializes API Details */
export declare function initAPIDetails(dsn: DsnLike, metadata?: SdkMetadata, tunnel?: string): APIDetails;
/**
* Returns the store endpoint URL with auth in the query string.
*
* Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
*/
export declare function getStoreEndpointWithUrlEncodedAuth(dsn: DsnComponents): string;
/**
* Returns the envelope endpoint URL with auth in the query string.
*
* Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
*/
export declare function getEnvelopeEndpointWithUrlEncodedAuth(dsn: DsnComponents, tunnel?: string): string;
/**
* Returns an object that can be used in request headers.
* This is needed for node and the old /store endpoint in sentry
*/
export declare function getRequestHeaders(dsn: DsnComponents, clientName: string, clientVersion: string): {
[key: string]: string;
};
/** Returns the url to the report dialog endpoint. */
export declare function getReportDialogEndpoint(dsnLike: DsnLike, dialogOptions: {
[key: string]: any;
user?: {
name?: string;
email?: string;
};
}): string;
//# sourceMappingURL=api.d.ts.map

1
node_modules/@sentry/core/dist/api.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAKpE;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,oFAAoF;IACpF,QAAQ,EAAE,WAAW,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B,kCAAkC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;IAMI;AACJ,qBAAa,GAAG;IACd,yCAAyC;IAClC,GAAG,EAAE,OAAO,CAAC;IAEpB,oFAAoF;IAC7E,QAAQ,EAAE,WAAW,CAAC;IAE7B,sCAAsC;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;IAE3C,kCAAkC;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,mCAAmC;gBAChB,GAAG,EAAE,OAAO,EAAE,QAAQ,GAAE,WAAgB,EAAE,MAAM,CAAC,EAAE,MAAM;IAO5E,8BAA8B;IACvB,MAAM,IAAI,aAAa;IAI9B,2CAA2C;IACpC,aAAa,IAAI,OAAO;IAI/B,sEAAsE;IAC/D,kBAAkB,IAAI,MAAM;IAInC,sCAAsC;IAC/B,gBAAgB,IAAI,MAAM;IAIjC;;;;OAIG;IACI,kCAAkC,IAAI,MAAM;IAInD;;;;OAIG;IACI,qCAAqC,IAAI,MAAM;CAGvD;AAED,8BAA8B;AAC9B,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAOhG;AA6BD;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAE7E;AAOD;;;;GAIG;AACH,wBAAgB,qCAAqC,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACpB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAY3B;AAED,qDAAqD;AACrD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE;IAEb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C,GACA,MAAM,CA0BR"}

155
node_modules/@sentry/core/dist/api.js generated vendored Normal file
View File

@@ -0,0 +1,155 @@
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("@sentry/utils");
var SENTRY_API_VERSION = '7';
/**
* Helper class to provide urls, headers and metadata that can be used to form
* different types of requests to Sentry endpoints.
* Supports both envelopes and regular event requests.
*
* @deprecated Please use APIDetails
**/
var API = /** @class */ (function () {
/** Create a new instance of API */
function API(dsn, metadata, tunnel) {
if (metadata === void 0) { metadata = {}; }
this.dsn = dsn;
this._dsnObject = utils_1.makeDsn(dsn);
this.metadata = metadata;
this._tunnel = tunnel;
}
/** Returns the Dsn object. */
API.prototype.getDsn = function () {
return this._dsnObject;
};
/** Does this transport force envelopes? */
API.prototype.forceEnvelope = function () {
return !!this._tunnel;
};
/** Returns the prefix to construct Sentry ingestion API endpoints. */
API.prototype.getBaseApiEndpoint = function () {
return getBaseApiEndpoint(this._dsnObject);
};
/** Returns the store endpoint URL. */
API.prototype.getStoreEndpoint = function () {
return getStoreEndpoint(this._dsnObject);
};
/**
* Returns the store endpoint URL with auth in the query string.
*
* Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
*/
API.prototype.getStoreEndpointWithUrlEncodedAuth = function () {
return getStoreEndpointWithUrlEncodedAuth(this._dsnObject);
};
/**
* Returns the envelope endpoint URL with auth in the query string.
*
* Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
*/
API.prototype.getEnvelopeEndpointWithUrlEncodedAuth = function () {
return getEnvelopeEndpointWithUrlEncodedAuth(this._dsnObject, this._tunnel);
};
return API;
}());
exports.API = API;
/** Initializes API Details */
function initAPIDetails(dsn, metadata, tunnel) {
return {
initDsn: dsn,
metadata: metadata || {},
dsn: utils_1.makeDsn(dsn),
tunnel: tunnel,
};
}
exports.initAPIDetails = initAPIDetails;
/** Returns the prefix to construct Sentry ingestion API endpoints. */
function getBaseApiEndpoint(dsn) {
var protocol = dsn.protocol ? dsn.protocol + ":" : '';
var port = dsn.port ? ":" + dsn.port : '';
return protocol + "//" + dsn.host + port + (dsn.path ? "/" + dsn.path : '') + "/api/";
}
/** Returns the ingest API endpoint for target. */
function _getIngestEndpoint(dsn, target) {
return "" + getBaseApiEndpoint(dsn) + dsn.projectId + "/" + target + "/";
}
/** Returns a URL-encoded string with auth config suitable for a query string. */
function _encodedAuth(dsn) {
return utils_1.urlEncode({
// We send only the minimum set of required information. See
// https://github.com/getsentry/sentry-javascript/issues/2572.
sentry_key: dsn.publicKey,
sentry_version: SENTRY_API_VERSION,
});
}
/** Returns the store endpoint URL. */
function getStoreEndpoint(dsn) {
return _getIngestEndpoint(dsn, 'store');
}
/**
* Returns the store endpoint URL with auth in the query string.
*
* Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
*/
function getStoreEndpointWithUrlEncodedAuth(dsn) {
return getStoreEndpoint(dsn) + "?" + _encodedAuth(dsn);
}
exports.getStoreEndpointWithUrlEncodedAuth = getStoreEndpointWithUrlEncodedAuth;
/** Returns the envelope endpoint URL. */
function _getEnvelopeEndpoint(dsn) {
return _getIngestEndpoint(dsn, 'envelope');
}
/**
* Returns the envelope endpoint URL with auth in the query string.
*
* Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
*/
function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel) {
return tunnel ? tunnel : _getEnvelopeEndpoint(dsn) + "?" + _encodedAuth(dsn);
}
exports.getEnvelopeEndpointWithUrlEncodedAuth = getEnvelopeEndpointWithUrlEncodedAuth;
/**
* Returns an object that can be used in request headers.
* This is needed for node and the old /store endpoint in sentry
*/
function getRequestHeaders(dsn, clientName, clientVersion) {
// CHANGE THIS to use metadata but keep clientName and clientVersion compatible
var header = ["Sentry sentry_version=" + SENTRY_API_VERSION];
header.push("sentry_client=" + clientName + "/" + clientVersion);
header.push("sentry_key=" + dsn.publicKey);
if (dsn.pass) {
header.push("sentry_secret=" + dsn.pass);
}
return {
'Content-Type': 'application/json',
'X-Sentry-Auth': header.join(', '),
};
}
exports.getRequestHeaders = getRequestHeaders;
/** Returns the url to the report dialog endpoint. */
function getReportDialogEndpoint(dsnLike, dialogOptions) {
var dsn = utils_1.makeDsn(dsnLike);
var endpoint = getBaseApiEndpoint(dsn) + "embed/error-page/";
var encodedOptions = "dsn=" + utils_1.dsnToString(dsn);
for (var key in dialogOptions) {
if (key === 'dsn') {
continue;
}
if (key === 'user') {
if (!dialogOptions.user) {
continue;
}
if (dialogOptions.user.name) {
encodedOptions += "&name=" + encodeURIComponent(dialogOptions.user.name);
}
if (dialogOptions.user.email) {
encodedOptions += "&email=" + encodeURIComponent(dialogOptions.user.email);
}
}
else {
encodedOptions += "&" + encodeURIComponent(key) + "=" + encodeURIComponent(dialogOptions[key]);
}
}
return endpoint + "?" + encodedOptions;
}
exports.getReportDialogEndpoint = getReportDialogEndpoint;
//# sourceMappingURL=api.js.map

1
node_modules/@sentry/core/dist/api.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

83
node_modules/@sentry/core/dist/basebackend.d.ts generated vendored Normal file
View File

@@ -0,0 +1,83 @@
import { Event, EventHint, Options, Session, Severity, Transport } from '@sentry/types';
import { NewTransport } from './transports/base';
/**
* Internal platform-dependent Sentry SDK Backend.
*
* While {@link Client} contains business logic specific to an SDK, the
* Backend offers platform specific implementations for low-level operations.
* These are persisting and loading information, sending events, and hooking
* into the environment.
*
* Backends receive a handle to the Client in their constructor. When a
* Backend automatically generates events, it must pass them to
* the Client for validation and processing first.
*
* Usually, the Client will be of corresponding type, e.g. NodeBackend
* receives NodeClient. However, higher-level SDKs can choose to instantiate
* multiple Backends and delegate tasks between them. In this case, an event
* generated by one backend might very well be sent by another one.
*
* The client also provides access to options via {@link Client.getOptions}.
* @hidden
*/
export interface Backend {
/** Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. */
eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;
/** Creates an {@link Event} from primitive inputs to `captureMessage`. */
eventFromMessage(message: string, level?: Severity, hint?: EventHint): PromiseLike<Event>;
/** Submits the event to Sentry */
sendEvent(event: Event): void;
/** Submits the session to Sentry */
sendSession(session: Session): void;
/**
* Returns the transport that is used by the backend.
* Please note that the transport gets lazy initialized so it will only be there once the first event has been sent.
*
* @returns The transport.
*/
getTransport(): Transport;
}
/**
* A class object that can instantiate Backend objects.
* @hidden
*/
export declare type BackendClass<B extends Backend, O extends Options> = new (options: O) => B;
/**
* This is the base implemention of a Backend.
* @hidden
*/
export declare abstract class BaseBackend<O extends Options> implements Backend {
/** Options passed to the SDK. */
protected readonly _options: O;
/** Cached transport used internally. */
protected _transport: Transport;
/** New v7 Transport that is initialized alongside the old one */
protected _newTransport?: NewTransport;
/** Creates a new backend instance. */
constructor(options: O);
/**
* @inheritDoc
*/
eventFromException(_exception: any, _hint?: EventHint): PromiseLike<Event>;
/**
* @inheritDoc
*/
eventFromMessage(_message: string, _level?: Severity, _hint?: EventHint): PromiseLike<Event>;
/**
* @inheritDoc
*/
sendEvent(event: Event): void;
/**
* @inheritDoc
*/
sendSession(session: Session): void;
/**
* @inheritDoc
*/
getTransport(): Transport;
/**
* Sets up the transport so it can be used later to send requests.
*/
protected _setupTransport(): Transport;
}
//# sourceMappingURL=basebackend.d.ts.map

1
node_modules/@sentry/core/dist/basebackend.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"basebackend.d.ts","sourceRoot":"","sources":["../../src/basebackend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAMxF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,OAAO;IACtB,mHAAmH;IAEnH,kBAAkB,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAEzE,0EAA0E;IAC1E,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAE1F,kCAAkC;IAClC,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAE9B,oCAAoC;IACpC,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAEpC;;;;;OAKG;IACH,YAAY,IAAI,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,oBAAY,YAAY,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,OAAO,IAAI,KAAK,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;AAEvF;;;GAGG;AACH,8BAAsB,WAAW,CAAC,CAAC,SAAS,OAAO,CAAE,YAAW,OAAO;IACrE,iCAAiC;IACjC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE/B,wCAAwC;IACxC,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC;IAEhC,iEAAiE;IACjE,SAAS,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IAEvC,sCAAsC;gBACnB,OAAO,EAAE,CAAC;IAQ7B;;OAEG;IAEI,kBAAkB,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAIjF;;OAEG;IACI,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAInG;;OAEG;IACI,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAoBpC;;OAEG;IACI,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAyB1C;;OAEG;IACI,YAAY,IAAI,SAAS;IAIhC;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,SAAS;CAGvC"}

95
node_modules/@sentry/core/dist/basebackend.js generated vendored Normal file
View File

@@ -0,0 +1,95 @@
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var utils_1 = require("@sentry/utils");
var api_1 = require("./api");
var flags_1 = require("./flags");
var request_1 = require("./request");
var noop_1 = require("./transports/noop");
/**
* This is the base implemention of a Backend.
* @hidden
*/
var BaseBackend = /** @class */ (function () {
/** Creates a new backend instance. */
function BaseBackend(options) {
this._options = options;
if (!this._options.dsn) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.warn('No DSN provided, backend will not do anything.');
}
this._transport = this._setupTransport();
}
/**
* @inheritDoc
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
BaseBackend.prototype.eventFromException = function (_exception, _hint) {
throw new utils_1.SentryError('Backend has to implement `eventFromException` method');
};
/**
* @inheritDoc
*/
BaseBackend.prototype.eventFromMessage = function (_message, _level, _hint) {
throw new utils_1.SentryError('Backend has to implement `eventFromMessage` method');
};
/**
* @inheritDoc
*/
BaseBackend.prototype.sendEvent = function (event) {
// TODO(v7): Remove the if-else
if (this._newTransport &&
this._options.dsn &&
this._options._experiments &&
this._options._experiments.newTransport) {
var api = api_1.initAPIDetails(this._options.dsn, this._options._metadata, this._options.tunnel);
var env = request_1.createEventEnvelope(event, api);
void this._newTransport.send(env).then(null, function (reason) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.error('Error while sending event:', reason);
});
}
else {
void this._transport.sendEvent(event).then(null, function (reason) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.error('Error while sending event:', reason);
});
}
};
/**
* @inheritDoc
*/
BaseBackend.prototype.sendSession = function (session) {
if (!this._transport.sendSession) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.warn("Dropping session because custom transport doesn't implement sendSession");
return;
}
// TODO(v7): Remove the if-else
if (this._newTransport &&
this._options.dsn &&
this._options._experiments &&
this._options._experiments.newTransport) {
var api = api_1.initAPIDetails(this._options.dsn, this._options._metadata, this._options.tunnel);
var _a = tslib_1.__read(request_1.createSessionEnvelope(session, api), 1), env = _a[0];
void this._newTransport.send(env).then(null, function (reason) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.error('Error while sending session:', reason);
});
}
else {
void this._transport.sendSession(session).then(null, function (reason) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.error('Error while sending session:', reason);
});
}
};
/**
* @inheritDoc
*/
BaseBackend.prototype.getTransport = function () {
return this._transport;
};
/**
* Sets up the transport so it can be used later to send requests.
*/
BaseBackend.prototype._setupTransport = function () {
return new noop_1.NoopTransport();
};
return BaseBackend;
}());
exports.BaseBackend = BaseBackend;
//# sourceMappingURL=basebackend.js.map

1
node_modules/@sentry/core/dist/basebackend.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

191
node_modules/@sentry/core/dist/baseclient.d.ts generated vendored Normal file
View File

@@ -0,0 +1,191 @@
import { Scope, Session } from '@sentry/hub';
import { Client, DsnComponents, Event, EventHint, Integration, IntegrationClass, Options, Severity, Transport } from '@sentry/types';
import { Backend, BackendClass } from './basebackend';
import { IntegrationIndex } from './integration';
/**
* Base implementation for all JavaScript SDK clients.
*
* Call the constructor with the corresponding backend constructor and options
* specific to the client subclass. To access these options later, use
* {@link Client.getOptions}. Also, the Backend instance is available via
* {@link Client.getBackend}.
*
* If a Dsn is specified in the options, it will be parsed and stored. Use
* {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is
* invalid, the constructor will throw a {@link SentryException}. Note that
* without a valid Dsn, the SDK will not send any events to Sentry.
*
* Before sending an event via the backend, it is passed through
* {@link BaseClient._prepareEvent} to add SDK information and scope data
* (breadcrumbs and context). To add more custom information, override this
* method and extend the resulting prepared event.
*
* To issue automatically created events (e.g. via instrumentation), use
* {@link Client.captureEvent}. It will prepare the event and pass it through
* the callback lifecycle. To issue auto-breadcrumbs, use
* {@link Client.addBreadcrumb}.
*
* @example
* class NodeClient extends BaseClient<NodeBackend, NodeOptions> {
* public constructor(options: NodeOptions) {
* super(NodeBackend, options);
* }
*
* // ...
* }
*/
export declare abstract class BaseClient<B extends Backend, O extends Options> implements Client<O> {
/**
* The backend used to physically interact in the environment. Usually, this
* will correspond to the client. When composing SDKs, however, the Backend
* from the root SDK will be used.
*/
protected readonly _backend: B;
/** Options passed to the SDK. */
protected readonly _options: O;
/** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */
protected readonly _dsn?: DsnComponents;
/** Array of used integrations. */
protected _integrations: IntegrationIndex;
/** Number of calls being processed */
protected _numProcessing: number;
/**
* Initializes this client instance.
*
* @param backendClass A constructor function to create the backend.
* @param options Options for the client.
*/
protected constructor(backendClass: BackendClass<B, O>, options: O);
/**
* @inheritDoc
*/
captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined;
/**
* @inheritDoc
*/
captureMessage(message: string, level?: Severity, hint?: EventHint, scope?: Scope): string | undefined;
/**
* @inheritDoc
*/
captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined;
/**
* @inheritDoc
*/
captureSession(session: Session): void;
/**
* @inheritDoc
*/
getDsn(): DsnComponents | undefined;
/**
* @inheritDoc
*/
getOptions(): O;
/**
* @inheritDoc
*/
getTransport(): Transport;
/**
* @inheritDoc
*/
flush(timeout?: number): PromiseLike<boolean>;
/**
* @inheritDoc
*/
close(timeout?: number): PromiseLike<boolean>;
/**
* Sets up the integrations
*/
setupIntegrations(): void;
/**
* @inheritDoc
*/
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
/** Updates existing session based on the provided event */
protected _updateSessionFromEvent(session: Session, event: Event): void;
/** Deliver captured session to Sentry */
protected _sendSession(session: Session): void;
/**
* Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying
* "no" (resolving to `false`) in order to give the client a chance to potentially finish first.
*
* @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not
* passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
* `true`.
* @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and
* `false` otherwise
*/
protected _isClientDoneProcessing(timeout?: number): PromiseLike<boolean>;
/** Returns the current backend. */
protected _getBackend(): B;
/** Determines whether this SDK is enabled and a valid Dsn is present. */
protected _isEnabled(): boolean;
/**
* Adds common information to events.
*
* The information includes release and environment from `options`,
* breadcrumbs and context (extra, tags and user) from the scope.
*
* Information that is already present in the event is never overwritten. For
* nested objects, such as the context, keys are merged.
*
* @param event The original event.
* @param hint May contain additional information about the original exception.
* @param scope A scope containing event metadata.
* @returns A new event with more information.
*/
protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike<Event | null>;
/**
* Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.
* Normalized keys:
* - `breadcrumbs.data`
* - `user`
* - `contexts`
* - `extra`
* @param event Event
* @returns Normalized event
*/
protected _normalizeEvent(event: Event | null, depth: number, maxBreadth: number): Event | null;
/**
* Enhances event using the client configuration.
* It takes care of all "static" values like environment, release and `dist`,
* as well as truncating overly long values.
* @param event event instance to be enhanced
*/
protected _applyClientOptions(event: Event): void;
/**
* This function adds all used integrations to the SDK info in the event.
* @param event The event that will be filled with all integrations.
*/
protected _applyIntegrationsMetadata(event: Event): void;
/**
* Tells the backend to send this event
* @param event The Sentry event to send
*/
protected _sendEvent(event: Event): void;
/**
* Processes the event and logs an error in case of rejection
* @param event
* @param hint
* @param scope
*/
protected _captureEvent(event: Event, hint?: EventHint, scope?: Scope): PromiseLike<string | undefined>;
/**
* Processes an event (either error or message) and sends it to Sentry.
*
* This also adds breadcrumbs and context information to the event. However,
* platform specific meta data (such as the User's IP address) must be added
* by the SDK implementor.
*
*
* @param event The event to send to Sentry.
* @param hint May contain additional information about the original exception.
* @param scope A scope containing event metadata.
* @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
*/
protected _processEvent(event: Event, hint?: EventHint, scope?: Scope): PromiseLike<Event>;
/**
* Occupies the client with processing and event
*/
protected _process<T>(promise: PromiseLike<T>): void;
}
//# sourceMappingURL=baseclient.d.ts.map

1
node_modules/@sentry/core/dist/baseclient.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"baseclient.d.ts","sourceRoot":"","sources":["../../src/baseclient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,MAAM,EACN,aAAa,EACb,KAAK,EACL,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,SAAS,EACV,MAAM,eAAe,CAAC;AAkBvB,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,eAAe,CAAC;AAIpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,8BAAsB,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,OAAO,CAAE,YAAW,MAAM,CAAC,CAAC,CAAC;IACzF;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE/B,iCAAiC;IACjC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE/B,2FAA2F;IAC3F,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC;IAExC,kCAAkC;IAClC,SAAS,CAAC,aAAa,EAAE,gBAAgB,CAAM;IAE/C,sCAAsC;IACtC,SAAS,CAAC,cAAc,EAAE,MAAM,CAAK;IAErC;;;;;OAKG;IACH,SAAS,aAAa,YAAY,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;IASlE;;OAEG;IAEI,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS;IAqB5F;;OAEG;IACI,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS;IAkB7G;;OAEG;IACI,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS;IAkBtF;;OAEG;IACI,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAe7C;;OAEG;IACI,MAAM,IAAI,aAAa,GAAG,SAAS;IAI1C;;OAEG;IACI,UAAU,IAAI,CAAC;IAItB;;OAEG;IACI,YAAY,IAAI,SAAS;IAIhC;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;IAQpD;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;IAOpD;;OAEG;IACI,iBAAiB,IAAI,IAAI;IAMhC;;OAEG;IACI,cAAc,CAAC,CAAC,SAAS,WAAW,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI;IASxF,2DAA2D;IAC3D,SAAS,CAAC,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAgCvE,yCAAyC;IACzC,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI9C;;;;;;;;;OASG;IACH,SAAS,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;IAoBzE,mCAAmC;IACnC,SAAS,CAAC,WAAW,IAAI,CAAC;IAI1B,yEAAyE;IACzE,SAAS,CAAC,UAAU,IAAI,OAAO;IAI/B;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC;IA4CjG;;;;;;;;;OASG;IACH,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI;IA0C/F;;;;;OAKG;IACH,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IA+BjD;;;OAGG;IACH,SAAS,CAAC,0BAA0B,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAQxD;;;OAGG;IACH,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAIxC;;;;;OAKG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC;IAYvG;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IA6E1F;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI;CAarD"}

520
node_modules/@sentry/core/dist/baseclient.js generated vendored Normal file
View File

@@ -0,0 +1,520 @@
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
/* eslint-disable max-lines */
var hub_1 = require("@sentry/hub");
var utils_1 = require("@sentry/utils");
var flags_1 = require("./flags");
var integration_1 = require("./integration");
var ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";
/**
* Base implementation for all JavaScript SDK clients.
*
* Call the constructor with the corresponding backend constructor and options
* specific to the client subclass. To access these options later, use
* {@link Client.getOptions}. Also, the Backend instance is available via
* {@link Client.getBackend}.
*
* If a Dsn is specified in the options, it will be parsed and stored. Use
* {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is
* invalid, the constructor will throw a {@link SentryException}. Note that
* without a valid Dsn, the SDK will not send any events to Sentry.
*
* Before sending an event via the backend, it is passed through
* {@link BaseClient._prepareEvent} to add SDK information and scope data
* (breadcrumbs and context). To add more custom information, override this
* method and extend the resulting prepared event.
*
* To issue automatically created events (e.g. via instrumentation), use
* {@link Client.captureEvent}. It will prepare the event and pass it through
* the callback lifecycle. To issue auto-breadcrumbs, use
* {@link Client.addBreadcrumb}.
*
* @example
* class NodeClient extends BaseClient<NodeBackend, NodeOptions> {
* public constructor(options: NodeOptions) {
* super(NodeBackend, options);
* }
*
* // ...
* }
*/
var BaseClient = /** @class */ (function () {
/**
* Initializes this client instance.
*
* @param backendClass A constructor function to create the backend.
* @param options Options for the client.
*/
function BaseClient(backendClass, options) {
/** Array of used integrations. */
this._integrations = {};
/** Number of calls being processed */
this._numProcessing = 0;
this._backend = new backendClass(options);
this._options = options;
if (options.dsn) {
this._dsn = utils_1.makeDsn(options.dsn);
}
}
/**
* @inheritDoc
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
BaseClient.prototype.captureException = function (exception, hint, scope) {
var _this = this;
// ensure we haven't captured this very object before
if (utils_1.checkOrSetAlreadyCaught(exception)) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.log(ALREADY_SEEN_ERROR);
return;
}
var eventId = hint && hint.event_id;
this._process(this._getBackend()
.eventFromException(exception, hint)
.then(function (event) { return _this._captureEvent(event, hint, scope); })
.then(function (result) {
eventId = result;
}));
return eventId;
};
/**
* @inheritDoc
*/
BaseClient.prototype.captureMessage = function (message, level, hint, scope) {
var _this = this;
var eventId = hint && hint.event_id;
var promisedEvent = utils_1.isPrimitive(message)
? this._getBackend().eventFromMessage(String(message), level, hint)
: this._getBackend().eventFromException(message, hint);
this._process(promisedEvent
.then(function (event) { return _this._captureEvent(event, hint, scope); })
.then(function (result) {
eventId = result;
}));
return eventId;
};
/**
* @inheritDoc
*/
BaseClient.prototype.captureEvent = function (event, hint, scope) {
// ensure we haven't captured this very object before
if (hint && hint.originalException && utils_1.checkOrSetAlreadyCaught(hint.originalException)) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.log(ALREADY_SEEN_ERROR);
return;
}
var eventId = hint && hint.event_id;
this._process(this._captureEvent(event, hint, scope).then(function (result) {
eventId = result;
}));
return eventId;
};
/**
* @inheritDoc
*/
BaseClient.prototype.captureSession = function (session) {
if (!this._isEnabled()) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.warn('SDK not enabled, will not capture session.');
return;
}
if (!(typeof session.release === 'string')) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.warn('Discarded session because of missing or non-string release');
}
else {
this._sendSession(session);
// After sending, we set init false to indicate it's not the first occurrence
session.update({ init: false });
}
};
/**
* @inheritDoc
*/
BaseClient.prototype.getDsn = function () {
return this._dsn;
};
/**
* @inheritDoc
*/
BaseClient.prototype.getOptions = function () {
return this._options;
};
/**
* @inheritDoc
*/
BaseClient.prototype.getTransport = function () {
return this._getBackend().getTransport();
};
/**
* @inheritDoc
*/
BaseClient.prototype.flush = function (timeout) {
var _this = this;
return this._isClientDoneProcessing(timeout).then(function (clientFinished) {
return _this.getTransport()
.close(timeout)
.then(function (transportFlushed) { return clientFinished && transportFlushed; });
});
};
/**
* @inheritDoc
*/
BaseClient.prototype.close = function (timeout) {
var _this = this;
return this.flush(timeout).then(function (result) {
_this.getOptions().enabled = false;
return result;
});
};
/**
* Sets up the integrations
*/
BaseClient.prototype.setupIntegrations = function () {
if (this._isEnabled() && !this._integrations.initialized) {
this._integrations = integration_1.setupIntegrations(this._options);
}
};
/**
* @inheritDoc
*/
BaseClient.prototype.getIntegration = function (integration) {
try {
return this._integrations[integration.id] || null;
}
catch (_oO) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.warn("Cannot retrieve integration " + integration.id + " from the current Client");
return null;
}
};
/** Updates existing session based on the provided event */
BaseClient.prototype._updateSessionFromEvent = function (session, event) {
var e_1, _a;
var crashed = false;
var errored = false;
var exceptions = event.exception && event.exception.values;
if (exceptions) {
errored = true;
try {
for (var exceptions_1 = tslib_1.__values(exceptions), exceptions_1_1 = exceptions_1.next(); !exceptions_1_1.done; exceptions_1_1 = exceptions_1.next()) {
var ex = exceptions_1_1.value;
var mechanism = ex.mechanism;
if (mechanism && mechanism.handled === false) {
crashed = true;
break;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (exceptions_1_1 && !exceptions_1_1.done && (_a = exceptions_1.return)) _a.call(exceptions_1);
}
finally { if (e_1) throw e_1.error; }
}
}
// A session is updated and that session update is sent in only one of the two following scenarios:
// 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update
// 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update
var sessionNonTerminal = session.status === 'ok';
var shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);
if (shouldUpdateAndSend) {
session.update(tslib_1.__assign(tslib_1.__assign({}, (crashed && { status: 'crashed' })), { errors: session.errors || Number(errored || crashed) }));
this.captureSession(session);
}
};
/** Deliver captured session to Sentry */
BaseClient.prototype._sendSession = function (session) {
this._getBackend().sendSession(session);
};
/**
* Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying
* "no" (resolving to `false`) in order to give the client a chance to potentially finish first.
*
* @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not
* passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
* `true`.
* @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and
* `false` otherwise
*/
BaseClient.prototype._isClientDoneProcessing = function (timeout) {
var _this = this;
return new utils_1.SyncPromise(function (resolve) {
var ticked = 0;
var tick = 1;
var interval = setInterval(function () {
if (_this._numProcessing == 0) {
clearInterval(interval);
resolve(true);
}
else {
ticked += tick;
if (timeout && ticked >= timeout) {
clearInterval(interval);
resolve(false);
}
}
}, tick);
});
};
/** Returns the current backend. */
BaseClient.prototype._getBackend = function () {
return this._backend;
};
/** Determines whether this SDK is enabled and a valid Dsn is present. */
BaseClient.prototype._isEnabled = function () {
return this.getOptions().enabled !== false && this._dsn !== undefined;
};
/**
* Adds common information to events.
*
* The information includes release and environment from `options`,
* breadcrumbs and context (extra, tags and user) from the scope.
*
* Information that is already present in the event is never overwritten. For
* nested objects, such as the context, keys are merged.
*
* @param event The original event.
* @param hint May contain additional information about the original exception.
* @param scope A scope containing event metadata.
* @returns A new event with more information.
*/
BaseClient.prototype._prepareEvent = function (event, scope, hint) {
var _this = this;
var _a = this.getOptions(), _b = _a.normalizeDepth, normalizeDepth = _b === void 0 ? 3 : _b, _c = _a.normalizeMaxBreadth, normalizeMaxBreadth = _c === void 0 ? 1000 : _c;
var prepared = tslib_1.__assign(tslib_1.__assign({}, event), { event_id: event.event_id || (hint && hint.event_id ? hint.event_id : utils_1.uuid4()), timestamp: event.timestamp || utils_1.dateTimestampInSeconds() });
this._applyClientOptions(prepared);
this._applyIntegrationsMetadata(prepared);
// If we have scope given to us, use it as the base for further modifications.
// This allows us to prevent unnecessary copying of data if `captureContext` is not provided.
var finalScope = scope;
if (hint && hint.captureContext) {
finalScope = hub_1.Scope.clone(finalScope).update(hint.captureContext);
}
// We prepare the result here with a resolved Event.
var result = utils_1.resolvedSyncPromise(prepared);
// This should be the last thing called, since we want that
// {@link Hub.addEventProcessor} gets the finished prepared event.
if (finalScope) {
// In case we have a hub we reassign it.
result = finalScope.applyToEvent(prepared, hint);
}
return result.then(function (evt) {
if (evt) {
// TODO this is more of the hack trying to solve https://github.com/getsentry/sentry-javascript/issues/2809
// it is only attached as extra data to the event if the event somehow skips being normalized
evt.sdkProcessingMetadata = tslib_1.__assign(tslib_1.__assign({}, evt.sdkProcessingMetadata), { normalizeDepth: utils_1.normalize(normalizeDepth) + " (" + typeof normalizeDepth + ")" });
}
if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {
return _this._normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
}
return evt;
});
};
/**
* Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.
* Normalized keys:
* - `breadcrumbs.data`
* - `user`
* - `contexts`
* - `extra`
* @param event Event
* @returns Normalized event
*/
BaseClient.prototype._normalizeEvent = function (event, depth, maxBreadth) {
if (!event) {
return null;
}
var normalized = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, event), (event.breadcrumbs && {
breadcrumbs: event.breadcrumbs.map(function (b) { return (tslib_1.__assign(tslib_1.__assign({}, b), (b.data && {
data: utils_1.normalize(b.data, depth, maxBreadth),
}))); }),
})), (event.user && {
user: utils_1.normalize(event.user, depth, maxBreadth),
})), (event.contexts && {
contexts: utils_1.normalize(event.contexts, depth, maxBreadth),
})), (event.extra && {
extra: utils_1.normalize(event.extra, depth, maxBreadth),
}));
// event.contexts.trace stores information about a Transaction. Similarly,
// event.spans[] stores information about child Spans. Given that a
// Transaction is conceptually a Span, normalization should apply to both
// Transactions and Spans consistently.
// For now the decision is to skip normalization of Transactions and Spans,
// so this block overwrites the normalized event to add back the original
// Transaction information prior to normalization.
if (event.contexts && event.contexts.trace) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
normalized.contexts.trace = event.contexts.trace;
}
normalized.sdkProcessingMetadata = tslib_1.__assign(tslib_1.__assign({}, normalized.sdkProcessingMetadata), { baseClientNormalized: true });
return normalized;
};
/**
* Enhances event using the client configuration.
* It takes care of all "static" values like environment, release and `dist`,
* as well as truncating overly long values.
* @param event event instance to be enhanced
*/
BaseClient.prototype._applyClientOptions = function (event) {
var options = this.getOptions();
var environment = options.environment, release = options.release, dist = options.dist, _a = options.maxValueLength, maxValueLength = _a === void 0 ? 250 : _a;
if (!('environment' in event)) {
event.environment = 'environment' in options ? environment : 'production';
}
if (event.release === undefined && release !== undefined) {
event.release = release;
}
if (event.dist === undefined && dist !== undefined) {
event.dist = dist;
}
if (event.message) {
event.message = utils_1.truncate(event.message, maxValueLength);
}
var exception = event.exception && event.exception.values && event.exception.values[0];
if (exception && exception.value) {
exception.value = utils_1.truncate(exception.value, maxValueLength);
}
var request = event.request;
if (request && request.url) {
request.url = utils_1.truncate(request.url, maxValueLength);
}
};
/**
* This function adds all used integrations to the SDK info in the event.
* @param event The event that will be filled with all integrations.
*/
BaseClient.prototype._applyIntegrationsMetadata = function (event) {
var integrationsArray = Object.keys(this._integrations);
if (integrationsArray.length > 0) {
event.sdk = event.sdk || {};
event.sdk.integrations = tslib_1.__spread((event.sdk.integrations || []), integrationsArray);
}
};
/**
* Tells the backend to send this event
* @param event The Sentry event to send
*/
BaseClient.prototype._sendEvent = function (event) {
this._getBackend().sendEvent(event);
};
/**
* Processes the event and logs an error in case of rejection
* @param event
* @param hint
* @param scope
*/
BaseClient.prototype._captureEvent = function (event, hint, scope) {
return this._processEvent(event, hint, scope).then(function (finalEvent) {
return finalEvent.event_id;
}, function (reason) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.error(reason);
return undefined;
});
};
/**
* Processes an event (either error or message) and sends it to Sentry.
*
* This also adds breadcrumbs and context information to the event. However,
* platform specific meta data (such as the User's IP address) must be added
* by the SDK implementor.
*
*
* @param event The event to send to Sentry.
* @param hint May contain additional information about the original exception.
* @param scope A scope containing event metadata.
* @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
*/
BaseClient.prototype._processEvent = function (event, hint, scope) {
var _this = this;
// eslint-disable-next-line @typescript-eslint/unbound-method
var _a = this.getOptions(), beforeSend = _a.beforeSend, sampleRate = _a.sampleRate;
var transport = this.getTransport();
function recordLostEvent(outcome, category) {
if (transport.recordLostEvent) {
transport.recordLostEvent(outcome, category);
}
}
if (!this._isEnabled()) {
return utils_1.rejectedSyncPromise(new utils_1.SentryError('SDK not enabled, will not capture event.'));
}
var isTransaction = event.type === 'transaction';
// 1.0 === 100% events are sent
// 0.0 === 0% events are sent
// Sampling for transaction happens somewhere else
if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) {
recordLostEvent('sample_rate', 'event');
return utils_1.rejectedSyncPromise(new utils_1.SentryError("Discarding event because it's not included in the random sample (sampling rate = " + sampleRate + ")"));
}
return this._prepareEvent(event, scope, hint)
.then(function (prepared) {
if (prepared === null) {
recordLostEvent('event_processor', event.type || 'event');
throw new utils_1.SentryError('An event processor returned null, will not send event.');
}
var isInternalException = hint && hint.data && hint.data.__sentry__ === true;
if (isInternalException || isTransaction || !beforeSend) {
return prepared;
}
var beforeSendResult = beforeSend(prepared, hint);
return _ensureBeforeSendRv(beforeSendResult);
})
.then(function (processedEvent) {
if (processedEvent === null) {
recordLostEvent('before_send', event.type || 'event');
throw new utils_1.SentryError('`beforeSend` returned `null`, will not send event.');
}
var session = scope && scope.getSession && scope.getSession();
if (!isTransaction && session) {
_this._updateSessionFromEvent(session, processedEvent);
}
_this._sendEvent(processedEvent);
return processedEvent;
})
.then(null, function (reason) {
if (reason instanceof utils_1.SentryError) {
throw reason;
}
_this.captureException(reason, {
data: {
__sentry__: true,
},
originalException: reason,
});
throw new utils_1.SentryError("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: " + reason);
});
};
/**
* Occupies the client with processing and event
*/
BaseClient.prototype._process = function (promise) {
var _this = this;
this._numProcessing += 1;
void promise.then(function (value) {
_this._numProcessing -= 1;
return value;
}, function (reason) {
_this._numProcessing -= 1;
return reason;
});
};
return BaseClient;
}());
exports.BaseClient = BaseClient;
/**
* Verifies that return value of configured `beforeSend` is of expected type.
*/
function _ensureBeforeSendRv(rv) {
var nullErr = '`beforeSend` method has to return `null` or a valid event.';
if (utils_1.isThenable(rv)) {
return rv.then(function (event) {
if (!(utils_1.isPlainObject(event) || event === null)) {
throw new utils_1.SentryError(nullErr);
}
return event;
}, function (e) {
throw new utils_1.SentryError("beforeSend rejected with " + e);
});
}
else if (!(utils_1.isPlainObject(rv) || rv === null)) {
throw new utils_1.SentryError(nullErr);
}
return rv;
}
//# sourceMappingURL=baseclient.js.map

1
node_modules/@sentry/core/dist/baseclient.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

3
node_modules/@sentry/core/dist/flags.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
/** Flag that is true for debug builds, false otherwise. */
export declare const IS_DEBUG_BUILD: boolean;
//# sourceMappingURL=flags.d.ts.map

1
node_modules/@sentry/core/dist/flags.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../src/flags.ts"],"names":[],"mappings":"AAgBA,2DAA2D;AAC3D,eAAO,MAAM,cAAc,SAAoE,CAAC"}

17
node_modules/@sentry/core/dist/flags.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
/*
* This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking
* for users.
*
* Debug flags need to be declared in each package individually and must not be imported across package boundaries,
* because some build tools have trouble tree-shaking imported guards.
*
* As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.
*
* Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during
* our, or the user's build process. Take care when introducing new flags - they must not throw if they are not
* replaced.
*/
Object.defineProperty(exports, "__esModule", { value: true });
/** Flag that is true for debug builds, false otherwise. */
exports.IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;
//# sourceMappingURL=flags.js.map

1
node_modules/@sentry/core/dist/flags.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;;AAIH,2DAA2D;AAC9C,QAAA,cAAc,GAAG,OAAO,gBAAgB,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC","sourcesContent":["/*\n * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking\n * for users.\n *\n * Debug flags need to be declared in each package individually and must not be imported across package boundaries,\n * because some build tools have trouble tree-shaking imported guards.\n *\n * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.\n *\n * Debug flag files will contain \"magic strings\" like `__SENTRY_DEBUG__` that may get replaced with actual values during\n * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not\n * replaced.\n */\n\ndeclare const __SENTRY_DEBUG__: boolean;\n\n/** Flag that is true for debug builds, false otherwise. */\nexport const IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;\n"]}

13
node_modules/@sentry/core/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
export { addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, } from '@sentry/minimal';
export { addGlobalEventProcessor, getCurrentHub, getHubFromCarrier, Hub, makeMain, Scope, Session } from '@sentry/hub';
export { API, APIDetails, getEnvelopeEndpointWithUrlEncodedAuth, getStoreEndpointWithUrlEncodedAuth, getRequestHeaders, initAPIDetails, getReportDialogEndpoint, } from './api';
export { BaseClient } from './baseclient';
export { BackendClass, BaseBackend } from './basebackend';
export { eventToSentryRequest, sessionToSentryRequest } from './request';
export { initAndBind, ClientClass } from './sdk';
export { NoopTransport } from './transports/noop';
export { BaseTransportOptions, createTransport, NewTransport, TransportMakeRequestResponse, TransportRequest, TransportRequestExecutor, } from './transports/base';
export { SDK_VERSION } from './version';
import * as Integrations from './integrations';
export { Integrations };
//# sourceMappingURL=index.d.ts.map

1
node_modules/@sentry/core/dist/index.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,iBAAiB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACvH,OAAO,EAEL,GAAG,EACH,UAAU,EACV,qCAAqC,EACrC,kCAAkC,EAClC,iBAAiB,EACjB,cAAc,EACd,uBAAuB,GACxB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,4BAA4B,EAC5B,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,CAAC"}

49
node_modules/@sentry/core/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,49 @@
Object.defineProperty(exports, "__esModule", { value: true });
var minimal_1 = require("@sentry/minimal");
exports.addBreadcrumb = minimal_1.addBreadcrumb;
exports.captureException = minimal_1.captureException;
exports.captureEvent = minimal_1.captureEvent;
exports.captureMessage = minimal_1.captureMessage;
exports.configureScope = minimal_1.configureScope;
exports.startTransaction = minimal_1.startTransaction;
exports.setContext = minimal_1.setContext;
exports.setExtra = minimal_1.setExtra;
exports.setExtras = minimal_1.setExtras;
exports.setTag = minimal_1.setTag;
exports.setTags = minimal_1.setTags;
exports.setUser = minimal_1.setUser;
exports.withScope = minimal_1.withScope;
var hub_1 = require("@sentry/hub");
exports.addGlobalEventProcessor = hub_1.addGlobalEventProcessor;
exports.getCurrentHub = hub_1.getCurrentHub;
exports.getHubFromCarrier = hub_1.getHubFromCarrier;
exports.Hub = hub_1.Hub;
exports.makeMain = hub_1.makeMain;
exports.Scope = hub_1.Scope;
exports.Session = hub_1.Session;
var api_1 = require("./api");
// eslint-disable-next-line deprecation/deprecation
exports.API = api_1.API;
exports.getEnvelopeEndpointWithUrlEncodedAuth = api_1.getEnvelopeEndpointWithUrlEncodedAuth;
exports.getStoreEndpointWithUrlEncodedAuth = api_1.getStoreEndpointWithUrlEncodedAuth;
exports.getRequestHeaders = api_1.getRequestHeaders;
exports.initAPIDetails = api_1.initAPIDetails;
exports.getReportDialogEndpoint = api_1.getReportDialogEndpoint;
var baseclient_1 = require("./baseclient");
exports.BaseClient = baseclient_1.BaseClient;
var basebackend_1 = require("./basebackend");
exports.BaseBackend = basebackend_1.BaseBackend;
var request_1 = require("./request");
exports.eventToSentryRequest = request_1.eventToSentryRequest;
exports.sessionToSentryRequest = request_1.sessionToSentryRequest;
var sdk_1 = require("./sdk");
exports.initAndBind = sdk_1.initAndBind;
var noop_1 = require("./transports/noop");
exports.NoopTransport = noop_1.NoopTransport;
var base_1 = require("./transports/base");
exports.createTransport = base_1.createTransport;
var version_1 = require("./version");
exports.SDK_VERSION = version_1.SDK_VERSION;
var Integrations = require("./integrations");
exports.Integrations = Integrations;
//# sourceMappingURL=index.js.map

1
node_modules/@sentry/core/dist/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,2CAcyB;AAbvB,kCAAA,aAAa,CAAA;AACb,qCAAA,gBAAgB,CAAA;AAChB,iCAAA,YAAY,CAAA;AACZ,mCAAA,cAAc,CAAA;AACd,mCAAA,cAAc,CAAA;AACd,qCAAA,gBAAgB,CAAA;AAChB,+BAAA,UAAU,CAAA;AACV,6BAAA,QAAQ,CAAA;AACR,8BAAA,SAAS,CAAA;AACT,2BAAA,MAAM,CAAA;AACN,4BAAA,OAAO,CAAA;AACP,4BAAA,OAAO,CAAA;AACP,8BAAA,SAAS,CAAA;AAEX,mCAAuH;AAA9G,wCAAA,uBAAuB,CAAA;AAAE,8BAAA,aAAa,CAAA;AAAE,kCAAA,iBAAiB,CAAA;AAAE,oBAAA,GAAG,CAAA;AAAE,yBAAA,QAAQ,CAAA;AAAE,sBAAA,KAAK,CAAA;AAAE,wBAAA,OAAO,CAAA;AACjG,6BASe;AARb,mDAAmD;AACnD,oBAAA,GAAG,CAAA;AAEH,sDAAA,qCAAqC,CAAA;AACrC,mDAAA,kCAAkC,CAAA;AAClC,kCAAA,iBAAiB,CAAA;AACjB,+BAAA,cAAc,CAAA;AACd,wCAAA,uBAAuB,CAAA;AAEzB,2CAA0C;AAAjC,kCAAA,UAAU,CAAA;AACnB,6CAA0D;AAAnC,oCAAA,WAAW,CAAA;AAClC,qCAAyE;AAAhE,yCAAA,oBAAoB,CAAA;AAAE,2CAAA,sBAAsB,CAAA;AACrD,6BAAiD;AAAxC,4BAAA,WAAW,CAAA;AACpB,0CAAkD;AAAzC,+BAAA,aAAa,CAAA;AACtB,0CAO2B;AALzB,iCAAA,eAAe,CAAA;AAMjB,qCAAwC;AAA/B,gCAAA,WAAW,CAAA;AAEpB,6CAA+C;AAEtC,oCAAY","sourcesContent":["export {\n addBreadcrumb,\n captureException,\n captureEvent,\n captureMessage,\n configureScope,\n startTransaction,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n withScope,\n} from '@sentry/minimal';\nexport { addGlobalEventProcessor, getCurrentHub, getHubFromCarrier, Hub, makeMain, Scope, Session } from '@sentry/hub';\nexport {\n // eslint-disable-next-line deprecation/deprecation\n API,\n APIDetails,\n getEnvelopeEndpointWithUrlEncodedAuth,\n getStoreEndpointWithUrlEncodedAuth,\n getRequestHeaders,\n initAPIDetails,\n getReportDialogEndpoint,\n} from './api';\nexport { BaseClient } from './baseclient';\nexport { BackendClass, BaseBackend } from './basebackend';\nexport { eventToSentryRequest, sessionToSentryRequest } from './request';\nexport { initAndBind, ClientClass } from './sdk';\nexport { NoopTransport } from './transports/noop';\nexport {\n BaseTransportOptions,\n createTransport,\n NewTransport,\n TransportMakeRequestResponse,\n TransportRequest,\n TransportRequestExecutor,\n} from './transports/base';\nexport { SDK_VERSION } from './version';\n\nimport * as Integrations from './integrations';\n\nexport { Integrations };\n"]}

20
node_modules/@sentry/core/dist/integration.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import { Integration, Options } from '@sentry/types';
export declare const installedIntegrations: string[];
/** Map of integrations assigned to a client */
export declare type IntegrationIndex = {
[key: string]: Integration;
} & {
initialized?: boolean;
};
/** Gets integration to install */
export declare function getIntegrationsToSetup(options: Options): Integration[];
/** Setup given integration */
export declare function setupIntegration(integration: Integration): void;
/**
* Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default
* integrations are added unless they were already provided before.
* @param integrations array of integration instances
* @param withDefault should enable default integrations
*/
export declare function setupIntegrations<O extends Options>(options: O): IntegrationIndex;
//# sourceMappingURL=integration.d.ts.map

1
node_modules/@sentry/core/dist/integration.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/integration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKrD,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAAO,CAAC;AAElD,+CAA+C;AAC/C,oBAAY,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC;CAC5B,GAAG;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAc9B,kCAAkC;AAClC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,EAAE,CA4BtE;AAED,8BAA8B;AAC9B,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAO/D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,gBAAgB,CAWjF"}

71
node_modules/@sentry/core/dist/integration.js generated vendored Normal file
View File

@@ -0,0 +1,71 @@
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var hub_1 = require("@sentry/hub");
var utils_1 = require("@sentry/utils");
var flags_1 = require("./flags");
exports.installedIntegrations = [];
/**
* @private
*/
function filterDuplicates(integrations) {
return integrations.reduce(function (acc, integrations) {
if (acc.every(function (accIntegration) { return integrations.name !== accIntegration.name; })) {
acc.push(integrations);
}
return acc;
}, []);
}
/** Gets integration to install */
function getIntegrationsToSetup(options) {
var defaultIntegrations = (options.defaultIntegrations && tslib_1.__spread(options.defaultIntegrations)) || [];
var userIntegrations = options.integrations;
var integrations = tslib_1.__spread(filterDuplicates(defaultIntegrations));
if (Array.isArray(userIntegrations)) {
// Filter out integrations that are also included in user options
integrations = tslib_1.__spread(integrations.filter(function (integrations) {
return userIntegrations.every(function (userIntegration) { return userIntegration.name !== integrations.name; });
}), filterDuplicates(userIntegrations));
}
else if (typeof userIntegrations === 'function') {
integrations = userIntegrations(integrations);
integrations = Array.isArray(integrations) ? integrations : [integrations];
}
// Make sure that if present, `Debug` integration will always run last
var integrationsNames = integrations.map(function (i) { return i.name; });
var alwaysLastToRun = 'Debug';
if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {
integrations.push.apply(integrations, tslib_1.__spread(integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1)));
}
return integrations;
}
exports.getIntegrationsToSetup = getIntegrationsToSetup;
/** Setup given integration */
function setupIntegration(integration) {
if (exports.installedIntegrations.indexOf(integration.name) !== -1) {
return;
}
integration.setupOnce(hub_1.addGlobalEventProcessor, hub_1.getCurrentHub);
exports.installedIntegrations.push(integration.name);
flags_1.IS_DEBUG_BUILD && utils_1.logger.log("Integration installed: " + integration.name);
}
exports.setupIntegration = setupIntegration;
/**
* Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default
* integrations are added unless they were already provided before.
* @param integrations array of integration instances
* @param withDefault should enable default integrations
*/
function setupIntegrations(options) {
var integrations = {};
getIntegrationsToSetup(options).forEach(function (integration) {
integrations[integration.name] = integration;
setupIntegration(integration);
});
// set the `initialized` flag so we don't run through the process again unecessarily; use `Object.defineProperty`
// because by default it creates a property which is nonenumerable, which we want since `initialized` shouldn't be
// considered a member of the index the way the actual integrations are
utils_1.addNonEnumerableProperty(integrations, 'initialized', true);
return integrations;
}
exports.setupIntegrations = setupIntegrations;
//# sourceMappingURL=integration.js.map

1
node_modules/@sentry/core/dist/integration.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,17 @@
import { Integration } from '@sentry/types';
/** Patch toString calls to return proper name for wrapped functions */
export declare class FunctionToString implements Integration {
/**
* @inheritDoc
*/
static id: string;
/**
* @inheritDoc
*/
name: string;
/**
* @inheritDoc
*/
setupOnce(): void;
}
//# sourceMappingURL=functiontostring.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"functiontostring.d.ts","sourceRoot":"","sources":["../../../src/integrations/functiontostring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAC;AAK7D,uEAAuE;AACvE,qBAAa,gBAAiB,YAAW,WAAW;IAClD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAsB;IAE9C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAuB;IAE1C;;OAEG;IACI,SAAS,IAAI,IAAI;CAUzB"}

View File

@@ -0,0 +1,35 @@
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("@sentry/utils");
var originalFunctionToString;
/** Patch toString calls to return proper name for wrapped functions */
var FunctionToString = /** @class */ (function () {
function FunctionToString() {
/**
* @inheritDoc
*/
this.name = FunctionToString.id;
}
/**
* @inheritDoc
*/
FunctionToString.prototype.setupOnce = function () {
// eslint-disable-next-line @typescript-eslint/unbound-method
originalFunctionToString = Function.prototype.toString;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Function.prototype.toString = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var context = utils_1.getOriginalFunction(this) || this;
return originalFunctionToString.apply(context, args);
};
};
/**
* @inheritDoc
*/
FunctionToString.id = 'FunctionToString';
return FunctionToString;
}());
exports.FunctionToString = FunctionToString;
//# sourceMappingURL=functiontostring.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"functiontostring.js","sourceRoot":"","sources":["../../../src/integrations/functiontostring.ts"],"names":[],"mappings":";AACA,uCAAoD;AAEpD,IAAI,wBAAoC,CAAC;AAEzC,uEAAuE;AACvE;IAAA;QAME;;WAEG;QACI,SAAI,GAAW,gBAAgB,CAAC,EAAE,CAAC;IAe5C,CAAC;IAbC;;OAEG;IACI,oCAAS,GAAhB;QACE,6DAA6D;QAC7D,wBAAwB,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;QAEvD,8DAA8D;QAC9D,QAAQ,CAAC,SAAS,CAAC,QAAQ,GAAG;YAAiC,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YAC3E,IAAM,OAAO,GAAG,2BAAmB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;YAClD,OAAO,wBAAwB,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC;IAtBD;;OAEG;IACW,mBAAE,GAAW,kBAAkB,CAAC;IAoBhD,uBAAC;CAAA,AAxBD,IAwBC;AAxBY,4CAAgB","sourcesContent":["import { Integration, WrappedFunction } from '@sentry/types';\nimport { getOriginalFunction } from '@sentry/utils';\n\nlet originalFunctionToString: () => void;\n\n/** Patch toString calls to return proper name for wrapped functions */\nexport class FunctionToString implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'FunctionToString';\n\n /**\n * @inheritDoc\n */\n public name: string = FunctionToString.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Function.prototype.toString = function (this: WrappedFunction, ...args: any[]): string {\n const context = getOriginalFunction(this) || this;\n return originalFunctionToString.apply(context, args);\n };\n }\n}\n"]}

View File

@@ -0,0 +1,34 @@
import { Event, EventProcessor, Hub, Integration } from '@sentry/types';
/** Options for the InboundFilters integration */
export interface InboundFiltersOptions {
allowUrls: Array<string | RegExp>;
denyUrls: Array<string | RegExp>;
ignoreErrors: Array<string | RegExp>;
ignoreInternal: boolean;
/** @deprecated use {@link InboundFiltersOptions.allowUrls} instead. */
whitelistUrls: Array<string | RegExp>;
/** @deprecated use {@link InboundFiltersOptions.denyUrls} instead. */
blacklistUrls: Array<string | RegExp>;
}
/** Inbound filters configurable by the user */
export declare class InboundFilters implements Integration {
private readonly _options;
/**
* @inheritDoc
*/
static id: string;
/**
* @inheritDoc
*/
name: string;
constructor(_options?: Partial<InboundFiltersOptions>);
/**
* @inheritDoc
*/
setupOnce(addGlobalEventProcessor: (processor: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
/** JSDoc */
export declare function _mergeOptions(internalOptions?: Partial<InboundFiltersOptions>, clientOptions?: Partial<InboundFiltersOptions>): Partial<InboundFiltersOptions>;
/** JSDoc */
export declare function _shouldDropEvent(event: Event, options: Partial<InboundFiltersOptions>): boolean;
//# sourceMappingURL=inboundfilters.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"inboundfilters.d.ts","sourceRoot":"","sources":["../../../src/integrations/inboundfilters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,WAAW,EAAc,MAAM,eAAe,CAAC;AASpF,iDAAiD;AACjD,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACjC,YAAY,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACrC,cAAc,EAAE,OAAO,CAAC;IAExB,uEAAuE;IACvE,aAAa,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACtC,sEAAsE;IACtE,aAAa,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CACvC;AAED,+CAA+C;AAC/C,qBAAa,cAAe,YAAW,WAAW;IAW7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAV5C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAoB;IAE5C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAqB;gBAEJ,QAAQ,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAEjF;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CAe/G;AAED,YAAY;AACZ,wBAAgB,aAAa,CAC3B,eAAe,GAAE,OAAO,CAAC,qBAAqB,CAAM,EACpD,aAAa,GAAE,OAAO,CAAC,qBAAqB,CAAM,GACjD,OAAO,CAAC,qBAAqB,CAAC,CAyBhC;AAED,YAAY;AACZ,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAgC/F"}

View File

@@ -0,0 +1,161 @@
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var utils_1 = require("@sentry/utils");
var flags_1 = require("../flags");
// "Script error." is hard coded into browsers for errors that it can't read.
// this is the result of a script being pulled in from an external domain and CORS.
var DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/];
/** Inbound filters configurable by the user */
var InboundFilters = /** @class */ (function () {
function InboundFilters(_options) {
if (_options === void 0) { _options = {}; }
this._options = _options;
/**
* @inheritDoc
*/
this.name = InboundFilters.id;
}
/**
* @inheritDoc
*/
InboundFilters.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) {
addGlobalEventProcessor(function (event) {
var hub = getCurrentHub();
if (hub) {
var self_1 = hub.getIntegration(InboundFilters);
if (self_1) {
var client = hub.getClient();
var clientOptions = client ? client.getOptions() : {};
var options = _mergeOptions(self_1._options, clientOptions);
return _shouldDropEvent(event, options) ? null : event;
}
}
return event;
});
};
/**
* @inheritDoc
*/
InboundFilters.id = 'InboundFilters';
return InboundFilters;
}());
exports.InboundFilters = InboundFilters;
/** JSDoc */
function _mergeOptions(internalOptions, clientOptions) {
if (internalOptions === void 0) { internalOptions = {}; }
if (clientOptions === void 0) { clientOptions = {}; }
return {
allowUrls: tslib_1.__spread((internalOptions.whitelistUrls || []), (internalOptions.allowUrls || []), (clientOptions.whitelistUrls || []), (clientOptions.allowUrls || [])),
denyUrls: tslib_1.__spread((internalOptions.blacklistUrls || []), (internalOptions.denyUrls || []), (clientOptions.blacklistUrls || []), (clientOptions.denyUrls || [])),
ignoreErrors: tslib_1.__spread((internalOptions.ignoreErrors || []), (clientOptions.ignoreErrors || []), DEFAULT_IGNORE_ERRORS),
ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,
};
}
exports._mergeOptions = _mergeOptions;
/** JSDoc */
function _shouldDropEvent(event, options) {
if (options.ignoreInternal && _isSentryError(event)) {
flags_1.IS_DEBUG_BUILD &&
utils_1.logger.warn("Event dropped due to being internal Sentry Error.\nEvent: " + utils_1.getEventDescription(event));
return true;
}
if (_isIgnoredError(event, options.ignoreErrors)) {
flags_1.IS_DEBUG_BUILD &&
utils_1.logger.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: " + utils_1.getEventDescription(event));
return true;
}
if (_isDeniedUrl(event, options.denyUrls)) {
flags_1.IS_DEBUG_BUILD &&
utils_1.logger.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: " + utils_1.getEventDescription(event) + ".\nUrl: " + _getEventFilterUrl(event));
return true;
}
if (!_isAllowedUrl(event, options.allowUrls)) {
flags_1.IS_DEBUG_BUILD &&
utils_1.logger.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: " + utils_1.getEventDescription(event) + ".\nUrl: " + _getEventFilterUrl(event));
return true;
}
return false;
}
exports._shouldDropEvent = _shouldDropEvent;
function _isIgnoredError(event, ignoreErrors) {
if (!ignoreErrors || !ignoreErrors.length) {
return false;
}
return _getPossibleEventMessages(event).some(function (message) {
return ignoreErrors.some(function (pattern) { return utils_1.isMatchingPattern(message, pattern); });
});
}
function _isDeniedUrl(event, denyUrls) {
// TODO: Use Glob instead?
if (!denyUrls || !denyUrls.length) {
return false;
}
var url = _getEventFilterUrl(event);
return !url ? false : denyUrls.some(function (pattern) { return utils_1.isMatchingPattern(url, pattern); });
}
function _isAllowedUrl(event, allowUrls) {
// TODO: Use Glob instead?
if (!allowUrls || !allowUrls.length) {
return true;
}
var url = _getEventFilterUrl(event);
return !url ? true : allowUrls.some(function (pattern) { return utils_1.isMatchingPattern(url, pattern); });
}
function _getPossibleEventMessages(event) {
if (event.message) {
return [event.message];
}
if (event.exception) {
try {
var _a = (event.exception.values && event.exception.values[0]) || {}, _b = _a.type, type = _b === void 0 ? '' : _b, _c = _a.value, value = _c === void 0 ? '' : _c;
return ["" + value, type + ": " + value];
}
catch (oO) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.error("Cannot extract message for event " + utils_1.getEventDescription(event));
return [];
}
}
return [];
}
function _isSentryError(event) {
try {
// @ts-ignore can't be a sentry error if undefined
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return event.exception.values[0].type === 'SentryError';
}
catch (e) {
// ignore
}
return false;
}
function _getLastValidUrl(frames) {
if (frames === void 0) { frames = []; }
for (var i = frames.length - 1; i >= 0; i--) {
var frame = frames[i];
if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') {
return frame.filename || null;
}
}
return null;
}
function _getEventFilterUrl(event) {
try {
if (event.stacktrace) {
return _getLastValidUrl(event.stacktrace.frames);
}
var frames_1;
try {
// @ts-ignore we only care about frames if the whole thing here is defined
frames_1 = event.exception.values[0].stacktrace.frames;
}
catch (e) {
// ignore
}
return frames_1 ? _getLastValidUrl(frames_1) : null;
}
catch (oO) {
flags_1.IS_DEBUG_BUILD && utils_1.logger.error("Cannot extract url for event " + utils_1.getEventDescription(event));
return null;
}
}
//# sourceMappingURL=inboundfilters.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
export { FunctionToString } from './functiontostring';
export { InboundFilters } from './inboundfilters';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}

6
node_modules/@sentry/core/dist/integrations/index.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
Object.defineProperty(exports, "__esModule", { value: true });
var functiontostring_1 = require("./functiontostring");
exports.FunctionToString = functiontostring_1.FunctionToString;
var inboundfilters_1 = require("./inboundfilters");
exports.InboundFilters = inboundfilters_1.InboundFilters;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/index.ts"],"names":[],"mappings":";AAAA,uDAAsD;AAA7C,8CAAA,gBAAgB,CAAA;AACzB,mDAAkD;AAAzC,0CAAA,cAAc,CAAA","sourcesContent":["export { FunctionToString } from './functiontostring';\nexport { InboundFilters } from './inboundfilters';\n"]}

14
node_modules/@sentry/core/dist/request.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import { Event, EventEnvelope, SentryRequest, SentryRequestType, Session, SessionAggregates, SessionEnvelope } from '@sentry/types';
import { APIDetails } from './api';
/** Creates an envelope from a Session */
export declare function createSessionEnvelope(session: Session | SessionAggregates, api: APIDetails): [SessionEnvelope, SentryRequestType];
/** Creates a SentryRequest from a Session. */
export declare function sessionToSentryRequest(session: Session | SessionAggregates, api: APIDetails): SentryRequest;
/**
* Create an Envelope from an event. Note that this is duplicated from below,
* but on purpose as this will be refactored in v7.
*/
export declare function createEventEnvelope(event: Event, api: APIDetails): EventEnvelope;
/** Creates a SentryRequest from an event. */
export declare function eventToSentryRequest(event: Event, api: APIDetails): SentryRequest;
//# sourceMappingURL=request.d.ts.map

1
node_modules/@sentry/core/dist/request.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,aAAa,EAGb,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,iBAAiB,EACjB,eAAe,EAEhB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAA6E,MAAM,OAAO,CAAC;AA2B9G,yCAAyC;AACzC,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,GAAG,iBAAiB,EACpC,GAAG,EAAE,UAAU,GACd,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAgBtC;AAED,8CAA8C;AAC9C,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB,EAAE,GAAG,EAAE,UAAU,GAAG,aAAa,CAO3G;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,GAAG,aAAa,CAkDhF;AAED,6CAA6C;AAC7C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,GAAG,aAAa,CAgGjF"}

183
node_modules/@sentry/core/dist/request.js generated vendored Normal file
View File

@@ -0,0 +1,183 @@
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var utils_1 = require("@sentry/utils");
var api_1 = require("./api");
/** Extract sdk info from from the API metadata */
function getSdkMetadataForEnvelopeHeader(api) {
if (!api.metadata || !api.metadata.sdk) {
return;
}
var _a = api.metadata.sdk, name = _a.name, version = _a.version;
return { name: name, version: version };
}
/**
* Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.
* Merge with existing data if any.
**/
function enhanceEventWithSdkInfo(event, sdkInfo) {
if (!sdkInfo) {
return event;
}
event.sdk = event.sdk || {};
event.sdk.name = event.sdk.name || sdkInfo.name;
event.sdk.version = event.sdk.version || sdkInfo.version;
event.sdk.integrations = tslib_1.__spread((event.sdk.integrations || []), (sdkInfo.integrations || []));
event.sdk.packages = tslib_1.__spread((event.sdk.packages || []), (sdkInfo.packages || []));
return event;
}
/** Creates an envelope from a Session */
function createSessionEnvelope(session, api) {
var sdkInfo = getSdkMetadataForEnvelopeHeader(api);
var envelopeHeaders = tslib_1.__assign(tslib_1.__assign({ sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: utils_1.dsnToString(api.dsn) }));
// I know this is hacky but we don't want to add `sessions` to request type since it's never rate limited
var type = 'aggregates' in session ? 'sessions' : 'session';
// TODO (v7) Have to cast type because envelope items do not accept a `SentryRequestType`
var envelopeItem = [{ type: type }, session];
var envelope = utils_1.createEnvelope(envelopeHeaders, [envelopeItem]);
return [envelope, type];
}
exports.createSessionEnvelope = createSessionEnvelope;
/** Creates a SentryRequest from a Session. */
function sessionToSentryRequest(session, api) {
var _a = tslib_1.__read(createSessionEnvelope(session, api), 2), envelope = _a[0], type = _a[1];
return {
body: utils_1.serializeEnvelope(envelope),
type: type,
url: api_1.getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel),
};
}
exports.sessionToSentryRequest = sessionToSentryRequest;
/**
* Create an Envelope from an event. Note that this is duplicated from below,
* but on purpose as this will be refactored in v7.
*/
function createEventEnvelope(event, api) {
var sdkInfo = getSdkMetadataForEnvelopeHeader(api);
var eventType = event.type || 'event';
var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling;
var _a = transactionSampling || {}, samplingMethod = _a.method, sampleRate = _a.rate;
// TODO: Below is a temporary hack in order to debug a serialization error - see
// https://github.com/getsentry/sentry-javascript/issues/2809,
// https://github.com/getsentry/sentry-javascript/pull/4425, and
// https://github.com/getsentry/sentry-javascript/pull/4574.
//
// TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to
// throw a circular reference error.
//
// When it's time to remove it:
// 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting
// `sdkProcessingMetadata`
// 2. Restore the original version of the request body, which is commented out
// 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the
// baseClient tests in this package
enhanceEventWithSdkInfo(event, api.metadata.sdk);
event.tags = event.tags || {};
event.extra = event.extra || {};
// In theory, all events should be marked as having gone through normalization and so
// we should never set this tag/extra data
if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) {
event.tags.skippedNormalization = true;
event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset';
}
// prevent this data from being sent to sentry
// TODO: This is NOT part of the hack - DO NOT DELETE
delete event.sdkProcessingMetadata;
var envelopeHeaders = tslib_1.__assign(tslib_1.__assign({ event_id: event.event_id, sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: utils_1.dsnToString(api.dsn) }));
var eventItem = [
{
type: eventType,
sample_rates: [{ id: samplingMethod, rate: sampleRate }],
},
event,
];
return utils_1.createEnvelope(envelopeHeaders, [eventItem]);
}
exports.createEventEnvelope = createEventEnvelope;
/** Creates a SentryRequest from an event. */
function eventToSentryRequest(event, api) {
var sdkInfo = getSdkMetadataForEnvelopeHeader(api);
var eventType = event.type || 'event';
var useEnvelope = eventType === 'transaction' || !!api.tunnel;
var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling;
var _a = transactionSampling || {}, samplingMethod = _a.method, sampleRate = _a.rate;
// TODO: Below is a temporary hack in order to debug a serialization error - see
// https://github.com/getsentry/sentry-javascript/issues/2809,
// https://github.com/getsentry/sentry-javascript/pull/4425, and
// https://github.com/getsentry/sentry-javascript/pull/4574.
//
// TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to
// throw a circular reference error.
//
// When it's time to remove it:
// 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting
// `sdkProcessingMetadata`
// 2. Restore the original version of the request body, which is commented out
// 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the
// baseClient tests in this package
enhanceEventWithSdkInfo(event, api.metadata.sdk);
event.tags = event.tags || {};
event.extra = event.extra || {};
// In theory, all events should be marked as having gone through normalization and so
// we should never set this tag/extra data
if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) {
event.tags.skippedNormalization = true;
event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset';
}
// prevent this data from being sent to sentry
// TODO: This is NOT part of the hack - DO NOT DELETE
delete event.sdkProcessingMetadata;
var body;
try {
// 99.9% of events should get through just fine - no change in behavior for them
body = JSON.stringify(event);
}
catch (err) {
// Record data about the error without replacing original event data, then force renormalization
event.tags.JSONStringifyError = true;
event.extra.JSONStringifyError = err;
try {
body = JSON.stringify(utils_1.normalize(event));
}
catch (newErr) {
// At this point even renormalization hasn't worked, meaning something about the event data has gone very wrong.
// Time to cut our losses and record only the new error. With luck, even in the problematic cases we're trying to
// debug with this hack, we won't ever land here.
var innerErr = newErr;
body = JSON.stringify({
message: 'JSON.stringify error after renormalization',
// setting `extra: { innerErr }` here for some reason results in an empty object, so unpack manually
extra: { message: innerErr.message, stack: innerErr.stack },
});
}
}
var req = {
// this is the relevant line of code before the hack was added, to make it easy to undo said hack once we've solved
// the mystery
// body: JSON.stringify(sdkInfo ? enhanceEventWithSdkInfo(event, api.metadata.sdk) : event),
body: body,
type: eventType,
url: useEnvelope
? api_1.getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel)
: api_1.getStoreEndpointWithUrlEncodedAuth(api.dsn),
};
// https://develop.sentry.dev/sdk/envelopes/
// Since we don't need to manipulate envelopes nor store them, there is no
// exported concept of an Envelope with operations including serialization and
// deserialization. Instead, we only implement a minimal subset of the spec to
// serialize events inline here.
if (useEnvelope) {
var envelopeHeaders = tslib_1.__assign(tslib_1.__assign({ event_id: event.event_id, sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: utils_1.dsnToString(api.dsn) }));
var eventItem = [
{
type: eventType,
sample_rates: [{ id: samplingMethod, rate: sampleRate }],
},
req.body,
];
var envelope = utils_1.createEnvelope(envelopeHeaders, [eventItem]);
req.body = utils_1.serializeEnvelope(envelope);
}
return req;
}
exports.eventToSentryRequest = eventToSentryRequest;
//# sourceMappingURL=request.js.map

1
node_modules/@sentry/core/dist/request.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

12
node_modules/@sentry/core/dist/sdk.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import { Client, Options } from '@sentry/types';
/** A class object that can instantiate Client objects. */
export declare type ClientClass<F extends Client, O extends Options> = new (options: O) => F;
/**
* Internal function to create a new SDK client instance. The client is
* installed and then bound to the current scope.
*
* @param clientClass The client class to instantiate.
* @param options Options to pass to the client.
*/
export declare function initAndBind<F extends Client, O extends Options>(clientClass: ClientClass<F, O>, options: O): void;
//# sourceMappingURL=sdk.d.ts.map

1
node_modules/@sentry/core/dist/sdk.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKhD,0DAA0D;AAC1D,oBAAY,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,IAAI,KAAK,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;AAErF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAiBjH"}

32
node_modules/@sentry/core/dist/sdk.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
Object.defineProperty(exports, "__esModule", { value: true });
var hub_1 = require("@sentry/hub");
var utils_1 = require("@sentry/utils");
var flags_1 = require("./flags");
/**
* Internal function to create a new SDK client instance. The client is
* installed and then bound to the current scope.
*
* @param clientClass The client class to instantiate.
* @param options Options to pass to the client.
*/
function initAndBind(clientClass, options) {
if (options.debug === true) {
if (flags_1.IS_DEBUG_BUILD) {
utils_1.logger.enable();
}
else {
// use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped
// eslint-disable-next-line no-console
console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');
}
}
var hub = hub_1.getCurrentHub();
var scope = hub.getScope();
if (scope) {
scope.update(options.initialScope);
}
var client = new clientClass(options);
hub.bindClient(client);
}
exports.initAndBind = initAndBind;
//# sourceMappingURL=sdk.js.map

1
node_modules/@sentry/core/dist/sdk.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":";AAAA,mCAA4C;AAE5C,uCAAuC;AAEvC,iCAAyC;AAKzC;;;;;;GAMG;AACH,SAAgB,WAAW,CAAsC,WAA8B,EAAE,OAAU;IACzG,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,EAAE;QAC1B,IAAI,sBAAc,EAAE;YAClB,cAAM,CAAC,MAAM,EAAE,CAAC;SACjB;aAAM;YACL,kHAAkH;YAClH,sCAAsC;YACtC,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;SAC9F;KACF;IACD,IAAM,GAAG,GAAG,mBAAa,EAAE,CAAC;IAC5B,IAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC7B,IAAI,KAAK,EAAE;QACT,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;KACpC;IACD,IAAM,MAAM,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;IACxC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC;AAjBD,kCAiBC","sourcesContent":["import { getCurrentHub } from '@sentry/hub';\nimport { Client, Options } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { IS_DEBUG_BUILD } from './flags';\n\n/** A class object that can instantiate Client objects. */\nexport type ClientClass<F extends Client, O extends Options> = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind<F extends Client, O extends Options>(clientClass: ClientClass<F, O>, options: O): void {\n if (options.debug === true) {\n if (IS_DEBUG_BUILD) {\n logger.enable();\n } else {\n // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n }\n }\n const hub = getCurrentHub();\n const scope = hub.getScope();\n if (scope) {\n scope.update(options.initialScope);\n }\n const client = new clientClass(options);\n hub.bindClient(client);\n}\n"]}

51
node_modules/@sentry/core/dist/transports/base.d.ts generated vendored Normal file
View File

@@ -0,0 +1,51 @@
import { Envelope, EventStatus } from '@sentry/types';
import { PromiseBuffer } from '@sentry/utils';
export declare const ERROR_TRANSPORT_CATEGORY = "error";
export declare const TRANSACTION_TRANSPORT_CATEGORY = "transaction";
export declare const ATTACHMENT_TRANSPORT_CATEGORY = "attachment";
export declare const SESSION_TRANSPORT_CATEGORY = "session";
declare type TransportCategory = typeof ERROR_TRANSPORT_CATEGORY | typeof TRANSACTION_TRANSPORT_CATEGORY | typeof ATTACHMENT_TRANSPORT_CATEGORY | typeof SESSION_TRANSPORT_CATEGORY;
export declare type TransportRequest = {
body: string;
category: TransportCategory;
};
export declare type TransportMakeRequestResponse = {
body?: string;
headers?: {
[key: string]: string | null;
'x-sentry-rate-limits': string | null;
'retry-after': string | null;
};
reason?: string;
statusCode: number;
};
export declare type TransportResponse = {
status: EventStatus;
reason?: string;
};
interface InternalBaseTransportOptions {
bufferSize?: number;
}
export interface BaseTransportOptions extends InternalBaseTransportOptions {
url: string;
}
export interface BrowserTransportOptions extends BaseTransportOptions {
fetchParams: Record<string, string>;
headers?: Record<string, string>;
sendClientReports?: boolean;
}
export interface NewTransport {
send(request: Envelope): PromiseLike<TransportResponse>;
flush(timeout?: number): PromiseLike<boolean>;
}
export declare type TransportRequestExecutor = (request: TransportRequest) => PromiseLike<TransportMakeRequestResponse>;
export declare const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;
/**
* Creates a `NewTransport`
*
* @param options
* @param makeRequest
*/
export declare function createTransport(options: InternalBaseTransportOptions, makeRequest: TransportRequestExecutor, buffer?: PromiseBuffer<TransportResponse>): NewTransport;
export {};
//# sourceMappingURL=base.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/transports/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAML,aAAa,EAMd,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,wBAAwB,UAAU,CAAC;AAEhD,eAAO,MAAM,8BAA8B,gBAAgB,CAAC;AAE5D,eAAO,MAAM,6BAA6B,eAAe,CAAC;AAE1D,eAAO,MAAM,0BAA0B,YAAY,CAAC;AAEpD,aAAK,iBAAiB,GAClB,OAAO,wBAAwB,GAC/B,OAAO,8BAA8B,GACrC,OAAO,6BAA6B,GACpC,OAAO,0BAA0B,CAAC;AAEtC,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;QAC7B,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;QACtC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,UAAU,4BAA4B;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAqB,SAAQ,4BAA4B;IAIxE,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IAEnE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACxD,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;CAC/C;AAED,oBAAY,wBAAwB,GAAG,CAAC,OAAO,EAAE,gBAAgB,KAAK,WAAW,CAAC,4BAA4B,CAAC,CAAC;AAEhH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,4BAA4B,EACrC,WAAW,EAAE,wBAAwB,EACrC,MAAM,GAAE,aAAa,CAAC,iBAAiB,CAA0E,GAChH,YAAY,CA8Cd"}

61
node_modules/@sentry/core/dist/transports/base.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("@sentry/utils");
exports.ERROR_TRANSPORT_CATEGORY = 'error';
exports.TRANSACTION_TRANSPORT_CATEGORY = 'transaction';
exports.ATTACHMENT_TRANSPORT_CATEGORY = 'attachment';
exports.SESSION_TRANSPORT_CATEGORY = 'session';
exports.DEFAULT_TRANSPORT_BUFFER_SIZE = 30;
/**
* Creates a `NewTransport`
*
* @param options
* @param makeRequest
*/
function createTransport(options, makeRequest, buffer) {
if (buffer === void 0) { buffer = utils_1.makePromiseBuffer(options.bufferSize || exports.DEFAULT_TRANSPORT_BUFFER_SIZE); }
var rateLimits = {};
var flush = function (timeout) { return buffer.drain(timeout); };
function send(envelope) {
var envCategory = utils_1.getEnvelopeType(envelope);
var category = envCategory === 'event' ? 'error' : envCategory;
var request = {
category: category,
body: utils_1.serializeEnvelope(envelope),
};
// Don't add to buffer if transport is already rate-limited
if (utils_1.isRateLimited(rateLimits, category)) {
return utils_1.rejectedSyncPromise({
status: 'rate_limit',
reason: getRateLimitReason(rateLimits, category),
});
}
var requestTask = function () {
return makeRequest(request).then(function (_a) {
var body = _a.body, headers = _a.headers, reason = _a.reason, statusCode = _a.statusCode;
var status = utils_1.eventStatusFromHttpCode(statusCode);
if (headers) {
rateLimits = utils_1.updateRateLimits(rateLimits, headers);
}
if (status === 'success') {
return utils_1.resolvedSyncPromise({ status: status, reason: reason });
}
return utils_1.rejectedSyncPromise({
status: status,
reason: reason ||
body ||
(status === 'rate_limit' ? getRateLimitReason(rateLimits, category) : 'Unknown transport error'),
});
});
};
return buffer.add(requestTask);
}
return {
send: send,
flush: flush,
};
}
exports.createTransport = createTransport;
function getRateLimitReason(rateLimits, category) {
return "Too many " + category + " requests, backing off until: " + new Date(utils_1.disabledUntil(rateLimits, category)).toISOString();
}
//# sourceMappingURL=base.js.map

File diff suppressed because one or more lines are too long

13
node_modules/@sentry/core/dist/transports/noop.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import { Event, Response, Transport } from '@sentry/types';
/** Noop transport */
export declare class NoopTransport implements Transport {
/**
* @inheritDoc
*/
sendEvent(_: Event): PromiseLike<Response>;
/**
* @inheritDoc
*/
close(_?: number): PromiseLike<boolean>;
}
//# sourceMappingURL=noop.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../src/transports/noop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG3D,qBAAqB;AACrB,qBAAa,aAAc,YAAW,SAAS;IAC7C;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC;IAOjD;;OAEG;IACI,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;CAG/C"}

25
node_modules/@sentry/core/dist/transports/noop.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("@sentry/utils");
/** Noop transport */
var NoopTransport = /** @class */ (function () {
function NoopTransport() {
}
/**
* @inheritDoc
*/
NoopTransport.prototype.sendEvent = function (_) {
return utils_1.resolvedSyncPromise({
reason: 'NoopTransport: Event has been skipped because no Dsn is configured.',
status: 'skipped',
});
};
/**
* @inheritDoc
*/
NoopTransport.prototype.close = function (_) {
return utils_1.resolvedSyncPromise(true);
};
return NoopTransport;
}());
exports.NoopTransport = NoopTransport;
//# sourceMappingURL=noop.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"noop.js","sourceRoot":"","sources":["../../../src/transports/noop.ts"],"names":[],"mappings":";AACA,uCAAoD;AAEpD,qBAAqB;AACrB;IAAA;IAiBA,CAAC;IAhBC;;OAEG;IACI,iCAAS,GAAhB,UAAiB,CAAQ;QACvB,OAAO,2BAAmB,CAAC;YACzB,MAAM,EAAE,qEAAqE;YAC7E,MAAM,EAAE,SAAS;SAClB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,6BAAK,GAAZ,UAAa,CAAU;QACrB,OAAO,2BAAmB,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACH,oBAAC;AAAD,CAAC,AAjBD,IAiBC;AAjBY,sCAAa","sourcesContent":["import { Event, Response, Transport } from '@sentry/types';\nimport { resolvedSyncPromise } from '@sentry/utils';\n\n/** Noop transport */\nexport class NoopTransport implements Transport {\n /**\n * @inheritDoc\n */\n public sendEvent(_: Event): PromiseLike<Response> {\n return resolvedSyncPromise({\n reason: 'NoopTransport: Event has been skipped because no Dsn is configured.',\n status: 'skipped',\n });\n }\n\n /**\n * @inheritDoc\n */\n public close(_?: number): PromiseLike<boolean> {\n return resolvedSyncPromise(true);\n }\n}\n"]}

2
node_modules/@sentry/core/dist/version.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare const SDK_VERSION = "6.19.7";
//# sourceMappingURL=version.d.ts.map

1
node_modules/@sentry/core/dist/version.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,WAAW,CAAC"}

3
node_modules/@sentry/core/dist/version.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.SDK_VERSION = '6.19.7';
//# sourceMappingURL=version.js.map

1
node_modules/@sentry/core/dist/version.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAa,QAAA,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_VERSION = '6.19.7';\n"]}