import type { Either } from '@lokalise/node-core'; import { type AsyncPublisher, type BarrierResult, type MessageInvalidFormatError, type MessageValidationError, type OffloadedPayloadPointerPayload, type QueuePublisherOptions, type ResolvedMessage } from '@message-queue-toolkit/core'; import type { SNSCreationConfig, SNSDependencies, SNSTopicLocatorType } from './AbstractSnsService.ts'; import { AbstractSnsService } from './AbstractSnsService.ts'; export type SNSMessageOptions = { MessageGroupId?: string; MessageDeduplicationId?: string; }; export type SNSPublisherOptionsBase = QueuePublisherOptions; /** * SNS Publisher options with type-safe FIFO topic configuration. * When fifoTopic is true, messageGroupIdField and defaultMessageGroupId are available. * When fifoTopic is false or omitted, these fields are not allowed. */ export type SNSPublisherOptions = SNSPublisherOptionsBase & ({ /** * Set to true for FIFO topics. Enables messageGroupIdField and defaultMessageGroupId options. */ fifoTopic: true; /** * Field name in the message payload to use as MessageGroupId for FIFO topics. * If not provided, MessageGroupId must be specified in publish options. */ messageGroupIdField?: string; /** * Default MessageGroupId to use when messageGroupIdField is not present in the message. * If not provided and messageGroupIdField is not found, MessageGroupId must be specified in publish options. */ defaultMessageGroupId?: string; } | { /** * Set to false or omit for standard (non-FIFO) topics. */ fifoTopic?: false; messageGroupIdField?: never; defaultMessageGroupId?: never; }); export declare abstract class AbstractSnsPublisher extends AbstractSnsService implements AsyncPublisher { private readonly messageSchemaContainer; private readonly isDeduplicationEnabled; private readonly isFifoTopic; private readonly messageGroupIdField?; private readonly defaultMessageGroupId?; private initPromise?; constructor(dependencies: SNSDependencies, options: SNSPublisherOptions); init(): Promise; publish(message: MessagePayloadType, options?: SNSMessageOptions): Promise; protected resolveMessage(): Either; protected resolveSchema(message: MessagePayloadType): Either>>; protected resolveNextFunction(): () => void; protected processPrehandlers(): Promise; protected preHandlerBarrier(): Promise>; processMessage(): Promise>; protected isDeduplicationEnabledForMessage(message: MessagePayloadType): boolean; protected sendMessage(payload: MessagePayloadType | OffloadedPayloadPointerPayload, options: SNSMessageOptions): Promise; /** * Resolves FIFO-specific options (MessageGroupId) from the message payload. * This must be called BEFORE payload offloading, as the offloaded payload * won't contain the user fields needed for messageGroupIdField resolution. * * @param payload - The original (non-offloaded) message payload * @param options - The SNS message options to augment with FIFO settings * @returns The options with resolved MessageGroupId for FIFO topics */ private resolveFifoOptions; }