@sentry/cloudflare 10.72.0 → 10.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/async.js +7 -1
- package/build/cjs/async.js.map +1 -1
- package/build/cjs/durableobject.js +8 -55
- package/build/cjs/durableobject.js.map +1 -1
- package/build/cjs/index.js +2 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/instrument.js +4 -0
- package/build/cjs/instrument.js.map +1 -1
- package/build/cjs/instrumentations/instrumentDurableObjectHandlers.js +114 -0
- package/build/cjs/instrumentations/instrumentDurableObjectHandlers.js.map +1 -0
- package/build/cjs/instrumentations/instrumentWorkerEntrypoint.js +4 -1
- package/build/cjs/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/cjs/nodejs_compat/index.js +2 -0
- package/build/cjs/nodejs_compat/index.js.map +1 -1
- package/build/cjs/vite/agentClass.js +3 -2
- package/build/cjs/vite/agentClass.js.map +1 -1
- package/build/cjs/vite/autoInstrument.js +1 -1
- package/build/cjs/vite/autoInstrument.js.map +1 -1
- package/build/cjs/vite/transform.js +79 -16
- package/build/cjs/vite/transform.js.map +1 -1
- package/build/cjs/workflows.js +4 -1
- package/build/cjs/workflows.js.map +1 -1
- package/build/esm/async.js +8 -2
- package/build/esm/async.js.map +1 -1
- package/build/esm/durableobject.js +9 -56
- package/build/esm/durableobject.js.map +1 -1
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/instrument.js +4 -1
- package/build/esm/instrument.js.map +1 -1
- package/build/esm/instrumentations/instrumentDurableObjectHandlers.js +112 -0
- package/build/esm/instrumentations/instrumentDurableObjectHandlers.js.map +1 -0
- package/build/esm/instrumentations/instrumentWorkerEntrypoint.js +4 -1
- package/build/esm/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/esm/nodejs_compat/index.js +1 -0
- package/build/esm/nodejs_compat/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/vite/agentClass.js +3 -2
- package/build/esm/vite/agentClass.js.map +1 -1
- package/build/esm/vite/autoInstrument.js +1 -1
- package/build/esm/vite/autoInstrument.js.map +1 -1
- package/build/esm/vite/transform.js +79 -16
- package/build/esm/vite/transform.js.map +1 -1
- package/build/esm/workflows.js +4 -1
- package/build/esm/workflows.js.map +1 -1
- package/build/types/async.d.ts.map +1 -1
- package/build/types/durableobject.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/instrument.d.ts +10 -0
- package/build/types/instrument.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentDurableObjectHandlers.d.ts +28 -0
- package/build/types/instrumentations/instrumentDurableObjectHandlers.d.ts.map +1 -0
- package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts.map +1 -1
- package/build/types/vite/agentClass.d.ts +4 -3
- package/build/types/vite/agentClass.d.ts.map +1 -1
- package/build/types/vite/autoInstrument.d.ts.map +1 -1
- package/build/types/vite/transform.d.ts +5 -4
- package/build/types/vite/transform.d.ts.map +1 -1
- package/build/types/workflows.d.ts.map +1 -1
- package/build/types-ts3.8/index.d.ts +1 -0
- package/build/types-ts3.8/instrument.d.ts +10 -0
- package/build/types-ts3.8/instrumentations/instrumentDurableObjectHandlers.d.ts +28 -0
- package/build/types-ts3.8/vite/agentClass.d.ts +4 -3
- package/build/types-ts3.8/vite/transform.d.ts +5 -4
- package/package.json +3 -3
|
@@ -4,6 +4,7 @@ export { addEventProcessor, addBreadcrumb, addIntegration, captureException, cap
|
|
|
4
4
|
export { withSentry } from './withSentry';
|
|
5
5
|
export { defineCloudflareOptions } from './defineCloudflareOptions';
|
|
6
6
|
export { instrumentAgentWithSentry, instrumentDurableObjectWithSentry } from './durableobject';
|
|
7
|
+
export { _INTERNAL_wrapUnlessInstrumented } from './instrument';
|
|
7
8
|
export { sentryPagesPlugin } from './pages-plugin';
|
|
8
9
|
export { wrapRequestHandler } from './request';
|
|
9
10
|
export { CloudflareClient } from './client';
|
|
@@ -17,4 +17,14 @@ export declare function getInstrumented<T>(obj: T): T | undefined;
|
|
|
17
17
|
* @param noMark - If true, skips storing the original→instrumented mapping.
|
|
18
18
|
*/
|
|
19
19
|
export declare function ensureInstrumented<T>(original: T, instrumentFn: (original: T) => T, noMark?: boolean): T;
|
|
20
|
+
/**
|
|
21
|
+
* Applies `wrap` to `Class` unless `Class` is already an instrumented wrapper.
|
|
22
|
+
*
|
|
23
|
+
* Emitted by the Vite auto-instrumentation transform for classes the worker entry only re-exports:
|
|
24
|
+
* such a class may already be hand-wrapped with `instrument*WithSentry` in the module it comes
|
|
25
|
+
* from, which the build cannot see. Wrapping again would nest two proxies and instrument the same
|
|
26
|
+
* work twice, duplicated child spans, so the hand-wrapped class is returned as-is. Not part of the
|
|
27
|
+
* public API, hand-written wrapper calls are deliberately left untouched by this guard.
|
|
28
|
+
*/
|
|
29
|
+
export declare function _INTERNAL_wrapUnlessInstrumented<C>(wrap: (optionsCallback: (env: never) => unknown, Class: C) => C, optionsCallback: (env: never) => unknown, Class: C): C;
|
|
20
30
|
//# sourceMappingURL=instrument.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DurableObject } from 'cloudflare:workers';
|
|
2
|
+
import { CloudflareOptions } from '../client';
|
|
3
|
+
/**
|
|
4
|
+
* The instrumented context of the Durable Object being wrapped.
|
|
5
|
+
*
|
|
6
|
+
* Kept as `any` for the same reason as in `durableobject.ts`: a concrete `DurableObjectState` here
|
|
7
|
+
* makes `tsc` relate its `SqlStorage` graph against the parameter union of `wrapMethodWithSentry`,
|
|
8
|
+
* which hangs the type build.
|
|
9
|
+
*/
|
|
10
|
+
type InstrumentedDurableObjectContext = any;
|
|
11
|
+
/**
|
|
12
|
+
* Instruments the built-in Durable Object handler methods on a constructed instance.
|
|
13
|
+
*
|
|
14
|
+
* These are the methods that are available on a Durable Object
|
|
15
|
+
* ref: https://developers.cloudflare.com/durable-objects/api/base/
|
|
16
|
+
* - obj.alarm
|
|
17
|
+
* - obj.fetch
|
|
18
|
+
* - obj.webSocketError
|
|
19
|
+
* - obj.webSocketClose
|
|
20
|
+
* - obj.webSocketMessage
|
|
21
|
+
*
|
|
22
|
+
* Any other public methods on the Durable Object instance are RPC calls.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function instrumentDurableObjectHandlers<E, T extends DurableObject<E>>(obj: T, options: CloudflareOptions, context: InstrumentedDurableObjectContext): void;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=instrumentDurableObjectHandlers.d.ts.map
|
|
@@ -32,10 +32,11 @@ export interface ModuleResolver {
|
|
|
32
32
|
*/
|
|
33
33
|
export declare function detectAgentClasses(ast: ProgramBody, entryId: string, candidates: Iterable<string>, resolver: ModuleResolver): Promise<Set<string>>;
|
|
34
34
|
/**
|
|
35
|
-
* The
|
|
36
|
-
*
|
|
35
|
+
* The entry-module binding names a configured class name could refer to — a class declared under
|
|
36
|
+
* that name, an import of it from another module, a `export { X } from './x'` re-export, or the
|
|
37
|
+
* local binding an `export { Local as Configured }` specifier aliases.
|
|
37
38
|
*
|
|
38
|
-
* Keeps detection (which reads and scans other modules) off
|
|
39
|
+
* Keeps detection (which reads and scans other modules) off names no binding points at.
|
|
39
40
|
*/
|
|
40
41
|
export declare function collectAgentCandidates(ast: ProgramBody, configuredNames: Iterable<string>): Set<string>;
|
|
41
42
|
//# sourceMappingURL=agentClass.d.ts.map
|
|
@@ -54,10 +54,11 @@ export interface TransformResult {
|
|
|
54
54
|
* {@link TransformContext.classWrappers}, e.g. Durable Object classes with
|
|
55
55
|
* `instrumentDurableObjectWithSentry`).
|
|
56
56
|
*
|
|
57
|
-
* Handles
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
57
|
+
* Handles `export class MyDO {}`, the specifier form (`class MyDO {}` …
|
|
58
|
+
* `export { MyDO }` / `export { Foo as MyDO }`), and classes that live in
|
|
59
|
+
* another module (`import { MyDO } from './do'; export { MyDO }` or
|
|
60
|
+
* `export { MyDO } from './do'`). Only star re-exports (`export * from './do'`)
|
|
61
|
+
* are left alone — the plugin warns about those via
|
|
61
62
|
* {@link TransformResult.wrappedClasses}.
|
|
62
63
|
*
|
|
63
64
|
* Exported (rather than inlined into the plugin) so it can be unit-tested with a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/cloudflare",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.74.0",
|
|
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",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@opentelemetry/api": "^1.9.1",
|
|
73
|
-
"@sentry/core": "10.
|
|
74
|
-
"@sentry/server-utils": "10.
|
|
73
|
+
"@sentry/core": "10.74.0",
|
|
74
|
+
"@sentry/server-utils": "10.74.0",
|
|
75
75
|
"magic-string": "~0.30.21"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|