@jini-ai/user-management 0.7.3-next.2 → 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/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 +909 -11
package/dist/react/ports.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { AdminUser
|
|
1
|
+
import type { AdminUser } from "./models.js";
|
|
2
|
+
import type { MembersPort, RolesPort, UsersPort } from "@jini-ai/core/contracts/site/user-management-react";
|
|
3
|
+
export type { MembersPort, RolesPort, UsersPort } from "@jini-ai/core/contracts/site/user-management-react";
|
|
2
4
|
export interface LoginPort {
|
|
3
5
|
login(credentials: {
|
|
4
6
|
username: string;
|
|
@@ -16,148 +18,6 @@ export interface LoginPort {
|
|
|
16
18
|
user: AdminUser;
|
|
17
19
|
}>;
|
|
18
20
|
}
|
|
19
|
-
/** One screen loads users, roles and policies together, so splitting the port would leave full-screen fakes with the same dependencies. */
|
|
20
|
-
export interface UsersPort {
|
|
21
|
-
listUsers(required: Record<string, never>): Promise<{
|
|
22
|
-
users: AdminIdentityUser[];
|
|
23
|
-
}>;
|
|
24
|
-
me(required: Record<string, never>): Promise<{
|
|
25
|
-
user: {
|
|
26
|
-
id: string;
|
|
27
|
-
};
|
|
28
|
-
canManageUserTrash: boolean;
|
|
29
|
-
effectivePermissions?: string[] | undefined;
|
|
30
|
-
}>;
|
|
31
|
-
listRoles(required: Record<string, never>): Promise<{
|
|
32
|
-
roles: AdminRole[];
|
|
33
|
-
}>;
|
|
34
|
-
listPolicies(required: Record<string, never>): Promise<{
|
|
35
|
-
policies: AdminPolicy[];
|
|
36
|
-
}>;
|
|
37
|
-
createUser(input: {
|
|
38
|
-
username: string;
|
|
39
|
-
password: string;
|
|
40
|
-
}, options?: {
|
|
41
|
-
email?: string | undefined;
|
|
42
|
-
}): Promise<{
|
|
43
|
-
user: AdminIdentityUser;
|
|
44
|
-
}>;
|
|
45
|
-
updateUser(target: {
|
|
46
|
-
principalId: string;
|
|
47
|
-
}, options?: {
|
|
48
|
-
email?: string | undefined;
|
|
49
|
-
username?: string | undefined;
|
|
50
|
-
}): Promise<{
|
|
51
|
-
user: AdminIdentityUser;
|
|
52
|
-
}>;
|
|
53
|
-
disableUser(required: {
|
|
54
|
-
principalId: string;
|
|
55
|
-
}): Promise<{
|
|
56
|
-
user: AdminIdentityUser;
|
|
57
|
-
}>;
|
|
58
|
-
enableUser(required: {
|
|
59
|
-
principalId: string;
|
|
60
|
-
}): Promise<{
|
|
61
|
-
user: AdminIdentityUser;
|
|
62
|
-
}>;
|
|
63
|
-
resetUserPassword(input: {
|
|
64
|
-
principalId: string;
|
|
65
|
-
password: string;
|
|
66
|
-
}): Promise<void>;
|
|
67
|
-
assignRole(input: {
|
|
68
|
-
principalId: string;
|
|
69
|
-
roleId: string;
|
|
70
|
-
}): Promise<{
|
|
71
|
-
assignment: unknown;
|
|
72
|
-
}>;
|
|
73
|
-
attachPolicy(input: {
|
|
74
|
-
principalId: string;
|
|
75
|
-
policyId: string;
|
|
76
|
-
}): Promise<{
|
|
77
|
-
attachment: unknown;
|
|
78
|
-
}>;
|
|
79
|
-
deleteUser(required: {
|
|
80
|
-
principalId: string;
|
|
81
|
-
}): Promise<void>;
|
|
82
|
-
}
|
|
83
|
-
export interface RolesPort {
|
|
84
|
-
listRoles(required: Record<string, never>): Promise<{
|
|
85
|
-
roles: AdminRole[];
|
|
86
|
-
}>;
|
|
87
|
-
listPolicies(required: Record<string, never>): Promise<{
|
|
88
|
-
policies: AdminPolicy[];
|
|
89
|
-
}>;
|
|
90
|
-
createRole(required: {
|
|
91
|
-
name: string;
|
|
92
|
-
}): Promise<{
|
|
93
|
-
role: AdminRole;
|
|
94
|
-
}>;
|
|
95
|
-
updateRole(input: {
|
|
96
|
-
roleId: string;
|
|
97
|
-
name: string;
|
|
98
|
-
}): Promise<{
|
|
99
|
-
role: AdminRole;
|
|
100
|
-
}>;
|
|
101
|
-
deleteRole(required: {
|
|
102
|
-
roleId: string;
|
|
103
|
-
}): Promise<void>;
|
|
104
|
-
createPolicy(input: {
|
|
105
|
-
name: string;
|
|
106
|
-
}, options?: {
|
|
107
|
-
description?: string | undefined;
|
|
108
|
-
}): Promise<{
|
|
109
|
-
policy: AdminPolicy;
|
|
110
|
-
}>;
|
|
111
|
-
updatePolicy(target: {
|
|
112
|
-
policyId: string;
|
|
113
|
-
}, options?: {
|
|
114
|
-
name?: string | undefined;
|
|
115
|
-
description?: string | undefined;
|
|
116
|
-
}): Promise<{
|
|
117
|
-
policy: AdminPolicy;
|
|
118
|
-
}>;
|
|
119
|
-
deletePolicy(required: {
|
|
120
|
-
policyId: string;
|
|
121
|
-
}): Promise<void>;
|
|
122
|
-
writePolicyPermission(input: {
|
|
123
|
-
policyId: string;
|
|
124
|
-
permission: string;
|
|
125
|
-
}, options?: {
|
|
126
|
-
resourceType?: string | undefined;
|
|
127
|
-
}): Promise<{
|
|
128
|
-
policyPermission: unknown;
|
|
129
|
-
}>;
|
|
130
|
-
listPolicyPermissions(required: {
|
|
131
|
-
policyId: string;
|
|
132
|
-
}): Promise<{
|
|
133
|
-
policyPermissions: AdminPolicyPermission[];
|
|
134
|
-
}>;
|
|
135
|
-
removePolicyPermission(input: {
|
|
136
|
-
policyId: string;
|
|
137
|
-
policyPermissionId: string;
|
|
138
|
-
}): Promise<void>;
|
|
139
|
-
}
|
|
140
|
-
/** Pure error formatting stays outside the Members port. */
|
|
141
|
-
export interface MembersPort {
|
|
142
|
-
listMembers(required: Record<string, never>): Promise<{
|
|
143
|
-
members: AdminMember[];
|
|
144
|
-
}>;
|
|
145
|
-
getMember(required: {
|
|
146
|
-
id: string;
|
|
147
|
-
}): Promise<{
|
|
148
|
-
member: AdminMember;
|
|
149
|
-
}>;
|
|
150
|
-
disableMember(required: {
|
|
151
|
-
id: string;
|
|
152
|
-
}): Promise<{
|
|
153
|
-
member: AdminMember;
|
|
154
|
-
}>;
|
|
155
|
-
requestMemberMagicLink(input: {
|
|
156
|
-
email: string;
|
|
157
|
-
}): Promise<{
|
|
158
|
-
delivered: true;
|
|
159
|
-
}>;
|
|
160
|
-
}
|
|
161
21
|
/** Compose once per host/workspace. Screens never choose an HTTP transport. */
|
|
162
22
|
export interface IdentityAdminPort extends LoginPort, UsersPort, RolesPort, MembersPort {
|
|
163
23
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { AdminPolicy, AdminPolicyPermission, AdminRole } from "@jini-ai/core/contracts/site/user-management-react";
|
|
2
|
+
/** What the host injects into {@link createRolesApi}. */
|
|
3
|
+
export interface RolesApiDeps {
|
|
4
|
+
/** The host's `authenticatedAdminRequest`: it owns the base URL, authentication, retries and error decoding, so this client only names paths, methods and bodies. */
|
|
5
|
+
authenticatedAdminRequest: <T>(required: {
|
|
6
|
+
path: string;
|
|
7
|
+
method: string;
|
|
8
|
+
body?: unknown;
|
|
9
|
+
}) => Promise<T>;
|
|
10
|
+
/** The workspace the paths are scoped under (`/workspaces/<id>/...`). */
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
}
|
|
13
|
+
/** The admin API calls of the roles feature, bound to the host's injected collaborators.
|
|
14
|
+
* @example const rolesApi = createRolesApi({ authenticatedAdminRequest, workspaceId }); */
|
|
15
|
+
export declare function createRolesApi({ authenticatedAdminRequest, workspaceId }: RolesApiDeps, _optional?: Record<string, never>): {
|
|
16
|
+
listRoles: () => Promise<{
|
|
17
|
+
roles: AdminRole[];
|
|
18
|
+
}>;
|
|
19
|
+
createRole: ({ name }: {
|
|
20
|
+
name: string;
|
|
21
|
+
}, _optional?: Record<string, never>) => Promise<{
|
|
22
|
+
role: AdminRole;
|
|
23
|
+
}>;
|
|
24
|
+
updateRole: ({ roleId, name, expectedVersion }: {
|
|
25
|
+
roleId: string;
|
|
26
|
+
name: string;
|
|
27
|
+
expectedVersion?: number | undefined;
|
|
28
|
+
}, _options?: Record<string, never>) => Promise<{
|
|
29
|
+
role: AdminRole;
|
|
30
|
+
}>;
|
|
31
|
+
deleteRole: ({ roleId }: {
|
|
32
|
+
roleId: string;
|
|
33
|
+
}, _optional?: Record<string, never>) => Promise<void>;
|
|
34
|
+
listPolicies: () => Promise<{
|
|
35
|
+
policies: AdminPolicy[];
|
|
36
|
+
}>;
|
|
37
|
+
createPolicy: ({ name }: {
|
|
38
|
+
name: string;
|
|
39
|
+
}, options?: {
|
|
40
|
+
description?: string;
|
|
41
|
+
}) => Promise<{
|
|
42
|
+
policy: AdminPolicy;
|
|
43
|
+
}>;
|
|
44
|
+
updatePolicy: ({ policyId }: {
|
|
45
|
+
policyId: string;
|
|
46
|
+
}, options?: {
|
|
47
|
+
name?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
expectedVersion?: number | undefined;
|
|
50
|
+
}) => Promise<{
|
|
51
|
+
policy: AdminPolicy;
|
|
52
|
+
}>;
|
|
53
|
+
deletePolicy: ({ policyId }: {
|
|
54
|
+
policyId: string;
|
|
55
|
+
}, _optional?: Record<string, never>) => Promise<void>;
|
|
56
|
+
writePolicyPermission: ({ policyId, permission }: {
|
|
57
|
+
policyId: string;
|
|
58
|
+
permission: string;
|
|
59
|
+
}, options?: {
|
|
60
|
+
resourceType?: string;
|
|
61
|
+
}) => Promise<{
|
|
62
|
+
policyPermission: unknown;
|
|
63
|
+
}>;
|
|
64
|
+
listPolicyPermissions: ({ policyId }: {
|
|
65
|
+
policyId: string;
|
|
66
|
+
}, _optional?: Record<string, never>) => Promise<{
|
|
67
|
+
policyPermissions: AdminPolicyPermission[];
|
|
68
|
+
}>;
|
|
69
|
+
removePolicyPermission: ({ policyId, policyPermissionId }: {
|
|
70
|
+
policyId: string;
|
|
71
|
+
policyPermissionId: string;
|
|
72
|
+
}) => Promise<void>;
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=roles-api.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** The admin API calls of the roles feature, bound to the host's injected collaborators.
|
|
2
|
+
* @example const rolesApi = createRolesApi({ authenticatedAdminRequest, workspaceId }); */
|
|
3
|
+
export function createRolesApi({ authenticatedAdminRequest, workspaceId }, _optional = {}) {
|
|
4
|
+
return {
|
|
5
|
+
listRoles: () => authenticatedAdminRequest({ method: "GET", path: `/workspaces/${workspaceId}/roles` }),
|
|
6
|
+
createRole: ({ name }, _optional = {}) => authenticatedAdminRequest({ method: "POST", path: `/workspaces/${workspaceId}/roles`, body: { name } }),
|
|
7
|
+
// SPEC-006 0.6.0.
|
|
8
|
+
updateRole: ({ roleId, name, expectedVersion }, _options = {}) =>
|
|
9
|
+
// `expectedVersion` is the loaded row's version: the server's conditional write refuses a stale basis with 409.
|
|
10
|
+
authenticatedAdminRequest({ method: "PATCH", path: `/workspaces/${workspaceId}/roles/${encodeURIComponent(roleId)}`, body: { name, expectedVersion } }),
|
|
11
|
+
deleteRole: ({ roleId }, _optional = {}) => authenticatedAdminRequest({ method: "DELETE", path: `/workspaces/${workspaceId}/roles/${encodeURIComponent(roleId)}` }),
|
|
12
|
+
listPolicies: () => authenticatedAdminRequest({ method: "GET", path: `/workspaces/${workspaceId}/policies` }),
|
|
13
|
+
createPolicy: ({ name }, options = {}) => authenticatedAdminRequest({ method: "POST", path: `/workspaces/${workspaceId}/policies`, body: { name, description: options.description } }),
|
|
14
|
+
// SPEC-006 0.6.0.
|
|
15
|
+
updatePolicy: ({ policyId }, options = {}) => authenticatedAdminRequest({ method: "PATCH", path: `/workspaces/${workspaceId}/policies/${encodeURIComponent(policyId)}`, body: options }),
|
|
16
|
+
deletePolicy: ({ policyId }, _optional = {}) => authenticatedAdminRequest({ method: "DELETE", path: `/workspaces/${workspaceId}/policies/${encodeURIComponent(policyId)}` }),
|
|
17
|
+
writePolicyPermission: ({ policyId, permission }, options = {}) => authenticatedAdminRequest({ method: "POST", path: `/workspaces/${workspaceId}/policies/${encodeURIComponent(policyId)}/permissions`, body: { permission, resourceType: options.resourceType || undefined } }),
|
|
18
|
+
listPolicyPermissions: ({ policyId }, _optional = {}) => authenticatedAdminRequest({ method: "GET", path: `/workspaces/${workspaceId}/policies/${encodeURIComponent(policyId)}/permissions` }),
|
|
19
|
+
removePolicyPermission: ({ policyId, policyPermissionId }) => authenticatedAdminRequest({ method: "DELETE", path: `/workspaces/${workspaceId}/policies/${encodeURIComponent(policyId)}/permissions/${encodeURIComponent(policyPermissionId)}` }),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=roles-api.js.map
|
package/dist/react/testing.js
CHANGED
|
@@ -52,6 +52,19 @@ export function createFakeUsersPort(_required, options = {}) {
|
|
|
52
52
|
async listPolicies() {
|
|
53
53
|
return { policies: [...policies] };
|
|
54
54
|
},
|
|
55
|
+
...createFakeUserWriteMethods({ users, options, requireUser, replaceUser }),
|
|
56
|
+
async deleteUser({ principalId }) {
|
|
57
|
+
if (options.deleteUserError)
|
|
58
|
+
throw options.deleteUserError;
|
|
59
|
+
requireUser(principalId);
|
|
60
|
+
// Mirrors the real DELETE route's effect on `listUsers()`: a trashed user no longer lists. Removing it from this fake's backing array reproduces that without modeling the Trash itself.
|
|
61
|
+
const index = users.findIndex((u) => u.principalId === principalId);
|
|
62
|
+
users.splice(index, 1);
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function createFakeUserWriteMethods({ users, options, requireUser, replaceUser }) {
|
|
67
|
+
return {
|
|
55
68
|
async createUser(input, opts) {
|
|
56
69
|
if (options.createUserError)
|
|
57
70
|
throw options.createUserError;
|
|
@@ -99,14 +112,6 @@ export function createFakeUsersPort(_required, options = {}) {
|
|
|
99
112
|
replaceUser({ ...current, policyIds: [...current.policyIds, input.policyId] });
|
|
100
113
|
return { attachment: {} };
|
|
101
114
|
},
|
|
102
|
-
async deleteUser({ principalId }) {
|
|
103
|
-
if (options.deleteUserError)
|
|
104
|
-
throw options.deleteUserError;
|
|
105
|
-
requireUser(principalId);
|
|
106
|
-
// Mirrors the real DELETE route's effect on `listUsers()`: a trashed user no longer lists. Removing it from this fake's backing array reproduces that without modeling the Trash itself.
|
|
107
|
-
const index = users.findIndex((u) => u.principalId === principalId);
|
|
108
|
-
users.splice(index, 1);
|
|
109
|
-
},
|
|
110
115
|
};
|
|
111
116
|
}
|
|
112
117
|
function fakeRole(overrides) {
|
|
@@ -114,6 +119,7 @@ function fakeRole(overrides) {
|
|
|
114
119
|
workspaceId: FAKE_WORKSPACE_ID,
|
|
115
120
|
name: "Fake role",
|
|
116
121
|
isBuiltin: false,
|
|
122
|
+
version: 1,
|
|
117
123
|
...overrides,
|
|
118
124
|
};
|
|
119
125
|
}
|
|
@@ -123,6 +129,7 @@ function fakePolicy(overrides) {
|
|
|
123
129
|
name: "Fake policy",
|
|
124
130
|
isBuiltin: false,
|
|
125
131
|
isFrozen: false,
|
|
132
|
+
version: 1,
|
|
126
133
|
...overrides,
|
|
127
134
|
};
|
|
128
135
|
}
|
|
@@ -181,7 +188,9 @@ function fakePolicyOperations(policies, options, requirePolicy) {
|
|
|
181
188
|
throw new Error(`fake policy not found: ${target.policyId}`);
|
|
182
189
|
const current = policies[index];
|
|
183
190
|
// Optional updates must retain the required name when it is omitted or undefined.
|
|
184
|
-
|
|
191
|
+
// `expectedVersion` is the request's compare-and-set basis, not a policy field; keep it out of the stored row.
|
|
192
|
+
const { expectedVersion: _basis, ...fields } = opts ?? {};
|
|
193
|
+
const updated = { ...current, ...fields, name: fields.name ?? current.name };
|
|
185
194
|
policies[index] = updated;
|
|
186
195
|
return { policy: updated };
|
|
187
196
|
},
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { UsersPort } from "@jini-ai/core/contracts/site/user-management-react";
|
|
3
|
+
import type { WiredUsersHook } from "./hooks/use-localized-users.hooks.js";
|
|
4
|
+
/**
|
|
5
|
+
* @file The Users screen as a host mounts it: the host's wired controller hook adapted onto
|
|
6
|
+
* {@link JiniUsers}' `useUsersHook` seam. Moved from the host's `features/users/UsersPanel.tsx`; the
|
|
7
|
+
* host passes its live port, workspace scope and status-label renderer.
|
|
8
|
+
*/
|
|
9
|
+
export interface UsersPanelProps {
|
|
10
|
+
/**
|
|
11
|
+
* The host's wired controller hook (REQUIRED) — the host binds its live port, locale hook and
|
|
12
|
+
* router (see `useLocalizedUsers`); a test passes a fake-port composition instead.
|
|
13
|
+
*/
|
|
14
|
+
useUsersHook: WiredUsersHook;
|
|
15
|
+
/** Password-banner plan (2026-09-24), Slice 3: set by `panels.tsx` when the route is
|
|
16
|
+
* `/users/change-password` (the dashboard nag's deep link). Forwarded to `useUsersHook` as-is —
|
|
17
|
+
* `Users` itself has no opinion on what it means, see `use-users.hooks.ts` for the behavior. */
|
|
18
|
+
openOwnPasswordReset?: boolean | undefined;
|
|
19
|
+
/** The host's live `UsersPort`. */
|
|
20
|
+
port: UsersPort;
|
|
21
|
+
/** The host's workspace query scope. */
|
|
22
|
+
queryScope: string;
|
|
23
|
+
/** The host owns localization of protocol status/role labels. */
|
|
24
|
+
renderServerLabel: (required: {
|
|
25
|
+
value: string;
|
|
26
|
+
}) => ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/** Product composition only; Jini owns markup, hooks and account protections. */
|
|
29
|
+
export declare function UsersPanel({ useUsersHook, openOwnPasswordReset, port, queryScope, renderServerLabel }: UsersPanelProps): import("react").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=UsersPanel.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UsersController as JiniController } from "./hooks/use-users.hooks.js";
|
|
2
|
+
import type { WiredUsersHook } from "./hooks/use-localized-users.hooks.js";
|
|
3
|
+
/** Adapt the host's injected controller to Jini's existing hook seam. */
|
|
4
|
+
export declare function createUsersControllerHook({ useUsersHook, openOwnPasswordReset }: {
|
|
5
|
+
useUsersHook: WiredUsersHook;
|
|
6
|
+
openOwnPasswordReset?: boolean | undefined;
|
|
7
|
+
}, _optional?: Record<string, never>): (_required?: {}, _options?: {}) => JiniController;
|
|
8
|
+
//# sourceMappingURL=UsersPanel.hooks.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Adapt the host's injected controller to Jini's existing hook seam. */
|
|
2
|
+
export function createUsersControllerHook({ useUsersHook, openOwnPasswordReset }, _optional = {}) {
|
|
3
|
+
function useController(_required = {}, _options = {}) {
|
|
4
|
+
const controller = useUsersHook({ openOwnPasswordReset });
|
|
5
|
+
return { ...controller, translate: controller.t };
|
|
6
|
+
}
|
|
7
|
+
return useController;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=UsersPanel.hooks.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createUsersControllerHook } from "./UsersPanel.hooks.js";
|
|
3
|
+
import { Users as JiniUsers } from "./Users.js";
|
|
4
|
+
/** Product composition only; Jini owns markup, hooks and account protections. */
|
|
5
|
+
export function UsersPanel({ useUsersHook, openOwnPasswordReset, port, queryScope, renderServerLabel }) {
|
|
6
|
+
const useController = createUsersControllerHook({ useUsersHook, openOwnPasswordReset });
|
|
7
|
+
return _jsx(JiniUsers, { port: port, queryScope: queryScope, useUsersHook: useController, renderServerLabel: renderServerLabel });
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=UsersPanel.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { AdminIdentityUser } from "@jini-ai/core/contracts/site/user-management-react";
|
|
2
|
+
/** What the host injects into {@link createUsersApi}. */
|
|
3
|
+
export interface UsersApiDeps {
|
|
4
|
+
/** The host's `request`: it owns the base URL, authentication, retries and error decoding, so this client only names paths, methods and bodies. */
|
|
5
|
+
request: <T>(required: {
|
|
6
|
+
path: string;
|
|
7
|
+
}, optional?: {
|
|
8
|
+
init?: RequestInit;
|
|
9
|
+
}) => Promise<T>;
|
|
10
|
+
/** The workspace the paths are scoped under (`/workspaces/<id>/...`). */
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
}
|
|
13
|
+
/** The admin API calls of the users feature, bound to the host's injected collaborators.
|
|
14
|
+
* @example const usersApi = createUsersApi({ request, workspaceId }); */
|
|
15
|
+
export declare function createUsersApi({ request, workspaceId }: UsersApiDeps, _optional?: Record<string, never>): {
|
|
16
|
+
assignRole: ({ principalId, roleId }: {
|
|
17
|
+
principalId: string;
|
|
18
|
+
roleId: string;
|
|
19
|
+
}, _options?: Record<string, never>) => Promise<{
|
|
20
|
+
assignment: unknown;
|
|
21
|
+
}>;
|
|
22
|
+
attachPolicy: ({ principalId, policyId }: {
|
|
23
|
+
principalId: string;
|
|
24
|
+
policyId: string;
|
|
25
|
+
}, _options?: Record<string, never>) => Promise<{
|
|
26
|
+
attachment: unknown;
|
|
27
|
+
}>;
|
|
28
|
+
listUsers: () => Promise<{
|
|
29
|
+
users: AdminIdentityUser[];
|
|
30
|
+
}>;
|
|
31
|
+
createUser: (input: {
|
|
32
|
+
username: string;
|
|
33
|
+
password: string;
|
|
34
|
+
}, options?: {
|
|
35
|
+
email?: string;
|
|
36
|
+
}) => Promise<{
|
|
37
|
+
user: AdminIdentityUser;
|
|
38
|
+
}>;
|
|
39
|
+
updateUser: ({ principalId }: {
|
|
40
|
+
principalId: string;
|
|
41
|
+
}, options?: {
|
|
42
|
+
email?: string;
|
|
43
|
+
username?: string;
|
|
44
|
+
}) => Promise<{
|
|
45
|
+
user: AdminIdentityUser;
|
|
46
|
+
}>;
|
|
47
|
+
disableUser: ({ principalId }: {
|
|
48
|
+
principalId: string;
|
|
49
|
+
}, _optional?: Record<string, never>) => Promise<{
|
|
50
|
+
user: AdminIdentityUser;
|
|
51
|
+
}>;
|
|
52
|
+
enableUser: ({ principalId }: {
|
|
53
|
+
principalId: string;
|
|
54
|
+
}, _optional?: Record<string, never>) => Promise<{
|
|
55
|
+
user: AdminIdentityUser;
|
|
56
|
+
}>;
|
|
57
|
+
deleteUser: ({ principalId }: {
|
|
58
|
+
principalId: string;
|
|
59
|
+
}, _optional?: Record<string, never>) => Promise<void>;
|
|
60
|
+
resetUserPassword: ({ principalId, password }: {
|
|
61
|
+
principalId: string;
|
|
62
|
+
password: string;
|
|
63
|
+
}, _options?: Record<string, never>) => Promise<void>;
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=users-api.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** The admin API calls of the users feature, bound to the host's injected collaborators.
|
|
2
|
+
* @example const usersApi = createUsersApi({ request, workspaceId }); */
|
|
3
|
+
export function createUsersApi({ request, workspaceId }, _optional = {}) {
|
|
4
|
+
return {
|
|
5
|
+
listUsers: () => request({ path: `/workspaces/${workspaceId}/users` }),
|
|
6
|
+
createUser: (input, options = {}) => request({ path: `/workspaces/${workspaceId}/users` }, { init: {
|
|
7
|
+
method: "POST",
|
|
8
|
+
body: JSON.stringify({ ...input, ...options }),
|
|
9
|
+
} }),
|
|
10
|
+
// SPEC-006 0.6.0 (users/roles/policies CRUD-completion amendment).
|
|
11
|
+
updateUser: ({ principalId }, options = {}) => request({ path: `/workspaces/${workspaceId}/users/${encodeURIComponent(principalId)}` }, { init: {
|
|
12
|
+
method: "PATCH",
|
|
13
|
+
body: JSON.stringify(options),
|
|
14
|
+
} }),
|
|
15
|
+
disableUser: ({ principalId }, _optional = {}) => request({ path: `/workspaces/${workspaceId}/users/${encodeURIComponent(principalId)}/disable` }, { init: {
|
|
16
|
+
method: "POST",
|
|
17
|
+
} }),
|
|
18
|
+
enableUser: ({ principalId }, _optional = {}) => request({ path: `/workspaces/${workspaceId}/users/${encodeURIComponent(principalId)}/enable` }, { init: {
|
|
19
|
+
method: "POST",
|
|
20
|
+
} }),
|
|
21
|
+
// Delete-user plan v2 (2026-09-24): DELETE now moves the target to the Trash (disabled, sessions
|
|
22
|
+
// revoked, restorable there for 60 days) rather than hard-deleting it — same endpoint the v1
|
|
23
|
+
// plan's `deleteUser` used, just a different server-side outcome behind the same 204.
|
|
24
|
+
deleteUser: ({ principalId }, _optional = {}) => request({ path: `/workspaces/${workspaceId}/users/${encodeURIComponent(principalId)}` }, { init: {
|
|
25
|
+
method: "DELETE",
|
|
26
|
+
} }),
|
|
27
|
+
resetUserPassword: ({ principalId, password }, _options = {}) => request({ path: `/workspaces/${workspaceId}/users/${encodeURIComponent(principalId)}/reset-password` }, { init: {
|
|
28
|
+
method: "POST",
|
|
29
|
+
body: JSON.stringify({ password }),
|
|
30
|
+
} }),
|
|
31
|
+
...createUserAccessApi({ request, workspaceId }),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function createUserAccessApi({ request, workspaceId }) {
|
|
35
|
+
return {
|
|
36
|
+
assignRole: ({ principalId, roleId }, _options = {}) => request({ path: `/workspaces/${workspaceId}/users/${encodeURIComponent(principalId)}/roles` }, { init: {
|
|
37
|
+
method: "POST",
|
|
38
|
+
body: JSON.stringify({ roleId }),
|
|
39
|
+
} }),
|
|
40
|
+
attachPolicy: ({ principalId, policyId }, _options = {}) => request({ path: `/workspaces/${workspaceId}/users/${encodeURIComponent(principalId)}/policies` }, { init: {
|
|
41
|
+
method: "POST",
|
|
42
|
+
body: JSON.stringify({ policyId }),
|
|
43
|
+
} }),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=users-api.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { UsersController as JiniController, useUsers as useJiniUsers } from "./use-users.hooks.js";
|
|
2
|
+
import type { UsersPort } from "@jini-ai/core/contracts/site/user-management-react";
|
|
3
|
+
import type { DictionaryTranslator } from '@jini-ai/core/text';
|
|
4
|
+
/**
|
|
5
|
+
* @file The locale-bound users controller: binds the host's locale hook, the users dictionary
|
|
6
|
+
* translator and route navigation onto {@link useJiniUsers}. Moved from the host's
|
|
7
|
+
* `features/users/hooks/users-controller.hooks.ts`; the host keeps only `useWiredUsers` (the live
|
|
8
|
+
* port and its router) and injects every collaborator through {@link LocalizedUsersDependencies},
|
|
9
|
+
* including the users controller hook itself (`useUsers`, normally this package's own) and the
|
|
10
|
+
* deep-link close callback, so the route it navigates to stays the host's.
|
|
11
|
+
*/
|
|
12
|
+
export type LocalizedUsersController = Omit<JiniController, "translate"> & {
|
|
13
|
+
/** Raw resolved locale — `rules.ts`'s `userRowMenuItems` takes `locale` directly rather than a
|
|
14
|
+
* bound translator. See this file's header. */
|
|
15
|
+
locale: string;
|
|
16
|
+
};
|
|
17
|
+
export interface LocalizedUsersDependencies {
|
|
18
|
+
port: UsersPort;
|
|
19
|
+
/** When true, auto-opens the reset-password dialog on the caller's own row once it is known —
|
|
20
|
+
* see the one-shot effect in {@link useLocalizedUsers} for why this needs both the flag AND the user list
|
|
21
|
+
* AND `me()` to have settled before it can act. */
|
|
22
|
+
openOwnPasswordReset?: boolean | undefined;
|
|
23
|
+
/** Called once the deep-linked own-password-reset dialog closes (never for a normal row-menu
|
|
24
|
+
* reset). The host owns the route it returns to and its navigation options. */
|
|
25
|
+
onOwnPasswordResetClosed?: (() => void) | undefined;
|
|
26
|
+
/** The users controller hook (REQUIRED hook dependency; the host binds this package's `useUsers`). */
|
|
27
|
+
useUsers: typeof useJiniUsers;
|
|
28
|
+
/** The host's locale hook (REQUIRED; e.g. the admin's `useAdminLocale`). */
|
|
29
|
+
useAdminLocale: () => string;
|
|
30
|
+
/** The host's workspace query scope (e.g. its `WORKSPACE_ID`). */
|
|
31
|
+
queryScope: string;
|
|
32
|
+
/** The host's users dictionary translator (`t({ locale, key })`, e.g. its `users-i18n.ts` built with
|
|
33
|
+
* `createDictionaryTranslator` over its common dictionary). */
|
|
34
|
+
t: DictionaryTranslator;
|
|
35
|
+
}
|
|
36
|
+
/** Bind host locale, routes and transport; Jini owns all screen state and account rules. */
|
|
37
|
+
export declare function useLocalizedUsers({ port, openOwnPasswordReset, onOwnPasswordResetClosed, useUsers, useAdminLocale, queryScope, t }: LocalizedUsersDependencies, _optional?: Record<string, never>): LocalizedUsersController;
|
|
38
|
+
/** The host's zero-argument (or options-only) wired controller hook — what {@link createUsersControllerHook}
|
|
39
|
+
* and `UsersPanel` take as `useUsersHook`. */
|
|
40
|
+
export type WiredUsersHook = (options?: {
|
|
41
|
+
openOwnPasswordReset?: boolean | undefined;
|
|
42
|
+
}) => LocalizedUsersController;
|
|
43
|
+
//# sourceMappingURL=use-localized-users.hooks.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { passwordResetNotice } from "../password-reset-notice.js";
|
|
3
|
+
/** Bind host locale, routes and transport; Jini owns all screen state and account rules. */
|
|
4
|
+
export function useLocalizedUsers({ port, openOwnPasswordReset, onOwnPasswordResetClosed, useUsers, useAdminLocale, queryScope, t }, _optional = {}) {
|
|
5
|
+
const locale = useAdminLocale();
|
|
6
|
+
const translate = useCallback((key) => t({ locale: locale, key: key }), [locale, t]);
|
|
7
|
+
const controller = useUsers({ port, translate, queryScope }, {
|
|
8
|
+
openOwnPasswordReset,
|
|
9
|
+
// A normal row-menu reset must not call this; Jini calls it only for the deep-linked dialog.
|
|
10
|
+
onOwnPasswordResetClosed,
|
|
11
|
+
passwordResetNotice: ({ username }) => passwordResetNotice({ locale, username }),
|
|
12
|
+
});
|
|
13
|
+
return { ...controller, locale };
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=use-localized-users.hooks.js.map
|
|
@@ -17,11 +17,11 @@ export declare function useUsersState(deps: UsersDependencies, { useUsersRoster,
|
|
|
17
17
|
canRenameOwnProfile: boolean;
|
|
18
18
|
openOwnRename: () => void;
|
|
19
19
|
renameUserHandler: ({ user }: {
|
|
20
|
-
user: import("
|
|
21
|
-
}, _options?: Record<string, never>) => ((target: import("
|
|
22
|
-
ownProfile: import("
|
|
23
|
-
rowCapabilities: (user: import("
|
|
24
|
-
canRenameUser: (user: import("
|
|
20
|
+
user: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser;
|
|
21
|
+
}, _options?: Record<string, never>) => ((target: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser) => void) | undefined;
|
|
22
|
+
ownProfile: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser | null;
|
|
23
|
+
rowCapabilities: (user: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser) => import("../rules.js").UserAccountCapabilities;
|
|
24
|
+
canRenameUser: (user: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser) => boolean;
|
|
25
25
|
ownPrincipalId: string | null;
|
|
26
26
|
effectivePermissions: string[];
|
|
27
27
|
canManageUserTrash: boolean;
|
|
@@ -31,13 +31,13 @@ export declare function useUsersState(deps: UsersDependencies, { useUsersRoster,
|
|
|
31
31
|
setToggleError: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
32
32
|
notice: string | null;
|
|
33
33
|
setNotice: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
34
|
-
toggleStatusMutation: import("@jini-ai/ui").MutationResult<import("
|
|
35
|
-
user: import("
|
|
34
|
+
toggleStatusMutation: import("@jini-ai/ui").MutationResult<import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser, {
|
|
35
|
+
user: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser;
|
|
36
36
|
}>;
|
|
37
|
-
confirmingDisable: import("
|
|
38
|
-
setConfirmingDisable: import("react").Dispatch<import("react").SetStateAction<import("
|
|
39
|
-
resetPasswordFor: import("
|
|
40
|
-
setResetPasswordFor: import("react").Dispatch<import("react").SetStateAction<import("
|
|
37
|
+
confirmingDisable: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser | null;
|
|
38
|
+
setConfirmingDisable: import("react").Dispatch<import("react").SetStateAction<import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser | null>>;
|
|
39
|
+
resetPasswordFor: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser | null;
|
|
40
|
+
setResetPasswordFor: import("react").Dispatch<import("react").SetStateAction<import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser | null>>;
|
|
41
41
|
newPassword: string;
|
|
42
42
|
setNewPassword: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
43
43
|
resetPassword: import("../../kit.js").AsyncActionState;
|
|
@@ -70,7 +70,7 @@ export declare function useUsersState(deps: UsersDependencies, { useUsersRoster,
|
|
|
70
70
|
principalId: string;
|
|
71
71
|
email: string;
|
|
72
72
|
}, {
|
|
73
|
-
user: import("
|
|
73
|
+
user: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser;
|
|
74
74
|
}>;
|
|
75
75
|
formOpen: boolean;
|
|
76
76
|
setFormOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
@@ -86,16 +86,16 @@ export declare function useUsersState(deps: UsersDependencies, { useUsersRoster,
|
|
|
86
86
|
password: string;
|
|
87
87
|
email: string | undefined;
|
|
88
88
|
}, {
|
|
89
|
-
user: import("
|
|
89
|
+
user: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser;
|
|
90
90
|
}>;
|
|
91
|
-
portRef: import("react").RefObject<import("
|
|
92
|
-
users: import("
|
|
93
|
-
roles: import("
|
|
94
|
-
policies: import("
|
|
91
|
+
portRef: import("react").RefObject<import("@jini-ai/core/contracts/site/user-management-react").UsersPort>;
|
|
92
|
+
users: import("@jini-ai/core/contracts/site/user-management-react").AdminIdentityUser[] | null;
|
|
93
|
+
roles: import("@jini-ai/core/contracts/site/user-management-react").AdminRole[] | null;
|
|
94
|
+
policies: import("@jini-ai/core/contracts/site/user-management-react").AdminPolicy[] | null;
|
|
95
95
|
canGrant: boolean;
|
|
96
96
|
error: string | null;
|
|
97
97
|
describeError: (error: unknown, fallback: string) => string;
|
|
98
|
-
port: import("
|
|
98
|
+
port: import("@jini-ai/core/contracts/site/user-management-react").UsersPort;
|
|
99
99
|
translate: Translate;
|
|
100
100
|
queryScope: string;
|
|
101
101
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The reset-password success toast — embeds the user's own (untranslated) `username`
|
|
2
|
+
* mid-sentence, so it can't be a flat `ES` entry the way `roles-i18n.ts`'s
|
|
3
|
+
* `roleDeleteBodyParts` etc. handle the same shape. */
|
|
4
|
+
export declare function passwordResetNotice({ locale, username }: {
|
|
5
|
+
locale: string;
|
|
6
|
+
username: string;
|
|
7
|
+
}, _optional?: Record<string, never>): string;
|
|
8
|
+
//# sourceMappingURL=password-reset-notice.d.ts.map
|