Skip to content
Snippets Groups Projects
index.js 8.95 MiB
Newer Older
  • Learn to ignore specific revisions
  •       'removeEventListener',
          function (originalRemoveEventListener) {
            return function (
    
              type,
              listener,
              options,
            ) {
              if (type === 'click' || type == 'keypress') {
                try {
                  const el = this ;
                  const handlers = el.__sentry_instrumentation_handlers__ || {};
                  const handlerForType = handlers[type];
    
                  if (handlerForType) {
                    handlerForType.refCount--;
                    // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.
                    if (handlerForType.refCount <= 0) {
                      originalRemoveEventListener.call(this, type, handlerForType.handler, options);
                      handlerForType.handler = undefined;
                      delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete
                    }
    
                    // If there are no longer any custom handlers of any type on this element, cleanup everything.
                    if (Object.keys(handlers).length === 0) {
                      delete el.__sentry_instrumentation_handlers__;
                    }
                  }
                } catch (e) {
                  // Accessing dom properties is always fragile.
                  // Also allows us to skip `addEventListenrs` calls with no proper `this` context.
                }
              }
    
              return originalRemoveEventListener.call(this, type, listener, options);
            };
          },
        );
      });
    }
    
    let _oldOnErrorHandler = null;
    /** JSDoc */
    function instrumentError() {
      _oldOnErrorHandler = WINDOW.onerror;
    
      WINDOW.onerror = function (msg, url, line, column, error) {
        triggerHandlers('error', {
          column,
          error,
          line,
          msg,
          url,
    
        if (_oldOnErrorHandler) {
          // eslint-disable-next-line prefer-rest-params
          return _oldOnErrorHandler.apply(this, arguments);
        }
    
    let _oldOnUnhandledRejectionHandler = null;
    /** JSDoc */
    function instrumentUnhandledRejection() {
      _oldOnUnhandledRejectionHandler = WINDOW.onunhandledrejection;
    
      WINDOW.onunhandledrejection = function (e) {
        triggerHandlers('unhandledrejection', e);
    
        if (_oldOnUnhandledRejectionHandler) {
          // eslint-disable-next-line prefer-rest-params
          return _oldOnUnhandledRejectionHandler.apply(this, arguments);
    
    //# sourceMappingURL=instrument.js.map
    
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "isNativeFetch": () => (/* binding */ isNativeFetch),
    /* harmony export */   "supportsDOMError": () => (/* binding */ supportsDOMError),
    /* harmony export */   "supportsDOMException": () => (/* binding */ supportsDOMException),
    /* harmony export */   "supportsErrorEvent": () => (/* binding */ supportsErrorEvent),
    /* harmony export */   "supportsFetch": () => (/* binding */ supportsFetch),
    /* harmony export */   "supportsHistory": () => (/* binding */ supportsHistory),
    /* harmony export */   "supportsNativeFetch": () => (/* binding */ supportsNativeFetch),
    /* harmony export */   "supportsReferrerPolicy": () => (/* binding */ supportsReferrerPolicy),
    /* harmony export */   "supportsReportingObserver": () => (/* binding */ supportsReportingObserver)
    /* harmony export */ });
    
    /* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1548);
    /* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1539);
    
    // eslint-disable-next-line deprecation/deprecation
    const WINDOW = (0,_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalObject)();
    
    /**
     * Tells whether current environment supports ErrorEvent objects
     * {@link supportsErrorEvent}.
     *
     * @returns Answer to the given question.
     */
    function supportsErrorEvent() {
      try {
        new ErrorEvent('');
        return true;
      } catch (e) {
        return false;
      }
    }
    
    /**
     * Tells whether current environment supports DOMError objects
     * {@link supportsDOMError}.
     *
     * @returns Answer to the given question.
     */
    function supportsDOMError() {
      try {
        // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':
        // 1 argument required, but only 0 present.
        // @ts-ignore It really needs 1 argument, not 0.
        new DOMError('');
        return true;
      } catch (e) {
        return false;
    
    /**
     * Tells whether current environment supports DOMException objects
     * {@link supportsDOMException}.
     *
     * @returns Answer to the given question.
     */
    function supportsDOMException() {
      try {
        new DOMException('');
        return true;
      } catch (e) {
        return false;
      }
    }
    
    /**
     * Tells whether current environment supports Fetch API
     * {@link supportsFetch}.
     *
     * @returns Answer to the given question.
     */
    function supportsFetch() {
      if (!('fetch' in WINDOW)) {
        return false;
      }
    
      try {
        new Headers();
        new Request('http://www.example.com');
        new Response();
        return true;
      } catch (e) {
        return false;
      }
    }
    /**
     * isNativeFetch checks if the given function is a native implementation of fetch()
     */
    // eslint-disable-next-line @typescript-eslint/ban-types
    function isNativeFetch(func) {
      return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString());
    }
    
    /**
     * Tells whether current environment supports Fetch API natively
     * {@link supportsNativeFetch}.
     *
     * @returns true if `window.fetch` is natively implemented, false otherwise
     */
    function supportsNativeFetch() {
      if (!supportsFetch()) {
        return false;
      }
    
      // Fast path to avoid DOM I/O
      // eslint-disable-next-line @typescript-eslint/unbound-method
      if (isNativeFetch(WINDOW.fetch)) {
        return true;
      }
    
      // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)
      // so create a "pure" iframe to see if that has native fetch
      let result = false;
      const doc = WINDOW.document;
      // eslint-disable-next-line deprecation/deprecation
      if (doc && typeof (doc.createElement ) === 'function') {
        try {
          const sandbox = doc.createElement('iframe');
          sandbox.hidden = true;
          doc.head.appendChild(sandbox);
          if (sandbox.contentWindow && sandbox.contentWindow.fetch) {
            // eslint-disable-next-line @typescript-eslint/unbound-method
            result = isNativeFetch(sandbox.contentWindow.fetch);
          }
          doc.head.removeChild(sandbox);
        } catch (err) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
            _logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);
        }
      }
    
      return result;
    }
    
    /**
     * Tells whether current environment supports ReportingObserver API
     * {@link supportsReportingObserver}.
     *
     * @returns Answer to the given question.
     */
    function supportsReportingObserver() {
      return 'ReportingObserver' in WINDOW;
    }
    
    /**
     * Tells whether current environment supports Referrer Policy API
     * {@link supportsReferrerPolicy}.
     *
     * @returns Answer to the given question.
     */
    function supportsReferrerPolicy() {
      // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'
      // (see https://caniuse.com/#feat=referrer-policy),
      // it doesn't. And it throws an exception instead of ignoring this parameter...
      // REF: https://github.com/getsentry/raven-js/issues/1233
    
      if (!supportsFetch()) {
        return false;
      }
    
      try {
        new Request('_', {
          referrerPolicy: 'origin' ,
        });
        return true;
      } catch (e) {
        return false;
      }
    }
    
    /**
     * Tells whether current environment supports History API
     * {@link supportsHistory}.
     *
     * @returns Answer to the given question.
     */
    function supportsHistory() {
      // NOTE: in Chrome App environment, touching history.pushState, *even inside
      //       a try/catch block*, will cause Chrome to output an error to console.error
      // borrowed from: https://github.com/angular/angular.js/pull/13945/files
      /* eslint-disable @typescript-eslint/no-unsafe-member-access */
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      const chrome = (WINDOW ).chrome;
      const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
      /* eslint-enable @typescript-eslint/no-unsafe-member-access */
      const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;
    
      return !isChromePackagedApp && hasHistoryApi;
    }
    
    //# sourceMappingURL=supports.js.map
    
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    
    /* harmony export */   "Apollo": () => (/* reexport safe */ _node_apollo_js__WEBPACK_IMPORTED_MODULE_6__.Apollo),
    /* harmony export */   "BrowserTracing": () => (/* reexport safe */ _browser_browsertracing_js__WEBPACK_IMPORTED_MODULE_7__.BrowserTracing),
    
    /* harmony export */   "Express": () => (/* reexport safe */ _node_express_js__WEBPACK_IMPORTED_MODULE_0__.Express),
    
    /* harmony export */   "GraphQL": () => (/* reexport safe */ _node_graphql_js__WEBPACK_IMPORTED_MODULE_5__.GraphQL),
    
    /* harmony export */   "Mongo": () => (/* reexport safe */ _node_mongo_js__WEBPACK_IMPORTED_MODULE_3__.Mongo),
    /* harmony export */   "Mysql": () => (/* reexport safe */ _node_mysql_js__WEBPACK_IMPORTED_MODULE_2__.Mysql),
    /* harmony export */   "Postgres": () => (/* reexport safe */ _node_postgres_js__WEBPACK_IMPORTED_MODULE_1__.Postgres),
    /* harmony export */   "Prisma": () => (/* reexport safe */ _node_prisma_js__WEBPACK_IMPORTED_MODULE_4__.Prisma)
    
    /* harmony export */ });
    
    /* harmony import */ var _node_express_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1619);
    /* harmony import */ var _node_postgres_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1621);
    /* harmony import */ var _node_mysql_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1622);
    /* harmony import */ var _node_mongo_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1623);
    /* harmony import */ var _node_prisma_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1624);
    /* harmony import */ var _node_graphql_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1625);
    /* harmony import */ var _node_apollo_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1626);
    /* harmony import */ var _browser_browsertracing_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1627);
    
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "Express": () => (/* binding */ Express)
    /* harmony export */ });
    
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1558);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1548);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1595);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1596);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1544);
    /* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1620);
    
    
    
    
    
    /**
     * Express integration
     *
     * Provides an request and error handler for Express framework as well as tracing capabilities
     */
    class Express  {
      /**
       * @inheritDoc
       */
       static __initStatic() {this.id = 'Express';}
    
      /**
       * @inheritDoc
       */
       __init() {this.name = Express.id;}
    
      /**
       * Express App instance
       */
    
      /**
       * @inheritDoc
       */
       constructor(options = {}) {;Express.prototype.__init.call(this);
        this._router = options.router || options.app;
        this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use');
      }
    
      /**
       * @inheritDoc
       */
       setupOnce(_, getCurrentHub) {
        if (!this._router) {
    
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.error('ExpressIntegration is missing an Express instance');
    
        if ((0,_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_1__.shouldDisableAutoInstrumentation)(getCurrentHub)) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.log('Express Integration is skipped because of instrumenter configuration.');
    
          return;
        }
    
        instrumentMiddlewares(this._router, this._methods);
        instrumentRouter(this._router );
      }
    }Express.__initStatic();
    
    /**
     * Wraps original middleware function in a tracing call, which stores the info about the call as a span,
     * and finishes it once the middleware is done invoking.
     *
     * Express middlewares have 3 various forms, thus we have to take care of all of them:
     * // sync
     * app.use(function (req, res) { ... })
     * // async
     * app.use(function (req, res, next) { ... })
     * // error handler
     * app.use(function (err, req, res, next) { ... })
     *
     * They all internally delegate to the `router[method]` of the given application instance.
     */
    // eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any
    function wrap(fn, method) {
      const arity = fn.length;
    
      switch (arity) {
        case 2: {
          return function ( req, res) {
            const transaction = res.__sentry_transaction;
            if (transaction) {
              const span = transaction.startChild({
                description: fn.name,
                op: `middleware.express.${method}`,
              });
              res.once('finish', () => {
                span.finish();
              });
            }
            return fn.call(this, req, res);
          };
        }
        case 3: {
          return function (
    
            req,
            res,
            next,
          ) {
            const transaction = res.__sentry_transaction;
    
            const span = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([transaction, 'optionalAccess', _2 => _2.startChild, 'call', _3 => _3({
    
              description: fn.name,
              op: `middleware.express.${method}`,
            })]);
            fn.call(this, req, res, function ( ...args) {
    
              (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([span, 'optionalAccess', _4 => _4.finish, 'call', _5 => _5()]);
    
              next.call(this, ...args);
            });
          };
        }
        case 4: {
          return function (
    
            err,
            req,
            res,
            next,
          ) {
            const transaction = res.__sentry_transaction;
    
            const span = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([transaction, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({
    
              description: fn.name,
              op: `middleware.express.${method}`,
            })]);
            fn.call(this, err, req, res, function ( ...args) {
    
              (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
    
              next.call(this, ...args);
            });
          };
        }
        default: {
          throw new Error(`Express middleware takes 2-4 arguments. Got: ${arity}`);
        }
      }
    }
    
    /**
     * Takes all the function arguments passed to the original `app` or `router` method, eg. `app.use` or `router.use`
     * and wraps every function, as well as array of functions with a call to our `wrap` method.
     * We have to take care of the arrays as well as iterate over all of the arguments,
     * as `app.use` can accept middlewares in few various forms.
     *
     * app.use([<path>], <fn>)
     * app.use([<path>], <fn>, ...<fn>)
     * app.use([<path>], ...<fn>[])
     */
    function wrapMiddlewareArgs(args, method) {
      return args.map((arg) => {
        if (typeof arg === 'function') {
          return wrap(arg, method);
        }
    
        if (Array.isArray(arg)) {
          return arg.map((a) => {
            if (typeof a === 'function') {
              return wrap(a, method);
            }
            return a;
          });
        }
    
        return arg;
      });
    }
    
    /**
     * Patches original router to utilize our tracing functionality
     */
    function patchMiddleware(router, method) {
      const originalCallback = router[method];
    
      router[method] = function (...args) {
        return originalCallback.call(this, ...wrapMiddlewareArgs(args, method));
      };
    
      return router;
    }
    
    /**
     * Patches original router methods
     */
    function instrumentMiddlewares(router, methods = []) {
      methods.forEach((method) => patchMiddleware(router, method));
    }
    
    /**
     * Patches the prototype of Express.Router to accumulate the resolved route
     * if a layer instance's `match` function was called and it returned a successful match.
     *
     * @see https://github.com/expressjs/express/blob/master/lib/router/index.js
     *
     * @param appOrRouter the router instance which can either be an app (i.e. top-level) or a (nested) router.
     */
    function instrumentRouter(appOrRouter) {
      // This is how we can distinguish between app and routers
      const isApp = 'settings' in appOrRouter;
    
      // In case the app's top-level router hasn't been initialized yet, we have to do it now
      if (isApp && appOrRouter._router === undefined && appOrRouter.lazyrouter) {
        appOrRouter.lazyrouter();
      }
    
      const router = isApp ? appOrRouter._router : appOrRouter;
    
      if (!router) {
        /*
        If we end up here, this means likely that this integration is used with Express 3 or Express 5.
        For now, we don't support these versions (3 is very old and 5 is still in beta). To support Express 5,
        we'd need to make more changes to the routing instrumentation because the router is no longer part of
        the Express core package but maintained in its own package. The new router has different function
        signatures and works slightly differently, demanding more changes than just taking the router from
        `app.router` instead of `app._router`.
        @see https://github.com/pillarjs/router
    
        TODO: Proper Express 5 support
        */
    
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.debug('Cannot instrument router for URL Parameterization (did not find a valid router).');
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.debug('Routing instrumentation is currently only supported in Express 4.');
    
        return;
      }
    
      const routerProto = Object.getPrototypeOf(router) ;
    
      const originalProcessParams = routerProto.process_params;
      routerProto.process_params = function process_params(
        layer,
        called,
        req,
        res,
        done,
      ) {
        // Base case: We're in the first part of the URL (thus we start with the root '/')
        if (!req._reconstructedRoute) {
          req._reconstructedRoute = '';
        }
    
        // If the layer's partial route has params, is a regex or an array, the route is stored in layer.route.
        const { layerRoutePath, isRegex, isArray, numExtraSegments } = getLayerRoutePathInfo(layer);
    
        if (layerRoutePath || isRegex || isArray) {
          req._hasParameters = true;
        }
    
        // Otherwise, the hardcoded path (i.e. a partial route without params) is stored in layer.path
        const partialRoute = layerRoutePath || layer.path || '';
    
        // Normalize the partial route so that it doesn't contain leading or trailing slashes
        // and exclude empty or '*' wildcard routes.
        // The exclusion of '*' routes is our best effort to not "pollute" the transaction name
        // with interim handlers (e.g. ones that check authentication or do other middleware stuff).
        // We want to end up with the parameterized URL of the incoming request without any extraneous path segments.
        const finalPartialRoute = partialRoute
          .split('/')
          .filter(segment => segment.length > 0 && (isRegex || isArray || !segment.includes('*')))
          .join('/');
    
        // If we found a valid partial URL, we append it to the reconstructed route
        if (finalPartialRoute && finalPartialRoute.length > 0) {
          // If the partial route is from a regex route, we append a '/' to close the regex
          req._reconstructedRoute += `/${finalPartialRoute}${isRegex ? '/' : ''}`;
        }
    
        // Now we check if we are in the "last" part of the route. We determine this by comparing the
        // number of URL segments from the original URL to that of our reconstructed parameterized URL.
        // If we've reached our final destination, we update the transaction name.
    
        const urlLength = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.getNumberOfUrlSegments)(req.originalUrl || '') + numExtraSegments;
        const routeLength = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.getNumberOfUrlSegments)(req._reconstructedRoute);
    
    
        if (urlLength === routeLength) {
          if (!req._hasParameters) {
            if (req._reconstructedRoute !== req.originalUrl) {
              req._reconstructedRoute = req.originalUrl;
            }
          }
    
          const transaction = res.__sentry_transaction;
          if (transaction && transaction.metadata.source !== 'custom') {
            // If the request URL is '/' or empty, the reconstructed route will be empty.
            // Therefore, we fall back to setting the final route to '/' in this case.
            const finalRoute = req._reconstructedRoute || '/';
    
    
            transaction.setName(...(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.extractPathForTransaction)(req, { path: true, method: true, customRoute: finalRoute }));
    
          }
        }
    
        return originalProcessParams.call(this, layer, called, req, res, done);
      };
    }
    
    /**
     * Extracts and stringifies the layer's route which can either be a string with parameters (`users/:id`),
     * a RegEx (`/test/`) or an array of strings and regexes (`['/path1', /\/path[2-5]/, /path/:id]`). Additionally
     * returns extra information about the route, such as if the route is defined as regex or as an array.
     *
     * @param layer the layer to extract the stringified route from
     *
     * @returns an object containing the stringified route, a flag determining if the route was a regex
     *          and the number of extra segments to the matched path that are additionally in the route,
     *          if the route was an array (defaults to 0).
     */
    function getLayerRoutePathInfo(layer) {
    
      const lrp = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([layer, 'access', _10 => _10.route, 'optionalAccess', _11 => _11.path]);
    
      const isRegex = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__.isRegExp)(lrp);
    
      const isArray = Array.isArray(lrp);
    
      if (!lrp) {
        return { isRegex, isArray, numExtraSegments: 0 };
      }
    
      const numExtraSegments = isArray
    
        ? Math.max(getNumberOfArrayUrlSegments(lrp ) - (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.getNumberOfUrlSegments)(layer.path || ''), 0)
    
        : 0;
    
      const layerRoutePath = getLayerRoutePathString(isArray, lrp);
    
      return { layerRoutePath, isRegex, isArray, numExtraSegments };
    }
    
    /**
     * Returns the number of URL segments in an array of routes
     *
     * Example: ['/api/test', /\/api\/post[0-9]/, '/users/:id/details`] -> 7
     */
    function getNumberOfArrayUrlSegments(routesArray) {
      return routesArray.reduce((accNumSegments, currentRoute) => {
        // array members can be a RegEx -> convert them toString
    
        return accNumSegments + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.getNumberOfUrlSegments)(currentRoute.toString());
    
      }, 0);
    }
    
    /**
     * Extracts and returns the stringified version of the layers route path
     * Handles route arrays (by joining the paths together) as well as RegExp and normal
     * string values (in the latter case the toString conversion is technically unnecessary but
     * it doesn't hurt us either).
     */
    function getLayerRoutePathString(isArray, lrp) {
      if (isArray) {
        return (lrp ).map(r => r.toString()).join(',');
      }
      return lrp && lrp.toString();
    }
    
    
    //# sourceMappingURL=express.js.map
    
    
    /***/ }),
    
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "shouldDisableAutoInstrumentation": () => (/* binding */ shouldDisableAutoInstrumentation)
    /* harmony export */ });
    
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1558);
    
    
    
    /**
     * Check if Sentry auto-instrumentation should be disabled.
     *
     * @param getCurrentHub A method to fetch the current hub
     * @returns boolean
     */
    function shouldDisableAutoInstrumentation(getCurrentHub) {
    
      const clientOptions = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__._optionalChain)([getCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);
      const instrumenter = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__._optionalChain)([clientOptions, 'optionalAccess', _6 => _6.instrumenter]) || 'sentry';
    
    
      return instrumenter !== 'sentry';
    }
    
    
    //# sourceMappingURL=node-utils.js.map
    
    
    /***/ }),
    
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "Postgres": () => (/* binding */ Postgres)
    /* harmony export */ });
    
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1558);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1548);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1540);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1545);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1544);
    /* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1620);
    
    
    
    
    
    /** Tracing integration for node-postgres package */
    class Postgres  {
      /**
       * @inheritDoc
       */
       static __initStatic() {this.id = 'Postgres';}
    
      /**
       * @inheritDoc
       */
       __init() {this.name = Postgres.id;}
    
       constructor(options = {}) {;Postgres.prototype.__init.call(this);
        this._usePgNative = !!options.usePgNative;
      }
    
      /**
       * @inheritDoc
       */
       setupOnce(_, getCurrentHub) {
    
        if ((0,_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_0__.shouldDisableAutoInstrumentation)(getCurrentHub)) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log('Postgres Integration is skipped because of instrumenter configuration.');
    
        const pkg = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.loadModule)('pg');
    
        if (!pkg) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.error('Postgres Integration was unable to require `pg` package.');
    
        if (this._usePgNative && !(0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_3__._optionalChain)([pkg, 'access', _2 => _2.native, 'optionalAccess', _3 => _3.Client])) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.error("Postgres Integration was unable to access 'pg-native' bindings.");
    
          return;
        }
    
        const { Client } = this._usePgNative ? pkg.native : pkg;
    
        /**
         * function (query, callback) => void
         * function (query, params, callback) => void
         * function (query) => Promise
         * function (query, params) => Promise
         * function (pg.Cursor) => pg.Cursor
         */
    
        (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.fill)(Client.prototype, 'query', function (orig) {
    
          return function ( config, values, callback) {
            const scope = getCurrentHub().getScope();
    
            const parentSpan = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_3__._optionalChain)([scope, 'optionalAccess', _4 => _4.getSpan, 'call', _5 => _5()]);
            const span = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_3__._optionalChain)([parentSpan, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({
    
              description: typeof config === 'string' ? config : (config ).text,
              op: 'db',
            })]);
    
            if (typeof callback === 'function') {
              return orig.call(this, config, values, function (err, result) {
    
                (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_3__._optionalChain)([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
    
                callback(err, result);
              });
            }
    
            if (typeof values === 'function') {
              return orig.call(this, config, function (err, result) {
    
                (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_3__._optionalChain)([span, 'optionalAccess', _10 => _10.finish, 'call', _11 => _11()]);
    
                values(err, result);
              });
            }
    
            const rv = typeof values !== 'undefined' ? orig.call(this, config, values) : orig.call(this, config);
    
    
            if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__.isThenable)(rv)) {
    
                (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_3__._optionalChain)([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]);
    
            (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_3__._optionalChain)([span, 'optionalAccess', _14 => _14.finish, 'call', _15 => _15()]);
    
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "Mysql": () => (/* binding */ Mysql)
    /* harmony export */ });
    
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1558);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1548);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1540);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1545);
    /* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1620);
    
    
    
    
    
    /** Tracing integration for node-mysql package */
    class Mysql  {constructor() { Mysql.prototype.__init.call(this); }
      /**
       * @inheritDoc
       */
       static __initStatic() {this.id = 'Mysql';}
    
      /**
       * @inheritDoc
       */
       __init() {this.name = Mysql.id;}
    
      /**
       * @inheritDoc
       */
       setupOnce(_, getCurrentHub) {
    
        if ((0,_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_0__.shouldDisableAutoInstrumentation)(getCurrentHub)) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log('Mysql Integration is skipped because of instrumenter configuration.');
    
        const pkg = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.loadModule)('mysql/lib/Connection.js');
    
        if (!pkg) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.error('Mysql Integration was unable to require `mysql` package.');
    
          return;
        }
    
        // The original function will have one of these signatures:
        //    function (callback) => void
        //    function (options, callback) => void
        //    function (options, values, callback) => void
    
        (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.fill)(pkg, 'createQuery', function (orig) {
    
          return function ( options, values, callback) {
            const scope = getCurrentHub().getScope();
    
            const parentSpan = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__._optionalChain)([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);
            const span = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__._optionalChain)([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({
    
              description: typeof options === 'string' ? options : (options ).sql,
              op: 'db',
            })]);
    
            if (typeof callback === 'function') {
              return orig.call(this, options, values, function (err, result, fields) {
    
                (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__._optionalChain)([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]);
    
                callback(err, result, fields);
              });
            }
    
            if (typeof values === 'function') {
              return orig.call(this, options, function (err, result, fields) {
    
                (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__._optionalChain)([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
    
                values(err, result, fields);
              });
            }
    
            return orig.call(this, options, values, callback);
          };
        });
      }
    }Mysql.__initStatic();
    
    
    //# sourceMappingURL=mysql.js.map
    
    
    /***/ }),
    
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "Mongo": () => (/* binding */ Mongo)
    /* harmony export */ });
    
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1558);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1548);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1540);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1545);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1544);
    /* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1620);
    
    
    
    
    
    // This allows us to use the same array for both defaults options and the type itself.
    // (note `as const` at the end to make it a union of string literal types (i.e. "a" | "b" | ... )
    // and not just a string[])
    
    const OPERATIONS = [
      'aggregate', // aggregate(pipeline, options, callback)
      'bulkWrite', // bulkWrite(operations, options, callback)
      'countDocuments', // countDocuments(query, options, callback)
      'createIndex', // createIndex(fieldOrSpec, options, callback)
      'createIndexes', // createIndexes(indexSpecs, options, callback)
      'deleteMany', // deleteMany(filter, options, callback)
      'deleteOne', // deleteOne(filter, options, callback)
      'distinct', // distinct(key, query, options, callback)
      'drop', // drop(options, callback)
      'dropIndex', // dropIndex(indexName, options, callback)
      'dropIndexes', // dropIndexes(options, callback)
      'estimatedDocumentCount', // estimatedDocumentCount(options, callback)
      'find', // find(query, options, callback)
      'findOne', // findOne(query, options, callback)
      'findOneAndDelete', // findOneAndDelete(filter, options, callback)
      'findOneAndReplace', // findOneAndReplace(filter, replacement, options, callback)
      'findOneAndUpdate', // findOneAndUpdate(filter, update, options, callback)
      'indexes', // indexes(options, callback)
      'indexExists', // indexExists(indexes, options, callback)
      'indexInformation', // indexInformation(options, callback)
      'initializeOrderedBulkOp', // initializeOrderedBulkOp(options, callback)
      'insertMany', // insertMany(docs, options, callback)
      'insertOne', // insertOne(doc, options, callback)
      'isCapped', // isCapped(options, callback)
      'mapReduce', // mapReduce(map, reduce, options, callback)
      'options', // options(options, callback)
      'parallelCollectionScan', // parallelCollectionScan(options, callback)
      'rename', // rename(newName, options, callback)
      'replaceOne', // replaceOne(filter, doc, options, callback)
      'stats', // stats(options, callback)
      'updateMany', // updateMany(filter, update, options, callback)
      'updateOne', // updateOne(filter, update, options, callback)
    ] ;
    
    // All of the operations above take `options` and `callback` as their final parameters, but some of them
    // take additional parameters as well. For those operations, this is a map of
    // { <operation name>:  [<names of additional parameters>] }, as a way to know what to call the operation's
    // positional arguments when we add them to the span's `data` object later
    const OPERATION_SIGNATURES
    
     = {
      // aggregate intentionally not included because `pipeline` arguments are too complex to serialize well
      // see https://github.com/getsentry/sentry-javascript/pull/3102
      bulkWrite: ['operations'],
      countDocuments: ['query'],
      createIndex: ['fieldOrSpec'],
      createIndexes: ['indexSpecs'],
      deleteMany: ['filter'],
      deleteOne: ['filter'],
      distinct: ['key', 'query'],
      dropIndex: ['indexName'],
      find: ['query'],
      findOne: ['query'],
      findOneAndDelete: ['filter'],
      findOneAndReplace: ['filter', 'replacement'],
      findOneAndUpdate: ['filter', 'update'],
      indexExists: ['indexes'],
      insertMany: ['docs'],
      insertOne: ['doc'],
      mapReduce: ['map', 'reduce'],
      rename: ['newName'],
      replaceOne: ['filter', 'doc'],
      updateMany: ['filter', 'update'],
      updateOne: ['filter', 'update'],
    };
    
    
    function isCursor(maybeCursor) {
      return maybeCursor && typeof maybeCursor === 'object' && maybeCursor.once && typeof maybeCursor.once === 'function';
    }
    
    
    /** Tracing integration for mongo package */
    class Mongo  {
      /**
       * @inheritDoc
       */
       static __initStatic() {this.id = 'Mongo';}
    
      /**