legend-transactional 2.4.1 → 2.5.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/dist/index.d.mts CHANGED
@@ -494,7 +494,7 @@ interface EventPayload {
494
494
  */
495
495
  published_event: string;
496
496
  /**
497
- * Timestamp when the event was published (UNIX timestamp in seconds)
497
+ * Timestamp when the event was published (UNIX timestamp in milliseconds)
498
498
  */
499
499
  published_at: number;
500
500
  /**
@@ -519,7 +519,7 @@ interface EventPayload {
519
519
  */
520
520
  received_event: string;
521
521
  /**
522
- * Timestamp when the event was received (UNIX timestamp in seconds)
522
+ * Timestamp when the event was received (UNIX timestamp in milliseconds)
523
523
  */
524
524
  received_at: number;
525
525
  /**
@@ -548,7 +548,7 @@ interface EventPayload {
548
548
  */
549
549
  processed_event: string;
550
550
  /**
551
- * Timestamp when the event was processed (UNIX timestamp in seconds)
551
+ * Timestamp when the event was processed (UNIX timestamp in milliseconds)
552
552
  */
553
553
  processed_at: number;
554
554
  /**
@@ -577,7 +577,7 @@ interface EventPayload {
577
577
  */
578
578
  rejected_event: string;
579
579
  /**
580
- * Timestamp when the event was rejected (UNIX timestamp in seconds)
580
+ * Timestamp when the event was rejected (UNIX timestamp in milliseconds)
581
581
  */
582
582
  rejected_at: number;
583
583
  /**
package/dist/index.d.ts CHANGED
@@ -494,7 +494,7 @@ interface EventPayload {
494
494
  */
495
495
  published_event: string;
496
496
  /**
497
- * Timestamp when the event was published (UNIX timestamp in seconds)
497
+ * Timestamp when the event was published (UNIX timestamp in milliseconds)
498
498
  */
499
499
  published_at: number;
500
500
  /**
@@ -519,7 +519,7 @@ interface EventPayload {
519
519
  */
520
520
  received_event: string;
521
521
  /**
522
- * Timestamp when the event was received (UNIX timestamp in seconds)
522
+ * Timestamp when the event was received (UNIX timestamp in milliseconds)
523
523
  */
524
524
  received_at: number;
525
525
  /**
@@ -548,7 +548,7 @@ interface EventPayload {
548
548
  */
549
549
  processed_event: string;
550
550
  /**
551
- * Timestamp when the event was processed (UNIX timestamp in seconds)
551
+ * Timestamp when the event was processed (UNIX timestamp in milliseconds)
552
552
  */
553
553
  processed_at: number;
554
554
  /**
@@ -577,7 +577,7 @@ interface EventPayload {
577
577
  */
578
578
  rejected_event: string;
579
579
  /**
580
- * Timestamp when the event was rejected (UNIX timestamp in seconds)
580
+ * Timestamp when the event was rejected (UNIX timestamp in milliseconds)
581
581
  */
582
582
  rejected_at: number;
583
583
  /**
package/dist/index.js CHANGED
@@ -625,7 +625,7 @@ var EventsConsumeChannel = class extends Consume_default {
625
625
  */
626
626
  ackMessage() {
627
627
  this.channel.ack(this.msg, false);
628
- const timestamp = Math.floor(Date.now() / 1e3);
628
+ const timestamp = Date.now();
629
629
  publishAuditEvent(this.channel, "audit.processed", {
630
630
  publisher_microservice: this.publisherMicroservice,
631
631
  processor_microservice: this.processorMicroservice,
@@ -643,7 +643,7 @@ var EventsConsumeChannel = class extends Consume_default {
643
643
  */
644
644
  nackWithDelay(delay = NACKING_DELAY_MS, maxRetries) {
645
645
  const parentNack = super.nackWithDelay(delay, maxRetries);
646
- const timestamp = Math.floor(Date.now() / 1e3);
646
+ const timestamp = Date.now();
647
647
  publishAuditEvent(this.channel, "audit.dead_letter", {
648
648
  publisher_microservice: this.publisherMicroservice,
649
649
  rejector_microservice: this.processorMicroservice,
@@ -664,7 +664,7 @@ var EventsConsumeChannel = class extends Consume_default {
664
664
  */
665
665
  nackWithFibonacciStrategy(maxOccurrence = MAX_OCCURRENCE, maxRetries) {
666
666
  const parentNack = super.nackWithFibonacciStrategy(maxOccurrence, maxRetries);
667
- const timestamp = Math.floor(Date.now() / 1e3);
667
+ const timestamp = Date.now();
668
668
  publishAuditEvent(this.channel, "audit.dead_letter", {
669
669
  publisher_microservice: this.publisherMicroservice,
670
670
  rejector_microservice: this.processorMicroservice,
@@ -721,7 +721,7 @@ var eventCallback = (msg, channel, e, queueName) => {
721
721
  }
722
722
  const receiverMicroservice = extractMicroserviceFromQueue(queueName);
723
723
  const receivedEvent = event[0];
724
- const timestamp = Math.floor(Date.now() / 1e3);
724
+ const timestamp = Date.now();
725
725
  let event_id = msg.properties.messageId;
726
726
  if (!event_id) {
727
727
  console.warn("Message is missing messageId, generating a new UUID v7 for event_id");
@@ -1166,7 +1166,7 @@ var publishEvent = async (msg, event) => {
1166
1166
  messageId,
1167
1167
  appId: publisherMicroservice
1168
1168
  });
1169
- const timestamp = Math.floor(Date.now() / 1e3);
1169
+ const timestamp = Date.now();
1170
1170
  publishAuditEvent(channel, "audit.published", {
1171
1171
  publisher_microservice: publisherMicroservice,
1172
1172
  published_event: event,
package/dist/index.mjs CHANGED
@@ -618,7 +618,7 @@ var EventsConsumeChannel = class extends Consume_default {
618
618
  */
619
619
  ackMessage() {
620
620
  this.channel.ack(this.msg, false);
621
- const timestamp = Math.floor(Date.now() / 1e3);
621
+ const timestamp = Date.now();
622
622
  publishAuditEvent(this.channel, "audit.processed", {
623
623
  publisher_microservice: this.publisherMicroservice,
624
624
  processor_microservice: this.processorMicroservice,
@@ -636,7 +636,7 @@ var EventsConsumeChannel = class extends Consume_default {
636
636
  */
637
637
  nackWithDelay(delay = NACKING_DELAY_MS, maxRetries) {
638
638
  const parentNack = super.nackWithDelay(delay, maxRetries);
639
- const timestamp = Math.floor(Date.now() / 1e3);
639
+ const timestamp = Date.now();
640
640
  publishAuditEvent(this.channel, "audit.dead_letter", {
641
641
  publisher_microservice: this.publisherMicroservice,
642
642
  rejector_microservice: this.processorMicroservice,
@@ -657,7 +657,7 @@ var EventsConsumeChannel = class extends Consume_default {
657
657
  */
658
658
  nackWithFibonacciStrategy(maxOccurrence = MAX_OCCURRENCE, maxRetries) {
659
659
  const parentNack = super.nackWithFibonacciStrategy(maxOccurrence, maxRetries);
660
- const timestamp = Math.floor(Date.now() / 1e3);
660
+ const timestamp = Date.now();
661
661
  publishAuditEvent(this.channel, "audit.dead_letter", {
662
662
  publisher_microservice: this.publisherMicroservice,
663
663
  rejector_microservice: this.processorMicroservice,
@@ -714,7 +714,7 @@ var eventCallback = (msg, channel, e, queueName) => {
714
714
  }
715
715
  const receiverMicroservice = extractMicroserviceFromQueue(queueName);
716
716
  const receivedEvent = event[0];
717
- const timestamp = Math.floor(Date.now() / 1e3);
717
+ const timestamp = Date.now();
718
718
  let event_id = msg.properties.messageId;
719
719
  if (!event_id) {
720
720
  console.warn("Message is missing messageId, generating a new UUID v7 for event_id");
@@ -1159,7 +1159,7 @@ var publishEvent = async (msg, event) => {
1159
1159
  messageId,
1160
1160
  appId: publisherMicroservice
1161
1161
  });
1162
- const timestamp = Math.floor(Date.now() / 1e3);
1162
+ const timestamp = Date.now();
1163
1163
  publishAuditEvent(channel, "audit.published", {
1164
1164
  publisher_microservice: publisherMicroservice,
1165
1165
  published_event: event,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "legend-transactional",
3
- "version": "2.4.1",
3
+ "version": "2.5.0",
4
4
  "description": "A simple transactional, event-driven communication framework for microservices using RabbitMQ",
5
5
  "author": "Jorge Clavijo <jym272@gmail.com> (https://github.com/jym272)",
6
6
  "license": "MIT",