Files

29 lines
918 B
JavaScript
Raw Permalink Normal View History

2025-12-11 10:40:55 +01:00
/*
* Copyright (c) 2026 by Christian Kellner.
2025-12-11 10:40:55 +01:00
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
*/
import { markdown2Html } from '../../services/markdown.js';
2026-04-21 19:42:39 +02:00
export const send = ({ serviceName, newListings, jobKey, baseUrl }) => {
/* eslint-disable no-console */
2026-06-03 08:12:30 +02:00
const fredyLinks = baseUrl ? newListings.map((l) => `${baseUrl}/#/listings/listing/${l.id}`).join(', ') : null;
2026-04-21 19:42:39 +02:00
return [
Promise.resolve(
console.info(
`Found entry from service ${serviceName}, Job: ${jobKey}:`,
newListings,
...(fredyLinks ? [`Open in Fredy: ${fredyLinks}`] : []),
),
),
];
/* eslint-enable no-console */
2018-01-20 20:23:27 +01:00
};
export const config = {
id: 'console',
name: 'Console',
description: 'This adapter sends new listings to the console. It is mostly useful for debugging.',
config: {},
readme: markdown2Html('lib/notification/adapter/console.md'),
};