import type { ErrorObject } from "ajv"; import type { Catalox } from "./catalox.js"; import type { CataloxContext } from "@x12i/catalox-contracts/context.js"; import type { CreateCatalogInput } from "@x12i/catalox-contracts/inputs.js"; import type { CatalogDescriptor } from "@x12i/catalox-contracts/descriptors.js"; import type { CatalogItemValidationReport } from "@x12i/catalox-contracts/item-validation.js"; /** Supported manifest schema versions (increment when shape changes). */ export type CataloxSeedPresetSchemaVersion = 1; export type CataloxSeedManifestV1 = { presetVersion: CataloxSeedPresetSchemaVersion; /** Stable id for migrations (e.g. `xynthesis@v1`). */ id?: string; name?: string; description?: string; catalogs: CreateCatalogInput[]; descriptors?: Array<{ catalogId: string; descriptorVersion: string; descriptor: CatalogDescriptor; mode?: "replace" | "merge"; }>; bindings?: Array<{ appId: string; catalogId: string; access?: { canRead?: boolean; canWrite?: boolean; canAdmin?: boolean; }; }>; items?: Array<{ catalogId: string; data: Record; }>; }; export type CataloxSeedManifest = CataloxSeedManifestV1; export type ApplyCataloxSeedPresetResult = { applied: { catalogsCreated: string[]; catalogsSkippedExisting: string[]; descriptors: string[]; bindings: string[]; items: string[]; }; warnings?: string[]; }; export declare class CataloxSeedManifestError extends Error { readonly ajvErrors?: ErrorObject[] | null | undefined; constructor(message: string, ajvErrors?: ErrorObject[] | null | undefined); } export declare function parseCataloxSeedManifest(data: unknown): CataloxSeedManifestV1; export type CataloxSeedManifestItemPayloadIssue = { catalogId: string; itemIndex: number; report: CatalogItemValidationReport; }; /** * Validate manifest `items[]` rows against resolvable payload schemas (manifest catalog entries only; no Firestore). */ export declare function validateCataloxSeedManifestItemPayloads(manifest: CataloxSeedManifestV1): CataloxSeedManifestItemPayloadIssue[]; export declare function loadCataloxSeedManifestFromPath(presetPath: string): Promise; /** Parse manifest JSON and validate item payloads when schemas resolve. */ export declare function validateCataloxSeedManifest(data: unknown): { manifest: CataloxSeedManifestV1; itemPayloadIssues: CataloxSeedManifestItemPayloadIssue[]; }; /** * Idempotent apply: catalogs (create if missing) → descriptors → bindings → native items. * Descriptor steps require {@link CataloxContext.superAdmin}. Bindings default `canWrite` to `true` * when the manifest lists native `items` for that `catalogId` (so upserts succeed), unless overridden. * * Preset sources: * - `{ presetPath }` — filesystem JSON manifest * - `{ preset, cwd? }` — resolved via {@link resolveCataloxSeedPresetPath} (builtins, registry, npm `catalox.seedPreset`, or paths) * - `{ manifest }` — in-memory object (validated) */ export declare function applyCataloxSeedPreset(catalox: Catalox, context: CataloxContext, input: { manifest: CataloxSeedManifestV1; } | { presetPath: string; } | { preset: string; cwd?: string; }): Promise; //# sourceMappingURL=seed-preset.d.ts.map