@sentry/core 10.37.0 → 10.38.0

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 (50) hide show
  1. package/build/cjs/index.js +79 -79
  2. package/build/cjs/integrations/captureconsole.js +2 -2
  3. package/build/cjs/integrations/captureconsole.js.map +1 -1
  4. package/build/cjs/integrations/mcp-server/errorCapture.js +2 -2
  5. package/build/cjs/integrations/mcp-server/errorCapture.js.map +1 -1
  6. package/build/cjs/integrations/supabase.js +4 -4
  7. package/build/cjs/integrations/supabase.js.map +1 -1
  8. package/build/cjs/tracing/anthropic-ai/index.js +3 -3
  9. package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
  10. package/build/cjs/tracing/anthropic-ai/streaming.js +3 -3
  11. package/build/cjs/tracing/anthropic-ai/streaming.js.map +1 -1
  12. package/build/cjs/tracing/anthropic-ai/utils.js +2 -2
  13. package/build/cjs/tracing/anthropic-ai/utils.js.map +1 -1
  14. package/build/cjs/tracing/google-genai/index.js +3 -3
  15. package/build/cjs/tracing/google-genai/index.js.map +1 -1
  16. package/build/cjs/tracing/google-genai/streaming.js +2 -2
  17. package/build/cjs/tracing/google-genai/streaming.js.map +1 -1
  18. package/build/cjs/tracing/langchain/index.js +4 -4
  19. package/build/cjs/tracing/langchain/index.js.map +1 -1
  20. package/build/cjs/tracing/langgraph/index.js +3 -3
  21. package/build/cjs/tracing/langgraph/index.js.map +1 -1
  22. package/build/cjs/tracing/openai/index.js +3 -3
  23. package/build/cjs/tracing/openai/index.js.map +1 -1
  24. package/build/cjs/tracing/openai/streaming.js +2 -2
  25. package/build/cjs/tracing/openai/streaming.js.map +1 -1
  26. package/build/cjs/trpc.js +3 -3
  27. package/build/cjs/trpc.js.map +1 -1
  28. package/build/cjs/utils/aggregate-errors.js +13 -5
  29. package/build/cjs/utils/aggregate-errors.js.map +1 -1
  30. package/build/cjs/utils/exports.js +7 -7
  31. package/build/cjs/utils/exports.js.map +1 -1
  32. package/build/cjs/utils/flushIfServerless.js +2 -2
  33. package/build/cjs/utils/flushIfServerless.js.map +1 -1
  34. package/build/cjs/utils/traceData.js +2 -2
  35. package/build/cjs/utils/traceData.js.map +1 -1
  36. package/build/cjs/utils/version.js +1 -1
  37. package/build/esm/exports.js +2 -2
  38. package/build/esm/feedback.js +1 -1
  39. package/build/esm/integrations/moduleMetadata.js +1 -1
  40. package/build/esm/integrations/third-party-errors-filter.js +1 -1
  41. package/build/esm/logs/internal.js +1 -1
  42. package/build/esm/package.json +1 -1
  43. package/build/esm/tracing/measurement.js +1 -1
  44. package/build/esm/tracing/trace.js +3 -3
  45. package/build/esm/utils/aggregate-errors.js +13 -5
  46. package/build/esm/utils/aggregate-errors.js.map +1 -1
  47. package/build/esm/utils/exports.js +7 -7
  48. package/build/esm/utils/exports.js.map +1 -1
  49. package/build/esm/utils/version.js +1 -1
  50. package/package.json +1 -1
@@ -12,11 +12,11 @@ const measurement = require('./tracing/measurement.js');
12
12
  const sampling = require('./tracing/sampling.js');
13
13
  const logSpans = require('./tracing/logSpans.js');
14
14
  const semanticAttributes = require('./semanticAttributes.js');
15
- const envelope = require('./envelope.js');
16
- const exports$1 = require('./exports.js');
15
+ const envelope$1 = require('./envelope.js');
16
+ const _exports = require('./exports.js');
17
17
  const currentScopes = require('./currentScopes.js');
18
18
  const defaultScopes = require('./defaultScopes.js');
19
- const index = require('./asyncContext/index.js');
19
+ const index$6 = require('./asyncContext/index.js');
20
20
  const carrier = require('./carrier.js');
21
21
  const session = require('./session.js');
22
22
  const scope = require('./scope.js');
@@ -46,7 +46,7 @@ const traceData = require('./utils/traceData.js');
46
46
  const meta = require('./utils/meta.js');
47
47
  const debounce = require('./utils/debounce.js');
48
48
  const request = require('./utils/request.js');
49
- const constants = require('./constants.js');
49
+ const constants$1 = require('./constants.js');
50
50
  const breadcrumbs = require('./breadcrumbs.js');
51
51
  const functiontostring = require('./integrations/functiontostring.js');
52
52
  const eventFilters = require('./integrations/eventFilters.js');
@@ -60,14 +60,14 @@ const rewriteframes = require('./integrations/rewriteframes.js');
60
60
  const supabase = require('./integrations/supabase.js');
61
61
  const zoderrors = require('./integrations/zoderrors.js');
62
62
  const thirdPartyErrorsFilter = require('./integrations/third-party-errors-filter.js');
63
- const console = require('./integrations/console.js');
63
+ const console$1 = require('./integrations/console.js');
64
64
  const featureFlagsIntegration = require('./integrations/featureFlags/featureFlagsIntegration.js');
65
65
  const growthbook = require('./integrations/featureFlags/growthbook.js');
66
66
  const conversationId = require('./integrations/conversationId.js');
67
67
  const profiling = require('./profiling.js');
68
- const fetch = require('./fetch.js');
68
+ const fetch$1 = require('./fetch.js');
69
69
  const trpc = require('./trpc.js');
70
- const index$1 = require('./integrations/mcp-server/index.js');
70
+ const index$7 = require('./integrations/mcp-server/index.js');
71
71
  const feedback = require('./feedback.js');
72
72
  const internal = require('./logs/internal.js');
73
73
  const publicApi = require('./logs/public-api.js');
@@ -75,18 +75,18 @@ const consoleIntegration = require('./logs/console-integration.js');
75
75
  const internal$1 = require('./metrics/internal.js');
76
76
  const publicApi$1 = require('./metrics/public-api.js');
77
77
  const consola = require('./integrations/consola.js');
78
- const index$2 = require('./tracing/vercel-ai/index.js');
78
+ const index = require('./tracing/vercel-ai/index.js');
79
79
  const utils = require('./tracing/vercel-ai/utils.js');
80
- const index$3 = require('./tracing/openai/index.js');
81
- const constants$1 = require('./tracing/openai/constants.js');
82
- const index$4 = require('./tracing/anthropic-ai/index.js');
83
- const constants$2 = require('./tracing/anthropic-ai/constants.js');
84
- const index$5 = require('./tracing/google-genai/index.js');
85
- const constants$3 = require('./tracing/google-genai/constants.js');
86
- const index$6 = require('./tracing/langchain/index.js');
87
- const constants$4 = require('./tracing/langchain/constants.js');
88
- const index$7 = require('./tracing/langgraph/index.js');
89
- const constants$5 = require('./tracing/langgraph/constants.js');
80
+ const index$5 = require('./tracing/openai/index.js');
81
+ const constants$5 = require('./tracing/openai/constants.js');
82
+ const index$2 = require('./tracing/anthropic-ai/index.js');
83
+ const constants = require('./tracing/anthropic-ai/constants.js');
84
+ const index$3 = require('./tracing/google-genai/index.js');
85
+ const constants$2 = require('./tracing/google-genai/constants.js');
86
+ const index$1 = require('./tracing/langchain/index.js');
87
+ const constants$3 = require('./tracing/langchain/constants.js');
88
+ const index$4 = require('./tracing/langgraph/index.js');
89
+ const constants$4 = require('./tracing/langgraph/constants.js');
90
90
  const featureFlags = require('./utils/featureFlags.js');
91
91
  const aggregateErrors = require('./utils/aggregate-errors.js');
92
92
  const breadcrumbLogLevel = require('./utils/breadcrumb-log-level.js');
@@ -94,8 +94,8 @@ const browser = require('./utils/browser.js');
94
94
  const dsn = require('./utils/dsn.js');
95
95
  const error = require('./utils/error.js');
96
96
  const worldwide = require('./utils/worldwide.js');
97
- const console$1 = require('./instrument/console.js');
98
- const fetch$1 = require('./instrument/fetch.js');
97
+ const console = require('./instrument/console.js');
98
+ const fetch = require('./instrument/fetch.js');
99
99
  const globalError = require('./instrument/globalError.js');
100
100
  const globalUnhandledRejection = require('./instrument/globalUnhandledRejection.js');
101
101
  const handlers = require('./instrument/handlers.js');
@@ -109,7 +109,7 @@ const object = require('./utils/object.js');
109
109
  const path = require('./utils/path.js');
110
110
  const promisebuffer = require('./utils/promisebuffer.js');
111
111
  const severity = require('./utils/severity.js');
112
- const exports$2 = require('./utils/exports.js');
112
+ const _exports$1 = require('./utils/exports.js');
113
113
  const stacktrace = require('./utils/stacktrace.js');
114
114
  const nodeStackTrace = require('./utils/node-stack-trace.js');
115
115
  const string = require('./utils/string.js');
@@ -118,7 +118,7 @@ const syncpromise = require('./utils/syncpromise.js');
118
118
  const time = require('./utils/time.js');
119
119
  const tracing = require('./utils/tracing.js');
120
120
  const env = require('./utils/env.js');
121
- const envelope$1 = require('./utils/envelope.js');
121
+ const envelope = require('./utils/envelope.js');
122
122
  const clientreport = require('./utils/clientreport.js');
123
123
  const ratelimit = require('./utils/ratelimit.js');
124
124
  const baggage = require('./utils/baggage.js');
@@ -183,30 +183,30 @@ exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = semanticAttributes.SEMANTIC_ATTR
183
183
  exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE;
184
184
  exports.SEMANTIC_ATTRIBUTE_URL_FULL = semanticAttributes.SEMANTIC_ATTRIBUTE_URL_FULL;
185
185
  exports.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = semanticAttributes.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE;
186
- exports.createEventEnvelope = envelope.createEventEnvelope;
187
- exports.createSessionEnvelope = envelope.createSessionEnvelope;
188
- exports.createSpanEnvelope = envelope.createSpanEnvelope;
189
- exports.addEventProcessor = exports$1.addEventProcessor;
190
- exports.captureCheckIn = exports$1.captureCheckIn;
191
- exports.captureEvent = exports$1.captureEvent;
192
- exports.captureException = exports$1.captureException;
193
- exports.captureMessage = exports$1.captureMessage;
194
- exports.captureSession = exports$1.captureSession;
195
- exports.close = exports$1.close;
196
- exports.endSession = exports$1.endSession;
197
- exports.flush = exports$1.flush;
198
- exports.isEnabled = exports$1.isEnabled;
199
- exports.isInitialized = exports$1.isInitialized;
200
- exports.lastEventId = exports$1.lastEventId;
201
- exports.setContext = exports$1.setContext;
202
- exports.setConversationId = exports$1.setConversationId;
203
- exports.setExtra = exports$1.setExtra;
204
- exports.setExtras = exports$1.setExtras;
205
- exports.setTag = exports$1.setTag;
206
- exports.setTags = exports$1.setTags;
207
- exports.setUser = exports$1.setUser;
208
- exports.startSession = exports$1.startSession;
209
- exports.withMonitor = exports$1.withMonitor;
186
+ exports.createEventEnvelope = envelope$1.createEventEnvelope;
187
+ exports.createSessionEnvelope = envelope$1.createSessionEnvelope;
188
+ exports.createSpanEnvelope = envelope$1.createSpanEnvelope;
189
+ exports.addEventProcessor = _exports.addEventProcessor;
190
+ exports.captureCheckIn = _exports.captureCheckIn;
191
+ exports.captureEvent = _exports.captureEvent;
192
+ exports.captureException = _exports.captureException;
193
+ exports.captureMessage = _exports.captureMessage;
194
+ exports.captureSession = _exports.captureSession;
195
+ exports.close = _exports.close;
196
+ exports.endSession = _exports.endSession;
197
+ exports.flush = _exports.flush;
198
+ exports.isEnabled = _exports.isEnabled;
199
+ exports.isInitialized = _exports.isInitialized;
200
+ exports.lastEventId = _exports.lastEventId;
201
+ exports.setContext = _exports.setContext;
202
+ exports.setConversationId = _exports.setConversationId;
203
+ exports.setExtra = _exports.setExtra;
204
+ exports.setExtras = _exports.setExtras;
205
+ exports.setTag = _exports.setTag;
206
+ exports.setTags = _exports.setTags;
207
+ exports.setUser = _exports.setUser;
208
+ exports.startSession = _exports.startSession;
209
+ exports.withMonitor = _exports.withMonitor;
210
210
  exports.getClient = currentScopes.getClient;
211
211
  exports.getCurrentScope = currentScopes.getCurrentScope;
212
212
  exports.getGlobalScope = currentScopes.getGlobalScope;
@@ -216,7 +216,7 @@ exports.withIsolationScope = currentScopes.withIsolationScope;
216
216
  exports.withScope = currentScopes.withScope;
217
217
  exports.getDefaultCurrentScope = defaultScopes.getDefaultCurrentScope;
218
218
  exports.getDefaultIsolationScope = defaultScopes.getDefaultIsolationScope;
219
- exports.setAsyncContextStrategy = index.setAsyncContextStrategy;
219
+ exports.setAsyncContextStrategy = index$6.setAsyncContextStrategy;
220
220
  exports.getGlobalSingleton = carrier.getGlobalSingleton;
221
221
  exports.getMainCarrier = carrier.getMainCarrier;
222
222
  exports.closeSession = session.closeSession;
@@ -277,8 +277,8 @@ exports.httpHeadersToSpanAttributes = request.httpHeadersToSpanAttributes;
277
277
  exports.httpRequestToRequestData = request.httpRequestToRequestData;
278
278
  exports.winterCGHeadersToDict = request.winterCGHeadersToDict;
279
279
  exports.winterCGRequestToRequestData = request.winterCGRequestToRequestData;
280
- exports.DEFAULT_ENVIRONMENT = constants.DEFAULT_ENVIRONMENT;
281
- exports.DEV_ENVIRONMENT = constants.DEV_ENVIRONMENT;
280
+ exports.DEFAULT_ENVIRONMENT = constants$1.DEFAULT_ENVIRONMENT;
281
+ exports.DEV_ENVIRONMENT = constants$1.DEV_ENVIRONMENT;
282
282
  exports.addBreadcrumb = breadcrumbs.addBreadcrumb;
283
283
  exports.functionToStringIntegration = functiontostring.functionToStringIntegration;
284
284
  exports.eventFiltersIntegration = eventFilters.eventFiltersIntegration;
@@ -294,14 +294,14 @@ exports.instrumentSupabaseClient = supabase.instrumentSupabaseClient;
294
294
  exports.supabaseIntegration = supabase.supabaseIntegration;
295
295
  exports.zodErrorsIntegration = zoderrors.zodErrorsIntegration;
296
296
  exports.thirdPartyErrorFilterIntegration = thirdPartyErrorsFilter.thirdPartyErrorFilterIntegration;
297
- exports.consoleIntegration = console.consoleIntegration;
297
+ exports.consoleIntegration = console$1.consoleIntegration;
298
298
  exports.featureFlagsIntegration = featureFlagsIntegration.featureFlagsIntegration;
299
299
  exports.growthbookIntegration = growthbook.growthbookIntegration;
300
300
  exports.conversationIdIntegration = conversationId.conversationIdIntegration;
301
301
  exports.profiler = profiling.profiler;
302
- exports.instrumentFetchRequest = fetch.instrumentFetchRequest;
302
+ exports.instrumentFetchRequest = fetch$1.instrumentFetchRequest;
303
303
  exports.trpcMiddleware = trpc.trpcMiddleware;
304
- exports.wrapMcpServerWithSentry = index$1.wrapMcpServerWithSentry;
304
+ exports.wrapMcpServerWithSentry = index$7.wrapMcpServerWithSentry;
305
305
  exports.captureFeedback = feedback.captureFeedback;
306
306
  exports._INTERNAL_captureLog = internal._INTERNAL_captureLog;
307
307
  exports._INTERNAL_captureSerializedLog = internal._INTERNAL_captureSerializedLog;
@@ -313,20 +313,20 @@ exports._INTERNAL_captureSerializedMetric = internal$1._INTERNAL_captureSerializ
313
313
  exports._INTERNAL_flushMetricsBuffer = internal$1._INTERNAL_flushMetricsBuffer;
314
314
  exports.metrics = publicApi$1;
315
315
  exports.createConsolaReporter = consola.createConsolaReporter;
316
- exports.addVercelAiProcessors = index$2.addVercelAiProcessors;
316
+ exports.addVercelAiProcessors = index.addVercelAiProcessors;
317
317
  exports._INTERNAL_cleanupToolCallSpan = utils._INTERNAL_cleanupToolCallSpan;
318
318
  exports._INTERNAL_getSpanForToolCallId = utils._INTERNAL_getSpanForToolCallId;
319
- exports.instrumentOpenAiClient = index$3.instrumentOpenAiClient;
320
- exports.OPENAI_INTEGRATION_NAME = constants$1.OPENAI_INTEGRATION_NAME;
321
- exports.instrumentAnthropicAiClient = index$4.instrumentAnthropicAiClient;
322
- exports.ANTHROPIC_AI_INTEGRATION_NAME = constants$2.ANTHROPIC_AI_INTEGRATION_NAME;
323
- exports.instrumentGoogleGenAIClient = index$5.instrumentGoogleGenAIClient;
324
- exports.GOOGLE_GENAI_INTEGRATION_NAME = constants$3.GOOGLE_GENAI_INTEGRATION_NAME;
325
- exports.createLangChainCallbackHandler = index$6.createLangChainCallbackHandler;
326
- exports.LANGCHAIN_INTEGRATION_NAME = constants$4.LANGCHAIN_INTEGRATION_NAME;
327
- exports.instrumentLangGraph = index$7.instrumentLangGraph;
328
- exports.instrumentStateGraphCompile = index$7.instrumentStateGraphCompile;
329
- exports.LANGGRAPH_INTEGRATION_NAME = constants$5.LANGGRAPH_INTEGRATION_NAME;
319
+ exports.instrumentOpenAiClient = index$5.instrumentOpenAiClient;
320
+ exports.OPENAI_INTEGRATION_NAME = constants$5.OPENAI_INTEGRATION_NAME;
321
+ exports.instrumentAnthropicAiClient = index$2.instrumentAnthropicAiClient;
322
+ exports.ANTHROPIC_AI_INTEGRATION_NAME = constants.ANTHROPIC_AI_INTEGRATION_NAME;
323
+ exports.instrumentGoogleGenAIClient = index$3.instrumentGoogleGenAIClient;
324
+ exports.GOOGLE_GENAI_INTEGRATION_NAME = constants$2.GOOGLE_GENAI_INTEGRATION_NAME;
325
+ exports.createLangChainCallbackHandler = index$1.createLangChainCallbackHandler;
326
+ exports.LANGCHAIN_INTEGRATION_NAME = constants$3.LANGCHAIN_INTEGRATION_NAME;
327
+ exports.instrumentLangGraph = index$4.instrumentLangGraph;
328
+ exports.instrumentStateGraphCompile = index$4.instrumentStateGraphCompile;
329
+ exports.LANGGRAPH_INTEGRATION_NAME = constants$4.LANGGRAPH_INTEGRATION_NAME;
330
330
  exports._INTERNAL_FLAG_BUFFER_SIZE = featureFlags._INTERNAL_FLAG_BUFFER_SIZE;
331
331
  exports._INTERNAL_MAX_FLAGS_PER_SPAN = featureFlags._INTERNAL_MAX_FLAGS_PER_SPAN;
332
332
  exports._INTERNAL_addFeatureFlagToActiveSpan = featureFlags._INTERNAL_addFeatureFlagToActiveSpan;
@@ -342,9 +342,9 @@ exports.dsnToString = dsn.dsnToString;
342
342
  exports.makeDsn = dsn.makeDsn;
343
343
  exports.SentryError = error.SentryError;
344
344
  exports.GLOBAL_OBJ = worldwide.GLOBAL_OBJ;
345
- exports.addConsoleInstrumentationHandler = console$1.addConsoleInstrumentationHandler;
346
- exports.addFetchEndInstrumentationHandler = fetch$1.addFetchEndInstrumentationHandler;
347
- exports.addFetchInstrumentationHandler = fetch$1.addFetchInstrumentationHandler;
345
+ exports.addConsoleInstrumentationHandler = console.addConsoleInstrumentationHandler;
346
+ exports.addFetchEndInstrumentationHandler = fetch.addFetchEndInstrumentationHandler;
347
+ exports.addFetchInstrumentationHandler = fetch.addFetchInstrumentationHandler;
348
348
  exports.addGlobalErrorInstrumentationHandler = globalError.addGlobalErrorInstrumentationHandler;
349
349
  exports.addGlobalUnhandledRejectionInstrumentationHandler = globalUnhandledRejection.addGlobalUnhandledRejectionInstrumentationHandler;
350
350
  exports.addHandler = handlers.addHandler;
@@ -401,7 +401,7 @@ exports.resolve = path.resolve;
401
401
  exports.SENTRY_BUFFER_FULL_ERROR = promisebuffer.SENTRY_BUFFER_FULL_ERROR;
402
402
  exports.makePromiseBuffer = promisebuffer.makePromiseBuffer;
403
403
  exports.severityLevelFromString = severity.severityLevelFromString;
404
- exports.replaceExports = exports$2.replaceExports;
404
+ exports.replaceExports = _exports$1.replaceExports;
405
405
  exports.UNKNOWN_FUNCTION = stacktrace.UNKNOWN_FUNCTION;
406
406
  exports.createStackParser = stacktrace.createStackParser;
407
407
  exports.getFramesFromEvent = stacktrace.getFramesFromEvent;
@@ -439,17 +439,17 @@ exports.propagationContextFromHeaders = tracing.propagationContextFromHeaders;
439
439
  exports.shouldContinueTrace = tracing.shouldContinueTrace;
440
440
  exports.getSDKSource = env.getSDKSource;
441
441
  exports.isBrowserBundle = env.isBrowserBundle;
442
- exports.addItemToEnvelope = envelope$1.addItemToEnvelope;
443
- exports.createAttachmentEnvelopeItem = envelope$1.createAttachmentEnvelopeItem;
444
- exports.createEnvelope = envelope$1.createEnvelope;
445
- exports.createEventEnvelopeHeaders = envelope$1.createEventEnvelopeHeaders;
446
- exports.createSpanEnvelopeItem = envelope$1.createSpanEnvelopeItem;
447
- exports.envelopeContainsItemType = envelope$1.envelopeContainsItemType;
448
- exports.envelopeItemTypeToDataCategory = envelope$1.envelopeItemTypeToDataCategory;
449
- exports.forEachEnvelopeItem = envelope$1.forEachEnvelopeItem;
450
- exports.getSdkMetadataForEnvelopeHeader = envelope$1.getSdkMetadataForEnvelopeHeader;
451
- exports.parseEnvelope = envelope$1.parseEnvelope;
452
- exports.serializeEnvelope = envelope$1.serializeEnvelope;
442
+ exports.addItemToEnvelope = envelope.addItemToEnvelope;
443
+ exports.createAttachmentEnvelopeItem = envelope.createAttachmentEnvelopeItem;
444
+ exports.createEnvelope = envelope.createEnvelope;
445
+ exports.createEventEnvelopeHeaders = envelope.createEventEnvelopeHeaders;
446
+ exports.createSpanEnvelopeItem = envelope.createSpanEnvelopeItem;
447
+ exports.envelopeContainsItemType = envelope.envelopeContainsItemType;
448
+ exports.envelopeItemTypeToDataCategory = envelope.envelopeItemTypeToDataCategory;
449
+ exports.forEachEnvelopeItem = envelope.forEachEnvelopeItem;
450
+ exports.getSdkMetadataForEnvelopeHeader = envelope.getSdkMetadataForEnvelopeHeader;
451
+ exports.parseEnvelope = envelope.parseEnvelope;
452
+ exports.serializeEnvelope = envelope.serializeEnvelope;
453
453
  exports.createClientReportEnvelope = clientreport.createClientReportEnvelope;
454
454
  exports.DEFAULT_RETRY_AFTER = ratelimit.DEFAULT_RETRY_AFTER;
455
455
  exports.disabledUntil = ratelimit.disabledUntil;
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const currentScopes = require('../currentScopes.js');
4
- const exports$1 = require('../exports.js');
4
+ const _exports = require('../exports.js');
5
5
  const console = require('../instrument/console.js');
6
6
  const integration = require('../integration.js');
7
7
  const debugLogger = require('../utils/debug-logger.js');
@@ -81,7 +81,7 @@ function consoleHandler(args, level, handled) {
81
81
 
82
82
  const error = args.find(arg => arg instanceof Error);
83
83
  if (error) {
84
- exports$1.captureException(error, captureContext);
84
+ _exports.captureException(error, captureContext);
85
85
  return;
86
86
  }
87
87
 
@@ -1 +1 @@
1
- {"version":3,"file":"captureconsole.js","sources":["../../../src/integrations/captureconsole.ts"],"sourcesContent":["import { getClient, withScope } from '../currentScopes';\nimport { captureException } from '../exports';\nimport { addConsoleInstrumentationHandler } from '../instrument/console';\nimport { defineIntegration } from '../integration';\nimport type { CaptureContext } from '../scope';\nimport type { IntegrationFn } from '../types-hoist/integration';\nimport { CONSOLE_LEVELS } from '../utils/debug-logger';\nimport { addExceptionMechanism } from '../utils/misc';\nimport { severityLevelFromString } from '../utils/severity';\nimport { safeJoin } from '../utils/string';\nimport { GLOBAL_OBJ } from '../utils/worldwide';\n\ninterface CaptureConsoleOptions {\n levels?: string[];\n\n /**\n * By default, Sentry will mark captured console messages as handled.\n * Set this to `false` if you want to mark them as unhandled instead.\n *\n * @default true\n */\n handled?: boolean;\n}\n\nconst INTEGRATION_NAME = 'CaptureConsole';\n\nconst _captureConsoleIntegration = ((options: CaptureConsoleOptions = {}) => {\n const levels = options.levels || CONSOLE_LEVELS;\n const handled = options.handled ?? true;\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n addConsoleInstrumentationHandler(({ args, level }) => {\n if (getClient() !== client || !levels.includes(level)) {\n return;\n }\n\n consoleHandler(args, level, handled);\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Send Console API calls as Sentry Events.\n */\nexport const captureConsoleIntegration = defineIntegration(_captureConsoleIntegration);\n\nfunction consoleHandler(args: unknown[], level: string, handled: boolean): void {\n const severityLevel = severityLevelFromString(level);\n\n /*\n We create this error here already to attach a stack trace to captured messages,\n if users set `attachStackTrace` to `true` in Sentry.init.\n We do this here already because we want to minimize the number of Sentry SDK stack frames\n within the error. Technically, Client.captureMessage will also do it but this happens several\n stack frames deeper.\n */\n const syntheticException = new Error();\n\n const captureContext: CaptureContext = {\n level: severityLevelFromString(level),\n extra: {\n arguments: args,\n },\n };\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n event.logger = 'console';\n\n addExceptionMechanism(event, {\n handled,\n type: 'auto.core.capture_console',\n });\n\n return event;\n });\n\n if (level === 'assert') {\n if (!args[0]) {\n const message = `Assertion failed: ${safeJoin(args.slice(1), ' ') || 'console.assert'}`;\n scope.setExtra('arguments', args.slice(1));\n scope.captureMessage(message, severityLevel, { captureContext, syntheticException });\n }\n return;\n }\n\n const error = args.find(arg => arg instanceof Error);\n if (error) {\n captureException(error, captureContext);\n return;\n }\n\n const message = safeJoin(args, ' ');\n scope.captureMessage(message, severityLevel, { captureContext, syntheticException });\n });\n}\n"],"names":["CONSOLE_LEVELS","GLOBAL_OBJ","addConsoleInstrumentationHandler","getClient","defineIntegration","severityLevelFromString","withScope","addExceptionMechanism","safeJoin","captureException"],"mappings":";;;;;;;;;;;;AAwBA,MAAM,gBAAA,GAAmB,gBAAgB;;AAEzC,MAAM,0BAAA,IAA8B,CAAC,OAAO,GAA0B,EAAE,KAAK;AAC7E,EAAE,MAAM,MAAA,GAAS,OAAO,CAAC,MAAA,IAAUA,0BAAc;AACjD,EAAE,MAAM,OAAA,GAAU,OAAO,CAAC,OAAA,IAAW,IAAI;;AAEzC,EAAE,OAAO;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MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACpB,QAAQ,MAAM,UAAU,CAAC,kBAAkB,EAAEC,eAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,gBAAgB,CAAC,CAAA;AACA,QAAA,KAAA,CAAA,QAAA,CAAA,WAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AACA,QAAA,KAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,CAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;;AAEA,IAAA,MAAA,KAAA,GAAA,IAAA,CAAA,IAAA,CAAA,GAAA,IAAA,GAAA,YAAA,KAAA,CAAA;AACA,IAAA,IAAA,KAAA,EAAA;AACA,MAAAC,0BAAA,CAAA,KAAA,EAAA,cAAA,CAAA;AACA,MAAA;AACA,IAAA;;AAEA,IAAA,MAAA,OAAA,GAAAD,eAAA,CAAA,IAAA,EAAA,GAAA,CAAA;AACA,IAAA,KAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,CAAA;AACA,EAAA,CAAA,CAAA;AACA;;;;"}
1
+ {"version":3,"file":"captureconsole.js","sources":["../../../src/integrations/captureconsole.ts"],"sourcesContent":["import { getClient, withScope } from '../currentScopes';\nimport { captureException } from '../exports';\nimport { addConsoleInstrumentationHandler } from '../instrument/console';\nimport { defineIntegration } from '../integration';\nimport type { CaptureContext } from '../scope';\nimport type { IntegrationFn } from '../types-hoist/integration';\nimport { CONSOLE_LEVELS } from '../utils/debug-logger';\nimport { addExceptionMechanism } from '../utils/misc';\nimport { severityLevelFromString } from '../utils/severity';\nimport { safeJoin } from '../utils/string';\nimport { GLOBAL_OBJ } from '../utils/worldwide';\n\ninterface CaptureConsoleOptions {\n levels?: string[];\n\n /**\n * By default, Sentry will mark captured console messages as handled.\n * Set this to `false` if you want to mark them as unhandled instead.\n *\n * @default true\n */\n handled?: boolean;\n}\n\nconst INTEGRATION_NAME = 'CaptureConsole';\n\nconst _captureConsoleIntegration = ((options: CaptureConsoleOptions = {}) => {\n const levels = options.levels || CONSOLE_LEVELS;\n const handled = options.handled ?? true;\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n addConsoleInstrumentationHandler(({ args, level }) => {\n if (getClient() !== client || !levels.includes(level)) {\n return;\n }\n\n consoleHandler(args, level, handled);\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Send Console API calls as Sentry Events.\n */\nexport const captureConsoleIntegration = defineIntegration(_captureConsoleIntegration);\n\nfunction consoleHandler(args: unknown[], level: string, handled: boolean): void {\n const severityLevel = severityLevelFromString(level);\n\n /*\n We create this error here already to attach a stack trace to captured messages,\n if users set `attachStackTrace` to `true` in Sentry.init.\n We do this here already because we want to minimize the number of Sentry SDK stack frames\n within the error. Technically, Client.captureMessage will also do it but this happens several\n stack frames deeper.\n */\n const syntheticException = new Error();\n\n const captureContext: CaptureContext = {\n level: severityLevelFromString(level),\n extra: {\n arguments: args,\n },\n };\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n event.logger = 'console';\n\n addExceptionMechanism(event, {\n handled,\n type: 'auto.core.capture_console',\n });\n\n return event;\n });\n\n if (level === 'assert') {\n if (!args[0]) {\n const message = `Assertion failed: ${safeJoin(args.slice(1), ' ') || 'console.assert'}`;\n scope.setExtra('arguments', args.slice(1));\n scope.captureMessage(message, severityLevel, { captureContext, syntheticException });\n }\n return;\n }\n\n const error = args.find(arg => arg instanceof Error);\n if (error) {\n captureException(error, captureContext);\n return;\n }\n\n const message = safeJoin(args, ' ');\n scope.captureMessage(message, severityLevel, { captureContext, syntheticException });\n });\n}\n"],"names":["CONSOLE_LEVELS","GLOBAL_OBJ","addConsoleInstrumentationHandler","getClient","defineIntegration","severityLevelFromString","withScope","addExceptionMechanism","saf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BAAiB,CAAC,SAAS;AACrC,MAAM,KAAK,CAAC,MAAA,GAAS,SAAS;;AAE9B,MAAMC,0BAAqB,CAAC,KAAK,EAAE;AACnC,QAAQ,OAAO;AACf,QAAQ,IAAI,EAAE,2BAA2B;AACzC,OAAO,CAAC;;AAER,MAAM,OAAO,KAAK;AAClB,IAAI,CAAC,CAAC;;AAEN,IAAI,IAAI,KAAA,KAAU,QAAQ,EAAE;AAC5B,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACpB,QAAQ,MAAM,UAAU,CAAC,kBAAkB,EAAEC,eAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,gBAAgB,CAAC,CAAA;AACA,QAAA,KAAA,CAAA,QAAA,CAAA,WAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AACA,QAAA,KAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,CAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;;AAEA,IAAA,MAAA,KAAA,GAAA,IAAA,CAAA,IAAA,CAAA,GAAA,IAAA,GAAA,YAAA,KAAA,CAAA;AACA,IAAA,IAAA,KAAA,EAAA;AACA,MAAAC,yBAAA,CAAA,KAAA,EAAA,cAAA,CAAA;AACA,MAAA;AACA,IAAA;;AAEA,IAAA,MAAA,OAAA,GAAAD,eAAA,CAAA,IAAA,EAAA,GAAA,CAAA;AACA,IAAA,KAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,CAAA;AACA,EAAA,CAAA,CAAA;AACA;;;;"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const currentScopes = require('../../currentScopes.js');
4
- const exports$1 = require('../../exports.js');
4
+ const _exports = require('../../exports.js');
5
5
  const spanUtils = require('../../utils/spanUtils.js');
6
6
  const spanstatus = require('../../tracing/spanstatus.js');
7
7
 
@@ -36,7 +36,7 @@ function captureError(error, errorType, extraData) {
36
36
  });
37
37
  }
38
38
 
39
- exports$1.captureException(error, {
39
+ _exports.captureException(error, {
40
40
  mechanism: {
41
41
  type: 'auto.ai.mcp_server',
42
42
  handled: false,
@@ -1 +1 @@
1
- {"version":3,"file":"errorCapture.js","sources":["../../../../src/integrations/mcp-server/errorCapture.ts"],"sourcesContent":["/**\n * Safe error capture utilities for MCP server instrumentation\n *\n * Ensures error reporting never interferes with MCP server operation.\n * All capture operations are wrapped in try-catch to prevent side effects.\n */\n\nimport { getClient } from '../../currentScopes';\nimport { captureException } from '../../exports';\nimport { SPAN_STATUS_ERROR } from '../../tracing';\nimport { getActiveSpan } from '../../utils/spanUtils';\nimport type { McpErrorType } from './types';\n\n/**\n * Captures an error without affecting MCP server operation.\n *\n * The active span already contains all MCP context (method, tool, arguments, etc.)\n * @param error - Error to capture\n * @param errorType - Classification of error type for filtering\n * @param extraData - Additional context data to include\n */\nexport function captureError(error: Error, errorType?: McpErrorType, extraData?: Record<string, unknown>): void {\n try {\n const client = getClient();\n if (!client) {\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (activeSpan?.isRecording()) {\n activeSpan.setStatus({\n code: SPAN_STATUS_ERROR,\n message: 'internal_error',\n });\n }\n\n captureException(error, {\n mechanism: {\n type: 'auto.ai.mcp_server',\n handled: false,\n data: {\n error_type: errorType || 'handler_execution',\n ...extraData,\n },\n },\n });\n } catch {\n // noop\n }\n}\n"],"names":["getClient","getActiveSpan","SPAN_STATUS_ERROR","captureException"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAS,SAAS,EAAiB,SAAS,EAAkC;AAChH,EAAE,IAAI;AACN,IAAI,MAAM,MAAA,GAASA,uBAAS,EAAE;AAC9B,IAAI,IAAI,CAAC,MAAM,EAAE;AACjB,MAAM;AACN,IAAI;;AAEJ,IAAI,MAAM,UAAA,GAAaC,uBAAa,EAAE;AACtC,IAAI,IAAI,UAAU,EAAE,WAAW,EAAE,EAAE;AACnC,MAAM,UAAU,CAAC,SAAS,CAAC;AAC3B,QAAQ,IAAI,EAAEC,4BAAiB;AAC/B,QAAQ,OAAO,EAAE,gBAAgB;AACjC,OAAO,CAAC;AACR,IAAI;;AAEJ,IAAIC,0BAAgB,CAAC,KAAK,EAAE;AAC5B,MAAM,SAAS,EAAE;AACjB,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,IAAI,EAAE;AACd,UAAU,UAAU,EAAE,SAAA,IAAa,mBAAmB;AACtD,UAAU,GAAG,SAAS;AACtB,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,EAAE,EAAE,MAAM;AACV;AACA,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"errorCapture.js","sources":["../../../../src/integrations/mcp-server/errorCapture.ts"],"sourcesContent":["/**\n * Safe error capture utilities for MCP server instrumentation\n *\n * Ensures error reporting never interferes with MCP server operation.\n * All capture operations are wrapped in try-catch to prevent side effects.\n */\n\nimport { getClient } from '../../currentScopes';\nimport { captureException } from '../../exports';\nimport { SPAN_STATUS_ERROR } from '../../tracing';\nimport { getActiveSpan } from '../../utils/spanUtils';\nimport type { McpErrorType } from './types';\n\n/**\n * Captures an error without affecting MCP server operation.\n *\n * The active span already contains all MCP context (method, tool, arguments, etc.)\n * @param error - Error to capture\n * @param errorType - Classification of error type for filtering\n * @param extraData - Additional context data to include\n */\nexport function captureError(error: Error, errorType?: McpErrorType, extraData?: Record<string, unknown>): void {\n try {\n const client = getClient();\n if (!client) {\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (activeSpan?.isRecording()) {\n activeSpan.setStatus({\n code: SPAN_STATUS_ERROR,\n message: 'internal_error',\n });\n }\n\n captureException(error, {\n mechanism: {\n type: 'auto.ai.mcp_server',\n handled: false,\n data: {\n error_type: errorType || 'handler_execution',\n ...extraData,\n },\n },\n });\n } catch {\n // noop\n }\n}\n"],"names":["getClient","getActiveSpan","SPAN_STATUS_ERROR","captureException"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAS,SAAS,EAAiB,SAAS,EAAkC;AAChH,EAAE,IAAI;AACN,IAAI,MAAM,MAAA,GAASA,uBAAS,EAAE;AAC9B,IAAI,IAAI,CAAC,MAAM,EAAE;AACjB,MAAM;AACN,IAAI;;AAEJ,IAAI,MAAM,UAAA,GAAaC,uBAAa,EAAE;AACtC,IAAI,IAAI,UAAU,EAAE,WAAW,EAAE,EAAE;AACnC,MAAM,UAAU,CAAC,SAAS,CAAC;AAC3B,QAAQ,IAAI,EAAEC,4BAAiB;AAC/B,QAAQ,OAAO,EAAE,gBAAgB;AACjC,OAAO,CAAC;AACR,IAAI;;AAEJ,IAAIC,yBAAgB,CAAC,KAAK,EAAE;AAC5B,MAAM,SAAS,EAAE;AACjB,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,IAAI,EAAE;AACd,UAAU,UAAU,EAAE,SAAA,IAAa,mBAAmB;AACtD,UAAU,GAAG,SAAS;AACtB,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,EAAE,EAAE,MAAM;AACV;AACA,EAAE;AACF;;;;"}
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const breadcrumbs = require('../breadcrumbs.js');
4
4
  const debugBuild = require('../debug-build.js');
5
- const exports$1 = require('../exports.js');
5
+ const _exports = require('../exports.js');
6
6
  const integration = require('../integration.js');
7
7
  const semanticAttributes = require('../semanticAttributes.js');
8
8
  const debugLogger = require('../utils/debug-logger.js');
@@ -172,7 +172,7 @@ function instrumentAuthOperation(operation, isAdmin = false) {
172
172
  if (res && typeof res === 'object' && 'error' in res && res.error) {
173
173
  span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR });
174
174
 
175
- exports$1.captureException(res.error, {
175
+ _exports.captureException(res.error, {
176
176
  mechanism: {
177
177
  handled: false,
178
178
  type: 'auto.db.supabase.auth',
@@ -189,7 +189,7 @@ function instrumentAuthOperation(operation, isAdmin = false) {
189
189
  span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR });
190
190
  span.end();
191
191
 
192
- exports$1.captureException(err, {
192
+ _exports.captureException(err, {
193
193
  mechanism: {
194
194
  handled: false,
195
195
  type: 'auto.db.supabase.auth',
@@ -357,7 +357,7 @@ function instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder) {
357
357
  supabaseContext.body = body;
358
358
  }
359
359
 
360
- exports$1.captureException(err, scope => {
360
+ _exports.captureException(err, scope => {
361
361
  scope.addEventProcessor(e => {
362
362
  misc.addExceptionMechanism(e, {
363
363
  handled: false,
@@ -1 +1 @@
1
- {"version":3,"file":"supabase.js","sources":["../../../src/integrations/supabase.ts"],"sourcesContent":["// Based on Kamil Ogórek's work on:\n// https://github.com/supabase-community/sentry-integration-js\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport { addBreadcrumb } from '../breadcrumbs';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { captureException } from '../exports';\nimport { defineIntegration } from '../integration';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../semanticAttributes';\nimport { setHttpStatus, SPAN_STATUS_ERROR, SPAN_STATUS_OK, startSpan } from '../tracing';\nimport type { IntegrationFn } from '../types-hoist/integration';\nimport { debug } from '../utils/debug-logger';\nimport { isPlainObject } from '../utils/is';\nimport { addExceptionMechanism } from '../utils/misc';\n\nconst AUTH_OPERATIONS_TO_INSTRUMENT = [\n 'reauthenticate',\n 'signInAnonymously',\n 'signInWithOAuth',\n 'signInWithIdToken',\n 'signInWithOtp',\n 'signInWithPassword',\n 'signInWithSSO',\n 'signOut',\n 'signUp',\n 'verifyOtp',\n];\n\nconst AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT = [\n 'createUser',\n 'deleteUser',\n 'listUsers',\n 'getUserById',\n 'updateUserById',\n 'inviteUserByEmail',\n];\n\nexport const FILTER_MAPPINGS = {\n eq: 'eq',\n neq: 'neq',\n gt: 'gt',\n gte: 'gte',\n lt: 'lt',\n lte: 'lte',\n like: 'like',\n 'like(all)': 'likeAllOf',\n 'like(any)': 'likeAnyOf',\n ilike: 'ilike',\n 'ilike(all)': 'ilikeAllOf',\n 'ilike(any)': 'ilikeAnyOf',\n is: 'is',\n in: 'in',\n cs: 'contains',\n cd: 'containedBy',\n sr: 'rangeGt',\n nxl: 'rangeGte',\n sl: 'rangeLt',\n nxr: 'rangeLte',\n adj: 'rangeAdjacent',\n ov: 'overlaps',\n fts: '',\n plfts: 'plain',\n phfts: 'phrase',\n wfts: 'websearch',\n not: 'not',\n};\n\nexport const DB_OPERATIONS_TO_INSTRUMENT = ['select', 'insert', 'upsert', 'update', 'delete'];\n\ntype AuthOperationFn = (...args: unknown[]) => Promise<unknown>;\ntype AuthOperationName = (typeof AUTH_OPERATIONS_TO_INSTRUMENT)[number];\ntype AuthAdminOperationName = (typeof AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT)[number];\ntype PostgRESTQueryOperationFn = (...args: unknown[]) => PostgRESTFilterBuilder;\n\nexport interface SupabaseClientInstance {\n auth: {\n admin: Record<AuthAdminOperationName, AuthOperationFn>;\n } & Record<AuthOperationName, AuthOperationFn>;\n}\n\nexport interface PostgRESTQueryBuilder {\n [key: string]: PostgRESTQueryOperationFn;\n}\n\nexport interface PostgRESTFilterBuilder {\n method: string;\n headers: Record<string, string>;\n url: URL;\n schema: string;\n body: any;\n}\n\nexport interface SupabaseResponse {\n status?: number;\n error?: {\n message: string;\n code?: string;\n details?: unknown;\n };\n}\n\nexport interface SupabaseError extends Error {\n code?: string;\n details?: unknown;\n}\n\nexport interface SupabaseBreadcrumb {\n type: string;\n category: string;\n message: string;\n data?: {\n query?: string[];\n body?: Record<string, unknown>;\n };\n}\n\nexport interface SupabaseClientConstructor {\n prototype: {\n from: (table: string) => PostgRESTQueryBuilder;\n };\n}\n\nexport interface PostgRESTProtoThenable {\n then: <T>(\n onfulfilled?: ((value: T) => T | PromiseLike<T>) | null,\n onrejected?: ((reason: any) => T | PromiseLike<T>) | null,\n ) => Promise<T>;\n}\n\ntype SentryInstrumented<T> = T & {\n __SENTRY_INSTRUMENTED__?: boolean;\n};\n\nfunction markAsInstrumented<T>(fn: T): void {\n try {\n (fn as SentryInstrumented<T>).__SENTRY_INSTRUMENTED__ = true;\n } catch {\n // ignore errors here\n }\n}\n\nfunction isInstrumented<T>(fn: T): boolean | undefined {\n try {\n return (fn as SentryInstrumented<T>).__SENTRY_INSTRUMENTED__;\n } catch {\n return false;\n }\n}\n\n/**\n * Extracts the database operation type from the HTTP method and headers\n * @param method - The HTTP method of the request\n * @param headers - The request headers\n * @returns The database operation type ('select', 'insert', 'upsert', 'update', or 'delete')\n */\nexport function extractOperation(method: string, headers: Record<string, string> = {}): string {\n switch (method) {\n case 'GET': {\n return 'select';\n }\n case 'POST': {\n if (headers['Prefer']?.includes('resolution=')) {\n return 'upsert';\n } else {\n return 'insert';\n }\n }\n case 'PATCH': {\n return 'update';\n }\n case 'DELETE': {\n return 'delete';\n }\n default: {\n return '<unknown-op>';\n }\n }\n}\n\n/**\n * Translates Supabase filter parameters into readable method names for tracing\n * @param key - The filter key from the URL search parameters\n * @param query - The filter value from the URL search parameters\n * @returns A string representation of the filter as a method call\n */\nexport function translateFiltersIntoMethods(key: string, query: string): string {\n if (query === '' || query === '*') {\n return 'select(*)';\n }\n\n if (key === 'select') {\n return `select(${query})`;\n }\n\n if (key === 'or' || key.endsWith('.or')) {\n return `${key}${query}`;\n }\n\n const [filter, ...value] = query.split('.');\n\n let method;\n // Handle optional `configPart` of the filter\n if (filter?.startsWith('fts')) {\n method = 'textSearch';\n } else if (filter?.startsWith('plfts')) {\n method = 'textSearch[plain]';\n } else if (filter?.startsWith('phfts')) {\n method = 'textSearch[phrase]';\n } else if (filter?.startsWith('wfts')) {\n method = 'textSearch[websearch]';\n } else {\n method = (filter && FILTER_MAPPINGS[filter as keyof typeof FILTER_MAPPINGS]) || 'filter';\n }\n\n return `${method}(${key}, ${value.join('.')})`;\n}\n\nfunction instrumentAuthOperation(operation: AuthOperationFn, isAdmin = false): AuthOperationFn {\n return new Proxy(operation, {\n apply(target, thisArg, argumentsList) {\n return startSpan(\n {\n name: `auth ${isAdmin ? '(admin) ' : ''}${operation.name}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.supabase',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n 'db.system': 'postgresql',\n 'db.operation': `auth.${isAdmin ? 'admin.' : ''}${operation.name}`,\n },\n },\n span => {\n return Reflect.apply(target, thisArg, argumentsList)\n .then((res: unknown) => {\n if (res && typeof res === 'object' && 'error' in res && res.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n\n captureException(res.error, {\n mechanism: {\n handled: false,\n type: 'auto.db.supabase.auth',\n },\n });\n } else {\n span.setStatus({ code: SPAN_STATUS_OK });\n }\n\n span.end();\n return res;\n })\n .catch((err: unknown) => {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n span.end();\n\n captureException(err, {\n mechanism: {\n handled: false,\n type: 'auto.db.supabase.auth',\n },\n });\n\n throw err;\n })\n .then(...argumentsList);\n },\n );\n },\n });\n}\n\nfunction instrumentSupabaseAuthClient(supabaseClientInstance: SupabaseClientInstance): void {\n const auth = supabaseClientInstance.auth;\n\n if (!auth || isInstrumented(supabaseClientInstance.auth)) {\n return;\n }\n\n for (const operation of AUTH_OPERATIONS_TO_INSTRUMENT) {\n const authOperation = auth[operation];\n\n if (!authOperation) {\n continue;\n }\n\n if (typeof supabaseClientInstance.auth[operation] === 'function') {\n supabaseClientInstance.auth[operation] = instrumentAuthOperation(authOperation);\n }\n }\n\n for (const operation of AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT) {\n const authOperation = auth.admin[operation];\n\n if (!authOperation) {\n continue;\n }\n\n if (typeof supabaseClientInstance.auth.admin[operation] === 'function') {\n supabaseClientInstance.auth.admin[operation] = instrumentAuthOperation(authOperation, true);\n }\n }\n\n markAsInstrumented(supabaseClientInstance.auth);\n}\n\nfunction instrumentSupabaseClientConstructor(SupabaseClient: unknown): void {\n if (isInstrumented((SupabaseClient as SupabaseClientConstructor).prototype.from)) {\n return;\n }\n\n (SupabaseClient as SupabaseClientConstructor).prototype.from = new Proxy(\n (SupabaseClient as SupabaseClientConstructor).prototype.from,\n {\n apply(target, thisArg, argumentsList) {\n const rv = Reflect.apply(target, thisArg, argumentsList);\n const PostgRESTQueryBuilder = (rv as PostgRESTQueryBuilder).constructor;\n\n instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder as unknown as new () => PostgRESTQueryBuilder);\n\n return rv;\n },\n },\n );\n\n markAsInstrumented((SupabaseClient as SupabaseClientConstructor).prototype.from);\n}\n\nfunction instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder: PostgRESTFilterBuilder['constructor']): void {\n if (isInstrumented((PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then)) {\n return;\n }\n\n (PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then = new Proxy(\n (PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then,\n {\n apply(target, thisArg, argumentsList) {\n const operations = DB_OPERATIONS_TO_INSTRUMENT;\n const typedThis = thisArg as PostgRESTFilterBuilder;\n const operation = extractOperation(typedThis.method, typedThis.headers);\n\n if (!operations.includes(operation)) {\n return Reflect.apply(target, thisArg, argumentsList);\n }\n\n if (!typedThis?.url?.pathname || typeof typedThis.url.pathname !== 'string') {\n return Reflect.apply(target, thisArg, argumentsList);\n }\n\n const pathParts = typedThis.url.pathname.split('/');\n const table = pathParts.length > 0 ? pathParts[pathParts.length - 1] : '';\n\n const queryItems: string[] = [];\n for (const [key, value] of typedThis.url.searchParams.entries()) {\n // It's possible to have multiple entries for the same key, eg. `id=eq.7&id=eq.3`,\n // so we need to use array instead of object to collect them.\n queryItems.push(translateFiltersIntoMethods(key, value));\n }\n const body: Record<string, unknown> = Object.create(null);\n if (isPlainObject(typedThis.body)) {\n for (const [key, value] of Object.entries(typedThis.body)) {\n body[key] = value;\n }\n }\n\n // Adding operation to the beginning of the description if it's not a `select` operation\n // For example, it can be an `insert` or `update` operation but the query can be `select(...)`\n // For `select` operations, we don't need repeat it in the description\n const description = `${operation === 'select' ? '' : `${operation}${body ? '(...) ' : ''}`}${queryItems.join(\n ' ',\n )} from(${table})`;\n\n const attributes: Record<string, any> = {\n 'db.table': table,\n 'db.schema': typedThis.schema,\n 'db.url': typedThis.url.origin,\n 'db.sdk': typedThis.headers['X-Client-Info'],\n 'db.system': 'postgresql',\n 'db.operation': operation,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.supabase',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n };\n\n if (queryItems.length) {\n attributes['db.query'] = queryItems;\n }\n\n if (Object.keys(body).length) {\n attributes['db.body'] = body;\n }\n\n return startSpan(\n {\n name: description,\n attributes,\n },\n span => {\n return (Reflect.apply(target, thisArg, []) as Promise<SupabaseResponse>)\n .then(\n (res: SupabaseResponse) => {\n if (span) {\n if (res && typeof res === 'object' && 'status' in res) {\n setHttpStatus(span, res.status || 500);\n }\n span.end();\n }\n\n if (res.error) {\n const err = new Error(res.error.message) as SupabaseError;\n if (res.error.code) {\n err.code = res.error.code;\n }\n if (res.error.details) {\n err.details = res.error.details;\n }\n\n const supabaseContext: Record<string, any> = {};\n if (queryItems.length) {\n supabaseContext.query = queryItems;\n }\n if (Object.keys(body).length) {\n supabaseContext.body = body;\n }\n\n captureException(err, scope => {\n scope.addEventProcessor(e => {\n addExceptionMechanism(e, {\n handled: false,\n type: 'auto.db.supabase.postgres',\n });\n\n return e;\n });\n\n scope.setContext('supabase', supabaseContext);\n\n return scope;\n });\n }\n\n const breadcrumb: SupabaseBreadcrumb = {\n type: 'supabase',\n category: `db.${operation}`,\n message: description,\n };\n\n const data: Record<string, unknown> = {};\n\n if (queryItems.length) {\n data.query = queryItems;\n }\n\n if (Object.keys(body).length) {\n data.body = body;\n }\n\n if (Object.keys(data).length) {\n breadcrumb.data = data;\n }\n\n addBreadcrumb(breadcrumb);\n\n return res;\n },\n (err: Error) => {\n // TODO: shouldn't we capture this error?\n if (span) {\n setHttpStatus(span, 500);\n span.end();\n }\n throw err;\n },\n )\n .then(...argumentsList);\n },\n );\n },\n },\n );\n\n markAsInstrumented((PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then);\n}\n\nfunction instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder: new () => PostgRESTQueryBuilder): void {\n // We need to wrap _all_ operations despite them sharing the same `PostgRESTFilterBuilder`\n // constructor, as we don't know which method will be called first, and we don't want to miss any calls.\n for (const operation of DB_OPERATIONS_TO_INSTRUMENT) {\n if (isInstrumented((PostgRESTQueryBuilder.prototype as Record<string, any>)[operation])) {\n continue;\n }\n\n type PostgRESTOperation = keyof Pick<PostgRESTQueryBuilder, 'select' | 'insert' | 'upsert' | 'update' | 'delete'>;\n (PostgRESTQueryBuilder.prototype as Record<string, any>)[operation as PostgRESTOperation] = new Proxy(\n (PostgRESTQueryBuilder.prototype as Record<string, any>)[operation as PostgRESTOperation],\n {\n apply(target, thisArg, argumentsList) {\n const rv = Reflect.apply(target, thisArg, argumentsList);\n const PostgRESTFilterBuilder = (rv as PostgRESTFilterBuilder).constructor;\n\n DEBUG_BUILD && debug.log(`Instrumenting ${operation} operation's PostgRESTFilterBuilder`);\n\n instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder);\n\n return rv;\n },\n },\n );\n\n markAsInstrumented((PostgRESTQueryBuilder.prototype as Record<string, any>)[operation]);\n }\n}\n\nexport const instrumentSupabaseClient = (supabaseClient: unknown): void => {\n if (!supabaseClient) {\n DEBUG_BUILD && debug.warn('Supabase integration was not installed because no Supabase client was provided.');\n return;\n }\n const SupabaseClientConstructor =\n supabaseClient.constructor === Function ? supabaseClient : supabaseClient.constructor;\n\n instrumentSupabaseClientConstructor(SupabaseClientConstructor);\n instrumentSupabaseAuthClient(supabaseClient as SupabaseClientInstance);\n};\n\nconst INTEGRATION_NAME = 'Supabase';\n\nconst _supabaseIntegration = ((supabaseClient: unknown) => {\n return {\n setupOnce() {\n instrumentSupabaseClient(supabaseClient);\n },\n name: INTEGRATION_NAME,\n };\n}) satisfies IntegrationFn;\n\nexport const supabaseIntegration = defineIntegration((options: { supabaseClient: any }) => {\n return _supabaseIntegration(options.supabaseClient);\n}) satisfies IntegrationFn;\n"],"names":["startSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","SPAN_STATUS_ERROR","captureException","SPAN_STATUS_OK","isPlainObject","setHttpStatus","addExceptionMechanism","addBreadcrumb","DEBUG_BUILD","debug","defineIntegration"],"mappings":";;;;;;;;;;;;;AAAA;AACA;;;AAeA,MAAM,gCAAgC;AACtC,EAAE,gBAAgB;AAClB,EAAE,mBAAmB;AACrB,EAAE,iBAAiB;AACnB,EAAE,mBAAmB;AACrB,EAAE,eAAe;AACjB,EAAE,oBAAoB;AACtB,EAAE,eAAe;AACjB,EAAE,SAAS;AACX,EAAE,QAAQ;AACV,EAAE,WAAW;AACb,CAAC;;AAED,MAAM,sCAAsC;AAC5C,EAAE,YAAY;AACd,EAAE,YAAY;AACd,EAAE,WAAW;AACb,EAAE,aAAa;AACf,EAAE,gBAAgB;AAClB,EAAE,mBAAmB;AACrB,CAAC;;AAEM,MAAM,kBAAkB;AAC/B,EAAE,EAAE,EAAE,IAAI;AACV,EAAE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ACA,IAAAD,sBAAA,IAAAC,iBAAA,CAAA,IAAA,CAAA,iFAAA,CAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA,MAAA,yBAAA;AACA,IAAA,cAAA,CAAA,WAAA,KAAA,QAAA,GAAA,cAAA,GAAA,cAAA,CAAA,WAAA;;AAEA,EAAA,mCAAA,CAAA,yBAAA,CAAA;AACA,EAAA,4BAAA,CAAA,cAAA,EAAA;AACA;;AAEA,MAAA,gBAAA,GAAA,UAAA;;AAEA,MAAA,oBAAA,IAAA,CAAA,cAAA,KAAA;AACA,EAAA,OAAA;AACA,IAAA,SAAA,GAAA;AACA,MAAA,wBAAA,CAAA,cAAA,CAAA;AACA,IAAA,CAAA;AACA,IAAA,IAAA,EAAA,gBAAA;AACA,GAAA;AACA,CAAA,CAAA;;AAEA,MAAA,mBAAA,GAAAC,6BAAA,CAAA,CAAA,OAAA,KAAA;AACA,EAAA,OAAA,oBAAA,CAAA,OAAA,CAAA,cAAA,CAAA;AACA,CAAA,CAAA;;;;;;;;;"}
1
+ {"version":3,"file":"supabase.js","sources":["../../../src/integrations/supabase.ts"],"sourcesContent":["// Based on Kamil Ogórek's work on:\n// https://github.com/supabase-community/sentry-integration-js\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport { addBreadcrumb } from '../breadcrumbs';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { captureException } from '../exports';\nimport { defineIntegration } from '../integration';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../semanticAttributes';\nimport { setHttpStatus, SPAN_STATUS_ERROR, SPAN_STATUS_OK, startSpan } from '../tracing';\nimport type { IntegrationFn } from '../types-hoist/integration';\nimport { debug } from '../utils/debug-logger';\nimport { isPlainObject } from '../utils/is';\nimport { addExceptionMechanism } from '../utils/misc';\n\nconst AUTH_OPERATIONS_TO_INSTRUMENT = [\n 'reauthenticate',\n 'signInAnonymously',\n 'signInWithOAuth',\n 'signInWithIdToken',\n 'signInWithOtp',\n 'signInWithPassword',\n 'signInWithSSO',\n 'signOut',\n 'signUp',\n 'verifyOtp',\n];\n\nconst AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT = [\n 'createUser',\n 'deleteUser',\n 'listUsers',\n 'getUserById',\n 'updateUserById',\n 'inviteUserByEmail',\n];\n\nexport const FILTER_MAPPINGS = {\n eq: 'eq',\n neq: 'neq',\n gt: 'gt',\n gte: 'gte',\n lt: 'lt',\n lte: 'lte',\n like: 'like',\n 'like(all)': 'likeAllOf',\n 'like(any)': 'likeAnyOf',\n ilike: 'ilike',\n 'ilike(all)': 'ilikeAllOf',\n 'ilike(any)': 'ilikeAnyOf',\n is: 'is',\n in: 'in',\n cs: 'contains',\n cd: 'containedBy',\n sr: 'rangeGt',\n nxl: 'rangeGte',\n sl: 'rangeLt',\n nxr: 'rangeLte',\n adj: 'rangeAdjacent',\n ov: 'overlaps',\n fts: '',\n plfts: 'plain',\n phfts: 'phrase',\n wfts: 'websearch',\n not: 'not',\n};\n\nexport const DB_OPERATIONS_TO_INSTRUMENT = ['select', 'insert', 'upsert', 'update', 'delete'];\n\ntype AuthOperationFn = (...args: unknown[]) => Promise<unknown>;\ntype AuthOperationName = (typeof AUTH_OPERATIONS_TO_INSTRUMENT)[number];\ntype AuthAdminOperationName = (typeof AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT)[number];\ntype PostgRESTQueryOperationFn = (...args: unknown[]) => PostgRESTFilterBuilder;\n\nexport interface SupabaseClientInstance {\n auth: {\n admin: Record<AuthAdminOperationName, AuthOperationFn>;\n } & Record<AuthOperationName, AuthOperationFn>;\n}\n\nexport interface PostgRESTQueryBuilder {\n [key: string]: PostgRESTQueryOperationFn;\n}\n\nexport interface PostgRESTFilterBuilder {\n method: string;\n headers: Record<string, string>;\n url: URL;\n schema: string;\n body: any;\n}\n\nexport interface SupabaseResponse {\n status?: number;\n error?: {\n message: string;\n code?: string;\n details?: unknown;\n };\n}\n\nexport interface SupabaseError extends Error {\n code?: string;\n details?: unknown;\n}\n\nexport interface SupabaseBreadcrumb {\n type: string;\n category: string;\n message: string;\n data?: {\n query?: string[];\n body?: Record<string, unknown>;\n };\n}\n\nexport interface SupabaseClientConstructor {\n prototype: {\n from: (table: string) => PostgRESTQueryBuilder;\n };\n}\n\nexport interface PostgRESTProtoThenable {\n then: <T>(\n onfulfilled?: ((value: T) => T | PromiseLike<T>) | null,\n onrejected?: ((reason: any) => T | PromiseLike<T>) | null,\n ) => Promise<T>;\n}\n\ntype SentryInstrumented<T> = T & {\n __SENTRY_INSTRUMENTED__?: boolean;\n};\n\nfunction markAsInstrumented<T>(fn: T): void {\n try {\n (fn as SentryInstrumented<T>).__SENTRY_INSTRUMENTED__ = true;\n } catch {\n // ignore errors here\n }\n}\n\nfunction isInstrumented<T>(fn: T): boolean | undefined {\n try {\n return (fn as SentryInstrumented<T>).__SENTRY_INSTRUMENTED__;\n } catch {\n return false;\n }\n}\n\n/**\n * Extracts the database operation type from the HTTP method and headers\n * @param method - The HTTP method of the request\n * @param headers - The request headers\n * @returns The database operation type ('select', 'insert', 'upsert', 'update', or 'delete')\n */\nexport function extractOperation(method: string, headers: Record<string, string> = {}): string {\n switch (method) {\n case 'GET': {\n return 'select';\n }\n case 'POST': {\n if (headers['Prefer']?.includes('resolution=')) {\n return 'upsert';\n } else {\n return 'insert';\n }\n }\n case 'PATCH': {\n return 'update';\n }\n case 'DELETE': {\n return 'delete';\n }\n default: {\n return '<unknown-op>';\n }\n }\n}\n\n/**\n * Translates Supabase filter parameters into readable method names for tracing\n * @param key - The filter key from the URL search parameters\n * @param query - The filter value from the URL search parameters\n * @returns A string representation of the filter as a method call\n */\nexport function translateFiltersIntoMethods(key: string, query: string): string {\n if (query === '' || query === '*') {\n return 'select(*)';\n }\n\n if (key === 'select') {\n return `select(${query})`;\n }\n\n if (key === 'or' || key.endsWith('.or')) {\n return `${key}${query}`;\n }\n\n const [filter, ...value] = query.split('.');\n\n let method;\n // Handle optional `configPart` of the filter\n if (filter?.startsWith('fts')) {\n method = 'textSearch';\n } else if (filter?.startsWith('plfts')) {\n method = 'textSearch[plain]';\n } else if (filter?.startsWith('phfts')) {\n method = 'textSearch[phrase]';\n } else if (filter?.startsWith('wfts')) {\n method = 'textSearch[websearch]';\n } else {\n method = (filter && FILTER_MAPPINGS[filter as keyof typeof FILTER_MAPPINGS]) || 'filter';\n }\n\n return `${method}(${key}, ${value.join('.')})`;\n}\n\nfunction instrumentAuthOperation(operation: AuthOperationFn, isAdmin = false): AuthOperationFn {\n return new Proxy(operation, {\n apply(target, thisArg, argumentsList) {\n return startSpan(\n {\n name: `auth ${isAdmin ? '(admin) ' : ''}${operation.name}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.supabase',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n 'db.system': 'postgresql',\n 'db.operation': `auth.${isAdmin ? 'admin.' : ''}${operation.name}`,\n },\n },\n span => {\n return Reflect.apply(target, thisArg, argumentsList)\n .then((res: unknown) => {\n if (res && typeof res === 'object' && 'error' in res && res.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n\n captureException(res.error, {\n mechanism: {\n handled: false,\n type: 'auto.db.supabase.auth',\n },\n });\n } else {\n span.setStatus({ code: SPAN_STATUS_OK });\n }\n\n span.end();\n return res;\n })\n .catch((err: unknown) => {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n span.end();\n\n captureException(err, {\n mechanism: {\n handled: false,\n type: 'auto.db.supabase.auth',\n },\n });\n\n throw err;\n })\n .then(...argumentsList);\n },\n );\n },\n });\n}\n\nfunction instrumentSupabaseAuthClient(supabaseClientInstance: SupabaseClientInstance): void {\n const auth = supabaseClientInstance.auth;\n\n if (!auth || isInstrumented(supabaseClientInstance.auth)) {\n return;\n }\n\n for (const operation of AUTH_OPERATIONS_TO_INSTRUMENT) {\n const authOperation = auth[operation];\n\n if (!authOperation) {\n continue;\n }\n\n if (typeof supabaseClientInstance.auth[operation] === 'function') {\n supabaseClientInstance.auth[operation] = instrumentAuthOperation(authOperation);\n }\n }\n\n for (const operation of AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT) {\n const authOperation = auth.admin[operation];\n\n if (!authOperation) {\n continue;\n }\n\n if (typeof supabaseClientInstance.auth.admin[operation] === 'function') {\n supabaseClientInstance.auth.admin[operation] = instrumentAuthOperation(authOperation, true);\n }\n }\n\n markAsInstrumented(supabaseClientInstance.auth);\n}\n\nfunction instrumentSupabaseClientConstructor(SupabaseClient: unknown): void {\n if (isInstrumented((SupabaseClient as SupabaseClientConstructor).prototype.from)) {\n return;\n }\n\n (SupabaseClient as SupabaseClientConstructor).prototype.from = new Proxy(\n (SupabaseClient as SupabaseClientConstructor).prototype.from,\n {\n apply(target, thisArg, argumentsList) {\n const rv = Reflect.apply(target, thisArg, argumentsList);\n const PostgRESTQueryBuilder = (rv as PostgRESTQueryBuilder).constructor;\n\n instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder as unknown as new () => PostgRESTQueryBuilder);\n\n return rv;\n },\n },\n );\n\n markAsInstrumented((SupabaseClient as SupabaseClientConstructor).prototype.from);\n}\n\nfunction instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder: PostgRESTFilterBuilder['constructor']): void {\n if (isInstrumented((PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then)) {\n return;\n }\n\n (PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then = new Proxy(\n (PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then,\n {\n apply(target, thisArg, argumentsList) {\n const operations = DB_OPERATIONS_TO_INSTRUMENT;\n const typedThis = thisArg as PostgRESTFilterBuilder;\n const operation = extractOperation(typedThis.method, typedThis.headers);\n\n if (!operations.includes(operation)) {\n return Reflect.apply(target, thisArg, argumentsList);\n }\n\n if (!typedThis?.url?.pathname || typeof typedThis.url.pathname !== 'string') {\n return Reflect.apply(target, thisArg, argumentsList);\n }\n\n const pathParts = typedThis.url.pathname.split('/');\n const table = pathParts.length > 0 ? pathParts[pathParts.length - 1] : '';\n\n const queryItems: string[] = [];\n for (const [key, value] of typedThis.url.searchParams.entries()) {\n // It's possible to have multiple entries for the same key, eg. `id=eq.7&id=eq.3`,\n // so we need to use array instead of object to collect them.\n queryItems.push(translateFiltersIntoMethods(key, value));\n }\n const body: Record<string, unknown> = Object.create(null);\n if (isPlainObject(typedThis.body)) {\n for (const [key, value] of Object.entries(typedThis.body)) {\n body[key] = value;\n }\n }\n\n // Adding operation to the beginning of the description if it's not a `select` operation\n // For example, it can be an `insert` or `update` operation but the query can be `select(...)`\n // For `select` operations, we don't need repeat it in the description\n const description = `${operation === 'select' ? '' : `${operation}${body ? '(...) ' : ''}`}${queryItems.join(\n ' ',\n )} from(${table})`;\n\n const attributes: Record<string, any> = {\n 'db.table': table,\n 'db.schema': typedThis.schema,\n 'db.url': typedThis.url.origin,\n 'db.sdk': typedThis.headers['X-Client-Info'],\n 'db.system': 'postgresql',\n 'db.operation': operation,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.supabase',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n };\n\n if (queryItems.length) {\n attributes['db.query'] = queryItems;\n }\n\n if (Object.keys(body).length) {\n attributes['db.body'] = body;\n }\n\n return startSpan(\n {\n name: description,\n attributes,\n },\n span => {\n return (Reflect.apply(target, thisArg, []) as Promise<SupabaseResponse>)\n .then(\n (res: SupabaseResponse) => {\n if (span) {\n if (res && typeof res === 'object' && 'status' in res) {\n setHttpStatus(span, res.status || 500);\n }\n span.end();\n }\n\n if (res.error) {\n const err = new Error(res.error.message) as SupabaseError;\n if (res.error.code) {\n err.code = res.error.code;\n }\n if (res.error.details) {\n err.details = res.error.details;\n }\n\n const supabaseContext: Record<string, any> = {};\n if (queryItems.length) {\n supabaseContext.query = queryItems;\n }\n if (Object.keys(body).length) {\n supabaseContext.body = body;\n }\n\n captureException(err, scope => {\n scope.addEventProcessor(e => {\n addExceptionMechanism(e, {\n handled: false,\n type: 'auto.db.supabase.postgres',\n });\n\n return e;\n });\n\n scope.setContext('supabase', supabaseContext);\n\n return scope;\n });\n }\n\n const breadcrumb: SupabaseBreadcrumb = {\n type: 'supabase',\n category: `db.${operation}`,\n message: description,\n };\n\n const data: Record<string, unknown> = {};\n\n if (queryItems.length) {\n data.query = queryItems;\n }\n\n if (Object.keys(body).length) {\n data.body = body;\n }\n\n if (Object.keys(data).length) {\n breadcrumb.data = data;\n }\n\n addBreadcrumb(breadcrumb);\n\n return res;\n },\n (err: Error) => {\n // TODO: shouldn't we capture this error?\n if (span) {\n setHttpStatus(span, 500);\n span.end();\n }\n throw err;\n },\n )\n .then(...argumentsList);\n },\n );\n },\n },\n );\n\n markAsInstrumented((PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then);\n}\n\nfunction instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder: new () => PostgRESTQueryBuilder): void {\n // We need to wrap _all_ operations despite them sharing the same `PostgRESTFilterBuilder`\n // constructor, as we don't know which method will be called first, and we don't want to miss any calls.\n for (const operation of DB_OPERATIONS_TO_INSTRUMENT) {\n if (isInstrumented((PostgRESTQueryBuilder.prototype as Record<string, any>)[operation])) {\n continue;\n }\n\n type PostgRESTOperation = keyof Pick<PostgRESTQueryBuilder, 'select' | 'insert' | 'upsert' | 'update' | 'delete'>;\n (PostgRESTQueryBuilder.prototype as Record<string, any>)[operation as PostgRESTOperation] = new Proxy(\n (PostgRESTQueryBuilder.prototype as Record<string, any>)[operation as PostgRESTOperation],\n {\n apply(target, thisArg, argumentsList) {\n const rv = Reflect.apply(target, thisArg, argumentsList);\n const PostgRESTFilterBuilder = (rv as PostgRESTFilterBuilder).constructor;\n\n DEBUG_BUILD && debug.log(`Instrumenting ${operation} operation's PostgRESTFilterBuilder`);\n\n instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder);\n\n return rv;\n },\n },\n );\n\n markAsInstrumented((PostgRESTQueryBuilder.prototype as Record<string, any>)[operation]);\n }\n}\n\nexport const instrumentSupabaseClient = (supabaseClient: unknown): void => {\n if (!supabaseClient) {\n DEBUG_BUILD && debug.warn('Supabase integration was not installed because no Supabase client was provided.');\n return;\n }\n const SupabaseClientConstructor =\n supabaseClient.constructor === Function ? supabaseClient : supabaseClient.constructor;\n\n instrumentSupabaseClientConstructor(SupabaseClientConstructor);\n instrumentSupabaseAuthClient(supabaseClient as SupabaseClientInstance);\n};\n\nconst INTEGRATION_NAME = 'Supabase';\n\nconst _supabaseIntegration = ((supabaseClient: unknown) => {\n return {\n setupOnce() {\n instrumentSupabaseClient(supabaseClient);\n },\n name: INTEGRATION_NAME,\n };\n}) satisfies IntegrationFn;\n\nexport const supabaseIntegration = defineIntegration((options: { supabaseClient: any }) => {\n return _supabaseIntegration(options.supabaseClient);\n}) satisfies IntegrationFn;\n"],"names":["startSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","SPAN_STATUS_ERROR","captureException","SPAN_STATUS_OK","isPlainObject","setHttpStatus","addExceptionMechanism","addBreadcrumb","DEBUG_BUILD","debug","defineIntegration"],"mappings":";;;;;;;;;;;;;AAAA;AACA;;;AAeA,MAAM,gCAAgC;AACtC,EAAE,gBAAgB;AAClB,EAAE,mBAAmB;AACrB,EAAE,iBAAiB;AACnB,EAAE,mBAAmB;AACrB,EAAE,eAAe;AACjB,EAAE,oBAAoB;AACtB,EAAE,eAAe;AACjB,EAAE,SAAS;AACX,EAAE,QAAQ;AACV,EAAE,WAAW;AACb,CAAC;;AAED,MAAM,sCAAsC;AAC5C,EAAE,YAAY;AACd,EAAE,YAAY;AACd,EAAE,WAAW;AACb,EAAE,aAAa;AACf,EAAE,gBAAgB;AAClB,EAAE,mBAAmB;AACrB,CAAC;;AAEM,MAAM,kBAAkB;AAC/B,EAAE,EAAE,EAAE,IAAI;AACV,EAAE,GAAG,EAAE,K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AA,IAAAC,iBAAA,CAAA,IAAA,CAAA,iFAAA,CAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA,MAAA,yBAAA;AACA,IAAA,cAAA,CAAA,WAAA,KAAA,QAAA,GAAA,cAAA,GAAA,cAAA,CAAA,WAAA;;AAEA,EAAA,mCAAA,CAAA,yBAAA,CAAA;AACA,EAAA,4BAAA,CAAA,cAAA,EAAA;AACA;;AAEA,MAAA,gBAAA,GAAA,UAAA;;AAEA,MAAA,oBAAA,IAAA,CAAA,cAAA,KAAA;AACA,EAAA,OAAA;AACA,IAAA,SAAA,GAAA;AACA,MAAA,wBAAA,CAAA,cAAA,CAAA;AACA,IAAA,CAAA;AACA,IAAA,IAAA,EAAA,gBAAA;AACA,GAAA;AACA,CAAA,CAAA;;AAEA,MAAA,mBAAA,GAAAC,6BAAA,CAAA,CAAA,OAAA,KAAA;AACA,EAAA,OAAA,oBAAA,CAAA,OAAA,CAAA,cAAA,CAAA;AACA,CAAA,CAAA;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const currentScopes = require('../../currentScopes.js');
4
- const exports$1 = require('../../exports.js');
4
+ const _exports = require('../../exports.js');
5
5
  const semanticAttributes = require('../../semanticAttributes.js');
6
6
  const spanstatus = require('../spanstatus.js');
7
7
  const trace = require('../trace.js');
@@ -154,7 +154,7 @@ function addResponseAttributes(span, response, recordOutputs) {
154
154
  * Handle common error catching and reporting for streaming requests
155
155
  */
156
156
  function handleStreamingError(error, span, methodPath) {
157
- exports$1.captureException(error, {
157
+ _exports.captureException(error, {
158
158
  mechanism: { handled: false, type: 'auto.ai.anthropic', data: { function: methodPath } },
159
159
  });
160
160
 
@@ -271,7 +271,7 @@ function instrumentMethod(
271
271
  return handleCallbackErrors.handleCallbackErrors(
272
272
  () => target.apply(context, args),
273
273
  error => {
274
- exports$1.captureException(error, {
274
+ _exports.captureException(error, {
275
275
  mechanism: {
276
276
  handled: false,
277
277
  type: 'auto.ai.anthropic',