@puls-atlas/cli
Version:
The Puls Atlas CLI tool for managing Atlas projects
20 lines • 624 B
JavaScript
import { execSync } from '../../../utils/index.js';
export const manageRequest = async (projectId, data) => {
const url = `https://europe-west1-${projectId}.cloudfunctions.net/atlasExport-base-manageAtlasExport`;
const token = execSync('gcloud auth print-identity-token', {
stdio: 'pipe'
}).toString();
return fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`
},
body: JSON.stringify(data)
}).then(async response => {
if (!response.ok) {
throw new Error(await response.text());
}
return response;
});
};