mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
1 line
9.3 KiB
JSON
1 line
9.3 KiB
JSON
|
|
{"ast":null,"code":"import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';\nimport { loadModule, logger, fill, isThenable } from '@sentry/utils';\n\n/** Tracing integration for node-postgres package */\nclass Postgres {\n /**\n * @inheritDoc\n */\n static __initStatic() {\n this.id = 'Postgres';\n }\n\n /**\n * @inheritDoc\n */\n __init() {\n this.name = Postgres.id;\n }\n constructor(options = {}) {\n ;\n Postgres.prototype.__init.call(this);\n this._usePgNative = !!options.usePgNative;\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(_, getCurrentHub) {\n var pkg = loadModule('pg');\n if (!pkg) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Postgres Integration was unable to require `pg` package.');\n return;\n }\n if (this._usePgNative && !_optionalChain([pkg, 'access', _2 => _2.native, 'optionalAccess', _3 => _3.Client])) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(\"Postgres Integration was unable to access 'pg-native' bindings.\");\n return;\n }\n const {\n Client\n } = this._usePgNative ? pkg.native : pkg;\n\n /**\n * function (query, callback) => void\n * function (query, params, callback) => void\n * function (query) => Promise\n * function (query, params) => Promise\n * function (pg.Cursor) => pg.Cursor\n */\n fill(Client.prototype, 'query', function (orig) {\n return function (config, values, callback) {\n var scope = getCurrentHub().getScope();\n var parentSpan = _optionalChain([scope, 'optionalAccess', _4 => _4.getSpan, 'call', _5 => _5()]);\n var span = _optionalChain([parentSpan, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({\n description: typeof config === 'string' ? config : config.text,\n op: 'db'\n })]);\n if (typeof callback === 'function') {\n return orig.call(this, config, values, function (err, result) {\n _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);\n callback(err, result);\n });\n }\n if (typeof values === 'function') {\n return orig.call(this, config, function (err, result) {\n _optionalChain([span, 'optionalAccess', _10 => _10.finish, 'call', _11 => _11()]);\n values(err, result);\n });\n }\n var rv = typeof values !== 'undefined' ? orig.call(this, config, values) : orig.call(this, config);\n if (isThenable(rv)) {\n return rv.then(res => {\n _optionalChain([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]);\n return res;\n });\n }\n _optionalChain([span, 'optionalAccess', _14 => _14.finish, 'call', _15 => _15()]);\n return rv;\n };\n });\n }\n}\nPostgres.__initStatic();\nexport { Postgres };","map":{"version":3,"names":["_optionalChain","loadModule","logger","fill","isThenable","Postgres","__initStatic","id","__init","name","constructor","options","prototype","call","_usePgNative","usePgNative","setupOnce","_","getCurrentHub","pkg","__SENTRY_DEBUG__","error","_2","native","_3","Client","orig","config","values","callback","scope","getScope","parentSpan","_4","getSpan","_5","span","_6","startChild","_7","description","text","op","err","result","_8","finish","_9","_10","_11","rv","then","res","_12","_13","_14","_15"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@sentry/tracing/esm/integrations/node/postgres.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';\nimport { loadModule, logger, fill, isThenable } from '@sentry/utils';\n\n/** Tracing integration for node-postgres package */\nclass Postgres {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Postgres';}\n\n /**\n * @inheritDoc\n */\n __init() {this.name = Postgres.id;}\n\n constructor(options = {}) {;Postgres.prototype.__init.call(this);\n
|