@cedarjs/mailer-core 6.0.0-canary.2750 → 6.0.0-canary.2756
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 +2 -26
- package/dist/index.js +3 -26
- package/dist/mailer.d.ts.map +1 -1
- package/dist/mailer.js +10 -32
- package/dist/renderer.js +2 -26
- package/dist/types.js +0 -16
- package/dist/utils.js +2 -29
- package/package.json +6 -6
package/dist/handler.js
CHANGED
|
@@ -1,29 +1,5 @@
|
|
|
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);
|
|
24
1
|
class AbstractMailHandler {
|
|
25
2
|
}
|
|
26
|
-
|
|
27
|
-
0 && (module.exports = {
|
|
3
|
+
export {
|
|
28
4
|
AbstractMailHandler
|
|
29
|
-
}
|
|
5
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
});
|
|
1
|
+
export * from "./mailer.js";
|
|
2
|
+
export * from "./handler.js";
|
|
3
|
+
export * from "./renderer.js";
|
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":"","sources":["../src/mailer.ts"],"names":[],"mappings":"AAEA,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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,27 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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");
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { constructCompleteSendOptions, extractDefaults } from "./utils.js";
|
|
3
|
+
const require2 = createRequire(import.meta.url);
|
|
25
4
|
class Mailer {
|
|
26
5
|
constructor(config) {
|
|
27
6
|
this.config = config;
|
|
@@ -29,11 +8,11 @@ class Mailer {
|
|
|
29
8
|
this.mode = this.isTest() ? "test" : this.isDevelopment() ? "development" : "production";
|
|
30
9
|
this.handlers = this.config.handling.handlers;
|
|
31
10
|
this.renderers = this.config.rendering.renderers;
|
|
32
|
-
this.defaults =
|
|
11
|
+
this.defaults = extractDefaults(this.config.defaults ?? {});
|
|
33
12
|
const testHandlerKey = this.config.test?.handler;
|
|
34
13
|
if (testHandlerKey === void 0) {
|
|
35
14
|
try {
|
|
36
|
-
this.fallbackTestHandler = new (
|
|
15
|
+
this.fallbackTestHandler = new (require2("@cedarjs/mailer-handler-in-memory")).InMemoryMailHandler();
|
|
37
16
|
this.logger.warn(
|
|
38
17
|
"Automatically loaded the '@cedarjs/mailer-handler-in-memory' handler, this will be used to process mail in test mode"
|
|
39
18
|
);
|
|
@@ -56,7 +35,7 @@ class Mailer {
|
|
|
56
35
|
const developmentHandlerKey = this.config.development?.handler;
|
|
57
36
|
if (developmentHandlerKey === void 0) {
|
|
58
37
|
try {
|
|
59
|
-
this.fallbackDevelopmentHandler = new (
|
|
38
|
+
this.fallbackDevelopmentHandler = new (require2("@cedarjs/mailer-handler-studio")).StudioMailHandler();
|
|
60
39
|
this.logger.warn(
|
|
61
40
|
"Automatically loaded the '@cedarjs/mailer-handler-studio' handler, this will be used to process mail in development mode"
|
|
62
41
|
);
|
|
@@ -134,7 +113,7 @@ class Mailer {
|
|
|
134
113
|
if (handlerKey === null) {
|
|
135
114
|
return {};
|
|
136
115
|
}
|
|
137
|
-
const completedSendOptions =
|
|
116
|
+
const completedSendOptions = constructCompleteSendOptions(
|
|
138
117
|
sendOptions,
|
|
139
118
|
this.defaults
|
|
140
119
|
);
|
|
@@ -204,7 +183,7 @@ class Mailer {
|
|
|
204
183
|
if (handlerKey === null) {
|
|
205
184
|
return {};
|
|
206
185
|
}
|
|
207
|
-
const completedSendOptions =
|
|
186
|
+
const completedSendOptions = constructCompleteSendOptions(
|
|
208
187
|
sendOptions,
|
|
209
188
|
this.defaults
|
|
210
189
|
);
|
|
@@ -295,7 +274,6 @@ class Mailer {
|
|
|
295
274
|
return this.config.rendering.default;
|
|
296
275
|
}
|
|
297
276
|
}
|
|
298
|
-
|
|
299
|
-
0 && (module.exports = {
|
|
277
|
+
export {
|
|
300
278
|
Mailer
|
|
301
|
-
}
|
|
279
|
+
};
|
package/dist/renderer.js
CHANGED
|
@@ -1,29 +1,5 @@
|
|
|
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);
|
|
24
1
|
class AbstractMailRenderer {
|
|
25
2
|
}
|
|
26
|
-
|
|
27
|
-
0 && (module.exports = {
|
|
3
|
+
export {
|
|
28
4
|
AbstractMailRenderer
|
|
29
|
-
}
|
|
5
|
+
};
|
package/dist/types.js
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
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,29 +1,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 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);
|
|
27
1
|
function convertAddress(address) {
|
|
28
2
|
if (typeof address === "string") {
|
|
29
3
|
return address;
|
|
@@ -123,10 +97,9 @@ function constructCompleteSendOptions(sendOptions, defaults) {
|
|
|
123
97
|
}
|
|
124
98
|
return { ...sendOptionsComplete, from: convertAddress(from), subject };
|
|
125
99
|
}
|
|
126
|
-
|
|
127
|
-
0 && (module.exports = {
|
|
100
|
+
export {
|
|
128
101
|
constructCompleteSendOptions,
|
|
129
102
|
convertAddress,
|
|
130
103
|
convertAddresses,
|
|
131
104
|
extractDefaults
|
|
132
|
-
}
|
|
105
|
+
};
|
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/mailer-core",
|
|
3
|
-
"version": "6.0.0-canary.
|
|
3
|
+
"version": "6.0.0-canary.2756",
|
|
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": "module",
|
|
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",
|
|
18
18
|
"build:pack": "yarn pack -o cedarjs-mailer-core.tgz",
|
|
19
|
-
"build:types": "tsc --build --verbose",
|
|
19
|
+
"build:types": "tsc --build --verbose ./tsconfig.build.json",
|
|
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": "6.0.0-canary.
|
|
27
|
-
"@cedarjs/framework-tools": "6.0.0-canary.
|
|
26
|
+
"@cedarjs/api": "6.0.0-canary.2756",
|
|
27
|
+
"@cedarjs/framework-tools": "6.0.0-canary.2756",
|
|
28
28
|
"typescript": "5.9.3",
|
|
29
29
|
"vitest": "4.1.10"
|
|
30
30
|
},
|