@palmetto/nestjs-pubsub 1.0.8 → 2.0.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/README.md +1 -1
- package/dist/pubsub-module.js +9 -7
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ const MyModelConfig: RabbitQueueExchangeConfiguration = {
|
|
|
52
52
|
name: "my-model",
|
|
53
53
|
schema: MyModelSchema,
|
|
54
54
|
transport: RABBITMQ_TRANSPORT,
|
|
55
|
-
|
|
55
|
+
exchangeType: "direct",
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
// MyOtherModel* objects define another model you are publishing or subscribing, this time using BullMq
|
package/dist/pubsub-module.js
CHANGED
|
@@ -17,6 +17,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
17
17
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
|
+
var PubSubManager_1;
|
|
20
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
22
|
exports.PubSubModule = void 0;
|
|
22
23
|
const pubsub_1 = require("@palmetto/pubsub");
|
|
@@ -32,25 +33,26 @@ function isSubscriberProvider(obj) {
|
|
|
32
33
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
33
34
|
return (obj === null || obj === void 0 ? void 0 : obj.startSubscribe) !== undefined;
|
|
34
35
|
}
|
|
35
|
-
let PubSubManager = class PubSubManager {
|
|
36
|
+
let PubSubManager = PubSubManager_1 = class PubSubManager {
|
|
36
37
|
constructor(discover, publisher, subscriber, pubSubFactory) {
|
|
37
38
|
this.discover = discover;
|
|
38
39
|
this.publisher = publisher;
|
|
39
40
|
this.subscriber = subscriber;
|
|
40
41
|
this.pubSubFactory = pubSubFactory;
|
|
41
|
-
this.logger = new common_1.Logger(
|
|
42
|
+
this.logger = new common_1.Logger(PubSubManager_1.name);
|
|
42
43
|
this.bootstrapped = false;
|
|
44
|
+
this.logger.debug("initialized");
|
|
43
45
|
}
|
|
44
46
|
beforeApplicationShutdown() {
|
|
45
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
this.logger.debug(
|
|
48
|
+
this.logger.debug("Stopping subscribers");
|
|
47
49
|
yield this.subscriber.unsubscribe();
|
|
48
|
-
this.logger.debug(
|
|
50
|
+
this.logger.debug("Closing subscriber");
|
|
49
51
|
yield this.subscriber.close();
|
|
50
|
-
this.logger.debug(
|
|
52
|
+
this.logger.debug("Closing publisher");
|
|
51
53
|
yield this.publisher.close();
|
|
52
54
|
this.bootstrapped = false;
|
|
53
|
-
this.logger.debug(
|
|
55
|
+
this.logger.debug("shutdown");
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
onApplicationBootstrap() {
|
|
@@ -78,7 +80,7 @@ let PubSubManager = class PubSubManager {
|
|
|
78
80
|
});
|
|
79
81
|
}
|
|
80
82
|
};
|
|
81
|
-
PubSubManager = __decorate([
|
|
83
|
+
PubSubManager = PubSubManager_1 = __decorate([
|
|
82
84
|
(0, common_1.Injectable)(),
|
|
83
85
|
__metadata("design:paramtypes", [nestjs_discovery_1.DiscoveryService,
|
|
84
86
|
pubsub_1.Publisher,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@palmetto/nestjs-pubsub",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"main": "./dist/main.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "yarn run -T eslint --fix ./src",
|
|
@@ -23,13 +23,15 @@
|
|
|
23
23
|
"@nestjs/common": "^11.1.3",
|
|
24
24
|
"@nestjs/core": "^11.1.3",
|
|
25
25
|
"@nestjs/testing": "^11.1.5",
|
|
26
|
+
"@palmetto/nestjs-errors": "^2.2.1",
|
|
27
|
+
"@palmetto/pubsub": "^2.0.0",
|
|
26
28
|
"@swc/core": "^1.13.3",
|
|
27
29
|
"@types/node": "^24.2.1",
|
|
28
30
|
"@vitest/coverage-v8": "^3.2.4",
|
|
29
31
|
"typescript": "5.7.3",
|
|
30
32
|
"unplugin-swc": "^1.5.6",
|
|
31
33
|
"vitest": "^3.2.4",
|
|
32
|
-
"zod": "^4.
|
|
34
|
+
"zod": "^4.1.13"
|
|
33
35
|
},
|
|
34
36
|
"files": [
|
|
35
37
|
"dist/**/*",
|
|
@@ -43,14 +45,14 @@
|
|
|
43
45
|
},
|
|
44
46
|
"dependencies": {
|
|
45
47
|
"@golevelup/nestjs-discovery": "^5.0.0",
|
|
46
|
-
"@palmetto/nestjs-errors": "^2.2.1",
|
|
47
|
-
"@palmetto/pubsub": "^1.0.7",
|
|
48
48
|
"reflect-metadata": "^0.2.2",
|
|
49
49
|
"rxjs": "^7.8.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0",
|
|
53
53
|
"@nestjs/core": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0",
|
|
54
|
-
"
|
|
54
|
+
"@palmetto/nestjs-errors": "^2.2.1",
|
|
55
|
+
"@palmetto/pubsub": "^2.0.0",
|
|
56
|
+
"zod": "^4.1.13"
|
|
55
57
|
}
|
|
56
58
|
}
|