UNPKG

@foxy.io/sdk

Version:

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

22 lines (21 loc) 837 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAllowedFrequencies = void 0; const getAllowedFrequencies_js_1 = require("../backend/getAllowedFrequencies.js"); /** * Returns allowed frequencies for given subscription and customer portal settings. * * @param opts Subscription and settings. * @returns Array of allowed frequencies. */ function getAllowedFrequencies(opts) { const allowFrequencyModification = opts.settings.subscriptions.allow_frequency_modification.map(v => ({ jsonataQuery: v.jsonata_query, values: v.values, })); return getAllowedFrequencies_js_1.getAllowedFrequencies({ settings: { subscriptions: { allowFrequencyModification } }, subscription: opts.subscription, }); } exports.getAllowedFrequencies = getAllowedFrequencies;