UNPKG

@betit/orion-node-sdk

Version:
23 lines 687 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const UUID = require('uuid'); class Request { constructor(path, params) { this.path = path; this.params = params; this.tracerData = {}; this.meta = { 'x-trace-id': UUID.v4() // will be overriden by tracer is tracing is enabled }; } getId() { return this.meta['x-trace-id']; } merge(req) { // in cases where there are no guarantees that the req will be of type Request this.meta = req.meta || {}; this.tracerData = req.tracerData || {}; } } exports.Request = Request; //# sourceMappingURL=request.js.map