@platform-x/hep-notification-client 1.0.0
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/src/common/service/requestService.js +96 -0
- package/dist/src/common/service/twilioService.js +55 -0
- package/dist/src/common/util/commonUtil.js +44 -0
- package/dist/src/common/util/errorHandler.js +89 -0
- package/dist/src/common/util/logger.js +193 -0
- package/dist/src/common/util/requestTracer.js +17 -0
- package/dist/src/common/util/solrConnector.js +157 -0
- package/dist/src/config/index.js +52 -0
- package/dist/src/index.js +8 -0
- package/dist/src/platform-x/constants/index.js +15 -0
- package/dist/src/platform-x/constants/style.js +103 -0
- package/dist/src/platform-x/dataSource/emailDataSource.js +36 -0
- package/dist/src/platform-x/database/connection.js +51 -0
- package/dist/src/platform-x/database/dao/formBuilder.dao.js +51 -0
- package/dist/src/platform-x/database/index.js +9 -0
- package/dist/src/platform-x/database/models/formBuilder.model.js +35 -0
- package/dist/src/platform-x/util/emailHandler.js +458 -0
- package/dist/src/platform-x/util/emailTemplate.js +82 -0
- package/dist/src/platform-x/util/solr-data-source/SolrHttpDataSource.js +75 -0
- package/package.json +61 -0
- package/templates/orderPlaced.ejs +173 -0
- package/templates/orderPlaced.html +190 -0
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@platform-x/hep-notification-client",
|
|
3
|
+
"version": "1.0.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",
|
|
9
|
+
"prepare": "npm run build"
|
|
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/axios": "^0.14.0",
|
|
26
|
+
"@types/bunyan": "^1.8.6",
|
|
27
|
+
"@types/bunyan-format": "^0.2.3",
|
|
28
|
+
"@types/cls-hooked": "^4.3.3",
|
|
29
|
+
"@types/dompurify": "^3.0.5",
|
|
30
|
+
"@types/express": "^4.17.12",
|
|
31
|
+
"@types/lodash": "^4.14.171",
|
|
32
|
+
"@types/node": "^15.12.2",
|
|
33
|
+
"@types/twilio": "^3.19.2",
|
|
34
|
+
"apollo-server-caching": "^3.3.0",
|
|
35
|
+
"axios": "^0.21.1",
|
|
36
|
+
"bunyan": "^1.8.15",
|
|
37
|
+
"bunyan-format": "^0.2.1",
|
|
38
|
+
"cls-hooked": "^4.2.2",
|
|
39
|
+
"dataloader": "^2.0.0",
|
|
40
|
+
"dompurify": "^3.2.4",
|
|
41
|
+
"dotenv": "^10.0.0",
|
|
42
|
+
"ejs": "^3.1.10",
|
|
43
|
+
"express": "^4.17.1",
|
|
44
|
+
"jsdom": "^26.1.0",
|
|
45
|
+
"lodash": "^4.17.21",
|
|
46
|
+
"moment": "^2.30.1",
|
|
47
|
+
"moment-timezone": "^0.5.34",
|
|
48
|
+
"mongodb": "^3.6.0",
|
|
49
|
+
"mongoose": "^8.13.2",
|
|
50
|
+
"mysql2": "^2.3.3",
|
|
51
|
+
"node-html-parser": "^7.0.1",
|
|
52
|
+
"request-ip": "^3.3.0",
|
|
53
|
+
"solr-client": "0.10.0-rc6",
|
|
54
|
+
"twilio": "^5.3.6",
|
|
55
|
+
"uuid": "^8.3.2"
|
|
56
|
+
},
|
|
57
|
+
"private": false,
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"access": "public"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
2
|
+
<tbody>
|
|
3
|
+
<tr>
|
|
4
|
+
<td width="100%">
|
|
5
|
+
<div style="max-width:600px;Margin:0 auto">
|
|
6
|
+
<table align="center" cellpadding="0" cellspacing="0"
|
|
7
|
+
style="border-spacing:0;font-family:gt-eesti,ArialMT,Helvetica,Arial,sans-serif;Margin:0 auto;padding:24px;width:100%;max-width:500px">
|
|
8
|
+
<tbody>
|
|
9
|
+
<tr>
|
|
10
|
+
<td>
|
|
11
|
+
<table style="margin-bottom:40px;width:100%" width="100%">
|
|
12
|
+
<tbody>
|
|
13
|
+
</tbody>
|
|
14
|
+
</table>
|
|
15
|
+
</td>
|
|
16
|
+
</tr>
|
|
17
|
+
<tr>
|
|
18
|
+
<td style="text-align:justify;word-break:break-word">
|
|
19
|
+
<table style="margin-bottom:20px;width:100%" width="100%">
|
|
20
|
+
<tbody>
|
|
21
|
+
<tr>
|
|
22
|
+
<td>
|
|
23
|
+
<table style="width:100%;margin-bottom:20px" width="100%" cellpadding="0" cellspacing="0">
|
|
24
|
+
<tbody>
|
|
25
|
+
<tr>
|
|
26
|
+
<td>
|
|
27
|
+
<strong style="font-family:Helvetica,Arial,sans-serif;color:#234567">Hi <%= userName
|
|
28
|
+
%>, </strong>
|
|
29
|
+
|
|
30
|
+
<p style="font-size:26px;line-height:30px;color:#054752;word-break:normal">
|
|
31
|
+
Your Order <%= orderNumber %> has been placed sucessfully
|
|
32
|
+
</p>
|
|
33
|
+
</td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<td>
|
|
37
|
+
<p style="font-size:26px;line-height:30px;color:#054752;word-break:normal">
|
|
38
|
+
Address Details <%= completeAddressStr %>
|
|
39
|
+
</p>
|
|
40
|
+
</td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<td>
|
|
44
|
+
<p style="font-size:26px;line-height:30px;color:#054752;word-break:normal">
|
|
45
|
+
Tax Calculated on your order is <%= total_tax %>
|
|
46
|
+
</p>
|
|
47
|
+
</td>
|
|
48
|
+
</tr>
|
|
49
|
+
</tbody>
|
|
50
|
+
</table>
|
|
51
|
+
</td>
|
|
52
|
+
</tr>
|
|
53
|
+
</tbody>
|
|
54
|
+
</table>
|
|
55
|
+
</td>
|
|
56
|
+
</tr>
|
|
57
|
+
<tr>
|
|
58
|
+
<td>
|
|
59
|
+
<table style="margin-bottom:20px;width:100%" width="100%">
|
|
60
|
+
<tbody>
|
|
61
|
+
<tr>
|
|
62
|
+
<td>
|
|
63
|
+
<table style="width:100%;margin-bottom:20px" width="100%" cellpadding="0" cellspacing="0">
|
|
64
|
+
<tbody>
|
|
65
|
+
<tr> Package Details</tr>
|
|
66
|
+
<tr>
|
|
67
|
+
<td>
|
|
68
|
+
Item Name
|
|
69
|
+
</td>
|
|
70
|
+
<td>
|
|
71
|
+
Price
|
|
72
|
+
</td>
|
|
73
|
+
<td>
|
|
74
|
+
Quantity
|
|
75
|
+
</td>
|
|
76
|
+
<!-- <td>
|
|
77
|
+
Colour
|
|
78
|
+
</td>
|
|
79
|
+
<td>
|
|
80
|
+
Size
|
|
81
|
+
</td> -->
|
|
82
|
+
<td>
|
|
83
|
+
Brand
|
|
84
|
+
</td>
|
|
85
|
+
</tr>
|
|
86
|
+
<!-- <% for (var key in data) { %>
|
|
87
|
+
<h3>
|
|
88
|
+
<%= data[key].ecomx_en_name %>
|
|
89
|
+
</h3>
|
|
90
|
+
<h3>
|
|
91
|
+
<%= data[key].ecomx_quantity %>
|
|
92
|
+
</h3>
|
|
93
|
+
<h3>
|
|
94
|
+
<%= data[key].ecomx_attributes_size %>
|
|
95
|
+
</h3>
|
|
96
|
+
<% } %> -->
|
|
97
|
+
<% for (var key in data) { %>
|
|
98
|
+
<tr>
|
|
99
|
+
<td>
|
|
100
|
+
<%= data[key].ecomx_en_name %>
|
|
101
|
+
</td>
|
|
102
|
+
<td>
|
|
103
|
+
<%= data[key].total_price %>
|
|
104
|
+
<%= data[key].ecomx_currency_code %>
|
|
105
|
+
</td>
|
|
106
|
+
<td>
|
|
107
|
+
<%= data[key].ecomx_quantity %>
|
|
108
|
+
</td>
|
|
109
|
+
<!-- <td>
|
|
110
|
+
<%= data[key].ecomx_attributes_colour %>
|
|
111
|
+
</td>
|
|
112
|
+
<td>
|
|
113
|
+
<%= data[key].ecomx_attributes_size %>
|
|
114
|
+
</td> -->
|
|
115
|
+
<td>
|
|
116
|
+
<%= data[key].ecomx_attributes_brand %>
|
|
117
|
+
</td>
|
|
118
|
+
</tr>
|
|
119
|
+
<% } %>
|
|
120
|
+
</tbody>
|
|
121
|
+
</table>
|
|
122
|
+
</td>
|
|
123
|
+
</tr>
|
|
124
|
+
</tbody>
|
|
125
|
+
</table>
|
|
126
|
+
</td>
|
|
127
|
+
</tr>
|
|
128
|
+
<tr>
|
|
129
|
+
<td style="text-align:center">
|
|
130
|
+
<p style="font-size:26px;line-height:30px;color:#054752;word-break:normal">
|
|
131
|
+
Order total <%= total_price %>
|
|
132
|
+
</p>
|
|
133
|
+
</td>
|
|
134
|
+
</tr>
|
|
135
|
+
<tr>
|
|
136
|
+
<td>
|
|
137
|
+
<table width="100%" style="margin-bottom:20px;width:100%">
|
|
138
|
+
<tbody>
|
|
139
|
+
<tr>
|
|
140
|
+
<td width="100%">
|
|
141
|
+
<div style="width:100%;height:1px;background-color:#ddd" color="#DDD" width="100%"></div>
|
|
142
|
+
</td>
|
|
143
|
+
</tr>
|
|
144
|
+
</tbody>
|
|
145
|
+
</table>
|
|
146
|
+
</td>
|
|
147
|
+
</tr>
|
|
148
|
+
<tr>
|
|
149
|
+
<td style="text-align:center">
|
|
150
|
+
<table style="max-width:100%;width:100%;text-align:center;font-family:ArialMT,Arial,sans-serif"
|
|
151
|
+
cellspacing="0" cellpadding="0">
|
|
152
|
+
<tbody>
|
|
153
|
+
<tr>
|
|
154
|
+
<td style="text-align:center">
|
|
155
|
+
<p
|
|
156
|
+
style="font-size:10px;color:#708c91;text-align:center;padding:0;margin-top:10px;margin-bottom:2px">
|
|
157
|
+
This email was sent to you by
|
|
158
|
+
Platofrm X (Do not reply)
|
|
159
|
+
</p>
|
|
160
|
+
</td>
|
|
161
|
+
</tr>
|
|
162
|
+
</tbody>
|
|
163
|
+
</table>
|
|
164
|
+
</td>
|
|
165
|
+
</tr>
|
|
166
|
+
|
|
167
|
+
</tbody>
|
|
168
|
+
</table>
|
|
169
|
+
</div>
|
|
170
|
+
</td>
|
|
171
|
+
</tr>
|
|
172
|
+
</tbody>
|
|
173
|
+
</table>
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
2
|
+
<tbody>
|
|
3
|
+
<tr>
|
|
4
|
+
<td width="100%">
|
|
5
|
+
<div style="max-width:600px;Margin:0 auto">
|
|
6
|
+
<table align="center" cellpadding="0" cellspacing="0"
|
|
7
|
+
style="border-spacing:0;font-family:gt-eesti,ArialMT,Helvetica,Arial,sans-serif;Margin:0 auto;padding:24px;width:100%;max-width:500px">
|
|
8
|
+
<tbody>
|
|
9
|
+
<tr>
|
|
10
|
+
<td>
|
|
11
|
+
<table style="margin-bottom:40px;width:100%" width="100%">
|
|
12
|
+
<tbody>
|
|
13
|
+
<tr>
|
|
14
|
+
<td>
|
|
15
|
+
<a href="http://8link.in/?ref=mail"
|
|
16
|
+
style="font-family:Helvetica,Arial,sans-serif;color:#0086bf" target="_blank">
|
|
17
|
+
<img src="http://8link.in/assets/mail/logo.png" style="display:block" alt="8link"
|
|
18
|
+
width="200" height="65" />
|
|
19
|
+
</a>
|
|
20
|
+
</td>
|
|
21
|
+
</tr>
|
|
22
|
+
</tbody>
|
|
23
|
+
</table>
|
|
24
|
+
</td>
|
|
25
|
+
</tr>
|
|
26
|
+
<tr>
|
|
27
|
+
<td style="text-align:justify;word-break:break-word">
|
|
28
|
+
<table style="margin-bottom:20px;width:100%" width="100%">
|
|
29
|
+
<tbody>
|
|
30
|
+
<tr>
|
|
31
|
+
<td>
|
|
32
|
+
<table style="width:100%;margin-bottom:20px" width="100%" cellpadding="0" cellspacing="0">
|
|
33
|
+
<tbody>
|
|
34
|
+
<tr>
|
|
35
|
+
<td>
|
|
36
|
+
<strong style="font-family:Helvetica,Arial,sans-serif;color:#234567">Hi <%= userName
|
|
37
|
+
%>, </strong>
|
|
38
|
+
|
|
39
|
+
<p style="font-size:26px;line-height:30px;color:#054752;word-break:normal">
|
|
40
|
+
Your Order <%= orderNumber %> has been placed sucessfully
|
|
41
|
+
</p>
|
|
42
|
+
</td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr>
|
|
45
|
+
<td>
|
|
46
|
+
<p style="font-size:26px;line-height:30px;color:#054752;word-break:normal">
|
|
47
|
+
Address Details <%= completeAddressStr %>
|
|
48
|
+
</p>
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td>
|
|
53
|
+
<p style="font-size:26px;line-height:30px;color:#054752;word-break:normal">
|
|
54
|
+
Tax Calculated on your order is <%= total_tax %>
|
|
55
|
+
</p>
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
</tbody>
|
|
59
|
+
</table>
|
|
60
|
+
</td>
|
|
61
|
+
</tr>
|
|
62
|
+
</tbody>
|
|
63
|
+
</table>
|
|
64
|
+
</td>
|
|
65
|
+
</tr>
|
|
66
|
+
<tr>
|
|
67
|
+
<td>
|
|
68
|
+
<table style="margin-bottom:20px;width:100%" width="100%">
|
|
69
|
+
<tbody>
|
|
70
|
+
<tr>
|
|
71
|
+
<td>
|
|
72
|
+
<table style="width:100%;margin-bottom:20px" width="100%" cellpadding="0" cellspacing="0">
|
|
73
|
+
<tbody>
|
|
74
|
+
<tr> Package Details</tr>
|
|
75
|
+
<tr>
|
|
76
|
+
<td>
|
|
77
|
+
Item Name
|
|
78
|
+
</td>
|
|
79
|
+
<td>
|
|
80
|
+
Price
|
|
81
|
+
</td>
|
|
82
|
+
<td>
|
|
83
|
+
Quantity
|
|
84
|
+
</td>
|
|
85
|
+
<!-- <td>
|
|
86
|
+
Colour
|
|
87
|
+
</td>
|
|
88
|
+
<td>
|
|
89
|
+
Size
|
|
90
|
+
</td> -->
|
|
91
|
+
<td>
|
|
92
|
+
Brand
|
|
93
|
+
</td>
|
|
94
|
+
</tr>
|
|
95
|
+
<!-- <% for (var key in data) { %>
|
|
96
|
+
<h3>
|
|
97
|
+
<%= data[key].ecomx_en_name %>
|
|
98
|
+
</h3>
|
|
99
|
+
<h3>
|
|
100
|
+
<%= data[key].ecomx_quantity %>
|
|
101
|
+
</h3>
|
|
102
|
+
<h3>
|
|
103
|
+
<%= data[key].ecomx_attributes_size %>
|
|
104
|
+
</h3>
|
|
105
|
+
<% } %> -->
|
|
106
|
+
<% for (var key in data) { %>
|
|
107
|
+
<tr>
|
|
108
|
+
<td>
|
|
109
|
+
<%= data[key].ecomx_en_name %>
|
|
110
|
+
</td>
|
|
111
|
+
<td>
|
|
112
|
+
<%= data[key].total_price %>
|
|
113
|
+
<%= data[key].ecomx_currency_code %>
|
|
114
|
+
</td>
|
|
115
|
+
<td>
|
|
116
|
+
<%= data[key].ecomx_quantity %>
|
|
117
|
+
</td>
|
|
118
|
+
<!-- <td>
|
|
119
|
+
<%= data[key].ecomx_attributes_colour %>
|
|
120
|
+
</td>
|
|
121
|
+
<td>
|
|
122
|
+
<%= data[key].ecomx_attributes_size %>
|
|
123
|
+
</td> -->
|
|
124
|
+
<td>
|
|
125
|
+
<%= data[key].ecomx_attributes_brand %>
|
|
126
|
+
</td>
|
|
127
|
+
</tr>
|
|
128
|
+
<% } %>
|
|
129
|
+
</tbody>
|
|
130
|
+
</table>
|
|
131
|
+
</td>
|
|
132
|
+
</tr>
|
|
133
|
+
</tbody>
|
|
134
|
+
</table>
|
|
135
|
+
</td>
|
|
136
|
+
</tr>
|
|
137
|
+
<tr>
|
|
138
|
+
<td style="text-align:center">
|
|
139
|
+
<p style="font-size:26px;line-height:30px;color:#054752;word-break:normal">
|
|
140
|
+
Order total <%= total_price %>
|
|
141
|
+
</p>
|
|
142
|
+
</td>
|
|
143
|
+
</tr>
|
|
144
|
+
<tr>
|
|
145
|
+
<td>
|
|
146
|
+
<table width="100%" style="margin-bottom:20px;width:100%">
|
|
147
|
+
<tbody>
|
|
148
|
+
<tr>
|
|
149
|
+
<td width="100%">
|
|
150
|
+
<div style="width:100%;height:1px;background-color:#ddd" color="#DDD" width="100%"></div>
|
|
151
|
+
</td>
|
|
152
|
+
</tr>
|
|
153
|
+
</tbody>
|
|
154
|
+
</table>
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
|
|
158
|
+
<tr>
|
|
159
|
+
<td style="text-align:center">
|
|
160
|
+
<img src="http://8link.in/assets/mail/icon.png" alt="8link_icon"
|
|
161
|
+
style="display:block;width:29px;height:auto;margin-left:auto;margin-right:auto;margin-bottom:10px"
|
|
162
|
+
height="auto" />
|
|
163
|
+
</td>
|
|
164
|
+
</tr>
|
|
165
|
+
<tr>
|
|
166
|
+
<td style="text-align:center">
|
|
167
|
+
<table style="max-width:100%;width:100%;text-align:center;font-family:ArialMT,Arial,sans-serif"
|
|
168
|
+
cellspacing="0" cellpadding="0">
|
|
169
|
+
<tbody>
|
|
170
|
+
<tr>
|
|
171
|
+
<td style="text-align:center">
|
|
172
|
+
<p
|
|
173
|
+
style="font-size:10px;color:#708c91;text-align:center;padding:0;margin-top:10px;margin-bottom:2px">
|
|
174
|
+
This email was sent to you by
|
|
175
|
+
Platofrm X (Do not reply)
|
|
176
|
+
</p>
|
|
177
|
+
</td>
|
|
178
|
+
</tr>
|
|
179
|
+
</tbody>
|
|
180
|
+
</table>
|
|
181
|
+
</td>
|
|
182
|
+
</tr>
|
|
183
|
+
|
|
184
|
+
</tbody>
|
|
185
|
+
</table>
|
|
186
|
+
</div>
|
|
187
|
+
</td>
|
|
188
|
+
</tr>
|
|
189
|
+
</tbody>
|
|
190
|
+
</table>
|