@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,187 @@
|
|
|
1
|
+
import type { RoleRecord, PolicyRecord, PolicyPermissionRecord } from './models.js';
|
|
2
|
+
export interface RolesCallOptions {
|
|
3
|
+
readonly signal?: AbortSignal;
|
|
4
|
+
}
|
|
5
|
+
export interface RolesApiPort {
|
|
6
|
+
listRoles(required: Record<string, never>, optional?: RolesCallOptions): Promise<{
|
|
7
|
+
roles: RoleRecord[];
|
|
8
|
+
}>;
|
|
9
|
+
listPolicies(required: Record<string, never>, optional?: RolesCallOptions): Promise<{
|
|
10
|
+
policies: PolicyRecord[];
|
|
11
|
+
}>;
|
|
12
|
+
createRole(required: {
|
|
13
|
+
name: string;
|
|
14
|
+
}, optional?: RolesCallOptions): Promise<{
|
|
15
|
+
role: RoleRecord;
|
|
16
|
+
}>;
|
|
17
|
+
updateRole(required: {
|
|
18
|
+
roleId: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}, optional?: RolesCallOptions): Promise<{
|
|
21
|
+
role: RoleRecord;
|
|
22
|
+
}>;
|
|
23
|
+
deleteRole(required: {
|
|
24
|
+
roleId: string;
|
|
25
|
+
}, optional?: RolesCallOptions): Promise<void>;
|
|
26
|
+
createPolicy(required: {
|
|
27
|
+
name: string;
|
|
28
|
+
}, optional?: RolesCallOptions & {
|
|
29
|
+
description?: string;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
policy: PolicyRecord;
|
|
32
|
+
}>;
|
|
33
|
+
updatePolicy(required: {
|
|
34
|
+
policyId: string;
|
|
35
|
+
}, optional?: RolesCallOptions & {
|
|
36
|
+
name?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
policy: PolicyRecord;
|
|
40
|
+
}>;
|
|
41
|
+
deletePolicy(required: {
|
|
42
|
+
policyId: string;
|
|
43
|
+
}, optional?: RolesCallOptions): Promise<void>;
|
|
44
|
+
listPolicyPermissions(required: {
|
|
45
|
+
policyId: string;
|
|
46
|
+
}, optional?: RolesCallOptions): Promise<{
|
|
47
|
+
policyPermissions: PolicyPermissionRecord[];
|
|
48
|
+
}>;
|
|
49
|
+
writePolicyPermission(required: {
|
|
50
|
+
policyId: string;
|
|
51
|
+
permission: string;
|
|
52
|
+
}, optional?: RolesCallOptions & {
|
|
53
|
+
resourceType?: string;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
policyPermission: PolicyPermissionRecord;
|
|
56
|
+
}>;
|
|
57
|
+
removePolicyPermission(required: {
|
|
58
|
+
policyId: string;
|
|
59
|
+
policyPermissionId: string;
|
|
60
|
+
}, optional?: RolesCallOptions): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
/** Transport authenticates and applies a host API prefix. Server authorization is mandatory. */
|
|
63
|
+
export interface RolesHttpTransport {
|
|
64
|
+
request<T>(required: {
|
|
65
|
+
path: string;
|
|
66
|
+
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
67
|
+
body?: Readonly<Record<string, unknown>>;
|
|
68
|
+
}, optional?: RolesCallOptions): Promise<T>;
|
|
69
|
+
}
|
|
70
|
+
export declare class RolesApiError extends Error {
|
|
71
|
+
readonly code: string;
|
|
72
|
+
constructor(required: {
|
|
73
|
+
code: string;
|
|
74
|
+
message: string;
|
|
75
|
+
}, optional?: ErrorOptions);
|
|
76
|
+
}
|
|
77
|
+
export interface UsersApiPort {
|
|
78
|
+
listUsers(required: Record<string, never>, optional?: RolesCallOptions): Promise<{
|
|
79
|
+
users: import('./models.js').AdminOperator[];
|
|
80
|
+
}>;
|
|
81
|
+
listRoles(required: Record<string, never>, optional?: RolesCallOptions): Promise<{
|
|
82
|
+
roles: RoleRecord[];
|
|
83
|
+
}>;
|
|
84
|
+
listPolicies(required: Record<string, never>, optional?: RolesCallOptions): Promise<{
|
|
85
|
+
policies: PolicyRecord[];
|
|
86
|
+
}>;
|
|
87
|
+
me(required: Record<string, never>, optional?: RolesCallOptions): Promise<import('./models.js').CallerInfo>;
|
|
88
|
+
createUser(required: {
|
|
89
|
+
username: string;
|
|
90
|
+
password: string;
|
|
91
|
+
}, optional?: RolesCallOptions & {
|
|
92
|
+
email?: string;
|
|
93
|
+
}): Promise<{
|
|
94
|
+
user: import('./models.js').AdminOperator;
|
|
95
|
+
}>;
|
|
96
|
+
updateUser(required: {
|
|
97
|
+
principalId: string;
|
|
98
|
+
}, optional?: RolesCallOptions & {
|
|
99
|
+
email?: string;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
user: import('./models.js').AdminOperator;
|
|
102
|
+
}>;
|
|
103
|
+
disableUser(required: {
|
|
104
|
+
principalId: string;
|
|
105
|
+
}, optional?: RolesCallOptions): Promise<{
|
|
106
|
+
user: import('./models.js').AdminOperator;
|
|
107
|
+
}>;
|
|
108
|
+
enableUser(required: {
|
|
109
|
+
principalId: string;
|
|
110
|
+
}, optional?: RolesCallOptions): Promise<{
|
|
111
|
+
user: import('./models.js').AdminOperator;
|
|
112
|
+
}>;
|
|
113
|
+
resetUserPassword(required: {
|
|
114
|
+
principalId: string;
|
|
115
|
+
password: string;
|
|
116
|
+
}, optional?: RolesCallOptions): Promise<void>;
|
|
117
|
+
assignRole(required: {
|
|
118
|
+
principalId: string;
|
|
119
|
+
roleId: string;
|
|
120
|
+
}, optional?: RolesCallOptions): Promise<{
|
|
121
|
+
assignment: unknown;
|
|
122
|
+
}>;
|
|
123
|
+
attachPolicy(required: {
|
|
124
|
+
principalId: string;
|
|
125
|
+
policyId: string;
|
|
126
|
+
}, optional?: RolesCallOptions): Promise<{
|
|
127
|
+
attachment: unknown;
|
|
128
|
+
}>;
|
|
129
|
+
deleteUser(required: {
|
|
130
|
+
principalId: string;
|
|
131
|
+
}, optional?: RolesCallOptions): Promise<void>;
|
|
132
|
+
}
|
|
133
|
+
/** Effective wildcard ownership cannot be guessed from a role's display name. The host supplies
|
|
134
|
+
* an authoritative, current classification; missing or unresolved data always denies writes. */
|
|
135
|
+
export interface UsersSafetyPort {
|
|
136
|
+
ownerStatus(required: {
|
|
137
|
+
principalId: string;
|
|
138
|
+
}, optional?: Record<string, never>): 'owner' | 'operator' | 'unknown';
|
|
139
|
+
readonly seededOwnerPrincipalId: string | null;
|
|
140
|
+
}
|
|
141
|
+
export interface MembersApiPort {
|
|
142
|
+
listMembers(required: Record<string, never>, optional?: RolesCallOptions & {
|
|
143
|
+
afterId?: string;
|
|
144
|
+
limit?: number;
|
|
145
|
+
}): Promise<{
|
|
146
|
+
members: import('./models.js').AdminMember[];
|
|
147
|
+
}>;
|
|
148
|
+
getMember(required: {
|
|
149
|
+
id: string;
|
|
150
|
+
}, optional?: RolesCallOptions): Promise<{
|
|
151
|
+
member: import('./models.js').AdminMember;
|
|
152
|
+
}>;
|
|
153
|
+
disableMember(required: {
|
|
154
|
+
id: string;
|
|
155
|
+
}, optional?: RolesCallOptions): Promise<{
|
|
156
|
+
member: import('./models.js').AdminMember;
|
|
157
|
+
}>;
|
|
158
|
+
requestMemberMagicLink(required: {
|
|
159
|
+
email: string;
|
|
160
|
+
}, optional?: RolesCallOptions & {
|
|
161
|
+
redirectPath?: string;
|
|
162
|
+
}): Promise<{
|
|
163
|
+
delivered: true;
|
|
164
|
+
}>;
|
|
165
|
+
}
|
|
166
|
+
/** The host scopes notifications before calling onRefresh, and owns event topic names. */
|
|
167
|
+
export interface MembersRefreshPort {
|
|
168
|
+
subscribe(required: {
|
|
169
|
+
onRefresh: () => void;
|
|
170
|
+
}, optional?: Record<string, never>): () => void;
|
|
171
|
+
}
|
|
172
|
+
export interface AuthApiPort {
|
|
173
|
+
login(required: {
|
|
174
|
+
username: string;
|
|
175
|
+
password: string;
|
|
176
|
+
}, optional?: RolesCallOptions): Promise<{
|
|
177
|
+
user: import('./models.js').AdminAccount;
|
|
178
|
+
}>;
|
|
179
|
+
}
|
|
180
|
+
export declare class PeopleApiError extends Error {
|
|
181
|
+
readonly code: string;
|
|
182
|
+
constructor(required: {
|
|
183
|
+
code: string;
|
|
184
|
+
message: string;
|
|
185
|
+
}, optional?: ErrorOptions);
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class RolesApiError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
constructor(required, optional = {}) {
|
|
4
|
+
super(required.message, optional);
|
|
5
|
+
this.name = 'RolesApiError';
|
|
6
|
+
this.code = required.code;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export class PeopleApiError extends Error {
|
|
10
|
+
code;
|
|
11
|
+
constructor(required, optional = {}) {
|
|
12
|
+
super(required.message, optional);
|
|
13
|
+
this.name = 'PeopleApiError';
|
|
14
|
+
this.code = required.code;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ports.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ConfirmDialogProps } from '@jini-ai/ui-kit/react';
|
|
2
|
+
/** Kept mounted on the shell: closing a row menu must not discard its pending confirmation.
|
|
3
|
+
* Both the frame and its controls are host-overridable through ui-kit. */
|
|
4
|
+
export declare function DestructiveDialog(props: ConfirmDialogProps, _optional?: Record<string, never>): import("react").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=DestructiveDialog.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ConfirmDialog } from '@jini-ai/ui-kit/react';
|
|
3
|
+
/** Kept mounted on the shell: closing a row menu must not discard its pending confirmation.
|
|
4
|
+
* Both the frame and its controls are host-overridable through ui-kit. */
|
|
5
|
+
export function DestructiveDialog(props, _optional = {}) { return _jsx(ConfirmDialog, { ...props }); }
|
|
6
|
+
//# sourceMappingURL=DestructiveDialog.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, Button, Menu, Notice, Spinner } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { useMemberRow } from '../hooks/MembersPage.hooks.js';
|
|
4
|
+
export function MemberRow({ member }, _optional = {}) {
|
|
5
|
+
const v = useMemberRow({ member });
|
|
6
|
+
return _jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { children: _jsx(Button, { onPress: v.toggle, attrs: { 'aria-expanded': v.expanded }, children: member.email }) }), _jsx("td", { children: member.name ?? '—' }), _jsx("td", { children: _jsx(Badge, { children: member.status }) }), _jsx("td", { children: v.created }), _jsxs("td", { children: [v.items.length ? _jsx(Menu, { label: v.menuLabel, items: v.items }) : null, v.rs.error ? _jsx(Notice, { tone: "danger", children: v.rs.error }) : null, v.rs.notice ? _jsx(Notice, { children: v.rs.notice }) : null] })] }), v.expanded ? _jsx("tr", { children: _jsx("td", { colSpan: 5, children: v.loading ? _jsx(Spinner, { label: "Loading detail\u2026" }) : v.s.detailError ? _jsx(Notice, { tone: "danger", children: v.s.detailError }) : v.detail ? _jsxs("dl", { children: [_jsx("dt", { children: "ID" }), _jsx("dd", { children: v.detail.id }), _jsx("dt", { children: "Email verified" }), _jsx("dd", { children: v.verified }), _jsx("dt", { children: "Updated" }), _jsx("dd", { children: v.detail.updatedAt }), _jsx("dt", { children: "Version" }), _jsx("dd", { children: v.detail.version })] }) : null }) }) : null] });
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=MemberRow.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ConfirmDialog } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { useMembersConfirmation } from '../hooks/MembersPage.hooks.js';
|
|
4
|
+
export function MembersConfirmation(_required = {}, _optional = {}) {
|
|
5
|
+
const props = useMembersConfirmation({});
|
|
6
|
+
return _jsx(ConfirmDialog, { ...props });
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=MembersConfirmation.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, TextField, Spinner } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { usePermissionPanel } from '../hooks/PermissionPanel.hooks.js';
|
|
4
|
+
export function PermissionPanel(props, _optional = {}) {
|
|
5
|
+
const v = usePermissionPanel(props);
|
|
6
|
+
return _jsxs("div", { children: [_jsx("h3", { children: "Current permissions" }), v.loading ? _jsx(Spinner, { label: "Loading permissions\u2026" }) : v.empty ? _jsx("p", { children: "No permissions yet." }) :
|
|
7
|
+
_jsx("ul", { children: v.rows.map(row => _jsxs("li", { children: [_jsx("code", { children: row.permission }), row.resourceType ? _jsxs("span", { children: [" (", row.resourceType, ")"] }) : null, v.editable ? _jsx(Button, { onPress: row.requestRemove, pending: row.pending, attrs: { 'aria-label': row.removeLabel }, children: "Remove" }) : null] }, row.id)) }), v.editable ? _jsxs("form", { onSubmit: v.submit, children: [_jsx(TextField, { label: "Permission", value: v.permission, onValueChange: v.changePermission, placeholder: "e.g. content.write" }), _jsx(TextField, { label: "Resource type (optional)", value: v.resourceType, onValueChange: v.changeResourceType }), _jsx(Button, { type: "submit", pending: v.pending, disabled: v.addDisabled, children: "Add" })] }) : null] });
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=PermissionPanel.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, TextField, Menu, Badge } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { usePolicyRow } from '../hooks/PoliciesTab.hooks.js';
|
|
4
|
+
import { PermissionPanel } from './PermissionPanel.js';
|
|
5
|
+
export function PolicyRow(props, _optional = {}) {
|
|
6
|
+
const v = usePolicyRow(props);
|
|
7
|
+
return _jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { children: v.editing ? _jsx(TextField, { label: "Policy new name", value: v.draft, onValueChange: v.changeName }) : v.name }), _jsx("td", { children: v.editing ? _jsx(TextField, { label: "Policy new description", value: v.draftDescription, onValueChange: v.changeDescription }) : v.description }), _jsx("td", { children: _jsx(Badge, { children: v.type }) }), _jsx("td", { children: v.editable ?
|
|
8
|
+
v.editing ? _jsxs(_Fragment, { children: [_jsx(Button, { onPress: v.save, pending: v.pending, disabled: v.saveDisabled, children: "Save" }), _jsx(Button, { onPress: v.cancel, children: "Cancel" })] }) :
|
|
9
|
+
_jsx(Menu, { label: v.menuLabel, items: v.menu }) : _jsx(Button, { onPress: v.viewPermissions, children: v.readLabel }) })] }), v.open ? _jsx("tr", { children: _jsx("td", { colSpan: 4, children: _jsx(PermissionPanel, { policy: props.policy }) }) }) : null] });
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=PolicyRow.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, TextField, Menu, Badge } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { useRoleRow } from '../hooks/RolesTab.hooks.js';
|
|
4
|
+
export function RoleRow(props, _optional = {}) {
|
|
5
|
+
const v = useRoleRow(props);
|
|
6
|
+
return _jsxs("tr", { children: [_jsx("td", { children: v.editing ? _jsx(TextField, { label: "Role new name", value: v.draft, onValueChange: v.changeName }) : v.name }), _jsx("td", { children: _jsx(Badge, { children: v.type }) }), _jsx("td", { children: v.editable ?
|
|
7
|
+
v.editing ? _jsxs(_Fragment, { children: [_jsx(Button, { onPress: v.save, pending: v.pending, disabled: v.saveDisabled, children: "Save" }), _jsx(Button, { onPress: v.cancel, children: "Cancel" })] }) :
|
|
8
|
+
_jsx(Menu, { label: v.menuLabel, items: v.menu }) : _jsx("span", { children: "\u2014" }) })] });
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=RoleRow.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Badge, Menu, TextField, Select, Notice } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { useUserRow } from '../hooks/UsersTab.hooks.js';
|
|
4
|
+
export function UserRow({ user }, _optional = {}) {
|
|
5
|
+
const v = useUserRow({ user });
|
|
6
|
+
return _jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { children: v.canExpand ? _jsx(Button, { onPress: v.toggle, attrs: { 'aria-expanded': v.expanded }, children: user.username }) : user.username }), _jsx("td", { children: user.email ?? '—' }), _jsx("td", { children: _jsx(Badge, { children: user.status }) }), _jsx("td", { children: v.roles }), _jsx("td", { children: v.policies }), _jsx("td", { children: v.items.length ? _jsx(Menu, { label: v.menuLabel, items: v.items, disabled: v.s.confirming || v.s.rowSavingId !== null }) : null })] }), v.expanded ? _jsx("tr", { children: _jsxs("td", { colSpan: 6, children: [v.s.grantError ? _jsx(Notice, { tone: "danger", children: v.s.grantError }) : null, v.canEmail ? _jsxs(_Fragment, { children: [_jsx(TextField, { label: "Email", type: "email", value: v.s.editEmail, onValueChange: v.email }), _jsx(Button, { onPress: v.saveEmail, pending: v.s.grantSaving, children: "Save email" })] }) : null, v.canGrants ? _jsxs(_Fragment, { children: [_jsx(Select, { label: "Assign role", value: v.s.pendingRoleId, onValueChange: v.role, options: v.roleOptions }), _jsx(Button, { onPress: v.assignRole, disabled: !v.s.pendingRoleId, pending: v.s.grantSaving, children: "Assign" }), _jsx(Select, { label: "Attach policy", value: v.s.pendingPolicyId, onValueChange: v.policy, options: v.policyOptions }), _jsx(Button, { onPress: v.attachPolicy, disabled: !v.s.pendingPolicyId, pending: v.s.grantSaving, children: "Attach" })] }) : null] }) }) : null] });
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=UserRow.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Kept mounted independently of row menus. Confirmation and cancellation share ui-kit's guards. */
|
|
2
|
+
export declare function UsersConfirmation(_required?: Record<string, never>, _optional?: Record<string, never>): import("react").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=UsersConfirmation.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ConfirmDialog, TextField, Button, Notice } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { useUsersConfirmation, newPasswordAttrs } from '../hooks/UsersTab.hooks.js';
|
|
4
|
+
/** Kept mounted independently of row menus. Confirmation and cancellation share ui-kit's guards. */
|
|
5
|
+
export function UsersConfirmation(_required = {}, _optional = {}) {
|
|
6
|
+
const v = useUsersConfirmation({});
|
|
7
|
+
return _jsx(ConfirmDialog, { ...v.confirm, body: _jsxs("div", { children: [_jsx("p", { children: v.s.pending?.user.username }), _jsx("p", { children: v.copy.body }), v.reset ? _jsxs(_Fragment, { children: [_jsx(TextField, { label: "New password", type: v.newType, attrs: newPasswordAttrs, value: v.s.newPassword, onValueChange: v.newPassword, disabled: v.s.confirming }), _jsx(Button, { onPress: v.toggleNew, attrs: { 'aria-pressed': v.s.showNewPassword }, children: v.newLabel }), _jsx(TextField, { label: "Confirm new password", type: v.confirmType, attrs: newPasswordAttrs, value: v.s.confirmPassword, onValueChange: v.confirmPassword, disabled: v.s.confirming }), _jsx(Button, { onPress: v.toggleConfirm, attrs: { 'aria-pressed': v.s.showConfirmPassword }, children: v.confirmLabel }), v.error ? _jsx(Notice, { tone: "danger", children: v.error }) : null] }) : null] }) });
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=UsersConfirmation.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ComponentType, LazyExoticComponent, ReactNode } from 'react';
|
|
2
|
+
import type { AdminInstance } from '@jini-ai/admin/core/module';
|
|
3
|
+
import type { AuthApiPort } from '../../ports.js';
|
|
4
|
+
import { authModule } from '../../auth.module.js';
|
|
5
|
+
import type { AdminAccount } from "../../models.js";
|
|
6
|
+
export interface AuthScope {
|
|
7
|
+
readonly api: AuthApiPort;
|
|
8
|
+
readonly permissions: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
export interface AuthPageProps {
|
|
11
|
+
readonly tabs: Readonly<Record<string, LazyExoticComponent<ComponentType<{
|
|
12
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
13
|
+
}>>>>;
|
|
14
|
+
readonly description: ReturnType<AdminInstance['describe']>['pages'][number];
|
|
15
|
+
readonly title?: string;
|
|
16
|
+
readonly initialUsername?: string;
|
|
17
|
+
readonly onLogin: (required: {
|
|
18
|
+
user: AdminAccount;
|
|
19
|
+
}, optional?: Record<string, never>) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function useAuthScope(_required?: Record<string, never>, _optional?: Record<string, never>): AuthScope;
|
|
22
|
+
/** Descriptor identity must be the exact enriched object supplied to createAdmin. */
|
|
23
|
+
export declare function createAuthBinding({ module }: {
|
|
24
|
+
module: typeof authModule;
|
|
25
|
+
}, _optional?: Record<string, never>): {
|
|
26
|
+
pages: {
|
|
27
|
+
auth: {
|
|
28
|
+
Page: LazyExoticComponent<typeof import("../pages/LoginPage.js").default>;
|
|
29
|
+
tabs: {
|
|
30
|
+
auth: LazyExoticComponent<typeof import("../tabs/AuthTab.js").default>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
Provider: ({ admin, children }: {
|
|
35
|
+
admin: AdminInstance;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<AuthScope | null>>;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=AuthBinding.hooks.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createContext, createElement, lazy, useContext } from 'react';
|
|
2
|
+
import { authModule } from '../../auth.module.js';
|
|
3
|
+
const ScopeContext = createContext(null);
|
|
4
|
+
export function useAuthScope(_required = {}, _optional = {}) {
|
|
5
|
+
const scope = useContext(ScopeContext);
|
|
6
|
+
if (!scope)
|
|
7
|
+
throw new Error('Auth admin scope is unavailable.');
|
|
8
|
+
return scope;
|
|
9
|
+
}
|
|
10
|
+
/** Descriptor identity must be the exact enriched object supplied to createAdmin. */
|
|
11
|
+
export function createAuthBinding({ module }, _optional = {}) {
|
|
12
|
+
const pages = { auth: { Page: lazy(() => import('../pages/LoginPage.js')), tabs: { auth: lazy(() => import('../tabs/AuthTab.js')) } } };
|
|
13
|
+
function Provider({ admin, children }, _optional = {}) {
|
|
14
|
+
const ports = admin.scope({ module });
|
|
15
|
+
const description = admin.describe().pages.find(p => p.id === 'auth.auth');
|
|
16
|
+
const value = { api: ports.authApi, permissions: description?.grants ?? [] };
|
|
17
|
+
return createElement(ScopeContext.Provider, { value }, children);
|
|
18
|
+
}
|
|
19
|
+
return { pages, Provider };
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=AuthBinding.hooks.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { FormEvent } from 'react';
|
|
2
|
+
import type { AuthState } from '../../models.js';
|
|
3
|
+
import type { AuthController } from '../../controllers/auth.controller.js';
|
|
4
|
+
import type { AuthPageProps } from './AuthBinding.hooks.js';
|
|
5
|
+
export interface AuthView {
|
|
6
|
+
controller: AuthController;
|
|
7
|
+
state: AuthState;
|
|
8
|
+
}
|
|
9
|
+
export declare const AuthViewContext: import("react").Context<AuthView | null>;
|
|
10
|
+
export declare function useLoginPage(props: AuthPageProps, _optional?: Record<string, never>): {
|
|
11
|
+
content: import("react").FunctionComponentElement<{
|
|
12
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
13
|
+
} | ({
|
|
14
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
15
|
+
} & import("react").RefAttributes<import("react").Component<{
|
|
16
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
17
|
+
}, any, any>>)> | null;
|
|
18
|
+
visible: boolean;
|
|
19
|
+
view: {
|
|
20
|
+
state: AuthState;
|
|
21
|
+
controller: {
|
|
22
|
+
getSnapshot: (_required?: Record<string, never>, _optional?: Record<string, never>) => Readonly<AuthState>;
|
|
23
|
+
subscribe: ({ listener }: {
|
|
24
|
+
listener: () => void;
|
|
25
|
+
}, _optional?: Record<string, never>) => () => void;
|
|
26
|
+
dispose(_required?: Record<string, never>, _optional?: Record<string, never>): void;
|
|
27
|
+
setDraft({ patch }: {
|
|
28
|
+
patch: Pick<Partial<AuthState>, "username" | "password">;
|
|
29
|
+
}, _optional?: Record<string, never>): void;
|
|
30
|
+
submit(_required: Record<string, never>, _optional?: Record<string, never>): Promise<boolean>;
|
|
31
|
+
};
|
|
32
|
+
} | null;
|
|
33
|
+
title: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function useAuthTab(_required?: Record<string, never>, _optional?: Record<string, never>): {
|
|
36
|
+
s: AuthState;
|
|
37
|
+
username: ({ value }: {
|
|
38
|
+
value: string;
|
|
39
|
+
}) => void;
|
|
40
|
+
password: ({ value }: {
|
|
41
|
+
value: string;
|
|
42
|
+
}) => void;
|
|
43
|
+
submit: (e: FormEvent) => void;
|
|
44
|
+
submitLabel: string;
|
|
45
|
+
usernameAttrs: {
|
|
46
|
+
autoComplete: string;
|
|
47
|
+
'data-jini-part': string;
|
|
48
|
+
};
|
|
49
|
+
passwordAttrs: {
|
|
50
|
+
autoComplete: string;
|
|
51
|
+
'data-jini-part': string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=LoginPage.hooks.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createElement, createContext, useContext, useMemo } from 'react';
|
|
2
|
+
import { createAuthController } from '../../controllers/auth.controller.js';
|
|
3
|
+
import { useAuthScope } from './AuthBinding.hooks.js';
|
|
4
|
+
import { usePeopleController } from './PeopleController.hooks.js';
|
|
5
|
+
export const AuthViewContext = createContext(null);
|
|
6
|
+
export function useLoginPage(props, _optional = {}) {
|
|
7
|
+
const { api } = useAuthScope({});
|
|
8
|
+
const scope = useMemo(() => ({ api, onLogin: props.onLogin }), [api, props.onLogin]);
|
|
9
|
+
const { controller, state } = usePeopleController({ scope, key: props.initialUsername ?? 'admin',
|
|
10
|
+
create: () => createAuthController({ api, onLogin: props.onLogin }, { ...(props.initialUsername !== undefined ? { initialUsername: props.initialUsername } : {}) }), start: () => { },
|
|
11
|
+
});
|
|
12
|
+
return { content: props.tabs.auth ? createElement(props.tabs.auth, {}) : null, visible: props.description.visible && props.description.tabs.some(t => t.visible), view: state && controller ? { state, controller } : null, title: props.title ?? 'Sign in to your workspace' };
|
|
13
|
+
}
|
|
14
|
+
export function useAuthTab(_required = {}, _optional = {}) {
|
|
15
|
+
const v = useContext(AuthViewContext);
|
|
16
|
+
if (!v)
|
|
17
|
+
throw new Error('Login controller unavailable.');
|
|
18
|
+
const { state: s, controller: c } = v;
|
|
19
|
+
return { s, username: ({ value }) => c.setDraft({ patch: { username: value } }), password: ({ value }) => c.setDraft({ patch: { password: value } }),
|
|
20
|
+
submit: (e) => { e.preventDefault(); void c.submit({}); }, submitLabel: s.busy ? 'Signing in…' : 'Sign in',
|
|
21
|
+
usernameAttrs: { autoComplete: 'username', 'data-jini-part': 'username' }, passwordAttrs: { autoComplete: 'current-password', 'data-jini-part': 'password' } };
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=LoginPage.hooks.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComponentType, LazyExoticComponent, ReactNode } from 'react';
|
|
2
|
+
import type { AdminInstance } from '@jini-ai/admin/core/module';
|
|
3
|
+
import type { MembersApiPort } from '../../ports.js';
|
|
4
|
+
import { membersModule } from '../../members.module.js';
|
|
5
|
+
import type { MembersRefreshPort } from "../../ports.js";
|
|
6
|
+
export interface MembersScope {
|
|
7
|
+
readonly api: MembersApiPort;
|
|
8
|
+
readonly permissions: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
export interface MembersPageProps {
|
|
11
|
+
readonly tabs: Readonly<Record<string, LazyExoticComponent<ComponentType<{
|
|
12
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
13
|
+
}>>>>;
|
|
14
|
+
readonly description: ReturnType<AdminInstance['describe']>['pages'][number];
|
|
15
|
+
readonly refresh?: MembersRefreshPort;
|
|
16
|
+
}
|
|
17
|
+
export declare function useMembersScope(_required?: Record<string, never>, _optional?: Record<string, never>): MembersScope;
|
|
18
|
+
/** Descriptor identity must be the exact enriched object supplied to createAdmin. */
|
|
19
|
+
export declare function createMembersBinding({ module }: {
|
|
20
|
+
module: typeof membersModule;
|
|
21
|
+
}, _optional?: Record<string, never>): {
|
|
22
|
+
pages: {
|
|
23
|
+
members: {
|
|
24
|
+
Page: LazyExoticComponent<typeof import("../pages/MembersPage.js").default>;
|
|
25
|
+
tabs: {
|
|
26
|
+
members: LazyExoticComponent<typeof import("../tabs/MembersTab.js").default>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
Provider: ({ admin, children }: {
|
|
31
|
+
admin: AdminInstance;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<MembersScope | null>>;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=MembersBinding.hooks.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createContext, createElement, lazy, useContext } from 'react';
|
|
2
|
+
import { membersModule } from '../../members.module.js';
|
|
3
|
+
const ScopeContext = createContext(null);
|
|
4
|
+
export function useMembersScope(_required = {}, _optional = {}) {
|
|
5
|
+
const scope = useContext(ScopeContext);
|
|
6
|
+
if (!scope)
|
|
7
|
+
throw new Error('Members admin scope is unavailable.');
|
|
8
|
+
return scope;
|
|
9
|
+
}
|
|
10
|
+
/** Descriptor identity must be the exact enriched object supplied to createAdmin. */
|
|
11
|
+
export function createMembersBinding({ module }, _optional = {}) {
|
|
12
|
+
const pages = { members: { Page: lazy(() => import('../pages/MembersPage.js')), tabs: { members: lazy(() => import('../tabs/MembersTab.js')) } } };
|
|
13
|
+
function Provider({ admin, children }, _optional = {}) {
|
|
14
|
+
const ports = admin.scope({ module });
|
|
15
|
+
const description = admin.describe().pages.find(p => p.id === 'members.members');
|
|
16
|
+
const value = { api: ports.membersApi, permissions: description?.grants ?? [] };
|
|
17
|
+
return createElement(ScopeContext.Provider, { value }, children);
|
|
18
|
+
}
|
|
19
|
+
return { pages, Provider };
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=MembersBinding.hooks.js.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { MembersState, AdminMember } from '../../models.js';
|
|
2
|
+
import type { MembersController } from '../../controllers/members.controller.js';
|
|
3
|
+
import type { MenuItem } from '@jini-ai/ui-kit/react';
|
|
4
|
+
import type { MembersPageProps } from './MembersBinding.hooks.js';
|
|
5
|
+
export interface MembersView {
|
|
6
|
+
controller: MembersController;
|
|
7
|
+
state: MembersState;
|
|
8
|
+
canManage: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const MembersViewContext: import("react").Context<MembersView | null>;
|
|
11
|
+
export declare function useMembersView(_required?: Record<string, never>, _optional?: Record<string, never>): MembersView;
|
|
12
|
+
export declare function useMembersPage(props: MembersPageProps, _optional?: Record<string, never>): {
|
|
13
|
+
content: import("react").FunctionComponentElement<{
|
|
14
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
15
|
+
} | ({
|
|
16
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
17
|
+
} & import("react").RefAttributes<import("react").Component<{
|
|
18
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
19
|
+
}, any, any>>)> | null;
|
|
20
|
+
state: MembersState | null;
|
|
21
|
+
controller: {
|
|
22
|
+
getSnapshot: (_required?: Record<string, never>, _optional?: Record<string, never>) => Readonly<MembersState>;
|
|
23
|
+
subscribe: ({ listener }: {
|
|
24
|
+
listener: () => void;
|
|
25
|
+
}, _optional?: Record<string, never>) => () => void;
|
|
26
|
+
load: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<void>;
|
|
27
|
+
stateFor: ({ id }: {
|
|
28
|
+
id: string;
|
|
29
|
+
}, _optional?: Record<string, never>) => import("../../models.js").MemberRowState;
|
|
30
|
+
toggleDetail: ({ id }: {
|
|
31
|
+
id: string;
|
|
32
|
+
}, _optional?: Record<string, never>) => Promise<void>;
|
|
33
|
+
resendSignInLink: ({ id }: {
|
|
34
|
+
id: string;
|
|
35
|
+
}, _optional?: Record<string, never>) => Promise<boolean>;
|
|
36
|
+
confirmDestructive: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<boolean>;
|
|
37
|
+
requestDestructive({ id }: {
|
|
38
|
+
id: string;
|
|
39
|
+
}, _optional?: Record<string, never>): void;
|
|
40
|
+
cancelDestructive(_required: Record<string, never>, _optional?: Record<string, never>): void;
|
|
41
|
+
dispose(_required?: Record<string, never>, _optional?: Record<string, never>): void;
|
|
42
|
+
} | null;
|
|
43
|
+
canManage: boolean;
|
|
44
|
+
visible: boolean;
|
|
45
|
+
view: {
|
|
46
|
+
state: MembersState;
|
|
47
|
+
controller: {
|
|
48
|
+
getSnapshot: (_required?: Record<string, never>, _optional?: Record<string, never>) => Readonly<MembersState>;
|
|
49
|
+
subscribe: ({ listener }: {
|
|
50
|
+
listener: () => void;
|
|
51
|
+
}, _optional?: Record<string, never>) => () => void;
|
|
52
|
+
load: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<void>;
|
|
53
|
+
stateFor: ({ id }: {
|
|
54
|
+
id: string;
|
|
55
|
+
}, _optional?: Record<string, never>) => import("../../models.js").MemberRowState;
|
|
56
|
+
toggleDetail: ({ id }: {
|
|
57
|
+
id: string;
|
|
58
|
+
}, _optional?: Record<string, never>) => Promise<void>;
|
|
59
|
+
resendSignInLink: ({ id }: {
|
|
60
|
+
id: string;
|
|
61
|
+
}, _optional?: Record<string, never>) => Promise<boolean>;
|
|
62
|
+
confirmDestructive: (_required: Record<string, never>, _optional?: Record<string, never>) => Promise<boolean>;
|
|
63
|
+
requestDestructive({ id }: {
|
|
64
|
+
id: string;
|
|
65
|
+
}, _optional?: Record<string, never>): void;
|
|
66
|
+
cancelDestructive(_required: Record<string, never>, _optional?: Record<string, never>): void;
|
|
67
|
+
dispose(_required?: Record<string, never>, _optional?: Record<string, never>): void;
|
|
68
|
+
};
|
|
69
|
+
canManage: boolean;
|
|
70
|
+
} | null;
|
|
71
|
+
retry: () => void;
|
|
72
|
+
};
|
|
73
|
+
export declare function useMemberRow({ member }: {
|
|
74
|
+
member: AdminMember;
|
|
75
|
+
}, _optional?: Record<string, never>): {
|
|
76
|
+
s: MembersState;
|
|
77
|
+
rs: import("../../models.js").MemberRowState;
|
|
78
|
+
items: MenuItem[];
|
|
79
|
+
menuLabel: string;
|
|
80
|
+
expanded: boolean;
|
|
81
|
+
detail: AdminMember | undefined;
|
|
82
|
+
loading: boolean;
|
|
83
|
+
toggle: () => void;
|
|
84
|
+
verified: string;
|
|
85
|
+
created: string;
|
|
86
|
+
};
|
|
87
|
+
export declare function useMembersConfirmation(_required?: Record<string, never>, _optional?: Record<string, never>): {
|
|
88
|
+
open: boolean;
|
|
89
|
+
title: string;
|
|
90
|
+
body: string;
|
|
91
|
+
confirmLabel: string;
|
|
92
|
+
tone: "warning";
|
|
93
|
+
consequence: string;
|
|
94
|
+
pending: boolean;
|
|
95
|
+
agentMayConfirm: boolean;
|
|
96
|
+
onConfirm: () => Promise<void>;
|
|
97
|
+
onCancel: () => void;
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=MembersPage.hooks.d.ts.map
|