@sentry/cloudflare 11.0.0-rc.0 → 11.0.0-rc.1

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 (58) hide show
  1. package/build/cjs/dev/durableobject.js +26 -18
  2. package/build/cjs/dev/durableobject.js.map +1 -1
  3. package/build/cjs/dev/index.js +1 -1
  4. package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js +6 -0
  5. package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  6. package/build/cjs/dev/integrations/fetch.js +3 -101
  7. package/build/cjs/dev/integrations/fetch.js.map +1 -1
  8. package/build/cjs/dev/vite/flueRuntime.js +44 -0
  9. package/build/cjs/dev/vite/flueRuntime.js.map +1 -0
  10. package/build/cjs/dev/vite/index.js +2 -0
  11. package/build/cjs/dev/vite/index.js.map +1 -1
  12. package/build/cjs/prod/durableobject.js +26 -18
  13. package/build/cjs/prod/durableobject.js.map +1 -1
  14. package/build/cjs/prod/index.js +1 -1
  15. package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js +6 -0
  16. package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  17. package/build/cjs/prod/integrations/fetch.js +3 -101
  18. package/build/cjs/prod/integrations/fetch.js.map +1 -1
  19. package/build/cjs/prod/vite/flueRuntime.js +44 -0
  20. package/build/cjs/prod/vite/flueRuntime.js.map +1 -0
  21. package/build/cjs/prod/vite/index.js +2 -0
  22. package/build/cjs/prod/vite/index.js.map +1 -1
  23. package/build/esm/dev/durableobject.js +27 -19
  24. package/build/esm/dev/durableobject.js.map +1 -1
  25. package/build/esm/dev/index.js +2 -2
  26. package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js +6 -0
  27. package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  28. package/build/esm/dev/integrations/fetch.js +4 -102
  29. package/build/esm/dev/integrations/fetch.js.map +1 -1
  30. package/build/esm/dev/package.json +1 -1
  31. package/build/esm/dev/vite/flueRuntime.js +41 -0
  32. package/build/esm/dev/vite/flueRuntime.js.map +1 -0
  33. package/build/esm/dev/vite/index.js +2 -0
  34. package/build/esm/dev/vite/index.js.map +1 -1
  35. package/build/esm/prod/durableobject.js +27 -19
  36. package/build/esm/prod/durableobject.js.map +1 -1
  37. package/build/esm/prod/index.js +2 -2
  38. package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js +6 -0
  39. package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  40. package/build/esm/prod/integrations/fetch.js +4 -102
  41. package/build/esm/prod/integrations/fetch.js.map +1 -1
  42. package/build/esm/prod/package.json +1 -1
  43. package/build/esm/prod/vite/flueRuntime.js +41 -0
  44. package/build/esm/prod/vite/flueRuntime.js.map +1 -0
  45. package/build/esm/prod/vite/index.js +2 -0
  46. package/build/esm/prod/vite/index.js.map +1 -1
  47. package/build/types/durableobject.d.ts +3 -2
  48. package/build/types/durableobject.d.ts.map +1 -1
  49. package/build/types/index.d.ts +4 -2
  50. package/build/types/index.d.ts.map +1 -1
  51. package/build/types/instrumentations/instrumentDurableObjectNamespace.d.ts +1 -0
  52. package/build/types/instrumentations/instrumentDurableObjectNamespace.d.ts.map +1 -1
  53. package/build/types/integrations/fetch.d.ts +1 -15
  54. package/build/types/integrations/fetch.d.ts.map +1 -1
  55. package/build/types/vite/flueRuntime.d.ts +23 -0
  56. package/build/types/vite/flueRuntime.d.ts.map +1 -0
  57. package/build/types/vite/index.d.ts.map +1 -1
  58. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sources":["../../../../src/integrations/fetch.ts"],"sourcesContent":["import type {\n Client,\n FetchBreadcrumbData,\n FetchBreadcrumbHint,\n HandlerDataFetch,\n IntegrationFn,\n Span,\n} from '@sentry/core';\nimport {\n addBreadcrumb,\n addFetchInstrumentationHandler,\n defineIntegration,\n getBreadcrumbLogLevelFromHttpStatusCode,\n getClient,\n instrumentFetchRequest,\n isSentryRequestUrl,\n LRUMap,\n shouldPropagateTraceForUrl,\n} from '@sentry/core';\n\nconst INTEGRATION_NAME = 'Fetch' as const;\n\nconst HAS_CLIENT_MAP = new WeakMap<Client, boolean>();\n\nexport interface Options {\n /**\n * Whether breadcrumbs should be recorded for requests\n * Defaults to true\n */\n breadcrumbs: boolean;\n\n /**\n * Function determining whether or not to create spans to track outgoing requests to the given URL.\n * By default, spans will be created for all outgoing requests.\n */\n shouldCreateSpanForRequest?: (url: string) => boolean;\n}\n\nconst _fetchIntegration = ((options: Partial<Options> = {}) => {\n const breadcrumbs = options.breadcrumbs === undefined ? true : options.breadcrumbs;\n const shouldCreateSpanForRequest = options.shouldCreateSpanForRequest;\n\n const _createSpanUrlMap = new LRUMap<string, boolean>(100);\n const _headersUrlMap = new LRUMap<string, boolean>(100);\n\n const spans: Record<string, Span> = {};\n\n /** Decides whether to attach trace data to the outgoing fetch request */\n function _shouldAttachTraceData(url: string): boolean {\n const client = getClient();\n\n if (!client) {\n return false;\n }\n\n return shouldPropagateTraceForUrl(url, client.getOptions().tracePropagationTargets, _headersUrlMap);\n }\n\n /** Helper that wraps shouldCreateSpanForRequest option */\n function _shouldCreateSpan(url: string): boolean {\n if (shouldCreateSpanForRequest === undefined) {\n return true;\n }\n\n const cachedDecision = _createSpanUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = shouldCreateSpanForRequest(url);\n _createSpanUrlMap.set(url, decision);\n return decision;\n }\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n addFetchInstrumentationHandler(handlerData => {\n const client = getClient();\n const { propagateTraceparent } = client?.getOptions() || {};\n if (!client || !HAS_CLIENT_MAP.get(client)) {\n return;\n }\n\n if (isSentryRequestUrl(handlerData.fetchData.url, client)) {\n return;\n }\n\n instrumentFetchRequest(handlerData, _shouldCreateSpan, _shouldAttachTraceData, spans, {\n spanOrigin: 'auto.http.fetch',\n propagateTraceparent,\n });\n\n if (breadcrumbs) {\n createBreadcrumb(handlerData);\n }\n });\n },\n setup(client) {\n HAS_CLIENT_MAP.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Creates spans and attaches tracing headers to fetch requests.\n */\nexport const fetchIntegration = defineIntegration(_fetchIntegration);\n\nfunction createBreadcrumb(handlerData: HandlerDataFetch): void {\n const { startTimestamp, endTimestamp } = handlerData;\n\n // We only capture complete fetch requests\n if (!endTimestamp) {\n return;\n }\n\n const breadcrumbData: FetchBreadcrumbData = {\n method: handlerData.fetchData.method,\n url: handlerData.fetchData.url,\n };\n\n if (handlerData.error) {\n const hint: FetchBreadcrumbHint = {\n data: handlerData.error,\n input: handlerData.args,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'fetch',\n data: breadcrumbData,\n level: 'error',\n type: 'http',\n },\n hint,\n );\n } else {\n const response = handlerData.response as Response | undefined;\n\n breadcrumbData.request_body_size = handlerData.fetchData.request_body_size;\n breadcrumbData.response_body_size = handlerData.fetchData.response_body_size;\n breadcrumbData.status_code = response?.status;\n\n const hint: FetchBreadcrumbHint = {\n input: handlerData.args,\n response,\n startTimestamp,\n endTimestamp,\n };\n const level = getBreadcrumbLogLevelFromHttpStatusCode(breadcrumbData.status_code);\n\n addBreadcrumb(\n {\n category: 'fetch',\n data: breadcrumbData,\n type: 'http',\n level,\n },\n hint,\n );\n }\n}\n"],"names":[],"mappings":";;AAoBA,MAAM,gBAAA,GAAmB,OAAA;AAEzB,MAAM,cAAA,uBAAqB,OAAA,EAAyB;AAgBpD,MAAM,iBAAA,IAAqB,CAAC,OAAA,GAA4B,EAAC,KAAM;AAC7D,EAAA,MAAM,WAAA,GAAc,OAAA,CAAQ,WAAA,KAAgB,MAAA,GAAY,OAAO,OAAA,CAAQ,WAAA;AACvE,EAAA,MAAM,6BAA6B,OAAA,CAAQ,0BAAA;AAE3C,EAAA,MAAM,iBAAA,GAAoB,IAAI,MAAA,CAAwB,GAAG,CAAA;AACzD,E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AA,cAAA,CAAe,cAAc,QAAA,EAAU,MAAA;AAEvC,IAAA,MAAM,IAAA,GAA4B;AAAA,MAChC,OAAO,WAAA,CAAY,IAAA;AAAA,MACnB,QAAA;AAAA,MACA,cAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM,KAAA,GAAQ,uCAAA,CAAwC,cAAA,CAAe,WAAW,CAAA;AAEhF,IAAA,aAAA;AAAA,MACE;AAAA,QACE,QAAA,EAAU,OAAA;AAAA,QACV,IAAA,EAAM,cAAA;AAAA,QACN,IAAA,EAAM,MAAA;AAAA,QACN;AAAA,OACF;AAAA,MACA;AAAA,KACF;AAAA,EACF;AACF;;;;"}
1
+ {"version":3,"file":"fetch.js","sources":["../../../../src/integrations/fetch.ts"],"sourcesContent":["import { createFetchIntegration } from '@sentry/core';\n\n/**\n * Creates spans and attaches tracing headers to fetch requests.\n */\nexport const fetchIntegration = createFetchIntegration({\n name: 'Fetch',\n spanOrigin: 'auto.http.fetch',\n});\n"],"names":[],"mappings":";;AAKO,MAAM,mBAAmB,sBAAA,CAAuB;AAAA,EACrD,IAAA,EAAM,OAAA;AAAA,EACN,UAAA,EAAY;AACd,CAAC;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"11.0.0-rc.0","sideEffects":false}
1
+ {"type":"module","version":"11.0.0-rc.1","sideEffects":false}
@@ -0,0 +1,41 @@
1
+ import { createRequire } from 'node:module';
2
+ import { resolve } from 'node:path';
3
+ import MagicString from 'magic-string';
4
+
5
+ const PROVIDER_IDENTIFIER = "__SENTRY_FLUE_RUNTIME__";
6
+ const FLUE_MODULE = "@flue/runtime";
7
+ const FLUE_INTEGRATION_ID = /@sentry\/server-utils\/build\/esm\/integrations\/flue\.js$/;
8
+ function isFlueIntegrationModuleId(id) {
9
+ const normalizedId = id.replace(/\\/g, "/").replace(/[?#].*$/, "");
10
+ return FLUE_INTEGRATION_ID.test(normalizedId);
11
+ }
12
+ function sentryFlueRuntimeProviderPlugin() {
13
+ let providerSnippet;
14
+ return {
15
+ name: "sentry-cloudflare-flue-runtime-provider",
16
+ configResolved(config) {
17
+ try {
18
+ createRequire(resolve(config.root, "noop.js")).resolve(FLUE_MODULE);
19
+ } catch (error) {
20
+ const code = error?.code;
21
+ if (code === "MODULE_NOT_FOUND" || code === "ERR_MODULE_NOT_FOUND") {
22
+ return;
23
+ }
24
+ }
25
+ providerSnippet = `import * as ${PROVIDER_IDENTIFIER} from '${FLUE_MODULE}';
26
+ (globalThis.__SENTRY_ORCHESTRION__ = globalThis.__SENTRY_ORCHESTRION__ || {});
27
+ (globalThis.__SENTRY_ORCHESTRION__.providedModules = globalThis.__SENTRY_ORCHESTRION__.providedModules || {});
28
+ Object.defineProperty(globalThis.__SENTRY_ORCHESTRION__.providedModules, '${FLUE_MODULE}', { configurable: true, enumerable: true, get() { return ${PROVIDER_IDENTIFIER}; } });
29
+ `;
30
+ },
31
+ transform(code, id) {
32
+ if (!providerSnippet || !isFlueIntegrationModuleId(id) || code.includes(PROVIDER_IDENTIFIER)) return void 0;
33
+ const ms = new MagicString(code);
34
+ ms.prepend(providerSnippet);
35
+ return { code: ms.toString(), map: ms.generateMap({ hires: true }) };
36
+ }
37
+ };
38
+ }
39
+
40
+ export { isFlueIntegrationModuleId, sentryFlueRuntimeProviderPlugin };
41
+ //# sourceMappingURL=flueRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flueRuntime.js","sources":["../../../../src/vite/flueRuntime.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { resolve } from 'node:path';\nimport MagicString from 'magic-string';\n\n// Namespace binding the injected provider import uses; read back by the integration\n// off the global marker.\nconst PROVIDER_IDENTIFIER = '__SENTRY_FLUE_RUNTIME__';\n\nconst FLUE_MODULE = '@flue/runtime';\n\n// The bundled `@sentry/server-utils` Flue integration module (ESM build — the only one a\n// worker loads). It reads `@flue/runtime` off the global marker this provider populates,\n// because `instrument()` registers into module-scope state no channel payload can carry.\nconst FLUE_INTEGRATION_ID = /@sentry\\/server-utils\\/build\\/esm\\/integrations\\/flue\\.js$/;\n\n/** Whether `id` is the Sentry Flue integration module the provider injects into. */\nexport function isFlueIntegrationModuleId(id: string): boolean {\n const normalizedId = id.replace(/\\\\/g, '/').replace(/[?#].*$/, '');\n return FLUE_INTEGRATION_ID.test(normalizedId);\n}\n\n/**\n * Splices a static `import * as … from '@flue/runtime'` into Sentry's own Flue integration module\n * and exposes the namespace on the global orchestrion marker.\n *\n * Flue is registered rather than patched — `instrument()` writes into module-scope state — so\n * instrumenting it needs that module's own binding, and no channel payload carries one. On Node the\n * user passes it by calling `instrument()` themselves; a bundled worker has no `node_modules` to\n * resolve from, so it is supplied at build time instead.\n */\nexport function sentryFlueRuntimeProviderPlugin(): {\n name: string;\n configResolved(config: { root: string }): void;\n transform(code: string, id: string): { code: string; map: ReturnType<MagicString['generateMap']> } | undefined;\n} {\n let providerSnippet: string | undefined;\n\n return {\n name: 'sentry-cloudflare-flue-runtime-provider',\n\n configResolved(config: { root: string }): void {\n // Build-time only; never ships to the worker. Probed with CJS resolution, which an ESM-only\n // `@flue/runtime` fails with `ERR_PACKAGE_PATH_NOT_EXPORTED` — so only a module-not-found\n // counts as absent, and any other failure still injects and lets Vite report it. Not\n // `import.meta.resolve`: `parentURL` is ignored without a flag, and it is absent from the\n // CJS build.\n try {\n createRequire(resolve(config.root, 'noop.js')).resolve(FLUE_MODULE);\n } catch (error) {\n const code = (error as NodeJS.ErrnoException | undefined)?.code;\n if (code === 'MODULE_NOT_FOUND' || code === 'ERR_MODULE_NOT_FOUND') {\n return;\n }\n }\n // A getter where Mastra assigns: the bundler may evaluate Sentry's module before\n // `@flue/runtime` is initialized, and assigning there would store `undefined`.\n providerSnippet =\n `import * as ${PROVIDER_IDENTIFIER} from '${FLUE_MODULE}';\\n` +\n '(globalThis.__SENTRY_ORCHESTRION__ = globalThis.__SENTRY_ORCHESTRION__ || {});\\n' +\n '(globalThis.__SENTRY_ORCHESTRION__.providedModules = globalThis.__SENTRY_ORCHESTRION__.providedModules || {});\\n' +\n `Object.defineProperty(globalThis.__SENTRY_ORCHESTRION__.providedModules, '${FLUE_MODULE}', ` +\n `{ configurable: true, enumerable: true, get() { return ${PROVIDER_IDENTIFIER}; } });\\n`;\n },\n\n transform(code: string, id: string): { code: string; map: ReturnType<MagicString['generateMap']> } | undefined {\n // `code.includes` keeps this idempotent: a second pass over already-injected output would\n // otherwise emit a duplicate `import * as` binding, which is a syntax error.\n if (!providerSnippet || !isFlueIntegrationModuleId(id) || code.includes(PROVIDER_IDENTIFIER)) return undefined;\n\n const ms = new MagicString(code);\n ms.prepend(providerSnippet);\n return { code: ms.toString(), map: ms.generateMap({ hires: true }) };\n },\n };\n}\n"],"names":[],"mappings":";;;;AAMA,MAAM,mBAAA,GAAsB,yBAAA;AAE5B,MAAM,WAAA,GAAc,eAAA;AAKpB,MAAM,mBAAA,GAAsB,4DAAA;AAGrB,SAAS,0BAA0B,EAAA,EAAqB;AAC7D,EAAA,MAAM,YAAA,GAAe,GAAG,OAAA,CAAQ,KAAA,EAAO,GAAG,CAAA,CAAE,OAAA,CAAQ,WAAW,EAAE,CAAA;AACjE,EAAA,OAAO,mBAAA,CAAoB,KAAK,YAAY,CAAA;AAC9C;AAWO,SAAS,+BAAA,GAId;AACA,EAAA,IAAI,eAAA;AAEJ,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,yCAAA;AAAA,IAEN,eAAe,MAAA,EAAgC;AAM7C,MAAA,IAAI;AACF,QAAA,aAAA,CAAc,QAAQ,MAAA,CAAO,IAAA,EAAM,SAAS,CAAC,CAAA,CAAE,QAAQ,WAAW,CAAA;AAAA,MACpE,SAAS,KAAA,EAAO;AACd,QAAA,MAAM,OAAQ,KAAA,EAA6C,IAAA;AAC3D,QAAA,IAAI,IAAA,KAAS,kBAAA,IAAsB,IAAA,KAAS,sBAAA,EAAwB;AAClE,UAAA;AAAA,QACF;AAAA,MACF;AAGA,MAAA,eAAA,GACE,CAAA,YAAA,EAAe,mBAAmB,CAAA,OAAA,EAAU,WAAW,CAAA;AAAA;AAAA;AAAA,0EAAA,EAGsB,WAAW,6DAC9B,mBAAmB,CAAA;AAAA,CAAA;AAAA,IACjF,CAAA;AAAA,IAEA,SAAA,CAAU,MAAc,EAAA,EAAuF;AAG7G,MAAA,IAAI,CAAC,eAAA,IAAmB,CAAC,yBAAA,CAA0B,EAAE,KAAK,IAAA,CAAK,QAAA,CAAS,mBAAmB,CAAA,EAAG,OAAO,MAAA;AAErG,MAAA,MAAM,EAAA,GAAK,IAAI,WAAA,CAAY,IAAI,CAAA;AAC/B,MAAA,EAAA,CAAG,QAAQ,eAAe,CAAA;AAC1B,MAAA,OAAO,EAAE,IAAA,EAAM,EAAA,CAAG,QAAA,EAAS,EAAG,GAAA,EAAK,EAAA,CAAG,WAAA,CAAY,EAAE,KAAA,EAAO,IAAA,EAAM,CAAA,EAAE;AAAA,IACrE;AAAA,GACF;AACF;;;;"}
@@ -1,5 +1,6 @@
1
1
  import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';
2
2
  import { sentryCloudflareAutoInstrumentPlugin } from './autoInstrument.js';
3
+ import { sentryFlueRuntimeProviderPlugin } from './flueRuntime.js';
3
4
  import { sentryMastraObservabilityProviderPlugin } from './mastraObservability.js';
4
5
 
5
6
  function sentryCloudflareVitePlugin(options = {}) {
@@ -11,6 +12,7 @@ function sentryCloudflareVitePlugin(options = {}) {
11
12
  dcModule: "@sentry/cloudflare/orchestrion-diagnostics-channel"
12
13
  }),
13
14
  sentryMastraObservabilityProviderPlugin(),
15
+ sentryFlueRuntimeProviderPlugin(),
14
16
  ...options.autoInstrumentation !== false ? [sentryCloudflareAutoInstrumentPlugin({ wranglerConfigPath: options.wranglerConfigPath })] : []
15
17
  ];
16
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/vite/index.ts"],"sourcesContent":["// Published ESM-only via the `@sentry/cloudflare/vite` subpath export:\n// `@sentry/server-utils/orchestrion/vite` exposes no `require` condition, so a\n// CJS entry here would fail at resolution time (ERR_PACKAGE_PATH_NOT_EXPORTED).\n// The CJS rollup variant still emits this file, but `package.json` doesn't\n// expose it — same setup as `@sentry/server-utils/orchestrion/vite` itself.\nimport { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';\nimport { sentryCloudflareAutoInstrumentPlugin } from './autoInstrument';\nimport { sentryMastraObservabilityProviderPlugin } from './mastraObservability';\n\n/**\n * Options for {@link sentryCloudflareVitePlugin}.\n */\nexport interface SentryCloudflareVitePluginOptions {\n /**\n * Path to the wrangler config, relative to the Vite root (or absolute).\n * Set this when your config doesn't use a default name — e.g. when you\n * pass `configPath: './wrangler.agent.jsonc'` to `@cloudflare/vite-plugin`,\n * which the Sentry plugin cannot see. When set, only this file is read\n * (no default-name probing), and a warning is emitted if it is missing or\n * unparseable.\n *\n * @default undefined (probes `wrangler.json`, `wrangler.jsonc`, `wrangler.toml` at the Vite root)\n */\n wranglerConfigPath?: string;\n /**\n * Build-time automatic instrumentation of supported dependencies (e.g.\n * database clients like `mysql`) so the Sentry Cloudflare SDK can trace them\n * without monkey-patching, which wouldn't work in workerd anyway.\n *\n * When enabled, the plugin injects `diagnostics_channel.tracingChannel` calls\n * into the bundled packages and, next to each, a snippet that registers the\n * matching Sentry channel-subscriber factory on the global marker, which the\n * SDK picks up in `Sentry.withSentry()`. Both `vite build` and `vite dev` are\n * instrumented. Set to `false` to opt out.\n *\n * @default true\n */\n buildTimeInstrumentation?: boolean;\n /**\n * Automatically wraps your Worker at build time so you don't have to edit\n * your entry: the plugin reads your wrangler config, wraps the default\n * export with `Sentry.withSentry()` (sourcing options from a co-located\n * `instrument.*` file, falling back to env), and wraps any configured\n * Durable Object class with `instrumentDurableObjectWithSentry`. Both\n * `vite build` and `vite dev` are instrumented. Already-wrapped entries are\n * left alone, so this is safe alongside manual instrumentation. Set to\n * `false` to opt out.\n *\n * The plugin also adds the bindings that resolve to the wrapped classes (this worker's own\n * Durable Objects and self service bindings) to `rpcTracePropagationBindings`. Bindings to\n * other workers stay opt-in, their receivers may not run Sentry.\n *\n * @default true\n */\n autoInstrumentation?: boolean;\n}\n\n/**\n * Sentry Vite plugin for Cloudflare Workers.\n *\n * Add this plugin to your Vite configuration to enable additional Sentry\n * instrumentation for Cloudflare Workers built with Vite.\n *\n * By default, the plugin\n * - build-time instruments supported dependencies (such as database clients) so\n * they are traced without changing your application code — opt out with\n * `buildTimeInstrumentation: false`, and\n * - wraps your Worker entry (and any Durable Object, Workflow or\n * WorkerEntrypoint class in your wrangler config) with the matching Sentry\n * helper — opt out with `autoInstrumentation: false` and call\n * `Sentry.withSentry()` yourself.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { cloudflare } from '@cloudflare/vite-plugin';\n * import { sentryCloudflareVitePlugin } from '@sentry/cloudflare/vite';\n * import { defineConfig } from 'vite';\n *\n * export default defineConfig({\n * plugins: [cloudflare(), sentryCloudflareVitePlugin()],\n * });\n * ```\n */\nexport function sentryCloudflareVitePlugin(options: SentryCloudflareVitePluginOptions = {}): Array<{ name: string }> {\n return [\n sentryOrchestrionPlugin({\n buildTimeInstrumentation: options.buildTimeInstrumentation,\n // Route the injected `tracingChannel` imports through the workerd-safe façade so a\n // dependency wrapped at module scope (`const app = new Hono()`) doesn't throw on workerd.\n dcModule: '@sentry/cloudflare/orchestrion-diagnostics-channel',\n }),\n sentryMastraObservabilityProviderPlugin(),\n ...(options.autoInstrumentation !== false\n ? [sentryCloudflareAutoInstrumentPlugin({ wranglerConfigPath: options.wranglerConfigPath })]\n : []),\n ];\n}\n"],"names":[],"mappings":";;;;AAoFO,SAAS,0BAAA,CAA2B,OAAA,GAA6C,EAAC,EAA4B;AACnH,EAAA,OAAO;AAAA,IACL,uBAAA,CAAwB;AAAA,MACtB,0BAA0B,OAAA,CAAQ,wBAAA;AAAA;AAAA;AAAA,MAGlC,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,IACD,uCAAA,EAAwC;AAAA,IACxC,GAAI,OAAA,CAAQ,mBAAA,KAAwB,KAAA,GAChC,CAAC,oCAAA,CAAqC,EAAE,kBAAA,EAAoB,OAAA,CAAQ,kBAAA,EAAoB,CAAC,IACzF;AAAC,GACP;AACF;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/vite/index.ts"],"sourcesContent":["// Published ESM-only via the `@sentry/cloudflare/vite` subpath export:\n// `@sentry/server-utils/orchestrion/vite` exposes no `require` condition, so a\n// CJS entry here would fail at resolution time (ERR_PACKAGE_PATH_NOT_EXPORTED).\n// The CJS rollup variant still emits this file, but `package.json` doesn't\n// expose it — same setup as `@sentry/server-utils/orchestrion/vite` itself.\nimport { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';\nimport { sentryCloudflareAutoInstrumentPlugin } from './autoInstrument';\nimport { sentryFlueRuntimeProviderPlugin } from './flueRuntime';\nimport { sentryMastraObservabilityProviderPlugin } from './mastraObservability';\n\n/**\n * Options for {@link sentryCloudflareVitePlugin}.\n */\nexport interface SentryCloudflareVitePluginOptions {\n /**\n * Path to the wrangler config, relative to the Vite root (or absolute).\n * Set this when your config doesn't use a default name — e.g. when you\n * pass `configPath: './wrangler.agent.jsonc'` to `@cloudflare/vite-plugin`,\n * which the Sentry plugin cannot see. When set, only this file is read\n * (no default-name probing), and a warning is emitted if it is missing or\n * unparseable.\n *\n * @default undefined (probes `wrangler.json`, `wrangler.jsonc`, `wrangler.toml` at the Vite root)\n */\n wranglerConfigPath?: string;\n /**\n * Build-time automatic instrumentation of supported dependencies (e.g.\n * database clients like `mysql`) so the Sentry Cloudflare SDK can trace them\n * without monkey-patching, which wouldn't work in workerd anyway.\n *\n * When enabled, the plugin injects `diagnostics_channel.tracingChannel` calls\n * into the bundled packages and, next to each, a snippet that registers the\n * matching Sentry channel-subscriber factory on the global marker, which the\n * SDK picks up in `Sentry.withSentry()`. Both `vite build` and `vite dev` are\n * instrumented. Set to `false` to opt out.\n *\n * @default true\n */\n buildTimeInstrumentation?: boolean;\n /**\n * Automatically wraps your Worker at build time so you don't have to edit\n * your entry: the plugin reads your wrangler config, wraps the default\n * export with `Sentry.withSentry()` (sourcing options from a co-located\n * `instrument.*` file, falling back to env), and wraps any configured\n * Durable Object class with `instrumentDurableObjectWithSentry`. Both\n * `vite build` and `vite dev` are instrumented. Already-wrapped entries are\n * left alone, so this is safe alongside manual instrumentation. Set to\n * `false` to opt out.\n *\n * The plugin also adds the bindings that resolve to the wrapped classes (this worker's own\n * Durable Objects and self service bindings) to `rpcTracePropagationBindings`. Bindings to\n * other workers stay opt-in, their receivers may not run Sentry.\n *\n * @default true\n */\n autoInstrumentation?: boolean;\n}\n\n/**\n * Sentry Vite plugin for Cloudflare Workers.\n *\n * Add this plugin to your Vite configuration to enable additional Sentry\n * instrumentation for Cloudflare Workers built with Vite.\n *\n * By default, the plugin\n * - build-time instruments supported dependencies (such as database clients) so\n * they are traced without changing your application code — opt out with\n * `buildTimeInstrumentation: false`, and\n * - wraps your Worker entry (and any Durable Object, Workflow or\n * WorkerEntrypoint class in your wrangler config) with the matching Sentry\n * helper — opt out with `autoInstrumentation: false` and call\n * `Sentry.withSentry()` yourself.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { cloudflare } from '@cloudflare/vite-plugin';\n * import { sentryCloudflareVitePlugin } from '@sentry/cloudflare/vite';\n * import { defineConfig } from 'vite';\n *\n * export default defineConfig({\n * plugins: [cloudflare(), sentryCloudflareVitePlugin()],\n * });\n * ```\n */\nexport function sentryCloudflareVitePlugin(options: SentryCloudflareVitePluginOptions = {}): Array<{ name: string }> {\n return [\n sentryOrchestrionPlugin({\n buildTimeInstrumentation: options.buildTimeInstrumentation,\n // Route the injected `tracingChannel` imports through the workerd-safe façade so a\n // dependency wrapped at module scope (`const app = new Hono()`) doesn't throw on workerd.\n dcModule: '@sentry/cloudflare/orchestrion-diagnostics-channel',\n }),\n sentryMastraObservabilityProviderPlugin(),\n sentryFlueRuntimeProviderPlugin(),\n ...(options.autoInstrumentation !== false\n ? [sentryCloudflareAutoInstrumentPlugin({ wranglerConfigPath: options.wranglerConfigPath })]\n : []),\n ];\n}\n"],"names":[],"mappings":";;;;;AAqFO,SAAS,0BAAA,CAA2B,OAAA,GAA6C,EAAC,EAA4B;AACnH,EAAA,OAAO;AAAA,IACL,uBAAA,CAAwB;AAAA,MACtB,0BAA0B,OAAA,CAAQ,wBAAA;AAAA;AAAA;AAAA,MAGlC,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,IACD,uCAAA,EAAwC;AAAA,IACxC,+BAAA,EAAgC;AAAA,IAChC,GAAI,OAAA,CAAQ,mBAAA,KAAwB,KAAA,GAChC,CAAC,oCAAA,CAAqC,EAAE,kBAAA,EAAoB,OAAA,CAAQ,kBAAA,EAAoB,CAAC,IACzF;AAAC,GACP;AACF;;;;"}
@@ -31,7 +31,7 @@ export declare function constructInstrumentedDurableObject<E, T extends DurableO
31
31
  frameworkManagedMethods: ReadonlySet<string>;
32
32
  };
33
33
  /**
34
- * Adds trace propagation to a constructed Durable Object's RPC methods.
34
+ * Instruments a constructed Durable Object's RPC methods.
35
35
  *
36
36
  * RPC methods are wrapped on the prototype because Cloudflare dispatches them with the Durable
37
37
  * Object instance as the receiver. This preserves native private-field access and keeps the methods
@@ -58,7 +58,8 @@ export declare function finalizeWithRpcInstrumentation<T extends object>(obj: T,
58
58
  * - webSocketClose
59
59
  * - webSocketError
60
60
  *
61
- * RPC methods (prototype methods) are instrumented too, so an incoming trace continues into them.
61
+ * RPC methods (prototype methods) are instrumented too: an incoming trace continues into them, and
62
+ * errors, logs and metrics are captured whether or not the caller propagates a trace.
62
63
  *
63
64
  * @param optionsCallback Function that returns the options for the SDK initialization.
64
65
  * @param DurableObjectClass The Durable Object class to instrument.
@@ -1 +1 @@
1
- {"version":3,"file":"durableobject.d.ts","sourceRoot":"","sources":["../../src/durableobject.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB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GAAG,EAAE,GAAG,KAAK,CAAC,EACzG,CAAC,GAAG,OAAO,EACX,eAAe,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,uBAAuB,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAsB5F"}
@@ -1,8 +1,9 @@
1
1
  export type { Breadcrumb, BreadcrumbHint, PolymorphicRequest, RequestEventData, SdkInfo, Event, EventHint, ErrorEvent, Exception, FeatureFlagsIntegration, Session, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, Metric, ExclusiveEventHintOrCaptureContext, CaptureContext, } from '@sentry/core';
2
2
  export type { CloudflareOptions } from './client';
3
- export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureFeedback, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getGlobalScope, getIsolationScope, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setAttribute, setAttributes, setUser, setConversationId, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, getTraceData, getTraceMetaTags, startSpan, startInactiveSpan, startSpanManual, startNewTrace, bindScopeToEmitter, suppressTracing, withActiveSpan, getSpanDescendants, continueTrace, functionToStringIntegration, eventFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, extraErrorDataIntegration, dedupeIntegration, rewriteFramesIntegration, captureConsoleIntegration, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, consoleIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SENTRY_SEGMENT_NAME_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, spanToStaticSpanJSON, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, consoleLoggingIntegration, createConsolaReporter, featureFlagsIntegration, growthbookIntegration, logger, metrics, withStaticSpan, withStreamedSpan, spanStreamingIntegration, } from '@sentry/core';
3
+ export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureFeedback, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getGlobalScope, getIsolationScope, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setAttribute, setAttributes, setUser, setConversationId, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, getTraceData, getTraceMetaTags, startSpan, startInactiveSpan, startSpanManual, startNewTrace, bindScopeToEmitter, suppressTracing, withActiveSpan, getSpanDescendants, continueTrace, functionToStringIntegration, eventFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, extraErrorDataIntegration, dedupeIntegration, rewriteFramesIntegration, captureConsoleIntegration, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, consoleIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, spanToStaticSpanJSON, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, consoleLoggingIntegration, createConsolaReporter, featureFlagsIntegration, growthbookIntegration, logger, metrics, withStaticSpan, withStreamedSpan, spanStreamingIntegration, } from '@sentry/core';
4
4
  export { trpcMiddleware, wrapMcpServerWithSentry } from '@sentry/core/server';
5
5
  export { createFlueInstrumentation, instrumentPostgresJsSql } from '@sentry/server-utils';
6
+ export type { FlueOptions } from '@sentry/server-utils';
6
7
  export { withSentry } from './withSentry';
7
8
  export { defineCloudflareOptions } from './defineCloudflareOptions';
8
9
  export { instrumentAgentWithSentry, instrumentDurableObjectWithSentry } from './durableobject';
@@ -12,8 +13,9 @@ export { CloudflareClient } from './client';
12
13
  export { _INTERNAL_wrapRequestHandler, getDefaultIntegrations } from './sdk';
13
14
  export { httpServerIntegration } from './integrations/httpServer';
14
15
  export { fetchIntegration } from './integrations/fetch';
16
+ export type { FetchIntegrationOptions } from '@sentry/core';
15
17
  export { spotlightIntegration } from './integrations/spotlight';
16
- export { openTelemetryIntegration, getOtlpTracesEndpoint, prismaIntegration, instrumentMistralAiClient, instrumentOpenAiClient, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, instrumentWorkersAiClient, createLangChainCallbackHandler, instrumentLangChainEmbeddings, instrumentStateGraph, instrumentCreateReactAgent, vercelAIIntegration, eveConversationHook, getInstrumentedModuleNames, } from '@sentry/server-utils';
18
+ export { openTelemetryIntegration, getOtlpTracesEndpoint, prismaIntegration, instrumentMistralAiClient, instrumentOpenAiClient, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, instrumentWorkersAiClient, createLangChainCallbackHandler, instrumentLangChainEmbeddings, instrumentStateGraph, instrumentCreateReactAgent, vercelAIIntegration, eveConversationHook, eveIntegration, getInstrumentedModuleNames, } from '@sentry/server-utils';
17
19
  export { instrumentWorkflowWithSentry } from './workflows';
18
20
  export { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
19
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,OAAO,EACP,aAAa,EACb,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,MAAM,EACN,kCAAkC,EAClC,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EACh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,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,EAC7B,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,6CAA6C,CAAC"}
@@ -5,6 +5,7 @@ export declare const STUB_NON_RPC_METHODS: Set<string>;
5
5
  *
6
6
  * Wraps:
7
7
  * - `namespace.get(id)` / `namespace.getByName(name)` with a span + instruments returned stub
8
+ * - `namespace.jurisdiction(name)` by instrumenting the returned namespace the same way
8
9
  * - `namespace.idFromName(name)` / `namespace.idFromString(id)` / `namespace.newUniqueId()` with breadcrumbs
9
10
  *
10
11
  * @param namespace - The DurableObjectNamespace to instrument
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentDurableObjectNamespace.d.ts","sourceRoot":"","sources":["../../../src/instrumentations/instrumentDurableObjectNamespace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAqB,MAAM,2BAA2B,CAAC;AAK3F,eAAO,MAAM,oBAAoB,aAAuC,CAAC;AAEzE;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,sBAAsB,EACjC,iBAAiB,UAAQ,GACxB,sBAAsB,CAoBxB"}
1
+ {"version":3,"file":"instrumentDurableObjectNamespace.d.ts","sourceRoot":"","sources":["../../../src/instrumentations/instrumentDurableObjectNamespace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAqB,MAAM,2BAA2B,CAAC;AAK3F,eAAO,MAAM,oBAAoB,aAAuC,CAAC;AAEzE;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,sBAAsB,EACjC,iBAAiB,UAAQ,GACxB,sBAAsB,CA4BxB"}
@@ -1,19 +1,5 @@
1
- export interface Options {
2
- /**
3
- * Whether breadcrumbs should be recorded for requests
4
- * Defaults to true
5
- */
6
- breadcrumbs: boolean;
7
- /**
8
- * Function determining whether or not to create spans to track outgoing requests to the given URL.
9
- * By default, spans will be created for all outgoing requests.
10
- */
11
- shouldCreateSpanForRequest?: (url: string) => boolean;
12
- }
13
1
  /**
14
2
  * Creates spans and attaches tracing headers to fetch requests.
15
3
  */
16
- export declare const fetchIntegration: (options?: Partial<Options> | undefined) => import("@sentry/core").Integration & {
17
- name: "Fetch";
18
- };
4
+ export declare const fetchIntegration: (options?: import("@sentry/core").FetchIntegrationOptions) => import("@sentry/core").Integration;
19
5
  //# sourceMappingURL=fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/integrations/fetch.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,OAAO;IACtB;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,0BAA0B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACvD;AAoED;;GAEG;AACH,eAAO,MAAM,gBAAgB;;CAAuC,CAAC"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/integrations/fetch.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,gBAAgB,kGAG3B,CAAC"}
@@ -0,0 +1,23 @@
1
+ import MagicString from 'magic-string';
2
+ /** Whether `id` is the Sentry Flue integration module the provider injects into. */
3
+ export declare function isFlueIntegrationModuleId(id: string): boolean;
4
+ /**
5
+ * Splices a static `import * as … from '@flue/runtime'` into Sentry's own Flue integration module
6
+ * and exposes the namespace on the global orchestrion marker.
7
+ *
8
+ * Flue is registered rather than patched — `instrument()` writes into module-scope state — so
9
+ * instrumenting it needs that module's own binding, and no channel payload carries one. On Node the
10
+ * user passes it by calling `instrument()` themselves; a bundled worker has no `node_modules` to
11
+ * resolve from, so it is supplied at build time instead.
12
+ */
13
+ export declare function sentryFlueRuntimeProviderPlugin(): {
14
+ name: string;
15
+ configResolved(config: {
16
+ root: string;
17
+ }): void;
18
+ transform(code: string, id: string): {
19
+ code: string;
20
+ map: ReturnType<MagicString['generateMap']>;
21
+ } | undefined;
22
+ };
23
+ //# sourceMappingURL=flueRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flueRuntime.d.ts","sourceRoot":"","sources":["../../../src/vite/flueRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,cAAc,CAAC;AAavC,oFAAoF;AACpF,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAG7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,IAAI;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/C,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;KAAE,GAAG,SAAS,CAAC;CAChH,CAwCA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;OAYG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;;;;;;;;;;;OAeG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAanH"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;OAYG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;;;;;;;;;;;OAeG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAcnH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cloudflare",
3
- "version": "11.0.0-rc.0",
3
+ "version": "11.0.0-rc.1",
4
4
  "description": "Official Sentry SDK for Cloudflare Workers and Pages",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/cloudflare",
@@ -54,9 +54,9 @@
54
54
  "dependencies": {
55
55
  "@opentelemetry/api": "^1.9.1",
56
56
  "@sentry/conventions": "^0.23.0",
57
- "@sentry/core": "11.0.0-rc.0",
58
- "@sentry/opentelemetry": "11.0.0-rc.0",
59
- "@sentry/server-utils": "11.0.0-rc.0",
57
+ "@sentry/core": "11.0.0-rc.1",
58
+ "@sentry/opentelemetry": "11.0.0-rc.1",
59
+ "@sentry/server-utils": "11.0.0-rc.1",
60
60
  "magic-string": "~0.30.21"
61
61
  },
62
62
  "peerDependencies": {