@jini-ai/user-management 0.7.2 → 0.7.3-next.1
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 +1 -7
- package/README.md +9 -5
- package/dist/admin/adapters/http.js +25 -20
- package/dist/admin/adapters/memory.js +164 -82
- package/dist/admin/auth.module.d.ts +2 -2
- package/dist/admin/auth.module.js +1 -1
- package/dist/admin/conformance/index.js +40 -18
- package/dist/admin/controllers/auth.controller.js +3 -1
- package/dist/admin/controllers/members.controller.js +56 -31
- package/dist/admin/controllers/roles.controller.d.ts +3 -3
- package/dist/admin/controllers/roles.controller.js +188 -122
- package/dist/admin/controllers/users.controller.js +151 -72
- package/dist/admin/members.module.d.ts +2 -2
- package/dist/admin/members.module.js +1 -1
- package/dist/admin/models.d.ts +1 -0
- package/dist/admin/ports.d.ts +3 -0
- package/dist/admin/react/components/DestructiveDialog.d.ts +1 -1
- package/dist/admin/react/components/DestructiveDialog.js +1 -1
- package/dist/admin/react/components/MemberRow.d.ts +3 -1
- package/dist/admin/react/components/MemberRow.js +2 -2
- package/dist/admin/react/components/MembersConfirmation.d.ts +4 -1
- package/dist/admin/react/components/MembersConfirmation.js +2 -2
- package/dist/admin/react/components/PermissionPanel.d.ts +4 -2
- package/dist/admin/react/components/PermissionPanel.js +2 -2
- package/dist/admin/react/components/PolicyRow.d.ts +4 -2
- package/dist/admin/react/components/PolicyRow.js +2 -2
- package/dist/admin/react/components/RoleRow.d.ts +4 -2
- package/dist/admin/react/components/RoleRow.js +2 -2
- package/dist/admin/react/components/UserRow.d.ts +3 -1
- package/dist/admin/react/components/UserRow.js +2 -2
- package/dist/admin/react/components/UsersConfirmation.d.ts +4 -1
- package/dist/admin/react/components/UsersConfirmation.js +2 -2
- package/dist/admin/react/hooks/AuthBinding.hooks.d.ts +1 -1
- package/dist/admin/react/hooks/AuthScope.hooks.d.ts +1 -1
- package/dist/admin/react/hooks/MembersBinding.hooks.d.ts +1 -1
- package/dist/admin/react/hooks/MembersScope.hooks.d.ts +1 -1
- package/dist/admin/react/hooks/PeopleController.hooks.js +6 -4
- package/dist/admin/react/hooks/RolesBinding.hooks.d.ts +1 -1
- package/dist/admin/react/hooks/RolesController.hooks.d.ts +4 -4
- package/dist/admin/react/hooks/RolesController.hooks.js +4 -3
- package/dist/admin/react/hooks/RolesPage.hooks.d.ts +8 -8
- package/dist/admin/react/hooks/RolesScope.hooks.d.ts +1 -1
- package/dist/admin/react/hooks/UsersBinding.hooks.d.ts +1 -1
- package/dist/admin/react/hooks/UsersScope.hooks.d.ts +1 -1
- package/dist/admin/react/index.d.ts +9 -9
- package/dist/admin/react/pages/LoginPage.d.ts +4 -1
- package/dist/admin/react/pages/LoginPage.js +2 -2
- package/dist/admin/react/pages/MembersPage.d.ts +4 -1
- package/dist/admin/react/pages/MembersPage.js +2 -2
- package/dist/admin/react/pages/RolesPage.d.ts +4 -1
- package/dist/admin/react/pages/RolesPage.js +2 -2
- package/dist/admin/react/pages/UsersPage.d.ts +4 -1
- package/dist/admin/react/pages/UsersPage.js +2 -2
- package/dist/admin/react/tabs/AuthTab.d.ts +4 -2
- package/dist/admin/react/tabs/AuthTab.js +2 -2
- package/dist/admin/react/tabs/MembersTab.d.ts +4 -2
- package/dist/admin/react/tabs/MembersTab.js +2 -2
- package/dist/admin/react/tabs/PoliciesTab.d.ts +4 -2
- package/dist/admin/react/tabs/PoliciesTab.js +2 -2
- package/dist/admin/react/tabs/RolesTab.d.ts +4 -2
- package/dist/admin/react/tabs/RolesTab.js +2 -2
- package/dist/admin/react/tabs/UsersTab.d.ts +3 -1
- package/dist/admin/react/tabs/UsersTab.js +2 -2
- package/dist/admin/roles.module.d.ts +2 -2
- package/dist/admin/roles.module.js +1 -1
- package/dist/admin/users.module.d.ts +4 -4
- package/dist/admin/users.module.js +1 -1
- package/dist/react/auth/Login.js +1 -1
- package/dist/react/auth/OwnerRecovery.hooks.d.ts +93 -0
- package/dist/react/auth/OwnerRecovery.hooks.js +105 -0
- package/dist/react/auth/Passkeys.d.ts +8 -3
- package/dist/react/auth/Passkeys.hooks.d.ts +38 -0
- package/dist/react/auth/Passkeys.hooks.js +72 -0
- package/dist/react/auth/Passkeys.js +6 -64
- package/dist/react/auth/TotpSettings.d.ts +5 -2
- package/dist/react/auth/TotpSettings.hooks.d.ts +41 -0
- package/dist/react/auth/TotpSettings.hooks.js +82 -0
- package/dist/react/auth/TotpSettings.js +10 -77
- package/dist/react/auth/hooks/use-login.hooks.d.ts +1 -1
- package/dist/react/auth/hooks/use-login.hooks.js +1 -0
- package/dist/react/errors.d.ts +1 -1
- package/dist/react/errors.js +1 -0
- package/dist/react/index.d.ts +6 -2
- package/dist/react/index.js +3 -1
- package/dist/react/kit.d.ts +91 -0
- package/dist/react/kit.js +63 -0
- package/dist/react/members/Members.d.ts +1 -1
- package/dist/react/members/Members.js +19 -5
- package/dist/react/members/hooks/use-members.hooks.d.ts +1 -1
- package/dist/react/members/hooks/use-members.hooks.js +49 -27
- package/dist/react/members/rules.d.ts +2 -2
- package/dist/react/members/rules.js +1 -0
- package/dist/react/ports.d.ts +2 -0
- package/dist/react/testing.js +47 -22
- package/dist/react/users/ChangeUsernameDialog.d.ts +2 -2
- package/dist/react/users/ChangeUsernameDialog.js +4 -3
- package/dist/react/users/UserRowParts.d.ts +3 -3
- package/dist/react/users/UserRowParts.js +2 -1
- package/dist/react/users/Users.d.ts +3 -3
- package/dist/react/users/Users.js +14 -27
- package/dist/react/users/UsersDialogs.d.ts +7 -0
- package/dist/react/users/UsersDialogs.js +64 -0
- package/dist/react/users/UsersTable.d.ts +118 -0
- package/dist/react/users/UsersTable.js +55 -0
- package/dist/react/users/hooks/use-change-username.hooks.d.ts +1 -1
- package/dist/react/users/hooks/use-change-username.hooks.js +2 -1
- package/dist/react/users/hooks/use-reset-password-fields.hooks.d.ts +8 -0
- package/dist/react/users/hooks/use-reset-password-fields.hooks.js +11 -0
- package/dist/react/users/hooks/use-users-form-state.hooks.d.ts +81 -0
- package/dist/react/users/hooks/use-users-form-state.hooks.js +68 -0
- package/dist/react/users/hooks/use-users-password.hooks.d.ts +24 -0
- package/dist/react/users/hooks/use-users-password.hooks.js +85 -0
- package/dist/react/users/hooks/use-users-roster.hooks.d.ts +42 -0
- package/dist/react/users/hooks/use-users-roster.hooks.js +133 -0
- package/dist/react/users/hooks/use-users-state.hooks.d.ts +102 -0
- package/dist/react/users/hooks/use-users-state.hooks.js +19 -0
- package/dist/react/users/hooks/use-users-status.hooks.d.ts +26 -0
- package/dist/react/users/hooks/use-users-status.hooks.js +97 -0
- package/dist/react/users/hooks/use-users.hooks.d.ts +13 -5
- package/dist/react/users/hooks/use-users.hooks.js +23 -503
- package/dist/react/users/hooks/users-controller.d.ts +14 -0
- package/dist/react/users/hooks/users-controller.js +29 -0
- package/dist/react/users/hooks/users-grant-actions.d.ts +26 -0
- package/dist/react/users/hooks/users-grant-actions.js +124 -0
- package/dist/react/users/rules.d.ts +5 -4
- package/dist/react/users/rules.js +3 -2
- package/dist/server/admin-crud-service.d.ts +2 -2
- package/dist/server/admin-crud-service.js +38 -71
- package/dist/server/agent-tool-input.d.ts +7 -3
- package/dist/server/agent-tool-input.js +47 -14
- package/dist/server/agent-tool-registrations.d.ts +5 -2
- package/dist/server/agent-tool-registrations.js +250 -199
- package/dist/server/agent-tools.d.ts +1 -1
- package/dist/server/auth-service.js +1 -1
- package/dist/server/grant-service.d.ts +8 -0
- package/dist/server/grant-service.js +24 -22
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/server/link-policy.d.ts +23 -0
- package/dist/server/link-policy.js +30 -0
- package/dist/server/permission-migrations.d.ts +3 -3
- package/dist/server/repo.memory-transactions.js +24 -20
- package/dist/server/repo.memory.d.ts +21 -33
- package/dist/server/repo.memory.js +13 -34
- package/dist/server/seed.d.ts +3 -3
- package/dist/server/seed.js +10 -10
- package/dist/session-bootstrap/ensure.d.ts +13 -0
- package/dist/session-bootstrap/ensure.js +11 -0
- package/dist/session-bootstrap/index.d.ts +5 -0
- package/dist/session-bootstrap/index.js +4 -0
- package/dist/session-bootstrap/loopback.d.ts +14 -0
- package/dist/session-bootstrap/loopback.js +25 -0
- package/dist/session-bootstrap/read-initial.d.ts +25 -0
- package/dist/session-bootstrap/read-initial.js +27 -0
- package/package.json +20 -24
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState, useSyncExternalStore } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
2
2
|
/** StrictMode gets a fresh effect-owned controller. Scope changes drop old data synchronously,
|
|
3
3
|
* before the replacement effect runs; retired controllers abort requests and unsubscribe refresh. */
|
|
4
4
|
export function usePeopleController({ scope, key, create, start }, _optional = {}) {
|
|
5
|
+
const lifecycle = useRef({ create, start });
|
|
6
|
+
lifecycle.current = { create, start };
|
|
5
7
|
const [attachment, setAttachment] = useState(null);
|
|
6
8
|
const controller = attachment?.scope === scope && attachment.key === key ? attachment.controller : null;
|
|
7
9
|
useEffect(() => {
|
|
8
|
-
const
|
|
10
|
+
const { create: createController, start: startController } = lifecycle.current;
|
|
11
|
+
const current = createController();
|
|
9
12
|
setAttachment({ scope, key, controller: current });
|
|
10
|
-
|
|
13
|
+
startController(current);
|
|
11
14
|
return () => current.dispose({});
|
|
12
15
|
// create/start are render closures; scope and key encode their entire injected dependency set.
|
|
13
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
16
|
}, [scope, key]);
|
|
15
17
|
const subscribe = useCallback((listener) => controller?.subscribe({ listener }) ?? (() => { }), [controller]);
|
|
16
18
|
const read = useCallback(() => controller?.getSnapshot({}) ?? null, [controller]);
|
|
@@ -2,7 +2,7 @@ import { type RolesScope } from './RolesScope.hooks.js';
|
|
|
2
2
|
export { useRolesScope } from './RolesScope.hooks.js';
|
|
3
3
|
export type { RolesScope, RolesTabProps, RolesPageProps } from './RolesScope.hooks.js';
|
|
4
4
|
import type { ReactNode } from 'react';
|
|
5
|
-
import type { AdminInstance } from '@jini-ai/
|
|
5
|
+
import type { AdminInstance } from '@jini-ai/core/contracts/admin-module';
|
|
6
6
|
import { rolesModule } from '../../roles.module.js';
|
|
7
7
|
/** A private scope binds only this module's declared ports. No admin React internals are needed. */
|
|
8
8
|
export declare function createRolesBinding({ module }: {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Both tabs read the page-owned controller; neither tab starts its own duplicate fetches. */
|
|
3
3
|
export declare function useRolesController(_required?: Record<string, never>, _optional?: Record<string, never>): {
|
|
4
4
|
controller: {
|
|
5
|
-
getSnapshot(_required?: Record<string, never>, _optional?: Record<string, never>)
|
|
6
|
-
subscribe({ listener }: {
|
|
5
|
+
getSnapshot: (_required?: Record<string, never>, _optional?: Record<string, never>) => Readonly<import("../../models.js").RolesState>;
|
|
6
|
+
subscribe: ({ listener }: {
|
|
7
7
|
listener: () => void;
|
|
8
|
-
}, _optional?: Record<string, never>)
|
|
8
|
+
}, _optional?: Record<string, never>) => () => void;
|
|
9
9
|
dispose(_required?: Record<string, never>, _optional?: Record<string, never>): void;
|
|
10
10
|
setDraft({ patch }: {
|
|
11
11
|
patch: Partial<import("../../models.js").RolesDraft>;
|
|
@@ -37,7 +37,7 @@ export declare function useRolesController(_required?: Record<string, never>, _o
|
|
|
37
37
|
cancelDestructive: (_required: Record<string, never>, _optional?: Record<string, never>) => void;
|
|
38
38
|
confirmDestructive: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<boolean>;
|
|
39
39
|
} | null;
|
|
40
|
-
state: import("../../models.js").RolesState | null;
|
|
40
|
+
state: Readonly<import("../../models.js").RolesState> | null;
|
|
41
41
|
permissions: readonly string[];
|
|
42
42
|
};
|
|
43
43
|
//# sourceMappingURL=RolesController.hooks.d.ts.map
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState, useSyncExternalStore } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
2
2
|
import { createRolesController } from '../../controllers/roles.controller.js';
|
|
3
3
|
import { useRolesScope } from './RolesScope.hooks.js';
|
|
4
4
|
/** Controller creation belongs to the effect, so StrictMode replay gets a fresh instance.
|
|
5
5
|
* Both tabs read the page-owned controller; neither tab starts its own duplicate fetches. */
|
|
6
6
|
export function useRolesController(_required = {}, _optional = {}) {
|
|
7
7
|
const { api, permissions } = useRolesScope({});
|
|
8
|
+
const permissionsRef = useRef(permissions);
|
|
9
|
+
permissionsRef.current = permissions;
|
|
8
10
|
const grantKey = JSON.stringify(permissions);
|
|
9
11
|
const [attachment, setAttachment] = useState(null);
|
|
10
12
|
// A host/workspace swap cannot render the previous scope's data while its new effect attaches.
|
|
11
13
|
const controller = attachment?.api === api && attachment.grantKey === grantKey ? attachment.controller : null;
|
|
12
14
|
useEffect(() => {
|
|
13
|
-
const current = createRolesController({ api }, { permissions });
|
|
15
|
+
const current = createRolesController({ api }, { permissions: permissionsRef.current });
|
|
14
16
|
setAttachment({ controller: current, api, grantKey });
|
|
15
17
|
void current.load({});
|
|
16
18
|
return () => current.dispose({});
|
|
17
19
|
// grantKey is the immutable grant value, independent of a Provider's object identity.
|
|
18
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
20
|
}, [api, grantKey]);
|
|
20
21
|
const subscribe = useCallback((listener) => controller?.subscribe({ listener }) ?? (() => { }), [controller]);
|
|
21
22
|
const read = useCallback(() => controller?.getSnapshot() ?? null, [controller]);
|
|
@@ -11,10 +11,10 @@ export declare const RolesViewContext: import("react").Context<RolesView | null>
|
|
|
11
11
|
export declare function useRolesView(_required?: Record<string, never>, _optional?: Record<string, never>): RolesView;
|
|
12
12
|
export declare function useRolesPage(props: RolesPageProps, _optional?: Record<string, never>): {
|
|
13
13
|
controller: {
|
|
14
|
-
getSnapshot(_required?: Record<string, never>, _optional?: Record<string, never>)
|
|
15
|
-
subscribe({ listener }: {
|
|
14
|
+
getSnapshot: (_required?: Record<string, never>, _optional?: Record<string, never>) => Readonly<RolesState>;
|
|
15
|
+
subscribe: ({ listener }: {
|
|
16
16
|
listener: () => void;
|
|
17
|
-
}, _optional?: Record<string, never>)
|
|
17
|
+
}, _optional?: Record<string, never>) => () => void;
|
|
18
18
|
dispose(_required?: Record<string, never>, _optional?: Record<string, never>): void;
|
|
19
19
|
setDraft({ patch }: {
|
|
20
20
|
patch: Partial<import("../../models.js").RolesDraft>;
|
|
@@ -46,7 +46,7 @@ export declare function useRolesPage(props: RolesPageProps, _optional?: Record<s
|
|
|
46
46
|
cancelDestructive: (_required: Record<string, never>, _optional?: Record<string, never>) => void;
|
|
47
47
|
confirmDestructive: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<boolean>;
|
|
48
48
|
} | null;
|
|
49
|
-
state: RolesState | null;
|
|
49
|
+
state: Readonly<RolesState> | null;
|
|
50
50
|
canManage: boolean;
|
|
51
51
|
items: {
|
|
52
52
|
id: string;
|
|
@@ -59,10 +59,10 @@ export declare function useRolesPage(props: RolesPageProps, _optional?: Record<s
|
|
|
59
59
|
noTabs: boolean;
|
|
60
60
|
view: {
|
|
61
61
|
controller: {
|
|
62
|
-
getSnapshot(_required?: Record<string, never>, _optional?: Record<string, never>)
|
|
63
|
-
subscribe({ listener }: {
|
|
62
|
+
getSnapshot: (_required?: Record<string, never>, _optional?: Record<string, never>) => Readonly<RolesState>;
|
|
63
|
+
subscribe: ({ listener }: {
|
|
64
64
|
listener: () => void;
|
|
65
|
-
}, _optional?: Record<string, never>)
|
|
65
|
+
}, _optional?: Record<string, never>) => () => void;
|
|
66
66
|
dispose(_required?: Record<string, never>, _optional?: Record<string, never>): void;
|
|
67
67
|
setDraft({ patch }: {
|
|
68
68
|
patch: Partial<import("../../models.js").RolesDraft>;
|
|
@@ -94,7 +94,7 @@ export declare function useRolesPage(props: RolesPageProps, _optional?: Record<s
|
|
|
94
94
|
cancelDestructive: (_required: Record<string, never>, _optional?: Record<string, never>) => void;
|
|
95
95
|
confirmDestructive: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<boolean>;
|
|
96
96
|
};
|
|
97
|
-
state: RolesState
|
|
97
|
+
state: Readonly<RolesState>;
|
|
98
98
|
canManage: boolean;
|
|
99
99
|
} | null;
|
|
100
100
|
changeTab: ({ value }: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType, LazyExoticComponent } from 'react';
|
|
2
|
-
import type { AdminInstance } from '@jini-ai/
|
|
2
|
+
import type { AdminInstance } from '@jini-ai/core/contracts/admin-module';
|
|
3
3
|
import type { RolesApiPort } from '../../ports.js';
|
|
4
4
|
export interface RolesScope {
|
|
5
5
|
readonly api: RolesApiPort;
|
|
@@ -2,7 +2,7 @@ import { type UsersScope } from './UsersScope.hooks.js';
|
|
|
2
2
|
export { useUsersScope } from './UsersScope.hooks.js';
|
|
3
3
|
export type { UsersScope, UsersPageProps } from './UsersScope.hooks.js';
|
|
4
4
|
import type { ReactNode } from 'react';
|
|
5
|
-
import type { AdminInstance } from '@jini-ai/
|
|
5
|
+
import type { AdminInstance } from '@jini-ai/core/contracts/admin-module';
|
|
6
6
|
import { usersModule } from '../../users.module.js';
|
|
7
7
|
/** Descriptor identity must be the exact enriched object supplied to createAdmin. */
|
|
8
8
|
export declare function createUsersBinding({ module }: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType, LazyExoticComponent } from 'react';
|
|
2
|
-
import type { AdminInstance } from '@jini-ai/
|
|
2
|
+
import type { AdminInstance } from '@jini-ai/core/contracts/admin-module';
|
|
3
3
|
import type { UsersApiPort, UsersSafetyPort } from '../../ports.js';
|
|
4
4
|
export interface UsersScope {
|
|
5
5
|
readonly api: UsersApiPort;
|
|
@@ -3,7 +3,7 @@ export declare const rolesKitNeeds: import("@jini-ai/ui-kit").KitNeeds<"Notice"
|
|
|
3
3
|
export declare function roles(_required: Record<string, never>, _optional?: Record<string, never>): {
|
|
4
4
|
id: "roles";
|
|
5
5
|
requires: {
|
|
6
|
-
readonly rolesApi: import("@jini-ai/
|
|
6
|
+
readonly rolesApi: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").RolesApiPort, "jini.identity.rolesApi">;
|
|
7
7
|
};
|
|
8
8
|
provides: {};
|
|
9
9
|
messages: Readonly<{
|
|
@@ -52,7 +52,7 @@ export declare function roles(_required: Record<string, never>, _optional?: Reco
|
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
Provider: ({ admin, children }: {
|
|
55
|
-
admin: import("@jini-ai/
|
|
55
|
+
admin: import("@jini-ai/core/contracts/admin-module").AdminInstance;
|
|
56
56
|
children: import("react").ReactNode;
|
|
57
57
|
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("./hooks/RolesScope.hooks.js").RolesScope | null>>;
|
|
58
58
|
};
|
|
@@ -65,8 +65,8 @@ export declare const authKitNeeds: import("@jini-ai/ui-kit").KitNeeds<"Notice" |
|
|
|
65
65
|
export declare function users(_required: Record<string, never>, _optional?: Record<string, never>): {
|
|
66
66
|
id: "users";
|
|
67
67
|
requires: {
|
|
68
|
-
readonly usersApi: import("@jini-ai/
|
|
69
|
-
readonly usersSafety: import("@jini-ai/
|
|
68
|
+
readonly usersApi: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").UsersApiPort, "jini.identity.usersApi">;
|
|
69
|
+
readonly usersSafety: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").UsersSafetyPort, "jini.identity.usersSafety">;
|
|
70
70
|
};
|
|
71
71
|
provides: {};
|
|
72
72
|
messages: {
|
|
@@ -105,7 +105,7 @@ export declare function users(_required: Record<string, never>, _optional?: Reco
|
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
Provider: ({ admin, children }: {
|
|
108
|
-
admin: import("@jini-ai/
|
|
108
|
+
admin: import("@jini-ai/core/contracts/admin-module").AdminInstance;
|
|
109
109
|
children: import("react").ReactNode;
|
|
110
110
|
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("./hooks/UsersScope.hooks.js").UsersScope | null>>;
|
|
111
111
|
};
|
|
@@ -114,7 +114,7 @@ export declare function users(_required: Record<string, never>, _optional?: Reco
|
|
|
114
114
|
export declare function members(_required: Record<string, never>, _optional?: Record<string, never>): {
|
|
115
115
|
id: "members";
|
|
116
116
|
requires: {
|
|
117
|
-
readonly membersApi: import("@jini-ai/
|
|
117
|
+
readonly membersApi: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").MembersApiPort, "jini.identity.membersApi">;
|
|
118
118
|
};
|
|
119
119
|
provides: {};
|
|
120
120
|
messages: {
|
|
@@ -150,7 +150,7 @@ export declare function members(_required: Record<string, never>, _optional?: Re
|
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
152
|
Provider: ({ admin, children }: {
|
|
153
|
-
admin: import("@jini-ai/
|
|
153
|
+
admin: import("@jini-ai/core/contracts/admin-module").AdminInstance;
|
|
154
154
|
children: import("react").ReactNode;
|
|
155
155
|
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("./hooks/MembersScope.hooks.js").MembersScope | null>>;
|
|
156
156
|
};
|
|
@@ -159,7 +159,7 @@ export declare function members(_required: Record<string, never>, _optional?: Re
|
|
|
159
159
|
export declare function auth(_required: Record<string, never>, _optional?: Record<string, never>): {
|
|
160
160
|
id: "auth";
|
|
161
161
|
requires: {
|
|
162
|
-
readonly authApi: import("@jini-ai/
|
|
162
|
+
readonly authApi: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").AuthApiPort, "jini.identity.authApi">;
|
|
163
163
|
};
|
|
164
164
|
provides: {};
|
|
165
165
|
messages: {
|
|
@@ -191,7 +191,7 @@ export declare function auth(_required: Record<string, never>, _optional?: Recor
|
|
|
191
191
|
};
|
|
192
192
|
};
|
|
193
193
|
Provider: ({ admin, children }: {
|
|
194
|
-
admin: import("@jini-ai/
|
|
194
|
+
admin: import("@jini-ai/core/contracts/admin-module").AdminInstance;
|
|
195
195
|
children: import("react").ReactNode;
|
|
196
196
|
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("./hooks/AuthScope.hooks.js").AuthScope | null>>;
|
|
197
197
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { useLoginPage as useLoginPage_ } from '../hooks/LoginPage.hooks.js';
|
|
1
2
|
import type { AuthPageProps } from '../hooks/AuthScope.hooks.js';
|
|
2
|
-
export default function LoginPage(props: AuthPageProps
|
|
3
|
+
export default function LoginPage({ useLoginPage, ...props }: AuthPageProps & {
|
|
4
|
+
useLoginPage?: typeof useLoginPage_;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
3
6
|
//# sourceMappingURL=LoginPage.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense } from 'react';
|
|
3
3
|
import { Notice, Spinner } from '@jini-ai/ui-kit/react';
|
|
4
|
-
import { AuthViewContext, useLoginPage } from '../hooks/LoginPage.hooks.js';
|
|
5
|
-
export default function LoginPage(
|
|
4
|
+
import { AuthViewContext, useLoginPage as useLoginPage_ } from '../hooks/LoginPage.hooks.js';
|
|
5
|
+
export default function LoginPage({ useLoginPage = useLoginPage_, ...props }) {
|
|
6
6
|
const v = useLoginPage(props);
|
|
7
7
|
if (!v.visible)
|
|
8
8
|
return _jsx(Notice, { children: "Login is unavailable." });
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { MembersPageProps } from '../hooks/MembersScope.hooks.js';
|
|
2
|
-
|
|
2
|
+
import { useMembersPage as useMembersPage_ } from '../hooks/MembersPage.hooks.js';
|
|
3
|
+
export default function MembersPage({ useMembersPage, ...props }: MembersPageProps & {
|
|
4
|
+
useMembersPage?: typeof useMembersPage_;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
3
6
|
//# sourceMappingURL=MembersPage.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense } from 'react';
|
|
3
3
|
import { Notice, Spinner, Button } from '@jini-ai/ui-kit/react';
|
|
4
|
-
import { MembersViewContext, useMembersPage } from '../hooks/MembersPage.hooks.js';
|
|
4
|
+
import { MembersViewContext, useMembersPage as useMembersPage_ } from '../hooks/MembersPage.hooks.js';
|
|
5
5
|
import { membersMessagesEn as m } from '../../messages.en.js';
|
|
6
6
|
import { MembersConfirmation } from '../components/MembersConfirmation.js';
|
|
7
|
-
export default function MembersPage(
|
|
7
|
+
export default function MembersPage({ useMembersPage = useMembersPage_, ...props }) {
|
|
8
8
|
const v = useMembersPage(props);
|
|
9
9
|
if (!v.visible)
|
|
10
10
|
return _jsx(Notice, { children: "Members administration is unavailable." });
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { RolesPageProps } from '../hooks/RolesScope.hooks.js';
|
|
2
|
-
|
|
2
|
+
import { useRolesPage as useRolesPage_ } from '../hooks/RolesPage.hooks.js';
|
|
3
|
+
export default function RolesPage({ useRolesPage, ...props }: RolesPageProps & {
|
|
4
|
+
useRolesPage?: typeof useRolesPage_;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
3
6
|
//# sourceMappingURL=RolesPage.d.ts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense } from 'react';
|
|
3
3
|
import { Button, Notice, Spinner, Tabs } from '@jini-ai/ui-kit/react';
|
|
4
|
-
import { RolesViewContext, useRolesPage } from '../hooks/RolesPage.hooks.js';
|
|
4
|
+
import { RolesViewContext, useRolesPage as useRolesPage_ } from '../hooks/RolesPage.hooks.js';
|
|
5
5
|
import { DestructiveDialog } from '../components/DestructiveDialog.js';
|
|
6
6
|
import { rolesMessagesEn as m } from '../../messages.en.js';
|
|
7
7
|
/** The loaded shell; RolesPage only renders it once the page view and both lists exist. */
|
|
8
8
|
function RolesShell({ v, view }) {
|
|
9
9
|
return _jsx(RolesViewContext.Provider, { value: view, children: _jsxs("div", { className: "page", children: [_jsxs("header", { children: [_jsx("p", { children: m.people }), _jsx("h1", { children: m.title }), _jsx("p", { children: m.description })] }), !v.canManage ? _jsx(Notice, { children: m.readOnly }) : null, view.state.rowError ? _jsx(Notice, { tone: "danger", children: view.state.rowError }) : null, v.noTabs ? _jsx(Notice, { children: "No roles tabs are enabled." }) : _jsx(Suspense, { fallback: _jsx(Spinner, { label: m.loading }), children: _jsx(Tabs, { label: m.title, value: v.tab, items: v.items, onValueChange: v.changeTab }) }), _jsx(DestructiveDialog, { ...v.confirm })] }) });
|
|
10
10
|
}
|
|
11
|
-
export default function RolesPage(props) {
|
|
11
|
+
export default function RolesPage({ useRolesPage = useRolesPage_, ...props }) {
|
|
12
12
|
const v = useRolesPage(props);
|
|
13
13
|
if (v.hidden)
|
|
14
14
|
return _jsx(Notice, { children: "Roles administration is unavailable." });
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { UsersPageProps } from '../hooks/UsersScope.hooks.js';
|
|
2
|
-
|
|
2
|
+
import { useUsersPage as useUsersPage_ } from '../hooks/UsersPage.hooks.js';
|
|
3
|
+
export default function UsersPage({ useUsersPage, ...props }: UsersPageProps & {
|
|
4
|
+
useUsersPage?: typeof useUsersPage_;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
3
6
|
//# sourceMappingURL=UsersPage.d.ts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense } from 'react';
|
|
3
3
|
import { Button, Notice, Spinner } from '@jini-ai/ui-kit/react';
|
|
4
|
-
import { useUsersPage, UsersViewContext } from '../hooks/UsersPage.hooks.js';
|
|
4
|
+
import { useUsersPage as useUsersPage_, UsersViewContext } from '../hooks/UsersPage.hooks.js';
|
|
5
5
|
import { usersMessagesEn as m } from '../../messages.en.js';
|
|
6
6
|
import { UsersConfirmation } from '../components/UsersConfirmation.js';
|
|
7
7
|
/** The loaded shell; UsersPage only renders it once the page view and all three lists exist. */
|
|
8
8
|
function UsersShell({ v, view }) {
|
|
9
9
|
return _jsx(UsersViewContext.Provider, { value: view, children: _jsxs("div", { className: "page", children: [_jsxs("header", { children: [_jsx("p", { children: "People" }), _jsx("h1", { children: m.title }), _jsx("p", { children: m.description }), _jsx("p", { children: m.passwordHelp })] }), v.readOnly ? _jsx(Notice, { children: m.readOnly }) : null, _jsx(Notice, { children: m.protected }), view.state.rowError ? _jsx(Notice, { tone: "danger", children: view.state.rowError }) : null, view.state.notice ? _jsx(Notice, { tone: "success", children: view.state.notice }) : null, _jsx(Suspense, { fallback: _jsx(Spinner, { label: m.loading }), children: v.content }), _jsx(UsersConfirmation, {})] }) });
|
|
10
10
|
}
|
|
11
|
-
export default function UsersPage(props) {
|
|
11
|
+
export default function UsersPage({ useUsersPage = useUsersPage_, ...props }) {
|
|
12
12
|
const v = useUsersPage(props);
|
|
13
13
|
if (!v.visible)
|
|
14
14
|
return _jsx(Notice, { children: "Users administration is unavailable." });
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { useAuthTab as useAuthTab_ } from '../hooks/LoginPage.hooks.js';
|
|
2
|
+
export default function AuthTab({ useAuthTab }?: {
|
|
2
3
|
readonly params?: Readonly<Record<string, unknown>>;
|
|
3
|
-
|
|
4
|
+
useAuthTab?: typeof useAuthTab_;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
4
6
|
//# sourceMappingURL=AuthTab.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, TextField, Notice } from '@jini-ai/ui-kit/react';
|
|
3
|
-
import { useAuthTab } from '../hooks/LoginPage.hooks.js';
|
|
4
|
-
export default function AuthTab(
|
|
3
|
+
import { useAuthTab as useAuthTab_ } from '../hooks/LoginPage.hooks.js';
|
|
4
|
+
export default function AuthTab({ useAuthTab = useAuthTab_ } = {}) {
|
|
5
5
|
const v = useAuthTab({});
|
|
6
6
|
return _jsxs("form", { onSubmit: v.submit, children: [_jsx(TextField, { label: "Username", attrs: v.usernameAttrs, value: v.s.username, onValueChange: v.username }), _jsx(TextField, { label: "Password", attrs: v.passwordAttrs, type: "password", value: v.s.password, onValueChange: v.password }), v.s.error ? _jsx(Notice, { tone: "danger", children: v.s.error }) : null, _jsx(Button, { type: "submit", pending: v.s.busy, children: v.submitLabel })] });
|
|
7
7
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { useMembersView as useMembersView_ } from '../hooks/MembersPage.hooks.js';
|
|
2
|
+
export default function MembersTab({ useMembersView }?: {
|
|
2
3
|
readonly params?: Readonly<Record<string, unknown>>;
|
|
3
|
-
|
|
4
|
+
useMembersView?: typeof useMembersView_;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
4
6
|
//# sourceMappingURL=MembersTab.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Notice } from '@jini-ai/ui-kit/react';
|
|
3
|
-
import { useMembersView } from '../hooks/MembersPage.hooks.js';
|
|
3
|
+
import { useMembersView as useMembersView_ } from '../hooks/MembersPage.hooks.js';
|
|
4
4
|
import { MemberRow } from '../components/MemberRow.js';
|
|
5
|
-
export default function MembersTab(
|
|
5
|
+
export default function MembersTab({ useMembersView = useMembersView_ } = {}) {
|
|
6
6
|
const v = useMembersView({});
|
|
7
7
|
return _jsx("section", { "aria-label": "Members", children: v.state.members?.length === 0 ? _jsx(Notice, { children: "No members yet. Registered members will show up here." }) : _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Email" }), _jsx("th", { children: "Name" }), _jsx("th", { children: "Status" }), _jsx("th", { children: "Created" }), _jsx("th", { children: "Actions" })] }) }), _jsx("tbody", { children: v.state.members?.map(member => _jsx(MemberRow, { member: member }, member.id)) })] }) });
|
|
8
8
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { usePoliciesTab as usePoliciesTab_ } from '../hooks/PoliciesTab.hooks.js';
|
|
2
|
+
export default function PoliciesTab({ usePoliciesTab }: {
|
|
2
3
|
readonly params?: Readonly<Record<string, unknown>>;
|
|
3
|
-
|
|
4
|
+
usePoliciesTab?: typeof usePoliciesTab_;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
4
6
|
//# sourceMappingURL=PoliciesTab.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, TextField, Notice } from '@jini-ai/ui-kit/react';
|
|
3
|
-
import { usePoliciesTab } from '../hooks/PoliciesTab.hooks.js';
|
|
3
|
+
import { usePoliciesTab as usePoliciesTab_ } from '../hooks/PoliciesTab.hooks.js';
|
|
4
4
|
import { PolicyRow } from '../components/PolicyRow.js';
|
|
5
|
-
export default function PoliciesTab(
|
|
5
|
+
export default function PoliciesTab({ usePoliciesTab = usePoliciesTab_ }) {
|
|
6
6
|
const v = usePoliciesTab({});
|
|
7
7
|
return _jsxs("section", { children: [_jsx("h2", { children: "Policies" }), v.canManage ? _jsxs("form", { onSubmit: v.submit, children: [v.error ? _jsx(Notice, { tone: "danger", children: v.error }) : null, _jsx(TextField, { label: "Policy name", value: v.name, onValueChange: v.changeName, required: true }), _jsx(TextField, { label: "Description (optional)", value: v.description, onValueChange: v.changeDescription }), _jsx(Button, { type: "submit", pending: v.saving, disabled: v.createDisabled, children: "Create policy" })] }) : null, v.rows.length ? _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Name" }), _jsx("th", { children: "Description" }), _jsx("th", { children: "Type" }), _jsx("th", { children: "More" })] }) }), _jsx("tbody", { children: v.rows.map(policy => _jsx(PolicyRow, { policy: policy }, policy.id)) })] }) : _jsx("p", { children: "No policies yet." })] });
|
|
8
8
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { useRolesTab as useRolesTab_ } from '../hooks/RolesTab.hooks.js';
|
|
2
|
+
export default function RolesTab({ useRolesTab }: {
|
|
2
3
|
readonly params?: Readonly<Record<string, unknown>>;
|
|
3
|
-
|
|
4
|
+
useRolesTab?: typeof useRolesTab_;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
4
6
|
//# sourceMappingURL=RolesTab.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, TextField, Notice } from '@jini-ai/ui-kit/react';
|
|
3
|
-
import { useRolesTab } from '../hooks/RolesTab.hooks.js';
|
|
3
|
+
import { useRolesTab as useRolesTab_ } from '../hooks/RolesTab.hooks.js';
|
|
4
4
|
import { RoleRow } from '../components/RoleRow.js';
|
|
5
|
-
export default function RolesTab(
|
|
5
|
+
export default function RolesTab({ useRolesTab = useRolesTab_ }) {
|
|
6
6
|
const v = useRolesTab({});
|
|
7
7
|
return _jsxs("section", { children: [_jsx("h2", { children: "Roles" }), v.canManage ? _jsxs("form", { onSubmit: v.submit, children: [v.error ? _jsx(Notice, { tone: "danger", children: v.error }) : null, _jsx(TextField, { label: "Role name", value: v.name, onValueChange: v.changeName, required: true }), _jsx(Button, { type: "submit", pending: v.saving, disabled: v.createDisabled, children: "Create role" })] }) : null, v.rows.length ? _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Name" }), _jsx("th", { children: "Type" }), _jsx("th", { children: "More" })] }) }), _jsx("tbody", { children: v.rows.map(role => _jsx(RoleRow, { role: role }, role.id)) })] }) : _jsx("p", { children: "No roles yet." })] });
|
|
8
8
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { useUsersTab as useUsersTab_ } from '../hooks/UsersTab.hooks.js';
|
|
2
|
+
export default function UsersTab({ useUsersTab }?: {
|
|
2
3
|
readonly params?: Readonly<Record<string, unknown>>;
|
|
4
|
+
useUsersTab?: typeof useUsersTab_;
|
|
3
5
|
}, _optional?: Record<string, never>): import("react").JSX.Element;
|
|
4
6
|
//# sourceMappingURL=UsersTab.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, TextField, Notice } from '@jini-ai/ui-kit/react';
|
|
3
|
-
import { useUsersTab, newPasswordAttrs } from '../hooks/UsersTab.hooks.js';
|
|
3
|
+
import { useUsersTab as useUsersTab_, newPasswordAttrs } from '../hooks/UsersTab.hooks.js';
|
|
4
4
|
import { UserRow } from '../components/UserRow.js';
|
|
5
|
-
export default function UsersTab(
|
|
5
|
+
export default function UsersTab({ useUsersTab = useUsersTab_ } = {}, _optional) {
|
|
6
6
|
const v = useUsersTab({});
|
|
7
7
|
return _jsxs("section", { "aria-label": "Users", children: [v.canCreate ? _jsx(Button, { onPress: v.toggleForm, children: "New user" }) : null, v.canCreate && v.s.formOpen ? _jsxs("form", { onSubmit: v.submit, children: [_jsx(TextField, { label: "Username", value: v.s.username, onValueChange: v.username, required: true }), _jsx(TextField, { label: "Email (optional)", type: "email", value: v.s.email, onValueChange: v.email }), _jsx(TextField, { label: "Password", type: "password", attrs: newPasswordAttrs, value: v.s.password, onValueChange: v.password, required: true }), v.s.formError ? _jsx(Notice, { tone: "danger", children: v.s.formError }) : null, _jsx(Button, { type: "submit", pending: v.s.saving, children: "Create user" }), _jsx(Button, { onPress: v.cancelForm, children: "Cancel" })] }) : null, v.s.users?.length === 0 ? _jsx(Notice, { children: "No users yet. Create your first operator account to get started." }) : _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Username" }), _jsx("th", { children: "Email" }), _jsx("th", { children: "Status" }), _jsx("th", { children: "Roles" }), _jsx("th", { children: "Policies" }), _jsx("th", { children: "Actions" })] }) }), _jsx("tbody", { children: v.s.users?.map(user => _jsx(UserRow, { user: user }, user.principalId)) })] })] });
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RolesApiPort } from './ports.js';
|
|
2
|
-
export declare const rolesApiToken: import("@jini-ai/
|
|
2
|
+
export declare const rolesApiToken: import("@jini-ai/core/contracts/admin-module").AdminPortToken<RolesApiPort, "jini.identity.rolesApi">;
|
|
3
3
|
/** Roles and policies show no cross-reference columns, so separating them loses no context.
|
|
4
4
|
* Policy permission editors can grow without pushing the roles list down the page.
|
|
5
5
|
* Counts add density without information: each list is one click away and fully visible.
|
|
@@ -7,7 +7,7 @@ export declare const rolesApiToken: import("@jini-ai/admin/core/module").AdminPo
|
|
|
7
7
|
export declare const rolesModule: {
|
|
8
8
|
readonly id: "roles";
|
|
9
9
|
readonly requires: {
|
|
10
|
-
readonly rolesApi: import("@jini-ai/
|
|
10
|
+
readonly rolesApi: import("@jini-ai/core/contracts/admin-module").AdminPortToken<RolesApiPort, "jini.identity.rolesApi">;
|
|
11
11
|
};
|
|
12
12
|
readonly provides: {};
|
|
13
13
|
readonly messages: Readonly<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { adminPort, defineAdminModule } from '@jini-ai/
|
|
1
|
+
import { adminPort, defineAdminModule } from '@jini-ai/core/contracts/admin-module';
|
|
2
2
|
import { rolesMessagesEn } from './messages.en.js';
|
|
3
3
|
export const rolesApiToken = adminPort({ id: 'jini.identity.rolesApi' });
|
|
4
4
|
/** Roles and policies show no cross-reference columns, so separating them loses no context.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { UsersApiPort, UsersSafetyPort } from './ports.js';
|
|
2
|
-
export declare const usersApiToken: import("@jini-ai/
|
|
3
|
-
export declare const usersSafetyToken: import("@jini-ai/
|
|
2
|
+
export declare const usersApiToken: import("@jini-ai/core/contracts/admin-module").AdminPortToken<UsersApiPort, "jini.identity.usersApi">;
|
|
3
|
+
export declare const usersSafetyToken: import("@jini-ai/core/contracts/admin-module").AdminPortToken<UsersSafetyPort, "jini.identity.usersSafety">;
|
|
4
4
|
/** Reads remain server-authorized; grants gate mutation affordances, denied by default.
|
|
5
5
|
* Login is mounted by the signed-out host, before the authenticated shell. */
|
|
6
6
|
export declare const usersModule: {
|
|
7
7
|
readonly id: "users";
|
|
8
8
|
readonly requires: {
|
|
9
|
-
readonly usersApi: import("@jini-ai/
|
|
10
|
-
readonly usersSafety: import("@jini-ai/
|
|
9
|
+
readonly usersApi: import("@jini-ai/core/contracts/admin-module").AdminPortToken<UsersApiPort, "jini.identity.usersApi">;
|
|
10
|
+
readonly usersSafety: import("@jini-ai/core/contracts/admin-module").AdminPortToken<UsersSafetyPort, "jini.identity.usersSafety">;
|
|
11
11
|
};
|
|
12
12
|
readonly provides: {};
|
|
13
13
|
readonly messages: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { adminPort, defineAdminModule } from '@jini-ai/
|
|
1
|
+
import { adminPort, defineAdminModule } from '@jini-ai/core/contracts/admin-module';
|
|
2
2
|
import { usersMessagesEn } from './messages.en.js';
|
|
3
3
|
export const usersApiToken = adminPort({ id: 'jini.identity.usersApi' });
|
|
4
4
|
export const usersSafetyToken = adminPort({ id: 'jini.identity.usersSafety' });
|
package/dist/react/auth/Login.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
-
import { SecretInput } from "
|
|
3
|
+
import { SecretInput } from "../kit.js";
|
|
4
4
|
import { useLogin } from "./hooks/use-login.hooks.js";
|
|
5
5
|
export function Login({ onLogin, port, translate, productName, initialUsername, useLoginHook = useLogin }) {
|
|
6
6
|
const { username, setUsername, password, setPassword, error, busy, submit, mfa } = useLoginHook({ onLogin, port, translate }, { initialUsername });
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type Dispatch, type FormEvent, type SetStateAction } from 'react';
|
|
2
|
+
import type { UserFacingError } from '@jini-ai/core';
|
|
3
|
+
import type { Translate } from '@jini-ai/core/text';
|
|
4
|
+
export interface OwnerRecoveryPorts {
|
|
5
|
+
recover(required: {
|
|
6
|
+
code: string;
|
|
7
|
+
password: string;
|
|
8
|
+
}, optional?: Record<string, never>): Promise<unknown>;
|
|
9
|
+
issue(required: {
|
|
10
|
+
password: string;
|
|
11
|
+
code?: string;
|
|
12
|
+
}, optional?: Record<string, never>): Promise<{
|
|
13
|
+
codes: string[];
|
|
14
|
+
}>;
|
|
15
|
+
reset(required: {
|
|
16
|
+
password: string;
|
|
17
|
+
}, optional?: Record<string, never>): Promise<unknown>;
|
|
18
|
+
}
|
|
19
|
+
/** Host-resolved messages displayed without further translation. */
|
|
20
|
+
export interface OwnerRecoveryCopy {
|
|
21
|
+
readonly mismatch: string;
|
|
22
|
+
readonly recovered: string;
|
|
23
|
+
readonly reset: string;
|
|
24
|
+
}
|
|
25
|
+
export type DescribeRecoveryFailure = (required: {
|
|
26
|
+
error: unknown;
|
|
27
|
+
scope: 'recover' | 'issue' | 'reset';
|
|
28
|
+
}, optional?: Record<string, never>) => UserFacingError;
|
|
29
|
+
type Setter<T> = Dispatch<SetStateAction<T>>;
|
|
30
|
+
export interface RecoveryCodeSignInController {
|
|
31
|
+
code: string;
|
|
32
|
+
setCode: Setter<string>;
|
|
33
|
+
password: string;
|
|
34
|
+
setPassword: Setter<string>;
|
|
35
|
+
confirmation: string;
|
|
36
|
+
setConfirmation: Setter<string>;
|
|
37
|
+
failure: UserFacingError | null;
|
|
38
|
+
busy: boolean;
|
|
39
|
+
message: string;
|
|
40
|
+
submit(event: FormEvent): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
export interface RecoveryKitController {
|
|
43
|
+
password: string;
|
|
44
|
+
setPassword: Setter<string>;
|
|
45
|
+
code: string;
|
|
46
|
+
setCode: Setter<string>;
|
|
47
|
+
codes: string[];
|
|
48
|
+
setCodes: Setter<string[]>;
|
|
49
|
+
busy: boolean;
|
|
50
|
+
error: UserFacingError | null;
|
|
51
|
+
submit(event: FormEvent): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
export interface OwnerPasswordResetController {
|
|
54
|
+
password: string;
|
|
55
|
+
setPassword: Setter<string>;
|
|
56
|
+
confirmation: string;
|
|
57
|
+
setConfirmation: Setter<string>;
|
|
58
|
+
busy: boolean;
|
|
59
|
+
message: string;
|
|
60
|
+
failure: UserFacingError | null;
|
|
61
|
+
submit(event: FormEvent): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
/** Reset the owner password with a one-use recovery code. */
|
|
64
|
+
export declare function useRecoveryCodeSignIn(required: {
|
|
65
|
+
recover: OwnerRecoveryPorts['recover'];
|
|
66
|
+
describeFailure: DescribeRecoveryFailure;
|
|
67
|
+
t: Translate;
|
|
68
|
+
copy: OwnerRecoveryCopy;
|
|
69
|
+
}, _optional?: Record<string, never>): RecoveryCodeSignInController;
|
|
70
|
+
/** Issue a fresh recovery kit after password proof. */
|
|
71
|
+
export declare function useRecoveryKit(required: {
|
|
72
|
+
issue: OwnerRecoveryPorts['issue'];
|
|
73
|
+
describeFailure: DescribeRecoveryFailure;
|
|
74
|
+
}, _optional?: Record<string, never>): RecoveryKitController;
|
|
75
|
+
/** Save the displayed codes through the host before clearing them from the view. */
|
|
76
|
+
export declare function createRecoveryKitDownload(required: {
|
|
77
|
+
codes: readonly string[];
|
|
78
|
+
dismiss: () => void;
|
|
79
|
+
saveTextFile: (required: {
|
|
80
|
+
text: string;
|
|
81
|
+
filename: string;
|
|
82
|
+
}, optional?: Record<string, never>) => void;
|
|
83
|
+
filename: string;
|
|
84
|
+
}, _optional?: Record<string, never>): () => void;
|
|
85
|
+
/** Reset the owner's password using its restored owner session. */
|
|
86
|
+
export declare function useOwnerPasswordReset(required: {
|
|
87
|
+
reset: OwnerRecoveryPorts['reset'];
|
|
88
|
+
describeFailure: DescribeRecoveryFailure;
|
|
89
|
+
t: Translate;
|
|
90
|
+
copy: OwnerRecoveryCopy;
|
|
91
|
+
}, _optional?: Record<string, never>): OwnerPasswordResetController;
|
|
92
|
+
export {};
|
|
93
|
+
//# sourceMappingURL=OwnerRecovery.hooks.d.ts.map
|