feat: добавить генерацию image variants

- добавлен shared config presets, custom transforms и allowlist hosts
- реализованы Backend endpoints для assets, presets и variants
- добавлена orchestration через PostgreSQL, RabbitMQ, S3 и worker
- обновлён Gateway read-through flow с L1 cache и корректным Vary: Accept
- добавлена миграция resize_mode для variants lookup
- обновлены dev scripts, env template, lockfile и документация
This commit is contained in:
2026-05-05 13:25:28 +03:00
parent bcadb85a83
commit 1c0e8277a3
59 changed files with 3526 additions and 143 deletions

View File

@@ -1,2 +1,3 @@
export { createDatabase, createDatabasePool } from "./client.js"
export type { Database, DatabasePool } from "./client.js"
export * from "./schema.js"

View File

@@ -14,6 +14,7 @@ import {
export const assetStatusEnum = pgEnum("asset_status", ["active", "disabled", "deleted"])
export const variantFormatEnum = pgEnum("variant_format", ["avif", "webp", "jpg", "png"])
export const requestedFormatEnum = pgEnum("requested_format", ["auto", "avif", "webp", "jpg", "png"])
export const resizeModeEnum = pgEnum("resize_mode", ["fit", "fill"])
export const variantStatusEnum = pgEnum("variant_status", ["pending", "processing", "ready", "failed"])
const timestamps = {
@@ -86,6 +87,7 @@ export const imageVariants = pgTable(
format: variantFormatEnum("format").notNull(),
width: integer("width").notNull(),
height: integer("height"),
resizeMode: resizeModeEnum("resize_mode").notNull().default("fit"),
quality: integer("quality").notNull(),
s3Key: text("s3_key").notNull(),
contentType: text("content_type"),
@@ -103,6 +105,8 @@ export const imageVariants = pgTable(
table.assetVersion,
table.preset,
table.width,
table.height,
table.resizeMode,
table.quality,
table.format,
),