Skip to content
Snippets Groups Projects
index.js 8.31 MiB
Newer Older
  • Learn to ignore specific revisions
  • 
    //# 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 */   "Express": () => (/* reexport safe */ _node_express_js__WEBPACK_IMPORTED_MODULE_0__.Express),
    /* harmony export */   "Postgres": () => (/* reexport safe */ _node_postgres_js__WEBPACK_IMPORTED_MODULE_1__.Postgres),
    /* harmony export */   "Mysql": () => (/* reexport safe */ _node_mysql_js__WEBPACK_IMPORTED_MODULE_2__.Mysql),
    /* harmony export */   "Mongo": () => (/* reexport safe */ _node_mongo_js__WEBPACK_IMPORTED_MODULE_3__.Mongo),
    /* harmony export */   "Prisma": () => (/* reexport safe */ _node_prisma_js__WEBPACK_IMPORTED_MODULE_4__.Prisma),
    /* harmony export */   "GraphQL": () => (/* reexport safe */ _node_graphql_js__WEBPACK_IMPORTED_MODULE_5__.GraphQL),
    /* 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 */ });
    
    /* harmony import */ var _node_express_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1741);
    /* harmony import */ var _node_postgres_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1743);
    /* harmony import */ var _node_mysql_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1744);
    /* harmony import */ var _node_mongo_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1745);
    /* harmony import */ var _node_prisma_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1746);
    /* harmony import */ var _node_graphql_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1747);
    /* harmony import */ var _node_apollo_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1748);
    /* harmony import */ var _browser_browsertracing_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1749);
    
    /***/ ((__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__(1663);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1653);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1707);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1708);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1649);
    /* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1742);
    
    250056 250057 250058 250059 250060 250061 250062 250063 250064 250065 250066 250067 250068 250069 250070 250071 250072 250073 250074 250075 250076 250077 250078 250079 250080 250081 250082 250083 250084 250085 250086 250087 250088 250089 250090 250091 250092 250093 250094 250095 250096 250097 250098 250099 250100 250101 250102 250103 250104 250105 250106 250107 250108 250109 250110 250111 250112 250113 250114 250115 250116 250117 250118 250119 250120 250121 250122 250123 250124 250125 250126 250127 250128 250129 250130 250131 250132 250133 250134 250135 250136 250137 250138 250139 250140 250141 250142 250143 250144 250145 250146 250147 250148 250149 250150 250151 250152 250153 250154 250155 250156 250157 250158 250159 250160 250161 250162 250163 250164 250165 250166 250167 250168 250169 250170 250171 250172 250173 250174 250175 250176 250177 250178 250179 250180 250181 250182 250183 250184 250185 250186 250187 250188 250189 250190 250191 250192 250193 250194 250195 250196 250197 250198 250199 250200 250201 250202 250203 250204 250205 250206 250207 250208 250209 250210 250211 250212 250213 250214 250215 250216 250217 250218 250219 250220 250221 250222 250223 250224 250225 250226 250227 250228 250229 250230 250231 250232 250233 250234 250235 250236 250237 250238 250239 250240 250241 250242 250243 250244 250245 250246 250247 250248 250249 250250 250251 250252 250253 250254 250255 250256 250257 250258 250259 250260 250261 250262 250263 250264 250265 250266 250267 250268 250269 250270 250271 250272 250273 250274 250275 250276 250277 250278 250279 250280 250281 250282 250283 250284 250285 250286 250287 250288 250289 250290 250291 250292 250293 250294 250295 250296 250297 250298 250299 250300 250301 250302 250303 250304 250305 250306 250307 250308 250309 250310 250311 250312 250313 250314 250315 250316 250317 250318 250319 250320 250321 250322 250323 250324 250325 250326 250327 250328 250329 250330 250331 250332 250333 250334 250335 250336 250337 250338 250339 250340 250341 250342 250343 250344 250345 250346 250347 250348 250349 250350 250351 250352 250353 250354 250355 250356 250357 250358 250359 250360 250361 250362 250363 250364 250365 250366 250367 250368 250369 250370 250371 250372 250373 250374 250375 250376 250377 250378 250379 250380 250381 250382 250383 250384 250385 250386 250387 250388 250389 250390 250391 250392 250393 250394 250395 250396
    
    
    
    
    /**
     * 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');
          return;
        }
    
        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__(1663);
    
    
    
    /**
     * 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__(1663);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1645);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1653);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1650);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1649);
    /* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1742);
    
    
    
    
    
    /** 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) {
        const pkg = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.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.');
          return;
        }
    
        if ((0,_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__.shouldDisableAutoInstrumentation)(getCurrentHub)) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log('Postgres Integration is skipped because of instrumenter configuration.');
          return;
        }
    
        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)) {
              return rv.then((res) => {
                (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_3__._optionalChain)([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]);
                return res;
              });
            }
    
            (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_3__._optionalChain)([span, 'optionalAccess', _14 => _14.finish, 'call', _15 => _15()]);
            return rv;
          };
        });
      }
    }Postgres.__initStatic();
    
    
    //# sourceMappingURL=postgres.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 */   "Mysql": () => (/* binding */ Mysql)
    /* harmony export */ });
    
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1663);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1645);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1653);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1650);
    /* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1742);
    
    
    
    
    
    /** 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) {
        const pkg = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.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;
        }
    
        if ((0,_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__.shouldDisableAutoInstrumentation)(getCurrentHub)) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log('Mysql Integration is skipped because of instrumenter configuration.');
          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__(1663);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1645);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1653);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1650);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1649);
    /* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1742);
    
    250631 250632 250633 250634 250635 250636 250637 250638 250639 250640 250641 250642 250643 250644 250645 250646 250647 250648 250649 250650 250651 250652 250653 250654 250655 250656 250657 250658 250659 250660 250661 250662 250663 250664 250665 250666 250667 250668 250669 250670 250671 250672 250673 250674 250675 250676 250677 250678 250679 250680 250681 250682 250683 250684 250685 250686 250687 250688 250689 250690 250691 250692 250693 250694 250695 250696 250697 250698 250699 250700 250701 250702 250703 250704 250705 250706 250707 250708 250709 250710 250711 250712 250713 250714 250715 250716 250717 250718 250719 250720 250721 250722 250723 250724 250725 250726 250727 250728 250729 250730 250731 250732 250733 250734 250735 250736 250737 250738 250739 250740 250741 250742 250743 250744 250745 250746 250747 250748 250749 250750 250751 250752 250753 250754 250755 250756 250757 250758 250759 250760 250761 250762 250763 250764 250765 250766 250767 250768 250769 250770 250771 250772 250773 250774 250775 250776 250777 250778 250779 250780 250781 250782 250783 250784 250785 250786 250787 250788 250789 250790 250791 250792 250793 250794 250795 250796 250797 250798 250799 250800 250801 250802 250803 250804 250805 250806 250807 250808 250809 250810 250811 250812 250813 250814 250815 250816 250817 250818 250819 250820 250821 250822 250823 250824 250825 250826 250827 250828 250829 250830 250831 250832 250833 250834 250835 250836 250837 250838 250839 250840 250841 250842 250843 250844 250845 250846 250847
    
    
    
    
    // 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'],
    };
    
    /** Tracing integration for mongo package */
    class Mongo  {
      /**
       * @inheritDoc
       */
       static __initStatic() {this.id = 'Mongo';}
    
      /**
       * @inheritDoc
       */
       __init() {this.name = Mongo.id;}
    
      /**
       * @inheritDoc
       */
       constructor(options = {}) {;Mongo.prototype.__init.call(this);
        this._operations = Array.isArray(options.operations) ? options.operations : (OPERATIONS );
        this._describeOperations = 'describeOperations' in options ? options.describeOperations : true;
        this._useMongoose = !!options.useMongoose;
      }
    
      /**
       * @inheritDoc
       */
       setupOnce(_, getCurrentHub) {
        const moduleName = this._useMongoose ? 'mongoose' : 'mongodb';
        const pkg = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.loadModule)(moduleName);
    
        if (!pkg) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.error(`Mongo Integration was unable to require \`${moduleName}\` package.`);
          return;
        }
    
        if ((0,_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__.shouldDisableAutoInstrumentation)(getCurrentHub)) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log('Mongo Integration is skipped because of instrumenter configuration.');
          return;
        }
    
        this._instrumentOperations(pkg.Collection, this._operations, getCurrentHub);
      }
    
      /**
       * Patches original collection methods
       */
       _instrumentOperations(collection, operations, getCurrentHub) {
        operations.forEach((operation) => this._patchOperation(collection, operation, getCurrentHub));
      }
    
      /**
       * Patches original collection to utilize our tracing functionality
       */
       _patchOperation(collection, operation, getCurrentHub) {
        if (!(operation in collection.prototype)) return;
    
        const getSpanContext = this._getSpanContextFromOperationArguments.bind(this);
    
        (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.fill)(collection.prototype, operation, function (orig) {
          return function ( ...args) {
            const lastArg = args[args.length - 1];
            const scope = getCurrentHub().getScope();
            const parentSpan = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__._optionalChain)([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);
    
            // Check if the operation was passed a callback. (mapReduce requires a different check, as
            // its (non-callback) arguments can also be functions.)
            if (typeof lastArg !== 'function' || (operation === 'mapReduce' && args.length === 2)) {
              const span = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__._optionalChain)([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5(getSpanContext(this, operation, args))]);
              const maybePromise = orig.call(this, ...args) ;
    
              if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__.isThenable)(maybePromise)) {
                return maybePromise.then((res) => {
                  (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__._optionalChain)([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]);
                  return res;
                });
              } else {
                (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__._optionalChain)([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
                return maybePromise;
              }
            }
    
            const span = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__._optionalChain)([parentSpan, 'optionalAccess', _10 => _10.startChild, 'call', _11 => _11(getSpanContext(this, operation, args.slice(0, -1)))]);
            return orig.call(this, ...args.slice(0, -1), function (err, result) {
              (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__._optionalChain)([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]);
              lastArg(err, result);
            });
          };
        });
      }
    
      /**
       * Form a SpanContext based on the user input to a given operation.
       */
       _getSpanContextFromOperationArguments(
        collection,
        operation,
        args,
      ) {
        const data = {
          collectionName: collection.collectionName,
          dbName: collection.dbName,
          namespace: collection.namespace,
        };
        const spanContext = {
          op: 'db',
          description: operation,
          data,
        };
    
        // If the operation takes no arguments besides `options` and `callback`, or if argument
        // collection is disabled for this operation, just return early.
        const signature = OPERATION_SIGNATURES[operation];
        const shouldDescribe = Array.isArray(this._describeOperations)
          ? this._describeOperations.includes(operation)
          : this._describeOperations;
    
        if (!signature || !shouldDescribe) {
          return spanContext;
        }
    
        try {
          // Special case for `mapReduce`, as the only one accepting functions as arguments.
          if (operation === 'mapReduce') {
            const [map, reduce] = args ;
            data[signature[0]] = typeof map === 'string' ? map : map.name || '<anonymous>';
            data[signature[1]] = typeof reduce === 'string' ? reduce : reduce.name || '<anonymous>';
          } else {
            for (let i = 0; i < signature.length; i++) {
              data[signature[i]] = JSON.stringify(args[i]);
            }
          }
        } catch (_oO) {
          // no-empty
        }
    
        return spanContext;
      }
    }Mongo.__initStatic();
    
    
    //# sourceMappingURL=mongo.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 */   "Prisma": () => (/* binding */ Prisma)
    /* harmony export */ });
    
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1663);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1653);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1649);
    /* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1742);
    
    
    
    
    
    function isValidPrismaClient(possibleClient) {
      return possibleClient && !!(possibleClient )['$use'];
    }
    
    /** Tracing integration for @prisma/client package */
    class Prisma  {
      /**
       * @inheritDoc
       */
       static __initStatic() {this.id = 'Prisma';}
    
      /**
       * @inheritDoc
       */
       __init() {this.name = Prisma.id;}
    
      /**
       * Prisma ORM Client Instance
       */
    
      /**
       * @inheritDoc
       */
       constructor(options = {}) {;Prisma.prototype.__init.call(this);
        if (isValidPrismaClient(options.client)) {
          this._client = options.client;
        } else {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
            _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.warn(
              `Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`,
            );
        }
      }
    
      /**
       * @inheritDoc
       */
       setupOnce(_, getCurrentHub) {
        if (!this._client) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.error('PrismaIntegration is missing a Prisma Client Instance');
          return;
        }
    
        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('Prisma Integration is skipped because of instrumenter configuration.');
          return;
        }
    
        this._client.$use((params, next) => {
          const scope = getCurrentHub().getScope();
          const parentSpan = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);
    
          const action = params.action;
          const model = params.model;
    
          const span = (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({
            description: model ? `${model} ${action}` : action,
            op: 'db.sql.prisma',
          })]);
    
          const rv = next(params);
    
          if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.isThenable)(rv)) {
            return rv.then((res) => {
              (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]);
              return res;
            });
          }
    
          (0,_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_2__._optionalChain)([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
          return rv;
        });
      }
    }Prisma.__initStatic();
    
    
    //# sourceMappingURL=prisma.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 */   "GraphQL": () => (/* binding */ GraphQL)
    /* harmony export */ });
    
    /* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1663);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1645);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1653);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1650);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1649);
    /* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1742);
    
    
    
    
    
    /** Tracing integration for graphql package */
    class GraphQL  {constructor() { GraphQL.prototype.__init.call(this); }
      /**
       * @inheritDoc
       */
       static __initStatic() {this.id = 'GraphQL';}
    
      /**
       * @inheritDoc
       */
       __init() {this.name = GraphQL.id;}
    
      /**
       * @inheritDoc
       */
       setupOnce(_, getCurrentHub) {
        const pkg = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.loadModule)
    
    ('graphql/execution/execute.js');
    
        if (!pkg) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.error('GraphQL Integration was unable to require graphql/execution package.');
          return;
        }
    
        if ((0,_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__.shouldDisableAutoInstrumentation)(getCurrentHub)) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log('GraphQL Integration is skipped because of instrumenter configuration.');
          return;
        }
    
        (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.fill)(pkg, 'execute', function (orig) {
          return function ( ...args) {
            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: 'execute',
              op: 'graphql.execute',
            })]);