/** * Stored document types for MongoDB collections. * * Each type maps to a single MongoDB collection and represents a slice of a * parsed `BuildConfig`. The full config is intentionally split across multiple * collections so consumers can query individual sections (flows, attributes, * docs, etc.) without loading the entire build. */ import type { ChangeLog } from "../change-logs/types.js"; /** Shared fields present on every stored document that belongs to a build. */ export interface DomainVersion { domain: string; version: string; } /** * Top-level build metadata — everything from `BuildConfig` *except* the large * sub-collections (x-docs, x-flows, x-attributes, x-validations) which are * stored separately. */ export interface StoredBuildMeta extends DomainVersion { openapi: string; title?: string; description?: string; usecases: string[]; branchName?: string; reporting: boolean; security?: Record[]; paths: Record>; components: Record; errorCodes: { Event: string; Description: string; From: string; code: string | number; }[]; supportedActions: Record; apiProperties: Record; /** SHA-256 hex digest of the full JSON-stringified BuildConfig. */ buildHash: string; ingestedAt: Date; } /** One markdown document from `x-docs`. */ export interface StoredBuildDoc extends DomainVersion { slug: string; content: string; /** Insertion order derived from `Object.entries(x-docs)`. */ order: number; updatedAt: Date; } /** One flow entry from `x-flows`. */ export interface StoredBuildFlow extends DomainVersion { flowId: string; usecase: string; tags: string[]; description: string; /** Full flow config — kept as opaque JSON to avoid coupling to mock-runner types. */ config: unknown; updatedAt: Date; } /** One attribute set from `x-attributes`, keyed by use-case. */ export interface StoredBuildAttribute extends DomainVersion { useCaseId: string; attributeSet: Record; updatedAt: Date; } /** Domain validations — stored as-is since the schema is `unknown`. */ export interface StoredBuildValidation extends DomainVersion { validations: unknown; updatedAt: Date; } /** * Extends the existing `ChangeLog` type with identifiers needed for * querying changelogs by domain, version range, or date. */ export interface StoredChangeLog extends ChangeLog, DomainVersion { fromVersion: string; toVersion: string; branch?: string; totalChanges: number; } //# sourceMappingURL=schemas.d.ts.map