// ╔═══════╗╔═══════╗╔════╗╔═╗╔════╗╔═╗╔═══════╗╔═══════╗╔═══════╗╔═══════╗╔═══════╗╔════╗╔═╗ ╔═╗ ╔═╗╔═══════╗╔═╗ ╔═══════╗╔═══════╗╔═══════╗╔═══════╗╔═══════╗╔═══════╗╔═══════╗ ╔═══════╗╔═══════╗ // ║ ╔═════╝║ ╔═══╗ ║║ ╔╗ ║║ ║║ ╔╗ ║║ ║║ ╔═════╝║ ╔═════╝╚══╗ ╔══╝╚══╗ ╔══╝║ ╔═══╗ ║║ ╔╗ ║║ ║ ║ ║ ║ ║║ ╔═══╗ ║║ ║ ╚══╗ ╔══╝╚╗ ╔══╗ ║║ ╔═══╗ ║╚══╗ ╔══╝║ ╔═══╗ ║║ ╔═══╗ ║║ ╔═════╝ ╚══╗ ╔══╝║ ╔═════╝ // ║ ║ ║ ║ ║ ║║ ║║ ║║ ║║ ║║ ║║ ║║ ╚═════╗║ ║ ║ ║ ║ ║ ║ ║ ║ ║║ ║║ ║║ ║╔═══════╗║ ╚╗ ╔╝ ║║ ╚═══╝ ║║ ║ ║ ║ ║ ║ ║ ║║ ╚═══╝ ║ ║ ║ ║ ║ ║ ║║ ╚═══╝ ║║ ╚═════╗ ║ ║ ║ ╚═════╗ // ║ ║ ║ ║ ║ ║║ ║║ ║║ ║║ ║║ ║║ ║║ ╔═════╝║ ║ ║ ║ ║ ║ ║ ║ ║ ║║ ║║ ║║ ║╚═══════╝╚╗ ║ ║ ╔╝║ ╔═══╗ ║║ ║ ║ ║ ║ ║ ║ ║║ ╔═══╗ ║ ║ ║ ║ ║ ║ ║║ ╔═╗ ╔═╝╚═════╗ ║ ║ ║ ╚═════╗ ║ // ║ ╚═════╗║ ╚═══╝ ║║ ║║ ╚╝ ║║ ║║ ╚╝ ║║ ╚═════╗║ ╚═════╗ ║ ║ ╔══╝ ╚══╗║ ╚═══╝ ║║ ║║ ╚╝ ║ ║ ╚═╝ ║ ║ ║ ║ ║║ ╚═════╗╔══╝ ╚══╗╔╝ ╚══╝ ║║ ║ ║ ║ ║ ║ ║ ╚═══╝ ║║ ║ ║ ╚═╗╔═════╝ ║╔═╗ ║ ║ ╔═════╝ ║ // ╚═══════╝╚═══════╝╚═╝╚════╝╚═╝╚════╝╚═══════╝╚═══════╝ ╚═╝ ╚═══════╝╚═══════╝╚═╝╚════╝ ╚═════╝ ╚═╝ ╚═╝╚═══════╝╚═══════╝╚═══════╝╚═╝ ╚═╝ ╚═╝ ╚═══════╝╚═╝ ╚═══╝╚═══════╝╚═╝ ╚═╝ ╚═══════╝ // ╔═══════╗╔═══════╗╔═══════╗╔═══════╗╔═══════╗╔═══════╗╔═══════╗ // ╚══╗ ╔══╝║ ╔╗ ╔╗ ║║ ╔═══╗ ║║ ╔═══╗ ║║ ╔═══╗ ║╚══╗ ╔══╝║ ╔═════╝ // ║ ║ ║ ║║ ║║ ║║ ╚═══╝ ║║ ║ ║ ║║ ╚═══╝ ║ ║ ║ ║ ╚═════╗ // ║ ║ ║ ║║ ║║ ║║ ╔═════╝║ ║ ║ ║║ ╔═╗ ╔═╝ ║ ║ ╚═════╗ ║ // ╔══╝ ╚══╗║ ║║ ║║ ║║ ║ ║ ╚═══╝ ║║ ║ ║ ╚═╗ ║ ║ ╔═════╝ ║ // ╚═══════╝╚═╝╚═╝╚═╝╚═╝ ╚═══════╝╚═╝ ╚═══╝ ╚═╝ ╚═══════╝ import * as connectionClasses from '../classes/connection-classes.js'; import * as connectionErrors from '../errors/connection-errors.js'; import * as utilityEngine from '@xyz.warpmatter.com/utility-engine'; // ╔═══════╗╔════╗╔═╗╔═══════╗╔═══════╗╔═══════╗╔════╗╔═╗╔═══════╗╔═══════╗ // ╚══╗ ╔══╝║ ╔╗ ║║ ║║ ╔═════╝╚══╗ ╔══╝║ ╔═══╗ ║║ ╔╗ ║║ ║║ ╔═════╝║ ╔═════╝ // ║ ║ ║ ║║ ║║ ║║ ╚═════╗ ║ ║ ║ ╚═══╝ ║║ ║║ ║║ ║║ ║ ║ ╚═════╗ // ║ ║ ║ ║║ ║║ ║╚═════╗ ║ ║ ║ ║ ╔═══╗ ║║ ║║ ║║ ║║ ║ ║ ╔═════╝ // ╔══╝ ╚══╗║ ║║ ╚╝ ║╔═════╝ ║ ║ ║ ║ ║ ║ ║║ ║║ ╚╝ ║║ ╚═════╗║ ╚═════╗ // ╚═══════╝╚═╝╚════╝╚═══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚════╝╚═══════╝╚═══════╝ export function validateConnections(values: any[]) { if (!areValidConnections(values)) { return connectionErrors.throwInvalidMailgunConnectionInstanceError(); } } export function validateConnection(value: any) { if (!isValidConnection(value)) { return connectionErrors.throwInvalidMailgunConnectionInstanceError(); } } export function areValidConnections(values: any): values is connectionClasses.Connection[] { return utilityEngine.isFilledArray(values) && values.every((value) => isValidConnection(value)); } export function isValidConnection(value: any): value is connectionClasses.Connection { return value instanceof connectionClasses.Connection; }