@rafikidota/cuba-ofertas-scraping 0.1.0 โ†’ 0.2.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.
@@ -0,0 +1,116 @@
1
+ {
2
+ "AW": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ผ", "name": "Aruba" },
3
+ "AF": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ซ", "name": "Afghanistan" },
4
+ "AO": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ด", "name": "Angola" },
5
+ "AI": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ฎ", "name": "Anguilla" },
6
+ "AX": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ฝ", "name": "ร…land Islands" },
7
+ "AL": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ฑ", "name": "Albania" },
8
+ "AD": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ฉ", "name": "Andorra" },
9
+ "AE": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ช", "name": "United Arab Emirates" },
10
+ "AR": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ท", "name": "Argentina" },
11
+ "AM": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ฒ", "name": "Armenia" },
12
+ "AS": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ธ", "name": "American Samoa" },
13
+ "AQ": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ถ", "name": "Antarctica" },
14
+ "TF": { "flag": "๐Ÿ‡น๐Ÿ‡ซ", "name": "French Southern Territories" },
15
+ "AG": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ฌ", "name": "Antigua and Barbuda" },
16
+ "AU": { "flag": "๐Ÿ‡ฆ๐Ÿ‡บ", "name": "Australia" },
17
+ "AT": { "flag": "๐Ÿ‡ฆ๐Ÿ‡น", "name": "Austria" },
18
+ "AZ": { "flag": "๐Ÿ‡ฆ๐Ÿ‡ฟ", "name": "Azerbaijan" },
19
+ "BI": { "flag": "๐Ÿ‡ง๐Ÿ‡ฎ", "name": "Burundi" },
20
+ "BE": { "flag": "๐Ÿ‡ง๐Ÿ‡ช", "name": "Belgium" },
21
+ "BJ": { "flag": "๐Ÿ‡ง๐Ÿ‡ฏ", "name": "Benin" },
22
+ "BQ": { "flag": "๐Ÿ‡ง๐Ÿ‡ถ", "name": "Caribbean Netherlands" },
23
+ "BF": { "flag": "๐Ÿ‡ง๐Ÿ‡ซ", "name": "Burkina Faso" },
24
+ "BD": { "flag": "๐Ÿ‡ง๐Ÿ‡ฉ", "name": "Bangladesh" },
25
+ "BG": { "flag": "๐Ÿ‡ง๐Ÿ‡ฌ", "name": "Bulgaria" },
26
+ "BH": { "flag": "๐Ÿ‡ง๐Ÿ‡ญ", "name": "Bahrain" },
27
+ "BS": { "flag": "๐Ÿ‡ง๐Ÿ‡ธ", "name": "Bahamas" },
28
+ "BA": { "flag": "๐Ÿ‡ง๐Ÿ‡ฆ", "name": "Bosnia and Herzegovina" },
29
+ "BY": { "flag": "๐Ÿ‡ง๐Ÿ‡พ", "name": "Belarus" },
30
+ "BZ": { "flag": "๐Ÿ‡ง๐Ÿ‡ฟ", "name": "Belize" },
31
+ "BM": { "flag": "๐Ÿ‡ง๐Ÿ‡ฒ", "name": "Bermuda" },
32
+ "BO": { "flag": "๐Ÿ‡ง๐Ÿ‡ด", "name": "Bolivia" },
33
+ "BR": { "flag": "๐Ÿ‡ง๐Ÿ‡ท", "name": "Brazil" },
34
+ "BB": { "flag": "๐Ÿ‡ง๐Ÿ‡ง", "name": "Barbados" },
35
+ "BN": { "flag": "๐Ÿ‡ง๐Ÿ‡ณ", "name": "Brunei" },
36
+ "BT": { "flag": "๐Ÿ‡ง๐Ÿ‡น", "name": "Bhutan" },
37
+ "BW": { "flag": "๐Ÿ‡ง๐Ÿ‡ผ", "name": "Botswana" },
38
+ "CF": { "flag": "๐Ÿ‡จ๐Ÿ‡ซ", "name": "Central African Republic" },
39
+ "CA": { "flag": "๐Ÿ‡จ๐Ÿ‡ฆ", "name": "Canada" },
40
+ "CH": { "flag": "๐Ÿ‡จ๐Ÿ‡ญ", "name": "Switzerland" },
41
+ "CL": { "flag": "๐Ÿ‡จ๐Ÿ‡ฑ", "name": "Chile" },
42
+ "CN": { "flag": "๐Ÿ‡จ๐Ÿ‡ณ", "name": "China" },
43
+ "CI": { "flag": "๐Ÿ‡จ๐Ÿ‡ฎ", "name": "Cรดte d'Ivoire" },
44
+ "CM": { "flag": "๐Ÿ‡จ๐Ÿ‡ฒ", "name": "Cameroon" },
45
+ "CD": { "flag": "๐Ÿ‡จ๐Ÿ‡ฉ", "name": "Democratic Republic of the Congo" },
46
+ "CO": { "flag": "๐Ÿ‡จ๐Ÿ‡ด", "name": "Colombia" },
47
+ "CR": { "flag": "๐Ÿ‡จ๐Ÿ‡ท", "name": "Costa Rica" },
48
+ "CU": { "flag": "๐Ÿ‡จ๐Ÿ‡บ", "name": "Cuba" },
49
+ "CW": { "flag": "๐Ÿ‡จ๐Ÿ‡ผ", "name": "Curaรงao" },
50
+ "CY": { "flag": "๐Ÿ‡จ๐Ÿ‡พ", "name": "Cyprus" },
51
+ "CZ": { "flag": "๐Ÿ‡จ๐Ÿ‡ฟ", "name": "Czech Republic" },
52
+ "DE": { "flag": "๐Ÿ‡ฉ๐Ÿ‡ช", "name": "Germany" },
53
+ "DK": { "flag": "๐Ÿ‡ฉ๐Ÿ‡ฐ", "name": "Denmark" },
54
+ "DO": { "flag": "๐Ÿ‡ฉ๐Ÿ‡ด", "name": "Dominican Republic" },
55
+ "DZ": { "flag": "๐Ÿ‡ฉ๐Ÿ‡ฟ", "name": "Algeria" },
56
+ "EC": { "flag": "๐Ÿ‡ช๐Ÿ‡จ", "name": "Ecuador" },
57
+ "EG": { "flag": "๐Ÿ‡ช๐Ÿ‡ฌ", "name": "Egypt" },
58
+ "ES": { "flag": "๐Ÿ‡ช๐Ÿ‡ธ", "name": "Spain" },
59
+ "FI": { "flag": "๐Ÿ‡ซ๐Ÿ‡ฎ", "name": "Finland" },
60
+ "FR": { "flag": "๐Ÿ‡ซ๐Ÿ‡ท", "name": "France" },
61
+ "GB": { "flag": "๐Ÿ‡ฌ๐Ÿ‡ง", "name": "United Kingdom" },
62
+ "GR": { "flag": "๐Ÿ‡ฌ๐Ÿ‡ท", "name": "Greece" },
63
+ "GT": { "flag": "๐Ÿ‡ฌ๐Ÿ‡น", "name": "Guatemala" },
64
+ "HN": { "flag": "๐Ÿ‡ญ๐Ÿ‡ณ", "name": "Honduras" },
65
+ "HR": { "flag": "๐Ÿ‡ญ๐Ÿ‡ท", "name": "Croatia" },
66
+ "HU": { "flag": "๐Ÿ‡ญ๐Ÿ‡บ", "name": "Hungary" },
67
+ "ID": { "flag": "๐Ÿ‡ฎ๐Ÿ‡ฉ", "name": "Indonesia" },
68
+ "IE": { "flag": "๐Ÿ‡ฎ๐Ÿ‡ช", "name": "Ireland" },
69
+ "IL": { "flag": "๐Ÿ‡ฎ๐Ÿ‡ฑ", "name": "Israel" },
70
+ "IN": { "flag": "๐Ÿ‡ฎ๐Ÿ‡ณ", "name": "India" },
71
+ "IQ": { "flag": "๐Ÿ‡ฎ๐Ÿ‡ถ", "name": "Iraq" },
72
+ "IR": { "flag": "๐Ÿ‡ฎ๐Ÿ‡ท", "name": "Iran" },
73
+ "IS": { "flag": "๐Ÿ‡ฎ๐Ÿ‡ธ", "name": "Iceland" },
74
+ "IT": { "flag": "๐Ÿ‡ฎ๐Ÿ‡น", "name": "Italy" },
75
+ "JM": { "flag": "๐Ÿ‡ฏ๐Ÿ‡ฒ", "name": "Jamaica" },
76
+ "JO": { "flag": "๐Ÿ‡ฏ๐Ÿ‡ด", "name": "Jordan" },
77
+ "JP": { "flag": "๐Ÿ‡ฏ๐Ÿ‡ต", "name": "Japan" },
78
+ "KR": { "flag": "๐Ÿ‡ฐ๐Ÿ‡ท", "name": "South Korea" },
79
+ "KW": { "flag": "๐Ÿ‡ฐ๐Ÿ‡ผ", "name": "Kuwait" },
80
+ "KZ": { "flag": "๐Ÿ‡ฐ๐Ÿ‡ฟ", "name": "Kazakhstan" },
81
+ "LA": { "flag": "๐Ÿ‡ฑ๐Ÿ‡ฆ", "name": "Laos" },
82
+ "LB": { "flag": "๐Ÿ‡ฑ๐Ÿ‡ง", "name": "Lebanon" },
83
+ "LK": { "flag": "๐Ÿ‡ฑ๐Ÿ‡ฐ", "name": "Sri Lanka" },
84
+ "LT": { "flag": "๐Ÿ‡ฑ๐Ÿ‡น", "name": "Lithuania" },
85
+ "LU": { "flag": "๐Ÿ‡ฑ๐Ÿ‡บ", "name": "Luxembourg" },
86
+ "LV": { "flag": "๐Ÿ‡ฑ๐Ÿ‡ป", "name": "Latvia" },
87
+ "MA": { "flag": "๐Ÿ‡ฒ๐Ÿ‡ฆ", "name": "Morocco" },
88
+ "MX": { "flag": "๐Ÿ‡ฒ๐Ÿ‡ฝ", "name": "Mexico" },
89
+ "MY": { "flag": "๐Ÿ‡ฒ๐Ÿ‡พ", "name": "Malaysia" },
90
+ "NG": { "flag": "๐Ÿ‡ณ๐Ÿ‡ฌ", "name": "Nigeria" },
91
+ "NL": { "flag": "๐Ÿ‡ณ๐Ÿ‡ฑ", "name": "Netherlands" },
92
+ "NO": { "flag": "๐Ÿ‡ณ๐Ÿ‡ด", "name": "Norway" },
93
+ "NZ": { "flag": "๐Ÿ‡ณ๐Ÿ‡ฟ", "name": "New Zealand" },
94
+ "PA": { "flag": "๐Ÿ‡ต๐Ÿ‡ฆ", "name": "Panama" },
95
+ "PE": { "flag": "๐Ÿ‡ต๐Ÿ‡ช", "name": "Peru" },
96
+ "PH": { "flag": "๐Ÿ‡ต๐Ÿ‡ญ", "name": "Philippines" },
97
+ "PK": { "flag": "๐Ÿ‡ต๐Ÿ‡ฐ", "name": "Pakistan" },
98
+ "PL": { "flag": "๐Ÿ‡ต๐Ÿ‡ฑ", "name": "Poland" },
99
+ "PT": { "flag": "๐Ÿ‡ต๐Ÿ‡น", "name": "Portugal" },
100
+ "PY": { "flag": "๐Ÿ‡ต๐Ÿ‡พ", "name": "Paraguay" },
101
+ "QA": { "flag": "๐Ÿ‡ถ๐Ÿ‡ฆ", "name": "Qatar" },
102
+ "RO": { "flag": "๐Ÿ‡ท๐Ÿ‡ด", "name": "Romania" },
103
+ "RU": { "flag": "๐Ÿ‡ท๐Ÿ‡บ", "name": "Russia" },
104
+ "SA": { "flag": "๐Ÿ‡ธ๐Ÿ‡ฆ", "name": "Saudi Arabia" },
105
+ "SE": { "flag": "๐Ÿ‡ธ๐Ÿ‡ช", "name": "Sweden" },
106
+ "SG": { "flag": "๐Ÿ‡ธ๐Ÿ‡ฌ", "name": "Singapore" },
107
+ "SV": { "flag": "๐Ÿ‡ธ๐Ÿ‡ป", "name": "El Salvador" },
108
+ "TH": { "flag": "๐Ÿ‡น๐Ÿ‡ญ", "name": "Thailand" },
109
+ "TR": { "flag": "๐Ÿ‡น๐Ÿ‡ท", "name": "Turkey" },
110
+ "UA": { "flag": "๐Ÿ‡บ๐Ÿ‡ฆ", "name": "Ukraine" },
111
+ "US": { "flag": "๐Ÿ‡บ๐Ÿ‡ธ", "name": "United States" },
112
+ "UY": { "flag": "๐Ÿ‡บ๐Ÿ‡พ", "name": "Uruguay" },
113
+ "VE": { "flag": "๐Ÿ‡ป๐Ÿ‡ช", "name": "Venezuela" },
114
+ "VN": { "flag": "๐Ÿ‡ป๐Ÿ‡ณ", "name": "Vietnam" },
115
+ "ZA": { "flag": "๐Ÿ‡ฟ๐Ÿ‡ฆ", "name": "South Africa" }
116
+ }
@@ -3,6 +3,11 @@ export * from './delayer/delayer.service';
3
3
  export * from './delayer/use-cases/delayer-logger.service';
4
4
  export * from './delayer/use-cases/delayer-mapper.service';
5
5
  export * from './delayer/use-cases/delayer-sleeper.service';
6
+ export * from './processor/enum/queue.name';
7
+ export * from './processor/enum/queue.token';
8
+ export * from './processor/enum/queue.type';
9
+ export * from './processor/processor.module';
10
+ export * from './processor/processor.service';
6
11
  export * from './rabbitmq/env/rabbitmq.env.config';
7
12
  export * from './rabbitmq/env/rabbitmq.env.validation';
8
13
  export * from './rabbitmq/rabbitmq.module';
@@ -19,6 +19,11 @@ __exportStar(require("./delayer/delayer.service"), exports);
19
19
  __exportStar(require("./delayer/use-cases/delayer-logger.service"), exports);
20
20
  __exportStar(require("./delayer/use-cases/delayer-mapper.service"), exports);
21
21
  __exportStar(require("./delayer/use-cases/delayer-sleeper.service"), exports);
22
+ __exportStar(require("./processor/enum/queue.name"), exports);
23
+ __exportStar(require("./processor/enum/queue.token"), exports);
24
+ __exportStar(require("./processor/enum/queue.type"), exports);
25
+ __exportStar(require("./processor/processor.module"), exports);
26
+ __exportStar(require("./processor/processor.service"), exports);
22
27
  __exportStar(require("./rabbitmq/env/rabbitmq.env.config"), exports);
23
28
  __exportStar(require("./rabbitmq/env/rabbitmq.env.validation"), exports);
24
29
  __exportStar(require("./rabbitmq/rabbitmq.module"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,4DAA0C;AAC1C,6EAA2D;AAC3D,6EAA2D;AAC3D,8EAA4D;AAE5D,qEAAmD;AACnD,yEAAuD;AACvD,6DAA2C;AAC3C,8DAA4C;AAE5C,2DAAyC;AACzC,4DAA0C;AAE1C,qEAAmD;AACnD,yEAAuD;AACvD,6DAA2C;AAC3C,8DAA4C;AAE5C,uEAAqD;AACrD,2EAAyD;AACzD,+DAA6C;AAC7C,gEAA8C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,4DAA0C;AAC1C,6EAA2D;AAC3D,6EAA2D;AAC3D,8EAA4D;AAE5D,8DAA4C;AAC5C,+DAA6C;AAC7C,8DAA4C;AAC5C,+DAA6C;AAC7C,gEAA8C;AAE9C,qEAAmD;AACnD,yEAAuD;AACvD,6DAA2C;AAC3C,8DAA4C;AAE5C,2DAAyC;AACzC,4DAA0C;AAE1C,qEAAmD;AACnD,yEAAuD;AACvD,6DAA2C;AAC3C,8DAA4C;AAE5C,uEAAqD;AACrD,2EAAyD;AACzD,+DAA6C;AAC7C,gEAA8C"}
@@ -0,0 +1,5 @@
1
+ export declare enum QueueName {
2
+ DEV = "processor-dev",
3
+ QA = "processor-qa",
4
+ PROD = "processor-prod"
5
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueueName = void 0;
4
+ var QueueName;
5
+ (function (QueueName) {
6
+ QueueName["DEV"] = "processor-dev";
7
+ QueueName["QA"] = "processor-qa";
8
+ QueueName["PROD"] = "processor-prod";
9
+ })(QueueName || (exports.QueueName = QueueName = {}));
10
+ //# sourceMappingURL=queue.name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.name.js","sourceRoot":"","sources":["../../../../src/modules/processor/enum/queue.name.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,gCAAmB,CAAA;IACnB,oCAAuB,CAAA;AACzB,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB"}
@@ -0,0 +1,5 @@
1
+ export declare enum QueueToken {
2
+ DEV = "RABBITMQ_DEV",
3
+ QA = "RABBITMQ_QA",
4
+ PROD = "RABBITMQ_PROD"
5
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueueToken = void 0;
4
+ var QueueToken;
5
+ (function (QueueToken) {
6
+ QueueToken["DEV"] = "RABBITMQ_DEV";
7
+ QueueToken["QA"] = "RABBITMQ_QA";
8
+ QueueToken["PROD"] = "RABBITMQ_PROD";
9
+ })(QueueToken || (exports.QueueToken = QueueToken = {}));
10
+ //# sourceMappingURL=queue.token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.token.js","sourceRoot":"","sources":["../../../../src/modules/processor/enum/queue.token.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,kCAAoB,CAAA;IACpB,gCAAkB,CAAA;IAClB,oCAAsB,CAAA;AACxB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
@@ -0,0 +1,5 @@
1
+ export declare enum QueueType {
2
+ DEV = "dev",
3
+ QA = "qa",
4
+ PROD = "prod"
5
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueueType = void 0;
4
+ var QueueType;
5
+ (function (QueueType) {
6
+ QueueType["DEV"] = "dev";
7
+ QueueType["QA"] = "qa";
8
+ QueueType["PROD"] = "prod";
9
+ })(QueueType || (exports.QueueType = QueueType = {}));
10
+ //# sourceMappingURL=queue.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.type.js","sourceRoot":"","sources":["../../../../src/modules/processor/enum/queue.type.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,sBAAS,CAAA;IACT,0BAAa,CAAA;AACf,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB"}
@@ -0,0 +1,2 @@
1
+ export declare class ProcessorModule {
2
+ }
@@ -0,0 +1,27 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ProcessorModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const rabbitmq_module_1 = require("../rabbitmq/rabbitmq.module");
12
+ const processor_service_1 = require("./processor.service");
13
+ let ProcessorModule = class ProcessorModule {
14
+ };
15
+ exports.ProcessorModule = ProcessorModule;
16
+ exports.ProcessorModule = ProcessorModule = __decorate([
17
+ (0, common_1.Module)({
18
+ imports: [
19
+ rabbitmq_module_1.RabbitMQModule.registerQueue('processor-dev', 'RABBITMQ_DEV'),
20
+ rabbitmq_module_1.RabbitMQModule.registerQueue('processor-qa', 'RABBITMQ_QA'),
21
+ rabbitmq_module_1.RabbitMQModule.registerQueue('processor-prod', 'RABBITMQ_PROD'),
22
+ ],
23
+ providers: [processor_service_1.ProcessorService],
24
+ exports: [processor_service_1.ProcessorService],
25
+ })
26
+ ], ProcessorModule);
27
+ //# sourceMappingURL=processor.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processor.module.js","sourceRoot":"","sources":["../../../src/modules/processor/processor.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,iEAA6D;AAC7D,2DAAuD;AAWhD,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAT3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,gCAAc,CAAC,aAAa,CAAC,eAAe,EAAE,cAAc,CAAC;YAC7D,gCAAc,CAAC,aAAa,CAAC,cAAc,EAAE,aAAa,CAAC;YAC3D,gCAAc,CAAC,aAAa,CAAC,gBAAgB,EAAE,eAAe,CAAC;SAChE;QACD,SAAS,EAAE,CAAC,oCAAgB,CAAC;QAC7B,OAAO,EAAE,CAAC,oCAAgB,CAAC;KAC5B,CAAC;GACW,eAAe,CAAG"}
@@ -0,0 +1,15 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import { ClientProxy } from '@nestjs/microservices';
3
+ import { ConfigService } from '@nestjs/config';
4
+ export declare class ProcessorService implements OnModuleInit {
5
+ private readonly config;
6
+ private readonly dev;
7
+ private readonly qa;
8
+ private readonly prod;
9
+ private readonly logger;
10
+ private enabledQueues;
11
+ private clientMap;
12
+ constructor(config: ConfigService, dev: ClientProxy, qa: ClientProxy, prod: ClientProxy);
13
+ onModuleInit(): void;
14
+ send(data: any): Promise<void>;
15
+ }
@@ -0,0 +1,82 @@
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
+ var ProcessorService_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ProcessorService = void 0;
17
+ const common_1 = require("@nestjs/common");
18
+ const microservices_1 = require("@nestjs/microservices");
19
+ const config_1 = require("@nestjs/config");
20
+ const rxjs_1 = require("rxjs");
21
+ const queue_type_1 = require("./enum/queue.type");
22
+ const queue_name_1 = require("./enum/queue.name");
23
+ const queue_token_1 = require("./enum/queue.token");
24
+ let ProcessorService = ProcessorService_1 = class ProcessorService {
25
+ constructor(config, dev, qa, prod) {
26
+ this.config = config;
27
+ this.dev = dev;
28
+ this.qa = qa;
29
+ this.prod = prod;
30
+ this.enabledQueues = new Set();
31
+ this.clientMap = new Map();
32
+ const options = { timestamp: true };
33
+ this.logger = new common_1.Logger(ProcessorService_1.name, options);
34
+ }
35
+ onModuleInit() {
36
+ const queues = this.config.get('RABBITMQ_QUEUES');
37
+ this.clientMap.set(queue_type_1.QueueType.DEV, this.dev);
38
+ this.clientMap.set(queue_type_1.QueueType.QA, this.qa);
39
+ this.clientMap.set(queue_type_1.QueueType.PROD, this.prod);
40
+ queues.forEach((queue) => {
41
+ switch (queue) {
42
+ case queue_name_1.QueueName.DEV:
43
+ this.enabledQueues.add(queue_type_1.QueueType.DEV);
44
+ break;
45
+ case queue_name_1.QueueName.QA:
46
+ this.enabledQueues.add(queue_type_1.QueueType.QA);
47
+ break;
48
+ case queue_name_1.QueueName.PROD:
49
+ this.enabledQueues.add(queue_type_1.QueueType.PROD);
50
+ break;
51
+ default:
52
+ this.logger.warn(`Unknown queue in RABBITMQ_QUEUES: ${queue}`);
53
+ }
54
+ });
55
+ }
56
+ async send(data) {
57
+ const cmd = { cmd: 'scraping.completed' };
58
+ const promises = [];
59
+ this.enabledQueues.forEach((queue) => {
60
+ const client = this.clientMap.get(queue);
61
+ if (client) {
62
+ this.logger.log(`Sending data to ${queue} queue`);
63
+ promises.push(client.send(cmd, data));
64
+ }
65
+ });
66
+ if (promises.length > 0) {
67
+ await Promise.all(promises.map((x) => (0, rxjs_1.firstValueFrom)(x)));
68
+ }
69
+ }
70
+ };
71
+ exports.ProcessorService = ProcessorService;
72
+ exports.ProcessorService = ProcessorService = ProcessorService_1 = __decorate([
73
+ (0, common_1.Injectable)(),
74
+ __param(1, (0, common_1.Inject)(queue_token_1.QueueToken.DEV)),
75
+ __param(2, (0, common_1.Inject)(queue_token_1.QueueToken.QA)),
76
+ __param(3, (0, common_1.Inject)(queue_token_1.QueueToken.PROD)),
77
+ __metadata("design:paramtypes", [config_1.ConfigService,
78
+ microservices_1.ClientProxy,
79
+ microservices_1.ClientProxy,
80
+ microservices_1.ClientProxy])
81
+ ], ProcessorService);
82
+ //# sourceMappingURL=processor.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processor.service.js","sourceR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AAC,CAAA;IACtB,WAAA,IAAA,eAAM,EAAC,wBAAU,CAAC,EAAE,CAAC,CAAA;IACrB,WAAA,IAAA,eAAM,EAAC,wBAAU,CAAC,IAAI,CAAC,CAAA;qCAHC,sBAAa;QACQ,2BAAW;QACb,2BAAW;QACP,2BAAW;GATlD,gBAAgB,CAqD5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rafikidota/cuba-ofertas-scraping",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Sometimes, the best way to solve your own problems is to help someone else.",
5
5
  "repository": {
6
6
  "type": "git",