@amqp-contract/client 0.9.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 +20 -20
- 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:35](https://github.com/btravers/amqp-contract/blob/
|
|
11
|
+
Defined in: [packages/client/src/errors.ts:35](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/errors.ts#L35)
|
|
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:36](https://github.com/btravers/amqp-contract/blob/
|
|
27
|
+
Defined in: [packages/client/src/errors.ts:36](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/errors.ts#L36)
|
|
28
28
|
|
|
29
29
|
###### Parameters
|
|
30
30
|
|
|
@@ -48,10 +48,10 @@ ClientError.constructor
|
|
|
48
48
|
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
49
49
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
50
50
|
| <a id="cause"></a> `cause?` | `public` | `unknown` | - | `ClientError.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:38](https://github.com/btravers/amqp-contract/blob/
|
|
51
|
+
| <a id="issues"></a> `issues` | `readonly` | `unknown` | - | - | [packages/client/src/errors.ts:38](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/errors.ts#L38) |
|
|
52
52
|
| <a id="message"></a> `message` | `public` | `string` | - | `ClientError.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` | - | `ClientError.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:37](https://github.com/btravers/amqp-contract/blob/
|
|
54
|
+
| <a id="publishername"></a> `publisherName` | `readonly` | `string` | - | - | [packages/client/src/errors.ts:37](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/errors.ts#L37) |
|
|
55
55
|
| <a id="stack"></a> `stack?` | `public` | `string` | - | `ClientError.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. | `ClientError.stackTraceLimit` | node\_modules/.pnpm/@types+node@25.0.5/node\_modules/@types/node/globals.d.ts:67 |
|
|
57
57
|
|
|
@@ -159,7 +159,7 @@ ClientError.prepareStackTrace
|
|
|
159
159
|
|
|
160
160
|
### TechnicalError
|
|
161
161
|
|
|
162
|
-
Defined in: [packages/client/src/errors.ts:22](https://github.com/btravers/amqp-contract/blob/
|
|
162
|
+
Defined in: [packages/client/src/errors.ts:22](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/errors.ts#L22)
|
|
163
163
|
|
|
164
164
|
Error for technical/runtime failures that cannot be prevented by TypeScript
|
|
165
165
|
This includes validation failures and AMQP channel issues
|
|
@@ -176,7 +176,7 @@ This includes validation failures and AMQP channel issues
|
|
|
176
176
|
new TechnicalError(message, cause?): TechnicalError;
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
Defined in: [packages/client/src/errors.ts:23](https://github.com/btravers/amqp-contract/blob/
|
|
179
|
+
Defined in: [packages/client/src/errors.ts:23](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/errors.ts#L23)
|
|
180
180
|
|
|
181
181
|
###### Parameters
|
|
182
182
|
|
|
@@ -199,7 +199,7 @@ ClientError.constructor
|
|
|
199
199
|
|
|
200
200
|
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
201
201
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
202
|
-
| <a id="cause-1"></a> `cause?` | `readonly` | `unknown` | - | `ClientError.cause` | [packages/client/src/errors.ts:25](https://github.com/btravers/amqp-contract/blob/
|
|
202
|
+
| <a id="cause-1"></a> `cause?` | `readonly` | `unknown` | - | `ClientError.cause` | [packages/client/src/errors.ts:25](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/errors.ts#L25) |
|
|
203
203
|
| <a id="message-1"></a> `message` | `public` | `string` | - | `ClientError.message` | node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1077 |
|
|
204
204
|
| <a id="name-1"></a> `name` | `public` | `string` | - | `ClientError.name` | node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 |
|
|
205
205
|
| <a id="stack-1"></a> `stack?` | `public` | `string` | - | `ClientError.stack` | node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1078 |
|
|
@@ -309,7 +309,7 @@ ClientError.prepareStackTrace
|
|
|
309
309
|
|
|
310
310
|
### TypedAmqpClient
|
|
311
311
|
|
|
312
|
-
Defined in: [packages/client/src/client.ts:54](https://github.com/btravers/amqp-contract/blob/
|
|
312
|
+
Defined in: [packages/client/src/client.ts:54](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L54)
|
|
313
313
|
|
|
314
314
|
Type-safe AMQP client for publishing messages
|
|
315
315
|
|
|
@@ -327,7 +327,7 @@ Type-safe AMQP client for publishing messages
|
|
|
327
327
|
close(): Future<Result<void, TechnicalError>>;
|
|
328
328
|
```
|
|
329
329
|
|
|
330
|
-
Defined in: [packages/client/src/client.ts:219](https://github.com/btravers/amqp-contract/blob/
|
|
330
|
+
Defined in: [packages/client/src/client.ts:219](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L219)
|
|
331
331
|
|
|
332
332
|
Close the channel and connection
|
|
333
333
|
|
|
@@ -346,7 +346,7 @@ publish<TName>(
|
|
|
346
346
|
| MessageValidationError>>;
|
|
347
347
|
```
|
|
348
348
|
|
|
349
|
-
Defined in: [packages/client/src/client.ts:103](https://github.com/btravers/amqp-contract/blob/
|
|
349
|
+
Defined in: [packages/client/src/client.ts:103](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L103)
|
|
350
350
|
|
|
351
351
|
Publish a message using a defined publisher
|
|
352
352
|
|
|
@@ -384,7 +384,7 @@ value already in options will be overwritten by the compression algorithm.
|
|
|
384
384
|
static create<TContract>(__namedParameters): Future<Result<TypedAmqpClient<TContract>, TechnicalError>>;
|
|
385
385
|
```
|
|
386
386
|
|
|
387
|
-
Defined in: [packages/client/src/client.ts:72](https://github.com/btravers/amqp-contract/blob/
|
|
387
|
+
Defined in: [packages/client/src/client.ts:72](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L72)
|
|
388
388
|
|
|
389
389
|
Create a type-safe AMQP client from a contract.
|
|
390
390
|
|
|
@@ -419,7 +419,7 @@ connection options, following RabbitMQ best practices.
|
|
|
419
419
|
type ClientInferPublisherInput<TContract, TName> = PublisherInferInput<InferPublisher<TContract, TName>>;
|
|
420
420
|
```
|
|
421
421
|
|
|
422
|
-
Defined in: [packages/client/src/types.ts:37](https://github.com/btravers/amqp-contract/blob/
|
|
422
|
+
Defined in: [packages/client/src/types.ts:37](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/types.ts#L37)
|
|
423
423
|
|
|
424
424
|
Infer publisher input type (message payload) for a specific publisher in a contract
|
|
425
425
|
|
|
@@ -438,7 +438,7 @@ Infer publisher input type (message payload) for a specific publisher in a contr
|
|
|
438
438
|
type CreateClientOptions<TContract> = object;
|
|
439
439
|
```
|
|
440
440
|
|
|
441
|
-
Defined in: [packages/client/src/client.ts:38](https://github.com/btravers/amqp-contract/blob/
|
|
441
|
+
Defined in: [packages/client/src/client.ts:38](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L38)
|
|
442
442
|
|
|
443
443
|
Options for creating a client
|
|
444
444
|
|
|
@@ -452,11 +452,11 @@ Options for creating a client
|
|
|
452
452
|
|
|
453
453
|
| Property | Type | Description | Defined in |
|
|
454
454
|
| ------ | ------ | ------ | ------ |
|
|
455
|
-
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | - | [packages/client/src/client.ts:41](https://github.com/btravers/amqp-contract/blob/
|
|
456
|
-
| <a id="contract"></a> `contract` | `TContract` | - | [packages/client/src/client.ts:39](https://github.com/btravers/amqp-contract/blob/
|
|
457
|
-
| <a id="logger"></a> `logger?` | `Logger` | - | [packages/client/src/client.ts:42](https://github.com/btravers/amqp-contract/blob/
|
|
458
|
-
| <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:48](https://github.com/btravers/amqp-contract/blob/
|
|
459
|
-
| <a id="urls"></a> `urls` | `ConnectionUrl`[] | - | [packages/client/src/client.ts:40](https://github.com/btravers/amqp-contract/blob/
|
|
455
|
+
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | - | [packages/client/src/client.ts:41](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L41) |
|
|
456
|
+
| <a id="contract"></a> `contract` | `TContract` | - | [packages/client/src/client.ts:39](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L39) |
|
|
457
|
+
| <a id="logger"></a> `logger?` | `Logger` | - | [packages/client/src/client.ts:42](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L42) |
|
|
458
|
+
| <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:48](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L48) |
|
|
459
|
+
| <a id="urls"></a> `urls` | `ConnectionUrl`[] | - | [packages/client/src/client.ts:40](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L40) |
|
|
460
460
|
|
|
461
461
|
***
|
|
462
462
|
|
|
@@ -466,7 +466,7 @@ Options for creating a client
|
|
|
466
466
|
type PublishOptions = Options.Publish & object;
|
|
467
467
|
```
|
|
468
468
|
|
|
469
|
-
Defined in: [packages/client/src/client.ts:26](https://github.com/btravers/amqp-contract/blob/
|
|
469
|
+
Defined in: [packages/client/src/client.ts:26](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L26)
|
|
470
470
|
|
|
471
471
|
Publish options that extend amqplib's Options.Publish with optional compression support.
|
|
472
472
|
|
|
@@ -474,4 +474,4 @@ Publish options that extend amqplib's Options.Publish with optional compression
|
|
|
474
474
|
|
|
475
475
|
| Name | Type | Description | Defined in |
|
|
476
476
|
| ------ | ------ | ------ | ------ |
|
|
477
|
-
| `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:32](https://github.com/btravers/amqp-contract/blob/
|
|
477
|
+
| `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:32](https://github.com/btravers/amqp-contract/blob/00468eb63a019d6161c43f07dab8b68232bbb383/packages/client/src/client.ts#L32) |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amqp-contract/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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.10.0",
|
|
57
|
+
"@amqp-contract/core": "0.10.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.16",
|
|
70
70
|
"zod": "4.3.5",
|
|
71
|
-
"@amqp-contract/testing": "0.
|
|
71
|
+
"@amqp-contract/testing": "0.10.0",
|
|
72
72
|
"@amqp-contract/tsconfig": "0.1.0",
|
|
73
73
|
"@amqp-contract/typedoc": "0.1.0"
|
|
74
74
|
},
|