@amqp-contract/client 0.21.0 → 0.22.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
@@ -168,9 +168,316 @@ Error.prepareStackTrace
168
168
 
169
169
  ***
170
170
 
171
+ ### RpcCancelledError
172
+
173
+ Defined in: [packages/client/src/errors.ts:39](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/errors.ts#L39)
174
+
175
+ Returned from any in-flight RPC call when the client is closed before the
176
+ reply is received. The correlation map is cleared on close and every pending
177
+ caller's promise resolves with `Result.Error(RpcCancelledError)`.
178
+
179
+ #### Extends
180
+
181
+ - `Error`
182
+
183
+ #### Constructors
184
+
185
+ ##### Constructor
186
+
187
+ ```ts
188
+ new RpcCancelledError(rpcName): RpcCancelledError;
189
+ ```
190
+
191
+ Defined in: [packages/client/src/errors.ts:40](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/errors.ts#L40)
192
+
193
+ ###### Parameters
194
+
195
+ | Parameter | Type |
196
+ | ------ | ------ |
197
+ | `rpcName` | `string` |
198
+
199
+ ###### Returns
200
+
201
+ [`RpcCancelledError`](#rpccancellederror)
202
+
203
+ ###### Overrides
204
+
205
+ ```ts
206
+ Error.constructor
207
+ ```
208
+
209
+ #### Properties
210
+
211
+ | Property | Modifier | Type | Description | Inherited from | Defined in |
212
+ | ------ | ------ | ------ | ------ | ------ | ------ |
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
+ | <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
+ | <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/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/errors.ts#L40) |
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
+ | <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
+
220
+ #### Methods
221
+
222
+ ##### captureStackTrace()
223
+
224
+ ```ts
225
+ static captureStackTrace(targetObject, constructorOpt?): void;
226
+ ```
227
+
228
+ Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:52
229
+
230
+ Creates a `.stack` property on `targetObject`, which when accessed returns
231
+ a string representing the location in the code at which
232
+ `Error.captureStackTrace()` was called.
233
+
234
+ ```js
235
+ const myObject = {};
236
+ Error.captureStackTrace(myObject);
237
+ myObject.stack; // Similar to `new Error().stack`
238
+ ```
239
+
240
+ The first line of the trace will be prefixed with
241
+ `${myObject.name}: ${myObject.message}`.
242
+
243
+ The optional `constructorOpt` argument accepts a function. If given, all frames
244
+ above `constructorOpt`, including `constructorOpt`, will be omitted from the
245
+ generated stack trace.
246
+
247
+ The `constructorOpt` argument is useful for hiding implementation
248
+ details of error generation from the user. For instance:
249
+
250
+ ```js
251
+ function a() {
252
+ b();
253
+ }
254
+
255
+ function b() {
256
+ c();
257
+ }
258
+
259
+ function c() {
260
+ // Create an error without stack trace to avoid calculating the stack trace twice.
261
+ const { stackTraceLimit } = Error;
262
+ Error.stackTraceLimit = 0;
263
+ const error = new Error();
264
+ Error.stackTraceLimit = stackTraceLimit;
265
+
266
+ // Capture the stack trace above function b
267
+ Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
268
+ throw error;
269
+ }
270
+
271
+ a();
272
+ ```
273
+
274
+ ###### Parameters
275
+
276
+ | Parameter | Type |
277
+ | ------ | ------ |
278
+ | `targetObject` | `object` |
279
+ | `constructorOpt?` | `Function` |
280
+
281
+ ###### Returns
282
+
283
+ `void`
284
+
285
+ ###### Inherited from
286
+
287
+ ```ts
288
+ Error.captureStackTrace
289
+ ```
290
+
291
+ ##### prepareStackTrace()
292
+
293
+ ```ts
294
+ static prepareStackTrace(err, stackTraces): any;
295
+ ```
296
+
297
+ Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:56
298
+
299
+ ###### Parameters
300
+
301
+ | Parameter | Type |
302
+ | ------ | ------ |
303
+ | `err` | `Error` |
304
+ | `stackTraces` | `CallSite`[] |
305
+
306
+ ###### Returns
307
+
308
+ `any`
309
+
310
+ ###### See
311
+
312
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
313
+
314
+ ###### Inherited from
315
+
316
+ ```ts
317
+ Error.prepareStackTrace
318
+ ```
319
+
320
+ ***
321
+
322
+ ### RpcTimeoutError
323
+
324
+ Defined in: [packages/client/src/errors.ts:23](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/errors.ts#L23)
325
+
326
+ Returned from `TypedAmqpClient.call()` when the configured `timeoutMs` elapses
327
+ before the RPC server publishes a reply with the matching `correlationId`.
328
+
329
+ The pending call is removed from the in-memory correlation map; if a reply
330
+ arrives after the timeout it is dropped (and a debug log is emitted by the
331
+ client if a logger is configured).
332
+
333
+ #### Extends
334
+
335
+ - `Error`
336
+
337
+ #### Constructors
338
+
339
+ ##### Constructor
340
+
341
+ ```ts
342
+ new RpcTimeoutError(rpcName, timeoutMs): RpcTimeoutError;
343
+ ```
344
+
345
+ Defined in: [packages/client/src/errors.ts:24](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/errors.ts#L24)
346
+
347
+ ###### Parameters
348
+
349
+ | Parameter | Type |
350
+ | ------ | ------ |
351
+ | `rpcName` | `string` |
352
+ | `timeoutMs` | `number` |
353
+
354
+ ###### Returns
355
+
356
+ [`RpcTimeoutError`](#rpctimeouterror)
357
+
358
+ ###### Overrides
359
+
360
+ ```ts
361
+ Error.constructor
362
+ ```
363
+
364
+ #### Properties
365
+
366
+ | Property | Modifier | Type | Description | Inherited from | Defined in |
367
+ | ------ | ------ | ------ | ------ | ------ | ------ |
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
+ | <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
+ | <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/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/errors.ts#L25) |
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/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/errors.ts#L26) |
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
+
376
+ #### Methods
377
+
378
+ ##### captureStackTrace()
379
+
380
+ ```ts
381
+ static captureStackTrace(targetObject, constructorOpt?): void;
382
+ ```
383
+
384
+ Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:52
385
+
386
+ Creates a `.stack` property on `targetObject`, which when accessed returns
387
+ a string representing the location in the code at which
388
+ `Error.captureStackTrace()` was called.
389
+
390
+ ```js
391
+ const myObject = {};
392
+ Error.captureStackTrace(myObject);
393
+ myObject.stack; // Similar to `new Error().stack`
394
+ ```
395
+
396
+ The first line of the trace will be prefixed with
397
+ `${myObject.name}: ${myObject.message}`.
398
+
399
+ The optional `constructorOpt` argument accepts a function. If given, all frames
400
+ above `constructorOpt`, including `constructorOpt`, will be omitted from the
401
+ generated stack trace.
402
+
403
+ The `constructorOpt` argument is useful for hiding implementation
404
+ details of error generation from the user. For instance:
405
+
406
+ ```js
407
+ function a() {
408
+ b();
409
+ }
410
+
411
+ function b() {
412
+ c();
413
+ }
414
+
415
+ function c() {
416
+ // Create an error without stack trace to avoid calculating the stack trace twice.
417
+ const { stackTraceLimit } = Error;
418
+ Error.stackTraceLimit = 0;
419
+ const error = new Error();
420
+ Error.stackTraceLimit = stackTraceLimit;
421
+
422
+ // Capture the stack trace above function b
423
+ Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
424
+ throw error;
425
+ }
426
+
427
+ a();
428
+ ```
429
+
430
+ ###### Parameters
431
+
432
+ | Parameter | Type |
433
+ | ------ | ------ |
434
+ | `targetObject` | `object` |
435
+ | `constructorOpt?` | `Function` |
436
+
437
+ ###### Returns
438
+
439
+ `void`
440
+
441
+ ###### Inherited from
442
+
443
+ ```ts
444
+ Error.captureStackTrace
445
+ ```
446
+
447
+ ##### prepareStackTrace()
448
+
449
+ ```ts
450
+ static prepareStackTrace(err, stackTraces): any;
451
+ ```
452
+
453
+ Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:56
454
+
455
+ ###### Parameters
456
+
457
+ | Parameter | Type |
458
+ | ------ | ------ |
459
+ | `err` | `Error` |
460
+ | `stackTraces` | `CallSite`[] |
461
+
462
+ ###### Returns
463
+
464
+ `any`
465
+
466
+ ###### See
467
+
468
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
469
+
470
+ ###### Inherited from
471
+
472
+ ```ts
473
+ Error.prepareStackTrace
474
+ ```
475
+
476
+ ***
477
+
171
478
  ### TypedAmqpClient
172
479
 
173
- Defined in: [packages/client/src/client.ts:62](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L62)
480
+ Defined in: [packages/client/src/client.ts:123](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L123)
174
481
 
175
482
  Type-safe AMQP client for publishing messages
176
483
 
@@ -182,15 +489,74 @@ Type-safe AMQP client for publishing messages
182
489
 
183
490
  #### Methods
184
491
 
492
+ ##### call()
493
+
494
+ ```ts
495
+ call<TName>(
496
+ rpcName,
497
+ request,
498
+ options): Future<Result<ClientInferRpcResponseOutput<TContract, TName>,
499
+ | TechnicalError
500
+ | MessageValidationError
501
+ | RpcTimeoutError
502
+ | RpcCancelledError>>;
503
+ ```
504
+
505
+ Defined in: [packages/client/src/client.ts:420](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L420)
506
+
507
+ Invoke an RPC defined via `defineRpc` and await the typed response.
508
+
509
+ The request payload is validated against the RPC's request schema, then
510
+ published to the AMQP default exchange with the server's queue name as
511
+ routing key, `replyTo` set to `amq.rabbitmq.reply-to`, and a fresh UUID
512
+ `correlationId`. The returned Future resolves once a matching reply
513
+ arrives and validates against the response schema, or once `timeoutMs`
514
+ elapses (whichever comes first).
515
+
516
+ ###### Type Parameters
517
+
518
+ | Type Parameter | Description |
519
+ | ------ | ------ |
520
+ | `TName` *extends* `string` \| `number` \| `symbol` | An RPC name from `contract.rpcs`. |
521
+
522
+ ###### Parameters
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. |
529
+
530
+ ###### Returns
531
+
532
+ `Future`&lt;`Result`&lt;[`ClientInferRpcResponseOutput`](#clientinferrpcresponseoutput)&lt;`TContract`, `TName`&gt;,
533
+ \| `TechnicalError`
534
+ \| [`MessageValidationError`](#messagevalidationerror)
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.
540
+
541
+ ###### Example
542
+
543
+ ```typescript
544
+ const result = await client
545
+ .call('calculate', { a: 1, b: 2 }, { timeoutMs: 5_000 })
546
+ .toPromise();
547
+ if (result.isOk()) console.log(result.value.sum); // 3
548
+ ```
549
+
185
550
  ##### close()
186
551
 
187
552
  ```ts
188
553
  close(): Future<Result<void, TechnicalError>>;
189
554
  ```
190
555
 
191
- Defined in: [packages/client/src/client.ts:215](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L215)
556
+ Defined in: [packages/client/src/client.ts:572](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L572)
192
557
 
193
- Close the channel and connection
558
+ Close the channel and connection. Cancels the reply consumer (if any) and
559
+ rejects every in-flight RPC call with `RpcCancelledError`.
194
560
 
195
561
  ###### Returns
196
562
 
@@ -205,7 +571,7 @@ publish<TName>(
205
571
  options?): Future<Result<void, TechnicalError | MessageValidationError>>;
206
572
  ```
207
573
 
208
- Defined in: [packages/client/src/client.ts:118](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L118)
574
+ Defined in: [packages/client/src/client.ts:300](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L300)
209
575
 
210
576
  Publish a message using a defined publisher.
211
577
  TypeScript guarantees publisher exists for valid publisher names.
@@ -222,7 +588,7 @@ TypeScript guarantees publisher exists for valid publisher names.
222
588
  | ------ | ------ |
223
589
  | `publisherName` | `TName` |
224
590
  | `message` | [`ClientInferPublisherInput`](#clientinferpublisherinput)&lt;`TContract`, `TName`&gt; |
225
- | `options?` | [`PublishOptions`](#publishoptions) |
591
+ | `options?` | [`PublishOptions`](#publishoptions-1) |
226
592
 
227
593
  ###### Returns
228
594
 
@@ -234,7 +600,7 @@ TypeScript guarantees publisher exists for valid publisher names.
234
600
  static create<TContract>(__namedParameters): Future<Result<TypedAmqpClient<TContract>, TechnicalError>>;
235
601
  ```
236
602
 
237
- Defined in: [packages/client/src/client.ts:81](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L81)
603
+ Defined in: [packages/client/src/client.ts:154](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L154)
238
604
 
239
605
  Create a type-safe AMQP client from a contract.
240
606
 
@@ -263,15 +629,34 @@ connection options, following RabbitMQ best practices.
263
629
 
264
630
  ## Type Aliases
265
631
 
632
+ ### CallOptions
633
+
634
+ ```ts
635
+ type CallOptions = object;
636
+ ```
637
+
638
+ Defined in: [packages/client/src/client.ts:103](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L103)
639
+
640
+ Per-call options for `client.call()`.
641
+
642
+ #### Properties
643
+
644
+ | Property | Type | Description | Defined in |
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:117](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L117) |
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:111](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L111) |
648
+
649
+ ***
650
+
266
651
  ### ClientInferPublisherInput
267
652
 
268
653
  ```ts
269
654
  type ClientInferPublisherInput<TContract, TName> = PublisherInferInput<InferPublisher<TContract, TName>>;
270
655
  ```
271
656
 
272
- Defined in: [packages/client/src/types.ts:41](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/types.ts#L41)
657
+ Defined in: [packages/client/src/types.ts:43](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/types.ts#L43)
273
658
 
274
- Infer publisher input type (message payload) for a specific publisher in a contract
659
+ Input type accepted by `client.publish(name, ...)` for a specific publisher.
275
660
 
276
661
  #### Type Parameters
277
662
 
@@ -282,13 +667,51 @@ Infer publisher input type (message payload) for a specific publisher in a contr
282
667
 
283
668
  ***
284
669
 
670
+ ### ClientInferRpcRequestInput
671
+
672
+ ```ts
673
+ type ClientInferRpcRequestInput<TContract, TName> = InferRpc<TContract, TName> extends RpcDefinition<infer TRequest, MessageDefinition> ? TRequest extends MessageDefinition ? InferSchemaInput<TRequest["payload"]> : never : never;
674
+ ```
675
+
676
+ Defined in: [packages/client/src/types.ts:61](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/types.ts#L61)
677
+
678
+ Input type accepted by `client.call(name, request, ...)`.
679
+
680
+ #### Type Parameters
681
+
682
+ | Type Parameter |
683
+ | ------ |
684
+ | `TContract` *extends* `ContractDefinition` |
685
+ | `TName` *extends* `InferRpcNames`&lt;`TContract`&gt; |
686
+
687
+ ***
688
+
689
+ ### ClientInferRpcResponseOutput
690
+
691
+ ```ts
692
+ type ClientInferRpcResponseOutput<TContract, TName> = InferRpc<TContract, TName> extends RpcDefinition<MessageDefinition, infer TResponse> ? TResponse extends MessageDefinition ? InferSchemaOutput<TResponse["payload"]> : never : never;
693
+ ```
694
+
695
+ Defined in: [packages/client/src/types.ts:74](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/types.ts#L74)
696
+
697
+ Output (validated) response type returned by `client.call(name, ...)`.
698
+
699
+ #### Type Parameters
700
+
701
+ | Type Parameter |
702
+ | ------ |
703
+ | `TContract` *extends* `ContractDefinition` |
704
+ | `TName` *extends* `InferRpcNames`&lt;`TContract`&gt; |
705
+
706
+ ***
707
+
285
708
  ### CreateClientOptions
286
709
 
287
710
  ```ts
288
711
  type CreateClientOptions<TContract> = object;
289
712
  ```
290
713
 
291
- Defined in: [packages/client/src/client.ts:40](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L40)
714
+ Defined in: [packages/client/src/client.ts:74](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L74)
292
715
 
293
716
  Options for creating a client
294
717
 
@@ -302,12 +725,13 @@ Options for creating a client
302
725
 
303
726
  | Property | Type | Description | Defined in |
304
727
  | ------ | ------ | ------ | ------ |
305
- | <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | - | [packages/client/src/client.ts:43](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L43) |
306
- | <a id="contract"></a> `contract` | `TContract` | - | [packages/client/src/client.ts:41](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L41) |
307
- | <a id="defaultpublishoptions"></a> `defaultPublishOptions?` | [`PublishOptions`](#publishoptions) | 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:56](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L56) |
308
- | <a id="logger"></a> `logger?` | `Logger` | - | [packages/client/src/client.ts:44](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L44) |
309
- | <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:50](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L50) |
310
- | <a id="urls"></a> `urls` | `ConnectionUrl`[] | - | [packages/client/src/client.ts:42](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L42) |
728
+ | <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | - | [packages/client/src/client.ts:77](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L77) |
729
+ | <a id="connecttimeoutms"></a> `connectTimeoutMs?` | `number` | Maximum time in ms to wait for the AMQP connection to become ready before `create()` resolves to `Result.Error<TechnicalError>`. Without this option, `create()` waits forever — the underlying amqp-connection-manager retries indefinitely. | [packages/client/src/client.ts:97](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L97) |
730
+ | <a id="contract"></a> `contract` | `TContract` | - | [packages/client/src/client.ts:75](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L75) |
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:90](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L90) |
732
+ | <a id="logger"></a> `logger?` | `Logger` | - | [packages/client/src/client.ts:78](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L78) |
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:84](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L84) |
734
+ | <a id="urls"></a> `urls` | `ConnectionUrl`[] | - | [packages/client/src/client.ts:76](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L76) |
311
735
 
312
736
  ***
313
737
 
@@ -317,7 +741,7 @@ Options for creating a client
317
741
  type PublishOptions = AmqpClientPublishOptions & object;
318
742
  ```
319
743
 
320
- Defined in: [packages/client/src/client.ts:28](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L28)
744
+ Defined in: [packages/client/src/client.ts:62](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L62)
321
745
 
322
746
  Publish options that extend amqp-client's PublishOptions with optional compression support.
323
747
 
@@ -325,4 +749,4 @@ Publish options that extend amqp-client's PublishOptions with optional compressi
325
749
 
326
750
  | Name | Type | Description | Defined in |
327
751
  | ------ | ------ | ------ | ------ |
328
- | `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:34](https://github.com/btravers/amqp-contract/blob/c4431c816689353f677718608623c58fd1757388/packages/client/src/client.ts#L34) |
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:68](https://github.com/btravers/amqp-contract/blob/da9b95c747db8d5af9183ca6fe2a6e0af558d1fa/packages/client/src/client.ts#L68) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amqp-contract/client",
3
- "version": "0.21.0",
3
+ "version": "0.22.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.21.0",
57
- "@amqp-contract/core": "0.21.0"
56
+ "@amqp-contract/contract": "0.22.0",
57
+ "@amqp-contract/core": "0.22.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/amqplib": "0.10.8",
@@ -62,13 +62,13 @@
62
62
  "@vitest/coverage-v8": "4.1.5",
63
63
  "amqp-connection-manager": "5.0.0",
64
64
  "amqplib": "1.0.3",
65
- "tsdown": "0.21.9",
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
70
  "zod": "4.3.6",
71
- "@amqp-contract/testing": "0.21.0",
71
+ "@amqp-contract/testing": "0.22.0",
72
72
  "@amqp-contract/tsconfig": "0.1.0",
73
73
  "@amqp-contract/typedoc": "0.1.0"
74
74
  },