-
-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
Public exports per package. This is a typed-reference index — for narrative explanations, follow the links into the deeper pages.
For the canonical, always-up-to-date source: each package's dist/index.d.ts (shipped in the npm tarball).
import {
// Orchestration
Relay,
type RelayOptions,
type RelayHooks,
type RetryConfig,
type DlqConfig,
// Type-safe events
defineOutbox,
type OutboxRegistry,
type TopicDefinition,
type EnqueueInput,
type OutboxConsumer,
type OutboxProducer,
OutboxValidationError,
// Types
type OutboxRecord,
type OutboxMessageInput,
type OutboxStore,
type Publisher,
type PublishableMessage,
type PublishResult,
type PublishErrorKind,
type Serializer,
type Logger,
type Tracing,
// Standard Schema interop
type StandardSchemaV1,
} from "@eventferry/core";| Surface | Page |
|---|---|
Relay + retry / DLQ config |
Core Concepts, Reliability and Error Handling, Dead-Letter Queue |
defineOutbox, OutboxValidationError
|
Type-Safe Events |
PublishErrorKind taxonomy |
Reliability and Error Handling |
import {
PostgresStore,
type PostgresStoreOptions,
createMigrationSql,
PostgresStreamingRelay,
type PostgresStreamingRelayOptions,
PostgresNotifyWaker,
type PostgresNotifyWakerOptions,
} from "@eventferry/postgres";Page: Postgres Adapter
import {
MysqlStore,
type MysqlStoreOptions,
createMigrationSql,
MysqlBinlogRelay,
type MysqlBinlogRelayOptions,
} from "@eventferry/mysql";Page: MySQL Adapter
import {
// Publisher
KafkaPublisher,
type KafkaPublisherOptions,
type DriverKind, // "kafkajs" | "confluent"
// Connection config
type KafkaConnectionConfig,
type TlsConfig,
type SaslConfig,
type SaslPasswordConfig,
type SaslOauthbearerConfig,
type OauthBearerToken,
// Producer behavior
type ProducerBehaviorConfig,
type KafkaJsPartitionerChoice, // "default" | "legacy" | "java-compatible"
type LibrdkafkaStats,
// Hooks + tracing
type KafkaPublisherHooks,
type KafkaTracer,
type SpanLike,
type SpanAttributeValue,
NoopKafkaTracer,
// Admin
type KafkaAdmin,
type KafkaDriverAdmin,
type TopicCreateSpec,
type TopicMetadata,
type PartitionMetadata,
type PartitionGrowSpec,
// Health
type HealthStatus,
// Driver layer (advanced)
KafkaJsDriver,
ConfluentDriver,
type KafkaDriver,
buildConfluentClientConfig,
classifyKafkajsError,
classifyConfluentError,
} from "@eventferry/kafka";Subpath:
import {
decode,
decodeHeaders,
extractTraceContext,
type IncomingKafkaMessage,
type IncomingHeaders,
type DecodedHeaders,
type DecodedMessage,
type DecodeOptions,
type Decoder,
type TraceContext,
} from "@eventferry/kafka/consume";| Surface | Page |
|---|---|
KafkaPublisher configuration |
Kafka Publisher |
TlsConfig, SaslConfig
|
Authentication and TLS |
ProducerBehaviorConfig knobs |
Kafka Publisher |
KafkaPublisherHooks, KafkaTracer
|
Observability |
KafkaAdmin, TopicCreateSpec, etc. |
Admin Operations |
HealthStatus |
Observability |
decode, extractTraceContext
|
Consuming Events |
classifyKafkajsError, classifyConfluentError
|
Reliability and Error Handling |
import {
SchemaRegistrySerializer,
type SchemaRegistrySerializerOptions,
type SchemaSpec,
type SchemaType, // "AVRO" | "PROTOBUF" | "JSON"
type SubjectNameStrategy, // "TopicNameStrategy" | "RecordNameStrategy" | "TopicRecordNameStrategy"
type SchemaRegistryAuth,
type SchemaRegistryClient,
} from "@eventferry/schema-registry";Page: Schema Registry
import {
createMskIamSasl,
type MskIamSaslOptions,
type MskIamSigner,
} from "@eventferry/kafka-iam";Page: AWS MSK IAM
Re-exports everything from core + postgres + mysql + kafka + schema-registry. Same names, no namespacing:
import {
Relay,
PostgresStore,
MysqlStore,
KafkaPublisher,
SchemaRegistrySerializer,
defineOutbox,
// ...everything from the inner packages
} from "@eventferry/all";@eventferry/kafka-iam is not re-exported by @eventferry/all (AWS-specific). Install separately if needed.
Page: Packages
interface OutboxStore<Tx = unknown> {
enqueue(tx: Tx, msg: OutboxMessageInput): Promise<string>;
claimBatch(size: number): Promise<OutboxRecord[]>;
markDone(recordIds: string[]): Promise<void>;
markFailed(recordId: string, nextRetryAt: Date | null, status: "failed" | "dead"): Promise<void>;
requeue?(recordId: string, retryAt: Date): Promise<void>; // optional
purgeDone?(opts: { olderThanMs: number; batchSize: number }): Promise<number>;
init?(): Promise<void>;
close?(): Promise<void>;
}interface Publisher {
connect(): Promise<void>;
disconnect(): Promise<void>;
publish(messages: PublishableMessage[]): Promise<PublishResult[]>;
publishToDlq?(message: PublishableMessage, error: Error): Promise<void>;
readonly transactional?: boolean;
}interface KafkaDriver {
connect(): Promise<void>;
disconnect(): Promise<void>;
sendBatch(messages: PublishableMessage[]): Promise<PublishResult[]>;
readonly transactional: boolean;
admin?(): Promise<KafkaDriverAdmin>;
}interface KafkaAdmin {
listTopics(): Promise<string[]>;
describeTopics(topics: string[]): Promise<TopicMetadata[]>;
createTopics(specs: TopicCreateSpec[]): Promise<void>;
createPartitions(specs: PartitionGrowSpec[]): Promise<void>;
close(): Promise<void>;
}interface KafkaTracer {
startPublishSpan(name: string, attributes: Record<string, SpanAttributeValue>): SpanLike;
inject?(span: SpanLike, headers: Record<string, string>): void;
}interface Serializer {
readonly contentType: string;
serialize(record: OutboxRecord): Promise<Buffer>;
}type PublishErrorKind =
| "retriable" // transient — retry per backoff
| "fatal" // skip retry, DLQ immediately
| "poison" // record-level rejection, DLQ immediately
| "backpressure" // requeue without attempts++
| "quota" // retry with quotaMultiplier × backoff
| "fenced"; // producer epoch fencedFull mapping table → Reliability and Error Handling.
interface HealthStatus {
ok: boolean;
latencyMs: number;
timestamp: number;
error?: Error;
}publisher.healthCheck({ timeoutMs }) returns this. See Observability.
Repository · Issues · npm: @eventferry/all · MIT
Get going
Adapters
Type & schema
Security
Operational
- Transactions and EOS
- Admin Operations
- Observability
- Consuming Events
- Dead-Letter Queue
- Reliability and Error Handling
Operations
Reference