@amqp-contract/client 0.12.0 → 0.13.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 +17 -17
- package/package.json +4 -4
package/docs/index.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
### MessageValidationError
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/client/src/errors.ts:4](https://github.com/btravers/amqp-contract/blob/
|
|
11
|
+
Defined in: [packages/client/src/errors.ts:4](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/errors.ts#L4)
|
|
12
12
|
|
|
13
13
|
Error thrown when message validation fails
|
|
14
14
|
|
|
@@ -24,7 +24,7 @@ Error thrown when message validation fails
|
|
|
24
24
|
new MessageValidationError(publisherName, issues): MessageValidationError;
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Defined in: [packages/client/src/errors.ts:5](https://github.com/btravers/amqp-contract/blob/
|
|
27
|
+
Defined in: [packages/client/src/errors.ts:5](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/errors.ts#L5)
|
|
28
28
|
|
|
29
29
|
###### Parameters
|
|
30
30
|
|
|
@@ -48,10 +48,10 @@ Error.constructor
|
|
|
48
48
|
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
49
49
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
50
50
|
| <a id="cause"></a> `cause?` | `public` | `unknown` | - | `Error.cause` | node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:26 |
|
|
51
|
-
| <a id="issues"></a> `issues` | `readonly` | `unknown` | - | - | [packages/client/src/errors.ts:7](https://github.com/btravers/amqp-contract/blob/
|
|
51
|
+
| <a id="issues"></a> `issues` | `readonly` | `unknown` | - | - | [packages/client/src/errors.ts:7](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/errors.ts#L7) |
|
|
52
52
|
| <a id="message"></a> `message` | `public` | `string` | - | `Error.message` | node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1077 |
|
|
53
53
|
| <a id="name"></a> `name` | `public` | `string` | - | `Error.name` | node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 |
|
|
54
|
-
| <a id="publishername"></a> `publisherName` | `readonly` | `string` | - | - | [packages/client/src/errors.ts:6](https://github.com/btravers/amqp-contract/blob/
|
|
54
|
+
| <a id="publishername"></a> `publisherName` | `readonly` | `string` | - | - | [packages/client/src/errors.ts:6](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/errors.ts#L6) |
|
|
55
55
|
| <a id="stack"></a> `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1078 |
|
|
56
56
|
| <a id="stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | node\_modules/.pnpm/@types+node@25.0.9/node\_modules/@types/node/globals.d.ts:67 |
|
|
57
57
|
|
|
@@ -159,7 +159,7 @@ Error.prepareStackTrace
|
|
|
159
159
|
|
|
160
160
|
### TypedAmqpClient
|
|
161
161
|
|
|
162
|
-
Defined in: [packages/client/src/client.ts:55](https://github.com/btravers/amqp-contract/blob/
|
|
162
|
+
Defined in: [packages/client/src/client.ts:55](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L55)
|
|
163
163
|
|
|
164
164
|
Type-safe AMQP client for publishing messages
|
|
165
165
|
|
|
@@ -177,7 +177,7 @@ Type-safe AMQP client for publishing messages
|
|
|
177
177
|
close(): Future<Result<void, TechnicalError>>;
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
Defined in: [packages/client/src/client.ts:202](https://github.com/btravers/amqp-contract/blob/
|
|
180
|
+
Defined in: [packages/client/src/client.ts:202](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L202)
|
|
181
181
|
|
|
182
182
|
Close the channel and connection
|
|
183
183
|
|
|
@@ -194,7 +194,7 @@ publish<TName>(
|
|
|
194
194
|
options?): Future<Result<void, TechnicalError | MessageValidationError>>;
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
-
Defined in: [packages/client/src/client.ts:108](https://github.com/btravers/amqp-contract/blob/
|
|
197
|
+
Defined in: [packages/client/src/client.ts:108](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L108)
|
|
198
198
|
|
|
199
199
|
Publish a message using a defined publisher.
|
|
200
200
|
TypeScript guarantees publisher exists for valid publisher names.
|
|
@@ -223,7 +223,7 @@ TypeScript guarantees publisher exists for valid publisher names.
|
|
|
223
223
|
static create<TContract>(__namedParameters): Future<Result<TypedAmqpClient<TContract>, TechnicalError>>;
|
|
224
224
|
```
|
|
225
225
|
|
|
226
|
-
Defined in: [packages/client/src/client.ts:73](https://github.com/btravers/amqp-contract/blob/
|
|
226
|
+
Defined in: [packages/client/src/client.ts:73](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L73)
|
|
227
227
|
|
|
228
228
|
Create a type-safe AMQP client from a contract.
|
|
229
229
|
|
|
@@ -258,7 +258,7 @@ connection options, following RabbitMQ best practices.
|
|
|
258
258
|
type ClientInferPublisherInput<TContract, TName> = PublisherInferInput<InferPublisher<TContract, TName>>;
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
-
Defined in: [packages/client/src/types.ts:37](https://github.com/btravers/amqp-contract/blob/
|
|
261
|
+
Defined in: [packages/client/src/types.ts:37](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/types.ts#L37)
|
|
262
262
|
|
|
263
263
|
Infer publisher input type (message payload) for a specific publisher in a contract
|
|
264
264
|
|
|
@@ -277,7 +277,7 @@ Infer publisher input type (message payload) for a specific publisher in a contr
|
|
|
277
277
|
type CreateClientOptions<TContract> = object;
|
|
278
278
|
```
|
|
279
279
|
|
|
280
|
-
Defined in: [packages/client/src/client.ts:39](https://github.com/btravers/amqp-contract/blob/
|
|
280
|
+
Defined in: [packages/client/src/client.ts:39](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L39)
|
|
281
281
|
|
|
282
282
|
Options for creating a client
|
|
283
283
|
|
|
@@ -291,11 +291,11 @@ Options for creating a client
|
|
|
291
291
|
|
|
292
292
|
| Property | Type | Description | Defined in |
|
|
293
293
|
| ------ | ------ | ------ | ------ |
|
|
294
|
-
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | - | [packages/client/src/client.ts:42](https://github.com/btravers/amqp-contract/blob/
|
|
295
|
-
| <a id="contract"></a> `contract` | `TContract` | - | [packages/client/src/client.ts:40](https://github.com/btravers/amqp-contract/blob/
|
|
296
|
-
| <a id="logger"></a> `logger?` | `Logger` | - | [packages/client/src/client.ts:43](https://github.com/btravers/amqp-contract/blob/
|
|
297
|
-
| <a id="telemetry"></a> `telemetry?` | `TelemetryProvider` | Optional telemetry provider for tracing and metrics. If not provided, uses the default provider which attempts to load OpenTelemetry. OpenTelemetry instrumentation is automatically enabled if @opentelemetry/api is installed. | [packages/client/src/client.ts:49](https://github.com/btravers/amqp-contract/blob/
|
|
298
|
-
| <a id="urls"></a> `urls` | `ConnectionUrl`[] | - | [packages/client/src/client.ts:41](https://github.com/btravers/amqp-contract/blob/
|
|
294
|
+
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | - | [packages/client/src/client.ts:42](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L42) |
|
|
295
|
+
| <a id="contract"></a> `contract` | `TContract` | - | [packages/client/src/client.ts:40](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L40) |
|
|
296
|
+
| <a id="logger"></a> `logger?` | `Logger` | - | [packages/client/src/client.ts:43](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L43) |
|
|
297
|
+
| <a id="telemetry"></a> `telemetry?` | `TelemetryProvider` | Optional telemetry provider for tracing and metrics. If not provided, uses the default provider which attempts to load OpenTelemetry. OpenTelemetry instrumentation is automatically enabled if @opentelemetry/api is installed. | [packages/client/src/client.ts:49](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L49) |
|
|
298
|
+
| <a id="urls"></a> `urls` | `ConnectionUrl`[] | - | [packages/client/src/client.ts:41](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L41) |
|
|
299
299
|
|
|
300
300
|
***
|
|
301
301
|
|
|
@@ -305,7 +305,7 @@ Options for creating a client
|
|
|
305
305
|
type PublishOptions = Options.Publish & object;
|
|
306
306
|
```
|
|
307
307
|
|
|
308
|
-
Defined in: [packages/client/src/client.ts:27](https://github.com/btravers/amqp-contract/blob/
|
|
308
|
+
Defined in: [packages/client/src/client.ts:27](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L27)
|
|
309
309
|
|
|
310
310
|
Publish options that extend amqplib's Options.Publish with optional compression support.
|
|
311
311
|
|
|
@@ -313,4 +313,4 @@ Publish options that extend amqplib's Options.Publish with optional compression
|
|
|
313
313
|
|
|
314
314
|
| Name | Type | Description | Defined in |
|
|
315
315
|
| ------ | ------ | ------ | ------ |
|
|
316
|
-
| `compression?` | `CompressionAlgorithm` | Optional compression algorithm to use for the message payload. When specified, the message will be compressed using the chosen algorithm and the contentEncoding header will be set automatically. | [packages/client/src/client.ts:33](https://github.com/btravers/amqp-contract/blob/
|
|
316
|
+
| `compression?` | `CompressionAlgorithm` | Optional compression algorithm to use for the message payload. When specified, the message will be compressed using the chosen algorithm and the contentEncoding header will be set automatically. | [packages/client/src/client.ts:33](https://github.com/btravers/amqp-contract/blob/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L33) |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amqp-contract/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Client utilities for publishing messages using amqp-contract",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"amqp",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@standard-schema/spec": "1.1.0",
|
|
54
54
|
"@swan-io/boxed": "3.2.1",
|
|
55
55
|
"ts-pattern": "5.9.0",
|
|
56
|
-
"@amqp-contract/contract": "0.
|
|
57
|
-
"@amqp-contract/core": "0.
|
|
56
|
+
"@amqp-contract/contract": "0.13.0",
|
|
57
|
+
"@amqp-contract/core": "0.13.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/amqplib": "0.10.8",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"typescript": "5.9.3",
|
|
69
69
|
"vitest": "4.0.17",
|
|
70
70
|
"zod": "4.3.5",
|
|
71
|
-
"@amqp-contract/testing": "0.
|
|
71
|
+
"@amqp-contract/testing": "0.13.0",
|
|
72
72
|
"@amqp-contract/tsconfig": "0.1.0",
|
|
73
73
|
"@amqp-contract/typedoc": "0.1.0"
|
|
74
74
|
},
|