@seidor-cloud-produtos/orbit-backend-lib 2.0.81 → 2.0.83

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.
@@ -2,5 +2,10 @@ import Queue from './queue';
2
2
  export default interface QueueConnection extends Queue {
3
3
  connect(props: unknown): Promise<any>;
4
4
  close(): Promise<void>;
5
+ /**
6
+ *
7
+ * @deprecated Use createQueues() instead.
8
+ */
5
9
  createConsumers?<T>(queueName: string, configs: T | any): Promise<void>;
10
+ createQueues?<T>(queueName: string, configs: T | any): Promise<void>;
6
11
  }
@@ -29,7 +29,7 @@ class LoggerOrbit extends logger_1.default {
29
29
  async register(props, data) {
30
30
  try {
31
31
  const payload = this.buildPayload(props, data);
32
- await this.queue.publish('logservice.common.direct', new LogEvent(payload));
32
+ await this.queue.publish('log-service.direct', new LogEvent(payload));
33
33
  }
34
34
  catch (error) {
35
35
  if (this.options?.retryStrategy) {
@@ -3,6 +3,10 @@ export interface IConsumer {
3
3
  queueName: string;
4
4
  configs: any;
5
5
  }
6
+ /**
7
+ *
8
+ * @deprecated Use CreateQueues instead.
9
+ */
6
10
  export default abstract class CreateConsumers {
7
11
  readonly queue: QueueConnection;
8
12
  protected abstract consumers: IConsumer[];
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ *
5
+ * @deprecated Use CreateQueues instead.
6
+ */
3
7
  class CreateConsumers {
4
8
  queue;
5
9
  constructor(queue) {
@@ -0,0 +1,11 @@
1
+ import QueueConnection from '../../application/queue/queue-connection';
2
+ export interface IQueueProps {
3
+ name: string;
4
+ configs: any;
5
+ }
6
+ export default abstract class CreateQueues {
7
+ readonly queue: QueueConnection;
8
+ protected abstract queues: IQueueProps[];
9
+ constructor(queue: QueueConnection);
10
+ createQueues(): Promise<void>;
11
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class CreateQueues {
4
+ queue;
5
+ constructor(queue) {
6
+ this.queue = queue;
7
+ }
8
+ async createQueues() {
9
+ if (!this.queue.createQueues) {
10
+ return;
11
+ }
12
+ for (const queue of this.queues) {
13
+ await this.queue.createQueues(queue.name, queue.configs);
14
+ }
15
+ }
16
+ }
17
+ exports.default = CreateQueues;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seidor-cloud-produtos/orbit-backend-lib",
3
- "version": "2.0.81",
3
+ "version": "2.0.83",
4
4
  "description": "Internal lib for backend components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",