// engine/migration/service-migrator-catalogs.ts — Static provider/equivalence/validation catalogs
// Used internally by service-migrator.ts — not part of public API
// --- Provider catalog ---
export const PROVIDER_CATALOG = [
    // Message queues
    {
        provider: 'rabbitmq',
        type: 'message-queue',
        keywords: ['rabbitmq', 'amqp'],
        stateless: false,
        riskLevel: 'stateful-replayable',
    },
    {
        provider: 'kafka',
        type: 'message-queue',
        keywords: ['kafka', 'confluent'],
        stateless: false,
        riskLevel: 'stateful-replayable',
    },
    {
        provider: 'sqs',
        type: 'message-queue',
        keywords: ['sqs', 'aws sqs', 'simple queue'],
        stateless: false,
        riskLevel: 'stateful-replayable',
    },
    // Caches
    {
        provider: 'redis',
        type: 'cache',
        keywords: ['redis', 'ioredis', 'upstash'],
        stateless: true,
        riskLevel: 'stateless',
    },
    {
        provider: 'memcached',
        type: 'cache',
        keywords: ['memcached', 'memcache'],
        stateless: true,
        riskLevel: 'stateless',
    },
    // Object storage
    {
        provider: 's3',
        type: 'object-storage',
        keywords: ['s3', 'aws-sdk s3', '@aws-sdk/client-s3'],
        stateless: false,
        riskLevel: 'stateful-critical',
    },
    {
        provider: 'gcs',
        type: 'object-storage',
        keywords: ['gcs', 'google-cloud/storage', '@google-cloud/storage'],
        stateless: false,
        riskLevel: 'stateful-critical',
    },
    {
        provider: 'azure-blob',
        type: 'object-storage',
        keywords: ['azure blob', '@azure/storage-blob'],
        stateless: false,
        riskLevel: 'stateful-critical',
    },
    // Auth
    {
        provider: 'auth0',
        type: 'auth',
        keywords: ['auth0', '@auth0/'],
        stateless: true,
        riskLevel: 'stateless',
    },
    {
        provider: 'cognito',
        type: 'auth',
        keywords: ['cognito', 'amazon-cognito', 'aws-cognito'],
        stateless: true,
        riskLevel: 'stateless',
    },
    {
        provider: 'keycloak',
        type: 'auth',
        keywords: ['keycloak'],
        stateless: true,
        riskLevel: 'stateless',
    },
    // Observability
    {
        provider: 'datadog',
        type: 'observability',
        keywords: ['datadog', 'dd-trace'],
        stateless: true,
        riskLevel: 'stateless',
    },
    {
        provider: 'newrelic',
        type: 'observability',
        keywords: ['newrelic', 'new relic', '@newrelic'],
        stateless: true,
        riskLevel: 'stateless',
    },
    {
        provider: 'prometheus',
        type: 'observability',
        keywords: ['prometheus', 'prom-client'],
        stateless: true,
        riskLevel: 'stateless',
    },
];
// --- Service equivalences catalog ---
export const SERVICE_EQUIVALENCES = [
    {
        source: 'rabbitmq',
        target: 'kafka',
        type: 'message-queue',
        differences: [
            {
                aspect: 'Message deletion',
                sourceDescription: 'RabbitMQ deletes messages after acknowledgement',
                targetDescription: 'Kafka retains messages by offset; consumers manage position',
                migrationImpact: 'breaking',
            },
            {
                aspect: 'Consumer groups',
                sourceDescription: 'RabbitMQ queues are competing consumers by default',
                targetDescription: 'Kafka uses consumer groups with partition assignment',
                migrationImpact: 'notable',
            },
        ],
        adapterInterfaceName: 'IMessageBroker',
        methods: ['publish(topic, message)', 'subscribe(topic, handler)', 'acknowledge(messageId)'],
        sourceImpl: 'RabbitMQAdapter implements IMessageBroker',
        targetImpl: 'KafkaAdapter implements IMessageBroker',
        complexity: 'high',
    },
    {
        source: 'redis',
        target: 'dynamodb',
        type: 'cache',
        differences: [
            {
                aspect: 'TTL mechanism',
                sourceDescription: 'Redis EXPIRE sets TTL natively per key',
                targetDescription: 'DynamoDB TTL attribute-based; background deletion not immediate',
                migrationImpact: 'notable',
            },
            {
                aspect: 'Data structures',
                sourceDescription: 'Redis supports native sets, sorted sets, hashes, lists',
                targetDescription: 'DynamoDB only supports key-value and nested documents',
                migrationImpact: 'breaking',
            },
        ],
        adapterInterfaceName: 'ICacheStore',
        methods: ['get(key)', 'set(key, value, ttlSeconds?)', 'delete(key)', 'exists(key)'],
        sourceImpl: 'RedisAdapter implements ICacheStore',
        targetImpl: 'DynamoDbAdapter implements ICacheStore',
        complexity: 'medium',
    },
    {
        source: 's3',
        target: 'gcs',
        type: 'object-storage',
        differences: [
            {
                aspect: 'Bucket naming',
                sourceDescription: 'S3 bucket names are globally unique per AWS account',
                targetDescription: 'GCS bucket names are globally unique across all GCP projects',
                migrationImpact: 'minor',
            },
        ],
        adapterInterfaceName: 'IObjectStorage',
        methods: [
            'upload(bucket, key, data)',
            'download(bucket, key)',
            'delete(bucket, key)',
            'list(bucket, prefix?)',
        ],
        sourceImpl: 'S3Adapter implements IObjectStorage',
        targetImpl: 'GCSAdapter implements IObjectStorage',
        complexity: 'low',
    },
    {
        source: 'auth0',
        target: 'keycloak',
        type: 'auth',
        differences: [
            {
                aspect: 'Token validation',
                sourceDescription: 'Auth0 uses JWKS endpoint for token validation',
                targetDescription: 'Keycloak also uses JWKS but realm URL differs',
                migrationImpact: 'minor',
            },
            {
                aspect: 'User management API',
                sourceDescription: 'Auth0 Management API for user CRUD',
                targetDescription: 'Keycloak Admin REST API with different endpoints',
                migrationImpact: 'notable',
            },
        ],
        adapterInterfaceName: 'IAuthProvider',
        methods: ['verifyToken(token)', 'getUser(userId)', 'createUser(attrs)', 'deleteUser(userId)'],
        sourceImpl: 'Auth0Adapter implements IAuthProvider',
        targetImpl: 'KeycloakAdapter implements IAuthProvider',
        complexity: 'medium',
    },
];
// --- Validation checks catalog ---
export const VALIDATION_CHECK_TEMPLATES = [
    {
        serviceType: 'message-queue',
        checks: [
            { aspect: 'Throughput', unit: 'messages/second', checkType: 'throughput' },
            { aspect: 'End-to-end latency', unit: 'milliseconds (p99)', checkType: 'latency' },
            { aspect: 'Message durability', unit: 'hours (retention period)', checkType: 'durability' },
            {
                aspect: 'Delivery guarantee',
                unit: 'at-least-once | exactly-once',
                checkType: 'delivery-guarantee',
            },
            {
                aspect: 'Behaviour on broker failure',
                unit: 'reconnect time (seconds)',
                checkType: 'failure-mode',
            },
        ],
    },
    {
        serviceType: 'cache',
        checks: [
            { aspect: 'Read latency', unit: 'milliseconds (p99)', checkType: 'latency' },
            { aspect: 'Write throughput', unit: 'operations/second', checkType: 'throughput' },
            { aspect: 'TTL accuracy', unit: 'seconds (max delta)', checkType: 'durability' },
            { aspect: 'Eviction behaviour', unit: 'LRU | LFU | none', checkType: 'delivery-guarantee' },
            {
                aspect: 'Behaviour on node failure',
                unit: 'failover time (seconds)',
                checkType: 'failure-mode',
            },
        ],
    },
    {
        serviceType: 'object-storage',
        checks: [
            { aspect: 'Upload throughput', unit: 'MB/s', checkType: 'throughput' },
            { aspect: 'Download latency', unit: 'milliseconds (p99)', checkType: 'latency' },
            {
                aspect: 'Durability SLA',
                unit: 'nines of durability (e.g. 99.999999999)',
                checkType: 'durability',
            },
            {
                aspect: 'Consistency model',
                unit: 'strong | eventual | read-after-write',
                checkType: 'delivery-guarantee',
            },
            { aspect: 'Behaviour on region outage', unit: 'RTO in hours', checkType: 'failure-mode' },
        ],
    },
    {
        serviceType: 'auth',
        checks: [
            { aspect: 'Token validation latency', unit: 'milliseconds (p99)', checkType: 'latency' },
            { aspect: 'Token issuance throughput', unit: 'tokens/second', checkType: 'throughput' },
            { aspect: 'Token TTL', unit: 'seconds', checkType: 'durability' },
            { aspect: 'MFA support', unit: 'boolean', checkType: 'delivery-guarantee' },
            {
                aspect: 'Behaviour on provider outage',
                unit: 'fallback strategy',
                checkType: 'failure-mode',
            },
        ],
    },
    {
        serviceType: 'observability',
        checks: [
            { aspect: 'Metric ingestion latency', unit: 'seconds (max delay)', checkType: 'latency' },
            { aspect: 'Log ingestion throughput', unit: 'events/second', checkType: 'throughput' },
            { aspect: 'Retention period', unit: 'days', checkType: 'durability' },
            { aspect: 'Alert delivery SLA', unit: 'minutes (p99)', checkType: 'delivery-guarantee' },
            {
                aspect: 'Behaviour on agent failure',
                unit: 'data loss window (seconds)',
                checkType: 'failure-mode',
            },
        ],
    },
    {
        serviceType: 'third-party-api',
        checks: [
            { aspect: 'API response latency', unit: 'milliseconds (p99)', checkType: 'latency' },
            { aspect: 'Rate limit', unit: 'requests/minute', checkType: 'throughput' },
            { aspect: 'Data retention', unit: 'days', checkType: 'durability' },
            { aspect: 'Retry/idempotency support', unit: 'boolean', checkType: 'delivery-guarantee' },
            {
                aspect: 'Behaviour on API outage',
                unit: 'circuit breaker strategy',
                checkType: 'failure-mode',
            },
        ],
    },
];
//# sourceMappingURL=service-migrator-catalogs.js.map