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:
@@ -0,0 +1,17 @@
|
||||
/** FNV-1a–style hash for stable, client-only placeholder picks (e.g. icon per course). */
|
||||
export function hashStringToUInt32(value: string): number {
|
||||
let hash = 2166136261;
|
||||
|
||||
for (let index = 0; index < value.length; index++) {
|
||||
hash ^= value.charCodeAt(index);
|
||||
hash = Math.imul(hash, 16777619);
|
||||
}
|
||||
|
||||
return hash >>> 0;
|
||||
}
|
||||
|
||||
export function buildCoursePlaceholderAvatarUrl(seed: string): string {
|
||||
const stableSeed = hashStringToUInt32(seed).toString(36);
|
||||
|
||||
return `https://api.dicebear.com/9.x/thumbs/svg?seed=${encodeURIComponent(stableSeed)}`;
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import { writable } from 'svelte/store';
|
||||
export const courseMetaDeta = writable<{
|
||||
view: 'grid' | 'list';
|
||||
}>({
|
||||
view: 'grid'
|
||||
view: 'list'
|
||||
});
|
||||
|
||||
export const createCourseModal = writable({
|
||||
|
||||
Reference in New Issue
Block a user