@seidor-cloud-produtos/orbit-backend-lib 2.0.25 → 2.0.27

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.
@@ -39,7 +39,7 @@ class ExpressAdapter {
39
39
  }
40
40
  async listen(port) {
41
41
  this.server = this.instance.listen(port, () => {
42
- if (this.envs.NODE_ENV !== 'test') {
42
+ if (this.envs?.NODE_ENV !== 'test') {
43
43
  console.log(`🚀 Server is running on PORT ${port}`);
44
44
  }
45
45
  });
@@ -41,7 +41,7 @@ class FastifyAdapter {
41
41
  process.exit();
42
42
  }
43
43
  await this.instance?.ready();
44
- if (this.envs.NODE_ENV !== 'test') {
44
+ if (this.envs?.NODE_ENV !== 'test') {
45
45
  console.log(`🚀 Server is running on PORT ${port}`);
46
46
  }
47
47
  });
@@ -26,7 +26,7 @@ class LoggerInMemory extends logger_1.default {
26
26
  console.warn(error, props);
27
27
  }
28
28
  debug() {
29
- if (env_1.env.LOG_LEVEL === types_1.LOG_LEVEL.debug)
29
+ if (env_1.env?.LOG_LEVEL === types_1.LOG_LEVEL.debug)
30
30
  return this;
31
31
  return undefined;
32
32
  }
@@ -8,7 +8,7 @@ export declare class RabbitMQScaledJobRunner<T = any> {
8
8
  private readonly amqpQueue;
9
9
  private readonly queueName;
10
10
  private readonly handler;
11
- private readonly options;
11
+ private options;
12
12
  constructor(amqpQueue: AmqpQueue, queueName: string, handler: Handler, options?: IRunnerOptions);
13
13
  private setOptions;
14
14
  private handleError;
@@ -15,11 +15,13 @@ class RabbitMQScaledJobRunner {
15
15
  this.setOptions(options);
16
16
  }
17
17
  setOptions(options) {
18
- this.options.errorStrategy = options?.errorStrategy || 'nack-dlq';
19
- this.options.manualAck = options?.manualAck || true;
20
- this.options.parse =
21
- options?.parse || (raw => JSON.parse(raw.content.toString()));
22
- this.options.timeoutMs = options?.timeoutMs || 10000;
18
+ this.options = {
19
+ errorStrategy: options?.errorStrategy || 'nack-dlq',
20
+ manualAck: options?.manualAck || true,
21
+ parse: options?.parse ||
22
+ (raw => JSON.parse(raw.content.toString())),
23
+ timeoutMs: options?.timeoutMs || 10000,
24
+ };
23
25
  }
24
26
  async handleError(error, getResult) {
25
27
  if (!getResult) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seidor-cloud-produtos/orbit-backend-lib",
3
- "version": "2.0.25",
3
+ "version": "2.0.27",
4
4
  "description": "Internal lib for backend components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",