import { AbstractProcessor } from './AbstractProcessor.js';
import { AttributeProcessor } from './AttributeProcessor.js';
export class EventProcessor extends AbstractProcessor {
    attributeProcessor;
    constructor(context) {
        super(context);
        this.attributeProcessor = new AttributeProcessor(context);
    }
    process(eventsData) {
        return Object.entries(eventsData).map(([eventName, eventDef]) => {
            const payload = [];
            // Process attributes (same as model attributes)
            if (eventDef.attributes) {
                for (const [attrName, attrDef] of Object.entries(eventDef.attributes)) {
                    payload.push(this.attributeProcessor.process(attrName, attrDef));
                }
            }
            return {
                name: eventName,
                description: eventDef.description,
                version: eventDef.version, // NEW
                previousVersions: eventDef.previousVersions, // NEW
                payload
            };
        });
    }
}
//# sourceMappingURL=EventProcessor.js.map