9a4c6863d1
- Add stages module with full CRUD API and admin overview island - Add mobility overview island (Liste, Kanban, Detail CRUD views) - Add contract PDF upload/download endpoints for mobilites - Add light/dark theme toggle in header - Add employeeOnly flag to hide entire modules from students (admin, students, stages) - Add read-only GET endpoints for modules/ues/ue-modules in notes module - Add [slug].tsx catch-all routes for direct URL navigation - Replace old mobility table with mobilites + stages schema (migration 0004) - Allow students to create mobilites and upload contracts - Redirect authenticated users from / to /apps catalog
70 lines
1.5 KiB
TypeScript
70 lines
1.5 KiB
TypeScript
import { type RegularTagNode, type TextNode } from "@melvdouc/xml-parser";
|
|
import { AsyncRoute } from "$fresh/src/server/types.ts";
|
|
|
|
export interface AuthenticatedState {
|
|
isAuthenticated: true;
|
|
session: CasContent;
|
|
availablePages: Record<string, string>;
|
|
}
|
|
|
|
interface UnauthenticatedState {
|
|
isAuthenticated: false;
|
|
session: undefined;
|
|
}
|
|
|
|
export type State = AuthenticatedState | UnauthenticatedState;
|
|
|
|
export interface AppProperties {
|
|
name: string;
|
|
icon: string;
|
|
pages: Record<string, string>;
|
|
adminOnly: string[];
|
|
studentOnly?: string[];
|
|
employeeOnly?: boolean;
|
|
hint: string;
|
|
}
|
|
|
|
export interface CasTagNode extends RegularTagNode {
|
|
children: [TextNode];
|
|
}
|
|
|
|
export interface CasGroupNode extends RegularTagNode {
|
|
children: CasTagNode[];
|
|
}
|
|
|
|
export interface CasResponse extends RegularTagNode {
|
|
children: [TextNode, CasGroupNode];
|
|
}
|
|
|
|
export interface CasContent {
|
|
amuCampus: string;
|
|
amuComposante: string;
|
|
amuDateValidation: string;
|
|
coGroup: string;
|
|
eduPersonPrimaryAffiliation: string;
|
|
eduPersonPrincipalName: string;
|
|
mail: string;
|
|
displayName: string;
|
|
givenName: string;
|
|
memberOf: string[];
|
|
sn: string;
|
|
supannCivilite: string;
|
|
supannEntiteAffectation: string;
|
|
supannEtuAnneeInscription: string;
|
|
supannEtuEtape: string;
|
|
uid: string;
|
|
}
|
|
|
|
export interface LoginJWT {
|
|
iss: "PolyMPR";
|
|
iat: number;
|
|
exp: number;
|
|
aud: "PolyMPR";
|
|
user: CasContent;
|
|
}
|
|
|
|
export type EmptyObject = Record<string | number | symbol, never>;
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
export type Route = AsyncRoute<any, State>;
|