easywork-common-lib 1.0.453 → 1.0.455
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/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/queue/event.service.d.ts +9 -0
- package/dist/modules/queue/event.service.js +40 -0
- package/dist/modules/queue/event.service.js.map +1 -0
- package/dist/modules/queue/queue.module.d.ts +1 -1
- package/dist/modules/queue/queue.module.js +7 -5
- package/dist/modules/queue/queue.module.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/dist/modules/index.d.ts
CHANGED
package/dist/modules/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./queue/notifier.service"), exports);
|
|
18
18
|
__exportStar(require("./queue/scheduler.service"), exports);
|
|
19
19
|
__exportStar(require("./queue/queue.module"), exports);
|
|
20
|
+
__exportStar(require("./queue/event.service"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,4DAA0C;AAC1C,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,4DAA0C;AAC1C,uDAAqC;AACrC,wDAAsC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AmqpConnection } from "@golevelup/nestjs-rabbitmq";
|
|
2
|
+
import { Event } from "../../entities";
|
|
3
|
+
export declare class EasyEventService {
|
|
4
|
+
private readonly amqpConnection;
|
|
5
|
+
private readonly exchangeName;
|
|
6
|
+
private readonly routingKey;
|
|
7
|
+
constructor(amqpConnection: AmqpConnection, exchangeName: string, routingKey: string);
|
|
8
|
+
createEvent(event: Event): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.EasyEventService = void 0;
|
|
16
|
+
const nestjs_rabbitmq_1 = require("@golevelup/nestjs-rabbitmq");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const logger = new common_1.Logger("EasyEventService");
|
|
19
|
+
let EasyEventService = class EasyEventService {
|
|
20
|
+
amqpConnection;
|
|
21
|
+
exchangeName;
|
|
22
|
+
routingKey;
|
|
23
|
+
constructor(amqpConnection, exchangeName, routingKey) {
|
|
24
|
+
this.amqpConnection = amqpConnection;
|
|
25
|
+
this.exchangeName = exchangeName;
|
|
26
|
+
this.routingKey = routingKey;
|
|
27
|
+
}
|
|
28
|
+
async createEvent(event) {
|
|
29
|
+
logger.debug(`Creando un nuevo evento...`);
|
|
30
|
+
await this.amqpConnection.publish(this.exchangeName, this.routingKey, event);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.EasyEventService = EasyEventService;
|
|
34
|
+
exports.EasyEventService = EasyEventService = __decorate([
|
|
35
|
+
(0, common_1.Injectable)(),
|
|
36
|
+
__param(1, (0, common_1.Inject)("EXCHANGE_NAME")),
|
|
37
|
+
__param(2, (0, common_1.Inject)("SCHEDULER_ROUTING_KEY")),
|
|
38
|
+
__metadata("design:paramtypes", [nestjs_rabbitmq_1.AmqpConnection, String, String])
|
|
39
|
+
], EasyEventService);
|
|
40
|
+
//# sourceMappingURL=event.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.service.js","sourceRoot":"","sources":["../../../src/modules/queue/event.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAA4D;AAC5D,2CAA4D;AAG5D,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,kBAAkB,CAAC,CAAC;AAGvC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAER;IACyB;IACQ;IAHpD,YACmB,cAA8B,EACL,YAAoB,EACZ,UAAkB;QAFnD,mBAAc,GAAd,cAAc,CAAgB;QACL,iBAAY,GAAZ,YAAY,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAQ;IACnE,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,KAAY;QAC5B,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAC3C,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC/B,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,EACf,KAAK,CACN,CAAC;IACJ,CAAC;CACF,CAAA;AAfY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAIR,WAAA,IAAA,eAAM,EAAC,eAAe,CAAC,CAAA;IACvB,WAAA,IAAA,eAAM,EAAC,uBAAuB,CAAC,CAAA;qCAFC,gCAAc;GAFtC,gBAAgB,CAe5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicModule } from
|
|
1
|
+
import { DynamicModule } from "@nestjs/common";
|
|
2
2
|
export declare class EasyQueueModule {
|
|
3
3
|
static register(exchangeName: string, rabbitMQUri: string, notificationRoutingKey: string, schedulerRoutingKey: string): DynamicModule;
|
|
4
4
|
}
|
|
@@ -12,6 +12,7 @@ const common_1 = require("@nestjs/common");
|
|
|
12
12
|
const notifier_service_1 = require("./notifier.service");
|
|
13
13
|
const nestjs_rabbitmq_1 = require("@golevelup/nestjs-rabbitmq");
|
|
14
14
|
const scheduler_service_1 = require("./scheduler.service");
|
|
15
|
+
const event_service_1 = require("./event.service");
|
|
15
16
|
let EasyQueueModule = EasyQueueModule_1 = class EasyQueueModule {
|
|
16
17
|
static register(exchangeName, rabbitMQUri, notificationRoutingKey, schedulerRoutingKey) {
|
|
17
18
|
return {
|
|
@@ -21,7 +22,7 @@ let EasyQueueModule = EasyQueueModule_1 = class EasyQueueModule {
|
|
|
21
22
|
exchanges: [
|
|
22
23
|
{
|
|
23
24
|
name: exchangeName,
|
|
24
|
-
type:
|
|
25
|
+
type: "topic",
|
|
25
26
|
},
|
|
26
27
|
],
|
|
27
28
|
uri: rabbitMQUri,
|
|
@@ -29,21 +30,22 @@ let EasyQueueModule = EasyQueueModule_1 = class EasyQueueModule {
|
|
|
29
30
|
],
|
|
30
31
|
providers: [
|
|
31
32
|
{
|
|
32
|
-
provide:
|
|
33
|
+
provide: "EXCHANGE_NAME",
|
|
33
34
|
useValue: exchangeName,
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
|
-
provide:
|
|
37
|
+
provide: "NOTIFIER_ROUTING_KEY",
|
|
37
38
|
useValue: notificationRoutingKey,
|
|
38
39
|
},
|
|
39
40
|
{
|
|
40
|
-
provide:
|
|
41
|
+
provide: "SCHEDULER_ROUTING_KEY",
|
|
41
42
|
useValue: schedulerRoutingKey,
|
|
42
43
|
},
|
|
43
44
|
notifier_service_1.EasyNotifierService,
|
|
44
45
|
scheduler_service_1.EasySchedulerService,
|
|
46
|
+
event_service_1.EasyEventService,
|
|
45
47
|
],
|
|
46
|
-
exports: [notifier_service_1.EasyNotifierService, scheduler_service_1.EasySchedulerService],
|
|
48
|
+
exports: [notifier_service_1.EasyNotifierService, scheduler_service_1.EasySchedulerService, event_service_1.EasyEventService],
|
|
47
49
|
};
|
|
48
50
|
}
|
|
49
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.module.js","sourceRoot":"","sources":["../../../src/modules/queue/queue.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+D;AAC/D,yDAAyD;AACzD,gEAA4D;AAC5D,2DAA2D;
|
|
1
|
+
{"version":3,"file":"queue.module.js","sourceRoot":"","sources":["../../../src/modules/queue/queue.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+D;AAC/D,yDAAyD;AACzD,gEAA4D;AAC5D,2DAA2D;AAC3D,mDAAmD;AAI5C,IAAM,eAAe,uBAArB,MAAM,eAAe;IAC1B,MAAM,CAAC,QAAQ,CACb,YAAoB,EACpB,WAAmB,EACnB,sBAA8B,EAC9B,mBAA2B;QAE3B,OAAO;YACL,MAAM,EAAE,iBAAe;YACvB,OAAO,EAAE;gBACP,gCAAc,CAAC,OAAO,CAAC,gCAAc,EAAE;oBACrC,SAAS,EAAE;wBACT;4BACE,IAAI,EAAE,YAAY;4BAClB,IAAI,EAAE,OAAO;yBACd;qBACF;oBACD,GAAG,EAAE,WAAW;iBACjB,CAAC;aACH;YACD,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,eAAe;oBACxB,QAAQ,EAAE,YAAY;iBACvB;gBACD;oBACE,OAAO,EAAE,sBAAsB;oBAC/B,QAAQ,EAAE,sBAAsB;iBACjC;gBACD;oBACE,OAAO,EAAE,uBAAuB;oBAChC,QAAQ,EAAE,mBAAmB;iBAC9B;gBACD,sCAAmB;gBACnB,wCAAoB;gBACpB,gCAAgB;aACjB;YACD,OAAO,EAAE,CAAC,sCAAmB,EAAE,wCAAoB,EAAE,gCAAgB,CAAC;SACvE,CAAC;IACJ,CAAC;CACF,CAAA;AAxCY,0CAAe;0BAAf,eAAe;IAF3B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,eAAe,CAwC3B"}
|