@amqp-contract/client 0.23.0 → 0.24.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 CHANGED
@@ -170,11 +170,11 @@ Error.prepareStackTrace
170
170
 
171
171
  ### RpcCancelledError
172
172
 
173
- Defined in: [packages/client/src/errors.ts:39](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/errors.ts#L39)
173
+ Defined in: [packages/client/src/errors.ts:39](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/errors.ts#L39)
174
174
 
175
175
  Returned from any in-flight RPC call when the client is closed before the
176
176
  reply is received. The correlation map is cleared on close and every pending
177
- caller's promise resolves with `Result.Error(RpcCancelledError)`.
177
+ caller's promise resolves with `err(RpcCancelledError)`.
178
178
 
179
179
  #### Extends
180
180
 
@@ -188,7 +188,7 @@ caller's promise resolves with `Result.Error(RpcCancelledError)`.
188
188
  new RpcCancelledError(rpcName): RpcCancelledError;
189
189
  ```
190
190
 
191
- Defined in: [packages/client/src/errors.ts:40](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/errors.ts#L40)
191
+ Defined in: [packages/client/src/errors.ts:40](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/errors.ts#L40)
192
192
 
193
193
  ###### Parameters
194
194
 
@@ -213,7 +213,7 @@ Error.constructor
213
213
  | <a id="cause-1"></a> `cause?` | `public` | `unknown` | - | `Error.cause` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 |
214
214
  | <a id="message-1"></a> `message` | `public` | `string` | - | `Error.message` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 |
215
215
  | <a id="name-1"></a> `name` | `public` | `string` | - | `Error.name` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 |
216
- | <a id="rpcname"></a> `rpcName` | `readonly` | `string` | - | - | [packages/client/src/errors.ts:40](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/errors.ts#L40) |
216
+ | <a id="rpcname"></a> `rpcName` | `readonly` | `string` | - | - | [packages/client/src/errors.ts:40](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/errors.ts#L40) |
217
217
  | <a id="stack-1"></a> `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 |
218
218
  | <a id="stacktracelimit-1"></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@24.12.2/node\_modules/@types/node/globals.d.ts:68 |
219
219
 
@@ -321,7 +321,7 @@ Error.prepareStackTrace
321
321
 
322
322
  ### RpcTimeoutError
323
323
 
324
- Defined in: [packages/client/src/errors.ts:23](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/errors.ts#L23)
324
+ Defined in: [packages/client/src/errors.ts:23](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/errors.ts#L23)
325
325
 
326
326
  Returned from `TypedAmqpClient.call()` when the configured `timeoutMs` elapses
327
327
  before the RPC server publishes a reply with the matching `correlationId`.
@@ -342,7 +342,7 @@ client if a logger is configured).
342
342
  new RpcTimeoutError(rpcName, timeoutMs): RpcTimeoutError;
343
343
  ```
344
344
 
345
- Defined in: [packages/client/src/errors.ts:24](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/errors.ts#L24)
345
+ Defined in: [packages/client/src/errors.ts:24](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/errors.ts#L24)
346
346
 
347
347
  ###### Parameters
348
348
 
@@ -368,9 +368,9 @@ Error.constructor
368
368
  | <a id="cause-2"></a> `cause?` | `public` | `unknown` | - | `Error.cause` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:24 |
369
369
  | <a id="message-2"></a> `message` | `public` | `string` | - | `Error.message` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 |
370
370
  | <a id="name-2"></a> `name` | `public` | `string` | - | `Error.name` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 |
371
- | <a id="rpcname-1"></a> `rpcName` | `readonly` | `string` | - | - | [packages/client/src/errors.ts:25](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/errors.ts#L25) |
371
+ | <a id="rpcname-1"></a> `rpcName` | `readonly` | `string` | - | - | [packages/client/src/errors.ts:25](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/errors.ts#L25) |
372
372
  | <a id="stack-2"></a> `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 |
373
- | <a id="timeoutms"></a> `timeoutMs` | `readonly` | `number` | - | - | [packages/client/src/errors.ts:26](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/errors.ts#L26) |
373
+ | <a id="timeoutms"></a> `timeoutMs` | `readonly` | `number` | - | - | [packages/client/src/errors.ts:26](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/errors.ts#L26) |
374
374
  | <a id="stacktracelimit-2"></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@24.12.2/node\_modules/@types/node/globals.d.ts:68 |
375
375
 
376
376
  #### Methods
@@ -477,7 +477,7 @@ Error.prepareStackTrace
477
477
 
478
478
  ### TypedAmqpClient
479
479
 
480
- Defined in: [packages/client/src/client.ts:124](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L124)
480
+ Defined in: [packages/client/src/client.ts:124](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L124)
481
481
 
482
482
  Type-safe AMQP client for publishing messages
483
483
 
@@ -495,72 +495,67 @@ Type-safe AMQP client for publishing messages
495
495
  call<TName>(
496
496
  rpcName,
497
497
  request,
498
- options): Future<Result<ClientInferRpcResponseOutput<TContract, TName>,
498
+ options): ResultAsync<ClientInferRpcResponseOutput<TContract, TName>,
499
499
  | TechnicalError
500
500
  | MessageValidationError
501
501
  | RpcTimeoutError
502
- | RpcCancelledError>>;
502
+ | RpcCancelledError>;
503
503
  ```
504
504
 
505
- Defined in: [packages/client/src/client.ts:429](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L429)
505
+ Defined in: [packages/client/src/client.ts:404](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L404)
506
506
 
507
507
  Invoke an RPC defined via `defineRpc` and await the typed response.
508
508
 
509
509
  The request payload is validated against the RPC's request schema, then
510
510
  published to the AMQP default exchange with the server's queue name as
511
511
  routing key, `replyTo` set to `amq.rabbitmq.reply-to`, and a fresh UUID
512
- `correlationId`. The returned Future resolves once a matching reply
512
+ `correlationId`. The returned ResultAsync resolves once a matching reply
513
513
  arrives and validates against the response schema, or once `timeoutMs`
514
514
  elapses (whichever comes first).
515
515
 
516
516
  ###### Type Parameters
517
517
 
518
- | Type Parameter | Description |
519
- | ------ | ------ |
520
- | `TName` *extends* `string` \| `number` \| `symbol` | An RPC name from `contract.rpcs`. |
518
+ | Type Parameter |
519
+ | ------ |
520
+ | `TName` *extends* `string` \| `number` \| `symbol` |
521
521
 
522
522
  ###### Parameters
523
523
 
524
- | Parameter | Type | Description |
525
- | ------ | ------ | ------ |
526
- | `rpcName` | `TName` | The RPC name from the contract. |
527
- | `request` | [`ClientInferRpcRequestInput`](#clientinferrpcrequestinput)&lt;`TContract`, `TName`&gt; | The request payload, validated against the request schema. |
528
- | `options` | [`CallOptions`](#calloptions) | Per-call options. `timeoutMs` is required. |
524
+ | Parameter | Type |
525
+ | ------ | ------ |
526
+ | `rpcName` | `TName` |
527
+ | `request` | [`ClientInferRpcRequestInput`](#clientinferrpcrequestinput)&lt;`TContract`, `TName`&gt; |
528
+ | `options` | [`CallOptions`](#calloptions) |
529
529
 
530
530
  ###### Returns
531
531
 
532
- `Future`&lt;`Result`&lt;[`ClientInferRpcResponseOutput`](#clientinferrpcresponseoutput)&lt;`TContract`, `TName`&gt;,
532
+ `ResultAsync`&lt;[`ClientInferRpcResponseOutput`](#clientinferrpcresponseoutput)&lt;`TContract`, `TName`&gt;,
533
533
  \| `TechnicalError`
534
534
  \| [`MessageValidationError`](#messagevalidationerror)
535
535
  \| [`RpcTimeoutError`](#rpctimeouterror)
536
- \| [`RpcCancelledError`](#rpccancellederror)&gt;&gt;
537
-
538
- `Result.Ok(response)` on a successful round-trip; `Result.Error`
539
- on validation, transport, timeout, or cancel.
536
+ \| [`RpcCancelledError`](#rpccancellederror)&gt;
540
537
 
541
538
  ###### Example
542
539
 
543
540
  ```typescript
544
- const result = await client
545
- .call('calculate', { a: 1, b: 2 }, { timeoutMs: 5_000 })
546
- .toPromise();
541
+ const result = await client.call('calculate', { a: 1, b: 2 }, { timeoutMs: 5_000 });
547
542
  if (result.isOk()) console.log(result.value.sum); // 3
548
543
  ```
549
544
 
550
545
  ##### close()
551
546
 
552
547
  ```ts
553
- close(): Future<Result<void, TechnicalError>>;
548
+ close(): ResultAsync<void, TechnicalError>;
554
549
  ```
555
550
 
556
- Defined in: [packages/client/src/client.ts:581](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L581)
551
+ Defined in: [packages/client/src/client.ts:554](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L554)
557
552
 
558
553
  Close the channel and connection. Cancels the reply consumer (if any) and
559
554
  rejects every in-flight RPC call with `RpcCancelledError`.
560
555
 
561
556
  ###### Returns
562
557
 
563
- `Future`&lt;`Result`&lt;`void`, `TechnicalError`&gt;&gt;
558
+ `ResultAsync`&lt;`void`, `TechnicalError`&gt;
564
559
 
565
560
  ##### publish()
566
561
 
@@ -568,13 +563,12 @@ rejects every in-flight RPC call with `RpcCancelledError`.
568
563
  publish<TName>(
569
564
  publisherName,
570
565
  message,
571
- options?): Future<Result<void, TechnicalError | MessageValidationError>>;
566
+ options?): ResultAsync<void, TechnicalError | MessageValidationError>;
572
567
  ```
573
568
 
574
- Defined in: [packages/client/src/client.ts:309](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L309)
569
+ Defined in: [packages/client/src/client.ts:296](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L296)
575
570
 
576
571
  Publish a message using a defined publisher.
577
- TypeScript guarantees publisher exists for valid publisher names.
578
572
 
579
573
  ###### Type Parameters
580
574
 
@@ -584,23 +578,29 @@ TypeScript guarantees publisher exists for valid publisher names.
584
578
 
585
579
  ###### Parameters
586
580
 
587
- | Parameter | Type |
588
- | ------ | ------ |
589
- | `publisherName` | `TName` |
590
- | `message` | [`ClientInferPublisherInput`](#clientinferpublisherinput)&lt;`TContract`, `TName`&gt; |
591
- | `options?` | [`PublishOptions`](#publishoptions-1) |
581
+ | Parameter | Type | Description |
582
+ | ------ | ------ | ------ |
583
+ | `publisherName` | `TName` | The name of the publisher to use |
584
+ | `message` | [`ClientInferPublisherInput`](#clientinferpublisherinput)&lt;`TContract`, `TName`&gt; | The message to publish |
585
+ | `options?` | [`PublishOptions`](#publishoptions-1) | Optional publish options including compression, headers, priority, etc. |
592
586
 
593
587
  ###### Returns
594
588
 
595
- `Future`&lt;`Result`&lt;`void`, `TechnicalError` \| [`MessageValidationError`](#messagevalidationerror)&gt;&gt;
589
+ `ResultAsync`&lt;`void`, `TechnicalError` \| [`MessageValidationError`](#messagevalidationerror)&gt;
590
+
591
+ ###### Remarks
592
+
593
+ If `options.compression` is specified, the message will be compressed before publishing
594
+ and the `contentEncoding` property will be set automatically. Any `contentEncoding`
595
+ value already in options will be overwritten by the compression algorithm.
596
596
 
597
597
  ##### create()
598
598
 
599
599
  ```ts
600
- static create<TContract>(__namedParameters): Future<Result<TypedAmqpClient<TContract>, TechnicalError>>;
600
+ static create<TContract>(__namedParameters): ResultAsync<TypedAmqpClient<TContract>, TechnicalError>;
601
601
  ```
602
602
 
603
- Defined in: [packages/client/src/client.ts:155](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L155)
603
+ Defined in: [packages/client/src/client.ts:155](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L155)
604
604
 
605
605
  Create a type-safe AMQP client from a contract.
606
606
 
@@ -625,7 +625,7 @@ connection options, following RabbitMQ best practices.
625
625
 
626
626
  ###### Returns
627
627
 
628
- `Future`&lt;`Result`&lt;[`TypedAmqpClient`](#typedamqpclient)&lt;`TContract`&gt;, `TechnicalError`&gt;&gt;
628
+ `ResultAsync`&lt;[`TypedAmqpClient`](#typedamqpclient)&lt;`TContract`&gt;, `TechnicalError`&gt;
629
629
 
630
630
  ## Type Aliases
631
631
 
@@ -635,7 +635,7 @@ connection options, following RabbitMQ best practices.
635
635
  type CallOptions = object;
636
636
  ```
637
637
 
638
- Defined in: [packages/client/src/client.ts:104](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L104)
638
+ Defined in: [packages/client/src/client.ts:104](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L104)
639
639
 
640
640
  Per-call options for `client.call()`.
641
641
 
@@ -643,8 +643,8 @@ Per-call options for `client.call()`.
643
643
 
644
644
  | Property | Type | Description | Defined in |
645
645
  | ------ | ------ | ------ | ------ |
646
- | <a id="publishoptions"></a> `publishOptions?` | `Omit`&lt;`AmqpClientPublishOptions`, `"replyTo"` \| `"correlationId"`&gt; | Optional AMQP message properties to merge into the request. `replyTo` and `correlationId` are managed by the client and cannot be overridden. | [packages/client/src/client.ts:118](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L118) |
647
- | <a id="timeoutms-1"></a> `timeoutMs` | `number` | Maximum time in ms to wait for an RPC reply. If exceeded, the call resolves to `Result.Error<RpcTimeoutError>` and the in-memory correlation entry is cleared. A late reply arriving after the timeout is silently dropped. Required: RPC without a timeout is a footgun. | [packages/client/src/client.ts:112](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L112) |
646
+ | <a id="publishoptions"></a> `publishOptions?` | `Omit`&lt;`AmqpClientPublishOptions`, `"replyTo"` \| `"correlationId"`&gt; | Optional AMQP message properties to merge into the request. `replyTo` and `correlationId` are managed by the client and cannot be overridden. | [packages/client/src/client.ts:118](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L118) |
647
+ | <a id="timeoutms-1"></a> `timeoutMs` | `number` | Maximum time in ms to wait for an RPC reply. If exceeded, the call resolves to `err(RpcTimeoutError)` and the in-memory correlation entry is cleared. A late reply arriving after the timeout is silently dropped. Required: RPC without a timeout is a footgun. | [packages/client/src/client.ts:112](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L112) |
648
648
 
649
649
  ***
650
650
 
@@ -654,7 +654,7 @@ Per-call options for `client.call()`.
654
654
  type ClientInferPublisherInput<TContract, TName> = PublisherInferInput<InferPublisher<TContract, TName>>;
655
655
  ```
656
656
 
657
- Defined in: [packages/client/src/types.ts:43](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/types.ts#L43)
657
+ Defined in: [packages/client/src/types.ts:43](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/types.ts#L43)
658
658
 
659
659
  Input type accepted by `client.publish(name, ...)` for a specific publisher.
660
660
 
@@ -673,7 +673,7 @@ Input type accepted by `client.publish(name, ...)` for a specific publisher.
673
673
  type ClientInferRpcRequestInput<TContract, TName> = InferRpc<TContract, TName> extends RpcDefinition<infer TRequest, MessageDefinition> ? TRequest extends MessageDefinition ? InferSchemaInput<TRequest["payload"]> : never : never;
674
674
  ```
675
675
 
676
- Defined in: [packages/client/src/types.ts:61](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/types.ts#L61)
676
+ Defined in: [packages/client/src/types.ts:61](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/types.ts#L61)
677
677
 
678
678
  Input type accepted by `client.call(name, request, ...)`.
679
679
 
@@ -692,7 +692,7 @@ Input type accepted by `client.call(name, request, ...)`.
692
692
  type ClientInferRpcResponseOutput<TContract, TName> = InferRpc<TContract, TName> extends RpcDefinition<MessageDefinition, infer TResponse> ? TResponse extends MessageDefinition ? InferSchemaOutput<TResponse["payload"]> : never : never;
693
693
  ```
694
694
 
695
- Defined in: [packages/client/src/types.ts:74](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/types.ts#L74)
695
+ Defined in: [packages/client/src/types.ts:74](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/types.ts#L74)
696
696
 
697
697
  Output (validated) response type returned by `client.call(name, ...)`.
698
698
 
@@ -711,7 +711,7 @@ Output (validated) response type returned by `client.call(name, ...)`.
711
711
  type CreateClientOptions<TContract> = object;
712
712
  ```
713
713
 
714
- Defined in: [packages/client/src/client.ts:75](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L75)
714
+ Defined in: [packages/client/src/client.ts:75](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L75)
715
715
 
716
716
  Options for creating a client
717
717
 
@@ -725,13 +725,13 @@ Options for creating a client
725
725
 
726
726
  | Property | Type | Description | Defined in |
727
727
  | ------ | ------ | ------ | ------ |
728
- | <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | - | [packages/client/src/client.ts:78](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L78) |
729
- | <a id="connecttimeoutms"></a> `connectTimeoutMs?` | `number` \| `null` | Maximum time in ms to wait for the AMQP connection to become ready before `create()` resolves to `Result.Error<TechnicalError>`. Defaults to 30s (the [AmqpClient](https://btravers.github.io/amqp-contract/api/core#amqpclient)'s `DEFAULT_CONNECT_TIMEOUT_MS`). Pass `null` to disable the timeout and let amqp-connection-manager retry indefinitely. | [packages/client/src/client.ts:98](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L98) |
730
- | <a id="contract"></a> `contract` | `TContract` | - | [packages/client/src/client.ts:76](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L76) |
731
- | <a id="defaultpublishoptions"></a> `defaultPublishOptions?` | [`PublishOptions`](#publishoptions-1) | Default publish options that will be applied to all publish operations. These can be overridden by options passed to the publish method. By default, persistent is set to true for message durability. | [packages/client/src/client.ts:91](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L91) |
732
- | <a id="logger"></a> `logger?` | `Logger` | - | [packages/client/src/client.ts:79](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L79) |
733
- | <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:85](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L85) |
734
- | <a id="urls"></a> `urls` | `ConnectionUrl`[] | - | [packages/client/src/client.ts:77](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L77) |
728
+ | <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | - | [packages/client/src/client.ts:78](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L78) |
729
+ | <a id="connecttimeoutms"></a> `connectTimeoutMs?` | `number` \| `null` | Maximum time in ms to wait for the AMQP connection to become ready before `create()` resolves to an `err(TechnicalError)`. Defaults to 30s (the [AmqpClient](https://btravers.github.io/amqp-contract/api/core#amqpclient)'s `DEFAULT_CONNECT_TIMEOUT_MS`). Pass `null` to disable the timeout and let amqp-connection-manager retry indefinitely. | [packages/client/src/client.ts:98](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L98) |
730
+ | <a id="contract"></a> `contract` | `TContract` | - | [packages/client/src/client.ts:76](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L76) |
731
+ | <a id="defaultpublishoptions"></a> `defaultPublishOptions?` | [`PublishOptions`](#publishoptions-1) | Default publish options that will be applied to all publish operations. These can be overridden by options passed to the publish method. By default, persistent is set to true for message durability. | [packages/client/src/client.ts:91](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L91) |
732
+ | <a id="logger"></a> `logger?` | `Logger` | - | [packages/client/src/client.ts:79](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L79) |
733
+ | <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:85](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L85) |
734
+ | <a id="urls"></a> `urls` | `ConnectionUrl`[] | - | [packages/client/src/client.ts:77](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L77) |
735
735
 
736
736
  ***
737
737
 
@@ -741,7 +741,7 @@ Options for creating a client
741
741
  type PublishOptions = AmqpClientPublishOptions & object;
742
742
  ```
743
743
 
744
- Defined in: [packages/client/src/client.ts:63](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L63)
744
+ Defined in: [packages/client/src/client.ts:63](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L63)
745
745
 
746
746
  Publish options that extend amqp-client's PublishOptions with optional compression support.
747
747
 
@@ -749,4 +749,4 @@ Publish options that extend amqp-client's PublishOptions with optional compressi
749
749
 
750
750
  | Name | Type | Description | Defined in |
751
751
  | ------ | ------ | ------ | ------ |
752
- | `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:69](https://github.com/btravers/amqp-contract/blob/cb947e699b512bf57d7ddfcc5ae6e2531e8dfa43/packages/client/src/client.ts#L69) |
752
+ | `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:69](https://github.com/btravers/amqp-contract/blob/1ba3d51bb1d4a09c356afad101dc9e6e6d605185/packages/client/src/client.ts#L69) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amqp-contract/client",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "description": "Client utilities for publishing messages using amqp-contract",
5
5
  "keywords": [
6
6
  "amqp",
@@ -51,26 +51,26 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@standard-schema/spec": "1.1.0",
54
- "@swan-io/boxed": "3.2.1",
54
+ "neverthrow": "8.2.0",
55
55
  "ts-pattern": "5.9.0",
56
- "@amqp-contract/contract": "0.23.0",
57
- "@amqp-contract/core": "0.23.0"
56
+ "@amqp-contract/contract": "0.24.0",
57
+ "@amqp-contract/core": "0.24.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/amqplib": "0.10.8",
61
61
  "@types/node": "24.12.2",
62
62
  "@vitest/coverage-v8": "4.1.5",
63
63
  "amqp-connection-manager": "5.0.0",
64
- "amqplib": "1.0.3",
64
+ "amqplib": "0.10.9",
65
65
  "tsdown": "0.21.10",
66
66
  "typedoc": "0.28.19",
67
67
  "typedoc-plugin-markdown": "4.11.0",
68
68
  "typescript": "6.0.3",
69
69
  "vitest": "4.1.5",
70
- "zod": "4.3.6",
71
- "@amqp-contract/testing": "0.23.0",
72
- "@amqp-contract/tsconfig": "0.1.0",
73
- "@amqp-contract/typedoc": "0.1.0"
70
+ "zod": "4.4.3",
71
+ "@amqp-contract/testing": "0.24.0",
72
+ "@amqp-contract/typedoc": "0.1.0",
73
+ "@amqp-contract/tsconfig": "0.1.0"
74
74
  },
75
75
  "scripts": {
76
76
  "build": "tsdown src/index.ts --format cjs,esm --dts --clean",