@platform-x/hep-notification-client 1.3.0 → 1.3.2
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/README.md +7 -7
- package/dist/jest-setup.js +28 -0
- package/dist/jest-setup.js.map +1 -0
- package/dist/src/common/controllers/common_controller.js +72 -0
- package/dist/src/common/controllers/common_controller.js.map +1 -0
- package/dist/src/common/controllers/index.js +29 -0
- package/dist/src/common/controllers/index.js.map +1 -0
- package/dist/src/common/middleware/commonMiddleware.js +141 -0
- package/dist/src/common/middleware/commonMiddleware.js.map +1 -0
- package/dist/src/common/service/requestService.js +79 -1
- package/dist/src/common/service/requestService.js.map +1 -0
- package/dist/src/common/service/twilioService.js +3 -11
- package/dist/src/common/service/twilioService.js.map +1 -0
- package/dist/src/common/util/commonUtil.js +119 -1
- package/dist/src/common/util/commonUtil.js.map +1 -0
- package/dist/src/common/util/constants.js +18 -0
- package/dist/src/common/util/constants.js.map +1 -0
- package/dist/src/common/util/errorHandler.js +4 -6
- package/dist/src/common/util/errorHandler.js.map +1 -0
- package/dist/src/common/util/httpCodes.js +26 -0
- package/dist/src/common/util/httpCodes.js.map +1 -0
- package/dist/src/common/util/logger.js +1 -1
- package/dist/src/common/util/logger.js.map +1 -0
- package/dist/src/common/util/requestTracer.js +18 -1
- package/dist/src/common/util/requestTracer.js.map +1 -0
- package/dist/src/common/util/solrConnector.js.map +1 -0
- package/dist/src/config/index.js +49 -4
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/platform-x/app.js +35 -0
- package/dist/src/platform-x/app.js.map +1 -0
- package/dist/src/platform-x/constants/index.js +2 -14
- package/dist/src/platform-x/constants/index.js.map +1 -0
- package/dist/src/platform-x/constants/style.js +98 -98
- package/dist/src/platform-x/constants/style.js.map +1 -0
- package/dist/src/platform-x/controllers/cronController.js +399 -0
- package/dist/src/platform-x/controllers/cronController.js.map +1 -0
- package/dist/src/platform-x/controllers/fileUploadController.js +76 -0
- package/dist/src/platform-x/controllers/fileUploadController.js.map +1 -0
- package/dist/src/platform-x/controllers/graphRESTControllers.js +183 -0
- package/dist/src/platform-x/controllers/graphRESTControllers.js.map +1 -0
- package/dist/src/platform-x/controllers/index.js +30 -0
- package/dist/src/platform-x/controllers/index.js.map +1 -0
- package/dist/src/platform-x/controllers/siteDomainController.js +74 -0
- package/dist/src/platform-x/controllers/siteDomainController.js.map +1 -0
- package/dist/src/platform-x/dataSource/emailDataSource.js.map +1 -0
- package/dist/src/platform-x/database/connection.js +3 -6
- package/dist/src/platform-x/database/connection.js.map +1 -0
- package/dist/src/platform-x/database/dao/formBuilder.dao.js +1 -1
- package/dist/src/platform-x/database/dao/formBuilder.dao.js.map +1 -0
- package/dist/src/platform-x/database/dao/siteDomain.dao.js +73 -0
- package/dist/src/platform-x/database/dao/siteDomain.dao.js.map +1 -0
- package/dist/src/platform-x/database/index.js.map +1 -0
- package/dist/src/platform-x/{interface/interface.js → database/interfaces/site_domain.interface.js} +1 -1
- package/dist/src/platform-x/database/interfaces/site_domain.interface.js.map +1 -0
- package/dist/src/platform-x/database/models/formBuilder.model.js.map +1 -0
- package/dist/src/platform-x/database/models/site_domains.model.js +51 -0
- package/dist/src/platform-x/database/models/site_domains.model.js.map +1 -0
- package/dist/src/platform-x/routes/index.js +19 -0
- package/dist/src/platform-x/routes/index.js.map +1 -0
- package/dist/src/platform-x/services/cron.services.js +117 -0
- package/dist/src/platform-x/services/cron.services.js.map +1 -0
- package/dist/src/platform-x/util/emailHandler.js +53 -137
- package/dist/src/platform-x/util/emailHandler.js.map +1 -0
- package/dist/src/platform-x/util/emailTemplate.js +63 -60
- package/dist/src/platform-x/util/emailTemplate.js.map +1 -0
- package/dist/src/platform-x/util/solr-data-source/SolrHttpDataSource.js +2 -0
- package/dist/src/platform-x/util/solr-data-source/SolrHttpDataSource.js.map +1 -0
- package/dist/src/server.js +38 -0
- package/dist/src/server.js.map +1 -0
- package/dist/swagger.json +247 -0
- package/dist/test/controllers/common_controller.spec.js +79 -0
- package/dist/test/controllers/common_controller.spec.js.map +1 -0
- package/dist/test/middleware/commonMiddleware.spec.js +88 -0
- package/dist/test/middleware/commonMiddleware.spec.js.map +1 -0
- package/dist/test/platform-x/controllers/graphRESTControllers.spec.js +195 -0
- package/dist/test/platform-x/controllers/graphRESTControllers.spec.js.map +1 -0
- package/dist/test/platform-x/datasource/emailDataSource.spec.js +81 -0
- package/dist/test/platform-x/datasource/emailDataSource.spec.js.map +1 -0
- package/dist/test/platform-x/util/emailHandler.spec.js +474 -0
- package/dist/test/platform-x/util/emailHandler.spec.js.map +1 -0
- package/dist/test/platform-x/util/solr-data-source/SolrHttpDataSource.spec.js +80 -0
- package/dist/test/platform-x/util/solr-data-source/SolrHttpDataSource.spec.js.map +1 -0
- package/dist/test/services/requestService.spec.js +108 -0
- package/dist/test/services/requestService.spec.js.map +1 -0
- package/dist/test/services/requestServiceGet.spec.js +43 -0
- package/dist/test/services/requestServiceGet.spec.js.map +1 -0
- package/dist/test/src/common/service/twilioService.spec.js +65 -0
- package/dist/test/src/common/service/twilioService.spec.js.map +1 -0
- package/dist/test/util/commonUtil.spec.js +110 -0
- package/dist/test/util/commonUtil.spec.js.map +1 -0
- package/dist/test/util/logger.spec.js +51 -0
- package/dist/test/util/logger.spec.js.map +1 -0
- package/dist/test/util/requestTracer.spec.js +64 -0
- package/dist/test/util/requestTracer.spec.js.map +1 -0
- package/dist/test/util/solrconnector.spec.js +145 -0
- package/dist/test/util/solrconnector.spec.js.map +1 -0
- package/package.json +66 -62
- package/postman_collection/HEP_Environment.postman_environment.json +44 -44
- package/postman_collection/hep-notification.postman_collection.json +55 -55
- package/reports/output.jtl +1 -1
- package/reports/scripts/jmeter_sendgrid.js +34 -34
- package/reports/scripts/newman_sendgrid.js +40 -40
- package/reports/scripts/sendgrid.js +40 -40
- package/reports/scripts/trivy_sendgrid.js +40 -40
- package/src/common/service/requestService.ts +87 -0
- package/{dist/src/common/service/secretKeyManager.services.js → src/common/service/secretKeyManager.services.ts} +1 -2
- package/src/common/service/twilioService.ts +58 -0
- package/src/common/util/commonUtil.ts +39 -0
- package/src/common/util/errorHandler.ts +120 -0
- package/src/common/util/logger.ts +215 -0
- package/src/common/util/requestTracer.ts +10 -0
- package/src/common/util/solrConnector.ts +319 -0
- package/src/config/index.ts +35 -0
- package/src/index.ts +34 -0
- package/src/platform-x/constants/index.ts +20 -0
- package/src/platform-x/constants/style.ts +99 -0
- package/src/platform-x/dataSource/emailDataSource.ts +34 -0
- package/src/platform-x/database/connection.ts +47 -0
- package/src/platform-x/database/dao/formBuilder.dao.ts +33 -0
- package/src/platform-x/database/index.ts +7 -0
- package/src/platform-x/database/models/formBuilder.model.ts +23 -0
- package/src/platform-x/util/emailHandler.ts +580 -0
- package/src/platform-x/util/emailTemplate.ts +66 -0
- package/src/platform-x/util/solr-data-source/SolrHttpDataSource.ts +97 -0
- package/{dist → src}/templates/orderPlaced.ejs +172 -172
- package/{dist → src}/templates/orderPlaced.html +189 -189
- package/tsconfig.json +73 -0
- package/dist/src/common/service/requestService.d.ts +0 -26
- package/dist/src/common/service/secretKeyManager.services.d.ts +0 -0
- package/dist/src/common/service/twilioService.d.ts +0 -19
- package/dist/src/common/util/commonUtil.d.ts +0 -22
- package/dist/src/common/util/errorHandler.d.ts +0 -44
- package/dist/src/common/util/logger.d.ts +0 -68
- package/dist/src/common/util/requestTracer.d.ts +0 -2
- package/dist/src/common/util/secretKeyManager.d.ts +0 -7
- package/dist/src/common/util/secretKeyManager.js +0 -58
- package/dist/src/common/util/solrConnector.d.ts +0 -35
- package/dist/src/config/index.d.ts +0 -30
- package/dist/src/index.d.ts +0 -5
- package/dist/src/index.js +0 -20
- package/dist/src/platform-x/constants/index.d.ts +0 -18
- package/dist/src/platform-x/constants/style.d.ts +0 -1
- package/dist/src/platform-x/dataSource/emailDataSource.d.ts +0 -5
- package/dist/src/platform-x/database/connection.d.ts +0 -8
- package/dist/src/platform-x/database/dao/formBuilder.dao.d.ts +0 -9
- package/dist/src/platform-x/database/index.d.ts +0 -7
- package/dist/src/platform-x/database/models/formBuilder.model.d.ts +0 -34
- package/dist/src/platform-x/interface/interface.d.ts +0 -4
- package/dist/src/platform-x/util/emailHandler.d.ts +0 -62
- package/dist/src/platform-x/util/emailTemplate.d.ts +0 -4
- package/dist/src/platform-x/util/solr-data-source/SolrHttpDataSource.d.ts +0 -26
|
@@ -10,69 +10,72 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.EmailTemplateHandler = void 0;
|
|
13
|
+
// NOSONAR-NEXT-LINE
|
|
13
14
|
class EmailTemplateHandler {
|
|
14
|
-
|
|
15
|
+
// NOSONAR
|
|
16
|
+
// NOSONAR-NEXT-LINE
|
|
17
|
+
constructor() { } // NOSONAR
|
|
15
18
|
static prepareEmailTemplate(reqBody) {
|
|
16
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
let str = `<!DOCTYPE html>\r\n
|
|
18
|
-
<html>
|
|
19
|
-
\r\n
|
|
20
|
-
<head>\r\n </head>
|
|
21
|
-
\r\n
|
|
22
|
-
<body>
|
|
23
|
-
\r\n
|
|
24
|
-
<div>
|
|
25
|
-
\r\n
|
|
26
|
-
<div class=\"main_div\">
|
|
27
|
-
\r\n
|
|
28
|
-
<table>
|
|
29
|
-
\r\n
|
|
30
|
-
<tr>
|
|
31
|
-
\r\n
|
|
32
|
-
<td>
|
|
33
|
-
\r\n
|
|
34
|
-
<div class=\"table_div\">
|
|
35
|
-
\r\n
|
|
36
|
-
<table class=\"table_2\">
|
|
37
|
-
\r\n
|
|
38
|
-
<tr>
|
|
39
|
-
\r\n
|
|
40
|
-
<td valign=\"top\" class=\"w-400\">\r\n <img\r\n src=\"https://storage.googleapis.com/platx/dev/Setting/platform-x-logo-color%402x.png\"\r\n alt=\"logo\"\r\n class=\"w_h_30\"\r\n />\r\n </td>
|
|
41
|
-
\r\n
|
|
42
|
-
</tr>
|
|
43
|
-
\r\n
|
|
44
|
-
</table>
|
|
45
|
-
\r\n
|
|
46
|
-
<p class=\"username\">Hi <span id=\"1_dynamic_text\">{{username}}</span>,</p>
|
|
47
|
-
\r\n
|
|
48
|
-
<p class=\"main_text\">Your order <span id=\"6_dynamic_text\"><b>{{ordernumber}}</b></span> has been successfully placed for amount <span id=\"2_dynamic_text\"><b>{{totalAmt}}</b></span><span id=\"3_dynamic_text\"><b>{{currency}}</b></span>.</p>
|
|
49
|
-
\r\n
|
|
50
|
-
<p class=\"main_text\">Address Details<span id=\"4_dynamic_text\"><b>{{addressStr}}</b></span></p>
|
|
51
|
-
\r\n
|
|
52
|
-
<p class=\"main_text\">Calculated Tax on your order is <span id=\"5_dynamic_text\"><b>{{totaltax}}</b></span>
|
|
53
|
-
<div class=\"border\">
|
|
54
|
-
</div>
|
|
55
|
-
\r\n
|
|
56
|
-
<div>
|
|
57
|
-
\r\n
|
|
58
|
-
<p class=\"sub_text\">This emailer is copyright to Platform-X. All rights reserved.</p>
|
|
59
|
-
\r\n
|
|
60
|
-
</div>
|
|
61
|
-
\r\n
|
|
62
|
-
</div>
|
|
63
|
-
\r\n
|
|
64
|
-
</td>
|
|
65
|
-
\r\n
|
|
66
|
-
</tr>
|
|
67
|
-
\r\n
|
|
68
|
-
</table>
|
|
69
|
-
\r\n
|
|
70
|
-
</div>
|
|
71
|
-
\r\n
|
|
72
|
-
</div>
|
|
73
|
-
\r\n
|
|
74
|
-
</body>
|
|
75
|
-
\r\n
|
|
20
|
+
let str = `<!DOCTYPE html>\r\n
|
|
21
|
+
<html>
|
|
22
|
+
\r\n
|
|
23
|
+
<head>\r\n </head>
|
|
24
|
+
\r\n
|
|
25
|
+
<body>
|
|
26
|
+
\r\n
|
|
27
|
+
<div>
|
|
28
|
+
\r\n
|
|
29
|
+
<div class=\"main_div\">
|
|
30
|
+
\r\n
|
|
31
|
+
<table>
|
|
32
|
+
\r\n
|
|
33
|
+
<tr>
|
|
34
|
+
\r\n
|
|
35
|
+
<td>
|
|
36
|
+
\r\n
|
|
37
|
+
<div class=\"table_div\">
|
|
38
|
+
\r\n
|
|
39
|
+
<table class=\"table_2\">
|
|
40
|
+
\r\n
|
|
41
|
+
<tr>
|
|
42
|
+
\r\n
|
|
43
|
+
<td valign=\"top\" class=\"w-400\">\r\n <img\r\n src=\"https://storage.googleapis.com/platx/dev/Setting/platform-x-logo-color%402x.png\"\r\n alt=\"logo\"\r\n class=\"w_h_30\"\r\n />\r\n </td>
|
|
44
|
+
\r\n
|
|
45
|
+
</tr>
|
|
46
|
+
\r\n
|
|
47
|
+
</table>
|
|
48
|
+
\r\n
|
|
49
|
+
<p class=\"username\">Hi <span id=\"1_dynamic_text\">{{username}}</span>,</p>
|
|
50
|
+
\r\n
|
|
51
|
+
<p class=\"main_text\">Your order <span id=\"6_dynamic_text\"><b>{{ordernumber}}</b></span> has been successfully placed for amount <span id=\"2_dynamic_text\"><b>{{totalAmt}}</b></span><span id=\"3_dynamic_text\"><b>{{currency}}</b></span>.</p>
|
|
52
|
+
\r\n
|
|
53
|
+
<p class=\"main_text\">Address Details<span id=\"4_dynamic_text\"><b>{{addressStr}}</b></span></p>
|
|
54
|
+
\r\n
|
|
55
|
+
<p class=\"main_text\">Calculated Tax on your order is <span id=\"5_dynamic_text\"><b>{{totaltax}}</b></span>
|
|
56
|
+
<div class=\"border\">
|
|
57
|
+
</div>
|
|
58
|
+
\r\n
|
|
59
|
+
<div>
|
|
60
|
+
\r\n
|
|
61
|
+
<p class=\"sub_text\">This emailer is copyright to Platform-X. All rights reserved.</p>
|
|
62
|
+
\r\n
|
|
63
|
+
</div>
|
|
64
|
+
\r\n
|
|
65
|
+
</div>
|
|
66
|
+
\r\n
|
|
67
|
+
</td>
|
|
68
|
+
\r\n
|
|
69
|
+
</tr>
|
|
70
|
+
\r\n
|
|
71
|
+
</table>
|
|
72
|
+
\r\n
|
|
73
|
+
</div>
|
|
74
|
+
\r\n
|
|
75
|
+
</div>
|
|
76
|
+
\r\n
|
|
77
|
+
</body>
|
|
78
|
+
\r\n
|
|
76
79
|
</html>`;
|
|
77
80
|
return str;
|
|
78
81
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emailTemplate.js","sourceRoot":"","sources":["../../../../src/platform-x/util/emailTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oBAAoB;AACpB,MAAa,oBAAoB;IAC/B,UAAU;IACV,oBAAoB;IACpB,gBAAe,CAAC,CAAC,UAAU;IACpB,MAAM,CAAO,oBAAoB,CAAC,OAAY;;YACnD,IAAI,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2DN,CAAC;YACL,OAAO,GAAG,CAAC;QACb,CAAC;KAAA;CACF;AAnED,oDAmEC"}
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.SolrHttpDataSource = void 0;
|
|
16
16
|
const solrConnector_1 = require("../../../common/util/solrConnector");
|
|
17
17
|
const quick_lru_1 = __importDefault(require("@alloc/quick-lru"));
|
|
18
|
+
const logger_1 = require("../../../common/util/logger");
|
|
18
19
|
class SolrHttpDataSource {
|
|
19
20
|
// private loader: DataLoader<unknown, unknown, unknown>;
|
|
20
21
|
constructor() {
|
|
@@ -54,6 +55,7 @@ class SolrHttpDataSource {
|
|
|
54
55
|
solrQuery.filterList(filter); // fl
|
|
55
56
|
solrQuery.sort(sort); // sort
|
|
56
57
|
solrQuery.filterQuery(filterQuery); // fq
|
|
58
|
+
logger_1.Logger.info('SolrHttpDataSource:Solr Query created', 'createQuery');
|
|
57
59
|
}
|
|
58
60
|
executeSearch() {
|
|
59
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolrHttpDataSource.js","sourceRoot":"","sources":["../../../../../src/platform-x/util/solr-data-source/SolrHttpDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,sEAAgE;AAChE,iEAAwC;AACxC,wDAAqD;AAmBrD,MAAa,kBAAkB;IAK7B,yDAAyD;IACzD;QACE,IAAI,CAAC,IAAI,GAAG,IAAI,0BAAU,EAAE,CAAC;QAC7B,IAAI,CAAC,eAAe,GAAG,IAAI,mBAAQ,CAAC;YAClC,6EAA6E;YAC7E,OAAO,EAAE,EAAE;YACX,qEAAqE;YACrE,gFAAgF;YAChF,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,8DAA8D;IAChE,CAAC;IAED,4CAA4C;IAC5C,8BAA8B;IAC9B,oDAAoD;IACpD,IAAI;IAEJ,iCAAiC;IACjC,mBAAmB;IACnB,IAAI;IAEJ,QAAQ,CAAC,EAAU;QACjB,OAAO,QAAQ,EAAE,EAAE,CAAC;IACtB,CAAC;IAED,gBAAgB;;QACd,WAAW;QACX,4DAA4D;QAC5D,4BAA4B;QAC5B,MAAM,IAAI,GAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACnE,OAAO,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,0CAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IAED,WAAW,CAAC,YAA8B;QACxC,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,YAAY,CAAC;QACpE,IAAI,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QAC5B,SAAS,CAAC,QAAQ,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,CAAC,CAAC,CAAC,cAAc;QACvE,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK;QACnC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;QAC7B,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK;QACzC,eAAM,CAAC,IAAI,CACT,uCAAuC,EACvC,aAAa,CACd,CAAC;IACJ,CAAC;IAEK,aAAa;;YACjB,IAAI,QAAQ,CAAC;YACb,IAAI,QAAQ,GAAQ,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC5C,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;gBACtC,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC,CAAC,UAAU;gBAChE,OAAO,QAAQ,CAAC;aACjB;iBAAM;gBACL,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;gBAC3C,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBAC7C,OAAO,QAAQ,CAAC;aACjB;QACH,CAAC;KAAA;CACF;AAjED,gDAiEC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
require('elastic-apm-node').start({
|
|
7
|
+
// Override the service name from package.json
|
|
8
|
+
// Allowed characters: a-z, A-Z, 0-9, -, _, and space
|
|
9
|
+
serviceName: 'platformx-notification-service',
|
|
10
|
+
// Use if APM Server requires a secret token
|
|
11
|
+
secretToken: process.env.ELASTIC_APM_SECRET_TOKEN,
|
|
12
|
+
// Set the custom APM Server URL (default: http://localhost:8200)
|
|
13
|
+
serverUrl: process.env.ELASTIC_APM_SERVER_URL,
|
|
14
|
+
// Set the service environment
|
|
15
|
+
environment: process.env.ELASTIC_APM_ENVIRONMENT,
|
|
16
|
+
verifyServerCert: false,
|
|
17
|
+
// logLevel: 'debug',
|
|
18
|
+
});
|
|
19
|
+
const express_1 = __importDefault(require("express"));
|
|
20
|
+
const index_1 = __importDefault(require("./config/index"));
|
|
21
|
+
const logger_1 = require("./common/util/logger");
|
|
22
|
+
const commonMiddleware_1 = require("./common/middleware/commonMiddleware");
|
|
23
|
+
const app_1 = __importDefault(require("./platform-x/app"));
|
|
24
|
+
const index_2 = __importDefault(require("./platform-x/database/index"));
|
|
25
|
+
const PORT = index_1.default.port;
|
|
26
|
+
const app = (0, express_1.default)();
|
|
27
|
+
index_2.default.connect();
|
|
28
|
+
const initSubApps = (parentApp) => {
|
|
29
|
+
parentApp.use('/platform-x', app_1.default);
|
|
30
|
+
return parentApp;
|
|
31
|
+
};
|
|
32
|
+
(0, commonMiddleware_1.initCommonMiddlewares)(app)
|
|
33
|
+
.then((parentApp) => initSubApps(parentApp))
|
|
34
|
+
.then((parentApp) => (0, commonMiddleware_1.initRoutesMiddlewares)(parentApp))
|
|
35
|
+
.then((parentApp) => {
|
|
36
|
+
parentApp.listen(PORT, () => logger_1.Logger.info(`Running on ${PORT}`, 'initCommonMiddlewares'));
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC;IAChC,8CAA8C;IAC9C,qDAAqD;IACrD,WAAW,EAAE,gCAAgC;IAC7C,4CAA4C;IAC5C,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB;IACjD,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB;IAC7C,8BAA8B;IAC9B,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB;IAChD,gBAAgB,EAAE,KAAK;IACvB,qBAAqB;CACtB,CAAC,CAAC;AACH,sDAA2C;AAC3C,2DAAoC;AACpC,iDAA8C;AAC9C,2EAG8C;AAC9C,2DAA4C;AAC5C,wEAA4D;AAE5D,MAAM,IAAI,GAAG,eAAM,CAAC,IAAI,CAAC;AACzB,MAAM,GAAG,GAAY,IAAA,iBAAO,GAAE,CAAC;AAC/B,eAAiB,CAAC,OAAO,EAAE,CAAC;AAE5B,MAAM,WAAW,GAAG,CAAC,SAAkB,EAAE,EAAE;IACzC,SAAS,CAAC,GAAG,CAAC,aAAa,EAAE,aAAY,CAAC,CAAC;IAC3C,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,IAAA,wCAAqB,EAAC,GAAG,CAAC;KACvB,IAAI,CAAC,CAAC,SAAkB,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;KACpD,IAAI,CAAC,CAAC,SAAkB,EAAE,EAAE,CAAC,IAAA,wCAAqB,EAAC,SAAS,CAAC,CAAC;KAC9D,IAAI,CAAC,CAAC,SAAkB,EAAE,EAAE;IAC3B,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,CAC1B,eAAM,CAAC,IAAI,CAAC,cAAc,IAAI,EAAE,EAAE,uBAAuB,CAAC,CAC3D,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.0",
|
|
3
|
+
"servers": [
|
|
4
|
+
{
|
|
5
|
+
"url": "https://platx-delivery-dev.fanuep.com/",
|
|
6
|
+
"description": "API Gateway Endpoints",
|
|
7
|
+
"variables": {}
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"url": "http://localhost:8099",
|
|
11
|
+
"description": "",
|
|
12
|
+
"variables": {}
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"tags": [
|
|
16
|
+
{
|
|
17
|
+
"name": "Auth",
|
|
18
|
+
"description": "API for authentication"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "User",
|
|
22
|
+
"description": "API for user functionalities"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "plaform-x",
|
|
26
|
+
"description": "List of platform-x delivery service Apis"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"info": {
|
|
30
|
+
"version": "132802e8-6098-4c68-b791-24b9903e1d16",
|
|
31
|
+
"title": "delivery-service",
|
|
32
|
+
"description": "",
|
|
33
|
+
"termsOfService": "",
|
|
34
|
+
"contact": {},
|
|
35
|
+
"license": {
|
|
36
|
+
"name": ""
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"paths": {
|
|
40
|
+
"/auth/session": {
|
|
41
|
+
"post": {
|
|
42
|
+
"summary": "/auth/session",
|
|
43
|
+
"tags": ["Auth"],
|
|
44
|
+
"operationId": "/auth/session",
|
|
45
|
+
"parameters": [],
|
|
46
|
+
"responses": {
|
|
47
|
+
"200": {
|
|
48
|
+
"description": "",
|
|
49
|
+
"headers": {},
|
|
50
|
+
"content": {
|
|
51
|
+
"application/json": {
|
|
52
|
+
"schema": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"example": { "code": 200, "status": "success", "data": { "name": "asd sd", "first_name": "asd", "last_name": "sd", "email_id": "asd.ads@hcl.com", "username": "asd.asd@hcl.com", "email_verified": false, "gender": null } }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"requestBody": {
|
|
61
|
+
"required": true,
|
|
62
|
+
"content": {
|
|
63
|
+
"application/json": {
|
|
64
|
+
"schema": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"example": {
|
|
67
|
+
"code": "adsdsdsd",
|
|
68
|
+
"client_id": "react",
|
|
69
|
+
"grant_type": "authorization_code",
|
|
70
|
+
"redirect_uri": "http:localhost:3000/"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"example": "{\r\n \"code\":\"adsdsdsd\",\r\n \"client_id\":\"react\",\r\n \"grant_type\":\"authorization_code\",\r\n \"redirect_uri\":\"http:localhost:3000/\"\r\n}"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"/auth/logout": {
|
|
80
|
+
"get": {
|
|
81
|
+
"summary": "/auth/logout",
|
|
82
|
+
"operationId": "/auth/logout",
|
|
83
|
+
"tags": ["Auth"],
|
|
84
|
+
"parameters": [
|
|
85
|
+
{
|
|
86
|
+
"$ref": "#/components/parameters/client_id"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"$ref": "#/components/parameters/redirect_uri"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"responses": {
|
|
93
|
+
"200": {
|
|
94
|
+
"description": "redirect to logout",
|
|
95
|
+
"headers": {}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"/user/change-password": {
|
|
101
|
+
"put": {
|
|
102
|
+
"summary": "/user/change-password",
|
|
103
|
+
"operationId": "/user/change-password",
|
|
104
|
+
"parameters": [],
|
|
105
|
+
"tags": ["User"],
|
|
106
|
+
"responses": {
|
|
107
|
+
"200": {
|
|
108
|
+
"description": "",
|
|
109
|
+
"headers": {},
|
|
110
|
+
"content": {
|
|
111
|
+
"application/json": {
|
|
112
|
+
"schema": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"example": {
|
|
115
|
+
"code": 200,
|
|
116
|
+
"status": "success",
|
|
117
|
+
"data": {
|
|
118
|
+
"message": "Password Changed Successfully"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"requestBody": {
|
|
127
|
+
"required": true,
|
|
128
|
+
"content": {
|
|
129
|
+
"application/json": {
|
|
130
|
+
"schema": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"example": {
|
|
133
|
+
"existingPassword": "123",
|
|
134
|
+
"newPassword": "12345678"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"example": { "existingPassword": "1234",
|
|
138
|
+
"newPassword": "12345678" }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"/platform-x/api/v1/web/en/delivery/page-model": {
|
|
145
|
+
"get": {
|
|
146
|
+
"summary": "PageModel",
|
|
147
|
+
"description": "get the json of page model",
|
|
148
|
+
"operationId": "faqs",
|
|
149
|
+
"tags": ["platform-x"],
|
|
150
|
+
"parameters": [
|
|
151
|
+
{
|
|
152
|
+
"$ref": "#/components/parameters/pagePath"
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"responses": {
|
|
156
|
+
"200": {
|
|
157
|
+
"description": "",
|
|
158
|
+
"headers": {},
|
|
159
|
+
"content": {
|
|
160
|
+
"application/json": {
|
|
161
|
+
"schema": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"example": {
|
|
164
|
+
"code": 200,
|
|
165
|
+
"status": "success",
|
|
166
|
+
"data": { "fetchPageContent": { "Page": "contactus", "Title": "Home page2", "CurrentPageURL": "/contactus", "ParentPageURL": "/", "SiteName": "platform-x", "DevelopedBy": "dinesh", "DevelopedDate": "2022-02-28T09:49:00Z", "IsEdit": false, "SeoEnable": false, "AnalyticsEnable": false, "RobotTxt": true, "SiteMap": false, "Analytics": false, "Others": "{\"name\":\"dinesh\"}", "StructureData": "{\"name\":\"dinesh\"}", "PageSettings": { "PageName": "Home | Platform-X", "PageDescription": "Lorem Ipsum is simply dummy text of the printing", "PageTags": ["Contact", "Essentials"], "PageURL": "https://platform-x.com/home", "PageViewer": { "everyone": true, "admins": false, "members": false }, "PageCaching": true, "PageMobileFriendly": true, "SeoTitle": "Home | Platform-X", "SeoDescription": "Lorem Ipsum is simply dummy text of the printing", "SeoKeywords": ["Contact", "Essentials"], "SeoBlockIndexing": true, "SocialOgTitle": "Home | Platform-X", "SocialOgDescription": "Lorem Ipsum is simply dummy text of the printing", "SocialOgSiteName": "Home | Platform-X", "SocialOgType": "Website | Article", "SocialOgURL": "https://platform-x.com/home", "SocialOgLocale": "en_US | en_GB | fr_FR", "SocialOgImage": "/site/binaries/_ht_1647243588737/content/gallery/hclplatformx/sitecomponents/default/herobanner/hero-banner---web.jpg", "SocialOgTwitterTitle": "Home | Platform-X", "SocialOgTwitterDescription": "Lorem Ipsum is simply dummy text of the printing", "SocialOgTwitterImage": "/site/binaries/_ht_1647243588737/content/gallery/hclplatformx/sitecomponents/default/herobanner/hero-banner---web.jpg", "SocialOgTwitterURL": "https://platform-x.com/home", "SocialTwitterCardSize": "small | large" }, "Children": [{ "PrelemId": "prelem002", "PrelemName": "contactus", "SeoEnabled": false, "AnalyticsEnabled": false, "DocumentPath": "/content/documents/hclplatformx/sitecomponents/default/default_websiteintroduction", "DocumentType": "hclplatformx:SiteComponentWebsiteIntroduction", "IsHidden": false, "StructuredData": "" }, { "PrelemId": "prelem002", "PrelemName": "contactus", "SeoEnabled": false, "AnalyticsEnabled": false, "DocumentPath": "/content/documents/hclplatformx/sitecomponents/default/default_productsummaryviaimage", "DocumentType": "hclplatformx:SiteComponentProductSummaryViaImage", "IsHidden": false, "StructuredData": "" }, { "PrelemId": "prelem002", "PrelemName": "contactus", "SeoEnabled": false, "AnalyticsEnabled": false, "DocumentPath": "/content/documents/hclplatformx/sitecomponents/default/default_productsummaryviavideo", "DocumentType": "hclplatformx:SiteComponentProductSummaryViaVideo", "IsHidden": false, "StructuredData": "" }, { "PrelemId": "prelem002", "PrelemName": "contactus", "SeoEnabled": false, "AnalyticsEnabled": false, "DocumentPath": "/content/documents/hclplatformx/sitecomponents/default/default_quote", "DocumentType": "hclplatformx:SiteComponentQuote", "IsHidden": false, "StructuredData": "" }, { "PrelemId": "prelem002", "PrelemName": "contactus", "SeoEnabled": false, "AnalyticsEnabled": false, "DocumentPath": "/content/documents/hclplatformx/sitecomponents/default/default_logo", "DocumentType": "hclplatformx:SiteComponentLogo", "IsHidden": false, "StructuredData": "" }, { "PrelemId": "prelem002", "PrelemName": "contactus", "SeoEnabled": false, "AnalyticsEnabled": false, "DocumentPath": "/content/documents/hclplatformx/sitecomponents/default/default_productdetail", "DocumentType": "hclplatformx:SiteComponentProductDetail", "IsHidden": false, "StructuredData": "" }, { "PrelemId": "prelem002", "PrelemName": "contactus", "SeoEnabled": false, "AnalyticsEnabled": false, "DocumentPath": "/content/documents/hclplatformx/sitecomponents/default/default_contactus", "DocumentType": "hclplatformx:SiteComponentContactUs", "IsHidden": false, "StructuredData": "" }], "Content": { "/content/documents/hclplatformx/sitecomponents/default/default_logo": { "Images": { "Image_1": { "Name": "AWS", "Url": "/site/binaries/_ht_1646911954544/content/gallery/hclplatformx/sitecomponents/default/sponsors/1200px-amazon_web_services_logo.svg.png", "Title": "AWS", "Description": "This is for AWS", "Attribution": false, "AltText": "AWS" }, "Image_2": { "Name": "AngloAmerican", "Url": "/site/binaries/_ht_1646911955201/content/gallery/hclplatformx/sitecomponents/default/sponsors/anglo_american_logo_new.png", "Title": "AngloAmerican", "Description": "This is for AngloAmerican", "Attribution": false, "AltText": "AngloAmerican" }, "Image_3": { "Name": "Cisco", "Url": "/site/binaries/_ht_1646911955725/content/gallery/hclplatformx/sitecomponents/default/sponsors/cisco-logo-transparent.png", "Title": "Cisco", "Description": "This is for Cisco", "Attribution": false, "AltText": "Cisco" }, "Image_4": { "Name": "Linkedin", "Url": "/site/binaries/_ht_1646911956258/content/gallery/hclplatformx/sitecomponents/default/sponsors/linkedin_logo_2019.png", "Title": "Linkedin", "Description": "This is for Linkedin", "Attribution": false, "AltText": "Linkedin" }, "Image_5": { "Name": "Meta", "Url": "/site/binaries/_ht_1646909670109/content/gallery/hclplatformx/sitecomponents/default/sponsors/meta-logo.png", "Title": "Meta", "Description": "This is for Meta", "Attribution": false, "AltText": "Meta" }, "Image_6": { "Name": "Microsoft", "Url": "/site/binaries/_ht_1646911956861/content/gallery/hclplatformx/sitecomponents/default/sponsors/microsoft-logo-png-transparent.png", "Title": "Microsoft", "Description": "This is for Microsoft", "Attribution": false, "AltText": "Microsoft" }, "Image_7": { "Name": "SharkTank", "Url": "/site/binaries/_ht_1646909671662/content/gallery/hclplatformx/sitecomponents/default/sponsors/shark-tank-logo.png", "Title": "SharkTank", "Description": "This is for SharkTank", "Attribution": false, "AltText": "SharkTank" } } }, "/content/documents/hclplatformx/sitecomponents/default/default_productsummaryviaimage": { "Button1_Name": "Contact US", "Button1_Value": "Contact US", "Button1_RedirectURL": "www.hcl.com", "Button1_Internal": false, "Images": { "Image_1": { "Name": "Imagecard1", "Url": "/site/binaries/_ht_1647243694987/content/gallery/hclplatformx/sitecomponents/default/imagecard/image-section---web.jpg", "Title": "Imagecard1", "Description": "This is for Imagecard1", "Attribution": false, "AltText": "Imagecard1" } } }, "/content/documents/hclplatformx/sitecomponents/default/default_quote": { "AuthorName": "Nelson Mandela", "QuoteText": "Education is the most powerful weapon which you can use to change the world." }, "/content/documents/hclplatformx/sitecomponents/default/default_productsummaryviavideo": { "Videos": { "Video_1": { "Name": "HCL 360 Video", "Url": "https://www.youtube.com/watch?v=x9u4HdyTFXY", "Title": "HCL 360 Video", "Description": "This is for HCL 360 Video", "Attribution": false, "CC": false, "Transcript": false } }, "Images": { "Image_1": { "Url": "null" } }, "Title": "Why a Digital Business Career with HCL Technologies?", "Description": "Digital Business saves visitors a lot of time with its simple and easy-to-read FAQ page. Questions are separated into larger categories that make for simple searches. While there's no search bar, the ease of viewing all...Zappos saves visitors a lot of time with its simple and easy-to-read FAQ page. Questions are separated into larger categories that make for simple searches. While there's no search bar, the ease of viewing all..Zappos saves visitors a lot of time with its simple." }, "/content/documents/hclplatformx/sitecomponents/default/default_websiteintroduction": { "Button1_Name": "ICT Certified Cource", "Button1_Value": "ICT Certified Cource", "Button1_RedirectURL": "www.hcl.com", "Button1_Internal": false, "Button2_Name": "DBE icloud", "Button2_Value": "DBE icloud", "Button2_RedirectURL": "www.hcl.com", "Button2_Internal": false, "Images": { "Image_1": { "Name": "HomeBanner", "Url": "/site/binaries/_ht_1647243588737/content/gallery/hclplatformx/sitecomponents/default/herobanner/hero-banner---web.jpg", "Title": "HomeBanner", "Description": "This is for HeroBanner", "Attribution": false, "AltText": "HomeBanner" } }, "Description": "Digital transformation has gone beyond the buzzword stage to become the defining paradigm of modern global enterprises. In the ongoing race for better experiences, competitive advantages, market agility, and higher profits, the only way to scale and transform is through digital business.", "Title": "Digital Business for the Digital World" }, "/content/documents/hclplatformx/sitecomponents/default/default_productdetail": { "SubTitle": "Uploaded on 8th Nov, 2021", "Images": { "Image_1": { "Name": "Imagecard2", "Url": "/site/binaries/_ht_1647243696873/content/gallery/hclplatformx/sitecomponents/default/imagecard/heritage---web.jpg", "Title": "Imagecard2", "Description": "This is for Imagecard2", "Attribution": false, "AltText": "Imagecard2" } }, "Title": "Heritage Day Meme Competition (Winners)", "Description": "Here are the winners of the Meme Competition on Heritage Day." }, "/content/documents/hclplatformx/sitecomponents/default/default_contactus": { "Images": { "Image_1": { "Name": "ContactUs", "Url": "/site/binaries/_ht_1645503740038/content/gallery/hclplatformx/sitecomponents/default/imagecard/newcontact-1.png", "Title": "ContactUs", "Description": "This is for ContactUs", "Attribution": false, "AltText": "ContactUs" } }, "Title": "Contact Us", "SubTitle": "How can we help?", "Description": "All the essential numbers and email addresses you need to get in touch with us at Harvest Essential Oils.", "Button1_Name": "Reach Us", "Button1_Value": "Reach Us", "Button1_RedirectURL": "www.hcl.com", "Button1_Internal": false } } } }
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"components": {
|
|
177
|
+
"parameters": {
|
|
178
|
+
"client_id": {
|
|
179
|
+
"name": "client_id",
|
|
180
|
+
"in": "query",
|
|
181
|
+
"required": true,
|
|
182
|
+
"style": "form",
|
|
183
|
+
"schema": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"example": "react"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"pagePath": {
|
|
189
|
+
"name": "pagePath",
|
|
190
|
+
"in": "query",
|
|
191
|
+
"required": true,
|
|
192
|
+
"style": "form",
|
|
193
|
+
"schema": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"example": "contactus"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"redirect_uri": {
|
|
199
|
+
"name": "redirect_uri",
|
|
200
|
+
"in": "query",
|
|
201
|
+
"required": true,
|
|
202
|
+
"style": "form",
|
|
203
|
+
"schema": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"example": "http://localhost:3000/"
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"start": {
|
|
209
|
+
"name": "start",
|
|
210
|
+
"in": "path",
|
|
211
|
+
"description": "starting index of record",
|
|
212
|
+
"required": false,
|
|
213
|
+
"style": "form",
|
|
214
|
+
"schema": {
|
|
215
|
+
"type": "integer",
|
|
216
|
+
"example": "0"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"rows": {
|
|
220
|
+
"name": "rows",
|
|
221
|
+
"in": "path",
|
|
222
|
+
"description": "number of record that you want to fetch",
|
|
223
|
+
"required": false,
|
|
224
|
+
"style": "form",
|
|
225
|
+
"schema": {
|
|
226
|
+
"type": "integer",
|
|
227
|
+
"example": "10"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"sort": {
|
|
231
|
+
"name": "sort",
|
|
232
|
+
"in": "path",
|
|
233
|
+
"required": false,
|
|
234
|
+
"style": "form",
|
|
235
|
+
"schema": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"example": "desc"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"security": [],
|
|
243
|
+
"externalDocs": {
|
|
244
|
+
"url": "",
|
|
245
|
+
"description": ""
|
|
246
|
+
}
|
|
247
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
let getMock = jest.fn();
|
|
36
|
+
jest.mock("../../src/common/service/requestService", () => {
|
|
37
|
+
return {
|
|
38
|
+
HttpRequestHandler: jest.fn().mockImplementation(() => {
|
|
39
|
+
return {
|
|
40
|
+
get: getMock,
|
|
41
|
+
};
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
const common_controller_1 = require("../../src/common/controllers/common_controller");
|
|
46
|
+
const util = __importStar(require("../../src/common/util/commonUtil"));
|
|
47
|
+
describe('Test fetchOrDownloadFile', () => {
|
|
48
|
+
let req;
|
|
49
|
+
let resEnd = jest.fn();
|
|
50
|
+
let res = {
|
|
51
|
+
status: jest.fn().mockImplementation(() => {
|
|
52
|
+
return {
|
|
53
|
+
send: jest.fn()
|
|
54
|
+
};
|
|
55
|
+
}),
|
|
56
|
+
setHeader: jest.fn(),
|
|
57
|
+
send: jest.fn(),
|
|
58
|
+
end: resEnd
|
|
59
|
+
};
|
|
60
|
+
test('success scenario for healthCheck', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
|
+
let handleResponseSpy = jest.spyOn(util, 'handleResponse');
|
|
62
|
+
getMock.mockResolvedValue({});
|
|
63
|
+
yield (0, common_controller_1.healthCheck)(req, res);
|
|
64
|
+
expect(handleResponseSpy).toHaveBeenCalled();
|
|
65
|
+
}));
|
|
66
|
+
test('error scenario for healthCheck', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
+
let handleResponseSpy = jest.spyOn(util, 'handleResponse');
|
|
68
|
+
getMock.mockReturnValue({});
|
|
69
|
+
yield (0, common_controller_1.healthCheck)(req, res);
|
|
70
|
+
expect(handleResponseSpy).toHaveBeenCalled();
|
|
71
|
+
}));
|
|
72
|
+
test('error scenario for healthCheck', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
|
+
let handleResponseSpy = jest.spyOn(util, 'handleResponse');
|
|
74
|
+
getMock.mockRejectedValue({});
|
|
75
|
+
yield (0, common_controller_1.healthCheck)(req, res);
|
|
76
|
+
expect(handleResponseSpy).toHaveBeenCalled();
|
|
77
|
+
}));
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=common_controller.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common_controller.spec.js","sourceRoot":"","sources":["../../../test/controllers/common_controller.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,OAAO,GAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AACtB,IAAI,CAAC,IAAI,CAAC,yCAAyC,EAAC,GAAE,EAAE;IACpD,OAAO;QACH,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAE,EAAE;YACjD,OAAO;gBACH,GAAG,EAAE,OAAO;aACf,CAAA;QACL,CAAC,CAAC;KACL,CAAA;AACL,CAAC,CACA,CAAC;AAEF,sFAA8E;AAC9E,uEAAyD;AAEzD,QAAQ,CAAC,0BAA0B,EAAC,GAAE,EAAE;IACpC,IAAI,GAAQ,CAAC;IACb,IAAI,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACvB,IAAI,GAAG,GAAM;QACT,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAE,EAAE;YACrC,OAAO;gBACH,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;aAClB,CAAA;QACL,CAAC,CAAC;QACF,SAAS,EAAC,IAAI,CAAC,EAAE,EAAE;QACnB,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;QACf,GAAG,EAAC,MAAM;KACb,CAAC;IAEF,IAAI,CAAC,kCAAkC,EAAE,GAAQ,EAAE;QAC/C,IAAI,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAC,gBAAgB,CAAC,CAAA;QACzD,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAC9B,MAAM,IAAA,+BAAW,EAAC,GAAG,EAAC,GAAG,CAAC,CAAA;QAC1B,MAAM,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACjD,CAAC,CAAA,CAAC,CAAA;IAEF,IAAI,CAAC,gCAAgC,EAAE,GAAQ,EAAE;QAC7C,IAAI,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAC,gBAAgB,CAAC,CAAA;QACzD,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QAC5B,MAAM,IAAA,+BAAW,EAAC,GAAG,EAAC,GAAG,CAAC,CAAA;QAC1B,MAAM,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACjD,CAAC,CAAA,CAAC,CAAA;IACF,IAAI,CAAC,gCAAgC,EAAE,GAAQ,EAAE;QAC7C,IAAI,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAC,gBAAgB,CAAC,CAAA;QACzD,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAC9B,MAAM,IAAA,+BAAW,EAAC,GAAG,EAAC,GAAG,CAAC,CAAA;QAC1B,MAAM,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACjD,CAAC,CAAA,CAAC,CAAA;AAEN,CAAC,CAAC,CAAC"}
|