@proteinjs/email-server 1.2.0 → 1.2.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.2.1](https://github.com/proteinjs/notifications/compare/@proteinjs/email-server@1.2.0...@proteinjs/email-server@1.2.1) (2024-08-16)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * refactored to implement new @proteinjs/logger/Logger api ([fd48238](https://github.com/proteinjs/notifications/commit/fd48238a2b2899f6509bda13a8407f6afac49663))
12
+
13
+
14
+
15
+
16
+
6
17
  # [1.2.0](https://github.com/proteinjs/notifications/compare/@proteinjs/email-server@1.1.1...@proteinjs/email-server@1.2.0) (2024-08-08)
7
18
 
8
19
 
@@ -1,6 +1,6 @@
1
1
  /** Load Dependency Source Graphs */
2
+ import '@proteinjs/logger';
2
3
  import '@proteinjs/reflection';
3
- import '@proteinjs/util';
4
4
  import 'nodemailer';
5
5
  export * from '../index';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,CAAC;AACzB,OAAO,YAAY,CAAC;AAqBpB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,YAAY,CAAC;AAqBpB,cAAc,UAAU,CAAC"}
@@ -15,11 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
+ require("@proteinjs/logger");
18
19
  require("@proteinjs/reflection");
19
- require("@proteinjs/util");
20
20
  require("nodemailer");
21
21
  /** Generate Source Graph */
22
- var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultEmailConfigFactory\",\"filePath\":\"/home/runner/work/notifications/notifications/packages/email/server/src/EmailSender.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getEmailConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"EmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/EmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultInviteEmailConfigFactory\",\"filePath\":\"/home/runner/work/notifications/notifications/packages/email/server/src/configs/InviteEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"InviteEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/InviteEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultPasswordResetEmailConfigFactory\",\"filePath\":\"/home/runner/work/notifications/notifications/packages/email/server/src/configs/PasswordResetEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"PasswordResetEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/PasswordResetEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultPasswordUpdatedEmailConfigFactory\",\"filePath\":\"/home/runner/work/notifications/notifications/packages/email/server/src/configs/PasswordUpdatedEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"PasswordUpdatedEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/PasswordUpdatedEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultSignupConfirmationEmailConfigFactory\",\"filePath\":\"/home/runner/work/notifications/notifications/packages/email/server/src/configs/SignupConfirmationEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"SignupConfirmationEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/SignupConfirmationEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}}],\"edges\":[{\"v\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"}]}";
22
+ var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultEmailConfigFactory\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/notifications/packages/email/server/src/EmailSender.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getEmailConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"EmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/EmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultInviteEmailConfigFactory\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/notifications/packages/email/server/src/configs/InviteEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"InviteEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/InviteEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultPasswordResetEmailConfigFactory\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/notifications/packages/email/server/src/configs/PasswordResetEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"PasswordResetEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/PasswordResetEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultPasswordUpdatedEmailConfigFactory\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/notifications/packages/email/server/src/configs/PasswordUpdatedEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"PasswordUpdatedEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/PasswordUpdatedEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultSignupConfirmationEmailConfigFactory\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/notifications/packages/email/server/src/configs/SignupConfirmationEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"SignupConfirmationEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/SignupConfirmationEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}}],\"edges\":[{\"v\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"}]}";
23
23
  /** Generate Source Links */
24
24
  var sourceLinks = {};
25
25
  /** Load Source Graph and Links */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,iCAA+B;AAC/B,2BAAyB;AACzB,sBAAoB;AAGpB,4BAA4B;AAE5B,IAAM,WAAW,GAAG,uiMAAuiM,CAAC;AAG5jM,4BAA4B;AAG5B,IAAM,WAAW,GAAG,EACnB,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,6BAA2B;AAC3B,iCAA+B;AAC/B,sBAAoB;AAGpB,4BAA4B;AAE5B,IAAM,WAAW,GAAG,6rMAA6rM,CAAC;AAGltM,4BAA4B;AAG5B,IAAM,WAAW,GAAG,EACnB,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
@@ -52,7 +52,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  exports.createEmailSender = exports.EmailSender = void 0;
54
54
  var nodemailer_1 = __importDefault(require("nodemailer"));
55
- var util_1 = require("@proteinjs/util");
55
+ var logger_1 = require("@proteinjs/logger");
56
56
  var reflection_1 = require("@proteinjs/reflection");
57
57
  var EmailSender = /** @class */ (function () {
58
58
  function EmailSender(config) {
@@ -64,7 +64,7 @@ var EmailSender = /** @class */ (function () {
64
64
  auth: this.config.auth,
65
65
  });
66
66
  this.fromAddress = this.config.from;
67
- this.logger = new util_1.Logger('EmailSender');
67
+ this.logger = new logger_1.Logger({ name: this.constructor.name });
68
68
  }
69
69
  EmailSender.prototype.getDefaultEmailConfig = function () {
70
70
  if (!EmailSender.defaultEmailConfig) {
@@ -89,11 +89,11 @@ var EmailSender = /** @class */ (function () {
89
89
  return [4 /*yield*/, this.transporter.sendMail(finalMailOptions)];
90
90
  case 2:
91
91
  _a.sent();
92
- this.logger.info("Email sent successfully to ".concat(mailOptions.to));
92
+ this.logger.info({ message: "Email sent successfully to ".concat(mailOptions.to) });
93
93
  return [3 /*break*/, 4];
94
94
  case 3:
95
95
  error_1 = _a.sent();
96
- this.logger.error('Error sending email:', error_1);
96
+ this.logger.error({ message: 'Error sending email', error: error_1 });
97
97
  throw new Error('Failed to send email');
98
98
  case 4: return [2 /*return*/];
99
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EmailSender.js","sourceRoot":"","sources":["../../src/EmailSender.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAoC;AACpC,wCAAyC;AACzC,oDAAmE;AAqBnE;IAOE,qBAAY,MAAoB;QAC9B,IAAI,CAAC,MAA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M,IAAI,KAAK,CACb,0LAA0L,CAC3L,CAAC;aACH;YAED,WAAW,CAAC,kBAAkB,GAAG,yBAAyB,CAAC,cAAc,EAAE,CAAC;SAC7E;QAED,OAAO,WAAW,CAAC,kBAAkB,CAAC;IACxC,CAAC;IAEK,+BAAS,GAAf,UAAgB,WAAyB;;;;;;wBACjC,gBAAgB,cACpB,IAAI,EAAE,IAAI,CAAC,WAAW,IACnB,WAAW,CACf,CAAC;;;;wBAGA,qBAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAA;;wBAAjD,SAAiD,CAAC;wBAClD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,qCAA8B,WAAW,CAAC,EAAE,CAAE,EAAE,CAAC,CAAC;;;;wBAE9E,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,KAAK,SAAA,EAAE,CAAC,CAAC;wBAC7D,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;;;;;KAE3C;IACH,kBAAC;AAAD,CAAC,AAlDD,IAkDC;AAlDY,kCAAW;AAoDxB,SAAgB,iBAAiB,CAAC,MAAmB;IACnD,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAFD,8CAEC"}
@@ -1,13 +1,13 @@
1
1
  /** Load Dependency Source Graphs */
2
2
 
3
+ import '@proteinjs/logger';
3
4
  import '@proteinjs/reflection';
4
- import '@proteinjs/util';
5
5
  import 'nodemailer';
6
6
 
7
7
 
8
8
  /** Generate Source Graph */
9
9
 
10
- const sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultEmailConfigFactory\",\"filePath\":\"/home/runner/work/notifications/notifications/packages/email/server/src/EmailSender.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getEmailConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"EmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/EmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultInviteEmailConfigFactory\",\"filePath\":\"/home/runner/work/notifications/notifications/packages/email/server/src/configs/InviteEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"InviteEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/InviteEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultPasswordResetEmailConfigFactory\",\"filePath\":\"/home/runner/work/notifications/notifications/packages/email/server/src/configs/PasswordResetEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"PasswordResetEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/PasswordResetEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultPasswordUpdatedEmailConfigFactory\",\"filePath\":\"/home/runner/work/notifications/notifications/packages/email/server/src/configs/PasswordUpdatedEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"PasswordUpdatedEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/PasswordUpdatedEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultSignupConfirmationEmailConfigFactory\",\"filePath\":\"/home/runner/work/notifications/notifications/packages/email/server/src/configs/SignupConfirmationEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"SignupConfirmationEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/SignupConfirmationEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}}],\"edges\":[{\"v\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"}]}";
10
+ const sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultEmailConfigFactory\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/notifications/packages/email/server/src/EmailSender.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getEmailConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"EmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/EmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultInviteEmailConfigFactory\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/notifications/packages/email/server/src/configs/InviteEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"InviteEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/InviteEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultPasswordResetEmailConfigFactory\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/notifications/packages/email/server/src/configs/PasswordResetEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"PasswordResetEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/PasswordResetEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultPasswordUpdatedEmailConfigFactory\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/notifications/packages/email/server/src/configs/PasswordUpdatedEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"PasswordUpdatedEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/PasswordUpdatedEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultSignupConfirmationEmailConfigFactory\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/notifications/packages/email/server/src/configs/SignupConfirmationEmailConfig.ts\",\"qualifiedName\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"properties\":[],\"methods\":[{\"name\":\"getConfig\",\"returnType\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"SignupConfirmationEmailConfig\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/email-server/SignupConfirmationEmailConfig\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}}],\"edges\":[{\"v\":\"@proteinjs/email-server/DefaultEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultInviteEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultPasswordResetEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/email-server/DefaultSignupConfirmationEmailConfigFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"}]}";
11
11
 
12
12
 
13
13
  /** Generate Source Links */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/email-server",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Email server libraries",
5
5
  "main": "./dist/generated/index.js",
6
6
  "types": "./dist/generated/index.d.ts",
@@ -23,12 +23,12 @@
23
23
  "watch": "reflection-watch"
24
24
  },
25
25
  "dependencies": {
26
- "@proteinjs/reflection": "1.1.8",
27
- "@proteinjs/util": "1.4.0",
26
+ "@proteinjs/logger": "1.0.5",
27
+ "@proteinjs/reflection": "1.1.9",
28
28
  "nodemailer": "6.9.14"
29
29
  },
30
30
  "devDependencies": {
31
- "@proteinjs/reflection-build": "1.0.23",
31
+ "@proteinjs/reflection-build": "1.0.24",
32
32
  "@types/jest": "29.5.5",
33
33
  "@types/node": "20.3.1",
34
34
  "@types/nodemailer": "6.4.15",
@@ -40,6 +40,5 @@
40
40
  "jest": "29.7.0",
41
41
  "ts-jest": "29.1.1",
42
42
  "typescript": "5.2.2"
43
- },
44
- "gitHead": "9798769f11ef80c9f70fe51219cd2d4f534ff8db"
43
+ }
45
44
  }
@@ -1,5 +1,5 @@
1
1
  import nodemailer from 'nodemailer';
2
- import { Logger } from '@proteinjs/util';
2
+ import { Logger } from '@proteinjs/logger';
3
3
  import { Loadable, SourceRepository } from '@proteinjs/reflection';
4
4
  import Mail from 'nodemailer/lib/mailer';
5
5
 
@@ -37,7 +37,7 @@ export class EmailSender {
37
37
  auth: this.config.auth,
38
38
  });
39
39
  this.fromAddress = this.config.from;
40
- this.logger = new Logger('EmailSender');
40
+ this.logger = new Logger({ name: this.constructor.name });
41
41
  }
42
42
 
43
43
  private getDefaultEmailConfig(): EmailConfig {
@@ -65,9 +65,9 @@ export class EmailSender {
65
65
 
66
66
  try {
67
67
  await this.transporter.sendMail(finalMailOptions);
68
- this.logger.info(`Email sent successfully to ${mailOptions.to}`);
68
+ this.logger.info({ message: `Email sent successfully to ${mailOptions.to}` });
69
69
  } catch (error: any) {
70
- this.logger.error('Error sending email:', error);
70
+ this.logger.error({ message: 'Error sending email', error });
71
71
  throw new Error('Failed to send email');
72
72
  }
73
73
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Brent Bahry
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.