@palmetto/nestjs-pubsub 1.0.6 → 1.0.8

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 CHANGED
@@ -27,12 +27,27 @@ yarn add bullmq
27
27
  ### Add to your `AppModule` imports
28
28
 
29
29
  ```ts
30
+ import {
31
+ RABBITMQ_TRANSPORT,
32
+ RabbitQueueExchangeConfiguration,
33
+ BULLMQ_TRANSPORT,
34
+ BullMqQueueConfiguration,
35
+ IdMetaSchema,
36
+ Publisher,
37
+ } from "@palmetto/pubsub";
38
+
39
+ import { EventSubscriber } from "@palmetto/nestjs-pubsub";
40
+
41
+ import { Injectable, Module } from "@nestjs/common";
42
+
43
+ import { z } from "zod";
44
+
30
45
  // MyModel* objects define the model you are publishing or subscribing using RabbitMq
31
46
  const MyModelSchema = IdMetaSchema.extend({
32
- message: z4.string(),
33
- value: z4.int(),
47
+ message: z.string(),
48
+ value: z.int(),
34
49
  });
35
- type MyModel = z4.infer<typeof MyModelSchema>;
50
+ type MyModel = z.infer<typeof MyModelSchema>;
36
51
  const MyModelConfig: RabbitQueueExchangeConfiguration = {
37
52
  name: "my-model",
38
53
  schema: MyModelSchema,
@@ -42,11 +57,11 @@ const MyModelConfig: RabbitQueueExchangeConfiguration = {
42
57
 
43
58
  // MyOtherModel* objects define another model you are publishing or subscribing, this time using BullMq
44
59
  const MyOtherModelSchema = IdMetaSchema.extend({
45
- message: z4.string(),
46
- values: z4.int().array(),
60
+ message: z.string(),
61
+ values: z.int().array(),
47
62
  });
48
- type MyOtherModel = z4.infer<typeof MyOtherModelSchema>;
49
- const MyOtherModelConfig: RabbitQueueExchangeConfiguration = {
63
+ type MyOtherModel = z.infer<typeof MyOtherModelSchema>;
64
+ const MyOtherModelConfig: BullMqQueueConfiguration = {
50
65
  name: "my-other-model",
51
66
  schema: MyOtherModelSchema,
52
67
  transport: BULLMQ_TRANSPORT,
@@ -97,3 +112,7 @@ class MyModelHandler {
97
112
  })
98
113
  export class AppModule {}
99
114
  ```
115
+
116
+ ### pubsub
117
+
118
+ For details about pubsub, see [@palmetto/pubsub readme](../pubsub/README.md)
package/dist/main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from "./pubsub-module.js";
2
2
  export * from "./pubsub-bullmq-module.js";
3
3
  export * from "./pubsub-rabbitmq-module.js";
4
- export { EventSubcriber } from "./subscriber.js";
4
+ export { EventSubscriber } from "./subscriber.js";
package/dist/main.js CHANGED
@@ -14,9 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.EventSubcriber = void 0;
17
+ exports.EventSubscriber = void 0;
18
18
  __exportStar(require("./pubsub-module.js"), exports);
19
19
  __exportStar(require("./pubsub-bullmq-module.js"), exports);
20
20
  __exportStar(require("./pubsub-rabbitmq-module.js"), exports);
21
21
  var subscriber_js_1 = require("./subscriber.js");
22
- Object.defineProperty(exports, "EventSubcriber", { enumerable: true, get: function () { return subscriber_js_1.EventSubcriber; } });
22
+ Object.defineProperty(exports, "EventSubscriber", { enumerable: true, get: function () { return subscriber_js_1.EventSubscriber; } });
@@ -1,3 +1,3 @@
1
- import { PubSubConfiguration } from "@palmetto/pubsub";
1
+ import { BullMqQueueConfiguration, PubSubConfiguration, RabbitQueueExchangeConfiguration } from "@palmetto/pubsub";
2
2
  export declare const EVENT_HANDLER: unique symbol;
3
- export declare const EventSubcriber: (config: PubSubConfiguration) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
3
+ export declare const EventSubscriber: (config: PubSubConfiguration | RabbitQueueExchangeConfiguration | BullMqQueueConfiguration) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EventSubcriber = exports.EVENT_HANDLER = void 0;
3
+ exports.EventSubscriber = exports.EVENT_HANDLER = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  exports.EVENT_HANDLER = Symbol("EVENT_HANDLER");
6
6
  const makePubSubDecorator = () => (config) => (0, common_1.applyDecorators)((0, common_1.SetMetadata)(exports.EVENT_HANDLER, Object.assign({}, config)));
7
- exports.EventSubcriber = makePubSubDecorator();
7
+ exports.EventSubscriber = makePubSubDecorator();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palmetto/nestjs-pubsub",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "main": "./dist/main.js",
5
5
  "scripts": {
6
6
  "lint": "yarn run -T eslint --fix ./src",
@@ -44,7 +44,7 @@
44
44
  "dependencies": {
45
45
  "@golevelup/nestjs-discovery": "^5.0.0",
46
46
  "@palmetto/nestjs-errors": "^2.2.1",
47
- "@palmetto/pubsub": "^1.0.5",
47
+ "@palmetto/pubsub": "^1.0.7",
48
48
  "reflect-metadata": "^0.2.2",
49
49
  "rxjs": "^7.8.2"
50
50
  },