"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchBundle = void 0;
const axios_1 = __importDefault(require("axios"));
/**
 * Downloads the FHIR bundle from a Metriport webhook payload URL. The URL is
 * pre-signed and only valid for 10 minutes.
 * https://docs.metriport.com/medical-api/handling-data/patient-encounter-bundle
 */
const fetchBundle = async (url) => {
    const { data } = await axios_1.default.get(url, {
        // The bundle can be large; give it room and expect JSON back.
        responseType: 'json',
        maxContentLength: Infinity,
        maxBodyLength: Infinity,
    });
    return data;
};
exports.fetchBundle = fetchBundle;
//# sourceMappingURL=fetchBundle.js.map