import BaseService from '..'; import type { IPlansCatalog } from './plans.interface'; import { PLANS } from './plans.routes'; /** * The plan catalog from the API. Public, so it needs no token. * * @return {Promise} Plans, agents and the limit row order. */ export const getPlansCatalog = async (): Promise => { const response: IPlansCatalog & { success?: boolean } = await BaseService.get(PLANS); if (!response?.success || !Array.isArray(response.plans)) { throw new Error('Plan catalog response is malformed'); } return response; };