import { collectDependencies } from '../detection-utils.js';
const DYNAMO_DEPS = [
    '@aws-sdk/client-dynamodb',
    '@aws-sdk/lib-dynamodb',
    'dynamodb',
    'boto3-dynamodb',
    'aws-sdk-go/service/dynamodb',
    'dynamodb-enhanced',
];
const COSMOS_DEPS = ['@azure/cosmos', 'azure-cosmos', 'azure-cosmosdb'];
const DOCDB_DEPS = ['@aws-sdk/client-docdb', 'amazon-documentdb'];
const AURORA_DEPS = [
    '@aws-sdk/client-rds-data',
    'aurora-data-api',
    'aws-sdk-go/service/rdsdataservice',
];
export async function detectCloudDb(projectPath) {
    const deps = await collectDependencies(projectPath);
    // DynamoDB (AWS)
    if (DYNAMO_DEPS.some((d) => deps.has(d))) {
        return 'dynamodb';
    }
    // CosmosDB (Azure)
    if (COSMOS_DEPS.some((d) => deps.has(d))) {
        return 'cosmosdb';
    }
    // DocumentDB (AWS — MongoDB compatible)
    if (DOCDB_DEPS.some((d) => deps.has(d))) {
        return 'documentdb';
    }
    // Aurora (AWS — PostgreSQL/MySQL compatible)
    if (AURORA_DEPS.some((d) => deps.has(d))) {
        return 'aurora';
    }
    return null;
}
export function detectCloudProvider(cloudDb) {
    if (!cloudDb) {
        return null;
    }
    switch (cloudDb) {
        case 'dynamodb':
        case 'aurora':
        case 'documentdb':
            return 'aws';
        case 'cosmosdb':
            return 'azure';
    }
}
//# sourceMappingURL=cloud-db-detector.js.map