feat: add new page and migration scripts for access rules and collections

- Introduced new page component for library topics with type checks.
- Added migration scripts to update access rules for various collections including badges, curriculum versions, and themes.
- Implemented PocketBase integration for managing collection access rules dynamically.
- Ensured proper type validation for page props and metadata generation functions.
This commit is contained in:
RaymondVerhoef
2026-05-23 22:26:40 +02:00
parent 14286d6cb1
commit 8684ffa35b
109 changed files with 2065 additions and 114 deletions

View File

@@ -19,16 +19,22 @@ async function handleResponse<T>(res: Response): Promise<T> {
return res.json() as Promise<T>
}
export async function postIngest(formData: FormData): Promise<{ jobId: string }> {
export async function postIngest(payload: {
documentId: string
filename: string
format: 'pdf' | 'md' | 'txt'
fileUrl: string
}): Promise<{ jobId: string }> {
const res = await fetch(`${INGESTION_URL}/ingest`, {
method: 'POST',
body: formData,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
})
return handleResponse<{ jobId: string }>(res)
}
export async function getIngestionStatus(jobId: string): Promise<IngestionJobStatus> {
const res = await fetch(`${INGESTION_URL}/ingest/${encodeURIComponent(jobId)}/status`)
const res = await fetch(`${INGESTION_URL}/ingest/status/${encodeURIComponent(jobId)}`)
return handleResponse<IngestionJobStatus>(res)
}