@nxgt/janus-mail 0.9.0 → 0.9.1

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/README.md CHANGED
@@ -94,7 +94,7 @@ class. To retry a `MailFailure` or trace each send, wrap the mailer you pass:
94
94
  | `twoFactorEnabled(to)` | A notice: two-factor authentication was turned on, with `links.secureAccount()` | `to.email` |
95
95
  | `twoFactorDisabled(to)` | A notice: two-factor authentication was turned off, with `links.secureAccount()` | `to.email` |
96
96
  | `recoveryCodeUsed(to, { when, recoveryCodesLeft })` | A notice: a recovery code was used, `when`, and how many are left — "You have 9 recovery codes left." — with `links.recoveryCodes()`, else `links.secureAccount()` | `to.email` |
97
- | `newSignIn(to, { device, time, location? })` | A notice: the account was signed in from a new device — which device, `time`, and `location`, `—` when left out — with `links.secureAccount()` | `to.email` |
97
+ | `newSignIn(to, { device, time, location? })` | A notice: the account was signed in from a new device — which device, `time`, and `location`, "Unknown" ("Inconnu") when left out — with `links.secureAccount()` | `to.email` |
98
98
  | `welcome(to)` | A welcome to a new user — "Welcome, Ada" — with `links.getStarted()` | `to.email` |
99
99
 
100
100
  The five e-mails of a link or a code say how long it lasts — "This link
@@ -328,7 +328,8 @@ const auth = janus({
328
328
  Every value is your text, in the recipient's locale: `device` described
329
329
  from the request's `User-Agent`, `time` formatted in their time zone.
330
330
  **`@nxgt/janus` sees no IP**, so `location` is yours to work out — from a
331
- geo-IP of your own — and an e-mail without one shows `—` in its place. The
331
+ geo-IP of your own — and an e-mail without one says "Unknown" in its
332
+ place: `Location Unknown`, `Lieu Inconnu` in French. The
332
333
  button links to `links.secureAccount()`.
333
334
 
334
335
  ### Replacing a template
@@ -423,7 +424,7 @@ can carry the token.
423
424
  nothing answers `null`, which is a compile error here and, in JavaScript,
424
425
  `janusMail.newSignIn: location must be a string`: spread it in only when it
425
426
  is a string — `...(city === null ? {} : { location: city })` — and the
426
- e-mail shows `—`.
427
+ e-mail says "Unknown" in the recipient's locale.
427
428
 
428
429
  **Check `via` before `stepUp`.** `auth.stepUp.request(user)` answers
429
430
  `via: 'secondFactor'` — no code, no address — for a user whose second
package/dist/index.js CHANGED
@@ -117,27 +117,42 @@ function expiringMails(options) {
117
117
  };
118
118
  }
119
119
 
120
+ // src/no-location.ts
121
+ var NO_LOCATION = Object.freeze({
122
+ en: "Unknown",
123
+ fr: "Inconnu"
124
+ });
125
+ function isBuilt(locale) {
126
+ return Object.hasOwn(NO_LOCATION, locale);
127
+ }
128
+ function noLocationText(locale) {
129
+ if (isBuilt(locale))
130
+ return NO_LOCATION[locale];
131
+ const { language } = new Intl.Locale(locale);
132
+ return isBuilt(language) ? NO_LOCATION[language] : NO_LOCATION.en;
133
+ }
134
+
120
135
  // src/new-sign-in-mail.ts
121
136
  var METHOD = "newSignIn";
122
- var NO_LOCATION = "—";
123
- function locationOf(signIn) {
137
+ function locationOf(signIn, locale) {
124
138
  const given = typeof signIn === "object" && signIn !== null ? signIn.location : undefined;
125
139
  if (given === undefined)
126
- return NO_LOCATION;
140
+ return noLocationText(locale);
127
141
  return field(METHOD, signIn, "location");
128
142
  }
129
143
  function newSignInMail(options) {
130
144
  const { brand, links } = options;
131
145
  return {
132
146
  async newSignIn(to, signIn) {
147
+ const locale = localeFor(options, to);
133
148
  return send(options, METHOD, field(METHOD, to, "email"), {
134
149
  brand,
135
150
  name: field(METHOD, to, "name"),
136
151
  device: field(METHOD, signIn, "device"),
137
- location: locationOf(signIn),
152
+ location: locationOf(signIn, locale),
138
153
  time: field(METHOD, signIn, "time"),
139
154
  link: link(METHOD, links.secureAccount(), "secureAccount()"),
140
- locale: localeFor(options, to)
155
+ locale
141
156
  });
142
157
  }
143
158
  };
@@ -503,5 +518,5 @@ export {
503
518
  janusTemplates
504
519
  };
505
520
 
506
- //# debugId=F5414A38AA5F17CC64756E2164756E21
521
+ //# debugId=7D22DD84967F5A2664756E2164756E21
507
522
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/expiry.ts", "../src/send.ts", "../src/expiring-mails.ts", "../src/new-sign-in-mail.ts", "../src/notice-mails.ts", "../src/generated/locales.ts", "../src/refuse.ts", "../src/links.ts", "../src/mails.ts", "../src/templates.ts", "../src/options.ts", "../src/generated/codes-left.ts", "../src/codes-left.ts", "../src/recovery-mail.ts", "../src/step-up-mail.ts", "../src/janus-mail.ts"],
3
+ "sources": ["../src/expiry.ts", "../src/send.ts", "../src/expiring-mails.ts", "../src/no-location.ts", "../src/new-sign-in-mail.ts", "../src/notice-mails.ts", "../src/generated/locales.ts", "../src/refuse.ts", "../src/links.ts", "../src/mails.ts", "../src/templates.ts", "../src/options.ts", "../src/generated/codes-left.ts", "../src/codes-left.ts", "../src/recovery-mail.ts", "../src/step-up-mail.ts", "../src/janus-mail.ts"],
4
4
  "sourcesContent": [
5
5
  "/**\n * `expiresIn`: how long the link or the code of an e-mail stays valid, as\n * the text the e-mail shows — \"1 hour\", \"1 heure\". Derived from the\n * `expiresAt` the flow answered and the locale the recipient gets, unless the\n * send passes its own.\n */\nimport type { Clock } from '@nxgt/janus';\n\nconst MINUTE_MS = 60_000;\nconst MINUTES_IN_HOUR = 60;\nconst MINUTES_IN_DAY = 24 * MINUTES_IN_HOUR;\n\n/**\n * A duration in the locale, in the largest unit it holds at least once:\n * rounded to the minute first — the flow set `expiresAt` a moment before the\n * send, so an hour is 59 minutes and 59 seconds by then — and then down to a\n * whole unit: 90 minutes is \"1 hour\", 36 hours \"1 day\". At 30 seconds or\n * more, the e-mail never promises more than half a minute beyond what is\n * left; under that, it says \"1 minute\".\n *\n * ```ts\n * formatExpiry(3_600_000, 'fr'); // '1 heure'\n * ```\n */\nexport function formatExpiry(ms: number, locale: string): string {\n\tconst minutes = Math.max(1, Math.round(ms / MINUTE_MS));\n\tconst [value, unit] =\n\t\tminutes >= MINUTES_IN_DAY\n\t\t\t? [Math.floor(minutes / MINUTES_IN_DAY), 'day']\n\t\t\t: minutes >= MINUTES_IN_HOUR\n\t\t\t\t? [Math.floor(minutes / MINUTES_IN_HOUR), 'hour']\n\t\t\t\t: [minutes, 'minute'];\n\treturn new Intl.NumberFormat(locale, {\n\t\tstyle: 'unit',\n\t\tunit,\n\t\tunitDisplay: 'long',\n\t}).format(value);\n}\n\n/** The per-send `expiresIn`, when one was passed, or `undefined`; a `TypeError` when it is not a string. */\nfunction passedExpiresIn(method: string, options: unknown): string | undefined {\n\tconst read =\n\t\ttypeof options === 'object' && options !== null\n\t\t\t? (options as { expiresIn?: unknown }).expiresIn\n\t\t\t: undefined;\n\tif (read !== undefined && typeof read !== 'string') {\n\t\tthrow new TypeError(`janusMail.${method}: expiresIn must be a string`);\n\t}\n\treturn read;\n}\n\n/**\n * The `expiresIn` of one send: the one passed, as is, or the time left\n * until the flow's `expiresAt` by `clock` — the one given to `janus()`, when\n * it was given to `janusMail()` too — in `locale`. A `TypeError` naming the method\n * when `expiresAt` is not a valid `Date` — a flow's answer that went through\n * JSON holds a string there — or is already past.\n */\nexport function expiresInFor(\n\tmethod: string,\n\tissued: unknown,\n\tlocale: string,\n\toptions: unknown,\n\tclock: Clock,\n): string {\n\tconst passed = passedExpiresIn(method, options);\n\tif (passed !== undefined) return passed;\n\tconst expiresAt =\n\t\ttypeof issued === 'object' && issued !== null\n\t\t\t? (issued as { expiresAt?: unknown }).expiresAt\n\t\t\t: undefined;\n\tif (!(expiresAt instanceof Date) || Number.isNaN(expiresAt.getTime())) {\n\t\tthrow new TypeError(`janusMail.${method}: expiresAt must be a Date`);\n\t}\n\tconst now = clock.now();\n\tif (!(now instanceof Date) || Number.isNaN(now.getTime())) {\n\t\tthrow new TypeError(`janusMail.${method}: clock.now() must answer a Date`);\n\t}\n\tconst left = expiresAt.getTime() - now.getTime();\n\tif (left <= 0) {\n\t\tthrow new TypeError(\n\t\t\t`janusMail.${method}: expiresAt is past — the link or code would not work`,\n\t\t);\n\t}\n\treturn formatExpiry(left, locale);\n}\n",
6
6
  "/**\n * What every method shares: reading an argument's fields, a link, the\n * recipient's locale, and the send itself. A wrong argument is a `TypeError`\n * naming the method and the field — never its value.\n */\nimport type { Address, Rendered, SentMail, WantedLocales } from '@nxgt/mail';\nimport { pickLocale } from '@nxgt/mail';\nimport type { ResolvedOptions } from './options';\nimport type { JanusMailTemplateName, JanusMailVariables } from './types';\n\n/** A string field of an argument, or a `TypeError` naming the method and the field. */\nexport function field(method: string, value: unknown, key: string): string {\n\tconst read =\n\t\ttypeof value === 'object' && value !== null\n\t\t\t? (value as Record<string, unknown>)[key]\n\t\t\t: undefined;\n\tif (typeof read !== 'string') {\n\t\tthrow new TypeError(`janusMail.${method}: ${key} must be a string`);\n\t}\n\treturn read;\n}\n\n/**\n * What a `links` function answered, or a `TypeError` naming the method and\n * the call. Its scheme is the renderer's to check: `http(s)` and `mailto:`\n * pass, anything else is its `MailRefused`.\n */\nexport function link(method: string, value: unknown, call: string): string {\n\tif (typeof value !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`janusMail.${method}: links.${call} must answer a string`,\n\t\t);\n\t}\n\treturn value;\n}\n\n/** The locale the recipient gets: the first they want that is sent in, else the fallback. */\nexport function localeFor(options: ResolvedOptions, to: unknown): string {\n\tconst wanted =\n\t\ttypeof to === 'object' && to !== null\n\t\t\t? (to as { locale?: WantedLocales }).locale\n\t\t\t: undefined;\n\treturn pickLocale(wanted, options.locales, options.fallbackLocale);\n}\n\n/**\n * Renders one e-mail and hands it to the mailer. Only `subject`, `html` and\n * `text` are read from what the template answered: a template cannot add a\n * recipient or a header.\n */\nexport async function send<K extends JanusMailTemplateName>(\n\toptions: ResolvedOptions,\n\tname: K,\n\taddress: string,\n\tvariables: JanusMailVariables[K] & { readonly locale: string },\n): Promise<SentMail> {\n\tconst template = options.templates[name] as (\n\t\tvariables: JanusMailVariables[K] & { readonly locale: string },\n\t) => Rendered | PromiseLike<Rendered>;\n\tconst { subject, html, text }: Rendered = await template(variables);\n\tconst replyTo: { replyTo?: Address } =\n\t\toptions.replyTo === undefined ? {} : { replyTo: options.replyTo };\n\treturn options.mailer.send({\n\t\tto: address,\n\t\tfrom: options.from,\n\t\t...replyTo,\n\t\tsubject,\n\t\thtml,\n\t\ttext,\n\t});\n}\n",
7
7
  "/**\n * The four e-mails that carry what a flow issued — a one-time link or a\n * sign-in code — and say how long it lasts: `verifyEmail`, `resetPassword`,\n * `signInCode` and `magicLink`.\n */\nimport { expiresInFor } from './expiry';\nimport type { ResolvedOptions } from './options';\nimport { field, link, localeFor, send } from './send';\nimport type { JanusMail } from './types';\n\ntype ExpiringMails = Pick<\n\tJanusMail<string>,\n\t'verifyEmail' | 'resetPassword' | 'signInCode' | 'magicLink'\n>;\n\n/** The two e-mails of a one-time token, which link to your page with it. */\ntype LinkMailName = 'verifyEmail' | 'resetPassword';\n\n/** One e-mail of a one-time token: to `issued.email`, its link built from `issued.token`. */\nfunction linkMail(options: ResolvedOptions, name: LinkMailName) {\n\treturn async (issued: unknown, to: unknown, sendOptions?: unknown) => {\n\t\tconst token = field(name, issued, 'token');\n\t\tconst locale = localeFor(options, to);\n\t\treturn send(options, name, field(name, issued, 'email'), {\n\t\t\tbrand: options.brand,\n\t\t\tname: field(name, to, 'name'),\n\t\t\tlink: link(name, options.links[name](token), `${name}(token)`),\n\t\t\texpiresIn: expiresInFor(name, issued, locale, sendOptions, options.clock),\n\t\t\tlocale,\n\t\t});\n\t};\n}\n\n/**\n * The sign-in link's e-mail: to `issued.email`, greeting nobody, its link\n * built from `issued.token` by the optional `links.magicLink` — checked\n * before anything else is read, so a missing link is refused whatever the\n * arguments.\n */\nfunction magicLinkMail(options: ResolvedOptions) {\n\treturn async (issued: unknown, to: unknown, sendOptions?: unknown) => {\n\t\tconst build = options.links.magicLink;\n\t\tif (build === undefined) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'janusMail.magicLink: links.magicLink is missing — pass it to janusMail({ links }) to send sign-in links',\n\t\t\t);\n\t\t}\n\t\tconst token = field('magicLink', issued, 'token');\n\t\tconst locale = localeFor(options, to);\n\t\treturn send(options, 'magicLink', field('magicLink', issued, 'email'), {\n\t\t\tbrand: options.brand,\n\t\t\tlink: link('magicLink', build(token), 'magicLink(token)'),\n\t\t\texpiresIn: expiresInFor(\n\t\t\t\t'magicLink',\n\t\t\t\tissued,\n\t\t\t\tlocale,\n\t\t\t\tsendOptions,\n\t\t\t\toptions.clock,\n\t\t\t),\n\t\t\tlocale,\n\t\t});\n\t};\n}\n\n/** `verifyEmail`, `resetPassword`, `signInCode` and `magicLink`, over the resolved options. */\nexport function expiringMails(options: ResolvedOptions): ExpiringMails {\n\treturn {\n\t\tverifyEmail: linkMail(options, 'verifyEmail'),\n\t\tresetPassword: linkMail(options, 'resetPassword'),\n\t\tasync signInCode(issued, to, sendOptions) {\n\t\t\t// `code`, `email` and `expiresAt` only: the challenge is the visitor's secret.\n\t\t\tconst locale = localeFor(options, to);\n\t\t\treturn send(options, 'signInCode', field('signInCode', issued, 'email'), {\n\t\t\t\tbrand: options.brand,\n\t\t\t\tcode: field('signInCode', issued, 'code'),\n\t\t\t\texpiresIn: expiresInFor(\n\t\t\t\t\t'signInCode',\n\t\t\t\t\tissued,\n\t\t\t\t\tlocale,\n\t\t\t\t\tsendOptions,\n\t\t\t\t\toptions.clock,\n\t\t\t\t),\n\t\t\t\tlocale,\n\t\t\t});\n\t\t},\n\t\tmagicLink: magicLinkMail(options),\n\t};\n}\n",
8
- "/**\n * `newSignIn`: the notice of a sign-in from a device the user had not signed\n * in from — which device, when, and where when the sender knows — linking to\n * where the account is secured.\n *\n * Apart from the other notices because of its optional `location`: Janus\n * sees no IP, so the sender may know none, and the e-mail then shows `—`,\n * which reads the same in every locale.\n */\nimport type { ResolvedOptions } from './options';\nimport { field, link, localeFor, send } from './send';\nimport type { JanusMail } from './types';\n\nconst METHOD = 'newSignIn';\n\n/** What the e-mail shows where the sender knew no location. */\nexport const NO_LOCATION = '—';\n\n/** The sender's location, `—` without one, or a `TypeError` for anything else. */\nfunction locationOf(signIn: unknown): string {\n\tconst given =\n\t\ttypeof signIn === 'object' && signIn !== null\n\t\t\t? (signIn as { location?: unknown }).location\n\t\t\t: undefined;\n\tif (given === undefined) return NO_LOCATION;\n\treturn field(METHOD, signIn, 'location');\n}\n\n/** The new sign-in notice, over the resolved options. */\nexport function newSignInMail(\n\toptions: ResolvedOptions,\n): Pick<JanusMail<string>, 'newSignIn'> {\n\tconst { brand, links } = options;\n\treturn {\n\t\t// Async, so a wrong argument rejects as the other methods' do.\n\t\tasync newSignIn(to, signIn) {\n\t\t\treturn send(options, METHOD, field(METHOD, to, 'email'), {\n\t\t\t\tbrand,\n\t\t\t\tname: field(METHOD, to, 'name'),\n\t\t\t\tdevice: field(METHOD, signIn, 'device'),\n\t\t\t\tlocation: locationOf(signIn),\n\t\t\t\ttime: field(METHOD, signIn, 'time'),\n\t\t\t\tlink: link(METHOD, links.secureAccount(), 'secureAccount()'),\n\t\t\t\tlocale: localeFor(options, to),\n\t\t\t});\n\t\t},\n\t};\n}\n",
8
+ "/**\n * What `newSignIn` shows where the sender knew no location — \"Unknown\",\n * \"Inconnu\" — in the recipient's locale: the value after the row's label,\n * so \"Location Unknown\", \"Lieu Inconnu\".\n *\n * A map written here, not a message in `mail/locales/*.json`: those\n * catalogues are read by the Maizzle build alone, and hold only the\n * presets' own keys, which the build checks against `@nxgt/mail-presets`'\n * `en`. This string is a send's — whether a location was given is known\n * only then — so it is chosen at send time, as the codes left are\n * (`./codes-left`). Keyed by `JanusMailLocale`, so a locale added to the\n * build without its text here is a compile error.\n */\nimport type { JanusMailLocale } from './generated/locales';\n\n/** The text of a missing location, by built locale. */\nexport const NO_LOCATION: Readonly<Record<JanusMailLocale, string>> =\n\tObject.freeze({\n\t\ten: 'Unknown',\n\t\tfr: 'Inconnu',\n\t});\n\nfunction isBuilt(locale: string): locale is JanusMailLocale {\n\treturn Object.hasOwn(NO_LOCATION, locale);\n}\n\n/**\n * The text of a missing location in `locale` — the one `localeFor` picked —\n * else in its language (`fr` for `fr-CA`), else in `en`: a locale beyond\n * the built ones is sent only through templates of the consumer's own.\n */\nexport function noLocationText(locale: string): string {\n\tif (isBuilt(locale)) return NO_LOCATION[locale];\n\t// A language tag: `resolveOptions` refused anything else in `locales`.\n\tconst { language } = new Intl.Locale(locale);\n\treturn isBuilt(language) ? NO_LOCATION[language] : NO_LOCATION.en;\n}\n",
9
+ "/**\n * `newSignIn`: the notice of a sign-in from a device the user had not signed\n * in from — which device, when, and where when the sender knows — linking to\n * where the account is secured.\n *\n * Apart from the other notices because of its optional `location`: Janus\n * sees no IP, so the sender may know none, and the e-mail then says so in\n * the send's locale — \"Location Unknown\", \"Lieu Inconnu\" (`./no-location`).\n */\n\nimport { noLocationText } from './no-location';\nimport type { ResolvedOptions } from './options';\nimport { field, link, localeFor, send } from './send';\nimport type { JanusMail } from './types';\n\nconst METHOD = 'newSignIn';\n\n/**\n * The sender's location, the text of a missing one in `locale` without one,\n * or a `TypeError` for anything else.\n */\nfunction locationOf(signIn: unknown, locale: string): string {\n\tconst given =\n\t\ttypeof signIn === 'object' && signIn !== null\n\t\t\t? (signIn as { location?: unknown }).location\n\t\t\t: undefined;\n\tif (given === undefined) return noLocationText(locale);\n\treturn field(METHOD, signIn, 'location');\n}\n\n/** The new sign-in notice, over the resolved options. */\nexport function newSignInMail(\n\toptions: ResolvedOptions,\n): Pick<JanusMail<string>, 'newSignIn'> {\n\tconst { brand, links } = options;\n\treturn {\n\t\t// Async, so a wrong argument rejects as the other methods' do.\n\t\tasync newSignIn(to, signIn) {\n\t\t\tconst locale = localeFor(options, to);\n\t\t\treturn send(options, METHOD, field(METHOD, to, 'email'), {\n\t\t\t\tbrand,\n\t\t\t\tname: field(METHOD, to, 'name'),\n\t\t\t\tdevice: field(METHOD, signIn, 'device'),\n\t\t\t\tlocation: locationOf(signIn, locale),\n\t\t\t\ttime: field(METHOD, signIn, 'time'),\n\t\t\t\tlink: link(METHOD, links.secureAccount(), 'secureAccount()'),\n\t\t\t\tlocale,\n\t\t\t});\n\t\t},\n\t};\n}\n",
9
10
  "/**\n * The e-mails about the account itself, sent on what happened to it rather\n * than on a flow's answer: the notices of a change the user made — or someone\n * else did — `passwordChanged`, `emailChanged`, `twoFactorEnabled` and\n * `twoFactorDisabled`, each linking to where the account is secured; and\n * `welcome`, once it was created, linking to where a new user starts.\n */\nimport type { ResolvedOptions } from './options';\nimport { field, link, localeFor, send } from './send';\nimport type { JanusMail } from './types';\n\ntype NoticeMails = Pick<\n\tJanusMail<string>,\n\t| 'passwordChanged'\n\t| 'emailChanged'\n\t| 'twoFactorEnabled'\n\t| 'twoFactorDisabled'\n\t| 'welcome'\n>;\n\n/** The e-mails that greet `to.name` at `to.email`, and link to one of `links`. */\ntype PlainNotice =\n\t| 'passwordChanged'\n\t| 'twoFactorEnabled'\n\t| 'twoFactorDisabled'\n\t| 'welcome';\n\n/** The links a plain notice may take: those called with nothing. */\ntype PlainLink = 'secureAccount' | 'getStarted';\n\n/** The notices and the welcome, over the resolved options. */\nexport function noticeMails(options: ResolvedOptions): NoticeMails {\n\tconst { brand, links } = options;\n\tconst plain =\n\t\t(method: PlainNotice, target: PlainLink) =>\n\t\t// Async, so a wrong argument rejects as the other methods' do.\n\t\tasync (to: unknown): ReturnType<NoticeMails[PlainNotice]> =>\n\t\t\tsend(options, method, field(method, to, 'email'), {\n\t\t\t\tbrand,\n\t\t\t\tname: field(method, to, 'name'),\n\t\t\t\tlink: link(method, links[target](), `${target}()`),\n\t\t\t\tlocale: localeFor(options, to),\n\t\t\t});\n\treturn {\n\t\tpasswordChanged: plain('passwordChanged', 'secureAccount'),\n\t\ttwoFactorEnabled: plain('twoFactorEnabled', 'secureAccount'),\n\t\ttwoFactorDisabled: plain('twoFactorDisabled', 'secureAccount'),\n\t\twelcome: plain('welcome', 'getStarted'),\n\t\tasync emailChanged(to) {\n\t\t\t// To the former address: the one a hijacker just took the account from.\n\t\t\treturn send(\n\t\t\t\toptions,\n\t\t\t\t'emailChanged',\n\t\t\t\tfield('emailChanged', to, 'formerEmail'),\n\t\t\t\t{\n\t\t\t\t\tbrand,\n\t\t\t\t\tname: field('emailChanged', to, 'name'),\n\t\t\t\t\tlink: link('emailChanged', links.secureAccount(), 'secureAccount()'),\n\t\t\t\t\tnewEmail: field('emailChanged', to, 'newEmail'),\n\t\t\t\t\tlocale: localeFor(options, to),\n\t\t\t\t},\n\t\t\t);\n\t\t},\n\t};\n}\n",
10
11
  "// Generated by scripts/build-mail.ts from mails/mail-manifest.json, after\n// each build of the default e-mails. Never edited; committed.\n\n/** The locales the default e-mails are built in, the fallback locale first. */\nexport const LOCALES = ['en', 'fr'] as const;\n\n/** A locale the default e-mails are built in. */\nexport type JanusMailLocale = (typeof LOCALES)[number];\n",
11
12
  "/** A wiring refusal of `janusMail()`: a `TypeError` naming the option. */\nexport function refuse(message: string): never {\n\tthrow new TypeError(`janusMail: ${message}`);\n}\n",
@@ -19,7 +20,7 @@
19
20
  "/**\n * `stepUp`: the code of a step-up — a signed-in user proving again who they\n * are before a sensitive action — to the address `auth.stepUp.request(user)`\n * answered, greeting them, saying how long the code lasts, and linking to\n * where the account is secured, for a user who asked for nothing.\n *\n * Apart from the sign-in code's e-mail because of `via`: a step-up confirmed\n * with the user's app sends nothing, and is refused here rather than mailed\n * as an empty code.\n */\nimport { expiresInFor } from './expiry';\nimport type { ResolvedOptions } from './options';\nimport { field, link, localeFor, send } from './send';\nimport type { JanusMail } from './types';\n\nconst METHOD = 'stepUp';\n\n/** `issued.via`, which must be `'email'`: a `TypeError` otherwise, before anything else is read. */\nfunction checkVia(issued: unknown): void {\n\tconst via =\n\t\ttypeof issued === 'object' && issued !== null\n\t\t\t? (issued as { via?: unknown }).via\n\t\t\t: undefined;\n\tif (via !== 'email') {\n\t\tthrow new TypeError(\n\t\t\t`janusMail.${METHOD}: via must be 'email' — a step-up confirmed with the user's app sends no e-mail`,\n\t\t);\n\t}\n}\n\n/** The step-up's e-mail, over the resolved options. */\nexport function stepUpMail(\n\toptions: ResolvedOptions,\n): Pick<JanusMail<string>, 'stepUp'> {\n\tconst { brand, links } = options;\n\treturn {\n\t\t// `via`, `code`, `email` and `expiresAt` only: the challenge is the user's secret.\n\t\tasync stepUp(issued, to, sendOptions) {\n\t\t\tcheckVia(issued);\n\t\t\tconst locale = localeFor(options, to);\n\t\t\treturn send(options, METHOD, field(METHOD, issued, 'email'), {\n\t\t\t\tbrand,\n\t\t\t\tname: field(METHOD, to, 'name'),\n\t\t\t\tcode: field(METHOD, issued, 'code'),\n\t\t\t\texpiresIn: expiresInFor(\n\t\t\t\t\tMETHOD,\n\t\t\t\t\tissued,\n\t\t\t\t\tlocale,\n\t\t\t\t\tsendOptions,\n\t\t\t\t\toptions.clock,\n\t\t\t\t),\n\t\t\t\tlink: link(METHOD, links.secureAccount(), 'secureAccount()'),\n\t\t\t\tlocale,\n\t\t\t});\n\t\t},\n\t};\n}\n",
20
21
  "/**\n * `janusMail()`: the e-mails of Janus's flows, rendered by the templates and\n * handed to the mailer. It sends what a flow answered, to the address the\n * flow answered, and nothing else: no retry, no queue, no error of its own —\n * the mailer's `MailFailure` and `MailRefused` reach the caller untouched.\n */\n\nimport { expiringMails } from './expiring-mails';\nimport { newSignInMail } from './new-sign-in-mail';\nimport { noticeMails } from './notice-mails';\nimport { resolveOptions } from './options';\nimport { recoveryMail } from './recovery-mail';\nimport { stepUpMail } from './step-up-mail';\nimport type { JanusMail, JanusMailLocale, JanusMailOptions } from './types';\n\n/**\n * The e-mails of Janus's flows, over your mailer:\n *\n * ```ts\n * const mail = janusMail({\n * \tmailer,\n * \tfrom: 'noreply@acme.example',\n * \tbrand: 'Acme',\n * \tlinks: {\n * \t\tverifyEmail: (token) => `https://acme.example/verify?token=${token}`,\n * \t\tresetPassword: (token) => `https://acme.example/reset?token=${token}`,\n * \t\tsecureAccount: () => 'https://acme.example/account/security',\n * \t\tgetStarted: () => 'https://acme.example/',\n * \t\trecoveryCodes: () => 'https://acme.example/account/recovery-codes', // optional\n * \t},\n * });\n *\n * await mail.verifyEmail(await auth.verifyEmail.send(user), { name: user.name, locale: user.locale });\n * ```\n *\n * Reads nothing when called: the default e-mails are read on the first one\n * sent. A wrong option is a bare `TypeError`, thrown here.\n */\nexport function janusMail<const L extends string = JanusMailLocale>(\n\toptions: JanusMailOptions<L>,\n): JanusMail<L> {\n\tconst resolved = resolveOptions(options);\n\tconst mail: JanusMail<string> = Object.freeze({\n\t\t...expiringMails(resolved),\n\t\t...noticeMails(resolved),\n\t\t...recoveryMail(resolved),\n\t\t...newSignInMail(resolved),\n\t\t...stepUpMail(resolved),\n\t\ttemplates: resolved.templates,\n\t\tlocales: resolved.locales,\n\t});\n\t// The one cast at the boundary: the mirror above works on `string` locales.\n\treturn mail as unknown as JanusMail<L>;\n}\n"
21
22
  ],
22
- "mappings": ";AAQA,IAAM,YAAY;AAClB,IAAM,kBAAkB;AACxB,IAAM,iBAAiB,KAAK;AAcrB,SAAS,YAAY,CAAC,IAAY,QAAwB;AAAA,EAChE,MAAM,UAAU,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,SAAS,CAAC;AAAA,EACtD,OAAO,OAAO,QACb,WAAW,iBACR,CAAC,KAAK,MAAM,UAAU,cAAc,GAAG,KAAK,IAC5C,WAAW,kBACV,CAAC,KAAK,MAAM,UAAU,eAAe,GAAG,MAAM,IAC9C,CAAC,SAAS,QAAQ;AAAA,EACvB,OAAO,IAAI,KAAK,aAAa,QAAQ;AAAA,IACpC,OAAO;AAAA,IACP;AAAA,IACA,aAAa;AAAA,EACd,CAAC,EAAE,OAAO,KAAK;AAAA;AAIhB,SAAS,eAAe,CAAC,QAAgB,SAAsC;AAAA,EAC9E,MAAM,OACL,OAAO,YAAY,YAAY,YAAY,OACvC,QAAoC,YACrC;AAAA,EACJ,IAAI,SAAS,aAAa,OAAO,SAAS,UAAU;AAAA,IACnD,MAAM,IAAI,UAAU,aAAa,oCAAoC;AAAA,EACtE;AAAA,EACA,OAAO;AAAA;AAUD,SAAS,YAAY,CAC3B,QACA,Q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QAAQ,KACT;AAAA,QACA,MAAM,KAAK,SAAQ,MAAM,cAAc,GAAG,iBAAiB;AAAA,QAC3D;AAAA,MACD,CAAC;AAAA;AAAA,EAEH;AAAA;;;ACjBM,SAAS,SAAmD,CAClE,SACe;AAAA,EACf,MAAM,WAAW,eAAe,OAAO;AAAA,EACvC,MAAM,OAA0B,OAAO,OAAO;AAAA,OAC1C,cAAc,QAAQ;AAAA,OACtB,YAAY,QAAQ;AAAA,OACpB,aAAa,QAAQ;AAAA,OACrB,cAAc,QAAQ;AAAA,OACtB,WAAW,QAAQ;AAAA,IACtB,WAAW,SAAS;AAAA,IACpB,SAAS,SAAS;AAAA,EACnB,CAAC;AAAA,EAED,OAAO;AAAA;",
24
+ "debugId": "7D22DD84967F5A2664756E2164756E21",
24
25
  "names": []
25
26
  }
@@ -4,13 +4,11 @@
4
4
  * where the account is secured.
5
5
  *
6
6
  * Apart from the other notices because of its optional `location`: Janus
7
- * sees no IP, so the sender may know none, and the e-mail then shows `—`,
8
- * which reads the same in every locale.
7
+ * sees no IP, so the sender may know none, and the e-mail then says so in
8
+ * the send's locale — "Location Unknown", "Lieu Inconnu" (`./no-location`).
9
9
  */
10
10
  import type { ResolvedOptions } from './options';
11
11
  import type { JanusMail } from './types';
12
- /** What the e-mail shows where the sender knew no location. */
13
- export declare const NO_LOCATION = "\u2014";
14
12
  /** The new sign-in notice, over the resolved options. */
15
13
  export declare function newSignInMail(options: ResolvedOptions): Pick<JanusMail<string>, 'newSignIn'>;
16
14
  //# sourceMappingURL=new-sign-in-mail.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"new-sign-in-mail.d.ts","sourceRoot":"","sources":["../src/new-sign-in-mail.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIzC,+DAA+D;AAC/D,eAAO,MAAM,WAAW,WAAM,CAAC;AAY/B,yDAAyD;AACzD,wBAAgB,aAAa,CAC5B,OAAO,EAAE,eAAe,GACtB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAgBtC"}
1
+ {"version":3,"file":"new-sign-in-mail.d.ts","sourceRoot":"","sources":["../src/new-sign-in-mail.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAiBzC,yDAAyD;AACzD,wBAAgB,aAAa,CAC5B,OAAO,EAAE,eAAe,GACtB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAiBtC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * What `newSignIn` shows where the sender knew no location — "Unknown",
3
+ * "Inconnu" — in the recipient's locale: the value after the row's label,
4
+ * so "Location Unknown", "Lieu Inconnu".
5
+ *
6
+ * A map written here, not a message in `mail/locales/*.json`: those
7
+ * catalogues are read by the Maizzle build alone, and hold only the
8
+ * presets' own keys, which the build checks against `@nxgt/mail-presets`'
9
+ * `en`. This string is a send's — whether a location was given is known
10
+ * only then — so it is chosen at send time, as the codes left are
11
+ * (`./codes-left`). Keyed by `JanusMailLocale`, so a locale added to the
12
+ * build without its text here is a compile error.
13
+ */
14
+ import type { JanusMailLocale } from './generated/locales';
15
+ /** The text of a missing location, by built locale. */
16
+ export declare const NO_LOCATION: Readonly<Record<JanusMailLocale, string>>;
17
+ /**
18
+ * The text of a missing location in `locale` — the one `localeFor` picked —
19
+ * else in its language (`fr` for `fr-CA`), else in `en`: a locale beyond
20
+ * the built ones is sent only through templates of the consumer's own.
21
+ */
22
+ export declare function noLocationText(locale: string): string;
23
+ //# sourceMappingURL=no-location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-location.d.ts","sourceRoot":"","sources":["../src/no-location.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,uDAAuD;AACvD,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAI/D,CAAC;AAMJ;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKrD"}
@@ -86,8 +86,10 @@ export interface JanusMailVariables {
86
86
  };
87
87
  /**
88
88
  * `device`, `time` and `location` are the sender's text, already in the
89
- * recipient's locale; `location` is `—` when the sender knew none. `link`
90
- * is where the account is secured.
89
+ * recipient's locale. Without a `location` from the sender, it is
90
+ * "Unknown" in the send's locale — "Inconnu" in `fr` — the
91
+ * language's text for a regional `en` or `fr` tag, `en`'s for any other.
92
+ * `link` is where the account is secured.
91
93
  */
92
94
  readonly newSignIn: {
93
95
  readonly brand: string;
@@ -1 +1 @@
1
- {"version":3,"file":"template-types.d.ts","sourceRoot":"","sources":["../src/template-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,WAAW,EAAE;QACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,QAAQ,CAAC,aAAa,EAAE;QACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA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165
165
  * Every value is your text, in the recipient's locale: `device` described
166
166
  * from the request (`'Firefox on macOS'`), `time` formatted in their time
167
167
  * zone. **Janus sees no IP**: `location` is yours to work out, and an
168
- * e-mail without one shows `—` in its place.
168
+ * e-mail without one says "Unknown" in its place — "Inconnu" in French.
169
169
  */
170
170
  newSignIn(to: Recipient & {
171
171
  readonly email: string;
@@ -104,6 +104,10 @@ mail.locales; // readonly ('en' | 'fr' | 'de')[]
104
104
  plural of the codes left in `en` and `fr` only, so a German recipient's
105
105
  `mail.recoveryCodeUsed` takes the sentence as text — "Sie haben noch 3
106
106
  Wiederherstellungscodes." — and a count is a `TypeError` there.
107
+ `location`, left out of a `newSignIn`, is "Unknown" for `de`:
108
+ the text of a missing location is held in `en` and `fr` only, so pass
109
+ `location` yourself — "Unbekannt", so the row reads `Ort Unbekannt` —
110
+ where it matters.
107
111
  `recoveryCodeUsed` is the ninth template, since 0.5.0, `magicLink` the
108
112
  tenth, since 0.7.0, `stepUp` the eleventh, since 0.8.0, and `newSignIn` the
109
113
  twelfth, since 0.9.0: a `templates`
@@ -386,14 +386,18 @@ it carries no request to describe the device from.
386
386
  happened.
387
387
  - **`location` is optional, and yours.** `@nxgt/janus` sees no IP: a
388
388
  location comes from a geo-IP of your own, if you have one. Left out, the
389
- e-mail shows `—` — an em dash, which reads the same in English and
390
- French — since every line of the summary is always there. `null` is a
389
+ e-mail says so in the locale it is sent in — `Location Unknown`, `Lieu
390
+ Inconnu` — since every line of the summary is always there. A locale
391
+ beyond `en` and `fr`, sent through templates of your own, gets its
392
+ language's text when it is `en` or `fr` (`fr-CA` gets "Inconnu"),
393
+ and "Unknown" otherwise: pass `location` yourself there. `null` is a
391
394
  compile error, and in JavaScript `janusMail.newSignIn: location must be a
392
395
  string`: spread it in only when you have one,
393
396
  `...(city === null ? {} : { location: city })`.
394
- - **The text part** gives each line of the summary as its label, then its
395
- value on the next line — `Device`, then `Firefox on macOS` — where every
396
- other paragraph is one line.
397
+ - **The text part** gives each line of the summary on one line, its label
398
+ then its value — `Device Firefox on macOS`, `Location Unknown`,
399
+ `Time September 29, 2026 at 9:12 AM` — one row per line, with no blank line
400
+ between rows.
397
401
 
398
402
  ## The expiry
399
403
 
@@ -78,7 +78,9 @@ Every one also gets `locale`, one of `locales`. Every value is a string:
78
78
  for `stepUp`, `links.recoveryCodes()` (else
79
79
  `links.secureAccount()`) for `recoveryCodeUsed`, `links.getStarted()` for
80
80
  `welcome` — `code`, `newEmail`, `when`, `device` and `time` from the
81
- call, `location` from the call or `—` without one, and `expiresIn` derived from the flow's `expiresAt` in the locale, or
81
+ call, `location` from the call or, without one, "Unknown" in the
82
+ send's locale — "Inconnu" in `fr`; for another locale, its
83
+ language's text when it is `en` or `fr` (`fr-CA`), else `en`'s — and `expiresIn` derived from the flow's `expiresAt` in the locale, or
82
84
  the send's own `expiresIn` ([Sending](sending.md#the-expiry)).
83
85
 
84
86
  `recoveryCodesLeft` is a **sentence**, not the count: "You have 9 recovery
@@ -181,7 +183,7 @@ them renders: that is when the package's `mails/` folder is read, once.
181
183
  ## What the defaults say
182
184
 
183
185
  The defaults are [`@nxgt/mail-presets`](https://www.npmjs.com/package/@nxgt/mail-presets)
184
- 1.1.0, built with a neutral grey theme and no logo:
186
+ 1.1.1, built with a neutral grey theme and no logo:
185
187
 
186
188
  | Template | Built from | Subject (`en`) | Subject (`fr`) |
187
189
  | --- | --- | --- | --- |
@@ -212,7 +214,8 @@ device we had not seen*, then a summary of three lines — **Device**,
212
214
  **Location** and **Time**, *Appareil*, *Lieu* and *Heure* in French — then
213
215
  *if this was you, there is nothing to do; if this was not you, secure your
214
216
  account now*, its button saying **Secure my account**; in the text part each
215
- line of the summary is its label, then its value on the next line. `welcome` has the brand in
217
+ line of the summary is one line, its label then its value — `Device Firefox
218
+ on macOS` — with no blank line between rows. `welcome` has the brand in
216
219
  its heading — "Welcome to Acme" — and the recipient's name in its subject,
217
220
  filled at send time like the body; its button says **Get started**.
218
221
 
package/docs/roadmap.md CHANGED
@@ -46,6 +46,14 @@ Nothing between releases.
46
46
 
47
47
  Newest first; from the first release on, the package's CHANGELOG holds every one.
48
48
 
49
+ - **A readable summary and a location in words, v0.9.1.** Built with
50
+ `@nxgt/mail-config` 1.0.2 and `@nxgt/mail-presets` 1.1.1, the text part of
51
+ `newSignIn` gives each row of its summary on one line — `Device Firefox on
52
+ macOS` — with no blank line between rows, where it split each into a label
53
+ line and a value line. A new sign-in sent without `location` says
54
+ "Unknown" — `Location Unknown`, `Lieu Inconnu` in French — in the
55
+ recipient's locale, where it showed `—`.
56
+
49
57
  - **The new sign-in notice, v0.9.0.** `newSignIn(to, { device, time,
50
58
  location? })`, built from `@nxgt/mail-presets` 1.1.0's `new-sign-in` in
51
59
  English and French — "New sign-in to your account", which device, where
@@ -346,7 +346,8 @@ if (event.type === 'user.emailChanged' && event.formerEmail != null) {
346
346
  time must be a string` are the second argument missing, or its `time` given
347
347
  as the session's `Date`: pass the device as you describe it and the time as
348
348
  text. `janusMail.newSignIn: location must be a string` is a location lookup's
349
- `null`: leave `location` out, and the e-mail shows `—`. `janusMail.newSignIn:
349
+ `null`: leave `location` out, and the e-mail says "Unknown" in
350
+ the recipient's locale. `janusMail.newSignIn:
350
351
  email must be a string` is the `user.newDeviceSignedIn` event itself given
351
352
  as the recipient — read the user first.
352
353
 
@@ -769,7 +770,7 @@ Also, without `exactOptionalPropertyTypes` in your tsconfig:
769
770
 
770
771
  On `newSignIn`'s `location`: a geo-IP lookup's answer, `null` when it found
771
772
  nothing, passed as it is. `location` is optional: leave it out, and the
772
- e-mail shows `—`:
773
+ e-mail says "Unknown" — "Inconnu" in French:
773
774
 
774
775
  ```ts
775
776
  await mail.newSignIn(to, { device, time, ...(city === null ? {} : { location: city }) });
@@ -8,14 +8,9 @@ Hello {{ name }},
8
8
 
9
9
  Your account was signed in from a device we had not seen.
10
10
 
11
- Device
12
- {{ device }}
13
-
14
- Location
15
- {{ location }}
16
-
17
- Time
18
- {{ time }}
11
+ Device {{ device }}
12
+ Location {{ location }}
13
+ Time {{ time }}
19
14
 
20
15
  If this was you, there is nothing to do. If this was not you, secure your account now.
21
16
 
@@ -8,14 +8,9 @@ Bonjour {{ name }},
8
8
 
9
9
  Votre compte a été utilisé depuis un appareil que nous ne connaissions pas.
10
10
 
11
- Appareil
12
- {{ device }}
13
-
14
- Lieu
15
- {{ location }}
16
-
17
- Heure
18
- {{ time }}
11
+ Appareil {{ device }}
12
+ Lieu {{ location }}
13
+ Heure {{ time }}
19
14
 
20
15
  Si c'était vous, vous n'avez rien à faire. Si ce n'était pas vous, sécurisez votre compte dès maintenant.
21
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/janus-mail",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "The e-mails of @nxgt/janus's flows — e-mail verification, password reset, sign-in code, sign-in link, step-up code, password changed, e-mail changed, two-factor enabled and disabled, recovery code used, new sign-in, welcome — rendered in English and French from a prebuilt Maizzle build, with your brand, sent through any @nxgt/mail transport",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -54,11 +54,11 @@
54
54
  "@maizzle/framework": "6.1.7",
55
55
  "@maizzle/tailwindcss": "1.5.6",
56
56
  "@formatjs/icu-messageformat-parser": "3.5.20",
57
- "@nxgt/janus": "^0.17.0",
57
+ "@nxgt/janus": "^0.17.1",
58
58
  "@nxgt/mail": "1.0.1",
59
- "@nxgt/mail-config": "1.0.1",
59
+ "@nxgt/mail-config": "1.0.2",
60
60
  "@nxgt/mail-i18n": "1.0.1",
61
- "@nxgt/mail-presets": "1.1.0",
61
+ "@nxgt/mail-presets": "1.1.1",
62
62
  "@nxgt/mail-ui": "1.0.1",
63
63
  "@types/bun": "^1.4.2",
64
64
  "vue": "3.5.43",
@@ -66,7 +66,7 @@
66
66
  "zod": "^4.6.5"
67
67
  },
68
68
  "peerDependencies": {
69
- "@nxgt/janus": "^0.17.0",
69
+ "@nxgt/janus": "^0.17.1",
70
70
  "@nxgt/mail": ">=0.1.0 <2",
71
71
  "typescript": "^6.0.3"
72
72
  }