mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-03 16:10:21 +00:00
Added a test to add stream name and assert if stream with uppercase exists add a stream with lowercase and assert if stream name with lowercase exists
28 lines
795 B
JavaScript
28 lines
795 B
JavaScript
export const getHeaders = () => {
|
|
const basicAuthCredentials = Buffer.from(
|
|
`${process.env["ZO_ROOT_USER_EMAIL"]}:${process.env["ZO_ROOT_USER_PASSWORD"]}`
|
|
).toString("base64");
|
|
|
|
return {
|
|
Authorization: `Basic ${basicAuthCredentials}`,
|
|
"Content-Type": "application/json",
|
|
};
|
|
};
|
|
|
|
export const getIngestionUrl = (orgId, streamName) => {
|
|
return `${process.env.INGESTION_URL}/api/${orgId}/${streamName}/_json`;
|
|
};
|
|
|
|
export const sendRequest = async (page, url, payload, headers) => {
|
|
return await page.evaluate(
|
|
async ({ url, headers, payload }) => {
|
|
const response = await fetch(url, {
|
|
method: "POST",
|
|
headers: headers,
|
|
body: JSON.stringify(payload),
|
|
});
|
|
return await response.json();
|
|
},
|
|
{ url, headers, payload }
|
|
);
|
|
};
|