import { SmrtCollection } from '@happyvertical/smrt-core'; import { PipelineDefinition } from '../models/PipelineDefinition.js'; import { PipelineStage } from '../models/PipelineStage.js'; import { EnsureDefaultPipelineParams, EnsureDefaultPipelineResult } from '../types.js'; export declare class PipelineDefinitionCollection extends SmrtCollection { static readonly _itemClass: typeof PipelineDefinition; private stageCollectionPromise; /** Sibling stage collection sharing this collection's DB connection. */ private getStageCollection; /** * Find one pipeline by its machine key (natural key within the tenant * scope — ambient tenancy auto-filters the lookup). */ findByKey(key: string): Promise; /** * Find the pipeline flagged `isDefault` (informational designation). */ findDefault(): Promise; /** * A pipeline's stages in board order (`sortOrder` ascending). */ getStages(pipelineId: string): Promise; /** * Idempotently find-or-create the seeded default pipeline (key * `'default'`, `isDefault: true`) and its 7 default stages: * `new(0.1) → qualified(0.25) → discovery(0.4) → proposal(0.6) → * negotiation(0.8) → closed_won(1.0, isWon) → closed_lost(0.0, isLost)`. * * Idempotency is per stage KEY: a second call creates nothing, and a * partially-seeded pipeline (e.g. an interrupted first run) is healed by * creating only the missing keys. Existing stages are never overwritten — * renames, re-weights, reorders, and custom stages added via normal * PipelineStage operations all survive re-runs. * * Tenancy: under an ambient `withTenant()` context the pipeline/stages * auto-scope to that tenant; pass `tenantId` to seed for a specific tenant * from a system/global context. Lookup is by natural key, so each tenant * gets exactly one seeded default pipeline. * * @returns The pipeline plus ALL of its stages ordered by `sortOrder` * (including any custom stages added since seeding) */ ensureDefaultPipeline(params?: EnsureDefaultPipelineParams): Promise; } export default PipelineDefinitionCollection; //# sourceMappingURL=PipelineDefinitionCollection.d.ts.map