From 033d71b4f38c6290d836ab6be8e45259ef357586 Mon Sep 17 00:00:00 2001 From: Ivan Lediaev Date: Wed, 6 Dec 2023 20:00:24 +0300 Subject: [PATCH] feat: add userId context param for legacy compatibility --- src/lib/consts.ts | 1 + src/types.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/consts.ts b/src/lib/consts.ts index b12c901..4bae878 100644 --- a/src/lib/consts.ts +++ b/src/lib/consts.ts @@ -1,3 +1,4 @@ export const REQUEST_ID_HEADER = 'x-request-id'; export const REQUEST_ID_PARAM_NAME = 'requestId'; +export const USER_ID_PARAM_NAME = 'userId'; export const TRACE_KEY = 'uber-trace-id'; diff --git a/src/types.ts b/src/types.ts index ed516d1..44c2213 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,6 +1,6 @@ import type {pino} from 'pino'; -import {REQUEST_ID_PARAM_NAME} from './lib/consts'; +import {REQUEST_ID_PARAM_NAME, USER_ID_PARAM_NAME} from './lib/consts'; import type {LoggingLevel} from './lib/logging'; export interface AppConfig { @@ -46,6 +46,7 @@ export interface AppConfig { export interface AppContextParams { [REQUEST_ID_PARAM_NAME]?: string; + [USER_ID_PARAM_NAME]?: string; } export interface AppDynamicConfig {}