hud-sdk
Version:
Hud's Node SDK
2 lines • 21.7 kB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(global,()=>(()=>{"use strict";var e={290:e=>{e.exports=require("async_hooks")},395:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addReingestValue=function(e){n.add(e)},t.getAndClearReingestValues=function(){const e=new Set;for(const t of n)o.has(t)||e.add(t);for(const t of e)o.add(t);return n=new Set,e};let n=new Set;const o=new Set},523:e=>{e.exports=require("./logger")},754:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.storeEndpointDeclaration=function(e){n.push(e)},t.getEndpointDeclarationsFromStorage=function(){const e=n;return n=[],e};let n=[]},820:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(7764),t),r(n(4583),t),r(n(2314),t),r(n(3025),t),r(n(8714),t),r(n(4988),t),r(n(2525),t),r(n(3973),t),r(n(1757),t),r(n(1364),t),r(n(7398),t),r(n(8708),t),r(n(7918),t),r(n(395),t)},1364:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initGlobals=function(){globalThis.hudGlobalInitGuard||(globalThis.hudGlobalInitGuard=!0,globalThis.hudRunMutex=!1,globalThis.hudRanOnRequire=!1,globalThis.hudRanOnImport=!1,globalThis.hudInitGuard=void 0,globalThis.hudInstrumentationIndicator=void 0,globalThis.hudMetricsIndicator=void 0,globalThis.hudInstrumentationOccured=!1,globalThis.hudNextJsPluginIndicator=void 0,globalThis.hudStartTime=new Date,globalThis.hudCalls={},globalThis.hudRunningMode=r.HudRunningMode.enabled,globalThis.hudExecutionFlowMaxLength=o.hudConfig.dynamicConfig.investigationRateLimits.executionFlowMaxLength,globalThis.hudExceptionMaxLength=o.hudConfig.dynamicConfig.investigationRateLimits.exceptionMaxLength,globalThis.hudEnableInvestigation=o.hudConfig.dynamicConfig.enableInvestigation,globalThis.hudEnableInvestigationArgsSending=o.hudConfig.dynamicConfig.enableInvestigationArgsSending,(0,s.setInvestigationStorage)(new u.AsyncLocalStorage),(0,s.setFlowStateStorage)(new u.AsyncLocalStorage),function(){globalThis.hudSampleTable=[];const e=[[10,1],[30,2],[100,3],[500,11],[1e3,23],[5e3,53]];let t=0;for(const[n,o]of e){for(let e=t;e<n;e++)globalThis.hudSampleTable.push(e%o===0);t=n}}(),d())},t.resetGlobals=d,t.hookMessageChannel=function(){const{port1:e,port2:t}=new c.MessageChannel;return e.on("message",e=>{"HudModulePatch"===e.key?(globalThis.hudPatched.add(e.hudPatched),globalThis.hudProcessedFiles.push(e.hudProcessedFiles)):"HudRetrieveFileCache"===e.key&&globalThis.HudSourceMapCache.set(e.filename,e.content)}),e.unref(),globalThis.hudHookPort=e,t},t.clearInitGuard=l,t.clearMetricsIndicator=g,t.clearInstrumentationIndicator=h,t.clearUserIndicatorsTimeouts=function(){l(),g(),h()},t.detachHud=f,t.forceHudEnable=function(){globalThis.forceHudEnable=!0},t.saveHudRunningFromSetup=function(){globalThis.hudIsRunningFromSetup=!0},t.saveInstrumentationIndicator=function(e){globalThis.hudInstrumentationIndicator=e,globalThis.hudInstrumentationIndicator.unref()},t.validateAndGetUserInput=function(){return o.hudConfig.userConfig.key||o.hudConfig.userConfig.service?o.hudConfig.userConfig.key?(0,o.isValidParam)(o.hudConfig.userConfig.key.value)?o.hudConfig.userConfig.service?(0,o.isValidParam)(o.hudConfig.userConfig.service.value)?{apiKey:o.hudConfig.userConfig.key.value,service:o.hudConfig.userConfig.service.value}:(a.app_logger.critical("Service name is invalid - SDK cannot initialize",{source:o.hudConfig.userConfig.service.source}),o.hudConfig.disableOnBadServiceName&&f(!1),void a.customer_logger.log(i.UserErrorLogs.HudServiceInvalid(o.hudConfig.userConfig.service.source))):(a.app_logger.critical("Service name is missing - SDK cannot initialize"),o.hudConfig.disableOnBadServiceName&&f(!1),void a.customer_logger.log(i.UserErrorLogs.HudServiceNotSet(globalThis.hudStartFromAutoInit))):(a.app_logger.critical("API key is invalid - SDK cannot initialize",{source:o.hudConfig.userConfig.key.source}),o.hudConfig.disableOnBadApiKey&&f(!1),void a.customer_logger.log(i.UserErrorLogs.HudApiKeyInvalid(o.hudConfig.userConfig.key.source))):(a.app_logger.critical("API key is missing - SDK cannot initialize"),o.hudConfig.disableOnBadApiKey&&f(!1),void a.customer_logger.log(i.UserErrorLogs.HudApiKeyNotSet(globalThis.hudStartFromAutoInit))):(a.app_logger.critical("Both API key and service name are missing - SDK cannot initialize"),(o.hudConfig.disableOnBadApiKey||o.hudConfig.disableOnBadServiceName)&&f(!1),void a.customer_logger.log(i.UserErrorLogs.BothApiKeyAndServiceNotSet(globalThis.hudStartFromAutoInit)))};const o=n(5809),r=n(8528),i=n(2546),a=n(523),s=n(7131),u=n(290),c=n(8167);function d(){globalThis.hudProcessedFiles=[],globalThis.hudStack=new Array(1e3).fill(""),globalThis.hudStackIndex={value:0},globalThis.hudLoadedModules=[],globalThis.hudPatched=new Set,globalThis.HudSourceMapCache=new Map,globalThis.hudExpressState=[]}function l(){clearTimeout(globalThis.hudInitGuard),globalThis.hudInitGuard=void 0}function g(){clearTimeout(globalThis.hudMetricsIndicator),globalThis.hudMetricsIndicator=void 0}function h(){clearTimeout(globalThis.hudInstrumentationIndicator),globalThis.hudInstrumentationIndicator=void 0,globalThis.hudInstrumentationOccured=!0}function f(e=!0,t=!1){if(a.app_logger.warning("Detaching hud"),t||e&&hudRunningMode!==r.HudRunningMode.detached){const e=(0,i.getFirstError)();a.customer_logger.log(i.UserErrorLogs.ShutdownGracefully(e))}globalThis.hudRunningMode=r.HudRunningMode.detached}},1757:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.markShouldFlushOnInit=function(e){r=e},t.storeCredentials=function(e,t){n=e,o=t},t.storeSessionInfo=function(e){i=e},t.getSessionInfo=function(){return i},t.getStoredApiKey=function(){return n},t.getStoredService=function(){return o},t.getShouldFlushOnInit=function(){return r};let n,o,r=!1,i=null},2314:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fullEndpointFlowIdMap=void 0,t.getLinkedConsistentFlowId=u,t.getFlowIdFromMappings=c,t.linkTemporaryToConsistenFlowId=d,t.clearFlowIdMappings=function(){t.fullEndpointFlowIdMap.clear(),s.clear()},t.swapTempToConstFlowId=function(e){e.forEach(e=>{"express"===e.framework&&(e.flow_id=u(e.flow_id,!0)??e.flow_id)})};const o=n(2546),r=n(523),i=n(7930),a=n(8590);t.fullEndpointFlowIdMap=new Map;const s=new Map;function u(e,t){let n=c(e,!1);return n?n.flowId:(d(t),n=c(e,!0),n?(n.isPartial&&!t&&r.app_logger.warning("Found partial endpoint for flow id even though partial aren't allowd",{flowId:e,consistentFlowId:n.flowId}),n.flowId):void 0)}function c(e,n){let o=t.fullEndpointFlowIdMap.get(e);return o?{flowId:o,isPartial:!1}:n?(o=s.get(e),o?{flowId:o,isPartial:!0}:void 0):void 0}function d(e){const n=[];globalThis.hudExpressState.forEach(e=>{try{n.push(...(0,i.extractEndpointsFromRouter)("",e))}catch(e){r.app_logger.error("Failed to extract endpoints from express",{msg:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0})}}),n.forEach(e=>{if(e.partial_path)return;const n=e.flow_id;let r=t.fullEndpointFlowIdMap.get(n);r||(r=(0,o.generateEndpointFlowId)(e.path,e.methods),t.fullEndpointFlowIdMap.set(n,r))}),(0,a.getPartialEndpointDeclarationsFromStorage)().forEach(n=>{const r=n.flow_id;let i=t.fullEndpointFlowIdMap.get(r);i||(i=s.get(r),i||(i=(0,o.generateEndpointFlowId)(n.partial_path,n.methods),e?s.set(r,i):t.fullEndpointFlowIdMap.set(r,i)))})}},2525:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSqsQueues=function(){const e=n;return n=[],e},t.storeSqsQueueDeclaration=function(e){n.push(e)};let n=[]},2546:e=>{e.exports=require("./lib")},2987:e=>{e.exports=require("perf_hooks")},3025:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGraphQLOperations=function(){const e=n;return n={},e},t.storeGraphQLOperation=function(e){n[e.flow_id]||(n[e.flow_id]=e)};let n={}},3973:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFlowMetrics=function(e){const t=(new Date).toISOString(),n={};for(const o in s){const i=[];let a;for(const n in s[o]){const r=s[o][n];a||(a=r.getEventVersion()),i.push(r.finalize(u,t,e))}delete s[o],a?n[o]={eventVersion:a,metrics:i}:r.app_logger.error("No event version found for metric type",o)}return n},t.storeFlowMetric=function(e){const t=function(e){if(void 0!==e.flow_id)switch(e.type){case"EndpointMetric":{const t=e;return`${e.flow_id}|${t.route}|${t.method}|${t.status_code}`}case"KafkaJSMetric":{const t=e;return`${e.flow_id}|${t.partition}|${t.error}`}case"GraphQLMetric":{const t=e;return`${e.flow_id}|${t.status_code}|${t.error_occurred}`}default:return e.flow_id}}(e);if(!t)return;s[e.type]||(s[e.type]={});const n=s[e.type][t];if(n)n.update(e,u);else{const n=a.MetricFactory.createMetric(e,u);s[e.type][t]=n}};const o=n(5809),r=n(523),i=n(7131),a=n(7859),s={},u=new i.SketchManager(o.hudConfig.huddBinWidth)},4583:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getExpressEndpointDeclarations=function(){let e=[];globalThis.hudExpressState.forEach(t=>{try{e=e.concat((0,i.extractEndpointsFromRouter)("",t))}catch(e){o.app_logger.error("Failed to extract endpoints from express",{msg:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0})}}),e=e.concat((0,a.getRouterlessEndpointDeclarationsFromStorage)());const t=new Set;e.forEach(e=>{e.partial_path||t.add(e.flow_id)});const n=e.filter(e=>!e.partial_path||!t.has(e.flow_id)&&(o.app_logger.info("Partial endpoint without full endpoint",{endpoint:e}),!0)),s=new Map;for(const e of n){const t=`${e.path||e.partial_path||""}|${[...e.methods].sort().join(",")}`;s.has(t)||s.set(t,e)}const u=Array.from(s.values());return(0,r.swapTempToConstFlowId)(u),u};const o=n(523),r=n(2314),i=n(7930),a=n(8590)},4988:function(e,t,n){var o,r=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||(o=function(e){return o=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},o(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=o(e),a=0;a<n.length;a++)"default"!==n[a]&&r(t,e,n[a]);return i(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.pageManifest=t.apiManifest=void 0,t.setNextConfig=function(e){g=e,h=!0},t.getNextConfig=function(){return g},t.isNextConfigExtracted=function(){return h},t.extractNextEndpointDeclarations=async function(e){const n=[];if(!e)return n;d.worker_logger.info("Extracting next.js endpoint declarations in worker");const o=e.distDir,r=s.join(o,t.apiManifest),i=await(0,c.readFile)(r);if(i){const e=JSON.parse(i),t=await async function(e,t){const n=[];for(const o of Object.keys(t))if(o.endsWith("/route")){const r=s.join(e,"server",t[o]),i=await f(r),a=p(o,"/route");for(const e of i){const t=(0,c.generateEndpointFlowId)(a,[e]);n.push(new u.EndpointDeclaration(t,[e],"nextjs","",a))}}else if(o.endsWith("/page")){const e=["GET"],t=p(o,"/page"),r=(0,c.generateEndpointFlowId)(t,e);n.push(new u.EndpointDeclaration(r,e,"nextjs","",t))}else d.worker_logger.warning("Unknown Next.js manifest key type",{key:o});return n}(o,e);n.push(...t)}const a=s.join(o,t.pageManifest),g=await(0,c.readFile)(a);if(g){const e=JSON.parse(g),t=await async function(e,t){const n=[];for(const e of Object.keys(t))if(e.startsWith("/api/")){const t=(0,c.generateEndpointFlowId)(e,l);n.push(new u.EndpointDeclaration(t,l,"nextjs","",e))}else{const t=["GET"],o=(0,c.generateEndpointFlowId)(e,t);n.push(new u.EndpointDeclaration(o,t,"nextjs","",e))}return n}(0,e);n.push(...t)}return n};const s=a(n(6928)),u=n(8528),c=n(2546),d=n(523),l=["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD"];let g;t.apiManifest="server/app-paths-manifest.json",t.pageManifest="server/pages-manifest.json";let h=!1;async function f(e){const t=await(0,c.readFile)(e);if(!t)return[];const n=new RegExp(`\\b(${l.join("|")})\\b`,"g"),o=t.matchAll(n),r=Array.from(o,e=>e[1]);return Array.from(new Set(r))}function p(e,t){return e.length===t.length?"/":e.length>t.length?e.slice(0,0-t.length):e}},5809:e=>{e.exports=require("./config")},6928:e=>{e.exports=require("path")},7131:e=>{e.exports=require("./wrap")},7398:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.globalInvestigationTracking=void 0,t.getClosedInvestigations=function(){const e=i;return i=[],e},t.storeClosedInvestigation=function(e){i.push(e)},t.setGlobalInvestigationTracking=function(e){t.globalInvestigationTracking=e},t.increaseGlobalInvestigationTracking=function(){t.globalInvestigationTracking++},t.getGlobalInvestigationTracking=function(){return t.globalInvestigationTracking},t.increaseInvestigationDedupingCache=function(e,t){const n=a.get(e)??new Map,o=(n.get(t)??0)+1;n.set(t,o),a.set(e,n)},t.resetInvestigationDedupingCache=function(){a.clear()},t.getInvestigationDedupingCache=function(e){return a.get(e)??new Map},t.saveMachineMetric=function(){const e=process.cpuUsage(),t=r.performance.eventLoopUtilization();s.push({cpuUsage:e,elu:t,timestamp:Date.now()}),s.length>o.hudConfig.machineMetricsSavedLength&&s.shift()},t.getLastMetrics=function(){return s[0]},t.setInvestigationDurationThresholds=function(e){u=e},t.getFlowIdDurationThresholdAndCount=function(e){return u[e]},t.increaseInvestigationDurationCount=function(e){const t=c.get(e)??0;c.set(e,t+1)},t.getInvestigationDurationCount=function(e){return c.get(e)??0},t.resetInvestigationDurationCounts=function(){c.clear()},t.increaseTotalInvestigationsErrorBased=function(){d++},t.getTotalInvestigationsErrorBased=function(){return d},t.resetTotalInvestigationsErrorBased=function(){d=0},t.increaseTotalInvestigationsDurationBased=function(){l++},t.getTotalInvestigationsDurationBased=function(){return l},t.resetTotalInvestigationsDurationBased=function(){l=0};const o=n(5809),r=n(2987);let i=[];t.globalInvestigationTracking=0;const a=new Map,s=[];let u={};const c=new Map;let d=0,l=0},7764:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(754),t),r(n(3025),t),r(n(8714),t),r(n(4988),t),r(n(4583),t),r(n(8590),t)},7859:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricFactory=t.BaseMetric=void 0;class n{}class o extends n{flowId;count;sumDuration;sumSquaredDuration;sketchBuilder;errorBreakdown;constructor(e,t){super(),this.flowId=e.flow_id,this.count=1,this.sumDuration=e.duration,this.sumSquaredDuration=e.duration**2,this.sketchBuilder=t.newSketchDataWithValue(e.duration),this.errorBreakdown=new Map,e.error_breakdown&&this.updateErrorBreakdown(e.error_breakdown)}getEventVersion(){return"1.0.0"}updateErrorBreakdown(e){let t=this.errorBreakdown.get(e.key);void 0===t&&(t={errors:e.errors,count:0,caught:e.caught,key:e.key},this.errorBreakdown.set(e.key,t)),t.count+=1}update(e,t){this.sumDuration+=e.duration,this.sumSquaredDuration+=e.duration**2,this.count+=1,t.add(this.sketchBuilder,e.duration),void 0!==e.error_breakdown&&this.updateErrorBreakdown(e.error_breakdown)}finalize(e,t,n){return{flow_id:this.flowId,count:this.count,sum_duration:this.sumDuration,sum_squared_duration:this.sumSquaredDuration,timestamp:t,timeslice:n,sketch:e.encode(this.sketchBuilder),error_breakdown:Array.from(this.errorBreakdown.values()).map(e=>({errors:e.errors,count:e.count,caught:e.caught}))}}}t.BaseMetric=o;class r{static registry={};static registerMetric(e,t){r.registry[e]=t}static createMetric(e,t){const n=r.registry[e.type];if(!n)throw new Error(`Unknown metric type: ${e.type}`);return new n(e,t)}}t.MetricFactory=r,r.registerMetric("EndpointMetric",class extends o{method;statusCode;constructor(e,t){super(e,t),this.method=e.method,this.statusCode=e.status_code}getEventVersion(){return"1.0.2"}finalize(e,t,n){return{...super.finalize(e,t,n),method:this.method,status_code:this.statusCode}}}),r.registerMetric("GraphQLMetric",class extends o{statusCode;errorOccurred;constructor(e,t){super(e,t),this.statusCode=e.status_code,this.errorOccurred=e.error_occurred}finalize(e,t,n){return{...super.finalize(e,t,n),status_code:this.statusCode,error_occurred:this.errorOccurred}}}),r.registerMetric("KafkaJSMetric",class extends o{partition;error;ConsumeSketchBuilder;sumConsumedDuration;sumSquaredConsumedDuration;constructor(e,t){super(e,t),this.partition=e.partition,this.error=e.error,e.total_consume_duration&&(this.ConsumeSketchBuilder=t.newSketchDataWithValue(e.total_consume_duration)),this.sumConsumedDuration=e.total_consume_duration??0,this.sumSquaredConsumedDuration=(e.total_consume_duration??0)**2}update(e,t){super.update(e,t),e.total_consume_duration&&(this.sumConsumedDuration+=e.total_consume_duration,this.sumSquaredConsumedDuration+=e.total_consume_duration**2,this.ConsumeSketchBuilder?t.add(this.ConsumeSketchBuilder,e.total_consume_duration):this.ConsumeSketchBuilder=t.newSketchDataWithValue(e.total_consume_duration))}finalize(e,t,n){return{...super.finalize(e,t,n),partition:this.partition,error:this.error,sum_consumed_duration:this.sumConsumedDuration,sum_squared_consumed_duration:this.sumSquaredConsumedDuration,sketch_consume:e.encode(this.ConsumeSketchBuilder)}}}),r.registerMetric("SqsMetric",class extends o{msgCount;errors;e2eData;constructor(e,t){super(e,t),this.msgCount=e.msg_count,this.errors=e.errors,e.e2e_duration&&(this.e2eData={duration:e.e2e_duration,squaredDuration:e.e2e_duration**2,sketchBuilder:t.newSketchDataWithValue(e.e2e_duration)})}update(e,t){super.update(e,t),this.msgCount&&e.msg_count&&(this.msgCount+=e.msg_count),e.errors.forEach((e,t)=>{this.errors.set(t,(this.errors.get(t)??0)+e)}),this.e2eData&&e.e2e_duration&&(this.e2eData.duration+=e.e2e_duration,this.e2eData.squaredDuration+=e.e2e_duration**2,t.add(this.e2eData.sketchBuilder,e.e2e_duration))}getEventVersion(){return"1.0.2"}finalize(e,t,n){return{...super.finalize(e,t,n),errors:Object.fromEntries(this.errors),msg_count:this.msgCount,...this.e2eData?{e2e_sum_duration:this.e2eData.duration,e2e_sum_squared_duration:this.e2eData.squaredDuration,e2e_sketch:e.encode(this.e2eData.sketchBuilder)}:{}}}})},7918:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.storeLoadedOutbound=function(e){n.push(e)},t.getLoadedOutboundsFromStorage=function(){const e=n;return n=[],e};let n=[]},7930:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extractEndpointsFromRouter=function e(t,n){let r=[];const u="true"===process.env.HUD_LOG_EXPRESS;if(!n.stack)return i.app_logger.error("Router without stack - bad OTEL version",{router:n}),r;for(const c of n.stack)if("router"===c.name){if(!c[o.hudConfig.express.routeNamesSymbol]){i.app_logger.error("Router layer without routes",{layer:c});continue}const n=t+c[o.hudConfig.express.routeNamesSymbol];r=r.concat(e(n,c.handle))}else c.route&&c.route[o.hudConfig.express.layerStateSymbol]?r=r.concat(a(c,t)):u&&!s.has(c.name)&&(s.add(c.name),i.app_logger.warning("Found unknown layer name when extracting endpoints",{layer:c.name}));return r};const o=n(5809),r=n(8528),i=n(523);function a(e,t){const n=[];for(const[i,a]of Object.entries(e.route[o.hudConfig.express.layerStateSymbol]))n.push(new r.EndpointDeclaration(i,a.methods,"express",t,a.layerPath));return Array.from(n.values())}const s=new Set(["query","expressInit","mounted_app"])},8167:e=>{e.exports=require("worker_threads")},8528:e=>{e.exports=require("./dto")},8590:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRouterlessEndpointDeclarationsFromStorage=function(){const e=i;return i=[],e},t.storePartialEndpointDeclaration=function(e){a.push(e)},t.getPartialEndpointDeclarationsFromStorage=function(){const e=a;return a=[],e},t.storeExpressEndpointDeclaration=function(e){if(!r.fullEndpointFlowIdMap.has(e.flow_id)){if(e.path){const t=(0,o.generateEndpointFlowId)(e.path,e.methods);r.fullEndpointFlowIdMap.set(e.flow_id,t)}i.push(e)}};const o=n(2546),r=n(2314);let i=[],a=[]},8708:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setLambdaExtensionId=function(e){r&&o.app_logger.warning("Lambda extension id already set"),r=e},t.getLambdaExtensionId=function(){return r};const o=n(523);let r},8714:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getKafkaJSTopics=function(){const e=n;return n=[],e},t.storeKafkaJSTopicDeclaration=function(e){n.push(e)};let n=[]}},t={};return function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}(820)})());
//# sourceMappingURL=globalstate.js.map