UNPKG

@totalsoft/pino-multitenancy

Version:
15 lines (14 loc) 525 B
"use strict"; // Copyright (c) TotalSoft. // This source code is licensed under the MIT license. Object.defineProperty(exports, "__esModule", { value: true }); const multitenancy_core_1 = require("@totalsoft/multitenancy-core"); /** * Creates a pino mixin object containing the current tenant id * @returns - the pino mixin object */ function tenantIdMixin() { const tenant = multitenancy_core_1.tenantContextAccessor.getTenantContext()?.tenant; return { tenantId: tenant?.id }; } exports.default = tenantIdMixin;