@rafikidota/cuba-ofertas-scraping 0.30.0 → 0.31.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.
- package/dist/common/enum/shop-slug.enum.d.ts +11 -0
- package/dist/common/enum/shop-slug.enum.js +16 -0
- package/dist/common/enum/shop-slug.enum.js.map +1 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.js +1 -0
- package/dist/common/index.js.map +1 -1
- package/dist/modules/health/dto/health.dto.d.ts +4 -0
- package/dist/modules/health/dto/health.dto.js +22 -0
- package/dist/modules/health/dto/health.dto.js.map +1 -0
- package/dist/modules/health/enum/health-status.d.ts +4 -0
- package/dist/modules/health/enum/health-status.js +9 -0
- package/dist/modules/health/enum/health-status.js.map +1 -0
- package/dist/modules/health/health.controller.d.ts +14 -0
- package/dist/modules/health/health.controller.js +45 -0
- package/dist/modules/health/health.controller.js.map +1 -0
- package/dist/modules/health/health.module.d.ts +2 -0
- package/dist/modules/health/health.module.js +24 -0
- package/dist/modules/health/health.module.js.map +1 -0
- package/dist/modules/health/health.service.d.ts +18 -0
- package/dist/modules/health/health.service.js +81 -0
- package/dist/modules/health/health.service.js.map +1 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/modules/index.js.map +1 -1
- package/package.json +14 -11
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum ShopSlugEnum {
|
|
2
|
+
SUPERMARKET23 = "sm23",
|
|
3
|
+
KATAPULK = "kata",
|
|
4
|
+
TUAMBIA = "tuambia",
|
|
5
|
+
ALAWAO = "alawao",
|
|
6
|
+
CUBALLAMA = "cuballama",
|
|
7
|
+
DIMECUBA = "dimecuba",
|
|
8
|
+
LAJABALINA = "jabalina",
|
|
9
|
+
MIHOGAR53 = "mh53",
|
|
10
|
+
MALLHABANA = "mallhabana"
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ShopSlugEnum = void 0;
|
|
4
|
+
var ShopSlugEnum;
|
|
5
|
+
(function (ShopSlugEnum) {
|
|
6
|
+
ShopSlugEnum["SUPERMARKET23"] = "sm23";
|
|
7
|
+
ShopSlugEnum["KATAPULK"] = "kata";
|
|
8
|
+
ShopSlugEnum["TUAMBIA"] = "tuambia";
|
|
9
|
+
ShopSlugEnum["ALAWAO"] = "alawao";
|
|
10
|
+
ShopSlugEnum["CUBALLAMA"] = "cuballama";
|
|
11
|
+
ShopSlugEnum["DIMECUBA"] = "dimecuba";
|
|
12
|
+
ShopSlugEnum["LAJABALINA"] = "jabalina";
|
|
13
|
+
ShopSlugEnum["MIHOGAR53"] = "mh53";
|
|
14
|
+
ShopSlugEnum["MALLHABANA"] = "mallhabana";
|
|
15
|
+
})(ShopSlugEnum || (exports.ShopSlugEnum = ShopSlugEnum = {}));
|
|
16
|
+
//# sourceMappingURL=shop-slug.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shop-slug.enum.js","sourceRoot":"","sources":["../../../src/common/enum/shop-slug.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB,sCAAsB,CAAA;IACtB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,kCAAkB,CAAA;IAClB,yCAAyB,CAAA;AAC3B,CAAC,EAVW,YAAY,4BAAZ,YAAY,QAUvB"}
|
package/dist/common/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './enum/scraping-label.enum';
|
|
|
19
19
|
export * from './enum/scraping-message-pattern.enum';
|
|
20
20
|
export * from './enum/scraping-result-status.enum';
|
|
21
21
|
export * from './enum/scraping-type.enum';
|
|
22
|
+
export * from './enum/shop-slug.enum';
|
|
22
23
|
export * from './env/scraper.env.config';
|
|
23
24
|
export * from './env/scraper.env.validation';
|
|
24
25
|
export * from './interface/category.interface';
|
package/dist/common/index.js
CHANGED
|
@@ -35,6 +35,7 @@ __exportStar(require("./enum/scraping-label.enum"), exports);
|
|
|
35
35
|
__exportStar(require("./enum/scraping-message-pattern.enum"), exports);
|
|
36
36
|
__exportStar(require("./enum/scraping-result-status.enum"), exports);
|
|
37
37
|
__exportStar(require("./enum/scraping-type.enum"), exports);
|
|
38
|
+
__exportStar(require("./enum/shop-slug.enum"), exports);
|
|
38
39
|
__exportStar(require("./env/scraper.env.config"), exports);
|
|
39
40
|
__exportStar(require("./env/scraper.env.validation"), exports);
|
|
40
41
|
__exportStar(require("./interface/category.interface"), exports);
|
package/dist/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,iDAA+B;AAC/B,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC;AACjC,mDAAiC;AACjC,yDAAuC;AACvC,qEAAmD;AACnD,0DAAwC;AAExC,4DAA0C;AAC1C,oDAAkC;AAClC,sDAAoC;AACpC,qDAAmC;AACnC,kDAAgC;AAEhC,oDAAkC;AAClC,sDAAoC;AACpC,2DAAyC;AACzC,6DAA2C;AAC3C,uEAAqD;AACrD,qEAAmD;AACnD,4DAA0C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,iDAA+B;AAC/B,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC;AACjC,mDAAiC;AACjC,yDAAuC;AACvC,qEAAmD;AACnD,0DAAwC;AAExC,4DAA0C;AAC1C,oDAAkC;AAClC,sDAAoC;AACpC,qDAAmC;AACnC,kDAAgC;AAEhC,oDAAkC;AAClC,sDAAoC;AACpC,2DAAyC;AACzC,6DAA2C;AAC3C,uEAAqD;AACrD,qEAAmD;AACnD,4DAA0C;AAC1C,wDAAsC;AAEtC,2DAAyC;AACzC,+DAA6C;AAE7C,iEAA+C;AAC/C,+DAA6C;AAC7C,qEAAmD;AACnD,gEAA8C;AAC9C,iEAA+C;AAC/C,iEAA+C;AAC/C,wEAAsD;AACtD,wEAAsD;AAEtD,wEAAsD;AACtD,4EAA0D;AAC1D,8EAA4D;AAC5D,2EAAyD;AACzD,kDAAgC;AAEhC,2EAAyD;AACzD,6EAA2D;AAC3D,0EAAwD;AACxD,2EAAyD;AACzD,2EAAyD;AACzD,wEAAsD;AAEtD,yEAAuD;AACvD,2EAAyD;AACzD,wEAAsD;AACtD,yEAAuD;AACvD,yEAAuD;AAEvD,+EAA6D;AAC7D,iFAA+D;AAC/D,8EAA4D;AAC5D,+EAA6D;AAC7D,+EAA6D;AAE7D,0DAAwC;AAExC,kDAAgC;AAChC,sDAAoC;AACpC,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B;AAC/B,2DAAyC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HealthCheckDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const shop_slug_enum_1 = require("../../../common/enum/shop-slug.enum");
|
|
15
|
+
class HealthCheckDto {
|
|
16
|
+
}
|
|
17
|
+
exports.HealthCheckDto = HealthCheckDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsEnum)(shop_slug_enum_1.ShopSlugEnum),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], HealthCheckDto.prototype, "slug", void 0);
|
|
22
|
+
//# sourceMappingURL=health.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.dto.js","sourceRoot":"","sources":["../../../../src/modules/health/dto/health.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAyC;AACzC,wEAAmE;AAEnE,MAAa,cAAc;CAG1B;AAHD,wCAGC;AADC;IADC,IAAA,wBAAM,EAAC,6BAAY,CAAC;;4CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HealthStatus = void 0;
|
|
4
|
+
var HealthStatus;
|
|
5
|
+
(function (HealthStatus) {
|
|
6
|
+
HealthStatus["UP"] = "up";
|
|
7
|
+
HealthStatus["DOWN"] = "down";
|
|
8
|
+
})(HealthStatus || (exports.HealthStatus = HealthStatus = {}));
|
|
9
|
+
//# sourceMappingURL=health-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-status.js","sourceRoot":"","sources":["../../../../src/modules/health/enum/health-status.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,yBAAS,CAAA;IACT,6BAAa,CAAA;AACf,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HealthCheckService } from './health.service';
|
|
2
|
+
import { HealthCheckDto } from './dto/health.dto';
|
|
3
|
+
export declare class HealthCheckController {
|
|
4
|
+
private readonly service;
|
|
5
|
+
constructor(service: HealthCheckService);
|
|
6
|
+
health({ slug }: HealthCheckDto): Promise<{
|
|
7
|
+
status: import("@nestjs/terminus").HealthCheckStatus;
|
|
8
|
+
info?: Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult>;
|
|
9
|
+
error?: Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult>;
|
|
10
|
+
details: import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult;
|
|
11
|
+
slug: import("../..").ShopSlugEnum;
|
|
12
|
+
timestamp: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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.HealthCheckController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const terminus_1 = require("@nestjs/terminus");
|
|
18
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
19
|
+
const scraping_message_pattern_enum_1 = require("../../common/enum/scraping-message-pattern.enum");
|
|
20
|
+
const validation_pipe_1 = require("../../common/pipes/validation.pipe");
|
|
21
|
+
const health_service_1 = require("./health.service");
|
|
22
|
+
const health_dto_1 = require("./dto/health.dto");
|
|
23
|
+
let HealthCheckController = class HealthCheckController {
|
|
24
|
+
constructor(service) {
|
|
25
|
+
this.service = service;
|
|
26
|
+
}
|
|
27
|
+
async health({ slug }) {
|
|
28
|
+
return await this.service.health({ slug });
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.HealthCheckController = HealthCheckController;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, terminus_1.HealthCheck)(),
|
|
34
|
+
(0, microservices_1.MessagePattern)({ cmd: scraping_message_pattern_enum_1.ScraperMessagePatternEnum.HEALTH }),
|
|
35
|
+
(0, common_1.UsePipes)((0, validation_pipe_1.ValidationPipe)(health_dto_1.HealthCheckDto)),
|
|
36
|
+
__param(0, (0, microservices_1.Payload)()),
|
|
37
|
+
__metadata("design:type", Function),
|
|
38
|
+
__metadata("design:paramtypes", [health_dto_1.HealthCheckDto]),
|
|
39
|
+
__metadata("design:returntype", Promise)
|
|
40
|
+
], HealthCheckController.prototype, "health", null);
|
|
41
|
+
exports.HealthCheckController = HealthCheckController = __decorate([
|
|
42
|
+
(0, common_1.Controller)(),
|
|
43
|
+
__metadata("design:paramtypes", [health_service_1.HealthCheckService])
|
|
44
|
+
], HealthCheckController);
|
|
45
|
+
//# sourceMappingURL=health.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.controller.js","sourceRoot":"","sources":["../../../src/modules/health/health.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,+CAA+C;AAC/C,yDAAgE;AAEhE,mGAA4F;AAC5F,wEAAoE;AACpE,qDAAsD;AACtD,iDAAkD;AAG3C,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YAA6B,OAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;IAAG,CAAC;IAKtD,AAAN,KAAK,CAAC,MAAM,CAAY,EAAE,IAAI,EAAkB;QAC9C,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF,CAAA;AATY,sDAAqB;AAM1B;IAHL,IAAA,sBAAW,GAAE;IACb,IAAA,8BAAc,EAAC,EAAE,GAAG,EAAE,yDAAyB,CAAC,MAAM,EAAE,CAAC;IACzD,IAAA,iBAAQ,EAAC,IAAA,gCAAc,EAAC,2BAAc,CAAC,CAAC;IAC3B,WAAA,IAAA,uBAAO,GAAE,CAAA;;qCAAW,2BAAc;;mDAE/C;gCARU,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAE2B,mCAAkB;GAD7C,qBAAqB,CASjC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.HealthCheckModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const terminus_1 = require("@nestjs/terminus");
|
|
12
|
+
const health_service_1 = require("./health.service");
|
|
13
|
+
const health_controller_1 = require("./health.controller");
|
|
14
|
+
let HealthCheckModule = class HealthCheckModule {
|
|
15
|
+
};
|
|
16
|
+
exports.HealthCheckModule = HealthCheckModule;
|
|
17
|
+
exports.HealthCheckModule = HealthCheckModule = __decorate([
|
|
18
|
+
(0, common_1.Module)({
|
|
19
|
+
imports: [terminus_1.TerminusModule],
|
|
20
|
+
controllers: [health_controller_1.HealthCheckController],
|
|
21
|
+
providers: [health_service_1.HealthCheckService],
|
|
22
|
+
})
|
|
23
|
+
], HealthCheckModule);
|
|
24
|
+
//# sourceMappingURL=health.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.module.js","sourceRoot":"","sources":["../../../src/modules/health/health.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAElD,qDAAsD;AACtD,2DAA4D;AAOrD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,8CAAiB;4BAAjB,iBAAiB;IAL7B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yBAAc,CAAC;QACzB,WAAW,EAAE,CAAC,yCAAqB,CAAC;QACpC,SAAS,EAAE,CAAC,mCAAkB,CAAC;KAChC,CAAC;GACW,iBAAiB,CAAG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HealthCheckService as NestHealthCheckService } from '@nestjs/terminus';
|
|
2
|
+
import { HealthIndicatorResult } from '@nestjs/terminus';
|
|
3
|
+
import { HealthCheckDto } from './dto/health.dto';
|
|
4
|
+
export declare class HealthCheckService {
|
|
5
|
+
private readonly service;
|
|
6
|
+
constructor(service: NestHealthCheckService);
|
|
7
|
+
health({ slug }: HealthCheckDto): Promise<{
|
|
8
|
+
status: import("@nestjs/terminus").HealthCheckStatus;
|
|
9
|
+
info?: Partial<HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & HealthIndicatorResult>;
|
|
10
|
+
error?: Partial<HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & HealthIndicatorResult>;
|
|
11
|
+
details: HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & HealthIndicatorResult;
|
|
12
|
+
slug: import("../..").ShopSlugEnum;
|
|
13
|
+
timestamp: string;
|
|
14
|
+
}>;
|
|
15
|
+
private memory;
|
|
16
|
+
private cpu;
|
|
17
|
+
private process;
|
|
18
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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.HealthCheckService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
18
|
+
const terminus_1 = require("@nestjs/terminus");
|
|
19
|
+
const health_dto_1 = require("./dto/health.dto");
|
|
20
|
+
const health_status_1 = require("./enum/health-status");
|
|
21
|
+
let HealthCheckService = class HealthCheckService {
|
|
22
|
+
constructor(service) {
|
|
23
|
+
this.service = service;
|
|
24
|
+
}
|
|
25
|
+
async health({ slug }) {
|
|
26
|
+
const result = await this.service.check([
|
|
27
|
+
() => this.process(),
|
|
28
|
+
() => this.memory(),
|
|
29
|
+
() => this.cpu(),
|
|
30
|
+
]);
|
|
31
|
+
return { slug, timestamp: new Date().toISOString(), ...result };
|
|
32
|
+
}
|
|
33
|
+
memory() {
|
|
34
|
+
const memory = process.memoryUsage();
|
|
35
|
+
const details = {
|
|
36
|
+
rss: Math.round((memory.rss / 1024 / 1024) * 100) / 100,
|
|
37
|
+
heapUsed: Math.round((memory.heapUsed / 1024 / 1024) * 100) / 100,
|
|
38
|
+
heapTotal: Math.round((memory.heapTotal / 1024 / 1024) * 100) / 100,
|
|
39
|
+
external: Math.round((memory.external / 1024 / 1024) * 100) / 100,
|
|
40
|
+
};
|
|
41
|
+
const status = details.heapUsed < 500 ? health_status_1.HealthStatus.UP : health_status_1.HealthStatus.DOWN;
|
|
42
|
+
return { memory: { status, details } };
|
|
43
|
+
}
|
|
44
|
+
cpu() {
|
|
45
|
+
const usage = process.cpuUsage();
|
|
46
|
+
const uptime = process.uptime();
|
|
47
|
+
const percent = ((usage.user + usage.system) / (uptime * 1000000)) * 100;
|
|
48
|
+
const status = percent < 80 ? health_status_1.HealthStatus.UP : health_status_1.HealthStatus.DOWN;
|
|
49
|
+
const details = {
|
|
50
|
+
user: usage.user,
|
|
51
|
+
system: usage.system,
|
|
52
|
+
percent: Math.round(percent * 100) / 100,
|
|
53
|
+
};
|
|
54
|
+
return { cpu: { status, details } };
|
|
55
|
+
}
|
|
56
|
+
process() {
|
|
57
|
+
return {
|
|
58
|
+
process: {
|
|
59
|
+
status: health_status_1.HealthStatus.UP,
|
|
60
|
+
details: {
|
|
61
|
+
pid: process.pid,
|
|
62
|
+
uptime: Math.round(process.uptime() * 100) / 100,
|
|
63
|
+
platform: process.platform,
|
|
64
|
+
nodeVersion: process.version,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.HealthCheckService = HealthCheckService;
|
|
71
|
+
__decorate([
|
|
72
|
+
__param(0, (0, microservices_1.Payload)()),
|
|
73
|
+
__metadata("design:type", Function),
|
|
74
|
+
__metadata("design:paramtypes", [health_dto_1.HealthCheckDto]),
|
|
75
|
+
__metadata("design:returntype", Promise)
|
|
76
|
+
], HealthCheckService.prototype, "health", null);
|
|
77
|
+
exports.HealthCheckService = HealthCheckService = __decorate([
|
|
78
|
+
(0, common_1.Injectable)(),
|
|
79
|
+
__metadata("design:paramtypes", [terminus_1.HealthCheckService])
|
|
80
|
+
], HealthCheckService);
|
|
81
|
+
//# sourceMappingURL=health.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.service.js","sourceRoot":"","sources":["../../../src/modules/health/health.service.ts"],"names":[],"mappings":"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"}
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './delayer/delayer.service';
|
|
|
13
13
|
export * from './delayer/use-cases/delayer-config.service';
|
|
14
14
|
export * from './delayer/use-cases/delayer-mapper.service';
|
|
15
15
|
export * from './delayer/use-cases/delayer-sleeper.service';
|
|
16
|
+
export * from './health/health.module';
|
|
16
17
|
export * from './minio/minio.module';
|
|
17
18
|
export * from './minio/minio.service';
|
|
18
19
|
export * from './minio/env/minio.env.config';
|
package/dist/modules/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __exportStar(require("./delayer/delayer.service"), exports);
|
|
|
29
29
|
__exportStar(require("./delayer/use-cases/delayer-config.service"), exports);
|
|
30
30
|
__exportStar(require("./delayer/use-cases/delayer-mapper.service"), exports);
|
|
31
31
|
__exportStar(require("./delayer/use-cases/delayer-sleeper.service"), exports);
|
|
32
|
+
__exportStar(require("./health/health.module"), exports);
|
|
32
33
|
__exportStar(require("./minio/minio.module"), exports);
|
|
33
34
|
__exportStar(require("./minio/minio.service"), exports);
|
|
34
35
|
__exportStar(require("./minio/env/minio.env.config"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,4DAA0C;AAC1C,8EAA4D;AAC5D,sFAAoE;AACpE,oFAAkE;AAClE,8EAA4D;AAE5D,iEAA+C;AAC/C,kEAAgD;AAEhD,iEAA+C;AAC/C,qEAAmD;AACnD,2DAAyC;AACzC,4DAA0C;AAC1C,6EAA2D;AAC3D,6EAA2D;AAC3D,8EAA4D;AAE5D,uDAAqC;AACrC,wDAAsC;AACtC,+DAA6C;AAC7C,mEAAiD;AAEjD,+DAA6C;AAC7C,gEAA8C;AAE9C,+DAA6C;AAC7C,gEAA8C;AAE9C,qEAAmD;AACnD,yEAAuD;AACvD,6DAA2C;AAC3C,8DAA4C;AAE5C,iEAA+C;AAC/C,kEAAgD;AAEhD,2DAAyC;AACzC,4DAA0C;AAE1C,qEAAmD;AACnD,yEAAuD;AACvD,6DAA2C;AAC3C,8DAA4C;AAE5C,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,8EAA4D;AAC5D,sFAAoE;AACpE,oFAAkE;AAClE,8EAA4D;AAE5D,iEAA+C;AAC/C,kEAAgD;AAEhD,iEAA+C;AAC/C,qEAAmD;AACnD,2DAAyC;AACzC,4DAA0C;AAC1C,6EAA2D;AAC3D,6EAA2D;AAC3D,8EAA4D;AAE5D,yDAAuC;AAEvC,uDAAqC;AACrC,wDAAsC;AACtC,+DAA6C;AAC7C,mEAAiD;AAEjD,+DAA6C;AAC7C,gEAA8C;AAE9C,+DAA6C;AAC7C,gEAA8C;AAE9C,qEAAmD;AACnD,yEAAuD;AACvD,6DAA2C;AAC3C,8DAA4C;AAE5C,iEAA+C;AAC/C,kEAAgD;AAEhD,2DAAyC;AACzC,4DAA0C;AAE1C,qEAAmD;AACnD,yEAAuD;AACvD,6DAA2C;AAC3C,8DAA4C;AAE5C,6DAA2C;AAC3C,8DAA4C;AAE5C,uEAAqD;AACrD,2EAAyD;AACzD,+DAA6C;AAC7C,gEAA8C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rafikidota/cuba-ofertas-scraping",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.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",
|
|
@@ -15,26 +15,29 @@
|
|
|
15
15
|
"module": "./dist/index.js",
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@aws-sdk/client-s3": "3.
|
|
19
|
-
"@aws-sdk/s3-request-presigner": "3.
|
|
18
|
+
"@aws-sdk/client-s3": "3.1011.0",
|
|
19
|
+
"@aws-sdk/s3-request-presigner": "3.1011.0",
|
|
20
20
|
"@crawlee/cheerio": "3.16.0",
|
|
21
21
|
"@crawlee/playwright": "3.16.0",
|
|
22
22
|
"@eslint/eslintrc": "3.3.5",
|
|
23
23
|
"@eslint/js": "10.0.1",
|
|
24
24
|
"@nestjs/axios": "4.0.1",
|
|
25
|
-
"@nestjs/common": "11.1.
|
|
25
|
+
"@nestjs/common": "11.1.17",
|
|
26
26
|
"@nestjs/config": "4.0.3",
|
|
27
|
-
"@nestjs/core": "11.1.
|
|
27
|
+
"@nestjs/core": "11.1.17",
|
|
28
28
|
"@nestjs/event-emitter": "3.0.1",
|
|
29
|
-
"@nestjs/microservices": "11.1.
|
|
29
|
+
"@nestjs/microservices": "11.1.17",
|
|
30
30
|
"@nestjs/schedule": "6.1.1",
|
|
31
|
+
"@nestjs/terminus": "11.1.1",
|
|
31
32
|
"@types/archiver": "7.0.0",
|
|
32
|
-
"@types/node": "25.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
34
|
-
"@typescript-eslint/parser": "8.
|
|
33
|
+
"@types/node": "25.5.0",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "8.57.1",
|
|
35
|
+
"@typescript-eslint/parser": "8.57.1",
|
|
35
36
|
"archiver": "7.0.1",
|
|
36
37
|
"axios": "1.13.6",
|
|
37
38
|
"cheerio": "1.2.0",
|
|
39
|
+
"class-transformer": "0.5.1",
|
|
40
|
+
"class-validator": "0.15.1",
|
|
38
41
|
"crawlee": "3.16.0",
|
|
39
42
|
"dotenv": "17.3.1",
|
|
40
43
|
"eslint": "10.0.3",
|
|
@@ -45,14 +48,14 @@
|
|
|
45
48
|
"https-proxy-agent": "7.0.6",
|
|
46
49
|
"husky": "9.1.7",
|
|
47
50
|
"joi": "18.0.2",
|
|
48
|
-
"lint-staged": "16.
|
|
51
|
+
"lint-staged": "16.4.0",
|
|
49
52
|
"playwright": "1.58.2",
|
|
50
53
|
"prettier": "3.8.1",
|
|
51
54
|
"rimraf": "6.1.3",
|
|
52
55
|
"rxjs": "7.8.2",
|
|
53
56
|
"telegraf": "4.16.3",
|
|
54
57
|
"typescript": "5.9.3",
|
|
55
|
-
"typescript-eslint": "8.
|
|
58
|
+
"typescript-eslint": "8.57.1"
|
|
56
59
|
},
|
|
57
60
|
"scripts": {
|
|
58
61
|
"prebuild": "rimraf -rf dist",
|