import { IComponentContext, IRequireInitialization } from "@walmartlabs/cookie-cutter-core"; import { QueueGetPropertiesResponse } from "@azure/storage-queue"; import { SpanContext } from "opentracing"; import { IQueueConfiguration, IQueueMessagePreprocessor } from "../streaming"; interface IQueueRequestOptions { /** * Specifies the queue name to use other than the configured default */ queueName?: string; } export declare enum QueueOpenTracingTagKeys { QueueName = "queue.name" } export interface IDeadLetterQueueOptions extends IQueueCreateMessageOptions { readonly maxDequeueCount: number; readonly retryCount?: number; readonly retryInterval?: number; } export interface IQueueCreateMessageOptions extends IQueueRequestOptions { /** * (FROM AZURE DOCS) * The time-to-live interval for the message, in seconds. The maximum time-to-live allowed is 7 days. If this parameter * is omitted, the default time-to-live is 7 days (604800 seconds) */ messageTimeToLive?: number; /** * (FROM AZURE DOCS) * Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or * equal to 0, and cannot be larger than 7 days (604800 seconds). The visibility timeout of a message cannot be set to a value later than * the expiry time (calculated based on time-to-live when updating message). visibilitytimeout should be set to a value smaller than the time-to-live value. */ visibilityTimeout?: number; } export interface IQueueReadOptions extends IQueueRequestOptions { /** * (FROM AZURE DOCS) * A nonzero integer value that specifies the number of messages to retrieve from the queue, * up to a maximum of 32. By default, a single message is retrieved from the queue with this operation. */ numOfMessages?: number; /** * (FROM AZURE DOCS) * Required if not peek only. Specifies the new visibility timeout value, in seconds, * relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days (604800 seconds). * The visibility timeout of a message can be set to a value later than the expiry time. */ visibilityTimeout?: number; readonly deadLetterQueue?: IDeadLetterQueueOptions; } export interface IQueueMessage { headers: Record; payload: unknown; } export declare class EnvelopeQueueMessagePreprocessor implements IQueueMessagePreprocessor { process(payload: string): IQueueMessage; } export declare class QueueClient implements IRequireInitialization { private config; private readonly queueService; readonly defaultQueue: string; private tracer; private metrics; private logger; private spanOperationName; constructor(config: IQueueConfiguration); initialize(context: IComponentContext): Promise; private generateMetricTags; private spanLogAndSetTags; private createQueueIfNotExists; write(spanContext: SpanContext, payload: any, headers: Record, options?: IQueueCreateMessageOptions): Promise; read(spanContext: SpanContext, options?: IQueueReadOptions): Promise; markAsProcessed(spanContext: SpanContext, messageId: string, popReceipt: string, queueName?: string): Promise; queueMetadata(spanContext: SpanContext, queueName: string): Promise; private getKB; private isMessageTooBig; } export {};