@bymax-one/nest-notification 1.4.11 → 1.4.12

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
@@ -11,6 +11,20 @@ the entries that carry one, is the compatibility contract — read it, not the n
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [1.4.12] - 2026-11-17
15
+
16
+ ### Fixed
17
+
18
+ - **A send with no `html` part fails with its own error, not a `TypeError`.** When the transport or
19
+ the API rejected such a send, the code that removes secrets and echoed content from the error read
20
+ the missing part and threw a `TypeError` instead of the `SMTP send failed` or `Resend send failed`
21
+ error. `SmtpEmailProvider`, `ResendEmailProvider` and `EmailService` now treat a missing part as
22
+ nothing to echo against, and the declared values, the credentials and an echo of the text part are
23
+ removed as before. Only a caller that bypasses the `html: string` type reached it.
24
+ - **`pool: []` is refused.** `SmtpEmailProvider` took an empty array for the `pool` object and
25
+ behaved as if `{}` had been given; it now fails with the same `pool must be an object` as any
26
+ other value that is not one.
27
+
14
28
  ## [1.4.11] - 2026-11-17
15
29
 
16
30
  ### Added
@@ -1307,7 +1321,8 @@ rejected at startup rather than failing on the first send.
1307
1321
 
1308
1322
  [1.0.4]: https://github.com/bymaxone/nest-notification/compare/v1.0.3...v1.0.4
1309
1323
  [1.0.3]: https://github.com/bymaxone/nest-notification/compare/v1.0.2...v1.0.3
1310
- [Unreleased]: https://github.com/bymaxone/nest-notification/compare/v1.4.11...HEAD
1324
+ [Unreleased]: https://github.com/bymaxone/nest-notification/compare/v1.4.12...HEAD
1325
+ [1.4.12]: https://github.com/bymaxone/nest-notification/compare/v1.4.11...v1.4.12
1311
1326
  [1.4.11]: https://github.com/bymaxone/nest-notification/compare/v1.4.10...v1.4.11
1312
1327
  [1.4.10]: https://github.com/bymaxone/nest-notification/compare/v1.4.9...v1.4.10
1313
1328
  [1.4.9]: https://github.com/bymaxone/nest-notification/compare/v1.4.8...v1.4.9
package/README.md CHANGED
@@ -704,7 +704,7 @@ A one-time password is a credential, so every behavior is pinned so that a regre
704
704
  | Coverage | **100%** line/branch/function/statement per file (`pnpm test:cov:all`) |
705
705
  | Mutation | Stryker score **100%** (`break: 100`), no survivors |
706
706
  | Lint | ESLint flat config + `eslint-plugin-security`, zero warnings |
707
- | Bundle budgets | server < 35.34 KB · shared < 4 KB · react < 8 KB · testing < 4.5 KB brotli (`pnpm size`) |
707
+ | Bundle budgets | server < 35.33 KB · shared < 4 KB · react < 8 KB · testing < 4.5 KB brotli (`pnpm size`) |
708
708
  | Prisma-free | `pnpm check:no-prisma` — the library never imports `@prisma/client` |
709
709
  | Export map | `pnpm check:exports` — `attw` against the packed tarball, ESM and CJS |
710
710
  | Supply chain | published with npm provenance (OIDC), CodeQL + OpenSSF Scorecard |
@@ -1101,6 +1101,9 @@ function collectEchoedExcerpts(fields, reference) {
1101
1101
  budget -= field.length;
1102
1102
  }
1103
1103
  }
1104
+ if (typeof reference !== "string") {
1105
+ return whole;
1106
+ }
1104
1107
  const units = examined.flatMap((field) => [...field.split("").map((c) => c.charCodeAt(0)), -1]);
1105
1108
  const reach = longestEchoFrom(units, reference);
1106
1109
  const excerpts = whole;
@@ -1694,7 +1697,7 @@ exports.EmailService = class EmailService {
1694
1697
  gatherRedactionValues(parts, declared, sendOptions) {
1695
1698
  return [
1696
1699
  ...collectEchoedExcerpts(parts, sendOptions.html),
1697
- ...sendOptions.text !== void 0 ? collectEchoedExcerpts(parts, sendOptions.text) : [],
1700
+ ...collectEchoedExcerpts(parts, sendOptions.text),
1698
1701
  ...declared ?? []
1699
1702
  ];
1700
1703
  }
@@ -3154,9 +3157,7 @@ exports.ResendEmailProvider = class ResendEmailProvider {
3154
3157
  */
3155
3158
  scrubSendError(message, options) {
3156
3159
  const values = collectEchoedExcerpts(message, options.html);
3157
- if (options.text !== void 0) {
3158
- values.push(...collectEchoedExcerpts(message, options.text));
3159
- }
3160
+ values.push(...collectEchoedExcerpts(message, options.text));
3160
3161
  if (options.redactValues) {
3161
3162
  values.push(...options.redactValues);
3162
3163
  }
@@ -3255,7 +3256,7 @@ function assertPool(pool) {
3255
3256
  if (pool === void 0) {
3256
3257
  return;
3257
3258
  }
3258
- if (typeof pool !== "object" || pool === null) {
3259
+ if (typeof pool !== "object" || pool === null || Array.isArray(pool)) {
3259
3260
  throw new Error("SmtpEmailProvider: pool must be an object");
3260
3261
  }
3261
3262
  for (const [name, value] of [
@@ -3482,9 +3483,7 @@ exports.SmtpEmailProvider = class SmtpEmailProvider {
3482
3483
  */
3483
3484
  scrubTransportError(message, payload, declaredValues) {
3484
3485
  const values = collectEchoedExcerpts(message, payload.html);
3485
- if (payload.text !== void 0) {
3486
- values.push(...collectEchoedExcerpts(message, payload.text));
3487
- }
3486
+ values.push(...collectEchoedExcerpts(message, payload.text));
3488
3487
  if (declaredValues) {
3489
3488
  values.push(...declaredValues);
3490
3489
  }
@@ -1099,6 +1099,9 @@ function collectEchoedExcerpts(fields, reference) {
1099
1099
  budget -= field.length;
1100
1100
  }
1101
1101
  }
1102
+ if (typeof reference !== "string") {
1103
+ return whole;
1104
+ }
1102
1105
  const units = examined.flatMap((field) => [...field.split("").map((c) => c.charCodeAt(0)), -1]);
1103
1106
  const reach = longestEchoFrom(units, reference);
1104
1107
  const excerpts = whole;
@@ -1692,7 +1695,7 @@ var EmailService = class {
1692
1695
  gatherRedactionValues(parts, declared, sendOptions) {
1693
1696
  return [
1694
1697
  ...collectEchoedExcerpts(parts, sendOptions.html),
1695
- ...sendOptions.text !== void 0 ? collectEchoedExcerpts(parts, sendOptions.text) : [],
1698
+ ...collectEchoedExcerpts(parts, sendOptions.text),
1696
1699
  ...declared ?? []
1697
1700
  ];
1698
1701
  }
@@ -3152,9 +3155,7 @@ var ResendEmailProvider = class {
3152
3155
  */
3153
3156
  scrubSendError(message, options) {
3154
3157
  const values = collectEchoedExcerpts(message, options.html);
3155
- if (options.text !== void 0) {
3156
- values.push(...collectEchoedExcerpts(message, options.text));
3157
- }
3158
+ values.push(...collectEchoedExcerpts(message, options.text));
3158
3159
  if (options.redactValues) {
3159
3160
  values.push(...options.redactValues);
3160
3161
  }
@@ -3253,7 +3254,7 @@ function assertPool(pool) {
3253
3254
  if (pool === void 0) {
3254
3255
  return;
3255
3256
  }
3256
- if (typeof pool !== "object" || pool === null) {
3257
+ if (typeof pool !== "object" || pool === null || Array.isArray(pool)) {
3257
3258
  throw new Error("SmtpEmailProvider: pool must be an object");
3258
3259
  }
3259
3260
  for (const [name, value] of [
@@ -3480,9 +3481,7 @@ var SmtpEmailProvider = class {
3480
3481
  */
3481
3482
  scrubTransportError(message, payload, declaredValues) {
3482
3483
  const values = collectEchoedExcerpts(message, payload.html);
3483
- if (payload.text !== void 0) {
3484
- values.push(...collectEchoedExcerpts(message, payload.text));
3485
- }
3484
+ values.push(...collectEchoedExcerpts(message, payload.text));
3486
3485
  if (declaredValues) {
3487
3486
  values.push(...declaredValues);
3488
3487
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bymax-one/nest-notification",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "description": "Multi-channel notification library for NestJS — email, OTP, SMS, push — with pluggable providers and storage, multi-tenant by design, zero runtime dependencies.",
5
5
  "author": "Bymax One <support@bymax.one>",
6
6
  "license": "MIT",