@bernierllc/email 3.1.1 → 3.3.0

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.
@@ -0,0 +1,12 @@
1
+ export type EmailErrorCode = 'EMAIL_ERROR' | 'INVALID_INPUT' | 'OPERATION_FAILED';
2
+ export interface EmailErrorOptions {
3
+ cause?: Error;
4
+ code?: EmailErrorCode;
5
+ context?: Record<string, unknown>;
6
+ }
7
+ export declare class EmailError extends Error {
8
+ readonly code: EmailErrorCode;
9
+ readonly context?: Record<string, unknown>;
10
+ constructor(message: string, options?: EmailErrorOptions);
11
+ }
12
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GACtB,aAAa,GACb,eAAe,GACf,kBAAkB,CAAC;AAEvB,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAE/B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB;CASzD"}
package/dist/errors.js ADDED
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.EmailError = void 0;
11
+ class EmailError extends Error {
12
+ code;
13
+ context;
14
+ constructor(message, options) {
15
+ super(message, options?.cause ? { cause: options.cause } : undefined);
16
+ this.name = 'EmailError';
17
+ this.code = options?.code ?? 'EMAIL_ERROR';
18
+ if (options?.context !== undefined) {
19
+ this.context = options.context;
20
+ }
21
+ Error.captureStackTrace?.(this, this.constructor);
22
+ }
23
+ }
24
+ exports.EmailError = EmailError;
25
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AAaF,MAAa,UAAW,SAAQ,KAAK;IAC1B,IAAI,CAAiB;IACrB,OAAO,CAA2B;IAE3C,YAAY,OAAe,EAAE,OAA2B;QACtD,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,aAAa,CAAC;QAC3C,IAAI,OAAO,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACjC,CAAC;QACD,KAAK,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;CACF;AAbD,gCAaC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { EmailService } from './simple-email-service';
2
2
  export * from './types';
3
+ export { EmailError, type EmailErrorCode, type EmailErrorOptions } from './errors';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -21,8 +21,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
21
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.EmailService = void 0;
24
+ exports.EmailError = exports.EmailService = void 0;
25
25
  var simple_email_service_1 = require("./simple-email-service");
26
26
  Object.defineProperty(exports, "EmailService", { enumerable: true, get: function () { return simple_email_service_1.EmailService; } });
27
27
  __exportStar(require("./types"), exports);
28
+ var errors_1 = require("./errors");
29
+ Object.defineProperty(exports, "EmailError", { enumerable: true, get: function () { return errors_1.EmailError; } });
28
30
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;;;;;;;;;;;;;;;AAEF,+DAAsD;AAA7C,oHAAA,YAAY,OAAA;AACrB,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;;;;;;;;;;;;;;;AAEF,+DAAsD;AAA7C,oHAAA,YAAY,OAAA;AACrB,0CAAwB;AACxB,mCAAmF;AAA1E,oGAAA,UAAU,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bernierllc/email",
3
- "version": "3.1.1",
3
+ "version": "3.3.0",
4
4
  "deprecated": "This package is deprecated. Please use @bernierllc/email-service instead. See https://github.com/BernierLLC/tools/blob/main/packages/service/email-service/MIGRATION.md for migration guide.",
5
5
  "description": "A comprehensive email service that orchestrates sending, templates, authentication, and retry logic",
6
6
  "main": "dist/index.js",
@@ -24,13 +24,13 @@
24
24
  "directory": "packages/service/email"
25
25
  },
26
26
  "dependencies": {
27
- "@bernierllc/crypto-utils": "1.3.0",
28
27
  "@bernierllc/email-parser": "0.6.0",
29
28
  "@bernierllc/email-sender": "5.4.0",
30
29
  "@bernierllc/email-validator": "3.3.0",
31
30
  "@bernierllc/retry-metrics": "0.4.0",
31
+ "@bernierllc/retry-policy": "0.6.0",
32
32
  "@bernierllc/retry-state": "0.4.0",
33
- "@bernierllc/retry-policy": "0.6.0"
33
+ "@bernierllc/crypto-utils": "1.3.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/jest": "^29.5.12",