@slicemachine/manager 0.26.3-beta.1 → 0.26.3-beta.3

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 (116) hide show
  1. package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.cjs +6 -6
  2. package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.js +4 -4
  3. package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.js.map +1 -1
  4. package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.cjs +4 -4
  5. package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.cjs.map +1 -1
  6. package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js +4 -4
  7. package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js.map +1 -1
  8. package/dist/errors.cjs +7 -0
  9. package/dist/errors.cjs.map +1 -1
  10. package/dist/errors.d.ts +5 -1
  11. package/dist/errors.js +7 -0
  12. package/dist/errors.js.map +1 -1
  13. package/dist/index.cjs +1 -0
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +2 -1
  17. package/dist/managers/customTypes/CustomTypesManager.cjs +17 -7
  18. package/dist/managers/customTypes/CustomTypesManager.cjs.map +1 -1
  19. package/dist/managers/customTypes/CustomTypesManager.js +19 -9
  20. package/dist/managers/customTypes/CustomTypesManager.js.map +1 -1
  21. package/package.json +2 -2
  22. package/src/errors.ts +12 -1
  23. package/src/index.ts +1 -0
  24. package/src/managers/customTypes/CustomTypesManager.ts +29 -18
  25. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/constants.cjs +0 -5
  26. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/constants.cjs.map +0 -1
  27. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/constants.js +0 -5
  28. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/constants.js.map +0 -1
  29. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/debug-build.cjs +0 -5
  30. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/debug-build.cjs.map +0 -1
  31. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/debug-build.js +0 -5
  32. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/debug-build.js.map +0 -1
  33. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.cjs +0 -29
  34. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.cjs.map +0 -1
  35. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.js +0 -29
  36. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.js.map +0 -1
  37. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.cjs +0 -17
  38. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.cjs.map +0 -1
  39. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.js +0 -17
  40. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.js.map +0 -1
  41. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.cjs +0 -535
  42. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.cjs.map +0 -1
  43. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.js +0 -535
  44. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.js.map +0 -1
  45. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/scope.cjs +0 -545
  46. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/scope.cjs.map +0 -1
  47. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/scope.js +0 -545
  48. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/scope.js.map +0 -1
  49. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.cjs +0 -109
  50. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.cjs.map +0 -1
  51. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.js +0 -109
  52. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.js.map +0 -1
  53. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.cjs +0 -50
  54. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.cjs.map +0 -1
  55. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js +0 -50
  56. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js.map +0 -1
  57. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.cjs +0 -85
  58. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.cjs.map +0 -1
  59. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js +0 -85
  60. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js.map +0 -1
  61. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/getRootSpan.cjs +0 -7
  62. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/getRootSpan.cjs.map +0 -1
  63. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/getRootSpan.js +0 -7
  64. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/getRootSpan.js.map +0 -1
  65. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.cjs +0 -35
  66. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.cjs.map +0 -1
  67. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.js +0 -35
  68. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.js.map +0 -1
  69. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/spanUtils.cjs +0 -39
  70. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/spanUtils.cjs.map +0 -1
  71. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/spanUtils.js +0 -39
  72. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/spanUtils.js.map +0 -1
  73. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/version.cjs +0 -5
  74. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/version.cjs.map +0 -1
  75. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/version.js +0 -5
  76. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/version.js.map +0 -1
  77. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/debug-build.cjs +0 -5
  78. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/debug-build.cjs.map +0 -1
  79. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/debug-build.js +0 -5
  80. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/debug-build.js.map +0 -1
  81. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.cjs +0 -15
  82. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.cjs.map +0 -1
  83. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.js +0 -15
  84. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.js.map +0 -1
  85. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.cjs +0 -69
  86. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.cjs.map +0 -1
  87. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.js +0 -69
  88. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.js.map +0 -1
  89. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.cjs +0 -34
  90. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.cjs.map +0 -1
  91. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.js +0 -34
  92. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.js.map +0 -1
  93. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.cjs +0 -49
  94. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.cjs.map +0 -1
  95. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.js +0 -49
  96. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.js.map +0 -1
  97. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.cjs +0 -142
  98. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.cjs.map +0 -1
  99. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.js +0 -142
  100. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.js.map +0 -1
  101. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/time.cjs +0 -45
  102. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/time.cjs.map +0 -1
  103. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/time.js +0 -45
  104. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/time.js.map +0 -1
  105. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.cjs +0 -18
  106. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.cjs.map +0 -1
  107. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.js +0 -18
  108. package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.js.map +0 -1
  109. package/dist/lib/checkIsSentryEnabled.d.ts +0 -9
  110. package/dist/lib/sentryErrorHandlers.cjs +0 -10
  111. package/dist/lib/sentryErrorHandlers.cjs.map +0 -1
  112. package/dist/lib/sentryErrorHandlers.d.ts +0 -1
  113. package/dist/lib/sentryErrorHandlers.js +0 -10
  114. package/dist/lib/sentryErrorHandlers.js.map +0 -1
  115. package/src/lib/checkIsSentryEnabled.ts +0 -12
  116. package/src/lib/sentryErrorHandlers.ts +0 -13
@@ -1 +0,0 @@
1
- {"version":3,"file":"prepareEvent.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/utils/prepareEvent.js"],"sourcesContent":["import { uuid4, dateTimestampInSeconds, addExceptionMechanism, truncate, GLOBAL_OBJ, normalize } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors.js';\nimport { getGlobalScope, Scope } from '../scope.js';\nimport { mergeScopeData, applyScopeDataToEvent } from './applyScopeDataToEvent.js';\nimport { spanToJSON } from './spanUtils.js';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nfunction prepareEvent(\n options,\n event,\n hint,\n scope,\n client,\n isolationScope,\n) {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;\n const prepared = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...clientEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event, options) {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\nconst debugIdStackParserCache = new WeakMap();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nfunction applyDebugIds(event, stackParser) {\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n if (!debugIdMap) {\n return;\n }\n\n let debugIdStackFramesCache;\n const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n if (cachedDebugIdStackFrameCache) {\n debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n } else {\n debugIdStackFramesCache = new Map();\n debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n }\n\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = Object.keys(debugIdMap).reduce((acc, debugIdStackTrace) => {\n let parsedStack;\n const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n if (cachedParsedStack) {\n parsedStack = cachedParsedStack;\n } else {\n parsedStack = stackParser(debugIdStackTrace);\n debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n }\n\n for (let i = parsedStack.length - 1; i >= 0; i--) {\n const stackFrame = parsedStack[i];\n if (stackFrame.filename) {\n acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n break;\n }\n }\n return acc;\n }, {});\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nfunction applyDebugMeta(event) {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.keys(filenameDebugIdMap).forEach(filename => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id: filenameDebugIdMap[filename],\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event, integrationNames) {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event, depth, maxBreadth) {\n if (!event) {\n return null;\n }\n\n const normalized = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n const data = spanToJSON(span).data;\n\n if (data) {\n // This is a bit weird, as we generally have `Span` instances here, but to be safe we do not assume so\n // eslint-disable-next-line deprecation/deprecation\n span.data = normalize(data, depth, maxBreadth);\n }\n\n return span;\n });\n }\n\n return normalized;\n}\n\nfunction getFinalScope(scope, captureContext) {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nfunction parseEventHintOrCaptureContext(\n hint,\n) {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(\n hint,\n) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\nconst captureContextKeys = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'requestSession',\n 'propagationContext',\n] ;\n\nfunction hintIsScopeContext(hint) {\n return Object.keys(hint).some(key => captureContextKeys.includes(key ));\n}\n\nexport { applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext, prepareEvent };\n//# sourceMappingURL=prepareEvent.js.map\n"],"names":["Scope"],"mappings":";;;AAuVA,SAAS,+BACP,MACA;AACA,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAGA,MAAI,sBAAsB,IAAI,GAAG;AAC/B,WAAO,EAAE,gBAAgB,KAAI;AAAA,EAC/B;AAEA,MAAI,mBAAmB,IAAI,GAAG;AAC5B,WAAO;AAAA,MACL,gBAAgB;AAAA,IACtB;AAAA,EACE;AAEA,SAAO;AACT;AAEA,SAAS,sBACP,MACA;AACA,SAAO,gBAAgBA,MAAAA,SAAS,OAAO,SAAS;AAClD;AAEA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,mBAAmB,MAAM;AAChC,SAAO,OAAO,KAAK,IAAI,EAAE,KAAK,SAAO,mBAAmB,SAAS,IAAK;AACxE;;","x_google_ignoreList":[0]}
@@ -1,35 +0,0 @@
1
- import { Scope } from "../scope.js";
2
- function parseEventHintOrCaptureContext(hint) {
3
- if (!hint) {
4
- return void 0;
5
- }
6
- if (hintIsScopeOrFunction(hint)) {
7
- return { captureContext: hint };
8
- }
9
- if (hintIsScopeContext(hint)) {
10
- return {
11
- captureContext: hint
12
- };
13
- }
14
- return hint;
15
- }
16
- function hintIsScopeOrFunction(hint) {
17
- return hint instanceof Scope || typeof hint === "function";
18
- }
19
- const captureContextKeys = [
20
- "user",
21
- "level",
22
- "extra",
23
- "contexts",
24
- "tags",
25
- "fingerprint",
26
- "requestSession",
27
- "propagationContext"
28
- ];
29
- function hintIsScopeContext(hint) {
30
- return Object.keys(hint).some((key) => captureContextKeys.includes(key));
31
- }
32
- export {
33
- parseEventHintOrCaptureContext
34
- };
35
- //# sourceMappingURL=prepareEvent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prepareEvent.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/utils/prepareEvent.js"],"sourcesContent":["import { uuid4, dateTimestampInSeconds, addExceptionMechanism, truncate, GLOBAL_OBJ, normalize } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors.js';\nimport { getGlobalScope, Scope } from '../scope.js';\nimport { mergeScopeData, applyScopeDataToEvent } from './applyScopeDataToEvent.js';\nimport { spanToJSON } from './spanUtils.js';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nfunction prepareEvent(\n options,\n event,\n hint,\n scope,\n client,\n isolationScope,\n) {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;\n const prepared = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...clientEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event, options) {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\nconst debugIdStackParserCache = new WeakMap();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nfunction applyDebugIds(event, stackParser) {\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n if (!debugIdMap) {\n return;\n }\n\n let debugIdStackFramesCache;\n const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n if (cachedDebugIdStackFrameCache) {\n debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n } else {\n debugIdStackFramesCache = new Map();\n debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n }\n\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = Object.keys(debugIdMap).reduce((acc, debugIdStackTrace) => {\n let parsedStack;\n const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n if (cachedParsedStack) {\n parsedStack = cachedParsedStack;\n } else {\n parsedStack = stackParser(debugIdStackTrace);\n debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n }\n\n for (let i = parsedStack.length - 1; i >= 0; i--) {\n const stackFrame = parsedStack[i];\n if (stackFrame.filename) {\n acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n break;\n }\n }\n return acc;\n }, {});\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nfunction applyDebugMeta(event) {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.keys(filenameDebugIdMap).forEach(filename => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id: filenameDebugIdMap[filename],\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event, integrationNames) {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event, depth, maxBreadth) {\n if (!event) {\n return null;\n }\n\n const normalized = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n const data = spanToJSON(span).data;\n\n if (data) {\n // This is a bit weird, as we generally have `Span` instances here, but to be safe we do not assume so\n // eslint-disable-next-line deprecation/deprecation\n span.data = normalize(data, depth, maxBreadth);\n }\n\n return span;\n });\n }\n\n return normalized;\n}\n\nfunction getFinalScope(scope, captureContext) {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nfunction parseEventHintOrCaptureContext(\n hint,\n) {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(\n hint,\n) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\nconst captureContextKeys = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'requestSession',\n 'propagationContext',\n] ;\n\nfunction hintIsScopeContext(hint) {\n return Object.keys(hint).some(key => captureContextKeys.includes(key ));\n}\n\nexport { applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext, prepareEvent };\n//# sourceMappingURL=prepareEvent.js.map\n"],"names":[],"mappings":";AAuVA,SAAS,+BACP,MACA;AACA,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAGA,MAAI,sBAAsB,IAAI,GAAG;AAC/B,WAAO,EAAE,gBAAgB,KAAI;AAAA,EAC/B;AAEA,MAAI,mBAAmB,IAAI,GAAG;AAC5B,WAAO;AAAA,MACL,gBAAgB;AAAA,IACtB;AAAA,EACE;AAEA,SAAO;AACT;AAEA,SAAS,sBACP,MACA;AACA,SAAO,gBAAgB,SAAS,OAAO,SAAS;AAClD;AAEA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,mBAAmB,MAAM;AAChC,SAAO,OAAO,KAAK,IAAI,EAAE,KAAK,SAAO,mBAAmB,SAAS,IAAK;AACxE;","x_google_ignoreList":[0]}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const object = require("../../../utils/esm/object.cjs");
4
- const TRACE_FLAG_SAMPLED = 1;
5
- function spanToTraceContext(span) {
6
- const { spanId: span_id, traceId: trace_id } = span.spanContext();
7
- const { data, op, parent_span_id, status, tags, origin } = spanToJSON(span);
8
- return object.dropUndefinedKeys({
9
- data,
10
- op,
11
- parent_span_id,
12
- span_id,
13
- status,
14
- tags,
15
- trace_id,
16
- origin
17
- });
18
- }
19
- function spanToJSON(span) {
20
- if (spanIsSpanClass(span)) {
21
- return span.getSpanJSON();
22
- }
23
- if (typeof span.toJSON === "function") {
24
- return span.toJSON();
25
- }
26
- return {};
27
- }
28
- function spanIsSpanClass(span) {
29
- return typeof span.getSpanJSON === "function";
30
- }
31
- function spanIsSampled(span) {
32
- const { traceFlags } = span.spanContext();
33
- return Boolean(traceFlags & TRACE_FLAG_SAMPLED);
34
- }
35
- exports.TRACE_FLAG_SAMPLED = TRACE_FLAG_SAMPLED;
36
- exports.spanIsSampled = spanIsSampled;
37
- exports.spanToJSON = spanToJSON;
38
- exports.spanToTraceContext = spanToTraceContext;
39
- //# sourceMappingURL=spanUtils.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanUtils.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/utils/spanUtils.js"],"sourcesContent":["import { dropUndefinedKeys, generateSentryTraceHeader, timestampInSeconds } from '@sentry/utils';\n\n// These are aligned with OpenTelemetry trace flags\nconst TRACE_FLAG_NONE = 0x0;\nconst TRACE_FLAG_SAMPLED = 0x1;\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in an event.\n */\nfunction spanToTraceContext(span) {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { data, op, parent_span_id, status, tags, origin } = spanToJSON(span);\n\n return dropUndefinedKeys({\n data,\n op,\n parent_span_id,\n span_id,\n status,\n tags,\n trace_id,\n origin,\n });\n}\n\n/**\n * Convert a Span to a Sentry trace header.\n */\nfunction spanToTraceHeader(span) {\n const { traceId, spanId } = span.spanContext();\n const sampled = spanIsSampled(span);\n return generateSentryTraceHeader(traceId, spanId, sampled);\n}\n\n/**\n * Convert a span time input intp a timestamp in seconds.\n */\nfunction spanTimeInputToSeconds(input) {\n if (typeof input === 'number') {\n return ensureTimestampInSeconds(input);\n }\n\n if (Array.isArray(input)) {\n // See {@link HrTime} for the array-based time format\n return input[0] + input[1] / 1e9;\n }\n\n if (input instanceof Date) {\n return ensureTimestampInSeconds(input.getTime());\n }\n\n return timestampInSeconds();\n}\n\n/**\n * Converts a timestamp to second, if it was in milliseconds, or keeps it as second.\n */\nfunction ensureTimestampInSeconds(timestamp) {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Convert a span to a JSON representation.\n * Note that all fields returned here are optional and need to be guarded against.\n *\n * Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).\n * This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.\n * And `spanToJSON` needs the Span class from `span.ts` to check here.\n * TODO v8: When we remove the deprecated stuff from `span.ts`, we can remove the circular dependency again.\n */\nfunction spanToJSON(span) {\n if (spanIsSpanClass(span)) {\n return span.getSpanJSON();\n }\n\n // Fallback: We also check for `.toJSON()` here...\n // eslint-disable-next-line deprecation/deprecation\n if (typeof span.toJSON === 'function') {\n // eslint-disable-next-line deprecation/deprecation\n return span.toJSON();\n }\n\n return {};\n}\n\n/**\n * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof.\n * :( So instead we approximate this by checking if it has the `getSpanJSON` method.\n */\nfunction spanIsSpanClass(span) {\n return typeof (span ).getSpanJSON === 'function';\n}\n\n/**\n * Returns true if a span is sampled.\n * In most cases, you should just use `span.isRecording()` instead.\n * However, this has a slightly different semantic, as it also returns false if the span is finished.\n * So in the case where this distinction is important, use this method.\n */\nfunction spanIsSampled(span) {\n // We align our trace flags with the ones OpenTelemetry use\n // So we also check for sampled the same way they do.\n const { traceFlags } = span.spanContext();\n // eslint-disable-next-line no-bitwise\n return Boolean(traceFlags & TRACE_FLAG_SAMPLED);\n}\n\nexport { TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED, spanIsSampled, spanTimeInputToSeconds, spanToJSON, spanToTraceContext, spanToTraceHeader };\n//# sourceMappingURL=spanUtils.js.map\n"],"names":["dropUndefinedKeys"],"mappings":";;;AAIK,MAAC,qBAAqB;AAK3B,SAAS,mBAAmB,MAAM;AAChC,QAAM,EAAE,QAAQ,SAAS,SAAS,SAAQ,IAAK,KAAK,YAAW;AAC/D,QAAM,EAAE,MAAM,IAAI,gBAAgB,QAAQ,MAAM,OAAM,IAAK,WAAW,IAAI;AAE1E,SAAOA,yBAAkB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG;AACH;AAgDA,SAAS,WAAW,MAAM;AACxB,MAAI,gBAAgB,IAAI,GAAG;AACzB,WAAO,KAAK,YAAW;AAAA,EACzB;AAIA,MAAI,OAAO,KAAK,WAAW,YAAY;AAErC,WAAO,KAAK,OAAM;AAAA,EACpB;AAEA,SAAO,CAAA;AACT;AAMA,SAAS,gBAAgB,MAAM;AAC7B,SAAO,OAAQ,KAAO,gBAAgB;AACxC;AAQA,SAAS,cAAc,MAAM;AAG3B,QAAM,EAAE,WAAU,IAAK,KAAK,YAAW;AAEvC,SAAO,QAAQ,aAAa,kBAAkB;AAChD;;;;;","x_google_ignoreList":[0]}
@@ -1,39 +0,0 @@
1
- import { dropUndefinedKeys } from "../../../utils/esm/object.js";
2
- const TRACE_FLAG_SAMPLED = 1;
3
- function spanToTraceContext(span) {
4
- const { spanId: span_id, traceId: trace_id } = span.spanContext();
5
- const { data, op, parent_span_id, status, tags, origin } = spanToJSON(span);
6
- return dropUndefinedKeys({
7
- data,
8
- op,
9
- parent_span_id,
10
- span_id,
11
- status,
12
- tags,
13
- trace_id,
14
- origin
15
- });
16
- }
17
- function spanToJSON(span) {
18
- if (spanIsSpanClass(span)) {
19
- return span.getSpanJSON();
20
- }
21
- if (typeof span.toJSON === "function") {
22
- return span.toJSON();
23
- }
24
- return {};
25
- }
26
- function spanIsSpanClass(span) {
27
- return typeof span.getSpanJSON === "function";
28
- }
29
- function spanIsSampled(span) {
30
- const { traceFlags } = span.spanContext();
31
- return Boolean(traceFlags & TRACE_FLAG_SAMPLED);
32
- }
33
- export {
34
- TRACE_FLAG_SAMPLED,
35
- spanIsSampled,
36
- spanToJSON,
37
- spanToTraceContext
38
- };
39
- //# sourceMappingURL=spanUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanUtils.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/utils/spanUtils.js"],"sourcesContent":["import { dropUndefinedKeys, generateSentryTraceHeader, timestampInSeconds } from '@sentry/utils';\n\n// These are aligned with OpenTelemetry trace flags\nconst TRACE_FLAG_NONE = 0x0;\nconst TRACE_FLAG_SAMPLED = 0x1;\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in an event.\n */\nfunction spanToTraceContext(span) {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { data, op, parent_span_id, status, tags, origin } = spanToJSON(span);\n\n return dropUndefinedKeys({\n data,\n op,\n parent_span_id,\n span_id,\n status,\n tags,\n trace_id,\n origin,\n });\n}\n\n/**\n * Convert a Span to a Sentry trace header.\n */\nfunction spanToTraceHeader(span) {\n const { traceId, spanId } = span.spanContext();\n const sampled = spanIsSampled(span);\n return generateSentryTraceHeader(traceId, spanId, sampled);\n}\n\n/**\n * Convert a span time input intp a timestamp in seconds.\n */\nfunction spanTimeInputToSeconds(input) {\n if (typeof input === 'number') {\n return ensureTimestampInSeconds(input);\n }\n\n if (Array.isArray(input)) {\n // See {@link HrTime} for the array-based time format\n return input[0] + input[1] / 1e9;\n }\n\n if (input instanceof Date) {\n return ensureTimestampInSeconds(input.getTime());\n }\n\n return timestampInSeconds();\n}\n\n/**\n * Converts a timestamp to second, if it was in milliseconds, or keeps it as second.\n */\nfunction ensureTimestampInSeconds(timestamp) {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Convert a span to a JSON representation.\n * Note that all fields returned here are optional and need to be guarded against.\n *\n * Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).\n * This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.\n * And `spanToJSON` needs the Span class from `span.ts` to check here.\n * TODO v8: When we remove the deprecated stuff from `span.ts`, we can remove the circular dependency again.\n */\nfunction spanToJSON(span) {\n if (spanIsSpanClass(span)) {\n return span.getSpanJSON();\n }\n\n // Fallback: We also check for `.toJSON()` here...\n // eslint-disable-next-line deprecation/deprecation\n if (typeof span.toJSON === 'function') {\n // eslint-disable-next-line deprecation/deprecation\n return span.toJSON();\n }\n\n return {};\n}\n\n/**\n * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof.\n * :( So instead we approximate this by checking if it has the `getSpanJSON` method.\n */\nfunction spanIsSpanClass(span) {\n return typeof (span ).getSpanJSON === 'function';\n}\n\n/**\n * Returns true if a span is sampled.\n * In most cases, you should just use `span.isRecording()` instead.\n * However, this has a slightly different semantic, as it also returns false if the span is finished.\n * So in the case where this distinction is important, use this method.\n */\nfunction spanIsSampled(span) {\n // We align our trace flags with the ones OpenTelemetry use\n // So we also check for sampled the same way they do.\n const { traceFlags } = span.spanContext();\n // eslint-disable-next-line no-bitwise\n return Boolean(traceFlags & TRACE_FLAG_SAMPLED);\n}\n\nexport { TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED, spanIsSampled, spanTimeInputToSeconds, spanToJSON, spanToTraceContext, spanToTraceHeader };\n//# sourceMappingURL=spanUtils.js.map\n"],"names":[],"mappings":";AAIK,MAAC,qBAAqB;AAK3B,SAAS,mBAAmB,MAAM;AAChC,QAAM,EAAE,QAAQ,SAAS,SAAS,SAAQ,IAAK,KAAK,YAAW;AAC/D,QAAM,EAAE,MAAM,IAAI,gBAAgB,QAAQ,MAAM,OAAM,IAAK,WAAW,IAAI;AAE1E,SAAO,kBAAkB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG;AACH;AAgDA,SAAS,WAAW,MAAM;AACxB,MAAI,gBAAgB,IAAI,GAAG;AACzB,WAAO,KAAK,YAAW;AAAA,EACzB;AAIA,MAAI,OAAO,KAAK,WAAW,YAAY;AAErC,WAAO,KAAK,OAAM;AAAA,EACpB;AAEA,SAAO,CAAA;AACT;AAMA,SAAS,gBAAgB,MAAM;AAC7B,SAAO,OAAQ,KAAO,gBAAgB;AACxC;AAQA,SAAS,cAAc,MAAM;AAG3B,QAAM,EAAE,WAAU,IAAK,KAAK,YAAW;AAEvC,SAAO,QAAQ,aAAa,kBAAkB;AAChD;","x_google_ignoreList":[0]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SDK_VERSION = "7.116.0";
4
- exports.SDK_VERSION = SDK_VERSION;
5
- //# sourceMappingURL=version.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.cjs","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/version.js"],"sourcesContent":["const SDK_VERSION = '7.116.0';\n\nexport { SDK_VERSION };\n//# sourceMappingURL=version.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,cAAc;;","x_google_ignoreList":[0]}
@@ -1,5 +0,0 @@
1
- const SDK_VERSION = "7.116.0";
2
- export {
3
- SDK_VERSION
4
- };
5
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/version.js"],"sourcesContent":["const SDK_VERSION = '7.116.0';\n\nexport { SDK_VERSION };\n//# sourceMappingURL=version.js.map\n"],"names":[],"mappings":"AAAK,MAAC,cAAc;","x_google_ignoreList":[0]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
4
- exports.DEBUG_BUILD = DEBUG_BUILD;
5
- //# sourceMappingURL=debug-build.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-build.cjs","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/utils/esm/debug-build.js"],"sourcesContent":["/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n"],"names":[],"mappings":";;AAKK,MAAC,cAAe,OAAO,qBAAqB,eAAe;;","x_google_ignoreList":[0]}
@@ -1,5 +0,0 @@
1
- const DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
2
- export {
3
- DEBUG_BUILD
4
- };
5
- //# sourceMappingURL=debug-build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-build.js","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/utils/esm/debug-build.js"],"sourcesContent":["/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n"],"names":[],"mappings":"AAKK,MAAC,cAAe,OAAO,qBAAqB,eAAe;","x_google_ignoreList":[0]}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const objectToString = Object.prototype.toString;
4
- function isBuiltin(wat, className) {
5
- return objectToString.call(wat) === `[object ${className}]`;
6
- }
7
- function isPlainObject(wat) {
8
- return isBuiltin(wat, "Object");
9
- }
10
- function isThenable(wat) {
11
- return Boolean(wat && wat.then && typeof wat.then === "function");
12
- }
13
- exports.isPlainObject = isPlainObject;
14
- exports.isThenable = isThenable;
15
- //# sourceMappingURL=is.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is.cjs","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/utils/esm/is.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isError(wat) {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat, className) {\n return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isErrorEvent(wat) {\n return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMError(wat) {\n return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMException(wat) {\n return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isString(wat) {\n return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given string is parameterized\n * {@link isParameterizedString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isParameterizedString(wat) {\n return (\n typeof wat === 'object' &&\n wat !== null &&\n '__sentry_template_string__' in wat &&\n '__sentry_template_values__' in wat\n );\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPrimitive(wat) {\n return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal, or a class instance.\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPlainObject(wat) {\n return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isEvent(wat) {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isElement(wat) {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isRegExp(wat) {\n return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nfunction isThenable(wat) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isSyntheticEvent(wat) {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value is NaN\n * {@link isNaN}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isNaN(wat) {\n return typeof wat === 'number' && wat !== wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nfunction isInstanceOf(wat, base) {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n\n/**\n * Checks whether given value's type is a Vue ViewModel.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isVueViewModel(wat) {\n // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.\n return !!(typeof wat === 'object' && wat !== null && ((wat ).__isVue || (wat )._isVue));\n}\n\nexport { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isNaN, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isString, isSyntheticEvent, isThenable, isVueViewModel };\n//# sourceMappingURL=is.js.map\n"],"names":[],"mappings":";;AACA,MAAM,iBAAiB,OAAO,UAAU;AA0BxC,SAAS,UAAU,KAAK,WAAW;AACjC,SAAO,eAAe,KAAK,GAAG,MAAM,WAAW,SAAS;AAC1D;AAgFA,SAAS,cAAc,KAAK;AAC1B,SAAO,UAAU,KAAK,QAAQ;AAChC;AAuCA,SAAS,WAAW,KAAK;AAEvB,SAAO,QAAQ,OAAO,IAAI,QAAQ,OAAO,IAAI,SAAS,UAAU;AAClE;;;","x_google_ignoreList":[0]}
@@ -1,15 +0,0 @@
1
- const objectToString = Object.prototype.toString;
2
- function isBuiltin(wat, className) {
3
- return objectToString.call(wat) === `[object ${className}]`;
4
- }
5
- function isPlainObject(wat) {
6
- return isBuiltin(wat, "Object");
7
- }
8
- function isThenable(wat) {
9
- return Boolean(wat && wat.then && typeof wat.then === "function");
10
- }
11
- export {
12
- isPlainObject,
13
- isThenable
14
- };
15
- //# sourceMappingURL=is.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is.js","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/utils/esm/is.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isError(wat) {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat, className) {\n return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isErrorEvent(wat) {\n return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMError(wat) {\n return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMException(wat) {\n return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isString(wat) {\n return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given string is parameterized\n * {@link isParameterizedString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isParameterizedString(wat) {\n return (\n typeof wat === 'object' &&\n wat !== null &&\n '__sentry_template_string__' in wat &&\n '__sentry_template_values__' in wat\n );\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPrimitive(wat) {\n return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal, or a class instance.\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPlainObject(wat) {\n return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isEvent(wat) {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isElement(wat) {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isRegExp(wat) {\n return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nfunction isThenable(wat) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isSyntheticEvent(wat) {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value is NaN\n * {@link isNaN}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isNaN(wat) {\n return typeof wat === 'number' && wat !== wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nfunction isInstanceOf(wat, base) {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n\n/**\n * Checks whether given value's type is a Vue ViewModel.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isVueViewModel(wat) {\n // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.\n return !!(typeof wat === 'object' && wat !== null && ((wat ).__isVue || (wat )._isVue));\n}\n\nexport { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isNaN, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isString, isSyntheticEvent, isThenable, isVueViewModel };\n//# sourceMappingURL=is.js.map\n"],"names":[],"mappings":"AACA,MAAM,iBAAiB,OAAO,UAAU;AA0BxC,SAAS,UAAU,KAAK,WAAW;AACjC,SAAO,eAAe,KAAK,GAAG,MAAM,WAAW,SAAS;AAC1D;AAgFA,SAAS,cAAc,KAAK;AAC1B,SAAO,UAAU,KAAK,QAAQ;AAChC;AAuCA,SAAS,WAAW,KAAK;AAEvB,SAAO,QAAQ,OAAO,IAAI,QAAQ,OAAO,IAAI,SAAS,UAAU;AAClE;","x_google_ignoreList":[0]}
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const debugBuild = require("./debug-build.cjs");
4
- const worldwide = require("./worldwide.cjs");
5
- const PREFIX = "Sentry Logger ";
6
- const CONSOLE_LEVELS = [
7
- "debug",
8
- "info",
9
- "warn",
10
- "error",
11
- "log",
12
- "assert",
13
- "trace"
14
- ];
15
- const originalConsoleMethods = {};
16
- function consoleSandbox(callback) {
17
- if (!("console" in worldwide.GLOBAL_OBJ)) {
18
- return callback();
19
- }
20
- const console = worldwide.GLOBAL_OBJ.console;
21
- const wrappedFuncs = {};
22
- const wrappedLevels = Object.keys(originalConsoleMethods);
23
- wrappedLevels.forEach((level) => {
24
- const originalConsoleMethod = originalConsoleMethods[level];
25
- wrappedFuncs[level] = console[level];
26
- console[level] = originalConsoleMethod;
27
- });
28
- try {
29
- return callback();
30
- } finally {
31
- wrappedLevels.forEach((level) => {
32
- console[level] = wrappedFuncs[level];
33
- });
34
- }
35
- }
36
- function makeLogger() {
37
- let enabled = false;
38
- const logger2 = {
39
- enable: () => {
40
- enabled = true;
41
- },
42
- disable: () => {
43
- enabled = false;
44
- },
45
- isEnabled: () => enabled
46
- };
47
- if (debugBuild.DEBUG_BUILD) {
48
- CONSOLE_LEVELS.forEach((name) => {
49
- logger2[name] = (...args) => {
50
- if (enabled) {
51
- consoleSandbox(() => {
52
- worldwide.GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);
53
- });
54
- }
55
- };
56
- });
57
- } else {
58
- CONSOLE_LEVELS.forEach((name) => {
59
- logger2[name] = () => void 0;
60
- });
61
- }
62
- return logger2;
63
- }
64
- const logger = makeLogger();
65
- exports.CONSOLE_LEVELS = CONSOLE_LEVELS;
66
- exports.consoleSandbox = consoleSandbox;
67
- exports.logger = logger;
68
- exports.originalConsoleMethods = originalConsoleMethods;
69
- //# sourceMappingURL=logger.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.cjs","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/utils/esm/logger.js"],"sourcesContent":["import { DEBUG_BUILD } from './debug-build.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nconst CONSOLE_LEVELS = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] ;\n\n/** This may be mutated by the console instrumentation. */\nconst originalConsoleMethods\n\n = {};\n\n/** JSDoc */\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nfunction consoleSandbox(callback) {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console ;\n const wrappedFuncs = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) ;\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level] ;\n wrappedFuncs[level] = console[level] ;\n console[level] = originalConsoleMethod;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] ;\n });\n }\n}\n\nfunction makeLogger() {\n let enabled = false;\n const logger = {\n enable: () => {\n enabled = true;\n },\n disable: () => {\n enabled = false;\n },\n isEnabled: () => enabled,\n };\n\n if (DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(name => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n logger[name] = (...args) => {\n if (enabled) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = () => undefined;\n });\n }\n\n return logger ;\n}\n\nconst logger = makeLogger();\n\nexport { CONSOLE_LEVELS, consoleSandbox, logger, originalConsoleMethods };\n//# sourceMappingURL=logger.js.map\n"],"names":["GLOBAL_OBJ","logger","DEBUG_BUILD"],"mappings":";;;;AAIA,MAAM,SAAS;AAEV,MAAC,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGK,MAAC,yBAEH,CAAA;AAUH,SAAS,eAAe,UAAU;AAChC,MAAI,EAAE,aAAaA,UAAAA,aAAa;AAC9B,WAAO,SAAQ;AAAA,EACjB;AAEA,QAAM,UAAUA,UAAAA,WAAW;AAC3B,QAAM,eAAe,CAAA;AAErB,QAAM,gBAAgB,OAAO,KAAK,sBAAsB;AAGxD,gBAAc,QAAQ,WAAS;AAC7B,UAAM,wBAAwB,uBAAuB,KAAK;AAC1D,iBAAa,KAAK,IAAI,QAAQ,KAAK;AACnC,YAAQ,KAAK,IAAI;AAAA,EACnB,CAAC;AAED,MAAI;AACF,WAAO,SAAQ;AAAA,EACjB,UAAC;AAEC,kBAAc,QAAQ,WAAS;AAC7B,cAAQ,KAAK,IAAI,aAAa,KAAK;AAAA,IACrC,CAAC;AAAA,EACH;AACF;AAEA,SAAS,aAAa;AACpB,MAAI,UAAU;AACd,QAAMC,UAAS;AAAA,IACb,QAAQ,MAAM;AACZ,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,gBAAU;AAAA,IACZ;AAAA,IACA,WAAW,MAAM;AAAA,EACrB;AAEE,MAAIC,wBAAa;AACf,mBAAe,QAAQ,UAAQ;AAE7B,MAAAD,QAAO,IAAI,IAAI,IAAI,SAAS;AAC1B,YAAI,SAAS;AACX,yBAAe,MAAM;AACnBD,sBAAAA,WAAW,QAAQ,IAAI,EAAE,GAAG,MAAM,IAAI,IAAI,MAAM,GAAG,IAAI;AAAA,UACzD,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,mBAAe,QAAQ,UAAQ;AAC7B,MAAAC,QAAO,IAAI,IAAI,MAAM;AAAA,IACvB,CAAC;AAAA,EACH;AAEA,SAAOA;AACT;AAEK,MAAC,SAAS,WAAU;;;;;","x_google_ignoreList":[0]}
@@ -1,69 +0,0 @@
1
- import { DEBUG_BUILD } from "./debug-build.js";
2
- import { GLOBAL_OBJ } from "./worldwide.js";
3
- const PREFIX = "Sentry Logger ";
4
- const CONSOLE_LEVELS = [
5
- "debug",
6
- "info",
7
- "warn",
8
- "error",
9
- "log",
10
- "assert",
11
- "trace"
12
- ];
13
- const originalConsoleMethods = {};
14
- function consoleSandbox(callback) {
15
- if (!("console" in GLOBAL_OBJ)) {
16
- return callback();
17
- }
18
- const console = GLOBAL_OBJ.console;
19
- const wrappedFuncs = {};
20
- const wrappedLevels = Object.keys(originalConsoleMethods);
21
- wrappedLevels.forEach((level) => {
22
- const originalConsoleMethod = originalConsoleMethods[level];
23
- wrappedFuncs[level] = console[level];
24
- console[level] = originalConsoleMethod;
25
- });
26
- try {
27
- return callback();
28
- } finally {
29
- wrappedLevels.forEach((level) => {
30
- console[level] = wrappedFuncs[level];
31
- });
32
- }
33
- }
34
- function makeLogger() {
35
- let enabled = false;
36
- const logger2 = {
37
- enable: () => {
38
- enabled = true;
39
- },
40
- disable: () => {
41
- enabled = false;
42
- },
43
- isEnabled: () => enabled
44
- };
45
- if (DEBUG_BUILD) {
46
- CONSOLE_LEVELS.forEach((name) => {
47
- logger2[name] = (...args) => {
48
- if (enabled) {
49
- consoleSandbox(() => {
50
- GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);
51
- });
52
- }
53
- };
54
- });
55
- } else {
56
- CONSOLE_LEVELS.forEach((name) => {
57
- logger2[name] = () => void 0;
58
- });
59
- }
60
- return logger2;
61
- }
62
- const logger = makeLogger();
63
- export {
64
- CONSOLE_LEVELS,
65
- consoleSandbox,
66
- logger,
67
- originalConsoleMethods
68
- };
69
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/utils/esm/logger.js"],"sourcesContent":["import { DEBUG_BUILD } from './debug-build.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nconst CONSOLE_LEVELS = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] ;\n\n/** This may be mutated by the console instrumentation. */\nconst originalConsoleMethods\n\n = {};\n\n/** JSDoc */\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nfunction consoleSandbox(callback) {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console ;\n const wrappedFuncs = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) ;\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level] ;\n wrappedFuncs[level] = console[level] ;\n console[level] = originalConsoleMethod;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] ;\n });\n }\n}\n\nfunction makeLogger() {\n let enabled = false;\n const logger = {\n enable: () => {\n enabled = true;\n },\n disable: () => {\n enabled = false;\n },\n isEnabled: () => enabled,\n };\n\n if (DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(name => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n logger[name] = (...args) => {\n if (enabled) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = () => undefined;\n });\n }\n\n return logger ;\n}\n\nconst logger = makeLogger();\n\nexport { CONSOLE_LEVELS, consoleSandbox, logger, originalConsoleMethods };\n//# sourceMappingURL=logger.js.map\n"],"names":["logger"],"mappings":";;AAIA,MAAM,SAAS;AAEV,MAAC,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGK,MAAC,yBAEH,CAAA;AAUH,SAAS,eAAe,UAAU;AAChC,MAAI,EAAE,aAAa,aAAa;AAC9B,WAAO,SAAQ;AAAA,EACjB;AAEA,QAAM,UAAU,WAAW;AAC3B,QAAM,eAAe,CAAA;AAErB,QAAM,gBAAgB,OAAO,KAAK,sBAAsB;AAGxD,gBAAc,QAAQ,WAAS;AAC7B,UAAM,wBAAwB,uBAAuB,KAAK;AAC1D,iBAAa,KAAK,IAAI,QAAQ,KAAK;AACnC,YAAQ,KAAK,IAAI;AAAA,EACnB,CAAC;AAED,MAAI;AACF,WAAO,SAAQ;AAAA,EACjB,UAAC;AAEC,kBAAc,QAAQ,WAAS;AAC7B,cAAQ,KAAK,IAAI,aAAa,KAAK;AAAA,IACrC,CAAC;AAAA,EACH;AACF;AAEA,SAAS,aAAa;AACpB,MAAI,UAAU;AACd,QAAMA,UAAS;AAAA,IACb,QAAQ,MAAM;AACZ,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,gBAAU;AAAA,IACZ;AAAA,IACA,WAAW,MAAM;AAAA,EACrB;AAEE,MAAI,aAAa;AACf,mBAAe,QAAQ,UAAQ;AAE7B,MAAAA,QAAO,IAAI,IAAI,IAAI,SAAS;AAC1B,YAAI,SAAS;AACX,yBAAe,MAAM;AACnB,uBAAW,QAAQ,IAAI,EAAE,GAAG,MAAM,IAAI,IAAI,MAAM,GAAG,IAAI;AAAA,UACzD,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,mBAAe,QAAQ,UAAQ;AAC7B,MAAAA,QAAO,IAAI,IAAI,MAAM;AAAA,IACvB,CAAC;AAAA,EACH;AAEA,SAAOA;AACT;AAEK,MAAC,SAAS,WAAU;","x_google_ignoreList":[0]}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const worldwide = require("./worldwide.cjs");
4
- function uuid4() {
5
- const gbl = worldwide.GLOBAL_OBJ;
6
- const crypto = gbl.crypto || gbl.msCrypto;
7
- let getRandomByte = () => Math.random() * 16;
8
- try {
9
- if (crypto && crypto.randomUUID) {
10
- return crypto.randomUUID().replace(/-/g, "");
11
- }
12
- if (crypto && crypto.getRandomValues) {
13
- getRandomByte = () => {
14
- const typedArray = new Uint8Array(1);
15
- crypto.getRandomValues(typedArray);
16
- return typedArray[0];
17
- };
18
- }
19
- } catch (_) {
20
- }
21
- return ("10000000100040008000" + 1e11).replace(
22
- /[018]/g,
23
- (c) => (
24
- // eslint-disable-next-line no-bitwise
25
- (c ^ (getRandomByte() & 15) >> c / 4).toString(16)
26
- )
27
- );
28
- }
29
- function arrayify(maybeArray) {
30
- return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
31
- }
32
- exports.arrayify = arrayify;
33
- exports.uuid4 = uuid4;
34
- //# sourceMappingURL=misc.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"misc.cjs","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/utils/esm/misc.js"],"sourcesContent":["import { addNonEnumerableProperty } from './object.js';\nimport { snipLine } from './string.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nfunction uuid4() {\n const gbl = GLOBAL_OBJ ;\n const crypto = gbl.crypto || gbl.msCrypto;\n\n let getRandomByte = () => Math.random() * 16;\n try {\n if (crypto && crypto.randomUUID) {\n return crypto.randomUUID().replace(/-/g, '');\n }\n if (crypto && crypto.getRandomValues) {\n getRandomByte = () => {\n // crypto.getRandomValues might return undefined instead of the typed array\n // in old Chromium versions (e.g. 23.0.1235.0 (151422))\n // However, `typedArray` is still filled in-place.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray\n const typedArray = new Uint8Array(1);\n crypto.getRandomValues(typedArray);\n return typedArray[0];\n };\n }\n } catch (_) {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n // eslint-disable-next-line no-bitwise\n ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16),\n );\n}\n\nfunction getFirstException(event) {\n return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nfunction getEventDescription(event) {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\n\n const firstException = getFirstException(event);\n if (firstException) {\n if (firstException.type && firstException.value) {\n return `${firstException.type}: ${firstException.value}`;\n }\n return firstException.type || firstException.value || eventId || '<unknown>';\n }\n return eventId || '<unknown>';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nfunction addExceptionTypeValue(event, value, type) {\n const exception = (event.exception = event.exception || {});\n const values = (exception.values = exception.values || []);\n const firstException = (values[0] = values[0] || {});\n if (!firstException.value) {\n firstException.value = value || '';\n }\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nfunction addExceptionMechanism(event, newMechanism) {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nfunction parseSemver(input) {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nfunction addContextToFrame(lines, frame, linesOfContext = 5) {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nfunction checkOrSetAlreadyCaught(exception) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && (exception ).__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception , '__sentry_captured__', true);\n } catch (err) {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nfunction arrayify(maybeArray) {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n\nexport { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, arrayify, checkOrSetAlreadyCaught, getEventDescription, parseSemver, uuid4 };\n//# sourceMappingURL=misc.js.map\n"],"names":["GLOBAL_OBJ"],"mappings":";;;AASA,SAAS,QAAQ;AACf,QAAM,MAAMA,UAAAA;AACZ,QAAM,SAAS,IAAI,UAAU,IAAI;AAEjC,MAAI,gBAAgB,MAAM,KAAK,OAAM,IAAK;AAC1C,MAAI;AACF,QAAI,UAAU,OAAO,YAAY;AAC/B,aAAO,OAAO,WAAU,EAAG,QAAQ,MAAM,EAAE;AAAA,IAC7C;AACA,QAAI,UAAU,OAAO,iBAAiB;AACpC,sBAAgB,MAAM;AAKpB,cAAM,aAAa,IAAI,WAAW,CAAC;AACnC,eAAO,gBAAgB,UAAU;AACjC,eAAO,WAAW,CAAC;AAAA,MACrB;AAAA,IACF;AAAA,EACF,SAAS,GAAG;AAAA,EAGZ;AAIA,UAAS,yBAA4B,MAAM;AAAA,IAAQ;AAAA,IAAU;AAAA;AAAA,OAEzD,KAAQ,cAAa,IAAK,OAAS,IAAM,GAAK,SAAS,EAAE;AAAA;AAAA,EAC/D;AACA;AAqKA,SAAS,SAAS,YAAY;AAC5B,SAAO,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAC,UAAU;AAC7D;;;","x_google_ignoreList":[0]}
@@ -1,34 +0,0 @@
1
- import { GLOBAL_OBJ } from "./worldwide.js";
2
- function uuid4() {
3
- const gbl = GLOBAL_OBJ;
4
- const crypto = gbl.crypto || gbl.msCrypto;
5
- let getRandomByte = () => Math.random() * 16;
6
- try {
7
- if (crypto && crypto.randomUUID) {
8
- return crypto.randomUUID().replace(/-/g, "");
9
- }
10
- if (crypto && crypto.getRandomValues) {
11
- getRandomByte = () => {
12
- const typedArray = new Uint8Array(1);
13
- crypto.getRandomValues(typedArray);
14
- return typedArray[0];
15
- };
16
- }
17
- } catch (_) {
18
- }
19
- return ("10000000100040008000" + 1e11).replace(
20
- /[018]/g,
21
- (c) => (
22
- // eslint-disable-next-line no-bitwise
23
- (c ^ (getRandomByte() & 15) >> c / 4).toString(16)
24
- )
25
- );
26
- }
27
- function arrayify(maybeArray) {
28
- return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
29
- }
30
- export {
31
- arrayify,
32
- uuid4
33
- };
34
- //# sourceMappingURL=misc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"misc.js","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/utils/esm/misc.js"],"sourcesContent":["import { addNonEnumerableProperty } from './object.js';\nimport { snipLine } from './string.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nfunction uuid4() {\n const gbl = GLOBAL_OBJ ;\n const crypto = gbl.crypto || gbl.msCrypto;\n\n let getRandomByte = () => Math.random() * 16;\n try {\n if (crypto && crypto.randomUUID) {\n return crypto.randomUUID().replace(/-/g, '');\n }\n if (crypto && crypto.getRandomValues) {\n getRandomByte = () => {\n // crypto.getRandomValues might return undefined instead of the typed array\n // in old Chromium versions (e.g. 23.0.1235.0 (151422))\n // However, `typedArray` is still filled in-place.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray\n const typedArray = new Uint8Array(1);\n crypto.getRandomValues(typedArray);\n return typedArray[0];\n };\n }\n } catch (_) {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n // eslint-disable-next-line no-bitwise\n ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16),\n );\n}\n\nfunction getFirstException(event) {\n return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nfunction getEventDescription(event) {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\n\n const firstException = getFirstException(event);\n if (firstException) {\n if (firstException.type && firstException.value) {\n return `${firstException.type}: ${firstException.value}`;\n }\n return firstException.type || firstException.value || eventId || '<unknown>';\n }\n return eventId || '<unknown>';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nfunction addExceptionTypeValue(event, value, type) {\n const exception = (event.exception = event.exception || {});\n const values = (exception.values = exception.values || []);\n const firstException = (values[0] = values[0] || {});\n if (!firstException.value) {\n firstException.value = value || '';\n }\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nfunction addExceptionMechanism(event, newMechanism) {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nfunction parseSemver(input) {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nfunction addContextToFrame(lines, frame, linesOfContext = 5) {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nfunction checkOrSetAlreadyCaught(exception) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && (exception ).__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception , '__sentry_captured__', true);\n } catch (err) {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nfunction arrayify(maybeArray) {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n\nexport { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, arrayify, checkOrSetAlreadyCaught, getEventDescription, parseSemver, uuid4 };\n//# sourceMappingURL=misc.js.map\n"],"names":[],"mappings":";AASA,SAAS,QAAQ;AACf,QAAM,MAAM;AACZ,QAAM,SAAS,IAAI,UAAU,IAAI;AAEjC,MAAI,gBAAgB,MAAM,KAAK,OAAM,IAAK;AAC1C,MAAI;AACF,QAAI,UAAU,OAAO,YAAY;AAC/B,aAAO,OAAO,WAAU,EAAG,QAAQ,MAAM,EAAE;AAAA,IAC7C;AACA,QAAI,UAAU,OAAO,iBAAiB;AACpC,sBAAgB,MAAM;AAKpB,cAAM,aAAa,IAAI,WAAW,CAAC;AACnC,eAAO,gBAAgB,UAAU;AACjC,eAAO,WAAW,CAAC;AAAA,MACrB;AAAA,IACF;AAAA,EACF,SAAS,GAAG;AAAA,EAGZ;AAIA,UAAS,yBAA4B,MAAM;AAAA,IAAQ;AAAA,IAAU;AAAA;AAAA,OAEzD,KAAQ,cAAa,IAAK,OAAS,IAAM,GAAK,SAAS,EAAE;AAAA;AAAA,EAC/D;AACA;AAqKA,SAAS,SAAS,YAAY;AAC5B,SAAO,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAC,UAAU;AAC7D;","x_google_ignoreList":[0]}