feat: enhance API and middleware functionality: add public API routes, implement program and course member checks, and improve rate limiting for invite acceptance. Update OpenAPI spec generation to focus on public API endpoints and add new middleware for automation key scopes. Include new documentation for lesson AI features and public API tests.

This commit is contained in:
Rotimi Best
2026-04-12 08:58:41 +01:00
parent 5a8f50f67b
commit d6e812d08b
573 changed files with 31964 additions and 8708 deletions
@@ -0,0 +1,8 @@
import End from './resource-list-row-end.svelte';
import Group from './resource-list-group.svelte';
import Lead from './resource-list-row-lead.svelte';
import Main from './resource-list-row-main.svelte';
import Root from './resource-list-row.svelte';
export { Root, Lead, Main, End, Group };
export type { ResourceListRowAlign, ResourceListRowDensity } from './resource-list-row.svelte';
@@ -0,0 +1,21 @@
<script lang="ts">
import { cn, type WithElementRef } from '../../tools';
import type { HTMLAttributes } from 'svelte/elements';
let {
ref = $bindable(null),
class: className,
children,
...restProps
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
</script>
<div
bind:this={ref}
role="list"
data-slot="resource-list-group"
class={cn('ui:group/resource-list ui:flex ui:w-full ui:flex-col ui:rounded-md ui:border ui:border-border', className)}
{...restProps}
>
{@render children?.()}
</div>
@@ -0,0 +1,20 @@
<script lang="ts">
import { cn, type WithElementRef } from '../../tools';
import type { HTMLAttributes } from 'svelte/elements';
let {
ref = $bindable(null),
class: className,
children,
...restProps
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
</script>
<div
bind:this={ref}
data-slot="resource-list-row-end"
class={cn('ui:flex ui:shrink-0 ui:items-center ui:justify-end ui:gap-2 ui:self-center', className)}
{...restProps}
>
{@render children?.()}
</div>
@@ -0,0 +1,20 @@
<script lang="ts">
import { cn, type WithElementRef } from '../../tools';
import type { HTMLAttributes } from 'svelte/elements';
let {
ref = $bindable(null),
class: className,
children,
...restProps
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
</script>
<div
bind:this={ref}
data-slot="resource-list-row-lead"
class={cn('ui:flex ui:shrink-0 ui:items-center ui:justify-center ui:self-center', className)}
{...restProps}
>
{@render children?.()}
</div>
@@ -0,0 +1,20 @@
<script lang="ts">
import { cn, type WithElementRef } from '../../tools';
import type { HTMLAttributes } from 'svelte/elements';
let {
ref = $bindable(null),
class: className,
children,
...restProps
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
</script>
<div
bind:this={ref}
data-slot="resource-list-row-main"
class={cn('ui:flex ui:min-w-0 ui:flex-1 ui:flex-col ui:gap-0.5', className)}
{...restProps}
>
{@render children?.()}
</div>
@@ -0,0 +1,72 @@
<script lang="ts" module>
import { tv, type VariantProps } from 'tailwind-variants';
export const resourceListRowVariants = tv({
base: 'ui:flex-nowrap! ui:rounded-none ui:border-0 ui:border-b ui:border-border last:ui:border-b-0 ui:hover:bg-muted/50',
variants: {
align: {
center: 'ui:items-center',
start: 'ui:items-start'
},
/** Tighter block padding than `Item` size alone (e.g. toolbar / “select all” row). */
density: {
default: '',
toolbar: 'ui:gap-2 ui:py-1.5'
}
},
defaultVariants: {
align: 'center',
density: 'default'
}
});
export type ResourceListRowAlign = VariantProps<typeof resourceListRowVariants>['align'];
export type ResourceListRowDensity = VariantProps<typeof resourceListRowVariants>['density'];
</script>
<script lang="ts">
import * as Item from '../../base/item';
import { cn, type WithElementRef } from '../../tools';
import type { ItemSize, ItemVariant } from '../../base/item/item.svelte';
import type { HTMLAttributes } from 'svelte/elements';
import type { Snippet } from 'svelte';
let {
ref = $bindable(null),
class: className,
child,
children,
variant = 'outline',
size = 'sm',
align = 'center',
density = 'default',
...restProps
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
child?: Snippet<[{ props: Record<string, unknown> }]>;
children?: Snippet;
variant?: ItemVariant;
size?: ItemSize;
align?: ResourceListRowAlign;
density?: ResourceListRowDensity;
} = $props();
const layoutClass = $derived(cn(resourceListRowVariants({ align, density }), className));
</script>
{#if child}
<Item.Root {variant} {size} data-density={density} {...restProps}>
{#snippet child({ props })}
{@render child!({
props: {
...props,
'data-density': density,
class: cn(props.class as string | undefined, layoutClass)
}
})}
{/snippet}
</Item.Root>
{:else}
<Item.Root bind:ref {variant} {size} class={layoutClass} data-density={density} {...restProps}>
{@render children?.()}
</Item.Root>
{/if}