35 lines
772 B
JavaScript
35 lines
772 B
JavaScript
import { getJson, requestJson } from "./endpointClient";
|
|
import { buildHashedQueryUrl } from "./relayClient";
|
|
|
|
export const getFileJson = (url) => {
|
|
return getJson(url);
|
|
};
|
|
|
|
export const getSignedFileJson = async (queryUrl) => {
|
|
const signedUrl = await buildHashedQueryUrl(queryUrl);
|
|
|
|
return requestJson({
|
|
method: "get",
|
|
url: signedUrl
|
|
});
|
|
};
|
|
|
|
export const downloadFileBlob = (url) => {
|
|
return requestJson({
|
|
method: "get",
|
|
url,
|
|
responseType: "blob"
|
|
});
|
|
};
|
|
|
|
export const postSignedFileJson = async (queryUrl, data, config = {}) => {
|
|
const signedUrl = await buildHashedQueryUrl(queryUrl);
|
|
|
|
return requestJson({
|
|
method: "post",
|
|
url: signedUrl,
|
|
data,
|
|
...config
|
|
});
|
|
};
|