@amqp-contract/contract 0.3.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -51
- package/dist/index.cjs +83 -0
- package/dist/index.d.cts +528 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +528 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +82 -1
- package/dist/index.mjs.map +1 -1
- package/docs/index.md +276 -51
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -855,6 +855,533 @@ declare function defineConsumer<TMessage extends MessageDefinition>(queue: Queue
|
|
|
855
855
|
* ```
|
|
856
856
|
*/
|
|
857
857
|
declare function defineContract<TContract extends ContractDefinition>(definition: TContract): TContract;
|
|
858
|
+
/**
|
|
859
|
+
* Publisher-first builder result for fanout and direct exchanges.
|
|
860
|
+
*
|
|
861
|
+
* This type represents a publisher and provides a method to create
|
|
862
|
+
* a consumer that uses the same message schema with a binding to the exchange.
|
|
863
|
+
*
|
|
864
|
+
* This pattern is suitable for event-oriented messaging where publishers
|
|
865
|
+
* emit events without knowing which queues will consume them.
|
|
866
|
+
*
|
|
867
|
+
* @template TMessage - The message definition
|
|
868
|
+
* @template TPublisher - The publisher definition
|
|
869
|
+
*/
|
|
870
|
+
type PublisherFirstResult<TMessage extends MessageDefinition, TPublisher extends PublisherDefinition<TMessage>> = {
|
|
871
|
+
/** The publisher definition */
|
|
872
|
+
publisher: TPublisher;
|
|
873
|
+
/**
|
|
874
|
+
* Create a consumer that receives messages from this publisher.
|
|
875
|
+
* The consumer will automatically use the same message schema and
|
|
876
|
+
* a binding will be created with the same routing key.
|
|
877
|
+
*
|
|
878
|
+
* @param queue - The queue that will consume the messages
|
|
879
|
+
* @returns An object with the consumer definition and binding
|
|
880
|
+
*/
|
|
881
|
+
createConsumer: (queue: QueueDefinition) => {
|
|
882
|
+
consumer: ConsumerDefinition<TMessage>;
|
|
883
|
+
binding: QueueBindingDefinition;
|
|
884
|
+
};
|
|
885
|
+
};
|
|
886
|
+
/**
|
|
887
|
+
* Type-safe routing key that validates basic format.
|
|
888
|
+
*
|
|
889
|
+
* Validates that a routing key follows basic AMQP routing key rules:
|
|
890
|
+
* - Must not contain wildcards (* or #)
|
|
891
|
+
* - Must not be empty
|
|
892
|
+
* - Should contain alphanumeric characters, dots, hyphens, and underscores
|
|
893
|
+
*
|
|
894
|
+
* Note: Full character-by-character validation is not performed to avoid TypeScript
|
|
895
|
+
* recursion depth limits. Runtime validation is still recommended.
|
|
896
|
+
*
|
|
897
|
+
* @public
|
|
898
|
+
* @template S - The routing key string to validate
|
|
899
|
+
* @example
|
|
900
|
+
* ```typescript
|
|
901
|
+
* type Valid = RoutingKey<"order.created">; // "order.created"
|
|
902
|
+
* type Invalid = RoutingKey<"order.*">; // never (contains wildcard)
|
|
903
|
+
* type Invalid2 = RoutingKey<"">; // never (empty string)
|
|
904
|
+
* ```
|
|
905
|
+
*/
|
|
906
|
+
type RoutingKey<S extends string> = S extends "" ? never : S extends `${string}*${string}` | `${string}#${string}` ? never : S;
|
|
907
|
+
/**
|
|
908
|
+
* Type-safe binding pattern that validates basic format and wildcards.
|
|
909
|
+
*
|
|
910
|
+
* Validates that a binding pattern follows basic AMQP binding pattern rules:
|
|
911
|
+
* - Can contain wildcards (* for one word, # for zero or more words)
|
|
912
|
+
* - Must not be empty
|
|
913
|
+
* - Should contain alphanumeric characters, dots, hyphens, underscores, and wildcards
|
|
914
|
+
*
|
|
915
|
+
* Note: Full character-by-character validation is not performed to avoid TypeScript
|
|
916
|
+
* recursion depth limits. Runtime validation is still recommended.
|
|
917
|
+
*
|
|
918
|
+
* @public
|
|
919
|
+
* @template S - The binding pattern string to validate
|
|
920
|
+
* @example
|
|
921
|
+
* ```typescript
|
|
922
|
+
* type ValidPattern = BindingPattern<"order.*">; // "order.*"
|
|
923
|
+
* type ValidHash = BindingPattern<"order.#">; // "order.#"
|
|
924
|
+
* type ValidConcrete = BindingPattern<"order.created">; // "order.created"
|
|
925
|
+
* type Invalid = BindingPattern<"">; // never (empty string)
|
|
926
|
+
* ```
|
|
927
|
+
*/
|
|
928
|
+
type BindingPattern<S extends string> = S extends "" ? never : S;
|
|
929
|
+
/**
|
|
930
|
+
* Helper type for pattern matching with # in the middle
|
|
931
|
+
* Handles backtracking to match # with zero or more segments
|
|
932
|
+
* @internal
|
|
933
|
+
*/
|
|
934
|
+
type MatchesAfterHash<Key extends string, PatternRest$1 extends string> = MatchesPattern<Key, PatternRest$1> extends true ? true : Key extends `${string}.${infer KeyRest}` ? MatchesAfterHash<KeyRest, PatternRest$1> : false;
|
|
935
|
+
/**
|
|
936
|
+
* Check if a routing key matches a binding pattern
|
|
937
|
+
* Implements AMQP topic exchange pattern matching:
|
|
938
|
+
* - * matches exactly one word
|
|
939
|
+
* - # matches zero or more words
|
|
940
|
+
* @internal
|
|
941
|
+
*/
|
|
942
|
+
type MatchesPattern<Key extends string, Pattern extends string> = Pattern extends `${infer PatternPart}.${infer PatternRest}` ? PatternPart extends "#" ? MatchesAfterHash<Key, PatternRest> : Key extends `${infer KeyPart}.${infer KeyRest}` ? PatternPart extends "*" ? MatchesPattern<KeyRest, PatternRest> : PatternPart extends KeyPart ? MatchesPattern<KeyRest, PatternRest> : false : false : Pattern extends "#" ? true : Pattern extends "*" ? Key extends `${string}.${string}` ? false : true : Pattern extends Key ? true : false;
|
|
943
|
+
/**
|
|
944
|
+
* Validate that a routing key matches a binding pattern.
|
|
945
|
+
*
|
|
946
|
+
* This is a utility type provided for users who want compile-time validation
|
|
947
|
+
* that a routing key matches a specific pattern. It's not enforced internally
|
|
948
|
+
* in the API to avoid TypeScript recursion depth issues with complex routing keys.
|
|
949
|
+
*
|
|
950
|
+
* Returns the routing key if it's valid and matches the pattern, `never` otherwise.
|
|
951
|
+
*
|
|
952
|
+
* @example
|
|
953
|
+
* ```typescript
|
|
954
|
+
* type ValidKey = MatchingRoutingKey<"order.*", "order.created">; // "order.created"
|
|
955
|
+
* type InvalidKey = MatchingRoutingKey<"order.*", "user.created">; // never
|
|
956
|
+
* ```
|
|
957
|
+
*
|
|
958
|
+
* @template Pattern - The binding pattern (can contain * and # wildcards)
|
|
959
|
+
* @template Key - The routing key to validate
|
|
960
|
+
*/
|
|
961
|
+
type MatchingRoutingKey<Pattern extends string, Key extends string> = RoutingKey<Key> extends never ? never : BindingPattern<Pattern> extends never ? never : MatchesPattern<Key, Pattern> extends true ? Key : never;
|
|
962
|
+
/**
|
|
963
|
+
* Publisher-first builder result for topic exchanges.
|
|
964
|
+
*
|
|
965
|
+
* This type represents a publisher with a concrete routing key and provides a method
|
|
966
|
+
* to create consumers that can use routing key patterns matching the publisher's key.
|
|
967
|
+
*
|
|
968
|
+
* @template TMessage - The message definition
|
|
969
|
+
* @template TPublisher - The publisher definition
|
|
970
|
+
* @template TRoutingKey - The literal routing key type from the publisher (for documentation purposes)
|
|
971
|
+
*/
|
|
972
|
+
type PublisherFirstResultWithRoutingKey<TMessage extends MessageDefinition, TPublisher extends PublisherDefinition<TMessage>, TRoutingKey extends string> = {
|
|
973
|
+
/** The publisher definition */
|
|
974
|
+
publisher: TPublisher;
|
|
975
|
+
/**
|
|
976
|
+
* Create a consumer that receives messages from this publisher.
|
|
977
|
+
* For topic exchanges, the routing key pattern can be specified for the binding.
|
|
978
|
+
*
|
|
979
|
+
* @param queue - The queue that will consume the messages
|
|
980
|
+
* @param routingKey - Optional routing key pattern for the binding (defaults to publisher's routing key)
|
|
981
|
+
* @returns An object with the consumer definition and binding
|
|
982
|
+
*/
|
|
983
|
+
createConsumer: <TConsumerRoutingKey extends string = TRoutingKey>(queue: QueueDefinition, routingKey?: BindingPattern<TConsumerRoutingKey>) => {
|
|
984
|
+
consumer: ConsumerDefinition<TMessage>;
|
|
985
|
+
binding: QueueBindingDefinition;
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
/**
|
|
989
|
+
* Define a publisher-first relationship for event-oriented messaging.
|
|
990
|
+
*
|
|
991
|
+
* This builder enforces consistency by:
|
|
992
|
+
* 1. Ensuring the publisher and consumer use the same message schema
|
|
993
|
+
* 2. Linking the routing key from the publisher to the binding
|
|
994
|
+
*
|
|
995
|
+
* Use this pattern for events where publishers don't need to know about queues.
|
|
996
|
+
* Multiple consumers can be created for different queues, all using the same message schema.
|
|
997
|
+
*
|
|
998
|
+
* @param exchange - The exchange to publish to (fanout type)
|
|
999
|
+
* @param message - The message definition (schema and metadata)
|
|
1000
|
+
* @param options - Optional binding configuration
|
|
1001
|
+
* @returns A publisher-first result with publisher and consumer factory
|
|
1002
|
+
*
|
|
1003
|
+
* @example
|
|
1004
|
+
* ```typescript
|
|
1005
|
+
* import { z } from 'zod';
|
|
1006
|
+
*
|
|
1007
|
+
* const logsExchange = defineExchange('logs', 'fanout', { durable: true });
|
|
1008
|
+
* const logMessage = defineMessage(
|
|
1009
|
+
* z.object({
|
|
1010
|
+
* level: z.enum(['info', 'warn', 'error']),
|
|
1011
|
+
* message: z.string(),
|
|
1012
|
+
* })
|
|
1013
|
+
* );
|
|
1014
|
+
*
|
|
1015
|
+
* // Create publisher-first relationship (event pattern)
|
|
1016
|
+
* const logEvent = definePublisherFirst(logsExchange, logMessage);
|
|
1017
|
+
*
|
|
1018
|
+
* // Multiple queues can consume the same event
|
|
1019
|
+
* const logsQueue1 = defineQueue('logs-queue-1', { durable: true });
|
|
1020
|
+
* const logsQueue2 = defineQueue('logs-queue-2', { durable: true });
|
|
1021
|
+
*
|
|
1022
|
+
* // Use in contract
|
|
1023
|
+
* const { consumer: consumer1, binding: binding1 } = logEvent.createConsumer(logsQueue1);
|
|
1024
|
+
* const { consumer: consumer2, binding: binding2 } = logEvent.createConsumer(logsQueue2);
|
|
1025
|
+
*
|
|
1026
|
+
* const contract = defineContract({
|
|
1027
|
+
* exchanges: { logs: logsExchange },
|
|
1028
|
+
* queues: { logsQueue1, logsQueue2 },
|
|
1029
|
+
* bindings: {
|
|
1030
|
+
* logBinding1: binding1,
|
|
1031
|
+
* logBinding2: binding2,
|
|
1032
|
+
* },
|
|
1033
|
+
* publishers: { publishLog: logEvent.publisher },
|
|
1034
|
+
* consumers: {
|
|
1035
|
+
* consumeLog1: consumer1,
|
|
1036
|
+
* consumeLog2: consumer2,
|
|
1037
|
+
* },
|
|
1038
|
+
* });
|
|
1039
|
+
* ```
|
|
1040
|
+
*/
|
|
1041
|
+
declare function definePublisherFirst<TMessage extends MessageDefinition>(exchange: FanoutExchangeDefinition, message: TMessage, options?: Omit<Extract<QueueBindingDefinition, {
|
|
1042
|
+
exchange: FanoutExchangeDefinition;
|
|
1043
|
+
}>, "type" | "queue" | "exchange" | "routingKey">): PublisherFirstResult<TMessage, Extract<PublisherDefinition<TMessage>, {
|
|
1044
|
+
exchange: FanoutExchangeDefinition;
|
|
1045
|
+
}>>;
|
|
1046
|
+
/**
|
|
1047
|
+
* Define a publisher-first relationship for event-oriented messaging with direct exchange.
|
|
1048
|
+
*
|
|
1049
|
+
* This builder enforces consistency by:
|
|
1050
|
+
* 1. Ensuring the publisher and consumer use the same message schema
|
|
1051
|
+
* 2. Linking the routing key from the publisher to the binding
|
|
1052
|
+
*
|
|
1053
|
+
* Use this pattern for events where publishers don't need to know about queues.
|
|
1054
|
+
* Multiple consumers can be created for different queues, all using the same message schema.
|
|
1055
|
+
*
|
|
1056
|
+
* @param exchange - The exchange to publish to (direct type)
|
|
1057
|
+
* @param message - The message definition (schema and metadata)
|
|
1058
|
+
* @param options - Binding configuration (routingKey is required)
|
|
1059
|
+
* @param options.routingKey - The routing key for message routing
|
|
1060
|
+
* @returns A publisher-first result with publisher and consumer factory
|
|
1061
|
+
*
|
|
1062
|
+
* @example
|
|
1063
|
+
* ```typescript
|
|
1064
|
+
* import { z } from 'zod';
|
|
1065
|
+
*
|
|
1066
|
+
* const tasksExchange = defineExchange('tasks', 'direct', { durable: true });
|
|
1067
|
+
* const taskMessage = defineMessage(
|
|
1068
|
+
* z.object({
|
|
1069
|
+
* taskId: z.string(),
|
|
1070
|
+
* payload: z.record(z.unknown()),
|
|
1071
|
+
* })
|
|
1072
|
+
* );
|
|
1073
|
+
*
|
|
1074
|
+
* // Create publisher-first relationship with routing key
|
|
1075
|
+
* const taskEvent = definePublisherFirst(
|
|
1076
|
+
* tasksExchange,
|
|
1077
|
+
* taskMessage,
|
|
1078
|
+
* { routingKey: 'task.execute' }
|
|
1079
|
+
* );
|
|
1080
|
+
*
|
|
1081
|
+
* // Use in contract - routing key is consistent across publisher and bindings
|
|
1082
|
+
* const taskQueue = defineQueue('task-queue', { durable: true });
|
|
1083
|
+
* const { consumer, binding } = taskEvent.createConsumer(taskQueue);
|
|
1084
|
+
*
|
|
1085
|
+
* const contract = defineContract({
|
|
1086
|
+
* exchanges: { tasks: tasksExchange },
|
|
1087
|
+
* queues: { taskQueue },
|
|
1088
|
+
* bindings: { taskBinding: binding },
|
|
1089
|
+
* publishers: { executeTask: taskEvent.publisher },
|
|
1090
|
+
* consumers: { processTask: consumer },
|
|
1091
|
+
* });
|
|
1092
|
+
* ```
|
|
1093
|
+
*/
|
|
1094
|
+
declare function definePublisherFirst<TMessage extends MessageDefinition, TRoutingKey extends string>(exchange: DirectExchangeDefinition, message: TMessage, options: {
|
|
1095
|
+
routingKey: RoutingKey<TRoutingKey>;
|
|
1096
|
+
arguments?: Record<string, unknown>;
|
|
1097
|
+
}): PublisherFirstResult<TMessage, Extract<PublisherDefinition<TMessage>, {
|
|
1098
|
+
exchange: DirectExchangeDefinition | TopicExchangeDefinition;
|
|
1099
|
+
}>>;
|
|
1100
|
+
/**
|
|
1101
|
+
* Define a publisher-first relationship for event-oriented messaging with topic exchange.
|
|
1102
|
+
*
|
|
1103
|
+
* This builder enforces consistency by:
|
|
1104
|
+
* 1. Ensuring the publisher and consumer use the same message schema
|
|
1105
|
+
* 2. The publisher uses a concrete routing key (e.g., 'order.created')
|
|
1106
|
+
* 3. Consumers can optionally specify routing key patterns (e.g., 'order.*') or use the default
|
|
1107
|
+
*
|
|
1108
|
+
* Use this pattern for events where publishers emit with specific routing keys,
|
|
1109
|
+
* and consumers can subscribe with patterns. This is less common than the consumer-first pattern.
|
|
1110
|
+
*
|
|
1111
|
+
* @param exchange - The exchange to publish to (topic type)
|
|
1112
|
+
* @param message - The message definition (schema and metadata)
|
|
1113
|
+
* @param options - Binding configuration (routingKey is required)
|
|
1114
|
+
* @param options.routingKey - The concrete routing key for the publisher
|
|
1115
|
+
* @returns A publisher-first result with publisher and consumer factory that accepts optional routing key patterns
|
|
1116
|
+
*
|
|
1117
|
+
* @example
|
|
1118
|
+
* ```typescript
|
|
1119
|
+
* import { z } from 'zod';
|
|
1120
|
+
*
|
|
1121
|
+
* const ordersExchange = defineExchange('orders', 'topic', { durable: true });
|
|
1122
|
+
* const orderMessage = defineMessage(
|
|
1123
|
+
* z.object({
|
|
1124
|
+
* orderId: z.string(),
|
|
1125
|
+
* amount: z.number(),
|
|
1126
|
+
* })
|
|
1127
|
+
* );
|
|
1128
|
+
*
|
|
1129
|
+
* // Create publisher-first relationship with concrete routing key
|
|
1130
|
+
* const orderCreatedEvent = definePublisherFirst(
|
|
1131
|
+
* ordersExchange,
|
|
1132
|
+
* orderMessage,
|
|
1133
|
+
* { routingKey: 'order.created' } // Concrete key
|
|
1134
|
+
* );
|
|
1135
|
+
*
|
|
1136
|
+
* // Consumers can use patterns or specific keys
|
|
1137
|
+
* const orderQueue = defineQueue('order-processing', { durable: true });
|
|
1138
|
+
* const allOrdersQueue = defineQueue('all-orders', { durable: true });
|
|
1139
|
+
*
|
|
1140
|
+
* // Use in contract
|
|
1141
|
+
* const { consumer: processConsumer, binding: processBinding } =
|
|
1142
|
+
* orderCreatedEvent.createConsumer(orderQueue); // Uses 'order.created'
|
|
1143
|
+
* const { consumer: allOrdersConsumer, binding: allOrdersBinding } =
|
|
1144
|
+
* orderCreatedEvent.createConsumer(allOrdersQueue, 'order.*'); // Uses pattern
|
|
1145
|
+
*
|
|
1146
|
+
* const contract = defineContract({
|
|
1147
|
+
* exchanges: { orders: ordersExchange },
|
|
1148
|
+
* queues: { orderQueue, allOrdersQueue },
|
|
1149
|
+
* bindings: {
|
|
1150
|
+
* orderBinding: processBinding,
|
|
1151
|
+
* allOrdersBinding,
|
|
1152
|
+
* },
|
|
1153
|
+
* publishers: { orderCreated: orderCreatedEvent.publisher },
|
|
1154
|
+
* consumers: {
|
|
1155
|
+
* processOrder: processConsumer,
|
|
1156
|
+
* trackAllOrders: allOrdersConsumer,
|
|
1157
|
+
* },
|
|
1158
|
+
* });
|
|
1159
|
+
* ```
|
|
1160
|
+
*/
|
|
1161
|
+
declare function definePublisherFirst<TMessage extends MessageDefinition, TRoutingKey extends string>(exchange: TopicExchangeDefinition, message: TMessage, options: {
|
|
1162
|
+
routingKey: RoutingKey<TRoutingKey>;
|
|
1163
|
+
arguments?: Record<string, unknown>;
|
|
1164
|
+
}): PublisherFirstResultWithRoutingKey<TMessage, Extract<PublisherDefinition<TMessage>, {
|
|
1165
|
+
exchange: DirectExchangeDefinition | TopicExchangeDefinition;
|
|
1166
|
+
}>, TRoutingKey>;
|
|
1167
|
+
/**
|
|
1168
|
+
* Consumer-first builder result for fanout and direct exchanges.
|
|
1169
|
+
*
|
|
1170
|
+
* This type represents a consumer with its binding and provides a method to create
|
|
1171
|
+
* a publisher that uses the same message schema and routing key.
|
|
1172
|
+
*
|
|
1173
|
+
* @template TMessage - The message definition
|
|
1174
|
+
* @template TConsumer - The consumer definition
|
|
1175
|
+
* @template TBinding - The queue binding definition
|
|
1176
|
+
*/
|
|
1177
|
+
type ConsumerFirstResult<TMessage extends MessageDefinition, TConsumer extends ConsumerDefinition<TMessage>, TBinding extends QueueBindingDefinition> = {
|
|
1178
|
+
/** The consumer definition */
|
|
1179
|
+
consumer: TConsumer;
|
|
1180
|
+
/** The binding definition connecting the exchange to the queue */
|
|
1181
|
+
binding: TBinding;
|
|
1182
|
+
/**
|
|
1183
|
+
* Create a publisher that sends messages to this consumer.
|
|
1184
|
+
* The publisher will automatically use the same message schema and routing key.
|
|
1185
|
+
*
|
|
1186
|
+
* @returns A publisher definition with the same message type and routing key
|
|
1187
|
+
*/
|
|
1188
|
+
createPublisher: () => TBinding["exchange"] extends FanoutExchangeDefinition ? Extract<PublisherDefinition<TMessage>, {
|
|
1189
|
+
exchange: FanoutExchangeDefinition;
|
|
1190
|
+
}> : Extract<PublisherDefinition<TMessage>, {
|
|
1191
|
+
exchange: DirectExchangeDefinition | TopicExchangeDefinition;
|
|
1192
|
+
}>;
|
|
1193
|
+
};
|
|
1194
|
+
/**
|
|
1195
|
+
* Consumer-first builder result for topic exchanges.
|
|
1196
|
+
*
|
|
1197
|
+
* This type represents a consumer with its binding (which may use a pattern) and provides
|
|
1198
|
+
* a method to create a publisher with a concrete routing key that matches the pattern.
|
|
1199
|
+
*
|
|
1200
|
+
* @template TMessage - The message definition
|
|
1201
|
+
* @template TConsumer - The consumer definition
|
|
1202
|
+
* @template TBinding - The queue binding definition
|
|
1203
|
+
*/
|
|
1204
|
+
type ConsumerFirstResultWithRoutingKey<TMessage extends MessageDefinition, TConsumer extends ConsumerDefinition<TMessage>, TBinding extends QueueBindingDefinition> = {
|
|
1205
|
+
/** The consumer definition */
|
|
1206
|
+
consumer: TConsumer;
|
|
1207
|
+
/** The binding definition connecting the exchange to the queue */
|
|
1208
|
+
binding: TBinding;
|
|
1209
|
+
/**
|
|
1210
|
+
* Create a publisher that sends messages to this consumer.
|
|
1211
|
+
* For topic exchanges, the routing key can be specified to match the binding pattern.
|
|
1212
|
+
*
|
|
1213
|
+
* @param routingKey - The concrete routing key that matches the binding pattern
|
|
1214
|
+
* @returns A publisher definition with the specified routing key
|
|
1215
|
+
*/
|
|
1216
|
+
createPublisher: <TPublisherRoutingKey extends string>(routingKey: RoutingKey<TPublisherRoutingKey>) => Extract<PublisherDefinition<TMessage>, {
|
|
1217
|
+
exchange: DirectExchangeDefinition | TopicExchangeDefinition;
|
|
1218
|
+
}>;
|
|
1219
|
+
};
|
|
1220
|
+
/**
|
|
1221
|
+
* Define a consumer-first relationship between a consumer and publisher.
|
|
1222
|
+
*
|
|
1223
|
+
* This builder enforces consistency by:
|
|
1224
|
+
* 1. Ensuring the consumer and publisher use the same message schema
|
|
1225
|
+
* 2. Linking the routing key from the binding to the publisher
|
|
1226
|
+
* 3. Creating a binding that connects the exchange to the queue
|
|
1227
|
+
*
|
|
1228
|
+
* Use this when you want to start with a consumer and ensure publishers
|
|
1229
|
+
* send messages of the correct type.
|
|
1230
|
+
*
|
|
1231
|
+
* @param queue - The queue to consume from
|
|
1232
|
+
* @param exchange - The exchange that routes to the queue (fanout type)
|
|
1233
|
+
* @param message - The message definition (schema and metadata)
|
|
1234
|
+
* @param options - Optional binding configuration
|
|
1235
|
+
* @returns A consumer-first result with consumer, binding, and publisher factory
|
|
1236
|
+
*
|
|
1237
|
+
* @example
|
|
1238
|
+
* ```typescript
|
|
1239
|
+
* import { z } from 'zod';
|
|
1240
|
+
*
|
|
1241
|
+
* const notificationsQueue = defineQueue('notifications', { durable: true });
|
|
1242
|
+
* const notificationsExchange = defineExchange('notifications', 'fanout', { durable: true });
|
|
1243
|
+
* const notificationMessage = defineMessage(
|
|
1244
|
+
* z.object({
|
|
1245
|
+
* userId: z.string(),
|
|
1246
|
+
* message: z.string(),
|
|
1247
|
+
* })
|
|
1248
|
+
* );
|
|
1249
|
+
*
|
|
1250
|
+
* // Create consumer-first relationship
|
|
1251
|
+
* const notificationConsumerFirst = defineConsumerFirst(
|
|
1252
|
+
* notificationsQueue,
|
|
1253
|
+
* notificationsExchange,
|
|
1254
|
+
* notificationMessage
|
|
1255
|
+
* );
|
|
1256
|
+
*
|
|
1257
|
+
* // Use in contract
|
|
1258
|
+
* const contract = defineContract({
|
|
1259
|
+
* exchanges: { notifications: notificationsExchange },
|
|
1260
|
+
* queues: { notificationsQueue },
|
|
1261
|
+
* bindings: { notificationBinding: notificationConsumerFirst.binding },
|
|
1262
|
+
* publishers: { sendNotification: notificationConsumerFirst.createPublisher() },
|
|
1263
|
+
* consumers: { processNotification: notificationConsumerFirst.consumer },
|
|
1264
|
+
* });
|
|
1265
|
+
* ```
|
|
1266
|
+
*/
|
|
1267
|
+
declare function defineConsumerFirst<TMessage extends MessageDefinition>(queue: QueueDefinition, exchange: FanoutExchangeDefinition, message: TMessage, options?: Omit<Extract<QueueBindingDefinition, {
|
|
1268
|
+
exchange: FanoutExchangeDefinition;
|
|
1269
|
+
}>, "type" | "queue" | "exchange" | "routingKey">): ConsumerFirstResult<TMessage, ConsumerDefinition<TMessage>, Extract<QueueBindingDefinition, {
|
|
1270
|
+
exchange: FanoutExchangeDefinition;
|
|
1271
|
+
}>>;
|
|
1272
|
+
/**
|
|
1273
|
+
* Define a consumer-first relationship between a consumer and publisher.
|
|
1274
|
+
*
|
|
1275
|
+
* This builder enforces consistency by:
|
|
1276
|
+
* 1. Ensuring the consumer and publisher use the same message schema
|
|
1277
|
+
* 2. Linking the routing key from the binding to the publisher
|
|
1278
|
+
* 3. Creating a binding that connects the exchange to the queue
|
|
1279
|
+
*
|
|
1280
|
+
* Use this when you want to start with a consumer and ensure publishers
|
|
1281
|
+
* send messages with the correct type and routing key.
|
|
1282
|
+
*
|
|
1283
|
+
* @param queue - The queue to consume from
|
|
1284
|
+
* @param exchange - The exchange that routes to the queue (direct type)
|
|
1285
|
+
* @param message - The message definition (schema and metadata)
|
|
1286
|
+
* @param options - Binding configuration (routingKey is required)
|
|
1287
|
+
* @param options.routingKey - The routing key for message routing
|
|
1288
|
+
* @returns A consumer-first result with consumer, binding, and publisher factory
|
|
1289
|
+
*
|
|
1290
|
+
* @example
|
|
1291
|
+
* ```typescript
|
|
1292
|
+
* import { z } from 'zod';
|
|
1293
|
+
*
|
|
1294
|
+
* const taskQueue = defineQueue('tasks', { durable: true });
|
|
1295
|
+
* const tasksExchange = defineExchange('tasks', 'direct', { durable: true });
|
|
1296
|
+
* const taskMessage = defineMessage(
|
|
1297
|
+
* z.object({
|
|
1298
|
+
* taskId: z.string(),
|
|
1299
|
+
* payload: z.record(z.unknown()),
|
|
1300
|
+
* })
|
|
1301
|
+
* );
|
|
1302
|
+
*
|
|
1303
|
+
* // Create consumer-first relationship with routing key
|
|
1304
|
+
* const taskConsumerFirst = defineConsumerFirst(
|
|
1305
|
+
* taskQueue,
|
|
1306
|
+
* tasksExchange,
|
|
1307
|
+
* taskMessage,
|
|
1308
|
+
* { routingKey: 'task.execute' }
|
|
1309
|
+
* );
|
|
1310
|
+
*
|
|
1311
|
+
* // Use in contract - routing key is consistent across consumer and publisher
|
|
1312
|
+
* const contract = defineContract({
|
|
1313
|
+
* exchanges: { tasks: tasksExchange },
|
|
1314
|
+
* queues: { taskQueue },
|
|
1315
|
+
* bindings: { taskBinding: taskConsumerFirst.binding },
|
|
1316
|
+
* publishers: { executeTask: taskConsumerFirst.createPublisher() },
|
|
1317
|
+
* consumers: { processTask: taskConsumerFirst.consumer },
|
|
1318
|
+
* });
|
|
1319
|
+
* ```
|
|
1320
|
+
*/
|
|
1321
|
+
declare function defineConsumerFirst<TMessage extends MessageDefinition, TRoutingKey extends string>(queue: QueueDefinition, exchange: DirectExchangeDefinition, message: TMessage, options: {
|
|
1322
|
+
routingKey: RoutingKey<TRoutingKey>;
|
|
1323
|
+
arguments?: Record<string, unknown>;
|
|
1324
|
+
}): ConsumerFirstResult<TMessage, ConsumerDefinition<TMessage>, Extract<QueueBindingDefinition, {
|
|
1325
|
+
exchange: DirectExchangeDefinition;
|
|
1326
|
+
}>>;
|
|
1327
|
+
/**
|
|
1328
|
+
* Define a consumer-first relationship between a consumer and publisher with topic exchange.
|
|
1329
|
+
*
|
|
1330
|
+
* This builder enforces consistency by:
|
|
1331
|
+
* 1. Ensuring the consumer and publisher use the same message schema
|
|
1332
|
+
* 2. The binding uses a routing key pattern (e.g., 'order.*')
|
|
1333
|
+
* 3. The publisher factory accepts a concrete routing key that matches the pattern (e.g., 'order.created')
|
|
1334
|
+
*
|
|
1335
|
+
* Use this when you want to start with a consumer that uses a routing key pattern,
|
|
1336
|
+
* and allow publishers to specify concrete routing keys that match that pattern.
|
|
1337
|
+
*
|
|
1338
|
+
* @param queue - The queue to consume from
|
|
1339
|
+
* @param exchange - The exchange that routes to the queue (topic type)
|
|
1340
|
+
* @param message - The message definition (schema and metadata)
|
|
1341
|
+
* @param options - Binding configuration (routingKey is required)
|
|
1342
|
+
* @param options.routingKey - The routing key pattern for the binding (can use wildcards)
|
|
1343
|
+
* @returns A consumer-first result with consumer, binding, and publisher factory that accepts a routing key
|
|
1344
|
+
*
|
|
1345
|
+
* @example
|
|
1346
|
+
* ```typescript
|
|
1347
|
+
* import { z } from 'zod';
|
|
1348
|
+
*
|
|
1349
|
+
* const orderQueue = defineQueue('order-processing', { durable: true });
|
|
1350
|
+
* const ordersExchange = defineExchange('orders', 'topic', { durable: true });
|
|
1351
|
+
* const orderMessage = defineMessage(
|
|
1352
|
+
* z.object({
|
|
1353
|
+
* orderId: z.string(),
|
|
1354
|
+
* amount: z.number(),
|
|
1355
|
+
* })
|
|
1356
|
+
* );
|
|
1357
|
+
*
|
|
1358
|
+
* // Create consumer-first relationship with pattern
|
|
1359
|
+
* const orderConsumerFirst = defineConsumerFirst(
|
|
1360
|
+
* orderQueue,
|
|
1361
|
+
* ordersExchange,
|
|
1362
|
+
* orderMessage,
|
|
1363
|
+
* { routingKey: 'order.*' } // Pattern in binding
|
|
1364
|
+
* );
|
|
1365
|
+
*
|
|
1366
|
+
* // Use in contract - publisher can specify concrete routing key
|
|
1367
|
+
* const contract = defineContract({
|
|
1368
|
+
* exchanges: { orders: ordersExchange },
|
|
1369
|
+
* queues: { orderQueue },
|
|
1370
|
+
* bindings: { orderBinding: orderConsumerFirst.binding },
|
|
1371
|
+
* publishers: {
|
|
1372
|
+
* orderCreated: orderConsumerFirst.createPublisher('order.created'), // Concrete key
|
|
1373
|
+
* orderUpdated: orderConsumerFirst.createPublisher('order.updated'), // Concrete key
|
|
1374
|
+
* },
|
|
1375
|
+
* consumers: { processOrder: orderConsumerFirst.consumer },
|
|
1376
|
+
* });
|
|
1377
|
+
* ```
|
|
1378
|
+
*/
|
|
1379
|
+
declare function defineConsumerFirst<TMessage extends MessageDefinition, TRoutingKey extends string>(queue: QueueDefinition, exchange: TopicExchangeDefinition, message: TMessage, options: {
|
|
1380
|
+
routingKey: BindingPattern<TRoutingKey>;
|
|
1381
|
+
arguments?: Record<string, unknown>;
|
|
1382
|
+
}): ConsumerFirstResultWithRoutingKey<TMessage, ConsumerDefinition<TMessage>, Extract<QueueBindingDefinition, {
|
|
1383
|
+
exchange: TopicExchangeDefinition;
|
|
1384
|
+
}>>;
|
|
858
1385
|
//#endregion
|
|
859
|
-
export { type AnySchema, type BaseExchangeDefinition, type BindingDefinition, type ConsumerDefinition, type ContractDefinition, type DirectExchangeDefinition, type ExchangeBindingDefinition, type ExchangeDefinition, type FanoutExchangeDefinition, type InferConsumerNames, type InferPublisherNames, type MessageDefinition, type PublisherDefinition, type QueueBindingDefinition, type QueueDefinition, type TopicExchangeDefinition, defineConsumer, defineContract, defineExchange, defineExchangeBinding, defineMessage, definePublisher, defineQueue, defineQueueBinding };
|
|
1386
|
+
export { type AnySchema, type BaseExchangeDefinition, type BindingDefinition, type BindingPattern, type ConsumerDefinition, type ConsumerFirstResult, type ConsumerFirstResultWithRoutingKey, type ContractDefinition, type DirectExchangeDefinition, type ExchangeBindingDefinition, type ExchangeDefinition, type FanoutExchangeDefinition, type InferConsumerNames, type InferPublisherNames, type MatchingRoutingKey, type MessageDefinition, type PublisherDefinition, type PublisherFirstResult, type PublisherFirstResultWithRoutingKey, type QueueBindingDefinition, type QueueDefinition, type RoutingKey, type TopicExchangeDefinition, defineConsumer, defineConsumerFirst, defineContract, defineExchange, defineExchangeBinding, defineMessage, definePublisher, definePublisherFirst, defineQueue, defineQueueBinding };
|
|
860
1387
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/builder.ts"],"sourcesContent":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