Skip to main content

talawa-api / Exports / libraries/requestContext

Module: libraries/requestContext

Table of contents

Variables

Functions

Variables

requestContextNamespace

Const requestContextNamespace: Namespace<Record<string, any>>

Defined in

src/libraries/requestContext.ts:8

Functions

getRequestContextValue

getRequestContextValue<T>(key): T

Type parameters

Name
T

Parameters

NameType
keystring

Returns

T

Defined in

src/libraries/requestContext.ts:19


init

init<T>(options?): T

Type parameters

Name
T

Parameters

NameType
optionsInterfaceInitOptions<T>

Returns

T

Defined in

src/libraries/requestContext.ts:45


middleware

middleware(): (req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: NextFunction) => void

Returns

fn

▸ (req, res, next): void

Parameters
NameType
reqRequest<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
resResponse<any, Record<string, any>>
nextNextFunction
Returns

void

Defined in

src/libraries/requestContext.ts:28


setRequestContext

setRequestContext(obj): void

Parameters

NameType
objany

Returns

void

Defined in

src/libraries/requestContext.ts:23


setRequestContextValue

setRequestContextValue<T>(key, value): T

Type parameters

Name
T

Parameters

NameType
keystring
valueT

Returns

T

Defined in

src/libraries/requestContext.ts:14


translate

translate(...args): any

Parameters

NameType
...argsany

Returns

any

Defined in

src/libraries/requestContext.ts:62


translatePlural

translatePlural(...args): any

Parameters

NameType
...argsany

Returns

any

Defined in

src/libraries/requestContext.ts:71