legend-transactional 2.4.1 → 2.5.1

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
@@ -155,6 +155,11 @@ interface CompletedRanking {
155
155
  nftBlockchainNetwork?: string;
156
156
  nftContractAddress?: string;
157
157
  walletCryptoAsset?: string;
158
+ /** Optional notification config forwarded from rankings (dynamic template data) */
159
+ notificationConfig?: Record<string, unknown> & {
160
+ button_link?: string;
161
+ button_text?: string;
162
+ };
158
163
  }
159
164
  /**
160
165
  * Represents the possible genders a social user can have
@@ -494,7 +499,7 @@ interface EventPayload {
494
499
  */
495
500
  published_event: string;
496
501
  /**
497
- * Timestamp when the event was published (UNIX timestamp in seconds)
502
+ * Timestamp when the event was published (UNIX timestamp in milliseconds)
498
503
  */
499
504
  published_at: number;
500
505
  /**
@@ -519,7 +524,7 @@ interface EventPayload {
519
524
  */
520
525
  received_event: string;
521
526
  /**
522
- * Timestamp when the event was received (UNIX timestamp in seconds)
527
+ * Timestamp when the event was received (UNIX timestamp in milliseconds)
523
528
  */
524
529
  received_at: number;
525
530
  /**
@@ -548,7 +553,7 @@ interface EventPayload {
548
553
  */
549
554
  processed_event: string;
550
555
  /**
551
- * Timestamp when the event was processed (UNIX timestamp in seconds)
556
+ * Timestamp when the event was processed (UNIX timestamp in milliseconds)
552
557
  */
553
558
  processed_at: number;
554
559
  /**
@@ -577,7 +582,7 @@ interface EventPayload {
577
582
  */
578
583
  rejected_event: string;
579
584
  /**
580
- * Timestamp when the event was rejected (UNIX timestamp in seconds)
585
+ * Timestamp when the event was rejected (UNIX timestamp in milliseconds)
581
586
  */
582
587
  rejected_at: number;
583
588
  /**
package/dist/index.d.ts CHANGED
@@ -155,6 +155,11 @@ interface CompletedRanking {
155
155
  nftBlockchainNetwork?: string;
156
156
  nftContractAddress?: string;
157
157
  walletCryptoAsset?: string;
158
+ /** Optional notification config forwarded from rankings (dynamic template data) */
159
+ notificationConfig?: Record<string, unknown> & {
160
+ button_link?: string;
161
+ button_text?: string;
162
+ };
158
163
  }
159
164
  /**
160
165
  * Represents the possible genders a social user can have
@@ -494,7 +499,7 @@ interface EventPayload {
494
499
  */
495
500
  published_event: string;
496
501
  /**
497
- * Timestamp when the event was published (UNIX timestamp in seconds)
502
+ * Timestamp when the event was published (UNIX timestamp in milliseconds)
498
503
  */
499
504
  published_at: number;
500
505
  /**
@@ -519,7 +524,7 @@ interface EventPayload {
519
524
  */
520
525
  received_event: string;
521
526
  /**
522
- * Timestamp when the event was received (UNIX timestamp in seconds)
527
+ * Timestamp when the event was received (UNIX timestamp in milliseconds)
523
528
  */
524
529
  received_at: number;
525
530
  /**
@@ -548,7 +553,7 @@ interface EventPayload {
548
553
  */
549
554
  processed_event: string;
550
555
  /**
551
- * Timestamp when the event was processed (UNIX timestamp in seconds)
556
+ * Timestamp when the event was processed (UNIX timestamp in milliseconds)
552
557
  */
553
558
  processed_at: number;
554
559
  /**
@@ -577,7 +582,7 @@ interface EventPayload {
577
582
  */
578
583
  rejected_event: string;
579
584
  /**
580
- * Timestamp when the event was rejected (UNIX timestamp in seconds)
585
+ * Timestamp when the event was rejected (UNIX timestamp in milliseconds)
581
586
  */
582
587
  rejected_at: number;
583
588
  /**
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.1",
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",