@fonderie/courier 3.0.0 → 5.0.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,26 @@
1
+ -- Version index + revision history for email templates, on the shared
2
+ -- versioned-resource primitive (@fonderie/store). Each edit bumps `version`,
3
+ -- appends a revision, and can be rolled back. `locale` is nullable (NULL = the
4
+ -- base template), so the revisions uniqueness is a COALESCE index, not a PK
5
+ -- (a PRIMARY KEY can't span a nullable column).
6
+
7
+ ALTER TABLE fonderie_courier_templates
8
+ ADD COLUMN IF NOT EXISTS version INT NOT NULL DEFAULT 1,
9
+ ADD COLUMN IF NOT EXISTS updated_by TEXT;
10
+
11
+ CREATE TABLE IF NOT EXISTS fonderie_courier_template_revisions (
12
+ type TEXT NOT NULL,
13
+ locale TEXT,
14
+ subject TEXT,
15
+ html TEXT,
16
+ text TEXT NOT NULL,
17
+ version INT NOT NULL,
18
+ actor TEXT,
19
+ created_at TIMESTAMPTZ NOT NULL DEFAULT now()
20
+ );
21
+
22
+ CREATE UNIQUE INDEX IF NOT EXISTS fonderie_cct_rev_key_ver
23
+ ON fonderie_courier_template_revisions (type, COALESCE(locale, ''), version);
24
+
25
+ CREATE INDEX IF NOT EXISTS fonderie_cct_rev_key
26
+ ON fonderie_courier_template_revisions (type, COALESCE(locale, ''), version DESC);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonderie/courier",
3
- "version": "3.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "Transactional messaging for SaaS — multi-channel delivery (email, SMS, push) with FS or DB templates, per-message-type channel routing, and a persistent message log.",
5
5
  "keywords": [
6
6
  "fonderie-js",
@@ -48,12 +48,12 @@
48
48
  "check": "biome check --write src"
49
49
  },
50
50
  "dependencies": {
51
- "nodemailer": "^8.0.7"
51
+ "nodemailer": "^9.0.3"
52
52
  },
53
53
  "peerDependencies": {
54
- "@fonderie/core": "^0.3.0",
55
- "@fonderie/store": "^0.1.1",
56
- "@fonderie/events": "^3.0.0"
54
+ "@fonderie/core": "^0.5.0",
55
+ "@fonderie/store": "^0.2.0",
56
+ "@fonderie/events": "^5.0.0"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "@fonderie/store": {