# fixparser-common

Shared TypeScript interfaces, types, and utilities for the [FIXParser](https://fixparser.dev/) ecosystem.

## What is fixparser-common?

`fixparser-common` provides foundational building blocks for FIXParser and its plugins, including:
- **Message storage interfaces and buffers** for handling FIX messages
- **Logging interfaces and types** for consistent, pluggable logging
- **Plugin interface** for extensibility
- **UUID generation utility**
- **Common types** for messages and log levels

This package is not a standalone FIX engine, but is intended for use by FIXParser, its plugins, and related tools.

## Main Exports

- `IMessageStore<T>`: Interface for generic message storage (add, retrieve, update, remove, etc.)
- `MessageBuffer<T>`: In-memory buffer implementing `IMessageStore<T>`
- `ILogTransporter`: Interface for pluggable log transport (e.g., to file, console, remote)
- `LogMessage`, `Level`: Types for structured logging
- `IPlugin<T>`: Interface for registering plugins
- `IMessage`: Interface for FIX messages
- `uuidv4`: Utility for generating UUID v4 strings

## Example Usage

```ts
import { MessageBuffer, LogMessage, Level, uuidv4 } from 'fixparser-common';

// Message buffer for storing messages
const buffer = new MessageBuffer(100);
buffer.add({ messageSequence: 1, encode: () => 'FIX message' });

// Logging
const log: LogMessage = { level: 'info' as Level, message: 'Started FIX session' };

// Generate a UUID
const id = uuidv4();
```

## License

Copyright © 2025 FIXParser Ltd. Released under Commercial license. Check [LICENSE.md](https://gitlab.com/logotype/fixparser/-/blob/main/LICENSE.md). 