Initial commit: ArchiTools modular dashboard platform
Complete Next.js 16 application with 13 fully implemented modules: Email Signature, Word XML Generator, Registratura, Dashboard, Tag Manager, IT Inventory, Address Book, Password Vault, Mini Utilities, Prompt Generator, Digital Signatures, Word Templates, and AI Chat. Includes core platform systems (module registry, feature flags, storage abstraction, i18n, theming, auth stub, tagging), 16 technical documentation files, Docker deployment config, and legacy HTML tool reference. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import type { RegistryEntry } from '../types';
|
||||
|
||||
const STORAGE_PREFIX = 'entry:';
|
||||
|
||||
export interface RegistryStorage {
|
||||
get<T>(key: string): Promise<T | null>;
|
||||
set<T>(key: string, value: T): Promise<void>;
|
||||
delete(key: string): Promise<void>;
|
||||
list(): Promise<string[]>;
|
||||
}
|
||||
|
||||
export async function getAllEntries(storage: RegistryStorage): Promise<RegistryEntry[]> {
|
||||
const keys = await storage.list();
|
||||
const entries: RegistryEntry[] = [];
|
||||
for (const key of keys) {
|
||||
if (key.startsWith(STORAGE_PREFIX)) {
|
||||
const entry = await storage.get<RegistryEntry>(key);
|
||||
if (entry) entries.push(entry);
|
||||
}
|
||||
}
|
||||
entries.sort((a, b) => b.createdAt.localeCompare(a.createdAt));
|
||||
return entries;
|
||||
}
|
||||
|
||||
export async function saveEntry(storage: RegistryStorage, entry: RegistryEntry): Promise<void> {
|
||||
await storage.set(`${STORAGE_PREFIX}${entry.id}`, entry);
|
||||
}
|
||||
|
||||
export async function deleteEntry(storage: RegistryStorage, id: string): Promise<void> {
|
||||
await storage.delete(`${STORAGE_PREFIX}${id}`);
|
||||
}
|
||||
|
||||
export function generateRegistryNumber(date: string, index: number): string {
|
||||
const d = new Date(date);
|
||||
const year = d.getFullYear();
|
||||
const padded = String(index).padStart(4, '0');
|
||||
return `${padded}/${year}`;
|
||||
}
|
||||
Reference in New Issue
Block a user