芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/app.optimyar.com/backend/node_modules/@sentry/node/esm/sdk.js
import { __awaiter, __generator } from "tslib"; import { getCurrentHub, initAndBind, Integrations as CoreIntegrations } from '@sentry/core'; import { getMainCarrier, setHubOnCarrier } from '@sentry/hub'; import { getGlobalObject } from '@sentry/utils'; import * as domain from 'domain'; import { NodeClient } from './client'; import { Console, Http, LinkedErrors, OnUncaughtException, OnUnhandledRejection } from './integrations'; export var defaultIntegrations = [ // Common new CoreIntegrations.InboundFilters(), new CoreIntegrations.FunctionToString(), // Native Wrappers new Console(), new Http(), // Global Handlers new OnUncaughtException(), new OnUnhandledRejection(), // Misc new LinkedErrors(), ]; /** * The Sentry Node SDK Client. * * To use this SDK, call the {@link init} function as early as possible in the * main entry module. To set context information or send manual events, use the * provided methods. * * @example * ``` * * const { init } = require('@sentry/node'); * * init({ * dsn: '__DSN__', * // ... * }); * ``` * * @example * ``` * * const { configureScope } = require('@sentry/node'); * configureScope((scope: Scope) => { * scope.setExtra({ battery: 0.7 }); * scope.setTag({ user_mode: 'admin' }); * scope.setUser({ id: '4711' }); * }); * ``` * * @example * ``` * * const { addBreadcrumb } = require('@sentry/node'); * addBreadcrumb({ * message: 'My Breadcrumb', * // ... * }); * ``` * * @example * ``` * * const Sentry = require('@sentry/node'); * Sentry.captureMessage('Hello, world!'); * Sentry.captureException(new Error('Good bye')); * Sentry.captureEvent({ * message: 'Manual', * stacktrace: [ * // ... * ], * }); * ``` * * @see {@link NodeOptions} for documentation on configuration options. */ export function init(options) { if (options === void 0) { options = {}; } if (options.defaultIntegrations === undefined) { options.defaultIntegrations = defaultIntegrations; } if (options.dsn === undefined && process.env.SENTRY_DSN) { options.dsn = process.env.SENTRY_DSN; } if (options.tracesSampleRate === undefined && process.env.SENTRY_TRACES_SAMPLE_RATE) { var tracesSampleRate = parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE); if (isFinite(tracesSampleRate)) { options.tracesSampleRate = tracesSampleRate; } } if (options.release === undefined) { var global_1 = getGlobalObject(); // Prefer env var over global if (process.env.SENTRY_RELEASE) { options.release = process.env.SENTRY_RELEASE; } // This supports the variable that sentry-webpack-plugin injects else if (global_1.SENTRY_RELEASE && global_1.SENTRY_RELEASE.id) { options.release = global_1.SENTRY_RELEASE.id; } } if (options.environment === undefined && process.env.SENTRY_ENVIRONMENT) { options.environment = process.env.SENTRY_ENVIRONMENT; } // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any if (domain.active) { setHubOnCarrier(getMainCarrier(), getCurrentHub()); } initAndBind(NodeClient, options); } /** * This is the getter for lastEventId. * * @returns The last event id of a captured event. */ export function lastEventId() { return getCurrentHub().lastEventId(); } /** * A promise that resolves when all current events have been sent. * If you provide a timeout and the queue takes longer to drain the promise returns false. * * @param timeout Maximum time in ms the client should wait. */ export function flush(timeout) { return __awaiter(this, void 0, void 0, function () { var client; return __generator(this, function (_a) { client = getCurrentHub().getClient(); if (client) { return [2 /*return*/, client.flush(timeout)]; } return [2 /*return*/, Promise.reject(false)]; }); }); } /** * A promise that resolves when all current events have been sent. * If you provide a timeout and the queue takes longer to drain the promise returns false. * * @param timeout Maximum time in ms the client should wait. */ export function close(timeout) { return __awaiter(this, void 0, void 0, function () { var client; return __generator(this, function (_a) { client = getCurrentHub().getClient(); if (client) { return [2 /*return*/, client.close(timeout)]; } return [2 /*return*/, Promise.reject(false)]; }); }); } //# sourceMappingURL=sdk.js.map