@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.
- package/CHANGELOG.md +7 -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 +283 -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 +83 -0
- package/dist/newsletter/repo-subscribers.js +215 -0
- package/dist/newsletter/repo.d.ts +61 -0
- package/dist/newsletter/repo.js +147 -0
- package/dist/newsletter/repo.memory.d.ts +202 -0
- package/dist/newsletter/repo.memory.js +260 -0
- package/dist/newsletter/repo.rows.d.ts +221 -0
- package/dist/newsletter/repo.rows.js +260 -0
- package/dist/newsletter/save-guard.d.ts +32 -0
- package/dist/newsletter/save-guard.js +27 -0
- package/dist/newsletter/send-pipeline.d.ts +240 -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 +26 -7
- package/dist/server/agent-tools.js +22 -7
- 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 +909 -11
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { createOwnerRecoveryKitDownload, DesktopOwnerResetHook, OwnerRecoveryFailureFormatter, OwnerRecoveryKitHook, OwnerRecoveryPort } from './RecoveryCodesCard.hooks.js';
|
|
2
|
+
import { type ComponentType } from 'react';
|
|
3
|
+
import type { UserFacingError } from '@jini-ai/core';
|
|
4
|
+
import { type Translate } from '@jini-ai/core/text';
|
|
5
|
+
/** The host's failure presentation (message, action and copyable redacted details). */
|
|
6
|
+
export type RecoveryFailureNotice = ComponentType<{
|
|
7
|
+
failure: UserFacingError;
|
|
8
|
+
t: Translate;
|
|
9
|
+
}>;
|
|
10
|
+
export interface RecoveryCodesCardProps {
|
|
11
|
+
port: OwnerRecoveryPort;
|
|
12
|
+
describeFailure: OwnerRecoveryFailureFormatter;
|
|
13
|
+
FailureNotice: RecoveryFailureNotice;
|
|
14
|
+
/** The name the saved kit file gets; host product copy. */
|
|
15
|
+
filename: string;
|
|
16
|
+
t?: Translate;
|
|
17
|
+
/** Host-bound hooks (owner rule: no hook is imported by the card): `createOwnerRecoveryKitDownload`,
|
|
18
|
+
* and `useOwnerRecoveryKit` / `useDesktopOwnerReset` each bound to their inner owner-recovery hook. */
|
|
19
|
+
createDownloadHook: typeof createOwnerRecoveryKitDownload;
|
|
20
|
+
useRecoveryKitHook: OwnerRecoveryKitHook;
|
|
21
|
+
useDesktopOwnerResetHook: DesktopOwnerResetHook;
|
|
22
|
+
}
|
|
23
|
+
/** Existing Security page adapter. Codes live only in component memory until saved/dismissed.
|
|
24
|
+
* @complexity O(1), one small status read on mount; one ten-code write per explicit rotation.
|
|
25
|
+
*/
|
|
26
|
+
export declare function RecoveryCodesCard({ port, describeFailure, FailureNotice, filename, t, createDownloadHook, useRecoveryKitHook, useDesktopOwnerResetHook }: RecoveryCodesCardProps): import("react").JSX.Element | null;
|
|
27
|
+
//# sourceMappingURL=RecoveryCodesCard.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type useRecoveryKit as useJiniRecoveryKit, type useOwnerPasswordReset } from './OwnerRecovery.hooks.js';
|
|
2
|
+
import type { UserFacingError } from '@jini-ai/core';
|
|
3
|
+
import { type Translate } from '@jini-ai/core/text';
|
|
4
|
+
export interface OwnerRecoveryStatus {
|
|
5
|
+
isOwner: boolean;
|
|
6
|
+
available: boolean;
|
|
7
|
+
desktopOwnerReset: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface OwnerRecoveryPort {
|
|
10
|
+
status(): Promise<OwnerRecoveryStatus>;
|
|
11
|
+
issue(input: {
|
|
12
|
+
password: string;
|
|
13
|
+
code?: string;
|
|
14
|
+
}, optional?: Record<string, never>): Promise<{
|
|
15
|
+
codes: string[];
|
|
16
|
+
}>;
|
|
17
|
+
reset(input: {
|
|
18
|
+
password: string;
|
|
19
|
+
}, optional?: Record<string, never>): Promise<void>;
|
|
20
|
+
recover(input: {
|
|
21
|
+
code: string;
|
|
22
|
+
password: string;
|
|
23
|
+
}, optional?: Record<string, never>): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
/** The host's redacting formatter. `secrets` carries the exact submitted values, because a driver may
|
|
26
|
+
* echo them without a label; the host's redactor scrubs them from the message and the details. */
|
|
27
|
+
export type OwnerRecoveryFailureFormatter = (required: {
|
|
28
|
+
error: unknown;
|
|
29
|
+
message: string;
|
|
30
|
+
action: string;
|
|
31
|
+
step: string;
|
|
32
|
+
t: Translate;
|
|
33
|
+
secrets?: string[];
|
|
34
|
+
}, optional?: Record<string, never>) => UserFacingError;
|
|
35
|
+
/** What the card hands each of its two controller hooks. */
|
|
36
|
+
export interface OwnerRecoveryHookArgs {
|
|
37
|
+
port: OwnerRecoveryPort;
|
|
38
|
+
t: Translate;
|
|
39
|
+
describeFailure: OwnerRecoveryFailureFormatter;
|
|
40
|
+
}
|
|
41
|
+
/** Issue a fresh recovery kit after password proof. The host binds the inner `useRecoveryKit` hook. */
|
|
42
|
+
export declare function useOwnerRecoveryKit({ port, t, describeFailure }: OwnerRecoveryHookArgs, { useJiniRecoveryKitHook }: {
|
|
43
|
+
useJiniRecoveryKitHook: typeof useJiniRecoveryKit;
|
|
44
|
+
}): import("./OwnerRecovery.hooks.js").RecoveryKitController;
|
|
45
|
+
/** Browser download of the kit text; the object URL is released as soon as the click is dispatched. */
|
|
46
|
+
export declare function saveTextFileViaDom({ text, filename }: {
|
|
47
|
+
text: string;
|
|
48
|
+
filename: string;
|
|
49
|
+
}, _optional?: Record<string, never>): void;
|
|
50
|
+
/** Download the displayed codes and clear them from the view. */
|
|
51
|
+
export declare function createOwnerRecoveryKitDownload({ codes, dismiss, filename }: {
|
|
52
|
+
codes: string[];
|
|
53
|
+
dismiss: () => void;
|
|
54
|
+
filename: string;
|
|
55
|
+
}, { saveTextFile }?: {
|
|
56
|
+
saveTextFile?: typeof saveTextFileViaDom;
|
|
57
|
+
}): () => void;
|
|
58
|
+
/** Reset the desktop owner's password using its restored owner session. The host binds the inner
|
|
59
|
+
* `useOwnerPasswordReset` hook. */
|
|
60
|
+
export declare function useDesktopOwnerReset({ port, t, describeFailure }: OwnerRecoveryHookArgs, { useOwnerPasswordResetHook }: {
|
|
61
|
+
useOwnerPasswordResetHook: typeof useOwnerPasswordReset;
|
|
62
|
+
}): import("./OwnerRecovery.hooks.js").OwnerPasswordResetController;
|
|
63
|
+
/** The card's recovery-kit controller hook, already bound by the host to its inner hook. */
|
|
64
|
+
export type OwnerRecoveryKitHook = (required: OwnerRecoveryHookArgs) => ReturnType<typeof useOwnerRecoveryKit>;
|
|
65
|
+
/** The card's desktop-reset controller hook, already bound by the host to its inner hook. */
|
|
66
|
+
export type DesktopOwnerResetHook = (required: OwnerRecoveryHookArgs) => ReturnType<typeof useDesktopOwnerReset>;
|
|
67
|
+
//# sourceMappingURL=RecoveryCodesCard.hooks.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createRecoveryKitDownload as createJiniRecoveryKitDownload } from './OwnerRecovery.hooks.js';
|
|
2
|
+
import {} from '@jini-ai/core/text';
|
|
3
|
+
/** Issue a fresh recovery kit after password proof. The host binds the inner `useRecoveryKit` hook. */
|
|
4
|
+
export function useOwnerRecoveryKit({ port, t, describeFailure }, { useJiniRecoveryKitHook }) {
|
|
5
|
+
const controller = useJiniRecoveryKitHook({
|
|
6
|
+
issue: port.issue,
|
|
7
|
+
describeFailure: ({ error }) => describeFailure({ error, message: 'Recovery codes could not be generated.', action: 'Follow the server explanation before generating another set. Ask the host operator for help if it continues.', step: 'owner-recovery-issue', t, secrets: [controller.password, controller.code] }),
|
|
8
|
+
}, {});
|
|
9
|
+
return controller;
|
|
10
|
+
}
|
|
11
|
+
/** Browser download of the kit text; the object URL is released as soon as the click is dispatched. */
|
|
12
|
+
export function saveTextFileViaDom({ text, filename }, _optional = {}) {
|
|
13
|
+
const url = URL.createObjectURL(new Blob([text], { type: 'text/plain' }));
|
|
14
|
+
const link = document.createElement('a');
|
|
15
|
+
link.href = url;
|
|
16
|
+
link.download = filename;
|
|
17
|
+
link.click();
|
|
18
|
+
URL.revokeObjectURL(url);
|
|
19
|
+
}
|
|
20
|
+
/** Download the displayed codes and clear them from the view. */
|
|
21
|
+
export function createOwnerRecoveryKitDownload({ codes, dismiss, filename }, { saveTextFile = saveTextFileViaDom } = {}) {
|
|
22
|
+
return createJiniRecoveryKitDownload({ codes, dismiss, filename, saveTextFile }, {});
|
|
23
|
+
}
|
|
24
|
+
/** Reset the desktop owner's password using its restored owner session. The host binds the inner
|
|
25
|
+
* `useOwnerPasswordReset` hook. */
|
|
26
|
+
export function useDesktopOwnerReset({ port, t, describeFailure }, { useOwnerPasswordResetHook }) {
|
|
27
|
+
const controller = useOwnerPasswordResetHook({
|
|
28
|
+
reset: port.reset, t,
|
|
29
|
+
describeFailure: ({ error }) => describeFailure({ error, message: 'The owner password could not be reset.', action: 'Follow the server explanation. Reopen this site in the desktop app to renew local proof if it was refused.', step: 'desktop-owner-reset', t, secrets: [controller.password] }),
|
|
30
|
+
copy: {
|
|
31
|
+
mismatch: t('The passwords do not match. Enter the same password in both fields. Details: desktop-owner-confirmation'),
|
|
32
|
+
recovered: '',
|
|
33
|
+
reset: t('Owner password reset. All sessions and recovery codes were invalidated. Reopen the site or sign in with your new password.'),
|
|
34
|
+
},
|
|
35
|
+
}, {});
|
|
36
|
+
return controller;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=RecoveryCodesCard.hooks.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { AGENT_PRIVATE_ATTRIBUTE } from '@jini-ai/core/agent-handles';
|
|
4
|
+
import { SecretInput } from '../kit.js';
|
|
5
|
+
import {} from '@jini-ai/core/text';
|
|
6
|
+
const identityTranslate = text => text;
|
|
7
|
+
/** Existing Security page adapter. Codes live only in component memory until saved/dismissed.
|
|
8
|
+
* @complexity O(1), one small status read on mount; one ten-code write per explicit rotation.
|
|
9
|
+
*/
|
|
10
|
+
export function RecoveryCodesCard({ port, describeFailure, FailureNotice, filename, t = identityTranslate, createDownloadHook, useRecoveryKitHook, useDesktopOwnerResetHook }) {
|
|
11
|
+
const [status, setStatus] = useState();
|
|
12
|
+
const [loadError, setLoadError] = useState(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
let active = true;
|
|
15
|
+
void port.status().then(value => { if (active)
|
|
16
|
+
setStatus(value); }).catch(error => {
|
|
17
|
+
if (active)
|
|
18
|
+
setLoadError({ cause: error });
|
|
19
|
+
});
|
|
20
|
+
return () => { active = false; };
|
|
21
|
+
}, [port]);
|
|
22
|
+
const error = useMemo(() => loadError ? describeFailure({ error: loadError.cause,
|
|
23
|
+
message: 'Owner recovery settings could not load.',
|
|
24
|
+
action: 'Reload this page after resolving the server explanation. Ask the host operator to check the identity database if it continues.',
|
|
25
|
+
step: 'owner-recovery-status', t }) : null, [loadError, t, describeFailure]);
|
|
26
|
+
if (error)
|
|
27
|
+
return _jsx(FailureNotice, { failure: error, t: t });
|
|
28
|
+
if (!status)
|
|
29
|
+
return _jsx("p", { children: t('Loading owner recovery…') });
|
|
30
|
+
if (!status.isOwner || !status.available)
|
|
31
|
+
return null;
|
|
32
|
+
const chrome = { port, t, describeFailure, FailureNotice };
|
|
33
|
+
return _jsxs("section", { className: "jini-card", children: [_jsx("h3", { children: t('Recovery codes') }), _jsx("p", { children: t('Save ten single-use codes somewhere private. Using one resets your owner password, removes authenticators and passkeys, signs out all sessions and invalidates every code in the set.') }), _jsx(RecoveryKit, { ...chrome, filename: filename, createDownloadHook: createDownloadHook, useRecoveryKitHook: useRecoveryKitHook }), status.desktopOwnerReset ? _jsx(DesktopOwnerReset, { ...chrome, useDesktopOwnerResetHook: useDesktopOwnerResetHook }) : null] });
|
|
34
|
+
}
|
|
35
|
+
/** Issue only after password proof; never persist raw codes or leave the submitted password in state.
|
|
36
|
+
* @complexity O(1), one rotation per submit and at most ten codes in memory.
|
|
37
|
+
*/
|
|
38
|
+
function RecoveryKit({ port, t, describeFailure, FailureNotice, filename, createDownloadHook, useRecoveryKitHook }) {
|
|
39
|
+
const { password, setPassword, code, setCode, codes, setCodes, busy, error, submit } = useRecoveryKitHook({ port, t, describeFailure });
|
|
40
|
+
return _jsxs("div", { children: [_jsxs("form", { onSubmit: submit, children: [_jsx("label", { htmlFor: "recovery-current-password", children: t('Current owner password') }), _jsx(SecretInput, { id: "recovery-current-password", label: t('Current owner password'), autoComplete: "current-password", value: password, onChange: event => setPassword(event.target.value), [AGENT_PRIVATE_ATTRIBUTE]: '' }), _jsxs("label", { children: [t('Authenticator code (if enabled)'), _jsx("input", { autoComplete: "one-time-code", inputMode: "numeric", pattern: "[0-9]{6}", maxLength: 6, "data-agent-private": "", value: code, onChange: event => setCode(event.target.value) })] }), _jsx("button", { className: "jini-btn-primary", disabled: busy || !password, children: t('Generate recovery codes') }), _jsx("p", { children: t('Generating a new set invalidates all previous codes. Codes are shown only now.') })] }), error ? _jsx(FailureNotice, { failure: error, t: t }) : null, codes.length ? _jsx(RecoveryKitOutput, { codes: codes, dismiss: () => setCodes([]), t: t, filename: filename, createDownloadHook: createDownloadHook }) : null] });
|
|
41
|
+
}
|
|
42
|
+
/** Download the currently displayed kit once, then erase it from this view. No server read.
|
|
43
|
+
* @complexity O(1), one local blob of ten codes (~650 bytes), immediately released.
|
|
44
|
+
*/
|
|
45
|
+
function RecoveryKitOutput({ codes, dismiss, t, filename, createDownloadHook }) {
|
|
46
|
+
const download = createDownloadHook({ codes, dismiss, filename });
|
|
47
|
+
return _jsxs("div", { [AGENT_PRIVATE_ATTRIBUTE]: '', children: [_jsx("pre", { children: codes.join('\n') }), _jsx("button", { type: "button", className: "jini-btn-secondary", onClick: download, children: t('Download codes') }), _jsx("button", { type: "button", className: "jini-btn-secondary", onClick: dismiss, children: t('I saved these codes') })] });
|
|
48
|
+
}
|
|
49
|
+
/** Desktop proof restores the ordinary owner session before this action is offered by the server.
|
|
50
|
+
* @complexity O(1) UI state, one reset request per explicit submit; no staff promotion.
|
|
51
|
+
*/
|
|
52
|
+
function DesktopOwnerReset({ port, t, describeFailure, FailureNotice, useDesktopOwnerResetHook }) {
|
|
53
|
+
const { password, setPassword, confirmation, setConfirmation, busy, message, failure, submit } = useDesktopOwnerResetHook({ port, t, describeFailure });
|
|
54
|
+
return _jsxs("details", { children: [_jsx("summary", { children: t('Reset owner password') }), _jsx("p", { children: t('Your desktop launch restored your owner session. Choose a new password; this signs out all sessions and invalidates recovery codes.') }), _jsxs("form", { onSubmit: submit, children: [_jsx("label", { htmlFor: "desktop-owner-password", children: t('New owner password') }), _jsx(SecretInput, { id: "desktop-owner-password", label: t('New owner password'), autoComplete: "new-password", value: password, onChange: event => setPassword(event.target.value), [AGENT_PRIVATE_ATTRIBUTE]: '' }), _jsx("label", { htmlFor: "desktop-owner-confirm", children: t('Confirm new owner password') }), _jsx(SecretInput, { id: "desktop-owner-confirm", label: t('Confirm new owner password'), autoComplete: "new-password", value: confirmation, onChange: event => setConfirmation(event.target.value), [AGENT_PRIVATE_ATTRIBUTE]: '' }), _jsx("button", { className: "jini-btn-primary", disabled: busy || !password, children: t('Reset password and sign out sessions') })] }), failure ? _jsx(FailureNotice, { failure: failure, t: t }) : null, message ? _jsx("p", { className: "jini-notice", role: "status", children: message }) : null] });
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=RecoveryCodesCard.js.map
|
|
@@ -1,28 +1,7 @@
|
|
|
1
1
|
import { useTotpSettings, useTotpSettingsForm } from './TotpSettings.hooks.js';
|
|
2
2
|
import { type Translate } from '@jini-ai/core/text';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isOwner: boolean;
|
|
6
|
-
available: boolean;
|
|
7
|
-
enrolled: boolean;
|
|
8
|
-
}>;
|
|
9
|
-
enroll(input: {
|
|
10
|
-
password: string;
|
|
11
|
-
code?: string;
|
|
12
|
-
}): Promise<{
|
|
13
|
-
pendingToken: string;
|
|
14
|
-
secret: string;
|
|
15
|
-
uri: string;
|
|
16
|
-
}>;
|
|
17
|
-
confirm(input: {
|
|
18
|
-
pendingToken: string;
|
|
19
|
-
code: string;
|
|
20
|
-
}): Promise<void>;
|
|
21
|
-
remove(input: {
|
|
22
|
-
password: string;
|
|
23
|
-
code: string;
|
|
24
|
-
}): Promise<void>;
|
|
25
|
-
}
|
|
3
|
+
import type { TotpSettingsPort } from '@jini-ai/core/contracts/site/user-management-react';
|
|
4
|
+
export type { TotpSettingsPort } from '@jini-ai/core/contracts/site/user-management-react';
|
|
26
5
|
/** Owner settings hold setup secrets only until confirmation/cancellation or unmount.
|
|
27
6
|
* @complexity O(1): one bounded status read on mount and one request per explicit action; no polling.
|
|
28
7
|
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** The host's local browser adapter; the server owns production/launcher/peer admission. */
|
|
2
|
+
export interface LocalOwnerSessionPort<T> {
|
|
3
|
+
signInLocalOwner: (required: Record<string, never>, optional?: Record<string, never>) => Promise<unknown>;
|
|
4
|
+
me: () => Promise<T>;
|
|
5
|
+
}
|
|
6
|
+
/** `@jini-ai/user-management/session-bootstrap`'s `readInitialSession`, injected by the host so this
|
|
7
|
+
* browser entry does not reach the session-bootstrap entry's module. */
|
|
8
|
+
export type LocalOwnerReadInitialSession = <T>(required: {
|
|
9
|
+
me: () => Promise<T>;
|
|
10
|
+
bootstrap: () => Promise<unknown>;
|
|
11
|
+
admit: () => boolean;
|
|
12
|
+
isUnauthenticated: (required: {
|
|
13
|
+
error: unknown;
|
|
14
|
+
}) => boolean;
|
|
15
|
+
}, optional?: {
|
|
16
|
+
onBootstrapped?: () => void;
|
|
17
|
+
}) => Promise<T>;
|
|
18
|
+
/** The host's API error class: an instance carries the HTTP status and the canonical error code. */
|
|
19
|
+
export type LocalOwnerApiErrorClass = abstract new (...args: never[]) => {
|
|
20
|
+
status: number;
|
|
21
|
+
code?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
/** Avoid sending local-bootstrap requests from deployed browser origins. @complexity O(1). */
|
|
24
|
+
export declare function isLocalOwnerSignInHost({ hostname }: {
|
|
25
|
+
hostname: string;
|
|
26
|
+
}, _optional?: Record<string, never>): boolean;
|
|
27
|
+
/** The host injects its API error class (so only ITS 401 `UNAUTHENTICATED` starts a bootstrap) and `readInitialSession`.
|
|
28
|
+
* @complexity O(1) to build. */
|
|
29
|
+
export declare function createLocalOwnerSignIn({ apiErrorClass, readInitialSession }: {
|
|
30
|
+
apiErrorClass: LocalOwnerApiErrorClass;
|
|
31
|
+
readInitialSession: LocalOwnerReadInitialSession;
|
|
32
|
+
}, _optional?: Record<string, never>): {
|
|
33
|
+
readInitialAdminSession<T>(required: {
|
|
34
|
+
hostname: string;
|
|
35
|
+
port: LocalOwnerSessionPort<T>;
|
|
36
|
+
}, optional?: {
|
|
37
|
+
onLocalSignIn?: () => void;
|
|
38
|
+
}): Promise<T>;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=local-owner-signin.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Avoid sending local-bootstrap requests from deployed browser origins. @complexity O(1). */
|
|
2
|
+
export function isLocalOwnerSignInHost({ hostname }, _optional = {}) {
|
|
3
|
+
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]";
|
|
4
|
+
}
|
|
5
|
+
/** The host injects its API error class (so only ITS 401 `UNAUTHENTICATED` starts a bootstrap) and `readInitialSession`.
|
|
6
|
+
* @complexity O(1) to build. */
|
|
7
|
+
export function createLocalOwnerSignIn({ apiErrorClass, readInitialSession }, _optional = {}) {
|
|
8
|
+
/** Preserve a valid session; bootstrap only an unauthenticated local browser on initial load.
|
|
9
|
+
* The session hook retains this read across effect replays and never invokes it on later 401s.
|
|
10
|
+
* A refused bootstrap preserves the original 401 so the hook settles on ordinary login.
|
|
11
|
+
* @complexity O(1) time/space: at most one bootstrap and two identity reads.
|
|
12
|
+
*/
|
|
13
|
+
function readInitialAdminSession(required, optional = {}) {
|
|
14
|
+
const { hostname, port } = required;
|
|
15
|
+
return readInitialSession({
|
|
16
|
+
me: () => port.me(), bootstrap: () => port.signInLocalOwner({}), admit: () => isLocalOwnerSignInHost({ hostname }),
|
|
17
|
+
isUnauthenticated: ({ error }) => error instanceof apiErrorClass && error.status === 401 && error.code === "UNAUTHENTICATED",
|
|
18
|
+
}, {
|
|
19
|
+
// Settings readers may already have received a pre-cookie 401, just as on password login.
|
|
20
|
+
...(optional.onLocalSignIn ? { onBootstrapped: optional.onLocalSignIn } : {}),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return { readInitialAdminSession };
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=local-owner-signin.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TotpSettingsPort } from '@jini-ai/core/contracts/site/user-management-react';
|
|
2
|
+
import type { OwnerRequestOnce } from './owner-request.js';
|
|
3
|
+
/** Thin site transport: single-send writes never replay a proof after a lost response.
|
|
4
|
+
* The host injects its single-send `requestOnce` and builds one port for the page.
|
|
5
|
+
* @complexity O(1), one request per explicit action; status loads once, no poll.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createOwnerMfaPort({ requestOnce }: {
|
|
8
|
+
requestOnce: OwnerRequestOnce;
|
|
9
|
+
}, _optional?: Record<string, never>): TotpSettingsPort;
|
|
10
|
+
//# sourceMappingURL=owner-mfa-api.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Thin site transport: single-send writes never replay a proof after a lost response.
|
|
2
|
+
* The host injects its single-send `requestOnce` and builds one port for the page.
|
|
3
|
+
* @complexity O(1), one request per explicit action; status loads once, no poll.
|
|
4
|
+
*/
|
|
5
|
+
export function createOwnerMfaPort({ requestOnce }, _optional = {}) {
|
|
6
|
+
const post = ({ action, input }, _options = {}) => requestOnce({
|
|
7
|
+
path: `/auth/mfa/${action}`, init: { method: 'POST', headers: { 'content-type': 'application/json' },
|
|
8
|
+
body: JSON.stringify(input), cache: 'no-store' },
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
status: () => requestOnce({ path: '/auth/mfa', init: { cache: 'no-store' } }),
|
|
12
|
+
enroll: input => post({ action: 'enroll', input }),
|
|
13
|
+
confirm: input => post({ action: 'confirm', input }),
|
|
14
|
+
remove: input => post({ action: 'remove', input }),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=owner-mfa-api.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PasskeySettingsPort, PasskeySignInPort } from '@jini-ai/core/contracts/site/user-management-react';
|
|
2
|
+
import type { OwnerRequestOnce } from './owner-request.js';
|
|
3
|
+
/** Explicit ceremonies are single-send requests; lost responses never trigger proof replay.
|
|
4
|
+
* The host injects its single-send `requestOnce` and builds both ports once. @complexity O(1). */
|
|
5
|
+
export declare function createOwnerPasskeyPorts({ requestOnce }: {
|
|
6
|
+
requestOnce: OwnerRequestOnce;
|
|
7
|
+
}, _optional?: Record<string, never>): {
|
|
8
|
+
settings: PasskeySettingsPort;
|
|
9
|
+
signIn: PasskeySignInPort;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=owner-passkey-api.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Explicit ceremonies are single-send requests; lost responses never trigger proof replay.
|
|
2
|
+
* The host injects its single-send `requestOnce` and builds both ports once. @complexity O(1). */
|
|
3
|
+
export function createOwnerPasskeyPorts({ requestOnce }, _optional = {}) {
|
|
4
|
+
const post = ({ action, input }, _options = {}) => requestOnce({
|
|
5
|
+
path: `/auth/passkeys/${action}`, init: { method: 'POST', headers: { 'content-type': 'application/json' },
|
|
6
|
+
body: JSON.stringify(input), cache: 'no-store' },
|
|
7
|
+
});
|
|
8
|
+
const settings = {
|
|
9
|
+
status: () => requestOnce({ path: '/auth/passkeys', init: { cache: 'no-store' } }),
|
|
10
|
+
enroll: input => post({ action: 'enroll', input }), confirm: input => post({ action: 'confirm', input }), remove: input => post({ action: 'remove', input }),
|
|
11
|
+
};
|
|
12
|
+
const signIn = {
|
|
13
|
+
begin: input => post({ action: 'begin-login', input }), complete: async (input) => { await post({ action: 'login', input }); },
|
|
14
|
+
};
|
|
15
|
+
return { settings, signIn };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=owner-passkey-api.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type UserFacingError } from '@jini-ai/core';
|
|
2
|
+
import type { UserFacingErrorOptions } from '@jini-ai/core';
|
|
3
|
+
import { type Translate } from '@jini-ai/core/text';
|
|
4
|
+
import type { OwnerRequestOnce } from './owner-request.js';
|
|
5
|
+
export interface OwnerRecoveryStatus {
|
|
6
|
+
isOwner: boolean;
|
|
7
|
+
available: boolean;
|
|
8
|
+
desktopOwnerReset: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface OwnerRecoveryPort {
|
|
11
|
+
status(): Promise<OwnerRecoveryStatus>;
|
|
12
|
+
issue(input: {
|
|
13
|
+
password: string;
|
|
14
|
+
code?: string;
|
|
15
|
+
}, optional?: Record<string, never>): Promise<{
|
|
16
|
+
codes: string[];
|
|
17
|
+
}>;
|
|
18
|
+
reset(input: {
|
|
19
|
+
password: string;
|
|
20
|
+
}, optional?: Record<string, never>): Promise<void>;
|
|
21
|
+
recover(input: {
|
|
22
|
+
code: string;
|
|
23
|
+
password: string;
|
|
24
|
+
}, optional?: Record<string, never>): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
/** `failure` arguments: the caught error, translatable copy, the step id and the submitted secrets. */
|
|
27
|
+
export interface OwnerRecoveryFailureArgs {
|
|
28
|
+
error: unknown;
|
|
29
|
+
message: string;
|
|
30
|
+
action: string;
|
|
31
|
+
step: string;
|
|
32
|
+
t: Translate;
|
|
33
|
+
secrets?: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The host injects its single-send `requestOnce`, its API-error describer and its product
|
|
37
|
+
* redaction options (they stay in the host); it builds one client for the page.
|
|
38
|
+
* @complexity O(1) to build.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createOwnerRecoveryClient({ requestOnce, describeApiError, redactionOptions }: {
|
|
41
|
+
requestOnce: OwnerRequestOnce;
|
|
42
|
+
describeApiError: (required: {
|
|
43
|
+
e: unknown;
|
|
44
|
+
fallback: string;
|
|
45
|
+
}) => string;
|
|
46
|
+
redactionOptions: UserFacingErrorOptions;
|
|
47
|
+
}, _optional?: Record<string, never>): {
|
|
48
|
+
port: OwnerRecoveryPort;
|
|
49
|
+
failure: (required: OwnerRecoveryFailureArgs, _options?: Record<string, never>) => UserFacingError;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=owner-recovery-api.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { formatUserFacingError } from '@jini-ai/core';
|
|
2
|
+
import {} from '@jini-ai/core/text';
|
|
3
|
+
/**
|
|
4
|
+
* The host injects its single-send `requestOnce`, its API-error describer and its product
|
|
5
|
+
* redaction options (they stay in the host); it builds one client for the page.
|
|
6
|
+
* @complexity O(1) to build.
|
|
7
|
+
*/
|
|
8
|
+
export function createOwnerRecoveryClient({ requestOnce, describeApiError, redactionOptions }, _optional = {}) {
|
|
9
|
+
/** Single-send client: never retry a rotation/redemption whose response may have been lost.
|
|
10
|
+
* @complexity O(1), one request per action, kit responses bounded to ten 64-character codes.
|
|
11
|
+
*/
|
|
12
|
+
const post = ({ path, body }, _options = {}) => requestOnce({ path: `/auth/${path}`, init: {
|
|
13
|
+
method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body), cache: 'no-store',
|
|
14
|
+
} });
|
|
15
|
+
const port = {
|
|
16
|
+
status: () => requestOnce({ path: '/auth/owner-recovery', init: { cache: 'no-store' } }),
|
|
17
|
+
issue: (input, _optional = {}) => post({ path: 'recovery-codes', body: input }),
|
|
18
|
+
reset: (input, _optional = {}) => post({ path: 'reset-owner', body: input }),
|
|
19
|
+
recover: (input, _optional = {}) => post({ path: 'recover-owner', body: input }),
|
|
20
|
+
};
|
|
21
|
+
/** Preserve the server's specific explanation and provide selectable, redacted incident evidence.
|
|
22
|
+
* Submitted secrets are exact redaction hints because a driver may echo them without a label.
|
|
23
|
+
* @complexity O(diagnostic characters), no requests, clocks or clipboard effects.
|
|
24
|
+
* @example failure({ error, message: 'Recovery settings could not load.', action: 'Reload this page.', step: 'owner-recovery-status', t });
|
|
25
|
+
*/
|
|
26
|
+
const failure = ({ error, message, action, step, t, secrets = [] }, _options = {}) => formatUserFacingError({ message: describeApiError({ e: error, fallback: t(message) }), action: t(action), step, cause: error }, { ...redactionOptions, exactSecrets: secrets.filter(Boolean) });
|
|
27
|
+
return { port, failure };
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=owner-recovery-api.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The host's single-send request function the owner clients are bound to. Single-send matters:
|
|
2
|
+
* an MFA/passkey proof or a recovery rotation must never be replayed after a lost response. */
|
|
3
|
+
export type OwnerRequestOnce = <T>(required: {
|
|
4
|
+
path: string;
|
|
5
|
+
init?: RequestInit;
|
|
6
|
+
}) => Promise<T>;
|
|
7
|
+
//# sourceMappingURL=owner-request.d.ts.map
|
package/dist/react/index.d.ts
CHANGED
|
@@ -20,6 +20,12 @@ export { describeIdentityError } from './errors.js';
|
|
|
20
20
|
export { useChangeUsername } from './users/hooks/use-change-username.hooks.js';
|
|
21
21
|
export type { ChangeUsernameController } from './users/hooks/use-change-username.hooks.js';
|
|
22
22
|
export { ChangeUsernameDialog } from './users/ChangeUsernameDialog.js';
|
|
23
|
+
export { UsersPanel } from './users/UsersPanel.js';
|
|
24
|
+
export type { UsersPanelProps } from './users/UsersPanel.js';
|
|
25
|
+
export { createUsersControllerHook } from './users/UsersPanel.hooks.js';
|
|
26
|
+
export { useLocalizedUsers } from './users/hooks/use-localized-users.hooks.js';
|
|
27
|
+
export type { LocalizedUsersController, LocalizedUsersDependencies, WiredUsersHook } from './users/hooks/use-localized-users.hooks.js';
|
|
28
|
+
export { passwordResetNotice } from './users/password-reset-notice.js';
|
|
23
29
|
export { userAccountCapabilities, isOwnerAccount, grantOptionLabel, formatGrantLabel, userRowMenuItems, describeUsersError } from './users/rules.js';
|
|
24
30
|
export type { UserAccountCapabilities, UserRowMenuHandlers } from './users/rules.js';
|
|
25
31
|
export { emptyRowState, memberRowMenuItems, describeMembersError } from './members/rules.js';
|
|
@@ -31,4 +37,8 @@ export type { PasskeySignInPort, PasskeySettingsPort } from './auth/Passkeys.js'
|
|
|
31
37
|
export { runPasskeyCeremony } from './auth/passkey-browser.js';
|
|
32
38
|
export { useRecoveryCodeSignIn, useRecoveryKit, createRecoveryKitDownload, useOwnerPasswordReset } from './auth/OwnerRecovery.hooks.js';
|
|
33
39
|
export type { OwnerRecoveryPorts, OwnerRecoveryCopy, DescribeRecoveryFailure, RecoveryCodeSignInController, RecoveryKitController, OwnerPasswordResetController } from './auth/OwnerRecovery.hooks.js';
|
|
40
|
+
export { RecoveryCodesCard } from './auth/RecoveryCodesCard.js';
|
|
41
|
+
export type { RecoveryCodesCardProps, RecoveryFailureNotice } from './auth/RecoveryCodesCard.js';
|
|
42
|
+
export { useOwnerRecoveryKit, createOwnerRecoveryKitDownload, useDesktopOwnerReset, saveTextFileViaDom } from './auth/RecoveryCodesCard.hooks.js';
|
|
43
|
+
export type { OwnerRecoveryStatus, OwnerRecoveryPort, OwnerRecoveryFailureFormatter, OwnerRecoveryHookArgs, OwnerRecoveryKitHook, DesktopOwnerResetHook } from './auth/RecoveryCodesCard.hooks.js';
|
|
34
44
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/react/index.js
CHANGED
|
@@ -9,10 +9,16 @@ export { useMembers } from './members/hooks/use-members.hooks.js';
|
|
|
9
9
|
export { describeIdentityError } from './errors.js';
|
|
10
10
|
export { useChangeUsername } from './users/hooks/use-change-username.hooks.js';
|
|
11
11
|
export { ChangeUsernameDialog } from './users/ChangeUsernameDialog.js';
|
|
12
|
+
export { UsersPanel } from './users/UsersPanel.js';
|
|
13
|
+
export { createUsersControllerHook } from './users/UsersPanel.hooks.js';
|
|
14
|
+
export { useLocalizedUsers } from './users/hooks/use-localized-users.hooks.js';
|
|
15
|
+
export { passwordResetNotice } from './users/password-reset-notice.js';
|
|
12
16
|
export { userAccountCapabilities, isOwnerAccount, grantOptionLabel, formatGrantLabel, userRowMenuItems, describeUsersError } from './users/rules.js';
|
|
13
17
|
export { emptyRowState, memberRowMenuItems, describeMembersError } from './members/rules.js';
|
|
14
18
|
export { TotpSettings } from './auth/TotpSettings.js';
|
|
15
19
|
export { PasskeySignIn, PasskeySettings } from './auth/Passkeys.js';
|
|
16
20
|
export { runPasskeyCeremony } from './auth/passkey-browser.js';
|
|
17
21
|
export { useRecoveryCodeSignIn, useRecoveryKit, createRecoveryKitDownload, useOwnerPasswordReset } from './auth/OwnerRecovery.hooks.js';
|
|
22
|
+
export { RecoveryCodesCard } from './auth/RecoveryCodesCard.js';
|
|
23
|
+
export { useOwnerRecoveryKit, createOwnerRecoveryKitDownload, useDesktopOwnerReset, saveTextFileViaDom } from './auth/RecoveryCodesCard.hooks.js';
|
|
18
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { EmailCopy, EmailKit, EmailNavigate, EmailParts, EmailRules, EmailStatusControl, EmailTabHooks, EmailThemeBoundaryHook, EmailTypes } from './email-view.types.js';
|
|
3
|
+
export interface EmailProps<T extends EmailTypes> {
|
|
4
|
+
readonly tabId?: string | null | undefined;
|
|
5
|
+
readonly part?: string | null | undefined;
|
|
6
|
+
readonly useEmailHook: () => EmailStatusControl<T['status']>;
|
|
7
|
+
readonly tabHooks: EmailTabHooks<T>;
|
|
8
|
+
readonly useAdminThemeBoundaryHook: EmailThemeBoundaryHook;
|
|
9
|
+
readonly parts: EmailParts<T>;
|
|
10
|
+
readonly kit: EmailKit<T['status']>;
|
|
11
|
+
readonly copy: EmailCopy;
|
|
12
|
+
readonly rules: EmailRules<T['status'], T['provider'], T['choice']>;
|
|
13
|
+
readonly navigate: EmailNavigate;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The mail screen. `tabId` is the host's tab selection and `part` the section shown inside that tab;
|
|
17
|
+
* every hook, component, dictionary and rule is the host's, injected through props.
|
|
18
|
+
*/
|
|
19
|
+
export declare function Email<T extends EmailTypes>(props: EmailProps<T>): ReactElement;
|
|
20
|
+
//# sourceMappingURL=Email.d.ts.map
|