@amqp-contract/client-nestjs 0.3.0 → 0.3.2
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.d.cts +3 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.mts.map +1 -1
- package/docs/index.md +31 -12
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { ContractDefinition, InferPublisherNames } from "@amqp-contract/contract
|
|
|
4
4
|
import { Options } from "amqplib";
|
|
5
5
|
import { Future, Result } from "@swan-io/boxed";
|
|
6
6
|
import { AmqpConnectionManagerOptions, ConnectionUrl } from "amqp-connection-manager";
|
|
7
|
-
import { ClientInferPublisherInput, MessageValidationError, TechnicalError } from "@amqp-contract/client";
|
|
7
|
+
import { ClientInferPublisherInput, ClientInferPublisherInput as ClientInferPublisherInput$1, MessageValidationError, TechnicalError } from "@amqp-contract/client";
|
|
8
8
|
|
|
9
9
|
//#region src/client.service.d.ts
|
|
10
10
|
|
|
@@ -121,7 +121,7 @@ declare class AmqpClientService<TContract extends ContractDefinition> implements
|
|
|
121
121
|
* }
|
|
122
122
|
* ```
|
|
123
123
|
*/
|
|
124
|
-
publish<TName extends InferPublisherNames<TContract>>(publisherName: TName, message: ClientInferPublisherInput<TContract, TName>, options?: Options.Publish): Future<Result<boolean, TechnicalError | MessageValidationError>>;
|
|
124
|
+
publish<TName extends InferPublisherNames<TContract>>(publisherName: TName, message: ClientInferPublisherInput$1<TContract, TName>, options?: Options.Publish): Future<Result<boolean, TechnicalError | MessageValidationError>>;
|
|
125
125
|
}
|
|
126
126
|
//#endregion
|
|
127
127
|
//#region src/client.module-definition.d.ts
|
|
@@ -139,5 +139,5 @@ declare const ConfigurableModuleClass: _nestjs_common0.ConfigurableModuleCls<Amq
|
|
|
139
139
|
*/
|
|
140
140
|
declare class AmqpClientModule extends ConfigurableModuleClass {}
|
|
141
141
|
//#endregion
|
|
142
|
-
export { AmqpClientModule, type AmqpClientModuleOptions, AmqpClientService, MODULE_OPTIONS_TOKEN };
|
|
142
|
+
export { AmqpClientModule, type AmqpClientModuleOptions, AmqpClientService, type ClientInferPublisherInput, MODULE_OPTIONS_TOKEN };
|
|
143
143
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/client.service.ts","../src/client.module-definition.ts","../src/client.module.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA6BA;;;;;;AAuDA;;;;;;;AA+DwB,UAtHP,uBAsHO,CAAA,kBAtHmC,kBAsHnC,CAAA,CAAA;EACL;EACoB,QAAA,EAtH3B,SAsH2B;EAAW;EAArC,IAAA,EApHL,aAoHK,EAAA;EACC;EACc,iBAAA,CAAA,EApHN,4BAoHM,GAAA,SAAA;;;;;;;;;;AC/I5B;;;;;;;;;ACCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cF4Ea,oCAAoC,+BACpC,cAAc;;;uBAMG,wBAAwB;;;;;;;;kBAU9B;;;;;;;;qBAeG;;;;;;;;;;;;;;;;;;;;;;;;wBA8BH,oBAAoB,2BACzB,gBACN,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/client.service.ts","../src/client.module-definition.ts","../src/client.module.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA6BA;;;;;;AAuDA;;;;;;;AA+DwB,UAtHP,uBAsHO,CAAA,kBAtHmC,kBAsHnC,CAAA,CAAA;EACL;EACoB,QAAA,EAtH3B,SAsH2B;EAAW;EAArC,IAAA,EApHL,aAoHK,EAAA;EACC;EACc,iBAAA,CAAA,EApHN,4BAoHM,GAAA,SAAA;;;;;;;;;;AC/I5B;;;;;;;;;ACCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cF4Ea,oCAAoC,+BACpC,cAAc;;;uBAMG,wBAAwB;;;;;;;;kBAU9B;;;;;;;;qBAeG;;;;;;;;;;;;;;;;;;;;;;;;wBA8BH,oBAAoB,2BACzB,gBACN,4BAA0B,WAAW,kBACpC,OAAA,CAAQ,UACjB,OAAO,gBAAgB,iBAAiB;;;;;;;;cC/I9B,yBAAuB,eAAA,CAAA,sBAAA,wBAAA;;;;;;;;cCKzB,gBAAA,SAAyB,uBAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _nestjs_common0 from "@nestjs/common";
|
|
2
2
|
import { OnModuleDestroy, OnModuleInit } from "@nestjs/common";
|
|
3
|
-
import { ClientInferPublisherInput, MessageValidationError, TechnicalError } from "@amqp-contract/client";
|
|
3
|
+
import { ClientInferPublisherInput, ClientInferPublisherInput as ClientInferPublisherInput$1, MessageValidationError, TechnicalError } from "@amqp-contract/client";
|
|
4
4
|
import { ContractDefinition, InferPublisherNames } from "@amqp-contract/contract";
|
|
5
5
|
import { Options } from "amqplib";
|
|
6
6
|
import { Future, Result } from "@swan-io/boxed";
|
|
@@ -121,7 +121,7 @@ declare class AmqpClientService<TContract extends ContractDefinition> implements
|
|
|
121
121
|
* }
|
|
122
122
|
* ```
|
|
123
123
|
*/
|
|
124
|
-
publish<TName extends InferPublisherNames<TContract>>(publisherName: TName, message: ClientInferPublisherInput<TContract, TName>, options?: Options.Publish): Future<Result<boolean, TechnicalError | MessageValidationError>>;
|
|
124
|
+
publish<TName extends InferPublisherNames<TContract>>(publisherName: TName, message: ClientInferPublisherInput$1<TContract, TName>, options?: Options.Publish): Future<Result<boolean, TechnicalError | MessageValidationError>>;
|
|
125
125
|
}
|
|
126
126
|
//#endregion
|
|
127
127
|
//#region src/client.module-definition.d.ts
|
|
@@ -139,5 +139,5 @@ declare const ConfigurableModuleClass: _nestjs_common0.ConfigurableModuleCls<Amq
|
|
|
139
139
|
*/
|
|
140
140
|
declare class AmqpClientModule extends ConfigurableModuleClass {}
|
|
141
141
|
//#endregion
|
|
142
|
-
export { AmqpClientModule, type AmqpClientModuleOptions, AmqpClientService, MODULE_OPTIONS_TOKEN };
|
|
142
|
+
export { AmqpClientModule, type AmqpClientModuleOptions, AmqpClientService, type ClientInferPublisherInput, MODULE_OPTIONS_TOKEN };
|
|
143
143
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/client.service.ts","../src/client.module-definition.ts","../src/client.module.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA6BA;;;;;;AAuDA;;;;;;;AA+DwB,UAtHP,uBAsHO,CAAA,kBAtHmC,kBAsHnC,CAAA,CAAA;EACL;EACoB,QAAA,EAtH3B,SAsH2B;EAAW;EAArC,IAAA,EApHL,aAoHK,EAAA;EACC;EACc,iBAAA,CAAA,EApHN,4BAoHM,GAAA,SAAA;;;;;;;;;;AC/I5B;;;;;;;;;ACCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cF4Ea,oCAAoC,+BACpC,cAAc;;;uBAMG,wBAAwB;;;;;;;;kBAU9B;;;;;;;;qBAeG;;;;;;;;;;;;;;;;;;;;;;;;wBA8BH,oBAAoB,2BACzB,gBACN,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/client.service.ts","../src/client.module-definition.ts","../src/client.module.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA6BA;;;;;;AAuDA;;;;;;;AA+DwB,UAtHP,uBAsHO,CAAA,kBAtHmC,kBAsHnC,CAAA,CAAA;EACL;EACoB,QAAA,EAtH3B,SAsH2B;EAAW;EAArC,IAAA,EApHL,aAoHK,EAAA;EACC;EACc,iBAAA,CAAA,EApHN,4BAoHM,GAAA,SAAA;;;;;;;;;;AC/I5B;;;;;;;;;ACCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cF4Ea,oCAAoC,+BACpC,cAAc;;;uBAMG,wBAAwB;;;;;;;;kBAU9B;;;;;;;;qBAeG;;;;;;;;;;;;;;;;;;;;;;;;wBA8BH,oBAAoB,2BACzB,gBACN,4BAA0B,WAAW,kBACpC,OAAA,CAAQ,UACjB,OAAO,gBAAgB,iBAAiB;;;;;;;;cC/I9B,yBAAuB,eAAA,CAAA,sBAAA,wBAAA;;;;;;;;cCKzB,gBAAA,SAAyB,uBAAA"}
|
package/docs/index.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
### AmqpClientModule
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/client-nestjs/src/client.module.ts:14](https://github.com/btravers/amqp-contract/blob/
|
|
11
|
+
Defined in: [packages/client-nestjs/src/client.module.ts:14](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.module.ts#L14)
|
|
12
12
|
|
|
13
13
|
NestJS module for AMQP client integration
|
|
14
14
|
This module provides type-safe AMQP client functionality using @amqp-contract/client
|
|
@@ -55,7 +55,7 @@ ConfigurableModuleClass.constructor
|
|
|
55
55
|
|
|
56
56
|
### AmqpClientService
|
|
57
57
|
|
|
58
|
-
Defined in: [packages/client-nestjs/src/client.service.ts:86](https://github.com/btravers/amqp-contract/blob/
|
|
58
|
+
Defined in: [packages/client-nestjs/src/client.service.ts:86](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.service.ts#L86)
|
|
59
59
|
|
|
60
60
|
Type-safe AMQP client service for NestJS applications.
|
|
61
61
|
|
|
@@ -120,7 +120,7 @@ export class OrderService {
|
|
|
120
120
|
new AmqpClientService<TContract>(options): AmqpClientService<TContract>;
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
-
Defined in: [packages/client-nestjs/src/client.service.ts:91](https://github.com/btravers/amqp-contract/blob/
|
|
123
|
+
Defined in: [packages/client-nestjs/src/client.service.ts:91](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.service.ts#L91)
|
|
124
124
|
|
|
125
125
|
###### Parameters
|
|
126
126
|
|
|
@@ -140,7 +140,7 @@ Defined in: [packages/client-nestjs/src/client.service.ts:91](https://github.com
|
|
|
140
140
|
onModuleDestroy(): Promise<void>;
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
Defined in: [packages/client-nestjs/src/client.service.ts:118](https://github.com/btravers/amqp-contract/blob/
|
|
143
|
+
Defined in: [packages/client-nestjs/src/client.service.ts:118](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.service.ts#L118)
|
|
144
144
|
|
|
145
145
|
Close the AMQP client when the NestJS module is destroyed.
|
|
146
146
|
|
|
@@ -164,7 +164,7 @@ OnModuleDestroy.onModuleDestroy
|
|
|
164
164
|
onModuleInit(): Promise<void>;
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
Defined in: [packages/client-nestjs/src/client.service.ts:103](https://github.com/btravers/amqp-contract/blob/
|
|
167
|
+
Defined in: [packages/client-nestjs/src/client.service.ts:103](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.service.ts#L103)
|
|
168
168
|
|
|
169
169
|
Initialize the AMQP client when the NestJS module starts.
|
|
170
170
|
|
|
@@ -191,7 +191,7 @@ publish<TName>(
|
|
|
191
191
|
options?): Future<Result<boolean, TechnicalError | MessageValidationError>>;
|
|
192
192
|
```
|
|
193
193
|
|
|
194
|
-
Defined in: [packages/client-nestjs/src/client.service.ts:148](https://github.com/btravers/amqp-contract/blob/
|
|
194
|
+
Defined in: [packages/client-nestjs/src/client.service.ts:148](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.service.ts#L148)
|
|
195
195
|
|
|
196
196
|
Publish a message using a contract-defined publisher.
|
|
197
197
|
|
|
@@ -209,7 +209,7 @@ and explicit error handling through the Result type.
|
|
|
209
209
|
| Parameter | Type | Description |
|
|
210
210
|
| ------ | ------ | ------ |
|
|
211
211
|
| `publisherName` | `TName` | The name of the publisher from the contract |
|
|
212
|
-
| `message` | `ClientInferPublisherInput
|
|
212
|
+
| `message` | [`ClientInferPublisherInput`](#clientinferpublisherinput)\<`TContract`, `TName`\> | The message payload (type-checked against the contract) |
|
|
213
213
|
| `options?` | `Publish` | Optional AMQP publish options (e.g., persistence, headers) |
|
|
214
214
|
|
|
215
215
|
###### Returns
|
|
@@ -235,7 +235,7 @@ if (result.isError()) {
|
|
|
235
235
|
|
|
236
236
|
### AmqpClientModuleOptions
|
|
237
237
|
|
|
238
|
-
Defined in: [packages/client-nestjs/src/client.service.ts:30](https://github.com/btravers/amqp-contract/blob/
|
|
238
|
+
Defined in: [packages/client-nestjs/src/client.service.ts:30](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.service.ts#L30)
|
|
239
239
|
|
|
240
240
|
Configuration options for the AMQP client NestJS module.
|
|
241
241
|
|
|
@@ -261,9 +261,28 @@ const options: AmqpClientModuleOptions<typeof contract> = {
|
|
|
261
261
|
|
|
262
262
|
| Property | Type | Description | Defined in |
|
|
263
263
|
| ------ | ------ | ------ | ------ |
|
|
264
|
-
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | Optional connection configuration (heartbeat, reconnect settings, etc.) | [packages/client-nestjs/src/client.service.ts:36](https://github.com/btravers/amqp-contract/blob/
|
|
265
|
-
| <a id="contract"></a> `contract` | `TContract` | The AMQP contract definition specifying publishers and their message schemas | [packages/client-nestjs/src/client.service.ts:32](https://github.com/btravers/amqp-contract/blob/
|
|
266
|
-
| <a id="urls"></a> `urls` | `ConnectionUrl`[] | AMQP broker URL(s). Multiple URLs provide failover support | [packages/client-nestjs/src/client.service.ts:34](https://github.com/btravers/amqp-contract/blob/
|
|
264
|
+
| <a id="connectionoptions"></a> `connectionOptions?` | `AmqpConnectionManagerOptions` | Optional connection configuration (heartbeat, reconnect settings, etc.) | [packages/client-nestjs/src/client.service.ts:36](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.service.ts#L36) |
|
|
265
|
+
| <a id="contract"></a> `contract` | `TContract` | The AMQP contract definition specifying publishers and their message schemas | [packages/client-nestjs/src/client.service.ts:32](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.service.ts#L32) |
|
|
266
|
+
| <a id="urls"></a> `urls` | `ConnectionUrl`[] | AMQP broker URL(s). Multiple URLs provide failover support | [packages/client-nestjs/src/client.service.ts:34](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.service.ts#L34) |
|
|
267
|
+
|
|
268
|
+
## Type Aliases
|
|
269
|
+
|
|
270
|
+
### ClientInferPublisherInput
|
|
271
|
+
|
|
272
|
+
```ts
|
|
273
|
+
type ClientInferPublisherInput<TContract, TName> = PublisherInferInput<InferPublisher<TContract, TName>>;
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Defined in: packages/client/dist/index.d.mts:52
|
|
277
|
+
|
|
278
|
+
Infer publisher input type (message payload) for a specific publisher in a contract
|
|
279
|
+
|
|
280
|
+
#### Type Parameters
|
|
281
|
+
|
|
282
|
+
| Type Parameter |
|
|
283
|
+
| ------ |
|
|
284
|
+
| `TContract` *extends* `ContractDefinition` |
|
|
285
|
+
| `TName` *extends* `InferPublisherNames`\<`TContract`\> |
|
|
267
286
|
|
|
268
287
|
## Variables
|
|
269
288
|
|
|
@@ -273,4 +292,4 @@ const options: AmqpClientModuleOptions<typeof contract> = {
|
|
|
273
292
|
MODULE_OPTIONS_TOKEN: string | symbol;
|
|
274
293
|
```
|
|
275
294
|
|
|
276
|
-
Defined in: [packages/client-nestjs/src/client.module-definition.ts:9](https://github.com/btravers/amqp-contract/blob/
|
|
295
|
+
Defined in: [packages/client-nestjs/src/client.module-definition.ts:9](https://github.com/btravers/amqp-contract/blob/2e0e3a372088cd269fea97fb73812491d1fc5e14/packages/client-nestjs/src/client.module-definition.ts#L9)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amqp-contract/client-nestjs",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "NestJS integration for @amqp-contract/client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"amqp",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"docs"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@amqp-contract/client": "0.3.
|
|
47
|
-
"@amqp-contract/contract": "0.3.
|
|
46
|
+
"@amqp-contract/client": "0.3.2",
|
|
47
|
+
"@amqp-contract/contract": "0.3.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@nestjs/common": "11.1.10",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"reflect-metadata": "0.2.2",
|
|
58
58
|
"rxjs": "7.8.2",
|
|
59
59
|
"tsdown": "0.18.2",
|
|
60
|
-
"typedoc": "0.28.
|
|
60
|
+
"typedoc": "0.28.15",
|
|
61
61
|
"typedoc-plugin-markdown": "4.9.0",
|
|
62
62
|
"typescript": "5.9.3",
|
|
63
63
|
"vitest": "4.0.16",
|