@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.
Files changed (151) hide show
  1. package/README.md +7 -7
  2. package/dist/jest-setup.js +28 -0
  3. package/dist/jest-setup.js.map +1 -0
  4. package/dist/src/common/controllers/common_controller.js +72 -0
  5. package/dist/src/common/controllers/common_controller.js.map +1 -0
  6. package/dist/src/common/controllers/index.js +29 -0
  7. package/dist/src/common/controllers/index.js.map +1 -0
  8. package/dist/src/common/middleware/commonMiddleware.js +141 -0
  9. package/dist/src/common/middleware/commonMiddleware.js.map +1 -0
  10. package/dist/src/common/service/requestService.js +79 -1
  11. package/dist/src/common/service/requestService.js.map +1 -0
  12. package/dist/src/common/service/twilioService.js +3 -11
  13. package/dist/src/common/service/twilioService.js.map +1 -0
  14. package/dist/src/common/util/commonUtil.js +119 -1
  15. package/dist/src/common/util/commonUtil.js.map +1 -0
  16. package/dist/src/common/util/constants.js +18 -0
  17. package/dist/src/common/util/constants.js.map +1 -0
  18. package/dist/src/common/util/errorHandler.js +4 -6
  19. package/dist/src/common/util/errorHandler.js.map +1 -0
  20. package/dist/src/common/util/httpCodes.js +26 -0
  21. package/dist/src/common/util/httpCodes.js.map +1 -0
  22. package/dist/src/common/util/logger.js +1 -1
  23. package/dist/src/common/util/logger.js.map +1 -0
  24. package/dist/src/common/util/requestTracer.js +18 -1
  25. package/dist/src/common/util/requestTracer.js.map +1 -0
  26. package/dist/src/common/util/solrConnector.js.map +1 -0
  27. package/dist/src/config/index.js +49 -4
  28. package/dist/src/config/index.js.map +1 -0
  29. package/dist/src/platform-x/app.js +35 -0
  30. package/dist/src/platform-x/app.js.map +1 -0
  31. package/dist/src/platform-x/constants/index.js +2 -14
  32. package/dist/src/platform-x/constants/index.js.map +1 -0
  33. package/dist/src/platform-x/constants/style.js +98 -98
  34. package/dist/src/platform-x/constants/style.js.map +1 -0
  35. package/dist/src/platform-x/controllers/cronController.js +399 -0
  36. package/dist/src/platform-x/controllers/cronController.js.map +1 -0
  37. package/dist/src/platform-x/controllers/fileUploadController.js +76 -0
  38. package/dist/src/platform-x/controllers/fileUploadController.js.map +1 -0
  39. package/dist/src/platform-x/controllers/graphRESTControllers.js +183 -0
  40. package/dist/src/platform-x/controllers/graphRESTControllers.js.map +1 -0
  41. package/dist/src/platform-x/controllers/index.js +30 -0
  42. package/dist/src/platform-x/controllers/index.js.map +1 -0
  43. package/dist/src/platform-x/controllers/siteDomainController.js +74 -0
  44. package/dist/src/platform-x/controllers/siteDomainController.js.map +1 -0
  45. package/dist/src/platform-x/dataSource/emailDataSource.js.map +1 -0
  46. package/dist/src/platform-x/database/connection.js +3 -6
  47. package/dist/src/platform-x/database/connection.js.map +1 -0
  48. package/dist/src/platform-x/database/dao/formBuilder.dao.js +1 -1
  49. package/dist/src/platform-x/database/dao/formBuilder.dao.js.map +1 -0
  50. package/dist/src/platform-x/database/dao/siteDomain.dao.js +73 -0
  51. package/dist/src/platform-x/database/dao/siteDomain.dao.js.map +1 -0
  52. package/dist/src/platform-x/database/index.js.map +1 -0
  53. package/dist/src/platform-x/{interface/interface.js → database/interfaces/site_domain.interface.js} +1 -1
  54. package/dist/src/platform-x/database/interfaces/site_domain.interface.js.map +1 -0
  55. package/dist/src/platform-x/database/models/formBuilder.model.js.map +1 -0
  56. package/dist/src/platform-x/database/models/site_domains.model.js +51 -0
  57. package/dist/src/platform-x/database/models/site_domains.model.js.map +1 -0
  58. package/dist/src/platform-x/routes/index.js +19 -0
  59. package/dist/src/platform-x/routes/index.js.map +1 -0
  60. package/dist/src/platform-x/services/cron.services.js +117 -0
  61. package/dist/src/platform-x/services/cron.services.js.map +1 -0
  62. package/dist/src/platform-x/util/emailHandler.js +53 -137
  63. package/dist/src/platform-x/util/emailHandler.js.map +1 -0
  64. package/dist/src/platform-x/util/emailTemplate.js +63 -60
  65. package/dist/src/platform-x/util/emailTemplate.js.map +1 -0
  66. package/dist/src/platform-x/util/solr-data-source/SolrHttpDataSource.js +2 -0
  67. package/dist/src/platform-x/util/solr-data-source/SolrHttpDataSource.js.map +1 -0
  68. package/dist/src/server.js +38 -0
  69. package/dist/src/server.js.map +1 -0
  70. package/dist/swagger.json +247 -0
  71. package/dist/test/controllers/common_controller.spec.js +79 -0
  72. package/dist/test/controllers/common_controller.spec.js.map +1 -0
  73. package/dist/test/middleware/commonMiddleware.spec.js +88 -0
  74. package/dist/test/middleware/commonMiddleware.spec.js.map +1 -0
  75. package/dist/test/platform-x/controllers/graphRESTControllers.spec.js +195 -0
  76. package/dist/test/platform-x/controllers/graphRESTControllers.spec.js.map +1 -0
  77. package/dist/test/platform-x/datasource/emailDataSource.spec.js +81 -0
  78. package/dist/test/platform-x/datasource/emailDataSource.spec.js.map +1 -0
  79. package/dist/test/platform-x/util/emailHandler.spec.js +474 -0
  80. package/dist/test/platform-x/util/emailHandler.spec.js.map +1 -0
  81. package/dist/test/platform-x/util/solr-data-source/SolrHttpDataSource.spec.js +80 -0
  82. package/dist/test/platform-x/util/solr-data-source/SolrHttpDataSource.spec.js.map +1 -0
  83. package/dist/test/services/requestService.spec.js +108 -0
  84. package/dist/test/services/requestService.spec.js.map +1 -0
  85. package/dist/test/services/requestServiceGet.spec.js +43 -0
  86. package/dist/test/services/requestServiceGet.spec.js.map +1 -0
  87. package/dist/test/src/common/service/twilioService.spec.js +65 -0
  88. package/dist/test/src/common/service/twilioService.spec.js.map +1 -0
  89. package/dist/test/util/commonUtil.spec.js +110 -0
  90. package/dist/test/util/commonUtil.spec.js.map +1 -0
  91. package/dist/test/util/logger.spec.js +51 -0
  92. package/dist/test/util/logger.spec.js.map +1 -0
  93. package/dist/test/util/requestTracer.spec.js +64 -0
  94. package/dist/test/util/requestTracer.spec.js.map +1 -0
  95. package/dist/test/util/solrconnector.spec.js +145 -0
  96. package/dist/test/util/solrconnector.spec.js.map +1 -0
  97. package/package.json +66 -62
  98. package/postman_collection/HEP_Environment.postman_environment.json +44 -44
  99. package/postman_collection/hep-notification.postman_collection.json +55 -55
  100. package/reports/output.jtl +1 -1
  101. package/reports/scripts/jmeter_sendgrid.js +34 -34
  102. package/reports/scripts/newman_sendgrid.js +40 -40
  103. package/reports/scripts/sendgrid.js +40 -40
  104. package/reports/scripts/trivy_sendgrid.js +40 -40
  105. package/src/common/service/requestService.ts +87 -0
  106. package/{dist/src/common/service/secretKeyManager.services.js → src/common/service/secretKeyManager.services.ts} +1 -2
  107. package/src/common/service/twilioService.ts +58 -0
  108. package/src/common/util/commonUtil.ts +39 -0
  109. package/src/common/util/errorHandler.ts +120 -0
  110. package/src/common/util/logger.ts +215 -0
  111. package/src/common/util/requestTracer.ts +10 -0
  112. package/src/common/util/solrConnector.ts +319 -0
  113. package/src/config/index.ts +35 -0
  114. package/src/index.ts +34 -0
  115. package/src/platform-x/constants/index.ts +20 -0
  116. package/src/platform-x/constants/style.ts +99 -0
  117. package/src/platform-x/dataSource/emailDataSource.ts +34 -0
  118. package/src/platform-x/database/connection.ts +47 -0
  119. package/src/platform-x/database/dao/formBuilder.dao.ts +33 -0
  120. package/src/platform-x/database/index.ts +7 -0
  121. package/src/platform-x/database/models/formBuilder.model.ts +23 -0
  122. package/src/platform-x/util/emailHandler.ts +580 -0
  123. package/src/platform-x/util/emailTemplate.ts +66 -0
  124. package/src/platform-x/util/solr-data-source/SolrHttpDataSource.ts +97 -0
  125. package/{dist → src}/templates/orderPlaced.ejs +172 -172
  126. package/{dist → src}/templates/orderPlaced.html +189 -189
  127. package/tsconfig.json +73 -0
  128. package/dist/src/common/service/requestService.d.ts +0 -26
  129. package/dist/src/common/service/secretKeyManager.services.d.ts +0 -0
  130. package/dist/src/common/service/twilioService.d.ts +0 -19
  131. package/dist/src/common/util/commonUtil.d.ts +0 -22
  132. package/dist/src/common/util/errorHandler.d.ts +0 -44
  133. package/dist/src/common/util/logger.d.ts +0 -68
  134. package/dist/src/common/util/requestTracer.d.ts +0 -2
  135. package/dist/src/common/util/secretKeyManager.d.ts +0 -7
  136. package/dist/src/common/util/secretKeyManager.js +0 -58
  137. package/dist/src/common/util/solrConnector.d.ts +0 -35
  138. package/dist/src/config/index.d.ts +0 -30
  139. package/dist/src/index.d.ts +0 -5
  140. package/dist/src/index.js +0 -20
  141. package/dist/src/platform-x/constants/index.d.ts +0 -18
  142. package/dist/src/platform-x/constants/style.d.ts +0 -1
  143. package/dist/src/platform-x/dataSource/emailDataSource.d.ts +0 -5
  144. package/dist/src/platform-x/database/connection.d.ts +0 -8
  145. package/dist/src/platform-x/database/dao/formBuilder.dao.d.ts +0 -9
  146. package/dist/src/platform-x/database/index.d.ts +0 -7
  147. package/dist/src/platform-x/database/models/formBuilder.model.d.ts +0 -34
  148. package/dist/src/platform-x/interface/interface.d.ts +0 -4
  149. package/dist/src/platform-x/util/emailHandler.d.ts +0 -62
  150. package/dist/src/platform-x/util/emailTemplate.d.ts +0 -4
  151. package/dist/src/platform-x/util/solr-data-source/SolrHttpDataSource.d.ts +0 -26
package/package.json CHANGED
@@ -1,62 +1,66 @@
1
- {
2
- "name": "@platform-x/hep-notification-client",
3
- "version": "1.3.0",
4
- "description": "@platform-x/hep-notification-client",
5
- "main": "dist/src/index.js",
6
- "types": "dist/src/index.d.ts",
7
- "scripts": {
8
- "build": "tsc && npm run copy-static",
9
- "copy-static": "xcopy src\\templates dist\\templates /E /I /Y"
10
- },
11
- "author": "",
12
- "license": "ISC",
13
- "devDependencies": {
14
- "@types/ejs": "^3.1.5",
15
- "@types/jsdom": "^21.1.7",
16
- "@types/node": "^22.15.3",
17
- "@types/uuid": "^10.0.0",
18
- "ts-node": "^10.9.2",
19
- "typescript": "^5.8.3"
20
- },
21
- "dependencies": {
22
- "@alloc/quick-lru": "^5.2.0",
23
- "@sendgrid/helpers": "7.7.0",
24
- "@sendgrid/mail": "^7.6.0",
25
- "@types/bunyan": "^1.8.6",
26
- "@types/bunyan-format": "^0.2.3",
27
- "@types/cls-hooked": "^4.3.3",
28
- "@types/dompurify": "^3.0.5",
29
- "@types/express": "^4.17.12",
30
- "@types/lodash": "^4.14.171",
31
- "@types/node": "^15.12.2",
32
- "@types/twilio": "^3.19.2",
33
- "apollo-server-caching": "^3.3.0",
34
- "axios": "0.21.4",
35
- "bunyan": "^1.8.15",
36
- "bunyan-format": "^0.2.1",
37
- "cls-hooked": "^4.2.2",
38
- "dataloader": "^2.0.0",
39
- "dompurify": "^3.2.4",
40
- "dotenv": "^10.0.0",
41
- "ejs": "^3.1.10",
42
- "express": "^4.17.1",
43
- "fs": "^0.0.1-security",
44
- "hep-secret-access": "^1.3.4",
45
- "jsdom": "^26.1.0",
46
- "lodash": "4.17.21",
47
- "moment": "2.29.4",
48
- "moment-timezone": "0.5.34",
49
- "mongodb": "5.9.2",
50
- "mongoose": "7.0.3",
51
- "mysql2": "2.3.3",
52
- "node-html-parser": "^5.4.2",
53
- "request-ip": "2.1.3",
54
- "solr-client": "0.10.0-rc6",
55
- "twilio": "^5.3.6",
56
- "uuid": "8.3.2"
57
- },
58
- "private": false,
59
- "publishConfig": {
60
- "access": "public"
61
- }
62
- }
1
+ {
2
+ "name": "@platform-x/hep-notification-client",
3
+ "version": "1.3.2",
4
+ "description": "@platform-x/hep-notification-client",
5
+ "main": "dist/src/index.js",
6
+ "types": "dist/src/index.d.ts",
7
+ "scripts": {
8
+ "devstart": "npm run build && tsc-watch --onSuccess \"node ./dist/src/index.js\"",
9
+ "start": "node ./dist/src/index.js",
10
+ "build": "tsc && npm run copy-static",
11
+ "copy-static": "xcopy src\\templates dist\\templates /E /I /Y"
12
+ },
13
+ "author": "",
14
+ "license": "ISC",
15
+ "devDependencies": {
16
+ "@types/ejs": "^3.1.5",
17
+ "@types/jsdom": "^21.1.7",
18
+ "@types/node": "^22.15.3",
19
+ "@types/uuid": "^10.0.0",
20
+ "ts-node": "^10.9.2",
21
+ "tsc-watch": "^7.2.0",
22
+ "typescript": "^5.8.3"
23
+ },
24
+ "dependencies": {
25
+ "@alloc/quick-lru": "^5.2.0",
26
+ "@sendgrid/helpers": "7.7.0",
27
+ "@sendgrid/mail": "^7.6.0",
28
+ "@types/bunyan": "^1.8.6",
29
+ "@types/bunyan-format": "^0.2.3",
30
+ "@types/cls-hooked": "^4.3.3",
31
+ "@types/dompurify": "^3.0.5",
32
+ "@types/express": "^4.17.12",
33
+ "@types/lodash": "^4.14.171",
34
+ "@types/node": "^15.12.2",
35
+ "@types/twilio": "^3.19.2",
36
+ "apollo-datasource": "^3.3.2",
37
+ "apollo-server-caching": "^3.3.0",
38
+ "axios": "0.21.4",
39
+ "bunyan": "^1.8.15",
40
+ "bunyan-format": "^0.2.1",
41
+ "cls-hooked": "^4.2.2",
42
+ "dataloader": "^2.0.0",
43
+ "dompurify": "^3.2.4",
44
+ "dotenv": "^10.0.0",
45
+ "ejs": "^3.1.10",
46
+ "express": "^4.17.1",
47
+ "fs": "^0.0.1-security",
48
+ "hep-secret-access": "^1.3.4",
49
+ "jsdom": "^26.1.0",
50
+ "lodash": "4.17.21",
51
+ "moment": "2.29.4",
52
+ "moment-timezone": "0.5.34",
53
+ "mongodb": "5.9.2",
54
+ "mongoose": "7.0.3",
55
+ "mysql2": "2.3.3",
56
+ "node-html-parser": "^5.4.2",
57
+ "request-ip": "2.1.3",
58
+ "solr-client": "0.10.0-rc6",
59
+ "twilio": "^5.3.6",
60
+ "uuid": "^8.3.2"
61
+ },
62
+ "private": false,
63
+ "publishConfig": {
64
+ "access": "public"
65
+ }
66
+ }
@@ -1,45 +1,45 @@
1
- {
2
- "id": "e77aba62-34ba-47a9-acac-2dd708bbe87a",
3
- "name": "HEP_Environment",
4
- "values": [
5
- {
6
- "key": "devUrl",
7
- "value": "https://platx-api-dev.fanuep.com/",
8
- "type": "default",
9
- "enabled": true
10
- },
11
- {
12
- "key": "local_reg_url",
13
- "value": "http://localhost:8090/",
14
- "type": "default",
15
- "enabled": true
16
- },
17
- {
18
- "key": "local_delivery_url",
19
- "value": "http://localhost:8099/",
20
- "type": "default",
21
- "enabled": true
22
- },
23
- {
24
- "key": "local_gateway_url",
25
- "value": "http://localhost:8091/",
26
- "type": "default",
27
- "enabled": true
28
- },
29
- {
30
- "key": "dev_reg_url",
31
- "value": "https://platx-prelem-regs-dev.fanuep.com/",
32
- "type": "default",
33
- "enabled": true
34
- },
35
- {
36
- "key": "local_notification_url",
37
- "value": "http://localhost:8099/",
38
- "type": "default",
39
- "enabled": true
40
- }
41
- ],
42
- "_postman_variable_scope": "environment",
43
- "_postman_exported_at": "2022-11-18T06:40:59.828Z",
44
- "_postman_exported_using": "Postman/9.19.0"
1
+ {
2
+ "id": "e77aba62-34ba-47a9-acac-2dd708bbe87a",
3
+ "name": "HEP_Environment",
4
+ "values": [
5
+ {
6
+ "key": "devUrl",
7
+ "value": "https://platx-api-dev.fanuep.com/",
8
+ "type": "default",
9
+ "enabled": true
10
+ },
11
+ {
12
+ "key": "local_reg_url",
13
+ "value": "http://localhost:8090/",
14
+ "type": "default",
15
+ "enabled": true
16
+ },
17
+ {
18
+ "key": "local_delivery_url",
19
+ "value": "http://localhost:8099/",
20
+ "type": "default",
21
+ "enabled": true
22
+ },
23
+ {
24
+ "key": "local_gateway_url",
25
+ "value": "http://localhost:8091/",
26
+ "type": "default",
27
+ "enabled": true
28
+ },
29
+ {
30
+ "key": "dev_reg_url",
31
+ "value": "https://platx-prelem-regs-dev.fanuep.com/",
32
+ "type": "default",
33
+ "enabled": true
34
+ },
35
+ {
36
+ "key": "local_notification_url",
37
+ "value": "http://localhost:8099/",
38
+ "type": "default",
39
+ "enabled": true
40
+ }
41
+ ],
42
+ "_postman_variable_scope": "environment",
43
+ "_postman_exported_at": "2022-11-18T06:40:59.828Z",
44
+ "_postman_exported_using": "Postman/9.19.0"
45
45
  }
@@ -1,56 +1,56 @@
1
- {
2
- "info": {
3
- "_postman_id": "84173df2-abc7-4295-9cb7-95c70c4c04c7",
4
- "name": "hep-notification",
5
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
6
- },
7
- "item": [
8
- {
9
- "name": "publish notification",
10
- "request": {
11
- "auth": {
12
- "type": "basic",
13
- "basic": [
14
- {
15
- "key": "username",
16
- "value": "dinesh",
17
- "type": "string"
18
- },
19
- {
20
- "key": "password",
21
- "value": "1234567890",
22
- "type": "string"
23
- }
24
- ]
25
- },
26
- "method": "POST",
27
- "header": [],
28
- "body": {
29
- "mode": "raw",
30
- "raw": "{\n \"pageTitle\": \"Vod Publish Mail Testing\",\n \"userName\": \"Kapil Patel\",\n \"dateTime\": \"2022-04-26T05:09:40Z\",\n \"timezoneOffset\": \"Asia/Calcutta\",\n \"emailTo\": \"s_sunil@hcl.com\",\n \"eventPageUrl\": \"https://platx-dev.com\",\n \"event\": \"published\",\n \"contentType\": \"Vod\"\n}",
31
- "options": {
32
- "raw": {
33
- "language": "json"
34
- }
35
- }
36
- },
37
- "url": {
38
- "raw": "{{local_notification_url}}platform-x/api/v1/web/en/notifications/send-email/publishunpublishemail",
39
- "host": [
40
- "{{local_notification_url}}platform-x"
41
- ],
42
- "path": [
43
- "api",
44
- "v1",
45
- "web",
46
- "en",
47
- "notifications",
48
- "send-email",
49
- "publishunpublishemail"
50
- ]
51
- }
52
- },
53
- "response": []
54
- }
55
- ]
1
+ {
2
+ "info": {
3
+ "_postman_id": "84173df2-abc7-4295-9cb7-95c70c4c04c7",
4
+ "name": "hep-notification",
5
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
6
+ },
7
+ "item": [
8
+ {
9
+ "name": "publish notification",
10
+ "request": {
11
+ "auth": {
12
+ "type": "basic",
13
+ "basic": [
14
+ {
15
+ "key": "username",
16
+ "value": "dinesh",
17
+ "type": "string"
18
+ },
19
+ {
20
+ "key": "password",
21
+ "value": "1234567890",
22
+ "type": "string"
23
+ }
24
+ ]
25
+ },
26
+ "method": "POST",
27
+ "header": [],
28
+ "body": {
29
+ "mode": "raw",
30
+ "raw": "{\n \"pageTitle\": \"Vod Publish Mail Testing\",\n \"userName\": \"Kapil Patel\",\n \"dateTime\": \"2022-04-26T05:09:40Z\",\n \"timezoneOffset\": \"Asia/Calcutta\",\n \"emailTo\": \"s_sunil@hcl.com\",\n \"eventPageUrl\": \"https://platx-dev.com\",\n \"event\": \"published\",\n \"contentType\": \"Vod\"\n}",
31
+ "options": {
32
+ "raw": {
33
+ "language": "json"
34
+ }
35
+ }
36
+ },
37
+ "url": {
38
+ "raw": "{{local_notification_url}}platform-x/api/v1/web/en/notifications/send-email/publishunpublishemail",
39
+ "host": [
40
+ "{{local_notification_url}}platform-x"
41
+ ],
42
+ "path": [
43
+ "api",
44
+ "v1",
45
+ "web",
46
+ "en",
47
+ "notifications",
48
+ "send-email",
49
+ "publishunpublishemail"
50
+ ]
51
+ }
52
+ },
53
+ "response": []
54
+ }
55
+ ]
56
56
  }
@@ -1 +1 @@
1
- This is test file
1
+ This is test file
@@ -1,34 +1,34 @@
1
- #! /usr/bin/env node
2
-
3
- const sgMail = require('@sendgrid/mail');
4
- sgMail.setApiKey(process.env.SENDGRID_API_KEY);
5
-
6
- const fs = require('fs'),
7
- filename = 'api_qa_jmeter.zip',
8
- fileType = 'application/zip',
9
- data = fs.readFileSync(filename);
10
- const msg = {
11
- to: 'HEP_Team@hcl.com',
12
- from: 'hepteamhcl@gmail.com',
13
- subject: 'auto generated test report for performance testing ',
14
- text: 'Build Artifact Testing',
15
- html: '<p>Hi Team,<br> Please find below the auto generated load testing report by Jmeter </br> <br> Thanks </br> <br> DevOps Team </br> </p>',
16
- attachments: [
17
- {
18
- content: data.toString('base64'),
19
- filename: filename,
20
- type: fileType,
21
- disposition: 'attachment',
22
- },
23
- // {
24
- // content: data2.toString('base64'),
25
- // filename: filename2,
26
- // type: fileType2,
27
- // disposition: 'attachment',
28
- // },
29
- ],
30
- };
31
- sgMail
32
- .send(msg)
33
- .then(() => console.log('Mail sent successfully'))
34
- .catch((error) => console.error(error.toString()));
1
+ #! /usr/bin/env node
2
+
3
+ const sgMail = require('@sendgrid/mail');
4
+ sgMail.setApiKey(process.env.SENDGRID_API_KEY);
5
+
6
+ const fs = require('fs'),
7
+ filename = 'api_qa_jmeter.zip',
8
+ fileType = 'application/zip',
9
+ data = fs.readFileSync(filename);
10
+ const msg = {
11
+ to: 'HEP_Team@hcl.com',
12
+ from: 'hepteamhcl@gmail.com',
13
+ subject: 'auto generated test report for performance testing ',
14
+ text: 'Build Artifact Testing',
15
+ html: '<p>Hi Team,<br> Please find below the auto generated load testing report by Jmeter </br> <br> Thanks </br> <br> DevOps Team </br> </p>',
16
+ attachments: [
17
+ {
18
+ content: data.toString('base64'),
19
+ filename: filename,
20
+ type: fileType,
21
+ disposition: 'attachment',
22
+ },
23
+ // {
24
+ // content: data2.toString('base64'),
25
+ // filename: filename2,
26
+ // type: fileType2,
27
+ // disposition: 'attachment',
28
+ // },
29
+ ],
30
+ };
31
+ sgMail
32
+ .send(msg)
33
+ .then(() => console.log('Mail sent successfully'))
34
+ .catch((error) => console.error(error.toString()));
@@ -1,40 +1,40 @@
1
- #! /usr/bin/env node
2
-
3
- const sgMail = require('@sendgrid/mail');
4
- sgMail.setApiKey(process.env.SENDGRID_API_KEY);
5
-
6
- const fs = require('fs'),
7
- filename = 'api_qa_newman.zip',
8
- fileType = 'application/zip',
9
- data = fs.readFileSync(filename);
10
-
11
- // const filename2 = 'sonarsast.html',
12
- // fileType2 = 'application/html',
13
- // data2 = fs.readFileSync( filename2);
14
-
15
- const msg = {
16
- to: 'HEP_Team@hcl.com',
17
- from: 'hepteamhcl@gmail.com',
18
- subject: 'Auto generated Test Reports for API Testing',
19
- text: 'Build Artifact Testing',
20
- html: '<p>Hi Team,<br> Please find below the auto generated test reports for api testing </br> <br> Thanks </br> <br> DevOps Team </br> </p>',
21
- attachments: [
22
- {
23
- content: data.toString('base64'),
24
- filename: filename,
25
- type: fileType,
26
- disposition: 'attachment',
27
- },
28
- // {
29
- // content: data2.toString('base64'),
30
- // filename: filename2,
31
- // type: fileType2,
32
- // disposition: 'attachment',
33
- // },
34
- ],
35
- };
36
-
37
- sgMail
38
- .send(msg)
39
- .then(() => console.log('Mail sent successfully'))
40
- .catch(error => console.error(error.toString()));
1
+ #! /usr/bin/env node
2
+
3
+ const sgMail = require('@sendgrid/mail');
4
+ sgMail.setApiKey(process.env.SENDGRID_API_KEY);
5
+
6
+ const fs = require('fs'),
7
+ filename = 'api_qa_newman.zip',
8
+ fileType = 'application/zip',
9
+ data = fs.readFileSync(filename);
10
+
11
+ // const filename2 = 'sonarsast.html',
12
+ // fileType2 = 'application/html',
13
+ // data2 = fs.readFileSync( filename2);
14
+
15
+ const msg = {
16
+ to: 'HEP_Team@hcl.com',
17
+ from: 'hepteamhcl@gmail.com',
18
+ subject: 'Auto generated Test Reports for API Testing',
19
+ text: 'Build Artifact Testing',
20
+ html: '<p>Hi Team,<br> Please find below the auto generated test reports for api testing </br> <br> Thanks </br> <br> DevOps Team </br> </p>',
21
+ attachments: [
22
+ {
23
+ content: data.toString('base64'),
24
+ filename: filename,
25
+ type: fileType,
26
+ disposition: 'attachment',
27
+ },
28
+ // {
29
+ // content: data2.toString('base64'),
30
+ // filename: filename2,
31
+ // type: fileType2,
32
+ // disposition: 'attachment',
33
+ // },
34
+ ],
35
+ };
36
+
37
+ sgMail
38
+ .send(msg)
39
+ .then(() => console.log('Mail sent successfully'))
40
+ .catch(error => console.error(error.toString()));
@@ -1,40 +1,40 @@
1
- #! /usr/bin/env node
2
-
3
- const sgMail = require('@sendgrid/mail');
4
- sgMail.setApiKey(process.env.SENDGRID_API_KEY);
5
-
6
- const fs = require('fs'),
7
- filename = 'sonarsast.html',
8
- fileType = 'application/html',
9
- data = fs.readFileSync(filename);
10
-
11
- // const filename2 = 'sonarsast.html',
12
- // fileType2 = 'application/html',
13
- // data2 = fs.readFileSync( filename2);
14
-
15
- const msg = {
16
- to: 'HEP_Team@hcl.com',
17
- from: 'hepteamhcl@gmail.com',
18
- subject: 'Auto generated Test Reports for API Testing',
19
- text: 'Build Artifact Testing',
20
- html: '<p>Hi Team,<br> Please find below the auto generated test reports for api testing </br> <br> Thanks </br> <br> DevOps Team </br> </p>',
21
- attachments: [
22
- {
23
- content: data.toString('base64'),
24
- filename: filename,
25
- type: fileType,
26
- disposition: 'attachment',
27
- },
28
- // {
29
- // content: data2.toString('base64'),
30
- // filename: filename2,
31
- // type: fileType2,
32
- // disposition: 'attachment',
33
- // },
34
- ],
35
- };
36
-
37
- sgMail
38
- .send(msg)
39
- .then(() => console.log('Mail sent successfully'))
40
- .catch(error => console.error(error.toString()));
1
+ #! /usr/bin/env node
2
+
3
+ const sgMail = require('@sendgrid/mail');
4
+ sgMail.setApiKey(process.env.SENDGRID_API_KEY);
5
+
6
+ const fs = require('fs'),
7
+ filename = 'sonarsast.html',
8
+ fileType = 'application/html',
9
+ data = fs.readFileSync(filename);
10
+
11
+ // const filename2 = 'sonarsast.html',
12
+ // fileType2 = 'application/html',
13
+ // data2 = fs.readFileSync( filename2);
14
+
15
+ const msg = {
16
+ to: 'HEP_Team@hcl.com',
17
+ from: 'hepteamhcl@gmail.com',
18
+ subject: 'Auto generated Test Reports for API Testing',
19
+ text: 'Build Artifact Testing',
20
+ html: '<p>Hi Team,<br> Please find below the auto generated test reports for api testing </br> <br> Thanks </br> <br> DevOps Team </br> </p>',
21
+ attachments: [
22
+ {
23
+ content: data.toString('base64'),
24
+ filename: filename,
25
+ type: fileType,
26
+ disposition: 'attachment',
27
+ },
28
+ // {
29
+ // content: data2.toString('base64'),
30
+ // filename: filename2,
31
+ // type: fileType2,
32
+ // disposition: 'attachment',
33
+ // },
34
+ ],
35
+ };
36
+
37
+ sgMail
38
+ .send(msg)
39
+ .then(() => console.log('Mail sent successfully'))
40
+ .catch(error => console.error(error.toString()));
@@ -1,40 +1,40 @@
1
- #! /usr/bin/env node
2
-
3
- const sgMail = require('@sendgrid/mail');
4
- sgMail.setApiKey(process.env.SENDGRID_API_KEY);
5
-
6
- const fs = require('fs'),
7
- filename = 'api_qa_trivy.zip',
8
- fileType = 'application/zip',
9
- data = fs.readFileSync(filename);
10
-
11
- // const filename2 = 'sonarsast.html',
12
- // fileType2 = 'application/html',
13
- // data2 = fs.readFileSync( filename2);
14
-
15
- const msg = {
16
- to: 'HEP_Team@hcl.com',
17
- from: 'hepteamhcl@gmail.com',
18
- subject: 'auto generated vulnerability scanner report ',
19
- text: 'Build Artifact Testing',
20
- html: '<p>Hi Team,<br> Please find below the auto generated vulnerability scan report by trivy </br> <br> Thanks </br> <br> DevOps Team </br> </p>',
21
- attachments: [
22
- {
23
- content: data.toString('base64'),
24
- filename: filename,
25
- type: fileType,
26
- disposition: 'attachment',
27
- },
28
- // {
29
- // content: data2.toString('base64'),
30
- // filename: filename2,
31
- // type: fileType2,
32
- // disposition: 'attachment',
33
- // },
34
- ],
35
- };
36
-
37
- sgMail
38
- .send(msg)
39
- .then(() => console.log('Mail sent successfully'))
40
- .catch(error => console.error(error.toString()));
1
+ #! /usr/bin/env node
2
+
3
+ const sgMail = require('@sendgrid/mail');
4
+ sgMail.setApiKey(process.env.SENDGRID_API_KEY);
5
+
6
+ const fs = require('fs'),
7
+ filename = 'api_qa_trivy.zip',
8
+ fileType = 'application/zip',
9
+ data = fs.readFileSync(filename);
10
+
11
+ // const filename2 = 'sonarsast.html',
12
+ // fileType2 = 'application/html',
13
+ // data2 = fs.readFileSync( filename2);
14
+
15
+ const msg = {
16
+ to: 'HEP_Team@hcl.com',
17
+ from: 'hepteamhcl@gmail.com',
18
+ subject: 'auto generated vulnerability scanner report ',
19
+ text: 'Build Artifact Testing',
20
+ html: '<p>Hi Team,<br> Please find below the auto generated vulnerability scan report by trivy </br> <br> Thanks </br> <br> DevOps Team </br> </p>',
21
+ attachments: [
22
+ {
23
+ content: data.toString('base64'),
24
+ filename: filename,
25
+ type: fileType,
26
+ disposition: 'attachment',
27
+ },
28
+ // {
29
+ // content: data2.toString('base64'),
30
+ // filename: filename2,
31
+ // type: fileType2,
32
+ // disposition: 'attachment',
33
+ // },
34
+ ],
35
+ };
36
+
37
+ sgMail
38
+ .send(msg)
39
+ .then(() => console.log('Mail sent successfully'))
40
+ .catch(error => console.error(error.toString()));