import { RootAPIHelper } from './root-api'; /** * Retrieves merge variable data * @param apiKey Root API key with CLI permissions * @param policyId Optional policyId for which the merge vars will be created off of * @returns The policy merge vars that will be injected into product module documentation */ export const fetchMergeVars = async (params: { apiKey: string; policyId?: string; host: string }) => { const { apiKey, policyId, host } = params; const rootApi = new RootAPIHelper({ host, apiKey, throwResponseErrors: true }); const path = `/cli/policy-merge-vars`; const searchParams = { ...(policyId && { policy_id: policyId }), }; return rootApi.send({ path, searchParams }); };