@authup/server-core 1.0.0-beta.46 → 1.0.0-beta.47

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 (438) hide show
  1. package/LICENSE +661 -201
  2. package/README.md +3 -1
  3. package/dist/adapters/database/data-source/index.d.ts +0 -1
  4. package/dist/adapters/database/data-source/index.d.ts.map +1 -1
  5. package/dist/adapters/database/data-source/index.mjs +1 -2
  6. package/dist/adapters/database/domains/client/subscriber.d.ts +3 -6
  7. package/dist/adapters/database/domains/client/subscriber.d.ts.map +1 -1
  8. package/dist/adapters/database/domains/client/subscriber.mjs +21 -39
  9. package/dist/adapters/database/domains/client/subscriber.mjs.map +1 -1
  10. package/dist/adapters/database/domains/client-permission/subscriber.d.ts +3 -6
  11. package/dist/adapters/database/domains/client-permission/subscriber.d.ts.map +1 -1
  12. package/dist/adapters/database/domains/client-permission/subscriber.mjs +24 -49
  13. package/dist/adapters/database/domains/client-permission/subscriber.mjs.map +1 -1
  14. package/dist/adapters/database/domains/client-role/subscriber.d.ts +3 -6
  15. package/dist/adapters/database/domains/client-role/subscriber.d.ts.map +1 -1
  16. package/dist/adapters/database/domains/client-role/subscriber.mjs +24 -49
  17. package/dist/adapters/database/domains/client-role/subscriber.mjs.map +1 -1
  18. package/dist/adapters/database/domains/client-scope/subscriber.d.ts +3 -6
  19. package/dist/adapters/database/domains/client-scope/subscriber.d.ts.map +1 -1
  20. package/dist/adapters/database/domains/client-scope/subscriber.mjs +21 -36
  21. package/dist/adapters/database/domains/client-scope/subscriber.mjs.map +1 -1
  22. package/dist/adapters/database/domains/identity-provider/subscriber.d.ts +3 -6
  23. package/dist/adapters/database/domains/identity-provider/subscriber.d.ts.map +1 -1
  24. package/dist/adapters/database/domains/identity-provider/subscriber.mjs +21 -39
  25. package/dist/adapters/database/domains/identity-provider/subscriber.mjs.map +1 -1
  26. package/dist/adapters/database/domains/identity-provider-account/subscriber.d.ts +3 -6
  27. package/dist/adapters/database/domains/identity-provider-account/subscriber.d.ts.map +1 -1
  28. package/dist/adapters/database/domains/identity-provider-account/subscriber.mjs +21 -36
  29. package/dist/adapters/database/domains/identity-provider-account/subscriber.mjs.map +1 -1
  30. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.d.ts +3 -6
  31. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.d.ts.map +1 -1
  32. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.mjs +21 -36
  33. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.mjs.map +1 -1
  34. package/dist/adapters/database/domains/identity-provider-role-mapping/subscriber.d.ts +3 -6
  35. package/dist/adapters/database/domains/identity-provider-role-mapping/subscriber.d.ts.map +1 -1
  36. package/dist/adapters/database/domains/identity-provider-role-mapping/subscriber.mjs +21 -45
  37. package/dist/adapters/database/domains/identity-provider-role-mapping/subscriber.mjs.map +1 -1
  38. package/dist/adapters/database/domains/permission/subscriber.d.ts +3 -6
  39. package/dist/adapters/database/domains/permission/subscriber.d.ts.map +1 -1
  40. package/dist/adapters/database/domains/permission/subscriber.mjs +28 -47
  41. package/dist/adapters/database/domains/permission/subscriber.mjs.map +1 -1
  42. package/dist/adapters/database/domains/policy/subscriber.d.ts +3 -6
  43. package/dist/adapters/database/domains/policy/subscriber.d.ts.map +1 -1
  44. package/dist/adapters/database/domains/policy/subscriber.mjs +21 -36
  45. package/dist/adapters/database/domains/policy/subscriber.mjs.map +1 -1
  46. package/dist/adapters/database/domains/policy-attribute/subscriber.d.ts +3 -6
  47. package/dist/adapters/database/domains/policy-attribute/subscriber.d.ts.map +1 -1
  48. package/dist/adapters/database/domains/policy-attribute/subscriber.mjs +24 -45
  49. package/dist/adapters/database/domains/policy-attribute/subscriber.mjs.map +1 -1
  50. package/dist/adapters/database/domains/realm/subscriber.d.ts +3 -6
  51. package/dist/adapters/database/domains/realm/subscriber.d.ts.map +1 -1
  52. package/dist/adapters/database/domains/realm/subscriber.mjs +21 -36
  53. package/dist/adapters/database/domains/realm/subscriber.mjs.map +1 -1
  54. package/dist/adapters/database/domains/robot/subscriber.d.ts +3 -6
  55. package/dist/adapters/database/domains/robot/subscriber.d.ts.map +1 -1
  56. package/dist/adapters/database/domains/robot/subscriber.mjs +21 -39
  57. package/dist/adapters/database/domains/robot/subscriber.mjs.map +1 -1
  58. package/dist/adapters/database/domains/robot-permission/subscriber.d.ts +3 -6
  59. package/dist/adapters/database/domains/robot-permission/subscriber.d.ts.map +1 -1
  60. package/dist/adapters/database/domains/robot-permission/subscriber.mjs +24 -49
  61. package/dist/adapters/database/domains/robot-permission/subscriber.mjs.map +1 -1
  62. package/dist/adapters/database/domains/robot-role/subscriber.d.ts +3 -6
  63. package/dist/adapters/database/domains/robot-role/subscriber.d.ts.map +1 -1
  64. package/dist/adapters/database/domains/robot-role/subscriber.mjs +24 -49
  65. package/dist/adapters/database/domains/robot-role/subscriber.mjs.map +1 -1
  66. package/dist/adapters/database/domains/role/subscriber.d.ts +3 -6
  67. package/dist/adapters/database/domains/role/subscriber.d.ts.map +1 -1
  68. package/dist/adapters/database/domains/role/subscriber.mjs +21 -41
  69. package/dist/adapters/database/domains/role/subscriber.mjs.map +1 -1
  70. package/dist/adapters/database/domains/role-attribute/subscriber.d.ts +3 -6
  71. package/dist/adapters/database/domains/role-attribute/subscriber.d.ts.map +1 -1
  72. package/dist/adapters/database/domains/role-attribute/subscriber.mjs +24 -45
  73. package/dist/adapters/database/domains/role-attribute/subscriber.mjs.map +1 -1
  74. package/dist/adapters/database/domains/role-permission/subscriber.d.ts +3 -6
  75. package/dist/adapters/database/domains/role-permission/subscriber.d.ts.map +1 -1
  76. package/dist/adapters/database/domains/role-permission/subscriber.mjs +24 -49
  77. package/dist/adapters/database/domains/role-permission/subscriber.mjs.map +1 -1
  78. package/dist/adapters/database/domains/scope/subscriber.d.ts +3 -6
  79. package/dist/adapters/database/domains/scope/subscriber.d.ts.map +1 -1
  80. package/dist/adapters/database/domains/scope/subscriber.mjs +17 -43
  81. package/dist/adapters/database/domains/scope/subscriber.mjs.map +1 -1
  82. package/dist/adapters/database/domains/user/subscriber.d.ts +3 -6
  83. package/dist/adapters/database/domains/user/subscriber.d.ts.map +1 -1
  84. package/dist/adapters/database/domains/user/subscriber.mjs +21 -39
  85. package/dist/adapters/database/domains/user/subscriber.mjs.map +1 -1
  86. package/dist/adapters/database/domains/user-attribute/subscriber.d.ts +3 -6
  87. package/dist/adapters/database/domains/user-attribute/subscriber.d.ts.map +1 -1
  88. package/dist/adapters/database/domains/user-attribute/subscriber.mjs +24 -43
  89. package/dist/adapters/database/domains/user-attribute/subscriber.mjs.map +1 -1
  90. package/dist/adapters/database/domains/user-permission/subscriber.d.ts +3 -6
  91. package/dist/adapters/database/domains/user-permission/subscriber.d.ts.map +1 -1
  92. package/dist/adapters/database/domains/user-permission/subscriber.mjs +24 -49
  93. package/dist/adapters/database/domains/user-permission/subscriber.mjs.map +1 -1
  94. package/dist/adapters/database/domains/user-role/subscriber.d.ts +3 -6
  95. package/dist/adapters/database/domains/user-role/subscriber.d.ts.map +1 -1
  96. package/dist/adapters/database/domains/user-role/subscriber.mjs +24 -49
  97. package/dist/adapters/database/domains/user-role/subscriber.mjs.map +1 -1
  98. package/dist/adapters/database/index.d.ts +1 -0
  99. package/dist/adapters/database/index.d.ts.map +1 -1
  100. package/dist/adapters/database/index.mjs +3 -2
  101. package/dist/adapters/database/subscriber/index.d.ts +3 -0
  102. package/dist/adapters/database/subscriber/index.d.ts.map +1 -0
  103. package/dist/adapters/database/subscriber/index.mjs +5 -0
  104. package/dist/adapters/database/subscriber/module.d.ts +19 -0
  105. package/dist/adapters/database/subscriber/module.d.ts.map +1 -0
  106. package/dist/adapters/database/subscriber/module.mjs +70 -0
  107. package/dist/adapters/database/subscriber/module.mjs.map +1 -0
  108. package/dist/adapters/database/subscriber/types.d.ts +15 -0
  109. package/dist/adapters/database/subscriber/types.d.ts.map +1 -0
  110. package/dist/adapters/database/subscriber/types.mjs +4 -0
  111. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs +1 -1
  112. package/dist/adapters/http/controllers/workflows/activate/module.d.ts +8 -1
  113. package/dist/adapters/http/controllers/workflows/activate/module.d.ts.map +1 -1
  114. package/dist/adapters/http/controllers/workflows/activate/module.mjs +20 -1
  115. package/dist/adapters/http/controllers/workflows/activate/module.mjs.map +1 -1
  116. package/dist/adapters/http/controllers/workflows/authorize/module.d.ts.map +1 -1
  117. package/dist/adapters/http/controllers/workflows/authorize/module.mjs +16 -37
  118. package/dist/adapters/http/controllers/workflows/authorize/module.mjs.map +1 -1
  119. package/dist/adapters/http/controllers/workflows/authorize/types.d.ts +2 -0
  120. package/dist/adapters/http/controllers/workflows/authorize/types.d.ts.map +1 -1
  121. package/dist/adapters/http/controllers/workflows/password-forgot/module.d.ts +8 -1
  122. package/dist/adapters/http/controllers/workflows/password-forgot/module.d.ts.map +1 -1
  123. package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs +23 -2
  124. package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs.map +1 -1
  125. package/dist/adapters/http/controllers/workflows/password-reset/module.d.ts +8 -1
  126. package/dist/adapters/http/controllers/workflows/password-reset/module.d.ts.map +1 -1
  127. package/dist/adapters/http/controllers/workflows/password-reset/module.mjs +21 -1
  128. package/dist/adapters/http/controllers/workflows/password-reset/module.mjs.map +1 -1
  129. package/dist/adapters/http/controllers/workflows/register/module.d.ts +8 -1
  130. package/dist/adapters/http/controllers/workflows/register/module.d.ts.map +1 -1
  131. package/dist/adapters/http/controllers/workflows/register/module.mjs +23 -2
  132. package/dist/adapters/http/controllers/workflows/register/module.mjs.map +1 -1
  133. package/dist/adapters/http/controllers/workflows/status/module.d.ts +11 -4
  134. package/dist/adapters/http/controllers/workflows/status/module.d.ts.map +1 -1
  135. package/dist/adapters/http/controllers/workflows/status/module.mjs +17 -5
  136. package/dist/adapters/http/controllers/workflows/status/module.mjs.map +1 -1
  137. package/dist/adapters/http/index.mjs +4 -1
  138. package/dist/adapters/http/middleware/built-in/cors.d.ts.map +1 -1
  139. package/dist/adapters/http/middleware/built-in/cors.mjs.map +1 -1
  140. package/dist/adapters/http/middleware/built-in/error.d.ts +6 -1
  141. package/dist/adapters/http/middleware/built-in/error.d.ts.map +1 -1
  142. package/dist/adapters/http/middleware/built-in/error.mjs +2 -3
  143. package/dist/adapters/http/middleware/built-in/error.mjs.map +1 -1
  144. package/dist/adapters/http/middleware/built-in/index.d.ts +1 -0
  145. package/dist/adapters/http/middleware/built-in/index.d.ts.map +1 -1
  146. package/dist/adapters/http/middleware/built-in/index.mjs +2 -1
  147. package/dist/adapters/http/middleware/built-in/logger.d.ts +2 -0
  148. package/dist/adapters/http/middleware/built-in/logger.d.ts.map +1 -1
  149. package/dist/adapters/http/middleware/built-in/logger.mjs +1 -2
  150. package/dist/adapters/http/middleware/built-in/logger.mjs.map +1 -1
  151. package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts +15 -0
  152. package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts.map +1 -0
  153. package/dist/adapters/http/middleware/built-in/ui-http-client.mjs +25 -0
  154. package/dist/adapters/http/middleware/built-in/ui-http-client.mjs.map +1 -0
  155. package/dist/adapters/http/middleware/index.mjs +2 -1
  156. package/dist/adapters/http/request/helpers/index.d.ts +2 -0
  157. package/dist/adapters/http/request/helpers/index.d.ts.map +1 -1
  158. package/dist/adapters/http/request/helpers/index.mjs +3 -1
  159. package/dist/adapters/http/request/helpers/locale.d.ts +14 -0
  160. package/dist/adapters/http/request/helpers/locale.d.ts.map +1 -0
  161. package/dist/adapters/http/request/helpers/locale.mjs +32 -0
  162. package/dist/adapters/http/request/helpers/locale.mjs.map +1 -0
  163. package/dist/adapters/http/request/helpers/locations.mjs +1 -1
  164. package/dist/adapters/http/request/helpers/redirect.d.ts +14 -0
  165. package/dist/adapters/http/request/helpers/redirect.d.ts.map +1 -0
  166. package/dist/adapters/http/request/helpers/redirect.mjs +36 -0
  167. package/dist/adapters/http/request/helpers/redirect.mjs.map +1 -0
  168. package/dist/adapters/http/request/index.mjs +3 -1
  169. package/dist/adapters/http/ui/base-path.d.ts +9 -0
  170. package/dist/adapters/http/ui/base-path.d.ts.map +1 -0
  171. package/dist/adapters/http/ui/base-path.mjs +18 -0
  172. package/dist/adapters/http/ui/base-path.mjs.map +1 -0
  173. package/dist/adapters/http/ui/index.d.ts +5 -0
  174. package/dist/adapters/http/ui/index.d.ts.map +1 -0
  175. package/dist/adapters/http/ui/index.mjs +7 -0
  176. package/dist/adapters/http/ui/render.d.ts +4 -0
  177. package/dist/adapters/http/ui/render.d.ts.map +1 -0
  178. package/dist/adapters/http/ui/render.mjs +60 -0
  179. package/dist/adapters/http/ui/render.mjs.map +1 -0
  180. package/dist/adapters/http/ui/serve.d.ts +16 -0
  181. package/dist/adapters/http/ui/serve.d.ts.map +1 -0
  182. package/dist/adapters/http/ui/serve.mjs +32 -0
  183. package/dist/adapters/http/ui/serve.mjs.map +1 -0
  184. package/dist/adapters/http/ui/types.d.ts +8 -0
  185. package/dist/adapters/http/ui/types.d.ts.map +1 -0
  186. package/dist/adapters/http/ui/types.mjs +4 -0
  187. package/dist/app/index.mjs +3 -2
  188. package/dist/app/modules/config/constants.d.ts +1 -0
  189. package/dist/app/modules/config/constants.d.ts.map +1 -1
  190. package/dist/app/modules/config/constants.mjs +1 -0
  191. package/dist/app/modules/config/constants.mjs.map +1 -1
  192. package/dist/app/modules/config/index.d.ts +1 -0
  193. package/dist/app/modules/config/index.d.ts.map +1 -1
  194. package/dist/app/modules/config/index.mjs +2 -1
  195. package/dist/app/modules/config/normalize.d.ts.map +1 -1
  196. package/dist/app/modules/config/normalize.mjs +9 -2
  197. package/dist/app/modules/config/normalize.mjs.map +1 -1
  198. package/dist/app/modules/config/origins.d.ts +10 -0
  199. package/dist/app/modules/config/origins.d.ts.map +1 -0
  200. package/dist/app/modules/config/origins.mjs +21 -0
  201. package/dist/app/modules/config/origins.mjs.map +1 -0
  202. package/dist/app/modules/config/parse.d.ts.map +1 -1
  203. package/dist/app/modules/config/parse.mjs +1 -0
  204. package/dist/app/modules/config/parse.mjs.map +1 -1
  205. package/dist/app/modules/config/read/env.d.ts.map +1 -1
  206. package/dist/app/modules/config/read/env.mjs +2 -0
  207. package/dist/app/modules/config/read/env.mjs.map +1 -1
  208. package/dist/app/modules/config/types.d.ts +14 -0
  209. package/dist/app/modules/config/types.d.ts.map +1 -1
  210. package/dist/app/modules/database/constants.d.ts +2 -0
  211. package/dist/app/modules/database/constants.d.ts.map +1 -1
  212. package/dist/app/modules/database/constants.mjs +4 -1
  213. package/dist/app/modules/database/constants.mjs.map +1 -1
  214. package/dist/app/modules/database/module.d.ts +5 -1
  215. package/dist/app/modules/database/module.d.ts.map +1 -1
  216. package/dist/app/modules/database/module.mjs +26 -15
  217. package/dist/app/modules/database/module.mjs.map +1 -1
  218. package/dist/app/modules/http/constants.d.ts +11 -0
  219. package/dist/app/modules/http/constants.d.ts.map +1 -1
  220. package/dist/app/modules/http/constants.mjs +12 -1
  221. package/dist/app/modules/http/constants.mjs.map +1 -1
  222. package/dist/app/modules/http/modules/controller.d.ts +5 -1
  223. package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
  224. package/dist/app/modules/http/modules/controller.mjs +75 -10
  225. package/dist/app/modules/http/modules/controller.mjs.map +1 -1
  226. package/dist/app/modules/http/modules/middleware.d.ts +2 -1
  227. package/dist/app/modules/http/modules/middleware.d.ts.map +1 -1
  228. package/dist/app/modules/http/modules/middleware.mjs +19 -4
  229. package/dist/app/modules/http/modules/middleware.mjs.map +1 -1
  230. package/dist/app/modules/identity/module.mjs +4 -4
  231. package/dist/app/modules/identity/module.mjs.map +1 -1
  232. package/dist/app/modules/identity/repositories/provider/account/module.d.ts +3 -1
  233. package/dist/app/modules/identity/repositories/provider/account/module.d.ts.map +1 -1
  234. package/dist/app/modules/identity/repositories/provider/account/module.mjs +6 -3
  235. package/dist/app/modules/identity/repositories/provider/account/module.mjs.map +1 -1
  236. package/dist/app/modules/identity/repositories/provider/mapper/attribute.d.ts +3 -0
  237. package/dist/app/modules/identity/repositories/provider/mapper/attribute.d.ts.map +1 -1
  238. package/dist/app/modules/identity/repositories/provider/mapper/attribute.mjs +5 -2
  239. package/dist/app/modules/identity/repositories/provider/mapper/attribute.mjs.map +1 -1
  240. package/dist/app/modules/identity/repositories/provider/mapper/permission.d.ts +3 -0
  241. package/dist/app/modules/identity/repositories/provider/mapper/permission.d.ts.map +1 -1
  242. package/dist/app/modules/identity/repositories/provider/mapper/permission.mjs +5 -2
  243. package/dist/app/modules/identity/repositories/provider/mapper/permission.mjs.map +1 -1
  244. package/dist/app/modules/identity/repositories/provider/mapper/role.d.ts +3 -0
  245. package/dist/app/modules/identity/repositories/provider/mapper/role.d.ts.map +1 -1
  246. package/dist/app/modules/identity/repositories/provider/mapper/role.mjs +5 -2
  247. package/dist/app/modules/identity/repositories/provider/mapper/role.mjs.map +1 -1
  248. package/dist/app/modules/index.mjs +3 -2
  249. package/dist/app/modules/logger/module.d.ts.map +1 -1
  250. package/dist/app/modules/logger/module.mjs +1 -5
  251. package/dist/app/modules/logger/module.mjs.map +1 -1
  252. package/dist/app/modules/mail/constants.d.ts +2 -1
  253. package/dist/app/modules/mail/constants.d.ts.map +1 -1
  254. package/dist/app/modules/mail/constants.mjs +2 -1
  255. package/dist/app/modules/mail/constants.mjs.map +1 -1
  256. package/dist/app/modules/mail/index.mjs +2 -2
  257. package/dist/app/modules/mail/module.d.ts.map +1 -1
  258. package/dist/app/modules/mail/module.mjs +4 -1
  259. package/dist/app/modules/mail/module.mjs.map +1 -1
  260. package/dist/app/modules/oauth2/module.d.ts.map +1 -1
  261. package/dist/app/modules/oauth2/module.mjs +3 -1
  262. package/dist/app/modules/oauth2/module.mjs.map +1 -1
  263. package/dist/app/modules/oauth2/repositories/key/repository.d.ts +3 -0
  264. package/dist/app/modules/oauth2/repositories/key/repository.d.ts.map +1 -1
  265. package/dist/app/modules/oauth2/repositories/key/repository.mjs +5 -2
  266. package/dist/app/modules/oauth2/repositories/key/repository.mjs.map +1 -1
  267. package/dist/app/modules/provisioning/module.d.ts.map +1 -1
  268. package/dist/app/modules/provisioning/module.mjs +12 -0
  269. package/dist/app/modules/provisioning/module.mjs.map +1 -1
  270. package/dist/core/entities/client/index.d.ts +1 -0
  271. package/dist/core/entities/client/index.d.ts.map +1 -1
  272. package/dist/core/entities/client/index.mjs +2 -1
  273. package/dist/core/entities/client/service.d.ts.map +1 -1
  274. package/dist/core/entities/client/service.mjs +3 -2
  275. package/dist/core/entities/client/service.mjs.map +1 -1
  276. package/dist/core/entities/client/types.d.ts +11 -1
  277. package/dist/core/entities/client/types.d.ts.map +1 -1
  278. package/dist/core/entities/client/web-client.d.ts +34 -0
  279. package/dist/core/entities/client/web-client.d.ts.map +1 -0
  280. package/dist/core/entities/client/web-client.mjs +62 -0
  281. package/dist/core/entities/client/web-client.mjs.map +1 -0
  282. package/dist/core/entities/index.mjs +2 -1
  283. package/dist/core/entities/realm/service.d.ts +6 -1
  284. package/dist/core/entities/realm/service.d.ts.map +1 -1
  285. package/dist/core/entities/realm/service.mjs +9 -0
  286. package/dist/core/entities/realm/service.mjs.map +1 -1
  287. package/dist/core/identity/index.d.ts +1 -0
  288. package/dist/core/identity/index.d.ts.map +1 -1
  289. package/dist/core/identity/index.mjs +2 -1
  290. package/dist/core/identity/password-recovery/constants.d.ts +6 -0
  291. package/dist/core/identity/password-recovery/constants.d.ts.map +1 -0
  292. package/dist/core/identity/password-recovery/constants.mjs +12 -0
  293. package/dist/core/identity/password-recovery/constants.mjs.map +1 -0
  294. package/dist/core/identity/password-recovery/index.d.ts +1 -0
  295. package/dist/core/identity/password-recovery/index.d.ts.map +1 -1
  296. package/dist/core/identity/password-recovery/index.mjs +2 -1
  297. package/dist/core/identity/password-recovery/service.d.ts +4 -2
  298. package/dist/core/identity/password-recovery/service.d.ts.map +1 -1
  299. package/dist/core/identity/password-recovery/service.mjs +17 -6
  300. package/dist/core/identity/password-recovery/service.mjs.map +1 -1
  301. package/dist/core/identity/password-recovery/types.d.ts +5 -2
  302. package/dist/core/identity/password-recovery/types.d.ts.map +1 -1
  303. package/dist/core/identity/registration/service.d.ts +4 -2
  304. package/dist/core/identity/registration/service.d.ts.map +1 -1
  305. package/dist/core/identity/registration/service.mjs +15 -6
  306. package/dist/core/identity/registration/service.mjs.map +1 -1
  307. package/dist/core/identity/registration/types.d.ts +5 -2
  308. package/dist/core/identity/registration/types.d.ts.map +1 -1
  309. package/dist/core/identity/role/module.d.ts.map +1 -1
  310. package/dist/core/identity/role/module.mjs +1 -1
  311. package/dist/core/identity/role/module.mjs.map +1 -1
  312. package/dist/core/identity/types.d.ts +10 -0
  313. package/dist/core/identity/types.d.ts.map +1 -0
  314. package/dist/core/identity/types.mjs +4 -0
  315. package/dist/core/index.mjs +8 -1
  316. package/dist/core/mail/format/blocks.d.ts +12 -0
  317. package/dist/core/mail/format/blocks.d.ts.map +1 -0
  318. package/dist/core/mail/format/blocks.mjs +47 -0
  319. package/dist/core/mail/format/blocks.mjs.map +1 -0
  320. package/dist/core/mail/format/html.d.ts +9 -0
  321. package/dist/core/mail/format/html.d.ts.map +1 -0
  322. package/dist/core/mail/format/html.mjs +41 -0
  323. package/dist/core/mail/format/html.mjs.map +1 -0
  324. package/dist/core/mail/format/index.d.ts +5 -0
  325. package/dist/core/mail/format/index.d.ts.map +1 -0
  326. package/dist/core/mail/format/index.mjs +7 -0
  327. package/dist/core/mail/format/text.d.ts +3 -0
  328. package/dist/core/mail/format/text.d.ts.map +1 -0
  329. package/dist/core/mail/format/text.mjs +20 -0
  330. package/dist/core/mail/format/text.mjs.map +1 -0
  331. package/dist/core/mail/format/types.d.ts +30 -0
  332. package/dist/core/mail/format/types.d.ts.map +1 -0
  333. package/dist/core/mail/format/types.mjs +4 -0
  334. package/dist/core/mail/index.d.ts +3 -0
  335. package/dist/core/mail/index.d.ts.map +1 -1
  336. package/dist/core/mail/index.mjs +6 -1
  337. package/dist/core/mail/renderer.d.ts +10 -0
  338. package/dist/core/mail/renderer.d.ts.map +1 -0
  339. package/dist/core/mail/renderer.mjs +49 -0
  340. package/dist/core/mail/renderer.mjs.map +1 -0
  341. package/dist/core/mail/template/define.d.ts +7 -0
  342. package/dist/core/mail/template/define.d.ts.map +1 -0
  343. package/dist/core/mail/template/define.mjs +14 -0
  344. package/dist/core/mail/template/define.mjs.map +1 -0
  345. package/dist/core/mail/template/index.d.ts +4 -0
  346. package/dist/core/mail/template/index.d.ts.map +1 -0
  347. package/dist/core/mail/template/index.mjs +7 -0
  348. package/dist/core/mail/template/registry.d.ts +6 -0
  349. package/dist/core/mail/template/registry.d.ts.map +1 -0
  350. package/dist/core/mail/template/registry.mjs +15 -0
  351. package/dist/core/mail/template/registry.mjs.map +1 -0
  352. package/dist/core/mail/template/templates/password-reset.d.ts +3 -0
  353. package/dist/core/mail/template/templates/password-reset.d.ts.map +1 -0
  354. package/dist/core/mail/template/templates/password-reset.mjs +36 -0
  355. package/dist/core/mail/template/templates/password-reset.mjs.map +1 -0
  356. package/dist/core/mail/template/templates/registration-activation.d.ts +3 -0
  357. package/dist/core/mail/template/templates/registration-activation.d.ts.map +1 -0
  358. package/dist/core/mail/template/templates/registration-activation.mjs +34 -0
  359. package/dist/core/mail/template/templates/registration-activation.mjs.map +1 -0
  360. package/dist/core/mail/template/types.d.ts +39 -0
  361. package/dist/core/mail/template/types.d.ts.map +1 -0
  362. package/dist/core/mail/template/types.mjs +13 -0
  363. package/dist/core/mail/template/types.mjs.map +1 -0
  364. package/dist/core/mail/types.d.ts +21 -0
  365. package/dist/core/mail/types.d.ts.map +1 -1
  366. package/dist/index.mjs +7 -3
  367. package/dist/swagger.json +98 -3
  368. package/dist/ui/client/.vite/ssr-manifest.json +49086 -874
  369. package/dist/ui/client/assets/asap-latin-400-normal-Dc37g3Il.woff +0 -0
  370. package/dist/ui/client/assets/asap-latin-400-normal-DnZ1MOsG.woff2 +0 -0
  371. package/dist/ui/client/assets/asap-latin-700-normal-Dqcopq14.woff +0 -0
  372. package/dist/ui/client/assets/asap-latin-700-normal-l2Y8pi-F.woff2 +0 -0
  373. package/dist/ui/client/assets/asap-latin-ext-400-normal-C-fcRdtE.woff +0 -0
  374. package/dist/ui/client/assets/asap-latin-ext-400-normal-DwYtpHbV.woff2 +0 -0
  375. package/dist/ui/client/assets/asap-latin-ext-700-normal-D00OESsZ.woff +0 -0
  376. package/dist/ui/client/assets/asap-latin-ext-700-normal-y8bo5aW5.woff2 +0 -0
  377. package/dist/ui/client/assets/asap-vietnamese-400-normal-DGyJlJLT.woff2 +0 -0
  378. package/dist/ui/client/assets/asap-vietnamese-400-normal-lfLaoF2x.woff +0 -0
  379. package/dist/ui/client/assets/asap-vietnamese-700-normal-B-e19ug5.woff +0 -0
  380. package/dist/ui/client/assets/asap-vietnamese-700-normal-D-SxY94i.woff2 +0 -0
  381. package/dist/ui/client/assets/index-BeXJgvKE.css +2 -0
  382. package/dist/ui/client/assets/index-CgLTRwpP.js +95 -0
  383. package/dist/ui/client/assets/nunito-cyrillic-300-normal-BPQV259B.woff2 +0 -0
  384. package/dist/ui/client/assets/nunito-cyrillic-300-normal-g5qSsvc0.woff +0 -0
  385. package/dist/ui/client/assets/nunito-cyrillic-400-normal-D1j0u8EH.woff +0 -0
  386. package/dist/ui/client/assets/nunito-cyrillic-400-normal-xAOo5cBP.woff2 +0 -0
  387. package/dist/ui/client/assets/nunito-cyrillic-600-normal-BUjmtIuu.woff +0 -0
  388. package/dist/ui/client/assets/nunito-cyrillic-600-normal-DJGQ2h05.woff2 +0 -0
  389. package/dist/ui/client/assets/nunito-cyrillic-700-normal-DP36NgGt.woff2 +0 -0
  390. package/dist/ui/client/assets/nunito-cyrillic-700-normal-DfHRUDv-.woff +0 -0
  391. package/dist/ui/client/assets/nunito-cyrillic-ext-300-normal-BDHtqmCR.woff +0 -0
  392. package/dist/ui/client/assets/nunito-cyrillic-ext-300-normal-ChMQLIrm.woff2 +0 -0
  393. package/dist/ui/client/assets/nunito-cyrillic-ext-400-normal-CuPM9foi.woff2 +0 -0
  394. package/dist/ui/client/assets/nunito-cyrillic-ext-400-normal-xaE7D4Sw.woff +0 -0
  395. package/dist/ui/client/assets/nunito-cyrillic-ext-600-normal-CWPPjBOD.woff2 +0 -0
  396. package/dist/ui/client/assets/nunito-cyrillic-ext-600-normal-vnfu4DTE.woff +0 -0
  397. package/dist/ui/client/assets/nunito-cyrillic-ext-700-normal-BuR0mlCG.woff2 +0 -0
  398. package/dist/ui/client/assets/nunito-cyrillic-ext-700-normal-DfoqN4Gs.woff +0 -0
  399. package/dist/ui/client/assets/nunito-latin-300-normal-C3ZIKvzv.woff +0 -0
  400. package/dist/ui/client/assets/nunito-latin-300-normal-COoPE5VN.woff2 +0 -0
  401. package/dist/ui/client/assets/nunito-latin-400-normal-DKg4f3fz.woff +0 -0
  402. package/dist/ui/client/assets/nunito-latin-400-normal-r8SDr6Up.woff2 +0 -0
  403. package/dist/ui/client/assets/nunito-latin-600-normal-Br8yIETf.woff2 +0 -0
  404. package/dist/ui/client/assets/nunito-latin-600-normal-Cd0eNu1l.woff +0 -0
  405. package/dist/ui/client/assets/nunito-latin-700-normal-Dort48En.woff2 +0 -0
  406. package/dist/ui/client/assets/nunito-latin-700-normal-OcDqTBcA.woff +0 -0
  407. package/dist/ui/client/assets/nunito-latin-ext-300-normal-D1SyVuPt.woff2 +0 -0
  408. package/dist/ui/client/assets/nunito-latin-ext-300-normal-DfqbmdMl.woff +0 -0
  409. package/dist/ui/client/assets/nunito-latin-ext-400-normal-CjMJVfGn.woff +0 -0
  410. package/dist/ui/client/assets/nunito-latin-ext-400-normal-i-8OOpdj.woff2 +0 -0
  411. package/dist/ui/client/assets/nunito-latin-ext-600-normal-BKUpuB78.woff +0 -0
  412. package/dist/ui/client/assets/nunito-latin-ext-600-normal-Dd9Zuxh1.woff2 +0 -0
  413. package/dist/ui/client/assets/nunito-latin-ext-700-normal-BWeMsAzO.woff2 +0 -0
  414. package/dist/ui/client/assets/nunito-latin-ext-700-normal-D4woHhbd.woff +0 -0
  415. package/dist/ui/client/assets/nunito-vietnamese-300-normal-DATld5Vw.woff +0 -0
  416. package/dist/ui/client/assets/nunito-vietnamese-300-normal-mLneKULB.woff2 +0 -0
  417. package/dist/ui/client/assets/nunito-vietnamese-400-normal-BHkVbP3T.woff2 +0 -0
  418. package/dist/ui/client/assets/nunito-vietnamese-400-normal-DtOtW02z.woff +0 -0
  419. package/dist/ui/client/assets/nunito-vietnamese-600-normal-BY8O6Cug.woff2 +0 -0
  420. package/dist/ui/client/assets/nunito-vietnamese-600-normal-DO1RqFw5.woff +0 -0
  421. package/dist/ui/client/assets/nunito-vietnamese-700-normal-C9SQsXvj.woff +0 -0
  422. package/dist/ui/client/assets/nunito-vietnamese-700-normal-Ch8EUCfz.woff2 +0 -0
  423. package/dist/ui/client/index.html +2 -2
  424. package/dist/ui/server/server.js +2765 -540
  425. package/package.json +20 -17
  426. package/dist/adapters/database/data-source/singleton.d.ts +0 -5
  427. package/dist/adapters/database/data-source/singleton.d.ts.map +0 -1
  428. package/dist/adapters/database/data-source/singleton.mjs +0 -19
  429. package/dist/adapters/database/data-source/singleton.mjs.map +0 -1
  430. package/dist/adapters/database/event-publisher/index.d.ts +0 -2
  431. package/dist/adapters/database/event-publisher/index.d.ts.map +0 -1
  432. package/dist/adapters/database/event-publisher/index.mjs +0 -5
  433. package/dist/adapters/database/event-publisher/module.d.ts +0 -6
  434. package/dist/adapters/database/event-publisher/module.d.ts.map +0 -1
  435. package/dist/adapters/database/event-publisher/module.mjs +0 -25
  436. package/dist/adapters/database/event-publisher/module.mjs.map +0 -1
  437. package/dist/ui/client/assets/index-Cvz0JzBe.js +0 -95
  438. package/dist/ui/client/assets/index-DNeLkYQO.css +0 -1
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Structural building blocks of a mail body. Templates compose blocks;
3
+ * the html/text formatters turn the same block list into both mail parts,
4
+ * so the two representations cannot drift apart.
5
+ */
6
+ export type MailParagraphBlock = {
7
+ type: 'paragraph';
8
+ text: string;
9
+ };
10
+ export type MailCodeBlock = {
11
+ type: 'code';
12
+ label: string;
13
+ value: string;
14
+ };
15
+ export type MailActionBlock = {
16
+ type: 'action';
17
+ label: string;
18
+ url: string;
19
+ };
20
+ export type MailNoteBlock = {
21
+ type: 'note';
22
+ text: string;
23
+ };
24
+ export type MailBlock = MailParagraphBlock | MailCodeBlock | MailActionBlock | MailNoteBlock;
25
+ export type MailDocument = {
26
+ lang?: string;
27
+ preview?: string;
28
+ blocks: MailBlock[];
29
+ };
30
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/mail/format/types.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,kBAAkB,GAC1C,aAAa,GACb,eAAe,GACf,aAAa,CAAC;AAEd,MAAM,MAAM,YAAY,GAAG;IAEvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,EAAE,CAAC;CACvB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ export {};
@@ -1,2 +1,5 @@
1
+ export * from './format/types.ts';
2
+ export * from './renderer.ts';
3
+ export * from './template/index.ts';
1
4
  export * from './types.ts';
2
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/mail/index.ts"],"names":[],"mappings":"AAOA,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/mail/index.ts"],"names":[],"mappings":"AAOA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC"}
@@ -1,4 +1,9 @@
1
1
  import "node:path";
2
2
  import "node:url";
3
3
  import.meta.url;
4
- export {};
4
+ import { defineMailTemplate } from "./template/define.mjs";
5
+ import { MailTemplateName } from "./template/types.mjs";
6
+ import { MAIL_TEMPLATE_REGISTRY } from "./template/registry.mjs";
7
+ import { MailTemplateRenderer } from "./renderer.mjs";
8
+ import "./template/index.mjs";
9
+ export { MAIL_TEMPLATE_REGISTRY, MailTemplateName, MailTemplateRenderer, defineMailTemplate };
@@ -0,0 +1,10 @@
1
+ import { Ilingo } from 'ilingo';
2
+ import type { MailTemplateName } from './template/types.ts';
3
+ import type { IMailTemplateRenderer, MailContent, MailRenderInput } from './types.ts';
4
+ export declare class MailTemplateRenderer implements IMailTemplateRenderer {
5
+ protected ilingo: Ilingo;
6
+ constructor();
7
+ render<N extends MailTemplateName>(input: MailRenderInput<N>): Promise<MailContent>;
8
+ protected translate(locale: string, key: string, data?: Record<string, any>): Promise<string>;
9
+ }
10
+ //# sourceMappingURL=renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../src/core/mail/renderer.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AAM7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EACR,qBAAqB,EACrB,WAAW,EACX,eAAe,EAClB,MAAM,YAAY,CAAC;AAEpB,qBAAa,oBAAqB,YAAW,qBAAqB;IAC9D,SAAS,CAAC,MAAM,EAAG,MAAM,CAAC;;IASpB,MAAM,CAAC,CAAC,SAAS,gBAAgB,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;cA6BzE,SAAS,CACrB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC3B,OAAO,CAAC,MAAM,CAAC;CAcrB"}
@@ -0,0 +1,49 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { isSafeActionURL } from "./format/blocks.mjs";
5
+ import { renderHtmlDocument } from "./format/html.mjs";
6
+ import { renderTextDocument } from "./format/text.mjs";
7
+ import { MAIL_TEMPLATE_REGISTRY } from "./template/registry.mjs";
8
+ import { InternalError } from "@authup/errors";
9
+ import { CATALOGS, DEFAULT_LOCALE, TranslatorTranslationNamespace, matchLocale } from "@authup/i18n";
10
+ import { Ilingo, MemoryStore } from "ilingo";
11
+ //#region src/core/mail/renderer.ts
12
+ var MailTemplateRenderer = class {
13
+ ilingo;
14
+ constructor() {
15
+ this.ilingo = new Ilingo({
16
+ store: new MemoryStore({ data: CATALOGS }),
17
+ locale: DEFAULT_LOCALE
18
+ });
19
+ }
20
+ async render(input) {
21
+ const template = MAIL_TEMPLATE_REGISTRY[input.template];
22
+ const locale = matchLocale(input.locale) ?? DEFAULT_LOCALE;
23
+ const output = await template.build(input.params, (key, data) => this.translate(locale, key, data));
24
+ const document = {
25
+ lang: locale,
26
+ preview: output.preview,
27
+ blocks: output.blocks.filter((block) => block.type !== "action" || isSafeActionURL(block.url))
28
+ };
29
+ return {
30
+ subject: output.subject,
31
+ html: renderHtmlDocument(document),
32
+ text: renderTextDocument(document)
33
+ };
34
+ }
35
+ async translate(locale, key, data) {
36
+ const value = await this.ilingo.get({
37
+ namespace: TranslatorTranslationNamespace.MAIL,
38
+ key,
39
+ locale,
40
+ data
41
+ });
42
+ if (typeof value === "undefined") throw new InternalError(`The mail translation "${key}" (locale: ${locale}) could not be resolved.`);
43
+ return value;
44
+ }
45
+ };
46
+ //#endregion
47
+ export { MailTemplateRenderer };
48
+
49
+ //# sourceMappingURL=renderer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.mjs","names":["InternalError","CATALOGS","DEFAULT_LOCALE","TranslatorTranslationNamespace","matchLocale","Ilingo","MemoryStore","isSafeActionURL","renderHtmlDocument","renderTextDocument","MAIL_TEMPLATE_REGISTRY","MailTemplateRenderer","ilingo","store","data","locale","render","input","template","output","build","params","key","translate","document","lang","preview","blocks","filter","block","type","url","subject","html","text","value","get","namespace","MAIL"],"sources":["../../../src/core/mail/renderer.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { InternalError } from '@authup/errors';\nimport {\n CATALOGS,\n DEFAULT_LOCALE,\n TranslatorTranslationNamespace,\n matchLocale,\n} from '@authup/i18n';\nimport { Ilingo, MemoryStore } from 'ilingo';\nimport { isSafeActionURL } from './format/blocks.ts';\nimport { renderHtmlDocument } from './format/html.ts';\nimport { renderTextDocument } from './format/text.ts';\nimport type { MailDocument } from './format/types.ts';\nimport { MAIL_TEMPLATE_REGISTRY } from './template/registry.ts';\nimport type { MailTemplateName } from './template/types.ts';\nimport type {\n IMailTemplateRenderer,\n MailContent,\n MailRenderInput,\n} from './types.ts';\n\nexport class MailTemplateRenderer implements IMailTemplateRenderer {\n protected ilingo : Ilingo;\n\n constructor() {\n this.ilingo = new Ilingo({\n store: new MemoryStore({ data: CATALOGS }),\n locale: DEFAULT_LOCALE,\n });\n }\n\n async render<N extends MailTemplateName>(input: MailRenderInput<N>): Promise<MailContent> {\n const template = MAIL_TEMPLATE_REGISTRY[input.template];\n\n // Narrow the requested BCP-47 tag onto an authored catalog locale\n // up front, so the copy and the rendered `<html lang>` agree.\n const locale = matchLocale(input.locale) ?? DEFAULT_LOCALE;\n\n const output = await template.build(\n input.params,\n (key, data) => this.translate(locale, key, data),\n );\n\n const document : MailDocument = {\n lang: locale,\n preview: output.preview,\n // Central guard: a call-to-action never renders with a non-http(s)\n // URL, regardless of what an individual template composed.\n blocks: output.blocks.filter(\n (block) => block.type !== 'action' || isSafeActionURL(block.url),\n ),\n };\n\n return {\n subject: output.subject,\n html: renderHtmlDocument(document),\n text: renderTextDocument(document),\n };\n }\n\n protected async translate(\n locale: string,\n key: string,\n data?: Record<string, any>,\n ): Promise<string> {\n const value = await this.ilingo.get({\n namespace: TranslatorTranslationNamespace.MAIL,\n key,\n locale,\n data,\n });\n\n if (typeof value === 'undefined') {\n throw new InternalError(`The mail translation \"${key}\" (locale: ${locale}) could not be resolved.`);\n }\n\n return value;\n }\n}\n"],"mappings":";;;;;;;;;;;AA2BA,IAAaW,uBAAb,MAAaA;CACCC;CAEV,cAAc;EACV,KAAKA,SAAS,IAAIP,OAAO;GACrBQ,OAAO,IAAIP,YAAY,EAAEQ,MAAMb,SAAS,CAAA;GACxCc,QAAQb;EACZ,CAAA;CACJ;CAEA,MAAMc,OAAmCC,OAAiD;EACtF,MAAMC,WAAWR,uBAAuBO,MAAMC;EAI9C,MAAMH,SAASX,YAAYa,MAAMF,MAAM,KAAKb;EAE5C,MAAMiB,SAAS,MAAMD,SAASE,MAC1BH,MAAMI,SACLC,KAAKR,SAAS,KAAKS,UAAUR,QAAQO,KAAKR,IAAAA,CAAAA;EAG/C,MAAMU,WAA0B;GAC5BC,MAAMV;GACNW,SAASP,OAAOO;GAGhBC,QAAQR,OAAOQ,OAAOC,QACjBC,UAAUA,MAAMC,SAAS,YAAYvB,gBAAgBsB,MAAME,GAAG,CAAA;EAEvE;EAEA,OAAO;GACHC,SAASb,OAAOa;GAChBC,MAAMzB,mBAAmBgB,QAAAA;GACzBU,MAAMzB,mBAAmBe,QAAAA;EAC7B;CACJ;CAEA,MAAgBD,UACZR,QACAO,KACAR,MACe;EACf,MAAMqB,QAAQ,MAAM,KAAKvB,OAAOwB,IAAI;GAChCC,WAAWlC,+BAA+BmC;GAC1ChB;GACAP;GACAD;EACJ,CAAA;EAEA,IAAI,OAAOqB,UAAU,aACjB,MAAM,IAAInC,cAAc,yBAAyBsB,IAAI,aAAaP,OAAO,yBAAyB;EAGtG,OAAOoB;CACX;AACJ"}
@@ -0,0 +1,7 @@
1
+ import type { MailTemplate, MailTemplateName } from './types.ts';
2
+ /**
3
+ * Identity helper that pins down the per-template params (via `name`) so
4
+ * `build` is fully typed at the call site.
5
+ */
6
+ export declare function defineMailTemplate<N extends MailTemplateName>(template: MailTemplate<N>): MailTemplate<N>;
7
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../../src/core/mail/template/define.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,EACzD,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GAC1B,YAAY,CAAC,CAAC,CAAC,CAEjB"}
@@ -0,0 +1,14 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ //#region src/core/mail/template/define.ts
5
+ /**
6
+ * Identity helper that pins down the per-template params (via `name`) so
7
+ * `build` is fully typed at the call site.
8
+ */ function defineMailTemplate(template) {
9
+ return template;
10
+ }
11
+ //#endregion
12
+ export { defineMailTemplate };
13
+
14
+ //# sourceMappingURL=define.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.mjs","names":["defineMailTemplate","template"],"sources":["../../../../src/core/mail/template/define.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { MailTemplate, MailTemplateName } from './types.ts';\n\n/**\n * Identity helper that pins down the per-template params (via `name`) so\n * `build` is fully typed at the call site.\n */\nexport function defineMailTemplate<N extends MailTemplateName>(\n template: MailTemplate<N>,\n): MailTemplate<N> {\n return template;\n}\n"],"mappings":";;;;;;;GAaA,SAAgBA,mBACZC,UAAyB;CAEzB,OAAOA;AACX"}
@@ -0,0 +1,4 @@
1
+ export * from './define.ts';
2
+ export * from './registry.ts';
3
+ export * from './types.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/mail/template/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { defineMailTemplate } from "./define.mjs";
5
+ import { MailTemplateName } from "./types.mjs";
6
+ import { MAIL_TEMPLATE_REGISTRY } from "./registry.mjs";
7
+ export { MAIL_TEMPLATE_REGISTRY, MailTemplateName, defineMailTemplate };
@@ -0,0 +1,6 @@
1
+ import type { MailTemplate } from './types.ts';
2
+ import { MailTemplateName } from './types.ts';
3
+ export declare const MAIL_TEMPLATE_REGISTRY: {
4
+ [N in MailTemplateName]: MailTemplate<N>;
5
+ };
6
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/core/mail/template/registry.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,sBAAsB,EAAE;KAAG,CAAC,IAAI,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC;CAG9E,CAAC"}
@@ -0,0 +1,15 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { MailTemplateName } from "./types.mjs";
5
+ import { passwordResetMailTemplate } from "./templates/password-reset.mjs";
6
+ import { registrationActivationMailTemplate } from "./templates/registration-activation.mjs";
7
+ //#region src/core/mail/template/registry.ts
8
+ const MAIL_TEMPLATE_REGISTRY = {
9
+ [MailTemplateName.REGISTRATION_ACTIVATION]: registrationActivationMailTemplate,
10
+ [MailTemplateName.PASSWORD_RESET]: passwordResetMailTemplate
11
+ };
12
+ //#endregion
13
+ export { MAIL_TEMPLATE_REGISTRY };
14
+
15
+ //# sourceMappingURL=registry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.mjs","names":["passwordResetMailTemplate","registrationActivationMailTemplate","MailTemplateName","MAIL_TEMPLATE_REGISTRY","REGISTRATION_ACTIVATION","PASSWORD_RESET"],"sources":["../../../../src/core/mail/template/registry.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { passwordResetMailTemplate } from './templates/password-reset.ts';\nimport { registrationActivationMailTemplate } from './templates/registration-activation.ts';\nimport type { MailTemplate } from './types.ts';\nimport { MailTemplateName } from './types.ts';\n\nexport const MAIL_TEMPLATE_REGISTRY: { [N in MailTemplateName]: MailTemplate<N> } = {\n [MailTemplateName.REGISTRATION_ACTIVATION]: registrationActivationMailTemplate,\n [MailTemplateName.PASSWORD_RESET]: passwordResetMailTemplate,\n};\n"],"mappings":";;;;;;;AAYA,MAAaG,yBAAuE;EAC/ED,iBAAiBE,0BAA0BH;EAC3CC,iBAAiBG,iBAAiBL;AACvC"}
@@ -0,0 +1,3 @@
1
+ import { MailTemplateName } from '../types.ts';
2
+ export declare const passwordResetMailTemplate: import("../types.ts").MailTemplate<MailTemplateName.PASSWORD_RESET>;
3
+ //# sourceMappingURL=password-reset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-reset.d.ts","sourceRoot":"","sources":["../../../../../src/core/mail/template/templates/password-reset.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,yBAAyB,qEA2BpC,CAAC"}
@@ -0,0 +1,36 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { action, code, note, paragraph } from "../../format/blocks.mjs";
5
+ import { defineMailTemplate } from "../define.mjs";
6
+ import { MailTemplateName } from "../types.mjs";
7
+ import { TranslatorTranslationMailKey } from "@authup/i18n";
8
+ //#region src/core/mail/template/templates/password-reset.ts
9
+ const passwordResetMailTemplate = defineMailTemplate({
10
+ name: MailTemplateName.PASSWORD_RESET,
11
+ build: async (params, t) => {
12
+ const [subject, intro, codeLabel, actionLabel, hint] = await Promise.all([
13
+ t(TranslatorTranslationMailKey.PASSWORD_RESET_SUBJECT),
14
+ t(TranslatorTranslationMailKey.PASSWORD_RESET_INTRO),
15
+ t(TranslatorTranslationMailKey.CODE),
16
+ t(TranslatorTranslationMailKey.PASSWORD_RESET_ACTION),
17
+ t(TranslatorTranslationMailKey.PASSWORD_RESET_HINT)
18
+ ]);
19
+ const expiry = params.expiresInMinutes ? await t(TranslatorTranslationMailKey.PASSWORD_RESET_EXPIRY, { minutes: params.expiresInMinutes }) : void 0;
20
+ return {
21
+ subject,
22
+ preview: intro,
23
+ blocks: [
24
+ paragraph(intro),
25
+ code(codeLabel, params.code),
26
+ ...params.url ? [action(actionLabel, params.url)] : [],
27
+ ...expiry ? [note(expiry)] : [],
28
+ note(hint)
29
+ ]
30
+ };
31
+ }
32
+ });
33
+ //#endregion
34
+ export { passwordResetMailTemplate };
35
+
36
+ //# sourceMappingURL=password-reset.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-reset.mjs","names":["TranslatorTranslationMailKey","action","code","note","paragraph","defineMailTemplate","MailTemplateName","passwordResetMailTemplate","name","PASSWORD_RESET","build","params","t","subject","intro","codeLabel","actionLabel","hint","Promise","all","PASSWORD_RESET_SUBJECT","PASSWORD_RESET_INTRO","CODE","PASSWORD_RESET_ACTION","PASSWORD_RESET_HINT","expiry","expiresInMinutes","PASSWORD_RESET_EXPIRY","minutes","undefined","preview","blocks","url"],"sources":["../../../../../src/core/mail/template/templates/password-reset.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { TranslatorTranslationMailKey } from '@authup/i18n';\nimport { \n action, \n code, \n note, \n paragraph, \n} from '../../format/blocks.ts';\nimport { defineMailTemplate } from '../define.ts';\nimport { MailTemplateName } from '../types.ts';\n\nexport const passwordResetMailTemplate = defineMailTemplate({\n name: MailTemplateName.PASSWORD_RESET,\n build: async (params, t) => {\n const [subject, intro, codeLabel, actionLabel, hint] = await Promise.all([\n t(TranslatorTranslationMailKey.PASSWORD_RESET_SUBJECT),\n t(TranslatorTranslationMailKey.PASSWORD_RESET_INTRO),\n t(TranslatorTranslationMailKey.CODE),\n t(TranslatorTranslationMailKey.PASSWORD_RESET_ACTION),\n t(TranslatorTranslationMailKey.PASSWORD_RESET_HINT),\n ]);\n\n const expiry = params.expiresInMinutes ?\n await t(TranslatorTranslationMailKey.PASSWORD_RESET_EXPIRY, { minutes: params.expiresInMinutes }) :\n undefined;\n\n return {\n subject,\n preview: intro,\n blocks: [\n paragraph(intro),\n code(codeLabel, params.code),\n ...(params.url ? [action(actionLabel, params.url)] : []),\n ...(expiry ? [note(expiry)] : []),\n note(hint),\n ],\n };\n },\n});\n"],"mappings":";;;;;;;;AAiBA,MAAaO,4BAA4BF,mBAAmB;CACxDG,MAAMF,iBAAiBG;CACvBC,OAAO,OAAOC,QAAQC,MAAAA;EAClB,MAAM,CAACC,SAASC,OAAOC,WAAWC,aAAaC,QAAQ,MAAMC,QAAQC,IAAI;GACrEP,EAAEZ,6BAA6BoB,sBAAsB;GACrDR,EAAEZ,6BAA6BqB,oBAAoB;GACnDT,EAAEZ,6BAA6BsB,IAAI;GACnCV,EAAEZ,6BAA6BuB,qBAAqB;GACpDX,EAAEZ,6BAA6BwB,mBAAmB;GACrD;EAED,MAAMC,SAASd,OAAOe,mBAClB,MAAMd,EAAEZ,6BAA6B2B,uBAAuB,EAAEC,SAASjB,OAAOe,iBAAiB,CAAA,IAC/FG,KAAAA;EAEJ,OAAO;GACHhB;GACAiB,SAAShB;GACTiB,QAAQ;IACJ3B,UAAUU,KAAAA;IACVZ,KAAKa,WAAWJ,OAAOT,IAAI;OACvBS,OAAOqB,MAAM,CAAC/B,OAAOe,aAAaL,OAAOqB,GAAG,CAAA,IAAK,CAAA;OACjDP,SAAS,CAACtB,KAAKsB,MAAAA,CAAAA,IAAW,CAAA;IAC9BtB,KAAKc,IAAAA;;EAEb;CACJ;AACJ,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { MailTemplateName } from '../types.ts';
2
+ export declare const registrationActivationMailTemplate: import("../types.ts").MailTemplate<MailTemplateName.REGISTRATION_ACTIVATION>;
3
+ //# sourceMappingURL=registration-activation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registration-activation.d.ts","sourceRoot":"","sources":["../../../../../src/core/mail/template/templates/registration-activation.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,kCAAkC,8EAsB7C,CAAC"}
@@ -0,0 +1,34 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { action, code, note, paragraph } from "../../format/blocks.mjs";
5
+ import { defineMailTemplate } from "../define.mjs";
6
+ import { MailTemplateName } from "../types.mjs";
7
+ import { TranslatorTranslationMailKey } from "@authup/i18n";
8
+ //#region src/core/mail/template/templates/registration-activation.ts
9
+ const registrationActivationMailTemplate = defineMailTemplate({
10
+ name: MailTemplateName.REGISTRATION_ACTIVATION,
11
+ build: async (params, t) => {
12
+ const [subject, intro, codeLabel, actionLabel, hint] = await Promise.all([
13
+ t(TranslatorTranslationMailKey.REGISTRATION_ACTIVATION_SUBJECT),
14
+ t(TranslatorTranslationMailKey.REGISTRATION_ACTIVATION_INTRO),
15
+ t(TranslatorTranslationMailKey.CODE),
16
+ t(TranslatorTranslationMailKey.REGISTRATION_ACTIVATION_ACTION),
17
+ t(TranslatorTranslationMailKey.REGISTRATION_ACTIVATION_HINT)
18
+ ]);
19
+ return {
20
+ subject,
21
+ preview: intro,
22
+ blocks: [
23
+ paragraph(intro),
24
+ code(codeLabel, params.code),
25
+ ...params.url ? [action(actionLabel, params.url)] : [],
26
+ note(hint)
27
+ ]
28
+ };
29
+ }
30
+ });
31
+ //#endregion
32
+ export { registrationActivationMailTemplate };
33
+
34
+ //# sourceMappingURL=registration-activation.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registration-activation.mjs","names":["TranslatorTranslationMailKey","action","code","note","paragraph","defineMailTemplate","MailTemplateName","registrationActivationMailTemplate","name","REGISTRATION_ACTIVATION","build","params","t","subject","intro","codeLabel","actionLabel","hint","Promise","all","REGISTRATION_ACTIVATION_SUBJECT","REGISTRATION_ACTIVATION_INTRO","CODE","REGISTRATION_ACTIVATION_ACTION","REGISTRATION_ACTIVATION_HINT","preview","blocks","url"],"sources":["../../../../../src/core/mail/template/templates/registration-activation.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { TranslatorTranslationMailKey } from '@authup/i18n';\nimport { \n action, \n code, \n note, \n paragraph, \n} from '../../format/blocks.ts';\nimport { defineMailTemplate } from '../define.ts';\nimport { MailTemplateName } from '../types.ts';\n\nexport const registrationActivationMailTemplate = defineMailTemplate({\n name: MailTemplateName.REGISTRATION_ACTIVATION,\n build: async (params, t) => {\n const [subject, intro, codeLabel, actionLabel, hint] = await Promise.all([\n t(TranslatorTranslationMailKey.REGISTRATION_ACTIVATION_SUBJECT),\n t(TranslatorTranslationMailKey.REGISTRATION_ACTIVATION_INTRO),\n t(TranslatorTranslationMailKey.CODE),\n t(TranslatorTranslationMailKey.REGISTRATION_ACTIVATION_ACTION),\n t(TranslatorTranslationMailKey.REGISTRATION_ACTIVATION_HINT),\n ]);\n\n return {\n subject,\n preview: intro,\n blocks: [\n paragraph(intro),\n code(codeLabel, params.code),\n ...(params.url ? [action(actionLabel, params.url)] : []),\n note(hint),\n ],\n };\n },\n});\n"],"mappings":";;;;;;;;AAiBA,MAAaO,qCAAqCF,mBAAmB;CACjEG,MAAMF,iBAAiBG;CACvBC,OAAO,OAAOC,QAAQC,MAAAA;EAClB,MAAM,CAACC,SAASC,OAAOC,WAAWC,aAAaC,QAAQ,MAAMC,QAAQC,IAAI;GACrEP,EAAEZ,6BAA6BoB,+BAA+B;GAC9DR,EAAEZ,6BAA6BqB,6BAA6B;GAC5DT,EAAEZ,6BAA6BsB,IAAI;GACnCV,EAAEZ,6BAA6BuB,8BAA8B;GAC7DX,EAAEZ,6BAA6BwB,4BAA4B;GAC9D;EAED,OAAO;GACHX;GACAY,SAASX;GACTY,QAAQ;IACJtB,UAAUU,KAAAA;IACVZ,KAAKa,WAAWJ,OAAOT,IAAI;OACvBS,OAAOgB,MAAM,CAAC1B,OAAOe,aAAaL,OAAOgB,GAAG,CAAA,IAAK,CAAA;IACrDxB,KAAKc,IAAAA;;EAEb;CACJ;AACJ,CAAA"}
@@ -0,0 +1,39 @@
1
+ import type { TranslatorTranslationMailKey } from '@authup/i18n';
2
+ import type { MailBlock } from '../format/types.ts';
3
+ export declare enum MailTemplateName {
4
+ REGISTRATION_ACTIVATION = "registration-activation",
5
+ PASSWORD_RESET = "password-reset"
6
+ }
7
+ export type MailTemplateParamsMap = {
8
+ [MailTemplateName.REGISTRATION_ACTIVATION]: {
9
+ code: string;
10
+ url?: string;
11
+ };
12
+ [MailTemplateName.PASSWORD_RESET]: {
13
+ code: string;
14
+ url?: string;
15
+ expiresInMinutes?: number;
16
+ };
17
+ };
18
+ /**
19
+ * Locale-bound translator handed to a template's `build`. Resolves a key
20
+ * of the `authupMail` namespace (`@authup/i18n`) through ilingo — `data`
21
+ * feeds `{{var}}` interpolation. Async so file- or remote-backed override
22
+ * stores can slot in behind the same contract.
23
+ */
24
+ export type MailTemplateTranslator = (key: `${TranslatorTranslationMailKey}`, data?: Record<string, any>) => Promise<string>;
25
+ export type MailTemplateBuildOutput = {
26
+ subject: string;
27
+ preview?: string;
28
+ blocks: MailBlock[];
29
+ };
30
+ /**
31
+ * A mail template composes its body from blocks; subject, html and text
32
+ * all derive from the same build output. Copy is not embedded — it is
33
+ * resolved per locale through the supplied translator.
34
+ */
35
+ export type MailTemplate<N extends MailTemplateName = MailTemplateName> = {
36
+ name: N;
37
+ build(params: MailTemplateParamsMap[N], t: MailTemplateTranslator): Promise<MailTemplateBuildOutput>;
38
+ };
39
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/mail/template/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,oBAAY,gBAAgB;IACxB,uBAAuB,4BAA4B;IACnD,cAAc,mBAAmB;CACpC;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,EAAE;QACxC,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE;QAC/B,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;CACL,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACjC,GAAG,EAAE,GAAG,4BAA4B,EAAE,EACtC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACzB,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB,MAAM,MAAM,uBAAuB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,EAAE,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI;IACtE,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,CACD,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAChC,CAAC,EAAE,sBAAsB,GAC1B,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACvC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ //#region src/core/mail/template/types.ts
5
+ var MailTemplateName = /*#__PURE__*/ function(MailTemplateName) {
6
+ MailTemplateName["REGISTRATION_ACTIVATION"] = "registration-activation";
7
+ MailTemplateName["PASSWORD_RESET"] = "password-reset";
8
+ return MailTemplateName;
9
+ }({});
10
+ //#endregion
11
+ export { MailTemplateName };
12
+
13
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","names":["MailTemplateName"],"sources":["../../../../src/core/mail/template/types.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { TranslatorTranslationMailKey } from '@authup/i18n';\nimport type { MailBlock } from '../format/types.ts';\n\nexport enum MailTemplateName {\n REGISTRATION_ACTIVATION = 'registration-activation',\n PASSWORD_RESET = 'password-reset',\n}\n\nexport type MailTemplateParamsMap = {\n [MailTemplateName.REGISTRATION_ACTIVATION]: {\n code: string,\n url?: string,\n },\n [MailTemplateName.PASSWORD_RESET]: {\n code: string,\n url?: string,\n expiresInMinutes?: number,\n },\n};\n\n/**\n * Locale-bound translator handed to a template's `build`. Resolves a key\n * of the `authupMail` namespace (`@authup/i18n`) through ilingo — `data`\n * feeds `{{var}}` interpolation. Async so file- or remote-backed override\n * stores can slot in behind the same contract.\n */\nexport type MailTemplateTranslator = (\n key: `${TranslatorTranslationMailKey}`,\n data?: Record<string, any>,\n) => Promise<string>;\n\nexport type MailTemplateBuildOutput = {\n subject: string,\n // Hidden preheader shown by mail clients as the preview line.\n preview?: string,\n blocks: MailBlock[],\n};\n\n/**\n * A mail template composes its body from blocks; subject, html and text\n * all derive from the same build output. Copy is not embedded — it is\n * resolved per locale through the supplied translator.\n */\nexport type MailTemplate<N extends MailTemplateName = MailTemplateName> = {\n name: N,\n build(\n params: MailTemplateParamsMap[N],\n t: MailTemplateTranslator,\n ): Promise<MailTemplateBuildOutput>,\n};\n"],"mappings":";;;;AAUA,IAAO,mBAAKA,uBAAAA,kBAAAA;;;QAAAA"}
@@ -1,3 +1,4 @@
1
+ import type { MailTemplateName, MailTemplateParamsMap } from './template/types.ts';
1
2
  export type MailAddress = {
2
3
  name: string;
3
4
  address: string;
@@ -12,4 +13,24 @@ export type MailSendOptions = {
12
13
  export interface IMailClient {
13
14
  send(options: MailSendOptions): Promise<void>;
14
15
  }
16
+ export type MailRenderInput<N extends MailTemplateName = MailTemplateName> = {
17
+ template: N;
18
+ params: MailTemplateParamsMap[N];
19
+ locale?: string;
20
+ };
21
+ export type MailContent = {
22
+ subject: string;
23
+ html: string;
24
+ text: string;
25
+ };
26
+ /**
27
+ * Renders a localized, branded mail (subject + html + text) from a template
28
+ * name and typed params. Decouples mail copy/markup from the workflow
29
+ * services, which pass `{ template, params, locale }` instead of building
30
+ * HTML. Async because copy resolution runs through ilingo's store contract
31
+ * (memory today; file- or remote-backed overrides tomorrow).
32
+ */
33
+ export interface IMailTemplateRenderer {
34
+ render<N extends MailTemplateName>(input: MailRenderInput<N>): Promise<MailContent>;
35
+ }
15
36
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/mail/types.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,WAAW,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,WAAW;IACxB,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/mail/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEnF,MAAM,MAAM,WAAW,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,WAAW;IACxB,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAMD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI;IACzE,QAAQ,EAAE,CAAC,CAAC;IACZ,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAGjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IAClC,MAAM,CAAC,CAAC,SAAS,gBAAgB,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACvF"}
package/dist/index.mjs CHANGED
@@ -4,6 +4,7 @@ import.meta.url;
4
4
  import { AuthenticationInjectionKey } from "./app/modules/authentication/constants.mjs";
5
5
  import { RealmEntity } from "./adapters/database/domains/realm/entity.mjs";
6
6
  import { RealmRepository } from "./adapters/database/domains/realm/repository.mjs";
7
+ import { EntitySubscriber, buildEntityDestinations } from "./adapters/database/subscriber/module.mjs";
7
8
  import { CachePrefix } from "./adapters/database/domains/constants.mjs";
8
9
  import { RealmSubscriber } from "./adapters/database/domains/realm/subscriber.mjs";
9
10
  import { KeyEntity } from "./adapters/database/domains/key/entity.mjs";
@@ -63,13 +64,13 @@ import { CacheInjectionKey } from "./app/modules/cache/constants.mjs";
63
64
  import { ModuleName } from "./app/modules/constants.mjs";
64
65
  import { ConfigEnvironmentVariableName, ConfigInjectionKey } from "./app/modules/config/constants.mjs";
65
66
  import { ConfigModule } from "./app/modules/config/module.mjs";
67
+ import { getAppOrigins } from "./app/modules/config/origins.mjs";
66
68
  import { CacheModule } from "./app/modules/cache/module.mjs";
67
69
  import { SessionRepository } from "./app/modules/authentication/repositories/session.mjs";
68
70
  import { AuthenticationModule } from "./app/modules/authentication/module.mjs";
69
71
  import { DatabaseInjectionKey } from "./app/modules/database/constants.mjs";
70
72
  import { DatabaseQueryResultCache } from "./adapters/database/cache/module.mjs";
71
73
  import { DataSourceOptionsBuilder } from "./adapters/database/data-source/options/module.mjs";
72
- import { setDataSourceSync, unsetDataSourceSync, useDataSourceSync } from "./adapters/database/data-source/singleton.mjs";
73
74
  import { DatabaseConflictError } from "./adapters/database/errors/conflict.mjs";
74
75
  import { isDatabaseTypeSupported, isDatabaseTypeSupportedForEnvironment } from "./adapters/database/helpers/is-supported.mjs";
75
76
  import "./adapters/database/index.mjs";
@@ -105,9 +106,11 @@ import { setRequestPermissionEvaluator, useRequestPermissionEvaluator } from "./
105
106
  import { RequestIdentity, isRequestIdentityMasterRealmMember, setRequestIdentity, useRequestIdentity, useRequestIdentityOrFail } from "./adapters/http/request/helpers/identity.mjs";
106
107
  import { buildActorContext } from "./adapters/http/request/helpers/actor.mjs";
107
108
  import { getBodyRealmID } from "./adapters/http/request/helpers/body-realm-id.mjs";
109
+ import { LOCALE_COOKIE, useRequestLocale } from "./adapters/http/request/helpers/locale.mjs";
108
110
  import { readFromLocations } from "./adapters/http/request/helpers/locations.mjs";
109
111
  import { getRequestParamID, getRequestStringParam, getRequestStringParamOrFail, useRequestParamID } from "./adapters/http/request/helpers/param-id.mjs";
110
112
  import { applyRouteRealmIDToBody, getRequestRealmID, setRequestRealmID } from "./adapters/http/request/helpers/realm-id.mjs";
113
+ import { sanitizeRelativeRedirect } from "./adapters/http/request/helpers/redirect.mjs";
111
114
  import { setRequestScopes, useRequestScopes } from "./adapters/http/request/helpers/scopes.mjs";
112
115
  import { setRequestToken, useRequestToken } from "./adapters/http/request/helpers/token.mjs";
113
116
  import { RequestPermissionEvaluator } from "./adapters/http/request/permission/module.mjs";
@@ -134,6 +137,7 @@ import { createLoggerMiddleware } from "./adapters/http/middleware/built-in/logg
134
137
  import { registerPrometheusMiddleware } from "./adapters/http/middleware/built-in/prometheus.mjs";
135
138
  import { registerRateLimitMiddleware } from "./adapters/http/middleware/built-in/rate-limit.mjs";
136
139
  import { createSwaggerMiddleware } from "./adapters/http/middleware/built-in/swagger.mjs";
140
+ import { UI_HTTP_CLIENT_FACTORY_STORE_KEY, registerUIHttpClientMiddleware } from "./adapters/http/middleware/built-in/ui-http-client.mjs";
137
141
  import { ClientController } from "./adapters/http/controllers/entities/client/module.mjs";
138
142
  import { ClientPermissionController } from "./adapters/http/controllers/entities/client-permission/module.mjs";
139
143
  import { ClientPermissionRequestValidator } from "./adapters/http/controllers/entities/client-permission/utils/validation.mjs";
@@ -191,7 +195,7 @@ import { LDAPInjectionKey } from "./app/modules/ldap/constants.mjs";
191
195
  import { LdapModule } from "./app/modules/ldap/module.mjs";
192
196
  import { IdentityModule } from "./app/modules/identity/module.mjs";
193
197
  import { OAuth2Module } from "./app/modules/oauth2/module.mjs";
194
- import { MailInjectionKey } from "./app/modules/mail/constants.mjs";
198
+ import { MailInjectionKey, MailTemplateRendererInjectionKey } from "./app/modules/mail/constants.mjs";
195
199
  import { MailModule } from "./app/modules/mail/module.mjs";
196
200
  import { HTTPModule } from "./app/modules/http/module.mjs";
197
201
  import { DefaultProvisioningSource } from "./app/modules/provisioning/sources/default/module.mjs";
@@ -208,4 +212,4 @@ import { defineCLIResetCommand } from "./cli/commands/reset.mjs";
208
212
  import { defineCLIStartCommand } from "./cli/commands/start.mjs";
209
213
  import "./cli/commands/index.mjs";
210
214
  import "reflect-metadata";
211
- export { ActivateController, ApplicationBuilder, AuthenticationInjectionKey, AuthenticationModule, AuthorizationMiddleware, AuthorizeController, CacheInjectionKey, CacheModule, CachePrefix, ClientController, ClientEntity, ClientIdentityRepository, ClientPermissionController, ClientPermissionEntity, ClientPermissionRepositoryAdapter, ClientPermissionRequestValidator, ClientPermissionSubscriber, ClientRepositoryAdapter, ClientRoleController, ClientRoleEntity, ClientRoleRepositoryAdapter, ClientRoleRequestValidator, ClientRoleSubscriber, ClientScopeController, ClientScopeEntity, ClientScopeRepositoryAdapter, ClientScopeRequestValidator, ClientScopeSubscriber, ClientSubscriber, ComponentsModule, CompositeProvisioningSource, ConfigEnvironmentVariableName, ConfigInjectionKey, ConfigModule, DataSourceOptionsBuilder, DatabaseConflictError, DatabaseInjectionKey, DatabaseModule, DatabaseQueryResultCache, DefaultProvisioningSource, FileProvisioningSource, ForceLoggedInMiddleware, ForceUserLoggedInMiddleware, HTTPClientCredentialsGrant, HTTPInjectionKey, HTTPModule, HTTPOAuth2AuthorizeGrant, HTTPOAuth2Authorizer, HTTPOAuth2IdentityGrantType, HTTPOAuth2RefreshTokenGrant, HTTPPasswordGrant, HTTPRobotCredentialsGrant, IdentityInjectionKey, IdentityModule, IdentityProviderAccountEntity, IdentityProviderAccountRepository, IdentityProviderAccountSubscriber, IdentityProviderAttributeEntity, IdentityProviderAttributeMappingEntity, IdentityProviderAttributeMappingRepository, IdentityProviderAttributeSubscriber, IdentityProviderController, IdentityProviderEntity, IdentityProviderPermissionMappingEntity, IdentityProviderPermissionMappingRepository, IdentityProviderRepository, IdentityProviderRepositoryAdapter, IdentityProviderRoleMappingController, IdentityProviderRoleMappingEntity, IdentityProviderRoleMappingRepository, IdentityProviderRoleMappingRepositoryAdapter, IdentityProviderRoleSubscriber, IdentityProviderSubscriber, JwkController, KeyEntity, LDAPInjectionKey, LdapModule, LoggerInjectionKey, LoggerModule, MailInjectionKey, MailModule, ModuleName, OAuth2InjectionToken, OAuth2Module, OpenIDController, PasswordForgotController, PasswordResetController, PermissionController, PermissionDatabaseProvider, PermissionEntity, PermissionPolicyController, PermissionPolicyEntity, PermissionPolicyRepositoryAdapter, PermissionRepositoryAdapter, PermissionSubscriber, PolicyAttributeEntity, PolicyAttributeSubscriber, PolicyAttributesValidator, PolicyController, PolicyEntity, PolicyRepository, PolicyRepositoryAdapter, PolicySubscriber, PolicyValidator, ProvisionerModule, RealmController, RealmEntity, RealmRepository, RealmRepositoryAdapter, RealmResolverMiddleware, RealmSubscriber, RegisterController, RequestHandlerOperation, RequestIdentity, RequestPermissionEvaluator, RobotController, RobotEntity, RobotIdentityRepository, RobotPermissionController, RobotPermissionEntity, RobotPermissionRepositoryAdapter, RobotPermissionRequestValidator, RobotPermissionSubscriber, RobotRepositoryAdapter, RobotRoleController, RobotRoleEntity, RobotRoleRepositoryAdapter, RobotRoleRequestValidator, RobotRoleSubscriber, RobotSubscriber, RoleAttributeController, RoleAttributeEntity, RoleAttributeRepositoryAdapter, RoleAttributeRequestValidator, RoleAttributeSubscriber, RoleController, RoleEntity, RolePermissionController, RolePermissionEntity, RolePermissionRepositoryAdapter, RolePermissionRequestValidator, RolePermissionSubscriber, RoleRepository, RoleRepositoryAdapter, RoleSubscriber, RuntimeModule, ScopeController, ScopeEntity, ScopeRepositoryAdapter, ScopeSubscriber, SessionEntity, SessionRepository, StatusController, TokenController, UserAttributeController, UserAttributeEntity, UserAttributeRepositoryAdapter, UserAttributeRequestValidator, UserAttributeSubscriber, UserController, UserEntity, UserIdentityRepository, UserPermissionController, UserPermissionEntity, UserPermissionRepositoryAdapter, UserPermissionRequestValidator, UserPermissionSubscriber, UserRepository, UserRepositoryAdapter, UserRoleController, UserRoleEntity, UserRoleRepositoryAdapter, UserRoleRequestValidator, UserRoleSubscriber, UserSubscriber, VITE_SERVER_STORE_KEY, applyRouteRealmIDToBody, buildActorContext, createApplication, createAuthorizationMiddleware, createLoggerMiddleware, createRealmResolverMiddleware, createSwaggerMiddleware, defineCLIHealthCheckCommand, defineCLIMigrationCommand, defineCLIResetCommand, defineCLIStartCommand, extractClientCredentialsFromRequest, getBodyRealmID, getJwkRouteHandler, getJwksRouteHandler, getRequestParamID, getRequestRealmID, getRequestStringParam, getRequestStringParamOrFail, guessOauth2GrantTypeByRequest, isDatabaseTypeSupported, isDatabaseTypeSupportedForEnvironment, isRequestIdentityMasterRealmMember, readFromLocations, registerAssetsMiddleware, registerBasicMiddleware, registerCorsMiddleware, registerErrorMiddleware, registerPrometheusMiddleware, registerRateLimitMiddleware, setDataSourceSync, setRequestIdentity, setRequestPermissionEvaluator, setRequestRealmID, setRequestScopes, setRequestToken, unsetDataSourceSync, useDataSourceSync, useRequestIdentity, useRequestIdentityOrFail, useRequestParamID, useRequestPermissionEvaluator, useRequestScopes, useRequestToken };
215
+ export { ActivateController, ApplicationBuilder, AuthenticationInjectionKey, AuthenticationModule, AuthorizationMiddleware, AuthorizeController, CacheInjectionKey, CacheModule, CachePrefix, ClientController, ClientEntity, ClientIdentityRepository, ClientPermissionController, ClientPermissionEntity, ClientPermissionRepositoryAdapter, ClientPermissionRequestValidator, ClientPermissionSubscriber, ClientRepositoryAdapter, ClientRoleController, ClientRoleEntity, ClientRoleRepositoryAdapter, ClientRoleRequestValidator, ClientRoleSubscriber, ClientScopeController, ClientScopeEntity, ClientScopeRepositoryAdapter, ClientScopeRequestValidator, ClientScopeSubscriber, ClientSubscriber, ComponentsModule, CompositeProvisioningSource, ConfigEnvironmentVariableName, ConfigInjectionKey, ConfigModule, DataSourceOptionsBuilder, DatabaseConflictError, DatabaseInjectionKey, DatabaseModule, DatabaseQueryResultCache, DefaultProvisioningSource, EntitySubscriber, FileProvisioningSource, ForceLoggedInMiddleware, ForceUserLoggedInMiddleware, HTTPClientCredentialsGrant, HTTPInjectionKey, HTTPModule, HTTPOAuth2AuthorizeGrant, HTTPOAuth2Authorizer, HTTPOAuth2IdentityGrantType, HTTPOAuth2RefreshTokenGrant, HTTPPasswordGrant, HTTPRobotCredentialsGrant, IdentityInjectionKey, IdentityModule, IdentityProviderAccountEntity, IdentityProviderAccountRepository, IdentityProviderAccountSubscriber, IdentityProviderAttributeEntity, IdentityProviderAttributeMappingEntity, IdentityProviderAttributeMappingRepository, IdentityProviderAttributeSubscriber, IdentityProviderController, IdentityProviderEntity, IdentityProviderPermissionMappingEntity, IdentityProviderPermissionMappingRepository, IdentityProviderRepository, IdentityProviderRepositoryAdapter, IdentityProviderRoleMappingController, IdentityProviderRoleMappingEntity, IdentityProviderRoleMappingRepository, IdentityProviderRoleMappingRepositoryAdapter, IdentityProviderRoleSubscriber, IdentityProviderSubscriber, JwkController, KeyEntity, LDAPInjectionKey, LOCALE_COOKIE, LdapModule, LoggerInjectionKey, LoggerModule, MailInjectionKey, MailModule, MailTemplateRendererInjectionKey, ModuleName, OAuth2InjectionToken, OAuth2Module, OpenIDController, PasswordForgotController, PasswordResetController, PermissionController, PermissionDatabaseProvider, PermissionEntity, PermissionPolicyController, PermissionPolicyEntity, PermissionPolicyRepositoryAdapter, PermissionRepositoryAdapter, PermissionSubscriber, PolicyAttributeEntity, PolicyAttributeSubscriber, PolicyAttributesValidator, PolicyController, PolicyEntity, PolicyRepository, PolicyRepositoryAdapter, PolicySubscriber, PolicyValidator, ProvisionerModule, RealmController, RealmEntity, RealmRepository, RealmRepositoryAdapter, RealmResolverMiddleware, RealmSubscriber, RegisterController, RequestHandlerOperation, RequestIdentity, RequestPermissionEvaluator, RobotController, RobotEntity, RobotIdentityRepository, RobotPermissionController, RobotPermissionEntity, RobotPermissionRepositoryAdapter, RobotPermissionRequestValidator, RobotPermissionSubscriber, RobotRepositoryAdapter, RobotRoleController, RobotRoleEntity, RobotRoleRepositoryAdapter, RobotRoleRequestValidator, RobotRoleSubscriber, RobotSubscriber, RoleAttributeController, RoleAttributeEntity, RoleAttributeRepositoryAdapter, RoleAttributeRequestValidator, RoleAttributeSubscriber, RoleController, RoleEntity, RolePermissionController, RolePermissionEntity, RolePermissionRepositoryAdapter, RolePermissionRequestValidator, RolePermissionSubscriber, RoleRepository, RoleRepositoryAdapter, RoleSubscriber, RuntimeModule, ScopeController, ScopeEntity, ScopeRepositoryAdapter, ScopeSubscriber, SessionEntity, SessionRepository, StatusController, TokenController, UI_HTTP_CLIENT_FACTORY_STORE_KEY, UserAttributeController, UserAttributeEntity, UserAttributeRepositoryAdapter, UserAttributeRequestValidator, UserAttributeSubscriber, UserController, UserEntity, UserIdentityRepository, UserPermissionController, UserPermissionEntity, UserPermissionRepositoryAdapter, UserPermissionRequestValidator, UserPermissionSubscriber, UserRepository, UserRepositoryAdapter, UserRoleController, UserRoleEntity, UserRoleRepositoryAdapter, UserRoleRequestValidator, UserRoleSubscriber, UserSubscriber, VITE_SERVER_STORE_KEY, applyRouteRealmIDToBody, buildActorContext, buildEntityDestinations, createApplication, createAuthorizationMiddleware, createLoggerMiddleware, createRealmResolverMiddleware, createSwaggerMiddleware, defineCLIHealthCheckCommand, defineCLIMigrationCommand, defineCLIResetCommand, defineCLIStartCommand, extractClientCredentialsFromRequest, getAppOrigins, getBodyRealmID, getJwkRouteHandler, getJwksRouteHandler, getRequestParamID, getRequestRealmID, getRequestStringParam, getRequestStringParamOrFail, guessOauth2GrantTypeByRequest, isDatabaseTypeSupported, isDatabaseTypeSupportedForEnvironment, isRequestIdentityMasterRealmMember, readFromLocations, registerAssetsMiddleware, registerBasicMiddleware, registerCorsMiddleware, registerErrorMiddleware, registerPrometheusMiddleware, registerRateLimitMiddleware, registerUIHttpClientMiddleware, sanitizeRelativeRedirect, setRequestIdentity, setRequestPermissionEvaluator, setRequestRealmID, setRequestScopes, setRequestToken, useRequestIdentity, useRequestIdentityOrFail, useRequestLocale, useRequestParamID, useRequestPermissionEvaluator, useRequestScopes, useRequestToken };