@amqp-contract/client 0.13.0 → 0.15.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/dist/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  let _amqp_contract_core = require("@amqp-contract/core");
2
3
  let _swan_io_boxed = require("@swan-io/boxed");
3
4
  let node_zlib = require("node:zlib");
package/dist/index.d.cts CHANGED
@@ -1,19 +1,68 @@
1
1
  import { Logger, TechnicalError, TelemetryProvider } from "@amqp-contract/core";
2
- import { AmqpConnectionManagerOptions, ConnectionUrl } from "amqp-connection-manager";
3
- import { CompressionAlgorithm, ContractDefinition, InferPublisherNames, PublisherDefinition } from "@amqp-contract/contract";
2
+ import * as amqp from "amqplib";
3
+ import { Options } from "amqplib";
4
+ import { TcpSocketConnectOpts } from "net";
5
+ import { ConnectionOptions } from "tls";
6
+ import { CompressionAlgorithm, ContractDefinition, InferPublisherNames, PublisherEntry } from "@amqp-contract/contract";
4
7
  import { Future, Result } from "@swan-io/boxed";
5
8
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
- import { Options } from "amqplib";
7
9
 
10
+ //#region ../../node_modules/.pnpm/amqp-connection-manager@5.0.0_amqplib@0.10.9/node_modules/amqp-connection-manager/dist/types/AmqpConnectionManager.d.ts
11
+ type ConnectionUrl = string | amqp.Options.Connect | {
12
+ url: string;
13
+ connectionOptions?: AmqpConnectionOptions;
14
+ };
15
+ type AmqpConnectionOptions = (ConnectionOptions | TcpSocketConnectOpts) & {
16
+ noDelay?: boolean;
17
+ timeout?: number;
18
+ keepAlive?: boolean;
19
+ keepAliveDelay?: number;
20
+ clientProperties?: any;
21
+ credentials?: {
22
+ mechanism: string;
23
+ username: string;
24
+ password: string;
25
+ response: () => Buffer;
26
+ } | {
27
+ mechanism: string;
28
+ response: () => Buffer;
29
+ } | undefined;
30
+ };
31
+ interface AmqpConnectionManagerOptions {
32
+ /** Interval to send heartbeats to broker. Defaults to 5 seconds. */
33
+ heartbeatIntervalInSeconds?: number;
34
+ /**
35
+ * The time to wait before trying to reconnect. If not specified, defaults
36
+ * to `heartbeatIntervalInSeconds`.
37
+ */
38
+ reconnectTimeInSeconds?: number | undefined;
39
+ /**
40
+ * `findServers` is a function that which returns one or more servers to
41
+ * connect to. This should return either a single URL or an array of URLs.
42
+ * This is handy when you're using a service discovery mechanism such as
43
+ * Consul or etcd. Instead of taking a callback, this can also return a
44
+ * Promise. Note that if this is supplied, then `urls` is ignored.
45
+ */
46
+ findServers?: ((callback: (urls: ConnectionUrl | ConnectionUrl[]) => void) => void) | (() => Promise<ConnectionUrl | ConnectionUrl[]>) | undefined;
47
+ /** Connection options, passed as options to the amqplib.connect() method. */
48
+ connectionOptions?: AmqpConnectionOptions;
49
+ }
50
+ //#endregion
8
51
  //#region src/types.d.ts
9
52
  /**
10
53
  * Infer the TypeScript type from a schema
11
54
  */
12
55
  type InferSchemaInput<TSchema extends StandardSchemaV1> = TSchema extends StandardSchemaV1<infer TInput> ? TInput : never;
13
56
  /**
14
- * Infer publisher message input type
57
+ * Infer publisher message input type.
58
+ * Works with both PublisherDefinition and EventPublisherConfig since both have
59
+ * a `message` property with a `payload` schema.
15
60
  */
16
- type PublisherInferInput<TPublisher extends PublisherDefinition> = InferSchemaInput<TPublisher["message"]["payload"]>;
61
+ type PublisherInferInput<TPublisher extends PublisherEntry> = TPublisher extends {
62
+ message: {
63
+ payload: StandardSchemaV1;
64
+ };
65
+ } ? InferSchemaInput<TPublisher["message"]["payload"]> : never;
17
66
  /**
18
67
  * Infer all publishers from contract
19
68
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/errors.ts","../src/client.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;KAUK,iCAAiC,oBACpC,gBAAgB;;;AAN4C;KAWzD,mBANiC,CAAA,mBAMM,mBANN,CAAA,GAM6B,gBAN7B,CA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CAAA,CAAA,EAqCgB,MArChB,CAqCuB,MArCvB,CAqC8B,eArC9B,CAqC8C,SArC9C,CAAA,EAqC0D,cArC1D,CAAA,CAAA;EACX;;;AAYX;;;;;;;;;;;EAwBoD;;;;EA6BR,OAAA,CAAA,cAApB,mBAAoB,CAAA,SAAA,CAAA,CAAA,CAAA,aAAA,EACzB,KADyB,EAAA,OAAA,EAE/B,yBAF+B,CAEL,SAFK,EAEM,KAFN,CAAA,EAAA,OAAA,CAAA,EAG9B,cAH8B,CAAA,EAIvC,MAJuC,CAIhC,MAJgC,CAAA,IAAA,EAInB,cAJmB,GAIF,sBAJE,CAAA,CAAA;EAApB;;;EAE0B,KAAA,CAAA,CAAA,EA4FvC,MA5FuC,CA4FhC,MA5FgC,CAAA,IAAA,EA4FnB,cA5FmB,CAAA,CAAA;EAArC,QAAA,sBAAA"}
1
+ {"version":3,"file":"index.d.cts","names":["amqp","EventEmitter","TcpSocketConnectOpts","ConnectionOptions","ChannelWrapper","CreateChannelOpts","ConnectionUrl","Options","Connect","AmqpConnectionOptions","url","connectionOptions","ConnectListener","Connection","connection","arg","ConnectFailedListener","Error","err","Buffer","noDelay","timeout","keepAlive","keepAliveDelay","clientProperties","credentials","mechanism","username","password","response","AmqpConnectionManagerOptions","Promise","heartbeatIntervalInSeconds","reconnectTimeInSeconds","findServers","urls","callback","IAmqpConnectionManager","Function","ChannelModel","addListener","event","args","listener","reason","listeners","eventName","on","once","prependListener","prependOnceListener","removeListener","connect","options","reconnect","createChannel","close","isConnected","channelCount","AmqpConnectionManager","_channels","_currentUrl","_closed","_cancelRetriesHandler","_connectPromise","_currentConnection","_findServers","_urls","constructor","_connect","default"],"sources":["../../../node_modules/.pnpm/amqp-connection-manager@5.0.0_amqplib@0.10.9/node_modules/amqp-connection-manager/dist/types/AmqpConnectionManager.d.ts","../src/types.ts","../src/errors.ts","../src/client.ts"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;KAKYM,aAAAA,YAAyBN,IAAAA,CAA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,OAAA;EHrBZ;;;;;EG2BvB,WAAA,GAAc,oBAAA;AAAA;;;;KAMJ,mBAAA,mBAAsC,kBAAA;EAChD,QAAA,EAAU,SAAA;EACV,IAAA,EAAM,aAAA;EACN,iBAAA,GAAoB,4BAAA;EACpB,MAAA,GAAS,MAAA;EHrB8CP;;;;;EG2BvD,SAAA,GAAY,iBAAA;AAAA;;;;cAMD,eAAA,mBAAkC,kBAAA;EAAA,iBAE1B,QAAA;EAAA,iBACA,UAAA;EAAA,iBACA,MAAA;EAAA,iBACA,SAAA;EAAA,QAJZ,WAAA,CAAA;EHxBD2B;;;;;;;AAMR;;;EANQA,OGyCC,MAAA,mBAAyB,kBAAA,CAAA,CAAA;IAC9B,QAAA;IACA,IAAA;IACA,iBAAA;IACA,MAAA;IACA;EAAA,GACC,mBAAA,CAAoB,SAAA,IAAa,MAAA,CAAO,MAAA,CAAO,eAAA,CAAgB,SAAA,GAAY,cAAA;EH1B3BvB;;;;;;;;;;;;;;EAA4CyB;;;;EGuD/F,OAAA,eAAsB,mBAAA,CAAoB,SAAA,EAAA,CACxC,aAAA,EAAe,KAAA,EACf,OAAA,EAAS,yBAAA,CAA0B,SAAA,EAAW,KAAA,GAC9C,OAAA,GAAU,cAAA,GACT,MAAA,CAAO,MAAA,OAAa,cAAA,GAAiB,sBAAA;EHzDG;;;EGmJ3C,KAAA,CAAA,GAAS,MAAA,CAAO,MAAA,OAAa,cAAA;EAAA,QAIrB,sBAAA;AAAA"}
package/dist/index.d.mts CHANGED
@@ -1,19 +1,68 @@
1
1
  import { Logger, TechnicalError, TelemetryProvider } from "@amqp-contract/core";
2
2
  import { Future, Result } from "@swan-io/boxed";
3
- import { AmqpConnectionManagerOptions, ConnectionUrl } from "amqp-connection-manager";
4
- import { CompressionAlgorithm, ContractDefinition, InferPublisherNames, PublisherDefinition } from "@amqp-contract/contract";
5
- import { StandardSchemaV1 } from "@standard-schema/spec";
3
+ import * as amqp from "amqplib";
6
4
  import { Options } from "amqplib";
5
+ import { TcpSocketConnectOpts } from "net";
6
+ import { ConnectionOptions } from "tls";
7
+ import { CompressionAlgorithm, ContractDefinition, InferPublisherNames, PublisherEntry } from "@amqp-contract/contract";
8
+ import { StandardSchemaV1 } from "@standard-schema/spec";
7
9
 
10
+ //#region ../../node_modules/.pnpm/amqp-connection-manager@5.0.0_amqplib@0.10.9/node_modules/amqp-connection-manager/dist/types/AmqpConnectionManager.d.ts
11
+ type ConnectionUrl = string | amqp.Options.Connect | {
12
+ url: string;
13
+ connectionOptions?: AmqpConnectionOptions;
14
+ };
15
+ type AmqpConnectionOptions = (ConnectionOptions | TcpSocketConnectOpts) & {
16
+ noDelay?: boolean;
17
+ timeout?: number;
18
+ keepAlive?: boolean;
19
+ keepAliveDelay?: number;
20
+ clientProperties?: any;
21
+ credentials?: {
22
+ mechanism: string;
23
+ username: string;
24
+ password: string;
25
+ response: () => Buffer;
26
+ } | {
27
+ mechanism: string;
28
+ response: () => Buffer;
29
+ } | undefined;
30
+ };
31
+ interface AmqpConnectionManagerOptions {
32
+ /** Interval to send heartbeats to broker. Defaults to 5 seconds. */
33
+ heartbeatIntervalInSeconds?: number;
34
+ /**
35
+ * The time to wait before trying to reconnect. If not specified, defaults
36
+ * to `heartbeatIntervalInSeconds`.
37
+ */
38
+ reconnectTimeInSeconds?: number | undefined;
39
+ /**
40
+ * `findServers` is a function that which returns one or more servers to
41
+ * connect to. This should return either a single URL or an array of URLs.
42
+ * This is handy when you're using a service discovery mechanism such as
43
+ * Consul or etcd. Instead of taking a callback, this can also return a
44
+ * Promise. Note that if this is supplied, then `urls` is ignored.
45
+ */
46
+ findServers?: ((callback: (urls: ConnectionUrl | ConnectionUrl[]) => void) => void) | (() => Promise<ConnectionUrl | ConnectionUrl[]>) | undefined;
47
+ /** Connection options, passed as options to the amqplib.connect() method. */
48
+ connectionOptions?: AmqpConnectionOptions;
49
+ }
50
+ //#endregion
8
51
  //#region src/types.d.ts
9
52
  /**
10
53
  * Infer the TypeScript type from a schema
11
54
  */
12
55
  type InferSchemaInput<TSchema extends StandardSchemaV1> = TSchema extends StandardSchemaV1<infer TInput> ? TInput : never;
13
56
  /**
14
- * Infer publisher message input type
57
+ * Infer publisher message input type.
58
+ * Works with both PublisherDefinition and EventPublisherConfig since both have
59
+ * a `message` property with a `payload` schema.
15
60
  */
16
- type PublisherInferInput<TPublisher extends PublisherDefinition> = InferSchemaInput<TPublisher["message"]["payload"]>;
61
+ type PublisherInferInput<TPublisher extends PublisherEntry> = TPublisher extends {
62
+ message: {
63
+ payload: StandardSchemaV1;
64
+ };
65
+ } ? InferSchemaInput<TPublisher["message"]["payload"]> : never;
17
66
  /**
18
67
  * Infer all publishers from contract
19
68
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/errors.ts","../src/client.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;KAUK,iCAAiC,oBACpC,gBAAgB;;;AAN4C;KAWzD,mBANiC,CAAA,mBAMM,mBANN,CAAA,GAM6B,gBAN7B,CAOpC,UAPoC,CAAA,SAAA,CAAA,CAAA,SAAA,CAAA,CAAA;;;;AACJ,KAY7B,eAPA,CAAA,kBAOkC,kBAPf,CAAA,GAOqC,WAPrC,CAOiD,SAPjD,CAAA,YAAA,CAAA,CAAA;;;;KAYnB,cAZ8E,CAAA,kBAa/D,kBAb+D,EAAA,cAcnE,mBAdmE,CAc/C,SAd+C,CAAA,CAAA,GAe/E,eAf+E,CAe/D,SAf+D,CAAA,CAepD,KAfoD,CAAA;AAAA;;;AAOtB,KAajD,yBAbiD,CAAA,kBAczC,kBAdyC,EAAA,cAe7C,mBAf6C,CAezB,SAfyB,CAAA,CAAA,GAgBzD,mBAhByD,CAgBrC,cAhBqC,CAgBtB,SAhBsB,EAgBX,KAhBW,CAAA,CAAA;;;;;;cCpBhD,sBAAA,SAA+B,KAAA;;;;;;;;ADEkB;;AAM5D,KEeU,cAAA,GAAiB,OAAA,CAAQ,OFfnC,GAAA;EAAgB;;AA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ectionOptions","ChannelWrapper","CreateChannelOpts","ConnectionUrl","Options","Connect","AmqpConnectionOptions","url","connectionOptions","ConnectListener","Connection","connection","arg","ConnectFailedListener","Error","err","Buffer","noDelay","timeout","keepAlive","keepAliveDelay","clientProperties","credentials","mechanism","username","password","response","AmqpConnectionManagerOptions","Promise","heartbeatIntervalInSeconds","reconnectTimeInSeconds","findServers","urls","callback","IAmqpConnectionManager","Function","ChannelModel","addListener","event","args","listener","reason","listeners","eventName","on","once","prependListener","prependOnceListener","removeListener","connect","options","reconnect","createChannel","close","isConnected","channelCount","AmqpConnectionManager","_channels","_currentUrl","_closed","_cancelRetriesHandler","_connectPromise","_currentConnection","_findServers","_urls","constructor","_connect","default"],"sources":["../../../node_modules/.pnpm/amqp-connection-manager@5.0.0_amqplib@0.10.9/node_modules/amqp-connection-manager/dist/types/AmqpConnectionManager.d.ts","../src/types.ts","../src/errors.ts","../src/client.ts"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;KAKYM,aAAAA,YAAyBN,IAAAA,CAAKO,OAAAA,CAAQC,OAAAA;EAC9CE,GAAAA;EACAC,iBAAAA,GAAoBF,qBAAAA;AAAAA;AAAAA,KAcZA,qBAAAA,IAAyBN,iBAAAA,GAAoBD,oBAAAA;EACrDkB,OAAAA;EACAC,OAAAA;EACAC,SAAAA;EACAC,cAAAA;EACAC,gBAAAA;EACAC,WAAAA;IACIC,SAAAA;IACAC,QAAAA;IACAC,QAAAA;IACAC,QAAAA,QAAgBV,MAAAA;EAAAA;IAEhBO,SAAAA;IACAG,QAAAA,QAAgBV,MAAAA;EAAAA;AAAAA;AAAAA,UAGPW,4BAAAA;EAVbL;EAYAO,0BAAAA;EAVIL;;;;EAeJM,sBAAAA;EAVIJ;;;;AAGR;;;EAeIK,WAAAA,KAAgBE,QAAAA,GAAWD,IAAAA,EAAM7B,aAAAA,GAAgBA,aAAAA,+BAA4CyB,OAAAA,CAAQzB,aAAAA,GAAgBA,aAAAA;EAApEA;EAEjDK,iBAAA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;;;;;;;;;;;;EAA4CyB;;;;EGuD/F,OAAA,eAAsB,mBAAA,CAAoB,SAAA,EAAA,CACxC,aAAA,EAAe,KAAA,EACf,OAAA,EAAS,yBAAA,CAA0B,SAAA,EAAW,KAAA,GAC9C,OAAA,GAAU,cAAA,GACT,MAAA,CAAO,MAAA,OAAa,cAAA,GAAiB,sBAAA;EHzDG;;;EGmJ3C,KAAA,CAAA,GAAS,MAAA,CAAO,MAAA,OAAa,cAAA;EAAA,QAIrB,sBAAA;AAAA"}
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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/errors.ts#L4)
11
+ Defined in: [packages/client/src/errors.ts:4](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/errors.ts#L5)
27
+ Defined in: [packages/client/src/errors.ts:5](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/packages/client/src/errors.ts#L5)
28
28
 
29
29
  ###### Parameters
30
30
 
@@ -48,12 +48,12 @@ 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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/errors.ts#L7) |
51
+ | <a id="issues"></a> `issues` | `readonly` | `unknown` | - | - | [packages/client/src/errors.ts:7](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/errors.ts#L6) |
54
+ | <a id="publishername"></a> `publisherName` | `readonly` | `string` | - | - | [packages/client/src/errors.ts:6](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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
- | <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 |
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.2.1/node\_modules/@types/node/globals.d.ts:67 |
57
57
 
58
58
  #### Methods
59
59
 
@@ -63,7 +63,7 @@ Error.constructor
63
63
  static captureStackTrace(targetObject, constructorOpt?): void;
64
64
  ```
65
65
 
66
- Defined in: node\_modules/.pnpm/@types+node@25.0.9/node\_modules/@types/node/globals.d.ts:51
66
+ Defined in: node\_modules/.pnpm/@types+node@25.2.1/node\_modules/@types/node/globals.d.ts:51
67
67
 
68
68
  Creates a `.stack` property on `targetObject`, which when accessed returns
69
69
  a string representing the location in the code at which
@@ -132,7 +132,7 @@ Error.captureStackTrace
132
132
  static prepareStackTrace(err, stackTraces): any;
133
133
  ```
134
134
 
135
- Defined in: node\_modules/.pnpm/@types+node@25.0.9/node\_modules/@types/node/globals.d.ts:55
135
+ Defined in: node\_modules/.pnpm/@types+node@25.2.1/node\_modules/@types/node/globals.d.ts:55
136
136
 
137
137
  ###### Parameters
138
138
 
@@ -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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L55)
162
+ Defined in: [packages/client/src/client.ts:55](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L202)
180
+ Defined in: [packages/client/src/client.ts:202](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L108)
197
+ Defined in: [packages/client/src/client.ts:108](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L73)
226
+ Defined in: [packages/client/src/client.ts:73](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/types.ts#L37)
261
+ Defined in: [packages/client/src/types.ts:41](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/packages/client/src/types.ts#L41)
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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L39)
280
+ Defined in: [packages/client/src/client.ts:39](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/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) |
294
+ | <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | - | [packages/client/src/client.ts:42](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L27)
308
+ Defined in: [packages/client/src/client.ts:27](https://github.com/btravers/amqp-contract/blob/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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/69a6467d137997be809af2ea5c4332c378579b49/packages/client/src/client.ts#L33) |
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/a7c4b48f76ed6c3c5c7a9d457229c7ba475af3b1/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.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Client utilities for publishing messages using amqp-contract",
5
5
  "keywords": [
6
6
  "amqp",
@@ -53,22 +53,22 @@
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.13.0",
57
- "@amqp-contract/core": "0.13.0"
56
+ "@amqp-contract/contract": "0.15.0",
57
+ "@amqp-contract/core": "0.15.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/amqplib": "0.10.8",
61
- "@types/node": "25.0.9",
62
- "@vitest/coverage-v8": "4.0.17",
61
+ "@types/node": "25.2.1",
62
+ "@vitest/coverage-v8": "4.0.18",
63
63
  "amqp-connection-manager": "5.0.0",
64
64
  "amqplib": "0.10.9",
65
- "tsdown": "0.19.0",
65
+ "tsdown": "0.20.3",
66
66
  "typedoc": "0.28.16",
67
67
  "typedoc-plugin-markdown": "4.9.0",
68
68
  "typescript": "5.9.3",
69
- "vitest": "4.0.17",
70
- "zod": "4.3.5",
71
- "@amqp-contract/testing": "0.13.0",
69
+ "vitest": "4.0.18",
70
+ "zod": "4.3.6",
71
+ "@amqp-contract/testing": "0.15.0",
72
72
  "@amqp-contract/tsconfig": "0.1.0",
73
73
  "@amqp-contract/typedoc": "0.1.0"
74
74
  },