@platform-x/hep-push-notification-client 1.0.7 → 1.0.8

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 (38) hide show
  1. package/dist/src/common/service/requestService.d.ts +26 -0
  2. package/dist/src/common/service/requestService.js +96 -0
  3. package/dist/src/common/service/secretKeyManager.services.d.ts +0 -0
  4. package/dist/src/common/service/secretKeyManager.services.js +38 -0
  5. package/dist/src/common/service/twilioService.d.ts +19 -0
  6. package/dist/src/common/service/twilioService.js +63 -0
  7. package/dist/src/common/util/solrConnector.d.ts +35 -0
  8. package/dist/src/common/util/solrConnector.js +157 -0
  9. package/dist/src/platform-x/constants/index.d.ts +21 -15
  10. package/dist/src/platform-x/constants/index.js +21 -15
  11. package/dist/src/platform-x/constants/style.d.ts +1 -0
  12. package/dist/src/platform-x/constants/style.js +103 -0
  13. package/dist/src/platform-x/dataSource/emailDataSource.d.ts +5 -0
  14. package/dist/src/platform-x/dataSource/emailDataSource.js +36 -0
  15. package/dist/src/platform-x/database/connection.d.ts +10 -10
  16. package/dist/src/platform-x/database/connection.js +78 -78
  17. package/dist/src/platform-x/database/dao/formBuilder.dao.d.ts +9 -0
  18. package/dist/src/platform-x/database/dao/formBuilder.dao.js +51 -0
  19. package/dist/src/platform-x/database/dao/site_domain.dao.d.ts +8 -8
  20. package/dist/src/platform-x/database/dao/site_domain.dao.js +44 -44
  21. package/dist/src/platform-x/database/index.d.ts +10 -10
  22. package/dist/src/platform-x/database/index.js +9 -9
  23. package/dist/src/platform-x/database/interfaces/site_domain.interface.d.ts +33 -33
  24. package/dist/src/platform-x/database/interfaces/site_domain.interface.js +2 -2
  25. package/dist/src/platform-x/database/models/formBuilder.model.d.ts +34 -0
  26. package/dist/src/platform-x/database/models/formBuilder.model.js +35 -0
  27. package/dist/src/platform-x/database/models/site_domain.model.d.ts +2 -2
  28. package/dist/src/platform-x/database/models/site_domain.model.js +47 -47
  29. package/dist/src/platform-x/services/fcmservices.js +6 -6
  30. package/dist/src/platform-x/util/emailHandler.d.ts +62 -0
  31. package/dist/src/platform-x/util/emailHandler.js +524 -0
  32. package/dist/src/platform-x/util/emailTemplate.d.ts +4 -0
  33. package/dist/src/platform-x/util/emailTemplate.js +82 -0
  34. package/dist/src/platform-x/util/solr-data-source/SolrHttpDataSource.d.ts +26 -0
  35. package/dist/src/platform-x/util/solr-data-source/SolrHttpDataSource.js +75 -0
  36. package/dist/templates/orderPlaced.ejs +173 -0
  37. package/dist/templates/orderPlaced.html +190 -0
  38. package/package.json +1 -1
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.SolrHttpDataSource = void 0;
16
+ const solrConnector_1 = require("../../../common/util/solrConnector");
17
+ const quick_lru_1 = __importDefault(require("@alloc/quick-lru"));
18
+ class SolrHttpDataSource {
19
+ // private loader: DataLoader<unknown, unknown, unknown>;
20
+ constructor() {
21
+ this.solr = new solrConnector_1.SolrClient();
22
+ this.memoizedResults = new quick_lru_1.default({
23
+ // The maximum number of items before evicting the least recently used items.
24
+ maxSize: 50,
25
+ // The maximum number of milliseconds an item should remain in cache.
26
+ // By default maxAge will be Infinity, which means that items will never expire.
27
+ maxAge: 10000,
28
+ });
29
+ // this.loader = new DataLoader(ids => dbClient.getByIds(ids))
30
+ }
31
+ // initialize({ context, cache }:any = {}) {
32
+ // this.context = context;
33
+ // this.cache = cache || new InMemoryLRUCache();
34
+ // }
35
+ // didEncounterError(error:any) {
36
+ // throw error;
37
+ // }
38
+ cacheKey(id) {
39
+ return `solr-${id}`;
40
+ }
41
+ memoizedCacheKey() {
42
+ var _a;
43
+ // return (
44
+ // JSON.parse(JSON.stringify(this.solr.getQuery())) as any
45
+ // )?.parameters?.join('&');
46
+ const data = JSON.parse(JSON.stringify(this.solr.getQuery()));
47
+ return (_a = data === null || data === void 0 ? void 0 : data.parameters) === null || _a === void 0 ? void 0 : _a.join('&');
48
+ }
49
+ createQuery(queryRequest) {
50
+ let { query, pagination, filter, sort, filterQuery } = queryRequest;
51
+ let solrQuery = this.solr.createQuery();
52
+ solrQuery.query(query); // q
53
+ solrQuery.paginate(pagination === null || pagination === void 0 ? void 0 : pagination.start, pagination === null || pagination === void 0 ? void 0 : pagination.rows); // start, rows
54
+ solrQuery.filterList(filter); // fl
55
+ solrQuery.sort(sort); // sort
56
+ solrQuery.filterQuery(filterQuery); // fq
57
+ }
58
+ executeSearch() {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ let response;
61
+ let cacheKey = this.memoizedCacheKey();
62
+ if (this.memoizedResults.has(cacheKey)) {
63
+ response = yield this.memoizedResults.get(cacheKey); // NOSONAR
64
+ return response;
65
+ }
66
+ else {
67
+ response = yield this.solr.executeSearch();
68
+ this.memoizedResults.set(cacheKey, response);
69
+ return response;
70
+ }
71
+ });
72
+ }
73
+ }
74
+ exports.SolrHttpDataSource = SolrHttpDataSource;
75
+ //# sourceMappingURL=SolrHttpDataSource.js.map
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-x/hep-push-notification-client",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "@platform-x/hep-push-notification-client",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",