@mimik/request-helper

1.7.10 • Public • Published

request-helper

Example

const { getCorrelationId } = require('@mimik/request-helper');

request-helper~getCorrelationId(request) ⇒ UUID.<string>

Get the correlationId from the request. If it does not exist, a new correlationId step 0 and time will be created. Add step if it does not exist, add date if it does not exist. Increment step is it exist, and set step to 0 if step is not a number.

Kind: inner method of request-helper
Returns: UUID.<string> - The correlationId.
Category: sync

Param Type Description
request object The request from which to extract the correlationId or a string

request-helper~getUserAgent(request) ⇒ string

Get the userAgent from the request.

Kind: inner method of request-helper
Returns: string - The user agent from the request.
Category: sync

Param Type Description
request object The request from which to extract the correlationId or a string

request-helper~setUserAgent() ⇒ string

The following environment variable are being optionnaly used:

Env variable name Description Default Comments
SERVER_TYPE type of the server instance that makes the call generic for defining the agent
SERVER_VERSION version of the server instance that makes the call 1.0 for defining the agent
SERVER_ID id of the server instance that makes the call generic for defining the agent

Kind: inner method of request-helper
Returns: string - The user agent to be added to the request.
Category: sync

Readme

Keywords

Package Sidebar

Install

npm i @mimik/request-helper

Weekly Downloads

30

Version

1.7.10

License

MIT

Unpacked Size

16.4 kB

Total Files

8

Last publish

Collaborators

  • sasan.raisdana
  • miburger
  • hofachiang
  • mimik-npm-editor
  • mimikopensource