@proteinjs/email-server 1.1.1 → 1.2.1

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 (42) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE +21 -0
  3. package/dist/generated/index.d.ts +1 -1
  4. package/dist/generated/index.d.ts.map +1 -1
  5. package/dist/generated/index.js +2 -2
  6. package/dist/generated/index.js.map +1 -1
  7. package/dist/index.d.ts +4 -3
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +4 -3
  10. package/dist/index.js.map +1 -1
  11. package/dist/src/EmailSender.js +4 -4
  12. package/dist/src/EmailSender.js.map +1 -1
  13. package/dist/src/configs/InviteEmailConfig.d.ts.map +1 -0
  14. package/dist/src/configs/InviteEmailConfig.js.map +1 -0
  15. package/dist/src/configs/PasswordResetEmailConfig.d.ts.map +1 -0
  16. package/dist/src/configs/PasswordResetEmailConfig.js.map +1 -0
  17. package/dist/src/configs/PasswordUpdatedEmailConfig.d.ts +19 -0
  18. package/dist/src/configs/PasswordUpdatedEmailConfig.d.ts.map +1 -0
  19. package/dist/src/configs/PasswordUpdatedEmailConfig.js +15 -0
  20. package/dist/src/configs/PasswordUpdatedEmailConfig.js.map +1 -0
  21. package/dist/src/configs/SignupConfirmationEmailConfig.d.ts.map +1 -0
  22. package/dist/src/configs/SignupConfirmationEmailConfig.js.map +1 -0
  23. package/generated/index.ts +2 -2
  24. package/index.ts +4 -3
  25. package/package.json +5 -4
  26. package/src/EmailSender.ts +4 -4
  27. package/src/configs/PasswordUpdatedEmailConfig.ts +33 -0
  28. package/dist/src/InviteEmailConfig.d.ts.map +0 -1
  29. package/dist/src/InviteEmailConfig.js.map +0 -1
  30. package/dist/src/PasswordResetEmailConfig.d.ts.map +0 -1
  31. package/dist/src/PasswordResetEmailConfig.js.map +0 -1
  32. package/dist/src/SignupConfirmationEmailConfig.d.ts.map +0 -1
  33. package/dist/src/SignupConfirmationEmailConfig.js.map +0 -1
  34. /package/dist/src/{InviteEmailConfig.d.ts → configs/InviteEmailConfig.d.ts} +0 -0
  35. /package/dist/src/{InviteEmailConfig.js → configs/InviteEmailConfig.js} +0 -0
  36. /package/dist/src/{PasswordResetEmailConfig.d.ts → configs/PasswordResetEmailConfig.d.ts} +0 -0
  37. /package/dist/src/{PasswordResetEmailConfig.js → configs/PasswordResetEmailConfig.js} +0 -0
  38. /package/dist/src/{SignupConfirmationEmailConfig.d.ts → configs/SignupConfirmationEmailConfig.d.ts} +0 -0
  39. /package/dist/src/{SignupConfirmationEmailConfig.js → configs/SignupConfirmationEmailConfig.js} +0 -0
  40. /package/src/{InviteEmailConfig.ts → configs/InviteEmailConfig.ts} +0 -0
  41. /package/src/{PasswordResetEmailConfig.ts → configs/PasswordResetEmailConfig.ts} +0 -0
  42. /package/src/{SignupConfirmationEmailConfig.ts → configs/SignupConfirmationEmailConfig.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
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
+
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)
18
+
19
+
20
+ ### Features
21
+
22
+ * add password updated email config ([15fc07b](https://github.com/proteinjs/notifications/commit/15fc07b8d4fe1dff9ba63c3a06b422eadc0f8f19))
23
+
24
+
25
+
26
+
27
+
6
28
  # [1.1.0](https://github.com/proteinjs/notifications/compare/@proteinjs/email-server@1.0.5...@proteinjs/email-server@1.1.0) (2024-08-05)
7
29
 
8
30
 
package/LICENSE ADDED
@@ -0,0 +1,21 @@
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.
@@ -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\":\"/Users/veronica/Repositories/n3xa-meta-repo/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/veronica/Repositories/n3xa-meta-repo/packages/proteinjs/packages/notifications/packages/email/server/src/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/veronica/Repositories/n3xa-meta-repo/packages/proteinjs/packages/notifications/packages/email/server/src/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/DefaultSignupConfirmationEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultSignupConfirmationEmailConfigFactory\",\"filePath\":\"/Users/veronica/Repositories/n3xa-meta-repo/packages/proteinjs/packages/notifications/packages/email/server/src/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/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\":\"/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\"}]}";
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,s9JAAs9J,CAAC;AAG3+J,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,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"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- export * from './src/InviteEmailConfig';
2
- export * from './src/PasswordResetEmailConfig';
3
- export * from './src/SignupConfirmationEmailConfig';
1
+ export * from './src/configs/InviteEmailConfig';
2
+ export * from './src/configs/PasswordResetEmailConfig';
3
+ export * from './src/configs/PasswordUpdatedEmailConfig';
4
+ export * from './src/configs/SignupConfirmationEmailConfig';
4
5
  export * from './src/EmailSender';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src/InviteEmailConfig"), exports);
18
- __exportStar(require("./src/PasswordResetEmailConfig"), exports);
19
- __exportStar(require("./src/SignupConfirmationEmailConfig"), exports);
17
+ __exportStar(require("./src/configs/InviteEmailConfig"), exports);
18
+ __exportStar(require("./src/configs/PasswordResetEmailConfig"), exports);
19
+ __exportStar(require("./src/configs/PasswordUpdatedEmailConfig"), exports);
20
+ __exportStar(require("./src/configs/SignupConfirmationEmailConfig"), exports);
20
21
  __exportStar(require("./src/EmailSender"), exports);
21
22
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,iEAA+C;AAC/C,sEAAoD;AACpD,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,yEAAuD;AACvD,2EAAyD;AACzD,8EAA4D;AAC5D,oDAAkC"}
@@ -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,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7D,IAAI,CAAC,WAAW,GAAG,oBAAU,CAAC,eAAe,CAAC;YAC5C,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC1B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;SACvB,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,aAAM,CAAC,aAAa,CAAC,CAAC;IAC1C,CAAC;IAEO,2CAAqB,GAA7B;QACE,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE;YACnC,IAAM,yBAAyB,GAAG,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAC7D,mDAAmD,CACpD,CAAC;YACF,IAAI,CAAC,yBAAyB,EAAE;gBAC9B,MAAM,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,qCAA8B,WAAW,CAAC,EAAE,CAAE,CAAC,CAAC;;;;wBAEjE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,OAAK,CAAC,CAAC;wBACjD,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
+ {"version":3,"file":"EmailSender.js","sourceRoot":"","sources":["../../src/EmailSender.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAoC;AACpC,4CAA2C;AAC3C,oDAAmE;AAqBnE;IAOE,qBAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7D,IAAI,CAAC,WAAW,GAAG,oBAAU,CAAC,eAAe,CAAC;YAC5C,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC1B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;SACvB,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;IAEO,2CAAqB,GAA7B;QACE,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE;YACnC,IAAM,yBAAyB,GAAG,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAC7D,mDAAmD,CACpD,CAAC;YACF,IAAI,CAAC,yBAAyB,EAAE;gBAC9B,MAAM,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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InviteEmailConfig.d.ts","sourceRoot":"","sources":["../../../src/configs/InviteEmailConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AACnE,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC,eAAO,MAAM,kCAAkC,uCAG5C,CAAC;AAEJ,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;IAEvB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK;QAChD,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,+BAAgC,SAAQ,QAAQ;IAC/D,SAAS,IAAI,iBAAiB,CAAC;CAChC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InviteEmailConfig.js","sourceRoot":"","sources":["../../../src/configs/InviteEmailConfig.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AAG5D,IAAM,kCAAkC,GAAG;IAChD,OAAA,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAC3B,yDAAyD,CAC1D;AAFD,CAEC,CAAC;AAHS,QAAA,kCAAkC,sCAG3C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordResetEmailConfig.d.ts","sourceRoot":"","sources":["../../../src/configs/PasswordResetEmailConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AACnE,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC,eAAO,MAAM,yCAAyC,8CAGnD,CAAC;AAEJ,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;IAEvB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,EAAE,CAAC,kBAAkB,EAAE,MAAM,KAAK;QAC/C,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,sCAAuC,SAAQ,QAAQ;IACtE,SAAS,IAAI,wBAAwB,CAAC;CACvC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordResetEmailConfig.js","sourceRoot":"","sources":["../../../src/configs/PasswordResetEmailConfig.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AAG5D,IAAM,yCAAyC,GAAG;IACvD,OAAA,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAC3B,gEAAgE,CACjE;AAFD,CAEC,CAAC;AAHS,QAAA,yCAAyC,6CAGlD"}
@@ -0,0 +1,19 @@
1
+ import { Loadable } from '@proteinjs/reflection';
2
+ import Mail from 'nodemailer/lib/mailer';
3
+ export declare const getDefaultPasswordUpdatedEmailConfigFactory: () => DefaultPasswordUpdatedEmailConfigFactory;
4
+ export interface PasswordUpdatedEmailConfig {
5
+ /**
6
+ * Options to pass into the `EmailSender` object when building the email to be sent.
7
+ *
8
+ * @see https://nodemailer.com/message/ for all available options
9
+ */
10
+ options?: Mail.Options;
11
+ /** The plain text version of the email (required) */
12
+ text: string;
13
+ /** The HTML version of the email (optional, used for styling) */
14
+ html?: string;
15
+ }
16
+ export interface DefaultPasswordUpdatedEmailConfigFactory extends Loadable {
17
+ getConfig(): PasswordUpdatedEmailConfig;
18
+ }
19
+ //# sourceMappingURL=PasswordUpdatedEmailConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordUpdatedEmailConfig.d.ts","sourceRoot":"","sources":["../../../src/configs/PasswordUpdatedEmailConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AACnE,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC,eAAO,MAAM,2CAA2C,gDAYvD,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;IACvB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wCAAyC,SAAQ,QAAQ;IACxE,SAAS,IAAI,0BAA0B,CAAC;CACzC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDefaultPasswordUpdatedEmailConfigFactory = void 0;
4
+ var reflection_1 = require("@proteinjs/reflection");
5
+ var getDefaultPasswordUpdatedEmailConfigFactory = function () {
6
+ var defaultFactory = {
7
+ getConfig: function () { return ({
8
+ text: "Hello, your password has been successfully updated. If this wasn't you, please reset your password immediately.",
9
+ }); },
10
+ };
11
+ var retrievedFactory = reflection_1.SourceRepository.get().object('@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory');
12
+ return retrievedFactory || defaultFactory;
13
+ };
14
+ exports.getDefaultPasswordUpdatedEmailConfigFactory = getDefaultPasswordUpdatedEmailConfigFactory;
15
+ //# sourceMappingURL=PasswordUpdatedEmailConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordUpdatedEmailConfig.js","sourceRoot":"","sources":["../../../src/configs/PasswordUpdatedEmailConfig.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AAG5D,IAAM,2CAA2C,GAAG;IACzD,IAAM,cAAc,GAA6C;QAC/D,SAAS,EAAE,cAAkC,OAAA,CAAC;YAC5C,IAAI,EAAE,iHAAiH;SACxH,CAAC,EAF2C,CAE3C;KACH,CAAC;IAEF,IAAM,gBAAgB,GAAG,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CACpD,kEAAkE,CACnE,CAAC;IAEF,OAAO,gBAAgB,IAAI,cAAc,CAAC;AAC5C,CAAC,CAAC;AAZW,QAAA,2CAA2C,+CAYtD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignupConfirmationEmailConfig.d.ts","sourceRoot":"","sources":["../../../src/configs/SignupConfirmationEmailConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AACnE,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC,MAAM,WAAW,2CAA4C,SAAQ,QAAQ;IAC3E,SAAS,IAAI,6BAA6B,CAAC;CAC5C;AAED,eAAO,MAAM,8CAA8C,QAAO,2CAiBjE,CAAC;AAEF,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;IAEvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;;OAMG;IACH,sBAAsB,EAAE,MAAM;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF;;;;;;OAMG;IACH,2BAA2B,EAAE,MAAM;QACjC,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignupConfirmationEmailConfig.js","sourceRoot":"","sources":["../../../src/configs/SignupConfirmationEmailConfig.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AAO5D,IAAM,8CAA8C,GAAG;IAC5D,IAAM,cAAc,GAAgD;QAClE,SAAS,EAAE,cAAqC,OAAA,CAAC;YAC/C,sBAAsB,EAAE,cAAM,OAAA,CAAC;gBAC7B,IAAI,EAAE,2FAA2F;aAClG,CAAC,EAF4B,CAE5B;YACF,2BAA2B,EAAE,cAAM,OAAA,CAAC;gBAClC,IAAI,EAAE,0LACoE;aAC3E,CAAC,EAHiC,CAGjC;SACH,CAAC,EAR8C,CAQ9C;KACH,CAAC;IAEF,IAAM,OAAO,GAAG,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAC3C,qEAAqE,CACtE,CAAC;IACF,OAAO,OAAO,IAAI,cAAc,CAAC;AACnC,CAAC,CAAC;AAjBW,QAAA,8CAA8C,kDAiBzD"}
@@ -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\":\"/Users/veronica/Repositories/n3xa-meta-repo/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/veronica/Repositories/n3xa-meta-repo/packages/proteinjs/packages/notifications/packages/email/server/src/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/veronica/Repositories/n3xa-meta-repo/packages/proteinjs/packages/notifications/packages/email/server/src/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/DefaultSignupConfirmationEmailConfigFactory\",\"value\":{\"packageName\":\"@proteinjs/email-server\",\"name\":\"DefaultSignupConfirmationEmailConfigFactory\",\"filePath\":\"/Users/veronica/Repositories/n3xa-meta-repo/packages/proteinjs/packages/notifications/packages/email/server/src/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/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\":\"/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\"}]}";
11
11
 
12
12
 
13
13
  /** Generate Source Links */
package/index.ts CHANGED
@@ -1,4 +1,5 @@
1
- export * from './src/InviteEmailConfig';
2
- export * from './src/PasswordResetEmailConfig';
3
- export * from './src/SignupConfirmationEmailConfig';
1
+ export * from './src/configs/InviteEmailConfig';
2
+ export * from './src/configs/PasswordResetEmailConfig';
3
+ export * from './src/configs/PasswordUpdatedEmailConfig';
4
+ export * from './src/configs/SignupConfirmationEmailConfig';
4
5
  export * from './src/EmailSender';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/email-server",
3
- "version": "1.1.1",
3
+ "version": "1.2.1",
4
4
  "description": "Email server libraries",
5
5
  "main": "./dist/generated/index.js",
6
6
  "types": "./dist/generated/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  "watch": "reflection-watch"
24
24
  },
25
25
  "dependencies": {
26
+ "@proteinjs/logger": "1.0.4",
26
27
  "@proteinjs/reflection": "1.1.8",
27
- "@proteinjs/util": "1.4.0",
28
28
  "nodemailer": "6.9.14"
29
29
  },
30
30
  "devDependencies": {
@@ -40,5 +40,6 @@
40
40
  "jest": "29.7.0",
41
41
  "ts-jest": "29.1.1",
42
42
  "typescript": "5.2.2"
43
- }
44
- }
43
+ },
44
+ "gitHead": "b0d44246c29759253ad1cae3f6eb1065041b72fc"
45
+ }
@@ -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
  }
@@ -0,0 +1,33 @@
1
+ import { Loadable, SourceRepository } from '@proteinjs/reflection';
2
+ import Mail from 'nodemailer/lib/mailer';
3
+
4
+ export const getDefaultPasswordUpdatedEmailConfigFactory = () => {
5
+ const defaultFactory: DefaultPasswordUpdatedEmailConfigFactory = {
6
+ getConfig: (): PasswordUpdatedEmailConfig => ({
7
+ text: `Hello, your password has been successfully updated. If this wasn't you, please reset your password immediately.`,
8
+ }),
9
+ };
10
+
11
+ const retrievedFactory = SourceRepository.get().object<DefaultPasswordUpdatedEmailConfigFactory>(
12
+ '@proteinjs/email-server/DefaultPasswordUpdatedEmailConfigFactory'
13
+ );
14
+
15
+ return retrievedFactory || defaultFactory;
16
+ };
17
+
18
+ export interface PasswordUpdatedEmailConfig {
19
+ /**
20
+ * Options to pass into the `EmailSender` object when building the email to be sent.
21
+ *
22
+ * @see https://nodemailer.com/message/ for all available options
23
+ */
24
+ options?: Mail.Options;
25
+ /** The plain text version of the email (required) */
26
+ text: string;
27
+ /** The HTML version of the email (optional, used for styling) */
28
+ html?: string;
29
+ }
30
+
31
+ export interface DefaultPasswordUpdatedEmailConfigFactory extends Loadable {
32
+ getConfig(): PasswordUpdatedEmailConfig;
33
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"InviteEmailConfig.d.ts","sourceRoot":"","sources":["../../src/InviteEmailConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AACnE,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC,eAAO,MAAM,kCAAkC,uCAG5C,CAAC;AAEJ,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;IAEvB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK;QAChD,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,+BAAgC,SAAQ,QAAQ;IAC/D,SAAS,IAAI,iBAAiB,CAAC;CAChC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"InviteEmailConfig.js","sourceRoot":"","sources":["../../src/InviteEmailConfig.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AAG5D,IAAM,kCAAkC,GAAG;IAChD,OAAA,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAC3B,yDAAyD,CAC1D;AAFD,CAEC,CAAC;AAHS,QAAA,kCAAkC,sCAG3C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PasswordResetEmailConfig.d.ts","sourceRoot":"","sources":["../../src/PasswordResetEmailConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AACnE,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC,eAAO,MAAM,yCAAyC,8CAGnD,CAAC;AAEJ,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;IAEvB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,EAAE,CAAC,kBAAkB,EAAE,MAAM,KAAK;QAC/C,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,sCAAuC,SAAQ,QAAQ;IACtE,SAAS,IAAI,wBAAwB,CAAC;CACvC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PasswordResetEmailConfig.js","sourceRoot":"","sources":["../../src/PasswordResetEmailConfig.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AAG5D,IAAM,yCAAyC,GAAG;IACvD,OAAA,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAC3B,gEAAgE,CACjE;AAFD,CAEC,CAAC;AAHS,QAAA,yCAAyC,6CAGlD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SignupConfirmationEmailConfig.d.ts","sourceRoot":"","sources":["../../src/SignupConfirmationEmailConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AACnE,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC,MAAM,WAAW,2CAA4C,SAAQ,QAAQ;IAC3E,SAAS,IAAI,6BAA6B,CAAC;CAC5C;AAED,eAAO,MAAM,8CAA8C,QAAO,2CAiBjE,CAAC;AAEF,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;IAEvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;;OAMG;IACH,sBAAsB,EAAE,MAAM;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF;;;;;;OAMG;IACH,2BAA2B,EAAE,MAAM;QACjC,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SignupConfirmationEmailConfig.js","sourceRoot":"","sources":["../../src/SignupConfirmationEmailConfig.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AAO5D,IAAM,8CAA8C,GAAG;IAC5D,IAAM,cAAc,GAAgD;QAClE,SAAS,EAAE,cAAqC,OAAA,CAAC;YAC/C,sBAAsB,EAAE,cAAM,OAAA,CAAC;gBAC7B,IAAI,EAAE,2FAA2F;aAClG,CAAC,EAF4B,CAE5B;YACF,2BAA2B,EAAE,cAAM,OAAA,CAAC;gBAClC,IAAI,EAAE,0LACoE;aAC3E,CAAC,EAHiC,CAGjC;SACH,CAAC,EAR8C,CAQ9C;KACH,CAAC;IAEF,IAAM,OAAO,GAAG,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAC3C,qEAAqE,CACtE,CAAC;IACF,OAAO,OAAO,IAAI,cAAc,CAAC;AACnC,CAAC,CAAC;AAjBW,QAAA,8CAA8C,kDAiBzD"}