@cedarjs/mailer-core 5.0.4-next.167 → 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/handler.js +26 -2
- package/dist/index.js +26 -3
- package/dist/mailer.d.ts.map +1 -1
- package/dist/mailer.js +32 -10
- package/dist/renderer.js +26 -2
- package/dist/types.js +16 -0
- package/dist/utils.js +29 -2
- package/package.json +7 -7
package/dist/handler.js
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var handler_exports = {};
|
|
20
|
+
__export(handler_exports, {
|
|
21
|
+
AbstractMailHandler: () => AbstractMailHandler
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(handler_exports);
|
|
1
24
|
class AbstractMailHandler {
|
|
2
25
|
}
|
|
3
|
-
export
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
4
28
|
AbstractMailHandler
|
|
5
|
-
};
|
|
29
|
+
});
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var index_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(index_exports);
|
|
18
|
+
__reExport(index_exports, require("./mailer.js"), module.exports);
|
|
19
|
+
__reExport(index_exports, require("./handler.js"), module.exports);
|
|
20
|
+
__reExport(index_exports, require("./renderer.js"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("./mailer.js"),
|
|
24
|
+
...require("./handler.js"),
|
|
25
|
+
...require("./renderer.js")
|
|
26
|
+
});
|
package/dist/mailer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mailer.d.ts","sourceRoot":"","sources":["../src/mailer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mailer.d.ts","sourceRoot":"","s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cAAc,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAC3D,eAAe,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAC/D,OAAO,CAAC,UAAU,CAAC;IAyFhB,oBAAoB,CACxB,QAAQ,SAAS,MAAM,SAAS,GAAG,eAAe,EAElD,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EACnD,WAAW,EAAE,+BAA+B,CAAC,SAAS,EAAE,QAAQ,CAAC,EACjE,cAAc,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1D,OAAO,CAAC,UAAU,CAAC;IA6DtB,SAAS,CAAC,aAAa;IAcvB,SAAS,CAAC,MAAM;IAchB,cAAc;IAWd,qBAAqB;IAWrB,2BAA2B;IAI3B,iBAAiB,CAAC,IAAI,GAAE,UAAsB;IAa9C,kBAAkB;IAIlB,SAAS,CAAC,qBAAqB;CAGhC"}
|
package/dist/mailer.js
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var mailer_exports = {};
|
|
20
|
+
__export(mailer_exports, {
|
|
21
|
+
Mailer: () => Mailer
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(mailer_exports);
|
|
24
|
+
var import_utils = require("./utils.js");
|
|
4
25
|
class Mailer {
|
|
5
26
|
constructor(config) {
|
|
6
27
|
this.config = config;
|
|
@@ -8,11 +29,11 @@ class Mailer {
|
|
|
8
29
|
this.mode = this.isTest() ? "test" : this.isDevelopment() ? "development" : "production";
|
|
9
30
|
this.handlers = this.config.handling.handlers;
|
|
10
31
|
this.renderers = this.config.rendering.renderers;
|
|
11
|
-
this.defaults = extractDefaults(this.config.defaults ?? {});
|
|
32
|
+
this.defaults = (0, import_utils.extractDefaults)(this.config.defaults ?? {});
|
|
12
33
|
const testHandlerKey = this.config.test?.handler;
|
|
13
34
|
if (testHandlerKey === void 0) {
|
|
14
35
|
try {
|
|
15
|
-
this.fallbackTestHandler = new (
|
|
36
|
+
this.fallbackTestHandler = new (require("@cedarjs/mailer-handler-in-memory")).InMemoryMailHandler();
|
|
16
37
|
this.logger.warn(
|
|
17
38
|
"Automatically loaded the '@cedarjs/mailer-handler-in-memory' handler, this will be used to process mail in test mode"
|
|
18
39
|
);
|
|
@@ -35,7 +56,7 @@ class Mailer {
|
|
|
35
56
|
const developmentHandlerKey = this.config.development?.handler;
|
|
36
57
|
if (developmentHandlerKey === void 0) {
|
|
37
58
|
try {
|
|
38
|
-
this.fallbackDevelopmentHandler = new (
|
|
59
|
+
this.fallbackDevelopmentHandler = new (require("@cedarjs/mailer-handler-studio")).StudioMailHandler();
|
|
39
60
|
this.logger.warn(
|
|
40
61
|
"Automatically loaded the '@cedarjs/mailer-handler-studio' handler, this will be used to process mail in development mode"
|
|
41
62
|
);
|
|
@@ -113,7 +134,7 @@ class Mailer {
|
|
|
113
134
|
if (handlerKey === null) {
|
|
114
135
|
return {};
|
|
115
136
|
}
|
|
116
|
-
const completedSendOptions = constructCompleteSendOptions(
|
|
137
|
+
const completedSendOptions = (0, import_utils.constructCompleteSendOptions)(
|
|
117
138
|
sendOptions,
|
|
118
139
|
this.defaults
|
|
119
140
|
);
|
|
@@ -183,7 +204,7 @@ class Mailer {
|
|
|
183
204
|
if (handlerKey === null) {
|
|
184
205
|
return {};
|
|
185
206
|
}
|
|
186
|
-
const completedSendOptions = constructCompleteSendOptions(
|
|
207
|
+
const completedSendOptions = (0, import_utils.constructCompleteSendOptions)(
|
|
187
208
|
sendOptions,
|
|
188
209
|
this.defaults
|
|
189
210
|
);
|
|
@@ -274,6 +295,7 @@ class Mailer {
|
|
|
274
295
|
return this.config.rendering.default;
|
|
275
296
|
}
|
|
276
297
|
}
|
|
277
|
-
export
|
|
298
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
299
|
+
0 && (module.exports = {
|
|
278
300
|
Mailer
|
|
279
|
-
};
|
|
301
|
+
});
|
package/dist/renderer.js
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var renderer_exports = {};
|
|
20
|
+
__export(renderer_exports, {
|
|
21
|
+
AbstractMailRenderer: () => AbstractMailRenderer
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(renderer_exports);
|
|
1
24
|
class AbstractMailRenderer {
|
|
2
25
|
}
|
|
3
|
-
export
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
4
28
|
AbstractMailRenderer
|
|
5
|
-
};
|
|
29
|
+
});
|
package/dist/types.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
package/dist/utils.js
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
constructCompleteSendOptions: () => constructCompleteSendOptions,
|
|
22
|
+
convertAddress: () => convertAddress,
|
|
23
|
+
convertAddresses: () => convertAddresses,
|
|
24
|
+
extractDefaults: () => extractDefaults
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(utils_exports);
|
|
1
27
|
function convertAddress(address) {
|
|
2
28
|
if (typeof address === "string") {
|
|
3
29
|
return address;
|
|
@@ -97,9 +123,10 @@ function constructCompleteSendOptions(sendOptions, defaults) {
|
|
|
97
123
|
}
|
|
98
124
|
return { ...sendOptionsComplete, from: convertAddress(from), subject };
|
|
99
125
|
}
|
|
100
|
-
export
|
|
126
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
127
|
+
0 && (module.exports = {
|
|
101
128
|
constructCompleteSendOptions,
|
|
102
129
|
convertAddress,
|
|
103
130
|
convertAddresses,
|
|
104
131
|
extractDefaults
|
|
105
|
-
};
|
|
132
|
+
});
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/mailer-core",
|
|
3
|
-
"version": "5.0.4
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
7
7
|
"directory": "packages/mailer/core"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"type": "
|
|
10
|
+
"type": "commonjs",
|
|
11
11
|
"main": "./dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "node ./build.mts",
|
|
17
|
+
"build": "node ./build.mts && yarn build:types",
|
|
18
18
|
"build:pack": "yarn pack -o cedarjs-mailer-core.tgz",
|
|
19
|
-
"build:types": "tsc --build --verbose
|
|
19
|
+
"build:types": "tsc --build --verbose",
|
|
20
20
|
"build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"",
|
|
21
21
|
"prepublishOnly": "NODE_ENV=production yarn build",
|
|
22
22
|
"test": "vitest run",
|
|
23
23
|
"test:watch": "vitest watch"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@cedarjs/api": "5.0.4
|
|
27
|
-
"@cedarjs/framework-tools": "5.0.4
|
|
26
|
+
"@cedarjs/api": "5.0.4",
|
|
27
|
+
"@cedarjs/framework-tools": "5.0.4",
|
|
28
28
|
"typescript": "5.9.3",
|
|
29
|
-
"vitest": "
|
|
29
|
+
"vitest": "3.2.6"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=24"
|