easywork-common-lib 1.0.481 → 1.0.482
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/queue.module.d.ts +1 -1
- package/dist/modules/queue/queue.module.js +8 -2
- package/dist/modules/queue/queue.module.js.map +1 -1
- package/dist/modules/queue/queue.service.d.ts +8 -0
- package/dist/modules/queue/queue.service.js +40 -0
- package/dist/modules/queue/queue.service.js.map +1 -0
- package/package.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
package/dist/modules/index.d.ts
CHANGED
package/dist/modules/index.js
CHANGED
|
@@ -18,4 +18,5 @@ __exportStar(require("./queue/notifier.service"), exports);
|
|
|
18
18
|
__exportStar(require("./queue/scheduler.service"), exports);
|
|
19
19
|
__exportStar(require("./queue/queue.module"), exports);
|
|
20
20
|
__exportStar(require("./queue/event.service"), exports);
|
|
21
|
+
__exportStar(require("./queue/queue.service"), exports);
|
|
21
22
|
//# 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;AACrC,wDAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,4DAA0C;AAC1C,uDAAqC;AACrC,wDAAsC;AACtC,wDAAsC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DynamicModule } from "@nestjs/common";
|
|
2
2
|
export declare class EasyQueueModule {
|
|
3
|
-
static register(exchangeName: string, rabbitMQUri: string, notificationRoutingKey: string, schedulerRoutingKey: string, eventRoutingKey: string): DynamicModule;
|
|
3
|
+
static register(exchangeName: string, rabbitMQUri: string, notificationRoutingKey: string, schedulerRoutingKey: string, eventRoutingKey: string, queueRoutingKey: string): DynamicModule;
|
|
4
4
|
}
|
|
@@ -13,8 +13,9 @@ 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
15
|
const event_service_1 = require("./event.service");
|
|
16
|
+
const queue_service_1 = require("./queue.service");
|
|
16
17
|
let EasyQueueModule = EasyQueueModule_1 = class EasyQueueModule {
|
|
17
|
-
static register(exchangeName, rabbitMQUri, notificationRoutingKey, schedulerRoutingKey, eventRoutingKey) {
|
|
18
|
+
static register(exchangeName, rabbitMQUri, notificationRoutingKey, schedulerRoutingKey, eventRoutingKey, queueRoutingKey) {
|
|
18
19
|
return {
|
|
19
20
|
module: EasyQueueModule_1,
|
|
20
21
|
imports: [
|
|
@@ -45,11 +46,16 @@ let EasyQueueModule = EasyQueueModule_1 = class EasyQueueModule {
|
|
|
45
46
|
provide: "EVENT_ROUTING_KEY",
|
|
46
47
|
useValue: eventRoutingKey,
|
|
47
48
|
},
|
|
49
|
+
{
|
|
50
|
+
provide: "QUEUE_ROUTING_KEY",
|
|
51
|
+
useValue: queueRoutingKey,
|
|
52
|
+
},
|
|
48
53
|
notifier_service_1.EasyNotifierService,
|
|
49
54
|
scheduler_service_1.EasySchedulerService,
|
|
50
55
|
event_service_1.EasyEventService,
|
|
56
|
+
queue_service_1.EasyQueueService,
|
|
51
57
|
],
|
|
52
|
-
exports: [notifier_service_1.EasyNotifierService, scheduler_service_1.EasySchedulerService, event_service_1.EasyEventService],
|
|
58
|
+
exports: [notifier_service_1.EasyNotifierService, scheduler_service_1.EasySchedulerService, event_service_1.EasyEventService, queue_service_1.EasyQueueService],
|
|
53
59
|
};
|
|
54
60
|
}
|
|
55
61
|
};
|
|
@@ -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;AAC3D,mDAAmD;AAI5C,IAAM,eAAe,uBAArB,MAAM,eAAe;IAC1B,MAAM,CAAC,QAAQ,CACb,YAAoB,EACpB,WAAmB,EACnB,sBAA8B,EAC9B,mBAA2B,EAC3B,eAAuB;QAEvB,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;oBACE,OAAO,EAAE,mBAAmB;oBAC5B,QAAQ,EAAE,eAAe;iBAC1B;gBACD,sCAAmB;gBACnB,wCAAoB;gBACpB,gCAAgB;aACjB;YACD,OAAO,EAAE,CAAC,sCAAmB,EAAE,wCAAoB,EAAE,gCAAgB,CAAC;
|
|
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;AACnD,mDAAmD;AAI5C,IAAM,eAAe,uBAArB,MAAM,eAAe;IAC1B,MAAM,CAAC,QAAQ,CACb,YAAoB,EACpB,WAAmB,EACnB,sBAA8B,EAC9B,mBAA2B,EAC3B,eAAuB,EACvB,eAAuB;QAEvB,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;oBACE,OAAO,EAAE,mBAAmB;oBAC5B,QAAQ,EAAE,eAAe;iBAC1B;gBACD;oBACE,OAAO,EAAE,mBAAmB;oBAC5B,QAAQ,EAAE,eAAe;iBAC1B;gBACD,sCAAmB;gBACnB,wCAAoB;gBACpB,gCAAgB;gBAChB,gCAAgB;aACjB;YACD,OAAO,EAAE,CAAC,sCAAmB,EAAE,wCAAoB,EAAE,gCAAgB,EAAE,gCAAgB,CAAC;SACzF,CAAC;IACJ,CAAC;CACF,CAAA;AAnDY,0CAAe;0BAAf,eAAe;IAF3B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,eAAe,CAmD3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AmqpConnection } from "@golevelup/nestjs-rabbitmq";
|
|
2
|
+
export declare class EasyQueueService {
|
|
3
|
+
private readonly amqpConnection;
|
|
4
|
+
private readonly exchangeName;
|
|
5
|
+
private readonly routingKey;
|
|
6
|
+
constructor(amqpConnection: AmqpConnection, exchangeName: string, routingKey: string);
|
|
7
|
+
publishMessage(message: any): Promise<void>;
|
|
8
|
+
}
|
|
@@ -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.EasyQueueService = 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("EasyQueueService");
|
|
19
|
+
let EasyQueueService = class EasyQueueService {
|
|
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 publishMessage(message) {
|
|
29
|
+
logger.debug(`Publishing Message on the queue...`, this.exchangeName, this.routingKey);
|
|
30
|
+
await this.amqpConnection.publish(this.exchangeName, this.routingKey, message);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.EasyQueueService = EasyQueueService;
|
|
34
|
+
exports.EasyQueueService = EasyQueueService = __decorate([
|
|
35
|
+
(0, common_1.Injectable)(),
|
|
36
|
+
__param(1, (0, common_1.Inject)('EXCHANGE_NAME')),
|
|
37
|
+
__param(2, (0, common_1.Inject)('QUEUE_ROUTING_KEY')),
|
|
38
|
+
__metadata("design:paramtypes", [nestjs_rabbitmq_1.AmqpConnection, String, String])
|
|
39
|
+
], EasyQueueService);
|
|
40
|
+
//# sourceMappingURL=queue.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.service.js","sourceRoot":"","sources":["../../../src/modules/queue/queue.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAA4D;AAC5D,2CAA4D;AAE5D,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,kBAAkB,CAAC,CAAC;AAGvC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAEJ;IACyB;IACI;IAHlD,YACqB,cAA8B,EACL,YAAoB,EAChB,UAAkB;QAF/C,mBAAc,GAAd,cAAc,CAAgB;QACL,iBAAY,GAAZ,YAAY,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAQ;IAChE,CAAC;IAEL,KAAK,CAAC,cAAc,CAAC,OAAY;QAC/B,MAAM,CAAC,KAAK,CAAC,oCAAoC,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACvF,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACjF,CAAC;CACJ,CAAA;AAXY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAIJ,WAAA,IAAA,eAAM,EAAC,eAAe,CAAC,CAAA;IACvB,WAAA,IAAA,eAAM,EAAC,mBAAmB,CAAC,CAAA;qCAFK,gCAAc;GAF1C,gBAAgB,CAW5B"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easywork-common-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.482",
|
|
4
4
|
"description": "Librería común de Easywork",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc && cpx-fixed src/**/*.proto dist/",
|
|
8
|
-
"bump": "./scripts/bump.sh",
|
|
8
|
+
"bump": "sh ./scripts/bump.sh",
|
|
9
9
|
"bump-win": "cross-env ./scripts/bump.sh"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|