hud-sdk
Version:
Hud's Node SDK
2 lines • 24.7 kB
JavaScript
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var i in t)("object"==typeof exports?exports:e)[i]=t[i]}}(global,()=>(()=>{"use strict";var e={1569:e=>{e.exports=require("zod")},2210:(e,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SDK_MODULE_NAME=void 0,n.SDK_MODULE_NAME="hud-sdk"},2509:function(e,n,t){var i=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t);var a=Object.getOwnPropertyDescriptor(n,t);a&&!("get"in a?!n.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,a)}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),a=this&&this.__exportStar||function(e,n){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(n,t)||i(n,e,t)};Object.defineProperty(n,"__esModule",{value:!0}),n.SDK_VERSION=n.SDK_MODULE_NAME=void 0,a(t(2887),n),a(t(2570),n);var o=t(2210);Object.defineProperty(n,"SDK_MODULE_NAME",{enumerable:!0,get:function(){return o.SDK_MODULE_NAME}}),a(t(7089),n);var r=t(5453);Object.defineProperty(n,"SDK_VERSION",{enumerable:!0,get:function(){return r.SDK_VERSION}})},2570:(e,n,t)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.refreshInvestigationErrorStatusCodeRegex=function(e,n,t){if(null==e)return;const o=i.HudDynamicConfigSchema.deepPartial().safeParse(e);if(!o.success)return;const r=o.data?.investigationErrorStatusCodeRegex;void 0!==r&&r!==n.dynamicConfig.investigationErrorStatusCodeRegex&&a(r,n,t,"Periodic refresh - Dynamic configuration updated - investigationErrorStatusCodeRegex")},n.refreshInvestigationEnabled=function(e,n,t){if(null==e)return;const a=i.HudDynamicConfigSchema.deepPartial().safeParse(e);if(!a.success)return;const o=a.data?.enableInvestigation;if(void 0===o)return;o!==globalThis.hudEnableInvestigation&&(n.isInvestigationEnabledByEnv||(globalThis.hudEnableInvestigation=o,t.info("Periodic refresh - Dynamic configuration updated - enableInvestigation",{hudEnableInvestigation:o})))},n.updateDynamicConfig=function(e,n,t){const r=i.HudDynamicConfigSchema.deepPartial().safeParse(e);if(!r.success)return t.error("Dynamic configuration not updated - Invalid configuration override",{remoteConfigParseResult:r,remoteConfig:e}),n.dynamicConfig;const s=o(n.dynamicConfig,r.data);return void 0!==s.enableInvestigation&&s.enableInvestigation!==n.dynamicConfig.enableInvestigation&&(t.info("Dynamic configuration updated - enableInvestigation",{hudEnableInvestigation:s.enableInvestigation}),n.isInvestigationEnabledByEnv||(globalThis.hudEnableInvestigation=s.enableInvestigation)),void 0!==s.enableInvestigationArgsSending&&s.enableInvestigationArgsSending!==n.dynamicConfig.enableInvestigationArgsSending&&(t.info("Dynamic configuration updated - enableInvestigationArgsSending",{hudEnableInvestigationArgsSending:s.enableInvestigationArgsSending}),globalThis.hudEnableInvestigationArgsSending=s.enableInvestigationArgsSending),void 0!==s?.investigationRateLimits?.executionFlowMaxLength&&s?.investigationRateLimits?.executionFlowMaxLength!==n.dynamicConfig.investigationRateLimits.executionFlowMaxLength&&(globalThis.hudExecutionFlowMaxLength=s.investigationRateLimits.executionFlowMaxLength),void 0!==s?.investigationRateLimits?.exceptionMaxLength&&s?.investigationRateLimits?.exceptionMaxLength!==n.dynamicConfig.investigationRateLimits.exceptionMaxLength&&(globalThis.hudExceptionMaxLength=s.investigationRateLimits.exceptionMaxLength),void 0!==r.data.investigationErrorStatusCodeRegex&&s.investigationErrorStatusCodeRegex!==n.dynamicConfig.investigationErrorStatusCodeRegex&&a(s.investigationErrorStatusCodeRegex,n,t,"Dynamic configuration updated - investigationErrorStatusCodeRegex",s),s};const i=t(2887);function a(e,n,t,a,o){const{appliedRegex:r,usedDefault:s}=(0,i.updateInvestigationErrorStatusCodePatternGlobal)(e);n.dynamicConfig.investigationErrorStatusCodeRegex=r,o&&(o.investigationErrorStatusCodeRegex=r),s&&e!==r?t.warning("Invalid investigationErrorStatusCodeRegex, using default",{investigationErrorStatusCodeRegex:e,appliedRegex:r}):t.info(a,{investigationErrorStatusCodeRegex:r})}function o(e,n){if(null===n||"object"!=typeof n)return n;if(Array.isArray(e)&&Array.isArray(n))return n;const t={...e};for(const i in n){const a=e[i],r=n[i];t[i]=o(a,r)}return t}},2887:function(e,n,t){var i,a=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t);var a=Object.getOwnPropertyDescriptor(n,t);a&&!("get"in a?!n.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,a)}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var n=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[n.length]=t);return n},i(e)},function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t=i(e),r=0;r<t.length;r++)"default"!==t[r]&&a(n,e,t[r]);return o(n,e),n});Object.defineProperty(n,"__esModule",{value:!0}),n.HudFailedReadConfigError=n.loggerConfig=n.hudConfig=n.HudDynamicConfigSchema=n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX=void 0,n.functionUuidToBase64=c,n.getModulesToTraceFromEnv=function(){const e=process.env.HUD_MONITOR_MODULES||process.env.HUD_INCLUDE_MODULES;if(e)return e.split(",")},n.getExcludeDirsFromEnv=function(){const e=process.env.HUD_EXCLUDE_DIRS;if(e)return e.split(",")},n.getFrameworksToEnableFromEnv=function(){const e=process.env.HUD_ENABLE_FRAMEWORKS;let n;if(e)try{n=s.availableFrameworksSchema.parse(JSON.parse(e))}catch{n=new Map}return n},n.isValidParam=function(e){return null!=e&&""!==e&&"string"==typeof e},n.updateInvestigationRateLimitGlobals=function(){globalThis.hudMaxSameInvestigations=n.hudConfig.dynamicConfig.investigationRateLimits.maxSameInvestigations,globalThis.hudMaxTotalInvestigations=n.hudConfig.dynamicConfig.investigationRateLimits.maxTotalInvestigations,globalThis.hudSameInvestigationTimeWindowNs=BigInt(n.hudConfig.dynamicConfig.investigationRateLimits.sameInvestigationTimeWindowMs)*BigInt(1e6),globalThis.hudTotalInvestigationTimeWindowNs=BigInt(n.hudConfig.dynamicConfig.investigationRateLimits.totalInvestigationTimeWindowMs)*BigInt(1e6)},n.updateInvestigationErrorStatusCodePatternGlobal=function(e=n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX){try{return globalThis.hudInvestigationErrorStatusCodePattern=new RegExp(`^(?:${e})$`),{appliedRegex:e,usedDefault:e===n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX}}catch{return globalThis.hudInvestigationErrorStatusCodePattern=new RegExp(`^(?:${n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX})$`),{appliedRegex:n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX,usedDefault:!0}}},n.matchesInvestigationErrorStatusCode=function(e){return null!=e&&globalThis.hudInvestigationErrorStatusCodePattern.test(String(e))};const s=t(8528),l=r(t(6928)),u=t(3903),d=t(1569);function c(e){return Buffer.from((0,u.parse)(e)).toString("base64").slice(0,22)}const m="globalThis._hudMark";n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX="^5\\d\\d$",n.HudDynamicConfigSchema=d.z.object({aggregationInterval:d.z.number(),aggregationFirstSendTimeout:d.z.number(),investigationInterval:d.z.number(),investigationFirstSendTimeout:d.z.number(),enableInvestigation:d.z.boolean(),investigationErrorStatusCodeRegex:d.z.string(),enableInvestigationArgsSending:d.z.boolean(),investigationRateLimits:d.z.object({maxSameInvestigations:d.z.number().int().positive(),sameInvestigationTimeWindowMs:d.z.number().int().positive(),maxTotalInvestigations:d.z.number().int().positive(),maxTotalInvestigationsErrorBased:d.z.number().int().positive(),maxTotalInvestigationsDurationBased:d.z.number().int().positive(),totalInvestigationTimeWindowMs:d.z.number().int().positive(),maxUniqLogs:d.z.number().int().positive(),maxStringLength:d.z.number().int().positive(),maxArrayLength:d.z.number().int().positive(),maxObjectDepth:d.z.number().int().positive(),maxKeyLength:d.z.number().int().positive(),executionFlowMaxLength:d.z.number().int().positive(),exceptionMaxLength:d.z.number().int().positive(),maxUniqueSetFailureErrors:d.z.number().int().positive()}),machineMetricsInterval:d.z.number().int().positive(),blacklistParams:d.z.array(d.z.string()),forensicsBlacklistFields:d.z.array(d.z.string()),forensicsWhitelistFields:d.z.array(d.z.string()),censorshipRegexes:d.z.array(d.z.object({regex:d.z.string(),replacement:d.z.string()})),reingestInterval:d.z.number().int().positive(),extraHeaders:d.z.array(d.z.string()),performanceMetricsInterval:d.z.number().int().positive(),enableOutboundData:d.z.boolean(),maxTotalOutbounds:d.z.number().int().positive(),maxOutboundCountWithData:d.z.number().int().positive(),maxHTTPRequestBodySize:d.z.number().int().positive(),maxHTTPResponseBodySize:d.z.number().int().positive(),functionDetachEnabled:d.z.boolean(),functionDetachThresholdPerSecond:d.z.number().int().positive(),functionDetachMinWindowMs:d.z.number().int().nonnegative(),enableMongoDocumentData:d.z.boolean(),enableTeardown:d.z.boolean(),flushOnUncaughtException:d.z.boolean(),fileTimestampsLogDelayMs:d.z.number().int().positive(),maxCustomFlowIds:d.z.number().int().positive()});const g=process.env.HUD_ENABLE_INVESTIGATION,b="_HUD",v="94a210f3-861c-4e18-ab27-6b6c19437c9d",p={sink:{url:process.env.HUD_HOST||"https://api-prod.hud.io",timeout:5e3,session_attr:"X-Session-ID"},endpoints:{init:"sink/init",send:"sink/send",batch:"sink/batch",logs:"sink/logs",sessionslessLogs:"sink/sessionless-logs",fatalError:"sink/redline",getMode:"sink/getMode",getRemoteConfig:"sink/remote-config/get",fileDeclarations:"sink/file-declarations",sourceMap:"sink/sourcemap",storeObject:"sink/objects/store",getUploadUrls:"sink/registry/get-upload-urls",triggerReingest:"sink/registry/reingest",validateToken:"sink/registry/validate",fileDeclarationsCi:"sink/registry/file-declarations",completed:"sink/registry/completed",endpointsDurationsInvestigationThresholds:"sink/endpoint-configuration",getKnownDetachedFunctions:"sink/known-detached-functions/get",setDetachedFunctions:"sink/known-detached-functions/set"},logger:{default:{levels:{app:"warning",worker:"warning",instrument:"warning"}},debug:{levels:{app:"debug",worker:"debug",instrument:"debug"}}},investigation:{objectVersion:"1.0.2",store:{type:"s3"}},userConfig:{lean:{value:!1,source:"DEFAULT"},minPodMemoryMB:{value:250,source:"DEFAULT"},maxMappedFunctions:{value:5e4,source:"DEFAULT"},maxFileSizeBytes:{value:2831155,source:"DEFAULT"},maxTimeUntilInitSessionMs:{value:3e4,source:"DEFAULT"},includeModules:{value:[],source:"DEFAULT"},excludeDirs:{value:[],source:"DEFAULT"},disableRuntimeInstrumentation:{value:!1,source:"DEFAULT"},disableParametersExtraction:{value:!1,source:"DEFAULT"},disableDetachedFunctions:{value:!1,source:"DEFAULT"},enableVarHoisting:{value:!1,source:"DEFAULT"},instrumentOneLiners:{value:!0,source:"DEFAULT"},forensicsOnly:{value:!1,source:"DEFAULT"}},loggerWorkerPortSizeLimit:1e4,customerLoggerLevel:"info",logDirectory:process.env.HUD_LOG_DIR,invocationSampling:new Map([[[300n,null],100],[[200n,300n],50],[[100n,200n],25],[[0n,100n],10]]),callerResetInterval:36e5,modeInterval:3e5,logsSendInterval:6e4,endpointsInterval:3e4,endpointsFirstSendWaitTime:12e4,staticNextJsEndpointsInterval:1e4,staticNextJsEndpointsMaxAttempts:12,huddBinWidth:1.2,endpointsDurationsInvestigationThresholdsInterval:6e5,remoteConfigRefreshInterval:3e5,workerStateCollectionDelay:1e4,workerGrace:6e4,teardownGrace:5e3,workerTimeout:2e4,timeoutOnRegister:6e4,timeoutOnMetrics:6e4,workerMessageTimeout:1e4,communicationBatchSize:100,writePatched:!1,defaultOff:!0,disableOnBadApiKey:!0,disableOnBadServiceName:!0,cpuTimeCollection:!1,workloadMetadata:{sendInterval:3e5,aws:{imds:{baseURL:"http://169.254.169.254/latest",tokenURI:"/api/token",identityURI:"/dynamic/instance-identity/document",lifeCycleURI:"/meta-data/instance-life-cycle",requestTimeout:5e3},metadataFile:"/run/cloud-init/instance-data.json"},kubernetes:{namespaceFile:"/var/run/secrets/kubernetes.io/serviceaccount/namespace",uuidFile:"/sys/class/dmi/id/product_uuid",podMemoryLimitFile:"/sys/fs/cgroup/memory/memory.stat",podCPULimitFile:"/sys/fs/cgroup/cpuacct/cpu.shares"}},deleteLogsAfterSending:!0,supportSourceMap:!0,editInline:!0,bundlerBuildIdVarName:"hudFileBuildID",bundlerBuildUuidNamespace:"00c1e90b-af75-4d8e-9935-68485877f759",functionUuidNamespace:v,wrapVarPrefix:b,functionInitFunctionName:`${b}i`,functionCatchFunctionName:`${b}c`,functionFinallyFunctionName:`${b}n`,callContextVarName:`${b}x`,fixStackFunctionName:`${b}s`,asyncIteratorWrapperFunctionName:`${b}w`,wrapperUserCatchFunctionName:`${b}u`,asyncWrapperFunctionName:`${b}a`,internalAsyncWrapperFunctionName:`${b}b`,frameworksToPatch:new Map([["express",{framework:s.availableFrameworks.express,enable:!0,version:">=4.10.6 <6.0.0",enableEsbuild:!0}],[l.join("express","lib","router","layer.js"),{framework:s.availableFrameworks.express,enable:!0,version:"<5",patcher:"expressLayer",enableEsbuild:!0}],[l.join("express","lib","application.js"),{framework:s.availableFrameworks.express,enable:!0,version:">=4.10.6 <6.0.0",patcher:"express",enableEsbuild:!0}],[l.join("express","lib","router","index.js"),{framework:s.availableFrameworks.express,enable:!0,version:"<5",patcher:"expressRouter",enableEsbuild:!0}],["router",{framework:s.availableFrameworks.express,enable:!0,version:"^2.0.0",patcher:"expressRouterInRouter",enableEsbuild:!0}],[l.join("router","lib","layer.js"),{framework:s.availableFrameworks.express,enable:!0,version:"^2.0.0",patcher:"expressLayerInRouter",enableEsbuild:!0}],["@hapi/hapi",{framework:s.availableFrameworks.hapi,enable:!0,version:">=20.0.0 <22.0.0",patcher:"hapi"}],["koa",{framework:s.availableFrameworks.koa,enable:!0,version:"^2.0.0 || ^3.0.0",patcher:"koa"}],["fastify",{framework:s.availableFrameworks.fastify,enable:!0,version:">=4.0.0 <6",patcher:"fastify"}],["hono",{framework:s.availableFrameworks.hono,enable:!0,version:">=3.11.0 <5",patcher:"hono"}],[l.join("hono","dist","cjs","request.js"),{framework:s.availableFrameworks.hono,enable:!0,version:">=3.11.0 <5",patcher:"honoRequest"}],["graphql/execution/execute",{framework:s.availableFrameworks.graphql,enable:!1,version:"14 - 16",patcher:"graphql"}],["http",{framework:s.availableFrameworks.http,enable:!0,version:"*",patcher:"http"}],["https",{framework:s.availableFrameworks.https,enable:!0,version:"*",patcher:"http"}],["next/dist/server/base-server",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0 <17.0.0",patcher:"nextjs"}],["next/dist/server/lib/module-loader/route-module-loader",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0 <17.0.0",patcher:"nextJsModuleLoader"}],["next/dist/compiled/next-server/pages-api.runtime.prod",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0 <17.0.0",patcher:"nextJsRouteModule"}],["next/dist/compiled/next-server/pages-api-turbo.runtime.prod",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=16.0.0 <17.0.0",patcher:"nextJsRouteModule"}],["next/dist/server/config",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0 <17.0.0",patcher:"nextJsConfig"}],["@nestjs/core/router/router-execution-context",{framework:s.availableFrameworks.nestjs,enable:!0,version:"<12.0.0",patcher:"nestjsRouterExecutionContext"}],["kafkajs",{framework:s.availableFrameworks.kafkajs,enable:!0,version:">=1.4.0 <3.0.0",patcher:"kafkajs"}],["@confluentinc/kafka-javascript",{framework:s.availableFrameworks.confluentKafkaJs,enable:!1,version:">=1.4.0 <2.0.0",patcher:"confluentKafkaJs"}],["@nestjs/microservices/context/rpc-context-creator",{framework:s.availableFrameworks.nestjs,enable:!0,version:">=7.0.0 <12.0.0",patcher:"nestjsRpcContextCreator"}],[["@codegenie/serverless-express","src","frameworks","express.js"].join(l.sep),{framework:s.availableFrameworks.codegenieServerlessExpress,enable:!0,version:"^4.1.0",patcher:"codeGenieServerlessExpress",enableEsbuild:!0}],["@codegenie/serverless-express",{framework:s.availableFrameworks.codegenieServerlessExpress,enable:!0,enableEsbuild:!0}],["sqs-consumer",{framework:s.availableFrameworks.sqs,enable:!0,version:">=7.5.0 <16.0.0",patcher:"sqsConsumer"}],[["@mondaydotcomorg/monday-sqs-consumer","sqs-consumer"].join(l.sep),{framework:s.availableFrameworks.sqs,enable:!0,version:">=5.2.2 <6",patcher:"sqsConsumer",extraInfo:{isMondayVersion:!0,srcHash:"bd9064befbf3abb9ad0e6a53b0cf721d5612d5b8d8790875c994b7ff40b951c5"}}],["serverless-http",{framework:s.availableFrameworks.serverlessHttp,enable:!0,enableEsbuild:!0}],[l.join("serverless-http","lib","framework","get-framework.js"),{framework:s.availableFrameworks.serverlessHttp,enable:!0,version:"^2.7.0",patcher:"serverlessHttp",enableEsbuild:!0}],["axios",{framework:s.availableFrameworks.axios,enable:!0,version:">0.18.0 <1.0.0 || ^1.0.0",patcher:"outbound/axios",mainFilePath:"axios/dist/node/axios.cjs",extraInfo:{isOutbound:!0}}],["node-fetch",{framework:s.availableFrameworks.nodeFetch,enable:!0,version:"^2.0.0",patcher:"outbound/nodeFetch",mainFilePath:"node-fetch/lib/index.js",extraInfo:{isOutbound:!0}}],["request",{framework:s.availableFrameworks.request,enable:!0,version:"2.88.2",patcher:"outbound/request",extraInfo:{isOutbound:!0}}],["pg",{framework:s.availableFrameworks.pg,enable:!0,version:"^8.8.0",patcher:"outbound/pg",extraInfo:{isOutbound:!0}}],["@clickhouse/client",{framework:s.availableFrameworks.clickhouse,enable:!0,version:"^1.10.0",patcher:"outbound/clickhouse",extraInfo:{isOutbound:!0},minNodeMajorVersion:20}],["ioredis",{framework:s.availableFrameworks.ioredis,enable:!0,version:"^4.0.0 || ^5.0.0",patcher:"outbound/ioredis",extraInfo:{isOutbound:!0}}],["mongodb",{framework:s.availableFrameworks.mongodb,enable:!0,version:">=5.0.0 <8.0.0",patcher:"outbound/mongodb",extraInfo:{isOutbound:!0}}],["mongoose",{framework:s.availableFrameworks.mongoose,enable:!0,version:">=5.0.0 <7.0.0",patcher:"outbound/mongoose",extraInfo:{isOutbound:!0,coveredByFramework:{frameworkKey:"mongodb",versionRange:">=7.0.0 <10.0.0"}}}],["p-limit",{framework:"p-limit",enable:!0,version:"^3.0.0",patcher:"internal/pLimit"}],["@google-cloud/pubsub",{framework:s.availableFrameworks.pubsub,enable:!0,version:">=4.0.0",patcher:"pubsub"}],["bullmq",{framework:s.availableFrameworks.bullmq,enable:!0,version:">=4.0.0 <6.0.0",patcher:"bullmq"}],["@azure/event-hubs",{framework:s.availableFrameworks.eventHubs,enable:!0,version:">=5.12.0 <7.0.0",patcher:"eventHubs"}],["amqplib/lib/channel_model",{framework:s.availableFrameworks.amqplib,enable:!0,version:">=0.10.0 <3.0.0",patcher:"amqplib",minNodeMajorVersion:20}],["amqplib/lib/callback_model",{framework:s.availableFrameworks.amqplib,enable:!0,version:">=0.10.0 <3.0.0",patcher:"amqplib",minNodeMajorVersion:20}],["@azure/service-bus",{framework:s.availableFrameworks.servicebus,enable:!0,version:">=7.9.2",patcher:"servicebus",minNodeMajorVersion:20}]]),communicationKeepalive:!1,communicationKeepaliveGrace:5e3,express:{routeNamesSymbol:Symbol.for("hudRoutes"),layerStateSymbol:Symbol.for("hudState"),markedSymbol:Symbol.for("hudMarked"),wrapAllCallbacks:!0},supportedNodeVersions:["18","20","21","22","24","26"],hudPatchedName:"hudPatched",metricSymbol:Symbol.for("hudMetric"),dynamicConfig:{aggregationInterval:3e5,aggregationFirstSendTimeout:3e4,investigationInterval:5e3,investigationFirstSendTimeout:3e4,enableInvestigation:"true"===g,investigationErrorStatusCodeRegex:n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX,enableInvestigationArgsSending:!1,investigationRateLimits:{maxSameInvestigations:2,sameInvestigationTimeWindowMs:36e5,maxTotalInvestigations:25,maxTotalInvestigationsErrorBased:25,maxTotalInvestigationsDurationBased:20,totalInvestigationTimeWindowMs:216e5,maxUniqLogs:2,executionFlowMaxLength:20,exceptionMaxLength:20,maxStringLength:1024,maxArrayLength:10,maxObjectDepth:3,maxKeyLength:30,maxUniqueSetFailureErrors:100},machineMetricsInterval:1e4,performanceMetricsInterval:6e4,reingestInterval:3e4,extraHeaders:[],enableOutboundData:"true"===process.env.HUD_ENABLE_OUTBOUND_DATA,maxHTTPRequestBodySize:1024,maxHTTPResponseBodySize:5120,blacklistParams:[],censorshipRegexes:[],forensicsBlacklistFields:[],forensicsWhitelistFields:[],maxOutboundCountWithData:process.env.HUD_MAX_OUTBOUND_WITH_DATA?parseInt(process.env.HUD_MAX_OUTBOUND_WITH_DATA):10,maxTotalOutbounds:20,functionDetachEnabled:!1,functionDetachThresholdPerSecond:5833,functionDetachMinWindowMs:3e4,enableMongoDocumentData:!1,enableTeardown:!1,flushOnUncaughtException:!1,fileTimestampsLogDelayMs:12e4,maxCustomFlowIds:1e3},machineMetricsSavedLength:2,isInvestigationEnabledByEnv:void 0!==g,suppressTraces:"true"!==process.env.HUD_DISABLE_SUPPRESS_TRACES,lambdaMinimunMemory:1024,lambdaBaseGivenTime:400,lambdaExtraGivenTimePerRequest:50,lambdaMaxGivenTime:700,throttleStatusCode:202,axiosFunctionId:c((0,u.v5)("axios",v)),nodeFetchFunctionId:c((0,u.v5)("node-fetch",v)),nodeFetchBodiesFunctionIds:{json:c((0,u.v5)("node-fetch-body-json",v)),text:c((0,u.v5)("node-fetch-body-text",v)),arrayBuffer:c((0,u.v5)("node-fetch-body-arrayBuffer",v)),blob:c((0,u.v5)("node-fetch-body-blob",v))},requestFunctionId:c((0,u.v5)("request-request",v)),requestMethodFunctionIds:{get:c((0,u.v5)("request-get",v)),head:c((0,u.v5)("request-head",v)),options:c((0,u.v5)("request-options",v)),post:c((0,u.v5)("request-post",v)),put:c((0,u.v5)("request-put",v)),patch:c((0,u.v5)("request-patch",v)),del:c((0,u.v5)("request-del",v)),delete:c((0,u.v5)("request-delete",v))},pgConnectFunctionId:c((0,u.v5)("pg-connect",v)),pgQueryFunctionId:c((0,u.v5)("pg-query",v)),pgEndFunctionId:c((0,u.v5)("pg-end",v)),clickhouseQueryFunctionId:c((0,u.v5)("clickhouse-query",v)),clickhouseExecFunctionId:c((0,u.v5)("clickhouse-exec",v)),clickhouseCommandFunctionId:c((0,u.v5)("clickhouse-command",v)),clickhouseInsertFunctionId:c((0,u.v5)("clickhouse-insert",v)),clickhouseCloseFunctionId:c((0,u.v5)("clickhouse-close",v)),functionsToInstrument:[{moduleName:"typeorm",fileToFunctionsMapping:{[l.join(l.sep,"typeorm","repository","Repository.js")]:["hasId","getId","create","merge","preload","save","remove","softRemove","recover","insert","update","upsert","delete","softDelete","restore","exist","exists","existsBy","count","countBy","sum","average","minimum","maximum","find","findBy","findAndCount","findAndCountBy","findByIds","findOne","findOneBy","findOneById","findOneOrFail","findOneByOrFail","query","clear","increment","decrement","extend"]}}],esbuildGlobalVar:"hudSGV",esbuildFunctionIdVar:"hudFI",esbuildPluginMessagePrefix:"ESBuild plugin ",esbuildMark:"modifiedByHudESBuildPlugin-",esbuildMarkLength:67,esbuildUploadSourceMapTimeout:15e3,esbuildPluginLogsChunkSize:100,esbuildPluginLogsBatchSize:10,pluginsLogEndpoint:"https://yqp37dddrsewm6wdwwpwfraxqm0shdmx.lambda-url.eu-central-1.on.aws/",uninstrumentedFilesLogThreshold:2,tsNodeConfigTimeout:1e4,allowedEditExtensions:[".ts",".cts",".mts",".js",".cjs",".mjs"],nextJsMarkVarName:m,nextJsMarkStatement:`${m} = "a"`,timeoutOnNextJsPlugin:3e4,logIntervals:{instrumentedFilesCount:5e3,sentEventsCount:12e4,unknownAsyncContextTypes:6e4},cliBuildIdVarName:"hudCliBuildId",cliSdkVersionVarName:"hudCliSdkVersion"};n.hudConfig=function(e={}){return{...p,...e}}({logger:{default:{levels:{app:"info",worker:"info",instrument:"info"}},debug:{levels:{app:"debug",worker:"debug",instrument:"debug"}}},deleteLogsAfterSending:!1,communicationKeepalive:!0}),n.default=n.hudConfig;const f=process.env.HUD_DEBUG?n.hudConfig.logger.debug:n.hudConfig.logger.default;n.loggerConfig={...f,console:"true"===process.env.HUD_VERBOSE};class h extends Error{path;code;constructor(e,n){super(),this.path=e,this.code=n}}n.HudFailedReadConfigError=h},3903:e=>{e.exports=require("uuid")},5453:(e,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SDK_VERSION=void 0,n.SDK_VERSION="1.8.17"},6928:e=>{e.exports=require("path")},7089:(e,n,t)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ObjectStoreConfigSchema=void 0;const i=t(1569),a=i.z.object({type:i.z.literal("s3")}),o=i.z.object({type:i.z.literal("disk"),path:i.z.string()}),r=i.z.object({type:i.z.literal("customer_s3"),bucket:i.z.string(),region:i.z.string(),prefix:i.z.string().optional()});n.ObjectStoreConfigSchema=i.z.union([a,o,r])},8528:e=>{e.exports=require("./dto")}},n={};return function t(i){var a=n[i];if(void 0!==a)return a.exports;var o=n[i]={exports:{}};return e[i].call(o.exports,o,o.exports,t),o.exports}(2509)})());
//# sourceMappingURL=config.js.map