legend-transactional 2.1.2 → 2.2.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 +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -291,6 +291,17 @@ interface EventPayload {
|
|
|
291
291
|
'legend_missions.ongoing_mission': {
|
|
292
292
|
redisKey: string;
|
|
293
293
|
};
|
|
294
|
+
/**
|
|
295
|
+
* Event triggered when a mission finishes and needs to send final reports to participants
|
|
296
|
+
*/
|
|
297
|
+
'legend_missions.mission_finished': {
|
|
298
|
+
missionTitle: string;
|
|
299
|
+
participants: Array<{
|
|
300
|
+
userId?: string;
|
|
301
|
+
email?: string;
|
|
302
|
+
position?: number;
|
|
303
|
+
}>;
|
|
304
|
+
};
|
|
294
305
|
/**
|
|
295
306
|
* Event triggered to send an email notification when a user completes a crypto-based mission and earns a reward.
|
|
296
307
|
*/
|
|
@@ -445,6 +456,7 @@ declare const microserviceEvent: {
|
|
|
445
456
|
readonly 'LEGEND_MISSIONS.COMPLETED_MISSION_REWARD': "legend_missions.completed_mission_reward";
|
|
446
457
|
readonly 'LEGEND_MISSIONS.NEW_MISSION_CREATED': "legend_missions.new_mission_created";
|
|
447
458
|
readonly 'LEGEND_MISSIONS.ONGOING_MISSION': "legend_missions.ongoing_mission";
|
|
459
|
+
readonly 'LEGEND_MISSIONS.MISSION_FINISHED': "legend_missions.mission_finished";
|
|
448
460
|
readonly 'LEGEND_MISSIONS.SEND_EMAIL_CRYPTO_MISSION_COMPLETED': "legend_missions.send_email_crypto_mission_completed";
|
|
449
461
|
readonly 'LEGEND_MISSIONS.SEND_EMAIL_CODE_EXCHANGE_MISSION_COMPLETED': "legend_missions.send_email_code_exchange_mission_completed";
|
|
450
462
|
readonly 'LEGEND_MISSIONS.SEND_EMAIL_NFT_MISSION_COMPLETED': "legend_missions.send_email_nft_mission_completed";
|
|
@@ -575,7 +587,7 @@ declare class EventsConsumeChannel extends ConsumeChannel {
|
|
|
575
587
|
* Represents handlers for events emitted by a microservice.
|
|
576
588
|
*/
|
|
577
589
|
interface EventsHandler<T extends MicroserviceEvent> {
|
|
578
|
-
payload: EventPayload[T];
|
|
590
|
+
payload: EventPayload[T & keyof EventPayload];
|
|
579
591
|
channel: EventsConsumeChannel;
|
|
580
592
|
}
|
|
581
593
|
/**
|
|
@@ -1372,7 +1384,7 @@ declare const commenceSaga: <U extends SagaTitle>(sagaTitle: U, payload: SagaCom
|
|
|
1372
1384
|
*
|
|
1373
1385
|
* @see MicroserviceEvent
|
|
1374
1386
|
*/
|
|
1375
|
-
declare const publishEvent: <T extends MicroserviceEvent>(msg: EventPayload[T], event: T) => Promise<void>;
|
|
1387
|
+
declare const publishEvent: <T extends MicroserviceEvent>(msg: EventPayload[T & keyof EventPayload], event: T) => Promise<void>;
|
|
1376
1388
|
|
|
1377
1389
|
/**
|
|
1378
1390
|
* Get the _**consume**_ channel for consuming messages from RabbitMQ.
|
package/dist/index.d.ts
CHANGED
|
@@ -291,6 +291,17 @@ interface EventPayload {
|
|
|
291
291
|
'legend_missions.ongoing_mission': {
|
|
292
292
|
redisKey: string;
|
|
293
293
|
};
|
|
294
|
+
/**
|
|
295
|
+
* Event triggered when a mission finishes and needs to send final reports to participants
|
|
296
|
+
*/
|
|
297
|
+
'legend_missions.mission_finished': {
|
|
298
|
+
missionTitle: string;
|
|
299
|
+
participants: Array<{
|
|
300
|
+
userId?: string;
|
|
301
|
+
email?: string;
|
|
302
|
+
position?: number;
|
|
303
|
+
}>;
|
|
304
|
+
};
|
|
294
305
|
/**
|
|
295
306
|
* Event triggered to send an email notification when a user completes a crypto-based mission and earns a reward.
|
|
296
307
|
*/
|
|
@@ -445,6 +456,7 @@ declare const microserviceEvent: {
|
|
|
445
456
|
readonly 'LEGEND_MISSIONS.COMPLETED_MISSION_REWARD': "legend_missions.completed_mission_reward";
|
|
446
457
|
readonly 'LEGEND_MISSIONS.NEW_MISSION_CREATED': "legend_missions.new_mission_created";
|
|
447
458
|
readonly 'LEGEND_MISSIONS.ONGOING_MISSION': "legend_missions.ongoing_mission";
|
|
459
|
+
readonly 'LEGEND_MISSIONS.MISSION_FINISHED': "legend_missions.mission_finished";
|
|
448
460
|
readonly 'LEGEND_MISSIONS.SEND_EMAIL_CRYPTO_MISSION_COMPLETED': "legend_missions.send_email_crypto_mission_completed";
|
|
449
461
|
readonly 'LEGEND_MISSIONS.SEND_EMAIL_CODE_EXCHANGE_MISSION_COMPLETED': "legend_missions.send_email_code_exchange_mission_completed";
|
|
450
462
|
readonly 'LEGEND_MISSIONS.SEND_EMAIL_NFT_MISSION_COMPLETED': "legend_missions.send_email_nft_mission_completed";
|
|
@@ -575,7 +587,7 @@ declare class EventsConsumeChannel extends ConsumeChannel {
|
|
|
575
587
|
* Represents handlers for events emitted by a microservice.
|
|
576
588
|
*/
|
|
577
589
|
interface EventsHandler<T extends MicroserviceEvent> {
|
|
578
|
-
payload: EventPayload[T];
|
|
590
|
+
payload: EventPayload[T & keyof EventPayload];
|
|
579
591
|
channel: EventsConsumeChannel;
|
|
580
592
|
}
|
|
581
593
|
/**
|
|
@@ -1372,7 +1384,7 @@ declare const commenceSaga: <U extends SagaTitle>(sagaTitle: U, payload: SagaCom
|
|
|
1372
1384
|
*
|
|
1373
1385
|
* @see MicroserviceEvent
|
|
1374
1386
|
*/
|
|
1375
|
-
declare const publishEvent: <T extends MicroserviceEvent>(msg: EventPayload[T], event: T) => Promise<void>;
|
|
1387
|
+
declare const publishEvent: <T extends MicroserviceEvent>(msg: EventPayload[T & keyof EventPayload], event: T) => Promise<void>;
|
|
1376
1388
|
|
|
1377
1389
|
/**
|
|
1378
1390
|
* Get the _**consume**_ channel for consuming messages from RabbitMQ.
|
package/dist/index.js
CHANGED
|
@@ -107,6 +107,7 @@ var microserviceEvent = {
|
|
|
107
107
|
"LEGEND_MISSIONS.COMPLETED_MISSION_REWARD": "legend_missions.completed_mission_reward",
|
|
108
108
|
"LEGEND_MISSIONS.NEW_MISSION_CREATED": "legend_missions.new_mission_created",
|
|
109
109
|
"LEGEND_MISSIONS.ONGOING_MISSION": "legend_missions.ongoing_mission",
|
|
110
|
+
"LEGEND_MISSIONS.MISSION_FINISHED": "legend_missions.mission_finished",
|
|
110
111
|
"LEGEND_MISSIONS.SEND_EMAIL_CRYPTO_MISSION_COMPLETED": "legend_missions.send_email_crypto_mission_completed",
|
|
111
112
|
"LEGEND_MISSIONS.SEND_EMAIL_CODE_EXCHANGE_MISSION_COMPLETED": "legend_missions.send_email_code_exchange_mission_completed",
|
|
112
113
|
"LEGEND_MISSIONS.SEND_EMAIL_NFT_MISSION_COMPLETED": "legend_missions.send_email_nft_mission_completed",
|
package/dist/index.mjs
CHANGED
|
@@ -100,6 +100,7 @@ var microserviceEvent = {
|
|
|
100
100
|
"LEGEND_MISSIONS.COMPLETED_MISSION_REWARD": "legend_missions.completed_mission_reward",
|
|
101
101
|
"LEGEND_MISSIONS.NEW_MISSION_CREATED": "legend_missions.new_mission_created",
|
|
102
102
|
"LEGEND_MISSIONS.ONGOING_MISSION": "legend_missions.ongoing_mission",
|
|
103
|
+
"LEGEND_MISSIONS.MISSION_FINISHED": "legend_missions.mission_finished",
|
|
103
104
|
"LEGEND_MISSIONS.SEND_EMAIL_CRYPTO_MISSION_COMPLETED": "legend_missions.send_email_crypto_mission_completed",
|
|
104
105
|
"LEGEND_MISSIONS.SEND_EMAIL_CODE_EXCHANGE_MISSION_COMPLETED": "legend_missions.send_email_code_exchange_mission_completed",
|
|
105
106
|
"LEGEND_MISSIONS.SEND_EMAIL_NFT_MISSION_COMPLETED": "legend_missions.send_email_nft_mission_completed",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "legend-transactional",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.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",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"amqplib": "^0.10.
|
|
34
|
+
"amqplib": "^0.10.9",
|
|
35
35
|
"@types/amqplib": "^0.10.7",
|
|
36
36
|
"mitt": "latest"
|
|
37
37
|
},
|