@jini-ai/user-management 0.7.3-next.2 → 0.7.4

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 (380) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +55 -2
  3. package/dist/admin/adapters/memory.js +4 -4
  4. package/dist/admin-http/auth/auth-request.d.ts +112 -0
  5. package/dist/admin-http/auth/auth-request.js +32 -0
  6. package/dist/admin-http/auth/boot-redemption.d.ts +9 -0
  7. package/dist/admin-http/auth/boot-redemption.js +17 -0
  8. package/dist/admin-http/auth/boot-session.d.ts +30 -0
  9. package/dist/admin-http/auth/boot-session.js +40 -0
  10. package/dist/admin-http/auth/current-user.d.ts +28 -0
  11. package/dist/admin-http/auth/current-user.js +34 -0
  12. package/dist/admin-http/auth/index.d.ts +17 -0
  13. package/dist/admin-http/auth/index.js +9 -0
  14. package/dist/admin-http/auth/local-boot-session.d.ts +9 -0
  15. package/dist/admin-http/auth/local-boot-session.js +30 -0
  16. package/dist/admin-http/auth/logout.d.ts +10 -0
  17. package/dist/admin-http/auth/logout.js +17 -0
  18. package/dist/admin-http/auth/mfa-login.d.ts +30 -0
  19. package/dist/admin-http/auth/mfa-login.js +43 -0
  20. package/dist/admin-http/auth/password-login.d.ts +35 -0
  21. package/dist/admin-http/auth/password-login.js +52 -0
  22. package/dist/admin-http/auth/password-status.d.ts +34 -0
  23. package/dist/admin-http/auth/password-status.js +42 -0
  24. package/dist/admin-http/http/api-keys.d.ts +45 -0
  25. package/dist/admin-http/http/api-keys.js +28 -0
  26. package/dist/admin-http/http/users.d.ts +71 -0
  27. package/dist/admin-http/http/users.js +42 -0
  28. package/dist/admin-http/owner/mfa-deps.d.ts +41 -0
  29. package/dist/admin-http/owner/mfa-deps.js +26 -0
  30. package/dist/admin-http/owner/mfa-routes.d.ts +72 -0
  31. package/dist/admin-http/owner/mfa-routes.js +105 -0
  32. package/dist/admin-http/owner/passkey-admission.d.ts +46 -0
  33. package/dist/admin-http/owner/passkey-admission.js +23 -0
  34. package/dist/admin-http/owner/passkey-route-deps.d.ts +53 -0
  35. package/dist/admin-http/owner/passkey-route-deps.js +33 -0
  36. package/dist/admin-http/owner/passkey-routes.d.ts +146 -0
  37. package/dist/admin-http/owner/passkey-routes.js +98 -0
  38. package/dist/admin-http/owner/recovery-routes.d.ts +71 -0
  39. package/dist/admin-http/owner/recovery-routes.js +112 -0
  40. package/dist/admin-http/routes/api-keys/create-principal.d.ts +26 -0
  41. package/dist/admin-http/routes/api-keys/create-principal.js +37 -0
  42. package/dist/admin-http/routes/api-keys/issue.d.ts +32 -0
  43. package/dist/admin-http/routes/api-keys/issue.js +38 -0
  44. package/dist/admin-http/routes/api-keys/revoke.d.ts +26 -0
  45. package/dist/admin-http/routes/api-keys/revoke.js +31 -0
  46. package/dist/admin-http/routes/api-keys/shared.d.ts +46 -0
  47. package/dist/admin-http/routes/api-keys/shared.js +38 -0
  48. package/dist/admin-http/routes/users/access-shared.d.ts +103 -0
  49. package/dist/admin-http/routes/users/access-shared.js +85 -0
  50. package/dist/admin-http/routes/users/assign-role.d.ts +24 -0
  51. package/dist/admin-http/routes/users/assign-role.js +30 -0
  52. package/dist/admin-http/routes/users/attach-policy.d.ts +25 -0
  53. package/dist/admin-http/routes/users/attach-policy.js +31 -0
  54. package/dist/admin-http/routes/users/create-policy.d.ts +19 -0
  55. package/dist/admin-http/routes/users/create-policy.js +28 -0
  56. package/dist/admin-http/routes/users/create-role.d.ts +15 -0
  57. package/dist/admin-http/routes/users/create-role.js +21 -0
  58. package/dist/admin-http/routes/users/create.d.ts +32 -0
  59. package/dist/admin-http/routes/users/create.js +67 -0
  60. package/dist/admin-http/routes/users/delete-policy.d.ts +16 -0
  61. package/dist/admin-http/routes/users/delete-policy.js +24 -0
  62. package/dist/admin-http/routes/users/delete-role.d.ts +16 -0
  63. package/dist/admin-http/routes/users/delete-role.js +24 -0
  64. package/dist/admin-http/routes/users/delete.d.ts +35 -0
  65. package/dist/admin-http/routes/users/delete.js +35 -0
  66. package/dist/admin-http/routes/users/disable.d.ts +31 -0
  67. package/dist/admin-http/routes/users/disable.js +38 -0
  68. package/dist/admin-http/routes/users/enable.d.ts +32 -0
  69. package/dist/admin-http/routes/users/enable.js +45 -0
  70. package/dist/admin-http/routes/users/list-policies.d.ts +18 -0
  71. package/dist/admin-http/routes/users/list-policies.js +20 -0
  72. package/dist/admin-http/routes/users/list-policy-permissions.d.ts +28 -0
  73. package/dist/admin-http/routes/users/list-policy-permissions.js +30 -0
  74. package/dist/admin-http/routes/users/list-roles.d.ts +18 -0
  75. package/dist/admin-http/routes/users/list-roles.js +20 -0
  76. package/dist/admin-http/routes/users/list.d.ts +40 -0
  77. package/dist/admin-http/routes/users/list.js +82 -0
  78. package/dist/admin-http/routes/users/remove-policy-permission.d.ts +48 -0
  79. package/dist/admin-http/routes/users/remove-policy-permission.js +62 -0
  80. package/dist/admin-http/routes/users/reset-password.d.ts +33 -0
  81. package/dist/admin-http/routes/users/reset-password.js +52 -0
  82. package/dist/admin-http/routes/users/shared.d.ts +124 -0
  83. package/dist/admin-http/routes/users/shared.js +93 -0
  84. package/dist/admin-http/routes/users/update-policy.d.ts +25 -0
  85. package/dist/admin-http/routes/users/update-policy.js +30 -0
  86. package/dist/admin-http/routes/users/update-role.d.ts +23 -0
  87. package/dist/admin-http/routes/users/update-role.js +29 -0
  88. package/dist/admin-http/routes/users/update.d.ts +35 -0
  89. package/dist/admin-http/routes/users/update.js +78 -0
  90. package/dist/admin-http/routes/users/write-policy-permission.d.ts +31 -0
  91. package/dist/admin-http/routes/users/write-policy-permission.js +45 -0
  92. package/dist/core/ports.d.ts +22 -3
  93. package/dist/core/types.d.ts +17 -5
  94. package/dist/core/types.js +12 -0
  95. package/dist/identity/api-key-secret.d.ts +68 -0
  96. package/dist/identity/api-key-secret.js +229 -0
  97. package/dist/identity/api-key-service.d.ts +144 -0
  98. package/dist/identity/api-key-service.js +389 -0
  99. package/dist/identity/api-key-types.d.ts +79 -0
  100. package/dist/identity/api-key-types.js +2 -0
  101. package/dist/identity/boot-session-token.d.ts +18 -0
  102. package/dist/identity/boot-session-token.js +92 -0
  103. package/dist/identity/builtin-role-grants.d.ts +120 -0
  104. package/dist/identity/builtin-role-grants.js +88 -0
  105. package/dist/identity/delete-user-service.d.ts +195 -0
  106. package/dist/identity/delete-user-service.js +275 -0
  107. package/dist/identity/owner-reset-env.d.ts +37 -0
  108. package/dist/identity/owner-reset-env.js +38 -0
  109. package/dist/identity/permission-grants.d.ts +31 -0
  110. package/dist/identity/permission-grants.js +12 -0
  111. package/dist/identity/permission-list-tool.d.ts +35 -0
  112. package/dist/identity/permission-list-tool.js +47 -0
  113. package/dist/identity/repo.authentication.d.ts +57 -0
  114. package/dist/identity/repo.authentication.js +153 -0
  115. package/dist/identity/repo.authorization.d.ts +82 -0
  116. package/dist/identity/repo.authorization.js +203 -0
  117. package/dist/identity/repo.d.ts +87 -0
  118. package/dist/identity/repo.js +167 -0
  119. package/dist/identity/repo.memory.d.ts +31 -0
  120. package/dist/identity/repo.memory.js +37 -0
  121. package/dist/identity/role-manage-permission.d.ts +34 -0
  122. package/dist/identity/role-manage-permission.js +39 -0
  123. package/dist/identity/site-key-permission.d.ts +66 -0
  124. package/dist/identity/site-key-permission.js +92 -0
  125. package/dist/identity/sql/kernel-user-purge.d.ts +19 -0
  126. package/dist/identity/sql/kernel-user-purge.js +34 -0
  127. package/dist/identity/sql/kernel-user-trash-store.d.ts +15 -0
  128. package/dist/identity/sql/kernel-user-trash-store.js +41 -0
  129. package/dist/identity/sql/user-trash-adapter.d.ts +87 -0
  130. package/dist/identity/sql/user-trash-adapter.js +124 -0
  131. package/dist/identity/tool-registrations.d.ts +100 -0
  132. package/dist/identity/tool-registrations.js +257 -0
  133. package/dist/identity/user-manage-permission.d.ts +8 -0
  134. package/dist/identity/user-manage-permission.js +8 -0
  135. package/dist/identity/user-purge-types.d.ts +85 -0
  136. package/dist/identity/user-purge-types.js +17 -0
  137. package/dist/identity/user-purge.d.ts +69 -0
  138. package/dist/identity/user-purge.js +46 -0
  139. package/dist/identity/username-change-ports.d.ts +15 -0
  140. package/dist/identity/username-change-ports.js +22 -0
  141. package/dist/mail/site/capture-clear.d.ts +58 -0
  142. package/dist/mail/site/capture-clear.js +21 -0
  143. package/dist/mail/status/agent-tools.d.ts +65 -0
  144. package/dist/mail/status/agent-tools.js +22 -0
  145. package/dist/mail/status/delivery-agent-tools.d.ts +206 -0
  146. package/dist/mail/status/delivery-agent-tools.js +63 -0
  147. package/dist/mail/status/delivery-tool-registrations.d.ts +216 -0
  148. package/dist/mail/status/delivery-tool-registrations.js +110 -0
  149. package/dist/mail/status/domain-deps.d.ts +25 -0
  150. package/dist/mail/status/domain-deps.js +23 -0
  151. package/dist/mail/status/permissions.d.ts +43 -0
  152. package/dist/mail/status/permissions.js +45 -0
  153. package/dist/mail/status/provider-agent-tools.d.ts +38 -0
  154. package/dist/mail/status/provider-agent-tools.js +17 -0
  155. package/dist/mail/status/provider-operations.d.ts +166 -0
  156. package/dist/mail/status/provider-operations.js +121 -0
  157. package/dist/mail/status/provider-tool-registrations.d.ts +65 -0
  158. package/dist/mail/status/provider-tool-registrations.js +106 -0
  159. package/dist/mail/status/tool-registrations.d.ts +152 -0
  160. package/dist/mail/status/tool-registrations.js +112 -0
  161. package/dist/member-login/credentials.d.ts +40 -0
  162. package/dist/member-login/credentials.js +26 -0
  163. package/dist/member-login/link-service.d.ts +66 -0
  164. package/dist/member-login/link-service.js +141 -0
  165. package/dist/member-login/oidc-login.d.ts +132 -0
  166. package/dist/member-login/oidc-login.js +206 -0
  167. package/dist/member-login/oidc-request.d.ts +80 -0
  168. package/dist/member-login/oidc-request.js +86 -0
  169. package/dist/member-login/providers.d.ts +79 -0
  170. package/dist/member-login/providers.js +41 -0
  171. package/dist/member-login/ready-providers.d.ts +17 -0
  172. package/dist/member-login/ready-providers.js +11 -0
  173. package/dist/member-login/unlink-identity.d.ts +26 -0
  174. package/dist/member-login/unlink-identity.js +59 -0
  175. package/dist/members/access-resolver.d.ts +107 -0
  176. package/dist/members/access-resolver.js +231 -0
  177. package/dist/members/agent-tools.d.ts +14 -0
  178. package/dist/members/agent-tools.js +139 -0
  179. package/dist/members/auth-mail.d.ts +27 -0
  180. package/dist/members/auth-mail.js +21 -0
  181. package/dist/members/capability-card.d.ts +18 -0
  182. package/dist/members/capability-card.js +27 -0
  183. package/dist/members/consent-service.d.ts +115 -0
  184. package/dist/members/consent-service.js +179 -0
  185. package/dist/members/member-admin-writes.d.ts +73 -0
  186. package/dist/members/member-admin-writes.js +149 -0
  187. package/dist/members/member-challenge-request.d.ts +59 -0
  188. package/dist/members/member-challenge-request.js +145 -0
  189. package/dist/members/member-challenge.d.ts +37 -0
  190. package/dist/members/member-challenge.js +84 -0
  191. package/dist/members/member-credentials.d.ts +35 -0
  192. package/dist/members/member-credentials.js +57 -0
  193. package/dist/members/member-sign-in.d.ts +44 -0
  194. package/dist/members/member-sign-in.js +130 -0
  195. package/dist/members/member-validation.d.ts +5 -0
  196. package/dist/members/member-validation.js +13 -0
  197. package/dist/members/password-auth.d.ts +55 -0
  198. package/dist/members/password-auth.js +177 -0
  199. package/dist/members/ports.d.ts +455 -0
  200. package/dist/members/ports.js +21 -0
  201. package/dist/members/public-member-auth-response.d.ts +68 -0
  202. package/dist/members/public-member-auth-response.js +45 -0
  203. package/dist/members/public-member-response.d.ts +25 -0
  204. package/dist/members/public-member-response.js +15 -0
  205. package/dist/members/repo.d.ts +199 -0
  206. package/dist/members/repo.js +324 -0
  207. package/dist/members/repo.memory.d.ts +276 -0
  208. package/dist/members/repo.memory.js +395 -0
  209. package/dist/members/repo.rows.d.ts +153 -0
  210. package/dist/members/repo.rows.js +250 -0
  211. package/dist/members/repo.sessions.d.ts +80 -0
  212. package/dist/members/repo.sessions.js +166 -0
  213. package/dist/members/repo.sql.d.ts +9 -0
  214. package/dist/members/repo.sql.js +11 -0
  215. package/dist/members/subscriber-directory.d.ts +85 -0
  216. package/dist/members/subscriber-directory.js +70 -0
  217. package/dist/members/tool-registrations.d.ts +143 -0
  218. package/dist/members/tool-registrations.js +247 -0
  219. package/dist/members/trash-member.d.ts +24 -0
  220. package/dist/members/trash-member.js +24 -0
  221. package/dist/members/types.d.ts +321 -0
  222. package/dist/members/types.js +34 -0
  223. package/dist/members/write-service.d.ts +17 -0
  224. package/dist/members/write-service.js +15 -0
  225. package/dist/newsletter/agent-tools.d.ts +20 -0
  226. package/dist/newsletter/agent-tools.js +236 -0
  227. package/dist/newsletter/campaign-write-service.d.ts +92 -0
  228. package/dist/newsletter/campaign-write-service.js +190 -0
  229. package/dist/newsletter/campaign.d.ts +53 -0
  230. package/dist/newsletter/campaign.js +95 -0
  231. package/dist/newsletter/confirmation.d.ts +75 -0
  232. package/dist/newsletter/confirmation.js +142 -0
  233. package/dist/newsletter/data-module-manifest.d.ts +68 -0
  234. package/dist/newsletter/data-module-manifest.js +126 -0
  235. package/dist/newsletter/delivery/tool-registrations.d.ts +67 -0
  236. package/dist/newsletter/delivery/tool-registrations.js +229 -0
  237. package/dist/newsletter/errors.d.ts +93 -0
  238. package/dist/newsletter/errors.js +93 -0
  239. package/dist/newsletter/hooks.d.ts +59 -0
  240. package/dist/newsletter/hooks.js +49 -0
  241. package/dist/newsletter/http-error-responses.d.ts +17 -0
  242. package/dist/newsletter/http-error-responses.js +96 -0
  243. package/dist/newsletter/launch-gate.d.ts +62 -0
  244. package/dist/newsletter/launch-gate.js +29 -0
  245. package/dist/newsletter/lists.d.ts +60 -0
  246. package/dist/newsletter/lists.js +83 -0
  247. package/dist/newsletter/ports.d.ts +283 -0
  248. package/dist/newsletter/ports.js +2 -0
  249. package/dist/newsletter/repo-sends.d.ts +82 -0
  250. package/dist/newsletter/repo-sends.js +178 -0
  251. package/dist/newsletter/repo-subscribers.d.ts +83 -0
  252. package/dist/newsletter/repo-subscribers.js +215 -0
  253. package/dist/newsletter/repo.d.ts +61 -0
  254. package/dist/newsletter/repo.js +147 -0
  255. package/dist/newsletter/repo.memory.d.ts +202 -0
  256. package/dist/newsletter/repo.memory.js +260 -0
  257. package/dist/newsletter/repo.rows.d.ts +221 -0
  258. package/dist/newsletter/repo.rows.js +260 -0
  259. package/dist/newsletter/save-guard.d.ts +32 -0
  260. package/dist/newsletter/save-guard.js +27 -0
  261. package/dist/newsletter/send-pipeline.d.ts +240 -0
  262. package/dist/newsletter/send-pipeline.js +514 -0
  263. package/dist/newsletter/subscriptions.d.ts +87 -0
  264. package/dist/newsletter/subscriptions.js +119 -0
  265. package/dist/newsletter/tool-registrations.d.ts +89 -0
  266. package/dist/newsletter/tool-registrations.deps.d.ts +9 -0
  267. package/dist/newsletter/tool-registrations.deps.js +9 -0
  268. package/dist/newsletter/tool-registrations.js +133 -0
  269. package/dist/newsletter/tool-registrations.read.d.ts +76 -0
  270. package/dist/newsletter/tool-registrations.read.js +140 -0
  271. package/dist/newsletter/tool-registrations.write.d.ts +54 -0
  272. package/dist/newsletter/tool-registrations.write.js +229 -0
  273. package/dist/newsletter/types.d.ts +279 -0
  274. package/dist/newsletter/types.js +23 -0
  275. package/dist/newsletter/unsubscribe.d.ts +41 -0
  276. package/dist/newsletter/unsubscribe.js +100 -0
  277. package/dist/project-keys/attached-vault.d.ts +23 -0
  278. package/dist/project-keys/attached-vault.js +65 -0
  279. package/dist/project-keys/create-vault.d.ts +17 -0
  280. package/dist/project-keys/create-vault.js +29 -0
  281. package/dist/project-keys/service.d.ts +133 -0
  282. package/dist/project-keys/service.js +128 -0
  283. package/dist/project-keys/site-references.d.ts +30 -0
  284. package/dist/project-keys/site-references.js +63 -0
  285. package/dist/project-keys/site-sealer.d.ts +28 -0
  286. package/dist/project-keys/site-sealer.js +64 -0
  287. package/dist/project-keys/sql/attachments.d.ts +33 -0
  288. package/dist/project-keys/sql/attachments.js +55 -0
  289. package/dist/project-keys/tools.d.ts +86 -0
  290. package/dist/project-keys/tools.js +66 -0
  291. package/dist/public-http/routes/mail/feedback.d.ts +44 -0
  292. package/dist/public-http/routes/mail/feedback.js +17 -0
  293. package/dist/public-http/routes/newsletter/confirm.d.ts +38 -0
  294. package/dist/public-http/routes/newsletter/confirm.js +33 -0
  295. package/dist/public-http/routes/newsletter/page.d.ts +29 -0
  296. package/dist/public-http/routes/newsletter/page.js +34 -0
  297. package/dist/public-http/routes/newsletter/unsubscribe.d.ts +33 -0
  298. package/dist/public-http/routes/newsletter/unsubscribe.js +35 -0
  299. package/dist/react/auth/Passkeys.d.ts +2 -34
  300. package/dist/react/auth/RecoveryCodesCard.d.ts +27 -0
  301. package/dist/react/auth/RecoveryCodesCard.hooks.d.ts +67 -0
  302. package/dist/react/auth/RecoveryCodesCard.hooks.js +38 -0
  303. package/dist/react/auth/RecoveryCodesCard.js +56 -0
  304. package/dist/react/auth/TotpSettings.d.ts +2 -23
  305. package/dist/react/auth/local-owner-signin.d.ts +40 -0
  306. package/dist/react/auth/local-owner-signin.js +25 -0
  307. package/dist/react/auth/owner-mfa-api.d.ts +10 -0
  308. package/dist/react/auth/owner-mfa-api.js +17 -0
  309. package/dist/react/auth/owner-passkey-api.d.ts +11 -0
  310. package/dist/react/auth/owner-passkey-api.js +17 -0
  311. package/dist/react/auth/owner-recovery-api.d.ts +51 -0
  312. package/dist/react/auth/owner-recovery-api.js +29 -0
  313. package/dist/react/auth/owner-request.d.ts +7 -0
  314. package/dist/react/auth/owner-request.js +2 -0
  315. package/dist/react/index.d.ts +10 -0
  316. package/dist/react/index.js +6 -0
  317. package/dist/react/mail/Email.d.ts +20 -0
  318. package/dist/react/mail/Email.js +143 -0
  319. package/dist/react/mail/EmailProviderTab.d.ts +34 -0
  320. package/dist/react/mail/EmailProviderTab.js +132 -0
  321. package/dist/react/mail/EmailSegments.d.ts +24 -0
  322. package/dist/react/mail/EmailSegments.js +15 -0
  323. package/dist/react/mail/EmailTemplateEditor.d.ts +146 -0
  324. package/dist/react/mail/EmailTemplateEditor.js +116 -0
  325. package/dist/react/mail/email-view.types.d.ts +236 -0
  326. package/dist/react/mail/email-view.types.js +2 -0
  327. package/dist/react/members/Members.d.ts +5 -3
  328. package/dist/react/members/Members.js +3 -3
  329. package/dist/react/members/api/members-api.d.ts +37 -0
  330. package/dist/react/members/api/members-api.js +16 -0
  331. package/dist/react/members/hooks/use-members.hooks.js +2 -1
  332. package/dist/react/members/members-i18n.d.ts +23 -0
  333. package/dist/react/members/members-i18n.js +25 -0
  334. package/dist/react/members/members-i18n.locales-a.d.ts +4 -0
  335. package/dist/react/members/members-i18n.locales-a.js +294 -0
  336. package/dist/react/members/members-i18n.locales-b.d.ts +4 -0
  337. package/dist/react/members/members-i18n.locales-b.js +265 -0
  338. package/dist/react/models.d.ts +1 -49
  339. package/dist/react/ports.d.ts +3 -143
  340. package/dist/react/roles/api/roles-api.d.ts +74 -0
  341. package/dist/react/roles/api/roles-api.js +22 -0
  342. package/dist/react/testing.js +18 -9
  343. package/dist/react/users/UsersPanel.d.ts +30 -0
  344. package/dist/react/users/UsersPanel.hooks.d.ts +8 -0
  345. package/dist/react/users/UsersPanel.hooks.js +9 -0
  346. package/dist/react/users/UsersPanel.js +9 -0
  347. package/dist/react/users/api/users-api.d.ts +65 -0
  348. package/dist/react/users/api/users-api.js +46 -0
  349. package/dist/react/users/hooks/use-localized-users.hooks.d.ts +43 -0
  350. package/dist/react/users/hooks/use-localized-users.hooks.js +15 -0
  351. package/dist/react/users/hooks/use-users-state.hooks.d.ts +18 -18
  352. package/dist/react/users/password-reset-notice.d.ts +8 -0
  353. package/dist/react/users/password-reset-notice.js +36 -0
  354. package/dist/server/admin-crud-service.d.ts +4 -10
  355. package/dist/server/admin-crud-service.js +20 -6
  356. package/dist/server/agent-tool-registrations.js +26 -7
  357. package/dist/server/agent-tools.js +22 -7
  358. package/dist/server/auth-challenge.d.ts +1 -1
  359. package/dist/server/auth-service.js +2 -1
  360. package/dist/server/grant-service.d.ts +1 -0
  361. package/dist/server/grant-service.js +7 -4
  362. package/dist/server/mfa/passkey-service.d.ts +2 -2
  363. package/dist/server/mfa/passkey-service.js +1 -1
  364. package/dist/server/mfa/service.js +6 -4
  365. package/dist/server/repo.memory.d.ts +30 -2
  366. package/dist/server/repo.memory.js +58 -4
  367. package/dist/server/seed.js +3 -3
  368. package/dist/server/sql/assignments.d.ts +90 -0
  369. package/dist/server/sql/assignments.js +128 -0
  370. package/dist/server/sql/index.d.ts +6 -0
  371. package/dist/server/sql/index.js +5 -0
  372. package/dist/server/sql/kernel.d.ts +9 -0
  373. package/dist/server/sql/kernel.js +2 -0
  374. package/dist/server/sql/mfa.d.ts +36 -0
  375. package/dist/server/sql/mfa.js +51 -0
  376. package/dist/server/sql/passkeys.d.ts +25 -0
  377. package/dist/server/sql/passkeys.js +33 -0
  378. package/dist/server/sql/recovery-codes.d.ts +22 -0
  379. package/dist/server/sql/recovery-codes.js +32 -0
  380. package/package.json +909 -11
@@ -0,0 +1,260 @@
1
+ /**
2
+ * @file In-memory adapters for all 6 Newsletter repo ports (ADR-PIPE-011 File Map).
3
+ *
4
+ * One class per port, matching the host members feature's in-memory repo private rows and
5
+ * plain array find/filter/push-or-replace methods. Each constructor copies its optional initial rows.
6
+ * Rule-of-two adapter #1 (`repo.sqlite.ts` is #2).
7
+ */
8
+ import { upsertRecord } from "@jini-ai/core/records";
9
+ import { decodeListCursor, pageFromArray } from "@jini-ai/core/list-page";
10
+ import { assertNewsletterSave } from "./save-guard.js";
11
+ const DEFAULT_LIST_LIMIT = 100;
12
+ export class InMemoryNewsletterCampaignRepo {
13
+ campaigns;
14
+ revisions;
15
+ constructor(initial = {}) {
16
+ this.campaigns = [...(initial.campaigns ?? [])];
17
+ this.revisions = [...(initial.revisions ?? [])];
18
+ }
19
+ /** Mirror the SQL existence probe without copying campaign records or applying pagination.
20
+ * @complexity O(campaigns) comparisons, O(1) space; no I/O.
21
+ */
22
+ async hasSending({ workspaceId }, _optional = {}) {
23
+ return this.campaigns.some(campaign => campaign.workspaceId === workspaceId && campaign.status === 'sending');
24
+ }
25
+ async findById(required) {
26
+ return (this.campaigns.find((c) => c.workspaceId === required.workspaceId && c.id === required.id) ?? null);
27
+ }
28
+ /** Lists campaign envelopes with the same cursor contract as the SQL adapter.
29
+ * @throws {ToolInputError} If the cursor is malformed, including for an empty workspace.
30
+ * @complexity O(n log n) time and O(n) space for n stored campaigns; no I/O.
31
+ */
32
+ async list(required, optional = {}) {
33
+ const limit = Math.min(optional.limit ?? DEFAULT_LIST_LIMIT, DEFAULT_LIST_LIMIT);
34
+ if (optional.cursor != null)
35
+ decodeListCursor({ cursor: optional.cursor, shape: ['string'] });
36
+ return pageFromArray({ rows: this.campaigns.filter(c => c.workspaceId === required.workspaceId),
37
+ limit, cursor: optional.cursor ?? null, positionOf: campaign => [campaign.id], shape: ['string'] });
38
+ }
39
+ async saveCampaignRow(campaign) {
40
+ const idx = this.campaigns.findIndex((c) => c.workspaceId === campaign.workspaceId && c.id === campaign.id);
41
+ // Counters are insert-only here; `incrementCounter` owns them afterwards (see `ports.ts`).
42
+ const existing = idx >= 0 ? this.campaigns[idx] : undefined;
43
+ if (existing)
44
+ this.campaigns[idx] = { ...campaign, counters: existing.counters };
45
+ else
46
+ this.campaigns.push(campaign);
47
+ }
48
+ async appendRevision(revision) {
49
+ this.revisions.push(revision);
50
+ }
51
+ async listRevisions(required) {
52
+ return this.revisions
53
+ .filter((r) => r.workspaceId === required.workspaceId && r.campaignId === required.campaignId)
54
+ .sort((a, b) => a.seq - b.seq);
55
+ }
56
+ async transaction({ fn }, _optional = {}) {
57
+ // In-process, single-threaded: mutations are already atomic — no-op, mirrors
58
+ // `InMemorySettingsRepo.transaction`. A forced mid-transaction failure test (AC-08) therefore
59
+ // proves the SQLite adapter's real transaction, not this one — see `repo.contract.test.ts`.
60
+ return fn();
61
+ }
62
+ /**
63
+ * Atomically adds 1 to one counter (see `ports.ts`). No `await` happens before the write, so a
64
+ * concurrent caller cannot interleave between read and write. Replaces the stored object instead of
65
+ * mutating it, because `findById` hands out the stored reference.
66
+ *
67
+ * @complexity O(campaigns.length) to locate the row.
68
+ */
69
+ async incrementCounter(required) {
70
+ const idx = this.campaigns.findIndex((c) => c.workspaceId === required.workspaceId && c.id === required.id);
71
+ const campaign = idx >= 0 ? this.campaigns[idx] : undefined;
72
+ if (!campaign)
73
+ return;
74
+ const counters = { ...campaign.counters, [required.counter]: campaign.counters[required.counter] + 1 };
75
+ this.campaigns[idx] = { ...campaign, counters, updatedAt: required.updatedAt };
76
+ }
77
+ }
78
+ export class InMemoryNewsletterListRepo {
79
+ rows;
80
+ constructor(_required = {}, { initialRows = [] } = {}) {
81
+ // Read/write snapshots must not let callers mutate stored state around the save guard.
82
+ this.rows = initialRows.map((row) => ({ ...row }));
83
+ }
84
+ async findById(required) {
85
+ const row = this.rows.find((r) => r.workspaceId === required.workspaceId && r.id === required.id);
86
+ return row ? { ...row } : null;
87
+ }
88
+ async findDefault(required) {
89
+ const row = this.rows.find((r) => r.workspaceId === required.workspaceId && r.isDefault);
90
+ return row ? { ...row } : null;
91
+ }
92
+ async list(required) {
93
+ return this.rows.filter((r) => r.workspaceId === required.workspaceId).map((row) => ({ ...row }));
94
+ }
95
+ async save(row, optional = {}) {
96
+ const current = this.rows.find((item) => item.workspaceId === row.workspaceId && item.id === row.id);
97
+ assertNewsletterSave({ row, current, options: optional, entity: "list" });
98
+ upsertRecord({ records: this.rows, record: { ...row }, identity: { workspaceId: row.workspaceId, id: row.id } });
99
+ }
100
+ }
101
+ export class InMemoryNewsletterSubscriptionRepo {
102
+ rows;
103
+ constructor(_required = {}, { initialRows = [] } = {}) {
104
+ // Match SQL snapshots: caller-owned objects must never alias stored rows.
105
+ this.rows = initialRows.map((row) => ({ ...row }));
106
+ }
107
+ async findById(required) {
108
+ const row = this.rows.find((r) => r.workspaceId === required.workspaceId && r.id === required.id);
109
+ return row ? { ...row } : null;
110
+ }
111
+ async findBySubscriberAndList(required) {
112
+ const row = this.rows.find((r) => r.workspaceId === required.workspaceId &&
113
+ r.listId === required.listId && r.subscriberId === required.subscriberId);
114
+ return row ? { ...row } : null;
115
+ }
116
+ /** Lists one list's subscriptions with the SQL adapter's position-based contract.
117
+ * @throws {ToolInputError} If the cursor is malformed, even for an empty list.
118
+ * @complexity O(n log n) time and O(n) space for n stored subscriptions; no I/O.
119
+ */
120
+ async list(required, optional = {}) {
121
+ const limit = Math.min(optional.limit ?? DEFAULT_LIST_LIMIT, DEFAULT_LIST_LIMIT);
122
+ if (optional.cursor != null)
123
+ decodeListCursor({ cursor: optional.cursor, shape: ['string'] });
124
+ return pageFromArray({ rows: this.rows.filter(r => r.workspaceId === required.workspaceId && r.listId === required.listId).map(row => ({ ...row })),
125
+ limit, cursor: optional.cursor ?? null, positionOf: row => [row.id], shape: ['string'] });
126
+ }
127
+ async listSubscribed(required) {
128
+ return this.rows.filter((r) => r.workspaceId === required.workspaceId && r.listId === required.listId && r.status === "subscribed").map((row) => ({ ...row }));
129
+ }
130
+ async save(row, optional = {}) {
131
+ const current = this.rows.find((item) => item.workspaceId === row.workspaceId && item.id === row.id);
132
+ assertNewsletterSave({ row, current, options: optional, entity: "subscription" });
133
+ upsertRecord({ records: this.rows, record: { ...row }, identity: { workspaceId: row.workspaceId, id: row.id } });
134
+ }
135
+ async remove(required) {
136
+ this.rows = this.rows.filter((r) => !(r.workspaceId === required.workspaceId && r.id === required.id));
137
+ }
138
+ }
139
+ export class InMemoryNewsletterAudienceSnapshotRepo {
140
+ rows;
141
+ constructor(_required = {}, { initialRows = [] } = {}) {
142
+ this.rows = [...initialRows];
143
+ }
144
+ async findByCampaignId(required) {
145
+ return (this.rows.find((r) => r.workspaceId === required.workspaceId && r.campaignId === required.campaignId) ?? null);
146
+ }
147
+ async findById(required) {
148
+ return this.rows.find((r) => r.workspaceId === required.workspaceId && r.id === required.id) ?? null;
149
+ }
150
+ async save(row) {
151
+ // INV-06: immutable after creation — `save` is create-only; a duplicate id is a caller bug.
152
+ const exists = this.rows.some((r) => r.workspaceId === row.workspaceId && r.id === row.id);
153
+ if (exists)
154
+ throw new Error(`AudienceSnapshotRow ${row.id} already exists and is immutable`);
155
+ this.rows.push(row);
156
+ }
157
+ }
158
+ export class InMemoryNewsletterSendRepo {
159
+ rows;
160
+ constructor(_required = {}, { initialRows = [] } = {}) {
161
+ this.rows = [...initialRows];
162
+ }
163
+ async findById(required) {
164
+ return this.rows.find((r) => r.workspaceId === required.workspaceId && r.id === required.id) ?? null;
165
+ }
166
+ async findByIdempotencyKey(required) {
167
+ return (this.rows.find((r) => r.workspaceId === required.workspaceId && r.idempotencyKey === required.idempotencyKey) ?? null);
168
+ }
169
+ async listByCampaign(required) {
170
+ const limit = required.limit ?? DEFAULT_LIST_LIMIT;
171
+ let rows = this.rows
172
+ .filter((r) => r.workspaceId === required.workspaceId && r.campaignId === required.campaignId)
173
+ .slice()
174
+ // Code-unit order, the same order the `afterId` cursor below (and SQL `id >`) pages by.
175
+ .sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
176
+ const afterId = required.afterId;
177
+ if (afterId) {
178
+ rows = rows.filter((r) => r.id > afterId);
179
+ }
180
+ return rows.slice(0, limit);
181
+ }
182
+ async listPendingByAudienceSnapshot(required) {
183
+ return this.rows
184
+ .filter((r) => r.workspaceId === required.workspaceId &&
185
+ r.audienceSnapshotId === required.audienceSnapshotId &&
186
+ r.status === "pending")
187
+ .slice(0, required.limit);
188
+ }
189
+ async countPendingByCampaign(required) {
190
+ return this.rows.filter((r) => r.workspaceId === required.workspaceId && r.campaignId === required.campaignId && r.status === "pending").length;
191
+ }
192
+ async save(row) {
193
+ upsertRecord({ records: this.rows, record: row, identity: { workspaceId: row.workspaceId, id: row.id } });
194
+ }
195
+ async saveBatch({ rows }, _optional = {}) {
196
+ for (const row of rows)
197
+ await this.save(row);
198
+ }
199
+ /**
200
+ * Atomically takes the dispatch lease on one send row (2026-09-16, see `ports.ts` doc). No `await`
201
+ * happens before the write, which is what makes this atomic in-process: a concurrent caller's own
202
+ * turn cannot interleave between the read and the write.
203
+ *
204
+ * @complexity O(rows.length) to locate the row.
205
+ */
206
+ async claimForDispatch(required) {
207
+ const idx = this.rows.findIndex((r) => r.workspaceId === required.workspaceId && r.id === required.id);
208
+ const row = idx >= 0 ? this.rows[idx] : undefined;
209
+ if (!row || row.status !== "pending" || (row.nextAttemptAt !== null && row.nextAttemptAt > required.nowIso))
210
+ return null;
211
+ const leased = { ...row, nextAttemptAt: required.leaseUntilIso, updatedAt: required.nowIso };
212
+ this.rows[idx] = leased;
213
+ return leased;
214
+ }
215
+ /**
216
+ * Atomically records a dispatch outcome (2026-09-16, see `ports.ts` doc). No `await` happens before
217
+ * the write, so a concurrent caller's own turn cannot interleave between the pending check and the
218
+ * write — the first call to run wins the row; a later concurrent call sees it already non-pending.
219
+ *
220
+ * @complexity O(rows.length) to locate the row.
221
+ */
222
+ async recordOutcome(required) {
223
+ const idx = this.rows.findIndex((r) => r.workspaceId === required.workspaceId && r.id === required.id);
224
+ const row = idx >= 0 ? this.rows[idx] : undefined;
225
+ if (!row || row.status !== "pending")
226
+ return null;
227
+ const recorded = {
228
+ ...row,
229
+ status: required.status,
230
+ attempts: row.attempts + 1,
231
+ providerMessageId: required.providerMessageId ?? row.providerMessageId,
232
+ lastError: required.lastError,
233
+ nextAttemptAt: null,
234
+ updatedAt: required.updatedAt,
235
+ };
236
+ this.rows[idx] = recorded;
237
+ return recorded;
238
+ }
239
+ }
240
+ export class InMemoryNewsletterConfirmationTokenRepo {
241
+ rows;
242
+ constructor(_required = {}, { initialRows = [] } = {}) {
243
+ this.rows = [...initialRows];
244
+ }
245
+ async findById(required) {
246
+ return this.rows.find((r) => r.workspaceId === required.workspaceId && r.id === required.id) ?? null;
247
+ }
248
+ async findUnconsumedBySubscription(required) {
249
+ return this.rows.filter((r) => r.workspaceId === required.workspaceId &&
250
+ r.subscriptionId === required.subscriptionId &&
251
+ r.consumedAt === null);
252
+ }
253
+ async findByTokenHash(required) {
254
+ return (this.rows.find((r) => r.workspaceId === required.workspaceId && r.tokenHash === required.tokenHash) ?? null);
255
+ }
256
+ async save(row) {
257
+ upsertRecord({ records: this.rows, record: row, identity: { workspaceId: row.workspaceId, id: row.id } });
258
+ }
259
+ }
260
+ //# sourceMappingURL=repo.memory.js.map
@@ -0,0 +1,221 @@
1
+ import type { Generated, Insertable, Kysely, Selectable } from "kysely";
2
+ import { type StorageKernel } from "@jini-ai/core/contracts/storage";
3
+ import type { AudienceSnapshotRow, CampaignRecord, CampaignRevision, ConfirmationTokenRecord, NewsletterListRow, SendRow, SubscriptionRow } from "./types.js";
4
+ /**
5
+ * @file Row types and mapping for the newsletter tables, shared by every dialect. The campaign pair
6
+ * is in the migrated core schema, so its columns are the generated `ContentDatabase` types
7
+ * (snake_case, JSON as compact text). The five `p_newsletter__*` tables are created by the
8
+ * dataModule engine (`data-module-manifest.ts`), not the migrated schema, so they are NOT in
9
+ * `ContentDatabase`: the repo brings them into a query with Kysely's `withTables<NewsletterTables>()`.
10
+ * Neutral on purpose: no repo, no driver.
11
+ *
12
+ * Now: the campaign pair's stored column shape is copied here without schema changes (the host owns
13
+ * that schema), the manifest is `@jini-ai/user-management/newsletter/data-module-manifest`, and every
14
+ * table name is host-owned ({@link NewsletterSqlTables}): each repo brings its tables into a query
15
+ * with Kysely's `withTables<…TableViews>()`.
16
+ */
17
+ /** Host-owned table names. No schema or product table defaults live in the adapters. */
18
+ export interface NewsletterSqlTables {
19
+ campaigns: string;
20
+ campaignRevisions: string;
21
+ lists: string;
22
+ subscriptions: string;
23
+ audienceSnapshots: string;
24
+ sends: string;
25
+ confirmationTokens: string;
26
+ }
27
+ /** Reported when a stored campaign revision cannot be read: identity and sequence only. The host binds its own logger. */
28
+ export type CampaignBodyReporter = (required: {
29
+ campaignId: string;
30
+ seq: number | null | undefined;
31
+ }, optional?: Record<string, never>) => void;
32
+ /** Constructor requirement shared by every newsletter SQL repo: the schema-free kernel and the host's table names. */
33
+ export interface NewsletterSqlRequired<K extends keyof NewsletterSqlTables = keyof NewsletterSqlTables> {
34
+ kernel: StorageKernel<Kysely<unknown>, unknown>;
35
+ tables: Pick<NewsletterSqlTables, K>;
36
+ }
37
+ /** Stored `newsletter_campaigns` columns, in the host schema's generated key order. */
38
+ export interface CampaignsTable {
39
+ id: string;
40
+ workspace_id: string;
41
+ status: string;
42
+ subject: string;
43
+ preheader: string | null;
44
+ from_name: string;
45
+ from_email: string;
46
+ reply_to: string;
47
+ list_id: string;
48
+ scheduled_at: string | null;
49
+ send_started_at: string | null;
50
+ audience_snapshot_id: string | null;
51
+ counters_json: string;
52
+ version: number;
53
+ created_by_principal: string;
54
+ created_by_kind: Generated<string>;
55
+ created_at: string;
56
+ updated_at: string;
57
+ }
58
+ /** Stored `newsletter_campaign_revisions` columns, in the host schema's generated key order. */
59
+ export interface CampaignRevisionsTable {
60
+ seq: Generated<number>;
61
+ campaign_id: string;
62
+ workspace_id: string;
63
+ state_json: string;
64
+ actor_id: string;
65
+ recorded_at: string;
66
+ }
67
+ export type ListTableRow = {
68
+ id: string;
69
+ workspace_id: string;
70
+ name: string;
71
+ slug: string;
72
+ is_default: number;
73
+ status: string;
74
+ created_at: string;
75
+ updated_at: string;
76
+ };
77
+ export type SubscriptionTableRow = {
78
+ id: string;
79
+ workspace_id: string;
80
+ list_id: string;
81
+ subscriber_id: string;
82
+ status: string;
83
+ source: string;
84
+ consent_revision_id_at_subscribe: string | null;
85
+ subscribed_at: string | null;
86
+ unsubscribed_at: string | null;
87
+ created_at: string;
88
+ updated_at: string;
89
+ };
90
+ export type AudienceSnapshotTableRow = {
91
+ id: string;
92
+ workspace_id: string;
93
+ campaign_id: string;
94
+ list_id: string;
95
+ recipient_count: number;
96
+ created_at: string;
97
+ };
98
+ export type SendTableRow = {
99
+ id: string;
100
+ workspace_id: string;
101
+ campaign_id: string;
102
+ audience_snapshot_id: string;
103
+ subscriber_id: string;
104
+ recipient_email: string;
105
+ status: string;
106
+ attempts: number;
107
+ idempotency_key: string;
108
+ provider_message_id: string | null;
109
+ last_error: string | null;
110
+ next_attempt_at: string | null;
111
+ created_at: string;
112
+ updated_at: string;
113
+ };
114
+ export type ConfirmationTokenTableRow = {
115
+ id: string;
116
+ workspace_id: string;
117
+ subscription_id: string;
118
+ token_hash: string;
119
+ purpose: string;
120
+ created_at: string;
121
+ expires_at: string;
122
+ consumed_at: string | null;
123
+ };
124
+ /** The tables the newsletter repos add to the content kernel's schema. Type aliases, not interfaces:
125
+ * Kysely's `withTables` needs the implicit index signature only an alias has.
126
+ * Now: one per-table view each, a `Record<string, Row>` alias keyed by the host-owned table name. */
127
+ export type ListTableViews = Record<string, ListTableRow>;
128
+ export type SubscriptionTableViews = Record<string, SubscriptionTableRow>;
129
+ export type AudienceSnapshotTableViews = Record<string, AudienceSnapshotTableRow>;
130
+ export type SendTableViews = Record<string, SendTableRow>;
131
+ export type ConfirmationTokenTableViews = Record<string, ConfirmationTokenTableRow>;
132
+ export type CampaignTableViews = Record<string, CampaignsTable>;
133
+ export type CampaignRevisionTableViews = Record<string, CampaignRevisionsTable>;
134
+ /**
135
+ * The view of the campaign pair a detail read correlates. Every name resolves to the union of their
136
+ * columns, which is exact here: the one column they share (`workspace_id`) has one type.
137
+ */
138
+ export type CampaignJoinTableViews = Record<string, CampaignsTable & CampaignRevisionsTable>;
139
+ export type CampaignTableRow = Selectable<CampaignsTable>;
140
+ export type CampaignRevisionTableRow = Selectable<CampaignRevisionsTable>;
141
+ /** One `newsletter_campaigns` row as a {@link CampaignRecord}.
142
+ * Now: an unreadable revision body goes to `onUnreadableBody`. */
143
+ export declare function toCampaignRecord({ row, onUnreadableBody }: {
144
+ row: CampaignTableRow & {
145
+ editorial_state_json?: string | null;
146
+ editorial_seq?: number | null;
147
+ };
148
+ onUnreadableBody: CampaignBodyReporter;
149
+ }, _optional?: Record<string, never>): CampaignRecord;
150
+ /** The `newsletter_campaigns` row an INSERT writes. */
151
+ export declare function toCampaignRow(c: CampaignRecord, _optional?: Record<string, never>): Insertable<CampaignsTable>;
152
+ /**
153
+ * The columns a re-save overwrites: everything except the key and the counters, which are
154
+ * insert-only here (`incrementCounter` owns them afterwards, see `ports.ts`).
155
+ */
156
+ export declare function updatableCampaignColumns(row: Insertable<CampaignsTable>, _optional?: Record<string, never>): {
157
+ version: number;
158
+ status: string;
159
+ workspace_id: string;
160
+ subject: string;
161
+ created_at: string;
162
+ updated_at: string;
163
+ list_id: string;
164
+ from_name: string;
165
+ from_email: string;
166
+ reply_to: string;
167
+ created_by_principal: string;
168
+ preheader?: string | null;
169
+ audience_snapshot_id?: string | null;
170
+ scheduled_at?: string | null;
171
+ send_started_at?: string | null;
172
+ };
173
+ /** One `newsletter_campaign_revisions` row as a {@link CampaignRevision}. */
174
+ export declare function toCampaignRevision(row: CampaignRevisionTableRow): CampaignRevision;
175
+ /** One `p_newsletter__lists` row as a {@link NewsletterListRow}; `is_default` is read through `toBool`. */
176
+ export declare function toListRecord(row: Selectable<ListTableRow>): NewsletterListRow;
177
+ /** The `p_newsletter__lists` row an INSERT writes. */
178
+ export declare function toListRow(row: NewsletterListRow, _optional?: Record<string, never>): Insertable<ListTableRow>;
179
+ /** The columns a re-save of a list overwrites: everything except the key, workspace and creation time. */
180
+ export declare function updatableListColumns(row: Insertable<ListTableRow>, _optional?: Record<string, never>): {
181
+ status: string;
182
+ name: string;
183
+ slug: string;
184
+ updated_at: string;
185
+ is_default: number;
186
+ };
187
+ /** One `p_newsletter__subscriptions` row as a {@link SubscriptionRow}. */
188
+ export declare function toSubscriptionRecord(row: Selectable<SubscriptionTableRow>): SubscriptionRow;
189
+ /** The `p_newsletter__subscriptions` row an INSERT writes. */
190
+ export declare function toSubscriptionRow(row: SubscriptionRow, _optional?: Record<string, never>): Insertable<SubscriptionTableRow>;
191
+ /** The columns a re-save of a subscription overwrites: its lifecycle, not its identity (list, subscriber, source, creation). */
192
+ export declare function updatableSubscriptionColumns(row: Insertable<SubscriptionTableRow>, _optional?: Record<string, never>): {
193
+ status: string;
194
+ consent_revision_id_at_subscribe: string | null | undefined;
195
+ subscribed_at: string | null | undefined;
196
+ unsubscribed_at: string | null | undefined;
197
+ updated_at: string;
198
+ };
199
+ /** One `p_newsletter__audience_snapshots` row as an {@link AudienceSnapshotRow}. */
200
+ export declare function toAudienceSnapshotRecord(row: Selectable<AudienceSnapshotTableRow>, _optional?: Record<string, never>): AudienceSnapshotRow;
201
+ /** The `p_newsletter__audience_snapshots` row an INSERT writes. */
202
+ export declare function toAudienceSnapshotRow(row: AudienceSnapshotRow, _optional?: Record<string, never>): Insertable<AudienceSnapshotTableRow>;
203
+ /** One `p_newsletter__sends` row as a {@link SendRow}. */
204
+ export declare function toSendRecord(row: Selectable<SendTableRow>): SendRow;
205
+ /** The `p_newsletter__sends` row an INSERT writes. */
206
+ export declare function toSendRow(row: SendRow, _optional?: Record<string, never>): Insertable<SendTableRow>;
207
+ /** The columns a re-save of a send overwrites: its delivery state, not its identity (campaign, snapshot, subscriber, key). */
208
+ export declare function updatableSendColumns(row: Insertable<SendTableRow>, _optional?: Record<string, never>): {
209
+ status: string;
210
+ attempts: number;
211
+ provider_message_id: string | null | undefined;
212
+ last_error: string | null | undefined;
213
+ next_attempt_at: string | null | undefined;
214
+ recipient_email: string;
215
+ updated_at: string;
216
+ };
217
+ /** One `p_newsletter__confirmation_tokens` row as a {@link ConfirmationTokenRecord}. */
218
+ export declare function toConfirmationTokenRecord(row: Selectable<ConfirmationTokenTableRow>): ConfirmationTokenRecord;
219
+ /** The `p_newsletter__confirmation_tokens` row an INSERT writes. */
220
+ export declare function toConfirmationTokenRow(row: ConfirmationTokenRecord, _optional?: Record<string, never>): Insertable<ConfirmationTokenTableRow>;
221
+ //# sourceMappingURL=repo.rows.d.ts.map