UNPKG

@bitblit/epsilon

Version:

Tiny adapter to simplify building API gateway Lambda APIS

34 lines (33 loc) 1.76 kB
import { Context, ProxyResult } from 'aws-lambda'; import { EpsilonInstance } from '../epsilon-instance'; import { InternalBackgroundEntry } from '../background/internal-background-entry'; import { InterApiEntry } from '../inter-api/inter-api-entry'; export declare class ContextUtil { private static CURRENT_EPSILON_REFERENCE; private static CURRENT_CONTEXT; private static CURRENT_EVENT; private static CURRENT_LOG_VARS; private static CURRENT_PROCESS_LABEL; private static CURRENT_OVERRIDE_TRACE_ID; private static CURRENT_OVERRIDE_TRACE_DEPTH; private constructor(); static initContext(epsilon: EpsilonInstance, evt: any, ctx: Context, processLabel: string): void; static clearContext(): void; static setOverrideTrace(traceId: string, traceDepth: number): void; static setOverrideTraceFromInternalBackgroundEntry(entry: InternalBackgroundEntry<any>): void; static setOverrideTraceFromInterApiEntry(interApiEntry: InterApiEntry<any>): void; static addHeadersToRecord(input: Record<string, any>, depthOffset?: number): void; static addTraceToProxyResult(pr: ProxyResult): void; static addTraceToHttpRequestInit(ri: RequestInit): void; static setProcessLabel(processLabel: string): void; static currentRequestId(): string; static remainingTimeMS(): number; static currentProcessLabel(): string; private static traceHeaderName; private static traceDepthHeaderName; static currentTraceId(): string; static currentTraceDepth(): number; static addLogVariable(name: string, val: string | number | boolean): void; static fetchLogVariable(name: string): string | number | boolean; static fetchLogVariables(): Record<string, string | number | boolean>; }