@adaas/a-server 0.0.24 → 0.0.25
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/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js +11 -2
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js.map +1 -1
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs +7 -3
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs.map +1 -1
- package/package.json +8 -4
- package/src/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.ts +7 -4
|
@@ -6,6 +6,13 @@ var ARequest_entity = require('@adaas/a-server/request/A-Request.entity');
|
|
|
6
6
|
var AResponse_entity = require('@adaas/a-server/response/A-Response.entity');
|
|
7
7
|
var aConfig = require('@adaas/a-utils/a-config');
|
|
8
8
|
var AServerLogger_component = require('@adaas/a-server/logger/A-ServerLogger.component');
|
|
9
|
+
var fs = require('fs');
|
|
10
|
+
var path = require('path');
|
|
11
|
+
|
|
12
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
15
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
9
16
|
|
|
10
17
|
var __defProp = Object.defineProperty;
|
|
11
18
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -20,13 +27,15 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
20
27
|
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
21
28
|
class A_ServerHealthMonitor extends aConcept.A_Component {
|
|
22
29
|
async get(config, request, response, logger) {
|
|
23
|
-
const
|
|
30
|
+
const rootFolder = config.get("A_CONCEPT_ROOT_FOLDER") || aConcept.A_CONCEPT_ENV.A_CONCEPT_ROOT_FOLDER || process.cwd();
|
|
31
|
+
const pkgPath = path__default.default.join(rootFolder, "package.json");
|
|
32
|
+
const packageJSON = JSON.parse(fs__default.default.readFileSync(pkgPath, "utf-8"));
|
|
24
33
|
const exposedProperties = config.get("EXPOSED_PROPERTIES")?.split(",") || [
|
|
25
34
|
"name",
|
|
26
35
|
"version",
|
|
27
36
|
"description"
|
|
28
37
|
];
|
|
29
|
-
exposedProperties.forEach((prop) => response.add(prop, packageJSON
|
|
38
|
+
exposedProperties.forEach((prop) => response.add(prop, packageJSON[prop]));
|
|
30
39
|
}
|
|
31
40
|
}
|
|
32
41
|
__decorateClass([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.ts"],"names":["A_Component","A_ServerRouter","A_Config","A_Request","A_Response","A_ServerLogger"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.ts"],"names":["A_Component","A_CONCEPT_ENV","path","fs","A_ServerRouter","A_Config","A_Request","A_Response","A_ServerLogger"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,8BAA8BA,oBAAA,CAAY;AAAA,EAYnD,MAAM,GAAA,CACkB,MAAA,EACC,OAAA,EACC,UACI,MAAA,EACd;AACZ,IAAA,MAAM,UAAA,GAAa,OAAO,GAAA,CAAI,uBAAuB,KAAKC,sBAAA,CAAc,qBAAA,IAAyB,QAAQ,GAAA,EAAI;AAC7G,IAAA,MAAM,OAAA,GAAUC,qBAAA,CAAK,IAAA,CAAK,UAAA,EAAY,cAAc,CAAA;AACpD,IAAA,MAAM,cAAc,IAAA,CAAK,KAAA,CAAMC,oBAAG,YAAA,CAAa,OAAA,EAAS,OAAO,CAAC,CAAA;AAGhE,IAAA,MAAM,oBAAmC,MAAA,CAAO,GAAA,CAAI,oBAAoB,CAAA,EAAG,KAAA,CAAM,GAAG,CAAA,IAAK;AAAA,MACrF,MAAA;AAAA,MACA,SAAA;AAAA,MACA;AAAA,KACJ;AAEA,IAAA,iBAAA,CAAkB,OAAA,CAAQ,UAAQ,QAAA,CAAS,GAAA,CAAI,MAAM,WAAA,CAAY,IAAI,CAAC,CAAC,CAAA;AAAA,EAC3E;AACJ;AAnBU,eAAA,CAAA;AAAA,EALLC,uCAAe,GAAA,CAAI;AAAA,IAChB,IAAA,EAAM,GAAA;AAAA,IACN,MAAA,EAAQ,QAAA;AAAA,IACR,OAAA,EAAS;AAAA,GACZ,CAAA;AAAA,EAEI,qCAASC,gBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,yBAAS,CAAA,CAAA;AAAA,EAClB,qCAASC,2BAAU,CAAA,CAAA;AAAA,EACnB,qCAASC,sCAAc,CAAA;AAAA,CAAA,EAhBnB,qBAAA,CAYH,SAAA,EAAA,KAAA,CAAA","file":"A-ServerHealthMonitor.component.js","sourcesContent":["import { A_Component, A_CONCEPT_ENV, A_Inject } from \"@adaas/a-concept\";\nimport { A_ServerRouter } from \"@adaas/a-server/router/A-ServerRouter.component\";\nimport { A_Request } from \"@adaas/a-server/request/A-Request.entity\";\nimport { A_Response } from \"@adaas/a-server/response/A-Response.entity\";\nimport { A_Config } from \"@adaas/a-utils/a-config\";\nimport { A_ServerLogger } from \"@adaas/a-server/logger/A-ServerLogger.component\";\nimport fs from \"fs\";\nimport path from \"path\";\n\n\n\nexport class A_ServerHealthMonitor extends A_Component {\n\n\n // =======================================================\n // ================ Method Definition=====================\n // =======================================================\n\n @A_ServerRouter.Get({\n path: '/',\n prefix: 'health',\n version: 'v1',\n })\n async get(\n @A_Inject(A_Config) config: A_Config<['VERSION_PATH', 'EXPOSED_PROPERTIES']>,\n @A_Inject(A_Request) request: A_Request,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_ServerLogger) logger: A_ServerLogger\n ): Promise<any> {\n const rootFolder = config.get('A_CONCEPT_ROOT_FOLDER') || A_CONCEPT_ENV.A_CONCEPT_ROOT_FOLDER || process.cwd();\n const pkgPath = path.join(rootFolder, 'package.json');\n const packageJSON = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));\n\n\n const exposedProperties: Array<string> = config.get('EXPOSED_PROPERTIES')?.split(',') || [\n 'name',\n 'version',\n 'description',\n ];\n\n exposedProperties.forEach(prop => response.add(prop, packageJSON[prop]));\n }\n}"]}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { __decorateClass, __decorateParam } from '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
-
import { A_Inject, A_Component } from '@adaas/a-concept';
|
|
2
|
+
import { A_Inject, A_Component, A_CONCEPT_ENV } from '@adaas/a-concept';
|
|
3
3
|
import { A_ServerRouter } from '@adaas/a-server/router/A-ServerRouter.component';
|
|
4
4
|
import { A_Request } from '@adaas/a-server/request/A-Request.entity';
|
|
5
5
|
import { A_Response } from '@adaas/a-server/response/A-Response.entity';
|
|
6
6
|
import { A_Config } from '@adaas/a-utils/a-config';
|
|
7
7
|
import { A_ServerLogger } from '@adaas/a-server/logger/A-ServerLogger.component';
|
|
8
|
+
import fs from 'fs';
|
|
9
|
+
import path from 'path';
|
|
8
10
|
|
|
9
11
|
class A_ServerHealthMonitor extends A_Component {
|
|
10
12
|
async get(config, request, response, logger) {
|
|
11
|
-
const
|
|
13
|
+
const rootFolder = config.get("A_CONCEPT_ROOT_FOLDER") || A_CONCEPT_ENV.A_CONCEPT_ROOT_FOLDER || process.cwd();
|
|
14
|
+
const pkgPath = path.join(rootFolder, "package.json");
|
|
15
|
+
const packageJSON = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
12
16
|
const exposedProperties = config.get("EXPOSED_PROPERTIES")?.split(",") || [
|
|
13
17
|
"name",
|
|
14
18
|
"version",
|
|
15
19
|
"description"
|
|
16
20
|
];
|
|
17
|
-
exposedProperties.forEach((prop) => response.add(prop, packageJSON
|
|
21
|
+
exposedProperties.forEach((prop) => response.add(prop, packageJSON[prop]));
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
__decorateClass([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.ts"],"names":[],"mappings":";;;;;;;;;;AAWO,MAAM,8BAA8B,WAAA,CAAY;AAAA,EAYnD,MAAM,GAAA,CACkB,MAAA,EACC,OAAA,EACC,UACI,MAAA,EACd;AACZ,IAAA,MAAM,UAAA,GAAa,OAAO,GAAA,CAAI,uBAAuB,KAAK,aAAA,CAAc,qBAAA,IAAyB,QAAQ,GAAA,EAAI;AAC7G,IAAA,MAAM,OAAA,GAAU,IAAA,CAAK,IAAA,CAAK,UAAA,EAAY,cAAc,CAAA;AACpD,IAAA,MAAM,cAAc,IAAA,CAAK,KAAA,CAAM,GAAG,YAAA,CAAa,OAAA,EAAS,OAAO,CAAC,CAAA;AAGhE,IAAA,MAAM,oBAAmC,MAAA,CAAO,GAAA,CAAI,oBAAoB,CAAA,EAAG,KAAA,CAAM,GAAG,CAAA,IAAK;AAAA,MACrF,MAAA;AAAA,MACA,SAAA;AAAA,MACA;AAAA,KACJ;AAEA,IAAA,iBAAA,CAAkB,OAAA,CAAQ,UAAQ,QAAA,CAAS,GAAA,CAAI,MAAM,WAAA,CAAY,IAAI,CAAC,CAAC,CAAA;AAAA,EAC3E;AACJ;AAnBU,eAAA,CAAA;AAAA,EALL,eAAe,GAAA,CAAI;AAAA,IAChB,IAAA,EAAM,GAAA;AAAA,IACN,MAAA,EAAQ,QAAA;AAAA,IACR,OAAA,EAAS;AAAA,GACZ,CAAA;AAAA,EAEI,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,SAAS,CAAA,CAAA;AAAA,EAClB,4BAAS,UAAU,CAAA,CAAA;AAAA,EACnB,4BAAS,cAAc,CAAA;AAAA,CAAA,EAhBnB,qBAAA,CAYH,SAAA,EAAA,KAAA,EAAA,CAAA,CAAA","file":"A-ServerHealthMonitor.component.mjs","sourcesContent":["import { A_Component, A_CONCEPT_ENV, A_Inject } from \"@adaas/a-concept\";\nimport { A_ServerRouter } from \"@adaas/a-server/router/A-ServerRouter.component\";\nimport { A_Request } from \"@adaas/a-server/request/A-Request.entity\";\nimport { A_Response } from \"@adaas/a-server/response/A-Response.entity\";\nimport { A_Config } from \"@adaas/a-utils/a-config\";\nimport { A_ServerLogger } from \"@adaas/a-server/logger/A-ServerLogger.component\";\nimport fs from \"fs\";\nimport path from \"path\";\n\n\n\nexport class A_ServerHealthMonitor extends A_Component {\n\n\n // =======================================================\n // ================ Method Definition=====================\n // =======================================================\n\n @A_ServerRouter.Get({\n path: '/',\n prefix: 'health',\n version: 'v1',\n })\n async get(\n @A_Inject(A_Config) config: A_Config<['VERSION_PATH', 'EXPOSED_PROPERTIES']>,\n @A_Inject(A_Request) request: A_Request,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_ServerLogger) logger: A_ServerLogger\n ): Promise<any> {\n const rootFolder = config.get('A_CONCEPT_ROOT_FOLDER') || A_CONCEPT_ENV.A_CONCEPT_ROOT_FOLDER || process.cwd();\n const pkgPath = path.join(rootFolder, 'package.json');\n const packageJSON = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));\n\n\n const exposedProperties: Array<string> = config.get('EXPOSED_PROPERTIES')?.split(',') || [\n 'name',\n 'version',\n 'description',\n ];\n\n exposedProperties.forEach(prop => response.add(prop, packageJSON[prop]));\n }\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaas/a-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "A-Server is a powerful server framework designed to work seamlessly with the A-Concept framework. This library provides a robust and flexible server implementation of A-Server, enabling developers to create scalable and efficient server-side applications using the A-Concept architecture.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adaas",
|
|
@@ -289,11 +289,15 @@
|
|
|
289
289
|
"echo-version": "echo $npm_package_version",
|
|
290
290
|
"build": "tsup --config tsup.config.ts"
|
|
291
291
|
},
|
|
292
|
-
"
|
|
293
|
-
"@adaas/a-concept": "^0.3.
|
|
294
|
-
"@adaas/a-
|
|
292
|
+
"peerDependencies": {
|
|
293
|
+
"@adaas/a-concept": "^0.3.16",
|
|
294
|
+
"@adaas/a-frame": "^0.1.2",
|
|
295
|
+
"@adaas/a-utils": "^0.3.20"
|
|
295
296
|
},
|
|
296
297
|
"devDependencies": {
|
|
298
|
+
"@adaas/a-concept": "^0.3.15",
|
|
299
|
+
"@adaas/a-frame": "^0.1.2",
|
|
300
|
+
"@adaas/a-utils": "^0.3.19",
|
|
297
301
|
"@types/chai": "^4.3.14",
|
|
298
302
|
"@types/jest": "^29.5.12",
|
|
299
303
|
"@types/mocha": "^10.0.6",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { A_Component, A_Inject } from "@adaas/a-concept";
|
|
1
|
+
import { A_Component, A_CONCEPT_ENV, A_Inject } from "@adaas/a-concept";
|
|
2
2
|
import { A_ServerRouter } from "@adaas/a-server/router/A-ServerRouter.component";
|
|
3
3
|
import { A_Request } from "@adaas/a-server/request/A-Request.entity";
|
|
4
4
|
import { A_Response } from "@adaas/a-server/response/A-Response.entity";
|
|
5
5
|
import { A_Config } from "@adaas/a-utils/a-config";
|
|
6
6
|
import { A_ServerLogger } from "@adaas/a-server/logger/A-ServerLogger.component";
|
|
7
|
+
import fs from "fs";
|
|
8
|
+
import path from "path";
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
|
|
@@ -25,8 +27,9 @@ export class A_ServerHealthMonitor extends A_Component {
|
|
|
25
27
|
@A_Inject(A_Response) response: A_Response,
|
|
26
28
|
@A_Inject(A_ServerLogger) logger: A_ServerLogger
|
|
27
29
|
): Promise<any> {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
+
const rootFolder = config.get('A_CONCEPT_ROOT_FOLDER') || A_CONCEPT_ENV.A_CONCEPT_ROOT_FOLDER || process.cwd();
|
|
31
|
+
const pkgPath = path.join(rootFolder, 'package.json');
|
|
32
|
+
const packageJSON = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
30
33
|
|
|
31
34
|
|
|
32
35
|
const exposedProperties: Array<string> = config.get('EXPOSED_PROPERTIES')?.split(',') || [
|
|
@@ -35,6 +38,6 @@ export class A_ServerHealthMonitor extends A_Component {
|
|
|
35
38
|
'description',
|
|
36
39
|
];
|
|
37
40
|
|
|
38
|
-
exposedProperties.forEach(prop => response.add(prop, packageJSON
|
|
41
|
+
exposedProperties.forEach(prop => response.add(prop, packageJSON[prop]));
|
|
39
42
|
}
|
|
40
43
|
}
|