@jini-ai/user-management 0.2.0
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 +77 -0
- package/LICENSE +201 -0
- package/README.md +104 -0
- package/dist/admin/adapters/http.d.ts +29 -0
- package/dist/admin/adapters/http.js +69 -0
- package/dist/admin/adapters/memory.d.ts +61 -0
- package/dist/admin/adapters/memory.js +217 -0
- package/dist/admin/auth.module.d.ts +30 -0
- package/dist/admin/auth.module.js +12 -0
- package/dist/admin/conformance/index.d.ts +56 -0
- package/dist/admin/conformance/index.js +156 -0
- package/dist/admin/controllers/auth.controller.d.ts +23 -0
- package/dist/admin/controllers/auth.controller.js +33 -0
- package/dist/admin/controllers/controller-store.d.ts +18 -0
- package/dist/admin/controllers/controller-store.js +23 -0
- package/dist/admin/controllers/members.controller.d.ts +33 -0
- package/dist/admin/controllers/members.controller.js +119 -0
- package/dist/admin/controllers/roles.controller.d.ts +47 -0
- package/dist/admin/controllers/roles.controller.js +282 -0
- package/dist/admin/controllers/users.controller.d.ts +53 -0
- package/dist/admin/controllers/users.controller.js +220 -0
- package/dist/admin/index.d.ts +21 -0
- package/dist/admin/index.js +15 -0
- package/dist/admin/members.module.d.ts +34 -0
- package/dist/admin/members.module.js +13 -0
- package/dist/admin/messages.en.d.ts +37 -0
- package/dist/admin/messages.en.js +21 -0
- package/dist/admin/models.d.ts +133 -0
- package/dist/admin/models.js +2 -0
- package/dist/admin/people.rules.d.ts +29 -0
- package/dist/admin/people.rules.js +51 -0
- package/dist/admin/ports.d.ts +187 -0
- package/dist/admin/ports.js +17 -0
- package/dist/admin/react/components/DestructiveDialog.d.ts +5 -0
- package/dist/admin/react/components/DestructiveDialog.js +6 -0
- package/dist/admin/react/components/MemberRow.d.ts +5 -0
- package/dist/admin/react/components/MemberRow.js +8 -0
- package/dist/admin/react/components/MembersConfirmation.d.ts +2 -0
- package/dist/admin/react/components/MembersConfirmation.js +8 -0
- package/dist/admin/react/components/PermissionPanel.d.ts +5 -0
- package/dist/admin/react/components/PermissionPanel.js +9 -0
- package/dist/admin/react/components/PolicyRow.d.ts +5 -0
- package/dist/admin/react/components/PolicyRow.js +11 -0
- package/dist/admin/react/components/RoleRow.d.ts +5 -0
- package/dist/admin/react/components/RoleRow.js +10 -0
- package/dist/admin/react/components/UserRow.d.ts +5 -0
- package/dist/admin/react/components/UserRow.js +8 -0
- package/dist/admin/react/components/UsersConfirmation.d.ts +3 -0
- package/dist/admin/react/components/UsersConfirmation.js +9 -0
- package/dist/admin/react/hooks/AuthBinding.hooks.d.ts +39 -0
- package/dist/admin/react/hooks/AuthBinding.hooks.js +21 -0
- package/dist/admin/react/hooks/LoginPage.hooks.d.ts +54 -0
- package/dist/admin/react/hooks/LoginPage.hooks.js +23 -0
- package/dist/admin/react/hooks/MembersBinding.hooks.d.ts +35 -0
- package/dist/admin/react/hooks/MembersBinding.hooks.js +21 -0
- package/dist/admin/react/hooks/MembersPage.hooks.d.ts +99 -0
- package/dist/admin/react/hooks/MembersPage.hooks.js +38 -0
- package/dist/admin/react/hooks/PeopleController.hooks.d.ts +18 -0
- package/dist/admin/react/hooks/PeopleController.hooks.js +20 -0
- package/dist/admin/react/hooks/PermissionPanel.hooks.d.ts +30 -0
- package/dist/admin/react/hooks/PermissionPanel.hooks.js +15 -0
- package/dist/admin/react/hooks/PoliciesTab.hooks.d.ts +47 -0
- package/dist/admin/react/hooks/PoliciesTab.hooks.js +26 -0
- package/dist/admin/react/hooks/RolesBinding.hooks.d.ts +39 -0
- package/dist/admin/react/hooks/RolesBinding.hooks.js +23 -0
- package/dist/admin/react/hooks/RolesController.hooks.d.ts +43 -0
- package/dist/admin/react/hooks/RolesController.hooks.js +25 -0
- package/dist/admin/react/hooks/RolesPage.hooks.d.ts +105 -0
- package/dist/admin/react/hooks/RolesPage.hooks.js +33 -0
- package/dist/admin/react/hooks/RolesTab.hooks.d.ts +35 -0
- package/dist/admin/react/hooks/RolesTab.hooks.js +19 -0
- package/dist/admin/react/hooks/UsersBinding.hooks.d.ts +36 -0
- package/dist/admin/react/hooks/UsersBinding.hooks.js +21 -0
- package/dist/admin/react/hooks/UsersPage.hooks.d.ts +106 -0
- package/dist/admin/react/hooks/UsersPage.hooks.js +22 -0
- package/dist/admin/react/hooks/UsersTab.hooks.d.ts +101 -0
- package/dist/admin/react/hooks/UsersTab.hooks.js +53 -0
- package/dist/admin/react/index.d.ts +203 -0
- package/dist/admin/react/index.js +32 -0
- package/dist/admin/react/pages/LoginPage.d.ts +3 -0
- package/dist/admin/react/pages/LoginPage.js +13 -0
- package/dist/admin/react/pages/MembersPage.d.ts +3 -0
- package/dist/admin/react/pages/MembersPage.js +19 -0
- package/dist/admin/react/pages/RolesPage.d.ts +3 -0
- package/dist/admin/react/pages/RolesPage.js +19 -0
- package/dist/admin/react/pages/UsersPage.d.ts +3 -0
- package/dist/admin/react/pages/UsersPage.js +19 -0
- package/dist/admin/react/tabs/AuthTab.d.ts +4 -0
- package/dist/admin/react/tabs/AuthTab.js +8 -0
- package/dist/admin/react/tabs/MembersTab.d.ts +4 -0
- package/dist/admin/react/tabs/MembersTab.js +9 -0
- package/dist/admin/react/tabs/PoliciesTab.d.ts +4 -0
- package/dist/admin/react/tabs/PoliciesTab.js +9 -0
- package/dist/admin/react/tabs/RolesTab.d.ts +4 -0
- package/dist/admin/react/tabs/RolesTab.js +9 -0
- package/dist/admin/react/tabs/UsersTab.d.ts +4 -0
- package/dist/admin/react/tabs/UsersTab.js +9 -0
- package/dist/admin/roles.module.d.ts +48 -0
- package/dist/admin/roles.module.js +15 -0
- package/dist/admin/rules.d.ts +32 -0
- package/dist/admin/rules.js +32 -0
- package/dist/admin/users.module.d.ts +39 -0
- package/dist/admin/users.module.js +14 -0
- package/dist/core/builtin-permissions.d.ts +10 -0
- package/dist/core/builtin-permissions.js +402 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +9 -0
- package/dist/core/permissions.d.ts +40 -0
- package/dist/core/permissions.js +52 -0
- package/dist/core/ports.d.ts +237 -0
- package/dist/core/ports.js +2 -0
- package/dist/core/runtime-ports.d.ts +8 -0
- package/dist/core/runtime-ports.js +2 -0
- package/dist/core/types.d.ts +224 -0
- package/dist/core/types.js +93 -0
- package/dist/react/auth/Login.d.ts +9 -0
- package/dist/react/auth/Login.js +8 -0
- package/dist/react/auth/hooks/use-login.hooks.d.ts +22 -0
- package/dist/react/auth/hooks/use-login.hooks.js +24 -0
- package/dist/react/errors.d.ts +10 -0
- package/dist/react/errors.js +13 -0
- package/dist/react/index.d.ts +18 -0
- package/dist/react/index.js +9 -0
- package/dist/react/members/Members.d.ts +6 -0
- package/dist/react/members/Members.js +38 -0
- package/dist/react/members/hooks/use-members.hooks.d.ts +32 -0
- package/dist/react/members/hooks/use-members.hooks.js +120 -0
- package/dist/react/members/rules.d.ts +26 -0
- package/dist/react/members/rules.js +35 -0
- package/dist/react/models.d.ts +50 -0
- package/dist/react/models.js +2 -0
- package/dist/react/ports.d.ts +157 -0
- package/dist/react/ports.js +2 -0
- package/dist/react/roles/Roles.d.ts +100 -0
- package/dist/react/roles/Roles.hooks.d.ts +17 -0
- package/dist/react/roles/Roles.hooks.js +40 -0
- package/dist/react/roles/Roles.js +150 -0
- package/dist/react/roles/hooks/use-roles.hooks.d.ts +80 -0
- package/dist/react/roles/hooks/use-roles.hooks.js +303 -0
- package/dist/react/roles/rules.d.ts +35 -0
- package/dist/react/roles/rules.js +31 -0
- package/dist/react/roles/text.d.ts +27 -0
- package/dist/react/roles/text.js +13 -0
- package/dist/react/testing.d.ts +51 -0
- package/dist/react/testing.js +275 -0
- package/dist/react/users/Users.d.ts +72 -0
- package/dist/react/users/Users.js +129 -0
- package/dist/react/users/hooks/use-reset-password-fields.hooks.d.ts +16 -0
- package/dist/react/users/hooks/use-reset-password-fields.hooks.js +21 -0
- package/dist/react/users/hooks/use-users.hooks.d.ts +77 -0
- package/dist/react/users/hooks/use-users.hooks.js +286 -0
- package/dist/react/users/rules.d.ts +33 -0
- package/dist/react/users/rules.js +61 -0
- package/dist/server/admin-crud-service.d.ts +295 -0
- package/dist/server/admin-crud-service.js +561 -0
- package/dist/server/agent-tool-input.d.ts +58 -0
- package/dist/server/agent-tool-input.js +158 -0
- package/dist/server/agent-tool-registrations.d.ts +51 -0
- package/dist/server/agent-tool-registrations.js +417 -0
- package/dist/server/agent-tools.d.ts +88 -0
- package/dist/server/agent-tools.js +229 -0
- package/dist/server/auth-service.d.ts +107 -0
- package/dist/server/auth-service.js +170 -0
- package/dist/server/authorize.d.ts +92 -0
- package/dist/server/authorize.js +96 -0
- package/dist/server/grant-service.d.ts +219 -0
- package/dist/server/grant-service.js +419 -0
- package/dist/server/hasher.d.ts +64 -0
- package/dist/server/hasher.js +53 -0
- package/dist/server/identity-transaction.d.ts +9 -0
- package/dist/server/identity-transaction.js +8 -0
- package/dist/server/index.d.ts +18 -0
- package/dist/server/index.js +20 -0
- package/dist/server/messages.d.ts +7 -0
- package/dist/server/messages.js +5 -0
- package/dist/server/password-policy.d.ts +59 -0
- package/dist/server/password-policy.js +66 -0
- package/dist/server/permission-migrations.d.ts +84 -0
- package/dist/server/permission-migrations.js +77 -0
- package/dist/server/repo.memory-transactions.d.ts +16 -0
- package/dist/server/repo.memory-transactions.js +79 -0
- package/dist/server/repo.memory.d.ts +186 -0
- package/dist/server/repo.memory.js +230 -0
- package/dist/server/seed.d.ts +56 -0
- package/dist/server/seed.js +435 -0
- package/dist/server/session-tokens.d.ts +10 -0
- package/dist/server/session-tokens.js +12 -0
- package/dist/server/username.d.ts +14 -0
- package/dist/server/username.js +14 -0
- package/package.json +144 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { UsersController } from '../../controllers/users.controller.js';
|
|
2
|
+
import type { UsersState } from '../../models.js';
|
|
3
|
+
import type { UsersPageProps } from './UsersBinding.hooks.js';
|
|
4
|
+
export interface UsersView {
|
|
5
|
+
controller: UsersController;
|
|
6
|
+
state: UsersState;
|
|
7
|
+
permissions: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
export declare const UsersViewContext: import("react").Context<UsersView | null>;
|
|
10
|
+
export declare function useUsersView(_required?: Record<string, never>, _optional?: Record<string, never>): UsersView;
|
|
11
|
+
export declare function useUsersPage(props: UsersPageProps, _optional?: Record<string, never>): {
|
|
12
|
+
content: import("react").FunctionComponentElement<{
|
|
13
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
14
|
+
} | ({
|
|
15
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
16
|
+
} & import("react").RefAttributes<import("react").Component<{
|
|
17
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
18
|
+
}, any, any>>)> | null;
|
|
19
|
+
controller: {
|
|
20
|
+
getSnapshot: (_required?: Record<string, never>, _optional?: Record<string, never>) => Readonly<UsersState>;
|
|
21
|
+
subscribe: ({ listener }: {
|
|
22
|
+
listener: () => void;
|
|
23
|
+
}, _optional?: Record<string, never>) => () => void;
|
|
24
|
+
allowed: ({ principalId, action }: {
|
|
25
|
+
principalId: string;
|
|
26
|
+
action: import("../../models.js").UserAction;
|
|
27
|
+
}, _optional?: Record<string, never>) => boolean;
|
|
28
|
+
load: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<void>;
|
|
29
|
+
loadCaller: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<void>;
|
|
30
|
+
createUser: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<boolean>;
|
|
31
|
+
toggleExpanded: ({ principalId }: {
|
|
32
|
+
principalId: string;
|
|
33
|
+
}, _optional?: Record<string, never>) => void;
|
|
34
|
+
savePanel: ({ principalId, kind }: {
|
|
35
|
+
principalId: string;
|
|
36
|
+
kind: "email" | "role" | "policy";
|
|
37
|
+
}, _optional?: Record<string, never>) => Promise<boolean>;
|
|
38
|
+
enableUser: ({ principalId }: {
|
|
39
|
+
principalId: string;
|
|
40
|
+
}, _optional?: Record<string, never>) => Promise<boolean>;
|
|
41
|
+
requestDestructive: ({ principalId, kind }: {
|
|
42
|
+
principalId: string;
|
|
43
|
+
kind: "disable" | "delete" | "reset";
|
|
44
|
+
}, _optional?: Record<string, never>) => void;
|
|
45
|
+
confirmDestructive: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<boolean>;
|
|
46
|
+
cancelDestructive(_required: Record<string, never>, _optional?: Record<string, never>): void;
|
|
47
|
+
setFormOpen({ open }: {
|
|
48
|
+
open: boolean;
|
|
49
|
+
}, _optional?: Record<string, never>): void;
|
|
50
|
+
setDraft({ patch }: {
|
|
51
|
+
patch: Partial<import("../../models.js").UsersDraft>;
|
|
52
|
+
}, _optional?: Record<string, never>): void;
|
|
53
|
+
togglePasswordVisible({ field }: {
|
|
54
|
+
field: "new" | "confirm";
|
|
55
|
+
}, _optional?: Record<string, never>): void;
|
|
56
|
+
dispose(_required?: Record<string, never>, _optional?: Record<string, never>): void;
|
|
57
|
+
} | null;
|
|
58
|
+
state: UsersState | null;
|
|
59
|
+
visible: boolean;
|
|
60
|
+
view: {
|
|
61
|
+
controller: {
|
|
62
|
+
getSnapshot: (_required?: Record<string, never>, _optional?: Record<string, never>) => Readonly<UsersState>;
|
|
63
|
+
subscribe: ({ listener }: {
|
|
64
|
+
listener: () => void;
|
|
65
|
+
}, _optional?: Record<string, never>) => () => void;
|
|
66
|
+
allowed: ({ principalId, action }: {
|
|
67
|
+
principalId: string;
|
|
68
|
+
action: import("../../models.js").UserAction;
|
|
69
|
+
}, _optional?: Record<string, never>) => boolean;
|
|
70
|
+
load: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<void>;
|
|
71
|
+
loadCaller: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<void>;
|
|
72
|
+
createUser: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<boolean>;
|
|
73
|
+
toggleExpanded: ({ principalId }: {
|
|
74
|
+
principalId: string;
|
|
75
|
+
}, _optional?: Record<string, never>) => void;
|
|
76
|
+
savePanel: ({ principalId, kind }: {
|
|
77
|
+
principalId: string;
|
|
78
|
+
kind: "email" | "role" | "policy";
|
|
79
|
+
}, _optional?: Record<string, never>) => Promise<boolean>;
|
|
80
|
+
enableUser: ({ principalId }: {
|
|
81
|
+
principalId: string;
|
|
82
|
+
}, _optional?: Record<string, never>) => Promise<boolean>;
|
|
83
|
+
requestDestructive: ({ principalId, kind }: {
|
|
84
|
+
principalId: string;
|
|
85
|
+
kind: "disable" | "delete" | "reset";
|
|
86
|
+
}, _optional?: Record<string, never>) => void;
|
|
87
|
+
confirmDestructive: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<boolean>;
|
|
88
|
+
cancelDestructive(_required: Record<string, never>, _optional?: Record<string, never>): void;
|
|
89
|
+
setFormOpen({ open }: {
|
|
90
|
+
open: boolean;
|
|
91
|
+
}, _optional?: Record<string, never>): void;
|
|
92
|
+
setDraft({ patch }: {
|
|
93
|
+
patch: Partial<import("../../models.js").UsersDraft>;
|
|
94
|
+
}, _optional?: Record<string, never>): void;
|
|
95
|
+
togglePasswordVisible({ field }: {
|
|
96
|
+
field: "new" | "confirm";
|
|
97
|
+
}, _optional?: Record<string, never>): void;
|
|
98
|
+
dispose(_required?: Record<string, never>, _optional?: Record<string, never>): void;
|
|
99
|
+
};
|
|
100
|
+
state: UsersState;
|
|
101
|
+
permissions: readonly string[];
|
|
102
|
+
} | null;
|
|
103
|
+
readOnly: boolean;
|
|
104
|
+
retry: () => void;
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=UsersPage.hooks.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createElement, createContext, useContext, useMemo } from 'react';
|
|
2
|
+
import { createUsersController } from '../../controllers/users.controller.js';
|
|
3
|
+
import { hasAdminGrant } from '../../people.rules.js';
|
|
4
|
+
import { useUsersScope } from './UsersBinding.hooks.js';
|
|
5
|
+
import { usePeopleController } from './PeopleController.hooks.js';
|
|
6
|
+
export const UsersViewContext = createContext(null);
|
|
7
|
+
export function useUsersView(_required = {}, _optional = {}) { const v = useContext(UsersViewContext); if (!v)
|
|
8
|
+
throw new Error('Users controller unavailable.'); return v; }
|
|
9
|
+
export function useUsersPage(props, _optional = {}) {
|
|
10
|
+
const { api, safety, permissions } = useUsersScope({});
|
|
11
|
+
const scope = useMemo(() => ({ api, safety, closed: props.onOwnPasswordResetClosed }), [api, safety, props.onOwnPasswordResetClosed]);
|
|
12
|
+
const key = JSON.stringify([permissions, props.openOwnPasswordReset]);
|
|
13
|
+
const { controller, state } = usePeopleController({ scope, key,
|
|
14
|
+
create: () => createUsersController({ api, safety }, { permissions, ...(props.openOwnPasswordReset !== undefined ? { openOwnPasswordReset: props.openOwnPasswordReset } : {}), ...(props.onOwnPasswordResetClosed ? { onOwnPasswordResetClosed: props.onOwnPasswordResetClosed } : {}) }),
|
|
15
|
+
start: c => { void c.load({}); void c.loadCaller({}); },
|
|
16
|
+
});
|
|
17
|
+
const visible = props.description.visible && props.description.tabs.some(t => t.visible);
|
|
18
|
+
return { content: props.tabs.users ? createElement(props.tabs.users, {}) : null, controller, state, visible, view: controller && state ? { controller, state, permissions } : null,
|
|
19
|
+
readOnly: !hasAdminGrant({ permissions, permission: 'user.manage' }) && !hasAdminGrant({ permissions, permission: 'role.manage' }),
|
|
20
|
+
retry: () => { void controller?.load({}); } };
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=UsersPage.hooks.js.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { FormEvent } from 'react';
|
|
2
|
+
import type { AdminOperator } from '../../models.js';
|
|
3
|
+
import type { MenuItem } from '@jini-ai/ui-kit/react';
|
|
4
|
+
/** Semantic autocomplete must survive a reveal to type=text and host facade overrides. */
|
|
5
|
+
export declare const newPasswordAttrs: {
|
|
6
|
+
autoComplete: string;
|
|
7
|
+
'data-jini-part': string;
|
|
8
|
+
};
|
|
9
|
+
export declare function useUsersTab(_required?: Record<string, never>, _optional?: Record<string, never>): {
|
|
10
|
+
s: import("../../models.js").UsersState;
|
|
11
|
+
canCreate: boolean;
|
|
12
|
+
toggleForm: () => void;
|
|
13
|
+
cancelForm: () => void;
|
|
14
|
+
username: ({ value }: {
|
|
15
|
+
value: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
email: ({ value }: {
|
|
18
|
+
value: string;
|
|
19
|
+
}) => void;
|
|
20
|
+
password: ({ value }: {
|
|
21
|
+
value: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
submit: (e: FormEvent) => void;
|
|
24
|
+
};
|
|
25
|
+
export declare function useUserRow({ user }: {
|
|
26
|
+
user: AdminOperator;
|
|
27
|
+
}, _optional?: Record<string, never>): {
|
|
28
|
+
s: import("../../models.js").UsersState;
|
|
29
|
+
items: MenuItem[];
|
|
30
|
+
canEmail: boolean;
|
|
31
|
+
canGrants: boolean;
|
|
32
|
+
expanded: boolean;
|
|
33
|
+
canExpand: boolean;
|
|
34
|
+
roles: string;
|
|
35
|
+
policies: string;
|
|
36
|
+
toggle: () => void;
|
|
37
|
+
menuLabel: string;
|
|
38
|
+
email: ({ value }: {
|
|
39
|
+
value: string;
|
|
40
|
+
}) => void;
|
|
41
|
+
role: ({ value }: {
|
|
42
|
+
value: string;
|
|
43
|
+
}) => void;
|
|
44
|
+
policy: ({ value }: {
|
|
45
|
+
value: string;
|
|
46
|
+
}) => void;
|
|
47
|
+
saveEmail: () => void;
|
|
48
|
+
assignRole: () => void;
|
|
49
|
+
attachPolicy: () => void;
|
|
50
|
+
roleOptions: {
|
|
51
|
+
value: string;
|
|
52
|
+
label: string;
|
|
53
|
+
}[];
|
|
54
|
+
policyOptions: {
|
|
55
|
+
value: string;
|
|
56
|
+
label: string;
|
|
57
|
+
}[];
|
|
58
|
+
};
|
|
59
|
+
export declare function useUsersConfirmation(_required?: Record<string, never>, _optional?: Record<string, never>): {
|
|
60
|
+
s: import("../../models.js").UsersState;
|
|
61
|
+
reset: boolean;
|
|
62
|
+
mismatch: boolean;
|
|
63
|
+
error: string | null;
|
|
64
|
+
copy: {
|
|
65
|
+
title: string;
|
|
66
|
+
label: string;
|
|
67
|
+
tone: "danger";
|
|
68
|
+
body: string;
|
|
69
|
+
consequence: string;
|
|
70
|
+
} | {
|
|
71
|
+
title: string;
|
|
72
|
+
label: string;
|
|
73
|
+
tone: "warning";
|
|
74
|
+
body: string;
|
|
75
|
+
consequence: string;
|
|
76
|
+
};
|
|
77
|
+
confirm: {
|
|
78
|
+
open: boolean;
|
|
79
|
+
title: string;
|
|
80
|
+
confirmLabel: string;
|
|
81
|
+
tone: "warning" | "danger";
|
|
82
|
+
consequence: string;
|
|
83
|
+
pending: boolean;
|
|
84
|
+
agentMayConfirm: boolean;
|
|
85
|
+
onConfirm: () => Promise<void>;
|
|
86
|
+
onCancel: () => void;
|
|
87
|
+
};
|
|
88
|
+
newPassword: ({ value }: {
|
|
89
|
+
value: string;
|
|
90
|
+
}) => void;
|
|
91
|
+
confirmPassword: ({ value }: {
|
|
92
|
+
value: string;
|
|
93
|
+
}) => void;
|
|
94
|
+
newType: "password" | "text";
|
|
95
|
+
confirmType: "password" | "text";
|
|
96
|
+
toggleNew: () => void;
|
|
97
|
+
toggleConfirm: () => void;
|
|
98
|
+
newLabel: string;
|
|
99
|
+
confirmLabel: string;
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=UsersTab.hooks.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useUsersView } from './UsersPage.hooks.js';
|
|
2
|
+
import { grantLabel, hasAdminGrant } from '../../people.rules.js';
|
|
3
|
+
/** Semantic autocomplete must survive a reveal to type=text and host facade overrides. */
|
|
4
|
+
export const newPasswordAttrs = { autoComplete: 'new-password', 'data-jini-part': 'new-password' };
|
|
5
|
+
export function useUsersTab(_required = {}, _optional = {}) {
|
|
6
|
+
const { controller: c, state: s, permissions } = useUsersView({});
|
|
7
|
+
return { s, canCreate: hasAdminGrant({ permissions, permission: 'user.manage' }),
|
|
8
|
+
toggleForm: () => c.setFormOpen({ open: !s.formOpen }), cancelForm: () => c.setFormOpen({ open: false }),
|
|
9
|
+
username: ({ value }) => c.setDraft({ patch: { username: value } }),
|
|
10
|
+
email: ({ value }) => c.setDraft({ patch: { email: value } }),
|
|
11
|
+
password: ({ value }) => c.setDraft({ patch: { password: value } }),
|
|
12
|
+
submit: (e) => { e.preventDefault(); void c.createUser({}); },
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function useUserRow({ user }, _optional = {}) {
|
|
16
|
+
const { controller: c, state: s } = useUsersView({});
|
|
17
|
+
const id = user.principalId, canEmail = c.allowed({ principalId: id, action: 'email' }), canGrants = c.allowed({ principalId: id, action: 'grants' });
|
|
18
|
+
const items = [];
|
|
19
|
+
if (canEmail || canGrants)
|
|
20
|
+
items.push({ id: 'manage', label: 'Manage', onPress: () => c.toggleExpanded({ principalId: id }) });
|
|
21
|
+
if (c.allowed({ principalId: id, action: 'disable' }))
|
|
22
|
+
items.push({ id: 'disable', label: 'Disable', onPress: () => c.requestDestructive({ principalId: id, kind: 'disable' }) });
|
|
23
|
+
if (c.allowed({ principalId: id, action: 'enable' }))
|
|
24
|
+
items.push({ id: 'enable', label: 'Enable', onPress: () => { void c.enableUser({ principalId: id }); } });
|
|
25
|
+
if (c.allowed({ principalId: id, action: 'reset' }))
|
|
26
|
+
items.push({ id: 'reset', label: 'Reset password', onPress: () => c.requestDestructive({ principalId: id, kind: 'reset' }) });
|
|
27
|
+
if (c.allowed({ principalId: id, action: 'delete' }))
|
|
28
|
+
items.push({ id: 'delete', label: 'Delete', onPress: () => c.requestDestructive({ principalId: id, kind: 'delete' }) });
|
|
29
|
+
return { s, items, canEmail, canGrants, expanded: s.expandedId === id, canExpand: canEmail || canGrants,
|
|
30
|
+
roles: grantLabel({ ids: user.roleIds, records: s.roles ?? [] }), policies: grantLabel({ ids: user.policyIds, records: s.policies ?? [] }),
|
|
31
|
+
toggle: () => c.toggleExpanded({ principalId: id }), menuLabel: `Actions for user "${user.username}"`,
|
|
32
|
+
email: ({ value }) => c.setDraft({ patch: { editEmail: value } }), role: ({ value }) => c.setDraft({ patch: { pendingRoleId: value } }), policy: ({ value }) => c.setDraft({ patch: { pendingPolicyId: value } }),
|
|
33
|
+
saveEmail: () => { void c.savePanel({ principalId: id, kind: 'email' }); }, assignRole: () => { void c.savePanel({ principalId: id, kind: 'role' }); }, attachPolicy: () => { void c.savePanel({ principalId: id, kind: 'policy' }); },
|
|
34
|
+
roleOptions: [{ value: '', label: 'Select a role…' }, ...(s.roles ?? []).map(r => ({ value: r.id, label: `${r.name}${r.isBuiltin ? ' (built-in)' : ''}` }))],
|
|
35
|
+
policyOptions: [{ value: '', label: 'Select a policy…' }, ...(s.policies ?? []).map(p => ({ value: p.id, label: `${p.name}${p.isBuiltin ? ' (built-in)' : ''}` }))], };
|
|
36
|
+
}
|
|
37
|
+
export function useUsersConfirmation(_required = {}, _optional = {}) {
|
|
38
|
+
const { state: s, controller: c } = useUsersView({});
|
|
39
|
+
const kind = s.pending?.kind, reset = kind === 'reset', mismatch = s.newPassword !== s.confirmPassword;
|
|
40
|
+
const copy = kind === 'delete' ? { title: 'Delete this user?', label: 'Move to trash', tone: 'danger',
|
|
41
|
+
body: 'They will be signed out and moved to the Trash. You can restore them there; they are deleted permanently after 60 days.', consequence: 'moves the user to the Trash' }
|
|
42
|
+
: reset ? { title: 'Reset password?', label: 'Reset password', tone: 'warning', body: 'Every active session for this user will be signed out.', consequence: 'revokes every active session' }
|
|
43
|
+
: { title: 'Disable this user?', label: 'Disable', tone: 'warning', body: 'They will not be able to sign in until re-enabled.', consequence: 'revokes sign-in access' };
|
|
44
|
+
return { s, reset, mismatch, error: mismatch ? 'Passwords do not match.' : s.passwordError, copy,
|
|
45
|
+
confirm: { open: s.pending !== null, title: copy.title, confirmLabel: copy.label, tone: copy.tone, consequence: copy.consequence, pending: s.confirming, agentMayConfirm: false,
|
|
46
|
+
onConfirm: async () => { await c.confirmDestructive({}); }, onCancel: () => c.cancelDestructive({}) },
|
|
47
|
+
newPassword: ({ value }) => c.setDraft({ patch: { newPassword: value } }),
|
|
48
|
+
confirmPassword: ({ value }) => c.setDraft({ patch: { confirmPassword: value } }),
|
|
49
|
+
newType: s.showNewPassword ? 'text' : 'password', confirmType: s.showConfirmPassword ? 'text' : 'password',
|
|
50
|
+
toggleNew: () => c.togglePasswordVisible({ field: 'new' }), toggleConfirm: () => c.togglePasswordVisible({ field: 'confirm' }),
|
|
51
|
+
newLabel: s.showNewPassword ? 'Hide new password' : 'Show new password', confirmLabel: s.showConfirmPassword ? 'Hide confirm password' : 'Show confirm password', };
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=UsersTab.hooks.js.map
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
export declare const rolesKitNeeds: import("@jini-ai/ui-kit").KitNeeds<"Notice" | "Spinner" | "Tabs" | "Badge" | "Menu" | "Button" | "TextField" | "ConfirmDialog">;
|
|
2
|
+
/** Optional composition surface. Identity services remain owned by user-management. */
|
|
3
|
+
export declare function roles(_required: Record<string, never>, _optional?: Record<string, never>): {
|
|
4
|
+
id: "roles";
|
|
5
|
+
requires: {
|
|
6
|
+
readonly rolesApi: import("@jini-ai/admin/core/module").AdminPortToken<import("../ports.js").RolesApiPort, "jini.identity.rolesApi">;
|
|
7
|
+
};
|
|
8
|
+
provides: {};
|
|
9
|
+
messages: Readonly<{
|
|
10
|
+
title: "Roles & Permissions";
|
|
11
|
+
roles: "Roles";
|
|
12
|
+
policies: "Policies";
|
|
13
|
+
people: "People";
|
|
14
|
+
description: "Define roles and policies here. Assign them to people in Users.";
|
|
15
|
+
loading: "Loading roles & permissions…";
|
|
16
|
+
readOnly: "Read-only: managing roles requires role.manage.";
|
|
17
|
+
forbidden: "You do not have permission to do that.";
|
|
18
|
+
conflict: "It is still in use — remove that assignment/attachment first.";
|
|
19
|
+
unknownPermission: "That permission is not recognized.";
|
|
20
|
+
exceedsIssuer: "You cannot grant a permission you do not hold.";
|
|
21
|
+
validation: "Please correct the highlighted fields.";
|
|
22
|
+
immutable: "Built-in roles and built-in or frozen policies cannot be changed.";
|
|
23
|
+
}>;
|
|
24
|
+
pages: {
|
|
25
|
+
readonly roles: {
|
|
26
|
+
readonly path: "/roles";
|
|
27
|
+
readonly label: "Roles & Permissions";
|
|
28
|
+
readonly permissions: readonly [];
|
|
29
|
+
readonly nav: {
|
|
30
|
+
readonly group: "people";
|
|
31
|
+
readonly icon: "users";
|
|
32
|
+
};
|
|
33
|
+
readonly tabs: {
|
|
34
|
+
readonly roles: {
|
|
35
|
+
readonly label: "Roles";
|
|
36
|
+
};
|
|
37
|
+
readonly policies: {
|
|
38
|
+
readonly label: "Policies";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
} & {
|
|
44
|
+
react: {
|
|
45
|
+
pages: {
|
|
46
|
+
roles: {
|
|
47
|
+
Page: import("react").LazyExoticComponent<typeof import("./pages/RolesPage.js").default>;
|
|
48
|
+
tabs: {
|
|
49
|
+
roles: import("react").LazyExoticComponent<typeof import("./tabs/RolesTab.js").default>;
|
|
50
|
+
policies: import("react").LazyExoticComponent<typeof import("./tabs/PoliciesTab.js").default>;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
Provider: ({ admin, children }: {
|
|
55
|
+
admin: import("@jini-ai/admin/core/module").AdminInstance;
|
|
56
|
+
children: import("react").ReactNode;
|
|
57
|
+
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("./hooks/RolesBinding.hooks.js").RolesScope | null>>;
|
|
58
|
+
};
|
|
59
|
+
kitNeeds: import("@jini-ai/ui-kit").KitNeeds<"Notice" | "Spinner" | "Tabs" | "Badge" | "Menu" | "Button" | "TextField" | "ConfirmDialog">;
|
|
60
|
+
};
|
|
61
|
+
export type { RolesPageProps, RolesTabProps } from './hooks/RolesBinding.hooks.js';
|
|
62
|
+
export declare const usersKitNeeds: import("@jini-ai/ui-kit").KitNeeds<"Notice" | "Spinner" | "Badge" | "Menu" | "Button" | "TextField" | "Select" | "ConfirmDialog">;
|
|
63
|
+
export declare const membersKitNeeds: import("@jini-ai/ui-kit").KitNeeds<"Notice" | "Spinner" | "Badge" | "Menu" | "Button" | "ConfirmDialog">;
|
|
64
|
+
export declare const authKitNeeds: import("@jini-ai/ui-kit").KitNeeds<"Notice" | "Spinner" | "Button" | "TextField">;
|
|
65
|
+
export declare function users(_required: Record<string, never>, _optional?: Record<string, never>): {
|
|
66
|
+
id: "users";
|
|
67
|
+
requires: {
|
|
68
|
+
readonly usersApi: import("@jini-ai/admin/core/module").AdminPortToken<import("../ports.js").UsersApiPort, "jini.identity.usersApi">;
|
|
69
|
+
readonly usersSafety: import("@jini-ai/admin/core/module").AdminPortToken<import("../ports.js").UsersSafetyPort, "jini.identity.usersSafety">;
|
|
70
|
+
};
|
|
71
|
+
provides: {};
|
|
72
|
+
messages: {
|
|
73
|
+
readonly title: "Users";
|
|
74
|
+
readonly description: "Operator accounts with access to this admin — assign roles and policies, or disable access.";
|
|
75
|
+
readonly loading: "Loading users…";
|
|
76
|
+
readonly readOnly: "Read-only — user administration is unavailable with your current grants.";
|
|
77
|
+
readonly passwordHelp: "No 'forgot password' email yet. If someone is locked out, the owner can reset their password here.";
|
|
78
|
+
readonly protected: "Only an owner can modify an owner. Unresolved owner status prevents changes.";
|
|
79
|
+
readonly forbidden: "You do not have permission to do that.";
|
|
80
|
+
};
|
|
81
|
+
pages: {
|
|
82
|
+
readonly users: {
|
|
83
|
+
readonly path: "/users";
|
|
84
|
+
readonly label: "Users";
|
|
85
|
+
readonly permissions: readonly [];
|
|
86
|
+
readonly nav: {
|
|
87
|
+
readonly group: "people";
|
|
88
|
+
readonly icon: "users";
|
|
89
|
+
};
|
|
90
|
+
readonly tabs: {
|
|
91
|
+
readonly users: {
|
|
92
|
+
readonly label: "Users";
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
} & {
|
|
98
|
+
react: {
|
|
99
|
+
pages: {
|
|
100
|
+
users: {
|
|
101
|
+
Page: import("react").LazyExoticComponent<typeof import("./pages/UsersPage.js").default>;
|
|
102
|
+
tabs: {
|
|
103
|
+
users: import("react").LazyExoticComponent<typeof import("./tabs/UsersTab.js").default>;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
Provider: ({ admin, children }: {
|
|
108
|
+
admin: import("@jini-ai/admin/core/module").AdminInstance;
|
|
109
|
+
children: import("react").ReactNode;
|
|
110
|
+
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("./hooks/UsersBinding.hooks.js").UsersScope | null>>;
|
|
111
|
+
};
|
|
112
|
+
kitNeeds: import("@jini-ai/ui-kit").KitNeeds<"Notice" | "Spinner" | "Badge" | "Menu" | "Button" | "TextField" | "Select" | "ConfirmDialog">;
|
|
113
|
+
};
|
|
114
|
+
export declare function members(_required: Record<string, never>, _optional?: Record<string, never>): {
|
|
115
|
+
id: "members";
|
|
116
|
+
requires: {
|
|
117
|
+
readonly membersApi: import("@jini-ai/admin/core/module").AdminPortToken<import("../ports.js").MembersApiPort, "jini.identity.membersApi">;
|
|
118
|
+
};
|
|
119
|
+
provides: {};
|
|
120
|
+
messages: {
|
|
121
|
+
readonly title: "Members";
|
|
122
|
+
readonly description: "People who have registered an account — review status, resend a sign-in link, or disable access.";
|
|
123
|
+
readonly loading: "Loading members…";
|
|
124
|
+
readonly readOnly: "Read-only — member actions require member.manage.";
|
|
125
|
+
};
|
|
126
|
+
pages: {
|
|
127
|
+
readonly members: {
|
|
128
|
+
readonly path: "/members";
|
|
129
|
+
readonly label: "Members";
|
|
130
|
+
readonly permissions: readonly [];
|
|
131
|
+
readonly nav: {
|
|
132
|
+
readonly group: "people";
|
|
133
|
+
readonly icon: "users";
|
|
134
|
+
};
|
|
135
|
+
readonly tabs: {
|
|
136
|
+
readonly members: {
|
|
137
|
+
readonly label: "Members";
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
} & {
|
|
143
|
+
react: {
|
|
144
|
+
pages: {
|
|
145
|
+
members: {
|
|
146
|
+
Page: import("react").LazyExoticComponent<typeof import("./pages/MembersPage.js").default>;
|
|
147
|
+
tabs: {
|
|
148
|
+
members: import("react").LazyExoticComponent<typeof import("./tabs/MembersTab.js").default>;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
Provider: ({ admin, children }: {
|
|
153
|
+
admin: import("@jini-ai/admin/core/module").AdminInstance;
|
|
154
|
+
children: import("react").ReactNode;
|
|
155
|
+
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("./hooks/MembersBinding.hooks.js").MembersScope | null>>;
|
|
156
|
+
};
|
|
157
|
+
kitNeeds: import("@jini-ai/ui-kit").KitNeeds<"Notice" | "Spinner" | "Badge" | "Menu" | "Button" | "ConfirmDialog">;
|
|
158
|
+
};
|
|
159
|
+
export declare function auth(_required: Record<string, never>, _optional?: Record<string, never>): {
|
|
160
|
+
id: "auth";
|
|
161
|
+
requires: {
|
|
162
|
+
readonly authApi: import("@jini-ai/admin/core/module").AdminPortToken<import("../ports.js").AuthApiPort, "jini.identity.authApi">;
|
|
163
|
+
};
|
|
164
|
+
provides: {};
|
|
165
|
+
messages: {
|
|
166
|
+
readonly title: "Sign in to your workspace";
|
|
167
|
+
readonly submit: "Sign in";
|
|
168
|
+
readonly busy: "Signing in…";
|
|
169
|
+
readonly failed: "login failed";
|
|
170
|
+
};
|
|
171
|
+
pages: {
|
|
172
|
+
readonly auth: {
|
|
173
|
+
readonly path: "/login";
|
|
174
|
+
readonly label: "Login";
|
|
175
|
+
readonly permissions: readonly [];
|
|
176
|
+
readonly tabs: {
|
|
177
|
+
readonly auth: {
|
|
178
|
+
readonly label: "Login";
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
} & {
|
|
184
|
+
react: {
|
|
185
|
+
pages: {
|
|
186
|
+
auth: {
|
|
187
|
+
Page: import("react").LazyExoticComponent<typeof import("./pages/LoginPage.js").default>;
|
|
188
|
+
tabs: {
|
|
189
|
+
auth: import("react").LazyExoticComponent<typeof import("./tabs/AuthTab.js").default>;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
Provider: ({ admin, children }: {
|
|
194
|
+
admin: import("@jini-ai/admin/core/module").AdminInstance;
|
|
195
|
+
children: import("react").ReactNode;
|
|
196
|
+
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("./hooks/AuthBinding.hooks.js").AuthScope | null>>;
|
|
197
|
+
};
|
|
198
|
+
kitNeeds: import("@jini-ai/ui-kit").KitNeeds<"Notice" | "Spinner" | "Button" | "TextField">;
|
|
199
|
+
};
|
|
200
|
+
export type { UsersPageProps } from './hooks/UsersBinding.hooks.js';
|
|
201
|
+
export type { MembersPageProps } from './hooks/MembersBinding.hooks.js';
|
|
202
|
+
export type { AuthPageProps } from './hooks/AuthBinding.hooks.js';
|
|
203
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { needs } from '@jini-ai/ui-kit';
|
|
2
|
+
import { rolesModule } from '../roles.module.js';
|
|
3
|
+
import { createRolesBinding } from './hooks/RolesBinding.hooks.js';
|
|
4
|
+
export const rolesKitNeeds = needs({ id: 'identity.roles', components: ['Button', 'TextField', 'Menu', 'Tabs', 'Notice', 'Spinner', 'Badge', 'ConfirmDialog'] });
|
|
5
|
+
/** Optional composition surface. Identity services remain owned by user-management. */
|
|
6
|
+
export function roles(_required, _optional = {}) {
|
|
7
|
+
const module = { ...rolesModule };
|
|
8
|
+
// createAdmin scopes by descriptor identity; bind the exact enriched object being composed.
|
|
9
|
+
return Object.assign(module, { react: createRolesBinding({ module }), kitNeeds: rolesKitNeeds });
|
|
10
|
+
}
|
|
11
|
+
import { usersModule } from '../users.module.js';
|
|
12
|
+
import { membersModule } from '../members.module.js';
|
|
13
|
+
import { authModule } from '../auth.module.js';
|
|
14
|
+
import { createUsersBinding } from './hooks/UsersBinding.hooks.js';
|
|
15
|
+
import { createMembersBinding } from './hooks/MembersBinding.hooks.js';
|
|
16
|
+
import { createAuthBinding } from './hooks/AuthBinding.hooks.js';
|
|
17
|
+
export const usersKitNeeds = needs({ id: 'identity.users', components: ['Button', 'TextField', 'Select', 'Menu', 'Notice', 'Spinner', 'Badge', 'ConfirmDialog'] });
|
|
18
|
+
export const membersKitNeeds = needs({ id: 'identity.members', components: ['Button', 'Menu', 'Notice', 'Spinner', 'Badge', 'ConfirmDialog'] });
|
|
19
|
+
export const authKitNeeds = needs({ id: 'identity.auth', components: ['Button', 'TextField', 'Notice', 'Spinner'] });
|
|
20
|
+
export function users(_required, _optional = {}) {
|
|
21
|
+
const module = { ...usersModule };
|
|
22
|
+
return Object.assign(module, { react: createUsersBinding({ module }), kitNeeds: usersKitNeeds });
|
|
23
|
+
}
|
|
24
|
+
export function members(_required, _optional = {}) {
|
|
25
|
+
const module = { ...membersModule };
|
|
26
|
+
return Object.assign(module, { react: createMembersBinding({ module }), kitNeeds: membersKitNeeds });
|
|
27
|
+
}
|
|
28
|
+
export function auth(_required, _optional = {}) {
|
|
29
|
+
const module = { ...authModule };
|
|
30
|
+
return Object.assign(module, { react: createAuthBinding({ module }), kitNeeds: authKitNeeds });
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
|
+
import { Notice, Spinner } from '@jini-ai/ui-kit/react';
|
|
4
|
+
import { AuthViewContext, useLoginPage } from '../hooks/LoginPage.hooks.js';
|
|
5
|
+
export default function LoginPage(props, _optional = {}) {
|
|
6
|
+
const v = useLoginPage(props);
|
|
7
|
+
if (!v.visible)
|
|
8
|
+
return _jsx(Notice, { children: "Login is unavailable." });
|
|
9
|
+
if (!v.view)
|
|
10
|
+
return _jsx(Spinner, { label: "Loading login\u2026" });
|
|
11
|
+
return _jsx(AuthViewContext.Provider, { value: v.view, children: _jsxs("div", { className: "login-screen", children: [_jsx("h1", { children: v.title }), _jsx(Suspense, { fallback: _jsx(Spinner, { label: "Loading login\u2026" }), children: v.content })] }) });
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=LoginPage.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
|
+
import { Notice, Spinner, Button } from '@jini-ai/ui-kit/react';
|
|
4
|
+
import { MembersViewContext, useMembersPage } from '../hooks/MembersPage.hooks.js';
|
|
5
|
+
import { membersMessagesEn as m } from '../../messages.en.js';
|
|
6
|
+
import { MembersConfirmation } from '../components/MembersConfirmation.js';
|
|
7
|
+
export default function MembersPage(props, _optional = {}) {
|
|
8
|
+
const v = useMembersPage(props);
|
|
9
|
+
if (!v.visible)
|
|
10
|
+
return _jsx(Notice, { children: "Members administration is unavailable." });
|
|
11
|
+
if (!v.state)
|
|
12
|
+
return _jsx(Spinner, { label: m.loading });
|
|
13
|
+
if (v.state.error)
|
|
14
|
+
return _jsxs(Notice, { tone: "danger", children: [v.state.error, _jsx(Button, { onPress: v.retry, children: "Retry" })] });
|
|
15
|
+
if (!v.view || !v.state.members)
|
|
16
|
+
return _jsx(Spinner, { label: m.loading });
|
|
17
|
+
return _jsx(MembersViewContext.Provider, { value: v.view, children: _jsxs("div", { className: "page", children: [_jsxs("header", { children: [_jsx("p", { children: "People" }), _jsx("h1", { children: m.title }), _jsx("p", { children: m.description })] }), !v.canManage ? _jsx(Notice, { children: m.readOnly }) : null, _jsx(Suspense, { fallback: _jsx(Spinner, { label: m.loading }), children: v.content }), _jsx(MembersConfirmation, {})] }) });
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=MembersPage.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
|
+
import { Button, Notice, Spinner, Tabs } from '@jini-ai/ui-kit/react';
|
|
4
|
+
import { RolesViewContext, useRolesPage } from '../hooks/RolesPage.hooks.js';
|
|
5
|
+
import { DestructiveDialog } from '../components/DestructiveDialog.js';
|
|
6
|
+
import { rolesMessagesEn as m } from '../../messages.en.js';
|
|
7
|
+
export default function RolesPage(props, _optional = {}) {
|
|
8
|
+
const v = useRolesPage(props);
|
|
9
|
+
if (v.hidden)
|
|
10
|
+
return _jsx(Notice, { children: "Roles administration is unavailable." });
|
|
11
|
+
if (!v.state)
|
|
12
|
+
return _jsx(Spinner, { label: m.loading });
|
|
13
|
+
if (v.state.error)
|
|
14
|
+
return _jsxs(Notice, { tone: "danger", children: [v.state.error, _jsx(Button, { onPress: v.retry, children: "Retry" })] });
|
|
15
|
+
if (!v.view || !v.state.roles || !v.state.policies)
|
|
16
|
+
return _jsx(Spinner, { label: m.loading });
|
|
17
|
+
return _jsx(RolesViewContext.Provider, { value: v.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, v.state.rowError ? _jsx(Notice, { tone: "danger", children: v.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 })] }) });
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=RolesPage.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
|
+
import { Button, Notice, Spinner } from '@jini-ai/ui-kit/react';
|
|
4
|
+
import { useUsersPage, UsersViewContext } from '../hooks/UsersPage.hooks.js';
|
|
5
|
+
import { usersMessagesEn as m } from '../../messages.en.js';
|
|
6
|
+
import { UsersConfirmation } from '../components/UsersConfirmation.js';
|
|
7
|
+
export default function UsersPage(props, _optional = {}) {
|
|
8
|
+
const v = useUsersPage(props);
|
|
9
|
+
if (!v.visible)
|
|
10
|
+
return _jsx(Notice, { children: "Users administration is unavailable." });
|
|
11
|
+
if (!v.state)
|
|
12
|
+
return _jsx(Spinner, { label: m.loading });
|
|
13
|
+
if (v.state.error)
|
|
14
|
+
return _jsxs(Notice, { tone: "danger", children: [v.state.error, _jsx(Button, { onPress: v.retry, children: "Retry" })] });
|
|
15
|
+
if (!v.view || !v.state.users || !v.state.roles || !v.state.policies)
|
|
16
|
+
return _jsx(Spinner, { label: m.loading });
|
|
17
|
+
return _jsx(UsersViewContext.Provider, { value: v.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 }), v.state.rowError ? _jsx(Notice, { tone: "danger", children: v.state.rowError }) : null, v.state.notice ? _jsx(Notice, { tone: "success", children: v.state.notice }) : null, _jsx(Suspense, { fallback: _jsx(Spinner, { label: m.loading }), children: v.content }), _jsx(UsersConfirmation, {})] }) });
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=UsersPage.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, TextField, Notice } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { useAuthTab } from '../hooks/LoginPage.hooks.js';
|
|
4
|
+
export default function AuthTab(_props = {}, _optional = {}) {
|
|
5
|
+
const v = useAuthTab({});
|
|
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
|
+
}
|
|
8
|
+
//# sourceMappingURL=AuthTab.js.map
|