@jini-ai/user-management 0.7.3-next.1 → 0.7.3-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +55 -2
- package/dist/admin/adapters/memory.js +4 -4
- package/dist/admin-http/auth/auth-request.d.ts +112 -0
- package/dist/admin-http/auth/auth-request.js +32 -0
- package/dist/admin-http/auth/boot-redemption.d.ts +9 -0
- package/dist/admin-http/auth/boot-redemption.js +17 -0
- package/dist/admin-http/auth/boot-session.d.ts +30 -0
- package/dist/admin-http/auth/boot-session.js +40 -0
- package/dist/admin-http/auth/current-user.d.ts +28 -0
- package/dist/admin-http/auth/current-user.js +34 -0
- package/dist/admin-http/auth/index.d.ts +17 -0
- package/dist/admin-http/auth/index.js +9 -0
- package/dist/admin-http/auth/local-boot-session.d.ts +9 -0
- package/dist/admin-http/auth/local-boot-session.js +30 -0
- package/dist/admin-http/auth/logout.d.ts +10 -0
- package/dist/admin-http/auth/logout.js +17 -0
- package/dist/admin-http/auth/mfa-login.d.ts +30 -0
- package/dist/admin-http/auth/mfa-login.js +43 -0
- package/dist/admin-http/auth/password-login.d.ts +35 -0
- package/dist/admin-http/auth/password-login.js +52 -0
- package/dist/admin-http/auth/password-status.d.ts +34 -0
- package/dist/admin-http/auth/password-status.js +42 -0
- package/dist/admin-http/http/api-keys.d.ts +45 -0
- package/dist/admin-http/http/api-keys.js +28 -0
- package/dist/admin-http/http/users.d.ts +71 -0
- package/dist/admin-http/http/users.js +42 -0
- package/dist/admin-http/owner/mfa-deps.d.ts +41 -0
- package/dist/admin-http/owner/mfa-deps.js +26 -0
- package/dist/admin-http/owner/mfa-routes.d.ts +72 -0
- package/dist/admin-http/owner/mfa-routes.js +105 -0
- package/dist/admin-http/owner/passkey-admission.d.ts +46 -0
- package/dist/admin-http/owner/passkey-admission.js +23 -0
- package/dist/admin-http/owner/passkey-route-deps.d.ts +53 -0
- package/dist/admin-http/owner/passkey-route-deps.js +33 -0
- package/dist/admin-http/owner/passkey-routes.d.ts +146 -0
- package/dist/admin-http/owner/passkey-routes.js +98 -0
- package/dist/admin-http/owner/recovery-routes.d.ts +71 -0
- package/dist/admin-http/owner/recovery-routes.js +112 -0
- package/dist/admin-http/routes/api-keys/create-principal.d.ts +26 -0
- package/dist/admin-http/routes/api-keys/create-principal.js +37 -0
- package/dist/admin-http/routes/api-keys/issue.d.ts +32 -0
- package/dist/admin-http/routes/api-keys/issue.js +38 -0
- package/dist/admin-http/routes/api-keys/revoke.d.ts +26 -0
- package/dist/admin-http/routes/api-keys/revoke.js +31 -0
- package/dist/admin-http/routes/api-keys/shared.d.ts +46 -0
- package/dist/admin-http/routes/api-keys/shared.js +38 -0
- package/dist/admin-http/routes/users/access-shared.d.ts +103 -0
- package/dist/admin-http/routes/users/access-shared.js +85 -0
- package/dist/admin-http/routes/users/assign-role.d.ts +24 -0
- package/dist/admin-http/routes/users/assign-role.js +30 -0
- package/dist/admin-http/routes/users/attach-policy.d.ts +25 -0
- package/dist/admin-http/routes/users/attach-policy.js +31 -0
- package/dist/admin-http/routes/users/create-policy.d.ts +19 -0
- package/dist/admin-http/routes/users/create-policy.js +28 -0
- package/dist/admin-http/routes/users/create-role.d.ts +15 -0
- package/dist/admin-http/routes/users/create-role.js +21 -0
- package/dist/admin-http/routes/users/create.d.ts +32 -0
- package/dist/admin-http/routes/users/create.js +67 -0
- package/dist/admin-http/routes/users/delete-policy.d.ts +16 -0
- package/dist/admin-http/routes/users/delete-policy.js +24 -0
- package/dist/admin-http/routes/users/delete-role.d.ts +16 -0
- package/dist/admin-http/routes/users/delete-role.js +24 -0
- package/dist/admin-http/routes/users/delete.d.ts +35 -0
- package/dist/admin-http/routes/users/delete.js +35 -0
- package/dist/admin-http/routes/users/disable.d.ts +31 -0
- package/dist/admin-http/routes/users/disable.js +38 -0
- package/dist/admin-http/routes/users/enable.d.ts +32 -0
- package/dist/admin-http/routes/users/enable.js +45 -0
- package/dist/admin-http/routes/users/list-policies.d.ts +18 -0
- package/dist/admin-http/routes/users/list-policies.js +20 -0
- package/dist/admin-http/routes/users/list-policy-permissions.d.ts +28 -0
- package/dist/admin-http/routes/users/list-policy-permissions.js +30 -0
- package/dist/admin-http/routes/users/list-roles.d.ts +18 -0
- package/dist/admin-http/routes/users/list-roles.js +20 -0
- package/dist/admin-http/routes/users/list.d.ts +40 -0
- package/dist/admin-http/routes/users/list.js +82 -0
- package/dist/admin-http/routes/users/remove-policy-permission.d.ts +48 -0
- package/dist/admin-http/routes/users/remove-policy-permission.js +62 -0
- package/dist/admin-http/routes/users/reset-password.d.ts +33 -0
- package/dist/admin-http/routes/users/reset-password.js +52 -0
- package/dist/admin-http/routes/users/shared.d.ts +124 -0
- package/dist/admin-http/routes/users/shared.js +93 -0
- package/dist/admin-http/routes/users/update-policy.d.ts +25 -0
- package/dist/admin-http/routes/users/update-policy.js +30 -0
- package/dist/admin-http/routes/users/update-role.d.ts +23 -0
- package/dist/admin-http/routes/users/update-role.js +29 -0
- package/dist/admin-http/routes/users/update.d.ts +35 -0
- package/dist/admin-http/routes/users/update.js +78 -0
- package/dist/admin-http/routes/users/write-policy-permission.d.ts +31 -0
- package/dist/admin-http/routes/users/write-policy-permission.js +45 -0
- package/dist/core/ports.d.ts +22 -3
- package/dist/core/types.d.ts +17 -5
- package/dist/core/types.js +12 -0
- package/dist/identity/api-key-secret.d.ts +68 -0
- package/dist/identity/api-key-secret.js +229 -0
- package/dist/identity/api-key-service.d.ts +144 -0
- package/dist/identity/api-key-service.js +389 -0
- package/dist/identity/api-key-types.d.ts +79 -0
- package/dist/identity/api-key-types.js +2 -0
- package/dist/identity/boot-session-token.d.ts +18 -0
- package/dist/identity/boot-session-token.js +92 -0
- package/dist/identity/builtin-role-grants.d.ts +120 -0
- package/dist/identity/builtin-role-grants.js +88 -0
- package/dist/identity/delete-user-service.d.ts +195 -0
- package/dist/identity/delete-user-service.js +275 -0
- package/dist/identity/owner-reset-env.d.ts +37 -0
- package/dist/identity/owner-reset-env.js +38 -0
- package/dist/identity/permission-grants.d.ts +31 -0
- package/dist/identity/permission-grants.js +12 -0
- package/dist/identity/permission-list-tool.d.ts +35 -0
- package/dist/identity/permission-list-tool.js +47 -0
- package/dist/identity/repo.authentication.d.ts +57 -0
- package/dist/identity/repo.authentication.js +153 -0
- package/dist/identity/repo.authorization.d.ts +82 -0
- package/dist/identity/repo.authorization.js +203 -0
- package/dist/identity/repo.d.ts +87 -0
- package/dist/identity/repo.js +167 -0
- package/dist/identity/repo.memory.d.ts +31 -0
- package/dist/identity/repo.memory.js +37 -0
- package/dist/identity/role-manage-permission.d.ts +34 -0
- package/dist/identity/role-manage-permission.js +39 -0
- package/dist/identity/site-key-permission.d.ts +66 -0
- package/dist/identity/site-key-permission.js +92 -0
- package/dist/identity/sql/kernel-user-purge.d.ts +19 -0
- package/dist/identity/sql/kernel-user-purge.js +34 -0
- package/dist/identity/sql/kernel-user-trash-store.d.ts +15 -0
- package/dist/identity/sql/kernel-user-trash-store.js +41 -0
- package/dist/identity/sql/user-trash-adapter.d.ts +87 -0
- package/dist/identity/sql/user-trash-adapter.js +124 -0
- package/dist/identity/tool-registrations.d.ts +100 -0
- package/dist/identity/tool-registrations.js +257 -0
- package/dist/identity/user-manage-permission.d.ts +8 -0
- package/dist/identity/user-manage-permission.js +8 -0
- package/dist/identity/user-purge-types.d.ts +85 -0
- package/dist/identity/user-purge-types.js +17 -0
- package/dist/identity/user-purge.d.ts +69 -0
- package/dist/identity/user-purge.js +46 -0
- package/dist/identity/username-change-ports.d.ts +15 -0
- package/dist/identity/username-change-ports.js +22 -0
- package/dist/mail/site/capture-clear.d.ts +58 -0
- package/dist/mail/site/capture-clear.js +21 -0
- package/dist/mail/status/agent-tools.d.ts +65 -0
- package/dist/mail/status/agent-tools.js +22 -0
- package/dist/mail/status/delivery-agent-tools.d.ts +206 -0
- package/dist/mail/status/delivery-agent-tools.js +63 -0
- package/dist/mail/status/delivery-tool-registrations.d.ts +216 -0
- package/dist/mail/status/delivery-tool-registrations.js +110 -0
- package/dist/mail/status/domain-deps.d.ts +25 -0
- package/dist/mail/status/domain-deps.js +23 -0
- package/dist/mail/status/permissions.d.ts +43 -0
- package/dist/mail/status/permissions.js +45 -0
- package/dist/mail/status/provider-agent-tools.d.ts +38 -0
- package/dist/mail/status/provider-agent-tools.js +17 -0
- package/dist/mail/status/provider-operations.d.ts +166 -0
- package/dist/mail/status/provider-operations.js +121 -0
- package/dist/mail/status/provider-tool-registrations.d.ts +65 -0
- package/dist/mail/status/provider-tool-registrations.js +106 -0
- package/dist/mail/status/tool-registrations.d.ts +152 -0
- package/dist/mail/status/tool-registrations.js +112 -0
- package/dist/member-login/credentials.d.ts +40 -0
- package/dist/member-login/credentials.js +26 -0
- package/dist/member-login/link-service.d.ts +66 -0
- package/dist/member-login/link-service.js +141 -0
- package/dist/member-login/oidc-login.d.ts +132 -0
- package/dist/member-login/oidc-login.js +206 -0
- package/dist/member-login/oidc-request.d.ts +80 -0
- package/dist/member-login/oidc-request.js +86 -0
- package/dist/member-login/providers.d.ts +79 -0
- package/dist/member-login/providers.js +41 -0
- package/dist/member-login/ready-providers.d.ts +17 -0
- package/dist/member-login/ready-providers.js +11 -0
- package/dist/member-login/unlink-identity.d.ts +26 -0
- package/dist/member-login/unlink-identity.js +59 -0
- package/dist/members/access-resolver.d.ts +107 -0
- package/dist/members/access-resolver.js +231 -0
- package/dist/members/agent-tools.d.ts +14 -0
- package/dist/members/agent-tools.js +139 -0
- package/dist/members/auth-mail.d.ts +27 -0
- package/dist/members/auth-mail.js +21 -0
- package/dist/members/capability-card.d.ts +18 -0
- package/dist/members/capability-card.js +27 -0
- package/dist/members/consent-service.d.ts +115 -0
- package/dist/members/consent-service.js +179 -0
- package/dist/members/member-admin-writes.d.ts +73 -0
- package/dist/members/member-admin-writes.js +149 -0
- package/dist/members/member-challenge-request.d.ts +59 -0
- package/dist/members/member-challenge-request.js +145 -0
- package/dist/members/member-challenge.d.ts +37 -0
- package/dist/members/member-challenge.js +84 -0
- package/dist/members/member-credentials.d.ts +35 -0
- package/dist/members/member-credentials.js +57 -0
- package/dist/members/member-sign-in.d.ts +44 -0
- package/dist/members/member-sign-in.js +130 -0
- package/dist/members/member-validation.d.ts +5 -0
- package/dist/members/member-validation.js +13 -0
- package/dist/members/password-auth.d.ts +55 -0
- package/dist/members/password-auth.js +177 -0
- package/dist/members/ports.d.ts +455 -0
- package/dist/members/ports.js +21 -0
- package/dist/members/public-member-auth-response.d.ts +68 -0
- package/dist/members/public-member-auth-response.js +45 -0
- package/dist/members/public-member-response.d.ts +25 -0
- package/dist/members/public-member-response.js +15 -0
- package/dist/members/repo.d.ts +199 -0
- package/dist/members/repo.js +324 -0
- package/dist/members/repo.memory.d.ts +276 -0
- package/dist/members/repo.memory.js +395 -0
- package/dist/members/repo.rows.d.ts +153 -0
- package/dist/members/repo.rows.js +250 -0
- package/dist/members/repo.sessions.d.ts +80 -0
- package/dist/members/repo.sessions.js +166 -0
- package/dist/members/repo.sql.d.ts +9 -0
- package/dist/members/repo.sql.js +11 -0
- package/dist/members/subscriber-directory.d.ts +85 -0
- package/dist/members/subscriber-directory.js +70 -0
- package/dist/members/tool-registrations.d.ts +143 -0
- package/dist/members/tool-registrations.js +247 -0
- package/dist/members/trash-member.d.ts +24 -0
- package/dist/members/trash-member.js +24 -0
- package/dist/members/types.d.ts +321 -0
- package/dist/members/types.js +34 -0
- package/dist/members/write-service.d.ts +17 -0
- package/dist/members/write-service.js +15 -0
- package/dist/newsletter/agent-tools.d.ts +20 -0
- package/dist/newsletter/agent-tools.js +236 -0
- package/dist/newsletter/campaign-write-service.d.ts +92 -0
- package/dist/newsletter/campaign-write-service.js +190 -0
- package/dist/newsletter/campaign.d.ts +53 -0
- package/dist/newsletter/campaign.js +95 -0
- package/dist/newsletter/confirmation.d.ts +75 -0
- package/dist/newsletter/confirmation.js +142 -0
- package/dist/newsletter/data-module-manifest.d.ts +68 -0
- package/dist/newsletter/data-module-manifest.js +126 -0
- package/dist/newsletter/delivery/tool-registrations.d.ts +67 -0
- package/dist/newsletter/delivery/tool-registrations.js +229 -0
- package/dist/newsletter/errors.d.ts +93 -0
- package/dist/newsletter/errors.js +93 -0
- package/dist/newsletter/hooks.d.ts +59 -0
- package/dist/newsletter/hooks.js +49 -0
- package/dist/newsletter/http-error-responses.d.ts +17 -0
- package/dist/newsletter/http-error-responses.js +96 -0
- package/dist/newsletter/launch-gate.d.ts +62 -0
- package/dist/newsletter/launch-gate.js +29 -0
- package/dist/newsletter/lists.d.ts +60 -0
- package/dist/newsletter/lists.js +83 -0
- package/dist/newsletter/ports.d.ts +278 -0
- package/dist/newsletter/ports.js +2 -0
- package/dist/newsletter/repo-sends.d.ts +82 -0
- package/dist/newsletter/repo-sends.js +178 -0
- package/dist/newsletter/repo-subscribers.d.ts +82 -0
- package/dist/newsletter/repo-subscribers.js +193 -0
- package/dist/newsletter/repo.d.ts +61 -0
- package/dist/newsletter/repo.js +147 -0
- package/dist/newsletter/repo.memory.d.ts +201 -0
- package/dist/newsletter/repo.memory.js +250 -0
- package/dist/newsletter/repo.rows.d.ts +221 -0
- package/dist/newsletter/repo.rows.js +260 -0
- package/dist/newsletter/send-pipeline.d.ts +236 -0
- package/dist/newsletter/send-pipeline.js +514 -0
- package/dist/newsletter/subscriptions.d.ts +87 -0
- package/dist/newsletter/subscriptions.js +119 -0
- package/dist/newsletter/tool-registrations.d.ts +89 -0
- package/dist/newsletter/tool-registrations.deps.d.ts +9 -0
- package/dist/newsletter/tool-registrations.deps.js +9 -0
- package/dist/newsletter/tool-registrations.js +133 -0
- package/dist/newsletter/tool-registrations.read.d.ts +76 -0
- package/dist/newsletter/tool-registrations.read.js +140 -0
- package/dist/newsletter/tool-registrations.write.d.ts +54 -0
- package/dist/newsletter/tool-registrations.write.js +229 -0
- package/dist/newsletter/types.d.ts +279 -0
- package/dist/newsletter/types.js +23 -0
- package/dist/newsletter/unsubscribe.d.ts +41 -0
- package/dist/newsletter/unsubscribe.js +100 -0
- package/dist/project-keys/attached-vault.d.ts +23 -0
- package/dist/project-keys/attached-vault.js +65 -0
- package/dist/project-keys/create-vault.d.ts +17 -0
- package/dist/project-keys/create-vault.js +29 -0
- package/dist/project-keys/service.d.ts +133 -0
- package/dist/project-keys/service.js +128 -0
- package/dist/project-keys/site-references.d.ts +30 -0
- package/dist/project-keys/site-references.js +63 -0
- package/dist/project-keys/site-sealer.d.ts +28 -0
- package/dist/project-keys/site-sealer.js +64 -0
- package/dist/project-keys/sql/attachments.d.ts +33 -0
- package/dist/project-keys/sql/attachments.js +55 -0
- package/dist/project-keys/tools.d.ts +86 -0
- package/dist/project-keys/tools.js +66 -0
- package/dist/public-http/routes/mail/feedback.d.ts +44 -0
- package/dist/public-http/routes/mail/feedback.js +17 -0
- package/dist/public-http/routes/newsletter/confirm.d.ts +38 -0
- package/dist/public-http/routes/newsletter/confirm.js +33 -0
- package/dist/public-http/routes/newsletter/page.d.ts +29 -0
- package/dist/public-http/routes/newsletter/page.js +34 -0
- package/dist/public-http/routes/newsletter/unsubscribe.d.ts +33 -0
- package/dist/public-http/routes/newsletter/unsubscribe.js +35 -0
- package/dist/react/auth/Passkeys.d.ts +2 -34
- package/dist/react/auth/RecoveryCodesCard.d.ts +27 -0
- package/dist/react/auth/RecoveryCodesCard.hooks.d.ts +67 -0
- package/dist/react/auth/RecoveryCodesCard.hooks.js +38 -0
- package/dist/react/auth/RecoveryCodesCard.js +56 -0
- package/dist/react/auth/TotpSettings.d.ts +2 -23
- package/dist/react/auth/local-owner-signin.d.ts +40 -0
- package/dist/react/auth/local-owner-signin.js +25 -0
- package/dist/react/auth/owner-mfa-api.d.ts +10 -0
- package/dist/react/auth/owner-mfa-api.js +17 -0
- package/dist/react/auth/owner-passkey-api.d.ts +11 -0
- package/dist/react/auth/owner-passkey-api.js +17 -0
- package/dist/react/auth/owner-recovery-api.d.ts +51 -0
- package/dist/react/auth/owner-recovery-api.js +29 -0
- package/dist/react/auth/owner-request.d.ts +7 -0
- package/dist/react/auth/owner-request.js +2 -0
- package/dist/react/index.d.ts +10 -0
- package/dist/react/index.js +6 -0
- package/dist/react/mail/Email.d.ts +20 -0
- package/dist/react/mail/Email.js +143 -0
- package/dist/react/mail/EmailProviderTab.d.ts +34 -0
- package/dist/react/mail/EmailProviderTab.js +132 -0
- package/dist/react/mail/EmailSegments.d.ts +24 -0
- package/dist/react/mail/EmailSegments.js +15 -0
- package/dist/react/mail/EmailTemplateEditor.d.ts +146 -0
- package/dist/react/mail/EmailTemplateEditor.js +116 -0
- package/dist/react/mail/email-view.types.d.ts +236 -0
- package/dist/react/mail/email-view.types.js +2 -0
- package/dist/react/members/Members.d.ts +5 -3
- package/dist/react/members/Members.js +3 -3
- package/dist/react/members/api/members-api.d.ts +37 -0
- package/dist/react/members/api/members-api.js +16 -0
- package/dist/react/members/hooks/use-members.hooks.js +2 -1
- package/dist/react/members/members-i18n.d.ts +23 -0
- package/dist/react/members/members-i18n.js +25 -0
- package/dist/react/members/members-i18n.locales-a.d.ts +4 -0
- package/dist/react/members/members-i18n.locales-a.js +294 -0
- package/dist/react/members/members-i18n.locales-b.d.ts +4 -0
- package/dist/react/members/members-i18n.locales-b.js +265 -0
- package/dist/react/models.d.ts +1 -49
- package/dist/react/ports.d.ts +3 -143
- package/dist/react/roles/api/roles-api.d.ts +74 -0
- package/dist/react/roles/api/roles-api.js +22 -0
- package/dist/react/testing.js +18 -9
- package/dist/react/users/UsersPanel.d.ts +30 -0
- package/dist/react/users/UsersPanel.hooks.d.ts +8 -0
- package/dist/react/users/UsersPanel.hooks.js +9 -0
- package/dist/react/users/UsersPanel.js +9 -0
- package/dist/react/users/api/users-api.d.ts +65 -0
- package/dist/react/users/api/users-api.js +46 -0
- package/dist/react/users/hooks/use-localized-users.hooks.d.ts +43 -0
- package/dist/react/users/hooks/use-localized-users.hooks.js +15 -0
- package/dist/react/users/hooks/use-users-state.hooks.d.ts +18 -18
- package/dist/react/users/password-reset-notice.d.ts +8 -0
- package/dist/react/users/password-reset-notice.js +36 -0
- package/dist/server/admin-crud-service.d.ts +4 -10
- package/dist/server/admin-crud-service.js +20 -6
- package/dist/server/agent-tool-registrations.js +20 -5
- package/dist/server/agent-tools.js +16 -3
- package/dist/server/auth-challenge.d.ts +1 -1
- package/dist/server/auth-service.js +2 -1
- package/dist/server/grant-service.d.ts +1 -0
- package/dist/server/grant-service.js +7 -4
- package/dist/server/mfa/passkey-service.d.ts +2 -2
- package/dist/server/mfa/passkey-service.js +1 -1
- package/dist/server/mfa/service.js +6 -4
- package/dist/server/repo.memory.d.ts +30 -2
- package/dist/server/repo.memory.js +58 -4
- package/dist/server/seed.js +3 -3
- package/dist/server/sql/assignments.d.ts +90 -0
- package/dist/server/sql/assignments.js +128 -0
- package/dist/server/sql/index.d.ts +6 -0
- package/dist/server/sql/index.js +5 -0
- package/dist/server/sql/kernel.d.ts +9 -0
- package/dist/server/sql/kernel.js +2 -0
- package/dist/server/sql/mfa.d.ts +36 -0
- package/dist/server/sql/mfa.js +51 -0
- package/dist/server/sql/passkeys.d.ts +25 -0
- package/dist/server/sql/passkeys.js +33 -0
- package/dist/server/sql/recovery-codes.d.ts +22 -0
- package/dist/server/sql/recovery-codes.js +32 -0
- package/package.json +910 -12
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { UUID } from "@jini-ai/core/primitives";
|
|
2
|
+
import type { DomainEvent } from "@jini-ai/core/contracts/events";
|
|
3
|
+
/**
|
|
4
|
+
* @file `DELETE_USER`'s purge port (delete-user plan, 2026-09-24, decision 2/7).
|
|
5
|
+
*
|
|
6
|
+
* Purpose:
|
|
7
|
+
* `@jini-ai/cms/identity` has no delete method on any of its nine repo ports — user removal is a
|
|
8
|
+
* host-local transition, so its port is declared HERE rather than in the library, the same
|
|
9
|
+
* reasoning `api-key-types.ts`'s header gives for the tenth (`ApiKeyRepoPort`) port living in this
|
|
10
|
+
* repo. `UserPurgePort` is the eleventh: one method, `purgeUser`, that hard-deletes every identity
|
|
11
|
+
* row a principal owns (`principal_roles`, `principal_policies`, `sessions`, `api_keys`,
|
|
12
|
+
* `setting_values_user`, `admin_execution_credentials`, `identity_users`, `principals`) and appends
|
|
13
|
+
* an audit event, all as one atomic unit — see `user-purge.ts`'s class doc for why that
|
|
14
|
+
* atomicity requires a real SQL transaction the in-memory store cannot offer.
|
|
15
|
+
*
|
|
16
|
+
* `purgeUser` takes a `buildEvent` callback rather than an already-built `DomainEvent` (adjusted
|
|
17
|
+
* from the delete-user plan's original "caller builds the event" wording, disclosed as a deviation
|
|
18
|
+
* in the Slice 2 handoff): the event's payload must report exactly which rows were removed
|
|
19
|
+
* (`PurgeCounts`), and those counts are only known once the deletes have actually run — which, for
|
|
20
|
+
* the atomicity guarantee above, has to happen inside the SAME transaction as the outbox insert.
|
|
21
|
+
* The caller (`delete-user-service.ts`, and delete-user plan v2's `adapters/user.ts`) still owns
|
|
22
|
+
* every other event field (id, name, timestamps, actor, aggregate, payload shape) — it just
|
|
23
|
+
* receives the counts as the callback's argument instead of guessing them up front.
|
|
24
|
+
*
|
|
25
|
+
* `reason` (delete-user plan v2, decision 6) is optional and additive: a caller purging through the
|
|
26
|
+
* Trash states whether this was a hand-triggered permanent delete (`"manual"`) or the retention
|
|
27
|
+
* sweeper's automatic purge (`"retention"`), and that same value is handed back to `buildEvent` so
|
|
28
|
+
* the event payload can report it. `delete-user-service.ts`'s existing call site passes neither and
|
|
29
|
+
* its `buildEvent` callback ignores the second argument, so its behavior is unchanged.
|
|
30
|
+
*
|
|
31
|
+
* Architectural role:
|
|
32
|
+
* Interfaces and types only — no logic, mirroring `api-key-types.ts`'s own split. The two adapters
|
|
33
|
+
* are `InMemoryUserPurge` (below — refuses outright, see its own doc) and `SqlUserPurge`
|
|
34
|
+
* (`user-purge.ts`; `SqliteUserPurge` is its content-db subclass) — an ADR-006 rule-of-two, not a single-adapter port.
|
|
35
|
+
*/
|
|
36
|
+
/** Exact row counts `purgeUser` removed, one field per purged table (decision 2's list, minus
|
|
37
|
+
* `identity_users`/`principals` themselves, which are single-row-per-principal by construction and
|
|
38
|
+
* need no count). Returned so the audit event payload and the caller's response can both report
|
|
39
|
+
* precisely what was removed instead of re-deriving it from a second read. */
|
|
40
|
+
export interface PurgeCounts {
|
|
41
|
+
roles: number;
|
|
42
|
+
policies: number;
|
|
43
|
+
sessions: number;
|
|
44
|
+
apiKeys: number;
|
|
45
|
+
userSettings: number;
|
|
46
|
+
}
|
|
47
|
+
/** Why a purge happened — see this file's header for why it exists and why it is optional. */
|
|
48
|
+
export type UserPurgeReason = "manual" | "retention";
|
|
49
|
+
export interface UserPurgePort {
|
|
50
|
+
/**
|
|
51
|
+
* Hard-deletes `principalId`'s identity rows in `workspaceId`, then calls `buildEvent` with the
|
|
52
|
+
* exact counts just removed (and `reason`, verbatim) and appends the returned event to the
|
|
53
|
+
* outbox — all inside the same atomic unit as the deletes. `buildEvent` must be a pure,
|
|
54
|
+
* synchronous, side-effect-free function of its arguments (the real adapter calls it
|
|
55
|
+
* mid-transaction).
|
|
56
|
+
*/
|
|
57
|
+
purgeUser(required: {
|
|
58
|
+
workspaceId: UUID;
|
|
59
|
+
principalId: UUID;
|
|
60
|
+
buildEvent: (required: {
|
|
61
|
+
removed: PurgeCounts;
|
|
62
|
+
}, optional?: {
|
|
63
|
+
reason?: UserPurgeReason;
|
|
64
|
+
}) => DomainEvent;
|
|
65
|
+
reason?: UserPurgeReason;
|
|
66
|
+
}): Promise<PurgeCounts>;
|
|
67
|
+
}
|
|
68
|
+
/** Thrown by `InMemoryUserPurge.purgeUser` below; mapped to 501 `NOT_SUPPORTED` at the route layer
|
|
69
|
+
* (delete-user plan decision 4's last rule). */
|
|
70
|
+
export declare class UserDeleteUnsupportedError extends Error {
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The in-memory identity store (`@jini-ai/cms/identity`'s `InMemoryPrincipalRepo` et al., used by
|
|
74
|
+
* the hermetic test/dev composition root) has no delete methods at all — faking a purge over it
|
|
75
|
+
* would either silently no-op (a purge that doesn't purge) or hand-roll a second, untested deletion
|
|
76
|
+
* path with no transactional guarantee. Refusing outright is the honest behavior: `DELETE_USER` is
|
|
77
|
+
* SQLite-only until the in-memory store grows real delete support.
|
|
78
|
+
*/
|
|
79
|
+
export declare class InMemoryUserPurge implements UserPurgePort {
|
|
80
|
+
purgeUser(_required: {
|
|
81
|
+
workspaceId: UUID;
|
|
82
|
+
principalId: UUID;
|
|
83
|
+
}): Promise<PurgeCounts>;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=user-purge-types.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Thrown by `InMemoryUserPurge.purgeUser` below; mapped to 501 `NOT_SUPPORTED` at the route layer
|
|
2
|
+
* (delete-user plan decision 4's last rule). */
|
|
3
|
+
export class UserDeleteUnsupportedError extends Error {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The in-memory identity store (`@jini-ai/cms/identity`'s `InMemoryPrincipalRepo` et al., used by
|
|
7
|
+
* the hermetic test/dev composition root) has no delete methods at all — faking a purge over it
|
|
8
|
+
* would either silently no-op (a purge that doesn't purge) or hand-roll a second, untested deletion
|
|
9
|
+
* path with no transactional guarantee. Refusing outright is the honest behavior: `DELETE_USER` is
|
|
10
|
+
* SQLite-only until the in-memory store grows real delete support.
|
|
11
|
+
*/
|
|
12
|
+
export class InMemoryUserPurge {
|
|
13
|
+
async purgeUser(_required) {
|
|
14
|
+
throw new UserDeleteUnsupportedError("user delete requires the SQLite identity store");
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=user-purge-types.js.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { UUID } from "@jini-ai/core/primitives";
|
|
2
|
+
import type { DomainEvent } from "@jini-ai/core/contracts/events";
|
|
3
|
+
import type { PurgeCounts, UserPurgePort, UserPurgeReason } from "./user-purge-types.js";
|
|
4
|
+
/**
|
|
5
|
+
* @file `UserPurgePort`'s real adapter (delete-user plan decision 2/7) — the only one that can
|
|
6
|
+
* actually delete anything, since it is backed by real SQL tables. One Kysely query body for every
|
|
7
|
+
* dialect (storage plan §4, ADR-066); `user-purge.sqlite.ts` is the thin subclass built from the
|
|
8
|
+
* content db handle.
|
|
9
|
+
*/
|
|
10
|
+
type Scope = {
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
principalId: string;
|
|
13
|
+
};
|
|
14
|
+
/** The principal-scoped tables whose deleted-row counts the purge reports, in delete order. */
|
|
15
|
+
type CountedTable = "principal_roles" | "principal_policies" | "sessions" | "api_keys" | "setting_values_user";
|
|
16
|
+
export interface UserPurgeSqlPorts {
|
|
17
|
+
transaction<T>(required: {
|
|
18
|
+
run: () => Promise<T>;
|
|
19
|
+
}): Promise<T>;
|
|
20
|
+
deleteCounted(required: Scope & {
|
|
21
|
+
table: CountedTable;
|
|
22
|
+
}): Promise<number>;
|
|
23
|
+
deletePrincipalVault(required: Scope): Promise<void>;
|
|
24
|
+
deleteIdentityUser(required: Scope): Promise<void>;
|
|
25
|
+
deletePrincipal(required: Scope): Promise<void>;
|
|
26
|
+
appendOutbox(required: {
|
|
27
|
+
event: DomainEvent;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Hard-deletes a principal's identity rows and appends its audit event in ONE storage-kernel
|
|
32
|
+
* transaction, so a concurrent reader can never observe the principal half-purged (the kernel's
|
|
33
|
+
* transaction holds the SQLite write lock from `BEGIN IMMEDIATE`, and on Postgres nothing is
|
|
34
|
+
* visible before COMMIT) — mirroring `SqliteCommerceOrderRepo.placeOrder()`'s identical "header +
|
|
35
|
+
* line items in one transaction" reasoning. Any statement throwing (including the outbox insert,
|
|
36
|
+
* e.g. a duplicate event id) rolls back every delete this call made — see the paired RED test.
|
|
37
|
+
* Called from inside a caller's transaction (the trash core's `purgeSelected`), it joins that one.
|
|
38
|
+
*
|
|
39
|
+
* Deletes, in decision 2's order: `principal_roles`, `principal_policies`, `sessions`, `api_keys`
|
|
40
|
+
* (only keys bound to this principal — a key an agent/api_key principal ISSUED has its own,
|
|
41
|
+
* different `principalId` and is untouched), `setting_values_user`,
|
|
42
|
+
* principal-bound `secrets_vault` rows (their FK already cascades with `principals` below; deleted
|
|
43
|
+
* explicitly anyway so this method's own behavior does not depend on cascade ordering for a
|
|
44
|
+
* credential row), `identity_users`, `principals`.
|
|
45
|
+
*
|
|
46
|
+
* Deliberately does NOT touch any FK-less "created by"/"actor" attribution column
|
|
47
|
+
* (`posts.created_by_principal_id`, `*_revisions.actor_id`, `redirects.created_by_principal`, …) —
|
|
48
|
+
* `schema.sqlite.ts`'s own header note on those columns explains why an attribution fact must
|
|
49
|
+
* survive the principal it names being deleted; this method purges IDENTITY, never CONTENT.
|
|
50
|
+
*/
|
|
51
|
+
export declare class SqlUserPurge implements UserPurgePort {
|
|
52
|
+
private readonly ports;
|
|
53
|
+
constructor(required: {
|
|
54
|
+
ports: UserPurgeSqlPorts;
|
|
55
|
+
}, _optional?: Record<string, never>);
|
|
56
|
+
/** @complexity O(1): eight fixed DELETE statements plus one INSERT, no loop over caller data. */
|
|
57
|
+
purgeUser(required: {
|
|
58
|
+
workspaceId: UUID;
|
|
59
|
+
principalId: UUID;
|
|
60
|
+
buildEvent: (required: {
|
|
61
|
+
removed: PurgeCounts;
|
|
62
|
+
}, optional?: {
|
|
63
|
+
reason?: UserPurgeReason;
|
|
64
|
+
}) => DomainEvent;
|
|
65
|
+
reason?: UserPurgeReason;
|
|
66
|
+
}, _optional?: Record<string, never>): Promise<PurgeCounts>;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=user-purge.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hard-deletes a principal's identity rows and appends its audit event in ONE storage-kernel
|
|
3
|
+
* transaction, so a concurrent reader can never observe the principal half-purged (the kernel's
|
|
4
|
+
* transaction holds the SQLite write lock from `BEGIN IMMEDIATE`, and on Postgres nothing is
|
|
5
|
+
* visible before COMMIT) — mirroring `SqliteCommerceOrderRepo.placeOrder()`'s identical "header +
|
|
6
|
+
* line items in one transaction" reasoning. Any statement throwing (including the outbox insert,
|
|
7
|
+
* e.g. a duplicate event id) rolls back every delete this call made — see the paired RED test.
|
|
8
|
+
* Called from inside a caller's transaction (the trash core's `purgeSelected`), it joins that one.
|
|
9
|
+
*
|
|
10
|
+
* Deletes, in decision 2's order: `principal_roles`, `principal_policies`, `sessions`, `api_keys`
|
|
11
|
+
* (only keys bound to this principal — a key an agent/api_key principal ISSUED has its own,
|
|
12
|
+
* different `principalId` and is untouched), `setting_values_user`,
|
|
13
|
+
* principal-bound `secrets_vault` rows (their FK already cascades with `principals` below; deleted
|
|
14
|
+
* explicitly anyway so this method's own behavior does not depend on cascade ordering for a
|
|
15
|
+
* credential row), `identity_users`, `principals`.
|
|
16
|
+
*
|
|
17
|
+
* Deliberately does NOT touch any FK-less "created by"/"actor" attribution column
|
|
18
|
+
* (`posts.created_by_principal_id`, `*_revisions.actor_id`, `redirects.created_by_principal`, …) —
|
|
19
|
+
* `schema.sqlite.ts`'s own header note on those columns explains why an attribution fact must
|
|
20
|
+
* survive the principal it names being deleted; this method purges IDENTITY, never CONTENT.
|
|
21
|
+
*/
|
|
22
|
+
export class SqlUserPurge {
|
|
23
|
+
ports;
|
|
24
|
+
constructor(required, _optional = {}) {
|
|
25
|
+
this.ports = required.ports;
|
|
26
|
+
}
|
|
27
|
+
/** @complexity O(1): eight fixed DELETE statements plus one INSERT, no loop over caller data. */
|
|
28
|
+
async purgeUser(required, _optional = {}) {
|
|
29
|
+
const { workspaceId, principalId, buildEvent, reason } = required;
|
|
30
|
+
return this.ports.transaction({ run: async () => {
|
|
31
|
+
const roles = await this.ports.deleteCounted({ workspaceId, principalId, table: "principal_roles" });
|
|
32
|
+
const policies = await this.ports.deleteCounted({ workspaceId, principalId, table: "principal_policies" });
|
|
33
|
+
const sessionCount = await this.ports.deleteCounted({ workspaceId, principalId, table: "sessions" });
|
|
34
|
+
const apiKeyCount = await this.ports.deleteCounted({ workspaceId, principalId, table: "api_keys" });
|
|
35
|
+
const userSettings = await this.ports.deleteCounted({ workspaceId, principalId, table: "setting_values_user" });
|
|
36
|
+
await this.ports.deletePrincipalVault({ workspaceId, principalId });
|
|
37
|
+
await this.ports.deleteIdentityUser({ workspaceId, principalId });
|
|
38
|
+
await this.ports.deletePrincipal({ workspaceId, principalId });
|
|
39
|
+
const removed = { roles, policies, sessions: sessionCount, apiKeys: apiKeyCount, userSettings };
|
|
40
|
+
const event = buildEvent({ removed }, reason === undefined ? {} : { reason });
|
|
41
|
+
await this.ports.appendOutbox({ event });
|
|
42
|
+
return removed;
|
|
43
|
+
} });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=user-purge.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OutboxPort } from "@jini-ai/core/contracts/events";
|
|
2
|
+
import type { IdGenerator } from "@jini-ai/core/primitives";
|
|
3
|
+
import { type UsernameChangePort } from "../core/index.js";
|
|
4
|
+
/** Bind Jini's rename lifecycle to the host's Trash and existing transactional audit outbox.
|
|
5
|
+
* @complexity O(1): one Trash read per check, one audit enqueue per actual rename.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createUsernameChangePort(required: {
|
|
8
|
+
outbox: OutboxPort;
|
|
9
|
+
idGen: IdGenerator;
|
|
10
|
+
isInTrash: (required: {
|
|
11
|
+
principalId: string;
|
|
12
|
+
}, optional?: Record<string, never>) => Promise<boolean>;
|
|
13
|
+
seededOwnerPrincipalId: Promise<string>;
|
|
14
|
+
}, _optional?: Record<string, never>): UsernameChangePort;
|
|
15
|
+
//# sourceMappingURL=username-change-ports.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IdentityValidationError } from "../core/index.js";
|
|
2
|
+
/** Bind Jini's rename lifecycle to the host's Trash and existing transactional audit outbox.
|
|
3
|
+
* @complexity O(1): one Trash read per check, one audit enqueue per actual rename.
|
|
4
|
+
*/
|
|
5
|
+
export function createUsernameChangePort(required, _optional = {}) {
|
|
6
|
+
return {
|
|
7
|
+
assertSupported: async ({ principalId }, _options = {}) => {
|
|
8
|
+
// The host still discovers its bootstrap owner by login on restart. Persisting a stable
|
|
9
|
+
// binding needs an owner decision; until then a rename must not mint/promote another owner.
|
|
10
|
+
if (principalId === await required.seededOwnerPrincipalId) {
|
|
11
|
+
throw new IdentityValidationError({ message: "the seeded owner's username cannot be changed until a persistent owner identity is configured" });
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
isInTrash: ({ principalId }, _options = {}) => required.isInTrash({ principalId }),
|
|
15
|
+
record: async ({ workspaceId, principalId, callerPrincipalId, previousUsername, username, occurredAt }, _options = {}) => {
|
|
16
|
+
await required.outbox.enqueue({ id: required.idGen.newId(), name: "identity.user.username_changed",
|
|
17
|
+
workspaceId, aggregateId: principalId, actorId: callerPrincipalId, occurredAt,
|
|
18
|
+
payload: { principalId, previousUsername, username } });
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=username-change-ports.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type MailCaptureClearPlan, type MailCaptureClearResult } from "@jini-ai/core/contracts/mail";
|
|
2
|
+
/**
|
|
3
|
+
* @file "Clear all" captured test emails (owner decision 2026-11-23, bt2-todos G7-7/848): the plan
|
|
4
|
+
* the `POST system/mail-capture/clear` preview answers and the confirmed clear bound to it. The
|
|
5
|
+
* route (`@jini-ai/cms/admin-http/routes/system/mail-activity`) only clears when the request is
|
|
6
|
+
* confirmed with the revision of this plan. The revision names the exact reviewed set of captures
|
|
7
|
+
* (not its count and newest time), and the clear deletes only those ids: a capture that arrived
|
|
8
|
+
* after the review is never deleted unseen. "Test emails" are exactly what the Activity list shows
|
|
9
|
+
* as kept locally: stored test-mode captures and console-driver sends (which store no copy).
|
|
10
|
+
*/
|
|
11
|
+
/** What `planMailCaptureClear` reads and deletes through, and how it asks for the owner grant. */
|
|
12
|
+
export interface MailCaptureClearDeps {
|
|
13
|
+
capture: {
|
|
14
|
+
reviewCaptured(required: {
|
|
15
|
+
workspaceId: string;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
plan: MailCaptureClearPlan;
|
|
18
|
+
revision: string;
|
|
19
|
+
captureIds: readonly string[];
|
|
20
|
+
attemptIds: readonly string[];
|
|
21
|
+
}>;
|
|
22
|
+
clearReviewedCaptures(required: {
|
|
23
|
+
workspaceId: string;
|
|
24
|
+
captureIds: readonly string[];
|
|
25
|
+
attemptIds: readonly string[];
|
|
26
|
+
}): Promise<{
|
|
27
|
+
deleted: number;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
forbidden: (required: {
|
|
31
|
+
permission: string;
|
|
32
|
+
}, optional?: Record<string, never>) => Error;
|
|
33
|
+
checkPermission: (required: {
|
|
34
|
+
principalId: string;
|
|
35
|
+
permission: string;
|
|
36
|
+
}) => Promise<{
|
|
37
|
+
allowed: boolean;
|
|
38
|
+
reason: string;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
export interface MailCaptureClearBinding {
|
|
42
|
+
plan: MailCaptureClearPlan;
|
|
43
|
+
revision: string;
|
|
44
|
+
clear: () => Promise<MailCaptureClearResult>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Plans clearing the captured test emails of `workspaceId` as `principalId`.
|
|
48
|
+
* @returns `{ plan: { count, newestAt }, revision, clear }`; `clear` deletes only the reviewed
|
|
49
|
+
* captures of this workspace and answers `{ cleared: true, deleted }`.
|
|
50
|
+
* @throws MailActivityForbiddenError without `mail.capture.clear`, before anything is read.
|
|
51
|
+
* @complexity One permission check and one indexed id read; `clear` is one id-bound delete transaction.
|
|
52
|
+
*/
|
|
53
|
+
export declare function planMailCaptureClear({ principalId, workspaceId, deps }: {
|
|
54
|
+
principalId: string;
|
|
55
|
+
workspaceId: string;
|
|
56
|
+
deps: MailCaptureClearDeps;
|
|
57
|
+
}, _optional?: Record<string, never>): Promise<MailCaptureClearBinding>;
|
|
58
|
+
//# sourceMappingURL=capture-clear.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MAIL_CAPTURE_CLEAR_PERMISSION } from "@jini-ai/core/contracts/mail";
|
|
2
|
+
/**
|
|
3
|
+
* Plans clearing the captured test emails of `workspaceId` as `principalId`.
|
|
4
|
+
* @returns `{ plan: { count, newestAt }, revision, clear }`; `clear` deletes only the reviewed
|
|
5
|
+
* captures of this workspace and answers `{ cleared: true, deleted }`.
|
|
6
|
+
* @throws MailActivityForbiddenError without `mail.capture.clear`, before anything is read.
|
|
7
|
+
* @complexity One permission check and one indexed id read; `clear` is one id-bound delete transaction.
|
|
8
|
+
*/
|
|
9
|
+
export async function planMailCaptureClear({ principalId, workspaceId, deps }, _optional = {}) {
|
|
10
|
+
const grant = await deps.checkPermission({ principalId, permission: MAIL_CAPTURE_CLEAR_PERMISSION });
|
|
11
|
+
if (!grant.allowed) {
|
|
12
|
+
throw deps.forbidden({ permission: MAIL_CAPTURE_CLEAR_PERMISSION });
|
|
13
|
+
}
|
|
14
|
+
const { plan, captureIds, attemptIds, revision } = await deps.capture.reviewCaptured({ workspaceId });
|
|
15
|
+
return {
|
|
16
|
+
plan,
|
|
17
|
+
revision,
|
|
18
|
+
clear: async () => ({ cleared: true, deleted: (await deps.capture.clearReviewedCaptures({ workspaceId, captureIds, attemptIds })).deleted }),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=capture-clear.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** Mail configuration has no existing feature owner; this diagnostic and its two approval-gated
|
|
2
|
+
* controls share one catalog. */
|
|
3
|
+
export declare const mailStatusAgentToolCatalog: ({
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
sideEffects: "none";
|
|
7
|
+
authorization: {
|
|
8
|
+
permission: string;
|
|
9
|
+
};
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: string;
|
|
12
|
+
additionalProperties: boolean;
|
|
13
|
+
properties: {
|
|
14
|
+
refresh: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
providerId?: never;
|
|
19
|
+
to?: never;
|
|
20
|
+
};
|
|
21
|
+
required?: never;
|
|
22
|
+
};
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
sideEffects: "mutates-durable-state";
|
|
27
|
+
authorization: {
|
|
28
|
+
permission: string;
|
|
29
|
+
};
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: string;
|
|
32
|
+
additionalProperties: boolean;
|
|
33
|
+
required: string[];
|
|
34
|
+
properties: {
|
|
35
|
+
providerId: {
|
|
36
|
+
type: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
refresh?: never;
|
|
40
|
+
to?: never;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
} | {
|
|
44
|
+
name: string;
|
|
45
|
+
description: string;
|
|
46
|
+
sideEffects: "mutates-durable-state";
|
|
47
|
+
authorization: {
|
|
48
|
+
permission: string;
|
|
49
|
+
};
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: string;
|
|
52
|
+
additionalProperties: boolean;
|
|
53
|
+
properties: {
|
|
54
|
+
to: {
|
|
55
|
+
type: string;
|
|
56
|
+
maxLength: number;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
refresh?: never;
|
|
60
|
+
providerId?: never;
|
|
61
|
+
};
|
|
62
|
+
required?: never;
|
|
63
|
+
};
|
|
64
|
+
})[];
|
|
65
|
+
//# sourceMappingURL=agent-tools.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Mail configuration has no existing feature owner; this diagnostic and its two approval-gated
|
|
2
|
+
* controls share one catalog. */
|
|
3
|
+
export const mailStatusAgentToolCatalog = [{
|
|
4
|
+
name: "system_get_mail_status",
|
|
5
|
+
description: "Reports whether this site can send real email, the current mail driver, and a setup note. Use when email is not arriving, a magic link did not arrive, or to check whether sending is configured. Returns {mailDeliveryAvailable, driver, note} plus, when available, state (ready|unconfigured|degraded), lanes (transactional/bulk provider and state), warnings (sender_unverified, sender_unknown) and providers; console means messages are printed locally and never sent, unconfigured means no provider is chosen. This checks configuration, not whether a particular message reached an inbox. The providers list contains active adapters only. Before saying a mail provider is missing, call mail_list_providers to discover installed plugins that are switched off, then load_agent_plugin for setup guidance. Each providers entry is the safe configuration (lanes it sends for, capabilities, credential {required, saved, label}, selectable/refusal, setup fields), as mail_list_providers returns it. Also returns checkedAt and, after a provider failure, lastError {at, providerId, source (send|check), code, message}. The result is cached for about 30 seconds; pass refresh: true after changing a key or provider to check again now. Does not expose credentials or send mail. Requires admin.forms.manage, like the admin mail-status route. Immediately after startup it can still show the unresolved console fallback.",
|
|
6
|
+
sideEffects: "none",
|
|
7
|
+
authorization: { permission: "admin.forms.manage" },
|
|
8
|
+
inputSchema: { type: "object", additionalProperties: false, properties: { refresh: { type: "boolean", description: "Re-run the provider checks instead of using the briefly cached result." } } },
|
|
9
|
+
}, {
|
|
10
|
+
name: "mail_set_provider",
|
|
11
|
+
description: "Chooses which installed mail provider sends ALL of this site's email (sign-in links, confirmations, form notifications and newsletters), for both the transactional and bulk lanes. Pass providerId from system_get_mail_status's providers list. The provider must be installed and its key saved (mail_configure_provider shows how); its availability is checked again at the moment of the switch, and nothing is changed if it fails. Shows the person a confirmation card every time (approval cannot be remembered). Does not send mail; follow with mail_send_test. Requires settings.workspace.write.",
|
|
12
|
+
sideEffects: "mutates-durable-state",
|
|
13
|
+
authorization: { permission: "settings.workspace.write" },
|
|
14
|
+
inputSchema: { type: "object", additionalProperties: false, required: ["providerId"], properties: { providerId: { type: "string", description: "An installed provider id from system_get_mail_status." } } },
|
|
15
|
+
}, {
|
|
16
|
+
name: "mail_send_test",
|
|
17
|
+
description: "Sends one test email through the active provider and the site's delivery rules (suppression, test mode, rate limits), after a confirmation card that shows the actual destination. Sends to the signed-in operator's own account address unless to names one other address. Use after mail_set_provider or when checking delivery end to end. Returns {sent, outcome, to, from, driver, at} where outcome is accepted (the provider took it; providerMessageId), captured (kept locally by test mode or the console driver; nothing left the server), redirected (test mode sent it to redirectedTo instead) or failed (errorCode, message, retryable, retryAfterMs). accepted is not delivered: inbox delivery is only known from later provider feedback. Repeated sends are throttled (MAIL_TEST_DUPLICATE, MAIL_TEST_RATE_LIMITED). Requires admin.forms.manage.",
|
|
18
|
+
sideEffects: "mutates-durable-state",
|
|
19
|
+
authorization: { permission: "admin.forms.manage" },
|
|
20
|
+
inputSchema: { type: "object", additionalProperties: false, properties: { to: { type: "string", maxLength: 254, description: "One recipient address; omit to use your own account address." } } },
|
|
21
|
+
}];
|
|
22
|
+
//# sourceMappingURL=agent-tools.js.map
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/** Email delivery visibility tools (email phases 4-5, 2026-10-22): what uses email, recent sends with
|
|
2
|
+
* provider feedback, the suppression list and its owner-only removal, feedback setup. Each calls the
|
|
3
|
+
* same shared operation as its admin route. */
|
|
4
|
+
export declare const mailDeliveryAgentToolCatalog: ({
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
sideEffects: "none";
|
|
8
|
+
authorization: {
|
|
9
|
+
permission: string;
|
|
10
|
+
};
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: string;
|
|
13
|
+
additionalProperties: boolean;
|
|
14
|
+
properties: {
|
|
15
|
+
outcome?: never;
|
|
16
|
+
use?: never;
|
|
17
|
+
recipient?: never;
|
|
18
|
+
limit?: never;
|
|
19
|
+
cursor?: never;
|
|
20
|
+
activityId?: never;
|
|
21
|
+
search?: never;
|
|
22
|
+
scope?: never;
|
|
23
|
+
reason?: never;
|
|
24
|
+
address?: never;
|
|
25
|
+
};
|
|
26
|
+
required?: never;
|
|
27
|
+
};
|
|
28
|
+
} | {
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
sideEffects: "none";
|
|
32
|
+
authorization: {
|
|
33
|
+
permission: string;
|
|
34
|
+
};
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: string;
|
|
37
|
+
additionalProperties: boolean;
|
|
38
|
+
properties: {
|
|
39
|
+
outcome: {
|
|
40
|
+
type: string;
|
|
41
|
+
enum: string[];
|
|
42
|
+
};
|
|
43
|
+
use: {
|
|
44
|
+
type: string;
|
|
45
|
+
enum: string[];
|
|
46
|
+
};
|
|
47
|
+
recipient: {
|
|
48
|
+
type: string;
|
|
49
|
+
maxLength: number;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
limit: {
|
|
53
|
+
type: string;
|
|
54
|
+
minimum: number;
|
|
55
|
+
maximum: number;
|
|
56
|
+
clamp: boolean;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
cursor: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
activityId?: never;
|
|
64
|
+
search?: never;
|
|
65
|
+
scope?: never;
|
|
66
|
+
reason?: never;
|
|
67
|
+
address?: never;
|
|
68
|
+
};
|
|
69
|
+
required?: never;
|
|
70
|
+
};
|
|
71
|
+
} | {
|
|
72
|
+
name: string;
|
|
73
|
+
description: string;
|
|
74
|
+
sideEffects: "none";
|
|
75
|
+
authorization: {
|
|
76
|
+
permission: string;
|
|
77
|
+
};
|
|
78
|
+
inputSchema: {
|
|
79
|
+
type: string;
|
|
80
|
+
additionalProperties: boolean;
|
|
81
|
+
required: string[];
|
|
82
|
+
properties: {
|
|
83
|
+
activityId: {
|
|
84
|
+
type: string;
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
outcome?: never;
|
|
88
|
+
use?: never;
|
|
89
|
+
recipient?: never;
|
|
90
|
+
limit?: never;
|
|
91
|
+
cursor?: never;
|
|
92
|
+
search?: never;
|
|
93
|
+
scope?: never;
|
|
94
|
+
reason?: never;
|
|
95
|
+
address?: never;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
} | {
|
|
99
|
+
name: string;
|
|
100
|
+
description: string;
|
|
101
|
+
sideEffects: "none";
|
|
102
|
+
authorization: {
|
|
103
|
+
permission: string;
|
|
104
|
+
};
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: string;
|
|
107
|
+
additionalProperties: boolean;
|
|
108
|
+
properties: {
|
|
109
|
+
search: {
|
|
110
|
+
type: string;
|
|
111
|
+
maxLength: number;
|
|
112
|
+
description: string;
|
|
113
|
+
};
|
|
114
|
+
scope: {
|
|
115
|
+
type: string;
|
|
116
|
+
enum: string[];
|
|
117
|
+
};
|
|
118
|
+
reason: {
|
|
119
|
+
type: string;
|
|
120
|
+
enum: string[];
|
|
121
|
+
minLength?: never;
|
|
122
|
+
maxLength?: never;
|
|
123
|
+
description?: never;
|
|
124
|
+
};
|
|
125
|
+
limit: {
|
|
126
|
+
type: string;
|
|
127
|
+
minimum: number;
|
|
128
|
+
maximum: number;
|
|
129
|
+
clamp: boolean;
|
|
130
|
+
description: string;
|
|
131
|
+
};
|
|
132
|
+
cursor: {
|
|
133
|
+
type: string;
|
|
134
|
+
description: string;
|
|
135
|
+
};
|
|
136
|
+
outcome?: never;
|
|
137
|
+
use?: never;
|
|
138
|
+
recipient?: never;
|
|
139
|
+
activityId?: never;
|
|
140
|
+
address?: never;
|
|
141
|
+
};
|
|
142
|
+
required?: never;
|
|
143
|
+
};
|
|
144
|
+
} | {
|
|
145
|
+
name: string;
|
|
146
|
+
description: string;
|
|
147
|
+
sideEffects: "mutates-durable-state";
|
|
148
|
+
authorization: {
|
|
149
|
+
permission: string;
|
|
150
|
+
};
|
|
151
|
+
inputSchema: {
|
|
152
|
+
type: string;
|
|
153
|
+
additionalProperties: boolean;
|
|
154
|
+
required: string[];
|
|
155
|
+
properties: {
|
|
156
|
+
address: {
|
|
157
|
+
type: string;
|
|
158
|
+
maxLength: number;
|
|
159
|
+
description: string;
|
|
160
|
+
};
|
|
161
|
+
scope: {
|
|
162
|
+
type: string;
|
|
163
|
+
enum: string[];
|
|
164
|
+
};
|
|
165
|
+
reason: {
|
|
166
|
+
type: string;
|
|
167
|
+
minLength: number;
|
|
168
|
+
maxLength: number;
|
|
169
|
+
description: string;
|
|
170
|
+
enum?: never;
|
|
171
|
+
};
|
|
172
|
+
outcome?: never;
|
|
173
|
+
use?: never;
|
|
174
|
+
recipient?: never;
|
|
175
|
+
limit?: never;
|
|
176
|
+
cursor?: never;
|
|
177
|
+
activityId?: never;
|
|
178
|
+
search?: never;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
} | {
|
|
182
|
+
name: string;
|
|
183
|
+
description: string;
|
|
184
|
+
sideEffects: "mutates-durable-state";
|
|
185
|
+
authorization: {
|
|
186
|
+
permission: string;
|
|
187
|
+
};
|
|
188
|
+
inputSchema: {
|
|
189
|
+
type: string;
|
|
190
|
+
additionalProperties: boolean;
|
|
191
|
+
properties: {
|
|
192
|
+
outcome?: never;
|
|
193
|
+
use?: never;
|
|
194
|
+
recipient?: never;
|
|
195
|
+
limit?: never;
|
|
196
|
+
cursor?: never;
|
|
197
|
+
activityId?: never;
|
|
198
|
+
search?: never;
|
|
199
|
+
scope?: never;
|
|
200
|
+
reason?: never;
|
|
201
|
+
address?: never;
|
|
202
|
+
};
|
|
203
|
+
required?: never;
|
|
204
|
+
};
|
|
205
|
+
})[];
|
|
206
|
+
//# sourceMappingURL=delivery-agent-tools.d.ts.map
|