@marlinjai/mail-contract 0.9.0 → 0.10.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.
package/dist/index.js CHANGED
@@ -1577,6 +1577,14 @@ var Mailing = import_zod7.z.object({
1577
1577
  * language: without a ready version in it, the main language goes out.
1578
1578
  */
1579
1579
  send_locale: LocaleTag.nullable(),
1580
+ /**
1581
+ * The template's language version the mailing was written from
1582
+ * (`MailingCreate.template_locale`), or null. When set, it equals `locale`
1583
+ * and `send_locale`: the mailing is one letter in that language, and the
1584
+ * template's other versions never go out with it (see "Writing from one
1585
+ * language version" in the contract's documentation).
1586
+ */
1587
+ template_locale: LocaleTag.nullable().default(null),
1580
1588
  /**
1581
1589
  * The topic the mailing is sent under. Null for a letter (a one-to-one
1582
1590
  * mailing with at most one recipient, which belongs to no topic and whose
@@ -1623,10 +1631,14 @@ var MailingCreate = import_zod7.z.object({
1623
1631
  ...MailingContent,
1624
1632
  subject: MailingContent.subject.optional(),
1625
1633
  document: TemplateDocument.optional(),
1626
- template_id: Id.optional()
1634
+ template_id: Id.optional(),
1635
+ template_locale: LocaleTag.optional()
1627
1636
  }).refine((v) => v.document === void 0 !== (v.template_id === void 0), {
1628
1637
  message: "exactly one of document or template_id",
1629
1638
  path: ["document"]
1639
+ }).refine((v) => v.template_locale === void 0 || v.template_id !== void 0, {
1640
+ message: "template_locale names a version of template_id",
1641
+ path: ["template_locale"]
1630
1642
  }).refine((v) => v.template_id !== void 0 || v.subject !== void 0, {
1631
1643
  message: "a mailing made from a document needs a subject",
1632
1644
  path: ["subject"]
package/dist/index.mjs CHANGED
@@ -977,6 +977,14 @@ var Mailing = z7.object({
977
977
  * language: without a ready version in it, the main language goes out.
978
978
  */
979
979
  send_locale: LocaleTag.nullable(),
980
+ /**
981
+ * The template's language version the mailing was written from
982
+ * (`MailingCreate.template_locale`), or null. When set, it equals `locale`
983
+ * and `send_locale`: the mailing is one letter in that language, and the
984
+ * template's other versions never go out with it (see "Writing from one
985
+ * language version" in the contract's documentation).
986
+ */
987
+ template_locale: LocaleTag.nullable().default(null),
980
988
  /**
981
989
  * The topic the mailing is sent under. Null for a letter (a one-to-one
982
990
  * mailing with at most one recipient, which belongs to no topic and whose
@@ -1023,10 +1031,14 @@ var MailingCreate = z7.object({
1023
1031
  ...MailingContent,
1024
1032
  subject: MailingContent.subject.optional(),
1025
1033
  document: TemplateDocument.optional(),
1026
- template_id: Id.optional()
1034
+ template_id: Id.optional(),
1035
+ template_locale: LocaleTag.optional()
1027
1036
  }).refine((v) => v.document === void 0 !== (v.template_id === void 0), {
1028
1037
  message: "exactly one of document or template_id",
1029
1038
  path: ["document"]
1039
+ }).refine((v) => v.template_locale === void 0 || v.template_id !== void 0, {
1040
+ message: "template_locale names a version of template_id",
1041
+ path: ["template_locale"]
1030
1042
  }).refine((v) => v.template_id !== void 0 || v.subject !== void 0, {
1031
1043
  message: "a mailing made from a document needs a subject",
1032
1044
  path: ["subject"]
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.9.0",
6
+ "version": "0.10.0",
7
7
  "description": "The v1 API contract of the mail service: zod schemas and types for every request, response, error and webhook, the route table, and webhook signing helpers",
8
8
  "license": "MIT",
9
9
  "repository": {