gatsby-source-sanity
Version:
Gatsby source plugin for building websites using Sanity.io as a backend.
17 lines • 612 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const axios_1 = require("axios");
const index_1 = require("../index");
function getDocumentStream(url, token) {
const auth = token ? { Authorization: `Bearer ${token}` } : {};
const userAgent = { 'User-Agent': `${index_1.pkgName}` };
const headers = Object.assign({}, userAgent, auth);
return axios_1.default({
method: 'get',
responseType: 'stream',
url,
headers
}).then(res => res.data);
}
exports.getDocumentStream = getDocumentStream;
//# sourceMappingURL=getDocumentStream.js.map