import { type Id } from '../identifier.utils.js'; import { type CreateMessage } from './message.utils.js'; import type { Partitioning } from './partitioning.utils.js'; import type { CommandResponse } from '../../client/client.type.js'; /** * Parameters for the send messages command. */ export type SendMessages = { /** Stream identifier */ streamId: Id; /** Topic identifier */ topicId: Id; /** Array of messages to send */ messages: CreateMessage[]; /** Optional partitioning strategy */ partition?: Partitioning; }; /** Commit confirmation for one partition written by a send. */ export type SendMessagesConfirmation = { /** Numeric id of the stream the batch was written to */ streamId: number; /** Numeric id of the topic the batch was written to */ topicId: number; /** Partition the batch was written to */ partitionId: number; /** * Offset assigned to the first message of the batch in that partition. * * Delivery is at-least-once, so an earlier retry of the same batch may * already have committed at a lower offset: this never identifies a batch * uniquely. Confirmation follows VSR quorum commit. Persisted message * durability also requires recoverable stable-storage copies on the quorum. */ baseOffset: bigint; }; /** * Outcome of a successful send, one confirmation per written partition. The * legacy server returns an empty list: it commits without reporting offsets. */ export type SendMessagesResponse = { /** Commit confirmations, one per partition the batch was written to */ confirmations: SendMessagesConfirmation[]; }; /** * Send messages command definition. * Publishes messages to a topic. */ export declare const SEND_MESSAGES: { code: number; serialize: ({ streamId, topicId, messages, partition }: SendMessages) => Buffer; deserialize: (r: CommandResponse) => SendMessagesResponse; }; /** * Executable send messages command function. Resolves to the commit * confirmations of the written partitions, empty against the legacy server. */ export declare const sendMessages: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: SendMessages) => Promise; //# sourceMappingURL=send-messages.command.d.ts.map