@amqp-contract/contract 0.8.0 → 0.10.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/docs/index.md +73 -73
- package/package.json +1 -1
package/docs/index.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
type AnySchema = StandardSchemaV1;
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Defined in: [types.ts:12](https://github.com/btravers/amqp-contract/blob/
|
|
15
|
+
Defined in: [types.ts:12](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L12)
|
|
16
16
|
|
|
17
17
|
Any schema that conforms to Standard Schema v1.
|
|
18
18
|
|
|
@@ -32,7 +32,7 @@ https://github.com/standard-schema/standard-schema
|
|
|
32
32
|
type BaseExchangeDefinition = object;
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Defined in: [types.ts:50](https://github.com/btravers/amqp-contract/blob/
|
|
35
|
+
Defined in: [types.ts:50](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L50)
|
|
36
36
|
|
|
37
37
|
Base definition of an AMQP exchange.
|
|
38
38
|
|
|
@@ -43,11 +43,11 @@ type and routing rules. This type contains properties common to all exchange typ
|
|
|
43
43
|
|
|
44
44
|
| Property | Type | Description | Defined in |
|
|
45
45
|
| ------ | ------ | ------ | ------ |
|
|
46
|
-
| <a id="arguments"></a> `arguments?` | `Record`\<`string`, `unknown`\> | Additional AMQP arguments for advanced configuration. Common arguments include alternate-exchange for handling unroutable messages. | [types.ts:79](https://github.com/btravers/amqp-contract/blob/
|
|
47
|
-
| <a id="autodelete"></a> `autoDelete?` | `boolean` | If true, the exchange is deleted when all queues have finished using it. **Default** `false` | [types.ts:66](https://github.com/btravers/amqp-contract/blob/
|
|
48
|
-
| <a id="durable"></a> `durable?` | `boolean` | If true, the exchange survives broker restarts. Durable exchanges are persisted to disk. **Default** `false` | [types.ts:60](https://github.com/btravers/amqp-contract/blob/
|
|
49
|
-
| <a id="internal"></a> `internal?` | `boolean` | If true, the exchange cannot be directly published to by clients. It can only receive messages from other exchanges via exchange-to-exchange bindings. **Default** `false` | [types.ts:73](https://github.com/btravers/amqp-contract/blob/
|
|
50
|
-
| <a id="name"></a> `name` | `string` | The name of the exchange. Must be unique within the RabbitMQ virtual host. | [types.ts:54](https://github.com/btravers/amqp-contract/blob/
|
|
46
|
+
| <a id="arguments"></a> `arguments?` | `Record`\<`string`, `unknown`\> | Additional AMQP arguments for advanced configuration. Common arguments include alternate-exchange for handling unroutable messages. | [types.ts:79](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L79) |
|
|
47
|
+
| <a id="autodelete"></a> `autoDelete?` | `boolean` | If true, the exchange is deleted when all queues have finished using it. **Default** `false` | [types.ts:66](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L66) |
|
|
48
|
+
| <a id="durable"></a> `durable?` | `boolean` | If true, the exchange survives broker restarts. Durable exchanges are persisted to disk. **Default** `false` | [types.ts:60](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L60) |
|
|
49
|
+
| <a id="internal"></a> `internal?` | `boolean` | If true, the exchange cannot be directly published to by clients. It can only receive messages from other exchanges via exchange-to-exchange bindings. **Default** `false` | [types.ts:73](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L73) |
|
|
50
|
+
| <a id="name"></a> `name` | `string` | The name of the exchange. Must be unique within the RabbitMQ virtual host. | [types.ts:54](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L54) |
|
|
51
51
|
|
|
52
52
|
***
|
|
53
53
|
|
|
@@ -59,7 +59,7 @@ type BindingDefinition =
|
|
|
59
59
|
| ExchangeBindingDefinition;
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Defined in: [types.ts:370](https://github.com/btravers/amqp-contract/blob/
|
|
62
|
+
Defined in: [types.ts:370](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L370)
|
|
63
63
|
|
|
64
64
|
Union type of all binding definitions.
|
|
65
65
|
|
|
@@ -75,7 +75,7 @@ A binding can be either:
|
|
|
75
75
|
type BindingPattern<S> = S extends "" ? never : S;
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Defined in: [builder.ts:844](https://github.com/btravers/amqp-contract/blob/
|
|
78
|
+
Defined in: [builder.ts:844](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L844)
|
|
79
79
|
|
|
80
80
|
Type-safe binding pattern that validates basic format and wildcards.
|
|
81
81
|
|
|
@@ -110,7 +110,7 @@ type Invalid = BindingPattern<"">; // never (empty string)
|
|
|
110
110
|
type CompressionAlgorithm = "gzip" | "deflate";
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
Defined in: [types.ts:42](https://github.com/btravers/amqp-contract/blob/
|
|
113
|
+
Defined in: [types.ts:42](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L42)
|
|
114
114
|
|
|
115
115
|
Supported compression algorithms for message payloads.
|
|
116
116
|
|
|
@@ -148,7 +148,7 @@ await client.publish("orderCreated", payload, {
|
|
|
148
148
|
type ConsumerDefinition<TMessage> = object;
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
Defined in: [types.ts:431](https://github.com/btravers/amqp-contract/blob/
|
|
151
|
+
Defined in: [types.ts:431](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L431)
|
|
152
152
|
|
|
153
153
|
Definition of a message consumer.
|
|
154
154
|
|
|
@@ -176,8 +176,8 @@ const consumer: ConsumerDefinition = {
|
|
|
176
176
|
|
|
177
177
|
| Property | Type | Description | Defined in |
|
|
178
178
|
| ------ | ------ | ------ | ------ |
|
|
179
|
-
| <a id="message"></a> `message` | `TMessage` | The message definition including the payload schema | [types.ts:436](https://github.com/btravers/amqp-contract/blob/
|
|
180
|
-
| <a id="queue"></a> `queue` | [`QueueDefinition`](#queuedefinition) | The queue to consume messages from | [types.ts:433](https://github.com/btravers/amqp-contract/blob/
|
|
179
|
+
| <a id="message"></a> `message` | `TMessage` | The message definition including the payload schema | [types.ts:436](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L436) |
|
|
180
|
+
| <a id="queue"></a> `queue` | [`QueueDefinition`](#queuedefinition) | The queue to consume messages from | [types.ts:433](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L433) |
|
|
181
181
|
|
|
182
182
|
***
|
|
183
183
|
|
|
@@ -187,7 +187,7 @@ const consumer: ConsumerDefinition = {
|
|
|
187
187
|
type ConsumerFirstResult<TMessage, TConsumer, TBinding> = object;
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
Defined in: [builder.ts:1221](https://github.com/btravers/amqp-contract/blob/
|
|
190
|
+
Defined in: [builder.ts:1221](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L1221)
|
|
191
191
|
|
|
192
192
|
Consumer-first builder result for fanout and direct exchanges.
|
|
193
193
|
|
|
@@ -206,9 +206,9 @@ a publisher that uses the same message schema and routing key.
|
|
|
206
206
|
|
|
207
207
|
| Property | Type | Description | Defined in |
|
|
208
208
|
| ------ | ------ | ------ | ------ |
|
|
209
|
-
| <a id="binding"></a> `binding` | `TBinding` | The binding definition connecting the exchange to the queue | [builder.ts:1229](https://github.com/btravers/amqp-contract/blob/
|
|
210
|
-
| <a id="consumer"></a> `consumer` | `TConsumer` | The consumer definition | [builder.ts:1227](https://github.com/btravers/amqp-contract/blob/
|
|
211
|
-
| <a id="createpublisher"></a> `createPublisher` | () => `TBinding`\[`"exchange"`\] *extends* [`FanoutExchangeDefinition`](#fanoutexchangedefinition) ? `Extract`\<[`PublisherDefinition`](#publisherdefinition)\<`TMessage`\>, \{ `exchange`: [`FanoutExchangeDefinition`](#fanoutexchangedefinition); \}\> : `Extract`\<[`PublisherDefinition`](#publisherdefinition)\<`TMessage`\>, \{ `exchange`: \| [`DirectExchangeDefinition`](#directexchangedefinition) \| [`TopicExchangeDefinition`](#topicexchangedefinition); \}\> | Create a publisher that sends messages to this consumer. The publisher will automatically use the same message schema and routing key. | [builder.ts:1236](https://github.com/btravers/amqp-contract/blob/
|
|
209
|
+
| <a id="binding"></a> `binding` | `TBinding` | The binding definition connecting the exchange to the queue | [builder.ts:1229](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L1229) |
|
|
210
|
+
| <a id="consumer"></a> `consumer` | `TConsumer` | The consumer definition | [builder.ts:1227](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L1227) |
|
|
211
|
+
| <a id="createpublisher"></a> `createPublisher` | () => `TBinding`\[`"exchange"`\] *extends* [`FanoutExchangeDefinition`](#fanoutexchangedefinition) ? `Extract`\<[`PublisherDefinition`](#publisherdefinition)\<`TMessage`\>, \{ `exchange`: [`FanoutExchangeDefinition`](#fanoutexchangedefinition); \}\> : `Extract`\<[`PublisherDefinition`](#publisherdefinition)\<`TMessage`\>, \{ `exchange`: \| [`DirectExchangeDefinition`](#directexchangedefinition) \| [`TopicExchangeDefinition`](#topicexchangedefinition); \}\> | Create a publisher that sends messages to this consumer. The publisher will automatically use the same message schema and routing key. | [builder.ts:1236](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L1236) |
|
|
212
212
|
|
|
213
213
|
***
|
|
214
214
|
|
|
@@ -218,7 +218,7 @@ a publisher that uses the same message schema and routing key.
|
|
|
218
218
|
type ConsumerFirstResultWithRoutingKey<TMessage, TConsumer, TBinding> = object;
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
-
Defined in: [builder.ts:1254](https://github.com/btravers/amqp-contract/blob/
|
|
221
|
+
Defined in: [builder.ts:1254](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L1254)
|
|
222
222
|
|
|
223
223
|
Consumer-first builder result for topic exchanges.
|
|
224
224
|
|
|
@@ -237,9 +237,9 @@ a method to create a publisher with a concrete routing key that matches the patt
|
|
|
237
237
|
|
|
238
238
|
| Property | Type | Description | Defined in |
|
|
239
239
|
| ------ | ------ | ------ | ------ |
|
|
240
|
-
| <a id="binding-1"></a> `binding` | `TBinding` | The binding definition connecting the exchange to the queue | [builder.ts:1262](https://github.com/btravers/amqp-contract/blob/
|
|
241
|
-
| <a id="consumer-1"></a> `consumer` | `TConsumer` | The consumer definition | [builder.ts:1260](https://github.com/btravers/amqp-contract/blob/
|
|
242
|
-
| <a id="createpublisher-1"></a> `createPublisher` | \<`TPublisherRoutingKey`\>(`routingKey`) => `Extract`\<[`PublisherDefinition`](#publisherdefinition)\<`TMessage`\>, \{ `exchange`: \| [`DirectExchangeDefinition`](#directexchangedefinition) \| [`TopicExchangeDefinition`](#topicexchangedefinition); \}\> | Create a publisher that sends messages to this consumer. For topic exchanges, the routing key can be specified to match the binding pattern. | [builder.ts:1270](https://github.com/btravers/amqp-contract/blob/
|
|
240
|
+
| <a id="binding-1"></a> `binding` | `TBinding` | The binding definition connecting the exchange to the queue | [builder.ts:1262](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L1262) |
|
|
241
|
+
| <a id="consumer-1"></a> `consumer` | `TConsumer` | The consumer definition | [builder.ts:1260](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L1260) |
|
|
242
|
+
| <a id="createpublisher-1"></a> `createPublisher` | \<`TPublisherRoutingKey`\>(`routingKey`) => `Extract`\<[`PublisherDefinition`](#publisherdefinition)\<`TMessage`\>, \{ `exchange`: \| [`DirectExchangeDefinition`](#directexchangedefinition) \| [`TopicExchangeDefinition`](#topicexchangedefinition); \}\> | Create a publisher that sends messages to this consumer. For topic exchanges, the routing key can be specified to match the binding pattern. | [builder.ts:1270](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L1270) |
|
|
243
243
|
|
|
244
244
|
***
|
|
245
245
|
|
|
@@ -249,7 +249,7 @@ a method to create a publisher with a concrete routing key that matches the patt
|
|
|
249
249
|
type ContractDefinition = object;
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
Defined in: [types.ts:472](https://github.com/btravers/amqp-contract/blob/
|
|
252
|
+
Defined in: [types.ts:472](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L472)
|
|
253
253
|
|
|
254
254
|
Complete AMQP contract definition.
|
|
255
255
|
|
|
@@ -288,11 +288,11 @@ const contract: ContractDefinition = {
|
|
|
288
288
|
|
|
289
289
|
| Property | Type | Description | Defined in |
|
|
290
290
|
| ------ | ------ | ------ | ------ |
|
|
291
|
-
| <a id="bindings"></a> `bindings?` | `Record`\<`string`, [`BindingDefinition`](#bindingdefinition)\> | Named binding definitions. Bindings can be queue-to-exchange or exchange-to-exchange. | [types.ts:489](https://github.com/btravers/amqp-contract/blob/
|
|
292
|
-
| <a id="consumers"></a> `consumers?` | `Record`\<`string`, [`ConsumerDefinition`](#consumerdefinition)\> | Named consumer definitions. Each key requires a corresponding handler in the TypedAmqpWorker. The handler will be fully typed based on the message schema. | [types.ts:503](https://github.com/btravers/amqp-contract/blob/
|
|
293
|
-
| <a id="exchanges"></a> `exchanges?` | `Record`\<`string`, [`ExchangeDefinition`](#exchangedefinition)\> | Named exchange definitions. Each key becomes available as a named resource in the contract. | [types.ts:477](https://github.com/btravers/amqp-contract/blob/
|
|
294
|
-
| <a id="publishers"></a> `publishers?` | `Record`\<`string`, [`PublisherDefinition`](#publisherdefinition)\> | Named publisher definitions. Each key becomes a method on the TypedAmqpClient for publishing messages. The method will be fully typed based on the message schema. | [types.ts:496](https://github.com/btravers/amqp-contract/blob/
|
|
295
|
-
| <a id="queues"></a> `queues?` | `Record`\<`string`, [`QueueDefinition`](#queuedefinition)\> | Named queue definitions. Each key becomes available as a named resource in the contract. | [types.ts:483](https://github.com/btravers/amqp-contract/blob/
|
|
291
|
+
| <a id="bindings"></a> `bindings?` | `Record`\<`string`, [`BindingDefinition`](#bindingdefinition)\> | Named binding definitions. Bindings can be queue-to-exchange or exchange-to-exchange. | [types.ts:489](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L489) |
|
|
292
|
+
| <a id="consumers"></a> `consumers?` | `Record`\<`string`, [`ConsumerDefinition`](#consumerdefinition)\> | Named consumer definitions. Each key requires a corresponding handler in the TypedAmqpWorker. The handler will be fully typed based on the message schema. | [types.ts:503](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L503) |
|
|
293
|
+
| <a id="exchanges"></a> `exchanges?` | `Record`\<`string`, [`ExchangeDefinition`](#exchangedefinition)\> | Named exchange definitions. Each key becomes available as a named resource in the contract. | [types.ts:477](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L477) |
|
|
294
|
+
| <a id="publishers"></a> `publishers?` | `Record`\<`string`, [`PublisherDefinition`](#publisherdefinition)\> | Named publisher definitions. Each key becomes a method on the TypedAmqpClient for publishing messages. The method will be fully typed based on the message schema. | [types.ts:496](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L496) |
|
|
295
|
+
| <a id="queues"></a> `queues?` | `Record`\<`string`, [`QueueDefinition`](#queuedefinition)\> | Named queue definitions. Each key becomes available as a named resource in the contract. | [types.ts:483](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L483) |
|
|
296
296
|
|
|
297
297
|
***
|
|
298
298
|
|
|
@@ -302,7 +302,7 @@ const contract: ContractDefinition = {
|
|
|
302
302
|
type DeadLetterConfig = object;
|
|
303
303
|
```
|
|
304
304
|
|
|
305
|
-
Defined in: [types.ts:154](https://github.com/btravers/amqp-contract/blob/
|
|
305
|
+
Defined in: [types.ts:154](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L154)
|
|
306
306
|
|
|
307
307
|
Configuration for dead letter exchange (DLX) on a queue.
|
|
308
308
|
|
|
@@ -314,8 +314,8 @@ or storage.
|
|
|
314
314
|
|
|
315
315
|
| Property | Type | Description | Defined in |
|
|
316
316
|
| ------ | ------ | ------ | ------ |
|
|
317
|
-
| <a id="exchange"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | The exchange to send dead-lettered messages to. This exchange must be declared in the contract. | [types.ts:159](https://github.com/btravers/amqp-contract/blob/
|
|
318
|
-
| <a id="routingkey"></a> `routingKey?` | `string` | Optional routing key to use when forwarding messages to the dead letter exchange. If not specified, the original message routing key is used. | [types.ts:165](https://github.com/btravers/amqp-contract/blob/
|
|
317
|
+
| <a id="exchange"></a> `exchange` | [`ExchangeDefinition`](#exchangedefinition) | The exchange to send dead-lettered messages to. This exchange must be declared in the contract. | [types.ts:159](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L159) |
|
|
318
|
+
| <a id="routingkey"></a> `routingKey?` | `string` | Optional routing key to use when forwarding messages to the dead letter exchange. If not specified, the original message routing key is used. | [types.ts:165](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L165) |
|
|
319
319
|
|
|
320
320
|
***
|
|
321
321
|
|
|
@@ -325,7 +325,7 @@ or storage.
|
|
|
325
325
|
type DirectExchangeDefinition = BaseExchangeDefinition & object;
|
|
326
326
|
```
|
|
327
327
|
|
|
328
|
-
Defined in: [types.ts:112](https://github.com/btravers/amqp-contract/blob/
|
|
328
|
+
Defined in: [types.ts:112](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L112)
|
|
329
329
|
|
|
330
330
|
A direct exchange definition.
|
|
331
331
|
|
|
@@ -336,7 +336,7 @@ This is ideal for point-to-point messaging where each message should go to speci
|
|
|
336
336
|
|
|
337
337
|
| Name | Type | Defined in |
|
|
338
338
|
| ------ | ------ | ------ |
|
|
339
|
-
| `type` | `"direct"` | [types.ts:113](https://github.com/btravers/amqp-contract/blob/
|
|
339
|
+
| `type` | `"direct"` | [types.ts:113](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L113) |
|
|
340
340
|
|
|
341
341
|
#### Example
|
|
342
342
|
|
|
@@ -363,7 +363,7 @@ type ExchangeBindingDefinition = object &
|
|
|
363
363
|
};
|
|
364
364
|
```
|
|
365
365
|
|
|
366
|
-
Defined in: [types.ts:334](https://github.com/btravers/amqp-contract/blob/
|
|
366
|
+
Defined in: [types.ts:334](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L334)
|
|
367
367
|
|
|
368
368
|
Binding between two exchanges (exchange-to-exchange routing).
|
|
369
369
|
|
|
@@ -374,9 +374,9 @@ This allows for more complex routing topologies.
|
|
|
374
374
|
|
|
375
375
|
| Name | Type | Description | Defined in |
|
|
376
376
|
| ------ | ------ | ------ | ------ |
|
|
377
|
-
| `arguments?` | `Record`\<`string`, `unknown`\> | Additional AMQP arguments for the binding. | [types.ts:344](https://github.com/btravers/amqp-contract/blob/
|
|
378
|
-
| `destination` | [`ExchangeDefinition`](#exchangedefinition) | The destination exchange that will receive forwarded messages | [types.ts:339](https://github.com/btravers/amqp-contract/blob/
|
|
379
|
-
| `type` | `"exchange"` | Discriminator indicating this is an exchange-to-exchange binding | [types.ts:336](https://github.com/btravers/amqp-contract/blob/
|
|
377
|
+
| `arguments?` | `Record`\<`string`, `unknown`\> | Additional AMQP arguments for the binding. | [types.ts:344](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L344) |
|
|
378
|
+
| `destination` | [`ExchangeDefinition`](#exchangedefinition) | The destination exchange that will receive forwarded messages | [types.ts:339](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L339) |
|
|
379
|
+
| `type` | `"exchange"` | Discriminator indicating this is an exchange-to-exchange binding | [types.ts:336](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L336) |
|
|
380
380
|
|
|
381
381
|
#### Example
|
|
382
382
|
|
|
@@ -401,7 +401,7 @@ type ExchangeDefinition =
|
|
|
401
401
|
| TopicExchangeDefinition;
|
|
402
402
|
```
|
|
403
403
|
|
|
404
|
-
Defined in: [types.ts:142](https://github.com/btravers/amqp-contract/blob/
|
|
404
|
+
Defined in: [types.ts:142](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L142)
|
|
405
405
|
|
|
406
406
|
Union type of all exchange definitions.
|
|
407
407
|
|
|
@@ -415,7 +415,7 @@ Represents any type of AMQP exchange: fanout, direct, or topic.
|
|
|
415
415
|
type FanoutExchangeDefinition = BaseExchangeDefinition & object;
|
|
416
416
|
```
|
|
417
417
|
|
|
418
|
-
Defined in: [types.ts:95](https://github.com/btravers/amqp-contract/blob/
|
|
418
|
+
Defined in: [types.ts:95](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L95)
|
|
419
419
|
|
|
420
420
|
A fanout exchange definition.
|
|
421
421
|
|
|
@@ -426,7 +426,7 @@ This is the simplest exchange type for pub/sub messaging patterns.
|
|
|
426
426
|
|
|
427
427
|
| Name | Type | Defined in |
|
|
428
428
|
| ------ | ------ | ------ |
|
|
429
|
-
| `type` | `"fanout"` | [types.ts:96](https://github.com/btravers/amqp-contract/blob/
|
|
429
|
+
| `type` | `"fanout"` | [types.ts:96](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L96) |
|
|
430
430
|
|
|
431
431
|
#### Example
|
|
432
432
|
|
|
@@ -444,7 +444,7 @@ const logsExchange: FanoutExchangeDefinition = defineExchange('logs', 'fanout',
|
|
|
444
444
|
type InferConsumerNames<TContract> = TContract["consumers"] extends Record<string, unknown> ? keyof TContract["consumers"] : never;
|
|
445
445
|
```
|
|
446
446
|
|
|
447
|
-
Defined in: [types.ts:539](https://github.com/btravers/amqp-contract/blob/
|
|
447
|
+
Defined in: [types.ts:539](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L539)
|
|
448
448
|
|
|
449
449
|
Extract consumer names from a contract.
|
|
450
450
|
|
|
@@ -476,7 +476,7 @@ type ConsumerNames = InferConsumerNames<typeof myContract>;
|
|
|
476
476
|
type InferPublisherNames<TContract> = TContract["publishers"] extends Record<string, unknown> ? keyof TContract["publishers"] : never;
|
|
477
477
|
```
|
|
478
478
|
|
|
479
|
-
Defined in: [types.ts:521](https://github.com/btravers/amqp-contract/blob/
|
|
479
|
+
Defined in: [types.ts:521](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L521)
|
|
480
480
|
|
|
481
481
|
Extract publisher names from a contract.
|
|
482
482
|
|
|
@@ -508,7 +508,7 @@ type PublisherNames = InferPublisherNames<typeof myContract>;
|
|
|
508
508
|
type MatchingRoutingKey<Pattern, Key> = RoutingKey<Key> extends never ? never : BindingPattern<Pattern> extends never ? never : MatchesPattern<Key, Pattern> extends true ? Key : never;
|
|
509
509
|
```
|
|
510
510
|
|
|
511
|
-
Defined in: [builder.ts:906](https://github.com/btravers/amqp-contract/blob/
|
|
511
|
+
Defined in: [builder.ts:906](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L906)
|
|
512
512
|
|
|
513
513
|
Validate that a routing key matches a binding pattern.
|
|
514
514
|
|
|
@@ -540,7 +540,7 @@ type InvalidKey = MatchingRoutingKey<"order.*", "user.created">; // never
|
|
|
540
540
|
type MessageDefinition<TPayload, THeaders> = object;
|
|
541
541
|
```
|
|
542
542
|
|
|
543
|
-
Defined in: [types.ts:250](https://github.com/btravers/amqp-contract/blob/
|
|
543
|
+
Defined in: [types.ts:250](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L250)
|
|
544
544
|
|
|
545
545
|
Definition of a message with typed payload and optional headers.
|
|
546
546
|
|
|
@@ -555,10 +555,10 @@ Definition of a message with typed payload and optional headers.
|
|
|
555
555
|
|
|
556
556
|
| Property | Type | Description | Defined in |
|
|
557
557
|
| ------ | ------ | ------ | ------ |
|
|
558
|
-
| <a id="description"></a> `description?` | `string` | Detailed description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:276](https://github.com/btravers/amqp-contract/blob/
|
|
559
|
-
| <a id="headers"></a> `headers?` | `THeaders` | Optional headers schema for validating message metadata. Must be a Standard Schema v1 compatible schema. | [types.ts:264](https://github.com/btravers/amqp-contract/blob/
|
|
560
|
-
| <a id="payload"></a> `payload` | `TPayload` | The payload schema for validating message content. Must be a Standard Schema v1 compatible schema (Zod, Valibot, ArkType, etc.). | [types.ts:258](https://github.com/btravers/amqp-contract/blob/
|
|
561
|
-
| <a id="summary"></a> `summary?` | `string` | Brief description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:270](https://github.com/btravers/amqp-contract/blob/
|
|
558
|
+
| <a id="description"></a> `description?` | `string` | Detailed description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:276](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L276) |
|
|
559
|
+
| <a id="headers"></a> `headers?` | `THeaders` | Optional headers schema for validating message metadata. Must be a Standard Schema v1 compatible schema. | [types.ts:264](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L264) |
|
|
560
|
+
| <a id="payload"></a> `payload` | `TPayload` | The payload schema for validating message content. Must be a Standard Schema v1 compatible schema (Zod, Valibot, ArkType, etc.). | [types.ts:258](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L258) |
|
|
561
|
+
| <a id="summary"></a> `summary?` | `string` | Brief description of the message for documentation purposes. Used in AsyncAPI specification generation. | [types.ts:270](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L270) |
|
|
562
562
|
|
|
563
563
|
***
|
|
564
564
|
|
|
@@ -577,7 +577,7 @@ type PublisherDefinition<TMessage> = object &
|
|
|
577
577
|
};
|
|
578
578
|
```
|
|
579
579
|
|
|
580
|
-
Defined in: [types.ts:392](https://github.com/btravers/amqp-contract/blob/
|
|
580
|
+
Defined in: [types.ts:392](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L392)
|
|
581
581
|
|
|
582
582
|
Definition of a message publisher.
|
|
583
583
|
|
|
@@ -591,7 +591,7 @@ algorithm when calling the publish method.
|
|
|
591
591
|
|
|
592
592
|
| Name | Type | Description | Defined in |
|
|
593
593
|
| ------ | ------ | ------ | ------ |
|
|
594
|
-
| `message` | `TMessage` | The message definition including the payload schema | [types.ts:394](https://github.com/btravers/amqp-contract/blob/
|
|
594
|
+
| `message` | `TMessage` | The message definition including the payload schema | [types.ts:394](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L394) |
|
|
595
595
|
|
|
596
596
|
#### Type Parameters
|
|
597
597
|
|
|
@@ -617,7 +617,7 @@ const publisher: PublisherDefinition = {
|
|
|
617
617
|
type PublisherFirstResult<TMessage, TPublisher> = object;
|
|
618
618
|
```
|
|
619
619
|
|
|
620
|
-
Defined in: [builder.ts:773](https://github.com/btravers/amqp-contract/blob/
|
|
620
|
+
Defined in: [builder.ts:773](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L773)
|
|
621
621
|
|
|
622
622
|
Publisher-first builder result for fanout and direct exchanges.
|
|
623
623
|
|
|
@@ -638,8 +638,8 @@ emit events without knowing which queues will consume them.
|
|
|
638
638
|
|
|
639
639
|
| Property | Type | Description | Defined in |
|
|
640
640
|
| ------ | ------ | ------ | ------ |
|
|
641
|
-
| <a id="createconsumer"></a> `createConsumer` | (`queue`) => `object` | Create a consumer that receives messages from this publisher. The consumer will automatically use the same message schema and a binding will be created with the same routing key. | [builder.ts:787](https://github.com/btravers/amqp-contract/blob/
|
|
642
|
-
| <a id="publisher"></a> `publisher` | `TPublisher` | The publisher definition | [builder.ts:778](https://github.com/btravers/amqp-contract/blob/
|
|
641
|
+
| <a id="createconsumer"></a> `createConsumer` | (`queue`) => `object` | Create a consumer that receives messages from this publisher. The consumer will automatically use the same message schema and a binding will be created with the same routing key. | [builder.ts:787](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L787) |
|
|
642
|
+
| <a id="publisher"></a> `publisher` | `TPublisher` | The publisher definition | [builder.ts:778](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L778) |
|
|
643
643
|
|
|
644
644
|
***
|
|
645
645
|
|
|
@@ -649,7 +649,7 @@ emit events without knowing which queues will consume them.
|
|
|
649
649
|
type PublisherFirstResultWithRoutingKey<TMessage, TPublisher, TRoutingKey> = object;
|
|
650
650
|
```
|
|
651
651
|
|
|
652
|
-
Defined in: [builder.ts:925](https://github.com/btravers/amqp-contract/blob/
|
|
652
|
+
Defined in: [builder.ts:925](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L925)
|
|
653
653
|
|
|
654
654
|
Publisher-first builder result for topic exchanges.
|
|
655
655
|
|
|
@@ -668,8 +668,8 @@ to create consumers that can use routing key patterns matching the publisher's k
|
|
|
668
668
|
|
|
669
669
|
| Property | Type | Description | Defined in |
|
|
670
670
|
| ------ | ------ | ------ | ------ |
|
|
671
|
-
| <a id="createconsumer-1"></a> `createConsumer` | \<`TConsumerRoutingKey`\>(`queue`, `routingKey?`) => `object` | Create a consumer that receives messages from this publisher. For topic exchanges, the routing key pattern can be specified for the binding. | [builder.ts:940](https://github.com/btravers/amqp-contract/blob/
|
|
672
|
-
| <a id="publisher-1"></a> `publisher` | `TPublisher` | The publisher definition | [builder.ts:931](https://github.com/btravers/amqp-contract/blob/
|
|
671
|
+
| <a id="createconsumer-1"></a> `createConsumer` | \<`TConsumerRoutingKey`\>(`queue`, `routingKey?`) => `object` | Create a consumer that receives messages from this publisher. For topic exchanges, the routing key pattern can be specified for the binding. | [builder.ts:940](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L940) |
|
|
672
|
+
| <a id="publisher-1"></a> `publisher` | `TPublisher` | The publisher definition | [builder.ts:931](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L931) |
|
|
673
673
|
|
|
674
674
|
***
|
|
675
675
|
|
|
@@ -688,7 +688,7 @@ type QueueBindingDefinition = object &
|
|
|
688
688
|
};
|
|
689
689
|
```
|
|
690
690
|
|
|
691
|
-
Defined in: [types.ts:286](https://github.com/btravers/amqp-contract/blob/
|
|
691
|
+
Defined in: [types.ts:286](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L286)
|
|
692
692
|
|
|
693
693
|
Binding between a queue and an exchange.
|
|
694
694
|
|
|
@@ -700,9 +700,9 @@ For fanout exchanges, no routing key is needed as all messages are broadcast.
|
|
|
700
700
|
|
|
701
701
|
| Name | Type | Description | Defined in |
|
|
702
702
|
| ------ | ------ | ------ | ------ |
|
|
703
|
-
| `arguments?` | `Record`\<`string`, `unknown`\> | Additional AMQP arguments for the binding. Can be used for advanced routing scenarios with the headers exchange type. | [types.ts:297](https://github.com/btravers/amqp-contract/blob/
|
|
704
|
-
| `queue` | [`QueueDefinition`](#queuedefinition) | The queue that will receive messages | [types.ts:291](https://github.com/btravers/amqp-contract/blob/
|
|
705
|
-
| `type` | `"queue"` | Discriminator indicating this is a queue-to-exchange binding | [types.ts:288](https://github.com/btravers/amqp-contract/blob/
|
|
703
|
+
| `arguments?` | `Record`\<`string`, `unknown`\> | Additional AMQP arguments for the binding. Can be used for advanced routing scenarios with the headers exchange type. | [types.ts:297](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L297) |
|
|
704
|
+
| `queue` | [`QueueDefinition`](#queuedefinition) | The queue that will receive messages | [types.ts:291](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L291) |
|
|
705
|
+
| `type` | `"queue"` | Discriminator indicating this is a queue-to-exchange binding | [types.ts:288](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L288) |
|
|
706
706
|
|
|
707
707
|
***
|
|
708
708
|
|
|
@@ -712,7 +712,7 @@ For fanout exchanges, no routing key is needed as all messages are broadcast.
|
|
|
712
712
|
type QueueDefinition = object;
|
|
713
713
|
```
|
|
714
714
|
|
|
715
|
-
Defined in: [types.ts:174](https://github.com/btravers/amqp-contract/blob/
|
|
715
|
+
Defined in: [types.ts:174](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L174)
|
|
716
716
|
|
|
717
717
|
Definition of an AMQP queue.
|
|
718
718
|
|
|
@@ -723,12 +723,12 @@ to receive messages based on routing rules.
|
|
|
723
723
|
|
|
724
724
|
| Property | Type | Description | Defined in |
|
|
725
725
|
| ------ | ------ | ------ | ------ |
|
|
726
|
-
| <a id="arguments-1"></a> `arguments?` | `Record`\<`string`, `unknown`\> | Additional AMQP arguments for advanced configuration. Common arguments include: - `x-message-ttl`: Message time-to-live in milliseconds - `x-expires`: Queue expiration time in milliseconds - `x-max-length`: Maximum number of messages in the queue - `x-max-length-bytes`: Maximum size of the queue in bytes - `x-max-priority`: Maximum priority level for priority queues Note: When using the `deadLetter` property, the `x-dead-letter-exchange` and `x-dead-letter-routing-key` arguments are automatically set and should not be specified in this arguments object. **Example** `{ 'x-message-ttl': 86400000, // 24 hours 'x-max-priority': 10 }` | [types.ts:241](https://github.com/btravers/amqp-contract/blob/
|
|
727
|
-
| <a id="autodelete-1"></a> `autoDelete?` | `boolean` | If true, the queue is deleted when the last consumer unsubscribes. **Default** `false` | [types.ts:197](https://github.com/btravers/amqp-contract/blob/
|
|
728
|
-
| <a id="deadletter"></a> `deadLetter?` | [`DeadLetterConfig`](#deadletterconfig) | Dead letter configuration for handling failed or rejected messages. When configured, messages that are rejected, expire, or exceed queue limits will be automatically forwarded to the specified dead letter exchange. **Example** `const dlx = defineExchange('orders-dlx', 'topic', { durable: true }); const queue = defineQueue('order-processing', { durable: true, deadLetter: { exchange: dlx, routingKey: 'order.failed' } });` | [types.ts:217](https://github.com/btravers/amqp-contract/blob/
|
|
729
|
-
| <a id="durable-1"></a> `durable?` | `boolean` | If true, the queue survives broker restarts. Durable queues are persisted to disk. **Default** `false` | [types.ts:184](https://github.com/btravers/amqp-contract/blob/
|
|
730
|
-
| <a id="exclusive"></a> `exclusive?` | `boolean` | If true, the queue can only be used by the declaring connection and is deleted when that connection closes. Exclusive queues are private to the connection. **Default** `false` | [types.ts:191](https://github.com/btravers/amqp-contract/blob/
|
|
731
|
-
| <a id="name-1"></a> `name` | `string` | The name of the queue. Must be unique within the RabbitMQ virtual host. | [types.ts:178](https://github.com/btravers/amqp-contract/blob/
|
|
726
|
+
| <a id="arguments-1"></a> `arguments?` | `Record`\<`string`, `unknown`\> | Additional AMQP arguments for advanced configuration. Common arguments include: - `x-message-ttl`: Message time-to-live in milliseconds - `x-expires`: Queue expiration time in milliseconds - `x-max-length`: Maximum number of messages in the queue - `x-max-length-bytes`: Maximum size of the queue in bytes - `x-max-priority`: Maximum priority level for priority queues Note: When using the `deadLetter` property, the `x-dead-letter-exchange` and `x-dead-letter-routing-key` arguments are automatically set and should not be specified in this arguments object. **Example** `{ 'x-message-ttl': 86400000, // 24 hours 'x-max-priority': 10 }` | [types.ts:241](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L241) |
|
|
727
|
+
| <a id="autodelete-1"></a> `autoDelete?` | `boolean` | If true, the queue is deleted when the last consumer unsubscribes. **Default** `false` | [types.ts:197](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L197) |
|
|
728
|
+
| <a id="deadletter"></a> `deadLetter?` | [`DeadLetterConfig`](#deadletterconfig) | Dead letter configuration for handling failed or rejected messages. When configured, messages that are rejected, expire, or exceed queue limits will be automatically forwarded to the specified dead letter exchange. **Example** `const dlx = defineExchange('orders-dlx', 'topic', { durable: true }); const queue = defineQueue('order-processing', { durable: true, deadLetter: { exchange: dlx, routingKey: 'order.failed' } });` | [types.ts:217](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L217) |
|
|
729
|
+
| <a id="durable-1"></a> `durable?` | `boolean` | If true, the queue survives broker restarts. Durable queues are persisted to disk. **Default** `false` | [types.ts:184](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L184) |
|
|
730
|
+
| <a id="exclusive"></a> `exclusive?` | `boolean` | If true, the queue can only be used by the declaring connection and is deleted when that connection closes. Exclusive queues are private to the connection. **Default** `false` | [types.ts:191](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L191) |
|
|
731
|
+
| <a id="name-1"></a> `name` | `string` | The name of the queue. Must be unique within the RabbitMQ virtual host. | [types.ts:178](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L178) |
|
|
732
732
|
|
|
733
733
|
***
|
|
734
734
|
|
|
@@ -738,7 +738,7 @@ to receive messages based on routing rules.
|
|
|
738
738
|
type RoutingKey<S> = S extends "" ? never : S extends `${string}*${string}` | `${string}#${string}` ? never : S;
|
|
739
739
|
```
|
|
740
740
|
|
|
741
|
-
Defined in: [builder.ts:817](https://github.com/btravers/amqp-contract/blob/
|
|
741
|
+
Defined in: [builder.ts:817](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L817)
|
|
742
742
|
|
|
743
743
|
Type-safe routing key that validates basic format.
|
|
744
744
|
|
|
@@ -772,7 +772,7 @@ type Invalid2 = RoutingKey<"">; // never (empty string)
|
|
|
772
772
|
type TopicExchangeDefinition = BaseExchangeDefinition & object;
|
|
773
773
|
```
|
|
774
774
|
|
|
775
|
-
Defined in: [types.ts:133](https://github.com/btravers/amqp-contract/blob/
|
|
775
|
+
Defined in: [types.ts:133](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L133)
|
|
776
776
|
|
|
777
777
|
A topic exchange definition.
|
|
778
778
|
|
|
@@ -786,7 +786,7 @@ Words are separated by dots (e.g., `order.created.high-value`).
|
|
|
786
786
|
|
|
787
787
|
| Name | Type | Defined in |
|
|
788
788
|
| ------ | ------ | ------ |
|
|
789
|
-
| `type` | `"topic"` | [types.ts:134](https://github.com/btravers/amqp-contract/blob/
|
|
789
|
+
| `type` | `"topic"` | [types.ts:134](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/types.ts#L134) |
|
|
790
790
|
|
|
791
791
|
#### Example
|
|
792
792
|
|
|
@@ -808,7 +808,7 @@ function defineConsumer<TMessage>(
|
|
|
808
808
|
options?): ConsumerDefinition<TMessage>;
|
|
809
809
|
```
|
|
810
810
|
|
|
811
|
-
Defined in: [builder.ts:634](https://github.com/btravers/amqp-contract/blob/
|
|
811
|
+
Defined in: [builder.ts:634](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L634)
|
|
812
812
|
|
|
813
813
|
Define a message consumer.
|
|
814
814
|
|
|
@@ -875,7 +875,7 @@ const processOrderConsumer = defineConsumer(orderQueue, orderMessage);
|
|
|
875
875
|
function defineContract<TContract>(definition): TContract;
|
|
876
876
|
```
|
|
877
877
|
|
|
878
|
-
Defined in: [builder.ts:715](https://github.com/btravers/amqp-contract/blob/
|
|
878
|
+
Defined in: [builder.ts:715](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L715)
|
|
879
879
|
|
|
880
880
|
Define an AMQP contract.
|
|
881
881
|
|
|
@@ -964,7 +964,7 @@ export const contract = defineContract({
|
|
|
964
964
|
function defineMessage<TPayload, THeaders>(payload, options?): MessageDefinition<TPayload, THeaders>;
|
|
965
965
|
```
|
|
966
966
|
|
|
967
|
-
Defined in: [builder.ts:236](https://github.com/btravers/amqp-contract/blob/
|
|
967
|
+
Defined in: [builder.ts:236](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L236)
|
|
968
968
|
|
|
969
969
|
Define a message definition with payload and optional headers/metadata.
|
|
970
970
|
|
|
@@ -1025,7 +1025,7 @@ const orderMessage = defineMessage(
|
|
|
1025
1025
|
function defineQueue(name, options?): QueueDefinition;
|
|
1026
1026
|
```
|
|
1027
1027
|
|
|
1028
|
-
Defined in: [builder.ts:170](https://github.com/btravers/amqp-contract/blob/
|
|
1028
|
+
Defined in: [builder.ts:170](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/contract/src/builder.ts#L170)
|
|
1029
1029
|
|
|
1030
1030
|
Define an AMQP queue.
|
|
1031
1031
|
|