@message-queue-toolkit/core
Advanced tools
Comparing version 3.4.0 to 3.5.0
@@ -5,3 +5,3 @@ export type { QueueConsumer, AsyncPublisher, SyncPublisher, TransactionObservabilityManager, Logger, SchemaMap, } from './lib/types/MessageQueueTypes'; | ||
export { isMessageError, MessageValidationError, MessageInvalidFormatError, } from './lib/errors/Errors'; | ||
export { HandlerContainer, MessageHandlerConfig, MessageHandlerConfigBuilder, } from './lib/queues/HandlerContainer'; | ||
export { HandlerContainer, MessageHandlerConfig, MessageHandlerConfigBuilder, BarrierCallbackWithoutMessageType, } from './lib/queues/HandlerContainer'; | ||
export type { HandlerContainerOptions, Handler } from './lib/queues/HandlerContainer'; | ||
@@ -8,0 +8,0 @@ export { MessageSchemaContainer } from './lib/queues/MessageSchemaContainer'; |
import type { Either } from '@lokalise/node-core'; | ||
import type { ZodSchema } from 'zod'; | ||
export type LogFormatter<MessagePayloadSchema> = (message: MessagePayloadSchema) => unknown; | ||
export type BarrierCallbackWithoutMessageType<MessagePayloadSchema extends object> = (message: MessagePayloadSchema) => Promise<boolean>; | ||
export declare const defaultLogFormatter: <MessagePayloadSchema>(message: MessagePayloadSchema) => MessagePayloadSchema; | ||
export type HandlerConfigOptions<MessagePayloadSchema> = { | ||
export type HandlerConfigOptions<MessagePayloadSchema extends object> = { | ||
messageLogFormatter?: LogFormatter<MessagePayloadSchema>; | ||
preHandlerBarrier?: BarrierCallbackWithoutMessageType<MessagePayloadSchema>; | ||
}; | ||
export declare class MessageHandlerConfig<const MessagePayloadSchema, const ExecutionContext> { | ||
export declare class MessageHandlerConfig<const MessagePayloadSchema extends object, const ExecutionContext> { | ||
readonly schema: ZodSchema<MessagePayloadSchema>; | ||
readonly handler: Handler<MessagePayloadSchema, ExecutionContext>; | ||
readonly messageLogFormatter: LogFormatter<MessagePayloadSchema>; | ||
readonly handler: Handler<MessagePayloadSchema, ExecutionContext>; | ||
readonly preHandlerBarrier?: BarrierCallbackWithoutMessageType<MessagePayloadSchema>; | ||
constructor(schema: ZodSchema<MessagePayloadSchema>, handler: Handler<MessagePayloadSchema, ExecutionContext>, options?: HandlerConfigOptions<MessagePayloadSchema>); | ||
} | ||
export declare class MessageHandlerConfigBuilder<MessagePayloadSchemas, ExecutionContext> { | ||
export declare class MessageHandlerConfigBuilder<MessagePayloadSchemas extends object, ExecutionContext> { | ||
private readonly configs; | ||
@@ -16,0 +19,0 @@ constructor(); |
@@ -8,4 +8,5 @@ "use strict"; | ||
schema; | ||
handler; | ||
messageLogFormatter; | ||
handler; | ||
preHandlerBarrier; | ||
constructor(schema, handler, options) { | ||
@@ -15,2 +16,3 @@ this.schema = schema; | ||
this.messageLogFormatter = options?.messageLogFormatter ?? exports.defaultLogFormatter; | ||
this.preHandlerBarrier = options?.preHandlerBarrier; | ||
} | ||
@@ -17,0 +19,0 @@ } |
{ | ||
"name": "@message-queue-toolkit/core", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30139
438