@seas-computing/nestjs-healthcheck 0.0.13-1 → 0.0.13

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.
Files changed (35) hide show
  1. package/README.md +22 -11
  2. package/lib/ValkeyHealthService.d.ts +7 -0
  3. package/lib/ValkeyHealthService.js +60 -0
  4. package/lib/ValkeyHealthService.js.map +1 -0
  5. package/lib/constants.d.ts +4 -0
  6. package/lib/constants.js +9 -0
  7. package/lib/constants.js.map +1 -0
  8. package/lib/healthcheck.controller.d.ts +12 -0
  9. package/lib/healthcheck.controller.js +72 -0
  10. package/lib/healthcheck.controller.js.map +1 -0
  11. package/lib/healthcheck.module-definition.d.ts +2 -0
  12. package/lib/healthcheck.module-definition.js +7 -0
  13. package/lib/healthcheck.module-definition.js.map +1 -0
  14. package/lib/healthcheck.module.d.ts +3 -0
  15. package/lib/healthcheck.module.js +31 -0
  16. package/lib/healthcheck.module.js.map +1 -0
  17. package/lib/index.d.ts +7 -0
  18. package/lib/index.js +26 -0
  19. package/lib/index.js.map +1 -0
  20. package/lib/types/BuildVersionHealthIndicator.interface.d.ts +4 -0
  21. package/lib/types/BuildVersionHealthIndicator.interface.js +3 -0
  22. package/lib/types/BuildVersionHealthIndicator.interface.js.map +1 -0
  23. package/lib/types/ConfigServiceInterface.d.ts +4 -0
  24. package/lib/types/ConfigServiceInterface.js +3 -0
  25. package/lib/types/ConfigServiceInterface.js.map +1 -0
  26. package/lib/types/CustomHealthCheckResponse.d.ts +10 -0
  27. package/lib/types/CustomHealthCheckResponse.js +3 -0
  28. package/lib/types/CustomHealthCheckResponse.js.map +1 -0
  29. package/lib/types/ValkeyHealthIndicator.interface.d.ts +5 -0
  30. package/lib/types/ValkeyHealthIndicator.interface.js +3 -0
  31. package/lib/types/ValkeyHealthIndicator.interface.js.map +1 -0
  32. package/lib/types/healthcheckModuleOptions.d.ts +9 -0
  33. package/lib/types/healthcheckModuleOptions.js +4 -0
  34. package/lib/types/healthcheckModuleOptions.js.map +1 -0
  35. package/package.json +1 -1
package/README.md CHANGED
@@ -16,12 +16,25 @@ npm install @seas-computing/nestjs-healthcheck
16
16
  To add the nestjs healthcheck system, you should make the following changes in the consuming application's `AppModule` (or other root module):
17
17
  - be sure that the `ConfigModule` is at the top of the imports list
18
18
  - import and register the `HealthcheckModule` using `registerAsync`
19
- - import `TypeOrmModule` and `ValkeyModule`
19
+ - import `TypeOrmModule` and `RedisModule`
20
20
 
21
21
  In the `ConfigService`, configuration values (i.e. `HealthcheckModuleOptions`) should be made available and passed as options to the `HealthcheckModule`.
22
22
 
23
- Example `app.module` from [oap-grad-database](https://github.huit.harvard.edu/SEAS/oap-grad-database/blob/develop/src/server/app.module.ts):
23
+ Example `app.module` based on [oap-grad-database](https://github.huit.harvard.edu/SEAS/oap-grad-database/blob/develop/src/server/app.module.ts):
24
24
  ```ts
25
+ import { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common';
26
+ import { LogMiddleware, LogModule } from '@seas-computing/nestjs-logging';
27
+ import { TypeOrmModule, TypeOrmModuleOptions } from '@nestjs/typeorm';
28
+ import { HarvardKeyModule } from '@seas-computing/nestjs-harvard-key';
29
+ import { SessionModule, NestSessionOptions } from 'nestjs-session';
30
+ import { RedisStore } from 'connect-redis';
31
+ import { RedisModule, RedisModuleOptions } from '@nestjs-modules/ioredis';
32
+ import { HealthcheckModule, HealthcheckModuleOptions } from '@seas-computing/nestjs-healthcheck';
33
+ import Redis from 'iovalkey';
34
+ import { ConfigModule } from './config/config.module';
35
+ import { ConfigService } from './config/config.service';
36
+ import { HealthCheckModule } from './healthCheck/healthCheck.module';
37
+
25
38
  @Module({
26
39
  imports: [
27
40
  ConfigModule, // Ensure this is at the top
@@ -77,13 +90,6 @@ Example `app.module` from [oap-grad-database](https://github.huit.harvard.edu/SE
77
90
  },
78
91
  }),
79
92
  }),
80
- AdvisorModule,
81
- StudentModule,
82
- StudentToAdvisorModule,
83
- NoteModule,
84
- ThesisModule,
85
- DegreeProgramModule,
86
- MilestonesModule,
87
93
  HealthcheckModule.registerAsync({ // Add HealthcheckModule
88
94
  imports: [ConfigModule],
89
95
  inject: [ConfigService],
@@ -149,7 +155,7 @@ public get healthcheckConfig(): HealthcheckModuleOptions {
149
155
  oidcCheckURL: this.oidcCheckURL,
150
156
  dbOptions: this.dbOptions,
151
157
  valkeyURL: this.valkeyURL,
152
- version: this.buildVersion,
158
+ buildVersion: this.buildVersion,
153
159
  strategy: this.isProduction
154
160
  ? HEALTH_STRATEGY_NAME.HEALTHCHECK
155
161
  : HEALTH_STRATEGY_NAME.DEV,
@@ -159,7 +165,12 @@ public get healthcheckConfig(): HealthcheckModuleOptions {
159
165
 
160
166
  ## Sample Response
161
167
 
162
- You should receive a response that looks like this:
168
+ After running
169
+ ```
170
+ curl http://127.0.0.1:3001/[yourAppName]/health-check
171
+ ```
172
+
173
+ from the cli, you should receive a response that looks like this:
163
174
 
164
175
  ```json
165
176
  {
@@ -0,0 +1,7 @@
1
+ import { HealthIndicatorResult } from '@nestjs/terminus';
2
+ import Valkey from 'iovalkey';
3
+ export declare class ValkeyHealthService {
4
+ private readonly valkeyClient;
5
+ constructor(valkeyClient: Valkey);
6
+ checkValkeyConnection(): Promise<HealthIndicatorResult>;
7
+ }
@@ -0,0 +1,60 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ValkeyHealthService = void 0;
19
+ const common_1 = require("@nestjs/common");
20
+ const iovalkey_1 = __importDefault(require("iovalkey"));
21
+ const ioredis_1 = require("@nestjs-modules/ioredis");
22
+ let ValkeyHealthService = class ValkeyHealthService {
23
+ constructor(valkeyClient) {
24
+ this.valkeyClient = valkeyClient;
25
+ }
26
+ async checkValkeyConnection() {
27
+ try {
28
+ const result = await this.valkeyClient.ping();
29
+ return {
30
+ valkey: {
31
+ status: 'up',
32
+ result,
33
+ },
34
+ };
35
+ }
36
+ catch (error) {
37
+ if (error instanceof Error) {
38
+ return {
39
+ valkey: {
40
+ status: 'down',
41
+ message: error.message,
42
+ },
43
+ };
44
+ }
45
+ return {
46
+ valkey: {
47
+ status: 'down',
48
+ message: 'Could not connect to Valkey.',
49
+ },
50
+ };
51
+ }
52
+ }
53
+ };
54
+ exports.ValkeyHealthService = ValkeyHealthService;
55
+ exports.ValkeyHealthService = ValkeyHealthService = __decorate([
56
+ (0, common_1.Injectable)(),
57
+ __param(0, (0, ioredis_1.InjectRedis)()),
58
+ __metadata("design:paramtypes", [iovalkey_1.default])
59
+ ], ValkeyHealthService);
60
+ //# sourceMappingURL=ValkeyHealthService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValkeyHealthService.js","sourceRoot":"","sources":["../src/ValkeyHealthService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAE5C,wDAA8B;AAC9B,qDAAsD;AAS/C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACkC,YAAoB;QAApB,iBAAY,GAAZ,YAAY,CAAQ;IACnD,CAAC;IAEG,KAAK,CAAC,qBAAqB;QAChC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;YAE9C,OAAO;gBACL,MAAM,EAAE;oBACN,MAAM,EAAE,IAAI;oBACZ,MAAM;iBACP;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,OAAO;oBACL,MAAM,EAAE;wBACN,MAAM,EAAE,MAAM;wBACd,OAAO,EAAE,KAAK,CAAC,OAAO;qBACvB;iBACF,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,MAAM,EAAE;oBACN,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,8BAA8B;iBACxC;aACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAhCY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,qBAAW,GAAE,CAAA;qCAAgC,kBAAM;GAF3C,mBAAmB,CAgC/B"}
@@ -0,0 +1,4 @@
1
+ export declare enum HEALTH_STRATEGY_NAME {
2
+ HEALTHCHECK = "HealthcheckStrategy",
3
+ DEV = "DevStrategy"
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HEALTH_STRATEGY_NAME = void 0;
4
+ var HEALTH_STRATEGY_NAME;
5
+ (function (HEALTH_STRATEGY_NAME) {
6
+ HEALTH_STRATEGY_NAME["HEALTHCHECK"] = "HealthcheckStrategy";
7
+ HEALTH_STRATEGY_NAME["DEV"] = "DevStrategy";
8
+ })(HEALTH_STRATEGY_NAME || (exports.HEALTH_STRATEGY_NAME = HEALTH_STRATEGY_NAME = {}));
9
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAGA,IAAY,oBAqBX;AArBD,WAAY,oBAAoB;IAI9B,2DAAmC,CAAA;IAgBnC,2CAAmB,CAAA;AACrB,CAAC,EArBW,oBAAoB,oCAApB,oBAAoB,QAqB/B"}
@@ -0,0 +1,12 @@
1
+ import { HealthCheckService, TypeOrmHealthIndicator, HealthCheckResult, HttpHealthIndicator } from '@nestjs/terminus';
2
+ import { ConfigServiceInterface } from './types/ConfigServiceInterface';
3
+ import { ValkeyHealthService } from './ValkeyHealthService';
4
+ export declare class HealthCheckController {
5
+ private config;
6
+ private health;
7
+ private db;
8
+ private http;
9
+ private valkeyHealth;
10
+ constructor(config: ConfigServiceInterface, health: HealthCheckService, db: TypeOrmHealthIndicator, http: HttpHealthIndicator, valkeyHealth: ValkeyHealthService);
11
+ getHealthCheck(): Promise<HealthCheckResult>;
12
+ }
@@ -0,0 +1,72 @@
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 swagger_1 = require("@nestjs/swagger");
18
+ const terminus_1 = require("@nestjs/terminus");
19
+ const ValkeyHealthService_1 = require("./ValkeyHealthService");
20
+ const healthcheck_module_definition_1 = require("./healthcheck.module-definition");
21
+ let HealthCheckController = class HealthCheckController {
22
+ constructor(config, health, db, http, valkeyHealth) {
23
+ this.config = config;
24
+ this.health = health;
25
+ this.db = db;
26
+ this.http = http;
27
+ this.valkeyHealth = valkeyHealth;
28
+ }
29
+ async getHealthCheck() {
30
+ const status = await this.health.check([
31
+ () => this.db.pingCheck('database'),
32
+ () => this.http.pingCheck('harvard-key', this.config.oidcCheckURL),
33
+ async () => this.valkeyHealth.checkValkeyConnection(),
34
+ () => ({
35
+ buildVersion: {
36
+ status: 'up',
37
+ version: this.config.buildVersion,
38
+ },
39
+ }),
40
+ ]);
41
+ return status;
42
+ }
43
+ };
44
+ exports.HealthCheckController = HealthCheckController;
45
+ __decorate([
46
+ (0, common_1.Get)('/'),
47
+ (0, swagger_1.ApiOperation)({
48
+ summary: 'While the server is active, return a 200 status code',
49
+ }),
50
+ (0, swagger_1.ApiOkResponse)({
51
+ description: 'A 200 response',
52
+ isArray: false,
53
+ }),
54
+ (0, terminus_1.HealthCheck)(),
55
+ __metadata("design:type", Function),
56
+ __metadata("design:paramtypes", []),
57
+ __metadata("design:returntype", Promise)
58
+ ], HealthCheckController.prototype, "getHealthCheck", null);
59
+ exports.HealthCheckController = HealthCheckController = __decorate([
60
+ (0, swagger_1.ApiTags)('Health Check'),
61
+ (0, common_1.Controller)('health-check'),
62
+ __param(0, (0, common_1.Inject)(healthcheck_module_definition_1.MODULE_OPTIONS_TOKEN)),
63
+ __param(1, (0, common_1.Inject)(terminus_1.HealthCheckService)),
64
+ __param(2, (0, common_1.Inject)(terminus_1.TypeOrmHealthIndicator)),
65
+ __param(3, (0, common_1.Inject)(terminus_1.HttpHealthIndicator)),
66
+ __param(4, (0, common_1.Inject)(ValkeyHealthService_1.ValkeyHealthService)),
67
+ __metadata("design:paramtypes", [Object, terminus_1.HealthCheckService,
68
+ terminus_1.TypeOrmHealthIndicator,
69
+ terminus_1.HttpHealthIndicator,
70
+ ValkeyHealthService_1.ValkeyHealthService])
71
+ ], HealthCheckController);
72
+ //# sourceMappingURL=healthcheck.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healthcheck.controller.js","sourceRoot":"","sources":["../src/healthcheck.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyD;AACzD,6CAAuE;AACvE,+CAAmI;AAEnI,+DAA4D;AAC5D,mFAAuE;AAIhE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAEhC,YACwC,MAA8B,EAChC,MAA0B,EACtB,EAA0B,EAC7B,IAAyB,EACzB,YAAiC;QAJhC,WAAM,GAAN,MAAM,CAAwB;QAChC,WAAM,GAAN,MAAM,CAAoB;QACtB,OAAE,GAAF,EAAE,CAAwB;QAC7B,SAAI,GAAJ,IAAI,CAAqB;QACzB,iBAAY,GAAZ,YAAY,CAAqB;IACrE,CAAC;IAcS,AAAN,KAAK,CAAC,cAAc;QAEzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YACrC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC;YACnC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CACvB,aAAa,EACb,IAAI,CAAC,MAAM,CAAC,YAAY,CACzB;YACD,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,qBAAqB,EAAE;YACrD,GAAG,EAAE,CAAC,CAAC;gBACL,YAAY,EAAE;oBACZ,MAAM,EAAE,IAAI;oBACZ,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY;iBAClC;aACF,CAAC;SACH,CACA,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AAzCY,sDAAqB;AAsBnB;IATZ,IAAA,YAAG,EAAC,GAAG,CAAC;IACR,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,sDAAsD;KAChE,CAAC;IACD,IAAA,uBAAa,EAAC;QACb,WAAW,EAAE,gBAAgB;QAC7B,OAAO,EAAE,KAAK;KACf,CAAC;IACD,IAAA,sBAAW,GAAE;;;;2DAmBb;gCAxCU,qBAAqB;IAFjC,IAAA,iBAAO,EAAC,cAAc,CAAC;IACvB,IAAA,mBAAU,EAAC,cAAc,CAAC;IAItB,WAAA,IAAA,eAAM,EAAC,oDAAoB,CAAC,CAAA;IAC5B,WAAA,IAAA,eAAM,EAAC,6BAAkB,CAAC,CAAA;IAC1B,WAAA,IAAA,eAAM,EAAC,iCAAsB,CAAC,CAAA;IAC9B,WAAA,IAAA,eAAM,EAAC,8BAAmB,CAAC,CAAA;IAC3B,WAAA,IAAA,eAAM,EAAC,yCAAmB,CAAC,CAAA;6CAHgB,6BAAkB;QAClB,iCAAsB;QACvB,8BAAmB;QACX,yCAAmB;GAP7D,qBAAqB,CAyCjC"}
@@ -0,0 +1,2 @@
1
+ import { HealthcheckModuleOptions } from './types/healthcheckModuleOptions';
2
+ export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<HealthcheckModuleOptions, "register", "create", {}>, MODULE_OPTIONS_TOKEN: string | symbol;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = void 0;
5
+ const common_1 = require("@nestjs/common");
6
+ _a = new common_1.ConfigurableModuleBuilder().build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN;
7
+ //# sourceMappingURL=healthcheck.module-definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healthcheck.module-definition.js","sourceRoot":"","sources":["../src/healthcheck.module-definition.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAO9C,KAGT,IAAI,kCAAyB,EAA4B,CAAC,KAAK,EAAE,EAFnE,+BAAuB,+BACvB,4BAAoB,2BACgD"}
@@ -0,0 +1,3 @@
1
+ import { ConfigurableModuleClass } from './healthcheck.module-definition';
2
+ export declare class HealthcheckModule extends ConfigurableModuleClass {
3
+ }
@@ -0,0 +1,31 @@
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 axios_1 = require("@nestjs/axios");
13
+ const typeorm_1 = require("@nestjs/typeorm");
14
+ const healthcheck_controller_1 = require("./healthcheck.controller");
15
+ const ValkeyHealthService_1 = require("./ValkeyHealthService");
16
+ const healthcheck_module_definition_1 = require("./healthcheck.module-definition");
17
+ let HealthcheckModule = class HealthcheckModule extends healthcheck_module_definition_1.ConfigurableModuleClass {
18
+ };
19
+ exports.HealthcheckModule = HealthcheckModule;
20
+ exports.HealthcheckModule = HealthcheckModule = __decorate([
21
+ (0, common_1.Module)({
22
+ imports: [
23
+ terminus_1.TerminusModule,
24
+ axios_1.HttpModule,
25
+ typeorm_1.TypeOrmModule.forFeature([]),
26
+ ],
27
+ controllers: [healthcheck_controller_1.HealthCheckController],
28
+ providers: [ValkeyHealthService_1.ValkeyHealthService],
29
+ })
30
+ ], HealthcheckModule);
31
+ //# sourceMappingURL=healthcheck.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healthcheck.module.js","sourceRoot":"","sources":["../src/healthcheck.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,yCAA2C;AAC3C,6CAAgD;AAChD,qEAAiE;AACjE,+DAA4D;AAC5D,mFAA0E;AAYnE,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,uDAAuB;CAAG,CAAA;AAApD,8CAAiB;4BAAjB,iBAAiB;IAV7B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,yBAAc;YACd,kBAAU;YACV,uBAAa,CAAC,UAAU,CAAC,EAAE,CAAC;SAC7B;QACD,WAAW,EAAE,CAAC,8CAAqB,CAAC;QACpC,SAAS,EAAE,CAAC,yCAAmB,CAAC;KACjC,CAAC;GAEW,iBAAiB,CAAmC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export { HealthcheckModule } from './healthcheck.module';
2
+ export * from './healthcheck.controller';
3
+ export * from './ValkeyHealthService';
4
+ export * from './types/ConfigServiceInterface';
5
+ export * from './types/healthcheckModuleOptions';
6
+ export * from './constants';
7
+ export * from './healthcheck.module-definition';
package/lib/index.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.HealthcheckModule = void 0;
18
+ var healthcheck_module_1 = require("./healthcheck.module");
19
+ Object.defineProperty(exports, "HealthcheckModule", { enumerable: true, get: function () { return healthcheck_module_1.HealthcheckModule; } });
20
+ __exportStar(require("./healthcheck.controller"), exports);
21
+ __exportStar(require("./ValkeyHealthService"), exports);
22
+ __exportStar(require("./types/ConfigServiceInterface"), exports);
23
+ __exportStar(require("./types/healthcheckModuleOptions"), exports);
24
+ __exportStar(require("./constants"), exports);
25
+ __exportStar(require("./healthcheck.module-definition"), exports);
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,2DAAyC;AACzC,wDAAsC;AACtC,iEAA+C;AAC/C,mEAAiD;AACjD,8CAA4B;AAC5B,kEAAgD"}
@@ -0,0 +1,4 @@
1
+ import { HealthIndicatorStatus, HealthIndicatorResult } from '@nestjs/terminus';
2
+ export type BuildVersionHealthIndicatorResult = HealthIndicatorResult<'buildVersion', HealthIndicatorStatus, Partial<{
3
+ version: string;
4
+ }>>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BuildVersionHealthIndicator.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildVersionHealthIndicator.interface.js","sourceRoot":"","sources":["../../src/types/BuildVersionHealthIndicator.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export interface ConfigServiceInterface {
2
+ oidcCheckURL: string;
3
+ buildVersion: string;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ConfigServiceInterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigServiceInterface.js","sourceRoot":"","sources":["../../src/types/ConfigServiceInterface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { HealthCheckResult as TerminusHealthCheckResult, HealthIndicatorResult as TerminusHealthIndicatorResult } from '@nestjs/terminus';
2
+ import { ValkeyHealthIndicatorResult } from './ValkeyHealthIndicator.interface';
3
+ import { BuildVersionHealthIndicatorResult } from './BuildVersionHealthIndicator.interface';
4
+ type CustomHealthIndicatorResult = TerminusHealthIndicatorResult<'database' | 'harvard-key' | 'valkey' | 'buildVersion'> & ValkeyHealthIndicatorResult & BuildVersionHealthIndicatorResult;
5
+ export interface CustomHealthCheckResult extends TerminusHealthCheckResult {
6
+ info?: CustomHealthIndicatorResult;
7
+ error?: CustomHealthIndicatorResult;
8
+ details: CustomHealthIndicatorResult;
9
+ }
10
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=CustomHealthCheckResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomHealthCheckResponse.js","sourceRoot":"","sources":["../../src/types/CustomHealthCheckResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { HealthIndicatorStatus, HealthIndicatorResult } from '@nestjs/terminus';
2
+ export type ValkeyHealthIndicatorResult = HealthIndicatorResult<'valkey', HealthIndicatorStatus, Partial<{
3
+ result: string;
4
+ message: string;
5
+ }>>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ValkeyHealthIndicator.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValkeyHealthIndicator.interface.js","sourceRoot":"","sources":["../../src/types/ValkeyHealthIndicator.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { TypeOrmModuleOptions } from '@nestjs/typeorm';
2
+ import { HEALTH_STRATEGY_NAME } from '../constants';
3
+ export interface HealthcheckModuleOptions {
4
+ oidcCheckURL: string;
5
+ dbOptions: TypeOrmModuleOptions;
6
+ valkeyURL: string;
7
+ buildVersion: string;
8
+ strategy: HEALTH_STRATEGY_NAME;
9
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ ;
4
+ //# sourceMappingURL=healthcheckModuleOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healthcheckModuleOptions.js","sourceRoot":"","sources":["../../src/types/healthcheckModuleOptions.ts"],"names":[],"mappings":";;AAYC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seas-computing/nestjs-healthcheck",
3
- "version": "0.0.13-1",
3
+ "version": "0.0.13",
4
4
  "description": "A standalone healthcheck module for NestJS apps",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",