"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getServiceTrn = exports.withServiceTrn = exports.getParentMessage = exports.withParentMessage = void 0;
const env_1 = require("./env");
const PARENT_MESSAGE_KEY = "ctx-key-parent-message";
const withParentMessage = (ctx, parent) => {
    return Object.assign(Object.assign({}, ctx), { [PARENT_MESSAGE_KEY]: parent });
};
exports.withParentMessage = withParentMessage;
const getParentMessage = (ctx) => {
    const l = ctx[PARENT_MESSAGE_KEY];
    if (l == undefined) {
        return "";
    }
    return l;
};
exports.getParentMessage = getParentMessage;
const SERVICE_TRN_KEY = "ctx-key-service-trn";
const withServiceTrn = (ctx, trn) => {
    return Object.assign(Object.assign({}, ctx), { [SERVICE_TRN_KEY]: trn });
};
exports.withServiceTrn = withServiceTrn;
const getServiceTrn = (ctx) => {
    const l = ctx[SERVICE_TRN_KEY];
    if (l == undefined) {
        return env_1.defaultServiceTrn;
    }
    return l;
};
exports.getServiceTrn = getServiceTrn;
//# sourceMappingURL=context.js.map