start-slicemachine 0.12.57-beta.8 → 0.12.57-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/dist/StartSliceMachineProcess.cjs.map +1 -1
  2. package/dist/StartSliceMachineProcess.js.map +1 -1
  3. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/api.cjs.map +1 -1
  4. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/api.js.map +1 -1
  5. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/baseclient.cjs.map +1 -1
  6. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/baseclient.js.map +1 -1
  7. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.cjs.map +1 -1
  8. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.js.map +1 -1
  9. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.cjs.map +1 -1
  10. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.js.map +1 -1
  11. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integration.cjs.map +1 -1
  12. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integration.js.map +1 -1
  13. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/functiontostring.cjs.map +1 -1
  14. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/functiontostring.js.map +1 -1
  15. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/inboundfilters.cjs.map +1 -1
  16. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/inboundfilters.js.map +1 -1
  17. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/requestdata.cjs.map +1 -1
  18. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/requestdata.js.map +1 -1
  19. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/instance.cjs.map +1 -1
  20. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/instance.js.map +1 -1
  21. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/metric-summary.cjs.map +1 -1
  22. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/metric-summary.js.map +1 -1
  23. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/utils.cjs.map +1 -1
  24. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/utils.js.map +1 -1
  25. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.cjs.map +1 -1
  26. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.js.map +1 -1
  27. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.cjs.map +1 -1
  28. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js.map +1 -1
  29. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/errors.cjs.map +1 -1
  30. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/errors.js.map +1 -1
  31. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/hubextensions.cjs.map +1 -1
  32. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/hubextensions.js.map +1 -1
  33. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/sampling.cjs.map +1 -1
  34. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/sampling.js.map +1 -1
  35. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/span.cjs.map +1 -1
  36. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/span.js.map +1 -1
  37. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/transaction.cjs.map +1 -1
  38. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/transaction.js.map +1 -1
  39. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/transports/base.cjs.map +1 -1
  40. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/transports/base.js.map +1 -1
  41. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.cjs.map +1 -1
  42. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.js.map +1 -1
  43. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/sdkMetadata.cjs.map +1 -1
  44. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/sdkMetadata.js.map +1 -1
  45. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/aggregate-errors.cjs.map +1 -1
  46. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/aggregate-errors.js.map +1 -1
  47. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/baggage.cjs.map +1 -1
  48. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/baggage.js.map +1 -1
  49. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/browser.cjs.map +1 -1
  50. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/browser.js.map +1 -1
  51. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/cookie.cjs.map +1 -1
  52. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/cookie.js.map +1 -1
  53. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/dsn.cjs.map +1 -1
  54. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/dsn.js.map +1 -1
  55. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/envelope.cjs.map +1 -1
  56. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/envelope.js.map +1 -1
  57. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/eventbuilder.cjs.map +1 -1
  58. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/eventbuilder.js.map +1 -1
  59. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/_handlers.cjs.map +1 -1
  60. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/_handlers.js.map +1 -1
  61. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.cjs.map +1 -1
  62. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.js.map +1 -1
  63. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.cjs.map +1 -1
  64. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.js.map +1 -1
  65. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.cjs.map +1 -1
  66. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.js.map +1 -1
  67. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/node-stack-trace.cjs.map +1 -1
  68. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/node-stack-trace.js.map +1 -1
  69. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/normalize.cjs.map +1 -1
  70. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/normalize.js.map +1 -1
  71. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.cjs.map +1 -1
  72. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.js.map +1 -1
  73. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/path.cjs.map +1 -1
  74. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/path.js.map +1 -1
  75. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/ratelimit.cjs.map +1 -1
  76. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/ratelimit.js.map +1 -1
  77. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/requestdata.cjs.map +1 -1
  78. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/requestdata.js.map +1 -1
  79. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/stacktrace.cjs.map +1 -1
  80. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/stacktrace.js.map +1 -1
  81. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/string.cjs.map +1 -1
  82. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/string.js.map +1 -1
  83. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.cjs.map +1 -1
  84. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.js.map +1 -1
  85. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/tracing.cjs.map +1 -1
  86. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/tracing.js.map +1 -1
  87. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/url.cjs.map +1 -1
  88. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/url.js.map +1 -1
  89. package/dist/_node_modules/@sentry/node/esm/integrations/context.cjs.map +1 -1
  90. package/dist/_node_modules/@sentry/node/esm/integrations/context.js.map +1 -1
  91. package/dist/_node_modules/@sentry/node/esm/integrations/contextlines.cjs.map +1 -1
  92. package/dist/_node_modules/@sentry/node/esm/integrations/contextlines.js.map +1 -1
  93. package/dist/_node_modules/@sentry/node/esm/integrations/http.cjs.map +1 -1
  94. package/dist/_node_modules/@sentry/node/esm/integrations/http.js.map +1 -1
  95. package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/common.cjs.map +1 -1
  96. package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/common.js.map +1 -1
  97. package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.cjs.map +1 -1
  98. package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.js.map +1 -1
  99. package/dist/_node_modules/@sentry/node/esm/integrations/modules.cjs.map +1 -1
  100. package/dist/_node_modules/@sentry/node/esm/integrations/modules.js.map +1 -1
  101. package/dist/_node_modules/@sentry/node/esm/integrations/spotlight.cjs.map +1 -1
  102. package/dist/_node_modules/@sentry/node/esm/integrations/spotlight.js.map +1 -1
  103. package/dist/_node_modules/@sentry/node/esm/integrations/undici/index.cjs.map +1 -1
  104. package/dist/_node_modules/@sentry/node/esm/integrations/undici/index.js.map +1 -1
  105. package/dist/_node_modules/@sentry/node/esm/integrations/utils/http.cjs.map +1 -1
  106. package/dist/_node_modules/@sentry/node/esm/integrations/utils/http.js.map +1 -1
  107. package/dist/_node_modules/@sentry/node/esm/module.cjs.map +1 -1
  108. package/dist/_node_modules/@sentry/node/esm/module.js.map +1 -1
  109. package/dist/_node_modules/@sentry/node/esm/proxy/index.cjs.map +1 -1
  110. package/dist/_node_modules/@sentry/node/esm/proxy/index.js.map +1 -1
  111. package/dist/_node_modules/@sentry/node/esm/proxy/parse-proxy-response.cjs.map +1 -1
  112. package/dist/_node_modules/@sentry/node/esm/proxy/parse-proxy-response.js.map +1 -1
  113. package/dist/_node_modules/@sentry/node/esm/transports/http.cjs.map +1 -1
  114. package/dist/_node_modules/@sentry/node/esm/transports/http.js.map +1 -1
  115. package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -1
  116. package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -1
  117. package/dist/_node_modules/fetch-blob/file.cjs.map +1 -1
  118. package/dist/_node_modules/fetch-blob/file.js.map +1 -1
  119. package/dist/_node_modules/fetch-blob/index.cjs.map +1 -1
  120. package/dist/_node_modules/fetch-blob/index.js.map +1 -1
  121. package/dist/_node_modules/fetch-blob/streams.cjs.map +1 -1
  122. package/dist/_node_modules/fetch-blob/streams.js.map +1 -1
  123. package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -1
  124. package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -1
  125. package/dist/_node_modules/node-domexception/index.cjs.map +1 -1
  126. package/dist/_node_modules/node-domexception/index.js.map +1 -1
  127. package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -1
  128. package/dist/_node_modules/node-fetch/src/body.js.map +1 -1
  129. package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -1
  130. package/dist/_node_modules/node-fetch/src/headers.js.map +1 -1
  131. package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -1
  132. package/dist/_node_modules/node-fetch/src/index.js.map +1 -1
  133. package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -1
  134. package/dist/_node_modules/node-fetch/src/request.js.map +1 -1
  135. package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +1 -1
  136. package/dist/_node_modules/node-fetch/src/utils/is.js.map +1 -1
  137. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -1
  138. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -1
  139. package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -1
  140. package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -1
  141. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -1
  142. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -1
  143. package/dist/_node_modules/yallist/yallist.cjs.map +1 -1
  144. package/dist/_node_modules/yallist/yallist.js.map +1 -1
  145. package/dist/cli.cjs.map +1 -1
  146. package/dist/cli.js.map +1 -1
  147. package/dist/constants.cjs.map +1 -1
  148. package/dist/constants.js.map +1 -1
  149. package/dist/legacyMigrations/detectFramework.cjs.map +1 -1
  150. package/dist/legacyMigrations/detectFramework.js.map +1 -1
  151. package/dist/legacyMigrations/migrateAssets.cjs.map +1 -1
  152. package/dist/legacyMigrations/migrateAssets.js.map +1 -1
  153. package/dist/legacyMigrations/migrateSMJSON.cjs.map +1 -1
  154. package/dist/legacyMigrations/migrateSMJSON.js.map +1 -1
  155. package/dist/lib/checkIsSentryEnabled.cjs.map +1 -1
  156. package/dist/lib/checkIsSentryEnabled.js.map +1 -1
  157. package/dist/lib/createSliceMachineExpressApp.cjs.map +1 -1
  158. package/dist/lib/createSliceMachineExpressApp.js.map +1 -1
  159. package/dist/lib/locateFileUpward.cjs.map +1 -1
  160. package/dist/lib/locateFileUpward.js.map +1 -1
  161. package/dist/lib/safelyExecute.cjs.map +1 -1
  162. package/dist/lib/safelyExecute.js.map +1 -1
  163. package/dist/lib/sentryFrontendTunnel.cjs.map +1 -1
  164. package/dist/lib/sentryFrontendTunnel.js.map +1 -1
  165. package/dist/lib/setupSentry.cjs.map +1 -1
  166. package/dist/lib/setupSentry.js.map +1 -1
  167. package/dist/packages/start-slicemachine/_node_modules/semver/classes/comparator.cjs.map +1 -1
  168. package/dist/packages/start-slicemachine/_node_modules/semver/classes/comparator.js.map +1 -1
  169. package/dist/packages/start-slicemachine/_node_modules/semver/classes/range.cjs.map +1 -1
  170. package/dist/packages/start-slicemachine/_node_modules/semver/classes/range.js.map +1 -1
  171. package/dist/packages/start-slicemachine/_node_modules/semver/classes/semver.cjs.map +1 -1
  172. package/dist/packages/start-slicemachine/_node_modules/semver/classes/semver.js.map +1 -1
  173. package/dist/packages/start-slicemachine/_node_modules/semver/functions/cmp.cjs.map +1 -1
  174. package/dist/packages/start-slicemachine/_node_modules/semver/functions/cmp.js.map +1 -1
  175. package/dist/packages/start-slicemachine/_node_modules/semver/functions/coerce.cjs.map +1 -1
  176. package/dist/packages/start-slicemachine/_node_modules/semver/functions/coerce.js.map +1 -1
  177. package/dist/packages/start-slicemachine/_node_modules/semver/functions/inc.cjs.map +1 -1
  178. package/dist/packages/start-slicemachine/_node_modules/semver/functions/inc.js.map +1 -1
  179. package/dist/packages/start-slicemachine/_node_modules/semver/functions/parse.cjs.map +1 -1
  180. package/dist/packages/start-slicemachine/_node_modules/semver/functions/parse.js.map +1 -1
  181. package/dist/packages/start-slicemachine/_node_modules/semver/functions/satisfies.cjs.map +1 -1
  182. package/dist/packages/start-slicemachine/_node_modules/semver/functions/satisfies.js.map +1 -1
  183. package/dist/packages/start-slicemachine/_node_modules/semver/internal/re.cjs.map +1 -1
  184. package/dist/packages/start-slicemachine/_node_modules/semver/internal/re.js.map +1 -1
  185. package/dist/packages/start-slicemachine/_node_modules/semver/ranges/max-satisfying.cjs.map +1 -1
  186. package/dist/packages/start-slicemachine/_node_modules/semver/ranges/max-satisfying.js.map +1 -1
  187. package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-satisfying.cjs.map +1 -1
  188. package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-satisfying.js.map +1 -1
  189. package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-version.cjs.map +1 -1
  190. package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-version.js.map +1 -1
  191. package/dist/packages/start-slicemachine/_node_modules/semver/ranges/simplify.cjs.map +1 -1
  192. package/dist/packages/start-slicemachine/_node_modules/semver/ranges/simplify.js.map +1 -1
  193. package/dist/packages/start-slicemachine/_node_modules/semver/ranges/valid.cjs.map +1 -1
  194. package/dist/packages/start-slicemachine/_node_modules/semver/ranges/valid.js.map +1 -1
  195. package/dist/packages/start-slicemachine/package.json.cjs +1 -1
  196. package/dist/packages/start-slicemachine/package.json.js +1 -1
  197. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"http.cjs","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/http.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, getClient, isSentryRequestUrl, getCurrentScope, getIsolationScope, getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient, setHttpStatus, spanToJSON, hasTracingEnabled, getCurrentHub, addBreadcrumb } from '@sentry/core';\nimport { dropUndefinedKeys, logger, fill, LRUMap, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { NODE_VERSION } from '../nodeVersion.js';\nimport { normalizeRequestArgs, extractRawUrl, extractUrl, cleanSpanDescription } from './utils/http.js';\n\nconst _httpIntegration = ((options = {}) => {\n const { breadcrumbs, tracing, shouldCreateSpanForRequest } = options;\n\n const convertedOptions = {\n breadcrumbs,\n tracing:\n tracing === false\n ? false\n : dropUndefinedKeys({\n // If tracing is forced to `true`, we don't want to set `enableIfHasTracingEnabled`\n enableIfHasTracingEnabled: tracing === true ? undefined : true,\n shouldCreateSpanForRequest,\n }),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n return new Http(convertedOptions) ;\n}) ;\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, spans for outgoing\n * http requests, and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * By default, this will always create breadcrumbs, and will create spans if tracing is enabled.\n */\nconst httpIntegration = defineIntegration(_httpIntegration);\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing\n * http requests and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * @deprecated Use `httpIntegration()` instead.\n */\nclass Http {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Http';}\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n __init() {this.name = Http.id;}\n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {Http.prototype.__init.call(this);\n this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(\n _addGlobalEventProcessor,\n // eslint-disable-next-line deprecation/deprecation\n setupOnceGetCurrentHub,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);\n\n // If `tracing` is not explicitly set, we default this based on whether or not tracing is enabled.\n // But for compatibility, we only do that if `enableIfHasTracingEnabled` is set.\n const shouldCreateSpans = _shouldCreateSpans(this._tracing, clientOptions);\n\n // No need to instrument if we don't want to track anything\n if (!this._breadcrumbs && !shouldCreateSpans) {\n return;\n }\n\n // Do not auto-instrument for other instrumenter\n if (clientOptions && clientOptions.instrumenter !== 'sentry') {\n DEBUG_BUILD && logger.log('HTTP Integration is skipped because of instrumenter configuration.');\n return;\n }\n\n const shouldCreateSpanForRequest = _getShouldCreateSpanForRequest(shouldCreateSpans, this._tracing, clientOptions);\n\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.tracePropagationTargets]) || _optionalChain([this, 'access', _7 => _7._tracing, 'optionalAccess', _8 => _8.tracePropagationTargets]);\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpModule = require('http');\n const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(\n httpModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpModule, 'get', wrappedHttpHandlerMaker);\n fill(httpModule, 'request', wrappedHttpHandlerMaker);\n\n // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n // If we do, we'd get double breadcrumbs and double spans for `https` calls.\n // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.\n if (NODE_VERSION.major > 8) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpsModule = require('https');\n const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(\n httpsModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpsModule, 'get', wrappedHttpsHandlerMaker);\n fill(httpsModule, 'request', wrappedHttpsHandlerMaker);\n }\n }\n}Http.__initStatic();\n\n// for ease of reading below\n\n/**\n * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`\n * and `https` modules. (NB: Not a typo - this is a creator^2!)\n *\n * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs\n * @param tracingEnabled Whether or not to record outgoing requests as tracing spans\n *\n * @returns A function which accepts the exiting handler and returns a wrapped handler\n */\nfunction _createWrappedRequestMethodFactory(\n httpModule,\n breadcrumbsEnabled,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n) {\n // We're caching results so we don't have to recompute regexp every time we create a request.\n const createSpanUrlMap = new LRUMap(100);\n const headersUrlMap = new LRUMap(100);\n\n const shouldCreateSpan = (url) => {\n if (shouldCreateSpanForRequest === undefined) {\n return true;\n }\n\n const cachedDecision = createSpanUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = shouldCreateSpanForRequest(url);\n createSpanUrlMap.set(url, decision);\n return decision;\n };\n\n const shouldAttachTraceData = (url) => {\n if (tracePropagationTargets === undefined) {\n return true;\n }\n\n const cachedDecision = headersUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = stringMatchesSomePattern(url, tracePropagationTargets);\n headersUrlMap.set(url, decision);\n return decision;\n };\n\n /**\n * Captures Breadcrumb based on provided request/response pair\n */\n function addRequestBreadcrumb(\n event,\n requestSpanData,\n req,\n res,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n if (!getCurrentHub().getIntegration(Http)) {\n return;\n }\n\n addBreadcrumb(\n {\n category: 'http',\n data: {\n status_code: res && res.statusCode,\n ...requestSpanData,\n },\n type: 'http',\n },\n {\n event,\n request: req,\n response: res,\n },\n );\n }\n\n return function wrappedRequestMethodFactory(originalRequestMethod) {\n return function wrappedMethod( ...args) {\n const requestArgs = normalizeRequestArgs(httpModule, args);\n const requestOptions = requestArgs[0];\n // eslint-disable-next-line deprecation/deprecation\n const rawRequestUrl = extractRawUrl(requestOptions);\n const requestUrl = extractUrl(requestOptions);\n const client = getClient();\n\n // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n if (isSentryRequestUrl(requestUrl, client)) {\n return originalRequestMethod.apply(httpModule, requestArgs);\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n const parentSpan = getActiveSpan();\n\n const data = getRequestSpanData(requestUrl, requestOptions);\n\n const requestSpan = shouldCreateSpan(rawRequestUrl)\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([parentSpan, 'optionalAccess', _9 => _9.startChild, 'call', _10 => _10({\n op: 'http.client',\n origin: 'auto.http.node.http',\n description: `${data['http.method']} ${data.url}`,\n data,\n })])\n : undefined;\n\n if (client && shouldAttachTraceData(rawRequestUrl)) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = requestSpan\n ? spanToTraceHeader(requestSpan)\n : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (requestSpan\n ? getDynamicSamplingContextFromSpan(requestSpan)\n : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, sentryBaggageHeader);\n } else {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalRequestMethod\n .apply(httpModule, requestArgs)\n .once('response', function ( res) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('response', data, req, res);\n }\n if (requestSpan) {\n if (res.statusCode) {\n setHttpStatus(requestSpan, res.statusCode);\n }\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n })\n .once('error', function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('error', data, req);\n }\n if (requestSpan) {\n setHttpStatus(requestSpan, 500);\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n });\n };\n };\n}\n\nfunction addHeadersToRequestOptions(\n requestOptions,\n requestUrl,\n sentryTraceHeader,\n sentryBaggageHeader,\n) {\n // Don't overwrite sentry-trace and baggage header if it's already set.\n const headers = requestOptions.headers || {};\n if (headers['sentry-trace']) {\n return;\n }\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to \"${requestUrl}\": `);\n\n requestOptions.headers = {\n ...requestOptions.headers,\n 'sentry-trace': sentryTraceHeader,\n // Setting a header to `undefined` will crash in node so we only set the baggage header when it's defined\n ...(sentryBaggageHeader &&\n sentryBaggageHeader.length > 0 && { baggage: normalizeBaggageHeader(requestOptions, sentryBaggageHeader) }),\n };\n}\n\nfunction getRequestSpanData(requestUrl, requestOptions) {\n const method = requestOptions.method || 'GET';\n const data = {\n url: requestUrl,\n 'http.method': method,\n };\n if (requestOptions.hash) {\n // strip leading \"#\"\n data['http.fragment'] = requestOptions.hash.substring(1);\n }\n if (requestOptions.search) {\n // strip leading \"?\"\n data['http.query'] = requestOptions.search.substring(1);\n }\n return data;\n}\n\nfunction normalizeBaggageHeader(\n requestOptions,\n sentryBaggageHeader,\n) {\n if (!requestOptions.headers || !requestOptions.headers.baggage) {\n return sentryBaggageHeader;\n } else if (!sentryBaggageHeader) {\n return requestOptions.headers.baggage ;\n } else if (Array.isArray(requestOptions.headers.baggage)) {\n return [...requestOptions.headers.baggage, sentryBaggageHeader];\n }\n // Type-cast explanation:\n // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity\n // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.\n return [requestOptions.headers.baggage, sentryBaggageHeader] ;\n}\n\n/** Exported for tests only. */\nfunction _shouldCreateSpans(\n tracingOptions,\n clientOptions,\n) {\n return tracingOptions === undefined\n ? false\n : tracingOptions.enableIfHasTracingEnabled\n ? hasTracingEnabled(clientOptions)\n : true;\n}\n\n/** Exported for tests only. */\nfunction _getShouldCreateSpanForRequest(\n shouldCreateSpans,\n tracingOptions,\n clientOptions,\n) {\n const handler = shouldCreateSpans\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([tracingOptions, 'optionalAccess', _11 => _11.shouldCreateSpanForRequest]) || _optionalChain([clientOptions, 'optionalAccess', _12 => _12.shouldCreateSpanForRequest])\n : () => false;\n\n return handler;\n}\n\nexport { Http, _getShouldCreateSpanForRequest, _shouldCreateSpans, httpIntegration };\n//# sourceMappingURL=http.js.map\n"],"names":["tracing","dropUndefinedKeys","defineIntegration","_optionalChain","DEBUG_BUILD","logger","fill","NODE_VERSION","LRUMap","stringMatchesSomePattern","getCurrentHub","addBreadcrumb","normalizeRequestArgs","extractRawUrl","extractUrl","getClient","isSentryRequestUrl","getCurrentScope","getIsolationScope","getActiveSpan","spanToTraceHeader","generateSentryTraceHeader","dynamicSamplingContextToSentryBaggageHeader","getDynamicSamplingContextFromSpan","getDynamicSamplingContextFromClient","setHttpStatus","cleanSpanDescription","spanToJSON","hasTracingEnabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,mBAAoB,CAAC,UAAU,OAAO;AAC1C,QAAM,EAAE,aAAa,SAAAA,UAAS,2BAA0B,IAAK;AAE7D,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA,SACEA,aAAY,QACR,QACAC,yBAAkB;AAAA;AAAA,MAEhB,2BAA2BD,aAAY,OAAO,SAAY;AAAA,MAC1D;AAAA,IACZ,CAAW;AAAA,EACX;AAGE,SAAO,IAAI,KAAK,gBAAgB;AAClC;AAQK,MAAC,kBAAkBE,YAAiB,kBAAC,gBAAgB;AAQ1D,MAAM,KAAM;AAAA;AAAA;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C,QAAM,OAAO;AAAA,IACX,KAAK;AAAA,IACL,eAAe;AAAA,EACnB;AACE,MAAI,eAAe,MAAM;AAEvB,SAAK,eAAe,IAAI,eAAe,KAAK,UAAU,CAAC;AAAA,EACxD;AACD,MAAI,eAAe,QAAQ;AAEzB,SAAK,YAAY,IAAI,eAAe,OAAO,UAAU,CAAC;AAAA,EACvD;AACD,SAAO;AACT;AAEA,SAAS,uBACP,gBACA,qBACA;AACA,MAAI,CAAC,eAAe,WAAW,CAAC,eAAe,QAAQ,SAAS;AAC9D,WAAO;AAAA,EACX,WAAa,CAAC,qBAAqB;AAC/B,WAAO,eAAe,QAAQ;AAAA,EAClC,WAAa,MAAM,QAAQ,eAAe,QAAQ,OAAO,GAAG;AACxD,WAAO,CAAC,GAAG,eAAe,QAAQ,SAAS,mBAAmB;AAAA,EAC/D;AAID,SAAO,CAAC,eAAe,QAAQ,SAAS,mBAAmB;AAC7D;AAGA,SAAS,mBACP,gBACA,eACA;AACA,SAAO,mBAAmB,SACtB,QACA,eAAe,4BACbuB,kBAAAA,kBAAkB,aAAa,IAC/B;AACR;AAGA,SAAS,+BACP,mBACA,gBACA,eACA;AACA,QAAM,UAAU;AAAA;AAAA,IAEZzB,eAAc,eAAC,CAAC,gBAAgB,kBAAkB,SAAO,IAAI,0BAA0B,CAAC,KAAKA,eAAAA,eAAe,CAAC,eAAe,kBAAkB,SAAO,IAAI,0BAA0B,CAAC;AAAA,MACpL,MAAM;AAEV,SAAO;AACT;;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"http.cjs","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/http.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, getClient, isSentryRequestUrl, getCurrentScope, getIsolationScope, getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient, setHttpStatus, spanToJSON, hasTracingEnabled, getCurrentHub, addBreadcrumb } from '@sentry/core';\nimport { dropUndefinedKeys, logger, fill, LRUMap, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { NODE_VERSION } from '../nodeVersion.js';\nimport { normalizeRequestArgs, extractRawUrl, extractUrl, cleanSpanDescription } from './utils/http.js';\n\nconst _httpIntegration = ((options = {}) => {\n const { breadcrumbs, tracing, shouldCreateSpanForRequest } = options;\n\n const convertedOptions = {\n breadcrumbs,\n tracing:\n tracing === false\n ? false\n : dropUndefinedKeys({\n // If tracing is forced to `true`, we don't want to set `enableIfHasTracingEnabled`\n enableIfHasTracingEnabled: tracing === true ? undefined : true,\n shouldCreateSpanForRequest,\n }),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n return new Http(convertedOptions) ;\n}) ;\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, spans for outgoing\n * http requests, and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * By default, this will always create breadcrumbs, and will create spans if tracing is enabled.\n */\nconst httpIntegration = defineIntegration(_httpIntegration);\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing\n * http requests and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * @deprecated Use `httpIntegration()` instead.\n */\nclass Http {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Http';}\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n __init() {this.name = Http.id;}\n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {Http.prototype.__init.call(this);\n this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(\n _addGlobalEventProcessor,\n // eslint-disable-next-line deprecation/deprecation\n setupOnceGetCurrentHub,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);\n\n // If `tracing` is not explicitly set, we default this based on whether or not tracing is enabled.\n // But for compatibility, we only do that if `enableIfHasTracingEnabled` is set.\n const shouldCreateSpans = _shouldCreateSpans(this._tracing, clientOptions);\n\n // No need to instrument if we don't want to track anything\n if (!this._breadcrumbs && !shouldCreateSpans) {\n return;\n }\n\n // Do not auto-instrument for other instrumenter\n if (clientOptions && clientOptions.instrumenter !== 'sentry') {\n DEBUG_BUILD && logger.log('HTTP Integration is skipped because of instrumenter configuration.');\n return;\n }\n\n const shouldCreateSpanForRequest = _getShouldCreateSpanForRequest(shouldCreateSpans, this._tracing, clientOptions);\n\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.tracePropagationTargets]) || _optionalChain([this, 'access', _7 => _7._tracing, 'optionalAccess', _8 => _8.tracePropagationTargets]);\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpModule = require('http');\n const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(\n httpModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpModule, 'get', wrappedHttpHandlerMaker);\n fill(httpModule, 'request', wrappedHttpHandlerMaker);\n\n // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n // If we do, we'd get double breadcrumbs and double spans for `https` calls.\n // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.\n if (NODE_VERSION.major > 8) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpsModule = require('https');\n const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(\n httpsModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpsModule, 'get', wrappedHttpsHandlerMaker);\n fill(httpsModule, 'request', wrappedHttpsHandlerMaker);\n }\n }\n}Http.__initStatic();\n\n// for ease of reading below\n\n/**\n * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`\n * and `https` modules. (NB: Not a typo - this is a creator^2!)\n *\n * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs\n * @param tracingEnabled Whether or not to record outgoing requests as tracing spans\n *\n * @returns A function which accepts the exiting handler and returns a wrapped handler\n */\nfunction _createWrappedRequestMethodFactory(\n httpModule,\n breadcrumbsEnabled,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n) {\n // We're caching results so we don't have to recompute regexp every time we create a request.\n const createSpanUrlMap = new LRUMap(100);\n const headersUrlMap = new LRUMap(100);\n\n const shouldCreateSpan = (url) => {\n if (shouldCreateSpanForRequest === undefined) {\n return true;\n }\n\n const cachedDecision = createSpanUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = shouldCreateSpanForRequest(url);\n createSpanUrlMap.set(url, decision);\n return decision;\n };\n\n const shouldAttachTraceData = (url) => {\n if (tracePropagationTargets === undefined) {\n return true;\n }\n\n const cachedDecision = headersUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = stringMatchesSomePattern(url, tracePropagationTargets);\n headersUrlMap.set(url, decision);\n return decision;\n };\n\n /**\n * Captures Breadcrumb based on provided request/response pair\n */\n function addRequestBreadcrumb(\n event,\n requestSpanData,\n req,\n res,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n if (!getCurrentHub().getIntegration(Http)) {\n return;\n }\n\n addBreadcrumb(\n {\n category: 'http',\n data: {\n status_code: res && res.statusCode,\n ...requestSpanData,\n },\n type: 'http',\n },\n {\n event,\n request: req,\n response: res,\n },\n );\n }\n\n return function wrappedRequestMethodFactory(originalRequestMethod) {\n return function wrappedMethod( ...args) {\n const requestArgs = normalizeRequestArgs(httpModule, args);\n const requestOptions = requestArgs[0];\n // eslint-disable-next-line deprecation/deprecation\n const rawRequestUrl = extractRawUrl(requestOptions);\n const requestUrl = extractUrl(requestOptions);\n const client = getClient();\n\n // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n if (isSentryRequestUrl(requestUrl, client)) {\n return originalRequestMethod.apply(httpModule, requestArgs);\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n const parentSpan = getActiveSpan();\n\n const data = getRequestSpanData(requestUrl, requestOptions);\n\n const requestSpan = shouldCreateSpan(rawRequestUrl)\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([parentSpan, 'optionalAccess', _9 => _9.startChild, 'call', _10 => _10({\n op: 'http.client',\n origin: 'auto.http.node.http',\n description: `${data['http.method']} ${data.url}`,\n data,\n })])\n : undefined;\n\n if (client && shouldAttachTraceData(rawRequestUrl)) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = requestSpan\n ? spanToTraceHeader(requestSpan)\n : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (requestSpan\n ? getDynamicSamplingContextFromSpan(requestSpan)\n : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, sentryBaggageHeader);\n } else {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalRequestMethod\n .apply(httpModule, requestArgs)\n .once('response', function ( res) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('response', data, req, res);\n }\n if (requestSpan) {\n if (res.statusCode) {\n setHttpStatus(requestSpan, res.statusCode);\n }\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n })\n .once('error', function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('error', data, req);\n }\n if (requestSpan) {\n setHttpStatus(requestSpan, 500);\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n });\n };\n };\n}\n\nfunction addHeadersToRequestOptions(\n requestOptions,\n requestUrl,\n sentryTraceHeader,\n sentryBaggageHeader,\n) {\n // Don't overwrite sentry-trace and baggage header if it's already set.\n const headers = requestOptions.headers || {};\n if (headers['sentry-trace']) {\n return;\n }\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to \"${requestUrl}\": `);\n\n requestOptions.headers = {\n ...requestOptions.headers,\n 'sentry-trace': sentryTraceHeader,\n // Setting a header to `undefined` will crash in node so we only set the baggage header when it's defined\n ...(sentryBaggageHeader &&\n sentryBaggageHeader.length > 0 && { baggage: normalizeBaggageHeader(requestOptions, sentryBaggageHeader) }),\n };\n}\n\nfunction getRequestSpanData(requestUrl, requestOptions) {\n const method = requestOptions.method || 'GET';\n const data = {\n url: requestUrl,\n 'http.method': method,\n };\n if (requestOptions.hash) {\n // strip leading \"#\"\n data['http.fragment'] = requestOptions.hash.substring(1);\n }\n if (requestOptions.search) {\n // strip leading \"?\"\n data['http.query'] = requestOptions.search.substring(1);\n }\n return data;\n}\n\nfunction normalizeBaggageHeader(\n requestOptions,\n sentryBaggageHeader,\n) {\n if (!requestOptions.headers || !requestOptions.headers.baggage) {\n return sentryBaggageHeader;\n } else if (!sentryBaggageHeader) {\n return requestOptions.headers.baggage ;\n } else if (Array.isArray(requestOptions.headers.baggage)) {\n return [...requestOptions.headers.baggage, sentryBaggageHeader];\n }\n // Type-cast explanation:\n // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity\n // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.\n return [requestOptions.headers.baggage, sentryBaggageHeader] ;\n}\n\n/** Exported for tests only. */\nfunction _shouldCreateSpans(\n tracingOptions,\n clientOptions,\n) {\n return tracingOptions === undefined\n ? false\n : tracingOptions.enableIfHasTracingEnabled\n ? hasTracingEnabled(clientOptions)\n : true;\n}\n\n/** Exported for tests only. */\nfunction _getShouldCreateSpanForRequest(\n shouldCreateSpans,\n tracingOptions,\n clientOptions,\n) {\n const handler = shouldCreateSpans\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([tracingOptions, 'optionalAccess', _11 => _11.shouldCreateSpanForRequest]) || _optionalChain([clientOptions, 'optionalAccess', _12 => _12.shouldCreateSpanForRequest])\n : () => false;\n\n return handler;\n}\n\nexport { Http, _getShouldCreateSpanForRequest, _shouldCreateSpans, httpIntegration };\n//# sourceMappingURL=http.js.map\n"],"names":["tracing","dropUndefinedKeys","defineIntegration","_optionalChain","DEBUG_BUILD","logger","fill","NODE_VERSION","LRUMap","stringMatchesSomePattern","getCurrentHub","addBreadcrumb","normalizeRequestArgs","extractRawUrl","extractUrl","getClient","isSentryRequestUrl","getCurrentScope","getIsolationScope","getActiveSpan","spanToTraceHeader","generateSentryTraceHeader","dynamicSamplingContextToSentryBaggageHeader","getDynamicSamplingContextFromSpan","getDynamicSamplingContextFromClient","setHttpStatus","cleanSpanDescription","spanToJSON","hasTracingEnabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,mBAAoB,CAAC,UAAU,OAAO;AAC1C,QAAM,EAAE,aAAa,SAAAA,UAAS,2BAA0B,IAAK;AAE7D,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA,SACEA,aAAY,QACR,QACAC,yBAAkB;AAAA;AAAA,MAEhB,2BAA2BD,aAAY,OAAO,SAAY;AAAA,MAC1D;AAAA,IACZ,CAAW;AAAA,EACX;AAGE,SAAO,IAAI,KAAK,gBAAgB;AAClC;AAQK,MAAC,kBAAkBE,YAAiB,kBAAC,gBAAgB;AAQ1D,MAAM,KAA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AY,gBAAgB;AACtD,QAAM,SAAS,eAAe,UAAU;AACxC,QAAM,OAAO;AAAA,IACX,KAAK;AAAA,IACL,eAAe;AAAA,EACnB;AACE,MAAI,eAAe,MAAM;AAEvB,SAAK,eAAe,IAAI,eAAe,KAAK,UAAU,CAAC;AAAA,EACxD;AACD,MAAI,eAAe,QAAQ;AAEzB,SAAK,YAAY,IAAI,eAAe,OAAO,UAAU,CAAC;AAAA,EACvD;AACD,SAAO;AACT;AAEA,SAAS,uBACP,gBACA,qBACA;AACA,MAAI,CAAC,eAAe,WAAW,CAAC,eAAe,QAAQ,SAAS;AAC9D,WAAO;AAAA,EACX,WAAa,CAAC,qBAAqB;AAC/B,WAAO,eAAe,QAAQ;AAAA,EAClC,WAAa,MAAM,QAAQ,eAAe,QAAQ,OAAO,GAAG;AACxD,WAAO,CAAC,GAAG,eAAe,QAAQ,SAAS,mBAAmB;AAAA,EAC/D;AAID,SAAO,CAAC,eAAe,QAAQ,SAAS,mBAAmB;AAC7D;AAGA,SAAS,mBACP,gBACA,eACA;AACA,SAAO,mBAAmB,SACtB,QACA,eAAe,4BACbuB,kBAAAA,kBAAkB,aAAa,IAC/B;AACR;AAGA,SAAS,+BACP,mBACA,gBACA,eACA;AACA,QAAM,UAAU;AAAA;AAAA,IAEZzB,eAAc,eAAC,CAAC,gBAAgB,kBAAkB,SAAO,IAAI,0BAA0B,CAAC,KAAKA,eAAAA,eAAe,CAAC,eAAe,kBAAkB,SAAO,IAAI,0BAA0B,CAAC;AAAA,MACpL,MAAM;AAEV,SAAO;AACT;;;;;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/http.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, getClient, isSentryRequestUrl, getCurrentScope, getIsolationScope, getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient, setHttpStatus, spanToJSON, hasTracingEnabled, getCurrentHub, addBreadcrumb } from '@sentry/core';\nimport { dropUndefinedKeys, logger, fill, LRUMap, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { NODE_VERSION } from '../nodeVersion.js';\nimport { normalizeRequestArgs, extractRawUrl, extractUrl, cleanSpanDescription } from './utils/http.js';\n\nconst _httpIntegration = ((options = {}) => {\n const { breadcrumbs, tracing, shouldCreateSpanForRequest } = options;\n\n const convertedOptions = {\n breadcrumbs,\n tracing:\n tracing === false\n ? false\n : dropUndefinedKeys({\n // If tracing is forced to `true`, we don't want to set `enableIfHasTracingEnabled`\n enableIfHasTracingEnabled: tracing === true ? undefined : true,\n shouldCreateSpanForRequest,\n }),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n return new Http(convertedOptions) ;\n}) ;\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, spans for outgoing\n * http requests, and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * By default, this will always create breadcrumbs, and will create spans if tracing is enabled.\n */\nconst httpIntegration = defineIntegration(_httpIntegration);\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing\n * http requests and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * @deprecated Use `httpIntegration()` instead.\n */\nclass Http {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Http';}\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n __init() {this.name = Http.id;}\n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {Http.prototype.__init.call(this);\n this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(\n _addGlobalEventProcessor,\n // eslint-disable-next-line deprecation/deprecation\n setupOnceGetCurrentHub,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);\n\n // If `tracing` is not explicitly set, we default this based on whether or not tracing is enabled.\n // But for compatibility, we only do that if `enableIfHasTracingEnabled` is set.\n const shouldCreateSpans = _shouldCreateSpans(this._tracing, clientOptions);\n\n // No need to instrument if we don't want to track anything\n if (!this._breadcrumbs && !shouldCreateSpans) {\n return;\n }\n\n // Do not auto-instrument for other instrumenter\n if (clientOptions && clientOptions.instrumenter !== 'sentry') {\n DEBUG_BUILD && logger.log('HTTP Integration is skipped because of instrumenter configuration.');\n return;\n }\n\n const shouldCreateSpanForRequest = _getShouldCreateSpanForRequest(shouldCreateSpans, this._tracing, clientOptions);\n\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.tracePropagationTargets]) || _optionalChain([this, 'access', _7 => _7._tracing, 'optionalAccess', _8 => _8.tracePropagationTargets]);\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpModule = require('http');\n const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(\n httpModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpModule, 'get', wrappedHttpHandlerMaker);\n fill(httpModule, 'request', wrappedHttpHandlerMaker);\n\n // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n // If we do, we'd get double breadcrumbs and double spans for `https` calls.\n // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.\n if (NODE_VERSION.major > 8) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpsModule = require('https');\n const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(\n httpsModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpsModule, 'get', wrappedHttpsHandlerMaker);\n fill(httpsModule, 'request', wrappedHttpsHandlerMaker);\n }\n }\n}Http.__initStatic();\n\n// for ease of reading below\n\n/**\n * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`\n * and `https` modules. (NB: Not a typo - this is a creator^2!)\n *\n * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs\n * @param tracingEnabled Whether or not to record outgoing requests as tracing spans\n *\n * @returns A function which accepts the exiting handler and returns a wrapped handler\n */\nfunction _createWrappedRequestMethodFactory(\n httpModule,\n breadcrumbsEnabled,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n) {\n // We're caching results so we don't have to recompute regexp every time we create a request.\n const createSpanUrlMap = new LRUMap(100);\n const headersUrlMap = new LRUMap(100);\n\n const shouldCreateSpan = (url) => {\n if (shouldCreateSpanForRequest === undefined) {\n return true;\n }\n\n const cachedDecision = createSpanUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = shouldCreateSpanForRequest(url);\n createSpanUrlMap.set(url, decision);\n return decision;\n };\n\n const shouldAttachTraceData = (url) => {\n if (tracePropagationTargets === undefined) {\n return true;\n }\n\n const cachedDecision = headersUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = stringMatchesSomePattern(url, tracePropagationTargets);\n headersUrlMap.set(url, decision);\n return decision;\n };\n\n /**\n * Captures Breadcrumb based on provided request/response pair\n */\n function addRequestBreadcrumb(\n event,\n requestSpanData,\n req,\n res,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n if (!getCurrentHub().getIntegration(Http)) {\n return;\n }\n\n addBreadcrumb(\n {\n category: 'http',\n data: {\n status_code: res && res.statusCode,\n ...requestSpanData,\n },\n type: 'http',\n },\n {\n event,\n request: req,\n response: res,\n },\n );\n }\n\n return function wrappedRequestMethodFactory(originalRequestMethod) {\n return function wrappedMethod( ...args) {\n const requestArgs = normalizeRequestArgs(httpModule, args);\n const requestOptions = requestArgs[0];\n // eslint-disable-next-line deprecation/deprecation\n const rawRequestUrl = extractRawUrl(requestOptions);\n const requestUrl = extractUrl(requestOptions);\n const client = getClient();\n\n // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n if (isSentryRequestUrl(requestUrl, client)) {\n return originalRequestMethod.apply(httpModule, requestArgs);\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n const parentSpan = getActiveSpan();\n\n const data = getRequestSpanData(requestUrl, requestOptions);\n\n const requestSpan = shouldCreateSpan(rawRequestUrl)\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([parentSpan, 'optionalAccess', _9 => _9.startChild, 'call', _10 => _10({\n op: 'http.client',\n origin: 'auto.http.node.http',\n description: `${data['http.method']} ${data.url}`,\n data,\n })])\n : undefined;\n\n if (client && shouldAttachTraceData(rawRequestUrl)) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = requestSpan\n ? spanToTraceHeader(requestSpan)\n : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (requestSpan\n ? getDynamicSamplingContextFromSpan(requestSpan)\n : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, sentryBaggageHeader);\n } else {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalRequestMethod\n .apply(httpModule, requestArgs)\n .once('response', function ( res) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('response', data, req, res);\n }\n if (requestSpan) {\n if (res.statusCode) {\n setHttpStatus(requestSpan, res.statusCode);\n }\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n })\n .once('error', function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('error', data, req);\n }\n if (requestSpan) {\n setHttpStatus(requestSpan, 500);\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n });\n };\n };\n}\n\nfunction addHeadersToRequestOptions(\n requestOptions,\n requestUrl,\n sentryTraceHeader,\n sentryBaggageHeader,\n) {\n // Don't overwrite sentry-trace and baggage header if it's already set.\n const headers = requestOptions.headers || {};\n if (headers['sentry-trace']) {\n return;\n }\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to \"${requestUrl}\": `);\n\n requestOptions.headers = {\n ...requestOptions.headers,\n 'sentry-trace': sentryTraceHeader,\n // Setting a header to `undefined` will crash in node so we only set the baggage header when it's defined\n ...(sentryBaggageHeader &&\n sentryBaggageHeader.length > 0 && { baggage: normalizeBaggageHeader(requestOptions, sentryBaggageHeader) }),\n };\n}\n\nfunction getRequestSpanData(requestUrl, requestOptions) {\n const method = requestOptions.method || 'GET';\n const data = {\n url: requestUrl,\n 'http.method': method,\n };\n if (requestOptions.hash) {\n // strip leading \"#\"\n data['http.fragment'] = requestOptions.hash.substring(1);\n }\n if (requestOptions.search) {\n // strip leading \"?\"\n data['http.query'] = requestOptions.search.substring(1);\n }\n return data;\n}\n\nfunction normalizeBaggageHeader(\n requestOptions,\n sentryBaggageHeader,\n) {\n if (!requestOptions.headers || !requestOptions.headers.baggage) {\n return sentryBaggageHeader;\n } else if (!sentryBaggageHeader) {\n return requestOptions.headers.baggage ;\n } else if (Array.isArray(requestOptions.headers.baggage)) {\n return [...requestOptions.headers.baggage, sentryBaggageHeader];\n }\n // Type-cast explanation:\n // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity\n // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.\n return [requestOptions.headers.baggage, sentryBaggageHeader] ;\n}\n\n/** Exported for tests only. */\nfunction _shouldCreateSpans(\n tracingOptions,\n clientOptions,\n) {\n return tracingOptions === undefined\n ? false\n : tracingOptions.enableIfHasTracingEnabled\n ? hasTracingEnabled(clientOptions)\n : true;\n}\n\n/** Exported for tests only. */\nfunction _getShouldCreateSpanForRequest(\n shouldCreateSpans,\n tracingOptions,\n clientOptions,\n) {\n const handler = shouldCreateSpans\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([tracingOptions, 'optionalAccess', _11 => _11.shouldCreateSpanForRequest]) || _optionalChain([clientOptions, 'optionalAccess', _12 => _12.shouldCreateSpanForRequest])\n : () => false;\n\n return handler;\n}\n\nexport { Http, _getShouldCreateSpanForRequest, _shouldCreateSpans, httpIntegration };\n//# sourceMappingURL=http.js.map\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MAAM,mBAAoB,CAAC,UAAU,OAAO;AAC1C,QAAM,EAAE,aAAa,SAAS,2BAA0B,IAAK;AAE7D,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA,SACE,YAAY,QACR,QACA,kBAAkB;AAAA;AAAA,MAEhB,2BAA2B,YAAY,OAAO,SAAY;AAAA,MAC1D;AAAA,IACZ,CAAW;AAAA,EACX;AAGE,SAAO,IAAI,KAAK,gBAAgB;AAClC;AAQK,MAAC,kBAAkB,kBAAkB,gBAAgB;AAQ1D,MAAM,KAAM;AAAA;AAAA;AAAA;AAAA,EAIT,OAAO,eAAe;AAAC,SAAK,KAAK;AAAA,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,SAAS;AAAC,SAAK,OAAO,KAAK;AAAA,EAAG;AAAA;AAAA;AAAA;AAAA,EAK9B,YAAY,UAAU,CAAA,GAAI;AAAC,SAAK,UAAU,OAAO,KAAK,IAAI;AACzD,SAAK,eAAe,OAAO,QAAQ,gBAAgB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SAAO,CAAC,eAAe,QAAQ,SAAS,mBAAmB;AAC7D;AAGA,SAAS,mBACP,gBACA,eACA;AACA,SAAO,mBAAmB,SACtB,QACA,eAAe,4BACb,kBAAkB,aAAa,IAC/B;AACR;AAGA,SAAS,+BACP,mBACA,gBACA,eACA;AACA,QAAM,UAAU;AAAA;AAAA,IAEZ,eAAe,CAAC,gBAAgB,kBAAkB,SAAO,IAAI,0BAA0B,CAAC,KAAK,eAAe,CAAC,eAAe,kBAAkB,SAAO,IAAI,0BAA0B,CAAC;AAAA,MACpL,MAAM;AAEV,SAAO;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"http.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/http.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, getClient, isSentryRequestUrl, getCurrentScope, getIsolationScope, getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient, setHttpStatus, spanToJSON, hasTracingEnabled, getCurrentHub, addBreadcrumb } from '@sentry/core';\nimport { dropUndefinedKeys, logger, fill, LRUMap, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { NODE_VERSION } from '../nodeVersion.js';\nimport { normalizeRequestArgs, extractRawUrl, extractUrl, cleanSpanDescription } from './utils/http.js';\n\nconst _httpIntegration = ((options = {}) => {\n const { breadcrumbs, tracing, shouldCreateSpanForRequest } = options;\n\n const convertedOptions = {\n breadcrumbs,\n tracing:\n tracing === false\n ? false\n : dropUndefinedKeys({\n // If tracing is forced to `true`, we don't want to set `enableIfHasTracingEnabled`\n enableIfHasTracingEnabled: tracing === true ? undefined : true,\n shouldCreateSpanForRequest,\n }),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n return new Http(convertedOptions) ;\n}) ;\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, spans for outgoing\n * http requests, and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * By default, this will always create breadcrumbs, and will create spans if tracing is enabled.\n */\nconst httpIntegration = defineIntegration(_httpIntegration);\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing\n * http requests and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * @deprecated Use `httpIntegration()` instead.\n */\nclass Http {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Http';}\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n __init() {this.name = Http.id;}\n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {Http.prototype.__init.call(this);\n this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(\n _addGlobalEventProcessor,\n // eslint-disable-next-line deprecation/deprecation\n setupOnceGetCurrentHub,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);\n\n // If `tracing` is not explicitly set, we default this based on whether or not tracing is enabled.\n // But for compatibility, we only do that if `enableIfHasTracingEnabled` is set.\n const shouldCreateSpans = _shouldCreateSpans(this._tracing, clientOptions);\n\n // No need to instrument if we don't want to track anything\n if (!this._breadcrumbs && !shouldCreateSpans) {\n return;\n }\n\n // Do not auto-instrument for other instrumenter\n if (clientOptions && clientOptions.instrumenter !== 'sentry') {\n DEBUG_BUILD && logger.log('HTTP Integration is skipped because of instrumenter configuration.');\n return;\n }\n\n const shouldCreateSpanForRequest = _getShouldCreateSpanForRequest(shouldCreateSpans, this._tracing, clientOptions);\n\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.tracePropagationTargets]) || _optionalChain([this, 'access', _7 => _7._tracing, 'optionalAccess', _8 => _8.tracePropagationTargets]);\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpModule = require('http');\n const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(\n httpModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpModule, 'get', wrappedHttpHandlerMaker);\n fill(httpModule, 'request', wrappedHttpHandlerMaker);\n\n // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n // If we do, we'd get double breadcrumbs and double spans for `https` calls.\n // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.\n if (NODE_VERSION.major > 8) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpsModule = require('https');\n const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(\n httpsModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpsModule, 'get', wrappedHttpsHandlerMaker);\n fill(httpsModule, 'request', wrappedHttpsHandlerMaker);\n }\n }\n}Http.__initStatic();\n\n// for ease of reading below\n\n/**\n * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`\n * and `https` modules. (NB: Not a typo - this is a creator^2!)\n *\n * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs\n * @param tracingEnabled Whether or not to record outgoing requests as tracing spans\n *\n * @returns A function which accepts the exiting handler and returns a wrapped handler\n */\nfunction _createWrappedRequestMethodFactory(\n httpModule,\n breadcrumbsEnabled,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n) {\n // We're caching results so we don't have to recompute regexp every time we create a request.\n const createSpanUrlMap = new LRUMap(100);\n const headersUrlMap = new LRUMap(100);\n\n const shouldCreateSpan = (url) => {\n if (shouldCreateSpanForRequest === undefined) {\n return true;\n }\n\n const cachedDecision = createSpanUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = shouldCreateSpanForRequest(url);\n createSpanUrlMap.set(url, decision);\n return decision;\n };\n\n const shouldAttachTraceData = (url) => {\n if (tracePropagationTargets === undefined) {\n return true;\n }\n\n const cachedDecision = headersUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = stringMatchesSomePattern(url, tracePropagationTargets);\n headersUrlMap.set(url, decision);\n return decision;\n };\n\n /**\n * Captures Breadcrumb based on provided request/response pair\n */\n function addRequestBreadcrumb(\n event,\n requestSpanData,\n req,\n res,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n if (!getCurrentHub().getIntegration(Http)) {\n return;\n }\n\n addBreadcrumb(\n {\n category: 'http',\n data: {\n status_code: res && res.statusCode,\n ...requestSpanData,\n },\n type: 'http',\n },\n {\n event,\n request: req,\n response: res,\n },\n );\n }\n\n return function wrappedRequestMethodFactory(originalRequestMethod) {\n return function wrappedMethod( ...args) {\n const requestArgs = normalizeRequestArgs(httpModule, args);\n const requestOptions = requestArgs[0];\n // eslint-disable-next-line deprecation/deprecation\n const rawRequestUrl = extractRawUrl(requestOptions);\n const requestUrl = extractUrl(requestOptions);\n const client = getClient();\n\n // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n if (isSentryRequestUrl(requestUrl, client)) {\n return originalRequestMethod.apply(httpModule, requestArgs);\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n const parentSpan = getActiveSpan();\n\n const data = getRequestSpanData(requestUrl, requestOptions);\n\n const requestSpan = shouldCreateSpan(rawRequestUrl)\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([parentSpan, 'optionalAccess', _9 => _9.startChild, 'call', _10 => _10({\n op: 'http.client',\n origin: 'auto.http.node.http',\n description: `${data['http.method']} ${data.url}`,\n data,\n })])\n : undefined;\n\n if (client && shouldAttachTraceData(rawRequestUrl)) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = requestSpan\n ? spanToTraceHeader(requestSpan)\n : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (requestSpan\n ? getDynamicSamplingContextFromSpan(requestSpan)\n : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, sentryBaggageHeader);\n } else {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalRequestMethod\n .apply(httpModule, requestArgs)\n .once('response', function ( res) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('response', data, req, res);\n }\n if (requestSpan) {\n if (res.statusCode) {\n setHttpStatus(requestSpan, res.statusCode);\n }\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n })\n .once('error', function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('error', data, req);\n }\n if (requestSpan) {\n setHttpStatus(requestSpan, 500);\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n });\n };\n };\n}\n\nfunction addHeadersToRequestOptions(\n requestOptions,\n requestUrl,\n sentryTraceHeader,\n sentryBaggageHeader,\n) {\n // Don't overwrite sentry-trace and baggage header if it's already set.\n const headers = requestOptions.headers || {};\n if (headers['sentry-trace']) {\n return;\n }\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to \"${requestUrl}\": `);\n\n requestOptions.headers = {\n ...requestOptions.headers,\n 'sentry-trace': sentryTraceHeader,\n // Setting a header to `undefined` will crash in node so we only set the baggage header when it's defined\n ...(sentryBaggageHeader &&\n sentryBaggageHeader.length > 0 && { baggage: normalizeBaggageHeader(requestOptions, sentryBaggageHeader) }),\n };\n}\n\nfunction getRequestSpanData(requestUrl, requestOptions) {\n const method = requestOptions.method || 'GET';\n const data = {\n url: requestUrl,\n 'http.method': method,\n };\n if (requestOptions.hash) {\n // strip leading \"#\"\n data['http.fragment'] = requestOptions.hash.substring(1);\n }\n if (requestOptions.search) {\n // strip leading \"?\"\n data['http.query'] = requestOptions.search.substring(1);\n }\n return data;\n}\n\nfunction normalizeBaggageHeader(\n requestOptions,\n sentryBaggageHeader,\n) {\n if (!requestOptions.headers || !requestOptions.headers.baggage) {\n return sentryBaggageHeader;\n } else if (!sentryBaggageHeader) {\n return requestOptions.headers.baggage ;\n } else if (Array.isArray(requestOptions.headers.baggage)) {\n return [...requestOptions.headers.baggage, sentryBaggageHeader];\n }\n // Type-cast explanation:\n // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity\n // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.\n return [requestOptions.headers.baggage, sentryBaggageHeader] ;\n}\n\n/** Exported for tests only. */\nfunction _shouldCreateSpans(\n tracingOptions,\n clientOptions,\n) {\n return tracingOptions === undefined\n ? false\n : tracingOptions.enableIfHasTracingEnabled\n ? hasTracingEnabled(clientOptions)\n : true;\n}\n\n/** Exported for tests only. */\nfunction _getShouldCreateSpanForRequest(\n shouldCreateSpans,\n tracingOptions,\n clientOptions,\n) {\n const handler = shouldCreateSpans\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([tracingOptions, 'optionalAccess', _11 => _11.shouldCreateSpanForRequest]) || _optionalChain([clientOptions, 'optionalAccess', _12 => _12.shouldCreateSpanForRequest])\n : () => false;\n\n return handler;\n}\n\nexport { Http, _getShouldCreateSpanForRequest, _shouldCreateSpans, httpIntegration };\n//# sourceMappingURL=http.js.map\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MA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,EAAE,SAAS,uBAAuB,gBAAgB,mBAAmB;EAC7G;AACA;AAEA,SAAS,mBAAmB,YAAY,gBAAgB;AACtD,QAAM,SAAS,eAAe,UAAU;AACxC,QAAM,OAAO;AAAA,IACX,KAAK;AAAA,IACL,eAAe;AAAA,EACnB;AACE,MAAI,eAAe,MAAM;AAEvB,SAAK,eAAe,IAAI,eAAe,KAAK,UAAU,CAAC;AAAA,EACxD;AACD,MAAI,eAAe,QAAQ;AAEzB,SAAK,YAAY,IAAI,eAAe,OAAO,UAAU,CAAC;AAAA,EACvD;AACD,SAAO;AACT;AAEA,SAAS,uBACP,gBACA,qBACA;AACA,MAAI,CAAC,eAAe,WAAW,CAAC,eAAe,QAAQ,SAAS;AAC9D,WAAO;AAAA,EACX,WAAa,CAAC,qBAAqB;AAC/B,WAAO,eAAe,QAAQ;AAAA,EAClC,WAAa,MAAM,QAAQ,eAAe,QAAQ,OAAO,GAAG;AACxD,WAAO,CAAC,GAAG,eAAe,QAAQ,SAAS,mBAAmB;AAAA,EAC/D;AAID,SAAO,CAAC,eAAe,QAAQ,SAAS,mBAAmB;AAC7D;AAGA,SAAS,mBACP,gBACA,eACA;AACA,SAAO,mBAAmB,SACtB,QACA,eAAe,4BACb,kBAAkB,aAAa,IAC/B;AACR;AAGA,SAAS,+BACP,mBACA,gBACA,eACA;AACA,QAAM,UAAU;AAAA;AAAA,IAEZ,eAAe,CAAC,gBAAgB,kBAAkB,SAAO,IAAI,0BAA0B,CAAC,KAAK,eAAe,CAAC,eAAe,kBAAkB,SAAO,IAAI,0BAA0B,CAAC;AAAA,MACpL,MAAM;AAEV,SAAO;AACT;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"common.cjs","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/common.js"],"sourcesContent":["/**\n * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback\n * when a timeout has occurred.\n * @param maxPerSecond Maximum number of calls per second\n * @param enable Callback to enable capture\n * @param disable Callback to disable capture\n * @returns A function to call to increment the rate limiter count\n */\nfunction createRateLimiter(\n maxPerSecond,\n enable,\n disable,\n) {\n let count = 0;\n let retrySeconds = 5;\n let disabledTimeout = 0;\n\n setInterval(() => {\n if (disabledTimeout === 0) {\n if (count > maxPerSecond) {\n retrySeconds *= 2;\n disable(retrySeconds);\n\n // Cap at one day\n if (retrySeconds > 86400) {\n retrySeconds = 86400;\n }\n disabledTimeout = retrySeconds;\n }\n } else {\n disabledTimeout -= 1;\n\n if (disabledTimeout === 0) {\n enable();\n }\n }\n\n count = 0;\n }, 1000).unref();\n\n return () => {\n count += 1;\n };\n}\n\n// Add types for the exception event data\n\n/** Could this be an anonymous function? */\nfunction isAnonymous(name) {\n return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');\n}\n\n/** Do the function names appear to match? */\nfunction functionNamesMatch(a, b) {\n return a === b || (isAnonymous(a) && isAnonymous(b));\n}\n\n/** Creates a unique hash from stack frames */\nfunction hashFrames(frames) {\n if (frames === undefined) {\n return;\n }\n\n // Only hash the 10 most recent frames (ie. the last 10)\n return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');\n}\n\n/**\n * We use the stack parser to create a unique hash from the exception stack trace\n * This is used to lookup vars when the exception passes through the event processor\n */\nfunction hashFromStack(stackParser, stack) {\n if (stack === undefined) {\n return undefined;\n }\n\n return hashFrames(stackParser(stack, 1));\n}\n\nexport { createRateLimiter, functionNamesMatch, hashFrames, hashFromStack, isAnonymous };\n//# sourceMappingURL=common.js.map\n"],"names":[],"mappings":";;AAQA,SAAS,kBACP,cACA,QACA,SACA;AACA,MAAI,QAAQ;AACZ,MAAI,eAAe;AACnB,MAAI,kBAAkB;AAEtB,cAAY,MAAM;AAChB,QAAI,oBAAoB,GAAG;AACzB,UAAI,QAAQ,cAAc;AACxB,wBAAgB;AAChB,gBAAQ,YAAY;AAGpB,YAAI,eAAe,OAAO;AACxB,yBAAe;AAAA,QAChB;AACD,0BAAkB;AAAA,MACnB;AAAA,IACP,OAAW;AACL,yBAAmB;AAEnB,UAAI,oBAAoB,GAAG;AACzB;MACD;AAAA,IACF;AAED,YAAQ;AAAA,EACZ,GAAK,GAAI,EAAE;AAET,SAAO,MAAM;AACX,aAAS;AAAA,EACb;AACA;AAKA,SAAS,YAAY,MAAM;AACzB,SAAO,SAAS,WAAc,KAAK,WAAW,KAAK,SAAS,OAAO,SAAS;AAC9E;AAGA,SAAS,mBAAmB,GAAG,GAAG;AAChC,SAAO,MAAM,KAAM,YAAY,CAAC,KAAK,YAAY,CAAC;AACpD;AAGA,SAAS,WAAW,QAAQ;AAC1B,MAAI,WAAW,QAAW;AACxB;AAAA,EACD;AAGD,SAAO,OAAO,MAAM,GAAG,EAAE,OAAO,CAAC,KAAK,UAAU,GAAG,OAAO,MAAM,YAAY,MAAM,UAAU,MAAM,SAAS,EAAE;AAC/G;AAMA,SAAS,cAAc,aAAa,OAAO;AACzC,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACR;AAED,SAAO,WAAW,YAAY,OAAO,CAAC,CAAC;AACzC;;;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"common.cjs","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/common.js"],"sourcesContent":["/**\n * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback\n * when a timeout has occurred.\n * @param maxPerSecond Maximum number of calls per second\n * @param enable Callback to enable capture\n * @param disable Callback to disable capture\n * @returns A function to call to increment the rate limiter count\n */\nfunction createRateLimiter(\n maxPerSecond,\n enable,\n disable,\n) {\n let count = 0;\n let retrySeconds = 5;\n let disabledTimeout = 0;\n\n setInterval(() => {\n if (disabledTimeout === 0) {\n if (count > maxPerSecond) {\n retrySeconds *= 2;\n disable(retrySeconds);\n\n // Cap at one day\n if (retrySeconds > 86400) {\n retrySeconds = 86400;\n }\n disabledTimeout = retrySeconds;\n }\n } else {\n disabledTimeout -= 1;\n\n if (disabledTimeout === 0) {\n enable();\n }\n }\n\n count = 0;\n }, 1000).unref();\n\n return () => {\n count += 1;\n };\n}\n\n// Add types for the exception event data\n\n/** Could this be an anonymous function? */\nfunction isAnonymous(name) {\n return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');\n}\n\n/** Do the function names appear to match? */\nfunction functionNamesMatch(a, b) {\n return a === b || (isAnonymous(a) && isAnonymous(b));\n}\n\n/** Creates a unique hash from stack frames */\nfunction hashFrames(frames) {\n if (frames === undefined) {\n return;\n }\n\n // Only hash the 10 most recent frames (ie. the last 10)\n return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');\n}\n\n/**\n * We use the stack parser to create a unique hash from the exception stack trace\n * This is used to lookup vars when the exception passes through the event processor\n */\nfunction hashFromStack(stackParser, stack) {\n if (stack === undefined) {\n return undefined;\n }\n\n return hashFrames(stackParser(stack, 1));\n}\n\nexport { createRateLimiter, functionNamesMatch, hashFrames, hashFromStack, isAnonymous };\n//# sourceMappingURL=common.js.map\n"],"names":[],"mappings":";;AAQA,SAAS,kBACP,cACA,QACA,SACA;AACA,MAAI,QAAQ;AACZ,MAAI,eAAe;AACnB,MAAI,kBAAkB;AAEtB,cAAY,MAAM;AAChB,QAAI,oBAAoB,GAAG;AACzB,UAAI,QAAQ,cAAc;AACxB,wBAAgB;AAChB,gBAAQ,YAAY;AAGpB,YAAI,eAAe,OAAO;AACxB,yBAAe;AAAA,QAChB;AACD,0BAAkB;AAAA,MACnB;AAAA,IACP,OAAW;AACL,yBAAmB;AAEnB,UAAI,oBAAoB,GAAG;AACzB;MACD;AAAA,IACF;AAED,YAAQ;AAAA,EACZ,GAAK,GAAI,EAAE;AAET,SAAO,MAAM;AACX,aAAS;AAAA,EACb;AACA;AAKA,SAAS,YAAY,MAAM;AACzB,SAAO,SAAS,WAAc,KAAK,WAAW,KAAK,SAAS,OAAO,SAAS;AAC9E;AAGA,SAAS,mBAAmB,GAAG,GAAG;AAChC,SAAO,MAAM,KAAM,YAAY,CAAC,KAAK,YAAY,CAAC;AACpD;AAGA,SAAS,WAAW,QAAQ;AAC1B,MAAI,WAAW,QAAW;AACxB;AAAA,EACD;AAGD,SAAO,OAAO,MAAM,GAAG,EAAE,OAAO,CAAC,KAAK,UAAU,GAAG,GAAG,IAAI,MAAM,QAAQ,IAAI,MAAM,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE;AAC/G;AAMA,SAAS,cAAc,aAAa,OAAO;AACzC,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACR;AAED,SAAO,WAAW,YAAY,OAAO,CAAC,CAAC;AACzC;;;;;;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/common.js"],"sourcesContent":["/**\n * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback\n * when a timeout has occurred.\n * @param maxPerSecond Maximum number of calls per second\n * @param enable Callback to enable capture\n * @param disable Callback to disable capture\n * @returns A function to call to increment the rate limiter count\n */\nfunction createRateLimiter(\n maxPerSecond,\n enable,\n disable,\n) {\n let count = 0;\n let retrySeconds = 5;\n let disabledTimeout = 0;\n\n setInterval(() => {\n if (disabledTimeout === 0) {\n if (count > maxPerSecond) {\n retrySeconds *= 2;\n disable(retrySeconds);\n\n // Cap at one day\n if (retrySeconds > 86400) {\n retrySeconds = 86400;\n }\n disabledTimeout = retrySeconds;\n }\n } else {\n disabledTimeout -= 1;\n\n if (disabledTimeout === 0) {\n enable();\n }\n }\n\n count = 0;\n }, 1000).unref();\n\n return () => {\n count += 1;\n };\n}\n\n// Add types for the exception event data\n\n/** Could this be an anonymous function? */\nfunction isAnonymous(name) {\n return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');\n}\n\n/** Do the function names appear to match? */\nfunction functionNamesMatch(a, b) {\n return a === b || (isAnonymous(a) && isAnonymous(b));\n}\n\n/** Creates a unique hash from stack frames */\nfunction hashFrames(frames) {\n if (frames === undefined) {\n return;\n }\n\n // Only hash the 10 most recent frames (ie. the last 10)\n return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');\n}\n\n/**\n * We use the stack parser to create a unique hash from the exception stack trace\n * This is used to lookup vars when the exception passes through the event processor\n */\nfunction hashFromStack(stackParser, stack) {\n if (stack === undefined) {\n return undefined;\n }\n\n return hashFrames(stackParser(stack, 1));\n}\n\nexport { createRateLimiter, functionNamesMatch, hashFrames, hashFromStack, isAnonymous };\n//# sourceMappingURL=common.js.map\n"],"names":[],"mappings":"AAQA,SAAS,kBACP,cACA,QACA,SACA;AACA,MAAI,QAAQ;AACZ,MAAI,eAAe;AACnB,MAAI,kBAAkB;AAEtB,cAAY,MAAM;AAChB,QAAI,oBAAoB,GAAG;AACzB,UAAI,QAAQ,cAAc;AACxB,wBAAgB;AAChB,gBAAQ,YAAY;AAGpB,YAAI,eAAe,OAAO;AACxB,yBAAe;AAAA,QAChB;AACD,0BAAkB;AAAA,MACnB;AAAA,IACP,OAAW;AACL,yBAAmB;AAEnB,UAAI,oBAAoB,GAAG;AACzB;MACD;AAAA,IACF;AAED,YAAQ;AAAA,EACZ,GAAK,GAAI,EAAE;AAET,SAAO,MAAM;AACX,aAAS;AAAA,EACb;AACA;AAKA,SAAS,YAAY,MAAM;AACzB,SAAO,SAAS,WAAc,KAAK,WAAW,KAAK,SAAS,OAAO,SAAS;AAC9E;AAGA,SAAS,mBAAmB,GAAG,GAAG;AAChC,SAAO,MAAM,KAAM,YAAY,CAAC,KAAK,YAAY,CAAC;AACpD;AAGA,SAAS,WAAW,QAAQ;AAC1B,MAAI,WAAW,QAAW;AACxB;AAAA,EACD;AAGD,SAAO,OAAO,MAAM,GAAG,EAAE,OAAO,CAAC,KAAK,UAAU,GAAG,OAAO,MAAM,YAAY,MAAM,UAAU,MAAM,SAAS,EAAE;AAC/G;AAMA,SAAS,cAAc,aAAa,OAAO;AACzC,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACR;AAED,SAAO,WAAW,YAAY,OAAO,CAAC,CAAC;AACzC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"common.js","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/common.js"],"sourcesContent":["/**\n * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback\n * when a timeout has occurred.\n * @param maxPerSecond Maximum number of calls per second\n * @param enable Callback to enable capture\n * @param disable Callback to disable capture\n * @returns A function to call to increment the rate limiter count\n */\nfunction createRateLimiter(\n maxPerSecond,\n enable,\n disable,\n) {\n let count = 0;\n let retrySeconds = 5;\n let disabledTimeout = 0;\n\n setInterval(() => {\n if (disabledTimeout === 0) {\n if (count > maxPerSecond) {\n retrySeconds *= 2;\n disable(retrySeconds);\n\n // Cap at one day\n if (retrySeconds > 86400) {\n retrySeconds = 86400;\n }\n disabledTimeout = retrySeconds;\n }\n } else {\n disabledTimeout -= 1;\n\n if (disabledTimeout === 0) {\n enable();\n }\n }\n\n count = 0;\n }, 1000).unref();\n\n return () => {\n count += 1;\n };\n}\n\n// Add types for the exception event data\n\n/** Could this be an anonymous function? */\nfunction isAnonymous(name) {\n return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');\n}\n\n/** Do the function names appear to match? */\nfunction functionNamesMatch(a, b) {\n return a === b || (isAnonymous(a) && isAnonymous(b));\n}\n\n/** Creates a unique hash from stack frames */\nfunction hashFrames(frames) {\n if (frames === undefined) {\n return;\n }\n\n // Only hash the 10 most recent frames (ie. the last 10)\n return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');\n}\n\n/**\n * We use the stack parser to create a unique hash from the exception stack trace\n * This is used to lookup vars when the exception passes through the event processor\n */\nfunction hashFromStack(stackParser, stack) {\n if (stack === undefined) {\n return undefined;\n }\n\n return hashFrames(stackParser(stack, 1));\n}\n\nexport { createRateLimiter, functionNamesMatch, hashFrames, hashFromStack, isAnonymous };\n//# sourceMappingURL=common.js.map\n"],"names":[],"mappings":"AAQA,SAAS,kBACP,cACA,QACA,SACA;AACA,MAAI,QAAQ;AACZ,MAAI,eAAe;AACnB,MAAI,kBAAkB;AAEtB,cAAY,MAAM;AAChB,QAAI,oBAAoB,GAAG;AACzB,UAAI,QAAQ,cAAc;AACxB,wBAAgB;AAChB,gBAAQ,YAAY;AAGpB,YAAI,eAAe,OAAO;AACxB,yBAAe;AAAA,QAChB;AACD,0BAAkB;AAAA,MACnB;AAAA,IACP,OAAW;AACL,yBAAmB;AAEnB,UAAI,oBAAoB,GAAG;AACzB;MACD;AAAA,IACF;AAED,YAAQ;AAAA,EACZ,GAAK,GAAI,EAAE;AAET,SAAO,MAAM;AACX,aAAS;AAAA,EACb;AACA;AAKA,SAAS,YAAY,MAAM;AACzB,SAAO,SAAS,WAAc,KAAK,WAAW,KAAK,SAAS,OAAO,SAAS;AAC9E;AAGA,SAAS,mBAAmB,GAAG,GAAG;AAChC,SAAO,MAAM,KAAM,YAAY,CAAC,KAAK,YAAY,CAAC;AACpD;AAGA,SAAS,WAAW,QAAQ;AAC1B,MAAI,WAAW,QAAW;AACxB;AAAA,EACD;AAGD,SAAO,OAAO,MAAM,GAAG,EAAE,OAAO,CAAC,KAAK,UAAU,GAAG,GAAG,IAAI,MAAM,QAAQ,IAAI,MAAM,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE;AAC/G;AAMA,SAAS,cAAc,aAAa,OAAO;AACzC,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACR;AAED,SAAO,WAAW,YAAY,OAAO,CAAC,CAAC;AACzC;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"local-variables-sync.cjs","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, convertIntegrationFnToClass, getClient } from '@sentry/core';\nimport { LRUMap, logger } from '@sentry/utils';\nimport { NODE_VERSION } from '../../nodeVersion.js';\nimport { createRateLimiter, hashFromStack, hashFrames, functionNamesMatch } from './common.js';\n\n/* eslint-disable max-lines */\n\n/** Creates a container for callbacks to be called sequentially */\nfunction createCallbackList(complete) {\n // A collection of callbacks to be executed last to first\n let callbacks = [];\n\n let completedCalled = false;\n function checkedComplete(result) {\n callbacks = [];\n if (completedCalled) {\n return;\n }\n completedCalled = true;\n complete(result);\n }\n\n // complete should be called last\n callbacks.push(checkedComplete);\n\n function add(fn) {\n callbacks.push(fn);\n }\n\n function next(result) {\n const popped = callbacks.pop() || checkedComplete;\n\n try {\n popped(result);\n } catch (_) {\n // If there is an error, we still want to call the complete callback\n checkedComplete(result);\n }\n }\n\n return { add, next };\n}\n\n/**\n * Promise API is available as `Experimental` and in Node 19 only.\n *\n * Callback-based API is `Stable` since v14 and `Experimental` since v8.\n * Because of that, we are creating our own `AsyncSession` class.\n *\n * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api\n * https://nodejs.org/docs/latest-v14.x/api/inspector.html\n */\nclass AsyncSession {\n\n /** Throws if inspector API is not available */\n constructor() {\n /*\n TODO: We really should get rid of this require statement below for a couple of reasons:\n 1. It makes the integration unusable in the SvelteKit SDK, as it's not possible to use `require`\n in SvelteKit server code (at least not by default).\n 2. Throwing in a constructor is bad practice\n\n More context for a future attempt to fix this:\n We already tried replacing it with import but didn't get it to work because of async problems.\n We still called import in the constructor but assigned to a promise which we \"awaited\" in\n `configureAndConnect`. However, this broke the Node integration tests as no local variables\n were reported any more. We probably missed a place where we need to await the promise, too.\n */\n\n // Node can be built without inspector support so this can throw\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { Session } = require('inspector');\n this._session = new Session();\n }\n\n /** @inheritdoc */\n configureAndConnect(onPause, captureAll) {\n this._session.connect();\n\n this._session.on('Debugger.paused', event => {\n onPause(event, () => {\n // After the pause work is complete, resume execution or the exception context memory is leaked\n this._session.post('Debugger.resume');\n });\n });\n\n this._session.post('Debugger.enable');\n this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });\n }\n\n setPauseOnExceptions(captureAll) {\n this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });\n }\n\n /** @inheritdoc */\n getLocalVariables(objectId, complete) {\n this._getProperties(objectId, props => {\n const { add, next } = createCallbackList(complete);\n\n for (const prop of props) {\n if (_optionalChain([prop, 'optionalAccess', _2 => _2.value, 'optionalAccess', _3 => _3.objectId]) && _optionalChain([prop, 'optionalAccess', _4 => _4.value, 'access', _5 => _5.className]) === 'Array') {\n const id = prop.value.objectId;\n add(vars => this._unrollArray(id, prop.name, vars, next));\n } else if (_optionalChain([prop, 'optionalAccess', _6 => _6.value, 'optionalAccess', _7 => _7.objectId]) && _optionalChain([prop, 'optionalAccess', _8 => _8.value, 'optionalAccess', _9 => _9.className]) === 'Object') {\n const id = prop.value.objectId;\n add(vars => this._unrollObject(id, prop.name, vars, next));\n } else if (_optionalChain([prop, 'optionalAccess', _10 => _10.value, 'optionalAccess', _11 => _11.value]) != null || _optionalChain([prop, 'optionalAccess', _12 => _12.value, 'optionalAccess', _13 => _13.description]) != null) {\n add(vars => this._unrollOther(prop, vars, next));\n }\n }\n\n next({});\n });\n }\n\n /**\n * Gets all the PropertyDescriptors of an object\n */\n _getProperties(objectId, next) {\n this._session.post(\n 'Runtime.getProperties',\n {\n objectId,\n ownProperties: true,\n },\n (err, params) => {\n if (err) {\n next([]);\n } else {\n next(params.result);\n }\n },\n );\n }\n\n /**\n * Unrolls an array property\n */\n _unrollArray(objectId, name, vars, next) {\n this._getProperties(objectId, props => {\n vars[name] = props\n .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10)))\n .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10))\n .map(v => _optionalChain([v, 'optionalAccess', _14 => _14.value, 'optionalAccess', _15 => _15.value]));\n\n next(vars);\n });\n }\n\n /**\n * Unrolls an object property\n */\n _unrollObject(objectId, name, vars, next) {\n this._getProperties(objectId, props => {\n vars[name] = props\n .map(v => [v.name, _optionalChain([v, 'optionalAccess', _16 => _16.value, 'optionalAccess', _17 => _17.value])])\n .reduce((obj, [key, val]) => {\n obj[key] = val;\n return obj;\n }, {} );\n\n next(vars);\n });\n }\n\n /**\n * Unrolls other properties\n */\n _unrollOther(prop, vars, next) {\n if (_optionalChain([prop, 'optionalAccess', _18 => _18.value, 'optionalAccess', _19 => _19.value]) != null) {\n vars[prop.name] = prop.value.value;\n } else if (_optionalChain([prop, 'optionalAccess', _20 => _20.value, 'optionalAccess', _21 => _21.description]) != null && _optionalChain([prop, 'optionalAccess', _22 => _22.value, 'optionalAccess', _23 => _23.type]) !== 'function') {\n vars[prop.name] = `<${prop.value.description}>`;\n }\n\n next(vars);\n }\n}\n\n/**\n * When using Vercel pkg, the inspector module is not available.\n * https://github.com/getsentry/sentry-javascript/issues/6769\n */\nfunction tryNewAsyncSession() {\n try {\n return new AsyncSession();\n } catch (e) {\n return undefined;\n }\n}\n\nconst INTEGRATION_NAME = 'LocalVariables';\n\n/**\n * Adds local variables to exception frames\n */\nconst _localVariablesSyncIntegration = ((\n options = {},\n session = tryNewAsyncSession(),\n) => {\n const cachedFrames = new LRUMap(20);\n let rateLimiter;\n let shouldProcessEvent = false;\n\n function handlePaused(\n stackParser,\n { params: { reason, data, callFrames } },\n complete,\n ) {\n if (reason !== 'exception' && reason !== 'promiseRejection') {\n complete();\n return;\n }\n\n _optionalChain([rateLimiter, 'optionalCall', _24 => _24()]);\n\n // data.description contains the original error.stack\n const exceptionHash = hashFromStack(stackParser, _optionalChain([data, 'optionalAccess', _25 => _25.description]));\n\n if (exceptionHash == undefined) {\n complete();\n return;\n }\n\n const { add, next } = createCallbackList(frames => {\n cachedFrames.set(exceptionHash, frames);\n complete();\n });\n\n // Because we're queuing up and making all these calls synchronously, we can potentially overflow the stack\n // For this reason we only attempt to get local variables for the first 5 frames\n for (let i = 0; i < Math.min(callFrames.length, 5); i++) {\n const { scopeChain, functionName, this: obj } = callFrames[i];\n\n const localScope = scopeChain.find(scope => scope.type === 'local');\n\n // obj.className is undefined in ESM modules\n const fn = obj.className === 'global' || !obj.className ? functionName : `${obj.className}.${functionName}`;\n\n if (_optionalChain([localScope, 'optionalAccess', _26 => _26.object, 'access', _27 => _27.objectId]) === undefined) {\n add(frames => {\n frames[i] = { function: fn };\n next(frames);\n });\n } else {\n const id = localScope.object.objectId;\n add(frames =>\n _optionalChain([session, 'optionalAccess', _28 => _28.getLocalVariables, 'call', _29 => _29(id, vars => {\n frames[i] = { function: fn, vars };\n next(frames);\n })]),\n );\n }\n }\n\n next([]);\n }\n\n function addLocalVariablesToException(exception) {\n const hash = hashFrames(_optionalChain([exception, 'optionalAccess', _30 => _30.stacktrace, 'optionalAccess', _31 => _31.frames]));\n\n if (hash === undefined) {\n return;\n }\n\n // Check if we have local variables for an exception that matches the hash\n // remove is identical to get but also removes the entry from the cache\n const cachedFrame = cachedFrames.remove(hash);\n\n if (cachedFrame === undefined) {\n return;\n }\n\n // Filter out frames where the function name is `new Promise` since these are in the error.stack frames\n // but do not appear in the debugger call frames\n const frames = (_optionalChain([exception, 'access', _32 => _32.stacktrace, 'optionalAccess', _33 => _33.frames]) || []).filter(frame => frame.function !== 'new Promise');\n\n for (let i = 0; i < frames.length; i++) {\n // Sentry frames are in reverse order\n const frameIndex = frames.length - i - 1;\n\n // Drop out if we run out of frames to match up\n if (!frames[frameIndex] || !cachedFrame[i]) {\n break;\n }\n\n if (\n // We need to have vars to add\n cachedFrame[i].vars === undefined ||\n // We're not interested in frames that are not in_app because the vars are not relevant\n frames[frameIndex].in_app === false ||\n // The function names need to match\n !functionNamesMatch(frames[frameIndex].function, cachedFrame[i].function)\n ) {\n continue;\n }\n\n frames[frameIndex].vars = cachedFrame[i].vars;\n }\n }\n\n function addLocalVariablesToEvent(event) {\n for (const exception of _optionalChain([event, 'optionalAccess', _34 => _34.exception, 'optionalAccess', _35 => _35.values]) || []) {\n addLocalVariablesToException(exception);\n }\n\n return event;\n }\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const client = getClient();\n const clientOptions = _optionalChain([client, 'optionalAccess', _36 => _36.getOptions, 'call', _37 => _37()]);\n\n if (session && _optionalChain([clientOptions, 'optionalAccess', _38 => _38.includeLocalVariables])) {\n // Only setup this integration if the Node version is >= v18\n // https://github.com/getsentry/sentry-javascript/issues/7697\n const unsupportedNodeVersion = NODE_VERSION.major < 18;\n\n if (unsupportedNodeVersion) {\n logger.log('The `LocalVariables` integration is only supported on Node >= v18.');\n return;\n }\n\n const captureAll = options.captureAllExceptions !== false;\n\n session.configureAndConnect(\n (ev, complete) =>\n handlePaused(clientOptions.stackParser, ev , complete),\n captureAll,\n );\n\n if (captureAll) {\n const max = options.maxExceptionsPerSecond || 50;\n\n rateLimiter = createRateLimiter(\n max,\n () => {\n logger.log('Local variables rate-limit lifted.');\n _optionalChain([session, 'optionalAccess', _39 => _39.setPauseOnExceptions, 'call', _40 => _40(true)]);\n },\n seconds => {\n logger.log(\n `Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${seconds} seconds.`,\n );\n _optionalChain([session, 'optionalAccess', _41 => _41.setPauseOnExceptions, 'call', _42 => _42(false)]);\n },\n );\n }\n\n shouldProcessEvent = true;\n }\n },\n processEvent(event) {\n if (shouldProcessEvent) {\n return addLocalVariablesToEvent(event);\n }\n\n return event;\n },\n // These are entirely for testing\n _getCachedFramesCount() {\n return cachedFrames.size;\n },\n _getFirstCachedFrame() {\n return cachedFrames.values()[0];\n },\n };\n}) ;\n\nconst localVariablesSyncIntegration = defineIntegration(_localVariablesSyncIntegration);\n\n/**\n * Adds local variables to exception frames.\n * @deprecated Use `localVariablesSyncIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst LocalVariablesSync = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n localVariablesSyncIntegration,\n)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nexport { LocalVariablesSync, createCallbackList, localVariablesSyncIntegration };\n//# sourceMappingURL=local-variables-sync.js.map\n"],"names":["_optionalChain","LRUMap","hashFromStack","hashFrames","functionNamesMatch","getClient","NODE_VERSION","logger","createRateLimiter","defineIntegration","convertIntegrationFnToClass"],"mappings":";;;;;;;;;AASA,SAAS,mBAAmB,UAAU;AAEpC,MAAI,YAAY,CAAA;AAEhB,MAAI,kBAAkB;AACtB,WAAS,gBAAgB,QAAQ;AAC/B,gBAAY,CAAA;AACZ,QAAI,iBAAiB;AACnB;AAAA,IACD;AACD,sBAAkB;AAClB,aAAS,MAAM;AAAA,EAChB;AAGD,YAAU,KAAK,eAAe;AAE9B,WAAS,IAAI,IAAI;AACf,cAAU,KAAK,EAAE;AAAA,EAClB;AAED,WAAS,KAAK,QAAQ;AACpB,UAAM,SAAS,UAAU,IAAG,KAAM;AAElC,QAAI;AACF,aAAO,MAAM;AAAA,IACd,SAAQ,GAAP;AAEA,sBAAgB,MAAM;AAAA,IACvB;AAAA,EACF;AAED,SAAO,EAAE,KAAK;AAChB;AAWA,MAAM,aAAc;AAAA;AAAA,EAGjB,cAAc;AAgBb,UAAM,EAAE,QAAO,IAAK,QAAQ,WAAW;AACvC,SAAK,WAAW,IAAI;EACrB;AAAA;AAAA,EAGA,oBAAoB,SAAS,YAAY;AACxC,SAAK,SAAS;AAEd,SAAK,SAAS,GAAG,mBAAmB,WAAS;AAC3C,cAAQ,OAAO,MAAM;AAEnB,aAAK,SAAS,KAAK,iBAAiB;AAAA,MAC5C,CAAO;AAAA,IACP,CAAK;AAED,SAAK,SAAS,KAAK,iBAAiB;AACpC,SAAK,SAAS,KAAK,iCAAiC,EAAE,OAAO,aAAa,QAAQ,WAAU,CAAE;AAAA,EAC/F;AAAA,EAEA,qBAAqB,YAAY;AAChC,SAAK,SAAS,KAAK,iCAAiC,EAAE,OAAO,aAAa,QAAQ,WAAU,CAAE;AAAA,EAC/F;AAAA;AAAA,EAGA,kBAAkB,UAAU,UAAU;AACrC,SAAK,eAAe,UAAU,WAAS;AACrC,YA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ED,6BAAqB;AAAA,MACtB;AAAA,IACF;AAAA,IACD,aAAa,OAAO;AAClB,UAAI,oBAAoB;AACtB,eAAO,yBAAyB,KAAK;AAAA,MACtC;AAED,aAAO;AAAA,IACR;AAAA;AAAA,IAED,wBAAwB;AACtB,aAAO,aAAa;AAAA,IACrB;AAAA,IACD,uBAAuB;AACrB,aAAO,aAAa,SAAS,CAAC;AAAA,IAC/B;AAAA,EACL;AACA;AAEK,MAAC,gCAAgCS,YAAiB,kBAAC,8BAA8B;AAO3DC,YAA2B;AAAA,EACpD;AAAA,EACA;AACF;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"local-variables-sync.cjs","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, convertIntegrationFnToClass, getClient } from '@sentry/core';\nimport { LRUMap, logger } from '@sentry/utils';\nimport { NODE_VERSION } from '../../nodeVersion.js';\nimport { createRateLimiter, hashFromStack, hashFrames, functionNamesMatch } from './common.js';\n\n/* eslint-disable max-lines */\n\n/** Creates a container for callbacks to be called sequentially */\nfunction createCallbackList(complete) {\n // A collection of callbacks to be executed last to first\n let callbacks = [];\n\n let completedCalled = false;\n function checkedComplete(result) {\n callbacks = [];\n if (completedCalled) {\n return;\n }\n completedCalled = true;\n complete(result);\n }\n\n // complete should be called last\n callbacks.push(checkedComplete);\n\n function add(fn) {\n callbacks.push(fn);\n }\n\n function next(result) {\n const popped = callbacks.pop() || checkedComplete;\n\n try {\n popped(result);\n } catch (_) {\n // If there is an error, we still want to call the complete callback\n checkedComplete(result);\n }\n }\n\n return { add, next };\n}\n\n/**\n * Promise API is available as `Experimental` and in Node 19 only.\n *\n * Callback-based API is `Stable` since v14 and `Experimental` since v8.\n * Because of that, we are creating our own `AsyncSession` class.\n *\n * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api\n * https://nodejs.org/docs/latest-v14.x/api/inspector.html\n */\nclass AsyncSession {\n\n /** Throws if inspector API is not available */\n constructor() {\n /*\n TODO: We really should get rid of this require statement below for a couple of reasons:\n 1. It makes the integration unusable in the SvelteKit SDK, as it's not possible to use `require`\n in SvelteKit server code (at least not by default).\n 2. Throwing in a constructor is bad practice\n\n More context for a future attempt to fix this:\n We already tried replacing it with import but didn't get it to work because of async problems.\n We still called import in the constructor but assigned to a promise which we \"awaited\" in\n `configureAndConnect`. However, this broke the Node integration tests as no local variables\n were reported any more. We probably missed a place where we need to await the promise, too.\n */\n\n // Node can be built without inspector support so this can throw\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { Session } = require('inspector');\n this._session = new Session();\n }\n\n /** @inheritdoc */\n configureAndConnect(onPause, captureAll) {\n this._session.connect();\n\n this._session.on('Debugger.paused', event => {\n onPause(event, () => {\n // After the pause work is complete, resume execution or the exception context memory is leaked\n this._session.post('Debugger.resume');\n });\n });\n\n this._session.post('Debugger.enable');\n this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });\n }\n\n setPauseOnExceptions(captureAll) {\n this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });\n }\n\n /** @inheritdoc */\n getLocalVariables(objectId, complete) {\n this._getProperties(objectId, props => {\n const { add, next } = createCallbackList(complete);\n\n for (const prop of props) {\n if (_optionalChain([prop, 'optionalAccess', _2 => _2.value, 'optionalAccess', _3 => _3.objectId]) && _optionalChain([prop, 'optionalAccess', _4 => _4.value, 'access', _5 => _5.className]) === 'Array') {\n const id = prop.value.objectId;\n add(vars => this._unrollArray(id, prop.name, vars, next));\n } else if (_optionalChain([prop, 'optionalAccess', _6 => _6.value, 'optionalAccess', _7 => _7.objectId]) && _optionalChain([prop, 'optionalAccess', _8 => _8.value, 'optionalAccess', _9 => _9.className]) === 'Object') {\n const id = prop.value.objectId;\n add(vars => this._unrollObject(id, prop.name, vars, next));\n } else if (_optionalChain([prop, 'optionalAccess', _10 => _10.value, 'optionalAccess', _11 => _11.value]) != null || _optionalChain([prop, 'optionalAccess', _12 => _12.value, 'optionalAccess', _13 => _13.description]) != null) {\n add(vars => this._unrollOther(prop, vars, next));\n }\n }\n\n next({});\n });\n }\n\n /**\n * Gets all the PropertyDescriptors of an object\n */\n _getProperties(objectId, next) {\n this._session.post(\n 'Runtime.getProperties',\n {\n objectId,\n ownProperties: true,\n },\n (err, params) => {\n if (err) {\n next([]);\n } else {\n next(params.result);\n }\n },\n );\n }\n\n /**\n * Unrolls an array property\n */\n _unrollArray(objectId, name, vars, next) {\n this._getProperties(objectId, props => {\n vars[name] = props\n .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10)))\n .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10))\n .map(v => _optionalChain([v, 'optionalAccess', _14 => _14.value, 'optionalAccess', _15 => _15.value]));\n\n next(vars);\n });\n }\n\n /**\n * Unrolls an object property\n */\n _unrollObject(objectId, name, vars, next) {\n this._getProperties(objectId, props => {\n vars[name] = props\n .map(v => [v.name, _optionalChain([v, 'optionalAccess', _16 => _16.value, 'optionalAccess', _17 => _17.value])])\n .reduce((obj, [key, val]) => {\n obj[key] = val;\n return obj;\n }, {} );\n\n next(vars);\n });\n }\n\n /**\n * Unrolls other properties\n */\n _unrollOther(prop, vars, next) {\n if (_optionalChain([prop, 'optionalAccess', _18 => _18.value, 'optionalAccess', _19 => _19.value]) != null) {\n vars[prop.name] = prop.value.value;\n } else if (_optionalChain([prop, 'optionalAccess', _20 => _20.value, 'optionalAccess', _21 => _21.description]) != null && _optionalChain([prop, 'optionalAccess', _22 => _22.value, 'optionalAccess', _23 => _23.type]) !== 'function') {\n vars[prop.name] = `<${prop.value.description}>`;\n }\n\n next(vars);\n }\n}\n\n/**\n * When using Vercel pkg, the inspector module is not available.\n * https://github.com/getsentry/sentry-javascript/issues/6769\n */\nfunction tryNewAsyncSession() {\n try {\n return new AsyncSession();\n } catch (e) {\n return undefined;\n }\n}\n\nconst INTEGRATION_NAME = 'LocalVariables';\n\n/**\n * Adds local variables to exception frames\n */\nconst _localVariablesSyncIntegration = ((\n options = {},\n session = tryNewAsyncSession(),\n) => {\n const cachedFrames = new LRUMap(20);\n let rateLimiter;\n let shouldProcessEvent = false;\n\n function handlePaused(\n stackParser,\n { params: { reason, data, callFrames } },\n complete,\n ) {\n if (reason !== 'exception' && reason !== 'promiseRejection') {\n complete();\n return;\n }\n\n _optionalChain([rateLimiter, 'optionalCall', _24 => _24()]);\n\n // data.description contains the original error.stack\n const exceptionHash = hashFromStack(stackParser, _optionalChain([data, 'optionalAccess', _25 => _25.description]));\n\n if (exceptionHash == undefined) {\n complete();\n return;\n }\n\n const { add, next } = createCallbackList(frames => {\n cachedFrames.set(exceptionHash, frames);\n complete();\n });\n\n // Because we're queuing up and making all these calls synchronously, we can potentially overflow the stack\n // For this reason we only attempt to get local variables for the first 5 frames\n for (let i = 0; i < Math.min(callFrames.length, 5); i++) {\n const { scopeChain, functionName, this: obj } = callFrames[i];\n\n const localScope = scopeChain.find(scope => scope.type === 'local');\n\n // obj.className is undefined in ESM modules\n const fn = obj.className === 'global' || !obj.className ? functionName : `${obj.className}.${functionName}`;\n\n if (_optionalChain([localScope, 'optionalAccess', _26 => _26.object, 'access', _27 => _27.objectId]) === undefined) {\n add(frames => {\n frames[i] = { function: fn };\n next(frames);\n });\n } else {\n const id = localScope.object.objectId;\n add(frames =>\n _optionalChain([session, 'optionalAccess', _28 => _28.getLocalVariables, 'call', _29 => _29(id, vars => {\n frames[i] = { function: fn, vars };\n next(frames);\n })]),\n );\n }\n }\n\n next([]);\n }\n\n function addLocalVariablesToException(exception) {\n const hash = hashFrames(_optionalChain([exception, 'optionalAccess', _30 => _30.stacktrace, 'optionalAccess', _31 => _31.frames]));\n\n if (hash === undefined) {\n return;\n }\n\n // Check if we have local variables for an exception that matches the hash\n // remove is identical to get but also removes the entry from the cache\n const cachedFrame = cachedFrames.remove(hash);\n\n if (cachedFrame === undefined) {\n return;\n }\n\n // Filter out frames where the function name is `new Promise` since these are in the error.stack frames\n // but do not appear in the debugger call frames\n const frames = (_optionalChain([exception, 'access', _32 => _32.stacktrace, 'optionalAccess', _33 => _33.frames]) || []).filter(frame => frame.function !== 'new Promise');\n\n for (let i = 0; i < frames.length; i++) {\n // Sentry frames are in reverse order\n const frameIndex = frames.length - i - 1;\n\n // Drop out if we run out of frames to match up\n if (!frames[frameIndex] || !cachedFrame[i]) {\n break;\n }\n\n if (\n // We need to have vars to add\n cachedFrame[i].vars === undefined ||\n // We're not interested in frames that are not in_app because the vars are not relevant\n frames[frameIndex].in_app === false ||\n // The function names need to match\n !functionNamesMatch(frames[frameIndex].function, cachedFrame[i].function)\n ) {\n continue;\n }\n\n frames[frameIndex].vars = cachedFrame[i].vars;\n }\n }\n\n function addLocalVariablesToEvent(event) {\n for (const exception of _optionalChain([event, 'optionalAccess', _34 => _34.exception, 'optionalAccess', _35 => _35.values]) || []) {\n addLocalVariablesToException(exception);\n }\n\n return event;\n }\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const client = getClient();\n const clientOptions = _optionalChain([client, 'optionalAccess', _36 => _36.getOptions, 'call', _37 => _37()]);\n\n if (session && _optionalChain([clientOptions, 'optionalAccess', _38 => _38.includeLocalVariables])) {\n // Only setup this integration if the Node version is >= v18\n // https://github.com/getsentry/sentry-javascript/issues/7697\n const unsupportedNodeVersion = NODE_VERSION.major < 18;\n\n if (unsupportedNodeVersion) {\n logger.log('The `LocalVariables` integration is only supported on Node >= v18.');\n return;\n }\n\n const captureAll = options.captureAllExceptions !== false;\n\n session.configureAndConnect(\n (ev, complete) =>\n handlePaused(clientOptions.stackParser, ev , complete),\n captureAll,\n );\n\n if (captureAll) {\n const max = options.maxExceptionsPerSecond || 50;\n\n rateLimiter = createRateLimiter(\n max,\n () => {\n logger.log('Local variables rate-limit lifted.');\n _optionalChain([session, 'optionalAccess', _39 => _39.setPauseOnExceptions, 'call', _40 => _40(true)]);\n },\n seconds => {\n logger.log(\n `Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${seconds} seconds.`,\n );\n _optionalChain([session, 'optionalAccess', _41 => _41.setPauseOnExceptions, 'call', _42 => _42(false)]);\n },\n );\n }\n\n shouldProcessEvent = true;\n }\n },\n processEvent(event) {\n if (shouldProcessEvent) {\n return addLocalVariablesToEvent(event);\n }\n\n return event;\n },\n // These are entirely for testing\n _getCachedFramesCount() {\n return cachedFrames.size;\n },\n _getFirstCachedFrame() {\n return cachedFrames.values()[0];\n },\n };\n}) ;\n\nconst localVariablesSyncIntegration = defineIntegration(_localVariablesSyncIntegration);\n\n/**\n * Adds local variables to exception frames.\n * @deprecated Use `localVariablesSyncIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst LocalVariablesSync = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n localVariablesSyncIntegration,\n)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nexport { LocalVariablesSync, createCallbackList, localVariablesSyncIntegration };\n//# sourceMappingURL=local-variables-sync.js.map\n"],"names":["_optionalChain","LRUMap","hashFromStack","hashFrames","functionNamesMatch","getClient","NODE_VERSION","logger","createRateLimiter","defineIntegration","convertIntegrationFnToClass"],"mappings":";;;;;;;;;AASA,SAAS,mBAAmB,UAAU;AAEpC,MAAI,YAAY,CAAA;AAEhB,MAAI,kBAAkB;AACtB,WAAS,gBAAgB,QAAQ;AAC/B,gBAAY,CAAA;AACZ,QAAI,iBAAiB;AACnB;AAAA,IACD;AACD,sBAAkB;AAClB,aAAS,MAAM;AAAA,EAChB;AAGD,YAAU,KAAK,eAAe;AAE9B,WAAS,IAAI,IAAI;AACf,cAAU,KAAK,EAAE;AAAA,EAClB;AAED,WAAS,KAAK,QAAQ;AACpB,UAAM,SAAS,UAAU,IAAG,KAAM;AAElC,QAAI;AACF,aAAO,MAAM;AAAA,IACd,SAAQ,GAAG;AAEV,sBAAgB,MAAM;AAAA,IACvB;AAAA,EACF;AAED,SAAO,EAAE,KAAK;AAChB;AAWA,MAAM,aAAc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AAI,oEAAoE;AAC/E;AAAA,QACD;AAED,cAAM,aAAa,QAAQ,yBAAyB;AAEpD,gBAAQ;AAAA,UACN,CAAC,IAAI,aACH,aAAa,cAAc,aAAa,IAAK,QAAQ;AAAA,UACvD;AAAA,QACV;AAEQ,YAAI,YAAY;AACd,gBAAM,MAAM,QAAQ,0BAA0B;AAE9C,wBAAcC,OAAiB;AAAA,YAC7B;AAAA,YACA,MAAM;AACJD,4BAAO,IAAI,oCAAoC;AAC/CP,6BAAAA,eAAe,CAAC,SAAS,kBAAkB,SAAO,IAAI,sBAAsB,QAAQ,SAAO,IAAI,IAAI,CAAC,CAAC;AAAA,YACtG;AAAA,YACD,aAAW;AACTO,qBAAAA,OAAO;AAAA,gBACL,qFAAqF,OAAO;AAAA,cAC5G;AACcP,6BAAAA,eAAe,CAAC,SAAS,kBAAkB,SAAO,IAAI,sBAAsB,QAAQ,SAAO,IAAI,KAAK,CAAC,CAAC;AAAA,YACvG;AAAA,UACb;AAAA,QACS;AAED,6BAAqB;AAAA,MACtB;AAAA,IACF;AAAA,IACD,aAAa,OAAO;AAClB,UAAI,oBAAoB;AACtB,eAAO,yBAAyB,KAAK;AAAA,MACtC;AAED,aAAO;AAAA,IACR;AAAA;AAAA,IAED,wBAAwB;AACtB,aAAO,aAAa;AAAA,IACrB;AAAA,IACD,uBAAuB;AACrB,aAAO,aAAa,SAAS,CAAC;AAAA,IAC/B;AAAA,EACL;AACA;AAEK,MAAC,gCAAgCS,YAAiB,kBAAC,8BAA8B;AAO3DC,YAA2B;AAAA,EACpD;AAAA,EACA;AACF;;;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"local-variables-sync.js","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, convertIntegrationFnToClass, getClient } from '@sentry/core';\nimport { LRUMap, logger } from '@sentry/utils';\nimport { NODE_VERSION } from '../../nodeVersion.js';\nimport { createRateLimiter, hashFromStack, hashFrames, functionNamesMatch } from './common.js';\n\n/* eslint-disable max-lines */\n\n/** Creates a container for callbacks to be called sequentially */\nfunction createCallbackList(complete) {\n // A collection of callbacks to be executed last to first\n let callbacks = [];\n\n let completedCalled = false;\n function checkedComplete(result) {\n callbacks = [];\n if (completedCalled) {\n return;\n }\n completedCalled = true;\n complete(result);\n }\n\n // complete should be called last\n callbacks.push(checkedComplete);\n\n function add(fn) {\n callbacks.push(fn);\n }\n\n function next(result) {\n const popped = callbacks.pop() || checkedComplete;\n\n try {\n popped(result);\n } catch (_) {\n // If there is an error, we still want to call the complete callback\n checkedComplete(result);\n }\n }\n\n return { add, next };\n}\n\n/**\n * Promise API is available as `Experimental` and in Node 19 only.\n *\n * Callback-based API is `Stable` since v14 and `Experimental` since v8.\n * Because of that, we are creating our own `AsyncSession` class.\n *\n * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api\n * https://nodejs.org/docs/latest-v14.x/api/inspector.html\n */\nclass AsyncSession {\n\n /** Throws if inspector API is not available */\n constructor() {\n /*\n TODO: We really should get rid of this require statement below for a couple of reasons:\n 1. It makes the integration unusable in the SvelteKit SDK, as it's not possible to use `require`\n in SvelteKit server code (at least not by default).\n 2. Throwing in a constructor is bad practice\n\n More context for a future attempt to fix this:\n We already tried replacing it with import but didn't get it to work because of async problems.\n We still called import in the constructor but assigned to a promise which we \"awaited\" in\n `configureAndConnect`. However, this broke the Node integration tests as no local variables\n were reported any more. We probably missed a place where we need to await the promise, too.\n */\n\n // Node can be built without inspector support so this can throw\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { Session } = require('inspector');\n this._session = new Session();\n }\n\n /** @inheritdoc */\n configureAndConnect(onPause, captureAll) {\n this._session.connect();\n\n this._session.on('Debugger.paused', event => {\n onPause(event, () => {\n // After the pause work is complete, resume execution or the exception context memory is leaked\n this._session.post('Debugger.resume');\n });\n });\n\n this._session.post('Debugger.enable');\n this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });\n }\n\n setPauseOnExceptions(captureAll) {\n this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });\n }\n\n /** @inheritdoc */\n getLocalVariables(objectId, complete) {\n this._getProperties(objectId, props => {\n const { add, next } = createCallbackList(complete);\n\n for (const prop of props) {\n if (_optionalChain([prop, 'optionalAccess', _2 => _2.value, 'optionalAccess', _3 => _3.objectId]) && _optionalChain([prop, 'optionalAccess', _4 => _4.value, 'access', _5 => _5.className]) === 'Array') {\n const id = prop.value.objectId;\n add(vars => this._unrollArray(id, prop.name, vars, next));\n } else if (_optionalChain([prop, 'optionalAccess', _6 => _6.value, 'optionalAccess', _7 => _7.objectId]) && _optionalChain([prop, 'optionalAccess', _8 => _8.value, 'optionalAccess', _9 => _9.className]) === 'Object') {\n const id = prop.value.objectId;\n add(vars => this._unrollObject(id, prop.name, vars, next));\n } else if (_optionalChain([prop, 'optionalAccess', _10 => _10.value, 'optionalAccess', _11 => _11.value]) != null || _optionalChain([prop, 'optionalAccess', _12 => _12.value, 'optionalAccess', _13 => _13.description]) != null) {\n add(vars => this._unrollOther(prop, vars, next));\n }\n }\n\n next({});\n });\n }\n\n /**\n * Gets all the PropertyDescriptors of an object\n */\n _getProperties(objectId, next) {\n this._session.post(\n 'Runtime.getProperties',\n {\n objectId,\n ownProperties: true,\n },\n (err, params) => {\n if (err) {\n next([]);\n } else {\n next(params.result);\n }\n },\n );\n }\n\n /**\n * Unrolls an array property\n */\n _unrollArray(objectId, name, vars, next) {\n this._getProperties(objectId, props => {\n vars[name] = props\n .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10)))\n .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10))\n .map(v => _optionalChain([v, 'optionalAccess', _14 => _14.value, 'optionalAccess', _15 => _15.value]));\n\n next(vars);\n });\n }\n\n /**\n * Unrolls an object property\n */\n _unrollObject(objectId, name, vars, next) {\n this._getProperties(objectId, props => {\n vars[name] = props\n .map(v => [v.name, _optionalChain([v, 'optionalAccess', _16 => _16.value, 'optionalAccess', _17 => _17.value])])\n .reduce((obj, [key, val]) => {\n obj[key] = val;\n return obj;\n }, {} );\n\n next(vars);\n });\n }\n\n /**\n * Unrolls other properties\n */\n _unrollOther(prop, vars, next) {\n if (_optionalChain([prop, 'optionalAccess', _18 => _18.value, 'optionalAccess', _19 => _19.value]) != null) {\n vars[prop.name] = prop.value.value;\n } else if (_optionalChain([prop, 'optionalAccess', _20 => _20.value, 'optionalAccess', _21 => _21.description]) != null && _optionalChain([prop, 'optionalAccess', _22 => _22.value, 'optionalAccess', _23 => _23.type]) !== 'function') {\n vars[prop.name] = `<${prop.value.description}>`;\n }\n\n next(vars);\n }\n}\n\n/**\n * When using Vercel pkg, the inspector module is not available.\n * https://github.com/getsentry/sentry-javascript/issues/6769\n */\nfunction tryNewAsyncSession() {\n try {\n return new AsyncSession();\n } catch (e) {\n return undefined;\n }\n}\n\nconst INTEGRATION_NAME = 'LocalVariables';\n\n/**\n * Adds local variables to exception frames\n */\nconst _localVariablesSyncIntegration = ((\n options = {},\n session = tryNewAsyncSession(),\n) => {\n const cachedFrames = new LRUMap(20);\n let rateLimiter;\n let shouldProcessEvent = false;\n\n function handlePaused(\n stackParser,\n { params: { reason, data, callFrames } },\n complete,\n ) {\n if (reason !== 'exception' && reason !== 'promiseRejection') {\n complete();\n return;\n }\n\n _optionalChain([rateLimiter, 'optionalCall', _24 => _24()]);\n\n // data.description contains the original error.stack\n const exceptionHash = hashFromStack(stackParser, _optionalChain([data, 'optionalAccess', _25 => _25.description]));\n\n if (exceptionHash == undefined) {\n complete();\n return;\n }\n\n const { add, next } = createCallbackList(frames => {\n cachedFrames.set(exceptionHash, frames);\n complete();\n });\n\n // Because we're queuing up and making all these calls synchronously, we can potentially overflow the stack\n // For this reason we only attempt to get local variables for the first 5 frames\n for (let i = 0; i < Math.min(callFrames.length, 5); i++) {\n const { scopeChain, functionName, this: obj } = callFrames[i];\n\n const localScope = scopeChain.find(scope => scope.type === 'local');\n\n // obj.className is undefined in ESM modules\n const fn = obj.className === 'global' || !obj.className ? functionName : `${obj.className}.${functionName}`;\n\n if (_optionalChain([localScope, 'optionalAccess', _26 => _26.object, 'access', _27 => _27.objectId]) === undefined) {\n add(frames => {\n frames[i] = { function: fn };\n next(frames);\n });\n } else {\n const id = localScope.object.objectId;\n add(frames =>\n _optionalChain([session, 'optionalAccess', _28 => _28.getLocalVariables, 'call', _29 => _29(id, vars => {\n frames[i] = { function: fn, vars };\n next(frames);\n })]),\n );\n }\n }\n\n next([]);\n }\n\n function addLocalVariablesToException(exception) {\n const hash = hashFrames(_optionalChain([exception, 'optionalAccess', _30 => _30.stacktrace, 'optionalAccess', _31 => _31.frames]));\n\n if (hash === undefined) {\n return;\n }\n\n // Check if we have local variables for an exception that matches the hash\n // remove is identical to get but also removes the entry from the cache\n const cachedFrame = cachedFrames.remove(hash);\n\n if (cachedFrame === undefined) {\n return;\n }\n\n // Filter out frames where the function name is `new Promise` since these are in the error.stack frames\n // but do not appear in the debugger call frames\n const frames = (_optionalChain([exception, 'access', _32 => _32.stacktrace, 'optionalAccess', _33 => _33.frames]) || []).filter(frame => frame.function !== 'new Promise');\n\n for (let i = 0; i < frames.length; i++) {\n // Sentry frames are in reverse order\n const frameIndex = frames.length - i - 1;\n\n // Drop out if we run out of frames to match up\n if (!frames[frameIndex] || !cachedFrame[i]) {\n break;\n }\n\n if (\n // We need to have vars to add\n cachedFrame[i].vars === undefined ||\n // We're not interested in frames that are not in_app because the vars are not relevant\n frames[frameIndex].in_app === false ||\n // The function names need to match\n !functionNamesMatch(frames[frameIndex].function, cachedFrame[i].function)\n ) {\n continue;\n }\n\n frames[frameIndex].vars = cachedFrame[i].vars;\n }\n }\n\n function addLocalVariablesToEvent(event) {\n for (const exception of _optionalChain([event, 'optionalAccess', _34 => _34.exception, 'optionalAccess', _35 => _35.values]) || []) {\n addLocalVariablesToException(exception);\n }\n\n return event;\n }\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const client = getClient();\n const clientOptions = _optionalChain([client, 'optionalAccess', _36 => _36.getOptions, 'call', _37 => _37()]);\n\n if (session && _optionalChain([clientOptions, 'optionalAccess', _38 => _38.includeLocalVariables])) {\n // Only setup this integration if the Node version is >= v18\n // https://github.com/getsentry/sentry-javascript/issues/7697\n const unsupportedNodeVersion = NODE_VERSION.major < 18;\n\n if (unsupportedNodeVersion) {\n logger.log('The `LocalVariables` integration is only supported on Node >= v18.');\n return;\n }\n\n const captureAll = options.captureAllExceptions !== false;\n\n session.configureAndConnect(\n (ev, complete) =>\n handlePaused(clientOptions.stackParser, ev , complete),\n captureAll,\n );\n\n if (captureAll) {\n const max = options.maxExceptionsPerSecond || 50;\n\n rateLimiter = createRateLimiter(\n max,\n () => {\n logger.log('Local variables rate-limit lifted.');\n _optionalChain([session, 'optionalAccess', _39 => _39.setPauseOnExceptions, 'call', _40 => _40(true)]);\n },\n seconds => {\n logger.log(\n `Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${seconds} seconds.`,\n );\n _optionalChain([session, 'optionalAccess', _41 => _41.setPauseOnExceptions, 'call', _42 => _42(false)]);\n },\n );\n }\n\n shouldProcessEvent = true;\n }\n },\n processEvent(event) {\n if (shouldProcessEvent) {\n return addLocalVariablesToEvent(event);\n }\n\n return event;\n },\n // These are entirely for testing\n _getCachedFramesCount() {\n return cachedFrames.size;\n },\n _getFirstCachedFrame() {\n return cachedFrames.values()[0];\n },\n };\n}) ;\n\nconst localVariablesSyncIntegration = defineIntegration(_localVariablesSyncIntegration);\n\n/**\n * Adds local variables to exception frames.\n * @deprecated Use `localVariablesSyncIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst LocalVariablesSync = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n localVariablesSyncIntegration,\n)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nexport { LocalVariablesSync, createCallbackList, localVariablesSyncIntegration };\n//# source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zB;AAAA,EACA;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"local-variables-sync.js","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, convertIntegrationFnToClass, getClient } from '@sentry/core';\nimport { LRUMap, logger } from '@sentry/utils';\nimport { NODE_VERSION } from '../../nodeVersion.js';\nimport { createRateLimiter, hashFromStack, hashFrames, functionNamesMatch } from './common.js';\n\n/* eslint-disable max-lines */\n\n/** Creates a container for callbacks to be called sequentially */\nfunction createCallbackList(complete) {\n // A collection of callbacks to be executed last to first\n let callbacks = [];\n\n let completedCalled = false;\n function checkedComplete(result) {\n callbacks = [];\n if (completedCalled) {\n return;\n }\n completedCalled = true;\n complete(result);\n }\n\n // complete should be called last\n callbacks.push(checkedComplete);\n\n function add(fn) {\n callbacks.push(fn);\n }\n\n function next(result) {\n const popped = callbacks.pop() || checkedComplete;\n\n try {\n popped(result);\n } catch (_) {\n // If there is an error, we still want to call the complete callback\n checkedComplete(result);\n }\n }\n\n return { add, next };\n}\n\n/**\n * Promise API is available as `Experimental` and in Node 19 only.\n *\n * Callback-based API is `Stable` since v14 and `Experimental` since v8.\n * Because of that, we are creating our own `AsyncSession` class.\n *\n * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api\n * https://nodejs.org/docs/latest-v14.x/api/inspector.html\n */\nclass AsyncSession {\n\n /** Throws if inspector API is not available */\n constructor() {\n /*\n TODO: We really should get rid of this require statement below for a couple of reasons:\n 1. It makes the integration unusable in the SvelteKit SDK, as it's not possible to use `require`\n in SvelteKit server code (at least not by default).\n 2. Throwing in a constructor is bad practice\n\n More context for a future attempt to fix this:\n We already tried replacing it with import but didn't get it to work because of async problems.\n We still called import in the constructor but assigned to a promise which we \"awaited\" in\n `configureAndConnect`. However, this broke the Node integration tests as no local variables\n were reported any more. We probably missed a place where we need to await the promise, too.\n */\n\n // Node can be built without inspector support so this can throw\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { Session } = require('inspector');\n this._session = new Session();\n }\n\n /** @inheritdoc */\n configureAndConnect(onPause, captureAll) {\n this._session.connect();\n\n this._session.on('Debugger.paused', event => {\n onPause(event, () => {\n // After the pause work is complete, resume execution or the exception context memory is leaked\n this._session.post('Debugger.resume');\n });\n });\n\n this._session.post('Debugger.enable');\n this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });\n }\n\n setPauseOnExceptions(captureAll) {\n this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });\n }\n\n /** @inheritdoc */\n getLocalVariables(objectId, complete) {\n this._getProperties(objectId, props => {\n const { add, next } = createCallbackList(complete);\n\n for (const prop of props) {\n if (_optionalChain([prop, 'optionalAccess', _2 => _2.value, 'optionalAccess', _3 => _3.objectId]) && _optionalChain([prop, 'optionalAccess', _4 => _4.value, 'access', _5 => _5.className]) === 'Array') {\n const id = prop.value.objectId;\n add(vars => this._unrollArray(id, prop.name, vars, next));\n } else if (_optionalChain([prop, 'optionalAccess', _6 => _6.value, 'optionalAccess', _7 => _7.objectId]) && _optionalChain([prop, 'optionalAccess', _8 => _8.value, 'optionalAccess', _9 => _9.className]) === 'Object') {\n const id = prop.value.objectId;\n add(vars => this._unrollObject(id, prop.name, vars, next));\n } else if (_optionalChain([prop, 'optionalAccess', _10 => _10.value, 'optionalAccess', _11 => _11.value]) != null || _optionalChain([prop, 'optionalAccess', _12 => _12.value, 'optionalAccess', _13 => _13.description]) != null) {\n add(vars => this._unrollOther(prop, vars, next));\n }\n }\n\n next({});\n });\n }\n\n /**\n * Gets all the PropertyDescriptors of an object\n */\n _getProperties(objectId, next) {\n this._session.post(\n 'Runtime.getProperties',\n {\n objectId,\n ownProperties: true,\n },\n (err, params) => {\n if (err) {\n next([]);\n } else {\n next(params.result);\n }\n },\n );\n }\n\n /**\n * Unrolls an array property\n */\n _unrollArray(objectId, name, vars, next) {\n this._getProperties(objectId, props => {\n vars[name] = props\n .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10)))\n .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10))\n .map(v => _optionalChain([v, 'optionalAccess', _14 => _14.value, 'optionalAccess', _15 => _15.value]));\n\n next(vars);\n });\n }\n\n /**\n * Unrolls an object property\n */\n _unrollObject(objectId, name, vars, next) {\n this._getProperties(objectId, props => {\n vars[name] = props\n .map(v => [v.name, _optionalChain([v, 'optionalAccess', _16 => _16.value, 'optionalAccess', _17 => _17.value])])\n .reduce((obj, [key, val]) => {\n obj[key] = val;\n return obj;\n }, {} );\n\n next(vars);\n });\n }\n\n /**\n * Unrolls other properties\n */\n _unrollOther(prop, vars, next) {\n if (_optionalChain([prop, 'optionalAccess', _18 => _18.value, 'optionalAccess', _19 => _19.value]) != null) {\n vars[prop.name] = prop.value.value;\n } else if (_optionalChain([prop, 'optionalAccess', _20 => _20.value, 'optionalAccess', _21 => _21.description]) != null && _optionalChain([prop, 'optionalAccess', _22 => _22.value, 'optionalAccess', _23 => _23.type]) !== 'function') {\n vars[prop.name] = `<${prop.value.description}>`;\n }\n\n next(vars);\n }\n}\n\n/**\n * When using Vercel pkg, the inspector module is not available.\n * https://github.com/getsentry/sentry-javascript/issues/6769\n */\nfunction tryNewAsyncSession() {\n try {\n return new AsyncSession();\n } catch (e) {\n return undefined;\n }\n}\n\nconst INTEGRATION_NAME = 'LocalVariables';\n\n/**\n * Adds local variables to exception frames\n */\nconst _localVariablesSyncIntegration = ((\n options = {},\n session = tryNewAsyncSession(),\n) => {\n const cachedFrames = new LRUMap(20);\n let rateLimiter;\n let shouldProcessEvent = false;\n\n function handlePaused(\n stackParser,\n { params: { reason, data, callFrames } },\n complete,\n ) {\n if (reason !== 'exception' && reason !== 'promiseRejection') {\n complete();\n return;\n }\n\n _optionalChain([rateLimiter, 'optionalCall', _24 => _24()]);\n\n // data.description contains the original error.stack\n const exceptionHash = hashFromStack(stackParser, _optionalChain([data, 'optionalAccess', _25 => _25.description]));\n\n if (exceptionHash == undefined) {\n complete();\n return;\n }\n\n const { add, next } = createCallbackList(frames => {\n cachedFrames.set(exceptionHash, frames);\n complete();\n });\n\n // Because we're queuing up and making all these calls synchronously, we can potentially overflow the stack\n // For this reason we only attempt to get local variables for the first 5 frames\n for (let i = 0; i < Math.min(callFrames.length, 5); i++) {\n const { scopeChain, functionName, this: obj } = callFrames[i];\n\n const localScope = scopeChain.find(scope => scope.type === 'local');\n\n // obj.className is undefined in ESM modules\n const fn = obj.className === 'global' || !obj.className ? functionName : `${obj.className}.${functionName}`;\n\n if (_optionalChain([localScope, 'optionalAccess', _26 => _26.object, 'access', _27 => _27.objectId]) === undefined) {\n add(frames => {\n frames[i] = { function: fn };\n next(frames);\n });\n } else {\n const id = localScope.object.objectId;\n add(frames =>\n _optionalChain([session, 'optionalAccess', _28 => _28.getLocalVariables, 'call', _29 => _29(id, vars => {\n frames[i] = { function: fn, vars };\n next(frames);\n })]),\n );\n }\n }\n\n next([]);\n }\n\n function addLocalVariablesToException(exception) {\n const hash = hashFrames(_optionalChain([exception, 'optionalAccess', _30 => _30.stacktrace, 'optionalAccess', _31 => _31.frames]));\n\n if (hash === undefined) {\n return;\n }\n\n // Check if we have local variables for an exception that matches the hash\n // remove is identical to get but also removes the entry from the cache\n const cachedFrame = cachedFrames.remove(hash);\n\n if (cachedFrame === undefined) {\n return;\n }\n\n // Filter out frames where the function name is `new Promise` since these are in the error.stack frames\n // but do not appear in the debugger call frames\n const frames = (_optionalChain([exception, 'access', _32 => _32.stacktrace, 'optionalAccess', _33 => _33.frames]) || []).filter(frame => frame.function !== 'new Promise');\n\n for (let i = 0; i < frames.length; i++) {\n // Sentry frames are in reverse order\n const frameIndex = frames.length - i - 1;\n\n // Drop out if we run out of frames to match up\n if (!frames[frameIndex] || !cachedFrame[i]) {\n break;\n }\n\n if (\n // We need to have vars to add\n cachedFrame[i].vars === undefined ||\n // We're not interested in frames that are not in_app because the vars are not relevant\n frames[frameIndex].in_app === false ||\n // The function names need to match\n !functionNamesMatch(frames[frameIndex].function, cachedFrame[i].function)\n ) {\n continue;\n }\n\n frames[frameIndex].vars = cachedFrame[i].vars;\n }\n }\n\n function addLocalVariablesToEvent(event) {\n for (const exception of _optionalChain([event, 'optionalAccess', _34 => _34.exception, 'optionalAccess', _35 => _35.values]) || []) {\n addLocalVariablesToException(exception);\n }\n\n return event;\n }\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const client = getClient();\n const clientOptions = _optionalChain([client, 'optionalAccess', _36 => _36.getOptions, 'call', _37 => _37()]);\n\n if (session && _optionalChain([clientOptions, 'optionalAccess', _38 => _38.includeLocalVariables])) {\n // Only setup this integration if the Node version is >= v18\n // https://github.com/getsentry/sentry-javascript/issues/7697\n const unsupportedNodeVersion = NODE_VERSION.major < 18;\n\n if (unsupportedNodeVersion) {\n logger.log('The `LocalVariables` integration is only supported on Node >= v18.');\n return;\n }\n\n const captureAll = options.captureAllExceptions !== false;\n\n session.configureAndConnect(\n (ev, complete) =>\n handlePaused(clientOptions.stackParser, ev , complete),\n captureAll,\n );\n\n if (captureAll) {\n const max = options.maxExceptionsPerSecond || 50;\n\n rateLimiter = createRateLimiter(\n max,\n () => {\n logger.log('Local variables rate-limit lifted.');\n _optionalChain([session, 'optionalAccess', _39 => _39.setPauseOnExceptions, 'call', _40 => _40(true)]);\n },\n seconds => {\n logger.log(\n `Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${seconds} seconds.`,\n );\n _optionalChain([session, 'optionalAccess', _41 => _41.setPauseOnExceptions, 'call', _42 => _42(false)]);\n },\n );\n }\n\n shouldProcessEvent = true;\n }\n },\n processEvent(event) {\n if (shouldProcessEvent) {\n return addLocalVariablesToEvent(event);\n }\n\n return event;\n },\n // These are entirely for testing\n _getCachedFramesCount() {\n return cachedFrames.size;\n },\n _getFirstCachedFrame() {\n return cachedFrames.values()[0];\n },\n };\n}) ;\n\nconst localVariablesSyncIntegration = defineIntegration(_localVariablesSyncIntegration);\n\n/**\n * Adds local variables to exception frames.\n * @deprecated Use `localVariablesSyncIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst LocalVariablesSync = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n localVariablesSyncIntegration,\n)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nexport { LocalVariablesSync, createCallbackList, localVariablesSyncIntegration };\n//# sourceMappingURL=local-variables-sync.js.map\n"],"names":[],"mappings":";;;;;;;AASA,SAAS,mBAAmB,UAAU;AAEpC,MAAI,YAAY,CAAA;AAEhB,MAAI,kBAAkB;AACtB,WAAS,gBAAgB,QAAQ;AAC/B,gBAAY,CAAA;AACZ,QAAI,iBAAiB;AACnB;AAAA,IACD;AACD,sBAAkB;AAClB,aAAS,MAAM;AAAA,EAChB;AAGD,YAAU,KAAK,eAAe;AAE9B,WAAS,IAAI,IAAI;AACf,cAAU,KAAK,EAAE;AAAA,EAClB;AAED,WAAS,KAAK,QAAQ;AACpB,UAAM,SAAS,UAAU,IAAG,KAAM;AAElC,QAAI;AACF,aAAO,MAAM;AAAA,IACd,SAAQ,GAAG;AAEV,sBAAgB,MAAM;AAAA,IACvB;AAAA,EACF;AAED,SAAO,EAAE,KAAK;AAChB;AAWA,MAAM,aAAc;AAAA;AAAA,EAGjB,cAAc;AAgBb,UAAM,EAAE,QAAO,IAAK,QAAQ,WAAW;AACvC,SAAK,WAAW,IAAI;EACrB;AAAA;AAAA,EAGA,oBAAoB,SAAS,YAAY;AACxC,SAAK,SAAS;AAEd,SAAK,SAAS,GAAG,mBAAmB,WAAS;AAC3C,cAAQ,OAAO,MAAM;AAEnB,aAAK,SAAS,KAAK,iBAAiB;AAAA,MAC5C,CAAO;AAAA,IACP,CAAK;AAED,SAAK,SAAS,KAAK,iBAAiB;AACpC,SAAK,SAAS,KAAK,iCAAiC,EAAE,OAAO,aAAa,QAAQ,WAAU,CAAE;AAAA,EAC/F;AAAA,EAEA,qBAAqB,YAAY;AAChC,SA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IACD,aAAa,OAAO;AAClB,UAAI,oBAAoB;AACtB,eAAO,yBAAyB,KAAK;AAAA,MACtC;AAED,aAAO;AAAA,IACR;AAAA;AAAA,IAED,wBAAwB;AACtB,aAAO,aAAa;AAAA,IACrB;AAAA,IACD,uBAAuB;AACrB,aAAO,aAAa,SAAS,CAAC;AAAA,IAC/B;AAAA,EACL;AACA;AAEK,MAAC,gCAAgC,kBAAkB,8BAA8B;AAO3D;AAAA,EACzB;AAAA,EACA;AACF;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"modules.cjs","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/modules.js"],"sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\n\nlet moduleCache;\n\nconst INTEGRATION_NAME = 'Modules';\n\n/** Extract information about paths */\nfunction getPaths() {\n try {\n return require.cache ? Object.keys(require.cache ) : [];\n } catch (e) {\n return [];\n }\n}\n\n/** Extract information about package.json modules */\nfunction collectModules()\n\n {\n const mainPaths = (require.main && require.main.paths) || [];\n const paths = getPaths();\n const infos\n\n = {};\n const seen\n\n = {};\n\n paths.forEach(path => {\n let dir = path;\n\n /** Traverse directories upward in the search of package.json file */\n const updir = () => {\n const orig = dir;\n dir = dirname(orig);\n\n if (!dir || orig === dir || seen[orig]) {\n return undefined;\n }\n if (mainPaths.indexOf(dir) < 0) {\n return updir();\n }\n\n const pkgfile = join(orig, 'package.json');\n seen[orig] = true;\n\n if (!existsSync(pkgfile)) {\n return updir();\n }\n\n try {\n const info = JSON.parse(readFileSync(pkgfile, 'utf8'))\n\n;\n infos[info.name] = info.version;\n } catch (_oO) {\n // no-empty\n }\n };\n\n updir();\n });\n\n return infos;\n}\n\n/** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */\nfunction _getModules() {\n if (!moduleCache) {\n moduleCache = collectModules();\n }\n return moduleCache;\n}\n\nconst _modulesIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event) {\n event.modules = {\n ...event.modules,\n ..._getModules(),\n };\n\n return event;\n },\n };\n}) ;\n\nconst modulesIntegration = defineIntegration(_modulesIntegration);\n\n/**\n * Add node modules / packages to the event.\n * @deprecated Use `modulesIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Modules = convertIntegrationFnToClass(INTEGRATION_NAME, modulesIntegration)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nexport { Modules, modulesIntegration };\n//# sourceMappingURL=modules.js.map\n"],"names":["path","dirname","join","existsSync","readFileSync","defineIntegration","convertIntegrationFnToClass"],"mappings":";;;;;AAIA,IAAI;AAEJ,MAAM,mBAAmB;AAGzB,SAAS,WAAW;AAClB,MAAI;AACF,WAAO,QAAQ,QAAQ,OAAO,KAAK,QAAQ,KAAO,IAAG;EACtD,SAAQ,GAAP;AACA,WAAO;EACR;AACH;AAGA,SAAS,iBAER;AACC,QAAM,YAAa,QAAQ,QAAQ,QAAQ,KAAK,SAAU;AAC1D,QAAM,QAAQ;AACd,QAAM,QAEL;AACD,QAAM,OAEL;AAED,QAAM,QAAQA,YAAQ;AACpB,QAAI,MAAMA;AAGV,UAAM,QAAQ,MAAM;AAClB,YAAM,OAAO;AACb,YAAMC,KAAAA,QAAQ,IAAI;AAElB,UAAI,CAAC,OAAO,SAAS,OAAO,KAAK,IAAI,GAAG;AACtC,eAAO;AAAA,MACR;AACD,UAAI,UAAU,QAAQ,GAAG,IAAI,GAAG;AAC9B,eAAO,MAAK;AAAA,MACb;AAED,YAAM,UAAUC,KAAAA,KAAK,MAAM,cAAc;AACzC,WAAK,IAAI,IAAI;AAEb,UAAI,CAACC,GAAAA,WAAW,OAAO,GAAG;AACxB,eAAO,MAAK;AAAA,MACb;AAED,UAAI;AACF,cAAM,OAAO,KAAK,MAAMC,GAAAA,aAAa,SAAS,MAAM,CAAC;AAGrD,cAAM,KAAK,IAAI,IAAI,KAAK;AAAA,MACzB,SAAQ,KAAP;AAAA,MAED;AAAA,IACP;AAEI;EACJ,CAAG;AAED,SAAO;AACT;AAGA,SAAS,cAAc;AACrB,MAAI,CAAC,aAAa;AAChB,kBAAc,eAAc;AAAA,EAC7B;AACD,SAAO;AACT;AAEA,MAAM,sBAAuB,MAAM;AACjC,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,YAAY;AAAA,IAAE;AAAA;AAAA,IACd,aAAa,OAAO;AAClB,YAAM,UAAU;AAAA,QACd,GAAG,MAAM;AAAA,QACT,GAAG,YAAa;AAAA,MACxB;AAEM,aAAO;AAAA,IACR;AAAA,EACL;AACA;AAEK,MAAC,qBAAqBC,YAAiB,kBAAC,mBAAmB;AAOhDC,YAAAA,4BAA4B,kBAAkB,kBAAkB;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"modules.cjs","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/modules.js"],"sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\n\nlet moduleCache;\n\nconst INTEGRATION_NAME = 'Modules';\n\n/** Extract information about paths */\nfunction getPaths() {\n try {\n return require.cache ? Object.keys(require.cache ) : [];\n } catch (e) {\n return [];\n }\n}\n\n/** Extract information about package.json modules */\nfunction collectModules()\n\n {\n const mainPaths = (require.main && require.main.paths) || [];\n const paths = getPaths();\n const infos\n\n = {};\n const seen\n\n = {};\n\n paths.forEach(path => {\n let dir = path;\n\n /** Traverse directories upward in the search of package.json file */\n const updir = () => {\n const orig = dir;\n dir = dirname(orig);\n\n if (!dir || orig === dir || seen[orig]) {\n return undefined;\n }\n if (mainPaths.indexOf(dir) < 0) {\n return updir();\n }\n\n const pkgfile = join(orig, 'package.json');\n seen[orig] = true;\n\n if (!existsSync(pkgfile)) {\n return updir();\n }\n\n try {\n const info = JSON.parse(readFileSync(pkgfile, 'utf8'))\n\n;\n infos[info.name] = info.version;\n } catch (_oO) {\n // no-empty\n }\n };\n\n updir();\n });\n\n return infos;\n}\n\n/** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */\nfunction _getModules() {\n if (!moduleCache) {\n moduleCache = collectModules();\n }\n return moduleCache;\n}\n\nconst _modulesIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event) {\n event.modules = {\n ...event.modules,\n ..._getModules(),\n };\n\n return event;\n },\n };\n}) ;\n\nconst modulesIntegration = defineIntegration(_modulesIntegration);\n\n/**\n * Add node modules / packages to the event.\n * @deprecated Use `modulesIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Modules = convertIntegrationFnToClass(INTEGRATION_NAME, modulesIntegration)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nexport { Modules, modulesIntegration };\n//# sourceMappingURL=modules.js.map\n"],"names":["path","dirname","join","existsSync","readFileSync","defineIntegration","convertIntegrationFnToClass"],"mappings":";;;;;AAIA,IAAI;AAEJ,MAAM,mBAAmB;AAGzB,SAAS,WAAW;AAClB,MAAI;AACF,WAAO,QAAQ,QAAQ,OAAO,KAAK,QAAQ,KAAO,IAAG;EACtD,SAAQ,GAAG;AACV,WAAO;EACR;AACH;AAGA,SAAS,iBAER;AACC,QAAM,YAAa,QAAQ,QAAQ,QAAQ,KAAK,SAAU;AAC1D,QAAM,QAAQ;AACd,QAAM,QAEL;AACD,QAAM,OAEL;AAED,QAAM,QAAQA,YAAQ;AACpB,QAAI,MAAMA;AAGV,UAAM,QAAQ,MAAM;AAClB,YAAM,OAAO;AACb,YAAMC,KAAAA,QAAQ,IAAI;AAElB,UAAI,CAAC,OAAO,SAAS,OAAO,KAAK,IAAI,GAAG;AACtC,eAAO;AAAA,MACR;AACD,UAAI,UAAU,QAAQ,GAAG,IAAI,GAAG;AAC9B,eAAO,MAAK;AAAA,MACb;AAED,YAAM,UAAUC,KAAAA,KAAK,MAAM,cAAc;AACzC,WAAK,IAAI,IAAI;AAEb,UAAI,CAACC,GAAAA,WAAW,OAAO,GAAG;AACxB,eAAO,MAAK;AAAA,MACb;AAED,UAAI;AACF,cAAM,OAAO,KAAK,MAAMC,GAAAA,aAAa,SAAS,MAAM,CAAC;AAGrD,cAAM,KAAK,IAAI,IAAI,KAAK;AAAA,MACzB,SAAQ,KAAK;AAAA,MAEb;AAAA,IACP;AAEI;EACJ,CAAG;AAED,SAAO;AACT;AAGA,SAAS,cAAc;AACrB,MAAI,CAAC,aAAa;AAChB,kBAAc,eAAc;AAAA,EAC7B;AACD,SAAO;AACT;AAEA,MAAM,sBAAuB,MAAM;AACjC,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,YAAY;AAAA,IAAE;AAAA;AAAA,IACd,aAAa,OAAO;AAClB,YAAM,UAAU;AAAA,QACd,GAAG,MAAM;AAAA,QACT,GAAG,YAAa;AAAA,MACxB;AAEM,aAAO;AAAA,IACR;AAAA,EACL;AACA;AAEK,MAAC,qBAAqBC,YAAiB,kBAAC,mBAAmB;AAOhDC,YAAAA,4BAA4B,kBAAkB,kBAAkB;;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"modules.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/modules.js"],"sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\n\nlet moduleCache;\n\nconst INTEGRATION_NAME = 'Modules';\n\n/** Extract information about paths */\nfunction getPaths() {\n try {\n return require.cache ? Object.keys(require.cache ) : [];\n } catch (e) {\n return [];\n }\n}\n\n/** Extract information about package.json modules */\nfunction collectModules()\n\n {\n const mainPaths = (require.main && require.main.paths) || [];\n const paths = getPaths();\n const infos\n\n = {};\n const seen\n\n = {};\n\n paths.forEach(path => {\n let dir = path;\n\n /** Traverse directories upward in the search of package.json file */\n const updir = () => {\n const orig = dir;\n dir = dirname(orig);\n\n if (!dir || orig === dir || seen[orig]) {\n return undefined;\n }\n if (mainPaths.indexOf(dir) < 0) {\n return updir();\n }\n\n const pkgfile = join(orig, 'package.json');\n seen[orig] = true;\n\n if (!existsSync(pkgfile)) {\n return updir();\n }\n\n try {\n const info = JSON.parse(readFileSync(pkgfile, 'utf8'))\n\n;\n infos[info.name] = info.version;\n } catch (_oO) {\n // no-empty\n }\n };\n\n updir();\n });\n\n return infos;\n}\n\n/** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */\nfunction _getModules() {\n if (!moduleCache) {\n moduleCache = collectModules();\n }\n return moduleCache;\n}\n\nconst _modulesIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event) {\n event.modules = {\n ...event.modules,\n ..._getModules(),\n };\n\n return event;\n },\n };\n}) ;\n\nconst modulesIntegration = defineIntegration(_modulesIntegration);\n\n/**\n * Add node modules / packages to the event.\n * @deprecated Use `modulesIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Modules = convertIntegrationFnToClass(INTEGRATION_NAME, modulesIntegration)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nexport { Modules, modulesIntegration };\n//# sourceMappingURL=modules.js.map\n"],"names":[],"mappings":";;;AAIA,IAAI;AAEJ,MAAM,mBAAmB;AAGzB,SAAS,WAAW;AAClB,MAAI;AACF,WAAO,QAAQ,QAAQ,OAAO,KAAK,QAAQ,KAAO,IAAG;EACtD,SAAQ,GAAP;AACA,WAAO;EACR;AACH;AAGA,SAAS,iBAER;AACC,QAAM,YAAa,QAAQ,QAAQ,QAAQ,KAAK,SAAU;AAC1D,QAAM,QAAQ;AACd,QAAM,QAEL;AACD,QAAM,OAEL;AAED,QAAM,QAAQ,UAAQ;AACpB,QAAI,MAAM;AAGV,UAAM,QAAQ,MAAM;AAClB,YAAM,OAAO;AACb,YAAM,QAAQ,IAAI;AAElB,UAAI,CAAC,OAAO,SAAS,OAAO,KAAK,IAAI,GAAG;AACtC,eAAO;AAAA,MACR;AACD,UAAI,UAAU,QAAQ,GAAG,IAAI,GAAG;AAC9B,eAAO,MAAK;AAAA,MACb;AAED,YAAM,UAAU,KAAK,MAAM,cAAc;AACzC,WAAK,IAAI,IAAI;AAEb,UAAI,CAAC,WAAW,OAAO,GAAG;AACxB,eAAO,MAAK;AAAA,MACb;AAED,UAAI;AACF,cAAM,OAAO,KAAK,MAAM,aAAa,SAAS,MAAM,CAAC;AAGrD,cAAM,KAAK,IAAI,IAAI,KAAK;AAAA,MACzB,SAAQ,KAAP;AAAA,MAED;AAAA,IACP;AAEI;EACJ,CAAG;AAED,SAAO;AACT;AAGA,SAAS,cAAc;AACrB,MAAI,CAAC,aAAa;AAChB,kBAAc,eAAc;AAAA,EAC7B;AACD,SAAO;AACT;AAEA,MAAM,sBAAuB,MAAM;AACjC,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,YAAY;AAAA,IAAE;AAAA;AAAA,IACd,aAAa,OAAO;AAClB,YAAM,UAAU;AAAA,QACd,GAAG,MAAM;AAAA,QACT,GAAG,YAAa;AAAA,MACxB;AAEM,aAAO;AAAA,IACR;AAAA,EACL;AACA;AAEK,MAAC,qBAAqB,kBAAkB,mBAAmB;AAOhD,4BAA4B,kBAAkB,kBAAkB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"modules.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/modules.js"],"sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\n\nlet moduleCache;\n\nconst INTEGRATION_NAME = 'Modules';\n\n/** Extract information about paths */\nfunction getPaths() {\n try {\n return require.cache ? Object.keys(require.cache ) : [];\n } catch (e) {\n return [];\n }\n}\n\n/** Extract information about package.json modules */\nfunction collectModules()\n\n {\n const mainPaths = (require.main && require.main.paths) || [];\n const paths = getPaths();\n const infos\n\n = {};\n const seen\n\n = {};\n\n paths.forEach(path => {\n let dir = path;\n\n /** Traverse directories upward in the search of package.json file */\n const updir = () => {\n const orig = dir;\n dir = dirname(orig);\n\n if (!dir || orig === dir || seen[orig]) {\n return undefined;\n }\n if (mainPaths.indexOf(dir) < 0) {\n return updir();\n }\n\n const pkgfile = join(orig, 'package.json');\n seen[orig] = true;\n\n if (!existsSync(pkgfile)) {\n return updir();\n }\n\n try {\n const info = JSON.parse(readFileSync(pkgfile, 'utf8'))\n\n;\n infos[info.name] = info.version;\n } catch (_oO) {\n // no-empty\n }\n };\n\n updir();\n });\n\n return infos;\n}\n\n/** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */\nfunction _getModules() {\n if (!moduleCache) {\n moduleCache = collectModules();\n }\n return moduleCache;\n}\n\nconst _modulesIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event) {\n event.modules = {\n ...event.modules,\n ..._getModules(),\n };\n\n return event;\n },\n };\n}) ;\n\nconst modulesIntegration = defineIntegration(_modulesIntegration);\n\n/**\n * Add node modules / packages to the event.\n * @deprecated Use `modulesIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Modules = convertIntegrationFnToClass(INTEGRATION_NAME, modulesIntegration)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nexport { Modules, modulesIntegration };\n//# sourceMappingURL=modules.js.map\n"],"names":[],"mappings":";;;AAIA,IAAI;AAEJ,MAAM,mBAAmB;AAGzB,SAAS,WAAW;AAClB,MAAI;AACF,WAAO,QAAQ,QAAQ,OAAO,KAAK,QAAQ,KAAO,IAAG;EACtD,SAAQ,GAAG;AACV,WAAO;EACR;AACH;AAGA,SAAS,iBAER;AACC,QAAM,YAAa,QAAQ,QAAQ,QAAQ,KAAK,SAAU;AAC1D,QAAM,QAAQ;AACd,QAAM,QAEL;AACD,QAAM,OAEL;AAED,QAAM,QAAQ,UAAQ;AACpB,QAAI,MAAM;AAGV,UAAM,QAAQ,MAAM;AAClB,YAAM,OAAO;AACb,YAAM,QAAQ,IAAI;AAElB,UAAI,CAAC,OAAO,SAAS,OAAO,KAAK,IAAI,GAAG;AACtC,eAAO;AAAA,MACR;AACD,UAAI,UAAU,QAAQ,GAAG,IAAI,GAAG;AAC9B,eAAO,MAAK;AAAA,MACb;AAED,YAAM,UAAU,KAAK,MAAM,cAAc;AACzC,WAAK,IAAI,IAAI;AAEb,UAAI,CAAC,WAAW,OAAO,GAAG;AACxB,eAAO,MAAK;AAAA,MACb;AAED,UAAI;AACF,cAAM,OAAO,KAAK,MAAM,aAAa,SAAS,MAAM,CAAC;AAGrD,cAAM,KAAK,IAAI,IAAI,KAAK;AAAA,MACzB,SAAQ,KAAK;AAAA,MAEb;AAAA,IACP;AAEI;EACJ,CAAG;AAED,SAAO;AACT;AAGA,SAAS,cAAc;AACrB,MAAI,CAAC,aAAa;AAChB,kBAAc,eAAc;AAAA,EAC7B;AACD,SAAO;AACT;AAEA,MAAM,sBAAuB,MAAM;AACjC,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,YAAY;AAAA,IAAE;AAAA;AAAA,IACd,aAAa,OAAO;AAClB,YAAM,UAAU;AAAA,QACd,GAAG,MAAM;AAAA,QACT,GAAG,YAAa;AAAA,MACxB;AAEM,aAAO;AAAA,IACR;AAAA,EACL;AACA;AAEK,MAAC,qBAAqB,kBAAkB,mBAAmB;AAOhD,4BAA4B,kBAAkB,kBAAkB;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"spotlight.cjs","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/spotlight.js"],"sourcesContent":["import * as http from 'http';\nimport { URL } from 'url';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { logger, serializeEnvelope } from '@sentry/utils';\n\nconst INTEGRATION_NAME = 'Spotlight';\n\nconst _spotlightIntegration = ((options = {}) => {\n const _options = {\n sidecarUrl: options.sidecarUrl || 'http://localhost:8969/stream',\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n if (typeof process === 'object' && process.env && process.env.NODE_ENV !== 'development') {\n logger.warn(\"[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?\");\n }\n connectToSpotlight(client, _options);\n },\n };\n}) ;\n\nconst spotlightIntegration = defineIntegration(_spotlightIntegration);\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n *\n * Important: This integration only works with Node 18 or newer.\n *\n * @deprecated Use `spotlightIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Spotlight = convertIntegrationFnToClass(INTEGRATION_NAME, spotlightIntegration)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nfunction connectToSpotlight(client, options) {\n const spotlightUrl = parseSidecarUrl(options.sidecarUrl);\n if (!spotlightUrl) {\n return;\n }\n\n let failedRequests = 0;\n\n if (typeof client.on !== 'function') {\n logger.warn('[Spotlight] Cannot connect to spotlight due to missing method on SDK client (`client.on`)');\n return;\n }\n\n client.on('beforeEnvelope', (envelope) => {\n if (failedRequests > 3) {\n logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests');\n return;\n }\n\n const serializedEnvelope = serializeEnvelope(envelope);\n\n const request = getNativeHttpRequest();\n const req = request(\n {\n method: 'POST',\n path: spotlightUrl.pathname,\n hostname: spotlightUrl.hostname,\n port: spotlightUrl.port,\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n },\n res => {\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n res.setEncoding('utf8');\n },\n );\n\n req.on('error', () => {\n failedRequests++;\n logger.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar');\n });\n req.write(serializedEnvelope);\n req.end();\n });\n}\n\nfunction parseSidecarUrl(url) {\n try {\n return new URL(`${url}`);\n } catch (e) {\n logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`);\n return undefined;\n }\n}\n\n/**\n * We want to get an unpatched http request implementation to avoid capturing our own calls.\n */\nfunction getNativeHttpRequest() {\n const { request } = http;\n if (isWrapped(request)) {\n return request.__sentry_original__;\n }\n\n return request;\n}\n\nfunction isWrapped(impl) {\n return '__sentry_original__' in impl;\n}\n\nexport { Spotlight, getNativeHttpRequest, spotlightIntegration };\n//# sourceMappingURL=spotlight.js.map\n"],"names":["logger","defineIntegration","convertIntegrationFnToClass","envelope","serializeEnvelope","url","URL","http"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,mBAAmB;AAEzB,MAAM,wBAAyB,CAAC,UAAU,OAAO;AAC/C,QAAM,WAAW;AAAA,IACf,YAAY,QAAQ,cAAc;AAAA,EACtC;AAEE,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,YAAY;AAAA,IAAE;AAAA;AAAA,IACd,MAAM,QAAQ;AACZ,UAAI,OAAO,YAAY,YAAY,QAAQ,OAAO,QAAQ,IAAI,aAAa,eAAe;AACxFA,sBAAO,KAAK,4FAA4F;AAAA,MACzG;AACD,yBAAmB,QAAQ,QAAQ;AAAA,IACpC;AAAA,EACL;AACA;AAEK,MAAC,uBAAuBC,YAAiB,kBAAC,qBAAqB;AAYlDC,YAAAA,4BAA4B,kBAAkB,oBAAoB;AAMpF,SAAS,mBAAmB,QAAQ,SAAS;AAC3C,QAAM,eAAe,gBAAgB,QAAQ,UAAU;AACvD,MAAI,CAAC,cAAc;AACjB;AAAA,EACD;AAED,MAAI,iBAAiB;AAErB,MAAI,OAAO,OAAO,OAAO,YAAY;AACnCF,kBAAO,KAAK,2FAA2F;AACvG;AAAA,EACD;AAED,SAAO,GAAG,kBAAkB,CAACG,eAAa;AACxC,QAAI,iBAAiB,GAAG;AACtBH,oBAAO,KAAK,sFAAsF;AAClG;AAAA,IACD;AAED,UAAM,qBAAqBI,2BAAkBD,UAAQ;AAErD,UAAM,UAAU;AAChB,UAAM,MAAM;AAAA,MACV;AAAA,QACE,QAAQ;AAAA,QACR,MAAM,aAAa;AAAA,QACnB,UAAU,aAAa;AAAA,QACvB,MAAM,aAAa;AAAA,QACnB,SAAS;AAAA,UACP,gBAAgB;AAAA,QACjB;AAAA,MACF;AAAA,MACD,SAAO;AACL,YAAI,GAAG,QAAQ,MAAM;AAAA,QAE7B,CAAS;AAED,YAAI,GAAG,OAAO,MAAM;AAAA,QAE5B,CAAS;AACD,YAAI,YAAY,MAAM;AAAA,MACvB;AAAA,IACP;AAEI,QAAI,GAAG,SAAS,MAAM;AACpB;AACAH,oBAAO,KAAK,0DAA0D;AAAA,IAC5E,CAAK;AACD,QAAI,MAAM,kBAAkB;AAC5B,QAAI,IAAG;AAAA,EACX,CAAG;AACH;AAEA,SAAS,gBAAgBK,OAAK;AAC5B,MAAI;AACF,WAAO,IAAIC,IAAAA,IAAI,GAAGD,OAAK;AAAA,EACxB,SAAQ,GAAP;AACAL,WAAAA,OAAO,KAAK,oCAAoCK,OAAK;AACrD,WAAO;AAAA,EACR;AACH;AAKA,SAAS,uBAAuB;AAC9B,QAAM,EAAE,QAAS,IAAGE;AACpB,MAAI,UAAU,OAAO,GAAG;AACtB,WAAO,QAAQ;AAAA,EAChB;AAED,SAAO;AACT;AAEA,SAAS,UAAU,MAAM;AACvB,SAAO,yBAAyB;AAClC;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"spotlight.cjs","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/spotlight.js"],"sourcesContent":["import * as http from 'http';\nimport { URL } from 'url';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { logger, serializeEnvelope } from '@sentry/utils';\n\nconst INTEGRATION_NAME = 'Spotlight';\n\nconst _spotlightIntegration = ((options = {}) => {\n const _options = {\n sidecarUrl: options.sidecarUrl || 'http://localhost:8969/stream',\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n if (typeof process === 'object' && process.env && process.env.NODE_ENV !== 'development') {\n logger.warn(\"[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?\");\n }\n connectToSpotlight(client, _options);\n },\n };\n}) ;\n\nconst spotlightIntegration = defineIntegration(_spotlightIntegration);\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n *\n * Important: This integration only works with Node 18 or newer.\n *\n * @deprecated Use `spotlightIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Spotlight = convertIntegrationFnToClass(INTEGRATION_NAME, spotlightIntegration)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nfunction connectToSpotlight(client, options) {\n const spotlightUrl = parseSidecarUrl(options.sidecarUrl);\n if (!spotlightUrl) {\n return;\n }\n\n let failedRequests = 0;\n\n if (typeof client.on !== 'function') {\n logger.warn('[Spotlight] Cannot connect to spotlight due to missing method on SDK client (`client.on`)');\n return;\n }\n\n client.on('beforeEnvelope', (envelope) => {\n if (failedRequests > 3) {\n logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests');\n return;\n }\n\n const serializedEnvelope = serializeEnvelope(envelope);\n\n const request = getNativeHttpRequest();\n const req = request(\n {\n method: 'POST',\n path: spotlightUrl.pathname,\n hostname: spotlightUrl.hostname,\n port: spotlightUrl.port,\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n },\n res => {\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n res.setEncoding('utf8');\n },\n );\n\n req.on('error', () => {\n failedRequests++;\n logger.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar');\n });\n req.write(serializedEnvelope);\n req.end();\n });\n}\n\nfunction parseSidecarUrl(url) {\n try {\n return new URL(`${url}`);\n } catch (e) {\n logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`);\n return undefined;\n }\n}\n\n/**\n * We want to get an unpatched http request implementation to avoid capturing our own calls.\n */\nfunction getNativeHttpRequest() {\n const { request } = http;\n if (isWrapped(request)) {\n return request.__sentry_original__;\n }\n\n return request;\n}\n\nfunction isWrapped(impl) {\n return '__sentry_original__' in impl;\n}\n\nexport { Spotlight, getNativeHttpRequest, spotlightIntegration };\n//# sourceMappingURL=spotlight.js.map\n"],"names":["logger","defineIntegration","convertIntegrationFnToClass","envelope","serializeEnvelope","url","URL","http"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,mBAAmB;AAEzB,MAAM,wBAAyB,CAAC,UAAU,OAAO;AAC/C,QAAM,WAAW;AAAA,IACf,YAAY,QAAQ,cAAc;AAAA,EACtC;AAEE,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,YAAY;AAAA,IAAE;AAAA;AAAA,IACd,MAAM,QAAQ;AACZ,UAAI,OAAO,YAAY,YAAY,QAAQ,OAAO,QAAQ,IAAI,aAAa,eAAe;AACxFA,sBAAO,KAAK,4FAA4F;AAAA,MACzG;AACD,yBAAmB,QAAQ,QAAQ;AAAA,IACpC;AAAA,EACL;AACA;AAEK,MAAC,uBAAuBC,YAAiB,kBAAC,qBAAqB;AAYlDC,YAAAA,4BAA4B,kBAAkB,oBAAoB;AAMpF,SAAS,mBAAmB,QAAQ,SAAS;AAC3C,QAAM,eAAe,gBAAgB,QAAQ,UAAU;AACvD,MAAI,CAAC,cAAc;AACjB;AAAA,EACD;AAED,MAAI,iBAAiB;AAErB,MAAI,OAAO,OAAO,OAAO,YAAY;AACnCF,kBAAO,KAAK,2FAA2F;AACvG;AAAA,EACD;AAED,SAAO,GAAG,kBAAkB,CAACG,eAAa;AACxC,QAAI,iBAAiB,GAAG;AACtBH,oBAAO,KAAK,sFAAsF;AAClG;AAAA,IACD;AAED,UAAM,qBAAqBI,2BAAkBD,UAAQ;AAErD,UAAM,UAAU;AAChB,UAAM,MAAM;AAAA,MACV;AAAA,QACE,QAAQ;AAAA,QACR,MAAM,aAAa;AAAA,QACnB,UAAU,aAAa;AAAA,QACvB,MAAM,aAAa;AAAA,QACnB,SAAS;AAAA,UACP,gBAAgB;AAAA,QACjB;AAAA,MACF;AAAA,MACD,SAAO;AACL,YAAI,GAAG,QAAQ,MAAM;AAAA,QAE7B,CAAS;AAED,YAAI,GAAG,OAAO,MAAM;AAAA,QAE5B,CAAS;AACD,YAAI,YAAY,MAAM;AAAA,MACvB;AAAA,IACP;AAEI,QAAI,GAAG,SAAS,MAAM;AACpB;AACAH,oBAAO,KAAK,0DAA0D;AAAA,IAC5E,CAAK;AACD,QAAI,MAAM,kBAAkB;AAC5B,QAAI,IAAG;AAAA,EACX,CAAG;AACH;AAEA,SAAS,gBAAgBK,OAAK;AAC5B,MAAI;AACF,WAAO,IAAIC,IAAAA,IAAI,GAAGD,KAAG,EAAE;AAAA,EACxB,SAAQ,GAAG;AACVL,WAAAA,OAAO,KAAK,oCAAoCK,KAAG,EAAE;AACrD,WAAO;AAAA,EACR;AACH;AAKA,SAAS,uBAAuB;AAC9B,QAAM,EAAE,QAAS,IAAGE;AACpB,MAAI,UAAU,OAAO,GAAG;AACtB,WAAO,QAAQ;AAAA,EAChB;AAED,SAAO;AACT;AAEA,SAAS,UAAU,MAAM;AACvB,SAAO,yBAAyB;AAClC;;;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"spotlight.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/spotlight.js"],"sourcesContent":["import * as http from 'http';\nimport { URL } from 'url';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { logger, serializeEnvelope } from '@sentry/utils';\n\nconst INTEGRATION_NAME = 'Spotlight';\n\nconst _spotlightIntegration = ((options = {}) => {\n const _options = {\n sidecarUrl: options.sidecarUrl || 'http://localhost:8969/stream',\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n if (typeof process === 'object' && process.env && process.env.NODE_ENV !== 'development') {\n logger.warn(\"[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?\");\n }\n connectToSpotlight(client, _options);\n },\n };\n}) ;\n\nconst spotlightIntegration = defineIntegration(_spotlightIntegration);\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n *\n * Important: This integration only works with Node 18 or newer.\n *\n * @deprecated Use `spotlightIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Spotlight = convertIntegrationFnToClass(INTEGRATION_NAME, spotlightIntegration)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nfunction connectToSpotlight(client, options) {\n const spotlightUrl = parseSidecarUrl(options.sidecarUrl);\n if (!spotlightUrl) {\n return;\n }\n\n let failedRequests = 0;\n\n if (typeof client.on !== 'function') {\n logger.warn('[Spotlight] Cannot connect to spotlight due to missing method on SDK client (`client.on`)');\n return;\n }\n\n client.on('beforeEnvelope', (envelope) => {\n if (failedRequests > 3) {\n logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests');\n return;\n }\n\n const serializedEnvelope = serializeEnvelope(envelope);\n\n const request = getNativeHttpRequest();\n const req = request(\n {\n method: 'POST',\n path: spotlightUrl.pathname,\n hostname: spotlightUrl.hostname,\n port: spotlightUrl.port,\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n },\n res => {\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n res.setEncoding('utf8');\n },\n );\n\n req.on('error', () => {\n failedRequests++;\n logger.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar');\n });\n req.write(serializedEnvelope);\n req.end();\n });\n}\n\nfunction parseSidecarUrl(url) {\n try {\n return new URL(`${url}`);\n } catch (e) {\n logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`);\n return undefined;\n }\n}\n\n/**\n * We want to get an unpatched http request implementation to avoid capturing our own calls.\n */\nfunction getNativeHttpRequest() {\n const { request } = http;\n if (isWrapped(request)) {\n return request.__sentry_original__;\n }\n\n return request;\n}\n\nfunction isWrapped(impl) {\n return '__sentry_original__' in impl;\n}\n\nexport { Spotlight, getNativeHttpRequest, spotlightIntegration };\n//# sourceMappingURL=spotlight.js.map\n"],"names":[],"mappings":";;;;;AAKA,MAAM,mBAAmB;AAEzB,MAAM,wBAAyB,CAAC,UAAU,OAAO;AAC/C,QAAM,WAAW;AAAA,IACf,YAAY,QAAQ,cAAc;AAAA,EACtC;AAEE,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,YAAY;AAAA,IAAE;AAAA;AAAA,IACd,MAAM,QAAQ;AACZ,UAAI,OAAO,YAAY,YAAY,QAAQ,OAAO,QAAQ,IAAI,aAAa,eAAe;AACxF,eAAO,KAAK,4FAA4F;AAAA,MACzG;AACD,yBAAmB,QAAQ,QAAQ;AAAA,IACpC;AAAA,EACL;AACA;AAEK,MAAC,uBAAuB,kBAAkB,qBAAqB;AAYlD,4BAA4B,kBAAkB,oBAAoB;AAMpF,SAAS,mBAAmB,QAAQ,SAAS;AAC3C,QAAM,eAAe,gBAAgB,QAAQ,UAAU;AACvD,MAAI,CAAC,cAAc;AACjB;AAAA,EACD;AAED,MAAI,iBAAiB;AAErB,MAAI,OAAO,OAAO,OAAO,YAAY;AACnC,WAAO,KAAK,2FAA2F;AACvG;AAAA,EACD;AAED,SAAO,GAAG,kBAAkB,CAAC,aAAa;AACxC,QAAI,iBAAiB,GAAG;AACtB,aAAO,KAAK,sFAAsF;AAClG;AAAA,IACD;AAED,UAAM,qBAAqB,kBAAkB,QAAQ;AAErD,UAAM,UAAU;AAChB,UAAM,MAAM;AAAA,MACV;AAAA,QACE,QAAQ;AAAA,QACR,MAAM,aAAa;AAAA,QACnB,UAAU,aAAa;AAAA,QACvB,MAAM,aAAa;AAAA,QACnB,SAAS;AAAA,UACP,gBAAgB;AAAA,QACjB;AAAA,MACF;AAAA,MACD,SAAO;AACL,YAAI,GAAG,QAAQ,MAAM;AAAA,QAE7B,CAAS;AAED,YAAI,GAAG,OAAO,MAAM;AAAA,QAE5B,CAAS;AACD,YAAI,YAAY,MAAM;AAAA,MACvB;AAAA,IACP;AAEI,QAAI,GAAG,SAAS,MAAM;AACpB;AACA,aAAO,KAAK,0DAA0D;AAAA,IAC5E,CAAK;AACD,QAAI,MAAM,kBAAkB;AAC5B,QAAI,IAAG;AAAA,EACX,CAAG;AACH;AAEA,SAAS,gBAAgB,KAAK;AAC5B,MAAI;AACF,WAAO,IAAI,IAAI,GAAG,KAAK;AAAA,EACxB,SAAQ,GAAP;AACA,WAAO,KAAK,oCAAoC,KAAK;AACrD,WAAO;AAAA,EACR;AACH;AAKA,SAAS,uBAAuB;AAC9B,QAAM,EAAE,QAAS,IAAG;AACpB,MAAI,UAAU,OAAO,GAAG;AACtB,WAAO,QAAQ;AAAA,EAChB;AAED,SAAO;AACT;AAEA,SAAS,UAAU,MAAM;AACvB,SAAO,yBAAyB;AAClC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"spotlight.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/spotlight.js"],"sourcesContent":["import * as http from 'http';\nimport { URL } from 'url';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { logger, serializeEnvelope } from '@sentry/utils';\n\nconst INTEGRATION_NAME = 'Spotlight';\n\nconst _spotlightIntegration = ((options = {}) => {\n const _options = {\n sidecarUrl: options.sidecarUrl || 'http://localhost:8969/stream',\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n if (typeof process === 'object' && process.env && process.env.NODE_ENV !== 'development') {\n logger.warn(\"[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?\");\n }\n connectToSpotlight(client, _options);\n },\n };\n}) ;\n\nconst spotlightIntegration = defineIntegration(_spotlightIntegration);\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n *\n * Important: This integration only works with Node 18 or newer.\n *\n * @deprecated Use `spotlightIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Spotlight = convertIntegrationFnToClass(INTEGRATION_NAME, spotlightIntegration)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\nfunction connectToSpotlight(client, options) {\n const spotlightUrl = parseSidecarUrl(options.sidecarUrl);\n if (!spotlightUrl) {\n return;\n }\n\n let failedRequests = 0;\n\n if (typeof client.on !== 'function') {\n logger.warn('[Spotlight] Cannot connect to spotlight due to missing method on SDK client (`client.on`)');\n return;\n }\n\n client.on('beforeEnvelope', (envelope) => {\n if (failedRequests > 3) {\n logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests');\n return;\n }\n\n const serializedEnvelope = serializeEnvelope(envelope);\n\n const request = getNativeHttpRequest();\n const req = request(\n {\n method: 'POST',\n path: spotlightUrl.pathname,\n hostname: spotlightUrl.hostname,\n port: spotlightUrl.port,\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n },\n res => {\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n res.setEncoding('utf8');\n },\n );\n\n req.on('error', () => {\n failedRequests++;\n logger.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar');\n });\n req.write(serializedEnvelope);\n req.end();\n });\n}\n\nfunction parseSidecarUrl(url) {\n try {\n return new URL(`${url}`);\n } catch (e) {\n logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`);\n return undefined;\n }\n}\n\n/**\n * We want to get an unpatched http request implementation to avoid capturing our own calls.\n */\nfunction getNativeHttpRequest() {\n const { request } = http;\n if (isWrapped(request)) {\n return request.__sentry_original__;\n }\n\n return request;\n}\n\nfunction isWrapped(impl) {\n return '__sentry_original__' in impl;\n}\n\nexport { Spotlight, getNativeHttpRequest, spotlightIntegration };\n//# sourceMappingURL=spotlight.js.map\n"],"names":[],"mappings":";;;;;AAKA,MAAM,mBAAmB;AAEzB,MAAM,wBAAyB,CAAC,UAAU,OAAO;AAC/C,QAAM,WAAW;AAAA,IACf,YAAY,QAAQ,cAAc;AAAA,EACtC;AAEE,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,YAAY;AAAA,IAAE;AAAA;AAAA,IACd,MAAM,QAAQ;AACZ,UAAI,OAAO,YAAY,YAAY,QAAQ,OAAO,QAAQ,IAAI,aAAa,eAAe;AACxF,eAAO,KAAK,4FAA4F;AAAA,MACzG;AACD,yBAAmB,QAAQ,QAAQ;AAAA,IACpC;AAAA,EACL;AACA;AAEK,MAAC,uBAAuB,kBAAkB,qBAAqB;AAYlD,4BAA4B,kBAAkB,oBAAoB;AAMpF,SAAS,mBAAmB,QAAQ,SAAS;AAC3C,QAAM,eAAe,gBAAgB,QAAQ,UAAU;AACvD,MAAI,CAAC,cAAc;AACjB;AAAA,EACD;AAED,MAAI,iBAAiB;AAErB,MAAI,OAAO,OAAO,OAAO,YAAY;AACnC,WAAO,KAAK,2FAA2F;AACvG;AAAA,EACD;AAED,SAAO,GAAG,kBAAkB,CAAC,aAAa;AACxC,QAAI,iBAAiB,GAAG;AACtB,aAAO,KAAK,sFAAsF;AAClG;AAAA,IACD;AAED,UAAM,qBAAqB,kBAAkB,QAAQ;AAErD,UAAM,UAAU;AAChB,UAAM,MAAM;AAAA,MACV;AAAA,QACE,QAAQ;AAAA,QACR,MAAM,aAAa;AAAA,QACnB,UAAU,aAAa;AAAA,QACvB,MAAM,aAAa;AAAA,QACnB,SAAS;AAAA,UACP,gBAAgB;AAAA,QACjB;AAAA,MACF;AAAA,MACD,SAAO;AACL,YAAI,GAAG,QAAQ,MAAM;AAAA,QAE7B,CAAS;AAED,YAAI,GAAG,OAAO,MAAM;AAAA,QAE5B,CA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