@contentgrowth/content-emailing 0.7.7 → 0.7.8
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/backend/index.cjs +32 -2
- package/dist/backend/index.cjs.map +1 -1
- package/dist/backend/index.js +32 -2
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/routes/index.cjs +4 -4
- package/dist/backend/routes/index.cjs.map +1 -1
- package/dist/backend/routes/index.d.cts +12 -12
- package/dist/backend/routes/index.d.ts +12 -12
- package/dist/backend/routes/index.js +4 -4
- package/dist/backend/routes/index.js.map +1 -1
- package/dist/index.cjs +32 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/backend/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ __export(backend_exports, {
|
|
|
35
35
|
createDOCacheProvider: () => createDOCacheProvider,
|
|
36
36
|
createEmailLoggerCallback: () => createEmailLoggerCallback,
|
|
37
37
|
createEmailRoutes: () => createEmailRoutes,
|
|
38
|
-
createTemplateRoutes: () =>
|
|
38
|
+
createTemplateRoutes: () => createTemplateRoutes,
|
|
39
39
|
createTrackingRoutes: () => createTrackingRoutes,
|
|
40
40
|
encodeTrackingLinks: () => encodeTrackingLinks,
|
|
41
41
|
extractVariables: () => extractVariables,
|
|
@@ -1471,7 +1471,7 @@ function createSettingsRoutes(config = {}) {
|
|
|
1471
1471
|
|
|
1472
1472
|
// src/backend/routes/templates.js
|
|
1473
1473
|
var import_hono2 = require("hono");
|
|
1474
|
-
function
|
|
1474
|
+
function createTemplateRoutes(config = {}) {
|
|
1475
1475
|
const app = new import_hono2.Hono();
|
|
1476
1476
|
app.get("/", async (c) => {
|
|
1477
1477
|
const emailService = new EmailService(c.env, config);
|
|
@@ -1728,6 +1728,36 @@ function createTrackingRoutes(env, config = {}) {
|
|
|
1728
1728
|
|
|
1729
1729
|
// src/backend/routes/logs.js
|
|
1730
1730
|
var import_hono4 = require("hono");
|
|
1731
|
+
function createLogRoutes(config = {}) {
|
|
1732
|
+
const app = new import_hono4.Hono();
|
|
1733
|
+
app.get("/", async (c) => {
|
|
1734
|
+
const limit = Math.min(parseInt(c.req.query("limit") || "50"), 100);
|
|
1735
|
+
const offset = parseInt(c.req.query("offset") || "0");
|
|
1736
|
+
const env = c.env;
|
|
1737
|
+
try {
|
|
1738
|
+
const table = `${config.emailTablePrefix || "system_email_"}logs`;
|
|
1739
|
+
const { results } = await env.DB.prepare(`
|
|
1740
|
+
SELECT * FROM ${table}
|
|
1741
|
+
ORDER BY created_at DESC
|
|
1742
|
+
LIMIT ? OFFSET ?
|
|
1743
|
+
`).bind(limit, offset).all();
|
|
1744
|
+
const countResult = await env.DB.prepare(`SELECT COUNT(*) as exact_count FROM ${table}`).first();
|
|
1745
|
+
return c.json({
|
|
1746
|
+
logs: results.map((row) => ({
|
|
1747
|
+
...row,
|
|
1748
|
+
metadata: row.metadata ? JSON.parse(row.metadata) : null
|
|
1749
|
+
})),
|
|
1750
|
+
total: countResult.exact_count,
|
|
1751
|
+
limit,
|
|
1752
|
+
offset
|
|
1753
|
+
});
|
|
1754
|
+
} catch (error) {
|
|
1755
|
+
console.error("Failed to fetch logs:", error);
|
|
1756
|
+
return c.json({ error: "Failed to fetch logs" }, 500);
|
|
1757
|
+
}
|
|
1758
|
+
});
|
|
1759
|
+
return app;
|
|
1760
|
+
}
|
|
1731
1761
|
|
|
1732
1762
|
// src/backend/routes/index.js
|
|
1733
1763
|
function createEmailRoutes(config = {}, cacheProvider = null) {
|