BREAKING: Full rewrite, no backward compatibility with v2.x.
v2.1.0 preserved at git tag v2.1.0 for reference.
Highlights:
- Engine-factory pattern: createMedia(config) returns frozen MediaEngine.
Package owns its models (pass connection, not a built model). No .init().
- MediaRepository extends mongokit Repository<T> directly — repository IS
the API surface. All 50+ proxy methods from v2 removed.
- Arc-compatible EventTransport (structural compat, no arc import). Any
arc transport (Memory / Redis / Kafka) drops in as config.eventTransport.
- Dynamic tenantFieldType ('objectId' | 'string') drives both schema
and multiTenantPlugin — enables \$lookup / .populate() for ObjectId
auth systems (Better Auth).
- Four host-implemented bridges: SourceBridge, ScanBridge, CdnBridge,
TransformBridge. Compose ImageKit-like stacks without vendor lock-in.
- Soft delete via mongokit's softDeletePlugin (replaces custom hooks).
- Zod v4 schemas at /schemas subpath. Numeric bounds use .min(1) not
.positive() so z.toJSONSchema() emits Fastify-compatible schemas.
- Peer deps: @classytic/mongokit >=3.6.2, mongoose >=9.4.1, zod >=4.
Testing: 368 tests (27 files), e2e against real S3, capabilities test
proves extensibility (ImageKit-like composition on primitives).
See CHANGELOG.md and CLAUDE.md for the full v3 surface.