UNPKG

@puls-atlas/cli

Version:

The Puls Atlas CLI tool for managing Atlas projects

21 lines 802 B
import airbyteService from './services/airbyte/index.js'; import { normalizeOptionalString } from '../../utils/value.js'; import { validateServiceLifecycle } from './services/contracts/validateServiceLifecycle.js'; const SERVICES = { airbyte: validateServiceLifecycle(airbyteService) }; export const listServices = () => Object.values(SERVICES); export const findService = serviceName => { const normalizedServiceName = normalizeOptionalString(serviceName)?.toLowerCase(); if (!normalizedServiceName) { return null; } return SERVICES[normalizedServiceName] ?? null; }; export const getService = serviceName => { const service = findService(serviceName); if (!service) { throw new Error(`Atlas services support only: ${Object.keys(SERVICES).join(', ')}.`); } return service; };