@seidor-cloud-produtos/orbit-backend-lib 2.0.114 → 2.0.116

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.
@@ -6,7 +6,7 @@ function handleAuthorizerHeaders(headers) {
6
6
  userName: headers.username,
7
7
  userEmail: headers.useremail,
8
8
  appName: headers['app-name'],
9
- entityId: headers.userid || headers['app-id'] || headers.useremail,
9
+ entityId: headers['app-id'] || headers.userid || headers.useremail,
10
10
  tenantId: headers.tenantid,
11
11
  traceId: headers['x-trace-id'],
12
12
  };
@@ -230,7 +230,7 @@ class AmqpQueue {
230
230
  }
231
231
  try {
232
232
  const promises = [
233
- this.publishToServerWaitForConfirms(exchangeName, domainEvent, buildedConfigs)
233
+ this.publishToServerWaitForConfirms(exchangeName, domainEvent, buildedConfigs),
234
234
  ];
235
235
  if (this.socketOptions?.timeoutSeconds) {
236
236
  promises.push(AmqpQueue.delayOperation(this.socketOptions.timeoutSeconds));
@@ -349,6 +349,12 @@ class AmqpQueue {
349
349
  async treatReconnection(vHost) {
350
350
  this.logger.info('⛔ Connection Error!!');
351
351
  this.logger.info(`🔄 Try connection to the vHost ${vHost}`);
352
+ try {
353
+ await this.close();
354
+ }
355
+ catch (error) {
356
+ this.logger.error('⛔ Error while closing the connection');
357
+ }
352
358
  AmqpQueue.instance = await this.connect(vHost);
353
359
  await this.reconnectionChannels();
354
360
  await this.publishMessagesOfMemory();
@@ -21,7 +21,7 @@ exports.headersDefaultWithUserId = zod_1.z.object({
21
21
  tenantid: zod_1.z.string().uuid(),
22
22
  username: zod_1.z.string(),
23
23
  useremail: zod_1.z.string(),
24
- userid: zod_1.z.string().uuid(),
24
+ userid: zod_1.z.string(),
25
25
  });
26
26
  exports.tenantIdSchema = zod_1.z.object({
27
27
  tenantid: zod_1.z.string().uuid(),
@@ -29,7 +29,7 @@ exports.tenantIdSchema = zod_1.z.object({
29
29
  exports.userSchema = zod_1.z.object({
30
30
  username: zod_1.z.string(),
31
31
  useremail: zod_1.z.string().email(),
32
- userid: zod_1.z.string().uuid().optional(),
32
+ userid: zod_1.z.string().optional(),
33
33
  });
34
34
  exports.appSchema = zod_1.z.object({
35
35
  ['app-name']: zod_1.z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seidor-cloud-produtos/orbit-backend-lib",
3
- "version": "2.0.114",
3
+ "version": "2.0.116",
4
4
  "description": "Internal lib for backend components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",