@platform-x/hep-notification-client 1.1.8 → 1.1.10
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.
|
@@ -7,7 +7,7 @@ export declare class TwilioService {
|
|
|
7
7
|
* @param authToken - Twilio Auth Token
|
|
8
8
|
* @param senderNumber - Twilio Sender Phone Number
|
|
9
9
|
*/
|
|
10
|
-
constructor(
|
|
10
|
+
constructor();
|
|
11
11
|
/**
|
|
12
12
|
* Send an SMS using Twilio
|
|
13
13
|
* @param to - Recipient's phone number
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.TwilioService = void 0;
|
|
16
16
|
const twilio_1 = __importDefault(require("twilio"));
|
|
17
17
|
const logger_1 = require("../util/logger");
|
|
18
|
+
const config_1 = __importDefault(require("../../config"));
|
|
18
19
|
class TwilioService {
|
|
19
20
|
/**
|
|
20
21
|
* Constructor to initialize Twilio client and sender number
|
|
@@ -22,9 +23,9 @@ class TwilioService {
|
|
|
22
23
|
* @param authToken - Twilio Auth Token
|
|
23
24
|
* @param senderNumber - Twilio Sender Phone Number
|
|
24
25
|
*/
|
|
25
|
-
constructor(
|
|
26
|
-
this.client = (0, twilio_1.default)(
|
|
27
|
-
this.senderNumber =
|
|
26
|
+
constructor() {
|
|
27
|
+
this.client = (0, twilio_1.default)(config_1.default === null || config_1.default === void 0 ? void 0 : config_1.default.TWILIO.ACCOUNT_SID, config_1.default === null || config_1.default === void 0 ? void 0 : config_1.default.TWILIO.AUTH_TOKEN);
|
|
28
|
+
this.senderNumber = config_1.default === null || config_1.default === void 0 ? void 0 : config_1.default.TWILIO.SENDER_NUMBER;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
31
|
* Send an SMS using Twilio
|
package/dist/src/index.js
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.TwilioService = exports.EmailHandler = void 0;
|
|
7
4
|
const emailHandler_1 = require("./platform-x/util/emailHandler");
|
|
8
5
|
Object.defineProperty(exports, "EmailHandler", { enumerable: true, get: function () { return emailHandler_1.EmailHandler; } });
|
|
9
6
|
const twilioService_1 = require("./common/service/twilioService");
|
|
10
7
|
Object.defineProperty(exports, "TwilioService", { enumerable: true, get: function () { return twilioService_1.TwilioService; } });
|
|
11
|
-
// test/testRunner.ts
|
|
12
|
-
const path_1 = __importDefault(require("path"));
|
|
13
|
-
const fs_1 = __importDefault(require("fs"));
|
|
14
|
-
const templatePath = path_1.default.resolve(__dirname, '../../templates/orderPlaced.ejs');
|
|
15
|
-
console.log('Resolved template path:', templatePath);
|
|
16
|
-
const exists = fs_1.default.existsSync(templatePath);
|
|
17
|
-
console.log('File exists?', exists);
|
|
18
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -63,7 +63,6 @@ const dompurify_1 = __importDefault(require("dompurify"));
|
|
|
63
63
|
const jsdom_1 = require("jsdom");
|
|
64
64
|
const logger_1 = require("../../common/util/logger");
|
|
65
65
|
const path_1 = __importDefault(require("path"));
|
|
66
|
-
const fs_1 = __importDefault(require("fs"));
|
|
67
66
|
const window = new jsdom_1.JSDOM('').window;
|
|
68
67
|
const DOMPurify = (0, dompurify_1.default)(window);
|
|
69
68
|
// NOSONAR-NEXT-LINE
|
|
@@ -379,8 +378,8 @@ class EmailHandler {
|
|
|
379
378
|
const start = moment.tz(reqBody.dateTime, 'UTC'); // original timezone
|
|
380
379
|
let curentTimeZone = start;
|
|
381
380
|
curentTimeZone.tz(reqBody.timezoneOffset).format('Do MMMM YYYY, h:mm a');
|
|
382
|
-
const
|
|
383
|
-
|
|
381
|
+
const emailTemplate = path_1.default.resolve(__dirname, '../../../templates/orderPlaced.ejs');
|
|
382
|
+
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>.', emailTemplate);
|
|
384
383
|
let billingStr = '';
|
|
385
384
|
billingStr +=
|
|
386
385
|
Object.keys(reqBody.billing_address).length !== 0
|