n8n
Version:
n8n Workflow Automation Tool
24 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toInternalDestinationOptions = toInternalDestinationOptions;
exports.toPublicDestination = toPublicDestination;
const api_types_1 = require("@n8n/api-types");
const PUBLIC_TO_INTERNAL = {
webhook: "$$MessageEventBusDestinationWebhook",
syslog: "$$MessageEventBusDestinationSyslog",
sentry: "$$MessageEventBusDestinationSentry",
};
const INTERNAL_TO_PUBLIC = {
["$$MessageEventBusDestinationWebhook"]: 'webhook',
["$$MessageEventBusDestinationSyslog"]: 'syslog',
["$$MessageEventBusDestinationSentry"]: 'sentry',
};
function toInternalDestinationOptions(input) {
const { type, ...rest } = input;
return { ...rest, __type: PUBLIC_TO_INTERNAL[type] };
}
function toPublicDestination(options) {
const type = options.__type ? INTERNAL_TO_PUBLIC[options.__type] : undefined;
return api_types_1.PublicDestinationResponseDto.parse({ ...options, type });
}
//# sourceMappingURL=log-streaming.mapper.js.map