@venturekit/notify 0.0.38 → 0.0.40

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.
Files changed (52) hide show
  1. package/README.md +53 -0
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +27 -0
  4. package/dist/client.js.map +1 -1
  5. package/dist/dispatcher.d.ts.map +1 -1
  6. package/dist/dispatcher.js +2 -0
  7. package/dist/dispatcher.js.map +1 -1
  8. package/dist/inbox/digest.d.ts +74 -0
  9. package/dist/inbox/digest.d.ts.map +1 -0
  10. package/dist/inbox/digest.js +110 -0
  11. package/dist/inbox/digest.js.map +1 -0
  12. package/dist/inbox/inbox.d.ts +125 -0
  13. package/dist/inbox/inbox.d.ts.map +1 -0
  14. package/dist/inbox/inbox.js +202 -0
  15. package/dist/inbox/inbox.js.map +1 -0
  16. package/dist/inbox/index.d.ts +5 -0
  17. package/dist/inbox/index.d.ts.map +1 -0
  18. package/dist/inbox/index.js +3 -0
  19. package/dist/inbox/index.js.map +1 -0
  20. package/dist/migrations/vk_notify_003_inbox.sql +59 -0
  21. package/dist/migrations/vk_notify_004_inbox_digest.sql +15 -0
  22. package/dist/migrations/vk_notify_005_cc.sql +13 -0
  23. package/dist/policy/frequency-cap.d.ts +80 -0
  24. package/dist/policy/frequency-cap.d.ts.map +1 -0
  25. package/dist/policy/frequency-cap.js +82 -0
  26. package/dist/policy/frequency-cap.js.map +1 -0
  27. package/dist/policy/index.d.ts +2 -1
  28. package/dist/policy/index.d.ts.map +1 -1
  29. package/dist/policy/index.js +2 -1
  30. package/dist/policy/index.js.map +1 -1
  31. package/dist/policy/string-templates.d.ts +21 -1
  32. package/dist/policy/string-templates.d.ts.map +1 -1
  33. package/dist/policy/string-templates.js +18 -2
  34. package/dist/policy/string-templates.js.map +1 -1
  35. package/dist/providers/email-mailhog.d.ts.map +1 -1
  36. package/dist/providers/email-mailhog.js +16 -6
  37. package/dist/providers/email-mailhog.js.map +1 -1
  38. package/dist/providers/email-ses.d.ts.map +1 -1
  39. package/dist/providers/email-ses.js +3 -2
  40. package/dist/providers/email-ses.js.map +1 -1
  41. package/dist/providers/types.d.ts +6 -0
  42. package/dist/providers/types.d.ts.map +1 -1
  43. package/dist/providers/types.js.map +1 -1
  44. package/dist/store/postgres.d.ts.map +1 -1
  45. package/dist/store/postgres.js +82 -79
  46. package/dist/store/postgres.js.map +1 -1
  47. package/dist/types.d.ts +17 -0
  48. package/dist/types.d.ts.map +1 -1
  49. package/package.json +10 -6
  50. package/src/migrations/vk_notify_003_inbox.sql +59 -0
  51. package/src/migrations/vk_notify_004_inbox_digest.sql +15 -0
  52. package/src/migrations/vk_notify_005_cc.sql +13 -0
@@ -0,0 +1,15 @@
1
+ -- @venturekit/notify — inbox digest cursor.
2
+ --
3
+ -- One row per user the digest cron has e-mailed: where the last digest
4
+ -- stopped (`last_digest_at`, the newest inbox row it included) and how
5
+ -- many digests went out in the current rolling day. `runInboxDigest`
6
+ -- reads it to pick up only what is new and to honour `maxPerUserPerDay`.
7
+
8
+ CREATE TABLE IF NOT EXISTS vk_inbox_digest_cursor (
9
+ user_id TEXT PRIMARY KEY,
10
+ last_digest_at TIMESTAMPTZ NOT NULL,
11
+ sent_today INTEGER NOT NULL DEFAULT 0
12
+ );
13
+
14
+ COMMENT ON TABLE vk_inbox_digest_cursor IS
15
+ 'Per-user cursor for the in-app inbox e-mail digest (runInboxDigest). Owned by @venturekit/notify.';
@@ -0,0 +1,13 @@
1
+ -- @venturekit/notify — carbon copies.
2
+ --
3
+ -- A message sometimes has to reach a second mailbox, visibly, in the same
4
+ -- send: the company's billing address on every invoice it issues, an account
5
+ -- manager on a customer's welcome. That is the provider's `Cc:`, not a second
6
+ -- outbox row — a copy row would be a separate message with its own status,
7
+ -- bounce handling and "sent to" line, and the recipient would never know the
8
+ -- copy existed. E-mail only; every other channel leaves it empty.
9
+ --
10
+ -- Existing rows and every enqueue that says nothing get `{}`.
11
+
12
+ ALTER TABLE vk_notifications
13
+ ADD COLUMN IF NOT EXISTS cc text[] NOT NULL DEFAULT '{}'::text[];