@tgoliveira/outpost 1.2.2 → 2.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.
Files changed (77) hide show
  1. package/AGENTS.md +172 -18
  2. package/README.md +17 -12
  3. package/dist/adapters/drizzle/index.cjs +194 -15
  4. package/dist/adapters/drizzle/index.cjs.map +1 -1
  5. package/dist/adapters/drizzle/index.d.cts +124 -7
  6. package/dist/adapters/drizzle/index.d.ts +124 -7
  7. package/dist/adapters/drizzle/index.js +194 -15
  8. package/dist/adapters/drizzle/index.js.map +1 -1
  9. package/dist/adapters/index.cjs +148 -38
  10. package/dist/adapters/index.cjs.map +1 -1
  11. package/dist/adapters/index.d.cts +21 -13
  12. package/dist/adapters/index.d.ts +21 -13
  13. package/dist/adapters/index.js +149 -39
  14. package/dist/adapters/index.js.map +1 -1
  15. package/dist/admin/index.cjs +10 -3
  16. package/dist/admin/index.cjs.map +1 -1
  17. package/dist/admin/index.d.cts +7 -7
  18. package/dist/admin/index.d.ts +7 -7
  19. package/dist/admin/index.js +10 -3
  20. package/dist/admin/index.js.map +1 -1
  21. package/dist/{fake-BY6t7UXb.d.cts → fake-B6OIEdod.d.ts} +6 -4
  22. package/dist/{fake-en-oOdg0.d.ts → fake-CpQc9p0N.d.cts} +6 -4
  23. package/dist/http/index.cjs.map +1 -1
  24. package/dist/http/index.d.cts +6 -6
  25. package/dist/http/index.d.ts +6 -6
  26. package/dist/http/index.js.map +1 -1
  27. package/dist/{index-c6caPsUG.d.ts → index-B4F7euCt.d.cts} +53 -21
  28. package/dist/{index-BO0GiZmP.d.cts → index-Cn1YsmGe.d.ts} +53 -21
  29. package/dist/index.cjs +509 -146
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +17 -15
  32. package/dist/index.d.ts +17 -15
  33. package/dist/index.js +509 -148
  34. package/dist/index.js.map +1 -1
  35. package/dist/modules/ui/index.cjs +3 -3
  36. package/dist/modules/ui/index.cjs.map +1 -1
  37. package/dist/modules/ui/index.js +3 -3
  38. package/dist/modules/ui/index.js.map +1 -1
  39. package/dist/modules/ui/pages/admin/admin-config-page.cjs +2 -2
  40. package/dist/modules/ui/pages/admin/admin-config-page.cjs.map +1 -1
  41. package/dist/modules/ui/pages/admin/admin-config-page.js +2 -2
  42. package/dist/modules/ui/pages/admin/admin-config-page.js.map +1 -1
  43. package/dist/modules/ui/pages/admin/admin-panel-page.cjs +1 -1
  44. package/dist/modules/ui/pages/admin/admin-panel-page.js +1 -1
  45. package/dist/modules/ui/pages/index.cjs +3 -3
  46. package/dist/modules/ui/pages/index.cjs.map +1 -1
  47. package/dist/modules/ui/pages/index.js +3 -3
  48. package/dist/modules/ui/pages/index.js.map +1 -1
  49. package/dist/{outpost-client-BItbgqIo.d.ts → outpost-client-BX3SsOFb.d.ts} +50 -21
  50. package/dist/{outpost-client-BlVf4gjo.d.cts → outpost-client-DhQgZY16.d.cts} +50 -21
  51. package/dist/react/index.cjs +3 -3
  52. package/dist/react/index.cjs.map +1 -1
  53. package/dist/react/index.js +3 -3
  54. package/dist/react/index.js.map +1 -1
  55. package/dist/repositories-DJYu4nGV.d.ts +322 -0
  56. package/dist/repositories-sMN6RHZJ.d.cts +322 -0
  57. package/dist/{services-CfTEsetF.d.ts → services-DZwZjDn_.d.cts} +9 -3
  58. package/dist/{services-CQINhAGo.d.cts → services-PoM2bxjP.d.ts} +9 -3
  59. package/dist/{template-DxI_p2Ny.d.cts → template-Dl1_ciRo.d.ts} +24 -4
  60. package/dist/{template-CREUq7bB.d.ts → template-Dny_7Ymi.d.cts} +24 -4
  61. package/dist/testing/index.cjs +200 -15
  62. package/dist/testing/index.cjs.map +1 -1
  63. package/dist/testing/index.d.cts +26 -7
  64. package/dist/testing/index.d.ts +26 -7
  65. package/dist/testing/index.js +200 -15
  66. package/dist/testing/index.js.map +1 -1
  67. package/dist/{webhook-kp6CiXk-.d.cts → webhook-B158Vi6p.d.cts} +20 -4
  68. package/dist/{webhook-kp6CiXk-.d.ts → webhook-B158Vi6p.d.ts} +20 -4
  69. package/dist/workers/index.cjs +471 -85
  70. package/dist/workers/index.cjs.map +1 -1
  71. package/dist/workers/index.d.cts +5 -5
  72. package/dist/workers/index.d.ts +5 -5
  73. package/dist/workers/index.js +471 -85
  74. package/dist/workers/index.js.map +1 -1
  75. package/package.json +6 -3
  76. package/dist/repositories-CHIOFGn3.d.cts +0 -182
  77. package/dist/repositories-WyhvxzyY.d.ts +0 -182
@@ -29,9 +29,9 @@
29
29
  declare const LIFECYCLE_STATES: readonly ["queued", "sending", "sent", "delivered", "bounced", "complained", "failed", "suppressed"];
30
30
  type LifecycleState = (typeof LIFECYCLE_STATES)[number];
31
31
  /**
32
- * Terminal states never transition again. The retention worker only ever acts
33
- * on rows in a terminal state (and only after the webhook window has closed),
34
- * which is what makes it safe to run concurrently with the send worker.
32
+ * Terminal states never transition again. Outbox retention acts on a row only
33
+ * while it is terminal and past the webhook window. Aged webhook rows are
34
+ * deleted as well. A non-terminal outbox row stays for the send worker.
35
35
  */
36
36
  declare const TERMINAL_STATES: readonly ["delivered", "bounced", "complained", "failed", "suppressed"];
37
37
  declare function isTerminal(state: LifecycleState): boolean;
@@ -101,6 +101,12 @@ interface Sealed {
101
101
  readonly wrappedKey?: string;
102
102
  /** Identifier of the key/key-version used, for rotation. */
103
103
  readonly keyId?: string;
104
+ /**
105
+ * True when the ciphertext is authenticated to a message id and a column.
106
+ * Absent on envelopes sealed before that binding. Stored in the existing
107
+ * JSON column; it is not a new table column.
108
+ */
109
+ readonly bound?: boolean;
104
110
  }
105
111
  /** The decrypted body handed to the provider at dispatch time. */
106
112
  interface MessageBody {
@@ -134,12 +140,22 @@ interface WebhookEvent {
134
140
  readonly type: WebhookEventType;
135
141
  /** Provider's message id — used to correlate back to the outbox row. */
136
142
  readonly providerMessageId: string;
137
- /** Recipient address as the provider reports it (used to derive the HMAC). */
143
+ /** Address the provider reported. Stored rows omit it. Suppression uses the outbox HMAC. */
138
144
  readonly recipient?: string;
139
145
  /** True for hard bounces; soft bounces should not suppress. */
140
146
  readonly isHardBounce?: boolean;
141
147
  /** Provider's own timestamp for the event, if supplied. */
142
148
  readonly occurredAt?: Date;
149
+ /**
150
+ * Provider's id for this event, when the payload includes one.
151
+ * When set, webhook identity is (provider, providerEventId).
152
+ */
153
+ readonly providerEventId?: string;
154
+ /**
155
+ * Time the adapter associates with verification, such as the signature
156
+ * timestamp. Freshness prefers this over `occurredAt`.
157
+ */
158
+ readonly verifiedAt?: Date;
143
159
  /** Raw provider payload, retained for traceability/replay. */
144
160
  readonly raw: unknown;
145
161
  }