mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
- Add background_information field to Room database table and model - Create database migration for the new field - Update API schemas (CreateRoom, UpdateRoom) to handle background_information - Integrate room context into AI summarization prompts - Add background_information field to frontend room form - Update TypeScript types from regenerated OpenAPI spec The background information will be used to provide context for AI-generated summaries, helping create more appropriate and relevant meeting summaries. 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
41 lines
809 B
TypeScript
41 lines
809 B
TypeScript
export type AuthToken = string | undefined;
|
|
|
|
export interface Auth {
|
|
/**
|
|
* Which part of the request do we use to send the auth?
|
|
*
|
|
* @default 'header'
|
|
*/
|
|
in?: "header" | "query" | "cookie";
|
|
/**
|
|
* Header or query parameter name.
|
|
*
|
|
* @default 'Authorization'
|
|
*/
|
|
name?: string;
|
|
scheme?: "basic" | "bearer";
|
|
type: "apiKey" | "http";
|
|
}
|
|
|
|
export const getAuthToken = async (
|
|
auth: Auth,
|
|
callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken,
|
|
): Promise<string | undefined> => {
|
|
const token =
|
|
typeof callback === "function" ? await callback(auth) : callback;
|
|
|
|
if (!token) {
|
|
return;
|
|
}
|
|
|
|
if (auth.scheme === "bearer") {
|
|
return `Bearer ${token}`;
|
|
}
|
|
|
|
if (auth.scheme === "basic") {
|
|
return `Basic ${btoa(token)}`;
|
|
}
|
|
|
|
return token;
|
|
};
|