export interface ServiceConfig { id: number; type: 'http'; serverId?: number; title: string; params: Array<{ type: ParamType; key: string; value: string | string[] | number | boolean; }>; } export const ParamTypes = ['text', 'number', 'boolean', 'regexp'] as const; export type ParamType = typeof ParamTypes[number]; export function validateParamType(input: string): ParamType { const found = ParamTypes.find(k => k === input); if (!found) throw new Error(`'${input}' is not a valid param type`); return found; }