@pithy-sh/email 0.5.0 → 0.7.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.
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH;oFACoF;AACpF,MAAM,WAAW,QAAQ;IACvB,0FAA0F;IAC1F,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8GAA8G;AAC9G,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;IACX,+GAA+G;IAC/G,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;;;;;;;;OASG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,mGAAmG;IACnG,KAAK,EAAE,YAAY,CAAC;IACpB,kFAAkF;IAClF,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC;IACnB,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAsJD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;iBA2ClC,CAAC;AACJ;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAmEhF,0CAA0C;AAC1C,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAwLnD,CAAC"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH;oFACoF;AACpF,MAAM,WAAW,QAAQ;IACvB,0FAA0F;IAC1F,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8GAA8G;AAC9G,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;IACX,+GAA+G;IAC/G,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;;;;;;;;OASG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,mGAAmG;IACnG,KAAK,EAAE,YAAY,CAAC;IACpB,kFAAkF;IAClF,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC;IACnB,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAmRD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;iBA2ClC,CAAC;AACJ;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAmEhF,0CAA0C;AAC1C,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAmUnD,CAAC"}
@@ -81,6 +81,66 @@ const PasswordChangedPayload = z.object({
81
81
  when: z.string().describe("A human-readable timestamp of when the credential changed."),
82
82
  supportUrl: z.string().describe("A link to contact support if the change was not the recipient. Tracked when click tracking is on.")
83
83
  }).describe("Inputs for the account-credential-changed security notice.");
84
+ /**
85
+ * The four account-lifecycle notices `@pithy-sh/auth` sends (#620). Every date arrives already written for
86
+ * the reader — `1 November 2026` — because the sender knows the recipient's locale and this template does
87
+ * not, which is the convention `when` set for `securityAlert`.
88
+ */
89
+ const AccountSuspendedPayload = z.object({
90
+ name: z.string().optional().describe("The recipient's name, for a personal greeting. Optional."),
91
+ reason: z.string().optional().describe("Why the account was suspended, in the operator's words. Rendered escaped, as every payload value is. Omitted when none was given."),
92
+ until: z.string().optional().describe("When the suspension ends by itself, written for the reader. Omitted for one with no end.")
93
+ }).describe("Inputs for the notice that an account was suspended.");
94
+ const AccountReinstatedPayload = z.object({ name: z.string().optional().describe("The recipient's name, for a personal greeting. Optional.") }).describe("Inputs for the notice that a suspension was lifted.");
95
+ const DeletionScheduledPayload = z.object({
96
+ name: z.string().optional().describe("The recipient's name, for a personal greeting. Optional."),
97
+ purgeOn: z.string().describe("The date the account's data will be erased, written for the reader. Until then it can be restored."),
98
+ restoreUrl: z.string().optional().describe("Where the account's owner can restore it inside the window. Tracked when click tracking is on. Omitted when the project offers no self-service restore.")
99
+ }).describe("Inputs for the notice that an account was deleted and will be erased.");
100
+ const DeletionCompletePayload = z.object({
101
+ name: z.string().optional().describe("The recipient's name, for a personal greeting. Optional."),
102
+ purgedOn: z.string().describe("The date the account's data was erased, written for the reader.")
103
+ }).describe("Inputs for the notice that an account's data was erased — sent before the address is.");
104
+ /**
105
+ * The three notices `@pithy-sh/organization` sends when an operator changes somebody's membership through
106
+ * the control plane (#624). Each names the organization, because a person in two accounts must be able to
107
+ * tell which one changed, and none carries the operator's reason: that is the trail's, written for the
108
+ * people who answer for the account, not for the person it happened to.
109
+ */
110
+ const OrganizationMemberAddedPayload = z.object({
111
+ name: z.string().optional().describe("The recipient's name, for a personal greeting. Optional."),
112
+ organizationName: z.string().describe("The organization they were added to, by display name. Tenant text, escaped like every value."),
113
+ role: z.string().describe("The role they hold there now, as the project's catalog names it.")
114
+ }).describe("Inputs for the notice that an operator added somebody to an organization.");
115
+ const OrganizationMemberRemovedPayload = z.object({
116
+ name: z.string().optional().describe("The recipient's name, for a personal greeting. Optional."),
117
+ organizationName: z.string().describe("The organization they were removed from, by display name. Tenant text, escaped like every value.")
118
+ }).describe("Inputs for the notice that an operator removed somebody from an organization.");
119
+ const OrganizationOwnershipTransferredPayload = z.object({
120
+ name: z.string().optional().describe("The recipient's name, for a personal greeting. Optional."),
121
+ organizationName: z.string().describe("The organization they now own, by display name. Tenant text, escaped like every value.")
122
+ }).describe("Inputs for the notice that an operator made somebody the owner of an organization.");
123
+ /**
124
+ * The three notices `@pithy-sh/organization` sends an organization's owners when an operator acts on the
125
+ * organization itself (#623): it was suspended, reinstated, or deleted with a date its data is erased. Each names
126
+ * the organization. The suspension carries the operator's reason, because the suspended screen tells every member
127
+ * the owners were told why.
128
+ */
129
+ const OrganizationSuspendedPayload = z.object({
130
+ name: z.string().optional().describe("The recipient's name, for a personal greeting. Optional."),
131
+ organizationName: z.string().describe("The organization that was suspended, by display name. Tenant text, escaped like every value."),
132
+ reason: z.string().optional().describe("Why it was suspended, in the operator's words. Rendered escaped. Omitted when none was given."),
133
+ until: z.string().optional().describe("When the suspension ends by itself, written for the reader. Omitted for one with no end.")
134
+ }).describe("Inputs for the notice to an owner that their organization was suspended.");
135
+ const OrganizationReinstatedPayload = z.object({
136
+ name: z.string().optional().describe("The recipient's name, for a personal greeting. Optional."),
137
+ organizationName: z.string().describe("The organization that was reinstated, by display name. Tenant text, escaped like every value.")
138
+ }).describe("Inputs for the notice to an owner that their organization's suspension was lifted.");
139
+ const OrganizationDeletionScheduledPayload = z.object({
140
+ name: z.string().optional().describe("The recipient's name, for a personal greeting. Optional."),
141
+ organizationName: z.string().describe("The organization that was deleted, by display name. Tenant text, escaped like every value."),
142
+ purgeOn: z.string().describe("When its data will be erased, written for the reader. Restorable until then.")
143
+ }).describe("Inputs for the notice to an owner that their organization was deleted and when it will be erased.");
84
144
  /** One labeled fact in an operational notice — what makes the notice specific rather than a mood. */
85
145
  const OperationalNoticeFact = z.object({
86
146
  label: z.string().describe("What this fact is: `Environment`, `Last rotated`, `Version`, `Owner`."),
@@ -253,6 +313,119 @@ const templates = {
253
313
  label: "password-support"
254
314
  }]
255
315
  },
316
+ accountSuspended: {
317
+ id: "accountSuspended",
318
+ category: "transactional",
319
+ kind: "transactional",
320
+ width: "narrow",
321
+ payload: AccountSuspendedPayload,
322
+ subject: `{{t "email/account_suspended.subject" app=theme.appName}}`,
323
+ html: layout(`${heading("{{t \"email/account_suspended.heading\"}}")}<p style="margin:0 0 8px">${greeting} {{t "email/account_suspended.body" app=theme.appName}}</p>{{#if reason}}<p style="margin:0 0 8px">{{t "email/account_suspended.reason" reason=reason}}</p>{{/if}}{{#if until}}<p style="margin:0 0 8px">{{t "email/account_suspended.until" until=until}}</p>{{/if}}<p class="t-subtle" style="margin:16px 0 0; font-size:13px; color:{{theme.light.textSubtle}}">{{t "email/account_suspended.contact"}}</p>`),
324
+ text: `${greeting}\n\n{{t "email/account_suspended.text_body" app=theme.appName}}{{#if reason}}\n\n{{t "email/account_suspended.reason" reason=reason}}{{/if}}{{#if until}}\n\n{{t "email/account_suspended.until" until=until}}{{/if}}\n\n{{t "email/account_suspended.text_contact"}}`,
325
+ links: []
326
+ },
327
+ accountReinstated: {
328
+ id: "accountReinstated",
329
+ category: "transactional",
330
+ kind: "transactional",
331
+ width: "narrow",
332
+ payload: AccountReinstatedPayload,
333
+ subject: `{{t "email/account_reinstated.subject" app=theme.appName}}`,
334
+ html: layout(`${heading("{{t \"email/account_reinstated.heading\"}}")}<p style="margin:0 0 8px">${greeting} {{t "email/account_reinstated.body" app=theme.appName}}</p>`),
335
+ text: `${greeting}\n\n{{t "email/account_reinstated.text_body" app=theme.appName}}`,
336
+ links: []
337
+ },
338
+ deletionScheduled: {
339
+ id: "deletionScheduled",
340
+ category: "transactional",
341
+ kind: "transactional",
342
+ width: "narrow",
343
+ payload: DeletionScheduledPayload,
344
+ subject: `{{t "email/deletion_scheduled.subject" app=theme.appName}}`,
345
+ html: layout(`${heading("{{t \"email/deletion_scheduled.heading\"}}")}<p style="margin:0 0 8px">${greeting} {{t "email/deletion_scheduled.body" app=theme.appName}}</p><p style="margin:0 0 8px">{{t "email/deletion_scheduled.purge" purgeOn=purgeOn}}</p>{{#if restoreUrl}}${button("restoreUrl", "{{t \"email/deletion_scheduled.cta\"}}")}{{/if}}<p class="t-subtle" style="margin:16px 0 0; font-size:13px; color:{{theme.light.textSubtle}}">{{t "email/deletion_scheduled.contact" purgeOn=purgeOn}}</p>`),
346
+ text: `${greeting}\n\n{{t "email/deletion_scheduled.text_body" app=theme.appName}}\n\n{{t "email/deletion_scheduled.purge" purgeOn=purgeOn}}{{#if restoreUrl}}\n\n{{t "email/deletion_scheduled.text_restore"}} {{restoreUrl}}{{/if}}\n\n{{t "email/deletion_scheduled.text_contact" purgeOn=purgeOn}}`,
347
+ links: [{
348
+ path: "restoreUrl",
349
+ label: "deletion-restore"
350
+ }]
351
+ },
352
+ deletionComplete: {
353
+ id: "deletionComplete",
354
+ category: "transactional",
355
+ kind: "transactional",
356
+ width: "narrow",
357
+ payload: DeletionCompletePayload,
358
+ subject: `{{t "email/deletion_complete.subject" app=theme.appName}}`,
359
+ html: layout(`${heading("{{t \"email/deletion_complete.heading\"}}")}<p style="margin:0 0 8px">${greeting} {{t "email/deletion_complete.body" app=theme.appName purgedOn=purgedOn}}</p><p class="t-subtle" style="margin:16px 0 0; font-size:13px; color:{{theme.light.textSubtle}}">{{t "email/deletion_complete.last"}}</p>`),
360
+ text: `${greeting}\n\n{{t "email/deletion_complete.text_body" app=theme.appName purgedOn=purgedOn}}\n\n{{t "email/deletion_complete.last"}}`,
361
+ links: []
362
+ },
363
+ organizationMemberAdded: {
364
+ id: "organizationMemberAdded",
365
+ category: "transactional",
366
+ kind: "transactional",
367
+ width: "narrow",
368
+ payload: OrganizationMemberAddedPayload,
369
+ subject: `{{t "email/organization_member_added.subject" organization=organizationName}}`,
370
+ html: layout(`${heading("{{t \"email/organization_member_added.heading\"}}")}<p style="margin:0 0 8px">${greeting} {{t "email/organization_member_added.body" organization=organizationName role=role app=theme.appName}}</p><p class="t-subtle" style="margin:16px 0 0; font-size:13px; color:{{theme.light.textSubtle}}">{{t "email/organization_member.contact"}}</p>`),
371
+ text: `${greeting}\n\n{{t "email/organization_member_added.text_body" organization=organizationName role=role app=theme.appName}}\n\n{{t "email/organization_member.contact"}}`,
372
+ links: []
373
+ },
374
+ organizationMemberRemoved: {
375
+ id: "organizationMemberRemoved",
376
+ category: "transactional",
377
+ kind: "transactional",
378
+ width: "narrow",
379
+ payload: OrganizationMemberRemovedPayload,
380
+ subject: `{{t "email/organization_member_removed.subject" organization=organizationName}}`,
381
+ html: layout(`${heading("{{t \"email/organization_member_removed.heading\"}}")}<p style="margin:0 0 8px">${greeting} {{t "email/organization_member_removed.body" organization=organizationName app=theme.appName}}</p><p class="t-subtle" style="margin:16px 0 0; font-size:13px; color:{{theme.light.textSubtle}}">{{t "email/organization_member.contact"}}</p>`),
382
+ text: `${greeting}\n\n{{t "email/organization_member_removed.text_body" organization=organizationName app=theme.appName}}\n\n{{t "email/organization_member.contact"}}`,
383
+ links: []
384
+ },
385
+ organizationOwnershipTransferred: {
386
+ id: "organizationOwnershipTransferred",
387
+ category: "transactional",
388
+ kind: "transactional",
389
+ width: "narrow",
390
+ payload: OrganizationOwnershipTransferredPayload,
391
+ subject: `{{t "email/organization_ownership_transferred.subject" organization=organizationName}}`,
392
+ html: layout(`${heading("{{t \"email/organization_ownership_transferred.heading\"}}")}<p style="margin:0 0 8px">${greeting} {{t "email/organization_ownership_transferred.body" organization=organizationName app=theme.appName}}</p><p class="t-subtle" style="margin:16px 0 0; font-size:13px; color:{{theme.light.textSubtle}}">{{t "email/organization_member.contact"}}</p>`),
393
+ text: `${greeting}\n\n{{t "email/organization_ownership_transferred.text_body" organization=organizationName app=theme.appName}}\n\n{{t "email/organization_member.contact"}}`,
394
+ links: []
395
+ },
396
+ organizationSuspended: {
397
+ id: "organizationSuspended",
398
+ category: "transactional",
399
+ kind: "transactional",
400
+ width: "narrow",
401
+ payload: OrganizationSuspendedPayload,
402
+ subject: `{{t "email/organization_suspended.subject" organization=organizationName}}`,
403
+ html: layout(`${heading("{{t \"email/organization_suspended.heading\"}}")}<p style="margin:0 0 8px">${greeting} {{t "email/organization_suspended.body" organization=organizationName app=theme.appName}}</p>{{#if reason}}<p style="margin:0 0 8px">{{t "email/organization_suspended.reason" reason=reason}}</p>{{/if}}{{#if until}}<p style="margin:0 0 8px">{{t "email/organization_suspended.until" until=until}}</p>{{/if}}<p class="t-subtle" style="margin:16px 0 0; font-size:13px; color:{{theme.light.textSubtle}}">{{t "email/organization_member.contact"}}</p>`),
404
+ text: `${greeting}\n\n{{t "email/organization_suspended.text_body" organization=organizationName app=theme.appName}}{{#if reason}}\n\n{{t "email/organization_suspended.reason" reason=reason}}{{/if}}{{#if until}}\n\n{{t "email/organization_suspended.until" until=until}}{{/if}}\n\n{{t "email/organization_member.contact"}}`,
405
+ links: []
406
+ },
407
+ organizationReinstated: {
408
+ id: "organizationReinstated",
409
+ category: "transactional",
410
+ kind: "transactional",
411
+ width: "narrow",
412
+ payload: OrganizationReinstatedPayload,
413
+ subject: `{{t "email/organization_reinstated.subject" organization=organizationName}}`,
414
+ html: layout(`${heading("{{t \"email/organization_reinstated.heading\"}}")}<p style="margin:0 0 8px">${greeting} {{t "email/organization_reinstated.body" organization=organizationName app=theme.appName}}</p><p class="t-subtle" style="margin:16px 0 0; font-size:13px; color:{{theme.light.textSubtle}}">{{t "email/organization_member.contact"}}</p>`),
415
+ text: `${greeting}\n\n{{t "email/organization_reinstated.text_body" organization=organizationName app=theme.appName}}\n\n{{t "email/organization_member.contact"}}`,
416
+ links: []
417
+ },
418
+ organizationDeletionScheduled: {
419
+ id: "organizationDeletionScheduled",
420
+ category: "transactional",
421
+ kind: "transactional",
422
+ width: "narrow",
423
+ payload: OrganizationDeletionScheduledPayload,
424
+ subject: `{{t "email/organization_deletion_scheduled.subject" organization=organizationName}}`,
425
+ html: layout(`${heading("{{t \"email/organization_deletion_scheduled.heading\"}}")}<p style="margin:0 0 8px">${greeting} {{t "email/organization_deletion_scheduled.body" organization=organizationName app=theme.appName purgeOn=purgeOn}}</p><p class="t-subtle" style="margin:16px 0 0; font-size:13px; color:{{theme.light.textSubtle}}">{{t "email/organization_deletion_scheduled.contact" purgeOn=purgeOn}}</p>`),
426
+ text: `${greeting}\n\n{{t "email/organization_deletion_scheduled.text_body" organization=organizationName app=theme.appName purgeOn=purgeOn}}\n\n{{t "email/organization_deletion_scheduled.contact" purgeOn=purgeOn}}`,
427
+ links: []
428
+ },
256
429
  operationalNotice: {
257
430
  id: "operationalNotice",
258
431
  category: "transactional",
@@ -1 +1 @@
1
- {"version":3,"file":"samples.d.ts","sourceRoot":"","sources":["../../src/templates/samples.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAkElD,CAAC"}
1
+ {"version":3,"file":"samples.d.ts","sourceRoot":"","sources":["../../src/templates/samples.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAiFlD,CAAC"}
@@ -53,6 +53,49 @@ const samplePayloads = {
53
53
  when: "just now",
54
54
  supportUrl: "https://example.com/support"
55
55
  },
56
+ accountSuspended: {
57
+ name: "Sam",
58
+ reason: "A payment is under review.",
59
+ until: "1 November 2026"
60
+ },
61
+ accountReinstated: { name: "Sam" },
62
+ deletionScheduled: {
63
+ name: "Sam",
64
+ purgeOn: "19 November 2026",
65
+ restoreUrl: "https://example.com/account/restore"
66
+ },
67
+ deletionComplete: {
68
+ name: "Sam",
69
+ purgedOn: "19 November 2026"
70
+ },
71
+ organizationMemberAdded: {
72
+ name: "Sam",
73
+ organizationName: "Globex",
74
+ role: "admin"
75
+ },
76
+ organizationMemberRemoved: {
77
+ name: "Sam",
78
+ organizationName: "Globex"
79
+ },
80
+ organizationOwnershipTransferred: {
81
+ name: "Sam",
82
+ organizationName: "Globex"
83
+ },
84
+ organizationSuspended: {
85
+ name: "Sam",
86
+ organizationName: "Globex",
87
+ reason: "The invoice for October is unpaid.",
88
+ until: "19 November 2026"
89
+ },
90
+ organizationReinstated: {
91
+ name: "Sam",
92
+ organizationName: "Globex"
93
+ },
94
+ organizationDeletionScheduled: {
95
+ name: "Sam",
96
+ organizationName: "Globex",
97
+ purgeOn: "19 November 2026"
98
+ },
56
99
  operationalNotice: {
57
100
  severity: "warning",
58
101
  summary: "A secret has not been rotated in 90 days",
@@ -3,5 +3,5 @@
3
3
  /** This package's npm name — the join key against a release feed. */
4
4
  export declare const PACKAGE_NAME = "@pithy-sh/email";
5
5
  /** This package's version, stamped from its own package.json at generation time. */
6
- export declare const PACKAGE_VERSION = "0.5.0";
6
+ export declare const PACKAGE_VERSION = "0.7.0";
7
7
  //# sourceMappingURL=version.generated.d.ts.map
@@ -4,6 +4,6 @@
4
4
  /** This package's npm name — the join key against a release feed. */
5
5
  const PACKAGE_NAME = "@pithy-sh/email";
6
6
  /** This package's version, stamped from its own package.json at generation time. */
7
- const PACKAGE_VERSION = "0.5.0";
7
+ const PACKAGE_VERSION = "0.7.0";
8
8
  //#endregion
9
9
  export { PACKAGE_NAME, PACKAGE_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pithy-sh/email",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,8 +42,8 @@
42
42
  "postal-mime": "^3.0.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@pithy-sh/core": "^0.11.0",
46
- "@pithy-sh/secrets": "^0.5.0",
45
+ "@pithy-sh/core": "^0.13.0",
46
+ "@pithy-sh/secrets": "^0.6.1",
47
47
  "hono": "^4.13.2",
48
48
  "kysely": "^0.29.0",
49
49
  "zod": "^4.4.0"
@@ -3,6 +3,7 @@
3
3
 
4
4
  import { PithyError } from "@pithy-sh/core/src/error/pithyError";
5
5
  import type { MessageParams } from "@pithy-sh/core/src/i18n/catalog";
6
+ import type { UnmarkedString } from "@pithy-sh/core/src/privacy/types";
6
7
 
7
8
  /**
8
9
  * `@pithy-sh/email` throw sugar. The `email/*` codes live in core's closed `KitErrorPayload` union
@@ -14,11 +15,11 @@ import type { MessageParams } from "@pithy-sh/core/src/i18n/catalog";
14
15
  /** Variable parts each subclass accepts; `code`/`status` are fixed by the subclass. */
15
16
  interface EmailErrorArgs {
16
17
  /** Override the public, safe-to-expose message. */
17
- message?: string;
18
+ message?: UnmarkedString;
18
19
  /** A remediation hint (CLI action line). */
19
- action?: string;
20
+ action?: UnmarkedString;
20
21
  /** Internal context for logs + audit. Never serialized to clients. */
21
- detail?: string;
22
+ detail?: UnmarkedString;
22
23
  /**
23
24
  * Values a translating client interpolates into its own wording for this code. Client-facing, so —
24
25
  * unlike `action` and `detail` — these cross the boundary with `message`.
@@ -100,6 +100,83 @@ export const EMAIL_ES: MessageCatalog = {
100
100
  "email/password_changed.text_body":
101
101
  "Las credenciales de tu cuenta cambiaron el {when}. Si no fuiste tú, contacta con soporte:",
102
102
 
103
+ // --- The account lifecycle ---
104
+ "email/account_suspended.subject": "Tu cuenta de {app} está suspendida",
105
+ "email/account_suspended.heading": "Tu cuenta está suspendida",
106
+ "email/account_suspended.body":
107
+ "tu cuenta de {app} está suspendida. No puedes iniciar sesión hasta que se levante la suspensión.",
108
+ "email/account_suspended.text_body":
109
+ "Tu cuenta de {app} está suspendida. No puedes iniciar sesión hasta que se levante la suspensión.",
110
+ "email/account_suspended.reason": "El motivo indicado: {reason}",
111
+ "email/account_suspended.until": "Termina el {until}.",
112
+ "email/account_suspended.contact": "Si crees que es un error, responde a este correo.",
113
+ "email/account_suspended.text_contact": "Si crees que es un error, responde a este correo.",
114
+
115
+ "email/account_reinstated.subject": "Tu cuenta de {app} vuelve a estar activa",
116
+ "email/account_reinstated.heading": "Tu cuenta vuelve a estar activa",
117
+ "email/account_reinstated.body":
118
+ "se ha levantado la suspensión de tu cuenta de {app}. Ya puedes volver a iniciar sesión.",
119
+ "email/account_reinstated.text_body":
120
+ "Se ha levantado la suspensión de tu cuenta de {app}. Ya puedes volver a iniciar sesión.",
121
+
122
+ "email/deletion_scheduled.subject": "Tu cuenta de {app} se ha eliminado",
123
+ "email/deletion_scheduled.heading": "Tu cuenta se ha eliminado",
124
+ "email/deletion_scheduled.body": "tu cuenta de {app} se ha eliminado y ya no puedes iniciar sesión.",
125
+ "email/deletion_scheduled.text_body": "Tu cuenta de {app} se ha eliminado y ya no puedes iniciar sesión.",
126
+ "email/deletion_scheduled.purge": "Tus datos se borrarán el {purgeOn}. Hasta entonces, la cuenta se puede recuperar.",
127
+ "email/deletion_scheduled.cta": "Recuperar mi cuenta",
128
+ "email/deletion_scheduled.text_restore": "Recupérala:",
129
+ "email/deletion_scheduled.contact": "Si no lo pediste tú, responde a este correo antes del {purgeOn}.",
130
+ "email/deletion_scheduled.text_contact": "Si no lo pediste tú, responde a este correo antes del {purgeOn}.",
131
+
132
+ "email/deletion_complete.subject": "Tus datos de {app} se han borrado",
133
+ "email/deletion_complete.heading": "Tus datos se han borrado",
134
+ "email/deletion_complete.body": "tu cuenta de {app} y sus datos se borraron el {purgedOn}. No se puede deshacer.",
135
+ "email/deletion_complete.text_body":
136
+ "Tu cuenta de {app} y sus datos se borraron el {purgedOn}. No se puede deshacer.",
137
+ "email/deletion_complete.last": "Es el último correo que recibirá esta cuenta.",
138
+
139
+ // --- Administración de la pertenencia ---
140
+ "email/organization_member_added.subject": "Te han añadido a {organization}",
141
+ "email/organization_member_added.heading": "Te han añadido a una organización",
142
+ "email/organization_member_added.body": "te han añadido a {organization} en {app}, con la función {role}.",
143
+ "email/organization_member_added.text_body": "Te han añadido a {organization} en {app}, con la función {role}.",
144
+ "email/organization_member_removed.subject": "Te han quitado de {organization}",
145
+ "email/organization_member_removed.heading": "Te han quitado de una organización",
146
+ "email/organization_member_removed.body": "te han quitado de {organization} en {app}. Ya no puedes actuar en ella.",
147
+ "email/organization_member_removed.text_body":
148
+ "Te han quitado de {organization} en {app}. Ya no puedes actuar en ella.",
149
+ "email/organization_ownership_transferred.subject": "Ahora eres titular de {organization}",
150
+ "email/organization_ownership_transferred.heading": "Ahora eres titular de una organización",
151
+ "email/organization_ownership_transferred.body":
152
+ "ahora eres titular de {organization} en {app}. La administras y respondes por ella.",
153
+ "email/organization_ownership_transferred.text_body":
154
+ "Ahora eres titular de {organization} en {app}. La administras y respondes por ella.",
155
+ "email/organization_member.contact": "Si no lo esperabas, responde a este correo.",
156
+
157
+ // --- Ciclo de vida de la organización ---
158
+ "email/organization_suspended.subject": "{organization} está suspendida",
159
+ "email/organization_suspended.heading": "Tu organización está suspendida",
160
+ "email/organization_suspended.body":
161
+ "{organization} en {app} está suspendida. Nadie puede actuar en ella hasta que se restablezca. Tu propia cuenta no se ve afectada.",
162
+ "email/organization_suspended.text_body":
163
+ "{organization} en {app} está suspendida. Nadie puede actuar en ella hasta que se restablezca. Tu propia cuenta no se ve afectada.",
164
+ "email/organization_suspended.reason": "El motivo indicado: {reason}",
165
+ "email/organization_suspended.until": "Termina el {until}.",
166
+ "email/organization_reinstated.subject": "{organization} está restablecida",
167
+ "email/organization_reinstated.heading": "Tu organización está restablecida",
168
+ "email/organization_reinstated.body":
169
+ "{organization} en {app} está restablecida. Sus miembros pueden volver a actuar en ella.",
170
+ "email/organization_reinstated.text_body":
171
+ "{organization} en {app} está restablecida. Sus miembros pueden volver a actuar en ella.",
172
+ "email/organization_deletion_scheduled.subject": "{organization} está eliminada",
173
+ "email/organization_deletion_scheduled.heading": "Tu organización está eliminada",
174
+ "email/organization_deletion_scheduled.body":
175
+ "{organization} en {app} está eliminada. Nadie puede actuar en ella, y sus datos se borrarán el {purgeOn}.",
176
+ "email/organization_deletion_scheduled.text_body":
177
+ "{organization} en {app} está eliminada. Nadie puede actuar en ella, y sus datos se borrarán el {purgeOn}.",
178
+ "email/organization_deletion_scheduled.contact": "Para conservarla, responde a este correo antes del {purgeOn}.",
179
+
103
180
  // --- leadCapture ---
104
181
  "email/lead_capture.subject": "Tu descarga: {asset}",
105
182
  "email/lead_capture.heading": "Tu descarga está lista",
@@ -44,14 +44,14 @@ import { EMAIL_ES } from "./messages.es";
44
44
  *
45
45
  * ## Only the kit's own copy
46
46
  *
47
- * Seven templates are here. The five whose words arrive as payload — `testerNudge`, `supportReply`,
47
+ * Eleven templates are here. The five whose words arrive as payload — `testerNudge`, `supportReply`,
48
48
  * `operationalNotice`, `newsletter`, `marketingCampaign` — are the adopter's copy, chosen by a human
49
49
  * for one message, and a catalog cannot translate a sentence it has never seen. Their **shell** still
50
50
  * follows the job's locale (the severity word, the footer, the document's `lang` and `dir`), so a
51
51
  * notice at locale `es` reads its severity in Spanish and its summary in whatever the caller wrote.
52
52
  */
53
53
 
54
- /** The kit's English for every string the seven kit-authored templates and the shared shell render. */
54
+ /** The kit's English for every string the eleven kit-authored templates and the shared shell render. */
55
55
  const EMAIL_EN: MessageCatalog = {
56
56
  // --- The shared shell ---
57
57
  // The greeting is two keys rather than one with an optional placeholder, because a language that
@@ -123,6 +123,84 @@ const EMAIL_EN: MessageCatalog = {
123
123
  "email/password_changed.text_body":
124
124
  "Your account credentials were changed on {when}. If this wasn't you, contact support:",
125
125
 
126
+ // --- The account lifecycle (#620) ---
127
+ // Each says what happened, what it means, and who to answer. The answer is a reply: the mail comes from the
128
+ // adopter's own address, so a reply reaches the people who can act on it.
129
+ "email/account_suspended.subject": "Your {app} account is suspended",
130
+ "email/account_suspended.heading": "Your account is suspended",
131
+ "email/account_suspended.body": "your {app} account is suspended. You cannot sign in until it is lifted.",
132
+ "email/account_suspended.text_body": "Your {app} account is suspended. You cannot sign in until it is lifted.",
133
+ "email/account_suspended.reason": "The reason given: {reason}",
134
+ "email/account_suspended.until": "It ends on {until}.",
135
+ "email/account_suspended.contact": "If you think this is a mistake, reply to this email.",
136
+ "email/account_suspended.text_contact": "If you think this is a mistake, reply to this email.",
137
+
138
+ "email/account_reinstated.subject": "Your {app} account is back",
139
+ "email/account_reinstated.heading": "Your account is back",
140
+ "email/account_reinstated.body": "the suspension on your {app} account is lifted. You can sign in again.",
141
+ "email/account_reinstated.text_body": "The suspension on your {app} account is lifted. You can sign in again.",
142
+
143
+ "email/deletion_scheduled.subject": "Your {app} account is deleted",
144
+ "email/deletion_scheduled.heading": "Your account is deleted",
145
+ "email/deletion_scheduled.body": "your {app} account is deleted, and you can no longer sign in.",
146
+ "email/deletion_scheduled.text_body": "Your {app} account is deleted, and you can no longer sign in.",
147
+ "email/deletion_scheduled.purge": "Your data will be erased on {purgeOn}. Until then, the account can be restored.",
148
+ "email/deletion_scheduled.cta": "Restore my account",
149
+ "email/deletion_scheduled.text_restore": "Restore it:",
150
+ "email/deletion_scheduled.contact": "If you did not ask for this, reply to this email before {purgeOn}.",
151
+ "email/deletion_scheduled.text_contact": "If you did not ask for this, reply to this email before {purgeOn}.",
152
+
153
+ "email/deletion_complete.subject": "Your {app} data is erased",
154
+ "email/deletion_complete.heading": "Your data is erased",
155
+ "email/deletion_complete.body": "your {app} account and its data were erased on {purgedOn}. This cannot be undone.",
156
+ "email/deletion_complete.text_body":
157
+ "Your {app} account and its data were erased on {purgedOn}. This cannot be undone.",
158
+ "email/deletion_complete.last": "This is the last email this account will receive.",
159
+
160
+ // --- Membership administration (#624) ---
161
+ // An operator changed somebody's membership. Each names the organization, because a person in two
162
+ // accounts has to know which one changed, and closes on who to answer.
163
+ "email/organization_member_added.subject": "You were added to {organization}",
164
+ "email/organization_member_added.heading": "You were added to an organization",
165
+ "email/organization_member_added.body": "you were added to {organization} on {app}, as {role}.",
166
+ "email/organization_member_added.text_body": "You were added to {organization} on {app}, as {role}.",
167
+ "email/organization_member_removed.subject": "You were removed from {organization}",
168
+ "email/organization_member_removed.heading": "You were removed from an organization",
169
+ "email/organization_member_removed.body":
170
+ "you were removed from {organization} on {app}. You can no longer act in it.",
171
+ "email/organization_member_removed.text_body":
172
+ "You were removed from {organization} on {app}. You can no longer act in it.",
173
+ "email/organization_ownership_transferred.subject": "You now own {organization}",
174
+ "email/organization_ownership_transferred.heading": "You now own an organization",
175
+ "email/organization_ownership_transferred.body":
176
+ "you are now the owner of {organization} on {app}. You administer it, and you answer for it.",
177
+ "email/organization_ownership_transferred.text_body":
178
+ "You are now the owner of {organization} on {app}. You administer it, and you answer for it.",
179
+ "email/organization_member.contact": "If you did not expect this, reply to this email.",
180
+
181
+ // --- The organization lifecycle (#623) ---
182
+ // To an owner, when an operator acts on the organization itself. Each names it, and says the owner's own
183
+ // account is not what changed.
184
+ "email/organization_suspended.subject": "{organization} is suspended",
185
+ "email/organization_suspended.heading": "Your organization is suspended",
186
+ "email/organization_suspended.body":
187
+ "{organization} on {app} is suspended. Nobody can act in it until it is reinstated. Your own account is not affected.",
188
+ "email/organization_suspended.text_body":
189
+ "{organization} on {app} is suspended. Nobody can act in it until it is reinstated. Your own account is not affected.",
190
+ "email/organization_suspended.reason": "The reason given: {reason}",
191
+ "email/organization_suspended.until": "It ends on {until}.",
192
+ "email/organization_reinstated.subject": "{organization} is reinstated",
193
+ "email/organization_reinstated.heading": "Your organization is reinstated",
194
+ "email/organization_reinstated.body": "{organization} on {app} is reinstated. Its members can act in it again.",
195
+ "email/organization_reinstated.text_body": "{organization} on {app} is reinstated. Its members can act in it again.",
196
+ "email/organization_deletion_scheduled.subject": "{organization} is deleted",
197
+ "email/organization_deletion_scheduled.heading": "Your organization is deleted",
198
+ "email/organization_deletion_scheduled.body":
199
+ "{organization} on {app} is deleted. Nobody can act in it, and its data will be erased on {purgeOn}.",
200
+ "email/organization_deletion_scheduled.text_body":
201
+ "{organization} on {app} is deleted. Nobody can act in it, and its data will be erased on {purgeOn}.",
202
+ "email/organization_deletion_scheduled.contact": "To keep it, reply to this email before {purgeOn}.",
203
+
126
204
  // --- leadCapture ---
127
205
  "email/lead_capture.subject": "Your download: {asset}",
128
206
  "email/lead_capture.heading": "Your download is ready",