@sentry/cloudflare 11.11.0 → 11.13.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/_virtual/_rolldown/runtime.js +22 -0
- package/build/cjs/dev/baseSdk.js +98 -103
- package/build/cjs/dev/baseSdk.js.map +1 -1
- package/build/cjs/dev/client.js +213 -237
- package/build/cjs/dev/client.js.map +1 -1
- package/build/cjs/dev/clientCache.js +8 -8
- package/build/cjs/dev/clientCache.js.map +1 -1
- package/build/cjs/dev/debug-build.js +9 -5
- package/build/cjs/dev/debug-build.js.map +1 -1
- package/build/cjs/dev/defineCloudflareOptions.js +5 -8
- package/build/cjs/dev/defineCloudflareOptions.js.map +1 -1
- package/build/cjs/dev/durableobject.js +290 -163
- package/build/cjs/dev/durableobject.js.map +1 -1
- package/build/cjs/dev/flush.js +104 -77
- package/build/cjs/dev/flush.js.map +1 -1
- package/build/cjs/dev/index.js +181 -182
- package/build/cjs/dev/instrument.js +53 -39
- package/build/cjs/dev/instrument.js.map +1 -1
- package/build/cjs/dev/instrumentations/agents/index.js +34 -13
- package/build/cjs/dev/instrumentations/agents/index.js.map +1 -1
- package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js +46 -49
- package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/cjs/dev/instrumentations/agents/instrumentAgentRequestConversation.js +23 -16
- package/build/cjs/dev/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
- package/build/cjs/dev/instrumentations/agents/instrumentChatAgentConversation.js +36 -28
- package/build/cjs/dev/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
- package/build/cjs/dev/instrumentations/agents/types.js +103 -58
- package/build/cjs/dev/instrumentations/agents/types.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectHandlers.js +87 -118
- package/build/cjs/dev/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js +46 -44
- package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js +70 -71
- package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -39
- package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentSqlStorage.js +50 -52
- package/build/cjs/dev/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js +136 -123
- package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentD1.js +131 -146
- package/build/cjs/dev/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentEmail.js +63 -61
- package/build/cjs/dev/instrumentations/worker/instrumentEmail.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentEnv.js +83 -87
- package/build/cjs/dev/instrumentations/worker/instrumentEnv.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentFetch.js +41 -48
- package/build/cjs/dev/instrumentations/worker/instrumentFetch.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentFetcher.js +25 -21
- package/build/cjs/dev/instrumentations/worker/instrumentFetcher.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentKV.js +54 -67
- package/build/cjs/dev/instrumentations/worker/instrumentKV.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentQueue.js +100 -76
- package/build/cjs/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js +91 -75
- package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentR2.js +128 -115
- package/build/cjs/dev/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js +90 -94
- package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentTail.js +100 -55
- package/build/cjs/dev/instrumentations/worker/instrumentTail.js.map +1 -1
- package/build/cjs/dev/integrations/cronTriggers.js +130 -85
- package/build/cjs/dev/integrations/cronTriggers.js.map +1 -1
- package/build/cjs/dev/integrations/fetch.js +9 -9
- package/build/cjs/dev/integrations/fetch.js.map +1 -1
- package/build/cjs/dev/integrations/httpServer.js +41 -22
- package/build/cjs/dev/integrations/httpServer.js.map +1 -1
- package/build/cjs/dev/integrations/spotlight.js +52 -55
- package/build/cjs/dev/integrations/spotlight.js.map +1 -1
- package/build/cjs/dev/opentelemetry/tracer.js +10 -8
- package/build/cjs/dev/opentelemetry/tracer.js.map +1 -1
- package/build/cjs/dev/options.js +55 -39
- package/build/cjs/dev/options.js.map +1 -1
- package/build/cjs/dev/orchestrion-deferred-channels.js +45 -29
- package/build/cjs/dev/orchestrion-deferred-channels.js.map +1 -1
- package/build/cjs/dev/orchestrion-diagnostics-channel.js +97 -72
- package/build/cjs/dev/orchestrion-diagnostics-channel.js.map +1 -1
- package/build/cjs/dev/pages-plugin.js +20 -21
- package/build/cjs/dev/pages-plugin.js.map +1 -1
- package/build/cjs/dev/request.js +16 -10
- package/build/cjs/dev/request.js.map +1 -1
- package/build/cjs/dev/scope-utils.js +12 -12
- package/build/cjs/dev/scope-utils.js.map +1 -1
- package/build/cjs/dev/sdk.js +24 -15
- package/build/cjs/dev/sdk.js.map +1 -1
- package/build/cjs/dev/transport.js +93 -86
- package/build/cjs/dev/transport.js.map +1 -1
- package/build/cjs/dev/utils/asyncContextStrategy.js +10 -10
- package/build/cjs/dev/utils/asyncContextStrategy.js.map +1 -1
- package/build/cjs/dev/utils/bindingPropagation.js +24 -0
- package/build/cjs/dev/utils/bindingPropagation.js.map +1 -0
- package/build/cjs/dev/utils/cloudflareTrace.js +34 -0
- package/build/cjs/dev/utils/cloudflareTrace.js.map +1 -0
- package/build/cjs/dev/utils/instrumentContext.js +74 -58
- package/build/cjs/dev/utils/instrumentContext.js.map +1 -1
- package/build/cjs/dev/utils/internalSqlQuery.js +38 -21
- package/build/cjs/dev/utils/internalSqlQuery.js.map +1 -1
- package/build/cjs/dev/utils/internalStorageKey.js +41 -38
- package/build/cjs/dev/utils/internalStorageKey.js.map +1 -1
- package/build/cjs/dev/utils/invocationContext.js +42 -32
- package/build/cjs/dev/utils/invocationContext.js.map +1 -1
- package/build/cjs/dev/utils/invocationScope.js +45 -21
- package/build/cjs/dev/utils/invocationScope.js.map +1 -1
- package/build/cjs/dev/utils/isBinding.js +47 -15
- package/build/cjs/dev/utils/isBinding.js.map +1 -1
- package/build/cjs/dev/utils/isCloudflareClass.js +11 -20
- package/build/cjs/dev/utils/isCloudflareClass.js.map +1 -1
- package/build/cjs/dev/utils/queueTraceMeta.js +33 -0
- package/build/cjs/dev/utils/queueTraceMeta.js.map +1 -0
- package/build/cjs/dev/utils/rpcMeta.js +37 -27
- package/build/cjs/dev/utils/rpcMeta.js.map +1 -1
- package/build/cjs/dev/utils/traceLinks.js +52 -42
- package/build/cjs/dev/utils/traceLinks.js.map +1 -1
- package/build/cjs/dev/vendor/stacktrace.js +32 -24
- package/build/cjs/dev/vendor/stacktrace.js.map +1 -1
- package/build/cjs/dev/vite/agentClass.js +105 -98
- package/build/cjs/dev/vite/agentClass.js.map +1 -1
- package/build/cjs/dev/vite/autoInstrument.js +121 -122
- package/build/cjs/dev/vite/autoInstrument.js.map +1 -1
- package/build/cjs/dev/vite/index.js +44 -21
- package/build/cjs/dev/vite/index.js.map +1 -1
- package/build/cjs/dev/vite/instrumentFile.js +37 -20
- package/build/cjs/dev/vite/instrumentFile.js.map +1 -1
- package/build/cjs/dev/vite/mastraObservability.js +19 -12
- package/build/cjs/dev/vite/mastraObservability.js.map +1 -1
- package/build/cjs/dev/vite/moduleShape.js +220 -201
- package/build/cjs/dev/vite/moduleShape.js.map +1 -1
- package/build/cjs/dev/vite/providedModulePlugin.js +62 -45
- package/build/cjs/dev/vite/providedModulePlugin.js.map +1 -1
- package/build/cjs/dev/vite/transform.js +333 -284
- package/build/cjs/dev/vite/transform.js.map +1 -1
- package/build/cjs/dev/vite/workerEntrypoint.js +66 -57
- package/build/cjs/dev/vite/workerEntrypoint.js.map +1 -1
- package/build/cjs/dev/vite/wranglerConfig.js +92 -67
- package/build/cjs/dev/vite/wranglerConfig.js.map +1 -1
- package/build/cjs/dev/withSentry.js +32 -26
- package/build/cjs/dev/withSentry.js.map +1 -1
- package/build/cjs/dev/workflows.js +165 -149
- package/build/cjs/dev/workflows.js.map +1 -1
- package/build/cjs/dev/wrapMethodWithSentry.js +148 -169
- package/build/cjs/dev/wrapMethodWithSentry.js.map +1 -1
- package/build/cjs/dev/wrapRequestHandlerWithInit.js +78 -72
- package/build/cjs/dev/wrapRequestHandlerWithInit.js.map +1 -1
- package/build/cjs/prod/_virtual/_rolldown/runtime.js +22 -0
- package/build/cjs/prod/baseSdk.js +94 -93
- package/build/cjs/prod/baseSdk.js.map +1 -1
- package/build/cjs/prod/client.js +213 -237
- package/build/cjs/prod/client.js.map +1 -1
- package/build/cjs/prod/clientCache.js +8 -8
- package/build/cjs/prod/clientCache.js.map +1 -1
- package/build/cjs/prod/debug-build.js +9 -5
- package/build/cjs/prod/debug-build.js.map +1 -1
- package/build/cjs/prod/defineCloudflareOptions.js +5 -8
- package/build/cjs/prod/defineCloudflareOptions.js.map +1 -1
- package/build/cjs/prod/durableobject.js +290 -163
- package/build/cjs/prod/durableobject.js.map +1 -1
- package/build/cjs/prod/flush.js +104 -77
- package/build/cjs/prod/flush.js.map +1 -1
- package/build/cjs/prod/index.js +181 -182
- package/build/cjs/prod/instrument.js +53 -39
- package/build/cjs/prod/instrument.js.map +1 -1
- package/build/cjs/prod/instrumentations/agents/index.js +34 -13
- package/build/cjs/prod/instrumentations/agents/index.js.map +1 -1
- package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js +46 -49
- package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/cjs/prod/instrumentations/agents/instrumentAgentRequestConversation.js +23 -16
- package/build/cjs/prod/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
- package/build/cjs/prod/instrumentations/agents/instrumentChatAgentConversation.js +36 -28
- package/build/cjs/prod/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
- package/build/cjs/prod/instrumentations/agents/types.js +103 -58
- package/build/cjs/prod/instrumentations/agents/types.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectHandlers.js +87 -118
- package/build/cjs/prod/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js +46 -44
- package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js +70 -71
- package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -39
- package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentSqlStorage.js +50 -52
- package/build/cjs/prod/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js +136 -123
- package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentD1.js +131 -146
- package/build/cjs/prod/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentEmail.js +63 -61
- package/build/cjs/prod/instrumentations/worker/instrumentEmail.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentEnv.js +83 -87
- package/build/cjs/prod/instrumentations/worker/instrumentEnv.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentFetch.js +41 -48
- package/build/cjs/prod/instrumentations/worker/instrumentFetch.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentFetcher.js +25 -21
- package/build/cjs/prod/instrumentations/worker/instrumentFetcher.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentKV.js +54 -67
- package/build/cjs/prod/instrumentations/worker/instrumentKV.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentQueue.js +100 -76
- package/build/cjs/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js +91 -75
- package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentR2.js +128 -115
- package/build/cjs/prod/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js +90 -94
- package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentTail.js +100 -55
- package/build/cjs/prod/instrumentations/worker/instrumentTail.js.map +1 -1
- package/build/cjs/prod/integrations/cronTriggers.js +130 -85
- package/build/cjs/prod/integrations/cronTriggers.js.map +1 -1
- package/build/cjs/prod/integrations/fetch.js +9 -9
- package/build/cjs/prod/integrations/fetch.js.map +1 -1
- package/build/cjs/prod/integrations/httpServer.js +41 -22
- package/build/cjs/prod/integrations/httpServer.js.map +1 -1
- package/build/cjs/prod/integrations/spotlight.js +52 -55
- package/build/cjs/prod/integrations/spotlight.js.map +1 -1
- package/build/cjs/prod/opentelemetry/tracer.js +10 -8
- package/build/cjs/prod/opentelemetry/tracer.js.map +1 -1
- package/build/cjs/prod/options.js +37 -24
- package/build/cjs/prod/options.js.map +1 -1
- package/build/cjs/prod/orchestrion-deferred-channels.js +45 -29
- package/build/cjs/prod/orchestrion-deferred-channels.js.map +1 -1
- package/build/cjs/prod/orchestrion-diagnostics-channel.js +97 -72
- package/build/cjs/prod/orchestrion-diagnostics-channel.js.map +1 -1
- package/build/cjs/prod/pages-plugin.js +20 -21
- package/build/cjs/prod/pages-plugin.js.map +1 -1
- package/build/cjs/prod/request.js +16 -10
- package/build/cjs/prod/request.js.map +1 -1
- package/build/cjs/prod/scope-utils.js +12 -12
- package/build/cjs/prod/scope-utils.js.map +1 -1
- package/build/cjs/prod/sdk.js +24 -15
- package/build/cjs/prod/sdk.js.map +1 -1
- package/build/cjs/prod/transport.js +93 -86
- package/build/cjs/prod/transport.js.map +1 -1
- package/build/cjs/prod/utils/asyncContextStrategy.js +10 -10
- package/build/cjs/prod/utils/asyncContextStrategy.js.map +1 -1
- package/build/cjs/prod/utils/bindingPropagation.js +24 -0
- package/build/cjs/prod/utils/bindingPropagation.js.map +1 -0
- package/build/cjs/prod/utils/cloudflareTrace.js +34 -0
- package/build/cjs/prod/utils/cloudflareTrace.js.map +1 -0
- package/build/cjs/prod/utils/instrumentContext.js +74 -58
- package/build/cjs/prod/utils/instrumentContext.js.map +1 -1
- package/build/cjs/prod/utils/internalSqlQuery.js +38 -21
- package/build/cjs/prod/utils/internalSqlQuery.js.map +1 -1
- package/build/cjs/prod/utils/internalStorageKey.js +41 -38
- package/build/cjs/prod/utils/internalStorageKey.js.map +1 -1
- package/build/cjs/prod/utils/invocationContext.js +42 -32
- package/build/cjs/prod/utils/invocationContext.js.map +1 -1
- package/build/cjs/prod/utils/invocationScope.js +45 -21
- package/build/cjs/prod/utils/invocationScope.js.map +1 -1
- package/build/cjs/prod/utils/isBinding.js +47 -15
- package/build/cjs/prod/utils/isBinding.js.map +1 -1
- package/build/cjs/prod/utils/isCloudflareClass.js +11 -20
- package/build/cjs/prod/utils/isCloudflareClass.js.map +1 -1
- package/build/cjs/prod/utils/queueTraceMeta.js +33 -0
- package/build/cjs/prod/utils/queueTraceMeta.js.map +1 -0
- package/build/cjs/prod/utils/rpcMeta.js +37 -27
- package/build/cjs/prod/utils/rpcMeta.js.map +1 -1
- package/build/cjs/prod/utils/traceLinks.js +52 -42
- package/build/cjs/prod/utils/traceLinks.js.map +1 -1
- package/build/cjs/prod/vendor/stacktrace.js +32 -24
- package/build/cjs/prod/vendor/stacktrace.js.map +1 -1
- package/build/cjs/prod/vite/agentClass.js +105 -98
- package/build/cjs/prod/vite/agentClass.js.map +1 -1
- package/build/cjs/prod/vite/autoInstrument.js +121 -122
- package/build/cjs/prod/vite/autoInstrument.js.map +1 -1
- package/build/cjs/prod/vite/index.js +44 -21
- package/build/cjs/prod/vite/index.js.map +1 -1
- package/build/cjs/prod/vite/instrumentFile.js +37 -20
- package/build/cjs/prod/vite/instrumentFile.js.map +1 -1
- package/build/cjs/prod/vite/mastraObservability.js +19 -12
- package/build/cjs/prod/vite/mastraObservability.js.map +1 -1
- package/build/cjs/prod/vite/moduleShape.js +220 -201
- package/build/cjs/prod/vite/moduleShape.js.map +1 -1
- package/build/cjs/prod/vite/providedModulePlugin.js +62 -45
- package/build/cjs/prod/vite/providedModulePlugin.js.map +1 -1
- package/build/cjs/prod/vite/transform.js +333 -284
- package/build/cjs/prod/vite/transform.js.map +1 -1
- package/build/cjs/prod/vite/workerEntrypoint.js +66 -57
- package/build/cjs/prod/vite/workerEntrypoint.js.map +1 -1
- package/build/cjs/prod/vite/wranglerConfig.js +92 -67
- package/build/cjs/prod/vite/wranglerConfig.js.map +1 -1
- package/build/cjs/prod/withSentry.js +32 -26
- package/build/cjs/prod/withSentry.js.map +1 -1
- package/build/cjs/prod/workflows.js +165 -149
- package/build/cjs/prod/workflows.js.map +1 -1
- package/build/cjs/prod/wrapMethodWithSentry.js +148 -169
- package/build/cjs/prod/wrapMethodWithSentry.js.map +1 -1
- package/build/cjs/prod/wrapRequestHandlerWithInit.js +78 -72
- package/build/cjs/prod/wrapRequestHandlerWithInit.js.map +1 -1
- package/build/esm/dev/baseSdk.js +98 -101
- package/build/esm/dev/baseSdk.js.map +1 -1
- package/build/esm/dev/client.js +213 -235
- package/build/esm/dev/client.js.map +1 -1
- package/build/esm/dev/clientCache.js +8 -6
- package/build/esm/dev/clientCache.js.map +1 -1
- package/build/esm/dev/debug-build.js +9 -3
- package/build/esm/dev/debug-build.js.map +1 -1
- package/build/esm/dev/defineCloudflareOptions.js +5 -6
- package/build/esm/dev/defineCloudflareOptions.js.map +1 -1
- package/build/esm/dev/durableobject.js +290 -161
- package/build/esm/dev/durableobject.js.map +1 -1
- package/build/esm/dev/flush.js +104 -75
- package/build/esm/dev/flush.js.map +1 -1
- package/build/esm/dev/index.js +19 -18
- package/build/esm/dev/instrument.js +53 -37
- package/build/esm/dev/instrument.js.map +1 -1
- package/build/esm/dev/instrumentations/agents/index.js +34 -11
- package/build/esm/dev/instrumentations/agents/index.js.map +1 -1
- package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js +46 -47
- package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/esm/dev/instrumentations/agents/instrumentAgentRequestConversation.js +23 -14
- package/build/esm/dev/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
- package/build/esm/dev/instrumentations/agents/instrumentChatAgentConversation.js +36 -26
- package/build/esm/dev/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
- package/build/esm/dev/instrumentations/agents/types.js +103 -56
- package/build/esm/dev/instrumentations/agents/types.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectHandlers.js +87 -116
- package/build/esm/dev/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js +46 -42
- package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js +70 -69
- package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -37
- package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentSqlStorage.js +50 -50
- package/build/esm/dev/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js +136 -121
- package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentD1.js +131 -144
- package/build/esm/dev/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentEmail.js +63 -59
- package/build/esm/dev/instrumentations/worker/instrumentEmail.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentEnv.js +83 -85
- package/build/esm/dev/instrumentations/worker/instrumentEnv.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentFetch.js +41 -46
- package/build/esm/dev/instrumentations/worker/instrumentFetch.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentFetcher.js +25 -19
- package/build/esm/dev/instrumentations/worker/instrumentFetcher.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentKV.js +54 -65
- package/build/esm/dev/instrumentations/worker/instrumentKV.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentQueue.js +100 -74
- package/build/esm/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js +91 -73
- package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentR2.js +128 -113
- package/build/esm/dev/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentScheduled.js +90 -92
- package/build/esm/dev/instrumentations/worker/instrumentScheduled.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentTail.js +100 -53
- package/build/esm/dev/instrumentations/worker/instrumentTail.js.map +1 -1
- package/build/esm/dev/integrations/cronTriggers.js +129 -82
- package/build/esm/dev/integrations/cronTriggers.js.map +1 -1
- package/build/esm/dev/integrations/fetch.js +9 -6
- package/build/esm/dev/integrations/fetch.js.map +1 -1
- package/build/esm/dev/integrations/httpServer.js +40 -19
- package/build/esm/dev/integrations/httpServer.js.map +1 -1
- package/build/esm/dev/integrations/spotlight.js +51 -52
- package/build/esm/dev/integrations/spotlight.js.map +1 -1
- package/build/esm/dev/opentelemetry/tracer.js +10 -6
- package/build/esm/dev/opentelemetry/tracer.js.map +1 -1
- package/build/esm/dev/options.js +55 -37
- package/build/esm/dev/options.js.map +1 -1
- package/build/esm/dev/orchestrion-deferred-channels.js +45 -27
- package/build/esm/dev/orchestrion-deferred-channels.js.map +1 -1
- package/build/esm/dev/orchestrion-diagnostics-channel.js +87 -66
- package/build/esm/dev/orchestrion-diagnostics-channel.js.map +1 -1
- package/build/esm/dev/package.json +1 -1
- package/build/esm/dev/pages-plugin.js +20 -19
- package/build/esm/dev/pages-plugin.js.map +1 -1
- package/build/esm/dev/request.js +14 -7
- package/build/esm/dev/request.js.map +1 -1
- package/build/esm/dev/scope-utils.js +12 -10
- package/build/esm/dev/scope-utils.js.map +1 -1
- package/build/esm/dev/sdk.js +23 -13
- package/build/esm/dev/sdk.js.map +1 -1
- package/build/esm/dev/transport.js +93 -84
- package/build/esm/dev/transport.js.map +1 -1
- package/build/esm/dev/utils/asyncContextStrategy.js +10 -8
- package/build/esm/dev/utils/asyncContextStrategy.js.map +1 -1
- package/build/esm/dev/utils/bindingPropagation.js +23 -0
- package/build/esm/dev/utils/bindingPropagation.js.map +1 -0
- package/build/esm/dev/utils/cloudflareTrace.js +34 -0
- package/build/esm/dev/utils/cloudflareTrace.js.map +1 -0
- package/build/esm/dev/utils/instrumentContext.js +74 -56
- package/build/esm/dev/utils/instrumentContext.js.map +1 -1
- package/build/esm/dev/utils/internalSqlQuery.js +38 -19
- package/build/esm/dev/utils/internalSqlQuery.js.map +1 -1
- package/build/esm/dev/utils/internalStorageKey.js +41 -36
- package/build/esm/dev/utils/internalStorageKey.js.map +1 -1
- package/build/esm/dev/utils/invocationContext.js +42 -30
- package/build/esm/dev/utils/invocationContext.js.map +1 -1
- package/build/esm/dev/utils/invocationScope.js +45 -19
- package/build/esm/dev/utils/invocationScope.js.map +1 -1
- package/build/esm/dev/utils/isBinding.js +47 -13
- package/build/esm/dev/utils/isBinding.js.map +1 -1
- package/build/esm/dev/utils/isCloudflareClass.js +11 -18
- package/build/esm/dev/utils/isCloudflareClass.js.map +1 -1
- package/build/esm/dev/utils/queueTraceMeta.js +32 -0
- package/build/esm/dev/utils/queueTraceMeta.js.map +1 -0
- package/build/esm/dev/utils/rpcMeta.js +37 -25
- package/build/esm/dev/utils/rpcMeta.js.map +1 -1
- package/build/esm/dev/utils/traceLinks.js +52 -40
- package/build/esm/dev/utils/traceLinks.js.map +1 -1
- package/build/esm/dev/vendor/stacktrace.js +31 -21
- package/build/esm/dev/vendor/stacktrace.js.map +1 -1
- package/build/esm/dev/vite/agentClass.js +105 -96
- package/build/esm/dev/vite/agentClass.js.map +1 -1
- package/build/esm/dev/vite/autoInstrument.js +121 -120
- package/build/esm/dev/vite/autoInstrument.js.map +1 -1
- package/build/esm/dev/vite/index.js +43 -19
- package/build/esm/dev/vite/index.js.map +1 -1
- package/build/esm/dev/vite/instrumentFile.js +37 -18
- package/build/esm/dev/vite/instrumentFile.js.map +1 -1
- package/build/esm/dev/vite/mastraObservability.js +19 -10
- package/build/esm/dev/vite/mastraObservability.js.map +1 -1
- package/build/esm/dev/vite/moduleShape.js +220 -199
- package/build/esm/dev/vite/moduleShape.js.map +1 -1
- package/build/esm/dev/vite/providedModulePlugin.js +60 -43
- package/build/esm/dev/vite/providedModulePlugin.js.map +1 -1
- package/build/esm/dev/vite/transform.js +331 -282
- package/build/esm/dev/vite/transform.js.map +1 -1
- package/build/esm/dev/vite/workerEntrypoint.js +66 -55
- package/build/esm/dev/vite/workerEntrypoint.js.map +1 -1
- package/build/esm/dev/vite/wranglerConfig.js +92 -65
- package/build/esm/dev/vite/wranglerConfig.js.map +1 -1
- package/build/esm/dev/withSentry.js +32 -24
- package/build/esm/dev/withSentry.js.map +1 -1
- package/build/esm/dev/workflows.js +165 -147
- package/build/esm/dev/workflows.js.map +1 -1
- package/build/esm/dev/wrapMethodWithSentry.js +148 -167
- package/build/esm/dev/wrapMethodWithSentry.js.map +1 -1
- package/build/esm/dev/wrapRequestHandlerWithInit.js +78 -70
- package/build/esm/dev/wrapRequestHandlerWithInit.js.map +1 -1
- package/build/esm/prod/baseSdk.js +94 -91
- package/build/esm/prod/baseSdk.js.map +1 -1
- package/build/esm/prod/client.js +213 -235
- package/build/esm/prod/client.js.map +1 -1
- package/build/esm/prod/clientCache.js +8 -6
- package/build/esm/prod/clientCache.js.map +1 -1
- package/build/esm/prod/debug-build.js +9 -3
- package/build/esm/prod/debug-build.js.map +1 -1
- package/build/esm/prod/defineCloudflareOptions.js +5 -6
- package/build/esm/prod/defineCloudflareOptions.js.map +1 -1
- package/build/esm/prod/durableobject.js +290 -161
- package/build/esm/prod/durableobject.js.map +1 -1
- package/build/esm/prod/flush.js +104 -75
- package/build/esm/prod/flush.js.map +1 -1
- package/build/esm/prod/index.js +19 -18
- package/build/esm/prod/instrument.js +53 -37
- package/build/esm/prod/instrument.js.map +1 -1
- package/build/esm/prod/instrumentations/agents/index.js +34 -11
- package/build/esm/prod/instrumentations/agents/index.js.map +1 -1
- package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js +46 -47
- package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/esm/prod/instrumentations/agents/instrumentAgentRequestConversation.js +23 -14
- package/build/esm/prod/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
- package/build/esm/prod/instrumentations/agents/instrumentChatAgentConversation.js +36 -26
- package/build/esm/prod/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
- package/build/esm/prod/instrumentations/agents/types.js +103 -56
- package/build/esm/prod/instrumentations/agents/types.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectHandlers.js +87 -116
- package/build/esm/prod/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js +46 -42
- package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js +70 -69
- package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -37
- package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentSqlStorage.js +50 -50
- package/build/esm/prod/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js +136 -121
- package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentD1.js +131 -144
- package/build/esm/prod/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentEmail.js +63 -59
- package/build/esm/prod/instrumentations/worker/instrumentEmail.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentEnv.js +83 -85
- package/build/esm/prod/instrumentations/worker/instrumentEnv.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentFetch.js +41 -46
- package/build/esm/prod/instrumentations/worker/instrumentFetch.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentFetcher.js +25 -19
- package/build/esm/prod/instrumentations/worker/instrumentFetcher.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentKV.js +54 -65
- package/build/esm/prod/instrumentations/worker/instrumentKV.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentQueue.js +100 -74
- package/build/esm/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js +91 -73
- package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentR2.js +128 -113
- package/build/esm/prod/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentScheduled.js +90 -92
- package/build/esm/prod/instrumentations/worker/instrumentScheduled.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentTail.js +100 -53
- package/build/esm/prod/instrumentations/worker/instrumentTail.js.map +1 -1
- package/build/esm/prod/integrations/cronTriggers.js +129 -82
- package/build/esm/prod/integrations/cronTriggers.js.map +1 -1
- package/build/esm/prod/integrations/fetch.js +9 -6
- package/build/esm/prod/integrations/fetch.js.map +1 -1
- package/build/esm/prod/integrations/httpServer.js +40 -19
- package/build/esm/prod/integrations/httpServer.js.map +1 -1
- package/build/esm/prod/integrations/spotlight.js +51 -52
- package/build/esm/prod/integrations/spotlight.js.map +1 -1
- package/build/esm/prod/opentelemetry/tracer.js +10 -6
- package/build/esm/prod/opentelemetry/tracer.js.map +1 -1
- package/build/esm/prod/options.js +37 -22
- package/build/esm/prod/options.js.map +1 -1
- package/build/esm/prod/orchestrion-deferred-channels.js +45 -27
- package/build/esm/prod/orchestrion-deferred-channels.js.map +1 -1
- package/build/esm/prod/orchestrion-diagnostics-channel.js +87 -66
- package/build/esm/prod/orchestrion-diagnostics-channel.js.map +1 -1
- package/build/esm/prod/package.json +1 -1
- package/build/esm/prod/pages-plugin.js +20 -19
- package/build/esm/prod/pages-plugin.js.map +1 -1
- package/build/esm/prod/request.js +14 -7
- package/build/esm/prod/request.js.map +1 -1
- package/build/esm/prod/scope-utils.js +12 -10
- package/build/esm/prod/scope-utils.js.map +1 -1
- package/build/esm/prod/sdk.js +23 -13
- package/build/esm/prod/sdk.js.map +1 -1
- package/build/esm/prod/transport.js +93 -84
- package/build/esm/prod/transport.js.map +1 -1
- package/build/esm/prod/utils/asyncContextStrategy.js +10 -8
- package/build/esm/prod/utils/asyncContextStrategy.js.map +1 -1
- package/build/esm/prod/utils/bindingPropagation.js +23 -0
- package/build/esm/prod/utils/bindingPropagation.js.map +1 -0
- package/build/esm/prod/utils/cloudflareTrace.js +34 -0
- package/build/esm/prod/utils/cloudflareTrace.js.map +1 -0
- package/build/esm/prod/utils/instrumentContext.js +74 -56
- package/build/esm/prod/utils/instrumentContext.js.map +1 -1
- package/build/esm/prod/utils/internalSqlQuery.js +38 -19
- package/build/esm/prod/utils/internalSqlQuery.js.map +1 -1
- package/build/esm/prod/utils/internalStorageKey.js +41 -36
- package/build/esm/prod/utils/internalStorageKey.js.map +1 -1
- package/build/esm/prod/utils/invocationContext.js +42 -30
- package/build/esm/prod/utils/invocationContext.js.map +1 -1
- package/build/esm/prod/utils/invocationScope.js +45 -19
- package/build/esm/prod/utils/invocationScope.js.map +1 -1
- package/build/esm/prod/utils/isBinding.js +47 -13
- package/build/esm/prod/utils/isBinding.js.map +1 -1
- package/build/esm/prod/utils/isCloudflareClass.js +11 -18
- package/build/esm/prod/utils/isCloudflareClass.js.map +1 -1
- package/build/esm/prod/utils/queueTraceMeta.js +32 -0
- package/build/esm/prod/utils/queueTraceMeta.js.map +1 -0
- package/build/esm/prod/utils/rpcMeta.js +37 -25
- package/build/esm/prod/utils/rpcMeta.js.map +1 -1
- package/build/esm/prod/utils/traceLinks.js +52 -40
- package/build/esm/prod/utils/traceLinks.js.map +1 -1
- package/build/esm/prod/vendor/stacktrace.js +31 -21
- package/build/esm/prod/vendor/stacktrace.js.map +1 -1
- package/build/esm/prod/vite/agentClass.js +105 -96
- package/build/esm/prod/vite/agentClass.js.map +1 -1
- package/build/esm/prod/vite/autoInstrument.js +121 -120
- package/build/esm/prod/vite/autoInstrument.js.map +1 -1
- package/build/esm/prod/vite/index.js +43 -19
- package/build/esm/prod/vite/index.js.map +1 -1
- package/build/esm/prod/vite/instrumentFile.js +37 -18
- package/build/esm/prod/vite/instrumentFile.js.map +1 -1
- package/build/esm/prod/vite/mastraObservability.js +19 -10
- package/build/esm/prod/vite/mastraObservability.js.map +1 -1
- package/build/esm/prod/vite/moduleShape.js +220 -199
- package/build/esm/prod/vite/moduleShape.js.map +1 -1
- package/build/esm/prod/vite/providedModulePlugin.js +60 -43
- package/build/esm/prod/vite/providedModulePlugin.js.map +1 -1
- package/build/esm/prod/vite/transform.js +331 -282
- package/build/esm/prod/vite/transform.js.map +1 -1
- package/build/esm/prod/vite/workerEntrypoint.js +66 -55
- package/build/esm/prod/vite/workerEntrypoint.js.map +1 -1
- package/build/esm/prod/vite/wranglerConfig.js +92 -65
- package/build/esm/prod/vite/wranglerConfig.js.map +1 -1
- package/build/esm/prod/withSentry.js +32 -24
- package/build/esm/prod/withSentry.js.map +1 -1
- package/build/esm/prod/workflows.js +165 -147
- package/build/esm/prod/workflows.js.map +1 -1
- package/build/esm/prod/wrapMethodWithSentry.js +148 -167
- package/build/esm/prod/wrapMethodWithSentry.js.map +1 -1
- package/build/esm/prod/wrapRequestHandlerWithInit.js +78 -70
- package/build/esm/prod/wrapRequestHandlerWithInit.js.map +1 -1
- package/build/types/client.d.ts +32 -1
- package/build/types/client.d.ts.map +1 -1
- package/build/types/durableobject.d.ts.map +1 -1
- package/build/types/index.d.ts +3 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentEmail.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentEnv.d.ts +1 -1
- package/build/types/instrumentations/worker/instrumentEnv.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentFetcher.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentQueue.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentQueueProducer.d.ts +1 -1
- package/build/types/instrumentations/worker/instrumentQueueProducer.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentScheduled.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentTail.d.ts +4 -2
- package/build/types/instrumentations/worker/instrumentTail.d.ts.map +1 -1
- package/build/types/utils/{rpcPropagation.d.ts → bindingPropagation.d.ts} +6 -1
- package/build/types/utils/bindingPropagation.d.ts.map +1 -0
- package/build/types/utils/cloudflareTrace.d.ts +13 -0
- package/build/types/utils/cloudflareTrace.d.ts.map +1 -0
- package/build/types/utils/queueTraceMeta.d.ts +7 -0
- package/build/types/utils/queueTraceMeta.d.ts.map +1 -0
- package/build/types/vite/autoInstrument.d.ts.map +1 -1
- package/build/types/vite/index.d.ts.map +1 -1
- package/build/types/vite/providedModulePlugin.d.ts +15 -11
- package/build/types/vite/providedModulePlugin.d.ts.map +1 -1
- package/build/types/workflows.d.ts.map +1 -1
- package/build/types/wrapMethodWithSentry.d.ts.map +1 -1
- package/build/types/wrapRequestHandlerWithInit.d.ts.map +1 -1
- package/package.json +20 -21
- package/build/cjs/dev/index.js.map +0 -1
- package/build/cjs/dev/utils/rpcPropagation.js +0 -15
- package/build/cjs/dev/utils/rpcPropagation.js.map +0 -1
- package/build/cjs/dev/vite/flueRuntime.js +0 -15
- package/build/cjs/dev/vite/flueRuntime.js.map +0 -1
- package/build/cjs/prod/index.js.map +0 -1
- package/build/cjs/prod/utils/rpcPropagation.js +0 -15
- package/build/cjs/prod/utils/rpcPropagation.js.map +0 -1
- package/build/cjs/prod/vite/flueRuntime.js +0 -15
- package/build/cjs/prod/vite/flueRuntime.js.map +0 -1
- package/build/esm/dev/index.js.map +0 -1
- package/build/esm/dev/utils/rpcPropagation.js +0 -13
- package/build/esm/dev/utils/rpcPropagation.js.map +0 -1
- package/build/esm/dev/vite/flueRuntime.js +0 -13
- package/build/esm/dev/vite/flueRuntime.js.map +0 -1
- package/build/esm/prod/index.js.map +0 -1
- package/build/esm/prod/utils/rpcPropagation.js +0 -13
- package/build/esm/prod/utils/rpcPropagation.js.map +0 -1
- package/build/esm/prod/vite/flueRuntime.js +0 -13
- package/build/esm/prod/vite/flueRuntime.js.map +0 -1
- package/build/types/utils/rpcPropagation.d.ts.map +0 -1
- package/build/types/vite/flueRuntime.d.ts +0 -12
- package/build/types/vite/flueRuntime.d.ts.map +0 -1
|
@@ -1,91 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
import { isAiBinding, isD1Database, isDurableObjectNamespace, isJSRPC, isKVNamespace, isQueue, isR2Bucket } from "../../utils/isBinding.js";
|
|
2
|
+
import { instrumentD1 } from "./instrumentD1.js";
|
|
3
|
+
import { appendRpcMeta } from "../../utils/rpcMeta.js";
|
|
4
|
+
import { createBindingPropagationResolver, createRpcPropagationResolver } from "../../utils/bindingPropagation.js";
|
|
5
|
+
import { STUB_NON_RPC_METHODS, instrumentDurableObjectNamespace } from "../instrumentDurableObjectNamespace.js";
|
|
6
|
+
import { instrumentFetcher } from "./instrumentFetcher.js";
|
|
7
|
+
import { instrumentKV } from "./instrumentKV.js";
|
|
8
|
+
import { instrumentQueueProducer } from "./instrumentQueueProducer.js";
|
|
9
|
+
import { instrumentR2Bucket } from "./instrumentR2.js";
|
|
10
|
+
import { isObjectLike } from "@sentry/core";
|
|
11
|
+
import { instrumentWorkersAiClient } from "@sentry/server-utils";
|
|
12
|
+
// src/instrumentations/worker/instrumentEnv.ts
|
|
13
13
|
function isProxyable(item) {
|
|
14
|
-
|
|
14
|
+
return isObjectLike(item) || typeof item === "function";
|
|
15
15
|
}
|
|
16
16
|
const instrumentedBindings = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
/**
|
|
18
|
+
* Wraps the Cloudflare `env` object in a Proxy that detects binding types
|
|
19
|
+
* on property access and returns instrumented versions.
|
|
20
|
+
*
|
|
21
|
+
* Currently detects:
|
|
22
|
+
* - DurableObjectNamespace (via `idFromName` duck-typing)
|
|
23
|
+
* - Service bindings / JSRPC proxies
|
|
24
|
+
* - Queue producers (via `send` + `sendBatch` duck-typing)
|
|
25
|
+
* - Workers KV namespaces (via `get` + `put` + `list` + `getWithMetadata` duck-typing)
|
|
26
|
+
* - R2 Buckets (via `head` + `put` + `createMultipartUpload` duck-typing)
|
|
27
|
+
* - Workers AI (via `run` + `gateway` + `toMarkdown` duck-typing)
|
|
28
|
+
*
|
|
29
|
+
* @param env - The Cloudflare env object to instrument
|
|
30
|
+
* @param options - Optional CloudflareOptions to control RPC and Queue trace propagation
|
|
31
|
+
*/
|
|
17
32
|
function instrumentEnv(env, options) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return instrumentFetcher((...args) => Reflect.apply(value, target2, args));
|
|
72
|
-
}
|
|
73
|
-
if (p === "connect" && typeof value === "function") {
|
|
74
|
-
return (...args) => Reflect.apply(value, target2, args);
|
|
75
|
-
}
|
|
76
|
-
if (propagateRpcTrace && typeof value === "function" && typeof p === "string" && !STUB_NON_RPC_METHODS.has(p)) {
|
|
77
|
-
return (...args) => Reflect.apply(value, target2, appendRpcMeta(args));
|
|
78
|
-
}
|
|
79
|
-
return value;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
instrumentedBindings.set(item, instrumented);
|
|
83
|
-
return instrumented;
|
|
84
|
-
}
|
|
85
|
-
return item;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
33
|
+
if (!env || typeof env !== "object") return env;
|
|
34
|
+
const shouldPropagateRpcTrace = createRpcPropagationResolver(options);
|
|
35
|
+
const shouldPropagateQueueTrace = createBindingPropagationResolver(options?.queueTracePropagationBindings);
|
|
36
|
+
return new Proxy(env, { get(target, prop, receiver) {
|
|
37
|
+
const item = Reflect.get(target, prop, receiver);
|
|
38
|
+
if (!isProxyable(item)) return item;
|
|
39
|
+
const cached = instrumentedBindings.get(item);
|
|
40
|
+
if (cached) return cached;
|
|
41
|
+
if (isD1Database(item)) {
|
|
42
|
+
const instrumented = instrumentD1(item);
|
|
43
|
+
instrumentedBindings.set(item, instrumented);
|
|
44
|
+
return instrumented;
|
|
45
|
+
}
|
|
46
|
+
if (isQueue(item)) {
|
|
47
|
+
const bindingName = typeof prop === "string" ? prop : String(prop);
|
|
48
|
+
const instrumented = instrumentQueueProducer(item, bindingName, shouldPropagateQueueTrace(bindingName));
|
|
49
|
+
instrumentedBindings.set(item, instrumented);
|
|
50
|
+
return instrumented;
|
|
51
|
+
}
|
|
52
|
+
if (isKVNamespace(item)) {
|
|
53
|
+
const instrumented = instrumentKV(item, typeof prop === "string" ? prop : String(prop));
|
|
54
|
+
instrumentedBindings.set(item, instrumented);
|
|
55
|
+
return instrumented;
|
|
56
|
+
}
|
|
57
|
+
if (isR2Bucket(item)) {
|
|
58
|
+
const instrumented = instrumentR2Bucket(item, typeof prop === "string" ? prop : String(prop));
|
|
59
|
+
instrumentedBindings.set(item, instrumented);
|
|
60
|
+
return instrumented;
|
|
61
|
+
}
|
|
62
|
+
if (isAiBinding(item)) {
|
|
63
|
+
const instrumented = instrumentWorkersAiClient(item);
|
|
64
|
+
instrumentedBindings.set(item, instrumented);
|
|
65
|
+
return instrumented;
|
|
66
|
+
}
|
|
67
|
+
const propagateRpcTrace = shouldPropagateRpcTrace(String(prop));
|
|
68
|
+
if (isDurableObjectNamespace(item)) {
|
|
69
|
+
const instrumented = instrumentDurableObjectNamespace(item, propagateRpcTrace);
|
|
70
|
+
instrumentedBindings.set(item, instrumented);
|
|
71
|
+
return instrumented;
|
|
72
|
+
}
|
|
73
|
+
if (isJSRPC(item)) {
|
|
74
|
+
const instrumented = new Proxy(item, { get(target, p) {
|
|
75
|
+
const value = Reflect.get(target, p);
|
|
76
|
+
if (p === "fetch" && typeof value === "function") return instrumentFetcher((...args) => Reflect.apply(value, target, args));
|
|
77
|
+
if (p === "connect" && typeof value === "function") return (...args) => Reflect.apply(value, target, args);
|
|
78
|
+
if (propagateRpcTrace && typeof value === "function" && typeof p === "string" && !STUB_NON_RPC_METHODS.has(p)) return (...args) => Reflect.apply(value, target, appendRpcMeta(args));
|
|
79
|
+
return value;
|
|
80
|
+
} });
|
|
81
|
+
instrumentedBindings.set(item, instrumented);
|
|
82
|
+
return instrumented;
|
|
83
|
+
}
|
|
84
|
+
return item;
|
|
85
|
+
} });
|
|
88
86
|
}
|
|
89
|
-
|
|
90
87
|
export { instrumentEnv };
|
|
91
|
-
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=instrumentEnv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentEnv.js","sources":["../../../../../src/instrumentations/worker/instrumentEnv.ts"],"sourcesContent":["import { isObjectLike } from '@sentry/core';\nimport { instrumentWorkersAiClient } from '@sentry/server-utils';\nimport type { CloudflareOptions } from '../../client';\nimport {\n isAiBinding,\n isD1Database,\n isDurableObjectNamespace,\n isJSRPC,\n isKVNamespace,\n isQueue,\n isR2Bucket,\n} from '../../utils/isBinding';\nimport { instrumentD1 } from './instrumentD1';\nimport { appendRpcMeta } from '../../utils/rpcMeta';\nimport { createRpcPropagationResolver } from '../../utils/
|
|
1
|
+
{"version":3,"file":"instrumentEnv.js","names":[],"sources":["../../../../../src/instrumentations/worker/instrumentEnv.ts"],"sourcesContent":["import { isObjectLike } from '@sentry/core';\nimport { instrumentWorkersAiClient } from '@sentry/server-utils';\nimport type { CloudflareOptions } from '../../client';\nimport {\n isAiBinding,\n isD1Database,\n isDurableObjectNamespace,\n isJSRPC,\n isKVNamespace,\n isQueue,\n isR2Bucket,\n} from '../../utils/isBinding';\nimport { instrumentD1 } from './instrumentD1';\nimport { appendRpcMeta } from '../../utils/rpcMeta';\nimport { createBindingPropagationResolver, createRpcPropagationResolver } from '../../utils/bindingPropagation';\nimport { instrumentDurableObjectNamespace, STUB_NON_RPC_METHODS } from '../instrumentDurableObjectNamespace';\nimport { instrumentFetcher } from './instrumentFetcher';\nimport { instrumentKV } from './instrumentKV';\nimport { instrumentQueueProducer } from './instrumentQueueProducer';\nimport { instrumentR2Bucket } from './instrumentR2';\n\nfunction isProxyable(item: unknown): item is object {\n return isObjectLike(item) || typeof item === 'function';\n}\n\nconst instrumentedBindings = new WeakMap<object, unknown>();\n\n/**\n * Wraps the Cloudflare `env` object in a Proxy that detects binding types\n * on property access and returns instrumented versions.\n *\n * Currently detects:\n * - DurableObjectNamespace (via `idFromName` duck-typing)\n * - Service bindings / JSRPC proxies\n * - Queue producers (via `send` + `sendBatch` duck-typing)\n * - Workers KV namespaces (via `get` + `put` + `list` + `getWithMetadata` duck-typing)\n * - R2 Buckets (via `head` + `put` + `createMultipartUpload` duck-typing)\n * - Workers AI (via `run` + `gateway` + `toMarkdown` duck-typing)\n *\n * @param env - The Cloudflare env object to instrument\n * @param options - Optional CloudflareOptions to control RPC and Queue trace propagation\n */\nexport function instrumentEnv<Env extends Record<string, unknown>>(env: Env, options?: CloudflareOptions): Env {\n if (!env || typeof env !== 'object') {\n return env;\n }\n\n const shouldPropagateRpcTrace = createRpcPropagationResolver(options);\n const shouldPropagateQueueTrace = createBindingPropagationResolver(options?.queueTracePropagationBindings);\n\n return new Proxy(env, {\n get(target, prop, receiver) {\n const item = Reflect.get(target, prop, receiver);\n\n if (!isProxyable(item)) {\n return item;\n }\n\n const cached = instrumentedBindings.get(item);\n\n if (cached) {\n return cached;\n }\n\n if (isD1Database(item)) {\n const instrumented = instrumentD1(item);\n instrumentedBindings.set(item, instrumented);\n return instrumented;\n }\n\n if (isQueue(item)) {\n const bindingName = typeof prop === 'string' ? prop : String(prop);\n const instrumented = instrumentQueueProducer(item, bindingName, shouldPropagateQueueTrace(bindingName));\n instrumentedBindings.set(item, instrumented);\n return instrumented;\n }\n\n if (isKVNamespace(item)) {\n const bindingName = typeof prop === 'string' ? prop : String(prop);\n const instrumented = instrumentKV(item, bindingName);\n instrumentedBindings.set(item, instrumented);\n return instrumented;\n }\n\n if (isR2Bucket(item)) {\n const bindingName = typeof prop === 'string' ? prop : String(prop);\n const instrumented = instrumentR2Bucket(item, bindingName);\n instrumentedBindings.set(item, instrumented);\n return instrumented;\n }\n\n if (isAiBinding(item)) {\n const instrumented = instrumentWorkersAiClient(item);\n instrumentedBindings.set(item, instrumented);\n return instrumented;\n }\n\n const propagateRpcTrace = shouldPropagateRpcTrace(String(prop));\n\n if (isDurableObjectNamespace(item)) {\n const instrumented = instrumentDurableObjectNamespace(item, propagateRpcTrace);\n instrumentedBindings.set(item, instrumented);\n return instrumented;\n }\n\n if (isJSRPC(item)) {\n const instrumented = new Proxy(item, {\n get(target, p) {\n const value = Reflect.get(target, p);\n\n if (p === 'fetch' && typeof value === 'function') {\n return instrumentFetcher((...args) => Reflect.apply(value, target, args));\n }\n\n if (p === 'connect' && typeof value === 'function') {\n return (...args: unknown[]) => Reflect.apply(value, target, args);\n }\n\n if (\n propagateRpcTrace &&\n typeof value === 'function' &&\n typeof p === 'string' &&\n !STUB_NON_RPC_METHODS.has(p)\n ) {\n return (...args: unknown[]) => Reflect.apply(value, target, appendRpcMeta(args));\n }\n\n return value;\n },\n });\n\n instrumentedBindings.set(item, instrumented);\n return instrumented;\n }\n\n return item;\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;AAqBA,SAAS,YAAY,MAA+B;CAClD,OAAO,aAAa,IAAI,KAAK,OAAO,SAAS;AAC/C;AAEA,MAAM,uCAAuB,IAAI,QAAyB;;;;;;;;;;;;;;;;AAiB1D,SAAgB,cAAmD,KAAU,SAAkC;CAC7G,IAAI,CAAC,OAAO,OAAO,QAAQ,UACzB,OAAO;CAGT,MAAM,0BAA0B,6BAA6B,OAAO;CACpE,MAAM,4BAA4B,iCAAiC,SAAS,6BAA6B;CAEzG,OAAO,IAAI,MAAM,KAAK,EACpB,IAAI,QAAQ,MAAM,UAAU;EAC1B,MAAM,OAAO,QAAQ,IAAI,QAAQ,MAAM,QAAQ;EAE/C,IAAI,CAAC,YAAY,IAAI,GACnB,OAAO;EAGT,MAAM,SAAS,qBAAqB,IAAI,IAAI;EAE5C,IAAI,QACF,OAAO;EAGT,IAAI,aAAa,IAAI,GAAG;GACtB,MAAM,eAAe,aAAa,IAAI;GACtC,qBAAqB,IAAI,MAAM,YAAY;GAC3C,OAAO;EACT;EAEA,IAAI,QAAQ,IAAI,GAAG;GACjB,MAAM,cAAc,OAAO,SAAS,WAAW,OAAO,OAAO,IAAI;GACjE,MAAM,eAAe,wBAAwB,MAAM,aAAa,0BAA0B,WAAW,CAAC;GACtG,qBAAqB,IAAI,MAAM,YAAY;GAC3C,OAAO;EACT;EAEA,IAAI,cAAc,IAAI,GAAG;GAEvB,MAAM,eAAe,aAAa,MADd,OAAO,SAAS,WAAW,OAAO,OAAO,IAAI,CACd;GACnD,qBAAqB,IAAI,MAAM,YAAY;GAC3C,OAAO;EACT;EAEA,IAAI,WAAW,IAAI,GAAG;GAEpB,MAAM,eAAe,mBAAmB,MADpB,OAAO,SAAS,WAAW,OAAO,OAAO,IAAI,CACR;GACzD,qBAAqB,IAAI,MAAM,YAAY;GAC3C,OAAO;EACT;EAEA,IAAI,YAAY,IAAI,GAAG;GACrB,MAAM,eAAe,0BAA0B,IAAI;GACnD,qBAAqB,IAAI,MAAM,YAAY;GAC3C,OAAO;EACT;EAEA,MAAM,oBAAoB,wBAAwB,OAAO,IAAI,CAAC;EAE9D,IAAI,yBAAyB,IAAI,GAAG;GAClC,MAAM,eAAe,iCAAiC,MAAM,iBAAiB;GAC7E,qBAAqB,IAAI,MAAM,YAAY;GAC3C,OAAO;EACT;EAEA,IAAI,QAAQ,IAAI,GAAG;GACjB,MAAM,eAAe,IAAI,MAAM,MAAM,EACnC,IAAI,QAAQ,GAAG;IACb,MAAM,QAAQ,QAAQ,IAAI,QAAQ,CAAC;IAEnC,IAAI,MAAM,WAAW,OAAO,UAAU,YACpC,OAAO,mBAAmB,GAAG,SAAS,QAAQ,MAAM,OAAO,QAAQ,IAAI,CAAC;IAG1E,IAAI,MAAM,aAAa,OAAO,UAAU,YACtC,QAAQ,GAAG,SAAoB,QAAQ,MAAM,OAAO,QAAQ,IAAI;IAGlE,IACE,qBACA,OAAO,UAAU,cACjB,OAAO,MAAM,YACb,CAAC,qBAAqB,IAAI,CAAC,GAE3B,QAAQ,GAAG,SAAoB,QAAQ,MAAM,OAAO,QAAQ,cAAc,IAAI,CAAC;IAGjF,OAAO;GACT,EACF,CAAC;GAED,qBAAqB,IAAI,MAAM,YAAY;GAC3C,OAAO;EACT;EAEA,OAAO;CACT,EACF,CAAC;AACH"}
|
|
@@ -1,51 +1,46 @@
|
|
|
1
|
-
import { ensureInstrumented } from
|
|
2
|
-
import { getFinalOptions } from
|
|
3
|
-
import { wrapRequestHandlerWithInit } from
|
|
4
|
-
import { init } from
|
|
5
|
-
import { instrumentContext } from
|
|
6
|
-
import { instrumentEnv } from
|
|
7
|
-
|
|
1
|
+
import { ensureInstrumented } from "../../instrument.js";
|
|
2
|
+
import { getFinalOptions } from "../../options.js";
|
|
3
|
+
import { wrapRequestHandlerWithInit } from "../../wrapRequestHandlerWithInit.js";
|
|
4
|
+
import { init } from "../../sdk.js";
|
|
5
|
+
import { instrumentContext } from "../../utils/instrumentContext.js";
|
|
6
|
+
import { instrumentEnv } from "./instrumentEnv.js";
|
|
7
|
+
// src/instrumentations/worker/instrumentFetch.ts
|
|
8
|
+
/**
|
|
9
|
+
* Instruments a fetch handler for ExportedHandler (env/ctx come from args).
|
|
10
|
+
*/
|
|
8
11
|
function instrumentExportedHandlerFetch(handler, optionsCallback) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
args[2] = context;
|
|
25
|
-
return wrapRequestHandlerWithInit({ options, request, context }, () => target.apply(thisArg, args), init);
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
);
|
|
12
|
+
if (!("fetch" in handler) || typeof handler.fetch !== "function") return;
|
|
13
|
+
handler.fetch = ensureInstrumented(handler.fetch, (original) => new Proxy(original, { apply(target, thisArg, args) {
|
|
14
|
+
const [rawRequest, env, ctx] = args;
|
|
15
|
+
const request = rawRequest;
|
|
16
|
+
if (request.method === "OPTIONS" || request.method === "HEAD") return target.apply(thisArg, args);
|
|
17
|
+
const context = instrumentContext(ctx);
|
|
18
|
+
const options = getFinalOptions(optionsCallback(env), env);
|
|
19
|
+
args[1] = instrumentEnv(env, options);
|
|
20
|
+
args[2] = context;
|
|
21
|
+
return wrapRequestHandlerWithInit({
|
|
22
|
+
options,
|
|
23
|
+
request,
|
|
24
|
+
context
|
|
25
|
+
}, () => target.apply(thisArg, args), init);
|
|
26
|
+
} }));
|
|
29
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Instruments a fetch method for WorkerEntrypoint (options/context already available).
|
|
30
|
+
*/
|
|
30
31
|
function instrumentWorkerEntrypointFetch(instance, options, context) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{ options, request, context },
|
|
43
|
-
() => Reflect.apply(target, thisArg, args),
|
|
44
|
-
init
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
32
|
+
if (!instance.fetch) return;
|
|
33
|
+
const original = instance.fetch.bind(instance);
|
|
34
|
+
instance.fetch = new Proxy(original, { apply(target, thisArg, args) {
|
|
35
|
+
const [request] = args;
|
|
36
|
+
if (request.method === "OPTIONS" || request.method === "HEAD") return Reflect.apply(target, thisArg, args);
|
|
37
|
+
return wrapRequestHandlerWithInit({
|
|
38
|
+
options,
|
|
39
|
+
request,
|
|
40
|
+
context
|
|
41
|
+
}, () => Reflect.apply(target, thisArg, args), init);
|
|
42
|
+
} });
|
|
48
43
|
}
|
|
49
|
-
|
|
50
44
|
export { instrumentExportedHandlerFetch, instrumentWorkerEntrypointFetch };
|
|
51
|
-
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=instrumentFetch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentFetch.js","sources":["../../../../../src/instrumentations/worker/instrumentFetch.ts"],"sourcesContent":["import type { AnyExportedHandler } from '../../types';\nimport type { env as cloudflareEnv, WorkerEntrypoint } from 'cloudflare:workers';\nimport type { CloudflareOptions } from '../../client';\nimport { ensureInstrumented } from '../../instrument';\nimport { getFinalOptions } from '../../options';\nimport { wrapRequestHandlerWithInit } from '../../wrapRequestHandlerWithInit';\nimport { init } from '../../sdk';\nimport { instrumentContext } from '../../utils/instrumentContext';\nimport { instrumentEnv } from './instrumentEnv';\n\n/**\n * Instruments a fetch handler for ExportedHandler (env/ctx come from args).\n */\nexport function instrumentExportedHandlerFetch<T extends AnyExportedHandler>(\n handler: T,\n optionsCallback: (env: typeof cloudflareEnv) => CloudflareOptions | undefined,\n): void {\n if (!('fetch' in handler) || typeof handler.fetch !== 'function') {\n return;\n }\n\n handler.fetch = ensureInstrumented(\n handler.fetch,\n original =>\n new Proxy(original, {\n apply(target, thisArg, args: Parameters<NonNullable<T['fetch']>>) {\n const [rawRequest, env, ctx] = args;\n // `T['fetch']` resolves to the structural `AnyHandlerMethod`, whose parameters are\n // `any` — but the fetch event is always a `Request` at runtime.\n const request = rawRequest as Request;\n\n if (request.method === 'OPTIONS' || request.method === 'HEAD') {\n return target.apply(thisArg, args);\n }\n\n const context = instrumentContext(ctx);\n const options = getFinalOptions(optionsCallback(env), env);\n args[1] = instrumentEnv(env, options);\n args[2] = context;\n\n return wrapRequestHandlerWithInit({ options, request, context }, () => target.apply(thisArg, args), init);\n },\n }),\n );\n}\n\n/**\n * Instruments a fetch method for WorkerEntrypoint (options/context already available).\n */\nexport function instrumentWorkerEntrypointFetch<T extends WorkerEntrypoint>(\n instance: T,\n options: CloudflareOptions,\n context: ExecutionContext,\n): void {\n if (!instance.fetch) {\n return;\n }\n\n const original = instance.fetch.bind(instance);\n instance.fetch = new Proxy(original, {\n apply(target, thisArg, args: [Request]) {\n const [request] = args;\n\n if (request.method === 'OPTIONS' || request.method === 'HEAD') {\n return Reflect.apply(target, thisArg, args);\n }\n\n return wrapRequestHandlerWithInit(\n { options, request, context },\n () => Reflect.apply(target, thisArg, args),\n init,\n );\n },\n });\n}\n"],"
|
|
1
|
+
{"version":3,"file":"instrumentFetch.js","names":[],"sources":["../../../../../src/instrumentations/worker/instrumentFetch.ts"],"sourcesContent":["import type { AnyExportedHandler } from '../../types';\nimport type { env as cloudflareEnv, WorkerEntrypoint } from 'cloudflare:workers';\nimport type { CloudflareOptions } from '../../client';\nimport { ensureInstrumented } from '../../instrument';\nimport { getFinalOptions } from '../../options';\nimport { wrapRequestHandlerWithInit } from '../../wrapRequestHandlerWithInit';\nimport { init } from '../../sdk';\nimport { instrumentContext } from '../../utils/instrumentContext';\nimport { instrumentEnv } from './instrumentEnv';\n\n/**\n * Instruments a fetch handler for ExportedHandler (env/ctx come from args).\n */\nexport function instrumentExportedHandlerFetch<T extends AnyExportedHandler>(\n handler: T,\n optionsCallback: (env: typeof cloudflareEnv) => CloudflareOptions | undefined,\n): void {\n if (!('fetch' in handler) || typeof handler.fetch !== 'function') {\n return;\n }\n\n handler.fetch = ensureInstrumented(\n handler.fetch,\n original =>\n new Proxy(original, {\n apply(target, thisArg, args: Parameters<NonNullable<T['fetch']>>) {\n const [rawRequest, env, ctx] = args;\n // `T['fetch']` resolves to the structural `AnyHandlerMethod`, whose parameters are\n // `any` — but the fetch event is always a `Request` at runtime.\n const request = rawRequest as Request;\n\n if (request.method === 'OPTIONS' || request.method === 'HEAD') {\n return target.apply(thisArg, args);\n }\n\n const context = instrumentContext(ctx);\n const options = getFinalOptions(optionsCallback(env), env);\n args[1] = instrumentEnv(env, options);\n args[2] = context;\n\n return wrapRequestHandlerWithInit({ options, request, context }, () => target.apply(thisArg, args), init);\n },\n }),\n );\n}\n\n/**\n * Instruments a fetch method for WorkerEntrypoint (options/context already available).\n */\nexport function instrumentWorkerEntrypointFetch<T extends WorkerEntrypoint>(\n instance: T,\n options: CloudflareOptions,\n context: ExecutionContext,\n): void {\n if (!instance.fetch) {\n return;\n }\n\n const original = instance.fetch.bind(instance);\n instance.fetch = new Proxy(original, {\n apply(target, thisArg, args: [Request]) {\n const [request] = args;\n\n if (request.method === 'OPTIONS' || request.method === 'HEAD') {\n return Reflect.apply(target, thisArg, args);\n }\n\n return wrapRequestHandlerWithInit(\n { options, request, context },\n () => Reflect.apply(target, thisArg, args),\n init,\n );\n },\n });\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,+BACd,SACA,iBACM;CACN,IAAI,EAAE,WAAW,YAAY,OAAO,QAAQ,UAAU,YACpD;CAGF,QAAQ,QAAQ,mBACd,QAAQ,QACR,aACE,IAAI,MAAM,UAAU,EAClB,MAAM,QAAQ,SAAS,MAA2C;EAChE,MAAM,CAAC,YAAY,KAAK,OAAO;EAG/B,MAAM,UAAU;EAEhB,IAAI,QAAQ,WAAW,aAAa,QAAQ,WAAW,QACrD,OAAO,OAAO,MAAM,SAAS,IAAI;EAGnC,MAAM,UAAU,kBAAkB,GAAG;EACrC,MAAM,UAAU,gBAAgB,gBAAgB,GAAG,GAAG,GAAG;EACzD,KAAK,KAAK,cAAc,KAAK,OAAO;EACpC,KAAK,KAAK;EAEV,OAAO,2BAA2B;GAAE;GAAS;GAAS;EAAQ,SAAS,OAAO,MAAM,SAAS,IAAI,GAAG,IAAI;CAC1G,EACF,CAAC,CACL;AACF;;;;AAKA,SAAgB,gCACd,UACA,SACA,SACM;CACN,IAAI,CAAC,SAAS,OACZ;CAGF,MAAM,WAAW,SAAS,MAAM,KAAK,QAAQ;CAC7C,SAAS,QAAQ,IAAI,MAAM,UAAU,EACnC,MAAM,QAAQ,SAAS,MAAiB;EACtC,MAAM,CAAC,WAAW;EAElB,IAAI,QAAQ,WAAW,aAAa,QAAQ,WAAW,QACrD,OAAO,QAAQ,MAAM,QAAQ,SAAS,IAAI;EAG5C,OAAO,2BACL;GAAE;GAAS;GAAS;EAAQ,SACtB,QAAQ,MAAM,QAAQ,SAAS,IAAI,GACzC,IACF;CACF,EACF,CAAC;AACH"}
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import { _INTERNAL_getTracingHeadersForFetchRequest } from
|
|
2
|
-
|
|
1
|
+
import { _INTERNAL_getTracingHeadersForFetchRequest } from "@sentry/core";
|
|
2
|
+
// src/instrumentations/worker/instrumentFetcher.ts
|
|
3
|
+
/**
|
|
4
|
+
* Wraps a fetch-like function to create a span and propagate trace headers
|
|
5
|
+
* (`sentry-trace` and `baggage`) on the outgoing request.
|
|
6
|
+
*
|
|
7
|
+
* Useful for instrumenting Cloudflare bindings that expose a `fetch` method
|
|
8
|
+
* (e.g. Durable Object stubs, Service bindings).
|
|
9
|
+
*/
|
|
3
10
|
function instrumentFetcher(fetchFn) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
11
|
+
return function(originalInput, originalInit) {
|
|
12
|
+
const initIsRequest = originalInit instanceof Request;
|
|
13
|
+
const input = initIsRequest ? new Request(originalInput, originalInit) : originalInput;
|
|
14
|
+
const init = initIsRequest ? void 0 : originalInit;
|
|
15
|
+
const headers = _INTERNAL_getTracingHeadersForFetchRequest(input, { headers: init?.headers });
|
|
16
|
+
if (input instanceof Request && init === void 0) {
|
|
17
|
+
if (!headers) return fetchFn(input);
|
|
18
|
+
return fetchFn(new Request(input, { headers }));
|
|
19
|
+
}
|
|
20
|
+
return fetchFn(input, {
|
|
21
|
+
...init,
|
|
22
|
+
...headers ? { headers } : {}
|
|
23
|
+
});
|
|
24
|
+
};
|
|
19
25
|
}
|
|
20
|
-
|
|
21
26
|
export { instrumentFetcher };
|
|
22
|
-
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=instrumentFetcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentFetcher.js","sources":["../../../../../src/instrumentations/worker/instrumentFetcher.ts"],"sourcesContent":["import type { Fetcher } from '@cloudflare/workers-types';\nimport { _INTERNAL_getTracingHeadersForFetchRequest } from '@sentry/core';\n\n/**\n * Wraps a fetch-like function to create a span and propagate trace headers\n * (`sentry-trace` and `baggage`) on the outgoing request.\n *\n * Useful for instrumenting Cloudflare bindings that expose a `fetch` method\n * (e.g. Durable Object stubs, Service bindings).\n */\nexport function instrumentFetcher(fetchFn: Fetcher['fetch']): Fetcher['fetch'] {\n return function (
|
|
1
|
+
{"version":3,"file":"instrumentFetcher.js","names":[],"sources":["../../../../../src/instrumentations/worker/instrumentFetcher.ts"],"sourcesContent":["import type { Fetcher } from '@cloudflare/workers-types';\nimport { _INTERNAL_getTracingHeadersForFetchRequest } from '@sentry/core';\n\n/**\n * Wraps a fetch-like function to create a span and propagate trace headers\n * (`sentry-trace` and `baggage`) on the outgoing request.\n *\n * Useful for instrumenting Cloudflare bindings that expose a `fetch` method\n * (e.g. Durable Object stubs, Service bindings).\n */\nexport function instrumentFetcher(fetchFn: Fetcher['fetch']): Fetcher['fetch'] {\n return function (originalInput: RequestInfo | URL, originalInit?: RequestInit): Promise<Response> {\n // A Request's fields are prototype getters, so the object spread below would drop them.\n const initIsRequest = originalInit instanceof Request;\n const input = initIsRequest ? new Request(originalInput, originalInit) : originalInput;\n const init = initIsRequest ? undefined : originalInit;\n\n const headers = _INTERNAL_getTracingHeadersForFetchRequest(input, { headers: init?.headers });\n\n if (input instanceof Request && init === undefined) {\n if (!headers) {\n return fetchFn(input);\n }\n\n // Newly created headers already include the previous headers from the original request\n // so we can clone the request and pass in all headers.\n const requestWithTracing = new Request(input, { headers: headers as HeadersInit });\n\n return fetchFn(requestWithTracing);\n }\n\n const mergedInit = {\n ...init,\n ...(headers ? { headers } : {}),\n } as NonNullable<Parameters<Fetcher['fetch']>[1]>;\n\n return fetchFn(input, mergedInit);\n };\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgB,kBAAkB,SAA6C;CAC7E,OAAO,SAAU,eAAkC,cAA+C;EAEhG,MAAM,gBAAgB,wBAAwB;EAC9C,MAAM,QAAQ,gBAAgB,IAAI,QAAQ,eAAe,YAAY,IAAI;EACzE,MAAM,OAAO,gBAAgB,KAAA,IAAY;EAEzC,MAAM,UAAU,2CAA2C,OAAO,EAAE,SAAS,MAAM,QAAQ,CAAC;EAE5F,IAAI,iBAAiB,WAAW,SAAS,KAAA,GAAW;GAClD,IAAI,CAAC,SACH,OAAO,QAAQ,KAAK;GAOtB,OAAO,QAAQ,IAFgB,QAAQ,OAAO,EAAW,QAAuB,CAEhD,CAAC;EACnC;EAOA,OAAO,QAAQ,OAAO;GAJpB,GAAG;GACH,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;EAGA,CAAC;CAClC;AACF"}
|
|
@@ -1,77 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { CACHE_OPERATION_NAMES, isObjectLike, startSpan } from "@sentry/core";
|
|
2
|
+
import { CACHE_HIT, CACHE_KEY, CACHE_OPERATION, DB_COLLECTION_NAME, DB_OPERATION_NAME, DB_SYSTEM_NAME, SENTRY_OP, SENTRY_ORIGIN } from "@sentry/conventions/attributes";
|
|
3
|
+
import { CACHE_GET, CACHE_PUT, CACHE_REMOVE } from "@sentry/conventions/op";
|
|
4
|
+
// src/instrumentations/worker/instrumentKV.ts
|
|
5
5
|
const ORIGIN = "auto.cache.cloudflare.kv";
|
|
6
6
|
const OPERATION_SPAN_OPS = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
get: CACHE_GET,
|
|
8
|
+
getWithMetadata: CACHE_GET,
|
|
9
|
+
put: CACHE_PUT,
|
|
10
|
+
delete: CACHE_REMOVE,
|
|
11
|
+
list: CACHE_GET
|
|
12
12
|
};
|
|
13
13
|
function getCacheKeys(operation, args) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (Array.isArray(key)) {
|
|
19
|
-
return key.map((value) => String(value));
|
|
20
|
-
}
|
|
21
|
-
return typeof key === "string" ? [key] : key == null ? void 0 : [String(key)];
|
|
14
|
+
if (operation === "list") return;
|
|
15
|
+
const key = args[0];
|
|
16
|
+
if (Array.isArray(key)) return key.map((value) => String(value));
|
|
17
|
+
return typeof key === "string" ? [key] : key == null ? void 0 : [String(key)];
|
|
22
18
|
}
|
|
23
19
|
function createSpanOptions(bindingName, operation, args) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
const cacheOperation = OPERATION_SPAN_OPS[operation];
|
|
21
|
+
const cacheOperationName = CACHE_OPERATION_NAMES[cacheOperation];
|
|
22
|
+
const keys = getCacheKeys(operation, args);
|
|
23
|
+
return {
|
|
24
|
+
name: cacheOperation,
|
|
25
|
+
attributes: {
|
|
26
|
+
[SENTRY_OP]: cacheOperation,
|
|
27
|
+
[CACHE_OPERATION]: cacheOperationName,
|
|
28
|
+
[SENTRY_ORIGIN]: ORIGIN,
|
|
29
|
+
...keys && keys.length > 0 && { [CACHE_KEY]: keys },
|
|
30
|
+
[DB_OPERATION_NAME]: operation,
|
|
31
|
+
[DB_COLLECTION_NAME]: bindingName,
|
|
32
|
+
[DB_SYSTEM_NAME]: "cloudflare-kv"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
39
35
|
}
|
|
40
36
|
function resolveCacheHit(operation, result) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return Array.from(result.values()).some((value) => resolveCacheHit(operation, value));
|
|
46
|
-
}
|
|
47
|
-
if (operation === "getWithMetadata" && isObjectLike(result) && "value" in result) {
|
|
48
|
-
return result.value != null;
|
|
49
|
-
}
|
|
50
|
-
return result != null;
|
|
37
|
+
if (operation === "list") return false;
|
|
38
|
+
if (result instanceof Map) return Array.from(result.values()).some((value) => resolveCacheHit(operation, value));
|
|
39
|
+
if (operation === "getWithMetadata" && isObjectLike(result) && "value" in result) return result.value != null;
|
|
40
|
+
return result != null;
|
|
51
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Wraps a Cloudflare Workers KV binding to create cache spans on namespace operations.
|
|
44
|
+
*
|
|
45
|
+
* Instrumented methods: get, getWithMetadata, put, delete, and list.
|
|
46
|
+
*/
|
|
52
47
|
function instrumentKV(kv, bindingName) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
return Reflect.get(target, prop, receiver);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
48
|
+
return new Proxy(kv, { get(target, prop, receiver) {
|
|
49
|
+
if (prop === "get" || prop === "getWithMetadata" || prop === "put" || prop === "delete" || prop === "list") {
|
|
50
|
+
const original = Reflect.get(target, prop, receiver);
|
|
51
|
+
if (typeof original !== "function") return original;
|
|
52
|
+
return function(...args) {
|
|
53
|
+
const operation = prop;
|
|
54
|
+
return startSpan(createSpanOptions(bindingName, operation, args), async (span) => {
|
|
55
|
+
const result = await Reflect.apply(original, target, args);
|
|
56
|
+
if (operation === "get" || operation === "getWithMetadata") span.setAttribute(CACHE_HIT, resolveCacheHit(operation, result));
|
|
57
|
+
return result;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return Reflect.get(target, prop, receiver);
|
|
62
|
+
} });
|
|
74
63
|
}
|
|
75
|
-
|
|
76
64
|
export { instrumentKV };
|
|
77
|
-
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=instrumentKV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentKV.js","sources":["../../../../../src/instrumentations/worker/instrumentKV.ts"],"sourcesContent":["import type { KVNamespace } from '@cloudflare/workers-types';\nimport {\n CACHE_HIT,\n CACHE_KEY,\n CACHE_OPERATION,\n DB_COLLECTION_NAME,\n DB_OPERATION_NAME,\n DB_SYSTEM_NAME,\n SENTRY_OP,\n SENTRY_ORIGIN,\n} from '@sentry/conventions/attributes';\nimport { CACHE_GET, CACHE_PUT, CACHE_REMOVE } from '@sentry/conventions/op';\nimport { CACHE_OPERATION_NAMES, isObjectLike, startSpan } from '@sentry/core';\n\nconst ORIGIN = 'auto.cache.cloudflare.kv';\n\ntype KVOperation = 'get' | 'getWithMetadata' | 'put' | 'delete' | 'list';\n\nconst OPERATION_SPAN_OPS = {\n get: CACHE_GET,\n getWithMetadata: CACHE_GET,\n put: CACHE_PUT,\n delete: CACHE_REMOVE,\n list: CACHE_GET,\n} as const satisfies Record<KVOperation, string>;\n\nfunction getCacheKeys(operation: KVOperation, args: unknown[]): string[] | undefined {\n if (operation === 'list') {\n return undefined;\n }\n\n const key = args[0];\n\n if (Array.isArray(key)) {\n return key.map(value => String(value));\n }\n\n return typeof key === 'string' ? [key] : key == null ? undefined : [String(key)];\n}\n\nfunction createSpanOptions(bindingName: string, operation: KVOperation, args: unknown[]) {\n const cacheOperation = OPERATION_SPAN_OPS[operation];\n const cacheOperationName = CACHE_OPERATION_NAMES[cacheOperation];\n const keys = getCacheKeys(operation, args);\n return {\n name: cacheOperation,\n attributes: {\n [SENTRY_OP]: cacheOperation,\n [CACHE_OPERATION]: cacheOperationName,\n [SENTRY_ORIGIN]: ORIGIN,\n ...(keys && keys.length > 0 && { [CACHE_KEY]: keys }),\n [DB_OPERATION_NAME]: operation,\n [DB_COLLECTION_NAME]: bindingName,\n [DB_SYSTEM_NAME]: 'cloudflare-kv',\n },\n };\n}\n\nfunction resolveCacheHit(operation: KVOperation, result: unknown): boolean {\n if (operation === 'list') {\n return false;\n }\n\n if (result instanceof Map) {\n return Array.from(result.values()).some(value => resolveCacheHit(operation, value));\n }\n\n if (operation === 'getWithMetadata' && isObjectLike(result) && 'value' in result) {\n return result.value != null;\n }\n\n return result != null;\n}\n\n/**\n * Wraps a Cloudflare Workers KV binding to create cache spans on namespace operations.\n *\n * Instrumented methods: get, getWithMetadata, put, delete, and list.\n */\nexport function instrumentKV<T extends KVNamespace>(kv: T, bindingName: string): T {\n return new Proxy(kv, {\n get(target, prop, receiver) {\n if (prop === 'get' || prop === 'getWithMetadata' || prop === 'put' || prop === 'delete' || prop === 'list') {\n const original = Reflect.get(target, prop, receiver);\n\n if (typeof original !== 'function') {\n return original;\n }\n\n return function (this: unknown, ...args: unknown[]) {\n const operation = prop;\n\n return startSpan(createSpanOptions(bindingName, operation, args), async span => {\n const result = await Reflect.apply(original, target, args);\n\n if (operation === 'get' || operation === 'getWithMetadata') {\n span.setAttribute(CACHE_HIT, resolveCacheHit(operation, result));\n }\n\n return result;\n });\n };\n }\n\n return Reflect.get(target, prop, receiver);\n },\n });\n}\n"],"
|
|
1
|
+
{"version":3,"file":"instrumentKV.js","names":[],"sources":["../../../../../src/instrumentations/worker/instrumentKV.ts"],"sourcesContent":["import type { KVNamespace } from '@cloudflare/workers-types';\nimport {\n CACHE_HIT,\n CACHE_KEY,\n CACHE_OPERATION,\n DB_COLLECTION_NAME,\n DB_OPERATION_NAME,\n DB_SYSTEM_NAME,\n SENTRY_OP,\n SENTRY_ORIGIN,\n} from '@sentry/conventions/attributes';\nimport { CACHE_GET, CACHE_PUT, CACHE_REMOVE } from '@sentry/conventions/op';\nimport { CACHE_OPERATION_NAMES, isObjectLike, startSpan } from '@sentry/core';\n\nconst ORIGIN = 'auto.cache.cloudflare.kv';\n\ntype KVOperation = 'get' | 'getWithMetadata' | 'put' | 'delete' | 'list';\n\nconst OPERATION_SPAN_OPS = {\n get: CACHE_GET,\n getWithMetadata: CACHE_GET,\n put: CACHE_PUT,\n delete: CACHE_REMOVE,\n list: CACHE_GET,\n} as const satisfies Record<KVOperation, string>;\n\nfunction getCacheKeys(operation: KVOperation, args: unknown[]): string[] | undefined {\n if (operation === 'list') {\n return undefined;\n }\n\n const key = args[0];\n\n if (Array.isArray(key)) {\n return key.map(value => String(value));\n }\n\n return typeof key === 'string' ? [key] : key == null ? undefined : [String(key)];\n}\n\nfunction createSpanOptions(bindingName: string, operation: KVOperation, args: unknown[]) {\n const cacheOperation = OPERATION_SPAN_OPS[operation];\n const cacheOperationName = CACHE_OPERATION_NAMES[cacheOperation];\n const keys = getCacheKeys(operation, args);\n return {\n name: cacheOperation,\n attributes: {\n [SENTRY_OP]: cacheOperation,\n [CACHE_OPERATION]: cacheOperationName,\n [SENTRY_ORIGIN]: ORIGIN,\n ...(keys && keys.length > 0 && { [CACHE_KEY]: keys }),\n [DB_OPERATION_NAME]: operation,\n [DB_COLLECTION_NAME]: bindingName,\n [DB_SYSTEM_NAME]: 'cloudflare-kv',\n },\n };\n}\n\nfunction resolveCacheHit(operation: KVOperation, result: unknown): boolean {\n if (operation === 'list') {\n return false;\n }\n\n if (result instanceof Map) {\n return Array.from(result.values()).some(value => resolveCacheHit(operation, value));\n }\n\n if (operation === 'getWithMetadata' && isObjectLike(result) && 'value' in result) {\n return result.value != null;\n }\n\n return result != null;\n}\n\n/**\n * Wraps a Cloudflare Workers KV binding to create cache spans on namespace operations.\n *\n * Instrumented methods: get, getWithMetadata, put, delete, and list.\n */\nexport function instrumentKV<T extends KVNamespace>(kv: T, bindingName: string): T {\n return new Proxy(kv, {\n get(target, prop, receiver) {\n if (prop === 'get' || prop === 'getWithMetadata' || prop === 'put' || prop === 'delete' || prop === 'list') {\n const original = Reflect.get(target, prop, receiver);\n\n if (typeof original !== 'function') {\n return original;\n }\n\n return function (this: unknown, ...args: unknown[]) {\n const operation = prop;\n\n return startSpan(createSpanOptions(bindingName, operation, args), async span => {\n const result = await Reflect.apply(original, target, args);\n\n if (operation === 'get' || operation === 'getWithMetadata') {\n span.setAttribute(CACHE_HIT, resolveCacheHit(operation, result));\n }\n\n return result;\n });\n };\n }\n\n return Reflect.get(target, prop, receiver);\n },\n });\n}\n"],"mappings":";;;;AAcA,MAAM,SAAS;AAIf,MAAM,qBAAqB;CACzB,KAAK;CACL,iBAAiB;CACjB,KAAK;CACL,QAAQ;CACR,MAAM;AACR;AAEA,SAAS,aAAa,WAAwB,MAAuC;CACnF,IAAI,cAAc,QAChB;CAGF,MAAM,MAAM,KAAK;CAEjB,IAAI,MAAM,QAAQ,GAAG,GACnB,OAAO,IAAI,KAAI,UAAS,OAAO,KAAK,CAAC;CAGvC,OAAO,OAAO,QAAQ,WAAW,CAAC,GAAG,IAAI,OAAO,OAAO,KAAA,IAAY,CAAC,OAAO,GAAG,CAAC;AACjF;AAEA,SAAS,kBAAkB,aAAqB,WAAwB,MAAiB;CACvF,MAAM,iBAAiB,mBAAmB;CAC1C,MAAM,qBAAqB,sBAAsB;CACjD,MAAM,OAAO,aAAa,WAAW,IAAI;CACzC,OAAO;EACL,MAAM;EACN,YAAY;IACT,YAAY;IACZ,kBAAkB;IAClB,gBAAgB;GACjB,GAAI,QAAQ,KAAK,SAAS,KAAK,GAAG,YAAY,KAAK;IAClD,oBAAoB;IACpB,qBAAqB;IACrB,iBAAiB;EACpB;CACF;AACF;AAEA,SAAS,gBAAgB,WAAwB,QAA0B;CACzE,IAAI,cAAc,QAChB,OAAO;CAGT,IAAI,kBAAkB,KACpB,OAAO,MAAM,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC,MAAK,UAAS,gBAAgB,WAAW,KAAK,CAAC;CAGpF,IAAI,cAAc,qBAAqB,aAAa,MAAM,KAAK,WAAW,QACxE,OAAO,OAAO,SAAS;CAGzB,OAAO,UAAU;AACnB;;;;;;AAOA,SAAgB,aAAoC,IAAO,aAAwB;CACjF,OAAO,IAAI,MAAM,IAAI,EACnB,IAAI,QAAQ,MAAM,UAAU;EAC1B,IAAI,SAAS,SAAS,SAAS,qBAAqB,SAAS,SAAS,SAAS,YAAY,SAAS,QAAQ;GAC1G,MAAM,WAAW,QAAQ,IAAI,QAAQ,MAAM,QAAQ;GAEnD,IAAI,OAAO,aAAa,YACtB,OAAO;GAGT,OAAO,SAAyB,GAAG,MAAiB;IAClD,MAAM,YAAY;IAElB,OAAO,UAAU,kBAAkB,aAAa,WAAW,IAAI,GAAG,OAAM,SAAQ;KAC9E,MAAM,SAAS,MAAM,QAAQ,MAAM,UAAU,QAAQ,IAAI;KAEzD,IAAI,cAAc,SAAS,cAAc,mBACvC,KAAK,aAAa,WAAW,gBAAgB,WAAW,MAAM,CAAC;KAGjE,OAAO;IACT,CAAC;GACH;EACF;EAEA,OAAO,QAAQ,IAAI,QAAQ,MAAM,QAAQ;CAC3C,EACF,CAAC;AACH"}
|