@sentry/cloudflare 11.3.0 → 11.5.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/dev/baseSdk.js +4 -1
- package/build/cjs/dev/baseSdk.js.map +1 -1
- package/build/cjs/dev/durableobject.js +2 -2
- package/build/cjs/dev/durableobject.js.map +1 -1
- package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js +1 -1
- package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentSqlStorage.js +1 -1
- package/build/cjs/dev/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js +2 -2
- package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentD1.js +2 -2
- package/build/cjs/dev/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentQueue.js +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentR2.js +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/cjs/dev/options.js +1 -1
- package/build/cjs/dev/options.js.map +1 -1
- package/build/cjs/dev/utils/asyncContextStrategy.js +13 -0
- package/build/cjs/dev/utils/asyncContextStrategy.js.map +1 -0
- package/build/cjs/dev/withSentry.js +2 -2
- package/build/cjs/dev/withSentry.js.map +1 -1
- package/build/cjs/dev/workflows.js +3 -3
- package/build/cjs/dev/workflows.js.map +1 -1
- package/build/cjs/dev/wrapRequestHandlerWithInit.js +2 -2
- package/build/cjs/dev/wrapRequestHandlerWithInit.js.map +1 -1
- package/build/cjs/prod/baseSdk.js +4 -1
- package/build/cjs/prod/baseSdk.js.map +1 -1
- package/build/cjs/prod/durableobject.js +2 -2
- package/build/cjs/prod/durableobject.js.map +1 -1
- package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js +1 -1
- package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentSqlStorage.js +1 -1
- package/build/cjs/prod/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js +2 -2
- package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentD1.js +2 -2
- package/build/cjs/prod/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentQueue.js +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentR2.js +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/cjs/prod/options.js +1 -1
- package/build/cjs/prod/options.js.map +1 -1
- package/build/cjs/prod/utils/asyncContextStrategy.js +13 -0
- package/build/cjs/prod/utils/asyncContextStrategy.js.map +1 -0
- package/build/cjs/prod/withSentry.js +2 -2
- package/build/cjs/prod/withSentry.js.map +1 -1
- package/build/cjs/prod/workflows.js +3 -3
- package/build/cjs/prod/workflows.js.map +1 -1
- package/build/cjs/prod/wrapRequestHandlerWithInit.js +2 -2
- package/build/cjs/prod/wrapRequestHandlerWithInit.js.map +1 -1
- package/build/esm/dev/baseSdk.js +5 -2
- package/build/esm/dev/baseSdk.js.map +1 -1
- package/build/esm/dev/durableobject.js +2 -2
- package/build/esm/dev/durableobject.js.map +1 -1
- package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js +3 -3
- package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js +3 -3
- package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js +3 -3
- package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentSqlStorage.js +3 -3
- package/build/esm/dev/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js +2 -2
- package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentD1.js +4 -4
- package/build/esm/dev/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentQueue.js +3 -3
- package/build/esm/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js +3 -3
- package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentR2.js +3 -3
- package/build/esm/dev/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/esm/dev/options.js +2 -2
- package/build/esm/dev/options.js.map +1 -1
- package/build/esm/dev/package.json +1 -1
- package/build/esm/dev/utils/asyncContextStrategy.js +11 -0
- package/build/esm/dev/utils/asyncContextStrategy.js.map +1 -0
- package/build/esm/dev/withSentry.js +2 -2
- package/build/esm/dev/withSentry.js.map +1 -1
- package/build/esm/dev/workflows.js +5 -5
- package/build/esm/dev/workflows.js.map +1 -1
- package/build/esm/dev/wrapRequestHandlerWithInit.js +1 -1
- package/build/esm/dev/wrapRequestHandlerWithInit.js.map +1 -1
- package/build/esm/prod/baseSdk.js +5 -2
- package/build/esm/prod/baseSdk.js.map +1 -1
- package/build/esm/prod/durableobject.js +2 -2
- package/build/esm/prod/durableobject.js.map +1 -1
- package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js +3 -3
- package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js +3 -3
- package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +3 -3
- package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentSqlStorage.js +3 -3
- package/build/esm/prod/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js +2 -2
- package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentD1.js +4 -4
- package/build/esm/prod/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentQueue.js +3 -3
- package/build/esm/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js +3 -3
- package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentR2.js +3 -3
- package/build/esm/prod/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/esm/prod/options.js +2 -2
- package/build/esm/prod/options.js.map +1 -1
- package/build/esm/prod/package.json +1 -1
- package/build/esm/prod/utils/asyncContextStrategy.js +11 -0
- package/build/esm/prod/utils/asyncContextStrategy.js.map +1 -0
- package/build/esm/prod/withSentry.js +2 -2
- package/build/esm/prod/withSentry.js.map +1 -1
- package/build/esm/prod/workflows.js +5 -5
- package/build/esm/prod/workflows.js.map +1 -1
- package/build/esm/prod/wrapRequestHandlerWithInit.js +1 -1
- package/build/esm/prod/wrapRequestHandlerWithInit.js.map +1 -1
- package/build/types/baseSdk.d.ts.map +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentSqlStorage.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentD1.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentR2.d.ts.map +1 -1
- package/build/types/utils/asyncContextStrategy.d.ts +6 -0
- package/build/types/utils/asyncContextStrategy.d.ts.map +1 -0
- package/build/types/workflows.d.ts.map +1 -1
- package/build/types/wrapRequestHandlerWithInit.d.ts.map +1 -1
- package/package.json +5 -5
- package/build/cjs/dev/utils/streaming.js +0 -16
- package/build/cjs/dev/utils/streaming.js.map +0 -1
- package/build/cjs/prod/utils/streaming.js +0 -16
- package/build/cjs/prod/utils/streaming.js.map +0 -1
- package/build/esm/dev/utils/streaming.js +0 -14
- package/build/esm/dev/utils/streaming.js.map +0 -1
- package/build/esm/prod/utils/streaming.js +0 -14
- package/build/esm/prod/utils/streaming.js.map +0 -1
- package/build/types/utils/streaming.d.ts +0 -17
- package/build/types/utils/streaming.d.ts.map +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
function classifyResponseStreaming(res) {
|
|
2
|
-
if (!res.body) {
|
|
3
|
-
return { isStreaming: false };
|
|
4
|
-
}
|
|
5
|
-
const contentType = res.headers.get("content-type") ?? "";
|
|
6
|
-
const contentLength = res.headers.get("content-length");
|
|
7
|
-
if (/^text\/event-stream\b/i.test(contentType) || /^application\/(x-)?ndjson\b/i.test(contentType) || /^application\/stream\+json\b/i.test(contentType) || /^text\/plain\b/i.test(contentType) && !contentLength) {
|
|
8
|
-
return { isStreaming: true };
|
|
9
|
-
}
|
|
10
|
-
return { isStreaming: false };
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { classifyResponseStreaming };
|
|
14
|
-
//# sourceMappingURL=streaming.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.js","sources":["../../../../src/utils/streaming.ts"],"sourcesContent":["export type StreamingGuess = {\n isStreaming: boolean;\n};\n\n/**\n * Classifies a Response as streaming or non-streaming.\n *\n * Heuristics:\n * - No body → not streaming\n * - Known streaming Content-Types → streaming (SSE, NDJSON, JSON streaming)\n * - text/plain without Content-Length → streaming (some AI APIs)\n * - Otherwise → not streaming (conservative default, including HTML/SSR)\n *\n * We avoid probing the stream to prevent blocking on transform streams (like injectTraceMetaTags)\n * or SSR streams that may not have data ready immediately.\n */\nexport function classifyResponseStreaming(res: Response): StreamingGuess {\n if (!res.body) {\n return { isStreaming: false };\n }\n\n const contentType = res.headers.get('content-type') ?? '';\n const contentLength = res.headers.get('content-length');\n\n // Streaming: Known streaming content types\n // - text/event-stream: Server-Sent Events (Vercel AI SDK, real-time APIs)\n // - application/x-ndjson, application/ndjson: Newline-delimited JSON\n // - application/stream+json: JSON streaming\n // - text/plain (without Content-Length): Some AI APIs use this for streaming text\n if (\n /^text\\/event-stream\\b/i.test(contentType) ||\n /^application\\/(x-)?ndjson\\b/i.test(contentType) ||\n /^application\\/stream\\+json\\b/i.test(contentType) ||\n (/^text\\/plain\\b/i.test(contentType) && !contentLength)\n ) {\n return { isStreaming: true };\n }\n\n // Default: treat as non-streaming\n return { isStreaming: false };\n}\n"],"names":[],"mappings":"AAgBO,SAAS,0BAA0B,GAAA,EAA+B;AACvE,EAAA,IAAI,CAAC,IAAI,IAAA,EAAM;AACb,IAAA,OAAO,EAAE,aAAa,KAAA,EAAM;AAAA,EAC9B;AAEA,EAAA,MAAM,WAAA,GAAc,GAAA,CAAI,OAAA,CAAQ,GAAA,CAAI,cAAc,CAAA,IAAK,EAAA;AACvD,EAAA,MAAM,aAAA,GAAgB,GAAA,CAAI,OAAA,CAAQ,GAAA,CAAI,gBAAgB,CAAA;AAOtD,EAAA,IACE,yBAAyB,IAAA,CAAK,WAAW,CAAA,IACzC,8BAAA,CAA+B,KAAK,WAAW,CAAA,IAC/C,+BAAA,CAAgC,IAAA,CAAK,WAAW,CAAA,IAC/C,iBAAA,CAAkB,KAAK,WAAW,CAAA,IAAK,CAAC,aAAA,EACzC;AACA,IAAA,OAAO,EAAE,aAAa,IAAA,EAAK;AAAA,EAC7B;AAGA,EAAA,OAAO,EAAE,aAAa,KAAA,EAAM;AAC9B;;;;"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export type StreamingGuess = {
|
|
2
|
-
isStreaming: boolean;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* Classifies a Response as streaming or non-streaming.
|
|
6
|
-
*
|
|
7
|
-
* Heuristics:
|
|
8
|
-
* - No body → not streaming
|
|
9
|
-
* - Known streaming Content-Types → streaming (SSE, NDJSON, JSON streaming)
|
|
10
|
-
* - text/plain without Content-Length → streaming (some AI APIs)
|
|
11
|
-
* - Otherwise → not streaming (conservative default, including HTML/SSR)
|
|
12
|
-
*
|
|
13
|
-
* We avoid probing the stream to prevent blocking on transform streams (like injectTraceMetaTags)
|
|
14
|
-
* or SSR streams that may not have data ready immediately.
|
|
15
|
-
*/
|
|
16
|
-
export declare function classifyResponseStreaming(res: Response): StreamingGuess;
|
|
17
|
-
//# sourceMappingURL=streaming.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../src/utils/streaming.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,QAAQ,GAAG,cAAc,CAwBvE"}
|