/**
 * LINE Channel Adapter
 *
 * Connects to LINE Messaging API for sending/receiving messages.
 * This is a stub implementation.
 */
import { logger } from '../../utils/logger.js';
export class LINEAdapter {
    config;
    running = false;
    constructor(config) {
        this.config = { ...config };
        if (this.config.port === undefined) {
            this.config.port = 8080;
        }
    }
    async start() {
        if (this.running) {
            throw new Error('LINEAdapter is already running');
        }
        logger.debug('LINEAdapter: starting webhook server', { port: this.config.port });
        this.running = true;
    }
    async stop() {
        if (!this.running) {
            throw new Error('LINEAdapter is not running');
        }
        logger.debug('LINEAdapter: stopping webhook server');
        this.running = false;
    }
    isRunning() {
        return this.running;
    }
    async sendMessage(userId, text) {
        if (!this.running) {
            throw new Error('LINEAdapter is not running');
        }
        logger.debug('LINEAdapter: sending message', { userId, textLength: text.length });
        return { success: true };
    }
    async sendImage(userId, imageUrl) {
        if (!this.running) {
            throw new Error('LINEAdapter is not running');
        }
        logger.debug('LINEAdapter: sending image', { userId, imageUrl });
        return { success: true };
    }
    async sendSticker(userId, packageId, stickerId) {
        if (!this.running) {
            throw new Error('LINEAdapter is not running');
        }
        logger.debug('LINEAdapter: sending sticker', { userId, packageId, stickerId });
        return { success: true };
    }
    async getProfile(userId) {
        if (!this.running) {
            throw new Error('LINEAdapter is not running');
        }
        return {
            userId,
            displayName: `User ${userId}`,
            pictureUrl: '',
            statusMessage: '',
        };
    }
    getConfig() {
        return { ...this.config };
    }
}
export default LINEAdapter;
//# sourceMappingURL=index.js.map