feat: pre-generate Directus image previews
Bundle extension (upload hook + API endpoint + admin module) that warms
Directus image transform cache in-process with an explicit acceptFormat,
so the generated file matches the browser's cache key byte-for-byte.
- resumable, window-aware backfill with progress + cancel
- system + custom presets, effective-format reporting, shadow warnings
- storage breakdown (previews vs originals), human-readable API fields
- diagnostics: resolve-plan prediction, per-file generate, ops ring buffer
- isolated dev/staging compose stack + deploy/rollback scripts
Verified on Directus 11.17.4: 40/40 tests, hash-match gate passed,
idempotent backfill, custom fixed-format presets, error surfacing.
2026-10-25 11:19:54 +03:00
|
|
|
export interface Preset {
|
|
|
|
|
key: string;
|
|
|
|
|
format?: string;
|
|
|
|
|
quality?: number | string;
|
|
|
|
|
width?: number | string;
|
|
|
|
|
height?: number | string;
|
|
|
|
|
fit?: string;
|
|
|
|
|
withoutEnlargement?: boolean;
|
|
|
|
|
focal_point_x?: number | string | null;
|
|
|
|
|
focal_point_y?: number | string | null;
|
|
|
|
|
transforms?: unknown[];
|
|
|
|
|
[key: string]: unknown;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface WarmResultItem {
|
|
|
|
|
key: string;
|
|
|
|
|
format: string | null;
|
|
|
|
|
ok: boolean;
|
|
|
|
|
ms: number;
|
2026-10-25 13:52:28 +03:00
|
|
|
cached?: boolean;
|
feat: pre-generate Directus image previews
Bundle extension (upload hook + API endpoint + admin module) that warms
Directus image transform cache in-process with an explicit acceptFormat,
so the generated file matches the browser's cache key byte-for-byte.
- resumable, window-aware backfill with progress + cancel
- system + custom presets, effective-format reporting, shadow warnings
- storage breakdown (previews vs originals), human-readable API fields
- diagnostics: resolve-plan prediction, per-file generate, ops ring buffer
- isolated dev/staging compose stack + deploy/rollback scripts
Verified on Directus 11.17.4: 40/40 tests, hash-match gate passed,
idempotent backfill, custom fixed-format presets, error surfacing.
2026-10-25 11:19:54 +03:00
|
|
|
error?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface WarmSummary {
|
|
|
|
|
requested: number;
|
|
|
|
|
ok: number;
|
|
|
|
|
failed: number;
|
|
|
|
|
results: WarmResultItem[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface CompletedRecord {
|
|
|
|
|
file_id: string;
|
|
|
|
|
preset_key: string;
|
|
|
|
|
format: string | null;
|
|
|
|
|
ts: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface RunState {
|
|
|
|
|
running: boolean;
|
|
|
|
|
startedAt: number | null;
|
|
|
|
|
finishedAt: number | null;
|
|
|
|
|
total: number;
|
|
|
|
|
done: number;
|
|
|
|
|
generated: number;
|
|
|
|
|
hits: number;
|
|
|
|
|
failed: number;
|
|
|
|
|
rate: number;
|
|
|
|
|
eta: number | null;
|
|
|
|
|
cancelled: boolean;
|
2026-10-25 14:26:49 +03:00
|
|
|
paused?: boolean;
|
feat: pre-generate Directus image previews
Bundle extension (upload hook + API endpoint + admin module) that warms
Directus image transform cache in-process with an explicit acceptFormat,
so the generated file matches the browser's cache key byte-for-byte.
- resumable, window-aware backfill with progress + cancel
- system + custom presets, effective-format reporting, shadow warnings
- storage breakdown (previews vs originals), human-readable API fields
- diagnostics: resolve-plan prediction, per-file generate, ops ring buffer
- isolated dev/staging compose stack + deploy/rollback scripts
Verified on Directus 11.17.4: 40/40 tests, hash-match gate passed,
idempotent backfill, custom fixed-format presets, error surfacing.
2026-10-25 11:19:54 +03:00
|
|
|
error?: string;
|
|
|
|
|
}
|