@antelopejs/dms-mailing 0.3.0 → 0.3.2
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/README.md +3 -1
- package/dist/antelope-modules.d.ts +1 -1
- package/dist/antelope-modules.js +1 -1
- package/dist/crons/retention.js +1 -1
- package/dist/crons/retention.js.map +1 -1
- package/dist/data/templates-table.d.ts +1 -1
- package/dist/data/templates-table.js +21 -0
- package/dist/data/templates-table.js.map +1 -1
- package/dist/db/models/sends.model.d.ts +2 -1
- package/dist/db/models/sends.model.js +1 -0
- package/dist/db/models/sends.model.js.map +1 -1
- package/dist/db/models/settings.model.d.ts +1 -1
- package/dist/db/models/settings.model.js +4 -1
- package/dist/db/models/settings.model.js.map +1 -1
- package/dist/db/tables/send-events.table.js +0 -1
- package/dist/db/tables/send-events.table.js.map +1 -1
- package/dist/db/tables/sends.table.js +0 -1
- package/dist/db/tables/sends.table.js.map +1 -1
- package/dist/db/tables/templates.table.js +0 -1
- package/dist/db/tables/templates.table.js.map +1 -1
- package/dist/hooks/tenant-export.js +1 -1
- package/dist/hooks/tenant-export.js.map +1 -1
- package/dist/routes/events.js +2 -2
- package/dist/routes/events.js.map +1 -1
- package/dist/routes/period.js +7 -4
- package/dist/routes/period.js.map +1 -1
- package/dist/services/attention.d.ts +3 -3
- package/dist/services/events.d.ts +1 -1
- package/dist/services/events.js.map +1 -1
- package/dist/services/metrics.d.ts +4 -4
- package/dist/services/settings.d.ts +1 -0
- package/dist/services/settings.js +25 -8
- package/dist/services/settings.js.map +1 -1
- package/dist/test/integration/events.test.js +11 -0
- package/dist/test/integration/events.test.js.map +1 -1
- package/dist/test/integration/sends.test.js +53 -0
- package/dist/test/integration/sends.test.js.map +1 -1
- package/dist/test/integration/settings.test.js +92 -0
- package/dist/test/integration/settings.test.js.map +1 -1
- package/dist/test/integration/templates.test.js +68 -2
- package/dist/test/integration/templates.test.js.map +1 -1
- package/dist/test/unit/period.test.js +17 -0
- package/dist/test/unit/period.test.js.map +1 -1
- package/dist/test/unit/webhook-secret.test.js +1 -0
- package/dist/test/unit/webhook-secret.test.js.map +1 -1
- package/frontend-vue/i18n/locales/mailing-en-GB.json +1 -0
- package/frontend-vue/i18n/locales/mailing-fr-FR.json +1 -0
- package/frontend-vue/package.json +1 -1
- package/frontend-vue/pnpm-lock.yaml +2 -28
- package/package.json +2 -2
- package/src/antelope-modules.ts +1 -1
- package/src/crons/retention.ts +3 -1
- package/src/data/templates-table.ts +46 -0
- package/src/db/models/sends.model.ts +6 -2
- package/src/db/models/settings.model.ts +7 -1
- package/src/db/tables/send-events.table.ts +0 -1
- package/src/db/tables/sends.table.ts +0 -1
- package/src/db/tables/templates.table.ts +0 -1
- package/src/hooks/tenant-export.ts +1 -1
- package/src/routes/events.ts +3 -3
- package/src/routes/metrics.ts +3 -3
- package/src/routes/period.ts +9 -4
- package/src/services/attention.ts +5 -5
- package/src/services/events.ts +4 -4
- package/src/services/metrics.ts +9 -9
- package/src/services/settings.ts +36 -7
- package/src/test/integration/events.test.ts +24 -1
- package/src/test/integration/sends.test.ts +33 -0
- package/src/test/integration/settings.test.ts +78 -0
- package/src/test/integration/templates.test.ts +49 -6
- package/src/test/unit/period.test.ts +27 -0
- package/src/test/unit/webhook-secret.test.ts +1 -0
|
@@ -61,4 +61,31 @@ describe("[unit] period range", () => {
|
|
|
61
61
|
expect(spanDays(previous)).to.equal(MAX_WINDOW_DAYS);
|
|
62
62
|
expect(previous.to.getTime()).to.equal(current.from.getTime());
|
|
63
63
|
});
|
|
64
|
+
|
|
65
|
+
// `compareFrom`/`compareTo` are plain query parameters too, and every metric
|
|
66
|
+
// reads its comparison window from the send log in full.
|
|
67
|
+
it("clamps an explicit comparison window like the current one", () => {
|
|
68
|
+
const current = currentRange(ctxWith({}));
|
|
69
|
+
const previous = comparisonRange(
|
|
70
|
+
ctxWith({
|
|
71
|
+
compareFrom: "1970-01-01T00:00:00.000Z",
|
|
72
|
+
compareTo: "2026-09-01T00:00:00.000Z",
|
|
73
|
+
}),
|
|
74
|
+
current,
|
|
75
|
+
);
|
|
76
|
+
expect(spanDays(previous)).to.equal(MAX_WINDOW_DAYS);
|
|
77
|
+
expect(previous.to.toISOString()).to.equal("2026-09-01T00:00:00.000Z");
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("keeps an explicit comparison window within the cap", () => {
|
|
81
|
+
const current = currentRange(ctxWith({}));
|
|
82
|
+
const previous = comparisonRange(
|
|
83
|
+
ctxWith({
|
|
84
|
+
compareFrom: "2026-08-01T00:00:00.000Z",
|
|
85
|
+
compareTo: "2026-09-01T00:00:00.000Z",
|
|
86
|
+
}),
|
|
87
|
+
current,
|
|
88
|
+
);
|
|
89
|
+
expect(previous.from.toISOString()).to.equal("2026-08-01T00:00:00.000Z");
|
|
90
|
+
});
|
|
64
91
|
});
|
|
@@ -22,6 +22,7 @@ describe("[unit] webhook secret", () => {
|
|
|
22
22
|
expect(webhookSecretMatches("", "")).to.equal(false);
|
|
23
23
|
expect(webhookSecretMatches(undefined, "")).to.equal(false);
|
|
24
24
|
expect(webhookSecretMatches(VALID_SECRET, "")).to.equal(false);
|
|
25
|
+
expect(webhookSecretMatches(VALID_SECRET, undefined)).to.equal(false);
|
|
25
26
|
});
|
|
26
27
|
|
|
27
28
|
it("refuses a missing or wrong header against a real secret", () => {
|