feat: implement automation key management with middleware and routes for organization API keys, invite improvements

This commit is contained in:
Rotimi Best
2026-03-13 18:40:07 +01:00
parent 77a1188573
commit 492f8dc5ed
71 changed files with 3655 additions and 456 deletions
+19
View File
@@ -0,0 +1,19 @@
export type GenerateSlugOptions = {
fallback?: string;
appendTimestamp?: boolean;
};
export function generateSlug(source: string | null | undefined, options: GenerateSlugOptions = {}): string {
const { fallback = 'item', appendTimestamp = false } = options;
const base =
(source ?? fallback)
.trim()
.toLowerCase()
.replace(/[^a-z0-9\s-]/g, '')
.replace(/\s+/g, '-')
.replace(/-+/g, '-')
.replace(/^-|-$/g, '') || fallback;
return appendTimestamp ? `${base}-${Date.now()}` : base;
}