@visulima/health-check 2.0.20 → 2.0.21
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/CHANGELOG.md +10 -0
- package/README.md +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/packem_shared/{httpCheck-CmLmorh2.cjs → httpCheck-BS8O0ZEs.cjs} +2 -2
- package/dist/packem_shared/{httpCheck-ivA5vEeE.mjs → httpCheck-hHYnlgcd.mjs} +2 -2
- package/dist/packem_shared/{nodeEnvCheck-CYVfgkJ_.mjs → nodeEnvCheck-Cjo3FyXK.mjs} +2 -2
- package/dist/packem_shared/{nodeEnvCheck-C2C9wY2Q.cjs → nodeEnvCheck-DcTXz_-V.cjs} +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## @visulima/health-check [2.0.21](https://github.com/visulima/visulima/compare/@visulima/health-check@2.0.20...@visulima/health-check@2.0.21) (2025-03-07)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* updated @visulima/packem and other dev deps, for better bundling size ([e940581](https://github.com/visulima/visulima/commit/e9405812201594e54dd81d17ddb74177df5f3c24))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* updated dev dependencies ([487a976](https://github.com/visulima/visulima/commit/487a976932dc7c39edfc19ffd3968960ff338066))
|
|
10
|
+
|
|
1
11
|
## @visulima/health-check [2.0.20](https://github.com/visulima/visulima/compare/@visulima/health-check@2.0.19...@visulima/health-check@2.0.20) (2025-01-25)
|
|
2
12
|
|
|
3
13
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -197,6 +197,7 @@ If you would like to help take a look at the [list of issues](https://github.com
|
|
|
197
197
|
The visulima health-check is open-sourced software licensed under the [MIT][license-url]
|
|
198
198
|
|
|
199
199
|
[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
200
|
+
|
|
200
201
|
[typescript-url]: https://www.typescriptlang.org/ "TypeScript" "typescript"
|
|
201
202
|
[license-image]: https://img.shields.io/npm/l/@visulima/health-check?color=blueviolet&style=for-the-badge
|
|
202
203
|
[license-url]: LICENSE.md "license"
|
package/dist/index.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
4
|
|
|
5
5
|
const dnsCheck = require('./packem_shared/dnsCheck-CKpwi39o.cjs');
|
|
6
|
-
const httpCheck = require('./packem_shared/httpCheck-
|
|
7
|
-
const nodeEnvCheck = require('./packem_shared/nodeEnvCheck-
|
|
6
|
+
const httpCheck = require('./packem_shared/httpCheck-BS8O0ZEs.cjs');
|
|
7
|
+
const nodeEnvCheck = require('./packem_shared/nodeEnvCheck-DcTXz_-V.cjs');
|
|
8
8
|
const pingCheck = require('./packem_shared/pingCheck-CYOzCjjQ.cjs');
|
|
9
9
|
const healthCheckHandler = require('./packem_shared/healthCheckHandler-BIIllStf.cjs');
|
|
10
10
|
const healthReadyHandler = require('./packem_shared/healthReadyHandler-vdf1928k.cjs');
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as dnsCheck } from './packem_shared/dnsCheck-DJXOtLo2.mjs';
|
|
2
|
-
export { default as httpCheck } from './packem_shared/httpCheck-
|
|
3
|
-
export { default as nodeEnvCheck } from './packem_shared/nodeEnvCheck-
|
|
2
|
+
export { default as httpCheck } from './packem_shared/httpCheck-hHYnlgcd.mjs';
|
|
3
|
+
export { default as nodeEnvCheck } from './packem_shared/nodeEnvCheck-Cjo3FyXK.mjs';
|
|
4
4
|
export { default as pingCheck } from './packem_shared/pingCheck-W2tp3p2k.mjs';
|
|
5
5
|
export { default as healthCheckHandler } from './packem_shared/healthCheckHandler-C0NYbHG_.mjs';
|
|
6
6
|
export { default as healthReadyHandler } from './packem_shared/healthReadyHandler-Bd4123kn.mjs';
|
|
@@ -8,10 +8,10 @@ const DISPLAY_NAME = "HTTP check for";
|
|
|
8
8
|
const httpCheck = /* @__PURE__ */ __name((host, options) => async () => {
|
|
9
9
|
try {
|
|
10
10
|
const response = await fetch(host, options?.fetchOptions ?? {});
|
|
11
|
-
if (options?.expected?.status !==
|
|
11
|
+
if (options?.expected?.status !== void 0 && options.expected.status !== response.status) {
|
|
12
12
|
throw new Error(`${DISPLAY_NAME} ${host} returned status ${response.status} instead of ${options.expected.status}`);
|
|
13
13
|
}
|
|
14
|
-
if (options?.expected?.body !==
|
|
14
|
+
if (options?.expected?.body !== void 0) {
|
|
15
15
|
const textBody = await response.text();
|
|
16
16
|
try {
|
|
17
17
|
node_assert.deepStrictEqual(textBody, options.expected.body);
|
|
@@ -6,10 +6,10 @@ const DISPLAY_NAME = "HTTP check for";
|
|
|
6
6
|
const httpCheck = /* @__PURE__ */ __name((host, options) => async () => {
|
|
7
7
|
try {
|
|
8
8
|
const response = await fetch(host, options?.fetchOptions ?? {});
|
|
9
|
-
if (options?.expected?.status !==
|
|
9
|
+
if (options?.expected?.status !== void 0 && options.expected.status !== response.status) {
|
|
10
10
|
throw new Error(`${DISPLAY_NAME} ${host} returned status ${response.status} instead of ${options.expected.status}`);
|
|
11
11
|
}
|
|
12
|
-
if (options?.expected?.body !==
|
|
12
|
+
if (options?.expected?.body !== void 0) {
|
|
13
13
|
const textBody = await response.text();
|
|
14
14
|
try {
|
|
15
15
|
deepStrictEqual(textBody, options.expected.body);
|
|
@@ -4,12 +4,12 @@ const DISPLAY_NAME = "Node Environment Check";
|
|
|
4
4
|
const nodeEnvironmentCheck = /* @__PURE__ */ __name((expectedEnvironment) => async () => {
|
|
5
5
|
const environment = process.env.NODE_ENV;
|
|
6
6
|
let errorMessage;
|
|
7
|
-
if (environment !==
|
|
7
|
+
if (environment !== void 0 && expectedEnvironment !== void 0 && environment !== expectedEnvironment) {
|
|
8
8
|
errorMessage = `NODE_ENV environment variable is set to "${environment}" instead of "${expectedEnvironment}".`;
|
|
9
9
|
} else if (!environment) {
|
|
10
10
|
errorMessage = ["Missing NODE_ENV environment variable.", "It can make some parts of the application misbehave"].join(" ");
|
|
11
11
|
}
|
|
12
|
-
if (errorMessage !==
|
|
12
|
+
if (errorMessage !== void 0) {
|
|
13
13
|
return {
|
|
14
14
|
displayName: DISPLAY_NAME,
|
|
15
15
|
health: {
|
|
@@ -6,12 +6,12 @@ const DISPLAY_NAME = "Node Environment Check";
|
|
|
6
6
|
const nodeEnvironmentCheck = /* @__PURE__ */ __name((expectedEnvironment) => async () => {
|
|
7
7
|
const environment = process.env.NODE_ENV;
|
|
8
8
|
let errorMessage;
|
|
9
|
-
if (environment !==
|
|
9
|
+
if (environment !== void 0 && expectedEnvironment !== void 0 && environment !== expectedEnvironment) {
|
|
10
10
|
errorMessage = `NODE_ENV environment variable is set to "${environment}" instead of "${expectedEnvironment}".`;
|
|
11
11
|
} else if (!environment) {
|
|
12
12
|
errorMessage = ["Missing NODE_ENV environment variable.", "It can make some parts of the application misbehave"].join(" ");
|
|
13
13
|
}
|
|
14
|
-
if (errorMessage !==
|
|
14
|
+
if (errorMessage !== void 0) {
|
|
15
15
|
return {
|
|
16
16
|
displayName: DISPLAY_NAME,
|
|
17
17
|
health: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/health-check",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.21",
|
|
4
4
|
"description": "A library built to provide support for defining service health for node services. It allows you to register async health checks for your dependencies and the service itself, provides a health endpoint that exposes their status, and health metrics.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"pingman": "^2.0.0"
|
|
74
74
|
},
|
|
75
75
|
"optionalDependencies": {
|
|
76
|
-
"next": ">=15.
|
|
76
|
+
"next": ">=15.2"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=18.0.0 <=23.x"
|