2025-12-11 10:40:55 +01:00
|
|
|
/*
|
2026-01-12 15:00:36 +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
|
|
|
|
|
*/
|
|
|
|
|
|
2023-03-13 13:42:43 +01:00
|
|
|
import { markdown2Html } from '../../services/markdown.js';
|
2021-01-21 16:09:23 +01:00
|
|
|
|
2026-04-21 19:42:39 +02:00
|
|
|
export const send = ({ serviceName, newListings, jobKey, baseUrl }) => {
|
2020-02-26 09:05:20 +01:00
|
|
|
/* 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}`] : []),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
];
|
2020-02-26 09:05:20 +01:00
|
|
|
/* eslint-enable no-console */
|
2018-01-20 20:23:27 +01:00
|
|
|
};
|
2023-03-13 13:42:43 +01:00
|
|
|
export const config = {
|
|
|
|
|
id: 'console',
|
2021-01-21 16:09:23 +01:00
|
|
|
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'),
|
|
|
|
|
};
|