UNPKG

@foxy.io/sdk

Version:

Universal SDK for a full server-side and a limited in-browser access to Foxy hAPI.

18 lines (17 loc) 678 B
import { getAllowedFrequencies as backendGetAllowedFrequencies } from '../backend/getAllowedFrequencies.js'; /** * Returns allowed frequencies for given subscription and customer portal settings. * * @param opts Subscription and settings. * @returns Array of allowed frequencies. */ export function getAllowedFrequencies(opts) { const allowFrequencyModification = opts.settings.subscriptions.allow_frequency_modification.map(v => ({ jsonataQuery: v.jsonata_query, values: v.values, })); return backendGetAllowedFrequencies({ settings: { subscriptions: { allowFrequencyModification } }, subscription: opts.subscription, }); }