diff --git a/packages/amqp/lib/AmqpQueuePublisherManager.ts b/packages/amqp/lib/AmqpQueuePublisherManager.ts index aa1bbd7f..40141e95 100644 --- a/packages/amqp/lib/AmqpQueuePublisherManager.ts +++ b/packages/amqp/lib/AmqpQueuePublisherManager.ts @@ -1,6 +1,5 @@ import type { PublisherBaseEventType, - CommonEventDefinition, EventRegistry, MetadataFiller, MessageMetadataType, @@ -9,6 +8,7 @@ import type { CommonCreationConfigType, } from '@message-queue-toolkit/core' import { AbstractPublisherManager } from '@message-queue-toolkit/core' +import type { AmqpAwareEventDefinition } from '@message-queue-toolkit/schemas' import type z from 'zod' import type { AbstractAmqpPublisher, AMQPPublisherOptions } from './AbstractAmqpPublisher' @@ -24,12 +24,7 @@ import type { import type { AmqpPublisherFactory } from './CommonAmqpPublisherFactory' import { CommonAmqpQueuePublisherFactory } from './CommonAmqpPublisherFactory' -export type AmqpAwareEventDefinition = { - schemaVersion?: string - exchange?: string // optional if used with a direct exchange - queueName?: string // should only be specified for direct exchanges - topic?: string // used for topic exchanges -} & CommonEventDefinition +export type { AmqpAwareEventDefinition } export type AmqpPublisherManagerDependencies = { eventRegistry: EventRegistry diff --git a/packages/schemas/index.ts b/packages/schemas/index.ts index 148cc6ba..a91ccddb 100644 --- a/packages/schemas/index.ts +++ b/packages/schemas/index.ts @@ -3,3 +3,6 @@ export { toDatePreprocessor } from './lib/utils/toDateProcessor' export * from './lib/events/eventTypes' export * from './lib/events/baseEventSchemas' export * from './lib/messages/baseMessageSchemas' + +export * from './lib/vendors/amqpSchemas' +export * from './lib/vendors/snsSchemas' diff --git a/packages/schemas/lib/vendors/amqpSchemas.ts b/packages/schemas/lib/vendors/amqpSchemas.ts new file mode 100644 index 00000000..e0b7abae --- /dev/null +++ b/packages/schemas/lib/vendors/amqpSchemas.ts @@ -0,0 +1,8 @@ +import type { CommonEventDefinition } from '../events/eventTypes' + +export type AmqpAwareEventDefinition = { + schemaVersion?: string + exchange?: string // optional if used with a direct exchange + queueName?: string // should only be specified for direct exchanges + topic?: string // used for topic exchanges +} & CommonEventDefinition diff --git a/packages/schemas/lib/vendors/snsSchemas.ts b/packages/schemas/lib/vendors/snsSchemas.ts new file mode 100644 index 00000000..5fff432c --- /dev/null +++ b/packages/schemas/lib/vendors/snsSchemas.ts @@ -0,0 +1,6 @@ +import type { CommonEventDefinition } from '../events/eventTypes' + +export type SnsAwareEventDefinition = { + schemaVersion?: string + snsTopic?: string +} & CommonEventDefinition diff --git a/packages/sns/lib/sns/SnsPublisherManager.ts b/packages/sns/lib/sns/SnsPublisherManager.ts index f798cf1d..1f629913 100644 --- a/packages/sns/lib/sns/SnsPublisherManager.ts +++ b/packages/sns/lib/sns/SnsPublisherManager.ts @@ -1,5 +1,4 @@ import type { - CommonEventDefinition, EventRegistry, MessagePublishType, MessageSchemaType, @@ -8,6 +7,7 @@ import type { } from '@message-queue-toolkit/core' import { AbstractPublisherManager } from '@message-queue-toolkit/core' import type { MessageMetadataType } from '@message-queue-toolkit/core/lib/messages/baseMessageSchemas' +import type { SnsAwareEventDefinition } from '@message-queue-toolkit/schemas' import type z from 'zod' import type { @@ -19,10 +19,7 @@ import type { SNSCreationConfig, SNSDependencies, SNSQueueLocatorType } from './ import type { SnsPublisherFactory } from './CommonSnsPublisherFactory' import { CommonSnsPublisherFactory } from './CommonSnsPublisherFactory' -export type SnsAwareEventDefinition = { - schemaVersion?: string - snsTopic?: string -} & CommonEventDefinition +export type { SnsAwareEventDefinition } export type SnsPublisherManagerDependencies = { eventRegistry: EventRegistry