@sentry/bundler-plugin-core 5.1.0 → 5.2.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.
package/dist/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region \0rolldown/runtime.js
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -7,16 +7,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
- key = keys[i];
13
- if (!__hasOwnProp.call(to, key) && key !== except) {
14
- __defProp(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- }
19
- }
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
20
16
  }
21
17
  return to;
22
18
  };
@@ -24,7 +20,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
20
  value: mod,
25
21
  enumerable: true
26
22
  }) : target, mod));
27
-
28
23
  //#endregion
29
24
  let _babel_core = require("@babel/core");
30
25
  let _sentry_babel_plugin_component_annotate = require("@sentry/babel-plugin-component-annotate");
@@ -56,7 +51,6 @@ let url = require("url");
56
51
  url = __toESM(url);
57
52
  let util = require("util");
58
53
  util = __toESM(util);
59
-
60
54
  //#region node_modules/@sentry/utils/build/esm/is.js
61
55
  const objectToString = Object.prototype.toString;
62
56
  /**
@@ -195,7 +189,6 @@ function isInstanceOf(wat, base) {
195
189
  function isVueViewModel(wat) {
196
190
  return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue));
197
191
  }
198
-
199
192
  //#endregion
200
193
  //#region node_modules/@sentry/utils/build/esm/string.js
201
194
  /**
@@ -209,11 +202,9 @@ function truncate(str, max = 0) {
209
202
  if (typeof str !== "string" || max === 0) return str;
210
203
  return str.length <= max ? str : `${str.slice(0, max)}...`;
211
204
  }
212
-
213
205
  //#endregion
214
206
  //#region node_modules/@sentry/utils/build/esm/version.js
215
207
  const SDK_VERSION = "8.30.0";
216
-
217
208
  //#endregion
218
209
  //#region node_modules/@sentry/utils/build/esm/worldwide.js
219
210
  /** Get's the global object for the current JavaScript runtime */
@@ -232,10 +223,9 @@ const GLOBAL_OBJ = globalThis;
232
223
  function getGlobalSingleton(name, creator, obj) {
233
224
  const gbl = obj || GLOBAL_OBJ;
234
225
  const __SENTRY__ = gbl.__SENTRY__ = gbl.__SENTRY__ || {};
235
- const versionedCarrier = __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {};
226
+ const versionedCarrier = __SENTRY__[SDK_VERSION] = __SENTRY__["8.30.0"] || {};
236
227
  return versionedCarrier[name] || (versionedCarrier[name] = creator());
237
228
  }
238
-
239
229
  //#endregion
240
230
  //#region node_modules/@sentry/utils/build/esm/browser.js
241
231
  const WINDOW = GLOBAL_OBJ;
@@ -311,7 +301,6 @@ function _htmlElementAsString(el, keyAttrs) {
311
301
  }
312
302
  return out.join("");
313
303
  }
314
-
315
304
  //#endregion
316
305
  //#region node_modules/@sentry/utils/build/esm/debug-build.js
317
306
  /**
@@ -320,7 +309,6 @@ function _htmlElementAsString(el, keyAttrs) {
320
309
  * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
321
310
  */
322
311
  const DEBUG_BUILD$1 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
323
-
324
312
  //#endregion
325
313
  //#region node_modules/@sentry/utils/build/esm/logger.js
326
314
  /** Prefix for logging strings */
@@ -389,7 +377,6 @@ function makeLogger() {
389
377
  * The logger is a singleton on the carrier, to ensure that a consistent logger is used throughout the SDK.
390
378
  */
391
379
  const logger = getGlobalSingleton("logger", makeLogger);
392
-
393
380
  //#endregion
394
381
  //#region node_modules/@sentry/utils/build/esm/dsn.js
395
382
  /** Regular expression used to parse a Dsn. */
@@ -495,7 +482,6 @@ function makeDsn(from) {
495
482
  if (!components || !validateDsn(components)) return;
496
483
  return components;
497
484
  }
498
-
499
485
  //#endregion
500
486
  //#region node_modules/@sentry/utils/build/esm/error.js
501
487
  /** An error emitted by Sentry SDKs and related utilities. */
@@ -509,7 +495,6 @@ var SentryError = class extends Error {
509
495
  this.logLevel = logLevel;
510
496
  }
511
497
  };
512
-
513
498
  //#endregion
514
499
  //#region node_modules/@sentry/utils/build/esm/object.js
515
500
  /**
@@ -639,11 +624,9 @@ function isPojo(input) {
639
624
  return true;
640
625
  }
641
626
  }
642
-
643
627
  //#endregion
644
628
  //#region node_modules/@sentry/utils/build/esm/stacktrace.js
645
629
  const STACKTRACE_FRAME_LIMIT = 50;
646
- const UNKNOWN_FUNCTION = "?";
647
630
  const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
648
631
  const STRIP_FRAME_REGEXP = /captureMessage|captureException/;
649
632
  /**
@@ -693,7 +676,7 @@ function stripSentryFramesAndReverse(stack) {
693
676
  return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame) => ({
694
677
  ...frame,
695
678
  filename: frame.filename || getLastStackFrame(localStack).filename,
696
- function: frame.function || UNKNOWN_FUNCTION
679
+ function: frame.function || "?"
697
680
  }));
698
681
  }
699
682
  function getLastStackFrame(arr) {
@@ -711,7 +694,6 @@ function getFunctionName(fn) {
711
694
  return defaultFunctionName;
712
695
  }
713
696
  }
714
-
715
697
  //#endregion
716
698
  //#region node_modules/@sentry/utils/build/esm/instrument/handlers.js
717
699
  const handlers = {};
@@ -738,7 +720,6 @@ function triggerHandlers(type, data) {
738
720
  DEBUG_BUILD$1 && logger.error(`Error while triggering instrumentation handler.\nType: ${type}\nName: ${getFunctionName(handler)}\nError:`, e);
739
721
  }
740
722
  }
741
-
742
723
  //#endregion
743
724
  //#region node_modules/@sentry/utils/build/esm/time.js
744
725
  const ONE_SECOND_IN_MS = 1e3;
@@ -779,20 +760,9 @@ function createUnixTimestampInSecondsFunc() {
779
760
  * See https://github.com/getsentry/sentry-javascript/issues/2590.
780
761
  */
781
762
  const timestampInSeconds = createUnixTimestampInSecondsFunc();
782
- /**
783
- * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.
784
- */
785
- let _browserPerformanceTimeOriginMode;
786
- /**
787
- * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the
788
- * performance API is available.
789
- */
790
- const browserPerformanceTimeOrigin = (() => {
763
+ (() => {
791
764
  const { performance } = GLOBAL_OBJ;
792
- if (!performance || !performance.now) {
793
- _browserPerformanceTimeOriginMode = "none";
794
- return;
795
- }
765
+ if (!performance || !performance.now) return;
796
766
  const threshold = 3600 * 1e3;
797
767
  const performanceNow = performance.now();
798
768
  const dateNow = Date.now();
@@ -800,17 +770,10 @@ const browserPerformanceTimeOrigin = (() => {
800
770
  const timeOriginIsReliable = timeOriginDelta < threshold;
801
771
  const navigationStart = performance.timing && performance.timing.navigationStart;
802
772
  const navigationStartDelta = typeof navigationStart === "number" ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;
803
- if (timeOriginIsReliable || navigationStartDelta < threshold) if (timeOriginDelta <= navigationStartDelta) {
804
- _browserPerformanceTimeOriginMode = "timeOrigin";
805
- return performance.timeOrigin;
806
- } else {
807
- _browserPerformanceTimeOriginMode = "navigationStart";
808
- return navigationStart;
809
- }
810
- _browserPerformanceTimeOriginMode = "dateNow";
773
+ if (timeOriginIsReliable || navigationStartDelta < threshold) if (timeOriginDelta <= navigationStartDelta) return performance.timeOrigin;
774
+ else return navigationStart;
811
775
  return dateNow;
812
776
  })();
813
-
814
777
  //#endregion
815
778
  //#region node_modules/@sentry/utils/build/esm/instrument/globalError.js
816
779
  let _oldOnErrorHandler = null;
@@ -840,7 +803,6 @@ function instrumentError() {
840
803
  };
841
804
  GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;
842
805
  }
843
-
844
806
  //#endregion
845
807
  //#region node_modules/@sentry/utils/build/esm/instrument/globalUnhandledRejection.js
846
808
  let _oldOnUnhandledRejectionHandler = null;
@@ -864,7 +826,6 @@ function instrumentUnhandledRejection() {
864
826
  };
865
827
  GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
866
828
  }
867
-
868
829
  //#endregion
869
830
  //#region node_modules/@sentry/utils/build/esm/memo.js
870
831
  /**
@@ -892,7 +853,6 @@ function memoBuilder() {
892
853
  }
893
854
  return [memoize, unmemoize];
894
855
  }
895
-
896
856
  //#endregion
897
857
  //#region node_modules/@sentry/utils/build/esm/misc.js
898
858
  /**
@@ -996,7 +956,6 @@ function checkOrSetAlreadyCaught(exception) {
996
956
  function arrayify$1(maybeArray) {
997
957
  return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
998
958
  }
999
-
1000
959
  //#endregion
1001
960
  //#region node_modules/@sentry/utils/build/esm/normalize.js
1002
961
  /**
@@ -1114,7 +1073,6 @@ function utf8Length(value) {
1114
1073
  function jsonSize(value) {
1115
1074
  return utf8Length(JSON.stringify(value));
1116
1075
  }
1117
-
1118
1076
  //#endregion
1119
1077
  //#region node_modules/@sentry/utils/build/esm/syncpromise.js
1120
1078
  /** SyncPromise internal states */
@@ -1261,7 +1219,6 @@ var SyncPromise = class SyncPromise {
1261
1219
  };
1262
1220
  }
1263
1221
  };
1264
-
1265
1222
  //#endregion
1266
1223
  //#region node_modules/@sentry/utils/build/esm/promisebuffer.js
1267
1224
  /**
@@ -1331,7 +1288,6 @@ function makePromiseBuffer(limit) {
1331
1288
  drain
1332
1289
  };
1333
1290
  }
1334
-
1335
1291
  //#endregion
1336
1292
  //#region node_modules/@sentry/utils/build/esm/node-stack-trace.js
1337
1293
  /**
@@ -1376,7 +1332,7 @@ function node(getModule) {
1376
1332
  functionName = void 0;
1377
1333
  }
1378
1334
  if (functionName === void 0) {
1379
- methodName = methodName || UNKNOWN_FUNCTION;
1335
+ methodName = methodName || "?";
1380
1336
  functionName = typeName ? `${typeName}.${methodName}` : methodName;
1381
1337
  }
1382
1338
  let filename = lineMatch[2] && lineMatch[2].startsWith("file://") ? lineMatch[2].slice(7) : lineMatch[2];
@@ -1407,18 +1363,11 @@ function nodeStackLineParser(getModule) {
1407
1363
  function _parseIntOrUndefined(input) {
1408
1364
  return parseInt(input || "", 10) || void 0;
1409
1365
  }
1410
-
1411
1366
  //#endregion
1412
1367
  //#region node_modules/@sentry/utils/build/esm/baggage.js
1413
1368
  const SENTRY_BAGGAGE_KEY_PREFIX = "sentry-";
1414
1369
  const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;
1415
1370
  /**
1416
- * Max length of a serialized baggage string
1417
- *
1418
- * https://www.w3.org/TR/baggage/#limits
1419
- */
1420
- const MAX_BAGGAGE_STRING_LENGTH = 8192;
1421
- /**
1422
1371
  * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values
1423
1372
  * from it.
1424
1373
  *
@@ -1492,16 +1441,15 @@ function objectToBaggageHeader(object) {
1492
1441
  return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {
1493
1442
  const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;
1494
1443
  const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;
1495
- if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {
1444
+ if (newBaggageHeader.length > 8192) {
1496
1445
  DEBUG_BUILD$1 && logger.warn(`Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`);
1497
1446
  return baggageHeader;
1498
1447
  } else return newBaggageHeader;
1499
1448
  }, "");
1500
1449
  }
1501
-
1502
1450
  //#endregion
1503
1451
  //#region node_modules/@sentry/utils/build/esm/tracing.js
1504
- const TRACEPARENT_REGEXP = new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");
1452
+ const TRACEPARENT_REGEXP = /* @__PURE__ */ new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");
1505
1453
  /**
1506
1454
  * Create sentry-trace header from span context values.
1507
1455
  */
@@ -1510,7 +1458,6 @@ function generateSentryTraceHeader(traceId = uuid4(), spanId = uuid4().substring
1510
1458
  if (sampled !== void 0) sampledString = sampled ? "-1" : "-0";
1511
1459
  return `${traceId}-${spanId}${sampledString}`;
1512
1460
  }
1513
-
1514
1461
  //#endregion
1515
1462
  //#region node_modules/@sentry/utils/build/esm/envelope.js
1516
1463
  /**
@@ -1651,7 +1598,6 @@ function createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn) {
1651
1598
  ...dynamicSamplingContext && { trace: dropUndefinedKeys({ ...dynamicSamplingContext }) }
1652
1599
  };
1653
1600
  }
1654
-
1655
1601
  //#endregion
1656
1602
  //#region node_modules/@sentry/utils/build/esm/clientreport.js
1657
1603
  /**
@@ -1666,7 +1612,6 @@ function createClientReportEnvelope(discarded_events, dsn, timestamp) {
1666
1612
  }];
1667
1613
  return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);
1668
1614
  }
1669
-
1670
1615
  //#endregion
1671
1616
  //#region node_modules/@sentry/utils/build/esm/ratelimit.js
1672
1617
  const DEFAULT_RETRY_AFTER = 60 * 1e3;
@@ -1736,7 +1681,6 @@ function updateRateLimits(limits, { statusCode, headers }, now = Date.now()) {
1736
1681
  else if (statusCode === 429) updatedRateLimits.all = now + 60 * 1e3;
1737
1682
  return updatedRateLimits;
1738
1683
  }
1739
-
1740
1684
  //#endregion
1741
1685
  //#region node_modules/@sentry/utils/build/esm/eventbuilder.js
1742
1686
  /**
@@ -1844,7 +1788,6 @@ function eventFromMessage(stackParser, message, level = "info", hint, attachStac
1844
1788
  event.message = message;
1845
1789
  return event;
1846
1790
  }
1847
-
1848
1791
  //#endregion
1849
1792
  //#region node_modules/@sentry/utils/build/esm/propagationContext.js
1850
1793
  /**
@@ -1856,7 +1799,6 @@ function generatePropagationContext() {
1856
1799
  spanId: uuid4().substring(16)
1857
1800
  };
1858
1801
  }
1859
-
1860
1802
  //#endregion
1861
1803
  //#region src/utils.ts
1862
1804
  /**
@@ -2068,7 +2010,6 @@ var CodeInjection = class CodeInjection {
2068
2010
  return new CodeInjection(this.body);
2069
2011
  }
2070
2012
  };
2071
-
2072
2013
  //#endregion
2073
2014
  //#region src/glob.ts
2074
2015
  function globFiles(patterns, options) {
@@ -2078,7 +2019,6 @@ function globFiles(patterns, options) {
2078
2019
  ...options
2079
2020
  });
2080
2021
  }
2081
-
2082
2022
  //#endregion
2083
2023
  //#region node_modules/@sentry/core/build/esm/debug-build.js
2084
2024
  /**
@@ -2087,7 +2027,6 @@ function globFiles(patterns, options) {
2087
2027
  * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
2088
2028
  */
2089
2029
  const DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
2090
-
2091
2030
  //#endregion
2092
2031
  //#region node_modules/@sentry/core/build/esm/carrier.js
2093
2032
  /**
@@ -2108,10 +2047,9 @@ function getMainCarrier() {
2108
2047
  /** Will either get the existing sentry carrier, or create a new one. */
2109
2048
  function getSentryCarrier(carrier) {
2110
2049
  const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {};
2111
- __SENTRY__.version = __SENTRY__.version || SDK_VERSION;
2112
- return __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {};
2050
+ __SENTRY__.version = __SENTRY__.version || "8.30.0";
2051
+ return __SENTRY__[SDK_VERSION] = __SENTRY__["8.30.0"] || {};
2113
2052
  }
2114
-
2115
2053
  //#endregion
2116
2054
  //#region node_modules/@sentry/core/build/esm/session.js
2117
2055
  /**
@@ -2219,7 +2157,6 @@ function sessionToJSON(session) {
2219
2157
  }
2220
2158
  });
2221
2159
  }
2222
-
2223
2160
  //#endregion
2224
2161
  //#region node_modules/@sentry/core/build/esm/utils/spanOnScope.js
2225
2162
  const SCOPE_SPAN_FIELD = "_sentrySpan";
@@ -2238,7 +2175,6 @@ function _setSpanForScope(scope, span) {
2238
2175
  function _getSpanForScope(scope) {
2239
2176
  return scope[SCOPE_SPAN_FIELD];
2240
2177
  }
2241
-
2242
2178
  //#endregion
2243
2179
  //#region node_modules/@sentry/core/build/esm/scope.js
2244
2180
  /**
@@ -2248,7 +2184,7 @@ const DEFAULT_MAX_BREADCRUMBS = 100;
2248
2184
  /**
2249
2185
  * Holds additional event information.
2250
2186
  */
2251
- var ScopeClass = class ScopeClass {
2187
+ const Scope = class ScopeClass {
2252
2188
  /** Flag if notifying is happening. */
2253
2189
  /** Callback for client to receive scope changes. */
2254
2190
  /** Callback list that will be called during event processing. */
@@ -2670,11 +2606,6 @@ var ScopeClass = class ScopeClass {
2670
2606
  }
2671
2607
  }
2672
2608
  };
2673
- /**
2674
- * Holds additional event information.
2675
- */
2676
- const Scope = ScopeClass;
2677
-
2678
2609
  //#endregion
2679
2610
  //#region node_modules/@sentry/core/build/esm/defaultScopes.js
2680
2611
  /** Get the default current scope. */
@@ -2685,7 +2616,6 @@ function getDefaultCurrentScope() {
2685
2616
  function getDefaultIsolationScope() {
2686
2617
  return getGlobalSingleton("defaultIsolationScope", () => new Scope());
2687
2618
  }
2688
-
2689
2619
  //#endregion
2690
2620
  //#region node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js
2691
2621
  /**
@@ -2805,7 +2735,6 @@ function getStackAsyncContextStrategy() {
2805
2735
  getIsolationScope: () => getAsyncContextStack().getIsolationScope()
2806
2736
  };
2807
2737
  }
2808
-
2809
2738
  //#endregion
2810
2739
  //#region node_modules/@sentry/core/build/esm/asyncContext/index.js
2811
2740
  /**
@@ -2817,7 +2746,6 @@ function getAsyncContextStrategy(carrier) {
2817
2746
  if (sentry.acs) return sentry.acs;
2818
2747
  return getStackAsyncContextStrategy();
2819
2748
  }
2820
-
2821
2749
  //#endregion
2822
2750
  //#region node_modules/@sentry/core/build/esm/currentScopes.js
2823
2751
  /**
@@ -2863,7 +2791,6 @@ function withScope(...rest) {
2863
2791
  function getClient() {
2864
2792
  return getCurrentScope().getClient();
2865
2793
  }
2866
-
2867
2794
  //#endregion
2868
2795
  //#region node_modules/@sentry/core/build/esm/metrics/metric-summary.js
2869
2796
  /**
@@ -2881,7 +2808,6 @@ function getMetricSummaryJsonForSpan(span) {
2881
2808
  for (const [, [exportKey, summary]] of storage) (output[exportKey] || (output[exportKey] = [])).push(dropUndefinedKeys(summary));
2882
2809
  return output;
2883
2810
  }
2884
-
2885
2811
  //#endregion
2886
2812
  //#region node_modules/@sentry/core/build/esm/semanticAttributes.js
2887
2813
  /**
@@ -2911,17 +2837,6 @@ const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = "sentry.measurement_value";
2911
2837
  */
2912
2838
  const SEMANTIC_ATTRIBUTE_PROFILE_ID = "sentry.profile_id";
2913
2839
  const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = "sentry.exclusive_time";
2914
-
2915
- //#endregion
2916
- //#region node_modules/@sentry/core/build/esm/tracing/spanstatus.js
2917
- const SPAN_STATUS_UNSET = 0;
2918
- const SPAN_STATUS_OK = 1;
2919
- const SPAN_STATUS_ERROR = 2;
2920
-
2921
- //#endregion
2922
- //#region node_modules/@sentry/core/build/esm/utils/spanUtils.js
2923
- const TRACE_FLAG_NONE = 0;
2924
- const TRACE_FLAG_SAMPLED = 1;
2925
2840
  /**
2926
2841
  * Convert a span to a trace context, which can be sent as the `trace` context in an event.
2927
2842
  * By default, this will only include trace_id, span_id & parent_span_id.
@@ -3025,12 +2940,12 @@ function spanIsSentrySpan(span) {
3025
2940
  */
3026
2941
  function spanIsSampled(span) {
3027
2942
  const { traceFlags } = span.spanContext();
3028
- return traceFlags === TRACE_FLAG_SAMPLED;
2943
+ return traceFlags === 1;
3029
2944
  }
3030
2945
  /** Get the status message to use for a JSON representation of a span. */
3031
2946
  function getStatusMessage(status) {
3032
- if (!status || status.code === SPAN_STATUS_UNSET) return;
3033
- if (status.code === SPAN_STATUS_OK) return "ok";
2947
+ if (!status || status.code === 0) return;
2948
+ if (status.code === 1) return "ok";
3034
2949
  return status.message || "unknown_error";
3035
2950
  }
3036
2951
  const CHILD_SPANS_FIELD = "_sentryChildSpans";
@@ -3073,7 +2988,6 @@ function getActiveSpan() {
3073
2988
  if (acs.getActiveSpan) return acs.getActiveSpan();
3074
2989
  return _getSpanForScope(getCurrentScope());
3075
2990
  }
3076
-
3077
2991
  //#endregion
3078
2992
  //#region node_modules/@sentry/core/build/esm/tracing/errors.js
3079
2993
  let errorsInstrumented = false;
@@ -3096,13 +3010,12 @@ function errorCallback() {
3096
3010
  const message = "internal_error";
3097
3011
  DEBUG_BUILD && logger.log(`[Tracing] Root span: ${message} -> Global error occured`);
3098
3012
  rootSpan.setStatus({
3099
- code: SPAN_STATUS_ERROR,
3013
+ code: 2,
3100
3014
  message
3101
3015
  });
3102
3016
  }
3103
3017
  }
3104
3018
  errorCallback.tag = "sentry_tracingErrorCallback";
3105
-
3106
3019
  //#endregion
3107
3020
  //#region node_modules/@sentry/core/build/esm/tracing/utils.js
3108
3021
  const SCOPE_ON_START_SPAN_FIELD = "_sentryScope";
@@ -3123,7 +3036,6 @@ function getCapturedScopesOnSpan(span) {
3123
3036
  isolationScope: span[ISOLATION_SCOPE_ON_START_SPAN_FIELD]
3124
3037
  };
3125
3038
  }
3126
-
3127
3039
  //#endregion
3128
3040
  //#region node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js
3129
3041
  /**
@@ -3137,7 +3049,6 @@ function hasTracingEnabled(maybeOptions) {
3137
3049
  const options = maybeOptions || client && client.getOptions();
3138
3050
  return !!options && (options.enableTracing || "tracesSampleRate" in options || "tracesSampler" in options);
3139
3051
  }
3140
-
3141
3052
  //#endregion
3142
3053
  //#region node_modules/@sentry/core/build/esm/tracing/sentryNonRecordingSpan.js
3143
3054
  /**
@@ -3153,7 +3064,7 @@ var SentryNonRecordingSpan = class {
3153
3064
  return {
3154
3065
  spanId: this._spanId,
3155
3066
  traceId: this._traceId,
3156
- traceFlags: TRACE_FLAG_NONE
3067
+ traceFlags: 0
3157
3068
  };
3158
3069
  }
3159
3070
  /** @inheritdoc */
@@ -3211,7 +3122,6 @@ var SentryNonRecordingSpan = class {
3211
3122
  */
3212
3123
  recordException(_exception, _time) {}
3213
3124
  };
3214
-
3215
3125
  //#endregion
3216
3126
  //#region node_modules/@sentry/core/build/esm/utils/handleCallbackErrors.js
3217
3127
  /**
@@ -3254,11 +3164,9 @@ function maybeHandlePromiseRejection(value, onError, onFinally) {
3254
3164
  onFinally();
3255
3165
  return value;
3256
3166
  }
3257
-
3258
3167
  //#endregion
3259
3168
  //#region node_modules/@sentry/core/build/esm/constants.js
3260
3169
  const DEFAULT_ENVIRONMENT = "production";
3261
-
3262
3170
  //#endregion
3263
3171
  //#region node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js
3264
3172
  /**
@@ -3281,7 +3189,7 @@ function getDynamicSamplingContextFromClient(trace_id, client) {
3281
3189
  const options = client.getOptions();
3282
3190
  const { publicKey: public_key } = client.getDsn() || {};
3283
3191
  const dsc = dropUndefinedKeys({
3284
- environment: options.environment || DEFAULT_ENVIRONMENT,
3192
+ environment: options.environment || "production",
3285
3193
  release: options.release,
3286
3194
  public_key,
3287
3195
  trace_id
@@ -3318,7 +3226,6 @@ function getDynamicSamplingContextFromSpan(span) {
3318
3226
  client.emit("createDsc", dsc, rootSpan);
3319
3227
  return dsc;
3320
3228
  }
3321
-
3322
3229
  //#endregion
3323
3230
  //#region node_modules/@sentry/core/build/esm/tracing/logSpans.js
3324
3231
  /**
@@ -3357,7 +3264,6 @@ function logSpanEnd(span) {
3357
3264
  const msg = `[Tracing] Finishing "${op}" ${getRootSpan(span) === span ? "root " : ""}span "${description}" with ID ${spanId}`;
3358
3265
  logger.log(msg);
3359
3266
  }
3360
-
3361
3267
  //#endregion
3362
3268
  //#region node_modules/@sentry/core/build/esm/utils/parseSampleRate.js
3363
3269
  /**
@@ -3376,7 +3282,6 @@ function parseSampleRate(sampleRate) {
3376
3282
  }
3377
3283
  return rate;
3378
3284
  }
3379
-
3380
3285
  //#endregion
3381
3286
  //#region node_modules/@sentry/core/build/esm/tracing/sampling.js
3382
3287
  /**
@@ -3407,7 +3312,6 @@ function sampleSpan(options, samplingContext) {
3407
3312
  }
3408
3313
  return [true, parsedSampleRate];
3409
3314
  }
3410
-
3411
3315
  //#endregion
3412
3316
  //#region node_modules/@sentry/core/build/esm/envelope.js
3413
3317
  /**
@@ -3469,7 +3373,6 @@ function createSpanEnvelope(spans, client) {
3469
3373
  }
3470
3374
  return createEnvelope(headers, items);
3471
3375
  }
3472
-
3473
3376
  //#endregion
3474
3377
  //#region node_modules/@sentry/core/build/esm/tracing/measurement.js
3475
3378
  /**
@@ -3500,7 +3403,6 @@ function timedEventsToMeasurements(events) {
3500
3403
  });
3501
3404
  return measurements;
3502
3405
  }
3503
-
3504
3406
  //#endregion
3505
3407
  //#region node_modules/@sentry/core/build/esm/tracing/sentrySpan.js
3506
3408
  const MAX_SPAN_COUNT = 1e3;
@@ -3572,7 +3474,7 @@ var SentrySpan = class {
3572
3474
  return {
3573
3475
  spanId,
3574
3476
  traceId,
3575
- traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE
3477
+ traceFlags: sampled ? 1 : 0
3576
3478
  };
3577
3479
  }
3578
3480
  /** @inheritdoc */
@@ -3762,7 +3664,6 @@ function sendSpanEnvelope(envelope) {
3762
3664
  DEBUG_BUILD && logger.error("Error while sending span:", reason);
3763
3665
  });
3764
3666
  }
3765
-
3766
3667
  //#endregion
3767
3668
  //#region node_modules/@sentry/core/build/esm/tracing/trace.js
3768
3669
  const SUPPRESS_TRACING_KEY = "__SENTRY_SUPPRESS_TRACING__";
@@ -3795,7 +3696,7 @@ function startSpan(options, callback) {
3795
3696
  return handleCallbackErrors(() => callback(activeSpan), () => {
3796
3697
  const { status } = spanToJSON(activeSpan);
3797
3698
  if (activeSpan.isRecording() && (!status || status === "ok")) activeSpan.setStatus({
3798
- code: SPAN_STATUS_ERROR,
3699
+ code: 2,
3799
3700
  message: "internal_error"
3800
3701
  });
3801
3702
  }, () => activeSpan.end());
@@ -3940,7 +3841,6 @@ function getActiveSpanWrapper(parentSpan) {
3940
3841
  return withActiveSpan(parentSpan, callback);
3941
3842
  } : (callback) => callback();
3942
3843
  }
3943
-
3944
3844
  //#endregion
3945
3845
  //#region node_modules/@sentry/core/build/esm/eventProcessors.js
3946
3846
  /**
@@ -3958,7 +3858,6 @@ function notifyEventProcessors(processors, event, hint, index = 0) {
3958
3858
  }
3959
3859
  });
3960
3860
  }
3961
-
3962
3861
  //#endregion
3963
3862
  //#region node_modules/@sentry/core/build/esm/utils/applyScopeDataToEvent.js
3964
3863
  /**
@@ -4058,7 +3957,6 @@ function applyFingerprintToEvent(event, fingerprint) {
4058
3957
  if (fingerprint) event.fingerprint = event.fingerprint.concat(fingerprint);
4059
3958
  if (event.fingerprint && !event.fingerprint.length) delete event.fingerprint;
4060
3959
  }
4061
-
4062
3960
  //#endregion
4063
3961
  //#region node_modules/@sentry/core/build/esm/utils/prepareEvent.js
4064
3962
  /**
@@ -4242,7 +4140,6 @@ function getFinalScope(scope, captureContext) {
4242
4140
  finalScope.update(captureContext);
4243
4141
  return finalScope;
4244
4142
  }
4245
-
4246
4143
  //#endregion
4247
4144
  //#region node_modules/@sentry/core/build/esm/sessionflusher.js
4248
4145
  /**
@@ -4317,7 +4214,6 @@ var SessionFlusher = class {
4317
4214
  }
4318
4215
  }
4319
4216
  };
4320
-
4321
4217
  //#endregion
4322
4218
  //#region node_modules/@sentry/core/build/esm/api.js
4323
4219
  const SENTRY_API_VERSION = "7";
@@ -4347,7 +4243,6 @@ function _encodedAuth(dsn, sdkInfo) {
4347
4243
  function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) {
4348
4244
  return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;
4349
4245
  }
4350
-
4351
4246
  //#endregion
4352
4247
  //#region node_modules/@sentry/core/build/esm/integration.js
4353
4248
  const installedIntegrations = [];
@@ -4393,7 +4288,6 @@ function setupIntegration(client, integration, integrationIndex) {
4393
4288
  }
4394
4289
  DEBUG_BUILD && logger.log(`Integration installed: ${integration.name}`);
4395
4290
  }
4396
-
4397
4291
  //#endregion
4398
4292
  //#region node_modules/@sentry/core/build/esm/baseclient.js
4399
4293
  const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";
@@ -4933,7 +4827,6 @@ function isErrorEvent(event) {
4933
4827
  function isTransactionEvent(event) {
4934
4828
  return event.type === "transaction";
4935
4829
  }
4936
-
4937
4830
  //#endregion
4938
4831
  //#region node_modules/@sentry/core/build/esm/checkin.js
4939
4832
  /**
@@ -4952,7 +4845,6 @@ function createCheckInEnvelope(checkIn, dynamicSamplingContext, metadata, tunnel
4952
4845
  function createCheckInEnvelopeItem(checkIn) {
4953
4846
  return [{ type: "check_in" }, checkIn];
4954
4847
  }
4955
-
4956
4848
  //#endregion
4957
4849
  //#region node_modules/@sentry/core/build/esm/server-runtime-client.js
4958
4850
  /**
@@ -5093,17 +4985,13 @@ var ServerRuntimeClient = class extends BaseClient {
5093
4985
  return [getDynamicSamplingContextFromClient(traceId, this), traceContext];
5094
4986
  }
5095
4987
  };
5096
-
5097
- //#endregion
5098
- //#region node_modules/@sentry/core/build/esm/transports/base.js
5099
- const DEFAULT_TRANSPORT_BUFFER_SIZE = 64;
5100
4988
  /**
5101
4989
  * Creates an instance of a Sentry `Transport`
5102
4990
  *
5103
4991
  * @param options
5104
4992
  * @param makeRequest
5105
4993
  */
5106
- function createTransport(options, makeRequest, buffer = makePromiseBuffer(options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE)) {
4994
+ function createTransport(options, makeRequest, buffer = makePromiseBuffer(options.bufferSize || 64)) {
5107
4995
  let rateLimits = {};
5108
4996
  const flush = (timeout) => buffer.drain(timeout);
5109
4997
  function send(envelope) {
@@ -5148,7 +5036,6 @@ function getEventForEnvelopeItem(item, type) {
5148
5036
  if (type !== "event" && type !== "transaction") return;
5149
5037
  return Array.isArray(item) ? item[1] : void 0;
5150
5038
  }
5151
-
5152
5039
  //#endregion
5153
5040
  //#region node_modules/@sentry/core/build/esm/utils/sdkMetadata.js
5154
5041
  /**
@@ -5176,7 +5063,6 @@ function applySdkMetadata(options, name, names = [name], source = "npm") {
5176
5063
  };
5177
5064
  options._metadata = metadata;
5178
5065
  }
5179
-
5180
5066
  //#endregion
5181
5067
  //#region node_modules/@sentry/core/build/esm/utils/traceData.js
5182
5068
  /**
@@ -5226,16 +5112,12 @@ function isValidBaggageString(baggage) {
5226
5112
  const spaces = "\\s*";
5227
5113
  return new RegExp(`^${keyRegex}${spaces}=${spaces}${valueRegex}(${spaces},${spaces}${keyRegex}${spaces}=${spaces}${valueRegex})*$`).test(baggage);
5228
5114
  }
5229
-
5230
- //#endregion
5231
- //#region src/options-mapping.ts
5232
- const SENTRY_SAAS_URL = "https://sentry.io";
5233
5115
  function normalizeUserOptions(userOptions) {
5234
5116
  const options = {
5235
5117
  org: userOptions.org ?? process.env["SENTRY_ORG"],
5236
5118
  project: userOptions.project ?? (process.env["SENTRY_PROJECT"]?.includes(",") ? process.env["SENTRY_PROJECT"].split(",").map((p) => p.trim()) : process.env["SENTRY_PROJECT"]),
5237
5119
  authToken: userOptions.authToken ?? process.env["SENTRY_AUTH_TOKEN"],
5238
- url: userOptions.url ?? process.env["SENTRY_URL"] ?? SENTRY_SAAS_URL,
5120
+ url: userOptions.url ?? process.env["SENTRY_URL"] ?? "https://sentry.io",
5239
5121
  headers: userOptions.headers,
5240
5122
  debug: userOptions.debug ?? false,
5241
5123
  silent: userOptions.silent ?? false,
@@ -5319,7 +5201,6 @@ function validateOptions(options, logger) {
5319
5201
  }
5320
5202
  return true;
5321
5203
  }
5322
-
5323
5204
  //#endregion
5324
5205
  //#region src/logger.ts
5325
5206
  function createLogger(options) {
@@ -5338,7 +5219,6 @@ function createLogger(options) {
5338
5219
  }
5339
5220
  };
5340
5221
  }
5341
-
5342
5222
  //#endregion
5343
5223
  //#region src/sentry/transports.ts
5344
5224
  /**
@@ -5414,17 +5294,23 @@ function makeOptionallyEnabledNodeTransport(shouldSendTelemetry) {
5414
5294
  global.__SENTRY_INTERCEPT_TRANSPORT__.push(request);
5415
5295
  return { statusCode: 200 };
5416
5296
  }
5417
- if (await shouldSendTelemetry) return nodeTransport.send(request);
5297
+ if (await shouldSendTelemetry) {
5298
+ if (process.env["SENTRY_TEST_OUT_DIR"]) {
5299
+ const { join } = await import("node:path");
5300
+ const { appendFileSync } = await import("node:fs");
5301
+ appendFileSync(join(process.env["SENTRY_TEST_OUT_DIR"], "sentry-telemetry.json"), JSON.stringify(request) + ",\n");
5302
+ return { statusCode: 200 };
5303
+ }
5304
+ return nodeTransport.send(request);
5305
+ }
5418
5306
  return { statusCode: 200 };
5419
5307
  }
5420
5308
  };
5421
5309
  };
5422
5310
  }
5423
-
5424
5311
  //#endregion
5425
5312
  //#region src/version.ts
5426
- const LIB_VERSION = "5.1.0";
5427
-
5313
+ const LIB_VERSION = "5.2.0";
5428
5314
  //#endregion
5429
5315
  //#region src/sentry/telemetry.ts
5430
5316
  const SENTRY_SAAS_HOSTNAME = "sentry.io";
@@ -5497,7 +5383,7 @@ function setTelemetryDataOnScope(options, scope, buildTool, buildToolMajorVersio
5497
5383
  async function allowedToSendTelemetry(options) {
5498
5384
  const { silent, org, project, authToken, url, headers, telemetry, release } = options;
5499
5385
  if (telemetry === false) return false;
5500
- if (url === SENTRY_SAAS_URL) return true;
5386
+ if (url === "https://sentry.io") return true;
5501
5387
  const cli = new _sentry_cli.default(null, {
5502
5388
  url,
5503
5389
  authToken,
@@ -5525,7 +5411,6 @@ async function safeFlushTelemetry(sentryClient) {
5525
5411
  await sentryClient.flush(2e3);
5526
5412
  } catch {}
5527
5413
  }
5528
-
5529
5414
  //#endregion
5530
5415
  //#region src/debug-id-upload.ts
5531
5416
  function createDebugIdUploadFunction({ sentryBuildPluginManager }) {
@@ -5627,7 +5512,10 @@ async function prepareSourceMapForDebugIdUpload(sourceMapPath, targetPath, debug
5627
5512
  logger.error(`Failed to parse source map for debug ID upload: ${sourceMapPath}`);
5628
5513
  return;
5629
5514
  }
5630
- if (map["sources"] && Array.isArray(map["sources"])) map["sources"] = map["sources"].map((source) => rewriteSourcesHook(source, map));
5515
+ if (map["sources"] && Array.isArray(map["sources"])) {
5516
+ const mapDir = path.default.dirname(sourceMapPath);
5517
+ map["sources"] = map["sources"].map((source) => rewriteSourcesHook(source, map, { mapDir }));
5518
+ }
5631
5519
  try {
5632
5520
  await util.promisify(fs.default.writeFile)(targetPath, JSON.stringify(map), { encoding: "utf8" });
5633
5521
  } catch (e) {
@@ -5640,7 +5528,6 @@ function defaultRewriteSourcesHook(source) {
5640
5528
  if (source.match(PROTOCOL_REGEX)) return source.replace(PROTOCOL_REGEX, "");
5641
5529
  else return path.default.relative(process.cwd(), path.default.normalize(source));
5642
5530
  }
5643
-
5644
5531
  //#endregion
5645
5532
  //#region src/build-plugin-manager.ts
5646
5533
  const _deployedReleases = /* @__PURE__ */ new Set();
@@ -5653,7 +5540,7 @@ function createCliInstance(options) {
5653
5540
  url: options.url,
5654
5541
  vcsRemote: options.release.vcsRemote,
5655
5542
  headers: {
5656
- ...getTraceData(),
5543
+ ...options.telemetry ? getTraceData() : {},
5657
5544
  ...options.headers
5658
5545
  }
5659
5546
  });
@@ -6071,7 +5958,6 @@ function canUploadSourceMaps(options, logger, isDevMode) {
6071
5958
  }
6072
5959
  return true;
6073
5960
  }
6074
-
6075
5961
  //#endregion
6076
5962
  //#region src/index.ts
6077
5963
  /**
@@ -6148,7 +6034,6 @@ function createComponentNameAnnotateHooks(ignoredComponents, injectIntoHtml) {
6148
6034
  function getDebugIdSnippet(debugId) {
6149
6035
  return new CodeInjection(`var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="${debugId}",e._sentryDebugIdIdentifier="sentry-dbid-${debugId}");`);
6150
6036
  }
6151
-
6152
6037
  //#endregion
6153
6038
  exports.COMMENT_USE_STRICT_REGEX = COMMENT_USE_STRICT_REGEX;
6154
6039
  exports.CodeInjection = CodeInjection;
@@ -6164,4 +6049,5 @@ exports.replaceBooleanFlagsInCode = replaceBooleanFlagsInCode;
6164
6049
  exports.sentryCliBinaryExists = sentryCliBinaryExists;
6165
6050
  exports.shouldSkipCodeInjection = shouldSkipCodeInjection;
6166
6051
  exports.stringToUUID = stringToUUID;
6052
+
6167
6053
  //# sourceMappingURL=index.js.map