mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02:00
# Description of Changes Adds a streaming endpoint to the Java AI orchestrator (`/api/v1/ai/orchestrate/stream` in addition to the existing `/api/v1/ai/orchestrate`). This allows the caller to get updates of what stage of orchestration is being run at the time so UIs can give the user feedback. Also contains some dubious Gradle changes to suppress errors coming from Spotless, when it crashes in Google stuff. I'm not sure if that's appropriate to add, feel free to ask for changes in review.
20 lines
611 B
TypeScript
20 lines
611 B
TypeScript
import type { AxiosInstance } from "axios";
|
|
import { getBrowserId } from "@app/utils/browserIdentifier";
|
|
|
|
export function setupApiInterceptors(client: AxiosInstance): void {
|
|
// Add browser ID header for WAU tracking
|
|
client.interceptors.request.use(
|
|
(config) => {
|
|
const browserId = getBrowserId();
|
|
config.headers["X-Browser-Id"] = browserId;
|
|
return config;
|
|
},
|
|
(error) => Promise.reject(error),
|
|
);
|
|
}
|
|
|
|
/** Auth headers for raw fetch() calls (SSE streams, etc.). Proprietary overrides with JWT + XSRF. */
|
|
export function getAuthHeaders(): Record<string, string> {
|
|
return {};
|
|
}
|