import {} from "./schema.js";
import { VetraCloudEnvironmentProcessor } from "./index.js";
import { up } from "./migrations.js";
import { childLogger } from "document-model";
const logger = childLogger(["vetra-cloud-environment-factory"]);
export const vetraCloudEnvironmentProcessorFactory = (module) => async (driveHeader) => {
    logger.info(`Creating processor for drive ${driveHeader.id}`);
    const db = await module.relationalDb.createNamespace("vetra-cloud-environments");
    await up(db);
    const processor = new VetraCloudEnvironmentProcessor(db, module.reactorClient);
    return [
        {
            processor,
            filter: {
                branch: ["main"],
                documentId: ["*"],
                documentType: ["powerhouse/vetra-cloud-environment", "powerhouse/document-drive"],
                scope: ["global"],
            },
        },
    ];
};
