@clxmedia/emailhub-client 1.1.4 → 1.1.5
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/client.d.ts +3 -2
- package/dist/client.js +6 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -66,6 +66,8 @@ export interface EmailHubSenderProfile {
|
|
|
66
66
|
}
|
|
67
67
|
export declare class MockEmailHubClient {
|
|
68
68
|
readonly environment: EmailHubEnvironment;
|
|
69
|
+
private extendedLogging;
|
|
70
|
+
constructor(extendedLogging?: boolean);
|
|
69
71
|
createSenderProfile(_domain: string): Promise<{
|
|
70
72
|
guid: string;
|
|
71
73
|
id: number;
|
|
@@ -103,7 +105,6 @@ export declare class MockEmailHubClient {
|
|
|
103
105
|
deleteSenderProfile(): Promise<void>;
|
|
104
106
|
sendEmail(msg: EmailHubMessage, options?: {
|
|
105
107
|
priority?: EmailHubPriorityLevel;
|
|
106
|
-
writeToLog?: boolean;
|
|
107
108
|
}): Promise<string>;
|
|
108
109
|
}
|
|
109
110
|
export declare class EmailHubClient {
|
|
@@ -112,7 +113,7 @@ export declare class EmailHubClient {
|
|
|
112
113
|
private server;
|
|
113
114
|
private pubsubClient;
|
|
114
115
|
constructor(cfg: EmailHubConfig);
|
|
115
|
-
static new(cfg: EmailHubConfig): EmailHubClient | MockEmailHubClient;
|
|
116
|
+
static new(cfg: EmailHubConfig, extendedLogging?: boolean): EmailHubClient | MockEmailHubClient;
|
|
116
117
|
private loadPubSubClient;
|
|
117
118
|
static validateEmailAddress(email?: string, regex?: RegExp): boolean;
|
|
118
119
|
createSenderProfile(domain: string): Promise<EmailHubSenderProfile>;
|
package/dist/client.js
CHANGED
|
@@ -45,8 +45,9 @@ const mockEmailHubSenderProfile = {
|
|
|
45
45
|
verified_at: undefined
|
|
46
46
|
};
|
|
47
47
|
class MockEmailHubClient {
|
|
48
|
-
constructor() {
|
|
48
|
+
constructor(extendedLogging = false) {
|
|
49
49
|
this.environment = EmailHubEnvironment.localhost;
|
|
50
|
+
this.extendedLogging = extendedLogging;
|
|
50
51
|
}
|
|
51
52
|
createSenderProfile(_domain) {
|
|
52
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -65,8 +66,8 @@ class MockEmailHubClient {
|
|
|
65
66
|
}
|
|
66
67
|
sendEmail(msg, options) {
|
|
67
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
if (
|
|
69
|
-
console.log(
|
|
69
|
+
if (this.extendedLogging) {
|
|
70
|
+
console.log(`----------------Begin mock email send: Priority: [${(options === null || options === void 0 ? void 0 : options.priority) || 'default'}]-----------------`);
|
|
70
71
|
console.log(JSON.stringify(msg));
|
|
71
72
|
console.log('----------------End mock email send-----------------');
|
|
72
73
|
}
|
|
@@ -81,8 +82,8 @@ class EmailHubClient {
|
|
|
81
82
|
this.sender = cfg.sender;
|
|
82
83
|
this.server = cfg.server ? cfg.server : DEFAULT_EMAIL_HUB_URL;
|
|
83
84
|
}
|
|
84
|
-
static new(cfg) {
|
|
85
|
-
return (cfg.sender.guid && cfg.sender.secret) ? new EmailHubClient(cfg) : new MockEmailHubClient();
|
|
85
|
+
static new(cfg, extendedLogging = false) {
|
|
86
|
+
return (cfg.sender.guid && cfg.sender.secret) ? new EmailHubClient(cfg) : new MockEmailHubClient(extendedLogging);
|
|
86
87
|
}
|
|
87
88
|
loadPubSubClient() {
|
|
88
89
|
return __awaiter(this, void 0, void 0, function* () {
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { EmailHubClient, EmailHubMessage, EmailHubAttachment, EmailHubConfig, EmailHubInlineAttachment, EmailHubRecipient, EmailHubPriorityLevel, EmailHubSender } from './client';
|
|
1
|
+
export { EmailHubClient, EmailHubMessage, EmailHubAttachment, EmailHubConfig, EmailHubInlineAttachment, EmailHubRecipient, EmailHubPriorityLevel, EmailHubSender, MockEmailHubClient, EmailHubEnvironment, EmailHubSenderProfile } from './client';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmailHubPriorityLevel = exports.EmailHubClient = void 0;
|
|
3
|
+
exports.EmailHubEnvironment = exports.MockEmailHubClient = exports.EmailHubPriorityLevel = exports.EmailHubClient = void 0;
|
|
4
4
|
var client_1 = require("./client");
|
|
5
5
|
Object.defineProperty(exports, "EmailHubClient", { enumerable: true, get: function () { return client_1.EmailHubClient; } });
|
|
6
6
|
Object.defineProperty(exports, "EmailHubPriorityLevel", { enumerable: true, get: function () { return client_1.EmailHubPriorityLevel; } });
|
|
7
|
+
Object.defineProperty(exports, "MockEmailHubClient", { enumerable: true, get: function () { return client_1.MockEmailHubClient; } });
|
|
8
|
+
Object.defineProperty(exports, "EmailHubEnvironment", { enumerable: true, get: function () { return client_1.EmailHubEnvironment; } });
|